@zohoim/client-sdk 1.1.0-calls → 1.1.0-calls3

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 (87) hide show
  1. package/es/application/services/channels/ChannelService.js +6 -1
  2. package/es/application/services/index.js +2 -0
  3. package/es/application/services/integrationServices/IntegrationService.js +21 -0
  4. package/es/application/services/integrationServices/index.js +2 -0
  5. package/es/application/services/sessions/SessionService.js +6 -1
  6. package/es/application/services/userPreferences/UserPreferenceService.js +26 -0
  7. package/es/application/services/userPreferences/index.js +2 -0
  8. package/es/core/constants/ModuleNames.js +2 -0
  9. package/es/core/utils/validateSchema.js +22 -9
  10. package/es/domain/dto/channels/getChannelRequest.js +13 -0
  11. package/es/domain/dto/channels/getChannelsRequest.js +3 -1
  12. package/es/domain/dto/channels/index.js +2 -1
  13. package/es/domain/dto/index.js +2 -0
  14. package/es/domain/dto/integrationServices/getIntegrationsRequest.js +7 -0
  15. package/es/domain/dto/integrationServices/index.js +1 -0
  16. package/es/domain/dto/sessions/getSessionMetricsRequest.js +16 -0
  17. package/es/domain/dto/sessions/index.js +2 -1
  18. package/es/domain/dto/userPreferences/getPreferencesRequest.js +7 -0
  19. package/es/domain/dto/userPreferences/index.js +2 -0
  20. package/es/domain/dto/userPreferences/updatePreferencesRequest.js +9 -0
  21. package/es/domain/entities/Channel/Channel.js +22 -4
  22. package/es/domain/entities/IntegrationService/IntegrationService.js +8 -1
  23. package/es/domain/entities/Session/SessionMetrics.js +21 -0
  24. package/es/domain/entities/Session/index.js +2 -1
  25. package/es/domain/entities/UserPreference/UserPreference.js +26 -0
  26. package/es/domain/entities/UserPreference/index.js +2 -0
  27. package/es/domain/entities/index.js +1 -0
  28. package/es/domain/enum/index.js +1 -0
  29. package/es/domain/enum/session/AssigneeFilter.js +6 -0
  30. package/es/domain/enum/session/SessionStatus.js +2 -1
  31. package/es/domain/enum/session/index.js +2 -1
  32. package/es/domain/enum/userPreference/CollapseSidePanel.js +5 -0
  33. package/es/domain/enum/userPreference/index.js +2 -0
  34. package/es/domain/interfaces/repositories/channels/IChannelRepository.js +7 -1
  35. package/es/domain/interfaces/repositories/index.js +2 -0
  36. package/es/domain/interfaces/repositories/integrationServices/IIntegrationServiceRepository.js +17 -0
  37. package/es/domain/interfaces/repositories/integrationServices/index.js +2 -0
  38. package/es/domain/interfaces/repositories/sessions/ISessionRepository.js +6 -1
  39. package/es/domain/interfaces/repositories/userPreferences/IUserPreferenceRepository.js +23 -0
  40. package/es/domain/interfaces/repositories/userPreferences/index.js +2 -0
  41. package/es/domain/schema/channel/ChannelSchema.js +39 -5
  42. package/es/domain/schema/index.js +1 -0
  43. package/es/domain/schema/integrationService/IntegrationServiceSchema.js +12 -0
  44. package/es/domain/schema/session/SessionMetrics/AssigneeSchema.js +20 -0
  45. package/es/domain/schema/session/SessionMetrics/SessionMetricsForAssigneeSchema.js +32 -0
  46. package/es/domain/schema/session/SessionMetrics/index.js +2 -0
  47. package/es/domain/schema/session/SessionMetricsSchema.js +9 -0
  48. package/es/domain/schema/session/index.js +2 -1
  49. package/es/domain/schema/userPreference/UserPreferenceSchema.js +9 -0
  50. package/es/domain/schema/userPreference/index.js +2 -0
  51. package/es/frameworks/managers/ModuleFactory.js +29 -5
  52. package/es/frameworks/managers/ModuleManager.js +1 -1
  53. package/es/frameworks/sdk/IMSDK.js +11 -1
  54. package/es/frameworks/sdk/integrationServices/IntegrationServiceSDK.js +30 -0
  55. package/es/frameworks/sdk/integrationServices/index.js +2 -0
  56. package/es/frameworks/sdk/userPreferences/UserPreferencesSDK.js +30 -0
  57. package/es/frameworks/sdk/userPreferences/index.js +2 -0
  58. package/es/infrastructure/adapters/channels/ChannelAdapter.js +16 -2
  59. package/es/infrastructure/adapters/index.js +2 -0
  60. package/es/infrastructure/adapters/integrationServices/IntegrationServiceAdapter.js +25 -0
  61. package/es/infrastructure/adapters/integrationServices/index.js +2 -0
  62. package/es/infrastructure/adapters/sessions/SessionMetricsAdapter.js +19 -0
  63. package/es/infrastructure/adapters/sessions/index.js +2 -1
  64. package/es/infrastructure/adapters/userPreferences/UserPreferenceAdapter.js +19 -0
  65. package/es/infrastructure/adapters/userPreferences/index.js +2 -0
  66. package/es/infrastructure/api/index.js +2 -0
  67. package/es/infrastructure/api/integrationServices/IntegrationServiceAPI.js +14 -0
  68. package/es/infrastructure/api/integrationServices/index.js +2 -0
  69. package/es/infrastructure/api/registry/getRegistryConfig.js +4 -0
  70. package/es/infrastructure/api/registry/integrationServices/constructIntegrationServiceEndPoint.js +10 -0
  71. package/es/infrastructure/api/registry/integrationServices/index.js +2 -0
  72. package/es/infrastructure/api/registry/integrationServices/integrationServiceAPIRegistry.js +12 -0
  73. package/es/infrastructure/api/registry/sessions/sessionAPIRegistry.js +8 -2
  74. package/es/infrastructure/api/registry/userPreferences/constructUserPreferencesEndPoint.js +10 -0
  75. package/es/infrastructure/api/registry/userPreferences/index.js +2 -0
  76. package/es/infrastructure/api/registry/userPreferences/userPreferenceAPIRegistry.js +17 -0
  77. package/es/infrastructure/api/sessions/SessionAPI.js +11 -1
  78. package/es/infrastructure/api/userPreferences/UserPreferenceAPI.js +24 -0
  79. package/es/infrastructure/api/userPreferences/index.js +2 -0
  80. package/es/infrastructure/repositories/channels/ChannelRepository.js +10 -1
  81. package/es/infrastructure/repositories/index.js +2 -0
  82. package/es/infrastructure/repositories/integrationServices/IntegrationServiceRepository.js +49 -0
  83. package/es/infrastructure/repositories/integrationServices/index.js +2 -0
  84. package/es/infrastructure/repositories/sessions/SessionRepository.js +14 -3
  85. package/es/infrastructure/repositories/userPreferences/UserPreferenceRepository.js +58 -0
  86. package/es/infrastructure/repositories/userPreferences/index.js +2 -0
  87. package/package.json +1 -1
