@solidxai/core 0.1.13-beta.8 → 0.1.13

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 (260) hide show
  1. package/CHANGELOG.md +8568 -0
  2. package/README.md +19 -0
  3. package/dist/commands/run-tests.command.d.ts +2 -0
  4. package/dist/commands/run-tests.command.d.ts.map +1 -1
  5. package/dist/commands/run-tests.command.js +20 -3
  6. package/dist/commands/run-tests.command.js.map +1 -1
  7. package/dist/config/cache.options.d.ts.map +1 -1
  8. package/dist/config/cache.options.js +2 -2
  9. package/dist/config/cache.options.js.map +1 -1
  10. package/dist/constants/error-messages.d.ts +7 -0
  11. package/dist/constants/error-messages.d.ts.map +1 -1
  12. package/dist/constants/error-messages.js +7 -0
  13. package/dist/constants/error-messages.js.map +1 -1
  14. package/dist/constants/media-file-types.d.ts +3 -0
  15. package/dist/constants/media-file-types.d.ts.map +1 -1
  16. package/dist/constants/media-file-types.js +47 -8
  17. package/dist/constants/media-file-types.js.map +1 -1
  18. package/dist/constants/success-messages.d.ts +3 -0
  19. package/dist/constants/success-messages.d.ts.map +1 -1
  20. package/dist/constants/success-messages.js +3 -0
  21. package/dist/constants/success-messages.js.map +1 -1
  22. package/dist/controllers/authentication.controller.d.ts +1 -1
  23. package/dist/controllers/authentication.controller.d.ts.map +1 -1
  24. package/dist/controllers/authentication.controller.js +4 -3
  25. package/dist/controllers/authentication.controller.js.map +1 -1
  26. package/dist/controllers/field-metadata.controller.d.ts +2 -2
  27. package/dist/controllers/mpin-authentication.controller.d.ts +44 -0
  28. package/dist/controllers/mpin-authentication.controller.d.ts.map +1 -0
  29. package/dist/controllers/mpin-authentication.controller.js +102 -0
  30. package/dist/controllers/mpin-authentication.controller.js.map +1 -0
  31. package/dist/dtos/change-mpin.dto.d.ts +6 -0
  32. package/dist/dtos/change-mpin.dto.d.ts.map +1 -0
  33. package/dist/dtos/change-mpin.dto.js +39 -0
  34. package/dist/dtos/change-mpin.dto.js.map +1 -0
  35. package/dist/dtos/create-field-metadata.dto.d.ts +3 -6
  36. package/dist/dtos/create-field-metadata.dto.d.ts.map +1 -1
  37. package/dist/dtos/create-field-metadata.dto.js +15 -10
  38. package/dist/dtos/create-field-metadata.dto.js.map +1 -1
  39. package/dist/dtos/create-model-sequence.dto.d.ts +1 -1
  40. package/dist/dtos/create-model-sequence.dto.d.ts.map +1 -1
  41. package/dist/dtos/create-model-sequence.dto.js +1 -1
  42. package/dist/dtos/create-model-sequence.dto.js.map +1 -1
  43. package/dist/dtos/mpin-login.dto.d.ts +5 -0
  44. package/dist/dtos/mpin-login.dto.d.ts.map +1 -0
  45. package/dist/dtos/mpin-login.dto.js +33 -0
  46. package/dist/dtos/mpin-login.dto.js.map +1 -0
  47. package/dist/dtos/setup-mpin.dto.d.ts +7 -0
  48. package/dist/dtos/setup-mpin.dto.d.ts.map +1 -0
  49. package/dist/dtos/setup-mpin.dto.js +47 -0
  50. package/dist/dtos/setup-mpin.dto.js.map +1 -0
  51. package/dist/entities/common.entity.d.ts +4 -4
  52. package/dist/entities/common.entity.d.ts.map +1 -1
  53. package/dist/entities/common.entity.js +1 -1
  54. package/dist/entities/common.entity.js.map +1 -1
  55. package/dist/entities/dashboard-user-layout.entity.js +2 -2
  56. package/dist/entities/dashboard-user-layout.entity.js.map +1 -1
  57. package/dist/entities/field-metadata.entity.d.ts +1 -0
  58. package/dist/entities/field-metadata.entity.d.ts.map +1 -1
  59. package/dist/entities/field-metadata.entity.js +5 -1
  60. package/dist/entities/field-metadata.entity.js.map +1 -1
  61. package/dist/entities/user-device-credential.entity.d.ts +18 -0
  62. package/dist/entities/user-device-credential.entity.d.ts.map +1 -0
  63. package/dist/entities/user-device-credential.entity.js +91 -0
  64. package/dist/entities/user-device-credential.entity.js.map +1 -0
  65. package/dist/entities/user.entity.js +2 -2
  66. package/dist/entities/user.entity.js.map +1 -1
  67. package/dist/entities/view-metadata.entity.js.map +1 -1
  68. package/dist/entities/workflow-execution-artifact.entity.d.ts.map +1 -1
  69. package/dist/entities/workflow-execution-artifact.entity.js +4 -3
  70. package/dist/entities/workflow-execution-artifact.entity.js.map +1 -1
  71. package/dist/entities/workflow-execution-log.entity.d.ts.map +1 -1
  72. package/dist/entities/workflow-execution-log.entity.js +4 -3
  73. package/dist/entities/workflow-execution-log.entity.js.map +1 -1
  74. package/dist/entities/workflow-execution.entity.d.ts.map +1 -1
  75. package/dist/entities/workflow-execution.entity.js +3 -2
  76. package/dist/entities/workflow-execution.entity.js.map +1 -1
  77. package/dist/entities/workflow-secret.entity.d.ts.map +1 -1
  78. package/dist/entities/workflow-secret.entity.js +3 -2
  79. package/dist/entities/workflow-secret.entity.js.map +1 -1
  80. package/dist/entities/workflow-step-execution.entity.d.ts.map +1 -1
  81. package/dist/entities/workflow-step-execution.entity.js +3 -2
  82. package/dist/entities/workflow-step-execution.entity.js.map +1 -1
  83. package/dist/entities/workflow-trigger-execution.entity.d.ts.map +1 -1
  84. package/dist/entities/workflow-trigger-execution.entity.js +6 -5
  85. package/dist/entities/workflow-trigger-execution.entity.js.map +1 -1
  86. package/dist/filters/http-exception.filter.d.ts.map +1 -1
  87. package/dist/filters/http-exception.filter.js +5 -1
  88. package/dist/filters/http-exception.filter.js.map +1 -1
  89. package/dist/helpers/bootstrap.helper.d.ts +5 -2
  90. package/dist/helpers/bootstrap.helper.d.ts.map +1 -1
  91. package/dist/helpers/bootstrap.helper.js +7 -3
  92. package/dist/helpers/bootstrap.helper.js.map +1 -1
  93. package/dist/helpers/field-crud-managers/MediaFieldCrudManager.d.ts +6 -0
  94. package/dist/helpers/field-crud-managers/MediaFieldCrudManager.d.ts.map +1 -1
  95. package/dist/helpers/field-crud-managers/MediaFieldCrudManager.js +54 -27
  96. package/dist/helpers/field-crud-managers/MediaFieldCrudManager.js.map +1 -1
  97. package/dist/helpers/file-download.helper.d.ts.map +1 -1
  98. package/dist/helpers/file-download.helper.js +6 -1
  99. package/dist/helpers/file-download.helper.js.map +1 -1
  100. package/dist/helpers/security.helper.d.ts +5 -1
  101. package/dist/helpers/security.helper.d.ts.map +1 -1
  102. package/dist/helpers/security.helper.js +15 -4
  103. package/dist/helpers/security.helper.js.map +1 -1
  104. package/dist/helpers/solid-core-error-codes-provider.service.d.ts.map +1 -1
  105. package/dist/helpers/solid-core-error-codes-provider.service.js +45 -0
  106. package/dist/helpers/solid-core-error-codes-provider.service.js.map +1 -1
  107. package/dist/helpers/solid-microservice-adapter.service.d.ts.map +1 -1
  108. package/dist/helpers/solid-microservice-adapter.service.js +1 -1
  109. package/dist/helpers/solid-microservice-adapter.service.js.map +1 -1
  110. package/dist/helpers/typeorm-db-helper.d.ts.map +1 -1
  111. package/dist/helpers/typeorm-db-helper.js +9 -0
  112. package/dist/helpers/typeorm-db-helper.js.map +1 -1
  113. package/dist/index.d.ts +6 -0
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +6 -0
  116. package/dist/index.js.map +1 -1
  117. package/dist/interfaces/active-user-data.interface.d.ts +1 -0
  118. package/dist/interfaces/active-user-data.interface.d.ts.map +1 -1
  119. package/dist/interfaces/active-user-data.interface.js.map +1 -1
  120. package/dist/repository/user-device-credential.repository.d.ts +12 -0
  121. package/dist/repository/user-device-credential.repository.d.ts.map +1 -0
  122. package/dist/repository/user-device-credential.repository.js +34 -0
  123. package/dist/repository/user-device-credential.repository.js.map +1 -0
  124. package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
  125. package/dist/seeders/module-metadata-seeder.service.js +7 -3
  126. package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
  127. package/dist/seeders/seed-data/solid-core-metadata.json +168 -2
  128. package/dist/services/api-key.service.d.ts.map +1 -1
  129. package/dist/services/api-key.service.js +1 -1
  130. package/dist/services/api-key.service.js.map +1 -1
  131. package/dist/services/authentication.service.d.ts +5 -4
  132. package/dist/services/authentication.service.d.ts.map +1 -1
  133. package/dist/services/authentication.service.js +50 -19
  134. package/dist/services/authentication.service.js.map +1 -1
  135. package/dist/services/chatter-message.service.d.ts +5 -1
  136. package/dist/services/chatter-message.service.d.ts.map +1 -1
  137. package/dist/services/chatter-message.service.js +48 -13
  138. package/dist/services/chatter-message.service.js.map +1 -1
  139. package/dist/services/crud-helper.service.d.ts +1 -2
  140. package/dist/services/crud-helper.service.d.ts.map +1 -1
  141. package/dist/services/crud-helper.service.js +2 -16
  142. package/dist/services/crud-helper.service.js.map +1 -1
  143. package/dist/services/crud.service.d.ts.map +1 -1
  144. package/dist/services/crud.service.js +2 -1
  145. package/dist/services/crud.service.js.map +1 -1
  146. package/dist/services/draft-publish-helper.service.d.ts +1 -0
  147. package/dist/services/draft-publish-helper.service.d.ts.map +1 -1
  148. package/dist/services/draft-publish-helper.service.js +38 -4
  149. package/dist/services/draft-publish-helper.service.js.map +1 -1
  150. package/dist/services/field-metadata.service.d.ts +2 -2
  151. package/dist/services/field-metadata.service.d.ts.map +1 -1
  152. package/dist/services/field-metadata.service.js +4 -1
  153. package/dist/services/field-metadata.service.js.map +1 -1
  154. package/dist/services/media-storage.utils.d.ts +1 -0
  155. package/dist/services/media-storage.utils.d.ts.map +1 -1
  156. package/dist/services/media-storage.utils.js +12 -1
  157. package/dist/services/media-storage.utils.js.map +1 -1
  158. package/dist/services/media.service.d.ts.map +1 -1
  159. package/dist/services/media.service.js +1 -0
  160. package/dist/services/media.service.js.map +1 -1
  161. package/dist/services/module-metadata.service.d.ts.map +1 -1
  162. package/dist/services/module-metadata.service.js +9 -1
  163. package/dist/services/module-metadata.service.js.map +1 -1
  164. package/dist/services/mpin.service.d.ts +67 -0
  165. package/dist/services/mpin.service.d.ts.map +1 -0
  166. package/dist/services/mpin.service.js +282 -0
  167. package/dist/services/mpin.service.js.map +1 -0
  168. package/dist/services/refresh-token-ids-storage.service.d.ts +25 -6
  169. package/dist/services/refresh-token-ids-storage.service.d.ts.map +1 -1
  170. package/dist/services/refresh-token-ids-storage.service.js +80 -42
  171. package/dist/services/refresh-token-ids-storage.service.js.map +1 -1
  172. package/dist/services/setting.service.d.ts.map +1 -1
  173. package/dist/services/setting.service.js +6 -1
  174. package/dist/services/setting.service.js.map +1 -1
  175. package/dist/services/settings/default-settings-provider.service.d.ts +206 -10
  176. package/dist/services/settings/default-settings-provider.service.d.ts.map +1 -1
  177. package/dist/services/settings/default-settings-provider.service.js +120 -5
  178. package/dist/services/settings/default-settings-provider.service.js.map +1 -1
  179. package/dist/solid-core.module.d.ts +1 -3
  180. package/dist/solid-core.module.d.ts.map +1 -1
  181. package/dist/solid-core.module.js +14 -39
  182. package/dist/solid-core.module.js.map +1 -1
  183. package/dist/testing/reporter/console-reporter.d.ts +3 -0
  184. package/dist/testing/reporter/console-reporter.d.ts.map +1 -1
  185. package/dist/testing/reporter/console-reporter.js +2 -0
  186. package/dist/testing/reporter/console-reporter.js.map +1 -1
  187. package/dist/testing/reporter/progress-reporter.d.ts +64 -0
  188. package/dist/testing/reporter/progress-reporter.d.ts.map +1 -0
  189. package/dist/testing/reporter/progress-reporter.js +224 -0
  190. package/dist/testing/reporter/progress-reporter.js.map +1 -0
  191. package/dist/testing/reporter/reporter.types.d.ts +3 -0
  192. package/dist/testing/reporter/reporter.types.d.ts.map +1 -1
  193. package/dist/testing/reporter/reporter.types.js.map +1 -1
  194. package/dist/testing/runner/run-from-metadata.d.ts.map +1 -1
  195. package/dist/testing/runner/run-from-metadata.js +1 -0
  196. package/dist/testing/runner/run-from-metadata.js.map +1 -1
  197. package/dist/theme/theme-registry.d.ts +14 -0
  198. package/dist/theme/theme-registry.d.ts.map +1 -0
  199. package/dist/theme/theme-registry.js +147 -0
  200. package/dist/theme/theme-registry.js.map +1 -0
  201. package/package.json +2 -2
  202. package/src/commands/run-tests.command.ts +17 -3
  203. package/src/config/cache.options.ts +9 -1
  204. package/src/constants/error-messages.ts +14 -0
  205. package/src/constants/media-file-types.ts +87 -9
  206. package/src/constants/success-messages.ts +5 -0
  207. package/src/controllers/authentication.controller.ts +5 -2
  208. package/src/controllers/mpin-authentication.controller.ts +67 -0
  209. package/src/dtos/change-mpin.dto.ts +18 -0
  210. package/src/dtos/create-field-metadata.dto.ts +17 -9
  211. package/src/dtos/create-model-sequence.dto.ts +1 -1
  212. package/src/dtos/mpin-login.dto.ts +24 -0
  213. package/src/dtos/setup-mpin.dto.ts +51 -0
  214. package/src/entities/common.entity.ts +8 -4
  215. package/src/entities/dashboard-user-layout.entity.ts +2 -2
  216. package/src/entities/field-metadata.entity.ts +3 -0
  217. package/src/entities/user-device-credential.entity.ts +130 -0
  218. package/src/entities/user.entity.ts +2 -2
  219. package/src/entities/view-metadata.entity.ts +2 -2
  220. package/src/entities/workflow-execution-artifact.entity.ts +4 -3
  221. package/src/entities/workflow-execution-log.entity.ts +4 -3
  222. package/src/entities/workflow-execution.entity.ts +3 -2
  223. package/src/entities/workflow-secret.entity.ts +3 -2
  224. package/src/entities/workflow-step-execution.entity.ts +3 -2
  225. package/src/entities/workflow-trigger-execution.entity.ts +6 -5
  226. package/src/filters/http-exception.filter.ts +11 -1
  227. package/src/helpers/bootstrap.helper.ts +43 -6
  228. package/src/helpers/field-crud-managers/MediaFieldCrudManager.ts +73 -34
  229. package/src/helpers/file-download.helper.ts +15 -1
  230. package/src/helpers/security.helper.ts +35 -8
  231. package/src/helpers/solid-core-error-codes-provider.service.ts +53 -0
  232. package/src/helpers/solid-microservice-adapter.service.ts +6 -1
  233. package/src/helpers/typeorm-db-helper.ts +12 -1
  234. package/src/index.ts +6 -0
  235. package/src/interfaces/active-user-data.interface.ts +9 -0
  236. package/src/repository/user-device-credential.repository.ts +17 -0
  237. package/src/seeders/module-metadata-seeder.service.ts +11 -3
  238. package/src/seeders/seed-data/solid-core-metadata.json +168 -2
  239. package/src/services/api-key.service.ts +13 -1
  240. package/src/services/authentication.service.ts +127 -36
  241. package/src/services/chatter-message.service.ts +78 -15
  242. package/src/services/crud-helper.service.ts +19 -16
  243. package/src/services/crud.service.ts +3 -1
  244. package/src/services/draft-publish-helper.service.ts +56 -4
  245. package/src/services/field-metadata.service.ts +5 -2
  246. package/src/services/media-storage.utils.ts +26 -1
  247. package/src/services/media.service.ts +1 -0
  248. package/src/services/module-metadata.service.ts +10 -1
  249. package/src/services/mpin.service.ts +447 -0
  250. package/src/services/refresh-token-ids-storage.service.ts +229 -90
  251. package/src/services/setting.service.ts +8 -1
  252. package/src/services/settings/default-settings-provider.service.ts +131 -5
  253. package/src/solid-core.module.ts +26 -12
  254. package/src/testing/README.md +11 -1
  255. package/src/testing/reporter/console-reporter.ts +4 -0
  256. package/src/testing/reporter/progress-reporter.ts +251 -0
  257. package/src/testing/reporter/reporter.types.ts +3 -0
  258. package/src/testing/runner/run-from-metadata.ts +1 -0
  259. package/src/theme/theme-registry.ts +181 -0
  260. package/CLAUDE.md +0 -26
