mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)
This commit is contained in:
@@ -8,7 +8,7 @@ import type {
|
||||
IWebhookFunctions,
|
||||
} from 'n8n-core';
|
||||
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
import type { IDataObject, JsonObject } from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function stravaApiRequest(
|
||||
@@ -20,12 +20,11 @@ export async function stravaApiRequest(
|
||||
| IWebhookFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
|
||||
body: any = {},
|
||||
body: IDataObject = {},
|
||||
qs: IDataObject = {},
|
||||
uri?: string,
|
||||
headers: IDataObject = {},
|
||||
): Promise<any> {
|
||||
) {
|
||||
const options: OptionsWithUri = {
|
||||
method,
|
||||
form: body,
|
||||
@@ -50,16 +49,15 @@ export async function stravaApiRequest(
|
||||
body.client_id = credentials.clientId;
|
||||
body.client_secret = credentials.clientSecret;
|
||||
}
|
||||
//@ts-ignore
|
||||
|
||||
return await this.helpers?.request(options);
|
||||
} else {
|
||||
//@ts-ignore
|
||||
return await this.helpers.requestOAuth2.call(this, 'stravaOAuth2Api', options, {
|
||||
includeCredentialsOnRefreshOnBody: true,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,9 +66,9 @@ export async function stravaApiRequestAllItems(
|
||||
method: string,
|
||||
resource: string,
|
||||
|
||||
body: any = {},
|
||||
body: IDataObject = {},
|
||||
query: IDataObject = {},
|
||||
): Promise<any> {
|
||||
) {
|
||||
const returnData: IDataObject[] = [];
|
||||
|
||||
let responseData;
|
||||
@@ -82,7 +80,7 @@ export async function stravaApiRequestAllItems(
|
||||
do {
|
||||
responseData = await stravaApiRequest.call(this, method, resource, body, query);
|
||||
query.page++;
|
||||
returnData.push.apply(returnData, responseData);
|
||||
returnData.push.apply(returnData, responseData as IDataObject[]);
|
||||
} while (responseData.length !== 0);
|
||||
|
||||
return returnData;
|
||||
|
||||
Reference in New Issue
Block a user