From a8444ea4c5ef6ac6bd8b0e66f5b4945827c85710 Mon Sep 17 00:00:00 2001 From: nrusso Date: Sat, 23 Mar 2024 23:10:38 -0300 Subject: [PATCH] refactor: some minor fixes on file domain and add more tests --- Makefile | 6 - jest.config.js | 2 + nodemon.json | 2 +- package.json | 15 +- pnpm-lock.yaml | 1091 +++++------------ .../Exceptions/BadCredentialsException.ts | 2 +- .../Exceptions/CantDisabledException.ts | 2 +- .../Domain/Exceptions/ForbiddenException.ts | 2 +- .../Exceptions/PasswordWrongException.ts | 2 +- .../Exceptions/UnverifiedUserException.ts | 2 +- .../Exceptions/UserDisabledException.ts | 2 +- .../Exceptions/WrongPermissionsException.ts | 2 +- src/Auth/Domain/Models/ILoginResponse.ts | 10 - .../Domain/Payload/PermissionRepPayload.ts | 9 - src/Auth/Infrastructure/Events/EmailEvent.ts | 2 +- .../Auth/AuthSupabaseRepository.ts | 3 +- .../Repositories/Auth/BaseAxiosRepository.ts | 22 - .../Auth/Responses/PermissionResponse.ts | 13 - .../BaseResponses/ErrorResponse.ts | 8 - .../Controllers/AuthFastifyController.ts | 2 +- .../Exceptions/TokenExpiredHttpException.ts | 3 +- .../Exceptions/TokenNotFoundHttpException.ts | 3 +- src/Auth/Presentation/Helpers/Validations.ts | 8 - .../Middlewares/AuthorizeFastifyMiddleware.ts | 2 +- .../Transformers/PermissionsTransformer.ts | 2 +- src/Auth/Tests/DataMock.ts | 2 +- src/Config/exceptions.ts | 4 +- .../DTO/FileBase64OptimizeDTO.ts | 4 +- .../DTO/FileMultipartOptimizeDTO.ts | 6 +- .../DTO/FileUpdateBase64OptimizeDTO.ts | 2 +- .../DTO/FileUpdateMultipartOptimizeDTO.ts | 6 +- .../DTO/FileVersionOptimizeDTO.ts | 6 +- src/File/Domain/Entities/File.ts | 2 +- src/File/Domain/Entities/FileVersion.ts | 2 +- src/File/Domain/Entities/IFileDomain.ts | 2 +- src/File/Domain/Entities/IFileDomainDto.ts | 8 - .../Domain/Entities/IFileVersionDomain.ts | 2 +- src/File/Domain/Payloads/DownloadPayload.ts | 2 +- src/File/Domain/Payloads/FileRepPayload.ts | 2 +- .../Payloads/FileUpdateBase64Payload.ts | 2 +- .../Payloads/FileUpdateMultipartPayload.ts | 2 +- .../Domain/Payloads/FileVersionPayload.ts | 11 + .../Domain/Payloads/ListObjectsPayload.ts | 10 +- src/File/Domain/Payloads/OptimizePayload.ts | 2 +- .../Repositories/IFileRepository.ts | 6 +- .../Repositories/IFileVersionRepository.ts | 6 +- src/File/Domain/Services/FileService.ts | 88 +- .../Domain/UseCases/CreateBucketUseCase.ts | 4 +- src/File/Domain/UseCases/DownloadUseCase.ts | 2 +- .../Domain/UseCases/GetFileMetadataUseCase.ts | 2 +- .../UseCases/GetPresignedGetObjectUseCase.ts | 2 +- src/File/Domain/UseCases/ListFilesUseCase.ts | 4 +- .../Domain/UseCases/ListObjectsUseCase.ts | 10 +- src/File/Domain/UseCases/OptimizeUseCase.ts | 2 +- src/File/Domain/UseCases/RemoveFileUseCase.ts | 2 +- .../UseCases/UpdateFileBase64UseCase.ts | 2 +- .../UseCases/UpdateFileMultipartUseCase.ts | 2 +- .../Domain/UseCases/UploadBase64UseCase.ts | 12 +- .../Domain/UseCases/UploadMultipartUseCase.ts | 2 +- .../Validations/DownloadSchemaValidation.ts | 0 .../Validations/FileBase64SchemaValidation.ts | 0 .../FileBase64UpdateSchemaValidation.ts | 0 .../FileMultipartSchemaValidation.ts | 0 .../FileMultipartUpdateSchemaValidation.ts | 0 .../FileOptionsQuerySchemaValidation.ts | 0 .../Validations/FileRepSchemaValidation.ts | 0 .../ListObjectsSchemaValidation.ts | 0 .../Validations/OptimizeSchemaValidation.ts | 0 .../PartialFileSchemaValidation.ts | 0 .../PresignedFileSchemaValidation.ts | 0 .../Repositories/FileMongooseRepository.ts | 5 +- .../FileVersionMongooseRepository.ts | 7 +- .../Controllers/FileFastifyController.ts | 20 +- src/File/Presentation/Criterias/FileFilter.ts | 2 +- src/File/Presentation/Criterias/FileSort.ts | 2 +- .../Middlewares/FileFastifyReqMiddleware.ts | 23 +- .../RequestTypes/FileRequestTypes.ts | 2 - .../Presentation/Routes/FileFastifyRouter.ts | 4 +- .../Transformers/FileTransformer.ts | 8 +- .../Transformers/FileVersionTransformer.ts | 2 +- .../Transformers/IFileTransformer.ts | 5 +- .../Transformers/IFileVersionTransformer.ts | 2 +- .../Transformers/ObjectTransformer.ts | 3 +- src/File/Tests/file.handler.spec.ts | 57 +- src/File/Tests/test_file.json | 1 + src/Item/Domain/Entities/Item.ts | 2 +- src/Item/Domain/Payloads/ItemUpdatePayload.ts | 2 +- src/Item/Domain/UseCases/GetItemUseCase.ts | 2 +- src/Item/Domain/UseCases/ListItemsUseCase.ts | 3 +- src/Item/Domain/UseCases/RemoveItemUseCase.ts | 2 +- .../Repositories/ItemMikroORMRepository.ts | 9 +- .../Repositories/ItemMongooseRepository.ts | 2 +- .../Infrastructure/Schemas/ItemMikroORM.ts | 4 +- .../Infrastructure/Schemas/ItemMongoose.ts | 2 +- .../Controllers/ItemFastifyController.ts | 14 +- src/Item/Presentation/Criterias/ItemFilter.ts | 2 +- src/Item/Presentation/Criterias/ItemSort.ts | 2 +- .../Transformers/ItemTransformer.ts | 2 +- src/Main/Domain/Criteria/Filter.ts | 72 ++ src/Main/Domain/Criteria/ICriteria.ts | 10 + src/Main/Domain/Criteria/IFilter.ts | 10 + src/Main/Domain/Criteria/IPagination.ts | 10 + src/Main/Domain/Criteria/IPaginator.ts | 21 + src/Main/Domain/Criteria/IRequestCriteria.ts | 10 + src/Main/Domain/Criteria/ISort.ts | 5 + src/Main/Domain/Criteria/RequestCriteria.ts | 34 + src/Main/Domain/Criteria/Sort.ts | 56 + src/Main/Domain/Criteria/index.ts | 6 + src/Main/Domain/Entities/Base.ts | 27 + src/Main/Domain/Entities/IBaseDomain.ts | 7 + src/Main/Domain/Entities/ITimestamps.ts | 6 + src/Main/Domain/Entities/index.ts | 3 + src/Main/Domain/Errors/ErrorException.ts | 16 + src/Main/Domain/Errors/IErrorMessage.ts | 8 + .../Exceptions/InvalidPasswordException.ts | 2 +- .../Domain/Exceptions/NotFoundException.ts | 13 + src/Main/Domain/IBaseExtendDomain.ts | 2 +- src/Main/Domain/Payloads/IdPayload.ts | 5 + .../Domain/Repositories/IBaseRepository.ts | 3 +- src/Main/Domain/Shared/IFilesystem.ts | 19 + src/Main/Domain/Shared/ValidatorSchema.ts | 2 +- .../Infrastructure/Criteria/BasePaginator.ts | 184 +++ .../Criteria/IPaginatorConfig.ts | 6 + src/Main/Infrastructure/Criteria/index.ts | 2 + .../Encryption/BcryptEncryptionStrategy.ts | 21 + .../Infrastructure/Encryption/IEncryption.ts | 7 + .../Encryption/Md5EncryptionStrategy.ts | 21 + .../Tests/encryption.infrastructure.spec.ts | 44 + src/Main/Infrastructure/Encryption/index.ts | 3 + .../Exceptions/DecryptForbiddenException.ts | 13 + .../Filesystem/FilesystemMockStrategy.ts | 69 ++ .../Filesystem/MinioStrategy.ts | 133 ++ src/Main/Infrastructure/Filesystem/index.ts | 2 + .../Infrastructure/Orm/MikroORMPaginator.ts | 4 +- .../Orm/MongooseAggregatePaginator.ts | 4 +- .../Infrastructure/Orm/MongoosePaginator.ts | 4 +- .../Repositories/BaseMikroORMRepository.ts | 4 +- .../Repositories/BaseMongooseRepository.ts | 5 +- .../Repositories/CacheRepository.ts | 3 +- .../Presentation/Application/FormatError.ts | 17 + src/Main/Presentation/Application/IApp.ts | 13 + .../Presentation/Application/IAppConfig.ts | 8 + .../Application/IHttpStatusCode.ts | 7 + .../Presentation/Application/StatusCode.ts | 46 + .../DuplicateEntityHttpException.ts | 3 +- .../Exceptions/ErrorHttpException.ts | 61 + .../Factories/AppBootstrapFactory.ts | 4 +- .../Factories/ExceptionFactory.ts | 3 +- src/Main/Presentation/Http/AppFastify.ts | 3 +- .../Presentation/Http/FastifyBootstrapping.ts | 4 +- .../Presentation/Http/IExtendAppConfig.ts | 8 - .../Middleware/ErrorFastifyHandler.ts | 2 +- .../Routers/IndexFastifyRouter.ts | 2 +- .../Transformers/BaseTransformer.ts | 5 + .../Transformers/DefaultMessageTransformer.ts | 23 + .../Transformers/DefaultTransformer.ts | 9 + .../IDefaultMessageTransformer.ts | 6 + .../Transformers/ILocaleMessage.ts | 6 + .../Presentation/Transformers/Transformer.ts | 24 + src/Main/Presentation/Transformers/index.ts | 6 + .../Presentation/Utils/FastifyResponder.ts | 11 +- .../Presentation/Utils/ResponseMessageEnum.ts | 6 + .../Domain/Entities/INotificationDomain.ts | 2 +- .../Domain/Entities/Notification.ts | 2 +- .../Domain/Entities/TypeNotification.ts | 2 +- .../Domain/Events/SendMessageEvent.ts | 2 +- .../events => Domain/Models}/EventHandler.ts | 10 +- .../events => Domain/Models}/IEvent.ts | 0 .../Services/AttachmentsFilesService.ts | 7 +- .../Domain/Services/NotificationService.ts | 8 +- .../Repositories/INotificationRepository.ts | 3 +- .../NotificationMongooseRepository.ts | 4 +- .../Infrastructure/events/index.ts | 2 - .../NotificationFastifyController.ts | 2 +- .../Criterias/NotificationFilter.ts | 2 +- .../Criterias/NotificationSort.ts | 2 +- src/Notification/Shared/EmailStrategy.ts | 3 +- src/Shared/DI/container.ts | 29 +- src/Shared/Factories/FilesystemFactory.ts | 31 - .../Infrastructure/RabbitMQMessageBroker.ts | 2 +- src/Shared/Utils/Pagination.ts | 2 +- src/Shared/Utils/PaginatorTransformer.ts | 3 +- src/closed.ts | 2 +- src/command.ts | 3 + src/index.ts | 25 +- src/initTestServer.ts | 29 +- 186 files changed, 1807 insertions(+), 1154 deletions(-) delete mode 100644 src/Auth/Domain/Models/ILoginResponse.ts delete mode 100644 src/Auth/Domain/Payload/PermissionRepPayload.ts delete mode 100644 src/Auth/Infrastructure/Repositories/Auth/BaseAxiosRepository.ts delete mode 100644 src/Auth/Infrastructure/Repositories/Auth/Responses/PermissionResponse.ts delete mode 100644 src/Auth/Infrastructure/Repositories/BaseResponses/ErrorResponse.ts delete mode 100644 src/Auth/Presentation/Helpers/Validations.ts rename src/File/{Presentation => Domain}/DTO/FileBase64OptimizeDTO.ts (88%) rename src/File/{Presentation => Domain}/DTO/FileMultipartOptimizeDTO.ts (57%) rename src/File/{Presentation => Domain}/DTO/FileUpdateBase64OptimizeDTO.ts (84%) rename src/File/{Presentation => Domain}/DTO/FileUpdateMultipartOptimizeDTO.ts (65%) rename src/File/{Presentation => Domain}/DTO/FileVersionOptimizeDTO.ts (80%) delete mode 100644 src/File/Domain/Entities/IFileDomainDto.ts create mode 100644 src/File/Domain/Payloads/FileVersionPayload.ts rename src/File/{Infrastructure => Domain}/Repositories/IFileRepository.ts (60%) rename src/File/{Infrastructure => Domain}/Repositories/IFileVersionRepository.ts (75%) rename src/File/{Presentation => Domain}/Validations/DownloadSchemaValidation.ts (100%) rename src/File/{Presentation => Domain}/Validations/FileBase64SchemaValidation.ts (100%) rename src/File/{Presentation => Domain}/Validations/FileBase64UpdateSchemaValidation.ts (100%) rename src/File/{Presentation => Domain}/Validations/FileMultipartSchemaValidation.ts (100%) rename src/File/{Presentation => Domain}/Validations/FileMultipartUpdateSchemaValidation.ts (100%) rename src/File/{Presentation => Domain}/Validations/FileOptionsQuerySchemaValidation.ts (100%) rename src/File/{Presentation => Domain}/Validations/FileRepSchemaValidation.ts (100%) rename src/File/{Presentation => Domain}/Validations/ListObjectsSchemaValidation.ts (100%) rename src/File/{Presentation => Domain}/Validations/OptimizeSchemaValidation.ts (100%) rename src/File/{Presentation => Domain}/Validations/PartialFileSchemaValidation.ts (100%) rename src/File/{Presentation => Domain}/Validations/PresignedFileSchemaValidation.ts (100%) delete mode 100644 src/File/Presentation/RequestTypes/FileRequestTypes.ts create mode 100644 src/File/Tests/test_file.json create mode 100644 src/Main/Domain/Criteria/Filter.ts create mode 100644 src/Main/Domain/Criteria/ICriteria.ts create mode 100644 src/Main/Domain/Criteria/IFilter.ts create mode 100644 src/Main/Domain/Criteria/IPagination.ts create mode 100644 src/Main/Domain/Criteria/IPaginator.ts create mode 100644 src/Main/Domain/Criteria/IRequestCriteria.ts create mode 100644 src/Main/Domain/Criteria/ISort.ts create mode 100644 src/Main/Domain/Criteria/RequestCriteria.ts create mode 100644 src/Main/Domain/Criteria/Sort.ts create mode 100644 src/Main/Domain/Criteria/index.ts create mode 100644 src/Main/Domain/Entities/Base.ts create mode 100644 src/Main/Domain/Entities/IBaseDomain.ts create mode 100644 src/Main/Domain/Entities/ITimestamps.ts create mode 100644 src/Main/Domain/Entities/index.ts create mode 100644 src/Main/Domain/Errors/ErrorException.ts create mode 100644 src/Main/Domain/Errors/IErrorMessage.ts create mode 100644 src/Main/Domain/Exceptions/NotFoundException.ts create mode 100644 src/Main/Domain/Payloads/IdPayload.ts create mode 100644 src/Main/Domain/Shared/IFilesystem.ts create mode 100644 src/Main/Infrastructure/Criteria/BasePaginator.ts create mode 100644 src/Main/Infrastructure/Criteria/IPaginatorConfig.ts create mode 100644 src/Main/Infrastructure/Criteria/index.ts create mode 100644 src/Main/Infrastructure/Encryption/BcryptEncryptionStrategy.ts create mode 100644 src/Main/Infrastructure/Encryption/IEncryption.ts create mode 100644 src/Main/Infrastructure/Encryption/Md5EncryptionStrategy.ts create mode 100644 src/Main/Infrastructure/Encryption/Tests/encryption.infrastructure.spec.ts create mode 100644 src/Main/Infrastructure/Encryption/index.ts create mode 100644 src/Main/Infrastructure/Exceptions/DecryptForbiddenException.ts create mode 100644 src/Main/Infrastructure/Filesystem/FilesystemMockStrategy.ts create mode 100644 src/Main/Infrastructure/Filesystem/MinioStrategy.ts create mode 100644 src/Main/Infrastructure/Filesystem/index.ts create mode 100644 src/Main/Presentation/Application/FormatError.ts create mode 100644 src/Main/Presentation/Application/IApp.ts create mode 100644 src/Main/Presentation/Application/IAppConfig.ts create mode 100644 src/Main/Presentation/Application/IHttpStatusCode.ts create mode 100644 src/Main/Presentation/Application/StatusCode.ts create mode 100644 src/Main/Presentation/Exceptions/ErrorHttpException.ts delete mode 100644 src/Main/Presentation/Http/IExtendAppConfig.ts create mode 100644 src/Main/Presentation/Transformers/BaseTransformer.ts create mode 100644 src/Main/Presentation/Transformers/DefaultMessageTransformer.ts create mode 100644 src/Main/Presentation/Transformers/DefaultTransformer.ts create mode 100644 src/Main/Presentation/Transformers/IDefaultMessageTransformer.ts create mode 100644 src/Main/Presentation/Transformers/ILocaleMessage.ts create mode 100644 src/Main/Presentation/Transformers/Transformer.ts create mode 100644 src/Main/Presentation/Transformers/index.ts create mode 100644 src/Main/Presentation/Utils/ResponseMessageEnum.ts rename src/Notification/{Infrastructure/events => Domain/Models}/EventHandler.ts (89%) rename src/Notification/{Infrastructure/events => Domain/Models}/IEvent.ts (100%) delete mode 100644 src/Notification/Infrastructure/events/index.ts delete mode 100644 src/Shared/Factories/FilesystemFactory.ts diff --git a/Makefile b/Makefile index d06ced39..a8be319f 100644 --- a/Makefile +++ b/Makefile @@ -71,12 +71,6 @@ stress: @echo '************ ************' artillery run artillery.yml -ts_check: - @echo '************ ************' - @echo '************ Exec NODE TS CHECK ************' - @echo '************ ************' - docker compose exec node pnpm ts-check - init: @echo '************ ************' @echo '************ Init NODE ************' diff --git a/jest.config.js b/jest.config.js index caa57f23..eb61147c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -35,6 +35,8 @@ module.exports = { "!dist/src/Main/Infrastructure/Repositories/RedisCacheRepository.{js,ts}", "!dist/src/Main/Infrastructure/Repositories/BaseMongooseRepository.{js,ts}", "!dist/src/Main/Infrastructure/Orm/MongooseAggregatePaginator.{js,ts}", + "!dist/src/Main/Infrastructure/Filesystem/MinioStrategy.{js,ts}", + "!dist/src/Main/Infrastructure/UseCases/SyncDbUseCase.{js,ts}", "!dist/src/**/*Command*.{js,ts}", "!dist/src/**/*Document.{js,ts}", "!dist/src/**/Tests/*.{js,ts}", diff --git a/nodemon.json b/nodemon.json index 8a39621b..9cec7380 100644 --- a/nodemon.json +++ b/nodemon.json @@ -7,7 +7,7 @@ "watch": [ "src/*" ], - "exec": "npm run build && node --env-file=.env --inspect=0.0.0.0:9229 ./dist/src/index.js", + "exec": "npm run build && node --inspect=0.0.0.0:9229 ./dist/src/index.js", "legacyWatch": true, "ext": "js,ts,json,hbs" } diff --git a/package.json b/package.json index 304ac92e..9a2d5247 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "author": "Nathan M. Russo", "license": "MIT", "dependencies": { - "@digichanges/shared-experience": "^1.4.1", "@faker-js/faker": "^8.4.1", "@fastify/compress": "^7.0.0", "@fastify/cors": "^9.0.1", @@ -46,6 +45,7 @@ "axios": "^1.6.7", "bcrypt": "^5.1.1", "commander": "^10.0.1", + "cwebp": "^3.0.0", "dayjs": "^1.11.10", "dependency-cruiser": "^16.2.3", "dotenv": "^16.4.5", @@ -77,16 +77,15 @@ "zod": "^3.22.4" }, "devDependencies": { - "@commitlint/cli": "^18.6.1", - "@commitlint/config-conventional": "^18.6.2", + "@commitlint/cli": "^19.2.0", + "@commitlint/config-conventional": "^19.1.0", "@shelf/jest-mongodb": "^4.2.0", "@types/amqplib": "^0.10.4", "@types/bcrypt": "^5.0.2", - "@types/config": "^0.0.41", "@types/jest": "^29.5.12", "@types/jwt-simple": "^0.5.36", "@types/md5": "^2.3.5", - "@types/node": "^20.11.20", + "@types/node": "^20.11.28", "@types/node-cron": "^3.0.11", "@types/nodemailer": "^6.4.14", "@types/pg": "^8.11.1", @@ -94,8 +93,8 @@ "@types/shelljs": "^0.8.15", "@types/supertest": "^2.0.16", "@types/web-push": "^3.6.3", - "@typescript-eslint/eslint-plugin": "^7.0.2", - "@typescript-eslint/parser": "^7.0.2", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", "cpy": "^9.0.1", "eslint": "^8.57.0", "eslint-plugin-import": "^2.29.1", @@ -110,7 +109,7 @@ "rimraf": "^3.0.2", "supertest": "^6.3.4", "ts-node": "^10.9.2", - "typescript": "^5.3.3" + "typescript": "^5.4.2" }, "type": "commonjs", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 018bb6d4..cf51fba9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,9 +5,6 @@ settings: excludeLinksFromLockfile: false dependencies: - '@digichanges/shared-experience': - specifier: ^1.4.1 - version: 1.4.1 '@faker-js/faker': specifier: ^8.4.1 version: 8.4.1 @@ -27,11 +24,11 @@ dependencies: specifier: ^4.12.1 version: 4.12.1 '@mikro-orm/core': - specifier: ^6.1.5 - version: 6.1.5 + specifier: ^6.1.9 + version: 6.1.9 '@mikro-orm/postgresql': - specifier: ^6.1.5 - version: 6.1.5(@mikro-orm/core@6.1.5) + specifier: ^6.1.9 + version: 6.1.9(@mikro-orm/core@6.1.9) '@supabase/supabase-js': specifier: ^2.39.7 version: 2.39.7 @@ -54,8 +51,8 @@ dependencies: specifier: ^1.11.10 version: 1.11.10 dependency-cruiser: - specifier: ^16.2.1 - version: 16.2.1 + specifier: ^16.2.3 + version: 16.2.3 dotenv: specifier: ^16.4.5 version: 16.4.5 @@ -63,11 +60,8 @@ dependencies: specifier: ^8.0.0 version: 8.0.0 fastify: - specifier: ^4.26.1 - version: 4.26.1 - fastify-multer: - specifier: ^2.0.3 - version: 2.0.3 + specifier: ^4.26.2 + version: 4.26.2 handlebars: specifier: ^4.7.8 version: 4.7.8 @@ -103,7 +97,7 @@ dependencies: version: 6.9.10 pg-mem: specifier: ^2.8.1 - version: 2.8.1(@mikro-orm/core@6.1.5)(@mikro-orm/postgresql@6.1.5)(pg-promise@11.5.4) + version: 2.8.1(@mikro-orm/core@6.1.9)(@mikro-orm/postgresql@6.1.9)(pg-promise@11.5.4) pg-promise: specifier: ^11.5.4 version: 11.5.4 @@ -143,11 +137,11 @@ dependencies: devDependencies: '@commitlint/cli': - specifier: ^18.6.1 - version: 18.6.1(@types/node@20.11.20)(typescript@5.3.3) + specifier: ^19.2.0 + version: 19.2.0(@types/node@20.11.28)(typescript@5.4.2) '@commitlint/config-conventional': - specifier: ^18.6.2 - version: 18.6.2 + specifier: ^19.1.0 + version: 19.1.0 '@shelf/jest-mongodb': specifier: ^4.2.0 version: 4.2.0(jest-environment-node@29.7.0)(mongodb@6.3.0) @@ -157,9 +151,6 @@ devDependencies: '@types/bcrypt': specifier: ^5.0.2 version: 5.0.2 - '@types/config': - specifier: ^0.0.41 - version: 0.0.41 '@types/jest': specifier: ^29.5.12 version: 29.5.12 @@ -170,8 +161,8 @@ devDependencies: specifier: ^2.3.5 version: 2.3.5 '@types/node': - specifier: ^20.11.20 - version: 20.11.20 + specifier: ^20.11.28 + version: 20.11.28 '@types/node-cron': specifier: ^3.0.11 version: 3.0.11 @@ -194,11 +185,11 @@ devDependencies: specifier: ^3.6.3 version: 3.6.3 '@typescript-eslint/eslint-plugin': - specifier: ^7.0.2 - version: 7.0.2(@typescript-eslint/parser@7.0.2)(eslint@8.57.0)(typescript@5.3.3) + specifier: ^7.2.0 + version: 7.2.0(@typescript-eslint/parser@7.2.0)(eslint@8.57.0)(typescript@5.4.2) '@typescript-eslint/parser': - specifier: ^7.0.2 - version: 7.0.2(eslint@8.57.0)(typescript@5.3.3) + specifier: ^7.2.0 + version: 7.2.0(eslint@8.57.0)(typescript@5.4.2) cpy: specifier: ^9.0.1 version: 9.0.1 @@ -207,7 +198,7 @@ devDependencies: version: 8.57.0 eslint-plugin-import: specifier: ^2.29.1 - version: 2.29.1(@typescript-eslint/parser@7.0.2)(eslint@8.57.0) + version: 2.29.1(@typescript-eslint/parser@7.2.0)(eslint@8.57.0) eslint-plugin-prefer-arrow: specifier: ^1.2.3 version: 1.2.3(eslint@8.57.0) @@ -216,7 +207,7 @@ devDependencies: version: 9.0.11 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.11.20)(ts-node@10.9.2) + version: 29.7.0(@types/node@20.11.28)(ts-node@10.9.2) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -228,7 +219,7 @@ devDependencies: version: 15.2.2 madge: specifier: ^6.1.0 - version: 6.1.0(typescript@5.3.3) + version: 6.1.0(typescript@5.4.2) nodemon: specifier: ^3.1.0 version: 3.1.0 @@ -240,10 +231,10 @@ devDependencies: version: 6.3.4 ts-node: specifier: ^10.9.2 - version: 10.9.2(@types/node@20.11.20)(typescript@5.3.3) + version: 10.9.2(@types/node@20.11.28)(typescript@5.4.2) typescript: - specifier: ^5.3.3 - version: 5.3.3 + specifier: ^5.4.2 + version: 5.4.2 packages: @@ -609,47 +600,44 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true - /@commitlint/cli@18.6.1(@types/node@20.11.20)(typescript@5.3.3): - resolution: {integrity: sha512-5IDE0a+lWGdkOvKH892HHAZgbAjcj1mT5QrfA/SVbLJV/BbBMGyKN0W5mhgjekPJJwEQdVNvhl9PwUacY58Usw==} + /@commitlint/cli@19.2.0(@types/node@20.11.28)(typescript@5.4.2): + resolution: {integrity: sha512-8XnQDMyQR+1/ldbmIyhonvnDS2enEw48Wompo/967fsEvy9Vj5/JbDutzmSBKxANWDVeEbR9QQm0yHpw6ArrFw==} engines: {node: '>=v18'} hasBin: true dependencies: - '@commitlint/format': 18.6.1 - '@commitlint/lint': 18.6.1 - '@commitlint/load': 18.6.1(@types/node@20.11.20)(typescript@5.3.3) - '@commitlint/read': 18.6.1 - '@commitlint/types': 18.6.1 - execa: 5.1.1 - lodash.isfunction: 3.0.9 - resolve-from: 5.0.0 - resolve-global: 1.0.0 + '@commitlint/format': 19.0.3 + '@commitlint/lint': 19.1.0 + '@commitlint/load': 19.2.0(@types/node@20.11.28)(typescript@5.4.2) + '@commitlint/read': 19.2.0 + '@commitlint/types': 19.0.3 + execa: 8.0.1 yargs: 17.6.2 transitivePeerDependencies: - '@types/node' - typescript dev: true - /@commitlint/config-conventional@18.6.2: - resolution: {integrity: sha512-PcgSYg1AKGQIwDQKbaHtJsfqYy4uJTC7crLVZ83lfjcPaec4Pry2vLeaWej7ao2KsT20l9dWoMPpEGg8LWdUuA==} + /@commitlint/config-conventional@19.1.0: + resolution: {integrity: sha512-KIKD2xrp6Uuk+dcZVj3++MlzIr/Su6zLE8crEDQCZNvWHNQSeeGbzOlNtsR32TUy6H3JbP7nWgduAHCaiGQ6EA==} engines: {node: '>=v18'} dependencies: - '@commitlint/types': 18.6.1 + '@commitlint/types': 19.0.3 conventional-changelog-conventionalcommits: 7.0.2 dev: true - /@commitlint/config-validator@18.6.1: - resolution: {integrity: sha512-05uiToBVfPhepcQWE1ZQBR/Io3+tb3gEotZjnI4tTzzPk16NffN6YABgwFQCLmzZefbDcmwWqJWc2XT47q7Znw==} + /@commitlint/config-validator@19.0.3: + resolution: {integrity: sha512-2D3r4PKjoo59zBc2auodrSCaUnCSALCx54yveOFwwP/i2kfEAQrygwOleFWswLqK0UL/F9r07MFi5ev2ohyM4Q==} engines: {node: '>=v18'} dependencies: - '@commitlint/types': 18.6.1 + '@commitlint/types': 19.0.3 ajv: 8.12.0 dev: true - /@commitlint/ensure@18.6.1: - resolution: {integrity: sha512-BPm6+SspyxQ7ZTsZwXc7TRQL5kh5YWt3euKmEIBZnocMFkJevqs3fbLRb8+8I/cfbVcAo4mxRlpTPfz8zX7SnQ==} + /@commitlint/ensure@19.0.3: + resolution: {integrity: sha512-SZEpa/VvBLoT+EFZVb91YWbmaZ/9rPH3ESrINOl0HD2kMYsjvl0tF7nMHh0EpTcv4+gTtZBAe1y/SS6/OhfZzQ==} engines: {node: '>=v18'} dependencies: - '@commitlint/types': 18.6.1 + '@commitlint/types': 19.0.3 lodash.camelcase: 4.3.0 lodash.kebabcase: 4.1.1 lodash.snakecase: 4.1.1 @@ -657,121 +645,122 @@ packages: lodash.upperfirst: 4.3.1 dev: true - /@commitlint/execute-rule@18.6.1: - resolution: {integrity: sha512-7s37a+iWyJiGUeMFF6qBlyZciUkF8odSAnHijbD36YDctLhGKoYltdvuJ/AFfRm6cBLRtRk9cCVPdsEFtt/2rg==} + /@commitlint/execute-rule@19.0.0: + resolution: {integrity: sha512-mtsdpY1qyWgAO/iOK0L6gSGeR7GFcdW7tIjcNFxcWkfLDF5qVbPHKuGATFqRMsxcO8OUKNj0+3WOHB7EHm4Jdw==} engines: {node: '>=v18'} dev: true - /@commitlint/format@18.6.1: - resolution: {integrity: sha512-K8mNcfU/JEFCharj2xVjxGSF+My+FbUHoqR+4GqPGrHNqXOGNio47ziiR4HQUPKtiNs05o8/WyLBoIpMVOP7wg==} + /@commitlint/format@19.0.3: + resolution: {integrity: sha512-QjjyGyoiVWzx1f5xOteKHNLFyhyweVifMgopozSgx1fGNrGV8+wp7k6n1t6StHdJ6maQJ+UUtO2TcEiBFRyR6Q==} engines: {node: '>=v18'} dependencies: - '@commitlint/types': 18.6.1 - chalk: 4.1.2 + '@commitlint/types': 19.0.3 + chalk: 5.3.0 dev: true - /@commitlint/is-ignored@18.6.1: - resolution: {integrity: sha512-MOfJjkEJj/wOaPBw5jFjTtfnx72RGwqYIROABudOtJKW7isVjFe9j0t8xhceA02QebtYf4P/zea4HIwnXg8rvA==} + /@commitlint/is-ignored@19.0.3: + resolution: {integrity: sha512-MqDrxJaRSVSzCbPsV6iOKG/Lt52Y+PVwFVexqImmYYFhe51iVJjK2hRhOG2jUAGiUHk4jpdFr0cZPzcBkSzXDQ==} engines: {node: '>=v18'} dependencies: - '@commitlint/types': 18.6.1 + '@commitlint/types': 19.0.3 semver: 7.6.0 dev: true - /@commitlint/lint@18.6.1: - resolution: {integrity: sha512-8WwIFo3jAuU+h1PkYe5SfnIOzp+TtBHpFr4S8oJWhu44IWKuVx6GOPux3+9H1iHOan/rGBaiacicZkMZuluhfQ==} + /@commitlint/lint@19.1.0: + resolution: {integrity: sha512-ESjaBmL/9cxm+eePyEr6SFlBUIYlYpI80n+Ltm7IA3MAcrmiP05UMhJdAD66sO8jvo8O4xdGn/1Mt2G5VzfZKw==} engines: {node: '>=v18'} dependencies: - '@commitlint/is-ignored': 18.6.1 - '@commitlint/parse': 18.6.1 - '@commitlint/rules': 18.6.1 - '@commitlint/types': 18.6.1 + '@commitlint/is-ignored': 19.0.3 + '@commitlint/parse': 19.0.3 + '@commitlint/rules': 19.0.3 + '@commitlint/types': 19.0.3 dev: true - /@commitlint/load@18.6.1(@types/node@20.11.20)(typescript@5.3.3): - resolution: {integrity: sha512-p26x8734tSXUHoAw0ERIiHyW4RaI4Bj99D8YgUlVV9SedLf8hlWAfyIFhHRIhfPngLlCe0QYOdRKYFt8gy56TA==} + /@commitlint/load@19.2.0(@types/node@20.11.28)(typescript@5.4.2): + resolution: {integrity: sha512-XvxxLJTKqZojCxaBQ7u92qQLFMMZc4+p9qrIq/9kJDy8DOrEa7P1yx7Tjdc2u2JxIalqT4KOGraVgCE7eCYJyQ==} engines: {node: '>=v18'} dependencies: - '@commitlint/config-validator': 18.6.1 - '@commitlint/execute-rule': 18.6.1 - '@commitlint/resolve-extends': 18.6.1 - '@commitlint/types': 18.6.1 - chalk: 4.1.2 - cosmiconfig: 8.3.6(typescript@5.3.3) - cosmiconfig-typescript-loader: 5.0.0(@types/node@20.11.20)(cosmiconfig@8.3.6)(typescript@5.3.3) + '@commitlint/config-validator': 19.0.3 + '@commitlint/execute-rule': 19.0.0 + '@commitlint/resolve-extends': 19.1.0 + '@commitlint/types': 19.0.3 + chalk: 5.3.0 + cosmiconfig: 9.0.0(typescript@5.4.2) + cosmiconfig-typescript-loader: 5.0.0(@types/node@20.11.28)(cosmiconfig@9.0.0)(typescript@5.4.2) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 - resolve-from: 5.0.0 transitivePeerDependencies: - '@types/node' - typescript dev: true - /@commitlint/message@18.6.1: - resolution: {integrity: sha512-VKC10UTMLcpVjMIaHHsY1KwhuTQtdIKPkIdVEwWV+YuzKkzhlI3aNy6oo1eAN6b/D2LTtZkJe2enHmX0corYRw==} + /@commitlint/message@19.0.0: + resolution: {integrity: sha512-c9czf6lU+9oF9gVVa2lmKaOARJvt4soRsVmbR7Njwp9FpbBgste5i7l/2l5o8MmbwGh4yE1snfnsy2qyA2r/Fw==} engines: {node: '>=v18'} dev: true - /@commitlint/parse@18.6.1: - resolution: {integrity: sha512-eS/3GREtvVJqGZrwAGRwR9Gdno3YcZ6Xvuaa+vUF8j++wsmxrA2En3n0ccfVO2qVOLJC41ni7jSZhQiJpMPGOQ==} + /@commitlint/parse@19.0.3: + resolution: {integrity: sha512-Il+tNyOb8VDxN3P6XoBBwWJtKKGzHlitEuXA5BP6ir/3loWlsSqDr5aecl6hZcC/spjq4pHqNh0qPlfeWu38QA==} engines: {node: '>=v18'} dependencies: - '@commitlint/types': 18.6.1 + '@commitlint/types': 19.0.3 conventional-changelog-angular: 7.0.0 conventional-commits-parser: 5.0.0 dev: true - /@commitlint/read@18.6.1: - resolution: {integrity: sha512-ia6ODaQFzXrVul07ffSgbZGFajpe8xhnDeLIprLeyfz3ivQU1dIoHp7yz0QIorZ6yuf4nlzg4ZUkluDrGN/J/w==} + /@commitlint/read@19.2.0: + resolution: {integrity: sha512-HlGeEd/jyp2a5Fb9mvtsaDm5hFCmj80dJYjLQkpG3DzWneWBc37YU3kM8Za1D1HUazZaTkdsWq73M3XDE4CvCA==} engines: {node: '>=v18'} dependencies: - '@commitlint/top-level': 18.6.1 - '@commitlint/types': 18.6.1 - git-raw-commits: 2.0.11 - minimist: 1.2.7 + '@commitlint/top-level': 19.0.0 + '@commitlint/types': 19.0.3 + execa: 8.0.1 + git-raw-commits: 4.0.0 + minimist: 1.2.8 dev: true - /@commitlint/resolve-extends@18.6.1: - resolution: {integrity: sha512-ifRAQtHwK+Gj3Bxj/5chhc4L2LIc3s30lpsyW67yyjsETR6ctHAHRu1FSpt0KqahK5xESqoJ92v6XxoDRtjwEQ==} + /@commitlint/resolve-extends@19.1.0: + resolution: {integrity: sha512-z2riI+8G3CET5CPgXJPlzftH+RiWYLMYv4C9tSLdLXdr6pBNimSKukYP9MS27ejmscqCTVA4almdLh0ODD2KYg==} engines: {node: '>=v18'} dependencies: - '@commitlint/config-validator': 18.6.1 - '@commitlint/types': 18.6.1 - import-fresh: 3.3.0 + '@commitlint/config-validator': 19.0.3 + '@commitlint/types': 19.0.3 + global-directory: 4.0.1 + import-meta-resolve: 4.0.0 lodash.mergewith: 4.6.2 resolve-from: 5.0.0 - resolve-global: 1.0.0 dev: true - /@commitlint/rules@18.6.1: - resolution: {integrity: sha512-kguM6HxZDtz60v/zQYOe0voAtTdGybWXefA1iidjWYmyUUspO1zBPQEmJZ05/plIAqCVyNUTAiRPWIBKLCrGew==} + /@commitlint/rules@19.0.3: + resolution: {integrity: sha512-TspKb9VB6svklxNCKKwxhELn7qhtY1rFF8ls58DcFd0F97XoG07xugPjjbVnLqmMkRjZDbDIwBKt9bddOfLaPw==} engines: {node: '>=v18'} dependencies: - '@commitlint/ensure': 18.6.1 - '@commitlint/message': 18.6.1 - '@commitlint/to-lines': 18.6.1 - '@commitlint/types': 18.6.1 - execa: 5.1.1 + '@commitlint/ensure': 19.0.3 + '@commitlint/message': 19.0.0 + '@commitlint/to-lines': 19.0.0 + '@commitlint/types': 19.0.3 + execa: 8.0.1 dev: true - /@commitlint/to-lines@18.6.1: - resolution: {integrity: sha512-Gl+orGBxYSNphx1+83GYeNy5N0dQsHBQ9PJMriaLQDB51UQHCVLBT/HBdOx5VaYksivSf5Os55TLePbRLlW50Q==} + /@commitlint/to-lines@19.0.0: + resolution: {integrity: sha512-vkxWo+VQU5wFhiP9Ub9Sre0FYe019JxFikrALVoD5UGa8/t3yOJEpEhxC5xKiENKKhUkTpEItMTRAjHw2SCpZw==} engines: {node: '>=v18'} dev: true - /@commitlint/top-level@18.6.1: - resolution: {integrity: sha512-HyiHQZUTf0+r0goTCDs/bbVv/LiiQ7AVtz6KIar+8ZrseB9+YJAIo8HQ2IC2QT1y3N1lbW6OqVEsTHjbT6hGSw==} + /@commitlint/top-level@19.0.0: + resolution: {integrity: sha512-KKjShd6u1aMGNkCkaX4aG1jOGdn7f8ZI8TR1VEuNqUOjWTOdcDSsmglinglJ18JTjuBX5I1PtjrhQCRcixRVFQ==} engines: {node: '>=v18'} dependencies: - find-up: 5.0.0 + find-up: 7.0.0 dev: true - /@commitlint/types@18.6.1: - resolution: {integrity: sha512-gwRLBLra/Dozj2OywopeuHj2ac26gjGkz2cZ+86cTJOdtWfiRRr4+e77ZDAGc6MDWxaWheI+mAV5TLWWRwqrFg==} + /@commitlint/types@19.0.3: + resolution: {integrity: sha512-tpyc+7i6bPG9mvaBbtKUeghfyZSDgWquIDfMgqYtTbmZ9Y9VzEm2je9EYcQ0aoz5o7NvGS+rcDec93yO08MHYA==} engines: {node: '>=v18'} dependencies: - chalk: 4.1.2 + '@types/conventional-commits-parser': 5.0.0 + chalk: 5.3.0 dev: true /@cspotcode/source-map-support@0.8.1: @@ -781,23 +770,6 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true - /@digichanges/shared-experience@1.4.1: - resolution: {integrity: sha512-oYWaEoOl9wZOwkaD9FH/kFrjMZEXdhwLEVpQZnQ3X4T0q7plx/0tWhr5IMw/W2zpV5x6nA4bv/Zm7Y8g1Gh0vA==} - dependencies: - bcrypt: 5.1.1 - koa: 2.14.2 - koa-qs: 3.0.0 - koa-router: 12.0.1 - lodash: 4.17.21 - md5: 2.3.0 - minio: 7.1.3 - qs: 6.11.2 - rxjs: 7.8.1 - transitivePeerDependencies: - - encoding - - supports-color - dev: false - /@eslint-community/eslint-utils@4.4.0(eslint@8.57.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -959,7 +931,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.28 chalk: 4.1.2 jest-message-util: 29.7.0 jest-util: 29.7.0 @@ -980,14 +952,14 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.28 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.7.0 exit: 0.1.2 graceful-fs: 4.2.10 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.11.20)(ts-node@10.9.2) + jest-config: 29.7.0(@types/node@20.11.28)(ts-node@10.9.2) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -1015,7 +987,7 @@ packages: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.28 jest-mock: 29.7.0 dev: true @@ -1042,7 +1014,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.11.20 + '@types/node': 20.11.28 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -1075,7 +1047,7 @@ packages: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.20 - '@types/node': 20.11.20 + '@types/node': 20.11.28 chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 @@ -1163,7 +1135,7 @@ packages: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 20.11.20 + '@types/node': 20.11.28 '@types/yargs': 17.0.15 chalk: 4.1.2 dev: true @@ -1238,26 +1210,26 @@ packages: - supports-color dev: false - /@mikro-orm/core@6.1.5: - resolution: {integrity: sha512-p71B9LxssyMr4zz7be1z6jLtPskshoVKm34bZU/zQ2wlyMBQQJPtOIr8VnRV3dOq7tvDze8cfEaBjcDGHlCIPA==} + /@mikro-orm/core@6.1.9: + resolution: {integrity: sha512-sJdoh9Otl0hEAPyAU4J2GEfhStDaOFY5O5fV1And2kU21eE7knJefUqTWNKwaOT4p3a9wk9fXJDPA+vo1AHWwg==} engines: {node: '>= 18.12.0'} dependencies: dataloader: 2.2.2 - dotenv: 16.4.4 + dotenv: 16.4.5 esprima: 4.0.1 fs-extra: 11.2.0 globby: 11.1.0 - mikro-orm: 6.1.5 + mikro-orm: 6.1.9 reflect-metadata: 0.2.1 dev: false - /@mikro-orm/knex@6.1.5(@mikro-orm/core@6.1.5)(pg@8.11.3): - resolution: {integrity: sha512-8DaxqSY3B+ZDwGqyfxnKrWquYulDxWdq0j4OB+7TMUpIW2hF/o4VvKiVyumORkfhbMbO0xzynwsgteh3/Gb4TQ==} + /@mikro-orm/knex@6.1.9(@mikro-orm/core@6.1.9)(pg@8.11.3): + resolution: {integrity: sha512-kmldPyHVhViEUDYGZeQK90w89B+YzMpNwpL808awZJm3Vo5syakxFlKdRsNPEKEHEwX9vpt6dJCpqQRuPqS9Aw==} engines: {node: '>= 18.12.0'} peerDependencies: '@mikro-orm/core': ^6.0.0 dependencies: - '@mikro-orm/core': 6.1.5 + '@mikro-orm/core': 6.1.9 fs-extra: 11.2.0 knex: 3.1.0(pg@8.11.3) sqlstring: 2.3.3 @@ -1272,14 +1244,14 @@ packages: - tedious dev: false - /@mikro-orm/postgresql@6.1.5(@mikro-orm/core@6.1.5): - resolution: {integrity: sha512-LkTbT9ys06hRV/ZxClEZKcMvtvl9ciqhMOe5XCe71AR+7DveOELKNr59c1s0l2Co6LtYwOw88NPxfTzu92654w==} + /@mikro-orm/postgresql@6.1.9(@mikro-orm/core@6.1.9): + resolution: {integrity: sha512-q1CVCSVctpvGRytqr0vXHVI0NFGrvxq9age1xwxLW3dp9sQxPF7EG9hXSFvOb6VbLPwxR7LcXZWc/Kkt84CpdQ==} engines: {node: '>= 18.12.0'} peerDependencies: '@mikro-orm/core': ^6.0.0 dependencies: - '@mikro-orm/core': 6.1.5 - '@mikro-orm/knex': 6.1.5(@mikro-orm/core@6.1.5)(pg@8.11.3) + '@mikro-orm/core': 6.1.9 + '@mikro-orm/knex': 6.1.9(@mikro-orm/core@6.1.9)(pg@8.11.3) pg: 8.11.3 postgres-array: 3.0.2 postgres-date: 2.1.0 @@ -1438,7 +1410,7 @@ packages: /@types/amqplib@0.10.4: resolution: {integrity: sha512-Y5Sqquh/LqDxSgxYaAAFNM0M7GyONtSDCcFMJk+DQwYEjibPyW6y+Yu9H9omdkKc3epyXULmFN3GTaeBHhn2Hg==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.28 dev: true /@types/babel__core@7.1.20: @@ -1473,11 +1445,13 @@ packages: /@types/bcrypt@5.0.2: resolution: {integrity: sha512-6atioO8Y75fNcbmj0G7UjI9lXN2pQ/IGJ2FWT4a/btd0Lk9lQalHLKhkgKVZ3r+spnmWUKfbMi1GEe9wyHQfNQ==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.28 dev: true - /@types/config@0.0.41: - resolution: {integrity: sha512-HjXUmIld0gwvyG8MU/17QtLzOyuMX4jbGuijmS9sWsob5xxgZ/hY9cbRCaHIHqTQ3HMLhwS3F8uXq3Bt9zgzHA==} + /@types/conventional-commits-parser@5.0.0: + resolution: {integrity: sha512-loB369iXNmAZglwWATL+WRe+CRMmmBPtpolYzIebFaX4YA3x+BEfLqhUAV9WanycKI3TG1IMr5bMJDajDKLlUQ==} + dependencies: + '@types/node': 20.11.28 dev: true /@types/cookiejar@2.1.2: @@ -1488,13 +1462,13 @@ packages: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 20.11.20 + '@types/node': 20.11.28 dev: true /@types/graceful-fs@4.1.5: resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.28 dev: true /@types/istanbul-lib-coverage@2.0.4: @@ -1523,7 +1497,7 @@ packages: /@types/jsdom@20.0.1: resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.28 '@types/tough-cookie': 4.0.2 parse5: 7.1.2 dev: true @@ -1548,33 +1522,25 @@ packages: resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} dev: true - /@types/minimist@1.2.2: - resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} - dev: true - /@types/node-cron@3.0.11: resolution: {integrity: sha512-0ikrnug3/IyneSHqCBeslAhlK2aBfYek1fGo4bP4QnZPmiqSGRK+Oy7ZMisLWkesffJvQ1cqAcBnJC+8+nxIAg==} dev: true - /@types/node@20.11.20: - resolution: {integrity: sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==} + /@types/node@20.11.28: + resolution: {integrity: sha512-M/GPWVS2wLkSkNHVeLkrF2fD5Lx5UC4PxA0uZcKc6QqbIQUJyW1jVjueJYi1z8n0I5PxYrtpnPnWglE+y9A0KA==} dependencies: undici-types: 5.26.5 /@types/nodemailer@6.4.14: resolution: {integrity: sha512-fUWthHO9k9DSdPCSPRqcu6TWhYyxTBg382vlNIttSe9M7XfsT06y0f24KHXtbnijPGGRIcVvdKHTNikOI6qiHA==} dependencies: - '@types/node': 20.11.20 - dev: true - - /@types/normalize-package-data@2.4.1: - resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} + '@types/node': 20.11.28 dev: true /@types/pg@8.11.1: resolution: {integrity: sha512-tUMU6HRvsosqH0qov7YH0Kj6EnziKoqmHUcREBPlDEQLWT+TxDUBT1MmQ53byHXs171xn3YFPIPwVTkVb16mVg==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.28 pg-protocol: 1.6.0 pg-types: 4.0.1 dev: true @@ -1595,7 +1561,7 @@ packages: resolution: {integrity: sha512-vzmnCHl6hViPu9GNLQJ+DZFd6BQI2DBTUeOvYHqkWQLMfKAAQYMb/xAmZkTogZI/vqXHCWkqDRymDI5p0QTi5Q==} dependencies: '@types/glob': 7.2.0 - '@types/node': 20.11.20 + '@types/node': 20.11.28 dev: true /@types/stack-utils@2.0.1: @@ -1606,7 +1572,7 @@ packages: resolution: {integrity: sha512-tLfnlJf6A5mB6ddqF159GqcDizfzbMUB1/DeT59/wBNqzRTNNKsaw79A/1TZ84X+f/EwWH8FeuSkjlCLyqS/zQ==} dependencies: '@types/cookiejar': 2.1.2 - '@types/node': 20.11.20 + '@types/node': 20.11.28 dev: true /@types/supertest@2.0.16: @@ -1622,7 +1588,7 @@ packages: /@types/web-push@3.6.3: resolution: {integrity: sha512-v3oT4mMJsHeJ/rraliZ+7TbZtr5bQQuxcgD7C3/1q/zkAj29c8RE0F9lVZVu3hiQe5Z9fYcBreV7TLnfKR+4mg==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.28 dev: true /@types/webidl-conversions@7.0.0: @@ -1636,14 +1602,14 @@ packages: /@types/whatwg-url@8.2.2: resolution: {integrity: sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.28 '@types/webidl-conversions': 7.0.0 dev: true /@types/ws@8.5.10: resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.28 dev: false /@types/yargs-parser@21.0.0: @@ -1656,8 +1622,8 @@ packages: '@types/yargs-parser': 21.0.0 dev: true - /@typescript-eslint/eslint-plugin@7.0.2(@typescript-eslint/parser@7.0.2)(eslint@8.57.0)(typescript@5.3.3): - resolution: {integrity: sha512-/XtVZJtbaphtdrWjr+CJclaCVGPtOdBpFEnvtNf/jRV0IiEemRrL0qABex/nEt8isYcnFacm3nPHYQwL+Wb7qg==} + /@typescript-eslint/eslint-plugin@7.2.0(@typescript-eslint/parser@7.2.0)(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-mdekAHOqS9UjlmyF/LSs6AIEvfceV749GFxoBAjwAv0nkevfKHWQFDMcBZWUiIC5ft6ePWivXoS36aKQ0Cy3sw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -1668,25 +1634,25 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.0.2(eslint@8.57.0)(typescript@5.3.3) - '@typescript-eslint/scope-manager': 7.0.2 - '@typescript-eslint/type-utils': 7.0.2(eslint@8.57.0)(typescript@5.3.3) - '@typescript-eslint/utils': 7.0.2(eslint@8.57.0)(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 7.0.2 + '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/scope-manager': 7.2.0 + '@typescript-eslint/type-utils': 7.2.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/utils': 7.2.0(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/visitor-keys': 7.2.0 debug: 4.3.4(supports-color@5.5.0) eslint: 8.57.0 graphemer: 1.4.0 - ignore: 5.3.0 + ignore: 5.3.1 natural-compare: 1.4.0 - semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@5.3.3) - typescript: 5.3.3 + semver: 7.6.0 + ts-api-utils: 1.0.3(typescript@5.4.2) + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@7.0.2(eslint@8.57.0)(typescript@5.3.3): - resolution: {integrity: sha512-GdwfDglCxSmU+QTS9vhz2Sop46ebNCXpPPvsByK7hu0rFGRHL+AusKQJ7SoN+LbLh6APFpQwHKmDSwN35Z700Q==} + /@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^8.56.0 @@ -1695,27 +1661,27 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 7.0.2 - '@typescript-eslint/types': 7.0.2 - '@typescript-eslint/typescript-estree': 7.0.2(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 7.0.2 + '@typescript-eslint/scope-manager': 7.2.0 + '@typescript-eslint/types': 7.2.0 + '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.2) + '@typescript-eslint/visitor-keys': 7.2.0 debug: 4.3.4(supports-color@5.5.0) eslint: 8.57.0 - typescript: 5.3.3 + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager@7.0.2: - resolution: {integrity: sha512-l6sa2jF3h+qgN2qUMjVR3uCNGjWw4ahGfzIYsCtFrQJCjhbrDPdiihYT8FnnqFwsWX+20hK592yX9I2rxKTP4g==} + /@typescript-eslint/scope-manager@7.2.0: + resolution: {integrity: sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 7.0.2 - '@typescript-eslint/visitor-keys': 7.0.2 + '@typescript-eslint/types': 7.2.0 + '@typescript-eslint/visitor-keys': 7.2.0 dev: true - /@typescript-eslint/type-utils@7.0.2(eslint@8.57.0)(typescript@5.3.3): - resolution: {integrity: sha512-IKKDcFsKAYlk8Rs4wiFfEwJTQlHcdn8CLwLaxwd6zb8HNiMcQIFX9sWax2k4Cjj7l7mGS5N1zl7RCHOVwHq2VQ==} + /@typescript-eslint/type-utils@7.2.0(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-xHi51adBHo9O9330J8GQYQwrKBqbIPJGZZVQTHHmy200hvkLZFWJIFtAG/7IYTWUyun6DE6w5InDReePJYJlJA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^8.56.0 @@ -1724,12 +1690,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.0.2(typescript@5.3.3) - '@typescript-eslint/utils': 7.0.2(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.2) + '@typescript-eslint/utils': 7.2.0(eslint@8.57.0)(typescript@5.4.2) debug: 4.3.4(supports-color@5.5.0) eslint: 8.57.0 - ts-api-utils: 1.0.3(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.0.3(typescript@5.4.2) + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true @@ -1744,8 +1710,8 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/types@7.0.2: - resolution: {integrity: sha512-ZzcCQHj4JaXFjdOql6adYV4B/oFOFjPOC9XYwCaZFRvqN8Llfvv4gSxrkQkd2u4Ci62i2c6W6gkDwQJDaRc4nA==} + /@typescript-eslint/types@7.2.0: + resolution: {integrity: sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==} engines: {node: ^16.0.0 || >=18.0.0} dev: true @@ -1791,8 +1757,8 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@7.0.2(typescript@5.3.3): - resolution: {integrity: sha512-3AMc8khTcELFWcKcPc0xiLviEvvfzATpdPj/DXuOGIdQIIFybf4DMT1vKRbuAEOFMwhWt7NFLXRkbjsvKZQyvw==} + /@typescript-eslint/typescript-estree@7.2.0(typescript@5.4.2): + resolution: {integrity: sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -1800,21 +1766,21 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 7.0.2 - '@typescript-eslint/visitor-keys': 7.0.2 + '@typescript-eslint/types': 7.2.0 + '@typescript-eslint/visitor-keys': 7.2.0 debug: 4.3.4(supports-color@5.5.0) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.0 - ts-api-utils: 1.0.3(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.0.3(typescript@5.4.2) + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@7.0.2(eslint@8.57.0)(typescript@5.3.3): - resolution: {integrity: sha512-PZPIONBIB/X684bhT1XlrkjNZJIEevwkKDsdwfiu1WeqBxYEEdIgVDgm8/bbKHVu+6YOpeRqcfImTdImx/4Bsw==} + /@typescript-eslint/utils@7.2.0(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-YfHpnMAGb1Eekpm3XRK8hcMwGLGsnT6L+7b2XyRv6ouDuJU1tZir1GS2i0+VXRatMwSI1/UfcyPe53ADkU+IuA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^8.56.0 @@ -1822,9 +1788,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@types/json-schema': 7.0.14 '@types/semver': 7.5.4 - '@typescript-eslint/scope-manager': 7.0.2 - '@typescript-eslint/types': 7.0.2 - '@typescript-eslint/typescript-estree': 7.0.2(typescript@5.3.3) + '@typescript-eslint/scope-manager': 7.2.0 + '@typescript-eslint/types': 7.2.0 + '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.2) eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: @@ -1848,11 +1814,11 @@ packages: eslint-visitor-keys: 3.3.0 dev: true - /@typescript-eslint/visitor-keys@7.0.2: - resolution: {integrity: sha512-8Y+YiBmqPighbm5xA2k4wKTxRzx9EkBu7Rlw+WHqMvRJ3RPz/BMBO9b2ru0LUNmXg120PHUXD5+SWFy2R8DqlQ==} + /@typescript-eslint/visitor-keys@7.2.0: + resolution: {integrity: sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 7.0.2 + '@typescript-eslint/types': 7.2.0 eslint-visitor-keys: 3.4.3 dev: true @@ -1892,14 +1858,6 @@ packages: resolution: {integrity: sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==} dev: false - /accepts@1.3.8: - resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} - engines: {node: '>= 0.6'} - dependencies: - mime-types: 2.1.35 - negotiator: 0.6.3 - dev: false - /acorn-globals@7.0.1: resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==} dependencies: @@ -2069,10 +2027,6 @@ packages: resolution: {integrity: sha512-gkco+qxENJV+8vFcDiiFhuoSvRXb2a/QPqpSoWhVz829VNJfOTnELbBmPmNKFxf3xdNnw4DWCkzkDaavcX/1YQ==} dev: true - /append-field@1.0.0: - resolution: {integrity: sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==} - dev: false - /append-field@2.0.0: resolution: {integrity: sha512-yUPXgerKgcuwakzrRyklfhX+Ma2aYYMjb+BO2RPUwq+tk928V/i5DFWcCUS3hQhj468N+Ktmwb0tfbEtmfC6WA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -2178,11 +2132,6 @@ packages: is-shared-array-buffer: 1.0.2 dev: true - /arrify@1.0.1: - resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} - engines: {node: '>=0.10.0'} - dev: true - /arrify@3.0.0: resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} engines: {node: '>=12'} @@ -2468,14 +2417,6 @@ packages: engines: {node: '>= 0.8'} dev: false - /cache-content-type@1.0.1: - resolution: {integrity: sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==} - engines: {node: '>= 6.0.0'} - dependencies: - mime-types: 2.1.35 - ylru: 1.3.2 - dev: false - /call-bind@1.0.2: resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} dependencies: @@ -2495,15 +2436,6 @@ packages: engines: {node: '>=6'} dev: true - /camelcase-keys@6.2.2: - resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} - engines: {node: '>=8'} - dependencies: - camelcase: 5.3.1 - map-obj: 4.3.0 - quick-lru: 4.0.1 - dev: true - /camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} @@ -2627,6 +2559,7 @@ packages: /co@4.6.0: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + dev: true /collect-v8-coverage@1.0.1: resolution: {integrity: sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==} @@ -2715,32 +2648,10 @@ packages: /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - /concat-stream@2.0.0: - resolution: {integrity: sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==} - engines: {'0': node >= 6.0} - dependencies: - buffer-from: 1.1.2 - inherits: 2.0.4 - readable-stream: 3.6.2 - typedarray: 0.0.6 - dev: false - /console-control-strings@1.1.0: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} dev: false - /content-disposition@0.5.4: - resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} - engines: {node: '>= 0.6'} - dependencies: - safe-buffer: 5.2.1 - dev: false - - /content-type@1.0.4: - resolution: {integrity: sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==} - engines: {node: '>= 0.6'} - dev: false - /conventional-changelog-angular@7.0.0: resolution: {integrity: sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==} engines: {node: '>=16'} @@ -2783,19 +2694,11 @@ packages: resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==} dev: true - /cookies@0.8.0: - resolution: {integrity: sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow==} - engines: {node: '>= 0.8'} - dependencies: - depd: 2.0.0 - keygrip: 1.1.0 - dev: false - /core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: false - /cosmiconfig-typescript-loader@5.0.0(@types/node@20.11.20)(cosmiconfig@8.3.6)(typescript@5.3.3): + /cosmiconfig-typescript-loader@5.0.0(@types/node@20.11.28)(cosmiconfig@9.0.0)(typescript@5.4.2): resolution: {integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==} engines: {node: '>=v16'} peerDependencies: @@ -2803,14 +2706,14 @@ packages: cosmiconfig: '>=8.2' typescript: '>=4' dependencies: - '@types/node': 20.11.20 - cosmiconfig: 8.3.6(typescript@5.3.3) + '@types/node': 20.11.28 + cosmiconfig: 9.0.0(typescript@5.4.2) jiti: 1.20.0 - typescript: 5.3.3 + typescript: 5.4.2 dev: true - /cosmiconfig@8.3.6(typescript@5.3.3): - resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} + /cosmiconfig@9.0.0(typescript@5.4.2): + resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} engines: {node: '>=14'} peerDependencies: typescript: '>=4.9.5' @@ -2818,11 +2721,11 @@ packages: typescript: optional: true dependencies: + env-paths: 2.2.1 import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 - path-type: 4.0.0 - typescript: 5.3.3 + typescript: 5.4.2 dev: true /cp-file@9.1.0: @@ -2849,7 +2752,7 @@ packages: p-map: 5.5.0 dev: true - /create-jest@29.7.0(@types/node@20.11.20)(ts-node@10.9.2): + /create-jest@29.7.0(@types/node@20.11.28)(ts-node@10.9.2): resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -2858,7 +2761,7 @@ packages: chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.10 - jest-config: 29.7.0(@types/node@20.11.20)(ts-node@10.9.2) + jest-config: 29.7.0(@types/node@20.11.28)(ts-node@10.9.2) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -2907,9 +2810,9 @@ packages: raw-body: 2.5.2 dev: false - /dargs@7.0.0: - resolution: {integrity: sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==} - engines: {node: '>=8'} + /dargs@8.1.0: + resolution: {integrity: sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw==} + engines: {node: '>=12'} dev: true /data-urls@3.0.2: @@ -2956,19 +2859,6 @@ packages: ms: 2.1.2 supports-color: 5.5.0 - /decamelize-keys@1.1.1: - resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} - engines: {node: '>=0.10.0'} - dependencies: - decamelize: 1.2.0 - map-obj: 1.0.1 - dev: true - - /decamelize@1.2.0: - resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} - engines: {node: '>=0.10.0'} - dev: true - /decimal.js@10.4.3: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} dev: true @@ -2987,10 +2877,6 @@ packages: optional: true dev: true - /deep-equal@1.0.1: - resolution: {integrity: sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw==} - dev: false - /deep-extend@0.6.0: resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} engines: {node: '>=4.0.0'} @@ -3037,18 +2923,13 @@ packages: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} dev: false - /depd@1.1.2: - resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==} - engines: {node: '>= 0.6'} - dev: false - /depd@2.0.0: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} dev: false - /dependency-cruiser@16.2.1: - resolution: {integrity: sha512-Pb3u+MrxLW0wn8xB+0FIqJwZcuuxB52++nVjGyCjRhc7Rk4NUv7NMvpdc7XFW03oSH/JNmh9+pdkzMglcdbqVg==} + /dependency-cruiser@16.2.3: + resolution: {integrity: sha512-Zxf9i577VF7NbLaiCmMUnItskrehfNKogH39YtuDJfiLNF94FqTuAoWeFFx3WPAGclUZBMBT5HyL8cgoQn6jiw==} engines: {node: ^18.17||>=20} hasBin: true dependencies: @@ -3060,8 +2941,8 @@ packages: ajv: 8.12.0 chalk: 5.3.0 commander: 12.0.0 - enhanced-resolve: 5.15.0 - figures: 6.0.1 + enhanced-resolve: 5.15.1 + figures: 6.1.0 ignore: 5.3.1 indent-string: 5.0.0 interpret: 3.1.1 @@ -3076,7 +2957,7 @@ packages: semver-try-require: 6.2.3 teamcity-service-messages: 0.1.14 tsconfig-paths-webpack-plugin: 4.1.0 - watskeburt: 2.0.5 + watskeburt: 4.0.0 wrap-ansi: 9.0.0 dev: false @@ -3094,11 +2975,6 @@ packages: - supports-color dev: true - /destroy@1.2.0: - resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} - engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - dev: false - /detect-libc@2.0.1: resolution: {integrity: sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==} engines: {node: '>=8'} @@ -3313,11 +3189,6 @@ packages: is-obj: 2.0.0 dev: true - /dotenv@16.4.4: - resolution: {integrity: sha512-XvPXc8XAQThSjAbY6cQ/9PcBXmFoWuw1sQ3b8HqUCR6ziGXjkTi//kB9SWa2UwqlgdAIuRqAa/9hVljzPehbYg==} - engines: {node: '>=12'} - dev: false - /dotenv@16.4.5: resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} engines: {node: '>=12'} @@ -3371,11 +3242,6 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: false - /encodeurl@1.0.2: - resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} - engines: {node: '>= 0.8'} - dev: false - /end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} dependencies: @@ -3388,12 +3254,26 @@ packages: dependencies: graceful-fs: 4.2.10 tapable: 2.2.1 + dev: true + + /enhanced-resolve@5.15.1: + resolution: {integrity: sha512-3d3JRbwsCLJsYgvb6NuWEG44jjPSOMuS73L/6+7BZuoKm3W+qXnSoIYVHi8dG7Qcg4inAY4jbzkZ7MnskePeDg==} + engines: {node: '>=10.13.0'} + dependencies: + graceful-fs: 4.2.10 + tapable: 2.2.1 + dev: false /entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} dev: true + /env-paths@2.2.1: + resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} + engines: {node: '>=6'} + dev: true + /envalid@8.0.0: resolution: {integrity: sha512-PGeYJnJB5naN0ME6SH8nFcDj9HVbLpYIfg1p5lAyM9T4cH2lwtu2fLbozC/bq+HUUOIFxhX/LP0/GmlqPHT4tQ==} engines: {node: '>=8.12'} @@ -3480,10 +3360,6 @@ packages: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} - /escape-html@1.0.3: - resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} - dev: false - /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} @@ -3527,7 +3403,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@7.0.2)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@7.2.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -3548,7 +3424,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 7.0.2(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.2) debug: 3.2.7 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 @@ -3556,7 +3432,7 @@ packages: - supports-color dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.0.2)(eslint@8.57.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0)(eslint@8.57.0): resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} peerDependencies: @@ -3566,7 +3442,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 7.0.2(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.2) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -3575,7 +3451,7 @@ packages: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.0.2)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.2.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -3846,32 +3722,12 @@ packages: strnum: 1.0.5 dev: false - /fastify-multer@2.0.3: - resolution: {integrity: sha512-QnFqrRgxmUwWHTgX9uyQSu0C/hmVCfcxopqjApZ4uaZD5W9MJ+nHUlW4+9q7Yd3BRxDIuHvgiM5mjrh6XG8cAA==} - engines: {node: '>=10.17.0'} - dependencies: - '@fastify/busboy': 1.2.1 - append-field: 1.0.0 - concat-stream: 2.0.0 - fastify-plugin: 2.3.4 - mkdirp: 1.0.4 - on-finished: 2.4.1 - type-is: 1.6.18 - xtend: 4.0.2 - dev: false - - /fastify-plugin@2.3.4: - resolution: {integrity: sha512-I+Oaj6p9oiRozbam30sh39BiuiqBda7yK2nmSPVwDCfIBlKnT8YB3MY+pRQc2Fcd07bf6KPGklHJaQ2Qu81TYQ==} - dependencies: - semver: 7.6.0 - dev: false - /fastify-plugin@4.5.1: resolution: {integrity: sha512-stRHYGeuqpEZTL1Ef0Ovr2ltazUT9g844X5z/zEBFLG8RYlpDiOCIG+ATvYEp+/zmc7sN29mcIMp8gvYplYPIQ==} dev: false - /fastify@4.26.1: - resolution: {integrity: sha512-tznA/G55dsxzM5XChBfcvVSloG2ejeeotfPPJSFaWmHyCDVGMpvf3nRNbsCb/JTBF9RmQFBfuujWt3Nphjesng==} + /fastify@4.26.2: + resolution: {integrity: sha512-90pjTuPGrfVKtdpLeLzND5nyC4woXZN5VadiNQCicj/iJU4viNHKhsAnb7jmv1vu2IzkLXyBiCzdWuzeXgQ5Ug==} dependencies: '@fastify/ajv-compiler': 3.5.0 '@fastify/error': 3.4.1 @@ -3887,7 +3743,7 @@ packages: proxy-addr: 2.0.7 rfdc: 1.3.0 secure-json-parse: 2.7.0 - semver: 7.5.4 + semver: 7.6.0 toad-cache: 3.3.0 transitivePeerDependencies: - supports-color @@ -3916,8 +3772,8 @@ packages: pend: 1.2.0 dev: true - /figures@6.0.1: - resolution: {integrity: sha512-0oY/olScYD4IhQ8u//gCPA4F3mlTn2dacYmiDm/mbDQvpmLjV4uH+zhsQ5IyXRyvqkvtUkXkNdGvg5OFJTCsuQ==} + /figures@6.1.0: + resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} engines: {node: '>=18'} dependencies: is-unicode-supported: 2.0.0 @@ -4006,6 +3862,15 @@ packages: path-exists: 4.0.0 dev: true + /find-up@7.0.0: + resolution: {integrity: sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==} + engines: {node: '>=18'} + dependencies: + locate-path: 7.2.0 + path-exists: 5.0.0 + unicorn-magic: 0.1.0 + dev: true + /flat-cache@3.0.4: resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -4066,11 +3931,6 @@ packages: engines: {node: '>= 0.6'} dev: false - /fresh@0.5.2: - resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} - engines: {node: '>= 0.6'} - dev: false - /from2@2.3.0: resolution: {integrity: sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==} dependencies: @@ -4226,16 +4086,14 @@ packages: resolution: {integrity: sha512-5eDf9fuSXwxBL6q5HX+dhDj+dslFGWzU5thZ9kNKUkcPtaPdatmUFKwHFrLb/uf/WpA4BHET+AX3Scl56cAjpA==} dev: false - /git-raw-commits@2.0.11: - resolution: {integrity: sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==} - engines: {node: '>=10'} + /git-raw-commits@4.0.0: + resolution: {integrity: sha512-ICsMM1Wk8xSGMowkOmPrzo2Fgmfo4bMHLNX6ytHjajRJUqvHOw/TFapQ+QG75c3X/tTDDhOSRPGC52dDbNM8FQ==} + engines: {node: '>=16'} hasBin: true dependencies: - dargs: 7.0.0 - lodash: 4.17.21 - meow: 8.1.2 - split2: 3.2.2 - through2: 4.0.2 + dargs: 8.1.0 + meow: 12.1.1 + split2: 4.1.0 dev: true /glob-parent@5.1.2: @@ -4266,14 +4124,6 @@ packages: engines: {node: '>=18'} dependencies: ini: 4.1.1 - dev: false - - /global-dirs@0.1.1: - resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==} - engines: {node: '>=4'} - dependencies: - ini: 1.3.8 - dev: true /globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} @@ -4301,7 +4151,7 @@ packages: array-union: 2.1.0 dir-glob: 3.0.1 fast-glob: 3.2.12 - ignore: 5.3.0 + ignore: 5.3.1 merge2: 1.4.1 slash: 3.0.0 @@ -4349,11 +4199,6 @@ packages: uglify-js: 3.17.4 dev: false - /hard-rejection@2.1.0: - resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} - engines: {node: '>=6'} - dev: true - /has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} dev: true @@ -4421,17 +4266,6 @@ packages: engines: {node: '>=8'} dev: true - /hosted-git-info@2.8.9: - resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} - dev: true - - /hosted-git-info@4.1.0: - resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} - engines: {node: '>=10'} - dependencies: - lru-cache: 6.0.0 - dev: true - /html-encoding-sniffer@3.0.0: resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==} engines: {node: '>=12'} @@ -4443,25 +4277,6 @@ packages: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} dev: true - /http-assert@1.5.0: - resolution: {integrity: sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==} - engines: {node: '>= 0.8'} - dependencies: - deep-equal: 1.0.1 - http-errors: 1.8.1 - dev: false - - /http-errors@1.8.1: - resolution: {integrity: sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==} - engines: {node: '>= 0.6'} - dependencies: - depd: 1.1.2 - inherits: 2.0.4 - setprototypeof: 1.2.0 - statuses: 1.5.0 - toidentifier: 1.0.1 - dev: false - /http-errors@2.0.0: resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} engines: {node: '>= 0.8'} @@ -4552,11 +4367,11 @@ packages: /ignore@5.3.0: resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} engines: {node: '>= 4'} + dev: true /ignore@5.3.1: resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} - dev: false /immutable@4.3.5: resolution: {integrity: sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw==} @@ -4579,16 +4394,15 @@ packages: resolve-cwd: 3.0.0 dev: true + /import-meta-resolve@4.0.0: + resolution: {integrity: sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==} + dev: true + /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} dev: true - /indent-string@4.0.0: - resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} - engines: {node: '>=8'} - dev: true - /indent-string@5.0.0: resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} engines: {node: '>=12'} @@ -4613,7 +4427,6 @@ packages: /ini@4.1.1: resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dev: false /internal-slot@1.0.6: resolution: {integrity: sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==} @@ -4814,11 +4627,6 @@ packages: engines: {node: '>=12'} dev: false - /is-plain-obj@1.1.0: - resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} - engines: {node: '>=0.10.0'} - dev: true - /is-potential-custom-element-name@1.0.1: resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} dev: true @@ -5012,7 +4820,7 @@ packages: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.28 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.1 @@ -5033,7 +4841,7 @@ packages: - supports-color dev: true - /jest-cli@29.7.0(@types/node@20.11.20)(ts-node@10.9.2): + /jest-cli@29.7.0(@types/node@20.11.28)(ts-node@10.9.2): resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -5047,10 +4855,10 @@ packages: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.11.20)(ts-node@10.9.2) + create-jest: 29.7.0(@types/node@20.11.28)(ts-node@10.9.2) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@20.11.20)(ts-node@10.9.2) + jest-config: 29.7.0(@types/node@20.11.28)(ts-node@10.9.2) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.6.2 @@ -5061,7 +4869,7 @@ packages: - ts-node dev: true - /jest-config@29.7.0(@types/node@20.11.20)(ts-node@10.9.2): + /jest-config@29.7.0(@types/node@20.11.28)(ts-node@10.9.2): resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -5076,7 +4884,7 @@ packages: '@babel/core': 7.20.5 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.28 babel-jest: 29.7.0(@babel/core@7.20.5) chalk: 4.1.2 ci-info: 3.7.0 @@ -5096,7 +4904,7 @@ packages: pretty-format: 29.7.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.2(@types/node@20.11.20)(typescript@5.3.3) + ts-node: 10.9.2(@types/node@20.11.28)(typescript@5.4.2) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -5143,7 +4951,7 @@ packages: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 '@types/jsdom': 20.0.1 - '@types/node': 20.11.20 + '@types/node': 20.11.28 jest-mock: 29.7.0 jest-util: 29.7.0 jsdom: 20.0.3 @@ -5160,7 +4968,7 @@ packages: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.28 jest-mock: 29.7.0 jest-util: 29.7.0 dev: true @@ -5176,7 +4984,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.5 - '@types/node': 20.11.20 + '@types/node': 20.11.28 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.10 @@ -5227,7 +5035,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.28 jest-util: 29.7.0 dev: true @@ -5282,7 +5090,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.28 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.10 @@ -5313,7 +5121,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.28 chalk: 4.1.2 cjs-module-lexer: 1.2.2 collect-v8-coverage: 1.0.1 @@ -5365,7 +5173,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.28 chalk: 4.1.2 ci-info: 3.7.0 graceful-fs: 4.2.10 @@ -5390,7 +5198,7 @@ packages: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.20 + '@types/node': 20.11.28 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -5402,13 +5210,13 @@ packages: resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.28 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true - /jest@29.7.0(@types/node@20.11.20)(ts-node@10.9.2): + /jest@29.7.0(@types/node@20.11.28)(ts-node@10.9.2): resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -5421,7 +5229,7 @@ packages: '@jest/core': 29.7.0(ts-node@10.9.2) '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@20.11.20)(ts-node@10.9.2) + jest-cli: 29.7.0(@types/node@20.11.28)(ts-node@10.9.2) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -5595,18 +5403,6 @@ packages: engines: {node: '>=12.0.0'} dev: false - /keygrip@1.1.0: - resolution: {integrity: sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==} - engines: {node: '>= 0.6'} - dependencies: - tsscmp: 1.0.6 - dev: false - - /kind-of@6.0.3: - resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} - engines: {node: '>=0.10.0'} - dev: true - /kleur@3.0.3: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} @@ -5658,70 +5454,6 @@ packages: - supports-color dev: false - /koa-compose@4.1.0: - resolution: {integrity: sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==} - dev: false - - /koa-convert@2.0.0: - resolution: {integrity: sha512-asOvN6bFlSnxewce2e/DK3p4tltyfC4VM7ZwuTuepI7dEQVcvpyFuBcEARu1+Hxg8DIwytce2n7jrZtRlPrARA==} - engines: {node: '>= 10'} - dependencies: - co: 4.6.0 - koa-compose: 4.1.0 - dev: false - - /koa-qs@3.0.0: - resolution: {integrity: sha512-05IB5KirwMs3heWW26iTz46HuMAtrlrRMus/aNH1BRDocLyF/099EtCB0MIfQpRuT0TISvaTsWwSy2gctIWiGA==} - engines: {node: '>= 8'} - dependencies: - merge-descriptors: 1.0.1 - qs: 6.11.2 - dev: false - - /koa-router@12.0.1: - resolution: {integrity: sha512-gaDdj3GtzoLoeosacd50kBBTnnh3B9AYxDThQUo4sfUyXdOhY6ku1qyZKW88tQCRgc3Sw6ChXYXWZwwgjOxE0w==} - engines: {node: '>= 12'} - dependencies: - debug: 4.3.4(supports-color@5.5.0) - http-errors: 2.0.0 - koa-compose: 4.1.0 - methods: 1.1.2 - path-to-regexp: 6.2.1 - transitivePeerDependencies: - - supports-color - dev: false - - /koa@2.14.2: - resolution: {integrity: sha512-VFI2bpJaodz6P7x2uyLiX6RLYpZmOJqNmoCst/Yyd7hQlszyPwG/I9CQJ63nOtKSxpt5M7NH67V6nJL2BwCl7g==} - engines: {node: ^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4} - dependencies: - accepts: 1.3.8 - cache-content-type: 1.0.1 - content-disposition: 0.5.4 - content-type: 1.0.4 - cookies: 0.8.0 - debug: 4.3.4(supports-color@5.5.0) - delegates: 1.0.0 - depd: 2.0.0 - destroy: 1.2.0 - encodeurl: 1.0.2 - escape-html: 1.0.3 - fresh: 0.5.2 - http-assert: 1.5.0 - http-errors: 1.8.1 - is-generator-function: 1.0.10 - koa-compose: 4.1.0 - koa-convert: 2.0.0 - on-finished: 2.4.1 - only: 0.0.2 - parseurl: 1.3.3 - statuses: 1.5.0 - type-is: 1.6.18 - vary: 1.1.2 - transitivePeerDependencies: - - supports-color - dev: false - /leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -5805,12 +5537,15 @@ packages: p-locate: 5.0.0 dev: true - /lodash.camelcase@4.3.0: - resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + /locate-path@7.2.0: + resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + p-locate: 6.0.0 dev: true - /lodash.isfunction@3.0.9: - resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} + /lodash.camelcase@4.3.0: + resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} dev: true /lodash.isplainobject@4.0.6: @@ -5847,6 +5582,7 @@ packages: /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: false /log-symbols@4.1.0: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} @@ -5873,7 +5609,7 @@ packages: dependencies: yallist: 4.0.0 - /madge@6.1.0(typescript@5.3.3): + /madge@6.1.0(typescript@5.4.2): resolution: {integrity: sha512-irWhT5RpFOc6lkzGHKLihonCVgM0YtfNUh4IrFeW3EqHpnt/JHUG3z26j8PeJEktCGB4tmGOOOJi1Rl/ACWucQ==} engines: {node: '>=14'} hasBin: true @@ -5904,7 +5640,7 @@ packages: rc: 1.2.8 stream-to-array: 2.3.0 ts-graphviz: 1.5.3 - typescript: 5.3.3 + typescript: 5.4.2 walkdir: 0.4.1 transitivePeerDependencies: - supports-color @@ -5926,16 +5662,6 @@ packages: tmpl: 1.0.5 dev: true - /map-obj@1.0.1: - resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} - engines: {node: '>=0.10.0'} - dev: true - - /map-obj@4.3.0: - resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} - engines: {node: '>=8'} - dev: true - /md5@2.3.0: resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==} dependencies: @@ -5958,27 +5684,6 @@ packages: engines: {node: '>=16.10'} dev: true - /meow@8.1.2: - resolution: {integrity: sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==} - engines: {node: '>=10'} - dependencies: - '@types/minimist': 1.2.2 - camelcase-keys: 6.2.2 - decamelize-keys: 1.1.1 - hard-rejection: 2.1.0 - minimist-options: 4.1.0 - normalize-package-data: 3.0.3 - read-pkg-up: 7.0.1 - redent: 3.0.0 - trim-newlines: 3.0.1 - type-fest: 0.18.1 - yargs-parser: 20.2.9 - dev: true - - /merge-descriptors@1.0.1: - resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} - dev: false - /merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} dev: true @@ -5990,6 +5695,7 @@ packages: /methods@1.1.2: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} engines: {node: '>= 0.6'} + dev: true /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} @@ -5998,8 +5704,8 @@ packages: braces: 3.0.2 picomatch: 2.3.1 - /mikro-orm@6.1.5: - resolution: {integrity: sha512-PUT1KrppadH3dq1LD5ieZuxMqCMsgMh+wac7BZWCm8fCc32cobXq6y1YZxZQ6Y/nZb3K31YZjengFJMnedRJ6w==} + /mikro-orm@6.1.9: + resolution: {integrity: sha512-NbNkZcRrFOZlKr3emorNQGgtVYZOLlcwDEkfWR6fUJOs+W26fUnbQKmIN9lnD92dqSBWu0xj5nTANlVk/0uYdg==} engines: {node: '>= 18.12.0'} dev: false @@ -6029,11 +5735,6 @@ packages: engines: {node: '>=12'} dev: true - /min-indent@1.0.1: - resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} - engines: {node: '>=4'} - dev: true - /minimalistic-assert@1.0.1: resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} dev: false @@ -6050,18 +5751,13 @@ packages: brace-expansion: 2.0.1 dev: true - /minimist-options@4.1.0: - resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} - engines: {node: '>= 6'} - dependencies: - arrify: 1.0.1 - is-plain-obj: 1.1.0 - kind-of: 6.0.3 - dev: true - /minimist@1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} + /minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: true + /minio@7.1.3: resolution: {integrity: sha512-xPrLjWkTT5E7H7VnzOjF//xBp9I40jYB4aWhb2xTFopXXfw+Wo82DDWngdUju7Doy3Wk7R8C4LAgwhLHHnf0wA==} engines: {node: ^16 || ^18 || >=20} @@ -6350,11 +6046,6 @@ packages: randexp: 0.4.6 dev: false - /negotiator@0.6.3: - resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} - engines: {node: '>= 0.6'} - dev: false - /neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: false @@ -6454,25 +6145,6 @@ packages: abbrev: 1.1.1 dev: false - /normalize-package-data@2.5.0: - resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} - dependencies: - hosted-git-info: 2.8.9 - resolve: 1.22.8 - semver: 5.7.2 - validate-npm-package-license: 3.0.4 - dev: true - - /normalize-package-data@3.0.3: - resolution: {integrity: sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==} - engines: {node: '>=10'} - dependencies: - hosted-git-info: 4.1.0 - is-core-module: 2.13.1 - semver: 7.6.0 - validate-npm-package-license: 3.0.4 - dev: true - /normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -6602,10 +6274,6 @@ packages: mimic-fn: 4.0.0 dev: true - /only@0.0.2: - resolution: {integrity: sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ==} - dev: false - /optionator@0.8.3: resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==} engines: {node: '>= 0.8.0'} @@ -6683,6 +6351,13 @@ packages: yocto-queue: 0.1.0 dev: true + /p-limit@4.0.0: + resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + yocto-queue: 1.0.0 + dev: true + /p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} @@ -6697,6 +6372,13 @@ packages: p-limit: 3.1.0 dev: true + /p-locate@6.0.0: + resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + p-limit: 4.0.0 + dev: true + /p-map@5.5.0: resolution: {integrity: sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==} engines: {node: '>=12'} @@ -6748,16 +6430,16 @@ packages: entities: 4.5.0 dev: true - /parseurl@1.3.3: - resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} - engines: {node: '>= 0.8'} - dev: false - /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} dev: true + /path-exists@5.0.0: + resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + /path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} @@ -6775,10 +6457,6 @@ packages: /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - /path-to-regexp@6.2.1: - resolution: {integrity: sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==} - dev: false - /path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} @@ -6814,7 +6492,7 @@ packages: resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} engines: {node: '>=4.0.0'} - /pg-mem@2.8.1(@mikro-orm/core@6.1.5)(@mikro-orm/postgresql@6.1.5)(pg-promise@11.5.4): + /pg-mem@2.8.1(@mikro-orm/core@6.1.9)(@mikro-orm/postgresql@6.1.9)(pg-promise@11.5.4): resolution: {integrity: sha512-6akyFsbVnChtZT5QUMsyh8w2qp+Ym0+IZrWNojoVU+v38JFHjF5KQX+rKz2IHDR5Rpx+7Bsin+XCicox5ms9VA==} peerDependencies: '@mikro-orm/core': '>=4.5.3' @@ -6843,8 +6521,8 @@ packages: typeorm: optional: true dependencies: - '@mikro-orm/core': 6.1.5 - '@mikro-orm/postgresql': 6.1.5(@mikro-orm/core@6.1.5) + '@mikro-orm/core': 6.1.9 + '@mikro-orm/postgresql': 6.1.9(@mikro-orm/core@6.1.9) functional-red-black-tree: 1.0.1 immutable: 4.3.5 json-stable-stringify: 1.0.2 @@ -7287,11 +6965,6 @@ packages: resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} dev: false - /quick-lru@4.0.1: - resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} - engines: {node: '>=8'} - dev: true - /quote-unquote@1.0.0: resolution: {integrity: sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==} dev: true @@ -7340,25 +7013,6 @@ packages: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true - /read-pkg-up@7.0.1: - resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} - engines: {node: '>=8'} - dependencies: - find-up: 4.1.0 - read-pkg: 5.2.0 - type-fest: 0.8.1 - dev: true - - /read-pkg@5.2.0: - resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} - engines: {node: '>=8'} - dependencies: - '@types/normalize-package-data': 2.4.1 - normalize-package-data: 2.5.0 - parse-json: 5.2.0 - type-fest: 0.6.0 - dev: true - /readable-stream@1.1.14: resolution: {integrity: sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==} dependencies: @@ -7431,14 +7085,6 @@ packages: resolve: 1.22.8 dev: false - /redent@3.0.0: - resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} - engines: {node: '>=8'} - dependencies: - indent-string: 4.0.0 - strip-indent: 3.0.0 - dev: true - /reflect-metadata@0.2.1: resolution: {integrity: sha512-i5lLI6iw9AU3Uu4szRNPPEkomnkjRTaVt9hy/bn5g/oSzekBSMeLZblcjP74AW0vBabqERLLIrz+gR8QYR54Tw==} dev: false @@ -7504,13 +7150,6 @@ packages: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} - /resolve-global@1.0.0: - resolution: {integrity: sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==} - engines: {node: '>=8'} - dependencies: - global-dirs: 0.1.1 - dev: true - /resolve.exports@2.0.2: resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} engines: {node: '>=10'} @@ -7657,11 +7296,6 @@ packages: semver: 7.6.0 dev: false - /semver@5.7.2: - resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} - hasBin: true - dev: true - /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -7672,6 +7306,7 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 + dev: true /semver@7.6.0: resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} @@ -7828,28 +7463,6 @@ packages: dependencies: memory-pager: 1.5.0 - /spdx-correct@3.1.1: - resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} - dependencies: - spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.12 - dev: true - - /spdx-exceptions@2.3.0: - resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} - dev: true - - /spdx-expression-parse@3.0.1: - resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - dependencies: - spdx-exceptions: 2.3.0 - spdx-license-ids: 3.0.12 - dev: true - - /spdx-license-ids@3.0.12: - resolution: {integrity: sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==} - dev: true - /spex@3.3.0: resolution: {integrity: sha512-VNiXjFp6R4ldPbVRYbpxlD35yRHceecVXlct1J4/X80KuuPnW2AXMq3sGwhnJOhKkUsOxAT6nRGfGE5pocVw5w==} engines: {node: '>=10.0.0'} @@ -7860,12 +7473,6 @@ packages: engines: {node: '>=6'} dev: false - /split2@3.2.2: - resolution: {integrity: sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==} - dependencies: - readable-stream: 3.6.2 - dev: true - /split2@4.1.0: resolution: {integrity: sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==} engines: {node: '>= 10.x'} @@ -7886,11 +7493,6 @@ packages: escape-string-regexp: 2.0.0 dev: true - /statuses@1.5.0: - resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==} - engines: {node: '>= 0.6'} - dev: false - /statuses@2.0.1: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} @@ -8044,13 +7646,6 @@ packages: engines: {node: '>=12'} dev: true - /strip-indent@3.0.0: - resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} - engines: {node: '>=8'} - dependencies: - min-indent: 1.0.1 - dev: true - /strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} @@ -8216,6 +7811,7 @@ packages: resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==} dependencies: readable-stream: 3.6.2 + dev: false /through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} @@ -8298,18 +7894,13 @@ packages: dependencies: punycode: 2.3.1 - /trim-newlines@3.0.1: - resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} - engines: {node: '>=8'} - dev: true - - /ts-api-utils@1.0.3(typescript@5.3.3): + /ts-api-utils@1.0.3(typescript@5.4.2): resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} engines: {node: '>=16.13.0'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.3.3 + typescript: 5.4.2 dev: true /ts-graphviz@1.5.3: @@ -8317,7 +7908,7 @@ packages: engines: {node: '>=14.16'} dev: true - /ts-node@10.9.2(@types/node@20.11.20)(typescript@5.3.3): + /ts-node@10.9.2(@types/node@20.11.28)(typescript@5.4.2): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true peerDependencies: @@ -8336,14 +7927,14 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 - '@types/node': 20.11.20 + '@types/node': 20.11.28 acorn: 8.11.2 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.3.3 + typescript: 5.4.2 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true @@ -8353,7 +7944,7 @@ packages: engines: {node: '>=10.13.0'} dependencies: chalk: 4.1.2 - enhanced-resolve: 5.15.0 + enhanced-resolve: 5.15.1 tsconfig-paths: 4.2.0 dev: false @@ -8390,11 +7981,6 @@ packages: /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - /tsscmp@1.0.6: - resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==} - engines: {node: '>=0.6.x'} - dev: false - /tsutils@3.21.0(typescript@3.9.10): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} @@ -8441,11 +8027,6 @@ packages: engines: {node: '>=4'} dev: true - /type-fest@0.18.1: - resolution: {integrity: sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==} - engines: {node: '>=10'} - dev: true - /type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} @@ -8456,16 +8037,6 @@ packages: engines: {node: '>=10'} dev: true - /type-fest@0.6.0: - resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} - engines: {node: '>=8'} - dev: true - - /type-fest@0.8.1: - resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} - engines: {node: '>=8'} - dev: true - /type-fest@3.13.1: resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} engines: {node: '>=14.16'} @@ -8517,10 +8088,6 @@ packages: is-typed-array: 1.1.12 dev: true - /typedarray@0.0.6: - resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - dev: false - /typescript@3.9.10: resolution: {integrity: sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==} engines: {node: '>=4.2.0'} @@ -8533,8 +8100,8 @@ packages: hasBin: true dev: true - /typescript@5.3.3: - resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + /typescript@5.4.2: + resolution: {integrity: sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==} engines: {node: '>=14.17'} hasBin: true dev: true @@ -8563,6 +8130,11 @@ packages: /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + /unicorn-magic@0.1.0: + resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} + engines: {node: '>=18'} + dev: true + /uniq@1.0.1: resolution: {integrity: sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==} dev: true @@ -8641,18 +8213,6 @@ packages: convert-source-map: 1.9.0 dev: true - /validate-npm-package-license@3.0.4: - resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} - dependencies: - spdx-correct: 3.1.1 - spdx-expression-parse: 3.0.1 - dev: true - - /vary@1.1.2: - resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} - engines: {node: '>= 0.8'} - dev: false - /w3c-xmlserializer@4.0.0: resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==} engines: {node: '>=14'} @@ -8671,8 +8231,8 @@ packages: makeerror: 1.0.12 dev: true - /watskeburt@2.0.5: - resolution: {integrity: sha512-mCxVT4o/U+nNxmYJ+Oei3qre4F28IBWR9c7RGS8aeAR7a7UY1y4ikTWcv+kaaybf1QXUANmB7XBHawHBcmg+kw==} + /watskeburt@4.0.0: + resolution: {integrity: sha512-hGcxm3qH9/lBE1JUCm6DFh2hLOoGT4/SPAyutyKN6zOL5ClAiwDSgtwWg6yxHgympkWJTun4fftdPT2dgvLbxQ==} engines: {node: ^18||>=20} hasBin: true dev: false @@ -8901,11 +8461,6 @@ packages: engines: {node: '>= 14'} dev: true - /yargs-parser@20.2.9: - resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} - engines: {node: '>=10'} - dev: true - /yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} @@ -8931,11 +8486,6 @@ packages: fd-slicer: 1.1.0 dev: true - /ylru@1.3.2: - resolution: {integrity: sha512-RXRJzMiK6U2ye0BlGGZnmpwJDPgakn6aNQ0A7gHRbD4I0uvK4TW6UqkK1V0pp9jskjJBAXd3dRrbzWkqJ+6cxA==} - engines: {node: '>= 4.0.0'} - dev: false - /yn@3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} engines: {node: '>=6'} @@ -8946,6 +8496,11 @@ packages: engines: {node: '>=10'} dev: true + /yocto-queue@1.0.0: + resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} + engines: {node: '>=12.20'} + dev: true + /zod@3.22.4: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false diff --git a/src/Auth/Domain/Exceptions/BadCredentialsException.ts b/src/Auth/Domain/Exceptions/BadCredentialsException.ts index c5b89f39..9e6929d0 100644 --- a/src/Auth/Domain/Exceptions/BadCredentialsException.ts +++ b/src/Auth/Domain/Exceptions/BadCredentialsException.ts @@ -1,4 +1,4 @@ -import { ErrorException } from '@digichanges/shared-experience'; +import { ErrorException } from '../../../Main/Domain/Errors/ErrorException'; class BadCredentialsException extends ErrorException { diff --git a/src/Auth/Domain/Exceptions/CantDisabledException.ts b/src/Auth/Domain/Exceptions/CantDisabledException.ts index 30e40012..ab4f2eba 100644 --- a/src/Auth/Domain/Exceptions/CantDisabledException.ts +++ b/src/Auth/Domain/Exceptions/CantDisabledException.ts @@ -1,4 +1,4 @@ -import { ErrorException } from '@digichanges/shared-experience'; +import { ErrorException } from '../../../Main/Domain/Errors/ErrorException'; class CantDisabledException extends ErrorException { diff --git a/src/Auth/Domain/Exceptions/ForbiddenException.ts b/src/Auth/Domain/Exceptions/ForbiddenException.ts index fd9ec93a..e0e0c189 100644 --- a/src/Auth/Domain/Exceptions/ForbiddenException.ts +++ b/src/Auth/Domain/Exceptions/ForbiddenException.ts @@ -1,4 +1,4 @@ -import { ErrorException } from '@digichanges/shared-experience'; +import { ErrorException } from '../../../Main/Domain/Errors/ErrorException'; class ForbiddenException extends ErrorException { diff --git a/src/Auth/Domain/Exceptions/PasswordWrongException.ts b/src/Auth/Domain/Exceptions/PasswordWrongException.ts index 94c0906b..456be376 100644 --- a/src/Auth/Domain/Exceptions/PasswordWrongException.ts +++ b/src/Auth/Domain/Exceptions/PasswordWrongException.ts @@ -1,4 +1,4 @@ -import { ErrorException } from '@digichanges/shared-experience'; +import { ErrorException } from '../../../Main/Domain/Errors/ErrorException'; class PasswordWrongException extends ErrorException { diff --git a/src/Auth/Domain/Exceptions/UnverifiedUserException.ts b/src/Auth/Domain/Exceptions/UnverifiedUserException.ts index b8318fb4..6be343f3 100644 --- a/src/Auth/Domain/Exceptions/UnverifiedUserException.ts +++ b/src/Auth/Domain/Exceptions/UnverifiedUserException.ts @@ -1,4 +1,4 @@ -import { ErrorException } from '@digichanges/shared-experience'; +import { ErrorException } from '../../../Main/Domain/Errors/ErrorException'; class UnverifiedUserException extends ErrorException { diff --git a/src/Auth/Domain/Exceptions/UserDisabledException.ts b/src/Auth/Domain/Exceptions/UserDisabledException.ts index c28bca9f..2a502259 100644 --- a/src/Auth/Domain/Exceptions/UserDisabledException.ts +++ b/src/Auth/Domain/Exceptions/UserDisabledException.ts @@ -1,4 +1,4 @@ -import { ErrorException } from '@digichanges/shared-experience'; +import { ErrorException } from '../../../Main/Domain/Errors/ErrorException'; class UserDisabledException extends ErrorException { diff --git a/src/Auth/Domain/Exceptions/WrongPermissionsException.ts b/src/Auth/Domain/Exceptions/WrongPermissionsException.ts index 71490391..cf0340dd 100644 --- a/src/Auth/Domain/Exceptions/WrongPermissionsException.ts +++ b/src/Auth/Domain/Exceptions/WrongPermissionsException.ts @@ -1,4 +1,4 @@ -import { ErrorException } from '@digichanges/shared-experience'; +import { ErrorException } from '../../../Main/Domain/Errors/ErrorException'; class WrongPermissionsException extends ErrorException { diff --git a/src/Auth/Domain/Models/ILoginResponse.ts b/src/Auth/Domain/Models/ILoginResponse.ts deleted file mode 100644 index e8bce953..00000000 --- a/src/Auth/Domain/Models/ILoginResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ - -interface ILoginResponse -{ - accessToken: string; - refreshToken: string; - expiresIn: number; - refreshExpiresIn: number; -} - -export default ILoginResponse; diff --git a/src/Auth/Domain/Payload/PermissionRepPayload.ts b/src/Auth/Domain/Payload/PermissionRepPayload.ts deleted file mode 100644 index 4232ecee..00000000 --- a/src/Auth/Domain/Payload/PermissionRepPayload.ts +++ /dev/null @@ -1,9 +0,0 @@ -interface PermissionRepPayload -{ - resources: string[]; - policies: string[]; - name: string; - description: string; - decisionStrategy: string; -} -export default PermissionRepPayload; diff --git a/src/Auth/Infrastructure/Events/EmailEvent.ts b/src/Auth/Infrastructure/Events/EmailEvent.ts index db5843c8..587dbe96 100644 --- a/src/Auth/Infrastructure/Events/EmailEvent.ts +++ b/src/Auth/Infrastructure/Events/EmailEvent.ts @@ -1,6 +1,6 @@ import NotifierFactory from '../../../Notification/Shared/NotifierFactory'; -import { IEvent } from '@digichanges/shared-experience'; import { FACTORIES } from '../../../Shared/DI/Injects'; +import { IEvent } from '../../../Notification/Domain/Models/IEvent'; class EmailEvent implements IEvent { diff --git a/src/Auth/Infrastructure/Repositories/Auth/AuthSupabaseRepository.ts b/src/Auth/Infrastructure/Repositories/Auth/AuthSupabaseRepository.ts index 4fd9344d..f6d58026 100644 --- a/src/Auth/Infrastructure/Repositories/Auth/AuthSupabaseRepository.ts +++ b/src/Auth/Infrastructure/Repositories/Auth/AuthSupabaseRepository.ts @@ -4,11 +4,12 @@ import IAuthRepository from '../../../Domain/Repositories/IAuthRepository'; import PermissionPayload from '../../../Domain/Payload/PermissionPayload'; import { MainConfig } from '../../../../Config/MainConfig'; -import { ErrorHttpException, StatusCode } from '@digichanges/shared-experience'; import IUserDomain from '../../../Domain/Entities/IUserDomain'; import IRoleDomain from '../../../Domain/Entities/IRoleDomain'; import IPermissionDomain from '../../../Domain/Entities/IPermissionDomain'; import IRolePermissionDomain from '../../../Domain/Entities/IRolePermissionDomain'; +import { ErrorHttpException } from '../../../../Main/Presentation/Exceptions/ErrorHttpException'; +import { StatusCode } from '../../../../Main/Presentation/Application/StatusCode'; class AuthSupabaseRepository implements IAuthRepository { diff --git a/src/Auth/Infrastructure/Repositories/Auth/BaseAxiosRepository.ts b/src/Auth/Infrastructure/Repositories/Auth/BaseAxiosRepository.ts deleted file mode 100644 index c6a48167..00000000 --- a/src/Auth/Infrastructure/Repositories/Auth/BaseAxiosRepository.ts +++ /dev/null @@ -1,22 +0,0 @@ - -class BaseAxiosRepository -{ - protected config: Record; - - constructor() - { - this.config = { - method: 'get', - maxBodyLength: Infinity, - headers: { - 'Content-Type': 'application/json' - }, - validateStatus: (status: number) => - { - return status < 500; - } - }; - } -} - -export default BaseAxiosRepository; diff --git a/src/Auth/Infrastructure/Repositories/Auth/Responses/PermissionResponse.ts b/src/Auth/Infrastructure/Repositories/Auth/Responses/PermissionResponse.ts deleted file mode 100644 index d8e8b637..00000000 --- a/src/Auth/Infrastructure/Repositories/Auth/Responses/PermissionResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -interface PermissionResponse -{ - id: string; - name: string; - description: string; - type: string; - policies?: string[] - resources?: string[] - logic: string; - decisionStrategy: string; -} - -export default PermissionResponse; diff --git a/src/Auth/Infrastructure/Repositories/BaseResponses/ErrorResponse.ts b/src/Auth/Infrastructure/Repositories/BaseResponses/ErrorResponse.ts deleted file mode 100644 index 18b144bb..00000000 --- a/src/Auth/Infrastructure/Repositories/BaseResponses/ErrorResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ - -interface ErrorResponse -{ - error?: string; - error_description?: string; -} - -export default ErrorResponse; diff --git a/src/Auth/Presentation/Controllers/AuthFastifyController.ts b/src/Auth/Presentation/Controllers/AuthFastifyController.ts index d13bcfd9..1739b415 100644 --- a/src/Auth/Presentation/Controllers/AuthFastifyController.ts +++ b/src/Auth/Presentation/Controllers/AuthFastifyController.ts @@ -1,9 +1,9 @@ -import { StatusCode } from '@digichanges/shared-experience'; import FastifyResponder from '../../../Main/Presentation/Utils/FastifyResponder'; import SyncPermissionsUseCase from '../../Domain/UseCases/Auth/SyncPermissionsUseCase'; import IGroupPermission from '../../../Config/IGroupPermission'; import PermissionsTransformer from '../Transformers/PermissionsTransformer'; import PermissionUseCase from '../../Domain/UseCases/Auth/PermissionUseCase'; +import { StatusCode } from '../../../Main/Presentation/Application/StatusCode'; const responder: FastifyResponder = new FastifyResponder(); diff --git a/src/Auth/Presentation/Exceptions/TokenExpiredHttpException.ts b/src/Auth/Presentation/Exceptions/TokenExpiredHttpException.ts index 9878b6de..dffd4f67 100644 --- a/src/Auth/Presentation/Exceptions/TokenExpiredHttpException.ts +++ b/src/Auth/Presentation/Exceptions/TokenExpiredHttpException.ts @@ -1,4 +1,5 @@ -import { StatusCode, ErrorHttpException } from '@digichanges/shared-experience'; +import { ErrorHttpException } from '../../../Main/Presentation/Exceptions/ErrorHttpException'; +import { StatusCode } from '../../../Main/Presentation/Application/StatusCode'; class TokenExpiredHttpException extends ErrorHttpException { diff --git a/src/Auth/Presentation/Exceptions/TokenNotFoundHttpException.ts b/src/Auth/Presentation/Exceptions/TokenNotFoundHttpException.ts index 04590265..2e22efd6 100644 --- a/src/Auth/Presentation/Exceptions/TokenNotFoundHttpException.ts +++ b/src/Auth/Presentation/Exceptions/TokenNotFoundHttpException.ts @@ -1,4 +1,5 @@ -import { ErrorHttpException, StatusCode } from '@digichanges/shared-experience'; +import { ErrorHttpException } from '../../../Main/Presentation/Exceptions/ErrorHttpException'; +import { StatusCode } from '../../../Main/Presentation/Application/StatusCode'; class TokenNotFoundHttpException extends ErrorHttpException { diff --git a/src/Auth/Presentation/Helpers/Validations.ts b/src/Auth/Presentation/Helpers/Validations.ts deleted file mode 100644 index 555def4e..00000000 --- a/src/Auth/Presentation/Helpers/Validations.ts +++ /dev/null @@ -1,8 +0,0 @@ - -export const checkPassword = { - check: (data) => data.password === data.passwordConfirmation, - message: { - message: 'Passwords don\'t match', - path: ['passwordConfirmation'] - } -}; diff --git a/src/Auth/Presentation/Middlewares/AuthorizeFastifyMiddleware.ts b/src/Auth/Presentation/Middlewares/AuthorizeFastifyMiddleware.ts index 1b75030a..3e827fc3 100644 --- a/src/Auth/Presentation/Middlewares/AuthorizeFastifyMiddleware.ts +++ b/src/Auth/Presentation/Middlewares/AuthorizeFastifyMiddleware.ts @@ -1,11 +1,11 @@ import { FastifyReply, FastifyRequest } from 'fastify'; -import { StatusCode } from '@digichanges/shared-experience'; import { MainConfig } from '../../../Config/MainConfig'; import container from '../../../Shared/DI/container'; import TokenNotFoundHttpException from '../Exceptions/TokenNotFoundHttpException'; import IAuthorizeService from '../../Domain/Services/IAuthorizeService'; import { SERVICES } from '../../../Shared/DI/Injects'; +import { StatusCode } from '../../../Main/Presentation/Application/StatusCode'; const AuthorizeFastifyMiddleware = (...handlerPermissions: string[]) => { diff --git a/src/Auth/Presentation/Transformers/PermissionsTransformer.ts b/src/Auth/Presentation/Transformers/PermissionsTransformer.ts index e2e79cac..244ccda2 100644 --- a/src/Auth/Presentation/Transformers/PermissionsTransformer.ts +++ b/src/Auth/Presentation/Transformers/PermissionsTransformer.ts @@ -1,4 +1,4 @@ -import { Transformer } from '@digichanges/shared-experience'; +import { Transformer } from '../../../Main/Presentation/Transformers'; class PermissionsTransformer extends Transformer { diff --git a/src/Auth/Tests/DataMock.ts b/src/Auth/Tests/DataMock.ts index 2a711ec6..002f729e 100644 --- a/src/Auth/Tests/DataMock.ts +++ b/src/Auth/Tests/DataMock.ts @@ -1,5 +1,5 @@ -import { IPaginator } from '@digichanges/shared-experience'; import dayjs from 'dayjs'; +import { IPaginator } from '../../Main/Domain/Criteria/IPaginator'; export const payloadUser = { birthdate: dayjs('1970-01-01', 'yyyy-mm-dd').toDate(), diff --git a/src/Config/exceptions.ts b/src/Config/exceptions.ts index 3142281d..fe20cd94 100644 --- a/src/Config/exceptions.ts +++ b/src/Config/exceptions.ts @@ -1,6 +1,8 @@ -import { StatusCode, DecryptForbiddenException, NotFoundException } from '@digichanges/shared-experience'; +import { StatusCode } from '../Main/Presentation/Application/StatusCode'; import InvalidPasswordException from '../Main/Domain/Exceptions/InvalidPasswordException'; import ForbiddenException from '../Auth/Domain/Exceptions/ForbiddenException'; +import { DecryptForbiddenException } from '../Main/Infrastructure/Exceptions/DecryptForbiddenException'; +import { NotFoundException } from '../Main/Domain/Exceptions/NotFoundException'; const exceptions = { [DecryptForbiddenException.name]: StatusCode.HTTP_FORBIDDEN, diff --git a/src/File/Presentation/DTO/FileBase64OptimizeDTO.ts b/src/File/Domain/DTO/FileBase64OptimizeDTO.ts similarity index 88% rename from src/File/Presentation/DTO/FileBase64OptimizeDTO.ts rename to src/File/Domain/DTO/FileBase64OptimizeDTO.ts index 81bdfc8d..d7a32745 100644 --- a/src/File/Presentation/DTO/FileBase64OptimizeDTO.ts +++ b/src/File/Domain/DTO/FileBase64OptimizeDTO.ts @@ -1,5 +1,5 @@ -import FileOptionsQueryPayload from '../../Domain/Payloads/FileOptionsQueryPayload'; -import FileBase64RepPayload from '../../Domain/Payloads/FileBase64RepPayload'; +import FileOptionsQueryPayload from '../Payloads/FileOptionsQueryPayload'; +import FileBase64RepPayload from '../Payloads/FileBase64RepPayload'; class FileBase64OptimizeDTO implements FileBase64RepPayload { diff --git a/src/File/Presentation/DTO/FileMultipartOptimizeDTO.ts b/src/File/Domain/DTO/FileMultipartOptimizeDTO.ts similarity index 57% rename from src/File/Presentation/DTO/FileMultipartOptimizeDTO.ts rename to src/File/Domain/DTO/FileMultipartOptimizeDTO.ts index 3f86cfe6..078434dc 100644 --- a/src/File/Presentation/DTO/FileMultipartOptimizeDTO.ts +++ b/src/File/Domain/DTO/FileMultipartOptimizeDTO.ts @@ -1,6 +1,6 @@ -import FileMultipartRepPayload from '../../Domain/Payloads/FileMultipartRepPayload'; -import IFileVersionPayload from '../../Domain/Entities/IFileVersionPayload'; -import FileOptionsQueryPayload from '../../Domain/Payloads/FileOptionsQueryPayload'; +import FileMultipartRepPayload from '../Payloads/FileMultipartRepPayload'; +import IFileVersionPayload from '../Entities/IFileVersionPayload'; +import FileOptionsQueryPayload from '../Payloads/FileOptionsQueryPayload'; class FileMultipartOptimizeDTO implements FileMultipartRepPayload { diff --git a/src/File/Presentation/DTO/FileUpdateBase64OptimizeDTO.ts b/src/File/Domain/DTO/FileUpdateBase64OptimizeDTO.ts similarity index 84% rename from src/File/Presentation/DTO/FileUpdateBase64OptimizeDTO.ts rename to src/File/Domain/DTO/FileUpdateBase64OptimizeDTO.ts index 9b6c8ff2..975a66cd 100644 --- a/src/File/Presentation/DTO/FileUpdateBase64OptimizeDTO.ts +++ b/src/File/Domain/DTO/FileUpdateBase64OptimizeDTO.ts @@ -1,5 +1,5 @@ import FileBase64OptimizeDTO from './FileBase64OptimizeDTO'; -import FileUpdateBase64Payload from '../../Domain/Payloads/FileUpdateBase64Payload'; +import FileUpdateBase64Payload from '../Payloads/FileUpdateBase64Payload'; class FileUpdateBase64OptimizeDTO extends FileBase64OptimizeDTO implements FileUpdateBase64Payload { diff --git a/src/File/Presentation/DTO/FileUpdateMultipartOptimizeDTO.ts b/src/File/Domain/DTO/FileUpdateMultipartOptimizeDTO.ts similarity index 65% rename from src/File/Presentation/DTO/FileUpdateMultipartOptimizeDTO.ts rename to src/File/Domain/DTO/FileUpdateMultipartOptimizeDTO.ts index e97c290b..045d6b32 100644 --- a/src/File/Presentation/DTO/FileUpdateMultipartOptimizeDTO.ts +++ b/src/File/Domain/DTO/FileUpdateMultipartOptimizeDTO.ts @@ -1,7 +1,7 @@ -import IFileVersionPayload from '../../Domain/Entities/IFileVersionPayload'; -import FileUpdateMultipartPayload from '../../Domain/Payloads/FileUpdateMultipartPayload'; +import IFileVersionPayload from '../Entities/IFileVersionPayload'; +import FileUpdateMultipartPayload from '../Payloads/FileUpdateMultipartPayload'; import FileMultipartOptimizeDTO from './FileMultipartOptimizeDTO'; -import FileOptionsQueryPayload from '../../Domain/Payloads/FileOptionsQueryPayload'; +import FileOptionsQueryPayload from '../Payloads/FileOptionsQueryPayload'; class FileUpdateMultipartOptimizeDTO extends FileMultipartOptimizeDTO implements FileUpdateMultipartPayload { diff --git a/src/File/Presentation/DTO/FileVersionOptimizeDTO.ts b/src/File/Domain/DTO/FileVersionOptimizeDTO.ts similarity index 80% rename from src/File/Presentation/DTO/FileVersionOptimizeDTO.ts rename to src/File/Domain/DTO/FileVersionOptimizeDTO.ts index a2577d8a..c2520851 100644 --- a/src/File/Presentation/DTO/FileVersionOptimizeDTO.ts +++ b/src/File/Domain/DTO/FileVersionOptimizeDTO.ts @@ -1,6 +1,6 @@ -import IFileVersionOptimizeDTO from '../../Domain/Payloads/IFileVersionOptimizeDTO'; -import IFileVersionPayload from '../../Domain/Entities/IFileVersionPayload'; -import IFileVersionDomain from '../../Domain/Entities/IFileVersionDomain'; +import IFileVersionOptimizeDTO from '../Payloads/IFileVersionOptimizeDTO'; +import IFileVersionPayload from '../Entities/IFileVersionPayload'; +import IFileVersionDomain from '../Entities/IFileVersionDomain'; class FileVersionOptimizeDTO implements IFileVersionOptimizeDTO { diff --git a/src/File/Domain/Entities/File.ts b/src/File/Domain/Entities/File.ts index a9ffb981..d55c9968 100644 --- a/src/File/Domain/Entities/File.ts +++ b/src/File/Domain/Entities/File.ts @@ -1,5 +1,5 @@ -import { Base } from '@digichanges/shared-experience'; import IFileDomain from './IFileDomain'; +import { Base } from '../../../Main/Domain/Entities'; class File extends Base implements IFileDomain { diff --git a/src/File/Domain/Entities/FileVersion.ts b/src/File/Domain/Entities/FileVersion.ts index eab10db5..80d1e527 100644 --- a/src/File/Domain/Entities/FileVersion.ts +++ b/src/File/Domain/Entities/FileVersion.ts @@ -1,7 +1,7 @@ -import { Base } from '@digichanges/shared-experience'; import IFileVersionDomain from './IFileVersionDomain'; import IFileBuild from './IFileBuild'; import IFileDomain from './IFileDomain'; +import { Base } from '../../../Main/Domain/Entities'; class FileVersion extends Base implements IFileVersionDomain { diff --git a/src/File/Domain/Entities/IFileDomain.ts b/src/File/Domain/Entities/IFileDomain.ts index 999c2511..0c86a121 100644 --- a/src/File/Domain/Entities/IFileDomain.ts +++ b/src/File/Domain/Entities/IFileDomain.ts @@ -1,4 +1,4 @@ -import { IBaseDomain } from '@digichanges/shared-experience'; +import { IBaseDomain } from '../../../Main/Domain/Entities'; interface IFileDomain extends IBaseDomain { diff --git a/src/File/Domain/Entities/IFileDomainDto.ts b/src/File/Domain/Entities/IFileDomainDto.ts deleted file mode 100644 index ea4763e9..00000000 --- a/src/File/Domain/Entities/IFileDomainDto.ts +++ /dev/null @@ -1,8 +0,0 @@ - -interface IFileDomainDto -{ - id: string; - url: string; -} - -export default IFileDomainDto; diff --git a/src/File/Domain/Entities/IFileVersionDomain.ts b/src/File/Domain/Entities/IFileVersionDomain.ts index 60c4508e..ca734754 100644 --- a/src/File/Domain/Entities/IFileVersionDomain.ts +++ b/src/File/Domain/Entities/IFileVersionDomain.ts @@ -1,6 +1,6 @@ -import { IBaseDomain } from '@digichanges/shared-experience'; import IFileDomain from './IFileDomain'; import FileRepPayload from '../Payloads/FileRepPayload'; +import { IBaseDomain } from '../../../Main/Domain/Entities'; interface IFileVersionDomain extends IBaseDomain, FileRepPayload { diff --git a/src/File/Domain/Payloads/DownloadPayload.ts b/src/File/Domain/Payloads/DownloadPayload.ts index d9a45421..443e4742 100644 --- a/src/File/Domain/Payloads/DownloadPayload.ts +++ b/src/File/Domain/Payloads/DownloadPayload.ts @@ -1,5 +1,5 @@ import VersionPayload from './VersionPayload'; -import { IdPayload } from '@digichanges/shared-experience'; +import { IdPayload } from '../../../Main/Domain/Payloads/IdPayload'; interface DownloadPayload extends VersionPayload, IdPayload {} diff --git a/src/File/Domain/Payloads/FileRepPayload.ts b/src/File/Domain/Payloads/FileRepPayload.ts index d6c00c3c..9a0cc6e5 100644 --- a/src/File/Domain/Payloads/FileRepPayload.ts +++ b/src/File/Domain/Payloads/FileRepPayload.ts @@ -1,4 +1,4 @@ -import { FileVersionPayload } from '@digichanges/shared-experience'; +import { FileVersionPayload } from './FileVersionPayload'; interface FileRepPayload extends FileVersionPayload { diff --git a/src/File/Domain/Payloads/FileUpdateBase64Payload.ts b/src/File/Domain/Payloads/FileUpdateBase64Payload.ts index 1a2c542b..e27a8925 100644 --- a/src/File/Domain/Payloads/FileUpdateBase64Payload.ts +++ b/src/File/Domain/Payloads/FileUpdateBase64Payload.ts @@ -1,5 +1,5 @@ -import { IdPayload } from '@digichanges/shared-experience'; import FileBase64RepPayload from './FileBase64RepPayload'; +import { IdPayload } from '../../../Main/Domain/Payloads/IdPayload'; interface FileUpdateBase64Payload extends IdPayload, FileBase64RepPayload {} diff --git a/src/File/Domain/Payloads/FileUpdateMultipartPayload.ts b/src/File/Domain/Payloads/FileUpdateMultipartPayload.ts index d7ac889c..74c6014f 100644 --- a/src/File/Domain/Payloads/FileUpdateMultipartPayload.ts +++ b/src/File/Domain/Payloads/FileUpdateMultipartPayload.ts @@ -1,5 +1,5 @@ -import { IdPayload } from '@digichanges/shared-experience'; import FileMultipartRepPayload from './FileMultipartRepPayload'; +import { IdPayload } from '../../../Main/Domain/Payloads/IdPayload'; interface FileUpdateMultipartPayload extends IdPayload, FileMultipartRepPayload {} diff --git a/src/File/Domain/Payloads/FileVersionPayload.ts b/src/File/Domain/Payloads/FileVersionPayload.ts new file mode 100644 index 00000000..f96853b1 --- /dev/null +++ b/src/File/Domain/Payloads/FileVersionPayload.ts @@ -0,0 +1,11 @@ + +export interface FileVersionPayload +{ + name: string; + version: number; + isOptimized: boolean; + objectPath: string; + isPublic: boolean; + mimeType: string; + size: number; +} diff --git a/src/File/Domain/Payloads/ListObjectsPayload.ts b/src/File/Domain/Payloads/ListObjectsPayload.ts index da979703..fcb20ad2 100644 --- a/src/File/Domain/Payloads/ListObjectsPayload.ts +++ b/src/File/Domain/Payloads/ListObjectsPayload.ts @@ -1,9 +1,7 @@ -import FileOptionsQueryPayload from './FileOptionsQueryPayload'; -interface ListObjectsPayload extends FileOptionsQueryPayload +export interface ListObjectsPayload { - recursive: boolean, - prefix: string, + recursive: boolean; + prefix: string; + isPublic: boolean; } - -export default ListObjectsPayload; diff --git a/src/File/Domain/Payloads/OptimizePayload.ts b/src/File/Domain/Payloads/OptimizePayload.ts index 5651fb5a..1aecb337 100644 --- a/src/File/Domain/Payloads/OptimizePayload.ts +++ b/src/File/Domain/Payloads/OptimizePayload.ts @@ -1,5 +1,5 @@ -import { IdPayload } from '@digichanges/shared-experience'; import FileOptionsQueryPayload from './FileOptionsQueryPayload'; +import { IdPayload } from '../../../Main/Domain/Payloads/IdPayload'; interface OptimizePayload extends IdPayload, FileOptionsQueryPayload {} diff --git a/src/File/Infrastructure/Repositories/IFileRepository.ts b/src/File/Domain/Repositories/IFileRepository.ts similarity index 60% rename from src/File/Infrastructure/Repositories/IFileRepository.ts rename to src/File/Domain/Repositories/IFileRepository.ts index 3d7bd82d..b0a0785b 100644 --- a/src/File/Infrastructure/Repositories/IFileRepository.ts +++ b/src/File/Domain/Repositories/IFileRepository.ts @@ -1,7 +1,7 @@ -import { ICriteria } from '@digichanges/shared-experience'; -import { IPaginator } from '@digichanges/shared-experience'; -import IFileDomain from '../../Domain/Entities/IFileDomain'; +import IFileDomain from '../Entities/IFileDomain'; import IBaseRepository from '../../../Main/Domain/Repositories/IBaseRepository'; +import { ICriteria } from '../../../Main/Domain/Criteria'; +import { IPaginator } from '../../../Main/Domain/Criteria/IPaginator'; interface IFileRepository extends IBaseRepository { diff --git a/src/File/Infrastructure/Repositories/IFileVersionRepository.ts b/src/File/Domain/Repositories/IFileVersionRepository.ts similarity index 75% rename from src/File/Infrastructure/Repositories/IFileVersionRepository.ts rename to src/File/Domain/Repositories/IFileVersionRepository.ts index a546c570..83ebd109 100644 --- a/src/File/Infrastructure/Repositories/IFileVersionRepository.ts +++ b/src/File/Domain/Repositories/IFileVersionRepository.ts @@ -1,8 +1,8 @@ -import { ICriteria } from '@digichanges/shared-experience'; -import { IPaginator } from '@digichanges/shared-experience'; -import IFileVersionDomain from '../../Domain/Entities/IFileVersionDomain'; +import IFileVersionDomain from '../Entities/IFileVersionDomain'; import IBaseRepository from '../../../Main/Domain/Repositories/IBaseRepository'; import IByOptions from '../../../Main/Domain/Repositories/IByOptions'; +import { ICriteria } from '../../../Main/Domain/Criteria'; +import { IPaginator } from '../../../Main/Domain/Criteria/IPaginator'; interface IFileVersionRepository extends IBaseRepository { diff --git a/src/File/Domain/Services/FileService.ts b/src/File/Domain/Services/FileService.ts index 1ad6529f..7896dff2 100644 --- a/src/File/Domain/Services/FileService.ts +++ b/src/File/Domain/Services/FileService.ts @@ -2,125 +2,127 @@ import { CWebp } from 'cwebp'; import { readFile, stat } from 'fs/promises'; import IFileVersionDomain from '../Entities/IFileVersionDomain'; -import FilesystemFactory from '../../../Shared/Factories/FilesystemFactory'; -import IFileVersionRepository from '../../Infrastructure/Repositories/IFileVersionRepository'; +import IFileVersionRepository from '../Repositories/IFileVersionRepository'; import PresignedFileRepPayload from '../../Domain/Payloads/PresignedFileRepPayload'; -import { ICriteria } from '@digichanges/shared-experience'; -import { IFilesystem, IPaginator } from '@digichanges/shared-experience'; -import ListObjectsPayload from '../../Domain/Payloads/ListObjectsPayload'; import FileBase64RepPayload from '../Payloads/FileBase64RepPayload'; import FileMultipartRepPayload from '../Payloads/FileMultipartRepPayload'; import CreateBucketPayload from '../Payloads/CreateBucketPayload'; import FileVersionDTO from '../Models/FileVersionDTO'; import IFileVersionDTO from '../Models/IFileVersionDTO'; import IFileVersionPayload from '../Entities/IFileVersionPayload'; -import FileMultipartOptimizeDTO from '../../Presentation/DTO/FileMultipartOptimizeDTO'; -import FileBase64OptimizeDTO from '../../Presentation/DTO/FileBase64OptimizeDTO'; +import FileMultipartOptimizeDTO from '../DTO/FileMultipartOptimizeDTO'; +import FileBase64OptimizeDTO from '../DTO/FileBase64OptimizeDTO'; import FileUpdateMultipartPayload from '../Payloads/FileUpdateMultipartPayload'; -import FileUpdateMultipartOptimizeDTO from '../../Presentation/DTO/FileUpdateMultipartOptimizeDTO'; +import FileUpdateMultipartOptimizeDTO from '../DTO/FileUpdateMultipartOptimizeDTO'; import FileUpdateBase64Payload from '../Payloads/FileUpdateBase64Payload'; -import FileUpdateBase64OptimizeDTO from '../../Presentation/DTO/FileUpdateBase64OptimizeDTO'; -import IFileRepository from '../../Infrastructure/Repositories/IFileRepository'; +import FileUpdateBase64OptimizeDTO from '../DTO/FileUpdateBase64OptimizeDTO'; +import IFileRepository from '../Repositories/IFileRepository'; import IFileDomain from '../Entities/IFileDomain'; import File from '../Entities/File'; import IFileVersionOptimizeDTO from '../Payloads/IFileVersionOptimizeDTO'; -import FileVersionOptimizeDTO from '../../Presentation/DTO/FileVersionOptimizeDTO'; +import FileVersionOptimizeDTO from '../DTO/FileVersionOptimizeDTO'; import IFileDTO from '../Models/IFileDTO'; import FileDTO from '../Models/FileDTO'; import DownloadPayload from '../Payloads/DownloadPayload'; import { REPOSITORIES } from '../../../Shared/DI/Injects'; import DependencyInjector from '../../../Shared/DI/DependencyInjector'; +import { ICriteria } from '../../../Main/Domain/Criteria'; +import { IFilesystem } from '../../../Main/Domain/Shared/IFilesystem'; +import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; +import ListObjectsSchemaValidation from '../Validations/ListObjectsSchemaValidation'; +import { ListObjectsPayload } from '../Payloads/ListObjectsPayload'; +import { IPaginator } from '../../../Main/Domain/Criteria/IPaginator'; class FileService { - private versionRepository: IFileVersionRepository; - private fileRepository: IFileRepository; - // TODO fileSystem should be a package and not a result from the factory - private fileSystem: IFilesystem; + #versionRepository: IFileVersionRepository; + #fileRepository: IFileRepository; + #fileSystem: IFilesystem; constructor() { - this.versionRepository = DependencyInjector.inject(REPOSITORIES.IFileVersionRepository); - this.fileRepository = DependencyInjector.inject(REPOSITORIES.IFileRepository); - this.fileSystem = FilesystemFactory.create(); + this.#versionRepository = DependencyInjector.inject(REPOSITORIES.IFileVersionRepository); + this.#fileRepository = DependencyInjector.inject(REPOSITORIES.IFileRepository); + this.#fileSystem = DependencyInjector.inject('IFilesystem'); } async getOne(id: string): Promise { - return await this.fileRepository.getOne(id); + return await this.#fileRepository.getOne(id); } async persist(): Promise { const file = new File(); - return this.fileRepository.save(file); + return this.#fileRepository.save(file); } async getPresignedGetObject(payload: PresignedFileRepPayload): Promise { const { file, expiry, version } = payload; - const fileVersion = await this.versionRepository.getLastOneByFields(file, version, { initThrow: true }); + const fileVersion = await this.#versionRepository.getLastOneByFields(file, version, { initThrow: true }); return await this.getFileUrl(fileVersion, expiry); } async persistVersion(fileVersion: IFileVersionDomain): Promise { - return await this.versionRepository.save(fileVersion); + return await this.#versionRepository.save(fileVersion); } async update(file: IFileDomain): Promise { file.currentVersion++; - return this.fileRepository.save(file); + return this.#fileRepository.save(file); } async uploadFileBase64(fileVersion: IFileVersionDomain, payload: FileBase64RepPayload): Promise { - await this.fileSystem.uploadFileByBuffer(fileVersion, payload.base64); - + await this.#fileSystem.uploadFileByBuffer(fileVersion, payload.base64); return fileVersion; } async uploadFileMultipart(fileVersion: IFileVersionDomain, payload: FileMultipartRepPayload): Promise { - await this.fileSystem.uploadFile(fileVersion, payload.file.path); + await this.#fileSystem.uploadFile(fileVersion, payload.file.path); return fileVersion; } async uploadFileVersionOptimized(fileVersion: IFileVersionDomain, payload: IFileVersionOptimizeDTO): Promise { - await this.fileSystem.uploadFile(fileVersion, payload.file.path); + await this.#fileSystem.uploadFile(fileVersion, payload.file.path); return fileVersion; } async list(payload: ICriteria): Promise { - return this.versionRepository.list(payload); + return this.#versionRepository.list(payload); } async listObjects(payload: ListObjectsPayload): Promise { - return await this.fileSystem.listObjects(payload); + await ValidatorSchema.handle(ListObjectsSchemaValidation, payload); + + return await this.#fileSystem.listObjects(payload); } async getVersions(file: string): Promise { - return await this.versionRepository.getAllByFileId(file); + return await this.#versionRepository.getAllByFileId(file); } async getLastVersions(file: string): Promise { - return await this.versionRepository.getLastOneByFields(file); + return await this.#versionRepository.getLastOneByFields(file); } async getOneVersion(file: string, version: number): Promise { - return await this.versionRepository.getOneByFileIdAndVersion(file, version); + return await this.#versionRepository.getOneByFileIdAndVersion(file, version); } async createBucket(payload: CreateBucketPayload): Promise @@ -133,11 +135,11 @@ class FileService const bucketPrivatePolicy = payload.privateBucketPolicy; const bucketPublicPolicy = payload.publicBucketPolicy; - await this.fileSystem.createBucket(bucketNamePrivate, region); - await this.fileSystem.setBucketPolicy(bucketPrivatePolicy, bucketNamePrivate); + await this.#fileSystem.createBucket(bucketNamePrivate, region); + await this.#fileSystem.setBucketPolicy(bucketPrivatePolicy, bucketNamePrivate); - await this.fileSystem.createBucket(bucketNamePublic, region); - await this.fileSystem.setBucketPolicy(bucketPublicPolicy, bucketNamePublic); + await this.#fileSystem.createBucket(bucketNamePublic, region); + await this.#fileSystem.setBucketPolicy(bucketPublicPolicy, bucketNamePublic); } async download(payload: DownloadPayload): Promise @@ -146,7 +148,7 @@ class FileService const fileVersion = !version ? await this.getLastVersions(id) : await this.getOneVersion(id, version); - const stream = await this.fileSystem.downloadStreamFile(fileVersion); + const stream = await this.#fileSystem.downloadStreamFile(fileVersion); return new FileVersionDTO(fileVersion, stream); } @@ -158,27 +160,27 @@ class FileService 'Content-Length': fileVersion.size }; - return await this.fileSystem.presignedGetObject(fileVersion, expiry, metadata); + return await this.#fileSystem.presignedGetObject(fileVersion, expiry, metadata); } async removeFileAndVersions(id: string): Promise { - const fileVersions = await this.versionRepository.getAllByFileId(id); + const fileVersions = await this.#versionRepository.getAllByFileId(id); for (const fileVersion of fileVersions) { - await this.fileSystem.removeObjects(fileVersion); - await this.versionRepository.delete(fileVersion.getId()); + await this.#fileSystem.removeObjects(fileVersion); + await this.#versionRepository.delete(fileVersion.getId()); } - const file = await this.fileRepository.delete(id); + const file = await this.#fileRepository.delete(id); return new FileDTO(file, fileVersions); } private async getFileVersionOptimized(fileVersion: IFileVersionDomain): Promise { - const path = await this.fileSystem.downloadFile(fileVersion); + const path = await this.#fileSystem.downloadFile(fileVersion); const encoder = CWebp(path); const newPath = path.replace(fileVersion.extension, 'webp'); await encoder.write(newPath); diff --git a/src/File/Domain/UseCases/CreateBucketUseCase.ts b/src/File/Domain/UseCases/CreateBucketUseCase.ts index 6c0e9981..470ad357 100644 --- a/src/File/Domain/UseCases/CreateBucketUseCase.ts +++ b/src/File/Domain/UseCases/CreateBucketUseCase.ts @@ -3,11 +3,11 @@ import FileService from '../Services/FileService'; class CreateBucketUseCase { - private fileService = new FileService(); + #fileService = new FileService(); async handle(payload: CreateBucketPayload): Promise { - await this.fileService.createBucket(payload); + await this.#fileService.createBucket(payload); } } diff --git a/src/File/Domain/UseCases/DownloadUseCase.ts b/src/File/Domain/UseCases/DownloadUseCase.ts index 0f7cf4a6..888ca986 100644 --- a/src/File/Domain/UseCases/DownloadUseCase.ts +++ b/src/File/Domain/UseCases/DownloadUseCase.ts @@ -1,7 +1,7 @@ import IFileVersionDTO from '../Models/IFileVersionDTO'; import FileService from '../Services/FileService'; import DownloadPayload from '../Payloads/DownloadPayload'; -import DownloadSchemaValidation from '../../Presentation/Validations/DownloadSchemaValidation'; +import DownloadSchemaValidation from '../Validations/DownloadSchemaValidation'; import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; class DownloadUseCase diff --git a/src/File/Domain/UseCases/GetFileMetadataUseCase.ts b/src/File/Domain/UseCases/GetFileMetadataUseCase.ts index 631701cd..9f99c943 100644 --- a/src/File/Domain/UseCases/GetFileMetadataUseCase.ts +++ b/src/File/Domain/UseCases/GetFileMetadataUseCase.ts @@ -1,9 +1,9 @@ -import { IdPayload } from '@digichanges/shared-experience'; import FileService from '../Services/FileService'; import FileDTO from '../Models/FileDTO'; import IFileDTO from '../Models/IFileDTO'; import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; import IdSchemaValidation from '../../../Main/Domain/Validations/IdSchemaValidation'; +import { IdPayload } from '../../../Main/Domain/Payloads/IdPayload'; class GetFileMetadataUserCase { diff --git a/src/File/Domain/UseCases/GetPresignedGetObjectUseCase.ts b/src/File/Domain/UseCases/GetPresignedGetObjectUseCase.ts index 319c4808..fd6cd362 100644 --- a/src/File/Domain/UseCases/GetPresignedGetObjectUseCase.ts +++ b/src/File/Domain/UseCases/GetPresignedGetObjectUseCase.ts @@ -1,6 +1,6 @@ import PresignedFileRepPayload from '../Payloads/PresignedFileRepPayload'; import FileService from '../Services/FileService'; -import PresignedFileSchemaValidation from '../../Presentation/Validations/PresignedFileSchemaValidation'; +import PresignedFileSchemaValidation from '../Validations/PresignedFileSchemaValidation'; import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; class GetPresignedGetObjectUseCase diff --git a/src/File/Domain/UseCases/ListFilesUseCase.ts b/src/File/Domain/UseCases/ListFilesUseCase.ts index 986fe24d..22ffccc5 100644 --- a/src/File/Domain/UseCases/ListFilesUseCase.ts +++ b/src/File/Domain/UseCases/ListFilesUseCase.ts @@ -1,6 +1,6 @@ -import { ICriteria } from '@digichanges/shared-experience'; -import { IPaginator } from '@digichanges/shared-experience'; import FileService from '../Services/FileService'; +import { ICriteria } from '../../../Main/Domain/Criteria'; +import { IPaginator } from '../../../Main/Domain/Criteria/IPaginator'; class ListFilesUseCase { diff --git a/src/File/Domain/UseCases/ListObjectsUseCase.ts b/src/File/Domain/UseCases/ListObjectsUseCase.ts index 2ad897a6..67aa4ace 100644 --- a/src/File/Domain/UseCases/ListObjectsUseCase.ts +++ b/src/File/Domain/UseCases/ListObjectsUseCase.ts @@ -1,17 +1,13 @@ -import ListObjectsPayload from '../Payloads/ListObjectsPayload'; import FileService from '../Services/FileService'; -import ListObjectsSchemaValidation from '../../Presentation/Validations/ListObjectsSchemaValidation'; -import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; +import { ListObjectsPayload } from '../Payloads/ListObjectsPayload'; class ListObjectsUseCase { - private fileService = new FileService(); + #fileService = new FileService(); async handle(payload: ListObjectsPayload): Promise { - await ValidatorSchema.handle(ListObjectsSchemaValidation, payload); - - return await this.fileService.listObjects(payload); + return await this.#fileService.listObjects(payload); } } diff --git a/src/File/Domain/UseCases/OptimizeUseCase.ts b/src/File/Domain/UseCases/OptimizeUseCase.ts index 2296a648..92b625d3 100644 --- a/src/File/Domain/UseCases/OptimizeUseCase.ts +++ b/src/File/Domain/UseCases/OptimizeUseCase.ts @@ -4,7 +4,7 @@ import FileService from '../Services/FileService'; import IFileDTO from '../Models/IFileDTO'; import FileDTO from '../Models/FileDTO'; import OptimizePayload from '../Payloads/OptimizePayload'; -import OptimizeSchemaValidation from '../../Presentation/Validations/OptimizeSchemaValidation'; +import OptimizeSchemaValidation from '../Validations/OptimizeSchemaValidation'; import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; class OptimizeUseCase diff --git a/src/File/Domain/UseCases/RemoveFileUseCase.ts b/src/File/Domain/UseCases/RemoveFileUseCase.ts index a4fab9e9..5bc9a56e 100644 --- a/src/File/Domain/UseCases/RemoveFileUseCase.ts +++ b/src/File/Domain/UseCases/RemoveFileUseCase.ts @@ -1,8 +1,8 @@ -import { IdPayload } from '@digichanges/shared-experience'; import FileService from '../Services/FileService'; import IFileDTO from '../Models/IFileDTO'; import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; import IdSchemaValidation from '../../../Main/Domain/Validations/IdSchemaValidation'; +import { IdPayload } from '../../../Main/Domain/Payloads/IdPayload'; class RemoveFileUseCase { diff --git a/src/File/Domain/UseCases/UpdateFileBase64UseCase.ts b/src/File/Domain/UseCases/UpdateFileBase64UseCase.ts index a7555c1e..f14ef5a8 100644 --- a/src/File/Domain/UseCases/UpdateFileBase64UseCase.ts +++ b/src/File/Domain/UseCases/UpdateFileBase64UseCase.ts @@ -3,7 +3,7 @@ import IFileVersionDomain from '../Entities/IFileVersionDomain'; import FileService from '../Services/FileService'; import FileVersion from '../Entities/FileVersion'; import FileDTO from '../Models/FileDTO'; -import FileBase64UpdateSchemaValidation from '../../Presentation/Validations/FileBase64UpdateSchemaValidation'; +import FileBase64UpdateSchemaValidation from '../Validations/FileBase64UpdateSchemaValidation'; import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; class UpdateFileBase64UseCase diff --git a/src/File/Domain/UseCases/UpdateFileMultipartUseCase.ts b/src/File/Domain/UseCases/UpdateFileMultipartUseCase.ts index e801f29f..fd14d660 100644 --- a/src/File/Domain/UseCases/UpdateFileMultipartUseCase.ts +++ b/src/File/Domain/UseCases/UpdateFileMultipartUseCase.ts @@ -3,7 +3,7 @@ import IFileVersionDomain from '../Entities/IFileVersionDomain'; import FileService from '../Services/FileService'; import FileVersion from '../Entities/FileVersion'; import FileDTO from '../Models/FileDTO'; -import FileMultipartUpdateSchemaValidation from '../../Presentation/Validations/FileMultipartUpdateSchemaValidation'; +import FileMultipartUpdateSchemaValidation from '../Validations/FileMultipartUpdateSchemaValidation'; import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; class UpdateFileMultipartUseCase diff --git a/src/File/Domain/UseCases/UploadBase64UseCase.ts b/src/File/Domain/UseCases/UploadBase64UseCase.ts index ab36f0cd..e3f5eaac 100644 --- a/src/File/Domain/UseCases/UploadBase64UseCase.ts +++ b/src/File/Domain/UseCases/UploadBase64UseCase.ts @@ -6,16 +6,16 @@ import FileDTO from '../Models/FileDTO'; class UploadBase64UseCase { - private fileService = new FileService(); + #fileService = new FileService(); async handle(payload: FileBase64RepPayload): Promise { if (payload.query?.isOptimize && payload.isImage) { - payload = await this.fileService.optimizeBase64ToUpload(payload); + payload = await this.#fileService.optimizeBase64ToUpload(payload); } - let file = await this.fileService.persist(); + let file = await this.#fileService.persist(); const build = { isOriginalName: payload.query?.isOriginalName ?? false, @@ -30,9 +30,9 @@ class UploadBase64UseCase }; let fileVersion: IFileVersionDomain = new FileVersion(build); - fileVersion = await this.fileService.persistVersion(fileVersion); - file = await this.fileService.update(file); - await this.fileService.uploadFileBase64(fileVersion, payload); + fileVersion = await this.#fileService.persistVersion(fileVersion); + file = await this.#fileService.update(file); + await this.#fileService.uploadFileBase64(fileVersion, payload); return new FileDTO(file, [fileVersion]); } diff --git a/src/File/Domain/UseCases/UploadMultipartUseCase.ts b/src/File/Domain/UseCases/UploadMultipartUseCase.ts index 6ffe0c96..5ebcbcaa 100644 --- a/src/File/Domain/UseCases/UploadMultipartUseCase.ts +++ b/src/File/Domain/UseCases/UploadMultipartUseCase.ts @@ -4,7 +4,7 @@ import FileVersion from '../Entities/FileVersion'; import FileService from '../Services/FileService'; import IFileDTO from '../Models/IFileDTO'; import FileDTO from '../Models/FileDTO'; -import FileMultipartSchemaValidation from '../../Presentation/Validations/FileMultipartSchemaValidation'; +import FileMultipartSchemaValidation from '../Validations/FileMultipartSchemaValidation'; import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; class UploadMultipartUseCase diff --git a/src/File/Presentation/Validations/DownloadSchemaValidation.ts b/src/File/Domain/Validations/DownloadSchemaValidation.ts similarity index 100% rename from src/File/Presentation/Validations/DownloadSchemaValidation.ts rename to src/File/Domain/Validations/DownloadSchemaValidation.ts diff --git a/src/File/Presentation/Validations/FileBase64SchemaValidation.ts b/src/File/Domain/Validations/FileBase64SchemaValidation.ts similarity index 100% rename from src/File/Presentation/Validations/FileBase64SchemaValidation.ts rename to src/File/Domain/Validations/FileBase64SchemaValidation.ts diff --git a/src/File/Presentation/Validations/FileBase64UpdateSchemaValidation.ts b/src/File/Domain/Validations/FileBase64UpdateSchemaValidation.ts similarity index 100% rename from src/File/Presentation/Validations/FileBase64UpdateSchemaValidation.ts rename to src/File/Domain/Validations/FileBase64UpdateSchemaValidation.ts diff --git a/src/File/Presentation/Validations/FileMultipartSchemaValidation.ts b/src/File/Domain/Validations/FileMultipartSchemaValidation.ts similarity index 100% rename from src/File/Presentation/Validations/FileMultipartSchemaValidation.ts rename to src/File/Domain/Validations/FileMultipartSchemaValidation.ts diff --git a/src/File/Presentation/Validations/FileMultipartUpdateSchemaValidation.ts b/src/File/Domain/Validations/FileMultipartUpdateSchemaValidation.ts similarity index 100% rename from src/File/Presentation/Validations/FileMultipartUpdateSchemaValidation.ts rename to src/File/Domain/Validations/FileMultipartUpdateSchemaValidation.ts diff --git a/src/File/Presentation/Validations/FileOptionsQuerySchemaValidation.ts b/src/File/Domain/Validations/FileOptionsQuerySchemaValidation.ts similarity index 100% rename from src/File/Presentation/Validations/FileOptionsQuerySchemaValidation.ts rename to src/File/Domain/Validations/FileOptionsQuerySchemaValidation.ts diff --git a/src/File/Presentation/Validations/FileRepSchemaValidation.ts b/src/File/Domain/Validations/FileRepSchemaValidation.ts similarity index 100% rename from src/File/Presentation/Validations/FileRepSchemaValidation.ts rename to src/File/Domain/Validations/FileRepSchemaValidation.ts diff --git a/src/File/Presentation/Validations/ListObjectsSchemaValidation.ts b/src/File/Domain/Validations/ListObjectsSchemaValidation.ts similarity index 100% rename from src/File/Presentation/Validations/ListObjectsSchemaValidation.ts rename to src/File/Domain/Validations/ListObjectsSchemaValidation.ts diff --git a/src/File/Presentation/Validations/OptimizeSchemaValidation.ts b/src/File/Domain/Validations/OptimizeSchemaValidation.ts similarity index 100% rename from src/File/Presentation/Validations/OptimizeSchemaValidation.ts rename to src/File/Domain/Validations/OptimizeSchemaValidation.ts diff --git a/src/File/Presentation/Validations/PartialFileSchemaValidation.ts b/src/File/Domain/Validations/PartialFileSchemaValidation.ts similarity index 100% rename from src/File/Presentation/Validations/PartialFileSchemaValidation.ts rename to src/File/Domain/Validations/PartialFileSchemaValidation.ts diff --git a/src/File/Presentation/Validations/PresignedFileSchemaValidation.ts b/src/File/Domain/Validations/PresignedFileSchemaValidation.ts similarity index 100% rename from src/File/Presentation/Validations/PresignedFileSchemaValidation.ts rename to src/File/Domain/Validations/PresignedFileSchemaValidation.ts diff --git a/src/File/Infrastructure/Repositories/FileMongooseRepository.ts b/src/File/Infrastructure/Repositories/FileMongooseRepository.ts index 09010154..fe58d848 100644 --- a/src/File/Infrastructure/Repositories/FileMongooseRepository.ts +++ b/src/File/Infrastructure/Repositories/FileMongooseRepository.ts @@ -1,14 +1,15 @@ import { Query } from 'mongoose'; -import { IPaginator, ICriteria } from '@digichanges/shared-experience'; import FileFilter from '../../Presentation/Criterias/FileFilter'; import MongoosePaginator from '../../../Main/Infrastructure/Orm/MongoosePaginator'; import BaseMongooseRepository from '../../../Main/Infrastructure/Repositories/BaseMongooseRepository'; import IFileDomain from '../../Domain/Entities/IFileDomain'; -import IFileRepository from './IFileRepository'; +import IFileRepository from '../../Domain/Repositories/IFileRepository'; import File from '../../Domain/Entities/File'; import { FileMongooseDocument } from '../Schemas/FileMongoose'; +import { ICriteria } from '../../../Main/Domain/Criteria'; +import { IPaginator } from '../../../Main/Domain/Criteria/IPaginator'; class FileMongooseRepository extends BaseMongooseRepository implements IFileRepository { diff --git a/src/File/Infrastructure/Repositories/FileVersionMongooseRepository.ts b/src/File/Infrastructure/Repositories/FileVersionMongooseRepository.ts index 15f43256..fdcca750 100644 --- a/src/File/Infrastructure/Repositories/FileVersionMongooseRepository.ts +++ b/src/File/Infrastructure/Repositories/FileVersionMongooseRepository.ts @@ -1,6 +1,6 @@ -import { NotFoundException, ICriteria } from '@digichanges/shared-experience'; +import mongoose from 'mongoose'; -import IFileVersionRepository from './IFileVersionRepository'; +import IFileVersionRepository from '../../Domain/Repositories/IFileVersionRepository'; import FileFilter from '../../Presentation/Criterias/FileFilter'; import IFileVersionDomain from '../../Domain/Entities/IFileVersionDomain'; @@ -9,7 +9,8 @@ import BaseMongooseRepository from '../../../Main/Infrastructure/Repositories/Ba import FileVersion from '../../Domain/Entities/FileVersion'; import { FileVersionMongooseDocument } from '../Schemas/FileVersionMongoose'; import IByOptions from '../../../Main/Domain/Repositories/IByOptions'; -import mongoose from 'mongoose'; +import { ICriteria } from '../../../Main/Domain/Criteria'; +import { NotFoundException } from '../../../Main/Domain/Exceptions/NotFoundException'; class FileVersionMongooseRepository extends BaseMongooseRepository implements IFileVersionRepository { diff --git a/src/File/Presentation/Controllers/FileFastifyController.ts b/src/File/Presentation/Controllers/FileFastifyController.ts index fac909c6..2912bfb0 100644 --- a/src/File/Presentation/Controllers/FileFastifyController.ts +++ b/src/File/Presentation/Controllers/FileFastifyController.ts @@ -1,4 +1,3 @@ -import { RequestCriteria, ICriteria, IPaginator, StatusCode, IdPayload } from '@digichanges/shared-experience'; import FileVersionTransformer from '../Transformers/FileVersionTransformer'; import ObjectTransformer from '../Transformers/ObjectTransformer'; import FileTransformer from '../Transformers/FileTransformer'; @@ -9,7 +8,7 @@ import ListFilesUseCase from '../../Domain/UseCases/ListFilesUseCase'; import ListObjectsUseCase from '../../Domain/UseCases/ListObjectsUseCase'; import GetFileMetadataUseCase from '../../Domain/UseCases/GetFileMetadataUseCase'; import FileBase64RepPayload from '../../Domain/Payloads/FileBase64RepPayload'; -import FileBase64SchemaValidation from '../Validations/FileBase64SchemaValidation'; +import FileBase64SchemaValidation from '../../Domain/Validations/FileBase64SchemaValidation'; import UploadBase64UseCase from '../../Domain/UseCases/UploadBase64UseCase'; import UploadMultipartUseCase from '../../Domain/UseCases/UploadMultipartUseCase'; import GetPresignedGetObjectUseCase from '../../Domain/UseCases/GetPresignedGetObjectUseCase'; @@ -26,10 +25,13 @@ import { ParsedQs } from 'qs'; import FastifyResponder from '../../../Main/Presentation/Utils/FastifyResponder'; import { IRequestFastify } from '../../../Shared/Utils/types'; import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; +import { StatusCode } from '../../../Main/Presentation/Application/StatusCode'; +import { ICriteria, RequestCriteria } from '../../../Main/Domain/Criteria'; +import { IdPayload } from '../../../Main/Domain/Payloads/IdPayload'; +import { IPaginator } from '../../../Main/Domain/Criteria/IPaginator'; const responder: FastifyResponder = new FastifyResponder(); - class FileController { // TODO implmente IFastify(extends from QueryRequest, bodyRequest, params request) request, or simple request(QueryRequest, bodyRequest, params request) @@ -49,7 +51,6 @@ class FileController await responder.paginate(paginator, reply, StatusCode.HTTP_OK, new FileVersionTransformer()); } - static async listObjects(request: any, reply: FastifyReply): Promise { const query = request.query; @@ -110,12 +111,14 @@ class FileController static async uploadMultipart(request: any, reply: FastifyReply): Promise { - const { originalname, encoding, mimetype, destination, filename, size } = request.file; - const { isOriginalName, isPublic, isOverwrite, isOptimize } = request.query; if (!request.file) { return void await responder.send('No file received', reply, StatusCode.HTTP_BAD_REQUEST); } + + const { originalname, encoding, mimetype, destination, filename, size } = request.file; + const { isOriginalName, isPublic, isOverwrite, isOptimize } = request.query; + const payload = { file: { originalName: originalname, @@ -135,6 +138,7 @@ class FileController isOptimize: isOptimize === 'true' } }; + const useCase = new UploadMultipartUseCase(); const uploadedFile = await useCase.handle(payload); @@ -143,11 +147,14 @@ class FileController static async uploadMultipleImages(request: any, reply: FastifyReply): Promise { const files = request.files; + if (!files) { return void await responder.send('No files received', reply, StatusCode.HTTP_BAD_REQUEST); } + const responseFiles = []; + for (const file of files) { const { originalname, encoding, mimetype, destination, filename, size } = file; @@ -175,6 +182,7 @@ class FileController const useCase = new UploadMultipartUseCase(); responseFiles.push((await useCase.handle(payload))); } + void await responder.send(responseFiles, reply, StatusCode.HTTP_CREATED, new FileTransformer()); } diff --git a/src/File/Presentation/Criterias/FileFilter.ts b/src/File/Presentation/Criterias/FileFilter.ts index 0f9f3fa0..2f07b7fc 100644 --- a/src/File/Presentation/Criterias/FileFilter.ts +++ b/src/File/Presentation/Criterias/FileFilter.ts @@ -1,4 +1,4 @@ -import { Filter } from '@digichanges/shared-experience'; +import { Filter } from '../../../Main/Domain/Criteria'; class FileFilter extends Filter { diff --git a/src/File/Presentation/Criterias/FileSort.ts b/src/File/Presentation/Criterias/FileSort.ts index c45ea7af..42912a1e 100644 --- a/src/File/Presentation/Criterias/FileSort.ts +++ b/src/File/Presentation/Criterias/FileSort.ts @@ -1,4 +1,4 @@ -import { Sort } from '@digichanges/shared-experience'; +import { Sort } from '../../../Main/Domain/Criteria'; class FileSort extends Sort { diff --git a/src/File/Presentation/Middlewares/FileFastifyReqMiddleware.ts b/src/File/Presentation/Middlewares/FileFastifyReqMiddleware.ts index 69622dd0..609f3e7e 100644 --- a/src/File/Presentation/Middlewares/FileFastifyReqMiddleware.ts +++ b/src/File/Presentation/Middlewares/FileFastifyReqMiddleware.ts @@ -5,32 +5,49 @@ import { pipeline } from 'node:stream'; import { stat } from 'fs/promises'; const pump = util.promisify(pipeline); -async function writeFile(fileStream) +interface IFileStream +{ + type: string; + fieldname: string; + filename: string; + encoding: string; + mimetype: string; + size?: number; + destination?: string; + originalname?: string; + file: unknown; +} + +async function writeFile(fileStream: IFileStream) { const { filename, file } = fileStream; - await pump(file, fs.createWriteStream(`/tmp/${filename}`)); + await pump(file as any, fs.createWriteStream(`/tmp/${filename}`)); fileStream.size = (await stat(`/tmp/${filename}`)).size; fileStream.destination = '/tmp'; fileStream.originalname = filename; + return fileStream; } + async function writeFileHandler(request: any) { const fileStream = await request.file(); request.file = await writeFile(fileStream); } + async function writeFilesHandler(request: any) { const parts = request.files(); const files = []; + for await (const part of parts) { files.push(await writeFile(part)); } + request.files = files; } - async function writeFileMiddleware(payload) { return async function(request: FastifyRequest) diff --git a/src/File/Presentation/RequestTypes/FileRequestTypes.ts b/src/File/Presentation/RequestTypes/FileRequestTypes.ts deleted file mode 100644 index f6eb8e53..00000000 --- a/src/File/Presentation/RequestTypes/FileRequestTypes.ts +++ /dev/null @@ -1,2 +0,0 @@ - -export type UploadBase64BodyRq = { filename: string, base64: string } diff --git a/src/File/Presentation/Routes/FileFastifyRouter.ts b/src/File/Presentation/Routes/FileFastifyRouter.ts index c65c4b31..f48eaa24 100644 --- a/src/File/Presentation/Routes/FileFastifyRouter.ts +++ b/src/File/Presentation/Routes/FileFastifyRouter.ts @@ -5,7 +5,6 @@ import multipart from '@fastify/multipart'; const FileFastifyRouter = async(fastify: FastifyInstance) => { - // @ts-ignore await fastify.register(multipart); fastify.get('/', FileController.listFiles); @@ -18,7 +17,8 @@ const FileFastifyRouter = async(fastify: FastifyInstance) => fastify.get('/:id', FileController.download); fastify.put('/optimize/:id', FileController.optimize); fastify.put('/base64/:id', FileController.updateBase64); - fastify.put('/:id', FileController.updateMultipart); + fastify.put('/:id', { preHandler: await writeFileMiddleware('file') }, FileController.updateMultipart); fastify.delete('/:id', FileController.remove); }; + export default FileFastifyRouter; diff --git a/src/File/Presentation/Transformers/FileTransformer.ts b/src/File/Presentation/Transformers/FileTransformer.ts index f70cf7a6..a12294fb 100644 --- a/src/File/Presentation/Transformers/FileTransformer.ts +++ b/src/File/Presentation/Transformers/FileTransformer.ts @@ -1,18 +1,15 @@ import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import { Transformer } from '@digichanges/shared-experience'; + import IFileDTO from '../../Domain/Models/IFileDTO'; import IFileTransformer from './IFileTransformer'; -import FileVersionTransformer from './FileVersionTransformer'; +import { Transformer } from '../../../Main/Presentation/Transformers'; class FileTransformer extends Transformer { - private fileVersionTransformer: FileVersionTransformer; - constructor() { super(); - this.fileVersionTransformer = new FileVersionTransformer(); } public async transform(fileDto: IFileDTO): Promise { @@ -21,7 +18,6 @@ class FileTransformer extends Transformer return { id: fileDto.file.getId(), currentVersion: fileDto.file.currentVersion, - // versions: await this.fileVersionTransformer.handle(fileDto.versions) ?? [], createdAt: dayjs(fileDto.file.createdAt).utc().unix(), updatedAt: dayjs(fileDto.file.updatedAt).utc().unix() }; diff --git a/src/File/Presentation/Transformers/FileVersionTransformer.ts b/src/File/Presentation/Transformers/FileVersionTransformer.ts index 503f7cbd..15e9d778 100644 --- a/src/File/Presentation/Transformers/FileVersionTransformer.ts +++ b/src/File/Presentation/Transformers/FileVersionTransformer.ts @@ -1,8 +1,8 @@ import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import { Transformer } from '@digichanges/shared-experience'; import IFileVersionDomain from '../../Domain/Entities/IFileVersionDomain'; import IFileVersionTransformer from './IFileVersionTransformer'; +import { Transformer } from '../../../Main/Presentation/Transformers'; class FileVersionTransformer extends Transformer { diff --git a/src/File/Presentation/Transformers/IFileTransformer.ts b/src/File/Presentation/Transformers/IFileTransformer.ts index 50d2784b..f576df2a 100644 --- a/src/File/Presentation/Transformers/IFileTransformer.ts +++ b/src/File/Presentation/Transformers/IFileTransformer.ts @@ -1,7 +1,8 @@ -import { BaseTransformer, BasePropertiesTransformer } from '@digichanges/shared-experience'; import IFileVersionDomain from '../../Domain/Entities/IFileVersionDomain'; +import { BasePropertiesTransformer, BaseTransformer } from '../../../Main/Presentation/Transformers'; -interface IFileData { +interface IFileData +{ currentVersion: number; versions: IFileVersionDomain[]; } diff --git a/src/File/Presentation/Transformers/IFileVersionTransformer.ts b/src/File/Presentation/Transformers/IFileVersionTransformer.ts index deaa8956..b08f55ce 100644 --- a/src/File/Presentation/Transformers/IFileVersionTransformer.ts +++ b/src/File/Presentation/Transformers/IFileVersionTransformer.ts @@ -1,5 +1,5 @@ -import { BaseTransformer, BasePropertiesTransformer } from '@digichanges/shared-experience'; import IFileVersionDomain from '../../Domain/Entities/IFileVersionDomain'; +import { BasePropertiesTransformer, BaseTransformer } from '../../../Main/Presentation/Transformers'; type IFileVersionTransformer = BaseTransformer & BasePropertiesTransformer; diff --git a/src/File/Presentation/Transformers/ObjectTransformer.ts b/src/File/Presentation/Transformers/ObjectTransformer.ts index 63ea29f4..7eea39e9 100644 --- a/src/File/Presentation/Transformers/ObjectTransformer.ts +++ b/src/File/Presentation/Transformers/ObjectTransformer.ts @@ -1,12 +1,13 @@ import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import { Transformer } from '@digichanges/shared-experience'; +import { Transformer } from '../../../Main/Presentation/Transformers'; class ObjectTransformer extends Transformer { public async transform(object: any) { dayjs.extend(utc); + return { name: object.name, lastModified: dayjs(object.lastModified).utc().unix(), diff --git a/src/File/Tests/file.handler.spec.ts b/src/File/Tests/file.handler.spec.ts index d774879e..bac2524e 100644 --- a/src/File/Tests/file.handler.spec.ts +++ b/src/File/Tests/file.handler.spec.ts @@ -3,7 +3,8 @@ import initTestServer from '../../initTestServer'; import { UploadFileBase64 } from './fixture'; import { IFileResponse } from './types'; import ICreateConnection from '../../Main/Infrastructure/Database/ICreateConnection'; - +import * as path from 'path'; +import fs from 'fs'; describe('Start File Test', () => { @@ -38,7 +39,21 @@ describe('Start File Test', () => expect(response.statusCode).toStrictEqual(201); expect(data.currentVersion).toStrictEqual(1); - expect(data.versions.length).toStrictEqual(1); + }); + + test('Upload File /files', async() => + { + const filePath = path.join(__dirname, 'test_file.json'); + const fileStream = fs.createReadStream(filePath); + + const response: IFileResponse = await request + .post('/api/files?isOriginalName=true&isPublic=false&isOptimize=false') + .attach('file', fileStream); + + const { body: { data } } = response; + + expect(response.statusCode).toStrictEqual(201); + expect(data.currentVersion).toStrictEqual(1); file_id = data.id; }); @@ -67,7 +82,6 @@ describe('Start File Test', () => expect(response.statusCode).toStrictEqual(201); expect(data.currentVersion).toStrictEqual(2); - expect(data.versions.length).toStrictEqual(2); }); test('Get presigned File /file/presigned-get-object', async() => @@ -110,10 +124,10 @@ describe('Start File Test', () => expect(response.statusCode).toStrictEqual(200); }); - test('Delete file /files/:id', async() => + test('Get Objects /files/objects with params', async() => { const response = await request - .get(`/api/files/${file_id}`) + .get('/api/files/objects?recursive=true&prefix=true') .set('Accept', 'application/json') .send(); @@ -121,10 +135,43 @@ describe('Start File Test', () => expect(response.statusCode).toStrictEqual(200); }); + + test('Delete file /files/:id', async() => + { + const response = await request + .delete(`/api/files/${file_id}`) + .set('Accept', 'application/json') + .send(); + + const { body: { data } } = response; + + expect(response.statusCode).toStrictEqual(201); + }); }); describe('File Failed', () => { + test('Upload File /files', async() => + { + const response: IFileResponse = await request + .post('/api/files') + .set('Accept', 'application/json') + .send(); + + expect(response.statusCode).toStrictEqual(500); + }); + + test('Upload File /files', async() => + { + const response: IFileResponse = await request + .post('/api/files?isOriginalName=true&isPublic=false&isOptimize=false') + .attach('file', null); + + const { body: { data } } = response; + + expect(response.statusCode).toStrictEqual(500); + }); + test('Upload File /files/base64', async() => { const response: IFileResponse = await request diff --git a/src/File/Tests/test_file.json b/src/File/Tests/test_file.json new file mode 100644 index 00000000..320bc878 --- /dev/null +++ b/src/File/Tests/test_file.json @@ -0,0 +1 @@ +{"title": "hello world"} diff --git a/src/Item/Domain/Entities/Item.ts b/src/Item/Domain/Entities/Item.ts index 7d88dd10..7e0e0021 100644 --- a/src/Item/Domain/Entities/Item.ts +++ b/src/Item/Domain/Entities/Item.ts @@ -1,5 +1,5 @@ import IItemDomain from './IItemDomain'; -import { Base } from '@digichanges/shared-experience'; +import { Base } from '../../../Main/Domain/Entities'; class Item extends Base implements IItemDomain { diff --git a/src/Item/Domain/Payloads/ItemUpdatePayload.ts b/src/Item/Domain/Payloads/ItemUpdatePayload.ts index b950c1cb..806dcca4 100644 --- a/src/Item/Domain/Payloads/ItemUpdatePayload.ts +++ b/src/Item/Domain/Payloads/ItemUpdatePayload.ts @@ -1,5 +1,5 @@ -import { IdPayload } from '@digichanges/shared-experience'; import ItemRepPayload from './ItemRepPayload'; +import { IdPayload } from '../../../Main/Domain/Payloads/IdPayload'; interface ItemUpdatePayload extends IdPayload, ItemRepPayload {} diff --git a/src/Item/Domain/UseCases/GetItemUseCase.ts b/src/Item/Domain/UseCases/GetItemUseCase.ts index 20f39c3b..f2b1b34e 100644 --- a/src/Item/Domain/UseCases/GetItemUseCase.ts +++ b/src/Item/Domain/UseCases/GetItemUseCase.ts @@ -1,10 +1,10 @@ -import { IdPayload } from '@digichanges/shared-experience'; import IItemDomain from '../Entities/IItemDomain'; import { REPOSITORIES } from '../../../Shared/DI/Injects'; import IItemRepository from '../Repositories/IItemRepository'; import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; import IdSchemaValidation from '../../../Main/Domain/Validations/IdSchemaValidation'; import DependencyInjector from '../../../Shared/DI/DependencyInjector'; +import { IdPayload } from '../../../Main/Domain/Payloads/IdPayload'; class GetItemUseCase { diff --git a/src/Item/Domain/UseCases/ListItemsUseCase.ts b/src/Item/Domain/UseCases/ListItemsUseCase.ts index 3d5f786a..cc371024 100644 --- a/src/Item/Domain/UseCases/ListItemsUseCase.ts +++ b/src/Item/Domain/UseCases/ListItemsUseCase.ts @@ -1,9 +1,10 @@ -import { IPaginator, ICriteria } from '@digichanges/shared-experience'; import { REPOSITORIES } from '../../../Shared/DI/Injects'; import IItemRepository from '../Repositories/IItemRepository'; import DependencyInjector from '../../../Shared/DI/DependencyInjector'; import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; import CriteriaSchemaValidation from '../../../Main/Domain/Validations/CriteriaSchemaValidation'; +import { ICriteria } from '../../../Main/Domain/Criteria'; +import { IPaginator } from '../../../Main/Domain/Criteria/IPaginator'; class ListItemsUseCase { diff --git a/src/Item/Domain/UseCases/RemoveItemUseCase.ts b/src/Item/Domain/UseCases/RemoveItemUseCase.ts index d3238a18..315fcb50 100644 --- a/src/Item/Domain/UseCases/RemoveItemUseCase.ts +++ b/src/Item/Domain/UseCases/RemoveItemUseCase.ts @@ -1,10 +1,10 @@ -import { IdPayload } from '@digichanges/shared-experience'; import IItemDomain from '../Entities/IItemDomain'; import { REPOSITORIES } from '../../../Shared/DI/Injects'; import IItemRepository from '../Repositories/IItemRepository'; import DependencyInjector from '../../../Shared/DI/DependencyInjector'; import ValidatorSchema from '../../../Main/Domain/Shared/ValidatorSchema'; import IdSchemaValidation from '../../../Main/Domain/Validations/IdSchemaValidation'; +import { IdPayload } from '../../../Main/Domain/Payloads/IdPayload'; class RemoveItemUseCase { diff --git a/src/Item/Infrastructure/Repositories/ItemMikroORMRepository.ts b/src/Item/Infrastructure/Repositories/ItemMikroORMRepository.ts index ccd8b4d6..eccc7da0 100644 --- a/src/Item/Infrastructure/Repositories/ItemMikroORMRepository.ts +++ b/src/Item/Infrastructure/Repositories/ItemMikroORMRepository.ts @@ -1,15 +1,18 @@ +import { QueryBuilder } from '@mikro-orm/postgresql'; + import IItemRepository from '../../Domain/Repositories/IItemRepository'; import Item from '../../Domain/Entities/Item'; -import { IPaginator, ICriteria } from '@digichanges/shared-experience'; import Paginator from '../../../Main/Infrastructure/Orm/MikroORMPaginator'; import ItemFilter from '../../Presentation/Criterias/ItemFilter'; import ItemSchema from '../Schemas/ItemMikroORM'; import BaseMikroORMRepository from '../../../Main/Infrastructure/Repositories/BaseMikroORMRepository'; -import { QueryBuilder } from '@mikro-orm/postgresql'; +import IItemDomain from '../../Domain/Entities/IItemDomain'; +import { ICriteria } from '../../../Main/Domain/Criteria'; +import { IPaginator } from '../../../Main/Domain/Criteria/IPaginator'; -class ItemMikroORMRepository extends BaseMikroORMRepository implements IItemRepository +class ItemMikroORMRepository extends BaseMikroORMRepository implements IItemRepository { constructor() { diff --git a/src/Item/Infrastructure/Repositories/ItemMongooseRepository.ts b/src/Item/Infrastructure/Repositories/ItemMongooseRepository.ts index 08529d1c..922ff97e 100644 --- a/src/Item/Infrastructure/Repositories/ItemMongooseRepository.ts +++ b/src/Item/Infrastructure/Repositories/ItemMongooseRepository.ts @@ -1,5 +1,4 @@ import * as mongoose from 'mongoose'; -import { ICriteria } from '@digichanges/shared-experience'; import IItemRepository from '../../Domain/Repositories/IItemRepository'; import ItemFilter from '../../Presentation/Criterias/ItemFilter'; @@ -8,6 +7,7 @@ import BaseMongooseRepository from '../../../Main/Infrastructure/Repositories/Ba import IItemDomain from '../../Domain/Entities/IItemDomain'; import Item from '../../Domain/Entities/Item'; import { ItemMongooseDocument } from '../Schemas/ItemMongoose'; +import { ICriteria } from '../../../Main/Domain/Criteria'; class ItemMongooseRepository extends BaseMongooseRepository implements IItemRepository { diff --git a/src/Item/Infrastructure/Schemas/ItemMikroORM.ts b/src/Item/Infrastructure/Schemas/ItemMikroORM.ts index 89330228..a8862dfc 100644 --- a/src/Item/Infrastructure/Schemas/ItemMikroORM.ts +++ b/src/Item/Infrastructure/Schemas/ItemMikroORM.ts @@ -1,7 +1,9 @@ import { EntitySchema } from '@mikro-orm/core'; + import Item from '../../Domain/Entities/Item'; +import IItemDomain from '../../Domain/Entities/IItemDomain'; -const ItemSchema = new EntitySchema({ +const ItemSchema = new EntitySchema({ name: 'Item', tableName: 'items', class: Item, diff --git a/src/Item/Infrastructure/Schemas/ItemMongoose.ts b/src/Item/Infrastructure/Schemas/ItemMongoose.ts index 4bf44074..7bd8fb57 100644 --- a/src/Item/Infrastructure/Schemas/ItemMongoose.ts +++ b/src/Item/Infrastructure/Schemas/ItemMongoose.ts @@ -5,7 +5,7 @@ import IItemDomain from '../../Domain/Entities/IItemDomain'; export type ItemMongooseDocument = Document & IItemDomain; -const ItemSchema: any = new mongoose.Schema({ +const ItemSchema: any = new mongoose.Schema({ _id: { type: String, default: randomUUID }, name: { type: String, required: true }, type: { type: Number, required: true } diff --git a/src/Item/Presentation/Controllers/ItemFastifyController.ts b/src/Item/Presentation/Controllers/ItemFastifyController.ts index af6c9837..e4a00dd9 100644 --- a/src/Item/Presentation/Controllers/ItemFastifyController.ts +++ b/src/Item/Presentation/Controllers/ItemFastifyController.ts @@ -1,11 +1,4 @@ -import { - ResponseMessageEnum, - DefaultMessageTransformer, - RequestCriteria, - StatusCode, - ICriteria, - IdPayload -} from '@digichanges/shared-experience'; + import { FastifyReply, FastifyRequest } from 'fastify'; import { ParsedQs } from 'qs'; @@ -22,6 +15,11 @@ import GetItemUseCase from '../../Domain/UseCases/GetItemUseCase'; import UpdateItemUseCase from '../../Domain/UseCases/UpdateItemUseCase'; import RemoveItemUseCase from '../../Domain/UseCases/RemoveItemUseCase'; import { IRequestFastify } from '../../../Shared/Utils/types'; +import { StatusCode } from '../../../Main/Presentation/Application/StatusCode'; +import { DefaultMessageTransformer } from '../../../Main/Presentation/Transformers'; +import { ResponseMessageEnum } from '../../../Main/Presentation/Utils/ResponseMessageEnum'; +import { ICriteria, RequestCriteria } from '../../../Main/Domain/Criteria'; +import { IdPayload } from '../../../Main/Domain/Payloads/IdPayload'; const responder: FastifyResponder = new FastifyResponder(); diff --git a/src/Item/Presentation/Criterias/ItemFilter.ts b/src/Item/Presentation/Criterias/ItemFilter.ts index 602927c9..c38fd6fa 100644 --- a/src/Item/Presentation/Criterias/ItemFilter.ts +++ b/src/Item/Presentation/Criterias/ItemFilter.ts @@ -1,4 +1,4 @@ -import { Filter } from '@digichanges/shared-experience'; +import { Filter } from '../../../Main/Domain/Criteria'; class ItemFilter extends Filter { diff --git a/src/Item/Presentation/Criterias/ItemSort.ts b/src/Item/Presentation/Criterias/ItemSort.ts index ab0059be..0f8b8672 100644 --- a/src/Item/Presentation/Criterias/ItemSort.ts +++ b/src/Item/Presentation/Criterias/ItemSort.ts @@ -1,4 +1,4 @@ -import { Sort } from '@digichanges/shared-experience'; +import { Sort } from '../../../Main/Domain/Criteria'; class ItemSort extends Sort { diff --git a/src/Item/Presentation/Transformers/ItemTransformer.ts b/src/Item/Presentation/Transformers/ItemTransformer.ts index 567f0ba8..c71c947f 100644 --- a/src/Item/Presentation/Transformers/ItemTransformer.ts +++ b/src/Item/Presentation/Transformers/ItemTransformer.ts @@ -1,8 +1,8 @@ import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import { Transformer } from '@digichanges/shared-experience'; import IItemDomain from '../../Domain/Entities/IItemDomain'; import IItemTransformer from './IItemTransformer'; +import { Transformer } from '../../../Main/Presentation/Transformers'; class ItemTransformer extends Transformer { diff --git a/src/Main/Domain/Criteria/Filter.ts b/src/Main/Domain/Criteria/Filter.ts new file mode 100644 index 00000000..71863712 --- /dev/null +++ b/src/Main/Domain/Criteria/Filter.ts @@ -0,0 +1,72 @@ +import { ParsedQs } from 'qs'; +import { IFilter } from './IFilter'; + +export abstract class Filter implements IFilter +{ + private readonly filters: Map; + + constructor(query: ParsedQs) + { + this.filters = new Map(); + const queryFilters: any = query.filter ?? []; + const defaultFilters: any = this.getDefaultFilters(); + const keys = this.getFields(); + + defaultFilters.forEach((defaultFilter: any) => + { + const defaultKey: string = Object.keys(defaultFilter)[0]; + const defaultValue: string = defaultFilter[defaultKey]; + + this.filters.set(defaultKey, defaultValue); + }); + + const newFilters = Object.keys(queryFilters).map((key: string) => + { + const filter: Record = query.filter as Record; + + return { + [key]: filter[key] + }; + }).filter((value => + { + const key = Object.keys(value)[0]; + return keys.includes(key) ? value : false; + })); + + newFilters.forEach((newFilter: any) => + { + const defaultKey: string = Object.keys(newFilter)[0]; + const defaultValue: string = newFilter[defaultKey]; + + this.filters.set(defaultKey, defaultValue); + }); + } + + get(key: string): T + { + return this.filters.has(key) ? this.filters.get(key) : ''; + } + + getArray(): any + { + return this.filters.entries(); + } + + has(key: string): boolean + { + return this.filters.has(key); + } + + isEmpty(): boolean + { + return this.filters.size === 0; + } + + values(): Map + { + return this.filters; + } + + abstract getFields(): string[]; + abstract getDefaultFilters(): unknown[]; +} diff --git a/src/Main/Domain/Criteria/ICriteria.ts b/src/Main/Domain/Criteria/ICriteria.ts new file mode 100644 index 00000000..b41564d9 --- /dev/null +++ b/src/Main/Domain/Criteria/ICriteria.ts @@ -0,0 +1,10 @@ +import { IPagination } from './IPagination'; +import { IFilter } from './IFilter'; +import { ISort } from './ISort'; + +export interface ICriteria +{ + getPagination(): IPagination; + getFilter(): IFilter; + getSort(): ISort; +} diff --git a/src/Main/Domain/Criteria/IFilter.ts b/src/Main/Domain/Criteria/IFilter.ts new file mode 100644 index 00000000..0a613b80 --- /dev/null +++ b/src/Main/Domain/Criteria/IFilter.ts @@ -0,0 +1,10 @@ + +export interface IFilter +{ + values(): Map; + get(key: string): unknown; + getArray(key: string): unknown[]; + has(key: string): boolean; + isEmpty(): boolean; + getFields(): unknown[]; +} diff --git a/src/Main/Domain/Criteria/IPagination.ts b/src/Main/Domain/Criteria/IPagination.ts new file mode 100644 index 00000000..0e394656 --- /dev/null +++ b/src/Main/Domain/Criteria/IPagination.ts @@ -0,0 +1,10 @@ + +export interface IPagination +{ + getLimit(): number; + getPath(): string; + getOffset(): number; + getCurrentUrl(): string; + getNextUrl(): string; + getExist(): boolean; +} diff --git a/src/Main/Domain/Criteria/IPaginator.ts b/src/Main/Domain/Criteria/IPaginator.ts new file mode 100644 index 00000000..a6c045a9 --- /dev/null +++ b/src/Main/Domain/Criteria/IPaginator.ts @@ -0,0 +1,21 @@ + +export interface IPaginator +{ + paginate(): Promise; + getTotal(): number; + getPerPage(): number; + getCurrentPage(): number; + getLasPage(): number; + getFrom(): number; + getTo(): number; + getPath(): string; + getFirstUrl(): string; + getLastUrl(): string; + getNextUrl(): string | null; + getPrevUrl(): string | null; + getCurrentUrl(): string; + getExist(): boolean; + getMetadata(): Record; + getOffset(): number; + getLimit(): number; +} diff --git a/src/Main/Domain/Criteria/IRequestCriteria.ts b/src/Main/Domain/Criteria/IRequestCriteria.ts new file mode 100644 index 00000000..eab7f0ac --- /dev/null +++ b/src/Main/Domain/Criteria/IRequestCriteria.ts @@ -0,0 +1,10 @@ +import { IFilter } from './IFilter'; +import { ISort } from './ISort'; +import { IPagination } from './IPagination'; + +export interface IRequestCriteria +{ + filter: IFilter; + sort: ISort; + pagination: IPagination; +} diff --git a/src/Main/Domain/Criteria/ISort.ts b/src/Main/Domain/Criteria/ISort.ts new file mode 100644 index 00000000..8de6e558 --- /dev/null +++ b/src/Main/Domain/Criteria/ISort.ts @@ -0,0 +1,5 @@ + +export interface ISort +{ + get(): Map; +} diff --git a/src/Main/Domain/Criteria/RequestCriteria.ts b/src/Main/Domain/Criteria/RequestCriteria.ts new file mode 100644 index 00000000..d1348909 --- /dev/null +++ b/src/Main/Domain/Criteria/RequestCriteria.ts @@ -0,0 +1,34 @@ +import { ICriteria } from './ICriteria'; +import { ISort } from './ISort'; +import { IFilter } from './IFilter'; +import { IPagination } from './IPagination'; +import { IRequestCriteria } from './IRequestCriteria'; + +export class RequestCriteria implements ICriteria +{ + private readonly sort: ISort; + private readonly filter: IFilter; + private readonly pagination: IPagination; + + constructor(criteria: IRequestCriteria) + { + this.sort = criteria.sort; + this.filter = criteria.filter; + this.pagination = criteria.pagination; + } + + getSort(): ISort + { + return this.sort; + } + + getFilter(): IFilter + { + return this.filter; + } + + getPagination(): IPagination + { + return this.pagination; + } +} diff --git a/src/Main/Domain/Criteria/Sort.ts b/src/Main/Domain/Criteria/Sort.ts new file mode 100644 index 00000000..e3b427a4 --- /dev/null +++ b/src/Main/Domain/Criteria/Sort.ts @@ -0,0 +1,56 @@ +import { ParsedQs } from 'qs'; +import { ISort } from './ISort'; + +export abstract class Sort implements ISort +{ + private readonly sorts: Map; + + constructor(query: ParsedQs) + { + this.sorts = new Map(); + const sorts: any = query.sort ?? []; + const keys = this.getFields(); + + const newSorts = Object.keys(sorts).map((key: string) => + { + const sort: any = query.sort; + + return { + [key]: sort[key] + }; + }).filter((value => + { + const key = Object.keys(value)[0]; + return keys.includes(key) ? value : false; + })); + + newSorts.forEach((newSort: any) => + { + const defaultKey: string = Object.keys(newSort)[0]; + const defaultValue: string = newSort[defaultKey]; + + this.sorts.set(defaultKey, defaultValue); + }); + + const defaultSorts = this.getDefaultSorts(); + + if (this.sorts.size === 0) + { + defaultSorts.forEach((defaultSort: any) => + { + const defaultKey: string = Object.keys(defaultSort)[0]; + const defaultValue: string = defaultSort[defaultKey]; + + this.sorts.set(defaultKey, defaultValue); + }); + } + } + + public get(): Map + { + return this.sorts; + } + + abstract getFields(): string[]; + abstract getDefaultSorts(): Record[]; +} diff --git a/src/Main/Domain/Criteria/index.ts b/src/Main/Domain/Criteria/index.ts new file mode 100644 index 00000000..95741520 --- /dev/null +++ b/src/Main/Domain/Criteria/index.ts @@ -0,0 +1,6 @@ +export * from './Filter'; +export * from './ICriteria'; +export * from './IFilter'; +export * from './ISort'; +export * from './RequestCriteria'; +export * from './Sort'; diff --git a/src/Main/Domain/Entities/Base.ts b/src/Main/Domain/Entities/Base.ts new file mode 100644 index 00000000..aca58d30 --- /dev/null +++ b/src/Main/Domain/Entities/Base.ts @@ -0,0 +1,27 @@ +import { randomUUID } from 'crypto'; +import { IBaseDomain } from './IBaseDomain'; + +export class Base implements IBaseDomain +{ + _id: string; + + createdAt: Date; + updatedAt: Date; + + constructor() + { + this._id = randomUUID(); + this.createdAt = new Date(); + this.updatedAt = new Date(); + } + + getId(): string + { + return this._id; + } + + setId(id: string) + { + this._id = id; + } +} diff --git a/src/Main/Domain/Entities/IBaseDomain.ts b/src/Main/Domain/Entities/IBaseDomain.ts new file mode 100644 index 00000000..61c772c8 --- /dev/null +++ b/src/Main/Domain/Entities/IBaseDomain.ts @@ -0,0 +1,7 @@ +import { ITimestamps } from './ITimestamps'; + +export interface IBaseDomain extends ITimestamps +{ + getId(): string; + setId(id: string): void; +} diff --git a/src/Main/Domain/Entities/ITimestamps.ts b/src/Main/Domain/Entities/ITimestamps.ts new file mode 100644 index 00000000..6c5fefbd --- /dev/null +++ b/src/Main/Domain/Entities/ITimestamps.ts @@ -0,0 +1,6 @@ + +export interface ITimestamps +{ + createdAt: Date; + updatedAt: Date; +} diff --git a/src/Main/Domain/Entities/index.ts b/src/Main/Domain/Entities/index.ts new file mode 100644 index 00000000..e2df6da5 --- /dev/null +++ b/src/Main/Domain/Entities/index.ts @@ -0,0 +1,3 @@ +export * from './Base'; +export * from './IBaseDomain'; +export * from './ITimestamps'; diff --git a/src/Main/Domain/Errors/ErrorException.ts b/src/Main/Domain/Errors/ErrorException.ts new file mode 100644 index 00000000..b9c750df --- /dev/null +++ b/src/Main/Domain/Errors/ErrorException.ts @@ -0,0 +1,16 @@ +import IErrorMessage from './IErrorMessage'; + +export class ErrorException extends Error +{ + public metadata: Record; + public errorCode: string | null; + + constructor(errorMessage: IErrorMessage, name = ErrorException.name, metadata: Record = {}) + { + super(); + this.message = errorMessage.message; + this.errorCode = errorMessage?.errorCode ?? null; + this.name = name; + this.metadata = metadata; + } +} diff --git a/src/Main/Domain/Errors/IErrorMessage.ts b/src/Main/Domain/Errors/IErrorMessage.ts new file mode 100644 index 00000000..2363af71 --- /dev/null +++ b/src/Main/Domain/Errors/IErrorMessage.ts @@ -0,0 +1,8 @@ + +interface IErrorMessage +{ + message: string; + errorCode?: string; +} + +export default IErrorMessage; diff --git a/src/Main/Domain/Exceptions/InvalidPasswordException.ts b/src/Main/Domain/Exceptions/InvalidPasswordException.ts index 4cf5ba3d..8c1408ca 100644 --- a/src/Main/Domain/Exceptions/InvalidPasswordException.ts +++ b/src/Main/Domain/Exceptions/InvalidPasswordException.ts @@ -1,4 +1,4 @@ -import { ErrorException } from '@digichanges/shared-experience'; +import { ErrorException } from '../Errors/ErrorException'; class InvalidPasswordException extends ErrorException { diff --git a/src/Main/Domain/Exceptions/NotFoundException.ts b/src/Main/Domain/Exceptions/NotFoundException.ts new file mode 100644 index 00000000..87be2cc7 --- /dev/null +++ b/src/Main/Domain/Exceptions/NotFoundException.ts @@ -0,0 +1,13 @@ +import { ErrorException } from '../Errors/ErrorException'; + +export class NotFoundException extends ErrorException +{ + constructor(entity: string) + { + const key = 'shared.exceptions.notFound'; + super({ + message: `${entity} not found.`, + errorCode: key + }, NotFoundException.name, { entity }); + } +} diff --git a/src/Main/Domain/IBaseExtendDomain.ts b/src/Main/Domain/IBaseExtendDomain.ts index 068b9220..8b106d35 100644 --- a/src/Main/Domain/IBaseExtendDomain.ts +++ b/src/Main/Domain/IBaseExtendDomain.ts @@ -1,4 +1,4 @@ -import { IBaseDomain } from '@digichanges/shared-experience'; +import { IBaseDomain } from './Entities'; export interface IBaseExtendDomain extends IBaseDomain { diff --git a/src/Main/Domain/Payloads/IdPayload.ts b/src/Main/Domain/Payloads/IdPayload.ts new file mode 100644 index 00000000..443bb650 --- /dev/null +++ b/src/Main/Domain/Payloads/IdPayload.ts @@ -0,0 +1,5 @@ + +export interface IdPayload +{ + id: string; +} diff --git a/src/Main/Domain/Repositories/IBaseRepository.ts b/src/Main/Domain/Repositories/IBaseRepository.ts index 17012103..09b31087 100644 --- a/src/Main/Domain/Repositories/IBaseRepository.ts +++ b/src/Main/Domain/Repositories/IBaseRepository.ts @@ -1,5 +1,6 @@ import IByOptions from './IByOptions'; -import { ICriteria, IPaginator } from '@digichanges/shared-experience'; +import { ICriteria } from '../Criteria'; +import { IPaginator } from '../Criteria/IPaginator'; interface IBaseRepository { diff --git a/src/Main/Domain/Shared/IFilesystem.ts b/src/Main/Domain/Shared/IFilesystem.ts new file mode 100644 index 00000000..1477afb7 --- /dev/null +++ b/src/Main/Domain/Shared/IFilesystem.ts @@ -0,0 +1,19 @@ +import { Readable } from 'stream'; +import { FileVersionPayload } from '../../../File/Domain/Payloads/FileVersionPayload'; +import { ListObjectsPayload } from '../../../File/Domain/Payloads/ListObjectsPayload'; + +export interface IFilesystem +{ + listObjects(payload: ListObjectsPayload): Promise; + uploadFile(object: FileVersionPayload, path: string): Promise; + uploadFileByBuffer(object: FileVersionPayload, base64Data: string): Promise; + downloadFile(object: FileVersionPayload): Promise; + downloadStreamFile(object: FileVersionPayload): Promise; + presignedGetObject(object: FileVersionPayload, expiry?: number, respHeaders?: { + [key: string]: any; + }): Promise; + presignedPutObject(objectPath: string, expiry?: number): Promise; + createBucket(bucketName: string, region?: string): Promise; + removeObjects(object: FileVersionPayload): Promise; + setBucketPolicy(bucketPolicy: string, bucketName?: string): Promise; +} diff --git a/src/Main/Domain/Shared/ValidatorSchema.ts b/src/Main/Domain/Shared/ValidatorSchema.ts index 79d1097a..0ec0c5df 100644 --- a/src/Main/Domain/Shared/ValidatorSchema.ts +++ b/src/Main/Domain/Shared/ValidatorSchema.ts @@ -1,4 +1,4 @@ -import { ErrorException } from '@digichanges/shared-experience'; +import { ErrorException } from '../Errors/ErrorException'; type ValidationType = { parseAsync: (data: unknown) => Promise }; diff --git a/src/Main/Infrastructure/Criteria/BasePaginator.ts b/src/Main/Infrastructure/Criteria/BasePaginator.ts new file mode 100644 index 00000000..2331db5e --- /dev/null +++ b/src/Main/Infrastructure/Criteria/BasePaginator.ts @@ -0,0 +1,184 @@ +import { IPaginator } from '../../Domain/Criteria/IPaginator'; +import { IPaginatorConfig } from './IPaginatorConfig'; +import { IFilter } from '../../Domain/Criteria'; +import { ISort } from '../../Domain/Criteria'; +import { IPagination } from '../../Domain/Criteria/IPagination'; +import { ICriteria } from '../../Domain/Criteria'; + +export abstract class BasePaginator implements IPaginator +{ + protected filter: IFilter; + protected sort: ISort; + protected pagination: IPagination; + + protected readonly limit: number; + protected readonly offset: number; + + protected total: number; + protected _perPage: number; + protected perPage: number; + + protected currentPage: number; + protected lastPage: number; + protected from: number; + protected to: number; + + protected readonly metadata: Record; + protected readonly helper?: (data: any) => Promise; + + constructor(criteria: ICriteria, config: IPaginatorConfig = { metadata: {}, helper: undefined }) + { + this.total = 0; + this._perPage = 5; + this.perPage = 5; + this.currentPage = 1; + this.lastPage = 1; + this.from = 0; + this.to = 10; + this.filter = criteria.getFilter(); + this.sort = criteria.getSort(); + this.pagination = criteria.getPagination(); + this.offset = this.pagination.getOffset(); + this.limit = this.pagination.getLimit(); + this.metadata = config?.metadata ?? {}; + this.helper = config?.helper; + } + + public abstract paginate(): Promise; + + public getExist(): boolean + { + return this.pagination.getExist(); + } + + public getTotal(): number + { + return this.total; + } + + public getPerPage(): number + { + if (this.getCurrentPage() > this.lastPage) + { + return 0; + } + + return this.perPage; + } + + public getCurrentPage(): number + { + return this.limit === 1 ? this.currentPage + 1 : this.currentPage; + } + + public getLasPage(): number + { + return this.lastPage; + } + + public getFrom(): number + { + if (this.getCurrentPage() > this.lastPage) + { + return 0; + } + + return this.limit === 1 ? this.from + 1 : this.from; + } + + public getTo(): number + { + if (this.getCurrentPage() > this.lastPage) + { + return 0; + } + + return this.limit === 1 ? this.to + 1 : this.to; + } + + public getPath(): string + { + return this.pagination.getPath(); + } + + public getFirstUrl(): string + { + const searchValue = `pagination[offset]=${this.offset}`; + const newValue = 'pagination[offset]=0'; + + return this.getCurrentUrl().replace(searchValue, newValue); + } + + public getLastUrl(): string + { + const offset = this.limit * this.lastPage; + const searchValue = `pagination[offset]=${this.offset}`; + const newValue = `pagination[offset]=${(this.limit === 1 ? offset - 1 : offset - this.limit)}`; + + return this.getCurrentUrl().replace(searchValue, newValue); + } + + public getNextUrl(): string | null + { + return this.getCurrentPage() < this.lastPage ? this.pagination.getNextUrl() : null; + } + + public getPrevUrl(): string | null + { + if (this.getCurrentPage() > 1) + { + const searchValue = `pagination[offset]=${this.offset}`; + const newValue = `pagination[offset]=${(this.offset - this.limit)}`; + + return this.getCurrentUrl().replace(searchValue, newValue); + } + + return null; + } + + public getCurrentUrl(): string + { + return this.pagination.getCurrentUrl(); + } + + public getMetadata(): Record + { + return this.metadata; + } + + public getOffset(): number + { + return this.offset; + } + + public getLimit(): number + { + return this.limit; + } + + protected setPerPage(perPage: number) + { + this.perPage = perPage <= this.limit ? perPage : this.limit; + } + + protected setCurrentPage() + { + this.currentPage = Math.ceil(Math.abs(((this.offset - 1) / this.limit) + 1)); + } + + protected setLasPage() + { + this.lastPage = Math.ceil((this.total / this.limit)); + } + + protected setFrom() + { + this.from = (this.currentPage * this.limit) - this.limit; + } + + protected setTo() + { + const to = this.currentPage * this.limit; + this.to = to >= this.total ? this.total : to; + } +} diff --git a/src/Main/Infrastructure/Criteria/IPaginatorConfig.ts b/src/Main/Infrastructure/Criteria/IPaginatorConfig.ts new file mode 100644 index 00000000..937e2798 --- /dev/null +++ b/src/Main/Infrastructure/Criteria/IPaginatorConfig.ts @@ -0,0 +1,6 @@ + +export interface IPaginatorConfig +{ + helper?: (data: unknown) => Promise; + metadata?: Record; +} diff --git a/src/Main/Infrastructure/Criteria/index.ts b/src/Main/Infrastructure/Criteria/index.ts new file mode 100644 index 00000000..46b19402 --- /dev/null +++ b/src/Main/Infrastructure/Criteria/index.ts @@ -0,0 +1,2 @@ +export * from './BasePaginator'; +export * from './IPaginatorConfig'; diff --git a/src/Main/Infrastructure/Encryption/BcryptEncryptionStrategy.ts b/src/Main/Infrastructure/Encryption/BcryptEncryptionStrategy.ts new file mode 100644 index 00000000..39a3f8a7 --- /dev/null +++ b/src/Main/Infrastructure/Encryption/BcryptEncryptionStrategy.ts @@ -0,0 +1,21 @@ +import bcrypt from 'bcrypt'; +import { IEncryption } from './IEncryption'; +import { DecryptForbiddenException } from '../Exceptions/DecryptForbiddenException'; + +export class BcryptEncryptionStrategy implements IEncryption +{ + async compare(chain: string, chainHashed: string): Promise + { + return await bcrypt.compare(chain, chainHashed); + } + + async decrypt(chain: string): Promise + { + throw new DecryptForbiddenException(); + } + + async encrypt(chain: string, saltRounds: number = 10): Promise + { + return await bcrypt.hash(chain, saltRounds); + } +} diff --git a/src/Main/Infrastructure/Encryption/IEncryption.ts b/src/Main/Infrastructure/Encryption/IEncryption.ts new file mode 100644 index 00000000..7f8bb3dc --- /dev/null +++ b/src/Main/Infrastructure/Encryption/IEncryption.ts @@ -0,0 +1,7 @@ + +export interface IEncryption +{ + compare(chain: string, chainHashed: string): Promise; + decrypt(chain: string): Promise; + encrypt(chain: string): Promise; +} diff --git a/src/Main/Infrastructure/Encryption/Md5EncryptionStrategy.ts b/src/Main/Infrastructure/Encryption/Md5EncryptionStrategy.ts new file mode 100644 index 00000000..fb51e647 --- /dev/null +++ b/src/Main/Infrastructure/Encryption/Md5EncryptionStrategy.ts @@ -0,0 +1,21 @@ +import md5 from 'md5'; +import { IEncryption } from './IEncryption'; +import { DecryptForbiddenException } from '../Exceptions/DecryptForbiddenException'; + +export class Md5EncryptionStrategy implements IEncryption +{ + async compare(chain: string, chainHashed: string): Promise + { + return md5(chain) === chainHashed; + } + + async decrypt(chain: string): Promise + { + throw new DecryptForbiddenException(); + } + + async encrypt(chain: string): Promise + { + return md5(chain); + } +} diff --git a/src/Main/Infrastructure/Encryption/Tests/encryption.infrastructure.spec.ts b/src/Main/Infrastructure/Encryption/Tests/encryption.infrastructure.spec.ts new file mode 100644 index 00000000..82ec1ed7 --- /dev/null +++ b/src/Main/Infrastructure/Encryption/Tests/encryption.infrastructure.spec.ts @@ -0,0 +1,44 @@ +import { IEncryption } from '../IEncryption'; +import { BcryptEncryptionStrategy } from '../BcryptEncryptionStrategy'; +import { Md5EncryptionStrategy } from '../Md5EncryptionStrategy'; + +describe('Encryption', () => +{ + test('BcryptEncryptionStrategy', async() => + { + try + { + const chain = '12345678'; + const encryption: IEncryption = new BcryptEncryptionStrategy(); + const hash = await encryption.encrypt(chain); + const success = await encryption.compare(chain, hash); + + expect(success).toStrictEqual(true); + + await encryption.decrypt(hash); + } + catch (error: any) + { + expect(error.message).toStrictEqual('Decrypt forbidden.'); + } + }); + + test('Md5EncryptionStrategy', async() => + { + try + { + const chain = '12345678'; + const encryption: IEncryption = new Md5EncryptionStrategy(); + const hash = await encryption.encrypt(chain); + const success = await encryption.compare(chain, hash); + + expect(success).toStrictEqual(true); + + await encryption.decrypt(hash); + } + catch (error: any) + { + expect(error.message).toStrictEqual('Decrypt forbidden.'); + } + }); +}); diff --git a/src/Main/Infrastructure/Encryption/index.ts b/src/Main/Infrastructure/Encryption/index.ts new file mode 100644 index 00000000..5b73369d --- /dev/null +++ b/src/Main/Infrastructure/Encryption/index.ts @@ -0,0 +1,3 @@ +export * from './BcryptEncryptionStrategy'; +export * from './IEncryption'; +export * from './Md5EncryptionStrategy'; diff --git a/src/Main/Infrastructure/Exceptions/DecryptForbiddenException.ts b/src/Main/Infrastructure/Exceptions/DecryptForbiddenException.ts new file mode 100644 index 00000000..9a288605 --- /dev/null +++ b/src/Main/Infrastructure/Exceptions/DecryptForbiddenException.ts @@ -0,0 +1,13 @@ +import { ErrorException } from '../../Domain/Errors/ErrorException'; + +export class DecryptForbiddenException extends ErrorException +{ + constructor() + { + const key = 'shared.exceptions.decryptForbidden'; + super({ + message: 'Decrypt forbidden.', + errorCode: key + }, DecryptForbiddenException.name); + } +} diff --git a/src/Main/Infrastructure/Filesystem/FilesystemMockStrategy.ts b/src/Main/Infrastructure/Filesystem/FilesystemMockStrategy.ts new file mode 100644 index 00000000..5cd69b4d --- /dev/null +++ b/src/Main/Infrastructure/Filesystem/FilesystemMockStrategy.ts @@ -0,0 +1,69 @@ +import internal from 'stream'; +import { IFilesystem } from '../../Domain/Shared/IFilesystem'; +import { FileVersionPayload } from '../../../File/Domain/Payloads/FileVersionPayload'; +import { ListObjectsPayload } from '../../../File/Domain/Payloads/ListObjectsPayload'; + +export class FilesystemMockStrategy implements IFilesystem +{ + readonly #filesystem: string; + + constructor() + { + this.#filesystem = 'filesystem'; + } + + async presignedGetObject(object: FileVersionPayload, expiry: number, respHeaders?: { [key: string]: any; }): Promise + { + return Promise.resolve('success'); + } + + async presignedPutObject(objectName: string, expiry: number): Promise + { + return Promise.resolve('success'); + } + + async createBucket(bucketName: string, region?: string): Promise + { + return Promise.resolve(); + } + + async setBucketPolicy(bucketPolicy: string, bucketName?: string): Promise + { + return Promise.resolve(); + } + + async uploadFile(object: FileVersionPayload, path: string): Promise + { + return Promise.resolve('success'); + } + + async uploadFileByBuffer(object: FileVersionPayload, base64Data: string) + { + return Promise.resolve('success'); + } + + async downloadFile(object: FileVersionPayload): Promise + { + return Promise.resolve('success'); + } + + async downloadStreamFile(object: FileVersionPayload): Promise + { + return Promise.resolve(new internal.Readable()); + } + + async listObjects(payload: ListObjectsPayload) + { + return Promise.resolve('success'); + } + + async removeObjects(object: FileVersionPayload): Promise + { + return Promise.resolve(); + } + + getClient(): any + { + return this.#filesystem; + } +} diff --git a/src/Main/Infrastructure/Filesystem/MinioStrategy.ts b/src/Main/Infrastructure/Filesystem/MinioStrategy.ts new file mode 100644 index 00000000..eaf76e3e --- /dev/null +++ b/src/Main/Infrastructure/Filesystem/MinioStrategy.ts @@ -0,0 +1,133 @@ +import { Client } from 'minio'; +import internal from 'stream'; + +import { IFilesystem } from '../../Domain/Shared/IFilesystem'; +import { FileVersionPayload } from '../../../File/Domain/Payloads/FileVersionPayload'; +import { ListObjectsPayload } from '../../../File/Domain/Payloads/ListObjectsPayload'; + +export interface MinioConfig +{ + endPoint: string; + accessKey: string; + secretKey: string; + useSSL: boolean; + port: number; + publicBucket: string; + privateBucket: string; + rootPath: string; + region: string; +} + +export class MinioStrategy implements IFilesystem +{ + readonly #filesystem: Client; + readonly #publicBucket: string; + readonly #privateBucket: string; + readonly #rootPath: string; + readonly #pathTemp: string; + readonly #region: string; + + constructor(config: MinioConfig) + { + this.#publicBucket = config.publicBucket; + this.#privateBucket = config.privateBucket; + this.#rootPath = config.rootPath; + this.#region = config.region; + this.#pathTemp = '/tmp/'; + + this.#filesystem = new Client({ + endPoint: config.endPoint, + accessKey: config.accessKey, + secretKey: config.secretKey, + region: config.region, + port: config.port, + useSSL: config.useSSL + }); + } + + async presignedGetObject(object: FileVersionPayload, expiry: number, respHeaders?: { [key: string]: any; }): Promise + { + const bucket = this.getBucket(object); + return await this.#filesystem.presignedGetObject(bucket, `${this.#rootPath}${object.objectPath}`, expiry, respHeaders); + } + + async presignedPutObject(objectPath: string, expiry: number, isPrivate = true): Promise + { + return await this.#filesystem.presignedPutObject(this.getBucket(undefined, isPrivate), objectPath, expiry); + } + + async createBucket(bucketPrivate: string, region?: string): Promise + { + return await this.#filesystem.makeBucket(bucketPrivate ?? this.#privateBucket, region ?? this.#region); + } + + async setBucketPolicy(bucketPolicy: string, bucketPrivate?: string): Promise + { + return await this.#filesystem.setBucketPolicy(bucketPrivate ?? this.#privateBucket, bucketPolicy); + } + + async uploadFile(object: FileVersionPayload, path: string) + { + const acl = object.isPublic ? 'public-read' : 'private'; + return await this.#filesystem.fPutObject(this.getBucket(object), `${this.#rootPath}${object.objectPath}`, path, { 'x-amz-acl': acl }); + } + + async uploadFileByBuffer(object: FileVersionPayload, base64Data: string) + { + const buffer = Buffer.from(base64Data, 'base64'); + + return await this.#filesystem.putObject(this.getBucket(object), `${this.#rootPath}${object.objectPath}`, buffer, object.size, { + 'content-type': object.mimeType + }); + } + + async downloadFile(object: FileVersionPayload, isPrivate = true): Promise + { + const filePath = `${this.#pathTemp}${object.name}`; + + await this.#filesystem.fGetObject(this.getBucket(object), `${this.#rootPath}${object.objectPath}`, filePath); + + return filePath; + } + + async downloadStreamFile(object: FileVersionPayload, isPrivate = true): Promise + { + return await this.#filesystem.getObject(this.getBucket(object), `${this.#rootPath}${object.objectPath}`); + } + + async listObjects(payload: ListObjectsPayload) + { + const prefix = payload.prefix; + const recursive = payload.recursive; + const isPrivate = payload.isPublic; + + const stream = this.#filesystem.listObjectsV2(this.getBucket(undefined, isPrivate), prefix, recursive); + + return new Promise((resolve, reject) => + { + const files: any = []; + + stream.on('data', (obj) => + { + files.push(obj); + }); + + stream.on('end', () => resolve(files)); + + stream.on('close', () => resolve(files)); + + stream.on('error', (error) => reject(error)); + }); + } + + async removeObjects(object: FileVersionPayload): Promise + { + await this.#filesystem.removeObject(this.getBucket(object), object.objectPath); + } + + private getBucket(object?: FileVersionPayload, isPrivate = false): string + { + const _isPrivate = (object && typeof object.isPublic !== 'undefined') ? !object.isPublic : isPrivate; + return _isPrivate ? this.#privateBucket : this.#publicBucket; + } +} diff --git a/src/Main/Infrastructure/Filesystem/index.ts b/src/Main/Infrastructure/Filesystem/index.ts new file mode 100644 index 00000000..69ff0ee5 --- /dev/null +++ b/src/Main/Infrastructure/Filesystem/index.ts @@ -0,0 +1,2 @@ +export * from './MinioStrategy'; +export * from './FilesystemMockStrategy'; diff --git a/src/Main/Infrastructure/Orm/MikroORMPaginator.ts b/src/Main/Infrastructure/Orm/MikroORMPaginator.ts index 7185854b..7f1521c3 100644 --- a/src/Main/Infrastructure/Orm/MikroORMPaginator.ts +++ b/src/Main/Infrastructure/Orm/MikroORMPaginator.ts @@ -1,5 +1,7 @@ import { QueryBuilder } from '@mikro-orm/postgresql'; -import { BasePaginator, IPaginatorConfig, IPaginator, ICriteria } from '@digichanges/shared-experience'; +import { BasePaginator, IPaginatorConfig } from '../Criteria'; +import { ICriteria } from '../../Domain/Criteria'; +import { IPaginator } from '../../Domain/Criteria/IPaginator'; class MikroORMPaginator extends BasePaginator implements IPaginator { diff --git a/src/Main/Infrastructure/Orm/MongooseAggregatePaginator.ts b/src/Main/Infrastructure/Orm/MongooseAggregatePaginator.ts index 1be44ded..593b7688 100644 --- a/src/Main/Infrastructure/Orm/MongooseAggregatePaginator.ts +++ b/src/Main/Infrastructure/Orm/MongooseAggregatePaginator.ts @@ -1,5 +1,7 @@ import { Aggregate } from 'mongoose'; -import { ICriteria, BasePaginator, IPaginatorConfig, IPaginator } from '@digichanges/shared-experience'; +import { BasePaginator, IPaginatorConfig } from '../Criteria'; +import { ICriteria } from '../../Domain/Criteria'; +import { IPaginator } from '../../Domain/Criteria/IPaginator'; class MongooseAggregatePaginator extends BasePaginator implements IPaginator { diff --git a/src/Main/Infrastructure/Orm/MongoosePaginator.ts b/src/Main/Infrastructure/Orm/MongoosePaginator.ts index 52b8b04a..c40795c0 100644 --- a/src/Main/Infrastructure/Orm/MongoosePaginator.ts +++ b/src/Main/Infrastructure/Orm/MongoosePaginator.ts @@ -1,5 +1,7 @@ import { Query } from 'mongoose'; -import { IPaginatorConfig, ICriteria, IPaginator, BasePaginator } from '@digichanges/shared-experience'; +import { BasePaginator, IPaginatorConfig } from '../Criteria'; +import { ICriteria } from '../../Domain/Criteria'; +import { IPaginator } from '../../Domain/Criteria/IPaginator'; class MongoosePaginator extends BasePaginator implements IPaginator { diff --git a/src/Main/Infrastructure/Repositories/BaseMikroORMRepository.ts b/src/Main/Infrastructure/Repositories/BaseMikroORMRepository.ts index 58c300b8..de751492 100644 --- a/src/Main/Infrastructure/Repositories/BaseMikroORMRepository.ts +++ b/src/Main/Infrastructure/Repositories/BaseMikroORMRepository.ts @@ -1,8 +1,10 @@ import { EntityRepository, EntitySchema, FindOneOptions } from '@mikro-orm/postgresql'; -import { ICriteria, IPaginator, NotFoundException } from '@digichanges/shared-experience'; import IByOptions from '../../Domain/Repositories/IByOptions'; import IBaseRepository from '../../Domain/Repositories/IBaseRepository'; import EntityMikroORMManagerFactory from '../Factories/EntityMikroORMManagerFactory'; +import { NotFoundException } from '../../Domain/Exceptions/NotFoundException'; +import { ICriteria } from '../../Domain/Criteria'; +import { IPaginator } from '../../Domain/Criteria/IPaginator'; abstract class BaseMikroORMRepository implements IBaseRepository { diff --git a/src/Main/Infrastructure/Repositories/BaseMongooseRepository.ts b/src/Main/Infrastructure/Repositories/BaseMongooseRepository.ts index de318447..ecb801a1 100644 --- a/src/Main/Infrastructure/Repositories/BaseMongooseRepository.ts +++ b/src/Main/Infrastructure/Repositories/BaseMongooseRepository.ts @@ -1,10 +1,13 @@ import * as mongoose from 'mongoose'; -import { IBaseDomain, ICriteria, IPaginator, NotFoundException } from '@digichanges/shared-experience'; import IByOptions from '../../Domain/Repositories/IByOptions'; import IBaseRepository from '../../Domain/Repositories/IBaseRepository'; import MongoosePaginator from '../Orm/MongoosePaginator'; import ResponsePayload from '../../../Shared/Utils/ResponsePayload'; import PaginatorTransformer from '../../../Shared/Utils/PaginatorTransformer'; +import { IBaseDomain } from '../../Domain/Entities'; +import { NotFoundException } from '../../Domain/Exceptions/NotFoundException'; +import { ICriteria } from '../../Domain/Criteria'; +import { IPaginator } from '../../Domain/Criteria/IPaginator'; abstract class BaseMongooseRepository implements IBaseRepository { diff --git a/src/Main/Infrastructure/Repositories/CacheRepository.ts b/src/Main/Infrastructure/Repositories/CacheRepository.ts index ce969051..c6268a1b 100644 --- a/src/Main/Infrastructure/Repositories/CacheRepository.ts +++ b/src/Main/Infrastructure/Repositories/CacheRepository.ts @@ -1,8 +1,9 @@ import crypto from 'crypto'; import IBaseRepository from '../../Domain/Repositories/IBaseRepository'; import ICacheDataAccess from './ICacheDataAccess'; -import { ICriteria, IPaginator } from '@digichanges/shared-experience'; import IByOptions from '../../Domain/Repositories/IByOptions'; +import { ICriteria } from '../../Domain/Criteria'; +import { IPaginator } from '../../Domain/Criteria/IPaginator'; class CacheRepository> implements IBaseRepository { diff --git a/src/Main/Presentation/Application/FormatError.ts b/src/Main/Presentation/Application/FormatError.ts new file mode 100644 index 00000000..dd4247d2 --- /dev/null +++ b/src/Main/Presentation/Application/FormatError.ts @@ -0,0 +1,17 @@ +import { ErrorHttpException } from '../Exceptions/ErrorHttpException'; +import { StatusCode } from './StatusCode'; + +export class FormatError +{ + getFormat = (errorHttpException: ErrorHttpException): any => + { + const { statusCode, message, errors, metadata, errorCode } = errorHttpException; + + return { + message: statusCode.code === StatusCode.HTTP_INTERNAL_SERVER_ERROR.code ? 'Internal Error Server' : message, + errorCode, + errors, + metadata + }; + }; +} diff --git a/src/Main/Presentation/Application/IApp.ts b/src/Main/Presentation/Application/IApp.ts new file mode 100644 index 00000000..bbdc79d4 --- /dev/null +++ b/src/Main/Presentation/Application/IApp.ts @@ -0,0 +1,13 @@ +import { Server } from 'http'; + +export interface IApp +{ + addMiddleware(middleware: T, options?: K): Promise; + setErrorHandler(plugin: any): Promise; + setNotFoundHandler(plugin: any): Promise; + addRouter(router: T, options?: unknown): Promise + callback(): Promise; + close(): Promise; + listen(callback?: () => void): Promise; + getServer(): Promise; +} diff --git a/src/Main/Presentation/Application/IAppConfig.ts b/src/Main/Presentation/Application/IAppConfig.ts new file mode 100644 index 00000000..8cc6d592 --- /dev/null +++ b/src/Main/Presentation/Application/IAppConfig.ts @@ -0,0 +1,8 @@ + +export interface IAppConfig +{ + serverPort: number; + proxy: boolean; + env: string; + cors: string; +} diff --git a/src/Main/Presentation/Application/IHttpStatusCode.ts b/src/Main/Presentation/Application/IHttpStatusCode.ts new file mode 100644 index 00000000..b4582ea5 --- /dev/null +++ b/src/Main/Presentation/Application/IHttpStatusCode.ts @@ -0,0 +1,7 @@ + +export interface IHttpStatusCode +{ + code: number; + statusCode: string; + status: string; +} diff --git a/src/Main/Presentation/Application/StatusCode.ts b/src/Main/Presentation/Application/StatusCode.ts new file mode 100644 index 00000000..dc0f00c1 --- /dev/null +++ b/src/Main/Presentation/Application/StatusCode.ts @@ -0,0 +1,46 @@ +import { IHttpStatusCode } from './IHttpStatusCode'; + +export class StatusCode +{ + public static HTTP_CONTINUE: IHttpStatusCode = { code: 100, statusCode: 'HTTP_CONTINUE', status: '' }; + public static HTTP_SWITCHING_PROTOCOLS: IHttpStatusCode = { code: 101, statusCode: 'HTTP_SWITCHING_PROTOCOLS', status: '' }; + public static HTTP_OK: IHttpStatusCode = { code: 200, statusCode: 'HTTP_OK', status: 'success' }; + public static HTTP_CREATED: IHttpStatusCode = { code: 201, statusCode: 'HTTP_CREATED', status: 'success' }; + public static HTTP_ACCEPTED: IHttpStatusCode = { code: 202, statusCode: 'HTTP_ACCEPTED', status: 'success' }; + public static HTTP_NO_CONTENT: IHttpStatusCode = { code: 204, statusCode: 'HTTP_NO_CONTENT', status: 'success' }; + public static HTTP_MULTIPLE_CHOICES: IHttpStatusCode = { code: 300, statusCode: 'HTTP_MULTIPLE_CHOICES', status: '' }; + public static HTTP_MOVED_PERMANENTLY: IHttpStatusCode = { code: 301, statusCode: 'HTTP_MOVED_PERMANENTLY', status: '' }; + public static HTTP_NOT_MODIFIED: IHttpStatusCode = { code: 304, statusCode: 'HTTP_NOT_MODIFIED', status: '' }; + public static HTTP_BAD_REQUEST: IHttpStatusCode = { code: 400, statusCode: 'HTTP_BAD_REQUEST', status: 'error' }; + public static HTTP_UNAUTHORIZED: IHttpStatusCode = { code: 401, statusCode: 'HTTP_UNAUTHORIZED', status: 'error' }; + public static HTTP_PAYMENT_REQUIRED: IHttpStatusCode = { code: 402, statusCode: 'HTTP_PAYMENT_REQUIRED', status: 'error' }; + public static HTTP_FORBIDDEN: IHttpStatusCode = { code: 403, statusCode: 'HTTP_FORBIDDEN', status: 'error' }; + public static HTTP_NOT_FOUND: IHttpStatusCode = { code: 404, statusCode: 'HTTP_NOT_FOUND', status: 'error' }; + public static HTTP_METHOD_NOT_ALLOWED: IHttpStatusCode = { code: 405, statusCode: 'HTTP_METHOD_NOT_ALLOWED', status: 'error' }; + public static HTTP_REQUEST_TIMEOUT: IHttpStatusCode = { code: 408, statusCode: 'HTTP_REQUEST_TIMEOUT', status: 'error' }; + public static HTTP_REQUEST_ENTITY_TOO_LARGE: IHttpStatusCode = { code: 413, statusCode: 'HTTP_REQUEST_ENTITY_TOO_LARGE', status: 'error' }; + public static HTTP_REQUEST_URI_TOO_LONG: IHttpStatusCode = { code: 414, statusCode: 'HTTP_REQUEST_URI_TOO_LONG', status: 'error' }; + public static HTTP_UNSUPPORTED_MEDIA_TYPE: IHttpStatusCode = { code: 415, statusCode: 'HTTP_UNSUPPORTED_MEDIA_TYPE', status: 'error' }; + public static HTTP_UNPROCESSABLE_ENTITY: IHttpStatusCode = { code: 422, statusCode: 'HTTP_UNPROCESSABLE_ENTITY', status: 'error' }; + public static HTTP_TOO_MANY_REQUESTS: IHttpStatusCode = { code: 429, statusCode: 'HTTP_TOO_MANY_REQUESTS', status: 'error' }; + public static HTTP_INTERNAL_SERVER_ERROR: IHttpStatusCode = { code: 500, statusCode: 'HTTP_INTERNAL_SERVER_ERROR', status: 'error' }; + public static HTTP_NOT_IMPLEMENTED: IHttpStatusCode = { code: 501, statusCode: 'HTTP_NOT_IMPLEMENTED', status: 'error' }; + public static HTTP_BAD_GATEWAY: IHttpStatusCode = { code: 502, statusCode: 'HTTP_BAD_GATEWAY', status: 'error' }; + public static HTTP_SERVICE_UNAVAILABLE: IHttpStatusCode = { code: 503, statusCode: 'HTTP_SERVICE_UNAVAILABLE', status: 'error' }; + public static HTTP_GATEWAY_TIMEOUT: IHttpStatusCode = { code: 504, statusCode: 'HTTP_GATEWAY_TIMEOUT', status: 'error' }; + + public static searchByCodeNumber(code: number): IHttpStatusCode + { + const keys = Object.keys(StatusCode) as (keyof typeof StatusCode)[]; + + for (const key of keys) + { + if ((StatusCode[key] as IHttpStatusCode)?.code === code) + { + return StatusCode[key]; + } + } + + return StatusCode.HTTP_OK; + } +} diff --git a/src/Main/Presentation/Exceptions/DuplicateEntityHttpException.ts b/src/Main/Presentation/Exceptions/DuplicateEntityHttpException.ts index 22357503..ae37c6a5 100644 --- a/src/Main/Presentation/Exceptions/DuplicateEntityHttpException.ts +++ b/src/Main/Presentation/Exceptions/DuplicateEntityHttpException.ts @@ -1,4 +1,5 @@ -import { StatusCode, ErrorHttpException } from '@digichanges/shared-experience'; +import { ErrorHttpException } from './ErrorHttpException'; +import { StatusCode } from '../Application/StatusCode'; class DuplicateEntityHttpException extends ErrorHttpException { diff --git a/src/Main/Presentation/Exceptions/ErrorHttpException.ts b/src/Main/Presentation/Exceptions/ErrorHttpException.ts new file mode 100644 index 00000000..97c1b3ca --- /dev/null +++ b/src/Main/Presentation/Exceptions/ErrorHttpException.ts @@ -0,0 +1,61 @@ +import IErrorMessage from '../../Domain/Errors/IErrorMessage'; +import { IHttpStatusCode } from '../Application/IHttpStatusCode'; +import { StatusCode } from '../Application/StatusCode'; + +export class ErrorHttpException extends Error +{ + private _statusCode: IHttpStatusCode; + private _errors: any[]; + private _metadata: Record; + private _errorCode: string | null; + + constructor(statusCode: IHttpStatusCode = StatusCode.HTTP_INTERNAL_SERVER_ERROR, errorMessage: IErrorMessage = { message: 'Internal Error' }, errors: any[] = [], metadata: Record = {}) + { + super(); + this._statusCode = statusCode; + this._errors = errors; + this.message = errorMessage.message; + this._errorCode = errorMessage?.errorCode ?? null; + this._metadata = metadata; + } + + public get statusCode(): IHttpStatusCode + { + return this._statusCode; + } + + public set statusCode(value: IHttpStatusCode) + { + this._statusCode = value; + } + + public get errors(): any[] + { + return this._errors; + } + + public set errors(err: any[]) + { + this._errors = err; + } + + public get metadata(): Record + { + return this._metadata; + } + + public set metadata(metadata: Record) + { + this._metadata = metadata; + } + + public get errorCode(): string | null + { + return this._errorCode; + } + + public set errorCode(errorKey: string | null) + { + this._errorCode = errorKey; + } +} diff --git a/src/Main/Presentation/Factories/AppBootstrapFactory.ts b/src/Main/Presentation/Factories/AppBootstrapFactory.ts index 85264cdd..0eec15e9 100644 --- a/src/Main/Presentation/Factories/AppBootstrapFactory.ts +++ b/src/Main/Presentation/Factories/AppBootstrapFactory.ts @@ -1,7 +1,7 @@ -import IExtendAppConfig from '../Http/IExtendAppConfig'; import FastifyBootstrapping from '../Http/FastifyBootstrapping'; +import { IAppConfig } from '../Application/IAppConfig'; -type TypeAppBootstrap = (config: IExtendAppConfig) => Promise; +type TypeAppBootstrap = (config: IAppConfig) => Promise; class AppBootstrapFactory { diff --git a/src/Main/Presentation/Factories/ExceptionFactory.ts b/src/Main/Presentation/Factories/ExceptionFactory.ts index 7ec3fb41..46b687d6 100644 --- a/src/Main/Presentation/Factories/ExceptionFactory.ts +++ b/src/Main/Presentation/Factories/ExceptionFactory.ts @@ -1,7 +1,8 @@ -import { ErrorHttpException, StatusCode } from '@digichanges/shared-experience'; import TokenExpiredHttpException from '../../../Auth/Presentation/Exceptions/TokenExpiredHttpException'; import DuplicateEntityHttpException from '../Exceptions/DuplicateEntityHttpException'; import exceptions from '../../../Config/exceptions'; +import { StatusCode } from '../Application/StatusCode'; +import { ErrorHttpException } from '../Exceptions/ErrorHttpException'; class ExceptionFactory { diff --git a/src/Main/Presentation/Http/AppFastify.ts b/src/Main/Presentation/Http/AppFastify.ts index aa05783e..e1f9e3b2 100644 --- a/src/Main/Presentation/Http/AppFastify.ts +++ b/src/Main/Presentation/Http/AppFastify.ts @@ -1,7 +1,8 @@ import qs from 'qs'; import { Server } from 'http'; import Fastify, { FastifyInstance, FastifyPluginCallback } from 'fastify'; -import { IApp, IAppConfig } from '@digichanges/shared-experience'; +import { IApp } from '../Application/IApp'; +import { IAppConfig } from '../Application/IAppConfig'; export class AppFastify implements IApp { diff --git a/src/Main/Presentation/Http/FastifyBootstrapping.ts b/src/Main/Presentation/Http/FastifyBootstrapping.ts index b8745c44..4865ad19 100644 --- a/src/Main/Presentation/Http/FastifyBootstrapping.ts +++ b/src/Main/Presentation/Http/FastifyBootstrapping.ts @@ -6,12 +6,12 @@ import IndexFastifyRouter from '../Routers/IndexFastifyRouter'; import ItemFastifyRouter from '../../../Item/Presentation/Routes/ItemFastifyRouter'; import NotificationFastifyHandler from '../../../Notification/Presentation/Handlers/NotificationFastifyHandler'; -import IExtendAppConfig from './IExtendAppConfig'; import { AppFastify } from './AppFastify'; import { ErrorFastifyHandler } from '../Middleware/ErrorFastifyHandler'; import FileFastifyRouter from '../../../File/Presentation/Routes/FileFastifyRouter'; +import { IAppConfig } from '../Application/IAppConfig'; -const FastifyBootstrapping = async(config: IExtendAppConfig) => +const FastifyBootstrapping = async(config: IAppConfig) => { const app = new AppFastify(config); diff --git a/src/Main/Presentation/Http/IExtendAppConfig.ts b/src/Main/Presentation/Http/IExtendAppConfig.ts deleted file mode 100644 index 2908aef2..00000000 --- a/src/Main/Presentation/Http/IExtendAppConfig.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IAppConfig } from '@digichanges/shared-experience'; - -type IExtendAppConfig = IAppConfig & { - env: string, - cors: string -}; - -export default IExtendAppConfig; diff --git a/src/Main/Presentation/Middleware/ErrorFastifyHandler.ts b/src/Main/Presentation/Middleware/ErrorFastifyHandler.ts index 22d1dc82..ab8438fd 100644 --- a/src/Main/Presentation/Middleware/ErrorFastifyHandler.ts +++ b/src/Main/Presentation/Middleware/ErrorFastifyHandler.ts @@ -1,6 +1,6 @@ import FastifyResponder from '../Utils/FastifyResponder'; -import { ErrorHttpException } from '@digichanges/shared-experience'; import ExceptionFactory from '../Factories/ExceptionFactory'; +import { ErrorHttpException } from '../Exceptions/ErrorHttpException'; export const ErrorFastifyHandler = async(error: any, request: any, reply: any) => { diff --git a/src/Main/Presentation/Routers/IndexFastifyRouter.ts b/src/Main/Presentation/Routers/IndexFastifyRouter.ts index 37ba7d91..5a51b09b 100644 --- a/src/Main/Presentation/Routers/IndexFastifyRouter.ts +++ b/src/Main/Presentation/Routers/IndexFastifyRouter.ts @@ -1,6 +1,6 @@ import FastifyResponder from '../Utils/FastifyResponder'; -import { StatusCode } from '@digichanges/shared-experience'; import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'; +import { StatusCode } from '../Application/StatusCode'; const IndexFastifyRouter = async(fastify: FastifyInstance) => { diff --git a/src/Main/Presentation/Transformers/BaseTransformer.ts b/src/Main/Presentation/Transformers/BaseTransformer.ts new file mode 100644 index 00000000..8f171a56 --- /dev/null +++ b/src/Main/Presentation/Transformers/BaseTransformer.ts @@ -0,0 +1,5 @@ + +export type BasePropertiesTransformer = { id: string, createdAt: number, updatedAt: number }; +export type OmitPropertiesTransformer = 'createdAt' | 'updatedAt'; + +export type BaseTransformer = Partial>; diff --git a/src/Main/Presentation/Transformers/DefaultMessageTransformer.ts b/src/Main/Presentation/Transformers/DefaultMessageTransformer.ts new file mode 100644 index 00000000..4a19f7d2 --- /dev/null +++ b/src/Main/Presentation/Transformers/DefaultMessageTransformer.ts @@ -0,0 +1,23 @@ +import { Transformer } from './Transformer'; +import { IDefaultMessageTransformer } from './IDefaultMessageTransformer'; +import { Base } from '../../Domain/Entities'; +import { ResponseMessageEnum } from '../Utils/ResponseMessageEnum'; + +export class DefaultMessageTransformer extends Transformer +{ + readonly #typeResponse: string; + + constructor(response: ResponseMessageEnum) + { + super(); + this.#typeResponse = response; + } + + public async transform(data: T): Promise + { + return { + id: data?._id, + message: this.#typeResponse + }; + } +} diff --git a/src/Main/Presentation/Transformers/DefaultTransformer.ts b/src/Main/Presentation/Transformers/DefaultTransformer.ts new file mode 100644 index 00000000..e036876a --- /dev/null +++ b/src/Main/Presentation/Transformers/DefaultTransformer.ts @@ -0,0 +1,9 @@ +import { Transformer } from './Transformer'; + +export class DefaultTransformer extends Transformer +{ + public async transform(data: any) + { + return data; + } +} diff --git a/src/Main/Presentation/Transformers/IDefaultMessageTransformer.ts b/src/Main/Presentation/Transformers/IDefaultMessageTransformer.ts new file mode 100644 index 00000000..f9b1d81f --- /dev/null +++ b/src/Main/Presentation/Transformers/IDefaultMessageTransformer.ts @@ -0,0 +1,6 @@ + +export interface IDefaultMessageTransformer +{ + id: string | undefined; + message: string; +} diff --git a/src/Main/Presentation/Transformers/ILocaleMessage.ts b/src/Main/Presentation/Transformers/ILocaleMessage.ts new file mode 100644 index 00000000..6663e62d --- /dev/null +++ b/src/Main/Presentation/Transformers/ILocaleMessage.ts @@ -0,0 +1,6 @@ + +export interface ILocaleMessage +{ + message: string; + messageCode: string; +} diff --git a/src/Main/Presentation/Transformers/Transformer.ts b/src/Main/Presentation/Transformers/Transformer.ts new file mode 100644 index 00000000..be33d182 --- /dev/null +++ b/src/Main/Presentation/Transformers/Transformer.ts @@ -0,0 +1,24 @@ + +export abstract class Transformer +{ + abstract transform(data: T): Promise

; + + async handle(data: T | T[]): Promise

+ { + let result: P[] | P = []; + + if (Array.isArray(data)) + { + for await (const element of data) + { + result.push(await this.transform(element)); + } + } + else + { + result = await this.transform(data); + } + + return result; + } +} diff --git a/src/Main/Presentation/Transformers/index.ts b/src/Main/Presentation/Transformers/index.ts new file mode 100644 index 00000000..8246aec5 --- /dev/null +++ b/src/Main/Presentation/Transformers/index.ts @@ -0,0 +1,6 @@ +export * from './BaseTransformer'; +export * from './DefaultMessageTransformer'; +export * from './DefaultTransformer'; +export * from './IDefaultMessageTransformer'; +export * from './ILocaleMessage'; +export * from './Transformer'; diff --git a/src/Main/Presentation/Utils/FastifyResponder.ts b/src/Main/Presentation/Utils/FastifyResponder.ts index b7840b43..2afa707f 100644 --- a/src/Main/Presentation/Utils/FastifyResponder.ts +++ b/src/Main/Presentation/Utils/FastifyResponder.ts @@ -1,10 +1,9 @@ -import { - Transformer, - FormatError, - ErrorHttpException, - IHttpStatusCode -} from '@digichanges/shared-experience'; + import { FastifyReply } from 'fastify'; +import { FormatError } from '../Application/FormatError'; +import { IHttpStatusCode } from '../Application/IHttpStatusCode'; +import { Transformer } from '../Transformers'; +import { ErrorHttpException } from '../Exceptions/ErrorHttpException'; class FastifyResponder { diff --git a/src/Main/Presentation/Utils/ResponseMessageEnum.ts b/src/Main/Presentation/Utils/ResponseMessageEnum.ts new file mode 100644 index 00000000..aa3a72d5 --- /dev/null +++ b/src/Main/Presentation/Utils/ResponseMessageEnum.ts @@ -0,0 +1,6 @@ + +export enum ResponseMessageEnum { + CREATED = 'Created Successfully.', + UPDATED = 'Updated successfully.', + DELETED = 'Deleted successfully.' +} diff --git a/src/Notification/Domain/Entities/INotificationDomain.ts b/src/Notification/Domain/Entities/INotificationDomain.ts index 8c3b114f..18a117a8 100644 --- a/src/Notification/Domain/Entities/INotificationDomain.ts +++ b/src/Notification/Domain/Entities/INotificationDomain.ts @@ -1,4 +1,4 @@ -import { IBaseDomain } from '@digichanges/shared-experience'; +import { IBaseDomain } from '../../../Main/Domain/Entities'; interface INotificationDomain extends IBaseDomain { diff --git a/src/Notification/Domain/Entities/Notification.ts b/src/Notification/Domain/Entities/Notification.ts index 1b29b2c0..0a7f9fee 100644 --- a/src/Notification/Domain/Entities/Notification.ts +++ b/src/Notification/Domain/Entities/Notification.ts @@ -1,5 +1,5 @@ import INotificationDomain from './INotificationDomain'; -import { Base } from '@digichanges/shared-experience'; +import { Base } from '../../../Main/Domain/Entities'; class Notification extends Base implements INotificationDomain { diff --git a/src/Notification/Domain/Entities/TypeNotification.ts b/src/Notification/Domain/Entities/TypeNotification.ts index 96cb8fbd..58532ac4 100644 --- a/src/Notification/Domain/Entities/TypeNotification.ts +++ b/src/Notification/Domain/Entities/TypeNotification.ts @@ -1,6 +1,6 @@ import webPush from 'web-push'; -import { Base } from '@digichanges/shared-experience'; import TypeEnum from '../Enum/TypeEnum'; +import { Base } from '../../../Main/Domain/Entities'; class TypeNotification extends Base { diff --git a/src/Notification/Domain/Events/SendMessageEvent.ts b/src/Notification/Domain/Events/SendMessageEvent.ts index 89f6247f..8b174567 100644 --- a/src/Notification/Domain/Events/SendMessageEvent.ts +++ b/src/Notification/Domain/Events/SendMessageEvent.ts @@ -1,6 +1,6 @@ import { FACTORIES } from '../../../Shared/DI/Injects'; import NotifierFactory from '../../Shared/NotifierFactory'; -import { IEvent } from '../../Infrastructure/events'; +import { IEvent } from '../Models/IEvent'; class SendMessageEvent implements IEvent { diff --git a/src/Notification/Infrastructure/events/EventHandler.ts b/src/Notification/Domain/Models/EventHandler.ts similarity index 89% rename from src/Notification/Infrastructure/events/EventHandler.ts rename to src/Notification/Domain/Models/EventHandler.ts index 544964d3..32fbcb78 100644 --- a/src/Notification/Infrastructure/events/EventHandler.ts +++ b/src/Notification/Domain/Models/EventHandler.ts @@ -1,17 +1,14 @@ import { Subject } from 'rxjs'; import { IEvent } from './IEvent'; + export interface IEventHandler { - execute(eventName: string, args: any): void; + execute(eventName: string, args: unknown): void; setEvent(_event: IEvent): void; removeListeners(): void; } -type SubscribeEventProps = - { - eventName: string; - args: Record; - } +type SubscribeEventProps = { eventName: string; args: Record; } export class EventHandler implements IEventHandler { @@ -20,7 +17,6 @@ export class EventHandler implements IEventHandler constructor() { - console.log(1); this.events = new Map Promise>(); this.eventSubject = new Subject(); diff --git a/src/Notification/Infrastructure/events/IEvent.ts b/src/Notification/Domain/Models/IEvent.ts similarity index 100% rename from src/Notification/Infrastructure/events/IEvent.ts rename to src/Notification/Domain/Models/IEvent.ts diff --git a/src/Notification/Domain/Services/AttachmentsFilesService.ts b/src/Notification/Domain/Services/AttachmentsFilesService.ts index 939ca821..099ef51d 100644 --- a/src/Notification/Domain/Services/AttachmentsFilesService.ts +++ b/src/Notification/Domain/Services/AttachmentsFilesService.ts @@ -2,15 +2,16 @@ import PATH from 'path'; import EmailNotification from '../Entities/EmailNotification'; import IFilesAttachments from '../Entities/IFilesAttachments'; import { promises as fs, createWriteStream } from 'fs'; -import FilesystemFactory from '../../../../src/Shared/Factories/FilesystemFactory'; import Logger from '../../../Shared/Helpers/Logger'; -import { FileVersionPayload } from '@digichanges/shared-experience'; +import DependencyInjector from '../../../Shared/DI/DependencyInjector'; +import { IFilesystem } from '../../../Main/Domain/Shared/IFilesystem'; +import { FileVersionPayload } from '../../../File/Domain/Payloads/FileVersionPayload'; class AttachmentsFilesService { static async getTempFilesAttachments(emailNotification: EmailNotification): Promise { - const filesystem = FilesystemFactory.create(); + const filesystem = DependencyInjector.inject('IFilesystem'); const tempDir = PATH.join(__dirname, '../../../temp'); await fs.mkdir(tempDir, { recursive: true }); diff --git a/src/Notification/Domain/Services/NotificationService.ts b/src/Notification/Domain/Services/NotificationService.ts index 2a66c822..e34d5d7d 100644 --- a/src/Notification/Domain/Services/NotificationService.ts +++ b/src/Notification/Domain/Services/NotificationService.ts @@ -3,19 +3,19 @@ import PushNotification from '../Entities/PushNotification'; import SendMessageEvent from '../Events/SendMessageEvent'; import NotificationSendMessagePayload from '../Payloads/NotificationSendMessagePayload'; import INotificationResponse from '../Entities/INotificationResponse'; -import { IEventHandler } from '../../Infrastructure/events'; import DependencyInjector from '../../../Shared/DI/DependencyInjector'; +import { IEventHandler } from '../Models/EventHandler'; class NotificationService { - private eventHandler: IEventHandler; + #eventHandler: IEventHandler; async execute(pushNotification: PushNotification, payload: NotificationRepPayload, message: string, name: string): Promise { - this.eventHandler = DependencyInjector.inject('IEventHandler'); + this.#eventHandler = DependencyInjector.inject('IEventHandler'); pushNotification.subscription = payload.getSubscription(); pushNotification.name = name; - this.eventHandler.execute(SendMessageEvent.name, { push_notification: pushNotification, message }); + this.#eventHandler.execute(SendMessageEvent.name, { push_notification: pushNotification, message }); return { message: 'We\'ve sent you a notification' }; } diff --git a/src/Notification/Infrastructure/Repositories/INotificationRepository.ts b/src/Notification/Infrastructure/Repositories/INotificationRepository.ts index 74854a58..5bcade6e 100644 --- a/src/Notification/Infrastructure/Repositories/INotificationRepository.ts +++ b/src/Notification/Infrastructure/Repositories/INotificationRepository.ts @@ -1,4 +1,5 @@ -import { IPaginator, ICriteria } from '@digichanges/shared-experience'; +import { ICriteria } from '../../../Main/Domain/Criteria'; +import { IPaginator } from '../../../Main/Domain/Criteria/IPaginator'; interface INotificationRepository { diff --git a/src/Notification/Infrastructure/Repositories/NotificationMongooseRepository.ts b/src/Notification/Infrastructure/Repositories/NotificationMongooseRepository.ts index 9c88b218..82677efd 100644 --- a/src/Notification/Infrastructure/Repositories/NotificationMongooseRepository.ts +++ b/src/Notification/Infrastructure/Repositories/NotificationMongooseRepository.ts @@ -1,5 +1,4 @@ import * as mongoose from 'mongoose'; -import { NotFoundException, IPaginator, ICriteria } from '@digichanges/shared-experience'; import INotificationRepository from './INotificationRepository'; import { NotificationMongooseDocument } from '../Schemas/NotificationMongoose'; @@ -9,6 +8,9 @@ import INotificationDomain from '../../Domain/Entities/INotificationDomain'; import EmailNotification from '../../Domain/Entities/EmailNotification'; import PushNotification from '../../Domain/Entities/PushNotification'; import NotificationFilter from '../../Presentation/Criterias/NotificationFilter'; +import { NotFoundException } from '../../../Main/Domain/Exceptions/NotFoundException'; +import { ICriteria } from '../../../Main/Domain/Criteria'; +import { IPaginator } from '../../../Main/Domain/Criteria/IPaginator'; class NotificationMongooseRepository implements INotificationRepository { diff --git a/src/Notification/Infrastructure/events/index.ts b/src/Notification/Infrastructure/events/index.ts deleted file mode 100644 index 3113181b..00000000 --- a/src/Notification/Infrastructure/events/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './EventHandler'; -export * from './IEvent'; diff --git a/src/Notification/Presentation/Controller/NotificationFastifyController.ts b/src/Notification/Presentation/Controller/NotificationFastifyController.ts index 6ca740aa..a7bf55d0 100644 --- a/src/Notification/Presentation/Controller/NotificationFastifyController.ts +++ b/src/Notification/Presentation/Controller/NotificationFastifyController.ts @@ -1,5 +1,4 @@ import { FastifyReply, FastifyRequest } from 'fastify'; -import { StatusCode } from '@digichanges/shared-experience'; import FastifyResponder from '../../../Main/Presentation/Utils/FastifyResponder'; import NotificationSubscriptionRequest from '../Requests/NotificationCreateSuscriptionRequest'; @@ -7,6 +6,7 @@ import NotificationSendMessageRequest from '../Requests/NotificationSendMessageR import CreateSubscriptionUseCase from '../../Domain/UseCases/CreateSubscriptionUseCase'; import SendPushNotificationUseCase from '../../Domain/UseCases/SendPushNotificationUseCase'; import SendMessageBrokerUseCase from '../../Domain/UseCases/SendMessageBrokerUseCase'; +import { StatusCode } from '../../../Main/Presentation/Application/StatusCode'; class NotificationFastifyController { diff --git a/src/Notification/Presentation/Criterias/NotificationFilter.ts b/src/Notification/Presentation/Criterias/NotificationFilter.ts index 7a9d4fd8..dfadd97f 100644 --- a/src/Notification/Presentation/Criterias/NotificationFilter.ts +++ b/src/Notification/Presentation/Criterias/NotificationFilter.ts @@ -1,4 +1,4 @@ -import { Filter } from '@digichanges/shared-experience'; +import { Filter } from '../../../Main/Domain/Criteria'; class NotificationFilter extends Filter { diff --git a/src/Notification/Presentation/Criterias/NotificationSort.ts b/src/Notification/Presentation/Criterias/NotificationSort.ts index 50c2a7c5..e074623f 100644 --- a/src/Notification/Presentation/Criterias/NotificationSort.ts +++ b/src/Notification/Presentation/Criterias/NotificationSort.ts @@ -1,4 +1,4 @@ -import { Sort } from '@digichanges/shared-experience'; +import { Sort } from '../../../Main/Domain/Criteria'; class NotificationSort extends Sort { diff --git a/src/Notification/Shared/EmailStrategy.ts b/src/Notification/Shared/EmailStrategy.ts index 7da68d66..2bd417b9 100644 --- a/src/Notification/Shared/EmailStrategy.ts +++ b/src/Notification/Shared/EmailStrategy.ts @@ -8,9 +8,10 @@ import AttachmentsFilesService from '../Domain/Services/AttachmentsFilesService' import StatusNotificationEnum from '../Domain/Enum/StatusNotificationEnum'; import EmailNotification from '../Domain/Entities/EmailNotification'; import INotifierStrategy from './INotifierStrategy'; -import { ErrorException } from '@digichanges/shared-experience'; + import container from '../../Shared/DI/container'; import { MainConfig } from '../../Config/MainConfig'; +import { ErrorException } from '../../Main/Domain/Errors/ErrorException'; class EmailStrategy implements INotifierStrategy { diff --git a/src/Shared/DI/container.ts b/src/Shared/DI/container.ts index b7057d98..7e9e5285 100644 --- a/src/Shared/DI/container.ts +++ b/src/Shared/DI/container.ts @@ -1,6 +1,5 @@ import 'reflect-metadata'; import { container, DependencyContainer, Lifecycle, instanceCachingFactory } from 'tsyringe'; -import { IEncryption, Md5EncryptionStrategy } from '@digichanges/shared-experience'; import { FACTORIES, SERVICES, REPOSITORIES } from './Injects'; @@ -28,12 +27,15 @@ import RabbitMQMessageBroker from '../Infrastructure/RabbitMQMessageBroker'; import CronService, { ICronService } from '../../Main/Infrastructure/Factories/CronService'; import { MainConfig } from '../../Config/MainConfig'; -import IFileVersionRepository from '../../File/Infrastructure/Repositories/IFileVersionRepository'; -import IFileRepository from '../../File/Infrastructure/Repositories/IFileRepository'; +import IFileVersionRepository from '../../File/Domain/Repositories/IFileVersionRepository'; +import IFileRepository from '../../File/Domain/Repositories/IFileRepository'; import FileVersionMongooseRepository from '../../File/Infrastructure/Repositories/FileVersionMongooseRepository'; import FileMongooseRepository from '../../File/Infrastructure/Repositories/FileMongooseRepository'; -import EventHandler, { IEventHandler } from '../../Notification/Infrastructure/events/EventHandler'; +import EventHandler, { IEventHandler } from '../../Notification/Domain/Models/EventHandler'; +import { IEncryption, Md5EncryptionStrategy } from '../../Main/Infrastructure/Encryption'; +import { IFilesystem } from '../../Main/Domain/Shared/IFilesystem'; +import { MinioStrategy } from '../../Main/Infrastructure/Filesystem'; const config = MainConfig.getEnv(); const defaultDbConfig = config.DB_ORM_DEFAULT; @@ -45,6 +47,18 @@ const cacheConfig = { password: config.CACHE_PASSWORD }; +const filesystemConfig = { + endPoint: config.MINIO_HOST, + accessKey: config.MINIO_ACCESS_KEY, + secretKey: config.MINIO_SECRET_KEY, + useSSL: config.MINIO_USE_SSL, + port: config.MINIO_PORT, + publicBucket: config.MINIO_PUBLIC_BUCKET, + privateBucket: config.MINIO_PRIVATE_BUCKET, + rootPath: '/data', + region: config.MINIO_REGION +}; + // Data Access Objects container.register(REPOSITORIES.ICacheDataAccess, { @@ -116,5 +130,12 @@ container.register(FACTORIES.IDatabaseFactory, { }) }, { lifecycle: Lifecycle.Transient }); +container.register('IFilesystem', { + // @ts-ignore + useFactory: instanceCachingFactory(() => + { + return new MinioStrategy(filesystemConfig); + }) +}, { lifecycle: Lifecycle.Transient }); export default container; diff --git a/src/Shared/Factories/FilesystemFactory.ts b/src/Shared/Factories/FilesystemFactory.ts deleted file mode 100644 index 852185cb..00000000 --- a/src/Shared/Factories/FilesystemFactory.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { IFilesystem, MinioStrategy } from '@digichanges/shared-experience'; -import { MainConfig } from '../../Config/MainConfig'; - -type FilesystemValueProp = typeof MinioStrategy; - -class FilesystemFactory -{ - static create(_default?: 'minio'): IFilesystem - { - const config = MainConfig.getEnv(); - const filesystemKey = _default ?? config.FILESYSTEM_DEFAULT; - const filesystemConfig = { - endPoint: config.MINIO_HOST, - accessKey: config.MINIO_ACCESS_KEY, - secretKey: config.MINIO_SECRET_KEY, - useSSL: config.MINIO_USE_SSL, - port: config.MINIO_PORT, - publicBucket: config.MINIO_PUBLIC_BUCKET, - privateBucket: config.MINIO_PRIVATE_BUCKET, - rootPath: '/data', - region: config.MINIO_REGION - }; - - const strategy = new Map(); - strategy.set('minio', MinioStrategy); - - return new (strategy.get(filesystemKey))(filesystemConfig); - } -} - -export default FilesystemFactory; diff --git a/src/Shared/Infrastructure/RabbitMQMessageBroker.ts b/src/Shared/Infrastructure/RabbitMQMessageBroker.ts index 598379c5..9c68f77c 100644 --- a/src/Shared/Infrastructure/RabbitMQMessageBroker.ts +++ b/src/Shared/Infrastructure/RabbitMQMessageBroker.ts @@ -1,7 +1,7 @@ import { Connection, Channel, connect } from 'amqplib'; -import { ErrorException } from '@digichanges/shared-experience'; import { IMessageBroker, PublishParams, SubscribeParams, MessageBrokerConfig } from './IMessageBroker'; +import { ErrorException } from '../../Main/Domain/Errors/ErrorException'; class RabbitMQMessageBroker implements IMessageBroker { diff --git a/src/Shared/Utils/Pagination.ts b/src/Shared/Utils/Pagination.ts index 2892a1cc..18ad07bd 100644 --- a/src/Shared/Utils/Pagination.ts +++ b/src/Shared/Utils/Pagination.ts @@ -1,6 +1,6 @@ import qs from 'qs'; -import { IPagination } from '@digichanges/shared-experience'; import { MainConfig } from '../../Config/MainConfig'; +import { IPagination } from '../../Main/Domain/Criteria/IPagination'; class Pagination implements IPagination { diff --git a/src/Shared/Utils/PaginatorTransformer.ts b/src/Shared/Utils/PaginatorTransformer.ts index 45a2129d..8377c397 100644 --- a/src/Shared/Utils/PaginatorTransformer.ts +++ b/src/Shared/Utils/PaginatorTransformer.ts @@ -1,5 +1,6 @@ -import { IPaginator, Transformer } from '@digichanges/shared-experience'; import { PaginatorTransformerResponse } from './PaginatorTransformerResponse'; +import { Transformer } from '../../Main/Presentation/Transformers'; +import { IPaginator } from '../../Main/Domain/Criteria/IPaginator'; class PaginatorTransformer extends Transformer { diff --git a/src/closed.ts b/src/closed.ts index 59cb229a..a681a5e9 100644 --- a/src/closed.ts +++ b/src/closed.ts @@ -5,7 +5,7 @@ import Logger from './Shared/Helpers/Logger'; import ICreateConnection from './Main/Infrastructure/Database/ICreateConnection'; import { Server } from 'http'; import { IMessageBroker } from './Shared/Infrastructure/IMessageBroker'; -import { IEventHandler } from './Notification/Infrastructure/events'; +import { IEventHandler } from './Notification/Domain/Models/EventHandler'; interface ClosedApplicationParams { diff --git a/src/command.ts b/src/command.ts index dfac74cc..ea16839c 100644 --- a/src/command.ts +++ b/src/command.ts @@ -1,3 +1,6 @@ +import dotenv from 'dotenv'; +dotenv.config(); + import { exit } from 'shelljs'; import commander from 'commander'; diff --git a/src/index.ts b/src/index.ts index 6dec6b3b..0f568711 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,7 @@ -import { EventHandler, IApp } from '@digichanges/shared-experience'; +import dotenv from 'dotenv'; +dotenv.config(); + +import { IApp } from './Main/Presentation/Application/IApp'; import DependencyInjector from './Shared/DI/DependencyInjector'; import { FACTORIES, REPOSITORIES } from './Shared/DI/Injects'; @@ -16,20 +19,22 @@ import EmailEvent from './Auth/Infrastructure/Events/EmailEvent'; import ICacheDataAccess from './Main/Infrastructure/Repositories/ICacheDataAccess'; import { IMessageBroker } from './Shared/Infrastructure/IMessageBroker'; import crons from './crons'; -import { IEventHandler } from './Notification/Infrastructure/events'; +import { IEventHandler } from './Notification/Domain/Models/EventHandler'; void (async() => { try { + const config = MainConfig.getEnv(); + // Init Application - const appBootstrap = AppBootstrapFactory.create(MainConfig.getEnv().APP_DEFAULT); + const appBootstrap = AppBootstrapFactory.create(config.APP_DEFAULT); const app: IApp = await appBootstrap({ - serverPort: MainConfig.getEnv().APP_PORT, - proxy: MainConfig.getEnv().APP_SET_APP_PROXY, - env: MainConfig.getEnv().NODE_ENV, - cors: MainConfig.getEnv().APP_CORS + serverPort: config.APP_PORT, + proxy: config.APP_SET_APP_PROXY, + env: config.NODE_ENV, + cors: config.APP_CORS }); await app.listen(); @@ -43,15 +48,13 @@ void (async() => // Create Cache connection let cache: ICacheDataAccess; - if (MainConfig.getEnv().CACHE_ENABLE) + if (config.CACHE_ENABLE) { cache = DependencyInjector.inject(REPOSITORIES.ICacheDataAccess); await cache.cleanAll(); } // Set EventHandler and all events - // const eventHandler = EventHandler.getInstance(); - const eventHandler = DependencyInjector.inject('IEventHandler'); eventHandler.setEvent(new EmailEvent()); eventHandler.setEvent(new SendMessageEvent()); @@ -63,7 +66,7 @@ void (async() => // Message Broker const messageBroker = DependencyInjector.inject('IMessageBroker'); - await messageBroker.connect({ uri: MainConfig.getEnv().MESSAGE_BROKER_URI }); + await messageBroker.connect({ uri: config.MESSAGE_BROKER_URI }); // Close gracefully const server = await app.getServer(); diff --git a/src/initTestServer.ts b/src/initTestServer.ts index 70f6d313..268df882 100644 --- a/src/initTestServer.ts +++ b/src/initTestServer.ts @@ -1,8 +1,6 @@ import dotenv from 'dotenv'; dotenv.config({ path: './.env.test' }); -import { EventHandler, IApp } from '@digichanges/shared-experience'; - import container from './Shared/DI/container'; import supertest from 'supertest'; @@ -13,12 +11,15 @@ import SeedFactory from './Shared/Factories/SeedFactory'; import AppBootstrapFactory from './Main/Presentation/Factories/AppBootstrapFactory'; import ICreateConnection from './Main/Infrastructure/Database/ICreateConnection'; import IAuthRepository from './Auth/Domain/Repositories/IAuthRepository'; -import { REPOSITORIES } from './Shared/DI/Injects'; -import { Lifecycle } from 'tsyringe'; +import { FACTORIES, REPOSITORIES } from './Shared/DI/Injects'; +import { instanceCachingFactory, Lifecycle } from 'tsyringe'; import SendMessageEvent from './Notification/Domain/Events/SendMessageEvent'; import AuthMockRepository from './Auth/Tests/AuthMockRepository'; import DependencyInjector from './Shared/DI/DependencyInjector'; -import { IEventHandler } from './Notification/Infrastructure/events'; +import { IApp } from './Main/Presentation/Application/IApp'; +import { IEventHandler } from './Notification/Domain/Models/EventHandler'; +import { IFilesystem } from './Main/Domain/Shared/IFilesystem'; +import { FilesystemMockStrategy } from './Main/Infrastructure/Filesystem'; type TestServerData = { request: supertest.SuperAgentTest, @@ -29,7 +30,7 @@ const initTestServer = async(): Promise => { const config = MainConfig.getEnv(); - const databaseFactory: DatabaseFactory = new DatabaseFactory(); + const databaseFactory = DependencyInjector.inject(FACTORIES.IDatabaseFactory); const dbConnection: ICreateConnection = databaseFactory.create(); await dbConnection.initConfigTest(); @@ -43,12 +44,22 @@ const initTestServer = async(): Promise => container._registry._registryMap.delete('IAuthRepository'); container.register(REPOSITORIES.IAuthRepository, { useClass: AuthMockRepository }, { lifecycle: Lifecycle.Singleton }); + // @ts-ignore + container._registry._registryMap.delete('IFilesystem'); + container.register('IFilesystem', { + // @ts-ignore + useFactory: instanceCachingFactory(() => + { + return new FilesystemMockStrategy(); + }) + }, { lifecycle: Lifecycle.Transient }); + const appBootstrap = AppBootstrapFactory.create(config.APP_DEFAULT); const app: IApp = await appBootstrap({ - serverPort: 8088, - proxy: false, - env: 'test', + serverPort: config.APP_PORT, + proxy: config.APP_SET_APP_PROXY, + env: config.NODE_ENV, cors: config.APP_CORS });