n8n-3867-progressively-apply-prettier-to-all (#3873)

* 🔨 formatting nodes with prettier
This commit is contained in:
Michael Kret
2022-08-17 18:50:24 +03:00
committed by GitHub
parent f2d326c7f0
commit 91d7e16c81
1072 changed files with 42357 additions and 59109 deletions

View File

@@ -1,16 +1,8 @@
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,
} from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function googleApiRequest(
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
@@ -20,7 +12,8 @@ export async function googleApiRequest(
qs: IDataObject = {},
uri?: string,
headers: IDataObject = {},
): Promise<any> { // tslint:disable-line:no-any
// tslint:disable-next-line:no-any
): Promise<any> {
const options: OptionsWithUri = {
headers: {
'Content-Type': 'application/json',
@@ -40,11 +33,7 @@ export async function googleApiRequest(
delete options.body;
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(
this,
'googleTasksOAuth2Api',
options,
);
return await this.helpers.requestOAuth2.call(this, 'googleTasksOAuth2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}
@@ -57,26 +46,18 @@ export async function googleApiRequestAllItems(
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.maxResults = 100;
do {
responseData = await googleApiRequest.call(
this,
method,
endpoint,
body,
query,
);
responseData = await googleApiRequest.call(this, method, endpoint, body, query);
query.pageToken = responseData['nextPageToken'];
returnData.push.apply(returnData, responseData[propertyName]);
} while (
responseData['nextPageToken'] !== undefined &&
responseData['nextPageToken'] !== ''
);
} while (responseData['nextPageToken'] !== undefined && responseData['nextPageToken'] !== '');
return returnData;
}