Skip to content

Commit 7aa1145

Browse files
committed
get rid of eslint warnings
1 parent e1084ef commit 7aa1145

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/DataSource.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

src/backend/rest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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';

0 commit comments

Comments
 (0)