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

@@ -10,7 +10,7 @@ import type {
IWebhookFunctions,
} from 'n8n-core';
import type { ICredentialDataDecryptedObject, IDataObject } from 'n8n-workflow';
import type { ICredentialDataDecryptedObject, IDataObject, JsonObject } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
import flow from 'lodash.flow';
@@ -62,14 +62,14 @@ export async function copperApiRequest(
delete options.qs;
}
if (Object.keys(options.body).length === 0) {
if (Object.keys(options.body as IDataObject).length === 0) {
delete options.body;
}
try {
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
@@ -167,7 +167,7 @@ export async function copperApiRequestAllItems(
do {
responseData = await copperApiRequest.call(this, method, resource, body, qs, uri, option);
totalItems = responseData.headers['x-pw-total'];
returnData.push(...responseData.body);
returnData.push(...(responseData.body as IDataObject[]));
} while (totalItems > returnData.length);
return returnData;