@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
|
@@ -16,21 +16,41 @@ exports.UserProfilesService = void 0;
|
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
18
|
const typeorm_2 = require("typeorm");
|
|
19
|
+
const audit_actions_1 = require("../../audit/constants/audit-actions");
|
|
20
|
+
const audit_service_1 = require("../../audit/services/audit.service");
|
|
21
|
+
const auth_events_1 = require("../../auth/events/auth.events");
|
|
22
|
+
const mfa_service_1 = require("../../auth/services/mfa.service");
|
|
19
23
|
const upload_types_1 = require("../../file-upload/constants/upload.types");
|
|
20
24
|
const file_upload_service_1 = require("../../file-upload/services/file-upload.service");
|
|
25
|
+
const structured_logger_service_1 = require("../../observability/logging/structured-logger.service");
|
|
21
26
|
const otp_service_interface_1 = require("../../otp/interfaces/otp.service.interface");
|
|
27
|
+
const refresh_token_entity_1 = require("../../sessions/entities/refresh-token.entity");
|
|
28
|
+
const token_service_1 = require("../../sessions/services/token.service");
|
|
22
29
|
const users_service_1 = require("../../users/services/users.service");
|
|
30
|
+
const public_user_profile_dto_1 = require("../dto/public-user-profile.dto");
|
|
23
31
|
const user_profiles_entity_1 = require("../entities/user-profiles.entity");
|
|
24
32
|
let UserProfilesService = class UserProfilesService {
|
|
25
33
|
profileRepository;
|
|
26
34
|
usersService;
|
|
27
35
|
otpService;
|
|
28
36
|
fileUploadService;
|
|
29
|
-
|
|
37
|
+
mfaService;
|
|
38
|
+
tokenService;
|
|
39
|
+
logger;
|
|
40
|
+
audit;
|
|
41
|
+
dataSource;
|
|
42
|
+
eventEmitter;
|
|
43
|
+
constructor(profileRepository, usersService, otpService, fileUploadService, mfaService, tokenService, logger, audit, dataSource, eventEmitter = null) {
|
|
30
44
|
this.profileRepository = profileRepository;
|
|
31
45
|
this.usersService = usersService;
|
|
32
46
|
this.otpService = otpService;
|
|
33
47
|
this.fileUploadService = fileUploadService;
|
|
48
|
+
this.mfaService = mfaService;
|
|
49
|
+
this.tokenService = tokenService;
|
|
50
|
+
this.logger = logger;
|
|
51
|
+
this.audit = audit;
|
|
52
|
+
this.dataSource = dataSource;
|
|
53
|
+
this.eventEmitter = eventEmitter;
|
|
34
54
|
}
|
|
35
55
|
async create(userId, dto, manager) {
|
|
36
56
|
const repo = manager?.getRepository(user_profiles_entity_1.UserProfile) ?? this.profileRepository;
|
|
@@ -42,12 +62,16 @@ let UserProfilesService = class UserProfilesService {
|
|
|
42
62
|
await this.assertUsernameAvailable(dto.username, undefined, manager);
|
|
43
63
|
}
|
|
44
64
|
await this.validateProfileFileRefs(userId, dto);
|
|
65
|
+
const photoUrl = await this.resolvePublicUrl(userId, dto.photoFileId, upload_types_1.UPLOAD_CATEGORY_PROFILE_PHOTO);
|
|
66
|
+
const coverPhotoUrl = await this.resolvePublicUrl(userId, dto.coverPhotoFileId, upload_types_1.UPLOAD_CATEGORY_COVER_PHOTO);
|
|
45
67
|
const profile = repo.create({
|
|
46
68
|
userId,
|
|
47
69
|
...dto,
|
|
48
70
|
photoFileId: dto.photoFileId ?? undefined,
|
|
71
|
+
photoUrl: photoUrl ?? undefined,
|
|
49
72
|
coverPhotoFileId: dto.coverPhotoFileId ?? undefined,
|
|
50
|
-
|
|
73
|
+
coverPhotoUrl: coverPhotoUrl ?? undefined,
|
|
74
|
+
username: dto.username ? this.normalizeUsername(dto.username) : undefined,
|
|
51
75
|
onboardingStep: 0,
|
|
52
76
|
isProfileCompleted: false,
|
|
53
77
|
});
|
|
@@ -67,12 +91,39 @@ let UserProfilesService = class UserProfilesService {
|
|
|
67
91
|
}
|
|
68
92
|
async findByUsername(username, manager) {
|
|
69
93
|
const repo = manager?.getRepository(user_profiles_entity_1.UserProfile) ?? this.profileRepository;
|
|
94
|
+
const normalized = this.normalizeUsername(username);
|
|
95
|
+
if (!normalized)
|
|
96
|
+
return null;
|
|
70
97
|
return repo.findOne({
|
|
71
98
|
where: {
|
|
72
|
-
username:
|
|
99
|
+
username: normalized,
|
|
73
100
|
},
|
|
74
101
|
});
|
|
75
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Public username lookup. Returns 404 for missing or non-public profiles
|
|
105
|
+
* (same status to avoid existence leaks for private accounts).
|
|
106
|
+
*/
|
|
107
|
+
async findPublicByUsername(username) {
|
|
108
|
+
const profile = await this.findByUsername(username);
|
|
109
|
+
if (!profile?.isPublic) {
|
|
110
|
+
throw new common_1.NotFoundException('Profile not found');
|
|
111
|
+
}
|
|
112
|
+
return public_user_profile_dto_1.PublicUserProfileDto.fromProfile(profile);
|
|
113
|
+
}
|
|
114
|
+
/** Check whether a username can be claimed (normalized, case-insensitive). */
|
|
115
|
+
async isUsernameAvailable(username) {
|
|
116
|
+
const normalized = this.normalizeUsername(username);
|
|
117
|
+
if (!normalized) {
|
|
118
|
+
throw new common_1.BadRequestException('Username is required');
|
|
119
|
+
}
|
|
120
|
+
const existing = await this.findByUsername(normalized);
|
|
121
|
+
return { username: normalized, available: !existing };
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Internal/admin listing helper — not exposed over HTTP.
|
|
125
|
+
* Search uses unindexed `LOWER(...) LIKE`; do not wire to a public API at scale.
|
|
126
|
+
*/
|
|
76
127
|
async findAll(filter) {
|
|
77
128
|
const page = filter.page ?? 1;
|
|
78
129
|
const limit = filter.limit ?? 20;
|
|
@@ -103,7 +154,7 @@ let UserProfilesService = class UserProfilesService {
|
|
|
103
154
|
}
|
|
104
155
|
if (filter.username?.trim()) {
|
|
105
156
|
qb.andWhere('profile.username = :username', {
|
|
106
|
-
username: filter.username
|
|
157
|
+
username: this.normalizeUsername(filter.username),
|
|
107
158
|
});
|
|
108
159
|
}
|
|
109
160
|
if (filter.occupation?.trim()) {
|
|
@@ -126,11 +177,134 @@ let UserProfilesService = class UserProfilesService {
|
|
|
126
177
|
await this.assertUsernameAvailable(dto.username, profile.id);
|
|
127
178
|
}
|
|
128
179
|
await this.validateProfileFileRefs(userId, dto);
|
|
129
|
-
Object.
|
|
130
|
-
|
|
131
|
-
|
|
180
|
+
const changedFields = Object.keys(dto).filter((k) => dto[k] !== undefined);
|
|
181
|
+
const photoUrl = dto.photoFileId !== undefined
|
|
182
|
+
? await this.resolvePublicUrl(userId, dto.photoFileId, upload_types_1.UPLOAD_CATEGORY_PROFILE_PHOTO)
|
|
183
|
+
: undefined;
|
|
184
|
+
const coverPhotoUrl = dto.coverPhotoFileId !== undefined
|
|
185
|
+
? await this.resolvePublicUrl(userId, dto.coverPhotoFileId, upload_types_1.UPLOAD_CATEGORY_COVER_PHOTO)
|
|
186
|
+
: undefined;
|
|
187
|
+
// Domain write in TX; audit enqueue-only so profile edits do not contend
|
|
188
|
+
// on the global seal advisory lock (login/hot-path pattern).
|
|
189
|
+
const saved = await this.dataSource.transaction(async (manager) => {
|
|
190
|
+
const repo = manager.getRepository(user_profiles_entity_1.UserProfile);
|
|
191
|
+
const row = await repo.findOneOrFail({ where: { userId } });
|
|
192
|
+
Object.assign(row, dto);
|
|
193
|
+
if (dto.username) {
|
|
194
|
+
row.username = this.normalizeUsername(dto.username);
|
|
195
|
+
}
|
|
196
|
+
if (dto.photoFileId !== undefined) {
|
|
197
|
+
row.photoFileId = dto.photoFileId;
|
|
198
|
+
row.photoUrl = photoUrl ?? null;
|
|
199
|
+
}
|
|
200
|
+
if (dto.coverPhotoFileId !== undefined) {
|
|
201
|
+
row.coverPhotoFileId = dto.coverPhotoFileId;
|
|
202
|
+
row.coverPhotoUrl = coverPhotoUrl ?? null;
|
|
203
|
+
}
|
|
204
|
+
return repo.save(row);
|
|
205
|
+
});
|
|
206
|
+
this.audit.record({
|
|
207
|
+
action: audit_actions_1.AUDIT_ACTIONS.PROFILE_UPDATED,
|
|
208
|
+
actorType: 'USER',
|
|
209
|
+
actorId: userId,
|
|
210
|
+
resourceType: 'user_profile',
|
|
211
|
+
resourceId: saved.id,
|
|
212
|
+
metadata: { fields: changedFields },
|
|
213
|
+
});
|
|
214
|
+
return saved;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* One-shot avatar upload: replace existing profile_photo or upload + bind.
|
|
218
|
+
* Respects single-slot quota without a separate PATCH.
|
|
219
|
+
*/
|
|
220
|
+
async setProfilePhoto(userId, file) {
|
|
221
|
+
const profile = await this.ensureProfile(userId);
|
|
222
|
+
if (profile.photoFileId) {
|
|
223
|
+
await this.fileUploadService.replaceFile(userId, profile.photoFileId, file);
|
|
224
|
+
const updated = await this.findByUserIdOrFail(userId);
|
|
225
|
+
this.audit.record({
|
|
226
|
+
action: audit_actions_1.AUDIT_ACTIONS.PROFILE_UPDATED,
|
|
227
|
+
actorType: 'USER',
|
|
228
|
+
actorId: userId,
|
|
229
|
+
resourceType: 'user_profile',
|
|
230
|
+
resourceId: updated.id,
|
|
231
|
+
metadata: { fields: ['photoFileId'], method: 'replace' },
|
|
232
|
+
});
|
|
233
|
+
return updated;
|
|
234
|
+
}
|
|
235
|
+
const uploaded = await this.fileUploadService.upload(userId, upload_types_1.UPLOAD_CATEGORY_PROFILE_PHOTO, file);
|
|
236
|
+
return this.update(userId, { photoFileId: uploaded.id });
|
|
237
|
+
}
|
|
238
|
+
/** Remove avatar file (if any) and clear photo_file_id / photo_url. */
|
|
239
|
+
async clearProfilePhoto(userId) {
|
|
240
|
+
const profile = await this.ensureProfile(userId);
|
|
241
|
+
if (profile.photoFileId) {
|
|
242
|
+
await this.fileUploadService.deleteFile(userId, profile.photoFileId);
|
|
243
|
+
const updated = await this.findByUserIdOrFail(userId);
|
|
244
|
+
this.audit.record({
|
|
245
|
+
action: audit_actions_1.AUDIT_ACTIONS.PROFILE_UPDATED,
|
|
246
|
+
actorType: 'USER',
|
|
247
|
+
actorId: userId,
|
|
248
|
+
resourceType: 'user_profile',
|
|
249
|
+
resourceId: updated.id,
|
|
250
|
+
metadata: { fields: ['photoFileId'], method: 'clear' },
|
|
251
|
+
});
|
|
252
|
+
return updated;
|
|
253
|
+
}
|
|
254
|
+
return this.update(userId, { photoFileId: null });
|
|
255
|
+
}
|
|
256
|
+
/** One-shot cover upload (replace or upload + bind). */
|
|
257
|
+
async setCoverPhoto(userId, file) {
|
|
258
|
+
const profile = await this.ensureProfile(userId);
|
|
259
|
+
if (profile.coverPhotoFileId) {
|
|
260
|
+
await this.fileUploadService.replaceFile(userId, profile.coverPhotoFileId, file);
|
|
261
|
+
const updated = await this.findByUserIdOrFail(userId);
|
|
262
|
+
this.audit.record({
|
|
263
|
+
action: audit_actions_1.AUDIT_ACTIONS.PROFILE_UPDATED,
|
|
264
|
+
actorType: 'USER',
|
|
265
|
+
actorId: userId,
|
|
266
|
+
resourceType: 'user_profile',
|
|
267
|
+
resourceId: updated.id,
|
|
268
|
+
metadata: { fields: ['coverPhotoFileId'], method: 'replace' },
|
|
269
|
+
});
|
|
270
|
+
return updated;
|
|
271
|
+
}
|
|
272
|
+
const uploaded = await this.fileUploadService.upload(userId, upload_types_1.UPLOAD_CATEGORY_COVER_PHOTO, file);
|
|
273
|
+
return this.update(userId, { coverPhotoFileId: uploaded.id });
|
|
274
|
+
}
|
|
275
|
+
/** Remove cover file and clear cover_photo_file_id / cover_photo_url. */
|
|
276
|
+
async clearCoverPhoto(userId) {
|
|
277
|
+
const profile = await this.ensureProfile(userId);
|
|
278
|
+
if (profile.coverPhotoFileId) {
|
|
279
|
+
await this.fileUploadService.deleteFile(userId, profile.coverPhotoFileId);
|
|
280
|
+
const updated = await this.findByUserIdOrFail(userId);
|
|
281
|
+
this.audit.record({
|
|
282
|
+
action: audit_actions_1.AUDIT_ACTIONS.PROFILE_UPDATED,
|
|
283
|
+
actorType: 'USER',
|
|
284
|
+
actorId: userId,
|
|
285
|
+
resourceType: 'user_profile',
|
|
286
|
+
resourceId: updated.id,
|
|
287
|
+
metadata: { fields: ['coverPhotoFileId'], method: 'clear' },
|
|
288
|
+
});
|
|
289
|
+
return updated;
|
|
132
290
|
}
|
|
133
|
-
return this.
|
|
291
|
+
return this.update(userId, { coverPhotoFileId: null });
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Refresh denormalized photo_url when the underlying profile_photo file is replaced.
|
|
295
|
+
*/
|
|
296
|
+
async syncPhotoUrlForFile(userId, fileId, publicUrl) {
|
|
297
|
+
await this.profileRepository.update({ userId, photoFileId: fileId }, { photoUrl: publicUrl });
|
|
298
|
+
}
|
|
299
|
+
/** Clear photo_file_id + photo_url when the referenced profile photo file is deleted. */
|
|
300
|
+
async clearPhotoIfFileDeleted(userId, fileId) {
|
|
301
|
+
await this.profileRepository.update({ userId, photoFileId: fileId }, { photoFileId: null, photoUrl: null });
|
|
302
|
+
}
|
|
303
|
+
async syncCoverUrlForFile(userId, fileId, publicUrl) {
|
|
304
|
+
await this.profileRepository.update({ userId, coverPhotoFileId: fileId }, { coverPhotoUrl: publicUrl });
|
|
305
|
+
}
|
|
306
|
+
async clearCoverIfFileDeleted(userId, fileId) {
|
|
307
|
+
await this.profileRepository.update({ userId, coverPhotoFileId: fileId }, { coverPhotoFileId: null, coverPhotoUrl: null });
|
|
134
308
|
}
|
|
135
309
|
/**
|
|
136
310
|
* Change phone number via OTP verification.
|
|
@@ -138,30 +312,55 @@ let UserProfilesService = class UserProfilesService {
|
|
|
138
312
|
* then POST /auth/verify-otp, and pass the returned verificationId + otp here.
|
|
139
313
|
*/
|
|
140
314
|
async changePhoneNumber(userId, changePhoneDto) {
|
|
141
|
-
|
|
315
|
+
await this.mfaService.assertSensitiveReauth(userId, {
|
|
316
|
+
purpose: 'change_phone',
|
|
317
|
+
stepUpToken: changePhoneDto.stepUpToken,
|
|
318
|
+
password: changePhoneDto.password,
|
|
319
|
+
verificationId: changePhoneDto.reauthVerificationId,
|
|
320
|
+
otp: changePhoneDto.reauthOtp,
|
|
321
|
+
provider: changePhoneDto.provider,
|
|
322
|
+
idToken: changePhoneDto.idToken,
|
|
323
|
+
});
|
|
324
|
+
const { data: { subject: phoneNumber, channel }, } = await this.otpService.verifyOtp(changePhoneDto.verificationId, changePhoneDto.otp);
|
|
325
|
+
if (channel !== 'sms') {
|
|
326
|
+
throw new common_1.BadRequestException('Change-phone requires an SMS OTP. Call POST /auth/send-otp with channel=sms.');
|
|
327
|
+
}
|
|
142
328
|
const existingUser = await this.usersService.findBy({ phoneNumber });
|
|
143
329
|
if (existingUser && existingUser.id !== userId) {
|
|
144
330
|
throw new common_1.ConflictException('Phone number already in use');
|
|
145
331
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
isPhoneVerified: true,
|
|
332
|
+
await this.usersService.update(userId, { phoneNumber, isPhoneVerified: true }, { skipIdentitySessionRevoke: true });
|
|
333
|
+
await this.tokenService.revokeAllUserTokens(userId, refresh_token_entity_1.RevokeReason.LOGOUT);
|
|
334
|
+
this.logger.info('Phone changed', {
|
|
335
|
+
event: 'auth.phone.changed',
|
|
336
|
+
metadata: { userId },
|
|
152
337
|
});
|
|
338
|
+
if (this.eventEmitter) {
|
|
339
|
+
const payload = { userId, at: new Date() };
|
|
340
|
+
void this.eventEmitter.emitAsync(auth_events_1.AUTH_EVENTS.PHONE_CHANGED, payload).catch((err) => {
|
|
341
|
+
this.logger.error('Auth phone-changed event listener failed', {
|
|
342
|
+
event: 'auth.identity.event_failed',
|
|
343
|
+
metadata: { listener: auth_events_1.AUTH_EVENTS.PHONE_CHANGED },
|
|
344
|
+
err: err instanceof Error ? err : undefined,
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
}
|
|
153
348
|
return this.usersService.findByIdOrFail(userId);
|
|
154
349
|
}
|
|
155
|
-
async deleteAccount(userId) {
|
|
156
|
-
await this.usersService.delete(userId);
|
|
157
|
-
}
|
|
158
350
|
async assertUsernameAvailable(username, excludeProfileId, manager) {
|
|
159
|
-
const normalized =
|
|
351
|
+
const normalized = this.normalizeUsername(username);
|
|
352
|
+
if (!normalized) {
|
|
353
|
+
throw new common_1.BadRequestException('Username is required');
|
|
354
|
+
}
|
|
160
355
|
const existing = await this.findByUsername(normalized, manager);
|
|
161
356
|
if (existing && existing.id !== excludeProfileId) {
|
|
162
357
|
throw new common_1.ConflictException('Username is already taken');
|
|
163
358
|
}
|
|
164
359
|
}
|
|
360
|
+
/** Strip leading `@` and lowercase. */
|
|
361
|
+
normalizeUsername(username) {
|
|
362
|
+
return username.trim().replace(/^@+/, '').toLowerCase();
|
|
363
|
+
}
|
|
165
364
|
async validateProfileFileRefs(userId, dto) {
|
|
166
365
|
if (dto.photoFileId) {
|
|
167
366
|
await this.fileUploadService.assertUserFileCategory(userId, dto.photoFileId, upload_types_1.UPLOAD_CATEGORY_PROFILE_PHOTO);
|
|
@@ -170,6 +369,26 @@ let UserProfilesService = class UserProfilesService {
|
|
|
170
369
|
await this.fileUploadService.assertUserFileCategory(userId, dto.coverPhotoFileId, upload_types_1.UPLOAD_CATEGORY_COVER_PHOTO);
|
|
171
370
|
}
|
|
172
371
|
}
|
|
372
|
+
async ensureProfile(userId) {
|
|
373
|
+
const existing = await this.findByUserId(userId);
|
|
374
|
+
if (existing)
|
|
375
|
+
return existing;
|
|
376
|
+
await this.create(userId, {});
|
|
377
|
+
return this.findByUserIdOrFail(userId);
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Resolve denormalized public CDN URL for a profile image file id.
|
|
381
|
+
* - undefined → leave unchanged (caller skips)
|
|
382
|
+
* - null → clear
|
|
383
|
+
* - uuid → require public category URL
|
|
384
|
+
*/
|
|
385
|
+
async resolvePublicUrl(userId, fileId, categorySlug) {
|
|
386
|
+
if (fileId === undefined)
|
|
387
|
+
return undefined;
|
|
388
|
+
if (fileId === null)
|
|
389
|
+
return null;
|
|
390
|
+
return this.fileUploadService.getRequiredPublicUrl(userId, fileId, categorySlug);
|
|
391
|
+
}
|
|
173
392
|
};
|
|
174
393
|
exports.UserProfilesService = UserProfilesService;
|
|
175
394
|
exports.UserProfilesService = UserProfilesService = __decorate([
|
|
@@ -177,9 +396,17 @@ exports.UserProfilesService = UserProfilesService = __decorate([
|
|
|
177
396
|
__param(0, (0, typeorm_1.InjectRepository)(user_profiles_entity_1.UserProfile)),
|
|
178
397
|
__param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => users_service_1.UsersService))),
|
|
179
398
|
__param(2, (0, common_1.Inject)(otp_service_interface_1.IOtpService)),
|
|
399
|
+
__param(3, (0, common_1.Inject)((0, common_1.forwardRef)(() => file_upload_service_1.FileUploadService))),
|
|
400
|
+
__param(4, (0, common_1.Inject)((0, common_1.forwardRef)(() => mfa_service_1.MfaService))),
|
|
401
|
+
__param(9, (0, common_1.Optional)()),
|
|
180
402
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
181
403
|
users_service_1.UsersService,
|
|
182
404
|
otp_service_interface_1.IOtpService,
|
|
183
|
-
file_upload_service_1.FileUploadService
|
|
405
|
+
file_upload_service_1.FileUploadService,
|
|
406
|
+
mfa_service_1.MfaService,
|
|
407
|
+
token_service_1.TokenService,
|
|
408
|
+
structured_logger_service_1.StructuredLoggerService,
|
|
409
|
+
audit_service_1.AuditService,
|
|
410
|
+
typeorm_2.DataSource, Object])
|
|
184
411
|
], UserProfilesService);
|
|
185
412
|
//# sourceMappingURL=profile.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.service.js","sourceRoot":"","sources":["../../../../src/modules/profile/services/profile.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAMwB;AACxB,6CAAmD;AACnD,qCAAoD;AAGpD,2EAGkD;AAClD,wFAAmF;AACnF,sFAAyE;AACzE,sEAAkE;AAQlE,2EAA+D;AAGxD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAGb;IAEA;IAEA;IACA;IAPlB,YAEkB,iBAA0C,EAE1C,YAA0B,EAE1B,UAAuB,EACvB,iBAAoC;QALpC,sBAAiB,GAAjB,iBAAiB,CAAyB;QAE1C,iBAAY,GAAZ,YAAY,CAAc;QAE1B,eAAU,GAAV,UAAU,CAAa;QACvB,sBAAiB,GAAjB,iBAAiB,CAAmB;IACnD,CAAC;IAEJ,KAAK,CAAC,MAAM,CACX,MAAc,EACd,GAAyB,EACzB,OAAuB;QAEvB,MAAM,IAAI,GAAG,OAAO,EAAE,aAAa,CAAC,kCAAW,CAAC,IAAI,IAAI,CAAC,iBAAiB,CAAC;QAE3E,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QAC3D,IAAI,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,0BAAiB,CAAC,sCAAsC,CAAC,CAAC;QACrE,CAAC;QAED,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QACtE,CAAC;QAED,MAAM,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAEhD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;YAC3B,MAAM;YACN,GAAG,GAAG;YACN,WAAW,EAAE,GAAG,CAAC,WAAW,IAAI,SAAS;YACzC,gBAAgB,EAAE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,CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAA;AA/MY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGV,WAAA,IAAA,0BAAgB,EAAC,kCAAW,CAAC,CAAA;IAE7B,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,4BAAY,CAAC,CAAC,CAAA;IAEtC,WAAA,IAAA,eAAM,EAAC,mCAAW,CAAC,CAAA;qCAHgB,oBAAU;QAEf,4BAAY;QAEd,mCAAW;QACJ,uCAAiB;GAR1C,mBAAmB,CA+M/B"}
|
|
1
|
+
{"version":3,"file":"profile.service.js","sourceRoot":"","sources":["../../../../src/modules/profile/services/profile.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AAExB,6CAAmD;AACnD,qCAAgE;AAGhE,uEAAoE;AACpE,sEAAkE;AAClE,+DAA2F;AAC3F,iEAA6D;AAC7D,2EAGkD;AAClD,wFAGwD;AACxD,qGAAgG;AAChG,sFAAyE;AACzE,uFAA4E;AAC5E,yEAAqE;AACrE,sEAAkE;AAMlE,4EAAsE;AAItE,2EAA+D;AAGxD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAGb;IAEA;IAEA;IAEA;IAEA;IACA;IACA;IACA;IACA;IAEA;IAhBlB,YAEkB,iBAA0C,EAE1C,YAA0B,EAE1B,UAAuB,EAEvB,iBAAoC,EAEpC,UAAsB,EACtB,YAA0B,EAC1B,MAA+B,EAC/B,KAAmB,EACnB,UAAsB,EAEtB,eAAqC,IAAI;QAdzC,sBAAiB,GAAjB,iBAAiB,CAAyB;QAE1C,iBAAY,GAAZ,YAAY,CAAc;QAE1B,eAAU,GAAV,UAAU,CAAa;QAEvB,sBAAiB,GAAjB,iBAAiB,CAAmB;QAEpC,eAAU,GAAV,UAAU,CAAY;QACtB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,WAAM,GAAN,MAAM,CAAyB;QAC/B,UAAK,GA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,mCAAW,CAAC,CAAA;IAEnB,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,uCAAiB,CAAC,CAAC,CAAA;IAE3C,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC,CAAC,CAAA;IAMpC,WAAA,IAAA,iBAAQ,GAAE,CAAA;qCAbyB,oBAAU;QAEf,4BAAY;QAEd,mCAAW;QAEJ,uCAAiB;QAExB,wBAAU;QACR,4BAAY;QAClB,mDAAuB;QACxB,4BAAY;QACP,oBAAU;GAf5B,mBAAmB,CAme/B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type INestApplication } from '@nestjs/common';
|
|
2
|
+
import { ConfigService } from '@nestjs/config';
|
|
3
|
+
import { IoAdapter } from '@nestjs/platform-socket.io';
|
|
4
|
+
import type { ServerOptions } from 'socket.io';
|
|
5
|
+
import { SettingsService } from '../../settings/services/settings.service';
|
|
6
|
+
import { RealtimeService } from '../services/realtime.service';
|
|
7
|
+
/**
|
|
8
|
+
* Socket.IO adapter with optional Redis pub/sub for multi-instance fan-out.
|
|
9
|
+
* Uses dedicated ioredis clients (not the shared REDIS_CLIENT command connection).
|
|
10
|
+
*/
|
|
11
|
+
export declare class RedisIoAdapter extends IoAdapter {
|
|
12
|
+
private readonly configService;
|
|
13
|
+
private readonly settings;
|
|
14
|
+
private readonly realtimeService;
|
|
15
|
+
private readonly logger;
|
|
16
|
+
private adapterConstructor;
|
|
17
|
+
private pubClient;
|
|
18
|
+
private subClient;
|
|
19
|
+
private controlClient;
|
|
20
|
+
constructor(app: INestApplication, configService: ConfigService, settings: SettingsService, realtimeService: RealtimeService);
|
|
21
|
+
connect(): Promise<void>;
|
|
22
|
+
createIOServer(port: number, options?: ServerOptions): unknown;
|
|
23
|
+
close(server?: unknown): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export declare function installRealtimeIoAdapter(app: INestApplication): Promise<RedisIoAdapter>;
|
|
26
|
+
//# sourceMappingURL=redis-io.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-io.adapter.d.ts","sourceRoot":"","sources":["../../../../src/modules/realtime/adapters/redis-io.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAU,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAK/C,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;;GAGG;AACH,qBAAa,cAAe,SAAQ,SAAS;IAS3C,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAVjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmC;IAC1D,OAAO,CAAC,kBAAkB,CAAiD;IAC3E,OAAO,CAAC,SAAS,CAAwB;IACzC,OAAO,CAAC,SAAS,CAAwB;IACzC,OAAO,CAAC,aAAa,CAAwB;gBAG5C,GAAG,EAAE,gBAAgB,EACJ,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,eAAe,EACzB,eAAe,EAAE,eAAe;IAK5C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAgDrB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO;IAuCxD,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAWrD;AAED,wBAAsB,wBAAwB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAQ7F"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RedisIoAdapter = void 0;
|
|
7
|
+
exports.installRealtimeIoAdapter = installRealtimeIoAdapter;
|
|
8
|
+
const common_1 = require("@nestjs/common");
|
|
9
|
+
const config_1 = require("@nestjs/config");
|
|
10
|
+
const platform_socket_io_1 = require("@nestjs/platform-socket.io");
|
|
11
|
+
const redis_adapter_1 = require("@socket.io/redis-adapter");
|
|
12
|
+
const ioredis_1 = __importDefault(require("ioredis"));
|
|
13
|
+
const env_flags_util_1 = require("../../../config/env-flags.util");
|
|
14
|
+
const tls_util_1 = require("../../../config/tls.util");
|
|
15
|
+
const settings_keys_1 = require("../../settings/constants/settings.keys");
|
|
16
|
+
const settings_service_1 = require("../../settings/services/settings.service");
|
|
17
|
+
const realtime_constants_1 = require("../constants/realtime.constants");
|
|
18
|
+
const realtime_service_1 = require("../services/realtime.service");
|
|
19
|
+
/**
|
|
20
|
+
* Socket.IO adapter with optional Redis pub/sub for multi-instance fan-out.
|
|
21
|
+
* Uses dedicated ioredis clients (not the shared REDIS_CLIENT command connection).
|
|
22
|
+
*/
|
|
23
|
+
class RedisIoAdapter extends platform_socket_io_1.IoAdapter {
|
|
24
|
+
configService;
|
|
25
|
+
settings;
|
|
26
|
+
realtimeService;
|
|
27
|
+
logger = new common_1.Logger(RedisIoAdapter.name);
|
|
28
|
+
adapterConstructor = null;
|
|
29
|
+
pubClient = null;
|
|
30
|
+
subClient = null;
|
|
31
|
+
controlClient = null;
|
|
32
|
+
constructor(app, configService, settings, realtimeService) {
|
|
33
|
+
super(app);
|
|
34
|
+
this.configService = configService;
|
|
35
|
+
this.settings = settings;
|
|
36
|
+
this.realtimeService = realtimeService;
|
|
37
|
+
}
|
|
38
|
+
async connect() {
|
|
39
|
+
if (!(0, env_flags_util_1.isRedisEnabled)()) {
|
|
40
|
+
this.logger.warn('Realtime running without Redis adapter (single-process only). Set REDIS_ENABLED=true for multi-instance.');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const common = {
|
|
44
|
+
host: this.configService.get('app.redis.host', 'localhost'),
|
|
45
|
+
port: this.configService.get('app.redis.port', 6379),
|
|
46
|
+
password: this.configService.get('app.redis.password') || undefined,
|
|
47
|
+
tls: (0, tls_util_1.redisTlsFromConfigService)(this.configService),
|
|
48
|
+
maxRetriesPerRequest: null,
|
|
49
|
+
enableReadyCheck: false,
|
|
50
|
+
connectTimeout: 5000,
|
|
51
|
+
retryStrategy: (times) => Math.min(times * 200, 5000),
|
|
52
|
+
};
|
|
53
|
+
this.pubClient = new ioredis_1.default(common);
|
|
54
|
+
this.subClient = this.pubClient.duplicate();
|
|
55
|
+
this.controlClient = this.pubClient.duplicate();
|
|
56
|
+
this.pubClient.on('error', (err) => this.logger.error(`Realtime Redis pub error: ${err.message}`));
|
|
57
|
+
this.subClient.on('error', (err) => this.logger.error(`Realtime Redis sub error: ${err.message}`));
|
|
58
|
+
this.adapterConstructor = (0, redis_adapter_1.createAdapter)(this.pubClient, this.subClient);
|
|
59
|
+
await this.controlClient.subscribe(realtime_constants_1.REALTIME_CONTROL_CHANNEL);
|
|
60
|
+
this.realtimeService.bindControlSubscriber({
|
|
61
|
+
subscribe: async (channel, handler) => {
|
|
62
|
+
this.controlClient?.on('message', (ch, message) => {
|
|
63
|
+
if (ch === channel)
|
|
64
|
+
handler(message);
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
unsubscribe: async () => {
|
|
68
|
+
await this.controlClient?.unsubscribe(realtime_constants_1.REALTIME_CONTROL_CHANNEL);
|
|
69
|
+
this.controlClient?.removeAllListeners('message');
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
this.logger.log('Realtime Socket.IO Redis adapter connected');
|
|
73
|
+
}
|
|
74
|
+
createIOServer(port, options) {
|
|
75
|
+
const corsOrigin = this.configService.get('app.corsOrigin', '*');
|
|
76
|
+
// Mirror HTTP CORS: browsers reject credentials with wildcard origin.
|
|
77
|
+
const credentials = corsOrigin !== '*';
|
|
78
|
+
const origins = corsOrigin === '*'
|
|
79
|
+
? true
|
|
80
|
+
: corsOrigin
|
|
81
|
+
.split(',')
|
|
82
|
+
.map((o) => o.trim())
|
|
83
|
+
.filter(Boolean);
|
|
84
|
+
const maxHttpBufferSize = Math.max(1024, this.settings.get(settings_keys_1.SETTING_KEYS.REALTIME_MAX_PAYLOAD_BYTES) || 65_536);
|
|
85
|
+
const server = super.createIOServer(port, {
|
|
86
|
+
...options,
|
|
87
|
+
path: realtime_constants_1.REALTIME_PATH,
|
|
88
|
+
cors: {
|
|
89
|
+
origin: origins,
|
|
90
|
+
credentials,
|
|
91
|
+
},
|
|
92
|
+
maxHttpBufferSize,
|
|
93
|
+
pingInterval: 25_000,
|
|
94
|
+
pingTimeout: 20_000,
|
|
95
|
+
allowEIO3: false,
|
|
96
|
+
});
|
|
97
|
+
if (this.adapterConstructor) {
|
|
98
|
+
server.adapter(this.adapterConstructor);
|
|
99
|
+
}
|
|
100
|
+
return server;
|
|
101
|
+
}
|
|
102
|
+
async close(server) {
|
|
103
|
+
await this.controlClient?.quit().catch(() => undefined);
|
|
104
|
+
await this.subClient?.quit().catch(() => undefined);
|
|
105
|
+
await this.pubClient?.quit().catch(() => undefined);
|
|
106
|
+
this.controlClient = null;
|
|
107
|
+
this.subClient = null;
|
|
108
|
+
this.pubClient = null;
|
|
109
|
+
if (server !== undefined) {
|
|
110
|
+
await Promise.resolve(super.close(server));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.RedisIoAdapter = RedisIoAdapter;
|
|
115
|
+
async function installRealtimeIoAdapter(app) {
|
|
116
|
+
const configService = app.get(config_1.ConfigService);
|
|
117
|
+
const settings = app.get(settings_service_1.SettingsService);
|
|
118
|
+
const realtimeService = app.get(realtime_service_1.RealtimeService);
|
|
119
|
+
const adapter = new RedisIoAdapter(app, configService, settings, realtimeService);
|
|
120
|
+
await adapter.connect();
|
|
121
|
+
app.useWebSocketAdapter(adapter);
|
|
122
|
+
return adapter;
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=redis-io.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-io.adapter.js","sourceRoot":"","sources":["../../../../src/modules/realtime/adapters/redis-io.adapter.ts"],"names":[],"mappings":";;;;;;AAsIA,4DAQC;AA9ID,2CAA+D;AAC/D,2CAA+C;AAC/C,mEAAuD;AACvD,4DAAyD;AACzD,sDAA8B;AAG9B,mEAAgE;AAChE,uDAAqE;AACrE,0EAAsE;AACtE,+EAA2E;AAC3E,wEAA0F;AAC1F,mEAA+D;AAE/D;;;GAGG;AACH,MAAa,cAAe,SAAQ,8BAAS;IAS1B;IACA;IACA;IAVD,MAAM,GAAG,IAAI,eAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAClD,kBAAkB,GAA4C,IAAI,CAAC;IACnE,SAAS,GAAmB,IAAI,CAAC;IACjC,SAAS,GAAmB,IAAI,CAAC;IACjC,aAAa,GAAmB,IAAI,CAAC;IAE7C,YACC,GAAqB,EACJ,aAA4B,EAC5B,QAAyB,EACzB,eAAgC;QAEjD,KAAK,CAAC,GAAG,CAAC,CAAC;QAJM,kBAAa,GAAb,aAAa,CAAe;QAC5B,aAAQ,GAAR,QAAQ,CAAiB;QACzB,oBAAe,GAAf,eAAe,CAAiB;IAGlD,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,IAAI,CAAC,IAAA,+BAAc,GAAE,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CACf,0GAA0G,CAC1G,CAAC;YACF,OAAO;QACR,CAAC;QAED,MAAM,MAAM,GAAG;YACd,IAAI,EAAE,IAAI,CAAC,aAAa,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AI,cAAc,CAAC,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;IAClF,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IACxB,GAAG,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACjC,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Engine.IO / Socket.IO HTTP path (not under API prefix). */
|
|
2
|
+
export declare const REALTIME_PATH = "/realtime";
|
|
3
|
+
/** Server-assigned room for a user. */
|
|
4
|
+
export declare const userRoom: (userId: string) => string;
|
|
5
|
+
/** Server-assigned room for a refresh-token family (force-disconnect). */
|
|
6
|
+
export declare const familyRoom: (familyId: string) => string;
|
|
7
|
+
/** Redis presence key. */
|
|
8
|
+
export declare const presenceKey: (userId: string) => string;
|
|
9
|
+
/** Redis pub/sub control channel (cross-instance disconnect / ops). */
|
|
10
|
+
export declare const REALTIME_CONTROL_CHANNEL = "realtime:control";
|
|
11
|
+
/** Handshake / client→server allowlisted events. */
|
|
12
|
+
export declare const REALTIME_CLIENT_EVENTS: {
|
|
13
|
+
readonly REAUTH: "realtime:reauth";
|
|
14
|
+
readonly PING: "realtime:ping";
|
|
15
|
+
};
|
|
16
|
+
/** Server→client system events. */
|
|
17
|
+
export declare const REALTIME_SERVER_EVENTS: {
|
|
18
|
+
readonly READY: "realtime:ready";
|
|
19
|
+
readonly ERROR: "realtime:error";
|
|
20
|
+
readonly PONG: "realtime:pong";
|
|
21
|
+
readonly NOTIFICATION_CREATED: "notification.created";
|
|
22
|
+
readonly SESSION_REVOKED: "session.revoked";
|
|
23
|
+
};
|
|
24
|
+
/** Disconnect / error codes exposed to clients. */
|
|
25
|
+
export declare const REALTIME_CLOSE_CODES: {
|
|
26
|
+
readonly UNAUTHORIZED: "UNAUTHORIZED";
|
|
27
|
+
readonly TOKEN_EXPIRED: "TOKEN_EXPIRED";
|
|
28
|
+
readonly SESSION_REVOKED: "SESSION_REVOKED";
|
|
29
|
+
readonly RATE_LIMITED: "RATE_LIMITED";
|
|
30
|
+
readonly PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
|
|
31
|
+
readonly BAD_EVENT: "BAD_EVENT";
|
|
32
|
+
};
|
|
33
|
+
/** Allowlisted custom room prefixes hosts may join via RealtimeService. */
|
|
34
|
+
export declare const REALTIME_ROOM_PREFIX_ALLOWLIST: readonly ["user:", "family:", "tenant:", "role:"];
|
|
35
|
+
export declare const REALTIME_ENVELOPE_VERSION = 1;
|
|
36
|
+
//# sourceMappingURL=realtime.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtime.constants.d.ts","sourceRoot":"","sources":["../../../../src/modules/realtime/constants/realtime.constants.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC,uCAAuC;AACvC,eAAO,MAAM,QAAQ,GAAI,QAAQ,MAAM,KAAG,MAA0B,CAAC;AAErE,0EAA0E;AAC1E,eAAO,MAAM,UAAU,GAAI,UAAU,MAAM,KAAG,MAA8B,CAAC;AAE7E,0BAA0B;AAC1B,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,KAAG,MAAuC,CAAC;AAErF,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAE3D,oDAAoD;AACpD,eAAO,MAAM,sBAAsB;;;CAGzB,CAAC;AAEX,mCAAmC;AACnC,eAAO,MAAM,sBAAsB;;;;;;CAMzB,CAAC;AAEX,mDAAmD;AACnD,eAAO,MAAM,oBAAoB;;;;;;;CAOvB,CAAC;AAEX,2EAA2E;AAC3E,eAAO,MAAM,8BAA8B,mDAAoD,CAAC;AAEhG,eAAO,MAAM,yBAAyB,IAAI,CAAC"}
|