@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,61 @@
|
|
|
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 InfobipProvider_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.InfobipProvider = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const settings_service_1 = require("../../../settings/services/settings.service");
|
|
16
|
+
const settings_keys_1 = require("../../../settings/constants/settings.keys");
|
|
17
|
+
const sms_provider_interface_1 = require("../sms-provider.interface");
|
|
18
|
+
let InfobipProvider = InfobipProvider_1 = class InfobipProvider extends sms_provider_interface_1.ISmsProvider {
|
|
19
|
+
constructor(settings) {
|
|
20
|
+
super();
|
|
21
|
+
this.settings = settings;
|
|
22
|
+
this.logger = new common_1.Logger(InfobipProvider_1.name);
|
|
23
|
+
}
|
|
24
|
+
get isConfigured() {
|
|
25
|
+
return !!this.settings.get(settings_keys_1.SETTING_KEYS.SMS_INFOBIP_API_KEY);
|
|
26
|
+
}
|
|
27
|
+
async send(message) {
|
|
28
|
+
const apiKey = this.settings.get(settings_keys_1.SETTING_KEYS.SMS_INFOBIP_API_KEY);
|
|
29
|
+
const baseUrl = this.settings.get(settings_keys_1.SETTING_KEYS.SMS_INFOBIP_BASE_URL);
|
|
30
|
+
const senderId = this.settings.get(settings_keys_1.SETTING_KEYS.SMS_INFOBIP_SENDER_ID);
|
|
31
|
+
const response = await fetch(`${baseUrl}/sms/2/text/advanced`, {
|
|
32
|
+
method: 'POST',
|
|
33
|
+
headers: {
|
|
34
|
+
Authorization: `App ${apiKey}`,
|
|
35
|
+
'Content-Type': 'application/json',
|
|
36
|
+
Accept: 'application/json',
|
|
37
|
+
},
|
|
38
|
+
body: JSON.stringify({
|
|
39
|
+
messages: [
|
|
40
|
+
{
|
|
41
|
+
from: senderId,
|
|
42
|
+
destinations: [{ to: message.to }],
|
|
43
|
+
text: message.body,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
}),
|
|
47
|
+
});
|
|
48
|
+
if (!response.ok) {
|
|
49
|
+
const error = await response.text();
|
|
50
|
+
this.logger.error(`Infobip send failed [${response.status}]: ${error}`);
|
|
51
|
+
throw new sms_provider_interface_1.SmsDeliveryError(`Infobip SMS delivery failed: ${response.status}`, response.status);
|
|
52
|
+
}
|
|
53
|
+
this.logger.debug(`Infobip SMS sent to ${message.to}`);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.InfobipProvider = InfobipProvider;
|
|
57
|
+
exports.InfobipProvider = InfobipProvider = InfobipProvider_1 = __decorate([
|
|
58
|
+
(0, common_1.Injectable)(),
|
|
59
|
+
__metadata("design:paramtypes", [settings_service_1.SettingsService])
|
|
60
|
+
], InfobipProvider);
|
|
61
|
+
//# sourceMappingURL=infobip.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infobip.provider.js","sourceRoot":"","sources":["../../../../../modules/otp/sms/providers/infobip.provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,kFAA8E;AAC9E,6EAAyE;AACzE,sEAAuF;AAGhF,IAAM,eAAe,uBAArB,MAAM,eAAgB,SAAQ,qCAAY;IAGhD,YAA6B,QAAyB;QACrD,KAAK,EAAE,CAAC;QADoB,aAAQ,GAAR,QAAQ,CAAiB;QAFrC,WAAM,GAAG,IAAI,eAAM,CAAC,iBAAe,CAAC,IAAI,CAAC,CAAC;IAI3D,CAAC;IAED,IAAI,YAAY;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M,CAAC,KAAK,CAAC,uBAAuB,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IACxD,CAAC;CACD,CAAA;AA7CY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAI2B,kCAAe;GAH1C,eAAe,CA6C3B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SettingsService } from '../../../settings/services/settings.service';
|
|
2
|
+
import { ISmsProvider, SmsMessage } from '../sms-provider.interface';
|
|
3
|
+
export declare class SmartSmsProvider extends ISmsProvider {
|
|
4
|
+
private readonly settings;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
private readonly baseUrl;
|
|
7
|
+
constructor(settings: SettingsService);
|
|
8
|
+
get isConfigured(): boolean;
|
|
9
|
+
send(message: SmsMessage): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=smart-sms.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-sms.provider.d.ts","sourceRoot":"","sources":["../../../../../modules/otp/sms/providers/smart-sms.provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvF,qBACa,gBAAiB,SAAQ,YAAY;IAIrC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAHrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgD;gBAE3C,QAAQ,EAAE,eAAe;IAItD,IAAI,YAAY,IAAI,OAAO,CAE1B;IAEK,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CA4B9C"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 SmartSmsProvider_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.SmartSmsProvider = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const settings_service_1 = require("../../../settings/services/settings.service");
|
|
16
|
+
const settings_keys_1 = require("../../../settings/constants/settings.keys");
|
|
17
|
+
const sms_provider_interface_1 = require("../sms-provider.interface");
|
|
18
|
+
let SmartSmsProvider = SmartSmsProvider_1 = class SmartSmsProvider extends sms_provider_interface_1.ISmsProvider {
|
|
19
|
+
constructor(settings) {
|
|
20
|
+
super();
|
|
21
|
+
this.settings = settings;
|
|
22
|
+
this.logger = new common_1.Logger(SmartSmsProvider_1.name);
|
|
23
|
+
this.baseUrl = 'https://smartsmssolutions.com/api/json.php';
|
|
24
|
+
}
|
|
25
|
+
get isConfigured() {
|
|
26
|
+
return !!this.settings.get(settings_keys_1.SETTING_KEYS.SMS_SMARTSMS_TOKEN);
|
|
27
|
+
}
|
|
28
|
+
async send(message) {
|
|
29
|
+
const token = this.settings.get(settings_keys_1.SETTING_KEYS.SMS_SMARTSMS_TOKEN);
|
|
30
|
+
const senderId = this.settings.get(settings_keys_1.SETTING_KEYS.SMS_SMARTSMS_SENDER_ID);
|
|
31
|
+
const response = await fetch(this.baseUrl, {
|
|
32
|
+
method: 'POST',
|
|
33
|
+
headers: { 'Content-Type': 'application/json' },
|
|
34
|
+
body: JSON.stringify({
|
|
35
|
+
token: token,
|
|
36
|
+
sender: senderId,
|
|
37
|
+
to: message.to,
|
|
38
|
+
message: message.body,
|
|
39
|
+
type: 0,
|
|
40
|
+
routing: 3,
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
43
|
+
if (!response.ok) {
|
|
44
|
+
const error = await response.text();
|
|
45
|
+
this.logger.error(`SmartSMS send failed [${response.status}]: ${error}`);
|
|
46
|
+
throw new sms_provider_interface_1.SmsDeliveryError(`SmartSMS delivery failed: ${response.status}`, response.status);
|
|
47
|
+
}
|
|
48
|
+
this.logger.debug(`SmartSMS SMS sent to ${message.to}`);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.SmartSmsProvider = SmartSmsProvider;
|
|
52
|
+
exports.SmartSmsProvider = SmartSmsProvider = SmartSmsProvider_1 = __decorate([
|
|
53
|
+
(0, common_1.Injectable)(),
|
|
54
|
+
__metadata("design:paramtypes", [settings_service_1.SettingsService])
|
|
55
|
+
], SmartSmsProvider);
|
|
56
|
+
//# sourceMappingURL=smart-sms.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-sms.provider.js","sourceRoot":"","sources":["../../../../../modules/otp/sms/providers/smart-sms.provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,kFAA8E;AAC9E,6EAAyE;AACzE,sEAAuF;AAGhF,IAAM,gBAAgB,wBAAtB,MAAM,gBAAiB,SAAQ,qCAAY;IAIjD,YAA6B,QAAyB;QACrD,KAAK,EAAE,CAAC;QADoB,aAAQ,GAAR,QAAQ,CAAiB;QAHrC,WAAM,GAAG,IAAI,eAAM,CAAC,kBAAgB,CAAC,IAAI,CAAC,CAAC;QAC3C,YAAO,GAAG,4CAA4C,CAAC;IAIxE,CAAC;IAED,IAAI,YAAY;QACf,OAAO,CAAC,C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wC5B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SettingsService } from '../../../settings/services/settings.service';
|
|
2
|
+
import { ISmsProvider, SmsMessage } from '../sms-provider.interface';
|
|
3
|
+
export declare class TermiiProvider extends ISmsProvider {
|
|
4
|
+
private readonly settings;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
private readonly baseUrl;
|
|
7
|
+
constructor(settings: SettingsService);
|
|
8
|
+
get isConfigured(): boolean;
|
|
9
|
+
send(message: SmsMessage): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=termii.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"termii.provider.d.ts","sourceRoot":"","sources":["../../../../../modules/otp/sms/providers/termii.provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvF,qBACa,cAAe,SAAQ,YAAY;IAInC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAHrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmC;IAC1D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;gBAE1B,QAAQ,EAAE,eAAe;IAItD,IAAI,YAAY,IAAI,OAAO,CAE1B;IAEK,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CA4B9C"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 TermiiProvider_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.TermiiProvider = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const settings_service_1 = require("../../../settings/services/settings.service");
|
|
16
|
+
const settings_keys_1 = require("../../../settings/constants/settings.keys");
|
|
17
|
+
const sms_provider_interface_1 = require("../sms-provider.interface");
|
|
18
|
+
let TermiiProvider = TermiiProvider_1 = class TermiiProvider extends sms_provider_interface_1.ISmsProvider {
|
|
19
|
+
constructor(settings) {
|
|
20
|
+
super();
|
|
21
|
+
this.settings = settings;
|
|
22
|
+
this.logger = new common_1.Logger(TermiiProvider_1.name);
|
|
23
|
+
this.baseUrl = 'https://v3.api.termii.com';
|
|
24
|
+
}
|
|
25
|
+
get isConfigured() {
|
|
26
|
+
return !!this.settings.get(settings_keys_1.SETTING_KEYS.SMS_TERMII_API_KEY);
|
|
27
|
+
}
|
|
28
|
+
async send(message) {
|
|
29
|
+
const apiKey = this.settings.get(settings_keys_1.SETTING_KEYS.SMS_TERMII_API_KEY);
|
|
30
|
+
const senderId = this.settings.get(settings_keys_1.SETTING_KEYS.SMS_TERMII_SENDER_ID);
|
|
31
|
+
const response = await fetch(`${this.baseUrl}/api/sms/send`, {
|
|
32
|
+
method: 'POST',
|
|
33
|
+
headers: { 'Content-Type': 'application/json' },
|
|
34
|
+
body: JSON.stringify({
|
|
35
|
+
to: message.to,
|
|
36
|
+
from: senderId,
|
|
37
|
+
sms: message.body,
|
|
38
|
+
type: 'plain',
|
|
39
|
+
api_key: apiKey,
|
|
40
|
+
channel: 'generic',
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
43
|
+
if (!response.ok) {
|
|
44
|
+
const error = await response.text();
|
|
45
|
+
this.logger.error(`Termii send failed [${response.status}]: ${error}`);
|
|
46
|
+
throw new sms_provider_interface_1.SmsDeliveryError(`Termii SMS delivery failed: ${response.status}`, response.status);
|
|
47
|
+
}
|
|
48
|
+
this.logger.debug(`Termii SMS sent to ${message.to}`);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.TermiiProvider = TermiiProvider;
|
|
52
|
+
exports.TermiiProvider = TermiiProvider = TermiiProvider_1 = __decorate([
|
|
53
|
+
(0, common_1.Injectable)(),
|
|
54
|
+
__metadata("design:paramtypes", [settings_service_1.SettingsService])
|
|
55
|
+
], TermiiProvider);
|
|
56
|
+
//# sourceMappingURL=termii.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"termii.provider.js","sourceRoot":"","sources":["../../../../../modules/otp/sms/providers/termii.provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,kFAA8E;AAC9E,6EAAyE;AACzE,sEAAuF;AAGhF,IAAM,cAAc,sBAApB,MAAM,cAAe,SAAQ,qCAAY;IAI/C,YAA6B,QAAyB;QACrD,KAAK,EAAE,CAAC;QADoB,aAAQ,GAAR,QAAQ,CAAiB;QAHrC,WAAM,GAAG,IAAI,eAAM,CAAC,gBAAc,CAAC,IAAI,CAAC,CAAC;QACzC,YAAO,GAAG,2BAA2B,CAAC;IAIvD,CAAC;IAED,IAAI,YAAY;QACf,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAS,4BAAY,CAAC,kBAAkB,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAmB;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAS,4BAAY,CAAC,kBAAkB,CAAC,CAAC;QAC1E,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAS,4BAAY,CAAC,oBAAoB,CAAC,CAAC;QAE9E,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,eAAe,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACpB,EAAE,EAAE,OAAO,CAAC,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,GAAG,EAAE,OAAO,CAAC,IAAI;gBACjB,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,MAAM;gBACf,OAAO,EAAE,SAAS;aAClB,CAAC;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YAClB,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,QAAQ,CAAC,MAAM,MAAM,KAAK,EAAE,CAAC,CAAC;YACvE,MAAM,IAAI,yCAAgB,CACzB,+BAA+B,QAAQ,CAAC,MAAM,EAAE,EAChD,QAAQ,CAAC,MAAM,CACf,CAAC;QACH,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IACvD,CAAC;CACD,CAAA;AAxCY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAK2B,kCAAe;GAJ1C,cAAc,CAwC1B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SettingsService } from '../../../settings/services/settings.service';
|
|
2
|
+
import { ISmsProvider, SmsMessage } from '../sms-provider.interface';
|
|
3
|
+
export declare class TwilioProvider 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=twilio.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"twilio.provider.d.ts","sourceRoot":"","sources":["../../../../../modules/otp/sms/providers/twilio.provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvF,qBACa,cAAe,SAAQ,YAAY;IAGnC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAFrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmC;gBAE7B,QAAQ,EAAE,eAAe;IAItD,IAAI,YAAY,IAAI,OAAO,CAK1B;IAEK,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAiC9C"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 TwilioProvider_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.TwilioProvider = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const settings_service_1 = require("../../../settings/services/settings.service");
|
|
16
|
+
const settings_keys_1 = require("../../../settings/constants/settings.keys");
|
|
17
|
+
const sms_provider_interface_1 = require("../sms-provider.interface");
|
|
18
|
+
let TwilioProvider = TwilioProvider_1 = class TwilioProvider extends sms_provider_interface_1.ISmsProvider {
|
|
19
|
+
constructor(settings) {
|
|
20
|
+
super();
|
|
21
|
+
this.settings = settings;
|
|
22
|
+
this.logger = new common_1.Logger(TwilioProvider_1.name);
|
|
23
|
+
}
|
|
24
|
+
get isConfigured() {
|
|
25
|
+
return !!(this.settings.get(settings_keys_1.SETTING_KEYS.SMS_TWILIO_ACCOUNT_SID) &&
|
|
26
|
+
this.settings.get(settings_keys_1.SETTING_KEYS.SMS_TWILIO_AUTH_TOKEN));
|
|
27
|
+
}
|
|
28
|
+
async send(message) {
|
|
29
|
+
const accountSid = this.settings.get(settings_keys_1.SETTING_KEYS.SMS_TWILIO_ACCOUNT_SID);
|
|
30
|
+
const authToken = this.settings.get(settings_keys_1.SETTING_KEYS.SMS_TWILIO_AUTH_TOKEN);
|
|
31
|
+
const fromNumber = this.settings.get(settings_keys_1.SETTING_KEYS.SMS_TWILIO_FROM_NUMBER);
|
|
32
|
+
const url = `https://api.twilio.com/2010-04-01/Accounts/${accountSid}/Messages.json`;
|
|
33
|
+
const body = new URLSearchParams({
|
|
34
|
+
To: message.to,
|
|
35
|
+
From: fromNumber,
|
|
36
|
+
Body: message.body,
|
|
37
|
+
});
|
|
38
|
+
const response = await fetch(url, {
|
|
39
|
+
method: 'POST',
|
|
40
|
+
headers: {
|
|
41
|
+
Authorization: `Basic ${Buffer.from(`${accountSid}:${authToken}`).toString('base64')}`,
|
|
42
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
43
|
+
},
|
|
44
|
+
body,
|
|
45
|
+
});
|
|
46
|
+
if (!response.ok) {
|
|
47
|
+
const error = await response.text();
|
|
48
|
+
this.logger.error(`Twilio send failed [${response.status}]: ${error}`);
|
|
49
|
+
throw new sms_provider_interface_1.SmsDeliveryError(`Twilio SMS delivery failed: ${response.status}`, response.status);
|
|
50
|
+
}
|
|
51
|
+
this.logger.debug(`Twilio SMS sent to ${message.to}`);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.TwilioProvider = TwilioProvider;
|
|
55
|
+
exports.TwilioProvider = TwilioProvider = TwilioProvider_1 = __decorate([
|
|
56
|
+
(0, common_1.Injectable)(),
|
|
57
|
+
__metadata("design:paramtypes", [settings_service_1.SettingsService])
|
|
58
|
+
], TwilioProvider);
|
|
59
|
+
//# sourceMappingURL=twilio.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"twilio.provider.js","sourceRoot":"","sources":["../../../../../modules/otp/sms/providers/twilio.provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,kFAA8E;AAC9E,6EAAyE;AACzE,sEAAuF;AAGhF,IAAM,cAAc,sBAApB,MAAM,cAAe,SAAQ,qCAAY;IAG/C,YAA6B,QAAyB;QACrD,KAAK,EAAE,CAAC;QADoB,aAAQ,GAAR,QAAQ,CAAiB;QAFrC,WAAM,GAAG,IAAI,eAAM,CAAC,gBAAc,CAAC,IAAI,CAAC,CAAC;IAI1D,CAAC;IAED,IAAI,YAAY;QACf,OAAO,CAAC,CAAC,CACR,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAS,4BAAY,CAAC,sBAAsB,CAAC;YAC9D,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAS,4BAAY,CAAC,qBAAqB,CAAC,CAC7D,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAmB;QAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAS,4BAAY,CAAC,sBAAsB,CAAC,CAAC;QAClF,MAAM,SAAS,GAAG,IAAI,CAAC,QA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: string;
|
|
3
|
+
body: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class SmsDeliveryError extends Error {
|
|
6
|
+
readonly status: number | null;
|
|
7
|
+
constructor(message: string, status: number | null);
|
|
8
|
+
}
|
|
9
|
+
export declare abstract class ISmsProvider {
|
|
10
|
+
abstract send(message: SmsMessage): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=sms-provider.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sms-provider.interface.d.ts","sourceRoot":"","sources":["../../../../modules/otp/sms/sms-provider.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IAE1B,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,MAAM,CAAC;CACb;AAOD,qBAAa,gBAAiB,SAAQ,KAAK;aAIzB,MAAM,EAAE,MAAM,GAAG,IAAI;gBAFrC,OAAO,EAAE,MAAM,EAEC,MAAM,EAAE,MAAM,GAAG,IAAI;CAKtC;AAMD,8BAAsB,YAAY;IACjC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CACjD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ISmsProvider = exports.SmsDeliveryError = void 0;
|
|
4
|
+
class SmsDeliveryError extends Error {
|
|
5
|
+
constructor(message, status) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.status = status;
|
|
8
|
+
this.name = 'SmsDeliveryError';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.SmsDeliveryError = SmsDeliveryError;
|
|
12
|
+
class ISmsProvider {
|
|
13
|
+
}
|
|
14
|
+
exports.ISmsProvider = ISmsProvider;
|
|
15
|
+
//# sourceMappingURL=sms-provider.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sms-provider.interface.js","sourceRoot":"","sources":["../../../../modules/otp/sms/sms-provider.interface.ts"],"names":[],"mappings":";;;AAYA,MAAa,gBAAiB,SAAQ,KAAK;IAC1C,YACC,OAAe,EAEC,MAAqB;QAErC,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,WAAM,GAAN,MAAM,CAAe;QAGrC,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IAChC,CAAC;CACD;AATD,4CASC;AAMD,MAAsB,YAAY;CAEjC;AAFD,oCAEC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { SettingsService } from '../../settings/services/settings.service';
|
|
3
|
+
import { ISmsProvider, SmsMessage } from './sms-provider.interface';
|
|
4
|
+
import { TwilioProvider } from './providers/twilio.provider';
|
|
5
|
+
import { TermiiProvider } from './providers/termii.provider';
|
|
6
|
+
import { InfobipProvider } from './providers/infobip.provider';
|
|
7
|
+
import { SmartSmsProvider } from './providers/smart-sms.provider';
|
|
8
|
+
export declare class SmsProxyService extends ISmsProvider implements OnModuleInit {
|
|
9
|
+
private readonly twilio;
|
|
10
|
+
private readonly termii;
|
|
11
|
+
private readonly infobip;
|
|
12
|
+
private readonly smartsms;
|
|
13
|
+
private readonly settings;
|
|
14
|
+
private readonly logger;
|
|
15
|
+
private readonly providerMap;
|
|
16
|
+
constructor(twilio: TwilioProvider, termii: TermiiProvider, infobip: InfobipProvider, smartsms: SmartSmsProvider, settings: SettingsService);
|
|
17
|
+
onModuleInit(): void;
|
|
18
|
+
send(message: SmsMessage): Promise<void>;
|
|
19
|
+
private resolve;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=sms-proxy.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sms-proxy.service.d.ts","sourceRoot":"","sources":["../../../../modules/otp/sms/sms-proxy.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAA+B,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOlE,qBACa,eAAgB,SAAQ,YAAa,YAAW,YAAY;IAMvE,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAT1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoC;IAE3D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+B;gBAGzC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,eAAe;IAM3C,YAAY,IAAI,IAAI;IAgBd,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9C,OAAO,CAAC,OAAO;CAWf"}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 SmsProxyService_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.SmsProxyService = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const settings_service_1 = require("../../settings/services/settings.service");
|
|
16
|
+
const settings_keys_1 = require("../../settings/constants/settings.keys");
|
|
17
|
+
const sms_provider_interface_1 = require("./sms-provider.interface");
|
|
18
|
+
const twilio_provider_1 = require("./providers/twilio.provider");
|
|
19
|
+
const termii_provider_1 = require("./providers/termii.provider");
|
|
20
|
+
const infobip_provider_1 = require("./providers/infobip.provider");
|
|
21
|
+
const smart_sms_provider_1 = require("./providers/smart-sms.provider");
|
|
22
|
+
let SmsProxyService = SmsProxyService_1 = class SmsProxyService extends sms_provider_interface_1.ISmsProvider {
|
|
23
|
+
constructor(twilio, termii, infobip, smartsms, settings) {
|
|
24
|
+
super();
|
|
25
|
+
this.twilio = twilio;
|
|
26
|
+
this.termii = termii;
|
|
27
|
+
this.infobip = infobip;
|
|
28
|
+
this.smartsms = smartsms;
|
|
29
|
+
this.settings = settings;
|
|
30
|
+
this.logger = new common_1.Logger(SmsProxyService_1.name);
|
|
31
|
+
this.providerMap = { twilio, termii, infobip, smartsms };
|
|
32
|
+
}
|
|
33
|
+
onModuleInit() {
|
|
34
|
+
const name = this.settings.get(settings_keys_1.SETTING_KEYS.SMS_ACTIVE_PROVIDER);
|
|
35
|
+
const provider = this.resolve(name);
|
|
36
|
+
if ('isConfigured' in provider && !provider.isConfigured) {
|
|
37
|
+
this.logger.warn(`⚠️ SMS provider "${name}" is selected but its credentials are not configured. ` +
|
|
38
|
+
`Set the required sms.${name}_* keys in app_settings. SMS delivery will fail until resolved.`);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.logger.log(`✅ SMS routing active — boot-time provider: "${name}" (live value read from app_settings on each send)`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async send(message) {
|
|
45
|
+
const name = this.settings.get(settings_keys_1.SETTING_KEYS.SMS_ACTIVE_PROVIDER);
|
|
46
|
+
return this.resolve(name).send(message);
|
|
47
|
+
}
|
|
48
|
+
resolve(name) {
|
|
49
|
+
const provider = this.providerMap[name];
|
|
50
|
+
if (!provider) {
|
|
51
|
+
this.logger.error(`❌ Unknown SMS provider "${name}". Valid options: ${Object.keys(this.providerMap).join(', ')}. ` +
|
|
52
|
+
`Update sms.active_provider in app_settings.`);
|
|
53
|
+
throw new common_1.ServiceUnavailableException(`Unknown SMS provider "${name}".`);
|
|
54
|
+
}
|
|
55
|
+
return provider;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.SmsProxyService = SmsProxyService;
|
|
59
|
+
exports.SmsProxyService = SmsProxyService = SmsProxyService_1 = __decorate([
|
|
60
|
+
(0, common_1.Injectable)(),
|
|
61
|
+
__metadata("design:paramtypes", [twilio_provider_1.TwilioProvider,
|
|
62
|
+
termii_provider_1.TermiiProvider,
|
|
63
|
+
infobip_provider_1.InfobipProvider,
|
|
64
|
+
smart_sms_provider_1.SmartSmsProvider,
|
|
65
|
+
settings_service_1.SettingsService])
|
|
66
|
+
], SmsProxyService);
|
|
67
|
+
//# sourceMappingURL=sms-proxy.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sms-proxy.service.js","sourceRoot":"","sources":["../../../../modules/otp/sms/sms-proxy.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA+F;AAC/F,+EAA2E;AAC3E,0EAAsE;AACtE,qEAAoE;AACpE,iEAA6D;AAC7D,iEAA6D;AAC7D,mEAA+D;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;QAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAChB,2BAA2B,IAAI,qBAAqB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;gBAC/F,6CAA6C,CAC9C,CAAC;YACF,MAAM,IAAI,oCAA2B,CAAC,yBAAyB,IAAI,IAAI,CAAC,CAAC;QAC1E,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD,CAAA;AAhDY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAOc,gCAAc;QACd,gCAAc;QACb,kCAAe;QACd,qCAAgB;QAChB,kCAAe;GAV/B,eAAe,CAgD3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sms.module.d.ts","sourceRoot":"","sources":["../../../../modules/otp/sms/sms.module.ts"],"names":[],"mappings":"AAQA,qBAWa,SAAS;CAAG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SmsModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const sms_provider_interface_1 = require("./sms-provider.interface");
|
|
12
|
+
const twilio_provider_1 = require("./providers/twilio.provider");
|
|
13
|
+
const termii_provider_1 = require("./providers/termii.provider");
|
|
14
|
+
const infobip_provider_1 = require("./providers/infobip.provider");
|
|
15
|
+
const smart_sms_provider_1 = require("./providers/smart-sms.provider");
|
|
16
|
+
const sms_proxy_service_1 = require("./sms-proxy.service");
|
|
17
|
+
let SmsModule = class SmsModule {
|
|
18
|
+
};
|
|
19
|
+
exports.SmsModule = SmsModule;
|
|
20
|
+
exports.SmsModule = SmsModule = __decorate([
|
|
21
|
+
(0, common_1.Module)({
|
|
22
|
+
providers: [
|
|
23
|
+
twilio_provider_1.TwilioProvider,
|
|
24
|
+
termii_provider_1.TermiiProvider,
|
|
25
|
+
infobip_provider_1.InfobipProvider,
|
|
26
|
+
smart_sms_provider_1.SmartSmsProvider,
|
|
27
|
+
sms_proxy_service_1.SmsProxyService,
|
|
28
|
+
{ provide: sms_provider_interface_1.ISmsProvider, useExisting: sms_proxy_service_1.SmsProxyService },
|
|
29
|
+
],
|
|
30
|
+
exports: [sms_provider_interface_1.ISmsProvider],
|
|
31
|
+
})
|
|
32
|
+
], SmsModule);
|
|
33
|
+
//# sourceMappingURL=sms.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sms.module.js","sourceRoot":"","sources":["../../../../modules/otp/sms/sms.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qEAAwD;AACxD,iEAA6D;AAC7D,iEAA6D;AAC7D,mEAA+D;AAC/D,uEAAkE;AAClE,2DAAsD;AAa/C,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAXrB,IAAA,eAAM,EAAC;QACP,SAAS,EAAE;YACV,gCAAc;YACd,gCAAc;YACd,kCAAe;YACf,qCAAgB;YAChB,mCAAe;YACf,EAAE,OAAO,EAAE,qCAAY,EAAE,WAAW,EAAE,mCAAe,EAAE;SACvD;QACD,OAAO,EAAE,CAAC,qCAAY,CAAC;KACvB,CAAC;GACW,SAAS,CAAG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const UUID_RE: RegExp;
|
|
2
|
+
export interface OtpSessionData {
|
|
3
|
+
identifier: string;
|
|
4
|
+
channel: 'sms' | 'email';
|
|
5
|
+
otpCodeHash: string;
|
|
6
|
+
attempts: number;
|
|
7
|
+
lastSentAt: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function generateCode(otpLength: number): string;
|
|
10
|
+
export declare function maskIdentifier(identifier: string, channel: 'sms' | 'email'): string;
|
|
11
|
+
export declare function normalizePhone(raw: string): string;
|
|
12
|
+
export declare function normalizeEmail(raw: string): string;
|
|
13
|
+
//# sourceMappingURL=otp.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otp.utils.d.ts","sourceRoot":"","sources":["../../../../modules/otp/utils/otp.utils.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,OAAO,QAA2E,CAAC;AAEhG,MAAM,WAAW,cAAc;IAE9B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACnB;AAOD,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGtD;AAOD,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,CAgBnF;AAOD,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAgBlD;AAGD,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMlD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UUID_RE = void 0;
|
|
4
|
+
exports.generateCode = generateCode;
|
|
5
|
+
exports.maskIdentifier = maskIdentifier;
|
|
6
|
+
exports.normalizePhone = normalizePhone;
|
|
7
|
+
exports.normalizeEmail = normalizeEmail;
|
|
8
|
+
const common_1 = require("@nestjs/common");
|
|
9
|
+
const crypto_1 = require("crypto");
|
|
10
|
+
const libphonenumber_js_1 = require("libphonenumber-js");
|
|
11
|
+
exports.UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
12
|
+
function generateCode(otpLength) {
|
|
13
|
+
const max = Math.min(10 ** otpLength, Number.MAX_SAFE_INTEGER);
|
|
14
|
+
return (0, crypto_1.randomInt)(0, max).toString().padStart(otpLength, '0');
|
|
15
|
+
}
|
|
16
|
+
function maskIdentifier(identifier, channel) {
|
|
17
|
+
if (channel === 'email') {
|
|
18
|
+
const [local, domain] = identifier.split('@');
|
|
19
|
+
if (!domain)
|
|
20
|
+
return '***';
|
|
21
|
+
const maskedLocal = local.length <= 2 ? '**' : `${local.slice(0, 2)}${'*'.repeat(local.length - 2)}`;
|
|
22
|
+
const domainParts = domain.split('.');
|
|
23
|
+
const tld = domainParts.pop() ?? '';
|
|
24
|
+
const maskedDomain = domainParts
|
|
25
|
+
.map((p) => (p.length <= 2 ? '**' : `${p.slice(0, 2)}${'*'.repeat(p.length - 2)}`))
|
|
26
|
+
.join('.');
|
|
27
|
+
return `${maskedLocal}@${maskedDomain}.${tld}`;
|
|
28
|
+
}
|
|
29
|
+
if (identifier.length < 6)
|
|
30
|
+
return '***';
|
|
31
|
+
return `${identifier.slice(0, 4)}****${identifier.slice(-2)}`;
|
|
32
|
+
}
|
|
33
|
+
function normalizePhone(raw) {
|
|
34
|
+
try {
|
|
35
|
+
const parsed = (0, libphonenumber_js_1.parsePhoneNumberWithError)(raw);
|
|
36
|
+
if (!parsed.isValid()) {
|
|
37
|
+
throw new common_1.BadRequestException('Invalid phone number.');
|
|
38
|
+
}
|
|
39
|
+
return parsed.number;
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
if (err instanceof common_1.BadRequestException)
|
|
43
|
+
throw err;
|
|
44
|
+
if (err instanceof libphonenumber_js_1.ParseError) {
|
|
45
|
+
throw new common_1.BadRequestException('Phone number must be in international format (e.g. +2348012345678).');
|
|
46
|
+
}
|
|
47
|
+
throw err;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function normalizeEmail(raw) {
|
|
51
|
+
const trimmed = raw.trim().toLowerCase();
|
|
52
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(trimmed)) {
|
|
53
|
+
throw new common_1.BadRequestException('Invalid email address.');
|
|
54
|
+
}
|
|
55
|
+
return trimmed;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=otp.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otp.utils.js","sourceRoot":"","sources":["../../../../modules/otp/utils/otp.utils.ts"],"names":[],"mappings":";;;AAsBA,oCAGC;AAOD,wCAgBC;AAOD,wCAgBC;AAGD,wCAMC;AAhFD,2CAAqD;AACrD,mCAAmC;AACnC,yDAA0E;AAI7D,QAAA,OAAO,GAAG,wEAAwE,CAAC;AAgBhG,SAAgB,YAAY,CAAC,SAAiB;IAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAC/D,OAAO,IAAA,kBAAS,EAAC,CAAC,EAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAC9D,CAAC;AAOD,SAAgB,cAAc,CAAC,UAAkB,EAAE,OAAwB;IAC1E,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACzB,MAAM,CAAC,KAAK,EAAE,MAAM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AAE,CAAC;YACvB,MAAM,IAAI,4BAAmB,CAAC,uBAAuB,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC;IACtB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,IAAI,GAAG,YAAY,4BAAmB;YAAE,MAAM,GAAG,CAAC;QAClD,IAAI,GAAG,YAAY,8BAAU,EAAE,CAAC;YAC/B,MAAM,IAAI,4BAAmB,CAC5B,qEAAqE,CACrE,CAAC;QACH,CAAC;QACD,MAAM,GAAG,CAAC;IACX,CAAC;AACF,CAAC;AAGD,SAAgB,cAAc,CAAC,GAAW;IACzC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACzC,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,4BAAmB,CAAC,wBAAwB,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ProfileService } from '../services/profile.service';
|
|
2
|
+
import { User } from '../../users/entities/user.entity';
|
|
3
|
+
import { UpdateProfileDto, ChangePhoneDto } from '../dto/profile.dto';
|
|
4
|
+
export declare class ProfileController {
|
|
5
|
+
private readonly profileService;
|
|
6
|
+
constructor(profileService: ProfileService);
|
|
7
|
+
getCurrentUser(user: User): Promise<User>;
|
|
8
|
+
updateProfile(user: User, updateDto: UpdateProfileDto): Promise<User>;
|
|
9
|
+
deleteAccount(user: User): Promise<{
|
|
10
|
+
message: string;
|
|
11
|
+
}>;
|
|
12
|
+
changePhoneNumber(user: User, changePhoneDto: ChangePhoneDto): Promise<User>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=profile.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.controller.d.ts","sourceRoot":"","sources":["../../../../modules/profile/controllers/profile.controller.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGtE,qBACa,iBAAiB;IACjB,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,cAAc;IAIrD,cAAc,CAAgB,IAAI,EAAE,IAAI;IAMxC,aAAa,CAAgB,IAAI,EAAE,IAAI,EAAU,SAAS,EAAE,gBAAgB;IAO5E,aAAa,CAAgB,IAAI,EAAE,IAAI;;;IAQvC,iBAAiB,CAAgB,IAAI,EAAE,IAAI,EAAU,cAAc,EAAE,cAAc;CAGzF"}
|