@@ -0,0 +1,49 @@
1
+ import { IIntegrationServiceRepository } from '../../../domain/interfaces/repositories';
2
+ import { IntegrationServiceAdapter } from '../../adapters';
3
+ import { IntegrationServiceAPI } from '../../api';
4
+ import { ResponseTypes } from '../../../core/constants';
5
+ export default class IntegrationServiceRepository extends IIntegrationServiceRepository {
6
+ constructor(_ref) {
7
+ let {
8
+ integrationServiceAPI,
9
+ integrationServiceAdapter
10
+ } = _ref;
11
+ super();
12
+ this.defaultAPI = new IntegrationServiceAPI();
13
+ this.customAPI = integrationServiceAPI;
14
+ this.integrationServiceAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
15
+ this.integrationServiceAdapter = integrationServiceAdapter || new IntegrationServiceAdapter();
16
+ }
17
+
18
+ async invokeAPI(_ref2) {
19
+ let {
20
+ operation,
21
+ request,
22
+ adapter = this.integrationServiceAdapter,
23
+ responseType
24
+ } = _ref2;
25
+ return this.executeAPICall({
26
+ operation,
27
+ request,
28
+ apiProxy: this.integrationServiceAPI,
29
+ customAPI: this.customAPI,
30
+ adapter,
31
+ responseType
32
+ });
33
+ }
34
+
35
+ async getIntegrations(request) {
36
+ return this.invokeAPI({
37
+ operation: 'getIntegrations',
38
+ request,
39
+ responseType: ResponseTypes.LIST
40
+ });
41
+ }
42
+
43
+ toJSON() {
44
+ return {
45
+ getIntegrations: this.getIntegrations.bind(this)
46
+ };
47
+ }
48
+
49
+ }
@@ -0,0 +1,2 @@
1
+ import IntegrationServiceRepository from './IntegrationServiceRepository';
2
+ export { IntegrationServiceRepository };
@@ -1,4 +1,4 @@
1
- import { AttachmentAdapter, MessageAdapter, SessionAdapter } from '../../adapters/index';
1
+ import { AttachmentAdapter, MessageAdapter, SessionAdapter, SessionMetricsAdapter } from '../../adapters/index';
2
2
  import { ISessionRepository } from '../../../domain/interfaces/repositories';
