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

@@ -4,6 +4,7 @@ import type {
INodeExecutionData,
INodeType,
INodeTypeDescription,
JsonObject,
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
import { flowApiRequest, FlowApiRequestAllItems } from './GenericFunctions';
@@ -124,7 +125,7 @@ export class Flow implements INodeType {
responseData = await flowApiRequest.call(this, 'POST', '/tasks', body);
responseData = responseData.task;
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
//https://developer.getflow.com/api/#tasks_update-a-task
@@ -192,7 +193,7 @@ export class Flow implements INodeType {
responseData = await flowApiRequest.call(this, 'PUT', `/tasks/${taskId}`, body);
responseData = responseData.task;
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
//https://developer.getflow.com/api/#tasks_get-task
@@ -206,7 +207,7 @@ export class Flow implements INodeType {
try {
responseData = await flowApiRequest.call(this, 'GET', `/tasks/${taskId}`, {}, qs);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
//https://developer.getflow.com/api/#tasks_get-tasks
@@ -257,13 +258,13 @@ export class Flow implements INodeType {
responseData = responseData.tasks;
}
} catch (error) {
throw new NodeApiError(this.getNode(), error, { itemIndex: i });
throw new NodeApiError(this.getNode(), error as JsonObject, { itemIndex: i });
}
}
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject[]),
{ itemData: { item: i } },
);
returnData.push(...executionData);