@@ -1 +1 @@
1
- {"version":3,"file":"authentication.controller.js","sourceRoot":"","sources":["../../src/controllers/authentication.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAqI;AACrI,6CAAoE;AAEpE,+EAAiE;AACjE,qEAAwD;AACxD,qEAAgE;AAChE,qFAA+E;AAC/E,mEAA6D;AAC7D,mEAA6D;AAC7D,uFAAiF;AACjF,iEAA4D;AAC5D,+DAA0D;AAC1D,qDAAgD;AAChD,uEAAkE;AAClE,qDAAgD;AAEhD,iEAA4D;AAC5D,+EAA2E;AAQpE,IAAM,wBAAwB,gCAA9B,MAAM,wBAAwB;IAGjC,YACqB,WAAkC,EAClC,aAA4B;QAD5B,gBAAW,GAAX,WAAW,CAAuB;QAClC,kBAAa,GAAb,aAAa,CAAe;QAJhC,WAAM,GAAG,IAAI,eAAM,CAAC,0BAAwB,CAAC,IAAI,CAAC,CAAC;IAKhE,CAAC;IAKL,MAAM,CAAS,SAAoB;QAC/B,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;IAID,aAAa,CAAS,SAA6B,EAAgB,UAA0B;QACzF,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,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AJpC,IAAA,mBAAU,EAAC,KAAK,CAAC;IACjB,IAAA,iBAAO,EAAC,YAAY,CAAC;qCAOgB,8CAAqB;QACnB,+BAAa;GALxC,wBAAwB,CA8IpC","sourcesContent":["import { Body, Controller, Get, HttpCode, HttpStatus, Logger, Param, ParseIntPipe, Patch, Post, Res, Headers } from '@nestjs/common';\nimport { ApiBearerAuth, ApiHeader, ApiTags } from '@nestjs/swagger';\nimport { Response } from 'express';\nimport { ActiveUser } from \"../decorators/active-user.decorator\";\nimport { Public } from '../decorators/public.decorator';\nimport { ChangePasswordDto } from \"../dtos/change-password.dto\";\nimport { ConfirmForgotPasswordDto } from '../dtos/confirm-forgot-password.dto';\nimport { CreateApiKeyDto } from '../dtos/create-api-key.dto';\nimport { UpdateApiKeyDto } from '../dtos/update-api-key.dto';\nimport { InitiateForgotPasswordDto } from '../dtos/initiate-forgot-password.dto';\nimport { RefreshTokenDto } from '../dtos/refresh-token.dto';\nimport { SsoExchangeDto } from '../dtos/sso-exchange.dto';\nimport { SignInDto } from '../dtos/sign-in.dto';\nimport { RegisterPrivateDto } from '../dtos/register-private.dto';\nimport { SignUpDto } from '../dtos/sign-up.dto';\nimport { ActiveUserData } from \"../interfaces/active-user-data.interface\";\nimport { ApiKeyService } from '../services/api-key.service';\nimport { AuthenticationService } from '../services/authentication.service';\n\n\n// @Auth(AuthType.None)\n@Controller('iam')\n@ApiTags(\"Solid Core\")\n// @UseGuards(ThrottlerGuard)\n// @SkipThrottle({login: true, short: true, burst: true, sustained: true}) // disable all sets by default for this controller\nexport class AuthenticationController {\n private readonly logger = new Logger(AuthenticationController.name);\n\n constructor(\n private readonly authService: AuthenticationService,\n private readonly apiKeyService: ApiKeyService,\n ) { }\n\n @Public()\n // @SkipThrottle({ login: false, short: true, burst: true, sustained: true }) //Enable the login throttle only\n @Post('register')\n signUp(@Body() signUpDto: SignUpDto) {\n return this.authService.signUp(signUpDto);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('register-private')\n signUpPrivate(@Body() signUpDto: RegisterPrivateDto, @ActiveUser() activeUser: ActiveUserData) {\n return this.authService.signUp(signUpDto, activeUser);\n }\n\n @Public()\n // @SkipThrottle({ login: false, short: true, burst: true, sustained: true }) //Enable the login throttle only\n @HttpCode(HttpStatus.OK) // by default @Post does 201, we wanted 200 - hence using @HttpCode(HttpStatus.OK)\n @Post('authenticate')\n async signIn(\n @Res({ passthrough: true }) response: Response,\n @Body() signInDto: SignInDto\n ) {\n // This means that we are passing the token back in plain text. \n // This is less secure. \n // console.log(\"signInDto in Signin Controller\", signInDto);\n\n return this.authService.signIn(signInDto);\n\n // This means we are setting the token as a http only cookie.\n // const accessToken = await this.authService.signIn(signInDto);\n // response.cookie('accessToken', accessToken, {\n // secure: true,\n // httpOnly: true,\n // sameSite: true,\n // });\n }\n\n @Public()\n // @SkipThrottle({ login: false, short: true, burst: true, sustained: true }) //Enable the login throttle only\n @HttpCode(HttpStatus.OK) // changed since the default is 201\n @Post('refresh-tokens')\n refreshTokens(@Body() refreshTokenDto: RefreshTokenDto) {\n return this.authService.refreshTokens(refreshTokenDto);\n }\n\n @Public()\n // @SkipThrottle({ login: false, short: true, burst: true, sustained: true }) //Enable the login throttle only\n @Post('initiate/forgot-password')\n initiateForgotPassword(@Body() initiateForgotPasswordDto: InitiateForgotPasswordDto) {\n return this.authService.initiateForgotPassword(initiateForgotPasswordDto);\n }\n\n @Public()\n // @SkipThrottle({ login: false, short: true, burst: true, sustained: true }) //Enable the login throttle only\n @Post('confirm/forgot-password')\n confirmForgotPassword(@Body() confirmForgotPasswordDto: ConfirmForgotPasswordDto) {\n return this.authService.confirmForgotPassword(confirmForgotPasswordDto);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('change-password')\n changePassword(@Body() changePasswordDto: ChangePasswordDto, @ActiveUser() activeUser: ActiveUserData) {\n return this.authService.changePassword(changePasswordDto, activeUser);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get('me')\n me(\n @ActiveUser() activeUser: ActiveUserData\n ) {\n return this.authService.me(activeUser);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('logout')\n @Public()\n @HttpCode(HttpStatus.OK)\n async logout(@Body('refreshToken') refreshToken: string) {\n return this.authService.logout(refreshToken);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('api-keys')\n @HttpCode(HttpStatus.CREATED)\n generateApiKey(\n @Body() dto: CreateApiKeyDto,\n @ActiveUser() activeUser: ActiveUserData,\n ) {\n return this.apiKeyService.generate(activeUser.sub, dto);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('api-keys/users/:userId')\n @HttpCode(HttpStatus.CREATED)\n generateApiKeyForUser(\n @Param('userId', ParseIntPipe) userId: number,\n @Body() dto: CreateApiKeyDto,\n ) {\n return this.apiKeyService.generate(userId, dto);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Patch('api-keys/:id')\n @HttpCode(HttpStatus.OK)\n updateApiKey(\n @Param('id', ParseIntPipe) id: number,\n @Body() dto: UpdateApiKeyDto,\n @ActiveUser() activeUser: ActiveUserData,\n ) {\n return this.apiKeyService.updateKey(id, activeUser.sub, dto);\n }\n\n @Public()\n @ApiHeader({ name: 'solidx-api-key', required: true, description: 'API key for authenticating the request' })\n @Get('api-keys/me')\n async apiKeyMe(@Headers('solidx-api-key') apiKey: string) {\n return this.apiKeyService.apiKeyMe(apiKey);\n }\n\n @Post('sso/code')\n @HttpCode(HttpStatus.OK)\n generateSsoCode(\n @ActiveUser() activeUser: ActiveUserData, \n @Headers('authorization') authorization: string,\n ) {\n const rawAccessToken = authorization?.replace(/^Bearer\\s+/i, '');\n return this.authService.generateSsoCode(activeUser, rawAccessToken);\n }\n\n @Public()\n @Post('sso/exchange')\n @HttpCode(HttpStatus.OK)\n exchangeSsoCode(@Body() ssoExchangeDto: SsoExchangeDto) {\n return this.authService.exchangeSsoCode(ssoExchangeDto.code);\n }\n}\n"]}
1
+ {"version":3,"file":"authentication.controller.js","sourceRoot":"","sources":["../../src/controllers/authentication.contro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CAAC,CAAA;IACzB,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,kCAAU,GAAE,CAAA;;6CADA,oCAAe;;4DAI/B;AAKK;IAHL,IAAA,yBAAM,GAAE;IACR,IAAA,mBAAS,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;IAC5G,IAAA,YAAG,EAAC,aAAa,CAAC;;IACH,WAAA,IAAA,gBAAO,EAAC,gBAAgB,CAAC,CAAA;;;;wDAExC;AAID;IAFC,IAAA,aAAI,EAAC,UAAU,CAAC;IAChB,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;kCAAd,mBAAU,CAAC,EAAE;IAElB,WAAA,IAAA,kCAAU,GAAE,CAAA;IACZ,WAAA,IAAA,gBAAO,EAAC,eAAe,CAAC,CAAA;;;;+DAI5B;AAKD;IAHC,IAAA,yBAAM,GAAE;IACR,IAAA,aAAI,EAAC,cAAc,CAAC;IACpB,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;kCAAd,mBAAU,CAAC,EAAE;IACN,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAiB,iCAAc;;+DAErD;mCAhJQ,wBAAwB;IAJpC,IAAA,mBAAU,EAAC,KAAK,CAAC;IACjB,IAAA,iBAAO,EAAC,YAAY,CAAC;qCAOgB,8CAAqB;QACnB,+BAAa;GALxC,wBAAwB,CAiJpC","sourcesContent":["import { Body, Controller, Get, HttpCode, HttpStatus, Logger, Param, ParseIntPipe, Patch, Post, Res, Headers } from '@nestjs/common';\nimport { ApiBearerAuth, ApiHeader, ApiTags } from '@nestjs/swagger';\nimport { Response } from 'express';\nimport { ActiveUser } from \"../decorators/active-user.decorator\";\nimport { Public } from '../decorators/public.decorator';\nimport { ChangePasswordDto } from \"../dtos/change-password.dto\";\nimport { ConfirmForgotPasswordDto } from '../dtos/confirm-forgot-password.dto';\nimport { CreateApiKeyDto } from '../dtos/create-api-key.dto';\nimport { UpdateApiKeyDto } from '../dtos/update-api-key.dto';\nimport { InitiateForgotPasswordDto } from '../dtos/initiate-forgot-password.dto';\nimport { RefreshTokenDto } from '../dtos/refresh-token.dto';\nimport { SsoExchangeDto } from '../dtos/sso-exchange.dto';\nimport { SignInDto } from '../dtos/sign-in.dto';\nimport { RegisterPrivateDto } from '../dtos/register-private.dto';\nimport { SignUpDto } from '../dtos/sign-up.dto';\nimport { ActiveUserData } from \"../interfaces/active-user-data.interface\";\nimport { ApiKeyService } from '../services/api-key.service';\nimport { AuthenticationService } from '../services/authentication.service';\n\n\n// @Auth(AuthType.None)\n@Controller('iam')\n@ApiTags(\"Solid Core\")\n// @UseGuards(ThrottlerGuard)\n// @SkipThrottle({login: true, short: true, burst: true, sustained: true}) // disable all sets by default for this controller\nexport class AuthenticationController {\n private readonly logger = new Logger(AuthenticationController.name);\n\n constructor(\n private readonly authService: AuthenticationService,\n private readonly apiKeyService: ApiKeyService,\n ) { }\n\n @Public()\n // @SkipThrottle({ login: false, short: true, burst: true, sustained: true }) //Enable the login throttle only\n @Post('register')\n signUp(@Body() signUpDto: SignUpDto) {\n return this.authService.signUp(signUpDto);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('register-private')\n signUpPrivate(@Body() signUpDto: RegisterPrivateDto, @ActiveUser() activeUser: ActiveUserData) {\n return this.authService.signUp(signUpDto, activeUser);\n }\n\n @Public()\n // @SkipThrottle({ login: false, short: true, burst: true, sustained: true }) //Enable the login throttle only\n @HttpCode(HttpStatus.OK) // by default @Post does 201, we wanted 200 - hence using @HttpCode(HttpStatus.OK)\n @Post('authenticate')\n async signIn(\n @Res({ passthrough: true }) response: Response,\n @Body() signInDto: SignInDto\n ) {\n // This means that we are passing the token back in plain text. \n // This is less secure. \n // console.log(\"signInDto in Signin Controller\", signInDto);\n\n return this.authService.signIn(signInDto);\n\n // This means we are setting the token as a http only cookie.\n // const accessToken = await this.authService.signIn(signInDto);\n // response.cookie('accessToken', accessToken, {\n // secure: true,\n // httpOnly: true,\n // sameSite: true,\n // });\n }\n\n @Public()\n // @SkipThrottle({ login: false, short: true, burst: true, sustained: true }) //Enable the login throttle only\n @HttpCode(HttpStatus.OK) // changed since the default is 201\n @Post('refresh-tokens')\n refreshTokens(@Body() refreshTokenDto: RefreshTokenDto) {\n return this.authService.refreshTokens(refreshTokenDto);\n }\n\n @Public()\n // @SkipThrottle({ login: false, short: true, burst: true, sustained: true }) //Enable the login throttle only\n @Post('initiate/forgot-password')\n initiateForgotPassword(@Body() initiateForgotPasswordDto: InitiateForgotPasswordDto) {\n return this.authService.initiateForgotPassword(initiateForgotPasswordDto);\n }\n\n @Public()\n // @SkipThrottle({ login: false, short: true, burst: true, sustained: true }) //Enable the login throttle only\n @Post('confirm/forgot-password')\n confirmForgotPassword(@Body() confirmForgotPasswordDto: ConfirmForgotPasswordDto) {\n return this.authService.confirmForgotPassword(confirmForgotPasswordDto);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('change-password')\n changePassword(@Body() changePasswordDto: ChangePasswordDto, @ActiveUser() activeUser: ActiveUserData) {\n return this.authService.changePassword(changePasswordDto, activeUser);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get('me')\n me(\n @ActiveUser() activeUser: ActiveUserData\n ) {\n return this.authService.me(activeUser);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('logout')\n @Public()\n @HttpCode(HttpStatus.OK)\n async logout(\n @Body('refreshToken') refreshToken: string,\n @Body('allDevices') allDevices?: boolean,\n ) {\n return this.authService.logout(refreshToken, allDevices === true);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('api-keys')\n @HttpCode(HttpStatus.CREATED)\n generateApiKey(\n @Body() dto: CreateApiKeyDto,\n @ActiveUser() activeUser: ActiveUserData,\n ) {\n return this.apiKeyService.generate(activeUser.sub, dto);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('api-keys/users/:userId')\n @HttpCode(HttpStatus.CREATED)\n generateApiKeyForUser(\n @Param('userId', ParseIntPipe) userId: number,\n @Body() dto: CreateApiKeyDto,\n ) {\n return this.apiKeyService.generate(userId, dto);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Patch('api-keys/:id')\n @HttpCode(HttpStatus.OK)\n updateApiKey(\n @Param('id', ParseIntPipe) id: number,\n @Body() dto: UpdateApiKeyDto,\n @ActiveUser() activeUser: ActiveUserData,\n ) {\n return this.apiKeyService.updateKey(id, activeUser.sub, dto);\n }\n\n @Public()\n @ApiHeader({ name: 'solidx-api-key', required: true, description: 'API key for authenticating the request' })\n @Get('api-keys/me')\n async apiKeyMe(@Headers('solidx-api-key') apiKey: string) {\n return this.apiKeyService.apiKeyMe(apiKey);\n }\n\n @Post('sso/code')\n @HttpCode(HttpStatus.OK)\n generateSsoCode(\n @ActiveUser() activeUser: ActiveUserData, \n @Headers('authorization') authorization: string,\n ) {\n const rawAccessToken = authorization?.replace(/^Bearer\\s+/i, '');\n return this.authService.generateSsoCode(activeUser, rawAccessToken);\n }\n\n @Public()\n @Post('sso/exchange')\n @HttpCode(HttpStatus.OK)\n exchangeSsoCode(@Body() ssoExchangeDto: SsoExchangeDto) {\n return this.authService.exchangeSsoCode(ssoExchangeDto.code);\n }\n}\n"]}
@@ -347,8 +347,8 @@ export declare class FieldMetadataController {
347
347
  value: unknown;
348
348
  }[];
349
349
  mediaTypes: {
350
- label: unknown;
351
- value: unknown;
350
+ label: "file" | "image" | "audio" | "video" | "pdf";
351
+ value: "file" | "image" | "audio" | "video" | "pdf";
352
352
  }[];
353
353
  relationTypes: {
354
354
  label: unknown;
@@ -0,0 +1,44 @@
1
+ import { ChangeMpinDto } from '../dtos/change-mpin.dto';
2
+ import { MpinLoginDto } from '../dtos/mpin-login.dto';
3
+ import { SetupMpinDto } from '../dtos/setup-mpin.dto';
4
+ import { ActiveUserData } from '../interfaces/active-user-data.interface';
5
+ import { MpinService } from '../services/mpin.service';
6
+ export declare class MpinAuthenticationController {
7
+ private readonly mpinService;
8
+ constructor(mpinService: MpinService);
9
+ setup(setupMpinDto: SetupMpinDto, activeUser: ActiveUserData): Promise<{
10
+ credentialRef: string;
11
+ message: string;
12
+ }>;
13
+ change(changeMpinDto: ChangeMpinDto, activeUser: ActiveUserData): Promise<{
14
+ credentialRef: string;
15
+ message: string;
16
+ }>;
17
+ login(mpinLoginDto: MpinLoginDto): Promise<{
18
+ accessToken: string;
19
+ refreshToken: string;
20
+ user: {
21
+ id: number;
22
+ email: string;
23
+ mobile: string;
24
+ username: string;
25
+ forcePasswordChange: boolean;
26
+ roles: string[];
27
+ };
28
+ }>;
29
+ listDevices(activeUser: ActiveUserData): Promise<{
30
+ id: number;
31
+ deviceId: string;
32
+ deviceName: string;
33
+ platform: string;
34
+ isActive: boolean;
35
+ failedAttempts: number;
36
+ lockedUntil: Date;
37
+ lastUsedAt: Date;
38
+ createdAt: Date;
39
+ }[]>;
40
+ revokeDevice(id: number, activeUser: ActiveUserData): Promise<{
41
+ message: string;
42
+ }>;
43
+ }
44
+ //# sourceMappingURL=mpin-authentication.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpin-authentication.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/mpin-authentication.controller.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAQvD,qBAEa,4BAA4B;IACzB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAKrD,KAAK,CACO,YAAY,EAAE,YAAY,EACpB,UAAU,EAAE,cAAc;;;;IAQ5C,MAAM,CACM,aAAa,EAAE,aAAa,EACtB,UAAU,EAAE,cAAc;;;;IAU5C,KAAK,CAAS,YAAY,EAAE,YAAY;;;;;;;;;;;;IAMxC,WAAW,CAAe,UAAU,EAAE,cAAc;;;;;;;;;;;IAQpD,YAAY,CACmB,EAAE,EAAE,MAAM,EACvB,UAAU,EAAE,cAAc;;;CAI/C"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.MpinAuthenticationController = void 0;
16
+ const openapi = require("@nestjs/swagger");
17
+ const common_1 = require("@nestjs/common");
18
+ const swagger_1 = require("@nestjs/swagger");
19
+ const active_user_decorator_1 = require("../decorators/active-user.decorator");
20
+ const public_decorator_1 = require("../decorators/public.decorator");
21
+ const change_mpin_dto_1 = require("../dtos/change-mpin.dto");
22
+ const mpin_login_dto_1 = require("../dtos/mpin-login.dto");
23
+ const setup_mpin_dto_1 = require("../dtos/setup-mpin.dto");
24
+ const mpin_service_1 = require("../services/mpin.service");
25
+ let MpinAuthenticationController = class MpinAuthenticationController {
26
+ constructor(mpinService) {
27
+ this.mpinService = mpinService;
28
+ }
29
+ setup(setupMpinDto, activeUser) {
30
+ return this.mpinService.setupMpin(activeUser, setupMpinDto);
31
+ }
32
+ change(changeMpinDto, activeUser) {
33
+ return this.mpinService.changeMpin(activeUser, changeMpinDto);
34
+ }
35
+ login(mpinLoginDto) {
36
+ return this.mpinService.loginWithMpin(mpinLoginDto);
37
+ }
38
+ listDevices(activeUser) {
39
+ return this.mpinService.listDevices(activeUser);
40
+ }
41
+ revokeDevice(id, activeUser) {
42
+ return this.mpinService.revokeDevice(activeUser, id);
43
+ }
44
+ };
45
+ exports.MpinAuthenticationController = MpinAuthenticationController;
46
+ __decorate([
47
+ (0, swagger_1.ApiBearerAuth)('jwt'),
48
+ (0, common_1.Post)('setup'),
49
+ (0, common_1.HttpCode)(common_1.HttpStatus.OK),
50
+ openapi.ApiResponse({ status: common_1.HttpStatus.OK }),
51
+ __param(0, (0, common_1.Body)()),
52
+ __param(1, (0, active_user_decorator_1.ActiveUser)()),
53
+ __metadata("design:type", Function),
54
+ __metadata("design:paramtypes", [setup_mpin_dto_1.SetupMpinDto, Object]),
55
+ __metadata("design:returntype", void 0)
56
+ ], MpinAuthenticationController.prototype, "setup", null);
57
+ __decorate([
58
+ (0, swagger_1.ApiBearerAuth)('jwt'),
59
+ (0, common_1.Post)('change'),
60
+ (0, common_1.HttpCode)(common_1.HttpStatus.OK),
61
+ openapi.ApiResponse({ status: common_1.HttpStatus.OK }),
62
+ __param(0, (0, common_1.Body)()),
63
+ __param(1, (0, active_user_decorator_1.ActiveUser)()),
64
+ __metadata("design:type", Function),
65
+ __metadata("design:paramtypes", [change_mpin_dto_1.ChangeMpinDto, Object]),
66
+ __metadata("design:returntype", void 0)
67
+ ], MpinAuthenticationController.prototype, "change", null);
68
+ __decorate([
69
+ (0, public_decorator_1.Public)(),
70
+ (0, common_1.Post)('login'),
71
+ (0, common_1.HttpCode)(common_1.HttpStatus.OK),
72
+ openapi.ApiResponse({ status: common_1.HttpStatus.OK }),
73
+ __param(0, (0, common_1.Body)()),
74
+ __metadata("design:type", Function),
75
+ __metadata("design:paramtypes", [mpin_login_dto_1.MpinLoginDto]),
76
+ __metadata("design:returntype", void 0)
77
+ ], MpinAuthenticationController.prototype, "login", null);
78
+ __decorate([
79
+ (0, swagger_1.ApiBearerAuth)('jwt'),
80
+ (0, common_1.Get)('devices'),
81
+ openapi.ApiResponse({ status: 200 }),
82
+ __param(0, (0, active_user_decorator_1.ActiveUser)()),
83
+ __metadata("design:type", Function),
84
+ __metadata("design:paramtypes", [Object]),
85
+ __metadata("design:returntype", void 0)
86
+ ], MpinAuthenticationController.prototype, "listDevices", null);
87
+ __decorate([
88
+ (0, swagger_1.ApiBearerAuth)('jwt'),
89
+ (0, common_1.Delete)('devices/:id'),
90
+ openapi.ApiResponse({ status: 200 }),
91
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
92
+ __param(1, (0, active_user_decorator_1.ActiveUser)()),
93
+ __metadata("design:type", Function),
94
+ __metadata("design:paramtypes", [Number, Object]),
95
+ __metadata("design:returntype", void 0)
96
+ ], MpinAuthenticationController.prototype, "revokeDevice", null);
97
+ exports.MpinAuthenticationController = MpinAuthenticationController = __decorate([
98
+ (0, common_1.Controller)('iam/mpin'),
99
+ (0, swagger_1.ApiTags)('Solid Core'),
100
+ __metadata("design:paramtypes", [mpin_service_1.MpinService])
101
+ ], MpinAuthenticationController);
102
+ //# sourceMappingURL=mpin-authentication.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpin-authentication.controller.js","sourceRoot":"","sources":["../../src/controllers/mpin-authentication.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAgH;AAChH,6CAAyD;AACzD,+EAAiE;AACjE,qEAAwD;AACxD,6DAAwD;AACxD,2DAAsD;AACtD,2DAAsD;AAEtD,2DAAuD;AAUhD,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACrC,YAA6B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAI,CAAC;IAK1D,KAAK,CACO,YAA0B,EACpB,UAA0B;QAExC,OAAO,IAAI,CAAC,WAA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CAAA;;qCAAe,6BAAY;;yDAEvC;AAID;IAFC,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,YAAG,EAAC,SAAS,CAAC;;IACF,WAAA,IAAA,kCAAU,GAAE,CAAA;;;;+DAExB;AAMD;IAFC,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,eAAM,EAAC,aAAa,CAAC;;IAEjB,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IACzB,WAAA,IAAA,kCAAU,GAAE,CAAA;;;;gEAGhB;uCA/CQ,4BAA4B;IAFxC,IAAA,mBAAU,EAAC,UAAU,CAAC;IACtB,IAAA,iBAAO,EAAC,YAAY,CAAC;qCAEwB,0BAAW;GAD5C,4BAA4B,CAgDxC","sourcesContent":["import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, ParseIntPipe, Post } from '@nestjs/common';\nimport { ApiBearerAuth, ApiTags } from '@nestjs/swagger';\nimport { ActiveUser } from '../decorators/active-user.decorator';\nimport { Public } from '../decorators/public.decorator';\nimport { ChangeMpinDto } from '../dtos/change-mpin.dto';\nimport { MpinLoginDto } from '../dtos/mpin-login.dto';\nimport { SetupMpinDto } from '../dtos/setup-mpin.dto';\nimport { ActiveUserData } from '../interfaces/active-user-data.interface';\nimport { MpinService } from '../services/mpin.service';\n\n/**\n * There is deliberately no public \"is MPIN set up for this identifier\" route.\n * That would reintroduce exactly the user-enumeration oracle the opaque\n * credential handle removes. The client decides whether to show the MPIN\n * screen from the presence of its own stored handle.\n */\n@Controller('iam/mpin')\n@ApiTags('Solid Core')\nexport class MpinAuthenticationController {\n constructor(private readonly mpinService: MpinService) { }\n\n @ApiBearerAuth('jwt')\n @Post('setup')\n @HttpCode(HttpStatus.OK)\n setup(\n @Body() setupMpinDto: SetupMpinDto,\n @ActiveUser() activeUser: ActiveUserData,\n ) {\n return this.mpinService.setupMpin(activeUser, setupMpinDto);\n }\n\n @ApiBearerAuth('jwt')\n @Post('change')\n @HttpCode(HttpStatus.OK)\n change(\n @Body() changeMpinDto: ChangeMpinDto,\n @ActiveUser() activeUser: ActiveUserData,\n ) {\n return this.mpinService.changeMpin(activeUser, changeMpinDto);\n }\n\n // Public by necessity - the caller has no session yet. The credential\n // handle is unguessable, so this carries no enumeration surface.\n @Public()\n @Post('login')\n @HttpCode(HttpStatus.OK)\n login(@Body() mpinLoginDto: MpinLoginDto) {\n return this.mpinService.loginWithMpin(mpinLoginDto);\n }\n\n @ApiBearerAuth('jwt')\n @Get('devices')\n listDevices(@ActiveUser() activeUser: ActiveUserData) {\n return this.mpinService.listDevices(activeUser);\n }\n\n // By row id, never by credential handle, so the management UI never has to\n // hold the secret.\n @ApiBearerAuth('jwt')\n @Delete('devices/:id')\n revokeDevice(\n @Param('id', ParseIntPipe) id: number,\n @ActiveUser() activeUser: ActiveUserData,\n ) {\n return this.mpinService.revokeDevice(activeUser, id);\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export declare class ChangeMpinDto {
2
+ credentialRef: string;
3
+ currentMpin: string;
4
+ newMpin: string;
5
+ }
6
+ //# sourceMappingURL=change-mpin.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-mpin.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/change-mpin.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,aAAa;IAItB,aAAa,EAAE,MAAM,CAAC;IAKtB,WAAW,EAAE,MAAM,CAAC;IAKpB,OAAO,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ChangeMpinDto = void 0;
13
+ const openapi = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ class ChangeMpinDto {
16
+ static _OPENAPI_METADATA_FACTORY() {
17
+ return { credentialRef: { required: true, type: () => String, maxLength: 128 }, currentMpin: { required: true, type: () => String, maxLength: 32 }, newMpin: { required: true, type: () => String, maxLength: 32 } };
18
+ }
19
+ }
20
+ exports.ChangeMpinDto = ChangeMpinDto;
21
+ __decorate([
22
+ (0, class_validator_1.IsNotEmpty)(),
23
+ (0, class_validator_1.IsString)(),
24
+ (0, class_validator_1.MaxLength)(128),
25
+ __metadata("design:type", String)
26
+ ], ChangeMpinDto.prototype, "credentialRef", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsNotEmpty)(),
29
+ (0, class_validator_1.IsString)(),
30
+ (0, class_validator_1.MaxLength)(32),
31
+ __metadata("design:type", String)
32
+ ], ChangeMpinDto.prototype, "currentMpin", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ (0, class_validator_1.IsString)(),
36
+ (0, class_validator_1.MaxLength)(32),
37
+ __metadata("design:type", String)
38
+ ], ChangeMpinDto.prototype, "newMpin", void 0);
39
+ //# sourceMappingURL=change-mpin.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-mpin.dto.js","sourceRoot":"","sources":["../../src/dtos/change-mpin.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAAkE;AAElE,MAAa,aAAa;;;;CAezB;AAfD,sCAeC;AAXG;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;;oDACO;AAKtB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,EAAE,CAAC;;kDACM;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,EAAE,CAAC;;8CACE","sourcesContent":["import { IsNotEmpty, IsString, MaxLength } from 'class-validator';\n\nexport class ChangeMpinDto {\n @IsNotEmpty()\n @IsString()\n @MaxLength(128)\n credentialRef: string;\n\n @IsNotEmpty()\n @IsString()\n @MaxLength(32)\n currentMpin: string;\n\n @IsNotEmpty()\n @IsString()\n @MaxLength(32)\n newMpin: string;\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { MediaCategory } from '../constants/media-file-types';
1
2
  export declare enum RelationFieldsCommand {
2
3
  set = "set",
3
4
  clear = "clear",
@@ -86,12 +87,7 @@ export declare enum DecryptWhenType {
86
87
  beforeTransit = "before-transit",
87
88
  afterTransit = "after-transit"
88
89
  }
89
- export declare enum MediaType {
90
- image = "image",
91
- audio = "audio",
92
- video = "video",
93
- file = "file"
94
- }
90
+ export type MediaType = MediaCategory;
95
91
  export declare enum RelationType {
96
92
  manyToOne = "many-to-one",
97
93
  manyTomany = "many-to-many",
@@ -149,6 +145,7 @@ export declare class CreateFieldMetadataDto {
149
145
  private: boolean;
150
146
  mediaTypes: MediaType[];
151
147
  mediaMaxSizeKb: number;
148
+ mediaAllowedExtensions?: string[];
152
149
  mediaStorageProviderId?: number;
153
150
  mediaStorageProviderUserKey?: string;
154
151
  relationType: RelationType;
@@ -1 +1 @@
1
- {"version":3,"file":"create-field-metadata.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-field-metadata.dto.ts"],"names":[],"mappings":"AAcA,oBAAY,qBAAqB;IAC/B,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,M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M,CAAC;IAYvB,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAKlC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAKhC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IAUrC,YAAY,EAAE,YAAY,CAAC;IAK3B,2BAA2B,EAAE,MAAM,CAAC;IAKpC,qBAAqB,EAAE,OAAO,CAAC;IAK/B,eAAe,EAAE,WAAW,CAAC;IAI7B,uBAAuB,EAAE,MAAM,CAAC;IAIhC,wBAAwB,EAAE,MAAM,CAAC;IAIjC,yBAAyB,EAAE,OAAO,CAAC;IAKnC,wBAAwB,EAAE,MAAM,CAAC;IAQjC,wBAAwB,EAAE,MAAM,CAAC;IAKjC,4BAA4B,EAAE,MAAM,CAAC;IAOrC,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAKhC,kBAAkB,EAAE,kBAAkB,CAAC;IAKvC,0BAA0B,EAAE,MAAM,CAAC;IAKnC,8BAA8B,EAAE,MAAM,CAAC;IAKvC,sBAAsB,EAAE,sBAAsB,CAAC;IAK/C,0BAA0B,EAAE,0BAA0B,EAAE,CAAC;IAMzD,IAAI,EAAE,MAAM,CAAC;IAKb,QAAQ,EAAE,OAAO,CAAC;IAKlB,kBAAkB,EAAE,OAAO,CAAC;IAK5B,UAAU,EAAE,MAAM,CAAA;IAKlB,yBAAyB,EAAE,MAAM,CAAA;IAKjC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAK3B,qBAAqB,EAAE,MAAM,CAAA;IAK7B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAK9B,aAAa,EAAE,OAAO,CAAC;IAKvB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB"}
@@ -9,10 +9,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CreateFieldMetadataDto = exports.ComputedFieldTriggerConfig = exports.ComputedFieldTriggerOperation = exports.ComputedFieldValueType = exports.SelectionValueType = exports.CascadeType = exports.RelationType = exports.MediaType = exports.DecryptWhenType = exports.EncryptionType = exports.ALL_ORM_TYPES = exports.MSSQLType = exports.PSQLType = exports.MySQLType = exports.SolidFieldType = exports.RelationFieldsCommand = void 0;
12
+ exports.CreateFieldMetadataDto = exports.ComputedFieldTriggerConfig = exports.ComputedFieldTriggerOperation = exports.ComputedFieldValueType = exports.SelectionValueType = exports.CascadeType = exports.RelationType = exports.DecryptWhenType = exports.EncryptionType = exports.ALL_ORM_TYPES = exports.MSSQLType = exports.PSQLType = exports.MySQLType = exports.SolidFieldType = exports.RelationFieldsCommand = void 0;
13
13
  const openapi = require("@nestjs/swagger");
14
14
  const swagger_1 = require("@nestjs/swagger");
15
15
  const class_transformer_1 = require("class-transformer");
16
+ const media_file_types_1 = require("../constants/media-file-types");
16
17
  const class_validator_1 = require("class-validator");
17
18
  var RelationFieldsCommand;
18
19
  (function (RelationFieldsCommand) {
@@ -112,13 +113,6 @@ var DecryptWhenType;
112
113
  DecryptWhenType["beforeTransit"] = "before-transit";
113
114
  DecryptWhenType["afterTransit"] = "after-transit";
114
115
  })(DecryptWhenType || (exports.DecryptWhenType = DecryptWhenType = {}));
115
- var MediaType;
116
- (function (MediaType) {
117
- MediaType["image"] = "image";
118
- MediaType["audio"] = "audio";
119
- MediaType["video"] = "video";
120
- MediaType["file"] = "file";
121
- })(MediaType || (exports.MediaType = MediaType = {}));
122
116
  var RelationType;
123
117
  (function (RelationType) {
124
118
  RelationType["manyToOne"] = "many-to-one";
@@ -162,7 +156,7 @@ class ComputedFieldTriggerConfig {
162
156
  exports.ComputedFieldTriggerConfig = ComputedFieldTriggerConfig;
163
157
  class CreateFieldMetadataDto {
164
158
  static _OPENAPI_METADATA_FACTORY() {
165
- return { name: { required: true, type: () => String }, displayName: { required: true, type: () => String }, description: { required: true, type: () => String }, type: { required: true, enum: require("./create-field-metadata.dto").SolidFieldType }, modelId: { required: true, type: () => Number }, ormType: { required: true, type: () => Object, enum: exports.ALL_ORM_TYPES }, length: { required: true, type: () => Number }, defaultValue: { required: true, type: () => String }, regexPattern: { required: true, type: () => String }, regexPatternNotMatchingErrorMsg: { required: true, type: () => String }, required: { required: true, type: () => Boolean }, unique: { required: true, type: () => Boolean }, encrypt: { required: true, type: () => Boolean }, encryptionType: { required: true, enum: require("./create-field-metadata.dto").EncryptionType }, decryptWhen: { required: true, enum: require("./create-field-metadata.dto").DecryptWhenType }, index: { required: true, type: () => Boolean }, max: { required: true, type: () => Number }, min: { required: true, type: () => Number }, private: { required: true, type: () => Boolean }, mediaTypes: { required: true, enum: require("./create-field-metadata.dto").MediaType, isArray: true }, mediaMaxSizeKb: { required: true, type: () => Number }, mediaStorageProviderId: { required: false, type: () => Number }, mediaStorageProviderUserKey: { required: false, type: () => String }, relationType: { required: true, enum: require("./create-field-metadata.dto").RelationType }, relationCoModelSingularName: { required: true, type: () => String }, relationCreateInverse: { required: true, type: () => Boolean }, relationCascade: { required: true, enum: require("./create-field-metadata.dto").CascadeType }, relationModelModuleName: { required: true, type: () => String }, relationCoModelFieldName: { required: true, type: () => String }, isRelationManyToManyOwner: { required: true, type: () => Boolean }, relationFieldFixedFilter: { required: true, type: () => String }, selectionDynamicProvider: { required: true, type: () => String }, selectionDynamicProviderCtxt: { required: true, type: () => String }, selectionStaticValues: { required: true, type: () => [String] }, selectionValueType: { required: true, enum: require("./create-field-metadata.dto").SelectionValueType }, computedFieldValueProvider: { required: true, type: () => String }, computedFieldValueProviderCtxt: { required: true, type: () => String }, computedFieldValueType: { required: true, enum: require("./create-field-metadata.dto").ComputedFieldValueType }, computedFieldTriggerConfig: { required: true, type: () => [require("./create-field-metadata.dto").ComputedFieldTriggerConfig] }, uuid: { required: true, type: () => String }, isSystem: { required: true, type: () => Boolean }, isMarkedForRemoval: { required: true, type: () => Boolean }, columnName: { required: true, type: () => String }, relationCoModelColumnName: { required: true, type: () => String }, isUserKey: { required: true, type: () => Boolean }, relationJoinTableName: { required: true, type: () => String }, enableAuditTracking: { required: false, type: () => Boolean }, isMultiSelect: { required: true, type: () => Boolean }, isPrimaryKey: { required: false, type: () => Boolean } };
159
+ return { name: { required: true, type: () => String }, displayName: { required: true, type: () => String }, description: { required: true, type: () => String }, type: { required: true, enum: require("./create-field-metadata.dto").SolidFieldType }, modelId: { required: true, type: () => Number }, ormType: { required: true, type: () => Object, enum: exports.ALL_ORM_TYPES }, length: { required: true, type: () => Number }, defaultValue: { required: true, type: () => String }, regexPattern: { required: true, type: () => String }, regexPatternNotMatchingErrorMsg: { required: true, type: () => String }, required: { required: true, type: () => Boolean }, unique: { required: true, type: () => Boolean }, encrypt: { required: true, type: () => Boolean }, encryptionType: { required: true, enum: require("./create-field-metadata.dto").EncryptionType }, decryptWhen: { required: true, enum: require("./create-field-metadata.dto").DecryptWhenType }, index: { required: true, type: () => Boolean }, max: { required: true, type: () => Number }, min: { required: true, type: () => Number }, private: { required: true, type: () => Boolean }, mediaTypes: { required: true, type: () => [Object], enum: [...media_file_types_1.MEDIA_CATEGORIES] }, mediaMaxSizeKb: { required: true, type: () => Number }, mediaAllowedExtensions: { required: false, type: () => [String] }, mediaStorageProviderId: { required: false, type: () => Number }, mediaStorageProviderUserKey: { required: false, type: () => String }, relationType: { required: true, enum: require("./create-field-metadata.dto").RelationType }, relationCoModelSingularName: { required: true, type: () => String }, relationCreateInverse: { required: true, type: () => Boolean }, relationCascade: { required: true, enum: require("./create-field-metadata.dto").CascadeType }, relationModelModuleName: { required: true, type: () => String }, relationCoModelFieldName: { required: true, type: () => String }, isRelationManyToManyOwner: { required: true, type: () => Boolean }, relationFieldFixedFilter: { required: true, type: () => String }, selectionDynamicProvider: { required: true, type: () => String }, selectionDynamicProviderCtxt: { required: true, type: () => String }, selectionStaticValues: { required: true, type: () => [String] }, selectionValueType: { required: true, enum: require("./create-field-metadata.dto").SelectionValueType }, computedFieldValueProvider: { required: true, type: () => String }, computedFieldValueProviderCtxt: { required: true, type: () => String }, computedFieldValueType: { required: true, enum: require("./create-field-metadata.dto").ComputedFieldValueType }, computedFieldTriggerConfig: { required: true, type: () => [require("./create-field-metadata.dto").ComputedFieldTriggerConfig] }, uuid: { required: true, type: () => String }, isSystem: { required: true, type: () => Boolean }, isMarkedForRemoval: { required: true, type: () => Boolean }, columnName: { required: true, type: () => String }, relationCoModelColumnName: { required: true, type: () => String }, isUserKey: { required: true, type: () => Boolean }, relationJoinTableName: { required: true, type: () => String }, enableAuditTracking: { required: false, type: () => Boolean }, isMultiSelect: { required: true, type: () => Boolean }, isPrimaryKey: { required: false, type: () => Boolean } };
166
160
  }
167
161
  }
168
162
  exports.CreateFieldMetadataDto = CreateFieldMetadataDto;
@@ -275,7 +269,7 @@ __decorate([
275
269
  ], CreateFieldMetadataDto.prototype, "private", void 0);
276
270
  __decorate([
277
271
  (0, swagger_1.ApiProperty)({ description: 'Allowed media types for the field. Only for type=mediaSingle,mediaMultiple', }),
278
- (0, class_validator_1.IsEnum)(MediaType, { each: true }),
272
+ (0, class_validator_1.IsIn)([...media_file_types_1.MEDIA_CATEGORIES], { each: true }),
279
273
  (0, class_validator_1.IsOptional)(),
280
274
  __metadata("design:type", Array)
281
275
  ], CreateFieldMetadataDto.prototype, "mediaTypes", void 0);
@@ -285,6 +279,17 @@ __decorate([
285
279
  (0, class_validator_1.IsOptional)(),
286
280
  __metadata("design:type", Number)
287
281
  ], CreateFieldMetadataDto.prototype, "mediaMaxSizeKb", void 0);
282
+ __decorate([
283
+ (0, swagger_1.ApiProperty)({ description: 'Explicit allowlist of file extensions (e.g. ["pdf","xlsx","png"]) permitted for this field, checked in addition to any mediaTypes category restriction — both must pass if both are set. For a strict allowlist, leave mediaTypes empty and use this alone. Only for type=mediaSingle,mediaMultiple', }),
284
+ (0, class_transformer_1.Transform)(({ value }) => Array.isArray(value)
285
+ ? value.map((ext) => String(ext).toLowerCase().trim().replace(/^\./, ''))
286
+ : value),
287
+ (0, class_validator_1.IsArray)(),
288
+ (0, class_validator_1.IsString)({ each: true }),
289
+ (0, class_validator_1.IsNotIn)([...media_file_types_1.DANGEROUS_EXTENSIONS], { each: true }),
290
+ (0, class_validator_1.IsOptional)(),
291
+ __metadata("design:type", Array)
292
+ ], CreateFieldMetadataDto.prototype, "mediaAllowedExtensions", void 0);
288
293
  __decorate([
289
294
  (0, swagger_1.ApiProperty)({ description: 'Configured Media storage provider. Only for type=mediaSingle,mediaMultiple', }),
290
295
  (0, class_validator_1.IsInt)(),
@@ -1 +1 @@
1
- {"version":3,"file":"create-field-metadata.dto.js","sourceRoot":"","sources":["../../src/dtos/create-field-metadata.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,yDAAoD;AAEpD,qDAUyB;AACzB,IAAY,qBAQX;AARD,WAAY,qBAAqB;IAC/B,oCAAW,CAAA;IACX,wCAAe,CAAA;IACf,sCAAa,CAAA;IACb,0CAAiB,CAAA;IACjB,0CAAiB,CAAA;IACjB,0CAAiB,CAAA;IACjB,0CAAiB,CAAA;AACnB,CAAC,EARW,qBAAqB,qCAArB,qBAAqB,QAQhC;AAED,IAAY,cAuCX;AAvCD,WAAY,cAAc;IAExB,6BAAW,CAAA;IACX,mCAAiB,CAAA;IAGjB,qCAAmB,CAAA;IAGnB,yCAAuB,CAAA;IACvB,uCAAqB,CAAA;IACrB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;IAGb,qCAAmB,CAAA;IAGnB,+BAAa,CAAA;IACb,uCAAqB,CAAA;IACrB,+BAAa,CAAA;IAGb,uCAAqB,CAAA;IAGrB,6CAA2B,CAAA;IAC3B,iDAA+B,CAAA;IAE/B,iCAAe,CAAA;IACf,uCAAqB,CAAA;IAGrB,qDAAmC,CAAA;IACnC,uDAAqC,CAAA;IAErC,uCAAqB,CAAA;IAErB,+BAAa,CAAA;AACf,CAAC,EAvCW,cAAc,8BAAd,cAAc,QAuCzB;AAED,IAAY,SA4BX;AA5BD,WAAY,SAAS;IAEnB,wBAAW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BAAW,EAAC,EAAE,WAAW,EAAE,sBAAsB,GAAG,CAAC;IACrD,IAAA,2BAAS,GAAE;;6DACW;AAKvB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sBAAsB,GAAG,CAAC;IACrD,IAAA,2BAAS,GAAE;;4DACW","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { Transform, Type } from 'class-transformer';\n\nimport {\n IsArray,\n IsBoolean,\n IsEnum,\n IsIn,\n IsInt,\n IsOptional,\n IsString,\n Matches,\n ValidateIf\n} from 'class-validator';\nexport enum RelationFieldsCommand {\n set = \"set\",\n clear = \"clear\",\n link = \"link\",\n unlink = \"unlink\",\n create = \"create\",\n update = \"update\",\n delete = \"delete\"\n}\n\nexport enum SolidFieldType {\n // numeric types\n int = 'int',\n bigint = 'bigint',\n // float = 'float',\n // double = 'double',\n decimal = 'decimal',\n\n // text types\n shortText = 'shortText',\n longtext = 'longText',\n richText = 'richText',\n json = 'json',\n\n // boolean types\n boolean = 'boolean',\n\n // date\n date = 'date',\n datetime = 'datetime',\n time = 'time',\n\n // relation\n relation = 'relation',\n\n // media\n mediaSingle = 'mediaSingle',\n mediaMultiple = 'mediaMultiple',\n\n email = 'email',\n password = 'password',\n\n // selection\n selectionStatic = 'selectionStatic',\n selectionDynamic = 'selectionDynamic',\n\n computed = 'computed',\n\n uuid = 'uuid'\n}\n\nexport enum MySQLType { //FIXME Currently this type is being used in the definition, Need to use OrmType instead\n // Numeric types\n int = 'int',\n decimal = 'decimal',\n double = 'double',\n\n // Text types\n // fieldType=shortText\n varchar = 'varchar',\n // fieldType=longText\n text = 'shortText',\n mediumtext = 'mediumtext',\n longtext = 'longtext',\n\n // Boolean types\n // fieldType=boolean\n bool = 'bool',\n boolean = 'boolean',\n\n //Date Types\n date = 'date',\n datetime = 'datetime',\n timestamp = 'timestamp',\n time = 'time',\n\n // Other types\n json = 'json',\n\n}\n\nexport enum PSQLType { //FIXME Currently this type is being used in the definition, Need to use OrmType instead\n // Numeric types\n integer = 'integer',\n decimal = 'decimal',\n bigint = 'bigint',\n\n // Text types\n varchar = 'varchar',\n text = 'text',\n\n // Boolean types\n boolean = 'boolean',\n\n // Date types\n timestamp = 'timestamp',\n timestamptz = 'timestamptz',\n time = 'time',\n date = 'date',\n\n // Other types\n json = 'json',\n jsonb = 'jsonb',\n simplejson = 'simple-json'\n}\n\nexport enum MSSQLType {\n int = \"int\",\n bigint = \"bigint\",\n decimal = \"decimal\",\n numeric = \"numeric\",\n varchar = \"varchar\",\n nvarchar = \"nvarchar\",\n simplejson = \"simple-json\",\n text = \"text\",\n bit = \"bit\",\n date = \"date\",\n datetime = \"datetime\",\n datetime2 = \"datetime2\",\n time = \"time\",\n uniqueidentifier = \"uniqueidentifier\"\n}\n\nexport const ALL_ORM_TYPES = [\n ...Object.values(PSQLType),\n ...Object.values(MSSQLType),\n ...Object.values(MySQLType),\n] as const;\n\nexport type OrmType = typeof ALL_ORM_TYPES[number];\n\n// export type OrmType = PSQLType | MySQLType | MSSQLType;\n\nexport enum EncryptionType {\n aes128 = 'aes-128',\n aes256 = 'aes-256',\n}\n\nexport enum DecryptWhenType {\n beforeTransit = 'before-transit',\n afterTransit = 'after-transit',\n}\n\nexport enum MediaType {\n image = 'image',\n audio = 'audio',\n video = 'video',\n // document = 'document',\n file = 'file',\n}\n\nexport enum RelationType {\n manyToOne = 'many-to-one',\n manyTomany = 'many-to-many',\n oneToMany = 'one-to-many',\n}\n\nexport enum CascadeType {\n setNull = 'set null',\n restrict = 'restrict',\n cascade = 'cascade',\n}\n\n// export enum MediaStorageProviderType {\n// database = 'database',\n// file = 'file',\n// s3 = 's3',\n// }\n\nexport enum SelectionValueType {\n string = 'string',\n int = 'int',\n}\n\nexport enum ComputedFieldValueType {\n string = 'string',\n int = 'int',\n decimal = 'decimal',\n boolean = 'boolean',\n date = 'date',\n datetime = 'datetime',\n}\n\nexport enum ComputedFieldTriggerOperation {\n beforeInsert = \"before-insert\",\n afterInsert = \"after-insert\",\n beforeUpdate = \"before-update\",\n afterUpdate = \"after-update\",\n beforeRemove = \"before-delete\",\n afterRemove = \"after-delete\",\n}\n\nexport class ComputedFieldTriggerConfig {\n moduleName: string; // Name of the module where the computed field is defined\n modelName: string;\n operations: ComputedFieldTriggerOperation[]; // List of operations where this computed field should be triggered\n}\n\nexport class CreateFieldMetadataDto {\n @ApiProperty({ description: 'Name of your field, this is also the name of the column or attribute', })\n // @Matches(/[a-z]+(_[a-z]+)*/, { message: 'Field name should follow snake case conventions only with all lower case.', })\n @IsString()\n name: string;\n\n @ApiProperty({ description: 'Display name of your field' })\n @IsString()\n readonly displayName: string;\n\n\n @ApiProperty({ description: 'Description of your field' })\n @IsOptional()\n @IsString()\n readonly description: string;\n\n // @ApiProperty({ description: \"Help text associated with this field\" })\n // @IsString()\n // readonly helpText: string;\n\n @ApiProperty({ description: 'Field can have types' })\n @IsEnum(SolidFieldType)\n readonly type: SolidFieldType;\n\n @ApiProperty({ description: 'Related model id' })\n @IsInt()\n @IsOptional()\n readonly modelId: number;\n\n //For all types of fields\n @ApiProperty({ description: 'Field can have orm types specific to your database', })\n @IsIn(ALL_ORM_TYPES)\n @IsOptional()\n readonly ormType: OrmType;\n\n @ApiProperty({ description: 'Length of the field. Only for type=text' })\n @IsInt()\n @IsOptional()\n readonly length: number;\n\n @ApiProperty({ description: 'Default value of the field' })\n @IsString()\n @IsOptional()\n readonly defaultValue: string;\n\n @ApiProperty({ description: 'Format regex pattern for the field. Only for type=text, longText, email, password', })\n @IsString()\n @IsOptional()\n readonly regexPattern: string;\n\n @ApiProperty({ description: 'If the regex pattern matching fails, then what is the error message to be displayed', })\n @IsString()\n @IsOptional()\n readonly regexPatternNotMatchingErrorMsg: string;\n\n @ApiProperty({ description: 'Is the field mandatory?' })\n @IsBoolean()\n readonly required: boolean;\n\n @ApiProperty({ description: 'Is the field value unique?' })\n @IsBoolean()\n @IsOptional()\n readonly unique: boolean;\n\n @ApiProperty({ description: 'Is the field symmetric encrypted?' })\n @IsBoolean()\n readonly encrypt: boolean;\n\n @ApiProperty({ description: 'Type of encryption. Only if encrypt=true' })\n @IsEnum(EncryptionType)\n @IsOptional()\n readonly encryptionType: EncryptionType;\n\n //Pending\n @ApiProperty({ description: 'At what point do we want to decrypt the data? Only if encrypt=true', })\n @IsEnum(DecryptWhenType)\n @IsOptional()\n decryptWhen: DecryptWhenType;\n\n @ApiProperty({ description: 'Is the field indexed? For all types, except:richText, longText', })\n @IsBoolean()\n index: boolean;\n\n @ApiProperty({ description: 'for text fields, this is length. for numeric fields, this is the range of values allowed. Only for type=shortText,longText,richText,json,int,decimal,date,dateTime,time', })\n @IsInt()\n @IsOptional()\n max: number;\n\n @ApiProperty({ description: 'for text fields, this is length. for numeric fields, this is the range of values allowed. Only for type=shortText,longText,richText,json,int,decimal,date,dateTime,time', })\n @IsInt()\n @IsOptional()\n min: number;\n\n @ApiProperty({ description: 'Is the field private?' })\n @IsBoolean()\n private: boolean;\n\n @ApiProperty({ description: 'Allowed media types for the field. Only for type=mediaSingle,mediaMultiple', })\n @IsEnum(MediaType, { each: true })\n @IsOptional()\n mediaTypes: MediaType[];\n\n @ApiProperty({ description: 'Maximum size of the media in KB. Only for type=mediaSingle,mediaMultiple', })\n @IsInt()\n @IsOptional()\n mediaMaxSizeKb: number;\n\n @ApiProperty({ description: 'Configured Media storage provider. Only for type=mediaSingle,mediaMultiple', })\n @IsInt()\n @IsOptional()\n mediaStorageProviderId?: number;\n\n @ApiProperty({ description: 'Configured Media storage provider. Only for type=mediaSingle,mediaMultiple. When you need to specify the storage provider by name.', })\n @IsInt()\n @IsOptional()\n mediaStorageProviderUserKey?: string;\n\n // @ApiProperty({ description: 'Is the media embedded in the entity table? Only for type=mediaSingle', })\n // @IsBoolean()\n // @IsOptional()\n // mediaEmbedded: boolean;\n\n @ApiProperty({ description: 'Relation Type. Only for type=relation' })\n @IsEnum(RelationType)\n @IsOptional()\n relationType: RelationType;\n\n @ApiProperty({ description: 'Related model for the relation. Only for type=relation' })\n @IsString()\n @IsOptional()\n relationCoModelSingularName: string;\n\n @ApiProperty({ description: 'Create inverse relation. Only for type=relation', })\n @IsBoolean()\n @IsOptional()\n relationCreateInverse: boolean;\n\n @ApiProperty({ description: 'Cascade type. Only for type=relation' })\n @IsEnum(CascadeType)\n @IsOptional()\n relationCascade: CascadeType;\n\n @ApiProperty({ description: 'Related field module. Only required for type=relation, if the related field belongs to a different module' })\n @IsOptional()\n relationModelModuleName: string;\n\n @ApiProperty({ description: 'Related field module. Only required for type=relation and relationType=many-to-many, i.e if the related many to many field belongs to a different model' })\n @IsOptional()\n relationCoModelFieldName: string;\n\n @ApiProperty({ description: 'Only for type=relation, many-to-many. This field is used to set the owner of the many-to-many relation' })\n @IsOptional()\n isRelationManyToManyOwner: boolean;\n\n\n @ApiProperty({ description: 'Only for type=relation, many-to-many. This field is used to store fixed filters that needs to applied on related model' })\n @IsOptional()\n relationFieldFixedFilter: string;\n\n @ApiProperty({\n description:\n 'Dynamic provider for selection. Only for type=selectionDynamic',\n })\n @IsString()\n @IsOptional()\n selectionDynamicProvider: string;\n\n @ApiProperty({ description: 'Dynamic provider Context. Only for type=selectionDynamic', })\n @IsString()\n @IsOptional()\n selectionDynamicProviderCtxt: string;\n\n @ApiProperty({ description: 'Static values for selection. Only for type=selectionStatic', })\n @IsArray()\n @IsString({ each: true })\n // @Matches(/^[\\w\\s\\d\\-\\/]+:[\\w\\s\\-\\/]+$/, { each: true })\n @IsOptional()\n selectionStaticValues: string[];\n\n @ApiProperty({ description: 'Type of value for selection. Applicable for type=selectionStatic,selectionDynamic', })\n @IsEnum(SelectionValueType)\n @IsOptional()\n selectionValueType: SelectionValueType;\n\n @ApiProperty({ description: 'Computed Field Value Provider. Only for type=computed', })\n @IsString()\n @IsOptional()\n computedFieldValueProvider: string;\n\n @ApiProperty({ description: 'Computed Field Value Provider Context. Only for type=computed', })\n @IsString()\n @IsOptional()\n computedFieldValueProviderCtxt: string;\n\n @ApiProperty({ description: 'Computed field value type. Only for type=computed', })\n @IsEnum(ComputedFieldValueType)\n @IsOptional()\n computedFieldValueType: ComputedFieldValueType;\n\n @IsArray()\n @Type(() => ComputedFieldTriggerConfig)\n @IsOptional()\n computedFieldTriggerConfig: ComputedFieldTriggerConfig[];\n\n @IsOptional()\n @ApiProperty({ description: 'Uuid.', })\n @IsString()\n @IsOptional()\n uuid: string;\n\n @IsOptional()\n @ApiProperty({ description: 'System fields are not included in the code generation, the assumption being that system fields have manually written code.', })\n @IsBoolean()\n isSystem: boolean;\n\n @IsOptional()\n @ApiProperty({ description: 'Marked for removal, this is used to soft delete the field.', })\n @IsBoolean()\n isMarkedForRemoval: boolean;\n\n @ApiProperty({ description: 'Column Name of Field', })\n @IsString()\n @IsOptional()\n columnName: string\n\n @ApiProperty({ description: 'Relation CoModel Column Name of Field', })\n @IsString()\n @IsOptional()\n relationCoModelColumnName: string\n\n @ApiProperty({ description: \"Is User Key\" })\n @IsOptional()\n @IsBoolean()\n readonly isUserKey: boolean\n\n @ApiProperty({ description: 'Relation Join Table Name of Field', })\n @IsString()\n @IsOptional()\n relationJoinTableName: string\n\n @ApiProperty({ description: 'Enable Audit Tracking for this field', })\n @IsOptional()\n @IsBoolean()\n enableAuditTracking?: boolean;\n\n @IsOptional()\n @ApiProperty({ description: 'Is MultiSelect Field', })\n @IsBoolean()\n isMultiSelect: boolean;\n\n @IsOptional()\n @ApiProperty({ description: 'Is Primary Key Field', })\n @IsBoolean()\n isPrimaryKey?: boolean;\n}"]}
1
+ {"version":3,"file":"create-field-metadata.dto.js","sourceRoot":"","sources":["../../src/dtos/create-field-metadata.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,yDAAoD;AACpD,oEAAsG;AAEtG,qDAWyB;AACzB,IAAY,qBAQX;AARD,WAAY,qBAAqB;IAC/B,oCAAW,CAAA;IACX,wCAAe,CAAA;IACf,sCAAa,CAAA;IACb,0CAAiB,CAAA;IACjB,0C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AKvB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sBAAsB,GAAG,CAAC;IACrD,IAAA,2BAAS,GAAE;;4DACW","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { Transform, Type } from 'class-transformer';\nimport { DANGEROUS_EXTENSIONS, MEDIA_CATEGORIES, MediaCategory } from '../constants/media-file-types';\n\nimport {\n IsArray,\n IsBoolean,\n IsEnum,\n IsIn,\n IsInt,\n IsNotIn,\n IsOptional,\n IsString,\n Matches,\n ValidateIf\n} from 'class-validator';\nexport enum RelationFieldsCommand {\n set = \"set\",\n clear = \"clear\",\n link = \"link\",\n unlink = \"unlink\",\n create = \"create\",\n update = \"update\",\n delete = \"delete\"\n}\n\nexport enum SolidFieldType {\n // numeric types\n int = 'int',\n bigint = 'bigint',\n // float = 'float',\n // double = 'double',\n decimal = 'decimal',\n\n // text types\n shortText = 'shortText',\n longtext = 'longText',\n richText = 'richText',\n json = 'json',\n\n // boolean types\n boolean = 'boolean',\n\n // date\n date = 'date',\n datetime = 'datetime',\n time = 'time',\n\n // relation\n relation = 'relation',\n\n // media\n mediaSingle = 'mediaSingle',\n mediaMultiple = 'mediaMultiple',\n\n email = 'email',\n password = 'password',\n\n // selection\n selectionStatic = 'selectionStatic',\n selectionDynamic = 'selectionDynamic',\n\n computed = 'computed',\n\n uuid = 'uuid'\n}\n\nexport enum MySQLType { //FIXME Currently this type is being used in the definition, Need to use OrmType instead\n // Numeric types\n int = 'int',\n decimal = 'decimal',\n double = 'double',\n\n // Text types\n // fieldType=shortText\n varchar = 'varchar',\n // fieldType=longText\n text = 'shortText',\n mediumtext = 'mediumtext',\n longtext = 'longtext',\n\n // Boolean types\n // fieldType=boolean\n bool = 'bool',\n boolean = 'boolean',\n\n //Date Types\n date = 'date',\n datetime = 'datetime',\n timestamp = 'timestamp',\n time = 'time',\n\n // Other types\n json = 'json',\n\n}\n\nexport enum PSQLType { //FIXME Currently this type is being used in the definition, Need to use OrmType instead\n // Numeric types\n integer = 'integer',\n decimal = 'decimal',\n bigint = 'bigint',\n\n // Text types\n varchar = 'varchar',\n text = 'text',\n\n // Boolean types\n boolean = 'boolean',\n\n // Date types\n timestamp = 'timestamp',\n timestamptz = 'timestamptz',\n time = 'time',\n date = 'date',\n\n // Other types\n json = 'json',\n jsonb = 'jsonb',\n simplejson = 'simple-json'\n}\n\nexport enum MSSQLType {\n int = \"int\",\n bigint = \"bigint\",\n decimal = \"decimal\",\n numeric = \"numeric\",\n varchar = \"varchar\",\n nvarchar = \"nvarchar\",\n simplejson = \"simple-json\",\n text = \"text\",\n bit = \"bit\",\n date = \"date\",\n datetime = \"datetime\",\n datetime2 = \"datetime2\",\n time = \"time\",\n uniqueidentifier = \"uniqueidentifier\"\n}\n\nexport const ALL_ORM_TYPES = [\n ...Object.values(PSQLType),\n ...Object.values(MSSQLType),\n ...Object.values(MySQLType),\n] as const;\n\nexport type OrmType = typeof ALL_ORM_TYPES[number];\n\n// export type OrmType = PSQLType | MySQLType | MSSQLType;\n\nexport enum EncryptionType {\n aes128 = 'aes-128',\n aes256 = 'aes-256',\n}\n\nexport enum DecryptWhenType {\n beforeTransit = 'before-transit',\n afterTransit = 'after-transit',\n}\n\nexport type MediaType = MediaCategory;\n\nexport enum RelationType {\n manyToOne = 'many-to-one',\n manyTomany = 'many-to-many',\n oneToMany = 'one-to-many',\n}\n\nexport enum CascadeType {\n setNull = 'set null',\n restrict = 'restrict',\n cascade = 'cascade',\n}\n\n// export enum MediaStorageProviderType {\n// database = 'database',\n// file = 'file',\n// s3 = 's3',\n// }\n\nexport enum SelectionValueType {\n string = 'string',\n int = 'int',\n}\n\nexport enum ComputedFieldValueType {\n string = 'string',\n int = 'int',\n decimal = 'decimal',\n boolean = 'boolean',\n date = 'date',\n datetime = 'datetime',\n}\n\nexport enum ComputedFieldTriggerOperation {\n beforeInsert = \"before-insert\",\n afterInsert = \"after-insert\",\n beforeUpdate = \"before-update\",\n afterUpdate = \"after-update\",\n beforeRemove = \"before-delete\",\n afterRemove = \"after-delete\",\n}\n\nexport class ComputedFieldTriggerConfig {\n moduleName: string; // Name of the module where the computed field is defined\n modelName: string;\n operations: ComputedFieldTriggerOperation[]; // List of operations where this computed field should be triggered\n}\n\nexport class CreateFieldMetadataDto {\n @ApiProperty({ description: 'Name of your field, this is also the name of the column or attribute', })\n // @Matches(/[a-z]+(_[a-z]+)*/, { message: 'Field name should follow snake case conventions only with all lower case.', })\n @IsString()\n name: string;\n\n @ApiProperty({ description: 'Display name of your field' })\n @IsString()\n readonly displayName: string;\n\n\n @ApiProperty({ description: 'Description of your field' })\n @IsOptional()\n @IsString()\n readonly description: string;\n\n // @ApiProperty({ description: \"Help text associated with this field\" })\n // @IsString()\n // readonly helpText: string;\n\n @ApiProperty({ description: 'Field can have types' })\n @IsEnum(SolidFieldType)\n readonly type: SolidFieldType;\n\n @ApiProperty({ description: 'Related model id' })\n @IsInt()\n @IsOptional()\n readonly modelId: number;\n\n //For all types of fields\n @ApiProperty({ description: 'Field can have orm types specific to your database', })\n @IsIn(ALL_ORM_TYPES)\n @IsOptional()\n readonly ormType: OrmType;\n\n @ApiProperty({ description: 'Length of the field. Only for type=text' })\n @IsInt()\n @IsOptional()\n readonly length: number;\n\n @ApiProperty({ description: 'Default value of the field' })\n @IsString()\n @IsOptional()\n readonly defaultValue: string;\n\n @ApiProperty({ description: 'Format regex pattern for the field. Only for type=text, longText, email, password', })\n @IsString()\n @IsOptional()\n readonly regexPattern: string;\n\n @ApiProperty({ description: 'If the regex pattern matching fails, then what is the error message to be displayed', })\n @IsString()\n @IsOptional()\n readonly regexPatternNotMatchingErrorMsg: string;\n\n @ApiProperty({ description: 'Is the field mandatory?' })\n @IsBoolean()\n readonly required: boolean;\n\n @ApiProperty({ description: 'Is the field value unique?' })\n @IsBoolean()\n @IsOptional()\n readonly unique: boolean;\n\n @ApiProperty({ description: 'Is the field symmetric encrypted?' })\n @IsBoolean()\n readonly encrypt: boolean;\n\n @ApiProperty({ description: 'Type of encryption. Only if encrypt=true' })\n @IsEnum(EncryptionType)\n @IsOptional()\n readonly encryptionType: EncryptionType;\n\n //Pending\n @ApiProperty({ description: 'At what point do we want to decrypt the data? Only if encrypt=true', })\n @IsEnum(DecryptWhenType)\n @IsOptional()\n decryptWhen: DecryptWhenType;\n\n @ApiProperty({ description: 'Is the field indexed? For all types, except:richText, longText', })\n @IsBoolean()\n index: boolean;\n\n @ApiProperty({ description: 'for text fields, this is length. for numeric fields, this is the range of values allowed. Only for type=shortText,longText,richText,json,int,decimal,date,dateTime,time', })\n @IsInt()\n @IsOptional()\n max: number;\n\n @ApiProperty({ description: 'for text fields, this is length. for numeric fields, this is the range of values allowed. Only for type=shortText,longText,richText,json,int,decimal,date,dateTime,time', })\n @IsInt()\n @IsOptional()\n min: number;\n\n @ApiProperty({ description: 'Is the field private?' })\n @IsBoolean()\n private: boolean;\n\n @ApiProperty({ description: 'Allowed media types for the field. Only for type=mediaSingle,mediaMultiple', })\n @IsIn([...MEDIA_CATEGORIES], { each: true })\n @IsOptional()\n mediaTypes: MediaType[];\n\n @ApiProperty({ description: 'Maximum size of the media in KB. Only for type=mediaSingle,mediaMultiple', })\n @IsInt()\n @IsOptional()\n mediaMaxSizeKb: number;\n\n @ApiProperty({ description: 'Explicit allowlist of file extensions (e.g. [\"pdf\",\"xlsx\",\"png\"]) permitted for this field, checked in addition to any mediaTypes category restriction — both must pass if both are set. For a strict allowlist, leave mediaTypes empty and use this alone. Only for type=mediaSingle,mediaMultiple', })\n @Transform(({ value }) =>\n Array.isArray(value)\n ? value.map((ext: any) => String(ext).toLowerCase().trim().replace(/^\\./, ''))\n : value\n )\n @IsArray()\n @IsString({ each: true })\n @IsNotIn([...DANGEROUS_EXTENSIONS], { each: true })\n @IsOptional()\n mediaAllowedExtensions?: string[];\n\n @ApiProperty({ description: 'Configured Media storage provider. Only for type=mediaSingle,mediaMultiple', })\n @IsInt()\n @IsOptional()\n mediaStorageProviderId?: number;\n\n @ApiProperty({ description: 'Configured Media storage provider. Only for type=mediaSingle,mediaMultiple. When you need to specify the storage provider by name.', })\n @IsInt()\n @IsOptional()\n mediaStorageProviderUserKey?: string;\n\n // @ApiProperty({ description: 'Is the media embedded in the entity table? Only for type=mediaSingle', })\n // @IsBoolean()\n // @IsOptional()\n // mediaEmbedded: boolean;\n\n @ApiProperty({ description: 'Relation Type. Only for type=relation' })\n @IsEnum(RelationType)\n @IsOptional()\n relationType: RelationType;\n\n @ApiProperty({ description: 'Related model for the relation. Only for type=relation' })\n @IsString()\n @IsOptional()\n relationCoModelSingularName: string;\n\n @ApiProperty({ description: 'Create inverse relation. Only for type=relation', })\n @IsBoolean()\n @IsOptional()\n relationCreateInverse: boolean;\n\n @ApiProperty({ description: 'Cascade type. Only for type=relation' })\n @IsEnum(CascadeType)\n @IsOptional()\n relationCascade: CascadeType;\n\n @ApiProperty({ description: 'Related field module. Only required for type=relation, if the related field belongs to a different module' })\n @IsOptional()\n relationModelModuleName: string;\n\n @ApiProperty({ description: 'Related field module. Only required for type=relation and relationType=many-to-many, i.e if the related many to many field belongs to a different model' })\n @IsOptional()\n relationCoModelFieldName: string;\n\n @ApiProperty({ description: 'Only for type=relation, many-to-many. This field is used to set the owner of the many-to-many relation' })\n @IsOptional()\n isRelationManyToManyOwner: boolean;\n\n\n @ApiProperty({ description: 'Only for type=relation, many-to-many. This field is used to store fixed filters that needs to applied on related model' })\n @IsOptional()\n relationFieldFixedFilter: string;\n\n @ApiProperty({\n description:\n 'Dynamic provider for selection. Only for type=selectionDynamic',\n })\n @IsString()\n @IsOptional()\n selectionDynamicProvider: string;\n\n @ApiProperty({ description: 'Dynamic provider Context. Only for type=selectionDynamic', })\n @IsString()\n @IsOptional()\n selectionDynamicProviderCtxt: string;\n\n @ApiProperty({ description: 'Static values for selection. Only for type=selectionStatic', })\n @IsArray()\n @IsString({ each: true })\n // @Matches(/^[\\w\\s\\d\\-\\/]+:[\\w\\s\\-\\/]+$/, { each: true })\n @IsOptional()\n selectionStaticValues: string[];\n\n @ApiProperty({ description: 'Type of value for selection. Applicable for type=selectionStatic,selectionDynamic', })\n @IsEnum(SelectionValueType)\n @IsOptional()\n selectionValueType: SelectionValueType;\n\n @ApiProperty({ description: 'Computed Field Value Provider. Only for type=computed', })\n @IsString()\n @IsOptional()\n computedFieldValueProvider: string;\n\n @ApiProperty({ description: 'Computed Field Value Provider Context. Only for type=computed', })\n @IsString()\n @IsOptional()\n computedFieldValueProviderCtxt: string;\n\n @ApiProperty({ description: 'Computed field value type. Only for type=computed', })\n @IsEnum(ComputedFieldValueType)\n @IsOptional()\n computedFieldValueType: ComputedFieldValueType;\n\n @IsArray()\n @Type(() => ComputedFieldTriggerConfig)\n @IsOptional()\n computedFieldTriggerConfig: ComputedFieldTriggerConfig[];\n\n @IsOptional()\n @ApiProperty({ description: 'Uuid.', })\n @IsString()\n @IsOptional()\n uuid: string;\n\n @IsOptional()\n @ApiProperty({ description: 'System fields are not included in the code generation, the assumption being that system fields have manually written code.', })\n @IsBoolean()\n isSystem: boolean;\n\n @IsOptional()\n @ApiProperty({ description: 'Marked for removal, this is used to soft delete the field.', })\n @IsBoolean()\n isMarkedForRemoval: boolean;\n\n @ApiProperty({ description: 'Column Name of Field', })\n @IsString()\n @IsOptional()\n columnName: string\n\n @ApiProperty({ description: 'Relation CoModel Column Name of Field', })\n @IsString()\n @IsOptional()\n relationCoModelColumnName: string\n\n @ApiProperty({ description: \"Is User Key\" })\n @IsOptional()\n @IsBoolean()\n readonly isUserKey: boolean\n\n @ApiProperty({ description: 'Relation Join Table Name of Field', })\n @IsString()\n @IsOptional()\n relationJoinTableName: string\n\n @ApiProperty({ description: 'Enable Audit Tracking for this field', })\n @IsOptional()\n @IsBoolean()\n enableAuditTracking?: boolean;\n\n @IsOptional()\n @ApiProperty({ description: 'Is MultiSelect Field', })\n @IsBoolean()\n isMultiSelect: boolean;\n\n @IsOptional()\n @ApiProperty({ description: 'Is Primary Key Field', })\n @IsBoolean()\n isPrimaryKey?: boolean;\n}\n"]}
@@ -6,7 +6,7 @@ export declare class CreateModelSequenceDto {
6
6
  fieldId: number;
7
7
  fieldUserKey: string;
8
8
  sequenceName: string;
9
- currentValue: number;
9
+ currentValue?: number;
10
10
  prefix: string;
11
11
  padding: number;
12
12
  separator: string;
@@ -1 +1 @@
1
- {"version":3,"file":"create-model-sequence.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-model-sequence.dto.ts"],"names":[],"mappings":"AAKA,qBAAa,sBAAsB;IAI/B,QAAQ,EAAE,MAAM,CAAC;IAIjB,aAAa,EAAE,MAAM,CAAC;IAItB,OAAO,EAAE,MAAM,CAAC;IAIhB,YAAY,EAAE,MAAM,CAAC;IAIrB,OAAO,EAAE,MAAM,CAAC;IAIhB,YAAY,EAAE,MAAM,CAAC;IAIrB,YAAY,EAAE,MAAM,CAAC;IAIrB,YAAY,EAAE,MAAM,CAAC;IAIrB,MAAM,EAAE,MAAM,CAAC;IAIf,OAAO,EAAE,MAAM,CAAC;IAIhB,SAAS,EAAE,MAAM,CAAC;CACrB"}
1
+ {"version":3,"file":"create-model-sequence.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-model-sequence.dto.ts"],"names":[],"mappings":"AAKA,qBAAa,sBAAsB;IAI/B,QAAQ,EAAE,MAAM,CAAC;IAIjB,aAAa,EAAE,MAAM,CAAC;IAItB,OAAO,EAAE,MAAM,CAAC;IAIhB,YAAY,EAAE,MAAM,CAAC;IAIrB,OAAO,EAAE,MAAM,CAAC;IAIhB,YAAY,EAAE,MAAM,CAAC;IAIrB,YAAY,EAAE,MAAM,CAAC;IAIrB,YAAY,CAAC,EAAE,MAAM,CAAC;IAItB,MAAM,EAAE,MAAM,CAAC;IAIf,OAAO,EAAE,MAAM,CAAC;IAIhB,SAAS,EAAE,MAAM,CAAC;CACrB"}
@@ -17,7 +17,7 @@ const class_validator_2 = require("class-validator");
17
17
  const class_validator_3 = require("class-validator");
18
18
  class CreateModelSequenceDto {
19
19
  static _OPENAPI_METADATA_FACTORY() {
20
- return { moduleId: { required: true, type: () => Number }, moduleUserKey: { required: true, type: () => String }, modelId: { required: true, type: () => Number }, modelUserKey: { required: true, type: () => String }, fieldId: { required: true, type: () => Number }, fieldUserKey: { required: true, type: () => String }, sequenceName: { required: true, type: () => String }, currentValue: { required: true, type: () => Number }, prefix: { required: true, type: () => String }, padding: { required: true, type: () => Number }, separator: { required: true, type: () => String } };
20
+ return { moduleId: { required: true, type: () => Number }, moduleUserKey: { required: true, type: () => String }, modelId: { required: true, type: () => Number }, modelUserKey: { required: true, type: () => String }, fieldId: { required: true, type: () => Number }, fieldUserKey: { required: true, type: () => String }, sequenceName: { required: true, type: () => String }, currentValue: { required: false, type: () => Number }, prefix: { required: true, type: () => String }, padding: { required: true, type: () => Number }, separator: { required: true, type: () => String } };
21
21
  }
22
22
  }
23
23
  exports.CreateModelSequenceDto = CreateModelSequenceDto;
@@ -1 +1 @@
1
- {"version":3,"file":"create-model-sequence.dto.js","sourceRoot":"","sources":["../../src/dtos/create-model-sequence.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAwC;AACxC,qDAA6C;AAC7C,qDAAuD;AAEvD,MAAa,sBAAsB;;;;CA6ClC;AA7CD,wDA6CC;AAzCG;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;wDACG;AAIjB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;6DACQ;AAItB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACE;AAIhB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACO;AAIrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACE;AAIhB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACO;AAIrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;4DACO;AAIrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;4DACO;AAIrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;sDACC;AAIf;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACE;AAIhB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;yDACI","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { IsInt } from 'class-validator';\nimport { IsOptional } from 'class-validator';\nimport { IsString, IsNotEmpty } from 'class-validator';\n\nexport class CreateModelSequenceDto {\n @IsOptional()\n @IsInt()\n @ApiProperty()\n moduleId: number;\n @IsString()\n @IsOptional()\n @ApiProperty()\n moduleUserKey: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n modelId: number;\n @IsString()\n @IsOptional()\n @ApiProperty()\n modelUserKey: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n fieldId: number;\n @IsString()\n @IsOptional()\n @ApiProperty()\n fieldUserKey: string;\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n sequenceName: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n currentValue: number;\n @IsOptional()\n @IsString()\n @ApiProperty()\n prefix: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n padding: number;\n @IsOptional()\n @IsString()\n @ApiProperty()\n separator: string;\n}"]}
1
+ {"version":3,"file":"create-model-sequence.dto.js","sourceRoot":"","sources":["../../src/dtos/create-model-sequence.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAwC;AACxC,qDAA6C;AAC7C,qDAAuD;AAEvD,MAAa,sBAAsB;;;;CA6ClC;AA7CD,wDA6CC;AAzCG;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;wDACG;AAIjB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;6DACQ;AAItB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACE;AAIhB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACO;AAIrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACE;AAIhB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACO;AAIrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;4DACO;AAIrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;4DACQ;AAItB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;sDACC;AAIf;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACE;AAIhB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;yDACI","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { IsInt } from 'class-validator';\nimport { IsOptional } from 'class-validator';\nimport { IsString, IsNotEmpty } from 'class-validator';\n\nexport class CreateModelSequenceDto {\n @IsOptional()\n @IsInt()\n @ApiProperty()\n moduleId: number;\n @IsString()\n @IsOptional()\n @ApiProperty()\n moduleUserKey: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n modelId: number;\n @IsString()\n @IsOptional()\n @ApiProperty()\n modelUserKey: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n fieldId: number;\n @IsString()\n @IsOptional()\n @ApiProperty()\n fieldUserKey: string;\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n sequenceName: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n currentValue?: number;\n @IsOptional()\n @IsString()\n @ApiProperty()\n prefix: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n padding: number;\n @IsOptional()\n @IsString()\n @ApiProperty()\n separator: string;\n}"]}
@@ -0,0 +1,5 @@
1
+ export declare class MpinLoginDto {
2
+ credentialRef: string;
3
+ mpin: string;
4
+ }
5
+ //# sourceMappingURL=mpin-login.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpin-login.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/mpin-login.dto.ts"],"names":[],"mappings":"AAWA,qBAAa,YAAY;IAMrB,aAAa,EAAE,MAAM,CAAC;IAKtB,IAAI,EAAE,MAAM,CAAC;CAChB"}