mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
n8n-3867-progressively-apply-prettier-to-all (#3873)
* 🔨 formatting nodes with prettier
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
import {
|
||||
OptionsWithUri,
|
||||
} from 'request';
|
||||
import { OptionsWithUri } from 'request';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject, NodeApiError, NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export async function zoomApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: object = {}, query: object = {}, headers: {} | undefined = undefined, option: {} = {}): Promise<any> { // tslint:disable-line:no-any
|
||||
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
export async function zoomApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
body: object = {},
|
||||
query: object = {},
|
||||
headers: {} | undefined = undefined,
|
||||
option: {} = {},
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const authenticationMethod = this.getNodeParameter('authentication', 0, 'accessToken') as string;
|
||||
|
||||
let options: OptionsWithUri = {
|
||||
@@ -36,7 +36,7 @@ export async function zoomApiRequest(this: IExecuteFunctions | IExecuteSingleFun
|
||||
|
||||
try {
|
||||
if (authenticationMethod === 'accessToken') {
|
||||
return await this.helpers.requestWithAuthentication.call(this,'zoomApi',options);
|
||||
return await this.helpers.requestWithAuthentication.call(this, 'zoomApi', options);
|
||||
} else {
|
||||
//@ts-ignore
|
||||
return await this.helpers.requestOAuth2.call(this, 'zoomOAuth2Api', options);
|
||||
@@ -46,7 +46,6 @@ export async function zoomApiRequest(this: IExecuteFunctions | IExecuteSingleFun
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function zoomApiRequestAllItems(
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
propertyName: string,
|
||||
@@ -54,26 +53,19 @@ export async function zoomApiRequestAllItems(
|
||||
endpoint: string,
|
||||
body: IDataObject = {},
|
||||
query: IDataObject = {},
|
||||
): Promise<any> { // tslint:disable-line:no-any
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const returnData: IDataObject[] = [];
|
||||
let responseData;
|
||||
query.page_number = 0;
|
||||
do {
|
||||
responseData = await zoomApiRequest.call(
|
||||
this,
|
||||
method,
|
||||
endpoint,
|
||||
body,
|
||||
query,
|
||||
);
|
||||
responseData = await zoomApiRequest.call(this, method, endpoint, body, query);
|
||||
query.page_number++;
|
||||
returnData.push.apply(returnData, responseData[propertyName]);
|
||||
// zoom free plan rate limit is 1 request/second
|
||||
// TODO just wait when the plan is free
|
||||
await wait();
|
||||
} while (
|
||||
responseData.page_count !== responseData.page_number
|
||||
);
|
||||
} while (responseData.page_count !== responseData.page_number);
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user