@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,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ModulesService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
const entities_1 = require("../entities");
|
|
20
|
+
let ModulesService = class ModulesService {
|
|
21
|
+
constructor(moduleRepository) {
|
|
22
|
+
this.moduleRepository = moduleRepository;
|
|
23
|
+
}
|
|
24
|
+
async create(dto) {
|
|
25
|
+
const existing = await this.moduleRepository.findOne({ where: { slug: dto.slug } });
|
|
26
|
+
if (existing) {
|
|
27
|
+
throw new common_1.ConflictException(`Module with slug '${dto.slug}' already exists`);
|
|
28
|
+
}
|
|
29
|
+
const mod = this.moduleRepository.create(dto);
|
|
30
|
+
return this.moduleRepository.save(mod);
|
|
31
|
+
}
|
|
32
|
+
async findAll() {
|
|
33
|
+
return this.moduleRepository.find({
|
|
34
|
+
relations: ['permissions'],
|
|
35
|
+
order: { slug: 'ASC' },
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async findById(id) {
|
|
39
|
+
const mod = await this.moduleRepository.findOne({
|
|
40
|
+
where: { id },
|
|
41
|
+
relations: ['permissions'],
|
|
42
|
+
});
|
|
43
|
+
if (!mod)
|
|
44
|
+
throw new common_1.NotFoundException(`Module ${id} not found`);
|
|
45
|
+
return mod;
|
|
46
|
+
}
|
|
47
|
+
async findBySlug(slug) {
|
|
48
|
+
return this.moduleRepository.findOne({
|
|
49
|
+
where: { slug },
|
|
50
|
+
relations: ['permissions'],
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
async update(id, dto) {
|
|
54
|
+
const mod = await this.findById(id);
|
|
55
|
+
Object.assign(mod, dto);
|
|
56
|
+
return this.moduleRepository.save(mod);
|
|
57
|
+
}
|
|
58
|
+
async delete(id) {
|
|
59
|
+
const mod = await this.findById(id);
|
|
60
|
+
await this.moduleRepository.remove(mod);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.ModulesService = ModulesService;
|
|
64
|
+
exports.ModulesService = ModulesService = __decorate([
|
|
65
|
+
(0, common_1.Injectable)(),
|
|
66
|
+
__param(0, (0, typeorm_1.InjectRepository)(entities_1.FeatureModule)),
|
|
67
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
68
|
+
], ModulesService);
|
|
69
|
+
//# sourceMappingURL=modules.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.service.js","sourceRoot":"","sources":["../../../../modules/roles/services/modules.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAkF;AAClF,6CAAmD;AACnD,qCAAqC;AACrC,0CAA4C;AAIrC,IAAM,cAAc,GAApB,MAAM,cAAc;IAC1B,YAEkB,gBAA2C;QAA3C,qBAAgB,GAAhB,gBAAgB,CAA2B;IAC1D,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,GAAoB;QAChC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,C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AC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACtB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACpC,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;CACD,CAAA;AAhDY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAGV,WAAA,IAAA,0BAAgB,EAAC,wBAAa,CAAC,CAAA;qCACG,oBAAU;GAHlC,cAAc,CAgD1B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { Permission } from '../entities';
|
|
3
|
+
import { CreatePermissionDto, UpdatePermissionDto } from '../dto';
|
|
4
|
+
export declare class PermissionsService {
|
|
5
|
+
private readonly permissionRepository;
|
|
6
|
+
constructor(permissionRepository: Repository<Permission>);
|
|
7
|
+
create(dto: CreatePermissionDto): Promise<Permission>;
|
|
8
|
+
findAll(moduleId?: string): Promise<Permission[]>;
|
|
9
|
+
findById(id: string): Promise<Permission>;
|
|
10
|
+
findBySlug(slug: string): Promise<Permission | null>;
|
|
11
|
+
update(id: string, dto: UpdatePermissionDto): Promise<Permission>;
|
|
12
|
+
delete(id: string): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=permissions.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.service.d.ts","sourceRoot":"","sources":["../../../../modules/roles/services/permissions.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAElE,qBACa,kBAAkB;IAG7B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBAApB,oBAAoB,EAAE,UAAU,CAAC,UAAU,CAAC;IAGxD,MAAM,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;IASrD,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAYjD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IASzC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAOpD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;IAMjE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAIvC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PermissionsService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
const entities_1 = require("../entities");
|
|
20
|
+
let PermissionsService = class PermissionsService {
|
|
21
|
+
constructor(permissionRepository) {
|
|
22
|
+
this.permissionRepository = permissionRepository;
|
|
23
|
+
}
|
|
24
|
+
async create(dto) {
|
|
25
|
+
const existing = await this.permissionRepository.findOne({ where: { slug: dto.slug } });
|
|
26
|
+
if (existing) {
|
|
27
|
+
throw new common_1.ConflictException(`Permission with slug '${dto.slug}' already exists`);
|
|
28
|
+
}
|
|
29
|
+
const permission = this.permissionRepository.create(dto);
|
|
30
|
+
return this.permissionRepository.save(permission);
|
|
31
|
+
}
|
|
32
|
+
async findAll(moduleId) {
|
|
33
|
+
const qb = this.permissionRepository
|
|
34
|
+
.createQueryBuilder('p')
|
|
35
|
+
.leftJoinAndSelect('p.featureModule', 'm');
|
|
36
|
+
if (moduleId) {
|
|
37
|
+
qb.where('p.module_id = :moduleId', { moduleId });
|
|
38
|
+
}
|
|
39
|
+
return qb.orderBy('m.slug', 'ASC').addOrderBy('p.slug', 'ASC').getMany();
|
|
40
|
+
}
|
|
41
|
+
async findById(id) {
|
|
42
|
+
const permission = await this.permissionRepository.findOne({
|
|
43
|
+
where: { id },
|
|
44
|
+
relations: ['featureModule'],
|
|
45
|
+
});
|
|
46
|
+
if (!permission)
|
|
47
|
+
throw new common_1.NotFoundException(`Permission ${id} not found`);
|
|
48
|
+
return permission;
|
|
49
|
+
}
|
|
50
|
+
async findBySlug(slug) {
|
|
51
|
+
return this.permissionRepository.findOne({
|
|
52
|
+
where: { slug },
|
|
53
|
+
relations: ['featureModule'],
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
async update(id, dto) {
|
|
57
|
+
const permission = await this.findById(id);
|
|
58
|
+
Object.assign(permission, dto);
|
|
59
|
+
return this.permissionRepository.save(permission);
|
|
60
|
+
}
|
|
61
|
+
async delete(id) {
|
|
62
|
+
const permission = await this.findById(id);
|
|
63
|
+
await this.permissionRepository.remove(permission);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.PermissionsService = PermissionsService;
|
|
67
|
+
exports.PermissionsService = PermissionsService = __decorate([
|
|
68
|
+
(0, common_1.Injectable)(),
|
|
69
|
+
__param(0, (0, typeorm_1.InjectRepository)(entities_1.Permission)),
|
|
70
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
71
|
+
], PermissionsService);
|
|
72
|
+
//# sourceMappingURL=permissions.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.service.js","sourceRoot":"","sources":["../../../../modules/roles/services/permissions.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAkF;AAClF,6CAAmD;AACnD,qCAAqC;AACrC,0CAAyC;AAIlC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC9B,YAEkB,oBAA4C;QAA5C,yBAAoB,GAApB,oBAAoB,CAAwB;IAC3D,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,GAAwB;QACpC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACxF,IAAI,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,0BAAiB,CAAC,yBAAyB,GAAG,CAAC,IAAI,kBAAkB,CAAC,CAAC;QAClF,CAAC;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAAiB;QAC9B,MAAM,EAAE,GAAG,IAAI,CAAC,oBAAoB;aAClC,kBAAkB,CAAC,GAAG,CAAC;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,MAAM,CAAC,UAAU,CAAC,CAAC;IACpD,CAAC;CACD,CAAA;AArDY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;IAGV,WAAA,IAAA,0BAAgB,EAAC,qBAAU,CAAC,CAAA;qCACU,oBAAU;GAHtC,kBAAkB,CAqD9B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { Role, Permission } from '../entities';
|
|
3
|
+
import { CreateRoleDto, UpdateRoleDto } from '../dto';
|
|
4
|
+
export declare class RolesService {
|
|
5
|
+
private readonly roleRepository;
|
|
6
|
+
private readonly permissionRepository;
|
|
7
|
+
constructor(roleRepository: Repository<Role>, permissionRepository: Repository<Permission>);
|
|
8
|
+
create(dto: CreateRoleDto): Promise<Role>;
|
|
9
|
+
findAll(): Promise<Role[]>;
|
|
10
|
+
findById(id: string): Promise<Role>;
|
|
11
|
+
findBySlug(slug: string): Promise<Role | null>;
|
|
12
|
+
update(id: string, dto: UpdateRoleDto): Promise<Role>;
|
|
13
|
+
delete(id: string): Promise<void>;
|
|
14
|
+
assignPermissions(roleId: string, permissionIds: string[]): Promise<Role>;
|
|
15
|
+
getPermissionSlugs(roleId: string): Promise<string[]>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=roles.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roles.service.d.ts","sourceRoot":"","sources":["../../../../modules/roles/services/roles.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAM,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEtD,qBACa,YAAY;IAGvB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAE/B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBAFpB,cAAc,EAAE,UAAU,CAAC,IAAI,CAAC,EAEhC,oBAAoB,EAAE,UAAU,CAAC,UAAU,CAAC;IAGxD,MAAM,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBzC,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAO1B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASnC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAO9C,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAWrD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKjC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAUzE,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAI3D"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.RolesService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
const entities_1 = require("../entities");
|
|
20
|
+
let RolesService = class RolesService {
|
|
21
|
+
constructor(roleRepository, permissionRepository) {
|
|
22
|
+
this.roleRepository = roleRepository;
|
|
23
|
+
this.permissionRepository = permissionRepository;
|
|
24
|
+
}
|
|
25
|
+
async create(dto) {
|
|
26
|
+
const existing = await this.roleRepository.findOne({ where: { slug: dto.slug } });
|
|
27
|
+
if (existing) {
|
|
28
|
+
throw new common_1.ConflictException(`Role with slug '${dto.slug}' already exists`);
|
|
29
|
+
}
|
|
30
|
+
const role = this.roleRepository.create({
|
|
31
|
+
slug: dto.slug,
|
|
32
|
+
name: dto.name,
|
|
33
|
+
description: dto.description,
|
|
34
|
+
});
|
|
35
|
+
const saved = await this.roleRepository.save(role);
|
|
36
|
+
if (dto.permissionIds?.length) {
|
|
37
|
+
await this.assignPermissions(saved.id, dto.permissionIds);
|
|
38
|
+
}
|
|
39
|
+
return this.findById(saved.id);
|
|
40
|
+
}
|
|
41
|
+
async findAll() {
|
|
42
|
+
return this.roleRepository.find({
|
|
43
|
+
relations: ['permissions'],
|
|
44
|
+
order: { slug: 'ASC' },
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
async findById(id) {
|
|
48
|
+
const role = await this.roleRepository.findOne({
|
|
49
|
+
where: { id },
|
|
50
|
+
relations: ['permissions'],
|
|
51
|
+
});
|
|
52
|
+
if (!role)
|
|
53
|
+
throw new common_1.NotFoundException(`Role ${id} not found`);
|
|
54
|
+
return role;
|
|
55
|
+
}
|
|
56
|
+
async findBySlug(slug) {
|
|
57
|
+
return this.roleRepository.findOne({
|
|
58
|
+
where: { slug },
|
|
59
|
+
relations: ['permissions'],
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
async update(id, dto) {
|
|
63
|
+
const role = await this.findById(id);
|
|
64
|
+
if (dto.name !== undefined)
|
|
65
|
+
role.name = dto.name;
|
|
66
|
+
if (dto.description !== undefined)
|
|
67
|
+
role.description = dto.description;
|
|
68
|
+
await this.roleRepository.save(role);
|
|
69
|
+
if (dto.permissionIds !== undefined) {
|
|
70
|
+
await this.assignPermissions(id, dto.permissionIds);
|
|
71
|
+
}
|
|
72
|
+
return this.findById(id);
|
|
73
|
+
}
|
|
74
|
+
async delete(id) {
|
|
75
|
+
const role = await this.findById(id);
|
|
76
|
+
await this.roleRepository.remove(role);
|
|
77
|
+
}
|
|
78
|
+
async assignPermissions(roleId, permissionIds) {
|
|
79
|
+
const role = await this.findById(roleId);
|
|
80
|
+
const permissions = await this.permissionRepository.find({
|
|
81
|
+
where: { id: (0, typeorm_2.In)(permissionIds) },
|
|
82
|
+
});
|
|
83
|
+
role.permissions = permissions;
|
|
84
|
+
await this.roleRepository.save(role);
|
|
85
|
+
return this.findById(roleId);
|
|
86
|
+
}
|
|
87
|
+
async getPermissionSlugs(roleId) {
|
|
88
|
+
const role = await this.findById(roleId);
|
|
89
|
+
return role.permissions.map((p) => p.slug);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
exports.RolesService = RolesService;
|
|
93
|
+
exports.RolesService = RolesService = __decorate([
|
|
94
|
+
(0, common_1.Injectable)(),
|
|
95
|
+
__param(0, (0, typeorm_1.InjectRepository)(entities_1.Role)),
|
|
96
|
+
__param(1, (0, typeorm_1.InjectRepository)(entities_1.Permission)),
|
|
97
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
98
|
+
typeorm_2.Repository])
|
|
99
|
+
], RolesService);
|
|
100
|
+
//# sourceMappingURL=roles.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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G,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACrC,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,MAAc,EAAE,aAAuB;QAC9D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC;YACxD,KAAK,EAAE,EAAE,EAAE,EAAE,IAAA,YAAE,EAAC,aAAa,CAAC,EAAE;SAChC,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,MAAc;QACtC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;CACD,CAAA;AA9EY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAGV,WAAA,IAAA,0BAAgB,EAAC,eAAI,CAAC,CAAA;IAEtB,WAAA,IAAA,0BAAgB,EAAC,qBAAU,CAAC,CAAA;qCADI,oBAAU;QAEJ,oBAAU;GALtC,YAAY,CA8ExB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { User } from '../../users/entities/user.entity';
|
|
3
|
+
import { Role } from '../entities';
|
|
4
|
+
import { AssignRolesDto } from '../dto';
|
|
5
|
+
export declare class UserRolesService {
|
|
6
|
+
private readonly userRepository;
|
|
7
|
+
private readonly roleRepository;
|
|
8
|
+
constructor(userRepository: Repository<User>, roleRepository: Repository<Role>);
|
|
9
|
+
assignRoles(userId: string, dto: AssignRolesDto): Promise<User>;
|
|
10
|
+
removeRoles(userId: string): Promise<User>;
|
|
11
|
+
getUserRoles(userId: string): Promise<Role[]>;
|
|
12
|
+
getUserPermissionSlugs(userId: string): Promise<string[]>;
|
|
13
|
+
private getUserWithRoles;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=user-roles.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-roles.service.d.ts","sourceRoot":"","sources":["../../../../modules/roles/services/user-roles.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAM,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC,qBACa,gBAAgB;IAG3B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAE/B,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAFd,cAAc,EAAE,UAAU,CAAC,IAAI,CAAC,EAEhC,cAAc,EAAE,UAAU,CAAC,IAAI,CAAC;IAG5C,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAe/D,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW1C,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAS7C,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAWjD,gBAAgB;CAQ9B"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.UserRolesService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
const user_entity_1 = require("../../users/entities/user.entity");
|
|
20
|
+
const entities_1 = require("../entities");
|
|
21
|
+
let UserRolesService = class UserRolesService {
|
|
22
|
+
constructor(userRepository, roleRepository) {
|
|
23
|
+
this.userRepository = userRepository;
|
|
24
|
+
this.roleRepository = roleRepository;
|
|
25
|
+
}
|
|
26
|
+
async assignRoles(userId, dto) {
|
|
27
|
+
const user = await this.userRepository.findOne({
|
|
28
|
+
where: { id: userId },
|
|
29
|
+
relations: ['roles'],
|
|
30
|
+
});
|
|
31
|
+
if (!user)
|
|
32
|
+
throw new common_1.NotFoundException(`User ${userId} not found`);
|
|
33
|
+
const roles = await this.roleRepository.find({
|
|
34
|
+
where: { id: (0, typeorm_2.In)(dto.roleIds) },
|
|
35
|
+
});
|
|
36
|
+
user.roles = roles;
|
|
37
|
+
await this.userRepository.save(user);
|
|
38
|
+
return this.getUserWithRoles(userId);
|
|
39
|
+
}
|
|
40
|
+
async removeRoles(userId) {
|
|
41
|
+
const user = await this.userRepository.findOne({
|
|
42
|
+
where: { id: userId },
|
|
43
|
+
relations: ['roles'],
|
|
44
|
+
});
|
|
45
|
+
if (!user)
|
|
46
|
+
throw new common_1.NotFoundException(`User ${userId} not found`);
|
|
47
|
+
user.roles = [];
|
|
48
|
+
await this.userRepository.save(user);
|
|
49
|
+
return this.getUserWithRoles(userId);
|
|
50
|
+
}
|
|
51
|
+
async getUserRoles(userId) {
|
|
52
|
+
const user = await this.userRepository.findOne({
|
|
53
|
+
where: { id: userId },
|
|
54
|
+
relations: ['roles', 'roles.permissions'],
|
|
55
|
+
});
|
|
56
|
+
if (!user)
|
|
57
|
+
throw new common_1.NotFoundException(`User ${userId} not found`);
|
|
58
|
+
return user.roles;
|
|
59
|
+
}
|
|
60
|
+
async getUserPermissionSlugs(userId) {
|
|
61
|
+
const roles = await this.getUserRoles(userId);
|
|
62
|
+
const slugs = new Set();
|
|
63
|
+
for (const role of roles) {
|
|
64
|
+
for (const perm of role.permissions) {
|
|
65
|
+
slugs.add(perm.slug);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return Array.from(slugs);
|
|
69
|
+
}
|
|
70
|
+
async getUserWithRoles(userId) {
|
|
71
|
+
const user = await this.userRepository.findOne({
|
|
72
|
+
where: { id: userId },
|
|
73
|
+
relations: ['roles', 'roles.permissions'],
|
|
74
|
+
});
|
|
75
|
+
if (!user)
|
|
76
|
+
throw new common_1.NotFoundException(`User ${userId} not found`);
|
|
77
|
+
return user;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
exports.UserRolesService = UserRolesService;
|
|
81
|
+
exports.UserRolesService = UserRolesService = __decorate([
|
|
82
|
+
(0, common_1.Injectable)(),
|
|
83
|
+
__param(0, (0, typeorm_1.InjectRepository)(user_entity_1.User)),
|
|
84
|
+
__param(1, (0, typeorm_1.InjectRepository)(entities_1.Role)),
|
|
85
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
86
|
+
typeorm_2.Repository])
|
|
87
|
+
], UserRolesService);
|
|
88
|
+
//# sourceMappingURL=user-roles.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-roles.service.js","sourceRoot":"","sources":["../../../../modules/roles/services/user-roles.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+D;AAC/D,6CAAmD;AACnD,qCAAyC;AACzC,kEAAwD;AACxD,0CAAmC;AAI5B,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC5B,YAEkB,cAAgC,EAEhC,cAAgC;QAFhC,mBAAc,GAAd,cAAc,CAAkB;QAEhC,mBAAc,GAAd,cAAc,CAAkB;IAC/C,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,MAAc,EAAE,GAAmB;QACpD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;YAC9C,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACrB,SAAS,EAAE,CAAC,OAAO,CAAC;SACpB,CAAC,CAAC;QACH,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,0BAAiB,CAAC,QAAQ,MAAM,YAAY,CAAC,CAAC;QAEnE,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;YAC5C,KAAK,EAAE,EAAE,EAAE,EAAE,IAAA,YAAE,EAAC,GAAG,CAAC,OAAO,CAAC,EAAE;SAC9B,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,W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AAK,CAAC,gBAAgB,CAAC,MAAc;QAC5C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;YAC9C,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACrB,SAAS,EAAE,CAAC,OAAO,EAAE,mBAAmB,CAAC;SACzC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,0BAAiB,CAAC,QAAQ,MAAM,YAAY,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAA;AA9DY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAGV,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;IAEtB,WAAA,IAAA,0BAAgB,EAAC,eAAI,CAAC,CAAA;qCADU,oBAAU;QAEV,oBAAU;GALhC,gBAAgB,CA8D5B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface PermissionManifest {
|
|
2
|
+
slug: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ModuleManifest {
|
|
7
|
+
slug: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
permissions: PermissionManifest[];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=manifest.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.types.d.ts","sourceRoot":"","sources":["../../../../modules/roles/types/manifest.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,kBAAkB,EAAE,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.types.js","sourceRoot":"","sources":["../../../../modules/roles/types/manifest.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Request } from 'express';
|
|
2
|
+
import { TokenService } from '../services/token.service';
|
|
3
|
+
import { RefreshTokenDto } from '../../auth/dto/token.dto';
|
|
4
|
+
import { User } from '../../users/entities/user.entity';
|
|
5
|
+
export declare class SessionController {
|
|
6
|
+
private readonly tokenService;
|
|
7
|
+
constructor(tokenService: TokenService);
|
|
8
|
+
refreshToken(body: RefreshTokenDto, req: Request): Promise<import("../../auth/dto/token.dto").TokenResponse>;
|
|
9
|
+
logout(user: User): Promise<{
|
|
10
|
+
message: string;
|
|
11
|
+
}>;
|
|
12
|
+
getActiveSessions(user: User): Promise<import("../entities/refresh-token.entity").RefreshToken[]>;
|
|
13
|
+
revokeSession(user: User, sessionId: string): Promise<{
|
|
14
|
+
message: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=session.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.controller.d.ts","sourceRoot":"","sources":["../../../../modules/sessions/controllers/session.controller.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAIzD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAGxD,qBAEa,iBAAiB;IACjB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,YAAY;IAMjD,YAAY,CAAS,IAAI,EAAE,eAAe,EAAS,GAAG,EAAE,OAAO;IAU/D,MAAM,CAAgB,IAAI,EAAE,IAAI;;;IAShC,iBAAiB,CAAgB,IAAI,EAAE,IAAI;IAS3C,aAAa,CAAgB,IAAI,EAAE,IAAI,EAAsB,SAAS,EAAE,MAAM;;;CAIpF"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SessionController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const token_service_1 = require("../services/token.service");
|
|
19
|
+
const refresh_token_entity_1 = require("../entities/refresh-token.entity");
|
|
20
|
+
const auth_guard_1 = require("../../../common/guards/auth.guard");
|
|
21
|
+
const decorators_1 = require("../../../common/decorators");
|
|
22
|
+
const token_dto_1 = require("../../auth/dto/token.dto");
|
|
23
|
+
const user_entity_1 = require("../../users/entities/user.entity");
|
|
24
|
+
const request_utils_1 = require("../../../common/utils/request.utils");
|
|
25
|
+
let SessionController = class SessionController {
|
|
26
|
+
constructor(tokenService) {
|
|
27
|
+
this.tokenService = tokenService;
|
|
28
|
+
}
|
|
29
|
+
async refreshToken(body, req) {
|
|
30
|
+
const { ip, deviceInfo } = (0, request_utils_1.extractRequestInfo)(req);
|
|
31
|
+
return this.tokenService.rotateRefreshToken(body.refreshToken, deviceInfo, ip);
|
|
32
|
+
}
|
|
33
|
+
async logout(user) {
|
|
34
|
+
await this.tokenService.revokeAllUserTokens(user.id, refresh_token_entity_1.RevokeReason.LOGOUT);
|
|
35
|
+
return { message: 'Logged out successfully' };
|
|
36
|
+
}
|
|
37
|
+
async getActiveSessions(user) {
|
|
38
|
+
return this.tokenService.getUserActiveSessions(user.id);
|
|
39
|
+
}
|
|
40
|
+
async revokeSession(user, sessionId) {
|
|
41
|
+
await this.tokenService.revokeRefreshToken(sessionId, refresh_token_entity_1.RevokeReason.LOGOUT);
|
|
42
|
+
return { message: 'Session revoked successfully' };
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.SessionController = SessionController;
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, decorators_1.Public)(),
|
|
48
|
+
(0, common_1.Post)('refresh'),
|
|
49
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
50
|
+
(0, swagger_1.ApiOperation)({ summary: 'Refresh tokens' }),
|
|
51
|
+
__param(0, (0, common_1.Body)()),
|
|
52
|
+
__param(1, (0, common_1.Req)()),
|
|
53
|
+
__metadata("design:type", Function),
|
|
54
|
+
__metadata("design:paramtypes", [token_dto_1.RefreshTokenDto, Object]),
|
|
55
|
+
__metadata("design:returntype", Promise)
|
|
56
|
+
], SessionController.prototype, "refreshToken", null);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard),
|
|
59
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
60
|
+
(0, common_1.Post)('logout'),
|
|
61
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
62
|
+
(0, swagger_1.ApiOperation)({ summary: 'Logout' }),
|
|
63
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
64
|
+
__metadata("design:type", Function),
|
|
65
|
+
__metadata("design:paramtypes", [user_entity_1.User]),
|
|
66
|
+
__metadata("design:returntype", Promise)
|
|
67
|
+
], SessionController.prototype, "logout", null);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard),
|
|
70
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
71
|
+
(0, common_1.Get)('sessions'),
|
|
72
|
+
(0, swagger_1.ApiOperation)({ summary: 'Get active sessions' }),
|
|
73
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
74
|
+
__metadata("design:type", Function),
|
|
75
|
+
__metadata("design:paramtypes", [user_entity_1.User]),
|
|
76
|
+
__metadata("design:returntype", Promise)
|
|
77
|
+
], SessionController.prototype, "getActiveSessions", null);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard),
|
|
80
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
81
|
+
(0, common_1.Post)('sessions/:sessionId/revoke'),
|
|
82
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
83
|
+
(0, swagger_1.ApiOperation)({ summary: 'Revoke a session' }),
|
|
84
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
85
|
+
__param(1, (0, common_1.Param)('sessionId')),
|
|
86
|
+
__metadata("design:type", Function),
|
|
87
|
+
__metadata("design:paramtypes", [user_entity_1.User, String]),
|
|
88
|
+
__metadata("design:returntype", Promise)
|
|
89
|
+
], SessionController.prototype, "revokeSession", null);
|
|
90
|
+
exports.SessionController = SessionController = __decorate([
|
|
91
|
+
(0, swagger_1.ApiTags)('Sessions'),
|
|
92
|
+
(0, common_1.Controller)('auth'),
|
|
93
|
+
__metadata("design:paramtypes", [token_service_1.TokenService])
|
|
94
|
+
], SessionController);
|
|
95
|
+
//# sourceMappingURL=session.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.controller.js","sourceRoot":"","sources":["../../../../modules/sessions/controllers/session.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,6CAAuE;AAEvE,6DAAyD;AACzD,2EAAgE;AAChE,kEAAiE;AACjE,2DAAiE;AACjE,wDAA2D;AAC3D,kEAAwD;AACxD,uEAAyE;AAIlE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC7B,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAMrD,AAAN,KAAK,CAAC,YAAY,CAAS,IAAqB,EAAS,GAAY;QACpE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,IAAA,kCAAkB,EAAC,GAAG,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;IAChF,CAAC;IAOK,AAAN,KAAK,CAAC,MAAM,CAAgB,IAAU;QACrC,MAAM,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,EAAE,mCAAY,CAAC,MAAM,CAAC,CAAC;QAC1E,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC;IAC/C,CAAC;IAMK,AAAN,KAAK,CAAC,iBAAiB,CAAgB,IAAU;QAChD,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzD,CAAC;IAOK,AAAN,KAAK,CAAC,aAAa,CAAgB,IAAU,EAAsB,SAAiB;QACnF,MAAM,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,SAAS,EAAE,mCAAY,CAAC,MAAM,CAAC,CAAC;QAC3E,OAAO,EAAE,OAAO,EAAE,8BAA8B,EAAE,CAAC;IACpD,CAAC;CACD,CAAA;AAvCY,8CAAiB;AAOv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3C,iBAAiB,CAuC7B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseEntity } from '../../../common/base/base.entity';
|
|
2
|
+
import { User } from '../../users/entities/user.entity';
|
|
3
|
+
export declare enum RevokeReason {
|
|
4
|
+
ROTATED = "rotated",
|
|
5
|
+
LOGOUT = "logout",
|
|
6
|
+
REUSE_DETECTED = "reuse_detected",
|
|
7
|
+
ADMIN = "admin"
|
|
8
|
+
}
|
|
9
|
+
export declare class RefreshToken extends BaseEntity {
|
|
10
|
+
userId: string;
|
|
11
|
+
tokenHash: string;
|
|
12
|
+
familyId: string;
|
|
13
|
+
providerRefreshToken?: string;
|
|
14
|
+
deviceInfo?: string;
|
|
15
|
+
ipAddress?: string;
|
|
16
|
+
expiresAt: Date;
|
|
17
|
+
isRevoked: boolean;
|
|
18
|
+
revokeReason?: RevokeReason;
|
|
19
|
+
user: User;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=refresh-token.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-token.entity.d.ts","sourceRoot":"","sources":["../../../../modules/sessions/entities/refresh-token.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAExD,oBAAY,YAAY;IACvB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,cAAc,mBAAmB;IACjC,KAAK,UAAU;CACf;AAED,qBACa,YAAa,SAAQ,UAAU;IAG3C,MAAM,EAAG,MAAM,CAAC;IAGhB,SAAS,EAAG,MAAM,CAAC;IASnB,QAAQ,EAAG,MAAM,CAAC;IAGlB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAG9B,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,SAAS,EAAG,IAAI,CAAC;IAGjB,SAAS,EAAG,OAAO,CAAC;IAQpB,YAAY,CAAC,EAAE,YAAY,CAAC;IAI5B,IAAI,EAAG,IAAI,CAAC;CACZ"}
|