Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/app/app-client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2034,4 +2034,39 @@ describe('AppClient tests', () => {
});
});
});

describe('getAppBranding tests', () => {
beforeEach(() => {
mockTransport = createRouterTransport(({ service }) => {
service(AppService, {
getAppBranding: () =>
new pb.GetAppBrandingResponse({
logoPath: '/branding/logo.png',
textCustomizations: {
machinePicker: new pb.TextOverrides({
fields: {
heading: 'Welcome',
subheading: 'Select your machine.',
},
}),
},
}),
});
});
});

it('getAppBranding', async () => {
const response = await subject().getAppBranding(
'publicNamespace',
'appName'
);
expect(response.logoPath).toEqual('/branding/logo.png');
expect(response.textCustomizations.machinePicker!.fields.heading).toEqual(
'Welcome'
);
expect(
response.textCustomizations.machinePicker!.fields.subheading
).toEqual('Select your machine.');
});
});
});
27 changes: 27 additions & 0 deletions src/app/app-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Fragment,
FragmentVisibility,
GetAppContentResponse,
GetAppBrandingResponse,
GetRobotPartLogsResponse,
GetRobotPartResponse,
GetRobotPartByNameAndLocationResponse,
Expand Down Expand Up @@ -2213,4 +2214,30 @@ export class AppClient {
data: Struct.fromJson(data),
});
}

/**
* Retrieves the app branding for an organization/app.
*
* @example
*
* ```ts
* const branding = await appClient.getAppBranding(
* '<YOUR-PUBLIC-NAMESPACE>',
* '<YOUR-APP-NAME>'
* );
* ```
*
* For more information, see [App
* API](https://docs.viam.com/dev/reference/apis/fleet/#getappbranding).
*
* @param publicNamespace The public namespace of the organization
* @param name The name of the app
* @returns The branding information for the app
*/
async getAppBranding(
publicNamespace: string,
name: string
): Promise<GetAppBrandingResponse> {
return this.client.getAppBranding({ publicNamespace, name });
}
}