@zohoim/client-sdk 1.1.0-attachmentsList → 1.1.0-calls1

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 (143) hide show
  1. package/es/application/services/calls/CallService.js +36 -0
  2. package/es/application/services/calls/index.js +1 -0
  3. package/es/application/services/channels/ChannelService.js +6 -1
  4. package/es/application/services/index.js +5 -1
  5. package/es/application/services/integrationServices/IntegrationService.js +21 -0
  6. package/es/application/services/integrationServices/index.js +2 -0
  7. package/es/application/services/sessions/SessionService.js +6 -1
  8. package/es/application/services/userPreferences/UserPreferenceService.js +26 -0
  9. package/es/application/services/userPreferences/index.js +2 -0
  10. package/es/application/services/whatsAppPricing/WhatsAppPricingService.js +21 -0
  11. package/es/application/services/whatsAppPricing/index.js +2 -0
  12. package/es/core/constants/ModuleNames.js +5 -1
  13. package/es/core/constants/ModuleTypes.js +5 -0
  14. package/es/core/constants/index.js +2 -1
  15. package/es/core/utils/validateSchema.js +25 -0
  16. package/es/domain/dto/calls/getCallRequest.js +14 -0
  17. package/es/domain/dto/calls/getCallsRequest.js +20 -0
  18. package/es/domain/dto/calls/index.js +4 -0
  19. package/es/domain/dto/calls/initiateCallRequest.js +15 -0
  20. package/es/domain/dto/calls/updateCallStatusRequest.js +15 -0
  21. package/es/domain/dto/channels/getChannelRequest.js +13 -0
  22. package/es/domain/dto/channels/getChannelsRequest.js +3 -1
  23. package/es/domain/dto/channels/index.js +2 -1
  24. package/es/domain/dto/index.js +5 -1
  25. package/es/domain/dto/integrationServices/getIntegrationsRequest.js +7 -0
  26. package/es/domain/dto/integrationServices/index.js +1 -0
  27. package/es/domain/dto/sessions/getSessionAttachmentsRequest.js +5 -2
  28. package/es/domain/dto/sessions/getSessionMetricsRequest.js +16 -0
  29. package/es/domain/dto/sessions/index.js +2 -1
  30. package/es/domain/dto/userPreferences/getPreferencesRequest.js +7 -0
  31. package/es/domain/dto/userPreferences/index.js +2 -0
  32. package/es/domain/dto/userPreferences/updatePreferencesRequest.js +9 -0
  33. package/es/domain/dto/whatsAppPricing/calculateWhatsAppPricingRequest.js +14 -0
  34. package/es/domain/dto/whatsAppPricing/index.js +1 -0
  35. package/es/domain/entities/Actor/Actor.js +4 -0
  36. package/es/domain/entities/Call/Call.js +47 -0
  37. package/es/domain/entities/Call/index.js +1 -0
  38. package/es/domain/entities/Channel/Channel.js +22 -4
  39. package/es/domain/entities/IntegrationService/IntegrationService.js +8 -1
  40. package/es/domain/entities/Session/SessionMetrics.js +21 -0
  41. package/es/domain/entities/Session/index.js +2 -1
  42. package/es/domain/entities/UserPreference/UserPreference.js +26 -0
  43. package/es/domain/entities/UserPreference/index.js +2 -0
  44. package/es/domain/entities/WhatsAppPricing/WhatsAppPricing.js +25 -0
  45. package/es/domain/entities/WhatsAppPricing/WhatsAppPricingCategory.js +22 -0
  46. package/es/domain/entities/WhatsAppPricing/index.js +3 -0
  47. package/es/domain/entities/index.js +4 -1
  48. package/es/domain/enum/call/CallStatus.js +8 -0
  49. package/es/domain/enum/call/index.js +1 -0
  50. package/es/domain/enum/index.js +3 -1
  51. package/es/domain/enum/session/AssigneeFilter.js +6 -0
  52. package/es/domain/enum/session/SessionStatus.js +2 -1
  53. package/es/domain/enum/session/index.js +2 -1
  54. package/es/domain/enum/userPreference/CollapseSidePanel.js +5 -0
  55. package/es/domain/enum/userPreference/index.js +2 -0
  56. package/es/domain/interfaces/repositories/calls/ICallRepository.js +32 -0
  57. package/es/domain/interfaces/repositories/calls/index.js +1 -0
  58. package/es/domain/interfaces/repositories/channels/IChannelRepository.js +7 -1
  59. package/es/domain/interfaces/repositories/index.js +5 -1
  60. package/es/domain/interfaces/repositories/integrationServices/IIntegrationServiceRepository.js +17 -0
  61. package/es/domain/interfaces/repositories/integrationServices/index.js +2 -0
  62. package/es/domain/interfaces/repositories/sessions/ISessionRepository.js +6 -1
  63. package/es/domain/interfaces/repositories/userPreferences/IUserPreferenceRepository.js +23 -0
  64. package/es/domain/interfaces/repositories/userPreferences/index.js +2 -0
  65. package/es/domain/interfaces/repositories/whatsAppPricing/IWhatsAppPricingRepository.js +18 -0
  66. package/es/domain/interfaces/repositories/whatsAppPricing/index.js +2 -0
  67. package/es/domain/schema/call/CallSchema.js +63 -0
  68. package/es/domain/schema/call/index.js +1 -0
  69. package/es/domain/schema/channel/ChannelSchema.js +39 -5
  70. package/es/domain/schema/index.js +4 -1
  71. package/es/domain/schema/integrationService/IntegrationServiceSchema.js +12 -0
  72. package/es/domain/schema/session/SessionMetrics/AssigneeSchema.js +20 -0
  73. package/es/domain/schema/session/SessionMetrics/SessionMetricsForAssigneeSchema.js +32 -0
  74. package/es/domain/schema/session/SessionMetrics/index.js +2 -0
  75. package/es/domain/schema/session/SessionMetricsSchema.js +9 -0
  76. package/es/domain/schema/session/index.js +2 -1
  77. package/es/domain/schema/userPreference/UserPreferenceSchema.js +9 -0
  78. package/es/domain/schema/userPreference/index.js +2 -0
  79. package/es/domain/schema/whatsAppPricing/WhatsAppPricingCategorySchema.js +11 -0
  80. package/es/domain/schema/whatsAppPricing/WhatsAppPricingSchema.js +21 -0
  81. package/es/domain/schema/whatsAppPricing/index.js +3 -0
  82. package/es/frameworks/managers/ModuleFactory.js +81 -23
  83. package/es/frameworks/managers/ModuleManager.js +25 -2
  84. package/es/frameworks/sdk/IMSDK.js +33 -11
  85. package/es/frameworks/sdk/calls/CallSDK.js +27 -0
  86. package/es/frameworks/sdk/calls/index.js +1 -0
  87. package/es/frameworks/sdk/integrationServices/IntegrationServiceSDK.js +30 -0
  88. package/es/frameworks/sdk/integrationServices/index.js +2 -0
  89. package/es/frameworks/sdk/userPreferences/UserPreferencesSDK.js +30 -0
  90. package/es/frameworks/sdk/userPreferences/index.js +2 -0
  91. package/es/frameworks/sdk/whatsAppPricing/WhatsAppPricingSDK.js +28 -0
  92. package/es/frameworks/sdk/whatsAppPricing/index.js +2 -0
  93. package/es/infrastructure/adapters/calls/CallAdapter.js +31 -0
  94. package/es/infrastructure/adapters/calls/index.js +1 -0
  95. package/es/infrastructure/adapters/channels/ChannelAdapter.js +16 -2
  96. package/es/infrastructure/adapters/index.js +5 -1
  97. package/es/infrastructure/adapters/integrationServices/IntegrationServiceAdapter.js +25 -0
  98. package/es/infrastructure/adapters/integrationServices/index.js +2 -0
  99. package/es/infrastructure/adapters/sessions/SessionMetricsAdapter.js +19 -0
  100. package/es/infrastructure/adapters/sessions/index.js +2 -1
  101. package/es/infrastructure/adapters/userPreferences/UserPreferenceAdapter.js +19 -0
  102. package/es/infrastructure/adapters/userPreferences/index.js +2 -0
  103. package/es/infrastructure/adapters/whatsAppPricing/WhatsAppPricingAdapter.js +22 -0
  104. package/es/infrastructure/adapters/whatsAppPricing/index.js +2 -0
  105. package/es/infrastructure/api/BaseAPI.js +5 -4
  106. package/es/infrastructure/api/calls/CallAPI.js +44 -0
  107. package/es/infrastructure/api/calls/index.js +1 -0
  108. package/es/infrastructure/api/index.js +5 -1
  109. package/es/infrastructure/api/integrationServices/IntegrationServiceAPI.js +14 -0
  110. package/es/infrastructure/api/integrationServices/index.js +2 -0
  111. package/es/infrastructure/api/registry/calls/callAPIRegistry.js +29 -0
  112. package/es/infrastructure/api/registry/calls/constructCallEndPoint.js +10 -0
  113. package/es/infrastructure/api/registry/calls/index.js +1 -0
  114. package/es/infrastructure/api/registry/createPublicBaseUrl.js +4 -0
  115. package/es/infrastructure/api/registry/getRegistryConfig.js +9 -1
  116. package/es/infrastructure/api/registry/integrationServices/constructIntegrationServiceEndPoint.js +10 -0
  117. package/es/infrastructure/api/registry/integrationServices/index.js +2 -0
  118. package/es/infrastructure/api/registry/integrationServices/integrationServiceAPIRegistry.js +12 -0
  119. package/es/infrastructure/api/registry/sessions/sessionAPIRegistry.js +8 -2
  120. package/es/infrastructure/api/registry/userPreferences/constructUserPreferencesEndPoint.js +10 -0
  121. package/es/infrastructure/api/registry/userPreferences/index.js +2 -0
  122. package/es/infrastructure/api/registry/userPreferences/userPreferenceAPIRegistry.js +17 -0
  123. package/es/infrastructure/api/registry/whatsAppPricing/constructWhatsAppPricingEndPoint.js +10 -0
  124. package/es/infrastructure/api/registry/whatsAppPricing/index.js +2 -0
  125. package/es/infrastructure/api/registry/whatsAppPricing/whatsAppPricingAPIRegistry.js +13 -0
  126. package/es/infrastructure/api/sessions/SessionAPI.js +11 -1
  127. package/es/infrastructure/api/userPreferences/UserPreferenceAPI.js +24 -0
  128. package/es/infrastructure/api/userPreferences/index.js +2 -0
  129. package/es/infrastructure/api/whatsAppPricing/WhatsAppPricingAPI.js +14 -0
  130. package/es/infrastructure/api/whatsAppPricing/index.js +2 -0
  131. package/es/infrastructure/config/configRegistry.js +8 -1
  132. package/es/infrastructure/repositories/calls/CallRepository.js +73 -0
  133. package/es/infrastructure/repositories/calls/index.js +1 -0
  134. package/es/infrastructure/repositories/channels/ChannelRepository.js +10 -1
  135. package/es/infrastructure/repositories/index.js +5 -1
  136. package/es/infrastructure/repositories/integrationServices/IntegrationServiceRepository.js +49 -0
  137. package/es/infrastructure/repositories/integrationServices/index.js +2 -0
  138. package/es/infrastructure/repositories/sessions/SessionRepository.js +14 -3
  139. package/es/infrastructure/repositories/userPreferences/UserPreferenceRepository.js +58 -0
  140. package/es/infrastructure/repositories/userPreferences/index.js +2 -0
  141. package/es/infrastructure/repositories/whatsAppPricing/WhatsAppPricingRepository.js +49 -0
  142. package/es/infrastructure/repositories/whatsAppPricing/index.js +2 -0
  143. package/package.json +2 -2
