@neohm/nestend 3.0.2 → 3.0.4
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/README.md +157 -81
- package/dist/admin/admin.module.d.ts +2 -3
- package/dist/admin/admin.module.d.ts.map +1 -1
- package/dist/admin/admin.module.js +9 -2
- package/dist/admin/admin.module.js.map +1 -1
- package/dist/admin/controllers/admin.scheduled.task.controller.js +1 -1
- package/dist/admin/controllers/admin.scheduled.task.controller.js.map +1 -1
- package/dist/admin/controllers/admin.tenant.controller.d.ts +5 -1
- package/dist/admin/controllers/admin.tenant.controller.d.ts.map +1 -1
- package/dist/admin/controllers/admin.tenant.controller.js +10 -4
- package/dist/admin/controllers/admin.tenant.controller.js.map +1 -1
- package/dist/admin/controllers/admin.user.controller.d.ts +6 -2
- package/dist/admin/controllers/admin.user.controller.d.ts.map +1 -1
- package/dist/admin/controllers/admin.user.controller.js +10 -4
- package/dist/admin/controllers/admin.user.controller.js.map +1 -1
- package/dist/admin/libraries/admin.user.data.processor.d.ts.map +1 -1
- package/dist/admin/libraries/admin.user.data.processor.js +2 -1
- package/dist/admin/libraries/admin.user.data.processor.js.map +1 -1
- package/dist/admin/libraries/bulk.user.data.processor.d.ts +2 -5
- package/dist/admin/libraries/bulk.user.data.processor.d.ts.map +1 -1
- package/dist/admin/libraries/bulk.user.data.processor.js +4 -3
- package/dist/admin/libraries/bulk.user.data.processor.js.map +1 -1
- package/dist/admin/libraries/client.user.data.processor.d.ts +9 -1
- package/dist/admin/libraries/client.user.data.processor.d.ts.map +1 -1
- package/dist/admin/libraries/client.user.data.processor.js +42 -2
- package/dist/admin/libraries/client.user.data.processor.js.map +1 -1
- package/dist/admin/libraries/tenant.data.processor.d.ts +8 -1
- package/dist/admin/libraries/tenant.data.processor.d.ts.map +1 -1
- package/dist/admin/libraries/tenant.data.processor.js +40 -2
- package/dist/admin/libraries/tenant.data.processor.js.map +1 -1
- package/dist/admin/types/admin.types.d.ts +9 -0
- package/dist/admin/types/admin.types.d.ts.map +1 -0
- package/dist/admin/types/admin.types.js +3 -0
- package/dist/admin/types/admin.types.js.map +1 -0
- package/dist/auth/auth.module.d.ts +2 -3
- package/dist/auth/auth.module.d.ts.map +1 -1
- package/dist/auth/auth.module.js.map +1 -1
- package/dist/auth/controllers/admin.auth.controller.js +1 -1
- package/dist/auth/controllers/admin.auth.controller.js.map +1 -1
- package/dist/auth/controllers/auth.controller.js +1 -1
- package/dist/auth/controllers/auth.controller.js.map +1 -1
- package/dist/auth/es6.classes.d.ts +2 -12
- package/dist/auth/es6.classes.d.ts.map +1 -1
- package/dist/auth/es6.classes.js +2 -24
- package/dist/auth/es6.classes.js.map +1 -1
- package/dist/auth/helpers/admin.auth.d.ts.map +1 -1
- package/dist/auth/helpers/admin.auth.js.map +1 -1
- package/dist/auth/helpers/auth.d.ts.map +1 -1
- package/dist/auth/helpers/auth.js.map +1 -1
- package/dist/auth/processors/change.password.data.processor.d.ts.map +1 -1
- package/dist/auth/processors/change.password.data.processor.js.map +1 -1
- package/dist/auth/processors/register.user.data.processor.d.ts.map +1 -1
- package/dist/auth/processors/register.user.data.processor.js +2 -1
- package/dist/auth/processors/register.user.data.processor.js.map +1 -1
- package/dist/auth/services/admin.auth.service.d.ts.map +1 -1
- package/dist/auth/services/admin.auth.service.js +1 -0
- package/dist/auth/services/admin.auth.service.js.map +1 -1
- package/dist/auth/services/auth.service.d.ts.map +1 -1
- package/dist/auth/services/auth.service.js +1 -0
- package/dist/auth/services/auth.service.js.map +1 -1
- package/dist/auth/types/auth.types.d.ts +11 -0
- package/dist/auth/types/auth.types.d.ts.map +1 -1
- package/dist/auth/utilities/auth.utilities.d.ts +2 -0
- package/dist/auth/utilities/auth.utilities.d.ts.map +1 -1
- package/dist/auth/utilities/auth.utilities.js +7 -0
- package/dist/auth/utilities/auth.utilities.js.map +1 -1
- package/dist/common/consumers/job.consumer.d.ts +4 -0
- package/dist/common/consumers/job.consumer.d.ts.map +1 -1
- package/dist/common/consumers/job.consumer.js +22 -2
- package/dist/common/consumers/job.consumer.js.map +1 -1
- package/dist/common/entities/scheduled.event.entity.d.ts.map +1 -1
- package/dist/common/entities/scheduled.event.entity.js.map +1 -1
- package/dist/common/es6.classes.d.ts +3 -21
- package/dist/common/es6.classes.d.ts.map +1 -1
- package/dist/common/es6.classes.js +2 -20
- package/dist/common/es6.classes.js.map +1 -1
- package/dist/common/jobs/dispatch.scheduled.event.job.d.ts +2 -0
- package/dist/common/jobs/dispatch.scheduled.event.job.d.ts.map +1 -1
- package/dist/common/jobs/dispatch.scheduled.event.job.js +18 -7
- package/dist/common/jobs/dispatch.scheduled.event.job.js.map +1 -1
- package/dist/common/jobs/set.scheduled.event.job.d.ts +1 -2
- package/dist/common/jobs/set.scheduled.event.job.d.ts.map +1 -1
- package/dist/common/jobs/set.scheduled.event.job.js +22 -19
- package/dist/common/jobs/set.scheduled.event.job.js.map +1 -1
- package/dist/common/jobs/system.scheduled.task.job.d.ts.map +1 -1
- package/dist/common/jobs/system.scheduled.task.job.js +3 -1
- package/dist/common/jobs/system.scheduled.task.job.js.map +1 -1
- package/dist/common/libraries/common.data.processor.d.ts +2 -4
- package/dist/common/libraries/common.data.processor.d.ts.map +1 -1
- package/dist/common/libraries/common.data.processor.js.map +1 -1
- package/dist/common/queue.module.d.ts.map +1 -1
- package/dist/common/queue.module.js +8 -0
- package/dist/common/queue.module.js.map +1 -1
- package/dist/common/services/queue.service.d.ts +2 -2
- package/dist/common/services/queue.service.d.ts.map +1 -1
- package/dist/common/services/queue.service.js.map +1 -1
- package/dist/common/services/system.property.service.d.ts +3 -4
- package/dist/common/services/system.property.service.d.ts.map +1 -1
- package/dist/common/services/system.property.service.js +12 -14
- package/dist/common/services/system.property.service.js.map +1 -1
- package/dist/common/subscribers/common.subscriber.d.ts.map +1 -1
- package/dist/common/subscribers/common.subscriber.js +8 -0
- package/dist/common/subscribers/common.subscriber.js.map +1 -1
- package/dist/common/system.property.module.d.ts +2 -3
- package/dist/common/system.property.module.d.ts.map +1 -1
- package/dist/common/system.property.module.js.map +1 -1
- package/dist/common/types/data.processor.types.d.ts +5 -0
- package/dist/common/types/data.processor.types.d.ts.map +1 -0
- package/dist/common/types/data.processor.types.js +3 -0
- package/dist/common/types/data.processor.types.js.map +1 -0
- package/dist/common/types/queue.types.d.ts +1 -0
- package/dist/common/types/queue.types.d.ts.map +1 -1
- package/dist/common/types/system.property.types.d.ts +12 -0
- package/dist/common/types/system.property.types.d.ts.map +1 -0
- package/dist/common/types/system.property.types.js +3 -0
- package/dist/common/types/system.property.types.js.map +1 -0
- package/dist/constants/job.constants.d.ts +0 -16
- package/dist/constants/job.constants.d.ts.map +1 -1
- package/dist/constants/job.constants.js +0 -16
- package/dist/constants/job.constants.js.map +1 -1
- package/dist/constants/job.maps.d.ts +0 -32
- package/dist/constants/job.maps.d.ts.map +1 -1
- package/dist/constants/job.maps.js +0 -32
- package/dist/constants/job.maps.js.map +1 -1
- package/dist/document/document.module.d.ts +2 -3
- package/dist/document/document.module.d.ts.map +1 -1
- package/dist/document/document.module.js.map +1 -1
- package/dist/document/types/document.types.d.ts +3 -0
- package/dist/document/types/document.types.d.ts.map +1 -1
- package/dist/global/filters/global.exception.filter.d.ts.map +1 -1
- package/dist/global/filters/global.exception.filter.js.map +1 -1
- package/dist/global/types/exception.filter.types.d.ts +9 -0
- package/dist/global/types/exception.filter.types.d.ts.map +1 -0
- package/dist/global/types/exception.filter.types.js +3 -0
- package/dist/global/types/exception.filter.types.js.map +1 -0
- package/dist/global/types/seeder.utility.types.d.ts +5 -0
- package/dist/global/types/seeder.utility.types.d.ts.map +1 -0
- package/dist/global/types/seeder.utility.types.js +3 -0
- package/dist/global/types/seeder.utility.types.js.map +1 -0
- package/dist/global/utilities/schedule.utility.d.ts.map +1 -1
- package/dist/global/utilities/schedule.utility.js +1 -5
- package/dist/global/utilities/schedule.utility.js.map +1 -1
- package/dist/global/utilities/seeder.utility.d.ts.map +1 -1
- package/dist/global/utilities/seeder.utility.js.map +1 -1
- package/dist/index.d.ts +3 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -18
- package/dist/index.js.map +1 -1
- package/dist/migrations/1749600000021.CreateSysEmailNotificationLogsTable.js +2 -2
- package/dist/notification/dtos/email.notification.options.dto.d.ts +3 -3
- package/dist/notification/dtos/email.notification.options.dto.js +3 -3
- package/dist/notification/entities/email.notification.log.entity.d.ts +1 -1
- package/dist/notification/entities/email.notification.log.entity.js +1 -1
- package/dist/notification/enums/email.notification.default.enum.d.ts +5 -1
- package/dist/notification/enums/email.notification.default.enum.d.ts.map +1 -1
- package/dist/notification/enums/email.notification.default.enum.js +4 -0
- package/dist/notification/enums/email.notification.default.enum.js.map +1 -1
- package/dist/notification/enums/email.template.identifier.enum.d.ts +5 -0
- package/dist/notification/enums/email.template.identifier.enum.d.ts.map +1 -0
- package/dist/notification/enums/email.template.identifier.enum.js +9 -0
- package/dist/notification/enums/email.template.identifier.enum.js.map +1 -0
- package/dist/notification/es6.classes.d.ts +2 -6
- package/dist/notification/es6.classes.d.ts.map +1 -1
- package/dist/notification/es6.classes.js +12 -8
- package/dist/notification/es6.classes.js.map +1 -1
- package/dist/notification/libraries/process.email.notification.js +6 -6
- package/dist/notification/notification.module.d.ts +2 -3
- package/dist/notification/notification.module.d.ts.map +1 -1
- package/dist/notification/notification.module.js.map +1 -1
- package/dist/notification/services/email.notification.service.js +9 -9
- package/dist/notification/types/email.notification.types.d.ts +2 -2
- package/dist/notification/types/notification.types.d.ts +3 -0
- package/dist/notification/types/notification.types.d.ts.map +1 -1
- package/dist/tenant/tenant.module.d.ts +2 -3
- package/dist/tenant/tenant.module.d.ts.map +1 -1
- package/dist/tenant/tenant.module.js.map +1 -1
- package/dist/tenant/types/tenant.types.d.ts +3 -0
- package/dist/tenant/types/tenant.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/auth/jobs/system.refresh.token.job.d.ts +0 -8
- package/dist/auth/jobs/system.refresh.token.job.d.ts.map +0 -1
- package/dist/auth/jobs/system.refresh.token.job.js +0 -31
- package/dist/auth/jobs/system.refresh.token.job.js.map +0 -1
- package/dist/auth/jobs/system.role.job.d.ts +0 -8
- package/dist/auth/jobs/system.role.job.d.ts.map +0 -1
- package/dist/auth/jobs/system.role.job.js +0 -31
- package/dist/auth/jobs/system.role.job.js.map +0 -1
- package/dist/auth/jobs/user.details.job.d.ts +0 -8
- package/dist/auth/jobs/user.details.job.d.ts.map +0 -1
- package/dist/auth/jobs/user.details.job.js +0 -31
- package/dist/auth/jobs/user.details.job.js.map +0 -1
- package/dist/auth/jobs/user.job.d.ts +0 -8
- package/dist/auth/jobs/user.job.d.ts.map +0 -1
- package/dist/auth/jobs/user.job.js +0 -31
- package/dist/auth/jobs/user.job.js.map +0 -1
- package/dist/auth/jobs/user.role.job.d.ts +0 -8
- package/dist/auth/jobs/user.role.job.d.ts.map +0 -1
- package/dist/auth/jobs/user.role.job.js +0 -31
- package/dist/auth/jobs/user.role.job.js.map +0 -1
- package/dist/auth/subscribers/system.refresh.token.subscriber.d.ts +0 -10
- package/dist/auth/subscribers/system.refresh.token.subscriber.d.ts.map +0 -1
- package/dist/auth/subscribers/system.refresh.token.subscriber.js +0 -33
- package/dist/auth/subscribers/system.refresh.token.subscriber.js.map +0 -1
- package/dist/auth/subscribers/system.role.subscriber.d.ts +0 -10
- package/dist/auth/subscribers/system.role.subscriber.d.ts.map +0 -1
- package/dist/auth/subscribers/system.role.subscriber.js +0 -33
- package/dist/auth/subscribers/system.role.subscriber.js.map +0 -1
- package/dist/auth/subscribers/user.details.subscriber.d.ts +0 -10
- package/dist/auth/subscribers/user.details.subscriber.d.ts.map +0 -1
- package/dist/auth/subscribers/user.details.subscriber.js +0 -33
- package/dist/auth/subscribers/user.details.subscriber.js.map +0 -1
- package/dist/auth/subscribers/user.role.subscriber.d.ts +0 -10
- package/dist/auth/subscribers/user.role.subscriber.d.ts.map +0 -1
- package/dist/auth/subscribers/user.role.subscriber.js +0 -33
- package/dist/auth/subscribers/user.role.subscriber.js.map +0 -1
- package/dist/auth/subscribers/user.subscriber.d.ts +0 -11
- package/dist/auth/subscribers/user.subscriber.d.ts.map +0 -1
- package/dist/auth/subscribers/user.subscriber.js +0 -39
- package/dist/auth/subscribers/user.subscriber.js.map +0 -1
- package/dist/common/jobs/activity.log.job.d.ts +0 -8
- package/dist/common/jobs/activity.log.job.d.ts.map +0 -1
- package/dist/common/jobs/activity.log.job.js +0 -31
- package/dist/common/jobs/activity.log.job.js.map +0 -1
- package/dist/common/jobs/document.job.d.ts +0 -8
- package/dist/common/jobs/document.job.d.ts.map +0 -1
- package/dist/common/jobs/document.job.js +0 -31
- package/dist/common/jobs/document.job.js.map +0 -1
- package/dist/common/jobs/scheduled.event.job.d.ts +0 -10
- package/dist/common/jobs/scheduled.event.job.d.ts.map +0 -1
- package/dist/common/jobs/scheduled.event.job.js +0 -29
- package/dist/common/jobs/scheduled.event.job.js.map +0 -1
- package/dist/common/jobs/system.audit.log.job.d.ts +0 -8
- package/dist/common/jobs/system.audit.log.job.d.ts.map +0 -1
- package/dist/common/jobs/system.audit.log.job.js +0 -31
- package/dist/common/jobs/system.audit.log.job.js.map +0 -1
- package/dist/common/jobs/system.constant.job.d.ts +0 -8
- package/dist/common/jobs/system.constant.job.d.ts.map +0 -1
- package/dist/common/jobs/system.constant.job.js +0 -31
- package/dist/common/jobs/system.constant.job.js.map +0 -1
- package/dist/common/jobs/system.constant.type.job.d.ts +0 -8
- package/dist/common/jobs/system.constant.type.job.d.ts.map +0 -1
- package/dist/common/jobs/system.constant.type.job.js +0 -31
- package/dist/common/jobs/system.constant.type.job.js.map +0 -1
- package/dist/common/jobs/system.failed.job.job.d.ts +0 -8
- package/dist/common/jobs/system.failed.job.job.d.ts.map +0 -1
- package/dist/common/jobs/system.failed.job.job.js +0 -31
- package/dist/common/jobs/system.failed.job.job.js.map +0 -1
- package/dist/common/jobs/system.notification.job.d.ts +0 -8
- package/dist/common/jobs/system.notification.job.d.ts.map +0 -1
- package/dist/common/jobs/system.notification.job.js +0 -31
- package/dist/common/jobs/system.notification.job.js.map +0 -1
- package/dist/common/jobs/system.property.job.d.ts +0 -8
- package/dist/common/jobs/system.property.job.d.ts.map +0 -1
- package/dist/common/jobs/system.property.job.js +0 -31
- package/dist/common/jobs/system.property.job.js.map +0 -1
- package/dist/common/subscribers/activity.log.subscriber.d.ts +0 -10
- package/dist/common/subscribers/activity.log.subscriber.d.ts.map +0 -1
- package/dist/common/subscribers/activity.log.subscriber.js +0 -33
- package/dist/common/subscribers/activity.log.subscriber.js.map +0 -1
- package/dist/common/subscribers/document.subscriber.d.ts +0 -10
- package/dist/common/subscribers/document.subscriber.d.ts.map +0 -1
- package/dist/common/subscribers/document.subscriber.js +0 -33
- package/dist/common/subscribers/document.subscriber.js.map +0 -1
- package/dist/common/subscribers/scheduled.event.subscriber.d.ts +0 -11
- package/dist/common/subscribers/scheduled.event.subscriber.d.ts.map +0 -1
- package/dist/common/subscribers/scheduled.event.subscriber.js +0 -35
- package/dist/common/subscribers/scheduled.event.subscriber.js.map +0 -1
- package/dist/common/subscribers/system.audit.log.subscriber.d.ts +0 -10
- package/dist/common/subscribers/system.audit.log.subscriber.d.ts.map +0 -1
- package/dist/common/subscribers/system.audit.log.subscriber.js +0 -33
- package/dist/common/subscribers/system.audit.log.subscriber.js.map +0 -1
- package/dist/common/subscribers/system.constant.subscriber.d.ts +0 -10
- package/dist/common/subscribers/system.constant.subscriber.d.ts.map +0 -1
- package/dist/common/subscribers/system.constant.subscriber.js +0 -33
- package/dist/common/subscribers/system.constant.subscriber.js.map +0 -1
- package/dist/common/subscribers/system.constant.type.subscriber.d.ts +0 -10
- package/dist/common/subscribers/system.constant.type.subscriber.d.ts.map +0 -1
- package/dist/common/subscribers/system.constant.type.subscriber.js +0 -33
- package/dist/common/subscribers/system.constant.type.subscriber.js.map +0 -1
- package/dist/common/subscribers/system.failed.job.subscriber.d.ts +0 -10
- package/dist/common/subscribers/system.failed.job.subscriber.d.ts.map +0 -1
- package/dist/common/subscribers/system.failed.job.subscriber.js +0 -33
- package/dist/common/subscribers/system.failed.job.subscriber.js.map +0 -1
- package/dist/common/subscribers/system.notification.subscriber.d.ts +0 -10
- package/dist/common/subscribers/system.notification.subscriber.d.ts.map +0 -1
- package/dist/common/subscribers/system.notification.subscriber.js +0 -33
- package/dist/common/subscribers/system.notification.subscriber.js.map +0 -1
- package/dist/common/subscribers/system.property.subscriber.d.ts +0 -10
- package/dist/common/subscribers/system.property.subscriber.d.ts.map +0 -1
- package/dist/common/subscribers/system.property.subscriber.js +0 -33
- package/dist/common/subscribers/system.property.subscriber.js.map +0 -1
- package/dist/notification/jobs/email.notification.log.job.d.ts +0 -8
- package/dist/notification/jobs/email.notification.log.job.d.ts.map +0 -1
- package/dist/notification/jobs/email.notification.log.job.js +0 -31
- package/dist/notification/jobs/email.notification.log.job.js.map +0 -1
- package/dist/notification/jobs/email.template.job.d.ts +0 -8
- package/dist/notification/jobs/email.template.job.d.ts.map +0 -1
- package/dist/notification/jobs/email.template.job.js +0 -31
- package/dist/notification/jobs/email.template.job.js.map +0 -1
- package/dist/notification/subscribers/email.notification.log.subscriber.d.ts +0 -11
- package/dist/notification/subscribers/email.notification.log.subscriber.d.ts.map +0 -1
- package/dist/notification/subscribers/email.notification.log.subscriber.js +0 -35
- package/dist/notification/subscribers/email.notification.log.subscriber.js.map +0 -1
- package/dist/notification/subscribers/email.template.subscriber.d.ts +0 -11
- package/dist/notification/subscribers/email.template.subscriber.d.ts.map +0 -1
- package/dist/notification/subscribers/email.template.subscriber.js +0 -35
- package/dist/notification/subscribers/email.template.subscriber.js.map +0 -1
package/README.md
CHANGED
|
@@ -82,32 +82,32 @@ app.useGlobalInterceptors(
|
|
|
82
82
|
|
|
83
83
|
## Feature Map
|
|
84
84
|
|
|
85
|
-
| Area | Key exports | Notes
|
|
86
|
-
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
87
|
-
| Entities | `RootEntity`, `CommonEntity`, `CommonAdminEntity`, `UserEntity`, `AdminUserEntity`, `SystemRoleEntity`, `SystemAdminRoleEntity`, ... | uuid PK, soft deletes, `created_by`, jsonb `attributes`; entity-level `findOneOrNew`, `softDelete`, `hardDelete`, `restore`, `paginate` statics
|
|
88
|
-
| Migrations | `CreateSysUsersTable...` (26 files, one per table), `MigrationUtility`, `SeederUtility` | fluent `this.string()`, `this.numeric()`, `addRecord()` seeding
|
|
89
|
-
| Queue | `QueueModule`, `QueueService`, `CommonJob`, `JobConsumer` | BullMQ `@Processor`/`WorkerHost` consumer; auto-discovered jobs, duplicate prevention, recurring schedulers, 1-day TTL, retries, failures persisted to `sys_failed_jobs`
|
|
90
|
-
| Scheduled events | `SystemScheduledTaskEntity`, `ScheduledEventEntity`, `SetScheduledEventJob`, `DispatchScheduledEventJob` | schedule definitions in `sys_scheduled_tasks` → events in `sys_scheduled_events`; worker-driven materialisation + dispatch via `
|
|
85
|
+
| Area | Key exports | Notes |
|
|
86
|
+
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
87
|
+
| Entities | `RootEntity`, `CommonEntity`, `CommonAdminEntity`, `UserEntity`, `AdminUserEntity`, `SystemRoleEntity`, `SystemAdminRoleEntity`, ... | uuid PK, soft deletes, `created_by`, jsonb `attributes`; entity-level `findOneOrNew`, `softDelete`, `hardDelete`, `restore`, `paginate` statics |
|
|
88
|
+
| Migrations | `CreateSysUsersTable...` (26 files, one per table), `MigrationUtility`, `SeederUtility` | fluent `this.string()`, `this.numeric()`, `addRecord()` seeding |
|
|
89
|
+
| Queue | `QueueModule`, `QueueService`, `CommonJob`, `JobConsumer` | BullMQ `@Processor`/`WorkerHost` consumer; auto-discovered jobs, duplicate prevention, recurring schedulers, 1-day TTL, retries, failures persisted to `sys_failed_jobs` |
|
|
90
|
+
| Scheduled events | `SystemScheduledTaskEntity`, `ScheduledEventEntity`, `SetScheduledEventJob`, `DispatchScheduledEventJob` | schedule definitions in `sys_scheduled_tasks` → events in `sys_scheduled_events`; worker-driven materialisation + fire-once dispatch, cadence via `SCHEDULED_EVENT_MIN` |
|
|
91
91
|
| Auth | `AuthModule`, `AuthService.validateRole()`, `Auth`, `JwtMiddleware`, `GoogleAuthService` | imperative auth (open by default); JwtMiddleware resolves the user into `Auth`'s AsyncLocalStorage context per request; access + rotating refresh tokens; session-based logout invalidation (`sys_auth_sessions`); Google SSO via ID token at `POST /auth/google` |
|
|
92
|
-
| Admin auth | `AdminAuthService.validateRole()`, `AdminAuth`, `AdminJwtMiddleware`, `AdminAuthController` (`/admin/auth`) | fully separate stack for back-office admins — own users table (`sys_admin_users`), own roles (`sys_admin_roles`/`sys_auser_roles`), own sessions/refresh tokens (shared tables, `is_admin` flag)
|
|
93
|
-
| API keys | `ApiKeyService`, `ApiKeyGuard` / `ApiKeyMiddleware`, `@ApiKeyScopes()`, `ScopeEntity`, `ApiScopeEntity`
|
|
94
|
-
| Multi-tenancy | `TenantModule`, `TenantEntity`, `TenantCommonEntity`, `TenantContextService`, `TenantContextMiddleware` | AsyncLocalStorage tenant context; resolve by header, slug, or domain; tenants are onboarded by admins (`TenantEntity.creator` → `AdminUserEntity`)
|
|
95
|
-
| Admin | `AdminModule`, `AdminAccessService`, `TenantDataProcessor`, `ClientUserDataProcessor`, `BulkUserDataProcessor`, `AdminUserDataProcessor`, list processors | back-office APIs: tenant onboarding, client/admin user registration (single + bulk, no role granting), tenant + scheduled-task listing; 4-tier `GlobalAdminRoles` gate over `sys_admin_roles`; Swagger at `/docs` (hidden in production)
|
|
96
|
-
| Notifications | `NotificationModule`, `NotificationService`, `FcmPushNotificationService` | in-app rows + FCM push (optional `firebase-admin`); device token registry
|
|
97
|
-
| Email (SES) | `EmailNotificationService`, `ProcessEmailNotification`, `EmailTemplateEntity`, `EmailNotificationLogEntity` | templates in `sys_email_templates` rendered by a remote service, dispatched via SES per recipient (to/cc/bcc); logged to `sys_email_notification_logs` outside production; dispatch skipped when `AWS_SES_FROM_ADDRESS` unset
|
|
98
|
-
| Audit | `AuditService` | `saveAuditLog(old, new)` with changed-value diffing into `sys_audit_logs`
|
|
99
|
-
| Feature flags | `FeatureFlagService` | on/off, percentage rollouts, allow lists — stored as `feature.*` system properties
|
|
100
|
-
| Cache | `CacheService` | Redis, TTL objects (`{days, hours, min}`), transparent encryption
|
|
101
|
-
| Encryption | `EncryptionService` | AES-256-GCM, scrypt-derived keys
|
|
102
|
-
| System properties | `SystemPropertyModule`, `SystemPropertyService` | cached + optionally encrypted key/value settings in `sys_properties`
|
|
103
|
-
| Documents | `DocumentModule`, `DocumentService`, `S3BucketDocumentService`, `MinioBucketDocumentService` | `uploadDocument(multerFiles) → links[]`; driver chosen via `DOCUMENT_STORAGE_DRIVER`
|
|
104
|
-
| HTTP | `CommonController`, `GlobalExceptionFilter`, common DTOs | health endpoint base controller, uniform error envelope
|
|
105
|
-
| Raw SQL | `SqlService`, `SqlTarget` | named `:key` placeholders always bound as driver params, `:...key` array expansion; runs on the read replica (`DB_READ_*`) with transparent primary fallback; `fetchOne`/`fetchScalar`/`exists`/`count`/`paginate` helpers
|
|
106
|
-
| List endpoints | `CommonListProcessor`, `CommonListFilterDto`, `FilterDto`, `FILTER_OPERATORS` | allowlisted columns, parameterised operators (`eq`…`isNull`), typed value casting (`str`/`num`/`date`/`bool`/`null`), multi-sort + paginated on the read replica
|
|
107
|
-
| Outbound HTTP | `RemoteRequestService`, `ApiRequestTypeEnum`, `ApiContentTypeEnum` | injectable `fetch` wrapper (global via `CommonModule`); `getApiResponse<T>()` parses JSON/text and throws `OperationException` on non-2xx, `getApiRawResponse()` returns the raw `Response`; JSON + form-urlencoded body serialisation
|
|
108
|
-
| Observability | `LoggingInterceptor`, `MonitoringInterceptor`, `MonitoringService` | Sentry auto-registers when `@sentry/node` + `SENTRY_DSN` present; pluggable `MonitoringAdapter`
|
|
109
|
-
| Jobs/Events | `CommonJob`, `JobConsumer`, `CommonSubscriber`, `CommonDataProcessor` | dispatch/handle separation, discovery-based registration, worker-event lifecycle, column-change detection, field error collection
|
|
110
|
-
| Constants & maps | `baseEntityConstants`, `baseJobConstants`, `baseEntityMaps`, `baseJobMaps` | centralised dotted identifiers (`as const`) plus identifier → class maps of every concrete entity and job (abstract bases excluded); map keys are computed from the constants, so renames propagate at compile time
|
|
92
|
+
| Admin auth | `AdminAuthService.validateRole()`, `AdminAuth`, `AdminJwtMiddleware`, `AdminAuthController` (`/admin/auth`) | fully separate stack for back-office admins — own users table (`sys_admin_users`), own roles (`sys_admin_roles`/`sys_auser_roles`), own sessions/refresh tokens (shared tables, `is_admin` flag) |
|
|
93
|
+
| API keys | `ApiKeyService`, `ApiKeyGuard` / `ApiKeyMiddleware`, `@ApiKeyScopes()`, `ScopeEntity`, `ApiScopeEntity` | hashed keys in `sys_api_keys` (admin-owned), scopes, expiry/revocation, `x-api-key` header; normalized scopes catalogue in `sys_scopes`/`sys_api_scopes` |
|
|
94
|
+
| Multi-tenancy | `TenantModule`, `TenantEntity`, `TenantCommonEntity`, `TenantContextService`, `TenantContextMiddleware` | AsyncLocalStorage tenant context; resolve by header, slug, or domain; tenants are onboarded by admins (`TenantEntity.creator` → `AdminUserEntity`) |
|
|
95
|
+
| Admin | `AdminModule`, `AdminAccessService`, `TenantDataProcessor`, `ClientUserDataProcessor`, `BulkUserDataProcessor`, `AdminUserDataProcessor`, list processors | back-office APIs: tenant onboarding, client/admin user registration (single + bulk, no role granting), tenant + scheduled-task listing; 4-tier `GlobalAdminRoles` gate over `sys_admin_roles`; Swagger at `/docs` (hidden in production) |
|
|
96
|
+
| Notifications | `NotificationModule`, `NotificationService`, `FcmPushNotificationService` | in-app rows + FCM push (optional `firebase-admin`); device token registry |
|
|
97
|
+
| Email (SES) | `EmailNotificationService`, `ProcessEmailNotification`, `EmailTemplateEntity`, `EmailNotificationLogEntity` | templates in `sys_email_templates` rendered by a remote service, dispatched via SES per recipient (to/cc/bcc); logged to `sys_email_notification_logs` outside production; dispatch skipped when `AWS_SES_FROM_ADDRESS` unset |
|
|
98
|
+
| Audit | `AuditService` | `saveAuditLog(old, new)` with changed-value diffing into `sys_audit_logs` |
|
|
99
|
+
| Feature flags | `FeatureFlagService` | on/off, percentage rollouts, allow lists — stored as `feature.*` system properties |
|
|
100
|
+
| Cache | `CacheService` | Redis, TTL objects (`{days, hours, min}`), transparent encryption |
|
|
101
|
+
| Encryption | `EncryptionService` | AES-256-GCM, scrypt-derived keys |
|
|
102
|
+
| System properties | `SystemPropertyModule`, `SystemPropertyService` | cached + optionally encrypted key/value settings in `sys_properties` |
|
|
103
|
+
| Documents | `DocumentModule`, `DocumentService`, `S3BucketDocumentService`, `MinioBucketDocumentService` | `uploadDocument(multerFiles) → links[]`; driver chosen via `DOCUMENT_STORAGE_DRIVER` |
|
|
104
|
+
| HTTP | `CommonController`, `GlobalExceptionFilter`, common DTOs | health endpoint base controller, uniform error envelope |
|
|
105
|
+
| Raw SQL | `SqlService`, `SqlTarget` | named `:key` placeholders always bound as driver params, `:...key` array expansion; runs on the read replica (`DB_READ_*`) with transparent primary fallback; `fetchOne`/`fetchScalar`/`exists`/`count`/`paginate` helpers |
|
|
106
|
+
| List endpoints | `CommonListProcessor`, `CommonListFilterDto`, `FilterDto`, `FILTER_OPERATORS` | allowlisted columns, parameterised operators (`eq`…`isNull`), typed value casting (`str`/`num`/`date`/`bool`/`null`), multi-sort + paginated on the read replica |
|
|
107
|
+
| Outbound HTTP | `RemoteRequestService`, `ApiRequestTypeEnum`, `ApiContentTypeEnum` | injectable `fetch` wrapper (global via `CommonModule`); `getApiResponse<T>()` parses JSON/text and throws `OperationException` on non-2xx, `getApiRawResponse()` returns the raw `Response`; JSON + form-urlencoded body serialisation |
|
|
108
|
+
| Observability | `LoggingInterceptor`, `MonitoringInterceptor`, `MonitoringService` | Sentry auto-registers when `@sentry/node` + `SENTRY_DSN` present; pluggable `MonitoringAdapter` |
|
|
109
|
+
| Jobs/Events | `CommonJob`, `JobConsumer`, `CommonSubscriber`, `CommonDataProcessor` | dispatch/handle separation, discovery-based registration, worker-event lifecycle, column-change detection, field error collection |
|
|
110
|
+
| Constants & maps | `baseEntityConstants`, `baseJobConstants`, `baseEntityMaps`, `baseJobMaps` | centralised dotted identifiers (`as const`) plus identifier → class maps of every concrete entity and job (abstract bases excluded); map keys are computed from the constants, so renames propagate at compile time |
|
|
111
111
|
|
|
112
112
|
## Environment Variables
|
|
113
113
|
|
|
@@ -136,22 +136,22 @@ queries). Comma-separate `DB_READ_HOST` for multiple replicas; unset `DB_READ_*`
|
|
|
136
136
|
values fall back to the primary's. Leave `DB_READ_HOST` empty to route replica
|
|
137
137
|
queries to the primary.
|
|
138
138
|
|
|
139
|
-
| Variable | Default
|
|
140
|
-
| ------------------ |
|
|
141
|
-
| `DB_READ_HOST` | _(empty)_
|
|
142
|
-
| `DB_READ_PORT` | `DB_PORT`
|
|
143
|
-
| `DB_READ_USERNAME` | `DB_USERNAME`
|
|
144
|
-
| `DB_READ_PASSWORD` | `DB_PASSWORD`
|
|
145
|
-
| `DB_READ_NAME` | `DB_NAME`
|
|
139
|
+
| Variable | Default | Description |
|
|
140
|
+
| ------------------ | ------------- | --------------------- |
|
|
141
|
+
| `DB_READ_HOST` | _(empty)_ | Replica host(s) |
|
|
142
|
+
| `DB_READ_PORT` | `DB_PORT` | Replica port |
|
|
143
|
+
| `DB_READ_USERNAME` | `DB_USERNAME` | Replica user |
|
|
144
|
+
| `DB_READ_PASSWORD` | `DB_PASSWORD` | Replica password |
|
|
145
|
+
| `DB_READ_NAME` | `DB_NAME` | Replica database name |
|
|
146
146
|
|
|
147
147
|
### JWT / Auth
|
|
148
148
|
|
|
149
|
-
| Variable | Default
|
|
150
|
-
| ---------------------- |
|
|
151
|
-
| `ACCESS_TOKEN_SECRET` | —
|
|
152
|
-
| `REFRESH_TOKEN_SECRET` | —
|
|
153
|
-
| `ACCESS_TOKEN_EXPIRY` | `1h`
|
|
154
|
-
| `REFRESH_TOKEN_EXPIRY` | `30d`
|
|
149
|
+
| Variable | Default | Description |
|
|
150
|
+
| ---------------------- | --------- | ---------------------------------------------------------------------------------------------- |
|
|
151
|
+
| `ACCESS_TOKEN_SECRET` | — | **Required.** Secret for signing access tokens. Min 32 chars |
|
|
152
|
+
| `REFRESH_TOKEN_SECRET` | — | **Required.** Secret for signing refresh tokens. Min 32 chars |
|
|
153
|
+
| `ACCESS_TOKEN_EXPIRY` | `1h` | Access token lifetime (`60s`, `15m`, `1h`, `7d`, …) |
|
|
154
|
+
| `REFRESH_TOKEN_EXPIRY` | `30d` | Refresh token lifetime |
|
|
155
155
|
| `GOOGLE_CLIENT_ID` | _(empty)_ | OAuth client id whose ID tokens are accepted at `POST /auth/google`. Empty disables Google SSO |
|
|
156
156
|
|
|
157
157
|
#### Authentication (imperative)
|
|
@@ -169,7 +169,10 @@ logic, so layering tenant/plan/role checks is just more code.
|
|
|
169
169
|
`AuthController` (mounted at `/auth`) exposes the ready-made flows: `POST
|
|
170
170
|
/auth/login`, `/auth/google`, `/auth/register`, `/auth/refresh`, `/auth/logout`,
|
|
171
171
|
`/auth/change-password`, and `GET /auth/me`. Passwords are hashed/verified via
|
|
172
|
-
`AuthUtility` (bcrypt); the write flows use the processor lifecycle.
|
|
172
|
+
`AuthUtility` (bcrypt); the write flows use the processor lifecycle. Credential
|
|
173
|
+
misses spend the same bcrypt work as a wrong password
|
|
174
|
+
(`AuthUtility.compareAgainstDummy()`), so response timing does not reveal
|
|
175
|
+
whether an account exists. Every
|
|
173
176
|
`issueTokens()` call (login or refresh) creates a fresh `sys_auth_sessions` row
|
|
174
177
|
and embeds its identifier in the access token as `sid`; `logout()` revokes the
|
|
175
178
|
refresh token and invalidates that session, so a still-unexpired access token
|
|
@@ -255,20 +258,19 @@ admin with the `admin` role can grant `sys_admin_roles` to other admins via
|
|
|
255
258
|
|
|
256
259
|
### Queue (BullMQ / Redis)
|
|
257
260
|
|
|
258
|
-
| Variable
|
|
259
|
-
|
|
|
260
|
-
| `BULL_REDIS_HOST`
|
|
261
|
-
| `BULL_REDIS_PORT`
|
|
262
|
-
| `BULL_REDIS_PASSWORD`
|
|
263
|
-
| `BULL_REDIS_DB`
|
|
264
|
-
| `BULL_QUEUE_NAME`
|
|
265
|
-
| `BULL_WORKERS`
|
|
266
|
-
| `BULL_QUEUE_WORKER`
|
|
267
|
-
| `BULL_JOB_TTL_SECONDS`
|
|
268
|
-
| `MAX_JOB_RETRIES`
|
|
269
|
-
| `
|
|
270
|
-
| `
|
|
271
|
-
| `SCHEDULED_EVENT_SEC` | `0` | Second component of the cadence (all three are summed; all-zero disables it) |
|
|
261
|
+
| Variable | Default | Description |
|
|
262
|
+
| ----------------------------------- | ------------- | --------------------------------------------------------------------------------------------------- |
|
|
263
|
+
| `BULL_REDIS_HOST` | `localhost` | Redis host for BullMQ |
|
|
264
|
+
| `BULL_REDIS_PORT` | `6379` | Redis port |
|
|
265
|
+
| `BULL_REDIS_PASSWORD` | _(empty)_ | Redis password |
|
|
266
|
+
| `BULL_REDIS_DB` | `0` | Redis DB index |
|
|
267
|
+
| `BULL_QUEUE_NAME` | `myapp-queue` | Name of the BullMQ queue |
|
|
268
|
+
| `BULL_WORKERS` | `2` | Concurrent worker threads per process |
|
|
269
|
+
| `BULL_QUEUE_WORKER` | `false` | Set `true` on consumer instances only — API servers should leave this `false` |
|
|
270
|
+
| `BULL_JOB_TTL_SECONDS` | `86400` | Retention (seconds) for completed/failed jobs before removal from the queue + Redis (default 1 day) |
|
|
271
|
+
| `MAX_JOB_RETRIES` | `3` | Max attempts per job (BullMQ `attempts` default) and the scheduled-event retry ceiling |
|
|
272
|
+
| `SCHEDULED_EVENT_MIN` | `0` | `SetScheduledEventJob` cadence in minutes (every N minutes); `0`/unset disables self-scheduling |
|
|
273
|
+
| `ENABLE_SCHEDULED_EVENTS_EXECUTION` | _unset_ | Must be exactly `true` to arm scheduled-event materialisation and dispatch |
|
|
272
274
|
|
|
273
275
|
#### Jobs
|
|
274
276
|
|
|
@@ -330,23 +332,57 @@ loop. Two tables back it:
|
|
|
330
332
|
| `sys_scheduled_tasks` | `SystemScheduledTaskEntity` | a schedule definition (`identifier`, `name`, `start_from`, `schedule_interval`, `enabled`, `next_upsert_at`) |
|
|
331
333
|
| `sys_scheduled_events` | `ScheduledEventEntity` | one row per fire time (`job_id` → task, `scheduled_at`, `started_at`, `failed_at`, `total_attempts`, `active`); one task → many events |
|
|
332
334
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
job
|
|
335
|
+
`JobConsumer` enrols `SetScheduledEventJob` as a recurring scheduler once **both**
|
|
336
|
+
the worker's Redis connection is ready and the application has bootstrapped —
|
|
337
|
+
whichever lands second triggers it. Both conditions matter: BullMQ emits `ready`
|
|
338
|
+
from the connection built in the `Worker` constructor, so it can arrive before the
|
|
339
|
+
job registry exists, while enrolling at bootstrap alone would reach for Redis
|
|
340
|
+
before it is known to be up. Because BullMQ schedules the first job of an `every`
|
|
341
|
+
series at the current time, the first materialise-and-dispatch pass runs as soon as
|
|
342
|
+
the worker is ready rather than one cadence later.
|
|
343
|
+
|
|
344
|
+
Cadence comes from `SCHEDULED_EVENT_MIN` — every N minutes (`0`/unset disables it).
|
|
345
|
+
BullMQ keys the scheduler on the job identifier, so re-running on each boot
|
|
346
|
+
**upserts** rather than duplicates. Per-task schedules are separate: each
|
|
347
|
+
`sys_scheduled_tasks` row carries its own `{hour, min, sec}` `schedule_interval`.
|
|
338
348
|
|
|
339
349
|
Each tick, `SetScheduledEventJob.handle()` materialises due
|
|
340
350
|
`sys_scheduled_events` rows from enabled `sys_scheduled_tasks` (using
|
|
341
351
|
`ScheduleUtility.addInterval`) and triggers `DispatchScheduledEventJob`, which
|
|
342
|
-
enqueues each due event's job
|
|
352
|
+
enqueues each due event's job. Set `ENABLE_SCHEDULED_EVENTS_EXECUTION=true` to
|
|
353
|
+
arm it — the value must be exactly `true`.
|
|
354
|
+
|
|
355
|
+
Each occurrence fires **once**. A pass claims an event by stamping `started_at`
|
|
356
|
+
under a `started_at IS NULL` condition, incrementing `total_attempts` in the same
|
|
357
|
+
statement, and only enqueues if that claim affected a row — so two concurrent
|
|
358
|
+
passes cannot both dispatch it. Stamped rows are excluded from the due set. A
|
|
359
|
+
failed enqueue releases the claim (`started_at` back to null) and records
|
|
360
|
+
`failed_at`/`error`, so the event is retried on later ticks until `total_attempts`
|
|
361
|
+
reaches `MAX_JOB_RETRIES` (default 3).
|
|
362
|
+
|
|
363
|
+
Because the claim is written before the enqueue, dispatch is **at-most-once**: if
|
|
364
|
+
the process dies in the window between them, that occurrence is skipped rather
|
|
365
|
+
than dispatched twice. Once a job is on the queue, BullMQ's own `attempts` governs
|
|
366
|
+
its retries.
|
|
367
|
+
|
|
368
|
+
Materialisation is safe to run concurrently — `BULL_WORKERS` defaults to 2, and
|
|
369
|
+
several worker instances may share one queue. Each due task is **claimed** before
|
|
370
|
+
its event is created: a conditional `UPDATE` re-asserts `next_upsert_at < now`
|
|
371
|
+
while advancing it, so a second racing pass matches zero rows and skips the task.
|
|
372
|
+
The claim and the insert share a transaction, so a crash between them cannot
|
|
373
|
+
advance the schedule without creating the occurrence it accounted for.
|
|
343
374
|
`SystemScheduledTaskJob` (via `SystemScheduledTaskSubscriber`) keeps events in
|
|
344
375
|
step with task changes — toggling `active` when a task is enabled/disabled and
|
|
345
376
|
soft-deleting events when a task is removed.
|
|
346
377
|
|
|
347
|
-
|
|
348
|
-
`
|
|
349
|
-
|
|
378
|
+
`DispatchScheduledEventJob` enqueues each due event under **the scheduled task's
|
|
379
|
+
own `identifier`**, so register a job in your app whose identifier matches the
|
|
380
|
+
`identifier` you gave the task — that job's `handle()` is what runs per fire time.
|
|
381
|
+
|
|
382
|
+
`SystemScheduledTaskSubscriber` is the only entity subscriber this package
|
|
383
|
+
registers, because it is the only one backed by a job that does real work.
|
|
384
|
+
Subscribers for your own entities are yours to provide (see `CommonSubscriber`);
|
|
385
|
+
a subscriber only starts firing once something constructs it.
|
|
350
386
|
|
|
351
387
|
### Document Storage
|
|
352
388
|
|
|
@@ -500,10 +536,25 @@ dispatch is skipped entirely — so development stays send-free by default.
|
|
|
500
536
|
await new ProcessEmailNotification(emailNotificationService).process({
|
|
501
537
|
identifier: 'user.welcome',
|
|
502
538
|
data: { name: 'Jane' }, // payload for the remote template renderer
|
|
503
|
-
|
|
539
|
+
emailRecipients: [{ recipient: 'jane@example.com', cc: ['ops@example.com'] }],
|
|
504
540
|
});
|
|
505
541
|
```
|
|
506
542
|
|
|
543
|
+
The templates the library itself dispatches are named by the
|
|
544
|
+
`EmailTemplateIdentifier` enum — seed a matching `sys_email_templates` row for each
|
|
545
|
+
one you want delivered:
|
|
546
|
+
|
|
547
|
+
| Identifier | Sent by | Recipient | `data` keys |
|
|
548
|
+
| ----------------------- | ------------------------- | ------------------ | --------------------------------------------------------------------------- |
|
|
549
|
+
| `tenant-onboarded` | `TenantDataProcessor` | tenant's POC email | `tenant_name`, `tenant_poc`, `tenant_email`, `onboarded_on`, support fields |
|
|
550
|
+
| `tenant-user-onboarded` | `ClientUserDataProcessor` | the new user | `user_name`, `user_email`, `tenant_name`, `onboarded_on`, support fields |
|
|
551
|
+
|
|
552
|
+
Both add `support_email` and `support_link`, read from the `support_email` /
|
|
553
|
+
`support_link` system properties and falling back to the placeholders in
|
|
554
|
+
`EmailNotificationDefault`. Neither send can fail its flow: the row is committed
|
|
555
|
+
first, so a missing template or SES error is logged as a warning and the request
|
|
556
|
+
still succeeds.
|
|
557
|
+
|
|
507
558
|
## List Endpoints & Filtering
|
|
508
559
|
|
|
509
560
|
List endpoints are `POST .../list` routes backed by `CommonListProcessor`: a
|
|
@@ -517,13 +568,13 @@ into the SQL.
|
|
|
517
568
|
Each `FilterDto` is `{ identifier, operator, value, value_type }`. The raw
|
|
518
569
|
string `value` is cast per its declared `value_type` before binding:
|
|
519
570
|
|
|
520
|
-
| `value_type` | Cast
|
|
521
|
-
| ------------ |
|
|
522
|
-
| `str` | used as-is
|
|
523
|
-
| `num` | `Number(value)` — rejects empty / non-numeric input
|
|
524
|
-
| `date` | `new Date(value)` — rejects invalid dates
|
|
571
|
+
| `value_type` | Cast |
|
|
572
|
+
| ------------ | ----------------------------------------------------------------------------- |
|
|
573
|
+
| `str` | used as-is |
|
|
574
|
+
| `num` | `Number(value)` — rejects empty / non-numeric input |
|
|
575
|
+
| `date` | `new Date(value)` — rejects invalid dates |
|
|
525
576
|
| `bool` | case-insensitive `'true'` / `'false'` → real boolean, rejects everything else |
|
|
526
|
-
| `null` | bound as SQL `NULL`
|
|
577
|
+
| `null` | bound as SQL `NULL` |
|
|
527
578
|
|
|
528
579
|
Operators: `eq`, `ne`, `in`, `gt`, `gte`, `lt`, `lte`, `like`, `ilike`,
|
|
529
580
|
`between`, `isNull`. Multi-value operators (`in`, `between`) take
|
|
@@ -535,11 +586,26 @@ comma-separated values and cast each part; `isNull` reads its value truthily
|
|
|
535
586
|
"page": 1,
|
|
536
587
|
"limit": 10,
|
|
537
588
|
"filters": [
|
|
538
|
-
{
|
|
539
|
-
|
|
540
|
-
|
|
589
|
+
{
|
|
590
|
+
"identifier": "tenant_name",
|
|
591
|
+
"operator": "ilike",
|
|
592
|
+
"value": "acme",
|
|
593
|
+
"value_type": "str",
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
"identifier": "is_active",
|
|
597
|
+
"operator": "eq",
|
|
598
|
+
"value": "true",
|
|
599
|
+
"value_type": "bool",
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"identifier": "created_at",
|
|
603
|
+
"operator": "between",
|
|
604
|
+
"value": "2026-01-01, 2026-06-30",
|
|
605
|
+
"value_type": "date",
|
|
606
|
+
},
|
|
541
607
|
],
|
|
542
|
-
"sorts": [{ "identifier": "created_at", "direction": "DESC" }]
|
|
608
|
+
"sorts": [{ "identifier": "created_at", "direction": "DESC" }],
|
|
543
609
|
}
|
|
544
610
|
```
|
|
545
611
|
|
|
@@ -561,11 +627,11 @@ satisfies any junior requirement. They're held by admins only
|
|
|
561
627
|
(`sys_admin_users`, via `sys_auser_roles`) — never by tenant users:
|
|
562
628
|
|
|
563
629
|
| Role (`sys_admin_roles.identifier`) | Capability |
|
|
564
|
-
|
|
|
565
|
-
| `global.super.admin`
|
|
566
|
-
| `global.admin`
|
|
567
|
-
| `global.content.manager`
|
|
568
|
-
| `global.content.reader`
|
|
630
|
+
| ----------------------------------- | ---------------------------------------------------- |
|
|
631
|
+
| `global.super.admin` | View/change/delete everything, including tenant info |
|
|
632
|
+
| `global.admin` | Tenant listing and admin-user management |
|
|
633
|
+
| `global.content.manager` | View/change/edit everything except tenant info |
|
|
634
|
+
| `global.content.reader` | Read-only access to non-tenant content |
|
|
569
635
|
|
|
570
636
|
`AdminAccessService` exposes `validateSuperAdmin()`, `validateAdmin()`,
|
|
571
637
|
`validateContentManager()` and `validateContentReader()`. Each authenticates
|
|
@@ -575,8 +641,8 @@ pass the actor to a processor.
|
|
|
575
641
|
|
|
576
642
|
### Endpoints
|
|
577
643
|
|
|
578
|
-
| Route
|
|
579
|
-
|
|
|
644
|
+
| Route | Min. role | Processor |
|
|
645
|
+
| ---------------------------------- | --------------- | ---------------------------- |
|
|
580
646
|
| `POST /admin/tenants` | super admin | `TenantDataProcessor` |
|
|
581
647
|
| `POST /admin/tenants/list` | admin | `TenantListProcessor` |
|
|
582
648
|
| `POST /admin/users/clients` | super admin | `ClientUserDataProcessor` |
|
|
@@ -598,10 +664,20 @@ at `/admin/auth` (`AdminAuthController`) — see
|
|
|
598
664
|
@Post()
|
|
599
665
|
async onboard(@Body() dto: AddTenantDto) {
|
|
600
666
|
const { user } = await this.adminAccessService.validateSuperAdmin();
|
|
601
|
-
return new TenantDataProcessor(
|
|
667
|
+
return new TenantDataProcessor(
|
|
668
|
+
user,
|
|
669
|
+
this.emailNotificationService,
|
|
670
|
+
this.systemPropertyService,
|
|
671
|
+
).process(dto);
|
|
602
672
|
}
|
|
603
673
|
```
|
|
604
674
|
|
|
675
|
+
Onboarding a tenant (`tenant-onboarded`) or a single client user
|
|
676
|
+
(`tenant-user-onboarded`) also sends a templated welcome email — see
|
|
677
|
+
[Templated Email](#templated-email-aws-ses) for the payloads. That is why
|
|
678
|
+
`AdminModule` imports `NotificationModule` and `SystemPropertyModule`; bulk
|
|
679
|
+
registration deliberately sends nothing.
|
|
680
|
+
|
|
605
681
|
Data processors extend `CommonDataProcessor` and are created per request
|
|
606
682
|
(`new XxxDataProcessor(...deps).process(dto)`); list processors return a
|
|
607
683
|
`PaginatedResult`. Bulk registration validates the entire batch before any insert.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
import type { AdminModuleOptions } from './types/admin.types';
|
|
3
|
+
export type { AdminModuleOptions } from './types/admin.types';
|
|
5
4
|
export declare class AdminModule {
|
|
6
5
|
static register(options?: AdminModuleOptions): DynamicModule;
|
|
7
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.module.d.ts","sourceRoot":"","sources":["../../src/admin/admin.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"admin.module.d.ts","sourceRoot":"","sources":["../../src/admin/admin.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAIvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAc9D,qBAMa,WAAW;IACtB,MAAM,CAAC,QAAQ,CAAC,OAAO,GAAE,kBAAuB,GAAG,aAAa;CAcjE"}
|
|
@@ -12,12 +12,19 @@ const common_1 = require("@nestjs/common");
|
|
|
12
12
|
const auth_module_1 = require("../auth/auth.module");
|
|
13
13
|
const tenant_module_1 = require("../tenant/tenant.module");
|
|
14
14
|
const es6_classes_1 = require("./es6.classes");
|
|
15
|
+
const notification_module_1 = require("../notification/notification.module");
|
|
16
|
+
const system_property_module_1 = require("../common/system.property.module");
|
|
15
17
|
const [AdminAccessService] = es6_classes_1.es6Classes.services;
|
|
16
18
|
let AdminModule = AdminModule_1 = class AdminModule {
|
|
17
19
|
static register(options = {}) {
|
|
18
20
|
return {
|
|
19
21
|
module: AdminModule_1,
|
|
20
|
-
imports: [
|
|
22
|
+
imports: [
|
|
23
|
+
auth_module_1.AuthModule.register(options),
|
|
24
|
+
tenant_module_1.TenantModule.register(options),
|
|
25
|
+
notification_module_1.NotificationModule.register(options),
|
|
26
|
+
system_property_module_1.SystemPropertyModule.register(options),
|
|
27
|
+
],
|
|
21
28
|
controllers: [...es6_classes_1.es6Classes.controllers],
|
|
22
29
|
providers: [...es6_classes_1.es6Classes.services],
|
|
23
30
|
exports: [...es6_classes_1.es6Classes.services],
|
|
@@ -27,7 +34,7 @@ let AdminModule = AdminModule_1 = class AdminModule {
|
|
|
27
34
|
exports.AdminModule = AdminModule;
|
|
28
35
|
exports.AdminModule = AdminModule = AdminModule_1 = __decorate([
|
|
29
36
|
(0, common_1.Module)({
|
|
30
|
-
imports: [auth_module_1.AuthModule, tenant_module_1.TenantModule],
|
|
37
|
+
imports: [auth_module_1.AuthModule, tenant_module_1.TenantModule, notification_module_1.NotificationModule, system_property_module_1.SystemPropertyModule],
|
|
31
38
|
controllers: [...es6_classes_1.es6Classes.controllers],
|
|
32
39
|
providers: [...es6_classes_1.es6Classes.services],
|
|
33
40
|
exports: [...es6_classes_1.es6Classes.services],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.module.js","sourceRoot":"","sources":["../../src/admin/admin.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,qDAAiD;AACjD,2DAAuD;AACvD,+CAA2C;AAE3C,MAAM,CAAC,kBAAkB,CAAC,GAAG,wBAAU,CAAC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"admin.module.js","sourceRoot":"","sources":["../../src/admin/admin.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,qDAAiD;AACjD,2DAAuD;AACvD,+CAA2C;AAE3C,6EAAyE;AACzE,6EAAwE;AAGxE,MAAM,CAAC,kBAAkB,CAAC,GAAG,wBAAU,CAAC,QAAQ,CAAC;AAkB1C,IAAM,WAAW,mBAAjB,MAAM,WAAW;IACtB,MAAM,CAAC,QAAQ,CAAC,UAA8B,EAAE;QAC9C,OAAO;YACL,MAAM,EAAE,aAAW;YACnB,OAAO,EAAE;gBACP,wBAAU,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAC5B,4BAAY,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAC9B,wCAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC;gBACpC,6CAAoB,CAAC,QAAQ,CAAC,OAAO,CAAC;aACvC;YACD,WAAW,EAAE,CAAC,GAAG,wBAAU,CAAC,WAAW,CAAC;YACxC,SAAS,EAAE,CAAC,GAAG,wBAAU,CAAC,QAAQ,CAAC;YACnC,OAAO,EAAE,CAAC,GAAG,wBAAU,CAAC,QAAQ,CAAC;SAClC,CAAC;IACJ,CAAC;CACF,CAAA;AAfY,kCAAW;sBAAX,WAAW;IANvB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,wBAAU,EAAE,4BAAY,EAAE,wCAAkB,EAAE,6CAAoB,CAAC;QAC7E,WAAW,EAAE,CAAC,GAAG,wBAAU,CAAC,WAAW,CAAC;QACxC,SAAS,EAAE,CAAC,GAAG,wBAAU,CAAC,QAAQ,CAAC;QACnC,OAAO,EAAE,CAAC,GAAG,wBAAU,CAAC,QAAQ,CAAC;KAClC,CAAC;GACW,WAAW,CAevB"}
|
|
@@ -61,7 +61,7 @@ __decorate([
|
|
|
61
61
|
exports.AdminScheduledTaskController = AdminScheduledTaskController = __decorate([
|
|
62
62
|
(0, swagger_1.ApiTags)('Admin - Scheduled Tasks'),
|
|
63
63
|
(0, swagger_1.ApiBearerAuth)(),
|
|
64
|
-
(0, common_1.Controller)('admin/scheduled-tasks'),
|
|
64
|
+
(0, common_1.Controller)('api/admin/scheduled-tasks'),
|
|
65
65
|
__metadata("design:paramtypes", [admin_access_service_1.AdminAccessService,
|
|
66
66
|
sql_service_1.SqlService])
|
|
67
67
|
], AdminScheduledTaskController);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.scheduled.task.controller.js","sourceRoot":"","sources":["../../../src/admin/controllers/admin.scheduled.task.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,6CAAuE;AACvE,mEAA+D;AAC/D,2EAAsE;AACtE,8FAAwF;AACxF,8FAAwF;AACxF,2EAAqE;AACrE,6EAAuE;AAKhE,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACvC,YACmB,kBAAsC,EACtC,UAAsB;QADtB,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,eAAU,GAAV,UAAU,CAAY;IACtC,CAAC;IAOE,AAAN,KAAK,CAAC,GAAG,CAAS,GAAwB;QACxC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,CAAC;QACxE,OAAO,IAAI,0DAA0B,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3D,CAAC;IAOK,AAAN,KAAK,CAAC,IAAI,CAAS,GAAyB;QAC1C,MAAM,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,EAAE,CAAC;QACtD,OAAO,IAAI,0DAA0B,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtE,CAAC;CACF,CAAA;AAzBY,oEAA4B;AAWjC;IALL,IAAA,aAAI,GAAE;IACN,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,uBAAuB;QAChC,WAAW,EAAE,oDAAoD;KAClE,CAAC;IACS,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,4CAAmB;;uDAGzC;AAOK;IALL,IAAA,aAAI,EAAC,MAAM,CAAC;IACZ,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,0CAA0C;QACnD,WAAW,EAAE,mDAAmD;KACjE,CAAC;IACU,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,8CAAoB;;wDAG3C;uCAxBU,4BAA4B;IAHxC,IAAA,iBAAO,EAAC,yBAAyB,CAAC;IAClC,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,
|
|
1
|
+
{"version":3,"file":"admin.scheduled.task.controller.js","sourceRoot":"","sources":["../../../src/admin/controllers/admin.scheduled.task.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,6CAAuE;AACvE,mEAA+D;AAC/D,2EAAsE;AACtE,8FAAwF;AACxF,8FAAwF;AACxF,2EAAqE;AACrE,6EAAuE;AAKhE,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACvC,YACmB,kBAAsC,EACtC,UAAsB;QADtB,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,eAAU,GAAV,UAAU,CAAY;IACtC,CAAC;IAOE,AAAN,KAAK,CAAC,GAAG,CAAS,GAAwB;QACxC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,CAAC;QACxE,OAAO,IAAI,0DAA0B,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3D,CAAC;IAOK,AAAN,KAAK,CAAC,IAAI,CAAS,GAAyB;QAC1C,MAAM,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,EAAE,CAAC;QACtD,OAAO,IAAI,0DAA0B,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtE,CAAC;CACF,CAAA;AAzBY,oEAA4B;AAWjC;IALL,IAAA,aAAI,GAAE;IACN,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,uBAAuB;QAChC,WAAW,EAAE,oDAAoD;KAClE,CAAC;IACS,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,4CAAmB;;uDAGzC;AAOK;IALL,IAAA,aAAI,EAAC,MAAM,CAAC;IACZ,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,0CAA0C;QACnD,WAAW,EAAE,mDAAmD;KACjE,CAAC;IACU,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,8CAAoB;;wDAG3C;uCAxBU,4BAA4B;IAHxC,IAAA,iBAAO,EAAC,yBAAyB,CAAC;IAClC,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,2BAA2B,CAAC;qCAGC,yCAAkB;QAC1B,wBAAU;GAH9B,4BAA4B,CAyBxC"}
|
|
@@ -2,10 +2,14 @@ import { SqlService } from '../../common/services/sql.service';
|
|
|
2
2
|
import { AdminAccessService } from '../services/admin.access.service';
|
|
3
3
|
import { AddTenantDto } from '../dtos/add.tenant.dto';
|
|
4
4
|
import { TenantListDto } from '../dtos/tenant.list.dto';
|
|
5
|
+
import { EmailNotificationService } from '../../notification/services/email.notification.service';
|
|
6
|
+
import { SystemPropertyService } from '../../common/services/system.property.service';
|
|
5
7
|
export declare class AdminTenantController {
|
|
6
8
|
private readonly adminAccessService;
|
|
7
9
|
private readonly sqlService;
|
|
8
|
-
|
|
10
|
+
private readonly emailNotificationService;
|
|
11
|
+
private readonly systemPropertyService;
|
|
12
|
+
constructor(adminAccessService: AdminAccessService, sqlService: SqlService, emailNotificationService: EmailNotificationService, systemPropertyService: SystemPropertyService);
|
|
9
13
|
onboard(dto: AddTenantDto): Promise<import("../..").TenantEntity>;
|
|
10
14
|
list(dto: TenantListDto): Promise<{
|
|
11
15
|
records: import("../..").SqlRow[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.tenant.controller.d.ts","sourceRoot":"","sources":["../../../src/admin/controllers/admin.tenant.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAGtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"admin.tenant.controller.d.ts","sourceRoot":"","sources":["../../../src/admin/controllers/admin.tenant.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAGtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,qBAGa,qBAAqB;IAE9B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,wBAAwB;IACzC,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAHrB,kBAAkB,EAAE,kBAAkB,EACtC,UAAU,EAAE,UAAU,EACtB,wBAAwB,EAAE,wBAAwB,EAClD,qBAAqB,EAAE,qBAAqB;IAQzD,OAAO,CAAS,GAAG,EAAE,YAAY;IAejC,IAAI,CAAS,GAAG,EAAE,aAAa;;;;;;;CAItC"}
|
|
@@ -21,14 +21,18 @@ const tenant_data_processor_1 = require("../libraries/tenant.data.processor");
|
|
|
21
21
|
const tenant_list_processor_1 = require("../libraries/tenant.list.processor");
|
|
22
22
|
const add_tenant_dto_1 = require("../dtos/add.tenant.dto");
|
|
23
23
|
const tenant_list_dto_1 = require("../dtos/tenant.list.dto");
|
|
24
|
+
const email_notification_service_1 = require("../../notification/services/email.notification.service");
|
|
25
|
+
const system_property_service_1 = require("../../common/services/system.property.service");
|
|
24
26
|
let AdminTenantController = class AdminTenantController {
|
|
25
|
-
constructor(adminAccessService, sqlService) {
|
|
27
|
+
constructor(adminAccessService, sqlService, emailNotificationService, systemPropertyService) {
|
|
26
28
|
this.adminAccessService = adminAccessService;
|
|
27
29
|
this.sqlService = sqlService;
|
|
30
|
+
this.emailNotificationService = emailNotificationService;
|
|
31
|
+
this.systemPropertyService = systemPropertyService;
|
|
28
32
|
}
|
|
29
33
|
async onboard(dto) {
|
|
30
34
|
const { user } = await this.adminAccessService.validateSuperAdmin();
|
|
31
|
-
return new tenant_data_processor_1.TenantDataProcessor(user).process(dto);
|
|
35
|
+
return new tenant_data_processor_1.TenantDataProcessor(user, this.emailNotificationService, this.systemPropertyService).process(dto);
|
|
32
36
|
}
|
|
33
37
|
async list(dto) {
|
|
34
38
|
await this.adminAccessService.validateAdmin();
|
|
@@ -61,8 +65,10 @@ __decorate([
|
|
|
61
65
|
exports.AdminTenantController = AdminTenantController = __decorate([
|
|
62
66
|
(0, swagger_1.ApiTags)('Admin - Tenants'),
|
|
63
67
|
(0, swagger_1.ApiBearerAuth)(),
|
|
64
|
-
(0, common_1.Controller)('admin/tenants'),
|
|
68
|
+
(0, common_1.Controller)('api/admin/tenants'),
|
|
65
69
|
__metadata("design:paramtypes", [admin_access_service_1.AdminAccessService,
|
|
66
|
-
sql_service_1.SqlService
|
|
70
|
+
sql_service_1.SqlService,
|
|
71
|
+
email_notification_service_1.EmailNotificationService,
|
|
72
|
+
system_property_service_1.SystemPropertyService])
|
|
67
73
|
], AdminTenantController);
|
|
68
74
|
//# sourceMappingURL=admin.tenant.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.tenant.controller.js","sourceRoot":"","sources":["../../../src/admin/controllers/admin.tenant.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,6CAAuE;AACvE,mEAA+D;AAC/D,2EAAsE;AACtE,8EAAyE;AACzE,8EAAyE;AACzE,2DAAsD;AACtD,6DAAwD;
|
|
1
|
+
{"version":3,"file":"admin.tenant.controller.js","sourceRoot":"","sources":["../../../src/admin/controllers/admin.tenant.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,6CAAuE;AACvE,mEAA+D;AAC/D,2EAAsE;AACtE,8EAAyE;AACzE,8EAAyE;AACzE,2DAAsD;AACtD,6DAAwD;AACxD,uGAAkG;AAClG,2FAAsF;AAK/E,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,YACmB,kBAAsC,EACtC,UAAsB,EACtB,wBAAkD,EAClD,qBAA4C;QAH5C,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,eAAU,GAAV,UAAU,CAAY;QACtB,6BAAwB,GAAxB,wBAAwB,CAA0B;QAClD,0BAAqB,GAArB,qBAAqB,CAAuB;IAC5D,CAAC;IAOE,AAAN,KAAK,CAAC,OAAO,CAAS,GAAiB;QACrC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,CAAC;QAEpE,OAAO,IAAI,2CAAmB,CAC5B,IAAI,EACJ,IAAI,CAAC,wBAAwB,EAC7B,IAAI,CAAC,qBAAqB,CAC3B,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjB,CAAC;IAOK,AAAN,KAAK,CAAC,IAAI,CAAS,GAAkB;QACnC,MAAM,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC;QAC9C,OAAO,IAAI,2CAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/D,CAAC;CACF,CAAA;AAhCY,sDAAqB;AAa1B;IALL,IAAA,aAAI,GAAE;IACN,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,yCAAyC;QAClD,WAAW,EAAE,uCAAuC;KACrD,CAAC;IACa,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,6BAAY;;oDAQtC;AAOK;IALL,IAAA,aAAI,EAAC,MAAM,CAAC;IACZ,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,kCAAkC;QAC3C,WAAW,EAAE,0CAA0C;KACxD,CAAC;IACU,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,+BAAa;;iDAGpC;gCA/BU,qBAAqB;IAHjC,IAAA,iBAAO,EAAC,iBAAiB,CAAC;IAC1B,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,mBAAmB,CAAC;qCAGS,yCAAkB;QAC1B,wBAAU;QACI,qDAAwB;QAC3B,+CAAqB;GALpD,qBAAqB,CAgCjC"}
|
|
@@ -3,12 +3,16 @@ import { AdminAccessService } from '../services/admin.access.service';
|
|
|
3
3
|
import { AddClientUserDto } from '../dtos/add.client.user.dto';
|
|
4
4
|
import { AddBulkUsersDto } from '../dtos/add.bulk.users.dto';
|
|
5
5
|
import { AddAdminUserDto } from '../dtos/add.admin.user.dto';
|
|
6
|
+
import { EmailNotificationService } from '../../notification/services/email.notification.service';
|
|
7
|
+
import { SystemPropertyService } from '../../common/services/system.property.service';
|
|
6
8
|
export declare class AdminUserController {
|
|
7
9
|
private readonly adminAccessService;
|
|
8
10
|
private readonly tenantService;
|
|
9
|
-
|
|
11
|
+
private readonly emailNotificationService;
|
|
12
|
+
private readonly systemPropertyService;
|
|
13
|
+
constructor(adminAccessService: AdminAccessService, tenantService: TenantService, emailNotificationService: EmailNotificationService, systemPropertyService: SystemPropertyService);
|
|
10
14
|
addClientUser(dto: AddClientUserDto): Promise<import("../..").UserEntity>;
|
|
11
|
-
addClientUsersBulk(dto: AddBulkUsersDto): Promise<import("../
|
|
15
|
+
addClientUsersBulk(dto: AddBulkUsersDto): Promise<import("../types/admin.types").BulkUserResult>;
|
|
12
16
|
addAdminUser(dto: AddAdminUserDto): Promise<import("../..").AdminUserEntity>;
|
|
13
17
|
}
|
|
14
18
|
//# sourceMappingURL=admin.user.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.user.controller.d.ts","sourceRoot":"","sources":["../../../src/admin/controllers/admin.user.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAItE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"admin.user.controller.d.ts","sourceRoot":"","sources":["../../../src/admin/controllers/admin.user.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAItE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,qBAGa,mBAAmB;IAE5B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,wBAAwB;IACzC,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAHrB,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,aAAa,EAC5B,wBAAwB,EAAE,wBAAwB,EAClD,qBAAqB,EAAE,qBAAqB;IAQzD,aAAa,CAAS,GAAG,EAAE,gBAAgB;IAc3C,kBAAkB,CAAS,GAAG,EAAE,eAAe;IAU/C,YAAY,CAAS,GAAG,EAAE,eAAe;CAIhD"}
|
|
@@ -23,14 +23,18 @@ const admin_user_data_processor_1 = require("../libraries/admin.user.data.proces
|
|
|
23
23
|
const add_client_user_dto_1 = require("../dtos/add.client.user.dto");
|
|
24
24
|
const add_bulk_users_dto_1 = require("../dtos/add.bulk.users.dto");
|
|
25
25
|
const add_admin_user_dto_1 = require("../dtos/add.admin.user.dto");
|
|
26
|
+
const email_notification_service_1 = require("../../notification/services/email.notification.service");
|
|
27
|
+
const system_property_service_1 = require("../../common/services/system.property.service");
|
|
26
28
|
let AdminUserController = class AdminUserController {
|
|
27
|
-
constructor(adminAccessService, tenantService) {
|
|
29
|
+
constructor(adminAccessService, tenantService, emailNotificationService, systemPropertyService) {
|
|
28
30
|
this.adminAccessService = adminAccessService;
|
|
29
31
|
this.tenantService = tenantService;
|
|
32
|
+
this.emailNotificationService = emailNotificationService;
|
|
33
|
+
this.systemPropertyService = systemPropertyService;
|
|
30
34
|
}
|
|
31
35
|
async addClientUser(dto) {
|
|
32
36
|
await this.adminAccessService.validateSuperAdmin();
|
|
33
|
-
return new client_user_data_processor_1.ClientUserDataProcessor(this.tenantService).process(dto);
|
|
37
|
+
return new client_user_data_processor_1.ClientUserDataProcessor(this.tenantService, this.emailNotificationService, this.systemPropertyService).process(dto);
|
|
34
38
|
}
|
|
35
39
|
async addClientUsersBulk(dto) {
|
|
36
40
|
await this.adminAccessService.validateSuperAdmin();
|
|
@@ -78,8 +82,10 @@ __decorate([
|
|
|
78
82
|
exports.AdminUserController = AdminUserController = __decorate([
|
|
79
83
|
(0, swagger_1.ApiTags)('Admin - Users'),
|
|
80
84
|
(0, swagger_1.ApiBearerAuth)(),
|
|
81
|
-
(0, common_1.Controller)('admin/users'),
|
|
85
|
+
(0, common_1.Controller)('api/admin/users'),
|
|
82
86
|
__metadata("design:paramtypes", [admin_access_service_1.AdminAccessService,
|
|
83
|
-
tenant_service_1.TenantService
|
|
87
|
+
tenant_service_1.TenantService,
|
|
88
|
+
email_notification_service_1.EmailNotificationService,
|
|
89
|
+
system_property_service_1.SystemPropertyService])
|
|
84
90
|
], AdminUserController);
|
|
85
91
|
//# sourceMappingURL=admin.user.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.user.controller.js","sourceRoot":"","sources":["../../../src/admin/controllers/admin.user.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,6CAAuE;AACvE,yEAAqE;AACrE,2EAAsE;AACtE,wFAAkF;AAClF,oFAA8E;AAC9E,sFAAgF;AAChF,qEAA+D;AAC/D,mEAA6D;AAC7D,mEAA6D;
|
|
1
|
+
{"version":3,"file":"admin.user.controller.js","sourceRoot":"","sources":["../../../src/admin/controllers/admin.user.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,6CAAuE;AACvE,yEAAqE;AACrE,2EAAsE;AACtE,wFAAkF;AAClF,oFAA8E;AAC9E,sFAAgF;AAChF,qEAA+D;AAC/D,mEAA6D;AAC7D,mEAA6D;AAC7D,uGAAkG;AAClG,2FAAsF;AAK/E,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACmB,kBAAsC,EACtC,aAA4B,EAC5B,wBAAkD,EAClD,qBAA4C;QAH5C,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,kBAAa,GAAb,aAAa,CAAe;QAC5B,6BAAwB,GAAxB,wBAAwB,CAA0B;QAClD,0BAAqB,GAArB,qBAAqB,CAAuB;IAC5D,CAAC;IAOE,AAAN,KAAK,CAAC,aAAa,CAAS,GAAqB;QAC/C,MAAM,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,CAAC;QACnD,OAAO,IAAI,oDAAuB,CAChC,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,wBAAwB,EAC7B,IAAI,CAAC,qBAAqB,CAC3B,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjB,CAAC;IAOK,AAAN,KAAK,CAAC,kBAAkB,CAAS,GAAoB;QACnD,MAAM,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,CAAC;QACnD,OAAO,IAAI,gDAAqB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpE,CAAC;IAOK,AAAN,KAAK,CAAC,YAAY,CAAS,GAAoB;QAC7C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC;QAC/D,OAAO,IAAI,kDAAsB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACvD,CAAC;CACF,CAAA;AAzCY,kDAAmB;AAaxB;IALL,IAAA,aAAI,EAAC,SAAS,CAAC;IACf,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,gDAAgD;QACzD,WAAW,EAAE,uCAAuC;KACrD,CAAC;IACmB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,sCAAgB;;wDAOhD;AAOK;IALL,IAAA,aAAI,EAAC,cAAc,CAAC;IACpB,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,8CAA8C;QACvD,WAAW,EAAE,uCAAuC;KACrD,CAAC;IACwB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,oCAAe;;6DAGpD;AAOK;IALL,IAAA,aAAI,EAAC,QAAQ,CAAC;IACd,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,iCAAiC;QAC1C,WAAW,EAAE,0CAA0C;KACxD,CAAC;IACkB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,oCAAe;;uDAG9C;8BAxCU,mBAAmB;IAH/B,IAAA,iBAAO,EAAC,eAAe,CAAC;IACxB,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,iBAAiB,CAAC;qCAGW,yCAAkB;QACvB,8BAAa;QACF,qDAAwB;QAC3B,+CAAqB;GALpD,mBAAmB,CAyC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.user.data.processor.d.ts","sourceRoot":"","sources":["../../../src/admin/libraries/admin.user.data.processor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"admin.user.data.processor.d.ts","sourceRoot":"","sources":["../../../src/admin/libraries/admin.user.data.processor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAI7D,qBAAa,sBAAuB,SAAQ,mBAAmB;IAGjD,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFlC,SAAS,CAAC,OAAO,EAAE,eAAe,CAAC;gBAEN,KAAK,EAAE,eAAe;IAI7C,OAAO,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;YAMnD,QAAQ;YAQR,MAAM;YAiBN,oBAAoB;YAQpB,uBAAuB;YASvB,iBAAiB;YAiBjB,eAAe;IAc7B,OAAO,CAAC,YAAY;CAIrB"}
|