@colveor/core 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +6 -0
- package/dist/bootstrap/bootstrap-colveor-app.d.ts.map +1 -1
- package/dist/bootstrap/bootstrap-colveor-app.js +22 -3
- package/dist/bootstrap/bootstrap-colveor-app.js.map +1 -1
- package/dist/common/decorators/index.d.ts +6 -0
- package/dist/common/decorators/index.d.ts.map +1 -1
- package/dist/common/decorators/index.js +8 -1
- package/dist/common/decorators/index.js.map +1 -1
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts +9 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts.map +1 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.js +12 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.js.map +1 -0
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts +12 -6
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts.map +1 -1
- package/dist/common/guards/login-ip-rate-limit.guard.js +65 -21
- package/dist/common/guards/login-ip-rate-limit.guard.js.map +1 -1
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts +3 -2
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts.map +1 -1
- package/dist/common/guards/otp-ip-rate-limit.guard.js +17 -15
- package/dist/common/guards/otp-ip-rate-limit.guard.js.map +1 -1
- package/dist/common/guards/permissions.guard.d.ts.map +1 -1
- package/dist/common/guards/permissions.guard.js +12 -2
- package/dist/common/guards/permissions.guard.js.map +1 -1
- package/dist/common/interceptors/timeout.interceptor.d.ts +1 -1
- package/dist/common/interceptors/timeout.interceptor.d.ts.map +1 -1
- package/dist/common/interceptors/timeout.interceptor.js +5 -1
- package/dist/common/interceptors/timeout.interceptor.js.map +1 -1
- package/dist/common/interfaces/request-user.d.ts +4 -3
- package/dist/common/interfaces/request-user.d.ts.map +1 -1
- package/dist/common/utils/cache-version.util.d.ts +12 -0
- package/dist/common/utils/cache-version.util.d.ts.map +1 -0
- package/dist/common/utils/cache-version.util.js +34 -0
- package/dist/common/utils/cache-version.util.js.map +1 -0
- package/dist/common/utils/postgres-error.util.d.ts +5 -0
- package/dist/common/utils/postgres-error.util.d.ts.map +1 -0
- package/dist/common/utils/postgres-error.util.js +13 -0
- package/dist/common/utils/postgres-error.util.js.map +1 -0
- package/dist/common/utils/singleflight.util.d.ts +6 -0
- package/dist/common/utils/singleflight.util.d.ts.map +1 -0
- package/dist/common/utils/singleflight.util.js +21 -0
- package/dist/common/utils/singleflight.util.js.map +1 -0
- package/dist/common/validators/is-exclusive-auth-params.validator.js +1 -1
- package/dist/common/validators/is-exclusive-auth-params.validator.js.map +1 -1
- package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js +1 -1
- package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js.map +1 -1
- package/dist/config/app.config.d.ts +38 -0
- package/dist/config/app.config.d.ts.map +1 -1
- package/dist/config/app.config.js +24 -0
- package/dist/config/app.config.js.map +1 -1
- package/dist/config/database.config.d.ts +6 -0
- package/dist/config/database.config.d.ts.map +1 -1
- package/dist/config/database.config.js +3 -0
- package/dist/config/database.config.js.map +1 -1
- package/dist/config/env-flags.util.d.ts +4 -0
- package/dist/config/env-flags.util.d.ts.map +1 -1
- package/dist/config/env-flags.util.js +7 -0
- package/dist/config/env-flags.util.js.map +1 -1
- package/dist/config/env.validation.d.ts +24 -1
- package/dist/config/env.validation.d.ts.map +1 -1
- package/dist/config/env.validation.js +92 -2
- package/dist/config/env.validation.js.map +1 -1
- package/dist/config/in-memory-redis.client.d.ts +23 -4
- package/dist/config/in-memory-redis.client.d.ts.map +1 -1
- package/dist/config/in-memory-redis.client.js +148 -4
- package/dist/config/in-memory-redis.client.js.map +1 -1
- package/dist/config/redis.module.d.ts.map +1 -1
- package/dist/config/redis.module.js +5 -0
- package/dist/config/redis.module.js.map +1 -1
- package/dist/core.module.d.ts +5 -0
- package/dist/core.module.d.ts.map +1 -1
- package/dist/core.module.js +5 -0
- package/dist/core.module.js.map +1 -1
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts +7 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts.map +1 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.js +24 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.js.map +1 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts +7 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js +16 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js.map +1 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts +7 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.js +14 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.js.map +1 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts +13 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.js +35 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.js.map +1 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts +11 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts.map +1 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.js +60 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.js.map +1 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts +14 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts.map +1 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js +39 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js.map +1 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts +13 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.js +69 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts +11 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js +51 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts +12 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js +37 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts +12 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts.map +1 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.js +74 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.js.map +1 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts +12 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts.map +1 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.js +52 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.js.map +1 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts +11 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js +36 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js.map +1 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts +12 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js +39 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js.map +1 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts +12 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js +39 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js.map +1 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts +13 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js +72 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js.map +1 -0
- package/dist/database/migrations/1785006199386-audit-events.d.ts +10 -0
- package/dist/database/migrations/1785006199386-audit-events.d.ts.map +1 -0
- package/dist/database/migrations/1785006199386-audit-events.js +60 -0
- package/dist/database/migrations/1785006199386-audit-events.js.map +1 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts +10 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts.map +1 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js +25 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js.map +1 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.d.ts +11 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.d.ts.map +1 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.js +157 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.js.map +1 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts +10 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts.map +1 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.js +38 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.js.map +1 -0
- package/dist/database/migrations/1785006199390-audit-hardening.d.ts +14 -0
- package/dist/database/migrations/1785006199390-audit-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199390-audit-hardening.js +345 -0
- package/dist/database/migrations/1785006199390-audit-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts +10 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts.map +1 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.js +39 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.js.map +1 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.d.ts +11 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.d.ts.map +1 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.js +33 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.js.map +1 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.d.ts +11 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.d.ts.map +1 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.js +33 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.js.map +1 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts +11 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts.map +1 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.js +24 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.js.map +1 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts +10 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.js +35 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.js.map +1 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts +11 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts.map +1 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.js +23 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.js.map +1 -0
- package/dist/database/seeds/roles.seed.d.ts +6 -0
- package/dist/database/seeds/roles.seed.d.ts.map +1 -1
- package/dist/database/seeds/roles.seed.js +22 -5
- package/dist/database/seeds/roles.seed.js.map +1 -1
- package/dist/database/seeds/settings.seed.d.ts +5 -0
- package/dist/database/seeds/settings.seed.d.ts.map +1 -1
- package/dist/database/seeds/settings.seed.js +500 -25
- package/dist/database/seeds/settings.seed.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.d.ts +1 -0
- package/dist/database/seeds/templates/html-template.reader.d.ts.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.js +3 -1
- package/dist/database/seeds/templates/html-template.reader.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.ts +5 -1
- package/dist/database/typeorm.util.d.ts.map +1 -1
- package/dist/database/typeorm.util.js +6 -0
- package/dist/database/typeorm.util.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -4
- package/dist/index.js.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.d.ts +15 -7
- package/dist/modules/admin/controllers/admin.controller.d.ts.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.js +74 -17
- package/dist/modules/admin/controllers/admin.controller.js.map +1 -1
- package/dist/modules/admin/services/admin-log.service.d.ts +14 -7
- package/dist/modules/admin/services/admin-log.service.d.ts.map +1 -1
- package/dist/modules/admin/services/admin-log.service.js +41 -38
- package/dist/modules/admin/services/admin-log.service.js.map +1 -1
- package/dist/modules/audit/audit.manifest.d.ts +8 -0
- package/dist/modules/audit/audit.manifest.d.ts.map +1 -0
- package/dist/modules/audit/audit.manifest.js +31 -0
- package/dist/modules/audit/audit.manifest.js.map +1 -0
- package/dist/modules/audit/audit.module.d.ts +8 -0
- package/dist/modules/audit/audit.module.d.ts.map +1 -0
- package/dist/modules/audit/audit.module.js +57 -0
- package/dist/modules/audit/audit.module.js.map +1 -0
- package/dist/modules/audit/constants/audit-actions.d.ts +79 -0
- package/dist/modules/audit/constants/audit-actions.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-actions.js +89 -0
- package/dist/modules/audit/constants/audit-actions.js.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts +10 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.js +13 -0
- package/dist/modules/audit/constants/audit-mutation.js.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts +13 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.js +149 -0
- package/dist/modules/audit/controllers/audit.controller.js.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts +27 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.js +18 -0
- package/dist/modules/audit/decorators/audit.decorator.js.map +1 -0
- package/dist/modules/audit/dto/audit.dto.d.ts +54 -0
- package/dist/modules/audit/dto/audit.dto.d.ts.map +1 -0
- package/dist/modules/audit/dto/audit.dto.js +129 -0
- package/dist/modules/audit/dto/audit.dto.js.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts +33 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.js +125 -0
- package/dist/modules/audit/entities/audit-event.entity.js.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts +16 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js +65 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js.map +1 -0
- package/dist/modules/audit/index.d.ts +13 -0
- package/dist/modules/audit/index.d.ts.map +1 -0
- package/dist/modules/audit/index.js +23 -0
- package/dist/modules/audit/index.js.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts +11 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js +75 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts +31 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js +338 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.js +132 -0
- package/dist/modules/audit/services/audit-archive.service.js.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts +22 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js +79 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.js +99 -0
- package/dist/modules/audit/services/audit-leader.service.js.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts +29 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.js +144 -0
- package/dist/modules/audit/services/audit-outbox.worker.js.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts +18 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.js +70 -0
- package/dist/modules/audit/services/audit-partition.service.js.map +1 -0
- package/dist/modules/audit/services/audit-write.service.d.ts +60 -0
- package/dist/modules/audit/services/audit-write.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-write.service.js +463 -0
- package/dist/modules/audit/services/audit-write.service.js.map +1 -0
- package/dist/modules/audit/services/audit.service.d.ts +60 -0
- package/dist/modules/audit/services/audit.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit.service.js +373 -0
- package/dist/modules/audit/services/audit.service.js.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts +20 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.js +44 -0
- package/dist/modules/audit/utils/audit-hash.util.js.map +1 -0
- package/dist/modules/auth/auth-core/auth-core.module.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/auth-core.module.js +16 -4
- package/dist/modules/auth/auth-core/auth-core.module.js.map +1 -1
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts +22 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js +25 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts +19 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js +110 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts +7 -8
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js +34 -34
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js.map +1 -1
- package/dist/modules/auth/auth.manifest.d.ts +6 -0
- package/dist/modules/auth/auth.manifest.d.ts.map +1 -1
- package/dist/modules/auth/auth.manifest.js +38 -2
- package/dist/modules/auth/auth.manifest.js.map +1 -1
- package/dist/modules/auth/auth.module.d.ts.map +1 -1
- package/dist/modules/auth/auth.module.js +39 -4
- package/dist/modules/auth/auth.module.js.map +1 -1
- package/dist/modules/auth/controllers/account.controller.d.ts +15 -1
- package/dist/modules/auth/controllers/account.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/account.controller.js +65 -7
- package/dist/modules/auth/controllers/account.controller.js.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.d.ts +7 -3
- package/dist/modules/auth/controllers/auth.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.js +76 -16
- package/dist/modules/auth/controllers/auth.controller.js.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts +4 -2
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.js +32 -11
- package/dist/modules/auth/controllers/forgot-password.controller.js.map +1 -1
- package/dist/modules/auth/controllers/mfa.controller.d.ts +18 -0
- package/dist/modules/auth/controllers/mfa.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/mfa.controller.js +192 -0
- package/dist/modules/auth/controllers/mfa.controller.js.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts +22 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.js +192 -0
- package/dist/modules/auth/controllers/oauth.controller.js.map +1 -0
- package/dist/modules/auth/controllers/otp.controller.d.ts +6 -3
- package/dist/modules/auth/controllers/otp.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/otp.controller.js +32 -33
- package/dist/modules/auth/controllers/otp.controller.js.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.js +10 -2
- package/dist/modules/auth/controllers/pin.controller.js.map +1 -1
- package/dist/modules/auth/controllers/session.controller.d.ts +12 -4
- package/dist/modules/auth/controllers/session.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/session.controller.js +130 -31
- package/dist/modules/auth/controllers/session.controller.js.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.d.ts +11 -2
- package/dist/modules/auth/dto/auth-config.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.js +78 -3
- package/dist/modules/auth/dto/auth-config.dto.js.map +1 -1
- package/dist/modules/auth/dto/index.d.ts +2 -0
- package/dist/modules/auth/dto/index.d.ts.map +1 -1
- package/dist/modules/auth/dto/index.js +2 -0
- package/dist/modules/auth/dto/index.js.map +1 -1
- package/dist/modules/auth/dto/login.dto.d.ts +8 -1
- package/dist/modules/auth/dto/login.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/login.dto.js +48 -3
- package/dist/modules/auth/dto/login.dto.js.map +1 -1
- package/dist/modules/auth/dto/mfa.dto.d.ts +61 -0
- package/dist/modules/auth/dto/mfa.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/mfa.dto.js +326 -0
- package/dist/modules/auth/dto/mfa.dto.js.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts +45 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.js +249 -0
- package/dist/modules/auth/dto/oauth.dto.js.map +1 -0
- package/dist/modules/auth/dto/otp.dto.d.ts +3 -1
- package/dist/modules/auth/dto/otp.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/otp.dto.js +19 -0
- package/dist/modules/auth/dto/otp.dto.js.map +1 -1
- package/dist/modules/auth/dto/password.dto.d.ts +28 -0
- package/dist/modules/auth/dto/password.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/password.dto.js +191 -5
- package/dist/modules/auth/dto/password.dto.js.map +1 -1
- package/dist/modules/auth/dto/register.dto.d.ts +1 -0
- package/dist/modules/auth/dto/register.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/register.dto.js +1 -0
- package/dist/modules/auth/dto/register.dto.js.map +1 -1
- package/dist/modules/auth/dto/session.dto.d.ts +20 -0
- package/dist/modules/auth/dto/session.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/session.dto.js +98 -0
- package/dist/modules/auth/dto/session.dto.js.map +1 -0
- package/dist/modules/auth/dto/token.dto.d.ts +38 -1
- package/dist/modules/auth/dto/token.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/token.dto.js +21 -1
- package/dist/modules/auth/dto/token.dto.js.map +1 -1
- package/dist/modules/auth/entities/index.d.ts +2 -0
- package/dist/modules/auth/entities/index.d.ts.map +1 -1
- package/dist/modules/auth/entities/index.js +2 -0
- package/dist/modules/auth/entities/index.js.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts +2 -0
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.js +6 -0
- package/dist/modules/auth/entities/password-reset-token.entity.js.map +1 -1
- package/dist/modules/auth/entities/user-mfa.entity.d.ts +19 -0
- package/dist/modules/auth/entities/user-mfa.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-mfa.entity.js +73 -0
- package/dist/modules/auth/entities/user-mfa.entity.js.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts +24 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js +84 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js.map +1 -0
- package/dist/modules/auth/events/auth.events.d.ts +84 -19
- package/dist/modules/auth/events/auth.events.d.ts.map +1 -1
- package/dist/modules/auth/events/auth.events.js +17 -9
- package/dist/modules/auth/events/auth.events.js.map +1 -1
- package/dist/modules/auth/services/account.service.d.ts +74 -14
- package/dist/modules/auth/services/account.service.d.ts.map +1 -1
- package/dist/modules/auth/services/account.service.js +247 -31
- package/dist/modules/auth/services/account.service.js.map +1 -1
- package/dist/modules/auth/services/dpop.service.d.ts +41 -0
- package/dist/modules/auth/services/dpop.service.d.ts.map +1 -0
- package/dist/modules/auth/services/dpop.service.js +159 -0
- package/dist/modules/auth/services/dpop.service.js.map +1 -0
- package/dist/modules/auth/services/index.d.ts +2 -0
- package/dist/modules/auth/services/index.d.ts.map +1 -1
- package/dist/modules/auth/services/index.js +2 -0
- package/dist/modules/auth/services/index.js.map +1 -1
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts +28 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts.map +1 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js +163 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js.map +1 -0
- package/dist/modules/auth/services/login.service.d.ts +29 -34
- package/dist/modules/auth/services/login.service.d.ts.map +1 -1
- package/dist/modules/auth/services/login.service.js +173 -61
- package/dist/modules/auth/services/login.service.js.map +1 -1
- package/dist/modules/auth/services/mfa.service.d.ts +111 -0
- package/dist/modules/auth/services/mfa.service.d.ts.map +1 -0
- package/dist/modules/auth/services/mfa.service.js +662 -0
- package/dist/modules/auth/services/mfa.service.js.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js +56 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts +12 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js +64 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js +76 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts +16 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js +92 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts +9 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js +3 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js.map +1 -0
- package/dist/modules/auth/services/oauth.service.d.ts +83 -0
- package/dist/modules/auth/services/oauth.service.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth.service.js +471 -0
- package/dist/modules/auth/services/oauth.service.js.map +1 -0
- package/dist/modules/auth/services/otp-auth.service.d.ts +13 -3
- package/dist/modules/auth/services/otp-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/otp-auth.service.js +41 -7
- package/dist/modules/auth/services/otp-auth.service.js.map +1 -1
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts +22 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts.map +1 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js +117 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js.map +1 -0
- package/dist/modules/auth/services/password.service.d.ts +25 -5
- package/dist/modules/auth/services/password.service.d.ts.map +1 -1
- package/dist/modules/auth/services/password.service.js +154 -20
- package/dist/modules/auth/services/password.service.js.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.d.ts +10 -3
- package/dist/modules/auth/services/pin-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.js +110 -13
- package/dist/modules/auth/services/pin-auth.service.js.map +1 -1
- package/dist/modules/auth/services/registration.service.d.ts +10 -2
- package/dist/modules/auth/services/registration.service.d.ts.map +1 -1
- package/dist/modules/auth/services/registration.service.js +113 -25
- package/dist/modules/auth/services/registration.service.js.map +1 -1
- package/dist/modules/auth/services/turnstile.service.d.ts +17 -0
- package/dist/modules/auth/services/turnstile.service.d.ts.map +1 -0
- package/dist/modules/auth/services/turnstile.service.js +94 -0
- package/dist/modules/auth/services/turnstile.service.js.map +1 -0
- package/dist/modules/auth/utils/auth-params.util.d.ts +13 -6
- package/dist/modules/auth/utils/auth-params.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-params.util.js +27 -4
- package/dist/modules/auth/utils/auth-params.util.js.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts +12 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.js +36 -4
- package/dist/modules/auth/utils/auth-supported.util.js.map +1 -1
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts +10 -0
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js +31 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts +5 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.js +22 -0
- package/dist/modules/auth/utils/backup-codes.util.js.map +1 -0
- package/dist/modules/auth/utils/dpop.util.d.ts +22 -0
- package/dist/modules/auth/utils/dpop.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/dpop.util.js +73 -0
- package/dist/modules/auth/utils/dpop.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts +22 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.js +59 -0
- package/dist/modules/auth/utils/mfa-secret.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts +26 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js +49 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts +5 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js +18 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js.map +1 -0
- package/dist/modules/auth/utils/totp.util.d.ts +16 -0
- package/dist/modules/auth/utils/totp.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/totp.util.js +88 -0
- package/dist/modules/auth/utils/totp.util.js.map +1 -0
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts +28 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts.map +1 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.js +48 -2
- package/dist/modules/delivery/composers/otp-delivery.composer.js.map +1 -1
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts +29 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts.map +1 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js +51 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js.map +1 -0
- package/dist/modules/delivery/delivery.module.d.ts.map +1 -1
- package/dist/modules/delivery/delivery.module.js +1 -15
- package/dist/modules/delivery/delivery.module.js.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.d.ts.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js +3 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts +12 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.js +121 -40
- package/dist/modules/delivery/notification-delivery.service.js.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts +22 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.js +144 -42
- package/dist/modules/delivery/processors/delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/delivery.processor.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts +11 -0
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js +90 -16
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts +7 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.js +11 -2
- package/dist/modules/delivery/queues/sync-jobs.queue.js.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts +7 -3
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.js +33 -10
- package/dist/modules/delivery/services/delivery-audit-retention.service.js.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.d.ts +7 -4
- package/dist/modules/delivery/services/notification-audit.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.js +83 -26
- package/dist/modules/delivery/services/notification-audit.service.js.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts +2 -0
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.js +22 -3
- package/dist/modules/delivery/utils/payload-snapshot.util.js.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts +7 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.js +5 -7
- package/dist/modules/file-upload/controllers/file-upload.controller.js.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts +2 -0
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.js +20 -0
- package/dist/modules/file-upload/dto/file-upload.dto.js.map +1 -1
- package/dist/modules/file-upload/file-upload.module.d.ts.map +1 -1
- package/dist/modules/file-upload/file-upload.module.js +12 -2
- package/dist/modules/file-upload/file-upload.module.js.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.d.ts +24 -6
- package/dist/modules/file-upload/services/file-upload.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.js +164 -36
- package/dist/modules/file-upload/services/file-upload.service.js.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts +4 -2
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js +30 -5
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.d.ts.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js +7 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js.map +1 -1
- package/dist/modules/health/health.controller.d.ts +5 -1
- package/dist/modules/health/health.controller.d.ts.map +1 -1
- package/dist/modules/health/health.controller.js +57 -3
- package/dist/modules/health/health.controller.js.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.d.ts +19 -4
- package/dist/modules/invitations/controllers/invitations.controller.d.ts.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.js +19 -10
- package/dist/modules/invitations/controllers/invitations.controller.js.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.d.ts +13 -0
- package/dist/modules/invitations/dto/invitation.dto.d.ts.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.js +69 -2
- package/dist/modules/invitations/dto/invitation.dto.js.map +1 -1
- package/dist/modules/invitations/services/invitations.service.d.ts +24 -6
- package/dist/modules/invitations/services/invitations.service.d.ts.map +1 -1
- package/dist/modules/invitations/services/invitations.service.js +96 -20
- package/dist/modules/invitations/services/invitations.service.js.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.d.ts +7 -2
- package/dist/modules/jobs/queues/jobs.queue.d.ts.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.js +25 -10
- package/dist/modules/jobs/queues/jobs.queue.js.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts +3 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.js +25 -2
- package/dist/modules/notifications/controllers/notifications.controller.js.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.d.ts.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.js +1 -0
- package/dist/modules/notifications/dto/notification-query.dto.js.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.d.ts.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.js +3 -1
- package/dist/modules/notifications/entities/device-token.entity.js.map +1 -1
- package/dist/modules/notifications/services/fcm.service.d.ts +2 -0
- package/dist/modules/notifications/services/fcm.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/fcm.service.js +28 -7
- package/dist/modules/notifications/services/fcm.service.js.map +1 -1
- package/dist/modules/notifications/services/notifications.service.d.ts +16 -3
- package/dist/modules/notifications/services/notifications.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/notifications.service.js +95 -24
- package/dist/modules/notifications/services/notifications.service.js.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.d.ts +2 -0
- package/dist/modules/observability/metrics/metrics.service.d.ts.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.js +11 -0
- package/dist/modules/observability/metrics/metrics.service.js.map +1 -1
- package/dist/modules/otp/constants/otp.constants.d.ts +7 -5
- package/dist/modules/otp/constants/otp.constants.d.ts.map +1 -1
- package/dist/modules/otp/constants/otp.constants.js +11 -8
- package/dist/modules/otp/constants/otp.constants.js.map +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.d.ts +10 -2
- package/dist/modules/otp/otp.service.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.js +48 -4
- package/dist/modules/otp/otp.service.js.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.d.ts +2 -0
- package/dist/modules/otp/services/otp.rate-limiter.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.js +19 -0
- package/dist/modules/otp/services/otp.rate-limiter.js.map +1 -1
- package/dist/modules/otp/services/otp.session.store.d.ts +9 -3
- package/dist/modules/otp/services/otp.session.store.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.session.store.js +34 -42
- package/dist/modules/otp/services/otp.session.store.js.map +1 -1
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts +11 -0
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts.map +1 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js +68 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js.map +1 -0
- package/dist/modules/profile/controllers/profile.controller.d.ts +9 -3
- package/dist/modules/profile/controllers/profile.controller.d.ts.map +1 -1
- package/dist/modules/profile/controllers/profile.controller.js +140 -8
- package/dist/modules/profile/controllers/profile.controller.js.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts +10 -0
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js +43 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js.map +1 -1
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts +24 -0
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js +115 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js.map +1 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/user-profile-response.dto.js +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.js.map +1 -1
- package/dist/modules/profile/dto/username-available.dto.d.ts +6 -0
- package/dist/modules/profile/dto/username-available.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/username-available.dto.js +31 -0
- package/dist/modules/profile/dto/username-available.dto.js.map +1 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts +10 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts.map +1 -1
- package/dist/modules/profile/entities/user-profiles.entity.js +29 -1
- package/dist/modules/profile/entities/user-profiles.entity.js.map +1 -1
- package/dist/modules/profile/index.d.ts +1 -0
- package/dist/modules/profile/index.d.ts.map +1 -1
- package/dist/modules/profile/index.js +1 -0
- package/dist/modules/profile/index.js.map +1 -1
- package/dist/modules/profile/profile.manifest.d.ts +2 -2
- package/dist/modules/profile/profile.manifest.js +2 -2
- package/dist/modules/profile/profile.manifest.js.map +1 -1
- package/dist/modules/profile/profile.module.d.ts.map +1 -1
- package/dist/modules/profile/profile.module.js +7 -2
- package/dist/modules/profile/profile.module.js.map +1 -1
- package/dist/modules/profile/services/profile.service.d.ts +56 -4
- package/dist/modules/profile/services/profile.service.d.ts.map +1 -1
- package/dist/modules/profile/services/profile.service.js +247 -20
- package/dist/modules/profile/services/profile.service.js.map +1 -1
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts +26 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts.map +1 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js +124 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts +36 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.js +42 -0
- package/dist/modules/realtime/constants/realtime.constants.js.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts +21 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.js +113 -0
- package/dist/modules/realtime/controllers/realtime.controller.js.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts +42 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js +289 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js.map +1 -0
- package/dist/modules/realtime/index.d.ts +12 -0
- package/dist/modules/realtime/index.d.ts.map +1 -0
- package/dist/modules/realtime/index.js +35 -0
- package/dist/modules/realtime/index.js.map +1 -0
- package/dist/modules/realtime/realtime.manifest.d.ts +8 -0
- package/dist/modules/realtime/realtime.manifest.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.manifest.js +31 -0
- package/dist/modules/realtime/realtime.manifest.js.map +1 -0
- package/dist/modules/realtime/realtime.module.d.ts +14 -0
- package/dist/modules/realtime/realtime.module.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.module.js +126 -0
- package/dist/modules/realtime/realtime.module.js.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts +16 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js +55 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts +15 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.js +86 -0
- package/dist/modules/realtime/services/realtime-presence.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts +12 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js +63 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime.service.d.ts +88 -0
- package/dist/modules/realtime/services/realtime.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime.service.js +343 -0
- package/dist/modules/realtime/services/realtime.service.js.map +1 -0
- package/dist/modules/realtime/types/realtime.types.d.ts +50 -0
- package/dist/modules/realtime/types/realtime.types.d.ts.map +1 -0
- package/dist/modules/realtime/types/realtime.types.js +14 -0
- package/dist/modules/realtime/types/realtime.types.js.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts +5 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.js +45 -0
- package/dist/modules/realtime/utils/handshake-error.util.js.map +1 -0
- package/dist/modules/roles/controllers/modules.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/modules.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/modules.controller.js +21 -10
- package/dist/modules/roles/controllers/modules.controller.js.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/permissions.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.js +21 -10
- package/dist/modules/roles/controllers/permissions.controller.js.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.d.ts +5 -4
- package/dist/modules/roles/controllers/roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.js +26 -13
- package/dist/modules/roles/controllers/roles.controller.js.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.d.ts +3 -2
- package/dist/modules/roles/controllers/user-roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.js +14 -6
- package/dist/modules/roles/controllers/user-roles.controller.js.map +1 -1
- package/dist/modules/roles/services/modules.service.d.ts +8 -5
- package/dist/modules/roles/services/modules.service.d.ts.map +1 -1
- package/dist/modules/roles/services/modules.service.js +58 -12
- package/dist/modules/roles/services/modules.service.js.map +1 -1
- package/dist/modules/roles/services/permissions.service.d.ts +8 -5
- package/dist/modules/roles/services/permissions.service.d.ts.map +1 -1
- package/dist/modules/roles/services/permissions.service.js +61 -12
- package/dist/modules/roles/services/permissions.service.js.map +1 -1
- package/dist/modules/roles/services/roles.service.d.ts +19 -9
- package/dist/modules/roles/services/roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/roles.service.js +137 -47
- package/dist/modules/roles/services/roles.service.js.map +1 -1
- package/dist/modules/roles/services/user-roles.service.d.ts +12 -4
- package/dist/modules/roles/services/user-roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/user-roles.service.js +58 -26
- package/dist/modules/roles/services/user-roles.service.js.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts +7 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.js +10 -0
- package/dist/modules/sessions/entities/refresh-token.entity.js.map +1 -1
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts +12 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts.map +1 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js +46 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts +20 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js +97 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js.map +1 -0
- package/dist/modules/sessions/services/token.service.d.ts +150 -16
- package/dist/modules/sessions/services/token.service.d.ts.map +1 -1
- package/dist/modules/sessions/services/token.service.js +505 -74
- package/dist/modules/sessions/services/token.service.js.map +1 -1
- package/dist/modules/sessions/sessions.module.d.ts.map +1 -1
- package/dist/modules/sessions/sessions.module.js +4 -2
- package/dist/modules/sessions/sessions.module.js.map +1 -1
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts +13 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts.map +1 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js +37 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js.map +1 -0
- package/dist/modules/settings/constants/settings.defaults.d.ts +57 -3
- package/dist/modules/settings/constants/settings.defaults.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.defaults.js +58 -3
- package/dist/modules/settings/constants/settings.defaults.js.map +1 -1
- package/dist/modules/settings/constants/settings.keys.d.ts +138 -2
- package/dist/modules/settings/constants/settings.keys.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.keys.js +140 -2
- package/dist/modules/settings/constants/settings.keys.js.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts +5 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.js +134 -5
- package/dist/modules/settings/controllers/settings.controller.js.map +1 -1
- package/dist/modules/settings/services/settings.service.d.ts +17 -7
- package/dist/modules/settings/services/settings.service.d.ts.map +1 -1
- package/dist/modules/settings/services/settings.service.js +80 -14
- package/dist/modules/settings/services/settings.service.js.map +1 -1
- package/dist/modules/settings/utils/settings-secret.util.d.ts +13 -0
- package/dist/modules/settings/utils/settings-secret.util.d.ts.map +1 -0
- package/dist/modules/settings/utils/settings-secret.util.js +80 -0
- package/dist/modules/settings/utils/settings-secret.util.js.map +1 -0
- package/dist/modules/users/controllers/users.controller.d.ts +4 -2
- package/dist/modules/users/controllers/users.controller.d.ts.map +1 -1
- package/dist/modules/users/controllers/users.controller.js +89 -10
- package/dist/modules/users/controllers/users.controller.js.map +1 -1
- package/dist/modules/users/dto/user.dto.d.ts +3 -0
- package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
- package/dist/modules/users/dto/user.dto.js +27 -4
- package/dist/modules/users/dto/user.dto.js.map +1 -1
- package/dist/modules/users/entities/user.entity.d.ts +7 -1
- package/dist/modules/users/entities/user.entity.d.ts.map +1 -1
- package/dist/modules/users/entities/user.entity.js +10 -0
- package/dist/modules/users/entities/user.entity.js.map +1 -1
- package/dist/modules/users/services/users.service.d.ts +15 -2
- package/dist/modules/users/services/users.service.d.ts.map +1 -1
- package/dist/modules/users/services/users.service.js +152 -37
- package/dist/modules/users/services/users.service.js.map +1 -1
- package/dist/modules/users/users.module.d.ts.map +1 -1
- package/dist/modules/users/users.module.js +1 -2
- package/dist/modules/users/users.module.js.map +1 -1
- package/package.json +19 -7
- package/dist/modules/admin/entities/admin-log.entity.d.ts +0 -20
- package/dist/modules/admin/entities/admin-log.entity.d.ts.map +0 -1
- package/dist/modules/admin/entities/admin-log.entity.js +0 -65
- package/dist/modules/admin/entities/admin-log.entity.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199383-settings-role-and-verified-lock.js","sourceRoot":"","sources":["../../../src/database/migrations/1785006199383-settings-role-and-verified-lock.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,MAAa,wCAAwC;IACpD,IAAI,GAAG,0CAA0C,CAAC;IAE3C,KAAK,CAAC,EAAE,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;GAMvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;GAMvB,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACzC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;GAOvB,CAAC,CAAC;IACJ,CAAC;CACD;AA/BD,4FA+BC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type MigrationInterface, type QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Lock auth surface / test-backdoor settings:
|
|
4
|
+
* - auth.oauth.providers (cannot enable providers via settings:write)
|
|
5
|
+
* - test.otp_identifiers (cannot inject fixed OTP codes via API)
|
|
6
|
+
*/
|
|
7
|
+
export declare class SettingsProvidersAndTestOtpLock1785006199384 implements MigrationInterface {
|
|
8
|
+
name: string;
|
|
9
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
10
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=1785006199384-settings-providers-and-test-otp-lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199384-settings-providers-and-test-otp-lock.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1785006199384-settings-providers-and-test-otp-lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpE;;;;GAIG;AACH,qBAAa,4CAA6C,YAAW,kBAAkB;IACtF,IAAI,SAAkD;IAEzC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAU1D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SettingsProvidersAndTestOtpLock1785006199384 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Lock auth surface / test-backdoor settings:
|
|
6
|
+
* - auth.oauth.providers (cannot enable providers via settings:write)
|
|
7
|
+
* - test.otp_identifiers (cannot inject fixed OTP codes via API)
|
|
8
|
+
*/
|
|
9
|
+
class SettingsProvidersAndTestOtpLock1785006199384 {
|
|
10
|
+
name = 'SettingsProvidersAndTestOtpLock1785006199384';
|
|
11
|
+
async up(queryRunner) {
|
|
12
|
+
await queryRunner.query(`
|
|
13
|
+
UPDATE "app_settings"
|
|
14
|
+
SET "is_editable" = false,
|
|
15
|
+
"description" = 'JSON array of enabled OAuth providers. API cannot edit (auth surface expansion risk); ops/seed only.',
|
|
16
|
+
"updated_at" = NOW()
|
|
17
|
+
WHERE "key" = 'auth.oauth.providers'
|
|
18
|
+
`);
|
|
19
|
+
await queryRunner.query(`
|
|
20
|
+
UPDATE "app_settings"
|
|
21
|
+
SET "is_editable" = false,
|
|
22
|
+
"description" = 'Test OTP identifiers (non-production only). API cannot edit; ops/seed only. Hard-disabled when NODE_ENV=production.',
|
|
23
|
+
"updated_at" = NOW()
|
|
24
|
+
WHERE "key" = 'test.otp_identifiers'
|
|
25
|
+
`);
|
|
26
|
+
}
|
|
27
|
+
async down(queryRunner) {
|
|
28
|
+
await queryRunner.query(`
|
|
29
|
+
UPDATE "app_settings"
|
|
30
|
+
SET "is_editable" = true, "updated_at" = NOW()
|
|
31
|
+
WHERE "key" IN (
|
|
32
|
+
'auth.oauth.providers',
|
|
33
|
+
'test.otp_identifiers'
|
|
34
|
+
)
|
|
35
|
+
`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.SettingsProvidersAndTestOtpLock1785006199384 = SettingsProvidersAndTestOtpLock1785006199384;
|
|
39
|
+
//# sourceMappingURL=1785006199384-settings-providers-and-test-otp-lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199384-settings-providers-and-test-otp-lock.js","sourceRoot":"","sources":["../../../src/database/migrations/1785006199384-settings-providers-and-test-otp-lock.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,MAAa,4CAA4C;IACxD,IAAI,GAAG,8CAA8C,CAAC;IAE/C,KAAK,CAAC,EAAE,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;GAMvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;GAMvB,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACzC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;GAOvB,CAAC,CAAC;IACJ,CAAC;CACD;AA/BD,oGA+BC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type MigrationInterface, type QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Lock auth-surface and OAuth trust-boundary settings + backfill auto_link lock:
|
|
4
|
+
* - auth.method / supported_*_methods (cannot expand login/register via API)
|
|
5
|
+
* - auth.oauth.google.hosted_domain / microsoft.tenant (cannot widen trust)
|
|
6
|
+
* - auth.oauth.auto_link_verified_email (seed already false; ensure existing DBs)
|
|
7
|
+
*/
|
|
8
|
+
export declare class SettingsAuthSurfaceLock1785006199385 implements MigrationInterface {
|
|
9
|
+
name: string;
|
|
10
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
11
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=1785006199385-settings-auth-surface-lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199385-settings-auth-surface-lock.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1785006199385-settings-auth-surface-lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpE;;;;;GAKG;AACH,qBAAa,oCAAqC,YAAW,kBAAkB;IAC9E,IAAI,SAA0C;IAEjC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAkD3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAc1D"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SettingsAuthSurfaceLock1785006199385 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Lock auth-surface and OAuth trust-boundary settings + backfill auto_link lock:
|
|
6
|
+
* - auth.method / supported_*_methods (cannot expand login/register via API)
|
|
7
|
+
* - auth.oauth.google.hosted_domain / microsoft.tenant (cannot widen trust)
|
|
8
|
+
* - auth.oauth.auto_link_verified_email (seed already false; ensure existing DBs)
|
|
9
|
+
*/
|
|
10
|
+
class SettingsAuthSurfaceLock1785006199385 {
|
|
11
|
+
name = 'SettingsAuthSurfaceLock1785006199385';
|
|
12
|
+
async up(queryRunner) {
|
|
13
|
+
await queryRunner.query(`
|
|
14
|
+
UPDATE "app_settings"
|
|
15
|
+
SET "is_editable" = false,
|
|
16
|
+
"description" = 'Primary identity mechanism (phone|email). API cannot edit; ops/seed/env only.',
|
|
17
|
+
"updated_at" = NOW()
|
|
18
|
+
WHERE "key" = 'auth.method'
|
|
19
|
+
`);
|
|
20
|
+
await queryRunner.query(`
|
|
21
|
+
UPDATE "app_settings"
|
|
22
|
+
SET "is_editable" = false,
|
|
23
|
+
"description" = 'Enabled login credential shapes. API cannot edit (auth surface risk); ops/seed only.',
|
|
24
|
+
"updated_at" = NOW()
|
|
25
|
+
WHERE "key" = 'auth.supported_login_methods'
|
|
26
|
+
`);
|
|
27
|
+
await queryRunner.query(`
|
|
28
|
+
UPDATE "app_settings"
|
|
29
|
+
SET "is_editable" = false,
|
|
30
|
+
"description" = 'Enabled registration credential shapes. API cannot edit (auth surface risk); ops/seed only.',
|
|
31
|
+
"updated_at" = NOW()
|
|
32
|
+
WHERE "key" = 'auth.supported_registration_methods'
|
|
33
|
+
`);
|
|
34
|
+
await queryRunner.query(`
|
|
35
|
+
UPDATE "app_settings"
|
|
36
|
+
SET "is_editable" = false,
|
|
37
|
+
"description" = 'Google Workspace hd restriction. API cannot edit (trust-boundary risk); ops/seed only.',
|
|
38
|
+
"updated_at" = NOW()
|
|
39
|
+
WHERE "key" = 'auth.oauth.google.hosted_domain'
|
|
40
|
+
`);
|
|
41
|
+
await queryRunner.query(`
|
|
42
|
+
UPDATE "app_settings"
|
|
43
|
+
SET "is_editable" = false,
|
|
44
|
+
"description" = 'Microsoft Entra tenant. API cannot edit (trust-boundary risk); ops/seed only.',
|
|
45
|
+
"updated_at" = NOW()
|
|
46
|
+
WHERE "key" = 'auth.oauth.microsoft.tenant'
|
|
47
|
+
`);
|
|
48
|
+
await queryRunner.query(`
|
|
49
|
+
UPDATE "app_settings"
|
|
50
|
+
SET "is_editable" = false,
|
|
51
|
+
"description" = 'OAuth auto-link by verified email. API cannot enable (ATO risk); ops/seed only.',
|
|
52
|
+
"updated_at" = NOW()
|
|
53
|
+
WHERE "key" = 'auth.oauth.auto_link_verified_email'
|
|
54
|
+
`);
|
|
55
|
+
}
|
|
56
|
+
async down(queryRunner) {
|
|
57
|
+
await queryRunner.query(`
|
|
58
|
+
UPDATE "app_settings"
|
|
59
|
+
SET "is_editable" = true, "updated_at" = NOW()
|
|
60
|
+
WHERE "key" IN (
|
|
61
|
+
'auth.method',
|
|
62
|
+
'auth.supported_login_methods',
|
|
63
|
+
'auth.supported_registration_methods',
|
|
64
|
+
'auth.oauth.google.hosted_domain',
|
|
65
|
+
'auth.oauth.microsoft.tenant'
|
|
66
|
+
)
|
|
67
|
+
`);
|
|
68
|
+
// auto_link stays non-editable on down (safer default)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.SettingsAuthSurfaceLock1785006199385 = SettingsAuthSurfaceLock1785006199385;
|
|
72
|
+
//# sourceMappingURL=1785006199385-settings-auth-surface-lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199385-settings-auth-surface-lock.js","sourceRoot":"","sources":["../../../src/database/migrations/1785006199385-settings-auth-surface-lock.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACH,MAAa,oCAAoC;IAChD,IAAI,GAAG,sCAAsC,CAAC;IAEvC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;GAMvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;GAMvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;GAMvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;GAMvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;GAMvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;GAMvB,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACzC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;GAUvB,CAAC,CAAC;QACH,uDAAuD;IACxD,CAAC;CACD;AAnED,oFAmEC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type MigrationInterface, type QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Compliance audit trail (`audit_events`) + backfill from legacy `admin_logs`.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AuditEvents1785006199386 implements MigrationInterface {
|
|
6
|
+
name: string;
|
|
7
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
8
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=1785006199386-audit-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199386-audit-events.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1785006199386-audit-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpE;;GAEG;AACH,qBAAa,wBAAyB,YAAW,kBAAkB;IAClE,IAAI,SAA8B;IAErB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA2D3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAG1D"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuditEvents1785006199386 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Compliance audit trail (`audit_events`) + backfill from legacy `admin_logs`.
|
|
6
|
+
*/
|
|
7
|
+
class AuditEvents1785006199386 {
|
|
8
|
+
name = 'AuditEvents1785006199386';
|
|
9
|
+
async up(queryRunner) {
|
|
10
|
+
await queryRunner.query(`
|
|
11
|
+
CREATE TABLE IF NOT EXISTS "audit_events" (
|
|
12
|
+
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
|
|
13
|
+
"created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
|
|
14
|
+
"actor_type" character varying(32) NOT NULL DEFAULT 'USER',
|
|
15
|
+
"actor_id" uuid,
|
|
16
|
+
"action" character varying(128) NOT NULL,
|
|
17
|
+
"resource_type" character varying(64),
|
|
18
|
+
"resource_id" character varying(128),
|
|
19
|
+
"status" character varying(16) NOT NULL DEFAULT 'SUCCESS',
|
|
20
|
+
"metadata" jsonb,
|
|
21
|
+
"ip_address" character varying(64),
|
|
22
|
+
"device_info" character varying(512),
|
|
23
|
+
"request_id" character varying(64),
|
|
24
|
+
CONSTRAINT "PK_audit_events_id" PRIMARY KEY ("id")
|
|
25
|
+
)
|
|
26
|
+
`);
|
|
27
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_actor_type" ON "audit_events" ("actor_type")`);
|
|
28
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_actor_id" ON "audit_events" ("actor_id")`);
|
|
29
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_action" ON "audit_events" ("action")`);
|
|
30
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_resource_id" ON "audit_events" ("resource_id")`);
|
|
31
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_created_at" ON "audit_events" ("created_at")`);
|
|
32
|
+
// Backfill historical admin actions (idempotent: only when audit_events empty of those ids)
|
|
33
|
+
await queryRunner.query(`
|
|
34
|
+
INSERT INTO "audit_events" (
|
|
35
|
+
"id", "created_at", "actor_type", "actor_id", "action",
|
|
36
|
+
"resource_type", "resource_id", "status", "metadata", "ip_address"
|
|
37
|
+
)
|
|
38
|
+
SELECT
|
|
39
|
+
al."id",
|
|
40
|
+
al."created_at",
|
|
41
|
+
'ADMIN',
|
|
42
|
+
al."actor_id",
|
|
43
|
+
al."action",
|
|
44
|
+
al."target_type",
|
|
45
|
+
al."target_id",
|
|
46
|
+
'SUCCESS',
|
|
47
|
+
al."metadata",
|
|
48
|
+
al."ip_address"
|
|
49
|
+
FROM "admin_logs" al
|
|
50
|
+
WHERE NOT EXISTS (
|
|
51
|
+
SELECT 1 FROM "audit_events" ae WHERE ae."id" = al."id"
|
|
52
|
+
)
|
|
53
|
+
`);
|
|
54
|
+
}
|
|
55
|
+
async down(queryRunner) {
|
|
56
|
+
await queryRunner.query(`DROP TABLE IF EXISTS "audit_events"`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.AuditEvents1785006199386 = AuditEvents1785006199386;
|
|
60
|
+
//# sourceMappingURL=1785006199386-audit-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199386-audit-events.js","sourceRoot":"","sources":["../../../src/database/migrations/1785006199386-audit-events.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAa,wBAAwB;IACpC,IAAI,GAAG,0BAA0B,CAAC;IAE3B,KAAK,CAAC,EAAE,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;GAgBvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CACtB,2FAA2F,CAC3F,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,uFAAuF,CACvF,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,mFAAmF,CACnF,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,6FAA6F,CAC7F,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,2FAA2F,CAC3F,CAAC;QAEF,4FAA4F;QAC5F,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;GAoBvB,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACzC,MAAM,WAAW,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAChE,CAAC;CACD;AAjED,4DAiEC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type MigrationInterface, type QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Allow opaque resource ids (setting keys, external refs) — not UUID-only.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AuditResourceIdVarchar1785006199387 implements MigrationInterface {
|
|
6
|
+
name: string;
|
|
7
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
8
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=1785006199387-audit-resource-id-varchar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199387-audit-resource-id-varchar.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1785006199387-audit-resource-id-varchar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpE;;GAEG;AACH,qBAAa,mCAAoC,YAAW,kBAAkB;IAC7E,IAAI,SAAyC;IAEhC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAO1D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuditResourceIdVarchar1785006199387 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Allow opaque resource ids (setting keys, external refs) — not UUID-only.
|
|
6
|
+
*/
|
|
7
|
+
class AuditResourceIdVarchar1785006199387 {
|
|
8
|
+
name = 'AuditResourceIdVarchar1785006199387';
|
|
9
|
+
async up(queryRunner) {
|
|
10
|
+
await queryRunner.query(`
|
|
11
|
+
ALTER TABLE "audit_events"
|
|
12
|
+
ALTER COLUMN "resource_id" TYPE character varying(128)
|
|
13
|
+
USING "resource_id"::text
|
|
14
|
+
`);
|
|
15
|
+
}
|
|
16
|
+
async down(queryRunner) {
|
|
17
|
+
await queryRunner.query(`
|
|
18
|
+
ALTER TABLE "audit_events"
|
|
19
|
+
ALTER COLUMN "resource_id" TYPE uuid
|
|
20
|
+
USING NULLIF("resource_id", '')::uuid
|
|
21
|
+
`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.AuditResourceIdVarchar1785006199387 = AuditResourceIdVarchar1785006199387;
|
|
25
|
+
//# sourceMappingURL=1785006199387-audit-resource-id-varchar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199387-audit-resource-id-varchar.js","sourceRoot":"","sources":["../../../src/database/migrations/1785006199387-audit-resource-id-varchar.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAa,mCAAmC;IAC/C,IAAI,GAAG,qCAAqC,CAAC;IAEtC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;GAIvB,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACzC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;GAIvB,CAAC,CAAC;IACJ,CAAC;CACD;AAlBD,kFAkBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type MigrationInterface, type QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Enterprise audit: correlation/trace, hash chain, legal hold, outbox,
|
|
4
|
+
* append-only triggers (purge/legal_hold via session GUC).
|
|
5
|
+
*/
|
|
6
|
+
export declare class AuditEnterprise1785006199388 implements MigrationInterface {
|
|
7
|
+
name: string;
|
|
8
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
9
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=1785006199388-audit-enterprise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199388-audit-enterprise.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1785006199388-audit-enterprise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpE;;;GAGG;AACH,qBAAa,4BAA6B,YAAW,kBAAkB;IACtE,IAAI,SAAkC;IAEzB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA0I3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAqB1D"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuditEnterprise1785006199388 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Enterprise audit: correlation/trace, hash chain, legal hold, outbox,
|
|
6
|
+
* append-only triggers (purge/legal_hold via session GUC).
|
|
7
|
+
*/
|
|
8
|
+
class AuditEnterprise1785006199388 {
|
|
9
|
+
name = 'AuditEnterprise1785006199388';
|
|
10
|
+
async up(queryRunner) {
|
|
11
|
+
await queryRunner.query(`
|
|
12
|
+
ALTER TABLE "audit_events"
|
|
13
|
+
ADD COLUMN IF NOT EXISTS "correlation_id" character varying(64),
|
|
14
|
+
ADD COLUMN IF NOT EXISTS "trace_id" character varying(64),
|
|
15
|
+
ADD COLUMN IF NOT EXISTS "chain_seq" bigint,
|
|
16
|
+
ADD COLUMN IF NOT EXISTS "event_hash" character varying(64),
|
|
17
|
+
ADD COLUMN IF NOT EXISTS "prev_hash" character varying(64),
|
|
18
|
+
ADD COLUMN IF NOT EXISTS "legal_hold" boolean NOT NULL DEFAULT false
|
|
19
|
+
`);
|
|
20
|
+
await queryRunner.query(`
|
|
21
|
+
WITH ordered AS (
|
|
22
|
+
SELECT id, ROW_NUMBER() OVER (ORDER BY created_at ASC, id ASC) AS rn
|
|
23
|
+
FROM audit_events
|
|
24
|
+
WHERE chain_seq IS NULL
|
|
25
|
+
)
|
|
26
|
+
UPDATE audit_events ae
|
|
27
|
+
SET chain_seq = ordered.rn
|
|
28
|
+
FROM ordered
|
|
29
|
+
WHERE ae.id = ordered.id
|
|
30
|
+
`);
|
|
31
|
+
await queryRunner.query(`
|
|
32
|
+
CREATE SEQUENCE IF NOT EXISTS audit_events_chain_seq_seq
|
|
33
|
+
`);
|
|
34
|
+
await queryRunner.query(`
|
|
35
|
+
SELECT setval(
|
|
36
|
+
'audit_events_chain_seq_seq',
|
|
37
|
+
GREATEST(COALESCE((SELECT MAX(chain_seq) FROM audit_events), 0), 1)
|
|
38
|
+
)
|
|
39
|
+
`);
|
|
40
|
+
await queryRunner.query(`
|
|
41
|
+
ALTER TABLE "audit_events"
|
|
42
|
+
ALTER COLUMN "chain_seq" SET DEFAULT nextval('audit_events_chain_seq_seq'),
|
|
43
|
+
ALTER COLUMN "chain_seq" SET NOT NULL
|
|
44
|
+
`);
|
|
45
|
+
await queryRunner.query(`
|
|
46
|
+
ALTER SEQUENCE audit_events_chain_seq_seq OWNED BY audit_events.chain_seq
|
|
47
|
+
`);
|
|
48
|
+
await queryRunner.query(`
|
|
49
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "UQ_audit_events_chain_seq"
|
|
50
|
+
ON "audit_events" ("chain_seq")
|
|
51
|
+
`);
|
|
52
|
+
await queryRunner.query(`
|
|
53
|
+
CREATE INDEX IF NOT EXISTS "IDX_audit_events_correlation_id"
|
|
54
|
+
ON "audit_events" ("correlation_id")
|
|
55
|
+
`);
|
|
56
|
+
await queryRunner.query(`
|
|
57
|
+
CREATE INDEX IF NOT EXISTS "IDX_audit_events_legal_hold"
|
|
58
|
+
ON "audit_events" ("legal_hold")
|
|
59
|
+
WHERE "legal_hold" = true
|
|
60
|
+
`);
|
|
61
|
+
await queryRunner.query(`
|
|
62
|
+
CREATE INDEX IF NOT EXISTS "IDX_audit_events_created_at_brin"
|
|
63
|
+
ON "audit_events" USING BRIN ("created_at")
|
|
64
|
+
`);
|
|
65
|
+
await queryRunner.query(`
|
|
66
|
+
CREATE TABLE IF NOT EXISTS "audit_outbox" (
|
|
67
|
+
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
|
|
68
|
+
"created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
|
|
69
|
+
"payload" jsonb NOT NULL,
|
|
70
|
+
"status" character varying(32) NOT NULL DEFAULT 'pending',
|
|
71
|
+
"attempts" integer NOT NULL DEFAULT 0,
|
|
72
|
+
"next_retry_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
|
|
73
|
+
"last_error" text,
|
|
74
|
+
"completed_at" TIMESTAMP WITH TIME ZONE,
|
|
75
|
+
CONSTRAINT "PK_audit_outbox_id" PRIMARY KEY ("id")
|
|
76
|
+
)
|
|
77
|
+
`);
|
|
78
|
+
await queryRunner.query(`
|
|
79
|
+
CREATE INDEX IF NOT EXISTS "IDX_audit_outbox_pending"
|
|
80
|
+
ON "audit_outbox" ("status", "next_retry_at")
|
|
81
|
+
`);
|
|
82
|
+
await queryRunner.query(`
|
|
83
|
+
CREATE OR REPLACE FUNCTION audit_events_immutable_guard()
|
|
84
|
+
RETURNS trigger
|
|
85
|
+
LANGUAGE plpgsql
|
|
86
|
+
AS $$
|
|
87
|
+
DECLARE
|
|
88
|
+
mode text := current_setting('app.audit_mutation', true);
|
|
89
|
+
BEGIN
|
|
90
|
+
IF TG_OP = 'DELETE' THEN
|
|
91
|
+
IF mode = 'purge' THEN
|
|
92
|
+
RETURN OLD;
|
|
93
|
+
END IF;
|
|
94
|
+
RAISE EXCEPTION 'audit_events is append-only (DELETE denied)';
|
|
95
|
+
END IF;
|
|
96
|
+
|
|
97
|
+
IF TG_OP = 'UPDATE' THEN
|
|
98
|
+
IF mode = 'legal_hold' THEN
|
|
99
|
+
IF NEW.id IS DISTINCT FROM OLD.id
|
|
100
|
+
OR NEW.created_at IS DISTINCT FROM OLD.created_at
|
|
101
|
+
OR NEW.actor_type IS DISTINCT FROM OLD.actor_type
|
|
102
|
+
OR NEW.actor_id IS DISTINCT FROM OLD.actor_id
|
|
103
|
+
OR NEW.action IS DISTINCT FROM OLD.action
|
|
104
|
+
OR NEW.resource_type IS DISTINCT FROM OLD.resource_type
|
|
105
|
+
OR NEW.resource_id IS DISTINCT FROM OLD.resource_id
|
|
106
|
+
OR NEW.status IS DISTINCT FROM OLD.status
|
|
107
|
+
OR NEW.metadata IS DISTINCT FROM OLD.metadata
|
|
108
|
+
OR NEW.ip_address IS DISTINCT FROM OLD.ip_address
|
|
109
|
+
OR NEW.device_info IS DISTINCT FROM OLD.device_info
|
|
110
|
+
OR NEW.request_id IS DISTINCT FROM OLD.request_id
|
|
111
|
+
OR NEW.correlation_id IS DISTINCT FROM OLD.correlation_id
|
|
112
|
+
OR NEW.trace_id IS DISTINCT FROM OLD.trace_id
|
|
113
|
+
OR NEW.chain_seq IS DISTINCT FROM OLD.chain_seq
|
|
114
|
+
OR NEW.event_hash IS DISTINCT FROM OLD.event_hash
|
|
115
|
+
OR NEW.prev_hash IS DISTINCT FROM OLD.prev_hash
|
|
116
|
+
THEN
|
|
117
|
+
RAISE EXCEPTION 'audit_events legal_hold mode may only toggle legal_hold';
|
|
118
|
+
END IF;
|
|
119
|
+
RETURN NEW;
|
|
120
|
+
END IF;
|
|
121
|
+
RAISE EXCEPTION 'audit_events is append-only (UPDATE denied)';
|
|
122
|
+
END IF;
|
|
123
|
+
|
|
124
|
+
RETURN NEW;
|
|
125
|
+
END;
|
|
126
|
+
$$
|
|
127
|
+
`);
|
|
128
|
+
await queryRunner.query(`DROP TRIGGER IF EXISTS trg_audit_events_immutable ON audit_events`);
|
|
129
|
+
await queryRunner.query(`
|
|
130
|
+
CREATE TRIGGER trg_audit_events_immutable
|
|
131
|
+
BEFORE UPDATE OR DELETE ON audit_events
|
|
132
|
+
FOR EACH ROW
|
|
133
|
+
EXECUTE PROCEDURE audit_events_immutable_guard()
|
|
134
|
+
`);
|
|
135
|
+
}
|
|
136
|
+
async down(queryRunner) {
|
|
137
|
+
await queryRunner.query(`DROP TRIGGER IF EXISTS trg_audit_events_immutable ON audit_events`);
|
|
138
|
+
await queryRunner.query(`DROP FUNCTION IF EXISTS audit_events_immutable_guard()`);
|
|
139
|
+
await queryRunner.query(`DROP TABLE IF EXISTS "audit_outbox"`);
|
|
140
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_audit_events_created_at_brin"`);
|
|
141
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_audit_events_legal_hold"`);
|
|
142
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_audit_events_correlation_id"`);
|
|
143
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "UQ_audit_events_chain_seq"`);
|
|
144
|
+
await queryRunner.query(`
|
|
145
|
+
ALTER TABLE "audit_events"
|
|
146
|
+
DROP COLUMN IF EXISTS "legal_hold",
|
|
147
|
+
DROP COLUMN IF EXISTS "prev_hash",
|
|
148
|
+
DROP COLUMN IF EXISTS "event_hash",
|
|
149
|
+
DROP COLUMN IF EXISTS "chain_seq",
|
|
150
|
+
DROP COLUMN IF EXISTS "trace_id",
|
|
151
|
+
DROP COLUMN IF EXISTS "correlation_id"
|
|
152
|
+
`);
|
|
153
|
+
await queryRunner.query(`DROP SEQUENCE IF EXISTS audit_events_chain_seq_seq`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.AuditEnterprise1785006199388 = AuditEnterprise1785006199388;
|
|
157
|
+
//# sourceMappingURL=1785006199388-audit-enterprise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199388-audit-enterprise.js","sourceRoot":"","sources":["../../../src/database/migrations/1785006199388-audit-enterprise.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,4BAA4B;IACxC,IAAI,GAAG,8BAA8B,CAAC;IAE/B,KAAK,CAAC,EAAE,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;GAQvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;GAUvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;GAEvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;GAKvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;GAIvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;GAEvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;GAIvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;GAYvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CACtB,mEAAmE,CACnE,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;GAKvB,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACzC,MAAM,WAAW,CAAC,KAAK,CACtB,mEAAmE,CACnE,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAClF,MAAM,WAAW,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;QAC/D,MAAM,WAAW,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;QACnF,MAAM,WAAW,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;QAC9E,MAAM,WAAW,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAClF,MAAM,WAAW,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QAC5E,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;GAQvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;IAC/E,CAAC;CACD;AAlKD,oEAkKC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type MigrationInterface, type QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Retire legacy `admin_logs` after backfill into `audit_events` (9386).
|
|
4
|
+
*/
|
|
5
|
+
export declare class DropAdminLogs1785006199389 implements MigrationInterface {
|
|
6
|
+
name: string;
|
|
7
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
8
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=1785006199389-drop-admin-logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199389-drop-admin-logs.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1785006199389-drop-admin-logs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpE;;GAEG;AACH,qBAAa,0BAA2B,YAAW,kBAAkB;IACpE,IAAI,SAAgC;IAEvB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAO3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CA2B1D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DropAdminLogs1785006199389 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Retire legacy `admin_logs` after backfill into `audit_events` (9386).
|
|
6
|
+
*/
|
|
7
|
+
class DropAdminLogs1785006199389 {
|
|
8
|
+
name = 'DropAdminLogs1785006199389';
|
|
9
|
+
async up(queryRunner) {
|
|
10
|
+
await queryRunner.query(`ALTER TABLE IF EXISTS "admin_logs" DROP CONSTRAINT IF EXISTS "FK_3df363f383075d397bfde7443b2"`);
|
|
11
|
+
await queryRunner.query(`DROP TABLE IF EXISTS "admin_logs"`);
|
|
12
|
+
}
|
|
13
|
+
async down(queryRunner) {
|
|
14
|
+
await queryRunner.query(`
|
|
15
|
+
CREATE TABLE IF NOT EXISTS "admin_logs" (
|
|
16
|
+
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
|
|
17
|
+
"created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
|
|
18
|
+
"actor_id" uuid,
|
|
19
|
+
"action" character varying NOT NULL,
|
|
20
|
+
"target_type" character varying,
|
|
21
|
+
"target_id" uuid,
|
|
22
|
+
"metadata" jsonb,
|
|
23
|
+
"ip_address" character varying,
|
|
24
|
+
CONSTRAINT "PK_1bd116497b175ab12373dcb362b" PRIMARY KEY ("id")
|
|
25
|
+
)
|
|
26
|
+
`);
|
|
27
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_3df363f383075d397bfde7443b" ON "admin_logs" ("actor_id")`);
|
|
28
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_b4a4d9acc93bed6c9143a54870" ON "admin_logs" ("action")`);
|
|
29
|
+
await queryRunner.query(`
|
|
30
|
+
ALTER TABLE "admin_logs"
|
|
31
|
+
ADD CONSTRAINT "FK_3df363f383075d397bfde7443b2"
|
|
32
|
+
FOREIGN KEY ("actor_id") REFERENCES "users"("id")
|
|
33
|
+
ON DELETE SET NULL ON UPDATE NO ACTION
|
|
34
|
+
`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.DropAdminLogs1785006199389 = DropAdminLogs1785006199389;
|
|
38
|
+
//# sourceMappingURL=1785006199389-drop-admin-logs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199389-drop-admin-logs.js","sourceRoot":"","sources":["../../../src/database/migrations/1785006199389-drop-admin-logs.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAa,0BAA0B;IACtC,IAAI,GAAG,4BAA4B,CAAC;IAE7B,KAAK,CAAC,EAAE,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CACtB,+FAA+F,CAC/F,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;IAC9D,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACzC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;GAYvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CACtB,0FAA0F,CAC1F,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,wFAAwF,CACxF,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;GAKvB,CAAC,CAAC;IACJ,CAAC;CACD;AArCD,gEAqCC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type MigrationInterface, type QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Close remaining enterprise audit gaps:
|
|
4
|
+
* - range-partition audit_events by created_at
|
|
5
|
+
* - SECURITY DEFINER legal_hold / purge / seal / partition helpers
|
|
6
|
+
* - ownership split + REVOKE UPDATE/DELETE when privileges allow
|
|
7
|
+
* - extend immutability trigger for hash seal backfill
|
|
8
|
+
*/
|
|
9
|
+
export declare class AuditHardening1785006199390 implements MigrationInterface {
|
|
10
|
+
name: string;
|
|
11
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
12
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=1785006199390-audit-hardening.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199390-audit-hardening.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1785006199390-audit-hardening.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpE;;;;;;GAMG;AACH,qBAAa,2BAA4B,YAAW,kBAAkB;IACrE,IAAI,SAAiC;IAExB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAgX3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAuB1D"}
|