rez_core 2.2.258 → 2.2.259

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.
Files changed (233) hide show
  1. package/dist/app.module.js +2 -2
  2. package/dist/app.module.js.map +1 -1
  3. package/dist/module/integration/controller/calender-event.controller.js.map +1 -0
  4. package/dist/module/integration/controller/integration.controller.d.ts +113 -0
  5. package/dist/module/{communication/controller/communication.controller.js → integration/controller/integration.controller.js} +197 -75
  6. package/dist/module/integration/controller/integration.controller.js.map +1 -0
  7. package/dist/module/{communication → integration}/controller/wrapper.controller.d.ts +1 -1
  8. package/dist/module/integration/controller/wrapper.controller.js.map +1 -0
  9. package/dist/module/{communication → integration}/dto/create-config.dto.d.ts +48 -4
  10. package/dist/module/{communication → integration}/dto/create-config.dto.js +96 -18
  11. package/dist/module/integration/dto/create-config.dto.js.map +1 -0
  12. package/dist/module/{communication/entity/communication-config.entity.d.ts → integration/entity/integration-config.entity.d.ts} +11 -1
  13. package/dist/module/integration/entity/integration-config.entity.js +78 -0
  14. package/dist/module/integration/entity/integration-config.entity.js.map +1 -0
  15. package/dist/module/{communication → integration}/entity/integration-source.entity.d.ts +1 -1
  16. package/dist/module/{communication → integration}/entity/integration-source.entity.js +8 -8
  17. package/dist/module/integration/entity/integration-source.entity.js.map +1 -0
  18. package/dist/module/integration/entity/user-integration.entity.d.ts +23 -0
  19. package/dist/module/integration/entity/user-integration.entity.js +70 -0
  20. package/dist/module/integration/entity/user-integration.entity.js.map +1 -0
  21. package/dist/module/integration/examples/usage.example.d.ts +16 -0
  22. package/dist/module/integration/examples/usage.example.js +217 -0
  23. package/dist/module/integration/examples/usage.example.js.map +1 -0
  24. package/dist/module/{communication → integration}/factories/base.factory.d.ts +2 -2
  25. package/dist/module/integration/factories/base.factory.js.map +1 -0
  26. package/dist/module/{communication → integration}/factories/email.factory.d.ts +3 -7
  27. package/dist/module/{communication → integration}/factories/email.factory.js +1 -13
  28. package/dist/module/integration/factories/email.factory.js.map +1 -0
  29. package/dist/module/{communication/factories/communication.factory.d.ts → integration/factories/integration.factory.d.ts} +4 -4
  30. package/dist/module/{communication/factories/communication.factory.js → integration/factories/integration.factory.js} +26 -26
  31. package/dist/module/integration/factories/integration.factory.js.map +1 -0
  32. package/dist/module/integration/factories/sms.factory.d.ts +9 -0
  33. package/dist/module/integration/factories/sms.factory.js +26 -0
  34. package/dist/module/integration/factories/sms.factory.js.map +1 -0
  35. package/dist/module/{communication → integration}/factories/telephone.factory.d.ts +3 -5
  36. package/dist/module/{communication → integration}/factories/telephone.factory.js +11 -17
  37. package/dist/module/integration/factories/telephone.factory.js.map +1 -0
  38. package/dist/module/{communication → integration}/factories/whatsapp.factory.d.ts +2 -2
  39. package/dist/module/integration/factories/whatsapp.factory.js.map +1 -0
  40. package/dist/module/integration/integration.module.d.ts +2 -0
  41. package/dist/module/{communication/communication.module.js → integration/integration.module.js} +22 -42
  42. package/dist/module/integration/integration.module.js.map +1 -0
  43. package/dist/module/integration/service/calendar-event.service.js.map +1 -0
  44. package/dist/module/{communication/service/communication-queue.service.d.ts → integration/service/integration-queue.service.d.ts} +1 -1
  45. package/dist/module/{communication/service/communication-queue.service.js → integration/service/integration-queue.service.js} +8 -8
  46. package/dist/module/integration/service/integration-queue.service.js.map +1 -0
  47. package/dist/module/integration/service/integration.service.d.ts +155 -0
  48. package/dist/module/{communication/service/communication.service.js → integration/service/integration.service.js} +391 -307
  49. package/dist/module/integration/service/integration.service.js.map +1 -0
  50. package/dist/module/{communication → integration}/service/oauth.service.js +1 -1
  51. package/dist/module/integration/service/oauth.service.js.map +1 -0
  52. package/dist/module/{communication → integration}/service/wrapper.service.d.ts +4 -4
  53. package/dist/module/{communication → integration}/service/wrapper.service.js +25 -26
  54. package/dist/module/integration/service/wrapper.service.js.map +1 -0
  55. package/dist/module/{communication → integration}/strategies/email/gmail-api.strategy.d.ts +3 -3
  56. package/dist/module/{communication → integration}/strategies/email/gmail-api.strategy.js +2 -6
  57. package/dist/module/integration/strategies/email/gmail-api.strategy.js.map +1 -0
  58. package/dist/module/integration/strategies/email/outlook-api.strategy.d.ts +5 -0
  59. package/dist/module/integration/strategies/email/outlook-api.strategy.js.map +1 -0
  60. package/dist/module/integration/strategies/email/outlook.strategy.d.ts +5 -0
  61. package/dist/module/integration/strategies/email/outlook.strategy.js.map +1 -0
  62. package/dist/module/{communication → integration}/strategies/email/sendgrid-api.strategy.d.ts +3 -3
  63. package/dist/module/integration/strategies/email/sendgrid-api.strategy.js.map +1 -0
  64. package/dist/module/{communication/strategies/communication.strategy.d.ts → integration/strategies/integration.strategy.d.ts} +4 -3
  65. package/dist/module/{communication/strategies/communication.strategy.js → integration/strategies/integration.strategy.js} +1 -1
  66. package/dist/module/integration/strategies/integration.strategy.js.map +1 -0
  67. package/dist/module/integration/strategies/telephone/ozonetel-voice.strategy.d.ts +17 -0
  68. package/dist/module/{communication → integration}/strategies/telephone/ozonetel-voice.strategy.js +13 -5
  69. package/dist/module/integration/strategies/telephone/ozonetel-voice.strategy.js.map +1 -0
  70. package/dist/module/{communication → integration}/strategies/telephone/tubelight-voice.strategy.d.ts +6 -4
  71. package/dist/module/{communication → integration}/strategies/telephone/tubelight-voice.strategy.js +3 -7
  72. package/dist/module/integration/strategies/telephone/tubelight-voice.strategy.js.map +1 -0
  73. package/dist/module/{communication → integration}/strategies/whatsapp/whatsapp-cloud.strategy.d.ts +3 -3
  74. package/dist/module/integration/strategies/whatsapp/whatsapp-cloud.strategy.js.map +1 -0
  75. package/dist/module/integration/strategies/whatsapp/whatsapp.strategy.d.ts +5 -0
  76. package/dist/module/integration/strategies/whatsapp/whatsapp.strategy.js.map +1 -0
  77. package/dist/module/meta/entity/entity-master.entity.d.ts +1 -1
  78. package/dist/module/meta/entity/entity-master.entity.js +2 -2
  79. package/dist/module/meta/entity/entity-master.entity.js.map +1 -1
  80. package/dist/module/meta/service/entity-dynamic.service.js +47 -27
  81. package/dist/module/meta/service/entity-dynamic.service.js.map +1 -1
  82. package/dist/module/user/controller/login.controller.d.ts +3 -3
  83. package/dist/module/user/controller/login.controller.js +5 -5
  84. package/dist/module/user/controller/login.controller.js.map +1 -1
  85. package/dist/module/user/user.module.js +2 -2
  86. package/dist/module/user/user.module.js.map +1 -1
  87. package/dist/module/workflow-automation/entity/workflow-automation-action.entity.d.ts +1 -0
  88. package/dist/module/workflow-automation/entity/workflow-automation-action.entity.js +4 -0
  89. package/dist/module/workflow-automation/entity/workflow-automation-action.entity.js.map +1 -1
  90. package/dist/module/workflow-automation/service/workflow-automation.service.d.ts +2 -1
  91. package/dist/module/workflow-automation/service/workflow-automation.service.js +8 -4
  92. package/dist/module/workflow-automation/service/workflow-automation.service.js.map +1 -1
  93. package/dist/tsconfig.build.tsbuildinfo +1 -1
  94. package/docs/modules/event-driven-integration-design.md +92 -0
  95. package/docs/modules/integration.md +197 -0
  96. package/package.json +1 -1
  97. package/src/app.module.ts +2 -2
  98. package/src/module/integration/controller/integration.controller.ts +411 -0
  99. package/src/module/{communication → integration}/dto/create-config.dto.ts +110 -18
  100. package/src/module/{communication/entity/communication-config.entity.ts → integration/entity/integration-config.entity.ts} +33 -6
  101. package/src/module/{communication → integration}/entity/integration-source.entity.ts +1 -1
  102. package/src/module/integration/entity/user-integration.entity.ts +71 -0
  103. package/src/module/integration/examples/usage.example.ts +338 -0
  104. package/src/module/{communication → integration}/factories/base.factory.ts +2 -2
  105. package/src/module/{communication → integration}/factories/email.factory.ts +2 -12
  106. package/src/module/{communication/factories/communication.factory.ts → integration/factories/integration.factory.ts} +18 -18
  107. package/src/module/integration/factories/sms.factory.ts +19 -0
  108. package/src/module/integration/factories/telephone.factory.ts +41 -0
  109. package/src/module/{communication → integration}/factories/whatsapp.factory.ts +2 -2
  110. package/src/module/integration/integration.module.ts +86 -0
  111. package/src/module/{communication/service/communication-queue.service.ts → integration/service/integration-queue.service.ts} +2 -2
  112. package/src/module/{communication/service/communication.service.ts → integration/service/integration.service.ts} +598 -448
  113. package/src/module/{communication → integration}/service/oauth.service.ts +1 -1
  114. package/src/module/{communication → integration}/service/wrapper.service.ts +24 -25
  115. package/src/module/{communication → integration}/strategies/email/gmail-api.strategy.ts +6 -18
  116. package/src/module/{communication → integration}/strategies/email/outlook-api.strategy.ts +5 -5
  117. package/src/module/{communication → integration}/strategies/email/outlook.strategy.ts +5 -5
  118. package/src/module/{communication → integration}/strategies/email/sendgrid-api.strategy.ts +5 -5
  119. package/src/module/{communication/strategies/communication.strategy.ts → integration/strategies/integration.strategy.ts} +7 -3
  120. package/src/module/{communication → integration}/strategies/telephone/ozonetel-voice.strategy.ts +40 -12
  121. package/src/module/{communication → integration}/strategies/telephone/tubelight-voice.strategy.ts +24 -17
  122. package/src/module/{communication → integration}/strategies/whatsapp/whatsapp-cloud.strategy.ts +5 -5
  123. package/src/module/{communication → integration}/strategies/whatsapp/whatsapp.strategy.ts +5 -5
  124. package/src/module/meta/entity/entity-master.entity.ts +2 -2
  125. package/src/module/meta/service/entity-dynamic.service.ts +55 -28
  126. package/src/module/user/controller/login.controller.ts +3 -3
  127. package/src/module/user/user.module.ts +2 -2
  128. package/src/module/workflow-automation/entity/workflow-automation-action.entity.ts +3 -0
  129. package/src/module/workflow-automation/service/workflow-automation.service.ts +8 -4
  130. package/src/resources/dev.properties.yaml +3 -3
  131. package/.vscode/extensions.json +0 -5
  132. package/dist/module/communication/communication.module.d.ts +0 -2
  133. package/dist/module/communication/communication.module.js.map +0 -1
  134. package/dist/module/communication/controller/calender-event.controller.js.map +0 -1
  135. package/dist/module/communication/controller/communication.controller.d.ts +0 -99
  136. package/dist/module/communication/controller/communication.controller.js.map +0 -1
  137. package/dist/module/communication/controller/wrapper.controller.js.map +0 -1
  138. package/dist/module/communication/dto/create-config.dto.js.map +0 -1
  139. package/dist/module/communication/entity/communication-config.entity.js +0 -45
  140. package/dist/module/communication/entity/communication-config.entity.js.map +0 -1
  141. package/dist/module/communication/entity/communication-hub.entity.d.ts +0 -20
  142. package/dist/module/communication/entity/communication-hub.entity.js +0 -115
  143. package/dist/module/communication/entity/communication-hub.entity.js.map +0 -1
  144. package/dist/module/communication/entity/integration-source.entity.js.map +0 -1
  145. package/dist/module/communication/examples/usage.example.d.ts +0 -11
  146. package/dist/module/communication/examples/usage.example.js +0 -89
  147. package/dist/module/communication/examples/usage.example.js.map +0 -1
  148. package/dist/module/communication/factories/base.factory.js.map +0 -1
  149. package/dist/module/communication/factories/communication.factory.js.map +0 -1
  150. package/dist/module/communication/factories/email.factory.js.map +0 -1
  151. package/dist/module/communication/factories/sms.factory.d.ts +0 -15
  152. package/dist/module/communication/factories/sms.factory.js +0 -49
  153. package/dist/module/communication/factories/sms.factory.js.map +0 -1
  154. package/dist/module/communication/factories/telephone.factory.js.map +0 -1
  155. package/dist/module/communication/factories/whatsapp.factory.js.map +0 -1
  156. package/dist/module/communication/service/calendar-event.service.js.map +0 -1
  157. package/dist/module/communication/service/communication-queue.service.js.map +0 -1
  158. package/dist/module/communication/service/communication.service.d.ts +0 -155
  159. package/dist/module/communication/service/communication.service.js.map +0 -1
  160. package/dist/module/communication/service/oauth.service.js.map +0 -1
  161. package/dist/module/communication/service/wrapper.service.js.map +0 -1
  162. package/dist/module/communication/strategies/communication.strategy.js.map +0 -1
  163. package/dist/module/communication/strategies/email/gmail-api.strategy.js.map +0 -1
  164. package/dist/module/communication/strategies/email/gmail-smtp-v2.strategy.d.ts +0 -5
  165. package/dist/module/communication/strategies/email/gmail-smtp-v2.strategy.js +0 -60
  166. package/dist/module/communication/strategies/email/gmail-smtp-v2.strategy.js.map +0 -1
  167. package/dist/module/communication/strategies/email/gmail-smtp.strategy.d.ts +0 -5
  168. package/dist/module/communication/strategies/email/gmail-smtp.strategy.js +0 -49
  169. package/dist/module/communication/strategies/email/gmail-smtp.strategy.js.map +0 -1
  170. package/dist/module/communication/strategies/email/outlook-api.strategy.d.ts +0 -5
  171. package/dist/module/communication/strategies/email/outlook-api.strategy.js.map +0 -1
  172. package/dist/module/communication/strategies/email/outlook-smtp.strategy.d.ts +0 -5
  173. package/dist/module/communication/strategies/email/outlook-smtp.strategy.js +0 -65
  174. package/dist/module/communication/strategies/email/outlook-smtp.strategy.js.map +0 -1
  175. package/dist/module/communication/strategies/email/outlook.strategy.d.ts +0 -5
  176. package/dist/module/communication/strategies/email/outlook.strategy.js.map +0 -1
  177. package/dist/module/communication/strategies/email/sendgrid-api.strategy.js.map +0 -1
  178. package/dist/module/communication/strategies/sms/knowlarity-multi.strategy.d.ts +0 -6
  179. package/dist/module/communication/strategies/sms/knowlarity-multi.strategy.js +0 -121
  180. package/dist/module/communication/strategies/sms/knowlarity-multi.strategy.js.map +0 -1
  181. package/dist/module/communication/strategies/sms/knowlarity.strategy.d.ts +0 -5
  182. package/dist/module/communication/strategies/sms/knowlarity.strategy.js +0 -44
  183. package/dist/module/communication/strategies/sms/knowlarity.strategy.js.map +0 -1
  184. package/dist/module/communication/strategies/sms/twilio-v2.strategy.d.ts +0 -5
  185. package/dist/module/communication/strategies/sms/twilio-v2.strategy.js +0 -48
  186. package/dist/module/communication/strategies/sms/twilio-v2.strategy.js.map +0 -1
  187. package/dist/module/communication/strategies/sms/twilio.strategy.d.ts +0 -5
  188. package/dist/module/communication/strategies/sms/twilio.strategy.js +0 -44
  189. package/dist/module/communication/strategies/sms/twilio.strategy.js.map +0 -1
  190. package/dist/module/communication/strategies/telephone/knowlarity-multi.strategy.d.ts +0 -6
  191. package/dist/module/communication/strategies/telephone/knowlarity-multi.strategy.js +0 -121
  192. package/dist/module/communication/strategies/telephone/knowlarity-multi.strategy.js.map +0 -1
  193. package/dist/module/communication/strategies/telephone/knowlarity-voice.strategy.d.ts +0 -5
  194. package/dist/module/communication/strategies/telephone/knowlarity-voice.strategy.js +0 -44
  195. package/dist/module/communication/strategies/telephone/knowlarity-voice.strategy.js.map +0 -1
  196. package/dist/module/communication/strategies/telephone/ozonetel-voice.strategy.d.ts +0 -15
  197. package/dist/module/communication/strategies/telephone/ozonetel-voice.strategy.js.map +0 -1
  198. package/dist/module/communication/strategies/telephone/tubelight-voice.strategy.js.map +0 -1
  199. package/dist/module/communication/strategies/whatsapp/whatsapp-cloud.strategy.js.map +0 -1
  200. package/dist/module/communication/strategies/whatsapp/whatsapp.strategy.d.ts +0 -5
  201. package/dist/module/communication/strategies/whatsapp/whatsapp.strategy.js.map +0 -1
  202. package/docs/modules/communication.md +0 -177
  203. package/src/module/communication/communication.module.ts +0 -106
  204. package/src/module/communication/controller/communication.controller.ts +0 -293
  205. package/src/module/communication/entity/communication-hub.entity.ts +0 -103
  206. package/src/module/communication/examples/usage.example.ts +0 -170
  207. package/src/module/communication/factories/sms.factory.ts +0 -44
  208. package/src/module/communication/factories/telephone.factory.ts +0 -49
  209. package/src/module/communication/strategies/email/gmail-smtp-v2.strategy.ts +0 -68
  210. package/src/module/communication/strategies/email/gmail-smtp.strategy.ts +0 -51
  211. package/src/module/communication/strategies/email/outlook-smtp.strategy.ts +0 -73
  212. package/src/module/communication/strategies/sms/knowlarity-multi.strategy.ts +0 -158
  213. package/src/module/communication/strategies/sms/knowlarity.strategy.ts +0 -44
  214. package/src/module/communication/strategies/sms/twilio-v2.strategy.ts +0 -47
  215. package/src/module/communication/strategies/sms/twilio.strategy.ts +0 -44
  216. package/src/module/communication/strategies/telephone/knowlarity-multi.strategy.ts +0 -158
  217. package/src/module/communication/strategies/telephone/knowlarity-voice.strategy.ts +0 -44
  218. /package/dist/module/{communication → integration}/controller/calender-event.controller.d.ts +0 -0
  219. /package/dist/module/{communication → integration}/controller/calender-event.controller.js +0 -0
  220. /package/dist/module/{communication → integration}/controller/wrapper.controller.js +0 -0
  221. /package/dist/module/{communication → integration}/factories/base.factory.js +0 -0
  222. /package/dist/module/{communication → integration}/factories/whatsapp.factory.js +0 -0
  223. /package/dist/module/{communication → integration}/service/calendar-event.service.d.ts +0 -0
  224. /package/dist/module/{communication → integration}/service/calendar-event.service.js +0 -0
  225. /package/dist/module/{communication → integration}/service/oauth.service.d.ts +0 -0
  226. /package/dist/module/{communication → integration}/strategies/email/outlook-api.strategy.js +0 -0
  227. /package/dist/module/{communication → integration}/strategies/email/outlook.strategy.js +0 -0
  228. /package/dist/module/{communication → integration}/strategies/email/sendgrid-api.strategy.js +0 -0
  229. /package/dist/module/{communication → integration}/strategies/whatsapp/whatsapp-cloud.strategy.js +0 -0
  230. /package/dist/module/{communication → integration}/strategies/whatsapp/whatsapp.strategy.js +0 -0
  231. /package/src/module/{communication → integration}/controller/calender-event.controller.ts +0 -0
  232. /package/src/module/{communication → integration}/controller/wrapper.controller.ts +0 -0
  233. /package/src/module/{communication → integration}/service/calendar-event.service.ts +0 -0
