⬆️ Update types/node package in all packages (#1659)

* ⬆️ Update types/node package in all packages, fix type in crypto node

*  Fix build issue and some formatting

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
Ahsan Virani 2021-04-15 23:57:20 +02:00 committed by GitHub
parent ca4c3fa980
commit b54aae8c31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 21 deletions

View file

@ -32,7 +32,7 @@
"@types/jest": "^26.0.13", "@types/jest": "^26.0.13",
"@types/lodash.get": "^4.4.6", "@types/lodash.get": "^4.4.6",
"@types/mime-types": "^2.1.0", "@types/mime-types": "^2.1.0",
"@types/node": "14.0.27", "@types/node": "^14.14.40",
"@types/request-promise-native": "~1.0.15", "@types/request-promise-native": "~1.0.15",
"jest": "^26.4.2", "jest": "^26.4.2",
"source-map-support": "^0.5.9", "source-map-support": "^0.5.9",

View file

@ -36,7 +36,7 @@
"@types/jest": "^26.0.13", "@types/jest": "^26.0.13",
"@types/lodash.get": "^4.4.6", "@types/lodash.get": "^4.4.6",
"@types/lodash.set": "^4.3.6", "@types/lodash.set": "^4.3.6",
"@types/node": "14.0.27", "@types/node": "^14.14.40",
"@types/quill": "^2.0.1", "@types/quill": "^2.0.1",
"@typescript-eslint/eslint-plugin": "^2.13.0", "@typescript-eslint/eslint-plugin": "^2.13.0",
"@typescript-eslint/parser": "^2.13.0", "@typescript-eslint/parser": "^2.13.0",

View file

@ -55,7 +55,7 @@
"@oclif/command": "^1.5.18", "@oclif/command": "^1.5.18",
"@oclif/errors": "^1.2.2", "@oclif/errors": "^1.2.2",
"@types/express": "^4.17.6", "@types/express": "^4.17.6",
"@types/node": "14.0.27", "@types/node": "^14.14.40",
"change-case": "^4.1.1", "change-case": "^4.1.1",
"copyfiles": "^2.1.1", "copyfiles": "^2.1.1",
"inquirer": "^7.0.1", "inquirer": "^7.0.1",

View file

@ -9,12 +9,12 @@ import {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { import {
BinaryToTextEncoding,
createHash, createHash,
createHmac, createHmac,
createSign, createSign,
getHashes, getHashes,
HexBase64Latin1Encoding, } from 'crypto';
} from 'crypto';
export class Crypto implements INodeType { export class Crypto implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {
@ -60,7 +60,7 @@ export class Crypto implements INodeType {
name: 'type', name: 'type',
displayOptions: { displayOptions: {
show: { show: {
action:[ action: [
'hash', 'hash',
], ],
}, },
@ -93,7 +93,7 @@ export class Crypto implements INodeType {
name: 'value', name: 'value',
displayOptions: { displayOptions: {
show: { show: {
action:[ action: [
'hash', 'hash',
], ],
}, },
@ -123,7 +123,7 @@ export class Crypto implements INodeType {
name: 'encoding', name: 'encoding',
displayOptions: { displayOptions: {
show: { show: {
action:[ action: [
'hash', 'hash',
], ],
}, },
@ -147,7 +147,7 @@ export class Crypto implements INodeType {
name: 'type', name: 'type',
displayOptions: { displayOptions: {
show: { show: {
action:[ action: [
'hmac', 'hmac',
], ],
}, },
@ -180,7 +180,7 @@ export class Crypto implements INodeType {
name: 'value', name: 'value',
displayOptions: { displayOptions: {
show: { show: {
action:[ action: [
'hmac', 'hmac',
], ],
}, },
@ -210,7 +210,7 @@ export class Crypto implements INodeType {
name: 'secret', name: 'secret',
displayOptions: { displayOptions: {
show: { show: {
action:[ action: [
'hmac', 'hmac',
], ],
}, },
@ -224,7 +224,7 @@ export class Crypto implements INodeType {
name: 'encoding', name: 'encoding',
displayOptions: { displayOptions: {
show: { show: {
action:[ action: [
'hmac', 'hmac',
], ],
}, },
@ -248,7 +248,7 @@ export class Crypto implements INodeType {
name: 'value', name: 'value',
displayOptions: { displayOptions: {
show: { show: {
action:[ action: [
'sign', 'sign',
], ],
}, },
@ -278,7 +278,7 @@ export class Crypto implements INodeType {
name: 'algorithm', name: 'algorithm',
displayOptions: { displayOptions: {
show: { show: {
action:[ action: [
'sign', 'sign',
], ],
}, },
@ -295,7 +295,7 @@ export class Crypto implements INodeType {
name: 'encoding', name: 'encoding',
displayOptions: { displayOptions: {
show: { show: {
action:[ action: [
'sign', 'sign',
], ],
}, },
@ -319,7 +319,7 @@ export class Crypto implements INodeType {
name: 'privateKey', name: 'privateKey',
displayOptions: { displayOptions: {
show: { show: {
action:[ action: [
'sign', 'sign',
], ],
}, },
@ -371,18 +371,18 @@ export class Crypto implements INodeType {
if (action === 'hash') { if (action === 'hash') {
const type = this.getNodeParameter('type', i) as string; 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); newValue = createHash(type).update(value).digest(encoding);
} }
if (action === 'hmac') { if (action === 'hmac') {
const type = this.getNodeParameter('type', i) as string; const type = this.getNodeParameter('type', i) as string;
const secret = this.getNodeParameter('secret', 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); newValue = createHmac(type, secret).update(value).digest(encoding);
} }
if (action === 'sign') { if (action === 'sign') {
const algorithm = this.getNodeParameter('algorithm', i) as string; 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 privateKey = this.getNodeParameter('privateKey', i) as string;
const sign = createSign(algorithm); const sign = createSign(algorithm);
sign.write(value as string); sign.write(value as string);

View file

@ -566,7 +566,7 @@
"@types/mongodb": "^3.5.4", "@types/mongodb": "^3.5.4",
"@types/mqtt": "^2.5.0", "@types/mqtt": "^2.5.0",
"@types/mssql": "^6.0.2", "@types/mssql": "^6.0.2",
"@types/node": "14.0.27", "@types/node": "^14.14.40",
"@types/nodemailer": "^6.4.0", "@types/nodemailer": "^6.4.0",
"@types/redis": "^2.8.11", "@types/redis": "^2.8.11",
"@types/request-promise-native": "~1.0.15", "@types/request-promise-native": "~1.0.15",

View file

@ -29,7 +29,7 @@
"@types/express": "^4.17.6", "@types/express": "^4.17.6",
"@types/jest": "^26.0.13", "@types/jest": "^26.0.13",
"@types/lodash.get": "^4.4.6", "@types/lodash.get": "^4.4.6",
"@types/node": "14.0.27", "@types/node": "^14.14.40",
"jest": "^26.4.2", "jest": "^26.4.2",
"ts-jest": "^26.3.0", "ts-jest": "^26.3.0",
"tslint": "^6.1.2", "tslint": "^6.1.2",