@colveor/core 1.0.1 → 1.2.0

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 (837) hide show
  1. package/CHANGELOG.md +23 -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/1785006199371-auth-mfa-oauth.d.ts +7 -0
  75. package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts.map +1 -0
  76. package/dist/database/migrations/1785006199371-auth-mfa-oauth.js +24 -0
  77. package/dist/database/migrations/1785006199371-auth-mfa-oauth.js.map +1 -0
  78. package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts +7 -0
  79. package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts.map +1 -0
  80. package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js +16 -0
  81. package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js.map +1 -0
  82. package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts +7 -0
  83. package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts.map +1 -0
  84. package/dist/database/migrations/1785006199373-auth-gap-fixes.js +14 -0
  85. package/dist/database/migrations/1785006199373-auth-gap-fixes.js.map +1 -0
  86. package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts +13 -0
  87. package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts.map +1 -0
  88. package/dist/database/migrations/1785006199374-auth-sessions-indexes.js +35 -0
  89. package/dist/database/migrations/1785006199374-auth-sessions-indexes.js.map +1 -0
  90. package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts +11 -0
  91. package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts.map +1 -0
  92. package/dist/database/migrations/1785006199375-auth-identity-and-audit.js +60 -0
  93. package/dist/database/migrations/1785006199375-auth-identity-and-audit.js.map +1 -0
  94. package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts +14 -0
  95. package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts.map +1 -0
  96. package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js +39 -0
  97. package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js.map +1 -0
  98. package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts +13 -0
  99. package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts.map +1 -0
  100. package/dist/database/migrations/1785006199377-auth-security-hardening.js +69 -0
  101. package/dist/database/migrations/1785006199377-auth-security-hardening.js.map +1 -0
  102. package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts +11 -0
  103. package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts.map +1 -0
  104. package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js +51 -0
  105. package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js.map +1 -0
  106. package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts +12 -0
  107. package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts.map +1 -0
  108. package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js +37 -0
  109. package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js.map +1 -0
  110. package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts +12 -0
  111. package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts.map +1 -0
  112. package/dist/database/migrations/1785006199380-auth-remaining-gaps.js +74 -0
  113. package/dist/database/migrations/1785006199380-auth-remaining-gaps.js.map +1 -0
  114. package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts +12 -0
  115. package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts.map +1 -0
  116. package/dist/database/migrations/1785006199381-settings-blast-radius.js +52 -0
  117. package/dist/database/migrations/1785006199381-settings-blast-radius.js.map +1 -0
  118. package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts +11 -0
  119. package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts.map +1 -0
  120. package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js +36 -0
  121. package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js.map +1 -0
  122. package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts +12 -0
  123. package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts.map +1 -0
  124. package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js +39 -0
  125. package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js.map +1 -0
  126. package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts +12 -0
  127. package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts.map +1 -0
  128. package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js +39 -0
  129. package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js.map +1 -0
  130. package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts +13 -0
  131. package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts.map +1 -0
  132. package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js +72 -0
  133. package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js.map +1 -0
  134. package/dist/database/migrations/1785006199386-audit-events.d.ts +10 -0
  135. package/dist/database/migrations/1785006199386-audit-events.d.ts.map +1 -0
  136. package/dist/database/migrations/1785006199386-audit-events.js +60 -0
  137. package/dist/database/migrations/1785006199386-audit-events.js.map +1 -0
  138. package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts +10 -0
  139. package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts.map +1 -0
  140. package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js +25 -0
  141. package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js.map +1 -0
  142. package/dist/database/migrations/1785006199388-audit-enterprise.d.ts +11 -0
  143. package/dist/database/migrations/1785006199388-audit-enterprise.d.ts.map +1 -0
  144. package/dist/database/migrations/1785006199388-audit-enterprise.js +157 -0
  145. package/dist/database/migrations/1785006199388-audit-enterprise.js.map +1 -0
  146. package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts +10 -0
  147. package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts.map +1 -0
  148. package/dist/database/migrations/1785006199389-drop-admin-logs.js +38 -0
  149. package/dist/database/migrations/1785006199389-drop-admin-logs.js.map +1 -0
  150. package/dist/database/migrations/1785006199390-audit-hardening.d.ts +14 -0
  151. package/dist/database/migrations/1785006199390-audit-hardening.d.ts.map +1 -0
  152. package/dist/database/migrations/1785006199390-audit-hardening.js +345 -0
  153. package/dist/database/migrations/1785006199390-audit-hardening.js.map +1 -0
  154. package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts +10 -0
  155. package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts.map +1 -0
  156. package/dist/database/migrations/1785006199391-audit-owner-schema-create.js +39 -0
  157. package/dist/database/migrations/1785006199391-audit-owner-schema-create.js.map +1 -0
  158. package/dist/database/migrations/1785006199392-profile-photo-url.d.ts +11 -0
  159. package/dist/database/migrations/1785006199392-profile-photo-url.d.ts.map +1 -0
  160. package/dist/database/migrations/1785006199392-profile-photo-url.js +33 -0
  161. package/dist/database/migrations/1785006199392-profile-photo-url.js.map +1 -0
  162. package/dist/database/migrations/1785006199393-profile-cover-url.d.ts +11 -0
  163. package/dist/database/migrations/1785006199393-profile-cover-url.d.ts.map +1 -0
  164. package/dist/database/migrations/1785006199393-profile-cover-url.js +33 -0
  165. package/dist/database/migrations/1785006199393-profile-cover-url.js.map +1 -0
  166. package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts +11 -0
  167. package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts.map +1 -0
  168. package/dist/database/migrations/1785006199394-profile-is-public-default-false.js +24 -0
  169. package/dist/database/migrations/1785006199394-profile-is-public-default-false.js.map +1 -0
  170. package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts +10 -0
  171. package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts.map +1 -0
  172. package/dist/database/migrations/1785006199395-delivery-scale-indexes.js +35 -0
  173. package/dist/database/migrations/1785006199395-delivery-scale-indexes.js.map +1 -0
  174. package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts +11 -0
  175. package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts.map +1 -0
  176. package/dist/database/migrations/1785006199396-delivery-recipient-index.js +23 -0
  177. package/dist/database/migrations/1785006199396-delivery-recipient-index.js.map +1 -0
  178. package/dist/database/seeds/roles.seed.d.ts +6 -0
  179. package/dist/database/seeds/roles.seed.d.ts.map +1 -1
  180. package/dist/database/seeds/roles.seed.js +22 -5
  181. package/dist/database/seeds/roles.seed.js.map +1 -1
  182. package/dist/database/seeds/settings.seed.d.ts +5 -0
  183. package/dist/database/seeds/settings.seed.d.ts.map +1 -1
  184. package/dist/database/seeds/settings.seed.js +500 -25
  185. package/dist/database/seeds/settings.seed.js.map +1 -1
  186. package/dist/database/seeds/templates/html-template.reader.d.ts +1 -0
  187. package/dist/database/seeds/templates/html-template.reader.d.ts.map +1 -1
  188. package/dist/database/seeds/templates/html-template.reader.js +3 -1
  189. package/dist/database/seeds/templates/html-template.reader.js.map +1 -1
  190. package/dist/database/seeds/templates/html-template.reader.ts +5 -1
  191. package/dist/database/typeorm.util.d.ts.map +1 -1
  192. package/dist/database/typeorm.util.js +6 -0
  193. package/dist/database/typeorm.util.js.map +1 -1
  194. package/dist/index.d.ts +8 -1
  195. package/dist/index.d.ts.map +1 -1
  196. package/dist/index.js +39 -4
  197. package/dist/index.js.map +1 -1
  198. package/dist/modules/admin/controllers/admin.controller.d.ts +15 -7
  199. package/dist/modules/admin/controllers/admin.controller.d.ts.map +1 -1
  200. package/dist/modules/admin/controllers/admin.controller.js +74 -17
  201. package/dist/modules/admin/controllers/admin.controller.js.map +1 -1
  202. package/dist/modules/admin/services/admin-log.service.d.ts +14 -7
  203. package/dist/modules/admin/services/admin-log.service.d.ts.map +1 -1
  204. package/dist/modules/admin/services/admin-log.service.js +41 -38
  205. package/dist/modules/admin/services/admin-log.service.js.map +1 -1
  206. package/dist/modules/audit/audit.manifest.d.ts +8 -0
  207. package/dist/modules/audit/audit.manifest.d.ts.map +1 -0
  208. package/dist/modules/audit/audit.manifest.js +31 -0
  209. package/dist/modules/audit/audit.manifest.js.map +1 -0
  210. package/dist/modules/audit/audit.module.d.ts +8 -0
  211. package/dist/modules/audit/audit.module.d.ts.map +1 -0
  212. package/dist/modules/audit/audit.module.js +57 -0
  213. package/dist/modules/audit/audit.module.js.map +1 -0
  214. package/dist/modules/audit/constants/audit-actions.d.ts +79 -0
  215. package/dist/modules/audit/constants/audit-actions.d.ts.map +1 -0
  216. package/dist/modules/audit/constants/audit-actions.js +89 -0
  217. package/dist/modules/audit/constants/audit-actions.js.map +1 -0
  218. package/dist/modules/audit/constants/audit-mutation.d.ts +10 -0
  219. package/dist/modules/audit/constants/audit-mutation.d.ts.map +1 -0
  220. package/dist/modules/audit/constants/audit-mutation.js +13 -0
  221. package/dist/modules/audit/constants/audit-mutation.js.map +1 -0
  222. package/dist/modules/audit/controllers/audit.controller.d.ts +13 -0
  223. package/dist/modules/audit/controllers/audit.controller.d.ts.map +1 -0
  224. package/dist/modules/audit/controllers/audit.controller.js +149 -0
  225. package/dist/modules/audit/controllers/audit.controller.js.map +1 -0
  226. package/dist/modules/audit/decorators/audit.decorator.d.ts +27 -0
  227. package/dist/modules/audit/decorators/audit.decorator.d.ts.map +1 -0
  228. package/dist/modules/audit/decorators/audit.decorator.js +18 -0
  229. package/dist/modules/audit/decorators/audit.decorator.js.map +1 -0
  230. package/dist/modules/audit/dto/audit.dto.d.ts +54 -0
  231. package/dist/modules/audit/dto/audit.dto.d.ts.map +1 -0
  232. package/dist/modules/audit/dto/audit.dto.js +129 -0
  233. package/dist/modules/audit/dto/audit.dto.js.map +1 -0
  234. package/dist/modules/audit/entities/audit-event.entity.d.ts +33 -0
  235. package/dist/modules/audit/entities/audit-event.entity.d.ts.map +1 -0
  236. package/dist/modules/audit/entities/audit-event.entity.js +125 -0
  237. package/dist/modules/audit/entities/audit-event.entity.js.map +1 -0
  238. package/dist/modules/audit/entities/audit-outbox.entity.d.ts +16 -0
  239. package/dist/modules/audit/entities/audit-outbox.entity.d.ts.map +1 -0
  240. package/dist/modules/audit/entities/audit-outbox.entity.js +65 -0
  241. package/dist/modules/audit/entities/audit-outbox.entity.js.map +1 -0
  242. package/dist/modules/audit/index.d.ts +13 -0
  243. package/dist/modules/audit/index.d.ts.map +1 -0
  244. package/dist/modules/audit/index.js +23 -0
  245. package/dist/modules/audit/index.js.map +1 -0
  246. package/dist/modules/audit/interceptors/audit.interceptor.d.ts +11 -0
  247. package/dist/modules/audit/interceptors/audit.interceptor.d.ts.map +1 -0
  248. package/dist/modules/audit/interceptors/audit.interceptor.js +75 -0
  249. package/dist/modules/audit/interceptors/audit.interceptor.js.map +1 -0
  250. package/dist/modules/audit/listeners/auth-audit.listener.d.ts +31 -0
  251. package/dist/modules/audit/listeners/auth-audit.listener.d.ts.map +1 -0
  252. package/dist/modules/audit/listeners/auth-audit.listener.js +338 -0
  253. package/dist/modules/audit/listeners/auth-audit.listener.js.map +1 -0
  254. package/dist/modules/audit/services/audit-archive.service.d.ts +28 -0
  255. package/dist/modules/audit/services/audit-archive.service.d.ts.map +1 -0
  256. package/dist/modules/audit/services/audit-archive.service.js +132 -0
  257. package/dist/modules/audit/services/audit-archive.service.js.map +1 -0
  258. package/dist/modules/audit/services/audit-hash-backfill.service.d.ts +22 -0
  259. package/dist/modules/audit/services/audit-hash-backfill.service.d.ts.map +1 -0
  260. package/dist/modules/audit/services/audit-hash-backfill.service.js +79 -0
  261. package/dist/modules/audit/services/audit-hash-backfill.service.js.map +1 -0
  262. package/dist/modules/audit/services/audit-leader.service.d.ts +28 -0
  263. package/dist/modules/audit/services/audit-leader.service.d.ts.map +1 -0
  264. package/dist/modules/audit/services/audit-leader.service.js +99 -0
  265. package/dist/modules/audit/services/audit-leader.service.js.map +1 -0
  266. package/dist/modules/audit/services/audit-outbox.worker.d.ts +29 -0
  267. package/dist/modules/audit/services/audit-outbox.worker.d.ts.map +1 -0
  268. package/dist/modules/audit/services/audit-outbox.worker.js +144 -0
  269. package/dist/modules/audit/services/audit-outbox.worker.js.map +1 -0
  270. package/dist/modules/audit/services/audit-partition.service.d.ts +18 -0
  271. package/dist/modules/audit/services/audit-partition.service.d.ts.map +1 -0
  272. package/dist/modules/audit/services/audit-partition.service.js +70 -0
  273. package/dist/modules/audit/services/audit-partition.service.js.map +1 -0
  274. package/dist/modules/audit/services/audit-write.service.d.ts +60 -0
  275. package/dist/modules/audit/services/audit-write.service.d.ts.map +1 -0
  276. package/dist/modules/audit/services/audit-write.service.js +463 -0
  277. package/dist/modules/audit/services/audit-write.service.js.map +1 -0
  278. package/dist/modules/audit/services/audit.service.d.ts +60 -0
  279. package/dist/modules/audit/services/audit.service.d.ts.map +1 -0
  280. package/dist/modules/audit/services/audit.service.js +373 -0
  281. package/dist/modules/audit/services/audit.service.js.map +1 -0
  282. package/dist/modules/audit/utils/audit-hash.util.d.ts +20 -0
  283. package/dist/modules/audit/utils/audit-hash.util.d.ts.map +1 -0
  284. package/dist/modules/audit/utils/audit-hash.util.js +44 -0
  285. package/dist/modules/audit/utils/audit-hash.util.js.map +1 -0
  286. package/dist/modules/auth/auth-core/auth-core.module.d.ts.map +1 -1
  287. package/dist/modules/auth/auth-core/auth-core.module.js +16 -4
  288. package/dist/modules/auth/auth-core/auth-core.module.js.map +1 -1
  289. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts +22 -0
  290. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts.map +1 -0
  291. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js +25 -0
  292. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js.map +1 -0
  293. package/dist/modules/auth/auth-core/services/access-token.validator.d.ts +19 -0
  294. package/dist/modules/auth/auth-core/services/access-token.validator.d.ts.map +1 -0
  295. package/dist/modules/auth/auth-core/services/access-token.validator.js +110 -0
  296. package/dist/modules/auth/auth-core/services/access-token.validator.js.map +1 -0
  297. package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts +10 -0
  298. package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts.map +1 -0
  299. package/dist/modules/auth/auth-core/services/family-denylist.reader.js +44 -0
  300. package/dist/modules/auth/auth-core/services/family-denylist.reader.js.map +1 -0
  301. package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts +10 -0
  302. package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts.map +1 -0
  303. package/dist/modules/auth/auth-core/services/session-epoch.reader.js +44 -0
  304. package/dist/modules/auth/auth-core/services/session-epoch.reader.js.map +1 -0
  305. package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts +7 -8
  306. package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts.map +1 -1
  307. package/dist/modules/auth/auth-core/strategies/jwt.strategy.js +34 -34
  308. package/dist/modules/auth/auth-core/strategies/jwt.strategy.js.map +1 -1
  309. package/dist/modules/auth/auth.manifest.d.ts +6 -0
  310. package/dist/modules/auth/auth.manifest.d.ts.map +1 -1
  311. package/dist/modules/auth/auth.manifest.js +38 -2
  312. package/dist/modules/auth/auth.manifest.js.map +1 -1
  313. package/dist/modules/auth/auth.module.d.ts.map +1 -1
  314. package/dist/modules/auth/auth.module.js +39 -4
  315. package/dist/modules/auth/auth.module.js.map +1 -1
  316. package/dist/modules/auth/controllers/account.controller.d.ts +15 -1
  317. package/dist/modules/auth/controllers/account.controller.d.ts.map +1 -1
  318. package/dist/modules/auth/controllers/account.controller.js +65 -7
  319. package/dist/modules/auth/controllers/account.controller.js.map +1 -1
  320. package/dist/modules/auth/controllers/auth.controller.d.ts +7 -3
  321. package/dist/modules/auth/controllers/auth.controller.d.ts.map +1 -1
  322. package/dist/modules/auth/controllers/auth.controller.js +76 -16
  323. package/dist/modules/auth/controllers/auth.controller.js.map +1 -1
  324. package/dist/modules/auth/controllers/forgot-password.controller.d.ts +4 -2
  325. package/dist/modules/auth/controllers/forgot-password.controller.d.ts.map +1 -1
  326. package/dist/modules/auth/controllers/forgot-password.controller.js +32 -11
  327. package/dist/modules/auth/controllers/forgot-password.controller.js.map +1 -1
  328. package/dist/modules/auth/controllers/mfa.controller.d.ts +18 -0
  329. package/dist/modules/auth/controllers/mfa.controller.d.ts.map +1 -0
  330. package/dist/modules/auth/controllers/mfa.controller.js +192 -0
  331. package/dist/modules/auth/controllers/mfa.controller.js.map +1 -0
  332. package/dist/modules/auth/controllers/oauth.controller.d.ts +22 -0
  333. package/dist/modules/auth/controllers/oauth.controller.d.ts.map +1 -0
  334. package/dist/modules/auth/controllers/oauth.controller.js +192 -0
  335. package/dist/modules/auth/controllers/oauth.controller.js.map +1 -0
  336. package/dist/modules/auth/controllers/otp.controller.d.ts +6 -3
  337. package/dist/modules/auth/controllers/otp.controller.d.ts.map +1 -1
  338. package/dist/modules/auth/controllers/otp.controller.js +32 -33
  339. package/dist/modules/auth/controllers/otp.controller.js.map +1 -1
  340. package/dist/modules/auth/controllers/pin.controller.d.ts.map +1 -1
  341. package/dist/modules/auth/controllers/pin.controller.js +10 -2
  342. package/dist/modules/auth/controllers/pin.controller.js.map +1 -1
  343. package/dist/modules/auth/controllers/session.controller.d.ts +12 -4
  344. package/dist/modules/auth/controllers/session.controller.d.ts.map +1 -1
  345. package/dist/modules/auth/controllers/session.controller.js +130 -31
  346. package/dist/modules/auth/controllers/session.controller.js.map +1 -1
  347. package/dist/modules/auth/dto/auth-config.dto.d.ts +11 -2
  348. package/dist/modules/auth/dto/auth-config.dto.d.ts.map +1 -1
  349. package/dist/modules/auth/dto/auth-config.dto.js +78 -3
  350. package/dist/modules/auth/dto/auth-config.dto.js.map +1 -1
  351. package/dist/modules/auth/dto/index.d.ts +2 -0
  352. package/dist/modules/auth/dto/index.d.ts.map +1 -1
  353. package/dist/modules/auth/dto/index.js +2 -0
  354. package/dist/modules/auth/dto/index.js.map +1 -1
  355. package/dist/modules/auth/dto/login.dto.d.ts +8 -1
  356. package/dist/modules/auth/dto/login.dto.d.ts.map +1 -1
  357. package/dist/modules/auth/dto/login.dto.js +48 -3
  358. package/dist/modules/auth/dto/login.dto.js.map +1 -1
  359. package/dist/modules/auth/dto/mfa.dto.d.ts +61 -0
  360. package/dist/modules/auth/dto/mfa.dto.d.ts.map +1 -0
  361. package/dist/modules/auth/dto/mfa.dto.js +326 -0
  362. package/dist/modules/auth/dto/mfa.dto.js.map +1 -0
  363. package/dist/modules/auth/dto/oauth.dto.d.ts +45 -0
  364. package/dist/modules/auth/dto/oauth.dto.d.ts.map +1 -0
  365. package/dist/modules/auth/dto/oauth.dto.js +249 -0
  366. package/dist/modules/auth/dto/oauth.dto.js.map +1 -0
  367. package/dist/modules/auth/dto/otp.dto.d.ts +3 -1
  368. package/dist/modules/auth/dto/otp.dto.d.ts.map +1 -1
  369. package/dist/modules/auth/dto/otp.dto.js +19 -0
  370. package/dist/modules/auth/dto/otp.dto.js.map +1 -1
  371. package/dist/modules/auth/dto/password.dto.d.ts +28 -0
  372. package/dist/modules/auth/dto/password.dto.d.ts.map +1 -1
  373. package/dist/modules/auth/dto/password.dto.js +191 -5
  374. package/dist/modules/auth/dto/password.dto.js.map +1 -1
  375. package/dist/modules/auth/dto/register.dto.d.ts +1 -0
  376. package/dist/modules/auth/dto/register.dto.d.ts.map +1 -1
  377. package/dist/modules/auth/dto/register.dto.js +1 -0
  378. package/dist/modules/auth/dto/register.dto.js.map +1 -1
  379. package/dist/modules/auth/dto/session.dto.d.ts +20 -0
  380. package/dist/modules/auth/dto/session.dto.d.ts.map +1 -0
  381. package/dist/modules/auth/dto/session.dto.js +98 -0
  382. package/dist/modules/auth/dto/session.dto.js.map +1 -0
  383. package/dist/modules/auth/dto/token.dto.d.ts +38 -1
  384. package/dist/modules/auth/dto/token.dto.d.ts.map +1 -1
  385. package/dist/modules/auth/dto/token.dto.js +21 -1
  386. package/dist/modules/auth/dto/token.dto.js.map +1 -1
  387. package/dist/modules/auth/entities/index.d.ts +2 -0
  388. package/dist/modules/auth/entities/index.d.ts.map +1 -1
  389. package/dist/modules/auth/entities/index.js +2 -0
  390. package/dist/modules/auth/entities/index.js.map +1 -1
  391. package/dist/modules/auth/entities/password-reset-token.entity.d.ts +2 -0
  392. package/dist/modules/auth/entities/password-reset-token.entity.d.ts.map +1 -1
  393. package/dist/modules/auth/entities/password-reset-token.entity.js +6 -0
  394. package/dist/modules/auth/entities/password-reset-token.entity.js.map +1 -1
  395. package/dist/modules/auth/entities/user-mfa.entity.d.ts +19 -0
  396. package/dist/modules/auth/entities/user-mfa.entity.d.ts.map +1 -0
  397. package/dist/modules/auth/entities/user-mfa.entity.js +73 -0
  398. package/dist/modules/auth/entities/user-mfa.entity.js.map +1 -0
  399. package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts +24 -0
  400. package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts.map +1 -0
  401. package/dist/modules/auth/entities/user-oauth-identity.entity.js +84 -0
  402. package/dist/modules/auth/entities/user-oauth-identity.entity.js.map +1 -0
  403. package/dist/modules/auth/events/auth.events.d.ts +84 -19
  404. package/dist/modules/auth/events/auth.events.d.ts.map +1 -1
  405. package/dist/modules/auth/events/auth.events.js +17 -9
  406. package/dist/modules/auth/events/auth.events.js.map +1 -1
  407. package/dist/modules/auth/services/account.service.d.ts +74 -14
  408. package/dist/modules/auth/services/account.service.d.ts.map +1 -1
  409. package/dist/modules/auth/services/account.service.js +247 -31
  410. package/dist/modules/auth/services/account.service.js.map +1 -1
  411. package/dist/modules/auth/services/dpop.service.d.ts +41 -0
  412. package/dist/modules/auth/services/dpop.service.d.ts.map +1 -0
  413. package/dist/modules/auth/services/dpop.service.js +159 -0
  414. package/dist/modules/auth/services/dpop.service.js.map +1 -0
  415. package/dist/modules/auth/services/index.d.ts +2 -0
  416. package/dist/modules/auth/services/index.d.ts.map +1 -1
  417. package/dist/modules/auth/services/index.js +2 -0
  418. package/dist/modules/auth/services/index.js.map +1 -1
  419. package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts +28 -0
  420. package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts.map +1 -0
  421. package/dist/modules/auth/services/legacy-hash-cleanup.service.js +163 -0
  422. package/dist/modules/auth/services/legacy-hash-cleanup.service.js.map +1 -0
  423. package/dist/modules/auth/services/login.service.d.ts +29 -34
  424. package/dist/modules/auth/services/login.service.d.ts.map +1 -1
  425. package/dist/modules/auth/services/login.service.js +173 -61
  426. package/dist/modules/auth/services/login.service.js.map +1 -1
  427. package/dist/modules/auth/services/mfa.service.d.ts +111 -0
  428. package/dist/modules/auth/services/mfa.service.d.ts.map +1 -0
  429. package/dist/modules/auth/services/mfa.service.js +662 -0
  430. package/dist/modules/auth/services/mfa.service.js.map +1 -0
  431. package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts +11 -0
  432. package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts.map +1 -0
  433. package/dist/modules/auth/services/oauth/apple-id-token.verifier.js +56 -0
  434. package/dist/modules/auth/services/oauth/apple-id-token.verifier.js.map +1 -0
  435. package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts +12 -0
  436. package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts.map +1 -0
  437. package/dist/modules/auth/services/oauth/google-id-token.verifier.js +64 -0
  438. package/dist/modules/auth/services/oauth/google-id-token.verifier.js.map +1 -0
  439. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts +11 -0
  440. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts.map +1 -0
  441. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js +76 -0
  442. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js.map +1 -0
  443. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts +16 -0
  444. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts.map +1 -0
  445. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js +92 -0
  446. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js.map +1 -0
  447. package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts +9 -0
  448. package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts.map +1 -0
  449. package/dist/modules/auth/services/oauth/verified-oauth-identity.js +3 -0
  450. package/dist/modules/auth/services/oauth/verified-oauth-identity.js.map +1 -0
  451. package/dist/modules/auth/services/oauth.service.d.ts +83 -0
  452. package/dist/modules/auth/services/oauth.service.d.ts.map +1 -0
  453. package/dist/modules/auth/services/oauth.service.js +471 -0
  454. package/dist/modules/auth/services/oauth.service.js.map +1 -0
  455. package/dist/modules/auth/services/otp-auth.service.d.ts +13 -3
  456. package/dist/modules/auth/services/otp-auth.service.d.ts.map +1 -1
  457. package/dist/modules/auth/services/otp-auth.service.js +41 -7
  458. package/dist/modules/auth/services/otp-auth.service.js.map +1 -1
  459. package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts +22 -0
  460. package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts.map +1 -0
  461. package/dist/modules/auth/services/password-reset-audit-retention.service.js +117 -0
  462. package/dist/modules/auth/services/password-reset-audit-retention.service.js.map +1 -0
  463. package/dist/modules/auth/services/password.service.d.ts +25 -5
  464. package/dist/modules/auth/services/password.service.d.ts.map +1 -1
  465. package/dist/modules/auth/services/password.service.js +154 -20
  466. package/dist/modules/auth/services/password.service.js.map +1 -1
  467. package/dist/modules/auth/services/pin-auth.service.d.ts +10 -3
  468. package/dist/modules/auth/services/pin-auth.service.d.ts.map +1 -1
  469. package/dist/modules/auth/services/pin-auth.service.js +110 -13
  470. package/dist/modules/auth/services/pin-auth.service.js.map +1 -1
  471. package/dist/modules/auth/services/registration.service.d.ts +10 -2
  472. package/dist/modules/auth/services/registration.service.d.ts.map +1 -1
  473. package/dist/modules/auth/services/registration.service.js +113 -25
  474. package/dist/modules/auth/services/registration.service.js.map +1 -1
  475. package/dist/modules/auth/services/turnstile.service.d.ts +17 -0
  476. package/dist/modules/auth/services/turnstile.service.d.ts.map +1 -0
  477. package/dist/modules/auth/services/turnstile.service.js +94 -0
  478. package/dist/modules/auth/services/turnstile.service.js.map +1 -0
  479. package/dist/modules/auth/utils/auth-params.util.d.ts +13 -6
  480. package/dist/modules/auth/utils/auth-params.util.d.ts.map +1 -1
  481. package/dist/modules/auth/utils/auth-params.util.js +27 -4
  482. package/dist/modules/auth/utils/auth-params.util.js.map +1 -1
  483. package/dist/modules/auth/utils/auth-supported.util.d.ts +12 -1
  484. package/dist/modules/auth/utils/auth-supported.util.d.ts.map +1 -1
  485. package/dist/modules/auth/utils/auth-supported.util.js +36 -4
  486. package/dist/modules/auth/utils/auth-supported.util.js.map +1 -1
  487. package/dist/modules/auth/utils/backup-code-hash.util.d.ts +10 -0
  488. package/dist/modules/auth/utils/backup-code-hash.util.d.ts.map +1 -0
  489. package/dist/modules/auth/utils/backup-code-hash.util.js +31 -0
  490. package/dist/modules/auth/utils/backup-code-hash.util.js.map +1 -0
  491. package/dist/modules/auth/utils/backup-codes.util.d.ts +5 -0
  492. package/dist/modules/auth/utils/backup-codes.util.d.ts.map +1 -0
  493. package/dist/modules/auth/utils/backup-codes.util.js +22 -0
  494. package/dist/modules/auth/utils/backup-codes.util.js.map +1 -0
  495. package/dist/modules/auth/utils/dpop.util.d.ts +22 -0
  496. package/dist/modules/auth/utils/dpop.util.d.ts.map +1 -0
  497. package/dist/modules/auth/utils/dpop.util.js +73 -0
  498. package/dist/modules/auth/utils/dpop.util.js.map +1 -0
  499. package/dist/modules/auth/utils/mfa-secret.util.d.ts +22 -0
  500. package/dist/modules/auth/utils/mfa-secret.util.d.ts.map +1 -0
  501. package/dist/modules/auth/utils/mfa-secret.util.js +59 -0
  502. package/dist/modules/auth/utils/mfa-secret.util.js.map +1 -0
  503. package/dist/modules/auth/utils/mfa-verify-params.util.d.ts +26 -0
  504. package/dist/modules/auth/utils/mfa-verify-params.util.d.ts.map +1 -0
  505. package/dist/modules/auth/utils/mfa-verify-params.util.js +49 -0
  506. package/dist/modules/auth/utils/mfa-verify-params.util.js.map +1 -0
  507. package/dist/modules/auth/utils/step-up-purpose.util.d.ts +5 -0
  508. package/dist/modules/auth/utils/step-up-purpose.util.d.ts.map +1 -0
  509. package/dist/modules/auth/utils/step-up-purpose.util.js +18 -0
  510. package/dist/modules/auth/utils/step-up-purpose.util.js.map +1 -0
  511. package/dist/modules/auth/utils/totp.util.d.ts +16 -0
  512. package/dist/modules/auth/utils/totp.util.d.ts.map +1 -0
  513. package/dist/modules/auth/utils/totp.util.js +88 -0
  514. package/dist/modules/auth/utils/totp.util.js.map +1 -0
  515. package/dist/modules/delivery/composers/otp-delivery.composer.d.ts +28 -1
  516. package/dist/modules/delivery/composers/otp-delivery.composer.d.ts.map +1 -1
  517. package/dist/modules/delivery/composers/otp-delivery.composer.js +48 -2
  518. package/dist/modules/delivery/composers/otp-delivery.composer.js.map +1 -1
  519. package/dist/modules/delivery/constants/delivery-worker.constants.d.ts +29 -0
  520. package/dist/modules/delivery/constants/delivery-worker.constants.d.ts.map +1 -0
  521. package/dist/modules/delivery/constants/delivery-worker.constants.js +51 -0
  522. package/dist/modules/delivery/constants/delivery-worker.constants.js.map +1 -0
  523. package/dist/modules/delivery/delivery.module.d.ts.map +1 -1
  524. package/dist/modules/delivery/delivery.module.js +1 -15
  525. package/dist/modules/delivery/delivery.module.js.map +1 -1
  526. package/dist/modules/delivery/entities/notification-delivery-log.entity.d.ts.map +1 -1
  527. package/dist/modules/delivery/entities/notification-delivery-log.entity.js +3 -1
  528. package/dist/modules/delivery/entities/notification-delivery-log.entity.js.map +1 -1
  529. package/dist/modules/delivery/notification-delivery.service.d.ts +12 -1
  530. package/dist/modules/delivery/notification-delivery.service.d.ts.map +1 -1
  531. package/dist/modules/delivery/notification-delivery.service.js +121 -40
  532. package/dist/modules/delivery/notification-delivery.service.js.map +1 -1
  533. package/dist/modules/delivery/processors/delivery-job.runner.d.ts +22 -1
  534. package/dist/modules/delivery/processors/delivery-job.runner.d.ts.map +1 -1
  535. package/dist/modules/delivery/processors/delivery-job.runner.js +144 -42
  536. package/dist/modules/delivery/processors/delivery-job.runner.js.map +1 -1
  537. package/dist/modules/delivery/processors/delivery.processor.d.ts.map +1 -1
  538. package/dist/modules/delivery/processors/delivery.processor.js +6 -1
  539. package/dist/modules/delivery/processors/delivery.processor.js.map +1 -1
  540. package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts +11 -0
  541. package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts.map +1 -1
  542. package/dist/modules/delivery/processors/otp-delivery-job.runner.js +90 -16
  543. package/dist/modules/delivery/processors/otp-delivery-job.runner.js.map +1 -1
  544. package/dist/modules/delivery/processors/otp-delivery.processor.d.ts.map +1 -1
  545. package/dist/modules/delivery/processors/otp-delivery.processor.js +6 -1
  546. package/dist/modules/delivery/processors/otp-delivery.processor.js.map +1 -1
  547. package/dist/modules/delivery/queues/sync-jobs.queue.d.ts +7 -1
  548. package/dist/modules/delivery/queues/sync-jobs.queue.d.ts.map +1 -1
  549. package/dist/modules/delivery/queues/sync-jobs.queue.js +11 -2
  550. package/dist/modules/delivery/queues/sync-jobs.queue.js.map +1 -1
  551. package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts +7 -3
  552. package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts.map +1 -1
  553. package/dist/modules/delivery/services/delivery-audit-retention.service.js +33 -10
  554. package/dist/modules/delivery/services/delivery-audit-retention.service.js.map +1 -1
  555. package/dist/modules/delivery/services/notification-audit.service.d.ts +7 -4
  556. package/dist/modules/delivery/services/notification-audit.service.d.ts.map +1 -1
  557. package/dist/modules/delivery/services/notification-audit.service.js +83 -26
  558. package/dist/modules/delivery/services/notification-audit.service.js.map +1 -1
  559. package/dist/modules/delivery/utils/payload-snapshot.util.d.ts +2 -0
  560. package/dist/modules/delivery/utils/payload-snapshot.util.d.ts.map +1 -1
  561. package/dist/modules/delivery/utils/payload-snapshot.util.js +22 -3
  562. package/dist/modules/delivery/utils/payload-snapshot.util.js.map +1 -1
  563. package/dist/modules/file-upload/controllers/file-upload.controller.d.ts +7 -1
  564. package/dist/modules/file-upload/controllers/file-upload.controller.d.ts.map +1 -1
  565. package/dist/modules/file-upload/controllers/file-upload.controller.js +5 -7
  566. package/dist/modules/file-upload/controllers/file-upload.controller.js.map +1 -1
  567. package/dist/modules/file-upload/dto/file-upload.dto.d.ts +2 -0
  568. package/dist/modules/file-upload/dto/file-upload.dto.d.ts.map +1 -1
  569. package/dist/modules/file-upload/dto/file-upload.dto.js +20 -0
  570. package/dist/modules/file-upload/dto/file-upload.dto.js.map +1 -1
  571. package/dist/modules/file-upload/file-upload.module.d.ts.map +1 -1
  572. package/dist/modules/file-upload/file-upload.module.js +12 -2
  573. package/dist/modules/file-upload/file-upload.module.js.map +1 -1
  574. package/dist/modules/file-upload/services/file-upload.service.d.ts +24 -6
  575. package/dist/modules/file-upload/services/file-upload.service.d.ts.map +1 -1
  576. package/dist/modules/file-upload/services/file-upload.service.js +164 -36
  577. package/dist/modules/file-upload/services/file-upload.service.js.map +1 -1
  578. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts +4 -2
  579. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts.map +1 -1
  580. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js +30 -5
  581. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js.map +1 -1
  582. package/dist/modules/file-upload/utils/image-optimize.util.d.ts.map +1 -1
  583. package/dist/modules/file-upload/utils/image-optimize.util.js +7 -1
  584. package/dist/modules/file-upload/utils/image-optimize.util.js.map +1 -1
  585. package/dist/modules/health/health.controller.d.ts +5 -1
  586. package/dist/modules/health/health.controller.d.ts.map +1 -1
  587. package/dist/modules/health/health.controller.js +57 -3
  588. package/dist/modules/health/health.controller.js.map +1 -1
  589. package/dist/modules/invitations/controllers/invitations.controller.d.ts +19 -4
  590. package/dist/modules/invitations/controllers/invitations.controller.d.ts.map +1 -1
  591. package/dist/modules/invitations/controllers/invitations.controller.js +19 -10
  592. package/dist/modules/invitations/controllers/invitations.controller.js.map +1 -1
  593. package/dist/modules/invitations/dto/invitation.dto.d.ts +13 -0
  594. package/dist/modules/invitations/dto/invitation.dto.d.ts.map +1 -1
  595. package/dist/modules/invitations/dto/invitation.dto.js +69 -2
  596. package/dist/modules/invitations/dto/invitation.dto.js.map +1 -1
  597. package/dist/modules/invitations/services/invitations.service.d.ts +24 -6
  598. package/dist/modules/invitations/services/invitations.service.d.ts.map +1 -1
  599. package/dist/modules/invitations/services/invitations.service.js +96 -20
  600. package/dist/modules/invitations/services/invitations.service.js.map +1 -1
  601. package/dist/modules/jobs/queues/jobs.queue.d.ts +7 -2
  602. package/dist/modules/jobs/queues/jobs.queue.d.ts.map +1 -1
  603. package/dist/modules/jobs/queues/jobs.queue.js +25 -10
  604. package/dist/modules/jobs/queues/jobs.queue.js.map +1 -1
  605. package/dist/modules/notifications/controllers/notifications.controller.d.ts +3 -1
  606. package/dist/modules/notifications/controllers/notifications.controller.d.ts.map +1 -1
  607. package/dist/modules/notifications/controllers/notifications.controller.js +25 -2
  608. package/dist/modules/notifications/controllers/notifications.controller.js.map +1 -1
  609. package/dist/modules/notifications/dto/notification-query.dto.d.ts.map +1 -1
  610. package/dist/modules/notifications/dto/notification-query.dto.js +1 -0
  611. package/dist/modules/notifications/dto/notification-query.dto.js.map +1 -1
  612. package/dist/modules/notifications/entities/device-token.entity.d.ts.map +1 -1
  613. package/dist/modules/notifications/entities/device-token.entity.js +3 -1
  614. package/dist/modules/notifications/entities/device-token.entity.js.map +1 -1
  615. package/dist/modules/notifications/services/fcm.service.d.ts +2 -0
  616. package/dist/modules/notifications/services/fcm.service.d.ts.map +1 -1
  617. package/dist/modules/notifications/services/fcm.service.js +28 -7
  618. package/dist/modules/notifications/services/fcm.service.js.map +1 -1
  619. package/dist/modules/notifications/services/notifications.service.d.ts +16 -3
  620. package/dist/modules/notifications/services/notifications.service.d.ts.map +1 -1
  621. package/dist/modules/notifications/services/notifications.service.js +95 -24
  622. package/dist/modules/notifications/services/notifications.service.js.map +1 -1
  623. package/dist/modules/observability/metrics/metrics.service.d.ts +2 -0
  624. package/dist/modules/observability/metrics/metrics.service.d.ts.map +1 -1
  625. package/dist/modules/observability/metrics/metrics.service.js +11 -0
  626. package/dist/modules/observability/metrics/metrics.service.js.map +1 -1
  627. package/dist/modules/otp/constants/otp.constants.d.ts +7 -5
  628. package/dist/modules/otp/constants/otp.constants.d.ts.map +1 -1
  629. package/dist/modules/otp/constants/otp.constants.js +11 -8
  630. package/dist/modules/otp/constants/otp.constants.js.map +1 -1
  631. package/dist/modules/otp/interfaces/otp.service.interface.d.ts +1 -1
  632. package/dist/modules/otp/interfaces/otp.service.interface.d.ts.map +1 -1
  633. package/dist/modules/otp/otp.service.d.ts +10 -2
  634. package/dist/modules/otp/otp.service.d.ts.map +1 -1
  635. package/dist/modules/otp/otp.service.js +48 -4
  636. package/dist/modules/otp/otp.service.js.map +1 -1
  637. package/dist/modules/otp/services/otp.rate-limiter.d.ts +2 -0
  638. package/dist/modules/otp/services/otp.rate-limiter.d.ts.map +1 -1
  639. package/dist/modules/otp/services/otp.rate-limiter.js +19 -0
  640. package/dist/modules/otp/services/otp.rate-limiter.js.map +1 -1
  641. package/dist/modules/otp/services/otp.session.store.d.ts +9 -3
  642. package/dist/modules/otp/services/otp.session.store.d.ts.map +1 -1
  643. package/dist/modules/otp/services/otp.session.store.js +34 -42
  644. package/dist/modules/otp/services/otp.session.store.js.map +1 -1
  645. package/dist/modules/otp/utils/otp-code-hash.util.d.ts +11 -0
  646. package/dist/modules/otp/utils/otp-code-hash.util.d.ts.map +1 -0
  647. package/dist/modules/otp/utils/otp-code-hash.util.js +68 -0
  648. package/dist/modules/otp/utils/otp-code-hash.util.js.map +1 -0
  649. package/dist/modules/profile/controllers/profile.controller.d.ts +9 -3
  650. package/dist/modules/profile/controllers/profile.controller.d.ts.map +1 -1
  651. package/dist/modules/profile/controllers/profile.controller.js +140 -8
  652. package/dist/modules/profile/controllers/profile.controller.js.map +1 -1
  653. package/dist/modules/profile/dto/create-user-profile.dto.d.ts +10 -0
  654. package/dist/modules/profile/dto/create-user-profile.dto.d.ts.map +1 -1
  655. package/dist/modules/profile/dto/create-user-profile.dto.js +43 -1
  656. package/dist/modules/profile/dto/create-user-profile.dto.js.map +1 -1
  657. package/dist/modules/profile/dto/public-user-profile.dto.d.ts +24 -0
  658. package/dist/modules/profile/dto/public-user-profile.dto.d.ts.map +1 -0
  659. package/dist/modules/profile/dto/public-user-profile.dto.js +115 -0
  660. package/dist/modules/profile/dto/public-user-profile.dto.js.map +1 -0
  661. package/dist/modules/profile/dto/user-profile-response.dto.d.ts +4 -0
  662. package/dist/modules/profile/dto/user-profile-response.dto.d.ts.map +1 -1
  663. package/dist/modules/profile/dto/user-profile-response.dto.js +4 -0
  664. package/dist/modules/profile/dto/user-profile-response.dto.js.map +1 -1
  665. package/dist/modules/profile/dto/username-available.dto.d.ts +6 -0
  666. package/dist/modules/profile/dto/username-available.dto.d.ts.map +1 -0
  667. package/dist/modules/profile/dto/username-available.dto.js +31 -0
  668. package/dist/modules/profile/dto/username-available.dto.js.map +1 -0
  669. package/dist/modules/profile/entities/user-profiles.entity.d.ts +10 -0
  670. package/dist/modules/profile/entities/user-profiles.entity.d.ts.map +1 -1
  671. package/dist/modules/profile/entities/user-profiles.entity.js +29 -1
  672. package/dist/modules/profile/entities/user-profiles.entity.js.map +1 -1
  673. package/dist/modules/profile/index.d.ts +1 -0
  674. package/dist/modules/profile/index.d.ts.map +1 -1
  675. package/dist/modules/profile/index.js +1 -0
  676. package/dist/modules/profile/index.js.map +1 -1
  677. package/dist/modules/profile/profile.manifest.d.ts +2 -2
  678. package/dist/modules/profile/profile.manifest.js +2 -2
  679. package/dist/modules/profile/profile.manifest.js.map +1 -1
  680. package/dist/modules/profile/profile.module.d.ts.map +1 -1
  681. package/dist/modules/profile/profile.module.js +7 -2
  682. package/dist/modules/profile/profile.module.js.map +1 -1
  683. package/dist/modules/profile/services/profile.service.d.ts +56 -4
  684. package/dist/modules/profile/services/profile.service.d.ts.map +1 -1
  685. package/dist/modules/profile/services/profile.service.js +247 -20
  686. package/dist/modules/profile/services/profile.service.js.map +1 -1
  687. package/dist/modules/realtime/adapters/redis-io.adapter.d.ts +26 -0
  688. package/dist/modules/realtime/adapters/redis-io.adapter.d.ts.map +1 -0
  689. package/dist/modules/realtime/adapters/redis-io.adapter.js +124 -0
  690. package/dist/modules/realtime/adapters/redis-io.adapter.js.map +1 -0
  691. package/dist/modules/realtime/constants/realtime.constants.d.ts +36 -0
  692. package/dist/modules/realtime/constants/realtime.constants.d.ts.map +1 -0
  693. package/dist/modules/realtime/constants/realtime.constants.js +42 -0
  694. package/dist/modules/realtime/constants/realtime.constants.js.map +1 -0
  695. package/dist/modules/realtime/controllers/realtime.controller.d.ts +21 -0
  696. package/dist/modules/realtime/controllers/realtime.controller.d.ts.map +1 -0
  697. package/dist/modules/realtime/controllers/realtime.controller.js +113 -0
  698. package/dist/modules/realtime/controllers/realtime.controller.js.map +1 -0
  699. package/dist/modules/realtime/gateway/realtime.gateway.d.ts +42 -0
  700. package/dist/modules/realtime/gateway/realtime.gateway.d.ts.map +1 -0
  701. package/dist/modules/realtime/gateway/realtime.gateway.js +289 -0
  702. package/dist/modules/realtime/gateway/realtime.gateway.js.map +1 -0
  703. package/dist/modules/realtime/index.d.ts +12 -0
  704. package/dist/modules/realtime/index.d.ts.map +1 -0
  705. package/dist/modules/realtime/index.js +35 -0
  706. package/dist/modules/realtime/index.js.map +1 -0
  707. package/dist/modules/realtime/realtime.manifest.d.ts +8 -0
  708. package/dist/modules/realtime/realtime.manifest.d.ts.map +1 -0
  709. package/dist/modules/realtime/realtime.manifest.js +31 -0
  710. package/dist/modules/realtime/realtime.manifest.js.map +1 -0
  711. package/dist/modules/realtime/realtime.module.d.ts +14 -0
  712. package/dist/modules/realtime/realtime.module.d.ts.map +1 -0
  713. package/dist/modules/realtime/realtime.module.js +126 -0
  714. package/dist/modules/realtime/realtime.module.js.map +1 -0
  715. package/dist/modules/realtime/services/realtime-handler.registry.d.ts +16 -0
  716. package/dist/modules/realtime/services/realtime-handler.registry.d.ts.map +1 -0
  717. package/dist/modules/realtime/services/realtime-handler.registry.js +55 -0
  718. package/dist/modules/realtime/services/realtime-handler.registry.js.map +1 -0
  719. package/dist/modules/realtime/services/realtime-presence.service.d.ts +15 -0
  720. package/dist/modules/realtime/services/realtime-presence.service.d.ts.map +1 -0
  721. package/dist/modules/realtime/services/realtime-presence.service.js +86 -0
  722. package/dist/modules/realtime/services/realtime-presence.service.js.map +1 -0
  723. package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts +12 -0
  724. package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts.map +1 -0
  725. package/dist/modules/realtime/services/realtime-rate-limiter.service.js +63 -0
  726. package/dist/modules/realtime/services/realtime-rate-limiter.service.js.map +1 -0
  727. package/dist/modules/realtime/services/realtime.service.d.ts +88 -0
  728. package/dist/modules/realtime/services/realtime.service.d.ts.map +1 -0
  729. package/dist/modules/realtime/services/realtime.service.js +343 -0
  730. package/dist/modules/realtime/services/realtime.service.js.map +1 -0
  731. package/dist/modules/realtime/types/realtime.types.d.ts +50 -0
  732. package/dist/modules/realtime/types/realtime.types.d.ts.map +1 -0
  733. package/dist/modules/realtime/types/realtime.types.js +14 -0
  734. package/dist/modules/realtime/types/realtime.types.js.map +1 -0
  735. package/dist/modules/realtime/utils/handshake-error.util.d.ts +5 -0
  736. package/dist/modules/realtime/utils/handshake-error.util.d.ts.map +1 -0
  737. package/dist/modules/realtime/utils/handshake-error.util.js +45 -0
  738. package/dist/modules/realtime/utils/handshake-error.util.js.map +1 -0
  739. package/dist/modules/roles/controllers/modules.controller.d.ts +4 -3
  740. package/dist/modules/roles/controllers/modules.controller.d.ts.map +1 -1
  741. package/dist/modules/roles/controllers/modules.controller.js +21 -10
  742. package/dist/modules/roles/controllers/modules.controller.js.map +1 -1
  743. package/dist/modules/roles/controllers/permissions.controller.d.ts +4 -3
  744. package/dist/modules/roles/controllers/permissions.controller.d.ts.map +1 -1
  745. package/dist/modules/roles/controllers/permissions.controller.js +21 -10
  746. package/dist/modules/roles/controllers/permissions.controller.js.map +1 -1
  747. package/dist/modules/roles/controllers/roles.controller.d.ts +5 -4
  748. package/dist/modules/roles/controllers/roles.controller.d.ts.map +1 -1
  749. package/dist/modules/roles/controllers/roles.controller.js +26 -13
  750. package/dist/modules/roles/controllers/roles.controller.js.map +1 -1
  751. package/dist/modules/roles/controllers/user-roles.controller.d.ts +3 -2
  752. package/dist/modules/roles/controllers/user-roles.controller.d.ts.map +1 -1
  753. package/dist/modules/roles/controllers/user-roles.controller.js +14 -6
  754. package/dist/modules/roles/controllers/user-roles.controller.js.map +1 -1
  755. package/dist/modules/roles/services/modules.service.d.ts +8 -5
  756. package/dist/modules/roles/services/modules.service.d.ts.map +1 -1
  757. package/dist/modules/roles/services/modules.service.js +58 -12
  758. package/dist/modules/roles/services/modules.service.js.map +1 -1
  759. package/dist/modules/roles/services/permissions.service.d.ts +8 -5
  760. package/dist/modules/roles/services/permissions.service.d.ts.map +1 -1
  761. package/dist/modules/roles/services/permissions.service.js +61 -12
  762. package/dist/modules/roles/services/permissions.service.js.map +1 -1
  763. package/dist/modules/roles/services/roles.service.d.ts +19 -9
  764. package/dist/modules/roles/services/roles.service.d.ts.map +1 -1
  765. package/dist/modules/roles/services/roles.service.js +137 -47
  766. package/dist/modules/roles/services/roles.service.js.map +1 -1
  767. package/dist/modules/roles/services/user-roles.service.d.ts +12 -4
  768. package/dist/modules/roles/services/user-roles.service.d.ts.map +1 -1
  769. package/dist/modules/roles/services/user-roles.service.js +58 -26
  770. package/dist/modules/roles/services/user-roles.service.js.map +1 -1
  771. package/dist/modules/sessions/entities/refresh-token.entity.d.ts +7 -1
  772. package/dist/modules/sessions/entities/refresh-token.entity.d.ts.map +1 -1
  773. package/dist/modules/sessions/entities/refresh-token.entity.js +10 -0
  774. package/dist/modules/sessions/entities/refresh-token.entity.js.map +1 -1
  775. package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts +12 -0
  776. package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts.map +1 -0
  777. package/dist/modules/sessions/entities/revoked-refresh-family.entity.js +46 -0
  778. package/dist/modules/sessions/entities/revoked-refresh-family.entity.js.map +1 -0
  779. package/dist/modules/sessions/services/refresh-token-retention.service.d.ts +20 -0
  780. package/dist/modules/sessions/services/refresh-token-retention.service.d.ts.map +1 -0
  781. package/dist/modules/sessions/services/refresh-token-retention.service.js +97 -0
  782. package/dist/modules/sessions/services/refresh-token-retention.service.js.map +1 -0
  783. package/dist/modules/sessions/services/token.service.d.ts +150 -16
  784. package/dist/modules/sessions/services/token.service.d.ts.map +1 -1
  785. package/dist/modules/sessions/services/token.service.js +505 -74
  786. package/dist/modules/sessions/services/token.service.js.map +1 -1
  787. package/dist/modules/sessions/sessions.module.d.ts.map +1 -1
  788. package/dist/modules/sessions/sessions.module.js +4 -2
  789. package/dist/modules/sessions/sessions.module.js.map +1 -1
  790. package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts +13 -0
  791. package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts.map +1 -0
  792. package/dist/modules/sessions/utils/refresh-token-hash.util.js +37 -0
  793. package/dist/modules/sessions/utils/refresh-token-hash.util.js.map +1 -0
  794. package/dist/modules/settings/constants/settings.defaults.d.ts +57 -3
  795. package/dist/modules/settings/constants/settings.defaults.d.ts.map +1 -1
  796. package/dist/modules/settings/constants/settings.defaults.js +58 -3
  797. package/dist/modules/settings/constants/settings.defaults.js.map +1 -1
  798. package/dist/modules/settings/constants/settings.keys.d.ts +138 -2
  799. package/dist/modules/settings/constants/settings.keys.d.ts.map +1 -1
  800. package/dist/modules/settings/constants/settings.keys.js +140 -2
  801. package/dist/modules/settings/constants/settings.keys.js.map +1 -1
  802. package/dist/modules/settings/controllers/settings.controller.d.ts +5 -1
  803. package/dist/modules/settings/controllers/settings.controller.d.ts.map +1 -1
  804. package/dist/modules/settings/controllers/settings.controller.js +134 -5
  805. package/dist/modules/settings/controllers/settings.controller.js.map +1 -1
  806. package/dist/modules/settings/services/settings.service.d.ts +17 -7
  807. package/dist/modules/settings/services/settings.service.d.ts.map +1 -1
  808. package/dist/modules/settings/services/settings.service.js +80 -14
  809. package/dist/modules/settings/services/settings.service.js.map +1 -1
  810. package/dist/modules/settings/utils/settings-secret.util.d.ts +13 -0
  811. package/dist/modules/settings/utils/settings-secret.util.d.ts.map +1 -0
  812. package/dist/modules/settings/utils/settings-secret.util.js +80 -0
  813. package/dist/modules/settings/utils/settings-secret.util.js.map +1 -0
  814. package/dist/modules/users/controllers/users.controller.d.ts +4 -2
  815. package/dist/modules/users/controllers/users.controller.d.ts.map +1 -1
  816. package/dist/modules/users/controllers/users.controller.js +89 -10
  817. package/dist/modules/users/controllers/users.controller.js.map +1 -1
  818. package/dist/modules/users/dto/user.dto.d.ts +5 -0
  819. package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
  820. package/dist/modules/users/dto/user.dto.js +46 -5
  821. package/dist/modules/users/dto/user.dto.js.map +1 -1
  822. package/dist/modules/users/entities/user.entity.d.ts +7 -1
  823. package/dist/modules/users/entities/user.entity.d.ts.map +1 -1
  824. package/dist/modules/users/entities/user.entity.js +10 -0
  825. package/dist/modules/users/entities/user.entity.js.map +1 -1
  826. package/dist/modules/users/services/users.service.d.ts +15 -2
  827. package/dist/modules/users/services/users.service.d.ts.map +1 -1
  828. package/dist/modules/users/services/users.service.js +152 -37
  829. package/dist/modules/users/services/users.service.js.map +1 -1
  830. package/dist/modules/users/users.module.d.ts.map +1 -1
  831. package/dist/modules/users/users.module.js +1 -2
  832. package/dist/modules/users/users.module.js.map +1 -1
  833. package/package.json +19 -7
  834. package/dist/modules/admin/entities/admin-log.entity.d.ts +0 -20
  835. package/dist/modules/admin/entities/admin-log.entity.d.ts.map +0 -1
  836. package/dist/modules/admin/entities/admin-log.entity.js +0 -65
  837. package/dist/modules/admin/entities/admin-log.entity.js.map +0 -1
