@solidstarters/solid-core 1.2.169 → 1.2.171

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 (97) hide show
  1. package/dist/config/iam.config.d.ts +2 -0
  2. package/dist/config/iam.config.d.ts.map +1 -1
  3. package/dist/config/iam.config.js +2 -1
  4. package/dist/config/iam.config.js.map +1 -1
  5. package/dist/controllers/authentication.controller.d.ts.map +1 -1
  6. package/dist/controllers/authentication.controller.js +0 -8
  7. package/dist/controllers/authentication.controller.js.map +1 -1
  8. package/dist/controllers/email-template.controller.d.ts +1 -1
  9. package/dist/controllers/email-template.controller.d.ts.map +1 -1
  10. package/dist/controllers/email-template.controller.js +3 -6
  11. package/dist/controllers/email-template.controller.js.map +1 -1
  12. package/dist/controllers/google-authentication.controller.d.ts +3 -3
  13. package/dist/controllers/google-authentication.controller.d.ts.map +1 -1
  14. package/dist/controllers/google-authentication.controller.js +5 -8
  15. package/dist/controllers/google-authentication.controller.js.map +1 -1
  16. package/dist/controllers/media.controller.d.ts +1 -1
  17. package/dist/controllers/media.controller.d.ts.map +1 -1
  18. package/dist/controllers/media.controller.js +1 -5
  19. package/dist/controllers/media.controller.js.map +1 -1
  20. package/dist/controllers/model-metadata.controller.d.ts.map +1 -1
  21. package/dist/controllers/model-metadata.controller.js +0 -5
  22. package/dist/controllers/model-metadata.controller.js.map +1 -1
  23. package/dist/controllers/otp-authentication.controller.js +0 -3
  24. package/dist/controllers/otp-authentication.controller.js.map +1 -1
  25. package/dist/controllers/service.controller.d.ts +2 -2
  26. package/dist/controllers/service.controller.d.ts.map +1 -1
  27. package/dist/controllers/service.controller.js +3 -7
  28. package/dist/controllers/service.controller.js.map +1 -1
  29. package/dist/controllers/sms-template.controller.d.ts.map +1 -1
  30. package/dist/controllers/sms-template.controller.js +0 -3
  31. package/dist/controllers/sms-template.controller.js.map +1 -1
  32. package/dist/entities/user.entity.d.ts +3 -0
  33. package/dist/entities/user.entity.d.ts.map +1 -1
  34. package/dist/entities/user.entity.js +13 -1
  35. package/dist/entities/user.entity.js.map +1 -1
  36. package/dist/filters/http-exception.filter.js +1 -1
  37. package/dist/filters/http-exception.filter.js.map +1 -1
  38. package/dist/helpers/error-mapper.service.d.ts.map +1 -1
  39. package/dist/helpers/error-mapper.service.js +1 -1
  40. package/dist/helpers/error-mapper.service.js.map +1 -1
  41. package/dist/helpers/field-crud-managers/PasswordFieldCrudManager.d.ts +2 -1
  42. package/dist/helpers/field-crud-managers/PasswordFieldCrudManager.d.ts.map +1 -1
  43. package/dist/helpers/field-crud-managers/PasswordFieldCrudManager.js +3 -3
  44. package/dist/helpers/field-crud-managers/PasswordFieldCrudManager.js.map +1 -1
  45. package/dist/helpers/model-metadata-helper.service.js.map +1 -1
  46. package/dist/passport-strategies/local.strategy.js +1 -1
  47. package/dist/passport-strategies/local.strategy.js.map +1 -1
  48. package/dist/seeders/seed-data/solid-core-metadata.json +43 -0
  49. package/dist/services/authentication.service.d.ts +2 -1
  50. package/dist/services/authentication.service.d.ts.map +1 -1
  51. package/dist/services/authentication.service.js +28 -5
  52. package/dist/services/authentication.service.js.map +1 -1
  53. package/dist/services/bcrypt.service.d.ts +11 -1
  54. package/dist/services/bcrypt.service.d.ts.map +1 -1
  55. package/dist/services/bcrypt.service.js +35 -5
  56. package/dist/services/bcrypt.service.js.map +1 -1
  57. package/dist/services/crud.service.d.ts.map +1 -1
  58. package/dist/services/crud.service.js +2 -1
  59. package/dist/services/crud.service.js.map +1 -1
  60. package/dist/services/export-transaction.service.d.ts +3 -1
  61. package/dist/services/export-transaction.service.d.ts.map +1 -1
  62. package/dist/services/export-transaction.service.js +70 -16
  63. package/dist/services/export-transaction.service.js.map +1 -1
  64. package/dist/services/hashing.service.d.ts +4 -1
  65. package/dist/services/hashing.service.d.ts.map +1 -1
  66. package/dist/services/hashing.service.js.map +1 -1
  67. package/dist/solid-core.module.d.ts.map +1 -1
  68. package/dist/solid-core.module.js +46 -61
  69. package/dist/solid-core.module.js.map +1 -1
  70. package/dist/subscribers/audit.subscriber.d.ts.map +1 -1
  71. package/dist/subscribers/audit.subscriber.js +1 -1
  72. package/dist/subscribers/audit.subscriber.js.map +1 -1
  73. package/dist/tsconfig.tsbuildinfo +1 -1
  74. package/package.json +1 -1
  75. package/src/config/iam.config.ts +2 -1
  76. package/src/controllers/authentication.controller.ts +8 -10
  77. package/src/controllers/email-template.controller.ts +7 -10
  78. package/src/controllers/google-authentication.controller.ts +9 -10
  79. package/src/controllers/media.controller.ts +5 -6
  80. package/src/controllers/model-metadata.controller.ts +5 -6
  81. package/src/controllers/otp-authentication.controller.ts +2 -2
  82. package/src/controllers/service.controller.ts +8 -9
  83. package/src/controllers/sms-template.controller.ts +3 -4
  84. package/src/entities/user.entity.ts +9 -0
  85. package/src/filters/http-exception.filter.ts +1 -1
  86. package/src/helpers/error-mapper.service.ts +1 -35
  87. package/src/helpers/field-crud-managers/PasswordFieldCrudManager.ts +4 -3
  88. package/src/helpers/model-metadata-helper.service.ts +1 -1
  89. package/src/passport-strategies/local.strategy.ts +1 -1
  90. package/src/seeders/seed-data/solid-core-metadata.json +43 -0
  91. package/src/services/authentication.service.ts +32 -3
  92. package/src/services/bcrypt.service.ts +45 -7
  93. package/src/services/crud.service.ts +2 -1
  94. package/src/services/export-transaction.service.ts +118 -55
  95. package/src/services/hashing.service.ts +5 -2
  96. package/src/solid-core.module.ts +59 -61
  97. package/src/subscribers/audit.subscriber.ts +6 -1
@@ -16,14 +16,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.ServiceController = void 0;
17
17
  const openapi = require("@nestjs/swagger");
18
18
  const common_1 = require("@nestjs/common");
19
- const public_decorator_1 = require("../decorators/public.decorator");
20
- const solid_registry_1 = require("../helpers/solid-registry");
21
19
  const swagger_1 = require("@nestjs/swagger");
22
- const throttler_1 = require("@nestjs/throttler");
23
20
  const active_user_decorator_1 = require("../decorators/active-user.decorator");
21
+ const public_decorator_1 = require("../decorators/public.decorator");
22
+ const error_mapper_service_1 = require("../helpers/error-mapper.service");
24
23
  const ai_interaction_service_1 = require("../services/ai-interaction.service");
25
24
  const mq_message_service_1 = require("../services/mq-message.service");
