refactor(core): Allow custom types on getCredentials (no-changelog) (#10567)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-08-27 15:23:58 +02:00
committed by GitHub
parent 52c574d83f
commit be52176585
65 changed files with 132 additions and 123 deletions

View File

@@ -111,7 +111,7 @@ export class Baserow implements INodeType {
methods = {
loadOptions: {
async getDatabaseIds(this: ILoadOptionsFunctions) {
const credentials = (await this.getCredentials('baserowApi')) as BaserowCredentials;
const credentials = await this.getCredentials<BaserowCredentials>('baserowApi');
const jwtToken = await getJwtToken.call(this, credentials);
const endpoint = '/api/applications/';
const databases = (await baserowApiRequest.call(
@@ -124,7 +124,7 @@ export class Baserow implements INodeType {
},
async getTableIds(this: ILoadOptionsFunctions) {
const credentials = (await this.getCredentials('baserowApi')) as BaserowCredentials;
const credentials = await this.getCredentials<BaserowCredentials>('baserowApi');
const jwtToken = await getJwtToken.call(this, credentials);
const databaseId = this.getNodeParameter('databaseId', 0) as string;
const endpoint = `/api/database/tables/database/${databaseId}/`;
@@ -138,7 +138,7 @@ export class Baserow implements INodeType {
},
async getTableFields(this: ILoadOptionsFunctions) {
const credentials = (await this.getCredentials('baserowApi')) as BaserowCredentials;
const credentials = await this.getCredentials<BaserowCredentials>('baserowApi');
const jwtToken = await getJwtToken.call(this, credentials);
const tableId = this.getNodeParameter('tableId', 0) as string;
const endpoint = `/api/database/fields/table/${tableId}/`;
@@ -160,7 +160,7 @@ export class Baserow implements INodeType {
const operation = this.getNodeParameter('operation', 0) as Operation;
const tableId = this.getNodeParameter('tableId', 0) as string;
const credentials = (await this.getCredentials('baserowApi')) as BaserowCredentials;
const credentials = await this.getCredentials<BaserowCredentials>('baserowApi');
const jwtToken = await getJwtToken.call(this, credentials);
const fields = await mapper.getTableFields.call(this, tableId, jwtToken);
mapper.createMappings(fields);