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,
|
||||
@@ -10,11 +8,24 @@ import {
|
||||
IWebhookFunctions,
|
||||
} from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject, NodeApiError,
|
||||
} from 'n8n-workflow';
|
||||
import { IDataObject, NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function sentryIoApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IWebhookFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
||||
export async function sentryIoApiRequest(
|
||||
this:
|
||||
| IHookFunctions
|
||||
| IExecuteFunctions
|
||||
| IExecuteSingleFunctions
|
||||
| ILoadOptionsFunctions
|
||||
| IWebhookFunctions,
|
||||
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 authentication = this.getNodeParameter('authentication', 0);
|
||||
|
||||
const version = this.getNodeParameter('sentryVersion', 0);
|
||||
@@ -43,7 +54,6 @@ export async function sentryIoApiRequest(this: IHookFunctions | IExecuteFunction
|
||||
|
||||
try {
|
||||
if (authentication === 'accessToken') {
|
||||
|
||||
if (version === 'cloud') {
|
||||
credentialName = 'sentryIoApi';
|
||||
} else {
|
||||
@@ -62,19 +72,23 @@ export async function sentryIoApiRequest(this: IHookFunctions | IExecuteFunction
|
||||
|
||||
//@ts-ignore
|
||||
return this.helpers.request(options);
|
||||
|
||||
} else {
|
||||
|
||||
return await this.helpers.requestOAuth2!.call(this, 'sentryIoOAuth2Api', options);
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
}
|
||||
}
|
||||
|
||||
export async function sentryApiRequestAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, query: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
||||
|
||||
export async function sentryApiRequestAllItems(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
|
||||
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;
|
||||
@@ -84,16 +98,16 @@ export async function sentryApiRequestAllItems(this: IHookFunctions | IExecuteFu
|
||||
let uri: string | undefined;
|
||||
|
||||
do {
|
||||
responseData = await sentryIoApiRequest.call(this, method, resource, body, query, uri, { resolveWithFullResponse: true });
|
||||
responseData = await sentryIoApiRequest.call(this, method, resource, body, query, uri, {
|
||||
resolveWithFullResponse: true,
|
||||
});
|
||||
link = responseData.headers.link;
|
||||
uri = getNext(link);
|
||||
returnData.push.apply(returnData, responseData.body);
|
||||
if (query.limit && (query.limit >= returnData.length)) {
|
||||
if (query.limit && query.limit >= returnData.length) {
|
||||
return;
|
||||
}
|
||||
} while (
|
||||
hasMore(link)
|
||||
);
|
||||
} while (hasMore(link));
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user