@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,24 @@
|
|
|
1
|
+
import { getPreferencesRequest, updatePreferencesRequest } from '../../../domain/dto';
|
|
2
|
+
import { IUserPreferenceRepository } from '../../../domain/interfaces/repositories';
|
|
3
|
+
export default class UserPreferenceAPI extends IUserPreferenceRepository {
|
|
4
|
+
async getPreferences() {
|
|
5
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getPreferencesRequest();
|
|
6
|
+
const operation = 'getPreferences';
|
|
7
|
+
const httpRequest = await this.request({
|
|
8
|
+
request,
|
|
9
|
+
operation
|
|
10
|
+
});
|
|
11
|
+
return httpRequest;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async updatePreferences() {
|
|
15
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : updatePreferencesRequest();
|
|
16
|
+
const operation = 'updatePreferences';
|
|
17
|
+
const httpRequest = await this.request({
|
|
18
|
+
request,
|
|
19
|
+
operation
|
|
20
|
+
});
|
|
21
|
+
return httpRequest;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { calculateWhatsAppPricingRequest } from '../../../domain/dto';
|
|
2
|
+
import { IWhatsAppPricingRepository } from '../../../domain/interfaces/repositories';
|
|
3
|
+
export default class WhatsAppPricingAPI extends IWhatsAppPricingRepository {
|
|
4
|
+
async calculateWhatsAppPricing() {
|
|
5
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : calculateWhatsAppPricingRequest();
|
|
6
|
+
const operation = 'calculateWhatsAppPricing';
|
|
7
|
+
const httpRequest = await this.request({
|
|
8
|
+
request,
|
|
9
|
+
operation
|
|
10
|
+
});
|
|
11
|
+
return httpRequest;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
@@ -2,15 +2,18 @@ class ConfigRegistry {
|
|
|
2
2
|
constructor() {
|
|
3
3
|
this.baseURL = null;
|
|
4
4
|
this.httpClient = null;
|
|
5
|
+
this.publicHttpClient = null;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
setConfig(_ref) {
|
|
8
9
|
let {
|
|
9
10
|
baseURL,
|
|
10
|
-
httpClient
|
|
11
|
+
httpClient,
|
|
12
|
+
publicHttpClient
|
|
11
13
|
} = _ref;
|
|
12
14
|
this.baseURL = baseURL;
|
|
13
15
|
this.httpClient = httpClient;
|
|
16
|
+
this.publicHttpClient = publicHttpClient || null;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
getBaseURL() {
|
|
@@ -21,6 +24,10 @@ class ConfigRegistry {
|
|
|
21
24
|
return this.httpClient;
|
|
22
25
|
}
|
|
23
26
|
|
|
27
|
+
getPublicHttpClient() {
|
|
28
|
+
return this.publicHttpClient;
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
}
|
|
25
32
|
|
|
26
33
|
const configRegistry = new ConfigRegistry();
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { CallAdapter } from '../../adapters';
|
|
2
|
+
import { CallAPI } from '../../api';
|
|
3
|
+
import { ICallRepository } from '../../../domain/interfaces/repositories/calls';
|
|
4
|
+
import { ResponseTypes } from '../../../core/constants';
|
|
5
|
+
export default class CallRepository extends ICallRepository {
|
|
6
|
+
constructor(_ref) {
|
|
7
|
+
let {
|
|
8
|
+
callAPI,
|
|
9
|
+
callAdapter
|
|
10
|
+
} = _ref;
|
|
11
|
+
super();
|
|
12
|
+
this.defaultAPI = new CallAPI();
|
|
13
|
+
this.customAPI = callAPI;
|
|
14
|
+
this.callAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
|
|
15
|
+
this.callAdapter = callAdapter || new CallAdapter();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async invokeAPI(_ref2) {
|
|
19
|
+
let {
|
|
20
|
+
operation,
|
|
21
|
+
request,
|
|
22
|
+
adapter = this.callAdapter,
|
|
23
|
+
responseType
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return this.executeAPICall({
|
|
26
|
+
operation,
|
|
27
|
+
request,
|
|
28
|
+
apiProxy: this.callAPI,
|
|
29
|
+
customAPI: this.customAPI,
|
|
30
|
+
adapter,
|
|
31
|
+
responseType
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async getCalls(request) {
|
|
36
|
+
return this.invokeAPI({
|
|
37
|
+
operation: 'getCalls',
|
|
38
|
+
request,
|
|
39
|
+
responseType: ResponseTypes.LIST
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async getCall(request) {
|
|
44
|
+
return this.invokeAPI({
|
|
45
|
+
operation: 'getCall',
|
|
46
|
+
request
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async updateCallStatus(request) {
|
|
51
|
+
return this.invokeAPI({
|
|
52
|
+
operation: 'updateCallStatus',
|
|
53
|
+
request
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async initiateCall(request) {
|
|
58
|
+
return this.invokeAPI({
|
|
59
|
+
operation: 'initiateCall',
|
|
60
|
+
request
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
toJSON() {
|
|
65
|
+
return {
|
|
66
|
+
getCalls: this.getCalls.bind(this),
|
|
67
|
+
getCall: this.getCall.bind(this),
|
|
68
|
+
updateCallStatus: this.updateCallStatus.bind(this),
|
|
69
|
+
initiateCall: this.initiateCall.bind(this)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CallRepository } from './CallRepository';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CannedMessageAdapter } from '../../adapters';
|
|
1
|
+
import { CannedMessageAdapter, PlaceholderAdapter, TranslationAdapter } from '../../adapters';
|
|
2
2
|
import { CannedMessageAPI } from '../../api';
|
|
3
3
|
import { ICannedMessageRepository } from '../../../domain/interfaces/repositories/cannedMessages';
|
|
4
4
|
import { ResponseTypes } from '../../../core/constants';
|
|
@@ -6,13 +6,16 @@ export default class CannedMessageRepository extends ICannedMessageRepository {
|
|
|
6
6
|
constructor(_ref) {
|
|
7
7
|
let {
|
|
8
8
|
cannedMessageAPI,
|
|
9
|
-
cannedMessageAdapter
|
|
9
|
+
cannedMessageAdapter,
|
|
10
|
+
placeholderAdapter
|
|
10
11
|
} = _ref;
|
|
11
12
|
super();
|
|
12
13
|
this.defaultAPI = new CannedMessageAPI();
|
|
13
14
|
this.customAPI = cannedMessageAPI;
|
|
14
15
|
this.cannedMessageAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
|
|
15
16
|
this.cannedMessageAdapter = cannedMessageAdapter || new CannedMessageAdapter();
|
|
17
|
+
this.translationAdapter = new TranslationAdapter();
|
|
18
|
+
this.placeholderAdapter = placeholderAdapter || new PlaceholderAdapter();
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
async invokeAPI(_ref2) {
|
|
@@ -57,7 +60,8 @@ export default class CannedMessageRepository extends ICannedMessageRepository {
|
|
|
57
60
|
async deleteCannedMessage(request) {
|
|
58
61
|
return this.invokeAPI({
|
|
59
62
|
operation: 'deleteCannedMessage',
|
|
60
|
-
request
|
|
63
|
+
request,
|
|
64
|
+
responseType: ResponseTypes.NONE
|
|
61
65
|
});
|
|
62
66
|
}
|
|
63
67
|
|
|
@@ -71,14 +75,49 @@ export default class CannedMessageRepository extends ICannedMessageRepository {
|
|
|
71
75
|
async enableCannedMessage(request) {
|
|
72
76
|
return this.invokeAPI({
|
|
73
77
|
operation: 'enableCannedMessage',
|
|
74
|
-
request
|
|
78
|
+
request,
|
|
79
|
+
responseType: ResponseTypes.NONE
|
|
75
80
|
});
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
async disableCannedMessage(request) {
|
|
79
84
|
return this.invokeAPI({
|
|
80
85
|
operation: 'disableCannedMessage',
|
|
81
|
-
request
|
|
86
|
+
request,
|
|
87
|
+
responseType: ResponseTypes.NONE
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async addTranslation(request) {
|
|
92
|
+
return this.invokeAPI({
|
|
93
|
+
operation: 'addTranslation',
|
|
94
|
+
request,
|
|
95
|
+
adapter: this.translationAdapter
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async updateTranslation(request) {
|
|
100
|
+
return this.invokeAPI({
|
|
101
|
+
operation: 'updateTranslation',
|
|
102
|
+
request,
|
|
103
|
+
adapter: this.translationAdapter
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
async deleteTranslation(request) {
|
|
108
|
+
return this.invokeAPI({
|
|
109
|
+
operation: 'deleteTranslation',
|
|
110
|
+
request,
|
|
111
|
+
responseType: ResponseTypes.NONE
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
async getCannedPlaceholders(request) {
|
|
116
|
+
return this.invokeAPI({
|
|
117
|
+
operation: 'getCannedPlaceholders',
|
|
118
|
+
request,
|
|
119
|
+
adapter: this.placeholderAdapter,
|
|
120
|
+
responseType: ResponseTypes.LIST
|
|
82
121
|
});
|
|
83
122
|
}
|
|
84
123
|
|
|
@@ -89,8 +128,12 @@ export default class CannedMessageRepository extends ICannedMessageRepository {
|
|
|
89
128
|
createCannedMessage: this.createCannedMessage.bind(this),
|
|
90
129
|
updateCannedMessage: this.updateCannedMessage.bind(this),
|
|
91
130
|
deleteCannedMessage: this.deleteCannedMessage.bind(this),
|
|
92
|
-
|
|
93
|
-
disableCannedMessage: this.disableCannedMessage.bind(this)
|
|
131
|
+
enableCannedMessage: this.enableCannedMessage.bind(this),
|
|
132
|
+
disableCannedMessage: this.disableCannedMessage.bind(this),
|
|
133
|
+
addTranslation: this.addTranslation.bind(this),
|
|
134
|
+
updateTranslation: this.updateTranslation.bind(this),
|
|
135
|
+
deleteTranslation: this.deleteTranslation.bind(this),
|
|
136
|
+
getCannedPlaceholders: this.getCannedPlaceholders.bind(this)
|
|
94
137
|
};
|
|
95
138
|
}
|
|
96
139
|
|
|
@@ -40,9 +40,18 @@ export default class ChannelRepository extends IChannelRepository {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
async getChannel(request) {
|
|
44
|
+
return this.invokeAPI({
|
|
45
|
+
operation: 'getChannel',
|
|
46
|
+
request,
|
|
47
|
+
responseType: ResponseTypes.SINGLE
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
43
51
|
toJSON() {
|
|
44
52
|
return {
|
|
45
|
-
getChannels: this.getChannels.bind(this)
|
|
53
|
+
getChannels: this.getChannels.bind(this),
|
|
54
|
+
getChannel: this.getChannel.bind(this)
|
|
46
55
|
};
|
|
47
56
|
}
|
|
48
57
|
|
|
@@ -40,9 +40,17 @@ export default class ContactRepository extends IContactRepository {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
async getContact(request) {
|
|
44
|
+
return this.invokeAPI({
|
|
45
|
+
operation: 'getContact',
|
|
46
|
+
request
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
43
50
|
toJSON() {
|
|
44
51
|
return {
|
|
45
|
-
getContacts: this.getContacts.bind(this)
|
|
52
|
+
getContacts: this.getContacts.bind(this),
|
|
53
|
+
getContact: this.getContact.bind(this)
|
|
46
54
|
};
|
|
47
55
|
}
|
|
48
56
|
|
|
@@ -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,49 @@
|
|
|
1
|
+
import { IIntegrationServiceRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
+
import { IntegrationServiceAdapter } from '../../adapters';
|
|
3
|
+
import { IntegrationServiceAPI } from '../../api';
|
|
4
|
+
import { ResponseTypes } from '../../../core/constants';
|
|
5
|
+
export default class IntegrationServiceRepository extends IIntegrationServiceRepository {
|
|
6
|
+
constructor(_ref) {
|
|
7
|
+
let {
|
|
8
|
+
integrationServiceAPI,
|
|
9
|
+
integrationServiceAdapter
|
|
10
|
+
} = _ref;
|
|
11
|
+
super();
|
|
12
|
+
this.defaultAPI = new IntegrationServiceAPI();
|
|
13
|
+
this.customAPI = integrationServiceAPI;
|
|
14
|
+
this.integrationServiceAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
|
|
15
|
+
this.integrationServiceAdapter = integrationServiceAdapter || new IntegrationServiceAdapter();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async invokeAPI(_ref2) {
|
|
19
|
+
let {
|
|
20
|
+
operation,
|
|
21
|
+
request,
|
|
22
|
+
adapter = this.integrationServiceAdapter,
|
|
23
|
+
responseType
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return this.executeAPICall({
|
|
26
|
+
operation,
|
|
27
|
+
request,
|
|
28
|
+
apiProxy: this.integrationServiceAPI,
|
|
29
|
+
customAPI: this.customAPI,
|
|
30
|
+
adapter,
|
|
31
|
+
responseType
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async getIntegrations(request) {
|
|
36
|
+
return this.invokeAPI({
|
|
37
|
+
operation: 'getIntegrations',
|
|
38
|
+
request,
|
|
39
|
+
responseType: ResponseTypes.LIST
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
toJSON() {
|
|
44
|
+
return {
|
|
45
|
+
getIntegrations: this.getIntegrations.bind(this)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AttachmentAdapter, MessageAdapter, SessionAdapter } from '../../adapters/index';
|
|
1
|
+
import { AttachmentAdapter, MessageAdapter, SessionAdapter, SessionMetricsAdapter } from '../../adapters/index';
|
|
2
2
|
import { ISessionRepository } from '../../../domain/interfaces/repositories';
|
|
3
3
|
import { SessionAPI } from '../../api';
|
|
4
4
|
import { ResponseTypes } from '../../../core/constants';
|
|
@@ -8,7 +8,8 @@ export default class SessionRepository extends ISessionRepository {
|
|
|
8
8
|
sessionAPI,
|
|
9
9
|
sessionAdapter,
|
|
10
10
|
attachmentAdapter,
|
|
11
|
-
messageAdapter
|
|
11
|
+
messageAdapter,
|
|
12
|
+
sessionMetricsAdapter
|
|
12
13
|
} = _ref;
|
|
13
14
|
super();
|
|
14
15
|
this.defaultAPI = new SessionAPI();
|
|
@@ -17,6 +18,7 @@ export default class SessionRepository extends ISessionRepository {
|
|
|
17
18
|
this.sessionAdapter = sessionAdapter || new SessionAdapter();
|
|
18
19
|
this.attachmentAdapter = attachmentAdapter || new AttachmentAdapter();
|
|
19
20
|
this.messageAdapter = messageAdapter || new MessageAdapter();
|
|
21
|
+
this.sessionMetricsAdapter = sessionMetricsAdapter || new SessionMetricsAdapter();
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
async invokeAPI(_ref2) {
|
|
@@ -97,6 +99,14 @@ export default class SessionRepository extends ISessionRepository {
|
|
|
97
99
|
});
|
|
98
100
|
}
|
|
99
101
|
|
|
102
|
+
async getSessionMetrics(request) {
|
|
103
|
+
return this.invokeAPI({
|
|
104
|
+
operation: 'getSessionMetrics',
|
|
105
|
+
request,
|
|
106
|
+
adapter: this.sessionMetricsAdapter
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
100
110
|
toJSON() {
|
|
101
111
|
return {
|
|
102
112
|
pickupSession: this.pickupSession.bind(this),
|
|
@@ -106,7 +116,8 @@ export default class SessionRepository extends ISessionRepository {
|
|
|
106
116
|
getSessionAttachments: this.getSessionAttachments.bind(this),
|
|
107
117
|
getSessionLastMessages: this.getSessionLastMessages.bind(this),
|
|
108
118
|
markSessionAsRead: this.markSessionAsRead.bind(this),
|
|
109
|
-
updateSessionStatus: this.updateSessionStatus.bind(this)
|
|
119
|
+
updateSessionStatus: this.updateSessionStatus.bind(this),
|
|
120
|
+
getSessionMetrics: this.getSessionMetrics.bind(this)
|
|
110
121
|
};
|
|
111
122
|
}
|
|
112
123
|
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { AddOnAdapter, LicenseDetailsAdapter } from '../../adapters/index';
|
|
2
|
+
import { ISubscriptionRepository } from '../../../domain/interfaces/repositories';
|
|
3
|
+
import { SubscriptionAPI } from '../../api';
|
|
4
|
+
import { ResponseTypes } from '../../../core/constants';
|
|
5
|
+
export default class SubscriptionRepository extends ISubscriptionRepository {
|
|
6
|
+
constructor(_ref) {
|
|
7
|
+
let {
|
|
8
|
+
subscriptionAPI,
|
|
9
|
+
addOnAdapter,
|
|
10
|
+
licenseDetailsAdapter
|
|
11
|
+
} = _ref;
|
|
12
|
+
super();
|
|
13
|
+
this.defaultAPI = new SubscriptionAPI();
|
|
14
|
+
this.customAPI = subscriptionAPI;
|
|
15
|
+
this.subscriptionAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
|
|
16
|
+
this.addOnAdapter = addOnAdapter || new AddOnAdapter();
|
|
17
|
+
this.licenseDetailsAdapter = licenseDetailsAdapter || new LicenseDetailsAdapter();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async invokeAPI(_ref2) {
|
|
21
|
+
let {
|
|
22
|
+
operation,
|
|
23
|
+
request,
|
|
24
|
+
adapter = this.addOnAdapter,
|
|
25
|
+
responseType
|
|
26
|
+
} = _ref2;
|
|
27
|
+
return this.executeAPICall({
|
|
28
|
+
operation,
|
|
29
|
+
request,
|
|
30
|
+
apiProxy: this.subscriptionAPI,
|
|
31
|
+
customAPI: this.customAPI,
|
|
32
|
+
adapter,
|
|
33
|
+
responseType
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async getAddOns(request) {
|
|
38
|
+
return this.invokeAPI({
|
|
39
|
+
operation: 'getAddOns',
|
|
40
|
+
// No I18N
|
|
41
|
+
request,
|
|
42
|
+
responseType: ResponseTypes.LIST
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async buyAddOn(request) {
|
|
47
|
+
return this.invokeAPI({
|
|
48
|
+
operation: 'buyAddOn',
|
|
49
|
+
// No I18N
|
|
50
|
+
request,
|
|
51
|
+
responseType: ResponseTypes.SINGLE
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async modifyAddOn(request) {
|
|
56
|
+
return this.invokeAPI({
|
|
57
|
+
operation: 'modifyAddOn',
|
|
58
|
+
// No I18N
|
|
59
|
+
request,
|
|
60
|
+
responseType: ResponseTypes.SINGLE
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async getLicenseDetails(request) {
|
|
65
|
+
return this.invokeAPI({
|
|
66
|
+
operation: 'getLicenseDetails',
|
|
67
|
+
// No I18N
|
|
68
|
+
request,
|
|
69
|
+
adapter: this.licenseDetailsAdapter,
|
|
70
|
+
responseType: ResponseTypes.SINGLE
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
toJSON() {
|
|
75
|
+
return {
|
|
76
|
+
getAddOns: this.getAddOns.bind(this),
|
|
77
|
+
buyAddOn: this.buyAddOn.bind(this),
|
|
78
|
+
modifyAddOn: this.modifyAddOn.bind(this),
|
|
79
|
+
getLicenseDetails: this.getLicenseDetails.bind(this)
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ITemplateMessageRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
-
import { TemplateLanguageAdapter, TemplateCreditExhaustStatusAdapter } from '../../adapters';
|
|
2
|
+
import { TemplateLanguageAdapter, TemplateCreditExhaustStatusAdapter, TemplateTagsAdapter } from '../../adapters';
|
|
3
3
|
import { TemplateMessageAPI } from '../../api';
|
|
4
4
|
import { ResponseTypes } from '../../../core/constants';
|
|
5
5
|
export default class TemplateMessageRepository extends ITemplateMessageRepository {
|
|
@@ -7,7 +7,8 @@ export default class TemplateMessageRepository extends ITemplateMessageRepositor
|
|
|
7
7
|
let {
|
|
8
8
|
templateMessageAPI,
|
|
9
9
|
templateLanguageAdapter,
|
|
10
|
-
templateCreditExhaustStatusAdapter
|
|
10
|
+
templateCreditExhaustStatusAdapter,
|
|
11
|
+
templateTagsAdapter
|
|
11
12
|
} = _ref;
|
|
12
13
|
super();
|
|
13
14
|
this.defaultAPI = new TemplateMessageAPI();
|
|
@@ -15,6 +16,7 @@ export default class TemplateMessageRepository extends ITemplateMessageRepositor
|
|
|
15
16
|
this.templateMessageAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
|
|
16
17
|
this.templateLanguageAdapter = templateLanguageAdapter || new TemplateLanguageAdapter();
|
|
17
18
|
this.templateCreditExhaustStatusAdapter = templateCreditExhaustStatusAdapter || new TemplateCreditExhaustStatusAdapter();
|
|
19
|
+
this.templateTagsAdapter = templateTagsAdapter || new TemplateTagsAdapter();
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
async invokeTemplateLanguageAPI(_ref2) {
|
|
@@ -67,10 +69,20 @@ export default class TemplateMessageRepository extends ITemplateMessageRepositor
|
|
|
67
69
|
});
|
|
68
70
|
}
|
|
69
71
|
|
|
72
|
+
async getTemplateTags(request) {
|
|
73
|
+
return this.invokeTemplateLanguageAPI({
|
|
74
|
+
operation: 'getTemplateTags',
|
|
75
|
+
request,
|
|
76
|
+
adapter: this.templateTagsAdapter,
|
|
77
|
+
responseType: ResponseTypes.SINGLE
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
70
81
|
toJSON() {
|
|
71
82
|
return {
|
|
72
83
|
getTemplateLanguages: this.getTemplateLanguages.bind(this),
|
|
73
|
-
getWhatsAppTemplateCreditExhaustStatus: this.getWhatsAppTemplateCreditExhaustStatus.bind(this)
|
|
84
|
+
getWhatsAppTemplateCreditExhaustStatus: this.getWhatsAppTemplateCreditExhaustStatus.bind(this),
|
|
85
|
+
getTemplateTags: this.getTemplateTags.bind(this)
|
|
74
86
|
};
|
|
75
87
|
}
|
|
76
88
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { IUserPreferenceRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
+
import { UserPreferenceAdapter } from '../../adapters';
|
|
3
|
+
import { UserPreferenceAPI } from '../../api';
|
|
4
|
+
import { ResponseTypes } from '../../../core/constants';
|
|
5
|
+
export default class UserPreferenceRepository extends IUserPreferenceRepository {
|
|
6
|
+
constructor(_ref) {
|
|
7
|
+
let {
|
|
8
|
+
userPreferenceAPI,
|
|
9
|
+
userPreferenceAdapter
|
|
10
|
+
} = _ref;
|
|
11
|
+
super();
|
|
12
|
+
this.defaultAPI = new UserPreferenceAPI();
|
|
13
|
+
this.customAPI = userPreferenceAPI;
|
|
14
|
+
this.userPreferenceAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
|
|
15
|
+
this.userPreferenceAdapter = userPreferenceAdapter || new UserPreferenceAdapter();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async invokeAPI(_ref2) {
|
|
19
|
+
let {
|
|
20
|
+
operation,
|
|
21
|
+
request,
|
|
22
|
+
adapter = this.userPreferenceAdapter,
|
|
23
|
+
responseType
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return this.executeAPICall({
|
|
26
|
+
operation,
|
|
27
|
+
request,
|
|
28
|
+
apiProxy: this.userPreferenceAPI,
|
|
29
|
+
customAPI: this.customAPI,
|
|
30
|
+
adapter,
|
|
31
|
+
responseType
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async getPreferences(request) {
|
|
36
|
+
return this.invokeAPI({
|
|
37
|
+
operation: 'getPreferences',
|
|
38
|
+
request,
|
|
39
|
+
responseType: ResponseTypes.SINGLE
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async updatePreferences(request) {
|
|
44
|
+
return this.invokeAPI({
|
|
45
|
+
operation: 'updatePreferences',
|
|
46
|
+
request,
|
|
47
|
+
responseType: ResponseTypes.SINGLE
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
toJSON() {
|
|
52
|
+
return {
|
|
53
|
+
getPreferences: this.getPreferences.bind(this),
|
|
54
|
+
updatePreferences: this.updatePreferences.bind(this)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { IWhatsAppPricingRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
+
import { WhatsAppPricingAdapter } from '../../adapters';
|
|
3
|
+
import { WhatsAppPricingAPI } from '../../api';
|
|
4
|
+
import { ResponseTypes } from '../../../core/constants';
|
|
5
|
+
export default class WhatsAppPricingRepository extends IWhatsAppPricingRepository {
|
|
6
|
+
constructor(_ref) {
|
|
7
|
+
let {
|
|
8
|
+
whatsAppPricingAPI,
|
|
9
|
+
whatsAppPricingAdapter
|
|
10
|
+
} = _ref;
|
|
11
|
+
super();
|
|
12
|
+
this.defaultAPI = new WhatsAppPricingAPI();
|
|
13
|
+
this.customAPI = whatsAppPricingAPI;
|
|
14
|
+
this.whatsAppPricingAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
|
|
15
|
+
this.whatsAppPricingAdapter = whatsAppPricingAdapter || new WhatsAppPricingAdapter();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async invokeAPI(_ref2) {
|
|
19
|
+
let {
|
|
20
|
+
operation,
|
|
21
|
+
request,
|
|
22
|
+
adapter = this.whatsAppPricingAdapter,
|
|
23
|
+
responseType
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return this.executeAPICall({
|
|
26
|
+
operation,
|
|
27
|
+
request,
|
|
28
|
+
apiProxy: this.whatsAppPricingAPI,
|
|
29
|
+
customAPI: this.customAPI,
|
|
30
|
+
adapter,
|
|
31
|
+
responseType
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async calculateWhatsAppPricing(request) {
|
|
36
|
+
return this.invokeAPI({
|
|
37
|
+
operation: 'calculateWhatsAppPricing',
|
|
38
|
+
request,
|
|
39
|
+
responseType: ResponseTypes.SINGLE
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
toJSON() {
|
|
44
|
+
return {
|
|
45
|
+
calculateWhatsAppPricing: this.calculateWhatsAppPricing.bind(this)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohoim/client-sdk",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-rightPanelSessionInfo-2",
|
|
4
4
|
"description": "To have the client sdk for the IM",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
"@zohodesk/docs-builder": "1.0.2",
|
|
33
33
|
"@testing-library/jest-dom": "^5.16.5"
|
|
34
34
|
}
|
|
35
|
-
}
|
|
35
|
+
}
|