From 547c8a9da1955d99c0d681bcea3db7190a1185e9 Mon Sep 17 00:00:00 2001 From: Shai Yallin Date: Thu, 16 May 2024 13:12:31 +0300 Subject: [PATCH] some more examples --- package.json | 1 + packages/server/package.json | 2 + .../server/src/adapters/mongodb.module.ts | 19 +- packages/server/src/controllers.ts | 28 +- packages/server/src/index.ts | 56 ++-- packages/server/src/zodValidationPipe.ts | 15 + packages/server/test/purchase.system.spec.ts | 46 +++ yarn.lock | 296 +++++++++++++++++- 8 files changed, 405 insertions(+), 58 deletions(-) create mode 100644 packages/server/src/zodValidationPipe.ts create mode 100644 packages/server/test/purchase.system.spec.ts diff --git a/package.json b/package.json index b4be3e7..9f9c449 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "jsdom": "^21.1.2" }, "dependencies": { + "@nestjs/config": "^3.2.2", "winston": "^3.10.0" } } diff --git a/packages/server/package.json b/packages/server/package.json index 283ab3c..c414ca5 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -16,8 +16,10 @@ "@nestjs/testing": "^10.3.7", "@types/jest": "^28.1.8", "@types/node": "^20.7.1", + "@types/supertest": "^6.0.2", "jest": "^28.1.3", "nodemon": "^3.0.1", + "supertest": "^7.0.0", "ts-jest": "^28.0.8" }, "dependencies": { diff --git a/packages/server/src/adapters/mongodb.module.ts b/packages/server/src/adapters/mongodb.module.ts index 4e117d8..da534f0 100644 --- a/packages/server/src/adapters/mongodb.module.ts +++ b/packages/server/src/adapters/mongodb.module.ts @@ -1,12 +1,17 @@ -import {MongoClient} from "mongodb"; +import {MongoClient, MongoClientOptions} from "mongodb"; import {DynamicModule} from "@nestjs/common"; import {CART_REPO, ORDER_REPO, PRODUCT_REPO} from "./index"; import {MongoDBProductRepository} from "./product.repo"; import {MongoDBOrderRepository} from "./order.repo"; import {MemoryCartRepository} from "./cart.repo"; +type Config = { + uri: string; + dbName: string; +} & Pick + export class MongoDBModule { - static forRoot(uri: string): DynamicModule { + static forRoot({uri, dbName, ...config}: Config): DynamicModule { return { module: MongoDBModule, @@ -14,13 +19,9 @@ export class MongoDBModule { { provide: "storeDB", useFactory: async () => { - const mongo = await new MongoClient(uri, { - connectTimeoutMS: 100, - serverSelectionTimeoutMS: 100, - socketTimeoutMS: 100 - }).connect(); + const mongo = await new MongoClient(uri, config).connect(); - return mongo.db("store"); + return mongo.db(dbName); }, }, { @@ -39,4 +40,4 @@ export class MongoDBModule { exports: [PRODUCT_REPO, ORDER_REPO, CART_REPO] } } -} \ No newline at end of file +} diff --git a/packages/server/src/controllers.ts b/packages/server/src/controllers.ts index 364cedb..b527b01 100644 --- a/packages/server/src/controllers.ts +++ b/packages/server/src/controllers.ts @@ -1,32 +1,10 @@ -import { - ArgumentMetadata, - BadRequestException, - Body, - Controller, - Get, Inject, - Param, - PipeTransform, - Post, - UsePipes -} from '@nestjs/common'; -import { ZodSchema} from 'zod'; -import { ProductRepository } from './adapters/product.repo'; +import {BadRequestException, Body, Controller, Get, Inject, Param, Post, UsePipes} from '@nestjs/common'; +import {ProductRepository} from './adapters/product.repo'; import {ProductTemplate} from "./types"; import {OrderRepository} from "./adapters/order.repo"; import {CartRepository} from "./adapters/cart.repo"; import {CART_REPO, ORDER_REPO, PRODUCT_REPO} from "./adapters"; - -export class ZodValidationPipe implements PipeTransform { - constructor(private schema: ZodSchema) {} - - transform(value: unknown, metadata: ArgumentMetadata) { - try { - return this.schema.parse(value); - } catch (error) { - throw new BadRequestException(`failed parsing value ${value} into type ${metadata.type} with ${error}`); - } - } -} +import {ZodValidationPipe} from "./zodValidationPipe"; @Controller("/products") export class ProductController { diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index c9f39b8..71c9a5d 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -1,40 +1,56 @@ -import { MongoClient } from "mongodb"; -import { MongoDBOrderRepository } from "./adapters/order.repo"; -import { MongoDBProductRepository } from "./adapters/product.repo"; +import {MongoClient} from "mongodb"; +import {MongoDBOrderRepository} from "./adapters/order.repo"; +import {MongoDBProductRepository} from "./adapters/product.repo"; import {NestFactory} from "@nestjs/core"; import {AppModuleInversionOfControl} from "./app.module.ioc"; import {AppModuleOverrides} from "./app.module.overrides"; import {AppModuleWithRegister} from "./app.module.register"; import {MongoDBModule} from "./adapters/mongodb.module"; +import {z} from "zod"; + +const EnvConfig = z.object({ + MONGO_URI: z.string().default('mongodb://root:password@127.0.0.1'), + MONGO_DB: z.string().default('store'), + MONGO_CONNECT_TIMEOUT: z.number().default(100), + MONGO_SOCKET_TIMEOUT: z.number().default(100), + MONGO_SERVER_SELECTION_TIMEOUT: z.number().default(100), +}).transform((input) => ({ + uri: input.MONGO_URI, + dbName: input.MONGO_DB, + connectTimeoutMS: input.MONGO_CONNECT_TIMEOUT, + socketTimeoutMS: input.MONGO_SOCKET_TIMEOUT, + serverSelectionTimeoutMS: input.MONGO_SERVER_SELECTION_TIMEOUT, +})); // @ts-ignore async function startServerIoC() { - const mongo = await new MongoClient( - `mongodb://root:password@127.0.0.1?retryWrites=true&writeConcern=majority` - ).connect(); + const mongo = await new MongoClient( + `mongodb://root:password@127.0.0.1?retryWrites=true&writeConcern=majority` + ).connect(); - const db = mongo.db("store"); - const productRepo = new MongoDBProductRepository(db); - const orderRepo = new MongoDBOrderRepository(db); + const db = mongo.db("store"); + const productRepo = new MongoDBProductRepository(db); + const orderRepo = new MongoDBOrderRepository(db); - const app = await NestFactory.create(AppModuleInversionOfControl.register(productRepo, orderRepo)) - app.enableCors({origin: "*"}); - await app.listen(8080); + const app = await NestFactory.create(AppModuleInversionOfControl.register(productRepo, orderRepo)) + app.enableCors({origin: "*"}); + await app.listen(8080); } // @ts-ignore async function startServerOverrides() { - const app = await NestFactory.create(AppModuleOverrides) - app.enableCors({origin: "*"}); - await app.listen(8080); + const app = await NestFactory.create(AppModuleOverrides) + app.enableCors({origin: "*"}); + await app.listen(8080); } async function startServerRegister() { - const app = await NestFactory.create(AppModuleWithRegister.register( - MongoDBModule.forRoot(`mongodb://root:password@127.0.0.1`) - )); - app.enableCors({origin: "*"}); - await app.listen(8080); + const config = EnvConfig.parse(process.env); + const app = await NestFactory.create(AppModuleWithRegister.register( + MongoDBModule.forRoot(config) + )); + app.enableCors({origin: "*"}); + await app.listen(8080); } void startServerRegister(); diff --git a/packages/server/src/zodValidationPipe.ts b/packages/server/src/zodValidationPipe.ts new file mode 100644 index 0000000..1ae16e6 --- /dev/null +++ b/packages/server/src/zodValidationPipe.ts @@ -0,0 +1,15 @@ +import {ArgumentMetadata, BadRequestException, PipeTransform} from "@nestjs/common"; +import {ZodSchema} from "zod"; + +export class ZodValidationPipe implements PipeTransform { + constructor(private schema: ZodSchema) { + } + + transform(value: unknown, {type}: ArgumentMetadata) { + try { + return this.schema.parse(value); + } catch (error) { + throw new BadRequestException(`failed parsing value ${value} into type ${type} with ${error}`); + } + } +} \ No newline at end of file diff --git a/packages/server/test/purchase.system.spec.ts b/packages/server/test/purchase.system.spec.ts new file mode 100644 index 0000000..b21d719 --- /dev/null +++ b/packages/server/test/purchase.system.spec.ts @@ -0,0 +1,46 @@ +import {createTestingModule} from "../src/server.testkit"; +import {aProduct} from "../src/builders"; +import request from 'supertest'; + +async function createTestHarness() { + const {nest, ...rest} = await createTestingModule(); + return { + app: request(nest.getHttpServer()), + ...rest + } +} + +// this test is not really required, it's wholly contained within purchase.flow.spec.tsx +test('a user can order a product', async () => { + const {app, productRepo, orderRepo} = await createTestHarness(); + + const moogOne = await productRepo.create(aProduct({title: "Moog One"})); + const cartId = '666'; + + await app + .post(`/cart/${cartId}`) + .send({productId: moogOne.id}) + .expect(201); + + await app + .get(`/cart/${cartId}`) + .expect({id: cartId, items: [{ + productId: moogOne.id, + price: moogOne.price, + name: moogOne.title + }]}); + + const orderId = await app + .post(`/checkout/${666}`) + .expect(201) + .then(response => response.text); + + expect(orderRepo.orders).toContainEqual(expect.objectContaining({ + id: orderId, + items: expect.arrayContaining([ + expect.objectContaining({ + productId: moogOne.id, + }) + ]) + })); +}); \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 6be5c66..bb5ee19 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1577,6 +1577,21 @@ __metadata: languageName: node linkType: hard +"@nestjs/config@npm:^3.2.2": + version: 3.2.2 + resolution: "@nestjs/config@npm:3.2.2" + dependencies: + dotenv: 16.4.5 + dotenv-expand: 10.0.0 + lodash: 4.17.21 + uuid: 9.0.1 + peerDependencies: + "@nestjs/common": ^8.0.0 || ^9.0.0 || ^10.0.0 + rxjs: ^7.1.0 + checksum: 1f677ff4ea13dc7d9c27e094965101ea661dd1ec362aed8f188413037dac21c08f71967add551cad5a3d21301c66d4c61815ed709bf101afaa0fd0aa0f4bf14c + languageName: node + linkType: hard + "@nestjs/core@npm:^10.3.7": version: 10.3.7 resolution: "@nestjs/core@npm:10.3.7" @@ -1960,6 +1975,7 @@ __metadata: "@nestjs/testing": ^10.3.7 "@types/jest": ^28.1.8 "@types/node": ^20.7.1 + "@types/supertest": ^6.0.2 fastify: ^4.23.2 fastify-type-provider-zod: ^1.1.9 jest: ^28.1.3 @@ -1968,6 +1984,7 @@ __metadata: nodemon: ^3.0.1 reflect-metadata: ^0.2.2 rxjs: ^7.8.1 + supertest: ^7.0.0 ts-byob: ^1.0.3 ts-jest: ^28.0.8 ts-node: ^10.9.1 @@ -2125,6 +2142,13 @@ __metadata: languageName: node linkType: hard +"@types/cookiejar@npm:^2.1.5": + version: 2.1.5 + resolution: "@types/cookiejar@npm:2.1.5" + checksum: 04d5990e87b6387532d15a87d9ec9b2eb783039291193863751dcfd7fc723a3b3aa30ce4c06b03975cba58632e933772f1ff031af23eaa3ac7f94e71afa6e073 + languageName: node + linkType: hard + "@types/express-serve-static-core@npm:^4.17.33": version: 4.17.33 resolution: "@types/express-serve-static-core@npm:4.17.33" @@ -2220,6 +2244,13 @@ __metadata: languageName: node linkType: hard +"@types/methods@npm:^1.1.4": + version: 1.1.4 + resolution: "@types/methods@npm:1.1.4" + checksum: ad2a7178486f2fd167750f3eb920ab032a947ff2e26f55c86670a6038632d790b46f52e5b6ead5823f1e53fc68028f1e9ddd15cfead7903e04517c88debd72b1 + languageName: node + linkType: hard + "@types/mime@npm:*": version: 3.0.1 resolution: "@types/mime@npm:3.0.1" @@ -2333,6 +2364,27 @@ __metadata: languageName: node linkType: hard +"@types/superagent@npm:^8.1.0": + version: 8.1.7 + resolution: "@types/superagent@npm:8.1.7" + dependencies: + "@types/cookiejar": ^2.1.5 + "@types/methods": ^1.1.4 + "@types/node": "*" + checksum: 8f80c72bd1cc9a9295a2e1e8a7a8de9bef09348db63f33cc4f61e457917662064ab86ce013f28249c34d7239d9a4415c1a597dc70d4391b2ad83b338a63a3b73 + languageName: node + linkType: hard + +"@types/supertest@npm:^6.0.2": + version: 6.0.2 + resolution: "@types/supertest@npm:6.0.2" + dependencies: + "@types/methods": ^1.1.4 + "@types/superagent": ^8.1.0 + checksum: 1eafa472665757a6fd984439d11f388ae0480c6d243a6884066c474c4e0357de5373316488da503b1690c3163e075ca8c64c0c4853b3bb7deb09e05d1b64e556 + languageName: node + linkType: hard + "@types/testing-library__jest-dom@npm:^5.9.1": version: 5.14.5 resolution: "@types/testing-library__jest-dom@npm:5.14.5" @@ -2711,6 +2763,13 @@ __metadata: languageName: node linkType: hard +"asap@npm:^2.0.0": + version: 2.0.6 + resolution: "asap@npm:2.0.6" + checksum: b296c92c4b969e973260e47523207cd5769abd27c245a68c26dc7a0fe8053c55bb04360237cb51cab1df52be939da77150ace99ad331fb7fb13b3423ed73ff3d + languageName: node + linkType: hard + "assertion-error@npm:^1.1.0": version: 1.1.0 resolution: "assertion-error@npm:1.1.0" @@ -3083,6 +3142,19 @@ __metadata: languageName: node linkType: hard +"call-bind@npm:^1.0.7": + version: 1.0.7 + resolution: "call-bind@npm:1.0.7" + dependencies: + es-define-property: ^1.0.0 + es-errors: ^1.3.0 + function-bind: ^1.1.2 + get-intrinsic: ^1.2.4 + set-function-length: ^1.2.1 + checksum: 295c0c62b90dd6522e6db3b0ab1ce26bdf9e7404215bda13cfee25b626b5ff1a7761324d58d38b1ef1607fc65aca2d06e44d2e18d0dfc6c14b465b00d8660029 + languageName: node + linkType: hard + "callsites@npm:^3.0.0": version: 3.1.0 resolution: "callsites@npm:3.1.0" @@ -3372,6 +3444,13 @@ __metadata: languageName: node linkType: hard +"component-emitter@npm:^1.3.0": + version: 1.3.1 + resolution: "component-emitter@npm:1.3.1" + checksum: 94550aa462c7bd5a61c1bc480e28554aa306066930152d1b1844a0dd3845d4e5db7e261ddec62ae184913b3e59b55a2ad84093b9d3596a8f17c341514d6c483d + languageName: node + linkType: hard + "concat-map@npm:0.0.1": version: 0.0.1 resolution: "concat-map@npm:0.0.1" @@ -3480,6 +3559,13 @@ __metadata: languageName: node linkType: hard +"cookiejar@npm:^2.1.4": + version: 2.1.4 + resolution: "cookiejar@npm:2.1.4" + checksum: c4442111963077dc0e5672359956d6556a195d31cbb35b528356ce5f184922b99ac48245ac05ed86cf993f7df157c56da10ab3efdadfed79778a0d9b1b092d5b + languageName: node + linkType: hard + "core-util-is@npm:~1.0.0": version: 1.0.3 resolution: "core-util-is@npm:1.0.3" @@ -3695,6 +3781,17 @@ __metadata: languageName: node linkType: hard +"define-data-property@npm:^1.1.4": + version: 1.1.4 + resolution: "define-data-property@npm:1.1.4" + dependencies: + es-define-property: ^1.0.0 + es-errors: ^1.3.0 + gopd: ^1.0.1 + checksum: 8068ee6cab694d409ac25936eb861eea704b7763f7f342adbdfe337fc27c78d7ae0eff2364b2917b58c508d723c7a074326d068eef2e45c4edcd85cf94d0313b + languageName: node + linkType: hard + "define-properties@npm:^1.1.3, define-properties@npm:^1.1.4": version: 1.2.0 resolution: "define-properties@npm:1.2.0" @@ -3754,6 +3851,16 @@ __metadata: languageName: node linkType: hard +"dezalgo@npm:^1.0.4": + version: 1.0.4 + resolution: "dezalgo@npm:1.0.4" + dependencies: + asap: ^2.0.0 + wrappy: 1 + checksum: 895389c6aead740d2ab5da4d3466d20fa30f738010a4d3f4dcccc9fc645ca31c9d10b7e1804ae489b1eb02c7986f9f1f34ba132d409b043082a86d9a4e745624 + languageName: node + linkType: hard + "diff-sequences@npm:^28.1.1": version: 28.1.1 resolution: "diff-sequences@npm:28.1.1" @@ -3839,6 +3946,13 @@ __metadata: languageName: node linkType: hard +"dotenv-expand@npm:10.0.0": + version: 10.0.0 + resolution: "dotenv-expand@npm:10.0.0" + checksum: 2a38b470efe0abcb1ac8490421a55e1d764dc9440fd220942bce40965074f3fb00b585f4346020cb0f0f219966ee6b4ee5023458b3e2953fe5b3214de1b314ee + languageName: node + linkType: hard + "dotenv-expand@npm:^8.0.2": version: 8.0.3 resolution: "dotenv-expand@npm:8.0.3" @@ -3846,6 +3960,13 @@ __metadata: languageName: node linkType: hard +"dotenv@npm:16.4.5": + version: 16.4.5 + resolution: "dotenv@npm:16.4.5" + checksum: 301a12c3d44fd49888b74eb9ccf9f07a1f5df43f489e7fcb89647a2edcd84c42d6bc349dc8df099cd18f07c35c7b04685c1a4f3e6a6a9e6b30f8d48c15b7f49c + languageName: node + linkType: hard + "dotenv@npm:^16.0.0": version: 16.0.3 resolution: "dotenv@npm:16.0.3" @@ -3959,6 +4080,22 @@ __metadata: languageName: node linkType: hard +"es-define-property@npm:^1.0.0": + version: 1.0.0 + resolution: "es-define-property@npm:1.0.0" + dependencies: + get-intrinsic: ^1.2.4 + checksum: f66ece0a887b6dca71848fa71f70461357c0e4e7249696f81bad0a1f347eed7b31262af4a29f5d726dc026426f085483b6b90301855e647aa8e21936f07293c6 + languageName: node + linkType: hard + +"es-errors@npm:^1.3.0": + version: 1.3.0 + resolution: "es-errors@npm:1.3.0" + checksum: ec1414527a0ccacd7f15f4a3bc66e215f04f595ba23ca75cdae0927af099b5ec865f9f4d33e9d7e86f512f252876ac77d4281a7871531a50678132429b1271b5 + languageName: node + linkType: hard + "es-get-iterator@npm:^1.1.2": version: 1.1.3 resolution: "es-get-iterator@npm:1.1.3" @@ -4396,7 +4533,7 @@ __metadata: languageName: node linkType: hard -"fast-safe-stringify@npm:2.1.1": +"fast-safe-stringify@npm:2.1.1, fast-safe-stringify@npm:^2.1.1": version: 2.1.1 resolution: "fast-safe-stringify@npm:2.1.1" checksum: a851cbddc451745662f8f00ddb622d6766f9bd97642dabfd9a405fb0d646d69fc0b9a1243cbf67f5f18a39f40f6fa821737651ff1bceeba06c9992ca2dc5bd3d @@ -4569,6 +4706,17 @@ __metadata: languageName: node linkType: hard +"formidable@npm:^3.5.1": + version: 3.5.1 + resolution: "formidable@npm:3.5.1" + dependencies: + dezalgo: ^1.0.4 + hexoid: ^1.0.0 + once: ^1.4.0 + checksum: 46b21496f9f985161cf7636163147b6728f9997c7e1d59433680d92619758bf6862330e6d105b5816bafcd1ab32f27ef183455991f93ef836ea731c68db62af9 + languageName: node + linkType: hard + "forwarded@npm:0.2.0": version: 0.2.0 resolution: "forwarded@npm:0.2.0" @@ -4655,6 +4803,13 @@ __metadata: languageName: node linkType: hard +"function-bind@npm:^1.1.2": + version: 1.1.2 + resolution: "function-bind@npm:1.1.2" + checksum: 2b0ff4ce708d99715ad14a6d1f894e2a83242e4a52ccfcefaee5e40050562e5f6dafc1adbb4ce2d4ab47279a45dc736ab91ea5042d843c3c092820dfe032efb1 + languageName: node + linkType: hard + "functions-have-names@npm:^1.2.2": version: 1.2.3 resolution: "functions-have-names@npm:1.2.3" @@ -4717,6 +4872,19 @@ __metadata: languageName: node linkType: hard +"get-intrinsic@npm:^1.2.4": + version: 1.2.4 + resolution: "get-intrinsic@npm:1.2.4" + dependencies: + es-errors: ^1.3.0 + function-bind: ^1.1.2 + has-proto: ^1.0.1 + has-symbols: ^1.0.3 + hasown: ^2.0.0 + checksum: 414e3cdf2c203d1b9d7d33111df746a4512a1aa622770b361dadddf8ed0b5aeb26c560f49ca077e24bfafb0acb55ca908d1f709216ccba33ffc548ec8a79a951 + languageName: node + linkType: hard + "get-package-type@npm:^0.1.0": version: 0.1.0 resolution: "get-package-type@npm:0.1.0" @@ -4820,6 +4988,22 @@ __metadata: languageName: node linkType: hard +"has-property-descriptors@npm:^1.0.2": + version: 1.0.2 + resolution: "has-property-descriptors@npm:1.0.2" + dependencies: + es-define-property: ^1.0.0 + checksum: fcbb246ea2838058be39887935231c6d5788babed499d0e9d0cc5737494c48aba4fe17ba1449e0d0fbbb1e36175442faa37f9c427ae357d6ccb1d895fbcd3de3 + languageName: node + linkType: hard + +"has-proto@npm:^1.0.1": + version: 1.0.3 + resolution: "has-proto@npm:1.0.3" + checksum: fe7c3d50b33f50f3933a04413ed1f69441d21d2d2944f81036276d30635cad9279f6b43bc8f32036c31ebdfcf6e731150f46c1907ad90c669ffe9b066c3ba5c4 + languageName: node + linkType: hard + "has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3": version: 1.0.3 resolution: "has-symbols@npm:1.0.3" @@ -4852,6 +5036,15 @@ __metadata: languageName: node linkType: hard +"hasown@npm:^2.0.0": + version: 2.0.2 + resolution: "hasown@npm:2.0.2" + dependencies: + function-bind: ^1.1.2 + checksum: e8516f776a15149ca6c6ed2ae3110c417a00b62260e222590e54aa367cbcd6ed99122020b37b7fbdf05748df57b265e70095d7bf35a47660587619b15ffb93db + languageName: node + linkType: hard + "he@npm:1.2.0, he@npm:^1.2.0": version: 1.2.0 resolution: "he@npm:1.2.0" @@ -4861,6 +5054,13 @@ __metadata: languageName: node linkType: hard +"hexoid@npm:^1.0.0": + version: 1.0.0 + resolution: "hexoid@npm:1.0.0" + checksum: 27a148ca76a2358287f40445870116baaff4a0ed0acc99900bf167f0f708ffd82e044ff55e9949c71963852b580fc024146d3ac6d5d76b508b78d927fa48ae2d + languageName: node + linkType: hard + "html-encoding-sniffer@npm:^3.0.0": version: 3.0.0 resolution: "html-encoding-sniffer@npm:3.0.0" @@ -6120,7 +6320,7 @@ __metadata: languageName: node linkType: hard -"lodash@npm:^4.17.15": +"lodash@npm:4.17.21, lodash@npm:^4.17.15": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 @@ -6307,7 +6507,7 @@ __metadata: languageName: node linkType: hard -"methods@npm:~1.1.2": +"methods@npm:^1.1.2, methods@npm:~1.1.2": version: 1.1.2 resolution: "methods@npm:1.1.2" checksum: 0917ff4041fa8e2f2fda5425a955fe16ca411591fbd123c0d722fcf02b73971ed6f764d85f0a6f547ce49ee0221ce2c19a5fa692157931cecb422984f1dcd13a @@ -6356,6 +6556,15 @@ __metadata: languageName: node linkType: hard +"mime@npm:2.6.0": + version: 2.6.0 + resolution: "mime@npm:2.6.0" + bin: + mime: cli.js + checksum: 1497ba7b9f6960694268a557eae24b743fd2923da46ec392b042469f4b901721ba0adcf8b0d3c2677839d0e243b209d76e5edcbd09cfdeffa2dfb6bb4df4b862 + languageName: node + linkType: hard + "mimic-fn@npm:^2.1.0": version: 2.1.0 resolution: "mimic-fn@npm:2.1.0" @@ -6811,6 +7020,13 @@ __metadata: languageName: node linkType: hard +"object-inspect@npm:^1.13.1": + version: 1.13.1 + resolution: "object-inspect@npm:1.13.1" + checksum: 7d9fa9221de3311dcb5c7c307ee5dc011cdd31dc43624b7c184b3840514e118e05ef0002be5388304c416c0eb592feb46e983db12577fc47e47d5752fbbfb61f + languageName: node + linkType: hard + "object-inspect@npm:^1.9.0": version: 1.12.3 resolution: "object-inspect@npm:1.12.3" @@ -6877,7 +7093,7 @@ __metadata: languageName: node linkType: hard -"once@npm:^1.3.0": +"once@npm:^1.3.0, once@npm:^1.4.0": version: 1.4.0 resolution: "once@npm:1.4.0" dependencies: @@ -7360,6 +7576,15 @@ __metadata: languageName: node linkType: hard +"qs@npm:^6.11.0": + version: 6.12.1 + resolution: "qs@npm:6.12.1" + dependencies: + side-channel: ^1.0.6 + checksum: aa761d99e65b6936ba2dd2187f2d9976afbcda38deb3ff1b3fe331d09b0c578ed79ca2abdde1271164b5be619c521ec7db9b34c23f49a074e5921372d16242d5 + languageName: node + linkType: hard + "querystringify@npm:^2.1.1": version: 2.2.0 resolution: "querystringify@npm:2.2.0" @@ -7729,6 +7954,7 @@ __metadata: version: 0.0.0-use.local resolution: "root@workspace:." dependencies: + "@nestjs/config": ^3.2.2 "@types/cookie-parser": ^1.4.4 cookie-parser: ^1.4.6 jsdom: ^21.1.2 @@ -7910,6 +8136,20 @@ __metadata: languageName: node linkType: hard +"set-function-length@npm:^1.2.1": + version: 1.2.2 + resolution: "set-function-length@npm:1.2.2" + dependencies: + define-data-property: ^1.1.4 + es-errors: ^1.3.0 + function-bind: ^1.1.2 + get-intrinsic: ^1.2.4 + gopd: ^1.0.1 + has-property-descriptors: ^1.0.2 + checksum: a8248bdacdf84cb0fab4637774d9fb3c7a8e6089866d04c817583ff48e14149c87044ce683d7f50759a8c50fb87c7a7e173535b06169c87ef76f5fb276dfff72 + languageName: node + linkType: hard + "setprototypeof@npm:1.2.0": version: 1.2.0 resolution: "setprototypeof@npm:1.2.0" @@ -7944,6 +8184,18 @@ __metadata: languageName: node linkType: hard +"side-channel@npm:^1.0.6": + version: 1.0.6 + resolution: "side-channel@npm:1.0.6" + dependencies: + call-bind: ^1.0.7 + es-errors: ^1.3.0 + get-intrinsic: ^1.2.4 + object-inspect: ^1.13.1 + checksum: bfc1afc1827d712271453e91b7cd3878ac0efd767495fd4e594c4c2afaa7963b7b510e249572bfd54b0527e66e4a12b61b80c061389e129755f34c493aad9b97 + languageName: node + linkType: hard + "siginfo@npm:^2.0.0": version: 2.0.0 resolution: "siginfo@npm:2.0.0" @@ -8233,6 +8485,33 @@ __metadata: languageName: node linkType: hard +"superagent@npm:^9.0.1": + version: 9.0.2 + resolution: "superagent@npm:9.0.2" + dependencies: + component-emitter: ^1.3.0 + cookiejar: ^2.1.4 + debug: ^4.3.4 + fast-safe-stringify: ^2.1.1 + form-data: ^4.0.0 + formidable: ^3.5.1 + methods: ^1.1.2 + mime: 2.6.0 + qs: ^6.11.0 + checksum: f471461b21f034d844fd0aca332128d61e3afb75c2ee5950f3339f2a3b5ca8b23e2861224f19ad9b43f21c9184d28b7d9384af5a4fde64fdef479efdb15036db + languageName: node + linkType: hard + +"supertest@npm:^7.0.0": + version: 7.0.0 + resolution: "supertest@npm:7.0.0" + dependencies: + methods: ^1.1.2 + superagent: ^9.0.1 + checksum: 974743aa511ec0f387135dfca05e378f6202366c81f0850dfbcc2c3d6fc690e856dda27e175c70db38510e21d87f331c0f62e1a942afea4c447953c647c26c8b + languageName: node + linkType: hard + "supports-color@npm:^5.3.0, supports-color@npm:^5.5.0": version: 5.5.0 resolution: "supports-color@npm:5.5.0" @@ -8747,6 +9026,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:9.0.1": + version: 9.0.1 + resolution: "uuid@npm:9.0.1" + bin: + uuid: dist/bin/uuid + checksum: 39931f6da74e307f51c0fb463dc2462807531dc80760a9bff1e35af4316131b4fc3203d16da60ae33f07fdca5b56f3f1dd662da0c99fea9aaeab2004780cc5f4 + languageName: node + linkType: hard + "v8-compile-cache-lib@npm:^3.0.1": version: 3.0.1 resolution: "v8-compile-cache-lib@npm:3.0.1"