mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)
This commit is contained in:
@@ -7,19 +7,18 @@ import type {
|
||||
ILoadOptionsFunctions,
|
||||
} from 'n8n-core';
|
||||
|
||||
import type { IBinaryKeyData, IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||
import type { IBinaryKeyData, IDataObject, INodeExecutionData, JsonObject } from 'n8n-workflow';
|
||||
import { NodeApiError, NodeOperationError, sleep } from 'n8n-workflow';
|
||||
|
||||
export async function twitterApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IHookFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
|
||||
body: any = {},
|
||||
body: IDataObject = {},
|
||||
qs: IDataObject = {},
|
||||
uri?: string,
|
||||
option: IDataObject = {},
|
||||
): Promise<any> {
|
||||
) {
|
||||
let options: OptionsWithUrl = {
|
||||
method,
|
||||
body,
|
||||
@@ -37,10 +36,9 @@ export async function twitterApiRequest(
|
||||
if (Object.keys(qs).length === 0) {
|
||||
delete options.qs;
|
||||
}
|
||||
//@ts-ignore
|
||||
return await this.helpers.requestOAuth1.call(this, 'twitterOAuth1Api', options);
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,10 +47,9 @@ export async function twitterApiRequestAllItems(
|
||||
propertyName: string,
|
||||
method: string,
|
||||
endpoint: string,
|
||||
|
||||
body: any = {},
|
||||
body: IDataObject = {},
|
||||
query: IDataObject = {},
|
||||
): Promise<any> {
|
||||
) {
|
||||
const returnData: IDataObject[] = [];
|
||||
|
||||
let responseData;
|
||||
@@ -62,7 +59,7 @@ export async function twitterApiRequestAllItems(
|
||||
do {
|
||||
responseData = await twitterApiRequest.call(this, method, endpoint, body, query);
|
||||
query.since_id = responseData.search_metadata.max_id;
|
||||
returnData.push.apply(returnData, responseData[propertyName]);
|
||||
returnData.push.apply(returnData, responseData[propertyName] as IDataObject[]);
|
||||
} while (responseData.search_metadata?.next_results);
|
||||
|
||||
return returnData;
|
||||
|
||||
Reference in New Issue
Block a user