cqrs-boilerplate-code 1.0.25 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/common-infra/common-infra.module.js.map +1 -1
  2. package/dist/common-infra/database/abstraction/common-infra.options.js.map +1 -1
  3. package/dist/common-infra/database/abstraction/db-module.options.js.map +1 -1
  4. package/dist/common-infra/database/database.module.js.map +1 -1
  5. package/dist/common-infra/database/typeorm.config.js.map +1 -1
  6. package/dist/common-infra/http/axios.provider.js +0 -1
  7. package/dist/common-infra/http/axios.provider.js.map +1 -1
  8. package/dist/common-infra/http/http-module.options.js.map +1 -1
  9. package/dist/common-infra/http/http.constant.js.map +1 -1
  10. package/dist/common-infra/http/http.module.js.map +1 -1
  11. package/dist/common-infra/http/https.service.js.map +1 -1
  12. package/dist/common-infra/socket.io/interfaces.js.map +1 -1
  13. package/dist/common-infra/socket.io/socket.gateway.js.map +1 -1
  14. package/dist/common-infra/socket.io/socket.module.js.map +1 -1
  15. package/dist/common-infra/socket.io/socket.options.js.map +1 -1
  16. package/dist/core-common/constant/app.constant.js.map +1 -1
  17. package/dist/core-common/core-common.module.js +0 -1
  18. package/dist/core-common/core-common.module.js.map +1 -1
  19. package/dist/core-common/error/custom-error/already-exists.error.d.ts +0 -9
  20. package/dist/core-common/error/custom-error/already-exists.error.js +0 -9
  21. package/dist/core-common/error/custom-error/already-exists.error.js.map +1 -1
  22. package/dist/core-common/error/custom-error/bad-request.error.js.map +1 -1
  23. package/dist/core-common/error/custom-error/conflict.error.d.ts +0 -9
  24. package/dist/core-common/error/custom-error/conflict.error.js +0 -9
  25. package/dist/core-common/error/custom-error/conflict.error.js.map +1 -1
  26. package/dist/core-common/error/custom-error/custom-validation-error.js.map +1 -1
  27. package/dist/core-common/error/custom-error/forbidden.error.js.map +1 -1
  28. package/dist/core-common/error/custom-error/internal-server.error.js.map +1 -1
  29. package/dist/core-common/error/custom-error/not-found.error.js.map +1 -1
  30. package/dist/core-common/error/custom-error/service-unavailable.error.js.map +1 -1
  31. package/dist/core-common/error/custom-error/unauthorized.error.js.map +1 -1
  32. package/dist/core-common/error/custom-error/unprocess-entity.error.js.map +1 -1
  33. package/dist/core-common/error/custom-error/validation.error.js.map +1 -1
  34. package/dist/core-common/error/generic.error.d.ts +0 -8
  35. package/dist/core-common/error/generic.error.js +0 -8
  36. package/dist/core-common/error/generic.error.js.map +1 -1
  37. package/dist/core-common/logger/logger.interface.js.map +1 -1
  38. package/dist/core-common/logger/logger.module.js +0 -1
  39. package/dist/core-common/logger/logger.module.js.map +1 -1
  40. package/dist/core-common/logger/logger.service.js +0 -8
  41. package/dist/core-common/logger/logger.service.js.map +1 -1
  42. package/dist/core-common/response-model/generic-error-response.model.d.ts +0 -10
  43. package/dist/core-common/response-model/generic-error-response.model.js +2 -12
  44. package/dist/core-common/response-model/generic-error-response.model.js.map +1 -1
  45. package/dist/core-common/response-model/generic-success-response.model.d.ts +0 -10
  46. package/dist/core-common/response-model/generic-success-response.model.js +0 -10
  47. package/dist/core-common/response-model/generic-success-response.model.js.map +1 -1
  48. package/dist/core-common/result-model/result.js.map +1 -1
  49. package/dist/middleware/async-middleware/async-storage.middleware.js.map +1 -1
  50. package/dist/middleware/async-middleware/async-storage.service.js.map +1 -1
  51. package/dist/middleware/auth-middleware/auth.middleware.js +1 -1
  52. package/dist/middleware/auth-middleware/auth.middleware.js.map +1 -1
  53. package/dist/middleware/auth-middleware/jwt-validator.js.map +1 -1
  54. package/dist/tsconfig.build.tsbuildinfo +1 -1
  55. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"common-infra.module.js","sourceRoot":"","sources":["../../src/common-infra/common-infra.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,2CAA8C;AAC9C,gEAAsD;AACtD,oDAAgD;AAGzC,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAC5B,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,MAAM,EAAE,mBAAiB;YACzB,OAAO,EAAE;gBACP,qBAAY;gBACZ,wBAAU,CAAC,OAAO,EAAE;gBACpB,0BAAQ;aACT;YACD,OAAO,EAAE;gBACP,wBAAU,CAAC,OAAO,EAAE;gBACpB,0BAAQ;gBACR,qBAAY;aAAC;SAChB,CAAC;IACJ,CAAC;CACF,CAAA;AAfY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,iBAAiB,CAe7B"}
