@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
@@ -2,17 +2,49 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseSupportedAuthMethods = parseSupportedAuthMethods;
4
4
  exports.assertSupportedAuthMethod = assertSupportedAuthMethod;
5
+ exports.parseOAuthProviders = parseOAuthProviders;
6
+ exports.parseMfaRequiredMethods = parseMfaRequiredMethods;
7
+ exports.isKnownOAuthProvider = isKnownOAuthProvider;
8
+ exports.allSupportedAuthMethods = allSupportedAuthMethods;
5
9
  const common_1 = require("@nestjs/common");
6
- const ALL_METHODS = ['phone', 'email'];
10
+ const user_oauth_identity_entity_1 = require("../entities/user-oauth-identity.entity");
11
+ const ALL_METHODS = ['phone', 'email', 'oauth'];
12
+ const ALL_OAUTH_PROVIDERS = [
13
+ user_oauth_identity_entity_1.OAuthProvider.GOOGLE,
14
+ user_oauth_identity_entity_1.OAuthProvider.APPLE,
15
+ user_oauth_identity_entity_1.OAuthProvider.MICROSOFT,
16
+ ];
7
17
  function parseSupportedAuthMethods(raw) {
8
18
  if (!Array.isArray(raw))
9
- return ALL_METHODS;
10
- const parsed = raw.filter((entry) => entry === 'phone' || entry === 'email');
11
- return parsed.length > 0 ? parsed : ALL_METHODS;
19
+ return ['phone', 'email'];
20
+ const parsed = raw.filter((entry) => entry === 'phone' || entry === 'email' || entry === 'oauth');
21
+ return parsed.length > 0 ? parsed : ['phone', 'email'];
12
22
  }
13
23
  function assertSupportedAuthMethod(method, supported, action) {
14
24
  if (supported.includes(method))
15
25
  return;
16
26
  throw new common_1.ForbiddenException(`${method} ${action} is not enabled on this server. Supported: ${supported.join(', ')}.`);
17
27
  }
28
+ /** Parse OAuth provider allow-list from settings (known providers only). */
29
+ function parseOAuthProviders(raw) {
30
+ if (!Array.isArray(raw))
31
+ return [];
32
+ return raw.filter((entry) => ALL_OAUTH_PROVIDERS.includes(entry));
33
+ }
34
+ /**
35
+ * Parse MFA required-for methods. Unlike {@link parseSupportedAuthMethods}, an empty
36
+ * array means "never require MFA" and is preserved.
37
+ */
38
+ function parseMfaRequiredMethods(raw) {
39
+ if (!Array.isArray(raw))
40
+ return ['phone', 'email', 'oauth'];
41
+ return raw.filter((entry) => entry === 'phone' || entry === 'email' || entry === 'oauth');
42
+ }
43
+ function isKnownOAuthProvider(value) {
44
+ return ALL_OAUTH_PROVIDERS.includes(value);
45
+ }
46
+ /** @internal — for tests / docs */
47
+ function allSupportedAuthMethods() {
48
+ return [...ALL_METHODS];
49
+ }
18
50
  //# sourceMappingURL=auth-supported.util.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-supported.util.js","sourceRoot":"","sources":["../../../../src/modules/auth/utils/auth-supported.util.ts"],"names":[],"mappings":";;AAMA,8DAMC;AAED,8DAUC;AAxBD,2CAAoD;AAIpD,MAAM,WAAW,GAA0B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAE9D,SAAgB,yBAAyB,CAAC,GAAY;IACrD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,WAAW,CAAC;IAC5C,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CACxB,CAAC,KAAK,EAAgC,EAAE,CAAC,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,OAAO,CAC/E,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC;AACjD,CAAC;AAED,SAAgB,yBAAyB,CACxC,MAA2B,EAC3B,SAAgC,EAChC,M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AAC,IAAI,CAAC,GAAG,CACxF,CAAC;AACH,CAAC;AAED,4EAA4E;AAC5E,SAAgB,mBAAmB,CAAC,GAAY;IAC/C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,EAA0B,EAAE,CACnD,mBAAmB,CAAC,QAAQ,CAAC,KAAsB,CAAC,CACpD,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,GAAY;IACnD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5D,OAAO,GAAG,CAAC,MAAM,CAChB,CAAC,KAAK,EAAgC,EAAE,CACvC,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,OAAO,CAC5D,CAAC;AACH,CAAC;AAED,SAAgB,oBAAoB,CAAC,KAAa;IACjD,OAAO,mBAAmB,CAAC,QAAQ,CAAC,KAAsB,CAAC,CAAC;AAC7D,CAAC;AAED,mCAAmC;AACnC,SAAgB,uBAAuB;IACtC,OAAO,CAAC,GAAG,WAAW,CAAC,CAAC;AACzB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /** Stored format for HMAC-hashed MFA backup codes. */