@@ -45,17 +45,17 @@ __decorate([
45
45
  ], CreateUserDto.prototype, "authMethod", void 0);
46
46
  __decorate([
47
47
  (0, class_validator_1.IsPhoneNumber)(),
48
- (0, class_validator_1.ValidateIf)((o) => o.email === undefined || o.passwordHash === null),
48
+ (0, class_validator_1.ValidateIf)((o) => o.authMethod === user_entity_1.UserAuthMethod.PHONE),
49
49
  __metadata("design:type", String)
50
50
  ], CreateUserDto.prototype, "phoneNumber", void 0);
51
51
  __decorate([
52
52
  (0, class_validator_1.IsString)(),
53
- (0, class_validator_1.ValidateIf)((o) => o.email === undefined || o.passwordHash === null),
53
+ (0, class_validator_1.ValidateIf)((o) => o.authMethod === user_entity_1.UserAuthMethod.PHONE),
54
54
  __metadata("design:type", String)
55
55
  ], CreateUserDto.prototype, "countryCode", void 0);
56
56
  __decorate([
57
57
  (0, class_validator_1.IsEmail)(),
58
- (0, class_validator_1.ValidateIf)((o) => o.phoneNumber === undefined),
58
+ (0, class_validator_1.ValidateIf)((o) => o.authMethod === user_entity_1.UserAuthMethod.EMAIL || o.authMethod === user_entity_1.UserAuthMethod.OAUTH),
59
59
  __metadata("design:type", String)
60
60
  ], CreateUserDto.prototype, "email", void 0);