@@ -11,50 +11,53 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
- var CommunicationService_1;
14
+ var IntegrationService_1;
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.CommunicationService = void 0;
16
+ exports.IntegrationService = void 0;
17
17
  const common_1 = require("@nestjs/common");
18
18
  const typeorm_1 = require("@nestjs/typeorm");
19
19
  const typeorm_2 = require("typeorm");
20
20
  const config_1 = require("@nestjs/config");
21
21
  const googleapis_1 = require("googleapis");
22
- const communication_hub_entity_1 = require("../entity/communication-hub.entity");
23
- const communication_config_entity_1 = require("../entity/communication-config.entity");
24
- const communication_factory_1 = require("../factories/communication.factory");
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_factory_1 = require("../factories/integration.factory");
25
25
  const gmail_api_strategy_1 = require("../strategies/email/gmail-api.strategy");
26
26
  const sendgrid_api_strategy_1 = require("../strategies/email/sendgrid-api.strategy");
27
- const communication_queue_service_1 = require("./communication-queue.service");
28
- let CommunicationService = CommunicationService_1 = class CommunicationService {
29
- constructor(hubRepository, configRepository, communicationFactory, gmailApiStrategy, sendGridApiStrategy, configService, queueService) {
30
- this.hubRepository = hubRepository;
27
+ const integration_queue_service_1 = require("./integration-queue.service");
28
+ let IntegrationService = IntegrationService_1 = class IntegrationService {
29
+ constructor(configRepository, userIntegrationRepository, integrationFactory, gmailApiStrategy, sendGridApiStrategy, configService, queueService) {
31
30
  this.configRepository = configRepository;
32
- this.communicationFactory = communicationFactory;
31
+ this.userIntegrationRepository = userIntegrationRepository;
32
+ this.integrationFactory = integrationFactory;
33
33
  this.gmailApiStrategy = gmailApiStrategy;
34
34
  this.sendGridApiStrategy = sendGridApiStrategy;
35
35
  this.configService = configService;
36
36
  this.queueService = queueService;
37
- this.logger = new common_1.Logger(CommunicationService_1.name);
37
+ this.logger = new common_1.Logger(IntegrationService_1.name);
38
38
  this.gmailOAuthStates = new Map();
39
39
  }
40
- async sendMessage({ levelId, levelType, to, message, mode, priority = 1, }) {
40
+ deriveServiceType(integration_type, integration_provider, config_json) {
41
+ return 'API';
42
+ }
43
+ async sendMessage({ levelId, levelType, app_code, to, message, mode, priority = 1, user_id, }) {
41
44
  try {
42
- const hubs = await this.getActiveHubs(levelId, levelType, mode);
43
- if (!hubs.length) {
45
+ const configs = await this.getActiveConfigs(levelId, levelType, app_code, mode);
46
+ if (!configs.length) {
44
47
  throw new Error(`No active communication configuration found for ${levelType} ${levelId}`);
45
48
  }
46
- const sortedHubs = this.sortHubsByPriority(hubs, priority);
47
- for (const hub of sortedHubs) {
49
+ const sortedConfigs = this.sortConfigsByPriority(configs, priority);
50
+ for (const config of sortedConfigs) {
48
51
  try {
49
- const result = await this.sendViaHub(hub, to, message);
52
+ const result = await this.sendViaConfig(config, to, message, user_id);
50
53
  if (result.success) {
51
- this.logger.log(`Message sent successfully via ${hub.provider}/${hub.service}`);
54
+ this.logger.log(`Message sent successfully via ${config.integration_provider}`);
52
55
  return result;
53
56
  }
54
- this.logger.warn(`Failed to send via ${hub.provider}/${hub.service}: ${result.error}`);
57
+ this.logger.warn(`Failed to send via ${config.integration_provider}: ${result.error}`);
55
58
  }
56
59
  catch (error) {
57
- this.logger.error(`Error sending via ${hub.provider}/${hub.service}:`, error.message);
60
+ this.logger.error(`Error sending via ${config.integration_provider}:`, error.message);
58
61
  continue;
59
62
  }
60
63
  }
@@ -65,74 +68,50 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
65
68
  throw error;
66
69
  }
67
70
  }
68
- async getActiveHubs(levelId, levelType, mode) {
69
- let query = this.hubRepository
70
- .createQueryBuilder('hub')
71
- .leftJoin('cr_communication_config', 'config', 'config.id = hub.config_id')
72
- .select([
73
- 'hub.id as hub_id',
74
- 'hub.level_id as hub_level_id',
75
- 'hub.level_type as hub_level_type',
76
- 'hub.status as hub_status',
77
- 'hub.config_id as hub_config_id',
78
- 'hub.communication_config_type as hub_communication_config_type',
79
- 'hub.service as hub_service',
80
- 'hub.provider as hub_provider',
81
- 'hub.priority as hub_priority',
82
- 'hub.is_default as hub_is_default',
83
- 'hub.created_at as hub_created_at',
84
- 'hub.updated_at as hub_updated_at',
85
- 'config.id as config_id',
86
- 'config.config_json as config_json',
87
- 'config.created_at as config_created_at',
88
- 'config.updated_at as config_updated_at',
89
- ])
90
- .where('hub.level_id = :levelId', { levelId })
91
- .andWhere('hub.level_type = :levelType', { levelType })
92
- .andWhere('hub.status = :status', { status: 1 });
71
+ async getActiveConfigs(levelId, levelType, app_code, mode) {
72
+ const queryBuilder = this.configRepository
73
+ .createQueryBuilder('config')
74
+ .where('config.level_id = :levelId', { levelId })
75
+ .andWhere('config.level_type = :levelType', { levelType })
76
+ .andWhere('config.app_code = :app_code', { app_code })
77
+ .andWhere('config.status = 1');
93
78
  if (mode) {
94
- query = query.andWhere('hub.communication_config_type = :mode', { mode });
95
- }
96
- const results = await query.getRawMany();
97
- const hubsWithConfig = results.map((row) => ({
98
- id: row.hub_id,
99
- level_id: row.hub_level_id,
100
- level_type: row.hub_level_type,
101
- status: row.hub_status,
102
- config_id: row.hub_config_id,
103
- communication_config_type: row.hub_communication_config_type,
104
- service: row.hub_service,
105
- provider: row.hub_provider,
106
- priority: row.hub_priority || 1,
107
- is_default: row.hub_is_default || false,
108
- created_at: row.hub_created_at,
109
- updated_at: row.hub_updated_at,
110
- config: {
111
- id: row.config_id,
112
- config_json: row.config_json,
113
- created_at: row.config_created_at,
114
- updated_at: row.config_updated_at,
115
- },
116
- }));
117
- return hubsWithConfig;
79
+ queryBuilder.andWhere('config.integration_type = :mode', { mode });
80
+ }
81
+ return await queryBuilder.getMany();
118
82
  }
119
- sortHubsByPriority(hubs, _priority) {
120
- return hubs;
83
+ sortConfigsByPriority(configs, _priority) {
84
+ return configs.sort((a, b) => {
85
+ if (a.is_default !== b.is_default) {
86
+ return a.is_default ? -1 : 1;
87
+ }
88
+ return a.priority - b.priority;
89
+ });
121
90
  }
122
- async sendViaHub(hub, to, message) {
123
- const strategy = this.communicationFactory.create(hub.communication_config_type, hub.service, hub.provider);
124
- const result = await strategy.sendMessage(to, message, hub.config.config_json);
91
+ async sendViaConfig(config, to, message, user_id) {
92
+ const strategy = this.integrationFactory.create(config.integration_type, 'API', config.integration_provider);
93
+ let finalConfig = config.config_json;
94
+ if (user_id) {
95
+ const userIntegrationData = await this.getUserIntegrationForStrategy(user_id, config.id);
96
+ if (userIntegrationData) {
97
+ finalConfig = {
98
+ ...config.config_json,
99
+ external_user_id: userIntegrationData.external_user_id,
100
+ };
101
+ }
102
+ }
103
+ const result = await strategy.sendMessage(to, message, finalConfig);
125
104
  if (result.refreshedToken && result.success) {
126
105
  try {
127
- const currentConfig = hub.config.config_json;
106
+ const currentConfig = config.config_json;
128
107
  const updatedConfig = {
129
108
  ...currentConfig,
130
109
  accessToken: result.refreshedToken,
131
110
  };
132
- await this.configRepository.update(hub.config.id, {
111
+ await this.configRepository.update(config.id, {
133
112
  config_json: updatedConfig,
134
113
  });
135
- this.logger.log(`Updated access token for ${hub.provider}/${hub.service} configuration`);
114
+ this.logger.log(`Updated access token for ${config.integration_provider} configuration`);
136
115
  }
137
116
  catch (error) {
138
117
  this.logger.warn(`Failed to update refreshed token in database: ${error.message}`);
@@ -140,53 +119,60 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
140
119
  }
141
120
  return result;
142
121
  }
143
- async createCommunicationConfig(levelId, levelType, configType, service, provider, config, priority, is_default) {
144
- await this.validateUniqueActiveConfig(levelId, levelType, configType);
122
+ async createIntegrationConfig(levelId, levelType, app_code, configType, provider, integration_source_id, config, priority, is_default) {
123
+ await this.validateUniqueActiveConfig(levelId, levelType, app_code, configType, provider);
124
+ await this.configRepository.update({
125
+ level_id: levelId,
126
+ level_type: levelType,
127
+ app_code: app_code,
128
+ integration_type: configType,
129
+ status: 1,
130
+ }, { status: 0 });
145
131
  const supportedCombinations = await this.getSupportedCombinations();
146
- const isValidCombination = supportedCombinations.some((combo) => combo.mode === configType &&
147
- combo.service.toLowerCase() === service.toLowerCase() &&
132
+ const validCombination = supportedCombinations.find((combo) => combo.mode === configType &&
148
133
  combo.provider.toLowerCase() === provider.toLowerCase());
149
- if (!isValidCombination) {
150
- throw new Error(`Unsupported combination: ${configType}/${service}/${provider}`);
134
+ if (!validCombination) {
135
+ throw new Error(`Unsupported combination: ${configType}/${provider}`);
151
136
  }
152
- const requiresOAuth = this.requiresOAuthFlow(configType, service, provider, config);
137
+ const service = validCombination.service;
138
+ const requiresOAuth = this.requiresOAuthFlow(configType, provider, config);
153
139
  if (requiresOAuth) {
154
- return await this.generateOAuthUrl(levelId, levelType, configType, service, provider, config, priority, is_default);
140
+ return await this.generateOAuthUrl(levelId, levelType, app_code, configType, provider, integration_source_id, config, priority, is_default);
155
141
  }
156
- return await this.createDirectConfig(levelId, levelType, configType, service, provider, config, priority, is_default);
142
+ return await this.createDirectConfig(levelId, levelType, app_code, configType, provider, integration_source_id, config, priority, is_default);
157
143
  }
158
144
  getSupportedCombinations() {
159
- return this.communicationFactory.getAllSupportedCombinations();
145
+ return this.integrationFactory.getAllSupportedCombinations();
160
146
  }
161
147
  async getLevelConfigs(levelId, levelType, filters) {
162
148
  const where = { level_id: levelId, level_type: levelType };
163
- if (filters?.communication_config_type) {
164
- where.communication_config_type = filters.communication_config_type;
149
+ if (filters?.app_code) {
150
+ where.app_code = filters.app_code;
165
151
  }
166
- if (filters?.service) {
167
- where.service = filters.service;
152
+ if (filters?.integration_type) {
153
+ where.integration_type = filters.integration_type;
168
154
  }
169
- if (filters?.provider) {
170
- where.provider = filters.provider;
155
+ if (filters?.integration_provider) {
156
+ where.integration_provider = filters.integration_provider;
171
157
  }
172
- const hubs = await this.hubRepository.find({
158
+ const hubs = await this.configRepository.find({
173
159
  where,
174
160
  order: { created_at: 'DESC' },
175
161
  });
176
162
  const enhancedHubs = await Promise.all(hubs.map(async (hub) => {
177
163
  try {
178
- const config = await this.configRepository.findOne({
179
- where: { id: hub.config_id },
164
+ const relatedConfig = await this.configRepository.findOne({
165
+ where: { id: hub.id },
180
166
  });
181
- if (!config) {
167
+ if (!relatedConfig) {
182
168
  return {
183
169
  ...hub,
184
170
  linkedSource: 'Configuration not found',
185
171
  configDetails: null,
186
172
  };
187
173
  }
188
- const linkedSource = this.extractLinkedSource(hub.communication_config_type, hub.service, hub.provider, config.config_json);
189
- const configDetails = this.extractConfigDetails(hub.communication_config_type, hub.service, hub.provider, config.config_json);
174
+ const linkedSource = this.extractLinkedSource(hub.integration_type, hub.integration_provider, relatedConfig.config_json);
175
+ const configDetails = this.extractConfigDetails(hub.integration_type, hub.integration_provider, relatedConfig.config_json);
190
176
  return {
191
177
  ...hub,
192
178
  linkedSource,
@@ -204,14 +190,14 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
204
190
  }));
205
191
  return enhancedHubs;
206
192
  }
207
- extractLinkedSource(configType, service, provider, configJson) {
208
- const key = `${configType.toLowerCase()}_${service.toLowerCase()}_${provider.toLowerCase()}`;
193
+ extractLinkedSource(configType, provider, configJson) {
194
+ const key = `${configType.toLowerCase()}_${provider.toLowerCase()}`;
209
195
  try {
210
196
  switch (key) {
211
- case 'email_api_gmail':
197
+ case 'email_gmail':
212
198
  case 'email_smtp_gmail':
213
199
  return configJson?.email || 'Gmail account not configured';
214
- case 'email_api_outlook':
200
+ case 'email_outlook':
215
201
  case 'email_smtp_outlook':
216
202
  return configJson?.email || 'Outlook account not configured';
217
203
  case 'wa_api_whatsapp':
@@ -234,8 +220,8 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
234
220
  return configJson?.userName
235
221
  ? `Ozonetel Voice: ${configJson.userName}`
236
222
  : 'Ozonetel voice not configured';
237
- case 'email_api_aws-ses':
238
- case 'email_api_ses':
223
+ case 'email_aws-ses':
224
+ case 'email_ses':
239
225
  return configJson?.fromEmail || 'AWS SES not configured';
240
226
  case 'email_smtp_sendgrid':
241
227
  return configJson?.from || 'SendGrid not configured';
@@ -262,11 +248,11 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
262
248
  return 'Configuration error';
263
249
  }
264
250
  }
265
- extractConfigDetails(configType, service, provider, configJson) {
266
- const key = `${configType.toLowerCase()}_${service.toLowerCase()}_${provider.toLowerCase()}`;
251
+ extractConfigDetails(configType, provider, configJson) {
252
+ const key = `${configType.toLowerCase()}_${provider.toLowerCase()}`;
267
253
  try {
268
254
  switch (key) {
269
- case 'email_api_gmail':
255
+ case 'email_gmail':
270
256
  return {
271
257
  email: configJson?.email,
272
258
  authMethod: configJson?.authMethod || 'OAUTH2',
@@ -281,7 +267,7 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
281
267
  authMethod: 'SMTP',
282
268
  hasPassword: !!configJson?.password,
283
269
  };
284
- case 'email_api_outlook':
270
+ case 'email_outlook':
285
271
  return {
286
272
  email: configJson?.email,
287
273
  authMethod: 'OAUTH2',
@@ -329,8 +315,8 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
329
315
  agentLoginUrl: configJson?.agentLoginUrl,
330
316
  hasApiKey: !!configJson?.apiKey,
331
317
  };
332
- case 'email_api_aws-ses':
333
- case 'email_api_ses':
318
+ case 'email_aws-ses':
319
+ case 'email_ses':
334
320
  return {
335
321
  fromEmail: configJson?.fromEmail,
336
322
  region: configJson?.region,
@@ -398,102 +384,86 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
398
384
  }
399
385
  }
400
386
  async updateConfigStatus(hubId, status) {
401
- const hub = await this.hubRepository.findOne({
387
+ const config = await this.configRepository.findOne({
402
388
  where: { id: hubId },
403
389
  });
404
- if (!hub) {
405
- throw new Error('Communication configuration not found');
390
+ if (!config) {
391
+ throw new Error('Integration configuration not found');
406
392
  }
407
393
  if (status === 1) {
408
- await this.hubRepository.update({
409
- level_id: hub.level_id,
410
- level_type: hub.level_type,
411
- communication_config_type: hub.communication_config_type,
394
+ await this.configRepository.update({
395
+ level_id: config.level_id,
396
+ level_type: config.level_type,
397
+ app_code: config.app_code,
398
+ integration_type: config.integration_type,
412
399
  status: 1,
413
400
  id: (0, typeorm_2.Not)(hubId),
414
401
  }, { status: 0 });
415
402
  }
416
- await this.hubRepository.update(hubId, { status });
403
+ await this.configRepository.update(hubId, { status });
417
404
  }
418
- async deleteConfiguration(hubId) {
419
- const hub = await this.hubRepository.findOne({
420
- where: { id: hubId },
405
+ async deleteConfiguration(configId) {
406
+ const config = await this.configRepository.findOne({
407
+ where: { id: configId },
421
408
  });
422
- if (!hub) {
423
- throw new Error('Communication configuration not found');
409
+ if (!config) {
410
+ throw new Error('Integration configuration not found');
424
411
  }
425
- await this.hubRepository.delete(hubId);
426
- await this.configRepository.delete(hub.config_id);
427
- this.logger.log(`Communication configuration deleted: Hub ${hubId}, Config ${hub.config_id}`);
412
+ await this.configRepository.delete(configId);
413
+ this.logger.log(`Integration configuration deleted: ${configId}`);
428
414
  }
429
415
  async updateConfiguration(hubId, updateData) {
430
- const hub = await this.hubRepository.findOne({
416
+ const config = await this.configRepository.findOne({
431
417
  where: { id: hubId },
432
418
  });
433
- if (!hub) {
434
- throw new Error('Communication configuration not found');
419
+ if (!config) {
420
+ throw new Error('Integration configuration not found');
435
421
  }
436
422
  if (updateData.config) {
437
- const existingConfig = await this.configRepository.findOne({
438
- where: { id: hub.config_id },
439
- });
440
- if (!existingConfig) {
441
- throw new Error('Configuration record not found');
442
- }
443
423
  const updatedConfigJson = {
444
- ...existingConfig.config_json,
424
+ ...config.config_json,
445
425
  ...updateData.config,
446
426
  };
447
- await this.configRepository.update(hub.config_id, {
427
+ await this.configRepository.update(config.id, {
448
428
  config_json: updatedConfigJson,
449
429
  });
450
430
  }
451
- if (updateData.status === 1) {
452
- await this.validateUniqueActiveConfig(hub.level_id, hub.level_type, hub.communication_config_type, hubId);
453
- }
454
431
  if (updateData.is_default === true) {
455
- await this.hubRepository.update({
456
- level_id: hub.level_id,
457
- level_type: hub.level_type,
458
- communication_config_type: hub.communication_config_type,
432
+ await this.configRepository.update({
433
+ level_id: config.level_id,
434
+ level_type: config.level_type,
435
+ integration_type: config.integration_type,
459
436
  id: (0, typeorm_2.Not)(hubId),
460
437
  }, { is_default: false });
461
438
  }
462
- const hubUpdateData = {};
463
- if (updateData.priority !== undefined) {
464
- hubUpdateData.priority = updateData.priority;
439
+ const directUpdates = {};
440
+ if (updateData.priority !== undefined)
441
+ directUpdates.priority = updateData.priority;
442
+ if (updateData.is_default !== undefined)
443
+ directUpdates.is_default = updateData.is_default;
444
+ if (updateData.status !== undefined)
445
+ directUpdates.status = updateData.status;
446
+ if (Object.keys(directUpdates).length > 0) {
447
+ await this.configRepository.update(config.id, directUpdates);
465
448
  }
466
- if (updateData.is_default !== undefined) {
467
- hubUpdateData.is_default = updateData.is_default;
468
- }
469
- if (updateData.status !== undefined) {
470
- hubUpdateData.status = updateData.status;
471
- }
472
- if (Object.keys(hubUpdateData).length > 0) {
473
- await this.hubRepository.update(hubId, hubUpdateData);
474
- }
475
- const updatedHub = await this.hubRepository.findOne({
476
- where: { id: hubId },
477
- });
478
449
  const updatedConfig = await this.configRepository.findOne({
479
- where: { id: hub.config_id },
450
+ where: { id: hubId },
480
451
  });
481
- this.logger.log(`Communication configuration updated: Hub ${hubId}, Type ${hub.communication_config_type}`);
482
452
  return {
483
- ...updatedHub,
453
+ ...updatedConfig,
484
454
  config: updatedConfig?.config_json,
485
455
  };
486
456
  }
487
457
  async sendGenericMessage(messageDto) {
488
458
  try {
489
- const { levelId, levelType, to, message, type, priority = 'medium', subject, html, cc, bcc, attachments, mediaUrl, templateId, variables, } = messageDto;
459
+ const { levelId, levelType, app_code, to, message, type, priority = 'medium', subject, html, cc, bcc, attachments, mediaUrl, templateId, variables, user_id, } = messageDto;
490
460
  const communicationType = this.detectCommunicationType(to, type);
491
- const hubs = await this.getActiveHubs(levelId, levelType, communicationType);
492
- if (!hubs.length) {
493
- this.logger.warn(`No communication hubs found for ${levelType} ${levelId}. Please configure communication providers using the createCommunicationConfig method.`);
461
+ const configs = await this.getActiveConfigs(levelId, levelType, app_code, communicationType);
462
+ if (!configs.length) {
463
+ this.logger.warn(`No communication hubs found for ${levelType} ${levelId}. Please configure integration providers using the createIntegrationConfig method.`);
494
464
  throw new Error(`No active ${communicationType} configuration found for ${levelType} ${levelId}. Please configure a communication provider first.`);
495
465
  }
496
- const sortedHubs = this.sortHubsByPriorityAndDefault(hubs, priority);
466
+ const sortedConfigs = this.sortConfigsByPriorityAndDefault(configs, priority);
497
467
  const enhancedConfig = {
498
468
  subject,
499
469
  html,
@@ -506,30 +476,40 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
506
476
  const results = [];
507
477
  let hasSuccess = false;
508
478
  for (const recipient of to) {
509
- for (const hub of sortedHubs) {
479
+ for (const hub of sortedConfigs) {
510
480
  try {
511
- const strategy = this.communicationFactory.create(hub.communication_config_type, hub.service, hub.provider);
481
+ const serviceType = this.deriveServiceType(hub.integration_type, hub.integration_provider, hub.config_json);
482
+ const strategy = this.integrationFactory.create(hub.integration_type, serviceType, hub.integration_provider);
512
483
  let processedMessage = message;
513
484
  if (templateId && variables) {
514
485
  processedMessage = this.processTemplate(message, variables);
515
486
  }
516
- const finalConfig = {
517
- ...hub.config.config_json,
487
+ let finalConfig = {
488
+ ...hub.config_json,
518
489
  ...enhancedConfig,
519
490
  templateId,
520
491
  variables,
521
492
  };
493
+ if (user_id) {
494
+ const userIntegrationData = await this.getUserIntegrationForStrategy(user_id, hub.id);
495
+ if (userIntegrationData) {
496
+ finalConfig = {
497
+ ...finalConfig,
498
+ external_user_id: userIntegrationData.external_user_id,
499
+ };
500
+ }
501
+ }
522
502
  const result = await strategy.sendMessage(recipient, processedMessage, finalConfig);
523
503
  if (result.success) {
524
- this.logger.log(`Generic message sent successfully via ${hub.provider}/${hub.service} to ${recipient}`);
504
+ this.logger.log(`Generic message sent successfully via ${hub.integration_provider} to ${recipient}`);
525
505
  results.push(result);
526
506
  hasSuccess = true;
527
507
  break;
528
508
  }
529
- this.logger.warn(`Failed to send via ${hub.provider}/${hub.service} to ${recipient}: ${result.error}`);
509
+ this.logger.warn(`Failed to send via ${hub.integration_provider} to ${recipient}: ${result.error}`);
530
510
  }
531
511
  catch (error) {
532
- this.logger.error(`Error sending via ${hub.provider}/${hub.service} to ${recipient}:`, error.message);
512
+ this.logger.error(`Error sending via ${hub.integration_provider} to ${recipient}:`, error.message);
533
513
  continue;
534
514
  }
535
515
  }
@@ -545,28 +525,38 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
545
525
  }
546
526
  }
547
527
  else {
548
- for (const hub of sortedHubs) {
528
+ for (const hub of sortedConfigs) {
549
529
  try {
550
- const strategy = this.communicationFactory.create(hub.communication_config_type, hub.service, hub.provider);
530
+ const serviceType = this.deriveServiceType(hub.integration_type, hub.integration_provider, hub.config_json);
531
+ const strategy = this.integrationFactory.create(hub.integration_type, serviceType, hub.integration_provider);
551
532
  let processedMessage = message;
552
533
  if (html && variables) {
553
534
  processedMessage = this.processTemplate(html ? html : message, variables);
554
535
  }
555
- const finalConfig = {
556
- ...hub.config.config_json,
536
+ let finalConfig = {
537
+ ...hub.config_json,
557
538
  ...enhancedConfig,
558
539
  templateId,
559
540
  variables,
560
541
  };
542
+ if (user_id) {
543
+ const userIntegrationData = await this.getUserIntegrationForStrategy(user_id, hub.id);
544
+ if (userIntegrationData) {
545
+ finalConfig = {
546
+ ...finalConfig,
547
+ external_user_id: userIntegrationData.external_user_id,
548
+ };
549
+ }
550
+ }
561
551
  const result = await strategy.sendMessage(to, processedMessage, finalConfig);
562
552
  if (result.success) {
563
- this.logger.log(`Generic message sent successfully via ${hub.provider}/${hub.service} to ${to}`);
553
+ this.logger.log(`Generic message sent successfully via ${hub.integration_provider} to ${to}`);
564
554
  return result;
565
555
  }
566
- this.logger.warn(`Failed to send via ${hub.provider}/${hub.service}: ${result.error}`);
556
+ this.logger.warn(`Failed to send via ${hub.integration_provider}: ${result.error}`);
567
557
  }
568
558
  catch (error) {
569
- this.logger.error(`Error sending via ${hub.provider}/${hub.service}:`, error.message);
559
+ this.logger.error(`Error sending via ${hub.integration_provider}:`, error.message);
570
560
  continue;
571
561
  }
572
562
  }
@@ -580,7 +570,7 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
580
570
  }
581
571
  async sendBulkMessage(bulkDto) {
582
572
  try {
583
- const { levelId, levelType, recipients, message, type, priority = 'low', subject, html, templateId, variables, batchSize = 10, } = bulkDto;
573
+ const { levelId, levelType, app_code, recipients, message, type, priority = 'low', subject, html, templateId, variables, batchSize = 10, } = bulkDto;
584
574
  const results = [];
585
575
  const batches = this.chunkArray(recipients, batchSize);
586
576
  for (let i = 0; i < batches.length; i++) {
@@ -591,6 +581,7 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
591
581
  const messageDto = {
592
582
  levelId,
593
583
  levelType,
584
+ app_code,
594
585
  to: recipient,
595
586
  message,
596
587
  type,
@@ -663,6 +654,7 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
663
654
  const messageDto = {
664
655
  levelId: templateDto.levelId,
665
656
  levelType: templateDto.levelType,
657
+ app_code: templateDto.app_code,
666
658
  to: templateDto.to,
667
659
  message: processedMessage,
668
660
  subject: processedSubject,
@@ -678,15 +670,15 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
678
670
  }
679
671
  const recipient = Array.isArray(to) ? to[0] : to;
680
672
  if (recipient.includes('@')) {
681
- return communication_hub_entity_1.CommunicationConfigType.EMAIL;
673
+ return 'EMAIL';
682
674
  }
683
675
  if (/^\+?[\d\s\-\(\)]+$/.test(recipient)) {
684
- return communication_hub_entity_1.CommunicationConfigType.SMS;
676
+ return 'SMS';
685
677
  }
686
- return communication_hub_entity_1.CommunicationConfigType.EMAIL;
678
+ return 'EMAIL';
687
679
  }
688
- sortHubsByPriorityAndDefault(hubs, _priority) {
689
- return hubs.sort((a, b) => {
680
+ sortConfigsByPriorityAndDefault(configs, _priority) {
681
+ return configs.sort((a, b) => {
690
682
  if (a.is_default !== b.is_default) {
691
683
  return b.is_default ? 1 : -1;
692
684
  }
@@ -716,7 +708,7 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
716
708
  }
717
709
  return chunks;
718
710
  }
719
- async initGmailOAuth(levelId, levelType, email) {
711
+ async initGmailOAuth(levelId, levelType, app_code, email) {
720
712
  try {
721
713
  const clientId = this.configService.get('CLIENT_ID');
722
714
  const clientSecret = this.configService.get('CLIENT_SECRET');
@@ -729,6 +721,7 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
729
721
  this.gmailOAuthStates.set(state, {
730
722
  levelId,
731
723
  levelType,
724
+ app_code,
732
725
  email,
733
726
  timestamp: Date.now(),
734
727
  });
@@ -795,24 +788,23 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
795
788
  tokenType: tokens.token_type,
796
789
  expiryDate: tokens.expiry_date,
797
790
  };
798
- await this.validateUniqueActiveConfig(oauthState.levelId, oauthState.levelType, communication_hub_entity_1.CommunicationConfigType.EMAIL);
799
- const communicationConfig = this.configRepository.create({
800
- config_json: gmailConfig,
801
- });
802
- const savedConfig = await this.configRepository.save(communicationConfig);
803
- const hub = this.hubRepository.create({
791
+ await this.validateUniqueActiveConfig(oauthState.levelId, oauthState.levelType, oauthState.app_code, 'EMAIL', 'gmail');
792
+ const config = this.configRepository.create({
793
+ app_code: oauthState.app_code,
794
+ integration_type: 'EMAIL',
795
+ integration_provider: 'gmail',
796
+ integration_source_id: 1,
804
797
  level_id: oauthState.levelId,
805
798
  level_type: oauthState.levelType,
806
- config_id: savedConfig.id,
807
- communication_config_type: communication_hub_entity_1.CommunicationConfigType.EMAIL,
808
- service: 'API',
809
- provider: 'gmail',
810
799
  status: 1,
800
+ priority: 1,
801
+ is_default: false,
802
+ config_json: gmailConfig,
811
803
  });
812
- const savedHub = await this.hubRepository.save(hub);
804
+ const savedConfig = await this.configRepository.save(config);
813
805
  this.logger.log(`Gmail OAuth configuration created successfully for ${oauthState.levelType} ${oauthState.levelId} and email ${email}`);
814
806
  return {
815
- hubId: savedHub.id,
807
+ hubId: savedConfig.id,
816
808
  configId: savedConfig.id,
817
809
  };
818
810
  }
@@ -834,7 +826,7 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
834
826
  if (oauthState.email && oauthState.email !== email) {
835
827
  throw new Error('Email mismatch with OAuth hint');
836
828
  }
837
- await this.validateUniqueActiveConfig(oauthState.levelId, oauthState.levelType, communication_hub_entity_1.CommunicationConfigType.EMAIL);
829
+ await this.validateUniqueActiveConfig(oauthState.levelId, oauthState.levelType, oauthState.app_code, 'EMAIL', 'gmail');
838
830
  const gmailConfig = {
839
831
  email: email,
840
832
  accessToken: accessToken,
@@ -845,23 +837,22 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
845
837
  'https://www.googleapis.com/auth/userinfo.email',
846
838
  ],
847
839
  };
848
- const communicationConfig = this.configRepository.create({
849
- config_json: gmailConfig,
850
- });
851
- const savedConfig = await this.configRepository.save(communicationConfig);
852
- const hub = this.hubRepository.create({
840
+ const config = this.configRepository.create({
841
+ app_code: oauthState.app_code,
842
+ integration_type: 'EMAIL',
843
+ integration_provider: 'gmail',
844
+ integration_source_id: 1,
853
845
  level_id: oauthState.levelId,
854
846
  level_type: oauthState.levelType,
855
- config_id: savedConfig.id,
856
- communication_config_type: communication_hub_entity_1.CommunicationConfigType.EMAIL,
857
- service: 'API',
858
- provider: 'gmail',
859
847
  status: 1,
848
+ priority: 1,
849
+ is_default: false,
850
+ config_json: gmailConfig,
860
851
  });
861
- const savedHub = await this.hubRepository.save(hub);
852
+ const savedConfig = await this.configRepository.save(config);
862
853
  this.logger.log(`Gmail tokens configuration created successfully for ${oauthState.levelType} ${oauthState.levelId} and email ${email}`);
863
854
  return {
864
- hubId: savedHub.id,
855
+ hubId: savedConfig.id,
865
856
  configId: savedConfig.id,
866
857
  };
867
858
  }
@@ -872,19 +863,13 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
872
863
  }
873
864
  async testGmailConfig(hubId) {
874
865
  try {
875
- const hub = await this.hubRepository.findOne({
866
+ const integrationConfig = await this.configRepository.findOne({
876
867
  where: { id: hubId },
877
868
  });
878
- if (!hub) {
879
- throw new Error('Communication hub not found');
880
- }
881
- const config = await this.configRepository.findOne({
882
- where: { id: hub.config_id },
883
- });
884
- if (!config) {
885
- throw new Error('Configuration not found');
869
+ if (!integrationConfig) {
870
+ throw new Error('Integration config not found');
886
871
  }
887
- const isValid = await this.gmailApiStrategy.validateConnection(config.config_json);
872
+ const isValid = await this.gmailApiStrategy.validateConnection(integrationConfig.config_json);
888
873
  if (!isValid) {
889
874
  return {
890
875
  success: false,
@@ -901,89 +886,89 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
901
886
  generateSecureState() {
902
887
  return Math.random().toString(36).substring(2) + Date.now().toString(36);
903
888
  }
904
- async validateUniqueActiveConfig(levelId, levelType, configType, excludeHubId) {
905
- const query = this.hubRepository
889
+ async validateUniqueActiveConfig(levelId, levelType, app_code, configType, provider, excludeHubId) {
890
+ const query = this.configRepository
906
891
  .createQueryBuilder('hub')
907
892
  .where('hub.level_id = :levelId', { levelId })
908
893
  .andWhere('hub.level_type = :levelType', { levelType })
909
- .andWhere('hub.communication_config_type = :configType', { configType })
894
+ .andWhere('hub.app_code = :app_code', { app_code })
895
+ .andWhere('hub.integration_type = :configType', { configType })
896
+ .andWhere('hub.integration_provider = :provider', { provider })
910
897
  .andWhere('hub.status = :status', { status: 1 });
911
898
  if (excludeHubId) {
912
899
  query.andWhere('hub.id != :excludeHubId', { excludeHubId });
913
900
  }
914
901
  const existingActiveConfigs = await query.getMany();
915
902
  if (existingActiveConfigs.length > 0) {
916
- await this.hubRepository.update({
917
- level_id: levelId,
918
- level_type: levelType,
919
- communication_config_type: configType,
920
- status: 1,
921
- ...(excludeHubId && { id: (0, typeorm_2.Not)(excludeHubId) }),
922
- }, { status: 0 });
923
- this.logger.log(`Deactivated ${existingActiveConfigs.length} existing ${configType} configuration(s) for ${levelType} ${levelId} to maintain single active provider rule.`);
903
+ throw new Error(`A ${provider} configuration already exists for ${configType} in app_code ${app_code}, ${levelType} ${levelId}. Only one configuration per provider is allowed.`);
924
904
  }
925
905
  }
926
- requiresOAuthFlow(configType, service, provider, config) {
927
- const key = `${configType.toLowerCase()}_${service.toLowerCase()}_${provider.toLowerCase()}`;
906
+ requiresOAuthFlow(configType, provider, config) {
907
+ const key = `${configType.toLowerCase()}_${provider.toLowerCase()}`;
928
908
  switch (key) {
929
- case 'email_api_gmail':
909
+ case 'email_gmail':
930
910
  return !config.accessToken || config.useOAuth === true;
931
- case 'email_api_outlook':
911
+ case 'email_outlook':
932
912
  return !config.accessToken || config.useOAuth === true;
933
913
  default:
934
914
  return false;
935
915
  }
936
916
  }
937
- async generateOAuthUrl(levelId, levelType, configType, service, provider, config, priority, is_default) {
938
- const key = `${configType.toLowerCase()}_${service.toLowerCase()}_${provider.toLowerCase()}`;
917
+ async generateOAuthUrl(levelId, levelType, app_code, configType, provider, integration_source_id, config, priority, is_default) {
918
+ const key = `${configType.toLowerCase()}_${provider.toLowerCase()}`;
939
919
  switch (key) {
940
- case 'email_api_gmail':
941
- const gmailResult = await this.initGmailOAuth(levelId, levelType, config.email);
920
+ case 'email_gmail':
921
+ const gmailResult = await this.initGmailOAuth(levelId, levelType, app_code, config.email);
942
922
  return {
943
923
  authUrl: gmailResult.authUrl,
944
924
  state: gmailResult.state,
945
925
  message: 'Please complete Gmail OAuth authorization. Configuration will be created automatically after authorization.',
946
926
  };
947
- case 'email_api_outlook':
948
- const outlookResult = await this.initOutlookOAuth(levelId, levelType, config.email);
927
+ case 'email_outlook':
928
+ const outlookResult = await this.initOutlookOAuth(levelId, levelType, app_code, config.email);
949
929
  return {
950
930
  authUrl: outlookResult.authUrl,
951
931
  state: outlookResult.state,
952
932
  message: 'Please complete Outlook OAuth authorization. Configuration will be created automatically after authorization.',
953
933
  };
954
934
  default:
955
- throw new Error(`OAuth not supported for ${configType}/${service}/${provider}`);
935
+ throw new Error(`OAuth not supported for ${configType}/${provider}`);
956
936
  }
957
937
  }
958
- async createDirectConfig(levelId, levelType, configType, service, provider, config, priority, is_default) {
959
- await this.validateUniqueActiveConfig(levelId, levelType, configType);
938
+ async createDirectConfig(levelId, levelType, app_code, configType, provider, integration_source_id, config, priority, is_default) {
939
+ await this.validateUniqueActiveConfig(levelId, levelType, app_code, configType, provider);
940
+ await this.configRepository.update({
941
+ level_id: levelId,
942
+ level_type: levelType,
943
+ app_code: app_code,
944
+ integration_type: configType,
945
+ status: 1,
946
+ }, { status: 0 });
960
947
  if (is_default) {
961
- await this.hubRepository.update({
948
+ await this.configRepository.update({
962
949
  level_id: levelId,
963
950
  level_type: levelType,
964
- communication_config_type: configType,
951
+ app_code: app_code,
952
+ integration_type: configType,
965
953
  }, { is_default: false });
966
954
  }
967
- const communicationConfig = this.configRepository.create({
968
- config_json: config,
969
- });
970
- const savedConfig = await this.configRepository.save(communicationConfig);
971
- const hub = this.hubRepository.create({
955
+ const integrationConfig = this.configRepository.create({
956
+ app_code: app_code,
957
+ integration_type: configType,
958
+ integration_provider: provider,
959
+ integration_source_id: integration_source_id,
972
960
  level_id: levelId,
973
961
  level_type: levelType,
974
- config_id: savedConfig.id,
975
- communication_config_type: configType,
976
- service: service,
977
- provider: provider,
962
+ status: 1,
978
963
  priority: priority || 1,
979
964
  is_default: is_default || false,
980
- status: 1,
965
+ config_json: config,
981
966
  });
982
- const savedHub = await this.hubRepository.save(hub);
983
- this.logger.log(`Communication config created: ${configType}/${service}/${provider} for ${levelType} ${levelId}`);
984
- return Array.isArray(savedHub) ? savedHub[0] : savedHub;
967
+ const savedConfig = await this.configRepository.save(integrationConfig);
968
+ this.logger.log(`Communication config created: ${configType}/${provider} for ${levelType} ${levelId}`);
969
+ return Array.isArray(savedConfig) ? savedConfig[0] : savedConfig;
985
970
  }
986
- async initOutlookOAuth(levelId, levelType, email) {
971
+ async initOutlookOAuth(levelId, levelType, app_code, email) {
987
972
  try {
988
973
  const clientId = this.configService.get('OUTLOOK_CLIENT_ID');
989
974
  const tenantId = this.configService.get('OUTLOOK_TENANT_ID');
@@ -996,6 +981,7 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
996
981
  this.gmailOAuthStates.set(state, {
997
982
  levelId,
998
983
  levelType,
984
+ app_code,
999
985
  email,
1000
986
  timestamp: Date.now(),
1001
987
  });
@@ -1064,7 +1050,7 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
1064
1050
  if (!email) {
1065
1051
  throw new Error('Failed to get user email');
1066
1052
  }
1067
- await this.validateUniqueActiveConfig(oauthState.levelId, oauthState.levelType, communication_hub_entity_1.CommunicationConfigType.EMAIL);
1053
+ await this.validateUniqueActiveConfig(oauthState.levelId, oauthState.levelType, oauthState.app_code, 'EMAIL', 'outlook');
1068
1054
  const outlookConfig = {
1069
1055
  clientId,
1070
1056
  tenantId,
@@ -1075,23 +1061,22 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
1075
1061
  tokenType: tokens.token_type,
1076
1062
  expiresIn: tokens.expires_in,
1077
1063
  };
1078
- const communicationConfig = this.configRepository.create({
1079
- config_json: outlookConfig,
1080
- });
1081
- const savedConfig = await this.configRepository.save(communicationConfig);
1082
- const hub = this.hubRepository.create({
1064
+ const config = this.configRepository.create({
1065
+ app_code: oauthState.app_code,
1066
+ integration_type: 'EMAIL',
1067
+ integration_provider: 'outlook',
1068
+ integration_source_id: 1,
1083
1069
  level_id: oauthState.levelId,
1084
1070
  level_type: oauthState.levelType,
1085
- config_id: savedConfig.id,
1086
- communication_config_type: communication_hub_entity_1.CommunicationConfigType.EMAIL,
1087
- service: 'API',
1088
- provider: 'outlook',
1089
1071
  status: 1,
1072
+ priority: 1,
1073
+ is_default: false,
1074
+ config_json: outlookConfig,
1090
1075
  });
1091
- const savedHub = await this.hubRepository.save(hub);
1076
+ const savedConfig = await this.configRepository.save(config);
1092
1077
  this.logger.log(`Outlook OAuth configuration created successfully for ${oauthState.levelType} ${oauthState.levelId} and email ${email}`);
1093
1078
  return {
1094
- hubId: savedHub.id,
1079
+ hubId: savedConfig.id,
1095
1080
  configId: savedConfig.id,
1096
1081
  };
1097
1082
  }
@@ -1100,31 +1085,19 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
1100
1085
  throw new Error(`Failed to complete Outlook OAuth: ${error.message}`);
1101
1086
  }
1102
1087
  }
1103
- async getCommunicationConfigById(hubId) {
1088
+ async getIntegrationConfigById(hubId) {
1104
1089
  try {
1105
- const hub = await this.hubRepository.findOne({
1090
+ const integrationConfig = await this.configRepository.findOne({
1106
1091
  where: { id: hubId },
1107
1092
  });
1108
- if (!hub) {
1093
+ if (!integrationConfig) {
1109
1094
  return null;
1110
1095
  }
1111
- const config = await this.configRepository.findOne({
1112
- where: { id: hub.config_id },
1113
- });
1114
- if (!config) {
1115
- this.logger.warn(`Configuration not found for hub ${hubId} with config_id ${hub.config_id}`);
1116
- return {
1117
- ...hub,
1118
- config: null,
1119
- linkedSource: 'Configuration not found',
1120
- configDetails: null,
1121
- };
1122
- }
1123
- const linkedSource = this.extractLinkedSource(hub.communication_config_type, hub.service, hub.provider, config.config_json);
1124
- const configDetails = this.extractConfigDetails(hub.communication_config_type, hub.service, hub.provider, config.config_json);
1096
+ const linkedSource = this.extractLinkedSource(integrationConfig.integration_type, integrationConfig.integration_provider, integrationConfig.config_json);
1097
+ const configDetails = this.extractConfigDetails(integrationConfig.integration_type, integrationConfig.integration_provider, integrationConfig.config_json);
1125
1098
  return {
1126
- ...hub,
1127
- config,
1099
+ ...integrationConfig,
1100
+ config: integrationConfig,
1128
1101
  linkedSource,
1129
1102
  configDetails,
1130
1103
  };
@@ -1134,17 +1107,17 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
1134
1107
  throw new Error(`Failed to fetch communication configuration: ${error.message}`);
1135
1108
  }
1136
1109
  }
1137
- async getSendGridTemplates(levelId, levelType) {
1110
+ async getSendGridTemplates(levelId, levelType, app_code) {
1138
1111
  try {
1139
- const hubs = await this.getActiveHubs(levelId, levelType, communication_hub_entity_1.CommunicationConfigType.EMAIL);
1140
- const sendGridHub = hubs.find((hub) => hub.provider === 'sendgrid');
1112
+ const hubs = await this.getActiveConfigs(levelId, levelType, app_code, 'EMAIL');
1113
+ const sendGridHub = hubs.find((hub) => hub.integration_provider === 'sendgrid');
1141
1114
  if (!sendGridHub) {
1142
1115
  return {
1143
1116
  success: false,
1144
1117
  error: 'No active SendGrid configuration found for this level',
1145
1118
  };
1146
1119
  }
1147
- const apiKey = sendGridHub.config?.config_json?.apiKey;
1120
+ const apiKey = sendGridHub.config_json?.apiKey;
1148
1121
  if (!apiKey) {
1149
1122
  return {
1150
1123
  success: false,
@@ -1179,19 +1152,130 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
1179
1152
  };
1180
1153
  }
1181
1154
  }
1155
+ async createUserIntegration(createDto) {
1156
+ try {
1157
+ const existing = await this.userIntegrationRepository.findOne({
1158
+ where: {
1159
+ user_id: createDto.user_id,
1160
+ integration_config_id: createDto.integration_config_id,
1161
+ },
1162
+ });
1163
+ if (existing) {
1164
+ throw new Error('User integration mapping already exists');
1165
+ }
1166
+ const config = await this.configRepository.findOne({
1167
+ where: { id: createDto.integration_config_id },
1168
+ });
1169
+ if (!config) {
1170
+ throw new Error('Integration configuration not found');
1171
+ }
1172
+ const userIntegration = this.userIntegrationRepository.create(createDto);
1173
+ return await this.userIntegrationRepository.save(userIntegration);
1174
+ }
1175
+ catch (error) {
1176
+ this.logger.error(`Error creating user integration mapping: ${error.message}`);
1177
+ throw error;
1178
+ }
1179
+ }
1180
+ async getUserIntegrations(userId) {
1181
+ try {
1182
+ return await this.userIntegrationRepository.find({
1183
+ where: { user_id: userId, is_active: true },
1184
+ order: { created_at: 'DESC' },
1185
+ });
1186
+ }
1187
+ catch (error) {
1188
+ this.logger.error(`Error fetching user integrations for user ${userId}: ${error.message}`);
1189
+ throw error;
1190
+ }
1191
+ }
1192
+ async getConfigUserIntegrations(configId) {
1193
+ try {
1194
+ return await this.userIntegrationRepository.find({
1195
+ where: { integration_config_id: configId, is_active: true },
1196
+ order: { created_at: 'DESC' },
1197
+ });
1198
+ }
1199
+ catch (error) {
1200
+ this.logger.error(`Error fetching user integrations for config ${configId}: ${error.message}`);
1201
+ throw error;
1202
+ }
1203
+ }
1204
+ async getUserIntegrationByUserAndConfig(userId, configId) {
1205
+ try {
1206
+ return await this.userIntegrationRepository.findOne({
1207
+ where: {
1208
+ user_id: userId,
1209
+ integration_config_id: configId,
1210
+ is_active: true,
1211
+ },
1212
+ });
1213
+ }
1214
+ catch (error) {
1215
+ this.logger.error(`Error fetching user integration for user ${userId} and config ${configId}: ${error.message}`);
1216
+ throw error;
1217
+ }
1218
+ }
1219
+ async updateUserIntegration(id, updateDto) {
1220
+ try {
1221
+ const userIntegration = await this.userIntegrationRepository.findOne({
1222
+ where: { id },
1223
+ });
1224
+ if (!userIntegration) {
1225
+ throw new Error('User integration mapping not found');
1226
+ }
1227
+ Object.assign(userIntegration, updateDto);
1228
+ return await this.userIntegrationRepository.save(userIntegration);
1229
+ }
1230
+ catch (error) {
1231
+ this.logger.error(`Error updating user integration ${id}: ${error.message}`);
1232
+ throw error;
1233
+ }
1234
+ }
1235
+ async deleteUserIntegration(id) {
1236
+ try {
1237
+ const userIntegration = await this.userIntegrationRepository.findOne({
1238
+ where: { id },
1239
+ });
1240
+ if (!userIntegration) {
1241
+ throw new Error('User integration mapping not found');
1242
+ }
1243
+ await this.userIntegrationRepository.remove(userIntegration);
1244
+ }
1245
+ catch (error) {
1246
+ this.logger.error(`Error deleting user integration ${id}: ${error.message}`);
1247
+ throw error;
1248
+ }
1249
+ }
1250
+ async getUserIntegrationForStrategy(userId, integrationConfigId) {
1251
+ try {
1252
+ const userIntegration = await this.getUserIntegrationByUserAndConfig(userId, integrationConfigId);
1253
+ if (!userIntegration) {
1254
+ return null;
1255
+ }
1256
+ return {
1257
+ external_user_id: userIntegration.external_user_id,
1258
+ external_user_data: userIntegration.external_user_data,
1259
+ };
1260
+ }
1261
+ catch (error) {
1262
+ this.logger.error(`Error fetching user integration data for strategy: ${error.message}`);
1263
+ return null;
1264
+ }
1265
+ }
1182
1266
  };
1183
- exports.CommunicationService = CommunicationService;
1184
- exports.CommunicationService = CommunicationService = CommunicationService_1 = __decorate([
1267
+ exports.IntegrationService = IntegrationService;
1268
+ exports.IntegrationService = IntegrationService = IntegrationService_1 = __decorate([
1185
1269
  (0, common_1.Injectable)(),
1186
- __param(0, (0, typeorm_1.InjectRepository)(communication_hub_entity_1.CommunicationHub)),
1187
- __param(1, (0, typeorm_1.InjectRepository)(communication_config_entity_1.CommunicationConfig)),
1188
- __param(6, (0, common_1.Inject)((0, common_1.forwardRef)(() => communication_queue_service_1.CommunicationQueueService))),
1270
+ __param(0, (0, typeorm_1.InjectRepository)(integration_config_entity_1.IntegrationConfig)),
1271
+ __param(1, (0, typeorm_1.InjectRepository)(user_integration_entity_1.UserIntegration)),
1272
+ __param(6, (0, common_1.Inject)((0, common_1.forwardRef)(() => integration_queue_service_1.IntegrationQueueService))),
1189
1273
  __metadata("design:paramtypes", [typeorm_2.Repository,
1190
1274
  typeorm_2.Repository,
1191
- communication_factory_1.CommunicationFactory,
1275
+ integration_factory_1.IntegrationFactory,
1192
1276
  gmail_api_strategy_1.GmailApiStrategy,
1193
1277
  sendgrid_api_strategy_1.SendGridApiStrategy,
1194
1278
  config_1.ConfigService,
1195
- communication_queue_service_1.CommunicationQueueService])
1196
- ], CommunicationService);
1197
- //# sourceMappingURL=communication.service.js.map
1279
+ integration_queue_service_1.IntegrationQueueService])
1280
+ ], IntegrationService);
1281
+ //# sourceMappingURL=integration.service.js.map