@colveor/core 1.1.0 → 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 +17 -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 +3 -0
  819. package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
  820. package/dist/modules/users/dto/user.dto.js +27 -4
  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
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REALTIME_ENVELOPE_VERSION = exports.REALTIME_ROOM_PREFIX_ALLOWLIST = exports.REALTIME_CLOSE_CODES = exports.REALTIME_SERVER_EVENTS = exports.REALTIME_CLIENT_EVENTS = exports.REALTIME_CONTROL_CHANNEL = exports.presenceKey = exports.familyRoom = exports.userRoom = exports.REALTIME_PATH = void 0;
4
+ /** Engine.IO / Socket.IO HTTP path (not under API prefix). */
5
+ exports.REALTIME_PATH = '/realtime';
6
+ /** Server-assigned room for a user. */
7
+ const userRoom = (userId) => `user:${userId}`;
8
+ exports.userRoom = userRoom;
9
+ /** Server-assigned room for a refresh-token family (force-disconnect). */
10
+ const familyRoom = (familyId) => `family:${familyId}`;
11
+ exports.familyRoom = familyRoom;
12
+ /** Redis presence key. */
13
+ const presenceKey = (userId) => `realtime:presence:${userId}`;
14
+ exports.presenceKey = presenceKey;
15
+ /** Redis pub/sub control channel (cross-instance disconnect / ops). */
16
+ exports.REALTIME_CONTROL_CHANNEL = 'realtime:control';
17
+ /** Handshake / client→server allowlisted events. */
18
+ exports.REALTIME_CLIENT_EVENTS = {
19
+ REAUTH: 'realtime:reauth',
20
+ PING: 'realtime:ping',
21
+ };
22
+ /** Server→client system events. */
23
+ exports.REALTIME_SERVER_EVENTS = {
24
+ READY: 'realtime:ready',
25
+ ERROR: 'realtime:error',
26
+ PONG: 'realtime:pong',
27
+ NOTIFICATION_CREATED: 'notification.created',
28
+ SESSION_REVOKED: 'session.revoked',
29
+ };
30
+ /** Disconnect / error codes exposed to clients. */
31
+ exports.REALTIME_CLOSE_CODES = {
32
+ UNAUTHORIZED: 'UNAUTHORIZED',
33
+ TOKEN_EXPIRED: 'TOKEN_EXPIRED',
34
+ SESSION_REVOKED: 'SESSION_REVOKED',
35
+ RATE_LIMITED: 'RATE_LIMITED',
36
+ PAYLOAD_TOO_LARGE: 'PAYLOAD_TOO_LARGE',
37
+ BAD_EVENT: 'BAD_EVENT',
38
+ };
39
+ /** Allowlisted custom room prefixes hosts may join via RealtimeService. */
40
+ exports.REALTIME_ROOM_PREFIX_ALLOWLIST = ['user:', 'family:', 'tenant:', 'role:'];
41
+ exports.REALTIME_ENVELOPE_VERSION = 1;
42
+ //# sourceMappingURL=realtime.constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime.constants.js","sourceRoot":"","sources":["../../../../src/modules/realtime/constants/realtime.constants.ts"],"names":[],"mappings":";;;AAAA,8DAA8D;AACjD,QAAA,aAAa,GAAG,WAAW,CAAC;AAEzC,uCAAuC;AAChC,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,QAAQ,MAAM,EAAE,CAAC;AAAxD,QAAA,QAAQ,YAAgD;AAErE,0EAA0E;AACnE,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,UAAU,QAAQ,EAAE,CAAC;AAAhE,QAAA,UAAU,cAAsD;AAE7E,0BAA0B;AACnB,MAAM,WAAW,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,qBAAqB,MAAM,EAAE,CAAC;AAAxE,QAAA,WAAW,eAA6D;AAErF,uEAAuE;AAC1D,QAAA,wBAAwB,GAAG,kBAAkB,CAAC;AAE3D,oDAAoD;AACvC,QAAA,sBAAsB,GAAG;IACrC,MAAM,EAAE,iBAAiB;IACzB,IAAI,EAAE,eAAe;CACZ,CAAC;AAEX,mCAAmC;AACtB,QAAA,sBAAsB,GAAG;IACrC,KAAK,EAAE,gBAAgB;IACvB,KAAK,EAAE,gBAAgB;IACvB,IAAI,EAAE,eAAe;IACrB,oBAAoB,EAAE,sBAAsB;IAC5C,eAAe,EAAE,iBAAiB;CACzB,CAAC;AAEX,mDAAmD;AACtC,QAAA,oBAAoB,GAAG;IACnC,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,eAAe,EAAE,iBAAiB;IAClC,YAAY,EAAE,cAAc;IAC5B,iBAAiB,EAAE,mBAAmB;IACtC,SAAS,EAAE,WAAW;CACb,CAAC;AAEX,2EAA2E;AAC9D,QAAA,8BAA8B,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AAEnF,QAAA,yBAAyB,GAAG,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { RealtimeService } from '../services/realtime.service';
2
+ declare class RealtimeBroadcastDto {
3
+ event: string;
4
+ payload: Record<string, unknown>;
5
+ eventId?: string;
6
+ }
7
+ export declare class RealtimeController {
8
+ private readonly realtime;
9
+ constructor(realtime: RealtimeService);
10
+ status(): {
11
+ ready: boolean;
12
+ localConnections: number;
13
+ };
14
+ presence(userId: string): Promise<import("..").RealtimePresence>;
15
+ disconnect(userId: string): void;
16
+ broadcast(body: RealtimeBroadcastDto): Promise<{
17
+ ok: boolean;
18
+ }>;
19
+ }
20
+ export {};
21
+ //# sourceMappingURL=realtime.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/realtime/controllers/realtime.controller.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,cAAM,oBAAoB;IAIzB,KAAK,EAAG,MAAM,CAAC;IAGf,OAAO,EAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAKlC,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAIa,kBAAkB;IAClB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,eAAe;IAKtD,MAAM;;;;IAUN,QAAQ,CAAiC,MAAM,EAAE,MAAM;IAQvD,UAAU,CAAiC,MAAM,EAAE,MAAM,GAAG,IAAI;IAO1D,SAAS,CAAS,IAAI,EAAE,oBAAoB;;;CAMlD"}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.RealtimeController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const swagger_1 = require("@nestjs/swagger");
18
+ const class_validator_1 = require("class-validator");
19
+ const decorators_1 = require("../../../common/decorators");
20
+ const auth_guard_1 = require("../../../common/guards/auth.guard");
21
+ const permissions_guard_1 = require("../../../common/guards/permissions.guard");
22
+ const realtime_manifest_1 = require("../realtime.manifest");
23
+ const realtime_service_1 = require("../services/realtime.service");
24
+ class RealtimeBroadcastDto {
25
+ event;
26
+ payload;
27
+ eventId;
28
+ }
29
+ __decorate([
30
+ (0, class_validator_1.IsString)(),
31
+ (0, class_validator_1.MaxLength)(128),
32
+ (0, class_validator_1.Matches)(/^[a-zA-Z][a-zA-Z0-9_.:-]*$/),
33
+ __metadata("design:type", String)
34
+ ], RealtimeBroadcastDto.prototype, "event", void 0);
35
+ __decorate([
36
+ (0, class_validator_1.IsObject)(),
37
+ __metadata("design:type", Object)
38
+ ], RealtimeBroadcastDto.prototype, "payload", void 0);
39
+ __decorate([
40
+ (0, class_validator_1.IsOptional)(),
41
+ (0, class_validator_1.IsString)(),
42
+ (0, class_validator_1.MaxLength)(128),
43
+ __metadata("design:type", String)
44
+ ], RealtimeBroadcastDto.prototype, "eventId", void 0);
45
+ let RealtimeController = class RealtimeController {
46
+ realtime;
47
+ constructor(realtime) {
48
+ this.realtime = realtime;
49
+ }
50
+ status() {
51
+ return {
52
+ ready: this.realtime.isReady(),
53
+ localConnections: this.realtime.getLocalConnectionCount(),
54
+ };
55
+ }
56
+ presence(userId) {
57
+ return this.realtime.getPresence(userId);
58
+ }
59
+ disconnect(userId) {
60
+ this.realtime.disconnectUser(userId);
61
+ }
62
+ async broadcast(body) {
63
+ const ok = await this.realtime.emitToAll(body.event, body.payload, {
64
+ eventId: body.eventId,
65
+ });
66
+ return { ok };
67
+ }
68
+ };
69
+ exports.RealtimeController = RealtimeController;
70
+ __decorate([
71
+ (0, common_1.Get)('status'),
72
+ (0, decorators_1.RequirePermission)(realtime_manifest_1.REALTIME_PERMISSIONS.READ),
73
+ (0, swagger_1.ApiOperation)({ summary: 'Realtime module status (local connection count)' }),
74
+ __metadata("design:type", Function),
75
+ __metadata("design:paramtypes", []),
76
+ __metadata("design:returntype", void 0)
77
+ ], RealtimeController.prototype, "status", null);
78
+ __decorate([
79
+ (0, common_1.Get)('presence/:userId'),
80
+ (0, decorators_1.RequirePermission)(realtime_manifest_1.REALTIME_PERMISSIONS.READ),
81
+ (0, swagger_1.ApiOperation)({ summary: 'Presence for a user (Redis-backed when scaled)' }),
82
+ __param(0, (0, common_1.Param)('userId', common_1.ParseUUIDPipe)),
83
+ __metadata("design:type", Function),
84
+ __metadata("design:paramtypes", [String]),
85
+ __metadata("design:returntype", void 0)
86
+ ], RealtimeController.prototype, "presence", null);
87
+ __decorate([
88
+ (0, common_1.Post)('disconnect/:userId'),
89
+ (0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
90
+ (0, decorators_1.RequirePermission)(realtime_manifest_1.REALTIME_PERMISSIONS.DISCONNECT),
91
+ (0, swagger_1.ApiOperation)({ summary: 'Force-disconnect all sockets for a user' }),
92
+ __param(0, (0, common_1.Param)('userId', common_1.ParseUUIDPipe)),
93
+ __metadata("design:type", Function),
94
+ __metadata("design:paramtypes", [String]),
95
+ __metadata("design:returntype", void 0)
96
+ ], RealtimeController.prototype, "disconnect", null);
97
+ __decorate([
98
+ (0, common_1.Post)('broadcast'),
99
+ (0, decorators_1.RequirePermission)(realtime_manifest_1.REALTIME_PERMISSIONS.EMIT_ALL),
100
+ (0, swagger_1.ApiOperation)({ summary: 'Broadcast a realtime event to all connected clients' }),
101
+ __param(0, (0, common_1.Body)()),
102
+ __metadata("design:type", Function),
103
+ __metadata("design:paramtypes", [RealtimeBroadcastDto]),
104
+ __metadata("design:returntype", Promise)
105
+ ], RealtimeController.prototype, "broadcast", null);
106
+ exports.RealtimeController = RealtimeController = __decorate([
107
+ (0, swagger_1.ApiTags)('Realtime'),
108
+ (0, swagger_1.ApiBearerAuth)(),
109
+ (0, common_1.Controller)('realtime'),
110
+ (0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard, permissions_guard_1.PermissionsGuard),
111
+ __metadata("design:paramtypes", [realtime_service_1.RealtimeService])
112
+ ], RealtimeController);
113
+ //# sourceMappingURL=realtime.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime.controller.js","sourceRoot":"","sources":["../../../../src/modules/realtime/controllers/realtime.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,6CAAuE;AACvE,qDAAqF;AAErF,2DAA+D;AAC/D,kEAAiE;AACjE,gFAA4E;AAC5E,4DAA4D;AAC5D,mEAA+D;AAE/D,MAAM,oBAAoB;IAIzB,KAAK,CAAU;IAGf,OAAO,CAA2B;IAKlC,OAAO,CAAU;CACjB;AATA;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;IACd,IAAA,yBAAO,EAAC,4BAA4B,CAA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AE,gDAAgD,EAAE,CAAC;IAClE,WAAA,IAAA,cAAK,EAAC,QAAQ,EAAE,sBAAa,CAAC,CAAA;;;;kDAEvC;AAMD;IAJC,IAAA,aAAI,EAAC,oBAAoB,CAAC;IAC1B,IAAA,iBAAQ,EAAC,mBAAU,CAAC,UAAU,CAAC;IAC/B,IAAA,8BAAiB,EAAC,wCAAoB,CAAC,UAAU,CAAC;IAClD,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,yCAAyC,EAAE,CAAC;IACzD,WAAA,IAAA,cAAK,EAAC,QAAQ,EAAE,sBAAa,CAAC,CAAA;;;;oDAEzC;AAKK;IAHL,IAAA,aAAI,EAAC,WAAW,CAAC;IACjB,IAAA,8BAAiB,EAAC,wCAAoB,CAAC,QAAQ,CAAC;IAChD,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,qDAAqD,EAAE,CAAC;IAChE,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,oBAAoB;;mDAKjD;6BApCW,kBAAkB;IAJ9B,IAAA,iBAAO,EAAC,UAAU,CAAC;IACnB,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,UAAU,CAAC;IACtB,IAAA,kBAAS,EAAC,yBAAY,EAAE,oCAAgB,CAAC;qCAEF,kCAAe;GAD1C,kBAAkB,CAqC9B"}
@@ -0,0 +1,42 @@
1
+ import { OnGatewayConnection, OnGatewayDisconnect, OnGatewayInit } from '@nestjs/websockets';
2
+ import type { Server, Socket } from 'socket.io';
3
+ import { MetricsService } from '../../observability/metrics/metrics.service';
4
+ import { SettingsService } from '../../settings/services/settings.service';
5
+ import { RealtimeService } from '../services/realtime.service';
6
+ import { RealtimeHandlerRegistry } from '../services/realtime-handler.registry';
7
+ import { RealtimePresenceService } from '../services/realtime-presence.service';
8
+ import { RealtimeRateLimiterService } from '../services/realtime-rate-limiter.service';
9
+ /**
10
+ * CORS is configured by {@link RedisIoAdapter} from `app.corsOrigin` — do not set
11
+ * `cors: { origin: true }` here (that would loosen production origins).
12
+ */
13
+ export declare class RealtimeGateway implements OnGatewayInit, OnGatewayConnection, OnGatewayDisconnect {
14
+ private readonly realtime;
15
+ private readonly presence;
16
+ private readonly rateLimiter;
17
+ private readonly handlers;
18
+ private readonly settings;
19
+ private readonly metrics?;
20
+ private readonly logger;
21
+ server: Server;
22
+ constructor(realtime: RealtimeService, presence: RealtimePresenceService, rateLimiter: RealtimeRateLimiterService, handlers: RealtimeHandlerRegistry, settings: SettingsService, metrics?: MetricsService | undefined);
23
+ afterInit(server: Server): void;
24
+ handleConnection(client: Socket): Promise<void>;
25
+ handleDisconnect(client: Socket): Promise<void>;
26
+ onPing(client: Socket): Promise<void>;
27
+ onReauth(client: Socket, body: {
28
+ token?: string;
29
+ dpop?: string;
30
+ }): Promise<void>;
31
+ /**
32
+ * Domain inbound events: clients emit the event name; Core dispatches to
33
+ * {@link RealtimeHandlerRegistry} when registered.
34
+ */
35
+ onDomainMessage(client: Socket, body: {
36
+ event?: string;
37
+ payload?: unknown;
38
+ }): Promise<void>;
39
+ private extractToken;
40
+ private requireUser;
41
+ }
42
+ //# sourceMappingURL=realtime.gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime.gateway.d.ts","sourceRoot":"","sources":["../../../../src/modules/realtime/gateway/realtime.gateway.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EAIb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAE7E,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAS3E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CA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,YAAY;IAYpB,OAAO,CAAC,WAAW;CAenB"}
@@ -0,0 +1,289 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var RealtimeGateway_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.RealtimeGateway = void 0;
17
+ const common_1 = require("@nestjs/common");
18
+ const websockets_1 = require("@nestjs/websockets");
19
+ const metrics_service_1 = require("../../observability/metrics/metrics.service");
20
+ const settings_keys_1 = require("../../settings/constants/settings.keys");
21
+ const settings_service_1 = require("../../settings/services/settings.service");
22
+ const realtime_constants_1 = require("../constants/realtime.constants");
23
+ const realtime_service_1 = require("../services/realtime.service");
24
+ const realtime_handler_registry_1 = require("../services/realtime-handler.registry");
25
+ const realtime_presence_service_1 = require("../services/realtime-presence.service");
26
+ const realtime_rate_limiter_service_1 = require("../services/realtime-rate-limiter.service");
27
+ const handshake_error_util_1 = require("../utils/handshake-error.util");
28
+ /**
29
+ * CORS is configured by {@link RedisIoAdapter} from `app.corsOrigin` — do not set
30
+ * `cors: { origin: true }` here (that would loosen production origins).
31
+ */
32
+ let RealtimeGateway = RealtimeGateway_1 = class RealtimeGateway {
33
+ realtime;
34
+ presence;
35
+ rateLimiter;
36
+ handlers;
37
+ settings;
38
+ metrics;
39
+ logger = new common_1.Logger(RealtimeGateway_1.name);
40
+ server;
41
+ constructor(realtime, presence, rateLimiter, handlers, settings, metrics) {
42
+ this.realtime = realtime;
43
+ this.presence = presence;
44
+ this.rateLimiter = rateLimiter;
45
+ this.handlers = handlers;
46
+ this.settings = settings;
47
+ this.metrics = metrics;
48
+ }
49
+ afterInit(server) {
50
+ this.realtime.attachServer(server);
51
+ this.logger.log(`Realtime gateway ready on path ${realtime_constants_1.REALTIME_PATH}`);
52
+ }
53
+ async handleConnection(client) {
54
+ const ip = (typeof client.handshake.headers['x-forwarded-for'] === 'string'
55
+ ? client.handshake.headers['x-forwarded-for'].split(',')[0]?.trim()
56
+ : undefined) ||
57
+ client.handshake.address ||
58
+ 'unknown';
59
+ try {
60
+ if (!(await this.rateLimiter.allowHandshake(ip))) {
61
+ this.metrics?.recordBusinessEvent('realtime', 'handshake', 'rate_limited');
62
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.ERROR, {
63
+ code: realtime_constants_1.REALTIME_CLOSE_CODES.RATE_LIMITED,
64
+ });
65
+ client.disconnect(true);
66
+ return;
67
+ }
68
+ const token = this.extractToken(client);
69
+ if (!token) {
70
+ this.metrics?.recordBusinessEvent('realtime', 'handshake', 'missing_token');
71
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.ERROR, {
72
+ code: realtime_constants_1.REALTIME_CLOSE_CODES.UNAUTHORIZED,
73
+ });
74
+ client.disconnect(true);
75
+ return;
76
+ }
77
+ const host = (typeof client.handshake.headers.host === 'string'
78
+ ? client.handshake.headers.host
79
+ : undefined) || 'localhost';
80
+ const protoHeader = client.handshake.headers['x-forwarded-proto'];
81
+ const proto = typeof protoHeader === 'string'
82
+ ? protoHeader
83
+ : client.handshake.secure
84
+ ? 'https'
85
+ : 'http';
86
+ const dpop = typeof client.handshake.auth?.dpop === 'string'
87
+ ? client.handshake.auth.dpop
88
+ : typeof client.handshake.headers.dpop === 'string'
89
+ ? client.handshake.headers.dpop
90
+ : undefined;
91
+ const data = await this.realtime.authenticateToken(token, {
92
+ method: 'GET',
93
+ uri: this.realtime.buildHandshakeDpopUri(host, proto),
94
+ dpop,
95
+ });
96
+ client.data = data;
97
+ await client.join((0, realtime_constants_1.userRoom)(data.user.id));
98
+ await client.join((0, realtime_constants_1.familyRoom)(data.user.fid));
99
+ await this.presence.addConnection(data.user.id, client.id);
100
+ this.realtime.trackConnect();
101
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.READY, {
102
+ userId: data.user.id,
103
+ path: realtime_constants_1.REALTIME_PATH,
104
+ });
105
+ this.metrics?.recordBusinessEvent('realtime', 'handshake', 'success');
106
+ }
107
+ catch (err) {
108
+ const code = (0, handshake_error_util_1.mapRealtimeHandshakeError)(err);
109
+ this.metrics?.recordBusinessEvent('realtime', 'handshake', 'auth_failed');
110
+ this.logger.debug(`Realtime handshake failed: ${err instanceof Error ? err.message : String(err)}`);
111
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.ERROR, { code });
112
+ client.disconnect(true);
113
+ }
114
+ }
115
+ async handleDisconnect(client) {
116
+ const data = client.data;
117
+ if (data?.user?.id) {
118
+ await this.presence.removeConnection(data.user.id, client.id);
119
+ this.realtime.trackDisconnect();
120
+ }
121
+ }
122
+ async onPing(client) {
123
+ const user = this.requireUser(client);
124
+ if (!(await this.rateLimiter.allowInbound(user.id))) {
125
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.ERROR, {
126
+ code: realtime_constants_1.REALTIME_CLOSE_CODES.RATE_LIMITED,
127
+ });
128
+ return;
129
+ }
130
+ await this.presence.heartbeat(user.id);
131
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.PONG, { at: new Date().toISOString() });
132
+ }
133
+ async onReauth(client, body) {
134
+ const user = this.requireUser(client);
135
+ if (!(await this.rateLimiter.allowInbound(user.id))) {
136
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.ERROR, {
137
+ code: realtime_constants_1.REALTIME_CLOSE_CODES.RATE_LIMITED,
138
+ });
139
+ return;
140
+ }
141
+ const token = typeof body?.token === 'string' ? body.token.trim() : '';
142
+ if (!token) {
143
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.ERROR, {
144
+ code: realtime_constants_1.REALTIME_CLOSE_CODES.UNAUTHORIZED,
145
+ });
146
+ client.disconnect(true);
147
+ return;
148
+ }
149
+ try {
150
+ const host = (typeof client.handshake.headers.host === 'string'
151
+ ? client.handshake.headers.host
152
+ : undefined) || 'localhost';
153
+ const protoHeader = client.handshake.headers['x-forwarded-proto'];
154
+ const proto = typeof protoHeader === 'string'
155
+ ? protoHeader
156
+ : client.handshake.secure
157
+ ? 'https'
158
+ : 'http';
159
+ const data = await this.realtime.authenticateToken(token, {
160
+ method: 'GET',
161
+ uri: this.realtime.buildHandshakeDpopUri(host, proto),
162
+ dpop: typeof body?.dpop === 'string' ? body.dpop : undefined,
163
+ });
164
+ if (data.user.id !== user.id) {
165
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.ERROR, {
166
+ code: realtime_constants_1.REALTIME_CLOSE_CODES.UNAUTHORIZED,
167
+ });
168
+ client.disconnect(true);
169
+ return;
170
+ }
171
+ client.data = data;
172
+ if (data.user.fid !== user.fid) {
173
+ await client.leave((0, realtime_constants_1.familyRoom)(user.fid));
174
+ await client.join((0, realtime_constants_1.familyRoom)(data.user.fid));
175
+ }
176
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.READY, { userId: data.user.id, reauth: true });
177
+ this.metrics?.recordBusinessEvent('realtime', 'reauth', 'success');
178
+ }
179
+ catch (err) {
180
+ const code = (0, handshake_error_util_1.mapRealtimeHandshakeError)(err);
181
+ this.metrics?.recordBusinessEvent('realtime', 'reauth', 'failed');
182
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.ERROR, { code });
183
+ client.disconnect(true);
184
+ }
185
+ }
186
+ /**
187
+ * Domain inbound events: clients emit the event name; Core dispatches to
188
+ * {@link RealtimeHandlerRegistry} when registered.
189
+ */
190
+ async onDomainMessage(client, body) {
191
+ const user = this.requireUser(client);
192
+ if (!(await this.rateLimiter.allowInbound(user.id))) {
193
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.ERROR, {
194
+ code: realtime_constants_1.REALTIME_CLOSE_CODES.RATE_LIMITED,
195
+ });
196
+ return;
197
+ }
198
+ const event = typeof body?.event === 'string' ? body.event.trim() : '';
199
+ if (!event || event.startsWith('realtime:')) {
200
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.ERROR, { code: realtime_constants_1.REALTIME_CLOSE_CODES.BAD_EVENT });
201
+ return;
202
+ }
203
+ const maxBytes = this.settings.get(settings_keys_1.SETTING_KEYS.REALTIME_MAX_PAYLOAD_BYTES);
204
+ const size = Buffer.byteLength(JSON.stringify(body?.payload ?? null), 'utf8');
205
+ if (size > maxBytes) {
206
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.ERROR, {
207
+ code: realtime_constants_1.REALTIME_CLOSE_CODES.PAYLOAD_TOO_LARGE,
208
+ });
209
+ return;
210
+ }
211
+ if (!this.handlers.isRegistered(event)) {
212
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.ERROR, { code: realtime_constants_1.REALTIME_CLOSE_CODES.BAD_EVENT });
213
+ this.metrics?.recordBusinessEvent('realtime', 'inbound', 'unknown_event');
214
+ return;
215
+ }
216
+ await this.handlers.dispatch(event, user, body?.payload, {
217
+ socketId: client.id,
218
+ event,
219
+ });
220
+ this.metrics?.recordBusinessEvent('realtime', 'inbound', 'success');
221
+ }
222
+ extractToken(client) {
223
+ const authToken = client.handshake.auth?.token;
224
+ if (typeof authToken === 'string' && authToken.trim())
225
+ return authToken.trim();
226
+ const header = client.handshake.headers.authorization;
227
+ if (typeof header === 'string' && header.startsWith('Bearer ')) {
228
+ return header.slice('Bearer '.length).trim();
229
+ }
230
+ // Intentionally ignore query-string tokens (ADR 0003).
231
+ return undefined;
232
+ }
233
+ requireUser(client) {
234
+ const data = client.data;
235
+ if (!data?.user?.id) {
236
+ throw new common_1.UnauthorizedException(realtime_constants_1.REALTIME_CLOSE_CODES.UNAUTHORIZED);
237
+ }
238
+ // Soft expiry check — client should reauth; we disconnect if past exp.
239
+ if (data.tokenExp && data.tokenExp * 1000 < Date.now()) {
240
+ client.emit(realtime_constants_1.REALTIME_SERVER_EVENTS.ERROR, {
241
+ code: realtime_constants_1.REALTIME_CLOSE_CODES.TOKEN_EXPIRED,
242
+ });
243
+ client.disconnect(true);
244
+ throw new common_1.UnauthorizedException(realtime_constants_1.REALTIME_CLOSE_CODES.TOKEN_EXPIRED);
245
+ }
246
+ return data.user;
247
+ }
248
+ };
249
+ exports.RealtimeGateway = RealtimeGateway;
250
+ __decorate([
251
+ (0, websockets_1.WebSocketServer)(),
252
+ __metadata("design:type", Function)
253
+ ], RealtimeGateway.prototype, "server", void 0);
254
+ __decorate([
255
+ (0, websockets_1.SubscribeMessage)(realtime_constants_1.REALTIME_CLIENT_EVENTS.PING),
256
+ __param(0, (0, websockets_1.ConnectedSocket)()),
257
+ __metadata("design:type", Function),
258
+ __metadata("design:paramtypes", [Function]),
259
+ __metadata("design:returntype", Promise)
260
+ ], RealtimeGateway.prototype, "onPing", null);
261
+ __decorate([
262
+ (0, websockets_1.SubscribeMessage)(realtime_constants_1.REALTIME_CLIENT_EVENTS.REAUTH),
263
+ __param(0, (0, websockets_1.ConnectedSocket)()),
264
+ __param(1, (0, websockets_1.MessageBody)()),
265
+ __metadata("design:type", Function),
266
+ __metadata("design:paramtypes", [Function, Object]),
267
+ __metadata("design:returntype", Promise)
268
+ ], RealtimeGateway.prototype, "onReauth", null);
269
+ __decorate([
270
+ (0, websockets_1.SubscribeMessage)('message'),
271
+ __param(0, (0, websockets_1.ConnectedSocket)()),
272
+ __param(1, (0, websockets_1.MessageBody)()),
273
+ __metadata("design:type", Function),
274
+ __metadata("design:paramtypes", [Function, Object]),
275
+ __metadata("design:returntype", Promise)
276
+ ], RealtimeGateway.prototype, "onDomainMessage", null);
277
+ exports.RealtimeGateway = RealtimeGateway = RealtimeGateway_1 = __decorate([
278
+ (0, websockets_1.WebSocketGateway)({
279
+ path: realtime_constants_1.REALTIME_PATH,
280
+ }),
281
+ __param(5, (0, common_1.Optional)()),
282
+ __metadata("design:paramtypes", [realtime_service_1.RealtimeService,
283
+ realtime_presence_service_1.RealtimePresenceService,
284
+ realtime_rate_limiter_service_1.RealtimeRateLimiterService,
285
+ realtime_handler_registry_1.RealtimeHandlerRegistry,
286
+ settings_service_1.SettingsService,
287
+ metrics_service_1.MetricsService])
288
+ ], RealtimeGateway);
289
+ //# sourceMappingURL=realtime.gateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime.gateway.js","sourceRoot":"","sources":["../../../../src/modules/realtime/gateway/realtime.gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyE;AACzE,mDAS4B;AAI5B,iFAA6E;AAC7E,0EAAsE;AACtE,+EAA2E;AAC3E,wEAOyC;AACzC,mEAA+D;AAC/D,qFAAgF;AAChF,qFAAgF;AAChF,6FAAuF;AAEvF,wEAA0E;AAE1E;;;GAGG;AAII,IAAM,eAAe,uBAArB,MAAM,eAAe;IAOT;IACA;IACA;IACA;IACA;IACY;IAXb,MAAM,GAAG,IAAI,eAAM,CAAC,iBAAe,CAAC,IAAI,CAAC,CAAC;IAG3D,MAAM,CAAU;IAEhB,YACkB,QAAyB,EACzB,QAAiC,EACjC,WAAuC,EACvC,QAAiC,EACjC,QAAyB,EACb,OAAwB;QALpC,aAAQ,GAAR,QAAQ,CAAiB;QACzB,aAAQ,GAAR,QAAQ,CAAyB;QACjC,gBAAW,GAAX,WAAW,CAA4B;QACvC,aAAQ,GAAR,QAAQ,CAAyB;QACjC,aAAQ,GAAR,QAAQ,CAAiB;QACb,YAAO,GAAP,OAAO,CAAiB;IACnD,CAAC;IAEJ,SAAS,CAAC,MAAc;QACvB,IAAI,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AC;QACrE,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;CACD,CAAA;AAvPY,0CAAe;AAI3B;IADC,IAAA,4BAAe,GAAE;;+CACF;AAmGV;IADL,IAAA,6BAAgB,EAAC,2CAAsB,CAAC,IAAI,CAAC;IAChC,WAAA,IAAA,4BAAe,GAAE,CAAA;;;;6CAU9B;AAGK;IADL,IAAA,6BAAgB,EAAC,2CAAsB,CAAC,MAAM,CAAC;IAE9C,WAAA,IAAA,4BAAe,GAAE,CAAA;IACjB,WAAA,IAAA,wBAAW,GAAE,CAAA;;;;+CAuDd;AAOK;IADL,IAAA,6BAAgB,EAAC,SAAS,CAAC;IAE1B,WAAA,IAAA,4BAAe,GAAE,CAAA;IACjB,WAAA,IAAA,wBAAW,GAAE,CAAA;;;;sDAoCd;0BA1NW,eAAe;IAH3B,IAAA,6BAAgB,EAAC;QACjB,IAAI,EAAE,kCAAa;KACnB,CAAC;IAaC,WAAA,IAAA,iBAAQ,GAAE,CAAA;qCALgB,kCAAe;QACf,mDAAuB;QACpB,0DAA0B;QAC7B,mDAAuB;QACvB,kCAAe;QACH,gCAAc;GAZ1C,eAAe,CAuP3B"}
@@ -0,0 +1,12 @@
1
+ export { installRealtimeIoAdapter, RedisIoAdapter } from './adapters/redis-io.adapter';
2
+ export { familyRoom, REALTIME_CLIENT_EVENTS, REALTIME_CLOSE_CODES, REALTIME_CONTROL_CHANNEL, REALTIME_ENVELOPE_VERSION, REALTIME_PATH, REALTIME_ROOM_PREFIX_ALLOWLIST, REALTIME_SERVER_EVENTS, userRoom, } from './constants/realtime.constants';
3
+ export { RealtimeGateway } from './gateway/realtime.gateway';
4
+ export { REALTIME_PERMISSIONS, manifest as realtimeManifest } from './realtime.manifest';
5
+ export { REALTIME_ENABLED_TOKEN, RealtimeModule, type RealtimeModuleOptions, } from './realtime.module';
6
+ export { RealtimeService } from './services/realtime.service';
7
+ export { RealtimeHandlerRegistry } from './services/realtime-handler.registry';
8
+ export { RealtimePresenceService } from './services/realtime-presence.service';
9
+ export type { RealtimeControlMessage, RealtimeEmitOptions, RealtimeEnvelope, RealtimeInboundHandler, RealtimePresence, RealtimeSocketData, } from './types/realtime.types';
10
+ export { buildEnvelope } from './types/realtime.types';
11
+ export { mapRealtimeHandshakeError } from './utils/handshake-error.util';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/realtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EACN,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,aAAa,EACb,8BAA8B,EAC9B,sBAAsB,EACtB,QAAQ,GACR,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EACN,sBAAsB,EACtB,cAAc,EACd,KAAK,qBAAqB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,YAAY,EACX,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapRealtimeHandshakeError = exports.buildEnvelope = exports.RealtimePresenceService = exports.RealtimeHandlerRegistry = exports.RealtimeService = exports.RealtimeModule = exports.REALTIME_ENABLED_TOKEN = exports.realtimeManifest = exports.REALTIME_PERMISSIONS = exports.RealtimeGateway = exports.userRoom = exports.REALTIME_SERVER_EVENTS = exports.REALTIME_ROOM_PREFIX_ALLOWLIST = exports.REALTIME_PATH = exports.REALTIME_ENVELOPE_VERSION = exports.REALTIME_CONTROL_CHANNEL = exports.REALTIME_CLOSE_CODES = exports.REALTIME_CLIENT_EVENTS = exports.familyRoom = exports.RedisIoAdapter = exports.installRealtimeIoAdapter = void 0;
4
+ var redis_io_adapter_1 = require("./adapters/redis-io.adapter");
5
+ Object.defineProperty(exports, "installRealtimeIoAdapter", { enumerable: true, get: function () { return redis_io_adapter_1.installRealtimeIoAdapter; } });
6
+ Object.defineProperty(exports, "RedisIoAdapter", { enumerable: true, get: function () { return redis_io_adapter_1.RedisIoAdapter; } });
7
+ var realtime_constants_1 = require("./constants/realtime.constants");
8
+ Object.defineProperty(exports, "familyRoom", { enumerable: true, get: function () { return realtime_constants_1.familyRoom; } });
9
+ Object.defineProperty(exports, "REALTIME_CLIENT_EVENTS", { enumerable: true, get: function () { return realtime_constants_1.REALTIME_CLIENT_EVENTS; } });
10
+ Object.defineProperty(exports, "REALTIME_CLOSE_CODES", { enumerable: true, get: function () { return realtime_constants_1.REALTIME_CLOSE_CODES; } });
11
+ Object.defineProperty(exports, "REALTIME_CONTROL_CHANNEL", { enumerable: true, get: function () { return realtime_constants_1.REALTIME_CONTROL_CHANNEL; } });
12
+ Object.defineProperty(exports, "REALTIME_ENVELOPE_VERSION", { enumerable: true, get: function () { return realtime_constants_1.REALTIME_ENVELOPE_VERSION; } });
13
+ Object.defineProperty(exports, "REALTIME_PATH", { enumerable: true, get: function () { return realtime_constants_1.REALTIME_PATH; } });
14
+ Object.defineProperty(exports, "REALTIME_ROOM_PREFIX_ALLOWLIST", { enumerable: true, get: function () { return realtime_constants_1.REALTIME_ROOM_PREFIX_ALLOWLIST; } });
15
+ Object.defineProperty(exports, "REALTIME_SERVER_EVENTS", { enumerable: true, get: function () { return realtime_constants_1.REALTIME_SERVER_EVENTS; } });
16
+ Object.defineProperty(exports, "userRoom", { enumerable: true, get: function () { return realtime_constants_1.userRoom; } });
17
+ var realtime_gateway_1 = require("./gateway/realtime.gateway");
18
+ Object.defineProperty(exports, "RealtimeGateway", { enumerable: true, get: function () { return realtime_gateway_1.RealtimeGateway; } });
19
+ var realtime_manifest_1 = require("./realtime.manifest");
20
+ Object.defineProperty(exports, "REALTIME_PERMISSIONS", { enumerable: true, get: function () { return realtime_manifest_1.REALTIME_PERMISSIONS; } });
21
+ Object.defineProperty(exports, "realtimeManifest", { enumerable: true, get: function () { return realtime_manifest_1.manifest; } });
22
+ var realtime_module_1 = require("./realtime.module");
23
+ Object.defineProperty(exports, "REALTIME_ENABLED_TOKEN", { enumerable: true, get: function () { return realtime_module_1.REALTIME_ENABLED_TOKEN; } });
24
+ Object.defineProperty(exports, "RealtimeModule", { enumerable: true, get: function () { return realtime_module_1.RealtimeModule; } });
25
+ var realtime_service_1 = require("./services/realtime.service");
26
+ Object.defineProperty(exports, "RealtimeService", { enumerable: true, get: function () { return realtime_service_1.RealtimeService; } });
27
+ var realtime_handler_registry_1 = require("./services/realtime-handler.registry");
28
+ Object.defineProperty(exports, "RealtimeHandlerRegistry", { enumerable: true, get: function () { return realtime_handler_registry_1.RealtimeHandlerRegistry; } });
29
+ var realtime_presence_service_1 = require("./services/realtime-presence.service");
30
+ Object.defineProperty(exports, "RealtimePresenceService", { enumerable: true, get: function () { return realtime_presence_service_1.RealtimePresenceService; } });
31
+ var realtime_types_1 = require("./types/realtime.types");
32
+ Object.defineProperty(exports, "buildEnvelope", { enumerable: true, get: function () { return realtime_types_1.buildEnvelope; } });
33
+ var handshake_error_util_1 = require("./utils/handshake-error.util");
34
+ Object.defineProperty(exports, "mapRealtimeHandshakeError", { enumerable: true, get: function () { return handshake_error_util_1.mapRealtimeHandshakeError; } });
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/realtime/index.ts"],"names":[],"mappings":";;;AAAA,gEAAuF;AAA9E,4HAAA,wBAAwB,OAAA;AAAE,kHAAA,cAAc,OAAA;AACjD,qEAUwC;AATvC,gHAAA,UAAU,OAAA;AACV,4HAAA,sBAAsB,OAAA;AACtB,0HAAA,oBAAoB,OAAA;AACpB,8HAAA,wBAAwB,OAAA;AACxB,+HAAA,yBAAyB,OAAA;AACzB,mHAAA,aAAa,OAAA;AACb,oIAAA,8BAA8B,OAAA;AAC9B,4HAAA,sBAAsB,OAAA;AACtB,8GAAA,QAAQ,OAAA;AAET,+DAA6D;AAApD,mHAAA,eAAe,OAAA;AACxB,yDAAyF;AAAhF,yHAAA,oBAAoB,OAAA;AAAE,qHAAA,QAAQ,OAAoB;AAC3D,qDAI2B;AAH1B,yHAAA,sBAAsB,OAAA;AACtB,iHAAA,cAAc,OAAA;AAGf,gEAA8D;AAArD,mHAAA,eAAe,OAAA;AACxB,kFAA+E;AAAtE,oIAAA,uBAAuB,OAAA;AAChC,kFAA+E;AAAtE,oIAAA,uBAAuB,OAAA;AAShC,yDAAuD;AAA9C,+GAAA,aAAa,OAAA;AACtB,qEAAyE;AAAhE,iIAAA,yBAAyB,OAAA"}
@@ -0,0 +1,8 @@
1
+ import type { ModuleManifest } from '../roles/types/manifest.types';
2
+ export declare const REALTIME_PERMISSIONS: {
3
+ readonly READ: "realtime:read";
4
+ readonly DISCONNECT: "realtime:disconnect";
5
+ readonly EMIT_ALL: "realtime:emit-all";
6
+ };
7
+ export declare const manifest: ModuleManifest;
8
+ //# sourceMappingURL=realtime.manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime.manifest.d.ts","sourceRoot":"","sources":["../../../src/modules/realtime/realtime.manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAEpE,eAAO,MAAM,oBAAoB;;;;CAIvB,CAAC;AAEX,eAAO,MAAM,QAAQ,EAAE,cAqBtB,CAAC"}