@zohoim/client-sdk 1.0.0-replyAreaPoc9 → 1.0.0-subscription2

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 (151) hide show
  1. package/es/application/services/channels/ChannelService.js +6 -1
  2. package/es/application/services/index.js +5 -1
  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/subscription/SubscriptionService.js +36 -0
  7. package/es/application/services/subscription/index.js +2 -0
  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/channels/getChannelRequest.js +13 -0
  17. package/es/domain/dto/channels/getChannelsRequest.js +3 -1
  18. package/es/domain/dto/channels/index.js +2 -1
  19. package/es/domain/dto/index.js +5 -1
  20. package/es/domain/dto/integrationServices/getIntegrationsRequest.js +7 -0
  21. package/es/domain/dto/integrationServices/index.js +1 -0
  22. package/es/domain/dto/sessions/getSessionAttachmentsRequest.js +6 -1
  23. package/es/domain/dto/sessions/getSessionMetricsRequest.js +16 -0
  24. package/es/domain/dto/sessions/index.js +2 -1
  25. package/es/domain/dto/subscription/buyAddOnRequest.js +18 -0
  26. package/es/domain/dto/subscription/getAddOnsRequest.js +15 -0
  27. package/es/domain/dto/subscription/getLicenseDetailsRequest.js +7 -0
  28. package/es/domain/dto/subscription/index.js +4 -0
  29. package/es/domain/dto/subscription/modifyAddOnRequest.js +18 -0
  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/Channel/Channel.js +22 -4
  36. package/es/domain/entities/IntegrationService/IntegrationService.js +8 -1
  37. package/es/domain/entities/Session/SessionMetrics.js +21 -0
  38. package/es/domain/entities/Session/index.js +2 -1
  39. package/es/domain/entities/Subscription/AddOn.js +26 -0
  40. package/es/domain/entities/Subscription/LicenseDetails.js +21 -0
  41. package/es/domain/entities/Subscription/SubscriptionInfo.js +26 -0
  42. package/es/domain/entities/Subscription/index.js +4 -0
  43. package/es/domain/entities/UserPreference/UserPreference.js +26 -0
  44. package/es/domain/entities/UserPreference/index.js +2 -0
  45. package/es/domain/entities/WhatsAppPricing/WhatsAppPricing.js +25 -0
  46. package/es/domain/entities/WhatsAppPricing/WhatsAppPricingCategory.js +22 -0
  47. package/es/domain/entities/WhatsAppPricing/index.js +3 -0
  48. package/es/domain/entities/index.js +4 -1
  49. package/es/domain/enum/index.js +3 -1
  50. package/es/domain/enum/session/AssigneeFilter.js +6 -0
  51. package/es/domain/enum/session/SessionReplyStatus.js +4 -1
  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/subscription/AddOnModule.js +5 -0
  55. package/es/domain/enum/subscription/AddOnName.js +5 -0
  56. package/es/domain/enum/subscription/AddOnType.js +5 -0
  57. package/es/domain/enum/subscription/SubscriptionStatus.js +4 -0
  58. package/es/domain/enum/subscription/index.js +5 -0
  59. package/es/domain/enum/userPreference/CollapseSidePanel.js +5 -0
  60. package/es/domain/enum/userPreference/index.js +2 -0
  61. package/es/domain/interfaces/repositories/channels/IChannelRepository.js +7 -1
  62. package/es/domain/interfaces/repositories/index.js +5 -1
  63. package/es/domain/interfaces/repositories/integrationServices/IIntegrationServiceRepository.js +17 -0
  64. package/es/domain/interfaces/repositories/integrationServices/index.js +2 -0
  65. package/es/domain/interfaces/repositories/sessions/ISessionRepository.js +6 -1
  66. package/es/domain/interfaces/repositories/subscription/ISubscriptionRepository.js +32 -0
  67. package/es/domain/interfaces/repositories/subscription/index.js +2 -0
  68. package/es/domain/interfaces/repositories/userPreferences/IUserPreferenceRepository.js +23 -0
  69. package/es/domain/interfaces/repositories/userPreferences/index.js +2 -0
  70. package/es/domain/interfaces/repositories/whatsAppPricing/IWhatsAppPricingRepository.js +18 -0
  71. package/es/domain/interfaces/repositories/whatsAppPricing/index.js +2 -0
  72. package/es/domain/schema/channel/ChannelSchema.js +39 -5
  73. package/es/domain/schema/index.js +4 -1
  74. package/es/domain/schema/integrationService/IntegrationServiceSchema.js +12 -0
  75. package/es/domain/schema/session/SessionMetrics/AssigneeSchema.js +20 -0
  76. package/es/domain/schema/session/SessionMetrics/SessionMetricsForAssigneeSchema.js +32 -0
  77. package/es/domain/schema/session/SessionMetrics/index.js +2 -0
  78. package/es/domain/schema/session/SessionMetricsSchema.js +9 -0
  79. package/es/domain/schema/session/index.js +2 -1
  80. package/es/domain/schema/subscription/AddOnSchema.js +29 -0
  81. package/es/domain/schema/subscription/LicenseDetailsSchema.js +7 -0
  82. package/es/domain/schema/subscription/SubscriptionInfoSchema.js +29 -0
  83. package/es/domain/schema/subscription/index.js +4 -0
  84. package/es/domain/schema/userPreference/UserPreferenceSchema.js +9 -0
  85. package/es/domain/schema/userPreference/index.js +2 -0
  86. package/es/domain/schema/whatsAppPricing/WhatsAppPricingCategorySchema.js +11 -0
  87. package/es/domain/schema/whatsAppPricing/WhatsAppPricingSchema.js +21 -0
  88. package/es/domain/schema/whatsAppPricing/index.js +3 -0
  89. package/es/frameworks/managers/ModuleFactory.js +84 -24
  90. package/es/frameworks/managers/ModuleManager.js +25 -2
  91. package/es/frameworks/sdk/IMSDK.js +33 -11
  92. package/es/frameworks/sdk/integrationServices/IntegrationServiceSDK.js +30 -0
  93. package/es/frameworks/sdk/integrationServices/index.js +2 -0
  94. package/es/frameworks/sdk/subscription/SubscriptionSDK.js +32 -0
  95. package/es/frameworks/sdk/subscription/index.js +2 -0
  96. package/es/frameworks/sdk/userPreferences/UserPreferencesSDK.js +30 -0
  97. package/es/frameworks/sdk/userPreferences/index.js +2 -0
  98. package/es/frameworks/sdk/whatsAppPricing/WhatsAppPricingSDK.js +28 -0
  99. package/es/frameworks/sdk/whatsAppPricing/index.js +2 -0
  100. package/es/infrastructure/adapters/channels/ChannelAdapter.js +16 -2
  101. package/es/infrastructure/adapters/index.js +5 -1
  102. package/es/infrastructure/adapters/integrationServices/IntegrationServiceAdapter.js +25 -0
  103. package/es/infrastructure/adapters/integrationServices/index.js +2 -0
  104. package/es/infrastructure/adapters/sessions/SessionMetricsAdapter.js +19 -0
  105. package/es/infrastructure/adapters/sessions/index.js +2 -1
  106. package/es/infrastructure/adapters/subscription/AddOnAdapter.js +24 -0
  107. package/es/infrastructure/adapters/subscription/LicenseDetailsAdapter.js +20 -0
  108. package/es/infrastructure/adapters/subscription/index.js +3 -0
  109. package/es/infrastructure/adapters/userPreferences/UserPreferenceAdapter.js +19 -0
  110. package/es/infrastructure/adapters/userPreferences/index.js +2 -0
  111. package/es/infrastructure/adapters/whatsAppPricing/WhatsAppPricingAdapter.js +22 -0
  112. package/es/infrastructure/adapters/whatsAppPricing/index.js +2 -0
  113. package/es/infrastructure/api/BaseAPI.js +5 -4
  114. package/es/infrastructure/api/index.js +5 -1
  115. package/es/infrastructure/api/integrationServices/IntegrationServiceAPI.js +14 -0
  116. package/es/infrastructure/api/integrationServices/index.js +2 -0
  117. package/es/infrastructure/api/registry/createPublicBaseUrl.js +4 -0
  118. package/es/infrastructure/api/registry/getRegistryConfig.js +9 -1
  119. package/es/infrastructure/api/registry/integrationServices/constructIntegrationServiceEndPoint.js +10 -0
  120. package/es/infrastructure/api/registry/integrationServices/index.js +2 -0
  121. package/es/infrastructure/api/registry/integrationServices/integrationServiceAPIRegistry.js +12 -0
  122. package/es/infrastructure/api/registry/sessions/sessionAPIRegistry.js +8 -2
  123. package/es/infrastructure/api/registry/subscription/constructSubscriptionEndPoint.js +10 -0
  124. package/es/infrastructure/api/registry/subscription/index.js +2 -0
  125. package/es/infrastructure/api/registry/subscription/subscriptionAPIRegistry.js +30 -0
  126. package/es/infrastructure/api/registry/userPreferences/constructUserPreferencesEndPoint.js +10 -0
  127. package/es/infrastructure/api/registry/userPreferences/index.js +2 -0
  128. package/es/infrastructure/api/registry/userPreferences/userPreferenceAPIRegistry.js +17 -0
  129. package/es/infrastructure/api/registry/whatsAppPricing/constructWhatsAppPricingEndPoint.js +10 -0
  130. package/es/infrastructure/api/registry/whatsAppPricing/index.js +2 -0
  131. package/es/infrastructure/api/registry/whatsAppPricing/whatsAppPricingAPIRegistry.js +13 -0
  132. package/es/infrastructure/api/sessions/SessionAPI.js +11 -1
  133. package/es/infrastructure/api/subscription/SubscriptionAPI.js +48 -0
  134. package/es/infrastructure/api/subscription/index.js +2 -0
  135. package/es/infrastructure/api/userPreferences/UserPreferenceAPI.js +24 -0
  136. package/es/infrastructure/api/userPreferences/index.js +2 -0
  137. package/es/infrastructure/api/whatsAppPricing/WhatsAppPricingAPI.js +14 -0
  138. package/es/infrastructure/api/whatsAppPricing/index.js +2 -0
  139. package/es/infrastructure/config/configRegistry.js +8 -1
  140. package/es/infrastructure/repositories/channels/ChannelRepository.js +10 -1
  141. package/es/infrastructure/repositories/index.js +5 -1
  142. package/es/infrastructure/repositories/integrationServices/IntegrationServiceRepository.js +49 -0
  143. package/es/infrastructure/repositories/integrationServices/index.js +2 -0
  144. package/es/infrastructure/repositories/sessions/SessionRepository.js +14 -3
  145. package/es/infrastructure/repositories/subscription/SubscriptionRepository.js +83 -0
  146. package/es/infrastructure/repositories/subscription/index.js +2 -0
  147. package/es/infrastructure/repositories/userPreferences/UserPreferenceRepository.js +58 -0
  148. package/es/infrastructure/repositories/userPreferences/index.js +2 -0
  149. package/es/infrastructure/repositories/whatsAppPricing/WhatsAppPricingRepository.js +49 -0
  150. package/es/infrastructure/repositories/whatsAppPricing/index.js +2 -0
  151. package/package.json +1 -1
