From 14d8d2b22ecdea5971bc55f1c711ff62b04261c1 Mon Sep 17 00:00:00 2001 From: RXRD <118821868+RiXelanya@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:16:30 +0700 Subject: [PATCH] fix: dependency on google secret (#396) * fix * fix * fix * Update package-lock.json * fix * fix * fix --- package-lock.json | 1292 +---------------- package.json | 1 - src/app.module.ts | 39 +- src/common/caches/index.ts | 24 +- src/common/common.module.ts | 28 +- .../debio-conversion.module.ts | 6 +- .../debio-conversion.service.ts | 30 +- src/common/escrow/escrow.module.ts | 3 - src/common/escrow/escrow.service.ts | 12 +- src/common/ethereum/ethereum.module.ts | 16 +- src/common/ethereum/ethereum.service.ts | 14 +- src/common/mailer/mailer.manager.ts | 18 +- src/common/mailer/mailer.module.ts | 23 +- src/common/substrate/index.ts | 6 +- src/common/substrate/substrate.service.ts | 15 +- src/config.ts | 49 + src/indexer/indexer.handler.ts | 8 +- .../genetic-analysis-order-paid.handler.ts | 8 +- .../orders/order-paid/order-paid.handler.ts | 9 +- .../service-request-created.handler.ts | 6 +- .../service-created.handler.ts | 6 +- .../substrate-listener.module.ts | 44 +- .../unstaked.service.ts | 10 +- .../lab-unstake/lab-unstake.service.ts | 10 +- src/schedulers/mailer/mailer.service.ts | 6 +- .../menstrual-subscription.service.ts | 12 +- src/schedulers/schedulers.module.ts | 28 +- src/schedulers/unstaked/unstaked.service.ts | 10 +- .../events/certification-events.spec.ts | 31 +- .../events/genetic-analysis-events.spec.ts | 31 +- .../genetic-analysis-order-events.spec.ts | 31 +- .../events/genetic-analyst-events.spec.ts | 31 +- ...netic-analyst-qualification-events.spec.ts | 31 +- .../genetic-analyst-service-events.spec.ts | 31 +- .../events/genetic-data-events.spec.ts | 31 +- .../events/genetic-testing-events.spec.ts | 34 +- test/e2e/indexer/events/labs-events.spec.ts | 34 +- .../events/menstrual-calendar-events.spec.ts | 31 +- test/e2e/indexer/events/orders-events.spec.ts | 31 +- .../e2e/indexer/events/service-events.spec.ts | 31 +- .../events/service-request-events.spec.ts | 52 +- .../genetic-analysis-events.spec.ts | 52 +- .../genetic-analysis-events.spec.ts | 34 +- .../genetic-analyst-service-events.spec.ts | 34 +- .../genetic-analyst-events.spec.ts | 34 +- .../genetic-testing-events.spec.ts | 37 +- .../commands/labs/labs-events.spec.ts | 31 +- .../commands/orders/orders-events.spec.ts | 63 +- .../service-request-events.spec.ts | 34 +- .../commands/services/services-events.spec.ts | 36 +- test/e2e/schedulers/lab-unstake.spec.ts | 50 +- test/e2e/schedulers/mailer.spec.ts | 59 +- test/e2e/schedulers/unstaked.spec.ts | 50 +- ...enetic-analysis-order-paid.handler.spec.ts | 22 - .../order-fulfilled.handler.spec.ts | 3 +- .../order-paid/order-paid.handler.spec.ts | 22 - .../service-request-created.handler.spec.ts | 6 - .../service-created.handler.spec.ts | 6 - .../substrate-listener.handler.spec.ts | 15 - test/unit/mock.ts | 8 - .../genetic-analyst-unstaked.service.spec.ts | 19 - .../lab/lab-unstake.service.spec.ts | 19 - .../schedulers/mailer/mailer.service.spec.ts | 6 - .../menstrual-subscription.service.spec.ts | 38 +- .../unstaked/unstaked.service.spec.ts | 19 - 65 files changed, 222 insertions(+), 2638 deletions(-) create mode 100644 src/config.ts diff --git a/package-lock.json b/package-lock.json index d60e6b83..4e46c29c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "2.4.1", "license": "AGPL-3.0", "dependencies": { - "@debionetwork/nestjs-gcloud-secret-manager": "^0.0.3", "@debionetwork/polkadot-provider": "0.0.17", "@elastic/elasticsearch": "^7.13.0", "@google-cloud/storage": "^6.2.2", @@ -2163,19 +2162,6 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/@debionetwork/nestjs-gcloud-secret-manager": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@debionetwork/nestjs-gcloud-secret-manager/-/nestjs-gcloud-secret-manager-0.0.3.tgz", - "integrity": "sha512-biOSpzGSNCq2b/Ig5X34vQ9pPUBfwn+qgGIaANVWJ8hP8RS9Fx5P3h4HfkDi3qJByKFbGDYRoQAqDb8FHGFUgg==", - "dependencies": { - "@google-cloud/secret-manager": "^4.0.0" - }, - "peerDependencies": { - "@nestjs/common": "^8.0.6", - "@nestjs/core": "^8.0.0", - "@nestjs/platform-express": "^8.0.0" - } - }, "node_modules/@debionetwork/polkadot-provider": { "version": "0.0.17", "resolved": "https://registry.npmjs.org/@debionetwork/polkadot-provider/-/polkadot-provider-0.0.17.tgz", @@ -2945,17 +2931,6 @@ "node": ">=12" } }, - "node_modules/@google-cloud/secret-manager": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@google-cloud/secret-manager/-/secret-manager-4.0.0.tgz", - "integrity": "sha512-wHlMAldXuQ+D7P2A3HHn/2u6aAPH+S3h8G9sH+O6cQPKRgqt3clCN7k9jZy7lJsuS09LaXgi05CEupnbmtNDhw==", - "dependencies": { - "google-gax": "^3.0.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/@google-cloud/storage": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-6.2.2.tgz", @@ -3011,102 +2986,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@grpc/grpc-js": { - "version": "1.8.17", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.8.17.tgz", - "integrity": "sha512-DGuSbtMFbaRsyffMf+VEkVu8HkSXEUfO3UyGJNtqxW9ABdtTIA+2UXAJpwbJS+xfQxuwqLUeELmL6FuZkOqPxw==", - "dependencies": { - "@grpc/proto-loader": "^0.7.0", - "@types/node": ">=12.12.47" - }, - "engines": { - "node": "^8.13.0 || >=10.10.0" - } - }, - "node_modules/@grpc/proto-loader": { - "version": "0.7.7", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.7.tgz", - "integrity": "sha512-1TIeXOi8TuSCQprPItwoMymZXxWT0CPxUhkrkeCUH+D8U7QDwQ6b7SUz2MaLuWM2llT+J/TVFLmQI5KtML3BhQ==", - "dependencies": { - "@types/long": "^4.0.1", - "lodash.camelcase": "^4.3.0", - "long": "^4.0.0", - "protobufjs": "^7.0.0", - "yargs": "^17.7.2" - }, - "bin": { - "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@grpc/proto-loader/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@grpc/proto-loader/node_modules/protobufjs": { - "version": "7.2.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.4.tgz", - "integrity": "sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/@grpc/proto-loader/node_modules/protobufjs/node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" - }, - "node_modules/@grpc/proto-loader/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@grpc/proto-loader/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "engines": { - "node": ">=12" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", @@ -3544,17 +3423,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@jsdoc/salty": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.5.tgz", - "integrity": "sha512-TfRP53RqunNe2HBobVBJ0VLhK1HbfvBYeTC1ahnN64PWvyYyGebmMiPkuwvD9fpw2ZbkoPb8Q7mwy0aR8Z9rvw==", - "dependencies": { - "lodash": "^4.17.21" - }, - "engines": { - "node": ">=v12.0.0" - } - }, "node_modules/@nestjs-modules/mailer": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/@nestjs-modules/mailer/-/mailer-1.8.1.tgz", @@ -5190,60 +5058,6 @@ "node": ">=14.0.0" } }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" - }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" - }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" - }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" - }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" - }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" - }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" - }, "node_modules/@scure/base": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.0.0.tgz", @@ -5469,15 +5283,6 @@ "@types/range-parser": "*" } }, - "node_modules/@types/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==", - "dependencies": { - "@types/minimatch": "^5.1.2", - "@types/node": "*" - } - }, "node_modules/@types/graceful-fs": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", @@ -5529,41 +5334,12 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "node_modules/@types/linkify-it": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", - "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==" - }, - "node_modules/@types/long": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" - }, - "node_modules/@types/markdown-it": { - "version": "12.2.3", - "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", - "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", - "dependencies": { - "@types/linkify-it": "*", - "@types/mdurl": "*" - } - }, - "node_modules/@types/mdurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", - "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==" - }, "node_modules/@types/mime": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", "dev": true }, - "node_modules/@types/minimatch": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==" - }, "node_modules/@types/node": { "version": "16.6.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.6.1.tgz", @@ -5607,15 +5383,6 @@ "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", "dev": true }, - "node_modules/@types/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-F3OznnSLAUxFrCEu/L5PY8+ny8DtcFRjx7fZZ9bycvXRi3KPTRS9HOitGZwvPg0juRhXFWIeKX58cnX5YqLohQ==", - "dependencies": { - "@types/glob": "*", - "@types/node": "*" - } - }, "node_modules/@types/serve-static": { "version": "1.13.10", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", @@ -6062,6 +5829,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -6978,11 +6746,6 @@ "node": ">= 6" } }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" - }, "node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", @@ -7259,17 +7022,6 @@ } ] }, - "node_modules/catharsis": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", - "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", - "dependencies": { - "lodash": "^4.17.15" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/chalk": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", @@ -9869,273 +9621,6 @@ "node": ">=12" } }, - "node_modules/google-gax": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-3.6.0.tgz", - "integrity": "sha512-2fyb61vWxUonHiArRNJQmE4tx5oY1ni8VPo08fzII409vDSCWG7apDX4qNOQ2GXXT82gLBn3d3P1Dydh7pWjyw==", - "dependencies": { - "@grpc/grpc-js": "~1.8.0", - "@grpc/proto-loader": "^0.7.0", - "@types/long": "^4.0.0", - "@types/rimraf": "^3.0.2", - "abort-controller": "^3.0.0", - "duplexify": "^4.0.0", - "fast-text-encoding": "^1.0.3", - "google-auth-library": "^8.0.2", - "is-stream-ended": "^0.1.4", - "node-fetch": "^2.6.1", - "object-hash": "^3.0.0", - "proto3-json-serializer": "^1.0.0", - "protobufjs": "7.2.3", - "protobufjs-cli": "1.1.1", - "retry-request": "^5.0.0" - }, - "bin": { - "compileProtos": "build/tools/compileProtos.js", - "minifyProtoJson": "build/tools/minify.js" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/google-gax/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/google-gax/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/google-gax/node_modules/escodegen": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=4.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/google-gax/node_modules/eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/google-gax/node_modules/espree": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz", - "integrity": "sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A==", - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/google-gax/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/google-gax/node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/google-gax/node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" - }, - "node_modules/google-gax/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/google-gax/node_modules/object-hash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", - "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", - "engines": { - "node": ">= 6" - } - }, - "node_modules/google-gax/node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/google-gax/node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/google-gax/node_modules/protobufjs": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.3.tgz", - "integrity": "sha512-TtpvOqwB5Gdz/PQmOjgsrGH1nHjAQVCN7JG4A6r1sXRWESL5rNMAiRcBQlCAdKxZcAbstExQePYG8xof/JVRgg==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/google-gax/node_modules/protobufjs-cli": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/protobufjs-cli/-/protobufjs-cli-1.1.1.tgz", - "integrity": "sha512-VPWMgIcRNyQwWUv8OLPyGQ/0lQY/QTQAVN5fh+XzfDwsVw1FZ2L3DM/bcBf8WPiRz2tNpaov9lPZfNcmNo6LXA==", - "dependencies": { - "chalk": "^4.0.0", - "escodegen": "^1.13.0", - "espree": "^9.0.0", - "estraverse": "^5.1.0", - "glob": "^8.0.0", - "jsdoc": "^4.0.0", - "minimist": "^1.2.0", - "semver": "^7.1.2", - "tmp": "^0.2.1", - "uglify-js": "^3.7.7" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - }, - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "protobufjs": "^7.0.0" - } - }, - "node_modules/google-gax/node_modules/protobufjs-cli/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/google-gax/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/google-gax/node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dependencies": { - "rimraf": "^3.0.0" - }, - "engines": { - "node": ">=8.17.0" - } - }, - "node_modules/google-gax/node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/google-p12-pem": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-4.0.0.tgz", @@ -10935,11 +10420,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-stream-ended": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", - "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" - }, "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -12252,61 +11732,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/js2xmlparser": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", - "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", - "dependencies": { - "xmlcreate": "^2.0.4" - } - }, - "node_modules/jsdoc": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.2.tgz", - "integrity": "sha512-e8cIg2z62InH7azBBi3EsSEqrKx+nUtAS5bBcYTSpZFA+vhNPyhv8PTFZ0WsjOPDj04/dOLlm08EDcQJDqaGQg==", - "dependencies": { - "@babel/parser": "^7.20.15", - "@jsdoc/salty": "^0.2.1", - "@types/markdown-it": "^12.2.3", - "bluebird": "^3.7.2", - "catharsis": "^0.9.0", - "escape-string-regexp": "^2.0.0", - "js2xmlparser": "^4.0.2", - "klaw": "^3.0.0", - "markdown-it": "^12.3.2", - "markdown-it-anchor": "^8.4.1", - "marked": "^4.0.10", - "mkdirp": "^1.0.4", - "requizzle": "^0.2.3", - "strip-json-comments": "^3.1.0", - "underscore": "~1.13.2" - }, - "bin": { - "jsdoc": "jsdoc.js" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/jsdoc/node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/jsdoc/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/jsdom": { "version": "16.7.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", @@ -12480,14 +11905,6 @@ "safe-buffer": "^5.0.1" } }, - "node_modules/klaw": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", - "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", - "dependencies": { - "graceful-fs": "^4.1.9" - } - }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -12698,11 +12115,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" - }, "node_modules/lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -12758,11 +12170,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -12901,67 +12308,6 @@ "tmpl": "1.0.5" } }, - "node_modules/markdown-it": { - "version": "12.3.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", - "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", - "dependencies": { - "argparse": "^2.0.1", - "entities": "~2.1.0", - "linkify-it": "^3.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - }, - "bin": { - "markdown-it": "bin/markdown-it.js" - } - }, - "node_modules/markdown-it-anchor": { - "version": "8.6.7", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz", - "integrity": "sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA==", - "peerDependencies": { - "@types/markdown-it": "*", - "markdown-it": "*" - } - }, - "node_modules/markdown-it/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "node_modules/markdown-it/node_modules/entities": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/markdown-it/node_modules/linkify-it": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", - "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", - "dependencies": { - "uc.micro": "^1.0.1" - } - }, - "node_modules/marked": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", - "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", - "bin": { - "marked": "bin/marked.js" - }, - "engines": { - "node": ">= 12" - } - }, - "node_modules/mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" - }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -14685,42 +14031,6 @@ "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==" }, - "node_modules/proto3-json-serializer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-1.0.2.tgz", - "integrity": "sha512-wHxf8jYZ/LUP3M7XmULDKnbxBn+Bvk6SM+tDCPVTp9vraIzUi9hHsOBb1n2Y0VV0ukx4zBN/2vzMQYs4KWwRpg==", - "dependencies": { - "protobufjs": "^6.11.3" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -15327,14 +14637,6 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, - "node_modules/requizzle": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz", - "integrity": "sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw==", - "dependencies": { - "lodash": "^4.17.21" - } - }, "node_modules/resolve": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", @@ -15950,6 +15252,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, "engines": { "node": ">=8" }, @@ -16949,11 +16252,6 @@ "node": ">=0.8.0" } }, - "node_modules/underscore": { - "version": "1.13.6", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", - "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==" - }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -17629,11 +16927,6 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" }, - "node_modules/xmlcreate": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", - "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==" - }, "node_modules/xregexp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz", @@ -19218,14 +18511,6 @@ } } }, - "@debionetwork/nestjs-gcloud-secret-manager": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@debionetwork/nestjs-gcloud-secret-manager/-/nestjs-gcloud-secret-manager-0.0.3.tgz", - "integrity": "sha512-biOSpzGSNCq2b/Ig5X34vQ9pPUBfwn+qgGIaANVWJ8hP8RS9Fx5P3h4HfkDi3qJByKFbGDYRoQAqDb8FHGFUgg==", - "requires": { - "@google-cloud/secret-manager": "^4.0.0" - } - }, "@debionetwork/polkadot-provider": { "version": "0.0.17", "resolved": "https://registry.npmjs.org/@debionetwork/polkadot-provider/-/polkadot-provider-0.0.17.tgz", @@ -19672,14 +18957,6 @@ "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-3.0.0.tgz", "integrity": "sha512-91ArYvRgXWb73YvEOBMmOcJc0bDRs5yiVHnqkwoG0f3nm7nZuipllz6e7BvFESBvjkDTBC0zMD8QxedUwNLc1A==" }, - "@google-cloud/secret-manager": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@google-cloud/secret-manager/-/secret-manager-4.0.0.tgz", - "integrity": "sha512-wHlMAldXuQ+D7P2A3HHn/2u6aAPH+S3h8G9sH+O6cQPKRgqt3clCN7k9jZy7lJsuS09LaXgi05CEupnbmtNDhw==", - "requires": { - "google-gax": "^3.0.1" - } - }, "@google-cloud/storage": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-6.2.2.tgz", @@ -19710,93 +18987,15 @@ "mime": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==" - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "requires": { - "yocto-queue": "^0.1.0" - } - } - } - }, - "@grpc/grpc-js": { - "version": "1.8.17", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.8.17.tgz", - "integrity": "sha512-DGuSbtMFbaRsyffMf+VEkVu8HkSXEUfO3UyGJNtqxW9ABdtTIA+2UXAJpwbJS+xfQxuwqLUeELmL6FuZkOqPxw==", - "requires": { - "@grpc/proto-loader": "^0.7.0", - "@types/node": ">=12.12.47" - } - }, - "@grpc/proto-loader": { - "version": "0.7.7", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.7.tgz", - "integrity": "sha512-1TIeXOi8TuSCQprPItwoMymZXxWT0CPxUhkrkeCUH+D8U7QDwQ6b7SUz2MaLuWM2llT+J/TVFLmQI5KtML3BhQ==", - "requires": { - "@types/long": "^4.0.1", - "lodash.camelcase": "^4.3.0", - "long": "^4.0.0", - "protobufjs": "^7.0.0", - "yargs": "^17.7.2" - }, - "dependencies": { - "cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - } - }, - "protobufjs": { - "version": "7.2.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.4.tgz", - "integrity": "sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "dependencies": { - "long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" - } - } + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==" }, - "yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "requires": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" + "yocto-queue": "^0.1.0" } - }, - "yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" } } }, @@ -20142,14 +19341,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "@jsdoc/salty": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.5.tgz", - "integrity": "sha512-TfRP53RqunNe2HBobVBJ0VLhK1HbfvBYeTC1ahnN64PWvyYyGebmMiPkuwvD9fpw2ZbkoPb8Q7mwy0aR8Z9rvw==", - "requires": { - "lodash": "^4.17.21" - } - }, "@nestjs-modules/mailer": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/@nestjs-modules/mailer/-/mailer-1.8.1.tgz", @@ -21290,60 +20481,6 @@ "websocket": "^1.0.34" } }, - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "requires": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" - }, "@scure/base": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.0.0.tgz", @@ -21553,15 +20690,6 @@ "@types/range-parser": "*" } }, - "@types/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==", - "requires": { - "@types/minimatch": "^5.1.2", - "@types/node": "*" - } - }, "@types/graceful-fs": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", @@ -21613,41 +20741,12 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "@types/linkify-it": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", - "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==" - }, - "@types/long": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" - }, - "@types/markdown-it": { - "version": "12.2.3", - "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", - "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", - "requires": { - "@types/linkify-it": "*", - "@types/mdurl": "*" - } - }, - "@types/mdurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", - "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==" - }, "@types/mime": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", "dev": true }, - "@types/minimatch": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==" - }, "@types/node": { "version": "16.6.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.6.1.tgz", @@ -21691,15 +20790,6 @@ "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", "dev": true }, - "@types/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-F3OznnSLAUxFrCEu/L5PY8+ny8DtcFRjx7fZZ9bycvXRi3KPTRS9HOitGZwvPg0juRhXFWIeKX58cnX5YqLohQ==", - "requires": { - "@types/glob": "*", - "@types/node": "*" - } - }, "@types/serve-static": { "version": "1.13.10", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", @@ -22054,6 +21144,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, "requires": {} }, "acorn-walk": { @@ -22797,11 +21888,6 @@ } } }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" - }, "bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", @@ -23004,14 +22090,6 @@ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001361.tgz", "integrity": "sha512-ybhCrjNtkFji1/Wto6SSJKkWk6kZgVQsDq5QI83SafsF6FXv2JB4df9eEdH6g8sdGgqTXrFLjAxqBGgYoU3azQ==" }, - "catharsis": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", - "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", - "requires": { - "lodash": "^4.17.15" - } - }, "chalk": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", @@ -25019,196 +24097,6 @@ "lru-cache": "^6.0.0" } }, - "google-gax": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-3.6.0.tgz", - "integrity": "sha512-2fyb61vWxUonHiArRNJQmE4tx5oY1ni8VPo08fzII409vDSCWG7apDX4qNOQ2GXXT82gLBn3d3P1Dydh7pWjyw==", - "requires": { - "@grpc/grpc-js": "~1.8.0", - "@grpc/proto-loader": "^0.7.0", - "@types/long": "^4.0.0", - "@types/rimraf": "^3.0.2", - "abort-controller": "^3.0.0", - "duplexify": "^4.0.0", - "fast-text-encoding": "^1.0.3", - "google-auth-library": "^8.0.2", - "is-stream-ended": "^0.1.4", - "node-fetch": "^2.6.1", - "object-hash": "^3.0.0", - "proto3-json-serializer": "^1.0.0", - "protobufjs": "7.2.3", - "protobufjs-cli": "1.1.1", - "retry-request": "^5.0.0" - }, - "dependencies": { - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "requires": { - "balanced-match": "^1.0.0" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "escodegen": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", - "requires": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - } - }, - "eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==" - }, - "espree": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz", - "integrity": "sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A==", - "requires": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - } - }, - "glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - } - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" - }, - "minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "requires": { - "brace-expansion": "^2.0.1" - } - }, - "object-hash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", - "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==" - }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==" - }, - "protobufjs": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.3.tgz", - "integrity": "sha512-TtpvOqwB5Gdz/PQmOjgsrGH1nHjAQVCN7JG4A6r1sXRWESL5rNMAiRcBQlCAdKxZcAbstExQePYG8xof/JVRgg==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - } - }, - "protobufjs-cli": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/protobufjs-cli/-/protobufjs-cli-1.1.1.tgz", - "integrity": "sha512-VPWMgIcRNyQwWUv8OLPyGQ/0lQY/QTQAVN5fh+XzfDwsVw1FZ2L3DM/bcBf8WPiRz2tNpaov9lPZfNcmNo6LXA==", - "requires": { - "chalk": "^4.0.0", - "escodegen": "^1.13.0", - "espree": "^9.0.0", - "estraverse": "^5.1.0", - "glob": "^8.0.0", - "jsdoc": "^4.0.0", - "minimist": "^1.2.0", - "semver": "^7.1.2", - "tmp": "^0.2.1", - "uglify-js": "^3.7.7" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" - } - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true - }, - "tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "requires": { - "rimraf": "^3.0.0" - } - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "requires": { - "prelude-ls": "~1.1.2" - } - } - } - }, "google-p12-pem": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-4.0.0.tgz", @@ -25785,11 +24673,6 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" }, - "is-stream-ended": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", - "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" - }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -26773,48 +25656,6 @@ "esprima": "^4.0.0" } }, - "js2xmlparser": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", - "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", - "requires": { - "xmlcreate": "^2.0.4" - } - }, - "jsdoc": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.2.tgz", - "integrity": "sha512-e8cIg2z62InH7azBBi3EsSEqrKx+nUtAS5bBcYTSpZFA+vhNPyhv8PTFZ0WsjOPDj04/dOLlm08EDcQJDqaGQg==", - "requires": { - "@babel/parser": "^7.20.15", - "@jsdoc/salty": "^0.2.1", - "@types/markdown-it": "^12.2.3", - "bluebird": "^3.7.2", - "catharsis": "^0.9.0", - "escape-string-regexp": "^2.0.0", - "js2xmlparser": "^4.0.2", - "klaw": "^3.0.0", - "markdown-it": "^12.3.2", - "markdown-it-anchor": "^8.4.1", - "marked": "^4.0.10", - "mkdirp": "^1.0.4", - "requizzle": "^0.2.3", - "strip-json-comments": "^3.1.0", - "underscore": "~1.13.2" - }, - "dependencies": { - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==" - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - } - } - }, "jsdom": { "version": "16.7.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", @@ -26956,14 +25797,6 @@ "safe-buffer": "^5.0.1" } }, - "klaw": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", - "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", - "requires": { - "graceful-fs": "^4.1.9" - } - }, "kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -27129,11 +25962,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" - }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -27179,11 +26007,6 @@ } } }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -27296,54 +26119,6 @@ "tmpl": "1.0.5" } }, - "markdown-it": { - "version": "12.3.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", - "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", - "requires": { - "argparse": "^2.0.1", - "entities": "~2.1.0", - "linkify-it": "^3.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - }, - "dependencies": { - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "entities": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==" - }, - "linkify-it": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", - "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", - "requires": { - "uc.micro": "^1.0.1" - } - } - } - }, - "markdown-it-anchor": { - "version": "8.6.7", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz", - "integrity": "sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA==", - "requires": {} - }, - "marked": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", - "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==" - }, - "mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" - }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -28708,34 +27483,6 @@ "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==" }, - "proto3-json-serializer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-1.0.2.tgz", - "integrity": "sha512-wHxf8jYZ/LUP3M7XmULDKnbxBn+Bvk6SM+tDCPVTp9vraIzUi9hHsOBb1n2Y0VV0ukx4zBN/2vzMQYs4KWwRpg==", - "requires": { - "protobufjs": "^6.11.3" - } - }, - "protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - } - }, "proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -29241,14 +27988,6 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, - "requizzle": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz", - "integrity": "sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw==", - "requires": { - "lodash": "^4.17.21" - } - }, "resolve": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", @@ -29707,7 +28446,8 @@ "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true }, "stubs": { "version": "3.0.0", @@ -30370,11 +29110,6 @@ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.2.tgz", "integrity": "sha512-AaQNokTNgExWrkEYA24BTNMSjyqEXPSfhqoS0AxmHkCJ4U+Dyy5AvbGV/sqxuxficEfGGoX3zWw9R7QpLFfEsg==" }, - "underscore": { - "version": "1.13.6", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", - "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==" - }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -30869,11 +29604,6 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" }, - "xmlcreate": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", - "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==" - }, "xregexp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz", diff --git a/package.json b/package.json index 7381d195..153c7e64 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ }, "dependencies": { "@debionetwork/polkadot-provider": "0.0.17", - "@debionetwork/nestjs-gcloud-secret-manager": "^0.0.3", "@elastic/elasticsearch": "^7.13.0", "@google-cloud/storage": "^6.2.2", "@nestjs-modules/mailer": "^1.8.1", diff --git a/src/app.module.ts b/src/app.module.ts index 02118fc1..5e778618 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { MailerModule } from '@nestjs-modules/mailer'; import { Module } from '@nestjs/common'; import { ScheduleModule } from '@nestjs/schedule'; @@ -15,7 +11,7 @@ import { EscrowAccounts } from '@common/escrow/models/deposit.entity'; import { IndexerModule } from '@indexer/indexer.module'; import { SubstrateListenerModule } from '@listeners/substrate-listener/substrate-listener.module'; import { SchedulersModule } from '@schedulers/schedulers.module'; -import { keyList, SecretKeyList } from '@common/secrets'; +import { config } from './config'; // eslint-disable-next-line @typescript-eslint/no-var-requires require('dotenv').config(); @@ -23,7 +19,6 @@ require('dotenv').config(); @Module({ imports: [ ScheduleModule.forRoot(), - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), TypeOrmModule.forRootAsync({ imports: [ ProcessEnvModule.setDefault({ @@ -31,23 +26,15 @@ require('dotenv').config(); HOST_POSTGRES: 'HOST_POSTGRES', DB_POSTGRES: 'debio_escrow_dev', }), - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), ], - inject: [ProcessEnvProxy, GCloudSecretManagerService], - useFactory: async ( - processEnvProxy: ProcessEnvProxy, - gCloudSecretManagerService: GCloudSecretManagerService, - ) => { + inject: [ProcessEnvProxy], + useFactory: async (processEnvProxy: ProcessEnvProxy) => { return { type: 'postgres', host: processEnvProxy.env.HOST_POSTGRES, port: 5432, - username: gCloudSecretManagerService - .getSecret('POSTGRES_USERNAME') - .toString(), - password: gCloudSecretManagerService - .getSecret('POSTGRES_PASSWORD') - .toString(), + username: config.POSTGRES_USERNAME.toString(), + password: config.POSTGRES_PASSWORD.toString(), database: processEnvProxy.env.DB_POSTGRES, entities: [EscrowAccounts], autoLoadEntities: true, @@ -62,23 +49,15 @@ require('dotenv').config(); HOST_POSTGRES: 'HOST_POSTGRES', DB_LOCATION: 'debio_locations', }), - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), ], - inject: [ProcessEnvProxy, GCloudSecretManagerService], - useFactory: async ( - processEnvProxy: ProcessEnvProxy, - gCloudSecretManagerService: GCloudSecretManagerService, - ) => { + inject: [ProcessEnvProxy], + useFactory: async (processEnvProxy: ProcessEnvProxy) => { return { type: 'postgres', host: processEnvProxy.env.HOST_POSTGRES, port: 5432, - username: gCloudSecretManagerService - .getSecret('POSTGRES_USERNAME') - .toString(), - password: gCloudSecretManagerService - .getSecret('POSTGRES_PASSWORD') - .toString(), + username: config.POSTGRES_USERNAME.toString(), + password: config.POSTGRES_PASSWORD.toString(), database: processEnvProxy.env.DB_LOCATION, entities: [...LocationEntities], autoLoadEntities: true, diff --git a/src/common/caches/index.ts b/src/common/caches/index.ts index 9cc3e576..eb8ceb02 100644 --- a/src/common/caches/index.ts +++ b/src/common/caches/index.ts @@ -1,31 +1,21 @@ import { CacheModule, Module } from '@nestjs/common'; import { CachesService } from './caches.service'; import * as redisStore from 'cache-manager-redis-store'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; -import { keyList, SecretKeyList } from '@common/secrets'; +import { config } from '../../config'; require('dotenv').config(); // eslint-disable-line @Module({ imports: [ CacheModule.registerAsync({ - imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), - ], - inject: [GCloudSecretManagerService], - useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, - ) => { + imports: [], + inject: [], + useFactory: async () => { return { store: redisStore, - host: gCloudSecretManagerService.getSecret('REDIS_HOST').toString(), - port: gCloudSecretManagerService.getSecret('REDIS_PORT'), - auth_pass: gCloudSecretManagerService - .getSecret('REDIS_PASSWORD') - .toString(), + host: config.REDIS_HOST.toString(), + port: config.REDIS_PORT, + auth_pass: config.REDIS_PASSWORD.toString(), }; }, }), diff --git a/src/common/common.module.ts b/src/common/common.module.ts index 8107d9d1..dc94a2c5 100644 --- a/src/common/common.module.ts +++ b/src/common/common.module.ts @@ -1,11 +1,7 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { Module } from '@nestjs/common'; import { CqrsModule } from '@nestjs/cqrs'; import { ElasticsearchModule } from '@nestjs/elasticsearch'; -import { keyList, SecretKeyList } from '@common/secrets'; +import { config } from '../config'; // eslint-disable-next-line @typescript-eslint/no-var-requires require('dotenv').config(); @@ -13,23 +9,13 @@ require('dotenv').config(); @Module({ imports: [ ElasticsearchModule.registerAsync({ - imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), - ], - inject: [GCloudSecretManagerService], - useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, - ) => ({ - node: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_NODE') - .toString(), + imports: [], + inject: [], + useFactory: async () => ({ + node: config.ELASTICSEARCH_NODE.toString(), auth: { - username: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_USERNAME') - .toString(), - password: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_PASSWORD') - .toString(), + username: config.ELASTICSEARCH_USERNAME.toString(), + password: config.ELASTICSEARCH_PASSWORD.toString(), }, }), }), diff --git a/src/common/debio-conversion/debio-conversion.module.ts b/src/common/debio-conversion/debio-conversion.module.ts index 8b5eebb1..159c384b 100644 --- a/src/common/debio-conversion/debio-conversion.module.ts +++ b/src/common/debio-conversion/debio-conversion.module.ts @@ -1,12 +1,8 @@ -import { GCloudSecretManagerModule } from '@debionetwork/nestjs-gcloud-secret-manager'; import { Module } from '@nestjs/common'; import { DebioConversionService } from './debio-conversion.service'; -import { SecretKeyList } from '@common/secrets'; @Module({ - imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), - ], + imports: [], providers: [DebioConversionService], exports: [DebioConversionService], }) diff --git a/src/common/debio-conversion/debio-conversion.service.ts b/src/common/debio-conversion/debio-conversion.service.ts index e6c5c221..20b76a2e 100644 --- a/src/common/debio-conversion/debio-conversion.service.ts +++ b/src/common/debio-conversion/debio-conversion.service.ts @@ -1,29 +1,19 @@ -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import { Injectable, Logger } from '@nestjs/common'; import axios from 'axios'; -import { keyList } from '@common/secrets'; +import { config } from '../../config'; @Injectable() export class DebioConversionService { private readonly logger: Logger = new Logger(DebioConversionService.name); - constructor( - private readonly gCloudSecretManagerService: GCloudSecretManagerService, - ) {} async getExchange() { try { const res = await axios.get( - `${this.gCloudSecretManagerService - .getSecret('REDIS_STORE_URL') - .toString()}/cache`, + `${config.REDIS_STORE_URL.toString()}/cache`, { auth: { - username: this.gCloudSecretManagerService - .getSecret('REDIS_STORE_USERNAME') - .toString(), - password: this.gCloudSecretManagerService - .getSecret('REDIS_STORE_PASSWORD') - .toString(), + username: config.REDIS_STORE_USERNAME.toString(), + password: config.REDIS_PASSWORD.toString(), }, }, ); @@ -37,21 +27,15 @@ export class DebioConversionService { async getExchangeFromTo(from: string, to: string) { try { const res = await axios.get( - `${this.gCloudSecretManagerService - .getSecret('REDIS_STORE_URL') - .toString()}/cache`, + `${config.REDIS_STORE_URL.toString()}/cache`, { params: { from, to, }, auth: { - username: this.gCloudSecretManagerService - .getSecret('REDIS_STORE_USERNAME') - .toString(), - password: this.gCloudSecretManagerService - .getSecret('REDIS_STORE_PASSWORD') - .toString(), + username: config.REDIS_STORE_USERNAME.toString(), + password: config.REDIS_PASSWORD.toString(), }, }, ); diff --git a/src/common/escrow/escrow.module.ts b/src/common/escrow/escrow.module.ts index fa997d59..560ffc31 100644 --- a/src/common/escrow/escrow.module.ts +++ b/src/common/escrow/escrow.module.ts @@ -4,14 +4,11 @@ import { EscrowAccounts } from './models/deposit.entity'; import { EscrowService } from './escrow.service'; import { EthereumModule, SubstrateModule } from '../index'; import { ErrorLoggingModule } from '../error-logging'; -import { GCloudSecretManagerModule } from '@debionetwork/nestjs-gcloud-secret-manager'; -import { SecretKeyList } from '@common/secrets'; require('dotenv').config(); // eslint-disable-line @Module({ imports: [ TypeOrmModule.forFeature([EscrowAccounts]), - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), SubstrateModule, ErrorLoggingModule, forwardRef(() => EthereumModule), diff --git a/src/common/escrow/escrow.service.ts b/src/common/escrow/escrow.service.ts index ec20ea59..0e82810c 100644 --- a/src/common/escrow/escrow.service.ts +++ b/src/common/escrow/escrow.service.ts @@ -4,10 +4,9 @@ import { EthereumService, SubstrateService } from '../index'; import { setOrderPaid } from '@debionetwork/polkadot-provider'; import { ethers } from 'ethers'; import AsyncLock from 'async-lock'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import { ErrorLoggingService } from '../error-logging'; import { ErrorLoggingDto } from '../error-logging/dto/error-logging.dto'; -import { keyList } from '@common/secrets'; +import { config } from '../../config'; const lock = new AsyncLock(); const ESCROW_WALLET_LOCK_KEY = 'escrow-wallet-lock'; @@ -16,7 +15,6 @@ let nonce = 0; @Injectable() export class EscrowService { constructor( - private readonly gCloudSecretManagerService: GCloudSecretManagerService, private readonly substrateService: SubstrateService, private readonly ethereumService: EthereumService, private readonly errorLoggingRepository: ErrorLoggingService, @@ -27,9 +25,7 @@ export class EscrowService { async onModuleInit(): Promise { this.provider = await this.ethereumService.getEthersProvider(); this.escrowWallet = await new ethers.Wallet( - this.gCloudSecretManagerService - .getSecret('DEBIO_ESCROW_PRIVATE_KEY') - .toString(), + config.DEBIO_ESCROW_PRIVATE_KEY.toString(), this.provider, ); } @@ -167,9 +163,7 @@ export class EscrowService { const tokenAmount = ethers.utils.parseUnits(String(amount), 18); const tokenContract = this.ethereumService.getContract(); const wallet: WalletSigner = await this.ethereumService.createWallet( - this.gCloudSecretManagerService - .getSecret('DEBIO_ESCROW_PRIVATE_KEY') - .toString(), + config.DEBIO_ESCROW_PRIVATE_KEY.toString(), ); const tokenContractWithSigner = tokenContract.connect(wallet); const options = { diff --git a/src/common/ethereum/ethereum.module.ts b/src/common/ethereum/ethereum.module.ts index 1a1cb743..9aecbd96 100644 --- a/src/common/ethereum/ethereum.module.ts +++ b/src/common/ethereum/ethereum.module.ts @@ -3,11 +3,7 @@ import { EthersModule } from 'nestjs-ethers'; import { EthereumService } from './ethereum.service'; import { CachesModule } from '../caches'; import { ProcessEnvModule } from '../proxies'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; -import { SecretKeyList, keyList } from '@common/secrets'; +import { config } from '../../config'; @Module({ imports: [ @@ -18,20 +14,16 @@ import { SecretKeyList, keyList } from '@common/secrets'; HOST_POSTGRES: 'HOST_POSTGRES', DB_POSTGRES: 'debio_escrow_dev', }), - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), ], - inject: [GCloudSecretManagerService], - useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, - ) => { + inject: [], + useFactory: async () => { return { - network: gCloudSecretManagerService.getSecret('WEB3_RPC').toString(), + network: config.WEB3_RPC_HTTPS.toString(), useDefaultProvider: true, }; }, }), CachesModule, - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), ], providers: [EthereumService], exports: [CachesModule, EthersModule, EthereumService], diff --git a/src/common/ethereum/ethereum.service.ts b/src/common/ethereum/ethereum.service.ts index ebb2c7b0..7ed56e2a 100644 --- a/src/common/ethereum/ethereum.service.ts +++ b/src/common/ethereum/ethereum.service.ts @@ -9,13 +9,11 @@ import ABI from './utils/ABI.json'; import escrowContract from './utils/Escrow.json'; import { ethers } from 'ethers'; import { CachesService } from '../caches'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; -import { keyList } from '@common/secrets'; +import { config } from '../../config'; @Injectable() export class EthereumService { constructor( - private readonly gCloudSecretManagerService: GCloudSecretManagerService, private readonly ethersContract: EthersContract, private readonly ethersSigner: EthersSigner, private readonly cachesService: CachesService, @@ -38,7 +36,7 @@ export class EthereumService { getEthersProvider(): ethers.providers.JsonRpcProvider { const provider = new ethers.providers.JsonRpcProvider( - this.gCloudSecretManagerService.getSecret('WEB3_RPC_HTTPS').toString(), + config.WEB3_RPC_HTTPS.toString(), ); return provider; } @@ -46,9 +44,7 @@ export class EthereumService { getContract(): SmartContract { try { const contract: SmartContract = this.ethersContract.create( - this.gCloudSecretManagerService - .getSecret('ESCROW_CONTRACT_ADDRESS') - .toString(), + config.ESCROW_CONTRACT_ADDRESS.toString(), ABI, ); @@ -62,9 +58,7 @@ export class EthereumService { try { const provider = this.getEthersProvider(); const contract = new ethers.Contract( - this.gCloudSecretManagerService - .getSecret('ESCROW_CONTRACT_ADDRESS') - .toString(), + config.ESCROW_CONTRACT_ADDRESS.toString(), escrowContract.abi, provider, ); diff --git a/src/common/mailer/mailer.manager.ts b/src/common/mailer/mailer.manager.ts index 553cd13f..d7d70d34 100644 --- a/src/common/mailer/mailer.manager.ts +++ b/src/common/mailer/mailer.manager.ts @@ -1,18 +1,14 @@ -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import { MailerService } from '@nestjs-modules/mailer'; import { Injectable, Logger } from '@nestjs/common'; -import { keyList } from '@common/secrets'; import { CustomerStakingRequestService, LabRegister } from './models'; import { NewOrderGA } from './models/new-order-ga.model'; import { NewOrderLab } from './models/new-order-lab.model'; +import { config } from '../../config'; @Injectable() export class MailerManager { private readonly _logger: Logger = new Logger(MailerManager.name); - constructor( - private readonly gCloudSecretManagerService: GCloudSecretManagerService, - private readonly mailerService: MailerService, - ) {} + constructor(private readonly mailerService: MailerService) {} async sendNewOrderToLab(to: string, context: NewOrderLab) { const subject = `New Order #1`; @@ -39,10 +35,7 @@ export class MailerManager { context: CustomerStakingRequestService, ) { let subject = `New Service Request - ${context.service_name} - ${context.city}, ${context.state}, ${context.country}`; - if ( - this.gCloudSecretManagerService.getSecret('POSTGRES_HOST').toString() === - 'localhost' - ) { + if (config.POSTGRES_HOST.toString() === 'localhost') { subject = `Testing New Service Request Email`; } this.mailerService.sendMail({ @@ -55,10 +48,7 @@ export class MailerManager { async sendLabRegistrationEmail(to: string | string[], context: LabRegister) { let subject = `New Lab Register – ${context.lab_name} - ${context.city}, ${context.state}, ${context.country}`; - if ( - this.gCloudSecretManagerService.getSecret('POSTGRES_HOST').toString() === - 'localhost' - ) { + if (config.POSTGRES_HOST.toString() === 'localhost') { subject = `Testing New Lab Register Email`; } const files: any[] = []; diff --git a/src/common/mailer/mailer.module.ts b/src/common/mailer/mailer.module.ts index 61ccf254..8f7aca84 100644 --- a/src/common/mailer/mailer.module.ts +++ b/src/common/mailer/mailer.module.ts @@ -1,34 +1,23 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { MailerModule } from '@nestjs-modules/mailer'; import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter'; import { Module } from '@nestjs/common'; import { join } from 'path'; import { MailerManager } from './mailer.manager'; -import { SecretKeyList, keyList } from '@common/secrets'; +import { config } from '../../config'; @Module({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), MailerModule.forRootAsync({ - imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), - ], - inject: [GCloudSecretManagerService], - useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, - ) => { + imports: [], + inject: [], + useFactory: async () => { return { transport: { host: 'smtp.gmail.com', secure: false, auth: { - user: gCloudSecretManagerService.getSecret('EMAIL').toString(), - pass: gCloudSecretManagerService - .getSecret('PASS_EMAIL') - .toString(), + user: config.EMAIL.toString(), + pass: config.PASS_EMAIL.toString(), }, }, template: { diff --git a/src/common/substrate/index.ts b/src/common/substrate/index.ts index 5685398e..ccc9b494 100644 --- a/src/common/substrate/index.ts +++ b/src/common/substrate/index.ts @@ -1,12 +1,8 @@ -import { GCloudSecretManagerModule } from '@debionetwork/nestjs-gcloud-secret-manager'; import { Module } from '@nestjs/common'; import { SubstrateService } from './substrate.service'; -import { SecretKeyList } from '@common/secrets'; @Module({ - imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), - ], + imports: [], providers: [SubstrateService], exports: [SubstrateService], }) diff --git a/src/common/substrate/substrate.service.ts b/src/common/substrate/substrate.service.ts index 35fcc931..6610a1fb 100644 --- a/src/common/substrate/substrate.service.ts +++ b/src/common/substrate/substrate.service.ts @@ -1,8 +1,7 @@ import { ApiPromise, Keyring, WsProvider } from '@polkadot/api'; import { Injectable, OnModuleInit, Logger } from '@nestjs/common'; import { waitReady } from '@polkadot/wasm-crypto'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; -import { keyList } from '@common/secrets'; +import { config } from '../../config'; @Injectable() export class SubstrateService implements OnModuleInit { @@ -12,10 +11,6 @@ export class SubstrateService implements OnModuleInit { private _listenStatus: boolean; private readonly _logger: Logger = new Logger(SubstrateService.name); - constructor( - private readonly gCloudSecretManagerService: GCloudSecretManagerService, - ) {} - get api(): ApiPromise { return this._api; } @@ -25,17 +20,13 @@ export class SubstrateService implements OnModuleInit { } async onModuleInit() { - this._wsProvider = new WsProvider( - this.gCloudSecretManagerService.getSecret('SUBSTRATE_URL').toString(), - ); + this._wsProvider = new WsProvider(config.SUBSTRATE_URL.toString()); const keyring = new Keyring({ type: 'sr25519' }); await waitReady(); this._pair = await keyring.addFromUri( - this.gCloudSecretManagerService - .getSecret('ADMIN_SUBSTRATE_MNEMONIC') - .toString(), + config.ADMIN_SUBSTRATE_MNEMONIC.toString(), ); await this.startListen(); diff --git a/src/config.ts b/src/config.ts new file mode 100644 index 00000000..400c199a --- /dev/null +++ b/src/config.ts @@ -0,0 +1,49 @@ +import dotenv from 'dotenv'; +dotenv.config(); + +export const config = { + DEBIO_API_KEY: process.env.DEBIO_API_KEY ?? '', + RECAPTCHA_SECRET_KEY: process.env.RECAPTCHA_SECRET_KEY ?? '', + REDIS_HOST: process.env.HOST_REDIS ?? 'localhost', + REDIS_PORT: process.env.PORT_REDIS ?? '6379', + REDIS_PASSWORD: process.env.REDIS_PASSWORD ?? 'root', + REDIS_STORE_URL: process.env.REDIS_STORE_URL ?? 'localhost:6379', + REDIS_STORE_USERNAME: process.env.REDIS_STORE_USERNAME ?? '', + COINMARKETCAP_API_KEY: process.env.API_KEY_COINMARKETCAP ?? '', + COINMARKETCAP_HOST: + process.env.COINMARKETCAP_HOST ?? 'https://pro-api.coinmarketcap.com/v2', + DEBIO_ESCROW_PRIVATE_KEY: process.env.DEBIO_ESCROW_PRIVATE_KEY ?? 'PRIVKEY', + WEB3_RPC_HTTPS: process.env.WEB3_RPC_HTTPS ?? '', + ESCROW_CONTRACT_ADDRESS: process.env.ESCROW_CONTRACT_ADDRESS ?? 'ADDR', + ELASTICSEARCH_NODE: process.env.ELASTICSEARCH_NODE ?? '', + ELASTICSEARCH_USERNAME: process.env.ELASTICSEARCH_USERNAME ?? '', + ELASTICSEARCH_PASSWORD: process.env.ELASTICSEARCH_PASSWORD ?? '', + POSTGRES_HOST: process.env.HOST_POSTGRES ?? 'localhost', + POSTGRES_USERNAME: process.env.USERNAME_POSTGRES ?? '', + POSTGRES_PASSWORD: process.env.PASSWORD_POSTGRES ?? '', + EMAIL: process.env.EMAIL ?? '', + PASS_EMAIL: process.env.PASS_EMAIL ?? '', + EMAILS: process.env.EMAILS ?? '', + SUBSTRATE_URL: process.env.SUBSTRATE_URL ?? 'URL', + ADMIN_SUBSTRATE_MNEMONIC: process.env.ADMIN_SUBSTRATE_MNEMONIC ?? '', + BUCKET_NAME: process.env.BUCKET_NAME ?? '', + STORAGE_BASE_URI: process.env.STORAGE_BASE_URI ?? '', + MYRIAD_API_URL: process.env.MYRIAD_API_URL ?? '', + MYRIAD_ADMIN_USERNAME: process.env.MYRIAD_ADMIN_USERNAME ?? '', + MYRIAD_PHYSICAL_HEALTH_TIMELINE_ID: + process.env.PHYSICAL_HEALTH_EXPERIENCE_ID ?? '', + MYRIAD_MENTAL_HEALTH_TIMELINE_ID: + process.env.MENTAL_HEALTH_EXPERIENCE_ID ?? '', + PINATA_JWT: process.env.PINATA_SECRET_KEY ?? '', + GA_ORDER_LINK: + process.env.GA_ORDER_LINK ?? + 'https://analyst.testnet.debio.network/order-details/', + LAB_ORDER_LINK: + process.env.LAB_ORDER_LINK ?? + ' https://lab.testnet.debio.network/lab/orders/', + UNSTAKE_INTERVAL: process.env.UNSTAKE_INTERVAL ?? '00:00:00:30', + UNSTAKE_TIMER: process.env.UNSTAKE_TIMER ?? '6:00:00:00', + MENSTRUAL_SUBSCRIPTION_DURATION: + process.env.MENSTRUAL_SUBSCRIPTION_DURATION ?? + '{"Monthly": "30:00:00:00", "Quarterly": "90:00:00:00", "Yearly": "365:00:00:00"}', +}; diff --git a/src/indexer/indexer.handler.ts b/src/indexer/indexer.handler.ts index f6f8c60f..77fe357d 100644 --- a/src/indexer/indexer.handler.ts +++ b/src/indexer/indexer.handler.ts @@ -15,8 +15,7 @@ import { ElasticsearchService } from '@nestjs/elasticsearch'; import { u32 } from '@polkadot/types'; import { SchedulerRegistry } from '@nestjs/schedule'; import { eventRoutes } from './indexer.routes'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; -import { keyList } from '@common/secrets'; +import { config } from '../../src/config'; @Injectable() export class IndexerHandler @@ -34,7 +33,6 @@ export class IndexerHandler constructor( private commandBus: CommandBus, private queryBus: QueryBus, - private gCloudSecretManagerService: GCloudSecretManagerService, private readonly elasticsearchService: ElasticsearchService, private readonly schedulerRegistry: SchedulerRegistry, private readonly process: ProcessEnvProxy, @@ -59,9 +57,7 @@ export class IndexerHandler delete this.wsProvider; } - this.wsProvider = new WsProvider( - this.gCloudSecretManagerService.getSecret('SUBSTRATE_URL').toString(), - ); + this.wsProvider = new WsProvider(config.SUBSTRATE_URL.toString()); this.wsProvider.on('connected', () => { this.logger.log(`WS Connected`); diff --git a/src/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.ts b/src/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.ts index 8bf0a379..c3f46b7e 100644 --- a/src/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.ts +++ b/src/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.ts @@ -14,10 +14,9 @@ import { queryGeneticAnalystByAccountId, queryGeneticAnalystServicesByHashId, } from '@debionetwork/polkadot-provider'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; -import { keyList } from '@common/secrets'; import { TransactionTypeList } from '@common/transaction-type/models/transaction-type.list'; import { TransactionStatusList } from '@common/transaction-status/models/transaction-status.list'; +import { config } from '../../../../../config'; @Injectable() @CommandHandler(GeneticAnalysisOrderPaidCommand) @@ -34,7 +33,6 @@ export class GeneticAnalysisOrderPaidHandler private readonly dateTimeProxy: DateTimeProxy, private readonly substrateService: SubstrateService, private readonly mailerManager: MailerManager, - private readonly gCloudSecretManagerService: GCloudSecretManagerService, ) {} async execute(command: GeneticAnalysisOrderPaidCommand) { @@ -98,9 +96,7 @@ export class GeneticAnalysisOrderPaidHandler ); const linkOrder = - this.gCloudSecretManagerService - .getSecret('GA_ORDER_LINK') - ?.toString() ?? '' + geneticAnalysisOrder.id; + config.GA_ORDER_LINK?.toString() ?? '' + geneticAnalysisOrder.id; await this.mailerManager.sendNewOrderToGa( geneticAnaystDetail.info.email, diff --git a/src/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.ts b/src/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.ts index 3049f40b..0567413a 100644 --- a/src/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.ts +++ b/src/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.ts @@ -15,11 +15,10 @@ import { queryServiceById, } from '@debionetwork/polkadot-provider'; import { NotificationDto } from '@common/notification/dto/notification.dto'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; -import { keyList } from '@common/secrets'; import currencyUnit from '../../../models/currencyUnit'; import { TransactionTypeList } from '@common/transaction-type/models/transaction-type.list'; import { TransactionStatusList } from '@common/transaction-status/models/transaction-status.list'; +import { config } from '../../../../../config'; @Injectable() @CommandHandler(OrderPaidCommand) @@ -32,7 +31,6 @@ export class OrderPaidHandler implements ICommandHandler { private readonly dateTimeProxy: DateTimeProxy, private readonly substrateService: SubstrateService, private readonly mailerManager: MailerManager, - private readonly gCloudSecretManagerService: GCloudSecretManagerService, ) {} async execute(command: OrderPaidCommand) { @@ -101,10 +99,7 @@ export class OrderPaidHandler implements ICommandHandler { order.serviceId, ); - const linkOrder = - this.gCloudSecretManagerService - .getSecret('LAB_ORDER_LINK') - .toString() ?? '' + order.id; + const linkOrder = config.LAB_ORDER_LINK.toString() ?? '' + order.id; await this.mailerManager.sendNewOrderToLab(labDetail.info.email, { specimen_number: order.dnaSampleTrackingId, diff --git a/src/listeners/substrate-listener/commands/service-request/service-request-created/service-request-created.handler.ts b/src/listeners/substrate-listener/commands/service-request/service-request-created/service-request-created.handler.ts index 84ee7e90..0b233c04 100644 --- a/src/listeners/substrate-listener/commands/service-request/service-request-created/service-request-created.handler.ts +++ b/src/listeners/substrate-listener/commands/service-request/service-request-created/service-request-created.handler.ts @@ -11,10 +11,9 @@ import { import { CountryService } from '@common/location/country.service'; import { StateService } from '@common/location/state.service'; import { NotificationDto } from '@common/notification/dto/notification.dto'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; -import { keyList } from '@common/secrets'; import { TransactionTypeList } from '@common/transaction-type/models/transaction-type.list'; import { TransactionStatusList } from '@common/transaction-status/models/transaction-status.list'; +import { config } from '../../../../../config'; @Injectable() @CommandHandler(ServiceRequestCreatedCommand) @@ -26,7 +25,6 @@ export class ServiceRequestCreatedHandler ); constructor( - private readonly gCloudSecretManagerService: GCloudSecretManagerService, private readonly loggingService: TransactionLoggingService, private readonly countryService: CountryService, private readonly stateService: StateService, @@ -111,7 +109,7 @@ export class ServiceRequestCreatedHandler }; await this.mailerManager.sendCustomerStakingRequestServiceEmail( - this.gCloudSecretManagerService.getSecret('EMAILS').split(','), + config.EMAILS.split(','), context, ); } diff --git a/src/listeners/substrate-listener/commands/services/service-created/service-created.handler.ts b/src/listeners/substrate-listener/commands/services/service-created/service-created.handler.ts index 0b4207c5..237dde31 100644 --- a/src/listeners/substrate-listener/commands/services/service-created/service-created.handler.ts +++ b/src/listeners/substrate-listener/commands/services/service-created/service-created.handler.ts @@ -11,8 +11,7 @@ import { import { Lab, queryLabById, Service } from '@debionetwork/polkadot-provider'; import { ServiceCreatedCommand } from './service-created.command'; import { NotificationDto } from '@common/notification/dto/notification.dto'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; -import { keyList } from '@common/secrets'; +import { config } from '../../../../../config'; @Injectable() @CommandHandler(ServiceCreatedCommand) @@ -21,7 +20,6 @@ export class ServiceCreatedHandler { private readonly logger: Logger = new Logger(ServiceCreatedCommand.name); constructor( - private readonly gCloudSecretManagerService: GCloudSecretManagerService, private readonly notificationService: NotificationService, private readonly substrateService: SubstrateService, private readonly mailerManager: MailerManager, @@ -46,7 +44,7 @@ export class ServiceCreatedHandler lab, ); this.mailerManager.sendLabRegistrationEmail( - this.gCloudSecretManagerService.getSecret('EMAILS').split(','), + config.EMAILS.split(','), labRegister, ); } diff --git a/src/listeners/substrate-listener/substrate-listener.module.ts b/src/listeners/substrate-listener/substrate-listener.module.ts index e8b25c74..21fb7722 100644 --- a/src/listeners/substrate-listener/substrate-listener.module.ts +++ b/src/listeners/substrate-listener/substrate-listener.module.ts @@ -23,15 +23,11 @@ import { LabCommandHandlers } from './commands/labs'; import { ElasticsearchModule } from '@nestjs/elasticsearch'; import { BlockCommandHandlers, BlockQueryHandlers } from './blocks'; import { GeneticAnalystServiceCommandHandler } from './commands/genetic-analyst-services'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { MailerModule } from '@nestjs-modules/mailer'; import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter'; import { join } from 'path'; -import { SecretKeyList, keyList } from '@common/secrets'; import { MenstrualSubscriptionCommandHandler } from './commands/menstrual-subscription'; +import { config } from '../../config'; @Module({ imports: [ @@ -46,45 +42,29 @@ import { MenstrualSubscriptionCommandHandler } from './commands/menstrual-subscr DateTimeModule, NotificationModule, ElasticsearchModule.registerAsync({ - imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), - ], - inject: [GCloudSecretManagerService], - useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, - ) => { + imports: [], + inject: [], + useFactory: async () => { return { - node: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_NODE') - .toString(), + node: config.ELASTICSEARCH_NODE.toString(), auth: { - username: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_USERNAME') - .toString(), - password: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_PASSWORD') - .toString(), + username: config.ELASTICSEARCH_USERNAME.toString(), + password: config.ELASTICSEARCH_PASSWORD.toString(), }, }; }, }), MailerModule.forRootAsync({ - imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), - ], - inject: [GCloudSecretManagerService], - useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, - ) => { + imports: [], + inject: [], + useFactory: async () => { return { transport: { host: 'smtp.gmail.com', secure: false, auth: { - user: gCloudSecretManagerService.getSecret('EMAIL').toString(), - pass: gCloudSecretManagerService - .getSecret('PASS_EMAIL') - .toString(), + user: config.EMAIL.toString(), + pass: config.PASS_EMAIL.toString(), }, }, template: { diff --git a/src/schedulers/genetic-analyst-unstaked/unstaked.service.ts b/src/schedulers/genetic-analyst-unstaked/unstaked.service.ts index cae99c37..072d65ee 100644 --- a/src/schedulers/genetic-analyst-unstaked/unstaked.service.ts +++ b/src/schedulers/genetic-analyst-unstaked/unstaked.service.ts @@ -6,8 +6,7 @@ import { queryGeneticAnalystByAccountId, retrieveGeneticAnalystUnstakeAmount, } from '@debionetwork/polkadot-provider'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; -import { keyList } from '@common/secrets'; +import { config } from '../../config'; @Injectable() export class GeneticAnalystUnstakedService implements OnModuleInit { @@ -15,18 +14,15 @@ export class GeneticAnalystUnstakedService implements OnModuleInit { private isRunning = false; private timer: number; constructor( - private readonly gCloudSecretManagerService: GCloudSecretManagerService, private readonly elasticsearchService: ElasticsearchService, private readonly subtrateService: SubstrateService, private readonly schedulerRegistry: SchedulerRegistry, ) {} onModuleInit() { - this.timer = strToMilisecond( - this.gCloudSecretManagerService.getSecret('UNSTAKE_TIMER').toString(), - ); + this.timer = strToMilisecond(config.UNSTAKE_TIMER.toString()); const unstakeInterval: number = strToMilisecond( - this.gCloudSecretManagerService.getSecret('UNSTAKE_INTERVAL').toString(), + config.UNSTAKE_INTERVAL.toString(), ); const unstaked = setInterval(async () => { diff --git a/src/schedulers/lab-unstake/lab-unstake.service.ts b/src/schedulers/lab-unstake/lab-unstake.service.ts index 8b2cd843..00d6df8c 100644 --- a/src/schedulers/lab-unstake/lab-unstake.service.ts +++ b/src/schedulers/lab-unstake/lab-unstake.service.ts @@ -6,8 +6,7 @@ import { queryLabById, retrieveLabUnstakeAmount, } from '@debionetwork/polkadot-provider'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; -import { keyList } from '@common/secrets'; +import { config } from '../../config'; @Injectable() export class LabUnstakedService implements OnModuleInit { @@ -15,18 +14,15 @@ export class LabUnstakedService implements OnModuleInit { private isRunning = false; private timer: number; constructor( - private readonly gCloudSecretManagerService: GCloudSecretManagerService, private readonly elasticsearchService: ElasticsearchService, private readonly subtrateService: SubstrateService, private readonly schedulerRegistry: SchedulerRegistry, ) {} onModuleInit() { - this.timer = strToMilisecond( - this.gCloudSecretManagerService.getSecret('UNSTAKE_TIMER').toString(), - ); + this.timer = strToMilisecond(config.UNSTAKE_TIMER.toString()); const unstakeInterval: number = strToMilisecond( - this.gCloudSecretManagerService.getSecret('UNSTAKE_INTERVAL').toString(), + config.UNSTAKE_INTERVAL.toString(), ); const unstaked = setInterval(async () => { diff --git a/src/schedulers/mailer/mailer.service.ts b/src/schedulers/mailer/mailer.service.ts index b232a4d9..dbd1e0ef 100644 --- a/src/schedulers/mailer/mailer.service.ts +++ b/src/schedulers/mailer/mailer.service.ts @@ -8,15 +8,13 @@ import { LabRegister, } from '@common/index'; import { queryLabById } from '@debionetwork/polkadot-provider'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; -import { keyList } from '@common/secrets'; +import { config } from '../../config'; @Injectable() export class MailerService { private logger: Logger = new Logger(MailerService.name); private isRunning = false; constructor( - private readonly gCloudSecretManagerService: GCloudSecretManagerService, private readonly mailerManager: MailerManager, private readonly emailNotificationService: EmailNotificationService, private readonly substrateService: SubstrateService, @@ -44,7 +42,7 @@ export class MailerService { ); await this.mailerManager.sendLabRegistrationEmail( - this.gCloudSecretManagerService.getSecret('EMAILS').split(','), + config.EMAILS.split(','), labRegister, ); diff --git a/src/schedulers/menstrual-subscription/menstrual-subscription.service.ts b/src/schedulers/menstrual-subscription/menstrual-subscription.service.ts index 8b8420ba..d2d8d389 100644 --- a/src/schedulers/menstrual-subscription/menstrual-subscription.service.ts +++ b/src/schedulers/menstrual-subscription/menstrual-subscription.service.ts @@ -1,14 +1,13 @@ -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import { Injectable, Logger } from '@nestjs/common'; import { ElasticsearchService } from '@nestjs/elasticsearch'; import { SchedulerRegistry } from '@nestjs/schedule'; import { strToMilisecond, SubstrateService } from '@common/index'; -import { keyList } from '@common/secrets'; import { changeMenstrualSubscriptionStatus } from '@debionetwork/polkadot-provider/lib/command/menstrual-subscription'; import { queryMenstrualSubscriptionById } from '@debionetwork/polkadot-provider/lib/query/menstrual-subscription'; import { SubscriptionStatus } from '@debionetwork/polkadot-provider/lib/primitives/subscription-status'; import { PaymentStatus } from '@debionetwork/polkadot-provider/lib/primitives/payment-status'; import { Duration } from '@debionetwork/polkadot-provider/lib/primitives/duration'; +import { config } from '../../config'; @Injectable() export class MenstrualSubscriptionService { @@ -16,7 +15,6 @@ export class MenstrualSubscriptionService { private isRunningInActive = false; private menstrualSubscriptionDuration: { [key: string]: number }; constructor( - private readonly gCloudSecretManagerService: GCloudSecretManagerService, private readonly elasticsearchService: ElasticsearchService, private readonly subtrateService: SubstrateService, private readonly schedulerRegistry: SchedulerRegistry, @@ -24,7 +22,7 @@ export class MenstrualSubscriptionService { onModuleInit() { const unstakeInterval: number = strToMilisecond( - this.gCloudSecretManagerService.getSecret('UNSTAKE_INTERVAL').toString(), + config.UNSTAKE_INTERVAL.toString(), ); this.menstrualSubscriptionDuration = @@ -237,11 +235,7 @@ export class MenstrualSubscriptionService { parseMenstrualSubscriptionDuration(): { [key: string]: number } { try { const menstrualSubscriptionDurationObj: { [key: string]: string } = - JSON.parse( - this.gCloudSecretManagerService - .getSecret('MENSTRUAL_SUBSCRIPTION_DURATION') - .toString() ?? '{}', - ); + JSON.parse(config.MENSTRUAL_SUBSCRIPTION_DURATION.toString() ?? '{}'); const parseMenstrualSubscriptionDuration: Map = new Map< string, number diff --git a/src/schedulers/schedulers.module.ts b/src/schedulers/schedulers.module.ts index 83c2be7a..4cc5f79b 100644 --- a/src/schedulers/schedulers.module.ts +++ b/src/schedulers/schedulers.module.ts @@ -1,10 +1,5 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { Module } from '@nestjs/common'; import { ElasticsearchModule } from '@nestjs/elasticsearch'; -import { SecretKeyList, keyList } from '@common/secrets'; import { EmailNotificationModule, MailModule, @@ -15,28 +10,19 @@ import { import { MailerService } from './mailer/mailer.service'; import { UnstakedService } from './unstaked/unstaked.service'; import { MenstrualSubscriptionService } from './menstrual-subscription/menstrual-subscription.service'; +import { config } from '../config'; @Module({ imports: [ ElasticsearchModule.registerAsync({ - imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), - ], - inject: [GCloudSecretManagerService], - useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, - ) => { + imports: [], + inject: [], + useFactory: async () => { return { - node: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_NODE') - .toString(), + node: config.ELASTICSEARCH_NODE.toString(), auth: { - username: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_USERNAME') - .toString(), - password: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_PASSWORD') - .toString(), + username: config.ELASTICSEARCH_USERNAME.toString(), + password: config.ELASTICSEARCH_PASSWORD.toString(), }, }; }, diff --git a/src/schedulers/unstaked/unstaked.service.ts b/src/schedulers/unstaked/unstaked.service.ts index e3040ba0..675e2cf9 100644 --- a/src/schedulers/unstaked/unstaked.service.ts +++ b/src/schedulers/unstaked/unstaked.service.ts @@ -6,9 +6,8 @@ import { queryServiceRequestById, retrieveUnstakedAmount, } from '@debionetwork/polkadot-provider'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; -import { keyList } from '@common/secrets'; import { strToMilisecond } from '@common/tools'; +import { config } from '../../config'; @Injectable() export class UnstakedService implements OnModuleInit { @@ -16,18 +15,15 @@ export class UnstakedService implements OnModuleInit { private isRunning = false; private timer: number; constructor( - private readonly gCloudSecretManagerService: GCloudSecretManagerService, private readonly elasticsearchService: ElasticsearchService, private readonly subtrateService: SubstrateService, private readonly schedulerRegistry: SchedulerRegistry, ) {} onModuleInit() { - this.timer = strToMilisecond( - this.gCloudSecretManagerService.getSecret('UNSTAKE_TIMER').toString(), - ); + this.timer = strToMilisecond(config.UNSTAKE_TIMER.toString()); const unstakeInterval: number = strToMilisecond( - this.gCloudSecretManagerService.getSecret('UNSTAKE_INTERVAL').toString(), + config.UNSTAKE_INTERVAL.toString(), ); const unstaked = setInterval(async () => { diff --git a/test/e2e/indexer/events/certification-events.spec.ts b/test/e2e/indexer/events/certification-events.spec.ts index a7165aee..a83a9f84 100644 --- a/test/e2e/indexer/events/certification-events.spec.ts +++ b/test/e2e/indexer/events/certification-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { Certification, createCertification, @@ -27,7 +23,6 @@ import { LabCommandHandlers } from '@indexer/events/labs'; import { initializeApi } from '../../polkadot-init'; import { labDataMock } from '../../../mock/models/labs/labs.mock'; import { certificationDataMock } from '../../../mock/models/certifications/certification-mock'; -import { SecretKeyList } from '@common/secrets'; describe('Certification Event', () => { let app: INestApplication; @@ -47,30 +42,9 @@ describe('Certification Event', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -82,10 +56,7 @@ describe('Certification Event', () => { ...LabCommandHandlers, ...CertificationsCommandHandlers, ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-analysis-events.spec.ts b/test/e2e/indexer/events/genetic-analysis-events.spec.ts index 4b053679..27749e19 100644 --- a/test/e2e/indexer/events/genetic-analysis-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analysis-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { addGeneticData, createGeneticAnalysisOrder, @@ -34,7 +30,6 @@ import { CommonModule, ProcessEnvModule } from '@common/index'; import { IndexerHandler } from '@indexer/indexer.handler'; import { IndexerModule } from '@indexer/indexer.module'; import { geneticAnalystServiceDataMock } from '../../../mock/models/genetic-analysts/genetic-analyst-service.mock'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analysis Events', () => { let app: INestApplication; @@ -54,30 +49,9 @@ describe('Genetic Analysis Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -85,10 +59,7 @@ describe('Genetic Analysis Events', () => { IndexerModule, ], providers: [IndexerHandler], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-analysis-order-events.spec.ts b/test/e2e/indexer/events/genetic-analysis-order-events.spec.ts index 1272e77d..f4ea6940 100644 --- a/test/e2e/indexer/events/genetic-analysis-order-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analysis-order-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { addGeneticData, cancelGeneticAnalysisOrder, @@ -41,7 +37,6 @@ import { IndexerHandler } from '@indexer/indexer.handler'; import { IndexerModule } from '@indexer/indexer.module'; import { geneticAnalystServiceDataMock } from '../../../mock/models/genetic-analysts/genetic-analyst-service.mock'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analysis Events', () => { let app: INestApplication; @@ -62,30 +57,9 @@ describe('Genetic Analysis Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -93,10 +67,7 @@ describe('Genetic Analysis Events', () => { IndexerModule, ], providers: [IndexerHandler], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-analyst-events.spec.ts b/test/e2e/indexer/events/genetic-analyst-events.spec.ts index c6750dae..403e38c9 100644 --- a/test/e2e/indexer/events/genetic-analyst-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analyst-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { deregisterGeneticAnalyst, GeneticAnalyst, @@ -30,7 +26,6 @@ import { geneticAnalystsDataMock } from '../../../mock/models/genetic-analysts/g import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; import { AvailabilityStatus } from '@debionetwork/polkadot-provider/lib/primitives/availability-status'; import { StakeStatus } from '@indexer/models/stake-status'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analyst Events', () => { let app: INestApplication; @@ -49,30 +44,9 @@ describe('Genetic Analyst Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -80,10 +54,7 @@ describe('Genetic Analyst Events', () => { IndexerModule, ], providers: [IndexerHandler, ...GeneticAnalystsCommandHandlers], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-analyst-qualification-events.spec.ts b/test/e2e/indexer/events/genetic-analyst-qualification-events.spec.ts index fdd489ac..59dd1478 100644 --- a/test/e2e/indexer/events/genetic-analyst-qualification-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analyst-qualification-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { createQualification, deleteQualification, @@ -22,7 +18,6 @@ import { CommonModule, ProcessEnvModule } from '@common/index'; import { IndexerHandler } from '@indexer/indexer.handler'; import { IndexerModule } from '@indexer/indexer.module'; import { geneticAnalystQualificationsDataMock } from '../../../mock/models/genetic-analysts/genetic-analyst-qualifications.mock'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analyst Qualification Events', () => { let app: INestApplication; @@ -41,30 +36,9 @@ describe('Genetic Analyst Qualification Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -72,10 +46,7 @@ describe('Genetic Analyst Qualification Events', () => { IndexerModule, ], providers: [IndexerHandler], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-analyst-service-events.spec.ts b/test/e2e/indexer/events/genetic-analyst-service-events.spec.ts index fc8fe676..1ae2f785 100644 --- a/test/e2e/indexer/events/genetic-analyst-service-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analyst-service-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { createGeneticAnalystService, deleteGeneticAnalystService, @@ -26,7 +22,6 @@ import { IndexerHandler } from '@indexer/indexer.handler'; import { IndexerModule } from '@indexer/indexer.module'; import { geneticAnalystsDataMock } from '../../../mock/models/genetic-analysts/genetic-analysts.mock'; import { geneticAnalystServiceDataMock } from '../../../mock/models/genetic-analysts/genetic-analyst-service.mock'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analyst Service Events', () => { let app: INestApplication; @@ -46,30 +41,9 @@ describe('Genetic Analyst Service Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -77,10 +51,7 @@ describe('Genetic Analyst Service Events', () => { IndexerModule, ], providers: [IndexerHandler], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-data-events.spec.ts b/test/e2e/indexer/events/genetic-data-events.spec.ts index 741bda3c..b13db9cd 100644 --- a/test/e2e/indexer/events/genetic-data-events.spec.ts +++ b/test/e2e/indexer/events/genetic-data-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { addGeneticData, GeneticData, @@ -21,7 +17,6 @@ import { GeneticDataCommandHandlers } from '@indexer/events/genetic-data'; import { IndexerHandler } from '@indexer/indexer.handler'; import { IndexerModule } from '@indexer/indexer.module'; import { initializeApi } from '../../polkadot-init'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Data Events', () => { let app: INestApplication; @@ -45,30 +40,9 @@ describe('Genetic Data Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -76,10 +50,7 @@ describe('Genetic Data Events', () => { IndexerModule, ], providers: [IndexerHandler, ...GeneticDataCommandHandlers], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-testing-events.spec.ts b/test/e2e/indexer/events/genetic-testing-events.spec.ts index 8a079512..d7563605 100644 --- a/test/e2e/indexer/events/genetic-testing-events.spec.ts +++ b/test/e2e/indexer/events/genetic-testing-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { INestApplication } from '@nestjs/common'; import { CqrsModule } from '@nestjs/cqrs'; import { ElasticsearchService } from '@nestjs/elasticsearch'; @@ -35,7 +31,6 @@ import { import { labDataMock } from '../../../mock/models/labs/labs.mock'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; import { serviceDataMock } from '../../../mock/models/labs/services.mock'; -import { SecretKeyList } from '@common/secrets'; describe('Indexer Genetic Testing Event', () => { let app: INestApplication; @@ -56,33 +51,9 @@ describe('Indexer Genetic Testing Event', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), CommonModule, ProcessEnvModule, CqrsModule, @@ -90,10 +61,7 @@ describe('Indexer Genetic Testing Event', () => { IndexerModule, ], providers: [IndexerHandler, ...GeneticTestingCommandHandlers], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/labs-events.spec.ts b/test/e2e/indexer/events/labs-events.spec.ts index 9654614f..4d2c3cb6 100644 --- a/test/e2e/indexer/events/labs-events.spec.ts +++ b/test/e2e/indexer/events/labs-events.spec.ts @@ -20,15 +20,10 @@ import { ProcessEnvModule } from '@common/proxies/process-env/process-env.module import { IndexerHandler } from '@indexer/indexer.handler'; import { initializeApi } from '../../polkadot-init'; import { labDataMock } from '../../../mock/models/labs/labs.mock'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { IndexerModule } from '@indexer/indexer.module'; import { LabCommandHandlers } from '@indexer/events/labs'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; import { StakeStatus } from '@indexer/models/stake-status'; -import { SecretKeyList } from '@common/secrets'; describe('Event Command Service Request Claimed', () => { let app: INestApplication; @@ -47,33 +42,9 @@ describe('Event Command Service Request Claimed', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), CommonModule, ProcessEnvModule, CqrsModule, @@ -81,10 +52,7 @@ describe('Event Command Service Request Claimed', () => { IndexerModule, ], providers: [IndexerHandler, ...LabCommandHandlers], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/menstrual-calendar-events.spec.ts b/test/e2e/indexer/events/menstrual-calendar-events.spec.ts index d6e0a102..e69d651d 100644 --- a/test/e2e/indexer/events/menstrual-calendar-events.spec.ts +++ b/test/e2e/indexer/events/menstrual-calendar-events.spec.ts @@ -3,11 +3,6 @@ import { ApiPromise } from '@polkadot/api'; // import { MenstrualCycleLog } from '@indexer/models/menstrual-calendar/menstrual-cycle-log'; // import { MenstrualCalendar } from '@indexer/models/menstrual-calendar/menstrual-calendar'; import { Test, TestingModule } from '@nestjs/testing'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; -import { SecretKeyList } from '@common/secrets'; import { CommonModule, ProcessEnvModule } from '@common/index'; import { CqrsModule } from '@nestjs/cqrs'; import { ScheduleModule } from '@nestjs/schedule'; @@ -37,30 +32,9 @@ describe('Menstrual Calendar Test Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -68,10 +42,7 @@ describe('Menstrual Calendar Test Events', () => { IndexerModule, ], providers: [IndexerHandler, ...MenstrualCalendarCommandHandlers], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/orders-events.spec.ts b/test/e2e/indexer/events/orders-events.spec.ts index 0f0d4904..dd147c54 100644 --- a/test/e2e/indexer/events/orders-events.spec.ts +++ b/test/e2e/indexer/events/orders-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { INestApplication } from '@nestjs/common'; import { CqrsModule } from '@nestjs/cqrs'; import { ElasticsearchService } from '@nestjs/elasticsearch'; @@ -32,7 +28,6 @@ import { } from '@debionetwork/polkadot-provider'; import { OrderCommandHandlers } from '@indexer/events/orders'; import { DnaSample } from '@debionetwork/polkadot-provider/lib/models/labs/genetic-testing/dna-sample'; -import { SecretKeyList } from '@common/secrets'; describe('Orders Events', () => { let app: INestApplication; @@ -51,30 +46,9 @@ describe('Orders Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -82,10 +56,7 @@ describe('Orders Events', () => { IndexerModule, ], providers: [IndexerHandler, ...OrderCommandHandlers], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/service-events.spec.ts b/test/e2e/indexer/events/service-events.spec.ts index 64b9c552..57800b44 100644 --- a/test/e2e/indexer/events/service-events.spec.ts +++ b/test/e2e/indexer/events/service-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { createService, deleteService, @@ -25,7 +21,6 @@ import { IndexerHandler } from '@indexer/indexer.handler'; import { IndexerModule } from '@indexer/indexer.module'; import { labDataMock } from '../../../mock/models/labs/labs.mock'; import { serviceDataMock } from '../../../mock/models/labs/services.mock'; -import { SecretKeyList } from '@common/secrets'; describe('Service Event', () => { let app: INestApplication; @@ -45,30 +40,9 @@ describe('Service Event', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -80,10 +54,7 @@ describe('Service Event', () => { ...LabCommandHandlers, ...ServiceCommandHandlers, ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/service-request-events.spec.ts b/test/e2e/indexer/events/service-request-events.spec.ts index 236fe284..ab391ab1 100644 --- a/test/e2e/indexer/events/service-request-events.spec.ts +++ b/test/e2e/indexer/events/service-request-events.spec.ts @@ -34,11 +34,6 @@ import { RequestServiceCommandHandlers } from '@indexer/events/service-request'; import { ScheduleModule } from '@nestjs/schedule'; import { IndexerModule } from '@indexer/indexer.module'; import { serviceRequestMock } from '../../../mock/models/service-request/service-request.mock'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; -import { SecretKeyList } from '@common/secrets'; describe('Event Command Service Request Claimed', () => { let app: INestApplication; @@ -59,33 +54,9 @@ describe('Event Command Service Request Claimed', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), CommonModule, ProcessEnvModule, CqrsModule, @@ -98,10 +69,7 @@ describe('Event Command Service Request Claimed', () => { ...ServiceCommandHandlers, ...RequestServiceCommandHandlers, ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); @@ -263,19 +231,11 @@ describe('Event Command Service Request Claimed', () => { const claimRequestPromise: Promise = new Promise( // eslint-disable-next-line (resolve, reject) => { - claimRequest( - api, - pair, - serviceRequest.hash, - service.id, - '900000000000000000', - '100000000000000000', - () => { - queryServiceRequestById(api, serviceRequest.hash).then((res) => { - resolve(res); - }); - }, - ); + claimRequest(api, pair, serviceRequest.hash, service.id, () => { + queryServiceRequestById(api, serviceRequest.hash).then((res) => { + resolve(res); + }); + }); }, ); diff --git a/test/e2e/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-events.spec.ts index 3cba9222..483aa2d6 100644 --- a/test/e2e/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-events.spec.ts @@ -58,17 +58,13 @@ import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitiv import { geneticAnalystServiceDataMock } from '../../../../../mock/models/genetic-analysts/genetic-analyst-service.mock'; import { Notification } from '@common/notification/models/notification.entity'; import { createConnection } from 'typeorm'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { GeneticAnalysisOrderCreatedHandler } from '@listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysys-order-created/genetic-analysis-order-created.handler'; import { GeneticAnalysisOrderFulfilledHandler } from '@listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-fulfilled/genetic-analysis-order-fulfilled.handler'; import { GeneticAnalysisOrderPaidHandler } from '@listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler'; -import { keyList, SecretKeyList } from '@common/secrets'; import { MailerModule } from '@nestjs-modules/mailer'; import { join } from 'path'; import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter'; +import { config } from '../../../../../../src/config'; describe('Genetic Analysis Order Created Integration Test', () => { let app: INestApplication; @@ -85,33 +81,9 @@ describe('Genetic Analysis Order Created Integration Test', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -126,25 +98,16 @@ describe('Genetic Analysis Order Created Integration Test', () => { DateTimeModule, NotificationModule, MailerModule.forRootAsync({ - imports: [ - GCloudSecretManagerModule.withConfig( - process.env.PARENT, - SecretKeyList, - ), - ], - inject: [GCloudSecretManagerService], - useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, - ) => { + imports: [], + inject: [], + useFactory: async () => { return { transport: { host: 'smtp.gmail.com', secure: false, auth: { user: process.env.EMAIL, - pass: gCloudSecretManagerService - .getSecret('PASS_EMAIL') - .toString(), + pass: config.PASS_EMAIL.toString(), }, }, template: { @@ -174,10 +137,7 @@ describe('Genetic Analysis Order Created Integration Test', () => { GeneticAnalysisOrderFulfilledHandler, GeneticAnalysisOrderPaidHandler, ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/genetic-analysis/genetic-analysis-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/genetic-analysis/genetic-analysis-events.spec.ts index 6dbfe09f..438a33cb 100644 --- a/test/e2e/listeners/substrate-listener/commands/genetic-analysis/genetic-analysis-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/genetic-analysis/genetic-analysis-events.spec.ts @@ -51,12 +51,7 @@ import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitiv import { geneticAnalystServiceDataMock } from '../../../../../mock/models/genetic-analysts/genetic-analyst-service.mock'; import { Notification } from '@common/notification/models/notification.entity'; import { createConnection } from 'typeorm'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { GeneticAnalysisRejectedHandler } from '@listeners/substrate-listener/commands/genetic-analysis/genetic-analysis-rejected/genetic-analysis-rejected.handler'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analysis Order Created Integration Test', () => { let app: INestApplication; @@ -73,33 +68,9 @@ describe('Genetic Analysis Order Created Integration Test', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -128,10 +99,7 @@ describe('Genetic Analysis Order Created Integration Test', () => { SubstrateListenerHandler, GeneticAnalysisRejectedHandler, ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/genetic-analyst-service/genetic-analyst-service-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/genetic-analyst-service/genetic-analyst-service-events.spec.ts index 5f0b582c..db363217 100644 --- a/test/e2e/listeners/substrate-listener/commands/genetic-analyst-service/genetic-analyst-service-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/genetic-analyst-service/genetic-analyst-service-events.spec.ts @@ -39,11 +39,6 @@ import { geneticAnalystServiceDataMock } from '../../../../../mock/models/geneti import { Notification } from '@common/notification/models/notification.entity'; import { createConnection } from 'typeorm'; import { GeneticAnalystServiceCommandHandler } from '@listeners/substrate-listener/commands/genetic-analyst-services'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analyst Service Created Event', () => { let app: INestApplication; @@ -60,33 +55,9 @@ describe('Genetic Analyst Service Created Event', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -108,10 +79,7 @@ describe('Genetic Analyst Service Created Event', () => { SubstrateListenerHandler, ...GeneticAnalystServiceCommandHandler, ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/genetic-analysts/genetic-analyst-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/genetic-analysts/genetic-analyst-events.spec.ts index b82d473f..36e5fe46 100644 --- a/test/e2e/listeners/substrate-listener/commands/genetic-analysts/genetic-analyst-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/genetic-analysts/genetic-analyst-events.spec.ts @@ -30,12 +30,7 @@ import { geneticAnalystsDataMock } from '../../../../../mock/models/genetic-anal import { Notification } from '@common/notification/models/notification.entity'; import { createConnection } from 'typeorm'; import { StakeStatus } from '@debionetwork/polkadot-provider/lib/primitives/stake-status'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { GeneticAnalystRegisteredHandler } from '@listeners/substrate-listener/commands/genetic-analysts/genetic-analyst-registered/genetic-analyst-registered.handler'; -import { SecretKeyList } from '@common/secrets'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; import { GeneticAnalystVerificationStatusHandler } from '@listeners/substrate-listener/commands/genetic-analysts/genetic-analyst-verification-status/genetic-analyst-verification-status.handler'; @@ -54,33 +49,9 @@ describe('Genetic analyst verification status', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -104,10 +75,7 @@ describe('Genetic analyst verification status', () => { GeneticAnalystRegisteredHandler, GeneticAnalystVerificationStatusHandler, ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/genetic-testing/genetic-testing-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/genetic-testing/genetic-testing-events.spec.ts index 0d9963a4..5c4840d3 100644 --- a/test/e2e/listeners/substrate-listener/commands/genetic-testing/genetic-testing-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/genetic-testing/genetic-testing-events.spec.ts @@ -58,12 +58,7 @@ import { CqrsModule } from '@nestjs/cqrs'; import { SubstrateListenerHandler } from '@listeners/substrate-listener/substrate-listener.handler'; import { createConnection } from 'typeorm'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { DataStakedHandler } from '@listeners/substrate-listener/commands/genetic-testing/data-staked/data-staked.handler'; -import { SecretKeyList } from '@common/secrets'; import { DnaSample } from '@debionetwork/polkadot-provider/lib/models/labs/genetic-testing/dna-sample'; import { Notification } from '@common/notification/models/notification.entity'; import { DnaSampleRejectedCommandHandler } from '@listeners/substrate-listener/commands/genetic-testing/dna-sample-rejected/dna-sample-rejected.handler'; @@ -84,36 +79,9 @@ describe('Data Staked Integration Tests', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ['REDIS_STORE_URL', process.env.REDIS_STORE_URL], - ['REDIS_STORE_USERNAME', process.env.REDIS_STORE_USERNAME], - ['REDIS_STORE_PASSWORD', process.env.REDIS_STORE_PASSWORD], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -139,10 +107,7 @@ describe('Data Staked Integration Tests', () => { DnaSampleRejectedCommandHandler, DnaSampleResultReadyCommandHandler, ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/labs/labs-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/labs/labs-events.spec.ts index e4710cf4..2e4a9f91 100644 --- a/test/e2e/listeners/substrate-listener/commands/labs/labs-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/labs/labs-events.spec.ts @@ -31,12 +31,7 @@ import { CqrsModule } from '@nestjs/cqrs'; import { SubstrateListenerHandler } from '@listeners/substrate-listener/substrate-listener.handler'; import { LabStakeSuccessfullHandler } from '@listeners/substrate-listener/commands/labs/stake-successfull/stake-successful.handler'; import { createConnection } from 'typeorm'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { StakeStatus } from '@debionetwork/polkadot-provider/lib/primitives/stake-status'; -import { SecretKeyList } from '@common/secrets'; import { labUnstakedHandler } from '@listeners/substrate-listener/commands/labs/unstake-successfull/unstaked-successful.handler'; import { LabUpdateVerificationStatusHandler } from '@listeners/substrate-listener/commands/labs/update-verification-status/update-verification-status.handler'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; @@ -58,30 +53,9 @@ describe('lab staking Integration Tests', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -106,10 +80,7 @@ describe('lab staking Integration Tests', () => { labUnstakedHandler, LabUpdateVerificationStatusHandler, ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/orders/orders-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/orders/orders-events.spec.ts index f19e4950..bfb5d8eb 100644 --- a/test/e2e/listeners/substrate-listener/commands/orders/orders-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/orders/orders-events.spec.ts @@ -58,18 +58,14 @@ import { SubstrateListenerHandler } from '@listeners/substrate-listener/substrat import { Notification } from '@common/notification/models/notification.entity'; import { createConnection } from 'typeorm'; import { DnaSample } from '@debionetwork/polkadot-provider/lib/models/labs/genetic-testing/dna-sample'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { OrderFailedHandler } from '@listeners/substrate-listener/commands/orders/order-failed/order-failed.handler'; -import { keyList, SecretKeyList } from '@common/secrets'; import { deleteService, deregisterLab } from '@debionetwork/polkadot-provider'; import { OrderFulfilledHandler } from '@listeners/substrate-listener/commands/orders/order-fulfilled/order-fulfilled.handler'; import { OrderPaidHandler } from '@listeners/substrate-listener/commands/orders/order-paid/order-paid.handler'; import { MailerModule } from '@nestjs-modules/mailer'; import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter'; import { join } from 'path'; +import { config } from '../../../../../../src/config'; describe('Order Failed Integration Tests', () => { let app: INestApplication; @@ -86,35 +82,9 @@ describe('Order Failed Integration Tests', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ['LAB_ORDER_LINK', process.env.LAB_ORDER_LINK], - ['POSTGRES_HOST', process.env.POSTGRES_HOST], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -130,32 +100,18 @@ describe('Order Failed Integration Tests', () => { NotificationModule, DebioConversionModule, MailerModule.forRootAsync({ - imports: [ - GCloudSecretManagerModule.withConfig( - process.env.PARENT, - SecretKeyList, - ), - ], - inject: [GCloudSecretManagerService], - useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, - ) => { - console.log( - gCloudSecretManagerService.getSecret('EMAIL').toString(), - gCloudSecretManagerService.getSecret('PASS_EMAIL').toString(), - ); + imports: [], + inject: [], + useFactory: async () => { + console.log(config.EMAIL.toString(), config.PASS_EMAIL.toString()); return { transport: { host: 'smtp.gmail.com', port: 587, secure: false, auth: { - user: gCloudSecretManagerService - .getSecret('EMAIL') - .toString(), - pass: gCloudSecretManagerService - .getSecret('PASS_EMAIL') - .toString(), + user: config.EMAIL.toString(), + pass: config.PASS_EMAIL.toString(), }, }, template: { @@ -185,10 +141,7 @@ describe('Order Failed Integration Tests', () => { OrderFulfilledHandler, OrderPaidHandler, ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/service-request/service-request-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/service-request/service-request-events.spec.ts index 569fa38b..98e97df5 100644 --- a/test/e2e/listeners/substrate-listener/commands/service-request/service-request-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/service-request/service-request-events.spec.ts @@ -48,12 +48,7 @@ import { serviceRequestMock } from '../../../../../mock/models/labs/service-requ import { createConnection } from 'typeorm'; import { Notification } from '@common/notification/models/notification.entity'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { ServiceRequestStakingAmountExcessRefunded } from '@listeners/substrate-listener/commands/service-request/service-request-excess/service-request-excess.handler'; -import { SecretKeyList } from '@common/secrets'; import { ServiceRequestStakingAmountRefundedHandler } from '@listeners/substrate-listener/commands/service-request/service-request-staking-amount-refunded/service-request-staking-amount-refunded.handler'; describe('Service Request Excess Integration Tests', () => { @@ -71,33 +66,9 @@ describe('Service Request Excess Integration Tests', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -122,10 +93,7 @@ describe('Service Request Excess Integration Tests', () => { ServiceRequestStakingAmountExcessRefunded, ServiceRequestStakingAmountRefundedHandler, ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/services/services-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/services/services-events.spec.ts index b6d42535..529f8929 100644 --- a/test/e2e/listeners/substrate-listener/commands/services/services-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/services/services-events.spec.ts @@ -32,12 +32,7 @@ import { labDataMock } from '../../../../../mock/models/labs/labs.mock'; import { serviceDataMock } from '../../../../../mock/models/labs/services.mock'; import { Notification } from '@common/notification/models/notification.entity'; import { createConnection } from 'typeorm'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; -import { SecretKeyList } from '@common/secrets'; describe('Service Created Integration Tests', () => { let app: INestApplication; @@ -56,35 +51,9 @@ describe('Service Created Integration Tests', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['POSTGRES_HOST', 'localhost'], - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ['EMAILS', process.env.EMAILS], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const modules: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -108,10 +77,7 @@ describe('Service Created Integration Tests', () => { SubstrateListenerHandler, ...ServiceCommandHandlers, ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); app = modules.createNestApplication(); await app.init(); diff --git a/test/e2e/schedulers/lab-unstake.spec.ts b/test/e2e/schedulers/lab-unstake.spec.ts index f29eaa4c..60c6a931 100644 --- a/test/e2e/schedulers/lab-unstake.spec.ts +++ b/test/e2e/schedulers/lab-unstake.spec.ts @@ -15,39 +15,16 @@ import { LabUnstakedService } from '@schedulers/lab-unstake/lab-unstake.service' import * as labQuery from '@debionetwork/polkadot-provider/lib/query/labs'; import { Lab } from '@debionetwork/polkadot-provider'; import { StakeStatus } from '@debionetwork/polkadot-provider/lib/primitives/stake-status'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; -import { SecretKeyList, keyList } from '@common/secrets'; +import { config } from '../../../src/config'; describe('Lab Unstaked Scheduler (e2e)', () => { let schedulerRegistry: SchedulerRegistry; let labUnstakedService: LabUnstakedService; let substrateService: SubstrateService; - let gCloudSecretManagerService: GCloudSecretManagerService; let elasticsearchService: ElasticsearchService; let app: INestApplication; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['UNSTAKE_TIMER', process.env.UNSTAKE_TIMER], - ['UNSTAKE_INTERVAL', process.env.UNSTAKE_INTERVAL], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - global.console = { ...console, log: jest.fn(), @@ -60,23 +37,13 @@ describe('Lab Unstaked Scheduler (e2e)', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), ElasticsearchModule.registerAsync({ - inject: [GCloudSecretManagerService], - useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, - ) => ({ + inject: [], + useFactory: async () => ({ node: process.env.ELASTICSEARCH_NODE, auth: { - username: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_USERNAME') - .toString(), - password: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_PASSWORD') - .toString(), + username: config.ELASTICSEARCH_USERNAME.toString(), + password: config.ELASTICSEARCH_PASSWORD.toString(), }, }), }), @@ -84,18 +51,13 @@ describe('Lab Unstaked Scheduler (e2e)', () => { SubstrateModule, ScheduleModule.forRoot(), ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); schedulerRegistry = module.get(SchedulerRegistry); substrateService = module.get(SubstrateService); - gCloudSecretManagerService = module.get(GCloudSecretManagerService); elasticsearchService = module.get(ElasticsearchService); labUnstakedService = new LabUnstakedService( - gCloudSecretManagerService, elasticsearchService, substrateService, schedulerRegistry, diff --git a/test/e2e/schedulers/mailer.spec.ts b/test/e2e/schedulers/mailer.spec.ts index f566dcec..798f030c 100644 --- a/test/e2e/schedulers/mailer.spec.ts +++ b/test/e2e/schedulers/mailer.spec.ts @@ -17,19 +17,14 @@ import { Keyring } from '@polkadot/api'; import { TypeOrmModule } from '@nestjs/typeorm'; import { dummyCredentials } from '../config'; import { SubstrateService } from '@common/substrate/substrate.service'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { ElasticsearchModule } from '@nestjs/elasticsearch'; -import { SecretKeyList, keyList } from '@common/secrets'; +import { config } from '../../../src/config'; describe('Mailer Scheduler (e2e)', () => { let service: MailerService; let mailerManager: MailerManager; let substrateService: SubstrateService; let emailNotificationService: EmailNotificationService; - let gCloudSecretManagerService: GCloudSecretManagerService; let app: INestApplication; @@ -42,54 +37,17 @@ describe('Mailer Scheduler (e2e)', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - async accessSecret() { - return null; - } - _secretsList = new Map([ - ['POSTGRES_HOST', 'localhost'], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ['UNSTAKE_TIMER', process.env.UNSTAKE_TIMER], - ['UNSTAKE_INTERVAL', process.env.UNSTAKE_INTERVAL], - ['EMAILS', process.env.EMAILS], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ ProcessEnvModule, - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), ElasticsearchModule.registerAsync({ - inject: [GCloudSecretManagerService], - useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, - ) => ({ + inject: [], + useFactory: async () => ({ node: process.env.ELASTICSEARCH_NODE, auth: { - username: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_USERNAME') - .toString(), - password: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_PASSWORD') - .toString(), + username: config.ELASTICSEARCH_USERNAME.toString(), + password: config.ELASTICSEARCH_PASSWORD.toString(), }, }), }), @@ -104,18 +62,13 @@ describe('Mailer Scheduler (e2e)', () => { MailModule, EmailNotificationModule, ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); mailerManager = module.get(MailerManager); substrateService = module.get(SubstrateService); emailNotificationService = module.get(EmailNotificationService); - gCloudSecretManagerService = module.get(GCloudSecretManagerService); service = new MailerService( - gCloudSecretManagerService, mailerManager, emailNotificationService, substrateService, diff --git a/test/e2e/schedulers/unstaked.spec.ts b/test/e2e/schedulers/unstaked.spec.ts index 096ca4d8..a175c147 100644 --- a/test/e2e/schedulers/unstaked.spec.ts +++ b/test/e2e/schedulers/unstaked.spec.ts @@ -14,39 +14,16 @@ import { ScheduleModule, SchedulerRegistry } from '@nestjs/schedule'; import { UnstakedService } from '@schedulers/unstaked/unstaked.service'; import * as serviceRequestQuery from '@debionetwork/polkadot-provider/lib/query/service-request'; import { ServiceRequest } from '@debionetwork/polkadot-provider'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; -import { SecretKeyList, keyList } from '@common/secrets'; +import { config } from '../../../src/config'; describe('Unstaked Scheduler (e2e)', () => { let schedulerRegistry: SchedulerRegistry; let unstakedService: UnstakedService; let substrateService: SubstrateService; - let gCloudSecretManagerService: GCloudSecretManagerService; let elasticsearchService: ElasticsearchService; let app: INestApplication; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['UNSTAKE_TIMER', process.env.UNSTAKE_TIMER], - ['UNSTAKE_INTERVAL', process.env.UNSTAKE_INTERVAL], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - global.console = { ...console, log: jest.fn(), @@ -59,23 +36,13 @@ describe('Unstaked Scheduler (e2e)', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), ElasticsearchModule.registerAsync({ - inject: [GCloudSecretManagerService], - useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, - ) => ({ + inject: [], + useFactory: async () => ({ node: process.env.ELASTICSEARCH_NODE, auth: { - username: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_USERNAME') - .toString(), - password: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_PASSWORD') - .toString(), + username: config.ELASTICSEARCH_USERNAME.toString(), + password: config.ELASTICSEARCH_PASSWORD.toString(), }, }), }), @@ -83,18 +50,13 @@ describe('Unstaked Scheduler (e2e)', () => { SubstrateModule, ScheduleModule.forRoot(), ], - }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) - .compile(); + }).compile(); schedulerRegistry = module.get(SchedulerRegistry); substrateService = module.get(SubstrateService); - gCloudSecretManagerService = module.get(GCloudSecretManagerService); elasticsearchService = module.get(ElasticsearchService); unstakedService = new UnstakedService( - gCloudSecretManagerService, elasticsearchService, substrateService, schedulerRegistry, diff --git a/test/unit/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.spec.ts b/test/unit/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.spec.ts index 18eed7f7..e574dfc9 100644 --- a/test/unit/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.spec.ts +++ b/test/unit/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.spec.ts @@ -21,7 +21,6 @@ import { import { GeneticAnalysisOrderPaidHandler } from '@listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler'; import { when } from 'jest-when'; import { NotificationService } from '@common/notification/notification.service'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; describe('Genetic Analysis Order Paid Handler Event', () => { let geneticAnalysisOrderPaidHandler: GeneticAnalysisOrderPaidHandler; @@ -29,23 +28,6 @@ describe('Genetic Analysis Order Paid Handler Event', () => { let notificationServiceMock: MockType; let proceccEnvProxy: MockType; // eslint-disable-line - const GA_ORDER_LINK = 'http://localhost/lab/orders/'; - const POSTGRES_HOST = 'localhost'; - - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['GA_ORDER_LINK', GA_ORDER_LINK], - ['POSTGRES_HOST', POSTGRES_HOST], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ providers: [ @@ -69,10 +51,6 @@ describe('Genetic Analysis Order Paid Handler Event', () => { provide: SubstrateService, useFactory: substrateServiceMockFactory, }, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, GeneticAnalysisOrderPaidHandler, ], }).compile(); diff --git a/test/unit/listeners/substrate-listener/commands/orders/order-fulfilled/order-fulfilled.handler.spec.ts b/test/unit/listeners/substrate-listener/commands/orders/order-fulfilled/order-fulfilled.handler.spec.ts index 2350feb4..219d5541 100644 --- a/test/unit/listeners/substrate-listener/commands/orders/order-fulfilled/order-fulfilled.handler.spec.ts +++ b/test/unit/listeners/substrate-listener/commands/orders/order-fulfilled/order-fulfilled.handler.spec.ts @@ -4,7 +4,7 @@ import { SubstrateService, TransactionLoggingService, } from '@common/index'; -import { Order, OrderStatus } from '@debionetwork/polkadot-provider'; +import { OrderStatus } from '@debionetwork/polkadot-provider'; import { OrderCreatedCommand } from '@listeners/substrate-listener/commands/orders'; import { Test, TestingModule } from '@nestjs/testing'; import { @@ -27,7 +27,6 @@ import { TransactionRequest } from '@common/transaction-logging/models/transacti import * as globalProviderMethods from '@debionetwork/polkadot-provider/lib/index'; import * as rewardCommand from '@debionetwork/polkadot-provider/lib/command/rewards'; -import * as serviceRequestCommand from '@debionetwork/polkadot-provider/lib/command/service-request'; import * as userProfileQuery from '@debionetwork/polkadot-provider/lib/query/user-profile'; import * as serviceRequestQuery from '@debionetwork/polkadot-provider/lib/query/service-request'; import * as ordersQuery from '@debionetwork/polkadot-provider/lib/query/labs/orders'; diff --git a/test/unit/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.spec.ts b/test/unit/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.spec.ts index e6859b63..9293019f 100644 --- a/test/unit/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.spec.ts +++ b/test/unit/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.spec.ts @@ -23,7 +23,6 @@ import { when } from 'jest-when'; import { TransactionLoggingDto } from '@common/transaction-logging/dto/transaction-logging.dto'; import { TransactionRequest } from '@common/transaction-logging/models/transaction-request.entity'; import { NotificationService } from '@common/notification/notification.service'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import { TransactionTypeList } from '@common/transaction-type/models/transaction-type.list'; import { TransactionStatusList } from '@common/transaction-status/models/transaction-status.list'; @@ -32,23 +31,6 @@ describe('Order Paid Handler Event', () => { let transactionLoggingServiceMock: MockType; let proceccEnvProxy: MockType; // eslint-disable-line - const LAB_ORDER_LINK = 'http://localhost/lab/orders/'; - const POSTGRES_HOST = 'localhost'; - - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['LAB_ORDER_LINK', LAB_ORDER_LINK], - ['POSTGRES_HOST', POSTGRES_HOST], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeEach(async () => { jest .useFakeTimers() @@ -75,10 +57,6 @@ describe('Order Paid Handler Event', () => { provide: SubstrateService, useFactory: substrateServiceMockFactory, }, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, OrderPaidHandler, ], }).compile(); diff --git a/test/unit/listeners/substrate-listener/commands/service-request/service-request-created/service-request-created.handler.spec.ts b/test/unit/listeners/substrate-listener/commands/service-request/service-request-created/service-request-created.handler.spec.ts index b5cfb380..30f70ef4 100644 --- a/test/unit/listeners/substrate-listener/commands/service-request/service-request-created/service-request-created.handler.spec.ts +++ b/test/unit/listeners/substrate-listener/commands/service-request/service-request-created/service-request-created.handler.spec.ts @@ -7,7 +7,6 @@ import { transactionLoggingServiceMockFactory, notificationServiceMockFactory, dateTimeProxyMockFactory, - googleSecretManagerServiceMockFactory, } from '../../../../../mock'; import { MailerManager, @@ -23,7 +22,6 @@ import { NotificationService } from '@common/notification/notification.service'; import { BlockMetaData } from '@listeners/substrate-listener/models/block-metadata.event-model'; import { ServiceRequestCreatedCommand } from '@listeners/substrate-listener/commands/service-request'; import { when } from 'jest-when'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; describe('Service Request Created Handler Event', () => { let serviceRequesCreatedHandler: ServiceRequestCreatedHandler; @@ -97,10 +95,6 @@ describe('Service Request Created Handler Event', () => { provide: DateTimeProxy, useFactory: dateTimeProxyMockFactory, }, - { - provide: GCloudSecretManagerService, - useFactory: googleSecretManagerServiceMockFactory, - }, ServiceRequestCreatedHandler, ], }).compile(); diff --git a/test/unit/listeners/substrate-listener/commands/services/service-created/service-created.handler.spec.ts b/test/unit/listeners/substrate-listener/commands/services/service-created/service-created.handler.spec.ts index bef84be6..aa4817f9 100644 --- a/test/unit/listeners/substrate-listener/commands/services/service-created/service-created.handler.spec.ts +++ b/test/unit/listeners/substrate-listener/commands/services/service-created/service-created.handler.spec.ts @@ -9,7 +9,6 @@ import { ServiceFlow, ServiceInfo } from '@debionetwork/polkadot-provider'; import { ServiceCreatedHandler } from '@listeners/substrate-listener/commands/services/service-created/service-created.handler'; import { dateTimeProxyMockFactory, - googleSecretManagerServiceMockFactory, mailerManagerMockFactory, mockBlockNumber, MockType, @@ -20,7 +19,6 @@ import * as labQuery from '@debionetwork/polkadot-provider/lib/query/labs'; import { when } from 'jest-when'; import { NotificationService } from '@common/notification/notification.service'; import { ServiceCreatedCommand } from '@listeners/substrate-listener/commands/services'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; describe('Service Created Handler Event', () => { let serviceCreatedHandle: ServiceCreatedHandler; @@ -72,10 +70,6 @@ describe('Service Created Handler Event', () => { provide: DateTimeProxy, useFactory: dateTimeProxyMockFactory, }, - { - provide: GCloudSecretManagerService, - useFactory: googleSecretManagerServiceMockFactory, - }, ServiceCreatedHandler, ], }).compile(); diff --git a/test/unit/listeners/substrate-listener/substrate-listener.handler.spec.ts b/test/unit/listeners/substrate-listener/substrate-listener.handler.spec.ts index eb203b52..919fdcde 100644 --- a/test/unit/listeners/substrate-listener/substrate-listener.handler.spec.ts +++ b/test/unit/listeners/substrate-listener/substrate-listener.handler.spec.ts @@ -18,7 +18,6 @@ import { } from './substrate-listener.mock.data'; import { Logger } from '@nestjs/common'; import { BlockMetaData } from '@listeners/substrate-listener/models/block-metadata.event-model'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; const eventsSpy = jest.spyOn(API_MOCK.query.system, 'events'); const getBlockSpy = jest.spyOn(API_MOCK.rpc.chain, 'getBlock'); @@ -45,16 +44,6 @@ describe('Substrate Listener Handler Unit Test', () => { })); const NODE_ENV = 'development'; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([['NODE_ENV', NODE_ENV]]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } class ProcessEnvProxyMock { env = { NODE_ENV, @@ -69,10 +58,6 @@ describe('Substrate Listener Handler Unit Test', () => { { provide: QueryBus, useFactory: queryBusMockFactory }, { provide: CommandBus, useFactory: commandBusMockFactory }, { provide: ProcessEnvProxy, useClass: ProcessEnvProxyMock }, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, ], }).compile(); diff --git a/test/unit/mock.ts b/test/unit/mock.ts index def6bfd9..2eaae925 100644 --- a/test/unit/mock.ts +++ b/test/unit/mock.ts @@ -25,7 +25,6 @@ import { CountryService } from '@common/location/country.service'; import { StateService } from '@common/location/state.service'; import { SchedulerRegistry } from '@nestjs/schedule'; import { NotificationService } from '@common/notification/notification.service'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import { ErrorLoggingService } from '@common/error-logging/error-logging.service'; export function mockFunction(args) {} // eslint-disable-line @@ -366,13 +365,6 @@ export const schedulerRegistryMockFactory: () => MockType = addInterval: jest.fn(), })); -export const googleSecretManagerServiceMockFactory: () => MockType< - GCloudSecretManagerService -> = jest.fn(() => ({ - loadSecrets: jest.fn((entity) => entity), - getSecret: jest.fn((entity) => entity), -})); - export const errorLoggingServiceMockFactory: () => MockType = jest.fn(() => ({ getAllByToId: jest.fn((entity) => entity), diff --git a/test/unit/schedulers/genetic-analyst-unstaked/genetic-analyst-unstaked.service.spec.ts b/test/unit/schedulers/genetic-analyst-unstaked/genetic-analyst-unstaked.service.spec.ts index c04bfb35..87d0f843 100644 --- a/test/unit/schedulers/genetic-analyst-unstaked/genetic-analyst-unstaked.service.spec.ts +++ b/test/unit/schedulers/genetic-analyst-unstaked/genetic-analyst-unstaked.service.spec.ts @@ -15,7 +15,6 @@ import * as geneticAnalystCommand from '@debionetwork/polkadot-provider/lib/comm import { when } from 'jest-when'; import { SchedulerRegistry } from '@nestjs/schedule'; import { GeneticAnalystUnstakedService } from '@schedulers/genetic-analyst-unstaked/unstaked.service'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import * as schedulersTools from '@common/tools/schedulers'; jest.useFakeTimers(); @@ -31,20 +30,6 @@ describe('UnstakedService', () => { const INTERVAL = '00:00:00:30'; const TIMER = '6:00:00:00'; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['UNSTAKE_INTERVAL', INTERVAL], - ['UNSTAKE_TIMER', TIMER], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - class ProcessEnvProxyMock { env = { UNSTAKE_INTERVAL: INTERVAL, @@ -86,10 +71,6 @@ describe('UnstakedService', () => { provide: ProcessEnvProxy, useClass: ProcessEnvProxyMock, }, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, { provide: ElasticsearchService, useFactory: elasticsearchServiceMockFactory, diff --git a/test/unit/schedulers/lab/lab-unstake.service.spec.ts b/test/unit/schedulers/lab/lab-unstake.service.spec.ts index 472b253e..572b2b06 100644 --- a/test/unit/schedulers/lab/lab-unstake.service.spec.ts +++ b/test/unit/schedulers/lab/lab-unstake.service.spec.ts @@ -16,7 +16,6 @@ import * as labQuery from '@debionetwork/polkadot-provider/lib/query/labs'; import * as labCommand from '@debionetwork/polkadot-provider/lib/command/labs'; import { when } from 'jest-when'; import { StakeStatus } from '@debionetwork/polkadot-provider/lib/primitives/stake-status'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import * as schedulersTools from '@common/tools/schedulers'; jest.useFakeTimers(); @@ -32,20 +31,6 @@ describe('LabUnstakedService', () => { const INTERVAL = '00:00:00:30'; const TIMER = '6:00:00:00'; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['UNSTAKE_INTERVAL', INTERVAL], - ['UNSTAKE_TIMER', TIMER], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - const createSearchObject = () => { return { index: 'labs', @@ -76,10 +61,6 @@ describe('LabUnstakedService', () => { const module: TestingModule = await Test.createTestingModule({ providers: [ LabUnstakedService, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, { provide: ElasticsearchService, useFactory: elasticsearchServiceMockFactory, diff --git a/test/unit/schedulers/mailer/mailer.service.spec.ts b/test/unit/schedulers/mailer/mailer.service.spec.ts index c1667346..3ece58ba 100644 --- a/test/unit/schedulers/mailer/mailer.service.spec.ts +++ b/test/unit/schedulers/mailer/mailer.service.spec.ts @@ -5,7 +5,6 @@ import { mailerManagerMockFactory, emailNotificationServiceMockFactory, substrateServiceMockFactory, - googleSecretManagerServiceMockFactory, } from '../../mock'; import { MailerService } from '@schedulers/mailer/mailer.service'; import { @@ -13,7 +12,6 @@ import { MailerManager, SubstrateService, } from '@common/index'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; describe('MailerService', () => { let mailManagerMock: MockType; @@ -36,10 +34,6 @@ describe('MailerService', () => { provide: SubstrateService, useFactory: substrateServiceMockFactory, }, - { - provide: GCloudSecretManagerService, - useFactory: googleSecretManagerServiceMockFactory, - }, ], }).compile(); module.useLogger(MockLogger); diff --git a/test/unit/schedulers/menstrual-subscription/menstrual-subscription.service.spec.ts b/test/unit/schedulers/menstrual-subscription/menstrual-subscription.service.spec.ts index cfc0dd51..ccf4767a 100644 --- a/test/unit/schedulers/menstrual-subscription/menstrual-subscription.service.spec.ts +++ b/test/unit/schedulers/menstrual-subscription/menstrual-subscription.service.spec.ts @@ -1,5 +1,4 @@ import { SubstrateService } from '@common/substrate'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import { ElasticsearchService } from '@nestjs/elasticsearch'; import { SchedulerRegistry } from '@nestjs/schedule'; import { Test, TestingModule } from '@nestjs/testing'; @@ -19,35 +18,10 @@ describe('Menstrual Subscription Service', () => { let substrateServiceMock: MockType; let schedulerRegistryMock: MockType; - const MENSTRUAL_SUBSCRIPTION_DURATION = - process?.env?.MENSTRUAL_SUBSCRIPTION_DURATION ?? - '{"Monthly": "30:00:00:00", "Quarterly": "90:00:00:00", "Yearly": "365:00:00:00"}'; - const INTERVAL = '00:00:00:30'; - const TIMER = '6:00:00:00'; - - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['MENSTRUAL_SUBSCRIPTION_DURATION', MENSTRUAL_SUBSCRIPTION_DURATION], - ['UNSTAKE_INTERVAL', INTERVAL], - ['UNSTAKE_TIMER', TIMER], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ providers: [ MenstrualSubscriptionService, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, { provide: ElasticsearchService, useFactory: elasticsearchServiceMockFactory, @@ -87,12 +61,10 @@ describe('Menstrual Subscription Service', () => { it('should parse mesntrual subscription duration env value', () => { expect( menstrualSubscriptionService.parseMenstrualSubscriptionDuration(), - ).toEqual( - expect.objectContaining({ - Monthly: 30 * 24 * 60 * 60 * 1000, - Quarterly: 3 * 30 * 24 * 60 * 60 * 1000, - Yearly: 365 * 24 * 60 * 60 * 1000, - }), - ); + ).toEqual({ + Monthly: 30 * 24 * 60 * 60 * 1000, + Quarterly: 3 * 30 * 24 * 60 * 60 * 1000, + Yearly: 365 * 24 * 60 * 60 * 1000, + }); }); }); diff --git a/test/unit/schedulers/unstaked/unstaked.service.spec.ts b/test/unit/schedulers/unstaked/unstaked.service.spec.ts index 62208e0f..5f6cd03e 100644 --- a/test/unit/schedulers/unstaked/unstaked.service.spec.ts +++ b/test/unit/schedulers/unstaked/unstaked.service.spec.ts @@ -15,7 +15,6 @@ import * as serviceRequestQuery from '@debionetwork/polkadot-provider/lib/query/ import * as serviceRequestCommand from '@debionetwork/polkadot-provider/lib/command/service-request'; import { when } from 'jest-when'; import { SchedulerRegistry } from '@nestjs/schedule'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import * as schedulersTools from '@common/tools/schedulers'; jest.useFakeTimers(); @@ -31,20 +30,6 @@ describe('UnstakedService', () => { const INTERVAL = '00:00:00:30'; const TIMER = '6:00:00:00'; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['UNSTAKE_INTERVAL', INTERVAL], - ['UNSTAKE_TIMER', TIMER], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - const createSearchObject = () => { return { index: 'create-service-request', @@ -75,10 +60,6 @@ describe('UnstakedService', () => { const module: TestingModule = await Test.createTestingModule({ providers: [ UnstakedService, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, { provide: ElasticsearchService, useFactory: elasticsearchServiceMockFactory,