@skyapp-labs/blueprint-backend-core 1.0.9
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 +6 -0
- package/README.md +954 -0
- package/dist/common/base/base.entity.d.ts +12 -0
- package/dist/common/base/base.entity.d.ts.map +1 -0
- package/dist/common/base/base.entity.js +48 -0
- package/dist/common/base/base.entity.js.map +1 -0
- package/dist/common/base/base.repository.d.ts +26 -0
- package/dist/common/base/base.repository.d.ts.map +1 -0
- package/dist/common/base/base.repository.js +61 -0
- package/dist/common/base/base.repository.js.map +1 -0
- package/dist/common/constants/index.d.ts +9 -0
- package/dist/common/constants/index.d.ts.map +1 -0
- package/dist/common/constants/index.js +13 -0
- package/dist/common/constants/index.js.map +1 -0
- package/dist/common/decorators/auth-method-aware.decorator.d.ts +3 -0
- package/dist/common/decorators/auth-method-aware.decorator.d.ts.map +1 -0
- package/dist/common/decorators/auth-method-aware.decorator.js +8 -0
- package/dist/common/decorators/auth-method-aware.decorator.js.map +1 -0
- package/dist/common/decorators/index.d.ts +8 -0
- package/dist/common/decorators/index.d.ts.map +1 -0
- package/dist/common/decorators/index.js +24 -0
- package/dist/common/decorators/index.js.map +1 -0
- package/dist/common/dto/index.d.ts +2 -0
- package/dist/common/dto/index.d.ts.map +1 -0
- package/dist/common/dto/index.js +18 -0
- package/dist/common/dto/index.js.map +1 -0
- package/dist/common/dto/pagination.dto.d.ts +6 -0
- package/dist/common/dto/pagination.dto.d.ts.map +1 -0
- package/dist/common/dto/pagination.dto.js +45 -0
- package/dist/common/dto/pagination.dto.js.map +1 -0
- package/dist/common/filters/http-exception.filter.d.ts +9 -0
- package/dist/common/filters/http-exception.filter.d.ts.map +1 -0
- package/dist/common/filters/http-exception.filter.js +71 -0
- package/dist/common/filters/http-exception.filter.js.map +1 -0
- package/dist/common/filters/index.d.ts +2 -0
- package/dist/common/filters/index.d.ts.map +1 -0
- package/dist/common/filters/index.js +18 -0
- package/dist/common/filters/index.js.map +1 -0
- package/dist/common/guards/auth.guard.d.ts +11 -0
- package/dist/common/guards/auth.guard.d.ts.map +1 -0
- package/dist/common/guards/auth.guard.js +42 -0
- package/dist/common/guards/auth.guard.js.map +1 -0
- package/dist/common/guards/index.d.ts +5 -0
- package/dist/common/guards/index.d.ts.map +1 -0
- package/dist/common/guards/index.js +21 -0
- package/dist/common/guards/index.js.map +1 -0
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts +12 -0
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts.map +1 -0
- package/dist/common/guards/login-ip-rate-limit.guard.js +70 -0
- package/dist/common/guards/login-ip-rate-limit.guard.js.map +1 -0
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts +12 -0
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts.map +1 -0
- package/dist/common/guards/otp-ip-rate-limit.guard.js +70 -0
- package/dist/common/guards/otp-ip-rate-limit.guard.js.map +1 -0
- package/dist/common/guards/permissions.guard.d.ts +8 -0
- package/dist/common/guards/permissions.guard.d.ts.map +1 -0
- package/dist/common/guards/permissions.guard.js +41 -0
- package/dist/common/guards/permissions.guard.js.map +1 -0
- package/dist/common/index.d.ts +13 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +33 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/interceptors/index.d.ts +2 -0
- package/dist/common/interceptors/index.d.ts.map +1 -0
- package/dist/common/interceptors/index.js +18 -0
- package/dist/common/interceptors/index.js.map +1 -0
- package/dist/common/interceptors/logging.interceptor.d.ts +10 -0
- package/dist/common/interceptors/logging.interceptor.d.ts.map +1 -0
- package/dist/common/interceptors/logging.interceptor.js +50 -0
- package/dist/common/interceptors/logging.interceptor.js.map +1 -0
- package/dist/common/interfaces/index.d.ts +2 -0
- package/dist/common/interfaces/index.d.ts.map +1 -0
- package/dist/common/interfaces/index.js +18 -0
- package/dist/common/interfaces/index.js.map +1 -0
- package/dist/common/interfaces/request-user.interface.d.ts +5 -0
- package/dist/common/interfaces/request-user.interface.d.ts.map +1 -0
- package/dist/common/interfaces/request-user.interface.js +3 -0
- package/dist/common/interfaces/request-user.interface.js.map +1 -0
- package/dist/common/middlewares/index.d.ts +6 -0
- package/dist/common/middlewares/index.d.ts.map +1 -0
- package/dist/common/middlewares/index.js +23 -0
- package/dist/common/middlewares/index.js.map +1 -0
- package/dist/common/pipes/config-aware-validation.pipe.d.ts +9 -0
- package/dist/common/pipes/config-aware-validation.pipe.d.ts.map +1 -0
- package/dist/common/pipes/config-aware-validation.pipe.js +38 -0
- package/dist/common/pipes/config-aware-validation.pipe.js.map +1 -0
- package/dist/common/pipes/index.d.ts +14 -0
- package/dist/common/pipes/index.d.ts.map +1 -0
- package/dist/common/pipes/index.js +62 -0
- package/dist/common/pipes/index.js.map +1 -0
- package/dist/common/utils/index.d.ts +8 -0
- package/dist/common/utils/index.d.ts.map +1 -0
- package/dist/common/utils/index.js +33 -0
- package/dist/common/utils/index.js.map +1 -0
- package/dist/common/utils/request.utils.d.ts +7 -0
- package/dist/common/utils/request.utils.d.ts.map +1 -0
- package/dist/common/utils/request.utils.js +12 -0
- package/dist/common/utils/request.utils.js.map +1 -0
- package/dist/config/app.config.d.ts +66 -0
- package/dist/config/app.config.d.ts.map +1 -0
- package/dist/config/app.config.js +43 -0
- package/dist/config/app.config.js.map +1 -0
- package/dist/config/database.config.d.ts +16 -0
- package/dist/config/database.config.d.ts.map +1 -0
- package/dist/config/database.config.js +13 -0
- package/dist/config/database.config.js.map +1 -0
- package/dist/config/env.validation.d.ts +34 -0
- package/dist/config/env.validation.d.ts.map +1 -0
- package/dist/config/env.validation.js +172 -0
- package/dist/config/env.validation.js.map +1 -0
- package/dist/config/firebase.module.d.ts +5 -0
- package/dist/config/firebase.module.d.ts.map +1 -0
- package/dist/config/firebase.module.js +21 -0
- package/dist/config/firebase.module.js.map +1 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +17 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/keycloak.module.d.ts +6 -0
- package/dist/config/keycloak.module.d.ts.map +1 -0
- package/dist/config/keycloak.module.js +92 -0
- package/dist/config/keycloak.module.js.map +1 -0
- package/dist/config/redis.module.d.ts +10 -0
- package/dist/config/redis.module.d.ts.map +1 -0
- package/dist/config/redis.module.js +111 -0
- package/dist/config/redis.module.js.map +1 -0
- package/dist/core.module.d.ts +12 -0
- package/dist/core.module.d.ts.map +1 -0
- package/dist/core.module.js +53 -0
- package/dist/core.module.js.map +1 -0
- package/dist/database/data-source.d.ts +5 -0
- package/dist/database/data-source.d.ts.map +1 -0
- package/dist/database/data-source.js +56 -0
- package/dist/database/data-source.js.map +1 -0
- package/dist/database/migrations/1775258543167-full-schema.d.ts +7 -0
- package/dist/database/migrations/1775258543167-full-schema.d.ts.map +1 -0
- package/dist/database/migrations/1775258543167-full-schema.js +100 -0
- package/dist/database/migrations/1775258543167-full-schema.js.map +1 -0
- package/dist/database/seeds/roles.seed.d.ts +11 -0
- package/dist/database/seeds/roles.seed.d.ts.map +1 -0
- package/dist/database/seeds/roles.seed.js +66 -0
- package/dist/database/seeds/roles.seed.js.map +1 -0
- package/dist/database/seeds/run-seed.d.ts +2 -0
- package/dist/database/seeds/run-seed.d.ts.map +1 -0
- package/dist/database/seeds/run-seed.js +32 -0
- package/dist/database/seeds/run-seed.js.map +1 -0
- package/dist/database/seeds/settings.seed.d.ts +9 -0
- package/dist/database/seeds/settings.seed.d.ts.map +1 -0
- package/dist/database/seeds/settings.seed.js +450 -0
- package/dist/database/seeds/settings.seed.js.map +1 -0
- package/dist/database/seeds/user.seed.d.ts +9 -0
- package/dist/database/seeds/user.seed.d.ts.map +1 -0
- package/dist/database/seeds/user.seed.js +90 -0
- package/dist/database/seeds/user.seed.js.map +1 -0
- package/dist/database/typeorm.service.d.ts +13 -0
- package/dist/database/typeorm.service.d.ts.map +1 -0
- package/dist/database/typeorm.service.js +52 -0
- package/dist/database/typeorm.service.js.map +1 -0
- package/dist/health/health.controller.d.ts +29 -0
- package/dist/health/health.controller.d.ts.map +1 -0
- package/dist/health/health.controller.js +182 -0
- package/dist/health/health.controller.js.map +1 -0
- package/dist/health/health.module.d.ts +3 -0
- package/dist/health/health.module.d.ts.map +1 -0
- package/dist/health/health.module.js +50 -0
- package/dist/health/health.module.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -0
- package/dist/jobs/index.d.ts +6 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +10 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/jobs.module.d.ts +6 -0
- package/dist/jobs/jobs.module.d.ts.map +1 -0
- package/dist/jobs/jobs.module.js +63 -0
- package/dist/jobs/jobs.module.js.map +1 -0
- package/dist/jobs/processors/jobs.processor.d.ts +24 -0
- package/dist/jobs/processors/jobs.processor.d.ts.map +1 -0
- package/dist/jobs/processors/jobs.processor.js +164 -0
- package/dist/jobs/processors/jobs.processor.js.map +1 -0
- package/dist/jobs/queues/jobs.queue.d.ts +25 -0
- package/dist/jobs/queues/jobs.queue.d.ts.map +1 -0
- package/dist/jobs/queues/jobs.queue.js +55 -0
- package/dist/jobs/queues/jobs.queue.js.map +1 -0
- package/dist/jobs/queues/queue-names.d.ts +5 -0
- package/dist/jobs/queues/queue-names.d.ts.map +1 -0
- package/dist/jobs/queues/queue-names.js +7 -0
- package/dist/jobs/queues/queue-names.js.map +1 -0
- package/dist/modules/admin/admin.module.d.ts +3 -0
- package/dist/modules/admin/admin.module.d.ts.map +1 -0
- package/dist/modules/admin/admin.module.js +24 -0
- package/dist/modules/admin/admin.module.js.map +1 -0
- package/dist/modules/admin/controllers/admin.controller.d.ts +27 -0
- package/dist/modules/admin/controllers/admin.controller.d.ts.map +1 -0
- package/dist/modules/admin/controllers/admin.controller.js +110 -0
- package/dist/modules/admin/controllers/admin.controller.js.map +1 -0
- package/dist/modules/admin/dto/admin-log.dto.d.ts +17 -0
- package/dist/modules/admin/dto/admin-log.dto.d.ts.map +1 -0
- package/dist/modules/admin/dto/admin-log.dto.js +57 -0
- package/dist/modules/admin/dto/admin-log.dto.js.map +1 -0
- package/dist/modules/admin/entities/admin-log.entity.d.ts +12 -0
- package/dist/modules/admin/entities/admin-log.entity.d.ts.map +1 -0
- package/dist/modules/admin/entities/admin-log.entity.js +53 -0
- package/dist/modules/admin/entities/admin-log.entity.js.map +1 -0
- package/dist/modules/admin/services/admin-log.service.d.ts +11 -0
- package/dist/modules/admin/services/admin-log.service.d.ts.map +1 -0
- package/dist/modules/admin/services/admin-log.service.js +60 -0
- package/dist/modules/admin/services/admin-log.service.js.map +1 -0
- package/dist/modules/auth/auth-core/auth-core.module.d.ts +3 -0
- package/dist/modules/auth/auth-core/auth-core.module.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/auth-core.module.js +40 -0
- package/dist/modules/auth/auth-core/auth-core.module.js.map +1 -0
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts +18 -0
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js +45 -0
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js.map +1 -0
- package/dist/modules/auth/auth.manifest.d.ts +9 -0
- package/dist/modules/auth/auth.manifest.d.ts.map +1 -0
- package/dist/modules/auth/auth.manifest.js +29 -0
- package/dist/modules/auth/auth.manifest.js.map +1 -0
- package/dist/modules/auth/auth.module.d.ts +3 -0
- package/dist/modules/auth/auth.module.d.ts.map +1 -0
- package/dist/modules/auth/auth.module.js +67 -0
- package/dist/modules/auth/auth.module.js.map +1 -0
- package/dist/modules/auth/controllers/account.controller.d.ts +42 -0
- package/dist/modules/auth/controllers/account.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/account.controller.js +206 -0
- package/dist/modules/auth/controllers/account.controller.js.map +1 -0
- package/dist/modules/auth/controllers/auth.controller.d.ts +32 -0
- package/dist/modules/auth/controllers/auth.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/auth.controller.js +206 -0
- package/dist/modules/auth/controllers/auth.controller.js.map +1 -0
- package/dist/modules/auth/controllers/otp.controller.d.ts +10 -0
- package/dist/modules/auth/controllers/otp.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/otp.controller.js +156 -0
- package/dist/modules/auth/controllers/otp.controller.js.map +1 -0
- package/dist/modules/auth/dto/index.d.ts +7 -0
- package/dist/modules/auth/dto/index.d.ts.map +1 -0
- package/dist/modules/auth/dto/index.js +23 -0
- package/dist/modules/auth/dto/index.js.map +1 -0
- package/dist/modules/auth/dto/invite.dto.d.ts +7 -0
- package/dist/modules/auth/dto/invite.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/invite.dto.js +39 -0
- package/dist/modules/auth/dto/invite.dto.js.map +1 -0
- package/dist/modules/auth/dto/login.dto.d.ts +7 -0
- package/dist/modules/auth/dto/login.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/login.dto.js +48 -0
- package/dist/modules/auth/dto/login.dto.js.map +1 -0
- package/dist/modules/auth/dto/otp.dto.d.ts +15 -0
- package/dist/modules/auth/dto/otp.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/otp.dto.js +83 -0
- package/dist/modules/auth/dto/otp.dto.js.map +1 -0
- package/dist/modules/auth/dto/password.dto.d.ts +25 -0
- package/dist/modules/auth/dto/password.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/password.dto.js +122 -0
- package/dist/modules/auth/dto/password.dto.js.map +1 -0
- package/dist/modules/auth/dto/register.dto.d.ts +19 -0
- package/dist/modules/auth/dto/register.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/register.dto.js +132 -0
- package/dist/modules/auth/dto/register.dto.js.map +1 -0
- package/dist/modules/auth/dto/token.dto.d.ts +15 -0
- package/dist/modules/auth/dto/token.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/token.dto.js +24 -0
- package/dist/modules/auth/dto/token.dto.js.map +1 -0
- package/dist/modules/auth/entities/index.d.ts +2 -0
- package/dist/modules/auth/entities/index.d.ts.map +1 -0
- package/dist/modules/auth/entities/index.js +18 -0
- package/dist/modules/auth/entities/index.js.map +1 -0
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts +9 -0
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/password-reset-token.entity.js +40 -0
- package/dist/modules/auth/entities/password-reset-token.entity.js.map +1 -0
- package/dist/modules/auth/index.d.ts +5 -0
- package/dist/modules/auth/index.d.ts.map +1 -0
- package/dist/modules/auth/index.js +21 -0
- package/dist/modules/auth/index.js.map +1 -0
- package/dist/modules/auth/providers/index.d.ts +5 -0
- package/dist/modules/auth/providers/index.d.ts.map +1 -0
- package/dist/modules/auth/providers/index.js +21 -0
- package/dist/modules/auth/providers/index.js.map +1 -0
- package/dist/modules/auth/providers/interfaces/auth-provider.interface.d.ts +37 -0
- package/dist/modules/auth/providers/interfaces/auth-provider.interface.d.ts.map +1 -0
- package/dist/modules/auth/providers/interfaces/auth-provider.interface.js +3 -0
- package/dist/modules/auth/providers/interfaces/auth-provider.interface.js.map +1 -0
- package/dist/modules/auth/providers/interfaces/index.d.ts +2 -0
- package/dist/modules/auth/providers/interfaces/index.d.ts.map +1 -0
- package/dist/modules/auth/providers/interfaces/index.js +18 -0
- package/dist/modules/auth/providers/interfaces/index.js.map +1 -0
- package/dist/modules/auth/providers/keycloak/index.d.ts +3 -0
- package/dist/modules/auth/providers/keycloak/index.d.ts.map +1 -0
- package/dist/modules/auth/providers/keycloak/index.js +19 -0
- package/dist/modules/auth/providers/keycloak/index.js.map +1 -0
- package/dist/modules/auth/providers/keycloak/keycloak-auth-provider.module.d.ts +3 -0
- package/dist/modules/auth/providers/keycloak/keycloak-auth-provider.module.d.ts.map +1 -0
- package/dist/modules/auth/providers/keycloak/keycloak-auth-provider.module.js +80 -0
- package/dist/modules/auth/providers/keycloak/keycloak-auth-provider.module.js.map +1 -0
- package/dist/modules/auth/providers/keycloak/keycloak-verify-email.strategy.d.ts +7 -0
- package/dist/modules/auth/providers/keycloak/keycloak-verify-email.strategy.d.ts.map +1 -0
- package/dist/modules/auth/providers/keycloak/keycloak-verify-email.strategy.js +54 -0
- package/dist/modules/auth/providers/keycloak/keycloak-verify-email.strategy.js.map +1 -0
- package/dist/modules/auth/providers/keycloak/keycloak.auth-provider.d.ts +36 -0
- package/dist/modules/auth/providers/keycloak/keycloak.auth-provider.d.ts.map +1 -0
- package/dist/modules/auth/providers/keycloak/keycloak.auth-provider.js +188 -0
- package/dist/modules/auth/providers/keycloak/keycloak.auth-provider.js.map +1 -0
- package/dist/modules/auth/providers/native/index.d.ts +3 -0
- package/dist/modules/auth/providers/native/index.d.ts.map +1 -0
- package/dist/modules/auth/providers/native/index.js +19 -0
- package/dist/modules/auth/providers/native/index.js.map +1 -0
- package/dist/modules/auth/providers/native/native.auth-provider.d.ts +19 -0
- package/dist/modules/auth/providers/native/native.auth-provider.d.ts.map +1 -0
- package/dist/modules/auth/providers/native/native.auth-provider.js +159 -0
- package/dist/modules/auth/providers/native/native.auth-provider.js.map +1 -0
- package/dist/modules/auth/providers/native/native.auth-provider.module.d.ts +3 -0
- package/dist/modules/auth/providers/native/native.auth-provider.module.d.ts.map +1 -0
- package/dist/modules/auth/providers/native/native.auth-provider.module.js +24 -0
- package/dist/modules/auth/providers/native/native.auth-provider.module.js.map +1 -0
- package/dist/modules/auth/providers/provider.registry.d.ts +14 -0
- package/dist/modules/auth/providers/provider.registry.d.ts.map +1 -0
- package/dist/modules/auth/providers/provider.registry.js +49 -0
- package/dist/modules/auth/providers/provider.registry.js.map +1 -0
- package/dist/modules/auth/services/account.service.d.ts +40 -0
- package/dist/modules/auth/services/account.service.d.ts.map +1 -0
- package/dist/modules/auth/services/account.service.js +165 -0
- package/dist/modules/auth/services/account.service.js.map +1 -0
- package/dist/modules/auth/services/index.d.ts +6 -0
- package/dist/modules/auth/services/index.d.ts.map +1 -0
- package/dist/modules/auth/services/index.js +22 -0
- package/dist/modules/auth/services/index.js.map +1 -0
- package/dist/modules/auth/services/login.service.d.ts +28 -0
- package/dist/modules/auth/services/login.service.d.ts.map +1 -0
- package/dist/modules/auth/services/login.service.js +210 -0
- package/dist/modules/auth/services/login.service.js.map +1 -0
- package/dist/modules/auth/services/otp-auth.service.d.ts +16 -0
- package/dist/modules/auth/services/otp-auth.service.d.ts.map +1 -0
- package/dist/modules/auth/services/otp-auth.service.js +75 -0
- package/dist/modules/auth/services/otp-auth.service.js.map +1 -0
- package/dist/modules/auth/services/password.service.d.ts +39 -0
- package/dist/modules/auth/services/password.service.d.ts.map +1 -0
- package/dist/modules/auth/services/password.service.js +213 -0
- package/dist/modules/auth/services/password.service.js.map +1 -0
- package/dist/modules/auth/services/registration.service.d.ts +30 -0
- package/dist/modules/auth/services/registration.service.d.ts.map +1 -0
- package/dist/modules/auth/services/registration.service.js +217 -0
- package/dist/modules/auth/services/registration.service.js.map +1 -0
- package/dist/modules/notifications/controllers/index.d.ts +2 -0
- package/dist/modules/notifications/controllers/index.d.ts.map +1 -0
- package/dist/modules/notifications/controllers/index.js +18 -0
- package/dist/modules/notifications/controllers/index.js.map +1 -0
- package/dist/modules/notifications/controllers/notifications.controller.d.ts +38 -0
- package/dist/modules/notifications/controllers/notifications.controller.d.ts.map +1 -0
- package/dist/modules/notifications/controllers/notifications.controller.js +140 -0
- package/dist/modules/notifications/controllers/notifications.controller.js.map +1 -0
- package/dist/modules/notifications/dto/device.dto.d.ts +10 -0
- package/dist/modules/notifications/dto/device.dto.d.ts.map +1 -0
- package/dist/modules/notifications/dto/device.dto.js +38 -0
- package/dist/modules/notifications/dto/device.dto.js.map +1 -0
- package/dist/modules/notifications/dto/event-types.dto.d.ts +6 -0
- package/dist/modules/notifications/dto/event-types.dto.d.ts.map +1 -0
- package/dist/modules/notifications/dto/event-types.dto.js +10 -0
- package/dist/modules/notifications/dto/event-types.dto.js.map +1 -0
- package/dist/modules/notifications/dto/fcm.dto.d.ts +14 -0
- package/dist/modules/notifications/dto/fcm.dto.d.ts.map +1 -0
- package/dist/modules/notifications/dto/fcm.dto.js +3 -0
- package/dist/modules/notifications/dto/fcm.dto.js.map +1 -0
- package/dist/modules/notifications/dto/index.d.ts +6 -0
- package/dist/modules/notifications/dto/index.d.ts.map +1 -0
- package/dist/modules/notifications/dto/index.js +22 -0
- package/dist/modules/notifications/dto/index.js.map +1 -0
- package/dist/modules/notifications/dto/notification-query.dto.d.ts +8 -0
- package/dist/modules/notifications/dto/notification-query.dto.d.ts.map +1 -0
- package/dist/modules/notifications/dto/notification-query.dto.js +44 -0
- package/dist/modules/notifications/dto/notification-query.dto.js.map +1 -0
- package/dist/modules/notifications/dto/user-device-token.dto.d.ts +9 -0
- package/dist/modules/notifications/dto/user-device-token.dto.d.ts.map +1 -0
- package/dist/modules/notifications/dto/user-device-token.dto.js +3 -0
- package/dist/modules/notifications/dto/user-device-token.dto.js.map +1 -0
- package/dist/modules/notifications/entities/device-token.entity.d.ts +17 -0
- package/dist/modules/notifications/entities/device-token.entity.d.ts.map +1 -0
- package/dist/modules/notifications/entities/device-token.entity.js +62 -0
- package/dist/modules/notifications/entities/device-token.entity.js.map +1 -0
- package/dist/modules/notifications/entities/index.d.ts +3 -0
- package/dist/modules/notifications/entities/index.d.ts.map +1 -0
- package/dist/modules/notifications/entities/index.js +19 -0
- package/dist/modules/notifications/entities/index.js.map +1 -0
- package/dist/modules/notifications/entities/notification.entity.d.ts +21 -0
- package/dist/modules/notifications/entities/notification.entity.d.ts.map +1 -0
- package/dist/modules/notifications/entities/notification.entity.js +70 -0
- package/dist/modules/notifications/entities/notification.entity.js.map +1 -0
- package/dist/modules/notifications/firebase.module.d.ts +3 -0
- package/dist/modules/notifications/firebase.module.d.ts.map +1 -0
- package/dist/modules/notifications/firebase.module.js +25 -0
- package/dist/modules/notifications/firebase.module.js.map +1 -0
- package/dist/modules/notifications/notifications.manifest.d.ts +9 -0
- package/dist/modules/notifications/notifications.manifest.d.ts.map +1 -0
- package/dist/modules/notifications/notifications.manifest.js +37 -0
- package/dist/modules/notifications/notifications.manifest.js.map +1 -0
- package/dist/modules/notifications/notifications.module.d.ts +3 -0
- package/dist/modules/notifications/notifications.module.d.ts.map +1 -0
- package/dist/modules/notifications/notifications.module.js +32 -0
- package/dist/modules/notifications/notifications.module.js.map +1 -0
- package/dist/modules/notifications/services/fcm.service.d.ts +17 -0
- package/dist/modules/notifications/services/fcm.service.d.ts.map +1 -0
- package/dist/modules/notifications/services/fcm.service.js +150 -0
- package/dist/modules/notifications/services/fcm.service.js.map +1 -0
- package/dist/modules/notifications/services/firebase.service.d.ts +19 -0
- package/dist/modules/notifications/services/firebase.service.d.ts.map +1 -0
- package/dist/modules/notifications/services/firebase.service.js +73 -0
- package/dist/modules/notifications/services/firebase.service.js.map +1 -0
- package/dist/modules/notifications/services/index.d.ts +4 -0
- package/dist/modules/notifications/services/index.d.ts.map +1 -0
- package/dist/modules/notifications/services/index.js +20 -0
- package/dist/modules/notifications/services/index.js.map +1 -0
- package/dist/modules/notifications/services/notifications.service.d.ts +19 -0
- package/dist/modules/notifications/services/notifications.service.d.ts.map +1 -0
- package/dist/modules/notifications/services/notifications.service.js +97 -0
- package/dist/modules/notifications/services/notifications.service.js.map +1 -0
- package/dist/modules/otp/constants/otp.constants.d.ts +4 -0
- package/dist/modules/otp/constants/otp.constants.d.ts.map +1 -0
- package/dist/modules/otp/constants/otp.constants.js +10 -0
- package/dist/modules/otp/constants/otp.constants.js.map +1 -0
- package/dist/modules/otp/email/email-provider.interface.d.ts +14 -0
- package/dist/modules/otp/email/email-provider.interface.d.ts.map +1 -0
- package/dist/modules/otp/email/email-provider.interface.js +15 -0
- package/dist/modules/otp/email/email-provider.interface.js.map +1 -0
- package/dist/modules/otp/email/email-proxy.service.d.ts +21 -0
- package/dist/modules/otp/email/email-proxy.service.d.ts.map +1 -0
- package/dist/modules/otp/email/email-proxy.service.js +67 -0
- package/dist/modules/otp/email/email-proxy.service.js.map +1 -0
- package/dist/modules/otp/email/email.module.d.ts +3 -0
- package/dist/modules/otp/email/email.module.d.ts.map +1 -0
- package/dist/modules/otp/email/email.module.js +33 -0
- package/dist/modules/otp/email/email.module.js.map +1 -0
- package/dist/modules/otp/email/index.d.ts +4 -0
- package/dist/modules/otp/email/index.d.ts.map +1 -0
- package/dist/modules/otp/email/index.js +20 -0
- package/dist/modules/otp/email/index.js.map +1 -0
- package/dist/modules/otp/email/providers/index.d.ts +5 -0
- package/dist/modules/otp/email/providers/index.d.ts.map +1 -0
- package/dist/modules/otp/email/providers/index.js +21 -0
- package/dist/modules/otp/email/providers/index.js.map +1 -0
- package/dist/modules/otp/email/providers/mailgun.provider.d.ts +10 -0
- package/dist/modules/otp/email/providers/mailgun.provider.d.ts.map +1 -0
- package/dist/modules/otp/email/providers/mailgun.provider.js +59 -0
- package/dist/modules/otp/email/providers/mailgun.provider.js.map +1 -0
- package/dist/modules/otp/email/providers/resend.provider.d.ts +10 -0
- package/dist/modules/otp/email/providers/resend.provider.d.ts.map +1 -0
- package/dist/modules/otp/email/providers/resend.provider.js +57 -0
- package/dist/modules/otp/email/providers/resend.provider.js.map +1 -0
- package/dist/modules/otp/email/providers/sendgrid.provider.d.ts +10 -0
- package/dist/modules/otp/email/providers/sendgrid.provider.d.ts.map +1 -0
- package/dist/modules/otp/email/providers/sendgrid.provider.js +58 -0
- package/dist/modules/otp/email/providers/sendgrid.provider.js.map +1 -0
- package/dist/modules/otp/email/providers/smtp.provider.d.ts +15 -0
- package/dist/modules/otp/email/providers/smtp.provider.d.ts.map +1 -0
- package/dist/modules/otp/email/providers/smtp.provider.js +115 -0
- package/dist/modules/otp/email/providers/smtp.provider.js.map +1 -0
- package/dist/modules/otp/index.d.ts +5 -0
- package/dist/modules/otp/index.d.ts.map +1 -0
- package/dist/modules/otp/index.js +21 -0
- package/dist/modules/otp/index.js.map +1 -0
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts +26 -0
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts.map +1 -0
- package/dist/modules/otp/interfaces/otp.service.interface.js +7 -0
- package/dist/modules/otp/interfaces/otp.service.interface.js.map +1 -0
- package/dist/modules/otp/otp.module.d.ts +3 -0
- package/dist/modules/otp/otp.module.d.ts.map +1 -0
- package/dist/modules/otp/otp.module.js +36 -0
- package/dist/modules/otp/otp.module.js.map +1 -0
- package/dist/modules/otp/otp.service.d.ts +25 -0
- package/dist/modules/otp/otp.service.d.ts.map +1 -0
- package/dist/modules/otp/otp.service.js +146 -0
- package/dist/modules/otp/otp.service.js.map +1 -0
- package/dist/modules/otp/services/otp.rate-limiter.d.ts +13 -0
- package/dist/modules/otp/services/otp.rate-limiter.d.ts.map +1 -0
- package/dist/modules/otp/services/otp.rate-limiter.js +70 -0
- package/dist/modules/otp/services/otp.rate-limiter.js.map +1 -0
- package/dist/modules/otp/services/otp.session.store.d.ts +28 -0
- package/dist/modules/otp/services/otp.session.store.d.ts.map +1 -0
- package/dist/modules/otp/services/otp.session.store.js +226 -0
- package/dist/modules/otp/services/otp.session.store.js.map +1 -0
- package/dist/modules/otp/sms/index.d.ts +4 -0
- package/dist/modules/otp/sms/index.d.ts.map +1 -0
- package/dist/modules/otp/sms/index.js +20 -0
- package/dist/modules/otp/sms/index.js.map +1 -0
- package/dist/modules/otp/sms/providers/index.d.ts +5 -0
- package/dist/modules/otp/sms/providers/index.d.ts.map +1 -0
- package/dist/modules/otp/sms/providers/index.js +21 -0
- package/dist/modules/otp/sms/providers/index.js.map +1 -0
- package/dist/modules/otp/sms/providers/infobip.provider.d.ts +10 -0
- package/dist/modules/otp/sms/providers/infobip.provider.d.ts.map +1 -0
- package/dist/modules/otp/sms/providers/infobip.provider.js +61 -0
- package/dist/modules/otp/sms/providers/infobip.provider.js.map +1 -0
- package/dist/modules/otp/sms/providers/smart-sms.provider.d.ts +11 -0
- package/dist/modules/otp/sms/providers/smart-sms.provider.d.ts.map +1 -0
- package/dist/modules/otp/sms/providers/smart-sms.provider.js +56 -0
- package/dist/modules/otp/sms/providers/smart-sms.provider.js.map +1 -0
- package/dist/modules/otp/sms/providers/termii.provider.d.ts +11 -0
- package/dist/modules/otp/sms/providers/termii.provider.d.ts.map +1 -0
- package/dist/modules/otp/sms/providers/termii.provider.js +56 -0
- package/dist/modules/otp/sms/providers/termii.provider.js.map +1 -0
- package/dist/modules/otp/sms/providers/twilio.provider.d.ts +10 -0
- package/dist/modules/otp/sms/providers/twilio.provider.d.ts.map +1 -0
- package/dist/modules/otp/sms/providers/twilio.provider.js +59 -0
- package/dist/modules/otp/sms/providers/twilio.provider.js.map +1 -0
- package/dist/modules/otp/sms/sms-provider.interface.d.ts +12 -0
- package/dist/modules/otp/sms/sms-provider.interface.d.ts.map +1 -0
- package/dist/modules/otp/sms/sms-provider.interface.js +15 -0
- package/dist/modules/otp/sms/sms-provider.interface.js.map +1 -0
- package/dist/modules/otp/sms/sms-proxy.service.d.ts +21 -0
- package/dist/modules/otp/sms/sms-proxy.service.d.ts.map +1 -0
- package/dist/modules/otp/sms/sms-proxy.service.js +67 -0
- package/dist/modules/otp/sms/sms-proxy.service.js.map +1 -0
- package/dist/modules/otp/sms/sms.module.d.ts +3 -0
- package/dist/modules/otp/sms/sms.module.d.ts.map +1 -0
- package/dist/modules/otp/sms/sms.module.js +33 -0
- package/dist/modules/otp/sms/sms.module.js.map +1 -0
- package/dist/modules/otp/utils/otp.utils.d.ts +13 -0
- package/dist/modules/otp/utils/otp.utils.d.ts.map +1 -0
- package/dist/modules/otp/utils/otp.utils.js +57 -0
- package/dist/modules/otp/utils/otp.utils.js.map +1 -0
- package/dist/modules/profile/controllers/profile.controller.d.ts +14 -0
- package/dist/modules/profile/controllers/profile.controller.d.ts.map +1 -0
- package/dist/modules/profile/controllers/profile.controller.js +81 -0
- package/dist/modules/profile/controllers/profile.controller.js.map +1 -0
- package/dist/modules/profile/dto/profile.dto.d.ts +11 -0
- package/dist/modules/profile/dto/profile.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/profile.dto.js +50 -0
- package/dist/modules/profile/dto/profile.dto.js.map +1 -0
- package/dist/modules/profile/index.d.ts +3 -0
- package/dist/modules/profile/index.d.ts.map +1 -0
- package/dist/modules/profile/index.js +19 -0
- package/dist/modules/profile/index.js.map +1 -0
- package/dist/modules/profile/profile.module.d.ts +3 -0
- package/dist/modules/profile/profile.module.d.ts.map +1 -0
- package/dist/modules/profile/profile.module.js +26 -0
- package/dist/modules/profile/profile.module.js.map +1 -0
- package/dist/modules/profile/services/profile.service.d.ts +16 -0
- package/dist/modules/profile/services/profile.service.d.ts.map +1 -0
- package/dist/modules/profile/services/profile.service.js +64 -0
- package/dist/modules/profile/services/profile.service.js.map +1 -0
- package/dist/modules/roles/controllers/index.d.ts +5 -0
- package/dist/modules/roles/controllers/index.d.ts.map +1 -0
- package/dist/modules/roles/controllers/index.js +12 -0
- package/dist/modules/roles/controllers/index.js.map +1 -0
- package/dist/modules/roles/controllers/modules.controller.d.ts +14 -0
- package/dist/modules/roles/controllers/modules.controller.d.ts.map +1 -0
- package/dist/modules/roles/controllers/modules.controller.js +82 -0
- package/dist/modules/roles/controllers/modules.controller.js.map +1 -0
- package/dist/modules/roles/controllers/permissions.controller.d.ts +14 -0
- package/dist/modules/roles/controllers/permissions.controller.d.ts.map +1 -0
- package/dist/modules/roles/controllers/permissions.controller.js +83 -0
- package/dist/modules/roles/controllers/permissions.controller.js.map +1 -0
- package/dist/modules/roles/controllers/roles.controller.d.ts +17 -0
- package/dist/modules/roles/controllers/roles.controller.d.ts.map +1 -0
- package/dist/modules/roles/controllers/roles.controller.js +93 -0
- package/dist/modules/roles/controllers/roles.controller.js.map +1 -0
- package/dist/modules/roles/controllers/user-roles.controller.d.ts +11 -0
- package/dist/modules/roles/controllers/user-roles.controller.d.ts.map +1 -0
- package/dist/modules/roles/controllers/user-roles.controller.js +94 -0
- package/dist/modules/roles/controllers/user-roles.controller.js.map +1 -0
- package/dist/modules/roles/dto/index.d.ts +4 -0
- package/dist/modules/roles/dto/index.d.ts.map +1 -0
- package/dist/modules/roles/dto/index.js +20 -0
- package/dist/modules/roles/dto/index.js.map +1 -0
- package/dist/modules/roles/dto/module.dto.d.ts +10 -0
- package/dist/modules/roles/dto/module.dto.d.ts.map +1 -0
- package/dist/modules/roles/dto/module.dto.js +48 -0
- package/dist/modules/roles/dto/module.dto.js.map +1 -0
- package/dist/modules/roles/dto/permission.dto.d.ts +14 -0
- package/dist/modules/roles/dto/permission.dto.d.ts.map +1 -0
- package/dist/modules/roles/dto/permission.dto.js +60 -0
- package/dist/modules/roles/dto/permission.dto.js.map +1 -0
- package/dist/modules/roles/dto/role.dto.d.ts +15 -0
- package/dist/modules/roles/dto/role.dto.d.ts.map +1 -0
- package/dist/modules/roles/dto/role.dto.js +65 -0
- package/dist/modules/roles/dto/role.dto.js.map +1 -0
- package/dist/modules/roles/entities/index.d.ts +4 -0
- package/dist/modules/roles/entities/index.d.ts.map +1 -0
- package/dist/modules/roles/entities/index.js +10 -0
- package/dist/modules/roles/entities/index.js.map +1 -0
- package/dist/modules/roles/entities/module.entity.d.ts +9 -0
- package/dist/modules/roles/entities/module.entity.d.ts.map +1 -0
- package/dist/modules/roles/entities/module.entity.js +39 -0
- package/dist/modules/roles/entities/module.entity.js.map +1 -0
- package/dist/modules/roles/entities/permission.entity.d.ts +12 -0
- package/dist/modules/roles/entities/permission.entity.d.ts.map +1 -0
- package/dist/modules/roles/entities/permission.entity.js +49 -0
- package/dist/modules/roles/entities/permission.entity.js.map +1 -0
- package/dist/modules/roles/entities/role.entity.d.ts +11 -0
- package/dist/modules/roles/entities/role.entity.d.ts.map +1 -0
- package/dist/modules/roles/entities/role.entity.js +49 -0
- package/dist/modules/roles/entities/role.entity.js.map +1 -0
- package/dist/modules/roles/index.d.ts +7 -0
- package/dist/modules/roles/index.d.ts.map +1 -0
- package/dist/modules/roles/index.js +25 -0
- package/dist/modules/roles/index.js.map +1 -0
- package/dist/modules/roles/registry/discover-manifests.d.ts +3 -0
- package/dist/modules/roles/registry/discover-manifests.d.ts.map +1 -0
- package/dist/modules/roles/registry/discover-manifests.js +83 -0
- package/dist/modules/roles/registry/discover-manifests.js.map +1 -0
- package/dist/modules/roles/registry/index.d.ts +3 -0
- package/dist/modules/roles/registry/index.d.ts.map +1 -0
- package/dist/modules/roles/registry/index.js +8 -0
- package/dist/modules/roles/registry/index.js.map +1 -0
- package/dist/modules/roles/registry/sync-manifests-to-db.d.ts +7 -0
- package/dist/modules/roles/registry/sync-manifests-to-db.d.ts.map +1 -0
- package/dist/modules/roles/registry/sync-manifests-to-db.js +52 -0
- package/dist/modules/roles/registry/sync-manifests-to-db.js.map +1 -0
- package/dist/modules/roles/roles.manifest.d.ts +12 -0
- package/dist/modules/roles/roles.manifest.d.ts.map +1 -0
- package/dist/modules/roles/roles.manifest.js +51 -0
- package/dist/modules/roles/roles.manifest.js.map +1 -0
- package/dist/modules/roles/roles.module.d.ts +8 -0
- package/dist/modules/roles/roles.module.d.ts.map +1 -0
- package/dist/modules/roles/roles.module.js +43 -0
- package/dist/modules/roles/roles.module.js.map +1 -0
- package/dist/modules/roles/services/index.d.ts +6 -0
- package/dist/modules/roles/services/index.d.ts.map +1 -0
- package/dist/modules/roles/services/index.js +14 -0
- package/dist/modules/roles/services/index.js.map +1 -0
- package/dist/modules/roles/services/manifest-sync.service.d.ts +11 -0
- package/dist/modules/roles/services/manifest-sync.service.d.ts.map +1 -0
- package/dist/modules/roles/services/manifest-sync.service.js +38 -0
- package/dist/modules/roles/services/manifest-sync.service.js.map +1 -0
- package/dist/modules/roles/services/modules.service.d.ts +14 -0
- package/dist/modules/roles/services/modules.service.d.ts.map +1 -0
- package/dist/modules/roles/services/modules.service.js +69 -0
- package/dist/modules/roles/services/modules.service.js.map +1 -0
- package/dist/modules/roles/services/permissions.service.d.ts +14 -0
- package/dist/modules/roles/services/permissions.service.d.ts.map +1 -0
- package/dist/modules/roles/services/permissions.service.js +72 -0
- package/dist/modules/roles/services/permissions.service.js.map +1 -0
- package/dist/modules/roles/services/roles.service.d.ts +17 -0
- package/dist/modules/roles/services/roles.service.d.ts.map +1 -0
- package/dist/modules/roles/services/roles.service.js +100 -0
- package/dist/modules/roles/services/roles.service.js.map +1 -0
- package/dist/modules/roles/services/user-roles.service.d.ts +15 -0
- package/dist/modules/roles/services/user-roles.service.d.ts.map +1 -0
- package/dist/modules/roles/services/user-roles.service.js +88 -0
- package/dist/modules/roles/services/user-roles.service.js.map +1 -0
- package/dist/modules/roles/types/manifest.types.d.ts +12 -0
- package/dist/modules/roles/types/manifest.types.d.ts.map +1 -0
- package/dist/modules/roles/types/manifest.types.js +3 -0
- package/dist/modules/roles/types/manifest.types.js.map +1 -0
- package/dist/modules/sessions/controllers/session.controller.d.ts +17 -0
- package/dist/modules/sessions/controllers/session.controller.d.ts.map +1 -0
- package/dist/modules/sessions/controllers/session.controller.js +95 -0
- package/dist/modules/sessions/controllers/session.controller.js.map +1 -0
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts +21 -0
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts.map +1 -0
- package/dist/modules/sessions/entities/refresh-token.entity.js +77 -0
- package/dist/modules/sessions/entities/refresh-token.entity.js.map +1 -0
- package/dist/modules/sessions/index.d.ts +4 -0
- package/dist/modules/sessions/index.d.ts.map +1 -0
- package/dist/modules/sessions/index.js +20 -0
- package/dist/modules/sessions/index.js.map +1 -0
- package/dist/modules/sessions/services/token.service.d.ts +42 -0
- package/dist/modules/sessions/services/token.service.d.ts.map +1 -0
- package/dist/modules/sessions/services/token.service.js +253 -0
- package/dist/modules/sessions/services/token.service.js.map +1 -0
- package/dist/modules/sessions/sessions.module.d.ts +3 -0
- package/dist/modules/sessions/sessions.module.d.ts.map +1 -0
- package/dist/modules/sessions/sessions.module.js +28 -0
- package/dist/modules/sessions/sessions.module.js.map +1 -0
- package/dist/modules/settings/constants/settings.defaults.d.ts +60 -0
- package/dist/modules/settings/constants/settings.defaults.d.ts.map +1 -0
- package/dist/modules/settings/constants/settings.defaults.js +78 -0
- package/dist/modules/settings/constants/settings.defaults.js.map +1 -0
- package/dist/modules/settings/constants/settings.keys.d.ts +56 -0
- package/dist/modules/settings/constants/settings.keys.d.ts.map +1 -0
- package/dist/modules/settings/constants/settings.keys.js +58 -0
- package/dist/modules/settings/constants/settings.keys.js.map +1 -0
- package/dist/modules/settings/controllers/settings.controller.d.ts +13 -0
- package/dist/modules/settings/controllers/settings.controller.d.ts.map +1 -0
- package/dist/modules/settings/controllers/settings.controller.js +91 -0
- package/dist/modules/settings/controllers/settings.controller.js.map +1 -0
- package/dist/modules/settings/dto/settings.dto.d.ts +4 -0
- package/dist/modules/settings/dto/settings.dto.d.ts.map +1 -0
- package/dist/modules/settings/dto/settings.dto.js +24 -0
- package/dist/modules/settings/dto/settings.dto.js.map +1 -0
- package/dist/modules/settings/entities/app-setting.entity.d.ts +13 -0
- package/dist/modules/settings/entities/app-setting.entity.d.ts.map +1 -0
- package/dist/modules/settings/entities/app-setting.entity.js +56 -0
- package/dist/modules/settings/entities/app-setting.entity.js.map +1 -0
- package/dist/modules/settings/index.d.ts +8 -0
- package/dist/modules/settings/index.d.ts.map +1 -0
- package/dist/modules/settings/index.js +24 -0
- package/dist/modules/settings/index.js.map +1 -0
- package/dist/modules/settings/services/settings.service.d.ts +23 -0
- package/dist/modules/settings/services/settings.service.d.ts.map +1 -0
- package/dist/modules/settings/services/settings.service.js +116 -0
- package/dist/modules/settings/services/settings.service.js.map +1 -0
- package/dist/modules/settings/settings.manifest.d.ts +7 -0
- package/dist/modules/settings/settings.manifest.d.ts.map +1 -0
- package/dist/modules/settings/settings.manifest.js +25 -0
- package/dist/modules/settings/settings.manifest.js.map +1 -0
- package/dist/modules/settings/settings.module.d.ts +3 -0
- package/dist/modules/settings/settings.module.d.ts.map +1 -0
- package/dist/modules/settings/settings.module.js +27 -0
- package/dist/modules/settings/settings.module.js.map +1 -0
- package/dist/modules/users/controllers/users.controller.d.ts +41 -0
- package/dist/modules/users/controllers/users.controller.d.ts.map +1 -0
- package/dist/modules/users/controllers/users.controller.js +273 -0
- package/dist/modules/users/controllers/users.controller.js.map +1 -0
- package/dist/modules/users/dto/user.dto.d.ts +52 -0
- package/dist/modules/users/dto/user.dto.d.ts.map +1 -0
- package/dist/modules/users/dto/user.dto.js +139 -0
- package/dist/modules/users/dto/user.dto.js.map +1 -0
- package/dist/modules/users/entities/user.entity.d.ts +33 -0
- package/dist/modules/users/entities/user.entity.d.ts.map +1 -0
- package/dist/modules/users/entities/user.entity.js +130 -0
- package/dist/modules/users/entities/user.entity.js.map +1 -0
- package/dist/modules/users/index.d.ts +7 -0
- package/dist/modules/users/index.d.ts.map +1 -0
- package/dist/modules/users/index.js +23 -0
- package/dist/modules/users/index.js.map +1 -0
- package/dist/modules/users/services/invite.service.d.ts +35 -0
- package/dist/modules/users/services/invite.service.d.ts.map +1 -0
- package/dist/modules/users/services/invite.service.js +236 -0
- package/dist/modules/users/services/invite.service.js.map +1 -0
- package/dist/modules/users/services/users.service.d.ts +40 -0
- package/dist/modules/users/services/users.service.d.ts.map +1 -0
- package/dist/modules/users/services/users.service.js +239 -0
- package/dist/modules/users/services/users.service.js.map +1 -0
- package/dist/modules/users/users.manifest.d.ts +12 -0
- package/dist/modules/users/users.manifest.d.ts.map +1 -0
- package/dist/modules/users/users.manifest.js +43 -0
- package/dist/modules/users/users.manifest.js.map +1 -0
- package/dist/modules/users/users.module.d.ts +3 -0
- package/dist/modules/users/users.module.d.ts.map +1 -0
- package/dist/modules/users/users.module.js +36 -0
- package/dist/modules/users/users.module.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +140 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var OtpService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.OtpService = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const config_1 = require("@nestjs/config");
|
|
19
|
+
const otp_service_interface_1 = require("./interfaces/otp.service.interface");
|
|
20
|
+
const jobs_1 = require("../../jobs");
|
|
21
|
+
const redis_module_1 = require("../../config/redis.module");
|
|
22
|
+
const otp_session_store_1 = require("./services/otp.session.store");
|
|
23
|
+
const otp_rate_limiter_1 = require("./services/otp.rate-limiter");
|
|
24
|
+
const otp_utils_1 = require("./utils/otp.utils");
|
|
25
|
+
const settings_service_1 = require("../settings/services/settings.service");
|
|
26
|
+
const settings_keys_1 = require("../settings/constants/settings.keys");
|
|
27
|
+
let OtpService = OtpService_1 = class OtpService extends otp_service_interface_1.IOtpService {
|
|
28
|
+
constructor(redis, jobsQueue, sessionStore, rateLimiter, configService, settingsService) {
|
|
29
|
+
super();
|
|
30
|
+
this.redis = redis;
|
|
31
|
+
this.jobsQueue = jobsQueue;
|
|
32
|
+
this.sessionStore = sessionStore;
|
|
33
|
+
this.rateLimiter = rateLimiter;
|
|
34
|
+
this.configService = configService;
|
|
35
|
+
this.settingsService = settingsService;
|
|
36
|
+
this.logger = new common_1.Logger(OtpService_1.name);
|
|
37
|
+
if (!this.redis || !this.jobsQueue) {
|
|
38
|
+
this.logger.warn('OtpService: Redis or JobsQueue is disabled — OTP features unavailable. Set REDIS_ENABLED=true to enable.');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async generateOtp(identifier, channel) {
|
|
42
|
+
this.assertEnabled();
|
|
43
|
+
const normalized = channel === 'sms' ? (0, otp_utils_1.normalizePhone)(identifier) : (0, otp_utils_1.normalizeEmail)(identifier);
|
|
44
|
+
const test = this.getTestCredentials();
|
|
45
|
+
if (test && channel === 'sms' && normalized === test.phone) {
|
|
46
|
+
this.auditLog('otp.generated.test', {
|
|
47
|
+
identifier: (0, otp_utils_1.maskIdentifier)(normalized, channel),
|
|
48
|
+
});
|
|
49
|
+
return this.sessionStore.createSession(normalized, channel, test.code);
|
|
50
|
+
}
|
|
51
|
+
await this.rateLimiter.assertSendRateLimit(normalized, channel);
|
|
52
|
+
const result = await this.sessionStore.createSession(normalized, channel);
|
|
53
|
+
this.auditLog('otp.generated', { identifier: (0, otp_utils_1.maskIdentifier)(normalized, channel) });
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
async verifyOtp(sessionToken, code) {
|
|
57
|
+
this.assertEnabled();
|
|
58
|
+
this.assertValidUuid(sessionToken);
|
|
59
|
+
const session = await this.sessionStore.loadSession(sessionToken);
|
|
60
|
+
const { isValid, newAttempts, lockedOut, identifier, channel } = await this.sessionStore.verifyCodeAndTrackAttempts(sessionToken, code, session);
|
|
61
|
+
if (lockedOut) {
|
|
62
|
+
this.auditLog('otp.locked_out', {
|
|
63
|
+
identifier: (0, otp_utils_1.maskIdentifier)(identifier, channel),
|
|
64
|
+
attempts: newAttempts,
|
|
65
|
+
});
|
|
66
|
+
throw new common_1.BadRequestException('Maximum verification attempts exceeded. Please request a new OTP.');
|
|
67
|
+
}
|
|
68
|
+
if (!isValid) {
|
|
69
|
+
this.auditLog('otp.failed', {
|
|
70
|
+
identifier: (0, otp_utils_1.maskIdentifier)(identifier, channel),
|
|
71
|
+
attempts: newAttempts,
|
|
72
|
+
});
|
|
73
|
+
throw new common_1.BadRequestException('Invalid or expired code.');
|
|
74
|
+
}
|
|
75
|
+
this.auditLog('otp.verified', { identifier: (0, otp_utils_1.maskIdentifier)(identifier, channel) });
|
|
76
|
+
return {
|
|
77
|
+
success: true,
|
|
78
|
+
message: 'OTP verified successfully',
|
|
79
|
+
data: {
|
|
80
|
+
subject: identifier,
|
|
81
|
+
channel,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
async resendOtp(sessionToken) {
|
|
86
|
+
this.assertEnabled();
|
|
87
|
+
this.assertValidUuid(sessionToken);
|
|
88
|
+
const session = await this.sessionStore.loadSession(sessionToken);
|
|
89
|
+
const cooldown = this.settingsService.get(settings_keys_1.SETTING_KEYS.OTP_RESEND_COOLDOWN_SECONDS);
|
|
90
|
+
const elapsed = (Date.now() - session.lastSentAt) / 1000;
|
|
91
|
+
if (elapsed < cooldown) {
|
|
92
|
+
const remaining = Math.ceil(cooldown - elapsed);
|
|
93
|
+
throw new common_1.HttpException({
|
|
94
|
+
message: `Please wait ${remaining}s before requesting a new OTP.`,
|
|
95
|
+
retryAfter: remaining,
|
|
96
|
+
}, common_1.HttpStatus.TOO_MANY_REQUESTS, { description: `Retry-After: ${remaining}` });
|
|
97
|
+
}
|
|
98
|
+
const test = this.getTestCredentials();
|
|
99
|
+
const isTestIdentifier = !!test && session.channel === 'sms' && session.identifier === test.phone;
|
|
100
|
+
if (!isTestIdentifier) {
|
|
101
|
+
await this.rateLimiter.assertResendRateLimit(session.identifier, session.channel);
|
|
102
|
+
}
|
|
103
|
+
await this.sessionStore.deleteSession(sessionToken);
|
|
104
|
+
const result = await this.sessionStore.createSession(session.identifier, session.channel, isTestIdentifier ? test.code : undefined);
|
|
105
|
+
this.auditLog(isTestIdentifier ? 'otp.resent.test' : 'otp.resent', {
|
|
106
|
+
identifier: (0, otp_utils_1.maskIdentifier)(session.identifier, session.channel),
|
|
107
|
+
});
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
assertEnabled() {
|
|
111
|
+
if (!this.redis || !this.jobsQueue) {
|
|
112
|
+
throw new common_1.ServiceUnavailableException('OTP features require Redis. Set REDIS_ENABLED=true in your environment.');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
assertValidUuid(token) {
|
|
116
|
+
if (!otp_utils_1.UUID_RE.test(token)) {
|
|
117
|
+
throw new common_1.BadRequestException('Invalid session token format.');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
getTestCredentials() {
|
|
121
|
+
const isProd = this.configService.get('app.nodeEnv') === 'production';
|
|
122
|
+
if (isProd)
|
|
123
|
+
return null;
|
|
124
|
+
const phone = this.configService.get('app.testOtp.phone');
|
|
125
|
+
const code = this.configService.get('app.testOtp.code');
|
|
126
|
+
if (!phone || !code)
|
|
127
|
+
return null;
|
|
128
|
+
return { phone, code };
|
|
129
|
+
}
|
|
130
|
+
auditLog(event, meta) {
|
|
131
|
+
this.logger.log(JSON.stringify({ event, ...meta, ts: new Date().toISOString() }));
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
exports.OtpService = OtpService;
|
|
135
|
+
exports.OtpService = OtpService = OtpService_1 = __decorate([
|
|
136
|
+
(0, common_1.Injectable)(),
|
|
137
|
+
__param(0, (0, common_1.Optional)()),
|
|
138
|
+
__param(0, (0, common_1.Inject)(redis_module_1.REDIS_CLIENT)),
|
|
139
|
+
__param(1, (0, common_1.Optional)()),
|
|
140
|
+
__param(1, (0, common_1.Inject)(jobs_1.JobsQueue)),
|
|
141
|
+
__metadata("design:paramtypes", [Object, Object, otp_session_store_1.OtpSessionStore,
|
|
142
|
+
otp_rate_limiter_1.OtpRateLimiter,
|
|
143
|
+
config_1.ConfigService,
|
|
144
|
+
settings_service_1.SettingsService])
|
|
145
|
+
], OtpService);
|
|
146
|
+
//# sourceMappingURL=otp.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otp.service.js","sourceRoot":"","sources":["../../../modules/otp/otp.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,2CAA+C;AAE/C,8EAI4C;AAC5C,qCAAuC;AACvC,4DAAyD;AACzD,oEAA+D;AAC/D,kEAA6D;AAC7D,iDAA4F;AAC5F,4EAAwE;AACxE,uEAAmE;AAG5D,IAAM,UAAU,kBAAhB,MAAM,UAAW,SAAQ,mCAAW;IAG1C,YAGC,KAAsC,EAGtC,SAA4C,EAC3B,YAA6B,EAC7B,WAA2B,EAC3B,aAA4B,EAC5B,eAAgC;QAEjD,KAAK,EAAE,CAAC;QATS,UAAK,GAAL,KAAK,CAAgB;QAGrB,cAAS,GAAT,SAAS,CAAkB;QAC3B,iBAAY,GAAZ,YAAY,CAAiB;QAC7B,gBAAW,GAAX,WAAW,CAAgB;QAC3B,kBAAa,GAAb,aAAa,CAAe;QAC5B,oBAAe,GAAf,eAAe,CAAiB;QAZjC,WAAM,GAAG,IAAI,eAAM,CAAC,YAAU,CAAC,IAAI,CAAC,CAAC;QAerD,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,MAAM,CAAC,IAAI,CACf,0GAA0G,CAC1G,CAAC;QACH,CAAC;IACF,CAAC;IAID,KAAK,CAAC,WAAW,CAAC,UAAkB,EAAE,OAAwB;QAC7D,IAAI,CAAC,aAAa,EAAE,CAAC;QAErB,MAAM,UAAU,GACf,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,IAAA,0BAAc,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAA,0BAAc,EAAC,UAAU,CAAC,CAAC;QAE7E,MAAM,IAAI,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACvC,IAAI,IAAI,IAAI,OA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F,CAAC;IASO,kBAAkB;QACzB,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,aAAa,CAAC,KAAK,YAAY,CAAC;QAC9E,IAAI,MAAM;YAAE,OAAO,IAAI,CAAC;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,mBAAmB,CAAC,CAAC;QAClE,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,kBAAkB,CAAC,CAAC;QAChE,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACjC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACxB,CAAC;IAKO,QAAQ,CAAC,KAAa,EAAE,IAA6B;QAC5D,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC;IACnF,CAAC;CACD,CAAA;AA3KY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;IAKV,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,2BAAY,CAAC,CAAA;IAEpB,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,gBAAS,CAAC,CAAA;qDAEa,mCAAe;QAChB,iCAAc;QACZ,sBAAa;QACX,kCAAe;GAbtC,UAAU,CA2KtB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import IORedis from 'ioredis';
|
|
2
|
+
import { SettingsService } from '../../settings/services/settings.service';
|
|
3
|
+
export declare class OtpRateLimiter {
|
|
4
|
+
private readonly redis;
|
|
5
|
+
private readonly settingsService;
|
|
6
|
+
constructor(redis: IORedis | null, settingsService: SettingsService);
|
|
7
|
+
assertSendRateLimit(identifier: string, channel: 'sms' | 'email'): Promise<void>;
|
|
8
|
+
assertResendRateLimit(identifier: string, channel: 'sms' | 'email'): Promise<void>;
|
|
9
|
+
private evalRateLimit;
|
|
10
|
+
private rateKey;
|
|
11
|
+
private get client();
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=otp.rate-limiter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otp.rate-limiter.d.ts","sourceRoot":"","sources":["../../../../modules/otp/services/otp.rate-limiter.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAG3E,qBACa,cAAc;IAIzB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBADf,KAAK,EAAE,OAAO,GAAG,IAAI,EACrB,eAAe,EAAE,eAAe;IAY5C,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBhF,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;YAqB1E,aAAa;IAW3B,OAAO,CAAC,OAAO;IAIf,OAAO,KAAK,MAAM,GAEjB;CACD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.OtpRateLimiter = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const redis_module_1 = require("../../../config/redis.module");
|
|
18
|
+
const settings_service_1 = require("../../settings/services/settings.service");
|
|
19
|
+
const settings_keys_1 = require("../../settings/constants/settings.keys");
|
|
20
|
+
let OtpRateLimiter = class OtpRateLimiter {
|
|
21
|
+
constructor(redis, settingsService) {
|
|
22
|
+
this.redis = redis;
|
|
23
|
+
this.settingsService = settingsService;
|
|
24
|
+
}
|
|
25
|
+
async assertSendRateLimit(identifier, channel) {
|
|
26
|
+
const max = this.settingsService.get(settings_keys_1.SETTING_KEYS.OTP_RATE_LIMIT_MAX);
|
|
27
|
+
const window = this.settingsService.get(settings_keys_1.SETTING_KEYS.OTP_RATE_LIMIT_WINDOW_SECONDS);
|
|
28
|
+
const key = this.rateKey(identifier, channel);
|
|
29
|
+
const count = await this.evalRateLimit(key, window);
|
|
30
|
+
if (count > max) {
|
|
31
|
+
const ttl = await this.client.ttl(key);
|
|
32
|
+
throw new common_1.HttpException({
|
|
33
|
+
message: `Too many OTP requests. Please try again in ${ttl}s.`,
|
|
34
|
+
retryAfter: ttl,
|
|
35
|
+
}, common_1.HttpStatus.TOO_MANY_REQUESTS, { description: `Retry-After: ${ttl}` });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async assertResendRateLimit(identifier, channel) {
|
|
39
|
+
const max = this.settingsService.get(settings_keys_1.SETTING_KEYS.OTP_RATE_LIMIT_MAX);
|
|
40
|
+
const window = this.settingsService.get(settings_keys_1.SETTING_KEYS.OTP_RATE_LIMIT_WINDOW_SECONDS);
|
|
41
|
+
const key = this.rateKey(identifier, channel);
|
|
42
|
+
const count = await this.evalRateLimit(key, window);
|
|
43
|
+
if (count > max) {
|
|
44
|
+
const ttl = await this.client.ttl(key);
|
|
45
|
+
throw new common_1.HttpException({
|
|
46
|
+
message: `Too many OTP requests. Please try again in ${ttl}s.`,
|
|
47
|
+
retryAfter: ttl,
|
|
48
|
+
}, common_1.HttpStatus.TOO_MANY_REQUESTS, { description: `Retry-After: ${ttl}` });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async evalRateLimit(key, windowSeconds) {
|
|
52
|
+
return (await this.client.eval(`local n = redis.call('INCR', KEYS[1])
|
|
53
|
+
if n == 1 then redis.call('EXPIRE', KEYS[1], ARGV[1]) end
|
|
54
|
+
return n`, 1, key, String(windowSeconds)));
|
|
55
|
+
}
|
|
56
|
+
rateKey(identifier, channel) {
|
|
57
|
+
return `otp:rate:${channel}:${identifier}`;
|
|
58
|
+
}
|
|
59
|
+
get client() {
|
|
60
|
+
return this.redis;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.OtpRateLimiter = OtpRateLimiter;
|
|
64
|
+
exports.OtpRateLimiter = OtpRateLimiter = __decorate([
|
|
65
|
+
(0, common_1.Injectable)(),
|
|
66
|
+
__param(0, (0, common_1.Optional)()),
|
|
67
|
+
__param(0, (0, common_1.Inject)(redis_module_1.REDIS_CLIENT)),
|
|
68
|
+
__metadata("design:paramtypes", [Object, settings_service_1.SettingsService])
|
|
69
|
+
], OtpRateLimiter);
|
|
70
|
+
//# sourceMappingURL=otp.rate-limiter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otp.rate-limiter.js","sourceRoot":"","sources":["../../../../modules/otp/services/otp.rate-limiter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAy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CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAC9C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAEpD,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;YACjB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACvC,MAAM,IAAI,sBAAa,CACtB;gBACC,OAAO,EAAE,8CAA8C,GAAG,IAAI;gBAC9D,UAAU,EAAE,GAAG;aACf,EACD,mBAAU,CAAC,iBAAiB,EAC5B,EAAE,WAAW,EAAE,gBAAgB,GAAG,EAAE,EAAE,CACtC,CAAC;QACH,CAAC;IACF,CAAC;IAGO,KAAK,CAAC,aAAa,CAAC,GAAW,EAAE,aAAqB;QAC7D,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAC7B;;aAEU,EACV,CAAC,EACD,GAAG,EACH,MAAM,CAAC,aAAa,CAAC,CACrB,CAAW,CAAC;IACd,CAAC;IAEO,OAAO,CAAC,UAAkB,EAAE,OAAwB;QAC3D,OAAO,YAAY,OAAO,IAAI,UAAU,EAAE,CAAC;IAC5C,CAAC;IAED,IAAY,MAAM;QACjB,OAAO,IAAI,CAAC,KAAM,CAAC;IACpB,CAAC;CACD,CAAA;AAhFY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAGV,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,2BAAY,CAAC,CAAA;6CAEa,kCAAe;GALtC,cAAc,CAgF1B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import IORedis from 'ioredis';
|
|
2
|
+
import { JobsQueue } from '../../../jobs';
|
|
3
|
+
import { OtpGenerateResult } from '../interfaces/otp.service.interface';
|
|
4
|
+
import { OtpSessionData } from '../utils/otp.utils';
|
|
5
|
+
import { SettingsService } from '../../settings/services/settings.service';
|
|
6
|
+
export interface VerifyCodeResult {
|
|
7
|
+
isValid: boolean;
|
|
8
|
+
newAttempts: number;
|
|
9
|
+
lockedOut: boolean;
|
|
10
|
+
identifier: string;
|
|
11
|
+
channel: 'sms' | 'email';
|
|
12
|
+
}
|
|
13
|
+
export declare class OtpSessionStore {
|
|
14
|
+
private readonly redis;
|
|
15
|
+
private readonly jobsQueue;
|
|
16
|
+
private readonly settingsService;
|
|
17
|
+
private readonly logger;
|
|
18
|
+
constructor(redis: IORedis | null, jobsQueue: JobsQueue | null, settingsService: SettingsService);
|
|
19
|
+
isEnabled(): boolean;
|
|
20
|
+
createSession(identifier: string, channel: 'sms' | 'email', fixedCode?: string): Promise<OtpGenerateResult>;
|
|
21
|
+
loadSession(sessionToken: string): Promise<OtpSessionData>;
|
|
22
|
+
deleteSession(sessionToken: string): Promise<void>;
|
|
23
|
+
verifyCodeAndTrackAttempts(sessionToken: string, code: string, session: OtpSessionData): Promise<VerifyCodeResult>;
|
|
24
|
+
private sessionKey;
|
|
25
|
+
private correlationKey;
|
|
26
|
+
private get client();
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=otp.session.store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otp.session.store.d.ts","sourceRoot":"","sources":["../../../../modules/otp/services/otp.session.store.ts"],"names":[],"mappings":"AAUA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAgC,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAG3E,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC;CACzB;AAED,qBACa,eAAe;IAM1B,OAAO,CAAC,QAAQ,CAAC,KAAK;IAGtB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,eAAe;IATjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoC;gBAKzC,KAAK,EAAE,OAAO,GAAG,IAAI,EAGrB,SAAS,EAAE,SAAS,GAAG,IAAI,EAC3B,eAAe,EAAE,eAAe;IAGlD,SAAS,IAAI,OAAO;IAgBd,aAAa,CAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,KAAK,GAAG,OAAO,EACxB,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,iBAAiB,CAAC;IA+FvB,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAuB1D,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBlD,0BAA0B,CAC/B,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,cAAc,GACrB,OAAO,CAAC,gBAAgB,CAAC;IA+D5B,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,cAAc;IAItB,OAAO,KAAK,MAAM,GAEjB;CACD"}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
45
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
46
|
+
};
|
|
47
|
+
var OtpSessionStore_1;
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.OtpSessionStore = void 0;
|
|
50
|
+
const common_1 = require("@nestjs/common");
|
|
51
|
+
const crypto_1 = require("crypto");
|
|
52
|
+
const argon2 = __importStar(require("argon2"));
|
|
53
|
+
const redis_module_1 = require("../../../config/redis.module");
|
|
54
|
+
const jobs_1 = require("../../../jobs");
|
|
55
|
+
const otp_utils_1 = require("../utils/otp.utils");
|
|
56
|
+
const otp_constants_1 = require("../constants/otp.constants");
|
|
57
|
+
const settings_service_1 = require("../../settings/services/settings.service");
|
|
58
|
+
const settings_keys_1 = require("../../settings/constants/settings.keys");
|
|
59
|
+
let OtpSessionStore = OtpSessionStore_1 = class OtpSessionStore {
|
|
60
|
+
constructor(redis, jobsQueue, settingsService) {
|
|
61
|
+
this.redis = redis;
|
|
62
|
+
this.jobsQueue = jobsQueue;
|
|
63
|
+
this.settingsService = settingsService;
|
|
64
|
+
this.logger = new common_1.Logger(OtpSessionStore_1.name);
|
|
65
|
+
}
|
|
66
|
+
isEnabled() {
|
|
67
|
+
return !!(this.redis && this.jobsQueue);
|
|
68
|
+
}
|
|
69
|
+
async createSession(identifier, channel, fixedCode) {
|
|
70
|
+
const ttl = this.settingsService.get(settings_keys_1.SETTING_KEYS.OTP_TTL_SECONDS);
|
|
71
|
+
const resendIn = this.settingsService.get(settings_keys_1.SETTING_KEYS.OTP_RESEND_COOLDOWN_SECONDS);
|
|
72
|
+
const code = fixedCode ?? (0, otp_utils_1.generateCode)(otp_constants_1.OTP_CODE_LENGTH);
|
|
73
|
+
const sessionToken = (0, crypto_1.randomUUID)();
|
|
74
|
+
const otpCodeHash = await argon2.hash(code);
|
|
75
|
+
const now = Date.now();
|
|
76
|
+
const sessionData = {
|
|
77
|
+
identifier,
|
|
78
|
+
channel,
|
|
79
|
+
otpCodeHash,
|
|
80
|
+
attempts: 0,
|
|
81
|
+
lastSentAt: now,
|
|
82
|
+
};
|
|
83
|
+
try {
|
|
84
|
+
const result = await this.client.set(this.sessionKey(sessionToken), JSON.stringify(sessionData), 'EX', ttl);
|
|
85
|
+
if (result !== 'OK')
|
|
86
|
+
throw new Error('Redis SET returned unexpected result');
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
this.logger.error(`Redis SET failed for OTP session (${(0, otp_utils_1.maskIdentifier)(identifier, channel)})`, err);
|
|
90
|
+
throw new common_1.ServiceUnavailableException('Failed to create OTP session. Please try again.');
|
|
91
|
+
}
|
|
92
|
+
if (!fixedCode) {
|
|
93
|
+
const correlationId = (0, crypto_1.randomUUID)();
|
|
94
|
+
try {
|
|
95
|
+
await this.client.set(this.correlationKey(correlationId), code, 'EX', otp_constants_1.OTP_CORRELATION_TTL_SECONDS);
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
await this.client.del(this.sessionKey(sessionToken)).catch(() => undefined);
|
|
99
|
+
this.logger.error(`Correlation key write failed for ${(0, otp_utils_1.maskIdentifier)(identifier, channel)}`, err);
|
|
100
|
+
throw new common_1.ServiceUnavailableException('Failed to create OTP session. Please try again.');
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
if (channel === 'sms') {
|
|
104
|
+
await this.jobsQueue.addSendSms({ to: identifier, correlationId });
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
await this.jobsQueue.addSendEmail({
|
|
108
|
+
to: identifier,
|
|
109
|
+
subject: 'Your verification code',
|
|
110
|
+
template: 'otp',
|
|
111
|
+
data: { correlationId },
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
await Promise.allSettled([
|
|
117
|
+
this.client.del(this.sessionKey(sessionToken)),
|
|
118
|
+
this.client.del(this.correlationKey(correlationId)),
|
|
119
|
+
]);
|
|
120
|
+
this.logger.error(`${channel.toUpperCase()} enqueue failed for ${(0, otp_utils_1.maskIdentifier)(identifier, channel)} — session rolled back`, err);
|
|
121
|
+
throw new common_1.ServiceUnavailableException('Failed to send OTP. Please try again.');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
success: true,
|
|
126
|
+
message: 'OTP generated successfully',
|
|
127
|
+
data: {
|
|
128
|
+
verificationId: sessionToken,
|
|
129
|
+
expiresAt: now + ttl * 1000,
|
|
130
|
+
resendIn: resendIn * 1000,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
async loadSession(sessionToken) {
|
|
135
|
+
let raw;
|
|
136
|
+
try {
|
|
137
|
+
raw = await this.client.get(this.sessionKey(sessionToken));
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
this.logger.error('Redis GET failed during session load', err);
|
|
141
|
+
throw new common_1.ServiceUnavailableException('Failed to load OTP session. Please try again.');
|
|
142
|
+
}
|
|
143
|
+
if (!raw) {
|
|
144
|
+
throw new common_1.BadRequestException('Invalid or expired code.');
|
|
145
|
+
}
|
|
146
|
+
try {
|
|
147
|
+
return JSON.parse(raw);
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
this.logger.error(`Corrupted OTP session data for token ${sessionToken.slice(0, 8)}…`);
|
|
151
|
+
await this.client.del(this.sessionKey(sessionToken)).catch(() => undefined);
|
|
152
|
+
throw new common_1.BadRequestException('Invalid or expired code.');
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
async deleteSession(sessionToken) {
|
|
156
|
+
await this.client.del(this.sessionKey(sessionToken));
|
|
157
|
+
}
|
|
158
|
+
async verifyCodeAndTrackAttempts(sessionToken, code, session) {
|
|
159
|
+
const maxAttempts = this.settingsService.get(settings_keys_1.SETTING_KEYS.OTP_MAX_ATTEMPTS);
|
|
160
|
+
const key = this.sessionKey(sessionToken);
|
|
161
|
+
if (session.attempts >= maxAttempts) {
|
|
162
|
+
await this.client.del(key);
|
|
163
|
+
return {
|
|
164
|
+
isValid: false,
|
|
165
|
+
newAttempts: session.attempts,
|
|
166
|
+
lockedOut: true,
|
|
167
|
+
identifier: session.identifier,
|
|
168
|
+
channel: session.channel,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
const isValid = await argon2.verify(session.otpCodeHash, code);
|
|
172
|
+
if (!isValid) {
|
|
173
|
+
const [newAttempts, lockedOut] = (await this.client.eval(`local raw = redis.call('GET', KEYS[1])
|
|
174
|
+
if not raw then return {0, 0} end
|
|
175
|
+
local data = cjson.decode(raw)
|
|
176
|
+
data['attempts'] = data['attempts'] + 1
|
|
177
|
+
local locked = 0
|
|
178
|
+
if data['attempts'] >= tonumber(ARGV[1]) then
|
|
179
|
+
redis.call('DEL', KEYS[1])
|
|
180
|
+
locked = 1
|
|
181
|
+
else
|
|
182
|
+
local ttl = redis.call('TTL', KEYS[1])
|
|
183
|
+
if ttl > 0 then
|
|
184
|
+
redis.call('SET', KEYS[1], cjson.encode(data), 'EX', ttl)
|
|
185
|
+
else
|
|
186
|
+
redis.call('SET', KEYS[1], cjson.encode(data))
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
return {data['attempts'], locked}`, 1, key, String(maxAttempts)));
|
|
190
|
+
return {
|
|
191
|
+
isValid: false,
|
|
192
|
+
newAttempts,
|
|
193
|
+
lockedOut: lockedOut === 1,
|
|
194
|
+
identifier: session.identifier,
|
|
195
|
+
channel: session.channel,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
await this.client.del(key);
|
|
199
|
+
return {
|
|
200
|
+
isValid: true,
|
|
201
|
+
newAttempts: session.attempts,
|
|
202
|
+
lockedOut: false,
|
|
203
|
+
identifier: session.identifier,
|
|
204
|
+
channel: session.channel,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
sessionKey(sessionToken) {
|
|
208
|
+
return `otp:session:${sessionToken}`;
|
|
209
|
+
}
|
|
210
|
+
correlationKey(correlationId) {
|
|
211
|
+
return `otp:code:${correlationId}`;
|
|
212
|
+
}
|
|
213
|
+
get client() {
|
|
214
|
+
return this.redis;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
exports.OtpSessionStore = OtpSessionStore;
|
|
218
|
+
exports.OtpSessionStore = OtpSessionStore = OtpSessionStore_1 = __decorate([
|
|
219
|
+
(0, common_1.Injectable)(),
|
|
220
|
+
__param(0, (0, common_1.Optional)()),
|
|
221
|
+
__param(0, (0, common_1.Inject)(redis_module_1.REDIS_CLIENT)),
|
|
222
|
+
__param(1, (0, common_1.Optional)()),
|
|
223
|
+
__param(1, (0, common_1.Inject)(jobs_1.JobsQueue)),
|
|
224
|
+
__metadata("design:paramtypes", [Object, Object, settings_service_1.SettingsService])
|
|
225
|
+
], OtpSessionStore);
|
|
226
|
+
//# sourceMappingURL=otp.session.store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otp.session.store.js","sourceRoot":"","sources":["../../../../modules/otp/services/otp.session.store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,mCAAoC;AACpC,+CAAiC;AAEjC,+DAA4D;AAC5D,wCAA0C;AAE1C,kDAAkF;AAClF,8DAA0F;AAC1F,+EAA2E;AAC3E,0EAAsE;AAW/D,IAAM,eAAe,uBAArB,MAAM,eAAe;IAG3B,YAGC,KAAsC,EAGtC,SAA4C,EAC3B,eAAgC;QAJhC,UAAK,GAAL,KAAK,CAAgB;QAGrB,cAAS,GAAT,SAAS,CAAkB;QAC3B,oBAAe,GAAf,eAAe,CAAiB;QATjC,WAAM,GAAG,IAAI,eAAM,CAAC,iBAAe,CAAC,IAAI,CAAC,CAAC;IAUxD,CAAC;IAEJ,SAAS;QACR,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;I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OAAO,CAAC,OAAO;aACxB,CAAC;QACH,CAAC;QAGD,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAE3B,OAAO;YACN,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,OAAO,CAAC,QAAQ;YAC7B,SAAS,EAAE,KAAK;YAChB,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;SACxB,CAAC;IACH,CAAC;IAEO,UAAU,CAAC,YAAoB;QACtC,OAAO,eAAe,YAAY,EAAE,CAAC;IACtC,CAAC;IAEO,cAAc,CAAC,aAAqB;QAC3C,OAAO,YAAY,aAAa,EAAE,CAAC;IACpC,CAAC;IAED,IAAY,MAAM;QACjB,OAAO,IAAI,CAAC,KAAM,CAAC;IACpB,CAAC;CACD,CAAA;AArPY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAKV,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,2BAAY,CAAC,CAAA;IAEpB,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,gBAAS,CAAC,CAAA;qDAEgB,kCAAe;GAVtC,eAAe,CAqP3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../modules/otp/sms/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./sms-provider.interface"), exports);
|
|
18
|
+
__exportStar(require("./sms.module"), exports);
|
|
19
|
+
__exportStar(require("./providers"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../modules/otp/sms/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,+CAA6B;AAC7B,8CAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../modules/otp/sms/providers/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./twilio.provider"), exports);
|
|
18
|
+
__exportStar(require("./termii.provider"), exports);
|
|
19
|
+
__exportStar(require("./infobip.provider"), exports);
|
|
20
|
+
__exportStar(require("./smart-sms.provider"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/otp/sms/providers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,oDAAkC;AAClC,qDAAmC;AACnC,uDAAqC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SettingsService } from '../../../settings/services/settings.service';
|
|
2
|
+
import { ISmsProvider, SmsMessage } from '../sms-provider.interface';
|
|
3
|
+
export declare class InfobipProvider extends ISmsProvider {
|
|
4
|
+
private readonly settings;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
constructor(settings: SettingsService);
|
|
7
|
+
get isConfigured(): boolean;
|
|
8
|
+
send(message: SmsMessage): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=infobip.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infobip.provider.d.ts","sourceRoot":"","sources":["../../../../../modules/otp/sms/providers/infobip.provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvF,qBACa,eAAgB,SAAQ,YAAY;IAGpC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAFrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoC;gBAE9B,QAAQ,EAAE,eAAe;IAItD,IAAI,YAAY,IAAI,OAAO,CAE1B;IAEK,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAkC9C"}
|