@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
|
@@ -16,22 +16,39 @@ exports.PermissionsService = void 0;
|
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
18
|
const typeorm_2 = require("typeorm");
|
|
19
|
+
const audit_actions_1 = require("../../audit/constants/audit-actions");
|
|
20
|
+
const audit_service_1 = require("../../audit/services/audit.service");
|
|
19
21
|
const entities_1 = require("../entities");
|
|
20
22
|
const roles_service_1 = require("./roles.service");
|
|
21
23
|
let PermissionsService = class PermissionsService {
|
|
22
24
|
permissionRepository;
|
|
23
25
|
rolesService;
|
|
24
|
-
|
|
26
|
+
audit;
|
|
27
|
+
dataSource;
|
|
28
|
+
constructor(permissionRepository, rolesService, audit, dataSource) {
|
|
25
29
|
this.permissionRepository = permissionRepository;
|
|
26
30
|
this.rolesService = rolesService;
|
|
31
|
+
this.audit = audit;
|
|
32
|
+
this.dataSource = dataSource;
|
|
27
33
|
}
|
|
28
|
-
async create(dto) {
|
|
34
|
+
async create(dto, actorId) {
|
|
29
35
|
const existing = await this.permissionRepository.findOne({ where: { slug: dto.slug } });
|
|
30
36
|
if (existing) {
|
|
31
37
|
throw new common_1.ConflictException(`Permission with slug '${dto.slug}' already exists`);
|
|
32
38
|
}
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
return this.dataSource.transaction(async (manager) => {
|
|
40
|
+
const repo = manager.getRepository(entities_1.Permission);
|
|
41
|
+
const saved = await repo.save(repo.create(dto));
|
|
42
|
+
await this.audit.recordInTransaction(manager, {
|
|
43
|
+
action: audit_actions_1.AUDIT_ACTIONS.PERMISSION_CREATED,
|
|
44
|
+
actorType: 'ADMIN',
|
|
45
|
+
actorId,
|
|
46
|
+
resourceType: 'permission',
|
|
47
|
+
resourceId: saved.id,
|
|
48
|
+
metadata: { slug: saved.slug },
|
|
49
|
+
});
|
|
50
|
+
return saved;
|
|
51
|
+
});
|
|
35
52
|
}
|
|
36
53
|
async findAll(moduleId) {
|
|
37
54
|
const qb = this.permissionRepository
|
|
@@ -57,16 +74,46 @@ let PermissionsService = class PermissionsService {
|
|
|
57
74
|
relations: ['featureModule'],
|
|
58
75
|
});
|
|
59
76
|
}
|
|
60
|
-
async update(id, dto) {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
77
|
+
async update(id, dto, actorId) {
|
|
78
|
+
const result = await this.dataSource.transaction(async (manager) => {
|
|
79
|
+
const repo = manager.getRepository(entities_1.Permission);
|
|
80
|
+
const permission = await repo.findOne({
|
|
81
|
+
where: { id },
|
|
82
|
+
relations: ['featureModule'],
|
|
83
|
+
});
|
|
84
|
+
if (!permission)
|
|
85
|
+
throw new common_1.NotFoundException(`Permission ${id} not found`);
|
|
86
|
+
Object.assign(permission, dto);
|
|
87
|
+
const saved = await repo.save(permission);
|
|
88
|
+
await this.audit.recordInTransaction(manager, {
|
|
89
|
+
action: audit_actions_1.AUDIT_ACTIONS.PERMISSION_UPDATED,
|
|
90
|
+
actorType: 'ADMIN',
|
|
91
|
+
actorId,
|
|
92
|
+
resourceType: 'permission',
|
|
93
|
+
resourceId: saved.id,
|
|
94
|
+
metadata: { slug: saved.slug },
|
|
95
|
+
});
|
|
96
|
+
return saved;
|
|
97
|
+
});
|
|
64
98
|
await this.rolesService.reloadCache();
|
|
65
99
|
return result;
|
|
66
100
|
}
|
|
67
|
-
async delete(id) {
|
|
68
|
-
|
|
69
|
-
|
|
101
|
+
async delete(id, actorId) {
|
|
102
|
+
await this.dataSource.transaction(async (manager) => {
|
|
103
|
+
const repo = manager.getRepository(entities_1.Permission);
|
|
104
|
+
const permission = await repo.findOne({ where: { id } });
|
|
105
|
+
if (!permission)
|
|
106
|
+
throw new common_1.NotFoundException(`Permission ${id} not found`);
|
|
107
|
+
await repo.remove(permission);
|
|
108
|
+
await this.audit.recordInTransaction(manager, {
|
|
109
|
+
action: audit_actions_1.AUDIT_ACTIONS.PERMISSION_DELETED,
|
|
110
|
+
actorType: 'ADMIN',
|
|
111
|
+
actorId,
|
|
112
|
+
resourceType: 'permission',
|
|
113
|
+
resourceId: id,
|
|
114
|
+
metadata: { slug: permission.slug },
|
|
115
|
+
});
|
|
116
|
+
});
|
|
70
117
|
await this.rolesService.reloadCache();
|
|
71
118
|
}
|
|
72
119
|
};
|
|
@@ -75,6 +122,8 @@ exports.PermissionsService = PermissionsService = __decorate([
|
|
|
75
122
|
(0, common_1.Injectable)(),
|
|
76
123
|
__param(0, (0, typeorm_1.InjectRepository)(entities_1.Permission)),
|
|
77
124
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
78
|
-
roles_service_1.RolesService
|
|
125
|
+
roles_service_1.RolesService,
|
|
126
|
+
audit_service_1.AuditService,
|
|
127
|
+
typeorm_2.DataSource])
|
|
79
128
|
], PermissionsService);
|
|
80
129
|
//# sourceMappingURL=permissions.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.service.js","sourceRoot":"","sources":["../../../../src/modules/roles/services/permissions.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAkF;AAClF,6CAAmD;AACnD,
|
|
1
|
+
{"version":3,"file":"permissions.service.js","sourceRoot":"","sources":["../../../../src/modules/roles/services/permissions.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAkF;AAClF,6CAAmD;AACnD,qCAAiD;AAEjD,uEAAoE;AACpE,sEAAkE;AAElE,0CAAyC;AACzC,mDAA+C;AAGxC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGZ;IACA;IACA;IACA;IALlB,YAEkB,oBAA4C,EAC5C,YAA0B,EAC1B,KAAmB,EACnB,UAAsB;QAHtB,yBAAoB,GAApB,oBAAoB,CAAwB;QAC5C,iBAAY,GAAZ,YAAY,CAAc;QAC1B,UAAK,GAAL,KAAK,CAAc;QACnB,eAAU,GAAV,UAAU,CAAY;IACrC,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,GAAwB,EAAE,OAAgB;QACtD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACxF,IAAI,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,0BAAiB,CAAC,yBAAyB,GAAG,CAAC,IAAI,kBAAkB,CAAC,CAAC;QAClF,CAAC;QACD,OAAO,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redis';
|
|
3
|
+
import { DataSource, EntityManager, Repository } from 'typeorm';
|
|
4
|
+
import { AuditService } from '../../audit/services/audit.service';
|
|
3
5
|
import { StructuredLoggerService } from '../../observability/logging/structured-logger.service';
|
|
4
6
|
import { CreateRoleDto, UpdateRoleDto } from '../dto';
|
|
5
7
|
import { Permission, Role } from '../entities';
|
|
6
|
-
export declare class RolesService implements OnModuleInit {
|
|
8
|
+
export declare class RolesService implements OnModuleInit, OnModuleDestroy {
|
|
7
9
|
private readonly roleRepository;
|
|
8
10
|
private readonly permissionRepository;
|
|
9
11
|
private readonly logger;
|
|
12
|
+
private readonly audit;
|
|
13
|
+
private readonly dataSource;
|
|
14
|
+
private readonly redis;
|
|
10
15
|
/** Permission slugs keyed by role slug — populated at boot via reloadCache(). */
|
|
11
16
|
private readonly permissionCache;
|
|
12
|
-
|
|
17
|
+
private localCacheVersion;
|
|
18
|
+
private pollTimer;
|
|
19
|
+
constructor(roleRepository: Repository<Role>, permissionRepository: Repository<Permission>, logger: StructuredLoggerService, audit: AuditService, dataSource: DataSource, redis: IORedis);
|
|
13
20
|
onModuleInit(): void;
|
|
21
|
+
onModuleDestroy(): void;
|
|
14
22
|
/**
|
|
15
23
|
* Returns the permission slugs for a role by its slug.
|
|
16
24
|
*
|
|
@@ -32,14 +40,16 @@ export declare class RolesService implements OnModuleInit {
|
|
|
32
40
|
* can be called again after bulk out-of-band changes.
|
|
33
41
|
*/
|
|
34
42
|
reloadCache(): Promise<void>;
|
|
35
|
-
create(dto: CreateRoleDto): Promise<Role>;
|
|
43
|
+
create(dto: CreateRoleDto, actorId?: string): Promise<Role>;
|
|
36
44
|
findAll(): Promise<Role[]>;
|
|
37
|
-
findById(id: string): Promise<Role>;
|
|
45
|
+
findById(id: string, manager?: EntityManager): Promise<Role>;
|
|
38
46
|
findBySlug(slug: string, manager?: EntityManager): Promise<Role | null>;
|
|
39
|
-
update(id: string, dto: UpdateRoleDto): Promise<Role>;
|
|
40
|
-
delete(id: string): Promise<void>;
|
|
41
|
-
assignPermissions(roleId: string, permissionIds: string[]): Promise<Role>;
|
|
47
|
+
update(id: string, dto: UpdateRoleDto, actorId?: string): Promise<Role>;
|
|
48
|
+
delete(id: string, actorId?: string): Promise<void>;
|
|
49
|
+
assignPermissions(roleId: string, permissionIds: string[], actorId?: string, manager?: EntityManager): Promise<Role>;
|
|
42
50
|
getPermissionSlugs(roleId: string): Promise<string[]>;
|
|
43
51
|
private cacheRole;
|
|
52
|
+
private publishCacheBump;
|
|
53
|
+
private pollRemoteCacheVersion;
|
|
44
54
|
}
|
|
45
55
|
//# sourceMappingURL=roles.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/roles/services/roles.service.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"roles.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/roles/services/roles.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAKN,eAAe,EACf,YAAY,EACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAM,UAAU,EAAE,MAAM,SAAS,CAAC;AAKpE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAI/C,qBACa,YAAa,YAAW,YAAY,EAAE,eAAe;IAQhE,OAAO,CAAC,QAAQ,CAAC,cAAc;IAE/B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ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B,CACtB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,IAAI,CAAC;IA0BV,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAO3D,OAAO,CAAC,SAAS;YAUH,gBAAgB;YAKhB,sBAAsB;CAUpC"}
|
|
@@ -16,21 +16,45 @@ exports.RolesService = void 0;
|
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
18
|
const typeorm_2 = require("typeorm");
|
|
19
|
+
const cache_version_util_1 = require("../../../common/utils/cache-version.util");
|
|
20
|
+
const redis_module_1 = require("../../../config/redis.module");
|
|
21
|
+
const audit_actions_1 = require("../../audit/constants/audit-actions");
|
|
22
|
+
const audit_service_1 = require("../../audit/services/audit.service");
|
|
19
23
|
const structured_logger_service_1 = require("../../observability/logging/structured-logger.service");
|
|
20
24
|
const entities_1 = require("../entities");
|
|
25
|
+
const CACHE_POLL_MS = 2_000;
|
|
21
26
|
let RolesService = class RolesService {
|
|
22
27
|
roleRepository;
|
|
23
28
|
permissionRepository;
|
|
24
29
|
logger;
|
|
30
|
+
audit;
|
|
31
|
+
dataSource;
|
|
32
|
+
redis;
|
|
25
33
|
/** Permission slugs keyed by role slug — populated at boot via reloadCache(). */
|
|
26
34
|
permissionCache = new Map();
|
|
27
|
-
|
|
35
|
+
localCacheVersion = '0';
|
|
36
|
+
pollTimer = null;
|
|
37
|
+
constructor(roleRepository, permissionRepository, logger, audit, dataSource, redis) {
|
|
28
38
|
this.roleRepository = roleRepository;
|
|
29
39
|
this.permissionRepository = permissionRepository;
|
|
30
40
|
this.logger = logger;
|
|
41
|
+
this.audit = audit;
|
|
42
|
+
this.dataSource = dataSource;
|
|
43
|
+
this.redis = redis;
|
|
31
44
|
}
|
|
32
45
|
onModuleInit() {
|
|
33
|
-
void this.reloadCache()
|
|
46
|
+
void this.reloadCache().then(async () => {
|
|
47
|
+
this.localCacheVersion = await (0, cache_version_util_1.readCacheVersion)(this.redis, 'roles');
|
|
48
|
+
});
|
|
49
|
+
this.pollTimer = setInterval(() => {
|
|
50
|
+
void this.pollRemoteCacheVersion();
|
|
51
|
+
}, CACHE_POLL_MS);
|
|
52
|
+
}
|
|
53
|
+
onModuleDestroy() {
|
|
54
|
+
if (this.pollTimer) {
|
|
55
|
+
clearInterval(this.pollTimer);
|
|
56
|
+
this.pollTimer = null;
|
|
57
|
+
}
|
|
34
58
|
}
|
|
35
59
|
// ─── Cache ───────────────────────────────────────────────────────────────
|
|
36
60
|
/**
|
|
@@ -76,23 +100,33 @@ let RolesService = class RolesService {
|
|
|
76
100
|
});
|
|
77
101
|
}
|
|
78
102
|
// ─── CRUD ────────────────────────────────────────────────────────────────
|
|
79
|
-
async create(dto) {
|
|
103
|
+
async create(dto, actorId) {
|
|
80
104
|
const existing = await this.roleRepository.findOne({ where: { slug: dto.slug } });
|
|
81
105
|
if (existing) {
|
|
82
106
|
throw new common_1.ConflictException(`Role with slug '${dto.slug}' already exists`);
|
|
83
107
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
108
|
+
return this.dataSource.transaction(async (manager) => {
|
|
109
|
+
const roleRepo = manager.getRepository(entities_1.Role);
|
|
110
|
+
const saved = await roleRepo.save(roleRepo.create({
|
|
111
|
+
slug: dto.slug,
|
|
112
|
+
name: dto.name,
|
|
113
|
+
description: dto.description,
|
|
114
|
+
}));
|
|
115
|
+
if (dto.permissionIds?.length) {
|
|
116
|
+
await this.assignPermissions(saved.id, dto.permissionIds, actorId, manager);
|
|
117
|
+
}
|
|
118
|
+
const result = await this.findById(saved.id, manager);
|
|
119
|
+
this.cacheRole(result);
|
|
120
|
+
await this.audit.recordInTransaction(manager, {
|
|
121
|
+
action: audit_actions_1.AUDIT_ACTIONS.ROLE_CREATED,
|
|
122
|
+
actorType: 'ADMIN',
|
|
123
|
+
actorId,
|
|
124
|
+
resourceType: 'role',
|
|
125
|
+
resourceId: result.id,
|
|
126
|
+
metadata: { slug: result.slug },
|
|
127
|
+
});
|
|
128
|
+
return result;
|
|
88
129
|
});
|
|
89
|
-
const saved = await this.roleRepository.save(role);
|
|
90
|
-
if (dto.permissionIds?.length) {
|
|
91
|
-
await this.assignPermissions(saved.id, dto.permissionIds);
|
|
92
|
-
}
|
|
93
|
-
const result = await this.findById(saved.id);
|
|
94
|
-
this.cacheRole(result);
|
|
95
|
-
return result;
|
|
96
130
|
}
|
|
97
131
|
async findAll() {
|
|
98
132
|
return this.roleRepository.find({
|
|
@@ -100,8 +134,8 @@ let RolesService = class RolesService {
|
|
|
100
134
|
order: { slug: 'ASC' },
|
|
101
135
|
});
|
|
102
136
|
}
|
|
103
|
-
async findById(id) {
|
|
104
|
-
const role = await this.roleRepository.findOne({
|
|
137
|
+
async findById(id, manager) {
|
|
138
|
+
const role = await (manager?.getRepository(entities_1.Role) ?? this.roleRepository).findOne({
|
|
105
139
|
where: { id },
|
|
106
140
|
relations: ['permissions'],
|
|
107
141
|
});
|
|
@@ -115,39 +149,76 @@ let RolesService = class RolesService {
|
|
|
115
149
|
relations: ['permissions'],
|
|
116
150
|
});
|
|
117
151
|
}
|
|
118
|
-
async update(id, dto) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
role
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
await
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
152
|
+
async update(id, dto, actorId) {
|
|
153
|
+
return this.dataSource.transaction(async (manager) => {
|
|
154
|
+
const roleRepo = manager.getRepository(entities_1.Role);
|
|
155
|
+
const role = await this.findById(id, manager);
|
|
156
|
+
if (dto.name !== undefined)
|
|
157
|
+
role.name = dto.name;
|
|
158
|
+
if (dto.description !== undefined)
|
|
159
|
+
role.description = dto.description;
|
|
160
|
+
await roleRepo.save(role);
|
|
161
|
+
if (dto.permissionIds !== undefined) {
|
|
162
|
+
await this.assignPermissions(id, dto.permissionIds, actorId, manager);
|
|
163
|
+
}
|
|
164
|
+
const result = await this.findById(id, manager);
|
|
165
|
+
this.cacheRole(result);
|
|
166
|
+
await this.audit.recordInTransaction(manager, {
|
|
167
|
+
action: audit_actions_1.AUDIT_ACTIONS.ROLE_UPDATED,
|
|
168
|
+
actorType: 'ADMIN',
|
|
169
|
+
actorId,
|
|
170
|
+
resourceType: 'role',
|
|
171
|
+
resourceId: result.id,
|
|
172
|
+
metadata: { slug: result.slug },
|
|
173
|
+
});
|
|
174
|
+
return result;
|
|
139
175
|
});
|
|
140
176
|
}
|
|
141
|
-
async
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
177
|
+
async delete(id, actorId) {
|
|
178
|
+
await this.dataSource.transaction(async (manager) => {
|
|
179
|
+
const role = await this.findById(id, manager);
|
|
180
|
+
await manager.getRepository(entities_1.Role).remove(role);
|
|
181
|
+
this.permissionCache.delete(role.slug);
|
|
182
|
+
await this.publishCacheBump();
|
|
183
|
+
this.logger.info('Permission cache evicted for deleted role', {
|
|
184
|
+
event: 'roles.cache.evicted',
|
|
185
|
+
metadata: { roleSlug: role.slug },
|
|
186
|
+
});
|
|
187
|
+
await this.audit.recordInTransaction(manager, {
|
|
188
|
+
action: audit_actions_1.AUDIT_ACTIONS.ROLE_DELETED,
|
|
189
|
+
actorType: 'ADMIN',
|
|
190
|
+
actorId,
|
|
191
|
+
resourceType: 'role',
|
|
192
|
+
resourceId: id,
|
|
193
|
+
metadata: { slug: role.slug },
|
|
194
|
+
});
|
|
145
195
|
});
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
196
|
+
}
|
|
197
|
+
async assignPermissions(roleId, permissionIds, actorId, manager) {
|
|
198
|
+
const run = async (em) => {
|
|
199
|
+
const roleRepo = em.getRepository(entities_1.Role);
|
|
200
|
+
const permissionRepo = em.getRepository(entities_1.Permission);
|
|
201
|
+
const role = await this.findById(roleId, em);
|
|
202
|
+
const permissions = await permissionRepo.find({
|
|
203
|
+
where: { id: (0, typeorm_2.In)(permissionIds) },
|
|
204
|
+
});
|
|
205
|
+
role.permissions = permissions;
|
|
206
|
+
await roleRepo.save(role);
|
|
207
|
+
const result = await this.findById(roleId, em);
|
|
208
|
+
this.cacheRole(result);
|
|
209
|
+
await this.audit.recordInTransaction(em, {
|
|
210
|
+
action: audit_actions_1.AUDIT_ACTIONS.ROLE_PERMISSIONS_ASSIGNED,
|
|
211
|
+
actorType: 'ADMIN',
|
|
212
|
+
actorId,
|
|
213
|
+
resourceType: 'role',
|
|
214
|
+
resourceId: roleId,
|
|
215
|
+
metadata: { permissionCount: permissions.length },
|
|
216
|
+
});
|
|
217
|
+
return result;
|
|
218
|
+
};
|
|
219
|
+
if (manager)
|
|
220
|
+
return run(manager);
|
|
221
|
+
return this.dataSource.transaction(run);
|
|
151
222
|
}
|
|
152
223
|
async getPermissionSlugs(roleId) {
|
|
153
224
|
const role = await this.findById(roleId);
|
|
@@ -157,19 +228,38 @@ let RolesService = class RolesService {
|
|
|
157
228
|
cacheRole(role) {
|
|
158
229
|
const slugs = role.permissions.map((p) => p.slug);
|
|
159
230
|
this.permissionCache.set(role.slug, slugs);
|
|
231
|
+
void this.publishCacheBump();
|
|
160
232
|
this.logger.info('Permission cache updated', {
|
|
161
233
|
event: 'roles.cache.updated',
|
|
162
234
|
metadata: { roleSlug: role.slug, permissionCount: slugs.length },
|
|
163
235
|
});
|
|
164
236
|
}
|
|
237
|
+
async publishCacheBump() {
|
|
238
|
+
await (0, cache_version_util_1.bumpCacheVersion)(this.redis, 'roles');
|
|
239
|
+
this.localCacheVersion = await (0, cache_version_util_1.readCacheVersion)(this.redis, 'roles');
|
|
240
|
+
}
|
|
241
|
+
async pollRemoteCacheVersion() {
|
|
242
|
+
const remote = await (0, cache_version_util_1.readCacheVersion)(this.redis, 'roles');
|
|
243
|
+
if (remote === this.localCacheVersion)
|
|
244
|
+
return;
|
|
245
|
+
await this.reloadCache();
|
|
246
|
+
this.localCacheVersion = remote;
|
|
247
|
+
this.logger.info('Permission cache reloaded from remote version bump', {
|
|
248
|
+
event: 'roles.cache.remote_reload',
|
|
249
|
+
metadata: { version: remote },
|
|
250
|
+
});
|
|
251
|
+
}
|
|
165
252
|
};
|
|
166
253
|
exports.RolesService = RolesService;
|
|
167
254
|
exports.RolesService = RolesService = __decorate([
|
|
168
255
|
(0, common_1.Injectable)(),
|
|
169
256
|
__param(0, (0, typeorm_1.InjectRepository)(entities_1.Role)),
|
|
170
257
|
__param(1, (0, typeorm_1.InjectRepository)(entities_1.Permission)),
|
|
258
|
+
__param(5, (0, common_1.Inject)(redis_module_1.REDIS_CLIENT)),
|
|
171
259
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
172
260
|
typeorm_2.Repository,
|
|
173
|
-
structured_logger_service_1.StructuredLoggerService
|
|
261
|
+
structured_logger_service_1.StructuredLoggerService,
|
|
262
|
+
audit_service_1.AuditService,
|
|
263
|
+
typeorm_2.DataSource, Function])
|
|
174
264
|
], RolesService);
|
|
175
265
|
//# sourceMappingURL=roles.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.service.js","sourceRoot":"","sources":["../../../../src/modules/roles/services/roles.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"roles.service.js","sourceRoot":"","sources":["../../../../src/modules/roles/services/roles.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,6CAAmD;AAEnD,qCAAoE;AAEpE,iFAA8F;AAC9F,+DAA4D;AAC5D,uEAAoE;AACpE,sEAAkE;AAClE,qGAAgG;AAEhG,0CAA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,CAAC;IACtE,CAAC;IAEO,KAAK,CAAC,sBAAsB;QACnC,MAAM,MAAM,GAAG,MAAM,IAAA,qCAAgB,EAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC3D,IAAI,MAAM,KAAK,IAAI,CAAC,iBAAiB;YAAE,OAAO;QAC9C,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QACzB,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC;QAChC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oDAAoD,EAAE;YACtE,KAAK,EAAE,2BAA2B;YAClC,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;SAC7B,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;AAxPY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAQV,WAAA,IAAA,0BAAgB,EAAC,eAAI,CAAC,CAAA;IAEtB,WAAA,IAAA,0BAAgB,EAAC,qBAAU,CAAC,CAAA;IAK5B,WAAA,IAAA,eAAM,EAAC,2BAAY,CAAC,CAAA;qCANY,oBAAU;QAEJ,oBAAU;QACxB,mDAAuB;QACxB,4BAAY;QACP,oBAAU;GAb5B,YAAY,CAwPxB"}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import { EntityManager, Repository } from 'typeorm';
|
|
1
|
+
import { DataSource, EntityManager, Repository } from 'typeorm';
|
|
2
|
+
import type { AuditActorType } from '../../audit/entities/audit-event.entity';
|
|
3
|
+
import { AuditService } from '../../audit/services/audit.service';
|
|
2
4
|
import { User } from '../../users/entities/user.entity';
|
|
3
5
|
import { AssignRolesDto } from '../dto';
|
|
4
6
|
import { Role } from '../entities';
|
|
7
|
+
export type RoleAuditActor = {
|
|
8
|
+
actorType?: AuditActorType;
|
|
9
|
+
actorId?: string;
|
|
10
|
+
};
|
|
5
11
|
export declare class UserRolesService {
|
|
6
12
|
private readonly userRepository;
|
|
7
13
|
private readonly roleRepository;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
private readonly audit;
|
|
15
|
+
private readonly dataSource;
|
|
16
|
+
constructor(userRepository: Repository<User>, roleRepository: Repository<Role>, audit: AuditService, dataSource: DataSource);
|
|
17
|
+
assignRoles(userId: string, dto: AssignRolesDto, manager?: EntityManager, auditActor?: RoleAuditActor): Promise<User>;
|
|
18
|
+
removeRoles(userId: string, auditActor?: RoleAuditActor): Promise<User>;
|
|
11
19
|
getUserRoles(userId: string): Promise<Role[]>;
|
|
12
20
|
getUserPermissionSlugs(userId: string): Promise<string[]>;
|
|
13
21
|
getUserRoleAndPermissionSlugs(userId: string): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-roles.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/roles/services/user-roles.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAM,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"user-roles.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/roles/services/user-roles.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAM,UAAU,EAAE,MAAM,SAAS,CAAC;AAGpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,MAAM,MAAM,cAAc,GAAG;IAC5B,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBACa,gBAAgB;IAG3B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAE/B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAJV,cAAc,EAAE,UAAU,CAAC,IAAI,CAAC,EAEhC,cAAc,EAAE,UAAU,CAAC,IAAI,CAAC,EAChC,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,UAAU;IAGlC,WAAW,CAChB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,cAAc,EACnB,OAAO,CAAC,EAAE,aAAa,EACvB,UAAU,GAAE,cAAuC,GACjD,OAAO,CAAC,IAAI,CAAC;IA6BV,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB3E,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAS7C,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAKzD,6BAA6B,CAClC,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAK1D,2FAA2F;IACrF,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QACjD,IAAI,EAAE,IAAI,CAAC;QACX,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,SAAS,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IAWF,OAAO,CAAC,6BAA6B;YAevB,gBAAgB;CAS9B"}
|
|
@@ -16,41 +16,71 @@ exports.UserRolesService = void 0;
|
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
18
|
const typeorm_2 = require("typeorm");
|
|
19
|
+
const audit_actions_1 = require("../../audit/constants/audit-actions");
|
|
20
|
+
const audit_service_1 = require("../../audit/services/audit.service");
|
|
19
21
|
const user_entity_1 = require("../../users/entities/user.entity");
|
|
20
22
|
const entities_1 = require("../entities");
|
|
21
23
|
let UserRolesService = class UserRolesService {
|
|
22
24
|
userRepository;
|
|
23
25
|
roleRepository;
|
|
24
|
-
|
|
26
|
+
audit;
|
|
27
|
+
dataSource;
|
|
28
|
+
constructor(userRepository, roleRepository, audit, dataSource) {
|
|
25
29
|
this.userRepository = userRepository;
|
|
26
30
|
this.roleRepository = roleRepository;
|
|
31
|
+
this.audit = audit;
|
|
32
|
+
this.dataSource = dataSource;
|
|
27
33
|
}
|
|
28
|
-
async assignRoles(userId, dto, manager) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
async assignRoles(userId, dto, manager, auditActor = { actorType: 'ADMIN' }) {
|
|
35
|
+
const run = async (em) => {
|
|
36
|
+
const userRepository = em.getRepository(user_entity_1.User);
|
|
37
|
+
const roleRepository = em.getRepository(entities_1.Role);
|
|
38
|
+
const user = await userRepository.findOne({
|
|
39
|
+
where: { id: userId },
|
|
40
|
+
relations: ['roles'],
|
|
41
|
+
});
|
|
42
|
+
if (!user)
|
|
43
|
+
throw new common_1.NotFoundException(`User ${userId} not found`);
|
|
44
|
+
const roles = await roleRepository.find({
|
|
45
|
+
where: { id: (0, typeorm_2.In)(dto.roleIds) },
|
|
46
|
+
});
|
|
47
|
+
user.roles = roles;
|
|
48
|
+
await userRepository.save(user);
|
|
49
|
+
await this.audit.recordInTransaction(em, {
|
|
50
|
+
action: audit_actions_1.AUDIT_ACTIONS.USER_ROLES_ASSIGNED,
|
|
51
|
+
actorType: auditActor.actorType ?? 'ADMIN',
|
|
52
|
+
actorId: auditActor.actorId,
|
|
53
|
+
resourceType: 'user',
|
|
54
|
+
resourceId: userId,
|
|
55
|
+
metadata: { roleIds: dto.roleIds, roleSlugs: roles.map((r) => r.slug) },
|
|
56
|
+
});
|
|
57
|
+
return this.getUserWithRoles(userId, em);
|
|
58
|
+
};
|
|
59
|
+
if (manager)
|
|
60
|
+
return run(manager);
|
|
61
|
+
return this.dataSource.transaction(run);
|
|
43
62
|
}
|
|
44
|
-
async removeRoles(userId) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
63
|
+
async removeRoles(userId, auditActor = {}) {
|
|
64
|
+
return this.dataSource.transaction(async (em) => {
|
|
65
|
+
const user = await em.getRepository(user_entity_1.User).findOne({
|
|
66
|
+
where: { id: userId },
|
|
67
|
+
relations: ['roles'],
|
|
68
|
+
});
|
|
69
|
+
if (!user)
|
|
70
|
+
throw new common_1.NotFoundException(`User ${userId} not found`);
|
|
71
|
+
const previousSlugs = (user.roles ?? []).map((r) => r.slug);
|
|
72
|
+
user.roles = [];
|
|
73
|
+
await em.getRepository(user_entity_1.User).save(user);
|
|
74
|
+
await this.audit.recordInTransaction(em, {
|
|
75
|
+
action: audit_actions_1.AUDIT_ACTIONS.USER_ROLES_REMOVED,
|
|
76
|
+
actorType: auditActor.actorType ?? 'ADMIN',
|
|
77
|
+
actorId: auditActor.actorId,
|
|
78
|
+
resourceType: 'user',
|
|
79
|
+
resourceId: userId,
|
|
80
|
+
metadata: { previousRoleSlugs: previousSlugs },
|
|
81
|
+
});
|
|
82
|
+
return this.getUserWithRoles(userId, em);
|
|
48
83
|
});
|
|
49
|
-
if (!user)
|
|
50
|
-
throw new common_1.NotFoundException(`User ${userId} not found`);
|
|
51
|
-
user.roles = [];
|
|
52
|
-
await this.userRepository.save(user);
|
|
53
|
-
return this.getUserWithRoles(userId);
|
|
54
84
|
}
|
|
55
85
|
async getUserRoles(userId) {
|
|
56
86
|
const user = await this.userRepository.findOne({
|
|
@@ -108,6 +138,8 @@ exports.UserRolesService = UserRolesService = __decorate([
|
|
|
108
138
|
__param(0, (0, typeorm_1.InjectRepository)(user_entity_1.User)),
|
|
109
139
|
__param(1, (0, typeorm_1.InjectRepository)(entities_1.Role)),
|
|
110
140
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
111
|
-
typeorm_2.Repository
|
|
141
|
+
typeorm_2.Repository,
|
|
142
|
+
audit_service_1.AuditService,
|
|
143
|
+
typeorm_2.DataSource])
|
|
112
144
|
], UserRolesService);
|
|
113
145
|
//# sourceMappingURL=user-roles.service.js.map
|