diff --git a/package.json b/package.json index 74572bf9..273c213d 100644 --- a/package.json +++ b/package.json @@ -160,7 +160,7 @@ "@types/jest": "^29.5.5", "@types/mime-types": "^2.1.2", "@types/multer": "^1.4.8", - "@types/node": "^20.8.3", + "@types/node": "^20.8.4", "@types/nodemailer": "^6.4.11", "@types/passport": "^1.0.13", "@types/passport-facebook": "^3.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbd2d255..7dedb0ff 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,10 +4,6 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false -overrides: - prom-client: ^14.0.0 - stripe: ^11.12.0 - dependencies: '@aws-sdk/client-s3': specifier: ^3.427.0 @@ -23,7 +19,7 @@ dependencies: version: 4.0.0(@nestjs/common@10.2.7)(@nestjs/core@10.2.7)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@golevelup/nestjs-stripe': specifier: ^0.6.3 - version: 0.6.3(@nestjs/common@10.2.7)(@nestjs/core@10.2.7)(rxjs@7.8.1)(stripe@11.18.0) + version: 0.6.3(@nestjs/common@10.2.7)(@nestjs/core@10.2.7)(rxjs@7.8.1)(stripe@13.9.0) '@golevelup/nestjs-webhooks': specifier: ^0.2.16 version: 0.2.16(@nestjs/common@10.2.7)(body-parser@1.20.2)(rxjs@7.8.1) @@ -217,8 +213,8 @@ dependencies: specifier: ^3.0.19 version: 3.0.19 prom-client: - specifier: ^14.0.0 - version: 14.2.0 + specifier: ^15.0.0 + version: 15.0.0 pug: specifier: ^3.0.2 version: 3.0.2 @@ -244,11 +240,11 @@ dependencies: specifier: ^4.7.2 version: 4.7.2 stripe: - specifier: ^11.12.0 - version: 11.18.0 + specifier: ^13.9.0 + version: 13.9.0 swagger-stats: specifier: ^0.99.7 - version: 0.99.7(prom-client@14.2.0) + version: 0.99.7(prom-client@15.0.0) twilio: specifier: 4.18.1 version: 4.18.1 @@ -324,8 +320,8 @@ devDependencies: specifier: ^1.4.8 version: 1.4.8 '@types/node': - specifier: ^20.8.3 - version: 20.8.3 + specifier: ^20.8.4 + version: 20.8.4 '@types/nodemailer': specifier: ^6.4.11 version: 6.4.11 @@ -376,7 +372,7 @@ devDependencies: version: 8.0.3 jest: specifier: 29.7.0 - version: 29.7.0(@types/node@20.8.3)(ts-node@10.9.1) + version: 29.7.0(@types/node@20.8.4)(ts-node@10.9.1) lint-staged: specifier: ^14.0.1 version: 14.0.1 @@ -394,7 +390,7 @@ devDependencies: version: 9.5.0(typescript@5.2.2)(webpack@5.88.2) ts-node: specifier: 10.9.1 - version: 10.9.1(@swc/core@1.3.92)(@types/node@20.8.3)(typescript@5.2.2) + version: 10.9.1(@swc/core@1.3.92)(@types/node@20.8.4)(typescript@5.2.2) tsconfig-paths: specifier: 4.2.0 version: 4.2.0 @@ -1922,7 +1918,7 @@ packages: - supports-color dev: false - /@golevelup/nestjs-stripe@0.6.3(@nestjs/common@10.2.7)(@nestjs/core@10.2.7)(rxjs@7.8.1)(stripe@11.18.0): + /@golevelup/nestjs-stripe@0.6.3(@nestjs/common@10.2.7)(@nestjs/core@10.2.7)(rxjs@7.8.1)(stripe@13.9.0): resolution: {integrity: sha512-1h9VBwZIpw/xN5iuzpA1YtQq2ezOP7dVEUnB4xtGTWX3/3KjUm2DlBawQ5YN8aTK+FJMCHTg839rq4FryEj12w==} peerDependencies: stripe: ^11.12.0 @@ -1930,7 +1926,7 @@ packages: '@golevelup/nestjs-common': 2.0.0(@nestjs/common@10.2.7) '@golevelup/nestjs-discovery': 4.0.0(@nestjs/common@10.2.7)(@nestjs/core@10.2.7) '@golevelup/nestjs-modules': 0.7.0(@nestjs/common@10.2.7)(rxjs@7.8.1) - stripe: 11.18.0 + stripe: 13.9.0 transitivePeerDependencies: - '@nestjs/common' - '@nestjs/core' @@ -2076,7 +2072,7 @@ packages: requiresBuild: true dependencies: '@grpc/proto-loader': 0.7.10 - '@types/node': 20.8.3 + '@types/node': 20.8.4 dev: false optional: true @@ -2383,7 +2379,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.8.3 + '@types/node': 20.8.4 chalk: 4.1.2 jest-message-util: 29.7.0 jest-util: 29.7.0 @@ -2404,14 +2400,14 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.8.3 + '@types/node': 20.8.4 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.8.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.8.3)(ts-node@10.9.1) + jest-config: 29.7.0(@types/node@20.8.4)(ts-node@10.9.1) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -2446,7 +2442,7 @@ packages: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.8.3 + '@types/node': 20.8.4 jest-mock: 29.7.0 dev: true @@ -2473,7 +2469,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.8.3 + '@types/node': 20.8.4 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -2506,7 +2502,7 @@ packages: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.19 - '@types/node': 20.8.3 + '@types/node': 20.8.4 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -2593,7 +2589,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.2 - '@types/node': 20.8.3 + '@types/node': 20.8.4 '@types/yargs': 16.0.6 chalk: 4.1.2 dev: true @@ -2605,7 +2601,7 @@ packages: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.2 - '@types/node': 20.8.3 + '@types/node': 20.8.4 '@types/yargs': 17.0.26 chalk: 4.1.2 dev: true @@ -3468,6 +3464,10 @@ packages: transitivePeerDependencies: - encoding + /@opentelemetry/api@1.6.0: + resolution: {integrity: sha512-OWlrQAnWn9577PhVgqjUvMr1pg57Bc4jv0iL4w0PRuOSRvq67rvHW9Ie/dZVMvCzhSCB+UxhcY/PmCmFj33Q+g==} + engines: {node: '>=8.0.0'} + /@otplib/core@12.0.1: resolution: {integrity: sha512-4sGntwbA/AC+SbPhbsziRiD+jNDdIzsZ3JUyfZwjtKyc/wufl1pnSIaG4Uqx8ymPagujub0o92kgBnB89cuAMA==} dev: false @@ -3751,7 +3751,7 @@ packages: jest-runtime: '>=28' dependencies: '@jest/transform': 29.7.0 - jest: 29.7.0(@types/node@20.8.3)(ts-node@10.9.1) + jest: 29.7.0(@types/node@20.8.4)(ts-node@10.9.1) jest-runtime: 29.7.0 dev: true @@ -4477,7 +4477,7 @@ packages: resolution: {integrity: sha512-oyl4jvAfTGX9Bt6Or4H9ni1Z447/tQuxnZsytsCaExKlmJiU8sFgnIBRzJUpKwB5eWn9HuBYlUlVA74q/yN0eQ==} dependencies: '@types/connect': 3.4.36 - '@types/node': 20.8.3 + '@types/node': 20.8.4 /@types/cache-manager-redis-store@2.0.2: resolution: {integrity: sha512-Y9AkjU/y3If0nlJI/8k3mMmr/1FIuZ8U7biI5vQH0uP5mOb1Xycru6NcOiVKyUe/adHYUoY/EpnvWZ8NoBqRKQ==} @@ -4509,7 +4509,7 @@ packages: /@types/connect@3.4.36: resolution: {integrity: sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 /@types/cookie@0.4.1: resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} @@ -4521,7 +4521,7 @@ packages: /@types/cors@2.8.14: resolution: {integrity: sha512-RXHUvNWYICtbP6s18PnOCaqToK8y14DnLd75c6HfyKf228dxy7pHNOQkxPtvXKp/hINFMDjbYzsj63nnpPMSRQ==} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 /@types/dompurify@3.0.3: resolution: {integrity: sha512-odiGr/9/qMqjcBOe5UhcNLOFHSYmKFOyr+bJ/Xu3Qp4k1pNPAlNLUVNNLcLfjQI7+W7ObX58EdD3H+3p3voOvA==} @@ -4550,7 +4550,7 @@ packages: /@types/express-serve-static-core@4.17.37: resolution: {integrity: sha512-ZohaCYTgGFcOP7u6aJOhY9uIZQgZ2vxC2yWoArY+FeDXlqeH66ZVBjgvg+RLVAS/DWNq4Ap9ZXu1+SUQiiWYMg==} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 '@types/qs': 6.9.8 '@types/range-parser': 1.2.5 '@types/send': 0.17.2 @@ -4568,14 +4568,14 @@ packages: requiresBuild: true dependencies: '@types/minimatch': 5.1.2 - '@types/node': 20.8.3 + '@types/node': 20.8.4 dev: false optional: true /@types/graceful-fs@4.1.7: resolution: {integrity: sha512-MhzcwU8aUygZroVwL2jeYk6JisJrPl/oov/gsgGCue9mkgl9wjGbzReYQClxiUgFDnib9FuHqTndccKeZKxTRw==} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 dev: true /@types/http-errors@2.0.2: @@ -4611,13 +4611,13 @@ packages: /@types/jsonwebtoken@9.0.2: resolution: {integrity: sha512-drE6uz7QBKq1fYqqoFKTDRdFCPHd5TCub75BM+D+cMx7NU9hUz7SESLfC2fSCXVFMO5Yj8sOWHuGqPgjc+fz0Q==} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 dev: false /@types/jsonwebtoken@9.0.3: resolution: {integrity: sha512-b0jGiOgHtZ2jqdPgPnP6WLCXZk1T8p06A/vPGzUvxpFGgKMbjXJDjC5m52ErqBnIuWZFgGoIJyRdeG5AyreJjA==} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 /@types/linkify-it@3.0.3: resolution: {integrity: sha512-pTjcqY9E4nOI55Wgpz7eiI8+LzdYnw3qxXCfHyBDdPbYvbyLgWLJGh8EdPvqawwMK1Uo1794AUkkR38Fr0g+2g==} @@ -4638,7 +4638,7 @@ packages: /@types/mailparser@3.4.1: resolution: {integrity: sha512-ZEF3ElxrEY/7cmo6YCOZVIwJRyUae3ioic4llB7qjmwHZdaElvsnefnvkS8Jakc4U9vBvQJvfTlK5Q/67DyAqQ==} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 iconv-lite: 0.6.3 dev: true @@ -4695,13 +4695,15 @@ packages: dev: true optional: true - /@types/node@20.8.3: - resolution: {integrity: sha512-jxiZQFpb+NlH5kjW49vXxvxTjeeqlbsnTAdBTKpzEdPs9itay7MscYXz3Fo9VYFEsfQ6LJFitHad3faerLAjCw==} + /@types/node@20.8.4: + resolution: {integrity: sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==} + dependencies: + undici-types: 5.25.3 /@types/nodemailer@6.4.11: resolution: {integrity: sha512-Ld2c0frwpGT4VseuoeboCXQ7UJIkK3X7Lx/4YsZEiUHtHsthWAOCYtf6PAiLhMtfwV0cWJRabLBS3+LD8x6Nrw==} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 dev: true /@types/normalize-package-data@2.4.2: @@ -4710,7 +4712,7 @@ packages: /@types/oauth@0.9.2: resolution: {integrity: sha512-Nu3/abQ6yR9VlsCdX3aiGsWFkj6OJvJqDvg/36t8Gwf2mFXdBZXPDN3K+2yfeA6Lo2m1Q12F8Qil9TZ48nWhOQ==} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 dev: true /@types/parse-json@4.0.0: @@ -4766,7 +4768,7 @@ packages: resolution: {integrity: sha512-bb/oorXPzl16jDK9APG+5rZoLxFD1msong4GxWQr02b8kMdrED2GzcYUig3uk6bkulYECkHR+CXrBqohj/bhsQ==} dependencies: '@types/mailparser': 3.4.1 - '@types/node': 20.8.3 + '@types/node': 20.8.4 '@types/nodemailer': 6.4.11 dev: true @@ -4777,7 +4779,7 @@ packages: /@types/qrcode@1.5.2: resolution: {integrity: sha512-W4KDz75m7rJjFbyCctzCtRzZUj+PrUHV+YjqDp50sSRezTbrtEAIq2iTzC6lISARl3qw+8IlcCyljdcVJE0Wug==} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 dev: true /@types/qs@6.9.8: @@ -4795,7 +4797,7 @@ packages: /@types/redis@2.8.32: resolution: {integrity: sha512-7jkMKxcGq9p242exlbsVzuJb57KqHRhNl4dHoQu2Y5v9bCAbtIXXH0R3HleSQW4CTOqpHIYUW3t6tpUj4BVQ+w==} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 dev: true /@types/rimraf@3.0.2: @@ -4803,7 +4805,7 @@ packages: requiresBuild: true dependencies: '@types/glob': 8.1.0 - '@types/node': 20.8.3 + '@types/node': 20.8.4 dev: false optional: true @@ -4815,14 +4817,14 @@ packages: resolution: {integrity: sha512-aAG6yRf6r0wQ29bkS+x97BIs64ZLxeE/ARwyS6wrldMm3C1MdKwCcnnEwMC1slI8wuxJOpiUH9MioC0A0i+GJw==} dependencies: '@types/mime': 1.3.3 - '@types/node': 20.8.3 + '@types/node': 20.8.4 /@types/serve-static@1.15.3: resolution: {integrity: sha512-yVRvFsEMrv7s0lGhzrggJjNOSmZCdgCjw9xWrPr/kNNLp6FaDfMC1KaYl3TSJ0c58bECwNBMoQrZJ8hA8E1eFg==} dependencies: '@types/http-errors': 2.0.2 '@types/mime': 3.0.2 - '@types/node': 20.8.3 + '@types/node': 20.8.4 /@types/stack-utils@2.0.1: resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} @@ -4832,7 +4834,7 @@ packages: resolution: {integrity: sha512-McM1mlc7PBZpCaw0fw/36uFqo0YeA6m8JqoyE4OfqXsZCIg0hPP2xdE6FM7r6fdprDZHlJwDpydUj1R++93hCA==} dependencies: '@types/cookiejar': 2.1.2 - '@types/node': 20.8.3 + '@types/node': 20.8.4 dev: true /@types/supertest@2.0.14: @@ -4846,10 +4848,10 @@ packages: dependencies: '@hapi/hapi': 21.1.0 '@types/express': 4.17.18 - '@types/node': 20.8.3 + '@types/node': 20.8.4 fastify: 3.29.5 joi: 17.11.0 - prom-client: 14.2.0 + prom-client: 15.0.0 transitivePeerDependencies: - supports-color dev: true @@ -6532,7 +6534,7 @@ packages: dev: true optional: true - /create-jest@29.7.0(@types/node@20.8.3)(ts-node@10.9.1): + /create-jest@29.7.0(@types/node@20.8.4)(ts-node@10.9.1): resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -6541,7 +6543,7 @@ packages: chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.8.3)(ts-node@10.9.1) + jest-config: 29.7.0(@types/node@20.8.4)(ts-node@10.9.1) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -6985,7 +6987,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.14 - '@types/node': 20.8.3 + '@types/node': 20.8.4 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -8035,7 +8037,7 @@ packages: '@fastify/busboy': 1.2.1 '@firebase/database-compat': 0.3.4 '@firebase/database-types': 0.10.4 - '@types/node': 20.8.3 + '@types/node': 20.8.4 jsonwebtoken: 9.0.2 jwks-rsa: 3.0.1 node-forge: 1.3.1 @@ -9329,7 +9331,7 @@ packages: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.8.3 + '@types/node': 20.8.4 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.1 @@ -9350,7 +9352,7 @@ packages: - supports-color dev: true - /jest-cli@29.7.0(@types/node@20.8.3)(ts-node@10.9.1): + /jest-cli@29.7.0(@types/node@20.8.4)(ts-node@10.9.1): resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -9364,10 +9366,10 @@ packages: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.8.3)(ts-node@10.9.1) + create-jest: 29.7.0(@types/node@20.8.4)(ts-node@10.9.1) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@20.8.3)(ts-node@10.9.1) + jest-config: 29.7.0(@types/node@20.8.4)(ts-node@10.9.1) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -9378,7 +9380,7 @@ packages: - ts-node dev: true - /jest-config@29.7.0(@types/node@20.8.3)(ts-node@10.9.1): + /jest-config@29.7.0(@types/node@20.8.4)(ts-node@10.9.1): resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -9393,7 +9395,7 @@ packages: '@babel/core': 7.23.0 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.8.3 + '@types/node': 20.8.4 babel-jest: 29.7.0(@babel/core@7.23.0) chalk: 4.1.2 ci-info: 3.8.0 @@ -9413,7 +9415,7 @@ packages: pretty-format: 29.7.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1(@swc/core@1.3.92)(@types/node@20.8.3)(typescript@5.2.2) + ts-node: 10.9.1(@swc/core@1.3.92)(@types/node@20.8.4)(typescript@5.2.2) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -9454,7 +9456,7 @@ packages: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.8.3 + '@types/node': 20.8.4 jest-mock: 29.7.0 jest-util: 29.7.0 dev: true @@ -9470,7 +9472,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.7 - '@types/node': 20.8.3 + '@types/node': 20.8.4 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -9521,7 +9523,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.8.3 + '@types/node': 20.8.4 jest-util: 29.7.0 dev: true @@ -9576,7 +9578,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.8.3 + '@types/node': 20.8.4 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -9607,7 +9609,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.8.3 + '@types/node': 20.8.4 chalk: 4.1.2 cjs-module-lexer: 1.2.3 collect-v8-coverage: 1.0.2 @@ -9659,7 +9661,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.8.3 + '@types/node': 20.8.4 chalk: 4.1.2 ci-info: 3.8.0 graceful-fs: 4.2.11 @@ -9684,7 +9686,7 @@ packages: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.8.3 + '@types/node': 20.8.4 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -9696,7 +9698,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -9705,13 +9707,13 @@ packages: resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true - /jest@29.7.0(@types/node@20.8.3)(ts-node@10.9.1): + /jest@29.7.0(@types/node@20.8.4)(ts-node@10.9.1): resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -9724,7 +9726,7 @@ packages: '@jest/core': 29.7.0(ts-node@10.9.1) '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@20.8.3)(ts-node@10.9.1) + jest-cli: 29.7.0(@types/node@20.8.4)(ts-node@10.9.1) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -11785,10 +11787,11 @@ packages: engines: {node: '>= 0.6.0'} dev: false - /prom-client@14.2.0: - resolution: {integrity: sha512-sF308EhTenb/pDRPakm+WgiN+VdM/T1RaHj1x+MvAuT8UiQP8JmOEbxVqtkbfR4LrvOg5n7ic01kRBDGXjYikA==} - engines: {node: '>=10'} + /prom-client@15.0.0: + resolution: {integrity: sha512-UocpgIrKyA2TKLVZDSfm8rGkL13C19YrQBAiG3xo3aDFWcHedxRxI3z+cIcucoxpSO0h5lff5iv/SXoxyeopeA==} + engines: {node: ^16 || ^18 || >=20} dependencies: + '@opentelemetry/api': 1.6.0 tdigest: 0.1.2 /promise-breaker@5.0.0: @@ -11863,7 +11866,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 20.8.3 + '@types/node': 20.8.4 long: 5.2.3 dev: false optional: true @@ -11883,7 +11886,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 20.8.3 + '@types/node': 20.8.4 long: 5.2.3 dev: false optional: true @@ -13061,11 +13064,11 @@ packages: acorn: 8.10.0 dev: true - /stripe@11.18.0: - resolution: {integrity: sha512-OUA32uhNoSoM6wOodyFbV+3IBCoO140uzdXmBArQ0S88D4EbH91xl2v+Ml1sKalcFKUBadHLeHfU/p9AbsOfGw==} + /stripe@13.9.0: + resolution: {integrity: sha512-sQAqodCvaw/iYWauHHdOWlFGj0oZj/3A51zs4rG5PN3SUJUFSSjtnbc9q5Djpls0iz3nXz2UwjzAdKHVP4dVqQ==} engines: {node: '>=12.*'} dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 qs: 6.11.2 dev: false @@ -13156,10 +13159,10 @@ packages: dev: false optional: true - /swagger-stats@0.99.7(prom-client@14.2.0): + /swagger-stats@0.99.7(prom-client@15.0.0): resolution: {integrity: sha512-niP70m99Cwpz/Fyfk8ydul1jM0pOKD6UofSaDzW2Op6o6WYFsuAl/BhVbmLkZWOAZ7IloDVvFj6vaU5zA0xydg==} peerDependencies: - prom-client: ^14.0.0 + prom-client: '>= 10 <= 14' dependencies: axios: 1.5.1(debug@4.3.4) basic-auth: 2.0.1 @@ -13167,7 +13170,7 @@ packages: debug: 4.3.4 moment: 2.29.4 path-to-regexp: 6.2.1 - prom-client: 14.2.0 + prom-client: 15.0.0 qs: 6.11.2 send: 0.18.0 uuid: 9.0.1 @@ -13511,7 +13514,7 @@ packages: dev: true optional: true - /ts-node@10.9.1(@swc/core@1.3.92)(@types/node@20.8.3)(typescript@5.2.2): + /ts-node@10.9.1(@swc/core@1.3.92)(@types/node@20.8.4)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -13531,7 +13534,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.8.3 + '@types/node': 20.8.4 acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 @@ -13766,6 +13769,9 @@ packages: dev: false optional: true + /undici-types@5.25.3: + resolution: {integrity: sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==} + /unist-util-stringify-position@2.0.3: resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} dependencies: @@ -13895,7 +13901,7 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - /vite-node@0.34.6(@types/node@20.8.3): + /vite-node@0.34.6(@types/node@20.8.4): resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} engines: {node: '>=v14.18.0'} hasBin: true @@ -13905,7 +13911,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.4.10(@types/node@20.8.3) + vite: 4.4.10(@types/node@20.8.4) transitivePeerDependencies: - '@types/node' - less @@ -13917,7 +13923,7 @@ packages: - terser dev: true - /vite@4.4.10(@types/node@20.8.3): + /vite@4.4.10(@types/node@20.8.4): resolution: {integrity: sha512-TzIjiqx9BEXF8yzYdF2NTf1kFFbjMjUSV0LFZ3HyHoI3SGSPLnnFUKiIQtL3gl2AjHvMrprOvQ3amzaHgQlAxw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -13945,7 +13951,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.8.3 + '@types/node': 20.8.4 esbuild: 0.18.20 postcss: 8.4.31 rollup: 3.29.4 @@ -13986,7 +13992,7 @@ packages: dependencies: '@types/chai': 4.3.6 '@types/chai-subset': 1.3.3 - '@types/node': 20.8.3 + '@types/node': 20.8.4 '@vitest/expect': 0.34.6 '@vitest/runner': 0.34.6 '@vitest/snapshot': 0.34.6 @@ -14005,8 +14011,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.1 tinypool: 0.7.0 - vite: 4.4.10(@types/node@20.8.3) - vite-node: 0.34.6(@types/node@20.8.3) + vite: 4.4.10(@types/node@20.8.4) + vite-node: 0.34.6(@types/node@20.8.4) why-is-node-running: 2.2.2 transitivePeerDependencies: - less diff --git a/src/common/helpers/app.utils.ts b/src/common/helpers/app.utils.ts index 75c6433a..5202c7db 100644 --- a/src/common/helpers/app.utils.ts +++ b/src/common/helpers/app.utils.ts @@ -1,4 +1,3 @@ -/* eslint-disable unicorn/no-process-exit */ import type { INestApplication, ValidationPipeOptions } from "@nestjs/common"; import { Logger } from "@nestjs/common"; import type { ConfigService } from "@nestjs/config"; @@ -25,6 +24,7 @@ export const AppUtils = { whitelist: true, transform: true, forbidUnknownValues: false, + validateCustomDecorators: true, enableDebugMessages: HelperService.isDev(), exceptionFactory: i18nValidationErrorFactory, }; diff --git a/src/lib/aws/aws.s3.service.ts b/src/lib/aws/aws.s3.service.ts index d3f4a1b6..571a04be 100644 --- a/src/lib/aws/aws.s3.service.ts +++ b/src/lib/aws/aws.s3.service.ts @@ -16,6 +16,8 @@ import { Inject, Injectable } from "@nestjs/common"; import { lookup } from "mime-types"; import { omit } from "helper-fns"; +import type { Observable } from "rxjs"; +import { from, map, mergeMap } from "rxjs"; import type { AwsS3, AwsS3MultiPart, @@ -24,8 +26,6 @@ import type { import { AwsModuleOptions } from "./aws.interface"; import { MODULE_OPTIONS_TOKEN } from "./aws.module"; -// TODO: convert to observables - @Injectable() export class AwsS3Service { private readonly s3Client: S3Client; @@ -33,8 +33,8 @@ export class AwsS3Service { private readonly baseUrl: string; constructor( - @Inject(MODULE_OPTIONS_TOKEN) - private readonly options: AwsModuleOptions, + @Inject(MODULE_OPTIONS_TOKEN) + private readonly options: AwsModuleOptions, ) { this.s3Client = new S3Client(omit(options, ["bucket", "baseUrl"])); @@ -47,11 +47,8 @@ export class AwsS3Service { * returns them as an array of strings. * @returns An array of strings, which are the names of the buckets. */ - async listBucket(): Promise { - const listBucket = await this.s3Client.send(new ListBucketsCommand({})); - const mapList = listBucket.Buckets.map((value: Bucket) => value.Name); - - return mapList; + listBucket(): Observable { + return from(this.s3Client.send(new ListBucketsCommand({}))).pipe(map(listBucket => listBucket.Buckets.map((value: Bucket) => value.Name))); } /** @@ -62,31 +59,32 @@ export class AwsS3Service { * the specified prefix. If no prefix is provided, all objects in the bucket will be listed. * @returns The function `listItemInBucket` returns an array of objects of type `IAwsS3[]`. */ - async listItemInBucket(prefix?: string): Promise { - const listItems = await this.s3Client.send( + listItemInBucket(prefix?: string): Observable { + return from(this.s3Client.send( new ListObjectsV2Command({ Bucket: this.bucket, Prefix: prefix, }), - ); - - const mapList = listItems.Contents.map((value) => { - const lastIndex = value.Key.lastIndexOf("/"); - const path = value.Key.slice(0, lastIndex); - const filename = value.Key.slice(lastIndex, value.Key.length); - - const mime = this.getMime(filename); - return { - path, - pathWithFilename: value.Key, - filename, - completedUrl: `${this.baseUrl}/${value.Key}`, - baseUrl: this.baseUrl, - mime, - }; - }); - - return mapList; + )).pipe(map((listItems) => { + const mapList = listItems.Contents.map((value) => { + const lastIndex = value.Key.lastIndexOf("/"); + const path = value.Key.slice(0, lastIndex); + const filename = value.Key.slice(lastIndex, value.Key.length); + + const mime = this.getMime(filename); + return { + path, + pathWithFilename: value.Key, + filename, + completedUrl: `${this.baseUrl}/${value.Key}`, + baseUrl: this.baseUrl, + mime, + }; + }); + + return mapList; + }, + )); } /** @@ -99,19 +97,17 @@ export class AwsS3Service { * filename to form the complete key for retrieving the file from the bucket. * @returns the body of the item retrieved from the specified bucket in the AWS S3 storage. */ - async getItemInBucket( + getItemInBucket( filename: string, path?: string, - ): Promise> { + ): Observable> { const key: string = path ? `${path}/${filename}` : filename; - const item = await this.s3Client.send( + return from(this.s3Client.send( new GetObjectCommand({ Bucket: this.bucket, Key: key, }), - ); - - return item.Body; + )).pipe(map(item => item.Body)); } /** @@ -124,8 +120,8 @@ export class AwsS3Service { private generateFileName(originalFilename: string): string { const [name, extension] = originalFilename.split("."); const fileName = `${Date.now()}-${Math.round( - Math.random() * 10_000, - )}-${name}.${extension}`; + Math.random() * 10_000, + )}-${name}.${extension}`; return fileName.replaceAll(" ", "-"); } @@ -158,30 +154,28 @@ export class AwsS3Service { * ContentLanguage, Metadata, and StorageClass. These options allow you to * @returns The function `putItemInBucket` returns an object of type `IAwsS3`. */ - async putItemInBucket( + putItemInBucket( originalFilename: string, content: Uint8Array | Buffer, options?: AwsS3PutItemOptions, - ): Promise { + ): Observable { const filename = options.keepOriginalName ? originalFilename : this.generateFileName(originalFilename); const { key, mime, path } = this.getOptions(options, filename); - await this.s3Client.send( + return from(this.s3Client.send( new PutObjectCommand({ Bucket: this.bucket, Key: key, Body: content, ContentType: mime, }), - ); - - return { + )).pipe(map(_response => ({ path, pathWithFilename: key, filename, completedUrl: `${this.baseUrl}/${key}`, baseUrl: this.baseUrl, mime, - }; + }))); } /** @@ -190,13 +184,13 @@ export class AwsS3Service { * you want to delete from the bucket. * @returns The function `deleteItemInBucket` returns a Promise that resolves to void. */ - async deleteItemInBucket(filename: string): Promise { - await this.s3Client.send( + deleteItemInBucket(filename: string): Observable { + return from(this.s3Client.send( new DeleteObjectCommand({ Bucket: this.bucket, Key: filename, }), - ); + )); } /** @@ -206,19 +200,19 @@ export class AwsS3Service { * @returns The function `deleteItemsInBucket` returns a Promise that resolves to void. */ - async deleteItemsInBucket(filenames: string[]): Promise { + deleteItemsInBucket(filenames: string[]): Observable { const keys = filenames.map(value => ({ Key: value, })); - await this.s3Client.send( + return from(this.s3Client.send( new DeleteObjectsCommand({ Bucket: this.bucket, Delete: { Objects: keys, }, }), - ); + )); } /** @@ -227,31 +221,43 @@ export class AwsS3Service { * of the folder you want to delete from an S3 bucket. * @returns The function `deleteFolder` returns a Promise that resolves to void. */ - async deleteFolder(directory: string): Promise { - const lists = await this.s3Client.send( - new ListObjectsV2Command({ - Bucket: this.bucket, - Prefix: directory, - }), + deleteFolder(directory: string): Observable { + const listObjectsObservable = from( + this.s3Client.send( + new ListObjectsV2Command({ + Bucket: this.bucket, + Prefix: directory, + }), + ), ); - const listItems = lists.Contents.map(value => ({ - Key: value.Key, - })); - - await Promise.all([this.s3Client.send( - new DeleteObjectsCommand({ - Bucket: this.bucket, - Delete: { - Objects: listItems, - }, - }), - ), this.s3Client.send( - new DeleteObjectCommand({ - Bucket: this.bucket, - Key: directory, - }), - )]); + return listObjectsObservable.pipe( + map(lists => + lists.Contents.map(value => ({ + Key: value.Key, + })), + ), + mergeMap(listItems => + from( + Promise.all([ + this.s3Client.send( + new DeleteObjectsCommand({ + Bucket: this.bucket, + Delete: { + Objects: listItems, + }, + }), + ), + this.s3Client.send( + new DeleteObjectCommand({ + Bucket: this.bucket, + Key: directory, + }), + ), + ]), + ), + ), + ); } /** @@ -264,21 +270,20 @@ export class AwsS3Service { * @returns The function `createMultiPart` returns a Promise that resolves to an object of type * `AwsS3MultiPart`. */ - async createMultiPart( + createMultiPart( filename: string, options?: AwsS3PutItemOptions, - ): Promise { + ): Observable { const { key, mime, path, acl } = this.getOptions(options, filename); - const response = await this.s3Client.send( + return from(this.s3Client.send( new CreateMultipartUploadCommand({ Bucket: this.bucket, Key: key, ACL: acl, }), - ); + )).pipe(map(response => ({ - return { uploadId: response.UploadId, path, pathWithFilename: key, @@ -286,7 +291,7 @@ export class AwsS3Service { completedUrl: `${this.baseUrl}/${key}`, baseUrl: this.baseUrl, mime, - }; + }))); } /** @@ -329,13 +334,13 @@ export class AwsS3Service { * contains additional configuration options for the upload. It is of type `IAwsS3PutItemOptions`. * @returns The function `uploadPart` returns a Promise that resolves to void. */ - async uploadPart( + uploadPart( filename: string, content: Buffer, uploadId: string, partNumber: number, options?: AwsS3PutItemOptions, - ): Promise { + ): Observable { let path = options?.path ?? undefined; if (path) @@ -343,7 +348,7 @@ export class AwsS3Service { const key = path ? `${path}/${filename}` : filename; - await this.s3Client.send( + return from(this.s3Client.send( new UploadPartCommand({ Bucket: this.bucket, Key: key, @@ -351,6 +356,6 @@ export class AwsS3Service { PartNumber: partNumber, UploadId: uploadId, }), - ); + )); } } diff --git a/src/lib/rabbit/rabbit.service.ts b/src/lib/rabbit/rabbit.service.ts index fb64ce8e..6dbe050a 100644 --- a/src/lib/rabbit/rabbit.service.ts +++ b/src/lib/rabbit/rabbit.service.ts @@ -8,7 +8,6 @@ import { MailPayload, Queues, RoutingKey } from "@common/@types"; export class RabbitService { private logger = new Logger(RabbitService.name); - constructor(private readonly mailService: MailerService) {} @RabbitSubscribe({ diff --git a/src/main.ts b/src/main.ts index b254139d..9d0596a4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -72,8 +72,7 @@ async function bootstrap() { app.useGlobalInterceptors(new LoggerErrorInterceptor()); - - + // ========================================================= // configure socket // =========================================================