@colveor/core 1.0.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (837) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +6 -0
  3. package/dist/bootstrap/bootstrap-colveor-app.d.ts.map +1 -1
  4. package/dist/bootstrap/bootstrap-colveor-app.js +22 -3
  5. package/dist/bootstrap/bootstrap-colveor-app.js.map +1 -1
  6. package/dist/common/decorators/index.d.ts +6 -0
  7. package/dist/common/decorators/index.d.ts.map +1 -1
  8. package/dist/common/decorators/index.js +8 -1
  9. package/dist/common/decorators/index.js.map +1 -1
  10. package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts +9 -0
  11. package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts.map +1 -0
  12. package/dist/common/decorators/ip-rate-limit-bucket.decorator.js +12 -0
  13. package/dist/common/decorators/ip-rate-limit-bucket.decorator.js.map +1 -0
  14. package/dist/common/guards/login-ip-rate-limit.guard.d.ts +12 -6
  15. package/dist/common/guards/login-ip-rate-limit.guard.d.ts.map +1 -1
  16. package/dist/common/guards/login-ip-rate-limit.guard.js +65 -21
  17. package/dist/common/guards/login-ip-rate-limit.guard.js.map +1 -1
  18. package/dist/common/guards/otp-ip-rate-limit.guard.d.ts +3 -2
  19. package/dist/common/guards/otp-ip-rate-limit.guard.d.ts.map +1 -1
  20. package/dist/common/guards/otp-ip-rate-limit.guard.js +17 -15
  21. package/dist/common/guards/otp-ip-rate-limit.guard.js.map +1 -1
  22. package/dist/common/guards/permissions.guard.d.ts.map +1 -1
  23. package/dist/common/guards/permissions.guard.js +12 -2
  24. package/dist/common/guards/permissions.guard.js.map +1 -1
  25. package/dist/common/interceptors/timeout.interceptor.d.ts +1 -1
  26. package/dist/common/interceptors/timeout.interceptor.d.ts.map +1 -1
  27. package/dist/common/interceptors/timeout.interceptor.js +5 -1
  28. package/dist/common/interceptors/timeout.interceptor.js.map +1 -1
  29. package/dist/common/interfaces/request-user.d.ts +4 -3
  30. package/dist/common/interfaces/request-user.d.ts.map +1 -1
  31. package/dist/common/utils/cache-version.util.d.ts +12 -0
  32. package/dist/common/utils/cache-version.util.d.ts.map +1 -0
  33. package/dist/common/utils/cache-version.util.js +34 -0
  34. package/dist/common/utils/cache-version.util.js.map +1 -0
  35. package/dist/common/utils/postgres-error.util.d.ts +5 -0
  36. package/dist/common/utils/postgres-error.util.d.ts.map +1 -0
  37. package/dist/common/utils/postgres-error.util.js +13 -0
  38. package/dist/common/utils/postgres-error.util.js.map +1 -0
  39. package/dist/common/utils/singleflight.util.d.ts +6 -0
  40. package/dist/common/utils/singleflight.util.d.ts.map +1 -0
  41. package/dist/common/utils/singleflight.util.js +21 -0
  42. package/dist/common/utils/singleflight.util.js.map +1 -0
  43. package/dist/common/validators/is-exclusive-auth-params.validator.js +1 -1
  44. package/dist/common/validators/is-exclusive-auth-params.validator.js.map +1 -1
  45. package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js +1 -1
  46. package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js.map +1 -1
  47. package/dist/config/app.config.d.ts +38 -0
  48. package/dist/config/app.config.d.ts.map +1 -1
  49. package/dist/config/app.config.js +24 -0
  50. package/dist/config/app.config.js.map +1 -1
  51. package/dist/config/database.config.d.ts +6 -0
  52. package/dist/config/database.config.d.ts.map +1 -1
  53. package/dist/config/database.config.js +3 -0
  54. package/dist/config/database.config.js.map +1 -1
  55. package/dist/config/env-flags.util.d.ts +4 -0
  56. package/dist/config/env-flags.util.d.ts.map +1 -1
  57. package/dist/config/env-flags.util.js +7 -0
  58. package/dist/config/env-flags.util.js.map +1 -1
  59. package/dist/config/env.validation.d.ts +24 -1
  60. package/dist/config/env.validation.d.ts.map +1 -1
  61. package/dist/config/env.validation.js +92 -2
  62. package/dist/config/env.validation.js.map +1 -1
  63. package/dist/config/in-memory-redis.client.d.ts +23 -4
  64. package/dist/config/in-memory-redis.client.d.ts.map +1 -1
  65. package/dist/config/in-memory-redis.client.js +148 -4
  66. package/dist/config/in-memory-redis.client.js.map +1 -1
  67. package/dist/config/redis.module.d.ts.map +1 -1
  68. package/dist/config/redis.module.js +5 -0
  69. package/dist/config/redis.module.js.map +1 -1
  70. package/dist/core.module.d.ts +5 -0
  71. package/dist/core.module.d.ts.map +1 -1
  72. package/dist/core.module.js +5 -0
  73. package/dist/core.module.js.map +1 -1
  74. package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts +7 -0
  75. package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts.map +1 -0
  76. package/dist/database/migrations/1785006199371-auth-mfa-oauth.js +24 -0
  77. package/dist/database/migrations/1785006199371-auth-mfa-oauth.js.map +1 -0
  78. package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts +7 -0
  79. package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts.map +1 -0
  80. package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js +16 -0
  81. package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js.map +1 -0
  82. package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts +7 -0
  83. package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts.map +1 -0
  84. package/dist/database/migrations/1785006199373-auth-gap-fixes.js +14 -0
  85. package/dist/database/migrations/1785006199373-auth-gap-fixes.js.map +1 -0
  86. package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts +13 -0
  87. package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts.map +1 -0
  88. package/dist/database/migrations/1785006199374-auth-sessions-indexes.js +35 -0
  89. package/dist/database/migrations/1785006199374-auth-sessions-indexes.js.map +1 -0
  90. package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts +11 -0
  91. package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts.map +1 -0
  92. package/dist/database/migrations/1785006199375-auth-identity-and-audit.js +60 -0
  93. package/dist/database/migrations/1785006199375-auth-identity-and-audit.js.map +1 -0
  94. package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts +14 -0
  95. package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts.map +1 -0
  96. package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js +39 -0
  97. package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js.map +1 -0
  98. package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts +13 -0
  99. package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts.map +1 -0
  100. package/dist/database/migrations/1785006199377-auth-security-hardening.js +69 -0
  101. package/dist/database/migrations/1785006199377-auth-security-hardening.js.map +1 -0
  102. package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts +11 -0
  103. package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts.map +1 -0
  104. package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js +51 -0
  105. package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js.map +1 -0
  106. package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts +12 -0
  107. package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts.map +1 -0
  108. package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js +37 -0
  109. package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js.map +1 -0
  110. package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts +12 -0
  111. package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts.map +1 -0
  112. package/dist/database/migrations/1785006199380-auth-remaining-gaps.js +74 -0
  113. package/dist/database/migrations/1785006199380-auth-remaining-gaps.js.map +1 -0
  114. package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts +12 -0
  115. package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts.map +1 -0
  116. package/dist/database/migrations/1785006199381-settings-blast-radius.js +52 -0
  117. package/dist/database/migrations/1785006199381-settings-blast-radius.js.map +1 -0
  118. package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts +11 -0
  119. package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts.map +1 -0
  120. package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js +36 -0
  121. package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js.map +1 -0
  122. package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts +12 -0
  123. package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts.map +1 -0
  124. package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js +39 -0
  125. package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js.map +1 -0
  126. package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts +12 -0
  127. package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts.map +1 -0
  128. package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js +39 -0
  129. package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js.map +1 -0
  130. package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts +13 -0
  131. package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts.map +1 -0
  132. package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js +72 -0
  133. package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js.map +1 -0
  134. package/dist/database/migrations/1785006199386-audit-events.d.ts +10 -0
  135. package/dist/database/migrations/1785006199386-audit-events.d.ts.map +1 -0
  136. package/dist/database/migrations/1785006199386-audit-events.js +60 -0
  137. package/dist/database/migrations/1785006199386-audit-events.js.map +1 -0
  138. package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts +10 -0
  139. package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts.map +1 -0
  140. package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js +25 -0
  141. package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js.map +1 -0
  142. package/dist/database/migrations/1785006199388-audit-enterprise.d.ts +11 -0
  143. package/dist/database/migrations/1785006199388-audit-enterprise.d.ts.map +1 -0
  144. package/dist/database/migrations/1785006199388-audit-enterprise.js +157 -0
  145. package/dist/database/migrations/1785006199388-audit-enterprise.js.map +1 -0
  146. package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts +10 -0
  147. package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts.map +1 -0
  148. package/dist/database/migrations/1785006199389-drop-admin-logs.js +38 -0
  149. package/dist/database/migrations/1785006199389-drop-admin-logs.js.map +1 -0
  150. package/dist/database/migrations/1785006199390-audit-hardening.d.ts +14 -0
  151. package/dist/database/migrations/1785006199390-audit-hardening.d.ts.map +1 -0
  152. package/dist/database/migrations/1785006199390-audit-hardening.js +345 -0
  153. package/dist/database/migrations/1785006199390-audit-hardening.js.map +1 -0
  154. package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts +10 -0
  155. package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts.map +1 -0
  156. package/dist/database/migrations/1785006199391-audit-owner-schema-create.js +39 -0
  157. package/dist/database/migrations/1785006199391-audit-owner-schema-create.js.map +1 -0
  158. package/dist/database/migrations/1785006199392-profile-photo-url.d.ts +11 -0
  159. package/dist/database/migrations/1785006199392-profile-photo-url.d.ts.map +1 -0
  160. package/dist/database/migrations/1785006199392-profile-photo-url.js +33 -0
  161. package/dist/database/migrations/1785006199392-profile-photo-url.js.map +1 -0
  162. package/dist/database/migrations/1785006199393-profile-cover-url.d.ts +11 -0
  163. package/dist/database/migrations/1785006199393-profile-cover-url.d.ts.map +1 -0
  164. package/dist/database/migrations/1785006199393-profile-cover-url.js +33 -0
  165. package/dist/database/migrations/1785006199393-profile-cover-url.js.map +1 -0
  166. package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts +11 -0
  167. package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts.map +1 -0
  168. package/dist/database/migrations/1785006199394-profile-is-public-default-false.js +24 -0
  169. package/dist/database/migrations/1785006199394-profile-is-public-default-false.js.map +1 -0
  170. package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts +10 -0
  171. package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts.map +1 -0
  172. package/dist/database/migrations/1785006199395-delivery-scale-indexes.js +35 -0
  173. package/dist/database/migrations/1785006199395-delivery-scale-indexes.js.map +1 -0
  174. package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts +11 -0
  175. package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts.map +1 -0
  176. package/dist/database/migrations/1785006199396-delivery-recipient-index.js +23 -0
  177. package/dist/database/migrations/1785006199396-delivery-recipient-index.js.map +1 -0
  178. package/dist/database/seeds/roles.seed.d.ts +6 -0
  179. package/dist/database/seeds/roles.seed.d.ts.map +1 -1
  180. package/dist/database/seeds/roles.seed.js +22 -5
  181. package/dist/database/seeds/roles.seed.js.map +1 -1
  182. package/dist/database/seeds/settings.seed.d.ts +5 -0
  183. package/dist/database/seeds/settings.seed.d.ts.map +1 -1
  184. package/dist/database/seeds/settings.seed.js +500 -25
  185. package/dist/database/seeds/settings.seed.js.map +1 -1
  186. package/dist/database/seeds/templates/html-template.reader.d.ts +1 -0
  187. package/dist/database/seeds/templates/html-template.reader.d.ts.map +1 -1
  188. package/dist/database/seeds/templates/html-template.reader.js +3 -1
  189. package/dist/database/seeds/templates/html-template.reader.js.map +1 -1
  190. package/dist/database/seeds/templates/html-template.reader.ts +5 -1
  191. package/dist/database/typeorm.util.d.ts.map +1 -1
  192. package/dist/database/typeorm.util.js +6 -0
  193. package/dist/database/typeorm.util.js.map +1 -1
  194. package/dist/index.d.ts +8 -1
  195. package/dist/index.d.ts.map +1 -1
  196. package/dist/index.js +39 -4
  197. package/dist/index.js.map +1 -1
  198. package/dist/modules/admin/controllers/admin.controller.d.ts +15 -7
  199. package/dist/modules/admin/controllers/admin.controller.d.ts.map +1 -1
  200. package/dist/modules/admin/controllers/admin.controller.js +74 -17
  201. package/dist/modules/admin/controllers/admin.controller.js.map +1 -1
  202. package/dist/modules/admin/services/admin-log.service.d.ts +14 -7
  203. package/dist/modules/admin/services/admin-log.service.d.ts.map +1 -1
  204. package/dist/modules/admin/services/admin-log.service.js +41 -38
  205. package/dist/modules/admin/services/admin-log.service.js.map +1 -1
  206. package/dist/modules/audit/audit.manifest.d.ts +8 -0
  207. package/dist/modules/audit/audit.manifest.d.ts.map +1 -0
  208. package/dist/modules/audit/audit.manifest.js +31 -0
  209. package/dist/modules/audit/audit.manifest.js.map +1 -0
  210. package/dist/modules/audit/audit.module.d.ts +8 -0
  211. package/dist/modules/audit/audit.module.d.ts.map +1 -0
  212. package/dist/modules/audit/audit.module.js +57 -0
  213. package/dist/modules/audit/audit.module.js.map +1 -0
  214. package/dist/modules/audit/constants/audit-actions.d.ts +79 -0
  215. package/dist/modules/audit/constants/audit-actions.d.ts.map +1 -0
  216. package/dist/modules/audit/constants/audit-actions.js +89 -0
  217. package/dist/modules/audit/constants/audit-actions.js.map +1 -0
  218. package/dist/modules/audit/constants/audit-mutation.d.ts +10 -0
  219. package/dist/modules/audit/constants/audit-mutation.d.ts.map +1 -0
  220. package/dist/modules/audit/constants/audit-mutation.js +13 -0
  221. package/dist/modules/audit/constants/audit-mutation.js.map +1 -0
  222. package/dist/modules/audit/controllers/audit.controller.d.ts +13 -0
  223. package/dist/modules/audit/controllers/audit.controller.d.ts.map +1 -0
  224. package/dist/modules/audit/controllers/audit.controller.js +149 -0
  225. package/dist/modules/audit/controllers/audit.controller.js.map +1 -0
  226. package/dist/modules/audit/decorators/audit.decorator.d.ts +27 -0
  227. package/dist/modules/audit/decorators/audit.decorator.d.ts.map +1 -0
  228. package/dist/modules/audit/decorators/audit.decorator.js +18 -0
  229. package/dist/modules/audit/decorators/audit.decorator.js.map +1 -0
  230. package/dist/modules/audit/dto/audit.dto.d.ts +54 -0
  231. package/dist/modules/audit/dto/audit.dto.d.ts.map +1 -0
  232. package/dist/modules/audit/dto/audit.dto.js +129 -0
  233. package/dist/modules/audit/dto/audit.dto.js.map +1 -0
  234. package/dist/modules/audit/entities/audit-event.entity.d.ts +33 -0
  235. package/dist/modules/audit/entities/audit-event.entity.d.ts.map +1 -0
  236. package/dist/modules/audit/entities/audit-event.entity.js +125 -0
  237. package/dist/modules/audit/entities/audit-event.entity.js.map +1 -0
  238. package/dist/modules/audit/entities/audit-outbox.entity.d.ts +16 -0
  239. package/dist/modules/audit/entities/audit-outbox.entity.d.ts.map +1 -0
  240. package/dist/modules/audit/entities/audit-outbox.entity.js +65 -0
  241. package/dist/modules/audit/entities/audit-outbox.entity.js.map +1 -0
  242. package/dist/modules/audit/index.d.ts +13 -0
  243. package/dist/modules/audit/index.d.ts.map +1 -0
  244. package/dist/modules/audit/index.js +23 -0
  245. package/dist/modules/audit/index.js.map +1 -0
  246. package/dist/modules/audit/interceptors/audit.interceptor.d.ts +11 -0
  247. package/dist/modules/audit/interceptors/audit.interceptor.d.ts.map +1 -0
  248. package/dist/modules/audit/interceptors/audit.interceptor.js +75 -0
  249. package/dist/modules/audit/interceptors/audit.interceptor.js.map +1 -0
  250. package/dist/modules/audit/listeners/auth-audit.listener.d.ts +31 -0
  251. package/dist/modules/audit/listeners/auth-audit.listener.d.ts.map +1 -0
  252. package/dist/modules/audit/listeners/auth-audit.listener.js +338 -0
  253. package/dist/modules/audit/listeners/auth-audit.listener.js.map +1 -0
  254. package/dist/modules/audit/services/audit-archive.service.d.ts +28 -0
  255. package/dist/modules/audit/services/audit-archive.service.d.ts.map +1 -0
  256. package/dist/modules/audit/services/audit-archive.service.js +132 -0
  257. package/dist/modules/audit/services/audit-archive.service.js.map +1 -0
  258. package/dist/modules/audit/services/audit-hash-backfill.service.d.ts +22 -0
  259. package/dist/modules/audit/services/audit-hash-backfill.service.d.ts.map +1 -0
  260. package/dist/modules/audit/services/audit-hash-backfill.service.js +79 -0
  261. package/dist/modules/audit/services/audit-hash-backfill.service.js.map +1 -0
  262. package/dist/modules/audit/services/audit-leader.service.d.ts +28 -0
  263. package/dist/modules/audit/services/audit-leader.service.d.ts.map +1 -0
  264. package/dist/modules/audit/services/audit-leader.service.js +99 -0
  265. package/dist/modules/audit/services/audit-leader.service.js.map +1 -0
  266. package/dist/modules/audit/services/audit-outbox.worker.d.ts +29 -0
  267. package/dist/modules/audit/services/audit-outbox.worker.d.ts.map +1 -0
  268. package/dist/modules/audit/services/audit-outbox.worker.js +144 -0
  269. package/dist/modules/audit/services/audit-outbox.worker.js.map +1 -0
  270. package/dist/modules/audit/services/audit-partition.service.d.ts +18 -0
  271. package/dist/modules/audit/services/audit-partition.service.d.ts.map +1 -0
  272. package/dist/modules/audit/services/audit-partition.service.js +70 -0
  273. package/dist/modules/audit/services/audit-partition.service.js.map +1 -0
  274. package/dist/modules/audit/services/audit-write.service.d.ts +60 -0
  275. package/dist/modules/audit/services/audit-write.service.d.ts.map +1 -0
  276. package/dist/modules/audit/services/audit-write.service.js +463 -0
  277. package/dist/modules/audit/services/audit-write.service.js.map +1 -0
  278. package/dist/modules/audit/services/audit.service.d.ts +60 -0
  279. package/dist/modules/audit/services/audit.service.d.ts.map +1 -0
  280. package/dist/modules/audit/services/audit.service.js +373 -0
  281. package/dist/modules/audit/services/audit.service.js.map +1 -0
  282. package/dist/modules/audit/utils/audit-hash.util.d.ts +20 -0
  283. package/dist/modules/audit/utils/audit-hash.util.d.ts.map +1 -0
  284. package/dist/modules/audit/utils/audit-hash.util.js +44 -0
  285. package/dist/modules/audit/utils/audit-hash.util.js.map +1 -0
  286. package/dist/modules/auth/auth-core/auth-core.module.d.ts.map +1 -1
  287. package/dist/modules/auth/auth-core/auth-core.module.js +16 -4
  288. package/dist/modules/auth/auth-core/auth-core.module.js.map +1 -1
  289. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts +22 -0
  290. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts.map +1 -0
  291. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js +25 -0
  292. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js.map +1 -0
  293. package/dist/modules/auth/auth-core/services/access-token.validator.d.ts +19 -0
  294. package/dist/modules/auth/auth-core/services/access-token.validator.d.ts.map +1 -0
  295. package/dist/modules/auth/auth-core/services/access-token.validator.js +110 -0
  296. package/dist/modules/auth/auth-core/services/access-token.validator.js.map +1 -0
  297. package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts +10 -0
  298. package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts.map +1 -0
  299. package/dist/modules/auth/auth-core/services/family-denylist.reader.js +44 -0
  300. package/dist/modules/auth/auth-core/services/family-denylist.reader.js.map +1 -0
  301. package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts +10 -0
  302. package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts.map +1 -0
  303. package/dist/modules/auth/auth-core/services/session-epoch.reader.js +44 -0
  304. package/dist/modules/auth/auth-core/services/session-epoch.reader.js.map +1 -0
  305. package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts +7 -8
  306. package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts.map +1 -1
  307. package/dist/modules/auth/auth-core/strategies/jwt.strategy.js +34 -34
  308. package/dist/modules/auth/auth-core/strategies/jwt.strategy.js.map +1 -1
  309. package/dist/modules/auth/auth.manifest.d.ts +6 -0
  310. package/dist/modules/auth/auth.manifest.d.ts.map +1 -1
  311. package/dist/modules/auth/auth.manifest.js +38 -2
  312. package/dist/modules/auth/auth.manifest.js.map +1 -1
  313. package/dist/modules/auth/auth.module.d.ts.map +1 -1
  314. package/dist/modules/auth/auth.module.js +39 -4
  315. package/dist/modules/auth/auth.module.js.map +1 -1
  316. package/dist/modules/auth/controllers/account.controller.d.ts +15 -1
  317. package/dist/modules/auth/controllers/account.controller.d.ts.map +1 -1
  318. package/dist/modules/auth/controllers/account.controller.js +65 -7
  319. package/dist/modules/auth/controllers/account.controller.js.map +1 -1
  320. package/dist/modules/auth/controllers/auth.controller.d.ts +7 -3
  321. package/dist/modules/auth/controllers/auth.controller.d.ts.map +1 -1
  322. package/dist/modules/auth/controllers/auth.controller.js +76 -16
  323. package/dist/modules/auth/controllers/auth.controller.js.map +1 -1
  324. package/dist/modules/auth/controllers/forgot-password.controller.d.ts +4 -2
  325. package/dist/modules/auth/controllers/forgot-password.controller.d.ts.map +1 -1
  326. package/dist/modules/auth/controllers/forgot-password.controller.js +32 -11
  327. package/dist/modules/auth/controllers/forgot-password.controller.js.map +1 -1
  328. package/dist/modules/auth/controllers/mfa.controller.d.ts +18 -0
  329. package/dist/modules/auth/controllers/mfa.controller.d.ts.map +1 -0
  330. package/dist/modules/auth/controllers/mfa.controller.js +192 -0
  331. package/dist/modules/auth/controllers/mfa.controller.js.map +1 -0
  332. package/dist/modules/auth/controllers/oauth.controller.d.ts +22 -0
  333. package/dist/modules/auth/controllers/oauth.controller.d.ts.map +1 -0
  334. package/dist/modules/auth/controllers/oauth.controller.js +192 -0
  335. package/dist/modules/auth/controllers/oauth.controller.js.map +1 -0
  336. package/dist/modules/auth/controllers/otp.controller.d.ts +6 -3
  337. package/dist/modules/auth/controllers/otp.controller.d.ts.map +1 -1
  338. package/dist/modules/auth/controllers/otp.controller.js +32 -33
  339. package/dist/modules/auth/controllers/otp.controller.js.map +1 -1
  340. package/dist/modules/auth/controllers/pin.controller.d.ts.map +1 -1
  341. package/dist/modules/auth/controllers/pin.controller.js +10 -2
  342. package/dist/modules/auth/controllers/pin.controller.js.map +1 -1
  343. package/dist/modules/auth/controllers/session.controller.d.ts +12 -4
  344. package/dist/modules/auth/controllers/session.controller.d.ts.map +1 -1
  345. package/dist/modules/auth/controllers/session.controller.js +130 -31
  346. package/dist/modules/auth/controllers/session.controller.js.map +1 -1
  347. package/dist/modules/auth/dto/auth-config.dto.d.ts +11 -2
  348. package/dist/modules/auth/dto/auth-config.dto.d.ts.map +1 -1
  349. package/dist/modules/auth/dto/auth-config.dto.js +78 -3
  350. package/dist/modules/auth/dto/auth-config.dto.js.map +1 -1
  351. package/dist/modules/auth/dto/index.d.ts +2 -0
  352. package/dist/modules/auth/dto/index.d.ts.map +1 -1
  353. package/dist/modules/auth/dto/index.js +2 -0
  354. package/dist/modules/auth/dto/index.js.map +1 -1
  355. package/dist/modules/auth/dto/login.dto.d.ts +8 -1
  356. package/dist/modules/auth/dto/login.dto.d.ts.map +1 -1
  357. package/dist/modules/auth/dto/login.dto.js +48 -3
  358. package/dist/modules/auth/dto/login.dto.js.map +1 -1
  359. package/dist/modules/auth/dto/mfa.dto.d.ts +61 -0
  360. package/dist/modules/auth/dto/mfa.dto.d.ts.map +1 -0
  361. package/dist/modules/auth/dto/mfa.dto.js +326 -0
  362. package/dist/modules/auth/dto/mfa.dto.js.map +1 -0
  363. package/dist/modules/auth/dto/oauth.dto.d.ts +45 -0
  364. package/dist/modules/auth/dto/oauth.dto.d.ts.map +1 -0
  365. package/dist/modules/auth/dto/oauth.dto.js +249 -0
  366. package/dist/modules/auth/dto/oauth.dto.js.map +1 -0
  367. package/dist/modules/auth/dto/otp.dto.d.ts +3 -1
  368. package/dist/modules/auth/dto/otp.dto.d.ts.map +1 -1
  369. package/dist/modules/auth/dto/otp.dto.js +19 -0
  370. package/dist/modules/auth/dto/otp.dto.js.map +1 -1
  371. package/dist/modules/auth/dto/password.dto.d.ts +28 -0
  372. package/dist/modules/auth/dto/password.dto.d.ts.map +1 -1
  373. package/dist/modules/auth/dto/password.dto.js +191 -5
  374. package/dist/modules/auth/dto/password.dto.js.map +1 -1
  375. package/dist/modules/auth/dto/register.dto.d.ts +1 -0
  376. package/dist/modules/auth/dto/register.dto.d.ts.map +1 -1
  377. package/dist/modules/auth/dto/register.dto.js +1 -0
  378. package/dist/modules/auth/dto/register.dto.js.map +1 -1
  379. package/dist/modules/auth/dto/session.dto.d.ts +20 -0
  380. package/dist/modules/auth/dto/session.dto.d.ts.map +1 -0
  381. package/dist/modules/auth/dto/session.dto.js +98 -0
  382. package/dist/modules/auth/dto/session.dto.js.map +1 -0
  383. package/dist/modules/auth/dto/token.dto.d.ts +38 -1
  384. package/dist/modules/auth/dto/token.dto.d.ts.map +1 -1
  385. package/dist/modules/auth/dto/token.dto.js +21 -1
  386. package/dist/modules/auth/dto/token.dto.js.map +1 -1
  387. package/dist/modules/auth/entities/index.d.ts +2 -0
  388. package/dist/modules/auth/entities/index.d.ts.map +1 -1
  389. package/dist/modules/auth/entities/index.js +2 -0
  390. package/dist/modules/auth/entities/index.js.map +1 -1
  391. package/dist/modules/auth/entities/password-reset-token.entity.d.ts +2 -0
  392. package/dist/modules/auth/entities/password-reset-token.entity.d.ts.map +1 -1
  393. package/dist/modules/auth/entities/password-reset-token.entity.js +6 -0
  394. package/dist/modules/auth/entities/password-reset-token.entity.js.map +1 -1
  395. package/dist/modules/auth/entities/user-mfa.entity.d.ts +19 -0
  396. package/dist/modules/auth/entities/user-mfa.entity.d.ts.map +1 -0
  397. package/dist/modules/auth/entities/user-mfa.entity.js +73 -0
  398. package/dist/modules/auth/entities/user-mfa.entity.js.map +1 -0
  399. package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts +24 -0
  400. package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts.map +1 -0
  401. package/dist/modules/auth/entities/user-oauth-identity.entity.js +84 -0
  402. package/dist/modules/auth/entities/user-oauth-identity.entity.js.map +1 -0
  403. package/dist/modules/auth/events/auth.events.d.ts +84 -19
  404. package/dist/modules/auth/events/auth.events.d.ts.map +1 -1
  405. package/dist/modules/auth/events/auth.events.js +17 -9
  406. package/dist/modules/auth/events/auth.events.js.map +1 -1
  407. package/dist/modules/auth/services/account.service.d.ts +74 -14
  408. package/dist/modules/auth/services/account.service.d.ts.map +1 -1
  409. package/dist/modules/auth/services/account.service.js +247 -31
  410. package/dist/modules/auth/services/account.service.js.map +1 -1
  411. package/dist/modules/auth/services/dpop.service.d.ts +41 -0
  412. package/dist/modules/auth/services/dpop.service.d.ts.map +1 -0
  413. package/dist/modules/auth/services/dpop.service.js +159 -0
  414. package/dist/modules/auth/services/dpop.service.js.map +1 -0
  415. package/dist/modules/auth/services/index.d.ts +2 -0
  416. package/dist/modules/auth/services/index.d.ts.map +1 -1
  417. package/dist/modules/auth/services/index.js +2 -0
  418. package/dist/modules/auth/services/index.js.map +1 -1
  419. package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts +28 -0
  420. package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts.map +1 -0
  421. package/dist/modules/auth/services/legacy-hash-cleanup.service.js +163 -0
  422. package/dist/modules/auth/services/legacy-hash-cleanup.service.js.map +1 -0
  423. package/dist/modules/auth/services/login.service.d.ts +29 -34
  424. package/dist/modules/auth/services/login.service.d.ts.map +1 -1
  425. package/dist/modules/auth/services/login.service.js +173 -61
  426. package/dist/modules/auth/services/login.service.js.map +1 -1
  427. package/dist/modules/auth/services/mfa.service.d.ts +111 -0
  428. package/dist/modules/auth/services/mfa.service.d.ts.map +1 -0
  429. package/dist/modules/auth/services/mfa.service.js +662 -0
  430. package/dist/modules/auth/services/mfa.service.js.map +1 -0
  431. package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts +11 -0
  432. package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts.map +1 -0
  433. package/dist/modules/auth/services/oauth/apple-id-token.verifier.js +56 -0
  434. package/dist/modules/auth/services/oauth/apple-id-token.verifier.js.map +1 -0
  435. package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts +12 -0
  436. package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts.map +1 -0
  437. package/dist/modules/auth/services/oauth/google-id-token.verifier.js +64 -0
  438. package/dist/modules/auth/services/oauth/google-id-token.verifier.js.map +1 -0
  439. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts +11 -0
  440. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts.map +1 -0
  441. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js +76 -0
  442. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js.map +1 -0
  443. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts +16 -0
  444. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts.map +1 -0
  445. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js +92 -0
  446. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js.map +1 -0
  447. package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts +9 -0
  448. package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts.map +1 -0
  449. package/dist/modules/auth/services/oauth/verified-oauth-identity.js +3 -0
  450. package/dist/modules/auth/services/oauth/verified-oauth-identity.js.map +1 -0
  451. package/dist/modules/auth/services/oauth.service.d.ts +83 -0
  452. package/dist/modules/auth/services/oauth.service.d.ts.map +1 -0
  453. package/dist/modules/auth/services/oauth.service.js +471 -0
  454. package/dist/modules/auth/services/oauth.service.js.map +1 -0
  455. package/dist/modules/auth/services/otp-auth.service.d.ts +13 -3
  456. package/dist/modules/auth/services/otp-auth.service.d.ts.map +1 -1
  457. package/dist/modules/auth/services/otp-auth.service.js +41 -7
  458. package/dist/modules/auth/services/otp-auth.service.js.map +1 -1
  459. package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts +22 -0
  460. package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts.map +1 -0
  461. package/dist/modules/auth/services/password-reset-audit-retention.service.js +117 -0
  462. package/dist/modules/auth/services/password-reset-audit-retention.service.js.map +1 -0
  463. package/dist/modules/auth/services/password.service.d.ts +25 -5
  464. package/dist/modules/auth/services/password.service.d.ts.map +1 -1
  465. package/dist/modules/auth/services/password.service.js +154 -20
  466. package/dist/modules/auth/services/password.service.js.map +1 -1
  467. package/dist/modules/auth/services/pin-auth.service.d.ts +10 -3
  468. package/dist/modules/auth/services/pin-auth.service.d.ts.map +1 -1
  469. package/dist/modules/auth/services/pin-auth.service.js +110 -13
  470. package/dist/modules/auth/services/pin-auth.service.js.map +1 -1
  471. package/dist/modules/auth/services/registration.service.d.ts +10 -2
  472. package/dist/modules/auth/services/registration.service.d.ts.map +1 -1
  473. package/dist/modules/auth/services/registration.service.js +113 -25
  474. package/dist/modules/auth/services/registration.service.js.map +1 -1
  475. package/dist/modules/auth/services/turnstile.service.d.ts +17 -0
  476. package/dist/modules/auth/services/turnstile.service.d.ts.map +1 -0
  477. package/dist/modules/auth/services/turnstile.service.js +94 -0
  478. package/dist/modules/auth/services/turnstile.service.js.map +1 -0
  479. package/dist/modules/auth/utils/auth-params.util.d.ts +13 -6
  480. package/dist/modules/auth/utils/auth-params.util.d.ts.map +1 -1
  481. package/dist/modules/auth/utils/auth-params.util.js +27 -4
  482. package/dist/modules/auth/utils/auth-params.util.js.map +1 -1
  483. package/dist/modules/auth/utils/auth-supported.util.d.ts +12 -1
  484. package/dist/modules/auth/utils/auth-supported.util.d.ts.map +1 -1
  485. package/dist/modules/auth/utils/auth-supported.util.js +36 -4
  486. package/dist/modules/auth/utils/auth-supported.util.js.map +1 -1
  487. package/dist/modules/auth/utils/backup-code-hash.util.d.ts +10 -0
  488. package/dist/modules/auth/utils/backup-code-hash.util.d.ts.map +1 -0
  489. package/dist/modules/auth/utils/backup-code-hash.util.js +31 -0
  490. package/dist/modules/auth/utils/backup-code-hash.util.js.map +1 -0
  491. package/dist/modules/auth/utils/backup-codes.util.d.ts +5 -0
  492. package/dist/modules/auth/utils/backup-codes.util.d.ts.map +1 -0
  493. package/dist/modules/auth/utils/backup-codes.util.js +22 -0
  494. package/dist/modules/auth/utils/backup-codes.util.js.map +1 -0
  495. package/dist/modules/auth/utils/dpop.util.d.ts +22 -0
  496. package/dist/modules/auth/utils/dpop.util.d.ts.map +1 -0
  497. package/dist/modules/auth/utils/dpop.util.js +73 -0
  498. package/dist/modules/auth/utils/dpop.util.js.map +1 -0
  499. package/dist/modules/auth/utils/mfa-secret.util.d.ts +22 -0
  500. package/dist/modules/auth/utils/mfa-secret.util.d.ts.map +1 -0
  501. package/dist/modules/auth/utils/mfa-secret.util.js +59 -0
  502. package/dist/modules/auth/utils/mfa-secret.util.js.map +1 -0
  503. package/dist/modules/auth/utils/mfa-verify-params.util.d.ts +26 -0
  504. package/dist/modules/auth/utils/mfa-verify-params.util.d.ts.map +1 -0
  505. package/dist/modules/auth/utils/mfa-verify-params.util.js +49 -0
  506. package/dist/modules/auth/utils/mfa-verify-params.util.js.map +1 -0
  507. package/dist/modules/auth/utils/step-up-purpose.util.d.ts +5 -0
  508. package/dist/modules/auth/utils/step-up-purpose.util.d.ts.map +1 -0
  509. package/dist/modules/auth/utils/step-up-purpose.util.js +18 -0
  510. package/dist/modules/auth/utils/step-up-purpose.util.js.map +1 -0
  511. package/dist/modules/auth/utils/totp.util.d.ts +16 -0
  512. package/dist/modules/auth/utils/totp.util.d.ts.map +1 -0
  513. package/dist/modules/auth/utils/totp.util.js +88 -0
  514. package/dist/modules/auth/utils/totp.util.js.map +1 -0
  515. package/dist/modules/delivery/composers/otp-delivery.composer.d.ts +28 -1
  516. package/dist/modules/delivery/composers/otp-delivery.composer.d.ts.map +1 -1
  517. package/dist/modules/delivery/composers/otp-delivery.composer.js +48 -2
  518. package/dist/modules/delivery/composers/otp-delivery.composer.js.map +1 -1
  519. package/dist/modules/delivery/constants/delivery-worker.constants.d.ts +29 -0
  520. package/dist/modules/delivery/constants/delivery-worker.constants.d.ts.map +1 -0
  521. package/dist/modules/delivery/constants/delivery-worker.constants.js +51 -0
  522. package/dist/modules/delivery/constants/delivery-worker.constants.js.map +1 -0
  523. package/dist/modules/delivery/delivery.module.d.ts.map +1 -1
  524. package/dist/modules/delivery/delivery.module.js +1 -15
  525. package/dist/modules/delivery/delivery.module.js.map +1 -1
  526. package/dist/modules/delivery/entities/notification-delivery-log.entity.d.ts.map +1 -1
  527. package/dist/modules/delivery/entities/notification-delivery-log.entity.js +3 -1
  528. package/dist/modules/delivery/entities/notification-delivery-log.entity.js.map +1 -1
  529. package/dist/modules/delivery/notification-delivery.service.d.ts +12 -1
  530. package/dist/modules/delivery/notification-delivery.service.d.ts.map +1 -1
  531. package/dist/modules/delivery/notification-delivery.service.js +121 -40
  532. package/dist/modules/delivery/notification-delivery.service.js.map +1 -1
  533. package/dist/modules/delivery/processors/delivery-job.runner.d.ts +22 -1
  534. package/dist/modules/delivery/processors/delivery-job.runner.d.ts.map +1 -1
  535. package/dist/modules/delivery/processors/delivery-job.runner.js +144 -42
  536. package/dist/modules/delivery/processors/delivery-job.runner.js.map +1 -1
  537. package/dist/modules/delivery/processors/delivery.processor.d.ts.map +1 -1
  538. package/dist/modules/delivery/processors/delivery.processor.js +6 -1
  539. package/dist/modules/delivery/processors/delivery.processor.js.map +1 -1
  540. package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts +11 -0
  541. package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts.map +1 -1
  542. package/dist/modules/delivery/processors/otp-delivery-job.runner.js +90 -16
  543. package/dist/modules/delivery/processors/otp-delivery-job.runner.js.map +1 -1
  544. package/dist/modules/delivery/processors/otp-delivery.processor.d.ts.map +1 -1
  545. package/dist/modules/delivery/processors/otp-delivery.processor.js +6 -1
  546. package/dist/modules/delivery/processors/otp-delivery.processor.js.map +1 -1
  547. package/dist/modules/delivery/queues/sync-jobs.queue.d.ts +7 -1
  548. package/dist/modules/delivery/queues/sync-jobs.queue.d.ts.map +1 -1
  549. package/dist/modules/delivery/queues/sync-jobs.queue.js +11 -2
  550. package/dist/modules/delivery/queues/sync-jobs.queue.js.map +1 -1
  551. package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts +7 -3
  552. package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts.map +1 -1
  553. package/dist/modules/delivery/services/delivery-audit-retention.service.js +33 -10
  554. package/dist/modules/delivery/services/delivery-audit-retention.service.js.map +1 -1
  555. package/dist/modules/delivery/services/notification-audit.service.d.ts +7 -4
  556. package/dist/modules/delivery/services/notification-audit.service.d.ts.map +1 -1
  557. package/dist/modules/delivery/services/notification-audit.service.js +83 -26
  558. package/dist/modules/delivery/services/notification-audit.service.js.map +1 -1
  559. package/dist/modules/delivery/utils/payload-snapshot.util.d.ts +2 -0
  560. package/dist/modules/delivery/utils/payload-snapshot.util.d.ts.map +1 -1
  561. package/dist/modules/delivery/utils/payload-snapshot.util.js +22 -3
  562. package/dist/modules/delivery/utils/payload-snapshot.util.js.map +1 -1
  563. package/dist/modules/file-upload/controllers/file-upload.controller.d.ts +7 -1
  564. package/dist/modules/file-upload/controllers/file-upload.controller.d.ts.map +1 -1
  565. package/dist/modules/file-upload/controllers/file-upload.controller.js +5 -7
  566. package/dist/modules/file-upload/controllers/file-upload.controller.js.map +1 -1
  567. package/dist/modules/file-upload/dto/file-upload.dto.d.ts +2 -0
  568. package/dist/modules/file-upload/dto/file-upload.dto.d.ts.map +1 -1
  569. package/dist/modules/file-upload/dto/file-upload.dto.js +20 -0
  570. package/dist/modules/file-upload/dto/file-upload.dto.js.map +1 -1
  571. package/dist/modules/file-upload/file-upload.module.d.ts.map +1 -1
  572. package/dist/modules/file-upload/file-upload.module.js +12 -2
  573. package/dist/modules/file-upload/file-upload.module.js.map +1 -1
  574. package/dist/modules/file-upload/services/file-upload.service.d.ts +24 -6
  575. package/dist/modules/file-upload/services/file-upload.service.d.ts.map +1 -1
  576. package/dist/modules/file-upload/services/file-upload.service.js +164 -36
  577. package/dist/modules/file-upload/services/file-upload.service.js.map +1 -1
  578. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts +4 -2
  579. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts.map +1 -1
  580. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js +30 -5
  581. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js.map +1 -1
  582. package/dist/modules/file-upload/utils/image-optimize.util.d.ts.map +1 -1
  583. package/dist/modules/file-upload/utils/image-optimize.util.js +7 -1
  584. package/dist/modules/file-upload/utils/image-optimize.util.js.map +1 -1
  585. package/dist/modules/health/health.controller.d.ts +5 -1
  586. package/dist/modules/health/health.controller.d.ts.map +1 -1
  587. package/dist/modules/health/health.controller.js +57 -3
  588. package/dist/modules/health/health.controller.js.map +1 -1
  589. package/dist/modules/invitations/controllers/invitations.controller.d.ts +19 -4
  590. package/dist/modules/invitations/controllers/invitations.controller.d.ts.map +1 -1
  591. package/dist/modules/invitations/controllers/invitations.controller.js +19 -10
  592. package/dist/modules/invitations/controllers/invitations.controller.js.map +1 -1
  593. package/dist/modules/invitations/dto/invitation.dto.d.ts +13 -0
  594. package/dist/modules/invitations/dto/invitation.dto.d.ts.map +1 -1
  595. package/dist/modules/invitations/dto/invitation.dto.js +69 -2
  596. package/dist/modules/invitations/dto/invitation.dto.js.map +1 -1
  597. package/dist/modules/invitations/services/invitations.service.d.ts +24 -6
  598. package/dist/modules/invitations/services/invitations.service.d.ts.map +1 -1
  599. package/dist/modules/invitations/services/invitations.service.js +96 -20
  600. package/dist/modules/invitations/services/invitations.service.js.map +1 -1
  601. package/dist/modules/jobs/queues/jobs.queue.d.ts +7 -2
  602. package/dist/modules/jobs/queues/jobs.queue.d.ts.map +1 -1
  603. package/dist/modules/jobs/queues/jobs.queue.js +25 -10
  604. package/dist/modules/jobs/queues/jobs.queue.js.map +1 -1
  605. package/dist/modules/notifications/controllers/notifications.controller.d.ts +3 -1
  606. package/dist/modules/notifications/controllers/notifications.controller.d.ts.map +1 -1
  607. package/dist/modules/notifications/controllers/notifications.controller.js +25 -2
  608. package/dist/modules/notifications/controllers/notifications.controller.js.map +1 -1
  609. package/dist/modules/notifications/dto/notification-query.dto.d.ts.map +1 -1
  610. package/dist/modules/notifications/dto/notification-query.dto.js +1 -0
  611. package/dist/modules/notifications/dto/notification-query.dto.js.map +1 -1
  612. package/dist/modules/notifications/entities/device-token.entity.d.ts.map +1 -1
  613. package/dist/modules/notifications/entities/device-token.entity.js +3 -1
  614. package/dist/modules/notifications/entities/device-token.entity.js.map +1 -1
  615. package/dist/modules/notifications/services/fcm.service.d.ts +2 -0
  616. package/dist/modules/notifications/services/fcm.service.d.ts.map +1 -1
  617. package/dist/modules/notifications/services/fcm.service.js +28 -7
  618. package/dist/modules/notifications/services/fcm.service.js.map +1 -1
  619. package/dist/modules/notifications/services/notifications.service.d.ts +16 -3
  620. package/dist/modules/notifications/services/notifications.service.d.ts.map +1 -1
  621. package/dist/modules/notifications/services/notifications.service.js +95 -24
  622. package/dist/modules/notifications/services/notifications.service.js.map +1 -1
  623. package/dist/modules/observability/metrics/metrics.service.d.ts +2 -0
  624. package/dist/modules/observability/metrics/metrics.service.d.ts.map +1 -1
  625. package/dist/modules/observability/metrics/metrics.service.js +11 -0
  626. package/dist/modules/observability/metrics/metrics.service.js.map +1 -1
  627. package/dist/modules/otp/constants/otp.constants.d.ts +7 -5
  628. package/dist/modules/otp/constants/otp.constants.d.ts.map +1 -1
  629. package/dist/modules/otp/constants/otp.constants.js +11 -8
  630. package/dist/modules/otp/constants/otp.constants.js.map +1 -1
  631. package/dist/modules/otp/interfaces/otp.service.interface.d.ts +1 -1
  632. package/dist/modules/otp/interfaces/otp.service.interface.d.ts.map +1 -1
  633. package/dist/modules/otp/otp.service.d.ts +10 -2
  634. package/dist/modules/otp/otp.service.d.ts.map +1 -1
  635. package/dist/modules/otp/otp.service.js +48 -4
  636. package/dist/modules/otp/otp.service.js.map +1 -1
  637. package/dist/modules/otp/services/otp.rate-limiter.d.ts +2 -0
  638. package/dist/modules/otp/services/otp.rate-limiter.d.ts.map +1 -1
  639. package/dist/modules/otp/services/otp.rate-limiter.js +19 -0
  640. package/dist/modules/otp/services/otp.rate-limiter.js.map +1 -1
  641. package/dist/modules/otp/services/otp.session.store.d.ts +9 -3
  642. package/dist/modules/otp/services/otp.session.store.d.ts.map +1 -1
  643. package/dist/modules/otp/services/otp.session.store.js +34 -42
  644. package/dist/modules/otp/services/otp.session.store.js.map +1 -1
  645. package/dist/modules/otp/utils/otp-code-hash.util.d.ts +11 -0
  646. package/dist/modules/otp/utils/otp-code-hash.util.d.ts.map +1 -0
  647. package/dist/modules/otp/utils/otp-code-hash.util.js +68 -0
  648. package/dist/modules/otp/utils/otp-code-hash.util.js.map +1 -0
  649. package/dist/modules/profile/controllers/profile.controller.d.ts +9 -3
  650. package/dist/modules/profile/controllers/profile.controller.d.ts.map +1 -1
  651. package/dist/modules/profile/controllers/profile.controller.js +140 -8
  652. package/dist/modules/profile/controllers/profile.controller.js.map +1 -1
  653. package/dist/modules/profile/dto/create-user-profile.dto.d.ts +10 -0
  654. package/dist/modules/profile/dto/create-user-profile.dto.d.ts.map +1 -1
  655. package/dist/modules/profile/dto/create-user-profile.dto.js +43 -1
  656. package/dist/modules/profile/dto/create-user-profile.dto.js.map +1 -1
  657. package/dist/modules/profile/dto/public-user-profile.dto.d.ts +24 -0
  658. package/dist/modules/profile/dto/public-user-profile.dto.d.ts.map +1 -0
  659. package/dist/modules/profile/dto/public-user-profile.dto.js +115 -0
  660. package/dist/modules/profile/dto/public-user-profile.dto.js.map +1 -0
  661. package/dist/modules/profile/dto/user-profile-response.dto.d.ts +4 -0
  662. package/dist/modules/profile/dto/user-profile-response.dto.d.ts.map +1 -1
  663. package/dist/modules/profile/dto/user-profile-response.dto.js +4 -0
  664. package/dist/modules/profile/dto/user-profile-response.dto.js.map +1 -1
  665. package/dist/modules/profile/dto/username-available.dto.d.ts +6 -0
  666. package/dist/modules/profile/dto/username-available.dto.d.ts.map +1 -0
  667. package/dist/modules/profile/dto/username-available.dto.js +31 -0
  668. package/dist/modules/profile/dto/username-available.dto.js.map +1 -0
  669. package/dist/modules/profile/entities/user-profiles.entity.d.ts +10 -0
  670. package/dist/modules/profile/entities/user-profiles.entity.d.ts.map +1 -1
  671. package/dist/modules/profile/entities/user-profiles.entity.js +29 -1
  672. package/dist/modules/profile/entities/user-profiles.entity.js.map +1 -1
  673. package/dist/modules/profile/index.d.ts +1 -0
  674. package/dist/modules/profile/index.d.ts.map +1 -1
  675. package/dist/modules/profile/index.js +1 -0
  676. package/dist/modules/profile/index.js.map +1 -1
  677. package/dist/modules/profile/profile.manifest.d.ts +2 -2
  678. package/dist/modules/profile/profile.manifest.js +2 -2
  679. package/dist/modules/profile/profile.manifest.js.map +1 -1
  680. package/dist/modules/profile/profile.module.d.ts.map +1 -1
  681. package/dist/modules/profile/profile.module.js +7 -2
  682. package/dist/modules/profile/profile.module.js.map +1 -1
  683. package/dist/modules/profile/services/profile.service.d.ts +56 -4
  684. package/dist/modules/profile/services/profile.service.d.ts.map +1 -1
  685. package/dist/modules/profile/services/profile.service.js +247 -20
  686. package/dist/modules/profile/services/profile.service.js.map +1 -1
  687. package/dist/modules/realtime/adapters/redis-io.adapter.d.ts +26 -0
  688. package/dist/modules/realtime/adapters/redis-io.adapter.d.ts.map +1 -0
  689. package/dist/modules/realtime/adapters/redis-io.adapter.js +124 -0
  690. package/dist/modules/realtime/adapters/redis-io.adapter.js.map +1 -0
  691. package/dist/modules/realtime/constants/realtime.constants.d.ts +36 -0
  692. package/dist/modules/realtime/constants/realtime.constants.d.ts.map +1 -0
  693. package/dist/modules/realtime/constants/realtime.constants.js +42 -0
  694. package/dist/modules/realtime/constants/realtime.constants.js.map +1 -0
  695. package/dist/modules/realtime/controllers/realtime.controller.d.ts +21 -0
  696. package/dist/modules/realtime/controllers/realtime.controller.d.ts.map +1 -0
  697. package/dist/modules/realtime/controllers/realtime.controller.js +113 -0
  698. package/dist/modules/realtime/controllers/realtime.controller.js.map +1 -0
  699. package/dist/modules/realtime/gateway/realtime.gateway.d.ts +42 -0
  700. package/dist/modules/realtime/gateway/realtime.gateway.d.ts.map +1 -0
  701. package/dist/modules/realtime/gateway/realtime.gateway.js +289 -0
  702. package/dist/modules/realtime/gateway/realtime.gateway.js.map +1 -0
  703. package/dist/modules/realtime/index.d.ts +12 -0
  704. package/dist/modules/realtime/index.d.ts.map +1 -0
  705. package/dist/modules/realtime/index.js +35 -0
  706. package/dist/modules/realtime/index.js.map +1 -0
  707. package/dist/modules/realtime/realtime.manifest.d.ts +8 -0
  708. package/dist/modules/realtime/realtime.manifest.d.ts.map +1 -0
  709. package/dist/modules/realtime/realtime.manifest.js +31 -0
  710. package/dist/modules/realtime/realtime.manifest.js.map +1 -0
  711. package/dist/modules/realtime/realtime.module.d.ts +14 -0
  712. package/dist/modules/realtime/realtime.module.d.ts.map +1 -0
  713. package/dist/modules/realtime/realtime.module.js +126 -0
  714. package/dist/modules/realtime/realtime.module.js.map +1 -0
  715. package/dist/modules/realtime/services/realtime-handler.registry.d.ts +16 -0
  716. package/dist/modules/realtime/services/realtime-handler.registry.d.ts.map +1 -0
  717. package/dist/modules/realtime/services/realtime-handler.registry.js +55 -0
  718. package/dist/modules/realtime/services/realtime-handler.registry.js.map +1 -0
  719. package/dist/modules/realtime/services/realtime-presence.service.d.ts +15 -0
  720. package/dist/modules/realtime/services/realtime-presence.service.d.ts.map +1 -0
  721. package/dist/modules/realtime/services/realtime-presence.service.js +86 -0
  722. package/dist/modules/realtime/services/realtime-presence.service.js.map +1 -0
  723. package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts +12 -0
  724. package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts.map +1 -0
  725. package/dist/modules/realtime/services/realtime-rate-limiter.service.js +63 -0
  726. package/dist/modules/realtime/services/realtime-rate-limiter.service.js.map +1 -0
  727. package/dist/modules/realtime/services/realtime.service.d.ts +88 -0
  728. package/dist/modules/realtime/services/realtime.service.d.ts.map +1 -0
  729. package/dist/modules/realtime/services/realtime.service.js +343 -0
  730. package/dist/modules/realtime/services/realtime.service.js.map +1 -0
  731. package/dist/modules/realtime/types/realtime.types.d.ts +50 -0
  732. package/dist/modules/realtime/types/realtime.types.d.ts.map +1 -0
  733. package/dist/modules/realtime/types/realtime.types.js +14 -0
  734. package/dist/modules/realtime/types/realtime.types.js.map +1 -0
  735. package/dist/modules/realtime/utils/handshake-error.util.d.ts +5 -0
  736. package/dist/modules/realtime/utils/handshake-error.util.d.ts.map +1 -0
  737. package/dist/modules/realtime/utils/handshake-error.util.js +45 -0
  738. package/dist/modules/realtime/utils/handshake-error.util.js.map +1 -0
  739. package/dist/modules/roles/controllers/modules.controller.d.ts +4 -3
  740. package/dist/modules/roles/controllers/modules.controller.d.ts.map +1 -1
  741. package/dist/modules/roles/controllers/modules.controller.js +21 -10
  742. package/dist/modules/roles/controllers/modules.controller.js.map +1 -1
  743. package/dist/modules/roles/controllers/permissions.controller.d.ts +4 -3
  744. package/dist/modules/roles/controllers/permissions.controller.d.ts.map +1 -1
  745. package/dist/modules/roles/controllers/permissions.controller.js +21 -10
  746. package/dist/modules/roles/controllers/permissions.controller.js.map +1 -1
  747. package/dist/modules/roles/controllers/roles.controller.d.ts +5 -4
  748. package/dist/modules/roles/controllers/roles.controller.d.ts.map +1 -1
  749. package/dist/modules/roles/controllers/roles.controller.js +26 -13
  750. package/dist/modules/roles/controllers/roles.controller.js.map +1 -1
  751. package/dist/modules/roles/controllers/user-roles.controller.d.ts +3 -2
  752. package/dist/modules/roles/controllers/user-roles.controller.d.ts.map +1 -1
  753. package/dist/modules/roles/controllers/user-roles.controller.js +14 -6
  754. package/dist/modules/roles/controllers/user-roles.controller.js.map +1 -1
  755. package/dist/modules/roles/services/modules.service.d.ts +8 -5
  756. package/dist/modules/roles/services/modules.service.d.ts.map +1 -1
  757. package/dist/modules/roles/services/modules.service.js +58 -12
  758. package/dist/modules/roles/services/modules.service.js.map +1 -1
  759. package/dist/modules/roles/services/permissions.service.d.ts +8 -5
  760. package/dist/modules/roles/services/permissions.service.d.ts.map +1 -1
  761. package/dist/modules/roles/services/permissions.service.js +61 -12
  762. package/dist/modules/roles/services/permissions.service.js.map +1 -1
  763. package/dist/modules/roles/services/roles.service.d.ts +19 -9
  764. package/dist/modules/roles/services/roles.service.d.ts.map +1 -1
  765. package/dist/modules/roles/services/roles.service.js +137 -47
  766. package/dist/modules/roles/services/roles.service.js.map +1 -1
  767. package/dist/modules/roles/services/user-roles.service.d.ts +12 -4
  768. package/dist/modules/roles/services/user-roles.service.d.ts.map +1 -1
  769. package/dist/modules/roles/services/user-roles.service.js +58 -26
  770. package/dist/modules/roles/services/user-roles.service.js.map +1 -1
  771. package/dist/modules/sessions/entities/refresh-token.entity.d.ts +7 -1
  772. package/dist/modules/sessions/entities/refresh-token.entity.d.ts.map +1 -1
  773. package/dist/modules/sessions/entities/refresh-token.entity.js +10 -0
  774. package/dist/modules/sessions/entities/refresh-token.entity.js.map +1 -1
  775. package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts +12 -0
  776. package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts.map +1 -0
  777. package/dist/modules/sessions/entities/revoked-refresh-family.entity.js +46 -0
  778. package/dist/modules/sessions/entities/revoked-refresh-family.entity.js.map +1 -0
  779. package/dist/modules/sessions/services/refresh-token-retention.service.d.ts +20 -0
  780. package/dist/modules/sessions/services/refresh-token-retention.service.d.ts.map +1 -0
  781. package/dist/modules/sessions/services/refresh-token-retention.service.js +97 -0
  782. package/dist/modules/sessions/services/refresh-token-retention.service.js.map +1 -0
  783. package/dist/modules/sessions/services/token.service.d.ts +150 -16
  784. package/dist/modules/sessions/services/token.service.d.ts.map +1 -1
  785. package/dist/modules/sessions/services/token.service.js +505 -74
  786. package/dist/modules/sessions/services/token.service.js.map +1 -1
  787. package/dist/modules/sessions/sessions.module.d.ts.map +1 -1
  788. package/dist/modules/sessions/sessions.module.js +4 -2
  789. package/dist/modules/sessions/sessions.module.js.map +1 -1
  790. package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts +13 -0
  791. package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts.map +1 -0
  792. package/dist/modules/sessions/utils/refresh-token-hash.util.js +37 -0
  793. package/dist/modules/sessions/utils/refresh-token-hash.util.js.map +1 -0
  794. package/dist/modules/settings/constants/settings.defaults.d.ts +57 -3
  795. package/dist/modules/settings/constants/settings.defaults.d.ts.map +1 -1
  796. package/dist/modules/settings/constants/settings.defaults.js +58 -3
  797. package/dist/modules/settings/constants/settings.defaults.js.map +1 -1
  798. package/dist/modules/settings/constants/settings.keys.d.ts +138 -2
  799. package/dist/modules/settings/constants/settings.keys.d.ts.map +1 -1
  800. package/dist/modules/settings/constants/settings.keys.js +140 -2
  801. package/dist/modules/settings/constants/settings.keys.js.map +1 -1
  802. package/dist/modules/settings/controllers/settings.controller.d.ts +5 -1
  803. package/dist/modules/settings/controllers/settings.controller.d.ts.map +1 -1
  804. package/dist/modules/settings/controllers/settings.controller.js +134 -5
  805. package/dist/modules/settings/controllers/settings.controller.js.map +1 -1
  806. package/dist/modules/settings/services/settings.service.d.ts +17 -7
  807. package/dist/modules/settings/services/settings.service.d.ts.map +1 -1
  808. package/dist/modules/settings/services/settings.service.js +80 -14
  809. package/dist/modules/settings/services/settings.service.js.map +1 -1
  810. package/dist/modules/settings/utils/settings-secret.util.d.ts +13 -0
  811. package/dist/modules/settings/utils/settings-secret.util.d.ts.map +1 -0
  812. package/dist/modules/settings/utils/settings-secret.util.js +80 -0
  813. package/dist/modules/settings/utils/settings-secret.util.js.map +1 -0
  814. package/dist/modules/users/controllers/users.controller.d.ts +4 -2
  815. package/dist/modules/users/controllers/users.controller.d.ts.map +1 -1
  816. package/dist/modules/users/controllers/users.controller.js +89 -10
  817. package/dist/modules/users/controllers/users.controller.js.map +1 -1
  818. package/dist/modules/users/dto/user.dto.d.ts +5 -0
  819. package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
  820. package/dist/modules/users/dto/user.dto.js +46 -5
  821. package/dist/modules/users/dto/user.dto.js.map +1 -1
  822. package/dist/modules/users/entities/user.entity.d.ts +7 -1
  823. package/dist/modules/users/entities/user.entity.d.ts.map +1 -1
  824. package/dist/modules/users/entities/user.entity.js +10 -0
  825. package/dist/modules/users/entities/user.entity.js.map +1 -1
  826. package/dist/modules/users/services/users.service.d.ts +15 -2
  827. package/dist/modules/users/services/users.service.d.ts.map +1 -1
  828. package/dist/modules/users/services/users.service.js +152 -37
  829. package/dist/modules/users/services/users.service.js.map +1 -1
  830. package/dist/modules/users/users.module.d.ts.map +1 -1
  831. package/dist/modules/users/users.module.js +1 -2
  832. package/dist/modules/users/users.module.js.map +1 -1
  833. package/package.json +19 -7
  834. package/dist/modules/admin/entities/admin-log.entity.d.ts +0 -20
  835. package/dist/modules/admin/entities/admin-log.entity.d.ts.map +0 -1
  836. package/dist/modules/admin/entities/admin-log.entity.js +0 -65
  837. package/dist/modules/admin/entities/admin-log.entity.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## [1.2.0](https://github.com/colveor/core/compare/v1.1.0...v1.2.0) (2026-07-30)