@@ -0,0 +1,26 @@
1
+ import { validateSchema } from '../../../core/utils';
2
+ import { UserPreferenceSchema } from '../../schema';
3
+ import { CollapseSidePanel } from '../../enum';
4
+ export default class UserPreference {
5
+ constructor() {
6
+ let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7
+ const validatedData = validateSchema({
8
+ schema: UserPreferenceSchema,
9
+ data,
10
+ entityName: 'UserPreference'
11
+ });
12
+ this.data = {
13
+ collapseSidePanel: validatedData.collapseSidePanel
14
+ };
15
+ }
16
+
17
+ static isCollpseView(view) {
18
+ return view === CollapseSidePanel.ENABLED;
19
+ }
20
+
21
+ toJSON() {
22
+ return { ...this.data
23
+ };
24
+ }
25
+
26
+ }
@@ -0,0 +1,2 @@
1
+ import UserPreference from './UserPreference';
2
+ export { UserPreference };
@@ -0,0 +1,25 @@
1
+ import { validateSchema } from '../../../core/utils';
2
+ import { WhatsAppPricingSchema } from '../../schema';
3
+ import WhatsAppPricingCategory from './WhatsAppPricingCategory';
4
+ export default class WhatsAppPricing {
5
+ constructor() {
6
+ let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7
+ const validatedData = validateSchema({
8
+ schema: WhatsAppPricingSchema,
9
+ data,
10
+ entityName: 'WhatsAppPricing'
11
+ });
12
+ this.data = {
13
+ total: validatedData.total,
14
+ creditsCount: validatedData.creditsCount,
15
+ actutalCreditsAmount: validatedData.actutalCreditsAmount,
16
+ category: validatedData.category.map(item => new WhatsAppPricingCategory(item).toJSON())
17
+ };
18
+ }
19
+
20
+ toJSON() {
21
+ return { ...this.data
22
+ };
23
+ }
24
+
25
+ }
@@ -0,0 +1,22 @@
1
+ import { validateSchema } from '../../../core/utils';
2
+ import { WhatsAppPricingCategorySchema } from '../../schema';
3
+ export default class WhatsAppPricingCategory {
4
+ constructor() {
5
+ let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6
+ const validatedData = validateSchema({
7
+ schema: WhatsAppPricingCategorySchema,
8
+ data,
9
+ entityName: 'WhatsAppPricingCategory'
10
+ });
11
+ this.data = {
12
+ type: validatedData.type,
13
+ value: validatedData.value
14
+ };
15
+ }
16
+
17
+ toJSON() {
18
+ return { ...this.data
19
+ };
20
+ }
21
+
22
+ }
@@ -0,0 +1,3 @@
1
+ import WhatsAppPricing from './WhatsAppPricing';
2
+ import WhatsAppPricingCategory from './WhatsAppPricingCategory';
3
+ export { WhatsAppPricing, WhatsAppPricingCategory };
@@ -9,4 +9,7 @@ export * from './Contact';
9
9
  export * from './IntegrationService';
