From b54aae8c31efdf1bd0e54c83f1a33f8e9f6d794e Mon Sep 17 00:00:00 2001 From: Ahsan Virani Date: Thu, 15 Apr 2021 23:57:20 +0200 Subject: [PATCH] :arrow_up: Update types/node package in all packages (#1659) * :arrow_up: Update types/node package in all packages, fix type in crypto node * :zap: Fix build issue and some formatting Co-authored-by: Jan Oberhauser --- packages/core/package.json | 2 +- packages/editor-ui/package.json | 2 +- packages/node-dev/package.json | 2 +- packages/nodes-base/nodes/Crypto.node.ts | 32 ++++++++++++------------ packages/nodes-base/package.json | 2 +- packages/workflow/package.json | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index f0eee7085c..2d5a5c1d30 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -32,7 +32,7 @@ "@types/jest": "^26.0.13", "@types/lodash.get": "^4.4.6", "@types/mime-types": "^2.1.0", - "@types/node": "14.0.27", + "@types/node": "^14.14.40", "@types/request-promise-native": "~1.0.15", "jest": "^26.4.2", "source-map-support": "^0.5.9", diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index 2b53707120..4bbd604ca1 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -36,7 +36,7 @@ "@types/jest": "^26.0.13", "@types/lodash.get": "^4.4.6", "@types/lodash.set": "^4.3.6", - "@types/node": "14.0.27", + "@types/node": "^14.14.40", "@types/quill": "^2.0.1", "@typescript-eslint/eslint-plugin": "^2.13.0", "@typescript-eslint/parser": "^2.13.0", diff --git a/packages/node-dev/package.json b/packages/node-dev/package.json index 6ba68331a2..b005de16d7 100644 --- a/packages/node-dev/package.json +++ b/packages/node-dev/package.json @@ -55,7 +55,7 @@ "@oclif/command": "^1.5.18", "@oclif/errors": "^1.2.2", "@types/express": "^4.17.6", - "@types/node": "14.0.27", + "@types/node": "^14.14.40", "change-case": "^4.1.1", "copyfiles": "^2.1.1", "inquirer": "^7.0.1", diff --git a/packages/nodes-base/nodes/Crypto.node.ts b/packages/nodes-base/nodes/Crypto.node.ts index 79403ae002..dc602598a2 100644 --- a/packages/nodes-base/nodes/Crypto.node.ts +++ b/packages/nodes-base/nodes/Crypto.node.ts @@ -9,12 +9,12 @@ import { } from 'n8n-workflow'; import { + BinaryToTextEncoding, createHash, createHmac, createSign, getHashes, - HexBase64Latin1Encoding, - } from 'crypto'; +} from 'crypto'; export class Crypto implements INodeType { description: INodeTypeDescription = { @@ -60,7 +60,7 @@ export class Crypto implements INodeType { name: 'type', displayOptions: { show: { - action:[ + action: [ 'hash', ], }, @@ -93,7 +93,7 @@ export class Crypto implements INodeType { name: 'value', displayOptions: { show: { - action:[ + action: [ 'hash', ], }, @@ -123,7 +123,7 @@ export class Crypto implements INodeType { name: 'encoding', displayOptions: { show: { - action:[ + action: [ 'hash', ], }, @@ -147,7 +147,7 @@ export class Crypto implements INodeType { name: 'type', displayOptions: { show: { - action:[ + action: [ 'hmac', ], }, @@ -180,7 +180,7 @@ export class Crypto implements INodeType { name: 'value', displayOptions: { show: { - action:[ + action: [ 'hmac', ], }, @@ -210,7 +210,7 @@ export class Crypto implements INodeType { name: 'secret', displayOptions: { show: { - action:[ + action: [ 'hmac', ], }, @@ -224,7 +224,7 @@ export class Crypto implements INodeType { name: 'encoding', displayOptions: { show: { - action:[ + action: [ 'hmac', ], }, @@ -248,7 +248,7 @@ export class Crypto implements INodeType { name: 'value', displayOptions: { show: { - action:[ + action: [ 'sign', ], }, @@ -278,7 +278,7 @@ export class Crypto implements INodeType { name: 'algorithm', displayOptions: { show: { - action:[ + action: [ 'sign', ], }, @@ -295,7 +295,7 @@ export class Crypto implements INodeType { name: 'encoding', displayOptions: { show: { - action:[ + action: [ 'sign', ], }, @@ -319,7 +319,7 @@ export class Crypto implements INodeType { name: 'privateKey', displayOptions: { show: { - action:[ + action: [ 'sign', ], }, @@ -371,18 +371,18 @@ export class Crypto implements INodeType { if (action === 'hash') { const type = this.getNodeParameter('type', i) as string; - const encoding = this.getNodeParameter('encoding', i) as HexBase64Latin1Encoding; + const encoding = this.getNodeParameter('encoding', i) as BinaryToTextEncoding; newValue = createHash(type).update(value).digest(encoding); } if (action === 'hmac') { const type = this.getNodeParameter('type', i) as string; const secret = this.getNodeParameter('secret', i) as string; - const encoding = this.getNodeParameter('encoding', i) as HexBase64Latin1Encoding; + const encoding = this.getNodeParameter('encoding', i) as BinaryToTextEncoding; newValue = createHmac(type, secret).update(value).digest(encoding); } if (action === 'sign') { const algorithm = this.getNodeParameter('algorithm', i) as string; - const encoding = this.getNodeParameter('encoding', i) as HexBase64Latin1Encoding; + const encoding = this.getNodeParameter('encoding', i) as BinaryToTextEncoding; const privateKey = this.getNodeParameter('privateKey', i) as string; const sign = createSign(algorithm); sign.write(value as string); diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index bcaedd4bd3..e5e69ad4c4 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -566,7 +566,7 @@ "@types/mongodb": "^3.5.4", "@types/mqtt": "^2.5.0", "@types/mssql": "^6.0.2", - "@types/node": "14.0.27", + "@types/node": "^14.14.40", "@types/nodemailer": "^6.4.0", "@types/redis": "^2.8.11", "@types/request-promise-native": "~1.0.15", diff --git a/packages/workflow/package.json b/packages/workflow/package.json index 170f4c640e..8c5bf0b1d7 100644 --- a/packages/workflow/package.json +++ b/packages/workflow/package.json @@ -29,7 +29,7 @@ "@types/express": "^4.17.6", "@types/jest": "^26.0.13", "@types/lodash.get": "^4.4.6", - "@types/node": "14.0.27", + "@types/node": "^14.14.40", "jest": "^26.4.2", "ts-jest": "^26.3.0", "tslint": "^6.1.2",