26
- const error_mapper_service_1 = require("../helpers/error-mapper.service");
25
+ const solid_registry_1 = require("../helpers/solid-registry");
27
26
  let ServiceController = ServiceController_1 = class ServiceController {
28
27
  constructor(solidRegistry, aiInteractionService, mqMessageService, errorMapper) {
29
28
  this.solidRegistry = solidRegistry;
@@ -104,7 +103,6 @@ __decorate([
104
103
  ], ServiceController.prototype, "mcpPingPong", null);
105
104
  __decorate([
106
105
  (0, public_decorator_1.Public)(),
107
- (0, throttler_1.SkipThrottle)({ short: false, login: true, burst: true, sustained: true }),
108
106
  (0, common_1.Post)('seed'),
109
107
  openapi.ApiResponse({ status: 201 }),
110
108
  __param(0, (0, common_1.Body)()),
@@ -115,8 +113,6 @@ __decorate([
115
113
  exports.ServiceController = ServiceController = ServiceController_1 = __decorate([
116
114
  (0, common_1.Controller)(''),
117
115
  (0, swagger_1.ApiTags)("Common"),
118
- (0, common_1.UseGuards)(throttler_1.ThrottlerGuard),
119
- (0, throttler_1.SkipThrottle)({ short: true, login: true, burst: true, sustained: true }),
120
116
  __metadata("design:paramtypes", [solid_registry_1.SolidRegistry,
121
117
  ai_interaction_service_1.AiInteractionService,
122
118
  mq_message_service_1.MqMessageService,
@@ -1 +1 @@
1
- {"version":3,"file":"service.controller.js","sourceRoot":"","sources":["../../src/controllers/service.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAgF;AAChF,qEAAyD;AACzD,8DAA0D;AAC1D,6CAAyD;AACzD,iDAAiE;AAEjE,+EAAkE;AAClE,+EAA2E;AAC3E,uEAAmE;AACnE,0EAAsE;AAO/D,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAG1B,YACqB,aAA4B,EAC5B,oBAA0C,EAC1C,gBAAkC,EAClC,WAA+B;QAH/B,kBAAa,GAAb,aAAa,CAAe;QAC5B,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EAAE,iBAAiB,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;IAC3D,CAAC;CAoBJ,CAAA;AA5GY,8CAAiB;AAY1B;IAFC,IAAA,yBAAM,GAAE;IACR,IAAA,YAAG,EAAC,MAAM,CAAC;;;;;iDAGX;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,YAAG,EAAC,UAAU,CAAC;;IACG,WAAA,IAAA,kCAAU,GAAE,CAAA;;;;oDAoD9B;AAKK;IAHL,IAAA,yBAAM,GAAE;IACR,IAAA,wBAAY,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IACzE,IAAA,aAAI,EAAC,MAAM,CAAC;;IACG,WAAA,IAAA,aAAI,GAAE,CAAA;;;;iDAarB;4BAxFQ,iBAAiB;IAJ7B,IAAA,mBAAU,EAAC,EAAE,CAAC;IACd,IAAA,iBAAO,EAAC,QAAQ,CAAC;IACjB,IAAA,kBAAS,EAAC,0BAAc,CAAC;IACzB,IAAA,wBAAY,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;qCAKjC,8BAAa;QACN,6CAAoB;QACxB,qCAAgB;QACrB,yCAAkB;GAP3C,iBAAiB,CA4G7B","sourcesContent":["import { Body, Controller, Get, Logger, Post, UseGuards } from '@nestjs/common';\nimport { Public } from 'src/decorators/public.decorator';\nimport { SolidRegistry } from '../helpers/solid-registry';\nimport { ApiBearerAuth, ApiTags } from '@nestjs/swagger';\nimport { ThrottlerGuard, SkipThrottle } from '@nestjs/throttler';\nimport { ActiveUserData } from 'src/interfaces/active-user-data.interface';\nimport { ActiveUser } from 'src/decorators/active-user.decorator';\nimport { AiInteractionService } from 'src/services/ai-interaction.service';\nimport { MqMessageService } from 'src/services/mq-message.service';\nimport { ErrorMapperService } from 'src/helpers/error-mapper.service';\n\n\n@Controller('')\n@ApiTags(\"Common\")\n@UseGuards(ThrottlerGuard)\n@SkipThrottle({ short: true, login: true, burst: true, sustained: true }) // Skip all\nexport class ServiceController {\n private readonly logger = new Logger(ServiceController.name);\n\n constructor(\n private readonly solidRegistry: SolidRegistry,\n private readonly aiInteractionService: AiInteractionService,\n private readonly mqMessageService: MqMessageService,\n private readonly errorMapper: ErrorMapperService\n ) { }\n\n @Public()\n @Get('ping')\n pingPong() {\n return { pong: 'v1.0.2' };\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get('mcp/ping')\n async mcpPingPong(@ActiveUser() activeUser: ActiveUserData) {\n // TODO: do a MCP client invocation, wait for response and return.\n // If failure then decide shape to return.\n\n const threadId = `pingPongTxn-${activeUser.sub}`;\n\n const { queueMessageId, aiInteractionId } = await this.aiInteractionService.triggerMcpClientJob(\n `Can you do 1 + 1`,\n activeUser.sub,\n true,\n threadId\n );\n\n this.logger.debug(`mcp ping pong job triggered: queueMessageId=${queueMessageId}, aiInteractionId=${aiInteractionId}`);\n\n // Wait up to 2 minutes, start at 500ms poll, back off to max 2s, throw if failed:\n const result = await this.mqMessageService.waitForTerminalStatus(queueMessageId, {\n timeoutMs: 2 * 60 * 1000,\n intervalMs: 500,\n maxIntervalMs: 2000,\n throwOnFailure: false,\n });\n\n this.logger.debug(`mcp ping pong job finished with stage=${result.stage}`)\n\n this.logger.debug(`mcp ping pong trying to find genai (child) interaction for aiInteraction for id=${aiInteractionId}`)\n\n // @ts-ignore\n const genAiInteractions = await this.aiInteractionService.find({\n filters: {\n parentInteraction: {\n id: {\n $eq: aiInteractionId\n }\n }\n }\n });\n\n const genAiInteraction = genAiInteractions['records'][0];\n this.logger.debug(genAiInteraction.message);\n\n this.logger.debug(`identified gen-ai interaction with id=${genAiInteraction.id}`);\n this.logger.debug(`proceeding with applying the gen-ai interaction`)\n\n return {\n mcpPong: 'v1.0.2',\n genAiInteraction: {\n status: genAiInteraction.status,\n errorCode: genAiInteraction.status === 'failed' ? this.errorMapper.mapMessage(genAiInteraction.errorMessage, genAiInteraction.metadata) : '',\n errorMessage: genAiInteraction.errorMessage,\n }\n };\n }\n\n @Public()\n @SkipThrottle({ short: false, login: true, burst: true, sustained: true }) //Enable the short throttle only\n @Post('seed')\n async seedData(@Body() seedData: any) {\n const seeder = this.solidRegistry\n .getSeeders()\n .filter((seeder) => seeder.name === seedData.seeder)\n .map((seeder) => seeder.instance)\n .pop();\n if (!seeder) {\n this.logger.error(`Seeder service ${seedData.seeder} not found. Does your service have a seed() method?`);\n return;\n }\n this.logger.log(`Running the seed() method for seeder :${seeder.constructor.name}`);\n await seeder.seed();\n return { message: `seed data for ${seedData.seeder}` };\n }\n\n // @Public()\n // @Get('play')\n // play() {\n // return this.solidRegistry.getControllers();\n // }\n\n // //This method identifies a provider as a seeder if it has a seed method i.e duck typing\n // private isSeeder(provider: InstanceWrapper) {\n // const { instance } = provider;\n // if (!instance) return false;\n\n // const seedMethod = this.metadataScanner\n // .getAllMethodNames(Object.getPrototypeOf(instance))\n // .find((methodName) => methodName === 'seed');\n // if (!seedMethod) return false;\n // return true;\n // }\n\n}\n"]}
1
+ {"version":3,"file":"service.controller.js","sourceRoot":"","sources":["../../src/controllers/service.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAqE;AACrE,6CAAyD;AACzD,+EAAkE;AAClE,qEAAyD;AACzD,0EAAsE;AAEtE,+EAA2E;AAC3E,uEAAmE;AACnE,8DAA0D;AAOnD,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAG1B,YACqB,aAA4B,EAC5B,oBAA0C,EAC1C,gBAAkC,EAClC,WAA+B;QAH/B,kBAAa,GAAb,aAAa,CAAe;QAC5B,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,gBAAW,GAAX,WAAW,CAAoB;QANnC,WAAM,GAAG,IAAI,eAAM,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,IAAA,YAAG,EAAC,MAAM,CAAC;;;;;iDAGX;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,YAAG,EAAC,UAAU,CAAC;;IACG,WAAA,IAAA,kCAAU,GAAE,CAAA;;;;oDAoD9B;AAKK;IAHL,IAAA,yBAAM,GAAE;IAER,IAAA,aAAI,EAAC,MAAM,CAAC;;IACG,WAAA,IAAA,aAAI,GAAE,CAAA;;;;iDAarB;4BAxFQ,iBAAiB;IAJ7B,IAAA,mBAAU,EAAC,EAAE,CAAC;IACd,IAAA,iBAAO,EAAC,QAAQ,CAAC;qCAOsB,8BAAa;QACN,6CAAoB;QACxB,qCAAgB;QACrB,yCAAkB;GAP3C,iBAAiB,CA4G7B","sourcesContent":["import { Body, Controller, Get, Logger, Post } from '@nestjs/common';\nimport { ApiBearerAuth, ApiTags } from '@nestjs/swagger';\nimport { ActiveUser } from 'src/decorators/active-user.decorator';\nimport { Public } from 'src/decorators/public.decorator';\nimport { ErrorMapperService } from 'src/helpers/error-mapper.service';\nimport { ActiveUserData } from 'src/interfaces/active-user-data.interface';\nimport { AiInteractionService } from 'src/services/ai-interaction.service';\nimport { MqMessageService } from 'src/services/mq-message.service';\nimport { SolidRegistry } from '../helpers/solid-registry';\n\n\n@Controller('')\n@ApiTags(\"Common\")\n// @UseGuards(ThrottlerGuard)\n// @SkipThrottle({ short: true, login: true, burst: true, sustained: true }) // Skip all\nexport class ServiceController {\n private readonly logger = new Logger(ServiceController.name);\n\n constructor(\n private readonly solidRegistry: SolidRegistry,\n private readonly aiInteractionService: AiInteractionService,\n private readonly mqMessageService: MqMessageService,\n private readonly errorMapper: ErrorMapperService\n ) { }\n\n @Public()\n @Get('ping')\n pingPong() {\n return { pong: 'v1.0.2' };\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get('mcp/ping')\n async mcpPingPong(@ActiveUser() activeUser: ActiveUserData) {\n // TODO: do a MCP client invocation, wait for response and return.\n // If failure then decide shape to return.\n\n const threadId = `pingPongTxn-${activeUser.sub}`;\n\n const { queueMessageId, aiInteractionId } = await this.aiInteractionService.triggerMcpClientJob(\n `Can you do 1 + 1`,\n activeUser.sub,\n true,\n threadId\n );\n\n this.logger.debug(`mcp ping pong job triggered: queueMessageId=${queueMessageId}, aiInteractionId=${aiInteractionId}`);\n\n // Wait up to 2 minutes, start at 500ms poll, back off to max 2s, throw if failed:\n const result = await this.mqMessageService.waitForTerminalStatus(queueMessageId, {\n timeoutMs: 2 * 60 * 1000,\n intervalMs: 500,\n maxIntervalMs: 2000,\n throwOnFailure: false,\n });\n\n this.logger.debug(`mcp ping pong job finished with stage=${result.stage}`)\n\n this.logger.debug(`mcp ping pong trying to find genai (child) interaction for aiInteraction for id=${aiInteractionId}`)\n\n // @ts-ignore\n const genAiInteractions = await this.aiInteractionService.find({\n filters: {\n parentInteraction: {\n id: {\n $eq: aiInteractionId\n }\n }\n }\n });\n\n const genAiInteraction = genAiInteractions['records'][0];\n this.logger.debug(genAiInteraction.message);\n\n this.logger.debug(`identified gen-ai interaction with id=${genAiInteraction.id}`);\n this.logger.debug(`proceeding with applying the gen-ai interaction`)\n\n return {\n mcpPong: 'v1.0.2',\n genAiInteraction: {\n status: genAiInteraction.status,\n errorCode: genAiInteraction.status === 'failed' ? this.errorMapper.mapMessage(genAiInteraction.errorMessage, genAiInteraction.metadata) : '',\n errorMessage: genAiInteraction.errorMessage,\n }\n };\n }\n\n @Public()\n // @SkipThrottle({ short: false, login: true, burst: true, sustained: true }) //Enable the short throttle only\n @Post('seed')\n async seedData(@Body() seedData: any) {\n const seeder = this.solidRegistry\n .getSeeders()\n .filter((seeder) => seeder.name === seedData.seeder)\n .map((seeder) => seeder.instance)\n .pop();\n if (!seeder) {\n this.logger.error(`Seeder service ${seedData.seeder} not found. Does your service have a seed() method?`);\n return;\n }\n this.logger.log(`Running the seed() method for seeder :${seeder.constructor.name}`);\n await seeder.seed();\n return { message: `seed data for ${seedData.seeder}` };\n }\n\n // @Public()\n // @Get('play')\n // play() {\n // return this.solidRegistry.getControllers();\n // }\n\n // //This method identifies a provider as a seeder if it has a seed method i.e duck typing\n // private isSeeder(provider: InstanceWrapper) {\n // const { instance } = provider;\n // if (!instance) return false;\n\n // const seedMethod = this.metadataScanner\n // .getAllMethodNames(Object.getPrototypeOf(instance))\n // .find((methodName) => methodName === 'seed');\n // if (!seedMethod) return false;\n // return true;\n // }\n\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sms-template.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/sms-template.controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAGtE,qBAIa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,kBAAkB;IAKtD,MAAM,CAAS,SAAS,EAAE,oBAAoB,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAOlG,UAAU,CAAS,UAAU,EAAE,oBAAoB,EAAE,EAAmB,UAAU,GAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAO;IAOhH,MAAM,CAAc,EAAE,EAAE,MAAM,EAAU,SAAS,EAAE,oBAAoB,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAgBrH,QAAQ,CAAU,KAAK,EAAE,GAAG;;;;;;;;;;;;;;;;;;;;IAM5B,OAAO,CAAc,EAAE,EAAE,MAAM,EAAW,KAAK,EAAE,GAAG;IAKpD,UAAU,CAAS,GAAG,EAAE,MAAM,EAAE;IAMhC,MAAM,CAAc,EAAE,EAAE,MAAM;CAGvC"}
1
+ {"version":3,"file":"sms-template.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/sms-template.controller.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAGtE,qBAIa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,kBAAkB;IAKtD,MAAM,CAAS,SAAS,EAAE,oBAAoB,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAOlG,UAAU,CAAS,UAAU,EAAE,oBAAoB,EAAE,EAAmB,UAAU,GAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAO;IAOhH,MAAM,CAAc,EAAE,EAAE,MAAM,EAAU,SAAS,EAAE,oBAAoB,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAgBrH,QAAQ,CAAU,KAAK,EAAE,GAAG;;;;;;;;;;;;;;;;;;;;IAM5B,OAAO,CAAc,EAAE,EAAE,MAAM,EAAW,KAAK,EAAE,GAAG;IAKpD,UAAU,CAAS,GAAG,EAAE,MAAM,EAAE;IAMhC,MAAM,CAAc,EAAE,EAAE,MAAM;CAGvC"}
@@ -17,7 +17,6 @@ const openapi = require("@nestjs/swagger");
17
17
  const common_1 = require("@nestjs/common");
18
18
  const platform_express_1 = require("@nestjs/platform-express");
19
19
  const swagger_1 = require("@nestjs/swagger");
20
- const throttler_1 = require("@nestjs/throttler");
21
20
  const public_decorator_1 = require("../decorators/public.decorator");
22
21
  const create_sms_template_dto_1 = require("../dtos/create-sms-template.dto");
23
22
  const update_sms_template_dto_1 = require("../dtos/update-sms-template.dto");
@@ -132,8 +131,6 @@ __decorate([
132
131
  exports.SmsTemplateController = SmsTemplateController = __decorate([
133
132
  (0, common_1.Controller)('sms-template'),
134
133
  (0, swagger_1.ApiTags)("Common"),
135
- (0, common_1.UseGuards)(throttler_1.ThrottlerGuard),
136
- (0, throttler_1.SkipThrottle)({ short: false, login: true, burst: true, sustained: true }),
137
134
  __metadata("design:paramtypes", [sms_template_service_1.SmsTemplateService])
138
135
  ], SmsTemplateController);
139
136
  //# sourceMappingURL=sms-template.controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sms-template.controller.js","sourceRoot":"","sources":["../../src/controllers/sms-template.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAmI;AACnI,+DAA+D;AAC/D,6CAAoD;AACpD,iDAAiE;AACjE,qEAAyD;AACzD,6EAAuE;AACvE,6EAAuE;AACvE,2EAAsE;AAO/D,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,YAA6B,OAA2B;QAA3B,YAAO,GAAP,OAAO,CAAoB;IAAI,CAAC;IAK3D,MAAM,CAAS,SAA+B,EAAmB,KAAiC;QAChG,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAKD,UAAU,CAAS,UAAkC,EAAmB,aAAsC,EAAE;QAC9G,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACzD,CAAC;IAKD,MAAM,CAAc,EAAU,EAAU,SAA+B,EAAmB,KAAiC;QACzH,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;IAcK,AAAN,KAAK,CAAC,QAAQ,CAAU,KAAU;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAIK,AAAN,KAAK,CAAC,OAAO,CAAc,EAAU,EAAW,KAAU;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAGK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IK;IAFL,IAAA,yBAAM,GAAE;IACR,IAAA,eAAM,EAAC,KAAK,CAAC;;IACA,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;mDAExB;gCAvDQ,qBAAqB;IAJjC,IAAA,mBAAU,EAAC,cAAc,CAAC;IAC1B,IAAA,iBAAO,EAAC,QAAQ,CAAC;IACjB,IAAA,kBAAS,EAAC,0BAAc,CAAC;IACzB,IAAA,wBAAY,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;qCAElC,yCAAkB;GAD7C,qBAAqB,CAwDjC","sourcesContent":["import { Body, Controller, Delete, Get, Param, Post, Put, Query, UploadedFiles, UseGuards, UseInterceptors } from '@nestjs/common';\nimport { AnyFilesInterceptor } from '@nestjs/platform-express';\nimport { ApiQuery, ApiTags } from '@nestjs/swagger';\nimport { SkipThrottle, ThrottlerGuard } from '@nestjs/throttler';\nimport { Public } from 'src/decorators/public.decorator';\nimport { CreateSmsTemplateDto } from '../dtos/create-sms-template.dto';\nimport { UpdateSmsTemplateDto } from '../dtos/update-sms-template.dto';\nimport { SmsTemplateService } from '../services/sms-template.service';\n\n\n@Controller('sms-template')\n@ApiTags(\"Common\")\n@UseGuards(ThrottlerGuard)\n@SkipThrottle({ short: false, login: true, burst: true, sustained: true }) //Enable the short throttle only\nexport class SmsTemplateController {\n constructor(private readonly service: SmsTemplateService) { }\n\n @Public()\n @Post()\n @UseInterceptors(AnyFilesInterceptor())\n create(@Body() createDto: CreateSmsTemplateDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.create(createDto, files);\n }\n \n @Public()\n @Post('/bulk')\n @UseInterceptors(AnyFilesInterceptor())\n insertMany(@Body() createDtos: CreateSmsTemplateDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {\n return this.service.insertMany(createDtos, filesArray);\n }\n \n @Public()\n @Put(':id')\n @UseInterceptors(AnyFilesInterceptor())\n update(@Param('id') id: number, @Body() updateDto: UpdateSmsTemplateDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files);\n }\n \n @Public()\n @ApiQuery({ name: 'showSoftDeleted', required: false, type: Boolean })\n @ApiQuery({ name: 'showOnlySoftDeleted', required: false, type: Boolean })\n @ApiQuery({ name: 'limit', required: false, type: Number })\n @ApiQuery({ name: 'offset', required: false, type: Number })\n @ApiQuery({ name: 'fields', required: false, type: Array })\n @ApiQuery({ name: 'sort', required: false, type: Array })\n @ApiQuery({ name: 'groupBy', required: false, type: Array })\n @ApiQuery({ name: 'populate', required: false, type: Array })\n @ApiQuery({ name: 'populateMedia', required: false, type: Array })\n @ApiQuery({ name: 'filters', required: false, type: Array })\n @Get()\n async findMany(@Query() query: any) {\n return this.service.find(query);\n }\n \n @Public()\n @Get(':id')\n async findOne(@Param('id') id: string, @Query() query: any) {\n return this.service.findOne(+id, query);\n }\n \n @Delete('/bulk')\n async deleteMany(@Body() ids: number[]) {\n return this.service.deleteMany(ids);\n }\n \n @Public()\n @Delete(':id')\n async delete(@Param('id') id: number) {\n return this.service.delete(id);\n }\n}\n"]}
1
+ {"version":3,"file":"sms-template.controller.js","sourceRoot":"","sources":["../../src/controllers/sms-template.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwH;AACxH,+DAA+D;AAC/D,6CAAoD;AACpD,qEAAyD;AACzD,6EAAuE;AACvE,6EAAuE;AACvE,2EAAsE;AAO/D,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,YAA6B,OAA2B;QAA3B,YAAO,GAAP,OAAO,CAAoB;IAAI,CAAC;IAK3D,MAAM,CAAS,SAA+B,EAAmB,KAAiC;QAChG,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAKD,UAAU,CAAS,UAAkC,EAAmB,aAAsC,EAAE;QAC9G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AAI,EAAE,eAAe,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACjE,IAAA,kBAAQ,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAC3D,IAAA,YAAG,GAAE;;IACU,WAAA,IAAA,cAAK,GAAE,CAAA;;;;qDAEtB;AAIK;IAFL,IAAA,yBAAM,GAAE;IACR,IAAA,YAAG,EAAC,KAAK,CAAC;;IACI,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,cAAK,GAAE,CAAA;;;;oDAE9C;AAGK;IADL,IAAA,eAAM,EAAC,OAAO,CAAC;;IACE,WAAA,IAAA,aAAI,GAAE,CAAA;;;;uDAEvB;AAIK;IAFL,IAAA,yBAAM,GAAE;IACR,IAAA,eAAM,EAAC,KAAK,CAAC;;IACA,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;mDAExB;gCAvDQ,qBAAqB;IAJjC,IAAA,mBAAU,EAAC,cAAc,CAAC;IAC1B,IAAA,iBAAO,EAAC,QAAQ,CAAC;qCAIsB,yCAAkB;GAD7C,qBAAqB,CAwDjC","sourcesContent":["import { Body, Controller, Delete, Get, Param, Post, Put, Query, UploadedFiles, UseInterceptors } from '@nestjs/common';\nimport { AnyFilesInterceptor } from '@nestjs/platform-express';\nimport { ApiQuery, ApiTags } from '@nestjs/swagger';\nimport { Public } from 'src/decorators/public.decorator';\nimport { CreateSmsTemplateDto } from '../dtos/create-sms-template.dto';\nimport { UpdateSmsTemplateDto } from '../dtos/update-sms-template.dto';\nimport { SmsTemplateService } from '../services/sms-template.service';\n\n\n@Controller('sms-template')\n@ApiTags(\"Common\")\n// @UseGuards(ThrottlerGuard)\n// @SkipThrottle({ short: false, login: true, burst: true, sustained: true }) //Enable the short throttle only\nexport class SmsTemplateController {\n constructor(private readonly service: SmsTemplateService) { }\n\n @Public()\n @Post()\n @UseInterceptors(AnyFilesInterceptor())\n create(@Body() createDto: CreateSmsTemplateDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.create(createDto, files);\n }\n \n @Public()\n @Post('/bulk')\n @UseInterceptors(AnyFilesInterceptor())\n insertMany(@Body() createDtos: CreateSmsTemplateDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {\n return this.service.insertMany(createDtos, filesArray);\n }\n \n @Public()\n @Put(':id')\n @UseInterceptors(AnyFilesInterceptor())\n update(@Param('id') id: number, @Body() updateDto: UpdateSmsTemplateDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files);\n }\n \n @Public()\n @ApiQuery({ name: 'showSoftDeleted', required: false, type: Boolean })\n @ApiQuery({ name: 'showOnlySoftDeleted', required: false, type: Boolean })\n @ApiQuery({ name: 'limit', required: false, type: Number })\n @ApiQuery({ name: 'offset', required: false, type: Number })\n @ApiQuery({ name: 'fields', required: false, type: Array })\n @ApiQuery({ name: 'sort', required: false, type: Array })\n @ApiQuery({ name: 'groupBy', required: false, type: Array })\n @ApiQuery({ name: 'populate', required: false, type: Array })\n @ApiQuery({ name: 'populateMedia', required: false, type: Array })\n @ApiQuery({ name: 'filters', required: false, type: Array })\n @Get()\n async findMany(@Query() query: any) {\n return this.service.find(query);\n }\n \n @Public()\n @Get(':id')\n async findOne(@Param('id') id: string, @Query() query: any) {\n return this.service.findOne(+id, query);\n }\n \n @Delete('/bulk')\n async deleteMany(@Body() ids: number[]) {\n return this.service.deleteMany(ids);\n }\n \n @Public()\n @Delete(':id')\n async delete(@Param('id') id: number) {\n return this.service.delete(id);\n }\n}\n"]}
@@ -32,5 +32,8 @@ export declare class User extends CommonEntity {
32
32
  customPayload: string;
33
33
  roles: RoleMetadata[];
34
34
  userViewMetadata: UserViewMetadata[];
35
+ passwordScheme: string;
36
+ passwordSchemeVersion: number;
37
+ rehashedAt: Date;
35
38
  }
36
39
  //# sourceMappingURL=user.entity.d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,aAAa,EAAE,MAAM,CAAC;IAItB,KAAK,EAAE,YAAY,EAAE,CAAC;IAGtB,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;IAGrC,cAAc,EAAE,MAAM,CAAC;IAGvB,qBAAqB,EAAE,MAAM,CAAC;IAG9B,UAAU,EAAE,IAAI,CAAC;CACpB"}
@@ -24,7 +24,7 @@ let User = class User extends common_entity_1.CommonEntity {
24
24
  this.active = true;
25
25
  }
26
26
  static _OPENAPI_METADATA_FACTORY() {
27
- return { fullName: { required: true, type: () => String }, username: { required: true, type: () => String }, email: { required: true, type: () => String }, mobile: { required: true, type: () => String }, password: { required: true, type: () => String }, forcePasswordChange: { required: true, type: () => Boolean, default: true }, lastLoginProvider: { required: true, type: () => String, default: "local" }, accessCode: { required: true, type: () => String }, googleAccessToken: { required: true, type: () => String }, googleId: { required: true, type: () => String }, googleProfilePicture: { required: true, type: () => String }, active: { required: true, type: () => Boolean, default: true }, forgotPasswordConfirmedAt: { required: true, type: () => Date }, verificationTokenOnForgotPassword: { required: true, type: () => String }, verificationTokenOnForgotPasswordExpiresAt: { required: true, type: () => Date }, emailVerifiedOnRegistrationAt: { required: true, type: () => Date }, emailVerificationTokenOnRegistration: { required: true, type: () => String }, emailVerificationTokenOnRegistrationExpiresAt: { required: true, type: () => Date }, mobileVerifiedOnRegistrationAt: { required: true, type: () => Date }, mobileVerificationTokenOnRegistration: { required: true, type: () => String }, mobileVerificationTokenOnRegistrationExpiresAt: { required: true, type: () => Date }, emailVerifiedOnLoginAt: { required: true, type: () => Date }, emailVerificationTokenOnLogin: { required: true, type: () => String }, emailVerificationTokenOnLoginExpiresAt: { required: true, type: () => Date }, mobileVerifiedOnLoginAt: { required: true, type: () => Date }, mobileVerificationTokenOnLogin: { required: true, type: () => String }, mobileVerificationTokenOnLoginExpiresAt: { required: true, type: () => Date }, customPayload: { required: true, type: () => String }, roles: { required: true, type: () => [require("./role-metadata.entity").RoleMetadata] }, userViewMetadata: { required: true, type: () => [require("./user-view-metadata.entity").UserViewMetadata] } };
27
+ return { fullName: { required: true, type: () => String }, username: { required: true, type: () => String }, email: { required: true, type: () => String }, mobile: { required: true, type: () => String }, password: { required: true, type: () => String }, forcePasswordChange: { required: true, type: () => Boolean, default: true }, lastLoginProvider: { required: true, type: () => String, default: "local" }, accessCode: { required: true, type: () => String }, googleAccessToken: { required: true, type: () => String }, googleId: { required: true, type: () => String }, googleProfilePicture: { required: true, type: () => String }, active: { required: true, type: () => Boolean, default: true }, forgotPasswordConfirmedAt: { required: true, type: () => Date }, verificationTokenOnForgotPassword: { required: true, type: () => String }, verificationTokenOnForgotPasswordExpiresAt: { required: true, type: () => Date }, emailVerifiedOnRegistrationAt: { required: true, type: () => Date }, emailVerificationTokenOnRegistration: { required: true, type: () => String }, emailVerificationTokenOnRegistrationExpiresAt: { required: true, type: () => Date }, mobileVerifiedOnRegistrationAt: { required: true, type: () => Date }, mobileVerificationTokenOnRegistration: { required: true, type: () => String }, mobileVerificationTokenOnRegistrationExpiresAt: { required: true, type: () => Date }, emailVerifiedOnLoginAt: { required: true, type: () => Date }, emailVerificationTokenOnLogin: { required: true, type: () => String }, emailVerificationTokenOnLoginExpiresAt: { required: true, type: () => Date }, mobileVerifiedOnLoginAt: { required: true, type: () => Date }, mobileVerificationTokenOnLogin: { required: true, type: () => String }, mobileVerificationTokenOnLoginExpiresAt: { required: true, type: () => Date }, customPayload: { required: true, type: () => String }, roles: { required: true, type: () => [require("./role-metadata.entity").RoleMetadata] }, userViewMetadata: { required: true, type: () => [require("./user-view-metadata.entity").UserViewMetadata] }, passwordScheme: { required: true, type: () => String }, passwordSchemeVersion: { required: true, type: () => Number }, rehashedAt: { required: true, type: () => Date } };
28
28
  }
29
29
  };
30
30
  exports.User = User;
@@ -160,6 +160,18 @@ __decorate([
160
160
  (0, typeorm_1.OneToMany)(() => user_view_metadata_entity_1.UserViewMetadata, userViewMetadata => userViewMetadata.user, { cascade: true }),
161
161
  __metadata("design:type", Array)
162
162
  ], User.prototype, "userViewMetadata", void 0);
163
+ __decorate([
164
+ (0, typeorm_1.Column)({ type: "varchar", default: "bcrypt" }),
165
+ __metadata("design:type", String)
166
+ ], User.prototype, "passwordScheme", void 0);
167
+ __decorate([
168
+ (0, typeorm_1.Column)({ type: "int", default: 1 }),
169
+ __metadata("design:type", Number)
170
+ ], User.prototype, "passwordSchemeVersion", void 0);
171
+ __decorate([
172
+ (0, typeorm_1.Column)({ type: "timestamp", nullable: true }),
173
+ __metadata("design:type", Date)
174
+ ], User.prototype, "rehashedAt", void 0);
163
175
  exports.User = User = __decorate([
164
176
  (0, typeorm_1.Entity)("ss_user"),
165
177
  (0, typeorm_1.TableInheritance)({ column: { type: "varchar", name: "type", default: "User" } }),
@@ -1 +1 @@
1
- {"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAyD;AACzD,qCAAoG;AACpG,iEAAiE;AACjE,2EAAyE;AACzE,yDAAoD;AAK7C,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,4BAAY;IAA/B;;QAqBH,wBAAmB,GAAY,IAAI,CAAC;QAGpC,sBAAiB,GAAW,OAAO,CAAC;QAepC,WAAM,GAAY,IAAI,CAAC;KAwD1B;;2UA1EkC,IAAI,wWAkBjB,IAAI;;CAwDzB,CAAA;AA/FY,oBAAI;AAGb;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,0BAAM,GAAE;;sCACQ;AAIjB;IAHC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,0BAAM,GAAE;;sCACQ;AAIjB;IAHC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,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AAI,EAAE,CAAC;8BAEN,IAAI;oEAAC;AAG7C;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAErB,IAAI;qDAAC;AAG9B;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DAEL;AAGvC;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAEL,IAAI;qEAAC;AAG9C;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,0BAAM,GAAE;;2CACa;AAItB;IAHC,IAAA,oBAAU,EAAC,GAAG,EAAE,CAAC,mCAAY,EAAE,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACrF,IAAA,mBAAS,GAAE;IACX,IAAA,0BAAM,GAAE;;mCACa;AAGtB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,4CAAgB,EAAE,gBAAgB,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;8CAE3D;eA9F5B,IAAI;IAHhB,IAAA,gBAAM,EAAC,SAAS,CAAC;IACjB,IAAA,0BAAgB,EAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IAChF,IAAA,2BAAO,GAAE;GACG,IAAI,CA+FhB","sourcesContent":["import { CommonEntity } from \"src/entities/common.entity\"\nimport { Entity, Column, Index, JoinTable, ManyToMany, OneToMany, TableInheritance } from \"typeorm\";\nimport { RoleMetadata } from 'src/entities/role-metadata.entity';\nimport { UserViewMetadata } from 'src/entities/user-view-metadata.entity'\nimport { Exclude, Expose } from \"class-transformer\";\n\n@Entity(\"ss_user\")\n@TableInheritance({ column: { type: \"varchar\", name: \"type\", default: \"User\" } })\n@Exclude()\nexport class User extends CommonEntity {\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n fullName: string; \n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n @Expose()\n username: string;\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n email: string;\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n mobile: string;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n password: string;\n @Column({ type: \"boolean\", nullable: true, default: true })\n @Expose()\n forcePasswordChange: boolean = true;\n @Column({ type: \"varchar\", default: \"local\" })\n // don't send to client\n lastLoginProvider: string = \"local\";\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client (test)\n accessCode: string;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n googleAccessToken: string;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n googleId: string;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n googleProfilePicture: string;\n @Column({ type: \"boolean\", default: true })\n @Expose()\n active: boolean = true;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n forgotPasswordConfirmedAt: Date;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n verificationTokenOnForgotPassword: string;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n verificationTokenOnForgotPasswordExpiresAt: Date;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n emailVerifiedOnRegistrationAt: Date;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n emailVerificationTokenOnRegistration: string;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n emailVerificationTokenOnRegistrationExpiresAt: Date;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n mobileVerifiedOnRegistrationAt: Date;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n mobileVerificationTokenOnRegistration: string;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n mobileVerificationTokenOnRegistrationExpiresAt: Date;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n emailVerifiedOnLoginAt: Date;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n emailVerificationTokenOnLogin: string;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n emailVerificationTokenOnLoginExpiresAt: Date;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n mobileVerifiedOnLoginAt: Date;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n mobileVerificationTokenOnLogin: string;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n mobileVerificationTokenOnLoginExpiresAt: Date;\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n customPayload: string;\n @ManyToMany(() => RoleMetadata, roleMetadata => roleMetadata.users, { cascade: true })\n @JoinTable()\n @Expose()\n roles: RoleMetadata[];\n @OneToMany(() => UserViewMetadata, userViewMetadata => userViewMetadata.user, { cascade: true })\n // don't send to client\n userViewMetadata: UserViewMetadata[];\n}"]}
1
+ {"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAyD;AACzD,qCAAoG;AACpG,iEAAiE;AACjE,2EAAyE;AACzE,yDAAoD;AAK7C,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,4BAAY;IAA/B;;QAqBH,wBAAmB,GAAY,IAAI,CAAC;QAGpC,sBAAiB,GAAW,OAAO,CAAC;QAepC,WAAM,GAAY,IAAI,CAAC;KAiE1B;;2UAnFkC,IAAI,wWAkBjB,IAAI;;CAiEzB,CAAA;AAxGY,oBAAI;AAGb;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAA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AC;;4CACxB;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mDACN;AAG9B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAClC,IAAI;wCAAC;eAvGR,IAAI;IAHhB,IAAA,gBAAM,EAAC,SAAS,CAAC;IACjB,IAAA,0BAAgB,EAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IAChF,IAAA,2BAAO,GAAE;GACG,IAAI,CAwGhB","sourcesContent":["import { CommonEntity } from \"src/entities/common.entity\"\nimport { Entity, Column, Index, JoinTable, ManyToMany, OneToMany, TableInheritance } from \"typeorm\";\nimport { RoleMetadata } from 'src/entities/role-metadata.entity';\nimport { UserViewMetadata } from 'src/entities/user-view-metadata.entity'\nimport { Exclude, Expose } from \"class-transformer\";\n\n@Entity(\"ss_user\")\n@TableInheritance({ column: { type: \"varchar\", name: \"type\", default: \"User\" } })\n@Exclude()\nexport class User extends CommonEntity {\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n fullName: string; \n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n @Expose()\n username: string;\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n email: string;\n @Index({ unique: true })\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n mobile: string;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n password: string;\n @Column({ type: \"boolean\", nullable: true, default: true })\n @Expose()\n forcePasswordChange: boolean = true;\n @Column({ type: \"varchar\", default: \"local\" })\n // don't send to client\n lastLoginProvider: string = \"local\";\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client (test)\n accessCode: string;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n googleAccessToken: string;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n googleId: string;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n googleProfilePicture: string;\n @Column({ type: \"boolean\", default: true })\n @Expose()\n active: boolean = true;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n forgotPasswordConfirmedAt: Date;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n verificationTokenOnForgotPassword: string;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n verificationTokenOnForgotPasswordExpiresAt: Date;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n emailVerifiedOnRegistrationAt: Date;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n emailVerificationTokenOnRegistration: string;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n emailVerificationTokenOnRegistrationExpiresAt: Date;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n mobileVerifiedOnRegistrationAt: Date;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n mobileVerificationTokenOnRegistration: string;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n mobileVerificationTokenOnRegistrationExpiresAt: Date;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n emailVerifiedOnLoginAt: Date;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n emailVerificationTokenOnLogin: string;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n emailVerificationTokenOnLoginExpiresAt: Date;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n mobileVerifiedOnLoginAt: Date;\n @Column({ type: \"varchar\", nullable: true })\n // don't send to client\n mobileVerificationTokenOnLogin: string;\n @Column({ type: \"timestamp\", nullable: true })\n // don't send to client\n mobileVerificationTokenOnLoginExpiresAt: Date;\n @Column({ type: \"varchar\", nullable: true })\n @Expose()\n customPayload: string;\n @ManyToMany(() => RoleMetadata, roleMetadata => roleMetadata.users, { cascade: true })\n @JoinTable()\n @Expose()\n roles: RoleMetadata[];\n @OneToMany(() => UserViewMetadata, userViewMetadata => userViewMetadata.user, { cascade: true })\n // don't send to client\n userViewMetadata: UserViewMetadata[];\n // dont send to client\n @Column({ type: \"varchar\", default: \"bcrypt\" })\n passwordScheme: string;\n // dont send to client\n @Column({ type: \"int\", default: 1 })\n passwordSchemeVersion: number;\n // dont send to client\n @Column({ type: \"timestamp\", nullable: true })\n rehashedAt: Date;\n}"]}
@@ -28,7 +28,7 @@ let HttpExceptionFilter = HttpExceptionFilter_1 = class HttpExceptionFilter {
28
28
  const explicitStatus = isHttp ? exception.getStatus() : undefined;
29
29
  const code = this.errorMapper.mapException(exception);
30
30
  const defaultStatus = this.errorMapper.getHttpStatus(code);
31
- const message = code === 'unknown-error' ? `${exception?.message}` : this.errorMapper.getMessage(code);
31
+ const message = code === 'solidx-unknown-error' ? `${exception?.message}` : this.errorMapper.getMessage(code);
32
32
  const status = explicitStatus ?? defaultStatus ?? 500;
33
33
  this.logger.error(`[${status} ${logging_interceptor_1.HttpStatusCodeMessages[status] || 'Internal Server Error'}] ${request?.method} ${request?.url} - ${exception?.message || message} [code=${code}]`);
34
34
  if (exception?.stack) {
@@ -1 +1 @@
1
- {"version":3,"file":"http-exception.filter.js","sourceRoot":"","sources":["../../src/filters/http-exception.filter.ts"],"names":[],"mappings":";;;;;;;;;;;;;AACA,2CAOwB;AAExB,6EAA6E;AAC7E,0EAAsE;AAM/D,IAAM,mBAAmB,2BAAzB,MAAM,mBAAmB;IAG5B,YAA6B,WAA+B;QAA/B,gBAAW,GAAX,WAAW,CAAoB;QAF3C,WAAM,GAAG,IAAI,eAAM,CAAC,qBAAmB,CAAC,IAAI,CAAC,CAAC;QAG3D,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,SAAc,EAAE,IAAmB;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,GAAG,CA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O,EAAE,OAAO;YAChB,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,OAAO;YAGd,IAAI,EAAE,KAAK;SACd,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAjDY,kDAAmB;8BAAnB,mBAAmB;IAF/B,IAAA,cAAK,GAAE;IACP,IAAA,mBAAU,GAAE;qCAIiC,yCAAkB;GAHnD,mBAAmB,CAiD/B","sourcesContent":["// src/common/filters/http-exception.filter.ts\nimport {\n ExceptionFilter,\n Catch,\n ArgumentsHost,\n Logger,\n Injectable,\n HttpException,\n} from '@nestjs/common';\nimport { Response, Request } from 'express';\nimport { HttpStatusCodeMessages } from '../interceptors/logging.interceptor';\nimport { ErrorMapperService } from 'src/helpers/error-mapper.service';\nimport { ErrorCode } from 'src/interfaces';\n\n\n@Catch()\n@Injectable()\nexport class HttpExceptionFilter implements ExceptionFilter {\n private readonly logger = new Logger(HttpExceptionFilter.name);\n\n constructor(private readonly errorMapper: ErrorMapperService) {\n this.logger.debug('HttpExceptionFilter initialized');\n }\n\n catch(exception: any, host: ArgumentsHost) {\n const ctx = host.switchToHttp();\n const response = ctx.getResponse<Response>();\n const request = ctx.getRequest<Request>();\n\n const isHttp = exception instanceof HttpException;\n const explicitStatus = isHttp ? exception.getStatus() : undefined;\n\n // Canonical code + static message\n const code: ErrorCode = this.errorMapper.mapException(exception);\n const defaultStatus = this.errorMapper.getHttpStatus(code);\n const message = code === 'unknown-error' ? `${exception?.message}` : this.errorMapper.getMessage(code);\n\n const status = explicitStatus ?? defaultStatus ?? 500;\n\n // Logging\n this.logger.error(\n `[${status} ${HttpStatusCodeMessages[status] || 'Internal Server Error'}] ${request?.method} ${request?.url} - ${exception?.message || message} [code=${code}]`,\n );\n if (exception?.stack) {\n this.logger.error(exception.stack);\n }\n\n // Preserve any extra data the exception carried (optional)\n const extra =\n (isHttp && (exception.getResponse?.() as any)) ??\n exception?.response ??\n {};\n\n // Keep your legacy shape; add canonical code\n response.status(status).json({\n statusCode: status,\n statusCodeMessage: HttpStatusCodeMessages[status] || 'Internal Server Error',\n // Keeping this for backward compatibility..\n message: message,\n errorCode: code,\n error: message,\n // We can make this conditional based on whether we are running in prod mode or dev mode...\n // errorStack: exception.stack,\n data: extra,\n });\n }\n}"]}
1
+ {"version":3,"file":"http-exception.filter.js","sourceRoot":"","sources":["../../src/filters/http-exception.filter.ts"],"names":[],"mappings":";;;;;;;;;;;;;AACA,2CAOwB;AAExB,6EAA6E;AAC7E,0EAAsE;AAM/D,IAAM,mBAAmB,2BAAzB,MAAM,mBAAmB;IAG5B,YAA6B,WAA+B;QAA/B,gBAAW,GAAX,WAAW,CAAoB;QAF3C,WAAM,GAAG,IAAI,eAAM,CAAC,qBAAmB,CAAC,IAAI,CAAC,CAAC;QAG3D,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,SAAc,EAAE,IAAmB;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAY,CAAC;QAC7C,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,EAAW,CAAC;QAE1C,MAAM,MAAM,GAAG,SAAS,YAAY,sBAAa,CAAC;QAClD,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAGlE,MAAM,IAAI,GAAc,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACjE,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC3D,MAAM,OAAO,GAAG,IAAI,KAAK,sBAAsB,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAE9G,MAAM,MAAM,GAAG,cAAc,IAAI,aAAa,IAAI,GAAG,CAAC;QAGtD,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,IAAI,MAAM,IAAI,4CAAsB,CAAC,MAAM,CAAC,IAAI,uBAAuB,KAAK,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,GAAG,MAAM,SAAS,EAAE,OAAO,IAAI,OAAO,UAAU,IAAI,GAAG,CAClK,CAAC;QACF,IAAI,SAAS,EAAE,KAAK,EAAE,CAAC;YACnB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;QAGD,MAAM,KAAK,GACP,CAAC,MAAM,IAAK,SAAS,CAAC,WAAW,EAAE,EAAU,CAAC;YAC9C,SAAS,EAAE,QAAQ;YACnB,EAAE,CAAC;QAGP,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;YACzB,UAAU,EAAE,MAAM;YAClB,iBAAiB,EAAE,4CAAsB,CAAC,MAAM,CAAC,IAAI,uBAAuB;YAE5E,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,OAAO;YAGd,IAAI,EAAE,KAAK;SACd,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAjDY,kDAAmB;8BAAnB,mBAAmB;IAF/B,IAAA,cAAK,GAAE;IACP,IAAA,mBAAU,GAAE;qCAIiC,yCAAkB;GAHnD,mBAAmB,CAiD/B","sourcesContent":["// src/common/filters/http-exception.filter.ts\nimport {\n ExceptionFilter,\n Catch,\n ArgumentsHost,\n Logger,\n Injectable,\n HttpException,\n} from '@nestjs/common';\nimport { Response, Request } from 'express';\nimport { HttpStatusCodeMessages } from '../interceptors/logging.interceptor';\nimport { ErrorMapperService } from 'src/helpers/error-mapper.service';\nimport { ErrorCode } from 'src/interfaces';\n\n\n@Catch()\n@Injectable()\nexport class HttpExceptionFilter implements ExceptionFilter {\n private readonly logger = new Logger(HttpExceptionFilter.name);\n\n constructor(private readonly errorMapper: ErrorMapperService) {\n this.logger.debug('HttpExceptionFilter initialized');\n }\n\n catch(exception: any, host: ArgumentsHost) {\n const ctx = host.switchToHttp();\n const response = ctx.getResponse<Response>();\n const request = ctx.getRequest<Request>();\n\n const isHttp = exception instanceof HttpException;\n const explicitStatus = isHttp ? exception.getStatus() : undefined;\n\n // Canonical code + static message\n const code: ErrorCode = this.errorMapper.mapException(exception);\n const defaultStatus = this.errorMapper.getHttpStatus(code);\n const message = code === 'solidx-unknown-error' ? `${exception?.message}` : this.errorMapper.getMessage(code);\n\n const status = explicitStatus ?? defaultStatus ?? 500;\n\n // Logging\n this.logger.error(\n `[${status} ${HttpStatusCodeMessages[status] || 'Internal Server Error'}] ${request?.method} ${request?.url} - ${exception?.message || message} [code=${code}]`,\n );\n if (exception?.stack) {\n this.logger.error(exception.stack);\n }\n\n // Preserve any extra data the exception carried (optional)\n const extra =\n (isHttp && (exception.getResponse?.() as any)) ??\n exception?.response ??\n {};\n\n // Keep your legacy shape; add canonical code\n response.status(status).json({\n statusCode: status,\n statusCodeMessage: HttpStatusCodeMessages[status] || 'Internal Server Error',\n // Keeping this for backward compatibility..\n message: message,\n errorCode: code,\n error: message,\n // We can make this conditional based on whether we are running in prod mode or dev mode...\n // errorStack: exception.stack,\n data: extra,\n });\n }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"error-mapper.service.d.ts","sourceRoot":"","sources":["../../src/helpers/error-mapper.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAA4C,MAAM,gBAAgB,CAAC;AAmCrF,qBACa,kBAAkB;IAGf,OAAO,CAAC,QAAQ,CAAC,aAAa;IAF1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;gBAEjC,aAAa,EAAE,aAAa;IAGzD,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS;IAMrC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS;IAMtD,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAMnC,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAMtC,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,iBAAiB;CAO5B"}
1
+ {"version":3,"file":"error-mapper.service.d.ts","sourceRoot":"","sources":["../../src/helpers/error-mapper.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAA4C,MAAM,gBAAgB,CAAC;AACrF,qBACa,kBAAkB;IAGf,OAAO,CAAC,QAAQ,CAAC,aAAa;IAF1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;gBAEjC,aAAa,EAAE,aAAa;IAGzD,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS;IAMrC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS;IAMtD,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAMnC,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAMtC,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,iBAAiB;CAO5B"}
@@ -45,7 +45,7 @@ let ErrorMapperService = ErrorMapperService_1 = class ErrorMapperService {
45
45
  this.logger.warn(`Error rule threw in match(): code=${rule.code} provider? — ${e}`);
46
46
  }
47
47
  }
48
- return 'unknown-error';
48
+ return 'solidx-unknown-error';
49
49
  }
50
50
  lookupMeta(code) {
51
51
  const rules = this.getAllRulesSorted();
@@ -1 +1 @@
1
- {"version":3,"file":"error-mapper.service.js","sourceRoot":"","sources":["../../src/helpers/error-mapper.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,qDAA2D;AAqCpD,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAG3B,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;QAFxC,WAAM,GAAG,IAAI,eAAM,CAAC,oBAAkB,CAAC,IAAI,CAAC,CAAC;IAED,CAAC;IAG9D,YAAY,CAAC,GAAY;QACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAGD,UAAU,CAAC,OAAe,EAAE,KAAc;QACtC,MAAM,QAAQ,GAAG,GAAG,OAAO,IAAI,EAAE,KAAK,KAAK,IAAI,EAAE,EAAE,CAAC,WAAW,EAAE,CAAC;QAClE,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAGD,UAAU,CAAC,IAAe;QACtB,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,IAAI,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC,CAAC,OAAO,CAAC;IAC1E,CAAC;IAGD,aAAa,CAAC,IAAe;QACzB,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,EAAE,UAAU,IAAI,GAAG,CAAC;IACnC,CAAC;IAGO,SAAS,CAAC,QAAgB;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,IAAI,CAAC;gBACD,IAAI,IAAI,CAAC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,CAAC;gBAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;gBACzC,OAAO,GAAG,IAAI,KAAK,GAAG,KAAK,KAAK,KAAK,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YAC9D,CAAC;YAAC,MAAM,CAAC;YAET,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC3C,CAAC;IAEO,iBAAiB,CAAC,GAAY;QAClC,IAAI,CAAC;YACD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,EAAE,CAAC;QACd,CAAC;IACL,CAAC;CACJ,CAAA;AApHY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAImC,8BAAa;GAHhD,kBAAkB,CAoH9B","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport { SolidRegistry } from 'src/helpers/solid-registry';\nimport { ErrorCode, ErrorMeta, ErrorRule, IErrorCodeProvider } from 'src/interfaces';\n\n// export const ERROR_CODES = [\n// 'db-duplicate-key',\n// 'db-foreign-key-error',\n// 'solidx-mcp-server-unavailable',\n// 'unknown-error',\n// ] as const;\n\n// export type ErrorCode = typeof ERROR_CODES[number];\n\n// type ErrorMeta = {\n// message: string;\n// httpStatus?: number;\n// };\n\n// const ERROR_MESSAGES: Record<ErrorCode, ErrorMeta> = {\n// 'db-duplicate-key': {\n// message: 'Duplicate key violation. A record with these values already exists.',\n// httpStatus: 409,\n// },\n// 'db-foreign-key-error': {\n// message: 'Foreign key constraint prevents this operation due to related records.',\n// httpStatus: 409,\n// },\n// 'solidx-mcp-server-unavailable': {\n// message: 'SolidX MCP server is unreachable. Please verify the MCP endpoint.',\n// httpStatus: 503,\n// },\n// 'unknown-error': {\n// message: 'An unexpected error occurred.',\n// httpStatus: 500,\n// },\n// };\n\n@Injectable()\nexport class ErrorMapperService {\n private readonly logger = new Logger(ErrorMapperService.name);\n\n constructor(private readonly solidRegistry: SolidRegistry) { }\n\n /** Map an exception object (or string) to a canonical ErrorCode */\n mapException(exc: unknown): ErrorCode {\n const combined = this.combineErrorText(exc);\n return this.matchCode(combined);\n }\n\n /** Map plain message/trace to ErrorCode */\n mapMessage(message: string, trace?: string): ErrorCode {\n const combined = `${message ?? ''}\\n${trace ?? ''}`.toLowerCase();\n return this.matchCode(combined);\n }\n\n /** Get static message for a given code */\n getMessage(code: ErrorCode): string {\n const meta = this.lookupMeta(code);\n return (meta ?? { message: 'An unexpected error occurred.' }).message;\n }\n\n /** Get default HTTP status for a code (falls back to 500) */\n getHttpStatus(code: ErrorCode): number {\n const meta = this.lookupMeta(code);\n return meta?.httpStatus ?? 500;\n }\n\n // ---- internal helpers ----\n private matchCode(combined: string): ErrorCode {\n const rules = this.getAllRulesSorted();\n for (const rule of rules) {\n try {\n if (rule.match(combined)) return rule.code;\n } catch (e) {\n // Defensive: bad provider shouldn't crash mapping\n this.logger.warn(`Error rule threw in match(): code=${rule.code} provider? — ${e}`);\n }\n }\n return 'unknown-error';\n }\n\n private lookupMeta(code: ErrorCode): ErrorMeta | undefined {\n // Prefer the first rule with that code\n const rules = this.getAllRulesSorted();\n const rule = rules.find((r) => r.code === code);\n if (rule?.meta) return rule.meta;\n\n // Optional: ask providers directly if they implement resolve()\n const providers = this.getProviders();\n for (const p of providers) {\n if (p.resolve) {\n const meta = p.resolve(code);\n if (meta) return meta;\n }\n }\n return undefined;\n }\n\n private getAllRulesSorted(): ReadonlyArray<ErrorRule> {\n const providers = this.getProviders();\n const all: ErrorRule[] = [];\n for (const p of providers) {\n try {\n const rules = p.rules() ?? [];\n // Optional: namespace collision check can be added here if desired\n all.push(...rules);\n } catch (e) {\n this.logger.warn(`ErrorCodeProvider.rules() failed for ${p.name?.()}: ${e}`);\n }\n }\n // Sort by priority desc; default 0\n return all.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n }\n\n private getProviders(): IErrorCodeProvider[] {\n // convert InstanceWrapper → instance\n return this.solidRegistry\n .getErrorCodeProviders()\n .map((w) => w.instance)\n .filter(Boolean) as IErrorCodeProvider[];\n }\n\n private combineErrorText(exc: unknown): string {\n if (typeof exc === 'string') return exc.toLowerCase();\n\n if (exc instanceof Error) {\n const message = exc.message ?? '';\n const stack = exc.stack ?? '';\n return `${message}\\n${stack}`.toLowerCase();\n }\n\n if (exc && typeof exc === 'object') {\n try {\n const obj = exc as Record<string, unknown>;\n const msg = String(obj.message ?? (obj as any)['Message'] ?? '');\n const name = String(obj.name ?? (obj as any)['__type'] ?? '');\n const stack = String((obj as any).stack ?? '');\n const json = this.safeJsonStringify(obj);\n return `${name}\\n${msg}\\n${stack}\\n${json}`.toLowerCase();\n } catch {\n // ignore\n }\n }\n\n return String(exc ?? '').toLowerCase();\n }\n\n private safeJsonStringify(obj: unknown): string {\n try {\n return JSON.stringify(obj);\n } catch {\n return '';\n }\n }\n}"]}
1
+ {"version":3,"file":"error-mapper.service.js","sourceRoot":"","sources":["../../src/helpers/error-mapper.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,qDAA2D;AAGpD,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAG3B,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;QAFxC,WAAM,GAAG,IAAI,eAAM,CAAC,oBAAkB,CAAC,IAAI,CAAC,CAAC;IAED,CAAC;IAG9D,YAAY,CAAC,GAAY;QACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAGD,UAAU,CAAC,OAAe,EAAE,KAAc;QACtC,MAAM,QAAQ,GAAG,GAAG,OAAO,IAAI,EAAE,KAAK,KAAK,IAAI,EAAE,EAAE,CAAC,WAAW,EAAE,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helpers/solid-registry';\nimport { ErrorCode, ErrorMeta, ErrorRule, IErrorCodeProvider } from 'src/interfaces';\n@Injectable()\nexport class ErrorMapperService {\n private readonly logger = new Logger(ErrorMapperService.name);\n\n constructor(private readonly solidRegistry: SolidRegistry) { }\n\n /** Map an exception object (or string) to a canonical ErrorCode */\n mapException(exc: unknown): ErrorCode {\n const combined = this.combineErrorText(exc);\n return this.matchCode(combined);\n }\n\n /** Map plain message/trace to ErrorCode */\n mapMessage(message: string, trace?: string): ErrorCode {\n const combined = `${message ?? ''}\\n${trace ?? ''}`.toLowerCase();\n return this.matchCode(combined);\n }\n\n /** Get static message for a given code */\n getMessage(code: ErrorCode): string {\n const meta = this.lookupMeta(code);\n return (meta ?? { message: 'An unexpected error occurred.' }).message;\n }\n\n /** Get default HTTP status for a code (falls back to 500) */\n getHttpStatus(code: ErrorCode): number {\n const meta = this.lookupMeta(code);\n return meta?.httpStatus ?? 500;\n }\n\n // ---- internal helpers ----\n private matchCode(combined: string): ErrorCode {\n const rules = this.getAllRulesSorted();\n for (const rule of rules) {\n try {\n if (rule.match(combined)) return rule.code;\n } catch (e) {\n // Defensive: bad provider shouldn't crash mapping\n this.logger.warn(`Error rule threw in match(): code=${rule.code} provider? — ${e}`);\n }\n }\n return 'solidx-unknown-error';\n }\n\n private lookupMeta(code: ErrorCode): ErrorMeta | undefined {\n // Prefer the first rule with that code\n const rules = this.getAllRulesSorted();\n const rule = rules.find((r) => r.code === code);\n if (rule?.meta) return rule.meta;\n\n // Optional: ask providers directly if they implement resolve()\n const providers = this.getProviders();\n for (const p of providers) {\n if (p.resolve) {\n const meta = p.resolve(code);\n if (meta) return meta;\n }\n }\n return undefined;\n }\n\n private getAllRulesSorted(): ReadonlyArray<ErrorRule> {\n const providers = this.getProviders();\n const all: ErrorRule[] = [];\n for (const p of providers) {\n try {\n const rules = p.rules() ?? [];\n // Optional: namespace collision check can be added here if desired\n all.push(...rules);\n } catch (e) {\n this.logger.warn(`ErrorCodeProvider.rules() failed for ${p.name?.()}: ${e}`);\n }\n }\n // Sort by priority desc; default 0\n return all.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n }\n\n private getProviders(): IErrorCodeProvider[] {\n // convert InstanceWrapper → instance\n return this.solidRegistry\n .getErrorCodeProviders()\n .map((w) => w.instance)\n .filter(Boolean) as IErrorCodeProvider[];\n }\n\n private combineErrorText(exc: unknown): string {\n if (typeof exc === 'string') return exc.toLowerCase();\n\n if (exc instanceof Error) {\n const message = exc.message ?? '';\n const stack = exc.stack ?? '';\n return `${message}\\n${stack}`.toLowerCase();\n }\n\n if (exc && typeof exc === 'object') {\n try {\n const obj = exc as Record<string, unknown>;\n const msg = String(obj.message ?? (obj as any)['Message'] ?? '');\n const name = String(obj.name ?? (obj as any)['__type'] ?? '');\n const stack = String((obj as any).stack ?? '');\n const json = this.safeJsonStringify(obj);\n return `${name}\\n${msg}\\n${stack}\\n${json}`.toLowerCase();\n } catch {\n // ignore\n }\n }\n\n return String(exc ?? '').toLowerCase();\n }\n\n private safeJsonStringify(obj: unknown): string {\n try {\n return JSON.stringify(obj);\n } catch {\n return '';\n }\n }\n}"]}
@@ -1,4 +1,5 @@
1
1
  import { FieldCrudManager, ValidationError } from "src/interfaces";
2
+ import { HashingService } from "src/services/hashing.service";
2
3
  export interface PasswordFieldOptions {
3
4
  min: number | undefined | null;
4
5
  max: number | undefined | null;
@@ -6,10 +7,10 @@ export interface PasswordFieldOptions {
6
7
  regexPattern: string | undefined | null;
7
8
  fieldName: string | undefined | null;
8
9
  isUpdate: Boolean;
10
+ hashingService: HashingService | undefined | null;
9
11
  }
10
12
  export declare class PasswordFieldCrudManager implements FieldCrudManager {
11
13
  private readonly options;
12
- private hashingService;
13
14
  constructor(options: PasswordFieldOptions);
14
15
  validate(dto: any): ValidationError[];
15
16
  private applyValidations;
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordFieldCrudManager.d.ts","sourceRoot":"","sources":["../../../src/helpers/field-crud-managers/PasswordFieldCrudManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAInE,MAAM,WAAW,oBAAoB;IACjC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IACrC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACxC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACrC,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,qBAAa,wBAAyB,YAAW,gBAAgB;IAGjD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,cAAc,CAAuC;gBAEhC,OAAO,EAAE,oBAAoB;IAG1D,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,eAAe,EAAE;IAKrC,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,sBAAsB;IAUxB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAQhD,OAAO,CAAC,oBAAoB;IAG5B,OAAO,CAAC,oBAAoB;IAG5B,OAAO,CAAC,eAAe;IAGvB,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,yBAAyB;CAGpC"}
1
+ {"version":3,"file":"PasswordFieldCrudManager.d.ts","sourceRoot":"","sources":["../../../src/helpers/field-crud-managers/PasswordFieldCrudManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,oBAAoB;IACjC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IACrC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACxC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,CAAC;CACrD;AAED,qBAAa,wBAAyB,YAAW,gBAAgB;IACjD,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,oBAAoB;IAG1D,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,eAAe,EAAE;IAKrC,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,sBAAsB;IAUxB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAUhD,OAAO,CAAC,oBAAoB;IAG5B,OAAO,CAAC,oBAAoB;IAG5B,OAAO,CAAC,eAAe;IAGvB,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,yBAAyB;CAGpC"}
@@ -2,11 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PasswordFieldCrudManager = void 0;
4
4
  const class_validator_1 = require("class-validator");
5
- const bcrypt_service_1 = require("../../services/bcrypt.service");
6
5
  class PasswordFieldCrudManager {
7
6
  constructor(options) {
8
7
  this.options = options;
9
- this.hashingService = new bcrypt_service_1.BcryptService();
10
8
  }
11
9
  validate(dto) {
12
10
  const fieldValue = dto[this.options.fieldName];
@@ -33,7 +31,9 @@ class PasswordFieldCrudManager {
33
31
  }
34
32
  async transformForCreate(dto) {
35
33
  if (dto[this.options.fieldName]) {
36
- dto[this.options.fieldName] = await this.hashingService.hash(dto[this.options.fieldName]);
34
+ dto[this.options.fieldName] = await this.options.hashingService.hash(dto[this.options.fieldName]);
35
+ dto['passwordScheme'] = this.options.hashingService.name();
36
+ dto['passwordHashVersion'] = this.options.hashingService.currentVersion();
37
37
  }
38
38
  return dto;
39
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordFieldCrudManager.js","sourceRoot":"","sources":["../../../src/helpers/field-crud-managers/PasswordFieldCrudManager.ts"],"names":[],"mappings":";;;AAAA,qDAAmF;AAEnF,kEAA4D;AAY5D,MAAa,wBAAwB;IAGjC,YAA6B,OAA6B;QAA7B,YAAO,GAAP,OAAO,CAAsB;QAFlD,mBAAc,GAAmB,IAAI,8BAAa,EAAE,CAAC;IAG7D,CAAC;IAED,QAAQ,CAAC,GAAQ;QACb,MAAM,UAAU,GAAQ,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IAClD,CAAC;IAEO,gBAAgB,CAAC,UAAe,EAAE,GAAQ;QAC9C,MAAM,MAAM,GAAsB,EAAE,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,IAAI,IAAI,CAAC,yBAAyB,EAAE,IAAI,IAAA,yBAAO,EAAC,UAAU,CAAC,EAAE,CAAC;YACrF,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,cAAc,EAAE,CAAC,CAAC;QAC1G,CAAC;QAED,IAAI,IAAA,4BAAU,EAAC,UAAU,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,sBAAsB,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAEO,sBAAsB,CAAC,UAAe,EAAE,GAAO;QACnD,MAAM,MAAM,GAAsB,EAAE,CAAC;QACrC,CAAC,IAAA,0BAAQ,EAAC,UAAU,CAAC,CAAC,CAAC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SAAS,CAAC,EAAC,CAAC;YAC5B,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;QAC9F,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IAGO,oBAAoB;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC;IAChC,CAAC;IACO,oBAAoB;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC;IAChC,CAAC;IACO,eAAe,CAAC,QAAgB;QACpC,OAAO,IAAA,yBAAO,EAAC,QAAQ,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,MAAM,CAAC,GAAG,CAAA,qDAAqD,CAAC,CAAC,CAAC;IACvI,CAAC;IACO,sBAAsB,CAAC,GAAQ;QACnC,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;QACjD,MAAM,wBAAwB,GAAG,GAAG,iBAAiB,SAAS,CAAC;QAC/D,OAAO,GAAG,CAAC,iBAAiB,CAAC,KAAK,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACpE,CAAC;IAEO,yBAAyB;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACjC,CAAC;CACJ;AA3DD,4DA2DC","sourcesContent":["import { isEmpty, isNotEmpty, isString, matches, max, min } from \"class-validator\";\nimport { FieldCrudManager, ValidationError } from \"src/interfaces\";\nimport { BcryptService } from \"src/services/bcrypt.service\";\nimport { HashingService } from \"src/services/hashing.service\";\n\nexport interface PasswordFieldOptions {\n min: number | undefined | null;\n max: number | undefined | null;\n required: boolean | undefined | null;\n regexPattern: string | undefined | null;\n fieldName: string | undefined | null;\n isUpdate: Boolean;\n}\n\nexport class PasswordFieldCrudManager implements FieldCrudManager {\n private hashingService: HashingService = new BcryptService(); //FIXME: The bcrypt service injected here probably can be optimized to be a singleton\n\n constructor(private readonly options: PasswordFieldOptions) {\n }\n\n validate(dto: any): ValidationError[] {\n const fieldValue: any = dto[this.options.fieldName];\n return this.applyValidations(fieldValue, dto);\n }\n\n private applyValidations(fieldValue: any, dto: any): ValidationError[] {\n const errors: ValidationError[] = [];\n if (!this.options?.isUpdate && this.isApplyRequiredValidation() && isEmpty(fieldValue)) {\n errors.push({ field: this.options.fieldName, error: `Field: ${this.options.fieldName} is required` });\n }\n // this.isApplyRequiredValidation() && isEmpty(fieldValue) ? errors.push({ field: this.options.fieldName, error: `Field: ${this.options.fieldName} is required` }): \"no errors\";\n if (isNotEmpty(fieldValue)) {\n errors.push(...this.applyFormatValidations(fieldValue, dto));\n }\n return errors;\n }\n\n private applyFormatValidations(fieldValue: any, dto:any): ValidationError[] {\n const errors: ValidationError[] = [];\n !isString(fieldValue) ? errors.push({ field: this.options.fieldName, error: 'Field is not a string' }) : \"no errors\";\n !this.isPasswordValid(fieldValue) ? errors.push({ field: this.options.fieldName, error: 'Password regex pattern is invalid' }) : \"no errors\";\n this.isApplyMinValidation() && !min(fieldValue, this.options.min) ? errors.push({ field: this.options.fieldName, error: 'Field value is lesser than minimum required' }) : \"no errors\";\n this.isApplyMaxValidation() && !max(fieldValue, this.options.max) ? errors.push({ field: this.options.fieldName, error: 'Field value is greater than maximum required' }) : \"no errors\";\n !this.isConfirmPasswordValid(dto) ? errors.push({ field: this.options.fieldName, error: 'Password and confirm password do not match' }) : \"no errors\";\n return errors;\n }\n\n async transformForCreate(dto: any): Promise<any> {\n if(dto[this.options.fieldName]){\n dto[this.options.fieldName] = await this.hashingService.hash(dto[this.options.fieldName]);\n }\n return dto;\n }\n\n // Validation to be applied\n private isApplyMinValidation(): boolean {\n return this.options.min > 0;\n }\n private isApplyMaxValidation(): boolean {\n return this.options.max > 0;\n }\n private isPasswordValid(password: string): boolean {\n return matches(password, new RegExp(this.options.regexPattern ?? String.raw`^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[^\\da-zA-Z]).*$`)); \n }\n private isConfirmPasswordValid(dto: any): boolean {\n const passwordFieldName = this.options.fieldName;\n const confirmPasswordFieldName = `${passwordFieldName}Confirm`;\n return dto[passwordFieldName] === dto[confirmPasswordFieldName];\n }\n\n private isApplyRequiredValidation(): boolean {\n return this.options.required;\n }\n}"]}
1
+ {"version":3,"file":"PasswordFieldCrudManager.js","sourceRoot":"","sources":["../../../src/helpers/field-crud-managers/PasswordFieldCrudManager.ts"],"names":[],"mappings":";;;AAAA,qDAAmF;AAenF,MAAa,wBAAwB;IACjC,YAA6B,OAA6B;QAA7B,YAAO,GAAP,OAAO,CAAsB;IAC1D,CAAC;IAED,QAAQ,CAAC,GAAQ;QACb,MAAM,UAAU,GAAQ,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IAClD,CAAC;IAEO,gBAAgB,CAAC,UAAe,EAAE,GAAQ;QAC9C,MAAM,MAAM,GAAsB,EAAE,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,IAAI,IAAI,CAAC,yBAAyB,EAAE,IAAI,IAAA,yBAAO,EAAC,UAAU,CAAC,EAAE,CAAC;YACrF,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,cAAc,EAAE,CAAC,CAAC;QAC1G,CAAC;QAED,IAAI,IAAA,4BAAU,EAAC,UAAU,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,sBAAsB,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;I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J;AA3DD,4DA2DC","sourcesContent":["import { isEmpty, isNotEmpty, isString, matches, max, min } from \"class-validator\";\nimport { FieldCrudManager, ValidationError } from \"src/interfaces\";\nimport { BcryptService } from \"src/services/bcrypt.service\";\nimport { HashingService } from \"src/services/hashing.service\";\n\nexport interface PasswordFieldOptions {\n min: number | undefined | null;\n max: number | undefined | null;\n required: boolean | undefined | null;\n regexPattern: string | undefined | null;\n fieldName: string | undefined | null;\n isUpdate: Boolean;\n hashingService: HashingService | undefined | null;\n}\n\nexport class PasswordFieldCrudManager implements FieldCrudManager {\n constructor(private readonly options: PasswordFieldOptions) {\n }\n\n validate(dto: any): ValidationError[] {\n const fieldValue: any = dto[this.options.fieldName];\n return this.applyValidations(fieldValue, dto);\n }\n\n private applyValidations(fieldValue: any, dto: any): ValidationError[] {\n const errors: ValidationError[] = [];\n if (!this.options?.isUpdate && this.isApplyRequiredValidation() && isEmpty(fieldValue)) {\n errors.push({ field: this.options.fieldName, error: `Field: ${this.options.fieldName} is required` });\n }\n // this.isApplyRequiredValidation() && isEmpty(fieldValue) ? errors.push({ field: this.options.fieldName, error: `Field: ${this.options.fieldName} is required` }): \"no errors\";\n if (isNotEmpty(fieldValue)) {\n errors.push(...this.applyFormatValidations(fieldValue, dto));\n }\n return errors;\n }\n\n private applyFormatValidations(fieldValue: any, dto:any): ValidationError[] {\n const errors: ValidationError[] = [];\n !isString(fieldValue) ? errors.push({ field: this.options.fieldName, error: 'Field is not a string' }) : \"no errors\";\n !this.isPasswordValid(fieldValue) ? errors.push({ field: this.options.fieldName, error: 'Password regex pattern is invalid' }) : \"no errors\";\n this.isApplyMinValidation() && !min(fieldValue, this.options.min) ? errors.push({ field: this.options.fieldName, error: 'Field value is lesser than minimum required' }) : \"no errors\";\n this.isApplyMaxValidation() && !max(fieldValue, this.options.max) ? errors.push({ field: this.options.fieldName, error: 'Field value is greater than maximum required' }) : \"no errors\";\n !this.isConfirmPasswordValid(dto) ? errors.push({ field: this.options.fieldName, error: 'Password and confirm password do not match' }) : \"no errors\";\n return errors;\n }\n\n async transformForCreate(dto: any): Promise<any> {\n if(dto[this.options.fieldName]){\n dto[this.options.fieldName] = await this.options.hashingService.hash(dto[this.options.fieldName]);\n dto['passwordScheme'] = this.options.hashingService.name(); //Don't want to expose this in dto // e.g., 'bcrypt'\n dto['passwordHashVersion'] = this.options.hashingService.currentVersion(); //Don't want to expose this in dto // e.g., 1, 2, ...\n }\n return dto;\n }\n\n // Validation to be applied\n private isApplyMinValidation(): boolean {\n return this.options.min > 0;\n }\n private isApplyMaxValidation(): boolean {\n return this.options.max > 0;\n }\n private isPasswordValid(password: string): boolean {\n return matches(password, new RegExp(this.options.regexPattern ?? String.raw`^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[^\\da-zA-Z]).*$`)); \n }\n private isConfirmPasswordValid(dto: any): boolean {\n const passwordFieldName = this.options.fieldName;\n const confirmPasswordFieldName = `${passwordFieldName}Confirm`;\n return dto[passwordFieldName] === dto[confirmPasswordFieldName];\n }\n\n private isApplyRequiredValidation(): boolean {\n return this.options.required;\n }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"model-metadata-helper.service.js","sourceRoot":"","sources":["../../src/helpers/model-metadata-helper.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,2CAAoD;AACpD,qDAAiD;AACjD,qCAAyC;AACzC,6CAAmD;AACnD,6EAAmE;AAG5D,IAAM,0BAA0B,kCAAhC,MAAM,0BAA0B;IAGnC,YAA6B,QAAuB,EAEhD,iBAA6D;QAFpC,aAAQ,GAAR,QAAQ,CAAe;QAE/B,sBAAiB,GAAjB,iBAAiB,CAA2B;QAJhD,WAAM,GAAG,IAAI,eAAM,CAAC,4BAA0B,CAAC,IAAI,CAAC,CAAC;IAMtE,CAAC;IAED,uBAAuB;QACnB,MAAM,oBAAoB,GAAG;YACzB;gBACI,IAAI,EAAE,IAAI;gBACV,WAAW,EAAE,IAAI;gBACjB,IAAI,EAAE,KAAK;gBAC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,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;YAG7B,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;gBACpB,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAC7C,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AA/HY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;IAKJ,WAAA,IAAA,0BAAgB,EAAC,qCAAa,CAAC,CAAA;qCADG,8BAAa;QAEZ,oBAAU;GALzC,0BAA0B,CA+HtC","sourcesContent":["// Return the system fields metadata for a model\n\nimport { Injectable, Logger } from \"@nestjs/common\";\nimport { SolidRegistry } from \"./solid-registry\";\nimport { In, Repository } from \"typeorm\";\nimport { InjectRepository } from \"@nestjs/typeorm\";\nimport { ModelMetadata } from \"src/entities/model-metadata.entity\";\n\n@Injectable()\nexport class ModelMetadataHelperService {\n private readonly logger = new Logger(ModelMetadataHelperService.name);\n\n constructor(private readonly registry: SolidRegistry,\n @InjectRepository(ModelMetadata)\n private readonly modelMetadataRepo: Repository<ModelMetadata>,\n ) {\n }\n\n getSystemFieldsMetadata(): any[] {\n const systemFieldsMetadata = [\n {\n name: \"id\",\n displayName: \"Id\",\n type: \"int\",\n ormType: \"bigint\",\n isSystem: true,\n },\n {\n name: \"createdAt\",\n displayName: \"Created At\",\n type: \"datetime\",\n ormType: \"timestamp\",\n isSystem: true,\n },\n {\n name: \"updatedAt\",\n displayName: \"Updated At\",\n type: \"datetime\",\n ormType: \"timestamp\",\n isSystem: true,\n },\n {\n name: \"deletedAt\",\n displayName: \"Deleted At\",\n type: \"datetime\",\n ormType: \"timestamp\",\n isSystem: true,\n },\n {\n name: \"deletedTracker\",\n displayName: \"Deleted Tracker\",\n type: \"shortText\",\n ormType: \"varchar\",\n isSystem: true,\n },\n {\n name: \"publishedAt\",\n displayName: \"Published At\",\n type: \"datetime\",\n ormType: \"timestamp\",\n isSystem: true,\n },\n {\n name: \"localeName\",\n displayName: \"Locale\",\n type: \"shortText\",\n ormType: \"varchar\",\n isSystem: true,\n },\n {\n name: \"defaultEntityLocaleId\",\n displayName: \"Default Entity Locale Id\",\n type: \"int\",\n ormType: \"integer\",\n isSystem: true,\n },\n {\n name: \"createdBy\",\n displayName: \"Created By\",\n type: \"relation\",\n ormType: \"integer\",\n isSystem: true,\n relationType: \"many-to-one\",\n relationCoModelSingularName: \"user\",\n relationCreateInverse: false,\n relationCascade: \"restrict\",\n relationModelModuleName: \"solid-core\"\n },\n {\n name: \"updatedBy\",\n displayName: \"Updated By\",\n type: \"relation\",\n ormType: \"integer\",\n isSystem: true,\n relationType: \"many-to-one\",\n relationCoModelSingularName: \"user\",\n relationCreateInverse: false,\n relationCascade: \"restrict\",\n relationModelModuleName: \"solid-core\"\n },\n ]\n\n // Do an additional check and add a warning if the common entity keys and system field metadata keys don't match exactly\n const commonEntityKeys = this.registry.getCommonEntityKeys();\n const systemFieldNames = systemFieldsMetadata.map(field => field.name);\n const missingKeys = commonEntityKeys.filter(key => !systemFieldNames.includes(key));\n if (missingKeys.length > 0) {\n this.logger.warn(`Missing system fields metadata for common entity keys: ${missingKeys.join(', ')}`);\n }\n return systemFieldsMetadata;\n }\n\n async loadFieldHierarchy(modelName: any) {\n const model = await this.modelMetadataRepo.findOne({\n where: {\n singularName: modelName,\n },\n relations: {\n fields: true,\n parentModel: {\n fields: true,\n }\n }\n });\n const fields = [];\n if (model) {\n // Add the fields of the current model\n fields.push(...model.fields);\n\n // Add the fields of the parent model\n if (model.parentModel) {\n fields.push(...model.parentModel.fields);\n }\n }\n return fields;\n }\n}"]}
1
+ {"version":3,"file":"model-metadata-helper.service.js","sourceRoot":"","sources":["../../src/helpers/model-metadata-helper.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,2CAAoD;AACpD,qDAAiD;AACjD,qCAAyC;AACzC,6CAAmD;AACnD,6EAAmE;AAG5D,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KAAK,CAAC,kBAAkB,CAAC,SAAc;QACnC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE;gBACH,YAAY,EAAE,SAAS;aAC1B;YACD,SAAS,EAAE;gBACP,MAAM,EAAE,IAAI;gBACZ,WAAW,EAAE;oBACT,MAAM,EAAE,IAAI;iBACf;aACJ;SACJ,CAAC,CAAC;QACH,MAAM,MAAM,GAAU,EAAE,CAAC;QACzB,IAAI,KAAK,EAAE,CAAC;YAER,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;YAG7B,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;gBACpB,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAC7C,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AA/HY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;IAKJ,WAAA,IAAA,0BAAgB,EAAC,qCAAa,CAAC,CAAA;qCADG,8BAAa;QAEZ,oBAAU;GALzC,0BAA0B,CA+HtC","sourcesContent":["// Return the system fields metadata for a model\n\nimport { Injectable, Logger } from \"@nestjs/common\";\nimport { SolidRegistry } from \"./solid-registry\";\nimport { In, Repository } from \"typeorm\";\nimport { InjectRepository } from \"@nestjs/typeorm\";\nimport { ModelMetadata } from \"src/entities/model-metadata.entity\";\n\n@Injectable()\nexport class ModelMetadataHelperService {\n private readonly logger = new Logger(ModelMetadataHelperService.name);\n\n constructor(private readonly registry: SolidRegistry,\n @InjectRepository(ModelMetadata)\n private readonly modelMetadataRepo: Repository<ModelMetadata>,\n ) {\n }\n\n getSystemFieldsMetadata(): any[] {\n const systemFieldsMetadata = [\n {\n name: \"id\",\n displayName: \"Id\",\n type: \"int\",\n ormType: \"bigint\",\n isSystem: true,\n },\n {\n name: \"createdAt\",\n displayName: \"Created At\",\n type: \"datetime\",\n ormType: \"timestamp\",\n isSystem: true,\n },\n {\n name: \"updatedAt\",\n displayName: \"Updated At\",\n type: \"datetime\",\n ormType: \"timestamp\",\n isSystem: true,\n },\n {\n name: \"deletedAt\",\n displayName: \"Deleted At\",\n type: \"datetime\",\n ormType: \"timestamp\",\n isSystem: true,\n },\n {\n name: \"deletedTracker\",\n displayName: \"Deleted Tracker\",\n type: \"shortText\",\n ormType: \"varchar\",\n isSystem: true,\n },\n {\n name: \"publishedAt\",\n displayName: \"Published At\",\n type: \"datetime\",\n ormType: \"timestamp\",\n isSystem: true,\n },\n {\n name: \"localeName\",\n displayName: \"Locale\",\n type: \"shortText\",\n ormType: \"varchar\",\n isSystem: true,\n },\n {\n name: \"defaultEntityLocaleId\",\n displayName: \"Default Entity Locale Id\",\n type: \"int\",\n ormType: \"integer\",\n isSystem: true,\n },\n {\n name: \"createdBy\",\n displayName: \"Created By\",\n type: \"relation\",\n ormType: \"integer\",\n isSystem: true,\n relationType: \"many-to-one\",\n relationCoModelSingularName: \"user\",\n relationCreateInverse: false,\n relationCascade: \"restrict\",\n relationModelModuleName: \"solid-core\"\n },\n {\n name: \"updatedBy\",\n displayName: \"Updated By\",\n type: \"relation\",\n ormType: \"integer\",\n isSystem: true,\n relationType: \"many-to-one\",\n relationCoModelSingularName: \"user\",\n relationCreateInverse: false,\n relationCascade: \"restrict\",\n relationModelModuleName: \"solid-core\"\n },\n ]\n\n // Do an additional check and add a warning if the common entity keys and system field metadata keys don't match exactly\n const commonEntityKeys = this.registry.getCommonEntityKeys();\n const systemFieldNames = systemFieldsMetadata.map(field => field.name);\n const missingKeys = commonEntityKeys.filter(key => !systemFieldNames.includes(key));\n if (missingKeys.length > 0) {\n this.logger.warn(`Missing system fields metadata for common entity keys: ${missingKeys.join(', ')}`);\n }\n return systemFieldsMetadata;\n }\n\n async loadFieldHierarchy(modelName: any) {\n const model = await this.modelMetadataRepo.findOne({\n where: {\n singularName: modelName,\n },\n relations: {\n fields: true,\n parentModel: {\n fields: true,\n }\n }\n });\n const fields: any[] = [];\n if (model) {\n // Add the fields of the current model\n fields.push(...model.fields);\n\n // Add the fields of the parent model\n if (model.parentModel) {\n fields.push(...model.parentModel.fields);\n }\n }\n return fields;\n }\n}"]}
@@ -22,7 +22,7 @@ let LocalStrategy = class LocalStrategy extends (0, passport_1.PassportStrategy)
22
22
  this.userService = userService;
23
23
  }
24
24
  async validate(username, password) {
25
- const user = await this.authService.validateUser({ username, password, email: null });
25
+ const user = await this.authService.validateUserAndRehashPasswordIfRequired({ username, password, email: null });
26
26
  if (!user) {
27
27
  throw new common_1.UnauthorizedException();
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"local.strategy.js","sourceRoot":"","sources":["../../src/passport-strategies/local.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAA0C;AAC1C,+CAA+D;AAC/D,2CAAmE;AACnE,+EAA2E;AAC3E,2DAAuD;AAIhD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,IAAA,2BAAgB,EAAC,yBAAQ,CAAC;IACzD,YACY,WAAkC,EAClC,WAAwB;QAEhC,KAAK,EAAE,CAAC;QAHA,gBAAW,GAAX,WAAW,CAAuB;QAClC,gBAAW,GAAX,WAAW,CAAa;IAGpC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAgB,EAAE,QAAgB;QAC7C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACtF,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,MAAM,IAAI,8BAAqB,EAAE,CAAC;QACtC,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAA;AAfY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAGgB,8CAAqB;QACrB,0BAAW;GAH3B,aAAa,CAezB;AAIM,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,IAAA,oBAAS,EAAC,OAAO,CAAC;CAAI,CAAA;AAA7C,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;GACA,cAAc,CAA+B","sourcesContent":["import { Strategy } from 'passport-local';\nimport { AuthGuard, PassportStrategy } from '@nestjs/passport';\nimport { Injectable, UnauthorizedException } from '@nestjs/common';\nimport { AuthenticationService } from '../services/authentication.service';\nimport { UserService } from '../services/user.service';\n\n\n@Injectable()\nexport class LocalStrategy extends PassportStrategy(Strategy) {\n constructor(\n private authService: AuthenticationService,\n private userService: UserService,\n ) {\n super();\n }\n\n async validate(username: string, password: string): Promise<any> {\n const user = await this.authService.validateUser({ username, password, email: null });\n if (!user) {\n throw new UnauthorizedException();\n }\n return user;\n }\n}\n\n\n@Injectable()\nexport class LocalAuthGuard extends AuthGuard('local') { }\n"]}
1
+ {"version":3,"file":"local.strategy.js","sourceRoot":"","sources":["../../src/passport-strategies/local.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAA0C;AAC1C,+CAA+D;AAC/D,2CAAmE;AACnE,+EAA2E;AAC3E,2DAAuD;AAIhD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,IAAA,2BAAgB,EAAC,yBAAQ,CAAC;IACzD,YACY,WAAkC,EAClC,WAAwB;QAEhC,KAAK,EAAE,CAAC;QAHA,gBAAW,GAAX,WAAW,CAAuB;QAClC,gBAAW,GAAX,WAAW,CAAa;IAGpC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAgB,EAAE,QAAgB;QAC7C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,uCAAuC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACjH,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,MAAM,IAAI,8BAAqB,EAAE,CAAC;QACtC,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAA;AAfY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAGgB,8CAAqB;QACrB,0BAAW;GAH3B,aAAa,CAezB;AAIM,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,IAAA,oBAAS,EAAC,OAAO,CAAC;CAAI,CAAA;AAA7C,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;GACA,cAAc,CAA+B","sourcesContent":["import { Strategy } from 'passport-local';\nimport { AuthGuard, PassportStrategy } from '@nestjs/passport';\nimport { Injectable, UnauthorizedException } from '@nestjs/common';\nimport { AuthenticationService } from '../services/authentication.service';\nimport { UserService } from '../services/user.service';\n\n\n@Injectable()\nexport class LocalStrategy extends PassportStrategy(Strategy) {\n constructor(\n private authService: AuthenticationService,\n private userService: UserService,\n ) {\n super();\n }\n\n async validate(username: string, password: string): Promise<any> {\n const user = await this.authService.validateUserAndRehashPasswordIfRequired({ username, password, email: null });\n if (!user) {\n throw new UnauthorizedException();\n }\n return user;\n }\n}\n\n\n@Injectable()\nexport class LocalAuthGuard extends AuthGuard('local') { }\n"]}
@@ -2115,6 +2115,49 @@
2115
2115
  "relationCreateInverse": true,
2116
2116
  "relationModelModuleName": "solid-core",
2117
2117
  "isSystem": true
2118
+ },
2119
+ {
2120
+ "name": "passwordScheme",
2121
+ "displayName": "Password Scheme",
2122
+ "type": "selectionStatic",
2123
+ "ormType": "varchar",
2124
+ "length": 256,
2125
+ "required": true,
2126
+ "index": false,
2127
+ "isSystem": true,
2128
+ "columnName": "password_scheme",
2129
+ "defaultValue": "bcrypt",
2130
+ "selectionValueType": "string",
2131
+ "selectionStaticValues": [
2132
+ "bcrypt:bcrypt"
2133
+ ]
2134
+ },
2135
+ {
2136
+ "name": "passwordSchemeVersion",
2137
+ "displayName": "Password Scheme Version",
2138
+ "type": "int",
2139
+ "ormType": "integer",
2140
+ "length": 512,
2141
+ "required": true,
2142
+ "defaultValue": 1,
2143
+ "unique": false,
2144
+ "index": false,
2145
+ "private": false,
2146
+ "encrypt": false,
2147
+ "isSystem": true
2148
+ },
2149
+ {
2150
+ "name": "rehashedAt",
2151
+ "displayName": "Password Rehashed At",
2152
+ "type": "datetime",
2153
+ "ormType": "timestamp",
2154
+ "length": 512,
2155
+ "required": false,
2156
+ "unique": false,
2157
+ "index": false,
2158
+ "private": false,
2159
+ "encrypt": false,
2160
+ "isSystem": true
2118
2161
  }
2119
2162
  ]
2120
2163
  },
@@ -49,8 +49,9 @@ export declare class AuthenticationService {
49
49
  private getConfig;
50
50
  private getCompanyLogo;
51
51
  resolveUser(username: string, email: string): Promise<User>;
52
+ updatePasswordDetails(user: User, newPassword: string): Promise<User>;
52
53
  resolveUserByVerificationToken(token: string): Promise<User>;
53
- validateUser(signInDto: SignInDto): Promise<User>;
54
+ validateUserAndRehashPasswordIfRequired(signInDto: SignInDto): Promise<User>;
54
55
  signUp(signUpDto: SignUpDto, activeUser?: ActiveUserData): Promise<User>;
55
56
  signupForExtensionUser<T extends User, U extends CreateUserDto>(signUpDto: SignUpDto, extensionUserDto: U, extensionUserRepo: Repository<T>): Promise<T>;
56
57
  private populateForSignup;
@@ -1 +1 @@
1
- {"version":3,"file":"authentication.service.d.ts","sourceRoot":"","sources":["../../src/services/authentication.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAW5C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKzC,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM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