@colveor/core 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -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 +5 -0
- package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
- package/dist/modules/users/dto/user.dto.js +46 -5
- 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
|
@@ -45,17 +45,17 @@ __decorate([
|
|
|
45
45
|
], CreateUserDto.prototype, "authMethod", void 0);
|
|
46
46
|
__decorate([
|
|
47
47
|
(0, class_validator_1.IsPhoneNumber)(),
|
|
48
|
-
(0, class_validator_1.ValidateIf)((o) => o.
|
|
48
|
+
(0, class_validator_1.ValidateIf)((o) => o.authMethod === user_entity_1.UserAuthMethod.PHONE),
|
|
49
49
|
__metadata("design:type", String)
|
|
50
50
|
], CreateUserDto.prototype, "phoneNumber", void 0);
|
|
51
51
|
__decorate([
|
|
52
52
|
(0, class_validator_1.IsString)(),
|
|
53
|
-
(0, class_validator_1.ValidateIf)((o) => o.
|
|
53
|
+
(0, class_validator_1.ValidateIf)((o) => o.authMethod === user_entity_1.UserAuthMethod.PHONE),
|
|
54
54
|
__metadata("design:type", String)
|
|
55
55
|
], CreateUserDto.prototype, "countryCode", void 0);
|
|
56
56
|
__decorate([
|
|
57
57
|
(0, class_validator_1.IsEmail)(),
|
|
58
|
-
(0, class_validator_1.ValidateIf)((o) => o.
|
|
58
|
+
(0, class_validator_1.ValidateIf)((o) => o.authMethod === user_entity_1.UserAuthMethod.EMAIL || o.authMethod === user_entity_1.UserAuthMethod.OAUTH),
|
|
59
59
|
__metadata("design:type", String)
|
|
60
60
|
], CreateUserDto.prototype, "email", void 0);
|
|
61
61
|
__decorate([
|
|
@@ -71,7 +71,7 @@ __decorate([
|
|
|
71
71
|
__decorate([
|
|
72
72
|
(0, class_validator_1.IsString)(),
|
|
73
73
|
(0, class_validator_1.MinLength)(8),
|
|
74
|
-
(0, class_validator_1.ValidateIf)((o) => o.
|
|
74
|
+
(0, class_validator_1.ValidateIf)((o) => o.authMethod === user_entity_1.UserAuthMethod.EMAIL),
|
|
75
75
|
__metadata("design:type", String)
|
|
76
76
|
], CreateUserDto.prototype, "passwordHash", void 0);
|
|
77
77
|
__decorate([
|
|
@@ -145,14 +145,24 @@ class UserResponseDto {
|
|
|
145
145
|
countryCode;
|
|
146
146
|
authMethod;
|
|
147
147
|
photoFileId;
|
|
148
|
+
photoUrl;
|
|
149
|
+
coverPhotoFileId;
|
|
150
|
+
coverPhotoUrl;
|
|
148
151
|
username;
|
|
149
152
|
displayName;
|
|
153
|
+
firstName;
|
|
154
|
+
lastName;
|
|
150
155
|
isEmailVerified;
|
|
151
156
|
isPhoneVerified;
|
|
152
157
|
onboardingStep;
|
|
153
158
|
isProfileCompleted;
|
|
154
159
|
status;
|
|
155
160
|
static fromUser(user) {
|
|
161
|
+
const { firstName, lastName, displayName, fullName } = user.profile ?? {};
|
|
162
|
+
const resolvedDisplayName = displayName ??
|
|
163
|
+
fullName ??
|
|
164
|
+
(firstName && lastName ? `${firstName} ${lastName}` : undefined);
|
|
165
|
+
const displayNameParts = resolvedDisplayName?.split(/\s+/).filter(Boolean) ?? [];
|
|
156
166
|
return {
|
|
157
167
|
id: user.id,
|
|
158
168
|
uid: user.uid ?? undefined,
|
|
@@ -161,8 +171,14 @@ class UserResponseDto {
|
|
|
161
171
|
countryCode: user.countryCode ?? undefined,
|
|
162
172
|
authMethod: user.authMethod,
|
|
163
173
|
photoFileId: user.profile?.photoFileId ?? undefined,
|
|
174
|
+
photoUrl: user.profile?.photoUrl ?? undefined,
|
|
175
|
+
coverPhotoFileId: user.profile?.coverPhotoFileId ?? undefined,
|
|
176
|
+
coverPhotoUrl: user.profile?.coverPhotoUrl ?? undefined,
|
|
164
177
|
username: user.profile?.username ?? undefined,
|
|
165
|
-
displayName:
|
|
178
|
+
displayName: resolvedDisplayName,
|
|
179
|
+
firstName: firstName ?? displayNameParts[0],
|
|
180
|
+
lastName: lastName ??
|
|
181
|
+
(displayNameParts.length > 1 ? displayNameParts.slice(1).join(' ') : undefined),
|
|
166
182
|
isEmailVerified: user.isEmailVerified,
|
|
167
183
|
isPhoneVerified: user.isPhoneVerified,
|
|
168
184
|
onboardingStep: user.profile?.onboardingStep ?? 0,
|
|
@@ -203,6 +219,22 @@ __decorate([
|
|
|
203
219
|
(0, swagger_1.ApiPropertyOptional)({ format: 'uuid' }),
|
|
204
220
|
__metadata("design:type", String)
|
|
205
221
|
], UserResponseDto.prototype, "photoFileId", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
224
|
+
description: 'Public CDN URL for the profile photo (denormalized; null when unset)',
|
|
225
|
+
}),
|
|
226
|
+
__metadata("design:type", String)
|
|
227
|
+
], UserResponseDto.prototype, "photoUrl", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
(0, swagger_1.ApiPropertyOptional)({ format: 'uuid' }),
|
|
230
|
+
__metadata("design:type", String)
|
|
231
|
+
], UserResponseDto.prototype, "coverPhotoFileId", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
234
|
+
description: 'Public CDN URL for the cover photo (denormalized; null when unset)',
|
|
235
|
+
}),
|
|
236
|
+
__metadata("design:type", String)
|
|
237
|
+
], UserResponseDto.prototype, "coverPhotoUrl", void 0);
|
|
206
238
|
__decorate([
|
|
207
239
|
(0, swagger_1.ApiPropertyOptional)(),
|
|
208
240
|
__metadata("design:type", String)
|
|
@@ -211,6 +243,14 @@ __decorate([
|
|
|
211
243
|
(0, swagger_1.ApiPropertyOptional)(),
|
|
212
244
|
__metadata("design:type", String)
|
|
213
245
|
], UserResponseDto.prototype, "displayName", void 0);
|
|
246
|
+
__decorate([
|
|
247
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
248
|
+
__metadata("design:type", String)
|
|
249
|
+
], UserResponseDto.prototype, "firstName", void 0);
|
|
250
|
+
__decorate([
|
|
251
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
252
|
+
__metadata("design:type", String)
|
|
253
|
+
], UserResponseDto.prototype, "lastName", void 0);
|
|
214
254
|
__decorate([
|
|
215
255
|
(0, swagger_1.ApiProperty)(),
|
|
216
256
|
__metadata("design:type", Boolean)
|
|
@@ -258,6 +298,7 @@ exports.UserFilterDto = UserFilterDto;
|
|
|
258
298
|
__decorate([
|
|
259
299
|
(0, class_validator_1.IsOptional)(),
|
|
260
300
|
(0, class_validator_1.IsString)(),
|
|
301
|
+
(0, class_validator_1.MaxLength)(64),
|
|
261
302
|
__metadata("design:type", String)
|
|
262
303
|
], UserFilterDto.prototype, "search", void 0);
|
|
263
304
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.dto.js","sourceRoot":"","sources":["../../../../src/modules/users/dto/user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,yDAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"user.dto.js","sourceRoot":"","sources":["../../../../src/modules/users/dto/user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,yDAAyC;AACzC,qDAayB;AAEzB,uEAAmE;AACnE,sHAAsG;AACtG,uFAGmD;AACnD,yDAA2E;AAE3E,MAAa,aAAa;IAGzB,GAAG,CAAU;IAQb,UAAU,CAAkB;IAI5B,WAAW,CAAU;IAIrB,WAAW,CAAU;IAOrB,KAAK,CAAU;IAIf,eAA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GrB;IADC,IAAA,6BAAmB,GAAE;;kDACH;AAGnB;IADC,IAAA,6BAAmB,GAAE;;iDACJ;AAGlB;IADC,IAAA,qBAAW,GAAE;;wDACY;AAG1B;IADC,IAAA,qBAAW,GAAE;;wDACY;AAG1B;IADC,IAAA,qBAAW,GAAE;;uDACU;AAGxB;IADC,IAAA,qBAAW,GAAE;;2DACe;AAG7B;IADC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,wBAAU,EAAE,CAAC;;+CACd;AAoCrB,MAAa,aAAc,SAAQ,eAAe;IAMjD,KAAK,CAAY;IAEjB,MAAM,CAAU,QAAQ,CAAC,IAAU;QAClC,OAAO;YACN,GAAG,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC;YACjC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;SACjD,CAAC;IACH,CAAC;CACD;AAdD,sCAcC;AARA;IALC,IAAA,qBAAW,EAAC;QACZ,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,WAAW,EAAE,yCAAyC;QACtD,OAAO,EAAE,CAAC,MAAM,CAAC;KACjB,CAAC;;4CACe;AAmBlB,MAAa,aAAc,SAAQ,8BAAa;IAI/C,MAAM,CAAU;IAIhB,MAAM,CAAc;IAIpB,MAAM,CAAU;CAChB;AAbD,sCAaC;AATA;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,EAAE,CAAC;;6CACE;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,wBAAU,CAAC;;6CACC;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;6CACO"}
|
|
@@ -11,7 +11,8 @@ export declare enum UserStatus {
|
|
|
11
11
|
/** Primary authentication method assigned at signup — immutable for the account. */
|
|
12
12
|
export declare enum UserAuthMethod {
|
|
13
13
|
PHONE = "phone",
|
|
14
|
-
EMAIL = "email"
|
|
14
|
+
EMAIL = "email",
|
|
15
|
+
OAUTH = "oauth"
|
|
15
16
|
}
|
|
16
17
|
export declare class User extends BaseEntity {
|
|
17
18
|
uid?: string;
|
|
@@ -31,6 +32,11 @@ export declare class User extends BaseEntity {
|
|
|
31
32
|
lockedUntil?: Date;
|
|
32
33
|
status: UserStatus;
|
|
33
34
|
isActive: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Monotonic session epoch. Bumped on logout-all / password / identity revoke.
|
|
37
|
+
* Dual-written to Redis; DB is source of truth after Redis flush.
|
|
38
|
+
*/
|
|
39
|
+
sessionEpoch: number;
|
|
34
40
|
lastLoginAt?: Date;
|
|
35
41
|
lastSeenAt?: Date;
|
|
36
42
|
lastActiveAt?: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../../src/modules/users/entities/user.entity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAExD,oBAAY,UAAU;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,SAAS,cAAc;CACvB;AAED,oFAAoF;AACpF,oBAAY,cAAc;IACzB,KAAK,UAAU;IACf,KAAK,UAAU;CACf;AAED,qBACa,IAAK,SAAQ,UAAU;IAUnC,GAAG,CAAC,EAAE,MAAM,CAAC;IAQb,WAAW,CAAC,EAAE,MAAM,CAAC;IAOrB,KAAK,CAAC,EAAE,MAAM,CAAC;IAOf,WAAW,CAAC,EAAE,MAAM,CAAC;IAOrB,UAAU,EAAG,cAAc,CAAC;IAU5B,eAAe,EAAG,OAAO,CAAC;IAO1B,eAAe,CAAC,E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MAAM,CAAC;IAOjB,iBAAiB,CAAC,EAAE,IAAI,CAAC;IAOzB,YAAY,CAAC,EAAE,IAAI,CAAC;IAMpB,mBAAmB,EAAG,MAAM,CAAC;IAO7B,WAAW,CAAC,EAAE,IAAI,CAAC;IAYnB,MAAM,EAAG,UAAU,CAAC;IAMpB,QAAQ,EAAG,OAAO,CAAC;IAMnB;;;OAGG;IAEH,YAAY,EAAG,MAAM,CAAC;IAOtB,WAAW,CAAC,EAAE,IAAI,CAAC;IAOnB,UAAU,CAAC,EAAE,IAAI,CAAC;IAOlB,YAAY,CAAC,EAAE,IAAI,CAAC;IAWpB,eAAe,CAAC,EAAE,MAAM,CAAC;IAQzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAO3B,oBAAoB,CAAC,EAAE,IAAI,CAAC;IAM5B,WAAW,CAAC,EAAE,MAAM,CAAC;IAOrB,SAAS,CAAC,EAAE,IAAI,CAAC;IAWjB,mBAAmB,CAAC,EAAE,IAAI,CAAC;IAS3B,OAAO,CAAC,EAAE,WAAW,CAAC;IActB,KAAK,EAAG,IAAI,EAAE,CAAC;CACf"}
|
|
@@ -28,6 +28,7 @@ var UserAuthMethod;
|
|
|
28
28
|
(function (UserAuthMethod) {
|
|
29
29
|
UserAuthMethod["PHONE"] = "phone";
|
|
30
30
|
UserAuthMethod["EMAIL"] = "email";
|
|
31
|
+
UserAuthMethod["OAUTH"] = "oauth";
|
|
31
32
|
})(UserAuthMethod || (exports.UserAuthMethod = UserAuthMethod = {}));
|
|
32
33
|
let User = class User extends base_entity_1.BaseEntity {
|
|
33
34
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -62,6 +63,11 @@ let User = class User extends base_entity_1.BaseEntity {
|
|
|
62
63
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
63
64
|
// Activity
|
|
64
65
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
66
|
+
/**
|
|
67
|
+
* Monotonic session epoch. Bumped on logout-all / password / identity revoke.
|
|
68
|
+
* Dual-written to Redis; DB is source of truth after Redis flush.
|
|
69
|
+
*/
|
|
70
|
+
sessionEpoch;
|
|
65
71
|
lastLoginAt;
|
|
66
72
|
lastSeenAt;
|
|
67
73
|
lastActiveAt;
|
|
@@ -218,6 +224,10 @@ __decorate([
|
|
|
218
224
|
}),
|
|
219
225
|
__metadata("design:type", Boolean)
|
|
220
226
|
], User.prototype, "isActive", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
(0, typeorm_1.Column)({ name: 'session_epoch', type: 'int', default: 0 }),
|
|
229
|
+
__metadata("design:type", Number)
|
|
230
|
+
], User.prototype, "sessionEpoch", void 0);
|
|
221
231
|
__decorate([
|
|
222
232
|
(0, typeorm_1.Column)({
|
|
223
233
|
name: 'last_login_at',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../../src/modules/users/entities/user.entity.ts"],"names":[],"mappings":";AAAA,iBAAiB;;;;;;;;;;;;AAEjB,qCAAiF;AAEjF,kEAA8D;AAC9D,sFAA0E;AAC1E,kEAAwD;AAExD,IAAY,UAMX;AAND,WAAY,UAAU;IACrB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;AACxB,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB;AAED,oFAAoF;AACpF,IAAY,
|
|
1
|
+
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../../src/modules/users/entities/user.entity.ts"],"names":[],"mappings":";AAAA,iBAAiB;;;;;;;;;;;;AAEjB,qCAAiF;AAEjF,kEAA8D;AAC9D,sFAA0E;AAC1E,kEAAwD;AAExD,IAAY,UAMX;AAND,WAAY,UAAU;IACrB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;AACxB,CAAC,EANW,UAAU,0BAAV,UAAU,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C,IAAI,CAAC,KAAK,CAAC;IAC5C,IAAA,mBAAS,EAAC;QACV,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACX,IAAI,EAAE,SAAS;YACf,oBAAoB,EAAE,IAAI;SAC1B;QACD,iBAAiB,EAAE;YAClB,IAAI,EAAE,SAAS;YACf,oBAAoB,EAAE,IAAI;SAC1B;KACD,CAAC;;mCACa;eA7OH,IAAI;IADhB,IAAA,gBAAM,EAAC,OAAO,CAAC;GACH,IAAI,CA8OhB"}
|
|
@@ -17,7 +17,10 @@ export declare class UsersService {
|
|
|
17
17
|
private readonly tokenService;
|
|
18
18
|
private readonly logger;
|
|
19
19
|
constructor(userRepository: Repository<User>, userProfilesService: UserProfilesService, redis: IORedis, settingsService: SettingsService, notificationDelivery: NotificationDeliveryService | null, tokenService: TokenService | null, logger: StructuredLoggerService);
|
|
20
|
-
create(createUserDto: CreateUserDto, manager?: EntityManager
|
|
20
|
+
create(createUserDto: CreateUserDto, manager?: EntityManager, opts?: {
|
|
21
|
+
skipUniquenessCheck?: boolean;
|
|
22
|
+
markLoggedIn?: boolean;
|
|
23
|
+
}): Promise<User>;
|
|
21
24
|
findAll(options?: PaginationOptions & UserFilterDto): Promise<PaginatedResult<UserResponseDto>>;
|
|
22
25
|
getStats(): Promise<{
|
|
23
26
|
total: number;
|
|
@@ -35,7 +38,9 @@ export declare class UsersService {
|
|
|
35
38
|
findByPhoneWithPassword(phoneNumber: string): Promise<User | null>;
|
|
36
39
|
private normalizeSearchOptions;
|
|
37
40
|
findBy(options: FindByOptions): Promise<User | null>;
|
|
38
|
-
update(id: string, updateUserDto: UpdateUserDto
|
|
41
|
+
update(id: string, updateUserDto: UpdateUserDto, opts?: {
|
|
42
|
+
skipIdentitySessionRevoke?: boolean;
|
|
43
|
+
}): Promise<User>;
|
|
39
44
|
updateLastLogin(id: string, manager?: EntityManager): Promise<void>;
|
|
40
45
|
updateLastSeen(id: string): Promise<void>;
|
|
41
46
|
updateLastActive(id: string): Promise<void>;
|
|
@@ -46,6 +51,14 @@ export declare class UsersService {
|
|
|
46
51
|
resetLoginAttempts(id: string): Promise<void>;
|
|
47
52
|
verifyEmail(id: string): Promise<User>;
|
|
48
53
|
verifyPhone(id: string): Promise<User>;
|
|
54
|
+
/** Single UPDATE — use when the caller already holds the user entity. */
|
|
55
|
+
markEmailVerified(id: string, manager?: EntityManager): Promise<void>;
|
|
56
|
+
/** Single UPDATE — use when the caller already holds the user entity. */
|
|
57
|
+
markPhoneVerified(id: string): Promise<void>;
|
|
58
|
+
/** DB session epoch (source of truth after Redis flush). */
|
|
59
|
+
getPersistedSessionEpoch(userId: string): Promise<number>;
|
|
60
|
+
/** Atomically increment persisted session epoch; returns the new value. */
|
|
61
|
+
bumpPersistedSessionEpoch(userId: string): Promise<number>;
|
|
49
62
|
deactivate(id: string): Promise<User>;
|
|
50
63
|
activate(id: string): Promise<User>;
|
|
51
64
|
delete(id: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/users/services/users.service.ts"],"names":[],"mappings":"AAUA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAoB,UAAU,EAAE,MAAM,SAAS,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"users.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/users/services/users.service.ts"],"names":[],"mappings":"AAUA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAoB,UAAU,EAAE,MAAM,SAAS,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAG1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAChG,OAAO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InB,OAAO,CAAC,sBAAsB;IAc9B,OAAO,CAAC,wBAAwB;IAgBhC,OAAO,CAAC,oBAAoB;IAc5B;;;OAGG;YACW,WAAW;YAQX,qBAAqB;CAuDnC"}
|
|
@@ -21,6 +21,7 @@ const typeorm_1 = require("@nestjs/typeorm");
|
|
|
21
21
|
const ioredis_1 = __importDefault(require("ioredis"));
|
|
22
22
|
const ms_1 = __importDefault(require("ms"));
|
|
23
23
|
const typeorm_2 = require("typeorm");
|
|
24
|
+
const postgres_error_util_1 = require("../../../common/utils/postgres-error.util");
|
|
24
25
|
const redis_module_1 = require("../../../config/redis.module");
|
|
25
26
|
const structured_logger_service_1 = require("../../observability/logging/structured-logger.service");
|
|
26
27
|
const profile_service_1 = require("../../profile/services/profile.service");
|
|
@@ -51,9 +52,12 @@ let UsersService = class UsersService {
|
|
|
51
52
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
52
53
|
// Create
|
|
53
54
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
54
|
-
async create(createUserDto, manager) {
|
|
55
|
+
async create(createUserDto, manager, opts) {
|
|
55
56
|
const repo = manager ? manager.getRepository(user_entity_1.User) : this.userRepository;
|
|
56
|
-
await this.validateCreateUserDto(createUserDto, repo
|
|
57
|
+
await this.validateCreateUserDto(createUserDto, repo, {
|
|
58
|
+
skipUniquenessCheck: opts?.skipUniquenessCheck,
|
|
59
|
+
});
|
|
60
|
+
const now = new Date();
|
|
57
61
|
const { profile: profileDto, ...userFields } = createUserDto;
|
|
58
62
|
const user = repo.create({
|
|
59
63
|
...userFields,
|
|
@@ -61,10 +65,22 @@ let UsersService = class UsersService {
|
|
|
61
65
|
phoneNumber: createUserDto.phoneNumber
|
|
62
66
|
? this.normalizePhone(createUserDto.phoneNumber)
|
|
63
67
|
: undefined,
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
emailVerifiedAt: createUserDto.isEmailVerified ? now : undefined,
|
|
69
|
+
phoneVerifiedAt: createUserDto.isPhoneVerified ? now : undefined,
|
|
70
|
+
lastSeenAt: now,
|
|
71
|
+
lastActiveAt: now,
|
|
72
|
+
...(opts?.markLoggedIn ? { lastLoginAt: now } : {}),
|
|
66
73
|
});
|
|
67
|
-
|
|
74
|
+
let savedUser;
|
|
75
|
+
try {
|
|
76
|
+
savedUser = await repo.save(user);
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
if ((0, postgres_error_util_1.isPostgresUniqueViolation)(err)) {
|
|
80
|
+
throw new common_1.ConflictException('An account with this email or phone number already exists.');
|
|
81
|
+
}
|
|
82
|
+
throw err;
|
|
83
|
+
}
|
|
68
84
|
if (profileDto && Object.keys(profileDto).length > 0) {
|
|
69
85
|
await this.userProfilesService.create(savedUser.id, profileDto, manager);
|
|
70
86
|
}
|
|
@@ -76,6 +92,11 @@ let UsersService = class UsersService {
|
|
|
76
92
|
async findAll(options) {
|
|
77
93
|
const page = options?.page || 1;
|
|
78
94
|
const limit = options?.limit || 20;
|
|
95
|
+
/** Deep offset pages become expensive — prefer tighter filters beyond this. */
|
|
96
|
+
const MAX_OFFSET_PAGE = 50;
|
|
97
|
+
if (page > MAX_OFFSET_PAGE) {
|
|
98
|
+
throw new common_1.BadRequestException(`Offset page > ${MAX_OFFSET_PAGE} is not supported. Narrow filters or use a lower page.`);
|
|
99
|
+
}
|
|
79
100
|
const skip = (page - 1) * limit;
|
|
80
101
|
const qb = this.userRepository
|
|
81
102
|
.createQueryBuilder('user')
|
|
@@ -85,17 +106,21 @@ let UsersService = class UsersService {
|
|
|
85
106
|
.take(limit)
|
|
86
107
|
.orderBy('user.createdAt', 'DESC');
|
|
87
108
|
if (options?.search?.trim()) {
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
109
|
+
const raw = options.search.trim().toLowerCase().slice(0, 64);
|
|
110
|
+
// Require at least 2 chars; use prefix match so unique indexes can help.
|
|
111
|
+
if (raw.length >= 2) {
|
|
112
|
+
const prefix = `${raw.replace(/[%_]/g, '\\$&')}%`;
|
|
113
|
+
qb.andWhere(`
|
|
114
|
+
(
|
|
115
|
+
user.email LIKE :prefix ESCAPE :esc
|
|
116
|
+
OR user.phoneNumber LIKE :prefix ESCAPE :esc
|
|
117
|
+
OR profile.username LIKE :prefix ESCAPE :esc
|
|
118
|
+
OR LOWER(profile.firstName) LIKE :prefix ESCAPE :esc
|
|
119
|
+
OR LOWER(profile.lastName) LIKE :prefix ESCAPE :esc
|
|
120
|
+
OR LOWER(profile.displayName) LIKE :prefix ESCAPE :esc
|
|
121
|
+
)
|
|
122
|
+
`, { prefix, esc: '\\' });
|
|
123
|
+
}
|
|
99
124
|
}
|
|
100
125
|
if (options?.status != null) {
|
|
101
126
|
qb.andWhere('user.status = :status', {
|
|
@@ -181,13 +206,14 @@ let UsersService = class UsersService {
|
|
|
181
206
|
async findByEmailWithPassword(email) {
|
|
182
207
|
if (!email?.trim())
|
|
183
208
|
return null;
|
|
209
|
+
// Emails are stored lowercased — equality hits the unique index (no LOWER()).
|
|
184
210
|
return this.userRepository
|
|
185
211
|
.createQueryBuilder('user')
|
|
186
212
|
.leftJoinAndSelect('user.profile', 'profile')
|
|
187
213
|
.leftJoinAndSelect('user.roles', 'roles')
|
|
188
214
|
.addSelect(['user.passwordHash', 'user.pinHash'])
|
|
189
|
-
.where('
|
|
190
|
-
email: email.trim(),
|
|
215
|
+
.where('user.email = :email', {
|
|
216
|
+
email: email.trim().toLowerCase(),
|
|
191
217
|
})
|
|
192
218
|
.getOne();
|
|
193
219
|
}
|
|
@@ -239,7 +265,7 @@ let UsersService = class UsersService {
|
|
|
239
265
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
240
266
|
// Update
|
|
241
267
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
242
|
-
async update(id, updateUserDto) {
|
|
268
|
+
async update(id, updateUserDto, opts) {
|
|
243
269
|
const user = await this.userRepository.findOne({
|
|
244
270
|
where: { id },
|
|
245
271
|
relations: [...USER_RELATIONS],
|
|
@@ -252,15 +278,47 @@ let UsersService = class UsersService {
|
|
|
252
278
|
if (requestedAuthMethod !== undefined && requestedAuthMethod !== user.authMethod) {
|
|
253
279
|
throw new common_1.BadRequestException('authMethod cannot be changed after signup');
|
|
254
280
|
}
|
|
281
|
+
const previousEmail = user.email;
|
|
282
|
+
const previousPhone = user.phoneNumber;
|
|
255
283
|
Object.assign(user, userFields);
|
|
256
284
|
if (updateUserDto.email) {
|
|
257
|
-
|
|
285
|
+
const nextEmail = updateUserDto.email.trim().toLowerCase();
|
|
286
|
+
user.email = nextEmail;
|
|
287
|
+
if (previousEmail !== nextEmail && updateUserDto.isEmailVerified === undefined) {
|
|
288
|
+
user.isEmailVerified = false;
|
|
289
|
+
user.emailVerifiedAt = undefined;
|
|
290
|
+
}
|
|
258
291
|
}
|
|
259
292
|
if (updateUserDto.phoneNumber) {
|
|
260
|
-
|
|
293
|
+
const nextPhone = this.normalizePhone(updateUserDto.phoneNumber);
|
|
294
|
+
user.phoneNumber = nextPhone;
|
|
295
|
+
// Admin updates that change phone without explicit verification clear the flag.
|
|
296
|
+
if (previousPhone !== nextPhone && updateUserDto.isPhoneVerified === undefined) {
|
|
297
|
+
user.isPhoneVerified = false;
|
|
298
|
+
user.phoneVerifiedAt = undefined;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
// Explicit verification flags refresh timestamps (e.g. change-email / change-phone).
|
|
302
|
+
if (updateUserDto.isEmailVerified === true) {
|
|
303
|
+
user.isEmailVerified = true;
|
|
304
|
+
user.emailVerifiedAt = new Date();
|
|
305
|
+
}
|
|
306
|
+
if (updateUserDto.isPhoneVerified === true) {
|
|
307
|
+
user.isPhoneVerified = true;
|
|
308
|
+
user.phoneVerifiedAt = new Date();
|
|
261
309
|
}
|
|
262
310
|
user.lastActiveAt = new Date();
|
|
263
|
-
|
|
311
|
+
const emailChanged = updateUserDto.email !== undefined && previousEmail !== user.email;
|
|
312
|
+
const phoneChanged = updateUserDto.phoneNumber !== undefined && previousPhone !== user.phoneNumber;
|
|
313
|
+
try {
|
|
314
|
+
await this.userRepository.save(user);
|
|
315
|
+
}
|
|
316
|
+
catch (err) {
|
|
317
|
+
if ((0, postgres_error_util_1.isPostgresUniqueViolation)(err)) {
|
|
318
|
+
throw new common_1.ConflictException('An account with this email or phone number already exists.');
|
|
319
|
+
}
|
|
320
|
+
throw err;
|
|
321
|
+
}
|
|
264
322
|
if (profileDto && Object.keys(profileDto).length > 0) {
|
|
265
323
|
const existingProfile = await this.userProfilesService.findByUserId(id);
|
|
266
324
|
if (existingProfile) {
|
|
@@ -273,6 +331,11 @@ let UsersService = class UsersService {
|
|
|
273
331
|
});
|
|
274
332
|
}
|
|
275
333
|
}
|
|
334
|
+
// Admin identity rebind must invalidate sessions. Self-serve change-* paths
|
|
335
|
+
// pass skipIdentitySessionRevoke and revoke themselves with the right reason.
|
|
336
|
+
if (!opts?.skipIdentitySessionRevoke && (emailChanged || phoneChanged)) {
|
|
337
|
+
await this.tokenService?.revokeAllUserTokens(id, refresh_token_entity_1.RevokeReason.ADMIN);
|
|
338
|
+
}
|
|
276
339
|
return user;
|
|
277
340
|
}
|
|
278
341
|
async updateLastLogin(id, manager) {
|
|
@@ -330,25 +393,35 @@ let UsersService = class UsersService {
|
|
|
330
393
|
// Verification
|
|
331
394
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
332
395
|
async verifyEmail(id) {
|
|
333
|
-
|
|
334
|
-
if (!user) {
|
|
335
|
-
throw new common_1.NotFoundException(`User with ID ${id} not found`);
|
|
336
|
-
}
|
|
337
|
-
user.isEmailVerified = true;
|
|
338
|
-
user.emailVerifiedAt = new Date();
|
|
339
|
-
await this.userRepository.save(user);
|
|
396
|
+
await this.markEmailVerified(id);
|
|
340
397
|
return this.findByIdOrFail(id);
|
|
341
398
|
}
|
|
342
399
|
async verifyPhone(id) {
|
|
343
|
-
|
|
344
|
-
if (!user) {
|
|
345
|
-
throw new common_1.NotFoundException(`User with ID ${id} not found`);
|
|
346
|
-
}
|
|
347
|
-
user.isPhoneVerified = true;
|
|
348
|
-
user.phoneVerifiedAt = new Date();
|
|
349
|
-
await this.userRepository.save(user);
|
|
400
|
+
await this.markPhoneVerified(id);
|
|
350
401
|
return this.findByIdOrFail(id);
|
|
351
402
|
}
|
|
403
|
+
/** Single UPDATE — use when the caller already holds the user entity. */
|
|
404
|
+
async markEmailVerified(id, manager) {
|
|
405
|
+
const repo = manager?.getRepository(user_entity_1.User) ?? this.userRepository;
|
|
406
|
+
await repo.update({ id, isEmailVerified: false }, { isEmailVerified: true, emailVerifiedAt: new Date() });
|
|
407
|
+
}
|
|
408
|
+
/** Single UPDATE — use when the caller already holds the user entity. */
|
|
409
|
+
async markPhoneVerified(id) {
|
|
410
|
+
await this.userRepository.update({ id, isPhoneVerified: false }, { isPhoneVerified: true, phoneVerifiedAt: new Date() });
|
|
411
|
+
}
|
|
412
|
+
/** DB session epoch (source of truth after Redis flush). */
|
|
413
|
+
async getPersistedSessionEpoch(userId) {
|
|
414
|
+
const row = await this.userRepository.findOne({
|
|
415
|
+
where: { id: userId },
|
|
416
|
+
select: ['id', 'sessionEpoch'],
|
|
417
|
+
});
|
|
418
|
+
return row?.sessionEpoch ?? 0;
|
|
419
|
+
}
|
|
420
|
+
/** Atomically increment persisted session epoch; returns the new value. */
|
|
421
|
+
async bumpPersistedSessionEpoch(userId) {
|
|
422
|
+
await this.userRepository.increment({ id: userId }, 'sessionEpoch', 1);
|
|
423
|
+
return this.getPersistedSessionEpoch(userId);
|
|
424
|
+
}
|
|
352
425
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
353
426
|
// Account State
|
|
354
427
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -394,7 +467,41 @@ let UsersService = class UsersService {
|
|
|
394
467
|
if (!user) {
|
|
395
468
|
throw new common_1.NotFoundException(`User with ID ${id} not found`);
|
|
396
469
|
}
|
|
470
|
+
// Kill access JWTs immediately (epoch) before soft-delete — JwtStrategy does not load user status.
|
|
471
|
+
if (this.tokenService) {
|
|
472
|
+
await this.tokenService.revokeAllUserTokens(id, refresh_token_entity_1.RevokeReason.LOGOUT);
|
|
473
|
+
}
|
|
397
474
|
this.notifyAccountDeleted(user);
|
|
475
|
+
// Release email/phone so they can be re-registered (partial unique indexes
|
|
476
|
+
// only apply where deleted_at IS NULL).
|
|
477
|
+
const tombstone = id.replace(/-/g, '').slice(0, 12);
|
|
478
|
+
await this.userRepository
|
|
479
|
+
.createQueryBuilder()
|
|
480
|
+
.update(user_entity_1.User)
|
|
481
|
+
.set({
|
|
482
|
+
email: user.email ? `deleted+${tombstone}@invalid.local` : () => 'NULL',
|
|
483
|
+
phoneNumber: () => 'NULL',
|
|
484
|
+
isEmailVerified: false,
|
|
485
|
+
isPhoneVerified: false,
|
|
486
|
+
emailVerifiedAt: () => 'NULL',
|
|
487
|
+
phoneVerifiedAt: () => 'NULL',
|
|
488
|
+
isActive: false,
|
|
489
|
+
status: user_entity_1.UserStatus.REVOKED,
|
|
490
|
+
})
|
|
491
|
+
.where('id = :id', { id })
|
|
492
|
+
.execute();
|
|
493
|
+
// Release OAuth subjects so the same provider identity can re-register
|
|
494
|
+
// (partial unique indexes apply only where deleted_at IS NULL).
|
|
495
|
+
await this.userRepository.query(`
|
|
496
|
+
UPDATE "user_oauth_identities"
|
|
497
|
+
SET
|
|
498
|
+
"provider_subject" = CONCAT('deleted:', "id"::text),
|
|
499
|
+
"email" = NULL,
|
|
500
|
+
"email_verified" = false,
|
|
501
|
+
"deleted_at" = NOW(),
|
|
502
|
+
"updated_at" = NOW()
|
|
503
|
+
WHERE "user_id" = $1 AND "deleted_at" IS NULL
|
|
504
|
+
`, [id]);
|
|
398
505
|
await this.userRepository.softDelete(id);
|
|
399
506
|
}
|
|
400
507
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -477,7 +584,7 @@ let UsersService = class UsersService {
|
|
|
477
584
|
const ttlSeconds = Math.ceil((0, ms_1.default)(ttlString) / 1000);
|
|
478
585
|
await this.redis.set(`user:banned:${userId}`, '1', 'EX', ttlSeconds);
|
|
479
586
|
}
|
|
480
|
-
async validateCreateUserDto(createUserDto, repo) {
|
|
587
|
+
async validateCreateUserDto(createUserDto, repo, opts) {
|
|
481
588
|
if (createUserDto.authMethod === user_entity_1.UserAuthMethod.PHONE && !createUserDto.phoneNumber) {
|
|
482
589
|
throw new common_1.ConflictException('Phone auth requires a phone number.');
|
|
483
590
|
}
|
|
@@ -489,6 +596,14 @@ let UsersService = class UsersService {
|
|
|
489
596
|
throw new common_1.ConflictException('Email auth requires a password.');
|
|
490
597
|
}
|
|
491
598
|
}
|
|
599
|
+
if (createUserDto.authMethod === user_entity_1.UserAuthMethod.OAUTH) {
|
|
600
|
+
if (!createUserDto.email) {
|
|
601
|
+
throw new common_1.ConflictException('OAuth auth requires an email address.');
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
// Registration already fail-fasts uniqueness before password hashing.
|
|
605
|
+
if (opts?.skipUniquenessCheck)
|
|
606
|
+
return;
|
|
492
607
|
const conditions = [];
|
|
493
608
|
if (createUserDto.phoneNumber) {
|
|
494
609
|
conditions.push({
|