10
10
  export * from './CannedMessage';
11
11
  export * from './TemplateMessage';
12
- export * from './CustomReplyExtension';
12
+ export * from './CustomReplyExtension';
13
+ export * from './UserPreference';
14
+ export * from './WhatsAppPricing';
15
+ export * from './subscription';
@@ -5,4 +5,6 @@ export * from './bot';
5
5
  export * from './message';
6
6
  export * from './attachment';
7
7
  export * from './cannedMessage';
8
- export * from './templateMessage';
8
+ export * from './templateMessage';
9
+ export * from './userPreference';
10
+ export * from './subscription';
@@ -0,0 +1,6 @@
1
+ const AssigneeFilter = {
2
+ NONE: 'NONE',
3
+ UNASSIGNED: 'UNASSIGNED',
4
+ MINE: 'MINE'
5
+ };
6
+ export default AssigneeFilter;
@@ -16,6 +16,9 @@ const SessionReplyStatus = {
16
16
  CHANNEL_DELETED: 'CHANNEL_DELETED',
17
17
  ENDUSER_OFFLINE: 'ENDUSER_OFFLINE',
18
18
  CONFIG_SKIPPED_CHANNEL: 'CONFIG_SKIPPED_CHANNEL',
19
- ASSIGNED_TO_OTHER_SERVICE: 'ASSIGNED_TO_OTHER_SERVICE'
19
+ ASSIGNED_TO_OTHER_SERVICE: 'ASSIGNED_TO_OTHER_SERVICE',
20
+ WECOM_TRAIL_EXPIRED: 'WECOM_TRAIL_EXPIRED',
21
+ WECOM_LICENSE_EXPIRED: 'WECOM_LICENSE_EXPIRED',
22
+ OUTGOING_LIMIT_REACHED: 'OUTGOING_LIMIT_REACHED'
20
23
  };
