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,16 +1,8 @@
|
||||
import {
|
||||
OptionsWithUri,
|
||||
} from 'request';
|
||||
import { OptionsWithUri } from 'request';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject, NodeApiError,
|
||||
} from 'n8n-workflow';
|
||||
import { IDataObject, NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export type Context = IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions;
|
||||
|
||||
@@ -24,9 +16,11 @@ export async function todoistApiRequest(
|
||||
this: Context,
|
||||
method: string,
|
||||
resource: string,
|
||||
// tslint:disable-next-line:no-any
|
||||
body: any = {}, // tslint:disable-line:no-any
|
||||
qs: IDataObject = {},
|
||||
): Promise<any> { // tslint:disable-line:no-any
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const authentication = this.getNodeParameter('authentication', 0) as string;
|
||||
|
||||
const endpoint = 'api.todoist.com/rest/v1';
|
||||
@@ -45,9 +39,8 @@ export async function todoistApiRequest(
|
||||
try {
|
||||
const credentialType = authentication === 'apiKey' ? 'todoistApi' : 'todoistOAuth2Api';
|
||||
return await this.helpers.requestWithAuthentication.call(this, credentialType, options);
|
||||
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), (error));
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +48,8 @@ export async function todoistSyncRequest(
|
||||
this: Context,
|
||||
body: any = {}, // tslint:disable-line:no-any
|
||||
qs: IDataObject = {},
|
||||
): Promise<any> { // tslint:disable-line:no-any
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const authentication = this.getNodeParameter('authentication', 0, 'oAuth2');
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
@@ -73,8 +67,7 @@ export async function todoistSyncRequest(
|
||||
try {
|
||||
const credentialType = authentication === 'oAuth2' ? 'todoistOAuth2Api' : 'todoistApi';
|
||||
return await this.helpers.requestWithAuthentication.call(this, credentialType, options);
|
||||
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), (error));
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user