@colveor/core 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (837) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +6 -0
  3. package/dist/bootstrap/bootstrap-colveor-app.d.ts.map +1 -1
  4. package/dist/bootstrap/bootstrap-colveor-app.js +22 -3
  5. package/dist/bootstrap/bootstrap-colveor-app.js.map +1 -1
  6. package/dist/common/decorators/index.d.ts +6 -0
  7. package/dist/common/decorators/index.d.ts.map +1 -1
  8. package/dist/common/decorators/index.js +8 -1
  9. package/dist/common/decorators/index.js.map +1 -1
  10. package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts +9 -0
  11. package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts.map +1 -0
  12. package/dist/common/decorators/ip-rate-limit-bucket.decorator.js +12 -0
  13. package/dist/common/decorators/ip-rate-limit-bucket.decorator.js.map +1 -0
  14. package/dist/common/guards/login-ip-rate-limit.guard.d.ts +12 -6
  15. package/dist/common/guards/login-ip-rate-limit.guard.d.ts.map +1 -1
  16. package/dist/common/guards/login-ip-rate-limit.guard.js +65 -21
  17. package/dist/common/guards/login-ip-rate-limit.guard.js.map +1 -1
  18. package/dist/common/guards/otp-ip-rate-limit.guard.d.ts +3 -2
  19. package/dist/common/guards/otp-ip-rate-limit.guard.d.ts.map +1 -1
  20. package/dist/common/guards/otp-ip-rate-limit.guard.js +17 -15
  21. package/dist/common/guards/otp-ip-rate-limit.guard.js.map +1 -1
  22. package/dist/common/guards/permissions.guard.d.ts.map +1 -1
  23. package/dist/common/guards/permissions.guard.js +12 -2
  24. package/dist/common/guards/permissions.guard.js.map +1 -1
  25. package/dist/common/interceptors/timeout.interceptor.d.ts +1 -1
  26. package/dist/common/interceptors/timeout.interceptor.d.ts.map +1 -1
  27. package/dist/common/interceptors/timeout.interceptor.js +5 -1
  28. package/dist/common/interceptors/timeout.interceptor.js.map +1 -1
  29. package/dist/common/interfaces/request-user.d.ts +4 -3
  30. package/dist/common/interfaces/request-user.d.ts.map +1 -1
  31. package/dist/common/utils/cache-version.util.d.ts +12 -0
  32. package/dist/common/utils/cache-version.util.d.ts.map +1 -0
  33. package/dist/common/utils/cache-version.util.js +34 -0
  34. package/dist/common/utils/cache-version.util.js.map +1 -0
  35. package/dist/common/utils/postgres-error.util.d.ts +5 -0
  36. package/dist/common/utils/postgres-error.util.d.ts.map +1 -0
  37. package/dist/common/utils/postgres-error.util.js +13 -0
  38. package/dist/common/utils/postgres-error.util.js.map +1 -0
  39. package/dist/common/utils/singleflight.util.d.ts +6 -0
  40. package/dist/common/utils/singleflight.util.d.ts.map +1 -0
  41. package/dist/common/utils/singleflight.util.js +21 -0
  42. package/dist/common/utils/singleflight.util.js.map +1 -0
  43. package/dist/common/validators/is-exclusive-auth-params.validator.js +1 -1
  44. package/dist/common/validators/is-exclusive-auth-params.validator.js.map +1 -1
  45. package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js +1 -1
  46. package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js.map +1 -1
  47. package/dist/config/app.config.d.ts +38 -0
  48. package/dist/config/app.config.d.ts.map +1 -1
  49. package/dist/config/app.config.js +24 -0
  50. package/dist/config/app.config.js.map +1 -1
  51. package/dist/config/database.config.d.ts +6 -0
  52. package/dist/config/database.config.d.ts.map +1 -1
  53. package/dist/config/database.config.js +3 -0
  54. package/dist/config/database.config.js.map +1 -1
  55. package/dist/config/env-flags.util.d.ts +4 -0
  56. package/dist/config/env-flags.util.d.ts.map +1 -1
  57. package/dist/config/env-flags.util.js +7 -0
  58. package/dist/config/env-flags.util.js.map +1 -1
  59. package/dist/config/env.validation.d.ts +24 -1
  60. package/dist/config/env.validation.d.ts.map +1 -1
  61. package/dist/config/env.validation.js +92 -2
  62. package/dist/config/env.validation.js.map +1 -1
  63. package/dist/config/in-memory-redis.client.d.ts +23 -4
  64. package/dist/config/in-memory-redis.client.d.ts.map +1 -1
  65. package/dist/config/in-memory-redis.client.js +148 -4
  66. package/dist/config/in-memory-redis.client.js.map +1 -1
  67. package/dist/config/redis.module.d.ts.map +1 -1
  68. package/dist/config/redis.module.js +5 -0
  69. package/dist/config/redis.module.js.map +1 -1
  70. package/dist/core.module.d.ts +5 -0
  71. package/dist/core.module.d.ts.map +1 -1
  72. package/dist/core.module.js +5 -0
  73. package/dist/core.module.js.map +1 -1
  74. package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts +7 -0
  75. package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts.map +1 -0
  76. package/dist/database/migrations/1785006199371-auth-mfa-oauth.js +24 -0
  77. package/dist/database/migrations/1785006199371-auth-mfa-oauth.js.map +1 -0
  78. package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts +7 -0
  79. package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts.map +1 -0
  80. package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js +16 -0
  81. package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js.map +1 -0
  82. package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts +7 -0
  83. package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts.map +1 -0
  84. package/dist/database/migrations/1785006199373-auth-gap-fixes.js +14 -0
  85. package/dist/database/migrations/1785006199373-auth-gap-fixes.js.map +1 -0
  86. package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts +13 -0
  87. package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts.map +1 -0
  88. package/dist/database/migrations/1785006199374-auth-sessions-indexes.js +35 -0
  89. package/dist/database/migrations/1785006199374-auth-sessions-indexes.js.map +1 -0
  90. package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts +11 -0
  91. package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts.map +1 -0
  92. package/dist/database/migrations/1785006199375-auth-identity-and-audit.js +60 -0
  93. package/dist/database/migrations/1785006199375-auth-identity-and-audit.js.map +1 -0
  94. package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts +14 -0
  95. package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts.map +1 -0
  96. package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js +39 -0
  97. package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js.map +1 -0
  98. package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts +13 -0
  99. package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts.map +1 -0
  100. package/dist/database/migrations/1785006199377-auth-security-hardening.js +69 -0
  101. package/dist/database/migrations/1785006199377-auth-security-hardening.js.map +1 -0
  102. package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts +11 -0
  103. package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts.map +1 -0
  104. package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js +51 -0
  105. package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js.map +1 -0
  106. package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts +12 -0
  107. package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts.map +1 -0
  108. package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js +37 -0
  109. package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js.map +1 -0
  110. package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts +12 -0
  111. package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts.map +1 -0
  112. package/dist/database/migrations/1785006199380-auth-remaining-gaps.js +74 -0
  113. package/dist/database/migrations/1785006199380-auth-remaining-gaps.js.map +1 -0
  114. package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts +12 -0
  115. package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts.map +1 -0
  116. package/dist/database/migrations/1785006199381-settings-blast-radius.js +52 -0
  117. package/dist/database/migrations/1785006199381-settings-blast-radius.js.map +1 -0
  118. package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts +11 -0
  119. package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts.map +1 -0
  120. package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js +36 -0
  121. package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js.map +1 -0
  122. package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts +12 -0
  123. package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts.map +1 -0
  124. package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js +39 -0
  125. package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js.map +1 -0
  126. package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts +12 -0
  127. package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts.map +1 -0
  128. package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js +39 -0
  129. package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js.map +1 -0
  130. package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts +13 -0
  131. package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts.map +1 -0
  132. package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js +72 -0
  133. package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js.map +1 -0
  134. package/dist/database/migrations/1785006199386-audit-events.d.ts +10 -0
  135. package/dist/database/migrations/1785006199386-audit-events.d.ts.map +1 -0
  136. package/dist/database/migrations/1785006199386-audit-events.js +60 -0
  137. package/dist/database/migrations/1785006199386-audit-events.js.map +1 -0
  138. package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts +10 -0
  139. package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts.map +1 -0
  140. package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js +25 -0
  141. package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js.map +1 -0
  142. package/dist/database/migrations/1785006199388-audit-enterprise.d.ts +11 -0
  143. package/dist/database/migrations/1785006199388-audit-enterprise.d.ts.map +1 -0
  144. package/dist/database/migrations/1785006199388-audit-enterprise.js +157 -0
  145. package/dist/database/migrations/1785006199388-audit-enterprise.js.map +1 -0
  146. package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts +10 -0
  147. package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts.map +1 -0
  148. package/dist/database/migrations/1785006199389-drop-admin-logs.js +38 -0
  149. package/dist/database/migrations/1785006199389-drop-admin-logs.js.map +1 -0
  150. package/dist/database/migrations/1785006199390-audit-hardening.d.ts +14 -0
  151. package/dist/database/migrations/1785006199390-audit-hardening.d.ts.map +1 -0
  152. package/dist/database/migrations/1785006199390-audit-hardening.js +345 -0
  153. package/dist/database/migrations/1785006199390-audit-hardening.js.map +1 -0
  154. package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts +10 -0
  155. package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts.map +1 -0
  156. package/dist/database/migrations/1785006199391-audit-owner-schema-create.js +39 -0
  157. package/dist/database/migrations/1785006199391-audit-owner-schema-create.js.map +1 -0
  158. package/dist/database/migrations/1785006199392-profile-photo-url.d.ts +11 -0
  159. package/dist/database/migrations/1785006199392-profile-photo-url.d.ts.map +1 -0
  160. package/dist/database/migrations/1785006199392-profile-photo-url.js +33 -0
  161. package/dist/database/migrations/1785006199392-profile-photo-url.js.map +1 -0
  162. package/dist/database/migrations/1785006199393-profile-cover-url.d.ts +11 -0
  163. package/dist/database/migrations/1785006199393-profile-cover-url.d.ts.map +1 -0
  164. package/dist/database/migrations/1785006199393-profile-cover-url.js +33 -0
  165. package/dist/database/migrations/1785006199393-profile-cover-url.js.map +1 -0
  166. package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts +11 -0
  167. package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts.map +1 -0
  168. package/dist/database/migrations/1785006199394-profile-is-public-default-false.js +24 -0
  169. package/dist/database/migrations/1785006199394-profile-is-public-default-false.js.map +1 -0
  170. package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts +10 -0
  171. package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts.map +1 -0
  172. package/dist/database/migrations/1785006199395-delivery-scale-indexes.js +35 -0
  173. package/dist/database/migrations/1785006199395-delivery-scale-indexes.js.map +1 -0
  174. package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts +11 -0
  175. package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts.map +1 -0
  176. package/dist/database/migrations/1785006199396-delivery-recipient-index.js +23 -0
  177. package/dist/database/migrations/1785006199396-delivery-recipient-index.js.map +1 -0
  178. package/dist/database/seeds/roles.seed.d.ts +6 -0
  179. package/dist/database/seeds/roles.seed.d.ts.map +1 -1
  180. package/dist/database/seeds/roles.seed.js +22 -5
  181. package/dist/database/seeds/roles.seed.js.map +1 -1
  182. package/dist/database/seeds/settings.seed.d.ts +5 -0
  183. package/dist/database/seeds/settings.seed.d.ts.map +1 -1
  184. package/dist/database/seeds/settings.seed.js +500 -25
  185. package/dist/database/seeds/settings.seed.js.map +1 -1
  186. package/dist/database/seeds/templates/html-template.reader.d.ts +1 -0
  187. package/dist/database/seeds/templates/html-template.reader.d.ts.map +1 -1
  188. package/dist/database/seeds/templates/html-template.reader.js +3 -1
  189. package/dist/database/seeds/templates/html-template.reader.js.map +1 -1
  190. package/dist/database/seeds/templates/html-template.reader.ts +5 -1
  191. package/dist/database/typeorm.util.d.ts.map +1 -1
  192. package/dist/database/typeorm.util.js +6 -0
  193. package/dist/database/typeorm.util.js.map +1 -1
  194. package/dist/index.d.ts +8 -1
  195. package/dist/index.d.ts.map +1 -1
  196. package/dist/index.js +39 -4
  197. package/dist/index.js.map +1 -1
  198. package/dist/modules/admin/controllers/admin.controller.d.ts +15 -7
  199. package/dist/modules/admin/controllers/admin.controller.d.ts.map +1 -1
  200. package/dist/modules/admin/controllers/admin.controller.js +74 -17
  201. package/dist/modules/admin/controllers/admin.controller.js.map +1 -1
  202. package/dist/modules/admin/services/admin-log.service.d.ts +14 -7
  203. package/dist/modules/admin/services/admin-log.service.d.ts.map +1 -1
  204. package/dist/modules/admin/services/admin-log.service.js +41 -38
  205. package/dist/modules/admin/services/admin-log.service.js.map +1 -1
  206. package/dist/modules/audit/audit.manifest.d.ts +8 -0
  207. package/dist/modules/audit/audit.manifest.d.ts.map +1 -0
  208. package/dist/modules/audit/audit.manifest.js +31 -0
  209. package/dist/modules/audit/audit.manifest.js.map +1 -0
  210. package/dist/modules/audit/audit.module.d.ts +8 -0
  211. package/dist/modules/audit/audit.module.d.ts.map +1 -0
  212. package/dist/modules/audit/audit.module.js +57 -0
  213. package/dist/modules/audit/audit.module.js.map +1 -0
  214. package/dist/modules/audit/constants/audit-actions.d.ts +79 -0
  215. package/dist/modules/audit/constants/audit-actions.d.ts.map +1 -0
  216. package/dist/modules/audit/constants/audit-actions.js +89 -0
  217. package/dist/modules/audit/constants/audit-actions.js.map +1 -0
  218. package/dist/modules/audit/constants/audit-mutation.d.ts +10 -0
  219. package/dist/modules/audit/constants/audit-mutation.d.ts.map +1 -0
  220. package/dist/modules/audit/constants/audit-mutation.js +13 -0
  221. package/dist/modules/audit/constants/audit-mutation.js.map +1 -0
  222. package/dist/modules/audit/controllers/audit.controller.d.ts +13 -0
  223. package/dist/modules/audit/controllers/audit.controller.d.ts.map +1 -0
  224. package/dist/modules/audit/controllers/audit.controller.js +149 -0
  225. package/dist/modules/audit/controllers/audit.controller.js.map +1 -0
  226. package/dist/modules/audit/decorators/audit.decorator.d.ts +27 -0
  227. package/dist/modules/audit/decorators/audit.decorator.d.ts.map +1 -0
  228. package/dist/modules/audit/decorators/audit.decorator.js +18 -0
  229. package/dist/modules/audit/decorators/audit.decorator.js.map +1 -0
  230. package/dist/modules/audit/dto/audit.dto.d.ts +54 -0
  231. package/dist/modules/audit/dto/audit.dto.d.ts.map +1 -0
  232. package/dist/modules/audit/dto/audit.dto.js +129 -0
  233. package/dist/modules/audit/dto/audit.dto.js.map +1 -0
  234. package/dist/modules/audit/entities/audit-event.entity.d.ts +33 -0
  235. package/dist/modules/audit/entities/audit-event.entity.d.ts.map +1 -0
  236. package/dist/modules/audit/entities/audit-event.entity.js +125 -0
  237. package/dist/modules/audit/entities/audit-event.entity.js.map +1 -0
  238. package/dist/modules/audit/entities/audit-outbox.entity.d.ts +16 -0
  239. package/dist/modules/audit/entities/audit-outbox.entity.d.ts.map +1 -0
  240. package/dist/modules/audit/entities/audit-outbox.entity.js +65 -0
  241. package/dist/modules/audit/entities/audit-outbox.entity.js.map +1 -0
  242. package/dist/modules/audit/index.d.ts +13 -0
  243. package/dist/modules/audit/index.d.ts.map +1 -0
  244. package/dist/modules/audit/index.js +23 -0
  245. package/dist/modules/audit/index.js.map +1 -0
  246. package/dist/modules/audit/interceptors/audit.interceptor.d.ts +11 -0
  247. package/dist/modules/audit/interceptors/audit.interceptor.d.ts.map +1 -0
  248. package/dist/modules/audit/interceptors/audit.interceptor.js +75 -0
  249. package/dist/modules/audit/interceptors/audit.interceptor.js.map +1 -0
  250. package/dist/modules/audit/listeners/auth-audit.listener.d.ts +31 -0
  251. package/dist/modules/audit/listeners/auth-audit.listener.d.ts.map +1 -0
  252. package/dist/modules/audit/listeners/auth-audit.listener.js +338 -0
  253. package/dist/modules/audit/listeners/auth-audit.listener.js.map +1 -0
  254. package/dist/modules/audit/services/audit-archive.service.d.ts +28 -0
  255. package/dist/modules/audit/services/audit-archive.service.d.ts.map +1 -0
  256. package/dist/modules/audit/services/audit-archive.service.js +132 -0
  257. package/dist/modules/audit/services/audit-archive.service.js.map +1 -0
  258. package/dist/modules/audit/services/audit-hash-backfill.service.d.ts +22 -0
  259. package/dist/modules/audit/services/audit-hash-backfill.service.d.ts.map +1 -0
  260. package/dist/modules/audit/services/audit-hash-backfill.service.js +79 -0
  261. package/dist/modules/audit/services/audit-hash-backfill.service.js.map +1 -0
  262. package/dist/modules/audit/services/audit-leader.service.d.ts +28 -0
  263. package/dist/modules/audit/services/audit-leader.service.d.ts.map +1 -0
  264. package/dist/modules/audit/services/audit-leader.service.js +99 -0
  265. package/dist/modules/audit/services/audit-leader.service.js.map +1 -0
  266. package/dist/modules/audit/services/audit-outbox.worker.d.ts +29 -0
  267. package/dist/modules/audit/services/audit-outbox.worker.d.ts.map +1 -0
  268. package/dist/modules/audit/services/audit-outbox.worker.js +144 -0
  269. package/dist/modules/audit/services/audit-outbox.worker.js.map +1 -0
  270. package/dist/modules/audit/services/audit-partition.service.d.ts +18 -0
  271. package/dist/modules/audit/services/audit-partition.service.d.ts.map +1 -0
  272. package/dist/modules/audit/services/audit-partition.service.js +70 -0
  273. package/dist/modules/audit/services/audit-partition.service.js.map +1 -0
  274. package/dist/modules/audit/services/audit-write.service.d.ts +60 -0
  275. package/dist/modules/audit/services/audit-write.service.d.ts.map +1 -0
  276. package/dist/modules/audit/services/audit-write.service.js +463 -0
  277. package/dist/modules/audit/services/audit-write.service.js.map +1 -0
  278. package/dist/modules/audit/services/audit.service.d.ts +60 -0
  279. package/dist/modules/audit/services/audit.service.d.ts.map +1 -0
  280. package/dist/modules/audit/services/audit.service.js +373 -0
  281. package/dist/modules/audit/services/audit.service.js.map +1 -0
  282. package/dist/modules/audit/utils/audit-hash.util.d.ts +20 -0
  283. package/dist/modules/audit/utils/audit-hash.util.d.ts.map +1 -0
  284. package/dist/modules/audit/utils/audit-hash.util.js +44 -0
  285. package/dist/modules/audit/utils/audit-hash.util.js.map +1 -0
  286. package/dist/modules/auth/auth-core/auth-core.module.d.ts.map +1 -1
  287. package/dist/modules/auth/auth-core/auth-core.module.js +16 -4
  288. package/dist/modules/auth/auth-core/auth-core.module.js.map +1 -1
  289. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts +22 -0
  290. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts.map +1 -0
  291. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js +25 -0
  292. package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js.map +1 -0
  293. package/dist/modules/auth/auth-core/services/access-token.validator.d.ts +19 -0
  294. package/dist/modules/auth/auth-core/services/access-token.validator.d.ts.map +1 -0
  295. package/dist/modules/auth/auth-core/services/access-token.validator.js +110 -0
  296. package/dist/modules/auth/auth-core/services/access-token.validator.js.map +1 -0
  297. package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts +10 -0
  298. package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts.map +1 -0
  299. package/dist/modules/auth/auth-core/services/family-denylist.reader.js +44 -0
  300. package/dist/modules/auth/auth-core/services/family-denylist.reader.js.map +1 -0
  301. package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts +10 -0
  302. package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts.map +1 -0
  303. package/dist/modules/auth/auth-core/services/session-epoch.reader.js +44 -0
  304. package/dist/modules/auth/auth-core/services/session-epoch.reader.js.map +1 -0
  305. package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts +7 -8
  306. package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts.map +1 -1
  307. package/dist/modules/auth/auth-core/strategies/jwt.strategy.js +34 -34
  308. package/dist/modules/auth/auth-core/strategies/jwt.strategy.js.map +1 -1
  309. package/dist/modules/auth/auth.manifest.d.ts +6 -0
  310. package/dist/modules/auth/auth.manifest.d.ts.map +1 -1
  311. package/dist/modules/auth/auth.manifest.js +38 -2
  312. package/dist/modules/auth/auth.manifest.js.map +1 -1
  313. package/dist/modules/auth/auth.module.d.ts.map +1 -1
  314. package/dist/modules/auth/auth.module.js +39 -4
  315. package/dist/modules/auth/auth.module.js.map +1 -1
  316. package/dist/modules/auth/controllers/account.controller.d.ts +15 -1
  317. package/dist/modules/auth/controllers/account.controller.d.ts.map +1 -1
  318. package/dist/modules/auth/controllers/account.controller.js +65 -7
  319. package/dist/modules/auth/controllers/account.controller.js.map +1 -1
  320. package/dist/modules/auth/controllers/auth.controller.d.ts +7 -3
  321. package/dist/modules/auth/controllers/auth.controller.d.ts.map +1 -1
  322. package/dist/modules/auth/controllers/auth.controller.js +76 -16
  323. package/dist/modules/auth/controllers/auth.controller.js.map +1 -1
  324. package/dist/modules/auth/controllers/forgot-password.controller.d.ts +4 -2
  325. package/dist/modules/auth/controllers/forgot-password.controller.d.ts.map +1 -1
  326. package/dist/modules/auth/controllers/forgot-password.controller.js +32 -11
  327. package/dist/modules/auth/controllers/forgot-password.controller.js.map +1 -1
  328. package/dist/modules/auth/controllers/mfa.controller.d.ts +18 -0
  329. package/dist/modules/auth/controllers/mfa.controller.d.ts.map +1 -0
  330. package/dist/modules/auth/controllers/mfa.controller.js +192 -0
  331. package/dist/modules/auth/controllers/mfa.controller.js.map +1 -0
  332. package/dist/modules/auth/controllers/oauth.controller.d.ts +22 -0
  333. package/dist/modules/auth/controllers/oauth.controller.d.ts.map +1 -0
  334. package/dist/modules/auth/controllers/oauth.controller.js +192 -0
  335. package/dist/modules/auth/controllers/oauth.controller.js.map +1 -0
  336. package/dist/modules/auth/controllers/otp.controller.d.ts +6 -3
  337. package/dist/modules/auth/controllers/otp.controller.d.ts.map +1 -1
  338. package/dist/modules/auth/controllers/otp.controller.js +32 -33
  339. package/dist/modules/auth/controllers/otp.controller.js.map +1 -1
  340. package/dist/modules/auth/controllers/pin.controller.d.ts.map +1 -1
  341. package/dist/modules/auth/controllers/pin.controller.js +10 -2
  342. package/dist/modules/auth/controllers/pin.controller.js.map +1 -1
  343. package/dist/modules/auth/controllers/session.controller.d.ts +12 -4
  344. package/dist/modules/auth/controllers/session.controller.d.ts.map +1 -1
  345. package/dist/modules/auth/controllers/session.controller.js +130 -31
  346. package/dist/modules/auth/controllers/session.controller.js.map +1 -1
  347. package/dist/modules/auth/dto/auth-config.dto.d.ts +11 -2
  348. package/dist/modules/auth/dto/auth-config.dto.d.ts.map +1 -1
  349. package/dist/modules/auth/dto/auth-config.dto.js +78 -3
  350. package/dist/modules/auth/dto/auth-config.dto.js.map +1 -1
  351. package/dist/modules/auth/dto/index.d.ts +2 -0
  352. package/dist/modules/auth/dto/index.d.ts.map +1 -1
  353. package/dist/modules/auth/dto/index.js +2 -0
  354. package/dist/modules/auth/dto/index.js.map +1 -1
  355. package/dist/modules/auth/dto/login.dto.d.ts +8 -1
  356. package/dist/modules/auth/dto/login.dto.d.ts.map +1 -1
  357. package/dist/modules/auth/dto/login.dto.js +48 -3
  358. package/dist/modules/auth/dto/login.dto.js.map +1 -1
  359. package/dist/modules/auth/dto/mfa.dto.d.ts +61 -0
  360. package/dist/modules/auth/dto/mfa.dto.d.ts.map +1 -0
  361. package/dist/modules/auth/dto/mfa.dto.js +326 -0
  362. package/dist/modules/auth/dto/mfa.dto.js.map +1 -0
  363. package/dist/modules/auth/dto/oauth.dto.d.ts +45 -0
  364. package/dist/modules/auth/dto/oauth.dto.d.ts.map +1 -0
  365. package/dist/modules/auth/dto/oauth.dto.js +249 -0
  366. package/dist/modules/auth/dto/oauth.dto.js.map +1 -0
  367. package/dist/modules/auth/dto/otp.dto.d.ts +3 -1
  368. package/dist/modules/auth/dto/otp.dto.d.ts.map +1 -1
  369. package/dist/modules/auth/dto/otp.dto.js +19 -0
  370. package/dist/modules/auth/dto/otp.dto.js.map +1 -1
  371. package/dist/modules/auth/dto/password.dto.d.ts +28 -0
  372. package/dist/modules/auth/dto/password.dto.d.ts.map +1 -1
  373. package/dist/modules/auth/dto/password.dto.js +191 -5
  374. package/dist/modules/auth/dto/password.dto.js.map +1 -1
  375. package/dist/modules/auth/dto/register.dto.d.ts +1 -0
  376. package/dist/modules/auth/dto/register.dto.d.ts.map +1 -1
  377. package/dist/modules/auth/dto/register.dto.js +1 -0
  378. package/dist/modules/auth/dto/register.dto.js.map +1 -1
  379. package/dist/modules/auth/dto/session.dto.d.ts +20 -0
  380. package/dist/modules/auth/dto/session.dto.d.ts.map +1 -0
  381. package/dist/modules/auth/dto/session.dto.js +98 -0
  382. package/dist/modules/auth/dto/session.dto.js.map +1 -0
  383. package/dist/modules/auth/dto/token.dto.d.ts +38 -1
  384. package/dist/modules/auth/dto/token.dto.d.ts.map +1 -1
  385. package/dist/modules/auth/dto/token.dto.js +21 -1
  386. package/dist/modules/auth/dto/token.dto.js.map +1 -1
  387. package/dist/modules/auth/entities/index.d.ts +2 -0
  388. package/dist/modules/auth/entities/index.d.ts.map +1 -1
  389. package/dist/modules/auth/entities/index.js +2 -0
  390. package/dist/modules/auth/entities/index.js.map +1 -1
  391. package/dist/modules/auth/entities/password-reset-token.entity.d.ts +2 -0
  392. package/dist/modules/auth/entities/password-reset-token.entity.d.ts.map +1 -1
  393. package/dist/modules/auth/entities/password-reset-token.entity.js +6 -0
  394. package/dist/modules/auth/entities/password-reset-token.entity.js.map +1 -1
  395. package/dist/modules/auth/entities/user-mfa.entity.d.ts +19 -0
  396. package/dist/modules/auth/entities/user-mfa.entity.d.ts.map +1 -0
  397. package/dist/modules/auth/entities/user-mfa.entity.js +73 -0
  398. package/dist/modules/auth/entities/user-mfa.entity.js.map +1 -0
  399. package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts +24 -0
  400. package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts.map +1 -0
  401. package/dist/modules/auth/entities/user-oauth-identity.entity.js +84 -0
  402. package/dist/modules/auth/entities/user-oauth-identity.entity.js.map +1 -0
  403. package/dist/modules/auth/events/auth.events.d.ts +84 -19
  404. package/dist/modules/auth/events/auth.events.d.ts.map +1 -1
  405. package/dist/modules/auth/events/auth.events.js +17 -9
  406. package/dist/modules/auth/events/auth.events.js.map +1 -1
  407. package/dist/modules/auth/services/account.service.d.ts +74 -14
  408. package/dist/modules/auth/services/account.service.d.ts.map +1 -1
  409. package/dist/modules/auth/services/account.service.js +247 -31
  410. package/dist/modules/auth/services/account.service.js.map +1 -1
  411. package/dist/modules/auth/services/dpop.service.d.ts +41 -0
  412. package/dist/modules/auth/services/dpop.service.d.ts.map +1 -0
  413. package/dist/modules/auth/services/dpop.service.js +159 -0
  414. package/dist/modules/auth/services/dpop.service.js.map +1 -0
  415. package/dist/modules/auth/services/index.d.ts +2 -0
  416. package/dist/modules/auth/services/index.d.ts.map +1 -1
  417. package/dist/modules/auth/services/index.js +2 -0
  418. package/dist/modules/auth/services/index.js.map +1 -1
  419. package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts +28 -0
  420. package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts.map +1 -0
  421. package/dist/modules/auth/services/legacy-hash-cleanup.service.js +163 -0
  422. package/dist/modules/auth/services/legacy-hash-cleanup.service.js.map +1 -0
  423. package/dist/modules/auth/services/login.service.d.ts +29 -34
  424. package/dist/modules/auth/services/login.service.d.ts.map +1 -1
  425. package/dist/modules/auth/services/login.service.js +173 -61
  426. package/dist/modules/auth/services/login.service.js.map +1 -1
  427. package/dist/modules/auth/services/mfa.service.d.ts +111 -0
  428. package/dist/modules/auth/services/mfa.service.d.ts.map +1 -0
  429. package/dist/modules/auth/services/mfa.service.js +662 -0
  430. package/dist/modules/auth/services/mfa.service.js.map +1 -0
  431. package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts +11 -0
  432. package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts.map +1 -0
  433. package/dist/modules/auth/services/oauth/apple-id-token.verifier.js +56 -0
  434. package/dist/modules/auth/services/oauth/apple-id-token.verifier.js.map +1 -0
  435. package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts +12 -0
  436. package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts.map +1 -0
  437. package/dist/modules/auth/services/oauth/google-id-token.verifier.js +64 -0
  438. package/dist/modules/auth/services/oauth/google-id-token.verifier.js.map +1 -0
  439. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts +11 -0
  440. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts.map +1 -0
  441. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js +76 -0
  442. package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js.map +1 -0
  443. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts +16 -0
  444. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts.map +1 -0
  445. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js +92 -0
  446. package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js.map +1 -0
  447. package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts +9 -0
  448. package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts.map +1 -0
  449. package/dist/modules/auth/services/oauth/verified-oauth-identity.js +3 -0
  450. package/dist/modules/auth/services/oauth/verified-oauth-identity.js.map +1 -0
  451. package/dist/modules/auth/services/oauth.service.d.ts +83 -0
  452. package/dist/modules/auth/services/oauth.service.d.ts.map +1 -0
  453. package/dist/modules/auth/services/oauth.service.js +471 -0
  454. package/dist/modules/auth/services/oauth.service.js.map +1 -0
  455. package/dist/modules/auth/services/otp-auth.service.d.ts +13 -3
  456. package/dist/modules/auth/services/otp-auth.service.d.ts.map +1 -1
  457. package/dist/modules/auth/services/otp-auth.service.js +41 -7
  458. package/dist/modules/auth/services/otp-auth.service.js.map +1 -1
  459. package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts +22 -0
  460. package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts.map +1 -0
  461. package/dist/modules/auth/services/password-reset-audit-retention.service.js +117 -0
  462. package/dist/modules/auth/services/password-reset-audit-retention.service.js.map +1 -0
  463. package/dist/modules/auth/services/password.service.d.ts +25 -5
  464. package/dist/modules/auth/services/password.service.d.ts.map +1 -1
  465. package/dist/modules/auth/services/password.service.js +154 -20
  466. package/dist/modules/auth/services/password.service.js.map +1 -1
  467. package/dist/modules/auth/services/pin-auth.service.d.ts +10 -3
  468. package/dist/modules/auth/services/pin-auth.service.d.ts.map +1 -1
  469. package/dist/modules/auth/services/pin-auth.service.js +110 -13
  470. package/dist/modules/auth/services/pin-auth.service.js.map +1 -1
  471. package/dist/modules/auth/services/registration.service.d.ts +10 -2
  472. package/dist/modules/auth/services/registration.service.d.ts.map +1 -1
  473. package/dist/modules/auth/services/registration.service.js +113 -25
  474. package/dist/modules/auth/services/registration.service.js.map +1 -1
  475. package/dist/modules/auth/services/turnstile.service.d.ts +17 -0
  476. package/dist/modules/auth/services/turnstile.service.d.ts.map +1 -0
  477. package/dist/modules/auth/services/turnstile.service.js +94 -0
  478. package/dist/modules/auth/services/turnstile.service.js.map +1 -0
  479. package/dist/modules/auth/utils/auth-params.util.d.ts +13 -6
  480. package/dist/modules/auth/utils/auth-params.util.d.ts.map +1 -1
  481. package/dist/modules/auth/utils/auth-params.util.js +27 -4
  482. package/dist/modules/auth/utils/auth-params.util.js.map +1 -1
  483. package/dist/modules/auth/utils/auth-supported.util.d.ts +12 -1
  484. package/dist/modules/auth/utils/auth-supported.util.d.ts.map +1 -1
  485. package/dist/modules/auth/utils/auth-supported.util.js +36 -4
  486. package/dist/modules/auth/utils/auth-supported.util.js.map +1 -1
  487. package/dist/modules/auth/utils/backup-code-hash.util.d.ts +10 -0
  488. package/dist/modules/auth/utils/backup-code-hash.util.d.ts.map +1 -0
  489. package/dist/modules/auth/utils/backup-code-hash.util.js +31 -0
  490. package/dist/modules/auth/utils/backup-code-hash.util.js.map +1 -0
  491. package/dist/modules/auth/utils/backup-codes.util.d.ts +5 -0
  492. package/dist/modules/auth/utils/backup-codes.util.d.ts.map +1 -0
  493. package/dist/modules/auth/utils/backup-codes.util.js +22 -0
  494. package/dist/modules/auth/utils/backup-codes.util.js.map +1 -0
  495. package/dist/modules/auth/utils/dpop.util.d.ts +22 -0
  496. package/dist/modules/auth/utils/dpop.util.d.ts.map +1 -0
  497. package/dist/modules/auth/utils/dpop.util.js +73 -0
  498. package/dist/modules/auth/utils/dpop.util.js.map +1 -0
  499. package/dist/modules/auth/utils/mfa-secret.util.d.ts +22 -0
  500. package/dist/modules/auth/utils/mfa-secret.util.d.ts.map +1 -0
  501. package/dist/modules/auth/utils/mfa-secret.util.js +59 -0
  502. package/dist/modules/auth/utils/mfa-secret.util.js.map +1 -0
  503. package/dist/modules/auth/utils/mfa-verify-params.util.d.ts +26 -0
  504. package/dist/modules/auth/utils/mfa-verify-params.util.d.ts.map +1 -0
  505. package/dist/modules/auth/utils/mfa-verify-params.util.js +49 -0
  506. package/dist/modules/auth/utils/mfa-verify-params.util.js.map +1 -0
  507. package/dist/modules/auth/utils/step-up-purpose.util.d.ts +5 -0
  508. package/dist/modules/auth/utils/step-up-purpose.util.d.ts.map +1 -0
  509. package/dist/modules/auth/utils/step-up-purpose.util.js +18 -0
  510. package/dist/modules/auth/utils/step-up-purpose.util.js.map +1 -0
  511. package/dist/modules/auth/utils/totp.util.d.ts +16 -0
  512. package/dist/modules/auth/utils/totp.util.d.ts.map +1 -0
  513. package/dist/modules/auth/utils/totp.util.js +88 -0
  514. package/dist/modules/auth/utils/totp.util.js.map +1 -0
  515. package/dist/modules/delivery/composers/otp-delivery.composer.d.ts +28 -1
  516. package/dist/modules/delivery/composers/otp-delivery.composer.d.ts.map +1 -1
  517. package/dist/modules/delivery/composers/otp-delivery.composer.js +48 -2
  518. package/dist/modules/delivery/composers/otp-delivery.composer.js.map +1 -1
  519. package/dist/modules/delivery/constants/delivery-worker.constants.d.ts +29 -0
  520. package/dist/modules/delivery/constants/delivery-worker.constants.d.ts.map +1 -0
  521. package/dist/modules/delivery/constants/delivery-worker.constants.js +51 -0
  522. package/dist/modules/delivery/constants/delivery-worker.constants.js.map +1 -0
  523. package/dist/modules/delivery/delivery.module.d.ts.map +1 -1
  524. package/dist/modules/delivery/delivery.module.js +1 -15
  525. package/dist/modules/delivery/delivery.module.js.map +1 -1
  526. package/dist/modules/delivery/entities/notification-delivery-log.entity.d.ts.map +1 -1
  527. package/dist/modules/delivery/entities/notification-delivery-log.entity.js +3 -1
  528. package/dist/modules/delivery/entities/notification-delivery-log.entity.js.map +1 -1
  529. package/dist/modules/delivery/notification-delivery.service.d.ts +12 -1
  530. package/dist/modules/delivery/notification-delivery.service.d.ts.map +1 -1
  531. package/dist/modules/delivery/notification-delivery.service.js +121 -40
  532. package/dist/modules/delivery/notification-delivery.service.js.map +1 -1
  533. package/dist/modules/delivery/processors/delivery-job.runner.d.ts +22 -1
  534. package/dist/modules/delivery/processors/delivery-job.runner.d.ts.map +1 -1
  535. package/dist/modules/delivery/processors/delivery-job.runner.js +144 -42
  536. package/dist/modules/delivery/processors/delivery-job.runner.js.map +1 -1
  537. package/dist/modules/delivery/processors/delivery.processor.d.ts.map +1 -1
  538. package/dist/modules/delivery/processors/delivery.processor.js +6 -1
  539. package/dist/modules/delivery/processors/delivery.processor.js.map +1 -1
  540. package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts +11 -0
  541. package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts.map +1 -1
  542. package/dist/modules/delivery/processors/otp-delivery-job.runner.js +90 -16
  543. package/dist/modules/delivery/processors/otp-delivery-job.runner.js.map +1 -1
  544. package/dist/modules/delivery/processors/otp-delivery.processor.d.ts.map +1 -1
  545. package/dist/modules/delivery/processors/otp-delivery.processor.js +6 -1
  546. package/dist/modules/delivery/processors/otp-delivery.processor.js.map +1 -1
  547. package/dist/modules/delivery/queues/sync-jobs.queue.d.ts +7 -1
  548. package/dist/modules/delivery/queues/sync-jobs.queue.d.ts.map +1 -1
  549. package/dist/modules/delivery/queues/sync-jobs.queue.js +11 -2
  550. package/dist/modules/delivery/queues/sync-jobs.queue.js.map +1 -1
  551. package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts +7 -3
  552. package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts.map +1 -1
  553. package/dist/modules/delivery/services/delivery-audit-retention.service.js +33 -10
  554. package/dist/modules/delivery/services/delivery-audit-retention.service.js.map +1 -1
  555. package/dist/modules/delivery/services/notification-audit.service.d.ts +7 -4
  556. package/dist/modules/delivery/services/notification-audit.service.d.ts.map +1 -1
  557. package/dist/modules/delivery/services/notification-audit.service.js +83 -26
  558. package/dist/modules/delivery/services/notification-audit.service.js.map +1 -1
  559. package/dist/modules/delivery/utils/payload-snapshot.util.d.ts +2 -0
  560. package/dist/modules/delivery/utils/payload-snapshot.util.d.ts.map +1 -1
  561. package/dist/modules/delivery/utils/payload-snapshot.util.js +22 -3
  562. package/dist/modules/delivery/utils/payload-snapshot.util.js.map +1 -1
  563. package/dist/modules/file-upload/controllers/file-upload.controller.d.ts +7 -1
  564. package/dist/modules/file-upload/controllers/file-upload.controller.d.ts.map +1 -1
  565. package/dist/modules/file-upload/controllers/file-upload.controller.js +5 -7
  566. package/dist/modules/file-upload/controllers/file-upload.controller.js.map +1 -1
  567. package/dist/modules/file-upload/dto/file-upload.dto.d.ts +2 -0
  568. package/dist/modules/file-upload/dto/file-upload.dto.d.ts.map +1 -1
  569. package/dist/modules/file-upload/dto/file-upload.dto.js +20 -0
  570. package/dist/modules/file-upload/dto/file-upload.dto.js.map +1 -1
  571. package/dist/modules/file-upload/file-upload.module.d.ts.map +1 -1
  572. package/dist/modules/file-upload/file-upload.module.js +12 -2
  573. package/dist/modules/file-upload/file-upload.module.js.map +1 -1
  574. package/dist/modules/file-upload/services/file-upload.service.d.ts +24 -6
  575. package/dist/modules/file-upload/services/file-upload.service.d.ts.map +1 -1
  576. package/dist/modules/file-upload/services/file-upload.service.js +164 -36
  577. package/dist/modules/file-upload/services/file-upload.service.js.map +1 -1
  578. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts +4 -2
  579. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts.map +1 -1
  580. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js +30 -5
  581. package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js.map +1 -1
  582. package/dist/modules/file-upload/utils/image-optimize.util.d.ts.map +1 -1
  583. package/dist/modules/file-upload/utils/image-optimize.util.js +7 -1
  584. package/dist/modules/file-upload/utils/image-optimize.util.js.map +1 -1
  585. package/dist/modules/health/health.controller.d.ts +5 -1
  586. package/dist/modules/health/health.controller.d.ts.map +1 -1
  587. package/dist/modules/health/health.controller.js +57 -3
  588. package/dist/modules/health/health.controller.js.map +1 -1
  589. package/dist/modules/invitations/controllers/invitations.controller.d.ts +19 -4
  590. package/dist/modules/invitations/controllers/invitations.controller.d.ts.map +1 -1
  591. package/dist/modules/invitations/controllers/invitations.controller.js +19 -10
  592. package/dist/modules/invitations/controllers/invitations.controller.js.map +1 -1
  593. package/dist/modules/invitations/dto/invitation.dto.d.ts +13 -0
  594. package/dist/modules/invitations/dto/invitation.dto.d.ts.map +1 -1
  595. package/dist/modules/invitations/dto/invitation.dto.js +69 -2
  596. package/dist/modules/invitations/dto/invitation.dto.js.map +1 -1
  597. package/dist/modules/invitations/services/invitations.service.d.ts +24 -6
  598. package/dist/modules/invitations/services/invitations.service.d.ts.map +1 -1
  599. package/dist/modules/invitations/services/invitations.service.js +96 -20
  600. package/dist/modules/invitations/services/invitations.service.js.map +1 -1
  601. package/dist/modules/jobs/queues/jobs.queue.d.ts +7 -2
  602. package/dist/modules/jobs/queues/jobs.queue.d.ts.map +1 -1
  603. package/dist/modules/jobs/queues/jobs.queue.js +25 -10
  604. package/dist/modules/jobs/queues/jobs.queue.js.map +1 -1
  605. package/dist/modules/notifications/controllers/notifications.controller.d.ts +3 -1
  606. package/dist/modules/notifications/controllers/notifications.controller.d.ts.map +1 -1
  607. package/dist/modules/notifications/controllers/notifications.controller.js +25 -2
  608. package/dist/modules/notifications/controllers/notifications.controller.js.map +1 -1
  609. package/dist/modules/notifications/dto/notification-query.dto.d.ts.map +1 -1
  610. package/dist/modules/notifications/dto/notification-query.dto.js +1 -0
  611. package/dist/modules/notifications/dto/notification-query.dto.js.map +1 -1
  612. package/dist/modules/notifications/entities/device-token.entity.d.ts.map +1 -1
  613. package/dist/modules/notifications/entities/device-token.entity.js +3 -1
  614. package/dist/modules/notifications/entities/device-token.entity.js.map +1 -1
  615. package/dist/modules/notifications/services/fcm.service.d.ts +2 -0
  616. package/dist/modules/notifications/services/fcm.service.d.ts.map +1 -1
  617. package/dist/modules/notifications/services/fcm.service.js +28 -7
  618. package/dist/modules/notifications/services/fcm.service.js.map +1 -1
  619. package/dist/modules/notifications/services/notifications.service.d.ts +16 -3
  620. package/dist/modules/notifications/services/notifications.service.d.ts.map +1 -1
  621. package/dist/modules/notifications/services/notifications.service.js +95 -24
  622. package/dist/modules/notifications/services/notifications.service.js.map +1 -1
  623. package/dist/modules/observability/metrics/metrics.service.d.ts +2 -0
  624. package/dist/modules/observability/metrics/metrics.service.d.ts.map +1 -1
  625. package/dist/modules/observability/metrics/metrics.service.js +11 -0
  626. package/dist/modules/observability/metrics/metrics.service.js.map +1 -1
  627. package/dist/modules/otp/constants/otp.constants.d.ts +7 -5
  628. package/dist/modules/otp/constants/otp.constants.d.ts.map +1 -1
  629. package/dist/modules/otp/constants/otp.constants.js +11 -8
  630. package/dist/modules/otp/constants/otp.constants.js.map +1 -1
  631. package/dist/modules/otp/interfaces/otp.service.interface.d.ts +1 -1
  632. package/dist/modules/otp/interfaces/otp.service.interface.d.ts.map +1 -1
  633. package/dist/modules/otp/otp.service.d.ts +10 -2
  634. package/dist/modules/otp/otp.service.d.ts.map +1 -1
  635. package/dist/modules/otp/otp.service.js +48 -4
  636. package/dist/modules/otp/otp.service.js.map +1 -1
  637. package/dist/modules/otp/services/otp.rate-limiter.d.ts +2 -0
  638. package/dist/modules/otp/services/otp.rate-limiter.d.ts.map +1 -1
  639. package/dist/modules/otp/services/otp.rate-limiter.js +19 -0
  640. package/dist/modules/otp/services/otp.rate-limiter.js.map +1 -1
  641. package/dist/modules/otp/services/otp.session.store.d.ts +9 -3
  642. package/dist/modules/otp/services/otp.session.store.d.ts.map +1 -1
  643. package/dist/modules/otp/services/otp.session.store.js +34 -42
  644. package/dist/modules/otp/services/otp.session.store.js.map +1 -1
  645. package/dist/modules/otp/utils/otp-code-hash.util.d.ts +11 -0
  646. package/dist/modules/otp/utils/otp-code-hash.util.d.ts.map +1 -0
  647. package/dist/modules/otp/utils/otp-code-hash.util.js +68 -0
  648. package/dist/modules/otp/utils/otp-code-hash.util.js.map +1 -0
  649. package/dist/modules/profile/controllers/profile.controller.d.ts +9 -3
  650. package/dist/modules/profile/controllers/profile.controller.d.ts.map +1 -1
  651. package/dist/modules/profile/controllers/profile.controller.js +140 -8
  652. package/dist/modules/profile/controllers/profile.controller.js.map +1 -1
  653. package/dist/modules/profile/dto/create-user-profile.dto.d.ts +10 -0
  654. package/dist/modules/profile/dto/create-user-profile.dto.d.ts.map +1 -1
  655. package/dist/modules/profile/dto/create-user-profile.dto.js +43 -1
  656. package/dist/modules/profile/dto/create-user-profile.dto.js.map +1 -1
  657. package/dist/modules/profile/dto/public-user-profile.dto.d.ts +24 -0
  658. package/dist/modules/profile/dto/public-user-profile.dto.d.ts.map +1 -0
  659. package/dist/modules/profile/dto/public-user-profile.dto.js +115 -0
  660. package/dist/modules/profile/dto/public-user-profile.dto.js.map +1 -0
  661. package/dist/modules/profile/dto/user-profile-response.dto.d.ts +4 -0
  662. package/dist/modules/profile/dto/user-profile-response.dto.d.ts.map +1 -1
  663. package/dist/modules/profile/dto/user-profile-response.dto.js +4 -0
  664. package/dist/modules/profile/dto/user-profile-response.dto.js.map +1 -1
  665. package/dist/modules/profile/dto/username-available.dto.d.ts +6 -0
  666. package/dist/modules/profile/dto/username-available.dto.d.ts.map +1 -0
  667. package/dist/modules/profile/dto/username-available.dto.js +31 -0
  668. package/dist/modules/profile/dto/username-available.dto.js.map +1 -0
  669. package/dist/modules/profile/entities/user-profiles.entity.d.ts +10 -0
  670. package/dist/modules/profile/entities/user-profiles.entity.d.ts.map +1 -1
  671. package/dist/modules/profile/entities/user-profiles.entity.js +29 -1
  672. package/dist/modules/profile/entities/user-profiles.entity.js.map +1 -1
  673. package/dist/modules/profile/index.d.ts +1 -0
  674. package/dist/modules/profile/index.d.ts.map +1 -1
  675. package/dist/modules/profile/index.js +1 -0
  676. package/dist/modules/profile/index.js.map +1 -1
  677. package/dist/modules/profile/profile.manifest.d.ts +2 -2
  678. package/dist/modules/profile/profile.manifest.js +2 -2
  679. package/dist/modules/profile/profile.manifest.js.map +1 -1
  680. package/dist/modules/profile/profile.module.d.ts.map +1 -1
  681. package/dist/modules/profile/profile.module.js +7 -2
  682. package/dist/modules/profile/profile.module.js.map +1 -1
  683. package/dist/modules/profile/services/profile.service.d.ts +56 -4
  684. package/dist/modules/profile/services/profile.service.d.ts.map +1 -1
  685. package/dist/modules/profile/services/profile.service.js +247 -20
  686. package/dist/modules/profile/services/profile.service.js.map +1 -1
  687. package/dist/modules/realtime/adapters/redis-io.adapter.d.ts +26 -0
  688. package/dist/modules/realtime/adapters/redis-io.adapter.d.ts.map +1 -0
  689. package/dist/modules/realtime/adapters/redis-io.adapter.js +124 -0
  690. package/dist/modules/realtime/adapters/redis-io.adapter.js.map +1 -0
  691. package/dist/modules/realtime/constants/realtime.constants.d.ts +36 -0
  692. package/dist/modules/realtime/constants/realtime.constants.d.ts.map +1 -0
  693. package/dist/modules/realtime/constants/realtime.constants.js +42 -0
  694. package/dist/modules/realtime/constants/realtime.constants.js.map +1 -0
  695. package/dist/modules/realtime/controllers/realtime.controller.d.ts +21 -0
  696. package/dist/modules/realtime/controllers/realtime.controller.d.ts.map +1 -0
  697. package/dist/modules/realtime/controllers/realtime.controller.js +113 -0
  698. package/dist/modules/realtime/controllers/realtime.controller.js.map +1 -0
  699. package/dist/modules/realtime/gateway/realtime.gateway.d.ts +42 -0
  700. package/dist/modules/realtime/gateway/realtime.gateway.d.ts.map +1 -0
  701. package/dist/modules/realtime/gateway/realtime.gateway.js +289 -0
  702. package/dist/modules/realtime/gateway/realtime.gateway.js.map +1 -0
  703. package/dist/modules/realtime/index.d.ts +12 -0
  704. package/dist/modules/realtime/index.d.ts.map +1 -0
  705. package/dist/modules/realtime/index.js +35 -0
  706. package/dist/modules/realtime/index.js.map +1 -0
  707. package/dist/modules/realtime/realtime.manifest.d.ts +8 -0
  708. package/dist/modules/realtime/realtime.manifest.d.ts.map +1 -0
  709. package/dist/modules/realtime/realtime.manifest.js +31 -0
  710. package/dist/modules/realtime/realtime.manifest.js.map +1 -0
  711. package/dist/modules/realtime/realtime.module.d.ts +14 -0
  712. package/dist/modules/realtime/realtime.module.d.ts.map +1 -0
  713. package/dist/modules/realtime/realtime.module.js +126 -0
  714. package/dist/modules/realtime/realtime.module.js.map +1 -0
  715. package/dist/modules/realtime/services/realtime-handler.registry.d.ts +16 -0
  716. package/dist/modules/realtime/services/realtime-handler.registry.d.ts.map +1 -0
  717. package/dist/modules/realtime/services/realtime-handler.registry.js +55 -0
  718. package/dist/modules/realtime/services/realtime-handler.registry.js.map +1 -0
  719. package/dist/modules/realtime/services/realtime-presence.service.d.ts +15 -0
  720. package/dist/modules/realtime/services/realtime-presence.service.d.ts.map +1 -0
  721. package/dist/modules/realtime/services/realtime-presence.service.js +86 -0
  722. package/dist/modules/realtime/services/realtime-presence.service.js.map +1 -0
  723. package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts +12 -0
  724. package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts.map +1 -0
  725. package/dist/modules/realtime/services/realtime-rate-limiter.service.js +63 -0
  726. package/dist/modules/realtime/services/realtime-rate-limiter.service.js.map +1 -0
  727. package/dist/modules/realtime/services/realtime.service.d.ts +88 -0
  728. package/dist/modules/realtime/services/realtime.service.d.ts.map +1 -0
  729. package/dist/modules/realtime/services/realtime.service.js +343 -0
  730. package/dist/modules/realtime/services/realtime.service.js.map +1 -0
  731. package/dist/modules/realtime/types/realtime.types.d.ts +50 -0
  732. package/dist/modules/realtime/types/realtime.types.d.ts.map +1 -0
  733. package/dist/modules/realtime/types/realtime.types.js +14 -0
  734. package/dist/modules/realtime/types/realtime.types.js.map +1 -0
  735. package/dist/modules/realtime/utils/handshake-error.util.d.ts +5 -0
  736. package/dist/modules/realtime/utils/handshake-error.util.d.ts.map +1 -0
  737. package/dist/modules/realtime/utils/handshake-error.util.js +45 -0
  738. package/dist/modules/realtime/utils/handshake-error.util.js.map +1 -0
  739. package/dist/modules/roles/controllers/modules.controller.d.ts +4 -3
  740. package/dist/modules/roles/controllers/modules.controller.d.ts.map +1 -1
  741. package/dist/modules/roles/controllers/modules.controller.js +21 -10
  742. package/dist/modules/roles/controllers/modules.controller.js.map +1 -1
  743. package/dist/modules/roles/controllers/permissions.controller.d.ts +4 -3
  744. package/dist/modules/roles/controllers/permissions.controller.d.ts.map +1 -1
  745. package/dist/modules/roles/controllers/permissions.controller.js +21 -10
  746. package/dist/modules/roles/controllers/permissions.controller.js.map +1 -1
  747. package/dist/modules/roles/controllers/roles.controller.d.ts +5 -4
  748. package/dist/modules/roles/controllers/roles.controller.d.ts.map +1 -1
  749. package/dist/modules/roles/controllers/roles.controller.js +26 -13
  750. package/dist/modules/roles/controllers/roles.controller.js.map +1 -1
  751. package/dist/modules/roles/controllers/user-roles.controller.d.ts +3 -2
  752. package/dist/modules/roles/controllers/user-roles.controller.d.ts.map +1 -1
  753. package/dist/modules/roles/controllers/user-roles.controller.js +14 -6
  754. package/dist/modules/roles/controllers/user-roles.controller.js.map +1 -1
  755. package/dist/modules/roles/services/modules.service.d.ts +8 -5
  756. package/dist/modules/roles/services/modules.service.d.ts.map +1 -1
  757. package/dist/modules/roles/services/modules.service.js +58 -12
  758. package/dist/modules/roles/services/modules.service.js.map +1 -1
  759. package/dist/modules/roles/services/permissions.service.d.ts +8 -5
  760. package/dist/modules/roles/services/permissions.service.d.ts.map +1 -1
  761. package/dist/modules/roles/services/permissions.service.js +61 -12
  762. package/dist/modules/roles/services/permissions.service.js.map +1 -1
  763. package/dist/modules/roles/services/roles.service.d.ts +19 -9
  764. package/dist/modules/roles/services/roles.service.d.ts.map +1 -1
  765. package/dist/modules/roles/services/roles.service.js +137 -47
  766. package/dist/modules/roles/services/roles.service.js.map +1 -1
  767. package/dist/modules/roles/services/user-roles.service.d.ts +12 -4
  768. package/dist/modules/roles/services/user-roles.service.d.ts.map +1 -1
  769. package/dist/modules/roles/services/user-roles.service.js +58 -26
  770. package/dist/modules/roles/services/user-roles.service.js.map +1 -1
  771. package/dist/modules/sessions/entities/refresh-token.entity.d.ts +7 -1
  772. package/dist/modules/sessions/entities/refresh-token.entity.d.ts.map +1 -1
  773. package/dist/modules/sessions/entities/refresh-token.entity.js +10 -0
  774. package/dist/modules/sessions/entities/refresh-token.entity.js.map +1 -1
  775. package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts +12 -0
  776. package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts.map +1 -0
  777. package/dist/modules/sessions/entities/revoked-refresh-family.entity.js +46 -0
  778. package/dist/modules/sessions/entities/revoked-refresh-family.entity.js.map +1 -0
  779. package/dist/modules/sessions/services/refresh-token-retention.service.d.ts +20 -0
  780. package/dist/modules/sessions/services/refresh-token-retention.service.d.ts.map +1 -0
  781. package/dist/modules/sessions/services/refresh-token-retention.service.js +97 -0
  782. package/dist/modules/sessions/services/refresh-token-retention.service.js.map +1 -0
  783. package/dist/modules/sessions/services/token.service.d.ts +150 -16
  784. package/dist/modules/sessions/services/token.service.d.ts.map +1 -1
  785. package/dist/modules/sessions/services/token.service.js +505 -74
  786. package/dist/modules/sessions/services/token.service.js.map +1 -1
  787. package/dist/modules/sessions/sessions.module.d.ts.map +1 -1
  788. package/dist/modules/sessions/sessions.module.js +4 -2
  789. package/dist/modules/sessions/sessions.module.js.map +1 -1
  790. package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts +13 -0
  791. package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts.map +1 -0
  792. package/dist/modules/sessions/utils/refresh-token-hash.util.js +37 -0
  793. package/dist/modules/sessions/utils/refresh-token-hash.util.js.map +1 -0
  794. package/dist/modules/settings/constants/settings.defaults.d.ts +57 -3
  795. package/dist/modules/settings/constants/settings.defaults.d.ts.map +1 -1
  796. package/dist/modules/settings/constants/settings.defaults.js +58 -3
  797. package/dist/modules/settings/constants/settings.defaults.js.map +1 -1
  798. package/dist/modules/settings/constants/settings.keys.d.ts +138 -2
  799. package/dist/modules/settings/constants/settings.keys.d.ts.map +1 -1
  800. package/dist/modules/settings/constants/settings.keys.js +140 -2
  801. package/dist/modules/settings/constants/settings.keys.js.map +1 -1
  802. package/dist/modules/settings/controllers/settings.controller.d.ts +5 -1
  803. package/dist/modules/settings/controllers/settings.controller.d.ts.map +1 -1
  804. package/dist/modules/settings/controllers/settings.controller.js +134 -5
  805. package/dist/modules/settings/controllers/settings.controller.js.map +1 -1
  806. package/dist/modules/settings/services/settings.service.d.ts +17 -7
  807. package/dist/modules/settings/services/settings.service.d.ts.map +1 -1
  808. package/dist/modules/settings/services/settings.service.js +80 -14
  809. package/dist/modules/settings/services/settings.service.js.map +1 -1
  810. package/dist/modules/settings/utils/settings-secret.util.d.ts +13 -0
  811. package/dist/modules/settings/utils/settings-secret.util.d.ts.map +1 -0
  812. package/dist/modules/settings/utils/settings-secret.util.js +80 -0
  813. package/dist/modules/settings/utils/settings-secret.util.js.map +1 -0
  814. package/dist/modules/users/controllers/users.controller.d.ts +4 -2
  815. package/dist/modules/users/controllers/users.controller.d.ts.map +1 -1
  816. package/dist/modules/users/controllers/users.controller.js +89 -10
  817. package/dist/modules/users/controllers/users.controller.js.map +1 -1
  818. package/dist/modules/users/dto/user.dto.d.ts +3 -0
  819. package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
  820. package/dist/modules/users/dto/user.dto.js +27 -4
  821. package/dist/modules/users/dto/user.dto.js.map +1 -1
  822. package/dist/modules/users/entities/user.entity.d.ts +7 -1
  823. package/dist/modules/users/entities/user.entity.d.ts.map +1 -1
  824. package/dist/modules/users/entities/user.entity.js +10 -0
  825. package/dist/modules/users/entities/user.entity.js.map +1 -1
  826. package/dist/modules/users/services/users.service.d.ts +15 -2
  827. package/dist/modules/users/services/users.service.d.ts.map +1 -1
  828. package/dist/modules/users/services/users.service.js +152 -37
  829. package/dist/modules/users/services/users.service.js.map +1 -1
  830. package/dist/modules/users/users.module.d.ts.map +1 -1
  831. package/dist/modules/users/users.module.js +1 -2
  832. package/dist/modules/users/users.module.js.map +1 -1
  833. package/package.json +19 -7
  834. package/dist/modules/admin/entities/admin-log.entity.d.ts +0 -20
  835. package/dist/modules/admin/entities/admin-log.entity.d.ts.map +0 -1
  836. package/dist/modules/admin/entities/admin-log.entity.js +0 -65
  837. package/dist/modules/admin/entities/admin-log.entity.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"file-upload.dto.d.ts","sourceRoot":"","sources":["../../../../src/modules/file-upload/dto/file-upload.dto.ts"],"names":[],"mappings":"AASA,qBAAa,aAAa;IASzB,QAAQ,EAAG,MAAM,CAAC;CAClB;AAED,qBAAa,iBAAiB;IAO7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,yBAAyB;IAKrC,IAAI,EAAG,MAAM,CAAC;IAGd,KAAK,EAAG,MAAM,CAAC;IAMf,UAAU,EAAG,MAAM,EAAE,CAAC;IAQtB,YAAY,EAAG,MAAM,CAAC;IAQtB,MAAM,EAAG,OAAO,CAAC;IAQjB,eAAe,EAAG,MAAM,CAAC;IAMzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAMlB,SAAS,CAAC,EAAE,MAAM,CAAC;IASnB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAQ9B,aAAa,CAAC,EAAE,OAAO,CAAC;IAQxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,qBAAa,uBAAuB;IAMnC,EAAE,EAAG,MAAM,CAAC;IAMZ,QAAQ,EAAG,MAAM,CAAC;IAOlB,YAAY,EAAG,MAAM,CAAC;IAMtB,QAAQ,EAAG,MAAM,CAAC;IAMlB,SAAS,EAAG,MAAM,CAAC;IAMnB,SAAS,EAAG,MAAM,CAAC;IAQnB,SAAS,CAAC,EAAE,MAAM,CAAC;IAMnB,cAAc,CAAC,EAAE,MAAM,CAAC;IAMxB,SAAS,EAAG,IAAI,CAAC;CACjB;AAED,qBAAa,0BAA0B;IAMtC,GAAG,EAAG,MAAM,CAAC;IAOb,SAAS,EAAG,MAAM,CAAC;CACnB;AAED,qBAAa,yBAAyB;IAOrC,QAAQ,EAAG,MAAM,CAAC;IAQlB,QAAQ,EAAG,MAAM,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B,EAAE,EAAG,MAAM,CAAC;CACZ;AAED,oDAAoD;AACpD,eAAO,MAAM,gCAAgC,EAAE,yBAAyB,EAyBvE,CAAC;AAEF,gDAAgD;AAChD,eAAO,MAAM,8BAA8B,EAAE,uBAU5C,CAAC"}
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.UPLOADED_FILE_RESPONSE_EXAMPLE = exports.UPLOAD_CATEGORY_RESPONSE_EXAMPLE = exports.FileIdParamDto = exports.DeleteFileResponseDto = exports.PresignedCompleteDto = exports.PresignedUploadResponseDto = exports.PresignedUploadRequestDto = exports.FileDownloadUrlResponseDto = exports.UploadedFileResponseDto = exports.UploadCategoryResponseDto = exports.ListFilesQueryDto = exports.UploadFileDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
+ const class_transformer_1 = require("class-transformer");
14
15
  const class_validator_1 = require("class-validator");