61
61
  __decorate([
@@ -71,7 +71,7 @@ __decorate([
71
71
  __decorate([
72
72
  (0, class_validator_1.IsString)(),
73
73
  (0, class_validator_1.MinLength)(8),
74
- (0, class_validator_1.ValidateIf)((o) => o.phoneNumber === undefined),
74
+ (0, class_validator_1.ValidateIf)((o) => o.authMethod === user_entity_1.UserAuthMethod.EMAIL),
75
75
  __metadata("design:type", String)
76
76
  ], CreateUserDto.prototype, "passwordHash", void 0);
77
77
  __decorate([
@@ -145,14 +145,24 @@ class UserResponseDto {
145
145
  countryCode;
146
146
  authMethod;
147
147
  photoFileId;
148
+ photoUrl;
149
+ coverPhotoFileId;
150
+ coverPhotoUrl;
148
151
  username;
149
152
  displayName;
153
+ firstName;
154
+ lastName;
150
155
  isEmailVerified;
151
156
  isPhoneVerified;
152
157
  onboardingStep;
153
158
  isProfileCompleted;
154
159
  status;
155
160
  static fromUser(user) {
161
+ const { firstName, lastName, displayName, fullName } = user.profile ?? {};
162
+ const resolvedDisplayName = displayName ??
163
+ fullName ??
164
+ (firstName && lastName ? `${firstName} ${lastName}` : undefined);
165
+ const displayNameParts = resolvedDisplayName?.split(/\s+/).filter(Boolean) ?? [];
156
166
  return {
157
167
  id: user.id,
158
168
  uid: user.uid ?? undefined,
@@ -161,8 +171,14 @@ class UserResponseDto {
161
171
  countryCode: user.countryCode ?? undefined,
162
172
  authMethod: user.authMethod,
163
173
  photoFileId: user.profile?.photoFileId ?? undefined,
174
+ photoUrl: user.profile?.photoUrl ?? undefined,
175
+ coverPhotoFileId: user.profile?.coverPhotoFileId ?? undefined,
176
+ coverPhotoUrl: user.profile?.coverPhotoUrl ?? undefined,
164
177
  username: user.profile?.username ?? undefined,
165
- displayName: user.profile?.displayName ?? user.profile?.fullName ?? undefined,
178
+ displayName: resolvedDisplayName,
179
+ firstName: firstName ?? displayNameParts[0],
180
+ lastName: lastName ??
181
+ (displayNameParts.length > 1 ? displayNameParts.slice(1).join(' ') : undefined),
166
182
  isEmailVerified: user.isEmailVerified,
167
183
  isPhoneVerified: user.isPhoneVerified,
168
184
  onboardingStep: user.profile?.onboardingStep ?? 0,
@@ -203,6 +219,22 @@ __decorate([
203
219
  (0, swagger_1.ApiPropertyOptional)({ format: 'uuid' }),
204
220
  __metadata("design:type", String)
205
221
  ], UserResponseDto.prototype, "photoFileId", void 0);
222
+ __decorate([
223
+ (0, swagger_1.ApiPropertyOptional)({
224
+ description: 'Public CDN URL for the profile photo (denormalized; null when unset)',
225
+ }),
226
+ __metadata("design:type", String)
227
+ ], UserResponseDto.prototype, "photoUrl", void 0);
228
+ __decorate([
229
+ (0, swagger_1.ApiPropertyOptional)({ format: 'uuid' }),
230
+ __metadata("design:type", String)
231
+ ], UserResponseDto.prototype, "coverPhotoFileId", void 0);
232
+ __decorate([
233
+ (0, swagger_1.ApiPropertyOptional)({
234
+ description: 'Public CDN URL for the cover photo (denormalized; null when unset)',
235
+ }),
236
+ __metadata("design:type", String)
237
+ ], UserResponseDto.prototype, "coverPhotoUrl", void 0);
206
238
  __decorate([
207
239
  (0, swagger_1.ApiPropertyOptional)(),
208
240
  __metadata("design:type", String)
@@ -211,6 +243,14 @@ __decorate([
211
243
  (0, swagger_1.ApiPropertyOptional)(),
212
244
  __metadata("design:type", String)
213
245
  ], UserResponseDto.prototype, "displayName", void 0);
246
+ __decorate([
247
+ (0, swagger_1.ApiPropertyOptional)(),
248
+ __metadata("design:type", String)
249
+ ], UserResponseDto.prototype, "firstName", void 0);
250
+ __decorate([
251
+ (0, swagger_1.ApiPropertyOptional)(),
252
+ __metadata("design:type", String)
253
+ ], UserResponseDto.prototype, "lastName", void 0);
214
254
  __decorate([
215
255
  (0, swagger_1.ApiProperty)(),
216
256
  __metadata("design:type", Boolean)
@@ -258,6 +298,7 @@ exports.UserFilterDto = UserFilterDto;
258
298
  __decorate([
259
299
  (0, class_validator_1.IsOptional)(),
260
300
  (0, class_validator_1.IsString)(),
301
+ (0, class_validator_1.MaxLength)(64),
261
302
  __metadata("design:type", String)
262
303
  ], UserFilterDto.prototype, "search", void 0);
263
304
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"user.dto.js","sourceRoot":"","sources":["../../../../src/modules/users/dto/user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,yDAAyC;AACzC,qDAYyB;AAEzB,uEAAmE;AACnE,sHAAsG;AACtG,uFAGmD;AACnD,yDAA2E;AAE3E,MAAa,aAAa;IAGzB,GAAG,CAAU;IAQb,UAAU,CAAkB;IAI5B,WAAW,CAAU;IAIrB,WAAW,CAAU;IAIrB,KAAK,CAAU;IAIf,eAAe,CAAW;IAI1B,eAAe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wBAAU,CAAC;;6CACC;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;6CACO"}
@@ -11,7 +11,8 @@ export declare enum UserStatus {
11
11
  /** Primary authentication method assigned at signup — immutable for the account. */
12
12
  export declare enum UserAuthMethod {
13
13
  PHONE = "phone",
14
- EMAIL = "email"
14
+ EMAIL = "email",
15
+ OAUTH = "oauth"
15
16
  }
16
17
  export declare class User extends BaseEntity {
17
18
  uid?: string;
@@ -31,6 +32,11 @@ export declare class User extends BaseEntity {
31
32
  lockedUntil?: Date;
32
33
  status: UserStatus;
33
34
  isActive: boolean;
35
+ /**
36
+ * Monotonic session epoch. Bumped on logout-all / password / identity revoke.
37
+ * Dual-written to Redis; DB is source of truth after Redis flush.
38
+ */
39
+ sessionEpoch: number;
34
40
  lastLoginAt?: Date;
35
41
  lastSeenAt?: Date;
36
42
  lastActiveAt?: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../../src/modules/users/entities/user.entity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAExD,oBAAY,UAAU;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,SAAS,cAAc;CACvB;AAED,oFAAoF;AACpF,oBAAY,cAAc;IACzB,KAAK,UAAU;IACf,KAAK,UAAU;CACf;AAED,qBACa,IAAK,SAAQ,UAAU;IAUnC,GAAG,CAAC,EAAE,MAAM,CAAC;IAQb,WAAW,CAAC,EAAE,MAAM,CAAC;IAOrB,KAAK,CAAC,EAAE,MAAM,CAAC;IAOf,WAAW,CAAC,EAAE,MAAM,CAAC;IAOrB,UAAU,EAAG,cAAc,CAAC;IAU5B,eAAe,EAAG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UserAuthMethod["EMAIL"] = "email";
31
+ UserAuthMethod["OAUTH"] = "oauth";
31
32
  })(UserAuthMethod || (exports.UserAuthMethod = UserAuthMethod = {}));
32
33
  let User = class User extends base_entity_1.BaseEntity {
33
34
  // ─────────────────────────────────────────────────────────────────────────────
@@ -62,6 +63,11 @@ let User = class User extends base_entity_1.BaseEntity {
62
63
  // ─────────────────────────────────────────────────────────────────────────────
63
64
  // Activity
64
65
  // ─────────────────────────────────────────────────────────────────────────────
66
+ /**
67
+ * Monotonic session epoch. Bumped on logout-all / password / identity revoke.
68
+ * Dual-written to Redis; DB is source of truth after Redis flush.
69
+ */
70
+ sessionEpoch;
65
71
  lastLoginAt;
66
72
  lastSeenAt;
67
73
  lastActiveAt;
@@ -218,6 +224,10 @@ __decorate([
218
224
  }),
219
225
  __metadata("design:type", Boolean)
220
226
  ], User.prototype, "isActive", void 0);
227
+ __decorate([
228
+ (0, typeorm_1.Column)({ name: 'session_epoch', type: 'int', default: 0 }),
229
+ __metadata("design:type", Number)
230
+ ], User.prototype, "sessionEpoch", void 0);
221
231
  __decorate([
222
232
  (0, typeorm_1.Column)({
223
233
  name: 'last_login_at',
@@ -1 +1 @@
1
- {"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../../src/modules/users/entities/user.entity.ts"],"names":[],"mappings":";AAAA,iBAAiB;;;;;;;;;;;;AAEjB,qCAAiF;AAEjF,kEAA8D;AAC9D,sFAA0E;AAC1E,kEAAwD;AAExD,IAAY,UAMX;AAND,WAAY,UAAU;IACrB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;AACxB,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB;AAED,oFAAoF;AACpF,IAAY,cAGX;AAHD,WAAY,cAAc;IACzB,iCAAe,CAAA;IACf,iCAAe,CAAA;AAChB,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAGM,IAAM,IAAI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E,aAAa;QACnB,QAAQ,EAAE,IAAI;KACd,CAAC;8BACoB,IAAI;iDAAC;AAS3B;IAHC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,kCAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE;QACvD,OAAO,EAAE,IAAI;KACb,CAAC;8BACQ,kCAAW;qCAAC;AActB;IAZC,IAAA,oBAAU,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;IAC5C,IAAA,mBAAS,EAAC;QACV,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACX,IAAI,EAAE,SAAS;YACf,oBAAoB,EAAE,IAAI;SAC1B;QACD,iBAAiB,EAAE;YAClB,IAAI,EAAE,SAAS;YACf,oBAAoB,EAAE,IAAI;SAC1B;KACD,CAAC;;mCACa;eA7OH,IAAI;IADhB,IAAA,gBAAM,EAAC,OAAO,CAAC;GACH,IAAI,CA8OhB"}
@@ -17,7 +17,10 @@ export declare class UsersService {
17
17
  private readonly tokenService;
18
18
  private readonly logger;
19
19
  constructor(userRepository: Repository<User>, userProfilesService: UserProfilesService, redis: IORedis, settingsService: SettingsService, notificationDelivery: NotificationDeliveryService | null, tokenService: TokenService | null, logger: StructuredLoggerService);
20
- create(createUserDto: CreateUserDto, manager?: EntityManager): Promise<User>;
20
+ create(createUserDto: CreateUserDto, manager?: EntityManager, opts?: {
21
+ skipUniquenessCheck?: boolean;
22
+ markLoggedIn?: boolean;
23
+ }): Promise<User>;
21
24
  findAll(options?: PaginationOptions & UserFilterDto): Promise<PaginatedResult<UserResponseDto>>;
22
25
  getStats(): Promise<{
23
26
  total: number;
@@ -35,7 +38,9 @@ export declare class UsersService {
35
38
  findByPhoneWithPassword(phoneNumber: string): Promise<User | null>;
36
39
  private normalizeSearchOptions;
37
40
  findBy(options: FindByOptions): Promise<User | null>;
38
- update(id: string, updateUserDto: UpdateUserDto): Promise<User>;
41
+ update(id: string, updateUserDto: UpdateUserDto, opts?: {
42
+ skipIdentitySessionRevoke?: boolean;
43
+ }): Promise<User>;
39
44
  updateLastLogin(id: string, manager?: EntityManager): Promise<void>;
40
45
  updateLastSeen(id: string): Promise<void>;
41
46
  updateLastActive(id: string): Promise<void>;
@@ -46,6 +51,14 @@ export declare class UsersService {
46
51
  resetLoginAttempts(id: string): Promise<void>;
47
52
  verifyEmail(id: string): Promise<User>;
48
53
  verifyPhone(id: string): Promise<User>;
54
+ /** Single UPDATE — use when the caller already holds the user entity. */
55
+ markEmailVerified(id: string, manager?: EntityManager): Promise<void>;
56
+ /** Single UPDATE — use when the caller already holds the user entity. */
57
+ markPhoneVerified(id: string): Promise<void>;
58
+ /** DB session epoch (source of truth after Redis flush). */
59
+ getPersistedSessionEpoch(userId: string): Promise<number>;
60
+ /** Atomically increment persisted session epoch; returns the new value. */
61
+ bumpPersistedSessionEpoch(userId: string): Promise<number>;
49
62
  deactivate(id: string): Promise<User>;
50
63
  activate(id: string): Promise<User>;
51
64
  delete(id: string): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"users.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/users/services/users.service.ts"],"names":[],"mappings":"AAUA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAoB,UAAU,EAAE,MAAM,SAAS,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAE1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EACN,aAAa,EACb,aAA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const ms_1 = __importDefault(require("ms"));
23
23
  const typeorm_2 = require("typeorm");
24
+ const postgres_error_util_1 = require("../../../common/utils/postgres-error.util");
24
25
  const redis_module_1 = require("../../../config/redis.module");
25
26
  const structured_logger_service_1 = require("../../observability/logging/structured-logger.service");
26
27
  const profile_service_1 = require("../../profile/services/profile.service");
@@ -51,9 +52,12 @@ let UsersService = class UsersService {
51
52
  // ─────────────────────────────────────────────────────────────────────────────
52
53
  // Create
53
54
  // ─────────────────────────────────────────────────────────────────────────────
54
- async create(createUserDto, manager) {
55
+ async create(createUserDto, manager, opts) {
55
56
  const repo = manager ? manager.getRepository(user_entity_1.User) : this.userRepository;
56
- await this.validateCreateUserDto(createUserDto, repo);
57
+ await this.validateCreateUserDto(createUserDto, repo, {
58
+ skipUniquenessCheck: opts?.skipUniquenessCheck,
59
+ });
60
+ const now = new Date();
57
61
  const { profile: profileDto, ...userFields } = createUserDto;
58
62
  const user = repo.create({
59
63
  ...userFields,
@@ -61,10 +65,22 @@ let UsersService = class UsersService {
61
65
  phoneNumber: createUserDto.phoneNumber
62
66
  ? this.normalizePhone(createUserDto.phoneNumber)
63
67
  : undefined,
64
- lastSeenAt: new Date(),
65
- lastActiveAt: new Date(),
68
+ emailVerifiedAt: createUserDto.isEmailVerified ? now : undefined,
69
+ phoneVerifiedAt: createUserDto.isPhoneVerified ? now : undefined,
70
+ lastSeenAt: now,
71
+ lastActiveAt: now,
72
+ ...(opts?.markLoggedIn ? { lastLoginAt: now } : {}),
66
73
  });
67
- const savedUser = await repo.save(user);
74
+ let savedUser;
75
+ try {
76
+ savedUser = await repo.save(user);
77
+ }
78
+ catch (err) {
79
+ if ((0, postgres_error_util_1.isPostgresUniqueViolation)(err)) {
80
+ throw new common_1.ConflictException('An account with this email or phone number already exists.');
81
+ }
82
+ throw err;
83
+ }
68
84
  if (profileDto && Object.keys(profileDto).length > 0) {
69
85
  await this.userProfilesService.create(savedUser.id, profileDto, manager);
70
86
  }
@@ -76,6 +92,11 @@ let UsersService = class UsersService {
76
92
  async findAll(options) {
77
93
  const page = options?.page || 1;
78
94
  const limit = options?.limit || 20;
95
+ /** Deep offset pages become expensive — prefer tighter filters beyond this. */
96
+ const MAX_OFFSET_PAGE = 50;
97
+ if (page > MAX_OFFSET_PAGE) {
98
+ throw new common_1.BadRequestException(`Offset page > ${MAX_OFFSET_PAGE} is not supported. Narrow filters or use a lower page.`);
99
+ }
79
100
  const skip = (page - 1) * limit;
80
101
  const qb = this.userRepository
81
102
  .createQueryBuilder('user')
@@ -85,17 +106,21 @@ let UsersService = class UsersService {
85
106
  .take(limit)
86
107
  .orderBy('user.createdAt', 'DESC');
87
108
  if (options?.search?.trim()) {
88
- const term = `%${options.search.trim().toLowerCase()}%`;
89
- qb.andWhere(`
90
- (
91
- LOWER(user.email) LIKE :term
92
- OR LOWER(user.phoneNumber) LIKE :term
93
- OR LOWER(profile.firstName) LIKE :term
94
- OR LOWER(profile.lastName) LIKE :term
95
- OR LOWER(profile.displayName) LIKE :term
96
- OR LOWER(profile.username) LIKE :term
97
- )
98
- `, { term });
109
+ const raw = options.search.trim().toLowerCase().slice(0, 64);
110
+ // Require at least 2 chars; use prefix match so unique indexes can help.
111
+ if (raw.length >= 2) {
112
+ const prefix = `${raw.replace(/[%_]/g, '\\$&')}%`;
113
+ qb.andWhere(`
114
+ (
115
+ user.email LIKE :prefix ESCAPE :esc
116
+ OR user.phoneNumber LIKE :prefix ESCAPE :esc
117
+ OR profile.username LIKE :prefix ESCAPE :esc
118
+ OR LOWER(profile.firstName) LIKE :prefix ESCAPE :esc
119
+ OR LOWER(profile.lastName) LIKE :prefix ESCAPE :esc
120
+ OR LOWER(profile.displayName) LIKE :prefix ESCAPE :esc
121
+ )
122
+ `, { prefix, esc: '\\' });
123
+ }
99
124
  }
100
125
  if (options?.status != null) {
101
126
  qb.andWhere('user.status = :status', {
@@ -181,13 +206,14 @@ let UsersService = class UsersService {
181
206
  async findByEmailWithPassword(email) {
182
207
  if (!email?.trim())
183
208
  return null;
209
+ // Emails are stored lowercased — equality hits the unique index (no LOWER()).
184
210
  return this.userRepository
185
211
  .createQueryBuilder('user')
186
212
  .leftJoinAndSelect('user.profile', 'profile')
187
213
  .leftJoinAndSelect('user.roles', 'roles')
188
214
  .addSelect(['user.passwordHash', 'user.pinHash'])
189
- .where('LOWER(user.email) = LOWER(:email)', {
190
- email: email.trim(),
215
+ .where('user.email = :email', {
216
+ email: email.trim().toLowerCase(),
191
217
  })
192
218
  .getOne();
193
219
  }
@@ -239,7 +265,7 @@ let UsersService = class UsersService {
239
265
  // ─────────────────────────────────────────────────────────────────────────────
240
266
  // Update
241
267
  // ─────────────────────────────────────────────────────────────────────────────
242
- async update(id, updateUserDto) {
268
+ async update(id, updateUserDto, opts) {
243
269
  const user = await this.userRepository.findOne({
244
270
  where: { id },
245
271
  relations: [...USER_RELATIONS],
@@ -252,15 +278,47 @@ let UsersService = class UsersService {
252
278
  if (requestedAuthMethod !== undefined && requestedAuthMethod !== user.authMethod) {
253
279
  throw new common_1.BadRequestException('authMethod cannot be changed after signup');
254
280
  }
281
+ const previousEmail = user.email;
282
+ const previousPhone = user.phoneNumber;
255
283
  Object.assign(user, userFields);
256
284
  if (updateUserDto.email) {
257
- user.email = updateUserDto.email.trim().toLowerCase();
285
+ const nextEmail = updateUserDto.email.trim().toLowerCase();
286
+ user.email = nextEmail;
287
+ if (previousEmail !== nextEmail && updateUserDto.isEmailVerified === undefined) {
288
+ user.isEmailVerified = false;
289
+ user.emailVerifiedAt = undefined;
290
+ }
258
291
  }
259
292
  if (updateUserDto.phoneNumber) {
260
- user.phoneNumber = this.normalizePhone(updateUserDto.phoneNumber);
293
+ const nextPhone = this.normalizePhone(updateUserDto.phoneNumber);
294
+ user.phoneNumber = nextPhone;
295
+ // Admin updates that change phone without explicit verification clear the flag.
296
+ if (previousPhone !== nextPhone && updateUserDto.isPhoneVerified === undefined) {
297
+ user.isPhoneVerified = false;
298
+ user.phoneVerifiedAt = undefined;
299
+ }
300
+ }
301
+ // Explicit verification flags refresh timestamps (e.g. change-email / change-phone).
302
+ if (updateUserDto.isEmailVerified === true) {
303
+ user.isEmailVerified = true;
304
+ user.emailVerifiedAt = new Date();
305
+ }
306
+ if (updateUserDto.isPhoneVerified === true) {
307
+ user.isPhoneVerified = true;
308
+ user.phoneVerifiedAt = new Date();
261
309
  }
262
310
  user.lastActiveAt = new Date();
263
- await this.userRepository.save(user);
311
+ const emailChanged = updateUserDto.email !== undefined && previousEmail !== user.email;
312
+ const phoneChanged = updateUserDto.phoneNumber !== undefined && previousPhone !== user.phoneNumber;
313
+ try {
314
+ await this.userRepository.save(user);
315
+ }
316
+ catch (err) {
317
+ if ((0, postgres_error_util_1.isPostgresUniqueViolation)(err)) {
318
+ throw new common_1.ConflictException('An account with this email or phone number already exists.');
319
+ }
320
+ throw err;
321
+ }
264
322
  if (profileDto && Object.keys(profileDto).length > 0) {
265
323
  const existingProfile = await this.userProfilesService.findByUserId(id);
266
324
  if (existingProfile) {
@@ -273,6 +331,11 @@ let UsersService = class UsersService {
273
331
  });
274
332
  }
275
333
  }
334
+ // Admin identity rebind must invalidate sessions. Self-serve change-* paths
335
+ // pass skipIdentitySessionRevoke and revoke themselves with the right reason.
336
+ if (!opts?.skipIdentitySessionRevoke && (emailChanged || phoneChanged)) {
337
+ await this.tokenService?.revokeAllUserTokens(id, refresh_token_entity_1.RevokeReason.ADMIN);
338
+ }
276
339
  return user;
277
340
  }
278
341
  async updateLastLogin(id, manager) {
@@ -330,25 +393,35 @@ let UsersService = class UsersService {
330
393
  // Verification
331
394
  // ─────────────────────────────────────────────────────────────────────────────
332
395
  async verifyEmail(id) {
333
- const user = await this.userRepository.findOne({ where: { id } });
334
- if (!user) {
335
- throw new common_1.NotFoundException(`User with ID ${id} not found`);
336
- }
337
- user.isEmailVerified = true;
338
- user.emailVerifiedAt = new Date();
339
- await this.userRepository.save(user);
396
+ await this.markEmailVerified(id);
340
397
  return this.findByIdOrFail(id);
341
398
  }
342
399
  async verifyPhone(id) {
343
- const user = await this.userRepository.findOne({ where: { id } });
344
- if (!user) {
345
- throw new common_1.NotFoundException(`User with ID ${id} not found`);
346
- }
347
- user.isPhoneVerified = true;
348
- user.phoneVerifiedAt = new Date();
349
- await this.userRepository.save(user);
400
+ await this.markPhoneVerified(id);
350
401
  return this.findByIdOrFail(id);
351
402
  }
403
+ /** Single UPDATE — use when the caller already holds the user entity. */
404
+ async markEmailVerified(id, manager) {
405
+ const repo = manager?.getRepository(user_entity_1.User) ?? this.userRepository;
406
+ await repo.update({ id, isEmailVerified: false }, { isEmailVerified: true, emailVerifiedAt: new Date() });
407
+ }
408
+ /** Single UPDATE — use when the caller already holds the user entity. */
409
+ async markPhoneVerified(id) {
410
+ await this.userRepository.update({ id, isPhoneVerified: false }, { isPhoneVerified: true, phoneVerifiedAt: new Date() });
411
+ }
412
+ /** DB session epoch (source of truth after Redis flush). */
413
+ async getPersistedSessionEpoch(userId) {
414
+ const row = await this.userRepository.findOne({
415
+ where: { id: userId },
416
+ select: ['id', 'sessionEpoch'],
417
+ });
418
+ return row?.sessionEpoch ?? 0;
419
+ }
420
+ /** Atomically increment persisted session epoch; returns the new value. */
421
+ async bumpPersistedSessionEpoch(userId) {
422
+ await this.userRepository.increment({ id: userId }, 'sessionEpoch', 1);
423
+ return this.getPersistedSessionEpoch(userId);
424
+ }
352
425
  // ─────────────────────────────────────────────────────────────────────────────
353
426
  // Account State
354
427
  // ─────────────────────────────────────────────────────────────────────────────
@@ -394,7 +467,41 @@ let UsersService = class UsersService {
394
467
  if (!user) {
395
468
  throw new common_1.NotFoundException(`User with ID ${id} not found`);
396
469
  }
470
+ // Kill access JWTs immediately (epoch) before soft-delete — JwtStrategy does not load user status.
471
+ if (this.tokenService) {
472
+ await this.tokenService.revokeAllUserTokens(id, refresh_token_entity_1.RevokeReason.LOGOUT);
473
+ }
397
474
  this.notifyAccountDeleted(user);
475
+ // Release email/phone so they can be re-registered (partial unique indexes
476
+ // only apply where deleted_at IS NULL).
477
+ const tombstone = id.replace(/-/g, '').slice(0, 12);
478
+ await this.userRepository
479
+ .createQueryBuilder()
480
+ .update(user_entity_1.User)
481
+ .set({
482
+ email: user.email ? `deleted+${tombstone}@invalid.local` : () => 'NULL',
483
+ phoneNumber: () => 'NULL',
484
+ isEmailVerified: false,
485
+ isPhoneVerified: false,
486
+ emailVerifiedAt: () => 'NULL',
487
+ phoneVerifiedAt: () => 'NULL',
488
+ isActive: false,
489
+ status: user_entity_1.UserStatus.REVOKED,
490
+ })
491
+ .where('id = :id', { id })
492
+ .execute();
493
+ // Release OAuth subjects so the same provider identity can re-register
494
+ // (partial unique indexes apply only where deleted_at IS NULL).
495
+ await this.userRepository.query(`
496
+ UPDATE "user_oauth_identities"
497
+ SET
498
+ "provider_subject" = CONCAT('deleted:', "id"::text),
499
+ "email" = NULL,
500
+ "email_verified" = false,
501
+ "deleted_at" = NOW(),
502
+ "updated_at" = NOW()
503
+ WHERE "user_id" = $1 AND "deleted_at" IS NULL
504
+ `, [id]);
398
505
  await this.userRepository.softDelete(id);
399
506
  }
400
507
  // ─────────────────────────────────────────────────────────────────────────────
@@ -477,7 +584,7 @@ let UsersService = class UsersService {
477
584
  const ttlSeconds = Math.ceil((0, ms_1.default)(ttlString) / 1000);
478
585
  await this.redis.set(`user:banned:${userId}`, '1', 'EX', ttlSeconds);
479
586
  }
480
- async validateCreateUserDto(createUserDto, repo) {
587
+ async validateCreateUserDto(createUserDto, repo, opts) {
481
588
  if (createUserDto.authMethod === user_entity_1.UserAuthMethod.PHONE && !createUserDto.phoneNumber) {
482
589
  throw new common_1.ConflictException('Phone auth requires a phone number.');
483
590
  }
@@ -489,6 +596,14 @@ let UsersService = class UsersService {
489
596
  throw new common_1.ConflictException('Email auth requires a password.');
490
597
  }
491
598
  }
599
+ if (createUserDto.authMethod === user_entity_1.UserAuthMethod.OAUTH) {
600
+ if (!createUserDto.email) {
601
+ throw new common_1.ConflictException('OAuth auth requires an email address.');
602
+ }
603
+ }
604
+ // Registration already fail-fasts uniqueness before password hashing.
605
+ if (opts?.skipUniquenessCheck)
606
+ return;
492
607
  const conditions = [];
493
608
  if (createUserDto.phoneNumber) {
494
609
  conditions.push({