File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,10 @@ export class DataSource extends DataSourceApi<CmkQuery> {
9494 }
9595
9696 getUsername ( ) : string {
97- return this . instanceSettings . jsonData . username ! ;
97+ const username = this . instanceSettings . jsonData . username ;
98+ if ( typeof username === 'string' ) {
99+ return username ;
100+ }
101+ throw Error ( 'Impossible' ) ;
98102 }
99103}
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ export default class RestApiBackend implements Backend {
101101 }
102102
103103 async isAutomationUser ( username : string ) : Promise < boolean > {
104- const response = await this . api < any > ( {
104+ const response = await this . api < { extensions : { auth_option : { auth_type : string } } } > ( {
105105 url : `/objects/user_config/${ username } ` ,
106106 } ) ;
107107 return response . data [ 'extensions' ] [ 'auth_option' ] [ 'auth_type' ] === 'automation' ;
You can’t perform that action at this time.
0 commit comments