@zohoim/client-sdk 1.0.0-replyAreaPoc9 → 1.0.0-rightPanelSessionInfo-2
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.
- package/es/application/services/calls/CallService.js +36 -0
- package/es/application/services/calls/index.js +1 -0
- package/es/application/services/cannedMessages/CannedMessageService.js +21 -1
- package/es/application/services/channels/ChannelService.js +6 -1
- package/es/application/services/contacts/ContactService.js +6 -1
- package/es/application/services/index.js +6 -1
- package/es/application/services/integrationServices/IntegrationService.js +21 -0
- package/es/application/services/integrationServices/index.js +2 -0
- package/es/application/services/sessions/SessionService.js +6 -1
- package/es/application/services/subscription/SubscriptionService.js +36 -0
- package/es/application/services/subscription/index.js +2 -0
- package/es/application/services/templateMessages/TemplateMessageService.js +6 -1
- package/es/application/services/userPreferences/UserPreferenceService.js +26 -0
- package/es/application/services/userPreferences/index.js +2 -0
- package/es/application/services/whatsAppPricing/WhatsAppPricingService.js +21 -0
- package/es/application/services/whatsAppPricing/index.js +2 -0
- package/es/core/constants/ModuleNames.js +6 -1
- package/es/core/constants/ModuleTypes.js +5 -0
- package/es/core/constants/index.js +2 -1
- package/es/core/utils/validateSchema.js +27 -2
- package/es/domain/dto/calls/getCallRequest.js +14 -0
- package/es/domain/dto/calls/getCallsRequest.js +20 -0
- package/es/domain/dto/calls/index.js +4 -0
- package/es/domain/dto/calls/initiateCallRequest.js +15 -0
- package/es/domain/dto/calls/updateCallStatusRequest.js +15 -0
- package/es/domain/dto/cannedMessages/addTranslationRequest.js +19 -0
- package/es/domain/dto/cannedMessages/deleteTranslationRequest.js +14 -0
- package/es/domain/dto/cannedMessages/getCannedPlaceholdersRequest.js +7 -0
- package/es/domain/dto/cannedMessages/index.js +5 -1
- package/es/domain/dto/cannedMessages/updateTranslationRequest.js +20 -0
- package/es/domain/dto/channels/getChannelRequest.js +13 -0
- package/es/domain/dto/channels/getChannelsRequest.js +3 -1
- package/es/domain/dto/channels/index.js +2 -1
- package/es/domain/dto/contacts/getContactRequest.js +13 -0
- package/es/domain/dto/contacts/index.js +2 -1
- package/es/domain/dto/index.js +6 -1
- package/es/domain/dto/integrationServices/getIntegrationsRequest.js +7 -0
- package/es/domain/dto/integrationServices/index.js +1 -0
- package/es/domain/dto/sessions/getSessionAttachmentsRequest.js +6 -1
- package/es/domain/dto/sessions/getSessionMetricsRequest.js +16 -0
- package/es/domain/dto/sessions/index.js +2 -1
- package/es/domain/dto/subscription/buyAddOnRequest.js +18 -0
- package/es/domain/dto/subscription/getAddOnsRequest.js +15 -0
- package/es/domain/dto/subscription/getLicenseDetailsRequest.js +7 -0
- package/es/domain/dto/subscription/index.js +4 -0
- package/es/domain/dto/subscription/modifyAddOnRequest.js +18 -0
- package/es/domain/dto/templateMessages/getTemplateCreditExhaustStatusRequest.js +3 -2
- package/es/domain/dto/templateMessages/getTemplateTagsRequest.js +7 -0
- package/es/domain/dto/templateMessages/index.js +2 -1
- package/es/domain/dto/userPreferences/getPreferencesRequest.js +7 -0
- package/es/domain/dto/userPreferences/index.js +2 -0
- package/es/domain/dto/userPreferences/updatePreferencesRequest.js +9 -0
- package/es/domain/dto/whatsAppPricing/calculateWhatsAppPricingRequest.js +14 -0
- package/es/domain/dto/whatsAppPricing/index.js +1 -0
- package/es/domain/entities/Actor/Actor.js +4 -0
- package/es/domain/entities/Call/Call.js +47 -0
- package/es/domain/entities/Call/index.js +1 -0
- package/es/domain/entities/CannedMessage/CannedMessage.js +34 -6
- package/es/domain/entities/CannedMessage/Translation.js +48 -0
- package/es/domain/entities/CannedMessage/index.js +2 -1
- package/es/domain/entities/Channel/Channel.js +22 -4
- package/es/domain/entities/Contact/Contact.js +4 -1
- package/es/domain/entities/IntegrationService/IntegrationService.js +8 -1
- package/es/domain/entities/Placeholder/Placeholder.js +24 -0
- package/es/domain/entities/Placeholder/index.js +2 -0
- package/es/domain/entities/Session/SessionMetrics.js +21 -0
- package/es/domain/entities/Session/index.js +2 -1
- package/es/domain/entities/Subscription/AddOn.js +26 -0
- package/es/domain/entities/Subscription/LicenseDetails.js +21 -0
- package/es/domain/entities/Subscription/SubscriptionInfo.js +26 -0
- package/es/domain/entities/Subscription/index.js +4 -0
- package/es/domain/entities/TemplateMessage/TemplateItemButton.js +48 -0
- package/es/domain/entities/TemplateMessage/TemplateItemFooter.js +27 -0
- package/es/domain/entities/TemplateMessage/TemplateItemHeader.js +48 -0
- package/es/domain/entities/TemplateMessage/TemplateTags.js +21 -0
- package/es/domain/entities/TemplateMessage/index.js +5 -1
- package/es/domain/entities/UserPreference/UserPreference.js +26 -0
- package/es/domain/entities/UserPreference/index.js +2 -0
- package/es/domain/entities/WhatsAppPricing/WhatsAppPricing.js +25 -0
- package/es/domain/entities/WhatsAppPricing/WhatsAppPricingCategory.js +22 -0
- package/es/domain/entities/WhatsAppPricing/index.js +3 -0
- package/es/domain/entities/index.js +6 -1
- package/es/domain/enum/call/CallStatus.js +8 -0
- package/es/domain/enum/call/index.js +1 -0
- package/es/domain/enum/cannedMessage/CannedMessageStatus.js +11 -1
- package/es/domain/enum/cannedMessage/CannedMessageType.js +3 -1
- package/es/domain/enum/cannedMessage/TemplateItemButtonType.js +7 -1
- package/es/domain/enum/cannedMessage/TemplateItemHeaderType.js +3 -1
- package/es/domain/enum/index.js +4 -1
- package/es/domain/enum/message/InfoAction.js +4 -1
- package/es/domain/enum/session/AssigneeFilter.js +6 -0
- package/es/domain/enum/session/SessionReplyStatus.js +4 -1
- package/es/domain/enum/session/SessionStatus.js +2 -1
- package/es/domain/enum/session/index.js +2 -1
- package/es/domain/enum/subscription/AddOnModule.js +5 -0
- package/es/domain/enum/subscription/AddOnName.js +5 -0
- package/es/domain/enum/subscription/AddOnType.js +5 -0
- package/es/domain/enum/subscription/SubscriptionStatus.js +4 -0
- package/es/domain/enum/subscription/index.js +5 -0
- package/es/domain/enum/userPreference/CollapseSidePanel.js +5 -0
- package/es/domain/enum/userPreference/index.js +2 -0
- package/es/domain/interfaces/repositories/calls/ICallRepository.js +32 -0
- package/es/domain/interfaces/repositories/calls/index.js +1 -0
- package/es/domain/interfaces/repositories/cannedMessages/ICannedMessageRepository.js +21 -1
- package/es/domain/interfaces/repositories/channels/IChannelRepository.js +7 -1
- package/es/domain/interfaces/repositories/contacts/IContactRepository.js +7 -1
- package/es/domain/interfaces/repositories/index.js +6 -1
- package/es/domain/interfaces/repositories/integrationServices/IIntegrationServiceRepository.js +17 -0
- package/es/domain/interfaces/repositories/integrationServices/index.js +2 -0
- package/es/domain/interfaces/repositories/sessions/ISessionRepository.js +6 -1
- package/es/domain/interfaces/repositories/subscription/ISubscriptionRepository.js +32 -0
- package/es/domain/interfaces/repositories/subscription/index.js +2 -0
- package/es/domain/interfaces/repositories/templateMessages/ITemplateMessageRepository.js +7 -1
- package/es/domain/interfaces/repositories/userPreferences/IUserPreferenceRepository.js +23 -0
- package/es/domain/interfaces/repositories/userPreferences/index.js +2 -0
- package/es/domain/interfaces/repositories/whatsAppPricing/IWhatsAppPricingRepository.js +18 -0
- package/es/domain/interfaces/repositories/whatsAppPricing/index.js +2 -0
- package/es/domain/schema/call/CallSchema.js +63 -0
- package/es/domain/schema/call/index.js +1 -0
- package/es/domain/schema/cannedMessage/CannedMessageSchema.js +12 -0
- package/es/domain/schema/cannedMessage/TemplateItem/TemplateItemButtonsSchema.js +1 -1
- package/es/domain/schema/cannedMessage/TranslationsSchema.js +2 -2
- package/es/domain/schema/cannedMessage/index.js +3 -1
- package/es/domain/schema/channel/ChannelSchema.js +39 -5
- package/es/domain/schema/contact/ContactSchema.js +12 -0
- package/es/domain/schema/index.js +6 -1
- package/es/domain/schema/integrationService/IntegrationServiceSchema.js +12 -0
- package/es/domain/schema/placeholder/PlaceholderSchema.js +19 -0
- package/es/domain/schema/placeholder/index.js +2 -0
- package/es/domain/schema/session/SessionMetrics/AssigneeSchema.js +20 -0
- package/es/domain/schema/session/SessionMetrics/SessionMetricsForAssigneeSchema.js +32 -0
- package/es/domain/schema/session/SessionMetrics/index.js +2 -0
- package/es/domain/schema/session/SessionMetricsSchema.js +9 -0
- package/es/domain/schema/session/index.js +2 -1
- package/es/domain/schema/subscription/AddOnSchema.js +29 -0
- package/es/domain/schema/subscription/LicenseDetailsSchema.js +7 -0
- package/es/domain/schema/subscription/SubscriptionInfoSchema.js +29 -0
- package/es/domain/schema/subscription/index.js +4 -0
- package/es/domain/schema/templateMessage/TemplateTagsSchema.js +7 -0
- package/es/domain/schema/templateMessage/index.js +2 -1
- package/es/domain/schema/userPreference/UserPreferenceSchema.js +9 -0
- package/es/domain/schema/userPreference/index.js +2 -0
- package/es/domain/schema/whatsAppPricing/WhatsAppPricingCategorySchema.js +11 -0
- package/es/domain/schema/whatsAppPricing/WhatsAppPricingSchema.js +21 -0
- package/es/domain/schema/whatsAppPricing/index.js +3 -0
- package/es/frameworks/managers/ModuleFactory.js +95 -24
- package/es/frameworks/managers/ModuleManager.js +25 -2
- package/es/frameworks/sdk/IMSDK.js +38 -11
- package/es/frameworks/sdk/calls/CallSDK.js +27 -0
- package/es/frameworks/sdk/calls/index.js +1 -0
- package/es/frameworks/sdk/integrationServices/IntegrationServiceSDK.js +30 -0
- package/es/frameworks/sdk/integrationServices/index.js +2 -0
- package/es/frameworks/sdk/subscription/SubscriptionSDK.js +32 -0
- package/es/frameworks/sdk/subscription/index.js +2 -0
- package/es/frameworks/sdk/userPreferences/UserPreferencesSDK.js +30 -0
- package/es/frameworks/sdk/userPreferences/index.js +2 -0
- package/es/frameworks/sdk/whatsAppPricing/WhatsAppPricingSDK.js +28 -0
- package/es/frameworks/sdk/whatsAppPricing/index.js +2 -0
- package/es/infrastructure/adapters/calls/CallAdapter.js +31 -0
- package/es/infrastructure/adapters/calls/index.js +1 -0
- package/es/infrastructure/adapters/cannedMessages/CannedMessageAdapter.js +3 -1
- package/es/infrastructure/adapters/cannedMessages/TranslationAdapter.js +27 -0
- package/es/infrastructure/adapters/cannedMessages/index.js +2 -1
- package/es/infrastructure/adapters/channels/ChannelAdapter.js +16 -2
- package/es/infrastructure/adapters/contacts/ContactAdapter.js +4 -1
- package/es/infrastructure/adapters/index.js +7 -1
- package/es/infrastructure/adapters/integrationServices/IntegrationServiceAdapter.js +25 -0
- package/es/infrastructure/adapters/integrationServices/index.js +2 -0
- package/es/infrastructure/adapters/placeholders/PlaceholderAdapter.js +22 -0
- package/es/infrastructure/adapters/placeholders/index.js +2 -0
- package/es/infrastructure/adapters/sessions/SessionMetricsAdapter.js +19 -0
- package/es/infrastructure/adapters/sessions/index.js +2 -1
- package/es/infrastructure/adapters/subscription/AddOnAdapter.js +24 -0
- package/es/infrastructure/adapters/subscription/LicenseDetailsAdapter.js +20 -0
- package/es/infrastructure/adapters/subscription/index.js +3 -0
- package/es/infrastructure/adapters/templateMessages/TemplateTagsAdapter.js +21 -0
- package/es/infrastructure/adapters/templateMessages/index.js +2 -1
- package/es/infrastructure/adapters/userPreferences/UserPreferenceAdapter.js +19 -0
- package/es/infrastructure/adapters/userPreferences/index.js +2 -0
- package/es/infrastructure/adapters/whatsAppPricing/WhatsAppPricingAdapter.js +22 -0
- package/es/infrastructure/adapters/whatsAppPricing/index.js +2 -0
- package/es/infrastructure/api/BaseAPI.js +5 -4
- package/es/infrastructure/api/calls/CallAPI.js +44 -0
- package/es/infrastructure/api/calls/index.js +1 -0
- package/es/infrastructure/api/cannedMessages/CannedMessageAPI.js +41 -1
- package/es/infrastructure/api/channels/ChannelAPI.js +11 -1
- package/es/infrastructure/api/contacts/ContactAPI.js +11 -1
- package/es/infrastructure/api/index.js +6 -1
- package/es/infrastructure/api/integrationServices/IntegrationServiceAPI.js +14 -0
- package/es/infrastructure/api/integrationServices/index.js +2 -0
- package/es/infrastructure/api/registry/calls/callAPIRegistry.js +29 -0
- package/es/infrastructure/api/registry/calls/constructCallEndPoint.js +10 -0
- package/es/infrastructure/api/registry/calls/index.js +1 -0
- package/es/infrastructure/api/registry/cannedMessages/cannedMessageAPIRegistry.js +22 -2
- package/es/infrastructure/api/registry/channels/channelAPIRegistry.js +7 -1
- package/es/infrastructure/api/registry/channels/channelAgentAPIRegistry.js +1 -1
- package/es/infrastructure/api/registry/contacts/contactAPIRegistry.js +8 -2
- package/es/infrastructure/api/registry/createPublicBaseUrl.js +4 -0
- package/es/infrastructure/api/registry/getRegistryConfig.js +11 -1
- package/es/infrastructure/api/registry/integrationServices/constructIntegrationServiceEndPoint.js +10 -0
- package/es/infrastructure/api/registry/integrationServices/index.js +2 -0
- package/es/infrastructure/api/registry/integrationServices/integrationServiceAPIRegistry.js +12 -0
- package/es/infrastructure/api/registry/sessions/sessionAPIRegistry.js +9 -3
- package/es/infrastructure/api/registry/subscription/constructSubscriptionEndPoint.js +10 -0
- package/es/infrastructure/api/registry/subscription/index.js +2 -0
- package/es/infrastructure/api/registry/subscription/subscriptionAPIRegistry.js +30 -0
- package/es/infrastructure/api/registry/templateMessages/templateMessageAPIRegistry.js +7 -2
- package/es/infrastructure/api/registry/userPreferences/constructUserPreferencesEndPoint.js +10 -0
- package/es/infrastructure/api/registry/userPreferences/index.js +2 -0
- package/es/infrastructure/api/registry/userPreferences/userPreferenceAPIRegistry.js +17 -0
- package/es/infrastructure/api/registry/whatsAppPricing/constructWhatsAppPricingEndPoint.js +10 -0
- package/es/infrastructure/api/registry/whatsAppPricing/index.js +2 -0
- package/es/infrastructure/api/registry/whatsAppPricing/whatsAppPricingAPIRegistry.js +13 -0
- package/es/infrastructure/api/sessions/SessionAPI.js +11 -1
- package/es/infrastructure/api/subscription/SubscriptionAPI.js +48 -0
- package/es/infrastructure/api/subscription/index.js +2 -0
- package/es/infrastructure/api/templateMessages/TemplateMessageAPI.js +11 -1
- package/es/infrastructure/api/userPreferences/UserPreferenceAPI.js +24 -0
- package/es/infrastructure/api/userPreferences/index.js +2 -0
- package/es/infrastructure/api/whatsAppPricing/WhatsAppPricingAPI.js +14 -0
- package/es/infrastructure/api/whatsAppPricing/index.js +2 -0
- package/es/infrastructure/config/configRegistry.js +8 -1
- package/es/infrastructure/repositories/calls/CallRepository.js +73 -0
- package/es/infrastructure/repositories/calls/index.js +1 -0
- package/es/infrastructure/repositories/cannedMessages/CannedMessageRepository.js +50 -7
- package/es/infrastructure/repositories/channels/ChannelRepository.js +10 -1
- package/es/infrastructure/repositories/contacts/ContactRepository.js +9 -1
- package/es/infrastructure/repositories/index.js +6 -1
- package/es/infrastructure/repositories/integrationServices/IntegrationServiceRepository.js +49 -0
- package/es/infrastructure/repositories/integrationServices/index.js +2 -0
- package/es/infrastructure/repositories/sessions/SessionRepository.js +14 -3
- package/es/infrastructure/repositories/subscription/SubscriptionRepository.js +83 -0
- package/es/infrastructure/repositories/subscription/index.js +2 -0
- package/es/infrastructure/repositories/templateMessages/TemplateMessageRepository.js +15 -3
- package/es/infrastructure/repositories/userPreferences/UserPreferenceRepository.js +58 -0
- package/es/infrastructure/repositories/userPreferences/index.js +2 -0
- package/es/infrastructure/repositories/whatsAppPricing/WhatsAppPricingRepository.js +49 -0
- package/es/infrastructure/repositories/whatsAppPricing/index.js +2 -0
- package/package.json +2 -2
|
@@ -60,6 +60,18 @@ 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
|
|
63
75
|
}
|
|
64
76
|
};
|
|
65
77
|
export default CannedMessageSchema;
|
|
@@ -15,7 +15,7 @@ const TranslationsSchema = {
|
|
|
15
15
|
},
|
|
16
16
|
message: {
|
|
17
17
|
type: 'string',
|
|
18
|
-
required:
|
|
18
|
+
required: false
|
|
19
19
|
},
|
|
20
20
|
uuid: {
|
|
21
21
|
type: 'string',
|
|
@@ -31,7 +31,7 @@ const TranslationsSchema = {
|
|
|
31
31
|
},
|
|
32
32
|
status: {
|
|
33
33
|
type: 'string',
|
|
34
|
-
required:
|
|
34
|
+
required: false,
|
|
35
35
|
enum: Object.values(CannedMessageStatus)
|
|
36
36
|
},
|
|
37
37
|
templateItems: {
|
|
@@ -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
|
-
|
|
8
|
-
type: '
|
|
9
|
-
required:
|
|
10
|
-
|
|
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;
|
|
@@ -22,6 +22,18 @@ const ContactSchema = {
|
|
|
22
22
|
mobile: {
|
|
23
23
|
type: 'string',
|
|
24
24
|
required: false
|
|
25
|
+
},
|
|
26
|
+
webUrl: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
required: false
|
|
29
|
+
},
|
|
30
|
+
layoutId: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
required: false
|
|
33
|
+
},
|
|
34
|
+
customFields: {
|
|
35
|
+
type: 'object',
|
|
36
|
+
required: false
|
|
25
37
|
}
|
|
26
38
|
};
|
|
27
39
|
export default ContactSchema;
|
|
@@ -8,4 +8,9 @@ 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 './placeholder';
|
|
13
|
+
export * from './userPreference';
|
|
14
|
+
export * from './whatsAppPricing';
|
|
15
|
+
export * from './call';
|
|
16
|
+
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,19 @@
|
|
|
1
|
+
const PlaceholderSchema = {
|
|
2
|
+
apiName: {
|
|
3
|
+
type: 'string',
|
|
4
|
+
required: false
|
|
5
|
+
},
|
|
6
|
+
i18nFieldLabel: {
|
|
7
|
+
type: 'string',
|
|
8
|
+
required: true
|
|
9
|
+
},
|
|
10
|
+
fieldLabel: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
placeHolder: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
required: true
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export default PlaceholderSchema;
|
|
@@ -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,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,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;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import TemplateLanguageSchema from './TemplateLanguageSchema';
|
|
2
2
|
import TemplateCreditExhaustStatusSchema from './TemplateCreditExhaustStatusSchema';
|
|
3
|
-
|
|
3
|
+
import TemplateTagsSchema from './TemplateTagsSchema';
|
|
4
|
+
export { TemplateLanguageSchema, TemplateCreditExhaustStatusSchema, TemplateTagsSchema };
|
|
@@ -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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModuleNames } from '../../core/constants';
|
|
1
|
+
import { ModuleNames, ModuleTypes } from '../../core/constants';
|
|
2
2
|
import { BotSDK } from '../sdk/bots';
|
|
3
3
|
import { ChannelSDK } from '../sdk/channels';
|
|
4
4
|
import { SessionSDK } from '../sdk/sessions';
|
|
@@ -7,70 +7,141 @@ 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 { WhatsAppPricingSDK } from '../sdk/whatsAppPricing';
|
|
11
|
+
import { IntegrationServiceSDK } from '../sdk/integrationServices';
|
|
12
|
+
import { UserPreferencesSDK } from '../sdk/userPreferences';
|
|
13
|
+
import { CallSDK } from '../sdk/calls';
|
|
14
|
+
import { SubscriptionSDK } from '../sdk/subscription';
|
|
10
15
|
const ModuleFactory = {
|
|
11
16
|
[ModuleNames.CHANNELS]: _ref => {
|
|
12
17
|
let {
|
|
13
18
|
config
|
|
14
19
|
} = _ref;
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
return {
|
|
21
|
+
[ModuleTypes.AUTHENTICATED]: new ChannelSDK({
|
|
22
|
+
config
|
|
23
|
+
}).toJSON()
|
|
24
|
+
};
|
|
18
25
|
},
|
|
19
26
|
[ModuleNames.SESSIONS]: _ref2 => {
|
|
20
27
|
let {
|
|
21
28
|
config
|
|
22
29
|
} = _ref2;
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
return {
|
|
31
|
+
[ModuleTypes.AUTHENTICATED]: new SessionSDK({
|
|
32
|
+
config
|
|
33
|
+
}).toJSON()
|
|
34
|
+
};
|
|
26
35
|
},
|
|
27
36
|
[ModuleNames.BOTS]: _ref3 => {
|
|
28
37
|
let {
|
|
29
38
|
config
|
|
30
39
|
} = _ref3;
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
return {
|
|
41
|
+
[ModuleTypes.AUTHENTICATED]: new BotSDK({
|
|
42
|
+
config
|
|
43
|
+
}).toJSON()
|
|
44
|
+
};
|
|
34
45
|
},
|
|
35
46
|
[ModuleNames.AGENTS]: _ref4 => {
|
|
36
47
|
let {
|
|
37
48
|
config
|
|
38
49
|
} = _ref4;
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
return {
|
|
51
|
+
[ModuleTypes.AUTHENTICATED]: new AgentSDK({
|
|
52
|
+
config
|
|
53
|
+
}).toJSON()
|
|
54
|
+
};
|
|
42
55
|
},
|
|
43
56
|
[ModuleNames.CONTACTS]: _ref5 => {
|
|
44
57
|
let {
|
|
45
58
|
config
|
|
46
59
|
} = _ref5;
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
60
|
+
return {
|
|
61
|
+
[ModuleTypes.AUTHENTICATED]: new ContactSDK({
|
|
62
|
+
config
|
|
63
|
+
}).toJSON()
|
|
64
|
+
};
|
|
50
65
|
},
|
|
51
66
|
[ModuleNames.MESSAGES]: _ref6 => {
|
|
52
67
|
let {
|
|
53
68
|
config
|
|
54
69
|
} = _ref6;
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
70
|
+
return {
|
|
71
|
+
[ModuleTypes.AUTHENTICATED]: new MessageSDK({
|
|
72
|
+
config
|
|
73
|
+
}).toJSON()
|
|
74
|
+
};
|
|
58
75
|
},
|
|
59
76
|
[ModuleNames.CANNED_MESSAGES]: _ref7 => {
|
|
60
77
|
let {
|
|
61
78
|
config
|
|
62
79
|
} = _ref7;
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
|
|
80
|
+
return {
|
|
81
|
+
[ModuleTypes.AUTHENTICATED]: new CannedMessageSDK({
|
|
82
|
+
config
|
|
83
|
+
}).toJSON()
|
|
84
|
+
};
|
|
66
85
|
},
|
|
67
86
|
[ModuleNames.TEMPLATE_MESSAGES]: _ref8 => {
|
|
68
87
|
let {
|
|
69
88
|
config
|
|
70
89
|
} = _ref8;
|
|
71
|
-
return
|
|
90
|
+
return {
|
|
91
|
+
[ModuleTypes.AUTHENTICATED]: new TemplateMessageSDK({
|
|
92
|
+
config
|
|
93
|
+
}).toJSON()
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
[ModuleNames.INTEGRATION_SERVICES]: _ref9 => {
|
|
97
|
+
let {
|
|
98
|
+
config
|
|
99
|
+
} = _ref9;
|
|
100
|
+
return {
|
|
101
|
+
[ModuleTypes.AUTHENTICATED]: new IntegrationServiceSDK({
|
|
102
|
+
config
|
|
103
|
+
}).toJSON()
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
[ModuleNames.USER_PREFERENCES]: _ref10 => {
|
|
107
|
+
let {
|
|
108
|
+
config
|
|
109
|
+
} = _ref10;
|
|
110
|
+
return {
|
|
111
|
+
[ModuleTypes.AUTHENTICATED]: new UserPreferencesSDK({
|
|
112
|
+
config
|
|
113
|
+
}).toJSON()
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
[ModuleNames.WHATSAPP_PRICING]: _ref11 => {
|
|
117
|
+
let {
|
|
118
|
+
config
|
|
119
|
+
} = _ref11;
|
|
120
|
+
return {
|
|
121
|
+
[ModuleTypes.PUBLIC]: new WhatsAppPricingSDK({
|
|
122
|
+
config
|
|
123
|
+
}).toJSON()
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
[ModuleNames.CALLS]: _ref12 => {
|
|
127
|
+
let {
|
|
128
|
+
config
|
|
129
|
+
} = _ref12;
|
|
130
|
+
return {
|
|
131
|
+
[ModuleTypes.AUTHENTICATED]: new CallSDK({
|
|
132
|
+
config
|
|
133
|
+
}).toJSON()
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
[ModuleNames.SUBSCRIPTION]: _ref13 => {
|
|
137
|
+
let {
|
|
72
138
|
config
|
|
73
|
-
}
|
|
139
|
+
} = _ref13;
|
|
140
|
+
return {
|
|
141
|
+
[ModuleTypes.AUTHENTICATED]: new SubscriptionSDK({
|
|
142
|
+
config
|
|
143
|
+
}).toJSON()
|
|
144
|
+
};
|
|
74
145
|
}
|
|
75
146
|
};
|
|
76
147
|
export default ModuleFactory;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ModuleNames } from '../../core/constants';
|
|
1
|
+
import { ModuleNames, ModuleTypes } from '../../core/constants';
|
|
2
2
|
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, ModuleNames.WHATSAPP_PRICING, ModuleNames.CALLS, ModuleNames.SUBSCRIPTION];
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
initialize(_ref) {
|
|
@@ -37,6 +37,29 @@ export default class ModuleManager {
|
|
|
37
37
|
return this._modules.get(moduleName);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
getModuleByType(moduleName) {
|
|
41
|
+
let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ModuleTypes.AUTHENTICATED;
|
|
42
|
+
const moduleEntry = this.getModule(moduleName);
|
|
43
|
+
|
|
44
|
+
if (!moduleEntry) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return moduleEntry[type];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
getModulesByType(type) {
|
|
52
|
+
const result = {};
|
|
53
|
+
|
|
54
|
+
this._modules.forEach((moduleEntry, moduleName) => {
|
|
55
|
+
if (moduleEntry[type]) {
|
|
56
|
+
result[moduleName] = moduleEntry[type];
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
|
|
40
63
|
hasModule(moduleName) {
|
|
41
64
|
return this._modules.has(moduleName);
|
|
42
65
|
}
|