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,15 +7,21 @@ import {
|
||||
ILoadOptionsFunctions,
|
||||
} from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject, NodeApiError, NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
IRelation,
|
||||
} from './Interfaces';
|
||||
import { IRelation } from './Interfaces';
|
||||
|
||||
export async function orbitApiRequest(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 orbitApiRequest(
|
||||
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> {
|
||||
try {
|
||||
const credentials = await this.getCredentials('orbitApi');
|
||||
let options: OptionsWithUri = {
|
||||
@@ -43,8 +47,16 @@ export async function orbitApiRequest(this: IHookFunctions | IExecuteFunctions |
|
||||
* Make an API request to paginated flow endpoint
|
||||
* and return all results
|
||||
*/
|
||||
export async function orbitApiRequestAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, propertyName: string, method: string, resource: string, body: any = {}, query: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
||||
|
||||
export async function orbitApiRequestAllItems(
|
||||
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;
|
||||
@@ -63,13 +75,10 @@ export async function orbitApiRequestAllItems(this: IHookFunctions | IExecuteFun
|
||||
}
|
||||
|
||||
query.page++;
|
||||
if (query.limit && (returnData.length >= query.limit)) {
|
||||
if (query.limit && returnData.length >= query.limit) {
|
||||
return returnData;
|
||||
}
|
||||
|
||||
} while (
|
||||
responseData.data.length !== 0
|
||||
);
|
||||
} while (responseData.data.length !== 0);
|
||||
return returnData;
|
||||
}
|
||||
|
||||
@@ -86,7 +95,8 @@ export function resolveIdentities(responseData: IRelation) {
|
||||
for (let i = 0; i < responseData.data.length; i++) {
|
||||
for (let y = 0; y < responseData.data[i].relationships.identities.data.length; y++) {
|
||||
//@ts-ignore
|
||||
responseData.data[i].relationships.identities.data[y] = identities[responseData.data[i].relationships.identities.data[y].id];
|
||||
responseData.data[i].relationships.identities.data[y] =
|
||||
identities[responseData.data[i].relationships.identities.data[y].id];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,6 +113,8 @@ export function resolveMember(responseData: IRelation) {
|
||||
|
||||
for (let i = 0; i < responseData.data.length; i++) {
|
||||
//@ts-ignore
|
||||
responseData.data[i].relationships.member.data = members[responseData.data[i].relationships.member.data.id];
|
||||
responseData.data[i].relationships.member.data =
|
||||
//@ts-ignore
|
||||
members[responseData.data[i].relationships.member.data.id];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user