mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
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:
@@ -1,18 +1,20 @@
|
||||
import {
|
||||
OptionsWithUri,
|
||||
} from 'request';
|
||||
import { OptionsWithUri } from 'request';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IPollFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions, ILoadOptionsFunctions, IPollFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject, NodeApiError,
|
||||
} from 'n8n-workflow';
|
||||
import { IDataObject, NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function clockifyApiRequest(this: ILoadOptionsFunctions | IPollFunctions | IExecuteFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
||||
export async function clockifyApiRequest(
|
||||
this: ILoadOptionsFunctions | IPollFunctions | IExecuteFunctions,
|
||||
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 BASE_URL = 'https://api.clockify.me/api/v1';
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
@@ -34,8 +36,15 @@ export async function clockifyApiRequest(this: ILoadOptionsFunctions | IPollFunc
|
||||
}
|
||||
}
|
||||
|
||||
export async function clockifyApiRequestAllItems(this: IExecuteFunctions | IPollFunctions | ILoadOptionsFunctions, method: string, endpoint: string, body: any = {}, query: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
||||
|
||||
export async function clockifyApiRequestAllItems(
|
||||
this: IExecuteFunctions | IPollFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
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;
|
||||
@@ -49,16 +58,12 @@ export async function clockifyApiRequestAllItems(this: IExecuteFunctions | IPoll
|
||||
|
||||
returnData.push.apply(returnData, responseData);
|
||||
|
||||
if (query.limit && (returnData.length >= query.limit)) {
|
||||
|
||||
if (query.limit && returnData.length >= query.limit) {
|
||||
return returnData;
|
||||
}
|
||||
|
||||
query.page++;
|
||||
|
||||
} while (
|
||||
responseData.length !== 0
|
||||
);
|
||||
} while (responseData.length !== 0);
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user