n8n-3867-progressively-apply-prettier-to-all (#3873)

* 🔨 formatting nodes with prettier
This commit is contained in:
Michael Kret
2022-08-17 18:50:24 +03:00
committed by GitHub
parent f2d326c7f0
commit 91d7e16c81
1072 changed files with 42357 additions and 59109 deletions

View File

@@ -1,6 +1,4 @@
import {
OptionsWithUri,
} from 'request';
import { OptionsWithUri } from 'request';
import {
IExecuteFunctions,
@@ -9,11 +7,18 @@ import {
ILoadOptionsFunctions,
} from 'n8n-core';
import {
IDataObject, NodeApiError, NodeOperationError,
} from 'n8n-workflow';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
export async function humanticAiApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
export async function humanticAiApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
method: string,
resource: string,
// tslint:disable-next-line:no-any
body: any = {},
qs: IDataObject = {},
option: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
try {
const credentials = await this.getCredentials('humanticAiApi');
let options: OptionsWithUri = {
@@ -41,7 +46,6 @@ export async function humanticAiApiRequest(this: IHookFunctions | IExecuteFuncti
}
return response;
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}

View File

@@ -1,6 +1,4 @@
import {
IExecuteFunctions,
} from 'n8n-core';
import { IExecuteFunctions } from 'n8n-core';
import {
IBinaryData,
@@ -12,14 +10,9 @@ import {
NodeOperationError,
} from 'n8n-workflow';
import {
humanticAiApiRequest,
} from './GenericFunctions';
import { humanticAiApiRequest } from './GenericFunctions';
import {
profileFields,
profileOperations,
} from './ProfileDescription';
import { profileFields, profileOperations } from './ProfileDescription';
export class HumanticAi implements INodeType {
description: INodeTypeDescription = {
@@ -81,7 +74,9 @@ export class HumanticAi implements INodeType {
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i) as string;
if (items[i].binary === undefined) {
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { itemIndex: i });
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', {
itemIndex: i,
});
}
const item = items[i].binary as IBinaryKeyData;
@@ -90,7 +85,11 @@ export class HumanticAi implements INodeType {
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
if (binaryData === undefined) {
throw new NodeOperationError(this.getNode(), `No binary data property "${binaryPropertyName}" does not exists on item!`, { itemIndex: i });
throw new NodeOperationError(
this.getNode(),
`No binary data property "${binaryPropertyName}" does not exists on item!`,
{ itemIndex: i },
);
}
responseData = await humanticAiApiRequest.call(
@@ -111,7 +110,13 @@ export class HumanticAi implements INodeType {
},
);
} else {
responseData = await humanticAiApiRequest.call(this, 'GET', `/user-profile/create`, {}, qs);
responseData = await humanticAiApiRequest.call(
this,
'GET',
`/user-profile/create`,
{},
qs,
);
}
if (responseData.data !== undefined) {
@@ -142,7 +147,9 @@ export class HumanticAi implements INodeType {
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i) as string;
if (items[i].binary === undefined) {
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { itemIndex: i });
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', {
itemIndex: i,
});
}
const item = items[i].binary as IBinaryKeyData;
@@ -151,7 +158,11 @@ export class HumanticAi implements INodeType {
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
if (binaryData === undefined) {
throw new NodeOperationError(this.getNode(), `No binary data property "${binaryPropertyName}" does not exists on item!`, { itemIndex: i });
throw new NodeOperationError(
this.getNode(),
`No binary data property "${binaryPropertyName}" does not exists on item!`,
{ itemIndex: i },
);
}
responseData = await humanticAiApiRequest.call(
@@ -180,7 +191,13 @@ export class HumanticAi implements INodeType {
qs.userid = userId;
responseData = await humanticAiApiRequest.call(this, 'POST', `/user-profile/create`, body, qs);
responseData = await humanticAiApiRequest.call(
this,
'POST',
`/user-profile/create`,
body,
qs,
);
responseData = responseData.data;
}
}

View File

@@ -1,6 +1,4 @@
import {
INodeProperties,
} from 'n8n-workflow';
import { INodeProperties } from 'n8n-workflow';
export const profileOperations: INodeProperties[] = [
{
@@ -10,9 +8,7 @@ export const profileOperations: INodeProperties[] = [
noDataExpression: true,
displayOptions: {
show: {
resource: [
'profile',
],
resource: ['profile'],
},
},
options: [
@@ -51,15 +47,12 @@ export const profileFields: INodeProperties[] = [
default: '',
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'profile',
],
operation: ['create'],
resource: ['profile'],
},
},
description: 'The LinkedIn profile URL or email ID for creating a Humantic profile. If you are sending the resume, this should be a unique string.',
description:
'The LinkedIn profile URL or email ID for creating a Humantic profile. If you are sending the resume, this should be a unique string.',
},
{
displayName: 'Send Resume',
@@ -68,12 +61,8 @@ export const profileFields: INodeProperties[] = [
default: false,
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'profile',
],
operation: ['create'],
resource: ['profile'],
},
},
description: 'Whether to send a resume for a resume based analysis',
@@ -85,15 +74,9 @@ export const profileFields: INodeProperties[] = [
default: 'data',
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'profile',
],
sendResume: [
true,
],
operation: ['create'],
resource: ['profile'],
sendResume: [true],
},
},
description: 'The resume in PDF or DOCX format',
@@ -110,15 +93,12 @@ export const profileFields: INodeProperties[] = [
default: '',
displayOptions: {
show: {
operation: [
'get',
],
resource: [
'profile',
],
operation: ['get'],
resource: ['profile'],
},
},
description: 'This value is the same as the User ID that was provided when the analysis was created. This could be a LinkedIn URL, email ID, or a unique string in case of resume based analysis.',
description:
'This value is the same as the User ID that was provided when the analysis was created. This could be a LinkedIn URL, email ID, or a unique string in case of resume based analysis.',
},
{
displayName: 'Options',
@@ -128,12 +108,8 @@ export const profileFields: INodeProperties[] = [
default: {},
displayOptions: {
show: {
operation: [
'get',
],
resource: [
'profile',
],
operation: ['get'],
resource: ['profile'],
},
},
options: [
@@ -152,13 +128,12 @@ export const profileFields: INodeProperties[] = [
},
],
default: [],
description: 'Fetch the Humantic profile of the user for a particular persona type. Multiple persona values can be supported using comma as a delimiter.',
description:
'Fetch the Humantic profile of the user for a particular persona type. Multiple persona values can be supported using comma as a delimiter.',
},
],
},
/* -------------------------------------------------------------------------- */
/* profile:update */
/* -------------------------------------------------------------------------- */
@@ -170,15 +145,12 @@ export const profileFields: INodeProperties[] = [
default: '',
displayOptions: {
show: {
operation: [
'update',
],
resource: [
'profile',
],
operation: ['update'],
resource: ['profile'],
},
},
description: 'This value is the same as the User ID that was provided when the analysis was created. Currently only supported for profiles created using LinkedIn URL.',
description:
'This value is the same as the User ID that was provided when the analysis was created. Currently only supported for profiles created using LinkedIn URL.',
},
{
displayName: 'Send Resume',
@@ -187,12 +159,8 @@ export const profileFields: INodeProperties[] = [
default: false,
displayOptions: {
show: {
operation: [
'update',
],
resource: [
'profile',
],
operation: ['update'],
resource: ['profile'],
},
},
description: 'Whether to send a resume for a resume of the user',
@@ -204,15 +172,9 @@ export const profileFields: INodeProperties[] = [
default: '',
displayOptions: {
show: {
operation: [
'update',
],
resource: [
'profile',
],
sendResume: [
false,
],
operation: ['update'],
resource: ['profile'],
sendResume: [false],
},
},
description: 'Additional text written by the user',
@@ -224,15 +186,9 @@ export const profileFields: INodeProperties[] = [
default: 'data',
displayOptions: {
show: {
operation: [
'update',
],
resource: [
'profile',
],
sendResume: [
true,
],
operation: ['update'],
resource: ['profile'],
sendResume: [true],
},
},
description: 'The resume in PDF or DOCX format',