2
+ export declare const BACKUP_CODE_HASH_PREFIX = "hmac-sha256:";
3
+ export declare function hashBackupCode(normalizedCode: string, pepper: string): string;
4
+ export declare function verifyHmacBackupCode(stored: string, normalizedCode: string, pepper: string): boolean;
5
+ /**
6
+ * Verify a stored backup-code hash (HMAC-SHA256 only).
7
+ * Legacy Argon2 hashes are stripped at boot by {@link LegacyHashCleanupService}.
8
+ */
9
+ export declare function verifyBackupCodeHash(stored: string, normalizedCode: string, pepper: string): boolean;
10
+ //# sourceMappingURL=backup-code-hash.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backup-code-hash.util.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/utils/backup-code-hash.util.ts"],"names":[],"mappings":"AAEA,sDAAsD;AACtD,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AAEtD,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAG7E;AAED,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,GACZ,OAAO,CAOT;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,GACZ,OAAO,CAET"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BACKUP_CODE_HASH_PREFIX = void 0;
4
+ exports.hashBackupCode = hashBackupCode;
5
+ exports.verifyHmacBackupCode = verifyHmacBackupCode;
6
+ exports.verifyBackupCodeHash = verifyBackupCodeHash;
7
+ const crypto_1 = require("crypto");
8
+ /** Stored format for HMAC-hashed MFA backup codes. */
9
+ exports.BACKUP_CODE_HASH_PREFIX = 'hmac-sha256:';
10
+ function hashBackupCode(normalizedCode, pepper) {
11
+ const digest = (0, crypto_1.createHmac)('sha256', pepper).update(normalizedCode, 'utf8').digest('hex');
12
+ return `${exports.BACKUP_CODE_HASH_PREFIX}${digest}`;
13
+ }
14
+ function verifyHmacBackupCode(stored, normalizedCode, pepper) {
15
+ if (!stored.startsWith(exports.BACKUP_CODE_HASH_PREFIX))
16
+ return false;
17
+ const expected = hashBackupCode(normalizedCode, pepper);
18
+ const a = Buffer.from(stored);
19
+ const b = Buffer.from(expected);
20
+ if (a.length !== b.length)
21
+ return false;
22
+ return (0, crypto_1.timingSafeEqual)(a, b);
23
+ }
24
+ /**
25
+ * Verify a stored backup-code hash (HMAC-SHA256 only).
26
+ * Legacy Argon2 hashes are stripped at boot by {@link LegacyHashCleanupService}.
27
+ */
28
+ function verifyBackupCodeHash(stored, normalizedCode, pepper) {
29
+ return verifyHmacBackupCode(stored, normalizedCode, pepper);
30
+ }
31
+ //# sourceMappingURL=backup-code-hash.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backup-code-hash.util.js","sourceRoot":"","sources":["../../../../src/modules/auth/utils/backup-code-hash.util.ts"],"names":[],"mappings":";;;AAKA,wCAGC;AAED,oDAWC;AAMD,oDAMC;AAjCD,mCAAqD;AAErD,sDAAsD;AACzC,QAAA,uBAAuB,GAAG,cAAc,CAAC;AAEtD,SAAgB,cAAc,CAAC,cAAsB,EAAE,MAAc;IACpE,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzF,OAAO,GAAG,+BAAuB,GAAG,MAAM,EAAE,CAAC;AAC9C,CAAC;AAED,SAAgB,oBAAoB,CACnC,MAAc,EACd,cAAsB,EACtB,MAAc;IAEd,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,+BAAuB,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,QAAQ,GAAG,cAAc,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IACxD,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACxC,OAAO,IAAA,wBAAe,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CACnC,MAAc,EACd,cAAsB,EACtB,MAAc;IAEd,OAAO,oBAAoB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Generate human-readable backup codes: `xxxx-xxxx-xxxx` (hex groups). */
2
+ export declare function generateBackupCodes(count: number): string[];
3
+ /** Normalize user-entered backup code for comparison (strips separators). */
4
+ export declare function normalizeBackupCode(code: string): string;
5
+ //# sourceMappingURL=backup-codes.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backup-codes.util.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/utils/backup-codes.util.ts"],"names":[],"mappings":"AAEA,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAO3D;AAED,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKxD"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateBackupCodes = generateBackupCodes;
4
+ exports.normalizeBackupCode = normalizeBackupCode;
5
+ const crypto_1 = require("crypto");
6
+ /** Generate human-readable backup codes: `xxxx-xxxx-xxxx` (hex groups). */
7
+ function generateBackupCodes(count) {
8
+ const codes = [];
9
+ for (let i = 0; i < count; i++) {
10
+ const raw = (0, crypto_1.randomBytes)(6).toString('hex'); // 12 hex chars
11
+ codes.push(`${raw.slice(0, 4)}-${raw.slice(4, 8)}-${raw.slice(8, 12)}`);
12
+ }
13
+ return codes;
14
+ }
15
+ /** Normalize user-entered backup code for comparison (strips separators). */
16
+ function normalizeBackupCode(code) {
17
+ return code
18
+ .trim()
19
+ .toLowerCase()
20
+ .replace(/[\s_-]/g, '');
21
+ }
22
+ //# sourceMappingURL=backup-codes.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backup-codes.util.js","sourceRoot":"","sources":["../../../../src/modules/auth/utils/backup-codes.util.ts"],"names":[],"mappings":";;AAGA,kDAOC;AAGD,kDAKC;AAlBD,mCAAqC;AAErC,2EAA2E;AAC3E,SAAgB,mBAAmB,CAAC,KAAa;IAChD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,IAAA,oBAAW,EAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe;QAC3D,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,6EAA6E;AAC7E,SAAgB,mBAAmB,CAAC,IAAY;IAC/C,OAAO,IAAI;SACT,IAAI,EAAE;SACN,WAAW,EAAE;SACb,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { type JWK, type JWTPayload } from 'jose';
2
+ export type DpopMode = 'off' | 'optional' | 'required';
3
+ export declare function parseDpopMode(raw: unknown): DpopMode;
4
+ /** RFC 7638 JWK thumbprint (SHA-256) → base64url. */
5
+ export declare function computeJwkThumbprint(jwk: JWK): Promise<string>;
6
+ export declare function accessTokenHash(accessToken: string): string;
7
+ export interface VerifiedDpopProof {
8
+ jkt: string;
9
+ jti: string;
10
+ payload: JWTPayload;
11
+ }
12
+ /**
13
+ * Verify a DPoP proof JWT (RFC 9449 subset: ES256/RS256, htm/htu/iat/jti, optional ath).
14
+ */
15
+ export declare function verifyDpopProof(args: {
16
+ proof: string;
17
+ method: string;
18
+ uri: string;
19
+ accessToken?: string;
20
+ maxAgeSeconds?: number;
21
+ }): Promise<VerifiedDpopProof>;
22
+ //# sourceMappingURL=dpop.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dpop.util.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/utils/dpop.util.ts"],"names":[],"mappings":"AACA,OAAO,EAAoD,KAAK,GAAG,EAAE,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAEnG,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,CAAC;AAEvD,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,QAAQ,CAGpD;AAED,qDAAqD;AACrD,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpE;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,MAAM,WAAW,iBAAiB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,UAAU,CAAC;CACpB;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAoC7B"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseDpopMode = parseDpopMode;
4
+ exports.computeJwkThumbprint = computeJwkThumbprint;
5
+ exports.accessTokenHash = accessTokenHash;
6
+ exports.verifyDpopProof = verifyDpopProof;
7
+ const crypto_1 = require("crypto");
8
+ const jose_1 = require("jose");
9
+ function parseDpopMode(raw) {
10
+ if (raw === 'required' || raw === 'optional' || raw === 'off')
11
+ return raw;
12
+ return 'optional';
13
+ }
14
+ /** RFC 7638 JWK thumbprint (SHA-256) → base64url. */
15
+ async function computeJwkThumbprint(jwk) {
16
+ return (0, jose_1.calculateJwkThumbprint)(jwk, 'sha256');
17
+ }
18
+ function accessTokenHash(accessToken) {
19
+ return (0, crypto_1.createHash)('sha256').update(accessToken, 'utf8').digest('base64url');
20
+ }
21
+ /**
22
+ * Verify a DPoP proof JWT (RFC 9449 subset: ES256/RS256, htm/htu/iat/jti, optional ath).
23
+ */
24
+ async function verifyDpopProof(args) {
25
+ const { proof, method, uri, accessToken, maxAgeSeconds = 60 } = args;
26
+ const headerB64 = proof.split('.')[0];
27
+ if (!headerB64)
28
+ throw new Error('Invalid DPoP proof');
29
+ const header = JSON.parse(Buffer.from(headerB64, 'base64url').toString('utf8'));
30
+ if (header.typ !== 'dpop+jwt')
31
+ throw new Error('DPoP typ must be dpop+jwt');
32
+ if (!header.jwk || typeof header.jwk !== 'object')
33
+ throw new Error('DPoP header missing jwk');
34
+ if (header.jwk.d)
35
+ throw new Error('DPoP jwk must be a public key');
36
+ const key = await (0, jose_1.importJWK)(header.jwk, header.alg);
37
+ const { payload } = await (0, jose_1.compactVerify)(proof, key);
38
+ const claims = JSON.parse(new TextDecoder().decode(payload));
39
+ if (typeof claims.htm !== 'string' || claims.htm.toUpperCase() !== method.toUpperCase()) {
40
+ throw new Error('DPoP htm mismatch');
41
+ }
42
+ if (typeof claims.htu !== 'string' || !htuMatches(claims.htu, uri)) {
43
+ throw new Error('DPoP htu mismatch');
44
+ }
45
+ if (typeof claims.iat !== 'number')
46
+ throw new Error('DPoP iat required');
47
+ const age = Math.abs(Math.floor(Date.now() / 1000) - claims.iat);
48
+ if (age > maxAgeSeconds)
49
+ throw new Error('DPoP proof expired');
50
+ if (typeof claims.jti !== 'string' || !claims.jti)
51
+ throw new Error('DPoP jti required');
52
+ if (accessToken) {
53
+ const expectedAth = accessTokenHash(accessToken);
54
+ if (claims.ath !== expectedAth)
55
+ throw new Error('DPoP ath mismatch');
56
+ }
57
+ const jkt = await computeJwkThumbprint(header.jwk);
58
+ return { jkt, jti: claims.jti, payload: claims };
59
+ }
60
+ /** Compare htu ignoring trailing slash and query/hash differences on the request side. */
61
+ function htuMatches(claimHtu, requestUri) {
62
+ try {
63
+ const a = new URL(claimHtu);
64
+ const b = new URL(requestUri);
65
+ const pathA = a.pathname.replace(/\/$/, '') || '/';
66
+ const pathB = b.pathname.replace(/\/$/, '') || '/';
67
+ return a.origin === b.origin && pathA === pathB;
68
+ }
69
+ catch {
70
+ return claimHtu === requestUri;
71
+ }
72
+ }
73
+ //# sourceMappingURL=dpop.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dpop.util.js","sourceRoot":"","sources":["../../../../src/modules/auth/utils/dpop.util.ts"],"names":[],"mappings":";;AAKA,sCAGC;AAGD,oDAEC;AAED,0CAEC;AAWD,0CA0CC;AAtED,mCAAoC;AACpC,+BAAmG;AAInG,SAAgB,aAAa,CAAC,GAAY;IACzC,IAAI,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,KAAK;QAAE,OAAO,GAAG,CAAC;IAC1E,OAAO,UAAU,CAAC;AACnB,CAAC;AAED,qDAAqD;AAC9C,KAAK,UAAU,oBAAoB,CAAC,GAAQ;IAClD,OAAO,IAAA,6BAAsB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAED,SAAgB,eAAe,CAAC,WAAmB;IAClD,OAAO,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAC7E,CAAC;AAQD;;GAEG;AACI,KAAK,UAAU,eAAe,CAAC,IAMrC;IACA,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;IAErE,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,GAA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CAAC,IAAI,GAAG,CAAC;QACnD,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,KAAK,KAAK,KAAK,CAAC;IACjD,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,QAAQ,KAAK,UAAU,CAAC;IAChC,CAAC;AACF,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { decrypt, encrypt, tryDecrypt } from '../../../config/encryption.util';
2
+ /** Prefixed ciphertext for versioned MFA TOTP secrets. */
3
+ export declare const MFA_SECRET_PREFIX = "enc:v1:";
4
+ /**
5
+ * Seal a TOTP secret for Redis/DB storage.
6
+ * Format: `enc:v1:<iv>:<tag>:<ciphertext>` (AES-256-GCM via ENCRYPTION_KEY / MFA_ENCRYPTION_KEY).
7
+ */
8
+ export declare function sealMfaSecret(plaintext: string, encryptionKey: string): string;
9
+ /**
10
+ * Open a stored MFA secret. Supports:
11
+ * - `enc:v1:...` (current format)
12
+ * - legacy unprefixed `iv:tag:ct` (pre-versioning)
13
+ *
14
+ * Tries `currentKey`, then optional `previousKey` for zero-downtime rotation.
15
+ */
16
+ export declare function openMfaSecret(stored: string, currentKey: string, previousKey?: string): string | null;
17
+ /** Strict decrypt (throws) for cases that must fail closed. */
18
+ export declare function decryptMfaSecret(stored: string, currentKey: string, previousKey?: string): string;
19
+ /** Re-encrypt legacy/unprefixed ciphertext to `enc:v1:` under the current key. */
20
+ export declare function resealMfaSecretIfNeeded(stored: string, currentKey: string, previousKey?: string): string | null;
21
+ export { decrypt, encrypt, tryDecrypt };
22
+ //# sourceMappingURL=mfa-secret.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa-secret.util.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/utils/mfa-secret.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE/E,0DAA0D;AAC1D,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C;;;GAGG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAE9E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC5B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,WAAW,CAAC,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAYf;AAED,+DAA+D;AAC/D,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAMjG;AAED,kFAAkF;AAClF,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,WAAW,CAAC,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAUf;AAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tryDecrypt = exports.encrypt = exports.decrypt = exports.MFA_SECRET_PREFIX = void 0;
4
+ exports.sealMfaSecret = sealMfaSecret;
5
+ exports.openMfaSecret = openMfaSecret;
6
+ exports.decryptMfaSecret = decryptMfaSecret;
7
+ exports.resealMfaSecretIfNeeded = resealMfaSecretIfNeeded;
8
+ const encryption_util_1 = require("../../../config/encryption.util");
9
+ Object.defineProperty(exports, "decrypt", { enumerable: true, get: function () { return encryption_util_1.decrypt; } });
10
+ Object.defineProperty(exports, "encrypt", { enumerable: true, get: function () { return encryption_util_1.encrypt; } });
11
+ Object.defineProperty(exports, "tryDecrypt", { enumerable: true, get: function () { return encryption_util_1.tryDecrypt; } });
12
+ /** Prefixed ciphertext for versioned MFA TOTP secrets. */
13
+ exports.MFA_SECRET_PREFIX = 'enc:v1:';
14
+ /**
15
+ * Seal a TOTP secret for Redis/DB storage.
16
+ * Format: `enc:v1:<iv>:<tag>:<ciphertext>` (AES-256-GCM via ENCRYPTION_KEY / MFA_ENCRYPTION_KEY).
17
+ */
18
+ function sealMfaSecret(plaintext, encryptionKey) {
19
+ return `${exports.MFA_SECRET_PREFIX}${(0, encryption_util_1.encrypt)(plaintext, encryptionKey)}`;
20
+ }
21
+ /**
22
+ * Open a stored MFA secret. Supports:
23
+ * - `enc:v1:...` (current format)
24
+ * - legacy unprefixed `iv:tag:ct` (pre-versioning)
25
+ *
26
+ * Tries `currentKey`, then optional `previousKey` for zero-downtime rotation.
27
+ */
28
+ function openMfaSecret(stored, currentKey, previousKey) {
29
+ const payload = stored.startsWith(exports.MFA_SECRET_PREFIX)
30
+ ? stored.slice(exports.MFA_SECRET_PREFIX.length)
31
+ : stored;
32
+ const fromCurrent = (0, encryption_util_1.tryDecrypt)(payload, currentKey);
33
+ if (fromCurrent != null)
34
+ return fromCurrent;
35
+ if (previousKey) {
36
+ return (0, encryption_util_1.tryDecrypt)(payload, previousKey);
37
+ }
38
+ return null;
39
+ }
40
+ /** Strict decrypt (throws) for cases that must fail closed. */
41
+ function decryptMfaSecret(stored, currentKey, previousKey) {
42
+ const opened = openMfaSecret(stored, currentKey, previousKey);
43
+ if (opened == null) {
44
+ throw new Error('Unable to decrypt MFA secret with configured keys');
45
+ }
46
+ return opened;
47
+ }
48
+ /** Re-encrypt legacy/unprefixed ciphertext to `enc:v1:` under the current key. */
49
+ function resealMfaSecretIfNeeded(stored, currentKey, previousKey) {
50
+ const plaintext = openMfaSecret(stored, currentKey, previousKey);
51
+ if (plaintext == null)
52
+ return null;
53
+ if (stored.startsWith(exports.MFA_SECRET_PREFIX) &&
54
+ (0, encryption_util_1.tryDecrypt)(stored.slice(exports.MFA_SECRET_PREFIX.length), currentKey) != null) {
55
+ return stored; // already current version + current key
56
+ }
57
+ return sealMfaSecret(plaintext, currentKey);
58
+ }
59
+ //# sourceMappingURL=mfa-secret.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa-secret.util.js","sourceRoot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AAkF;AAClF,SAAgB,uBAAuB,CACtC,MAAc,EACd,UAAkB,EAClB,WAAoB;IAEpB,MAAM,SAAS,GAAG,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;IACjE,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IACnC,IACC,MAAM,CAAC,UAAU,CAAC,yBAAiB,CAAC;QACpC,IAAA,4BAAU,EAAC,MAAM,CAAC,KAAK,CAAC,yBAAiB,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,IAAI,IAAI,EACrE,CAAC;QACF,OAAO,MAAM,CAAC,CAAC,wCAAwC;IACxD,CAAC;IACD,OAAO,aAAa,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,26 @@
1
+ /** MFA verify body: TOTP vs backup code (exclusive). */
2
+ export interface MfaVerifyParams {
3
+ mfaToken?: string;
4
+ totp?: string;
5
+ backupCode?: string;
6
+ }
7
+ export type MfaVerifyMode = 'totp' | 'backup_code' | 'ambiguous' | 'missing';
8
+ export declare function resolveMfaVerifyMode(dto: MfaVerifyParams): MfaVerifyMode;
9
+ export declare const MFA_VERIFY_PARAMS_ERROR = "Provide { mfaToken, totp } or { mfaToken, backupCode } \u2014 not both and not neither.";
10
+ /** Step-up body: TOTP vs backup code (exclusive). */
11
+ export interface MfaStepUpParams {
12
+ totp?: string;
13
+ backupCode?: string;
14
+ }
15
+ export type MfaStepUpMode = 'totp' | 'backup_code' | 'ambiguous' | 'missing';
16
+ export declare function resolveMfaStepUpMode(dto: MfaStepUpParams): MfaStepUpMode;
17
+ export declare const MFA_STEP_UP_PARAMS_ERROR = "Provide either { totp } or { backupCode } \u2014 not both and not neither.";
18
+ /** Disable / regenerate confirmation: TOTP `code` vs backup code (exclusive). */
19
+ export interface MfaDisableParams {
20
+ code?: string;
21
+ backupCode?: string;
22
+ }
23
+ export type MfaDisableMode = 'totp' | 'backup_code' | 'ambiguous' | 'missing';
24
+ export declare function resolveMfaDisableMode(dto: MfaDisableParams): MfaDisableMode;
25
+ export declare const MFA_DISABLE_PARAMS_ERROR = "Provide either { code } (TOTP) or { backupCode } \u2014 not both and not neither.";
26
+ //# sourceMappingURL=mfa-verify-params.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa-verify-params.util.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/utils/mfa-verify-params.util.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,CAAC;AAE7E,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,eAAe,GAAG,aAAa,CAaxE;AAED,eAAO,MAAM,uBAAuB,4FACiD,CAAC;AAEtF,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,CAAC;AAE7E,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,eAAe,GAAG,aAAa,CASxE;AAED,eAAO,MAAM,wBAAwB,+EACmC,CAAC;AAEzE,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,CAAC;AAE9E,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,GAAG,cAAc,CAS3E;AAED,eAAO,MAAM,wBAAwB,sFAC0C,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MFA_DISABLE_PARAMS_ERROR = exports.MFA_STEP_UP_PARAMS_ERROR = exports.MFA_VERIFY_PARAMS_ERROR = void 0;
4
+ exports.resolveMfaVerifyMode = resolveMfaVerifyMode;
5
+ exports.resolveMfaStepUpMode = resolveMfaStepUpMode;
6
+ exports.resolveMfaDisableMode = resolveMfaDisableMode;
7
+ function resolveMfaVerifyMode(dto) {
8
+ const hasToken = typeof dto.mfaToken === 'string' && dto.mfaToken.trim().length > 0;
9
+ if (!hasToken)
10
+ return 'missing';
11
+ const totp = typeof dto.totp === 'string' && /^\d{6}$/.test(dto.totp.trim());
12
+ const backup = typeof dto.backupCode === 'string' &&
13
+ dto.backupCode.trim().replace(/[\s_-]/g, '').length >= 8;
14
+ if (totp && backup)
15
+ return 'ambiguous';
16
+ if (totp)
17
+ return 'totp';
18
+ if (backup)
19
+ return 'backup_code';
20
+ return 'missing';
21
+ }
22
+ exports.MFA_VERIFY_PARAMS_ERROR = 'Provide { mfaToken, totp } or { mfaToken, backupCode } — not both and not neither.';
23
+ function resolveMfaStepUpMode(dto) {
24
+ const totp = typeof dto.totp === 'string' && /^\d{6}$/.test(dto.totp.trim());
25
+ const backup = typeof dto.backupCode === 'string' &&
26
+ dto.backupCode.trim().replace(/[\s_-]/g, '').length >= 8;
27
+ if (totp && backup)
28
+ return 'ambiguous';
29
+ if (totp)
30
+ return 'totp';
31
+ if (backup)
32
+ return 'backup_code';
33
+ return 'missing';
34
+ }
35
+ exports.MFA_STEP_UP_PARAMS_ERROR = 'Provide either { totp } or { backupCode } — not both and not neither.';
36
+ function resolveMfaDisableMode(dto) {
37
+ const totp = typeof dto.code === 'string' && /^\d{6}$/.test(dto.code.trim());
38
+ const backup = typeof dto.backupCode === 'string' &&
39
+ dto.backupCode.trim().replace(/[\s_-]/g, '').length >= 8;
40
+ if (totp && backup)
41
+ return 'ambiguous';
42
+ if (totp)
43
+ return 'totp';
44
+ if (backup)
45
+ return 'backup_code';
46
+ return 'missing';
47
+ }
48
+ exports.MFA_DISABLE_PARAMS_ERROR = 'Provide either { code } (TOTP) or { backupCode } — not both and not neither.';
49
+ //# sourceMappingURL=mfa-verify-params.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa-verify-params.util.js","sourceRoot":"","sources":["../../../../src/modules/auth/utils/mfa-verify-params.util.ts"],"names":[],"mappings":";;;AASA,oDAaC;AAaD,oDASC;AAaD,sDASC;AAzDD,SAAgB,oBAAoB,CAAC,GAAoB;IACxD,MAAM,QAAQ,GAAG,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IACpF,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAC;IAEhC,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7E,MAAM,MAAM,GACX,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ;QAClC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC;IAE1D,IAAI,IAAI,IAAI,MAAM;QAAE,OAAO,WAAW,CAAC;IACvC,IAAI,IAAI;QAAE,OAAO,MAAM,CAAC;IACxB,IAAI,MAAM;QAAE,OAAO,aAAa,CAAC;IACjC,OAAO,SAAS,CAAC;AAClB,CAAC;AAEY,QAAA,uBAAuB,GACnC,oFAAoF,CAAC;AAUtF,SAAgB,oBAAoB,CAAC,GAAoB;IACxD,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7E,MAAM,MAAM,GACX,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ;QAClC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC;IAC1D,IAAI,IAAI,IAAI,MAAM;QAAE,OAAO,WAAW,CAAC;IACvC,IAAI,IAAI;QAAE,OAAO,MAAM,CAAC;IACxB,IAAI,MAAM;QAAE,OAAO,aAAa,CAAC;IACjC,OAAO,SAAS,CAAC;AAClB,CAAC;AAEY,QAAA,wBAAwB,GACpC,uEAAuE,CAAC;AAUzE,SAAgB,qBAAqB,CAAC,GAAqB;IAC1D,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7E,MAAM,MAAM,GACX,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ;QAClC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC;IAC1D,IAAI,IAAI,IAAI,MAAM;QAAE,OAAO,WAAW,CAAC;IACvC,IAAI,IAAI;QAAE,OAAO,MAAM,CAAC;IACxB,IAAI,MAAM;QAAE,OAAO,aAAa,CAAC;IACjC,OAAO,SAAS,CAAC;AAClB,CAAC;AAEY,QAAA,wBAAwB,GACpC,8EAA8E,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Action scope for MFA step-up tokens (mint + consume must match). */
2
+ export declare const STEP_UP_PURPOSES: readonly ["change_email", "change_phone", "change_password", "set_password", "oauth_link", "oauth_unlink", "account_delete"];
3
+ export type StepUpPurpose = (typeof STEP_UP_PURPOSES)[number];
4
+ export declare function isStepUpPurpose(value: unknown): value is StepUpPurpose;
5
+ //# sourceMappingURL=step-up-purpose.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-up-purpose.util.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/utils/step-up-purpose.util.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,eAAO,MAAM,gBAAgB,8HAQnB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STEP_UP_PURPOSES = void 0;
4
+ exports.isStepUpPurpose = isStepUpPurpose;
5
+ /** Action scope for MFA step-up tokens (mint + consume must match). */
6
+ exports.STEP_UP_PURPOSES = [
7
+ 'change_email',
8
+ 'change_phone',
9
+ 'change_password',
10
+ 'set_password',
11
+ 'oauth_link',
12
+ 'oauth_unlink',
13
+ 'account_delete',
14
+ ];
15
+ function isStepUpPurpose(value) {
16
+ return typeof value === 'string' && exports.STEP_UP_PURPOSES.includes(value);
17
+ }
18
+ //# sourceMappingURL=step-up-purpose.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-up-purpose.util.js","sourceRoot":"","sources":["../../../../src/modules/auth/utils/step-up-purpose.util.ts"],"names":[],"mappings":";;;AAaA,0CAEC;AAfD,uEAAuE;AAC1D,QAAA,gBAAgB,GAAG;IAC/B,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,cAAc;IACd,YAAY;IACZ,cAAc;IACd,gBAAgB;CACP,CAAC;AAIX,SAAgB,eAAe,CAAC,KAAc;IAC7C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,wBAAsC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC7F,CAAC"}
@@ -0,0 +1,16 @@
1
+ /** Generate a 20-byte random secret encoded as base32 (Authenticator-compatible). */
2
+ export declare function generateTotpSecret(bytes?: number): string;
3
+ /** Build an `otpauth://` URI for QR provisioning. */
4
+ export declare function buildOtpAuthUri(args: {
5
+ secret: string;
6
+ accountName: string;
7
+ issuer: string;
8
+ }): string;
9
+ /**
10
+ * Verify a 6-digit TOTP code against a base32 secret.
11
+ * Allows ±`window` time steps (default 1 → 30s skew tolerance).
12
+ */
13
+ export declare function verifyTotp(secretBase32: string, token: string, window?: number): boolean;
14
+ /** Current time-step index (for replay-protection keys). */
15
+ export declare function currentTotpTimestep(): number;
16
+ //# sourceMappingURL=totp.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"totp.util.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/utils/totp.util.ts"],"names":[],"mappings":"AAIA,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,KAAK,SAAK,GAAG,MAAM,CAErD;AAED,qDAAqD;AACrD,wBAAgB,eAAe,CAAC,IAAI,EAAE;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAIT;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,SAAI,GAAG,OAAO,CAWnF;AAED,4DAA4D;AAC5D,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateTotpSecret = generateTotpSecret;
4
+ exports.buildOtpAuthUri = buildOtpAuthUri;
5
+ exports.verifyTotp = verifyTotp;
6
+ exports.currentTotpTimestep = currentTotpTimestep;
7
+ const crypto_1 = require("crypto");
8
+ const BASE32_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
9
+ /** Generate a 20-byte random secret encoded as base32 (Authenticator-compatible). */
10
+ function generateTotpSecret(bytes = 20) {
11
+ return base32Encode((0, crypto_1.randomBytes)(bytes));
12
+ }
13
+ /** Build an `otpauth://` URI for QR provisioning. */
14
+ function buildOtpAuthUri(args) {
15
+ const label = encodeURIComponent(`${args.issuer}:${args.accountName}`);
16
+ const issuer = encodeURIComponent(args.issuer);
17
+ return `otpauth://totp/${label}?secret=${args.secret}&issuer=${issuer}&algorithm=SHA1&digits=6&period=30`;
18
+ }
19
+ /**
20
+ * Verify a 6-digit TOTP code against a base32 secret.
21
+ * Allows ±`window` time steps (default 1 → 30s skew tolerance).
22
+ */
23
+ function verifyTotp(secretBase32, token, window = 1) {
24
+ const normalized = token.replace(/\s/g, '');
25
+ if (!/^\d{6}$/.test(normalized))
26
+ return false;
27
+ const secret = base32Decode(secretBase32);
28
+ const timestep = Math.floor(Date.now() / 1000 / 30);
29
+ for (let i = -window; i <= window; i++) {
30
+ if (hotp(secret, timestep + i) === normalized)
31
+ return true;
32
+ }
33
+ return false;
34
+ }
35
+ /** Current time-step index (for replay-protection keys). */
36
+ function currentTotpTimestep() {
37
+ return Math.floor(Date.now() / 1000 / 30);
38
+ }
39
+ function hotp(secret, counter) {
40
+ const buf = Buffer.alloc(8);
41
+ buf.writeBigUInt64BE(BigInt(counter));
42
+ const hmac = (0, crypto_1.createHmac)('sha1', secret).update(buf).digest();
43
+ const offset = hmac[hmac.length - 1] & 0x0f;
44
+ const code = ((hmac[offset] & 0x7f) << 24) |
45
+ ((hmac[offset + 1] & 0xff) << 16) |
46
+ ((hmac[offset + 2] & 0xff) << 8) |
47
+ (hmac[offset + 3] & 0xff);
48
+ return String(code % 1_000_000).padStart(6, '0');
49
+ }
50
+ function base32Encode(data) {
51
+ let bits = 0;
52
+ let value = 0;
53
+ let output = '';
54
+ for (const byte of data) {
55
+ value = (value << 8) | byte;
56
+ bits += 8;
57
+ while (bits >= 5) {
58
+ output += BASE32_ALPHABET[(value >>> (bits - 5)) & 31];
59
+ bits -= 5;
60
+ }
61
+ }
62
+ if (bits > 0) {
63
+ output += BASE32_ALPHABET[(value << (5 - bits)) & 31];
64
+ }
65
+ return output;
66
+ }
67
+ function base32Decode(input) {
68
+ const cleaned = input
69
+ .replace(/=+$/, '')
70
+ .toUpperCase()
71
+ .replace(/[^A-Z2-7]/g, '');
72
+ let bits = 0;
73
+ let value = 0;
74
+ const bytes = [];
75
+ for (const char of cleaned) {
76
+ const idx = BASE32_ALPHABET.indexOf(char);
77
+ if (idx === -1)
78
+ throw new Error('Invalid base32 secret');
79
+ value = (value << 5) | idx;
80
+ bits += 5;
81
+ if (bits >= 8) {
82
+ bytes.push((value >>> (bits - 8)) & 0xff);
83
+ bits -= 8;
84
+ }
85
+ }
86
+ return Buffer.from(bytes);
87
+ }
88
+ //# sourceMappingURL=totp.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"totp.util.js","sourceRoot":"","sources":["../../../../src/modules/auth/utils/totp.util.ts"],"names":[],"mappings":";;AAKA,gDAEC;AAGD,0CAQC;AAMD,gCAWC;AAGD,kDAEC;AAxCD,mCAAiD;AAEjD,MAAM,eAAe,GAAG,kCAAkC,CAAC;AAE3D,qFAAqF;AACrF,SAAgB,kBAAkB,CAAC,KAAK,GAAG,EAAE;IAC5C,OAAO,YAAY,CAAC,IAAA,oBAAW,EAAC,KAAK,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,qDAAqD;AACrD,SAAgB,eAAe,CAAC,IAI/B;IACA,MAAM,KAAK,GAAG,kBAAkB,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACvE,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/C,OAAO,kBAAkB,KAAK,WAAW,IAAI,CAAC,MAAM,WAAW,MAAM,oCAAoC,CAAC;AAC3G,CAAC;AAED;;;GAGG;AACH,SAAgB,UAAU,CAAC,YAAoB,EAAE,KAAa,EAAE,MAAM,GAAG,CAAC;IACzE,MAAM,UAAU,GAA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