@zohoim/client-sdk 1.0.0-canned08 → 1.0.0-leftPanelPoc2

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 (125) hide show
  1. package/es/application/services/cannedMessages/CannedMessageService.js +1 -21
  2. package/es/application/services/channels/ChannelService.js +6 -1
  3. package/es/application/services/index.js +3 -1
  4. package/es/application/services/integrationServices/IntegrationService.js +21 -0
  5. package/es/application/services/integrationServices/index.js +2 -0
  6. package/es/application/services/sessions/SessionService.js +6 -1
  7. package/es/application/services/templateMessages/TemplateMessageService.js +1 -6
  8. package/es/application/services/userPreferences/UserPreferenceService.js +26 -0
  9. package/es/application/services/userPreferences/index.js +2 -0
  10. package/es/core/constants/ModuleNames.js +3 -1
  11. package/es/domain/dto/cannedMessages/index.js +1 -5
  12. package/es/domain/dto/{cannedMessages/deleteTranslationRequest.js → channels/getChannelRequest.js} +3 -4
  13. package/es/domain/dto/channels/getChannelsRequest.js +3 -1
  14. package/es/domain/dto/channels/index.js +2 -1
  15. package/es/domain/dto/index.js +3 -1
  16. package/es/domain/dto/{templateMessages/getTemplateTagsRequest.js → integrationServices/getIntegrationsRequest.js} +2 -2
  17. package/es/domain/dto/integrationServices/index.js +1 -0
  18. package/es/domain/dto/sessions/getSessionMetricsRequest.js +16 -0
  19. package/es/domain/dto/sessions/index.js +2 -1
  20. package/es/domain/dto/templateMessages/index.js +1 -2
  21. package/es/domain/dto/userPreferences/getPreferencesRequest.js +7 -0
  22. package/es/domain/dto/userPreferences/index.js +2 -0
  23. package/es/domain/dto/userPreferences/updatePreferencesRequest.js +9 -0
  24. package/es/domain/entities/CannedMessage/CannedMessage.js +6 -34
  25. package/es/domain/entities/CannedMessage/index.js +1 -2
  26. package/es/domain/entities/Channel/Channel.js +22 -4
  27. package/es/domain/entities/IntegrationService/IntegrationService.js +8 -1
  28. package/es/domain/entities/Session/SessionMetrics.js +21 -0
  29. package/es/domain/entities/Session/index.js +2 -1
  30. package/es/domain/entities/TemplateMessage/index.js +1 -4
  31. package/es/domain/entities/UserPreference/UserPreference.js +26 -0
  32. package/es/domain/entities/UserPreference/index.js +2 -0
  33. package/es/domain/entities/index.js +1 -1
  34. package/es/domain/enum/cannedMessage/CannedMessageStatus.js +1 -11
  35. package/es/domain/enum/cannedMessage/CannedMessageType.js +1 -3
  36. package/es/domain/enum/cannedMessage/TemplateItemButtonType.js +1 -7
  37. package/es/domain/enum/cannedMessage/TemplateItemHeaderType.js +1 -3
  38. package/es/domain/enum/index.js +2 -1
  39. package/es/domain/enum/session/AssigneeFilter.js +6 -0
  40. package/es/domain/enum/session/SessionStatus.js +2 -1
  41. package/es/domain/enum/session/index.js +2 -1
  42. package/es/domain/enum/userPreference/CollapseSidePanel.js +5 -0
  43. package/es/domain/enum/userPreference/index.js +2 -0
  44. package/es/domain/interfaces/repositories/cannedMessages/ICannedMessageRepository.js +1 -21
  45. package/es/domain/interfaces/repositories/channels/IChannelRepository.js +7 -1
  46. package/es/domain/interfaces/repositories/index.js +3 -1
  47. package/es/domain/interfaces/repositories/integrationServices/IIntegrationServiceRepository.js +17 -0
  48. package/es/domain/interfaces/repositories/integrationServices/index.js +2 -0
  49. package/es/domain/interfaces/repositories/sessions/ISessionRepository.js +6 -1
  50. package/es/domain/interfaces/repositories/templateMessages/ITemplateMessageRepository.js +1 -7
  51. package/es/domain/interfaces/repositories/userPreferences/IUserPreferenceRepository.js +23 -0
  52. package/es/domain/interfaces/repositories/userPreferences/index.js +2 -0
  53. package/es/domain/schema/cannedMessage/CannedMessageSchema.js +0 -12
  54. package/es/domain/schema/cannedMessage/TemplateItem/TemplateItemButtonsSchema.js +1 -1
  55. package/es/domain/schema/cannedMessage/TranslationsSchema.js +1 -1
  56. package/es/domain/schema/cannedMessage/index.js +1 -3
  57. package/es/domain/schema/channel/ChannelSchema.js +39 -5
  58. package/es/domain/schema/index.js +1 -1
  59. package/es/domain/schema/integrationService/IntegrationServiceSchema.js +12 -0
  60. package/es/domain/schema/session/SessionMetrics/AssigneeSchema.js +20 -0
  61. package/es/domain/schema/session/SessionMetrics/SessionMetricsForAssigneeSchema.js +32 -0
  62. package/es/domain/schema/session/SessionMetrics/index.js +2 -0
  63. package/es/domain/schema/session/SessionMetricsSchema.js +9 -0
  64. package/es/domain/schema/session/index.js +2 -1
  65. package/es/domain/schema/userPreference/UserPreferenceSchema.js +9 -0
  66. package/es/domain/schema/userPreference/index.js +2 -0
  67. package/es/frameworks/managers/ModuleFactory.js +18 -0
  68. package/es/frameworks/managers/ModuleManager.js +1 -1
  69. package/es/frameworks/sdk/IMSDK.js +10 -0
  70. package/es/frameworks/sdk/integrationServices/IntegrationServiceSDK.js +30 -0
  71. package/es/frameworks/sdk/integrationServices/index.js +2 -0
  72. package/es/frameworks/sdk/userPreferences/UserPreferencesSDK.js +30 -0
  73. package/es/frameworks/sdk/userPreferences/index.js +2 -0
  74. package/es/infrastructure/adapters/cannedMessages/CannedMessageAdapter.js +2 -3
  75. package/es/infrastructure/adapters/cannedMessages/index.js +1 -2
  76. package/es/infrastructure/adapters/channels/ChannelAdapter.js +16 -2
  77. package/es/infrastructure/adapters/index.js +2 -1
  78. package/es/infrastructure/adapters/integrationServices/IntegrationServiceAdapter.js +25 -0
  79. package/es/infrastructure/adapters/integrationServices/index.js +2 -0
  80. package/es/infrastructure/adapters/sessions/SessionMetricsAdapter.js +19 -0
  81. package/es/infrastructure/adapters/sessions/index.js +2 -1
  82. package/es/infrastructure/adapters/userPreferences/UserPreferenceAdapter.js +19 -0
  83. package/es/infrastructure/adapters/userPreferences/index.js +2 -0
  84. package/es/infrastructure/api/cannedMessages/CannedMessageAPI.js +1 -41
  85. package/es/infrastructure/api/index.js +3 -1
  86. package/es/infrastructure/api/integrationServices/IntegrationServiceAPI.js +14 -0
  87. package/es/infrastructure/api/integrationServices/index.js +2 -0
  88. package/es/infrastructure/api/registry/cannedMessages/cannedMessageAPIRegistry.js +2 -22
  89. package/es/infrastructure/api/registry/getRegistryConfig.js +5 -1
  90. package/es/infrastructure/api/registry/integrationServices/constructIntegrationServiceEndPoint.js +10 -0
  91. package/es/infrastructure/api/registry/integrationServices/index.js +2 -0
  92. package/es/infrastructure/api/registry/integrationServices/integrationServiceAPIRegistry.js +12 -0
  93. package/es/infrastructure/api/registry/sessions/sessionAPIRegistry.js +8 -2
  94. package/es/infrastructure/api/registry/templateMessages/templateMessageAPIRegistry.js +2 -7
  95. package/es/infrastructure/api/registry/userPreferences/constructUserPreferencesEndPoint.js +10 -0
  96. package/es/infrastructure/api/registry/userPreferences/index.js +2 -0
  97. package/es/infrastructure/api/registry/userPreferences/userPreferenceAPIRegistry.js +17 -0
  98. package/es/infrastructure/api/sessions/SessionAPI.js +11 -1
  99. package/es/infrastructure/api/templateMessages/TemplateMessageAPI.js +1 -11
  100. package/es/infrastructure/api/userPreferences/UserPreferenceAPI.js +24 -0
  101. package/es/infrastructure/api/userPreferences/index.js +2 -0
  102. package/es/infrastructure/repositories/cannedMessages/CannedMessageRepository.js +7 -50
  103. package/es/infrastructure/repositories/channels/ChannelRepository.js +10 -1
  104. package/es/infrastructure/repositories/index.js +3 -1
  105. package/es/infrastructure/repositories/integrationServices/IntegrationServiceRepository.js +49 -0
  106. package/es/infrastructure/repositories/integrationServices/index.js +2 -0
  107. package/es/infrastructure/repositories/sessions/SessionRepository.js +14 -3
  108. package/es/infrastructure/repositories/templateMessages/TemplateMessageRepository.js +1 -10
  109. package/es/infrastructure/repositories/userPreferences/UserPreferenceRepository.js +58 -0
  110. package/es/infrastructure/repositories/userPreferences/index.js +2 -0
  111. package/package.json +1 -1
  112. package/es/domain/dto/cannedMessages/addTranslationRequest.js +0 -18
  113. package/es/domain/dto/cannedMessages/getCannedPlaceholdersRequest.js +0 -10
  114. package/es/domain/dto/cannedMessages/updateTranslationRequest.js +0 -18
  115. package/es/domain/entities/CannedMessage/Translation.js +0 -48
  116. package/es/domain/entities/Placeholder/Placeholder.js +0 -24
  117. package/es/domain/entities/Placeholder/index.js +0 -2
  118. package/es/domain/entities/TemplateMessage/TemplateItemButton.js +0 -48
  119. package/es/domain/entities/TemplateMessage/TemplateItemFooter.js +0 -27
  120. package/es/domain/entities/TemplateMessage/TemplateItemHeader.js +0 -48
  121. package/es/domain/schema/placeholder/PlaceholderSchema.js +0 -19
  122. package/es/domain/schema/placeholder/index.js +0 -2
  123. package/es/infrastructure/adapters/cannedMessages/TranslationAdapter.js +0 -27
  124. package/es/infrastructure/adapters/placeholders/PlaceholderAdapter.js +0 -22
  125. package/es/infrastructure/adapters/placeholders/index.js +0 -2
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-unused-vars */
2
2
  import { ModuleNames } from '../../../../core/constants';