21
24
  export default SessionReplyStatus;
@@ -5,6 +5,7 @@ const SessionStatus = {
5
5
  ON_HOLD: 'ON_HOLD',
6
6
  ENDED: 'ENDED',
7
7
  BLOCKED: 'BLOCKED',
8
- UNASSIGNED: 'UNASSIGNED'
8
+ UNASSIGNED: 'UNASSIGNED',
9
+ MISSED: 'MISSED'
9
10
  };
10
11
  export default SessionStatus;
@@ -1,3 +1,4 @@
1
1
  import SessionReplyStatus from './SessionReplyStatus';
2
2
  import SessionStatus from './SessionStatus';
3
- export { SessionStatus, SessionReplyStatus };
3
+ import AssigneeFilter from './AssigneeFilter';
4
+ export { SessionStatus, SessionReplyStatus, AssigneeFilter };
@@ -0,0 +1,5 @@
1
+ const AddOnModule = {
2
+ CHANNEL: 'CHANNEL',
3
+ MESSAGE: 'MESSAGE'
4
+ };
5
+ export default AddOnModule;
@@ -0,0 +1,5 @@
1
+ const AddOnName = {
2
+ IM_CREDITS: 'IM_CREDITS',
3
+ TWILIO_PHONENUMBER: 'TWILIO_PHONENUMBER'
4
+ };
5
+ export default AddOnName;
@@ -0,0 +1,5 @@
1
+ const AddOnType = {
2
+ COUNT: 'COUNT',
3
+ CREDIT: 'CREDIT'
4
+ };
5
+ export default AddOnType;
@@ -0,0 +1,4 @@
1
+ const SubscriptionStatus = {
2
+ PURCHASED: 'PURCHASED'
3
+ };
4
+ export default SubscriptionStatus;
@@ -0,0 +1,5 @@
1
+ import AddOnModule from './AddOnModule';
2
+ import AddOnName from './AddOnName';
3
+ import AddOnType from './AddOnType';
4
+ import SubscriptionStatus from './SubscriptionStatus';
5
+ export { AddOnModule, AddOnName, AddOnType, SubscriptionStatus };
@@ -0,0 +1,5 @@
1
+ const CollapseSidePanel = {
2
+ ENABLED: 'ENABLED',
3
+ DISABLED: 'DISABLED'
4
+ };
5
+ export default CollapseSidePanel;
@@ -0,0 +1,2 @@
1
+ import CollapseSidePanel from './CollapseSidePanel';
2
+ export { CollapseSidePanel };
@@ -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,8 @@ 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';
11
+ export * from './whatsAppPricing';
12
+ export * from './subscription';
@@ -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
  }
