@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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ICallRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
+
export default class CallService extends ICallRepository {
|
|
3
|
+
constructor(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
callRepository
|
|
6
|
+
} = _ref;
|
|
7
|
+
super();
|
|
8
|
+
this.callRepository = callRepository;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async getCalls(request) {
|
|
12
|
+
return this.callRepository.getCalls(request);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async getCall(request) {
|
|
16
|
+
return this.callRepository.getCall(request);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async updateCallStatus(request) {
|
|
20
|
+
return this.callRepository.updateCallStatus(request);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async initiateCall(request) {
|
|
24
|
+
return this.callRepository.initiateCall(request);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
toJSON() {
|
|
28
|
+
return {
|
|
29
|
+
getCalls: this.getCalls.bind(this),
|
|
30
|
+
getCall: this.getCall.bind(this),
|
|
31
|
+
updateCallStatus: this.updateCallStatus.bind(this),
|
|
32
|
+
initiateCall: this.initiateCall.bind(this)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CallService } from './CallService';
|
|
@@ -36,6 +36,22 @@ export default class CannedMessageService extends ICannedMessageRepository {
|
|
|
36
36
|
return this.cannedMessageRepository.disableCannedMessage(request);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
async addTranslation(request) {
|
|
40
|
+
return this.cannedMessageRepository.addTranslation(request);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async updateTranslation(request) {
|
|
44
|
+
return this.cannedMessageRepository.updateTranslation(request);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async deleteTranslation(request) {
|
|
48
|
+
return this.cannedMessageRepository.deleteTranslation(request);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async getCannedPlaceholders(request) {
|
|
52
|
+
return this.cannedMessageRepository.getCannedPlaceholders(request);
|
|
53
|
+
}
|
|
54
|
+
|
|
39
55
|
toJSON() {
|
|
40
56
|
return {
|
|
41
57
|
getCannedMessages: this.getCannedMessages.bind(this),
|
|
@@ -44,7 +60,11 @@ export default class CannedMessageService extends ICannedMessageRepository {
|
|
|
44
60
|
deleteCannedMessage: this.deleteCannedMessage.bind(this),
|
|
45
61
|
updateCannedMessage: this.updateCannedMessage.bind(this),
|
|
46
62
|
enableCannedMessage: this.enableCannedMessage.bind(this),
|
|
47
|
-
disableCannedMessage: this.disableCannedMessage.bind(this)
|
|
63
|
+
disableCannedMessage: this.disableCannedMessage.bind(this),
|
|
64
|
+
addTranslation: this.addTranslation.bind(this),
|
|
65
|
+
updateTranslation: this.updateTranslation.bind(this),
|
|
66
|
+
deleteTranslation: this.deleteTranslation.bind(this),
|
|
67
|
+
getCannedPlaceholders: this.getCannedPlaceholders.bind(this)
|
|
48
68
|
};
|
|
49
69
|
}
|
|
50
70
|
|
|
@@ -12,9 +12,14 @@ export default class ChannelService extends IChannelRepository {
|
|
|
12
12
|
return this.channelRepository.getChannels(request);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
async getChannel(request) {
|
|
16
|
+
return this.channelRepository.getChannel(request);
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
toJSON() {
|
|
16
20
|
return {
|
|
17
|
-
getChannels: this.getChannels.bind(this)
|
|
21
|
+
getChannels: this.getChannels.bind(this),
|
|
22
|
+
getChannel: this.getChannel.bind(this)
|
|
18
23
|
};
|
|
19
24
|
}
|
|
20
25
|
|
|
@@ -12,9 +12,14 @@ export default class ContactService extends IContactRepository {
|
|
|
12
12
|
return this.contactRepository.getContacts(request);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
async getContact(request) {
|
|
16
|
+
return this.contactRepository.getContact(request);
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
toJSON() {
|
|
16
20
|
return {
|
|
17
|
-
getContacts: this.getContacts.bind(this)
|
|
21
|
+
getContacts: this.getContacts.bind(this),
|
|
22
|
+
getContact: this.getContact.bind(this)
|
|
18
23
|
};
|
|
19
24
|
}
|
|
20
25
|
|
|
@@ -5,4 +5,9 @@ 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 './calls';
|
|
13
|
+
export * from './subscription';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IIntegrationServiceRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
+
export default class IntegrationService extends IIntegrationServiceRepository {
|
|
3
|
+
constructor(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
integrationServiceRepository
|
|
6
|
+
} = _ref;
|
|
7
|
+
super();
|
|
8
|
+
this.integrationServiceRepository = integrationServiceRepository;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async getIntegrations(request) {
|
|
12
|
+
return this.integrationServiceRepository.getIntegrations(request);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
getIntegrations: this.getIntegrations.bind(this)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -40,6 +40,10 @@ export default class SessionService extends ISessionRepository {
|
|
|
40
40
|
return this.sessionRepository.updateSessionStatus(request);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
async getSessionMetrics(request) {
|
|
44
|
+
return this.sessionRepository.getSessionMetrics(request);
|
|
45
|
+
}
|
|
46
|
+
|
|
43
47
|
toJSON() {
|
|
44
48
|
return {
|
|
45
49
|
pickupSession: this.pickupSession.bind(this),
|
|
@@ -49,7 +53,8 @@ export default class SessionService extends ISessionRepository {
|
|
|
49
53
|
getSessionAttachments: this.getSessionAttachments.bind(this),
|
|
50
54
|
getSessionLastMessages: this.getSessionLastMessages.bind(this),
|
|
51
55
|
markSessionAsRead: this.markSessionAsRead.bind(this),
|
|
52
|
-
updateSessionStatus: this.updateSessionStatus.bind(this)
|
|
56
|
+
updateSessionStatus: this.updateSessionStatus.bind(this),
|
|
57
|
+
getSessionMetrics: this.getSessionMetrics.bind(this)
|
|
53
58
|
};
|
|
54
59
|
}
|
|
55
60
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ISubscriptionRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
+
export default class SubscriptionService extends ISubscriptionRepository {
|
|
3
|
+
constructor(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
subscriptionRepository
|
|
6
|
+
} = _ref;
|
|
7
|
+
super();
|
|
8
|
+
this.subscriptionRepository = subscriptionRepository;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async getAddOns(request) {
|
|
12
|
+
return this.subscriptionRepository.getAddOns(request);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async buyAddOn(request) {
|
|
16
|
+
return this.subscriptionRepository.buyAddOn(request);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async modifyAddOn(request) {
|
|
20
|
+
return this.subscriptionRepository.modifyAddOn(request);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async getLicenseDetails(request) {
|
|
24
|
+
return this.subscriptionRepository.getLicenseDetails(request);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
toJSON() {
|
|
28
|
+
return {
|
|
29
|
+
getAddOns: this.getAddOns.bind(this),
|
|
30
|
+
buyAddOn: this.buyAddOn.bind(this),
|
|
31
|
+
modifyAddOn: this.modifyAddOn.bind(this),
|
|
32
|
+
getLicenseDetails: this.getLicenseDetails.bind(this)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|
|
@@ -16,10 +16,15 @@ export default class TemplateMessageService extends ITemplateMessageRepository {
|
|
|
16
16
|
return this.templateMessageRepository.getWhatsAppTemplateCreditExhaustStatus(request);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
async getTemplateTags() {
|
|
20
|
+
return this.templateMessageRepository.getTemplateTags();
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
toJSON() {
|
|
20
24
|
return {
|
|
21
25
|
getTemplateLanguages: this.getTemplateLanguages.bind(this),
|
|
22
|
-
getWhatsAppTemplateCreditExhaustStatus: this.getWhatsAppTemplateCreditExhaustStatus.bind(this)
|
|
26
|
+
getWhatsAppTemplateCreditExhaustStatus: this.getWhatsAppTemplateCreditExhaustStatus.bind(this),
|
|
27
|
+
getTemplateTags: this.getTemplateTags.bind(this)
|
|
23
28
|
};
|
|
24
29
|
}
|
|
25
30
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IUserPreferenceRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
+
export default class UserPreferenceService extends IUserPreferenceRepository {
|
|
3
|
+
constructor(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
userPreferenceRepository
|
|
6
|
+
} = _ref;
|
|
7
|
+
super();
|
|
8
|
+
this.userPreferenceRepository = userPreferenceRepository;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async getPreferences(request) {
|
|
12
|
+
return this.userPreferenceRepository.getPreferences(request);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async updatePreferences(request) {
|
|
16
|
+
return this.userPreferenceRepository.updatePreferences(request);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
toJSON() {
|
|
20
|
+
return {
|
|
21
|
+
getPreferences: this.getPreferences.bind(this),
|
|
22
|
+
updatePreferences: this.updatePreferences.bind(this)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IWhatsAppPricingRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
+
export default class WhatsAppPricingService extends IWhatsAppPricingRepository {
|
|
3
|
+
constructor(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
whatsAppPricingRepository
|
|
6
|
+
} = _ref;
|
|
7
|
+
super();
|
|
8
|
+
this.whatsAppPricingRepository = whatsAppPricingRepository;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async calculateWhatsAppPricing(request) {
|
|
12
|
+
return this.whatsAppPricingRepository.calculateWhatsAppPricing(request);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
calculateWhatsAppPricing: this.calculateWhatsAppPricing.bind(this)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -7,6 +7,11 @@ const ModuleNames = {
|
|
|
7
7
|
AGENTS: 'agents',
|
|
8
8
|
CANNED_MESSAGES: 'cannedMessages',
|
|
9
9
|
TEMPLATE_MESSAGES: 'templateMessages',
|
|
10
|
-
CUSTOM_REPLY_EXTENSIONS: 'articles'
|
|
10
|
+
CUSTOM_REPLY_EXTENSIONS: 'articles',
|
|
11
|
+
INTEGRATION_SERVICES: 'integrationServices',
|
|
12
|
+
USER_PREFERENCES: 'userPreferences',
|
|
13
|
+
WHATSAPP_PRICING: 'whatsAppPricing',
|
|
14
|
+
CALLS: 'calls',
|
|
15
|
+
SUBSCRIPTION: 'subscription'
|
|
11
16
|
};
|
|
12
17
|
export default ModuleNames;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HttpMethods } from '@zohoim/http-client';
|
|
2
2
|
import ModuleNames from './ModuleNames';
|
|
3
|
+
import ModuleTypes from './ModuleTypes';
|
|
3
4
|
import ResponseTypes from './ResponseTypes';
|
|
4
5
|
const IM_API_PREFIX = '/api/v1';
|
|
5
6
|
const HTTP_METHODS = HttpMethods;
|
|
6
|
-
export { ModuleNames, IM_API_PREFIX, HTTP_METHODS, ResponseTypes };
|
|
7
|
+
export { ModuleNames, ModuleTypes, IM_API_PREFIX, HTTP_METHODS, ResponseTypes };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
function validateSchemaKeys(_ref) {
|
|
1
|
+
export function validateSchemaKeys(_ref) {
|
|
2
2
|
let {
|
|
3
3
|
schema = {},
|
|
4
4
|
data = {},
|
|
5
5
|
entityName = ''
|
|
6
6
|
} = _ref;
|
|
7
7
|
Object.keys(schema).forEach(key => {
|
|
8
|
-
if (!(key in data)) {
|
|
8
|
+
if (!(key in data) && schema[key].required !== false) {
|
|
9
9
|
console.warn(`${entityName} - Key '${key}' is missing in the data`);
|
|
10
10
|
}
|
|
11
11
|
});
|
|
@@ -94,6 +94,31 @@ export const validateSchema = _ref4 => {
|
|
|
94
94
|
path: fieldPath,
|
|
95
95
|
entityName
|
|
96
96
|
});
|
|
97
|
+
} // Array validation — schema (objects) or enum (primitives), not both
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
if (rules.type === 'array' && Array.isArray(value)) {
|
|
101
|
+
if (rules.schema && rules.enum) {
|
|
102
|
+
console.warn(`${entityName} - ${fieldPath} must define either schema or enum for array, not both`);
|
|
103
|
+
} else if (rules.schema) {
|
|
104
|
+
value.forEach((item, index) => {
|
|
105
|
+
validate({
|
|
106
|
+
schema: rules.schema,
|
|
107
|
+
data: item,
|
|
108
|
+
path: `${fieldPath}[${index}]`,
|
|
109
|
+
entityName
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
} else if (rules.enum) {
|
|
113
|
+
value.forEach((item, index) => {
|
|
114
|
+
validateEnumCheck({
|
|
115
|
+
value: item,
|
|
116
|
+
rules,
|
|
117
|
+
path: `${fieldPath}[${index}]`,
|
|
118
|
+
entityName
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}
|
|
97
122
|
}
|
|
98
123
|
}
|
|
99
124
|
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
export default function getCallRequest() {
|
|
3
|
+
let {
|
|
4
|
+
params = {},
|
|
5
|
+
query = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withParams({
|
|
8
|
+
callId: null,
|
|
9
|
+
...params
|
|
10
|
+
}).withQuery({
|
|
11
|
+
include: null,
|
|
12
|
+
...query
|
|
13
|
+
}).build();
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
export default function getCallsRequest() {
|
|
3
|
+
let {
|
|
4
|
+
query = {}
|
|
5
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
+
return new RequestBuilder().withQuery({
|
|
7
|
+
from: 0,
|
|
8
|
+
limit: 10,
|
|
9
|
+
status: null,
|
|
10
|
+
integrationServiceId: null,
|
|
11
|
+
userType: null,
|
|
12
|
+
callIds: null,
|
|
13
|
+
sessionIds: null,
|
|
14
|
+
include: null,
|
|
15
|
+
userId: null,
|
|
16
|
+
channelIds: null,
|
|
17
|
+
exclude: null,
|
|
18
|
+
...query
|
|
19
|
+
}).build();
|
|
20
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as getCallRequest } from './getCallRequest';
|
|
2
|
+
export { default as getCallsRequest } from './getCallsRequest';
|
|
3
|
+
export { default as initiateCallRequest } from './initiateCallRequest';
|
|
4
|
+
export { default as updateCallStatusRequest } from './updateCallStatusRequest';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
export default function initiateCall() {
|
|
3
|
+
let {
|
|
4
|
+
params = {},
|
|
5
|
+
body = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withParams({
|
|
8
|
+
callId: null,
|
|
9
|
+
...params
|
|
10
|
+
}).withBody({
|
|
11
|
+
platform: null,
|
|
12
|
+
meta: null,
|
|
13
|
+
...body
|
|
14
|
+
}).build();
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
export default function updateCallStatusRequest() {
|
|
3
|
+
let {
|
|
4
|
+
params = {},
|
|
5
|
+
body = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withParams({
|
|
8
|
+
callId: null,
|
|
9
|
+
...params
|
|
10
|
+
}).withBody({
|
|
11
|
+
status: null,
|
|
12
|
+
meta: null,
|
|
13
|
+
...body
|
|
14
|
+
}).build();
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function addTranslationRequest() {
|
|
4
|
+
let {
|
|
5
|
+
params = {},
|
|
6
|
+
body = {}
|
|
7
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8
|
+
return new RequestBuilder().withParams({
|
|
9
|
+
cannedMessageId: null,
|
|
10
|
+
...params
|
|
11
|
+
}).withBody({
|
|
12
|
+
message: null,
|
|
13
|
+
language: null,
|
|
14
|
+
templateItems: {},
|
|
15
|
+
...body
|
|
16
|
+
}).build();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default addTranslationRequest;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function deleteTranslationRequest() {
|
|
4
|
+
let {
|
|
5
|
+
params = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withParams({
|
|
8
|
+
cannedMessageId: null,
|
|
9
|
+
translationId: null,
|
|
10
|
+
...params
|
|
11
|
+
}).build();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default deleteTranslationRequest;
|
|
@@ -4,4 +4,8 @@ export { default as deleteCannedMessageRequest } from './deleteCannedMessageRequ
|
|
|
4
4
|
export { default as createCannedMessageRequest } from './createCannedMessageRequest';
|
|
5
5
|
export { default as enableCannedMessageRequest } from './enableCannedMessageRequest';
|
|
6
6
|
export { default as disableCannedMessageRequest } from './disableCannedMessageRequest';
|
|
7
|
-
export { default as updateCannedMessageRequest } from './updateCannedMessageRequest';
|
|
7
|
+
export { default as updateCannedMessageRequest } from './updateCannedMessageRequest';
|
|
8
|
+
export { default as addTranslationRequest } from './addTranslationRequest';
|
|
9
|
+
export { default as updateTranslationRequest } from './updateTranslationRequest';
|
|
10
|
+
export { default as deleteTranslationRequest } from './deleteTranslationRequest';
|
|
11
|
+
export { default as getCannedPlaceholdersRequest } from './getCannedPlaceholdersRequest';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function updateTranslationRequest() {
|
|
4
|
+
let {
|
|
5
|
+
params = {},
|
|
6
|
+
body = {}
|
|
7
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8
|
+
return new RequestBuilder().withParams({
|
|
9
|
+
cannedMessageId: null,
|
|
10
|
+
translationId: null,
|
|
11
|
+
...params
|
|
12
|
+
}).withBody({
|
|
13
|
+
message: null,
|
|
14
|
+
language: null,
|
|
15
|
+
templateItems: {},
|
|
16
|
+
...body
|
|
17
|
+
}).build();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default updateTranslationRequest;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function getChannelRequest() {
|
|
4
|
+
let {
|
|
5
|
+
params = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withParams({
|
|
8
|
+
channelId: null,
|
|
9
|
+
...params
|
|
10
|
+
}).build();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default getChannelRequest;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function getContactRequest() {
|
|
4
|
+
let {
|
|
5
|
+
params = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withParams({
|
|
8
|
+
contactId: null,
|
|
9
|
+
...params
|
|
10
|
+
}).build();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default getContactRequest;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default as getContactsRequest } from './getContactsRequest';
|
|
1
|
+
export { default as getContactsRequest } from './getContactsRequest';
|
|
2
|
+
export { default as getContactRequest } from './getContactRequest';
|
package/es/domain/dto/index.js
CHANGED
|
@@ -5,4 +5,9 @@ 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 './calls';
|
|
13
|
+
export * from './subscription';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as getIntegrationsRequest } from './getIntegrationsRequest';
|
|
@@ -2,11 +2,16 @@ import RequestBuilder from '../RequestBuilder';
|
|
|
2
2
|
|
|
3
3
|
function getSessionAttachmentsRequest() {
|
|
4
4
|
let {
|
|
5
|
-
params = {}
|
|
5
|
+
params = {},
|
|
6
|
+
query = {}
|
|
6
7
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
8
|
return new RequestBuilder().withParams({
|
|
8
9
|
sessionId: null,
|
|
9
10
|
...params
|
|
11
|
+
}).withQuery({
|
|
12
|
+
from: null,
|
|
13
|
+
limit: null,
|
|
14
|
+
...query
|
|
10
15
|
}).build();
|
|
11
16
|
}
|
|
12
17
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function getSessionMetricsRequest() {
|
|
4
|
+
let {
|
|
5
|
+
query = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withQuery({
|
|
8
|
+
channelIds: null,
|
|
9
|
+
integrationServiceId: null,
|
|
10
|
+
excludeSyncingChannels: false,
|
|
11
|
+
assignmentType: null,
|
|
12
|
+
...query
|
|
13
|
+
}).build();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default getSessionMetricsRequest;
|
|
@@ -5,4 +5,5 @@ export { default as getSessionAttachmentsRequest } from './getSessionAttachments
|
|
|
5
5
|
export { default as getSessionLastMessagesRequest } from './getSessionLastMessagesRequest';
|
|
6
6
|
export { default as markSessionAsReadRequest } from './markSessionAsReadRequest';
|
|
7
7
|
export { default as updateSessionStatusRequest } from './updateSessionStatusRequest';
|
|
8
|
-
export { default as pickupSessionRequest } from './pickupSessionRequest';
|
|
8
|
+
export { default as pickupSessionRequest } from './pickupSessionRequest';
|
|
9
|
+
export { default as getSessionMetricsRequest } from './getSessionMetricsRequest';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function buyAddOnRequest() {
|
|
4
|
+
let {
|
|
5
|
+
body = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withBody({
|
|
8
|
+
name: null,
|
|
9
|
+
count: null,
|
|
10
|
+
autoRenewal: null,
|
|
11
|
+
renewalCount: null,
|
|
12
|
+
renewalThreshold: null,
|
|
13
|
+
source: null,
|
|
14
|
+
...body
|
|
15
|
+
}).build();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default buyAddOnRequest;
|