1
+ {"version":3,"file":"common-infra.module.js","sourceRoot":"","sources":["../../src/common-infra/common-infra.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,2CAA8C;AAC9C,gEAAsD;AACtD,oDAAgD;AAGzC,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAC5B,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,MAAM,EAAE,mBAAiB;YACzB,OAAO,EAAE;gBACP,qBAAY;gBACZ,wBAAU,CAAC,OAAO,EAAE;gBACpB,0BAAQ;aACT;YACD,OAAO,EAAE;gBACP,wBAAU,CAAC,OAAO,EAAE;gBACpB,0BAAQ;gBACR,qBAAY;aAAC;SAChB,CAAC;IACJ,CAAC;CACF,CAAA;AAfY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,iBAAiB,CAe7B","sourcesContent":["import { DynamicModule, Module } from \"@nestjs/common\";\nimport { ConfigModule } from \"@nestjs/config\";\nimport { DBModule } from \"./database/database.module\";\nimport { HttpModule } from \"./http/http.module\";\n\n@Module({})\nexport class CommonInfraModule {\n static forRoot(): DynamicModule {\n return {\n module: CommonInfraModule,\n imports: [\n ConfigModule,\n HttpModule.forRoot(),\n DBModule,\n ],\n exports: [\n HttpModule.forRoot(),\n DBModule,\n ConfigModule],\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"common-infra.options.js","sourceRoot":"","sources":["../../../../src/common-infra/database/abstraction/common-infra.options.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"common-infra.options.js","sourceRoot":"","sources":["../../../../src/common-infra/database/abstraction/common-infra.options.ts"],"names":[],"mappings":"","sourcesContent":["import { DBModuleOptions } from './db-module.options';\n\nexport interface CommonInfraModuleOptions {\n db?: DBModuleOptions;\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"db-module.options.js","sourceRoot":"","sources":["../../../../src/common-infra/database/abstraction/db-module.options.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"db-module.options.js","sourceRoot":"","sources":["../../../../src/common-infra/database/abstraction/db-module.options.ts"],"names":[],"mappings":"","sourcesContent":["import { TypeOrmModuleOptions } from \"@nestjs/typeorm\";\n\nexport interface DBModuleOptions {\n typeOrmOptions?: Partial<TypeOrmModuleOptions>;\n useConfigService?: boolean;\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"database.module.js","sourceRoot":"","sources":["../../../src/common-infra/database/database.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,2CAA6D;AAC7D,6CAAsE;AAEtE,qDAAiD;AAG1C,IAAM,QAAQ,gBAAd,MAAM,QAAQ;IACnB,MAAM,CAAC,OAAO,CAAC,UAA2B,EAAE;QAC1C,MAAM,EACJ,gBAAgB,GAAG,IAAI,EACvB,cAAc,GAAG,EAAE,GACpB,GAAG,OAAO,CAAC;QAEZ,OAAO;YACL,MAAM,EAAE,UAAQ;YAChB,OAAO,EAAE;gBACP,uBAAa,CAAC,YAAY,CAAC;oBACzB,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,sBAAa,CAAC,CAAC,CAAC,CAAC,EAAE;oBAC/C,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,qBAAY,CAAC,CAAC,CAAC,CAAC,EAAE;oBAC/C,UAAU,EAAE,KAAK,EAAE,aAA6B,EAAE,EAAE,CAAC,CAAC;wBACpD,GAAG,CAAC,gBAAgB;4BAClB,CAAC,CAAC,IAAA,8BAAa,EAAC,aAAc,CAAC;4BAC/B,CAAC,CAAC,EAAE,CAAC;wBACP,GAAG,cAAc;qBAClB,CAAyB;iBAC3B,CAAC;aACH;YACD,OAAO,EAAE,CAAC,uBAAa,CAAC;SACzB,CAAC;IACJ,CAAC;CACF,CAAA;AAxBY,4BAAQ;mBAAR,QAAQ;IADpB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,QAAQ,CAwBpB"}
1
+ {"version":3,"file":"database.module.js","sourceRoot":"","sources":["../../../src/common-infra/database/database.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,2CAA6D;AAC7D,6CAAsE;AAEtE,qDAAiD;AAG1C,IAAM,QAAQ,gBAAd,MAAM,QAAQ;IACnB,MAAM,CAAC,OAAO,CAAC,UAA2B,EAAE;QAC1C,MAAM,EACJ,gBAAgB,GAAG,IAAI,EACvB,cAAc,GAAG,EAAE,GACpB,GAAG,OAAO,CAAC;QAEZ,OAAO;YACL,MAAM,EAAE,UAAQ;YAChB,OAAO,EAAE;gBACP,uBAAa,CAAC,YAAY,CAAC;oBACzB,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,sBAAa,CAAC,CAAC,CAAC,CAAC,EAAE;oBAC/C,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,qBAAY,CAAC,CAAC,CAAC,CAAC,EAAE;oBAC/C,UAAU,EAAE,KAAK,EAAE,aAA6B,EAAE,EAAE,CAAC,CAAC;wBACpD,GAAG,CAAC,gBAAgB;4BAClB,CAAC,CAAC,IAAA,8BAAa,EAAC,aAAc,CAAC;4BAC/B,CAAC,CAAC,EAAE,CAAC;wBACP,GAAG,cAAc;qBAClB,CAAyB;iBAC3B,CAAC;aACH;YACD,OAAO,EAAE,CAAC,uBAAa,CAAC;SACzB,CAAC;IACJ,CAAC;CACF,CAAA;AAxBY,4BAAQ;mBAAR,QAAQ;IADpB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,QAAQ,CAwBpB","sourcesContent":["import { DynamicModule, Module } from \"@nestjs/common\";\nimport { ConfigModule, ConfigService } from \"@nestjs/config\";\nimport { TypeOrmModule, TypeOrmModuleOptions } from \"@nestjs/typeorm\";\nimport { DBModuleOptions } from \"./abstraction/db-module.options\";\nimport { typeOrmConfig } from \"./typeorm.config\";\n\n@Module({})\nexport class DBModule {\n static forRoot(options: DBModuleOptions = {}): DynamicModule {\n const {\n useConfigService = true,\n typeOrmOptions = {},\n } = options;\n\n return {\n module: DBModule,\n imports: [\n TypeOrmModule.forRootAsync({\n inject: useConfigService ? [ConfigService] : [],\n imports: useConfigService ? [ConfigModule] : [],\n useFactory: async (configService?: ConfigService) => ({\n ...(useConfigService\n ? typeOrmConfig(configService!)\n : {}),\n ...typeOrmOptions,\n }) as TypeOrmModuleOptions,\n }),\n ],\n exports: [TypeOrmModule],\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"typeorm.config.js","sourceRoot":"","sources":["../../../src/common-infra/database/typeorm.config.ts"],"names":[],"mappings":";;;AAGO,MAAM,aAAa,GAAG,CAC3B,aAA4B,EACN,EAAE,CAAC,CAAC;IAC1B,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,aAAa,CAAC,GAAG,CAAS,SAAS,CAAC;IAC1C,IAAI,EAAE,aAAa,CAAC,GAAG,CAAS,SAAS,CAAC;IAC1C,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAS,aAAa,CAAC;IAClD,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAS,aAAa,CAAC;IAClD,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAS,SAAS,CAAC;IAC9C,gBAAgB,EAAE,IAAI;IACtB,WAAW,EAAE,aAAa,CAAC,GAAG,CAAS,UAAU,CAAC,KAAK,YAAY;IACnE,UAAU,EAAE,CAAC,sBAAsB,CAAC;IACpC,aAAa,EAAE,IAAI;IACnB,OAAO,EAAE,aAAa,CAAC,GAAG,CAAS,UAAU,CAAC,KAAK,YAAY;CAChE,CAAC,CAAC;AAdU,QAAA,aAAa,iBAcvB"}
1
+ {"version":3,"file":"typeorm.config.js","sourceRoot":"","sources":["../../../src/common-infra/database/typeorm.config.ts"],"names":[],"mappings":";;;AAGO,MAAM,aAAa,GAAG,CAC3B,aAA4B,EACN,EAAE,CAAC,CAAC;IAC1B,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,aAAa,CAAC,GAAG,CAAS,SAAS,CAAC;IAC1C,IAAI,EAAE,aAAa,CAAC,GAAG,CAAS,SAAS,CAAC;IAC1C,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAS,aAAa,CAAC;IAClD,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAS,aAAa,CAAC;IAClD,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAS,SAAS,CAAC;IAC9C,gBAAgB,EAAE,IAAI;IACtB,WAAW,EAAE,aAAa,CAAC,GAAG,CAAS,UAAU,CAAC,KAAK,YAAY;IACnE,UAAU,EAAE,CAAC,sBAAsB,CAAC;IACpC,aAAa,EAAE,IAAI;IACnB,OAAO,EAAE,aAAa,CAAC,GAAG,CAAS,UAAU,CAAC,KAAK,YAAY;CAChE,CAAC,CAAC;AAdU,QAAA,aAAa,iBAcvB","sourcesContent":["import { TypeOrmModuleOptions } from \"@nestjs/typeorm\";\nimport { ConfigService } from \"@nestjs/config\";\n\nexport const typeOrmConfig = (\n configService: ConfigService,\n): TypeOrmModuleOptions => ({\n type: \"postgres\",\n host: configService.get<string>(\"DB_HOST\"),\n port: configService.get<number>(\"DB_PORT\"),\n username: configService.get<string>(\"DB_USERNAME\"),\n password: configService.get<string>(\"DB_PASSWORD\"),\n database: configService.get<string>(\"DB_NAME\"),\n autoLoadEntities: true,\n synchronize: configService.get<string>(\"NODE_ENV\") !== \"production\",\n migrations: [\"dist/migrations/*.js\"],\n migrationsRun: true,\n logging: configService.get<string>(\"NODE_ENV\") !== \"production\",\n});\n"]}
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createAxiosProvider = void 0;
7
- // src/providers/axios.provider.ts
8
7
  const axios_1 = __importDefault(require("axios"));
9
8
  const axios_retry_1 = __importDefault(require("axios-retry"));
10
9
  const http_constant_1 = require("./http.constant");
@@ -1 +1 @@
1
- {"version":3,"file":"axios.provider.js","sourceRoot":"","sources":["../../../src/common-infra/http/axios.provider.ts"],"names":[],"mappings":";;;;;;AAAA,kCAAkC;AAClC,kDAA6C;AAC7C,8DAAqC;AAErC,mDAAuD;AAGhD,MAAM,mBAAmB,GAAG,CACjC,OAA0B,EAChB,EAAE,CAAC,CAAC;IACd,OAAO,EAAE,oCAAoB;IAC7B,UAAU,EAAE,GAAkB,EAAE;QAC9B,MAAM,QAAQ,GAAG,eAAK,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAA,qBAAU,EAAC,QAAQ,EAAE;YACnB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC;YACpC,UAAU,EAAE,qBAAU,CAAC,gBAAgB;YACvC,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE;gBACxB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC;gBACtC,OAAO,CACL,qBAAU,CAAC,iCAAiC,CAAC,KAAK,CAAC;oBACnD,OAAO,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,CACjD,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC,CAAC;AAnBU,QAAA,mBAAmB,uBAmB7B"}
1
+ {"version":3,"file":"axios.provider.js","sourceRoot":"","sources":["../../../src/common-infra/http/axios.provider.ts"],"names":[],"mappings":";;;;;;AACA,kDAA6C;AAC7C,8DAAqC;AAErC,mDAAuD;AAGhD,MAAM,mBAAmB,GAAG,CACjC,OAA0B,EAChB,EAAE,CAAC,CAAC;IACd,OAAO,EAAE,oCAAoB;IAC7B,UAAU,EAAE,GAAkB,EAAE;QAC9B,MAAM,QAAQ,GAAG,eAAK,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAA,qBAAU,EAAC,QAAQ,EAAE;YACnB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC;YACpC,UAAU,EAAE,qBAAU,CAAC,gBAAgB;YACvC,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE;gBACxB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC;gBACtC,OAAO,CACL,qBAAU,CAAC,iCAAiC,CAAC,KAAK,CAAC;oBACnD,OAAO,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,CACjD,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC,CAAC;AAnBU,QAAA,mBAAmB,uBAmB7B","sourcesContent":["// src/providers/axios.provider.ts\nimport axios, { AxiosInstance } from 'axios';\nimport axiosRetry from 'axios-retry';\nimport { Provider } from '@nestjs/common';\nimport { AXIOS_INSTANCE_TOKEN } from './http.constant';\nimport { HttpModuleOptions } from './http-module.options';\n\nexport const createAxiosProvider = (\n options: HttpModuleOptions,\n): Provider => ({\n provide: AXIOS_INSTANCE_TOKEN,\n useFactory: (): AxiosInstance => {\n const instance = axios.create(options.axios);\n axiosRetry(instance, {\n retries: options.retry?.retries ?? 3,\n retryDelay: axiosRetry.exponentialDelay,\n retryCondition: (error) => {\n const status = error.response?.status;\n return (\n axiosRetry.isNetworkOrIdempotentRequestError(error) ||\n options.retry?.retryOnStatuses?.includes(status)\n );\n },\n });\n return instance;\n },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"http-module.options.js","sourceRoot":"","sources":["../../../src/common-infra/http/http-module.options.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"http-module.options.js","sourceRoot":"","sources":["../../../src/common-infra/http/http-module.options.ts"],"names":[],"mappings":"","sourcesContent":["// src/interfaces/http-module.options.ts\nimport { AxiosRequestConfig } from 'axios';\n\nexport interface RetryOptions {\n retries?: number;\n retryDelay?: number;\n retryOnStatuses?: number[];\n}\n\nexport interface HttpModuleOptions {\n axios?: AxiosRequestConfig;\n retry?: RetryOptions;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"http.constant.js","sourceRoot":"","sources":["../../../src/common-infra/http/http.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAC9C,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAClC,QAAA,mBAAmB,GAAG,qBAAqB,CAAC"}
1
+ {"version":3,"file":"http.constant.js","sourceRoot":"","sources":["../../../src/common-infra/http/http.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAC9C,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAClC,QAAA,mBAAmB,GAAG,qBAAqB,CAAC","sourcesContent":["export const AXIOS_INSTANCE_TOKEN = 'AXIOS_INSTANCE_TOKEN';\nexport const HTTP_MODULE_ID = 'HTTP_MODULE_ID';\nexport const HTTP_MODULE_OPTIONS = 'HTTP_MODULE_OPTIONS';\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"http.module.js","sourceRoot":"","sources":["../../../src/common-infra/http/http.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAwE;AACxE,qDAAuD;AAEvD,mDAAuD;AACvD,mDAA8C;AAGvC,IAAM,UAAU,kBAAhB,MAAM,UAAU;IACnB,MAAM,CAAC,OAAO,CAAC,UAA6B,EAAE;QAC1C,OAAO;YACH,MAAM,EAAE,YAAU;YAClB,SAAS,EAAE;gBACP,IAAA,oCAAmB,EAAC,OAAO,CAAC;gBAC5B,2BAAW;aACd;YACD,OAAO,EAAE,CAAC,2BAAW,CAAC;SACzB,CAAC;IACN,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,OAInB;QACG,OAAO;YACH,MAAM,EAAE,YAAU;YAClB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,oCAAoB;oBAC7B,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,UAAU,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE,CAC1B,IAAA,oCAAmB,EAAC,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAqB,CAAC,UAAU,EAAE;iBACzF;gBACD,2BAAW;aACd;YACD,OAAO,EAAE,CAAC,2BAAW,CAAC;SACzB,CAAC;IACN,CAAC;CACJ,CAAA;AAhCY,gCAAU;qBAAV,UAAU;IADtB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,UAAU,CAgCtB"}
1
+ {"version":3,"file":"http.module.js","sourceRoot":"","sources":["../../../src/common-infra/http/http.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAwE;AACxE,qDAAuD;AAEvD,mDAAuD;AACvD,mDAA8C;AAGvC,IAAM,UAAU,kBAAhB,MAAM,UAAU;IACnB,MAAM,CAAC,OAAO,CAAC,UAA6B,EAAE;QAC1C,OAAO;YACH,MAAM,EAAE,YAAU;YAClB,SAAS,EAAE;gBACP,IAAA,oCAAmB,EAAC,OAAO,CAAC;gBAC5B,2BAAW;aACd;YACD,OAAO,EAAE,CAAC,2BAAW,CAAC;SACzB,CAAC;IACN,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,OAInB;QACG,OAAO;YACH,MAAM,EAAE,YAAU;YAClB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,oCAAoB;oBAC7B,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,UAAU,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE,CAC1B,IAAA,oCAAmB,EAAC,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAqB,CAAC,UAAU,EAAE;iBACzF;gBACD,2BAAW;aACd;YACD,OAAO,EAAE,CAAC,2BAAW,CAAC;SACzB,CAAC;IACN,CAAC;CACJ,CAAA;AAhCY,gCAAU;qBAAV,UAAU;IADtB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,UAAU,CAgCtB","sourcesContent":["import { DynamicModule, FactoryProvider, Module } from \"@nestjs/common\";\nimport { createAxiosProvider } from \"./axios.provider\";\nimport { HttpModuleOptions } from \"./http-module.options\";\nimport { AXIOS_INSTANCE_TOKEN } from \"./http.constant\";\nimport { HttpService } from \"./https.service\";\n\n@Module({})\nexport class HttpModule {\n static forRoot(options: HttpModuleOptions = {}): DynamicModule {\n return {\n module: HttpModule,\n providers: [\n createAxiosProvider(options),\n HttpService,\n ],\n exports: [HttpService],\n };\n }\n\n static forRootAsync(options: {\n useFactory: (...args: any[]) => HttpModuleOptions;\n inject?: any[];\n imports?: any[];\n }): DynamicModule {\n return {\n module: HttpModule,\n imports: options.imports,\n providers: [\n {\n provide: AXIOS_INSTANCE_TOKEN,\n inject: options.inject,\n useFactory: (...args: any[]) =>\n (createAxiosProvider(options.useFactory(...args)) as FactoryProvider).useFactory(),\n },\n HttpService,\n ],\n exports: [HttpService],\n };\n }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"https.service.js","sourceRoot":"","sources":["../../../src/common-infra/http/https.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,kDAMe;AACf,+BAAkC;AAClC,mDAAuD;AAEvD,IAAa,WAAW,GAAxB,MAAa,WAAW;IAGD;IAFrB,YAEqB,WAA0B,eAAK;QAA/B,aAAQ,GAAR,QAAQ,CAAuB;IACjD,CAAC;IAEJ,OAAO,CAAU,MAA0B;QACzC,OAAO,IAAI,CAAC,cAAc,CAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE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YAC3B,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;YACtC,MAAM,MAAM,GAAuB,EAAE,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YACtE,QAAQ,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;YAE7B,IAAI,YAA+B,CAAC;YACpC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;gBACxB,YAAY,GAAG,eAAK,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;gBAC1C,MAAM,CAAC,WAAW,GAAG,YAAY,CAAC,KAAK,CAAC;YAC1C,CAAC;YAED,KAAK,CAAC,GAAG,QAAQ,CAAC;iBACf,IAAI,CAAC,GAAG,CAAC,EAAE;gBACV,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrB,UAAU,CAAC,QAAQ,EAAE,CAAC;YACxB,CAAC,CAAC;iBACD,KAAK,CAAC,GAAG,CAAC,EAAE;gBACX,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACxB,CAAC,CAAC,CAAC;YACL,OAAO,GAAG,EAAE;gBACV,IAAI,MAAM,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;oBACrC,OAAO;gBACT,CAAC;gBAED,IAAI,YAAY,EAAE,CAAC;oBACjB,YAAY,CAAC,MAAM,EAAE,CAAC;gBACxB,CAAC;YACH,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AApJY,kCAAW;sBAAX,WAAW;IAEnB,WAAA,IAAA,eAAM,EAAC,oCAAoB,CAAC,CAAA;;GAFpB,WAAW,CAoJvB","sourcesContent":["import { Inject } from '@nestjs/common';\nimport Axios, {\n AxiosInstance,\n AxiosPromise,\n AxiosRequestConfig,\n AxiosResponse,\n CancelTokenSource,\n} from 'axios';\nimport { Observable } from 'rxjs';\nimport { AXIOS_INSTANCE_TOKEN } from './http.constant';\n\nexport class HttpService {\n constructor(\n @Inject(AXIOS_INSTANCE_TOKEN)\n protected readonly instance: AxiosInstance = Axios,\n ) {}\n\n request<T = any>(config: AxiosRequestConfig): Observable<AxiosResponse<T>> {\n return this.makeObservable<T>(this.instance.request, config);\n }\n\n get<T = any, D = any>(\n url: string,\n config?: AxiosRequestConfig<D>,\n ): Observable<AxiosResponse<T, D>> {\n return this.makeObservable<T>(this.instance.get, url, config);\n }\n\n delete<T = any, D = any>(\n url: string,\n config?: AxiosRequestConfig<D>,\n ): Observable<AxiosResponse<T, D>> {\n return this.makeObservable<T>(this.instance.delete, url, config);\n }\n\n head<T = any, D = any>(\n url: string,\n config?: AxiosRequestConfig<D>,\n ): Observable<AxiosResponse<T, D>> {\n return this.makeObservable<T>(this.instance.head, url, config);\n }\n\n post<T = any, D = any>(\n url: string,\n data?: D,\n config?: AxiosRequestConfig<D>,\n ): Observable<AxiosResponse<T, D>>;\n post<T = any>(\n url: string,\n data?: any,\n config?: AxiosRequestConfig,\n ): Observable<AxiosResponse<T>> {\n return this.makeObservable<T>(this.instance.post, url, data, config);\n }\n\n put<T = any, D = any>(\n url: string,\n data?: D,\n config?: AxiosRequestConfig<D>,\n ): Observable<AxiosResponse<T, D>>;\n put<T = any>(\n url: string,\n data?: any,\n config?: AxiosRequestConfig,\n ): Observable<AxiosResponse<T>> {\n return this.makeObservable<T>(this.instance.put, url, data, config);\n }\n\n patch<T = any, D = any>(\n url: string,\n data?: D,\n config?: AxiosRequestConfig<D>,\n ): Observable<AxiosResponse<T, D>>;\n patch<T = any>(\n url: string,\n data?: any,\n config?: AxiosRequestConfig,\n ): Observable<AxiosResponse<T>> {\n return this.makeObservable<T>(this.instance.patch, url, data, config);\n }\n\n postForm<T = any, D = any>(\n url: string,\n data?: D,\n config?: AxiosRequestConfig<D>,\n ): Observable<AxiosResponse<T, D>>;\n postForm<T = any>(\n url: string,\n data?: any,\n config?: AxiosRequestConfig,\n ): Observable<AxiosResponse<T>> {\n return this.makeObservable<T>(this.instance.postForm, url, data, config);\n }\n\n putForm<T = any, D = any>(\n url: string,\n data?: D,\n config?: AxiosRequestConfig<D>,\n ): Observable<AxiosResponse<T, D>>;\n putForm<T = any>(\n url: string,\n data?: any,\n config?: AxiosRequestConfig,\n ): Observable<AxiosResponse<T>> {\n return this.makeObservable<T>(this.instance.putForm, url, data, config);\n }\n\n patchForm<T = any, D = any>(\n url: string,\n data?: D,\n config?: AxiosRequestConfig<D>,\n ): Observable<AxiosResponse<T, D>>;\n patchForm<T = any>(\n url: string,\n data?: any,\n config?: AxiosRequestConfig,\n ): Observable<AxiosResponse<T>> {\n return this.makeObservable<T>(this.instance.patchForm, url, data, config);\n }\n\n get axiosRef(): AxiosInstance {\n return this.instance;\n }\n\n protected makeObservable<T>(\n axios: (...args: any[]) => AxiosPromise<T>,\n ...args: any[]\n ) {\n return new Observable<AxiosResponse<T>>(subscriber => {\n const argsCopy = [...args];\n const configIdx = argsCopy.length - 1;\n const config: AxiosRequestConfig = { ...(argsCopy[configIdx] || {}) };\n argsCopy[configIdx] = config;\n\n let cancelSource: CancelTokenSource;\n if (!config.cancelToken) {\n cancelSource = Axios.CancelToken.source();\n config.cancelToken = cancelSource.token;\n }\n\n axios(...argsCopy)\n .then(res => {\n subscriber.next(res);\n subscriber.complete();\n })\n .catch(err => {\n subscriber.error(err);\n });\n return () => {\n if (config.responseType === 'stream') {\n return;\n }\n\n if (cancelSource) {\n cancelSource.cancel();\n }\n };\n });\n }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/common-infra/socket.io/interfaces.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/common-infra/socket.io/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["export interface SocketMessage<T = any> {\n event: string;\n payload: T;\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"socket.gateway.js","sourceRoot":"","sources":["../../../src/common-infra/socket.io/socket.gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAM4B;AAC5B,yCAA2C;AAGpC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEhB,MAAM,CAAS;IAEzB,gBAAgB,CAAC,MAAc;QAC3B,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,gBAAgB,CAAC,MAAc;QAC3B,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;IAGD,SAAS,CACU,OAAY,EACR,MAAc;QAEjC,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAES,YAAY,CAClB,MAAc,EACd,KAAa,EACb,IAAS;QAET,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;IAES,SAAS,CACf,KAAa,EACb,IAAS;QAET,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;CACJ,CAAA;AAlCY,8CAAiB;AAEhB;IADT,IAAA,4BAAe,GAAE;8BACA,kBAAM;iDAAC;AAWzB;IADC,IAAA,6BAAgB,EAAC,SAAS,CAAC;IAEvB,WAAA,IAAA,wBAAW,GAAE,CAAA;IACb,WAAA,IAAA,4BAAe,GAAE,CAAA;;6CAAS,kBAAM;;kDAGpC;4BAlBQ,iBAAiB;IAD7B,IAAA,6BAAgB,GAAE;GACN,iBAAiB,CAkC7B"}
1
+ {"version":3,"file":"socket.gateway.js","sourceRoot":"","sources":["../../../src/common-infra/socket.io/socket.gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAM4B;AAC5B,yCAA2C;AAGpC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEhB,MAAM,CAAS;IAEzB,gBAAgB,CAAC,MAAc;QAC3B,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,gBAAgB,CAAC,MAAc;QAC3B,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;IAGD,SAAS,CACU,OAAY,EACR,MAAc;QAEjC,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAES,YAAY,CAClB,MAAc,EACd,KAAa,EACb,IAAS;QAET,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;IAES,SAAS,CACf,KAAa,EACb,IAAS;QAET,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;CACJ,CAAA;AAlCY,8CAAiB;AAEhB;IADT,IAAA,4BAAe,GAAE;8BACA,kBAAM;iDAAC;AAWzB;IADC,IAAA,6BAAgB,EAAC,SAAS,CAAC;IAEvB,WAAA,IAAA,wBAAW,GAAE,CAAA;IACb,WAAA,IAAA,4BAAe,GAAE,CAAA;;6CAAS,kBAAM;;kDAGpC;4BAlBQ,iBAAiB;IAD7B,IAAA,6BAAgB,GAAE;GACN,iBAAiB,CAkC7B","sourcesContent":["import {\n WebSocketGateway,\n WebSocketServer,\n SubscribeMessage,\n MessageBody,\n ConnectedSocket,\n} from '@nestjs/websockets';\nimport { Server, Socket } from 'socket.io';\n\n@WebSocketGateway()\nexport class BaseSocketGateway {\n @WebSocketServer()\n protected server: Server;\n\n handleConnection(client: Socket) {\n console.log('[Socket Connected]', client.id);\n }\n\n handleDisconnect(client: Socket) {\n console.log('[Socket Disconnected]', client.id);\n }\n\n @SubscribeMessage('message')\n onMessage(\n @MessageBody() payload: any,\n @ConnectedSocket() client: Socket,\n ) {\n client.emit('messageResponse', payload);\n }\n\n protected emitToClient(\n client: Socket,\n event: string,\n data: any,\n ) {\n client.emit(event, data);\n }\n\n protected broadcast(\n event: string,\n data: any,\n ) {\n this.server.emit(event, data);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"socket.module.js","sourceRoot":"","sources":["../../../src/common-infra/socket.io/socket.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,mDAAsD;AACtD,qDAAqD;AAI9C,IAAM,YAAY,oBAAlB,MAAM,YAAY;IACd,AAAP,MAAM,CAAC,QAAQ,CAAC,UAA+B,EAAE;QAK7C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,kCAAiB;SAAG,CAAA;QAApC,OAAO;YAJZ,IAAA,6BAAgB,EAAC;gBACd,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;gBACrC,SAAS,EAAE,OAAO,CAAC,SAAS;aAC/B,CAAC;WACI,OAAO,CAA6B;QAC1C,OAAO;YACH,MAAM,EAAE,cAAY;YACpB,SAAS,EAAE,CAAC,OAAO,CAAC;YACpB,OAAO,EAAE,CAAC,OAAO,CAAC;SACrB,CAAC;IACN,CAAC;CACJ,CAAA;AAbY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,YAAY,CAaxB"}
1
+ {"version":3,"file":"socket.module.js","sourceRoot":"","sources":["../../../src/common-infra/socket.io/socket.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,mDAAsD;AACtD,qDAAqD;AAI9C,IAAM,YAAY,oBAAlB,MAAM,YAAY;IACd,AAAP,MAAM,CAAC,QAAQ,CAAC,UAA+B,EAAE;QAK7C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,kCAAiB;SAAG,CAAA;QAApC,OAAO;YAJZ,IAAA,6BAAgB,EAAC;gBACd,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;gBACrC,SAAS,EAAE,OAAO,CAAC,SAAS;aAC/B,CAAC;WACI,OAAO,CAA6B;QAC1C,OAAO;YACH,MAAM,EAAE,cAAY;YACpB,SAAS,EAAE,CAAC,OAAO,CAAC;YACpB,OAAO,EAAE,CAAC,OAAO,CAAC;SACrB,CAAC;IACN,CAAC;CACJ,CAAA;AAbY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,YAAY,CAaxB","sourcesContent":["import { DynamicModule, Module } from '@nestjs/common';\nimport { WebSocketGateway } from '@nestjs/websockets';\nimport { BaseSocketGateway } from './socket.gateway';\nimport { SocketModuleOptions } from './socket.options';\n\n@Module({})\nexport class SocketModule {\n static register(options: SocketModuleOptions = {}): DynamicModule {\n @WebSocketGateway({\n cors: options.cors ?? { origin: '*' },\n namespace: options.namespace,\n })\n class Gateway extends BaseSocketGateway {}\n return {\n module: SocketModule,\n providers: [Gateway],\n exports: [Gateway],\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"socket.options.js","sourceRoot":"","sources":["../../../src/common-infra/socket.io/socket.options.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"socket.options.js","sourceRoot":"","sources":["../../../src/common-infra/socket.io/socket.options.ts"],"names":[],"mappings":"","sourcesContent":["export interface SocketModuleOptions {\n cors?: {\n origin: string | string[];\n };\n namespace?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"app.constant.js","sourceRoot":"","sources":["../../../src/core-common/constant/app.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,IAAI,CAAC;AACZ,QAAA,QAAQ,GAAG,aAAa,CAAA"}
1
+ {"version":3,"file":"app.constant.js","sourceRoot":"","sources":["../../../src/core-common/constant/app.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,IAAI,CAAC;AACZ,QAAA,QAAQ,GAAG,aAAa,CAAA","sourcesContent":["export const PORT = 3001;\nexport const BASE_URL = '/api/retail'\n"]}
@@ -8,7 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var CoreCommonModule_1;
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.CoreCommonModule = void 0;
11
- // src/core-common.module.ts
12
11
  const common_1 = require("@nestjs/common");
13
12
  const logger_module_1 = require("./logger/logger.module");
14
13
  let CoreCommonModule = CoreCommonModule_1 = class CoreCommonModule {
@@ -1 +1 @@
1
- {"version":3,"file":"core-common.module.js","sourceRoot":"","sources":["../../src/core-common/core-common.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,4BAA4B;AAC5B,2CAA+D;AAC/D,0DAAsD;AAI/C,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAC3B,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,MAAM,EAAE,kBAAgB;YACxB,OAAO,EAAE;gBACP,4BAAY,CAAC,OAAO,EAAE;aACvB;YACD,OAAO,EAAE;gBACP,4BAAY;aACb;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAZY,4CAAgB;2BAAhB,gBAAgB;IAF5B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,gBAAgB,CAY5B"}
1
+ {"version":3,"file":"core-common.module.js","sourceRoot":"","sources":["../../src/core-common/core-common.module.ts"],"names":[],"mappings":";;;;;;;;;;AACA,2CAA+D;AAC/D,0DAAsD;AAI/C,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAC3B,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,MAAM,EAAE,kBAAgB;YACxB,OAAO,EAAE;gBACP,4BAAY,CAAC,OAAO,EAAE;aACvB;YACD,OAAO,EAAE;gBACP,4BAAY;aACb;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAZY,4CAAgB;2BAAhB,gBAAgB;IAF5B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,gBAAgB,CAY5B","sourcesContent":["// src/core-common.module.ts\nimport { DynamicModule, Global, Module } from \"@nestjs/common\";\nimport { LoggerModule } from \"./logger/logger.module\";\n\n@Global()\n@Module({})\nexport class CoreCommonModule {\n static forRoot(): DynamicModule {\n return {\n module: CoreCommonModule,\n imports: [\n LoggerModule.forRoot(),\n ],\n exports: [\n LoggerModule,\n ],\n };\n }\n}\n"]}
@@ -1,13 +1,4 @@
1
1
  import { GenericError } from "../generic.error";
2
- /**
3
- * Custom error class for representing the scenario where an entity already exists/Conflict with existing.
4
- * Extends the GenericError class.
5
- */
6
2
  export declare class AlreadyExistsError extends GenericError {
7
- /**
8
- * Constructor for the AlreadyExistsError class.
9
- * @param code - Short code associated with the error.
10
- * @param message - Detailed error information.
11
- */
12
3
  constructor(code: string, message: string);
13
4
  }
@@ -3,16 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AlreadyExistsError = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  const generic_error_1 = require("../generic.error");
6
- /**
7
- * Custom error class for representing the scenario where an entity already exists/Conflict with existing.
8
- * Extends the GenericError class.
9
- */
10
6
  class AlreadyExistsError extends generic_error_1.GenericError {
11
- /**
12
- * Constructor for the AlreadyExistsError class.
13
- * @param code - Short code associated with the error.
14
- * @param message - Detailed error information.
15
- */
16
7
  constructor(code, message) {
17
8
  super(code, message, common_1.HttpStatus.CONFLICT);
18
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"already-exists.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/already-exists.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,4BAAY;IAClD;;;;OAIG;IACH,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACF;AATD,gDASC"}
1
+ {"version":3,"file":"already-exists.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/already-exists.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAMhD,MAAa,kBAAmB,SAAQ,4BAAY;IAMlD,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACF;AATD,gDASC","sourcesContent":["import { HttpStatus } from \"@nestjs/common\";\nimport { GenericError } from \"../generic.error\";\n\n/**\n * Custom error class for representing the scenario where an entity already exists/Conflict with existing.\n * Extends the GenericError class.\n */\nexport class AlreadyExistsError extends GenericError {\n /**\n * Constructor for the AlreadyExistsError class.\n * @param code - Short code associated with the error.\n * @param message - Detailed error information.\n */\n constructor(code: string, message: string) {\n super(code, message, HttpStatus.CONFLICT);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bad-request.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/bad-request.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,eAAgB,SAAQ,4BAAY;IAC/C,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,WAAW,CAAC,CAAC;IAC/C,CAAC;CACF;AAJD,0CAIC"}
1
+ {"version":3,"file":"bad-request.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/bad-request.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,eAAgB,SAAQ,4BAAY;IAC/C,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,WAAW,CAAC,CAAC;IAC/C,CAAC;CACF;AAJD,0CAIC","sourcesContent":["import { HttpStatus } from \"@nestjs/common\";\nimport { GenericError } from \"../generic.error\";\n\nexport class BadRequestError extends GenericError {\n constructor(code: string, message: string) {\n super(code, message, HttpStatus.BAD_REQUEST);\n }\n}\n"]}
@@ -1,13 +1,4 @@
1
1
  import { GenericError } from "../generic.error";
2
- /**
3
- * Custom error class for representing conflict errors.
4
- * Extends the GenericError class.
5
- */
6
2
  export declare class ConflictError extends GenericError {
7
- /**
8
- * Constructor for the ConflictError class.
9
- * @param code - Short code associated with the error.
10
- * @param message - Detailed error information.
11
- */
12
3
  constructor(code: string, message: string);
13
4
  }
@@ -3,16 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConflictError = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  const generic_error_1 = require("../generic.error");
6
- /**
7
- * Custom error class for representing conflict errors.
8
- * Extends the GenericError class.
9
- */
10
6
  class ConflictError extends generic_error_1.GenericError {
11
- /**
12
- * Constructor for the ConflictError class.
13
- * @param code - Short code associated with the error.
14
- * @param message - Detailed error information.
15
- */
16
7
  constructor(code, message) {
17
8
  super(code, message, common_1.HttpStatus.CONFLICT);
18
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"conflict.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/conflict.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD;;;GAGG;AACH,MAAa,aAAc,SAAQ,4BAAY;IAC7C;;;;OAIG;IACH,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACF;AATD,sCASC"}
1
+ {"version":3,"file":"conflict.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/conflict.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAMhD,MAAa,aAAc,SAAQ,4BAAY;IAM7C,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACF;AATD,sCASC","sourcesContent":["import { HttpStatus } from \"@nestjs/common\";\nimport { GenericError } from \"../generic.error\";\n\n/**\n * Custom error class for representing conflict errors.\n * Extends the GenericError class.\n */\nexport class ConflictError extends GenericError {\n /**\n * Constructor for the ConflictError class.\n * @param code - Short code associated with the error.\n * @param message - Detailed error information.\n */\n constructor(code: string, message: string) {\n super(code, message, HttpStatus.CONFLICT);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"custom-validation-error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/custom-validation-error.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AAEtD,MAAa,qBAAsB,SAAQ,mCAAe;IAE/C;IADT,YACS,gBAAqB;QAE5B,KAAK,CAAC,iBAAiB,EAAE,+CAA+C,CAAC,CAAC;QAFnE,qBAAgB,GAAhB,gBAAgB,CAAK;IAG9B,CAAC;CACF;AAND,sDAMC"}
1
+ {"version":3,"file":"custom-validation-error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/custom-validation-error.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AAEtD,MAAa,qBAAsB,SAAQ,mCAAe;IAE/C;IADT,YACS,gBAAqB;QAE5B,KAAK,CAAC,iBAAiB,EAAE,+CAA+C,CAAC,CAAC;QAFnE,qBAAgB,GAAhB,gBAAgB,CAAK;IAG9B,CAAC;CACF;AAND,sDAMC","sourcesContent":["import { BadRequestError } from \"./bad-request.error\";\n\nexport class CustomValidationError extends BadRequestError {\n constructor(\n public validationErrors: any\n ) {\n super(\"ValidationError\", \"There are issues found in the input provided.\");\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"forbidden.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/forbidden.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,cAAe,SAAQ,4BAAY;IAC9C,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;CACF;AAJD,wCAIC"}
1
+ {"version":3,"file":"forbidden.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/forbidden.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,cAAe,SAAQ,4BAAY;IAC9C,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;CACF;AAJD,wCAIC","sourcesContent":["import { HttpStatus } from \"@nestjs/common\";\nimport { GenericError } from \"../generic.error\";\n\nexport class ForbiddenError extends GenericError {\n constructor(code: string, message: string) {\n super(code, message, HttpStatus.FORBIDDEN);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal-server.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/internal-server.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,mBAAoB,SAAQ,4BAAY;IACnD,YACE,IAAI,GAAG,uBAAuB,EAC9B,OAAO,GAAG,8BAA8B;QAExC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,qBAAqB,CAAC,CAAC;IACzD,CAAC;CACF;AAPD,kDAOC"}
1
+ {"version":3,"file":"internal-server.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/internal-server.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,mBAAoB,SAAQ,4BAAY;IACnD,YACE,IAAI,GAAG,uBAAuB,EAC9B,OAAO,GAAG,8BAA8B;QAExC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,qBAAqB,CAAC,CAAC;IACzD,CAAC;CACF;AAPD,kDAOC","sourcesContent":["import { HttpStatus } from \"@nestjs/common\";\nimport { GenericError } from \"../generic.error\";\n\nexport class InternalServerError extends GenericError {\n constructor(\n code = \"INTERNAL_SERVER_ERROR\",\n message = \"An unexpected error occurred\",\n ) {\n super(code, message, HttpStatus.INTERNAL_SERVER_ERROR);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"not-found.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/not-found.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,aAAc,SAAQ,4BAAY;IAC7C,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;CACF;AAJD,sCAIC"}
1
+ {"version":3,"file":"not-found.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/not-found.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,aAAc,SAAQ,4BAAY;IAC7C,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;CACF;AAJD,sCAIC","sourcesContent":["import { HttpStatus } from \"@nestjs/common\";\nimport { GenericError } from \"../generic.error\";\n\nexport class NotFoundError extends GenericError {\n constructor(code: string, message: string) {\n super(code, message, HttpStatus.NOT_FOUND);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"service-unavailable.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/service-unavailable.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,uBAAwB,SAAQ,4BAAY;IACvD,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,mBAAmB,CAAC,CAAC;IACvD,CAAC;CACF;AAJD,0DAIC"}
1
+ {"version":3,"file":"service-unavailable.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/service-unavailable.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,uBAAwB,SAAQ,4BAAY;IACvD,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,mBAAmB,CAAC,CAAC;IACvD,CAAC;CACF;AAJD,0DAIC","sourcesContent":["import { HttpStatus } from \"@nestjs/common\";\nimport { GenericError } from \"../generic.error\";\n\nexport class ServiceUnavailableError extends GenericError {\n constructor(code: string, message: string) {\n super(code, message, HttpStatus.SERVICE_UNAVAILABLE);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"unauthorized.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/unauthorized.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,iBAAkB,SAAQ,4BAAY;IACjD,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,YAAY,CAAC,CAAC;IAChD,CAAC;CACF;AAJD,8CAIC"}
1
+ {"version":3,"file":"unauthorized.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/unauthorized.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,iBAAkB,SAAQ,4BAAY;IACjD,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,YAAY,CAAC,CAAC;IAChD,CAAC;CACF;AAJD,8CAIC","sourcesContent":["import { HttpStatus } from \"@nestjs/common\";\nimport { GenericError } from \"../generic.error\";\n\nexport class UnauthorizedError extends GenericError {\n constructor(code: string, message: string) {\n super(code, message, HttpStatus.UNAUTHORIZED);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"unprocess-entity.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/unprocess-entity.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,wBAAyB,SAAQ,4BAAY;IACxD,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,oBAAoB,CAAC,CAAC;IACxD,CAAC;CACF;AAJD,4DAIC"}
1
+ {"version":3,"file":"unprocess-entity.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/unprocess-entity.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,wBAAyB,SAAQ,4BAAY;IACxD,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,oBAAoB,CAAC,CAAC;IACxD,CAAC;CACF;AAJD,4DAIC","sourcesContent":["import { HttpStatus } from \"@nestjs/common\";\nimport { GenericError } from \"../generic.error\";\n\nexport class UnprocessableEntityError extends GenericError {\n constructor(code: string, message: string) {\n super(code, message, HttpStatus.UNPROCESSABLE_ENTITY);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"validation.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/validation.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,eAAgB,SAAQ,4BAAY;IAC/C,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,oBAAoB,CAAC,CAAC;IACxD,CAAC;CACF;AAJD,0CAIC"}
1
+ {"version":3,"file":"validation.error.js","sourceRoot":"","sources":["../../../../src/core-common/error/custom-error/validation.error.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,oDAAgD;AAEhD,MAAa,eAAgB,SAAQ,4BAAY;IAC/C,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAU,CAAC,oBAAoB,CAAC,CAAC;IACxD,CAAC;CACF;AAJD,0CAIC","sourcesContent":["import { HttpStatus } from \"@nestjs/common\";\nimport { GenericError } from \"../generic.error\";\n\nexport class ValidationError extends GenericError {\n constructor(code: string, message: string) {\n super(code, message, HttpStatus.UNPROCESSABLE_ENTITY);\n }\n}\n"]}
@@ -1,15 +1,7 @@
1
1
  import { HttpStatus } from "@nestjs/common";
2
- /**
3
- * Custom error class which needs to be returned from the lower layers to the higher calling layers
4
- */
5
2
  export declare class GenericError {
6
3
  code: string;
7
4
  message: string;
8
5
  statusCode: HttpStatus;
9
- /**
10
- * Default constructor
11
- * @param code - Short error code e.g. "InvaliOperation", "ItemNotFound" etc
12
- * @param message - Detailed error message
13
- */
14
6
  constructor(code: string, message: string, statusCode?: HttpStatus);
15
7
  }
@@ -12,18 +12,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.GenericError = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
14
  const swagger_1 = require("@nestjs/swagger");
15
- /**
16
- * Custom error class which needs to be returned from the lower layers to the higher calling layers
17
- */
18
15
  class GenericError {
19
16
  code;
20
17
  message;
21
18
  statusCode;
22
- /**
23
- * Default constructor
24
- * @param code - Short error code e.g. "InvaliOperation", "ItemNotFound" etc
25
- * @param message - Detailed error message
26
- */
27
19
  constructor(code, message, statusCode = common_1.HttpStatus.INTERNAL_SERVER_ERROR) {
28
20
  this.code = code;
29
21
  this.message = message;
@@ -1 +1 @@
1
- {"version":3,"file":"generic.error.js","sourceRoot":"","sources":["../../../src/core-common/error/generic.error.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAA8C;AAE9C;;GAEG;AACH,MAAa,YAAY;IAEhB,IAAI,CAAS;IAGb,OAAO,CAAS;IAGhB,UAAU,CAAa;IAE9B;;;;OAIG;IACH,YACE,IAAY,EACZ,OAAe,EACf,aAAyB,mBAAU,CAAC,qBAAqB;QAEzD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AAxBD,oCAwBC;AAtBQ;IADN,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;;0CAC7B;AAGb;IADN,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;6CACpC;AAGhB;IADN,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;gDAC7B"}
1
+ {"version":3,"file":"generic.error.js","sourceRoot":"","sources":["../../../src/core-common/error/generic.error.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAA8C;AAK9C,MAAa,YAAY;IAEhB,IAAI,CAAS;IAGb,OAAO,CAAS;IAGhB,UAAU,CAAa;IAO9B,YACE,IAAY,EACZ,OAAe,EACf,aAAyB,mBAAU,CAAC,qBAAqB;QAEzD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AAxBD,oCAwBC;AAtBQ;IADN,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;;0CAC7B;AAGb;IADN,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;6CACpC;AAGhB;IADN,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;gDAC7B","sourcesContent":["import { HttpStatus } from \"@nestjs/common\";\nimport { ApiProperty } from \"@nestjs/swagger\";\n\n/**\n * Custom error class which needs to be returned from the lower layers to the higher calling layers\n */\nexport class GenericError {\n @ApiProperty({ description: \"Short error code\" })\n public code: string;\n\n @ApiProperty({ description: \"Detailed error description\" })\n public message: string;\n\n @ApiProperty({ description: \"Detailed error description\" })\n public statusCode: HttpStatus;\n\n /**\n * Default constructor\n * @param code - Short error code e.g. \"InvaliOperation\", \"ItemNotFound\" etc\n * @param message - Detailed error message\n */\n constructor(\n code: string,\n message: string,\n statusCode: HttpStatus = HttpStatus.INTERNAL_SERVER_ERROR,\n ) {\n this.code = code;\n this.message = message;\n this.statusCode = statusCode;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"logger.interface.js","sourceRoot":"","sources":["../../../src/core-common/logger/logger.interface.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"logger.interface.js","sourceRoot":"","sources":["../../../src/core-common/logger/logger.interface.ts"],"names":[],"mappings":"","sourcesContent":["// src/logger/logger.options.ts\nexport interface LoggerModuleOptions {\n level?: string;\n deploymentEnv?: string;\n serviceVersion?: string;\n otelAgentHost?: string;\n overrideConsole?: boolean;\n}"]}
@@ -8,7 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var LoggerModule_1;
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.LoggerModule = exports.LOGGER_OPTIONS = void 0;
11
- // src/logger/logger.module.ts
12
11
  const common_1 = require("@nestjs/common");
13
12
  const logger_service_1 = require("./logger.service");
14
13
  exports.LOGGER_OPTIONS = Symbol("LOGGER_OPTIONS");
@@ -1 +1 @@
1
- {"version":3,"file":"logger.module.js","sourceRoot":"","sources":["../../../src/core-common/logger/logger.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,8BAA8B;AAC9B,2CAAuD;AACvD,qDAAiD;AAGpC,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAGhD,IAAM,YAAY,oBAAlB,MAAM,YAAY;IACvB,MAAM,CAAC,OAAO,CAAC,UAA+B,EAAE;QAC9C,OAAO;YACL,MAAM,EAAE,cAAY;YACpB,SAAS,EAAE;gBACT,8BAAa;gBACb;oBACE,OAAO,EAAE,sBAAc;oBACvB,QAAQ,EAAE,OAAO;iBAClB;aACF;YACD,OAAO,EAAE,CAAC,8BAAa,CAAC;SACzB,CAAC;IACJ,CAAC;CACF,CAAA;AAdY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,YAAY,CAcxB"}
1
+ {"version":3,"file":"logger.module.js","sourceRoot":"","sources":["../../../src/core-common/logger/logger.module.ts"],"names":[],"mappings":";;;;;;;;;;AACA,2CAAuD;AACvD,qDAAiD;AAGpC,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAGhD,IAAM,YAAY,oBAAlB,MAAM,YAAY;IACvB,MAAM,CAAC,OAAO,CAAC,UAA+B,EAAE;QAC9C,OAAO;YACL,MAAM,EAAE,cAAY;YACpB,SAAS,EAAE;gBACT,8BAAa;gBACb;oBACE,OAAO,EAAE,sBAAc;oBACvB,QAAQ,EAAE,OAAO;iBAClB;aACF;YACD,OAAO,EAAE,CAAC,8BAAa,CAAC;SACzB,CAAC;IACJ,CAAC;CACF,CAAA;AAdY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,YAAY,CAcxB","sourcesContent":["// src/logger/logger.module.ts\nimport { DynamicModule, Module } from \"@nestjs/common\";\nimport { LoggerService } from \"./logger.service\";\nimport { LoggerModuleOptions } from \"./logger.interface\";\n\nexport const LOGGER_OPTIONS = Symbol(\"LOGGER_OPTIONS\");\n\n@Module({})\nexport class LoggerModule {\n static forRoot(options: LoggerModuleOptions = {}): DynamicModule {\n return {\n module: LoggerModule,\n providers: [\n LoggerService,\n {\n provide: LOGGER_OPTIONS,\n useValue: options,\n },\n ],\n exports: [LoggerService],\n };\n }\n}\n"]}
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.LoggerService = void 0;
7
7
  const winston_1 = __importDefault(require("winston"));
8
- /* ---------------------------------- Types --------------------------------- */
9
8
  var SeverityText;
10
9
  (function (SeverityText) {
11
10
  SeverityText["INFO"] = "Information";
@@ -13,7 +12,6 @@ var SeverityText;
13
12
  SeverityText["WARNING"] = "Warning";
14
13
  SeverityText["ERROR"] = "Error";
15
14
  })(SeverityText || (SeverityText = {}));
16
- /* --------------------------------- Service -------------------------------- */
17
15
  class LoggerService {
18
16
  logger;
19
17
  deploymentEnv;
@@ -26,7 +24,6 @@ class LoggerService {
26
24
  this.logger = this.createLogger(logLevel);
27
25
  this.overrideConsole();
28
26
  }
29
- /* ------------------------------- Public API ------------------------------- */
30
27
  log(message, metadata) {
31
28
  this.write("info", SeverityText.INFO, message, metadata);
32
29
  }
@@ -39,7 +36,6 @@ class LoggerService {
39
36
  error(message, metadata, error) {
40
37
  this.write("error", SeverityText.ERROR, message, metadata, error);
41
38
  }
42
- /* ------------------------------ Logger Core ------------------------------ */
43
39
  write(level, severity, message, metadata = {}, error) {
44
40
  const body = {
45
41
  SeverityText: severity,
@@ -64,7 +60,6 @@ class LoggerService {
64
60
  transports: [new winston_1.default.transports.Console()],
65
61
  });
66
62
  }
67
- /* ------------------------------- Context -------------------------------- */
68
63
  buildAttributes(level) {
69
64
  return {
70
65
  "service.image.version": this.hostImageVersion,
@@ -73,7 +68,6 @@ class LoggerService {
73
68
  "service.log.level": level,
74
69
  };
75
70
  }
76
- /* ------------------------------- Helpers -------------------------------- */
77
71
  cleanMeta(meta) {
78
72
  return Object.fromEntries(Object.entries(meta).filter(([_, value]) => value !== undefined && value !== "None"));
79
73
  }
@@ -98,7 +92,6 @@ class LoggerService {
98
92
  return value;
99
93
  };
100
94
  }
101
- /* ----------------------------- Redaction -------------------------------- */
102
95
  redactSecrets(message) {
103
96
  const patterns = [
104
97
  {
@@ -118,7 +111,6 @@ class LoggerService {
118
111
  return msg.replace(regex, (m) => `${m.slice(0, visible)}...[REDACTED_${name}]`);
119
112
  }, message);
120
113
  }
121
- /* --------------------------- Console Override ---------------------------- */
122
114
  overrideConsole() {
123
115
  const blocked = ["NodeSDK", "AuthToken"];
124
116
  console.log = (...args) => {
@@ -1 +1 @@
1
- {"version":3,"file":"logger.service.js","sourceRoot":"","sources":["../../../src/core-common/logger/logger.service.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA0C;AAE1C,gFAAgF;AAEhF,IAAK,YAKJ;AALD,WAAK,YAAY;IACf,oCAAoB,CAAA;IACpB,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,+BAAe,CAAA;AACjB,CAAC,EALI,YAAY,KAAZ,YAAY,QAKhB;AAaD,gFAAgF;AAEhF,MAAa,aAAa;IACP,MAAM,CAAS;IACf,aAAa,CAAS;IACtB,gBAAgB,CAAS;IACzB,aAAa,CAAS;IAEvC,YAAY,WAAmB,OAAO;QACpC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,UAAU,CAAC;QAClE,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,UAAU,CAAC;QAC/D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC1C,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAED,gFAAgF;IAEhF,GAAG,CAAC,OAAe,EAAE,QAAsB;QACzC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,QAAsB;QAC3C,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,QAAsB;QAC1C,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ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,EAAE,qCAAqC;gBAC5C,OAAO,EAAE,EAAE;aACZ;YACD,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,uBAAuB,EAAE,OAAO,EAAE,CAAC,EAAE;YAC/D,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,CAAC,EAAE;SAC/D,CAAC;QAEF,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;YACvD,OAAO,GAAG,CAAC,OAAO,CAChB,KAAK,EACL,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,gBAAgB,IAAI,GAAG,CACrD,CAAC;QACJ,CAAC,EAAE,OAAO,CAAC,CAAC;IACd,CAAC;IAIO,eAAe;QACrB,MAAM,OAAO,GAAG,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE;YACnC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAAE,OAAO;YACjD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;CACF;AAtJD,sCAsJC","sourcesContent":["import winston, { Logger } from \"winston\";\n\n/* ---------------------------------- Types --------------------------------- */\n\nenum SeverityText {\n INFO = \"Information\",\n DEBUG = \"Debug\",\n WARNING = \"Warning\",\n ERROR = \"Error\",\n}\n\ntype LogMetadata = {\n ClassName?: string;\n MethodName?: string;\n};\n\nexport type OrgContext = {\n orgId?: string;\n orgFid?: string;\n userId?: string;\n};\n\n/* --------------------------------- Service -------------------------------- */\n\nexport class LoggerService {\n private readonly logger: Logger;\n private readonly deploymentEnv: string;\n private readonly hostImageVersion: string;\n private readonly otelAgentHost: string;\n\n constructor(logLevel: string = \"debug\") {\n this.deploymentEnv = \"rls-dev\";\n this.hostImageVersion = process.env.SERVICE_VERSION ?? \"202501.1\";\n this.otelAgentHost = process.env.OTEL_AGENT_HOST ?? \"10.0.0.1\";\n this.logger = this.createLogger(logLevel);\n this.overrideConsole();\n }\n\n /* ------------------------------- Public API ------------------------------- */\n\n log(message: string, metadata?: LogMetadata) {\n this.write(\"info\", SeverityText.INFO, message, metadata);\n }\n\n debug(message: string, metadata?: LogMetadata) {\n this.write(\"debug\", SeverityText.DEBUG, message, metadata);\n }\n\n warn(message: string, metadata?: LogMetadata) {\n this.write(\"warn\", SeverityText.WARNING, message, metadata);\n }\n\n error(message: string, metadata?: LogMetadata, error?: Error) {\n this.write(\"error\", SeverityText.ERROR, message, metadata, error);\n }\n\n /* ------------------------------ Logger Core ------------------------------ */\n\n private write(\n level: keyof Logger,\n severity: SeverityText,\n message: string,\n metadata: LogMetadata = {},\n error?: Error,\n ) {\n const body = {\n SeverityText: severity,\n ...metadata,\n ...(error && {\n ErrorMessage: error.message,\n StackTrace: error.stack,\n }),\n };\n\n this.logger[level](this.redactSecrets(message), body);\n }\n\n private createLogger(level: string): Logger {\n return winston.createLogger({\n level,\n levels: winston.config.npm.levels,\n format: winston.format.combine(\n winston.format.timestamp({ format: \"YYYY-MM-DD HH:mm:ss\" }),\n winston.format.printf(({ level, message, timestamp, ...meta }) =>\n JSON.stringify({\n message: this.safeStringify(message),\n attributes: this.buildAttributes(level),\n timestamp: timestamp,\n ...this.cleanMeta(meta),\n }),\n ),\n ),\n transports: [new winston.transports.Console()],\n });\n }\n\n /* ------------------------------- Context -------------------------------- */\n\n private buildAttributes(level: string) {\n return {\n \"service.image.version\": this.hostImageVersion,\n \"deployment.environment\": this.deploymentEnv,\n \"otel.agent.host\": this.otelAgentHost,\n \"service.log.level\": level,\n };\n }\n\n /* ------------------------------- Helpers -------------------------------- */\n\n private cleanMeta(meta: Record<string, unknown>) {\n return Object.fromEntries(\n Object.entries(meta).filter(\n ([_, value]) => value !== undefined && value !== \"None\",\n ),\n );\n }\n\n private safeStringify(input: unknown): string {\n try {\n return typeof input === \"string\"\n ? input\n : JSON.stringify(input, this.circularReplacer());\n } catch {\n return \"[Unserializable Object]\";\n }\n }\n\n private circularReplacer() {\n const seen = new WeakSet();\n return (_: string, value: any) => {\n if (typeof value === \"object\" && value !== null) {\n if (seen.has(value)) return \"[Circular]\";\n seen.add(value);\n }\n return value;\n };\n }\n\n /* ----------------------------- Redaction -------------------------------- */\n\n private redactSecrets(message: string): string {\n const patterns = [\n {\n name: \"JWT\",\n regex: /eyJ[a-zA-Z0-9-_]+\\.[a-zA-Z0-9-_]+\\.[a-zA-Z0-9-_]+/g,\n visible: 10,\n },\n {\n name: \"BEARER\",\n regex: /Bearer\\s+eyJ[A-Za-z0-9\\-._~+/]+=*/gi,\n visible: 15,\n },\n { name: \"API_KEY\", regex: /\\b[A-Za-z0-9]{32,}\\b/g, visible: 8 },\n { name: \"AWS_SECRET\", regex: /AKIA[0-9A-Z]{16}/g, visible: 8 },\n ];\n\n return patterns.reduce((msg, { regex, visible, name }) => {\n return msg.replace(\n regex,\n (m) => `${m.slice(0, visible)}...[REDACTED_${name}]`,\n );\n }, message);\n }\n\n /* --------------------------- Console Override ---------------------------- */\n\n private overrideConsole() {\n const blocked = [\"NodeSDK\", \"AuthToken\"];\n console.log = (...args: unknown[]) => {\n const msg = args.map(String).join(\" \");\n if (blocked.some((k) => msg.includes(k))) return;\n this.log(msg);\n };\n }\n}\n"]}
@@ -1,9 +1,4 @@
1
1
  import { Result } from "../result-model/result";
2
- /**
3
- * Standard error response to be returned to the caller of the API.
4
- * This class represents the structure of an error response returned by the API
5
- * in case of failures.
6
- */
7
2
  export declare class ErrorDisplay {
8
3
  code: string;
9
4
  message: string;
@@ -16,10 +11,5 @@ export declare class GenericErrorResponse {
16
11
  timestamp: string;
17
12
  data: any;
18
13
  constructor();
19
- /**
20
- * Sets the properties from the Result object.
21
- * @param result - Result object instance returned from the controller method.
22
- * @param statusCode - HTTP status code.
23
- */
24
14
  initialize(result: Result<any>, statusCode: number): void;
25
15
  }
@@ -1,11 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GenericErrorResponse = exports.ErrorDisplay = void 0;
4
- /**
5
- * Standard error response to be returned to the caller of the API.
6
- * This class represents the structure of an error response returned by the API
7
- * in case of failures.
8
- */
9
4
  class ErrorDisplay {
10
5
  code;
11
6
  message;
@@ -19,15 +14,10 @@ class GenericErrorResponse {
19
14
  timestamp;
20
15
  data;
21
16
  constructor() {
22
- this.statusCode = 500; // Default value
17
+ this.statusCode = 500;
23
18
  this.success = false;
24
- this.timestamp = new Date().toISOString(); // Default value
19
+ this.timestamp = new Date().toISOString();
25
20
  }
26
- /**
27
- * Sets the properties from the Result object.
28
- * @param result - Result object instance returned from the controller method.
29
- * @param statusCode - HTTP status code.
30
- */
31
21
  initialize(result, statusCode) {
32
22
  this.statusCode = statusCode;
33
23
  this.error = {
@@ -1 +1 @@
1
- {"version":3,"file":"generic-error-response.model.js","sourceRoot":"","sources":["../../../src/core-common/response-model/generic-error-response.model.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AAEH,MAAa,YAAY;IACvB,IAAI,CAAS;IACb,OAAO,CAAS;IAChB,eAAe,CAAO;CACvB;AAJD,oCAIC;AACD,MAAa,oBAAoB;IAC/B,UAAU,CAAS;IACnB,OAAO,GAAY,KAAK,CAAC;IACzB,KAAK,CAAe;IACpB,SAAS,CAAS;IAClB,IAAI,CAAM;IAEV;QACE,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC,gBAAgB;QACvC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,gBAAgB;IAC7D,CAAC;IACD;;;;OAIG;IACH,UAAU,CACR,MAAmB,EACnB,UAAkB;QAElB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG;YACX,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,IAAI,OAAO;YACnC,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,IAAI,oBAAoB;SACvD,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;QACvB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,KAAK,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAChE,CAAC;CACF;AA9BD,oDA8BC"}
1
+ {"version":3,"file":"generic-error-response.model.js","sourceRoot":"","sources":["../../../src/core-common/response-model/generic-error-response.model.ts"],"names":[],"mappings":";;;AAQA,MAAa,YAAY;IACvB,IAAI,CAAS;IACb,OAAO,CAAS;IAChB,eAAe,CAAO;CACvB;AAJD,oCAIC;AACD,MAAa,oBAAoB;IAC/B,UAAU,CAAS;IACnB,OAAO,GAAY,KAAK,CAAC;IACzB,KAAK,CAAe;IACpB,SAAS,CAAS;IAClB,IAAI,CAAM;IAEV;QACE,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5C,CAAC;IAMD,UAAU,CACR,MAAmB,EACnB,UAAkB;QAElB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG;YACX,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,IAAI,OAAO;YACnC,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,IAAI,oBAAoB;SACvD,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;QACvB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,KAAK,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAChE,CAAC;CACF;AA9BD,oDA8BC","sourcesContent":["import { Result } from \"../result-model/result\";\n\n/**\n * Standard error response to be returned to the caller of the API.\n * This class represents the structure of an error response returned by the API\n * in case of failures.\n */\n\nexport class ErrorDisplay {\n code: string;\n message: string;\n validationError?: any;\n}\nexport class GenericErrorResponse {\n statusCode: number;\n success: boolean = false;\n error: ErrorDisplay;\n timestamp: string;\n data: any;\n\n constructor() {\n this.statusCode = 500; // Default value\n this.success = false;\n this.timestamp = new Date().toISOString(); // Default value\n }\n /**\n * Sets the properties from the Result object.\n * @param result - Result object instance returned from the controller method.\n * @param statusCode - HTTP status code.\n */\n initialize(\n result: Result<any>,\n statusCode: number,\n ) {\n this.statusCode = statusCode;\n this.error = {\n code: result.error?.code || \"ERROR\",\n message: result.error?.message || \"An error occurred.\",\n };\n this.data = result.data\n this.success = result.success || false;\n this.timestamp = result.timestamp || new Date().toISOString();\n }\n}\n"]}
@@ -1,18 +1,8 @@
1
1
  import { Result } from "../result-model/result";
2
- /**
3
- * Standard response object to be returned to the caller of the API.
4
- * This class represents the structure of a success response returned by the API.
5
- * @typeparam T - The type of data included in the response.
6
- */
7
2
  export declare class GenericSuccessResponse<T> {
8
3
  statusCode: number;
9
4
  success: boolean;
10
5
  data: T;
11
6
  timestamp: string;
12
- /**
13
- * Sets the properties from the Result object.
14
- * @param result - Result object instance returned from the controller method.
15
- * @param statusCode - HTTP status code.
16
- */
17
7
  initialize(result: Result<T>, statusCode: number): void;
18
8
  }
@@ -1,21 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GenericSuccessResponse = void 0;
4
- /**
5
- * Standard response object to be returned to the caller of the API.
6
- * This class represents the structure of a success response returned by the API.
7
- * @typeparam T - The type of data included in the response.
8
- */
9
4
  class GenericSuccessResponse {
10
5
  statusCode;
11
6
  success;
12
7
  data;
13
8
  timestamp;
14
- /**
15
- * Sets the properties from the Result object.
16
- * @param result - Result object instance returned from the controller method.
17
- * @param statusCode - HTTP status code.
18
- */
19
9
  initialize(result, statusCode) {
20
10
  this.statusCode = statusCode;
21
11
  this.success = result.success;
@@ -1 +1 @@
1
- {"version":3,"file":"generic-success-response.model.js","sourceRoot":"","sources":["../../../src/core-common/response-model/generic-success-response.model.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,MAAa,sBAAsB;IACjC,UAAU,CAAS;IACnB,OAAO,CAAU;IACjB,IAAI,CAAI;IACR,SAAS,CAAS;IAElB;;;;OAIG;IACH,UAAU,CAAC,MAAiB,EAAE,UAAkB;QAC9C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5C,CAAC;CACF;AAjBD,wDAiBC"}
1
+ {"version":3,"file":"generic-success-response.model.js","sourceRoot":"","sources":["../../../src/core-common/response-model/generic-success-response.model.ts"],"names":[],"mappings":";;;AAOA,MAAa,sBAAsB;IACjC,UAAU,CAAS;IACnB,OAAO,CAAU;IACjB,IAAI,CAAI;IACR,SAAS,CAAS;IAOlB,UAAU,CAAC,MAAiB,EAAE,UAAkB;QAC9C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5C,CAAC;CACF;AAjBD,wDAiBC","sourcesContent":["import { Result } from \"../result-model/result\";\n\n/**\n * Standard response object to be returned to the caller of the API.\n * This class represents the structure of a success response returned by the API.\n * @typeparam T - The type of data included in the response.\n */\nexport class GenericSuccessResponse<T> {\n statusCode: number;\n success: boolean;\n data: T;\n timestamp: string;\n\n /**\n * Sets the properties from the Result object.\n * @param result - Result object instance returned from the controller method.\n * @param statusCode - HTTP status code.\n */\n initialize(result: Result<T>, statusCode: number) {\n this.statusCode = statusCode;\n this.success = result.success;\n this.data = result.data;\n this.timestamp = new Date().toISOString();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/core-common/result-model/result.ts"],"names":[],"mappings":";;;AAEA,MAAa,MAAM;IACjB,OAAO,CAAU;IACjB,IAAI,CAAI;IACR,KAAK,CAAe;IACpB,SAAS,CAAS;IAEX,MAAM,CAAC,OAAO,CAAI,IAAO;QAC9B,MAAM,MAAM,GAAG,IAAI,MAAM,EAAK,CAAC;QAC/B,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;QACnB,MAAM,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC5C,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,MAAM,CAAC,MAAM,CAAI,KAAmB,EAAE,IAAQ;QACnD,MAAM,MAAM,GAAG,IAAI,MAAM,EAAK,CAAC;QAC/B,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;QACvB,MAAM,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC5C,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,IAAI,IAAI,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T,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;QACrB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,MAAM,CAAC,UAAU,CAAI,KAAmB,EAAE,IAAQ;QACvD,MAAM,MAAM,GAAG,IAAI,MAAM,EAAK,CAAC;QAC/B,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;QACvB,MAAM,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC5C,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,IAAI,IAAI,EAAE,CAAC;YACT,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;QACrB,CAAC;QACD,MAAM,MAAM,CAAC;IACf,CAAC;CACF;AAnCD,wBAmCC","sourcesContent":["import { GenericError } from \"../error/generic.error\";\n\nexport class Result<T> {\n success: boolean;\n data: T;\n error: GenericError;\n timestamp: string;\n\n public static success<T>(data: T): Result<T> {\n const result = new Result<T>();\n result.success = true;\n result.data = data;\n result.timestamp = new Date().toISOString();\n return result;\n }\n\n public static failed<T>(error: GenericError, data?: T): Result<T> {\n const result = new Result<T>();\n result.success = false;\n result.timestamp = new Date().toISOString();\n result.error = error;\n if (data) {\n result.data = data;\n }\n return result;\n }\n\n public static throwError<T>(error: GenericError, data?: T): Result<T> {\n const result = new Result<T>();\n result.success = false;\n result.timestamp = new Date().toISOString();\n result.error = error;\n if (data) {\n result.data = data;\n }\n throw result;\n }\n}\n"]}