@@ -0,0 +1,32 @@
1
+ /* eslint-disable no-unused-vars */
2
+ import { ModuleNames } from '../../../../core/constants';
3
+ import BaseAPI from '../../../../infrastructure/api/BaseAPI';
4
+ import { getAddOnsRequest, buyAddOnRequest, modifyAddOnRequest, getLicenseDetailsRequest } from '../../../dto';
5
+ export default class ISubscriptionRepository extends BaseAPI {
6
+ constructor() {
7
+ super({
8
+ module: ModuleNames.SUBSCRIPTION
9
+ });
10
+ }
11
+
12
+ getAddOns() {
13
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getAddOnsRequest();
14
+ throw new Error('Method not implemented.');
15
+ }
16
+
17
+ buyAddOn() {
18
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : buyAddOnRequest();
19
+ throw new Error('Method not implemented.');
20
+ }
21
+
22
+ modifyAddOn() {
23
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : modifyAddOnRequest();
24
+ throw new Error('Method not implemented.');
25
+ }
26
+
27
+ getLicenseDetails() {
28
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLicenseDetailsRequest();
29
+ throw new Error('Method not implemented.');
30
+ }
31
+
32
+ }
@@ -0,0 +1,2 @@
1
+ import ISubscriptionRepository from './ISubscriptionRepository';
2
+ export { ISubscriptionRepository };
@@ -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 };
@@ -0,0 +1,18 @@
1
+ /* eslint-disable no-unused-vars */
2
+ import { ModuleNames, ModuleTypes } from '../../../../core/constants';
3
+ import BaseAPI from '../../../../infrastructure/api/BaseAPI';
4
+ import { calculateWhatsAppPricingRequest } from '../../../dto';
5
+ export default class IWhatsAppPricingRepository extends BaseAPI {
6
+ constructor() {
7
+ super({
8
+ module: ModuleNames.WHATSAPP_PRICING,
9
+ moduleType: ModuleTypes.PUBLIC
10
+ });
11
+ }
12
+
13
+ async calculateWhatsAppPricing() {
14
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : calculateWhatsAppPricingRequest();
15
+ throw new Error('Method not implemented');
16
+ }
17
+
18
+ }
@@ -0,0 +1,2 @@
1
+ import IWhatsAppPricingRepository from './IWhatsAppPricingRepository';
2
+ export { IWhatsAppPricingRepository };
@@ -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;
@@ -8,4 +8,7 @@ export * from './integrationService';
8
8
  export * from './contact';