@@ -0,0 +1,49 @@
1
+ import { IWhatsAppPricingRepository } from '../../../domain/interfaces/repositories';
2
+ import { WhatsAppPricingAdapter } from '../../adapters';
3
+ import { WhatsAppPricingAPI } from '../../api';
4
+ import { ResponseTypes } from '../../../core/constants';
5
+ export default class WhatsAppPricingRepository extends IWhatsAppPricingRepository {
6
+ constructor(_ref) {
7
+ let {
8
+ whatsAppPricingAPI,
9
+ whatsAppPricingAdapter
10
+ } = _ref;
11
+ super();
12
+ this.defaultAPI = new WhatsAppPricingAPI();
13
+ this.customAPI = whatsAppPricingAPI;
14
+ this.whatsAppPricingAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
15
+ this.whatsAppPricingAdapter = whatsAppPricingAdapter || new WhatsAppPricingAdapter();
16
+ }
17
+
18
+ async invokeAPI(_ref2) {
19
+ let {
20
+ operation,
21
+ request,
22
+ adapter = this.whatsAppPricingAdapter,
23
+ responseType
24
+ } = _ref2;
25
+ return this.executeAPICall({
26
+ operation,
27
+ request,
28
+ apiProxy: this.whatsAppPricingAPI,
29
+ customAPI: this.customAPI,
30
+ adapter,
31
+ responseType
32
+ });
33
+ }
34
+
35
+ async calculateWhatsAppPricing(request) {
36
+ return this.invokeAPI({
37
+ operation: 'calculateWhatsAppPricing',
38
+ request,
39
+ responseType: ResponseTypes.SINGLE
40
+ });
41
+ }
42
+
43
+ toJSON() {
44
+ return {
45
+ calculateWhatsAppPricing: this.calculateWhatsAppPricing.bind(this)
46
+ };
47
+ }
48
+
49
+ }
@@ -0,0 +1,2 @@
1
+ import WhatsAppPricingRepository from './WhatsAppPricingRepository';
2
+ export { WhatsAppPricingRepository };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/client-sdk",
3
- "version": "1.1.0-attachmentsList",
3
+ "version": "1.1.0-calls1",
4
4
  "description": "To have the client sdk for the IM",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",
@@ -32,4 +32,4 @@
32
32
  "@zohodesk/docs-builder": "1.0.2",
33
33
  "@testing-library/jest-dom": "^5.16.5"
34
34
  }
35
- }
35
+ }