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

@@ -1,6 +1,6 @@
import type { IExecuteFunctions, IHookFunctions } from 'n8n-core';
import type { IDataObject, ILoadOptionsFunctions } from 'n8n-workflow';
import type { IDataObject, ILoadOptionsFunctions, JsonObject } from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
import type {
@@ -54,19 +54,19 @@ export async function freshserviceApiRequest(
if (numberOfErrors === 1) {
const [validationError] = error.error.errors;
throw new NodeApiError(this.getNode(), error, {
throw new NodeApiError(this.getNode(), error as JsonObject, {
message,
description: `For ${validationError.field}: ${validationError.message}`,
});
} else if (numberOfErrors > 1) {
throw new NodeApiError(this.getNode(), error, {
throw new NodeApiError(this.getNode(), error as JsonObject, {
message,
description: "For more information, expand 'details' below and look at 'cause' section",
});
}
}
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
@@ -83,10 +83,10 @@ export async function freshserviceApiRequestAllItems(
do {
const responseData = await freshserviceApiRequest.call(this, method, endpoint, body, qs);
const key = Object.keys(responseData)[0];
const key = Object.keys(responseData as IDataObject)[0];
items = responseData[key];
if (!items.length) return returnData;
returnData.push(...items);
returnData.push(...(items as IDataObject[]));
qs.page++;
} while (items.length >= 30);