9
9
  export * from './cannedMessage';
10
10
  export * from './templateMessage';
11
- export * from './customReplyExtension';
11
+ export * from './customReplyExtension';
12
+ export * from './userPreference';
13
+ export * from './whatsAppPricing';
14
+ export * from './subscription';
@@ -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,29 @@
1
+ import { AddOnModule, AddOnName, AddOnType } from '../../enum';
2
+ import SubscriptionInfoSchema from './SubscriptionInfoSchema';
3
+ const AddOnSchema = {
4
+ name: {
5
+ type: 'string',
6
+ required: true,
7
+ enum: Object.values(AddOnName)
8
+ },
9
+ type: {
10
+ type: 'string',
11
+ required: true,
12
+ enum: Object.values(AddOnType)
13
+ },
14
+ module: {
15
+ type: 'string',
16
+ required: true,
17
+ enum: Object.values(AddOnModule)
18
+ },
19
+ cost: {
20
+ type: 'string',
21
+ required: false
22
+ },
23
+ subscriptionInfo: {
24
+ type: 'object',
25
+ required: false,
26
+ schema: SubscriptionInfoSchema
27
+ }
28
+ };
29
+ export default AddOnSchema;
@@ -0,0 +1,7 @@
1
+ const LicenseDetailsSchema = {
2
+ paymentSource: {
3
+ type: 'boolean',
4
+ required: true
5
+ }
6
+ };
7
+ export default LicenseDetailsSchema;
@@ -0,0 +1,29 @@
1
+ import { SubscriptionStatus } from '../../enum';
2
+ const SubscriptionInfoSchema = {
3
+ count: {
4
+ type: 'string',
5
+ required: true
6
+ },
7
+ available: {
8
+ type: 'string',
9
+ required: true
10
+ },
11
+ renewalCount: {
12
+ type: 'string',
13
+ required: false
14
+ },
15
+ renewalThreshold: {
16
+ type: 'string',
17
+ required: false
18
+ },
19
+ status: {
20
+ type: 'string',
21
+ required: true,
22
+ enum: Object.values(SubscriptionStatus)
23
+ },
24
+ reserved: {
25
+ type: 'string',
26
+ required: false
27
+ }
28
+ };
29
+ export default SubscriptionInfoSchema;
@@ -0,0 +1,4 @@
1
+ import AddOnSchema from './AddOnSchema';
2
+ import LicenseDetailsSchema from './LicenseDetailsSchema';
3
+ import SubscriptionInfoSchema from './SubscriptionInfoSchema';
4
+ export { AddOnSchema, LicenseDetailsSchema, SubscriptionInfoSchema };
@@ -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 };
@@ -0,0 +1,11 @@
1
+ const WhatsAppPricingCategorySchema = {
2
+ type: {
3
+ type: 'string',
4
+ required: true
5
+ },
6
+ value: {
7
+ type: 'number',
8
+ required: true
9
+ }
10
+ };
11
+ export default WhatsAppPricingCategorySchema;
@@ -0,0 +1,21 @@
1
+ import WhatsAppPricingCategorySchema from './WhatsAppPricingCategorySchema';
2
+ const WhatsAppPricingSchema = {
3
+ total: {
4
+ type: 'number',
5
+ required: true
6
+ },
7
+ creditsCount: {
8
+ type: 'number',
9
+ required: true
10
+ },
11
+ actutalCreditsAmount: {
12
+ type: 'number',
13
+ required: true
14
+ },
15
+ category: {
16
+ type: 'array',
17
+ required: true,
18
+ schema: WhatsAppPricingCategorySchema
19
+ }
20
+ };
21
+ export default WhatsAppPricingSchema;