@colveor/core 1.1.0 → 1.2.1

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 (740) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +6 -0
  3. package/dist/bootstrap/bootstrap-colveor-app.d.ts.map +1 -1
  4. package/dist/bootstrap/bootstrap-colveor-app.js +22 -3
  5. package/dist/bootstrap/bootstrap-colveor-app.js.map +1 -1
  6. package/dist/common/decorators/index.d.ts +6 -0
  7. package/dist/common/decorators/index.d.ts.map +1 -1
  8. package/dist/common/decorators/index.js +8 -1
  9. package/dist/common/decorators/index.js.map +1 -1
  10. package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts +9 -0
  11. package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts.map +1 -0
  12. package/dist/common/decorators/ip-rate-limit-bucket.decorator.js +12 -0
  13. package/dist/common/decorators/ip-rate-limit-bucket.decorator.js.map +1 -0
  14. package/dist/common/guards/login-ip-rate-limit.guard.d.ts +12 -6
  15. package/dist/common/guards/login-ip-rate-limit.guard.d.ts.map +1 -1
  16. package/dist/common/guards/login-ip-rate-limit.guard.js +65 -21
  17. package/dist/common/guards/login-ip-rate-limit.guard.js.map +1 -1
  18. package/dist/common/guards/otp-ip-rate-limit.guard.d.ts +3 -2
  19. package/dist/common/guards/otp-ip-rate-limit.guard.d.ts.map +1 -1
  20. package/dist/common/guards/otp-ip-rate-limit.guard.js +17 -15
  21. package/dist/common/guards/otp-ip-rate-limit.guard.js.map +1 -1
  22. package/dist/common/guards/permissions.guard.d.ts.map +1 -1
  23. package/dist/common/guards/permissions.guard.js +12 -2
  24. package/dist/common/guards/permissions.guard.js.map +1 -1
  25. package/dist/common/interceptors/timeout.interceptor.d.ts +1 -1
  26. package/dist/common/interceptors/timeout.interceptor.d.ts.map +1 -1
  27. package/dist/common/interceptors/timeout.interceptor.js +5 -1
  28. package/dist/common/interceptors/timeout.interceptor.js.map +1 -1
  29. package/dist/common/interfaces/request-user.d.ts +4 -3
  30. package/dist/common/interfaces/request-user.d.ts.map +1 -1
  31. package/dist/common/utils/cache-version.util.d.ts +12 -0
  32. package/dist/common/utils/cache-version.util.d.ts.map +1 -0
  33. package/dist/common/utils/cache-version.util.js +34 -0
  34. package/dist/common/utils/cache-version.util.js.map +1 -0
  35. package/dist/common/utils/postgres-error.util.d.ts +5 -0
  36. package/dist/common/utils/postgres-error.util.d.ts.map +1 -0
  37. package/dist/common/utils/postgres-error.util.js +13 -0
  38. package/dist/common/utils/postgres-error.util.js.map +1 -0
  39. package/dist/common/utils/singleflight.util.d.ts +6 -0
  40. package/dist/common/utils/singleflight.util.d.ts.map +1 -0
  41. package/dist/common/utils/singleflight.util.js +21 -0
  42. package/dist/common/utils/singleflight.util.js.map +1 -0
  43. package/dist/common/validators/is-exclusive-auth-params.validator.js +1 -1
  44. package/dist/common/validators/is-exclusive-auth-params.validator.js.map +1 -1
  45. package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js +1 -1
  46. package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js.map +1 -1
  47. package/dist/config/app.config.d.ts +38 -0
  48. package/dist/config/app.config.d.ts.map +1 -1
  49. package/dist/config/app.config.js +24 -0
  50. package/dist/config/app.config.js.map +1 -1
  51. package/dist/config/database.config.d.ts +6 -0
  52. package/dist/config/database.config.d.ts.map +1 -1
  53. package/dist/config/database.config.js +3 -0
  54. package/dist/config/database.config.js.map +1 -1
  55. package/dist/config/env-flags.util.d.ts +4 -0
  56. package/dist/config/env-flags.util.d.ts.map +1 -1
  57. package/dist/config/env-flags.util.js +7 -0
  58. package/dist/config/env-flags.util.js.map +1 -1
  59. package/dist/config/env.validation.d.ts +24 -1
  60. package/dist/config/env.validation.d.ts.map +1 -1
  61. package/dist/config/env.validation.js +92 -2
  62. package/dist/config/env.validation.js.map +1 -1
  63. package/dist/config/in-memory-redis.client.d.ts +23 -4
  64. package/dist/config/in-memory-redis.client.d.ts.map +1 -1
  65. package/dist/config/in-memory-redis.client.js +148 -4
  66. package/dist/config/in-memory-redis.client.js.map +1 -1
  67. package/dist/config/redis.module.d.ts.map +1 -1
  68. package/dist/config/redis.module.js +5 -0
  69. package/dist/config/redis.module.js.map +1 -1
  70. package/dist/core.module.d.ts +5 -0
  71. package/dist/core.module.d.ts.map +1 -1
  72. package/dist/core.module.js +5 -0
  73. package/dist/core.module.js.map +1 -1
  74. package/dist/database/migrations/1784284557959-full-schema.d.ts.map +1 -1
  75. package/dist/database/migrations/1784284557959-full-schema.js +48 -14
  76. package/dist/database/migrations/1784284557959-full-schema.js.map +1 -1
  77. package/dist/database/migrations/1784284557960-audit-partitioning.d.ts +17 -0
  78. package/dist/database/migrations/1784284557960-audit-partitioning.d.ts.map +1 -0
  79. package/dist/database/migrations/1784284557960-audit-partitioning.js +384 -0
  80. package/dist/database/migrations/1784284557960-audit-partitioning.js.map +1 -0
  81. package/dist/database/seeds/roles.seed.d.ts +6 -0
  82. package/dist/database/seeds/roles.seed.d.ts.map +1 -1
  83. package/dist/database/seeds/roles.seed.js +22 -5
  84. package/dist/database/seeds/roles.seed.js.map +1 -1
  85. package/dist/database/seeds/settings.seed.d.ts +5 -0
  86. package/dist/database/seeds/settings.seed.d.ts.map +1 -1
  87. package/dist/database/seeds/settings.seed.js +500 -25
  88. package/dist/database/seeds/settings.seed.js.map +1 -1
  89. package/dist/database/seeds/templates/html-template.reader.d.ts +1 -0
  90. package/dist/database/seeds/templates/html-template.reader.d.ts.map +1 -1
  91. package/dist/database/seeds/templates/html-template.reader.js +3 -1
  92. package/dist/database/seeds/templates/html-template.reader.js.map +1 -1
  93. package/dist/database/seeds/templates/html-template.reader.ts +5 -1
  94. package/dist/database/typeorm.util.d.ts.map +1 -1
  95. package/dist/database/typeorm.util.js +6 -0
  96. package/dist/database/typeorm.util.js.map +1 -1
  97. package/dist/index.d.ts +8 -1
  98. package/dist/index.d.ts.map +1 -1
  99. package/dist/index.js +39 -4
  100. package/dist/index.js.map +1 -1
  101. package/dist/modules/admin/controllers/admin.controller.d.ts +15 -7
  102. package/dist/modules/admin/controllers/admin.controller.d.ts.map +1 -1
  103. package/dist/modules/admin/controllers/admin.controller.js +74 -17
  104. package/dist/modules/admin/controllers/admin.controller.js.map +1 -1
  105. package/dist/modules/admin/services/admin-log.service.d.ts +14 -7
  106. package/dist/modules/admin/services/admin-log.service.d.ts.map +1 -1
  107. package/dist/modules/admin/services/admin-log.service.js +41 -38
  108. package/dist/modules/admin/services/admin-log.service.js.map +1 -1
  109. package/dist/modules/audit/audit.manifest.d.ts +8 -0
  110. package/dist/modules/audit/audit.manifest.d.ts.map +1 -0
  111. package/dist/modules/audit/audit.manifest.js +31 -0
  112. package/dist/modules/audit/audit.manifest.js.map +1 -0
  113. package/dist/modules/audit/audit.module.d.ts +8 -0
  114. package/dist/modules/audit/audit.module.d.ts.map +1 -0
  115. package/dist/modules/audit/audit.module.js +57 -0
  116. package/dist/modules/audit/audit.module.js.map +1 -0
  117. package/dist/modules/audit/constants/audit-actions.d.ts +79 -0
  118. package/dist/modules/audit/constants/audit-actions.d.ts.map +1 -0
  119. package/dist/modules/audit/constants/audit-actions.js +89 -0
  120. package/dist/modules/audit/constants/audit-actions.js.map +1 -0
  121. package/dist/modules/audit/constants/audit-mutation.d.ts +10 -0
  122. package/dist/modules/audit/constants/audit-mutation.d.ts.map +1 -0
  123. package/dist/modules/audit/constants/audit-mutation.js +13 -0
  124. package/dist/modules/audit/constants/audit-mutation.js.map +1 -0
  125. package/dist/modules/audit/controllers/audit.controller.d.ts +13 -0
  126. package/dist/modules/audit/controllers/audit.controller.d.ts.map +1 -0
  127. package/dist/modules/audit/controllers/audit.controller.js +149 -0
  128. package/dist/modules/audit/controllers/audit.controller.js.map +1 -0
  129. package/dist/modules/audit/decorators/audit.decorator.d.ts +27 -0
  130. package/dist/modules/audit/decorators/audit.decorator.d.ts.map +1 -0
  131. package/dist/modules/audit/decorators/audit.decorator.js +18 -0
  132. package/dist/modules/audit/decorators/audit.decorator.js.map +1 -0
  133. package/dist/modules/audit/dto/audit.dto.d.ts +54 -0
  134. package/dist/modules/audit/dto/audit.dto.d.ts.map +1 -0
  135. package/dist/modules/audit/dto/audit.dto.js +129 -0
  136. package/dist/modules/audit/dto/audit.dto.js.map +1 -0
  137. package/dist/modules/audit/entities/audit-event.entity.d.ts +33 -0
  138. package/dist/modules/audit/entities/audit-event.entity.d.ts.map +1 -0
  139. package/dist/modules/audit/entities/audit-event.entity.js +125 -0
  140. package/dist/modules/audit/entities/audit-event.entity.js.map +1 -0
  141. package/dist/modules/audit/entities/audit-outbox.entity.d.ts +16 -0
  142. package/dist/modules/audit/entities/audit-outbox.entity.d.ts.map +1 -0
  143. package/dist/modules/audit/entities/audit-outbox.entity.js +65 -0
  144. package/dist/modules/audit/entities/audit-outbox.entity.js.map +1 -0
  145. package/dist/modules/audit/index.d.ts +13 -0
  146. package/dist/modules/audit/index.d.ts.map +1 -0
  147. package/dist/modules/audit/index.js +23 -0
  148. package/dist/modules/audit/index.js.map +1 -0
  149. package/dist/modules/audit/interceptors/audit.interceptor.d.ts +11 -0
  150. package/dist/modules/audit/interceptors/audit.interceptor.d.ts.map +1 -0
  151. package/dist/modules/audit/interceptors/audit.interceptor.js +75 -0
  152. package/dist/modules/audit/interceptors/audit.interceptor.js.map +1 -0
  153. package/dist/modules/audit/listeners/auth-audit.listener.d.ts +31 -0
  154. package/dist/modules/audit/listeners/auth-audit.listener.d.ts.map +1 -0
  155. package/dist/modules/audit/listeners/auth-audit.listener.js +338 -0
  156. package/dist/modules/audit/listeners/auth-audit.listener.js.map +1 -0
  157. package/dist/modules/audit/services/audit-archive.service.d.ts +28 -0
  158. package/dist/modules/audit/services/audit-archive.service.d.ts.map +1 -0
  159. package/dist/modules/audit/services/audit-archive.service.js +132 -0
  160. package/dist/modules/audit/services/audit-archive.service.js.map +1 -0
  161. package/dist/modules/audit/services/audit-hash-backfill.service.d.ts +22 -0
  162. package/dist/modules/audit/services/audit-hash-backfill.service.d.ts.map +1 -0
  163. package/dist/modules/audit/services/audit-hash-backfill.service.js +79 -0
  164. package/dist/modules/audit/services/audit-hash-backfill.service.js.map +1 -0
  165. package/dist/modules/audit/services/audit-leader.service.d.ts +28 -0
  166. package/dist/modules/audit/services/audit-leader.service.d.ts.map +1 -0
  167. package/dist/modules/audit/services/audit-leader.service.js +99 -0
  168. package/dist/modules/audit/services/audit-leader.service.js.map +1 -0
  169. package/dist/modules/audit/services/audit-outbox.worker.d.ts +29 -0
  170. package/dist/modules/audit/services/audit-outbox.worker.d.ts.map +1 -0
  171. package/dist/modules/audit/services/audit-outbox.worker.js +144 -0
  172. package/dist/modules/audit/services/audit-outbox.worker.js.map +1 -0
  173. package/dist/modules/audit/services/audit-partition.service.d.ts +18 -0
  174. package/dist/modules/audit/services/audit-partition.service.d.ts.map +1 -0
  175. package/dist/modules/audit/services/audit-partition.service.js +70 -0
  176. package/dist/modules/audit/services/audit-partition.service.js.map +1 -0
  177. package/dist/modules/audit/services/audit-write.service.d.ts +60 -0
  178. package/dist/modules/audit/services/audit-write.service.d.ts.map +1 -0
  179. package/dist/modules/audit/services/audit-write.service.js +463 -0
  180. package/dist/modules/audit/services/audit-write.service.js.map +1 -0
  181. package/dist/modules/audit/services/audit.service.d.ts +60 -0
  182. package/dist/modules/audit/services/audit.service.d.ts.map +1 -0
  183. package/dist/modules/audit/services/audit.service.js +373 -0
  184. package/dist/modules/audit/services/audit.service.js.map +1 -0
  185. package/dist/modules/audit/utils/audit-hash.util.d.ts +20 -0
  186. package/dist/modules/audit/utils/audit-hash.util.d.ts.map +1 -0
  187. package/dist/modules/audit/utils/audit-hash.util.js +44 -0
  188. package/dist/modules/audit/utils/audit-hash.util.js.map +1 -0
  189. package/dist/modules/auth/auth-core/auth-core.module.d.ts.map +1 -1
  190. package/dist/modules/auth/auth-core/auth-core.module.js +16 -4
  191. package/dist/modules/auth/auth-core/auth-core.module.js.map +1 -1
  192. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts +22 -0
  193. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts.map +1 -0
  194. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js +25 -0
  195. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js.map +1 -0
  196. package/dist/modules/auth/auth-core/services/access-token.validator.d.ts +19 -0
  197. package/dist/modules/auth/auth-core/services/access-token.validator.d.ts.map +1 -0
  198. package/dist/modules/auth/auth-core/services/access-token.validator.js +110 -0
  199. package/dist/modules/auth/auth-core/services/access-token.validator.js.map +1 -0
  200. package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts +10 -0
  201. package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts.map +1 -0
  202. package/dist/modules/auth/auth-core/services/family-denylist.reader.js +44 -0
  203. package/dist/modules/auth/auth-core/services/family-denylist.reader.js.map +1 -0
  204. package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts +10 -0
  205. package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts.map +1 -0
  206. package/dist/modules/auth/auth-core/services/session-epoch.reader.js +44 -0
  207. package/dist/modules/auth/auth-core/services/session-epoch.reader.js.map +1 -0
  208. package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts +7 -8
  209. package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts.map +1 -1
  210. package/dist/modules/auth/auth-core/strategies/jwt.strategy.js +34 -34
  211. package/dist/modules/auth/auth-core/strategies/jwt.strategy.js.map +1 -1
  212. package/dist/modules/auth/auth.manifest.d.ts +6 -0
  213. package/dist/modules/auth/auth.manifest.d.ts.map +1 -1
  214. package/dist/modules/auth/auth.manifest.js +38 -2
  215. package/dist/modules/auth/auth.manifest.js.map +1 -1
  216. package/dist/modules/auth/auth.module.d.ts.map +1 -1
  217. package/dist/modules/auth/auth.module.js +39 -4
  218. package/dist/modules/auth/auth.module.js.map +1 -1
  219. package/dist/modules/auth/controllers/account.controller.d.ts +15 -1
  220. package/dist/modules/auth/controllers/account.controller.d.ts.map +1 -1
  221. package/dist/modules/auth/controllers/account.controller.js +65 -7
  222. package/dist/modules/auth/controllers/account.controller.js.map +1 -1
  223. package/dist/modules/auth/controllers/auth.controller.d.ts +7 -3
  224. package/dist/modules/auth/controllers/auth.controller.d.ts.map +1 -1
  225. package/dist/modules/auth/controllers/auth.controller.js +76 -16
  226. package/dist/modules/auth/controllers/auth.controller.js.map +1 -1
  227. package/dist/modules/auth/controllers/forgot-password.controller.d.ts +4 -2
  228. package/dist/modules/auth/controllers/forgot-password.controller.d.ts.map +1 -1
  229. package/dist/modules/auth/controllers/forgot-password.controller.js +32 -11
  230. package/dist/modules/auth/controllers/forgot-password.controller.js.map +1 -1
  231. package/dist/modules/auth/controllers/mfa.controller.d.ts +18 -0
  232. package/dist/modules/auth/controllers/mfa.controller.d.ts.map +1 -0
  233. package/dist/modules/auth/controllers/mfa.controller.js +192 -0
  234. package/dist/modules/auth/controllers/mfa.controller.js.map +1 -0
  235. package/dist/modules/auth/controllers/oauth.controller.d.ts +22 -0
  236. package/dist/modules/auth/controllers/oauth.controller.d.ts.map +1 -0
  237. package/dist/modules/auth/controllers/oauth.controller.js +192 -0
  238. package/dist/modules/auth/controllers/oauth.controller.js.map +1 -0
  239. package/dist/modules/auth/controllers/otp.controller.d.ts +6 -3
  240. package/dist/modules/auth/controllers/otp.controller.d.ts.map +1 -1
  241. package/dist/modules/auth/controllers/otp.controller.js +32 -33
  242. package/dist/modules/auth/controllers/otp.controller.js.map +1 -1
  243. package/dist/modules/auth/controllers/pin.controller.d.ts.map +1 -1
  244. package/dist/modules/auth/controllers/pin.controller.js +10 -2
  245. package/dist/modules/auth/controllers/pin.controller.js.map +1 -1
  246. package/dist/modules/auth/controllers/session.controller.d.ts +12 -4
  247. package/dist/modules/auth/controllers/session.controller.d.ts.map +1 -1
  248. package/dist/modules/auth/controllers/session.controller.js +130 -31
  249. package/dist/modules/auth/controllers/session.controller.js.map +1 -1
  250. package/dist/modules/auth/dto/auth-config.dto.d.ts +11 -2
  251. package/dist/modules/auth/dto/auth-config.dto.d.ts.map +1 -1
  252. package/dist/modules/auth/dto/auth-config.dto.js +78 -3
  253. package/dist/modules/auth/dto/auth-config.dto.js.map +1 -1
  254. package/dist/modules/auth/dto/index.d.ts +2 -0
  255. package/dist/modules/auth/dto/index.d.ts.map +1 -1
  256. package/dist/modules/auth/dto/index.js +2 -0
  257. package/dist/modules/auth/dto/index.js.map +1 -1
  258. package/dist/modules/auth/dto/login.dto.d.ts +8 -1
  259. package/dist/modules/auth/dto/login.dto.d.ts.map +1 -1
  260. package/dist/modules/auth/dto/login.dto.js +48 -3
  261. package/dist/modules/auth/dto/login.dto.js.map +1 -1
  262. package/dist/modules/auth/dto/mfa.dto.d.ts +61 -0
  263. package/dist/modules/auth/dto/mfa.dto.d.ts.map +1 -0
  264. package/dist/modules/auth/dto/mfa.dto.js +326 -0
  265. package/dist/modules/auth/dto/mfa.dto.js.map +1 -0
  266. package/dist/modules/auth/dto/oauth.dto.d.ts +45 -0
  267. package/dist/modules/auth/dto/oauth.dto.d.ts.map +1 -0
  268. package/dist/modules/auth/dto/oauth.dto.js +249 -0
  269. package/dist/modules/auth/dto/oauth.dto.js.map +1 -0
  270. package/dist/modules/auth/dto/otp.dto.d.ts +3 -1
  271. package/dist/modules/auth/dto/otp.dto.d.ts.map +1 -1
  272. package/dist/modules/auth/dto/otp.dto.js +19 -0
  273. package/dist/modules/auth/dto/otp.dto.js.map +1 -1
  274. package/dist/modules/auth/dto/password.dto.d.ts +28 -0
  275. package/dist/modules/auth/dto/password.dto.d.ts.map +1 -1
  276. package/dist/modules/auth/dto/password.dto.js +191 -5
  277. package/dist/modules/auth/dto/password.dto.js.map +1 -1
  278. package/dist/modules/auth/dto/register.dto.d.ts +1 -0
  279. package/dist/modules/auth/dto/register.dto.d.ts.map +1 -1
  280. package/dist/modules/auth/dto/register.dto.js +1 -0
  281. package/dist/modules/auth/dto/register.dto.js.map +1 -1
  282. package/dist/modules/auth/dto/session.dto.d.ts +20 -0
  283. package/dist/modules/auth/dto/session.dto.d.ts.map +1 -0
  284. package/dist/modules/auth/dto/session.dto.js +98 -0
  285. package/dist/modules/auth/dto/session.dto.js.map +1 -0
  286. package/dist/modules/auth/dto/token.dto.d.ts +38 -1
  287. package/dist/modules/auth/dto/token.dto.d.ts.map +1 -1
  288. package/dist/modules/auth/dto/token.dto.js +21 -1
  289. package/dist/modules/auth/dto/token.dto.js.map +1 -1
  290. package/dist/modules/auth/entities/index.d.ts +2 -0
  291. package/dist/modules/auth/entities/index.d.ts.map +1 -1
  292. package/dist/modules/auth/entities/index.js +2 -0
  293. package/dist/modules/auth/entities/index.js.map +1 -1
  294. package/dist/modules/auth/entities/password-reset-token.entity.d.ts +2 -0
  295. package/dist/modules/auth/entities/password-reset-token.entity.d.ts.map +1 -1
  296. package/dist/modules/auth/entities/password-reset-token.entity.js +6 -0
  297. package/dist/modules/auth/entities/password-reset-token.entity.js.map +1 -1
  298. package/dist/modules/auth/entities/user-mfa.entity.d.ts +19 -0
  299. package/dist/modules/auth/entities/user-mfa.entity.d.ts.map +1 -0
  300. package/dist/modules/auth/entities/user-mfa.entity.js +73 -0
  301. package/dist/modules/auth/entities/user-mfa.entity.js.map +1 -0
  302. package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts +24 -0
  303. package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts.map +1 -0
  304. package/dist/modules/auth/entities/user-oauth-identity.entity.js +84 -0
  305. package/dist/modules/auth/entities/user-oauth-identity.entity.js.map +1 -0
  306. package/dist/modules/auth/events/auth.events.d.ts +84 -19
  307. package/dist/modules/auth/events/auth.events.d.ts.map +1 -1
  308. package/dist/modules/auth/events/auth.events.js +17 -9
  309. package/dist/modules/auth/events/auth.events.js.map +1 -1
  310. package/dist/modules/auth/services/account.service.d.ts +74 -14
  311. package/dist/modules/auth/services/account.service.d.ts.map +1 -1
  312. package/dist/modules/auth/services/account.service.js +247 -31
  313. package/dist/modules/auth/services/account.service.js.map +1 -1
  314. package/dist/modules/auth/services/dpop.service.d.ts +41 -0
  315. package/dist/modules/auth/services/dpop.service.d.ts.map +1 -0
  316. package/dist/modules/auth/services/dpop.service.js +159 -0
  317. package/dist/modules/auth/services/dpop.service.js.map +1 -0
  318. package/dist/modules/auth/services/index.d.ts +2 -0
  319. package/dist/modules/auth/services/index.d.ts.map +1 -1
  320. package/dist/modules/auth/services/index.js +2 -0
  321. package/dist/modules/auth/services/index.js.map +1 -1
  322. package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts +28 -0
  323. package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts.map +1 -0
  324. package/dist/modules/auth/services/legacy-hash-cleanup.service.js +163 -0
  325. package/dist/modules/auth/services/legacy-hash-cleanup.service.js.map +1 -0
  326. package/dist/modules/auth/services/login.service.d.ts +29 -34
  327. package/dist/modules/auth/services/login.service.d.ts.map +1 -1
  328. package/dist/modules/auth/services/login.service.js +173 -61
  329. package/dist/modules/auth/services/login.service.js.map +1 -1
  330. package/dist/modules/auth/services/mfa.service.d.ts +111 -0
  331. package/dist/modules/auth/services/mfa.service.d.ts.map +1 -0
  332. package/dist/modules/auth/services/mfa.service.js +662 -0
  333. package/dist/modules/auth/services/mfa.service.js.map +1 -0
  334. package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts +11 -0
  335. package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts.map +1 -0
  336. package/dist/modules/auth/services/oauth/apple-id-token.verifier.js +56 -0
  337. package/dist/modules/auth/services/oauth/apple-id-token.verifier.js.map +1 -0
  338. package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts +12 -0
  339. package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts.map +1 -0
  340. package/dist/modules/auth/services/oauth/google-id-token.verifier.js +64 -0
  341. package/dist/modules/auth/services/oauth/google-id-token.verifier.js.map +1 -0
  342. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts +11 -0
  343. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts.map +1 -0
  344. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js +76 -0
  345. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js.map +1 -0
  346. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts +16 -0
  347. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts.map +1 -0
  348. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js +92 -0
  349. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js.map +1 -0
  350. package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts +9 -0
  351. package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts.map +1 -0
  352. package/dist/modules/auth/services/oauth/verified-oauth-identity.js +3 -0
  353. package/dist/modules/auth/services/oauth/verified-oauth-identity.js.map +1 -0
  354. package/dist/modules/auth/services/oauth.service.d.ts +83 -0
  355. package/dist/modules/auth/services/oauth.service.d.ts.map +1 -0
  356. package/dist/modules/auth/services/oauth.service.js +471 -0
  357. package/dist/modules/auth/services/oauth.service.js.map +1 -0
  358. package/dist/modules/auth/services/otp-auth.service.d.ts +13 -3
  359. package/dist/modules/auth/services/otp-auth.service.d.ts.map +1 -1
  360. package/dist/modules/auth/services/otp-auth.service.js +41 -7
  361. package/dist/modules/auth/services/otp-auth.service.js.map +1 -1
  362. package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts +22 -0
  363. package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts.map +1 -0
  364. package/dist/modules/auth/services/password-reset-audit-retention.service.js +117 -0
  365. package/dist/modules/auth/services/password-reset-audit-retention.service.js.map +1 -0
  366. package/dist/modules/auth/services/password.service.d.ts +25 -5
  367. package/dist/modules/auth/services/password.service.d.ts.map +1 -1
  368. package/dist/modules/auth/services/password.service.js +154 -20
  369. package/dist/modules/auth/services/password.service.js.map +1 -1
  370. package/dist/modules/auth/services/pin-auth.service.d.ts +10 -3
  371. package/dist/modules/auth/services/pin-auth.service.d.ts.map +1 -1
  372. package/dist/modules/auth/services/pin-auth.service.js +110 -13
  373. package/dist/modules/auth/services/pin-auth.service.js.map +1 -1
  374. package/dist/modules/auth/services/registration.service.d.ts +10 -2
  375. package/dist/modules/auth/services/registration.service.d.ts.map +1 -1
  376. package/dist/modules/auth/services/registration.service.js +113 -25
  377. package/dist/modules/auth/services/registration.service.js.map +1 -1
  378. package/dist/modules/auth/services/turnstile.service.d.ts +17 -0
  379. package/dist/modules/auth/services/turnstile.service.d.ts.map +1 -0
  380. package/dist/modules/auth/services/turnstile.service.js +94 -0
  381. package/dist/modules/auth/services/turnstile.service.js.map +1 -0
  382. package/dist/modules/auth/utils/auth-params.util.d.ts +13 -6
  383. package/dist/modules/auth/utils/auth-params.util.d.ts.map +1 -1
  384. package/dist/modules/auth/utils/auth-params.util.js +27 -4
  385. package/dist/modules/auth/utils/auth-params.util.js.map +1 -1
  386. package/dist/modules/auth/utils/auth-supported.util.d.ts +12 -1
  387. package/dist/modules/auth/utils/auth-supported.util.d.ts.map +1 -1
  388. package/dist/modules/auth/utils/auth-supported.util.js +36 -4
  389. package/dist/modules/auth/utils/auth-supported.util.js.map +1 -1
  390. package/dist/modules/auth/utils/backup-code-hash.util.d.ts +10 -0
  391. package/dist/modules/auth/utils/backup-code-hash.util.d.ts.map +1 -0
  392. package/dist/modules/auth/utils/backup-code-hash.util.js +31 -0
  393. package/dist/modules/auth/utils/backup-code-hash.util.js.map +1 -0
  394. package/dist/modules/auth/utils/backup-codes.util.d.ts +5 -0
  395. package/dist/modules/auth/utils/backup-codes.util.d.ts.map +1 -0
  396. package/dist/modules/auth/utils/backup-codes.util.js +22 -0
  397. package/dist/modules/auth/utils/backup-codes.util.js.map +1 -0
  398. package/dist/modules/auth/utils/dpop.util.d.ts +22 -0
  399. package/dist/modules/auth/utils/dpop.util.d.ts.map +1 -0
  400. package/dist/modules/auth/utils/dpop.util.js +73 -0
  401. package/dist/modules/auth/utils/dpop.util.js.map +1 -0
  402. package/dist/modules/auth/utils/mfa-secret.util.d.ts +22 -0
  403. package/dist/modules/auth/utils/mfa-secret.util.d.ts.map +1 -0
  404. package/dist/modules/auth/utils/mfa-secret.util.js +59 -0
  405. package/dist/modules/auth/utils/mfa-secret.util.js.map +1 -0
  406. package/dist/modules/auth/utils/mfa-verify-params.util.d.ts +26 -0
  407. package/dist/modules/auth/utils/mfa-verify-params.util.d.ts.map +1 -0
  408. package/dist/modules/auth/utils/mfa-verify-params.util.js +49 -0
  409. package/dist/modules/auth/utils/mfa-verify-params.util.js.map +1 -0
  410. package/dist/modules/auth/utils/step-up-purpose.util.d.ts +5 -0
  411. package/dist/modules/auth/utils/step-up-purpose.util.d.ts.map +1 -0
  412. package/dist/modules/auth/utils/step-up-purpose.util.js +18 -0
  413. package/dist/modules/auth/utils/step-up-purpose.util.js.map +1 -0
  414. package/dist/modules/auth/utils/totp.util.d.ts +16 -0
  415. package/dist/modules/auth/utils/totp.util.d.ts.map +1 -0
  416. package/dist/modules/auth/utils/totp.util.js +88 -0
  417. package/dist/modules/auth/utils/totp.util.js.map +1 -0
  418. package/dist/modules/delivery/composers/otp-delivery.composer.d.ts +28 -1
  419. package/dist/modules/delivery/composers/otp-delivery.composer.d.ts.map +1 -1
  420. package/dist/modules/delivery/composers/otp-delivery.composer.js +48 -2
  421. package/dist/modules/delivery/composers/otp-delivery.composer.js.map +1 -1
  422. package/dist/modules/delivery/constants/delivery-worker.constants.d.ts +29 -0
  423. package/dist/modules/delivery/constants/delivery-worker.constants.d.ts.map +1 -0
  424. package/dist/modules/delivery/constants/delivery-worker.constants.js +51 -0
  425. package/dist/modules/delivery/constants/delivery-worker.constants.js.map +1 -0
  426. package/dist/modules/delivery/delivery.module.d.ts.map +1 -1
  427. package/dist/modules/delivery/delivery.module.js +1 -15
  428. package/dist/modules/delivery/delivery.module.js.map +1 -1
  429. package/dist/modules/delivery/entities/notification-delivery-log.entity.d.ts.map +1 -1
  430. package/dist/modules/delivery/entities/notification-delivery-log.entity.js +3 -1
  431. package/dist/modules/delivery/entities/notification-delivery-log.entity.js.map +1 -1
  432. package/dist/modules/delivery/notification-delivery.service.d.ts +12 -1
  433. package/dist/modules/delivery/notification-delivery.service.d.ts.map +1 -1
  434. package/dist/modules/delivery/notification-delivery.service.js +121 -40
  435. package/dist/modules/delivery/notification-delivery.service.js.map +1 -1
  436. package/dist/modules/delivery/processors/delivery-job.runner.d.ts +22 -1
  437. package/dist/modules/delivery/processors/delivery-job.runner.d.ts.map +1 -1
  438. package/dist/modules/delivery/processors/delivery-job.runner.js +144 -42
  439. package/dist/modules/delivery/processors/delivery-job.runner.js.map +1 -1
  440. package/dist/modules/delivery/processors/delivery.processor.d.ts.map +1 -1
  441. package/dist/modules/delivery/processors/delivery.processor.js +6 -1
  442. package/dist/modules/delivery/processors/delivery.processor.js.map +1 -1
  443. package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts +11 -0
  444. package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts.map +1 -1
  445. package/dist/modules/delivery/processors/otp-delivery-job.runner.js +90 -16
  446. package/dist/modules/delivery/processors/otp-delivery-job.runner.js.map +1 -1
  447. package/dist/modules/delivery/processors/otp-delivery.processor.d.ts.map +1 -1
  448. package/dist/modules/delivery/processors/otp-delivery.processor.js +6 -1
  449. package/dist/modules/delivery/processors/otp-delivery.processor.js.map +1 -1
  450. package/dist/modules/delivery/queues/sync-jobs.queue.d.ts +7 -1
  451. package/dist/modules/delivery/queues/sync-jobs.queue.d.ts.map +1 -1
  452. package/dist/modules/delivery/queues/sync-jobs.queue.js +11 -2
  453. package/dist/modules/delivery/queues/sync-jobs.queue.js.map +1 -1
  454. package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts +7 -3
  455. package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts.map +1 -1
  456. package/dist/modules/delivery/services/delivery-audit-retention.service.js +33 -10
  457. package/dist/modules/delivery/services/delivery-audit-retention.service.js.map +1 -1
  458. package/dist/modules/delivery/services/notification-audit.service.d.ts +7 -4
  459. package/dist/modules/delivery/services/notification-audit.service.d.ts.map +1 -1
  460. package/dist/modules/delivery/services/notification-audit.service.js +83 -26
  461. package/dist/modules/delivery/services/notification-audit.service.js.map +1 -1
  462. package/dist/modules/delivery/utils/payload-snapshot.util.d.ts +2 -0
  463. package/dist/modules/delivery/utils/payload-snapshot.util.d.ts.map +1 -1
  464. package/dist/modules/delivery/utils/payload-snapshot.util.js +22 -3
  465. package/dist/modules/delivery/utils/payload-snapshot.util.js.map +1 -1
  466. package/dist/modules/file-upload/controllers/file-upload.controller.d.ts +7 -1
  467. package/dist/modules/file-upload/controllers/file-upload.controller.d.ts.map +1 -1
  468. package/dist/modules/file-upload/controllers/file-upload.controller.js +5 -7
  469. package/dist/modules/file-upload/controllers/file-upload.controller.js.map +1 -1
  470. package/dist/modules/file-upload/dto/file-upload.dto.d.ts +2 -0
  471. package/dist/modules/file-upload/dto/file-upload.dto.d.ts.map +1 -1
  472. package/dist/modules/file-upload/dto/file-upload.dto.js +20 -0
  473. package/dist/modules/file-upload/dto/file-upload.dto.js.map +1 -1
  474. package/dist/modules/file-upload/file-upload.module.d.ts.map +1 -1
  475. package/dist/modules/file-upload/file-upload.module.js +12 -2
  476. package/dist/modules/file-upload/file-upload.module.js.map +1 -1
  477. package/dist/modules/file-upload/services/file-upload.service.d.ts +24 -6
  478. package/dist/modules/file-upload/services/file-upload.service.d.ts.map +1 -1
  479. package/dist/modules/file-upload/services/file-upload.service.js +164 -36
  480. package/dist/modules/file-upload/services/file-upload.service.js.map +1 -1
  481. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts +4 -2
  482. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts.map +1 -1
  483. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js +30 -5
  484. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js.map +1 -1
  485. package/dist/modules/file-upload/utils/image-optimize.util.d.ts.map +1 -1
  486. package/dist/modules/file-upload/utils/image-optimize.util.js +7 -1
  487. package/dist/modules/file-upload/utils/image-optimize.util.js.map +1 -1
  488. package/dist/modules/health/health.controller.d.ts +5 -1
  489. package/dist/modules/health/health.controller.d.ts.map +1 -1
  490. package/dist/modules/health/health.controller.js +57 -3
  491. package/dist/modules/health/health.controller.js.map +1 -1
  492. package/dist/modules/invitations/controllers/invitations.controller.d.ts +19 -4
  493. package/dist/modules/invitations/controllers/invitations.controller.d.ts.map +1 -1
  494. package/dist/modules/invitations/controllers/invitations.controller.js +19 -10
  495. package/dist/modules/invitations/controllers/invitations.controller.js.map +1 -1
  496. package/dist/modules/invitations/dto/invitation.dto.d.ts +13 -0
  497. package/dist/modules/invitations/dto/invitation.dto.d.ts.map +1 -1
  498. package/dist/modules/invitations/dto/invitation.dto.js +69 -2
  499. package/dist/modules/invitations/dto/invitation.dto.js.map +1 -1
  500. package/dist/modules/invitations/services/invitations.service.d.ts +24 -6
  501. package/dist/modules/invitations/services/invitations.service.d.ts.map +1 -1
  502. package/dist/modules/invitations/services/invitations.service.js +96 -20
  503. package/dist/modules/invitations/services/invitations.service.js.map +1 -1
  504. package/dist/modules/jobs/queues/jobs.queue.d.ts +7 -2
  505. package/dist/modules/jobs/queues/jobs.queue.d.ts.map +1 -1
  506. package/dist/modules/jobs/queues/jobs.queue.js +25 -10
  507. package/dist/modules/jobs/queues/jobs.queue.js.map +1 -1
  508. package/dist/modules/notifications/controllers/notifications.controller.d.ts +3 -1
  509. package/dist/modules/notifications/controllers/notifications.controller.d.ts.map +1 -1
  510. package/dist/modules/notifications/controllers/notifications.controller.js +25 -2
  511. package/dist/modules/notifications/controllers/notifications.controller.js.map +1 -1
  512. package/dist/modules/notifications/dto/notification-query.dto.d.ts.map +1 -1
  513. package/dist/modules/notifications/dto/notification-query.dto.js +1 -0
  514. package/dist/modules/notifications/dto/notification-query.dto.js.map +1 -1
  515. package/dist/modules/notifications/entities/device-token.entity.d.ts.map +1 -1
  516. package/dist/modules/notifications/entities/device-token.entity.js +3 -1
  517. package/dist/modules/notifications/entities/device-token.entity.js.map +1 -1
  518. package/dist/modules/notifications/services/fcm.service.d.ts +2 -0
  519. package/dist/modules/notifications/services/fcm.service.d.ts.map +1 -1
  520. package/dist/modules/notifications/services/fcm.service.js +28 -7
  521. package/dist/modules/notifications/services/fcm.service.js.map +1 -1
  522. package/dist/modules/notifications/services/notifications.service.d.ts +16 -3
  523. package/dist/modules/notifications/services/notifications.service.d.ts.map +1 -1
  524. package/dist/modules/notifications/services/notifications.service.js +95 -24
  525. package/dist/modules/notifications/services/notifications.service.js.map +1 -1
  526. package/dist/modules/observability/metrics/metrics.service.d.ts +2 -0
  527. package/dist/modules/observability/metrics/metrics.service.d.ts.map +1 -1
  528. package/dist/modules/observability/metrics/metrics.service.js +11 -0
  529. package/dist/modules/observability/metrics/metrics.service.js.map +1 -1
  530. package/dist/modules/otp/constants/otp.constants.d.ts +7 -5
  531. package/dist/modules/otp/constants/otp.constants.d.ts.map +1 -1
  532. package/dist/modules/otp/constants/otp.constants.js +11 -8
  533. package/dist/modules/otp/constants/otp.constants.js.map +1 -1
  534. package/dist/modules/otp/interfaces/otp.service.interface.d.ts +1 -1
  535. package/dist/modules/otp/interfaces/otp.service.interface.d.ts.map +1 -1
  536. package/dist/modules/otp/otp.service.d.ts +10 -2
  537. package/dist/modules/otp/otp.service.d.ts.map +1 -1
  538. package/dist/modules/otp/otp.service.js +48 -4
  539. package/dist/modules/otp/otp.service.js.map +1 -1
  540. package/dist/modules/otp/services/otp.rate-limiter.d.ts +2 -0
  541. package/dist/modules/otp/services/otp.rate-limiter.d.ts.map +1 -1
  542. package/dist/modules/otp/services/otp.rate-limiter.js +19 -0
  543. package/dist/modules/otp/services/otp.rate-limiter.js.map +1 -1
  544. package/dist/modules/otp/services/otp.session.store.d.ts +9 -3
  545. package/dist/modules/otp/services/otp.session.store.d.ts.map +1 -1
  546. package/dist/modules/otp/services/otp.session.store.js +34 -42
  547. package/dist/modules/otp/services/otp.session.store.js.map +1 -1
  548. package/dist/modules/otp/utils/otp-code-hash.util.d.ts +11 -0
  549. package/dist/modules/otp/utils/otp-code-hash.util.d.ts.map +1 -0
  550. package/dist/modules/otp/utils/otp-code-hash.util.js +68 -0
  551. package/dist/modules/otp/utils/otp-code-hash.util.js.map +1 -0
  552. package/dist/modules/profile/controllers/profile.controller.d.ts +9 -3
  553. package/dist/modules/profile/controllers/profile.controller.d.ts.map +1 -1
  554. package/dist/modules/profile/controllers/profile.controller.js +140 -8
  555. package/dist/modules/profile/controllers/profile.controller.js.map +1 -1
  556. package/dist/modules/profile/dto/create-user-profile.dto.d.ts +10 -0
  557. package/dist/modules/profile/dto/create-user-profile.dto.d.ts.map +1 -1
  558. package/dist/modules/profile/dto/create-user-profile.dto.js +43 -1
  559. package/dist/modules/profile/dto/create-user-profile.dto.js.map +1 -1
  560. package/dist/modules/profile/dto/public-user-profile.dto.d.ts +24 -0
  561. package/dist/modules/profile/dto/public-user-profile.dto.d.ts.map +1 -0
  562. package/dist/modules/profile/dto/public-user-profile.dto.js +115 -0
  563. package/dist/modules/profile/dto/public-user-profile.dto.js.map +1 -0
  564. package/dist/modules/profile/dto/user-profile-response.dto.d.ts +4 -0
  565. package/dist/modules/profile/dto/user-profile-response.dto.d.ts.map +1 -1
  566. package/dist/modules/profile/dto/user-profile-response.dto.js +4 -0
  567. package/dist/modules/profile/dto/user-profile-response.dto.js.map +1 -1
  568. package/dist/modules/profile/dto/username-available.dto.d.ts +6 -0
  569. package/dist/modules/profile/dto/username-available.dto.d.ts.map +1 -0
  570. package/dist/modules/profile/dto/username-available.dto.js +31 -0
  571. package/dist/modules/profile/dto/username-available.dto.js.map +1 -0
  572. package/dist/modules/profile/entities/user-profiles.entity.d.ts +10 -0
  573. package/dist/modules/profile/entities/user-profiles.entity.d.ts.map +1 -1
  574. package/dist/modules/profile/entities/user-profiles.entity.js +29 -1
  575. package/dist/modules/profile/entities/user-profiles.entity.js.map +1 -1
  576. package/dist/modules/profile/index.d.ts +1 -0
  577. package/dist/modules/profile/index.d.ts.map +1 -1
  578. package/dist/modules/profile/index.js +1 -0
  579. package/dist/modules/profile/index.js.map +1 -1
  580. package/dist/modules/profile/profile.manifest.d.ts +2 -2
  581. package/dist/modules/profile/profile.manifest.js +2 -2
  582. package/dist/modules/profile/profile.manifest.js.map +1 -1
  583. package/dist/modules/profile/profile.module.d.ts.map +1 -1
  584. package/dist/modules/profile/profile.module.js +7 -2
  585. package/dist/modules/profile/profile.module.js.map +1 -1
  586. package/dist/modules/profile/services/profile.service.d.ts +56 -4
  587. package/dist/modules/profile/services/profile.service.d.ts.map +1 -1
  588. package/dist/modules/profile/services/profile.service.js +247 -20
  589. package/dist/modules/profile/services/profile.service.js.map +1 -1
  590. package/dist/modules/realtime/adapters/redis-io.adapter.d.ts +26 -0
  591. package/dist/modules/realtime/adapters/redis-io.adapter.d.ts.map +1 -0
  592. package/dist/modules/realtime/adapters/redis-io.adapter.js +124 -0
  593. package/dist/modules/realtime/adapters/redis-io.adapter.js.map +1 -0
  594. package/dist/modules/realtime/constants/realtime.constants.d.ts +36 -0
  595. package/dist/modules/realtime/constants/realtime.constants.d.ts.map +1 -0
  596. package/dist/modules/realtime/constants/realtime.constants.js +42 -0
  597. package/dist/modules/realtime/constants/realtime.constants.js.map +1 -0
  598. package/dist/modules/realtime/controllers/realtime.controller.d.ts +21 -0
  599. package/dist/modules/realtime/controllers/realtime.controller.d.ts.map +1 -0
  600. package/dist/modules/realtime/controllers/realtime.controller.js +113 -0
  601. package/dist/modules/realtime/controllers/realtime.controller.js.map +1 -0
  602. package/dist/modules/realtime/gateway/realtime.gateway.d.ts +42 -0
  603. package/dist/modules/realtime/gateway/realtime.gateway.d.ts.map +1 -0
  604. package/dist/modules/realtime/gateway/realtime.gateway.js +289 -0
  605. package/dist/modules/realtime/gateway/realtime.gateway.js.map +1 -0
  606. package/dist/modules/realtime/index.d.ts +12 -0
  607. package/dist/modules/realtime/index.d.ts.map +1 -0
  608. package/dist/modules/realtime/index.js +35 -0
  609. package/dist/modules/realtime/index.js.map +1 -0
  610. package/dist/modules/realtime/realtime.manifest.d.ts +8 -0
  611. package/dist/modules/realtime/realtime.manifest.d.ts.map +1 -0
  612. package/dist/modules/realtime/realtime.manifest.js +31 -0
  613. package/dist/modules/realtime/realtime.manifest.js.map +1 -0
  614. package/dist/modules/realtime/realtime.module.d.ts +14 -0
  615. package/dist/modules/realtime/realtime.module.d.ts.map +1 -0
  616. package/dist/modules/realtime/realtime.module.js +126 -0
  617. package/dist/modules/realtime/realtime.module.js.map +1 -0
  618. package/dist/modules/realtime/services/realtime-handler.registry.d.ts +16 -0
  619. package/dist/modules/realtime/services/realtime-handler.registry.d.ts.map +1 -0
  620. package/dist/modules/realtime/services/realtime-handler.registry.js +55 -0
  621. package/dist/modules/realtime/services/realtime-handler.registry.js.map +1 -0
  622. package/dist/modules/realtime/services/realtime-presence.service.d.ts +15 -0
  623. package/dist/modules/realtime/services/realtime-presence.service.d.ts.map +1 -0
  624. package/dist/modules/realtime/services/realtime-presence.service.js +86 -0
  625. package/dist/modules/realtime/services/realtime-presence.service.js.map +1 -0
  626. package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts +12 -0
  627. package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts.map +1 -0
  628. package/dist/modules/realtime/services/realtime-rate-limiter.service.js +63 -0
  629. package/dist/modules/realtime/services/realtime-rate-limiter.service.js.map +1 -0
  630. package/dist/modules/realtime/services/realtime.service.d.ts +88 -0
  631. package/dist/modules/realtime/services/realtime.service.d.ts.map +1 -0
  632. package/dist/modules/realtime/services/realtime.service.js +343 -0
  633. package/dist/modules/realtime/services/realtime.service.js.map +1 -0
  634. package/dist/modules/realtime/types/realtime.types.d.ts +50 -0
  635. package/dist/modules/realtime/types/realtime.types.d.ts.map +1 -0
  636. package/dist/modules/realtime/types/realtime.types.js +14 -0
  637. package/dist/modules/realtime/types/realtime.types.js.map +1 -0
  638. package/dist/modules/realtime/utils/handshake-error.util.d.ts +5 -0
  639. package/dist/modules/realtime/utils/handshake-error.util.d.ts.map +1 -0
  640. package/dist/modules/realtime/utils/handshake-error.util.js +45 -0
  641. package/dist/modules/realtime/utils/handshake-error.util.js.map +1 -0
  642. package/dist/modules/roles/controllers/modules.controller.d.ts +4 -3
  643. package/dist/modules/roles/controllers/modules.controller.d.ts.map +1 -1
  644. package/dist/modules/roles/controllers/modules.controller.js +21 -10
  645. package/dist/modules/roles/controllers/modules.controller.js.map +1 -1
  646. package/dist/modules/roles/controllers/permissions.controller.d.ts +4 -3
  647. package/dist/modules/roles/controllers/permissions.controller.d.ts.map +1 -1
  648. package/dist/modules/roles/controllers/permissions.controller.js +21 -10
  649. package/dist/modules/roles/controllers/permissions.controller.js.map +1 -1
  650. package/dist/modules/roles/controllers/roles.controller.d.ts +5 -4
  651. package/dist/modules/roles/controllers/roles.controller.d.ts.map +1 -1
  652. package/dist/modules/roles/controllers/roles.controller.js +26 -13
  653. package/dist/modules/roles/controllers/roles.controller.js.map +1 -1
  654. package/dist/modules/roles/controllers/user-roles.controller.d.ts +3 -2
  655. package/dist/modules/roles/controllers/user-roles.controller.d.ts.map +1 -1
  656. package/dist/modules/roles/controllers/user-roles.controller.js +14 -6
  657. package/dist/modules/roles/controllers/user-roles.controller.js.map +1 -1
  658. package/dist/modules/roles/services/modules.service.d.ts +8 -5
  659. package/dist/modules/roles/services/modules.service.d.ts.map +1 -1
  660. package/dist/modules/roles/services/modules.service.js +58 -12
  661. package/dist/modules/roles/services/modules.service.js.map +1 -1
  662. package/dist/modules/roles/services/permissions.service.d.ts +8 -5
  663. package/dist/modules/roles/services/permissions.service.d.ts.map +1 -1
  664. package/dist/modules/roles/services/permissions.service.js +61 -12
  665. package/dist/modules/roles/services/permissions.service.js.map +1 -1
  666. package/dist/modules/roles/services/roles.service.d.ts +19 -9
  667. package/dist/modules/roles/services/roles.service.d.ts.map +1 -1
  668. package/dist/modules/roles/services/roles.service.js +137 -47
  669. package/dist/modules/roles/services/roles.service.js.map +1 -1
  670. package/dist/modules/roles/services/user-roles.service.d.ts +12 -4
  671. package/dist/modules/roles/services/user-roles.service.d.ts.map +1 -1
  672. package/dist/modules/roles/services/user-roles.service.js +58 -26
  673. package/dist/modules/roles/services/user-roles.service.js.map +1 -1
  674. package/dist/modules/sessions/entities/refresh-token.entity.d.ts +7 -1
  675. package/dist/modules/sessions/entities/refresh-token.entity.d.ts.map +1 -1
  676. package/dist/modules/sessions/entities/refresh-token.entity.js +10 -0
  677. package/dist/modules/sessions/entities/refresh-token.entity.js.map +1 -1
  678. package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts +12 -0
  679. package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts.map +1 -0
  680. package/dist/modules/sessions/entities/revoked-refresh-family.entity.js +46 -0
  681. package/dist/modules/sessions/entities/revoked-refresh-family.entity.js.map +1 -0
  682. package/dist/modules/sessions/services/refresh-token-retention.service.d.ts +20 -0
  683. package/dist/modules/sessions/services/refresh-token-retention.service.d.ts.map +1 -0
  684. package/dist/modules/sessions/services/refresh-token-retention.service.js +97 -0
  685. package/dist/modules/sessions/services/refresh-token-retention.service.js.map +1 -0
  686. package/dist/modules/sessions/services/token.service.d.ts +150 -16
  687. package/dist/modules/sessions/services/token.service.d.ts.map +1 -1
  688. package/dist/modules/sessions/services/token.service.js +505 -74
  689. package/dist/modules/sessions/services/token.service.js.map +1 -1
  690. package/dist/modules/sessions/sessions.module.d.ts.map +1 -1
  691. package/dist/modules/sessions/sessions.module.js +4 -2
  692. package/dist/modules/sessions/sessions.module.js.map +1 -1
  693. package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts +13 -0
  694. package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts.map +1 -0
  695. package/dist/modules/sessions/utils/refresh-token-hash.util.js +37 -0
  696. package/dist/modules/sessions/utils/refresh-token-hash.util.js.map +1 -0
  697. package/dist/modules/settings/constants/settings.defaults.d.ts +57 -3
  698. package/dist/modules/settings/constants/settings.defaults.d.ts.map +1 -1
  699. package/dist/modules/settings/constants/settings.defaults.js +58 -3
  700. package/dist/modules/settings/constants/settings.defaults.js.map +1 -1
  701. package/dist/modules/settings/constants/settings.keys.d.ts +138 -2
  702. package/dist/modules/settings/constants/settings.keys.d.ts.map +1 -1
  703. package/dist/modules/settings/constants/settings.keys.js +140 -2
  704. package/dist/modules/settings/constants/settings.keys.js.map +1 -1
  705. package/dist/modules/settings/controllers/settings.controller.d.ts +5 -1
  706. package/dist/modules/settings/controllers/settings.controller.d.ts.map +1 -1
  707. package/dist/modules/settings/controllers/settings.controller.js +134 -5
  708. package/dist/modules/settings/controllers/settings.controller.js.map +1 -1
  709. package/dist/modules/settings/services/settings.service.d.ts +17 -7
  710. package/dist/modules/settings/services/settings.service.d.ts.map +1 -1
  711. package/dist/modules/settings/services/settings.service.js +80 -14
  712. package/dist/modules/settings/services/settings.service.js.map +1 -1
  713. package/dist/modules/settings/utils/settings-secret.util.d.ts +13 -0
  714. package/dist/modules/settings/utils/settings-secret.util.d.ts.map +1 -0
  715. package/dist/modules/settings/utils/settings-secret.util.js +80 -0
  716. package/dist/modules/settings/utils/settings-secret.util.js.map +1 -0
  717. package/dist/modules/users/controllers/users.controller.d.ts +4 -2
  718. package/dist/modules/users/controllers/users.controller.d.ts.map +1 -1
  719. package/dist/modules/users/controllers/users.controller.js +89 -10
  720. package/dist/modules/users/controllers/users.controller.js.map +1 -1
  721. package/dist/modules/users/dto/user.dto.d.ts +3 -0
  722. package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
  723. package/dist/modules/users/dto/user.dto.js +27 -4
  724. package/dist/modules/users/dto/user.dto.js.map +1 -1
  725. package/dist/modules/users/entities/user.entity.d.ts +7 -1
  726. package/dist/modules/users/entities/user.entity.d.ts.map +1 -1
  727. package/dist/modules/users/entities/user.entity.js +10 -0
  728. package/dist/modules/users/entities/user.entity.js.map +1 -1
  729. package/dist/modules/users/services/users.service.d.ts +15 -2
  730. package/dist/modules/users/services/users.service.d.ts.map +1 -1
  731. package/dist/modules/users/services/users.service.js +152 -37
  732. package/dist/modules/users/services/users.service.js.map +1 -1
  733. package/dist/modules/users/users.module.d.ts.map +1 -1
  734. package/dist/modules/users/users.module.js +1 -2
  735. package/dist/modules/users/users.module.js.map +1 -1
  736. package/package.json +19 -7
  737. package/dist/modules/admin/entities/admin-log.entity.d.ts +0 -20
  738. package/dist/modules/admin/entities/admin-log.entity.d.ts.map +0 -1
  739. package/dist/modules/admin/entities/admin-log.entity.js +0 -65
  740. package/dist/modules/admin/entities/admin-log.entity.js.map +0 -1
