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,10 +1,6 @@
|
||||
import {
|
||||
set,
|
||||
} from 'lodash';
|
||||
import { set } from 'lodash';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
ILoadOptionsFunctions,
|
||||
@@ -79,9 +75,7 @@ export class Crypto implements INodeType {
|
||||
name: 'type',
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'hash',
|
||||
],
|
||||
action: ['hash'],
|
||||
},
|
||||
},
|
||||
type: 'options',
|
||||
@@ -112,9 +106,7 @@ export class Crypto implements INodeType {
|
||||
name: 'value',
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'hash',
|
||||
],
|
||||
action: ['hash'],
|
||||
},
|
||||
},
|
||||
type: 'string',
|
||||
@@ -130,9 +122,7 @@ export class Crypto implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'hash',
|
||||
],
|
||||
action: ['hash'],
|
||||
},
|
||||
},
|
||||
description: 'Name of the property to which to write the hash',
|
||||
@@ -142,9 +132,7 @@ export class Crypto implements INodeType {
|
||||
name: 'encoding',
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'hash',
|
||||
],
|
||||
action: ['hash'],
|
||||
},
|
||||
},
|
||||
type: 'options',
|
||||
@@ -166,9 +154,7 @@ export class Crypto implements INodeType {
|
||||
name: 'type',
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'hmac',
|
||||
],
|
||||
action: ['hmac'],
|
||||
},
|
||||
},
|
||||
type: 'options',
|
||||
@@ -199,9 +185,7 @@ export class Crypto implements INodeType {
|
||||
name: 'value',
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'hmac',
|
||||
],
|
||||
action: ['hmac'],
|
||||
},
|
||||
},
|
||||
type: 'string',
|
||||
@@ -217,9 +201,7 @@ export class Crypto implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'hmac',
|
||||
],
|
||||
action: ['hmac'],
|
||||
},
|
||||
},
|
||||
description: 'Name of the property to which to write the hmac',
|
||||
@@ -229,9 +211,7 @@ export class Crypto implements INodeType {
|
||||
name: 'secret',
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'hmac',
|
||||
],
|
||||
action: ['hmac'],
|
||||
},
|
||||
},
|
||||
type: 'string',
|
||||
@@ -243,9 +223,7 @@ export class Crypto implements INodeType {
|
||||
name: 'encoding',
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'hmac',
|
||||
],
|
||||
action: ['hmac'],
|
||||
},
|
||||
},
|
||||
type: 'options',
|
||||
@@ -267,9 +245,7 @@ export class Crypto implements INodeType {
|
||||
name: 'value',
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'sign',
|
||||
],
|
||||
action: ['sign'],
|
||||
},
|
||||
},
|
||||
type: 'string',
|
||||
@@ -285,9 +261,7 @@ export class Crypto implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'sign',
|
||||
],
|
||||
action: ['sign'],
|
||||
},
|
||||
},
|
||||
description: 'Name of the property to which to write the signed value',
|
||||
@@ -297,13 +271,12 @@ export class Crypto implements INodeType {
|
||||
name: 'algorithm',
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'sign',
|
||||
],
|
||||
action: ['sign'],
|
||||
},
|
||||
},
|
||||
type: 'options',
|
||||
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getHashes',
|
||||
},
|
||||
@@ -315,9 +288,7 @@ export class Crypto implements INodeType {
|
||||
name: 'encoding',
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'sign',
|
||||
],
|
||||
action: ['sign'],
|
||||
},
|
||||
},
|
||||
type: 'options',
|
||||
@@ -339,9 +310,7 @@ export class Crypto implements INodeType {
|
||||
name: 'privateKey',
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'sign',
|
||||
],
|
||||
action: ['sign'],
|
||||
},
|
||||
},
|
||||
type: 'string',
|
||||
@@ -360,9 +329,7 @@ export class Crypto implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'generate',
|
||||
],
|
||||
action: ['generate'],
|
||||
},
|
||||
},
|
||||
description: 'Name of the property to which to write the random string',
|
||||
@@ -372,9 +339,7 @@ export class Crypto implements INodeType {
|
||||
name: 'encodingType',
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'generate',
|
||||
],
|
||||
action: ['generate'],
|
||||
},
|
||||
},
|
||||
type: 'options',
|
||||
@@ -408,14 +373,8 @@ export class Crypto implements INodeType {
|
||||
description: 'Length of the generated string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
action: [
|
||||
'generate',
|
||||
],
|
||||
encodingType: [
|
||||
'ascii',
|
||||
'base64',
|
||||
'hex',
|
||||
],
|
||||
action: ['generate'],
|
||||
encodingType: ['ascii', 'base64', 'hex'],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -451,9 +410,7 @@ export class Crypto implements INodeType {
|
||||
|
||||
let item: INodeExecutionData;
|
||||
for (let i = 0; i < length; i++) {
|
||||
|
||||
try {
|
||||
|
||||
item = items[i];
|
||||
const dataPropertyName = this.getNodeParameter('dataPropertyName', i) as string;
|
||||
const value = this.getNodeParameter('value', i, '') as string;
|
||||
@@ -466,9 +423,14 @@ export class Crypto implements INodeType {
|
||||
} else {
|
||||
const stringLength = this.getNodeParameter('stringLength', i) as number;
|
||||
if (encodingType === 'base64') {
|
||||
newValue = randomBytes(stringLength).toString(encodingType as BufferEncoding).replace(/\W/g, '').slice(0, stringLength);
|
||||
newValue = randomBytes(stringLength)
|
||||
.toString(encodingType as BufferEncoding)
|
||||
.replace(/\W/g, '')
|
||||
.slice(0, stringLength);
|
||||
} else {
|
||||
newValue = randomBytes(stringLength).toString(encodingType as BufferEncoding).slice(0, stringLength);
|
||||
newValue = randomBytes(stringLength)
|
||||
.toString(encodingType as BufferEncoding)
|
||||
.slice(0, stringLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -519,7 +481,6 @@ export class Crypto implements INodeType {
|
||||
set(newItem, `json.${dataPropertyName}`, newValue);
|
||||
|
||||
returnData.push(newItem);
|
||||
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
returnData.push({
|
||||
|
||||
Reference in New Issue
Block a user