2
+
3
+ ### Features
4
+
5
+ * add documentation submodule ([d976042](https://github.com/colveor/core/commit/d9760421b5fb831cc23b53b105a3ae3c6a430ca4))
6
+ * add realtime WebSocket support and related configurations ([78546a7](https://github.com/colveor/core/commit/78546a730fddfd015d6deff70f78636105b6c5fb))
7
+ * enhance database configuration and admin controller with caching and audit logging ([a3e2795](https://github.com/colveor/core/commit/a3e27950b6020cf2e34f228953ff7baa210b369e))
8
+ * enhance file upload and profile modules with photo URL management ([0238bdb](https://github.com/colveor/core/commit/0238bdb76fe7bc5ef50b7ccd569e70f38559a54f))
9
+ * enhance PIN management with rate limiting and verification improvements ([64a941a](https://github.com/colveor/core/commit/64a941a6fc47a3781b581dd00201ac5e9144d6bf))
10
+ * enhance profile module with public username lookup and cover photo management ([b24a4b1](https://github.com/colveor/core/commit/b24a4b150d5ab890c62984c7abe2ef6e21f611ef))
11
+ * harden auth with MFA, OAuth, DPoP, and settings locks ([fce2692](https://github.com/colveor/core/commit/fce26923e0fcbf81b1e58d985d81c8f4cf37f12c))
12
+ * implement audit logging across various modules ([3a32fef](https://github.com/colveor/core/commit/3a32fef2fba6c08ecd9b4e7dce1d3206262632e0))
13
+
14
+ ### Bug Fixes
15
+
16
+ * clean up import statements and formatting across multiple files ([2efdbe4](https://github.com/colveor/core/commit/2efdbe4595a768a1ac61ea0641c3eda2092b089d))
17
+
18
+ ## [1.1.0](https://github.com/colveor/core/compare/v1.0.1...v1.1.0) (2026-07-24)
19
+
20
+ ### Features
21
+
22
+ * expose firstName/lastName on UserResponseDto ([d672bf8](https://github.com/colveor/core/commit/d672bf8249b3a8f46c55b71918e8b10a7bb3c68f))
23
+
1
24
  ## [1.0.1](https://github.com/colveor/core/compare/v1.0.0...v1.0.1) (2026-07-20)
2
25
 
3
26
  ### Bug Fixes
package/README.md CHANGED
@@ -78,6 +78,12 @@ npm run build
78
78
 
79
79
  Shared tooling comes from [`@colveor/devkit`](https://github.com/colveor/devkit).
80
80
 
81
+ ## Documentation
82
+
83
+ Ecosystem docs live under [`documentation/`](documentation/readme.md) (products, guides, tutorials, architecture).
84
+
85
+ Start with [Core introduction](documentation/products/core/introduction.md) or [Creating your first app](documentation/guides/creating-your-first-app.md).
86
+
81
87
  ## Related packages
82
88
 
83
89
  | Package | Purpose |
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-colveor-app.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bootstrap-colveor-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,IAAI,EAAkB,MAAM,gBAAgB,CAAC;AAGxF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAUvE,OAAO,KAAK,EAAE,uBAAuB,EAA4B,MAAM,mBAAmB,CAAC;AAqB3F;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,CACxC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EACxB,OAAO,GAAE,uBAA4B,GACnC,OAAO,CAAC,sBAAsB,CAAC,CAuDjC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC5B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EACxB,OAAO,GAAE,uBAA4B,GACnC,IAAI,CAQN"}
1
+ {"version":3,"file":"bootstrap-colveor-app.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bootstrap-colveor-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,IAAI,EAAkB,MAAM,gBAAgB,CAAC;AAGxF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAWvE,OAAO,KAAK,EAAE,uBAAuB,EAA4B,MAAM,mBAAmB,CAAC;AAiC3F;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,CACxC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EACxB,OAAO,GAAE,uBAA4B,GACnC,OAAO,CAAC,sBAAsB,CAAC,CAyDjC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC5B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EACxB,OAAO,GAAE,uBAA4B,GACnC,IAAI,CAQN"}
@@ -15,9 +15,22 @@ const middlewares_1 = require("../common/middlewares");
15
15
  const validation_1 = require("../common/utils/validation");
16
16
  const env_flags_util_1 = require("../config/env-flags.util");
17
17
  const observability_1 = require("../modules/observability");
18
+ const realtime_1 = require("../modules/realtime");
18
19
  const logger_utils_1 = require("./logger.utils");
19
20
  const metrics_prefix_alias_middleware_1 = require("./metrics-prefix-alias.middleware");
20
21
  const observability_bootstrap_1 = require("./observability.bootstrap");
22
+ async function installRealtimeAdapterIfEnabled(app) {
23
+ try {
24
+ const enabled = app.get(realtime_1.REALTIME_ENABLED_TOKEN, { strict: false });
25
+ if (enabled === true) {
26
+ await (0, realtime_1.installRealtimeIoAdapter)(app);
27
+ new common_1.Logger('Bootstrap').log('Realtime Socket.IO adapter installed');
28
+ }
29
+ }
30
+ catch {
31
+ // Realtime module not registered
32
+ }
33
+ }
21
34
  // ─── Defaults ─────────────────────────────────────────────────────────────────
22
35
  const DEFAULT_PREFIX_EXCLUDE = [
23
36
  '/',
@@ -54,6 +67,7 @@ async function bootstrapColveorApp(appModule, options = {}) {
54
67
  const app = await core_1.NestFactory.create(appModule, {
55
68
  logger: loggerLevels,
56
69
  });
70
+ await installRealtimeAdapterIfEnabled(app);
57
71
  await options.beforeConfigure?.(app);
58
72
  const configService = app.get(config_1.ConfigService);
59
73
  const configNamespace = options.configNamespace ?? 'app';
@@ -61,7 +75,7 @@ async function bootstrapColveorApp(appModule, options = {}) {
61
75
  const port = configService.get(getKey('port'), options.defaultPort ?? 3001);
62
76
  const apiPrefix = configService.get(getKey('apiPrefix'), options.defaultApiPrefix ?? 'api/v1');
63
77
  const nodeEnv = configService.get(getKey('nodeEnv'), 'development');
64
- configureTrustProxy(app, options);
78
+ configureTrustProxy(app, options, nodeEnv);
65
79
  configureMiddleware(app, options, nodeEnv);
66
80
  configureRequestId(app, options);
67
81
  configureGlobalPrefix(app, apiPrefix, options);
@@ -98,8 +112,13 @@ function runColveorApp(appModule, options = {}) {
98
112
  });
99
113
  }
100
114
  // ─── Configuration Helpers ────────────────────────────────────────────────────
101
- function configureTrustProxy(app, options) {
102
- app.set('trust proxy', options.trustProxy ?? 1);
115
+ function configureTrustProxy(app, options, nodeEnv) {
116
+ const value = options.trustProxy ?? 1;
117
+ if (nodeEnv === 'production' && (value === false || value === 0)) {
118
+ throw new Error('trust proxy must be enabled in production (IP rate limits and audit depend on req.ip). ' +
119
+ 'Pass trustProxy: 1 (or hop count) to runColveorApp / bootstrapColveorApp.');
120
+ }
121
+ app.set('trust proxy', value);
103
122
  }
104
123
  function configureMiddleware(app, options, nodeEnv) {
105
124
  if (options.helmet !== false) {
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-colveor-app.js","sourceRoot":"","sources":["../../src/bootstrap/bootstrap-colveor-app.ts"],"names":[],"mappings":";;;;;AAmDA,kDA0DC;AAOD,sCAWC;AA/HD,2CAAwF;AACxF,2CAA+C;AAC/C,uCAA2C;AAE3C,6CAAiE;AAEjE,8DAAsC;AACtC,oDAA4B;AAE5B,uDAA4D;AAC5D,2DAA0E;AAC1E,6DAAkE;AAClE,4DAA0E;AAE1E,iDAAiD;AACjD,uFAAuF;AACvF,uEAAiE;AAEjE,iFAAiF;AAEjF,MAAM,sBAAsB,GAAG;IAC9B,GAAG;IACH,QAAQ;IACR,MAAM;IACN,WAAW;IACX,SAAS;IACT,iBAAiB;IACjB,kBAAkB;CAClB,CAAC;AAEF,MAAM,oBAAoB,GAAG,wCAAwC,CAAC;AAEtE,iFAAiF;AAEjF;;;;;;;;;;;;;;;;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uB,CAC/B,GAA2B,EAC3B,OAAgC;IAEhC,MAAM,MAAM,GAAG,GAAG,CAAC,aAAa,EAAE,CAAC;IACnC,MAAM,CAAC,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,IAAI,MAAM,CAAC;IAC/D,MAAM,CAAC,cAAc,GAAG,OAAO,CAAC,gBAAgB,IAAI,MAAM,CAAC;AAC5D,CAAC;AAeD,SAAS,oBAAoB,CAAC,EAC7B,MAAM,EACN,aAAa,EACb,IAAI,EACJ,SAAS,EACT,OAAO,EACP,cAAc,EACd,WAAW,EACX,eAAe,GACc;IAC7B,MAAM,OAAO,GACZ,aAAa,CAAC,GAAG,CAAS,GAAG,eAAe,MAAM,CAAC,IAAI,oBAAoB,IAAI,EAAE,CAAC;IAEnF,MAAM,gBAAgB,GAAG,aAAa,CAAC,GAAG,CACzC,GAAG,eAAe,mBAAmB,EACrC,MAAM,CACN,CAAC;IAEF,MAAM,CAAC,GAAG,CAAC,8BAA8B,OAAO,IAAI,SAAS,EAAE,CAAC,CAAC;IACjE,MAAM,CAAC,GAAG,CAAC,gBAAgB,OAAO,EAAE,CAAC,CAAC;IACtC,MAAM,CAAC,GAAG,CAAC,oBAAoB,gBAAgB,IAAI,CAAC,CAAC;IACrD,MAAM,CAAC,GAAG,CAAC,YAAY,OAAO,UAAU,CAAC,CAAC;IAC1C,MAAM,CAAC,GAAG,CAAC,iBAAiB,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;AAC1F,CAAC"}
@@ -3,6 +3,12 @@ export declare const IS_PUBLIC_KEY = "isPublic";
3
3
  export declare const Public: () => import("@nestjs/common").CustomDecorator<string>;
4
4
  export declare const PERMISSIONS_KEY = "permissions";
5
5
  export declare const RequirePermission: (...permissions: string[]) => import("@nestjs/common").CustomDecorator<string>;
6
+ /**
7
+ * Intentional JWT-only route (no permission slug).
8
+ * Required when PermissionsGuard is fail-closed and the handler has no @RequirePermission.
9
+ */
10
+ export declare const ALLOW_AUTHENTICATED_KEY = "allowAuthenticated";
11
+ export declare const AllowAuthenticated: () => import("@nestjs/common").CustomDecorator<string>;
6
12
  export declare const IpAddress: (...dataOrPipes: unknown[]) => ParameterDecorator;
7
13
  export declare const UserAgent: (...dataOrPipes: unknown[]) => ParameterDecorator;
8
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/decorators/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,qMAMvB,CAAC;AAGF,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,MAAM,wDAAyC,CAAC;AAG7D,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,iBAAiB,GAAI,GAAG,aAAa,MAAM,EAAE,qDAChB,CAAC;AAG3C,eAAO,MAAM,SAAS,mDAQpB,CAAC;AAGH,eAAO,MAAM,SAAS,mDAGpB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/decorators/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,qMAMvB,CAAC;AAGF,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,MAAM,wDAAyC,CAAC;AAG7D,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,iBAAiB,GAAI,GAAG,aAAa,MAAM,EAAE,qDAChB,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAC5D,eAAO,MAAM,kBAAkB,wDAAmD,CAAC;AAGnF,eAAO,MAAM,SAAS,mDAQpB,CAAC;AAGH,eAAO,MAAM,SAAS,mDAGpB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserAgent = exports.IpAddress = exports.RequirePermission = exports.PERMISSIONS_KEY = exports.Public = exports.IS_PUBLIC_KEY = exports.CurrentUser = void 0;
3
+ exports.UserAgent = exports.IpAddress = exports.AllowAuthenticated = exports.ALLOW_AUTHENTICATED_KEY = exports.RequirePermission = exports.PERMISSIONS_KEY = exports.Public = exports.IS_PUBLIC_KEY = exports.CurrentUser = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  // Current user decorator - extracts user from request
6
6
  exports.CurrentUser = (0, common_1.createParamDecorator)((data, ctx) => {
@@ -16,6 +16,13 @@ exports.Public = Public;
16
16
  exports.PERMISSIONS_KEY = 'permissions';
17
17
  const RequirePermission = (...permissions) => (0, common_1.SetMetadata)(exports.PERMISSIONS_KEY, permissions);
18
18
  exports.RequirePermission = RequirePermission;
19
+ /**
20
+ * Intentional JWT-only route (no permission slug).
21
+ * Required when PermissionsGuard is fail-closed and the handler has no @RequirePermission.
22
+ */
23
+ exports.ALLOW_AUTHENTICATED_KEY = 'allowAuthenticated';
24
+ const AllowAuthenticated = () => (0, common_1.SetMetadata)(exports.ALLOW_AUTHENTICATED_KEY, true);
25
+ exports.AllowAuthenticated = AllowAuthenticated;
19
26
  // IP address decorator
20
27
  exports.IpAddress = (0, common_1.createParamDecorator)((_data, ctx) => {
21
28
  const request = ctx.switchToHttp().getRequest();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/decorators/index.ts"],"names":[],"mappings":";;;AAAA,2CAA0F;AAO1F,sDAAsD;AACzC,QAAA,WAAW,GAAG,IAAA,6BAAoB,EAC9C,CAAC,IAAwB,EAAE,GAAqB,EAAE,EAAE;IACnD,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAwB,CAAC;IACtE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACnC,CAAC,CACD,CAA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IACrD,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;QAC3C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAClE,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IACpC,CAAC;IACD,OAAO,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC;AACpD,CAAC,CAAC,CAAC;AAEH,uBAAuB;AACV,QAAA,SAAS,GAAG,IAAA,6BAAoB,EAAC,CAAC,KAAc,EAAE,GAAqB,EAAE,EAAE;IACvF,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAW,CAAC;IACzD,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AACtC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** Rate-limit bucket for {@link LoginIpRateLimitGuard}. */
2
+ export type IpRateLimitBucket = 'login' | 'refresh' | 'auth_public' | 'profile_public';
3
+ export declare const IP_RATE_LIMIT_BUCKET_KEY = "ip_rate_limit_bucket";
4
+ /**
5
+ * Selects which IP rate-limit settings / Redis key prefix the guard uses.
6
+ * Default (no decorator) = `login`.
7
+ */
8
+ export declare const IpRateLimitBucket: (bucket: IpRateLimitBucket) => import("@nestjs/common").CustomDecorator<string>;
9
+ //# sourceMappingURL=ip-rate-limit-bucket.decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ip-rate-limit-bucket.decorator.d.ts","sourceRoot":"","sources":["../../../src/common/decorators/ip-rate-limit-bucket.decorator.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAEvF,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,iBAAiB,qDACb,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IpRateLimitBucket = exports.IP_RATE_LIMIT_BUCKET_KEY = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ exports.IP_RATE_LIMIT_BUCKET_KEY = 'ip_rate_limit_bucket';
6
+ /**
7
+ * Selects which IP rate-limit settings / Redis key prefix the guard uses.
8
+ * Default (no decorator) = `login`.
9
+ */
10
+ const IpRateLimitBucket = (bucket) => (0, common_1.SetMetadata)(exports.IP_RATE_LIMIT_BUCKET_KEY, bucket);
11
+ exports.IpRateLimitBucket = IpRateLimitBucket;
12
+ //# sourceMappingURL=ip-rate-limit-bucket.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ip-rate-limit-bucket.decorator.js","sourceRoot":"","sources":["../../../src/common/decorators/ip-rate-limit-bucket.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAKhC,QAAA,wBAAwB,GAAG,sBAAsB,CAAC;AAE/D;;;GAGG;AACI,MAAM,iBAAiB,GAAG,CAAC,MAAyB,EAAE,EAAE,CAC9D,IAAA,oBAAW,EAAC,gCAAwB,EAAE,MAAM,CAAC,CAAC;AADlC,QAAA,iBAAiB,qBACiB"}
@@ -1,18 +1,24 @@
1
1
  import { CanActivate, ExecutionContext } from '@nestjs/common';
2
+ import { ConfigService } from '@nestjs/config';
3
+ import { Reflector } from '@nestjs/core';
2
4
  import IORedis from 'ioredis';
3
5
  import { SettingsService } from '../../modules/settings/services/settings.service';
4
6
  /**
5
- * Per-IP rate limit guard for the login endpoint.
7
+ * Per-IP rate limit guard for public auth endpoints.
6
8
  *
7
- * Prevents credential-stuffing and brute-force attacks from a single IP.
8
- * Limits are read live from SettingsService so they can be tuned without
9
- * a redeploy.
9
+ * Bucket selected via {@link IpRateLimitBucket} metadata (default: `login`):
10
+ * - `login` — credential stuffing protection (login / MFA verify / OAuth callback)
11
+ * - `refresh` — higher budget for mobile token rotation
12
+ * - `auth_public` — register / forgot-password / OAuth start
13
+ * - `profile_public` — public username profile lookup
10
14
  */
11
15
  export declare class LoginIpRateLimitGuard implements CanActivate {
12
16
  private readonly redis;
13
17
  private readonly settingsService;
14
- constructor(redis: IORedis, settingsService: SettingsService);
18
+ private readonly reflector;
19
+ private readonly configService;
20
+ constructor(redis: IORedis, settingsService: SettingsService, reflector: Reflector, configService: ConfigService);
15
21
  canActivate(context: ExecutionContext): Promise<boolean>;
16
- private extractIp;
22
+ private resolveBucket;
17
23
  }
18
24
  //# sourceMappingURL=login-ip-rate-limit.guard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"login-ip-rate-limit.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/login-ip-rate-limit.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,gBAAgB,EAKhB,MAAM,gBAAgB,CAAC;AAExB,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF;;;;;;GAMG;AACH,qBACa,qBAAsB,YAAW,WAAW;IAGvD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBADf,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,eAAe;IAG5C,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAmC9D,OAAO,CAAC,SAAS;CAUjB"}
1
+ {"version":3,"file":"login-ip-rate-limit.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/login-ip-rate-limit.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,gBAAgB,EAKhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,OAAO,MAAM,SAAS,CAAC;AAK9B,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAOnF;;;;;;;;GAQG;AACH,qBACa,qBAAsB,YAAW,WAAW;IAGvD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAHb,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa;IAGxC,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAkD9D,OAAO,CAAC,aAAa;CA+CrB"}
@@ -17,54 +17,96 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.LoginIpRateLimitGuard = void 0;
19
19
  const common_1 = require("@nestjs/common");
20
+ const config_1 = require("@nestjs/config");
21
+ const core_1 = require("@nestjs/core");
20
22
  const ioredis_1 = __importDefault(require("ioredis"));
23
+ const node_env_util_1 = require("../../config/node-env.util");
21
24
  const redis_module_1 = require("../../config/redis.module");
22
25
  const settings_keys_1 = require("../../modules/settings/constants/settings.keys");
23
26
  const settings_service_1 = require("../../modules/settings/services/settings.service");
27
+ const ip_rate_limit_bucket_decorator_1 = require("../decorators/ip-rate-limit-bucket.decorator");
28
+ const request_utils_1 = require("../utils/request.utils");
24
29
  /**
25
- * Per-IP rate limit guard for the login endpoint.
30
+ * Per-IP rate limit guard for public auth endpoints.
26
31
  *
27
- * Prevents credential-stuffing and brute-force attacks from a single IP.
28
- * Limits are read live from SettingsService so they can be tuned without
29
- * a redeploy.
32
+ * Bucket selected via {@link IpRateLimitBucket} metadata (default: `login`):
33
+ * - `login` — credential stuffing protection (login / MFA verify / OAuth callback)
34
+ * - `refresh` — higher budget for mobile token rotation
35
+ * - `auth_public` — register / forgot-password / OAuth start
36
+ * - `profile_public` — public username profile lookup
30
37
  */
31
38
  let LoginIpRateLimitGuard = class LoginIpRateLimitGuard {
32
39
  redis;
33
40
  settingsService;
34
- constructor(redis, settingsService) {
41
+ reflector;
42
+ configService;
43
+ constructor(redis, settingsService, reflector, configService) {
35
44
  this.redis = redis;
36
45
  this.settingsService = settingsService;
46
+ this.reflector = reflector;
47
+ this.configService = configService;
37
48
  }
38
49
  async canActivate(context) {
39
50
  const request = context.switchToHttp().getRequest();
40
- const ip = this.extractIp(request);
41
- if (!ip)
51
+ // Use Express `req.ip` (trust-proxy aware). Never trust raw X-Forwarded-For.
52
+ const ip = (0, request_utils_1.extractIp)(request);
53
+ if (!ip) {
54
+ if ((0, node_env_util_1.isProductionNodeEnv)(this.configService.get('app.nodeEnv'))) {
55
+ throw new common_1.HttpException({
56
+ message: 'Unable to resolve client IP for rate limiting. Check trust-proxy configuration.',
57
+ }, common_1.HttpStatus.SERVICE_UNAVAILABLE);
58
+ }
42
59
  return true;
43
- const max = this.settingsService.get(settings_keys_1.SETTING_KEYS.LOGIN_IP_RATE_LIMIT_MAX);
44
- const window = this.settingsService.get(settings_keys_1.SETTING_KEYS.LOGIN_IP_RATE_LIMIT_WINDOW_SECONDS);
45
- const key = `login:ip-rate:${ip}`;
60
+ }
61
+ const bucket = this.reflector.getAllAndOverride(ip_rate_limit_bucket_decorator_1.IP_RATE_LIMIT_BUCKET_KEY, [
62
+ context.getHandler(),
63
+ context.getClass(),
64
+ ]) ?? 'login';
65
+ const { max, window, keyPrefix, label } = this.resolveBucket(bucket);
66
+ const key = `${keyPrefix}${ip}`;
46
67
  const count = (await this.redis.eval(`local n = redis.call('INCR', KEYS[1])
47
68
  if n == 1 then redis.call('EXPIRE', KEYS[1], ARGV[1]) end
48
69
  return n`, 1, key, String(window)));
49
70
  if (count > max) {
50
71
  const ttl = await this.redis.ttl(key);
51
72
  throw new common_1.HttpException({
52
- message: `Too many login attempts from this IP. Please try again in ${ttl}s.`,
73
+ message: `Too many ${label} from this IP. Please try again in ${ttl}s.`,
53
74
  retryAfter: ttl,
54
75
  }, common_1.HttpStatus.TOO_MANY_REQUESTS);
55
76
  }
56
77
  return true;
57
78
  }
58
- extractIp(request) {
59
- const forwarded = request.headers['x-forwarded-for'];
60
- if (forwarded != null && forwarded !== '') {
61
- const first = (Array.isArray(forwarded) ? forwarded[0] : forwarded)
62
- .split(',')[0]
63
- .trim();
64
- if (first)
65
- return first;
79
+ resolveBucket(bucket) {
80
+ if (bucket === 'refresh') {
81
+ return {
82
+ max: this.settingsService.get(settings_keys_1.SETTING_KEYS.REFRESH_IP_RATE_LIMIT_MAX),
83
+ window: this.settingsService.get(settings_keys_1.SETTING_KEYS.REFRESH_IP_RATE_LIMIT_WINDOW_SECONDS),
84
+ keyPrefix: 'refresh:ip-rate:',
85
+ label: 'token refresh attempts',
86
+ };
87
+ }
88
+ if (bucket === 'auth_public') {
89
+ return {
90
+ max: this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_PUBLIC_IP_RATE_LIMIT_MAX),
91
+ window: this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_PUBLIC_IP_RATE_LIMIT_WINDOW_SECONDS),
92
+ keyPrefix: 'auth:public-ip-rate:',
93
+ label: 'auth requests',
94
+ };
95
+ }
96
+ if (bucket === 'profile_public') {
97
+ return {
98
+ max: this.settingsService.get(settings_keys_1.SETTING_KEYS.PROFILE_PUBLIC_IP_RATE_LIMIT_MAX),
99
+ window: this.settingsService.get(settings_keys_1.SETTING_KEYS.PROFILE_PUBLIC_IP_RATE_LIMIT_WINDOW_SECONDS),
100
+ keyPrefix: 'profile:public-ip-rate:',
101
+ label: 'public profile lookups',
102
+ };
66
103
  }
67
- return request.ip ?? null;
104
+ return {
105
+ max: this.settingsService.get(settings_keys_1.SETTING_KEYS.LOGIN_IP_RATE_LIMIT_MAX),
106
+ window: this.settingsService.get(settings_keys_1.SETTING_KEYS.LOGIN_IP_RATE_LIMIT_WINDOW_SECONDS),
107
+ keyPrefix: 'login:ip-rate:',
108
+ label: 'login attempts',
109
+ };
68
110
  }
69
111
  };
70
112
  exports.LoginIpRateLimitGuard = LoginIpRateLimitGuard;
@@ -72,6 +114,8 @@ exports.LoginIpRateLimitGuard = LoginIpRateLimitGuard = __decorate([
72
114
  (0, common_1.Injectable)(),
73
115
  __param(0, (0, common_1.Inject)(redis_module_1.REDIS_CLIENT)),
74
116
  __metadata("design:paramtypes", [ioredis_1.default,
75
- settings_service_1.SettingsService])
117
+ settings_service_1.SettingsService,
118
+ core_1.Reflector,
119
+ config_1.ConfigService])
76
120
  ], LoginIpRateLimitGuard);
77
121
  //# sourceMappingURL=login-ip-rate-limit.guard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"login-ip-rate-limit.guard.js","sourceRoot":"","sources":["../../../src/common/guards/login-ip-rate-limit.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAOwB;AAExB,sDAA8B;AAE9B,4DAAyD;AACzD,kFAA8E;AAC9E,uFAAmF;AAEnF;;;;;;GAMG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAGf;IACA;IAHlB,YAEkB,KAAc,EACd,eAAgC;QADhC,UAAK,GAAL,KAAK,CAAS;QACd,oBAAe,GAAf,eAAe,CAAiB;IAC/C,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,OAAyB;QAC1C,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAW,CAAC;QAC7D,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAEnC,IAAI,CAAC,EAAE;YAAE,OAAO,IAAI,CAAC;QAErB,MAAM,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAS,4BAAY,CAAC,uBAAuB,CAAC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CAAe;GAJtC,qBAAqB,CAoDjC"}
1
+ {"version":3,"file":"login-ip-rate-limit.guard.js","sourceRoot":"","sources":["../../../src/common/guards/login-ip-rate-limit.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,2CAA+C;AAC/C,uCAAyC;AAEzC,sDAA8B;AAE9B,8DAAiE;AACjE,4DAAyD;AACzD,kFAA8E;AAC9E,uFAAmF;AACnF,iGAGsD;AACtD,0DAAmD;AAEnD;;;;;;;;GAQG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAGf;IACA;IACA;IACA;IALlB,YAEkB,KAAc,EACd,eAAgC,EAChC,SAAoB,EACpB,aAA4B;QAH5B,UAAK,GAAL,KAAK,CAAS;QACd,oBAAe,GAAf,eAAe,CAAiB;QAChC,cAAS,GAAT,SAAS,CAAW;QACpB,kBAAa,GAAb,aAAa,CAAe;IAC3C,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,OAAyB;QAC1C,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAW,CAAC;QAC7D,6EAA6E;QAC7E,MAAM,EAAE,GAAG,IAAA,yBAAS,EAAC,OAAO,CAAC,CAAC;QAE9B,IAAI,CAAC,EAAE,EAAE,CAAC;YACT,IAAI,IAAA,mCAAmB,EAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,aAAa,CAAC,CAAC,EAAE,CAAC;gBACxE,MAAM,IAAI,sBAAa,CACtB;oBACC,OAAO,EACN,iFAAiF;iBAClF,EACD,mBAAU,CAAC,mBAAmB,CAC9B,CAAC;YACH,CAAC;YACD,OAAO,IAAI,CAAC;QACb,CAAC;QAED,MAAM,MAAM,GACX,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAoB,yDAAwB,EAAE;YAC7E,OAAO,CAAC,UAAU,EAAE;YACpB,OAAO,CAAC,QAAQ,EAAE;SAClB,CAAC,IAAI,OAAO,CAAC;QAEf,MAA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Ae;aACtB,CAAC;QACH,CAAC;QACD,IAAI,MAAM,KAAK,gBAAgB,EAAE,CAAC;YACjC,OAAO;gBACN,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAC5B,4BAAY,CAAC,gCAAgC,CAC7C;gBACD,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAC/B,4BAAY,CAAC,2CAA2C,CACxD;gBACD,SAAS,EAAE,yBAAyB;gBACpC,KAAK,EAAE,wBAAwB;aAC/B,CAAC;QACH,CAAC;QACD,OAAO;YACN,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAS,4BAAY,CAAC,uBAAuB,CAAC;YAC3E,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAC/B,4BAAY,CAAC,kCAAkC,CAC/C;YACD,SAAS,EAAE,gBAAgB;YAC3B,KAAK,EAAE,gBAAgB;SACvB,CAAC;IACH,CAAC;CACD,CAAA;AA1GY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;IAGV,WAAA,IAAA,eAAM,EAAC,2BAAY,CAAC,CAAA;qCACG,iBAAO;QACG,kCAAe;QACrB,gBAAS;QACL,sBAAa;GANlC,qBAAqB,CA0GjC"}
@@ -1,4 +1,5 @@
1
1
  import { CanActivate, ExecutionContext } from '@nestjs/common';
2
+ import { ConfigService } from '@nestjs/config';
2
3
  import IORedis from 'ioredis';
3
4
  import { StructuredLoggerService } from '../../modules/observability/logging/structured-logger.service';
4
5
  import { SettingsService } from '../../modules/settings/services/settings.service';
@@ -13,8 +14,8 @@ export declare class OtpIpRateLimitGuard implements CanActivate {
13
14
  private readonly redis;
14
15
  private readonly settingsService;
15
16
  private readonly logger;
16
- constructor(redis: IORedis, settingsService: SettingsService, logger: StructuredLoggerService);
17
+ private readonly configService;
18
+ constructor(redis: IORedis, settingsService: SettingsService, logger: StructuredLoggerService, configService: ConfigService);
17
19
  canActivate(context: ExecutionContext): Promise<boolean>;
18
- private extractIp;
19
20
  }
20
21
  //# sourceMappingURL=otp-ip-rate-limit.guard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"otp-ip-rate-limit.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/otp-ip-rate-limit.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,gBAAgB,EAKhB,MAAM,gBAAgB,CAAC;AAExB,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AAExG,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF;;;;;;GAMG;AACH,qBACa,mBAAoB,YAAW,WAAW;IAGrD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,uBAAuB;IAG3C,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAwC9D,OAAO,CAAC,SAAS;CAUjB"}
1
+ {"version":3,"file":"otp-ip-rate-limit.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/otp-ip-rate-limit.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,gBAAgB,EAKhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AAExG,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAGnF;;;;;;GAMG;AACH,qBACa,mBAAoB,YAAW,WAAW;IAGrD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAHb,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,uBAAuB,EAC/B,aAAa,EAAE,aAAa;IAGxC,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;CAmD9D"}
@@ -17,11 +17,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.OtpIpRateLimitGuard = void 0;
19
19
  const common_1 = require("@nestjs/common");
20
+ const config_1 = require("@nestjs/config");
20
21
  const ioredis_1 = __importDefault(require("ioredis"));
22
+ const node_env_util_1 = require("../../config/node-env.util");
21
23
  const redis_module_1 = require("../../config/redis.module");
22
24
  const structured_logger_service_1 = require("../../modules/observability/logging/structured-logger.service");
23
25
  const settings_keys_1 = require("../../modules/settings/constants/settings.keys");
24
26
  const settings_service_1 = require("../../modules/settings/services/settings.service");
27
+ const request_utils_1 = require("../utils/request.utils");
25
28
  /**
26
29
  * Per-IP rate limit guard for OTP endpoints.
27
30
  *
@@ -33,16 +36,25 @@ let OtpIpRateLimitGuard = class OtpIpRateLimitGuard {
33
36
  redis;
34
37
  settingsService;
35
38
  logger;
36
- constructor(redis, settingsService, logger) {
39
+ configService;
40
+ constructor(redis, settingsService, logger, configService) {
37
41
  this.redis = redis;
38
42
  this.settingsService = settingsService;
39
43
  this.logger = logger;
44
+ this.configService = configService;
40
45
  }
41
46
  async canActivate(context) {
42
47
  const request = context.switchToHttp().getRequest();
43
- const ip = this.extractIp(request);
44
- if (!ip)
48
+ // Use Express `req.ip` (trust-proxy aware). Never trust raw X-Forwarded-For.
49
+ const ip = (0, request_utils_1.extractIp)(request);
50
+ if (!ip) {
51
+ if ((0, node_env_util_1.isProductionNodeEnv)(this.configService.get('app.nodeEnv'))) {
52
+ throw new common_1.HttpException({
53
+ message: 'Unable to resolve client IP for rate limiting. Check trust-proxy configuration.',
54
+ }, common_1.HttpStatus.SERVICE_UNAVAILABLE);
55
+ }
45
56
  return true;
57
+ }
46
58
  const max = this.settingsService.get(settings_keys_1.SETTING_KEYS.OTP_IP_RATE_LIMIT_MAX);
47
59
  const window = this.settingsService.get(settings_keys_1.SETTING_KEYS.OTP_IP_RATE_LIMIT_WINDOW_SECONDS);
48
60
  const key = `otp:ip-rate:${ip}`;
@@ -62,17 +74,6 @@ let OtpIpRateLimitGuard = class OtpIpRateLimitGuard {
62
74
  }
63
75
  return true;
64
76
  }
65
- extractIp(request) {
66
- const forwarded = request.headers['x-forwarded-for'];
67
- if (forwarded != null && forwarded !== '') {
68
- const first = (Array.isArray(forwarded) ? forwarded[0] : forwarded)
69
- .split(',')[0]
70
- .trim();
71
- if (first)
72
- return first;
73
- }
74
- return request.ip ?? null;
75
- }
76
77
  };
77
78
  exports.OtpIpRateLimitGuard = OtpIpRateLimitGuard;
78
79
  exports.OtpIpRateLimitGuard = OtpIpRateLimitGuard = __decorate([
@@ -80,6 +81,7 @@ exports.OtpIpRateLimitGuard = OtpIpRateLimitGuard = __decorate([
80
81
  __param(0, (0, common_1.Inject)(redis_module_1.REDIS_CLIENT)),
81
82
  __metadata("design:paramtypes", [ioredis_1.default,
82
83
  settings_service_1.SettingsService,
83
- structured_logger_service_1.StructuredLoggerService])
84
+ structured_logger_service_1.StructuredLoggerService,
85
+ config_1.ConfigService])
84
86
  ], OtpIpRateLimitGuard);
85
87
  //# sourceMappingURL=otp-ip-rate-limit.guard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"otp-ip-rate-limit.guard.js","sourceRoot":"","sources":["../../../src/common/guards/otp-ip-rate-limit.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAOwB;AAExB,sDAA8B;AAE9B,4DAAyD;AACzD,6GAAwG;AACxG,kFAA8E;AAC9E,uFAAmF;AAEnF;;;;;;GAMG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;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E,EAAE,CACtC,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAEO,SAAS,CAAC,OAAgB;QACjC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACrD,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;YAC3C,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;iBACjE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;iBACb,IAAI,EAAE,CAAC;YACT,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;QACzB,CAAC;QACD,OAAO,OAAO,CAAC,EAAE,IAAI,IAAI,CAAC;IAC3B,CAAC;CACD,CAAA;AA1DY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGV,WAAA,IAAA,eAAM,EAAC,2BAAY,CAAC,CAAA;qCACG,iBAAO;QACG,kCAAe;QACxB,mDAAuB;GALrC,mBAAmB,CA0D/B"}
1
+ {"version":3,"file":"otp-ip-rate-limit.guard.js","sourceRoot":"","sources":["../../../src/common/guards/otp-ip-rate-limit.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,2CAA+C;AAE/C,sDAA8B;AAE9B,8DAAiE;AACjE,4DAAyD;AACzD,6GAAwG;AACxG,kFAA8E;AAC9E,uFAAmF;AACnF,0DAAmD;AAEnD;;;;;;GAMG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAGb;IACA;IACA;IACA;IALlB,YAEkB,KAAc,EACd,eAAgC,EAChC,MAA+B,EAC/B,aAA4B;QAH5B,UAAK,GAAL,KAAK,CAAS;QACd,oBAAe,GAAf,eAAe,CAAiB;QAChC,WAAM,GAAN,MAAM,CAAyB;QAC/B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D,GAAG,IAAI;gBAC3E,UAAU,EAAE,GAAG;aACf,EACD,mBAAU,CAAC,iBAAiB,EAC5B,EAAE,WAAW,EAAE,gBAAgB,GAAG,EAAE,EAAE,CACtC,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAA;AA5DY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGV,WAAA,IAAA,eAAM,EAAC,2BAAY,CAAC,CAAA;qCACG,iBAAO;QACG,kCAAe;QACxB,mDAAuB;QAChB,sBAAa;GANlC,mBAAmB,CA4D/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/permissions.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAkC,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAU5D,qBACa,gBAAiB,YAAW,WAAW;IAElD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY;IAG5C,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;CAwB/C"}
1
+ {"version":3,"file":"permissions.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/permissions.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAkC,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAU5D,qBACa,gBAAiB,YAAW,WAAW;IAElD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY;IAG5C,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;CAwC/C"}
@@ -22,12 +22,22 @@ let PermissionsGuard = class PermissionsGuard {
22
22
  this.rolesService = rolesService;
23
23
  }
24
24
  canActivate(context) {
25
- const requiredPermissions = this.reflector.getAllAndOverride(decorators_1.PERMISSIONS_KEY, [
25
+ const isPublic = this.reflector.getAllAndOverride(decorators_1.IS_PUBLIC_KEY, [
26
26
  context.getHandler(),
27
27
  context.getClass(),
28
28
  ]);
29
- if (!requiredPermissions?.length)
29
+ if (isPublic)
30
30
  return true;
31
+ const requiredPermissions = this.reflector.getAllAndOverride(decorators_1.PERMISSIONS_KEY, [
32
+ context.getHandler(),
33
+ context.getClass(),
34
+ ]);
35
+ const allowAuthenticated = this.reflector.getAllAndOverride(decorators_1.ALLOW_AUTHENTICATED_KEY, [context.getHandler(), context.getClass()]);
36
+ if (!requiredPermissions?.length) {
37
+ if (allowAuthenticated)
38
+ return true;
39
+ throw new common_1.ForbiddenException('Missing permission metadata. Annotate with @RequirePermission(...) or @AllowAuthenticated().');
40
+ }
31
41
  const { user } = context.switchToHttp().getRequest();
32
42
  if (!user?.id)
33
43
  throw new common_1.ForbiddenException('Authenticated user is required');
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.guard.js","sourceRoot":"","sources":["../../../src/common/guards/permissions.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA+F;AAC/F,uCAAyC;AAEzC,2DAA4D;AAC5D,8CAAgD;AAUzC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAEV;IACA;IAFlB,YACkB,SAAoB,EACpB,YAA0B;QAD1B,cAAS,GAAT,SAAS,CAAW;QACpB,iBAAY,GAAZ,YAAY,CAAc;IACzC,CAAC;IAEJ,WAAW,CAAC,OAAyB;QACpC,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAW,4BAAe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Q,CAAC,IAAI,CAAC,CAAC,CAAC;QAEzF,IAAI,CAAC,aAAa,EAAE,CAAC;YACpB,MAAM,IAAI,2BAAkB,CAC3B,wBAAwB,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAC1D,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAA;AA9CY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAGiB,gBAAS;QACN,uBAAY;GAHhC,gBAAgB,CA8C5B"}
@@ -8,6 +8,6 @@ import { Observable } from 'rxjs';
8
8
  export declare class TimeoutInterceptor implements NestInterceptor {
9
9
  private readonly ms;
10
10
  constructor(ms: number);
11
- intercept(_context: ExecutionContext, next: CallHandler): Observable<unknown>;
11
+ intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
12
12
  }
13
13
  //# sourceMappingURL=timeout.interceptor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"timeout.interceptor.d.ts","sourceRoot":"","sources":["../../../src/common/interceptors/timeout.interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,gBAAgB,EAEhB,eAAe,EAEf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAA4B,MAAM,MAAM,CAAC;AAG5D;;;;GAIG;AACH,qBACa,kBAAmB,YAAW,eAAe;IAC7C,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,MAAM;IAEvC,SAAS,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC;CAiB7E"}
1
+ {"version":3,"file":"timeout.interceptor.d.ts","sourceRoot":"","sources":["../../../src/common/interceptors/timeout.interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,gBAAgB,EAEhB,eAAe,EAEf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAA4B,MAAM,MAAM,CAAC;AAG5D;;;;GAIG;AACH,qBACa,kBAAmB,YAAW,eAAe;IAC7C,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,MAAM;IAEvC,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC;CAsB5E"}
@@ -23,7 +23,11 @@ let TimeoutInterceptor = class TimeoutInterceptor {
23
23
  constructor(ms) {
24
24
  this.ms = ms;
25
25
  }
26
- intercept(_context, next) {
26
+ intercept(context, next) {
27
+ // Long-lived WebSocket handlers must not be aborted by the HTTP request timeout.
28
+ if (context.getType() === 'ws') {
29
+ return next.handle();
30
+ }
27
31
  return next.handle().pipe((0, operators_1.timeout)(this.ms), (0, operators_1.catchError)((err) => {
28
32
  if (err instanceof rxjs_1.TimeoutError) {
29
33
  return (0, rxjs_1.throwError)(() => new common_1.RequestTimeoutException({
@@ -1 +1 @@
1
- {"version":3,"file":"timeout.interceptor.js","sourceRoot":"","sources":["../../../src/common/interceptors/timeout.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAMwB;AACxB,+BAA4D;AAC5D,8CAAqD;AAErD;;;;GAIG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACD;IAA7B,YAA6B,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;IAAG,CAAC;IAE3C,SAAS,CAAC,QAA0B,EAAE,IAAiB;QACtD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CACxB,IAAA,mBAAO,EAAC,IAAI,CAAC,EAAE,CAAC,EAChB,IAAA,sBAAU,EAAC,CAAC,GAAY,EAAE,EAAE;YAC3B,IAAI,GAAG,YAAY,mBAAY,EAAE,CAAC;gBACjC,OAAO,IAAA,iBAAU,EAChB,GAAG,EAAE,CACJ,IAAI,gCAAuB,CAAC;oBAC3B,OAAO,EAAE,mBAAmB;oBAC5B,SAAS,EAAE,iBAAiB;iBAC5B,CAAC,CACH,CAAC;YACH,CAAC;YACD,OAAO,IAAA,iBAAU,EAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QAC9B,CAAC,CAAC,CACF,CAAC;IACH,CAAC;CACD,CAAA;AApBY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;;GACA,kBAAkB,CAoB9B"}
1
+ {"version":3,"file":"timeout.interceptor.js","sourceRoot":"","sources":["../../../src/common/interceptors/timeout.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAMwB;AACxB,+BAA4D;AAC5D,8CAAqD;AAErD;;;;GAIG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACD;IAA7B,YAA6B,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;IAAG,CAAC;IAE3C,SAAS,CAAC,OAAyB,EAAE,IAAiB;QACrD,iFAAiF;QACjF,IAAI,OAAO,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;QACtB,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CACxB,IAAA,mBAAO,EAAC,IAAI,CAAC,EAAE,CAAC,EAChB,IAAA,sBAAU,EAAC,CAAC,GAAY,EAAE,EAAE;YAC3B,IAAI,GAAG,YAAY,mBAAY,EAAE,CAAC;gBACjC,OAAO,IAAA,iBAAU,EAChB,GAAG,EAAE,CACJ,IAAI,gCAAuB,CAAC;oBAC3B,OAAO,EAAE,mBAAmB;oBAC5B,SAAS,EAAE,iBAAiB;iBAC5B,CAAC,CACH,CAAC;YACH,CAAC;YACD,OAAO,IAAA,iBAAU,EAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QAC9B,CAAC,CAAC,CACF,CAAC;IACH,CAAC;CACD,CAAA;AAzBY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;;GACA,kBAAkB,CAyB9B"}