From 8a2aece0b2f75201a20ccb30c612acfd11bc5900 Mon Sep 17 00:00:00 2001 From: Nathan Brown Date: Wed, 13 Sep 2023 10:04:13 +0100 Subject: [PATCH] feat(cb2-9045): fix build issues --- .github/workflows/ci.yml | 2 +- package-lock.json | 59 ++++++++++++-------------------------- package.json | 2 +- src/utils/Configuration.ts | 10 +++---- src/utils/decleration.d.ts | 1 + tsconfig.json | 3 +- 6 files changed, 29 insertions(+), 48 deletions(-) create mode 100644 src/utils/decleration.d.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f55cd5f..7b33e14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,4 +9,4 @@ jobs: with: args: '--all-projects' secrets: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} \ No newline at end of file + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} diff --git a/package-lock.json b/package-lock.json index 5702945..4cde0b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "ts-jest": "^26.1.1", "ts-node": "^8.5.4", "tslint": "^6.0.0", - "typescript": "3.8.3" + "typescript": "4.4.4" }, "engines": { "node": "18.*", @@ -3378,9 +3378,9 @@ "dev": true }, "node_modules/@types/triple-beam": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.2.tgz", - "integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.3.tgz", + "integrity": "sha512-6tOUG+nVHn0cJbVp25JFayS5UE6+xlbcNF9Lo9mU7U0zk3zeUShZied4YEQZjy1JBF043FSkdXw8YkUJuVtB5g==", "dev": true }, "node_modules/@types/uuid": { @@ -8465,20 +8465,6 @@ "node": ">= 4" } }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -13802,9 +13788,9 @@ "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==" }, "node_modules/nan": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", - "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==", + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", + "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==", "dev": true, "optional": true }, @@ -19626,9 +19612,9 @@ } }, "node_modules/typescript": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", - "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -23731,9 +23717,9 @@ "dev": true }, "@types/triple-beam": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.2.tgz", - "integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.3.tgz", + "integrity": "sha512-6tOUG+nVHn0cJbVp25JFayS5UE6+xlbcNF9Lo9mU7U0zk3zeUShZied4YEQZjy1JBF043FSkdXw8YkUJuVtB5g==", "dev": true }, "@types/uuid": { @@ -27781,13 +27767,6 @@ } } }, - "fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "optional": true - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -31894,9 +31873,9 @@ "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==" }, "nan": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", - "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==", + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", + "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==", "dev": true, "optional": true }, @@ -36539,9 +36518,9 @@ } }, "typescript": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", - "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", "dev": true }, "unbox-primitive": { diff --git a/package.json b/package.json index 791480b..0b1d731 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "ts-jest": "^26.1.1", "ts-node": "^8.5.4", "tslint": "^6.0.0", - "typescript": "3.8.3" + "typescript": "4.4.4" }, "dependencies": { "@types/js-yaml": "^3.12.2", diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index 6543428..703af84 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -1,11 +1,11 @@ // @ts-ignore -import * as yml from 'node-yaml'; import { Handler } from 'aws-lambda'; -import { IConfig, IFunctionEvent, IInvokeConfig, INotifyConfig, ISecretConfig } from '../models'; -import { ERRORS } from './Enums'; import SecretsManager, { GetSecretValueRequest, GetSecretValueResponse } from 'aws-sdk/clients/secretsmanager'; -import { safeLoad } from 'js-yaml'; import * as AWSXray from 'aws-xray-sdk'; +import { safeLoad } from 'js-yaml'; +import * as yml from 'node-yaml'; +import { IConfig, IFunctionEvent, IInvokeConfig, INotifyConfig, ISecretConfig } from '../models'; +import { ERRORS } from './Enums'; class Configuration { private static instance: Configuration; @@ -137,7 +137,7 @@ class Configuration { }; const resp: GetSecretValueResponse = await this.secretsClient.getSecretValue(req).promise(); try { - secret = await safeLoad(resp.SecretString as string); + secret = (await safeLoad(resp.SecretString as string)) as ISecretConfig; } catch (e) { throw new Error(ERRORS.SECRET_STRING_EMPTY); } diff --git a/src/utils/decleration.d.ts b/src/utils/decleration.d.ts new file mode 100644 index 0000000..b3e3dee --- /dev/null +++ b/src/utils/decleration.d.ts @@ -0,0 +1 @@ +declare module 'node-yaml'; diff --git a/tsconfig.json b/tsconfig.json index 26cc22e..0d1e34f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,7 @@ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, "resolveJsonModule": true, "experimentalDecorators": true, - "pretty": true + "pretty": true, + "useUnknownInCatchVariables": false } }