3
3
  import { SessionAPI } from '../../api';
4
4
  import { ResponseTypes } from '../../../core/constants';
@@ -8,7 +8,8 @@ export default class SessionRepository extends ISessionRepository {
8
8
  sessionAPI,
9
9
  sessionAdapter,
10
10
  attachmentAdapter,
11
- messageAdapter
11
+ messageAdapter,
12
+ sessionMetricsAdapter
12
13
  } = _ref;
13
14
  super();
14
15
  this.defaultAPI = new SessionAPI();
@@ -17,6 +18,7 @@ export default class SessionRepository extends ISessionRepository {
17
18
  this.sessionAdapter = sessionAdapter || new SessionAdapter();
18
19
  this.attachmentAdapter = attachmentAdapter || new AttachmentAdapter();
19
20
  this.messageAdapter = messageAdapter || new MessageAdapter();
21
+ this.sessionMetricsAdapter = sessionMetricsAdapter || new SessionMetricsAdapter();
20
22
  }
21
23
 
22
24
  async invokeAPI(_ref2) {
@@ -97,6 +99,14 @@ export default class SessionRepository extends ISessionRepository {
97
99
  });
98
100
  }
99
101
 
102
+ async getSessionMetrics(request) {
103
+ return this.invokeAPI({
104
+ operation: 'getSessionMetrics',
105
+ request,
106
+ adapter: this.sessionMetricsAdapter
107
+ });
108
+ }
109
+
100
110
  toJSON() {
101
111
  return {
102
112
  pickupSession: this.pickupSession.bind(this),
@@ -106,7 +116,8 @@ export default class SessionRepository extends ISessionRepository {
106
116
  getSessionAttachments: this.getSessionAttachments.bind(this),
107
117
  getSessionLastMessages: this.getSessionLastMessages.bind(this),
108
118
  markSessionAsRead: this.markSessionAsRead.bind(this),
109
- updateSessionStatus: this.updateSessionStatus.bind(this)
119
+ updateSessionStatus: this.updateSessionStatus.bind(this),
120
+ getSessionMetrics: this.getSessionMetrics.bind(this)
110
121
  };
111
122
  }
112
123
 
@@ -0,0 +1,58 @@
1
+ import { IUserPreferenceRepository } from '../../../domain/interfaces/repositories';
2
+ import { UserPreferenceAdapter } from '../../adapters';
3
+ import { UserPreferenceAPI } from '../../api';
4
+ import { ResponseTypes } from '../../../core/constants';
5
+ export default class UserPreferenceRepository extends IUserPreferenceRepository {
6
+ constructor(_ref) {
7
+ let {
8
+ userPreferenceAPI,
9
+ userPreferenceAdapter
10
+ } = _ref;
11
+ super();
12
+ this.defaultAPI = new UserPreferenceAPI();
13
+ this.customAPI = userPreferenceAPI;
14
+ this.userPreferenceAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
15
+ this.userPreferenceAdapter = userPreferenceAdapter || new UserPreferenceAdapter();
16
+ }
17
+
18
+ async invokeAPI(_ref2) {
19
+ let {
20
+ operation,
21
+ request,
22
+ adapter = this.userPreferenceAdapter,
23
+ responseType
24
+ } = _ref2;
25
+ return this.executeAPICall({
26
+ operation,
27
+ request,
28
+ apiProxy: this.userPreferenceAPI,
29
+ customAPI: this.customAPI,
30
+ adapter,
31
+ responseType
32
+ });
33
+ }
34
+
35
+ async getPreferences(request) {
36
+ return this.invokeAPI({
37
+ operation: 'getPreferences',
38
+ request,
39
+ responseType: ResponseTypes.SINGLE
40
+ });
41
+ }
42
+
43
+ async updatePreferences(request) {
44
+ return this.invokeAPI({
45
+ operation: 'updatePreferences',
46
+ request,
47
+ responseType: ResponseTypes.SINGLE
48
+ });
49
+ }
50
+
51
+ toJSON() {
52
+ return {
53
+ getPreferences: this.getPreferences.bind(this),
54
+ updatePreferences: this.updatePreferences.bind(this)
55
+ };
56
+ }
57
+
58
+ }
@@ -0,0 +1,2 @@
1
+ import UserPreferenceRepository from './UserPreferenceRepository';
2
+ export { UserPreferenceRepository };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/client-sdk",
3
- "version": "1.1.0-calls",
3
+ "version": "1.1.0-calls3",
4
4
  "description": "To have the client sdk for the IM",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",