fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)
This commit is contained in:
@@ -2,7 +2,7 @@ import type { OptionsWithUri } from 'request';
|
||||
|
||||
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';
|
||||
|
||||
/**
|
||||
@@ -56,7 +56,7 @@ export async function githubApiRequest(
|
||||
|
||||
return await this.helpers.requestWithAuthentication.call(this, credentialType, options);
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,11 +101,11 @@ export async function githubApiRequestAllItems(
|
||||
query.page = 1;
|
||||
|
||||
do {
|
||||
responseData = await githubApiRequest.call(this, method, endpoint, body, query, {
|
||||
responseData = await githubApiRequest.call(this, method, endpoint, body as IDataObject, query, {
|
||||
resolveWithFullResponse: true,
|
||||
});
|
||||
query.page++;
|
||||
returnData.push.apply(returnData, responseData.body);
|
||||
returnData.push.apply(returnData, responseData.body as IDataObject[]);
|
||||
} while (responseData.headers.link?.includes('next'));
|
||||
return returnData;
|
||||
}
|
||||
|
||||
@@ -2250,7 +2250,7 @@ export class Github implements INodeType {
|
||||
overwriteDataOperationsArray.includes(fullOperation)
|
||||
) {
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
|
||||
@@ -5,6 +5,7 @@ import type {
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
IWebhookResponseData,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
@@ -535,7 +536,7 @@ export class GithubTrigger implements INodeType {
|
||||
|
||||
if (responseData.id === undefined || responseData.active !== true) {
|
||||
// Required data is missing so was not successful
|
||||
throw new NodeApiError(this.getNode(), responseData, {
|
||||
throw new NodeApiError(this.getNode(), responseData as JsonObject, {
|
||||
message: 'Github webhook creation response did not contain the expected data.',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user