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,6 +1,4 @@
|
||||
import {
|
||||
OptionsWithUri,
|
||||
} from 'request';
|
||||
import { OptionsWithUri } from 'request';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
@@ -9,12 +7,18 @@ import {
|
||||
IWebhookFunctions,
|
||||
} from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject, NodeApiError, NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export async function quickbaseApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions | IWebhookFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
||||
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
export async function quickbaseApiRequest(
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions | IWebhookFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
// tslint:disable-next-line:no-any
|
||||
body: any = {},
|
||||
qs: IDataObject = {},
|
||||
option: IDataObject = {},
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const credentials = await this.getCredentials('quickbaseApi');
|
||||
|
||||
if (!credentials.hostname) {
|
||||
@@ -30,7 +34,7 @@ export async function quickbaseApiRequest(this: IExecuteFunctions | ILoadOptions
|
||||
headers: {
|
||||
'QB-Realm-Hostname': credentials.hostname,
|
||||
'User-Agent': 'n8n',
|
||||
'Authorization': `QB-USER-TOKEN ${credentials.userToken}`,
|
||||
Authorization: `QB-USER-TOKEN ${credentials.userToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
method,
|
||||
@@ -40,7 +44,6 @@ export async function quickbaseApiRequest(this: IExecuteFunctions | ILoadOptions
|
||||
json: true,
|
||||
};
|
||||
|
||||
|
||||
if (Object.keys(body).length === 0) {
|
||||
delete options.body;
|
||||
}
|
||||
@@ -60,6 +63,7 @@ export async function quickbaseApiRequest(this: IExecuteFunctions | ILoadOptions
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
// prettier-ignore
|
||||
export async function getFieldsObject(this: IHookFunctions | ILoadOptionsFunctions | IExecuteFunctions, tableId: string): any { // tslint:disable-line:no-any
|
||||
const fieldsLabelKey: { [key: string]: number } = {};
|
||||
const fieldsIdKey: { [key: number]: string } = {};
|
||||
@@ -71,8 +75,15 @@ export async function getFieldsObject(this: IHookFunctions | ILoadOptionsFunctio
|
||||
return { fieldsLabelKey, fieldsIdKey };
|
||||
}
|
||||
|
||||
export async function quickbaseApiRequestAllItems(this: IHookFunctions | ILoadOptionsFunctions | IExecuteFunctions, method: string, resource: string, body: any = {}, query: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
||||
|
||||
export async function quickbaseApiRequestAllItems(
|
||||
this: IHookFunctions | ILoadOptionsFunctions | IExecuteFunctions,
|
||||
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 = [];
|
||||
@@ -90,7 +101,11 @@ export async function quickbaseApiRequestAllItems(this: IHookFunctions | ILoadOp
|
||||
let metadata;
|
||||
|
||||
do {
|
||||
const { data, fields, metadata: meta } = await quickbaseApiRequest.call(this, method, resource, body, query);
|
||||
const {
|
||||
data,
|
||||
fields,
|
||||
metadata: meta,
|
||||
} = await quickbaseApiRequest.call(this, method, resource, body, query);
|
||||
|
||||
metadata = meta;
|
||||
|
||||
@@ -116,9 +131,7 @@ export async function quickbaseApiRequestAllItems(this: IHookFunctions | ILoadOp
|
||||
}
|
||||
returnData.push.apply(returnData, responseData);
|
||||
responseData = [];
|
||||
} while (
|
||||
returnData.length < metadata.totalRecords
|
||||
);
|
||||
} while (returnData.length < metadata.totalRecords);
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user