fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)

This commit is contained in:
Michael Kret
2023-02-28 05:39:43 +02:00
committed by GitHub
parent 3172ea376e
commit bb4db58819
560 changed files with 2227 additions and 1919 deletions

View File

@@ -8,7 +8,7 @@ import type {
IWebhookFunctions,
} from 'n8n-core';
import type { ICredentialDataDecryptedObject, IDataObject } from 'n8n-workflow';
import type { ICredentialDataDecryptedObject, IDataObject, JsonObject } from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
import { createHash } from 'crypto';
@@ -44,7 +44,7 @@ export async function getAuthorization(
return response.auth_token;
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
@@ -90,7 +90,7 @@ export async function taigaApiRequest(
try {
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
@@ -99,7 +99,7 @@ export async function taigaApiRequestAllItems(
method: string,
resource: string,
body: any = {},
body: IDataObject = {},
query: IDataObject = {},
): Promise<any> {
const returnData: IDataObject[] = [];
@@ -112,7 +112,7 @@ export async function taigaApiRequestAllItems(
responseData = await taigaApiRequest.call(this, method, resource, body, query, uri, {
resolveWithFullResponse: true,
});
returnData.push.apply(returnData, responseData.body);
returnData.push.apply(returnData, responseData.body as IDataObject[]);
uri = responseData.headers['x-pagination-next'];
if (query.limit && returnData.length >= query.limit) {
return returnData;