@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
|
@@ -3,16 +3,43 @@ import { SettingsService } from '../../settings/services/settings.service';
|
|
|
3
3
|
import type { ComposedEmail, EmailMetadata } from '../types/email-metadata';
|
|
4
4
|
import { EmailComposer } from './email.composer';
|
|
5
5
|
export declare const OTP_CODE_KEY_PREFIX = "otp:code:";
|
|
6
|
+
/** Receipt key so Bull retries after a successful send do not re-deliver. */
|
|
7
|
+
export declare const OTP_DELIVERED_KEY_PREFIX = "otp:delivered:";
|
|
6
8
|
export declare class OtpDeliveryComposer {
|
|
7
9
|
private readonly redis;
|
|
8
10
|
private readonly settings;
|
|
9
11
|
private readonly emailComposer;
|
|
10
12
|
constructor(redis: IORedis, settings: SettingsService, emailComposer: EmailComposer);
|
|
11
13
|
/**
|
|
12
|
-
*
|
|
14
|
+
* Reads the OTP correlation key without consuming it.
|
|
15
|
+
* Used before provider send so transient failures can retry with the same code.
|
|
16
|
+
*/
|
|
17
|
+
peekCorrelationCode(correlationId: string): Promise<string | null>;
|
|
18
|
+
/**
|
|
19
|
+
* Atomically consumes the OTP correlation key after a successful send.
|
|
13
20
|
* Returns null when the key is missing or already consumed.
|
|
14
21
|
*/
|
|
15
22
|
consumeCorrelationCode(correlationId: string): Promise<string | null>;
|
|
23
|
+
/** Receipt value for a correlation, or null when missing. */
|
|
24
|
+
getDeliveryReceipt(correlationId: string): Promise<string | null>;
|
|
25
|
+
/** True when a prior worker already completed provider send for this correlation. */
|
|
26
|
+
wasDelivered(correlationId: string): Promise<boolean>;
|
|
27
|
+
/** True when a send claim is held (in-flight or crashed mid-attempt). */
|
|
28
|
+
isDeliveryPending(correlationId: string): Promise<boolean>;
|
|
29
|
+
/** Age of a pending claim in ms, or null when not pending. */
|
|
30
|
+
pendingClaimAgeMs(correlationId: string): Promise<number | null>;
|
|
31
|
+
/**
|
|
32
|
+
* Claims the correlation for send (SET NX pending:timestamp). Returns false if another
|
|
33
|
+
* worker already holds the key.
|
|
34
|
+
*/
|
|
35
|
+
claimForSend(correlationId: string): Promise<boolean>;
|
|
36
|
+
/** Drops a pending claim after provider failure so retries can re-claim. Fail-closed. */
|
|
37
|
+
releaseClaim(correlationId: string): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Records a delivery receipt immediately after provider send succeeds.
|
|
40
|
+
* Survives a crash before consume/markSent so retries skip re-send.
|
|
41
|
+
*/
|
|
42
|
+
markDelivered(correlationId: string): Promise<void>;
|
|
16
43
|
composeSmsBody(code: string): string;
|
|
17
44
|
composeOtpEmail(to: string, code: string, metadata?: Partial<EmailMetadata>): ComposedEmail;
|
|
18
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp-delivery.composer.d.ts","sourceRoot":"","sources":["../../../../src/modules/delivery/composers/otp-delivery.composer.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"otp-delivery.composer.d.ts","sourceRoot":"","sources":["../../../../src/modules/delivery/composers/otp-delivery.composer.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAA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CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASzD,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAKpC,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa;CAG3F"}
|
|
@@ -15,15 +15,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.OtpDeliveryComposer = exports.OTP_CODE_KEY_PREFIX = void 0;
|
|
18
|
+
exports.OtpDeliveryComposer = exports.OTP_DELIVERED_KEY_PREFIX = exports.OTP_CODE_KEY_PREFIX = void 0;
|
|
19
19
|
const common_1 = require("@nestjs/common");
|
|
20
20
|
const ioredis_1 = __importDefault(require("ioredis"));
|
|
21
21
|
const redis_module_1 = require("../../../config/redis.module");
|
|
22
22
|
const settings_keys_1 = require("../../settings/constants/settings.keys");
|
|
23
23
|
const settings_service_1 = require("../../settings/services/settings.service");
|
|
24
|
+
const delivery_worker_constants_1 = require("../constants/delivery-worker.constants");
|
|
24
25
|
const otp_sms_template_1 = require("../templates/otp-sms.template");
|
|
25
26
|
const email_composer_1 = require("./email.composer");
|
|
26
27
|
exports.OTP_CODE_KEY_PREFIX = 'otp:code:';
|
|
28
|
+
/** Receipt key so Bull retries after a successful send do not re-deliver. */
|
|
29
|
+
exports.OTP_DELIVERED_KEY_PREFIX = 'otp:delivered:';
|
|
30
|
+
const OTP_DELIVERED_TTL_SEC = 3600;
|
|
27
31
|
let OtpDeliveryComposer = class OtpDeliveryComposer {
|
|
28
32
|
redis;
|
|
29
33
|
settings;
|
|
@@ -34,12 +38,54 @@ let OtpDeliveryComposer = class OtpDeliveryComposer {
|
|
|
34
38
|
this.emailComposer = emailComposer;
|
|
35
39
|
}
|
|
36
40
|
/**
|
|
37
|
-
*
|
|
41
|
+
* Reads the OTP correlation key without consuming it.
|
|
42
|
+
* Used before provider send so transient failures can retry with the same code.
|
|
43
|
+
*/
|
|
44
|
+
async peekCorrelationCode(correlationId) {
|
|
45
|
+
return this.redis.get(`${exports.OTP_CODE_KEY_PREFIX}${correlationId}`);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Atomically consumes the OTP correlation key after a successful send.
|
|
38
49
|
* Returns null when the key is missing or already consumed.
|
|
39
50
|
*/
|
|
40
51
|
async consumeCorrelationCode(correlationId) {
|
|
41
52
|
return this.redis.getdel(`${exports.OTP_CODE_KEY_PREFIX}${correlationId}`);
|
|
42
53
|
}
|
|
54
|
+
/** Receipt value for a correlation, or null when missing. */
|
|
55
|
+
async getDeliveryReceipt(correlationId) {
|
|
56
|
+
return this.redis.get(`${exports.OTP_DELIVERED_KEY_PREFIX}${correlationId}`);
|
|
57
|
+
}
|
|
58
|
+
/** True when a prior worker already completed provider send for this correlation. */
|
|
59
|
+
async wasDelivered(correlationId) {
|
|
60
|
+
return (0, delivery_worker_constants_1.isDeliveredReceipt)(await this.getDeliveryReceipt(correlationId));
|
|
61
|
+
}
|
|
62
|
+
/** True when a send claim is held (in-flight or crashed mid-attempt). */
|
|
63
|
+
async isDeliveryPending(correlationId) {
|
|
64
|
+
return (0, delivery_worker_constants_1.isPendingReceipt)(await this.getDeliveryReceipt(correlationId));
|
|
65
|
+
}
|
|
66
|
+
/** Age of a pending claim in ms, or null when not pending. */
|
|
67
|
+
async pendingClaimAgeMs(correlationId) {
|
|
68
|
+
return (0, delivery_worker_constants_1.pendingClaimAgeMs)(await this.getDeliveryReceipt(correlationId));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Claims the correlation for send (SET NX pending:timestamp). Returns false if another
|
|
72
|
+
* worker already holds the key.
|
|
73
|
+
*/
|
|
74
|
+
async claimForSend(correlationId) {
|
|
75
|
+
const result = await this.redis.set(`${exports.OTP_DELIVERED_KEY_PREFIX}${correlationId}`, (0, delivery_worker_constants_1.encodePendingClaim)(), 'EX', OTP_DELIVERED_TTL_SEC, 'NX');
|
|
76
|
+
return result === 'OK';
|
|
77
|
+
}
|
|
78
|
+
/** Drops a pending claim after provider failure so retries can re-claim. Fail-closed. */
|
|
79
|
+
async releaseClaim(correlationId) {
|
|
80
|
+
await this.redis.del(`${exports.OTP_DELIVERED_KEY_PREFIX}${correlationId}`);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Records a delivery receipt immediately after provider send succeeds.
|
|
84
|
+
* Survives a crash before consume/markSent so retries skip re-send.
|
|
85
|
+
*/
|
|
86
|
+
async markDelivered(correlationId) {
|
|
87
|
+
await this.redis.set(`${exports.OTP_DELIVERED_KEY_PREFIX}${correlationId}`, delivery_worker_constants_1.DELIVERY_RECEIPT_DELIVERED, 'EX', OTP_DELIVERED_TTL_SEC);
|
|
88
|
+
}
|
|
43
89
|
composeSmsBody(code) {
|
|
44
90
|
const template = this.settings.get(settings_keys_1.SETTING_KEYS.OTP_SMS_TEMPLATE);
|
|
45
91
|
return (0, otp_sms_template_1.renderOtpSmsTemplate)(template, code);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp-delivery.composer.js","sourceRoot":"","sources":["../../../../src/modules/delivery/composers/otp-delivery.composer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,sDAA8B;AAE9B,+DAA4D;AAC5D,0EAAsE;AACtE,+EAA2E;AAC3E,oEAAqE;AAErE,qDAAiD;AAEpC,QAAA,mBAAmB,GAAG,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"otp-delivery.composer.js","sourceRoot":"","sources":["../../../../src/modules/delivery/composers/otp-delivery.composer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,sDAA8B;AAE9B,+DAA4D;AAC5D,0EAAsE;AACtE,+EAA2E;AAC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lC,mBAAmB,CAqF/B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BullMQ lock must outlive worst-case provider work (SMTP/SMS 30s, FCM multi-token fan-out).
|
|
3
|
+
* Worker renews the lock while the job is running; this bounds stall detection.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DELIVERY_LOCK_DURATION_MS = 120000;
|
|
6
|
+
/** How often Bull checks for stalled jobs (must be < lockDuration). */
|
|
7
|
+
export declare const DELIVERY_STALLED_INTERVAL_MS = 60000;
|
|
8
|
+
/**
|
|
9
|
+
* Treat a leftover `pending:` claim as delivered after this age.
|
|
10
|
+
* Equal to lockDuration: once Bull stalls the job the lock is gone, so the
|
|
11
|
+
* first post-stall reprocess (even with attemptsMade === 0) can finalize at-most-once.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DELIVERY_PENDING_STALE_MS = 120000;
|
|
14
|
+
/**
|
|
15
|
+
* Bull job attempts/backoff for delivery + OTP queues (used by JobsQueue).
|
|
16
|
+
* Exponential delays with 5 attempts (10+20+40+80 ≈ 150s) exceed
|
|
17
|
+
* DELIVERY_PENDING_STALE_MS so "claim in progress" retries can reach stale finalize.
|
|
18
|
+
*/
|
|
19
|
+
export declare const DELIVERY_JOB_ATTEMPTS = 5;
|
|
20
|
+
export declare const DELIVERY_JOB_BACKOFF_MS = 10000;
|
|
21
|
+
export declare const OTP_DELIVERY_JOB_BACKOFF_MS = 10000;
|
|
22
|
+
export declare const DELIVERY_RECEIPT_DELIVERED = "1";
|
|
23
|
+
export declare const DELIVERY_RECEIPT_PENDING_PREFIX = "pending:";
|
|
24
|
+
export declare function encodePendingClaim(nowMs?: number): string;
|
|
25
|
+
/** Age of a pending claim in ms, or null if not a pending receipt. */
|
|
26
|
+
export declare function pendingClaimAgeMs(receipt: string | null, nowMs?: number): number | null;
|
|
27
|
+
export declare function isDeliveredReceipt(receipt: string | null): boolean;
|
|
28
|
+
export declare function isPendingReceipt(receipt: string | null): boolean;
|
|
29
|
+
//# sourceMappingURL=delivery-worker.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-worker.constants.d.ts","sourceRoot":"","sources":["../../../../src/modules/delivery/constants/delivery-worker.constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,yBAAyB,SAAU,CAAC;AAEjD,uEAAuE;AACvE,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,SAA4B,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAC9C,eAAO,MAAM,2BAA2B,QAA0B,CAAC;AAEnE,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAC9C,eAAO,MAAM,+BAA+B,aAAa,CAAC;AAE1D,wBAAgB,kBAAkB,CAAC,KAAK,SAAa,GAAG,MAAM,CAE7D;AAED,sEAAsE;AACtE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,SAAa,GAAG,MAAM,GAAG,IAAI,CAS3F;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAElE;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAEhE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DELIVERY_RECEIPT_PENDING_PREFIX = exports.DELIVERY_RECEIPT_DELIVERED = exports.OTP_DELIVERY_JOB_BACKOFF_MS = exports.DELIVERY_JOB_BACKOFF_MS = exports.DELIVERY_JOB_ATTEMPTS = exports.DELIVERY_PENDING_STALE_MS = exports.DELIVERY_STALLED_INTERVAL_MS = exports.DELIVERY_LOCK_DURATION_MS = void 0;
|
|
4
|
+
exports.encodePendingClaim = encodePendingClaim;
|
|
5
|
+
exports.pendingClaimAgeMs = pendingClaimAgeMs;
|
|
6
|
+
exports.isDeliveredReceipt = isDeliveredReceipt;
|
|
7
|
+
exports.isPendingReceipt = isPendingReceipt;
|
|
8
|
+
/**
|
|
9
|
+
* BullMQ lock must outlive worst-case provider work (SMTP/SMS 30s, FCM multi-token fan-out).
|
|
10
|
+
* Worker renews the lock while the job is running; this bounds stall detection.
|
|
11
|
+
*/
|
|
12
|
+
exports.DELIVERY_LOCK_DURATION_MS = 120_000;
|
|
13
|
+
/** How often Bull checks for stalled jobs (must be < lockDuration). */
|
|
14
|
+
exports.DELIVERY_STALLED_INTERVAL_MS = 60_000;
|
|
15
|
+
/**
|
|
16
|
+
* Treat a leftover `pending:` claim as delivered after this age.
|
|
17
|
+
* Equal to lockDuration: once Bull stalls the job the lock is gone, so the
|
|
18
|
+
* first post-stall reprocess (even with attemptsMade === 0) can finalize at-most-once.
|
|
19
|
+
*/
|
|
20
|
+
exports.DELIVERY_PENDING_STALE_MS = exports.DELIVERY_LOCK_DURATION_MS;
|
|
21
|
+
/**
|
|
22
|
+
* Bull job attempts/backoff for delivery + OTP queues (used by JobsQueue).
|
|
23
|
+
* Exponential delays with 5 attempts (10+20+40+80 ≈ 150s) exceed
|
|
24
|
+
* DELIVERY_PENDING_STALE_MS so "claim in progress" retries can reach stale finalize.
|
|
25
|
+
*/
|
|
26
|
+
exports.DELIVERY_JOB_ATTEMPTS = 5;
|
|
27
|
+
exports.DELIVERY_JOB_BACKOFF_MS = 10_000;
|
|
28
|
+
exports.OTP_DELIVERY_JOB_BACKOFF_MS = exports.DELIVERY_JOB_BACKOFF_MS;
|
|
29
|
+
exports.DELIVERY_RECEIPT_DELIVERED = '1';
|
|
30
|
+
exports.DELIVERY_RECEIPT_PENDING_PREFIX = 'pending:';
|
|
31
|
+
function encodePendingClaim(nowMs = Date.now()) {
|
|
32
|
+
return `${exports.DELIVERY_RECEIPT_PENDING_PREFIX}${nowMs}`;
|
|
33
|
+
}
|
|
34
|
+
/** Age of a pending claim in ms, or null if not a pending receipt. */
|
|
35
|
+
function pendingClaimAgeMs(receipt, nowMs = Date.now()) {
|
|
36
|
+
if (receipt == null || !receipt.startsWith(exports.DELIVERY_RECEIPT_PENDING_PREFIX)) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
const started = Number(receipt.slice(exports.DELIVERY_RECEIPT_PENDING_PREFIX.length));
|
|
40
|
+
if (!Number.isFinite(started)) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return Math.max(0, nowMs - started);
|
|
44
|
+
}
|
|
45
|
+
function isDeliveredReceipt(receipt) {
|
|
46
|
+
return receipt === exports.DELIVERY_RECEIPT_DELIVERED;
|
|
47
|
+
}
|
|
48
|
+
function isPendingReceipt(receipt) {
|
|
49
|
+
return pendingClaimAgeMs(receipt) != null;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=delivery-worker.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-worker.constants.js","sourceRoot":"","sources":["../../../../src/modules/delivery/constants/delivery-worker.constants.ts"],"names":[],"mappings":";;;AA4BA,gDAEC;AAGD,8CASC;AAED,gDAEC;AAED,4CAEC;AAlDD;;;GAGG;AACU,QAAA,yBAAyB,GAAG,OAAO,CAAC;AAEjD,uEAAuE;AAC1D,QAAA,4BAA4B,GAAG,MAAM,CAAC;AAEnD;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,iCAAyB,CAAC;AAEnE;;;;GAIG;AACU,QAAA,qBAAqB,GAAG,CAAC,CAAC;AAC1B,QAAA,uBAAuB,GAAG,MAAM,CAAC;AACjC,QAAA,2BAA2B,GAAG,+BAAuB,CAAC;AAEtD,QAAA,0BAA0B,GAAG,GAAG,CAAC;AACjC,QAAA,+BAA+B,GAAG,UAAU,CAAC;AAE1D,SAAgB,kBAAkB,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE;IACpD,OAAO,GAAG,uCAA+B,GAAG,KAAK,EAAE,CAAC;AACrD,CAAC;AAED,sEAAsE;AACtE,SAAgB,iBAAiB,CAAC,OAAsB,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE;IAC3E,IAAI,OAAO,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,uCAA+B,CAAC,EAAE,CAAC;QAC7E,OAAO,IAAI,CAAC;IACb,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,uCAA+B,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9E,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,CAAC;AACrC,CAAC;AAED,SAAgB,kBAAkB,CAAC,OAAsB;IACxD,OAAO,OAAO,KAAK,kCAA0B,CAAC;AAC/C,CAAC;AAED,SAAgB,gBAAgB,CAAC,OAAsB;IACtD,OAAO,iBAAiB,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;AAC3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery.module.d.ts","sourceRoot":"","sources":["../../../src/modules/delivery/delivery.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"delivery.module.d.ts","sourceRoot":"","sources":["../../../src/modules/delivery/delivery.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,gBAAgB,CAAC;AAmB/D,qBAEa,cAAc;IAC1B,MAAM,CAAC,QAAQ,IAAI,aAAa;CA6BhC"}
|
|
@@ -9,14 +9,11 @@ var DeliveryModule_1;
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.DeliveryModule = void 0;
|
|
11
11
|
const common_1 = require("@nestjs/common");
|
|
12
|
-
const core_1 = require("@nestjs/core");
|
|
13
12
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
14
13
|
const env_flags_util_1 = require("../../config/env-flags.util");
|
|
15
14
|
const jobs_module_1 = require("../jobs/jobs.module");
|
|
16
15
|
const jobs_queue_1 = require("../jobs/queues/jobs.queue");
|
|
17
16
|
const firebase_module_1 = require("../notifications/firebase.module");
|
|
18
|
-
const structured_logger_service_1 = require("../observability/logging/structured-logger.service");
|
|
19
|
-
const settings_service_1 = require("../settings/services/settings.service");
|
|
20
17
|
const email_composer_1 = require("./composers/email.composer");
|
|
21
18
|
const otp_delivery_composer_1 = require("./composers/otp-delivery.composer");
|
|
22
19
|
const notification_delivery_log_entity_1 = require("./entities/notification-delivery-log.entity");
|
|
@@ -39,18 +36,7 @@ let DeliveryModule = DeliveryModule_1 = class DeliveryModule {
|
|
|
39
36
|
delivery_job_runner_1.DeliveryJobRunner,
|
|
40
37
|
otp_delivery_job_runner_1.OtpDeliveryJobRunner,
|
|
41
38
|
...(useBull ? [delivery_processor_1.DeliveryProcessor, otp_delivery_processor_1.OtpDeliveryProcessor] : []),
|
|
42
|
-
|
|
43
|
-
provide: notification_delivery_service_1.NotificationDeliveryService,
|
|
44
|
-
useFactory: (jobsQueue, moduleRef, emailComposer, audit, settings, logger) => new notification_delivery_service_1.NotificationDeliveryService(jobsQueue, moduleRef, emailComposer, audit, settings, logger),
|
|
45
|
-
inject: [
|
|
46
|
-
jobs_queue_1.JobsQueue,
|
|
47
|
-
core_1.ModuleRef,
|
|
48
|
-
email_composer_1.EmailComposer,
|
|
49
|
-
notification_audit_service_1.NotificationAuditService,
|
|
50
|
-
settings_service_1.SettingsService,
|
|
51
|
-
structured_logger_service_1.StructuredLoggerService,
|
|
52
|
-
],
|
|
53
|
-
},
|
|
39
|
+
notification_delivery_service_1.NotificationDeliveryService,
|
|
54
40
|
];
|
|
55
41
|
const syncQueueProviders = useBull
|
|
56
42
|
? []
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery.module.js","sourceRoot":"","sources":["../../../src/modules/delivery/delivery.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"delivery.module.js","sourceRoot":"","sources":["../../../src/modules/delivery/delivery.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA+D;AAC/D,6CAAgD;AAEhD,gEAA6D;AAC7D,qDAAiD;AACjD,0DAAsD;AACtD,sEAAkE;AAClE,+DAA2D;AAC3D,6EAAwE;AACxE,kGAAsF;AACtF,mFAA8E;AAC9E,wEAAoE;AACpE,0EAAqE;AACrE,gFAA2E;AAC3E,kFAA4E;AAC5E,8DAAyD;AACzD,kGAA4F;AAC5F,sFAAiF;AAI1E,IAAM,cAAc,sBAApB,MAAM,cAAc;IAC1B,MAAM,CAAC,QAAQ;QACd,MAAM,OAAO,GAAG,IAAA,+BAAc,GAAE,CAAC;QACjC,MAAM,eAAe,GAAG;YACvB,8BAAa;YACb,qDAAwB;YACxB,gEAA6B;YAC7B,2CAAmB;YACnB,uCAAiB;YACjB,8CAAoB;YACpB,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,sCAAiB,EAAE,6CAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7D,2DAA2B;SAC3B,CAAC;QAEF,MAAM,kBAAkB,GAAG,OAAO;YACjC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,CAAC,+BAAa,EAAE,EAAE,OAAO,EAAE,sBAAS,EAAE,WAAW,EAAE,+BAAa,EAAE,CAAC,CAAC;QAEvE,OAAO;YACN,MAAM,EAAE,gBAAc;YACtB,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE;gBACR,wBAAU,CAAC,QAAQ,EAAE;gBACrB,gCAAc;gBACd,uBAAa,CAAC,UAAU,CAAC,CAAC,0DAAuB,CAAC,CAAC;aACnD;YACD,SAAS,EAAE,CAAC,GAAG,kBAAkB,EAAE,GAAG,eAAe,CAAC;YACtD,OAAO,EAAE,CAAC,2DAA2B,EAAE,qDAAwB,CAAC;SAChE,CAAC;IACH,CAAC;CACD,CAAA;AA9BY,wCAAc;yBAAd,cAAc;IAF1B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,cAAc,CA8B1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-delivery-log.entity.d.ts","sourceRoot":"","sources":["../../../../src/modules/delivery/entities/notification-delivery-log.entity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEzE,oBAAY,mBAAmB;IAC9B,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,IAAI,SAAS;CACb;AAED,oBAAY,0BAA0B;IACrC,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,iBAAiB,sBAAsB;CACvC;AAED,
|
|
1
|
+
{"version":3,"file":"notification-delivery-log.entity.d.ts","sourceRoot":"","sources":["../../../../src/modules/delivery/entities/notification-delivery-log.entity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEzE,oBAAY,mBAAmB;IAC9B,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,IAAI,SAAS;CACb;AAED,oBAAY,0BAA0B;IACrC,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,iBAAiB,sBAAsB;CACvC;AAED,qBAGa,uBAAwB,SAAQ,eAAe;IAG3D,cAAc,EAAG,MAAM,CAAC;IAGxB,OAAO,EAAG,mBAAmB,CAAC;IAG9B,OAAO,EAAG,MAAM,CAAC;IAEjB,mEAAmE;IAEnE,SAAS,EAAG,MAAM,CAAC;IAGnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,MAAM,EAAG,0BAA0B,CAAC;IAGpC,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,MAAM,CAAC,EAAE,IAAI,CAAC;IAEd,+EAA+E;IAE/E,eAAe,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACjD"}
|
|
@@ -82,6 +82,8 @@ __decorate([
|
|
|
82
82
|
__metadata("design:type", Object)
|
|
83
83
|
], NotificationDeliveryLog.prototype, "payloadSnapshot", void 0);
|
|
84
84
|
exports.NotificationDeliveryLog = NotificationDeliveryLog = __decorate([
|
|
85
|
-
(0, typeorm_1.Entity)('notification_delivery_logs')
|
|
85
|
+
(0, typeorm_1.Entity)('notification_delivery_logs'),
|
|
86
|
+
(0, typeorm_1.Index)(['status', 'createdAt']),
|
|
87
|
+
(0, typeorm_1.Index)(['createdAt'])
|
|
86
88
|
], NotificationDeliveryLog);
|
|
87
89
|
//# sourceMappingURL=notification-delivery-log.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-delivery-log.entity.js","sourceRoot":"","sources":["../../../../src/modules/delivery/entities/notification-delivery-log.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAgD;AAEhD,kEAAmE;AAGnE,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC9B,sCAAe,CAAA;IACf,kCAAW,CAAA;IACX,oCAAa,CAAA;AACd,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B;AAED,IAAY,0BAKX;AALD,WAAY,0BAA0B;IACrC,+CAAiB,CAAA;IACjB,2CAAa,CAAA;IACb,+CAAiB,CAAA;IACjB,qEAAuC,CAAA;AACxC,CAAC,EALW,0BAA0B,0CAA1B,0BAA0B,QAKrC;
|
|
1
|
+
{"version":3,"file":"notification-delivery-log.entity.js","sourceRoot":"","sources":["../../../../src/modules/delivery/entities/notification-delivery-log.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAgD;AAEhD,kEAAmE;AAGnE,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC9B,sCAAe,CAAA;IACf,kCAAW,CAAA;IACX,oCAAa,CAAA;AACd,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B;AAED,IAAY,0BAKX;AALD,WAAY,0BAA0B;IACrC,+CAAiB,CAAA;IACjB,2CAAa,CAAA;IACb,+CAAiB,CAAA;IACjB,qEAAuC,CAAA;AACxC,CAAC,EALW,0BAA0B,0CAA1B,0BAA0B,QAKrC;AAKM,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,6BAAe;IAG3D,cAAc,CAAU;IAGxB,OAAO,CAAuB;IAG9B,OAAO,CAAU;IAEjB,mEAAmE;IAEnE,SAAS,CAAU;IAGnB,WAAW,CAAU;IAGrB,MAAM,CAA8B;IAGpC,KAAK,CAAU;IAGf,YAAY,CAAU;IAGtB,MAAM,CAAQ;IAEd,+EAA+E;IAE/E,eAAe,CAAkC;CACjD,CAAA;AAjCY,0DAAuB;AAGnC;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;;+DACZ;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;wDACV;AAG9B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;;wDACZ;AAIjB;IADC,IAAA,gBAAM,GAAE;;0DACU;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DAC5B;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,0BAA0B,CAAC,MAAM,EAAE,CAAC;;uDAChD;AAGpC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDAC5B;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6DAC1C;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACxD,IAAI;uDAAC;AAId;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gEACnB;kCAhCrC,uBAAuB;IAHnC,IAAA,gBAAM,EAAC,4BAA4B,CAAC;IACpC,IAAA,eAAK,EAAC,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAC9B,IAAA,eAAK,EAAC,CAAC,WAAW,CAAC,CAAC;GACR,uBAAuB,CAiCnC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OnModuleInit } from '@nestjs/common';
|
|
2
2
|
import { ModuleRef } from '@nestjs/core';
|
|
3
|
+
import type IORedis from 'ioredis';
|
|
3
4
|
import { JobsQueue } from '../jobs/queues/jobs.queue';
|
|
4
5
|
import { StructuredLoggerService } from '../observability/logging/structured-logger.service';
|
|
5
6
|
import { SettingsService } from '../settings/services/settings.service';
|
|
@@ -14,8 +15,9 @@ export declare class NotificationDeliveryService implements OnModuleInit {
|
|
|
14
15
|
private readonly audit;
|
|
15
16
|
private readonly settings;
|
|
16
17
|
private readonly logger;
|
|
18
|
+
private readonly redis;
|
|
17
19
|
private resolvedQueue;
|
|
18
|
-
constructor(jobsQueue: JobsQueue, moduleRef: ModuleRef, emailComposer: EmailComposer, audit: NotificationAuditService, settings: SettingsService, logger: StructuredLoggerService);
|
|
20
|
+
constructor(jobsQueue: JobsQueue, moduleRef: ModuleRef, emailComposer: EmailComposer, audit: NotificationAuditService, settings: SettingsService, logger: StructuredLoggerService, redis: IORedis);
|
|
19
21
|
onModuleInit(): void;
|
|
20
22
|
isEnabled(): boolean;
|
|
21
23
|
private resolveQueue;
|
|
@@ -57,7 +59,16 @@ export declare class NotificationDeliveryService implements OnModuleInit {
|
|
|
57
59
|
private logSkipped;
|
|
58
60
|
private logEnqueued;
|
|
59
61
|
private recordQueued;
|
|
62
|
+
/**
|
|
63
|
+
* Enqueues a job and attaches its id. On queue failure, marks the audit failed
|
|
64
|
+
* so rows never remain QUEUED without a backing job.
|
|
65
|
+
*/
|
|
66
|
+
private enqueueAndAttach;
|
|
60
67
|
private attachJobId;
|
|
61
68
|
private assertEnabled;
|
|
69
|
+
private assertEmailPayloadSize;
|
|
70
|
+
private assertSmsBodySize;
|
|
71
|
+
private assertPushPayloadSize;
|
|
72
|
+
private assertAdminRetryRateLimit;
|
|
62
73
|
}
|
|
63
74
|
//# sourceMappingURL=notification-delivery.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-delivery.service.d.ts","sourceRoot":"","sources":["../../../src/modules/delivery/notification-delivery.service.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"notification-delivery.service.d.ts","sourceRoot":"","sources":["../../../src/modules/delivery/notification-delivery.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAON,YAAY,EAEZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,uBAAuB,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