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

@@ -6,6 +6,7 @@ import type {
INodePropertyOptions,
INodeType,
INodeTypeDescription,
JsonObject,
} from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
import { leadFields, leadOperations } from './LeadDescription';
@@ -82,7 +83,7 @@ export class Intercom implements INodeType {
try {
response = await intercomApiRequest.call(this, '/companies', 'GET');
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
const companies = response.companies;
for (const company of companies) {
@@ -201,7 +202,7 @@ export class Intercom implements INodeType {
try {
responseData = await intercomApiRequest.call(this, '/contacts', 'POST', body);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
if (operation === 'get') {
@@ -224,7 +225,7 @@ export class Intercom implements INodeType {
responseData = responseData.contacts;
}
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
if (operation === 'getAll') {
@@ -248,7 +249,7 @@ export class Intercom implements INodeType {
responseData = responseData.contacts;
}
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
if (operation === 'delete') {
@@ -262,7 +263,7 @@ export class Intercom implements INodeType {
responseData = await intercomApiRequest.call(this, '/contacts', 'DELETE', {}, qs);
}
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
}
@@ -377,7 +378,7 @@ export class Intercom implements INodeType {
try {
responseData = await intercomApiRequest.call(this, '/users', 'POST', body, qs);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
if (operation === 'get') {
@@ -399,7 +400,7 @@ export class Intercom implements INodeType {
responseData = await intercomApiRequest.call(this, '/users', 'GET', {}, qs);
}
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
if (operation === 'getAll') {
@@ -423,7 +424,7 @@ export class Intercom implements INodeType {
responseData = responseData.users;
}
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
if (operation === 'delete') {
@@ -614,7 +615,7 @@ export class Intercom implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);