@@ -53,21 +53,132 @@ exports.SETTING_KEYS = {
53
53
  // ─── Auth ─────────────────────────────────────────────────────────────────
54
54
  /** Primary identity method: "phone" | "email". */
55
55
  AUTH_METHOD: 'auth.method',
56
- /** Enabled login credential shapes: JSON string[] of "phone" | "email". */
56
+ /** Enabled login credential shapes: JSON string[] of "phone" | "email" | "oauth". */
57
57
  AUTH_SUPPORTED_LOGIN_METHODS: 'auth.supported_login_methods',
58
- /** Enabled registration credential shapes: JSON string[] of "phone" | "email". */
58
+ /** Enabled registration credential shapes: JSON string[] of "phone" | "email" | "oauth". */
59
59
  AUTH_SUPPORTED_REGISTRATION_METHODS: 'auth.supported_registration_methods',
60
60
  /** Role slug automatically assigned to every self-registered user. Empty string = no role. */
61
61
  AUTH_DEFAULT_ROLE_SLUG: 'auth.default_role_slug',
62
+ /**
63
+ * When true, email/password login is rejected until `user.isEmailVerified` is true.
64
+ * OAuth / phone OTP paths are unaffected.
65
+ */
66
+ AUTH_EMAIL_REQUIRE_VERIFIED_TO_LOGIN: 'auth.email.require_verified_to_login',
67
+ /** Global MFA kill-switch. When false, MFA challenges are never issued. */
68
+ AUTH_MFA_ENABLED: 'auth.mfa.enabled',
69
+ /**
70
+ * First-factor methods that trigger MFA when the user has MFA enrolled.
71
+ * JSON string[] of "phone" | "email" | "oauth". Default: phone + email + oauth.
72
+ */
73
+ AUTH_MFA_REQUIRED_FOR_METHODS: 'auth.mfa.required_for_methods',
74
+ /** MFA challenge token TTL in seconds. */
75
+ AUTH_MFA_CHALLENGE_TTL_SECONDS: 'auth.mfa.challenge_ttl_seconds',
76
+ /** Max failed MFA attempts before temporary lockout. */
77
+ AUTH_MFA_MAX_ATTEMPTS: 'auth.mfa.max_attempts',
78
+ /** MFA lockout duration in seconds. */
79
+ AUTH_MFA_LOCKOUT_DURATION_SECONDS: 'auth.mfa.lockout_duration_seconds',
80
+ /** Issuer label shown in authenticator apps. */
81
+ AUTH_MFA_TOTP_ISSUER: 'auth.mfa.totp_issuer',
82
+ /** Number of one-time backup codes issued when enabling/regenerating MFA recovery codes. */
83
+ AUTH_MFA_BACKUP_CODES_COUNT: 'auth.mfa.backup_codes_count',
84
+ /** Step-up MFA token TTL in seconds (elevated session for sensitive actions). */
85
+ AUTH_MFA_STEP_UP_TTL_SECONDS: 'auth.mfa.step_up_ttl_seconds',
86
+ /** Enabled OAuth providers: JSON string[] of "google" | "apple" | "microsoft". */
87
+ AUTH_OAUTH_PROVIDERS: 'auth.oauth.providers',
88
+ /**
89
+ * Google OAuth client IDs allowed to mint ID tokens (iOS / Android / Web).
90
+ * JSON string[].
91
+ */
92
+ AUTH_OAUTH_GOOGLE_CLIENT_IDS: 'auth.oauth.google.client_ids',
93
+ /** Google OAuth client secret for authorization-code + PKCE web exchange. */
94
+ AUTH_OAUTH_GOOGLE_CLIENT_SECRET: 'auth.oauth.google.client_secret',
95
+ /**
96
+ * Optional Google Workspace hosted domain restriction (`hd` claim).
97
+ * Empty string = no restriction.
98
+ */
99
+ AUTH_OAUTH_GOOGLE_HOSTED_DOMAIN: 'auth.oauth.google.hosted_domain',
100
+ /** Apple Services ID / bundle IDs allowed as ID token audience. JSON string[]. */
101
+ AUTH_OAUTH_APPLE_CLIENT_IDS: 'auth.oauth.apple.client_ids',
102
+ /** Microsoft app (client) IDs allowed as ID token audience. JSON string[]. */
103
+ AUTH_OAUTH_MICROSOFT_CLIENT_IDS: 'auth.oauth.microsoft.client_ids',
104
+ /** Microsoft OAuth client secret for authorization-code + PKCE web exchange. */
105
+ AUTH_OAUTH_MICROSOFT_CLIENT_SECRET: 'auth.oauth.microsoft.client_secret',
106
+ /** Microsoft Entra tenant: "common", "organizations", "consumers", or a tenant GUID. */
107
+ AUTH_OAUTH_MICROSOFT_TENANT: 'auth.oauth.microsoft.tenant',
108
+ /**
109
+ * Allowed OAuth redirect URIs for web start/callback. JSON string[].
110
+ * Empty = web code flow disabled.
111
+ */
112
+ AUTH_OAUTH_REDIRECT_URIS: 'auth.oauth.redirect_uris',
113
+ /**
114
+ * When true, a verified OAuth email matching an existing account auto-links on first OAuth login.
115
+ * When false (default), returns 409 and requires an authenticated link call.
116
+ */
117
+ AUTH_OAUTH_AUTO_LINK_VERIFIED_EMAIL: 'auth.oauth.auto_link_verified_email',
118
+ /**
119
+ * When true, OAuth ID-token login/register/link require a matching `nonce`
120
+ * (same value used at the IdP). Disable only for legacy clients.
121
+ */
122
+ AUTH_OAUTH_REQUIRE_ID_TOKEN_NONCE: 'auth.oauth.require_id_token_nonce',
123
+ /** Phone password-reset cool-off window in seconds (SIM-swap friction). */
124
+ AUTH_PASSWORD_RESET_PHONE_COOLDOWN_SECONDS: 'auth.password_reset.phone_cooldown_seconds',
125
+ /** Soft global OTP send budget per rolling day (0 = disabled). */
126
+ OTP_GLOBAL_DAILY_SEND_LIMIT: 'otp.global_daily_send_limit',
127
+ /** Require Cloudflare Turnstile on send-otp / resend-otp. */
128
+ AUTH_TURNSTILE_ENABLED: 'auth.turnstile.enabled',
129
+ /** Public Turnstile site key (also returned from GET /auth/config when enabled). */
130
+ AUTH_TURNSTILE_SITE_KEY: 'auth.turnstile.site_key',
131
+ /** Turnstile secret (encrypted at rest when ENCRYPTION_KEY is set). */
132
+ AUTH_TURNSTILE_SECRET_KEY: 'auth.turnstile.secret_key',
133
+ /**
134
+ * DPoP mode for access tokens: "off" | "optional" | "required".
135
+ * optional = bind when client sends DPoP; required = reject token issue without DPoP.
136
+ */
137
+ AUTH_DPOP_MODE: 'auth.dpop.mode',
62
138
  // ─── Login rate limiting & lockout ───────────────────────────────────────
63
139
  /** Max login attempts per IP within the rate-limit window. */
64
140
  LOGIN_IP_RATE_LIMIT_MAX: 'login.ip_rate_limit_max',
65
141
  /** Rolling window (seconds) for the per-IP login rate limit. */
66
142
  LOGIN_IP_RATE_LIMIT_WINDOW_SECONDS: 'login.ip_rate_limit_window_seconds',
143
+ /** Max refresh attempts per IP within the refresh rate-limit window. */
144
+ REFRESH_IP_RATE_LIMIT_MAX: 'refresh.ip_rate_limit_max',
145
+ /** Rolling window (seconds) for the per-IP refresh rate limit. */
146
+ REFRESH_IP_RATE_LIMIT_WINDOW_SECONDS: 'refresh.ip_rate_limit_window_seconds',
147
+ /**
148
+ * Max attempts per IP for public auth endpoints that are not login/refresh
149
+ * (register, forgot-password, OAuth start).
150
+ */
151
+ AUTH_PUBLIC_IP_RATE_LIMIT_MAX: 'auth.public_ip_rate_limit_max',
152
+ /** Rolling window (seconds) for the public-auth IP rate limit. */
153
+ AUTH_PUBLIC_IP_RATE_LIMIT_WINDOW_SECONDS: 'auth.public_ip_rate_limit_window_seconds',
154
+ /** Max GET /profile/u/:username attempts per IP within the window. */
155
+ PROFILE_PUBLIC_IP_RATE_LIMIT_MAX: 'profile.public_ip_rate_limit_max',
156
+ /** Rolling window (seconds) for public profile IP rate limit. */
157
+ PROFILE_PUBLIC_IP_RATE_LIMIT_WINDOW_SECONDS: 'profile.public_ip_rate_limit_window_seconds',
67
158
  /** Failed login attempts (per identifier) before the account is temporarily locked. */
68
159
  LOGIN_LOCKOUT_MAX_ATTEMPTS: 'login.lockout_max_attempts',
69
160
  /** Duration (seconds) an identifier remains locked after exceeding max attempts. */
70
161
  LOGIN_LOCKOUT_DURATION_SECONDS: 'login.lockout_duration_seconds',
162
+ /**
163
+ * Minimum seconds between last-login DB writes for the same user.
164
+ * Reduces hot-row churn under high login QPS (0 = write every login).
165
+ */
166
+ LOGIN_LAST_LOGIN_MIN_INTERVAL_SECONDS: 'login.last_login_min_interval_seconds',
167
+ /** Days to retain revoked/expired refresh_tokens before hard-delete purge. */
168
+ SESSIONS_REFRESH_TOKEN_RETENTION_DAYS: 'sessions.refresh_token_retention_days',
169
+ /** Default page size for GET /auth/sessions. */
170
+ SESSIONS_LIST_PAGE_SIZE: 'sessions.list_page_size',
171
+ /** Max page size for GET /auth/sessions. */
172
+ SESSIONS_LIST_MAX_PAGE_SIZE: 'sessions.list_max_page_size',
173
+ /** Days to retain password_reset_tokens audit rows before hard-delete. */
174
+ AUTH_PASSWORD_RESET_AUDIT_RETENTION_DAYS: 'auth.password_reset_audit_retention_days',
175
+ // ─── Audit (compliance trail) ─────────────────────────────────────────────
176
+ /** Days to keep audit_events in hot Postgres before R2 archive + purge. */
177
+ AUDIT_HOT_RETENTION_DAYS: 'audit.hot_retention_days',
178
+ /** When true, daily job archives aged non-legal-hold events to R2 then purges. */
179
+ AUDIT_ARCHIVE_ENABLED: 'audit.archive_enabled',
180
+ /** Max rows returned by GET /audit/events/export. */
181
+ AUDIT_EXPORT_MAX_ROWS: 'audit.export_max_rows',
71
182
  // ─── Health ───────────────────────────────────────────────────────────────
72
183
  /** Node.js heap threshold in MB — triggers health warning when exceeded. */
73
184
  HEALTH_MAX_HEAP_MB: 'health.max_heap_mb',
@@ -157,6 +268,15 @@ exports.SETTING_KEYS = {
157
268
  PIN_MAX_ATTEMPTS: 'pin.max_attempts',
158
269
  /** Duration (seconds) a PIN remains locked after exceeding max attempts. */
159
270
  PIN_LOCKOUT_DURATION_SECONDS: 'pin.lockout_duration_seconds',
271
+ /** Max PIN verify attempts per user within the rate-limit window. */
272
+ PIN_VERIFY_RATE_LIMIT_MAX: 'pin.verify_rate_limit_max',
273
+ /** Rolling window (seconds) for per-user PIN verify rate limit. */
274
+ PIN_VERIFY_RATE_LIMIT_WINDOW_SECONDS: 'pin.verify_rate_limit_window_seconds',
275
+ /**
276
+ * Minimum seconds between lastVerifiedAt writes for the same PIN.
277
+ * Reduces hot-row churn under frequent unlock (0 = write every verify).
278
+ */
279
+ PIN_LAST_VERIFIED_MIN_INTERVAL_SECONDS: 'pin.last_verified_min_interval_seconds',
160
280
  // ─── Delivery audit ───────────────────────────────────────────────────────
161
281
  /** Days to retain full payload snapshots on failed deliveries before redaction. */
162
282
  DELIVERY_AUDIT_SNAPSHOT_RETENTION_DAYS: 'delivery.audit_snapshot_retention_days',
@@ -192,5 +312,23 @@ exports.SETTING_KEYS = {
192
312
  FILES_UPLOAD_USER_RATE_LIMIT_MAX: 'files.upload.user_rate_limit_max',
193
313
  /** Rolling window (seconds) for per-user upload rate limit. */
194
314
  FILES_UPLOAD_USER_RATE_LIMIT_WINDOW_SECONDS: 'files.upload.user_rate_limit_window_seconds',
315
+ // ─── Realtime (WebSocket) ─────────────────────────────────────────────────
316
+ /** Max JSON payload bytes for realtime emit/inbound. */
317
+ REALTIME_MAX_PAYLOAD_BYTES: 'realtime.max_payload_bytes',
318
+ /** Presence key TTL / heartbeat window (seconds). */
319
+ REALTIME_PRESENCE_TTL_SECONDS: 'realtime.presence_ttl_seconds',
320
+ /** Max handshake attempts per IP in the window. */
321
+ REALTIME_HANDSHAKE_IP_RATE_LIMIT_MAX: 'realtime.handshake.ip_rate_limit_max',
322
+ REALTIME_HANDSHAKE_IP_RATE_LIMIT_WINDOW_SECONDS: 'realtime.handshake.ip_rate_limit_window_seconds',
323
+ /** Max server emits attributed per user in the window. */
324
+ REALTIME_EMIT_USER_RATE_LIMIT_MAX: 'realtime.emit.user_rate_limit_max',
325
+ REALTIME_EMIT_USER_RATE_LIMIT_WINDOW_SECONDS: 'realtime.emit.user_rate_limit_window_seconds',
326
+ /** Max client→server inbound events per user in the window. */
327
+ REALTIME_INBOUND_USER_RATE_LIMIT_MAX: 'realtime.inbound.user_rate_limit_max',
328
+ REALTIME_INBOUND_USER_RATE_LIMIT_WINDOW_SECONDS: 'realtime.inbound.user_rate_limit_window_seconds',
329
+ /** Emit notification.created to the user socket when channel includes websocket. */
330
+ REALTIME_EMIT_NOTIFICATION_CREATED: 'realtime.emit.notification_created',
331
+ /** Emit session.revoked before force-disconnect. */
332
+ REALTIME_EMIT_SESSION_REVOKED: 'realtime.emit.session_revoked',
195
333
  };
196
334
  //# sourceMappingURL=settings.keys.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.keys.js","sourceRoot":"","sources":["../../../../src/modules/settings/constants/settings.keys.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,YAAY,GAAG;IAC3B,4EAA4E;IAC5E,yDAAyD;IACzD,eAAe,EAAE,iBAAiB;IAClC,oEAAoE;IACpE,gBAAgB,EAAE,kBAAkB;IACpC,gEAAgE;IAChE,2BAA2B,EAAE,6BAA6B;IAC1D,iEAAiE;IACjE,kBAAkB,EAAE,oBAAoB;IACxC,kEAAkE;IAClE,6BAA6B,EAAE,+BAA+B;IAC9D,4DAA4D;IAC5D,qBAAqB,EAAE,uBAAuB;IAC9C,8DAA8D;IAC9D,gCAAgC,EAAE,kCAAkC;IACpE,qDAAqD;IACrD,gBAAgB,EAAE,kBAAkB;IACpC,2CAA2C;IAC3C,iBAAiB,EAAE,mBAAmB;IACtC,4DAA4D;IAC5D,uBAAuB,EAAE,yBAAyB;IAClD,sEAAsE;IACtE,uBAAuB,EAAE,yBAAyB;IAClD,+CAA+C;IAC/C,eAAe,EAAE,iBAAiB;IAElC,6EAA6E;IAC7E,sCAAsC;IACtC,uBAAuB,EAAE,yBAAyB;IAClD,iDAAiD;IACjD,4BAA4B,EAAE,8BAA8B;IAC5D,yDAAyD;IACzD,wBAAwB,EAAE,0BAA0B;IACpD,oCAAoC;IACpC,sBAAsB,EAAE,wBAAwB;IAChD,gDAAgD;IAChD,iCAAiC,EAAE,mCAAmC;IAEtE,6EAA6E;IAC7E;;;;OAIG;IACH,oBAAoB,EAAE,sBAAsB;IAE5C,6EAA6E;IAC7E,kDAAkD;IAClD,WAAW,EAAE,aAAa;IAC1B,2EAA2E;IAC3E,4BAA4B,EAAE,8BAA8B;IAC5D,kFAAkF;IAClF,mCAAm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3F,qBAAqB,EAAE,uBAAuB;IAC9C,2DAA2D;IAC3D,sBAAsB,EAAE,wBAAwB;IAChD;;;OAGG;IACH,yBAAyB,EAAE,2BAA2B;IAEtD,6EAA6E;IAC7E,+DAA+D;IAC/D,8BAA8B,EAAE,gCAAgC;IAChE,6DAA6D;IAC7D,yCAAyC,EAAE,2CAA2C;IACtF,iEAAiE;IACjE,gCAAgC,EAAE,kCAAkC;IACpE,+DAA+D;IAC/D,2CAA2C,EAAE,6CAA6C;CACjF,CAAC"}
1
+ {"version":3,"file":"settings.keys.js","sourceRoot":"","sources":["../../../../src/modules/settings/constants/settings.keys.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,YAAY,GAAG;IAC3B,4EAA4E;IAC5E,yDAAyD;IACzD,eAAe,EAAE,iBAAiB;IAClC,oEAAoE;IACpE,gBAAgB,EAAE,kBAAkB;IACpC,gEAAgE;IAChE,2BAA2B,EAAE,6BAA6B;IAC1D,iEAAiE;IACjE,kBAAkB,EAAE,oBAAoB;IACxC,kEAAkE;IAClE,6BAA6B,EAAE,+BAA+B;IAC9D,4DAA4D;IAC5D,qBAAqB,EAAE,uBAAuB;IAC9C,8DAA8D;IAC9D,gCAAgC,EAAE,kCAAkC;IACpE,qDAAqD;IACrD,gBAAgB,EAAE,kBAAkB;IACpC,2CAA2C;IAC3C,iBAAiB,EAAE,mBAAmB;IACtC,4DAA4D;IAC5D,uBAAuB,EAAE,yBAAyB;IAClD,sEAAsE;IACtE,uBAAuB,EAAE,yBAAyB;IAClD,+CAA+C;IAC/C,eAAe,EAAE,iBAAiB;IAElC,6EAA6E;IAC7E,sCAAsC;IACtC,uBAAuB,EAAE,yBAAyB;IAClD,iDAAiD;IACjD,4BAA4B,EAAE,8BAA8B;IAC5D,yDAAyD;IACzD,wBAAwB,EAAE,0BAA0B;IACpD,oCAAoC;IACpC,sBAAsB,EAAE,wBAAwB;IAChD,gDAAgD;IAChD,iCAAiC,EAAE,mCAAmC;IAEtE,6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;IACrD,6BAA6B,EAAE,+BAA+B;IAC9D,mDAAmD;IACnD,oCAAoC,EAAE,sCAAsC;IAC5E,+CAA+C,EAC9C,iDAAiD;IAClD,0DAA0D;IAC1D,iCAAiC,EAAE,mCAAmC;IACtE,4CAA4C,EAAE,8CAA8C;IAC5F,+DAA+D;IAC/D,oCAAoC,EAAE,sCAAsC;IAC5E,+CAA+C,EAC9C,iDAAiD;IAClD,oFAAoF;IACpF,kCAAkC,EAAE,oCAAoC;IACxE,oDAAoD;IACpD,6BAA6B,EAAE,+BAA+B;CACrD,CAAC"}
@@ -1,8 +1,12 @@
1
+ import { DataSource } from 'typeorm';
2
+ import { AuditService } from '../../audit/services/audit.service';
1
3
  import { UpdateSettingDto } from '../dto/settings.dto';
2
4
  import { SettingsService } from '../services/settings.service';
3
5
  export declare class SettingsController {
4
6
  private readonly settingsService;
5
- constructor(settingsService: SettingsService);
7
+ private readonly audit;
8
+ private readonly dataSource;
9
+ constructor(settingsService: SettingsService, audit: AuditService, dataSource: DataSource);
6
10
  /**
7
11
  * Returns all settings rows ordered by group then key.
8
12
  * Requires: settings:read
@@ -1 +1 @@
1
- {"version":3,"file":"settings.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/settings/controllers/settings.controller.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,qBAIa,kBAAkB;IAClB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,eAAe;IAE7D;;;OAGG;IAUH,OAAO;IAIP;;;;OAIG;IAqBG,MAAM,CACG,GAAG,EAAE,MAAM,EACjB,GAAG,EAAE,gBAAgB,EACV,MAAM,EAAE,MAAM;;;;;CA2BlC"}
1
+ {"version":3,"file":"settings.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/settings/controllers/settings.controller.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAMrC,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAQlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAQ/D,qBAIa,kBAAkB;IAE7B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAFV,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,UAAU;IAGxC;;;OAGG;IAUH,OAAO;IAIP;;;;OAIG;IAqBG,MAAM,CACG,GAAG,EAAE,MAAM,EACjB,GAAG,EAAE,gBAAgB,EACV,MAAM,EAAE,MAAM;;;;;CAyLlC"}
@@ -15,18 +15,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.SettingsController = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
17
  const swagger_1 = require("@nestjs/swagger");
18
+ const typeorm_1 = require("typeorm");
18
19
  const decorators_1 = require("../../../common/decorators");
19
20
  const auth_guard_1 = require("../../../common/guards/auth.guard");
20
21
  const permissions_guard_1 = require("../../../common/guards/permissions.guard");
22
+ const audit_actions_1 = require("../../audit/constants/audit-actions");
23
+ const audit_service_1 = require("../../audit/services/audit.service");
21
24
  const otp_constants_1 = require("../../otp/constants/otp.constants");
22
25
  const settings_keys_1 = require("../constants/settings.keys");
23
26
  const settings_dto_1 = require("../dto/settings.dto");
24
27
  const settings_service_1 = require("../services/settings.service");
25
28
  const settings_manifest_1 = require("../settings.manifest");
29
+ const settings_secret_util_1 = require("../utils/settings-secret.util");
26
30
  let SettingsController = class SettingsController {
27
31
  settingsService;
28
- constructor(settingsService) {
32
+ audit;
33
+ dataSource;
34
+ constructor(settingsService, audit, dataSource) {
29
35
  this.settingsService = settingsService;
36
+ this.audit = audit;
37
+ this.dataSource = dataSource;
30
38
  }
31
39
  /**
32
40
  * Returns all settings rows ordered by group then key.
@@ -50,11 +58,130 @@ let SettingsController = class SettingsController {
50
58
  }
51
59
  if (key === settings_keys_1.SETTING_KEYS.OTP_CODE_LENGTH) {
52
60
  const parsed = parseInt(String(dto.value), 10);
53
- if (!Number.isInteger(parsed) || (0, otp_constants_1.clampOtpCodeLength)(parsed) !== parsed) {
54
- throw new common_1.BadRequestException(`otp.code_length must be an integer between ${otp_constants_1.OTP_MIN_LENGTH} and ${otp_constants_1.OTP_MAX_LENGTH}.`);
61
+ const min = process.env.NODE_ENV === 'production' ? otp_constants_1.OTP_PROD_MIN_LENGTH : otp_constants_1.OTP_MIN_LENGTH;
62
+ if (!Number.isInteger(parsed) || (0, otp_constants_1.clampOtpCodeLength)(parsed, min) !== parsed) {
63
+ throw new common_1.BadRequestException(`otp.code_length must be an integer between ${min} and ${otp_constants_1.OTP_MAX_LENGTH}.`);
55
64
  }
56
65
  }
57
- await this.settingsService.set(key, dto.value, userId);
66
+ if (key === settings_keys_1.SETTING_KEYS.AUTH_OAUTH_AUTO_LINK_VERIFIED_EMAIL &&
67
+ (dto.value === 'true' || dto.value === '1')) {
68
+ throw new common_1.BadRequestException('Enabling OAuth auto-link is blocked via API (account-takeover risk). ' +
69
+ 'Set it only via controlled ops/seed after threat-model review.');
70
+ }
71
+ if (key === settings_keys_1.SETTING_KEYS.AUTH_MFA_ENABLED && (dto.value === 'false' || dto.value === '0')) {
72
+ throw new common_1.BadRequestException('Disabling global MFA via API is blocked (factor-bypass risk). ' +
73
+ 'Change only via controlled ops/seed after threat-model review.');
74
+ }
75
+ if (key === settings_keys_1.SETTING_KEYS.AUTH_OAUTH_REQUIRE_ID_TOKEN_NONCE &&
76
+ (dto.value === 'false' || dto.value === '0')) {
77
+ throw new common_1.BadRequestException('Disabling OAuth ID-token nonce via API is blocked (replay risk). Ops/seed only.');
78
+ }
79
+ if (key === settings_keys_1.SETTING_KEYS.AUTH_DPOP_MODE &&
80
+ String(dto.value).trim().toLowerCase() !== 'required') {
81
+ throw new common_1.BadRequestException('Weakening DPoP mode via API is blocked. Use AUTH_DPOP_MODE env / ops only.');
82
+ }
83
+ if (key === settings_keys_1.SETTING_KEYS.AUTH_TURNSTILE_ENABLED &&
84
+ (dto.value === 'false' || dto.value === '0')) {
85
+ throw new common_1.BadRequestException('Disabling Turnstile via API is blocked. Use TURNSTILE_ENABLED env / ops only.');
86
+ }
87
+ if ((0, settings_secret_util_1.isSecretSettingKey)(key) ||
88
+ (0, settings_secret_util_1.isOAuthAllowlistSettingKey)(key) ||
89
+ (0, settings_secret_util_1.isOpsOnlySettingKey)(key)) {
90
+ throw new common_1.BadRequestException(`Setting "${key}" cannot be changed via API (credential / OAuth allowlist / ops-only). Ops/seed only.`);
91
+ }
92
+ if (key === settings_keys_1.SETTING_KEYS.AUTH_DEFAULT_ROLE_SLUG) {
93
+ throw new common_1.BadRequestException('auth.default_role_slug cannot be changed via API (privilege-escalation risk). Ops/seed only.');
94
+ }
95
+ if (key === settings_keys_1.SETTING_KEYS.AUTH_EMAIL_REQUIRE_VERIFIED_TO_LOGIN &&
96
+ (dto.value === 'false' || dto.value === '0')) {
97
+ throw new common_1.BadRequestException('Disabling email verified-to-login via API is blocked. Ops/seed only.');
98
+ }
99
+ if (key === settings_keys_1.SETTING_KEYS.TOKENS_ACCESS_EXPIRES_IN) {
100
+ const raw = String(dto.value).trim().toLowerCase();
101
+ const match = /^(\d+)([smhd])$/.exec(raw);
102
+ if (!match) {
103
+ throw new common_1.BadRequestException('tokens.access_expires_in must be a duration like 5m, 300s, or 1h.');
104
+ }
105
+ const n = Number(match[1]);
106
+ const unit = match[2];
107
+ const ms = unit === 's'
108
+ ? n * 1000
109
+ : unit === 'm'
110
+ ? n * 60_000
111
+ : unit === 'h'
112
+ ? n * 3_600_000
113
+ : n * 86_400_000;
114
+ if (ms > 5 * 60_000) {
115
+ throw new common_1.BadRequestException('tokens.access_expires_in cannot exceed 5m (stolen access-token window).');
116
+ }
117
+ }
118
+ if (key === settings_keys_1.SETTING_KEYS.TOKENS_REFRESH_TTL_DAYS) {
119
+ const days = parseInt(String(dto.value), 10);
120
+ if (!Number.isInteger(days) || days < 1 || days > 90) {
121
+ throw new common_1.BadRequestException('tokens.refresh_ttl_days must be an integer between 1 and 90.');
122
+ }
123
+ }
124
+ const integerBounds = {
125
+ [settings_keys_1.SETTING_KEYS.LOGIN_IP_RATE_LIMIT_MAX]: { min: 5, max: 1_000 },
126
+ [settings_keys_1.SETTING_KEYS.REFRESH_IP_RATE_LIMIT_MAX]: { min: 10, max: 5_000 },
127
+ [settings_keys_1.SETTING_KEYS.OTP_IP_RATE_LIMIT_MAX]: { min: 5, max: 500 },
128
+ [settings_keys_1.SETTING_KEYS.AUTH_PUBLIC_IP_RATE_LIMIT_MAX]: { min: 5, max: 1_000 },
129
+ [settings_keys_1.SETTING_KEYS.PROFILE_PUBLIC_IP_RATE_LIMIT_MAX]: { min: 5, max: 1_000 },
130
+ [settings_keys_1.SETTING_KEYS.OTP_RATE_LIMIT_MAX]: { min: 3, max: 100 },
131
+ [settings_keys_1.SETTING_KEYS.OTP_MAX_ATTEMPTS]: { min: 3, max: 20 },
132
+ [settings_keys_1.SETTING_KEYS.AUTH_MFA_MAX_ATTEMPTS]: { min: 3, max: 20 },
133
+ [settings_keys_1.SETTING_KEYS.AUTH_MFA_LOCKOUT_DURATION_SECONDS]: { min: 300, max: 86_400 },
134
+ [settings_keys_1.SETTING_KEYS.LOGIN_LOCKOUT_MAX_ATTEMPTS]: { min: 5, max: 50 },
135
+ [settings_keys_1.SETTING_KEYS.LOGIN_LOCKOUT_DURATION_SECONDS]: { min: 300, max: 86_400 },
136
+ [settings_keys_1.SETTING_KEYS.AUTH_PASSWORD_RESET_PHONE_COOLDOWN_SECONDS]: { min: 3600, max: 604_800 },
137
+ [settings_keys_1.SETTING_KEYS.PIN_MAX_ATTEMPTS]: { min: 3, max: 20 },
138
+ [settings_keys_1.SETTING_KEYS.PIN_LOCKOUT_DURATION_SECONDS]: { min: 60, max: 3_600 },
139
+ [settings_keys_1.SETTING_KEYS.PIN_VERIFY_RATE_LIMIT_MAX]: { min: 5, max: 1_000 },
140
+ [settings_keys_1.SETTING_KEYS.PIN_VERIFY_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
141
+ [settings_keys_1.SETTING_KEYS.PIN_LAST_VERIFIED_MIN_INTERVAL_SECONDS]: { min: 0, max: 3_600 },
142
+ [settings_keys_1.SETTING_KEYS.OTP_RESEND_COOLDOWN_SECONDS]: { min: 30, max: 3_600 },
143
+ [settings_keys_1.SETTING_KEYS.OTP_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
144
+ [settings_keys_1.SETTING_KEYS.OTP_IP_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
145
+ [settings_keys_1.SETTING_KEYS.LOGIN_IP_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
146
+ [settings_keys_1.SETTING_KEYS.REFRESH_IP_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
147
+ [settings_keys_1.SETTING_KEYS.AUTH_PUBLIC_IP_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
148
+ [settings_keys_1.SETTING_KEYS.PROFILE_PUBLIC_IP_RATE_LIMIT_WINDOW_SECONDS]: {
149
+ min: 60,
150
+ max: 86_400,
151
+ },
152
+ [settings_keys_1.SETTING_KEYS.FILES_UPLOAD_IP_RATE_LIMIT_MAX]: { min: 5, max: 1_000 },
153
+ [settings_keys_1.SETTING_KEYS.FILES_UPLOAD_USER_RATE_LIMIT_MAX]: { min: 5, max: 1_000 },
154
+ [settings_keys_1.SETTING_KEYS.FILES_UPLOAD_IP_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
155
+ [settings_keys_1.SETTING_KEYS.FILES_UPLOAD_USER_RATE_LIMIT_WINDOW_SECONDS]: { min: 60, max: 86_400 },
156
+ [settings_keys_1.SETTING_KEYS.AUTH_MFA_CHALLENGE_TTL_SECONDS]: { min: 60, max: 900 },
157
+ [settings_keys_1.SETTING_KEYS.AUTH_MFA_STEP_UP_TTL_SECONDS]: { min: 60, max: 900 },
158
+ [settings_keys_1.SETTING_KEYS.OTP_TTL_SECONDS]: { min: 60, max: 900 },
159
+ [settings_keys_1.SETTING_KEYS.TOKENS_TEMPORARY_TTL_SECONDS]: { min: 60, max: 900 },
160
+ [settings_keys_1.SETTING_KEYS.TOKENS_PASSWORD_RESET_TTL_SECONDS]: { min: 300, max: 7_200 },
161
+ [settings_keys_1.SETTING_KEYS.TOKENS_INVITE_TTL_DAYS]: { min: 1, max: 30 },
162
+ /** Soft SMS-drain budget; API cannot set 0 (disables). Ops/seed only for disable. */
163
+ [settings_keys_1.SETTING_KEYS.OTP_GLOBAL_DAILY_SEND_LIMIT]: { min: 1_000, max: 1_000_000 },
164
+ };
165
+ const bounds = integerBounds[key];
166
+ if (bounds) {
167
+ const parsed = parseInt(String(dto.value), 10);
168
+ if (!Number.isInteger(parsed) || parsed < bounds.min || parsed > bounds.max) {
169
+ throw new common_1.BadRequestException(`${key} must be an integer between ${bounds.min} and ${bounds.max} via API.`);
170
+ }
171
+ }
172
+ const previous = (0, settings_secret_util_1.isSecretSettingKey)(key) ? '[REDACTED]' : setting.value;
173
+ const next = (0, settings_secret_util_1.isSecretSettingKey)(key) ? '[REDACTED]' : dto.value;
174
+ await this.dataSource.transaction(async (manager) => {
175
+ await this.settingsService.set(key, dto.value, userId, manager);
176
+ await this.audit.recordInTransaction(manager, {
177
+ action: audit_actions_1.AUDIT_ACTIONS.SETTING_UPDATED,
178
+ actorType: 'ADMIN',
179
+ actorId: userId,
180
+ resourceType: 'setting',
181
+ resourceId: key,
182
+ metadata: { before: previous, after: next },
183
+ });
184
+ });
58
185
  return { key, value: dto.value, message: 'Setting updated successfully.' };
59
186
  }
60
187
  };
@@ -104,6 +231,8 @@ exports.SettingsController = SettingsController = __decorate([
104
231
  (0, swagger_1.ApiBearerAuth)(),
105
232
  (0, common_1.Controller)('settings'),
106
233
  (0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard, permissions_guard_1.PermissionsGuard),
107
- __metadata("design:paramtypes", [settings_service_1.SettingsService])
234
+ __metadata("design:paramtypes", [settings_service_1.SettingsService,
235
+ audit_service_1.AuditService,
236
+ typeorm_1.DataSource])
108
237
  ], SettingsController);
109
238
  //# sourceMappingURL=settings.controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.controller.js","sourceRoot":"","sources":["../../../../src/modules/settings/controllers/settings.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAYwB;AACxB,6CAQyB;AAEzB,2DAA4E;AAC5E,kEAAiE;AACjE,gFAA4E;AAC5E,qEAI2C;AAC3C,8DAA0D;AAC1D,sDAAuD;AACvD,mEAA+D;AAC/D,4DAA4D;AAMrD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACD;IAA7B,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAEjE;;;OAGG;IAUH,OAAO;QACN,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;IACvC,CAAC;IAED;;;;OAIG;IAqBG,AAAN,KAAK,CAAC,MAAM,CACG,GAAW,EACjB,GAAqB,EACV,MAAc;QAEjC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAExD,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,MAAM,IAAI,0BAAiB,CAAC,YAAY,GAAG,mBAAmB,CAAC,CAAC;QACjE,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YACzB,MAAM,IAAI,2BAAkB,CAC3B,YAAY,GAAG,mDAAmD,CAClE,CAAC;QACH,CAAC;QAED,IAAI,GAAG,KAAK,4BAAY,CAAC,eAAe,EAAE,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;QAC9B,WAAW,EAAE,4BAA4B;KACzC,CAAC;IACD,IAAA,uBAAa,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAC/D,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAElE,WAAA,IAAA,cAAK,EAAC,KAAK,CAAC,CAAA;IACZ,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,wBAAW,EAAC,IAAI,CAAC,CAAA;;6CADL,+BAAgB;;gDA2B7B;6BA1EW,kBAAkB;IAJ9B,IAAA,iBAAO,EAAC,UAAU,CAAC;IACnB,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,UAAU,CAAC;IACtB,IAAA,kBAAS,EAAC,yBAAY,EAAE,oCAAgB,CAAC;qCAEK,kCAAe;GADjD,kBAAkB,CA2E9B"}
1
+ {"version":3,"file":"settings.controller.js","sourceRoot":"","sources":["../../../../src/modules/settings/controllers/settings.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAYwB;AACxB,6CAQyB;AACzB,qCAAqC;AAErC,2DAA4E;AAC5E,kEAAiE;AACjE,gFAA4E;AAC5E,uEAAoE;AACpE,sEAAkE;AAClE,qEAK2C;AAC3C,8DAA0D;AAC1D,sDAAuD;AACvD,mEAA+D;AAC/D,4DAA4D;AAC5D,wEAIuC;AAMhC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEZ;IACA;IACA;IAHlB,YACkB,eAAgC,EAChC,KAAmB,EACnB,UAAsB;QAFtB,oBAAe,GAAf,eAAe,CAAiB;QAChC,UAAK,GAAL,KAAK,CAAc;QACnB,eAAU,GAAV,UAAU,CAAY;IACrC,CAAC;IAEJ;;;OAGG;IAUH,OAAO;QACN,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;IACvC,CAAC;IAED;;;;OAIG;IAqBG,AAAN,KAAK,CAAC,MAAM,CACG,GAAW,EACjB,GAAqB,EACV,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1
+ import { OnModuleDestroy, OnModuleInit } from '@nestjs/common';
2
+ import { ConfigService } from '@nestjs/config';
3
+ import type IORedis from 'ioredis';
4
+ import { EntityManager, Repository } from 'typeorm';
3
5
  import { StructuredLoggerService } from '../../observability/logging/structured-logger.service';
4
6
  import { AppSetting } from '../entities/app-setting.entity';
5
7
  type ChangeHook = (key: string, value: unknown) => void;
6
- export declare class SettingsService implements OnModuleInit {
8
+ export declare class SettingsService implements OnModuleInit, OnModuleDestroy {
7
9
  private readonly repo;
8
10
  private readonly logger;
11
+ private readonly configService;
12
+ private readonly redis;
9
13
  /** Raw string values keyed by setting key (populated from DB at boot). */
10
14
  private readonly valueCache;
11
15
  /** Stored parse type per key (integer | boolean | json | string). */
@@ -16,8 +20,12 @@ export declare class SettingsService implements OnModuleInit {
16
20
  * Registered via registerChangeHook() from any OnModuleInit.
17
21
  */
18
22
  private readonly changeHooks;
19
- constructor(repo: Repository<AppSetting>, logger: StructuredLoggerService);
23
+ private localCacheVersion;
24
+ private pollTimer;
25
+ constructor(repo: Repository<AppSetting>, logger: StructuredLoggerService, configService: ConfigService, redis: IORedis);
26
+ private get encryptionKey();
20
27
  onModuleInit(): Promise<void>;
28
+ onModuleDestroy(): void;
21
29
  /**
22
30
  * Returns the setting value typed as T using a three-tier lookup:
23
31
  *
@@ -39,7 +47,7 @@ export declare class SettingsService implements OnModuleInit {
39
47
  * registered change hooks whose prefix matches the key.
40
48
  * Throws if the key does not exist (settings are not created ad hoc).
41
49
  */
42
- set(key: string, value: unknown, updatedById?: string): Promise<void>;
50
+ set(key: string, value: unknown, updatedById?: string, manager?: EntityManager): Promise<void>;
43
51
  /**
44
52
  * Registers a callback that is called synchronously after any setting whose
45
53
  * key starts with `prefix` is updated via set().
@@ -53,10 +61,12 @@ export declare class SettingsService implements OnModuleInit {
53
61
  * Call this after bulk changes (e.g. via a migration or seed).
54
62
  */
55
63
  reload(): Promise<void>;
56
- /** Returns all settings rows (for admin read endpoints). */
64
+ private pollRemoteCacheVersion;
65
+ /** Returns all settings rows (for admin read endpoints). Secrets are redacted. */
57
66
  findAll(): Promise<AppSetting[]>;
58
- /** Returns a single setting row by key, or null if it doesn't exist. */
67
+ /** Returns a single setting row by key, or null if it doesn't exist. Secrets are redacted. */
59
68
  findOne(key: string): Promise<AppSetting | null>;
69
+ private redactSecretRow;
60
70
  private loadAll;
61
71
  private fireHooks;
62
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"settings.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/settings/services/settings.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAEhG,OAAO,EAAE,UAAU,EAAe,MAAM,gCAAgC,CAAC;AAEzE,KAAK,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;AAExD,qBACa,eAAgB,YAAW,YAAY;IAclD,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAdxB,0EAA0E;IAC1E,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IACxD,qEAAqE;IACrE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkC;IAC5D;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmD;gBAI7D,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,EAC5B,MAAM,EAAE,uBAAuB;IAG3C,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAMnC;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC;IA0CxC;;;;;OAKG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE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