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

@@ -149,11 +149,11 @@ export class Box implements INodeType {
items[i] = newItem;
const data = Buffer.from(responseData.body);
const data = Buffer.from(responseData.body as string);
items[i].binary![dataPropertyNameDownload] = await this.helpers.prepareBinaryData(
data as unknown as Buffer,
fileName,
fileName as string,
mimeType,
);
}
@@ -524,7 +524,7 @@ export class Box implements INodeType {
}
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject[]),
{ itemData: { item: i } },
);
returnData.push(...executionData);

View File

@@ -7,7 +7,7 @@ import type {
ILoadOptionsFunctions,
} from 'n8n-core';
import type { IDataObject, IOAuth2Options } from 'n8n-workflow';
import type { IDataObject, IOAuth2Options, JsonObject } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
export async function boxApiRequest(
@@ -33,7 +33,7 @@ export async function boxApiRequest(
options = Object.assign({}, options, option);
try {
if (Object.keys(body).length === 0) {
if (Object.keys(body as IDataObject).length === 0) {
delete options.body;
}
@@ -44,7 +44,7 @@ export async function boxApiRequest(
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'boxOAuth2Api', options, oAuth2Options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
@@ -65,7 +65,7 @@ export async function boxApiRequestAllItems(
do {
responseData = await boxApiRequest.call(this, method, endpoint, body, query);
query.offset = (responseData.offset as number) + query.limit;
returnData.push.apply(returnData, responseData[propertyName]);
returnData.push.apply(returnData, responseData[propertyName] as IDataObject[]);
} while (responseData[propertyName].length !== 0);
return returnData;