rez_core 6.5.55 → 6.5.57
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/dist/app.controller.d.ts +6 -0
- package/dist/app.controller.js +34 -0
- package/dist/app.controller.js.map +1 -0
- package/dist/app.module.d.ts +2 -0
- package/dist/app.module.js +79 -0
- package/dist/app.module.js.map +1 -0
- package/dist/app.service.d.ts +3 -0
- package/dist/app.service.js +20 -0
- package/dist/app.service.js.map +1 -0
- package/dist/config/bull.config.d.ts +10 -0
- package/dist/config/bull.config.js +66 -0
- package/dist/config/bull.config.js.map +1 -0
- package/dist/config/config.module.d.ts +2 -0
- package/dist/config/config.module.js +29 -0
- package/dist/config/config.module.js.map +1 -0
- package/dist/config/database.config.d.ts +7 -0
- package/dist/config/database.config.js +43 -0
- package/dist/config/database.config.js.map +1 -0
- package/dist/constant/global.constant.d.ts +50 -0
- package/dist/constant/global.constant.js +54 -0
- package/dist/constant/global.constant.js.map +1 -0
- package/dist/constant/status.constant.d.ts +4 -0
- package/dist/constant/status.constant.js +9 -0
- package/dist/constant/status.constant.js.map +1 -0
- package/dist/core.module.d.ts +4 -0
- package/dist/core.module.js +113 -0
- package/dist/core.module.js.map +1 -0
- package/dist/decorators/roles.decorator.d.ts +1 -0
- package/dist/decorators/roles.decorator.js +7 -0
- package/dist/decorators/roles.decorator.js.map +1 -0
- package/dist/dtos/response.d.ts +5 -0
- package/dist/dtos/response.dto.d.ts +5 -0
- package/dist/dtos/response.dto.js +3 -0
- package/dist/dtos/response.dto.js.map +1 -0
- package/dist/dtos/response.js +3 -0
- package/dist/dtos/response.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +25 -0
- package/dist/main.js.map +1 -0
- package/dist/module/app_master/app-master.module.d.ts +2 -0
- package/dist/module/app_master/app-master.module.js +28 -0
- package/dist/module/app_master/app-master.module.js.map +1 -0
- package/dist/module/app_master/controller/app-master.controller.d.ts +9 -0
- package/dist/module/app_master/controller/app-master.controller.js +51 -0
- package/dist/module/app_master/controller/app-master.controller.js.map +1 -0
- package/dist/module/app_master/entity/app-master.entity.d.ts +17 -0
- package/dist/module/app_master/entity/app-master.entity.js +80 -0
- package/dist/module/app_master/entity/app-master.entity.js.map +1 -0
- package/dist/module/app_master/repository/app-master.repository.d.ts +7 -0
- package/dist/module/app_master/repository/app-master.repository.js +36 -0
- package/dist/module/app_master/repository/app-master.repository.js.map +1 -0
- package/dist/module/app_master/service/app-master.service.d.ts +8 -0
- package/dist/module/app_master/service/app-master.service.js +45 -0
- package/dist/module/app_master/service/app-master.service.js.map +1 -0
- package/dist/module/auth/auth.module.d.ts +2 -0
- package/dist/module/auth/auth.module.js +57 -0
- package/dist/module/auth/auth.module.js.map +1 -0
- package/dist/module/auth/controller/auth.controller.d.ts +5 -0
- package/dist/module/auth/controller/auth.controller.js +25 -0
- package/dist/module/auth/controller/auth.controller.js.map +1 -0
- package/dist/module/auth/guards/google-auth.guard.d.ts +6 -0
- package/dist/module/auth/guards/google-auth.guard.js +21 -0
- package/dist/module/auth/guards/google-auth.guard.js.map +1 -0
- package/dist/module/auth/guards/jwt.guard.d.ts +10 -0
- package/dist/module/auth/guards/jwt.guard.js +36 -0
- package/dist/module/auth/guards/jwt.guard.js.map +1 -0
- package/dist/module/auth/guards/role.guard.d.ts +9 -0
- package/dist/module/auth/guards/role.guard.js +59 -0
- package/dist/module/auth/guards/role.guard.js.map +1 -0
- package/dist/module/auth/services/auth.service.d.ts +14 -0
- package/dist/module/auth/services/auth.service.js +50 -0
- package/dist/module/auth/services/auth.service.js.map +1 -0
- package/dist/module/auth/services/jwt.service.d.ts +6 -0
- package/dist/module/auth/services/jwt.service.js +28 -0
- package/dist/module/auth/services/jwt.service.js.map +1 -0
- package/dist/module/auth/strategies/google.strategy.d.ts +10 -0
- package/dist/module/auth/strategies/google.strategy.js +59 -0
- package/dist/module/auth/strategies/google.strategy.js.map +1 -0
- package/dist/module/auth/strategies/jwt.strategy.d.ts +20 -0
- package/dist/module/auth/strategies/jwt.strategy.js +47 -0
- package/dist/module/auth/strategies/jwt.strategy.js.map +1 -0
- package/dist/module/auth/strategies/local.strategy.d.ts +7 -0
- package/dist/module/auth/strategies/local.strategy.js +30 -0
- package/dist/module/auth/strategies/local.strategy.js.map +1 -0
- package/dist/module/dashboard/controller/dashboard.controller.d.ts +33 -0
- package/dist/module/dashboard/controller/dashboard.controller.js +57 -0
- package/dist/module/dashboard/controller/dashboard.controller.js.map +1 -0
- package/dist/module/dashboard/dashboard.module.d.ts +2 -0
- package/dist/module/dashboard/dashboard.module.js +34 -0
- package/dist/module/dashboard/dashboard.module.js.map +1 -0
- package/dist/module/dashboard/entity/dashboard_page_data.entity.d.ts +10 -0
- package/dist/module/dashboard/entity/dashboard_page_data.entity.js +50 -0
- package/dist/module/dashboard/entity/dashboard_page_data.entity.js.map +1 -0
- package/dist/module/dashboard/entity/widget_master.entity.d.ts +7 -0
- package/dist/module/dashboard/entity/widget_master.entity.js +38 -0
- package/dist/module/dashboard/entity/widget_master.entity.js.map +1 -0
- package/dist/module/dashboard/repository/dashboard.repository.d.ts +11 -0
- package/dist/module/dashboard/repository/dashboard.repository.js +62 -0
- package/dist/module/dashboard/repository/dashboard.repository.js.map +1 -0
- package/dist/module/dashboard/service/dashboard.service.d.ts +35 -0
- package/dist/module/dashboard/service/dashboard.service.js +61 -0
- package/dist/module/dashboard/service/dashboard.service.js.map +1 -0
- package/dist/module/enterprise/controller/enterprise.controller.d.ts +12 -0
- package/dist/module/enterprise/controller/enterprise.controller.js +57 -0
- package/dist/module/enterprise/controller/enterprise.controller.js.map +1 -0
- package/dist/module/enterprise/controller/meta.controller.d.ts +9 -0
- package/dist/module/enterprise/controller/meta.controller.js +43 -0
- package/dist/module/enterprise/controller/meta.controller.js.map +1 -0
- package/dist/module/enterprise/controller/organization.controller.d.ts +22 -0
- package/dist/module/enterprise/controller/organization.controller.js +115 -0
- package/dist/module/enterprise/controller/organization.controller.js.map +1 -0
- package/dist/module/enterprise/enterprise.module.d.ts +2 -0
- package/dist/module/enterprise/enterprise.module.js +52 -0
- package/dist/module/enterprise/enterprise.module.js.map +1 -0
- package/dist/module/enterprise/entity/enterprise.entity.d.ts +11 -0
- package/dist/module/enterprise/entity/enterprise.entity.js +56 -0
- package/dist/module/enterprise/entity/enterprise.entity.js.map +1 -0
- package/dist/module/enterprise/entity/organization-app-mapping.entity.d.ts +10 -0
- package/dist/module/enterprise/entity/organization-app-mapping.entity.js +49 -0
- package/dist/module/enterprise/entity/organization-app-mapping.entity.js.map +1 -0
- package/dist/module/enterprise/entity/organization.entity.d.ts +16 -0
- package/dist/module/enterprise/entity/organization.entity.js +74 -0
- package/dist/module/enterprise/entity/organization.entity.js.map +1 -0
- package/dist/module/enterprise/repository/enterprise.repository.d.ts +10 -0
- package/dist/module/enterprise/repository/enterprise.repository.js +63 -0
- package/dist/module/enterprise/repository/enterprise.repository.js.map +1 -0
- package/dist/module/enterprise/repository/organization.repository.d.ts +8 -0
- package/dist/module/enterprise/repository/organization.repository.js +41 -0
- package/dist/module/enterprise/repository/organization.repository.js.map +1 -0
- package/dist/module/enterprise/repository/school.repository.d.ts +8 -0
- package/dist/module/enterprise/repository/school.repository.js +226 -0
- package/dist/module/enterprise/repository/school.repository.js.map +1 -0
- package/dist/module/enterprise/service/brand-profile.service.d.ts +0 -0
- package/dist/module/enterprise/service/brand-profile.service.js +1 -0
- package/dist/module/enterprise/service/brand-profile.service.js.map +1 -0
- package/dist/module/enterprise/service/brand.service.d.ts +0 -0
- package/dist/module/enterprise/service/brand.service.js +1 -0
- package/dist/module/enterprise/service/brand.service.js.map +1 -0
- package/dist/module/enterprise/service/enterprise.service.d.ts +8 -0
- package/dist/module/enterprise/service/enterprise.service.js +33 -0
- package/dist/module/enterprise/service/enterprise.service.js.map +1 -0
- package/dist/module/enterprise/service/organization-app-mapping.service.d.ts +2 -0
- package/dist/module/enterprise/service/organization-app-mapping.service.js +17 -0
- package/dist/module/enterprise/service/organization-app-mapping.service.js.map +1 -0
- package/dist/module/enterprise/service/organization.service.d.ts +19 -0
- package/dist/module/enterprise/service/organization.service.js +203 -0
- package/dist/module/enterprise/service/organization.service.js.map +1 -0
- package/dist/module/enterprise/service/populate-meta.service.d.ts +9 -0
- package/dist/module/enterprise/service/populate-meta.service.js +194 -0
- package/dist/module/enterprise/service/populate-meta.service.js.map +1 -0
- package/dist/module/enterprise/service/school.service.d.ts +0 -0
- package/dist/module/enterprise/service/school.service.js +1 -0
- package/dist/module/enterprise/service/school.service.js.map +1 -0
- package/dist/module/entity_json/controller/entity_json.controller.d.ts +18 -0
- package/dist/module/entity_json/controller/entity_json.controller.js +57 -0
- package/dist/module/entity_json/controller/entity_json.controller.js.map +1 -0
- package/dist/module/entity_json/entity/entityJson.entity.d.ts +10 -0
- package/dist/module/entity_json/entity/entityJson.entity.js +55 -0
- package/dist/module/entity_json/entity/entityJson.entity.js.map +1 -0
- package/dist/module/entity_json/entity_json.module.d.ts +2 -0
- package/dist/module/entity_json/entity_json.module.js +30 -0
- package/dist/module/entity_json/entity_json.module.js.map +1 -0
- package/dist/module/entity_json/service/entityJson.repository.d.ts +7 -0
- package/dist/module/entity_json/service/entityJson.repository.js +45 -0
- package/dist/module/entity_json/service/entityJson.repository.js.map +1 -0
- package/dist/module/entity_json/service/entity_json.service.d.ts +25 -0
- package/dist/module/entity_json/service/entity_json.service.js +209 -0
- package/dist/module/entity_json/service/entity_json.service.js.map +1 -0
- package/dist/module/export/controller/export.controller.d.ts +9 -0
- package/dist/module/export/controller/export.controller.js +83 -0
- package/dist/module/export/controller/export.controller.js.map +1 -0
- package/dist/module/export/export.module.d.ts +2 -0
- package/dist/module/export/export.module.js +27 -0
- package/dist/module/export/export.module.js.map +1 -0
- package/dist/module/export/service/export.service.d.ts +14 -0
- package/dist/module/export/service/export.service.js +85 -0
- package/dist/module/export/service/export.service.js.map +1 -0
- package/dist/module/filter/controller/filter.controller.d.ts +39 -0
- package/dist/module/filter/controller/filter.controller.js +94 -0
- package/dist/module/filter/controller/filter.controller.js.map +1 -0
- package/dist/module/filter/dto/filter-request.dto.d.ts +36 -0
- package/dist/module/filter/dto/filter-request.dto.js +3 -0
- package/dist/module/filter/dto/filter-request.dto.js.map +1 -0
- package/dist/module/filter/entity/saved-filter-detail.entity.d.ts +14 -0
- package/dist/module/filter/entity/saved-filter-detail.entity.js +67 -0
- package/dist/module/filter/entity/saved-filter-detail.entity.js.map +1 -0
- package/dist/module/filter/entity/saved-filter-master.entity.d.ts +12 -0
- package/dist/module/filter/entity/saved-filter-master.entity.js +59 -0
- package/dist/module/filter/entity/saved-filter-master.entity.js.map +1 -0
- package/dist/module/filter/filter.module.d.ts +2 -0
- package/dist/module/filter/filter.module.js +46 -0
- package/dist/module/filter/filter.module.js.map +1 -0
- package/dist/module/filter/repository/saved-filter.repository.d.ts +40 -0
- package/dist/module/filter/repository/saved-filter.repository.js +203 -0
- package/dist/module/filter/repository/saved-filter.repository.js.map +1 -0
- package/dist/module/filter/repository/saved.filter-detail.repository.d.ts +7 -0
- package/dist/module/filter/repository/saved.filter-detail.repository.js +38 -0
- package/dist/module/filter/repository/saved.filter-detail.repository.js.map +1 -0
- package/dist/module/filter/service/filter-evaluator.service.d.ts +9 -0
- package/dist/module/filter/service/filter-evaluator.service.js +59 -0
- package/dist/module/filter/service/filter-evaluator.service.js.map +1 -0
- package/dist/module/filter/service/filter.service.d.ts +74 -0
- package/dist/module/filter/service/filter.service.js +921 -0
- package/dist/module/filter/service/filter.service.js.map +1 -0
- package/dist/module/filter/service/saved-filter.service.d.ts +30 -0
- package/dist/module/filter/service/saved-filter.service.js +125 -0
- package/dist/module/filter/service/saved-filter.service.js.map +1 -0
- package/dist/module/ics/controller/ics.controller.d.ts +8 -0
- package/dist/module/ics/controller/ics.controller.js +45 -0
- package/dist/module/ics/controller/ics.controller.js.map +1 -0
- package/dist/module/ics/dto/ics.dto.d.ts +17 -0
- package/dist/module/ics/dto/ics.dto.js +73 -0
- package/dist/module/ics/dto/ics.dto.js.map +1 -0
- package/dist/module/ics/ics.module.d.ts +2 -0
- package/dist/module/ics/ics.module.js +26 -0
- package/dist/module/ics/ics.module.js.map +1 -0
- package/dist/module/ics/service/ics.service.d.ts +4 -0
- package/dist/module/ics/service/ics.service.js +61 -0
- package/dist/module/ics/service/ics.service.js.map +1 -0
- package/dist/module/integration/controller/calender-event.controller.d.ts +7 -0
- package/dist/module/integration/controller/calender-event.controller.js +51 -0
- package/dist/module/integration/controller/calender-event.controller.js.map +1 -0
- package/dist/module/integration/controller/integration.controller.d.ts +165 -0
- package/dist/module/integration/controller/integration.controller.js +697 -0
- package/dist/module/integration/controller/integration.controller.js.map +1 -0
- package/dist/module/integration/controller/wrapper.controller.d.ts +23 -0
- package/dist/module/integration/controller/wrapper.controller.js +52 -0
- package/dist/module/integration/controller/wrapper.controller.js.map +1 -0
- package/dist/module/integration/dto/create-config.dto.d.ts +217 -0
- package/dist/module/integration/dto/create-config.dto.js +495 -0
- package/dist/module/integration/dto/create-config.dto.js.map +1 -0
- package/dist/module/integration/entity/integration-config.entity.d.ts +54 -0
- package/dist/module/integration/entity/integration-config.entity.js +78 -0
- package/dist/module/integration/entity/integration-config.entity.js.map +1 -0
- package/dist/module/integration/entity/integration-entity-mapper.entity.d.ts +6 -0
- package/dist/module/integration/entity/integration-entity-mapper.entity.js +33 -0
- package/dist/module/integration/entity/integration-entity-mapper.entity.js.map +1 -0
- package/dist/module/integration/entity/integration-source.entity.d.ts +7 -0
- package/dist/module/integration/entity/integration-source.entity.js +37 -0
- package/dist/module/integration/entity/integration-source.entity.js.map +1 -0
- package/dist/module/integration/entity/user-integration.entity.d.ts +23 -0
- package/dist/module/integration/entity/user-integration.entity.js +70 -0
- package/dist/module/integration/entity/user-integration.entity.js.map +1 -0
- package/dist/module/integration/examples/usage.example.d.ts +16 -0
- package/dist/module/integration/examples/usage.example.js +217 -0
- package/dist/module/integration/examples/usage.example.js.map +1 -0
- package/dist/module/integration/factories/base.factory.d.ts +9 -0
- package/dist/module/integration/factories/base.factory.js +3 -0
- package/dist/module/integration/factories/base.factory.js.map +1 -0
- package/dist/module/integration/factories/email.factory.d.ts +17 -0
- package/dist/module/integration/factories/email.factory.js +55 -0
- package/dist/module/integration/factories/email.factory.js.map +1 -0
- package/dist/module/integration/factories/integration.factory.d.ts +33 -0
- package/dist/module/integration/factories/integration.factory.js +104 -0
- package/dist/module/integration/factories/integration.factory.js.map +1 -0
- package/dist/module/integration/factories/sms.factory.d.ts +17 -0
- package/dist/module/integration/factories/sms.factory.js +58 -0
- package/dist/module/integration/factories/sms.factory.js.map +1 -0
- package/dist/module/integration/factories/telephone.factory.d.ts +15 -0
- package/dist/module/integration/factories/telephone.factory.js +49 -0
- package/dist/module/integration/factories/telephone.factory.js.map +1 -0
- package/dist/module/integration/factories/whatsapp.factory.d.ts +19 -0
- package/dist/module/integration/factories/whatsapp.factory.js +63 -0
- package/dist/module/integration/factories/whatsapp.factory.js.map +1 -0
- package/dist/module/integration/integration.module.d.ts +2 -0
- package/dist/module/integration/integration.module.js +96 -0
- package/dist/module/integration/integration.module.js.map +1 -0
- package/dist/module/integration/service/calendar-event.service.d.ts +8 -0
- package/dist/module/integration/service/calendar-event.service.js +101 -0
- package/dist/module/integration/service/calendar-event.service.js.map +1 -0
- package/dist/module/integration/service/integration-entity-mapper.service.d.ts +7 -0
- package/dist/module/integration/service/integration-entity-mapper.service.js +36 -0
- package/dist/module/integration/service/integration-entity-mapper.service.js.map +1 -0
- package/dist/module/integration/service/integration-queue.service.d.ts +40 -0
- package/dist/module/integration/service/integration-queue.service.js +147 -0
- package/dist/module/integration/service/integration-queue.service.js.map +1 -0
- package/dist/module/integration/service/integration.service.d.ts +207 -0
- package/dist/module/integration/service/integration.service.js +1590 -0
- package/dist/module/integration/service/integration.service.js.map +1 -0
- package/dist/module/integration/service/oauth.service.d.ts +18 -0
- package/dist/module/integration/service/oauth.service.js +190 -0
- package/dist/module/integration/service/oauth.service.js.map +1 -0
- package/dist/module/integration/service/wrapper.service.d.ts +38 -0
- package/dist/module/integration/service/wrapper.service.js +348 -0
- package/dist/module/integration/service/wrapper.service.js.map +1 -0
- package/dist/module/integration/strategies/email/gmail-api.strategy.d.ts +13 -0
- package/dist/module/integration/strategies/email/gmail-api.strategy.js +195 -0
- package/dist/module/integration/strategies/email/gmail-api.strategy.js.map +1 -0
- package/dist/module/integration/strategies/email/outlook-api.strategy.d.ts +5 -0
- package/dist/module/integration/strategies/email/outlook-api.strategy.js +44 -0
- package/dist/module/integration/strategies/email/outlook-api.strategy.js.map +1 -0
- package/dist/module/integration/strategies/email/outlook.strategy.d.ts +5 -0
- package/dist/module/integration/strategies/email/outlook.strategy.js +64 -0
- package/dist/module/integration/strategies/email/outlook.strategy.js.map +1 -0
- package/dist/module/integration/strategies/email/sendgrid-api.strategy.d.ts +22 -0
- package/dist/module/integration/strategies/email/sendgrid-api.strategy.js +203 -0
- package/dist/module/integration/strategies/email/sendgrid-api.strategy.js.map +1 -0
- package/dist/module/integration/strategies/integration.strategy.d.ts +31 -0
- package/dist/module/integration/strategies/integration.strategy.js +40 -0
- package/dist/module/integration/strategies/integration.strategy.js.map +1 -0
- package/dist/module/integration/strategies/sms/gupshup-sms.strategy.d.ts +9 -0
- package/dist/module/integration/strategies/sms/gupshup-sms.strategy.js +104 -0
- package/dist/module/integration/strategies/sms/gupshup-sms.strategy.js.map +1 -0
- package/dist/module/integration/strategies/sms/msg91-sms.strategy.d.ts +9 -0
- package/dist/module/integration/strategies/sms/msg91-sms.strategy.js +113 -0
- package/dist/module/integration/strategies/sms/msg91-sms.strategy.js.map +1 -0
- package/dist/module/integration/strategies/sms/tubelight-sms.strategy.d.ts +9 -0
- package/dist/module/integration/strategies/sms/tubelight-sms.strategy.js +109 -0
- package/dist/module/integration/strategies/sms/tubelight-sms.strategy.js.map +1 -0
- package/dist/module/integration/strategies/telephone/ozonetel-voice.strategy.d.ts +22 -0
- package/dist/module/integration/strategies/telephone/ozonetel-voice.strategy.js +170 -0
- package/dist/module/integration/strategies/telephone/ozonetel-voice.strategy.js.map +1 -0
- package/dist/module/integration/strategies/telephone/tubelight-voice.strategy.d.ts +24 -0
- package/dist/module/integration/strategies/telephone/tubelight-voice.strategy.js +152 -0
- package/dist/module/integration/strategies/telephone/tubelight-voice.strategy.js.map +1 -0
- package/dist/module/integration/strategies/whatsapp/gupshup-whatsapp.strategy.d.ts +19 -0
- package/dist/module/integration/strategies/whatsapp/gupshup-whatsapp.strategy.js +257 -0
- package/dist/module/integration/strategies/whatsapp/gupshup-whatsapp.strategy.js.map +1 -0
- package/dist/module/integration/strategies/whatsapp/tubelight-whatsapp.strategy.d.ts +33 -0
- package/dist/module/integration/strategies/whatsapp/tubelight-whatsapp.strategy.js +256 -0
- package/dist/module/integration/strategies/whatsapp/tubelight-whatsapp.strategy.js.map +1 -0
- package/dist/module/integration/strategies/whatsapp/whatsapp-cloud.strategy.d.ts +20 -0
- package/dist/module/integration/strategies/whatsapp/whatsapp-cloud.strategy.js +264 -0
- package/dist/module/integration/strategies/whatsapp/whatsapp-cloud.strategy.js.map +1 -0
- package/dist/module/integration/strategies/whatsapp/whatsapp.strategy.d.ts +5 -0
- package/dist/module/integration/strategies/whatsapp/whatsapp.strategy.js +57 -0
- package/dist/module/integration/strategies/whatsapp/whatsapp.strategy.js.map +1 -0
- package/dist/module/layout/controller/layout.controller.d.ts +9 -0
- package/dist/module/layout/controller/layout.controller.js +55 -0
- package/dist/module/layout/controller/layout.controller.js.map +1 -0
- package/dist/module/layout/dto/header.dto.d.ts +0 -0
- package/dist/module/layout/dto/header.dto.js +1 -0
- package/dist/module/layout/dto/header.dto.js.map +1 -0
- package/dist/module/layout/entity/header-items.entity.d.ts +10 -0
- package/dist/module/layout/entity/header-items.entity.js +52 -0
- package/dist/module/layout/entity/header-items.entity.js.map +1 -0
- package/dist/module/layout/entity/header-section.entity.d.ts +5 -0
- package/dist/module/layout/entity/header-section.entity.js +32 -0
- package/dist/module/layout/entity/header-section.entity.js.map +1 -0
- package/dist/module/layout/layout.module.d.ts +2 -0
- package/dist/module/layout/layout.module.js +33 -0
- package/dist/module/layout/layout.module.js.map +1 -0
- package/dist/module/layout/repository/header-items.repository.d.ts +7 -0
- package/dist/module/layout/repository/header-items.repository.js +36 -0
- package/dist/module/layout/repository/header-items.repository.js.map +1 -0
- package/dist/module/layout/repository/header-section.repository.d.ts +7 -0
- package/dist/module/layout/repository/header-section.repository.js +34 -0
- package/dist/module/layout/repository/header-section.repository.js.map +1 -0
- package/dist/module/layout/service/header-section.service.d.ts +8 -0
- package/dist/module/layout/service/header-section.service.js +37 -0
- package/dist/module/layout/service/header-section.service.js.map +1 -0
- package/dist/module/layout_preference/controller/layout_preference.controller.d.ts +19 -0
- package/dist/module/layout_preference/controller/layout_preference.controller.js +78 -0
- package/dist/module/layout_preference/controller/layout_preference.controller.js.map +1 -0
- package/dist/module/layout_preference/dto/layout_preference.dto.d.ts +0 -0
- package/dist/module/layout_preference/dto/layout_preference.dto.js +1 -0
- package/dist/module/layout_preference/dto/layout_preference.dto.js.map +1 -0
- package/dist/module/layout_preference/entity/layout_preference.entity.d.ts +9 -0
- package/dist/module/layout_preference/entity/layout_preference.entity.js +50 -0
- package/dist/module/layout_preference/entity/layout_preference.entity.js.map +1 -0
- package/dist/module/layout_preference/layout_preference.module.d.ts +2 -0
- package/dist/module/layout_preference/layout_preference.module.js +35 -0
- package/dist/module/layout_preference/layout_preference.module.js.map +1 -0
- package/dist/module/layout_preference/repository/layout_preference.repository.d.ts +13 -0
- package/dist/module/layout_preference/repository/layout_preference.repository.js +68 -0
- package/dist/module/layout_preference/repository/layout_preference.repository.js.map +1 -0
- package/dist/module/layout_preference/service/layout_preference.service.d.ts +20 -0
- package/dist/module/layout_preference/service/layout_preference.service.js +128 -0
- package/dist/module/layout_preference/service/layout_preference.service.js.map +1 -0
- package/dist/module/lead/controller/lead.controller.d.ts +20 -0
- package/dist/module/lead/controller/lead.controller.js +58 -0
- package/dist/module/lead/controller/lead.controller.js.map +1 -0
- package/dist/module/lead/lead.module.d.ts +2 -0
- package/dist/module/lead/lead.module.js +26 -0
- package/dist/module/lead/lead.module.js.map +1 -0
- package/dist/module/lead/repository/lead.repository.d.ts +10 -0
- package/dist/module/lead/repository/lead.repository.js +53 -0
- package/dist/module/lead/repository/lead.repository.js.map +1 -0
- package/dist/module/lead/service/lead.service.d.ts +20 -0
- package/dist/module/lead/service/lead.service.js +55 -0
- package/dist/module/lead/service/lead.service.js.map +1 -0
- package/dist/module/linked_attributes/controller/linked_attributes.controller.d.ts +7 -0
- package/dist/module/linked_attributes/controller/linked_attributes.controller.js +55 -0
- package/dist/module/linked_attributes/controller/linked_attributes.controller.js.map +1 -0
- package/dist/module/linked_attributes/entity/linked_attribute.entity.d.ts +10 -0
- package/dist/module/linked_attributes/entity/linked_attribute.entity.js +74 -0
- package/dist/module/linked_attributes/entity/linked_attribute.entity.js.map +1 -0
- package/dist/module/linked_attributes/linked_attributes.module.d.ts +2 -0
- package/dist/module/linked_attributes/linked_attributes.module.js +29 -0
- package/dist/module/linked_attributes/linked_attributes.module.js.map +1 -0
- package/dist/module/linked_attributes/repository/linked_attribute.repository.d.ts +6 -0
- package/dist/module/linked_attributes/repository/linked_attribute.repository.js +31 -0
- package/dist/module/linked_attributes/repository/linked_attribute.repository.js.map +1 -0
- package/dist/module/linked_attributes/service/linked_attributes.service.d.ts +10 -0
- package/dist/module/linked_attributes/service/linked_attributes.service.js +74 -0
- package/dist/module/linked_attributes/service/linked_attributes.service.js.map +1 -0
- package/dist/module/listmaster/controller/list-master.controller.d.ts +29 -0
- package/dist/module/listmaster/controller/list-master.controller.js +186 -0
- package/dist/module/listmaster/controller/list-master.controller.js.map +1 -0
- package/dist/module/listmaster/entity/list-master-items.entity.d.ts +14 -0
- package/dist/module/listmaster/entity/list-master-items.entity.js +69 -0
- package/dist/module/listmaster/entity/list-master-items.entity.js.map +1 -0
- package/dist/module/listmaster/entity/list-master.entity.d.ts +11 -0
- package/dist/module/listmaster/entity/list-master.entity.js +56 -0
- package/dist/module/listmaster/entity/list-master.entity.js.map +1 -0
- package/dist/module/listmaster/listmaster.module.d.ts +2 -0
- package/dist/module/listmaster/listmaster.module.js +55 -0
- package/dist/module/listmaster/listmaster.module.js.map +1 -0
- package/dist/module/listmaster/repository/list-master-items.repository.d.ts +21 -0
- package/dist/module/listmaster/repository/list-master-items.repository.js +143 -0
- package/dist/module/listmaster/repository/list-master-items.repository.js.map +1 -0
- package/dist/module/listmaster/repository/list-master.repository.d.ts +10 -0
- package/dist/module/listmaster/repository/list-master.repository.js +62 -0
- package/dist/module/listmaster/repository/list-master.repository.js.map +1 -0
- package/dist/module/listmaster/service/list-master-engine.d.ts +6 -0
- package/dist/module/listmaster/service/list-master-engine.js +35 -0
- package/dist/module/listmaster/service/list-master-engine.js.map +1 -0
- package/dist/module/listmaster/service/list-master-extension.interface.d.ts +4 -0
- package/dist/module/listmaster/service/list-master-extension.interface.js +3 -0
- package/dist/module/listmaster/service/list-master-extension.interface.js.map +1 -0
- package/dist/module/listmaster/service/list-master-item.service.d.ts +20 -0
- package/dist/module/listmaster/service/list-master-item.service.js +148 -0
- package/dist/module/listmaster/service/list-master-item.service.js.map +1 -0
- package/dist/module/listmaster/service/list-master-registry.d.ts +6 -0
- package/dist/module/listmaster/service/list-master-registry.js +26 -0
- package/dist/module/listmaster/service/list-master-registry.js.map +1 -0
- package/dist/module/listmaster/service/list-master.service.d.ts +40 -0
- package/dist/module/listmaster/service/list-master.service.js +323 -0
- package/dist/module/listmaster/service/list-master.service.js.map +1 -0
- package/dist/module/mapper/controller/field-mapper.controller.d.ts +11 -0
- package/dist/module/mapper/controller/field-mapper.controller.js +94 -0
- package/dist/module/mapper/controller/field-mapper.controller.js.map +1 -0
- package/dist/module/mapper/controller/mapper.controller.d.ts +14 -0
- package/dist/module/mapper/controller/mapper.controller.js +45 -0
- package/dist/module/mapper/controller/mapper.controller.js.map +1 -0
- package/dist/module/mapper/dto/field-mapper.dto.d.ts +12 -0
- package/dist/module/mapper/dto/field-mapper.dto.js +8 -0
- package/dist/module/mapper/dto/field-mapper.dto.js.map +1 -0
- package/dist/module/mapper/entity/field-lovs.entity.d.ts +7 -0
- package/dist/module/mapper/entity/field-lovs.entity.js +38 -0
- package/dist/module/mapper/entity/field-lovs.entity.js.map +1 -0
- package/dist/module/mapper/entity/field-mapper.entity.d.ts +13 -0
- package/dist/module/mapper/entity/field-mapper.entity.js +78 -0
- package/dist/module/mapper/entity/field-mapper.entity.js.map +1 -0
- package/dist/module/mapper/entity/mapper.entity.d.ts +6 -0
- package/dist/module/mapper/entity/mapper.entity.js +34 -0
- package/dist/module/mapper/entity/mapper.entity.js.map +1 -0
- package/dist/module/mapper/mapper.module.d.ts +2 -0
- package/dist/module/mapper/mapper.module.js +48 -0
- package/dist/module/mapper/mapper.module.js.map +1 -0
- package/dist/module/mapper/repository/field-lovs.repository.d.ts +11 -0
- package/dist/module/mapper/repository/field-lovs.repository.js +52 -0
- package/dist/module/mapper/repository/field-lovs.repository.js.map +1 -0
- package/dist/module/mapper/repository/field-mapper.repository.d.ts +11 -0
- package/dist/module/mapper/repository/field-mapper.repository.js +54 -0
- package/dist/module/mapper/repository/field-mapper.repository.js.map +1 -0
- package/dist/module/mapper/repository/mapper.repository.d.ts +7 -0
- package/dist/module/mapper/repository/mapper.repository.js +46 -0
- package/dist/module/mapper/repository/mapper.repository.js.map +1 -0
- package/dist/module/mapper/service/field-mapper.service.d.ts +22 -0
- package/dist/module/mapper/service/field-mapper.service.js +200 -0
- package/dist/module/mapper/service/field-mapper.service.js.map +1 -0
- package/dist/module/mapper/service/mapper.service.d.ts +24 -0
- package/dist/module/mapper/service/mapper.service.js +84 -0
- package/dist/module/mapper/service/mapper.service.js.map +1 -0
- package/dist/module/master/controller/master.controller.d.ts +20 -0
- package/dist/module/master/controller/master.controller.js +82 -0
- package/dist/module/master/controller/master.controller.js.map +1 -0
- package/dist/module/master/service/master.service.d.ts +30 -0
- package/dist/module/master/service/master.service.js +364 -0
- package/dist/module/master/service/master.service.js.map +1 -0
- package/dist/module/meta/controller/attribute-master.controller.d.ts +29 -0
- package/dist/module/meta/controller/attribute-master.controller.js +93 -0
- package/dist/module/meta/controller/attribute-master.controller.js.map +1 -0
- package/dist/module/meta/controller/entity-dynamic.controller.d.ts +21 -0
- package/dist/module/meta/controller/entity-dynamic.controller.js +115 -0
- package/dist/module/meta/controller/entity-dynamic.controller.js.map +1 -0
- package/dist/module/meta/controller/entity-master.controller.d.ts +14 -0
- package/dist/module/meta/controller/entity-master.controller.js +57 -0
- package/dist/module/meta/controller/entity-master.controller.js.map +1 -0
- package/dist/module/meta/controller/entity-relation.controller.d.ts +6 -0
- package/dist/module/meta/controller/entity-relation.controller.js +45 -0
- package/dist/module/meta/controller/entity-relation.controller.js.map +1 -0
- package/dist/module/meta/controller/entity.controller.d.ts +33 -0
- package/dist/module/meta/controller/entity.controller.js +185 -0
- package/dist/module/meta/controller/entity.controller.js.map +1 -0
- package/dist/module/meta/controller/entity.public.controller.d.ts +12 -0
- package/dist/module/meta/controller/entity.public.controller.js +75 -0
- package/dist/module/meta/controller/entity.public.controller.js.map +1 -0
- package/dist/module/meta/controller/media.controller.d.ts +30 -0
- package/dist/module/meta/controller/media.controller.js +119 -0
- package/dist/module/meta/controller/media.controller.js.map +1 -0
- package/dist/module/meta/controller/meta.controller.d.ts +30 -0
- package/dist/module/meta/controller/meta.controller.js +99 -0
- package/dist/module/meta/controller/meta.controller.js.map +1 -0
- package/dist/module/meta/controller/view-master.controller.d.ts +12 -0
- package/dist/module/meta/controller/view-master.controller.js +90 -0
- package/dist/module/meta/controller/view-master.controller.js.map +1 -0
- package/dist/module/meta/dto/entity-list-data.dto.d.ts +5 -0
- package/dist/module/meta/dto/entity-list-data.dto.js +7 -0
- package/dist/module/meta/dto/entity-list-data.dto.js.map +1 -0
- package/dist/module/meta/dto/entity-tab.dto.d.ts +4 -0
- package/dist/module/meta/dto/entity-tab.dto.js +7 -0
- package/dist/module/meta/dto/entity-tab.dto.js.map +1 -0
- package/dist/module/meta/dto/entity-table.dto.d.ts +9 -0
- package/dist/module/meta/dto/entity-table.dto.js +8 -0
- package/dist/module/meta/dto/entity-table.dto.js.map +1 -0
- package/dist/module/meta/entity/attribute-master.entity.d.ts +23 -0
- package/dist/module/meta/entity/attribute-master.entity.js +128 -0
- package/dist/module/meta/entity/attribute-master.entity.js.map +1 -0
- package/dist/module/meta/entity/base-entity.entity.d.ts +19 -0
- package/dist/module/meta/entity/base-entity.entity.js +104 -0
- package/dist/module/meta/entity/base-entity.entity.js.map +1 -0
- package/dist/module/meta/entity/entity-master.entity.d.ts +20 -0
- package/dist/module/meta/entity/entity-master.entity.js +117 -0
- package/dist/module/meta/entity/entity-master.entity.js.map +1 -0
- package/dist/module/meta/entity/entity-relation-data.entity.d.ts +10 -0
- package/dist/module/meta/entity/entity-relation-data.entity.js +51 -0
- package/dist/module/meta/entity/entity-relation-data.entity.js.map +1 -0
- package/dist/module/meta/entity/entity-relation.entity.d.ts +8 -0
- package/dist/module/meta/entity/entity-relation.entity.js +43 -0
- package/dist/module/meta/entity/entity-relation.entity.js.map +1 -0
- package/dist/module/meta/entity/entity-table-column.entity.d.ts +19 -0
- package/dist/module/meta/entity/entity-table-column.entity.js +92 -0
- package/dist/module/meta/entity/entity-table-column.entity.js.map +1 -0
- package/dist/module/meta/entity/entity-table.entity.d.ts +17 -0
- package/dist/module/meta/entity/entity-table.entity.js +79 -0
- package/dist/module/meta/entity/entity-table.entity.js.map +1 -0
- package/dist/module/meta/entity/media-data.entity.d.ts +11 -0
- package/dist/module/meta/entity/media-data.entity.js +55 -0
- package/dist/module/meta/entity/media-data.entity.js.map +1 -0
- package/dist/module/meta/entity/preference.entity.d.ts +11 -0
- package/dist/module/meta/entity/preference.entity.js +85 -0
- package/dist/module/meta/entity/preference.entity.js.map +1 -0
- package/dist/module/meta/entity/view-master.entity.d.ts +14 -0
- package/dist/module/meta/entity/view-master.entity.js +67 -0
- package/dist/module/meta/entity/view-master.entity.js.map +1 -0
- package/dist/module/meta/entity.module.d.ts +2 -0
- package/dist/module/meta/entity.module.js +150 -0
- package/dist/module/meta/entity.module.js.map +1 -0
- package/dist/module/meta/repository/attribute-master.repository.d.ts +30 -0
- package/dist/module/meta/repository/attribute-master.repository.js +136 -0
- package/dist/module/meta/repository/attribute-master.repository.js.map +1 -0
- package/dist/module/meta/repository/entity-attribute-update.repository.d.ts +8 -0
- package/dist/module/meta/repository/entity-attribute-update.repository.js +50 -0
- package/dist/module/meta/repository/entity-attribute-update.repository.js.map +1 -0
- package/dist/module/meta/repository/entity-master.repository.d.ts +33 -0
- package/dist/module/meta/repository/entity-master.repository.js +121 -0
- package/dist/module/meta/repository/entity-master.repository.js.map +1 -0
- package/dist/module/meta/repository/entity-relation.repository.d.ts +7 -0
- package/dist/module/meta/repository/entity-relation.repository.js +39 -0
- package/dist/module/meta/repository/entity-relation.repository.js.map +1 -0
- package/dist/module/meta/repository/entity-table-column.repository.d.ts +7 -0
- package/dist/module/meta/repository/entity-table-column.repository.js +52 -0
- package/dist/module/meta/repository/entity-table-column.repository.js.map +1 -0
- package/dist/module/meta/repository/entity-table.repository.d.ts +9 -0
- package/dist/module/meta/repository/entity-table.repository.js +59 -0
- package/dist/module/meta/repository/entity-table.repository.js.map +1 -0
- package/dist/module/meta/repository/media-data.repository.d.ts +9 -0
- package/dist/module/meta/repository/media-data.repository.js +55 -0
- package/dist/module/meta/repository/media-data.repository.js.map +1 -0
- package/dist/module/meta/repository/preference.repository.d.ts +7 -0
- package/dist/module/meta/repository/preference.repository.js +36 -0
- package/dist/module/meta/repository/preference.repository.js.map +1 -0
- package/dist/module/meta/repository/user-app-mapping.repository.d.ts +0 -0
- package/dist/module/meta/repository/user-app-mapping.repository.js +1 -0
- package/dist/module/meta/repository/user-app-mapping.repository.js.map +1 -0
- package/dist/module/meta/repository/view-master.repository.d.ts +11 -0
- package/dist/module/meta/repository/view-master.repository.js +52 -0
- package/dist/module/meta/repository/view-master.repository.js.map +1 -0
- package/dist/module/meta/service/attribute-master.service.d.ts +21 -0
- package/dist/module/meta/service/attribute-master.service.js +81 -0
- package/dist/module/meta/service/attribute-master.service.js.map +1 -0
- package/dist/module/meta/service/common.service.d.ts +4 -0
- package/dist/module/meta/service/common.service.js +25 -0
- package/dist/module/meta/service/common.service.js.map +1 -0
- package/dist/module/meta/service/entity-attribute-update.service.d.ts +7 -0
- package/dist/module/meta/service/entity-attribute-update.service.js +34 -0
- package/dist/module/meta/service/entity-attribute-update.service.js.map +1 -0
- package/dist/module/meta/service/entity-dynamic.service.d.ts +32 -0
- package/dist/module/meta/service/entity-dynamic.service.js +496 -0
- package/dist/module/meta/service/entity-dynamic.service.js.map +1 -0
- package/dist/module/meta/service/entity-master.service.d.ts +38 -0
- package/dist/module/meta/service/entity-master.service.js +119 -0
- package/dist/module/meta/service/entity-master.service.js.map +1 -0
- package/dist/module/meta/service/entity-realation-data.service.d.ts +4 -0
- package/dist/module/meta/service/entity-realation-data.service.js +25 -0
- package/dist/module/meta/service/entity-realation-data.service.js.map +1 -0
- package/dist/module/meta/service/entity-relation.service.d.ts +11 -0
- package/dist/module/meta/service/entity-relation.service.js +71 -0
- package/dist/module/meta/service/entity-relation.service.js.map +1 -0
- package/dist/module/meta/service/entity-service-impl.service.d.ts +35 -0
- package/dist/module/meta/service/entity-service-impl.service.js +233 -0
- package/dist/module/meta/service/entity-service-impl.service.js.map +1 -0
- package/dist/module/meta/service/entity-table-column.service.d.ts +6 -0
- package/dist/module/meta/service/entity-table-column.service.js +29 -0
- package/dist/module/meta/service/entity-table-column.service.js.map +1 -0
- package/dist/module/meta/service/entity-table.service.d.ts +17 -0
- package/dist/module/meta/service/entity-table.service.js +88 -0
- package/dist/module/meta/service/entity-table.service.js.map +1 -0
- package/dist/module/meta/service/entity-validation.service.d.ts +22 -0
- package/dist/module/meta/service/entity-validation.service.js +118 -0
- package/dist/module/meta/service/entity-validation.service.js.map +1 -0
- package/dist/module/meta/service/entity.service.d.ts +12 -0
- package/dist/module/meta/service/entity.service.js +3 -0
- package/dist/module/meta/service/entity.service.js.map +1 -0
- package/dist/module/meta/service/field-group.service.d.ts +26 -0
- package/dist/module/meta/service/field-group.service.js +76 -0
- package/dist/module/meta/service/field-group.service.js.map +1 -0
- package/dist/module/meta/service/media-data.service.d.ts +43 -0
- package/dist/module/meta/service/media-data.service.js +372 -0
- package/dist/module/meta/service/media-data.service.js.map +1 -0
- package/dist/module/meta/service/preference.service.d.ts +7 -0
- package/dist/module/meta/service/preference.service.js +31 -0
- package/dist/module/meta/service/preference.service.js.map +1 -0
- package/dist/module/meta/service/resolver.service.d.ts +21 -0
- package/dist/module/meta/service/resolver.service.js +215 -0
- package/dist/module/meta/service/resolver.service.js.map +1 -0
- package/dist/module/meta/service/section-master.service.d.ts +26 -0
- package/dist/module/meta/service/section-master.service.js +77 -0
- package/dist/module/meta/service/section-master.service.js.map +1 -0
- package/dist/module/meta/service/update-form-json.service.d.ts +9 -0
- package/dist/module/meta/service/update-form-json.service.js +39 -0
- package/dist/module/meta/service/update-form-json.service.js.map +1 -0
- package/dist/module/meta/service/user-app-mapping.service.d.ts +0 -0
- package/dist/module/meta/service/user-app-mapping.service.js +1 -0
- package/dist/module/meta/service/user-app-mapping.service.js.map +1 -0
- package/dist/module/meta/service/view-master.service.d.ts +29 -0
- package/dist/module/meta/service/view-master.service.js +82 -0
- package/dist/module/meta/service/view-master.service.js.map +1 -0
- package/dist/module/microservice-client/microservice-clients.module.d.ts +2 -0
- package/dist/module/microservice-client/microservice-clients.module.js +27 -0
- package/dist/module/microservice-client/microservice-clients.module.js.map +1 -0
- package/dist/module/microservice-client/service/microservice-client-factory.d.ts +10 -0
- package/dist/module/microservice-client/service/microservice-client-factory.js +46 -0
- package/dist/module/microservice-client/service/microservice-client-factory.js.map +1 -0
- package/dist/module/microservice-client/service/microservice-clients.d.ts +4 -0
- package/dist/module/microservice-client/service/microservice-clients.js +3 -0
- package/dist/module/microservice-client/service/microservice-clients.js.map +1 -0
- package/dist/module/module/controller/menu.controller.d.ts +8 -0
- package/dist/module/module/controller/menu.controller.js +41 -0
- package/dist/module/module/controller/menu.controller.js.map +1 -0
- package/dist/module/module/controller/module-access.controller.d.ts +34 -0
- package/dist/module/module/controller/module-access.controller.js +153 -0
- package/dist/module/module/controller/module-access.controller.js.map +1 -0
- package/dist/module/module/entity/menu.entity.d.ts +18 -0
- package/dist/module/module/entity/menu.entity.js +81 -0
- package/dist/module/module/entity/menu.entity.js.map +1 -0
- package/dist/module/module/entity/module-access.entity.d.ts +23 -0
- package/dist/module/module/entity/module-access.entity.js +94 -0
- package/dist/module/module/entity/module-access.entity.js.map +1 -0
- package/dist/module/module/entity/module-action.entity.d.ts +8 -0
- package/dist/module/module/entity/module-action.entity.js +42 -0
- package/dist/module/module/entity/module-action.entity.js.map +1 -0
- package/dist/module/module/entity/module.entity.d.ts +16 -0
- package/dist/module/module/entity/module.entity.js +74 -0
- package/dist/module/module/entity/module.entity.js.map +1 -0
- package/dist/module/module/module.module.d.ts +2 -0
- package/dist/module/module/module.module.js +53 -0
- package/dist/module/module/module.module.js.map +1 -0
- package/dist/module/module/repository/menu.repository.d.ts +15 -0
- package/dist/module/module/repository/menu.repository.js +174 -0
- package/dist/module/module/repository/menu.repository.js.map +1 -0
- package/dist/module/module/repository/module-access.repository.d.ts +52 -0
- package/dist/module/module/repository/module-access.repository.js +333 -0
- package/dist/module/module/repository/module-access.repository.js.map +1 -0
- package/dist/module/module/service/menu.service.d.ts +10 -0
- package/dist/module/module/service/menu.service.js +56 -0
- package/dist/module/module/service/menu.service.js.map +1 -0
- package/dist/module/module/service/module-access.service.d.ts +60 -0
- package/dist/module/module/service/module-access.service.js +111 -0
- package/dist/module/module/service/module-access.service.js.map +1 -0
- package/dist/module/notification/controller/notification.controller.d.ts +23 -0
- package/dist/module/notification/controller/notification.controller.js +74 -0
- package/dist/module/notification/controller/notification.controller.js.map +1 -0
- package/dist/module/notification/controller/otp.controller.d.ts +35 -0
- package/dist/module/notification/controller/otp.controller.js +103 -0
- package/dist/module/notification/controller/otp.controller.js.map +1 -0
- package/dist/module/notification/entity/notification.entity.d.ts +25 -0
- package/dist/module/notification/entity/notification.entity.js +115 -0
- package/dist/module/notification/entity/notification.entity.js.map +1 -0
- package/dist/module/notification/entity/otp.entity.d.ts +10 -0
- package/dist/module/notification/entity/otp.entity.js +52 -0
- package/dist/module/notification/entity/otp.entity.js.map +1 -0
- package/dist/module/notification/firebase-admin.config.d.ts +7 -0
- package/dist/module/notification/firebase-admin.config.js +24 -0
- package/dist/module/notification/firebase-admin.config.js.map +1 -0
- package/dist/module/notification/notification.module.d.ts +2 -0
- package/dist/module/notification/notification.module.js +81 -0
- package/dist/module/notification/notification.module.js.map +1 -0
- package/dist/module/notification/repository/otp.repository.d.ts +9 -0
- package/dist/module/notification/repository/otp.repository.js +44 -0
- package/dist/module/notification/repository/otp.repository.js.map +1 -0
- package/dist/module/notification/service/email.service.d.ts +15 -0
- package/dist/module/notification/service/email.service.js +124 -0
- package/dist/module/notification/service/email.service.js.map +1 -0
- package/dist/module/notification/service/notification.service.d.ts +27 -0
- package/dist/module/notification/service/notification.service.js +127 -0
- package/dist/module/notification/service/notification.service.js.map +1 -0
- package/dist/module/notification/service/otp.service.d.ts +31 -0
- package/dist/module/notification/service/otp.service.js +111 -0
- package/dist/module/notification/service/otp.service.js.map +1 -0
- package/dist/module/preference_master/entity/preference.entity.d.ts +9 -0
- package/dist/module/preference_master/entity/preference.entity.js +48 -0
- package/dist/module/preference_master/entity/preference.entity.js.map +1 -0
- package/dist/module/preference_master/preference.service.d.ts +8 -0
- package/dist/module/preference_master/preference.service.js +31 -0
- package/dist/module/preference_master/preference.service.js.map +1 -0
- package/dist/module/preference_master/repo/preference.repository.d.ts +8 -0
- package/dist/module/preference_master/repo/preference.repository.js +48 -0
- package/dist/module/preference_master/repo/preference.repository.js.map +1 -0
- package/dist/module/third-party-module/entity/third-party-api-registry.entity.d.ts +18 -0
- package/dist/module/third-party-module/entity/third-party-api-registry.entity.js +84 -0
- package/dist/module/third-party-module/entity/third-party-api-registry.entity.js.map +1 -0
- package/dist/module/third-party-module/repository/third-party-api-registry.repository.d.ts +7 -0
- package/dist/module/third-party-module/repository/third-party-api-registry.repository.js +38 -0
- package/dist/module/third-party-module/repository/third-party-api-registry.repository.js.map +1 -0
- package/dist/module/third-party-module/service/api-registry.service.d.ts +6 -0
- package/dist/module/third-party-module/service/api-registry.service.js +28 -0
- package/dist/module/third-party-module/service/api-registry.service.js.map +1 -0
- package/dist/module/third-party-module/third-party.module.d.ts +2 -0
- package/dist/module/third-party-module/third-party.module.js +25 -0
- package/dist/module/third-party-module/third-party.module.js.map +1 -0
- package/dist/module/user/controller/login.controller.d.ts +24 -0
- package/dist/module/user/controller/login.controller.js +173 -0
- package/dist/module/user/controller/login.controller.js.map +1 -0
- package/dist/module/user/controller/user.controller.d.ts +7 -0
- package/dist/module/user/controller/user.controller.js +46 -0
- package/dist/module/user/controller/user.controller.js.map +1 -0
- package/dist/module/user/dto/create-user.dto.d.ts +20 -0
- package/dist/module/user/dto/create-user.dto.js +70 -0
- package/dist/module/user/dto/create-user.dto.js.map +1 -0
- package/dist/module/user/dto/update-user.dto.d.ts +5 -0
- package/dist/module/user/dto/update-user.dto.js +9 -0
- package/dist/module/user/dto/update-user.dto.js.map +1 -0
- package/dist/module/user/entity/role.entity.d.ts +23 -0
- package/dist/module/user/entity/role.entity.js +101 -0
- package/dist/module/user/entity/role.entity.js.map +1 -0
- package/dist/module/user/entity/user-role-mapping.entity.d.ts +22 -0
- package/dist/module/user/entity/user-role-mapping.entity.js +95 -0
- package/dist/module/user/entity/user-role-mapping.entity.js.map +1 -0
- package/dist/module/user/entity/user-session.entity.d.ts +13 -0
- package/dist/module/user/entity/user-session.entity.js +84 -0
- package/dist/module/user/entity/user-session.entity.js.map +1 -0
- package/dist/module/user/entity/user.entity.d.ts +33 -0
- package/dist/module/user/entity/user.entity.js +141 -0
- package/dist/module/user/entity/user.entity.js.map +1 -0
- package/dist/module/user/repository/role.repository.d.ts +23 -0
- package/dist/module/user/repository/role.repository.js +102 -0
- package/dist/module/user/repository/role.repository.js.map +1 -0
- package/dist/module/user/repository/user-role-mapping.repository.d.ts +20 -0
- package/dist/module/user/repository/user-role-mapping.repository.js +113 -0
- package/dist/module/user/repository/user-role-mapping.repository.js.map +1 -0
- package/dist/module/user/repository/user.repository.d.ts +13 -0
- package/dist/module/user/repository/user.repository.js +77 -0
- package/dist/module/user/repository/user.repository.js.map +1 -0
- package/dist/module/user/repository/userSession.repository.d.ts +11 -0
- package/dist/module/user/repository/userSession.repository.js +48 -0
- package/dist/module/user/repository/userSession.repository.js.map +1 -0
- package/dist/module/user/service/login.service.d.ts +39 -0
- package/dist/module/user/service/login.service.js +243 -0
- package/dist/module/user/service/login.service.js.map +1 -0
- package/dist/module/user/service/role.service.d.ts +38 -0
- package/dist/module/user/service/role.service.js +168 -0
- package/dist/module/user/service/role.service.js.map +1 -0
- package/dist/module/user/service/user-role-mapping.service.d.ts +14 -0
- package/dist/module/user/service/user-role-mapping.service.js +66 -0
- package/dist/module/user/service/user-role-mapping.service.js.map +1 -0
- package/dist/module/user/service/user-session.service.d.ts +30 -0
- package/dist/module/user/service/user-session.service.js +159 -0
- package/dist/module/user/service/user-session.service.js.map +1 -0
- package/dist/module/user/service/user.service.d.ts +49 -0
- package/dist/module/user/service/user.service.js +251 -0
- package/dist/module/user/service/user.service.js.map +1 -0
- package/dist/module/user/user.module.d.ts +2 -0
- package/dist/module/user/user.module.js +73 -0
- package/dist/module/user/user.module.js.map +1 -0
- package/dist/module/workflow/controller/action-category.controller.d.ts +18 -0
- package/dist/module/workflow/controller/action-category.controller.js +79 -0
- package/dist/module/workflow/controller/action-category.controller.js.map +1 -0
- package/dist/module/workflow/controller/action-resource-mapping.controller.d.ts +5 -0
- package/dist/module/workflow/controller/action-resource-mapping.controller.js +31 -0
- package/dist/module/workflow/controller/action-resource-mapping.controller.js.map +1 -0
- package/dist/module/workflow/controller/action-template-mapping.controller.d.ts +12 -0
- package/dist/module/workflow/controller/action-template-mapping.controller.js +44 -0
- package/dist/module/workflow/controller/action-template-mapping.controller.js.map +1 -0
- package/dist/module/workflow/controller/action.controller.d.ts +54 -0
- package/dist/module/workflow/controller/action.controller.js +122 -0
- package/dist/module/workflow/controller/action.controller.js.map +1 -0
- package/dist/module/workflow/controller/activity-log.controller.d.ts +42 -0
- package/dist/module/workflow/controller/activity-log.controller.js +62 -0
- package/dist/module/workflow/controller/activity-log.controller.js.map +1 -0
- package/dist/module/workflow/controller/comm-template.controller.d.ts +19 -0
- package/dist/module/workflow/controller/comm-template.controller.js +58 -0
- package/dist/module/workflow/controller/comm-template.controller.js.map +1 -0
- package/dist/module/workflow/controller/entity-modification.controller.d.ts +8 -0
- package/dist/module/workflow/controller/entity-modification.controller.js +44 -0
- package/dist/module/workflow/controller/entity-modification.controller.js.map +1 -0
- package/dist/module/workflow/controller/form-master.controller.d.ts +14 -0
- package/dist/module/workflow/controller/form-master.controller.js +59 -0
- package/dist/module/workflow/controller/form-master.controller.js.map +1 -0
- package/dist/module/workflow/controller/stage-group.controller.d.ts +19 -0
- package/dist/module/workflow/controller/stage-group.controller.js +57 -0
- package/dist/module/workflow/controller/stage-group.controller.js.map +1 -0
- package/dist/module/workflow/controller/stage.controller.d.ts +16 -0
- package/dist/module/workflow/controller/stage.controller.js +58 -0
- package/dist/module/workflow/controller/stage.controller.js.map +1 -0
- package/dist/module/workflow/controller/task.controller.d.ts +32 -0
- package/dist/module/workflow/controller/task.controller.js +72 -0
- package/dist/module/workflow/controller/task.controller.js.map +1 -0
- package/dist/module/workflow/controller/workflow-list-master.controller.d.ts +14 -0
- package/dist/module/workflow/controller/workflow-list-master.controller.js +67 -0
- package/dist/module/workflow/controller/workflow-list-master.controller.js.map +1 -0
- package/dist/module/workflow/controller/workflow-meta.controller.d.ts +15 -0
- package/dist/module/workflow/controller/workflow-meta.controller.js +72 -0
- package/dist/module/workflow/controller/workflow-meta.controller.js.map +1 -0
- package/dist/module/workflow/controller/workflow.controller.d.ts +31 -0
- package/dist/module/workflow/controller/workflow.controller.js +83 -0
- package/dist/module/workflow/controller/workflow.controller.js.map +1 -0
- package/dist/module/workflow/entity/action-category.entity.d.ts +13 -0
- package/dist/module/workflow/entity/action-category.entity.js +63 -0
- package/dist/module/workflow/entity/action-category.entity.js.map +1 -0
- package/dist/module/workflow/entity/action-data.entity.d.ts +19 -0
- package/dist/module/workflow/entity/action-data.entity.js +86 -0
- package/dist/module/workflow/entity/action-data.entity.js.map +1 -0
- package/dist/module/workflow/entity/action-resources-mapping.entity.d.ts +9 -0
- package/dist/module/workflow/entity/action-resources-mapping.entity.js +47 -0
- package/dist/module/workflow/entity/action-resources-mapping.entity.js.map +1 -0
- package/dist/module/workflow/entity/action-template-mapping.entity.d.ts +6 -0
- package/dist/module/workflow/entity/action-template-mapping.entity.js +35 -0
- package/dist/module/workflow/entity/action-template-mapping.entity.js.map +1 -0
- package/dist/module/workflow/entity/action.entity.d.ts +18 -0
- package/dist/module/workflow/entity/action.entity.js +83 -0
- package/dist/module/workflow/entity/action.entity.js.map +1 -0
- package/dist/module/workflow/entity/activity-log.entity.d.ts +15 -0
- package/dist/module/workflow/entity/activity-log.entity.js +70 -0
- package/dist/module/workflow/entity/activity-log.entity.js.map +1 -0
- package/dist/module/workflow/entity/comm-template.entity.d.ts +14 -0
- package/dist/module/workflow/entity/comm-template.entity.js +67 -0
- package/dist/module/workflow/entity/comm-template.entity.js.map +1 -0
- package/dist/module/workflow/entity/entity-modification.entity.d.ts +13 -0
- package/dist/module/workflow/entity/entity-modification.entity.js +63 -0
- package/dist/module/workflow/entity/entity-modification.entity.js.map +1 -0
- package/dist/module/workflow/entity/form.entity.d.ts +9 -0
- package/dist/module/workflow/entity/form.entity.js +46 -0
- package/dist/module/workflow/entity/form.entity.js.map +1 -0
- package/dist/module/workflow/entity/stage-action-mapping.entity.d.ts +6 -0
- package/dist/module/workflow/entity/stage-action-mapping.entity.js +35 -0
- package/dist/module/workflow/entity/stage-action-mapping.entity.js.map +1 -0
- package/dist/module/workflow/entity/stage-group.entity.d.ts +8 -0
- package/dist/module/workflow/entity/stage-group.entity.js +43 -0
- package/dist/module/workflow/entity/stage-group.entity.js.map +1 -0
- package/dist/module/workflow/entity/stage-movement-data.entity.d.ts +13 -0
- package/dist/module/workflow/entity/stage-movement-data.entity.js +63 -0
- package/dist/module/workflow/entity/stage-movement-data.entity.js.map +1 -0
- package/dist/module/workflow/entity/stage.entity.d.ts +7 -0
- package/dist/module/workflow/entity/stage.entity.js +39 -0
- package/dist/module/workflow/entity/stage.entity.js.map +1 -0
- package/dist/module/workflow/entity/task-data.entity.d.ts +30 -0
- package/dist/module/workflow/entity/task-data.entity.js +130 -0
- package/dist/module/workflow/entity/task-data.entity.js.map +1 -0
- package/dist/module/workflow/entity/template-attach-mapper.entity.d.ts +11 -0
- package/dist/module/workflow/entity/template-attach-mapper.entity.js +54 -0
- package/dist/module/workflow/entity/template-attach-mapper.entity.js.map +1 -0
- package/dist/module/workflow/entity/workflow-data.entity.d.ts +4 -0
- package/dist/module/workflow/entity/workflow-data.entity.js +27 -0
- package/dist/module/workflow/entity/workflow-data.entity.js.map +1 -0
- package/dist/module/workflow/entity/workflow-level-mapping.entity.d.ts +7 -0
- package/dist/module/workflow/entity/workflow-level-mapping.entity.js +38 -0
- package/dist/module/workflow/entity/workflow-level-mapping.entity.js.map +1 -0
- package/dist/module/workflow/entity/workflow.entity.d.ts +7 -0
- package/dist/module/workflow/entity/workflow.entity.js +39 -0
- package/dist/module/workflow/entity/workflow.entity.js.map +1 -0
- package/dist/module/workflow/repository/action-category.repository.d.ts +19 -0
- package/dist/module/workflow/repository/action-category.repository.js +84 -0
- package/dist/module/workflow/repository/action-category.repository.js.map +1 -0
- package/dist/module/workflow/repository/action-data.repository.d.ts +22 -0
- package/dist/module/workflow/repository/action-data.repository.js +252 -0
- package/dist/module/workflow/repository/action-data.repository.js.map +1 -0
- package/dist/module/workflow/repository/action.repository.d.ts +31 -0
- package/dist/module/workflow/repository/action.repository.js +258 -0
- package/dist/module/workflow/repository/action.repository.js.map +1 -0
- package/dist/module/workflow/repository/activity-log.repository.d.ts +57 -0
- package/dist/module/workflow/repository/activity-log.repository.js +129 -0
- package/dist/module/workflow/repository/activity-log.repository.js.map +1 -0
- package/dist/module/workflow/repository/comm-template.repository.d.ts +17 -0
- package/dist/module/workflow/repository/comm-template.repository.js +126 -0
- package/dist/module/workflow/repository/comm-template.repository.js.map +1 -0
- package/dist/module/workflow/repository/form-master.repository.d.ts +11 -0
- package/dist/module/workflow/repository/form-master.repository.js +41 -0
- package/dist/module/workflow/repository/form-master.repository.js.map +1 -0
- package/dist/module/workflow/repository/form.repository.d.ts +0 -0
- package/dist/module/workflow/repository/form.repository.js +1 -0
- package/dist/module/workflow/repository/form.repository.js.map +1 -0
- package/dist/module/workflow/repository/stage-group.repository.d.ts +37 -0
- package/dist/module/workflow/repository/stage-group.repository.js +145 -0
- package/dist/module/workflow/repository/stage-group.repository.js.map +1 -0
- package/dist/module/workflow/repository/stage-movement.repository.d.ts +28 -0
- package/dist/module/workflow/repository/stage-movement.repository.js +180 -0
- package/dist/module/workflow/repository/stage-movement.repository.js.map +1 -0
- package/dist/module/workflow/repository/stage.repository.d.ts +31 -0
- package/dist/module/workflow/repository/stage.repository.js +117 -0
- package/dist/module/workflow/repository/stage.repository.js.map +1 -0
- package/dist/module/workflow/repository/task.repository.d.ts +18 -0
- package/dist/module/workflow/repository/task.repository.js +134 -0
- package/dist/module/workflow/repository/task.repository.js.map +1 -0
- package/dist/module/workflow/repository/workflow.repository.d.ts +10 -0
- package/dist/module/workflow/repository/workflow.repository.js +49 -0
- package/dist/module/workflow/repository/workflow.repository.js.map +1 -0
- package/dist/module/workflow/service/action-category.service.d.ts +21 -0
- package/dist/module/workflow/service/action-category.service.js +42 -0
- package/dist/module/workflow/service/action-category.service.js.map +1 -0
- package/dist/module/workflow/service/action-data.service.d.ts +16 -0
- package/dist/module/workflow/service/action-data.service.js +39 -0
- package/dist/module/workflow/service/action-data.service.js.map +1 -0
- package/dist/module/workflow/service/action-resources-mapping.service.d.ts +6 -0
- package/dist/module/workflow/service/action-resources-mapping.service.js +27 -0
- package/dist/module/workflow/service/action-resources-mapping.service.js.map +1 -0
- package/dist/module/workflow/service/action-template-mapping.service.d.ts +10 -0
- package/dist/module/workflow/service/action-template-mapping.service.js +133 -0
- package/dist/module/workflow/service/action-template-mapping.service.js.map +1 -0
- package/dist/module/workflow/service/action.service.d.ts +44 -0
- package/dist/module/workflow/service/action.service.js +211 -0
- package/dist/module/workflow/service/action.service.js.map +1 -0
- package/dist/module/workflow/service/activity-log.service.d.ts +42 -0
- package/dist/module/workflow/service/activity-log.service.js +92 -0
- package/dist/module/workflow/service/activity-log.service.js.map +1 -0
- package/dist/module/workflow/service/comm-template.service.d.ts +24 -0
- package/dist/module/workflow/service/comm-template.service.js +132 -0
- package/dist/module/workflow/service/comm-template.service.js.map +1 -0
- package/dist/module/workflow/service/entity-modification.service.d.ts +8 -0
- package/dist/module/workflow/service/entity-modification.service.js +47 -0
- package/dist/module/workflow/service/entity-modification.service.js.map +1 -0
- package/dist/module/workflow/service/form-master.service.d.ts +17 -0
- package/dist/module/workflow/service/form-master.service.js +38 -0
- package/dist/module/workflow/service/form-master.service.js.map +1 -0
- package/dist/module/workflow/service/populate-workflow.service.d.ts +21 -0
- package/dist/module/workflow/service/populate-workflow.service.js +245 -0
- package/dist/module/workflow/service/populate-workflow.service.js.map +1 -0
- package/dist/module/workflow/service/stage-action-mapping.service.d.ts +3 -0
- package/dist/module/workflow/service/stage-action-mapping.service.js +18 -0
- package/dist/module/workflow/service/stage-action-mapping.service.js.map +1 -0
- package/dist/module/workflow/service/stage-group.service.d.ts +30 -0
- package/dist/module/workflow/service/stage-group.service.js +238 -0
- package/dist/module/workflow/service/stage-group.service.js.map +1 -0
- package/dist/module/workflow/service/stage.service.d.ts +21 -0
- package/dist/module/workflow/service/stage.service.js +136 -0
- package/dist/module/workflow/service/stage.service.js.map +1 -0
- package/dist/module/workflow/service/task.service.d.ts +46 -0
- package/dist/module/workflow/service/task.service.js +368 -0
- package/dist/module/workflow/service/task.service.js.map +1 -0
- package/dist/module/workflow/service/workflow-list-master.service.d.ts +7 -0
- package/dist/module/workflow/service/workflow-list-master.service.js +73 -0
- package/dist/module/workflow/service/workflow-list-master.service.js.map +1 -0
- package/dist/module/workflow/service/workflow-meta.service.d.ts +37 -0
- package/dist/module/workflow/service/workflow-meta.service.js +424 -0
- package/dist/module/workflow/service/workflow-meta.service.js.map +1 -0
- package/dist/module/workflow/service/workflow.service.d.ts +31 -0
- package/dist/module/workflow/service/workflow.service.js +153 -0
- package/dist/module/workflow/service/workflow.service.js.map +1 -0
- package/dist/module/workflow/workflow.module.d.ts +2 -0
- package/dist/module/workflow/workflow.module.js +194 -0
- package/dist/module/workflow/workflow.module.js.map +1 -0
- package/dist/module/workflow-automation/controller/workflow-automation.controller.d.ts +11 -0
- package/dist/module/workflow-automation/controller/workflow-automation.controller.js +47 -0
- package/dist/module/workflow-automation/controller/workflow-automation.controller.js.map +1 -0
- package/dist/module/workflow-automation/entity/workflow-automation-action.entity.d.ts +9 -0
- package/dist/module/workflow-automation/entity/workflow-automation-action.entity.js +47 -0
- package/dist/module/workflow-automation/entity/workflow-automation-action.entity.js.map +1 -0
- package/dist/module/workflow-automation/entity/workflow-automation.entity.d.ts +14 -0
- package/dist/module/workflow-automation/entity/workflow-automation.entity.js +67 -0
- package/dist/module/workflow-automation/entity/workflow-automation.entity.js.map +1 -0
- package/dist/module/workflow-automation/interface/action.decorator.d.ts +2 -0
- package/dist/module/workflow-automation/interface/action.decorator.js +8 -0
- package/dist/module/workflow-automation/interface/action.decorator.js.map +1 -0
- package/dist/module/workflow-automation/interface/action.interface.d.ts +4 -0
- package/dist/module/workflow-automation/interface/action.interface.js +3 -0
- package/dist/module/workflow-automation/interface/action.interface.js.map +1 -0
- package/dist/module/workflow-automation/service/action-registery.service.d.ts +11 -0
- package/dist/module/workflow-automation/service/action-registery.service.js +46 -0
- package/dist/module/workflow-automation/service/action-registery.service.js.map +1 -0
- package/dist/module/workflow-automation/service/schedule-handler.service.d.ts +22 -0
- package/dist/module/workflow-automation/service/schedule-handler.service.js +141 -0
- package/dist/module/workflow-automation/service/schedule-handler.service.js.map +1 -0
- package/dist/module/workflow-automation/service/workflow-automation-engine.service.d.ts +15 -0
- package/dist/module/workflow-automation/service/workflow-automation-engine.service.js +124 -0
- package/dist/module/workflow-automation/service/workflow-automation-engine.service.js.map +1 -0
- package/dist/module/workflow-automation/service/workflow-automation.service.d.ts +68 -0
- package/dist/module/workflow-automation/service/workflow-automation.service.js +339 -0
- package/dist/module/workflow-automation/service/workflow-automation.service.js.map +1 -0
- package/dist/module/workflow-automation/workflow-automation.module.d.ts +2 -0
- package/dist/module/workflow-automation/workflow-automation.module.js +68 -0
- package/dist/module/workflow-automation/workflow-automation.module.js.map +1 -0
- package/dist/module/workflow-schedule/constants/schedule.constants.d.ts +27 -0
- package/dist/module/workflow-schedule/constants/schedule.constants.js +31 -0
- package/dist/module/workflow-schedule/constants/schedule.constants.js.map +1 -0
- package/dist/module/workflow-schedule/controller/workflow-schedule.controller.d.ts +81 -0
- package/dist/module/workflow-schedule/controller/workflow-schedule.controller.js +218 -0
- package/dist/module/workflow-schedule/controller/workflow-schedule.controller.js.map +1 -0
- package/dist/module/workflow-schedule/dto/create-schedule.dto.d.ts +32 -0
- package/dist/module/workflow-schedule/dto/create-schedule.dto.js +163 -0
- package/dist/module/workflow-schedule/dto/create-schedule.dto.js.map +1 -0
- package/dist/module/workflow-schedule/dto/get-execution-logs.dto.d.ts +35 -0
- package/dist/module/workflow-schedule/dto/get-execution-logs.dto.js +124 -0
- package/dist/module/workflow-schedule/dto/get-execution-logs.dto.js.map +1 -0
- package/dist/module/workflow-schedule/dto/update-schedule.dto.d.ts +19 -0
- package/dist/module/workflow-schedule/dto/update-schedule.dto.js +106 -0
- package/dist/module/workflow-schedule/dto/update-schedule.dto.js.map +1 -0
- package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.d.ts +30 -0
- package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.js +113 -0
- package/dist/module/workflow-schedule/entities/scheduled-workflow.entity.js.map +1 -0
- package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.d.ts +34 -0
- package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.js +118 -0
- package/dist/module/workflow-schedule/entities/workflow-execution-log.entity.js.map +1 -0
- package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.d.ts +44 -0
- package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.js +3 -0
- package/dist/module/workflow-schedule/interfaces/schedule-job-data.interface.js.map +1 -0
- package/dist/module/workflow-schedule/interfaces/workflow-schedule-options.interface.d.ts +3 -0
- package/dist/module/workflow-schedule/interfaces/workflow-schedule-options.interface.js +3 -0
- package/dist/module/workflow-schedule/interfaces/workflow-schedule-options.interface.js.map +1 -0
- package/dist/module/workflow-schedule/processors/schedule.processor.d.ts +33 -0
- package/dist/module/workflow-schedule/processors/schedule.processor.js +422 -0
- package/dist/module/workflow-schedule/processors/schedule.processor.js.map +1 -0
- package/dist/module/workflow-schedule/service/workflow-schedule.service.d.ts +43 -0
- package/dist/module/workflow-schedule/service/workflow-schedule.service.js +432 -0
- package/dist/module/workflow-schedule/service/workflow-schedule.service.js.map +1 -0
- package/dist/module/workflow-schedule/workflow-schedule.module.d.ts +5 -0
- package/dist/module/workflow-schedule/workflow-schedule.module.js +52 -0
- package/dist/module/workflow-schedule/workflow-schedule.module.js.map +1 -0
- package/dist/resources/properties.module.d.ts +2 -0
- package/dist/resources/properties.module.js +25 -0
- package/dist/resources/properties.module.js.map +1 -0
- package/dist/resources/properties.yaml.d.ts +2 -0
- package/dist/resources/properties.yaml.js +10 -0
- package/dist/resources/properties.yaml.js.map +1 -0
- package/dist/table.config.d.ts +39 -0
- package/dist/table.config.js +136 -0
- package/dist/table.config.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/utils/dto/excel-data.dto.d.ts +7 -0
- package/dist/utils/dto/excel-data.dto.js +16 -0
- package/dist/utils/dto/excel-data.dto.js.map +1 -0
- package/dist/utils/dto/excelsheet-data.dto.d.ts +5 -0
- package/dist/utils/dto/excelsheet-data.dto.js +3 -0
- package/dist/utils/dto/excelsheet-data.dto.js.map +1 -0
- package/dist/utils/service/base64util.service.d.ts +4 -0
- package/dist/utils/service/base64util.service.js +21 -0
- package/dist/utils/service/base64util.service.js.map +1 -0
- package/dist/utils/service/clockIDGenUtil.service.d.ts +8 -0
- package/dist/utils/service/clockIDGenUtil.service.js +32 -0
- package/dist/utils/service/clockIDGenUtil.service.js.map +1 -0
- package/dist/utils/service/codeGenerator.service.d.ts +3 -0
- package/dist/utils/service/codeGenerator.service.js +19 -0
- package/dist/utils/service/codeGenerator.service.js.map +1 -0
- package/dist/utils/service/dateUtil.service.d.ts +3 -0
- package/dist/utils/service/dateUtil.service.js +28 -0
- package/dist/utils/service/dateUtil.service.js.map +1 -0
- package/dist/utils/service/encryptUtil.service.d.ts +9 -0
- package/dist/utils/service/encryptUtil.service.js +112 -0
- package/dist/utils/service/encryptUtil.service.js.map +1 -0
- package/dist/utils/service/excel-helper.service.d.ts +9 -0
- package/dist/utils/service/excel-helper.service.js +56 -0
- package/dist/utils/service/excel-helper.service.js.map +1 -0
- package/dist/utils/service/excelUtil.service.d.ts +3 -0
- package/dist/utils/service/excelUtil.service.js +17 -0
- package/dist/utils/service/excelUtil.service.js.map +1 -0
- package/dist/utils/service/file-util.service.d.ts +3 -0
- package/dist/utils/service/file-util.service.js +15 -0
- package/dist/utils/service/file-util.service.js.map +1 -0
- package/dist/utils/service/json-util.service.d.ts +3 -0
- package/dist/utils/service/json-util.service.js +24 -0
- package/dist/utils/service/json-util.service.js.map +1 -0
- package/dist/utils/service/loggingUtil.service.d.ts +11 -0
- package/dist/utils/service/loggingUtil.service.js +87 -0
- package/dist/utils/service/loggingUtil.service.js.map +1 -0
- package/dist/utils/service/reflection-helper.service.d.ts +10 -0
- package/dist/utils/service/reflection-helper.service.js +66 -0
- package/dist/utils/service/reflection-helper.service.js.map +1 -0
- package/dist/utils/service/wbsCodeGen.service.d.ts +3 -0
- package/dist/utils/service/wbsCodeGen.service.js +20 -0
- package/dist/utils/service/wbsCodeGen.service.js.map +1 -0
- package/dist/utils/utils.module.d.ts +2 -0
- package/dist/utils/utils.module.js +40 -0
- package/dist/utils/utils.module.js.map +1 -0
- package/package.json +1 -1
- package/src/module/module/repository/module-access.repository.ts +9 -9
|
@@ -0,0 +1,1590 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var IntegrationService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.IntegrationService = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
+
const typeorm_2 = require("typeorm");
|
|
20
|
+
const config_1 = require("@nestjs/config");
|
|
21
|
+
const googleapis_1 = require("googleapis");
|
|
22
|
+
const integration_config_entity_1 = require("../entity/integration-config.entity");
|
|
23
|
+
const user_integration_entity_1 = require("../entity/user-integration.entity");
|
|
24
|
+
const integration_entity_mapper_entity_1 = require("../entity/integration-entity-mapper.entity");
|
|
25
|
+
const integration_factory_1 = require("../factories/integration.factory");
|
|
26
|
+
const gmail_api_strategy_1 = require("../strategies/email/gmail-api.strategy");
|
|
27
|
+
const sendgrid_api_strategy_1 = require("../strategies/email/sendgrid-api.strategy");
|
|
28
|
+
const integration_queue_service_1 = require("./integration-queue.service");
|
|
29
|
+
const field_mapper_service_1 = require("../../mapper/service/field-mapper.service");
|
|
30
|
+
const global_constant_1 = require("../../../constant/global.constant");
|
|
31
|
+
const entity_service_impl_service_1 = require("../../meta/service/entity-service-impl.service");
|
|
32
|
+
const media_data_service_1 = require("../../meta/service/media-data.service");
|
|
33
|
+
const axios_1 = require("axios");
|
|
34
|
+
const reflection_helper_service_1 = require("../../../utils/service/reflection-helper.service");
|
|
35
|
+
let IntegrationService = IntegrationService_1 = class IntegrationService {
|
|
36
|
+
constructor(configRepository, userIntegrationRepository, entityMapperRepository, dataSource, integrationFactory, gmailApiStrategy, sendGridApiStrategy, configService, mediaService, fieldMapperService, entityService, reflectionHelper, queueService) {
|
|
37
|
+
this.configRepository = configRepository;
|
|
38
|
+
this.userIntegrationRepository = userIntegrationRepository;
|
|
39
|
+
this.entityMapperRepository = entityMapperRepository;
|
|
40
|
+
this.dataSource = dataSource;
|
|
41
|
+
this.integrationFactory = integrationFactory;
|
|
42
|
+
this.gmailApiStrategy = gmailApiStrategy;
|
|
43
|
+
this.sendGridApiStrategy = sendGridApiStrategy;
|
|
44
|
+
this.configService = configService;
|
|
45
|
+
this.mediaService = mediaService;
|
|
46
|
+
this.fieldMapperService = fieldMapperService;
|
|
47
|
+
this.entityService = entityService;
|
|
48
|
+
this.reflectionHelper = reflectionHelper;
|
|
49
|
+
this.queueService = queueService;
|
|
50
|
+
this.logger = new common_1.Logger(IntegrationService_1.name);
|
|
51
|
+
this.gmailOAuthStates = new Map();
|
|
52
|
+
}
|
|
53
|
+
deriveServiceType(integration_type, integration_provider, config_json) {
|
|
54
|
+
return 'API';
|
|
55
|
+
}
|
|
56
|
+
async sendMessage({ levelId, levelType, app_code, to, message, mode, priority = 1, user_id, }) {
|
|
57
|
+
try {
|
|
58
|
+
const configs = await this.getActiveConfigs(levelId, levelType, app_code, mode);
|
|
59
|
+
if (!configs.length) {
|
|
60
|
+
throw new Error(`No active communication configuration found for ${levelType} ${levelId}`);
|
|
61
|
+
}
|
|
62
|
+
const sortedConfigs = this.sortConfigsByPriority(configs, priority);
|
|
63
|
+
for (const config of sortedConfigs) {
|
|
64
|
+
try {
|
|
65
|
+
const result = await this.sendViaConfig(config, to, message, user_id);
|
|
66
|
+
if (result.success) {
|
|
67
|
+
this.logger.log(`Message sent successfully via ${config.integration_provider}`);
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
this.logger.warn(`Failed to send via ${config.integration_provider}: ${result.error}`);
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
this.logger.error(`Error sending via ${config.integration_provider}:`, error.message);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
throw new Error('All communication providers failed');
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
this.logger.error('Communication service error:', error.message);
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async getActiveConfigs(levelId, levelType, app_code, mode) {
|
|
85
|
+
const queryBuilder = this.configRepository
|
|
86
|
+
.createQueryBuilder('config')
|
|
87
|
+
.where('config.level_id = :levelId', { levelId })
|
|
88
|
+
.andWhere('config.level_type = :levelType', { levelType })
|
|
89
|
+
.andWhere('config.app_code = :app_code', { app_code })
|
|
90
|
+
.andWhere('config.status = 1');
|
|
91
|
+
if (mode) {
|
|
92
|
+
queryBuilder.andWhere('config.integration_type = :mode', { mode });
|
|
93
|
+
}
|
|
94
|
+
return await queryBuilder.getMany();
|
|
95
|
+
}
|
|
96
|
+
async getSingleActiveConfig(levelId, levelType, app_code, integration_type) {
|
|
97
|
+
const configs = await this.configRepository
|
|
98
|
+
.createQueryBuilder('config')
|
|
99
|
+
.where('config.level_id = :levelId', { levelId })
|
|
100
|
+
.andWhere('config.level_type = :levelType', { levelType })
|
|
101
|
+
.andWhere('config.app_code = :app_code', { app_code })
|
|
102
|
+
.andWhere('config.integration_type = :integration_type', {
|
|
103
|
+
integration_type,
|
|
104
|
+
})
|
|
105
|
+
.andWhere('config.status = 1')
|
|
106
|
+
.orderBy('config.is_default', 'DESC')
|
|
107
|
+
.addOrderBy('config.priority', 'ASC')
|
|
108
|
+
.addOrderBy('config.created_at', 'DESC')
|
|
109
|
+
.getMany();
|
|
110
|
+
return configs.length > 0 ? configs[0] : null;
|
|
111
|
+
}
|
|
112
|
+
async getAllIntegrationData(loggedInUser, integration_type) {
|
|
113
|
+
try {
|
|
114
|
+
const integrationSourceRepo = this.reflectionHelper.getRepoService('IntegrationSource');
|
|
115
|
+
const allIntegrationData = await integrationSourceRepo.find();
|
|
116
|
+
if (integration_type) {
|
|
117
|
+
return allIntegrationData.filter((data) => data.integration_type.toLowerCase() ===
|
|
118
|
+
integration_type.toLowerCase());
|
|
119
|
+
}
|
|
120
|
+
return allIntegrationData;
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
this.logger.error('Error fetching integration data:', error.message);
|
|
124
|
+
return [];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
sortConfigsByPriority(configs, _priority) {
|
|
128
|
+
return configs.sort((a, b) => {
|
|
129
|
+
if (a.is_default !== b.is_default) {
|
|
130
|
+
return a.is_default ? -1 : 1;
|
|
131
|
+
}
|
|
132
|
+
return a.priority - b.priority;
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
async sendViaConfig(config, to, message, user_id) {
|
|
136
|
+
const strategy = this.integrationFactory.create(config.integration_type, 'API', config.integration_provider);
|
|
137
|
+
let finalConfig = config.config_json;
|
|
138
|
+
if (user_id) {
|
|
139
|
+
const userIntegrationData = await this.getUserIntegrationForStrategy(user_id, config.id);
|
|
140
|
+
if (userIntegrationData) {
|
|
141
|
+
finalConfig = {
|
|
142
|
+
...config.config_json,
|
|
143
|
+
external_user_id: userIntegrationData.external_user_id,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const result = await strategy.sendMessage(to, message, finalConfig);
|
|
148
|
+
if (result.refreshedToken && result.success) {
|
|
149
|
+
try {
|
|
150
|
+
const currentConfig = config.config_json;
|
|
151
|
+
const updatedConfig = {
|
|
152
|
+
...currentConfig,
|
|
153
|
+
accessToken: result.refreshedToken,
|
|
154
|
+
};
|
|
155
|
+
await this.configRepository.update(config.id, {
|
|
156
|
+
config_json: updatedConfig,
|
|
157
|
+
});
|
|
158
|
+
this.logger.log(`Updated access token for ${config.integration_provider} configuration`);
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
this.logger.warn(`Failed to update refreshed token in database: ${error.message}`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return result;
|
|
165
|
+
}
|
|
166
|
+
async createIntegrationConfig(levelId, levelType, app_code, configType, provider, integration_source_id, config, priority, is_default) {
|
|
167
|
+
await this.validateUniqueActiveConfig(levelId, levelType, app_code, configType, provider);
|
|
168
|
+
await this.configRepository.update({
|
|
169
|
+
level_id: levelId,
|
|
170
|
+
level_type: levelType,
|
|
171
|
+
app_code: app_code,
|
|
172
|
+
integration_type: configType,
|
|
173
|
+
status: 1,
|
|
174
|
+
}, { status: 0 });
|
|
175
|
+
const supportedCombinations = await this.getSupportedCombinations();
|
|
176
|
+
const validCombination = supportedCombinations.find((combo) => combo.mode === configType &&
|
|
177
|
+
combo.provider.toLowerCase() === provider.toLowerCase());
|
|
178
|
+
if (!validCombination) {
|
|
179
|
+
throw new Error(`Unsupported combination: ${configType}/${provider}`);
|
|
180
|
+
}
|
|
181
|
+
const service = validCombination.service;
|
|
182
|
+
const requiresOAuth = this.requiresOAuthFlow(configType, provider, config);
|
|
183
|
+
if (requiresOAuth) {
|
|
184
|
+
return await this.generateOAuthUrl(levelId, levelType, app_code, configType, provider, integration_source_id, config, priority, is_default);
|
|
185
|
+
}
|
|
186
|
+
return await this.createDirectConfig(levelId, levelType, app_code, configType, provider, integration_source_id, config, priority, is_default);
|
|
187
|
+
}
|
|
188
|
+
getSupportedCombinations() {
|
|
189
|
+
return this.integrationFactory.getAllSupportedCombinations();
|
|
190
|
+
}
|
|
191
|
+
async getLevelConfigs(levelId, levelType, filters) {
|
|
192
|
+
const where = { level_id: levelId, level_type: levelType };
|
|
193
|
+
if (filters?.app_code) {
|
|
194
|
+
where.app_code = filters.app_code;
|
|
195
|
+
}
|
|
196
|
+
if (filters?.integration_type) {
|
|
197
|
+
where.integration_type = filters.integration_type;
|
|
198
|
+
}
|
|
199
|
+
if (filters?.integration_provider) {
|
|
200
|
+
where.integration_provider = filters.integration_provider;
|
|
201
|
+
}
|
|
202
|
+
const hubs = await this.configRepository.find({
|
|
203
|
+
where,
|
|
204
|
+
order: { created_at: 'DESC' },
|
|
205
|
+
});
|
|
206
|
+
const enhancedHubs = await Promise.all(hubs.map(async (hub) => {
|
|
207
|
+
try {
|
|
208
|
+
const relatedConfig = await this.configRepository.findOne({
|
|
209
|
+
where: { id: hub.id },
|
|
210
|
+
});
|
|
211
|
+
if (!relatedConfig) {
|
|
212
|
+
return {
|
|
213
|
+
...hub,
|
|
214
|
+
linkedSource: 'Configuration not found',
|
|
215
|
+
configDetails: null,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
const linkedSource = this.extractLinkedSource(hub.integration_type, hub.integration_provider, relatedConfig.config_json);
|
|
219
|
+
const configDetails = this.extractConfigDetails(hub.integration_type, hub.integration_provider, relatedConfig.config_json);
|
|
220
|
+
return {
|
|
221
|
+
...hub,
|
|
222
|
+
linkedSource,
|
|
223
|
+
configDetails,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
this.logger.warn(`Error extracting linked source for hub ${hub.id}:`, error.message);
|
|
228
|
+
return {
|
|
229
|
+
...hub,
|
|
230
|
+
linkedSource: 'Error retrieving source',
|
|
231
|
+
configDetails: null,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
}));
|
|
235
|
+
return enhancedHubs;
|
|
236
|
+
}
|
|
237
|
+
extractLinkedSource(configType, provider, configJson) {
|
|
238
|
+
const key = `${configType.toLowerCase()}_${provider.toLowerCase()}`;
|
|
239
|
+
try {
|
|
240
|
+
switch (key) {
|
|
241
|
+
case 'email_gmail':
|
|
242
|
+
case 'email_smtp_gmail':
|
|
243
|
+
return configJson?.email || 'Gmail account not configured';
|
|
244
|
+
case 'email_outlook':
|
|
245
|
+
case 'email_smtp_outlook':
|
|
246
|
+
return configJson?.email || 'Outlook account not configured';
|
|
247
|
+
case 'wa_api_whatsapp':
|
|
248
|
+
return configJson?.phoneNumberId
|
|
249
|
+
? `WhatsApp Business: ${configJson.phoneNumberId}`
|
|
250
|
+
: 'WhatsApp not configured';
|
|
251
|
+
case 'sms_third_party_twilio':
|
|
252
|
+
return configJson?.fromNumber
|
|
253
|
+
? `Twilio: ${configJson.fromNumber}`
|
|
254
|
+
: 'Twilio number not configured';
|
|
255
|
+
case 'sms_third_party_knowlarity':
|
|
256
|
+
return configJson?.callerNumber
|
|
257
|
+
? `Knowlarity: ${configJson.callerNumber}`
|
|
258
|
+
: 'Knowlarity number not configured';
|
|
259
|
+
case 'telephone_third_party_knowlarity':
|
|
260
|
+
return configJson?.callerNumber
|
|
261
|
+
? `Knowlarity Voice: ${configJson.callerNumber}`
|
|
262
|
+
: 'Knowlarity voice number not configured';
|
|
263
|
+
case 'telephone_third_party_ozonetel':
|
|
264
|
+
return configJson?.userName
|
|
265
|
+
? `Ozonetel Voice: ${configJson.userName}`
|
|
266
|
+
: 'Ozonetel voice not configured';
|
|
267
|
+
case 'email_aws-ses':
|
|
268
|
+
case 'email_ses':
|
|
269
|
+
return configJson?.fromEmail || 'AWS SES not configured';
|
|
270
|
+
case 'email_smtp_sendgrid':
|
|
271
|
+
return configJson?.from || 'SendGrid not configured';
|
|
272
|
+
case 'email_smtp_custom':
|
|
273
|
+
case 'email_smtp_generic':
|
|
274
|
+
return configJson?.from || configJson?.user || 'SMTP not configured';
|
|
275
|
+
default:
|
|
276
|
+
if (configJson?.email)
|
|
277
|
+
return configJson.email;
|
|
278
|
+
if (configJson?.from)
|
|
279
|
+
return configJson.from;
|
|
280
|
+
if (configJson?.user)
|
|
281
|
+
return configJson.user;
|
|
282
|
+
if (configJson?.phoneNumberId)
|
|
283
|
+
return configJson.phoneNumberId;
|
|
284
|
+
if (configJson?.fromNumber)
|
|
285
|
+
return configJson.fromNumber;
|
|
286
|
+
if (configJson?.callerNumber)
|
|
287
|
+
return configJson.callerNumber;
|
|
288
|
+
return `${provider} configured`;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
catch (error) {
|
|
292
|
+
return 'Configuration error';
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
extractConfigDetails(configType, provider, configJson) {
|
|
296
|
+
const key = `${configType.toLowerCase()}_${provider.toLowerCase()}`;
|
|
297
|
+
try {
|
|
298
|
+
switch (key) {
|
|
299
|
+
case 'email_gmail':
|
|
300
|
+
return {
|
|
301
|
+
email: configJson?.email,
|
|
302
|
+
authMethod: configJson?.authMethod || 'OAUTH2',
|
|
303
|
+
hasRefreshToken: !!configJson?.refreshToken,
|
|
304
|
+
isExpired: configJson?.expiryDate
|
|
305
|
+
? new Date(configJson.expiryDate) < new Date()
|
|
306
|
+
: false,
|
|
307
|
+
};
|
|
308
|
+
case 'email_smtp_gmail':
|
|
309
|
+
return {
|
|
310
|
+
email: configJson?.email,
|
|
311
|
+
authMethod: 'SMTP',
|
|
312
|
+
hasPassword: !!configJson?.password,
|
|
313
|
+
};
|
|
314
|
+
case 'email_outlook':
|
|
315
|
+
return {
|
|
316
|
+
email: configJson?.email,
|
|
317
|
+
authMethod: 'OAUTH2',
|
|
318
|
+
hasRefreshToken: !!configJson?.refreshToken,
|
|
319
|
+
tenantId: configJson?.tenantId,
|
|
320
|
+
};
|
|
321
|
+
case 'email_smtp_outlook':
|
|
322
|
+
return {
|
|
323
|
+
email: configJson?.email,
|
|
324
|
+
authMethod: 'SMTP',
|
|
325
|
+
hasPassword: !!configJson?.password,
|
|
326
|
+
};
|
|
327
|
+
case 'wa_api_whatsapp':
|
|
328
|
+
return {
|
|
329
|
+
phoneNumberId: configJson?.phoneNumberId,
|
|
330
|
+
apiVersion: configJson?.apiVersion || 'v17.0',
|
|
331
|
+
hasAccessToken: !!configJson?.accessToken,
|
|
332
|
+
};
|
|
333
|
+
case 'sms_third_party_twilio':
|
|
334
|
+
return {
|
|
335
|
+
fromNumber: configJson?.fromNumber,
|
|
336
|
+
accountSid: configJson?.accountSid
|
|
337
|
+
? configJson.accountSid.substring(0, 8) + '...'
|
|
338
|
+
: null,
|
|
339
|
+
hasAuthToken: !!configJson?.authToken,
|
|
340
|
+
};
|
|
341
|
+
case 'sms_third_party_knowlarity':
|
|
342
|
+
return {
|
|
343
|
+
callerNumber: configJson?.callerNumber,
|
|
344
|
+
callType: configJson?.callType || 'sms',
|
|
345
|
+
hasApiSecret: !!configJson?.apiSecret,
|
|
346
|
+
};
|
|
347
|
+
case 'telephone_third_party_knowlarity':
|
|
348
|
+
return {
|
|
349
|
+
callerNumber: configJson?.callerNumber,
|
|
350
|
+
callType: configJson?.callType || 'voice',
|
|
351
|
+
language: configJson?.language || 'en',
|
|
352
|
+
hasApiSecret: !!configJson?.apiSecret,
|
|
353
|
+
};
|
|
354
|
+
case 'telephone_third_party_ozonetel':
|
|
355
|
+
return {
|
|
356
|
+
userName: configJson?.userName,
|
|
357
|
+
agentID: configJson?.agentID,
|
|
358
|
+
campaignName: configJson?.campaignName,
|
|
359
|
+
agentLoginUrl: configJson?.agentLoginUrl,
|
|
360
|
+
hasApiKey: !!configJson?.apiKey,
|
|
361
|
+
};
|
|
362
|
+
case 'email_aws-ses':
|
|
363
|
+
case 'email_ses':
|
|
364
|
+
return {
|
|
365
|
+
fromEmail: configJson?.fromEmail,
|
|
366
|
+
region: configJson?.region,
|
|
367
|
+
hasCredentials: !!(configJson?.accessKeyId && configJson?.secretAccessKey),
|
|
368
|
+
};
|
|
369
|
+
case 'email_smtp_sendgrid':
|
|
370
|
+
return {
|
|
371
|
+
from: configJson?.from,
|
|
372
|
+
hasApiKey: !!configJson?.apiKey,
|
|
373
|
+
templateId: configJson?.templateId,
|
|
374
|
+
};
|
|
375
|
+
case 'email_smtp_custom':
|
|
376
|
+
case 'email_smtp_generic':
|
|
377
|
+
return {
|
|
378
|
+
host: configJson?.host,
|
|
379
|
+
port: configJson?.port || 587,
|
|
380
|
+
secure: configJson?.secure || false,
|
|
381
|
+
from: configJson?.from || configJson?.user,
|
|
382
|
+
hasCredentials: !!(configJson?.user && configJson?.password),
|
|
383
|
+
};
|
|
384
|
+
default: {
|
|
385
|
+
const safeConfig = {};
|
|
386
|
+
const safeFields = [
|
|
387
|
+
'email',
|
|
388
|
+
'from',
|
|
389
|
+
'user',
|
|
390
|
+
'host',
|
|
391
|
+
'port',
|
|
392
|
+
'secure',
|
|
393
|
+
'phoneNumberId',
|
|
394
|
+
'fromNumber',
|
|
395
|
+
'callerNumber',
|
|
396
|
+
'region',
|
|
397
|
+
'apiVersion',
|
|
398
|
+
'callType',
|
|
399
|
+
'language',
|
|
400
|
+
'templateId',
|
|
401
|
+
];
|
|
402
|
+
safeFields.forEach((field) => {
|
|
403
|
+
if (configJson?.[field]) {
|
|
404
|
+
safeConfig[field] = configJson[field];
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
const sensitiveFields = [
|
|
408
|
+
'accessToken',
|
|
409
|
+
'refreshToken',
|
|
410
|
+
'password',
|
|
411
|
+
'authToken',
|
|
412
|
+
'apiKey',
|
|
413
|
+
'apiSecret',
|
|
414
|
+
'clientSecret',
|
|
415
|
+
'secretAccessKey',
|
|
416
|
+
];
|
|
417
|
+
sensitiveFields.forEach((field) => {
|
|
418
|
+
if (configJson?.[field]) {
|
|
419
|
+
safeConfig[`has${field.charAt(0).toUpperCase() + field.slice(1)}`] = true;
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
return safeConfig;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
catch (error) {
|
|
427
|
+
return { error: 'Unable to extract configuration details' };
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
async updateConfigStatus(hubId, status) {
|
|
431
|
+
const config = await this.configRepository.findOne({
|
|
432
|
+
where: { id: hubId },
|
|
433
|
+
});
|
|
434
|
+
if (!config) {
|
|
435
|
+
throw new Error('Integration configuration not found');
|
|
436
|
+
}
|
|
437
|
+
if (status === 1) {
|
|
438
|
+
await this.configRepository.update({
|
|
439
|
+
level_id: config.level_id,
|
|
440
|
+
level_type: config.level_type,
|
|
441
|
+
app_code: config.app_code,
|
|
442
|
+
integration_type: config.integration_type,
|
|
443
|
+
status: 1,
|
|
444
|
+
id: (0, typeorm_2.Not)(hubId),
|
|
445
|
+
}, { status: 0 });
|
|
446
|
+
}
|
|
447
|
+
await this.configRepository.update(hubId, { status });
|
|
448
|
+
}
|
|
449
|
+
async deleteConfiguration(configId) {
|
|
450
|
+
const config = await this.configRepository.findOne({
|
|
451
|
+
where: { id: configId },
|
|
452
|
+
});
|
|
453
|
+
if (!config) {
|
|
454
|
+
throw new Error('Integration configuration not found');
|
|
455
|
+
}
|
|
456
|
+
await this.configRepository.delete(configId);
|
|
457
|
+
this.logger.log(`Integration configuration deleted: ${configId}`);
|
|
458
|
+
}
|
|
459
|
+
async updateConfiguration(hubId, updateData) {
|
|
460
|
+
const config = await this.configRepository.findOne({
|
|
461
|
+
where: { id: hubId },
|
|
462
|
+
});
|
|
463
|
+
if (!config) {
|
|
464
|
+
throw new Error('Integration configuration not found');
|
|
465
|
+
}
|
|
466
|
+
if (updateData.config) {
|
|
467
|
+
const updatedConfigJson = {
|
|
468
|
+
...config.config_json,
|
|
469
|
+
...updateData.config,
|
|
470
|
+
};
|
|
471
|
+
await this.configRepository.update(config.id, {
|
|
472
|
+
config_json: updatedConfigJson,
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
if (updateData.is_default === true) {
|
|
476
|
+
await this.configRepository.update({
|
|
477
|
+
level_id: config.level_id,
|
|
478
|
+
level_type: config.level_type,
|
|
479
|
+
integration_type: config.integration_type,
|
|
480
|
+
id: (0, typeorm_2.Not)(hubId),
|
|
481
|
+
}, { is_default: false });
|
|
482
|
+
}
|
|
483
|
+
if (config.integration_type === 'TELEPHONE') {
|
|
484
|
+
try {
|
|
485
|
+
const did = config.config_json.did;
|
|
486
|
+
if (did) {
|
|
487
|
+
await this.entityMapperRepository.delete({
|
|
488
|
+
integration_config_id: config.id,
|
|
489
|
+
});
|
|
490
|
+
const entityMapper = this.entityMapperRepository.create({
|
|
491
|
+
integration_config_id: config.id,
|
|
492
|
+
level_id: String(config.level_id),
|
|
493
|
+
level_type: config.level_type,
|
|
494
|
+
appcode: config.app_code,
|
|
495
|
+
did: did,
|
|
496
|
+
campaign_name: config.config_json.campaignName || null,
|
|
497
|
+
});
|
|
498
|
+
await this.entityMapperRepository.save(entityMapper);
|
|
499
|
+
this.logger.log(`DID mapping created for TELEPHONE integration: ${did} for ${config.level_id} ${config.level_type}`);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
catch (error) {
|
|
503
|
+
this.logger.warn(`Failed to create DID mapping for TELEPHONE integration: ${error.message}`);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
const directUpdates = {};
|
|
507
|
+
if (updateData.priority !== undefined)
|
|
508
|
+
directUpdates.priority = updateData.priority;
|
|
509
|
+
if (updateData.is_default !== undefined)
|
|
510
|
+
directUpdates.is_default = updateData.is_default;
|
|
511
|
+
if (updateData.status !== undefined)
|
|
512
|
+
directUpdates.status = updateData.status;
|
|
513
|
+
if (Object.keys(directUpdates).length > 0) {
|
|
514
|
+
await this.configRepository.update(config.id, directUpdates);
|
|
515
|
+
}
|
|
516
|
+
const updatedConfig = await this.configRepository.findOne({
|
|
517
|
+
where: { id: hubId },
|
|
518
|
+
});
|
|
519
|
+
return {
|
|
520
|
+
...updatedConfig,
|
|
521
|
+
config: updatedConfig?.config_json,
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
async sendGenericMessage(messageDto) {
|
|
525
|
+
try {
|
|
526
|
+
const { levelId, levelType, app_code, to, message, type, priority = 'medium', html, cc, bcc, attachments, mediaUrl, templateId, user_id, entity_id, entity_type, organization_id, mapped_entities, } = messageDto;
|
|
527
|
+
let subject = messageDto.subject;
|
|
528
|
+
const communicationType = this.detectCommunicationType(to, type);
|
|
529
|
+
const configs = await this.getActiveConfigs(levelId, levelType, app_code, communicationType);
|
|
530
|
+
if (!configs.length) {
|
|
531
|
+
this.logger.warn(`No communication hubs found for ${levelType} ${levelId}. Please configure integration providers using the createIntegrationConfig method.`);
|
|
532
|
+
throw new Error(`No active ${communicationType} configuration found for ${levelType} ${levelId}. Please configure a communication provider first.`);
|
|
533
|
+
}
|
|
534
|
+
const sortedConfigs = this.sortConfigsByPriorityAndDefault(configs, priority);
|
|
535
|
+
const enhancedConfig = {
|
|
536
|
+
subject,
|
|
537
|
+
html,
|
|
538
|
+
cc,
|
|
539
|
+
bcc,
|
|
540
|
+
attachments,
|
|
541
|
+
mediaUrl,
|
|
542
|
+
};
|
|
543
|
+
const loggedInUser = {
|
|
544
|
+
id: user_id || null,
|
|
545
|
+
organization_id: organization_id || -1,
|
|
546
|
+
level_id: levelId,
|
|
547
|
+
level_type: levelType,
|
|
548
|
+
app_code: app_code,
|
|
549
|
+
};
|
|
550
|
+
if (Array.isArray(to)) {
|
|
551
|
+
const results = [];
|
|
552
|
+
let hasSuccess = false;
|
|
553
|
+
for (const recipient of to) {
|
|
554
|
+
for (const hub of sortedConfigs) {
|
|
555
|
+
try {
|
|
556
|
+
const serviceType = this.deriveServiceType(hub.integration_type, hub.integration_provider, hub.config_json);
|
|
557
|
+
const strategy = this.integrationFactory.create(hub.integration_type, serviceType, hub.integration_provider);
|
|
558
|
+
let variables;
|
|
559
|
+
let richText;
|
|
560
|
+
let externalTemplateId = undefined;
|
|
561
|
+
const profile = this.configService.get('PROFILE');
|
|
562
|
+
const subjectPrefix = this.configService.get('SUBJECT_PREFIX');
|
|
563
|
+
if (templateId) {
|
|
564
|
+
const templateData = await this.processTemplate(parseInt(templateId, 10), entity_type, entity_id, loggedInUser, mapped_entities);
|
|
565
|
+
variables = templateData.variables;
|
|
566
|
+
externalTemplateId = templateData.externalTemplateId;
|
|
567
|
+
richText = templateData.rich_text;
|
|
568
|
+
subject = templateData.subject;
|
|
569
|
+
}
|
|
570
|
+
if (subjectPrefix) {
|
|
571
|
+
const updatedSubject = profile?.charAt(0).toUpperCase() +
|
|
572
|
+
profile?.slice(1) +
|
|
573
|
+
' : ' +
|
|
574
|
+
subject;
|
|
575
|
+
subject = updatedSubject;
|
|
576
|
+
}
|
|
577
|
+
let finalConfig = {
|
|
578
|
+
...hub.config_json,
|
|
579
|
+
...enhancedConfig,
|
|
580
|
+
templateId: externalTemplateId,
|
|
581
|
+
variables,
|
|
582
|
+
richText,
|
|
583
|
+
subject,
|
|
584
|
+
};
|
|
585
|
+
if (user_id) {
|
|
586
|
+
const userIntegrationData = await this.getUserIntegrationForStrategy(user_id, hub.id);
|
|
587
|
+
if (userIntegrationData) {
|
|
588
|
+
finalConfig = {
|
|
589
|
+
...finalConfig,
|
|
590
|
+
external_user_id: userIntegrationData.external_user_id,
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
const result = await strategy.sendMessage(recipient, message, finalConfig);
|
|
595
|
+
if (result.success) {
|
|
596
|
+
this.logger.log(`Generic message sent successfully via ${hub.integration_provider} to ${recipient}`);
|
|
597
|
+
results.push(result);
|
|
598
|
+
hasSuccess = true;
|
|
599
|
+
break;
|
|
600
|
+
}
|
|
601
|
+
this.logger.warn(`Failed to send via ${hub.integration_provider} to ${recipient}: ${result.error}`);
|
|
602
|
+
}
|
|
603
|
+
catch (error) {
|
|
604
|
+
this.logger.error(`Error sending via ${hub.integration_provider} to ${recipient}:`, error.message);
|
|
605
|
+
continue;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
if (hasSuccess) {
|
|
610
|
+
return {
|
|
611
|
+
success: true,
|
|
612
|
+
messageId: results.map((r) => r.messageId).join(','),
|
|
613
|
+
provider: 'multiple',
|
|
614
|
+
service: 'multiple',
|
|
615
|
+
timestamp: new Date(),
|
|
616
|
+
message: results.map((r) => r.message).join(','),
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
else {
|
|
621
|
+
for (const hub of sortedConfigs) {
|
|
622
|
+
try {
|
|
623
|
+
const serviceType = this.deriveServiceType(hub.integration_type, hub.integration_provider, hub.config_json);
|
|
624
|
+
const strategy = this.integrationFactory.create(hub.integration_type, serviceType, hub.integration_provider);
|
|
625
|
+
let variables;
|
|
626
|
+
let externalTemplateId = undefined;
|
|
627
|
+
let richText;
|
|
628
|
+
if (templateId) {
|
|
629
|
+
const templateData = await this.processTemplate(parseInt(templateId, 10), entity_type, entity_id, loggedInUser, mapped_entities);
|
|
630
|
+
variables = templateData.variables;
|
|
631
|
+
externalTemplateId = templateData.externalTemplateId;
|
|
632
|
+
richText = templateData.rich_text;
|
|
633
|
+
subject = templateData.subject;
|
|
634
|
+
}
|
|
635
|
+
let finalConfig = {
|
|
636
|
+
...hub.config_json,
|
|
637
|
+
...enhancedConfig,
|
|
638
|
+
templateId: externalTemplateId,
|
|
639
|
+
variables,
|
|
640
|
+
richText,
|
|
641
|
+
};
|
|
642
|
+
if (user_id) {
|
|
643
|
+
const userIntegrationData = await this.getUserIntegrationForStrategy(user_id, hub.id);
|
|
644
|
+
if (userIntegrationData) {
|
|
645
|
+
finalConfig = {
|
|
646
|
+
...finalConfig,
|
|
647
|
+
external_user_id: userIntegrationData.external_user_id,
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
const result = await strategy.sendMessage(to, message, finalConfig);
|
|
652
|
+
if (result.success) {
|
|
653
|
+
this.logger.log(`Generic message sent successfully via ${hub.integration_provider} to ${to}`);
|
|
654
|
+
return result;
|
|
655
|
+
}
|
|
656
|
+
this.logger.warn(`Failed to send via ${hub.integration_provider}: ${result.error}`);
|
|
657
|
+
}
|
|
658
|
+
catch (error) {
|
|
659
|
+
this.logger.error(`Error sending via ${hub.integration_provider}:`, error.message);
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
throw new Error('All communication providers failed');
|
|
665
|
+
}
|
|
666
|
+
catch (error) {
|
|
667
|
+
this.logger.error('Generic communication service error:', error.message);
|
|
668
|
+
throw error;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
async sendBulkMessage(bulkDto) {
|
|
672
|
+
try {
|
|
673
|
+
const { levelId, levelType, app_code, recipients, message, type, priority = 'low', subject, html, templateId, variables, batchSize = 10, } = bulkDto;
|
|
674
|
+
const results = [];
|
|
675
|
+
const batches = this.chunkArray(recipients, batchSize);
|
|
676
|
+
for (let i = 0; i < batches.length; i++) {
|
|
677
|
+
const batch = batches[i];
|
|
678
|
+
this.logger.log(`Processing batch ${i + 1}/${batches.length} with ${batch.length} recipients`);
|
|
679
|
+
const batchPromises = batch.map(async (recipient) => {
|
|
680
|
+
try {
|
|
681
|
+
const messageDto = {
|
|
682
|
+
levelId,
|
|
683
|
+
levelType,
|
|
684
|
+
app_code,
|
|
685
|
+
to: recipient,
|
|
686
|
+
message,
|
|
687
|
+
type,
|
|
688
|
+
priority,
|
|
689
|
+
subject,
|
|
690
|
+
html,
|
|
691
|
+
templateId,
|
|
692
|
+
variables,
|
|
693
|
+
};
|
|
694
|
+
return await this.sendGenericMessage(messageDto);
|
|
695
|
+
}
|
|
696
|
+
catch (error) {
|
|
697
|
+
return {
|
|
698
|
+
success: false,
|
|
699
|
+
provider: 'unknown',
|
|
700
|
+
service: 'unknown',
|
|
701
|
+
error: error.message,
|
|
702
|
+
timestamp: new Date(),
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
const batchResults = await Promise.allSettled(batchPromises);
|
|
707
|
+
const processedResults = batchResults.map((result) => {
|
|
708
|
+
if (result.status === 'fulfilled') {
|
|
709
|
+
return result.value;
|
|
710
|
+
}
|
|
711
|
+
else {
|
|
712
|
+
return {
|
|
713
|
+
success: false,
|
|
714
|
+
provider: 'unknown',
|
|
715
|
+
service: 'unknown',
|
|
716
|
+
error: result.reason?.message || 'Unknown error',
|
|
717
|
+
timestamp: new Date(),
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
results.push(...processedResults);
|
|
722
|
+
if (i < batches.length - 1) {
|
|
723
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
const summary = {
|
|
727
|
+
total: results.length,
|
|
728
|
+
successful: results.filter((r) => r.success).length,
|
|
729
|
+
failed: results.filter((r) => !r.success).length,
|
|
730
|
+
successRate: ((results.filter((r) => r.success).length / results.length) *
|
|
731
|
+
100).toFixed(2) + '%',
|
|
732
|
+
};
|
|
733
|
+
this.logger.log(`Bulk message completed: ${summary.successful}/${summary.total} successful`);
|
|
734
|
+
return { results, summary };
|
|
735
|
+
}
|
|
736
|
+
catch (error) {
|
|
737
|
+
this.logger.error('Bulk communication service error:', error.message);
|
|
738
|
+
throw error;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
async scheduleMessage(scheduledDto) {
|
|
742
|
+
this.logger.log(`Message scheduled for ${scheduledDto.scheduleFor}`);
|
|
743
|
+
return {
|
|
744
|
+
scheduled: true,
|
|
745
|
+
scheduleId: `sched_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`,
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
async sendTemplateMessage(templateDto) {
|
|
749
|
+
const template = await this.getTemplate(templateDto.templateId);
|
|
750
|
+
const processedMessage = this.replaceTemplateVariables(template.content, templateDto.variables);
|
|
751
|
+
const processedSubject = template.subject
|
|
752
|
+
? this.replaceTemplateVariables(template.subject, templateDto.variables)
|
|
753
|
+
: undefined;
|
|
754
|
+
const messageDto = {
|
|
755
|
+
levelId: templateDto.levelId,
|
|
756
|
+
levelType: templateDto.levelType,
|
|
757
|
+
app_code: templateDto.app_code,
|
|
758
|
+
to: templateDto.to,
|
|
759
|
+
message: processedMessage,
|
|
760
|
+
subject: processedSubject,
|
|
761
|
+
type: templateDto.type,
|
|
762
|
+
templateId: templateDto.templateId,
|
|
763
|
+
variables: templateDto.variables,
|
|
764
|
+
};
|
|
765
|
+
return this.sendGenericMessage(messageDto);
|
|
766
|
+
}
|
|
767
|
+
detectCommunicationType(to, type) {
|
|
768
|
+
if (type) {
|
|
769
|
+
return type;
|
|
770
|
+
}
|
|
771
|
+
const recipient = Array.isArray(to) ? to[0] : to;
|
|
772
|
+
if (recipient.includes('@')) {
|
|
773
|
+
return 'EMAIL';
|
|
774
|
+
}
|
|
775
|
+
if (/^\+?[\d\s\-\(\)]+$/.test(recipient)) {
|
|
776
|
+
return 'SMS';
|
|
777
|
+
}
|
|
778
|
+
return 'EMAIL';
|
|
779
|
+
}
|
|
780
|
+
sortConfigsByPriorityAndDefault(configs, _priority) {
|
|
781
|
+
return configs.sort((a, b) => {
|
|
782
|
+
if (a.is_default !== b.is_default) {
|
|
783
|
+
return b.is_default ? 1 : -1;
|
|
784
|
+
}
|
|
785
|
+
if (a.priority !== b.priority) {
|
|
786
|
+
return a.priority - b.priority;
|
|
787
|
+
}
|
|
788
|
+
return (new Date(b.created_at).getTime() - new Date(a.created_at).getTime());
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
async processTemplate(templateId, entity_type, entity_id, loggedInUser, mappedEntities) {
|
|
792
|
+
const commTemplate = await this.entityService.getEntityData(global_constant_1.COMM_TEMPLATE, templateId, {});
|
|
793
|
+
if (!commTemplate) {
|
|
794
|
+
return {
|
|
795
|
+
variables: {},
|
|
796
|
+
externalTemplateId: undefined,
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
let variables = {};
|
|
800
|
+
if (commTemplate.mapper_id) {
|
|
801
|
+
variables = await this.fieldMapperService.resolveData(commTemplate.mapper_id, 'LOOKUP', entity_type, entity_id, loggedInUser, {}, mappedEntities);
|
|
802
|
+
}
|
|
803
|
+
if (!commTemplate.template_id) {
|
|
804
|
+
let richText = commTemplate.rich_text;
|
|
805
|
+
if (!richText) {
|
|
806
|
+
if (commTemplate.markup_id) {
|
|
807
|
+
let url = await this.mediaService.getMediaDownloadUrl(commTemplate.markup_id, {}, 60000);
|
|
808
|
+
if (url) {
|
|
809
|
+
let response = await axios_1.default.get(url.signedUrl, {
|
|
810
|
+
responseType: 'text',
|
|
811
|
+
});
|
|
812
|
+
richText = response.data;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
richText = richText.replace(/\{\{(\w+)\}\}/g, (match, key) => {
|
|
817
|
+
const value = variables[key];
|
|
818
|
+
if (value === undefined)
|
|
819
|
+
return match;
|
|
820
|
+
if (typeof value === 'object' &&
|
|
821
|
+
value !== null &&
|
|
822
|
+
'signedUrl' in value) {
|
|
823
|
+
return String(value.signedUrl);
|
|
824
|
+
}
|
|
825
|
+
return String(value);
|
|
826
|
+
});
|
|
827
|
+
return {
|
|
828
|
+
rich_text: richText,
|
|
829
|
+
subject: commTemplate.subject,
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
return {
|
|
833
|
+
variables,
|
|
834
|
+
externalTemplateId: commTemplate.template_id,
|
|
835
|
+
};
|
|
836
|
+
}
|
|
837
|
+
replaceTemplateVariables(template, variables) {
|
|
838
|
+
return template.replace(/\{\{(\w+)\}\}/g, (match, key) => {
|
|
839
|
+
const value = variables[key];
|
|
840
|
+
return value !== undefined ? String(value) : match;
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
async getTemplate(templateId) {
|
|
844
|
+
return {
|
|
845
|
+
id: templateId,
|
|
846
|
+
subject: 'Default Subject {{variable}}',
|
|
847
|
+
content: 'Hello {{name}}, this is a template message with {{variable}}.',
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
chunkArray(array, chunkSize) {
|
|
851
|
+
const chunks = [];
|
|
852
|
+
for (let i = 0; i < array.length; i += chunkSize) {
|
|
853
|
+
chunks.push(array.slice(i, i + chunkSize));
|
|
854
|
+
}
|
|
855
|
+
return chunks;
|
|
856
|
+
}
|
|
857
|
+
async initGmailOAuth(levelId, levelType, app_code, email) {
|
|
858
|
+
try {
|
|
859
|
+
const clientId = this.configService.get('CLIENT_ID');
|
|
860
|
+
const clientSecret = this.configService.get('CLIENT_SECRET');
|
|
861
|
+
if (!clientId || !clientSecret) {
|
|
862
|
+
throw new Error('Gmail OAuth credentials not configured');
|
|
863
|
+
}
|
|
864
|
+
const state = this.generateSecureState();
|
|
865
|
+
const callbackUrl = this.configService.get('CALLBACK_URL') ||
|
|
866
|
+
'http://localhost:5001/auth/google/callback';
|
|
867
|
+
this.gmailOAuthStates.set(state, {
|
|
868
|
+
levelId,
|
|
869
|
+
levelType,
|
|
870
|
+
app_code,
|
|
871
|
+
email,
|
|
872
|
+
timestamp: Date.now(),
|
|
873
|
+
});
|
|
874
|
+
setTimeout(() => {
|
|
875
|
+
this.gmailOAuthStates.delete(state);
|
|
876
|
+
}, 10 * 60 * 1000);
|
|
877
|
+
const oauth2Client = new googleapis_1.google.auth.OAuth2(clientId, clientSecret, callbackUrl);
|
|
878
|
+
const scopes = [
|
|
879
|
+
'https://www.googleapis.com/auth/gmail.send',
|
|
880
|
+
'https://www.googleapis.com/auth/gmail.readonly',
|
|
881
|
+
'https://www.googleapis.com/auth/userinfo.email',
|
|
882
|
+
'https://www.googleapis.com/auth/calendar',
|
|
883
|
+
];
|
|
884
|
+
const authUrl = oauth2Client.generateAuthUrl({
|
|
885
|
+
access_type: 'offline',
|
|
886
|
+
scope: scopes,
|
|
887
|
+
state: `gmail_config:${state}`,
|
|
888
|
+
prompt: 'consent',
|
|
889
|
+
login_hint: email,
|
|
890
|
+
});
|
|
891
|
+
return { authUrl, state };
|
|
892
|
+
}
|
|
893
|
+
catch (error) {
|
|
894
|
+
this.logger.error('Error initializing Gmail OAuth:', error.message);
|
|
895
|
+
throw new Error('Failed to initialize Gmail OAuth');
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
async handleGmailOAuthCallback(code, state) {
|
|
899
|
+
try {
|
|
900
|
+
const oauthState = this.gmailOAuthStates.get(state);
|
|
901
|
+
if (!oauthState) {
|
|
902
|
+
throw new Error('Invalid or expired OAuth state');
|
|
903
|
+
}
|
|
904
|
+
this.gmailOAuthStates.delete(state);
|
|
905
|
+
if (Date.now() - oauthState.timestamp > 10 * 60 * 1000) {
|
|
906
|
+
throw new Error('OAuth state expired');
|
|
907
|
+
}
|
|
908
|
+
const clientId = this.configService.get('CLIENT_ID');
|
|
909
|
+
const clientSecret = this.configService.get('CLIENT_SECRET');
|
|
910
|
+
const callbackUrl = this.configService.get('CALLBACK_URL') ||
|
|
911
|
+
'http://localhost:5001/auth/google/callback';
|
|
912
|
+
const oauth2Client = new googleapis_1.google.auth.OAuth2(clientId, clientSecret, callbackUrl);
|
|
913
|
+
const { tokens } = await oauth2Client.getToken(code);
|
|
914
|
+
if (!tokens.access_token) {
|
|
915
|
+
throw new Error('Failed to obtain access token');
|
|
916
|
+
}
|
|
917
|
+
oauth2Client.setCredentials(tokens);
|
|
918
|
+
const oauth2 = googleapis_1.google.oauth2({ version: 'v2', auth: oauth2Client });
|
|
919
|
+
const userInfo = await oauth2.userinfo.get();
|
|
920
|
+
const email = userInfo.data.email;
|
|
921
|
+
if (!email) {
|
|
922
|
+
throw new Error('Failed to get user email');
|
|
923
|
+
}
|
|
924
|
+
if (oauthState.email && oauthState.email !== email) {
|
|
925
|
+
throw new Error('Email mismatch with OAuth hint');
|
|
926
|
+
}
|
|
927
|
+
const gmailConfig = {
|
|
928
|
+
clientId,
|
|
929
|
+
clientSecret,
|
|
930
|
+
email: email,
|
|
931
|
+
accessToken: tokens.access_token,
|
|
932
|
+
refreshToken: tokens.refresh_token,
|
|
933
|
+
scope: tokens.scope,
|
|
934
|
+
tokenType: tokens.token_type,
|
|
935
|
+
expiryDate: tokens.expiry_date,
|
|
936
|
+
};
|
|
937
|
+
await this.validateUniqueActiveConfig(oauthState.levelId, oauthState.levelType, oauthState.app_code, 'EMAIL', 'gmail');
|
|
938
|
+
const config = this.configRepository.create({
|
|
939
|
+
app_code: oauthState.app_code,
|
|
940
|
+
integration_type: 'EMAIL',
|
|
941
|
+
integration_provider: 'gmail',
|
|
942
|
+
integration_source_id: 1,
|
|
943
|
+
level_id: oauthState.levelId,
|
|
944
|
+
level_type: oauthState.levelType,
|
|
945
|
+
status: 1,
|
|
946
|
+
priority: 1,
|
|
947
|
+
is_default: false,
|
|
948
|
+
config_json: gmailConfig,
|
|
949
|
+
});
|
|
950
|
+
const savedConfig = await this.configRepository.save(config);
|
|
951
|
+
this.logger.log(`Gmail OAuth configuration created successfully for ${oauthState.levelType} ${oauthState.levelId} and email ${email}`);
|
|
952
|
+
return {
|
|
953
|
+
hubId: savedConfig.id,
|
|
954
|
+
configId: savedConfig.id,
|
|
955
|
+
};
|
|
956
|
+
}
|
|
957
|
+
catch (error) {
|
|
958
|
+
this.logger.error('Error handling Gmail OAuth callback:', error.message);
|
|
959
|
+
throw new Error(`Failed to complete Gmail OAuth: ${error.message}`);
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
async handleGmailTokensCallback(email, accessToken, refreshToken, state) {
|
|
963
|
+
try {
|
|
964
|
+
const oauthState = this.gmailOAuthStates.get(state);
|
|
965
|
+
if (!oauthState) {
|
|
966
|
+
throw new Error('Invalid or expired OAuth state');
|
|
967
|
+
}
|
|
968
|
+
this.gmailOAuthStates.delete(state);
|
|
969
|
+
if (Date.now() - oauthState.timestamp > 10 * 60 * 1000) {
|
|
970
|
+
throw new Error('OAuth state expired');
|
|
971
|
+
}
|
|
972
|
+
if (oauthState.email && oauthState.email !== email) {
|
|
973
|
+
throw new Error('Email mismatch with OAuth hint');
|
|
974
|
+
}
|
|
975
|
+
await this.validateUniqueActiveConfig(oauthState.levelId, oauthState.levelType, oauthState.app_code, 'EMAIL', 'gmail');
|
|
976
|
+
const gmailConfig = {
|
|
977
|
+
email: email,
|
|
978
|
+
accessToken: accessToken,
|
|
979
|
+
refreshToken: refreshToken,
|
|
980
|
+
authMethod: 'GOOGLE_SSO',
|
|
981
|
+
scopes: [
|
|
982
|
+
'https://www.googleapis.com/auth/gmail.send',
|
|
983
|
+
'https://www.googleapis.com/auth/userinfo.email',
|
|
984
|
+
],
|
|
985
|
+
};
|
|
986
|
+
const config = this.configRepository.create({
|
|
987
|
+
app_code: oauthState.app_code,
|
|
988
|
+
integration_type: 'EMAIL',
|
|
989
|
+
integration_provider: 'gmail',
|
|
990
|
+
integration_source_id: 1,
|
|
991
|
+
level_id: oauthState.levelId,
|
|
992
|
+
level_type: oauthState.levelType,
|
|
993
|
+
status: 1,
|
|
994
|
+
priority: 1,
|
|
995
|
+
is_default: false,
|
|
996
|
+
config_json: gmailConfig,
|
|
997
|
+
});
|
|
998
|
+
const savedConfig = await this.configRepository.save(config);
|
|
999
|
+
this.logger.log(`Gmail tokens configuration created successfully for ${oauthState.levelType} ${oauthState.levelId} and email ${email}`);
|
|
1000
|
+
return {
|
|
1001
|
+
hubId: savedConfig.id,
|
|
1002
|
+
configId: savedConfig.id,
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
catch (error) {
|
|
1006
|
+
this.logger.error('Error handling Gmail tokens callback:', error.message);
|
|
1007
|
+
throw new Error(`Failed to complete Gmail tokens callback: ${error.message}`);
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
async testGmailConfig(hubId) {
|
|
1011
|
+
try {
|
|
1012
|
+
const integrationConfig = await this.configRepository.findOne({
|
|
1013
|
+
where: { id: hubId },
|
|
1014
|
+
});
|
|
1015
|
+
if (!integrationConfig) {
|
|
1016
|
+
throw new Error('Integration config not found');
|
|
1017
|
+
}
|
|
1018
|
+
const isValid = await this.gmailApiStrategy.validateConnection(integrationConfig.config_json);
|
|
1019
|
+
if (!isValid) {
|
|
1020
|
+
return {
|
|
1021
|
+
success: false,
|
|
1022
|
+
error: 'Gmail configuration is invalid or expired',
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
return { success: true };
|
|
1026
|
+
}
|
|
1027
|
+
catch (error) {
|
|
1028
|
+
this.logger.error('Error testing Gmail config:', error.message);
|
|
1029
|
+
return { success: false, error: error.message };
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
generateSecureState() {
|
|
1033
|
+
return Math.random().toString(36).substring(2) + Date.now().toString(36);
|
|
1034
|
+
}
|
|
1035
|
+
async validateUniqueActiveConfig(levelId, levelType, app_code, configType, provider, excludeHubId) {
|
|
1036
|
+
const query = this.configRepository
|
|
1037
|
+
.createQueryBuilder('hub')
|
|
1038
|
+
.where('hub.level_id = :levelId', { levelId })
|
|
1039
|
+
.andWhere('hub.level_type = :levelType', { levelType })
|
|
1040
|
+
.andWhere('hub.app_code = :app_code', { app_code })
|
|
1041
|
+
.andWhere('hub.integration_type = :configType', { configType })
|
|
1042
|
+
.andWhere('hub.integration_provider = :provider', { provider })
|
|
1043
|
+
.andWhere('hub.status = :status', { status: 1 });
|
|
1044
|
+
if (excludeHubId) {
|
|
1045
|
+
query.andWhere('hub.id != :excludeHubId', { excludeHubId });
|
|
1046
|
+
}
|
|
1047
|
+
const existingActiveConfigs = await query.getMany();
|
|
1048
|
+
if (existingActiveConfigs.length > 0) {
|
|
1049
|
+
throw new Error(`A ${provider} configuration already exists for ${configType} in app_code ${app_code}, ${levelType} ${levelId}. Only one configuration per provider is allowed.`);
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
requiresOAuthFlow(configType, provider, config) {
|
|
1053
|
+
const key = `${configType.toLowerCase()}_${provider.toLowerCase()}`;
|
|
1054
|
+
switch (key) {
|
|
1055
|
+
case 'email_gmail':
|
|
1056
|
+
return !config.accessToken || config.useOAuth === true;
|
|
1057
|
+
case 'email_outlook':
|
|
1058
|
+
return !config.accessToken || config.useOAuth === true;
|
|
1059
|
+
default:
|
|
1060
|
+
return false;
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
async generateOAuthUrl(levelId, levelType, app_code, configType, provider, integration_source_id, config, priority, is_default) {
|
|
1064
|
+
const key = `${configType.toLowerCase()}_${provider.toLowerCase()}`;
|
|
1065
|
+
switch (key) {
|
|
1066
|
+
case 'email_gmail':
|
|
1067
|
+
const gmailResult = await this.initGmailOAuth(levelId, levelType, app_code, config.email);
|
|
1068
|
+
return {
|
|
1069
|
+
authUrl: gmailResult.authUrl,
|
|
1070
|
+
state: gmailResult.state,
|
|
1071
|
+
message: 'Please complete Gmail OAuth authorization. Configuration will be created automatically after authorization.',
|
|
1072
|
+
};
|
|
1073
|
+
case 'email_outlook':
|
|
1074
|
+
const outlookResult = await this.initOutlookOAuth(levelId, levelType, app_code, config.email);
|
|
1075
|
+
return {
|
|
1076
|
+
authUrl: outlookResult.authUrl,
|
|
1077
|
+
state: outlookResult.state,
|
|
1078
|
+
message: 'Please complete Outlook OAuth authorization. Configuration will be created automatically after authorization.',
|
|
1079
|
+
};
|
|
1080
|
+
default:
|
|
1081
|
+
throw new Error(`OAuth not supported for ${configType}/${provider}`);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
async createDirectConfig(levelId, levelType, app_code, configType, provider, integration_source_id, config, priority, is_default) {
|
|
1085
|
+
await this.validateUniqueActiveConfig(levelId, levelType, app_code, configType, provider);
|
|
1086
|
+
await this.configRepository.update({
|
|
1087
|
+
level_id: levelId,
|
|
1088
|
+
level_type: levelType,
|
|
1089
|
+
app_code: app_code,
|
|
1090
|
+
integration_type: configType,
|
|
1091
|
+
status: 1,
|
|
1092
|
+
}, { status: 0 });
|
|
1093
|
+
if (is_default) {
|
|
1094
|
+
await this.configRepository.update({
|
|
1095
|
+
level_id: levelId,
|
|
1096
|
+
level_type: levelType,
|
|
1097
|
+
app_code: app_code,
|
|
1098
|
+
integration_type: configType,
|
|
1099
|
+
}, { is_default: false });
|
|
1100
|
+
}
|
|
1101
|
+
const integrationConfig = this.configRepository.create({
|
|
1102
|
+
app_code: app_code,
|
|
1103
|
+
integration_type: configType,
|
|
1104
|
+
integration_provider: provider,
|
|
1105
|
+
integration_source_id: integration_source_id,
|
|
1106
|
+
level_id: levelId,
|
|
1107
|
+
level_type: levelType,
|
|
1108
|
+
status: 1,
|
|
1109
|
+
priority: priority || 1,
|
|
1110
|
+
is_default: is_default || false,
|
|
1111
|
+
config_json: config,
|
|
1112
|
+
});
|
|
1113
|
+
const savedConfig = await this.configRepository.save(integrationConfig);
|
|
1114
|
+
this.logger.log(`Communication config created: ${configType}/${provider} for ${levelType} ${levelId}`);
|
|
1115
|
+
if (configType === 'TELEPHONE') {
|
|
1116
|
+
try {
|
|
1117
|
+
const did = config.did || config.callerNumber || config.fromNumber;
|
|
1118
|
+
if (did) {
|
|
1119
|
+
const entityMapper = this.entityMapperRepository.create({
|
|
1120
|
+
integration_config_id: savedConfig.id,
|
|
1121
|
+
level_id: String(levelId),
|
|
1122
|
+
level_type: levelType,
|
|
1123
|
+
appcode: app_code,
|
|
1124
|
+
did: did,
|
|
1125
|
+
campaign_name: config.campaignName || null,
|
|
1126
|
+
});
|
|
1127
|
+
await this.entityMapperRepository.save(entityMapper);
|
|
1128
|
+
this.logger.log(`DID mapping created for TELEPHONE integration: ${did} for ${levelType} ${levelId}`);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
catch (error) {
|
|
1132
|
+
this.logger.warn(`Failed to create DID mapping for TELEPHONE integration: ${error.message}`);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
return Array.isArray(savedConfig) ? savedConfig[0] : savedConfig;
|
|
1136
|
+
}
|
|
1137
|
+
async initOutlookOAuth(levelId, levelType, app_code, email) {
|
|
1138
|
+
try {
|
|
1139
|
+
const clientId = this.configService.get('OUTLOOK_CLIENT_ID');
|
|
1140
|
+
const tenantId = this.configService.get('OUTLOOK_TENANT_ID');
|
|
1141
|
+
if (!clientId || !tenantId) {
|
|
1142
|
+
throw new Error('Outlook OAuth credentials not configured');
|
|
1143
|
+
}
|
|
1144
|
+
const state = this.generateSecureState();
|
|
1145
|
+
const callbackUrl = this.configService.get('OUTLOOK_CALLBACK_URL') ||
|
|
1146
|
+
'http://localhost:5001/auth/outlook/callback';
|
|
1147
|
+
this.gmailOAuthStates.set(state, {
|
|
1148
|
+
levelId,
|
|
1149
|
+
levelType,
|
|
1150
|
+
app_code,
|
|
1151
|
+
email,
|
|
1152
|
+
timestamp: Date.now(),
|
|
1153
|
+
});
|
|
1154
|
+
setTimeout(() => {
|
|
1155
|
+
this.gmailOAuthStates.delete(state);
|
|
1156
|
+
}, 10 * 60 * 1000);
|
|
1157
|
+
const scopes = [
|
|
1158
|
+
'https://graph.microsoft.com/Mail.Send',
|
|
1159
|
+
'https://graph.microsoft.com/User.Read',
|
|
1160
|
+
];
|
|
1161
|
+
const authUrl = `https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/authorize?` +
|
|
1162
|
+
`client_id=${clientId}&` +
|
|
1163
|
+
`response_type=code&` +
|
|
1164
|
+
`redirect_uri=${encodeURIComponent(callbackUrl)}&` +
|
|
1165
|
+
`scope=${encodeURIComponent(scopes.join(' '))}&` +
|
|
1166
|
+
`state=outlook_config:${state}&` +
|
|
1167
|
+
`response_mode=query&` +
|
|
1168
|
+
`prompt=consent` +
|
|
1169
|
+
(email ? `&login_hint=${encodeURIComponent(email)}` : '');
|
|
1170
|
+
return { authUrl, state };
|
|
1171
|
+
}
|
|
1172
|
+
catch (error) {
|
|
1173
|
+
this.logger.error('Error initializing Outlook OAuth:', error.message);
|
|
1174
|
+
throw new Error('Failed to initialize Outlook OAuth');
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
async handleOutlookOAuthCallback(code, state) {
|
|
1178
|
+
try {
|
|
1179
|
+
const oauthState = this.gmailOAuthStates.get(state);
|
|
1180
|
+
if (!oauthState) {
|
|
1181
|
+
throw new Error('Invalid or expired OAuth state');
|
|
1182
|
+
}
|
|
1183
|
+
this.gmailOAuthStates.delete(state);
|
|
1184
|
+
if (Date.now() - oauthState.timestamp > 10 * 60 * 1000) {
|
|
1185
|
+
throw new Error('OAuth state expired');
|
|
1186
|
+
}
|
|
1187
|
+
const clientId = this.configService.get('OUTLOOK_CLIENT_ID');
|
|
1188
|
+
const clientSecret = this.configService.get('OUTLOOK_CLIENT_SECRET');
|
|
1189
|
+
const tenantId = this.configService.get('OUTLOOK_TENANT_ID');
|
|
1190
|
+
const callbackUrl = this.configService.get('OUTLOOK_CALLBACK_URL') ||
|
|
1191
|
+
'http://localhost:5001/auth/outlook/callback';
|
|
1192
|
+
const tokenResponse = await fetch(`https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`, {
|
|
1193
|
+
method: 'POST',
|
|
1194
|
+
headers: {
|
|
1195
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
1196
|
+
},
|
|
1197
|
+
body: new URLSearchParams({
|
|
1198
|
+
client_id: clientId,
|
|
1199
|
+
client_secret: clientSecret,
|
|
1200
|
+
code: code,
|
|
1201
|
+
redirect_uri: callbackUrl,
|
|
1202
|
+
grant_type: 'authorization_code',
|
|
1203
|
+
}),
|
|
1204
|
+
});
|
|
1205
|
+
const tokens = await tokenResponse.json();
|
|
1206
|
+
if (!tokens.access_token) {
|
|
1207
|
+
throw new Error('Failed to obtain access token');
|
|
1208
|
+
}
|
|
1209
|
+
const userResponse = await fetch('https://graph.microsoft.com/v1.0/me', {
|
|
1210
|
+
headers: {
|
|
1211
|
+
Authorization: `Bearer ${tokens.access_token}`,
|
|
1212
|
+
},
|
|
1213
|
+
});
|
|
1214
|
+
const userInfo = await userResponse.json();
|
|
1215
|
+
const email = userInfo.mail || userInfo.userPrincipalName;
|
|
1216
|
+
if (!email) {
|
|
1217
|
+
throw new Error('Failed to get user email');
|
|
1218
|
+
}
|
|
1219
|
+
await this.validateUniqueActiveConfig(oauthState.levelId, oauthState.levelType, oauthState.app_code, 'EMAIL', 'outlook');
|
|
1220
|
+
const outlookConfig = {
|
|
1221
|
+
clientId,
|
|
1222
|
+
tenantId,
|
|
1223
|
+
email: email,
|
|
1224
|
+
accessToken: tokens.access_token,
|
|
1225
|
+
refreshToken: tokens.refresh_token,
|
|
1226
|
+
scope: tokens.scope,
|
|
1227
|
+
tokenType: tokens.token_type,
|
|
1228
|
+
expiresIn: tokens.expires_in,
|
|
1229
|
+
};
|
|
1230
|
+
const config = this.configRepository.create({
|
|
1231
|
+
app_code: oauthState.app_code,
|
|
1232
|
+
integration_type: 'EMAIL',
|
|
1233
|
+
integration_provider: 'outlook',
|
|
1234
|
+
integration_source_id: 1,
|
|
1235
|
+
level_id: oauthState.levelId,
|
|
1236
|
+
level_type: oauthState.levelType,
|
|
1237
|
+
status: 1,
|
|
1238
|
+
priority: 1,
|
|
1239
|
+
is_default: false,
|
|
1240
|
+
config_json: outlookConfig,
|
|
1241
|
+
});
|
|
1242
|
+
const savedConfig = await this.configRepository.save(config);
|
|
1243
|
+
this.logger.log(`Outlook OAuth configuration created successfully for ${oauthState.levelType} ${oauthState.levelId} and email ${email}`);
|
|
1244
|
+
return {
|
|
1245
|
+
hubId: savedConfig.id,
|
|
1246
|
+
configId: savedConfig.id,
|
|
1247
|
+
};
|
|
1248
|
+
}
|
|
1249
|
+
catch (error) {
|
|
1250
|
+
this.logger.error('Error handling Outlook OAuth callback:', error.message);
|
|
1251
|
+
throw new Error(`Failed to complete Outlook OAuth: ${error.message}`);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
async getIntegrationConfigById(hubId) {
|
|
1255
|
+
try {
|
|
1256
|
+
const integrationConfig = await this.configRepository.findOne({
|
|
1257
|
+
where: { id: hubId },
|
|
1258
|
+
});
|
|
1259
|
+
if (!integrationConfig) {
|
|
1260
|
+
return null;
|
|
1261
|
+
}
|
|
1262
|
+
const linkedSource = this.extractLinkedSource(integrationConfig.integration_type, integrationConfig.integration_provider, integrationConfig.config_json);
|
|
1263
|
+
const configDetails = this.extractConfigDetails(integrationConfig.integration_type, integrationConfig.integration_provider, integrationConfig.config_json);
|
|
1264
|
+
return {
|
|
1265
|
+
...integrationConfig,
|
|
1266
|
+
config: integrationConfig,
|
|
1267
|
+
linkedSource,
|
|
1268
|
+
configDetails,
|
|
1269
|
+
};
|
|
1270
|
+
}
|
|
1271
|
+
catch (error) {
|
|
1272
|
+
this.logger.error(`Error fetching communication config by ID ${hubId}:`, error.message);
|
|
1273
|
+
throw new Error(`Failed to fetch communication configuration: ${error.message}`);
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
async getIntegrationTemplates(levelId, levelType, app_code, integration_type) {
|
|
1277
|
+
try {
|
|
1278
|
+
const config = await this.getSingleActiveConfig(levelId, levelType, app_code, integration_type);
|
|
1279
|
+
if (!config) {
|
|
1280
|
+
return {
|
|
1281
|
+
success: false,
|
|
1282
|
+
error: `No active ${integration_type} configuration found for this level`,
|
|
1283
|
+
};
|
|
1284
|
+
}
|
|
1285
|
+
const strategy = this.integrationFactory.create(config.integration_type, 'API', config.integration_provider);
|
|
1286
|
+
if (typeof strategy.getTemplates !== 'function') {
|
|
1287
|
+
return {
|
|
1288
|
+
success: false,
|
|
1289
|
+
error: `Template retrieval not supported for provider: ${config.integration_provider}`,
|
|
1290
|
+
};
|
|
1291
|
+
}
|
|
1292
|
+
return await strategy.getTemplates(config.config_json);
|
|
1293
|
+
}
|
|
1294
|
+
catch (error) {
|
|
1295
|
+
this.logger.error(`Error fetching templates for ${integration_type} level ${levelId}/${levelType}:`, error.message);
|
|
1296
|
+
return {
|
|
1297
|
+
success: false,
|
|
1298
|
+
error: `Failed to fetch templates: ${error.message}`,
|
|
1299
|
+
};
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
async getSendGridTemplates(levelId, levelType, app_code) {
|
|
1303
|
+
try {
|
|
1304
|
+
const hubs = await this.getActiveConfigs(levelId, levelType, app_code, 'EMAIL');
|
|
1305
|
+
const sendGridHub = hubs.find((hub) => hub.integration_provider === 'sendgrid');
|
|
1306
|
+
if (!sendGridHub) {
|
|
1307
|
+
return {
|
|
1308
|
+
success: false,
|
|
1309
|
+
error: 'No active SendGrid configuration found for this level',
|
|
1310
|
+
};
|
|
1311
|
+
}
|
|
1312
|
+
const apiKey = sendGridHub.config_json?.apiKey;
|
|
1313
|
+
if (!apiKey) {
|
|
1314
|
+
return {
|
|
1315
|
+
success: false,
|
|
1316
|
+
error: 'SendGrid API key not found in configuration',
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
return this.sendGridApiStrategy.getTemplates(apiKey);
|
|
1320
|
+
}
|
|
1321
|
+
catch (error) {
|
|
1322
|
+
this.logger.error(`Error fetching SendGrid templates for level ${levelId}/${levelType}:`, error.message);
|
|
1323
|
+
return {
|
|
1324
|
+
success: false,
|
|
1325
|
+
error: `Failed to fetch SendGrid templates: ${error.message}`,
|
|
1326
|
+
};
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
async getSendGridVerifiedSenders(apiKey) {
|
|
1330
|
+
try {
|
|
1331
|
+
if (!apiKey) {
|
|
1332
|
+
return {
|
|
1333
|
+
success: false,
|
|
1334
|
+
error: 'SendGrid API key not found in configuration',
|
|
1335
|
+
};
|
|
1336
|
+
}
|
|
1337
|
+
return this.sendGridApiStrategy.getVerifiedSenders(apiKey);
|
|
1338
|
+
}
|
|
1339
|
+
catch (error) {
|
|
1340
|
+
this.logger.error(`Error fetching SendGrid verified senders`, error.message);
|
|
1341
|
+
return {
|
|
1342
|
+
success: false,
|
|
1343
|
+
error: `Failed to fetch SendGrid verified senders: ${error.message}`,
|
|
1344
|
+
};
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
async createUserIntegration(createDto) {
|
|
1348
|
+
try {
|
|
1349
|
+
const existing = await this.userIntegrationRepository.findOne({
|
|
1350
|
+
where: {
|
|
1351
|
+
user_id: createDto.user_id,
|
|
1352
|
+
integration_config_id: createDto.integration_config_id,
|
|
1353
|
+
},
|
|
1354
|
+
});
|
|
1355
|
+
if (existing) {
|
|
1356
|
+
throw new Error('User integration mapping already exists');
|
|
1357
|
+
}
|
|
1358
|
+
const config = await this.configRepository.findOne({
|
|
1359
|
+
where: { id: createDto.integration_config_id },
|
|
1360
|
+
});
|
|
1361
|
+
if (!config) {
|
|
1362
|
+
throw new Error('Integration configuration not found');
|
|
1363
|
+
}
|
|
1364
|
+
const userIntegration = this.userIntegrationRepository.create(createDto);
|
|
1365
|
+
return await this.userIntegrationRepository.save(userIntegration);
|
|
1366
|
+
}
|
|
1367
|
+
catch (error) {
|
|
1368
|
+
this.logger.error(`Error creating user integration mapping: ${error.message}`);
|
|
1369
|
+
throw error;
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
async bulkCreateUserIntegration(bulkDto) {
|
|
1373
|
+
const created = [];
|
|
1374
|
+
const updated = [];
|
|
1375
|
+
const failed = [];
|
|
1376
|
+
try {
|
|
1377
|
+
for (const createDto of bulkDto.user_integrations) {
|
|
1378
|
+
try {
|
|
1379
|
+
const existing = await this.userIntegrationRepository.findOne({
|
|
1380
|
+
where: {
|
|
1381
|
+
user_id: createDto.user_id,
|
|
1382
|
+
integration_config_id: createDto.integration_config_id,
|
|
1383
|
+
},
|
|
1384
|
+
});
|
|
1385
|
+
if (existing) {
|
|
1386
|
+
if (createDto.external_user_id !== undefined) {
|
|
1387
|
+
existing.external_user_id = createDto.external_user_id;
|
|
1388
|
+
}
|
|
1389
|
+
if (createDto.external_user_data !== undefined) {
|
|
1390
|
+
existing.external_user_data = createDto.external_user_data;
|
|
1391
|
+
}
|
|
1392
|
+
if (createDto.is_active !== undefined) {
|
|
1393
|
+
existing.is_active = createDto.is_active;
|
|
1394
|
+
}
|
|
1395
|
+
const updatedIntegration = await this.userIntegrationRepository.save(existing);
|
|
1396
|
+
updated.push(updatedIntegration);
|
|
1397
|
+
this.logger.log(`Updated user integration mapping for user ${createDto.user_id} and config ${createDto.integration_config_id}`);
|
|
1398
|
+
}
|
|
1399
|
+
else {
|
|
1400
|
+
const config = await this.configRepository.findOne({
|
|
1401
|
+
where: { id: createDto.integration_config_id },
|
|
1402
|
+
});
|
|
1403
|
+
if (!config) {
|
|
1404
|
+
failed.push({
|
|
1405
|
+
data: createDto,
|
|
1406
|
+
error: 'Integration configuration not found',
|
|
1407
|
+
});
|
|
1408
|
+
continue;
|
|
1409
|
+
}
|
|
1410
|
+
const userIntegration = this.userIntegrationRepository.create(createDto);
|
|
1411
|
+
const savedIntegration = await this.userIntegrationRepository.save(userIntegration);
|
|
1412
|
+
created.push(savedIntegration);
|
|
1413
|
+
this.logger.log(`Created user integration mapping for user ${createDto.user_id} and config ${createDto.integration_config_id}`);
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
catch (error) {
|
|
1417
|
+
failed.push({
|
|
1418
|
+
data: createDto,
|
|
1419
|
+
error: error.message || 'Unknown error',
|
|
1420
|
+
});
|
|
1421
|
+
this.logger.error(`Error processing user integration for user ${createDto.user_id}: ${error.message}`);
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
const summary = {
|
|
1425
|
+
total: bulkDto.user_integrations.length,
|
|
1426
|
+
created: created.length,
|
|
1427
|
+
updated: updated.length,
|
|
1428
|
+
failed: failed.length,
|
|
1429
|
+
};
|
|
1430
|
+
this.logger.log(`Bulk user integration completed: ${summary.created} created, ${summary.updated} updated, ${summary.failed} failed`);
|
|
1431
|
+
return { created, updated, failed, summary };
|
|
1432
|
+
}
|
|
1433
|
+
catch (error) {
|
|
1434
|
+
this.logger.error(`Error in bulk user integration creation: ${error.message}`);
|
|
1435
|
+
throw error;
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
async getUserIntegrations(userId) {
|
|
1439
|
+
try {
|
|
1440
|
+
return await this.userIntegrationRepository.find({
|
|
1441
|
+
where: { user_id: userId, is_active: true },
|
|
1442
|
+
order: { created_at: 'DESC' },
|
|
1443
|
+
});
|
|
1444
|
+
}
|
|
1445
|
+
catch (error) {
|
|
1446
|
+
this.logger.error(`Error fetching user integrations for user ${userId}: ${error.message}`);
|
|
1447
|
+
throw error;
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
async getConfigUserIntegrations(configId) {
|
|
1451
|
+
try {
|
|
1452
|
+
return await this.userIntegrationRepository.find({
|
|
1453
|
+
where: { integration_config_id: configId, is_active: true },
|
|
1454
|
+
order: { created_at: 'DESC' },
|
|
1455
|
+
});
|
|
1456
|
+
}
|
|
1457
|
+
catch (error) {
|
|
1458
|
+
this.logger.error(`Error fetching user integrations for config ${configId}: ${error.message}`);
|
|
1459
|
+
throw error;
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
async getUserIntegrationByUserAndConfig(userId, configId) {
|
|
1463
|
+
try {
|
|
1464
|
+
return await this.userIntegrationRepository.findOne({
|
|
1465
|
+
where: {
|
|
1466
|
+
user_id: userId,
|
|
1467
|
+
integration_config_id: configId,
|
|
1468
|
+
is_active: true,
|
|
1469
|
+
},
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
catch (error) {
|
|
1473
|
+
this.logger.error(`Error fetching user integration for user ${userId} and config ${configId}: ${error.message}`);
|
|
1474
|
+
throw error;
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
async updateUserIntegration(id, updateDto) {
|
|
1478
|
+
try {
|
|
1479
|
+
const userIntegration = await this.userIntegrationRepository.findOne({
|
|
1480
|
+
where: { id },
|
|
1481
|
+
});
|
|
1482
|
+
if (!userIntegration) {
|
|
1483
|
+
throw new Error('User integration mapping not found');
|
|
1484
|
+
}
|
|
1485
|
+
Object.assign(userIntegration, updateDto);
|
|
1486
|
+
return await this.userIntegrationRepository.save(userIntegration);
|
|
1487
|
+
}
|
|
1488
|
+
catch (error) {
|
|
1489
|
+
this.logger.error(`Error updating user integration ${id}: ${error.message}`);
|
|
1490
|
+
throw error;
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
async deleteUserIntegration(id) {
|
|
1494
|
+
try {
|
|
1495
|
+
const userIntegration = await this.userIntegrationRepository.findOne({
|
|
1496
|
+
where: { id },
|
|
1497
|
+
});
|
|
1498
|
+
if (!userIntegration) {
|
|
1499
|
+
throw new Error('User integration mapping not found');
|
|
1500
|
+
}
|
|
1501
|
+
await this.userIntegrationRepository.remove(userIntegration);
|
|
1502
|
+
}
|
|
1503
|
+
catch (error) {
|
|
1504
|
+
this.logger.error(`Error deleting user integration ${id}: ${error.message}`);
|
|
1505
|
+
throw error;
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
async getUserIntegrationForStrategy(userId, integrationConfigId) {
|
|
1509
|
+
try {
|
|
1510
|
+
const userIntegration = await this.getUserIntegrationByUserAndConfig(userId, integrationConfigId);
|
|
1511
|
+
if (!userIntegration) {
|
|
1512
|
+
return null;
|
|
1513
|
+
}
|
|
1514
|
+
return {
|
|
1515
|
+
external_user_id: userIntegration.external_user_id,
|
|
1516
|
+
external_user_data: userIntegration.external_user_data,
|
|
1517
|
+
};
|
|
1518
|
+
}
|
|
1519
|
+
catch (error) {
|
|
1520
|
+
this.logger.error(`Error fetching user integration data for strategy: ${error.message}`);
|
|
1521
|
+
return null;
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
async checkAgentStatus(levelId, levelType, appCode, userId, integrationType = 'TELEPHONE') {
|
|
1525
|
+
try {
|
|
1526
|
+
const config = await this.getSingleActiveConfig(levelId, levelType, appCode, integrationType);
|
|
1527
|
+
if (!config) {
|
|
1528
|
+
return {
|
|
1529
|
+
success: false,
|
|
1530
|
+
error: 'No active TELEPHONE configuration found',
|
|
1531
|
+
};
|
|
1532
|
+
}
|
|
1533
|
+
const userIntegration = await this.getUserIntegrationByUserAndConfig(userId, config.id);
|
|
1534
|
+
if (!userIntegration) {
|
|
1535
|
+
return {
|
|
1536
|
+
success: false,
|
|
1537
|
+
error: 'User integration mapping not found. Please configure agent details.',
|
|
1538
|
+
};
|
|
1539
|
+
}
|
|
1540
|
+
const strategy = this.integrationFactory.create(config.integration_type, 'API', config.integration_provider);
|
|
1541
|
+
let mergedConfig = config.config_json;
|
|
1542
|
+
if (strategy.createUserSpecificConfig) {
|
|
1543
|
+
mergedConfig = strategy.createUserSpecificConfig(config.config_json, userIntegration.external_user_id);
|
|
1544
|
+
}
|
|
1545
|
+
if (typeof strategy.checkAgentStatus !== 'function') {
|
|
1546
|
+
return {
|
|
1547
|
+
success: false,
|
|
1548
|
+
error: `Agent status check not supported for provider: ${config.integration_provider}`,
|
|
1549
|
+
};
|
|
1550
|
+
}
|
|
1551
|
+
const statusResult = await strategy.checkAgentStatus(mergedConfig);
|
|
1552
|
+
return {
|
|
1553
|
+
success: true,
|
|
1554
|
+
isReady: statusResult.isReady,
|
|
1555
|
+
state: statusResult.state,
|
|
1556
|
+
error: statusResult.error,
|
|
1557
|
+
};
|
|
1558
|
+
}
|
|
1559
|
+
catch (error) {
|
|
1560
|
+
this.logger.error(`Error checking agent status: ${error.message}`, error.stack);
|
|
1561
|
+
return {
|
|
1562
|
+
success: false,
|
|
1563
|
+
error: error.message || 'Failed to check agent status',
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
};
|
|
1568
|
+
exports.IntegrationService = IntegrationService;
|
|
1569
|
+
exports.IntegrationService = IntegrationService = IntegrationService_1 = __decorate([
|
|
1570
|
+
(0, common_1.Injectable)(),
|
|
1571
|
+
__param(0, (0, typeorm_1.InjectRepository)(integration_config_entity_1.IntegrationConfig)),
|
|
1572
|
+
__param(1, (0, typeorm_1.InjectRepository)(user_integration_entity_1.UserIntegration)),
|
|
1573
|
+
__param(2, (0, typeorm_1.InjectRepository)(integration_entity_mapper_entity_1.IntegrationEntityMapper)),
|
|
1574
|
+
__param(9, (0, common_1.Inject)('FieldMapperService')),
|
|
1575
|
+
__param(12, (0, common_1.Inject)((0, common_1.forwardRef)(() => integration_queue_service_1.IntegrationQueueService))),
|
|
1576
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
1577
|
+
typeorm_2.Repository,
|
|
1578
|
+
typeorm_2.Repository,
|
|
1579
|
+
typeorm_2.DataSource,
|
|
1580
|
+
integration_factory_1.IntegrationFactory,
|
|
1581
|
+
gmail_api_strategy_1.GmailApiStrategy,
|
|
1582
|
+
sendgrid_api_strategy_1.SendGridApiStrategy,
|
|
1583
|
+
config_1.ConfigService,
|
|
1584
|
+
media_data_service_1.MediaDataService,
|
|
1585
|
+
field_mapper_service_1.FieldMapperService,
|
|
1586
|
+
entity_service_impl_service_1.EntityServiceImpl,
|
|
1587
|
+
reflection_helper_service_1.ReflectionHelper,
|
|
1588
|
+
integration_queue_service_1.IntegrationQueueService])
|
|
1589
|
+
], IntegrationService);
|
|
1590
|
+
//# sourceMappingURL=integration.service.js.map
|