mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)
This commit is contained in:
@@ -34,5 +34,5 @@ export async function createContact(
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
return this.helpers.returnJsonArray(responseData);
|
||||
return this.helpers.returnJsonArray(responseData as IDataObject);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ export async function deleteContact(
|
||||
const body = {} as IDataObject;
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData);
|
||||
return this.helpers.returnJsonArray(responseData as IDataObject);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ export async function getContact(
|
||||
const body = {} as IDataObject;
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData);
|
||||
return this.helpers.returnJsonArray(responseData as IDataObject);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,6 @@ export async function getAll(
|
||||
} else {
|
||||
const limit = this.getNodeParameter('limit', index);
|
||||
responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData.contacts.splice(0, limit));
|
||||
return this.helpers.returnJsonArray(responseData.contacts.splice(0, limit) as IDataObject[]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,5 +37,5 @@ export async function updateContact(
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
return this.helpers.returnJsonArray(responseData);
|
||||
return this.helpers.returnJsonArray(responseData as IDataObject);
|
||||
}
|
||||
|
||||
@@ -51,5 +51,5 @@ export async function addCustomer(
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
return this.helpers.returnJsonArray(responseData.customer);
|
||||
return this.helpers.returnJsonArray(responseData.customer as IDataObject);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ export async function deleteCustomer(
|
||||
const body = {} as IDataObject;
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData);
|
||||
return this.helpers.returnJsonArray(responseData as IDataObject[]);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ export async function getCustomer(
|
||||
const body = {} as IDataObject;
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData.customer);
|
||||
return this.helpers.returnJsonArray(responseData.customer as IDataObject);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,6 @@ export async function getAll(
|
||||
return this.helpers.returnJsonArray(responseData);
|
||||
} else {
|
||||
responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData.customers);
|
||||
return this.helpers.returnJsonArray(responseData.customers as IDataObject[]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import type { IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||
import type { IDataObject, INodeExecutionData, JsonObject } from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
import { apiRequest } from '../../../transport';
|
||||
@@ -53,10 +53,10 @@ export async function updateCustomer(
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
if (!responseData.customer) {
|
||||
throw new NodeApiError(this.getNode(), responseData, {
|
||||
throw new NodeApiError(this.getNode(), responseData as JsonObject, {
|
||||
httpCode: '404',
|
||||
message: 'Customer ID not found',
|
||||
});
|
||||
}
|
||||
return this.helpers.returnJsonArray(responseData.customer);
|
||||
return this.helpers.returnJsonArray(responseData.customer as IDataObject[]);
|
||||
}
|
||||
|
||||
@@ -28,5 +28,5 @@ export async function addAlert(
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
return this.helpers.returnJsonArray(responseData.alert);
|
||||
return this.helpers.returnJsonArray(responseData.alert as IDataObject);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ export async function deleteAlert(
|
||||
const body = {} as IDataObject;
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData);
|
||||
return this.helpers.returnJsonArray(responseData as IDataObject[]);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ export async function getAlert(
|
||||
const body = {} as IDataObject;
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData.rmm_alert);
|
||||
return this.helpers.returnJsonArray(responseData.rmm_alert as IDataObject[]);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,6 @@ export async function getAll(
|
||||
return this.helpers.returnJsonArray(responseData);
|
||||
} else {
|
||||
responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData.rmm_alerts);
|
||||
return this.helpers.returnJsonArray(responseData.rmm_alerts as IDataObject[]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,5 +20,5 @@ export async function muteAlert(
|
||||
body.mute_for = mute;
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData);
|
||||
return this.helpers.returnJsonArray(responseData as IDataObject[]);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import type { INodeExecutionData } from 'n8n-workflow';
|
||||
import type { INodeExecutionData, JsonObject } from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
import * as customer from './customer';
|
||||
@@ -51,7 +51,7 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
|
||||
);
|
||||
operationResult.push(...executionErrorData);
|
||||
} else {
|
||||
throw new NodeApiError(this.getNode(), err, { itemIndex: i });
|
||||
throw new NodeApiError(this.getNode(), err as JsonObject, { itemIndex: i });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,5 +33,5 @@ export async function createTicket(
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
return this.helpers.returnJsonArray(responseData.ticket);
|
||||
return this.helpers.returnJsonArray(responseData.ticket as IDataObject[]);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ export async function deleteTicket(
|
||||
const body = {} as IDataObject;
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData);
|
||||
return this.helpers.returnJsonArray(responseData as IDataObject[]);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ export async function getTicket(
|
||||
const body = {} as IDataObject;
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData.ticket);
|
||||
return this.helpers.returnJsonArray(responseData.ticket as IDataObject[]);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,6 @@ export async function getAll(
|
||||
return this.helpers.returnJsonArray(responseData);
|
||||
} else {
|
||||
responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData.tickets);
|
||||
return this.helpers.returnJsonArray(responseData.tickets as IDataObject[]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,5 +37,5 @@ export async function updateTicket(
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
return this.helpers.returnJsonArray(responseData.ticket);
|
||||
return this.helpers.returnJsonArray(responseData.ticket as IDataObject[]);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import type {
|
||||
ICredentialTestFunctions,
|
||||
IDataObject,
|
||||
IHttpRequestOptions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
@@ -34,7 +35,7 @@ export async function apiRequest(
|
||||
try {
|
||||
return await this.helpers.httpRequest(options);
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +54,7 @@ export async function apiRequestAllItems(
|
||||
do {
|
||||
responseData = await apiRequest.call(this, method, endpoint, body, query);
|
||||
query.page++;
|
||||
returnData = returnData.concat(responseData[endpoint]);
|
||||
returnData = returnData.concat(responseData[endpoint] as IDataObject[]);
|
||||
} while (responseData[endpoint].length !== 0);
|
||||
return returnData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user