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,17 +1,20 @@
|
||||
import {
|
||||
OptionsWithUri,
|
||||
} from 'request';
|
||||
import { OptionsWithUri } from 'request';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
|
||||
import _ from 'lodash';
|
||||
import { NodeApiError, NodeOperationError, } from 'n8n-workflow';
|
||||
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
export async function mandrillApiRequest(this: IExecuteFunctions | IHookFunctions | ILoadOptionsFunctions, resource: string, method: string, action: string, body: any = {}, headers?: object): Promise<any> { // tslint:disable-line:no-any
|
||||
export async function mandrillApiRequest(
|
||||
this: IExecuteFunctions | IHookFunctions | ILoadOptionsFunctions,
|
||||
resource: string,
|
||||
method: string,
|
||||
action: string,
|
||||
// tslint:disable-next-line:no-any
|
||||
body: any = {},
|
||||
headers?: object,
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const credentials = await this.getCredentials('mandrillApi');
|
||||
|
||||
const data = Object.assign({}, body, { key: credentials.apiKey });
|
||||
@@ -26,7 +29,6 @@ export async function mandrillApiRequest(this: IExecuteFunctions | IHookFunction
|
||||
json: true,
|
||||
};
|
||||
|
||||
|
||||
try {
|
||||
return await this.helpers.request!(options);
|
||||
} catch (error) {
|
||||
@@ -34,7 +36,8 @@ export async function mandrillApiRequest(this: IExecuteFunctions | IHookFunction
|
||||
}
|
||||
}
|
||||
|
||||
export function getToEmailArray(toEmail: string): any { // tslint:disable-line:no-any
|
||||
// tslint:disable-next-line:no-any
|
||||
export function getToEmailArray(toEmail: string): any {
|
||||
let toEmailArray;
|
||||
if (toEmail.split(',').length > 0) {
|
||||
const array = toEmail.split(',');
|
||||
@@ -45,10 +48,12 @@ export function getToEmailArray(toEmail: string): any { // tslint:disable-line:n
|
||||
};
|
||||
});
|
||||
} else {
|
||||
toEmailArray = [{
|
||||
email: toEmail,
|
||||
type: 'to',
|
||||
}];
|
||||
toEmailArray = [
|
||||
{
|
||||
email: toEmail,
|
||||
type: 'to',
|
||||
},
|
||||
];
|
||||
}
|
||||
return toEmailArray;
|
||||
}
|
||||
@@ -63,7 +68,8 @@ export function getGoogleAnalyticsDomainsArray(s: string): string[] {
|
||||
return array;
|
||||
}
|
||||
|
||||
export function getTags(s: string): any[] { // tslint:disable-line:no-any
|
||||
// tslint:disable-next-line:no-any
|
||||
export function getTags(s: string): any[] {
|
||||
let array = [];
|
||||
if (s.split(',').length > 0) {
|
||||
array = s.split(',');
|
||||
@@ -73,7 +79,8 @@ export function getTags(s: string): any[] { // tslint:disable-line:no-any
|
||||
return array;
|
||||
}
|
||||
|
||||
export function validateJSON(json: string | undefined): any { // tslint:disable-line:no-any
|
||||
// tslint:disable-next-line:no-any
|
||||
export function validateJSON(json: string | undefined): any {
|
||||
let result;
|
||||
try {
|
||||
result = JSON.parse(json!);
|
||||
|
||||
Reference in New Issue
Block a user