@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,130 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.User = exports.UserStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_entity_1 = require("../../../common/base/base.entity");
|
|
15
|
+
const role_entity_1 = require("../../roles/entities/role.entity");
|
|
16
|
+
var UserStatus;
|
|
17
|
+
(function (UserStatus) {
|
|
18
|
+
UserStatus["ACTIVE"] = "active";
|
|
19
|
+
UserStatus["INVITED"] = "invited";
|
|
20
|
+
UserStatus["REVOKED"] = "revoked";
|
|
21
|
+
UserStatus["SUSPENDED"] = "suspended";
|
|
22
|
+
})(UserStatus || (exports.UserStatus = UserStatus = {}));
|
|
23
|
+
let User = class User extends base_entity_1.BaseEntity {
|
|
24
|
+
get fullName() {
|
|
25
|
+
return [this.firstName, this.lastName]
|
|
26
|
+
.filter((x) => x !== undefined && x !== null && x.trim().length > 0)
|
|
27
|
+
.join(' ');
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.User = User;
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ name: 'uid', unique: true, nullable: true }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], User.prototype, "uid", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ name: 'first_name' }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], User.prototype, "firstName", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ name: 'last_name' }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], User.prototype, "lastName", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ name: 'country_code', nullable: true }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], User.prototype, "countryCode", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Index)({ unique: true }),
|
|
49
|
+
(0, typeorm_1.Column)({ name: 'phone_number', unique: true, nullable: true }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], User.prototype, "phoneNumber", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ unique: true, nullable: true }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], User.prototype, "email", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ name: 'photo_url', nullable: true }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], User.prototype, "photoUrl", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({ name: 'password_hash', nullable: true, select: false }),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], User.prototype, "passwordHash", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ name: 'is_active', default: true }),
|
|
66
|
+
__metadata("design:type", Boolean)
|
|
67
|
+
], User.prototype, "isActive", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ name: 'is_email_verified', default: false }),
|
|
70
|
+
__metadata("design:type", Boolean)
|
|
71
|
+
], User.prototype, "isEmailVerified", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ name: 'is_phone_verified', default: false }),
|
|
74
|
+
__metadata("design:type", Boolean)
|
|
75
|
+
], User.prototype, "isPhoneVerified", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ name: 'last_login_at', type: 'timestamptz', nullable: true }),
|
|
78
|
+
__metadata("design:type", Date)
|
|
79
|
+
], User.prototype, "lastLoginAt", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({
|
|
82
|
+
name: 'status',
|
|
83
|
+
type: 'enum',
|
|
84
|
+
enum: UserStatus,
|
|
85
|
+
default: UserStatus.ACTIVE,
|
|
86
|
+
}),
|
|
87
|
+
__metadata("design:type", String)
|
|
88
|
+
], User.prototype, "status", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.Column)({ name: 'invite_token_hash', nullable: true, select: false }),
|
|
91
|
+
__metadata("design:type", String)
|
|
92
|
+
], User.prototype, "inviteTokenHash", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, typeorm_1.Index)(),
|
|
95
|
+
(0, typeorm_1.Column)({ name: 'invite_token_prefix', nullable: true, length: 12 }),
|
|
96
|
+
__metadata("design:type", String)
|
|
97
|
+
], User.prototype, "inviteTokenPrefix", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typeorm_1.Column)({ name: 'invite_token_expires_at', type: 'timestamptz', nullable: true }),
|
|
100
|
+
__metadata("design:type", Date)
|
|
101
|
+
], User.prototype, "inviteTokenExpiresAt", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, typeorm_1.Column)({ name: 'invited_by_id', nullable: true }),
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], User.prototype, "invitedById", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, typeorm_1.Column)({ name: 'invited_at', type: 'timestamptz', nullable: true }),
|
|
108
|
+
__metadata("design:type", Date)
|
|
109
|
+
], User.prototype, "invitedAt", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, typeorm_1.Column)({ name: 'deletion_requested_at', type: 'timestamptz', nullable: true }),
|
|
112
|
+
__metadata("design:type", Date)
|
|
113
|
+
], User.prototype, "deletionRequestedAt", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
116
|
+
__metadata("design:type", Object)
|
|
117
|
+
], User.prototype, "metadata", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, typeorm_1.ManyToMany)(() => role_entity_1.Role, (role) => role.users),
|
|
120
|
+
(0, typeorm_1.JoinTable)({
|
|
121
|
+
name: 'user_roles',
|
|
122
|
+
joinColumn: { name: 'user_id', referencedColumnName: 'id' },
|
|
123
|
+
inverseJoinColumn: { name: 'role_id', referencedColumnName: 'id' },
|
|
124
|
+
}),
|
|
125
|
+
__metadata("design:type", Array)
|
|
126
|
+
], User.prototype, "roles", void 0);
|
|
127
|
+
exports.User = User = __decorate([
|
|
128
|
+
(0, typeorm_1.Entity)('users')
|
|
129
|
+
], User);
|
|
130
|
+
//# sourceMappingURL=user.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../../modules/users/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AACvE,kEAA8D;AAC9D,kEAAwD;AAExD,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;AACxB,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAGM,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,wBAAU;IAkFnC,IAAI,QAAQ;QACX,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC;aACpC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC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E,CAAC;;sCACP;AAQnC;IANC,IAAA,oBAAU,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;IAC5C,IAAA,mBAAS,EAAC;QACV,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,oBAAoB,EAAE,IAAI,EAAE;QAC3D,iBAAiB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,oBAAoB,EAAE,IAAI,EAAE;KAClE,CAAC;;mCACa;eAhFH,IAAI;IADhB,IAAA,gBAAM,EAAC,OAAO,CAAC;GACH,IAAI,CAuFhB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './entities/user.entity';
|
|
2
|
+
export * from './services/users.service';
|
|
3
|
+
export * from './services/invite.service';
|
|
4
|
+
export * from './dto/user.dto';
|
|
5
|
+
export * from './users.module';
|
|
6
|
+
export * from './users.manifest';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../modules/users/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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("./entities/user.entity"), exports);
|
|
18
|
+
__exportStar(require("./services/users.service"), exports);
|
|
19
|
+
__exportStar(require("./services/invite.service"), exports);
|
|
20
|
+
__exportStar(require("./dto/user.dto"), exports);
|
|
21
|
+
__exportStar(require("./users.module"), exports);
|
|
22
|
+
__exportStar(require("./users.manifest"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../modules/users/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,2DAAyC;AACzC,4DAA0C;AAC1C,iDAA+B;AAC/B,iDAA+B;AAC/B,mDAAiC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { User } from '../entities/user.entity';
|
|
3
|
+
import { Role } from '../../roles/entities/role.entity';
|
|
4
|
+
import { InviteUserDto } from '../../auth/dto/invite.dto';
|
|
5
|
+
import { AcceptInviteDto } from '../../auth/dto/register.dto';
|
|
6
|
+
import { ConfigService } from '@nestjs/config';
|
|
7
|
+
import { SettingsService } from '../../settings/services/settings.service';
|
|
8
|
+
import { JobsQueue } from '../../../jobs';
|
|
9
|
+
export declare class InviteService {
|
|
10
|
+
private readonly userRepository;
|
|
11
|
+
private readonly roleRepository;
|
|
12
|
+
private readonly configService;
|
|
13
|
+
private readonly settingsService;
|
|
14
|
+
private readonly jobsQueue;
|
|
15
|
+
private readonly logger;
|
|
16
|
+
constructor(userRepository: Repository<User>, roleRepository: Repository<Role>, configService: ConfigService, settingsService: SettingsService, jobsQueue: JobsQueue | null);
|
|
17
|
+
inviteUser(dto: InviteUserDto, invitedById: string): Promise<{
|
|
18
|
+
message: string;
|
|
19
|
+
}>;
|
|
20
|
+
resendInvite(userId: string, invitedById: string): Promise<{
|
|
21
|
+
message: string;
|
|
22
|
+
}>;
|
|
23
|
+
revokeInvite(userId: string): Promise<{
|
|
24
|
+
message: string;
|
|
25
|
+
}>;
|
|
26
|
+
findMatchingInvitedUser(dto: AcceptInviteDto): Promise<User>;
|
|
27
|
+
acceptInvite(dto: AcceptInviteDto & {
|
|
28
|
+
uid?: string;
|
|
29
|
+
phone?: string;
|
|
30
|
+
countryCode?: string;
|
|
31
|
+
email?: string;
|
|
32
|
+
}, matchedUser: User, resolvedPhone?: string): Promise<User>;
|
|
33
|
+
private sendInviteEmail;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=invite.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invite.service.d.ts","sourceRoot":"","sources":["../../../../modules/users/services/invite.service.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAM,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,IAAI,EAAc,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,qBACa,aAAa;IAKxB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAE/B,OAAO,CAAC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PropertyDescriptor(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 InviteService_1;
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.InviteService = void 0;
|
|
50
|
+
const common_1 = require("@nestjs/common");
|
|
51
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
52
|
+
const typeorm_2 = require("typeorm");
|
|
53
|
+
const crypto_1 = require("crypto");
|
|
54
|
+
const argon2 = __importStar(require("argon2"));
|
|
55
|
+
const user_entity_1 = require("../entities/user.entity");
|
|
56
|
+
const role_entity_1 = require("../../roles/entities/role.entity");
|
|
57
|
+
const config_1 = require("@nestjs/config");
|
|
58
|
+
const settings_service_1 = require("../../settings/services/settings.service");
|
|
59
|
+
const settings_keys_1 = require("../../settings/constants/settings.keys");
|
|
60
|
+
const jobs_1 = require("../../../jobs");
|
|
61
|
+
let InviteService = InviteService_1 = class InviteService {
|
|
62
|
+
constructor(userRepository, roleRepository, configService, settingsService, jobsQueue) {
|
|
63
|
+
this.userRepository = userRepository;
|
|
64
|
+
this.roleRepository = roleRepository;
|
|
65
|
+
this.configService = configService;
|
|
66
|
+
this.settingsService = settingsService;
|
|
67
|
+
this.jobsQueue = jobsQueue;
|
|
68
|
+
this.logger = new common_1.Logger(InviteService_1.name);
|
|
69
|
+
}
|
|
70
|
+
async inviteUser(dto, invitedById) {
|
|
71
|
+
const existing = await this.userRepository.findOne({ where: { email: dto.email } });
|
|
72
|
+
if (existing) {
|
|
73
|
+
throw new common_1.ConflictException('A user with this email already exists.');
|
|
74
|
+
}
|
|
75
|
+
const rawToken = (0, crypto_1.randomUUID)();
|
|
76
|
+
const inviteTokenPrefix = rawToken.slice(0, 12);
|
|
77
|
+
const inviteTokenHash = await argon2.hash(rawToken);
|
|
78
|
+
const ttlDays = this.settingsService.get(settings_keys_1.SETTING_KEYS.TOKENS_INVITE_TTL_DAYS);
|
|
79
|
+
const expiresAt = new Date();
|
|
80
|
+
expiresAt.setDate(expiresAt.getDate() + ttlDays);
|
|
81
|
+
const roles = dto.roleIds?.length
|
|
82
|
+
? await this.roleRepository.find({ where: { id: (0, typeorm_2.In)(dto.roleIds) } })
|
|
83
|
+
: [];
|
|
84
|
+
const user = this.userRepository.create({
|
|
85
|
+
email: dto.email,
|
|
86
|
+
firstName: 'Invited',
|
|
87
|
+
lastName: 'User',
|
|
88
|
+
phoneNumber: `+00000000${Date.now()}`,
|
|
89
|
+
countryCode: '+000',
|
|
90
|
+
status: user_entity_1.UserStatus.INVITED,
|
|
91
|
+
inviteTokenHash,
|
|
92
|
+
inviteTokenPrefix,
|
|
93
|
+
inviteTokenExpiresAt: expiresAt,
|
|
94
|
+
invitedById,
|
|
95
|
+
invitedAt: new Date(),
|
|
96
|
+
isActive: false,
|
|
97
|
+
roles,
|
|
98
|
+
});
|
|
99
|
+
await this.userRepository.save(user);
|
|
100
|
+
await this.sendInviteEmail(dto.email, rawToken, ttlDays);
|
|
101
|
+
this.logger.log(`Invite sent to ${dto.email} by user ${invitedById}`);
|
|
102
|
+
return { message: `Invitation sent to ${dto.email}.` };
|
|
103
|
+
}
|
|
104
|
+
async resendInvite(userId, invitedById) {
|
|
105
|
+
const user = await this.userRepository
|
|
106
|
+
.createQueryBuilder('u')
|
|
107
|
+
.addSelect('u.invite_token_hash')
|
|
108
|
+
.where('u.id = :userId', { userId })
|
|
109
|
+
.getOne();
|
|
110
|
+
if (!user)
|
|
111
|
+
throw new common_1.NotFoundException('User not found');
|
|
112
|
+
if (user.status !== user_entity_1.UserStatus.INVITED)
|
|
113
|
+
throw new common_1.ForbiddenException('User is not in invited state');
|
|
114
|
+
const rawToken = (0, crypto_1.randomUUID)();
|
|
115
|
+
const inviteTokenPrefix = rawToken.slice(0, 12);
|
|
116
|
+
const inviteTokenHash = await argon2.hash(rawToken);
|
|
117
|
+
const ttlDays = this.settingsService.get(settings_keys_1.SETTING_KEYS.TOKENS_INVITE_TTL_DAYS);
|
|
118
|
+
const expiresAt = new Date();
|
|
119
|
+
expiresAt.setDate(expiresAt.getDate() + ttlDays);
|
|
120
|
+
await this.userRepository.update(user.id, {
|
|
121
|
+
inviteTokenHash,
|
|
122
|
+
inviteTokenPrefix,
|
|
123
|
+
inviteTokenExpiresAt: expiresAt,
|
|
124
|
+
});
|
|
125
|
+
await this.sendInviteEmail(user.email ?? '', rawToken, ttlDays);
|
|
126
|
+
this.logger.log(`Invite resent to ${user.email ?? userId} by ${invitedById}`);
|
|
127
|
+
return { message: 'Invitation resent.' };
|
|
128
|
+
}
|
|
129
|
+
async revokeInvite(userId) {
|
|
130
|
+
const user = await this.userRepository.findOne({ where: { id: userId } });
|
|
131
|
+
if (!user)
|
|
132
|
+
throw new common_1.NotFoundException('User not found');
|
|
133
|
+
if (user.status !== user_entity_1.UserStatus.INVITED)
|
|
134
|
+
throw new common_1.ForbiddenException('User is not in invited state');
|
|
135
|
+
await this.userRepository.update(user.id, {
|
|
136
|
+
status: user_entity_1.UserStatus.REVOKED,
|
|
137
|
+
inviteTokenHash: undefined,
|
|
138
|
+
inviteTokenPrefix: undefined,
|
|
139
|
+
inviteTokenExpiresAt: undefined,
|
|
140
|
+
});
|
|
141
|
+
return { message: 'Invitation revoked.' };
|
|
142
|
+
}
|
|
143
|
+
async findMatchingInvitedUser(dto) {
|
|
144
|
+
const prefix = dto.inviteToken.slice(0, 12);
|
|
145
|
+
const candidates = await this.userRepository
|
|
146
|
+
.createQueryBuilder('u')
|
|
147
|
+
.addSelect('u.invite_token_hash')
|
|
148
|
+
.where('u.status = :status', { status: user_entity_1.UserStatus.INVITED })
|
|
149
|
+
.andWhere('u.invite_token_expires_at > NOW()')
|
|
150
|
+
.andWhere('u.invite_token_prefix = :prefix', { prefix })
|
|
151
|
+
.getMany();
|
|
152
|
+
for (const candidate of candidates) {
|
|
153
|
+
if (candidate.inviteTokenHash) {
|
|
154
|
+
const matches = await argon2.verify(candidate.inviteTokenHash, dto.inviteToken);
|
|
155
|
+
if (matches)
|
|
156
|
+
return candidate;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
throw new common_1.UnauthorizedException('Invalid or expired invite token');
|
|
160
|
+
}
|
|
161
|
+
async acceptInvite(dto, matchedUser, resolvedPhone) {
|
|
162
|
+
let phoneNumber = matchedUser.phoneNumber;
|
|
163
|
+
let isPhoneVerified = false;
|
|
164
|
+
if (dto._authMethod === 'phone' && resolvedPhone) {
|
|
165
|
+
phoneNumber = resolvedPhone;
|
|
166
|
+
isPhoneVerified = true;
|
|
167
|
+
const existingPhone = await this.userRepository.findOne({ where: { phoneNumber } });
|
|
168
|
+
if (existingPhone && existingPhone.id !== matchedUser.id) {
|
|
169
|
+
throw new common_1.ConflictException('This phone number is already registered to another account.');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
let passwordHash;
|
|
173
|
+
if (dto.password && this.configService.get('app.auth.provider') === 'native') {
|
|
174
|
+
passwordHash = await argon2.hash(dto.password);
|
|
175
|
+
}
|
|
176
|
+
await this.userRepository.update(matchedUser.id, {
|
|
177
|
+
uid: dto.uid ?? matchedUser.uid,
|
|
178
|
+
firstName: dto.firstName,
|
|
179
|
+
lastName: dto.lastName,
|
|
180
|
+
phoneNumber: resolvedPhone ?? dto.phone ?? matchedUser.phoneNumber,
|
|
181
|
+
countryCode: dto.countryCode ?? matchedUser.countryCode,
|
|
182
|
+
status: user_entity_1.UserStatus.ACTIVE,
|
|
183
|
+
isActive: true,
|
|
184
|
+
isPhoneVerified,
|
|
185
|
+
inviteTokenHash: undefined,
|
|
186
|
+
inviteTokenPrefix: undefined,
|
|
187
|
+
inviteTokenExpiresAt: undefined,
|
|
188
|
+
});
|
|
189
|
+
if (passwordHash) {
|
|
190
|
+
await this.userRepository.query('UPDATE users SET password_hash = $1 WHERE id = $2', [
|
|
191
|
+
passwordHash,
|
|
192
|
+
matchedUser.id,
|
|
193
|
+
]);
|
|
194
|
+
}
|
|
195
|
+
this.logger.log(`Invite accepted by user: ${matchedUser.id} (${dto._authMethod}-method)`);
|
|
196
|
+
return this.userRepository.findOneOrFail({ where: { id: matchedUser.id } });
|
|
197
|
+
}
|
|
198
|
+
async sendInviteEmail(email, rawToken, ttlDays) {
|
|
199
|
+
if (!email)
|
|
200
|
+
return;
|
|
201
|
+
if (!this.jobsQueue) {
|
|
202
|
+
this.logger.warn('JobsQueue unavailable — invite email will not be sent');
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const appUrl = this.configService.get('app.url') ?? '';
|
|
206
|
+
const inviteUrl = `${appUrl}/auth/accept-invite?token=${rawToken}`;
|
|
207
|
+
await this.jobsQueue.addSendEmail({
|
|
208
|
+
to: email,
|
|
209
|
+
subject: "You've been invited",
|
|
210
|
+
template: 'invite',
|
|
211
|
+
data: {
|
|
212
|
+
html: `
|
|
213
|
+
<p>Hi,</p>
|
|
214
|
+
<p>You have been invited to join the platform. Click the link below to set up your account:</p>
|
|
215
|
+
<p><a href="${inviteUrl}" style="font-weight:bold">Accept Invitation</a></p>
|
|
216
|
+
<p>This invitation expires in ${ttlDays} day${ttlDays !== 1 ? 's' : ''}.</p>
|
|
217
|
+
<p>If you were not expecting this invitation, you can safely ignore this email.</p>
|
|
218
|
+
`.trim(),
|
|
219
|
+
text: `You've been invited!\n\nAccept your invitation: ${inviteUrl}\n\nThis invitation expires in ${ttlDays} day${ttlDays !== 1 ? 's' : ''}.`,
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
exports.InviteService = InviteService;
|
|
225
|
+
exports.InviteService = InviteService = InviteService_1 = __decorate([
|
|
226
|
+
(0, common_1.Injectable)(),
|
|
227
|
+
__param(0, (0, typeorm_1.InjectRepository)(user_entity_1.User)),
|
|
228
|
+
__param(1, (0, typeorm_1.InjectRepository)(role_entity_1.Role)),
|
|
229
|
+
__param(4, (0, common_1.Optional)()),
|
|
230
|
+
__param(4, (0, common_1.Inject)(jobs_1.JobsQueue)),
|
|
231
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
232
|
+
typeorm_2.Repository,
|
|
233
|
+
config_1.ConfigService,
|
|
234
|
+
settings_service_1.SettingsService, Object])
|
|
235
|
+
], InviteService);
|
|
236
|
+
//# sourceMappingURL=invite.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invite.service.js","sourceRoot":"","sources":["../../../../modules/users/services/invite.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,6CAAmD;AACnD,qCAAyC;AACzC,mCAAoC;AACpC,+CAAiC;AACjC,yDAA2D;AAC3D,kEAAwD;AAGxD,2CAA+C;AAC/C,+EAA2E;AAC3E,0EAAsE;AACtE,wCAA0C;AAGnC,IAAM,aAAa,qBAAnB,MAAM,aAAa;IAGzB,YAEC,cAAiD,EAEjD,cAAiD,EAChC,aAA4B,EAC5B,eAAgC,EAGjD,SAA4C;QAP3B,mBAAc,GAAd,cAAc,CAAkB;QAEhC,mBAAc,GAAd,cAAc,CAAkB;QAChC,kBAAa,GAAb,aAAa,CAAe;QAC5B,oBAAe,GAAf,eAAe,CAAiB;QAGhC,cAAS,GAAT,SAAS,CAAkB;QAX5B,WAAM,GAAG,IAAI,eAAM,CAAC,eAAa,CAAC,IAAI,CAAC,CAAC;IAYtD,CAAC;IAEJ,KAAK,CAAC,UAAU,CAAC,GAAkB,EAAE,WAAmB;QACvD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE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AC,uDAAuD,CAAC,CAAC;YAC1E,OAAO;QACR,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,SAAS,CAAC,IAAI,EAAE,CAAC;QAC/D,MAAM,SAAS,GAAG,GAAG,MAAM,6BAA6B,QAAQ,EAAE,CAAC;QAEnE,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;YACjC,EAAE,EAAE,KAAK;YACT,OAAO,EAAE,qBAAqB;YAC9B,QAAQ,EAAE,QAAQ;YAClB,IAAI,EAAE;gBACL,IAAI,EAAE;;;mBAGS,SAAS;qCACS,OAAO,OAAO,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;KAEtE,CAAC,IAAI,EAAE;gBACR,IAAI,EAAE,mDAAmD,SAAS,kCAAkC,OAAO,OAAO,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG;aAC7I;SACD,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;AAtNY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAKV,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;IAEtB,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;IAItB,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,eAAM,EAAC,gBAAS,CAAC,CAAA;qCANe,oBAAU;QAEV,oBAAU;QACX,sBAAa;QACX,kCAAe;GATtC,aAAa,CAsNzB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import IORedis from 'ioredis';
|
|
3
|
+
import { User } from '../entities/user.entity';
|
|
4
|
+
import { CreateUserDto, FindByOptions, UpdateUserDto, UserFilterDto } from '../dto/user.dto';
|
|
5
|
+
import { PaginationOptions, PaginatedResult } from '../../../common/base/base.repository';
|
|
6
|
+
import { SettingsService } from '../../settings/services/settings.service';
|
|
7
|
+
export declare class UsersService {
|
|
8
|
+
private readonly userRepository;
|
|
9
|
+
private readonly redis;
|
|
10
|
+
private readonly settingsService;
|
|
11
|
+
constructor(userRepository: Repository<User>, redis: IORedis | null, settingsService: SettingsService);
|
|
12
|
+
create(createUserDto: CreateUserDto): Promise<User>;
|
|
13
|
+
findAll(options?: PaginationOptions & UserFilterDto): Promise<PaginatedResult<User>>;
|
|
14
|
+
getStats(): Promise<{
|
|
15
|
+
total: number;
|
|
16
|
+
active: number;
|
|
17
|
+
invited: number;
|
|
18
|
+
suspended: number;
|
|
19
|
+
revoked: number;
|
|
20
|
+
}>;
|
|
21
|
+
findById(id: string): Promise<User | null>;
|
|
22
|
+
findByIdWithPassword(id: string): Promise<User | null>;
|
|
23
|
+
findByEmailWithPassword(email: string): Promise<User | null>;
|
|
24
|
+
setPasswordHash(id: string, hash: string): Promise<void>;
|
|
25
|
+
findByIdOrFail(id: string): Promise<User>;
|
|
26
|
+
private normalizeSearchOptions;
|
|
27
|
+
findBy(options: FindByOptions): Promise<User | null>;
|
|
28
|
+
update(id: string, updateUserDto: UpdateUserDto): Promise<User>;
|
|
29
|
+
updateLastLogin(id: string): Promise<void>;
|
|
30
|
+
delete(id: string): Promise<void>;
|
|
31
|
+
deactivate(id: string): Promise<User>;
|
|
32
|
+
activate(id: string): Promise<User>;
|
|
33
|
+
verifyEmail(id: string): Promise<User>;
|
|
34
|
+
verifyPhone(id: string): Promise<User>;
|
|
35
|
+
count(): Promise<number>;
|
|
36
|
+
countActiveUsers(): Promise<number>;
|
|
37
|
+
countCreatedToday(): Promise<number>;
|
|
38
|
+
private writeBanKey;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=users.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.service.d.ts","sourceRoot":"","sources":["../../../../modules/users/services/users.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,UAAU,EAAE,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