From 88d778d5a0fc16b5a19659707f319d6db4b58a82 Mon Sep 17 00:00:00 2001 From: Matthew Heroux Date: Mon, 4 Dec 2023 07:20:57 -0600 Subject: [PATCH] Feature/populate UUID (#735) Signed-off-by: hxtree --- ...eature-populate-uuid_2023-12-04-12-20.json | 10 + common/config/rush/pnpm-lock.yaml | 622 +++++------------- common/config/rush/repo-state.json | 2 +- libraries/faker-factory/package.json | 2 +- libraries/faker-factory/src/pojo.ts | 2 +- libraries/messaging-schemas/package.json | 2 +- libraries/nestjs-modules/package.json | 5 +- .../src/__tests__/books/book.repository.ts | 55 +- .../src/__tests__/books/book.schema.ts | 10 +- .../src/__tests__/persons/person.schema.ts | 17 +- .../__tests__/persons/student.repository.ts | 15 + .../src/__tests__/persons/student.schema.ts | 28 + .../src/mongoose/base.entity.ts | 4 +- .../src/mongoose/base.repository.test.ts | 103 ++- .../src/mongoose/base.repository.ts | 46 +- .../src/mongoose/mongoose.module.test.ts | 18 +- libraries/promare-gradients/package.json | 2 +- libraries/pseudo-random/package.json | 2 +- libraries/validation-schemas/package.json | 2 +- platform/api-gateway/package.json | 4 +- .../cli-tools/create-artifact/package.json | 2 +- platform/cli-tools/create-bundle/package.json | 2 +- platform/cli-tools/rush-coverage/package.json | 2 +- platform/constructs/package.json | 4 +- platform/lambda-layers/package.json | 4 +- platform/message-bus/package.json | 4 +- platform/pipeline/package.json | 2 +- services/authentication-service/package.json | 4 +- services/billing-system/package.json | 2 +- services/character-sheet/openapi-spec.json | 16 +- services/character-sheet/package.json | 4 +- .../src/models/character-sheet.schema.ts | 14 +- .../affiliation/affiliation.e2e-spec.ts | 10 +- .../character-sheet.controller.ts | 9 +- .../character-sheet.e2e-spec.ts | 13 +- .../create-character-sheet-dto.ts | 7 - .../src/modules/npc/npc.controller.ts | 3 +- services/design-system/package.json | 2 +- services/dialogue-service/package.json | 2 +- services/email-service/package.json | 4 +- services/graphql/package.json | 2 +- services/html-to-pdf/package.json | 2 +- services/instances/package.json | 4 +- .../src/module/instances/create.dto.ts | 2 +- services/jukebox/package.json | 2 +- services/luck-by-dice/package.json | 2 +- .../player-achievements/openapi-spec.json | 6 +- services/player-achievements/package.json | 4 +- .../src/models/achievement.schema.ts | 5 +- .../src/models/player-achievement.schema.ts | 11 +- .../module/player-achievements/create.dto.ts | 6 +- .../player-achievements.controller.ts | 2 +- .../player-achievements.e2e-spec.ts | 8 +- services/weather-control/package.json | 2 +- 54 files changed, 475 insertions(+), 644 deletions(-) create mode 100644 common/changes/@cats-cradle/eslint-config/feature-populate-uuid_2023-12-04-12-20.json create mode 100644 libraries/nestjs-modules/src/__tests__/persons/student.repository.ts create mode 100644 libraries/nestjs-modules/src/__tests__/persons/student.schema.ts diff --git a/common/changes/@cats-cradle/eslint-config/feature-populate-uuid_2023-12-04-12-20.json b/common/changes/@cats-cradle/eslint-config/feature-populate-uuid_2023-12-04-12-20.json new file mode 100644 index 00000000..c67973a5 --- /dev/null +++ b/common/changes/@cats-cradle/eslint-config/feature-populate-uuid_2023-12-04-12-20.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@cats-cradle/eslint-config", + "comment": "turn off null assert", + "type": "patch" + } + ], + "packageName": "@cats-cradle/eslint-config" +} \ No newline at end of file diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 52733980..5953e1a6 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -105,8 +105,8 @@ importers: version: 9.0.1 devDependencies: '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/jest': specifier: 29.5.8 version: 29.5.8 @@ -166,8 +166,8 @@ importers: version: 9.0.1 devDependencies: '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/jest': specifier: 29.5.8 version: 29.5.8 @@ -227,7 +227,7 @@ importers: version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/platform-express@9.3.9)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@nestjs/mongoose': specifier: 9.2.1 - version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.9.1)(reflect-metadata@0.1.13)(rxjs@7.8.1) + version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.11.3)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@nestjs/passport': specifier: 9.0.0 version: 9.0.0(@nestjs/common@9.4.0)(passport@0.6.0) @@ -262,8 +262,8 @@ importers: specifier: 8.13.0 version: 8.13.0 mongoose: - specifier: 6.9.1 - version: 6.9.1 + specifier: 6.11.3 + version: 6.11.3 reflect-metadata: specifier: 0.1.13 version: 0.1.13 @@ -273,9 +273,6 @@ importers: rxjs: specifier: 7.8.1 version: 7.8.1 - ts-mongoose-pagination: - specifier: ~1.1.2 - version: 1.1.2(@types/mongoose@5.11.97)(mongoose@6.9.1) uuid: specifier: ~9.0.1 version: 9.0.1 @@ -284,8 +281,8 @@ importers: specifier: 3.433.0 version: 3.433.0 '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@cats-cradle/faker-factory': specifier: workspace:* version: link:../faker-factory @@ -338,8 +335,8 @@ importers: ../../libraries/promare-gradients: dependencies: '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 clean-css-cli: specifier: ^5.5.0 version: 5.5.0 @@ -364,8 +361,8 @@ importers: version: link:../../platform/rigs/base-nodejs devDependencies: '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/jest': specifier: 29.5.8 version: 29.5.8 @@ -425,8 +422,8 @@ importers: version: 9.0.1 devDependencies: '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/jest': specifier: 29.5.8 version: 29.5.8 @@ -506,8 +503,8 @@ importers: specifier: 4.18.2 version: 4.18.2 mongoose: - specifier: 6.9.1 - version: 6.9.1 + specifier: 6.11.3 + version: 6.11.3 node-cache: specifier: 5.1.2 version: 5.1.2 @@ -534,8 +531,8 @@ importers: specifier: 2.0.0 version: 2.0.0(@yarnpkg/core@4.0.0-rc.51)(typanion@3.14.0) '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/aws-lambda': specifier: ~8.10.123 version: 8.10.123 @@ -601,8 +598,8 @@ importers: specifier: workspace:* version: link:../../rigs/base-nodejs '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@pnpm/types': specifier: ^8.5.0 version: 8.5.0 @@ -653,8 +650,8 @@ importers: version: 0.17.5 devDependencies: '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/jest': specifier: 29.5.8 version: 29.5.8 @@ -699,8 +696,8 @@ importers: version: 3.1.5 devDependencies: '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/jest': specifier: 29.5.8 version: 29.5.8 @@ -765,8 +762,8 @@ importers: specifier: ~4.17.21 version: 4.17.21 mongoose: - specifier: 6.9.1 - version: 6.9.1 + specifier: 6.11.3 + version: 6.11.3 node-cache: specifier: 5.1.2 version: 5.1.2 @@ -787,8 +784,8 @@ importers: specifier: workspace:* version: link:../rigs/base-nodejs '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/aws-lambda': specifier: ~8.10.123 version: 8.10.123 @@ -871,8 +868,8 @@ importers: specifier: 4.18.2 version: 4.18.2 mongoose: - specifier: 6.9.1 - version: 6.9.1 + specifier: 6.11.3 + version: 6.11.3 node-cache: specifier: 5.1.2 version: 5.1.2 @@ -893,8 +890,8 @@ importers: specifier: workspace:* version: link:../rigs/base-nodejs '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/aws-lambda': specifier: ~8.10.123 version: 8.10.123 @@ -992,8 +989,8 @@ importers: specifier: 4.18.2 version: 4.18.2 mongoose: - specifier: 6.9.1 - version: 6.9.1 + specifier: 6.11.3 + version: 6.11.3 node-cache: specifier: 5.1.2 version: 5.1.2 @@ -1020,8 +1017,8 @@ importers: specifier: 2.0.0 version: 2.0.0(@yarnpkg/core@4.0.0-rc.51)(typanion@3.14.0) '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/aws-lambda': specifier: ~8.10.123 version: 8.10.123 @@ -1084,8 +1081,8 @@ importers: version: 8.52.0 devDependencies: '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/aws-lambda': specifier: ~8.10.123 version: 8.10.123 @@ -1294,7 +1291,7 @@ importers: version: 10.1.1(@nestjs/common@9.4.0) '@nestjs/mongoose': specifier: 9.2.1 - version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.9.1)(reflect-metadata@0.1.13)(rxjs@7.8.1) + version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.11.3)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@nestjs/passport': specifier: 9.0.0 version: 9.0.0(@nestjs/common@9.4.0)(passport@0.6.0) @@ -1332,8 +1329,8 @@ importers: specifier: 4.18.2 version: 4.18.2 mongoose: - specifier: 6.9.1 - version: 6.9.1 + specifier: 6.11.3 + version: 6.11.3 node-cache: specifier: 5.1.2 version: 5.1.2 @@ -1363,8 +1360,8 @@ importers: specifier: 1.0.7 version: 1.0.7(@babel/core@7.22.20)(@types/node@20.9.0)(ts-node@10.9.1)(typescript@5.1.3) '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@cats-cradle/faker-factory': specifier: workspace:* version: link:../../libraries/faker-factory @@ -1502,8 +1499,8 @@ importers: specifier: 1.0.7 version: 1.0.7(@babel/core@7.22.20)(@types/node@20.9.0)(ts-node@10.9.1)(typescript@5.1.3) '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/aws-lambda': specifier: ~8.10.123 version: 8.10.123 @@ -1581,7 +1578,7 @@ importers: version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/platform-express@9.3.9)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@nestjs/mongoose': specifier: 9.2.1 - version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.9.1)(reflect-metadata@0.1.13)(rxjs@7.8.1) + version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.11.3)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@nestjs/platform-express': specifier: 9.3.9 version: 9.3.9(@nestjs/common@9.4.0)(@nestjs/core@9.2.1) @@ -1629,8 +1626,8 @@ importers: specifier: 1.0.7 version: 1.0.7(@babel/core@7.22.20)(@types/node@20.9.0)(ts-node@10.9.1)(typescript@5.1.3) '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@cats-cradle/faker-factory': specifier: workspace:* version: link:../../libraries/faker-factory @@ -1683,8 +1680,8 @@ importers: specifier: 8.13.0 version: 8.13.0 mongoose: - specifier: 6.9.1 - version: 6.9.1 + specifier: 6.11.3 + version: 6.11.3 path: specifier: ~0.12.7 version: 0.12.7 @@ -1704,8 +1701,8 @@ importers: ../../services/design-system: dependencies: '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@emotion/react': specifier: ~11.11.1 version: 11.11.1(@types/react@18.2.37)(react@18.2.0) @@ -1883,8 +1880,8 @@ importers: version: link:../../platform/rigs/base-nodejs devDependencies: '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 eslint: specifier: 8.52.0 version: 8.52.0 @@ -1920,7 +1917,7 @@ importers: version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/platform-express@9.3.9)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@nestjs/mongoose': specifier: 9.2.1 - version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.9.1)(reflect-metadata@0.1.13)(rxjs@7.8.1) + version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.11.3)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@nestjs/platform-express': specifier: 9.3.9 version: 9.3.9(@nestjs/common@9.4.0)(@nestjs/core@9.2.1) @@ -1958,8 +1955,8 @@ importers: specifier: ~4.17.21 version: 4.17.21 mongoose: - specifier: 6.9.1 - version: 6.9.1 + specifier: 6.11.3 + version: 6.11.3 node-cache: specifier: 5.1.2 version: 5.1.2 @@ -1983,8 +1980,8 @@ importers: specifier: 1.0.7 version: 1.0.7(@babel/core@7.22.20)(@types/node@20.9.0)(ts-node@10.9.1)(typescript@5.1.3) '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@cats-cradle/faker-factory': specifier: workspace:* version: link:../../libraries/faker-factory @@ -2128,8 +2125,8 @@ importers: specifier: 1.0.7 version: 1.0.7(@babel/core@7.22.20)(@types/node@20.9.0)(ts-node@10.9.1)(typescript@5.1.3) '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/aws-lambda': specifier: ~8.10.123 version: 8.10.123 @@ -2270,8 +2267,8 @@ importers: specifier: 1.0.7 version: 1.0.7(@babel/core@7.22.20)(@types/node@20.9.0)(ts-node@10.9.1)(typescript@5.1.3) '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/aws-lambda': specifier: ~8.10.123 version: 8.10.123 @@ -2352,7 +2349,7 @@ importers: version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/platform-express@9.3.9)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@nestjs/mongoose': specifier: 9.2.1 - version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.9.1)(reflect-metadata@0.1.13)(rxjs@7.8.1) + version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.11.3)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@nestjs/platform-express': specifier: 9.3.9 version: 9.3.9(@nestjs/common@9.4.0)(@nestjs/core@9.2.1) @@ -2381,8 +2378,8 @@ importers: specifier: 4.18.2 version: 4.18.2 mongoose: - specifier: 6.9.1 - version: 6.9.1 + specifier: 6.11.3 + version: 6.11.3 node-cache: specifier: 5.1.2 version: 5.1.2 @@ -2400,8 +2397,8 @@ importers: version: 9.0.1 devDependencies: '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@cats-cradle/faker-factory': specifier: workspace:* version: link:../../libraries/faker-factory @@ -2542,8 +2539,8 @@ importers: specifier: 1.0.7 version: 1.0.7(@babel/core@7.22.20)(@types/node@20.9.0)(ts-node@10.9.1)(typescript@5.1.3) '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@cats-cradle/faker-factory': specifier: workspace:* version: link:../../libraries/faker-factory @@ -2681,8 +2678,8 @@ importers: specifier: 1.0.7 version: 1.0.7(@babel/core@7.22.20)(@types/node@20.9.0)(ts-node@10.9.1)(typescript@5.1.3) '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@types/aws-lambda': specifier: ~8.10.123 version: 8.10.123 @@ -2763,7 +2760,7 @@ importers: version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/platform-express@9.3.9)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@nestjs/mongoose': specifier: 9.2.1 - version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.9.1)(reflect-metadata@0.1.13)(rxjs@7.8.1) + version: 9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.11.3)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@nestjs/platform-express': specifier: 9.3.9 version: 9.3.9(@nestjs/common@9.4.0)(@nestjs/core@9.2.1) @@ -2804,8 +2801,8 @@ importers: specifier: 6.0.0 version: 6.0.0 mongoose: - specifier: 6.9.1 - version: 6.9.1 + specifier: 6.11.3 + version: 6.11.3 node-cache: specifier: 5.1.2 version: 5.1.2 @@ -2823,8 +2820,8 @@ importers: version: 9.0.1 devDependencies: '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@cats-cradle/faker-factory': specifier: workspace:* version: link:../../libraries/faker-factory @@ -2962,8 +2959,8 @@ importers: version: 9.0.1 devDependencies: '@cats-cradle/eslint-config': - specifier: 1.0.7 - version: 1.0.7 + specifier: 1.0.8 + version: 1.0.8 '@cats-cradle/faker-factory': specifier: workspace:* version: link:../../libraries/faker-factory @@ -3247,28 +3244,28 @@ packages: '@aws-sdk/util-endpoints': 3.413.0 '@aws-sdk/util-user-agent-browser': 3.413.0 '@aws-sdk/util-user-agent-node': 3.413.0 - '@smithy/config-resolver': 2.0.10 - '@smithy/fetch-http-handler': 2.1.5 - '@smithy/hash-node': 2.0.9 - '@smithy/invalid-dependency': 2.0.9 - '@smithy/middleware-content-length': 2.0.11 - '@smithy/middleware-endpoint': 2.0.9 - '@smithy/middleware-retry': 2.0.12 - '@smithy/middleware-serde': 2.0.9 - '@smithy/middleware-stack': 2.0.2 - '@smithy/node-config-provider': 2.0.12 - '@smithy/node-http-handler': 2.1.5 - '@smithy/protocol-http': 3.0.5 - '@smithy/smithy-client': 2.1.6 + '@smithy/config-resolver': 2.0.18 + '@smithy/fetch-http-handler': 2.2.6 + '@smithy/hash-node': 2.0.15 + '@smithy/invalid-dependency': 2.0.13 + '@smithy/middleware-content-length': 2.0.15 + '@smithy/middleware-endpoint': 2.2.0 + '@smithy/middleware-retry': 2.0.20 + '@smithy/middleware-serde': 2.0.13 + '@smithy/middleware-stack': 2.0.7 + '@smithy/node-config-provider': 2.1.5 + '@smithy/node-http-handler': 2.1.9 + '@smithy/protocol-http': 3.0.9 + '@smithy/smithy-client': 2.1.15 '@smithy/types': 2.5.0 - '@smithy/url-parser': 2.0.9 - '@smithy/util-base64': 2.0.0 + '@smithy/url-parser': 2.0.13 + '@smithy/util-base64': 2.0.1 '@smithy/util-body-length-browser': 2.0.0 '@smithy/util-body-length-node': 2.1.0 - '@smithy/util-defaults-mode-browser': 2.0.10 - '@smithy/util-defaults-mode-node': 2.0.12 - '@smithy/util-retry': 2.0.2 - '@smithy/util-utf8': 2.0.0 + '@smithy/util-defaults-mode-browser': 2.0.19 + '@smithy/util-defaults-mode-node': 2.0.25 + '@smithy/util-retry': 2.0.6 + '@smithy/util-utf8': 2.0.2 tslib: 2.6.2 transitivePeerDependencies: - aws-crt @@ -3523,28 +3520,28 @@ packages: '@aws-sdk/util-endpoints': 3.413.0 '@aws-sdk/util-user-agent-browser': 3.413.0 '@aws-sdk/util-user-agent-node': 3.413.0 - '@smithy/config-resolver': 2.0.10 - '@smithy/fetch-http-handler': 2.1.5 - '@smithy/hash-node': 2.0.9 - '@smithy/invalid-dependency': 2.0.9 - '@smithy/middleware-content-length': 2.0.11 - '@smithy/middleware-endpoint': 2.0.9 - '@smithy/middleware-retry': 2.0.12 - '@smithy/middleware-serde': 2.0.9 - '@smithy/middleware-stack': 2.0.2 - '@smithy/node-config-provider': 2.0.12 - '@smithy/node-http-handler': 2.1.5 - '@smithy/protocol-http': 3.0.5 - '@smithy/smithy-client': 2.1.6 + '@smithy/config-resolver': 2.0.18 + '@smithy/fetch-http-handler': 2.2.6 + '@smithy/hash-node': 2.0.15 + '@smithy/invalid-dependency': 2.0.13 + '@smithy/middleware-content-length': 2.0.15 + '@smithy/middleware-endpoint': 2.2.0 + '@smithy/middleware-retry': 2.0.20 + '@smithy/middleware-serde': 2.0.13 + '@smithy/middleware-stack': 2.0.7 + '@smithy/node-config-provider': 2.1.5 + '@smithy/node-http-handler': 2.1.9 + '@smithy/protocol-http': 3.0.9 + '@smithy/smithy-client': 2.1.15 '@smithy/types': 2.5.0 - '@smithy/url-parser': 2.0.9 - '@smithy/util-base64': 2.0.0 + '@smithy/url-parser': 2.0.13 + '@smithy/util-base64': 2.0.1 '@smithy/util-body-length-browser': 2.0.0 '@smithy/util-body-length-node': 2.1.0 - '@smithy/util-defaults-mode-browser': 2.0.10 - '@smithy/util-defaults-mode-node': 2.0.12 - '@smithy/util-retry': 2.0.2 - '@smithy/util-utf8': 2.0.0 + '@smithy/util-defaults-mode-browser': 2.0.19 + '@smithy/util-defaults-mode-node': 2.0.25 + '@smithy/util-retry': 2.0.6 + '@smithy/util-utf8': 2.0.2 tslib: 2.6.2 transitivePeerDependencies: - aws-crt @@ -3580,13 +3577,13 @@ packages: '@smithy/smithy-client': 2.1.15 '@smithy/types': 2.5.0 '@smithy/url-parser': 2.0.13 - '@smithy/util-base64': 2.0.0 + '@smithy/util-base64': 2.0.1 '@smithy/util-body-length-browser': 2.0.0 '@smithy/util-body-length-node': 2.1.0 '@smithy/util-defaults-mode-browser': 2.0.19 '@smithy/util-defaults-mode-node': 2.0.25 '@smithy/util-retry': 2.0.6 - '@smithy/util-utf8': 2.0.0 + '@smithy/util-utf8': 2.0.2 tslib: 2.6.2 transitivePeerDependencies: - aws-crt @@ -3654,28 +3651,28 @@ packages: '@aws-sdk/util-endpoints': 3.413.0 '@aws-sdk/util-user-agent-browser': 3.413.0 '@aws-sdk/util-user-agent-node': 3.413.0 - '@smithy/config-resolver': 2.0.10 - '@smithy/fetch-http-handler': 2.1.5 - '@smithy/hash-node': 2.0.9 - '@smithy/invalid-dependency': 2.0.9 - '@smithy/middleware-content-length': 2.0.11 - '@smithy/middleware-endpoint': 2.0.9 - '@smithy/middleware-retry': 2.0.12 - '@smithy/middleware-serde': 2.0.9 - '@smithy/middleware-stack': 2.0.2 - '@smithy/node-config-provider': 2.0.12 - '@smithy/node-http-handler': 2.1.5 - '@smithy/protocol-http': 3.0.5 - '@smithy/smithy-client': 2.1.6 + '@smithy/config-resolver': 2.0.18 + '@smithy/fetch-http-handler': 2.2.6 + '@smithy/hash-node': 2.0.15 + '@smithy/invalid-dependency': 2.0.13 + '@smithy/middleware-content-length': 2.0.15 + '@smithy/middleware-endpoint': 2.2.0 + '@smithy/middleware-retry': 2.0.20 + '@smithy/middleware-serde': 2.0.13 + '@smithy/middleware-stack': 2.0.7 + '@smithy/node-config-provider': 2.1.5 + '@smithy/node-http-handler': 2.1.9 + '@smithy/protocol-http': 3.0.9 + '@smithy/smithy-client': 2.1.15 '@smithy/types': 2.5.0 - '@smithy/url-parser': 2.0.9 - '@smithy/util-base64': 2.0.0 + '@smithy/url-parser': 2.0.13 + '@smithy/util-base64': 2.0.1 '@smithy/util-body-length-browser': 2.0.0 '@smithy/util-body-length-node': 2.1.0 - '@smithy/util-defaults-mode-browser': 2.0.10 - '@smithy/util-defaults-mode-node': 2.0.12 - '@smithy/util-retry': 2.0.2 - '@smithy/util-utf8': 2.0.0 + '@smithy/util-defaults-mode-browser': 2.0.19 + '@smithy/util-defaults-mode-node': 2.0.25 + '@smithy/util-retry': 2.0.6 + '@smithy/util-utf8': 2.0.2 fast-xml-parser: 4.2.5 tslib: 2.6.2 transitivePeerDependencies: @@ -3776,7 +3773,7 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/types': 3.433.0 - '@smithy/property-provider': 2.0.10 + '@smithy/property-provider': 2.0.14 '@smithy/types': 2.5.0 tslib: 2.6.2 dev: false @@ -3820,7 +3817,7 @@ packages: '@aws-sdk/types': 3.413.0 '@smithy/credential-provider-imds': 2.1.1 '@smithy/property-provider': 2.0.14 - '@smithy/shared-ini-file-loader': 2.0.11 + '@smithy/shared-ini-file-loader': 2.2.4 '@smithy/types': 2.5.0 tslib: 2.6.2 transitivePeerDependencies: @@ -3836,9 +3833,9 @@ packages: '@aws-sdk/credential-provider-sso': 3.433.0 '@aws-sdk/credential-provider-web-identity': 3.433.0 '@aws-sdk/types': 3.433.0 - '@smithy/credential-provider-imds': 2.0.12 - '@smithy/property-provider': 2.0.10 - '@smithy/shared-ini-file-loader': 2.0.11 + '@smithy/credential-provider-imds': 2.1.1 + '@smithy/property-provider': 2.0.14 + '@smithy/shared-ini-file-loader': 2.2.4 '@smithy/types': 2.5.0 tslib: 2.6.2 transitivePeerDependencies: @@ -3875,7 +3872,7 @@ packages: '@aws-sdk/types': 3.413.0 '@smithy/credential-provider-imds': 2.1.1 '@smithy/property-provider': 2.0.14 - '@smithy/shared-ini-file-loader': 2.0.11 + '@smithy/shared-ini-file-loader': 2.2.4 '@smithy/types': 2.5.0 tslib: 2.6.2 transitivePeerDependencies: @@ -3892,8 +3889,8 @@ packages: '@aws-sdk/credential-provider-sso': 3.433.0 '@aws-sdk/credential-provider-web-identity': 3.433.0 '@aws-sdk/types': 3.433.0 - '@smithy/credential-provider-imds': 2.0.12 - '@smithy/property-provider': 2.0.10 + '@smithy/credential-provider-imds': 2.1.1 + '@smithy/property-provider': 2.0.14 '@smithy/shared-ini-file-loader': 2.0.11 '@smithy/types': 2.5.0 tslib: 2.6.2 @@ -3917,7 +3914,7 @@ packages: dependencies: '@aws-sdk/types': 3.413.0 '@smithy/property-provider': 2.0.14 - '@smithy/shared-ini-file-loader': 2.0.11 + '@smithy/shared-ini-file-loader': 2.2.4 '@smithy/types': 2.5.0 tslib: 2.6.2 optional: true @@ -3927,8 +3924,8 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/types': 3.433.0 - '@smithy/property-provider': 2.0.10 - '@smithy/shared-ini-file-loader': 2.0.11 + '@smithy/property-provider': 2.0.14 + '@smithy/shared-ini-file-loader': 2.2.4 '@smithy/types': 2.5.0 tslib: 2.6.2 dev: false @@ -3955,7 +3952,7 @@ packages: '@aws-sdk/token-providers': 3.413.0 '@aws-sdk/types': 3.413.0 '@smithy/property-provider': 2.0.14 - '@smithy/shared-ini-file-loader': 2.0.11 + '@smithy/shared-ini-file-loader': 2.2.4 '@smithy/types': 2.5.0 tslib: 2.6.2 transitivePeerDependencies: @@ -3969,8 +3966,8 @@ packages: '@aws-sdk/client-sso': 3.433.0 '@aws-sdk/token-providers': 3.433.0 '@aws-sdk/types': 3.433.0 - '@smithy/property-provider': 2.0.10 - '@smithy/shared-ini-file-loader': 2.0.11 + '@smithy/property-provider': 2.0.14 + '@smithy/shared-ini-file-loader': 2.2.4 '@smithy/types': 2.5.0 tslib: 2.6.2 transitivePeerDependencies: @@ -4001,7 +3998,7 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/types': 3.433.0 - '@smithy/property-provider': 2.0.10 + '@smithy/property-provider': 2.0.14 '@smithy/types': 2.5.0 tslib: 2.6.2 dev: false @@ -4022,9 +4019,9 @@ packages: '@aws-sdk/credential-provider-sso': 3.414.0 '@aws-sdk/credential-provider-web-identity': 3.413.0 '@aws-sdk/types': 3.413.0 - '@smithy/credential-provider-imds': 2.0.12 - '@smithy/property-provider': 2.0.10 - '@smithy/types': 2.3.3 + '@smithy/credential-provider-imds': 2.1.1 + '@smithy/property-provider': 2.0.14 + '@smithy/types': 2.5.0 tslib: 2.6.2 transitivePeerDependencies: - aws-crt @@ -4303,7 +4300,7 @@ packages: '@smithy/protocol-http': 3.0.9 '@smithy/signature-v4': 2.0.9 '@smithy/types': 2.5.0 - '@smithy/util-middleware': 2.0.2 + '@smithy/util-middleware': 2.0.6 tslib: 2.6.2 optional: true @@ -4312,7 +4309,7 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/types': 3.433.0 - '@smithy/property-provider': 2.0.10 + '@smithy/property-provider': 2.0.14 '@smithy/protocol-http': 3.0.9 '@smithy/signature-v4': 2.0.9 '@smithy/types': 2.5.0 @@ -4428,7 +4425,7 @@ packages: '@smithy/node-config-provider': 2.1.5 '@smithy/types': 2.5.0 '@smithy/util-config-provider': 2.0.0 - '@smithy/util-middleware': 2.0.2 + '@smithy/util-middleware': 2.0.6 tslib: 2.6.2 optional: true @@ -4572,17 +4569,17 @@ packages: '@smithy/node-http-handler': 2.1.9 '@smithy/property-provider': 2.0.14 '@smithy/protocol-http': 3.0.9 - '@smithy/shared-ini-file-loader': 2.0.11 + '@smithy/shared-ini-file-loader': 2.2.4 '@smithy/smithy-client': 2.1.15 '@smithy/types': 2.5.0 '@smithy/url-parser': 2.0.13 - '@smithy/util-base64': 2.0.0 + '@smithy/util-base64': 2.0.1 '@smithy/util-body-length-browser': 2.0.0 '@smithy/util-body-length-node': 2.1.0 '@smithy/util-defaults-mode-browser': 2.0.19 '@smithy/util-defaults-mode-node': 2.0.25 '@smithy/util-retry': 2.0.6 - '@smithy/util-utf8': 2.0.0 + '@smithy/util-utf8': 2.0.2 tslib: 2.6.2 transitivePeerDependencies: - aws-crt @@ -7498,8 +7495,8 @@ packages: - ts-node - typescript - /@cats-cradle/eslint-config@1.0.7: - resolution: {integrity: sha512-rBf5EbJjQwWwm8fG5sMyggwhZ/i14s9k+xYi4OUwaqlmeYfkZMv0YUAW9bAYcyNHMVcVUo1/o3dU6/QcYDUeyQ==} + /@cats-cradle/eslint-config@1.0.8: + resolution: {integrity: sha512-B/K6ssnAdEhP7ZYcvUpmAruKLRVx79ecHrKsL57RsAcqu+ZpO21uwEXz8hEdIu65m5+jaua/0uJ77t3YETp5cw==} dependencies: '@rushstack/eslint-config': 3.2.0(eslint@8.52.0)(typescript@5.1.3) '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.52.0)(typescript@5.1.3) @@ -9577,7 +9574,7 @@ packages: reflect-metadata: 0.1.13 dev: false - /@nestjs/mongoose@9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.9.1)(reflect-metadata@0.1.13)(rxjs@7.8.1): + /@nestjs/mongoose@9.2.1(@nestjs/common@9.4.0)(@nestjs/core@9.2.1)(mongoose@6.11.3)(reflect-metadata@0.1.13)(rxjs@7.8.1): resolution: {integrity: sha512-tMK5kKFjQnNVhqJDw1wa352z+VsODOFznTn74xSzrziof03qS+O6rLU4q1kMx0B4AmFbADf03GOdpvBc9bMWqw==} peerDependencies: '@nestjs/common': ^8.0.0 || ^9.0.0 @@ -9588,7 +9585,7 @@ packages: dependencies: '@nestjs/common': 9.4.0(class-transformer@0.5.1)(class-validator@0.13.2)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@nestjs/core': 9.2.1(@nestjs/common@9.4.0)(@nestjs/platform-express@9.3.9)(reflect-metadata@0.1.13)(rxjs@7.8.1) - mongoose: 6.9.1 + mongoose: 6.11.3 reflect-metadata: 0.1.13 rxjs: 7.8.1 dev: false @@ -12446,14 +12443,6 @@ packages: '@smithy/types': 2.5.0 tslib: 2.6.2 - /@smithy/abort-controller@2.0.9: - resolution: {integrity: sha512-8liHOEbx99xcy4VndeQNQhyA0LS+e7UqsuRnDTSIA26IKBv/7vA9w09KOd4fgNULrvX0r3WpA6cwsQTRJpSWkg==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 2.5.0 - tslib: 2.6.2 - optional: true - /@smithy/chunked-blob-reader-native@2.0.1: resolution: {integrity: sha512-N2oCZRglhWKm7iMBu7S6wDzXirjAofi7tAd26cxmgibRYOBS4D3hGfmkwCpHdASZzwZDD8rluh0Rcqw1JeZDRw==} dependencies: @@ -12467,17 +12456,6 @@ packages: tslib: 2.6.2 dev: false - /@smithy/config-resolver@2.0.10: - resolution: {integrity: sha512-MwToDsCltHjumkCuRn883qoNeJUawc2b8sX9caSn5vLz6J5crU1IklklNxWCaMO2z2nDL91Po4b/aI1eHv5PfA==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/node-config-provider': 2.1.5 - '@smithy/types': 2.5.0 - '@smithy/util-config-provider': 2.0.0 - '@smithy/util-middleware': 2.0.2 - tslib: 2.6.2 - optional: true - /@smithy/config-resolver@2.0.18: resolution: {integrity: sha512-761sJSgNbvsqcsKW6/WZbrZr4H+0Vp/QKKqwyrxCPwD8BsiPEXNHyYnqNgaeK9xRWYswjon0Uxbpe3DWQo0j/g==} engines: {node: '>=14.0.0'} @@ -12488,16 +12466,6 @@ packages: '@smithy/util-middleware': 2.0.6 tslib: 2.6.2 - /@smithy/credential-provider-imds@2.0.12: - resolution: {integrity: sha512-S3lUNe+2fEFwKcmiQniXGPXt69vaHvQCw8kYQOBL4OvJsgwfpkIYDZdroHbTshYi0M6WaKL26Mw+hvgma6dZqA==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/node-config-provider': 2.1.5 - '@smithy/property-provider': 2.0.14 - '@smithy/types': 2.5.0 - '@smithy/url-parser': 2.0.13 - tslib: 2.6.2 - /@smithy/credential-provider-imds@2.1.1: resolution: {integrity: sha512-gw5G3FjWC6sNz8zpOJgPpH5HGKrpoVFQpToNAwLwJVyI/LJ2jDJRjSKEsM6XI25aRpYjMSE/Qptxx305gN1vHw==} engines: {node: '>=14.0.0'} @@ -12515,15 +12483,6 @@ packages: '@smithy/types': 2.5.0 '@smithy/util-hex-encoding': 2.0.0 tslib: 2.6.2 - dev: false - - /@smithy/eventstream-codec@2.0.9: - resolution: {integrity: sha512-sy0pcbKnawt1iu+qCoSFbs/h9PAaUgvlJEO3lqkE1HFFj4p5RgL98vH+9CyDoj6YY82cG5XsorFmcLqQJHTOYw==} - dependencies: - '@aws-crypto/crc32': 3.0.0 - '@smithy/types': 2.5.0 - '@smithy/util-hex-encoding': 2.0.0 - tslib: 2.6.2 /@smithy/eventstream-serde-browser@2.0.13: resolution: {integrity: sha512-OJ/2g/VxkzA+mYZxV102oX3CsiE+igTSmqq/ir3oEVG2kSIdRC00ryttj/lmL14W06ExNi0ysmfLxQkL8XrAZQ==} @@ -12560,16 +12519,6 @@ packages: tslib: 2.6.2 dev: false - /@smithy/fetch-http-handler@2.1.5: - resolution: {integrity: sha512-BIeCHGfr5JCGN+EMTwZK74ELvjPXOIrI7OLM5OhZJJ6AmZyRv2S9ANJk18AtLwht0TsSm+8WoXIEp8LuxNgUyA==} - dependencies: - '@smithy/protocol-http': 3.0.9 - '@smithy/querystring-builder': 2.0.9 - '@smithy/types': 2.5.0 - '@smithy/util-base64': 2.0.1 - tslib: 2.6.2 - optional: true - /@smithy/fetch-http-handler@2.2.6: resolution: {integrity: sha512-PStY3XO1Ksjwn3wMKye5U6m6zxXpXrXZYqLy/IeCbh3nM9QB3Jgw/B0PUSLUWKdXg4U8qgEu300e3ZoBvZLsDg==} dependencies: @@ -12597,16 +12546,6 @@ packages: '@smithy/util-utf8': 2.0.2 tslib: 2.6.2 - /@smithy/hash-node@2.0.9: - resolution: {integrity: sha512-XP3yWd5wyCtiVmsY5Nuq/FUwyCEQ6YG7DsvRh7ThldNukGpCzyFdP8eivZJVjn4Fx7oYrrOnVoYZ0WEgpW1AvQ==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 2.5.0 - '@smithy/util-buffer-from': 2.0.0 - '@smithy/util-utf8': 2.0.2 - tslib: 2.6.2 - optional: true - /@smithy/hash-stream-node@2.0.15: resolution: {integrity: sha512-ZZ6kC/pHt5Dc2goXIIyC8uA7A4GUMSzdCynAabnZ3CSSaV6ctP8mlvVkqjPph0O3XzHlx/80gdLrNqi1GDPUsA==} engines: {node: '>=14.0.0'} @@ -12622,13 +12561,6 @@ packages: '@smithy/types': 2.5.0 tslib: 2.6.2 - /@smithy/invalid-dependency@2.0.9: - resolution: {integrity: sha512-RuJqhYf8nViK96IIO9JbTtjDUuFItVfuuJhWw2yk7fv67yltQ7fZD6IQ2OsHHluoVmstnQJuCg5raXJR696Ubw==} - dependencies: - '@smithy/types': 2.5.0 - tslib: 2.6.2 - optional: true - /@smithy/is-array-buffer@2.0.0: resolution: {integrity: sha512-z3PjFjMyZNI98JFRJi/U0nGoLWMSJlDjAW4QUX2WNZLas5C0CmVV6LJ01JI0k90l7FvpmixjWxPFmENSClQ7ug==} engines: {node: '>=14.0.0'} @@ -12643,15 +12575,6 @@ packages: tslib: 2.6.2 dev: false - /@smithy/middleware-content-length@2.0.11: - resolution: {integrity: sha512-Malj4voNTL4+a5ZL3a6+Ij7JTUMTa2R7c3ZIBzMxN5OUUgAspU7uFi1Q97f4B0afVh2joQBAWH5IQJUG25nl8g==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/protocol-http': 3.0.9 - '@smithy/types': 2.5.0 - tslib: 2.6.2 - optional: true - /@smithy/middleware-content-length@2.0.15: resolution: {integrity: sha512-xH4kRBw01gJgWiU+/mNTrnyFXeozpZHw39gLb3JKGsFDVmSrJZ8/tRqu27tU/ki1gKkxr2wApu+dEYjI3QwV1Q==} engines: {node: '>=14.0.0'} @@ -12660,17 +12583,6 @@ packages: '@smithy/types': 2.5.0 tslib: 2.6.2 - /@smithy/middleware-endpoint@2.0.9: - resolution: {integrity: sha512-72/o8R6AAO4+nyTI6h4z6PYGTSA4dr1M7tZz29U8DEUHuh1YkhC77js0P6RyF9G0wDLuYqxb+Yh0crI5WG2pJg==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/middleware-serde': 2.0.13 - '@smithy/types': 2.5.0 - '@smithy/url-parser': 2.0.13 - '@smithy/util-middleware': 2.0.2 - tslib: 2.6.2 - optional: true - /@smithy/middleware-endpoint@2.2.0: resolution: {integrity: sha512-tddRmaig5URk2106PVMiNX6mc5BnKIKajHHDxb7K0J5MLdcuQluHMGnjkv18iY9s9O0tF+gAcPd/pDXA5L9DZw==} engines: {node: '>=14.0.0'} @@ -12683,20 +12595,6 @@ packages: '@smithy/util-middleware': 2.0.6 tslib: 2.6.2 - /@smithy/middleware-retry@2.0.12: - resolution: {integrity: sha512-YQ/ufXX4/d9/+Jf1QQ4J+CVeupC7BW52qldBTvRV33PDX9vxndlAwkFwzBcmnUFC3Hjf1//HW6I77EItcjNSCA==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/node-config-provider': 2.1.5 - '@smithy/protocol-http': 3.0.9 - '@smithy/service-error-classification': 2.0.2 - '@smithy/types': 2.5.0 - '@smithy/util-middleware': 2.0.2 - '@smithy/util-retry': 2.0.6 - tslib: 2.6.2 - uuid: 8.3.2 - optional: true - /@smithy/middleware-retry@2.0.20: resolution: {integrity: sha512-X2yrF/SHDk2WDd8LflRNS955rlzQ9daz9UWSp15wW8KtzoTXg3bhHM78HbK1cjr48/FWERSJKh9AvRUUGlIawg==} engines: {node: '>=14.0.0'} @@ -12717,22 +12615,6 @@ packages: '@smithy/types': 2.5.0 tslib: 2.6.2 - /@smithy/middleware-serde@2.0.9: - resolution: {integrity: sha512-GVbauxrr6WmtCaesakktg3t5LR/yDbajpC7KkWc8rtCpddMI4ShAVO5Q6DqwX8MDFi4CLaY8H7eTGcxhl3jbLg==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 2.5.0 - tslib: 2.6.2 - optional: true - - /@smithy/middleware-stack@2.0.2: - resolution: {integrity: sha512-6BNfPVp/8gcmkKdJhNJK3HEkUNNTrY3hM9vuWXIUSoLk9FZo1L2QuGLGB6S124D9ySInn8PzEdOtguCF5Ao4KA==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 2.5.0 - tslib: 2.6.2 - optional: true - /@smithy/middleware-stack@2.0.7: resolution: {integrity: sha512-L1KLAAWkXbGx1t2jjCI/mDJ2dDNq+rp4/ifr/HcC6FHngxho5O7A5bQLpKHGlkfATH6fUnOEx0VICEVFA4sUzw==} engines: {node: '>=14.0.0'} @@ -12740,16 +12622,6 @@ packages: '@smithy/types': 2.5.0 tslib: 2.6.2 - /@smithy/node-config-provider@2.0.12: - resolution: {integrity: sha512-df9y9ywv+JmS40Y60ZqJ4jfZiTCmyHQffwzIqjBjLJLJl0imf9F6DWBd+jiEWHvlohR+sFhyY+KL/qzKgnAq1A==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/property-provider': 2.0.14 - '@smithy/shared-ini-file-loader': 2.2.4 - '@smithy/types': 2.5.0 - tslib: 2.6.2 - optional: true - /@smithy/node-config-provider@2.1.5: resolution: {integrity: sha512-3Omb5/h4tOCuKRx4p4pkYTvEYRCYoKk52bOYbKUyz/G/8gERbagsN8jFm4FjQubkrcIqQEghTpQaUw6uk+0edw==} engines: {node: '>=14.0.0'} @@ -12759,17 +12631,6 @@ packages: '@smithy/types': 2.5.0 tslib: 2.6.2 - /@smithy/node-http-handler@2.1.5: - resolution: {integrity: sha512-52uF+BrZaFiBh+NT/bADiVDCQO91T+OwDRsuaAeWZC1mlCXFjAPPQdxeQohtuYOe9m7mPP/xIMNiqbe8jvndHA==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/abort-controller': 2.0.9 - '@smithy/protocol-http': 3.0.9 - '@smithy/querystring-builder': 2.0.9 - '@smithy/types': 2.5.0 - tslib: 2.6.2 - optional: true - /@smithy/node-http-handler@2.1.9: resolution: {integrity: sha512-+K0q3SlNcocmo9OZj+fz67gY4lwhOCvIJxVbo/xH+hfWObvaxrMTx7JEzzXcluK0thnnLz++K3Qe7Z/8MDUreA==} engines: {node: '>=14.0.0'} @@ -12780,13 +12641,6 @@ packages: '@smithy/types': 2.5.0 tslib: 2.6.2 - /@smithy/property-provider@2.0.10: - resolution: {integrity: sha512-YMBVfh0ZMmJtbsUn+WfSwR32iRljZPdRN0Tn2GAcdJ+ejX8WrBXD7Z0jIkQDrQZr8fEuuv5x8WxMIj+qVbsPQw==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 2.5.0 - tslib: 2.6.2 - /@smithy/property-provider@2.0.14: resolution: {integrity: sha512-k3D2qp9o6imTrLaXRj6GdLYEJr1sXqS99nLhzq8fYmJjSVOeMg/G+1KVAAc7Oxpu71rlZ2f8SSZxcSxkevuR0A==} engines: {node: '>=14.0.0'} @@ -12794,14 +12648,6 @@ packages: '@smithy/types': 2.5.0 tslib: 2.6.2 - /@smithy/protocol-http@3.0.5: - resolution: {integrity: sha512-3t3fxj+ip4EPHRC2fQ0JimMxR/qCQ1LSQJjZZVZFgROnFLYWPDgUZqpoi7chr+EzatxJVXF/Rtoi5yLHOWCoZQ==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 2.5.0 - tslib: 2.6.2 - optional: true - /@smithy/protocol-http@3.0.9: resolution: {integrity: sha512-U1wl+FhYu4/BC+rjwh1lg2gcJChQhytiNQSggREgQ9G2FzmoK9sACBZvx7thyWMvRyHQTE22mO2d5UM8gMKDBg==} engines: {node: '>=14.0.0'} @@ -12817,15 +12663,6 @@ packages: '@smithy/util-uri-escape': 2.0.0 tslib: 2.6.2 - /@smithy/querystring-builder@2.0.9: - resolution: {integrity: sha512-Yt6CPF4j3j1cuwod/DRflbuXxBFjJm7gAjy6W1RE21Rz5/kfGFqiZBXWmmXwGtnnhiLThYwoHK4S6/TQtnx0Fg==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 2.5.0 - '@smithy/util-uri-escape': 2.0.0 - tslib: 2.6.2 - optional: true - /@smithy/querystring-parser@2.0.13: resolution: {integrity: sha512-TEiT6o8CPZVxJ44Rly/rrsATTQsE+b/nyBVzsYn2sa75xAaZcurNxsFd8z1haoUysONiyex24JMHoJY6iCfLdA==} engines: {node: '>=14.0.0'} @@ -12833,21 +12670,6 @@ packages: '@smithy/types': 2.5.0 tslib: 2.6.2 - /@smithy/querystring-parser@2.0.9: - resolution: {integrity: sha512-U6z4N743s4vrcxPW8p8+reLV0PjMCYEyb1/wtMVvv3VnbJ74gshdI8SR1sBnEh95cF8TxonmX5IxY25tS9qGfg==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 2.5.0 - tslib: 2.6.2 - optional: true - - /@smithy/service-error-classification@2.0.2: - resolution: {integrity: sha512-GTUd2j63gKy7A+ggvSdn2hc4sejG7LWfE+ZMF17vzWoNyqERWbRP7HTPS0d0Lwg1p6OQCAzvNigSrEIWVFt6iA==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 2.5.0 - optional: true - /@smithy/service-error-classification@2.0.6: resolution: {integrity: sha512-fCQ36frtYra2fqY2/DV8+3/z2d0VB/1D1hXbjRcM5wkxTToxq6xHbIY/NGGY6v4carskMyG8FHACxgxturJ9Pg==} engines: {node: '>=14.0.0'} @@ -12860,6 +12682,7 @@ packages: dependencies: '@smithy/types': 2.5.0 tslib: 2.6.2 + dev: false /@smithy/shared-ini-file-loader@2.2.4: resolution: {integrity: sha512-9dRknGgvYlRIsoTcmMJXuoR/3ekhGwhRq4un3ns2/byre4Ql5hyUN4iS0x8eITohjU90YOnUCsbRwZRvCkbRfw==} @@ -12872,13 +12695,13 @@ packages: resolution: {integrity: sha512-RkHP0joSI1j2EI+mU55sOi33/aMMkKdL9ZY+SWrPxsiCe1oyzzuy79Tpn8X7uT+t0ilNmQlwPpkP/jUy940pEA==} engines: {node: '>=14.0.0'} dependencies: - '@smithy/eventstream-codec': 2.0.9 + '@smithy/eventstream-codec': 2.0.13 '@smithy/is-array-buffer': 2.0.0 '@smithy/types': 2.5.0 '@smithy/util-hex-encoding': 2.0.0 '@smithy/util-middleware': 2.0.6 '@smithy/util-uri-escape': 2.0.0 - '@smithy/util-utf8': 2.0.0 + '@smithy/util-utf8': 2.0.2 tslib: 2.6.2 /@smithy/smithy-client@2.1.15: @@ -12890,23 +12713,6 @@ packages: '@smithy/util-stream': 2.0.20 tslib: 2.6.2 - /@smithy/smithy-client@2.1.6: - resolution: {integrity: sha512-+F26b8U7C6ydJgj5Y+OZ94NL54HQUPF1LrFiZjMAIX3OlgZjDhiT3m6VOZo6+hge3sEFOrupwdjB5V24JOCpQw==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/middleware-stack': 2.0.7 - '@smithy/types': 2.5.0 - '@smithy/util-stream': 2.0.12 - tslib: 2.6.2 - optional: true - - /@smithy/types@2.3.3: - resolution: {integrity: sha512-zTdIPR9PvFVNRdIKMQu4M5oyTaycIbUqLheQqaOi9rTWPkgjGO2wDBxMA1rBHQB81aqAEv+DbSS4jfKyQMnXRA==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.6.2 - optional: true - /@smithy/types@2.5.0: resolution: {integrity: sha512-/a31lYofrMBkJb3BuPlYJTMKDj0hUmKUP6JFZQu6YVuQVoAjubiY0A52U9S0Uysd33n/djexCUSNJ+G9bf3/aA==} engines: {node: '>=14.0.0'} @@ -12920,20 +12726,13 @@ packages: '@smithy/types': 2.5.0 tslib: 2.6.2 - /@smithy/url-parser@2.0.9: - resolution: {integrity: sha512-NBnJ0NiY8z6E82Xd5VYUFQfKwK/wA/+QkKmpYUYP+cpH3aCzE6g2gvixd9vQKYjsIdRfNPCf+SFAozt8ljozOw==} - dependencies: - '@smithy/querystring-parser': 2.0.9 - '@smithy/types': 2.5.0 - tslib: 2.6.2 - optional: true - /@smithy/util-base64@2.0.0: resolution: {integrity: sha512-Zb1E4xx+m5Lud8bbeYi5FkcMJMnn+1WUnJF3qD7rAdXpaL7UjkFQLdmW5fHadoKbdHpwH9vSR8EyTJFHJs++tA==} engines: {node: '>=14.0.0'} dependencies: '@smithy/util-buffer-from': 2.0.0 tslib: 2.6.2 + dev: false /@smithy/util-base64@2.0.1: resolution: {integrity: sha512-DlI6XFYDMsIVN+GH9JtcRp3j02JEVuWIn/QOZisVzpIAprdsxGveFed0bjbMRCqmIFe8uetn5rxzNrBtIGrPIQ==} @@ -12966,17 +12765,6 @@ packages: dependencies: tslib: 2.6.2 - /@smithy/util-defaults-mode-browser@2.0.10: - resolution: {integrity: sha512-M5eaPn961jU2glZkqvmrVd6H4Tz4j1CJ2Kt8kjqMfcWZ4IQFgwPYbRkgND0W93dZXDmFU2GtuJGatwSmWIqxrA==} - engines: {node: '>= 10.0.0'} - dependencies: - '@smithy/property-provider': 2.0.14 - '@smithy/smithy-client': 2.1.15 - '@smithy/types': 2.5.0 - bowser: 2.11.0 - tslib: 2.6.2 - optional: true - /@smithy/util-defaults-mode-browser@2.0.19: resolution: {integrity: sha512-VHP8xdFR7/orpiABJwgoTB0t8Zhhwpf93gXhNfUBiwAE9O0rvsv7LwpQYjgvbOUDDO8JfIYQB2GYJNkqqGWsXw==} engines: {node: '>= 10.0.0'} @@ -12987,19 +12775,6 @@ packages: bowser: 2.11.0 tslib: 2.6.2 - /@smithy/util-defaults-mode-node@2.0.12: - resolution: {integrity: sha512-fwAVus2YBTU5u4KFmmEZDdgx3HpUUg8f6SEUetJFsNL+6AzoGBIhCZX0yMrVCLJEZe6tUfMbL5TZHXMw2q6MaA==} - engines: {node: '>= 10.0.0'} - dependencies: - '@smithy/config-resolver': 2.0.18 - '@smithy/credential-provider-imds': 2.1.1 - '@smithy/node-config-provider': 2.1.5 - '@smithy/property-provider': 2.0.14 - '@smithy/smithy-client': 2.1.15 - '@smithy/types': 2.5.0 - tslib: 2.6.2 - optional: true - /@smithy/util-defaults-mode-node@2.0.25: resolution: {integrity: sha512-jkmep6/JyWmn2ADw9VULDeGbugR4N/FJCKOt+gYyVswmN1BJOfzF2umaYxQ1HhQDvna3kzm1Dbo1qIfBW4iuHA==} engines: {node: '>= 10.0.0'} @@ -13018,14 +12793,6 @@ packages: dependencies: tslib: 2.6.2 - /@smithy/util-middleware@2.0.2: - resolution: {integrity: sha512-UGPZM+Ja/vke5pc/S8G0LNiHpVirtjppsXO+GK9m9wbzRGzPJTfnZA/gERUUN/AfxEy/8SL7U1kd7u4t2X8K1w==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 2.5.0 - tslib: 2.6.2 - optional: true - /@smithy/util-middleware@2.0.6: resolution: {integrity: sha512-7W4uuwBvSLgKoLC1x4LfeArCVcbuHdtVaC4g30kKsD1erfICyQ45+tFhhs/dZNeQg+w392fhunCm/+oCcb6BSA==} engines: {node: '>=14.0.0'} @@ -13033,15 +12800,6 @@ packages: '@smithy/types': 2.5.0 tslib: 2.6.2 - /@smithy/util-retry@2.0.2: - resolution: {integrity: sha512-ovWiayUB38moZcLhSFFfUgB2IMb7R1JfojU20qSahjxAgfOZvDWme3eOYUMtAVnouZ9kYJiFgHLy27qRH4NeeA==} - engines: {node: '>= 14.0.0'} - dependencies: - '@smithy/service-error-classification': 2.0.2 - '@smithy/types': 2.5.0 - tslib: 2.6.2 - optional: true - /@smithy/util-retry@2.0.6: resolution: {integrity: sha512-PSO41FofOBmyhPQJwBQJ6mVlaD7Sp9Uff9aBbnfBJ9eqXOE/obrqQjn0PNdkfdvViiPXl49BINfnGcFtSP4kYw==} engines: {node: '>= 14.0.0'} @@ -13050,20 +12808,6 @@ packages: '@smithy/types': 2.5.0 tslib: 2.6.2 - /@smithy/util-stream@2.0.12: - resolution: {integrity: sha512-FOCpRLaj6gvSyUC5mJAACT+sPMPmp9sD1o+hVbUH/QxwZfulypA3ZIFdAg/59/IY0d/1Q4CTztsiHEB5LgjN4g==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/fetch-http-handler': 2.2.6 - '@smithy/node-http-handler': 2.1.9 - '@smithy/types': 2.5.0 - '@smithy/util-base64': 2.0.1 - '@smithy/util-buffer-from': 2.0.0 - '@smithy/util-hex-encoding': 2.0.0 - '@smithy/util-utf8': 2.0.2 - tslib: 2.6.2 - optional: true - /@smithy/util-stream@2.0.20: resolution: {integrity: sha512-tT8VASuD8jJu0yjHEMTCPt1o5E3FVzgdsxK6FQLAjXKqVv5V8InCnc0EOsYrijgspbfDqdAJg7r0o2sySfcHVg==} engines: {node: '>=14.0.0'} @@ -13089,6 +12833,7 @@ packages: dependencies: '@smithy/util-buffer-from': 2.0.0 tslib: 2.6.2 + dev: false /@smithy/util-utf8@2.0.2: resolution: {integrity: sha512-qOiVORSPm6Ce4/Yu6hbSgNHABLP2VMv8QOC3tTDNHHlWY19pPyc++fBTbZPtx6egPXi4HQxKDnMxVxpbtX2GoA==} @@ -15103,10 +14848,11 @@ packages: resolution: {integrity: sha512-cqwOVYT3qXyLiGw7ueU2kX9noE8DPGRY6z8eUxudhXY8NZ7DMKYAxyZkLSevGfhCX3dO/AoX5/SO9lAzfjon0Q==} deprecated: Mongoose publishes its own types, so you do not need to install this package. dependencies: - mongoose: 6.9.1 + mongoose: 6.11.3 transitivePeerDependencies: - aws-crt - supports-color + dev: true /@types/node-fetch@2.6.2: resolution: {integrity: sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==} @@ -24611,8 +24357,8 @@ packages: - supports-color dev: true - /mongodb@4.13.0: - resolution: {integrity: sha512-+taZ/bV8d1pYuHL4U+gSwkhmDrwkWbH1l4aah4YpmpscMwgFBkufIKxgP/G7m87/NUuQzc2Z75ZTI7ZOyqZLbw==} + /mongodb@4.16.0: + resolution: {integrity: sha512-0EB113Fsucaq1wsY0dOhi1fmZOwFtLOtteQkiqOXGklvWMnSH3g2QS53f0KTP+/6qOkuoXE2JksubSZNmxeI+g==} engines: {node: '>=12.9.0'} dependencies: bson: 4.7.2 @@ -24696,13 +24442,13 @@ packages: bson: 6.2.0 mongodb-connection-string-url: 2.6.0 - /mongoose@6.9.1: - resolution: {integrity: sha512-hOz1ZWV0w6WEVLrj89Wpk7PXDYtDDF6k7/NX79lY5iKqeFtZsceBXW8xW59YFNcW5O3cH32hQ8IbDlhgyBsDMA==} + /mongoose@6.11.3: + resolution: {integrity: sha512-M1Y5PjttgV51YDa30u7GVMVypQSlNZF/jUhlzTBAmaz5C9FvOr8eih/VLhhO7xtTSlcVTFQS1dqlQNMbtfUowQ==} engines: {node: '>=12.0.0'} dependencies: bson: 4.7.2 kareem: 2.5.1 - mongodb: 4.13.0 + mongodb: 4.16.0 mpath: 0.9.0 mquery: 4.0.3 ms: 2.1.3 @@ -29495,16 +29241,6 @@ packages: typescript: 5.1.3 yargs-parser: 21.1.1 - /ts-mongoose-pagination@1.1.2(@types/mongoose@5.11.97)(mongoose@6.9.1): - resolution: {integrity: sha512-KkhfTX5VmGy4WVVkoxxL+M3lx9gSjwjeP1svt4oT9vigPDquX99omH3sm0gvlN1c3JgyVEavtypsw8yl2WGyFA==} - peerDependencies: - '@types/mongoose': 5.x - mongoose: 5.x - dependencies: - '@types/mongoose': 5.11.97 - mongoose: 6.9.1 - dev: false - /ts-node@10.9.1(@swc/core@1.3.89)(@types/node@20.9.0)(typescript@5.1.3): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index 8a90fd7a..41ad724c 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "e1f7bbb05a66ed31d315cf99761e2d8c6db29d1f", + "pnpmShrinkwrapHash": "15e01ddf6a54fd41b38e4e5255e36748ef5bcd5d", "preferredVersionsHash": "7c6836c4ff2ee31a263e87ea93a487fc752ca3f6" } diff --git a/libraries/faker-factory/package.json b/libraries/faker-factory/package.json index ddb07529..c1a8288d 100644 --- a/libraries/faker-factory/package.json +++ b/libraries/faker-factory/package.json @@ -55,7 +55,7 @@ "esbuild": "~0.17.5", "@types/uuid": "~9.0.6", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@types/json-schema": "~7.0.11" } } diff --git a/libraries/faker-factory/src/pojo.ts b/libraries/faker-factory/src/pojo.ts index 990a6b76..d946fb66 100644 --- a/libraries/faker-factory/src/pojo.ts +++ b/libraries/faker-factory/src/pojo.ts @@ -10,7 +10,7 @@ export function toPojoInternal(obj: any, visited: Set): any { visited.add(obj); if (Array.isArray(obj)) { - const resultArray = obj.map(item => toPojoInternal(item, visited)); + const resultArray = obj.map((item) => toPojoInternal(item, visited)); visited.delete(obj); return resultArray; } diff --git a/libraries/messaging-schemas/package.json b/libraries/messaging-schemas/package.json index ec9d7978..2e46bc55 100644 --- a/libraries/messaging-schemas/package.json +++ b/libraries/messaging-schemas/package.json @@ -39,7 +39,7 @@ "esbuild": "~0.17.5", "@types/uuid": "~9.0.6", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@types/json-schema": "~7.0.11" } } diff --git a/libraries/nestjs-modules/package.json b/libraries/nestjs-modules/package.json index 3b29a340..6d4191fd 100644 --- a/libraries/nestjs-modules/package.json +++ b/libraries/nestjs-modules/package.json @@ -40,10 +40,9 @@ "@nestjs/passport": "9.0.0", "@nestjs/platform-express": "9.3.9", "@nestjs/mongoose": "9.2.1", - "mongoose": "6.9.1", + "mongoose": "6.11.3", "connection-string": "~4.3.6", "uuid": "~9.0.1", - "ts-mongoose-pagination": "~1.1.2", "rxjs": "7.8.1", "rimraf": "~4.1.2", "dotenv": "~16.0.3", @@ -65,7 +64,7 @@ "ts-node": "10.9.1", "esbuild": "~0.17.5", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@nestjs/schematics": "^9.0.0", "@nestjs/testing": "9.2.1", "@types/mongoose": "~5.11.97", diff --git a/libraries/nestjs-modules/src/__tests__/books/book.repository.ts b/libraries/nestjs-modules/src/__tests__/books/book.repository.ts index f2aee55b..28a8a442 100644 --- a/libraries/nestjs-modules/src/__tests__/books/book.repository.ts +++ b/libraries/nestjs-modules/src/__tests__/books/book.repository.ts @@ -1,58 +1,15 @@ import { Injectable } from '@nestjs/common'; import { InjectModel } from '@nestjs/mongoose'; -import { PaginateModel, IPaginateResult } from 'mongoose'; +import { Model } from 'mongoose'; +import { BaseRepository } from '../../mongoose/base.repository'; import { TBookDocument, Book } from './book.schema'; -import { CreateBookDto } from './create-book.dto'; @Injectable() -export class BooksRepository { +export class BookRepository extends BaseRepository { constructor( // @ts-ignore - @InjectModel(Book.name) - private BookModel: PaginateModel, - ) {} - - async findAll( - page: number, - size: number, - ): Promise> { - const conditions = {}; - const options = { - perPage: size, - page, - lean: true, - }; - return this.BookModel.paginate(conditions, options); - } - - async findById(id: number): Promise> { - const conditions = { - id, - }; - const options = { - lean: true, - }; - return this.BookModel.paginate(conditions, options); - } - - async findByFilter( - search: string, - page: number, - size: number, - ): Promise> { - const conditions = { - $or: [{ title: { $regex: search } }], - }; - const options = { - perPage: size, - page, - lean: true, - }; - return this.BookModel.paginate(conditions, options); - } - - async create(book: CreateBookDto): Promise { - const createdBook = new this.BookModel(book); - return createdBook.save(); + @InjectModel(Book.name) private entity: Model, + ) { + super(entity); } } diff --git a/libraries/nestjs-modules/src/__tests__/books/book.schema.ts b/libraries/nestjs-modules/src/__tests__/books/book.schema.ts index 454ee0ce..01439500 100644 --- a/libraries/nestjs-modules/src/__tests__/books/book.schema.ts +++ b/libraries/nestjs-modules/src/__tests__/books/book.schema.ts @@ -1,6 +1,5 @@ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; -import { mongoosePagination } from 'ts-mongoose-pagination'; import { BaseEntity } from '../../mongoose'; export type TBookDocument = Book & Document; @@ -8,14 +7,13 @@ export type TBookDocument = Book & Document; @Schema() export class Book extends BaseEntity { @Prop() - name: string; + name: string; @Prop() - price: string; + price: string; @Prop() - quantity: number; + quantity: number; } -export const BookSchema = - SchemaFactory.createForClass(Book).plugin(mongoosePagination); +export const BookSchema = SchemaFactory.createForClass(Book); diff --git a/libraries/nestjs-modules/src/__tests__/persons/person.schema.ts b/libraries/nestjs-modules/src/__tests__/persons/person.schema.ts index 9a0854d7..feaba0e4 100644 --- a/libraries/nestjs-modules/src/__tests__/persons/person.schema.ts +++ b/libraries/nestjs-modules/src/__tests__/persons/person.schema.ts @@ -1,14 +1,25 @@ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; -import { BaseEntity } from '../../mongoose'; +import { BaseEntity, BaseEntityProps } from '../../mongoose'; @Schema() export class Person extends BaseEntity { - @Prop() + @Prop({ + type: String, + trim: true, + }) public firstName!: string; - @Prop() + @Prop({ + type: String, + trim: true, + }) public lastName!: string; + + constructor(partial: NonNullable>) { + super(); + Object.assign(this, partial); + } } export type TPersonDocument = Person & Document; diff --git a/libraries/nestjs-modules/src/__tests__/persons/student.repository.ts b/libraries/nestjs-modules/src/__tests__/persons/student.repository.ts new file mode 100644 index 00000000..7e5d9962 --- /dev/null +++ b/libraries/nestjs-modules/src/__tests__/persons/student.repository.ts @@ -0,0 +1,15 @@ +import { Injectable } from '@nestjs/common'; +import { InjectModel } from '@nestjs/mongoose'; +import { Model } from 'mongoose'; +import { BaseRepository } from '../../mongoose/base.repository'; +import { TStudentDocument, Student } from './student.schema'; + +@Injectable() +export class StudentRepository extends BaseRepository { + constructor( + // @ts-ignore + @InjectModel(Student.name) private entity: Model, + ) { + super(entity); + } +} diff --git a/libraries/nestjs-modules/src/__tests__/persons/student.schema.ts b/libraries/nestjs-modules/src/__tests__/persons/student.schema.ts new file mode 100644 index 00000000..157a6565 --- /dev/null +++ b/libraries/nestjs-modules/src/__tests__/persons/student.schema.ts @@ -0,0 +1,28 @@ +import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; +import { Document, Schema as MongooseSchema } from 'mongoose'; +import { IsString, IsUuidV4 } from '@cats-cradle/validation-schemas'; +import { BaseEntity, BaseEntityProps } from '../../mongoose'; +import { Person } from './person.schema'; + +@Schema() +export class Student extends BaseEntity { + @IsUuidV4() + @Prop({ + type: MongooseSchema.Types.UUID, + ref: 'Person', + }) + public person: MongooseSchema.Types.UUID | Person; + + @IsString() + @Prop() + public studentNo!: string; + + constructor(partial: NonNullable>) { + super(); + Object.assign(this, partial); + } +} + +export type TStudentDocument = Student & Document; + +export const StudentSchema = SchemaFactory.createForClass(Student); diff --git a/libraries/nestjs-modules/src/mongoose/base.entity.ts b/libraries/nestjs-modules/src/mongoose/base.entity.ts index e1eaa661..ec198157 100644 --- a/libraries/nestjs-modules/src/mongoose/base.entity.ts +++ b/libraries/nestjs-modules/src/mongoose/base.entity.ts @@ -2,20 +2,18 @@ import { Prop } from '@nestjs/mongoose'; import { Schema } from 'mongoose'; import { IsDateString, IsUuidV4 } from '@cats-cradle/validation-schemas'; -import { v4 } from 'uuid'; import { UUID } from 'bson'; export type BaseEntityProps = '_id' | 'updatedAt' | 'createdAt'; export class BaseEntity { // @Transform(({ value }) => value.toString()) - // _id: ObjectId; @IsUuidV4() @Prop({ type: Schema.Types.UUID, default: () => new UUID(), }) - _id!: string; + _id!: Schema.Types.UUID; @IsDateString() @Prop({ diff --git a/libraries/nestjs-modules/src/mongoose/base.repository.test.ts b/libraries/nestjs-modules/src/mongoose/base.repository.test.ts index f47f15b4..f5a35cc6 100644 --- a/libraries/nestjs-modules/src/mongoose/base.repository.test.ts +++ b/libraries/nestjs-modules/src/mongoose/base.repository.test.ts @@ -1,32 +1,34 @@ import { Test, TestingModule } from '@nestjs/testing'; import { MongooseModule } from '@nestjs/mongoose'; import { INestApplication } from '@nestjs/common'; +import { IsUuidV4Validator } from '@cats-cradle/validation-schemas'; import { closeInMongodConnection, rootMongooseTestModule, -} from '../mongoose/mongoose.module'; -import { PersonSchema } from '../__tests__/persons/person.schema'; +} from './mongoose.module'; +import { Person, PersonSchema } from '../__tests__/persons/person.schema'; import { PersonRepository } from '../__tests__/persons/person.repository'; -import { - IsDateString, - IsUuidV4Validator, -} from '@cats-cradle/validation-schemas'; +import { StudentRepository } from '../__tests__/persons/student.repository'; +import { Student, StudentSchema } from '../__tests__/persons/student.schema'; describe('MongooseRepository', () => { let app: INestApplication; - let personsRepository: PersonRepository; + let personRepository: PersonRepository; + let studentRepository: StudentRepository; beforeEach(async () => { const moduleRef: TestingModule = await Test.createTestingModule({ imports: [ rootMongooseTestModule(), MongooseModule.forFeature([{ name: 'Person', schema: PersonSchema }]), + MongooseModule.forFeature([{ name: 'Student', schema: StudentSchema }]), ], - providers: [PersonRepository], + providers: [PersonRepository, StudentRepository], }).compile(); app = moduleRef.createNestApplication(); - personsRepository = await moduleRef.get(PersonRepository); + personRepository = await moduleRef.get(PersonRepository); + studentRepository = await moduleRef.get(StudentRepository); await app.init(); }); @@ -37,7 +39,7 @@ describe('MongooseRepository', () => { describe('create', () => { it('should create item', async () => { - const person = await personsRepository.create({ + const person = await personRepository.create({ firstName: 'Jane', lastName: 'Doe', }); @@ -50,14 +52,81 @@ describe('MongooseRepository', () => { }); }); + describe('findById', () => { + it('should populate given props', async () => { + const person = await personRepository.create( + new Person({ + firstName: 'Jane', + lastName: 'Doe', + }), + ); + + const student = await studentRepository.create( + new Student({ + studentNo: 'M-44993', + person: person!.id, + }), + ); + + const result = await studentRepository.findById(student!._id, { + populate: 'person', + }); + + const date = new Date(); + expect(result).toBeTruthy(); + expect(IsUuidV4Validator(result!._id)).toBe(true); + expect(result?.createdAt).toContain(date.getFullYear().toString()); + expect(result?.updatedAt).toContain(date.getFullYear().toString()); + expect(result.person).toBeTruthy(); + expect(IsUuidV4Validator(result.person!._id)).toBe(true); + expect(result.person?.firstName).toBe('Jane'); + expect(result.person?.lastName).toBe('Doe'); + expect(result.person?.createdAt).toContain(date.getFullYear().toString()); + expect(result.person?.updatedAt).toContain(date.getFullYear().toString()); + }); + }); + describe('findOne', () => { + it('should populate given props', async () => { + const person = await personRepository.create( + new Person({ + firstName: 'Jane', + lastName: 'Doe', + }), + ); + + const student = await studentRepository.create( + new Student({ + studentNo: 'M-44993', + person: person!.id, + }), + ); + + const result = await studentRepository.findOne( + { id: student!._id }, + { populate: 'person' }, + ); + + const date = new Date(); + expect(result).toBeTruthy(); + expect(IsUuidV4Validator(result!._id)).toBe(true); + expect(result?.createdAt).toContain(date.getFullYear().toString()); + expect(result?.updatedAt).toContain(date.getFullYear().toString()); + expect(result.person).toBeTruthy(); + expect(IsUuidV4Validator(result.person!._id)).toBe(true); + expect(result.person?.firstName).toBe('Jane'); + expect(result.person?.lastName).toBe('Doe'); + expect(result.person?.createdAt).toContain(date.getFullYear().toString()); + expect(result.person?.updatedAt).toContain(date.getFullYear().toString()); + }); + it('should find item in repository by id', async () => { - const person = await personsRepository.create({ + const person = await personRepository.create({ firstName: 'Jane', lastName: 'Doe', }); - const result = await personsRepository.findOne({ + const result = await personRepository.findOne({ id: person!.id, }); @@ -66,12 +135,12 @@ describe('MongooseRepository', () => { }); it('should find item in repository by property', async () => { - const person = await personsRepository.create({ + const person = await personRepository.create({ firstName: 'Jane', lastName: 'Doe', }); - const result = await personsRepository.findOne({ + const result = await personRepository.findOne({ firstName: 'Jane', }); @@ -82,12 +151,12 @@ describe('MongooseRepository', () => { describe('findOneOrFail', () => { it('should find item in repository', async () => { - await personsRepository.create({ + await personRepository.create({ firstName: 'Jane', lastName: 'Doe', }); - const result = await personsRepository.findOneOrFail({ + const result = await personRepository.findOneOrFail({ firstName: 'Jane', }); @@ -99,7 +168,7 @@ describe('MongooseRepository', () => { expect.assertions(1); try { - const result = await personsRepository.findOneOrFail({ + const result = await personRepository.findOneOrFail({ firstName: 'Jon', }); } catch (error) { diff --git a/libraries/nestjs-modules/src/mongoose/base.repository.ts b/libraries/nestjs-modules/src/mongoose/base.repository.ts index e0a27d85..892e5b89 100644 --- a/libraries/nestjs-modules/src/mongoose/base.repository.ts +++ b/libraries/nestjs-modules/src/mongoose/base.repository.ts @@ -6,14 +6,13 @@ import { UpdateWithAggregationPipeline, Document, } from 'mongoose'; -import { UUID, ObjectId } from 'bson'; -import { v4 } from 'uuid'; +import { UUID } from 'bson'; export type UpdateModelResponse = { matchedCount: number; modifiedCount: number; acknowledged: boolean; - upsertedId: unknown | ObjectId; + upsertedId: unknown | UUID; upsertedCount: number; }; @@ -22,10 +21,25 @@ export type DeleteModelResponse = { deleted: boolean; }; +export type FindOptions = { + skip?: number; + limit?: number; + populate?: string[] | string; +}; + export class BaseRepository { constructor(private readonly model: Model) {} + async populate(result: T[], option: any) { + return this.model.populate(result, option); + } + + async aggregate(option: any) { + return this.model.aggregate(option); + } + async create(doc: object): Promise { + // eslint-disable-next-line new-cap const createdEntity = new this.model({ ...doc }); await createdEntity.save(); @@ -34,16 +48,20 @@ export class BaseRepository { async findOne( filter: FilterQuery, - options?: QueryOptions, - ): Promise { - return this.model.findOne(filter, options); + options?: FindOptions, + ): Promise { + if (options?.populate) { + return this.model.findOne(filter).populate(options.populate).exec(); + } + + return this.model.findOne(filter); } async findOneOrFail( filter: FilterQuery, - options?: QueryOptions, - ): Promise { - const result = await this.model.findOne(filter, options); + options?: FindOptions, + ): Promise { + const result = await this.findOne(filter, options); if (result === null) { return Promise.reject(new Error('No results found')); @@ -53,10 +71,18 @@ export class BaseRepository { } async find(filter: FilterQuery, options?: QueryOptions): Promise { + // TODO add + // .skip(skip) + // .limit(limit) + return this.model.find(filter, null, options); } - async findById(id: string): Promise { + async findById(id: string, options?: FindOptions): Promise { + if (options?.populate) { + return this.model.findById(id).populate(options.populate).exec(); + } + return this.model.findById(id); } diff --git a/libraries/nestjs-modules/src/mongoose/mongoose.module.test.ts b/libraries/nestjs-modules/src/mongoose/mongoose.module.test.ts index 36b80d8d..b123cfed 100644 --- a/libraries/nestjs-modules/src/mongoose/mongoose.module.test.ts +++ b/libraries/nestjs-modules/src/mongoose/mongoose.module.test.ts @@ -4,14 +4,14 @@ import { INestApplication } from '@nestjs/common'; import { closeInMongodConnection, rootMongooseTestModule, -} from '../mongoose/mongoose.module'; +} from './mongoose.module'; import { BookSchema } from '../__tests__/books/book.schema'; -import { BooksRepository } from '../__tests__/books/book.repository'; +import { BookRepository } from '../__tests__/books/book.repository'; import { CreateBookDto } from '../__tests__/books/create-book.dto'; describe('MongooseModule', () => { let app: INestApplication; - let booksRepository: BooksRepository; + let bookRepository: BookRepository; beforeEach(async () => { const moduleRef: TestingModule = await Test.createTestingModule({ @@ -19,11 +19,11 @@ describe('MongooseModule', () => { rootMongooseTestModule(), MongooseModule.forFeature([{ name: 'Book', schema: BookSchema }]), ], - providers: [BooksRepository], + providers: [BookRepository], }).compile(); app = moduleRef.createNestApplication(); - booksRepository = await moduleRef.get(BooksRepository); + bookRepository = await moduleRef.get(BookRepository); await app.init(); }); @@ -39,11 +39,11 @@ describe('MongooseModule', () => { price: '100.00', quantity: 1, }; - await booksRepository.create(book1); + await bookRepository.create(book1); - const result = await booksRepository.findByFilter('Test Bible', 1, 1); - expect(result.data[0].price).toBe(book1.price); - expect(result.data[0].quantity).toBe(book1.quantity); + const result = await bookRepository.find({ name: 'Test Bible' }); + expect(result[0].price).toBe(book1.price); + expect(result[0].quantity).toBe(book1.quantity); }); }); }); diff --git a/libraries/promare-gradients/package.json b/libraries/promare-gradients/package.json index 70e57f63..01360258 100644 --- a/libraries/promare-gradients/package.json +++ b/libraries/promare-gradients/package.json @@ -31,7 +31,7 @@ "clean-css-cli": "^5.5.0", "express": "4.18.2", "sass": "^1.47.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "node-sass": "~8.0.0" }, "devDependencies": { diff --git a/libraries/pseudo-random/package.json b/libraries/pseudo-random/package.json index 8a74e5c5..22d99c49 100644 --- a/libraries/pseudo-random/package.json +++ b/libraries/pseudo-random/package.json @@ -41,6 +41,6 @@ "ts-node": "10.9.1", "esbuild": "~0.17.5", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7" + "@cats-cradle/eslint-config": "1.0.8" } } diff --git a/libraries/validation-schemas/package.json b/libraries/validation-schemas/package.json index 867044fc..f3ee1b1f 100644 --- a/libraries/validation-schemas/package.json +++ b/libraries/validation-schemas/package.json @@ -39,7 +39,7 @@ "esbuild": "~0.17.5", "@types/uuid": "~9.0.6", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@types/json-schema": "~7.0.11" } } diff --git a/platform/api-gateway/package.json b/platform/api-gateway/package.json index 7aebc4f4..fbeba1bd 100644 --- a/platform/api-gateway/package.json +++ b/platform/api-gateway/package.json @@ -39,7 +39,7 @@ "node-cache": "5.1.2", "reflect-metadata": "0.1.13", "rxjs": "7.8.1", - "mongoose": "6.9.1", + "mongoose": "6.11.3", "source-map-support": "~0.5.21", "@nestjs/swagger": "~7.1.16", "uuid": "~9.0.1", @@ -65,6 +65,6 @@ "@types/express": "~4.17.18", "@types/uuid": "~9.0.6", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7" + "@cats-cradle/eslint-config": "1.0.8" } } diff --git a/platform/cli-tools/create-artifact/package.json b/platform/cli-tools/create-artifact/package.json index 36798eb3..ff43e296 100644 --- a/platform/cli-tools/create-artifact/package.json +++ b/platform/cli-tools/create-artifact/package.json @@ -28,7 +28,7 @@ "@pnpm/find-workspace-dir": "~6.0.0" }, "devDependencies": { - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "eslint": "8.52.0", "@pnpm/types": "^8.5.0", "@types/fs-extra": "^9.0.13", diff --git a/platform/cli-tools/create-bundle/package.json b/platform/cli-tools/create-bundle/package.json index c57b4fe7..22c5ea8d 100644 --- a/platform/cli-tools/create-bundle/package.json +++ b/platform/cli-tools/create-bundle/package.json @@ -45,7 +45,7 @@ "typescript": "5.1.3", "ts-node": "10.9.1", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@cats-cradle/base-nodejs": "workspace:*" } } diff --git a/platform/cli-tools/rush-coverage/package.json b/platform/cli-tools/rush-coverage/package.json index 57127c0a..ae7d6dd7 100644 --- a/platform/cli-tools/rush-coverage/package.json +++ b/platform/cli-tools/rush-coverage/package.json @@ -44,6 +44,6 @@ "typescript": "5.1.3", "ts-node": "10.9.1", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7" + "@cats-cradle/eslint-config": "1.0.8" } } diff --git a/platform/constructs/package.json b/platform/constructs/package.json index 681b25e2..b0977baa 100644 --- a/platform/constructs/package.json +++ b/platform/constructs/package.json @@ -27,7 +27,7 @@ "node-cache": "5.1.2", "reflect-metadata": "0.1.13", "rxjs": "7.8.1", - "mongoose": "6.9.1", + "mongoose": "6.11.3", "source-map-support": "~0.5.21", "@nestjs/swagger": "~7.1.16", "uuid": "~9.0.1", @@ -50,7 +50,7 @@ "@types/express": "~4.17.18", "@types/uuid": "~9.0.6", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@cats-cradle/base-nodejs": "workspace:*" }, "exports": { diff --git a/platform/lambda-layers/package.json b/platform/lambda-layers/package.json index a754ffc4..c7012213 100644 --- a/platform/lambda-layers/package.json +++ b/platform/lambda-layers/package.json @@ -31,7 +31,7 @@ "node-cache": "5.1.2", "reflect-metadata": "0.1.13", "rxjs": "7.8.1", - "mongoose": "6.9.1", + "mongoose": "6.11.3", "source-map-support": "~0.5.21", "@nestjs/swagger": "~7.1.16", "uuid": "~9.0.1" @@ -53,6 +53,6 @@ "@types/express": "~4.17.18", "@types/uuid": "~9.0.6", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7" + "@cats-cradle/eslint-config": "1.0.8" } } diff --git a/platform/message-bus/package.json b/platform/message-bus/package.json index e99c03fa..045b4a6e 100644 --- a/platform/message-bus/package.json +++ b/platform/message-bus/package.json @@ -39,7 +39,7 @@ "node-cache": "5.1.2", "reflect-metadata": "0.1.13", "rxjs": "7.8.1", - "mongoose": "6.9.1", + "mongoose": "6.11.3", "source-map-support": "~0.5.21", "@nestjs/swagger": "~7.1.16", "uuid": "~9.0.1", @@ -66,6 +66,6 @@ "@types/express": "~4.17.18", "@types/uuid": "~9.0.6", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7" + "@cats-cradle/eslint-config": "1.0.8" } } diff --git a/platform/pipeline/package.json b/platform/pipeline/package.json index 0d78d8d1..3e92edf5 100644 --- a/platform/pipeline/package.json +++ b/platform/pipeline/package.json @@ -33,7 +33,7 @@ "@rushstack/node-core-library": "~3.55.2" }, "devDependencies": { - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "aws-cdk-lib": "2.95.0", "constructs": "^10.2.70", "@types/jest": "29.5.8", diff --git a/services/authentication-service/package.json b/services/authentication-service/package.json index 46a3dffe..e87a7be5 100644 --- a/services/authentication-service/package.json +++ b/services/authentication-service/package.json @@ -47,7 +47,7 @@ "rxjs": "7.8.1", "source-map-support": "~0.5.21", "uuid": "~9.0.1", - "mongoose": "6.9.1", + "mongoose": "6.11.3", "@nestjs/passport": "9.0.0", "aws-sdk": "~2.1469.0", "@nestjs/jwt": "~10.1.1", @@ -57,7 +57,7 @@ }, "devDependencies": { "@cats-cradle/create-artifact": "2.0.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@cats-cradle/faker-factory": "workspace:*", "@microsoft/tsdoc": "~0.13.2", "@nestjs/testing": "9.2.1", diff --git a/services/billing-system/package.json b/services/billing-system/package.json index ab4ae293..9d4946a1 100644 --- a/services/billing-system/package.json +++ b/services/billing-system/package.json @@ -47,7 +47,7 @@ "@nestjs/axios": "~2.0.0" }, "devDependencies": { - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "aws-cdk-lib": "2.95.0", "constructs": "^10.2.70", "@types/jest": "29.5.8", diff --git a/services/character-sheet/openapi-spec.json b/services/character-sheet/openapi-spec.json index 6b57f460..4c8abf1f 100644 --- a/services/character-sheet/openapi-spec.json +++ b/services/character-sheet/openapi-spec.json @@ -477,7 +477,7 @@ }, "/character-sheets/{id}": { "get": { - "operationId": "CharacterSheetController_findOne", + "operationId": "CharacterSheetController_findById", "parameters": [ { "name": "id", @@ -547,7 +547,7 @@ "required": true, "in": "path", "schema": { - "default": "a281ad2d-f1b1-4004-918f-704609287eb0", + "default": "ac44e16d-2fd7-40eb-95f9-3ff3137021b5", "type": "string" } } @@ -584,13 +584,9 @@ "CreateCharacterSheetDto": { "type": "object", "properties": { - "_id": { - "type": "string", - "default": "d24cbb2e-a137-48c8-b485-62d082578a7b" - }, "instanceId": { "type": "string", - "default": "a345f379-b55e-4da1-973c-f8127b2292e7" + "default": "6a6be6f8-da87-45e2-9ecc-35e04b70cfd0" }, "archetypeId": { "type": "string", @@ -640,14 +636,14 @@ "name": { "type": "string", "default": "Daruma" }, "surname": { "type": "string", "default": "Nakamura" } }, - "required": ["_id", "instanceId", "archetypeId", "name", "surname"] + "required": ["instanceId", "archetypeId", "name", "surname"] }, "CreateSpawnDto": { "type": "object", "properties": { "instanceId": { "type": "string", - "default": "c39a6a2a-1321-4447-b8a9-3d4b4a4fc90e" + "default": "7ee7ef85-4a8c-4578-aeae-9129c5d6882f" }, "place": { "type": "string", @@ -670,7 +666,7 @@ "properties": { "characterSheetId": { "type": "string", - "default": "acf77073-0249-4077-8c3f-e06e05f78191" + "default": "fb463bac-5232-410f-a026-fa1e90ea826b" }, "affiliationId": { "type": "string", diff --git a/services/character-sheet/package.json b/services/character-sheet/package.json index 96e1f1c0..3b6dea19 100644 --- a/services/character-sheet/package.json +++ b/services/character-sheet/package.json @@ -50,7 +50,7 @@ }, "devDependencies": { "@cats-cradle/create-artifact": "2.0.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@cats-cradle/faker-factory": "workspace:*", "@microsoft/tsdoc": "~0.13.2", "@nestjs/testing": "9.2.1", @@ -74,6 +74,6 @@ "@cats-cradle/create-bundle": "1.0.7", "@shelf/jest-mongodb": "~4.1.7", "mongodb-memory-server-global": "8.13.0", - "mongoose": "6.9.1" + "mongoose": "6.11.3" } } diff --git a/services/character-sheet/src/models/character-sheet.schema.ts b/services/character-sheet/src/models/character-sheet.schema.ts index c3d8c3a8..8b370e9f 100644 --- a/services/character-sheet/src/models/character-sheet.schema.ts +++ b/services/character-sheet/src/models/character-sheet.schema.ts @@ -145,8 +145,7 @@ CharacterSheetSchema.virtual('menu').get(function () { const skills: any = []; this.disciplines.forEach((disciplineEmbeddable: DisciplineEmbeddable) => { - const discipline: Discipline.Type = - Discipline[disciplineEmbeddable.disciplineId]; + const discipline: Discipline.Type = Discipline[disciplineEmbeddable.disciplineId]; if (discipline.progression === undefined) { return; @@ -159,8 +158,8 @@ CharacterSheetSchema.virtual('menu').get(function () { ); if ( - progression.level >= disciplineLevel && - skills.indexOf(progression.skill) === -1 + progression.level >= disciplineLevel + && skills.indexOf(progression.skill) === -1 ) { skills.push(progression.skill); } @@ -192,8 +191,7 @@ CharacterSheetSchema.virtual('skills').get(function () { const skills: any = []; this.disciplines.forEach((disciplineEmbeddable: DisciplineEmbeddable) => { - const discipline: Discipline.Type = - Discipline[disciplineEmbeddable.disciplineId]; + const discipline: Discipline.Type = Discipline[disciplineEmbeddable.disciplineId]; if (discipline.progression === undefined) { return; @@ -206,8 +204,8 @@ CharacterSheetSchema.virtual('skills').get(function () { ); if ( - progression.level >= disciplineLevel && - skills.indexOf(progression.skill) === -1 + progression.level >= disciplineLevel + && skills.indexOf(progression.skill) === -1 ) { skills.push(progression.skill); } diff --git a/services/character-sheet/src/modules/affiliation/affiliation.e2e-spec.ts b/services/character-sheet/src/modules/affiliation/affiliation.e2e-spec.ts index 043187c4..c2b5e082 100644 --- a/services/character-sheet/src/modules/affiliation/affiliation.e2e-spec.ts +++ b/services/character-sheet/src/modules/affiliation/affiliation.e2e-spec.ts @@ -82,19 +82,17 @@ describe('/affiliations', () => { CharacterSheetRepository, ); - const characterSheet = await FakerFactory.create( - CharacterSheet, - { + const characterSheet = await characterSheetRepository.create( + await FakerFactory.create(CharacterSheet, { archetypeId: 'MEEKU_ONI', affiliation: [{ affiliationId: 'THE_CATS', amount: 10 }], - }, + }), ); - await characterSheetRepository.create(characterSheet); const body = await FakerFactory.create( UpdateAffiliationDto, { - characterSheetId: characterSheet._id, + characterSheetId: characterSheet!.id, affiliationId: 'THE_CATS', value: 10, operation: Operation.ADD, diff --git a/services/character-sheet/src/modules/character-sheet/character-sheet.controller.ts b/services/character-sheet/src/modules/character-sheet/character-sheet.controller.ts index f0811327..3836b341 100644 --- a/services/character-sheet/src/modules/character-sheet/character-sheet.controller.ts +++ b/services/character-sheet/src/modules/character-sheet/character-sheet.controller.ts @@ -20,10 +20,8 @@ export class CharacterSheetController { constructor(private _characterSheetRepository: CharacterSheetRepository) {} @Get(':id') - async findOne(@Param('id', new ParseUUIDPipe()) id: string): Promise { - const result = await this._characterSheetRepository.findOne({ - id, - }); + async findById(@Param('id', new ParseUUIDPipe()) id: string): Promise { + const result = await this._characterSheetRepository.findById(id); if (!result) { throw new NotFoundException(); } @@ -86,8 +84,7 @@ export class CharacterSheetController { affiliation: [], }); - const character = - await this._characterSheetRepository.create(characterSheet); + const character = await this._characterSheetRepository.create(characterSheet); return character!.toJSON(); } diff --git a/services/character-sheet/src/modules/character-sheet/character-sheet.e2e-spec.ts b/services/character-sheet/src/modules/character-sheet/character-sheet.e2e-spec.ts index b79628a9..b53a33e0 100644 --- a/services/character-sheet/src/modules/character-sheet/character-sheet.e2e-spec.ts +++ b/services/character-sheet/src/modules/character-sheet/character-sheet.e2e-spec.ts @@ -145,15 +145,16 @@ describe('/character-sheets', () => { CharacterSheetRepository, ); - const characterSheet = await FakerFactory.create( - CreateCharacterSheetDto, - {}, - { optionals: true }, + const characterSheet = await characterSheetRepository.create( + await FakerFactory.create( + CreateCharacterSheetDto, + {}, + { optionals: true }, + ), ); - await characterSheetRepository.create(characterSheet); const result = await supertest(app.getHttpServer()) - .delete(`/character-sheets/${characterSheet._id}`) + .delete(`/character-sheets/${characterSheet!._id}`) .expect(200); expect(result.body).toMatchObject( diff --git a/services/character-sheet/src/modules/character-sheet/create-character-sheet-dto.ts b/services/character-sheet/src/modules/character-sheet/create-character-sheet-dto.ts index 1c244ec6..0cccaa39 100644 --- a/services/character-sheet/src/modules/character-sheet/create-character-sheet-dto.ts +++ b/services/character-sheet/src/modules/character-sheet/create-character-sheet-dto.ts @@ -9,13 +9,6 @@ import { v4 } from 'uuid'; import { ArchetypeId, ArchetypeIds } from '../../data/archetype'; export class CreateCharacterSheetDto { - @ApiProperty({ - default: v4(), - }) - @IsUuidV4() - @IsOptional() - public _id?: string; - @ApiProperty({ default: v4(), }) diff --git a/services/character-sheet/src/modules/npc/npc.controller.ts b/services/character-sheet/src/modules/npc/npc.controller.ts index 9b523b81..efff4bc5 100644 --- a/services/character-sheet/src/modules/npc/npc.controller.ts +++ b/services/character-sheet/src/modules/npc/npc.controller.ts @@ -56,8 +56,7 @@ export class NpcController { affiliation: [], }); - const character = - await this._characterSheetRepository.create(characterSheet); + const character = await this._characterSheetRepository.create(characterSheet); return character!.toJSON(); } diff --git a/services/design-system/package.json b/services/design-system/package.json index ceebc072..0c53c935 100644 --- a/services/design-system/package.json +++ b/services/design-system/package.json @@ -46,7 +46,7 @@ } ], "dependencies": { - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@emotion/react": "~11.11.1", "@emotion/styled": "11.11.0", "@mui/material": "~5.12.2", diff --git a/services/dialogue-service/package.json b/services/dialogue-service/package.json index 0ed81b13..1a1e8070 100644 --- a/services/dialogue-service/package.json +++ b/services/dialogue-service/package.json @@ -11,6 +11,6 @@ }, "devDependencies": { "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7" + "@cats-cradle/eslint-config": "1.0.8" } } diff --git a/services/email-service/package.json b/services/email-service/package.json index 6a4a91c7..dd63fceb 100644 --- a/services/email-service/package.json +++ b/services/email-service/package.json @@ -40,7 +40,7 @@ "node-cache": "5.1.2", "reflect-metadata": "0.1.13", "rxjs": "7.8.1", - "mongoose": "6.9.1", + "mongoose": "6.11.3", "source-map-support": "~0.5.21", "@nestjs/swagger": "~7.1.16", "uuid": "~9.0.1", @@ -71,7 +71,7 @@ "@types/express": "~4.17.18", "@types/uuid": "~9.0.6", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@nestjs/testing": "9.2.1", "supertest": "~6.3.3", "@types/supertest": "~2.0.14", diff --git a/services/graphql/package.json b/services/graphql/package.json index 7819be36..f5338319 100644 --- a/services/graphql/package.json +++ b/services/graphql/package.json @@ -47,7 +47,7 @@ "@nestjs/axios": "~2.0.0" }, "devDependencies": { - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "aws-cdk-lib": "2.95.0", "constructs": "^10.2.70", "@types/jest": "29.5.8", diff --git a/services/html-to-pdf/package.json b/services/html-to-pdf/package.json index 03a2cc89..a9527dcb 100644 --- a/services/html-to-pdf/package.json +++ b/services/html-to-pdf/package.json @@ -64,7 +64,7 @@ "axios": "^0.21.1" }, "devDependencies": { - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "aws-cdk-lib": "2.95.0", "constructs": "^10.2.70", "@types/jest": "29.5.8", diff --git a/services/instances/package.json b/services/instances/package.json index b79133e8..f78dfefc 100644 --- a/services/instances/package.json +++ b/services/instances/package.json @@ -47,7 +47,7 @@ "@nestjs/config": "2.2.0", "@cats-cradle/create-bundle": "1.0.7", "@nestjs/mongoose": "9.2.1", - "mongoose": "6.9.1" + "mongoose": "6.11.3" }, "devDependencies": { "@shelf/jest-mongodb": "~4.1.7", @@ -66,7 +66,7 @@ "@types/express": "~4.17.18", "@types/uuid": "~9.0.6", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@nestjs/testing": "9.2.1", "supertest": "~6.3.3", "@types/supertest": "~2.0.14", diff --git a/services/instances/src/module/instances/create.dto.ts b/services/instances/src/module/instances/create.dto.ts index de0d47e1..f5a7b500 100644 --- a/services/instances/src/module/instances/create.dto.ts +++ b/services/instances/src/module/instances/create.dto.ts @@ -10,5 +10,5 @@ export class CreateDto { default: v4(), type: String, }) - playerId: string; + playerId: string; } diff --git a/services/jukebox/package.json b/services/jukebox/package.json index 3f1bdef7..a1b1709c 100644 --- a/services/jukebox/package.json +++ b/services/jukebox/package.json @@ -64,7 +64,7 @@ "@types/express": "~4.17.18", "@types/uuid": "~9.0.6", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@nestjs/testing": "9.2.1", "supertest": "~6.3.3", "@types/supertest": "~2.0.14", diff --git a/services/luck-by-dice/package.json b/services/luck-by-dice/package.json index 398c7471..ef8c2162 100644 --- a/services/luck-by-dice/package.json +++ b/services/luck-by-dice/package.json @@ -52,7 +52,7 @@ "@nestjs/axios": "~2.0.0" }, "devDependencies": { - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "aws-cdk-lib": "2.95.0", "constructs": "^10.2.70", "@types/jest": "29.5.8", diff --git a/services/player-achievements/openapi-spec.json b/services/player-achievements/openapi-spec.json index 36720b5e..c6585dfc 100644 --- a/services/player-achievements/openapi-spec.json +++ b/services/player-achievements/openapi-spec.json @@ -161,12 +161,12 @@ "playerId": { "type": "string", "description": "The playerId", - "default": "1f03f1ff-c00f-41df-8ea4-74d417b0c93b" + "default": "264cc43a-cdf3-4417-bd2d-1983dd7915ea" }, "achievementId": { "type": "string", "description": "The achievementId", - "default": "22dd9506-6368-4db6-b7e4-098c37146dcd" + "default": "67a239f8-79a1-41c5-8bec-a7fa6c3f8470" }, "progress": { "type": "number", @@ -182,7 +182,7 @@ "id": { "type": "string", "description": "The playerAchievementId", - "default": "a336088b-56b9-4f13-8a78-76e610c12c35" + "default": "ba8d6a65-a537-405f-9662-b250526975d8" } }, "required": ["id"] diff --git a/services/player-achievements/package.json b/services/player-achievements/package.json index f76b3052..e531a87a 100644 --- a/services/player-achievements/package.json +++ b/services/player-achievements/package.json @@ -51,7 +51,7 @@ "@nestjs/config": "2.2.0", "@cats-cradle/create-bundle": "1.0.7", "@nestjs/mongoose": "9.2.1", - "mongoose": "6.9.1", + "mongoose": "6.11.3", "mongodb": "6.0.0", "dotenv": "~16.0.3", "bson": "~6.2.0", @@ -74,7 +74,7 @@ "@types/express": "~4.17.18", "@types/uuid": "~9.0.6", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@nestjs/testing": "9.2.1", "supertest": "~6.3.3", "@types/supertest": "~2.0.14", diff --git a/services/player-achievements/src/models/achievement.schema.ts b/services/player-achievements/src/models/achievement.schema.ts index 36b89452..dd293e27 100644 --- a/services/player-achievements/src/models/achievement.schema.ts +++ b/services/player-achievements/src/models/achievement.schema.ts @@ -1,6 +1,7 @@ /* eslint-disable func-names */ -// import { BaseEntity, BaseEntityProps } from '@cats-cradle/nestjs-modules'; -import { Prop, Schema, SchemaFactory, raw } from '@nestjs/mongoose'; +import { + Prop, Schema, SchemaFactory, raw, +} from '@nestjs/mongoose'; import { Document } from 'mongoose'; import { ArrayMaxSize, diff --git a/services/player-achievements/src/models/player-achievement.schema.ts b/services/player-achievements/src/models/player-achievement.schema.ts index d9d3392a..b8d5b72a 100644 --- a/services/player-achievements/src/models/player-achievement.schema.ts +++ b/services/player-achievements/src/models/player-achievement.schema.ts @@ -1,7 +1,7 @@ /* eslint-disable func-names */ import { BaseEntity, BaseEntityProps } from '@cats-cradle/nestjs-modules'; import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; -import { Document } from 'mongoose'; +import { Document, Schema as MongooseSchema } from 'mongoose'; import { IsNumber, IsUuidV4 } from '@cats-cradle/validation-schemas'; import { v4 } from 'uuid'; import { Achievement } from './achievement.schema'; @@ -16,10 +16,11 @@ export class PlayerAchievement extends BaseEntity { public playerId: string; @IsUuidV4() - // @Transform(({ value }) => new UUID(value) as unknown as MongooseSchema.Types.ObjectId) - // @Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Achievement' }) - @Prop({ type: String, ref: 'Achievement' }) - public achievementId: Achievement; + @Prop({ + type: MongooseSchema.Types.UUID, + ref: 'Achievement', + }) + public achievement: MongooseSchema.Types.UUID | Achievement; @IsNumber() @Prop({ diff --git a/services/player-achievements/src/module/player-achievements/create.dto.ts b/services/player-achievements/src/module/player-achievements/create.dto.ts index b3aac971..b4c9c9d7 100644 --- a/services/player-achievements/src/module/player-achievements/create.dto.ts +++ b/services/player-achievements/src/module/player-achievements/create.dto.ts @@ -9,7 +9,7 @@ export class CreateDto { default: v4(), type: String, }) - playerId: string; + playerId: string; @IsUuidV4() @ApiProperty({ @@ -17,7 +17,7 @@ export class CreateDto { default: v4(), type: String, }) - achievementId: string; + achievementId: string; @IsNumber() @ApiProperty({ @@ -25,5 +25,5 @@ export class CreateDto { default: 0, type: Number, }) - progress: number; + progress: number; } diff --git a/services/player-achievements/src/module/player-achievements/player-achievements.controller.ts b/services/player-achievements/src/module/player-achievements/player-achievements.controller.ts index 1837c125..ac1558ff 100644 --- a/services/player-achievements/src/module/player-achievements/player-achievements.controller.ts +++ b/services/player-achievements/src/module/player-achievements/player-achievements.controller.ts @@ -47,7 +47,7 @@ export class PlayerAchievementController { const playerAchievement = await this._playerAchievementRepository.create( new PlayerAchievement({ playerId: body.playerId, - achievementId: achievement!._id, + achievement: achievement!._id, progress: body.progress, }), ); diff --git a/services/player-achievements/src/module/player-achievements/player-achievements.e2e-spec.ts b/services/player-achievements/src/module/player-achievements/player-achievements.e2e-spec.ts index d163751f..8ad85468 100644 --- a/services/player-achievements/src/module/player-achievements/player-achievements.e2e-spec.ts +++ b/services/player-achievements/src/module/player-achievements/player-achievements.e2e-spec.ts @@ -83,7 +83,7 @@ describe('/player-achievements', () => { const records = await FakerFactory.createMany( PlayerAchievement, { - achievementId: achievement!.id, + achievement: achievement!.id, createdAt: new Date().toISOString(), }, { min: 1, max: 4, optionals: false }, @@ -137,7 +137,7 @@ describe('/player-achievements', () => { }); describe('POST /player-achievements', () => { - it('should create an player-achievements', async () => { + it.only('should create an player-achievements', async () => { const achievement = await achievementRepository.create( await FakerFactory.create( Achievement, @@ -160,6 +160,7 @@ describe('/player-achievements', () => { { id: response.body.id, }, + { populate: 'achievement' }, ); expect(response.body.id).toEqual(playerAchievement?.id); @@ -202,8 +203,7 @@ describe('/player-achievements', () => { await asyncForEach( records, async (playerAchievement: PlayerAchievement) => { - lastRecord = - await playerAchievementRepository.create(playerAchievement); + lastRecord = await playerAchievementRepository.create(playerAchievement); }, ); diff --git a/services/weather-control/package.json b/services/weather-control/package.json index 07495cee..c33fa4a8 100644 --- a/services/weather-control/package.json +++ b/services/weather-control/package.json @@ -65,7 +65,7 @@ "@types/express": "~4.17.18", "@types/uuid": "~9.0.6", "eslint": "8.52.0", - "@cats-cradle/eslint-config": "1.0.7", + "@cats-cradle/eslint-config": "1.0.8", "@nestjs/testing": "9.2.1", "supertest": "~6.3.3", "@types/supertest": "~2.0.14",