@colveor/core 1.1.0 → 1.2.1
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 +24 -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/1784284557959-full-schema.d.ts.map +1 -1
- package/dist/database/migrations/1784284557959-full-schema.js +48 -14
- package/dist/database/migrations/1784284557959-full-schema.js.map +1 -1
- package/dist/database/migrations/1784284557960-audit-partitioning.d.ts +17 -0
- package/dist/database/migrations/1784284557960-audit-partitioning.d.ts.map +1 -0
- package/dist/database/migrations/1784284557960-audit-partitioning.js +384 -0
- package/dist/database/migrations/1784284557960-audit-partitioning.js.map +1 -0
- package/dist/database/seeds/roles.seed.d.ts +6 -0
- package/dist/database/seeds/roles.seed.d.ts.map +1 -1
- package/dist/database/seeds/roles.seed.js +22 -5
- package/dist/database/seeds/roles.seed.js.map +1 -1
- package/dist/database/seeds/settings.seed.d.ts +5 -0
- package/dist/database/seeds/settings.seed.d.ts.map +1 -1
- package/dist/database/seeds/settings.seed.js +500 -25
- package/dist/database/seeds/settings.seed.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.d.ts +1 -0
- package/dist/database/seeds/templates/html-template.reader.d.ts.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.js +3 -1
- package/dist/database/seeds/templates/html-template.reader.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.ts +5 -1
- package/dist/database/typeorm.util.d.ts.map +1 -1
- package/dist/database/typeorm.util.js +6 -0
- package/dist/database/typeorm.util.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -4
- package/dist/index.js.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.d.ts +15 -7
- package/dist/modules/admin/controllers/admin.controller.d.ts.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.js +74 -17
- package/dist/modules/admin/controllers/admin.controller.js.map +1 -1
- package/dist/modules/admin/services/admin-log.service.d.ts +14 -7
- package/dist/modules/admin/services/admin-log.service.d.ts.map +1 -1
- package/dist/modules/admin/services/admin-log.service.js +41 -38
- package/dist/modules/admin/services/admin-log.service.js.map +1 -1
- package/dist/modules/audit/audit.manifest.d.ts +8 -0
- package/dist/modules/audit/audit.manifest.d.ts.map +1 -0
- package/dist/modules/audit/audit.manifest.js +31 -0
- package/dist/modules/audit/audit.manifest.js.map +1 -0
- package/dist/modules/audit/audit.module.d.ts +8 -0
- package/dist/modules/audit/audit.module.d.ts.map +1 -0
- package/dist/modules/audit/audit.module.js +57 -0
- package/dist/modules/audit/audit.module.js.map +1 -0
- package/dist/modules/audit/constants/audit-actions.d.ts +79 -0
- package/dist/modules/audit/constants/audit-actions.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-actions.js +89 -0
- package/dist/modules/audit/constants/audit-actions.js.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts +10 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.js +13 -0
- package/dist/modules/audit/constants/audit-mutation.js.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts +13 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.js +149 -0
- package/dist/modules/audit/controllers/audit.controller.js.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts +27 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.js +18 -0
- package/dist/modules/audit/decorators/audit.decorator.js.map +1 -0
- package/dist/modules/audit/dto/audit.dto.d.ts +54 -0
- package/dist/modules/audit/dto/audit.dto.d.ts.map +1 -0
- package/dist/modules/audit/dto/audit.dto.js +129 -0
- package/dist/modules/audit/dto/audit.dto.js.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts +33 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.js +125 -0
- package/dist/modules/audit/entities/audit-event.entity.js.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts +16 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js +65 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js.map +1 -0
- package/dist/modules/audit/index.d.ts +13 -0
- package/dist/modules/audit/index.d.ts.map +1 -0
- package/dist/modules/audit/index.js +23 -0
- package/dist/modules/audit/index.js.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts +11 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js +75 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts +31 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js +338 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.js +132 -0
- package/dist/modules/audit/services/audit-archive.service.js.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts +22 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js +79 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.js +99 -0
- package/dist/modules/audit/services/audit-leader.service.js.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts +29 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.js +144 -0
- package/dist/modules/audit/services/audit-outbox.worker.js.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts +18 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.js +70 -0
- package/dist/modules/audit/services/audit-partition.service.js.map +1 -0
- package/dist/modules/audit/services/audit-write.service.d.ts +60 -0
- package/dist/modules/audit/services/audit-write.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-write.service.js +463 -0
- package/dist/modules/audit/services/audit-write.service.js.map +1 -0
- package/dist/modules/audit/services/audit.service.d.ts +60 -0
- package/dist/modules/audit/services/audit.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit.service.js +373 -0
- package/dist/modules/audit/services/audit.service.js.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts +20 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.js +44 -0
- package/dist/modules/audit/utils/audit-hash.util.js.map +1 -0
- package/dist/modules/auth/auth-core/auth-core.module.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/auth-core.module.js +16 -4
- package/dist/modules/auth/auth-core/auth-core.module.js.map +1 -1
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts +22 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js +25 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts +19 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js +110 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts +7 -8
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js +34 -34
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js.map +1 -1
- package/dist/modules/auth/auth.manifest.d.ts +6 -0
- package/dist/modules/auth/auth.manifest.d.ts.map +1 -1
- package/dist/modules/auth/auth.manifest.js +38 -2
- package/dist/modules/auth/auth.manifest.js.map +1 -1
- package/dist/modules/auth/auth.module.d.ts.map +1 -1
- package/dist/modules/auth/auth.module.js +39 -4
- package/dist/modules/auth/auth.module.js.map +1 -1
- package/dist/modules/auth/controllers/account.controller.d.ts +15 -1
- package/dist/modules/auth/controllers/account.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/account.controller.js +65 -7
- package/dist/modules/auth/controllers/account.controller.js.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.d.ts +7 -3
- package/dist/modules/auth/controllers/auth.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.js +76 -16
- package/dist/modules/auth/controllers/auth.controller.js.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts +4 -2
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.js +32 -11
- package/dist/modules/auth/controllers/forgot-password.controller.js.map +1 -1
- package/dist/modules/auth/controllers/mfa.controller.d.ts +18 -0
- package/dist/modules/auth/controllers/mfa.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/mfa.controller.js +192 -0
- package/dist/modules/auth/controllers/mfa.controller.js.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts +22 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.js +192 -0
- package/dist/modules/auth/controllers/oauth.controller.js.map +1 -0
- package/dist/modules/auth/controllers/otp.controller.d.ts +6 -3
- package/dist/modules/auth/controllers/otp.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/otp.controller.js +32 -33
- package/dist/modules/auth/controllers/otp.controller.js.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.js +10 -2
- package/dist/modules/auth/controllers/pin.controller.js.map +1 -1
- package/dist/modules/auth/controllers/session.controller.d.ts +12 -4
- package/dist/modules/auth/controllers/session.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/session.controller.js +130 -31
- package/dist/modules/auth/controllers/session.controller.js.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.d.ts +11 -2
- package/dist/modules/auth/dto/auth-config.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.js +78 -3
- package/dist/modules/auth/dto/auth-config.dto.js.map +1 -1
- package/dist/modules/auth/dto/index.d.ts +2 -0
- package/dist/modules/auth/dto/index.d.ts.map +1 -1
- package/dist/modules/auth/dto/index.js +2 -0
- package/dist/modules/auth/dto/index.js.map +1 -1
- package/dist/modules/auth/dto/login.dto.d.ts +8 -1
- package/dist/modules/auth/dto/login.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/login.dto.js +48 -3
- package/dist/modules/auth/dto/login.dto.js.map +1 -1
- package/dist/modules/auth/dto/mfa.dto.d.ts +61 -0
- package/dist/modules/auth/dto/mfa.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/mfa.dto.js +326 -0
- package/dist/modules/auth/dto/mfa.dto.js.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts +45 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.js +249 -0
- package/dist/modules/auth/dto/oauth.dto.js.map +1 -0
- package/dist/modules/auth/dto/otp.dto.d.ts +3 -1
- package/dist/modules/auth/dto/otp.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/otp.dto.js +19 -0
- package/dist/modules/auth/dto/otp.dto.js.map +1 -1
- package/dist/modules/auth/dto/password.dto.d.ts +28 -0
- package/dist/modules/auth/dto/password.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/password.dto.js +191 -5
- package/dist/modules/auth/dto/password.dto.js.map +1 -1
- package/dist/modules/auth/dto/register.dto.d.ts +1 -0
- package/dist/modules/auth/dto/register.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/register.dto.js +1 -0
- package/dist/modules/auth/dto/register.dto.js.map +1 -1
- package/dist/modules/auth/dto/session.dto.d.ts +20 -0
- package/dist/modules/auth/dto/session.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/session.dto.js +98 -0
- package/dist/modules/auth/dto/session.dto.js.map +1 -0
- package/dist/modules/auth/dto/token.dto.d.ts +38 -1
- package/dist/modules/auth/dto/token.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/token.dto.js +21 -1
- package/dist/modules/auth/dto/token.dto.js.map +1 -1
- package/dist/modules/auth/entities/index.d.ts +2 -0
- package/dist/modules/auth/entities/index.d.ts.map +1 -1
- package/dist/modules/auth/entities/index.js +2 -0
- package/dist/modules/auth/entities/index.js.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts +2 -0
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.js +6 -0
- package/dist/modules/auth/entities/password-reset-token.entity.js.map +1 -1
- package/dist/modules/auth/entities/user-mfa.entity.d.ts +19 -0
- package/dist/modules/auth/entities/user-mfa.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-mfa.entity.js +73 -0
- package/dist/modules/auth/entities/user-mfa.entity.js.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts +24 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js +84 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js.map +1 -0
- package/dist/modules/auth/events/auth.events.d.ts +84 -19
- package/dist/modules/auth/events/auth.events.d.ts.map +1 -1
- package/dist/modules/auth/events/auth.events.js +17 -9
- package/dist/modules/auth/events/auth.events.js.map +1 -1
- package/dist/modules/auth/services/account.service.d.ts +74 -14
- package/dist/modules/auth/services/account.service.d.ts.map +1 -1
- package/dist/modules/auth/services/account.service.js +247 -31
- package/dist/modules/auth/services/account.service.js.map +1 -1
- package/dist/modules/auth/services/dpop.service.d.ts +41 -0
- package/dist/modules/auth/services/dpop.service.d.ts.map +1 -0
- package/dist/modules/auth/services/dpop.service.js +159 -0
- package/dist/modules/auth/services/dpop.service.js.map +1 -0
- package/dist/modules/auth/services/index.d.ts +2 -0
- package/dist/modules/auth/services/index.d.ts.map +1 -1
- package/dist/modules/auth/services/index.js +2 -0
- package/dist/modules/auth/services/index.js.map +1 -1
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts +28 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts.map +1 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js +163 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js.map +1 -0
- package/dist/modules/auth/services/login.service.d.ts +29 -34
- package/dist/modules/auth/services/login.service.d.ts.map +1 -1
- package/dist/modules/auth/services/login.service.js +173 -61
- package/dist/modules/auth/services/login.service.js.map +1 -1
- package/dist/modules/auth/services/mfa.service.d.ts +111 -0
- package/dist/modules/auth/services/mfa.service.d.ts.map +1 -0
- package/dist/modules/auth/services/mfa.service.js +662 -0
- package/dist/modules/auth/services/mfa.service.js.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js +56 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts +12 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js +64 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js +76 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts +16 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js +92 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts +9 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js +3 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js.map +1 -0
- package/dist/modules/auth/services/oauth.service.d.ts +83 -0
- package/dist/modules/auth/services/oauth.service.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth.service.js +471 -0
- package/dist/modules/auth/services/oauth.service.js.map +1 -0
- package/dist/modules/auth/services/otp-auth.service.d.ts +13 -3
- package/dist/modules/auth/services/otp-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/otp-auth.service.js +41 -7
- package/dist/modules/auth/services/otp-auth.service.js.map +1 -1
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts +22 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts.map +1 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js +117 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js.map +1 -0
- package/dist/modules/auth/services/password.service.d.ts +25 -5
- package/dist/modules/auth/services/password.service.d.ts.map +1 -1
- package/dist/modules/auth/services/password.service.js +154 -20
- package/dist/modules/auth/services/password.service.js.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.d.ts +10 -3
- package/dist/modules/auth/services/pin-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.js +110 -13
- package/dist/modules/auth/services/pin-auth.service.js.map +1 -1
- package/dist/modules/auth/services/registration.service.d.ts +10 -2
- package/dist/modules/auth/services/registration.service.d.ts.map +1 -1
- package/dist/modules/auth/services/registration.service.js +113 -25
- package/dist/modules/auth/services/registration.service.js.map +1 -1
- package/dist/modules/auth/services/turnstile.service.d.ts +17 -0
- package/dist/modules/auth/services/turnstile.service.d.ts.map +1 -0
- package/dist/modules/auth/services/turnstile.service.js +94 -0
- package/dist/modules/auth/services/turnstile.service.js.map +1 -0
- package/dist/modules/auth/utils/auth-params.util.d.ts +13 -6
- package/dist/modules/auth/utils/auth-params.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-params.util.js +27 -4
- package/dist/modules/auth/utils/auth-params.util.js.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts +12 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.js +36 -4
- package/dist/modules/auth/utils/auth-supported.util.js.map +1 -1
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts +10 -0
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js +31 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts +5 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.js +22 -0
- package/dist/modules/auth/utils/backup-codes.util.js.map +1 -0
- package/dist/modules/auth/utils/dpop.util.d.ts +22 -0
- package/dist/modules/auth/utils/dpop.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/dpop.util.js +73 -0
- package/dist/modules/auth/utils/dpop.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts +22 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.js +59 -0
- package/dist/modules/auth/utils/mfa-secret.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts +26 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js +49 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts +5 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js +18 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js.map +1 -0
- package/dist/modules/auth/utils/totp.util.d.ts +16 -0
- package/dist/modules/auth/utils/totp.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/totp.util.js +88 -0
- package/dist/modules/auth/utils/totp.util.js.map +1 -0
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts +28 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts.map +1 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.js +48 -2
- package/dist/modules/delivery/composers/otp-delivery.composer.js.map +1 -1
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts +29 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts.map +1 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js +51 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js.map +1 -0
- package/dist/modules/delivery/delivery.module.d.ts.map +1 -1
- package/dist/modules/delivery/delivery.module.js +1 -15
- package/dist/modules/delivery/delivery.module.js.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.d.ts.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js +3 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts +12 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.js +121 -40
- package/dist/modules/delivery/notification-delivery.service.js.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts +22 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.js +144 -42
- package/dist/modules/delivery/processors/delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/delivery.processor.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts +11 -0
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js +90 -16
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts +7 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.js +11 -2
- package/dist/modules/delivery/queues/sync-jobs.queue.js.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts +7 -3
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.js +33 -10
- package/dist/modules/delivery/services/delivery-audit-retention.service.js.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.d.ts +7 -4
- package/dist/modules/delivery/services/notification-audit.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.js +83 -26
- package/dist/modules/delivery/services/notification-audit.service.js.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts +2 -0
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.js +22 -3
- package/dist/modules/delivery/utils/payload-snapshot.util.js.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts +7 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.js +5 -7
- package/dist/modules/file-upload/controllers/file-upload.controller.js.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts +2 -0
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.js +20 -0
- package/dist/modules/file-upload/dto/file-upload.dto.js.map +1 -1
- package/dist/modules/file-upload/file-upload.module.d.ts.map +1 -1
- package/dist/modules/file-upload/file-upload.module.js +12 -2
- package/dist/modules/file-upload/file-upload.module.js.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.d.ts +24 -6
- package/dist/modules/file-upload/services/file-upload.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.js +164 -36
- package/dist/modules/file-upload/services/file-upload.service.js.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts +4 -2
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js +30 -5
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.d.ts.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js +7 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js.map +1 -1
- package/dist/modules/health/health.controller.d.ts +5 -1
- package/dist/modules/health/health.controller.d.ts.map +1 -1
- package/dist/modules/health/health.controller.js +57 -3
- package/dist/modules/health/health.controller.js.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.d.ts +19 -4
- package/dist/modules/invitations/controllers/invitations.controller.d.ts.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.js +19 -10
- package/dist/modules/invitations/controllers/invitations.controller.js.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.d.ts +13 -0
- package/dist/modules/invitations/dto/invitation.dto.d.ts.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.js +69 -2
- package/dist/modules/invitations/dto/invitation.dto.js.map +1 -1
- package/dist/modules/invitations/services/invitations.service.d.ts +24 -6
- package/dist/modules/invitations/services/invitations.service.d.ts.map +1 -1
- package/dist/modules/invitations/services/invitations.service.js +96 -20
- package/dist/modules/invitations/services/invitations.service.js.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.d.ts +7 -2
- package/dist/modules/jobs/queues/jobs.queue.d.ts.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.js +25 -10
- package/dist/modules/jobs/queues/jobs.queue.js.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts +3 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.js +25 -2
- package/dist/modules/notifications/controllers/notifications.controller.js.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.d.ts.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.js +1 -0
- package/dist/modules/notifications/dto/notification-query.dto.js.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.d.ts.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.js +3 -1
- package/dist/modules/notifications/entities/device-token.entity.js.map +1 -1
- package/dist/modules/notifications/services/fcm.service.d.ts +2 -0
- package/dist/modules/notifications/services/fcm.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/fcm.service.js +28 -7
- package/dist/modules/notifications/services/fcm.service.js.map +1 -1
- package/dist/modules/notifications/services/notifications.service.d.ts +16 -3
- package/dist/modules/notifications/services/notifications.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/notifications.service.js +95 -24
- package/dist/modules/notifications/services/notifications.service.js.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.d.ts +2 -0
- package/dist/modules/observability/metrics/metrics.service.d.ts.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.js +11 -0
- package/dist/modules/observability/metrics/metrics.service.js.map +1 -1
- package/dist/modules/otp/constants/otp.constants.d.ts +7 -5
- package/dist/modules/otp/constants/otp.constants.d.ts.map +1 -1
- package/dist/modules/otp/constants/otp.constants.js +11 -8
- package/dist/modules/otp/constants/otp.constants.js.map +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.d.ts +10 -2
- package/dist/modules/otp/otp.service.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.js +48 -4
- package/dist/modules/otp/otp.service.js.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.d.ts +2 -0
- package/dist/modules/otp/services/otp.rate-limiter.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.js +19 -0
- package/dist/modules/otp/services/otp.rate-limiter.js.map +1 -1
- package/dist/modules/otp/services/otp.session.store.d.ts +9 -3
- package/dist/modules/otp/services/otp.session.store.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.session.store.js +34 -42
- package/dist/modules/otp/services/otp.session.store.js.map +1 -1
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts +11 -0
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts.map +1 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js +68 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js.map +1 -0
- package/dist/modules/profile/controllers/profile.controller.d.ts +9 -3
- package/dist/modules/profile/controllers/profile.controller.d.ts.map +1 -1
- package/dist/modules/profile/controllers/profile.controller.js +140 -8
- package/dist/modules/profile/controllers/profile.controller.js.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts +10 -0
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js +43 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js.map +1 -1
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts +24 -0
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js +115 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js.map +1 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/user-profile-response.dto.js +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.js.map +1 -1
- package/dist/modules/profile/dto/username-available.dto.d.ts +6 -0
- package/dist/modules/profile/dto/username-available.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/username-available.dto.js +31 -0
- package/dist/modules/profile/dto/username-available.dto.js.map +1 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts +10 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts.map +1 -1
- package/dist/modules/profile/entities/user-profiles.entity.js +29 -1
- package/dist/modules/profile/entities/user-profiles.entity.js.map +1 -1
- package/dist/modules/profile/index.d.ts +1 -0
- package/dist/modules/profile/index.d.ts.map +1 -1
- package/dist/modules/profile/index.js +1 -0
- package/dist/modules/profile/index.js.map +1 -1
- package/dist/modules/profile/profile.manifest.d.ts +2 -2
- package/dist/modules/profile/profile.manifest.js +2 -2
- package/dist/modules/profile/profile.manifest.js.map +1 -1
- package/dist/modules/profile/profile.module.d.ts.map +1 -1
- package/dist/modules/profile/profile.module.js +7 -2
- package/dist/modules/profile/profile.module.js.map +1 -1
- package/dist/modules/profile/services/profile.service.d.ts +56 -4
- package/dist/modules/profile/services/profile.service.d.ts.map +1 -1
- package/dist/modules/profile/services/profile.service.js +247 -20
- package/dist/modules/profile/services/profile.service.js.map +1 -1
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts +26 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts.map +1 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js +124 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts +36 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.js +42 -0
- package/dist/modules/realtime/constants/realtime.constants.js.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts +21 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.js +113 -0
- package/dist/modules/realtime/controllers/realtime.controller.js.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts +42 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js +289 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js.map +1 -0
- package/dist/modules/realtime/index.d.ts +12 -0
- package/dist/modules/realtime/index.d.ts.map +1 -0
- package/dist/modules/realtime/index.js +35 -0
- package/dist/modules/realtime/index.js.map +1 -0
- package/dist/modules/realtime/realtime.manifest.d.ts +8 -0
- package/dist/modules/realtime/realtime.manifest.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.manifest.js +31 -0
- package/dist/modules/realtime/realtime.manifest.js.map +1 -0
- package/dist/modules/realtime/realtime.module.d.ts +14 -0
- package/dist/modules/realtime/realtime.module.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.module.js +126 -0
- package/dist/modules/realtime/realtime.module.js.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts +16 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js +55 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts +15 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.js +86 -0
- package/dist/modules/realtime/services/realtime-presence.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts +12 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js +63 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime.service.d.ts +88 -0
- package/dist/modules/realtime/services/realtime.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime.service.js +343 -0
- package/dist/modules/realtime/services/realtime.service.js.map +1 -0
- package/dist/modules/realtime/types/realtime.types.d.ts +50 -0
- package/dist/modules/realtime/types/realtime.types.d.ts.map +1 -0
- package/dist/modules/realtime/types/realtime.types.js +14 -0
- package/dist/modules/realtime/types/realtime.types.js.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts +5 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.js +45 -0
- package/dist/modules/realtime/utils/handshake-error.util.js.map +1 -0
- package/dist/modules/roles/controllers/modules.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/modules.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/modules.controller.js +21 -10
- package/dist/modules/roles/controllers/modules.controller.js.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/permissions.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.js +21 -10
- package/dist/modules/roles/controllers/permissions.controller.js.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.d.ts +5 -4
- package/dist/modules/roles/controllers/roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.js +26 -13
- package/dist/modules/roles/controllers/roles.controller.js.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.d.ts +3 -2
- package/dist/modules/roles/controllers/user-roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.js +14 -6
- package/dist/modules/roles/controllers/user-roles.controller.js.map +1 -1
- package/dist/modules/roles/services/modules.service.d.ts +8 -5
- package/dist/modules/roles/services/modules.service.d.ts.map +1 -1
- package/dist/modules/roles/services/modules.service.js +58 -12
- package/dist/modules/roles/services/modules.service.js.map +1 -1
- package/dist/modules/roles/services/permissions.service.d.ts +8 -5
- package/dist/modules/roles/services/permissions.service.d.ts.map +1 -1
- package/dist/modules/roles/services/permissions.service.js +61 -12
- package/dist/modules/roles/services/permissions.service.js.map +1 -1
- package/dist/modules/roles/services/roles.service.d.ts +19 -9
- package/dist/modules/roles/services/roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/roles.service.js +137 -47
- package/dist/modules/roles/services/roles.service.js.map +1 -1
- package/dist/modules/roles/services/user-roles.service.d.ts +12 -4
- package/dist/modules/roles/services/user-roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/user-roles.service.js +58 -26
- package/dist/modules/roles/services/user-roles.service.js.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts +7 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.js +10 -0
- package/dist/modules/sessions/entities/refresh-token.entity.js.map +1 -1
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts +12 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts.map +1 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js +46 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts +20 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js +97 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js.map +1 -0
- package/dist/modules/sessions/services/token.service.d.ts +150 -16
- package/dist/modules/sessions/services/token.service.d.ts.map +1 -1
- package/dist/modules/sessions/services/token.service.js +505 -74
- package/dist/modules/sessions/services/token.service.js.map +1 -1
- package/dist/modules/sessions/sessions.module.d.ts.map +1 -1
- package/dist/modules/sessions/sessions.module.js +4 -2
- package/dist/modules/sessions/sessions.module.js.map +1 -1
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts +13 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts.map +1 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js +37 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js.map +1 -0
- package/dist/modules/settings/constants/settings.defaults.d.ts +57 -3
- package/dist/modules/settings/constants/settings.defaults.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.defaults.js +58 -3
- package/dist/modules/settings/constants/settings.defaults.js.map +1 -1
- package/dist/modules/settings/constants/settings.keys.d.ts +138 -2
- package/dist/modules/settings/constants/settings.keys.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.keys.js +140 -2
- package/dist/modules/settings/constants/settings.keys.js.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts +5 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.js +134 -5
- package/dist/modules/settings/controllers/settings.controller.js.map +1 -1
- package/dist/modules/settings/services/settings.service.d.ts +17 -7
- package/dist/modules/settings/services/settings.service.d.ts.map +1 -1
- package/dist/modules/settings/services/settings.service.js +80 -14
- package/dist/modules/settings/services/settings.service.js.map +1 -1
- package/dist/modules/settings/utils/settings-secret.util.d.ts +13 -0
- package/dist/modules/settings/utils/settings-secret.util.d.ts.map +1 -0
- package/dist/modules/settings/utils/settings-secret.util.js +80 -0
- package/dist/modules/settings/utils/settings-secret.util.js.map +1 -0
- package/dist/modules/users/controllers/users.controller.d.ts +4 -2
- package/dist/modules/users/controllers/users.controller.d.ts.map +1 -1
- package/dist/modules/users/controllers/users.controller.js +89 -10
- package/dist/modules/users/controllers/users.controller.js.map +1 -1
- package/dist/modules/users/dto/user.dto.d.ts +3 -0
- package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
- package/dist/modules/users/dto/user.dto.js +27 -4
- package/dist/modules/users/dto/user.dto.js.map +1 -1
- package/dist/modules/users/entities/user.entity.d.ts +7 -1
- package/dist/modules/users/entities/user.entity.d.ts.map +1 -1
- package/dist/modules/users/entities/user.entity.js +10 -0
- package/dist/modules/users/entities/user.entity.js.map +1 -1
- package/dist/modules/users/services/users.service.d.ts +15 -2
- package/dist/modules/users/services/users.service.d.ts.map +1 -1
- package/dist/modules/users/services/users.service.js +152 -37
- package/dist/modules/users/services/users.service.js.map +1 -1
- package/dist/modules/users/users.module.d.ts.map +1 -1
- package/dist/modules/users/users.module.js +1 -2
- package/dist/modules/users/users.module.js.map +1 -1
- package/package.json +19 -7
- package/dist/modules/admin/entities/admin-log.entity.d.ts +0 -20
- package/dist/modules/admin/entities/admin-log.entity.d.ts.map +0 -1
- package/dist/modules/admin/entities/admin-log.entity.js +0 -65
- package/dist/modules/admin/entities/admin-log.entity.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-reset-token.entity.js","sourceRoot":"","sources":["../../../../src/modules/auth/entities/password-reset-token.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AAEvE,kEAAmE;AACnE,kEAAwD;AAExD;;;;GAIG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,6BAAe;IAGtD,MAAM,CAAU;IAGhB,MAAM,CAAQ;
|
|
1
|
+
{"version":3,"file":"password-reset-token.entity.js","sourceRoot":"","sources":["../../../../src/modules/auth/entities/password-reset-token.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AAEvE,kEAAmE;AACnE,kEAAwD;AAExD;;;;GAIG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,6BAAe;IAGtD,MAAM,CAAU;IAGhB,MAAM,CAAQ;IAEd,uDAAuD;IAEvD,MAAM,CAA+B;IAGrC,SAAS,CAAU;IAInB,IAAI,CAAQ;CACZ,CAAA;AAlBY,gDAAkB;AAG9B;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;kDACZ;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BACxC,IAAI;kDAAC;AAId;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;;kDAC3C;AAGrC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDAC5B;AAInB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC9C,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8BACzB,kBAAI;gDAAC;6BAjBA,kBAAkB;IAD9B,IAAA,gBAAM,EAAC,uBAAuB,CAAC;GACnB,kBAAkB,CAkB9B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseEntity } from '../../../common/base/base.entity';
|
|
2
|
+
import { User } from '../../users/entities/user.entity';
|
|
3
|
+
/**
|
|
4
|
+
* Per-user MFA (TOTP + backup codes) state. One row per user.
|
|
5
|
+
* Secrets are excluded from default SELECT.
|
|
6
|
+
*/
|
|
7
|
+
export declare class UserMfa extends BaseEntity {
|
|
8
|
+
userId: string;
|
|
9
|
+
user: User;
|
|
10
|
+
mfaEnabled: boolean;
|
|
11
|
+
totpSecretEncrypted?: string;
|
|
12
|
+
totpConfirmedAt?: Date;
|
|
13
|
+
/** HMAC-SHA256 hashes of unused backup codes. */
|
|
14
|
+
backupCodesHash?: string[];
|
|
15
|
+
backupCodesGeneratedAt?: Date;
|
|
16
|
+
failedAttempts: number;
|
|
17
|
+
lockedUntil?: Date;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=user-mfa.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-mfa.entity.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/entities/user-mfa.entity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAExD;;;GAGG;AACH,qBACa,OAAQ,SAAQ,UAAU;IAEtC,MAAM,EAAG,MAAM,CAAC;IAIhB,IAAI,EAAG,IAAI,CAAC;IAGZ,UAAU,EAAG,OAAO,CAAC;IAGrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAG7B,eAAe,CAAC,EAAE,IAAI,CAAC;IAEvB,iDAAiD;IAEjD,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAG3B,sBAAsB,CAAC,EAAE,IAAI,CAAC;IAG9B,cAAc,EAAG,MAAM,CAAC;IAGxB,WAAW,CAAC,EAAE,IAAI,CAAC;CACnB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UserMfa = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_entity_1 = require("../../../common/base/base.entity");
|
|
15
|
+
const user_entity_1 = require("../../users/entities/user.entity");
|
|
16
|
+
/**
|
|
17
|
+
* Per-user MFA (TOTP + backup codes) state. One row per user.
|
|
18
|
+
* Secrets are excluded from default SELECT.
|
|
19
|
+
*/
|
|
20
|
+
let UserMfa = class UserMfa extends base_entity_1.BaseEntity {
|
|
21
|
+
userId;
|
|
22
|
+
user;
|
|
23
|
+
mfaEnabled;
|
|
24
|
+
totpSecretEncrypted;
|
|
25
|
+
totpConfirmedAt;
|
|
26
|
+
/** HMAC-SHA256 hashes of unused backup codes. */
|
|
27
|
+
backupCodesHash;
|
|
28
|
+
backupCodesGeneratedAt;
|
|
29
|
+
failedAttempts;
|
|
30
|
+
lockedUntil;
|
|
31
|
+
};
|
|
32
|
+
exports.UserMfa = UserMfa;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ name: 'user_id', type: 'uuid', unique: true }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], UserMfa.prototype, "userId", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.OneToOne)(() => user_entity_1.User, { onDelete: 'CASCADE' }),
|
|
39
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
40
|
+
__metadata("design:type", user_entity_1.User)
|
|
41
|
+
], UserMfa.prototype, "user", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ name: 'mfa_enabled', default: false }),
|
|
44
|
+
__metadata("design:type", Boolean)
|
|
45
|
+
], UserMfa.prototype, "mfaEnabled", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ name: 'totp_secret_encrypted', type: 'text', nullable: true, select: false }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], UserMfa.prototype, "totpSecretEncrypted", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ name: 'totp_confirmed_at', type: 'timestamptz', nullable: true }),
|
|
52
|
+
__metadata("design:type", Date)
|
|
53
|
+
], UserMfa.prototype, "totpConfirmedAt", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ name: 'backup_codes_hash', type: 'jsonb', nullable: true, select: false }),
|
|
56
|
+
__metadata("design:type", Array)
|
|
57
|
+
], UserMfa.prototype, "backupCodesHash", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ name: 'backup_codes_generated_at', type: 'timestamptz', nullable: true }),
|
|
60
|
+
__metadata("design:type", Date)
|
|
61
|
+
], UserMfa.prototype, "backupCodesGeneratedAt", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ name: 'failed_attempts', default: 0 }),
|
|
64
|
+
__metadata("design:type", Number)
|
|
65
|
+
], UserMfa.prototype, "failedAttempts", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({ name: 'locked_until', type: 'timestamptz', nullable: true }),
|
|
68
|
+
__metadata("design:type", Date)
|
|
69
|
+
], UserMfa.prototype, "lockedUntil", void 0);
|
|
70
|
+
exports.UserMfa = UserMfa = __decorate([
|
|
71
|
+
(0, typeorm_1.Entity)('user_mfa')
|
|
72
|
+
], UserMfa);
|
|
73
|
+
//# sourceMappingURL=user-mfa.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-mfa.entity.js","sourceRoot":"","sources":["../../../../src/modules/auth/entities/user-mfa.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAE/D,kEAA8D;AAC9D,kEAAwD;AAExD;;;GAGG;AAEI,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,wBAAU;IAEtC,MAAM,CAAU;IAIhB,IAAI,CAAQ;IAGZ,UAAU,CAAW;IAGrB,mBAAmB,CAAU;IAG7B,eAAe,CAAQ;IAEvB,iDAAiD;IAEjD,eAAe,CAAY;IAG3B,sBAAsB,CAAQ;IAG9B,cAAc,CAAU;IAGxB,WAAW,CAAQ;CACnB,CAAA;AA7BY,0BAAO;AAEnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;uCACxC;AAIhB;IAFC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC7C,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8BACzB,kBAAI;qCAAC;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;2CAC3B;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;oDAC1D;AAG7B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACzD,IAAI;gDAAC;AAIvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;gDACzD;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,2BAA2B,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC1D,IAAI;uDAAC;AAG9B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+CACxB;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACxD,IAAI;4CAAC;kBA5BP,OAAO;IADnB,IAAA,gBAAM,EAAC,UAAU,CAAC;GACN,OAAO,CA6BnB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseEntity } from '../../../common/base/base.entity';
|
|
2
|
+
import { User } from '../../users/entities/user.entity';
|
|
3
|
+
export declare enum OAuthProvider {
|
|
4
|
+
GOOGLE = "google",
|
|
5
|
+
APPLE = "apple",
|
|
6
|
+
MICROSOFT = "microsoft"
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Linked external identity (Google / Apple / Microsoft).
|
|
10
|
+
* A user may have at most one active row per provider.
|
|
11
|
+
* Uniqueness is enforced by partial indexes WHERE deleted_at IS NULL
|
|
12
|
+
* (see migration AuthSecurityHardening1785006199377).
|
|
13
|
+
*/
|
|
14
|
+
export declare class UserOAuthIdentity extends BaseEntity {
|
|
15
|
+
userId: string;
|
|
16
|
+
user: User;
|
|
17
|
+
provider: OAuthProvider;
|
|
18
|
+
providerSubject: string;
|
|
19
|
+
email?: string;
|
|
20
|
+
emailVerified: boolean;
|
|
21
|
+
linkedAt: Date;
|
|
22
|
+
lastUsedAt?: Date;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=user-oauth-identity.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-oauth-identity.entity.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/entities/user-oauth-identity.entity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAExD,oBAAY,aAAa;IACxB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,SAAS,cAAc;CACvB;AAED;;;;;GAKG;AACH,qBASa,iBAAkB,SAAQ,UAAU;IAGhD,MAAM,EAAG,MAAM,CAAC;IAIhB,IAAI,EAAG,IAAI,CAAC;IAGZ,QAAQ,EAAG,aAAa,CAAC;IAGzB,eAAe,EAAG,MAAM,CAAC;IAGzB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,aAAa,EAAG,OAAO,CAAC;IAGxB,QAAQ,EAAG,IAAI,CAAC;IAGhB,UAAU,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UserOAuthIdentity = exports.OAuthProvider = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_entity_1 = require("../../../common/base/base.entity");
|
|
15
|
+
const user_entity_1 = require("../../users/entities/user.entity");
|
|
16
|
+
var OAuthProvider;
|
|
17
|
+
(function (OAuthProvider) {
|
|
18
|
+
OAuthProvider["GOOGLE"] = "google";
|
|
19
|
+
OAuthProvider["APPLE"] = "apple";
|
|
20
|
+
OAuthProvider["MICROSOFT"] = "microsoft";
|
|
21
|
+
})(OAuthProvider || (exports.OAuthProvider = OAuthProvider = {}));
|
|
22
|
+
/**
|
|
23
|
+
* Linked external identity (Google / Apple / Microsoft).
|
|
24
|
+
* A user may have at most one active row per provider.
|
|
25
|
+
* Uniqueness is enforced by partial indexes WHERE deleted_at IS NULL
|
|
26
|
+
* (see migration AuthSecurityHardening1785006199377).
|
|
27
|
+
*/
|
|
28
|
+
let UserOAuthIdentity = class UserOAuthIdentity extends base_entity_1.BaseEntity {
|
|
29
|
+
userId;
|
|
30
|
+
user;
|
|
31
|
+
provider;
|
|
32
|
+
providerSubject;
|
|
33
|
+
email;
|
|
34
|
+
emailVerified;
|
|
35
|
+
linkedAt;
|
|
36
|
+
lastUsedAt;
|
|
37
|
+
};
|
|
38
|
+
exports.UserOAuthIdentity = UserOAuthIdentity;
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Index)(),
|
|
41
|
+
(0, typeorm_1.Column)({ name: 'user_id', type: 'uuid' }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], UserOAuthIdentity.prototype, "userId", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: 'CASCADE' }),
|
|
46
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
47
|
+
__metadata("design:type", user_entity_1.User)
|
|
48
|
+
], UserOAuthIdentity.prototype, "user", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ name: 'provider', type: 'varchar', length: 32 }),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], UserOAuthIdentity.prototype, "provider", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ name: 'provider_subject', type: 'varchar', length: 255 }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], UserOAuthIdentity.prototype, "providerSubject", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ name: 'email', type: 'varchar', nullable: true }),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], UserOAuthIdentity.prototype, "email", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({ name: 'email_verified', default: false }),
|
|
63
|
+
__metadata("design:type", Boolean)
|
|
64
|
+
], UserOAuthIdentity.prototype, "emailVerified", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({ name: 'linked_at', type: 'timestamptz' }),
|
|
67
|
+
__metadata("design:type", Date)
|
|
68
|
+
], UserOAuthIdentity.prototype, "linkedAt", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ name: 'last_used_at', type: 'timestamptz', nullable: true }),
|
|
71
|
+
__metadata("design:type", Date)
|
|
72
|
+
], UserOAuthIdentity.prototype, "lastUsedAt", void 0);
|
|
73
|
+
exports.UserOAuthIdentity = UserOAuthIdentity = __decorate([
|
|
74
|
+
(0, typeorm_1.Entity)('user_oauth_identities'),
|
|
75
|
+
(0, typeorm_1.Index)('UQ_oauth_provider_subject_active', ['provider', 'providerSubject'], {
|
|
76
|
+
unique: true,
|
|
77
|
+
where: '"deleted_at" IS NULL',
|
|
78
|
+
}),
|
|
79
|
+
(0, typeorm_1.Index)('UQ_oauth_user_provider_active', ['userId', 'provider'], {
|
|
80
|
+
unique: true,
|
|
81
|
+
where: '"deleted_at" IS NULL',
|
|
82
|
+
})
|
|
83
|
+
], UserOAuthIdentity);
|
|
84
|
+
//# sourceMappingURL=user-oauth-identity.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-oauth-identity.entity.js","sourceRoot":"","sources":["../../../../src/modules/auth/entities/user-oauth-identity.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AAEvE,kEAA8D;AAC9D,kEAAwD;AAExD,IAAY,aAIX;AAJD,WAAY,aAAa;IACxB,kCAAiB,CAAA;IACjB,gCAAe,CAAA;IACf,wCAAuB,CAAA;AACxB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAED;;;;;GAKG;AAUI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,wBAAU;IAGhD,MAAM,CAAU;IAIhB,IAAI,CAAQ;IAGZ,QAAQ,CAAiB;IAGzB,eAAe,CAAU;IAGzB,KAAK,CAAU;IAGf,aAAa,CAAW;IAGxB,QAAQ,CAAQ;IAGhB,UAAU,CAAQ;CAClB,CAAA;AA1BY,8CAAiB;AAG7B;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAC1B;AAIhB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC9C,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8BACzB,kBAAI;+CAAC;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;mDACjC;AAGzB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;0DAC1C;AAGzB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC5C;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;wDAC3B;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BACxC,IAAI;mDAAC;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACzD,IAAI;qDAAC;4BAzBN,iBAAiB;IAT7B,IAAA,gBAAM,EAAC,uBAAuB,CAAC;IAC/B,IAAA,eAAK,EAAC,kCAAkC,EAAE,CAAC,UAAU,EAAE,iBAAiB,CAAC,EAAE;QAC3E,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,sBAAsB;KAC7B,CAAC;IACD,IAAA,eAAK,EAAC,+BAA+B,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE;QAC/D,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,sBAAsB;KAC7B,CAAC;GACW,iBAAiB,CA0B7B"}
|
|
@@ -1,45 +1,110 @@
|
|
|
1
1
|
import { type UserResponseDto } from '../../users/dto/user.dto';
|
|
2
2
|
import { type UserAuthMethod } from '../../users/entities/user.entity';
|
|
3
|
+
import { type OAuthProvider } from '../entities/user-oauth-identity.entity';
|
|
3
4
|
/**
|
|
4
5
|
* Auth lifecycle event names emitted via `EventEmitter2` (`@nestjs/event-emitter`).
|
|
5
6
|
*
|
|
6
7
|
* Consuming apps subscribe with `@OnEvent(AUTH_EVENTS.LOGIN_COMPLETED)` to run
|
|
7
|
-
* custom side effects
|
|
8
|
-
* modifying the library. Listeners are discovered globally because
|
|
9
|
-
* `CoreModule.forRoot()` registers `EventEmitterModule.forRoot()`.
|
|
10
|
-
*
|
|
11
|
-
* Listeners run as fire-and-forget side effects: a throwing or slow listener
|
|
12
|
-
* never fails or blocks the login/registration response. Offload heavy work to
|
|
13
|
-
* a queue inside your listener.
|
|
8
|
+
* custom side effects without modifying the library.
|
|
14
9
|
*/
|
|
15
10
|
export declare const AUTH_EVENTS: {
|
|
16
|
-
/** Emitted after a successful login (phone or email), once tokens are issued. */
|
|
17
11
|
readonly LOGIN_COMPLETED: "auth.login.completed";
|
|
18
|
-
|
|
12
|
+
readonly LOGIN_FAILED: "auth.login.failed";
|
|
19
13
|
readonly REGISTRATION_COMPLETED: "auth.registration.completed";
|
|
14
|
+
readonly LOGOUT: "auth.logout";
|
|
15
|
+
readonly LOGOUT_ALL: "auth.logout.all";
|
|
16
|
+
readonly OAUTH_LINKED: "auth.oauth.linked";
|
|
17
|
+
readonly OAUTH_UNLINKED: "auth.oauth.unlinked";
|
|
18
|
+
readonly MFA_ENABLED: "auth.mfa.enabled";
|
|
19
|
+
readonly MFA_DISABLED: "auth.mfa.disabled";
|
|
20
|
+
readonly MFA_BACKUP_CODES_REGENERATED: "auth.mfa.backup_codes_regenerated";
|
|
21
|
+
readonly MFA_STEP_UP: "auth.mfa.step_up";
|
|
22
|
+
readonly EMAIL_CHANGED: "auth.email.changed";
|
|
23
|
+
readonly PHONE_CHANGED: "auth.phone.changed";
|
|
24
|
+
readonly PASSWORD_CHANGED: "auth.password.changed";
|
|
25
|
+
readonly PASSWORD_RESET: "auth.password.reset";
|
|
26
|
+
readonly PASSWORD_FORGOT_INITIATED: "auth.password.forgot_initiated";
|
|
27
|
+
readonly ACCOUNT_DELETE_REQUESTED: "auth.account.delete_requested";
|
|
28
|
+
readonly ACCOUNT_DELETED: "auth.account.deleted";
|
|
20
29
|
};
|
|
21
30
|
export type AuthEventName = (typeof AUTH_EVENTS)[keyof typeof AUTH_EVENTS];
|
|
22
31
|
/** The identity method used to authenticate/register. */
|
|
23
32
|
export type AuthMethod = UserAuthMethod;
|
|
24
|
-
/** Fields shared by
|
|
33
|
+
/** Fields shared by login/registration lifecycle events. */
|
|
25
34
|
export interface AuthEventBase {
|
|
26
|
-
/** ID of the authenticated/registered user. */
|
|
27
35
|
userId: string;
|
|
28
|
-
/** Public-safe user snapshot (no password/token material). */
|
|
29
36
|
user: UserResponseDto;
|
|
30
|
-
/** Role slugs assigned to the user at the time of the event. */
|
|
31
37
|
roles: string[];
|
|
32
|
-
/** Identity method used: `'phone'`
|
|
38
|
+
/** Identity method used: `'phone'`, `'email'`, or `'oauth'`. */
|
|
33
39
|
method: AuthMethod;
|
|
34
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Authentication method reference values (OIDC-style), e.g. `['email']` or `['oauth','mfa']`.
|
|
42
|
+
*/
|
|
43
|
+
amr?: string[];
|
|
44
|
+
/** True when MFA was completed as part of this login. */
|
|
45
|
+
mfaUsed?: boolean;
|
|
46
|
+
/** OAuth provider when first factor was OAuth. */
|
|
47
|
+
oauthProvider?: OAuthProvider | string;
|
|
35
48
|
ipAddress?: string;
|
|
36
|
-
/** Parsed device/user-agent info, when available. */
|
|
37
49
|
deviceInfo?: string;
|
|
38
|
-
/** When the event was emitted. */
|
|
39
50
|
at: Date;
|
|
40
51
|
}
|
|
41
|
-
/** Payload for {@link AUTH_EVENTS.LOGIN_COMPLETED}. */
|
|
42
52
|
export type AuthLoginCompletedEvent = AuthEventBase;
|
|
43
|
-
/** Payload for {@link AUTH_EVENTS.REGISTRATION_COMPLETED}. */
|
|
44
53
|
export type AuthRegistrationCompletedEvent = AuthEventBase;
|
|
54
|
+
/** Failed login — no actor user; identity is hashed for correlation only. */
|
|
55
|
+
export interface AuthLoginFailedEvent {
|
|
56
|
+
method: AuthMethod;
|
|
57
|
+
reason: string;
|
|
58
|
+
/** Truncated SHA-256 of normalized identity (never raw email/phone). */
|
|
59
|
+
identityHash?: string;
|
|
60
|
+
ipAddress?: string;
|
|
61
|
+
deviceInfo?: string;
|
|
62
|
+
at: Date;
|
|
63
|
+
}
|
|
64
|
+
export interface AuthOAuthLinkedEvent {
|
|
65
|
+
userId: string;
|
|
66
|
+
provider: OAuthProvider;
|
|
67
|
+
at: Date;
|
|
68
|
+
}
|
|
69
|
+
export interface AuthOAuthUnlinkedEvent {
|
|
70
|
+
userId: string;
|
|
71
|
+
provider: OAuthProvider;
|
|
72
|
+
at: Date;
|
|
73
|
+
}
|
|
74
|
+
export interface AuthMfaLifecycleEvent {
|
|
75
|
+
userId: string;
|
|
76
|
+
at: Date;
|
|
77
|
+
}
|
|
78
|
+
export interface AuthIdentityChangedEvent {
|
|
79
|
+
userId: string;
|
|
80
|
+
at: Date;
|
|
81
|
+
ipAddress?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface AuthPasswordLifecycleEvent {
|
|
84
|
+
userId: string;
|
|
85
|
+
at: Date;
|
|
86
|
+
/** How the password was set/changed. */
|
|
87
|
+
method: 'change' | 'set' | 'reset_email' | 'reset_phone';
|
|
88
|
+
ipAddress?: string;
|
|
89
|
+
}
|
|
90
|
+
/** Password-reset link request (known or unknown email — never raw identity). */
|
|
91
|
+
export interface AuthPasswordForgotEvent {
|
|
92
|
+
/** Present only when the email matched an account. */
|
|
93
|
+
userId?: string;
|
|
94
|
+
/** Truncated SHA-256 of normalized email for correlation. */
|
|
95
|
+
identityHash: string;
|
|
96
|
+
outcome: 'sent' | 'unknown_email';
|
|
97
|
+
ipAddress?: string;
|
|
98
|
+
at: Date;
|
|
99
|
+
}
|
|
100
|
+
export interface AuthAccountDeleteEvent {
|
|
101
|
+
userId: string;
|
|
102
|
+
at: Date;
|
|
103
|
+
}
|
|
104
|
+
export interface AuthLogoutEvent {
|
|
105
|
+
userId: string;
|
|
106
|
+
at: Date;
|
|
107
|
+
ipAddress?: string;
|
|
108
|
+
deviceInfo?: string;
|
|
109
|
+
}
|
|
45
110
|
//# sourceMappingURL=auth.events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.events.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/events/auth.events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.events.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/events/auth.events.ts"],"names":[],"mappings":"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"}
|
|
@@ -5,18 +5,26 @@ exports.AUTH_EVENTS = void 0;
|
|
|
5
5
|
* Auth lifecycle event names emitted via `EventEmitter2` (`@nestjs/event-emitter`).
|
|
6
6
|
*
|
|
7
7
|
* Consuming apps subscribe with `@OnEvent(AUTH_EVENTS.LOGIN_COMPLETED)` to run
|
|
8
|
-
* custom side effects
|
|
9
|
-
* modifying the library. Listeners are discovered globally because
|
|
10
|
-
* `CoreModule.forRoot()` registers `EventEmitterModule.forRoot()`.
|
|
11
|
-
*
|
|
12
|
-
* Listeners run as fire-and-forget side effects: a throwing or slow listener
|
|
13
|
-
* never fails or blocks the login/registration response. Offload heavy work to
|
|
14
|
-
* a queue inside your listener.
|
|
8
|
+
* custom side effects without modifying the library.
|
|
15
9
|
*/
|
|
16
10
|
exports.AUTH_EVENTS = {
|
|
17
|
-
/** Emitted after a successful login (phone or email), once tokens are issued. */
|
|
18
11
|
LOGIN_COMPLETED: 'auth.login.completed',
|
|
19
|
-
|
|
12
|
+
LOGIN_FAILED: 'auth.login.failed',
|
|
20
13
|
REGISTRATION_COMPLETED: 'auth.registration.completed',
|
|
14
|
+
LOGOUT: 'auth.logout',
|
|
15
|
+
LOGOUT_ALL: 'auth.logout.all',
|
|
16
|
+
OAUTH_LINKED: 'auth.oauth.linked',
|
|
17
|
+
OAUTH_UNLINKED: 'auth.oauth.unlinked',
|
|
18
|
+
MFA_ENABLED: 'auth.mfa.enabled',
|
|
19
|
+
MFA_DISABLED: 'auth.mfa.disabled',
|
|
20
|
+
MFA_BACKUP_CODES_REGENERATED: 'auth.mfa.backup_codes_regenerated',
|
|
21
|
+
MFA_STEP_UP: 'auth.mfa.step_up',
|
|
22
|
+
EMAIL_CHANGED: 'auth.email.changed',
|
|
23
|
+
PHONE_CHANGED: 'auth.phone.changed',
|
|
24
|
+
PASSWORD_CHANGED: 'auth.password.changed',
|
|
25
|
+
PASSWORD_RESET: 'auth.password.reset',
|
|
26
|
+
PASSWORD_FORGOT_INITIATED: 'auth.password.forgot_initiated',
|
|
27
|
+
ACCOUNT_DELETE_REQUESTED: 'auth.account.delete_requested',
|
|
28
|
+
ACCOUNT_DELETED: 'auth.account.deleted',
|
|
21
29
|
};
|
|
22
30
|
//# sourceMappingURL=auth.events.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.events.js","sourceRoot":"","sources":["../../../../src/modules/auth/events/auth.events.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"auth.events.js","sourceRoot":"","sources":["../../../../src/modules/auth/events/auth.events.ts"],"names":[],"mappings":";;;AAIA;;;;;GAKG;AACU,QAAA,WAAW,GAAG;IAC1B,eAAe,EAAE,sBAAsB;IACvC,YAAY,EAAE,mBAAmB;IACjC,sBAAsB,EAAE,6BAA6B;IACrD,MAAM,EAAE,aAAa;IACrB,UAAU,EAAE,iBAAiB;IAC7B,YAAY,EAAE,mBAAmB;IACjC,cAAc,EAAE,qBAAqB;IACrC,WAAW,EAAE,kBAAkB;IAC/B,YAAY,EAAE,mBAAmB;IACjC,4BAA4B,EAAE,mCAAmC;IACjE,WAAW,EAAE,kBAAkB;IAC/B,aAAa,EAAE,oBAAoB;IACnC,aAAa,EAAE,oBAAoB;IACnC,gBAAgB,EAAE,uBAAuB;IACzC,cAAc,EAAE,qBAAqB;IACrC,yBAAyB,EAAE,gCAAgC;IAC3D,wBAAwB,EAAE,+BAA+B;IACzD,eAAe,EAAE,sBAAsB;CAC9B,CAAC"}
|
|
@@ -1,15 +1,25 @@
|
|
|
1
|
+
import { EventEmitter2 } from '@nestjs/event-emitter';
|
|
2
|
+
import { DataSource } from 'typeorm';
|
|
3
|
+
import { AuditService } from '../../audit/services/audit.service';
|
|
1
4
|
import { StructuredLoggerService } from '../../observability/logging/structured-logger.service';
|
|
2
|
-
import { RefreshToken } from '../../sessions/entities/refresh-token.entity';
|
|
3
5
|
import { TokenService } from '../../sessions/services/token.service';
|
|
4
6
|
import { UsersService } from '../../users/services/users.service';
|
|
5
|
-
import { DeleteAccountConfirmDto } from '../dto/password.dto';
|
|
7
|
+
import { ChangeEmailDto, DeleteAccountConfirmDto } from '../dto/password.dto';
|
|
8
|
+
import { RevokeOthersResponse } from '../dto/token.dto';
|
|
9
|
+
import { MfaService } from './mfa.service';
|
|
10
|
+
import { OAuthService } from './oauth.service';
|
|
6
11
|
import { OtpAuthService } from './otp-auth.service';
|
|
7
12
|
export declare class AccountService {
|
|
8
13
|
private readonly tokenService;
|
|
9
14
|
private readonly usersService;
|
|
10
15
|
private readonly otpAuthService;
|
|
16
|
+
private readonly oauthService;
|
|
17
|
+
private readonly mfaService;
|
|
11
18
|
private readonly logger;
|
|
12
|
-
|
|
19
|
+
private readonly audit;
|
|
20
|
+
private readonly dataSource;
|
|
21
|
+
private readonly eventEmitter;
|
|
22
|
+
constructor(tokenService: TokenService, usersService: UsersService, otpAuthService: OtpAuthService, oauthService: OAuthService, mfaService: MfaService, logger: StructuredLoggerService, audit: AuditService, dataSource: DataSource, eventEmitter?: EventEmitter2 | null);
|
|
13
23
|
/**
|
|
14
24
|
* Marks the authenticated user's email as verified.
|
|
15
25
|
*
|
|
@@ -20,22 +30,72 @@ export declare class AccountService {
|
|
|
20
30
|
verifyEmail(userId: string, verificationToken: string): Promise<{
|
|
21
31
|
message: string;
|
|
22
32
|
}>;
|
|
23
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Change email via OTP on the **new** address (send-otp → verify challenge here).
|
|
35
|
+
*/
|
|
36
|
+
changeEmail(userId: string, dto: ChangeEmailDto): Promise<{
|
|
37
|
+
message: string;
|
|
38
|
+
}>;
|
|
39
|
+
/** Revoke every refresh token for the user (logout-all). */
|
|
40
|
+
logoutAll(userId: string, ctx?: {
|
|
41
|
+
ipAddress?: string;
|
|
42
|
+
deviceInfo?: string;
|
|
43
|
+
}): Promise<{
|
|
44
|
+
message: string;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Logout-all with refresh-token ownership proof (stolen access JWT alone cannot wipe devices).
|
|
48
|
+
*/
|
|
49
|
+
logoutAllWithRefresh(userId: string, refreshToken: string, ctx?: {
|
|
50
|
+
ipAddress?: string;
|
|
51
|
+
deviceInfo?: string;
|
|
52
|
+
}): Promise<{
|
|
53
|
+
message: string;
|
|
54
|
+
}>;
|
|
55
|
+
/** Revoke only the refresh-token family for the provided refresh token. */
|
|
56
|
+
logoutCurrent(userId: string, refreshToken: string, ctx?: {
|
|
57
|
+
ipAddress?: string;
|
|
58
|
+
deviceInfo?: string;
|
|
59
|
+
}): Promise<{
|
|
60
|
+
message: string;
|
|
61
|
+
}>;
|
|
62
|
+
/** Revoke the current session family from the access-token `fid` claim (no refresh required). */
|
|
63
|
+
logoutCurrentFamily(userId: string, familyId: string, ctx?: {
|
|
64
|
+
ipAddress?: string;
|
|
65
|
+
deviceInfo?: string;
|
|
66
|
+
}): Promise<{
|
|
24
67
|
message: string;
|
|
25
68
|
}>;
|
|
69
|
+
/**
|
|
70
|
+
* Keep the current refresh-token family; revoke every other session.
|
|
71
|
+
* Bumps session epoch (kills other access JWTs), then rotates the kept
|
|
72
|
+
* refresh token and returns a fresh token envelope for the current device.
|
|
73
|
+
*/
|
|
74
|
+
revokeOtherSessions(userId: string, refreshToken: string, deviceInfo?: string, ipAddress?: string, dpopJkt?: string): Promise<RevokeOthersResponse>;
|
|
26
75
|
revokeSession(sessionId: string, requestingUserId: string): Promise<{
|
|
27
76
|
message: string;
|
|
28
77
|
}>;
|
|
29
|
-
getActiveSessions(userId: string
|
|
78
|
+
getActiveSessions(userId: string, opts?: {
|
|
79
|
+
page?: number;
|
|
80
|
+
limit?: number;
|
|
81
|
+
}): Promise<import("../dto/session.dto").PaginatedSessionsResponseDto>;
|
|
30
82
|
/**
|
|
31
83
|
* Step 1 — Request account deletion.
|
|
32
84
|
*
|
|
33
85
|
* Phone users: sends an OTP challenge. Returns verificationId + expiresAt.
|
|
34
|
-
* Email
|
|
86
|
+
* Email users: confirm with password.
|
|
87
|
+
* OAuth users: confirm with a fresh ID token.
|
|
35
88
|
*/
|
|
36
89
|
requestDeletion(userId: string): Promise<{
|
|
37
90
|
message: string;
|
|
38
91
|
requiresPassword: boolean;
|
|
92
|
+
requiresOAuth?: undefined;
|
|
93
|
+
verificationId?: undefined;
|
|
94
|
+
expiresAt?: undefined;
|
|
95
|
+
} | {
|
|
96
|
+
message: string;
|
|
97
|
+
requiresOAuth: boolean;
|
|
98
|
+
requiresPassword?: undefined;
|
|
39
99
|
verificationId?: undefined;
|
|
40
100
|
expiresAt?: undefined;
|
|
41
101
|
} | {
|
|
@@ -43,22 +103,22 @@ export declare class AccountService {
|
|
|
43
103
|
verificationId: string;
|
|
44
104
|
expiresAt: number;
|
|
45
105
|
requiresPassword?: undefined;
|
|
106
|
+
requiresOAuth?: undefined;
|
|
46
107
|
}>;
|
|
47
108
|
/**
|
|
48
109
|
* Step 2 — Confirm account deletion.
|
|
49
110
|
*
|
|
50
|
-
* Phone path: { verificationId, otp }
|
|
51
|
-
* Email path: { password }
|
|
52
|
-
*
|
|
53
|
-
*
|
|
111
|
+
* Phone path: { verificationId, otp }
|
|
112
|
+
* Email path: { password }
|
|
113
|
+
* OAuth path: { provider, idToken }
|
|
114
|
+
* MFA enrolled: also requires step-up with purpose=`account_delete`.
|
|
54
115
|
*/
|
|
55
116
|
confirmDeletion(userId: string, dto: DeleteAccountConfirmDto): Promise<{
|
|
56
117
|
message: string;
|
|
57
118
|
}>;
|
|
58
|
-
/**
|
|
59
|
-
* Validates the confirmation challenge before deletion proceeds.
|
|
60
|
-
* Exactly one of phone OTP or email password must be provided.
|
|
61
|
-
*/
|
|
62
119
|
private verifyDeletionChallenge;
|
|
120
|
+
private emitIdentityEvent;
|
|
121
|
+
private emitAccountDeleteEvent;
|
|
122
|
+
private emitLogoutEvent;
|
|
63
123
|
}
|
|
64
124
|
//# sourceMappingURL=account.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/services/account.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"account.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/services/account.service.ts"],"names":[],"mappings":"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"}
|