@colveor/core 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +6 -0
- package/dist/bootstrap/bootstrap-colveor-app.d.ts.map +1 -1
- package/dist/bootstrap/bootstrap-colveor-app.js +22 -3
- package/dist/bootstrap/bootstrap-colveor-app.js.map +1 -1
- package/dist/common/decorators/index.d.ts +6 -0
- package/dist/common/decorators/index.d.ts.map +1 -1
- package/dist/common/decorators/index.js +8 -1
- package/dist/common/decorators/index.js.map +1 -1
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts +9 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts.map +1 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.js +12 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.js.map +1 -0
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts +12 -6
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts.map +1 -1
- package/dist/common/guards/login-ip-rate-limit.guard.js +65 -21
- package/dist/common/guards/login-ip-rate-limit.guard.js.map +1 -1
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts +3 -2
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts.map +1 -1
- package/dist/common/guards/otp-ip-rate-limit.guard.js +17 -15
- package/dist/common/guards/otp-ip-rate-limit.guard.js.map +1 -1
- package/dist/common/guards/permissions.guard.d.ts.map +1 -1
- package/dist/common/guards/permissions.guard.js +12 -2
- package/dist/common/guards/permissions.guard.js.map +1 -1
- package/dist/common/interceptors/timeout.interceptor.d.ts +1 -1
- package/dist/common/interceptors/timeout.interceptor.d.ts.map +1 -1
- package/dist/common/interceptors/timeout.interceptor.js +5 -1
- package/dist/common/interceptors/timeout.interceptor.js.map +1 -1
- package/dist/common/interfaces/request-user.d.ts +4 -3
- package/dist/common/interfaces/request-user.d.ts.map +1 -1
- package/dist/common/utils/cache-version.util.d.ts +12 -0
- package/dist/common/utils/cache-version.util.d.ts.map +1 -0
- package/dist/common/utils/cache-version.util.js +34 -0
- package/dist/common/utils/cache-version.util.js.map +1 -0
- package/dist/common/utils/postgres-error.util.d.ts +5 -0
- package/dist/common/utils/postgres-error.util.d.ts.map +1 -0
- package/dist/common/utils/postgres-error.util.js +13 -0
- package/dist/common/utils/postgres-error.util.js.map +1 -0
- package/dist/common/utils/singleflight.util.d.ts +6 -0
- package/dist/common/utils/singleflight.util.d.ts.map +1 -0
- package/dist/common/utils/singleflight.util.js +21 -0
- package/dist/common/utils/singleflight.util.js.map +1 -0
- package/dist/common/validators/is-exclusive-auth-params.validator.js +1 -1
- package/dist/common/validators/is-exclusive-auth-params.validator.js.map +1 -1
- package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js +1 -1
- package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js.map +1 -1
- package/dist/config/app.config.d.ts +38 -0
- package/dist/config/app.config.d.ts.map +1 -1
- package/dist/config/app.config.js +24 -0
- package/dist/config/app.config.js.map +1 -1
- package/dist/config/database.config.d.ts +6 -0
- package/dist/config/database.config.d.ts.map +1 -1
- package/dist/config/database.config.js +3 -0
- package/dist/config/database.config.js.map +1 -1
- package/dist/config/env-flags.util.d.ts +4 -0
- package/dist/config/env-flags.util.d.ts.map +1 -1
- package/dist/config/env-flags.util.js +7 -0
- package/dist/config/env-flags.util.js.map +1 -1
- package/dist/config/env.validation.d.ts +24 -1
- package/dist/config/env.validation.d.ts.map +1 -1
- package/dist/config/env.validation.js +92 -2
- package/dist/config/env.validation.js.map +1 -1
- package/dist/config/in-memory-redis.client.d.ts +23 -4
- package/dist/config/in-memory-redis.client.d.ts.map +1 -1
- package/dist/config/in-memory-redis.client.js +148 -4
- package/dist/config/in-memory-redis.client.js.map +1 -1
- package/dist/config/redis.module.d.ts.map +1 -1
- package/dist/config/redis.module.js +5 -0
- package/dist/config/redis.module.js.map +1 -1
- package/dist/core.module.d.ts +5 -0
- package/dist/core.module.d.ts.map +1 -1
- package/dist/core.module.js +5 -0
- package/dist/core.module.js.map +1 -1
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts +7 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.d.ts.map +1 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.js +24 -0
- package/dist/database/migrations/1785006199371-auth-mfa-oauth.js.map +1 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts +7 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js +16 -0
- package/dist/database/migrations/1785006199372-auth-mfa-backup-codes.js.map +1 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts +7 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.js +14 -0
- package/dist/database/migrations/1785006199373-auth-gap-fixes.js.map +1 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts +13 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.js +35 -0
- package/dist/database/migrations/1785006199374-auth-sessions-indexes.js.map +1 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts +11 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.d.ts.map +1 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.js +60 -0
- package/dist/database/migrations/1785006199375-auth-identity-and-audit.js.map +1 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts +14 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.d.ts.map +1 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js +39 -0
- package/dist/database/migrations/1785006199376-auth-settings-security-defaults.js.map +1 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts +13 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.js +69 -0
- package/dist/database/migrations/1785006199377-auth-security-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts +11 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js +51 -0
- package/dist/database/migrations/1785006199378-auth-family-denylist-and-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts +12 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js +37 -0
- package/dist/database/migrations/1785006199379-authz-lifecycle-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts +12 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.d.ts.map +1 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.js +74 -0
- package/dist/database/migrations/1785006199380-auth-remaining-gaps.js.map +1 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts +12 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.d.ts.map +1 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.js +52 -0
- package/dist/database/migrations/1785006199381-settings-blast-radius.js.map +1 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts +11 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js +36 -0
- package/dist/database/migrations/1785006199382-oauth-client-ids-lock.js.map +1 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts +12 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js +39 -0
- package/dist/database/migrations/1785006199383-settings-role-and-verified-lock.js.map +1 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts +12 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js +39 -0
- package/dist/database/migrations/1785006199384-settings-providers-and-test-otp-lock.js.map +1 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts +13 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.d.ts.map +1 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js +72 -0
- package/dist/database/migrations/1785006199385-settings-auth-surface-lock.js.map +1 -0
- package/dist/database/migrations/1785006199386-audit-events.d.ts +10 -0
- package/dist/database/migrations/1785006199386-audit-events.d.ts.map +1 -0
- package/dist/database/migrations/1785006199386-audit-events.js +60 -0
- package/dist/database/migrations/1785006199386-audit-events.js.map +1 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts +10 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.d.ts.map +1 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js +25 -0
- package/dist/database/migrations/1785006199387-audit-resource-id-varchar.js.map +1 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.d.ts +11 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.d.ts.map +1 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.js +157 -0
- package/dist/database/migrations/1785006199388-audit-enterprise.js.map +1 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts +10 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.d.ts.map +1 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.js +38 -0
- package/dist/database/migrations/1785006199389-drop-admin-logs.js.map +1 -0
- package/dist/database/migrations/1785006199390-audit-hardening.d.ts +14 -0
- package/dist/database/migrations/1785006199390-audit-hardening.d.ts.map +1 -0
- package/dist/database/migrations/1785006199390-audit-hardening.js +345 -0
- package/dist/database/migrations/1785006199390-audit-hardening.js.map +1 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts +10 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.d.ts.map +1 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.js +39 -0
- package/dist/database/migrations/1785006199391-audit-owner-schema-create.js.map +1 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.d.ts +11 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.d.ts.map +1 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.js +33 -0
- package/dist/database/migrations/1785006199392-profile-photo-url.js.map +1 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.d.ts +11 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.d.ts.map +1 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.js +33 -0
- package/dist/database/migrations/1785006199393-profile-cover-url.js.map +1 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts +11 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.d.ts.map +1 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.js +24 -0
- package/dist/database/migrations/1785006199394-profile-is-public-default-false.js.map +1 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts +10 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.d.ts.map +1 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.js +35 -0
- package/dist/database/migrations/1785006199395-delivery-scale-indexes.js.map +1 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts +11 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.d.ts.map +1 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.js +23 -0
- package/dist/database/migrations/1785006199396-delivery-recipient-index.js.map +1 -0
- package/dist/database/seeds/roles.seed.d.ts +6 -0
- package/dist/database/seeds/roles.seed.d.ts.map +1 -1
- package/dist/database/seeds/roles.seed.js +22 -5
- package/dist/database/seeds/roles.seed.js.map +1 -1
- package/dist/database/seeds/settings.seed.d.ts +5 -0
- package/dist/database/seeds/settings.seed.d.ts.map +1 -1
- package/dist/database/seeds/settings.seed.js +500 -25
- package/dist/database/seeds/settings.seed.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.d.ts +1 -0
- package/dist/database/seeds/templates/html-template.reader.d.ts.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.js +3 -1
- package/dist/database/seeds/templates/html-template.reader.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.ts +5 -1
- package/dist/database/typeorm.util.d.ts.map +1 -1
- package/dist/database/typeorm.util.js +6 -0
- package/dist/database/typeorm.util.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -4
- package/dist/index.js.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.d.ts +15 -7
- package/dist/modules/admin/controllers/admin.controller.d.ts.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.js +74 -17
- package/dist/modules/admin/controllers/admin.controller.js.map +1 -1
- package/dist/modules/admin/services/admin-log.service.d.ts +14 -7
- package/dist/modules/admin/services/admin-log.service.d.ts.map +1 -1
- package/dist/modules/admin/services/admin-log.service.js +41 -38
- package/dist/modules/admin/services/admin-log.service.js.map +1 -1
- package/dist/modules/audit/audit.manifest.d.ts +8 -0
- package/dist/modules/audit/audit.manifest.d.ts.map +1 -0
- package/dist/modules/audit/audit.manifest.js +31 -0
- package/dist/modules/audit/audit.manifest.js.map +1 -0
- package/dist/modules/audit/audit.module.d.ts +8 -0
- package/dist/modules/audit/audit.module.d.ts.map +1 -0
- package/dist/modules/audit/audit.module.js +57 -0
- package/dist/modules/audit/audit.module.js.map +1 -0
- package/dist/modules/audit/constants/audit-actions.d.ts +79 -0
- package/dist/modules/audit/constants/audit-actions.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-actions.js +89 -0
- package/dist/modules/audit/constants/audit-actions.js.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts +10 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.js +13 -0
- package/dist/modules/audit/constants/audit-mutation.js.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts +13 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.js +149 -0
- package/dist/modules/audit/controllers/audit.controller.js.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts +27 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.js +18 -0
- package/dist/modules/audit/decorators/audit.decorator.js.map +1 -0
- package/dist/modules/audit/dto/audit.dto.d.ts +54 -0
- package/dist/modules/audit/dto/audit.dto.d.ts.map +1 -0
- package/dist/modules/audit/dto/audit.dto.js +129 -0
- package/dist/modules/audit/dto/audit.dto.js.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts +33 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.js +125 -0
- package/dist/modules/audit/entities/audit-event.entity.js.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts +16 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js +65 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js.map +1 -0
- package/dist/modules/audit/index.d.ts +13 -0
- package/dist/modules/audit/index.d.ts.map +1 -0
- package/dist/modules/audit/index.js +23 -0
- package/dist/modules/audit/index.js.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts +11 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js +75 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts +31 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js +338 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.js +132 -0
- package/dist/modules/audit/services/audit-archive.service.js.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts +22 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js +79 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.js +99 -0
- package/dist/modules/audit/services/audit-leader.service.js.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts +29 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.js +144 -0
- package/dist/modules/audit/services/audit-outbox.worker.js.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts +18 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.js +70 -0
- package/dist/modules/audit/services/audit-partition.service.js.map +1 -0
- package/dist/modules/audit/services/audit-write.service.d.ts +60 -0
- package/dist/modules/audit/services/audit-write.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-write.service.js +463 -0
- package/dist/modules/audit/services/audit-write.service.js.map +1 -0
- package/dist/modules/audit/services/audit.service.d.ts +60 -0
- package/dist/modules/audit/services/audit.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit.service.js +373 -0
- package/dist/modules/audit/services/audit.service.js.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts +20 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.js +44 -0
- package/dist/modules/audit/utils/audit-hash.util.js.map +1 -0
- package/dist/modules/auth/auth-core/auth-core.module.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/auth-core.module.js +16 -4
- package/dist/modules/auth/auth-core/auth-core.module.js.map +1 -1
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts +22 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js +25 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts +19 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js +110 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts +7 -8
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js +34 -34
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js.map +1 -1
- package/dist/modules/auth/auth.manifest.d.ts +6 -0
- package/dist/modules/auth/auth.manifest.d.ts.map +1 -1
- package/dist/modules/auth/auth.manifest.js +38 -2
- package/dist/modules/auth/auth.manifest.js.map +1 -1
- package/dist/modules/auth/auth.module.d.ts.map +1 -1
- package/dist/modules/auth/auth.module.js +39 -4
- package/dist/modules/auth/auth.module.js.map +1 -1
- package/dist/modules/auth/controllers/account.controller.d.ts +15 -1
- package/dist/modules/auth/controllers/account.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/account.controller.js +65 -7
- package/dist/modules/auth/controllers/account.controller.js.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.d.ts +7 -3
- package/dist/modules/auth/controllers/auth.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.js +76 -16
- package/dist/modules/auth/controllers/auth.controller.js.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts +4 -2
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.js +32 -11
- package/dist/modules/auth/controllers/forgot-password.controller.js.map +1 -1
- package/dist/modules/auth/controllers/mfa.controller.d.ts +18 -0
- package/dist/modules/auth/controllers/mfa.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/mfa.controller.js +192 -0
- package/dist/modules/auth/controllers/mfa.controller.js.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts +22 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.js +192 -0
- package/dist/modules/auth/controllers/oauth.controller.js.map +1 -0
- package/dist/modules/auth/controllers/otp.controller.d.ts +6 -3
- package/dist/modules/auth/controllers/otp.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/otp.controller.js +32 -33
- package/dist/modules/auth/controllers/otp.controller.js.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.js +10 -2
- package/dist/modules/auth/controllers/pin.controller.js.map +1 -1
- package/dist/modules/auth/controllers/session.controller.d.ts +12 -4
- package/dist/modules/auth/controllers/session.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/session.controller.js +130 -31
- package/dist/modules/auth/controllers/session.controller.js.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.d.ts +11 -2
- package/dist/modules/auth/dto/auth-config.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.js +78 -3
- package/dist/modules/auth/dto/auth-config.dto.js.map +1 -1
- package/dist/modules/auth/dto/index.d.ts +2 -0
- package/dist/modules/auth/dto/index.d.ts.map +1 -1
- package/dist/modules/auth/dto/index.js +2 -0
- package/dist/modules/auth/dto/index.js.map +1 -1
- package/dist/modules/auth/dto/login.dto.d.ts +8 -1
- package/dist/modules/auth/dto/login.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/login.dto.js +48 -3
- package/dist/modules/auth/dto/login.dto.js.map +1 -1
- package/dist/modules/auth/dto/mfa.dto.d.ts +61 -0
- package/dist/modules/auth/dto/mfa.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/mfa.dto.js +326 -0
- package/dist/modules/auth/dto/mfa.dto.js.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts +45 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.js +249 -0
- package/dist/modules/auth/dto/oauth.dto.js.map +1 -0
- package/dist/modules/auth/dto/otp.dto.d.ts +3 -1
- package/dist/modules/auth/dto/otp.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/otp.dto.js +19 -0
- package/dist/modules/auth/dto/otp.dto.js.map +1 -1
- package/dist/modules/auth/dto/password.dto.d.ts +28 -0
- package/dist/modules/auth/dto/password.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/password.dto.js +191 -5
- package/dist/modules/auth/dto/password.dto.js.map +1 -1
- package/dist/modules/auth/dto/register.dto.d.ts +1 -0
- package/dist/modules/auth/dto/register.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/register.dto.js +1 -0
- package/dist/modules/auth/dto/register.dto.js.map +1 -1
- package/dist/modules/auth/dto/session.dto.d.ts +20 -0
- package/dist/modules/auth/dto/session.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/session.dto.js +98 -0
- package/dist/modules/auth/dto/session.dto.js.map +1 -0
- package/dist/modules/auth/dto/token.dto.d.ts +38 -1
- package/dist/modules/auth/dto/token.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/token.dto.js +21 -1
- package/dist/modules/auth/dto/token.dto.js.map +1 -1
- package/dist/modules/auth/entities/index.d.ts +2 -0
- package/dist/modules/auth/entities/index.d.ts.map +1 -1
- package/dist/modules/auth/entities/index.js +2 -0
- package/dist/modules/auth/entities/index.js.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts +2 -0
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.js +6 -0
- package/dist/modules/auth/entities/password-reset-token.entity.js.map +1 -1
- package/dist/modules/auth/entities/user-mfa.entity.d.ts +19 -0
- package/dist/modules/auth/entities/user-mfa.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-mfa.entity.js +73 -0
- package/dist/modules/auth/entities/user-mfa.entity.js.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts +24 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js +84 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js.map +1 -0
- package/dist/modules/auth/events/auth.events.d.ts +84 -19
- package/dist/modules/auth/events/auth.events.d.ts.map +1 -1
- package/dist/modules/auth/events/auth.events.js +17 -9
- package/dist/modules/auth/events/auth.events.js.map +1 -1
- package/dist/modules/auth/services/account.service.d.ts +74 -14
- package/dist/modules/auth/services/account.service.d.ts.map +1 -1
- package/dist/modules/auth/services/account.service.js +247 -31
- package/dist/modules/auth/services/account.service.js.map +1 -1
- package/dist/modules/auth/services/dpop.service.d.ts +41 -0
- package/dist/modules/auth/services/dpop.service.d.ts.map +1 -0
- package/dist/modules/auth/services/dpop.service.js +159 -0
- package/dist/modules/auth/services/dpop.service.js.map +1 -0
- package/dist/modules/auth/services/index.d.ts +2 -0
- package/dist/modules/auth/services/index.d.ts.map +1 -1
- package/dist/modules/auth/services/index.js +2 -0
- package/dist/modules/auth/services/index.js.map +1 -1
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts +28 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts.map +1 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js +163 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js.map +1 -0
- package/dist/modules/auth/services/login.service.d.ts +29 -34
- package/dist/modules/auth/services/login.service.d.ts.map +1 -1
- package/dist/modules/auth/services/login.service.js +173 -61
- package/dist/modules/auth/services/login.service.js.map +1 -1
- package/dist/modules/auth/services/mfa.service.d.ts +111 -0
- package/dist/modules/auth/services/mfa.service.d.ts.map +1 -0
- package/dist/modules/auth/services/mfa.service.js +662 -0
- package/dist/modules/auth/services/mfa.service.js.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js +56 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts +12 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js +64 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js +76 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts +16 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js +92 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts +9 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js +3 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js.map +1 -0
- package/dist/modules/auth/services/oauth.service.d.ts +83 -0
- package/dist/modules/auth/services/oauth.service.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth.service.js +471 -0
- package/dist/modules/auth/services/oauth.service.js.map +1 -0
- package/dist/modules/auth/services/otp-auth.service.d.ts +13 -3
- package/dist/modules/auth/services/otp-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/otp-auth.service.js +41 -7
- package/dist/modules/auth/services/otp-auth.service.js.map +1 -1
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts +22 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts.map +1 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js +117 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js.map +1 -0
- package/dist/modules/auth/services/password.service.d.ts +25 -5
- package/dist/modules/auth/services/password.service.d.ts.map +1 -1
- package/dist/modules/auth/services/password.service.js +154 -20
- package/dist/modules/auth/services/password.service.js.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.d.ts +10 -3
- package/dist/modules/auth/services/pin-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.js +110 -13
- package/dist/modules/auth/services/pin-auth.service.js.map +1 -1
- package/dist/modules/auth/services/registration.service.d.ts +10 -2
- package/dist/modules/auth/services/registration.service.d.ts.map +1 -1
- package/dist/modules/auth/services/registration.service.js +113 -25
- package/dist/modules/auth/services/registration.service.js.map +1 -1
- package/dist/modules/auth/services/turnstile.service.d.ts +17 -0
- package/dist/modules/auth/services/turnstile.service.d.ts.map +1 -0
- package/dist/modules/auth/services/turnstile.service.js +94 -0
- package/dist/modules/auth/services/turnstile.service.js.map +1 -0
- package/dist/modules/auth/utils/auth-params.util.d.ts +13 -6
- package/dist/modules/auth/utils/auth-params.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-params.util.js +27 -4
- package/dist/modules/auth/utils/auth-params.util.js.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts +12 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.js +36 -4
- package/dist/modules/auth/utils/auth-supported.util.js.map +1 -1
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts +10 -0
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js +31 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts +5 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.js +22 -0
- package/dist/modules/auth/utils/backup-codes.util.js.map +1 -0
- package/dist/modules/auth/utils/dpop.util.d.ts +22 -0
- package/dist/modules/auth/utils/dpop.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/dpop.util.js +73 -0
- package/dist/modules/auth/utils/dpop.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts +22 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.js +59 -0
- package/dist/modules/auth/utils/mfa-secret.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts +26 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js +49 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts +5 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js +18 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js.map +1 -0
- package/dist/modules/auth/utils/totp.util.d.ts +16 -0
- package/dist/modules/auth/utils/totp.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/totp.util.js +88 -0
- package/dist/modules/auth/utils/totp.util.js.map +1 -0
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts +28 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts.map +1 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.js +48 -2
- package/dist/modules/delivery/composers/otp-delivery.composer.js.map +1 -1
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts +29 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts.map +1 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js +51 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js.map +1 -0
- package/dist/modules/delivery/delivery.module.d.ts.map +1 -1
- package/dist/modules/delivery/delivery.module.js +1 -15
- package/dist/modules/delivery/delivery.module.js.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.d.ts.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js +3 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts +12 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.js +121 -40
- package/dist/modules/delivery/notification-delivery.service.js.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts +22 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.js +144 -42
- package/dist/modules/delivery/processors/delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/delivery.processor.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts +11 -0
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js +90 -16
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts +7 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.js +11 -2
- package/dist/modules/delivery/queues/sync-jobs.queue.js.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts +7 -3
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.js +33 -10
- package/dist/modules/delivery/services/delivery-audit-retention.service.js.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.d.ts +7 -4
- package/dist/modules/delivery/services/notification-audit.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.js +83 -26
- package/dist/modules/delivery/services/notification-audit.service.js.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts +2 -0
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.js +22 -3
- package/dist/modules/delivery/utils/payload-snapshot.util.js.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts +7 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.js +5 -7
- package/dist/modules/file-upload/controllers/file-upload.controller.js.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts +2 -0
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.js +20 -0
- package/dist/modules/file-upload/dto/file-upload.dto.js.map +1 -1
- package/dist/modules/file-upload/file-upload.module.d.ts.map +1 -1
- package/dist/modules/file-upload/file-upload.module.js +12 -2
- package/dist/modules/file-upload/file-upload.module.js.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.d.ts +24 -6
- package/dist/modules/file-upload/services/file-upload.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.js +164 -36
- package/dist/modules/file-upload/services/file-upload.service.js.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts +4 -2
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js +30 -5
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.d.ts.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js +7 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js.map +1 -1
- package/dist/modules/health/health.controller.d.ts +5 -1
- package/dist/modules/health/health.controller.d.ts.map +1 -1
- package/dist/modules/health/health.controller.js +57 -3
- package/dist/modules/health/health.controller.js.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.d.ts +19 -4
- package/dist/modules/invitations/controllers/invitations.controller.d.ts.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.js +19 -10
- package/dist/modules/invitations/controllers/invitations.controller.js.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.d.ts +13 -0
- package/dist/modules/invitations/dto/invitation.dto.d.ts.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.js +69 -2
- package/dist/modules/invitations/dto/invitation.dto.js.map +1 -1
- package/dist/modules/invitations/services/invitations.service.d.ts +24 -6
- package/dist/modules/invitations/services/invitations.service.d.ts.map +1 -1
- package/dist/modules/invitations/services/invitations.service.js +96 -20
- package/dist/modules/invitations/services/invitations.service.js.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.d.ts +7 -2
- package/dist/modules/jobs/queues/jobs.queue.d.ts.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.js +25 -10
- package/dist/modules/jobs/queues/jobs.queue.js.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts +3 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.js +25 -2
- package/dist/modules/notifications/controllers/notifications.controller.js.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.d.ts.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.js +1 -0
- package/dist/modules/notifications/dto/notification-query.dto.js.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.d.ts.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.js +3 -1
- package/dist/modules/notifications/entities/device-token.entity.js.map +1 -1
- package/dist/modules/notifications/services/fcm.service.d.ts +2 -0
- package/dist/modules/notifications/services/fcm.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/fcm.service.js +28 -7
- package/dist/modules/notifications/services/fcm.service.js.map +1 -1
- package/dist/modules/notifications/services/notifications.service.d.ts +16 -3
- package/dist/modules/notifications/services/notifications.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/notifications.service.js +95 -24
- package/dist/modules/notifications/services/notifications.service.js.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.d.ts +2 -0
- package/dist/modules/observability/metrics/metrics.service.d.ts.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.js +11 -0
- package/dist/modules/observability/metrics/metrics.service.js.map +1 -1
- package/dist/modules/otp/constants/otp.constants.d.ts +7 -5
- package/dist/modules/otp/constants/otp.constants.d.ts.map +1 -1
- package/dist/modules/otp/constants/otp.constants.js +11 -8
- package/dist/modules/otp/constants/otp.constants.js.map +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.d.ts +10 -2
- package/dist/modules/otp/otp.service.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.js +48 -4
- package/dist/modules/otp/otp.service.js.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.d.ts +2 -0
- package/dist/modules/otp/services/otp.rate-limiter.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.js +19 -0
- package/dist/modules/otp/services/otp.rate-limiter.js.map +1 -1
- package/dist/modules/otp/services/otp.session.store.d.ts +9 -3
- package/dist/modules/otp/services/otp.session.store.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.session.store.js +34 -42
- package/dist/modules/otp/services/otp.session.store.js.map +1 -1
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts +11 -0
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts.map +1 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js +68 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js.map +1 -0
- package/dist/modules/profile/controllers/profile.controller.d.ts +9 -3
- package/dist/modules/profile/controllers/profile.controller.d.ts.map +1 -1
- package/dist/modules/profile/controllers/profile.controller.js +140 -8
- package/dist/modules/profile/controllers/profile.controller.js.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts +10 -0
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js +43 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js.map +1 -1
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts +24 -0
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js +115 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js.map +1 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/user-profile-response.dto.js +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.js.map +1 -1
- package/dist/modules/profile/dto/username-available.dto.d.ts +6 -0
- package/dist/modules/profile/dto/username-available.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/username-available.dto.js +31 -0
- package/dist/modules/profile/dto/username-available.dto.js.map +1 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts +10 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts.map +1 -1
- package/dist/modules/profile/entities/user-profiles.entity.js +29 -1
- package/dist/modules/profile/entities/user-profiles.entity.js.map +1 -1
- package/dist/modules/profile/index.d.ts +1 -0
- package/dist/modules/profile/index.d.ts.map +1 -1
- package/dist/modules/profile/index.js +1 -0
- package/dist/modules/profile/index.js.map +1 -1
- package/dist/modules/profile/profile.manifest.d.ts +2 -2
- package/dist/modules/profile/profile.manifest.js +2 -2
- package/dist/modules/profile/profile.manifest.js.map +1 -1
- package/dist/modules/profile/profile.module.d.ts.map +1 -1
- package/dist/modules/profile/profile.module.js +7 -2
- package/dist/modules/profile/profile.module.js.map +1 -1
- package/dist/modules/profile/services/profile.service.d.ts +56 -4
- package/dist/modules/profile/services/profile.service.d.ts.map +1 -1
- package/dist/modules/profile/services/profile.service.js +247 -20
- package/dist/modules/profile/services/profile.service.js.map +1 -1
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts +26 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts.map +1 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js +124 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts +36 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.js +42 -0
- package/dist/modules/realtime/constants/realtime.constants.js.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts +21 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.js +113 -0
- package/dist/modules/realtime/controllers/realtime.controller.js.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts +42 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js +289 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js.map +1 -0
- package/dist/modules/realtime/index.d.ts +12 -0
- package/dist/modules/realtime/index.d.ts.map +1 -0
- package/dist/modules/realtime/index.js +35 -0
- package/dist/modules/realtime/index.js.map +1 -0
- package/dist/modules/realtime/realtime.manifest.d.ts +8 -0
- package/dist/modules/realtime/realtime.manifest.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.manifest.js +31 -0
- package/dist/modules/realtime/realtime.manifest.js.map +1 -0
- package/dist/modules/realtime/realtime.module.d.ts +14 -0
- package/dist/modules/realtime/realtime.module.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.module.js +126 -0
- package/dist/modules/realtime/realtime.module.js.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts +16 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js +55 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts +15 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.js +86 -0
- package/dist/modules/realtime/services/realtime-presence.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts +12 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js +63 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime.service.d.ts +88 -0
- package/dist/modules/realtime/services/realtime.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime.service.js +343 -0
- package/dist/modules/realtime/services/realtime.service.js.map +1 -0
- package/dist/modules/realtime/types/realtime.types.d.ts +50 -0
- package/dist/modules/realtime/types/realtime.types.d.ts.map +1 -0
- package/dist/modules/realtime/types/realtime.types.js +14 -0
- package/dist/modules/realtime/types/realtime.types.js.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts +5 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.js +45 -0
- package/dist/modules/realtime/utils/handshake-error.util.js.map +1 -0
- package/dist/modules/roles/controllers/modules.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/modules.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/modules.controller.js +21 -10
- package/dist/modules/roles/controllers/modules.controller.js.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/permissions.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.js +21 -10
- package/dist/modules/roles/controllers/permissions.controller.js.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.d.ts +5 -4
- package/dist/modules/roles/controllers/roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.js +26 -13
- package/dist/modules/roles/controllers/roles.controller.js.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.d.ts +3 -2
- package/dist/modules/roles/controllers/user-roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.js +14 -6
- package/dist/modules/roles/controllers/user-roles.controller.js.map +1 -1
- package/dist/modules/roles/services/modules.service.d.ts +8 -5
- package/dist/modules/roles/services/modules.service.d.ts.map +1 -1
- package/dist/modules/roles/services/modules.service.js +58 -12
- package/dist/modules/roles/services/modules.service.js.map +1 -1
- package/dist/modules/roles/services/permissions.service.d.ts +8 -5
- package/dist/modules/roles/services/permissions.service.d.ts.map +1 -1
- package/dist/modules/roles/services/permissions.service.js +61 -12
- package/dist/modules/roles/services/permissions.service.js.map +1 -1
- package/dist/modules/roles/services/roles.service.d.ts +19 -9
- package/dist/modules/roles/services/roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/roles.service.js +137 -47
- package/dist/modules/roles/services/roles.service.js.map +1 -1
- package/dist/modules/roles/services/user-roles.service.d.ts +12 -4
- package/dist/modules/roles/services/user-roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/user-roles.service.js +58 -26
- package/dist/modules/roles/services/user-roles.service.js.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts +7 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.js +10 -0
- package/dist/modules/sessions/entities/refresh-token.entity.js.map +1 -1
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts +12 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts.map +1 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js +46 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts +20 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js +97 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js.map +1 -0
- package/dist/modules/sessions/services/token.service.d.ts +150 -16
- package/dist/modules/sessions/services/token.service.d.ts.map +1 -1
- package/dist/modules/sessions/services/token.service.js +505 -74
- package/dist/modules/sessions/services/token.service.js.map +1 -1
- package/dist/modules/sessions/sessions.module.d.ts.map +1 -1
- package/dist/modules/sessions/sessions.module.js +4 -2
- package/dist/modules/sessions/sessions.module.js.map +1 -1
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts +13 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts.map +1 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js +37 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js.map +1 -0
- package/dist/modules/settings/constants/settings.defaults.d.ts +57 -3
- package/dist/modules/settings/constants/settings.defaults.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.defaults.js +58 -3
- package/dist/modules/settings/constants/settings.defaults.js.map +1 -1
- package/dist/modules/settings/constants/settings.keys.d.ts +138 -2
- package/dist/modules/settings/constants/settings.keys.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.keys.js +140 -2
- package/dist/modules/settings/constants/settings.keys.js.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts +5 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.js +134 -5
- package/dist/modules/settings/controllers/settings.controller.js.map +1 -1
- package/dist/modules/settings/services/settings.service.d.ts +17 -7
- package/dist/modules/settings/services/settings.service.d.ts.map +1 -1
- package/dist/modules/settings/services/settings.service.js +80 -14
- package/dist/modules/settings/services/settings.service.js.map +1 -1
- package/dist/modules/settings/utils/settings-secret.util.d.ts +13 -0
- package/dist/modules/settings/utils/settings-secret.util.d.ts.map +1 -0
- package/dist/modules/settings/utils/settings-secret.util.js +80 -0
- package/dist/modules/settings/utils/settings-secret.util.js.map +1 -0
- package/dist/modules/users/controllers/users.controller.d.ts +4 -2
- package/dist/modules/users/controllers/users.controller.d.ts.map +1 -1
- package/dist/modules/users/controllers/users.controller.js +89 -10
- package/dist/modules/users/controllers/users.controller.js.map +1 -1
- package/dist/modules/users/dto/user.dto.d.ts +5 -0
- package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
- package/dist/modules/users/dto/user.dto.js +46 -5
- package/dist/modules/users/dto/user.dto.js.map +1 -1
- package/dist/modules/users/entities/user.entity.d.ts +7 -1
- package/dist/modules/users/entities/user.entity.d.ts.map +1 -1
- package/dist/modules/users/entities/user.entity.js +10 -0
- package/dist/modules/users/entities/user.entity.js.map +1 -1
- package/dist/modules/users/services/users.service.d.ts +15 -2
- package/dist/modules/users/services/users.service.d.ts.map +1 -1
- package/dist/modules/users/services/users.service.js +152 -37
- package/dist/modules/users/services/users.service.js.map +1 -1
- package/dist/modules/users/users.module.d.ts.map +1 -1
- package/dist/modules/users/users.module.js +1 -2
- package/dist/modules/users/users.module.js.map +1 -1
- package/package.json +19 -7
- package/dist/modules/admin/entities/admin-log.entity.d.ts +0 -20
- package/dist/modules/admin/entities/admin-log.entity.d.ts.map +0 -1
- package/dist/modules/admin/entities/admin-log.entity.js +0 -65
- package/dist/modules/admin/entities/admin-log.entity.js.map +0 -1
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuditHardening1785006199390 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Close remaining enterprise audit gaps:
|
|
6
|
+
* - range-partition audit_events by created_at
|
|
7
|
+
* - SECURITY DEFINER legal_hold / purge / seal / partition helpers
|
|
8
|
+
* - ownership split + REVOKE UPDATE/DELETE when privileges allow
|
|
9
|
+
* - extend immutability trigger for hash seal backfill
|
|
10
|
+
*/
|
|
11
|
+
class AuditHardening1785006199390 {
|
|
12
|
+
name = 'AuditHardening1785006199390';
|
|
13
|
+
async up(queryRunner) {
|
|
14
|
+
await queryRunner.query(`
|
|
15
|
+
CREATE OR REPLACE FUNCTION audit_events_immutable_guard()
|
|
16
|
+
RETURNS trigger
|
|
17
|
+
LANGUAGE plpgsql
|
|
18
|
+
AS $$
|
|
19
|
+
DECLARE
|
|
20
|
+
mode text := current_setting('app.audit_mutation', true);
|
|
21
|
+
BEGIN
|
|
22
|
+
IF TG_OP = 'DELETE' THEN
|
|
23
|
+
IF mode = 'purge' THEN
|
|
24
|
+
RETURN OLD;
|
|
25
|
+
END IF;
|
|
26
|
+
RAISE EXCEPTION 'audit_events is append-only (DELETE denied)';
|
|
27
|
+
END IF;
|
|
28
|
+
|
|
29
|
+
IF TG_OP = 'UPDATE' THEN
|
|
30
|
+
IF mode = 'legal_hold' THEN
|
|
31
|
+
IF NEW.id IS DISTINCT FROM OLD.id
|
|
32
|
+
OR NEW.created_at IS DISTINCT FROM OLD.created_at
|
|
33
|
+
OR NEW.actor_type IS DISTINCT FROM OLD.actor_type
|
|
34
|
+
OR NEW.actor_id IS DISTINCT FROM OLD.actor_id
|
|
35
|
+
OR NEW.action IS DISTINCT FROM OLD.action
|
|
36
|
+
OR NEW.resource_type IS DISTINCT FROM OLD.resource_type
|
|
37
|
+
OR NEW.resource_id IS DISTINCT FROM OLD.resource_id
|
|
38
|
+
OR NEW.status IS DISTINCT FROM OLD.status
|
|
39
|
+
OR NEW.metadata IS DISTINCT FROM OLD.metadata
|
|
40
|
+
OR NEW.ip_address IS DISTINCT FROM OLD.ip_address
|
|
41
|
+
OR NEW.device_info IS DISTINCT FROM OLD.device_info
|
|
42
|
+
OR NEW.request_id IS DISTINCT FROM OLD.request_id
|
|
43
|
+
OR NEW.correlation_id IS DISTINCT FROM OLD.correlation_id
|
|
44
|
+
OR NEW.trace_id IS DISTINCT FROM OLD.trace_id
|
|
45
|
+
OR NEW.chain_seq IS DISTINCT FROM OLD.chain_seq
|
|
46
|
+
OR NEW.event_hash IS DISTINCT FROM OLD.event_hash
|
|
47
|
+
OR NEW.prev_hash IS DISTINCT FROM OLD.prev_hash
|
|
48
|
+
THEN
|
|
49
|
+
RAISE EXCEPTION 'audit_events legal_hold mode may only toggle legal_hold';
|
|
50
|
+
END IF;
|
|
51
|
+
RETURN NEW;
|
|
52
|
+
END IF;
|
|
53
|
+
|
|
54
|
+
IF mode = 'seal' THEN
|
|
55
|
+
IF OLD.event_hash IS NOT NULL THEN
|
|
56
|
+
RAISE EXCEPTION 'audit_events seal mode only allowed when event_hash is null';
|
|
57
|
+
END IF;
|
|
58
|
+
IF NEW.id IS DISTINCT FROM OLD.id
|
|
59
|
+
OR NEW.created_at IS DISTINCT FROM OLD.created_at
|
|
60
|
+
OR NEW.actor_type IS DISTINCT FROM OLD.actor_type
|
|
61
|
+
OR NEW.actor_id IS DISTINCT FROM OLD.actor_id
|
|
62
|
+
OR NEW.action IS DISTINCT FROM OLD.action
|
|
63
|
+
OR NEW.resource_type IS DISTINCT FROM OLD.resource_type
|
|
64
|
+
OR NEW.resource_id IS DISTINCT FROM OLD.resource_id
|
|
65
|
+
OR NEW.status IS DISTINCT FROM OLD.status
|
|
66
|
+
OR NEW.metadata IS DISTINCT FROM OLD.metadata
|
|
67
|
+
OR NEW.ip_address IS DISTINCT FROM OLD.ip_address
|
|
68
|
+
OR NEW.device_info IS DISTINCT FROM OLD.device_info
|
|
69
|
+
OR NEW.request_id IS DISTINCT FROM OLD.request_id
|
|
70
|
+
OR NEW.correlation_id IS DISTINCT FROM OLD.correlation_id
|
|
71
|
+
OR NEW.trace_id IS DISTINCT FROM OLD.trace_id
|
|
72
|
+
OR NEW.chain_seq IS DISTINCT FROM OLD.chain_seq
|
|
73
|
+
OR NEW.legal_hold IS DISTINCT FROM OLD.legal_hold
|
|
74
|
+
THEN
|
|
75
|
+
RAISE EXCEPTION 'audit_events seal mode may only set event_hash/prev_hash';
|
|
76
|
+
END IF;
|
|
77
|
+
RETURN NEW;
|
|
78
|
+
END IF;
|
|
79
|
+
|
|
80
|
+
RAISE EXCEPTION 'audit_events is append-only (UPDATE denied)';
|
|
81
|
+
END IF;
|
|
82
|
+
|
|
83
|
+
RETURN NEW;
|
|
84
|
+
END;
|
|
85
|
+
$$
|
|
86
|
+
`);
|
|
87
|
+
// Drop helpers before rename so RETURN SETOF does not pin the old type.
|
|
88
|
+
await queryRunner.query(`DROP FUNCTION IF EXISTS audit_set_legal_hold(uuid, boolean)`);
|
|
89
|
+
await queryRunner.query(`DROP FUNCTION IF EXISTS audit_purge_ids(uuid[])`);
|
|
90
|
+
await queryRunner.query(`DROP FUNCTION IF EXISTS audit_seal_hashes(uuid, varchar, varchar)`);
|
|
91
|
+
await queryRunner.query(`DROP FUNCTION IF EXISTS audit_ensure_month_partition(date)`);
|
|
92
|
+
await queryRunner.query(`ALTER TABLE audit_events RENAME TO audit_events_plain`);
|
|
93
|
+
await queryRunner.query(`DROP TRIGGER IF EXISTS trg_audit_events_immutable ON audit_events_plain`);
|
|
94
|
+
await queryRunner.query(`
|
|
95
|
+
CREATE TABLE audit_events (
|
|
96
|
+
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
|
|
97
|
+
"created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
|
|
98
|
+
"actor_type" character varying(32) NOT NULL DEFAULT 'USER',
|
|
99
|
+
"actor_id" uuid,
|
|
100
|
+
"action" character varying(128) NOT NULL,
|
|
101
|
+
"resource_type" character varying(64),
|
|
102
|
+
"resource_id" character varying(128),
|
|
103
|
+
"status" character varying(16) NOT NULL DEFAULT 'SUCCESS',
|
|
104
|
+
"metadata" jsonb,
|
|
105
|
+
"ip_address" character varying(64),
|
|
106
|
+
"device_info" character varying(512),
|
|
107
|
+
"request_id" character varying(64),
|
|
108
|
+
"correlation_id" character varying(64),
|
|
109
|
+
"trace_id" character varying(64),
|
|
110
|
+
"chain_seq" bigint NOT NULL,
|
|
111
|
+
"event_hash" character varying(64),
|
|
112
|
+
"prev_hash" character varying(64),
|
|
113
|
+
"legal_hold" boolean NOT NULL DEFAULT false,
|
|
114
|
+
CONSTRAINT "PK_audit_events_id_created_at" PRIMARY KEY ("id", "created_at")
|
|
115
|
+
) PARTITION BY RANGE ("created_at")
|
|
116
|
+
`);
|
|
117
|
+
await queryRunner.query(`
|
|
118
|
+
DO $part$
|
|
119
|
+
DECLARE
|
|
120
|
+
start_month date;
|
|
121
|
+
end_month date;
|
|
122
|
+
cursor_month date;
|
|
123
|
+
part_name text;
|
|
124
|
+
from_ts timestamptz;
|
|
125
|
+
to_ts timestamptz;
|
|
126
|
+
BEGIN
|
|
127
|
+
SELECT date_trunc('month', COALESCE(MIN(created_at), now()))::date
|
|
128
|
+
INTO start_month
|
|
129
|
+
FROM audit_events_plain;
|
|
130
|
+
|
|
131
|
+
end_month := (date_trunc('month', now()) + interval '12 months')::date;
|
|
132
|
+
cursor_month := start_month;
|
|
133
|
+
|
|
134
|
+
WHILE cursor_month <= end_month LOOP
|
|
135
|
+
part_name := 'audit_events_' || to_char(cursor_month, 'YYYY_MM');
|
|
136
|
+
from_ts := cursor_month::timestamptz;
|
|
137
|
+
to_ts := (cursor_month + interval '1 month')::timestamptz;
|
|
138
|
+
EXECUTE format(
|
|
139
|
+
'CREATE TABLE IF NOT EXISTS %I PARTITION OF audit_events FOR VALUES FROM (%L) TO (%L)',
|
|
140
|
+
part_name,
|
|
141
|
+
from_ts,
|
|
142
|
+
to_ts
|
|
143
|
+
);
|
|
144
|
+
cursor_month := (cursor_month + interval '1 month')::date;
|
|
145
|
+
END LOOP;
|
|
146
|
+
|
|
147
|
+
CREATE TABLE IF NOT EXISTS audit_events_default PARTITION OF audit_events DEFAULT;
|
|
148
|
+
END
|
|
149
|
+
$part$
|
|
150
|
+
`);
|
|
151
|
+
await queryRunner.query(`
|
|
152
|
+
INSERT INTO audit_events (
|
|
153
|
+
id, created_at, actor_type, actor_id, action, resource_type, resource_id,
|
|
154
|
+
status, metadata, ip_address, device_info, request_id, correlation_id, trace_id,
|
|
155
|
+
chain_seq, event_hash, prev_hash, legal_hold
|
|
156
|
+
)
|
|
157
|
+
SELECT
|
|
158
|
+
id, created_at, actor_type, actor_id, action, resource_type, resource_id,
|
|
159
|
+
status, metadata, ip_address, device_info, request_id, correlation_id, trace_id,
|
|
160
|
+
chain_seq, event_hash, prev_hash, legal_hold
|
|
161
|
+
FROM audit_events_plain
|
|
162
|
+
`);
|
|
163
|
+
// Detach sequence before DROP so OWNED BY does not cascade-drop it.
|
|
164
|
+
await queryRunner.query(`
|
|
165
|
+
DO $seq$
|
|
166
|
+
BEGIN
|
|
167
|
+
IF EXISTS (SELECT 1 FROM pg_class WHERE relname = 'audit_events_chain_seq_seq') THEN
|
|
168
|
+
ALTER SEQUENCE audit_events_chain_seq_seq OWNED BY NONE;
|
|
169
|
+
END IF;
|
|
170
|
+
END
|
|
171
|
+
$seq$
|
|
172
|
+
`);
|
|
173
|
+
await queryRunner.query(`DROP TABLE audit_events_plain`);
|
|
174
|
+
await queryRunner.query(`
|
|
175
|
+
CREATE SEQUENCE IF NOT EXISTS audit_events_chain_seq_seq
|
|
176
|
+
`);
|
|
177
|
+
await queryRunner.query(`
|
|
178
|
+
SELECT setval(
|
|
179
|
+
'audit_events_chain_seq_seq',
|
|
180
|
+
GREATEST(COALESCE((SELECT MAX(chain_seq) FROM audit_events), 0), 1)
|
|
181
|
+
)
|
|
182
|
+
`);
|
|
183
|
+
await queryRunner.query(`
|
|
184
|
+
ALTER TABLE audit_events
|
|
185
|
+
ALTER COLUMN chain_seq SET DEFAULT nextval('audit_events_chain_seq_seq')
|
|
186
|
+
`);
|
|
187
|
+
await queryRunner.query(`ALTER SEQUENCE audit_events_chain_seq_seq OWNED BY audit_events.chain_seq`);
|
|
188
|
+
await queryRunner.query(`CREATE UNIQUE INDEX IF NOT EXISTS "UQ_audit_events_chain_seq_created"
|
|
189
|
+
ON audit_events ("chain_seq", "created_at")`);
|
|
190
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_actor_type" ON audit_events ("actor_type")`);
|
|
191
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_actor_id" ON audit_events ("actor_id")`);
|
|
192
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_action" ON audit_events ("action")`);
|
|
193
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_resource_id" ON audit_events ("resource_id")`);
|
|
194
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_created_at" ON audit_events ("created_at")`);
|
|
195
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_correlation_id" ON audit_events ("correlation_id")`);
|
|
196
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_legal_hold" ON audit_events ("legal_hold") WHERE legal_hold = true`);
|
|
197
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_created_at_brin" ON audit_events USING BRIN ("created_at")`);
|
|
198
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_audit_events_chain_seq" ON audit_events ("chain_seq")`);
|
|
199
|
+
await queryRunner.query(`
|
|
200
|
+
CREATE TRIGGER trg_audit_events_immutable
|
|
201
|
+
BEFORE UPDATE OR DELETE ON audit_events
|
|
202
|
+
FOR EACH ROW
|
|
203
|
+
EXECUTE PROCEDURE audit_events_immutable_guard()
|
|
204
|
+
`);
|
|
205
|
+
await queryRunner.query(`
|
|
206
|
+
CREATE OR REPLACE FUNCTION audit_set_legal_hold(p_id uuid, p_hold boolean)
|
|
207
|
+
RETURNS SETOF audit_events
|
|
208
|
+
LANGUAGE plpgsql
|
|
209
|
+
SECURITY DEFINER
|
|
210
|
+
SET search_path = public
|
|
211
|
+
AS $$
|
|
212
|
+
BEGIN
|
|
213
|
+
PERFORM set_config('app.audit_mutation', 'legal_hold', true);
|
|
214
|
+
RETURN QUERY
|
|
215
|
+
UPDATE audit_events
|
|
216
|
+
SET legal_hold = p_hold
|
|
217
|
+
WHERE id = p_id
|
|
218
|
+
RETURNING *;
|
|
219
|
+
END;
|
|
220
|
+
$$
|
|
221
|
+
`);
|
|
222
|
+
await queryRunner.query(`
|
|
223
|
+
CREATE OR REPLACE FUNCTION audit_purge_ids(p_ids uuid[])
|
|
224
|
+
RETURNS integer
|
|
225
|
+
LANGUAGE plpgsql
|
|
226
|
+
SECURITY DEFINER
|
|
227
|
+
SET search_path = public
|
|
228
|
+
AS $$
|
|
229
|
+
DECLARE
|
|
230
|
+
deleted integer;
|
|
231
|
+
BEGIN
|
|
232
|
+
PERFORM set_config('app.audit_mutation', 'purge', true);
|
|
233
|
+
DELETE FROM audit_events
|
|
234
|
+
WHERE id = ANY(p_ids)
|
|
235
|
+
AND legal_hold = false;
|
|
236
|
+
GET DIAGNOSTICS deleted = ROW_COUNT;
|
|
237
|
+
RETURN deleted;
|
|
238
|
+
END;
|
|
239
|
+
$$
|
|
240
|
+
`);
|
|
241
|
+
await queryRunner.query(`
|
|
242
|
+
CREATE OR REPLACE FUNCTION audit_seal_hashes(
|
|
243
|
+
p_id uuid,
|
|
244
|
+
p_event_hash varchar,
|
|
245
|
+
p_prev_hash varchar
|
|
246
|
+
)
|
|
247
|
+
RETURNS void
|
|
248
|
+
LANGUAGE plpgsql
|
|
249
|
+
SECURITY DEFINER
|
|
250
|
+
SET search_path = public
|
|
251
|
+
AS $$
|
|
252
|
+
BEGIN
|
|
253
|
+
PERFORM set_config('app.audit_mutation', 'seal', true);
|
|
254
|
+
UPDATE audit_events
|
|
255
|
+
SET event_hash = p_event_hash,
|
|
256
|
+
prev_hash = p_prev_hash
|
|
257
|
+
WHERE id = p_id
|
|
258
|
+
AND event_hash IS NULL;
|
|
259
|
+
END;
|
|
260
|
+
$$
|
|
261
|
+
`);
|
|
262
|
+
await queryRunner.query(`
|
|
263
|
+
CREATE OR REPLACE FUNCTION audit_ensure_month_partition(p_month date)
|
|
264
|
+
RETURNS void
|
|
265
|
+
LANGUAGE plpgsql
|
|
266
|
+
SECURITY DEFINER
|
|
267
|
+
SET search_path = public
|
|
268
|
+
AS $$
|
|
269
|
+
DECLARE
|
|
270
|
+
part_name text;
|
|
271
|
+
from_ts timestamptz;
|
|
272
|
+
to_ts timestamptz;
|
|
273
|
+
month_start date := date_trunc('month', p_month)::date;
|
|
274
|
+
BEGIN
|
|
275
|
+
part_name := 'audit_events_' || to_char(month_start, 'YYYY_MM');
|
|
276
|
+
from_ts := month_start::timestamptz;
|
|
277
|
+
to_ts := (month_start + interval '1 month')::timestamptz;
|
|
278
|
+
EXECUTE format(
|
|
279
|
+
'CREATE TABLE IF NOT EXISTS %I PARTITION OF audit_events FOR VALUES FROM (%L) TO (%L)',
|
|
280
|
+
part_name,
|
|
281
|
+
from_ts,
|
|
282
|
+
to_ts
|
|
283
|
+
);
|
|
284
|
+
END;
|
|
285
|
+
$$
|
|
286
|
+
`);
|
|
287
|
+
await queryRunner.query(`REVOKE ALL ON FUNCTION audit_set_legal_hold(uuid, boolean) FROM PUBLIC`);
|
|
288
|
+
await queryRunner.query(`REVOKE ALL ON FUNCTION audit_purge_ids(uuid[]) FROM PUBLIC`);
|
|
289
|
+
await queryRunner.query(`REVOKE ALL ON FUNCTION audit_seal_hashes(uuid, varchar, varchar) FROM PUBLIC`);
|
|
290
|
+
await queryRunner.query(`REVOKE ALL ON FUNCTION audit_ensure_month_partition(date) FROM PUBLIC`);
|
|
291
|
+
await queryRunner.query(`GRANT EXECUTE ON FUNCTION audit_set_legal_hold(uuid, boolean) TO CURRENT_USER`);
|
|
292
|
+
await queryRunner.query(`GRANT EXECUTE ON FUNCTION audit_purge_ids(uuid[]) TO CURRENT_USER`);
|
|
293
|
+
await queryRunner.query(`GRANT EXECUTE ON FUNCTION audit_seal_hashes(uuid, varchar, varchar) TO CURRENT_USER`);
|
|
294
|
+
await queryRunner.query(`GRANT EXECUTE ON FUNCTION audit_ensure_month_partition(date) TO CURRENT_USER`);
|
|
295
|
+
await queryRunner.query(`
|
|
296
|
+
DO $body$
|
|
297
|
+
BEGIN
|
|
298
|
+
IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'colveor_audit_owner') THEN
|
|
299
|
+
CREATE ROLE colveor_audit_owner NOLOGIN;
|
|
300
|
+
END IF;
|
|
301
|
+
|
|
302
|
+
ALTER TABLE audit_events OWNER TO colveor_audit_owner;
|
|
303
|
+
ALTER TABLE audit_outbox OWNER TO colveor_audit_owner;
|
|
304
|
+
ALTER FUNCTION audit_events_immutable_guard() OWNER TO colveor_audit_owner;
|
|
305
|
+
ALTER FUNCTION audit_set_legal_hold(uuid, boolean) OWNER TO colveor_audit_owner;
|
|
306
|
+
ALTER FUNCTION audit_purge_ids(uuid[]) OWNER TO colveor_audit_owner;
|
|
307
|
+
ALTER FUNCTION audit_seal_hashes(uuid, varchar, varchar) OWNER TO colveor_audit_owner;
|
|
308
|
+
ALTER FUNCTION audit_ensure_month_partition(date) OWNER TO colveor_audit_owner;
|
|
309
|
+
IF EXISTS (SELECT 1 FROM pg_class WHERE relname = 'audit_events_chain_seq_seq') THEN
|
|
310
|
+
ALTER SEQUENCE audit_events_chain_seq_seq OWNER TO colveor_audit_owner;
|
|
311
|
+
END IF;
|
|
312
|
+
|
|
313
|
+
REVOKE ALL ON TABLE audit_events FROM PUBLIC;
|
|
314
|
+
REVOKE UPDATE, DELETE ON TABLE audit_events FROM CURRENT_USER;
|
|
315
|
+
GRANT SELECT, INSERT ON TABLE audit_events TO CURRENT_USER;
|
|
316
|
+
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE audit_outbox TO CURRENT_USER;
|
|
317
|
+
GRANT USAGE, SELECT ON SEQUENCE audit_events_chain_seq_seq TO CURRENT_USER;
|
|
318
|
+
EXCEPTION
|
|
319
|
+
WHEN insufficient_privilege OR invalid_grantor OR undefined_object THEN
|
|
320
|
+
RAISE NOTICE 'audit ownership/REVOKE skipped: %', SQLERRM;
|
|
321
|
+
END
|
|
322
|
+
$body$
|
|
323
|
+
`);
|
|
324
|
+
}
|
|
325
|
+
async down(queryRunner) {
|
|
326
|
+
await queryRunner.query(`DROP FUNCTION IF EXISTS audit_ensure_month_partition(date)`);
|
|
327
|
+
await queryRunner.query(`DROP FUNCTION IF EXISTS audit_seal_hashes(uuid, varchar, varchar)`);
|
|
328
|
+
await queryRunner.query(`DROP FUNCTION IF EXISTS audit_purge_ids(uuid[])`);
|
|
329
|
+
await queryRunner.query(`DROP FUNCTION IF EXISTS audit_set_legal_hold(uuid, boolean)`);
|
|
330
|
+
await queryRunner.query(`CREATE TABLE audit_events_merged (LIKE audit_events INCLUDING ALL)`);
|
|
331
|
+
await queryRunner.query(`INSERT INTO audit_events_merged SELECT * FROM audit_events`);
|
|
332
|
+
await queryRunner.query(`DROP TABLE audit_events`);
|
|
333
|
+
await queryRunner.query(`ALTER TABLE audit_events_merged RENAME TO audit_events`);
|
|
334
|
+
await queryRunner.query(`
|
|
335
|
+
ALTER TABLE audit_events
|
|
336
|
+
DROP CONSTRAINT IF EXISTS "PK_audit_events_id_created_at"
|
|
337
|
+
`);
|
|
338
|
+
await queryRunner.query(`
|
|
339
|
+
ALTER TABLE audit_events
|
|
340
|
+
ADD CONSTRAINT "PK_audit_events_id" PRIMARY KEY ("id")
|
|
341
|
+
`);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
exports.AuditHardening1785006199390 = AuditHardening1785006199390;
|
|
345
|
+
//# sourceMappingURL=1785006199390-audit-hardening.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199390-audit-hardening.js","sourceRoot":"","sources":["../../../src/database/migrations/1785006199390-audit-hardening.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,MAAa,2BAA2B;IACvC,IAAI,GAAG,6BAA6B,CAAC;IAE9B,KAAK,CAAC,EAAE,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEvB,CAAC,CAAC;QAEH,wEAAwE;QACxE,MAAM,WAAW,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACvF,MAAM,WAAW,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;QAC3E,MAAM,WAAW,CAAC,KAAK,CACtB,mEAAmE,CACnE,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAEtF,MAAM,WAAW,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;QACjF,MAAM,WAAW,CAAC,KAAK,CACtB,yEAAyE,CACzE,CAAC;QAEF,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;GAsBvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;GAWvB,CAAC,CAAC;QAEH,oEAAoE;QACpE,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;GAQvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAEzD,MAAM,WAAW,CAAC,KAAK,CAAC;;GAEvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;GAKvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CACtB,2EAA2E,CAC3E,CAAC;QAEF,MAAM,WAAW,CAAC,KAAK,CACtB;gDAC6C,CAC7C,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,yFAAyF,CACzF,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,qFAAqF,CACrF,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,iFAAiF,CACjF,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,2FAA2F,CAC3F,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,yFAAyF,CACzF,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,iGAAiG,CACjG,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,iHAAiH,CACjH,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,yGAAyG,CACzG,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,uFAAuF,CACvF,CAAC;QAEF,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;GAKvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;GAgBvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;GAkBvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;GAoBvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;GAwBvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CACtB,wEAAwE,CACxE,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAC;QACtF,MAAM,WAAW,CAAC,KAAK,CACtB,8EAA8E,CAC9E,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,uEAAuE,CACvE,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,+EAA+E,CAC/E,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,mEAAmE,CACnE,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,qFAAqF,CACrF,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACtB,8EAA8E,CAC9E,CAAC;QAEF,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BvB,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACzC,MAAM,WAAW,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAC;QACtF,MAAM,WAAW,CAAC,KAAK,CACtB,mEAAmE,CACnE,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;QAC3E,MAAM,WAAW,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;QAEvF,MAAM,WAAW,CAAC,KAAK,CACtB,oEAAoE,CACpE,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAC;QACtF,MAAM,WAAW,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACnD,MAAM,WAAW,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAClF,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;IACJ,CAAC;CACD;AA1YD,kEA0YC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type MigrationInterface, type QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Allow colveor_audit_owner to create monthly partitions via SECURITY DEFINER.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AuditOwnerSchemaCreate1785006199391 implements MigrationInterface {
|
|
6
|
+
name: string;
|
|
7
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
8
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=1785006199391-audit-owner-schema-create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199391-audit-owner-schema-create.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1785006199391-audit-owner-schema-create.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;IAe3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAc1D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuditOwnerSchemaCreate1785006199391 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Allow colveor_audit_owner to create monthly partitions via SECURITY DEFINER.
|
|
6
|
+
*/
|
|
7
|
+
class AuditOwnerSchemaCreate1785006199391 {
|
|
8
|
+
name = 'AuditOwnerSchemaCreate1785006199391';
|
|
9
|
+
async up(queryRunner) {
|
|
10
|
+
await queryRunner.query(`
|
|
11
|
+
DO $body$
|
|
12
|
+
BEGIN
|
|
13
|
+
IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'colveor_audit_owner') THEN
|
|
14
|
+
GRANT USAGE, CREATE ON SCHEMA public TO colveor_audit_owner;
|
|
15
|
+
END IF;
|
|
16
|
+
EXCEPTION
|
|
17
|
+
WHEN insufficient_privilege OR undefined_object THEN
|
|
18
|
+
RAISE NOTICE 'audit owner schema grant skipped: %', SQLERRM;
|
|
19
|
+
END
|
|
20
|
+
$body$
|
|
21
|
+
`);
|
|
22
|
+
}
|
|
23
|
+
async down(queryRunner) {
|
|
24
|
+
await queryRunner.query(`
|
|
25
|
+
DO $body$
|
|
26
|
+
BEGIN
|
|
27
|
+
IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'colveor_audit_owner') THEN
|
|
28
|
+
REVOKE CREATE ON SCHEMA public FROM colveor_audit_owner;
|
|
29
|
+
END IF;
|
|
30
|
+
EXCEPTION
|
|
31
|
+
WHEN insufficient_privilege OR undefined_object THEN
|
|
32
|
+
RAISE NOTICE 'audit owner schema revoke skipped: %', SQLERRM;
|
|
33
|
+
END
|
|
34
|
+
$body$
|
|
35
|
+
`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.AuditOwnerSchemaCreate1785006199391 = AuditOwnerSchemaCreate1785006199391;
|
|
39
|
+
//# sourceMappingURL=1785006199391-audit-owner-schema-create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199391-audit-owner-schema-create.js","sourceRoot":"","sources":["../../../src/database/migrations/1785006199391-audit-owner-schema-create.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;;;;;;;;;;;GAWvB,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACzC,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;GAWvB,CAAC,CAAC;IACJ,CAAC;CACD;AAhCD,kFAgCC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type MigrationInterface, type QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Denormalized public CDN URL for profile avatars (read projection).
|
|
4
|
+
* Source of truth remains photo_file_id; URL is set on profile write / file replace.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ProfilePhotoUrl1785006199392 implements MigrationInterface {
|
|
7
|
+
name: string;
|
|
8
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
9
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=1785006199392-profile-photo-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199392-profile-photo-url.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1785006199392-profile-photo-url.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;IAiB3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAM1D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProfilePhotoUrl1785006199392 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Denormalized public CDN URL for profile avatars (read projection).
|
|
6
|
+
* Source of truth remains photo_file_id; URL is set on profile write / file replace.
|
|
7
|
+
*/
|
|
8
|
+
class ProfilePhotoUrl1785006199392 {
|
|
9
|
+
name = 'ProfilePhotoUrl1785006199392';
|
|
10
|
+
async up(queryRunner) {
|
|
11
|
+
await queryRunner.query(`
|
|
12
|
+
ALTER TABLE "user_profiles"
|
|
13
|
+
ADD COLUMN IF NOT EXISTS "photo_url" character varying(1024)
|
|
14
|
+
`);
|
|
15
|
+
await queryRunner.query(`
|
|
16
|
+
UPDATE "user_profiles" AS p
|
|
17
|
+
SET "photo_url" = f."public_url"
|
|
18
|
+
FROM "uploaded_files" AS f
|
|
19
|
+
WHERE p."photo_file_id" = f."id"
|
|
20
|
+
AND f."public_url" IS NOT NULL
|
|
21
|
+
AND f."deleted_at" IS NULL
|
|
22
|
+
AND (p."photo_url" IS NULL OR p."photo_url" = '')
|
|
23
|
+
`);
|
|
24
|
+
}
|
|
25
|
+
async down(queryRunner) {
|
|
26
|
+
await queryRunner.query(`
|
|
27
|
+
ALTER TABLE "user_profiles"
|
|
28
|
+
DROP COLUMN IF EXISTS "photo_url"
|
|
29
|
+
`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.ProfilePhotoUrl1785006199392 = ProfilePhotoUrl1785006199392;
|
|
33
|
+
//# sourceMappingURL=1785006199392-profile-photo-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199392-profile-photo-url.js","sourceRoot":"","sources":["../../../src/database/migrations/1785006199392-profile-photo-url.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;;;GAGvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;GAQvB,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACzC,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;IACJ,CAAC;CACD;AA1BD,oEA0BC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Denormalized public CDN URL for cover photos (read projection).
|
|
4
|
+
* Mirrors photo_url; SoT remains cover_photo_file_id.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ProfileCoverUrl1785006199393 implements MigrationInterface {
|
|
7
|
+
name: string;
|
|
8
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
9
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=1785006199393-profile-cover-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199393-profile-cover-url.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1785006199393-profile-cover-url.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE/D;;;GAGG;AACH,qBAAa,4BAA6B,YAAW,kBAAkB;IACtE,IAAI,SAAkC;IAEzB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAM1D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProfileCoverUrl1785006199393 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Denormalized public CDN URL for cover photos (read projection).
|
|
6
|
+
* Mirrors photo_url; SoT remains cover_photo_file_id.
|
|
7
|
+
*/
|
|
8
|
+
class ProfileCoverUrl1785006199393 {
|
|
9
|
+
name = 'ProfileCoverUrl1785006199393';
|
|
10
|
+
async up(queryRunner) {
|
|
11
|
+
await queryRunner.query(`
|
|
12
|
+
ALTER TABLE "user_profiles"
|
|
13
|
+
ADD COLUMN IF NOT EXISTS "cover_photo_url" character varying(1024)
|
|
14
|
+
`);
|
|
15
|
+
await queryRunner.query(`
|
|
16
|
+
UPDATE "user_profiles" AS p
|
|
17
|
+
SET "cover_photo_url" = f."public_url"
|
|
18
|
+
FROM "uploaded_files" AS f
|
|
19
|
+
WHERE p."cover_photo_file_id" = f."id"
|
|
20
|
+
AND f."public_url" IS NOT NULL
|
|
21
|
+
AND f."deleted_at" IS NULL
|
|
22
|
+
AND (p."cover_photo_url" IS NULL OR p."cover_photo_url" = '')
|
|
23
|
+
`);
|
|
24
|
+
}
|
|
25
|
+
async down(queryRunner) {
|
|
26
|
+
await queryRunner.query(`
|
|
27
|
+
ALTER TABLE "user_profiles"
|
|
28
|
+
DROP COLUMN IF EXISTS "cover_photo_url"
|
|
29
|
+
`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.ProfileCoverUrl1785006199393 = ProfileCoverUrl1785006199393;
|
|
33
|
+
//# sourceMappingURL=1785006199393-profile-cover-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199393-profile-cover-url.js","sourceRoot":"","sources":["../../../src/database/migrations/1785006199393-profile-cover-url.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;;;GAGvB,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;GAQvB,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACzC,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;IACJ,CAAC;CACD;AA1BD,oEA0BC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* New profiles default to private (opt-in public username lookup).
|
|
4
|
+
* Existing rows are left unchanged.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ProfileIsPublicDefaultFalse1785006199394 implements MigrationInterface {
|
|
7
|
+
name: string;
|
|
8
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
9
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=1785006199394-profile-is-public-default-false.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199394-profile-is-public-default-false.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1785006199394-profile-is-public-default-false.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE/D;;;GAGG;AACH,qBAAa,wCAAyC,YAAW,kBAAkB;IAClF,IAAI,SAA8C;IAErC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAO3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAM1D"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProfileIsPublicDefaultFalse1785006199394 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* New profiles default to private (opt-in public username lookup).
|
|
6
|
+
* Existing rows are left unchanged.
|
|
7
|
+
*/
|
|
8
|
+
class ProfileIsPublicDefaultFalse1785006199394 {
|
|
9
|
+
name = 'ProfileIsPublicDefaultFalse1785006199394';
|
|
10
|
+
async up(queryRunner) {
|
|
11
|
+
await queryRunner.query(`
|
|
12
|
+
ALTER TABLE "user_profiles"
|
|
13
|
+
ALTER COLUMN "is_public" SET DEFAULT false
|
|
14
|
+
`);
|
|
15
|
+
}
|
|
16
|
+
async down(queryRunner) {
|
|
17
|
+
await queryRunner.query(`
|
|
18
|
+
ALTER TABLE "user_profiles"
|
|
19
|
+
ALTER COLUMN "is_public" SET DEFAULT true
|
|
20
|
+
`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.ProfileIsPublicDefaultFalse1785006199394 = ProfileIsPublicDefaultFalse1785006199394;
|
|
24
|
+
//# sourceMappingURL=1785006199394-profile-is-public-default-false.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199394-profile-is-public-default-false.js","sourceRoot":"","sources":["../../../src/database/migrations/1785006199394-profile-is-public-default-false.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,wCAAwC;IACpD,IAAI,GAAG,0CAA0C,CAAC;IAE3C,KAAK,CAAC,EAAE,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACzC,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;IACJ,CAAC;CACD;AAhBD,4FAgBC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Indexes for delivery admin queries, retention, and device-token lookups.
|
|
4
|
+
*/
|
|
5
|
+
export declare class DeliveryScaleIndexes1785006199395 implements MigrationInterface {
|
|
6
|
+
name: string;
|
|
7
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
8
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=1785006199395-delivery-scale-indexes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199395-delivery-scale-indexes.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1785006199395-delivery-scale-indexes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE/D;;GAEG;AACH,qBAAa,iCAAkC,YAAW,kBAAkB;IAC3E,IAAI,SAAuC;IAE9B,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ1D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeliveryScaleIndexes1785006199395 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Indexes for delivery admin queries, retention, and device-token lookups.
|
|
6
|
+
*/
|
|
7
|
+
class DeliveryScaleIndexes1785006199395 {
|
|
8
|
+
name = 'DeliveryScaleIndexes1785006199395';
|
|
9
|
+
async up(queryRunner) {
|
|
10
|
+
await queryRunner.query(`
|
|
11
|
+
CREATE INDEX IF NOT EXISTS "IDX_notification_delivery_logs_status_created"
|
|
12
|
+
ON "notification_delivery_logs" ("status", "created_at")
|
|
13
|
+
`);
|
|
14
|
+
await queryRunner.query(`
|
|
15
|
+
CREATE INDEX IF NOT EXISTS "IDX_notification_delivery_logs_created"
|
|
16
|
+
ON "notification_delivery_logs" ("created_at")
|
|
17
|
+
`);
|
|
18
|
+
await queryRunner.query(`
|
|
19
|
+
CREATE INDEX IF NOT EXISTS "IDX_device_tokens_user_active"
|
|
20
|
+
ON "device_tokens" ("user_id", "is_active")
|
|
21
|
+
`);
|
|
22
|
+
await queryRunner.query(`
|
|
23
|
+
CREATE INDEX IF NOT EXISTS "IDX_device_tokens_fcm_token"
|
|
24
|
+
ON "device_tokens" ("fcm_token")
|
|
25
|
+
`);
|
|
26
|
+
}
|
|
27
|
+
async down(queryRunner) {
|
|
28
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_device_tokens_fcm_token"`);
|
|
29
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_device_tokens_user_active"`);
|
|
30
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_notification_delivery_logs_created"`);
|
|
31
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_notification_delivery_logs_status_created"`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.DeliveryScaleIndexes1785006199395 = DeliveryScaleIndexes1785006199395;
|
|
35
|
+
//# sourceMappingURL=1785006199395-delivery-scale-indexes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199395-delivery-scale-indexes.js","sourceRoot":"","sources":["../../../src/database/migrations/1785006199395-delivery-scale-indexes.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAa,iCAAiC;IAC7C,IAAI,GAAG,mCAAmC,CAAC;IAEpC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,CAAC;;;GAGvB,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACzC,MAAM,WAAW,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;QAC9E,MAAM,WAAW,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAC;QAChF,MAAM,WAAW,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;QACzF,MAAM,WAAW,CAAC,KAAK,CACtB,sEAAsE,CACtE,CAAC;IACH,CAAC;CACD;AA9BD,8EA8BC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Expression index for admin delivery prefix search:
|
|
4
|
+
* `LOWER(recipient) LIKE 'x%'` (case-insensitive, pattern_ops).
|
|
5
|
+
*/
|
|
6
|
+
export declare class DeliveryRecipientIndex1785006199396 implements MigrationInterface {
|
|
7
|
+
name: string;
|
|
8
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
9
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=1785006199396-delivery-recipient-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1785006199396-delivery-recipient-index.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1785006199396-delivery-recipient-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE/D;;;GAGG;AACH,qBAAa,mCAAoC,YAAW,kBAAkB;IAC7E,IAAI,SAAyC;IAEhC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAS3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAK1D"}
|