File tree Expand file tree Collapse file tree 2 files changed +62
-0
lines changed Expand file tree Collapse file tree 2 files changed +62
-0
lines changed Original file line number Diff line number Diff line change @@ -2034,4 +2034,39 @@ describe('AppClient tests', () => {
2034
2034
} ) ;
2035
2035
} ) ;
2036
2036
} ) ;
2037
+
2038
+ describe ( 'getAppBranding tests' , ( ) => {
2039
+ beforeEach ( ( ) => {
2040
+ mockTransport = createRouterTransport ( ( { service } ) => {
2041
+ service ( AppService , {
2042
+ getAppBranding : ( ) =>
2043
+ new pb . GetAppBrandingResponse ( {
2044
+ logoPath : '/branding/logo.png' ,
2045
+ textCustomizations : {
2046
+ machinePicker : new pb . TextOverrides ( {
2047
+ fields : {
2048
+ heading : 'Welcome' ,
2049
+ subheading : 'Select your machine.' ,
2050
+ } ,
2051
+ } ) ,
2052
+ } ,
2053
+ } ) ,
2054
+ } ) ;
2055
+ } ) ;
2056
+ } ) ;
2057
+
2058
+ it ( 'getAppBranding' , async ( ) => {
2059
+ const response = await subject ( ) . getAppBranding (
2060
+ 'publicNamespace' ,
2061
+ 'appName'
2062
+ ) ;
2063
+ expect ( response . logoPath ) . toEqual ( '/branding/logo.png' ) ;
2064
+ expect ( response . textCustomizations . machinePicker ! . fields . heading ) . toEqual (
2065
+ 'Welcome'
2066
+ ) ;
2067
+ expect (
2068
+ response . textCustomizations . machinePicker ! . fields . subheading
2069
+ ) . toEqual ( 'Select your machine.' ) ;
2070
+ } ) ;
2071
+ } ) ;
2037
2072
} ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
13
13
Fragment ,
14
14
FragmentVisibility ,
15
15
GetAppContentResponse ,
16
+ GetAppBrandingResponse ,
16
17
GetRobotPartLogsResponse ,
17
18
GetRobotPartResponse ,
18
19
GetRobotPartByNameAndLocationResponse ,
@@ -2213,4 +2214,30 @@ export class AppClient {
2213
2214
data : Struct . fromJson ( data ) ,
2214
2215
} ) ;
2215
2216
}
2217
+
2218
+ /**
2219
+ * Retrieves the app branding for an organization/app.
2220
+ *
2221
+ * @example
2222
+ *
2223
+ * ```ts
2224
+ * const branding = await appClient.getAppBranding(
2225
+ * '<YOUR-PUBLIC-NAMESPACE>',
2226
+ * '<YOUR-APP-NAME>'
2227
+ * );
2228
+ * ```
2229
+ *
2230
+ * For more information, see [App
2231
+ * API](https://docs.viam.com/dev/reference/apis/fleet/#getappbranding).
2232
+ *
2233
+ * @param publicNamespace The public namespace of the organization
2234
+ * @param name The name of the app
2235
+ * @returns The branding information for the app
2236
+ */
2237
+ async getAppBranding (
2238
+ publicNamespace : string ,
2239
+ name : string
2240
+ ) : Promise < GetAppBrandingResponse > {
2241
+ return this . client . getAppBranding ( { publicNamespace, name } ) ;
2242
+ }
2216
2243
}
You can’t perform that action at this time.
0 commit comments