@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.
- package/CHANGELOG.md +17 -0
- package/README.md +6 -0
- package/dist/bootstrap/bootstrap-colveor-app.d.ts.map +1 -1
- package/dist/bootstrap/bootstrap-colveor-app.js +22 -3
- package/dist/bootstrap/bootstrap-colveor-app.js.map +1 -1
- package/dist/common/decorators/index.d.ts +6 -0
- package/dist/common/decorators/index.d.ts.map +1 -1
- package/dist/common/decorators/index.js +8 -1
- package/dist/common/decorators/index.js.map +1 -1
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts +9 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts.map +1 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.js +12 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.js.map +1 -0
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts +12 -6
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts.map +1 -1
- package/dist/common/guards/login-ip-rate-limit.guard.js +65 -21
- package/dist/common/guards/login-ip-rate-limit.guard.js.map +1 -1
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts +3 -2
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts.map +1 -1
- package/dist/common/guards/otp-ip-rate-limit.guard.js +17 -15
- package/dist/common/guards/otp-ip-rate-limit.guard.js.map +1 -1
- package/dist/common/guards/permissions.guard.d.ts.map +1 -1
- package/dist/common/guards/permissions.guard.js +12 -2
- package/dist/common/guards/permissions.guard.js.map +1 -1
- package/dist/common/interceptors/timeout.interceptor.d.ts +1 -1
- package/dist/common/interceptors/timeout.interceptor.d.ts.map +1 -1
- package/dist/common/interceptors/timeout.interceptor.js +5 -1
- package/dist/common/interceptors/timeout.interceptor.js.map +1 -1
- package/dist/common/interfaces/request-user.d.ts +4 -3
- package/dist/common/interfaces/request-user.d.ts.map +1 -1
- package/dist/common/utils/cache-version.util.d.ts +12 -0
- package/dist/common/utils/cache-version.util.d.ts.map +1 -0
- package/dist/common/utils/cache-version.util.js +34 -0
- package/dist/common/utils/cache-version.util.js.map +1 -0
- package/dist/common/utils/postgres-error.util.d.ts +5 -0
- package/dist/common/utils/postgres-error.util.d.ts.map +1 -0
- package/dist/common/utils/postgres-error.util.js +13 -0
- package/dist/common/utils/postgres-error.util.js.map +1 -0
- package/dist/common/utils/singleflight.util.d.ts +6 -0
- package/dist/common/utils/singleflight.util.d.ts.map +1 -0
- package/dist/common/utils/singleflight.util.js +21 -0
- package/dist/common/utils/singleflight.util.js.map +1 -0
- package/dist/common/validators/is-exclusive-auth-params.validator.js +1 -1
- package/dist/common/validators/is-exclusive-auth-params.validator.js.map +1 -1
- package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js +1 -1
- package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js.map +1 -1
- package/dist/config/app.config.d.ts +38 -0
- package/dist/config/app.config.d.ts.map +1 -1
- package/dist/config/app.config.js +24 -0
- package/dist/config/app.config.js.map +1 -1
- package/dist/config/database.config.d.ts +6 -0
- package/dist/config/database.config.d.ts.map +1 -1
- package/dist/config/database.config.js +3 -0
- package/dist/config/database.config.js.map +1 -1
- package/dist/config/env-flags.util.d.ts +4 -0
- package/dist/config/env-flags.util.d.ts.map +1 -1
- package/dist/config/env-flags.util.js +7 -0
- package/dist/config/env-flags.util.js.map +1 -1
- package/dist/config/env.validation.d.ts +24 -1
- package/dist/config/env.validation.d.ts.map +1 -1
- package/dist/config/env.validation.js +92 -2
- package/dist/config/env.validation.js.map +1 -1
- package/dist/config/in-memory-redis.client.d.ts +23 -4
- package/dist/config/in-memory-redis.client.d.ts.map +1 -1
- package/dist/config/in-memory-redis.client.js +148 -4
- package/dist/config/in-memory-redis.client.js.map +1 -1
- package/dist/config/redis.module.d.ts.map +1 -1
- package/dist/config/redis.module.js +5 -0
- package/dist/config/redis.module.js.map +1 -1
- package/dist/core.module.d.ts +5 -0
- package/dist/core.module.d.ts.map +1 -1
- package/dist/core.module.js +5 -0
- package/dist/core.module.js.map +1 -1
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts +7 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts.map +1 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.js +24 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.js.map +1 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts +7 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js +16 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js.map +1 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts +7 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.js +14 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.js.map +1 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts +13 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.js +35 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.js.map +1 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts +11 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts.map +1 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.js +60 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.js.map +1 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts +14 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts.map +1 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js +39 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js.map +1 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts +13 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.js +69 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts +11 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js +51 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts +12 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js +37 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts +12 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts.map +1 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.js +74 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.js.map +1 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts +12 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts.map +1 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.js +52 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.js.map +1 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts +11 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js +36 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js.map +1 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts +12 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js +39 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js.map +1 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts +12 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js +39 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js.map +1 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts +13 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js +72 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js.map +1 -0
- package/dist/database/migrations/1785006199386-audit-events.d.ts +10 -0
- package/dist/database/migrations/1785006199386-audit-events.d.ts.map +1 -0
- package/dist/database/migrations/1785006199386-audit-events.js +60 -0
- package/dist/database/migrations/1785006199386-audit-events.js.map +1 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts +10 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts.map +1 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js +25 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js.map +1 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.d.ts +11 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.d.ts.map +1 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.js +157 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.js.map +1 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts +10 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts.map +1 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.js +38 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.js.map +1 -0
- package/dist/database/migrations/1785006199390-audit-hardening.d.ts +14 -0
- package/dist/database/migrations/1785006199390-audit-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199390-audit-hardening.js +345 -0
- package/dist/database/migrations/1785006199390-audit-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts +10 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts.map +1 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.js +39 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.js.map +1 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.d.ts +11 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.d.ts.map +1 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.js +33 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.js.map +1 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.d.ts +11 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.d.ts.map +1 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.js +33 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.js.map +1 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts +11 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts.map +1 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.js +24 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.js.map +1 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts +10 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.js +35 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.js.map +1 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts +11 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts.map +1 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.js +23 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.js.map +1 -0
- package/dist/database/seeds/roles.seed.d.ts +6 -0
- package/dist/database/seeds/roles.seed.d.ts.map +1 -1
- package/dist/database/seeds/roles.seed.js +22 -5
- package/dist/database/seeds/roles.seed.js.map +1 -1
- package/dist/database/seeds/settings.seed.d.ts +5 -0
- package/dist/database/seeds/settings.seed.d.ts.map +1 -1
- package/dist/database/seeds/settings.seed.js +500 -25
- package/dist/database/seeds/settings.seed.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.d.ts +1 -0
- package/dist/database/seeds/templates/html-template.reader.d.ts.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.js +3 -1
- package/dist/database/seeds/templates/html-template.reader.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.ts +5 -1
- package/dist/database/typeorm.util.d.ts.map +1 -1
- package/dist/database/typeorm.util.js +6 -0
- package/dist/database/typeorm.util.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -4
- package/dist/index.js.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.d.ts +15 -7
- package/dist/modules/admin/controllers/admin.controller.d.ts.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.js +74 -17
- package/dist/modules/admin/controllers/admin.controller.js.map +1 -1
- package/dist/modules/admin/services/admin-log.service.d.ts +14 -7
- package/dist/modules/admin/services/admin-log.service.d.ts.map +1 -1
- package/dist/modules/admin/services/admin-log.service.js +41 -38
- package/dist/modules/admin/services/admin-log.service.js.map +1 -1
- package/dist/modules/audit/audit.manifest.d.ts +8 -0
- package/dist/modules/audit/audit.manifest.d.ts.map +1 -0
- package/dist/modules/audit/audit.manifest.js +31 -0
- package/dist/modules/audit/audit.manifest.js.map +1 -0
- package/dist/modules/audit/audit.module.d.ts +8 -0
- package/dist/modules/audit/audit.module.d.ts.map +1 -0
- package/dist/modules/audit/audit.module.js +57 -0
- package/dist/modules/audit/audit.module.js.map +1 -0
- package/dist/modules/audit/constants/audit-actions.d.ts +79 -0
- package/dist/modules/audit/constants/audit-actions.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-actions.js +89 -0
- package/dist/modules/audit/constants/audit-actions.js.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts +10 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.js +13 -0
- package/dist/modules/audit/constants/audit-mutation.js.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts +13 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.js +149 -0
- package/dist/modules/audit/controllers/audit.controller.js.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts +27 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.js +18 -0
- package/dist/modules/audit/decorators/audit.decorator.js.map +1 -0
- package/dist/modules/audit/dto/audit.dto.d.ts +54 -0
- package/dist/modules/audit/dto/audit.dto.d.ts.map +1 -0
- package/dist/modules/audit/dto/audit.dto.js +129 -0
- package/dist/modules/audit/dto/audit.dto.js.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts +33 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.js +125 -0
- package/dist/modules/audit/entities/audit-event.entity.js.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts +16 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js +65 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js.map +1 -0
- package/dist/modules/audit/index.d.ts +13 -0
- package/dist/modules/audit/index.d.ts.map +1 -0
- package/dist/modules/audit/index.js +23 -0
- package/dist/modules/audit/index.js.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts +11 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js +75 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts +31 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js +338 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.js +132 -0
- package/dist/modules/audit/services/audit-archive.service.js.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts +22 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js +79 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.js +99 -0
- package/dist/modules/audit/services/audit-leader.service.js.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts +29 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.js +144 -0
- package/dist/modules/audit/services/audit-outbox.worker.js.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts +18 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.js +70 -0
- package/dist/modules/audit/services/audit-partition.service.js.map +1 -0
- package/dist/modules/audit/services/audit-write.service.d.ts +60 -0
- package/dist/modules/audit/services/audit-write.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-write.service.js +463 -0
- package/dist/modules/audit/services/audit-write.service.js.map +1 -0
- package/dist/modules/audit/services/audit.service.d.ts +60 -0
- package/dist/modules/audit/services/audit.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit.service.js +373 -0
- package/dist/modules/audit/services/audit.service.js.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts +20 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.js +44 -0
- package/dist/modules/audit/utils/audit-hash.util.js.map +1 -0
- package/dist/modules/auth/auth-core/auth-core.module.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/auth-core.module.js +16 -4
- package/dist/modules/auth/auth-core/auth-core.module.js.map +1 -1
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts +22 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js +25 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts +19 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js +110 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts +7 -8
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js +34 -34
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js.map +1 -1
- package/dist/modules/auth/auth.manifest.d.ts +6 -0
- package/dist/modules/auth/auth.manifest.d.ts.map +1 -1
- package/dist/modules/auth/auth.manifest.js +38 -2
- package/dist/modules/auth/auth.manifest.js.map +1 -1
- package/dist/modules/auth/auth.module.d.ts.map +1 -1
- package/dist/modules/auth/auth.module.js +39 -4
- package/dist/modules/auth/auth.module.js.map +1 -1
- package/dist/modules/auth/controllers/account.controller.d.ts +15 -1
- package/dist/modules/auth/controllers/account.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/account.controller.js +65 -7
- package/dist/modules/auth/controllers/account.controller.js.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.d.ts +7 -3
- package/dist/modules/auth/controllers/auth.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.js +76 -16
- package/dist/modules/auth/controllers/auth.controller.js.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts +4 -2
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.js +32 -11
- package/dist/modules/auth/controllers/forgot-password.controller.js.map +1 -1
- package/dist/modules/auth/controllers/mfa.controller.d.ts +18 -0
- package/dist/modules/auth/controllers/mfa.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/mfa.controller.js +192 -0
- package/dist/modules/auth/controllers/mfa.controller.js.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts +22 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.js +192 -0
- package/dist/modules/auth/controllers/oauth.controller.js.map +1 -0
- package/dist/modules/auth/controllers/otp.controller.d.ts +6 -3
- package/dist/modules/auth/controllers/otp.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/otp.controller.js +32 -33
- package/dist/modules/auth/controllers/otp.controller.js.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.js +10 -2
- package/dist/modules/auth/controllers/pin.controller.js.map +1 -1
- package/dist/modules/auth/controllers/session.controller.d.ts +12 -4
- package/dist/modules/auth/controllers/session.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/session.controller.js +130 -31
- package/dist/modules/auth/controllers/session.controller.js.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.d.ts +11 -2
- package/dist/modules/auth/dto/auth-config.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.js +78 -3
- package/dist/modules/auth/dto/auth-config.dto.js.map +1 -1
- package/dist/modules/auth/dto/index.d.ts +2 -0
- package/dist/modules/auth/dto/index.d.ts.map +1 -1
- package/dist/modules/auth/dto/index.js +2 -0
- package/dist/modules/auth/dto/index.js.map +1 -1
- package/dist/modules/auth/dto/login.dto.d.ts +8 -1
- package/dist/modules/auth/dto/login.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/login.dto.js +48 -3
- package/dist/modules/auth/dto/login.dto.js.map +1 -1
- package/dist/modules/auth/dto/mfa.dto.d.ts +61 -0
- package/dist/modules/auth/dto/mfa.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/mfa.dto.js +326 -0
- package/dist/modules/auth/dto/mfa.dto.js.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts +45 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.js +249 -0
- package/dist/modules/auth/dto/oauth.dto.js.map +1 -0
- package/dist/modules/auth/dto/otp.dto.d.ts +3 -1
- package/dist/modules/auth/dto/otp.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/otp.dto.js +19 -0
- package/dist/modules/auth/dto/otp.dto.js.map +1 -1
- package/dist/modules/auth/dto/password.dto.d.ts +28 -0
- package/dist/modules/auth/dto/password.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/password.dto.js +191 -5
- package/dist/modules/auth/dto/password.dto.js.map +1 -1
- package/dist/modules/auth/dto/register.dto.d.ts +1 -0
- package/dist/modules/auth/dto/register.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/register.dto.js +1 -0
- package/dist/modules/auth/dto/register.dto.js.map +1 -1
- package/dist/modules/auth/dto/session.dto.d.ts +20 -0
- package/dist/modules/auth/dto/session.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/session.dto.js +98 -0
- package/dist/modules/auth/dto/session.dto.js.map +1 -0
- package/dist/modules/auth/dto/token.dto.d.ts +38 -1
- package/dist/modules/auth/dto/token.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/token.dto.js +21 -1
- package/dist/modules/auth/dto/token.dto.js.map +1 -1
- package/dist/modules/auth/entities/index.d.ts +2 -0
- package/dist/modules/auth/entities/index.d.ts.map +1 -1
- package/dist/modules/auth/entities/index.js +2 -0
- package/dist/modules/auth/entities/index.js.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts +2 -0
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.js +6 -0
- package/dist/modules/auth/entities/password-reset-token.entity.js.map +1 -1
- package/dist/modules/auth/entities/user-mfa.entity.d.ts +19 -0
- package/dist/modules/auth/entities/user-mfa.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-mfa.entity.js +73 -0
- package/dist/modules/auth/entities/user-mfa.entity.js.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts +24 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js +84 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js.map +1 -0
- package/dist/modules/auth/events/auth.events.d.ts +84 -19
- package/dist/modules/auth/events/auth.events.d.ts.map +1 -1
- package/dist/modules/auth/events/auth.events.js +17 -9
- package/dist/modules/auth/events/auth.events.js.map +1 -1
- package/dist/modules/auth/services/account.service.d.ts +74 -14
- package/dist/modules/auth/services/account.service.d.ts.map +1 -1
- package/dist/modules/auth/services/account.service.js +247 -31
- package/dist/modules/auth/services/account.service.js.map +1 -1
- package/dist/modules/auth/services/dpop.service.d.ts +41 -0
- package/dist/modules/auth/services/dpop.service.d.ts.map +1 -0
- package/dist/modules/auth/services/dpop.service.js +159 -0
- package/dist/modules/auth/services/dpop.service.js.map +1 -0
- package/dist/modules/auth/services/index.d.ts +2 -0
- package/dist/modules/auth/services/index.d.ts.map +1 -1
- package/dist/modules/auth/services/index.js +2 -0
- package/dist/modules/auth/services/index.js.map +1 -1
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts +28 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts.map +1 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js +163 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js.map +1 -0
- package/dist/modules/auth/services/login.service.d.ts +29 -34
- package/dist/modules/auth/services/login.service.d.ts.map +1 -1
- package/dist/modules/auth/services/login.service.js +173 -61
- package/dist/modules/auth/services/login.service.js.map +1 -1
- package/dist/modules/auth/services/mfa.service.d.ts +111 -0
- package/dist/modules/auth/services/mfa.service.d.ts.map +1 -0
- package/dist/modules/auth/services/mfa.service.js +662 -0
- package/dist/modules/auth/services/mfa.service.js.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js +56 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts +12 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js +64 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js +76 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts +16 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js +92 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts +9 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js +3 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js.map +1 -0
- package/dist/modules/auth/services/oauth.service.d.ts +83 -0
- package/dist/modules/auth/services/oauth.service.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth.service.js +471 -0
- package/dist/modules/auth/services/oauth.service.js.map +1 -0
- package/dist/modules/auth/services/otp-auth.service.d.ts +13 -3
- package/dist/modules/auth/services/otp-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/otp-auth.service.js +41 -7
- package/dist/modules/auth/services/otp-auth.service.js.map +1 -1
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts +22 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts.map +1 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js +117 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js.map +1 -0
- package/dist/modules/auth/services/password.service.d.ts +25 -5
- package/dist/modules/auth/services/password.service.d.ts.map +1 -1
- package/dist/modules/auth/services/password.service.js +154 -20
- package/dist/modules/auth/services/password.service.js.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.d.ts +10 -3
- package/dist/modules/auth/services/pin-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.js +110 -13
- package/dist/modules/auth/services/pin-auth.service.js.map +1 -1
- package/dist/modules/auth/services/registration.service.d.ts +10 -2
- package/dist/modules/auth/services/registration.service.d.ts.map +1 -1
- package/dist/modules/auth/services/registration.service.js +113 -25
- package/dist/modules/auth/services/registration.service.js.map +1 -1
- package/dist/modules/auth/services/turnstile.service.d.ts +17 -0
- package/dist/modules/auth/services/turnstile.service.d.ts.map +1 -0
- package/dist/modules/auth/services/turnstile.service.js +94 -0
- package/dist/modules/auth/services/turnstile.service.js.map +1 -0
- package/dist/modules/auth/utils/auth-params.util.d.ts +13 -6
- package/dist/modules/auth/utils/auth-params.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-params.util.js +27 -4
- package/dist/modules/auth/utils/auth-params.util.js.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts +12 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.js +36 -4
- package/dist/modules/auth/utils/auth-supported.util.js.map +1 -1
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts +10 -0
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js +31 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts +5 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.js +22 -0
- package/dist/modules/auth/utils/backup-codes.util.js.map +1 -0
- package/dist/modules/auth/utils/dpop.util.d.ts +22 -0
- package/dist/modules/auth/utils/dpop.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/dpop.util.js +73 -0
- package/dist/modules/auth/utils/dpop.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts +22 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.js +59 -0
- package/dist/modules/auth/utils/mfa-secret.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts +26 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js +49 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts +5 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js +18 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js.map +1 -0
- package/dist/modules/auth/utils/totp.util.d.ts +16 -0
- package/dist/modules/auth/utils/totp.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/totp.util.js +88 -0
- package/dist/modules/auth/utils/totp.util.js.map +1 -0
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts +28 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts.map +1 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.js +48 -2
- package/dist/modules/delivery/composers/otp-delivery.composer.js.map +1 -1
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts +29 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts.map +1 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js +51 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js.map +1 -0
- package/dist/modules/delivery/delivery.module.d.ts.map +1 -1
- package/dist/modules/delivery/delivery.module.js +1 -15
- package/dist/modules/delivery/delivery.module.js.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.d.ts.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js +3 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts +12 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.js +121 -40
- package/dist/modules/delivery/notification-delivery.service.js.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts +22 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.js +144 -42
- package/dist/modules/delivery/processors/delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/delivery.processor.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts +11 -0
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js +90 -16
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts +7 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.js +11 -2
- package/dist/modules/delivery/queues/sync-jobs.queue.js.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts +7 -3
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.js +33 -10
- package/dist/modules/delivery/services/delivery-audit-retention.service.js.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.d.ts +7 -4
- package/dist/modules/delivery/services/notification-audit.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.js +83 -26
- package/dist/modules/delivery/services/notification-audit.service.js.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts +2 -0
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.js +22 -3
- package/dist/modules/delivery/utils/payload-snapshot.util.js.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts +7 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.js +5 -7
- package/dist/modules/file-upload/controllers/file-upload.controller.js.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts +2 -0
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.js +20 -0
- package/dist/modules/file-upload/dto/file-upload.dto.js.map +1 -1
- package/dist/modules/file-upload/file-upload.module.d.ts.map +1 -1
- package/dist/modules/file-upload/file-upload.module.js +12 -2
- package/dist/modules/file-upload/file-upload.module.js.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.d.ts +24 -6
- package/dist/modules/file-upload/services/file-upload.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.js +164 -36
- package/dist/modules/file-upload/services/file-upload.service.js.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts +4 -2
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js +30 -5
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.d.ts.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js +7 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js.map +1 -1
- package/dist/modules/health/health.controller.d.ts +5 -1
- package/dist/modules/health/health.controller.d.ts.map +1 -1
- package/dist/modules/health/health.controller.js +57 -3
- package/dist/modules/health/health.controller.js.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.d.ts +19 -4
- package/dist/modules/invitations/controllers/invitations.controller.d.ts.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.js +19 -10
- package/dist/modules/invitations/controllers/invitations.controller.js.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.d.ts +13 -0
- package/dist/modules/invitations/dto/invitation.dto.d.ts.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.js +69 -2
- package/dist/modules/invitations/dto/invitation.dto.js.map +1 -1
- package/dist/modules/invitations/services/invitations.service.d.ts +24 -6
- package/dist/modules/invitations/services/invitations.service.d.ts.map +1 -1
- package/dist/modules/invitations/services/invitations.service.js +96 -20
- package/dist/modules/invitations/services/invitations.service.js.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.d.ts +7 -2
- package/dist/modules/jobs/queues/jobs.queue.d.ts.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.js +25 -10
- package/dist/modules/jobs/queues/jobs.queue.js.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts +3 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.js +25 -2
- package/dist/modules/notifications/controllers/notifications.controller.js.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.d.ts.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.js +1 -0
- package/dist/modules/notifications/dto/notification-query.dto.js.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.d.ts.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.js +3 -1
- package/dist/modules/notifications/entities/device-token.entity.js.map +1 -1
- package/dist/modules/notifications/services/fcm.service.d.ts +2 -0
- package/dist/modules/notifications/services/fcm.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/fcm.service.js +28 -7
- package/dist/modules/notifications/services/fcm.service.js.map +1 -1
- package/dist/modules/notifications/services/notifications.service.d.ts +16 -3
- package/dist/modules/notifications/services/notifications.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/notifications.service.js +95 -24
- package/dist/modules/notifications/services/notifications.service.js.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.d.ts +2 -0
- package/dist/modules/observability/metrics/metrics.service.d.ts.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.js +11 -0
- package/dist/modules/observability/metrics/metrics.service.js.map +1 -1
- package/dist/modules/otp/constants/otp.constants.d.ts +7 -5
- package/dist/modules/otp/constants/otp.constants.d.ts.map +1 -1
- package/dist/modules/otp/constants/otp.constants.js +11 -8
- package/dist/modules/otp/constants/otp.constants.js.map +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.d.ts +10 -2
- package/dist/modules/otp/otp.service.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.js +48 -4
- package/dist/modules/otp/otp.service.js.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.d.ts +2 -0
- package/dist/modules/otp/services/otp.rate-limiter.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.js +19 -0
- package/dist/modules/otp/services/otp.rate-limiter.js.map +1 -1
- package/dist/modules/otp/services/otp.session.store.d.ts +9 -3
- package/dist/modules/otp/services/otp.session.store.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.session.store.js +34 -42
- package/dist/modules/otp/services/otp.session.store.js.map +1 -1
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts +11 -0
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts.map +1 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js +68 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js.map +1 -0
- package/dist/modules/profile/controllers/profile.controller.d.ts +9 -3
- package/dist/modules/profile/controllers/profile.controller.d.ts.map +1 -1
- package/dist/modules/profile/controllers/profile.controller.js +140 -8
- package/dist/modules/profile/controllers/profile.controller.js.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts +10 -0
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js +43 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js.map +1 -1
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts +24 -0
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js +115 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js.map +1 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/user-profile-response.dto.js +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.js.map +1 -1
- package/dist/modules/profile/dto/username-available.dto.d.ts +6 -0
- package/dist/modules/profile/dto/username-available.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/username-available.dto.js +31 -0
- package/dist/modules/profile/dto/username-available.dto.js.map +1 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts +10 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts.map +1 -1
- package/dist/modules/profile/entities/user-profiles.entity.js +29 -1
- package/dist/modules/profile/entities/user-profiles.entity.js.map +1 -1
- package/dist/modules/profile/index.d.ts +1 -0
- package/dist/modules/profile/index.d.ts.map +1 -1
- package/dist/modules/profile/index.js +1 -0
- package/dist/modules/profile/index.js.map +1 -1
- package/dist/modules/profile/profile.manifest.d.ts +2 -2
- package/dist/modules/profile/profile.manifest.js +2 -2
- package/dist/modules/profile/profile.manifest.js.map +1 -1
- package/dist/modules/profile/profile.module.d.ts.map +1 -1
- package/dist/modules/profile/profile.module.js +7 -2
- package/dist/modules/profile/profile.module.js.map +1 -1
- package/dist/modules/profile/services/profile.service.d.ts +56 -4
- package/dist/modules/profile/services/profile.service.d.ts.map +1 -1
- package/dist/modules/profile/services/profile.service.js +247 -20
- package/dist/modules/profile/services/profile.service.js.map +1 -1
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts +26 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts.map +1 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js +124 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts +36 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.js +42 -0
- package/dist/modules/realtime/constants/realtime.constants.js.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts +21 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.js +113 -0
- package/dist/modules/realtime/controllers/realtime.controller.js.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts +42 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js +289 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js.map +1 -0
- package/dist/modules/realtime/index.d.ts +12 -0
- package/dist/modules/realtime/index.d.ts.map +1 -0
- package/dist/modules/realtime/index.js +35 -0
- package/dist/modules/realtime/index.js.map +1 -0
- package/dist/modules/realtime/realtime.manifest.d.ts +8 -0
- package/dist/modules/realtime/realtime.manifest.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.manifest.js +31 -0
- package/dist/modules/realtime/realtime.manifest.js.map +1 -0
- package/dist/modules/realtime/realtime.module.d.ts +14 -0
- package/dist/modules/realtime/realtime.module.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.module.js +126 -0
- package/dist/modules/realtime/realtime.module.js.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts +16 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js +55 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts +15 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.js +86 -0
- package/dist/modules/realtime/services/realtime-presence.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts +12 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js +63 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime.service.d.ts +88 -0
- package/dist/modules/realtime/services/realtime.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime.service.js +343 -0
- package/dist/modules/realtime/services/realtime.service.js.map +1 -0
- package/dist/modules/realtime/types/realtime.types.d.ts +50 -0
- package/dist/modules/realtime/types/realtime.types.d.ts.map +1 -0
- package/dist/modules/realtime/types/realtime.types.js +14 -0
- package/dist/modules/realtime/types/realtime.types.js.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts +5 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.js +45 -0
- package/dist/modules/realtime/utils/handshake-error.util.js.map +1 -0
- package/dist/modules/roles/controllers/modules.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/modules.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/modules.controller.js +21 -10
- package/dist/modules/roles/controllers/modules.controller.js.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/permissions.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.js +21 -10
- package/dist/modules/roles/controllers/permissions.controller.js.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.d.ts +5 -4
- package/dist/modules/roles/controllers/roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.js +26 -13
- package/dist/modules/roles/controllers/roles.controller.js.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.d.ts +3 -2
- package/dist/modules/roles/controllers/user-roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.js +14 -6
- package/dist/modules/roles/controllers/user-roles.controller.js.map +1 -1
- package/dist/modules/roles/services/modules.service.d.ts +8 -5
- package/dist/modules/roles/services/modules.service.d.ts.map +1 -1
- package/dist/modules/roles/services/modules.service.js +58 -12
- package/dist/modules/roles/services/modules.service.js.map +1 -1
- package/dist/modules/roles/services/permissions.service.d.ts +8 -5
- package/dist/modules/roles/services/permissions.service.d.ts.map +1 -1
- package/dist/modules/roles/services/permissions.service.js +61 -12
- package/dist/modules/roles/services/permissions.service.js.map +1 -1
- package/dist/modules/roles/services/roles.service.d.ts +19 -9
- package/dist/modules/roles/services/roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/roles.service.js +137 -47
- package/dist/modules/roles/services/roles.service.js.map +1 -1
- package/dist/modules/roles/services/user-roles.service.d.ts +12 -4
- package/dist/modules/roles/services/user-roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/user-roles.service.js +58 -26
- package/dist/modules/roles/services/user-roles.service.js.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts +7 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.js +10 -0
- package/dist/modules/sessions/entities/refresh-token.entity.js.map +1 -1
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts +12 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts.map +1 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js +46 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts +20 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js +97 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js.map +1 -0
- package/dist/modules/sessions/services/token.service.d.ts +150 -16
- package/dist/modules/sessions/services/token.service.d.ts.map +1 -1
- package/dist/modules/sessions/services/token.service.js +505 -74
- package/dist/modules/sessions/services/token.service.js.map +1 -1
- package/dist/modules/sessions/sessions.module.d.ts.map +1 -1
- package/dist/modules/sessions/sessions.module.js +4 -2
- package/dist/modules/sessions/sessions.module.js.map +1 -1
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts +13 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts.map +1 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js +37 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js.map +1 -0
- package/dist/modules/settings/constants/settings.defaults.d.ts +57 -3
- package/dist/modules/settings/constants/settings.defaults.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.defaults.js +58 -3
- package/dist/modules/settings/constants/settings.defaults.js.map +1 -1
- package/dist/modules/settings/constants/settings.keys.d.ts +138 -2
- package/dist/modules/settings/constants/settings.keys.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.keys.js +140 -2
- package/dist/modules/settings/constants/settings.keys.js.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts +5 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.js +134 -5
- package/dist/modules/settings/controllers/settings.controller.js.map +1 -1
- package/dist/modules/settings/services/settings.service.d.ts +17 -7
- package/dist/modules/settings/services/settings.service.d.ts.map +1 -1
- package/dist/modules/settings/services/settings.service.js +80 -14
- package/dist/modules/settings/services/settings.service.js.map +1 -1
- package/dist/modules/settings/utils/settings-secret.util.d.ts +13 -0
- package/dist/modules/settings/utils/settings-secret.util.d.ts.map +1 -0
- package/dist/modules/settings/utils/settings-secret.util.js +80 -0
- package/dist/modules/settings/utils/settings-secret.util.js.map +1 -0
- package/dist/modules/users/controllers/users.controller.d.ts +4 -2
- package/dist/modules/users/controllers/users.controller.d.ts.map +1 -1
- package/dist/modules/users/controllers/users.controller.js +89 -10
- package/dist/modules/users/controllers/users.controller.js.map +1 -1
- package/dist/modules/users/dto/user.dto.d.ts +3 -0
- package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
- package/dist/modules/users/dto/user.dto.js +27 -4
- package/dist/modules/users/dto/user.dto.js.map +1 -1
- package/dist/modules/users/entities/user.entity.d.ts +7 -1
- package/dist/modules/users/entities/user.entity.d.ts.map +1 -1
- package/dist/modules/users/entities/user.entity.js +10 -0
- package/dist/modules/users/entities/user.entity.js.map +1 -1
- package/dist/modules/users/services/users.service.d.ts +15 -2
- package/dist/modules/users/services/users.service.d.ts.map +1 -1
- package/dist/modules/users/services/users.service.js +152 -37
- package/dist/modules/users/services/users.service.js.map +1 -1
- package/dist/modules/users/users.module.d.ts.map +1 -1
- package/dist/modules/users/users.module.js +1 -2
- package/dist/modules/users/users.module.js.map +1 -1
- package/package.json +19 -7
- package/dist/modules/admin/entities/admin-log.entity.d.ts +0 -20
- package/dist/modules/admin/entities/admin-log.entity.d.ts.map +0 -1
- package/dist/modules/admin/entities/admin-log.entity.js +0 -65
- 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":"
|
|
1
|
+
{"version":3,"file":"file-upload.dto.d.ts","sourceRoot":"","sources":["../../../../src/modules/file-upload/dto/file-upload.dto.ts"],"names":[],"mappings":"AAUA,qBAAa,aAAa;IASzB,QAAQ,EAAG,MAAM,CAAC;CAClB;AAED,qBAAa,iBAAiB;IAO7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAOlB,IAAI,CAAC,EAAE,MAAM,CAAK;IAQlB,KAAK,CAAC,EAAE,MAAM,CAAM;CACpB;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,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pD,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;
|
|
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,IA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AAE;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":"
|
|
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: [
|
|
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: [
|
|
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,
|
|
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
|
-
|
|
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<
|
|
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
|
-
/**
|
|
49
|
-
|
|
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":"
|
|
1
|
+
{"version":3,"file":"file-upload.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/file-upload/services/file-upload.service.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAqC,UAAU,EAAE,MAAM,SAAS,CAAC;AAGxE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAG7E,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAQN,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,CA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f,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAC3B,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAgC9B,OAAO,CAAC,cAAc;IAiBtB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc;IAW7C,OAAO,CAAC,yBAAyB;YAgBnB,oBAAoB;IA2ClC,OAAO,CAAC,sBAAsB;IAgB9B,OAAO,CAAC,iBAAiB;YAaX,qBAAqB;IAoCnC,uFAAuF;YACzE,qBAAqB;YAarB,8BAA8B;IAoB5C,OAAO,CAAC,iBAAiB;YAMX,oBAAoB;YAwCpB,eAAe;YAqBf,iBAAiB;YAmCjB,aAAa;YAQb,kBAAkB;IAqB1B,sBAAsB,CAC3B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAShB;;;OAGG;IACG,oBAAoB,CACzB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,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
|
-
|
|
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
|
|
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
|
|
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
|
-
/**
|
|
328
|
-
|
|
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
|
|
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 (
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
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
|
|
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 (
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
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
|
-
|
|
366
|
-
|
|
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
|
-
|
|
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
|