3
3
  import BaseAPI from '../../../../infrastructure/api/BaseAPI';
4
- import { getCannedMessageRequest, getCannedMessagesRequest, createCannedMessageRequest, updateCannedMessageRequest, deleteCannedMessageRequest, disableCannedMessageRequest, enableCannedMessageRequest, addTranslationRequest, updateTranslationRequest, deleteTranslationRequest, getCannedPlaceholdersRequest } from '../../../dto';
4
+ import { getCannedMessageRequest, getCannedMessagesRequest, createCannedMessageRequest, updateCannedMessageRequest, deleteCannedMessageRequest, disableCannedMessageRequest, enableCannedMessageRequest } from '../../../dto';
5
5
  export default class ICannedMessageRepository extends BaseAPI {
6
6
  constructor() {
7
7
  super({
@@ -44,24 +44,4 @@ export default class ICannedMessageRepository extends BaseAPI {
44
44
  throw new Error('Method not implemented.');
45
45
  }
46
46
 
47
- addTranslation() {
48
- let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : addTranslationRequest();
49
- throw new Error('Method not implemented.');
50
- }
51
-
52
- updateTranslation() {
53
- let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : updateTranslationRequest();
54
- throw new Error('Method not implemented.');
55
- }
56
-
57
- deleteTranslation() {
58
- let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : deleteTranslationRequest();
59
- throw new Error('Method not implemented.');
60
- }
61
-
62
- getCannedPlaceholders() {
63
- let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getCannedPlaceholdersRequest();
64
- throw new Error('Method not implemented.');
65
- }
66
-
67
47
  }
@@ -1,6 +1,6 @@
1
1
  import { ModuleNames } from '../../../../core/constants';
2
2
  import BaseAPI from '../../../../infrastructure/api/BaseAPI';
3
- import { getChannelsRequest } from '../../../dto';
3
+ import { getChannelRequest, getChannelsRequest } from '../../../dto';
4
4
  export default class IChannelRepository extends BaseAPI {
5
5
  constructor() {
6
6
  super({
@@ -12,6 +12,12 @@ export default class IChannelRepository extends BaseAPI {
12
12
  getChannels() {
13
13
  let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getChannelsRequest();
14
14
  throw new Error('Method not implemented.');
15
+ } // eslint-disable-next-line no-unused-vars
16
+
17
+
18
+ getChannel() {
19
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getChannelRequest();
20
+ throw new Error('Method not implemented.');
15
21
  }
16
22
 
17
23
  }
@@ -5,4 +5,6 @@ export * from './messages';
5
5
  export * from './agents';
6
6
  export * from './contacts';
7
7
  export * from './cannedMessages';
8
- export * from './templateMessages';
8
+ export * from './templateMessages';
9
+ export * from './integrationServices';
10
+ export * from './userPreferences';
@@ -0,0 +1,17 @@
1
+ import { ModuleNames } from '../../../../core/constants';
2
+ import BaseAPI from '../../../../infrastructure/api/BaseAPI';
3
+ import { getIntegrationsRequest } from '../../../dto';
4
+ export default class IIntegrationServiceRepository extends BaseAPI {
5
+ constructor() {
6
+ super({
7
+ module: ModuleNames.INTEGRATION_SERVICES
8
+ });
9
+ } // eslint-disable-next-line no-unused-vars
10
+
11
+
12
+ async getIntegrations() {
13
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getIntegrationsRequest();
14
+ throw new Error('Method not implemented');
15
+ }
16
+
17
+ }
@@ -0,0 +1,2 @@
1
+ import IIntegrationServiceRepository from './IIntegrationServiceRepository';
2
+ export { IIntegrationServiceRepository };
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-unused-vars */
2
2
  import { ModuleNames } from '../../../../core/constants';
3
3
  import BaseAPI from '../../../../infrastructure/api/BaseAPI';
4
- import { updateSessionAssigneeRequest, getSessionsRequest, getSessionRequest, getSessionAttachmentsRequest, getSessionLastMessagesRequest, markSessionAsReadRequest, updateSessionStatusRequest, pickupSessionRequest } from '../../../dto';
4
+ import { updateSessionAssigneeRequest, getSessionsRequest, getSessionRequest, getSessionAttachmentsRequest, getSessionLastMessagesRequest, markSessionAsReadRequest, updateSessionStatusRequest, pickupSessionRequest, getSessionMetricsRequest } from '../../../dto';
5
5
  export default class ISessionRepository extends BaseAPI {
6
6
  constructor() {
7
7
  super({
@@ -49,4 +49,9 @@ export default class ISessionRepository extends BaseAPI {
49
49
  throw new Error('Method not implemented.');
50
50
  }
51
51
 
52
+ getSessionMetrics() {
53
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getSessionMetricsRequest();
54
+ throw new Error('Method not implemented.');
55
+ }
56
+
52
57
  }
@@ -1,7 +1,6 @@
1
- /* eslint-disable no-unused-vars */
2
1
  import { ModuleNames } from '../../../../core/constants';
3
2
  import BaseAPI from '../../../../infrastructure/api/BaseAPI';
4
- import { getTemplateCreditExhaustStatusRequest, getTemplateLanguagesRequest, getTemplateTagsRequest } from '../../../dto';
3
+ import { getTemplateCreditExhaustStatusRequest, getTemplateLanguagesRequest } from '../../../dto';
5
4
  export default class ITemplateMessageRepository extends BaseAPI {
6
5
  constructor() {
7
6
  super({
@@ -19,9 +18,4 @@ export default class ITemplateMessageRepository extends BaseAPI {
19
18
  throw new Error('Method not implemented');
20
19
  }
21
20
 
22
- async getTemplateTags() {
23
- let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getTemplateTagsRequest();
24
- throw new Error('Method not implemented');
25
- }
26
-
27
21
  }
@@ -0,0 +1,23 @@
1
+ import { ModuleNames } from '../../../../core/constants';
2
+ import BaseAPI from '../../../../infrastructure/api/BaseAPI';
3
+ import { getPreferencesRequest, updatePreferencesRequest } from '../../../dto';
4
+ export default class IUserPreferenceRepository extends BaseAPI {
5
+ constructor() {
6
+ super({
7
+ module: ModuleNames.USER_PREFERENCES
8
+ });
9
+ } // eslint-disable-next-line no-unused-vars
10
+
11
+
12
+ async getPreferences() {
13
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getPreferencesRequest();
14
+ throw new Error('Method not implemented');
15
+ } // eslint-disable-next-line no-unused-vars
16
+
17
+
18
+ async updatePreferences() {
19
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : updatePreferencesRequest();
20
+ throw new Error('Method not implemented');
21
+ }
22
+
23
+ }
@@ -0,0 +1,2 @@
1
+ import IUserPreferenceRepository from './IUserPreferenceRepository';
2
+ export { IUserPreferenceRepository };
@@ -60,18 +60,6 @@ const CannedMessageSchema = {
60
60
  parameters: {
61
61
  type: 'object',
62
62
  required: false
63
- },
64
- primaryLanguage: {
65
- type: 'string',
66
- required: false
67
- },
68
- wabaId: {
69
- type: 'string',
70
- required: false
71
- },
72
- modifiedTime: {
73
- type: 'string',
74
- required: false
75
63
  }
76
64
  };
77
65
  export default CannedMessageSchema;
@@ -11,7 +11,7 @@ const TemplateItemButtonsSchema = {
11
11
  },
12
12
  action: {
13
13
  type: 'string',
14
- required: false
14
+ required: true
15
15
  }
16
16
  };
17
17
  export default TemplateItemButtonsSchema;
@@ -31,7 +31,7 @@ const TranslationsSchema = {
31
31
  },
32
32
  status: {
33
33
  type: 'string',
34
- required: false,
34
+ required: true,
35
35
  enum: Object.values(CannedMessageStatus)
36
36
  },
37
37
  templateItems: {
@@ -1,4 +1,2 @@
1
1
  import CannedMessageSchema from './CannedMessageSchema';
2
- import TranslationsSchema from './TranslationsSchema';
3
- export * from './TemplateItem';
4
- export { CannedMessageSchema, TranslationsSchema };
2
+ export { CannedMessageSchema };
@@ -1,13 +1,15 @@
1
- import { IntegrationServiceSchema } from '../integrationService';
2
1
  const ChannelSchema = {
3
2
  id: {
4
3
  type: 'string',
5
4
  required: true
6
5
  },
7
- integrationService: {
8
- type: 'object',
9
- required: true,
10
- schema: IntegrationServiceSchema
6
+ integrationServiceType: {
7
+ type: 'string',
8
+ required: false
9
+ },
10
+ integrationServiceId: {
11
+ type: 'string',
12
+ required: false
11
13
  },
12
14
  name: {
13
15
  type: 'string',
@@ -21,6 +23,14 @@ const ChannelSchema = {
21
23
  type: 'boolean',
22
24
  required: true
23
25
  },
26
+ isDeleted: {
27
+ type: 'boolean',
28
+ required: true
29
+ },
30
+ isSandBox: {
31
+ type: 'boolean',
32
+ required: true
33
+ },
24
34
  createdTime: {
25
35
  type: 'string',
26
36
  required: true
@@ -29,6 +39,10 @@ const ChannelSchema = {
29
39
  type: 'string',
30
40
  required: false
31
41
  },
42
+ universalLink: {
43
+ type: 'string',
44
+ required: true
45
+ },
32
46
  isSubscribed: {
33
47
  type: 'boolean',
34
48
  required: false
@@ -44,6 +58,26 @@ const ChannelSchema = {
44
58
  photoURL: {
45
59
  type: 'string',
46
60
  required: false
61
+ },
62
+ configParams: {
63
+ type: 'object',
64
+ required: false
65
+ },
66
+ authorizationPending: {
67
+ type: 'boolean',
68
+ required: false
69
+ },
70
+ meta: {
71
+ type: 'array',
72
+ required: false
73
+ },
74
+ logoURL: {
75
+ type: 'string',
76
+ required: false
77
+ },
78
+ workspaceId: {
79
+ type: 'string',
80
+ required: false
47
81
  }
48
82
  };
49
83
  export default ChannelSchema;
@@ -9,4 +9,4 @@ export * from './contact';
9
9
  export * from './cannedMessage';
10
10
  export * from './templateMessage';
11
11
  export * from './customReplyExtension';
12
- export * from './placeholder';
12
+ export * from './userPreference';
@@ -26,6 +26,18 @@ const IntegrationServiceSchema = {
26
26
  logoURL: {
27
27
  type: 'string',
28
28
  required: false
29
+ },
30
+ domain: {
31
+ type: 'string',
32
+ required: false
33
+ },
34
+ channelAlias: {
35
+ type: 'string',
36
+ required: false
37
+ },
38
+ isParentAccountNeeded: {
39
+ type: 'boolean',
40
+ required: false
29
41
  }
30
42
  };
31
43
  export default IntegrationServiceSchema;
@@ -0,0 +1,20 @@
1
+ import { AssigneeFilter } from '../../../enum';
2
+ import SessionMetricsForAssigneeSchema from './SessionMetricsForAssigneeSchema';
3
+ const AssigneeSchema = {
4
+ [AssigneeFilter.NONE]: {
5
+ type: 'object',
6
+ required: true,
7
+ schema: SessionMetricsForAssigneeSchema
8
+ },
9
+ [AssigneeFilter.MINE]: {
10
+ type: 'object',
11
+ required: true,
12
+ schema: SessionMetricsForAssigneeSchema
13
+ },
14
+ [AssigneeFilter.UNASSIGNED]: {
15
+ type: 'object',
16
+ required: true,
17
+ schema: SessionMetricsForAssigneeSchema
18
+ }
19
+ };
20
+ export default AssigneeSchema;
@@ -0,0 +1,32 @@
1
+ import { SessionStatus } from '../../../enum';
2
+ const SessionMetricsForAssigneeSchema = {
3
+ [SessionStatus.CREATED]: {
4
+ type: 'string',
5
+ required: true
6
+ },
7
+ [SessionStatus.OPEN]: {
8
+ type: 'string',
9
+ required: true
10
+ },
11
+ [SessionStatus.ON_PROGRESS]: {
12
+ type: 'string',
13
+ required: true
14
+ },
15
+ [SessionStatus.ON_HOLD]: {
16
+ type: 'string',
17
+ required: true
18
+ },
19
+ [SessionStatus.ENDED]: {
20
+ type: 'string',
21
+ required: true
22
+ },
23
+ [SessionStatus.BLOCKED]: {
24
+ type: 'string',
25
+ required: true
26
+ },
27
+ [SessionStatus.MISSED]: {
28
+ type: 'string',
29
+ required: true
30
+ }
31
+ };
32
+ export default SessionMetricsForAssigneeSchema;
@@ -0,0 +1,2 @@
1
+ import AssigneeSchema from './AssigneeSchema';
2
+ export { AssigneeSchema };
@@ -0,0 +1,9 @@
1
+ import AssigneeSchema from './SessionMetrics/AssigneeSchema';
2
+ const SessionMetricsSchema = {
3
+ assignee: {
4
+ type: 'object',
5
+ required: true,
6
+ schema: AssigneeSchema
7
+ }
8
+ };
9
+ export default SessionMetricsSchema;
@@ -1,2 +1,3 @@
1
1
  import SessionSchema from './SessionSchema';
2
- export { SessionSchema };
2
+ import SessionMetricsSchema from './SessionMetricsSchema';
3
+ export { SessionSchema, SessionMetricsSchema };
@@ -0,0 +1,9 @@
1
+ import { CollapseSidePanel } from '../../enum';
2
+ const UserPreferenceSchema = {
3
+ collapseSidePanel: {
4
+ type: 'string',
5
+ required: true,
6
+ enum: Object.values(CollapseSidePanel)
7
+ }
8
+ };
9
+ export default UserPreferenceSchema;
@@ -0,0 +1,2 @@
1
+ import UserPreferenceSchema from './UserPreferenceSchema';
2
+ export { UserPreferenceSchema };
@@ -7,6 +7,8 @@ import { AgentSDK } from '../sdk/agents';
7
7
  import { ContactSDK } from '../sdk/contacts';
8
8
  import { CannedMessageSDK } from '../sdk/cannedMessages';
9
9
  import { TemplateMessageSDK } from '../sdk/templateMessages';
10
+ import { IntegrationServiceSDK } from '../sdk/integrationServices';
11
+ import { UserPreferencesSDK } from '../sdk/userPreferences';
10
12
  const ModuleFactory = {
11
13
  [ModuleNames.CHANNELS]: _ref => {
12
14
  let {
@@ -71,6 +73,22 @@ const ModuleFactory = {
71
73
  return new TemplateMessageSDK({
72
74
  config
73
75
  }).toJSON();
76
+ },
77
+ [ModuleNames.INTEGRATION_SERVICES]: _ref9 => {
78
+ let {
79
+ config
80
+ } = _ref9;
81
+ return new IntegrationServiceSDK({
82
+ config
83
+ }).toJSON();
84
+ },
85
+ [ModuleNames.USER_PREFERENCES]: _ref10 => {
86
+ let {
87
+ config
88
+ } = _ref10;
89
+ return new UserPreferencesSDK({
90
+ config
91
+ }).toJSON();
74
92
  }
75
93
  };
76
94
  export default ModuleFactory;
@@ -3,7 +3,7 @@ import ModuleFactory from './ModuleFactory';
3
3
  export default class ModuleManager {
4
4
  constructor() {
5
5
  this._modules = new Map();
6
- this.supportedModules = [ModuleNames.CHANNELS, ModuleNames.SESSIONS, ModuleNames.BOTS, ModuleNames.MESSAGES, ModuleNames.AGENTS, ModuleNames.CONTACTS, ModuleNames.CANNED_MESSAGES, ModuleNames.TEMPLATE_MESSAGES];
6
+ this.supportedModules = [ModuleNames.CHANNELS, ModuleNames.SESSIONS, ModuleNames.BOTS, ModuleNames.MESSAGES, ModuleNames.AGENTS, ModuleNames.CONTACTS, ModuleNames.CANNED_MESSAGES, ModuleNames.TEMPLATE_MESSAGES, ModuleNames.INTEGRATION_SERVICES, ModuleNames.USER_PREFERENCES];
7
7
  }
8
8
 
9
9
  initialize(_ref) {
@@ -51,6 +51,14 @@ export default class IMSDK {
51
51
  return this._moduleManager.getModule(ModuleNames.TEMPLATE_MESSAGES);
52
52
  }
53
53
 
54
+ get integrationServices() {
55
+ return this._moduleManager.getModule(ModuleNames.INTEGRATION_SERVICES);
56
+ }
57
+
58
+ get userPreferences() {
59
+ return this._moduleManager.getModule(ModuleNames.USER_PREFERENCES);
60
+ }
61
+
54
62
  hasModule(moduleName) {
55
63
  return this._moduleManager.hasModule(moduleName);
56
64
  }
@@ -65,6 +73,8 @@ export default class IMSDK {
65
73
  contacts: this.contacts,
66
74
  cannedMessages: this.cannedMessages,
67
75
  templateMessages: this.templateMessages,
76
+ integrationServices: this.integrationServices,
77
+ userPreferences: this.userPreferences,
68
78
  hasModule: this.hasModule.bind(this)
69
79
  };
70
80
  }
@@ -0,0 +1,30 @@
1
+ import { IntegrationService } from '../../../application/services';
2
+ import { IntegrationServiceRepository } from '../../../infrastructure/repositories';
3
+
4
+ class IntegrationServiceSDK {
5
+ constructor(_ref) {
6
+ let {
7
+ config
8
+ } = _ref;
9
+ const {
10
+ integrationServiceAPI,
11
+ integrationServiceAdapter
12
+ } = config;
13
+ const integrationServiceRepository = new IntegrationServiceRepository({
14
+ integrationServiceAPI,
15
+ integrationServiceAdapter
16
+ }).toJSON();
17
+ const integrationService = new IntegrationService({
18
+ integrationServiceRepository
19
+ }).toJSON();
20
+ this.services = { ...integrationService
21
+ };
22
+ }
23
+
24
+ toJSON() {
25
+ return this.services;
26
+ }
27
+
28
+ }
29
+
30
+ export default IntegrationServiceSDK;
@@ -0,0 +1,2 @@
1
+ import IntegrationServiceSDK from './IntegrationServiceSDK';
2
+ export { IntegrationServiceSDK };
@@ -0,0 +1,30 @@
1
+ import { UserPreferenceService } from '../../../application/services';
2
+ import { UserPreferenceRepository } from '../../../infrastructure/repositories';
3
+
4
+ class UserPreferencesSDK {
5
+ constructor(_ref) {
6
+ let {
7
+ config
8
+ } = _ref;
9
+ const {
10
+ userPreferenceAPI,
11
+ userPreferenceAdapter
12
+ } = config;
13
+ const userPreferenceRepository = new UserPreferenceRepository({
14
+ userPreferenceAPI,
15
+ userPreferenceAdapter
16
+ }).toJSON();
17
+ const userPreferenceService = new UserPreferenceService({
18
+ userPreferenceRepository
19
+ }).toJSON();
20
+ this.services = { ...userPreferenceService
21
+ };
22
+ }
23
+
24
+ toJSON() {
25
+ return this.services;
26
+ }
27
+
28
+ }
29
+
30
+ export default UserPreferencesSDK;
@@ -0,0 +1,2 @@
1
+ import UserPreferencesSDK from './UserPreferencesSDK';
2
+ export { UserPreferencesSDK };
@@ -1,5 +1,5 @@
1
1
  import { AdapterError } from '../../../core/errors';
2
- import { CannedMessage, Translation } from '../../../domain/entities';
2
+ import { CannedMessage } from '../../../domain/entities';
3
3
  import { IAdapter } from '../../../domain/interfaces';
4
4
  export default class CannedMessageAdapter extends IAdapter {
5
5
  adapt(cannedMessageData) {
@@ -8,7 +8,6 @@ export default class CannedMessageAdapter extends IAdapter {
8
8
  }
9
9
 
10
10
  try {
11
- const translations = Array.isArray(cannedMessageData.translations) ? cannedMessageData.translations.map(translation => new Translation(translation).toJSON()) : cannedMessageData.translations;
12
11
  return new CannedMessage({
13
12
  id: cannedMessageData.id,
14
13
  title: cannedMessageData.title,
@@ -20,7 +19,7 @@ export default class CannedMessageAdapter extends IAdapter {
20
19
  createdBy: cannedMessageData.createdBy,
21
20
  isActive: cannedMessageData.isActive,
22
21
  isPrivate: cannedMessageData.isPrivate,
23
- translations,
22
+ translations: cannedMessageData.translations,
24
23
  uuid: cannedMessageData.uuid,
25
24
  meta: cannedMessageData.meta,
26
25
  rejectedReason: cannedMessageData.rejectedReason,
@@ -1,3 +1,2 @@
1
1
  import CannedMessageAdapter from './CannedMessageAdapter';
2
- import TranslationAdapter from './TranslationAdapter';
3
- export { CannedMessageAdapter, TranslationAdapter };
2
+ export { CannedMessageAdapter };
@@ -8,18 +8,32 @@ export default class ChannelAdapter extends IAdapter {
8
8
  }
9
9
 
10
10
  try {
11
+ const {
12
+ integrationServiceId = '',
13
+ integrationService = {}
14
+ } = rawChannel;
15
+ const updatedIntegrationServiceId = integrationServiceId || integrationService.id;
11
16
  return new Channel({
12
17
  id: rawChannel.id,
13
- integrationService: rawChannel.integrationService,
18
+ integrationServiceType: updatedIntegrationServiceId,
19
+ integrationServiceId: updatedIntegrationServiceId,
14
20
  name: rawChannel.name,
15
21
  defaultBotId: rawChannel.defaultBotId,
16
22
  isActive: rawChannel.isActive,
23
+ isDeleted: rawChannel.isDeleted,
24
+ isSandBox: rawChannel.isSandBox,
17
25
  createdTime: rawChannel.createdTime,
18
26
  accountName: rawChannel.accountName,
27
+ universalLink: rawChannel.universalLink,
19
28
  isSubscribed: rawChannel.isSubscribed,
20
29
  createdBy: rawChannel.createdBy,
21
30
  isOwner: rawChannel.isOwner,
22
- photoURL: rawChannel.logoURL
31
+ photoURL: rawChannel.photoURL,
32
+ configParams: rawChannel.configParams,
33
+ authorizationPending: rawChannel.authorizationPending,
34
+ meta: rawChannel.meta,
35
+ logoURL: rawChannel.logoURL,
36
+ workspaceId: rawChannel.workspaceId
23
37
  }).toJSON();
24
38
  } catch (error) {
25
39
  throw new AdapterError(`Failed to adapt channel: ${error.message}`);
@@ -8,4 +8,5 @@ export * from './contacts';
8
8
  export * from './cannedMessages';
9
9
  export * from './templateMessages';
10
10
  export * from './customReplyExtension';
11
- export * from './placeholders';
11
+ export * from './integrationServices';
12
+ export * from './userPreferences';
@@ -0,0 +1,25 @@
1
+ import { AdapterError } from '../../../core/errors';
2
+ import { IntegrationService } from '../../../domain/entities';
3
+ import { IAdapter } from '../../../domain/interfaces';
4
+ export default class IntegrationServiceAdapter extends IAdapter {
5
+ adapt(integrationServiceData) {
6
+ if (!integrationServiceData) {
7
+ throw new AdapterError('IntegrationService data is required');
8
+ }
9
+
10
+ try {
11
+ return new IntegrationService({
12
+ id: integrationServiceData.id,
13
+ label: integrationServiceData.label,
14
+ provider: integrationServiceData.provider,
15
+ domain: integrationServiceData.domain,
16
+ channelAlias: integrationServiceData.channelAlias,
17
+ logoURL: integrationServiceData.logoURL,
18
+ isParentAccountNeeded: integrationServiceData.isParentAccountNeeded
19
+ }).toJSON();
20
+ } catch (error) {
21
+ throw new AdapterError(`Failed to adapt integrationService: ${error.message}`);
22
+ }
23
+ }
24
+
25
+ }
@@ -0,0 +1,2 @@
1
+ import IntegrationServiceAdapter from './IntegrationServiceAdapter';
2
+ export { IntegrationServiceAdapter };
@@ -0,0 +1,19 @@
1
+ import { AdapterError } from '../../../core/errors';
2
+ import { SessionMetrics } from '../../../domain/entities';
3
+ import { IAdapter } from '../../../domain/interfaces';
4
+ export default class SessionMetricsAdapter extends IAdapter {
5
+ adapt(sessionMetricsData) {
6
+ if (!sessionMetricsData) {
7
+ throw new AdapterError('Session metrics data is required');
8
+ }
9
+
10
+ try {
11
+ return new SessionMetrics({
12
+ assignee: sessionMetricsData.assignee
13
+ }).toJSON();
14
+ } catch (error) {
15
+ throw new AdapterError(`Failed to adapt session Metrics Data: ${error.message}`);
16
+ }
17
+ }
18
+
19
+ }