15
16
  const upload_types_1 = require("../constants/upload.types");
16
17
  class UploadFileDto {
@@ -29,6 +30,8 @@ __decorate([
29
30
  ], UploadFileDto.prototype, "category", void 0);
30
31
  class ListFilesQueryDto {
31
32
  category;
33
+ page = 1;
34
+ limit = 50;
32
35
  }
33
36
  exports.ListFilesQueryDto = ListFilesQueryDto;
34
37
  __decorate([
@@ -40,6 +43,23 @@ __decorate([
40
43
  (0, class_validator_1.IsString)(),
41
44
  __metadata("design:type", String)
42
45
  ], ListFilesQueryDto.prototype, "category", void 0);
46
+ __decorate([
47
+ (0, swagger_1.ApiPropertyOptional)({ default: 1, minimum: 1 }),
48
+ (0, class_validator_1.IsOptional)(),
49
+ (0, class_validator_1.IsInt)(),
50
+ (0, class_validator_1.Min)(1),
51
+ (0, class_transformer_1.Type)(() => Number),
52
+ __metadata("design:type", Number)
53
+ ], ListFilesQueryDto.prototype, "page", void 0);
54
+ __decorate([
55
+ (0, swagger_1.ApiPropertyOptional)({ default: 50, minimum: 1, maximum: 100 }),
56
+ (0, class_validator_1.IsOptional)(),
57
+ (0, class_validator_1.IsInt)(),
58
+ (0, class_validator_1.Min)(1),
59
+ (0, class_validator_1.Max)(100),
60
+ (0, class_transformer_1.Type)(() => Number),
61
+ __metadata("design:type", Number)
62
+ ], ListFilesQueryDto.prototype, "limit", void 0);
43
63
  class UploadCategoryResponseDto {
44
64
  slug;
45
65
  label;
@@ -1 +1 @@
1
- {"version":3,"file":"file-upload.dto.js","sourceRoot":"","sources":["../../../../src/modules/file-upload/dto/file-upload.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,qDAA4F;AAE5F,4DAImC;AAEnC,MAAa,aAAa;IASzB,QAAQ,CAAU;CAClB;AAVD,sCAUC;AADA;IARC,IAAA,qBAAW,EAAC;QACZ,OAAO,EAAE,eAAe;QACxB,WAAW,EACV,yDAAyD;YACzD,+FAA+F;KAChG,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;+CACK;AAGnB,MAAa,iBAAiB;IAO7B,QAAQ,CAAU;CAClB;AARD,8CAQC;AADA;IANC,IAAA,6BAAmB,EAAC;QACpB,OAAO,EAAE,eAAe;QACxB,WAAW,EAAE,4DAA4D;KACzE,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACO;AAGnB,MAAa,yBAAyB;IAKrC,IAAI,CAAU;IAGd,KAAK,CAAU;IAMf,UAAU,CAAY;IAQtB,YAAY,CAAU;IAQtB,MAAM,CAAW;IAQjB,eAAe,CAAU;IAMzB,QAAQ,CAAU;IAMlB,SAAS,CAAU;IASnB,oBAAoB,CAAU;IAQ9B,aAAa,CAAW;IAQxB,qBAAqB,CAAW;CAChC;AA5ED,8DA4EC;AAvEA;IAJC,IAAA,qBAAW,EAAC;QACZ,OAAO,EAAE,eAAe;QACxB,WAAW,EAAE,qDAAqD;KAClE,CAAC;;uDACY;AAGd;IADC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,e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KAAK;QACpB,qBAAqB,EAAE,KAAK;KAC5B;CACD,CAAC;AAEF,gDAAgD;AACnC,QAAA,8BAA8B,GAA4B;IACtE,EAAE,EAAE,sCAAsC;IAC1C,QAAQ,EAAE,eAAe;IACzB,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,iEAAiE;IAC5E,cAAc,EAAE,kEAAkE;IAClF,SAAS,EAAE,IAAI,IAAI,CAAC,0BAA0B,CAAC;CAC/C,CAAC"}
1
+ {"version":3,"file":"file-upload.dto.js","sourceRoot":"","sources":["../../../../src/modules/file-upload/dto/file-upload.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,yDAAyC;AACzC,qDAA4F;AAE5F,4DAImC;AAEnC,MAAa,aAAa;IASzB,QAAQ,CAAU;CAClB;AAVD,sCAUC;AADA;IARC,IAAA,qBAAW,EAAC;QACZ,OAAO,EAAE,eAAe;QACxB,WAAW,EACV,yDAAyD;YACzD,+FAA+F;KAChG,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;+CACK;AAGnB,MAAa,iBAAiB;IAO7B,QAAQ,CAAU;IAOlB,IAAI,GAAY,CAAC,CAAC;IAQlB,KAAK,GAAY,EAAE,CAAC;CACpB;AAvBD,8CAuBC;AAhBA;IANC,IAAA,6BAAmB,EAAC;QACpB,OAAO,EAAE,eAAe;QACxB,WAAW,EAAE,4DAA4D;KACzE,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACO;AAOlB;IALC,IAAA,6BAAmB,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAC/C,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,wBAAI,EAAC,G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,wCAIC;AADA;IAFC,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACnE,IAAA,wBAAM,GAAE;;0CACG;AAGb,oDAAoD;AACvC,QAAA,gCAAgC,GAAgC;IAC5E;QACC,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,eAAe;QACtB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;QAC1C,YAAY,EAAE,SAAS;QACvB,MAAM,EAAE,IAAI;QACZ,eAAe,EAAE,CAAC;QAClB,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,IAAI;QACf,oBAAoB,EAAE,SAAS;QAC/B,aAAa,EAAE,KAAK;QACpB,qBAAqB,EAAE,IAAI;KAC3B;IACD;QACC,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;QACjB,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;QACzC,YAAY,EAAE,UAAU;QACxB,MAAM,EAAE,KAAK;QACb,eAAe,EAAE,EAAE;QACnB,oBAAoB,EAAE,SAAS;QAC/B,aAAa,EAAE,KAAK;QACpB,qBAAqB,EAAE,KAAK;KAC5B;CACD,CAAC;AAEF,gDAAgD;AACnC,QAAA,8BAA8B,GAA4B;IACtE,EAAE,EAAE,sCAAsC;IAC1C,QAAQ,EAAE,eAAe;IACzB,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,iEAAiE;IAC5E,cAAc,EAAE,kEAAkE;IAClF,SAAS,EAAE,IAAI,IAAI,CAAC,0BAA0B,CAAC;CAC/C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"file-upload.module.d.ts","sourceRoot":"","sources":["../../../src/modules/file-upload/file-upload.module.ts"],"names":[],"mappings":"AAaA,qBAaa,gBAAgB;CAAG"}
1
+ {"version":3,"file":"file-upload.module.d.ts","sourceRoot":"","sources":["../../../src/modules/file-upload/file-upload.module.ts"],"names":[],"mappings":"AAcA,qBAsBa,gBAAgB;CAAG"}
@@ -10,6 +10,7 @@ exports.FileUploadModule = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
11
  const typeorm_1 = require("@nestjs/typeorm");
12
12
  const guards_1 = require("../../common/guards");
13
+ const profile_module_1 = require("../profile/profile.module");
13
14
  const file_upload_controller_1 = require("./controllers/file-upload.controller");
14
15
  const pending_file_upload_entity_1 = require("./entities/pending-file-upload.entity");
15
16
  const uploaded_file_entity_1 = require("./entities/uploaded-file.entity");
@@ -23,7 +24,10 @@ let FileUploadModule = class FileUploadModule {
23
24
  exports.FileUploadModule = FileUploadModule;
24
25
  exports.FileUploadModule = FileUploadModule = __decorate([
25
26
  (0, common_1.Module)({
26
- imports: [typeorm_1.TypeOrmModule.forFeature([uploaded_file_entity_1.UploadedFile, pending_file_upload_entity_1.PendingFileUpload])],
27
+ imports: [
28
+ typeorm_1.TypeOrmModule.forFeature([uploaded_file_entity_1.UploadedFile, pending_file_upload_entity_1.PendingFileUpload]),
29
+ (0, common_1.forwardRef)(() => profile_module_1.ProfileModule),
30
+ ],
27
31
  controllers: [file_upload_controller_1.FileUploadController],
28
32
  providers: [
29
33
  r2_storage_service_1.R2StorageService,
@@ -33,7 +37,13 @@ exports.FileUploadModule = FileUploadModule = __decorate([
33
37
  guards_1.UploadUserRateLimitGuard,
34
38
  { provide: file_scan_service_interface_1.IFileScanService, useClass: noop_file_scan_service_1.NoopFileScanService },
35
39
  ],
36
- exports: [file_upload_service_1.FileUploadService, r2_storage_service_1.R2StorageService, file_scan_service_interface_1.IFileScanService],
40
+ exports: [
41
+ file_upload_service_1.FileUploadService,
42
+ r2_storage_service_1.R2StorageService,
43
+ file_scan_service_interface_1.IFileScanService,
44
+ guards_1.UploadIpRateLimitGuard,
45
+ guards_1.UploadUserRateLimitGuard,
46
+ ],
37
47
  })
38
48
  ], FileUploadModule);
39
49
  //# sourceMappingURL=file-upload.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-upload.module.js","sourceRoot":"","sources":["../../../src/modules/file-upload/file-upload.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAEhD,gDAAuF;AACvF,iFAA4E;AAC5E,sFAA0E;AAC1E,0EAA+D;AAC/D,0FAA4E;AAC5E,wEAAmE;AACnE,8EAAwE;AACxE,sEAAiE;AACjE,4FAAsF;AAe/E,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IAb5B,IAAA,eAAM,EAAC;QACP,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,mCAAY,EAAE,8CAAiB,CAAC,CAAC,CAAC;QACtE,WAAW,EAAE,CAAC,6CAAoB,CAAC;QACnC,SAAS,EAAE;YACV,qCAAgB;YAChB,uCAAiB;YACjB,0DAA0B;YAC1B,+BAAsB;YACtB,iCAAwB;YACxB,EAAE,OAAO,EAAE,8CAAgB,EAAE,QAAQ,EAAE,4CAAmB,EAAE;SAC5D;QACD,OAAO,EAAE,CAAC,uCAAiB,EAAE,qCAAgB,EAAE,8CAAgB,CAAC;KAChE,CAAC;GACW,gBAAgB,CAAG"}
1
+ {"version":3,"file":"file-upload.module.js","sourceRoot":"","sources":["../../../src/modules/file-upload/file-upload.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAEhD,gDAAuF;AACvF,8DAA0D;AAC1D,iFAA4E;AAC5E,sFAA0E;AAC1E,0EAA+D;AAC/D,0FAA4E;AAC5E,wEAAmE;AACnE,8EAAwE;AACxE,sEAAiE;AACjE,4FAAsF;AAwB/E,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IAtB5B,IAAA,eAAM,EAAC;QACP,OAAO,EAAE;YACR,uBAAa,CAAC,UAAU,CAAC,CAAC,mCAAY,EAAE,8CAAiB,CAAC,CAAC;YAC3D,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAa,CAAC;SAC/B;QACD,WAAW,EAAE,CAAC,6CAAoB,CAAC;QACnC,SAAS,EAAE;YACV,qCAAgB;YAChB,uCAAiB;YACjB,0DAA0B;YAC1B,+BAAsB;YACtB,iCAAwB;YACxB,EAAE,OAAO,EAAE,8CAAgB,EAAE,QAAQ,EAAE,4CAAmB,EAAE;SAC5D;QACD,OAAO,EAAE;YACR,uCAAiB;YACjB,qCAAgB;YAChB,8CAAgB;YAChB,+BAAsB;YACtB,iCAAwB;SACxB;KACD,CAAC;GACW,gBAAgB,CAAG"}
@@ -1,6 +1,8 @@
1
1
  import { Readable } from 'stream';
2
2
  import { Repository } from 'typeorm';
3
+ import { AuditService } from '../../audit/services/audit.service';
3
4
  import { StructuredLoggerService } from '../../observability/logging/structured-logger.service';
5
+ import { UserProfilesService } from '../../profile/services/profile.service';
4
6
  import { SettingsService } from '../../settings/services/settings.service';
5
7
  import { UploadCategory } from '../constants/upload.types';
6
8
  import { PresignedCompleteDto, PresignedUploadRequestDto, PresignedUploadResponseDto, UploadCategoryResponseDto, UploadedFileResponseDto } from '../dto/file-upload.dto';
@@ -29,13 +31,21 @@ export declare class FileUploadService {
29
31
  private readonly settingsService;
30
32
  private readonly logger;
31
33
  private readonly fileScanService;
32
- constructor(fileRepo: Repository<UploadedFile>, pendingRepo: Repository<PendingFileUpload>, r2Storage: R2StorageService, settingsService: SettingsService, logger: StructuredLoggerService, fileScanService: IFileScanService);
34
+ private readonly audit;
35
+ private readonly profiles?;
36
+ constructor(fileRepo: Repository<UploadedFile>, pendingRepo: Repository<PendingFileUpload>, r2Storage: R2StorageService, settingsService: SettingsService, logger: StructuredLoggerService, fileScanService: IFileScanService, audit: AuditService, profiles?: UserProfilesService | undefined);
33
37
  getCategories(): UploadCategoryResponseDto[];
34
38
  upload(userId: string, categorySlug: string, file: MulterFilePayload): Promise<UploadedFileResponseDto>;
35
39
  createPresignedUpload(userId: string, dto: PresignedUploadRequestDto): Promise<PresignedUploadResponseDto>;
36
40
  completePresignedUpload(userId: string, dto: PresignedCompleteDto): Promise<UploadedFileResponseDto>;
37
41
  replaceFile(userId: string, fileId: string, file: MulterFilePayload): Promise<UploadedFileResponseDto>;
38
- listUserFiles(userId: string, categorySlug?: string): Promise<UploadedFileResponseDto[]>;
42
+ listUserFiles(userId: string, categorySlug?: string, page?: number, limit?: number): Promise<{
43
+ data: UploadedFileResponseDto[];
44
+ total: number;
45
+ page: number;
46
+ limit: number;
47
+ totalPages: number;
48
+ }>;
39
49
  getFile(userId: string, fileId: string): Promise<UploadedFileResponseDto>;
40
50
  getDownloadUrl(userId: string, fileId: string): Promise<{
41
51
  url: string;
@@ -45,12 +55,15 @@ export declare class FileUploadService {
45
55
  deleteFile(userId: string, fileId: string): Promise<{
46
56
  message: string;
47
57
  }>;
48
- /** Purges R2 objects for soft-deleted files older than the retention window. */
49
- purgeSoftDeletedStorage(retentionDays?: number): Promise<{
58
+ /**
59
+ * Purges R2 objects for soft-deleted files older than the retention window.
60
+ * Processes in bounded batches so large backlogs do not heap-spike.
61
+ */
62
+ purgeSoftDeletedStorage(retentionDays?: number, batchSize?: number, onBatch?: () => Promise<void>): Promise<{
50
63
  purged: number;
51
64
  }>;
52
- /** Deletes expired presigned reservations and orphaned R2 objects. */
53
- purgeExpiredPendingUploads(): Promise<{
65
+ /** Deletes expired presigned reservations and orphaned R2 objects (batched). */
66
+ purgeExpiredPendingUploads(batchSize?: number, onBatch?: () => Promise<void>): Promise<{
54
67
  purged: number;
55
68
  }>;
56
69
  private loadCategories;
@@ -70,6 +83,11 @@ export declare class FileUploadService {
70
83
  private findOwnedFile;
71
84
  private findAccessibleFile;
72
85
  assertUserFileCategory(userId: string, fileId: string, categorySlug: string): Promise<void>;
86
+ /**
87
+ * Resolve a public CDN URL for a user-owned file in the given category.
88
+ * Used to denormalize avatar URLs onto user_profiles.photo_url.
89
+ */
90
+ getRequiredPublicUrl(userId: string, fileId: string, categorySlug: string): Promise<string>;
73
91
  private extractExtension;
74
92
  private buildObjectKeyPrefix;
75
93
  private buildObjectKey;
@@ -1 +1 @@
1
- {"version":3,"file":"file-upload.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/file-upload/services/file-upload.service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAqC,UAAU,EAAE,MAAM,SAAS,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAGhG,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAMN,cAAc,EACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAW7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,iGAAiG;AACjG,MAAM,WAAW,iBAAiB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,qBACa,iBAAiB;IAG5B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AE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC;IAgBlB,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,MAAM;YAIA,cAAc;IAkB5B,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,SAAS;CAajB"}
@@ -18,7 +18,10 @@ const typeorm_1 = require("@nestjs/typeorm");
18
18
  const crypto_1 = require("crypto");
19
19
  const path_1 = require("path");
20
20
  const typeorm_2 = require("typeorm");
21
+ const audit_actions_1 = require("../../audit/constants/audit-actions");
22
+ const audit_service_1 = require("../../audit/services/audit.service");
21
23
  const structured_logger_service_1 = require("../../observability/logging/structured-logger.service");
24
+ const profile_service_1 = require("../../profile/services/profile.service");
22
25
  const settings_defaults_1 = require("../../settings/constants/settings.defaults");
23
26
  const settings_keys_1 = require("../../settings/constants/settings.keys");
24
27
  const settings_service_1 = require("../../settings/services/settings.service");
@@ -40,13 +43,17 @@ let FileUploadService = class FileUploadService {
40
43
  settingsService;
41
44
  logger;
42
45
  fileScanService;
43
- constructor(fileRepo, pendingRepo, r2Storage, settingsService, logger, fileScanService) {
46
+ audit;
47
+ profiles;
48
+ constructor(fileRepo, pendingRepo, r2Storage, settingsService, logger, fileScanService, audit, profiles) {
44
49
  this.fileRepo = fileRepo;
45
50
  this.pendingRepo = pendingRepo;
46
51
  this.r2Storage = r2Storage;
47
52
  this.settingsService = settingsService;
48
53
  this.logger = logger;
49
54
  this.fileScanService = fileScanService;
55
+ this.audit = audit;
56
+ this.profiles = profiles;
50
57
  }
51
58
  getCategories() {
52
59
  return this.loadCategories().map((c) => this.toCategoryDto(c));
@@ -83,6 +90,18 @@ let FileUploadService = class FileUploadService {
83
90
  fileId: record.id,
84
91
  sizeBytes: prepared.sizeBytes,
85
92
  });
93
+ this.audit.record({
94
+ action: audit_actions_1.AUDIT_ACTIONS.FILE_UPLOADED,
95
+ actorType: 'USER',
96
+ actorId: userId,
97
+ resourceType: 'file',
98
+ resourceId: record.id,
99
+ metadata: {
100
+ category: category.slug,
101
+ method: 'direct',
102
+ sizeBytes: prepared.sizeBytes,
103
+ },
104
+ });
86
105
  return this.toFileDto(record);
87
106
  }
88
107
  catch (err) {
@@ -161,7 +180,7 @@ let FileUploadService = class FileUploadService {
161
180
  this.assertExtensionAllowed(extension, category);
162
181
  this.assertMimeAllowed(dto.mimeType, extension);
163
182
  const object = await this.r2Storage.getObject(dto.objectKey);
164
- const buffer = await this.streamToBuffer(object.body);
183
+ const buffer = await this.streamToBuffer(object.body, category.maxSizeBytes);
165
184
  if (!(0, file_sniff_util_1.magicBytesMatchExtension)(buffer, extension)) {
166
185
  await this.r2Storage.deleteObject(dto.objectKey).catch(() => undefined);
167
186
  await this.pendingRepo.delete(pending.id);
@@ -189,6 +208,8 @@ let FileUploadService = class FileUploadService {
189
208
  let finalEtag = head.etag;
190
209
  let finalChecksum = this.sha256(buffer);
191
210
  if (category.optimizeImages) {
211
+ // Yield so other requests can progress before CPU-heavy Sharp work.
212
+ await new Promise((resolve) => setImmediate(resolve));
192
213
  const optimized = await (0, image_optimize_util_1.optimizeImageBuffer)(buffer, extension, category.optimizeImages);
193
214
  finalObjectKey = this.buildObjectKey(category.slug, userId, optimized.extension);
194
215
  finalMime = optimized.mimeType;
@@ -224,6 +245,18 @@ let FileUploadService = class FileUploadService {
224
245
  fileId: record.id,
225
246
  sizeBytes: finalSize,
226
247
  });
248
+ this.audit.record({
249
+ action: audit_actions_1.AUDIT_ACTIONS.FILE_UPLOADED,
250
+ actorType: 'USER',
251
+ actorId: userId,
252
+ resourceType: 'file',
253
+ resourceId: record.id,
254
+ metadata: {
255
+ category: category.slug,
256
+ method: 'presigned',
257
+ sizeBytes: finalSize,
258
+ },
259
+ });
227
260
  return this.toFileDto(record);
228
261
  }
229
262
  catch (err) {
@@ -265,7 +298,21 @@ let FileUploadService = class FileUploadService {
265
298
  if (oldObjectKey !== prepared.objectKey) {
266
299
  await this.r2Storage.deleteObject(oldObjectKey).catch(() => undefined);
267
300
  }
301
+ if (category.slug === upload_types_1.UPLOAD_CATEGORY_PROFILE_PHOTO) {
302
+ await this.profiles?.syncPhotoUrlForFile(userId, fileId, publicUrl ?? null);
303
+ }
304
+ else if (category.slug === upload_types_1.UPLOAD_CATEGORY_COVER_PHOTO) {
305
+ await this.profiles?.syncCoverUrlForFile(userId, fileId, publicUrl ?? null);
306
+ }
268
307
  this.logFileEvent('files.replace.success', userId, category.slug, { fileId });
308
+ this.audit.record({
309
+ action: audit_actions_1.AUDIT_ACTIONS.FILE_REPLACED,
310
+ actorType: 'USER',
311
+ actorId: userId,
312
+ resourceType: 'file',
313
+ resourceId: fileId,
314
+ metadata: { category: category.slug },
315
+ });
269
316
  return this.toFileDto(updated);
270
317
  }
271
318
  catch (err) {
@@ -281,17 +328,27 @@ let FileUploadService = class FileUploadService {
281
328
  await (0, file_payload_util_1.cleanupMulterDiskFile)(file);
282
329
  }
283
330
  }
284
- async listUserFiles(userId, categorySlug) {
331
+ async listUserFiles(userId, categorySlug, page = 1, limit = 50) {
285
332
  const where = { userId };
286
333
  if (categorySlug) {
287
334
  this.resolveCategory(categorySlug);
288
335
  where.category = categorySlug;
289
336
  }
290
- const files = await this.fileRepo.find({
337
+ const take = Math.min(Math.max(limit, 1), 100);
338
+ const currentPage = Math.max(page, 1);
339
+ const [files, total] = await this.fileRepo.findAndCount({
291
340
  where,
292
341
  order: { createdAt: 'DESC' },
342
+ skip: (currentPage - 1) * take,
343
+ take,
293
344
  });
294
- return files.map((f) => this.toFileDto(f));
345
+ return {
346
+ data: files.map((f) => this.toFileDto(f)),
347
+ total,
348
+ page: currentPage,
349
+ limit: take,
350
+ totalPages: Math.ceil(total / take) || 0,
351
+ };
295
352
  }
296
353
  async getFile(userId, fileId) {
297
354
  const file = await this.findOwnedFile(userId, fileId);
@@ -321,49 +378,93 @@ let FileUploadService = class FileUploadService {
321
378
  const file = await this.findOwnedFile(userId, fileId);
322
379
  await this.r2Storage.deleteObject(file.objectKey);
323
380
  await this.fileRepo.softRemove(file);
381
+ if (file.category === upload_types_1.UPLOAD_CATEGORY_PROFILE_PHOTO) {
382
+ await this.profiles?.clearPhotoIfFileDeleted(userId, fileId);
383
+ }
384
+ else if (file.category === upload_types_1.UPLOAD_CATEGORY_COVER_PHOTO) {
385
+ await this.profiles?.clearCoverIfFileDeleted(userId, fileId);
386
+ }
324
387
  this.logFileEvent('files.delete.success', userId, file.category, { fileId });
388
+ this.audit.record({
389
+ action: audit_actions_1.AUDIT_ACTIONS.FILE_DELETED,
390
+ actorType: 'USER',
391
+ actorId: userId,
392
+ resourceType: 'file',
393
+ resourceId: fileId,
394
+ metadata: { category: file.category },
395
+ });
325
396
  return { message: 'File deleted successfully.' };
326
397
  }
327
- /** Purges R2 objects for soft-deleted files older than the retention window. */
328
- async purgeSoftDeletedStorage(retentionDays = 7) {
398
+ /**
399
+ * Purges R2 objects for soft-deleted files older than the retention window.
400
+ * Processes in bounded batches so large backlogs do not heap-spike.
401
+ */
402
+ async purgeSoftDeletedStorage(retentionDays = 7, batchSize = 200, onBatch) {
329
403
  if (!this.r2Storage.isEnabled())
330
404
  return { purged: 0 };
331
405
  const cutoff = new Date(Date.now() - retentionDays * 24 * 60 * 60 * 1000);
332
- const stale = await this.fileRepo
333
- .createQueryBuilder('f')
334
- .withDeleted()
335
- .where('f.deleted_at IS NOT NULL')
336
- .andWhere('f.deleted_at < :cutoff', { cutoff })
337
- .getMany();
406
+ const limit = Math.max(1, Math.min(batchSize, 500));
338
407
  let purged = 0;
339
- for (const file of stale) {
340
- try {
341
- await this.r2Storage.deleteObject(file.objectKey);
342
- purged++;
343
- }
344
- catch {
345
- // Best-effort — object may already be gone
408
+ for (;;) {
409
+ const stale = await this.fileRepo
410
+ .createQueryBuilder('f')
411
+ .withDeleted()
412
+ .where('f.deleted_at IS NOT NULL')
413
+ .andWhere('f.deleted_at < :cutoff', { cutoff })
414
+ .take(limit)
415
+ .getMany();
416
+ if (stale.length === 0)
417
+ break;
418
+ for (const file of stale) {
419
+ try {
420
+ await this.r2Storage.deleteObject(file.objectKey);
421
+ // Hard-delete so the next batch does not re-select the same rows.
422
+ await this.fileRepo
423
+ .createQueryBuilder()
424
+ .delete()
425
+ .from(uploaded_file_entity_1.UploadedFile)
426
+ .where('id = :id', { id: file.id })
427
+ .execute();
428
+ purged++;
429
+ }
430
+ catch {
431
+ // Best-effort — leave the soft-deleted row for a later pass
432
+ }
346
433
  }
434
+ if (onBatch)
435
+ await onBatch();
436
+ if (stale.length < limit)
437
+ break;
347
438
  }
348
439
  return { purged };
349
440
  }
350
- /** Deletes expired presigned reservations and orphaned R2 objects. */
351
- async purgeExpiredPendingUploads() {
441
+ /** Deletes expired presigned reservations and orphaned R2 objects (batched). */
442
+ async purgeExpiredPendingUploads(batchSize = 200, onBatch) {
352
443
  if (!this.r2Storage.isEnabled())
353
444
  return { purged: 0 };
354
- const expired = await this.pendingRepo.find({
355
- where: { expiresAt: (0, typeorm_2.LessThan)(new Date()) },
356
- });
445
+ const limit = Math.max(1, Math.min(batchSize, 500));
357
446
  let purged = 0;
358
- for (const pending of expired) {
359
- try {
360
- await this.r2Storage.deleteObject(pending.objectKey);
361
- }
362
- catch {
363
- // Object may never have been uploaded
447
+ for (;;) {
448
+ const expired = await this.pendingRepo.find({
449
+ where: { expiresAt: (0, typeorm_2.LessThan)(new Date()) },
450
+ take: limit,
451
+ });
452
+ if (expired.length === 0)
453
+ break;
454
+ for (const pending of expired) {
455
+ try {
456
+ await this.r2Storage.deleteObject(pending.objectKey);
457
+ }
458
+ catch {
459
+ // Object may never have been uploaded
460
+ }
461
+ await this.pendingRepo.delete(pending.id);
462
+ purged++;
364
463
  }
365
- await this.pendingRepo.delete(pending.id);
366
- purged++;
464
+ if (onBatch)
465
+ await onBatch();
466
+ if (expired.length < limit)
467
+ break;
367
468
  }
368
469
  return { purged };
369
470
  }
@@ -562,6 +663,21 @@ let FileUploadService = class FileUploadService {
562
663
  throw new common_1.BadRequestException(`File must belong to category "${categorySlug}". Got "${file.category}".`);
563
664
  }
564
665
  }
666
+ /**
667
+ * Resolve a public CDN URL for a user-owned file in the given category.
668
+ * Used to denormalize avatar URLs onto user_profiles.photo_url.
669
+ */
670
+ async getRequiredPublicUrl(userId, fileId, categorySlug) {
671
+ const file = await this.findOwnedFile(userId, fileId);
672
+ if (file.category !== categorySlug) {
673
+ throw new common_1.BadRequestException(`File must belong to category "${categorySlug}". Got "${file.category}".`);
674
+ }
675
+ const category = this.resolveCategory(file.category);
676
+ if (!category.public || !file.publicUrl) {
677
+ throw new common_1.BadRequestException(`File "${fileId}" must be in a public category with a public URL.`);
678
+ }
679
+ return file.publicUrl;
680
+ }
565
681
  extractExtension(filename) {
566
682
  const ext = (0, path_1.extname)(filename).replace(/^\./, '').toLowerCase();
567
683
  if (!ext) {
@@ -581,10 +697,18 @@ let FileUploadService = class FileUploadService {
581
697
  sha256(buffer) {
582
698
  return (0, crypto_1.createHash)('sha256').update(buffer).digest('hex');
583
699
  }
584
- async streamToBuffer(stream) {
700
+ async streamToBuffer(stream, maxBytes) {
701
+ const cap = Math.min(Math.max(maxBytes, 1), upload_types_1.UPLOAD_ABSOLUTE_MAX_BYTES);
585
702
  const chunks = [];
703
+ let total = 0;
586
704
  for await (const chunk of stream) {
587
- chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
705
+ const buf = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
706
+ total += buf.length;
707
+ if (total > cap) {
708
+ stream.destroy();
709
+ throw new common_1.BadRequestException(`Uploaded object exceeds maximum size of ${cap} bytes.`);
710
+ }
711
+ chunks.push(buf);
588
712
  }
589
713
  return Buffer.concat(chunks);
590
714
  }
@@ -629,11 +753,15 @@ exports.FileUploadService = FileUploadService = __decorate([
629
753
  __param(0, (0, typeorm_1.InjectRepository)(uploaded_file_entity_1.UploadedFile)),
630
754
  __param(1, (0, typeorm_1.InjectRepository)(pending_file_upload_entity_1.PendingFileUpload)),
631
755
  __param(5, (0, common_1.Inject)(file_scan_service_interface_1.IFileScanService)),
756
+ __param(7, (0, common_1.Optional)()),
757
+ __param(7, (0, common_1.Inject)((0, common_1.forwardRef)(() => profile_service_1.UserProfilesService))),
632
758
  __metadata("design:paramtypes", [typeorm_2.Repository,
633
759
  typeorm_2.Repository,
634
760
  r2_storage_service_1.R2StorageService,
635
761
  settings_service_1.SettingsService,
636
762
  structured_logger_service_1.StructuredLoggerService,
637
- file_scan_service_interface_1.IFileScanService])
763
+ file_scan_service_interface_1.IFileScanService,
764
+ audit_service_1.AuditService,
765
+ profile_service_1.UserProfilesService])
638
766
  ], FileUploadService);
639
767
  //# sourceMappingURL=file-upload.service.js.map