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,8 +1,4 @@
import {
IExecuteFunctions,
IHookFunctions,
ILoadOptionsFunctions,
} from 'n8n-core';
import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core';
import {
IDataObject,
@@ -11,9 +7,7 @@ import {
INodePropertyOptions,
} from 'n8n-workflow';
import {
get,
} from 'lodash';
import { get } from 'lodash';
/**
* Make an API request to Asana
@@ -24,7 +18,15 @@ import {
* @param {object} body
* @returns {Promise<any>}
*/
export async function asanaApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: IHttpRequestMethods, endpoint: string, body: object, query?: IDataObject, uri?: string | undefined): Promise<any> { // tslint:disable-line:no-any
export async function asanaApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
method: IHttpRequestMethods,
endpoint: string,
body: object,
query?: IDataObject,
uri?: string | undefined,
// tslint:disable-next-line:no-any
): Promise<any> {
const authenticationMethod = this.getNodeParameter('authentication', 0) as string;
const options: IHttpRequestOptions = {
@@ -40,8 +42,15 @@ export async function asanaApiRequest(this: IHookFunctions | IExecuteFunctions |
return this.helpers.requestWithAuthentication.call(this, credentialType, options);
}
export async function asanaApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, method: IHttpRequestMethods, endpoint: string, body: any = {}, query: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
export async function asanaApiRequestAllItems(
this: IExecuteFunctions | ILoadOptionsFunctions,
method: IHttpRequestMethods,
endpoint: string,
// tslint:disable-next-line:no-any
body: any = {},
query: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
const returnData: IDataObject[] = [];
let responseData;
@@ -52,9 +61,7 @@ export async function asanaApiRequestAllItems(this: IExecuteFunctions | ILoadOpt
responseData = await asanaApiRequest.call(this, method, endpoint, body, query, uri);
uri = get(responseData, 'next_page.uri');
returnData.push.apply(returnData, responseData['data']);
} while (
responseData['next_page'] !== null
);
} while (responseData['next_page'] !== null);
return returnData;
}
@@ -78,15 +85,18 @@ export async function getWorkspaces(this: ILoadOptionsFunctions): Promise<INodeP
}
returnData.sort((a, b) => {
if (a.name < b.name) { return -1; }
if (a.name > b.name) { return 1; }
if (a.name < b.name) {
return -1;
}
if (a.name > b.name) {
return 1;
}
return 0;
});
return returnData;
}
export function getColorOptions(): INodePropertyOptions[] {
return [
'dark-blue',
@@ -108,7 +118,7 @@ export function getColorOptions(): INodePropertyOptions[] {
'light-warm-gray',
'light-yellow',
'none',
].map(value => {
].map((value) => {
return {
name: value,
value,