refactor: Format nodes-base package (A-F) (#3800)

* 🔨 prettier formated nodes - A

* 🔨 prettier formated nodes - B

*  prettier formated nodes - C

*  prettier formated nodes - D

*  prettier formated nodes - E-F

* 🎨 Adjust nodes-base formatting command (#3805)

* Format additional files in nodes A-F (#3811)

*  fixes

* 🎨 Add Mindee to ignored dirs

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
Michael Kret
2022-08-01 23:47:55 +03:00
committed by GitHub
parent 2c17e6f3ca
commit 0ecbb4a19d
411 changed files with 12906 additions and 20148 deletions

View File

@@ -1,6 +1,4 @@
import {
OptionsWithUri,
} from 'request';
import { OptionsWithUri } from 'request';
import {
IExecuteFunctions,
@@ -9,21 +7,29 @@ import {
ILoadOptionsFunctions,
} from 'n8n-core';
import {
IDataObject, NodeApiError, NodeOperationError,
} from 'n8n-workflow';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
export async function circleciApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
export async function circleciApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
method: string,
resource: string,
// tslint:disable-next-line:no-any
body: any = {},
qs: IDataObject = {},
uri?: string,
option: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
const credentials = await this.getCredentials('circleCiApi');
let options: OptionsWithUri = {
headers: {
'Circle-Token': credentials.apiKey,
'Accept': 'application/json',
Accept: 'application/json',
},
method,
qs,
body,
uri: uri ||`https://circleci.com/api/v2${resource}`,
uri: uri || `https://circleci.com/api/v2${resource}`,
json: true,
};
options = Object.assign({}, options, option);
@@ -41,8 +47,16 @@ export async function circleciApiRequest(this: IHookFunctions | IExecuteFunction
* Make an API request to paginated CircleCI endpoint
* and return all results
*/
export async function circleciApiRequestAllItems(this: IHookFunctions | IExecuteFunctions| ILoadOptionsFunctions, propertyName: string, method: string, resource: string, body: any = {}, query: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
export async function circleciApiRequestAllItems(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
propertyName: string,
method: string,
resource: string,
// tslint:disable-next-line:no-any
body: any = {},
query: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
const returnData: IDataObject[] = [];
let responseData;
@@ -51,9 +65,6 @@ export async function circleciApiRequestAllItems(this: IHookFunctions | IExecute
responseData = await circleciApiRequest.call(this, method, resource, body, query);
returnData.push.apply(returnData, responseData[propertyName]);
query['page-token'] = responseData.next_page_token;
} while (
responseData.next_page_token !== undefined &&
responseData.next_page_token !== null
);
} while (responseData.next_page_token !== undefined && responseData.next_page_token !== null);
return returnData;
}