@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,15 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function getAddOnsRequest() {
|
|
4
|
+
let {
|
|
5
|
+
query = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withQuery({
|
|
8
|
+
subscription: true,
|
|
9
|
+
integrationServiceId: null,
|
|
10
|
+
currencyCode: null,
|
|
11
|
+
...query
|
|
12
|
+
}).build();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default getAddOnsRequest;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as getAddOnsRequest } from './getAddOnsRequest';
|
|
2
|
+
export { default as buyAddOnRequest } from './buyAddOnRequest';
|
|
3
|
+
export { default as modifyAddOnRequest } from './modifyAddOnRequest';
|
|
4
|
+
export { default as getLicenseDetailsRequest } from './getLicenseDetailsRequest';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function modifyAddOnRequest() {
|
|
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 modifyAddOnRequest;
|
|
@@ -4,9 +4,10 @@ function getTemplateCreditExhaustStatusRequest() {
|
|
|
4
4
|
let {
|
|
5
5
|
params = {}
|
|
6
6
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
return new RequestBuilder().withParams({
|
|
7
|
+
return new RequestBuilder().withParams({
|
|
8
8
|
channelId: null,
|
|
9
|
-
receiverId: null
|
|
9
|
+
receiverId: null,
|
|
10
|
+
...params
|
|
10
11
|
}).build();
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { default as getTemplateLanguagesRequest } from './getTemplateLanguagesRequest';
|
|
2
|
-
export { default as getTemplateCreditExhaustStatusRequest } from './getTemplateCreditExhaustStatusRequest';
|
|
2
|
+
export { default as getTemplateCreditExhaustStatusRequest } from './getTemplateCreditExhaustStatusRequest';
|
|
3
|
+
export { default as getTemplateTagsRequest } from './getTemplateTagsRequest';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function calculateWhatsAppPricingRequest() {
|
|
4
|
+
let {
|
|
5
|
+
body = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withBody({
|
|
8
|
+
currency: null,
|
|
9
|
+
data: null,
|
|
10
|
+
...body
|
|
11
|
+
}).build();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default calculateWhatsAppPricingRequest;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as calculateWhatsAppPricingRequest } from './calculateWhatsAppPricingRequest';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { CallSchema } from '../../schema';
|
|
3
|
+
import { Actor } from '../Actor';
|
|
4
|
+
export default class Call {
|
|
5
|
+
constructor() {
|
|
6
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
const validatedData = validateSchema({
|
|
8
|
+
schema: CallSchema,
|
|
9
|
+
data,
|
|
10
|
+
entityName: 'Call'
|
|
11
|
+
}); // Set required properties from schema
|
|
12
|
+
|
|
13
|
+
this.id = validatedData.id;
|
|
14
|
+
this.integrationServiceId = validatedData.integrationServiceId;
|
|
15
|
+
this.actor = new Actor(validatedData.actor).toJSON();
|
|
16
|
+
this.channelId = validatedData.channelId;
|
|
17
|
+
this.createdTime = validatedData.createdTime;
|
|
18
|
+
this.direction = validatedData.direction;
|
|
19
|
+
this.sessionId = validatedData.sessionId;
|
|
20
|
+
this.status = validatedData.status; // Set optional properties from schema
|
|
21
|
+
|
|
22
|
+
this.meta = validatedData.meta || null;
|
|
23
|
+
this.participants = validatedData.participants || null;
|
|
24
|
+
this.session = validatedData.session || false;
|
|
25
|
+
this.statuses = validatedData.statuses || null;
|
|
26
|
+
this.duration = validatedData.duration || null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
toJSON() {
|
|
30
|
+
return {
|
|
31
|
+
id: this.id,
|
|
32
|
+
integrationServiceId: this.integrationServiceId,
|
|
33
|
+
actor: this.actor,
|
|
34
|
+
channelId: this.channelId,
|
|
35
|
+
createdTime: this.createdTime,
|
|
36
|
+
direction: this.direction,
|
|
37
|
+
sessionId: this.sessionId,
|
|
38
|
+
status: this.status,
|
|
39
|
+
meta: this.meta,
|
|
40
|
+
participants: this.participants,
|
|
41
|
+
session: this.session,
|
|
42
|
+
statuses: this.statuses,
|
|
43
|
+
duration: this.duration
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Call } from './Call';
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import { validateSchema } from '../../../core/utils';
|
|
2
|
-
import { CannedMessageStatus } from '../../enum';
|
|
2
|
+
import { CannedMessageStatus, CannedMessageType } from '../../enum';
|
|
3
3
|
import { CannedMessageSchema } from '../../schema';
|
|
4
4
|
import { Actor } from '../Actor';
|
|
5
|
+
import Translation from './Translation';
|
|
5
6
|
export default class CannedMessage {
|
|
6
7
|
constructor() {
|
|
7
8
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8
9
|
const validatedData = validateSchema({
|
|
9
10
|
schema: CannedMessageSchema,
|
|
10
11
|
data,
|
|
11
|
-
entityName:
|
|
12
|
+
entityName: `CannedMessage${data?.id ? `_${data.id}` : ''}`
|
|
12
13
|
});
|
|
13
14
|
let {
|
|
14
|
-
createdBy
|
|
15
|
+
createdBy,
|
|
16
|
+
translations
|
|
15
17
|
} = validatedData;
|
|
16
18
|
|
|
17
19
|
if (createdBy && typeof createdBy === 'object' && !Array.isArray(createdBy)) {
|
|
18
|
-
createdBy = new Actor(createdBy);
|
|
20
|
+
createdBy = new Actor(createdBy).toJSON();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (Array.isArray(translations)) {
|
|
24
|
+
translations = translations.map(item => new Translation(item).toJSON());
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
this.data = {
|
|
@@ -33,8 +39,10 @@ export default class CannedMessage {
|
|
|
33
39
|
isPrivate: validatedData.isPrivate,
|
|
34
40
|
rejectionReason: validatedData.rejectionReason,
|
|
35
41
|
modifiedTime: validatedData.modifiedTime,
|
|
36
|
-
translations
|
|
37
|
-
parameters: validatedData.parameters
|
|
42
|
+
translations,
|
|
43
|
+
parameters: validatedData.parameters,
|
|
44
|
+
primaryLanguage: validatedData.primaryLanguage,
|
|
45
|
+
wabaId: validatedData.wabaId
|
|
38
46
|
};
|
|
39
47
|
}
|
|
40
48
|
|
|
@@ -50,6 +58,26 @@ export default class CannedMessage {
|
|
|
50
58
|
return status === CannedMessageStatus.PENDING;
|
|
51
59
|
}
|
|
52
60
|
|
|
61
|
+
static isUnknown(status) {
|
|
62
|
+
return status === CannedMessageStatus.UNKNOWN;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static isPartiallyApproved(status) {
|
|
66
|
+
return status === CannedMessageStatus.PARTIALLY_APPROVED;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static isDeletionInProgress(status) {
|
|
70
|
+
return status === CannedMessageStatus.DELETION_IN_PROGRESS;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static isDeletionFailed(status) {
|
|
74
|
+
return status === CannedMessageStatus.DELETION_FAILED;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
static isTemplate(type) {
|
|
78
|
+
return type === CannedMessageType.TEMPLATE;
|
|
79
|
+
}
|
|
80
|
+
|
|
53
81
|
toJSON() {
|
|
54
82
|
return { ...this.data
|
|
55
83
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { TranslationsSchema } from '../../schema';
|
|
3
|
+
import { TemplateItemButton, TemplateItemHeader, TemplateItemFooter } from '../TemplateMessage';
|
|
4
|
+
export default class Translation {
|
|
5
|
+
constructor() {
|
|
6
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
const validatedData = validateSchema({
|
|
8
|
+
schema: TranslationsSchema,
|
|
9
|
+
data,
|
|
10
|
+
entityName: `Translation${data?.id ? `_${data.id}` : ''}`
|
|
11
|
+
});
|
|
12
|
+
const {
|
|
13
|
+
templateItems
|
|
14
|
+
} = validatedData;
|
|
15
|
+
let adaptedTemplateItems = null;
|
|
16
|
+
|
|
17
|
+
if (templateItems) {
|
|
18
|
+
const {
|
|
19
|
+
header,
|
|
20
|
+
footer,
|
|
21
|
+
buttons
|
|
22
|
+
} = templateItems;
|
|
23
|
+
adaptedTemplateItems = {
|
|
24
|
+
header: header ? new TemplateItemHeader(header).toJSON() : null,
|
|
25
|
+
footer: footer ? new TemplateItemFooter(footer).toJSON() : null,
|
|
26
|
+
buttons: Array.isArray(buttons) ? buttons.map(btn => new TemplateItemButton(btn).toJSON()) : null
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
this.data = {
|
|
31
|
+
id: validatedData.id,
|
|
32
|
+
language: validatedData.language,
|
|
33
|
+
message: validatedData.message,
|
|
34
|
+
displayMessage: validatedData.displayMessage,
|
|
35
|
+
uuid: validatedData.uuid,
|
|
36
|
+
status: validatedData.status,
|
|
37
|
+
modifiedTime: validatedData.modifiedTime,
|
|
38
|
+
failedReason: validatedData.failedReason,
|
|
39
|
+
templateItems: adaptedTemplateItems
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
toJSON() {
|
|
44
|
+
return { ...this.data
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}
|
|
@@ -10,32 +10,50 @@ export default class Channel {
|
|
|
10
10
|
}); // Set required properties from schema
|
|
11
11
|
|
|
12
12
|
this.id = validatedData.id;
|
|
13
|
-
this.integrationService = validatedData.integrationService;
|
|
14
13
|
this.name = validatedData.name;
|
|
15
14
|
this.isActive = validatedData.isActive;
|
|
16
|
-
this.
|
|
15
|
+
this.isDeleted = validatedData.isDeleted;
|
|
16
|
+
this.isSandBox = validatedData.isSandBox;
|
|
17
|
+
this.createdTime = validatedData.createdTime;
|
|
18
|
+
this.universalLink = validatedData.universalLink; // Set optional properties from schema
|
|
17
19
|
|
|
20
|
+
this.integrationServiceType = validatedData.integrationServiceType || '';
|
|
21
|
+
this.integrationServiceId = validatedData.integrationServiceId || '';
|
|
18
22
|
this.defaultBotId = validatedData.defaultBotId || null;
|
|
19
23
|
this.accountName = validatedData.accountName || null;
|
|
20
24
|
this.isSubscribed = validatedData.isSubscribed || false;
|
|
21
25
|
this.createdBy = validatedData.createdBy || null;
|
|
22
26
|
this.isOwner = validatedData.isOwner || false;
|
|
23
27
|
this.photoURL = validatedData.photoURL || null;
|
|
28
|
+
this.configParams = validatedData.configParams || null;
|
|
29
|
+
this.authorizationPending = validatedData.authorizationPending || false;
|
|
30
|
+
this.meta = validatedData.meta || [];
|
|
31
|
+
this.logoURL = validatedData.logoURL || null;
|
|
32
|
+
this.workspaceId = validatedData.workspaceId || '';
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
toJSON() {
|
|
27
36
|
return {
|
|
28
37
|
id: this.id,
|
|
29
|
-
|
|
38
|
+
integrationServiceType: this.integrationServiceType,
|
|
39
|
+
integrationServiceId: this.integrationServiceId,
|
|
30
40
|
name: this.name,
|
|
31
41
|
defaultBotId: this.defaultBotId,
|
|
32
42
|
isActive: this.isActive,
|
|
43
|
+
isDeleted: this.isDeleted,
|
|
44
|
+
isSandBox: this.isSandBox,
|
|
33
45
|
createdTime: this.createdTime,
|
|
34
46
|
accountName: this.accountName,
|
|
47
|
+
universalLink: this.universalLink,
|
|
35
48
|
isSubscribed: this.isSubscribed,
|
|
36
49
|
createdBy: this.createdBy,
|
|
37
50
|
isOwner: this.isOwner,
|
|
38
|
-
photoURL: this.photoURL
|
|
51
|
+
photoURL: this.photoURL,
|
|
52
|
+
configParams: this.configParams,
|
|
53
|
+
authorizationPending: this.authorizationPending,
|
|
54
|
+
meta: this.meta,
|
|
55
|
+
logoURL: this.logoURL,
|
|
56
|
+
workspaceId: this.workspaceId
|
|
39
57
|
};
|
|
40
58
|
}
|
|
41
59
|
|
|
@@ -14,7 +14,10 @@ export default class Contact {
|
|
|
14
14
|
email: validatedData.email,
|
|
15
15
|
photoURL: validatedData.photoURL || null,
|
|
16
16
|
mobile: validatedData.mobile,
|
|
17
|
-
phone: validatedData.phone
|
|
17
|
+
phone: validatedData.phone,
|
|
18
|
+
customFields: validatedData.customFields || {},
|
|
19
|
+
webUrl: validatedData.webUrl || '',
|
|
20
|
+
layoutId: validatedData.layoutId || ''
|
|
18
21
|
};
|
|
19
22
|
}
|
|
20
23
|
|
|
@@ -13,7 +13,10 @@ export default class IntegrationService {
|
|
|
13
13
|
label: validatedData.label || '',
|
|
14
14
|
id: validatedData.id || '',
|
|
15
15
|
provider: validatedData.provider || {},
|
|
16
|
-
logoURL: validatedData.logoURL || null
|
|
16
|
+
logoURL: validatedData.logoURL || null,
|
|
17
|
+
domain: validatedData.domain || '',
|
|
18
|
+
channelAlias: validatedData.channelAlias,
|
|
19
|
+
isParentAccountNeeded: validatedData.isParentAccountNeeded
|
|
17
20
|
};
|
|
18
21
|
}
|
|
19
22
|
|
|
@@ -29,6 +32,10 @@ export default class IntegrationService {
|
|
|
29
32
|
return integrationServiceId === IntegrationServices.IM_TALK;
|
|
30
33
|
}
|
|
31
34
|
|
|
35
|
+
static isWecom(integrationServiceId) {
|
|
36
|
+
return integrationServiceId === IntegrationServices.WECOM;
|
|
37
|
+
}
|
|
38
|
+
|
|
32
39
|
toJSON() {
|
|
33
40
|
return { ...this.data
|
|
34
41
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { PlaceholderSchema } from '../../schema/placeholder';
|
|
3
|
+
export default class Placeholder {
|
|
4
|
+
constructor() {
|
|
5
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
+
const validatedData = validateSchema({
|
|
7
|
+
schema: PlaceholderSchema,
|
|
8
|
+
data,
|
|
9
|
+
entityName: 'Placeholder'
|
|
10
|
+
});
|
|
11
|
+
this.data = {
|
|
12
|
+
apiName: validatedData.apiName,
|
|
13
|
+
i18nFieldLabel: validatedData.i18nFieldLabel,
|
|
14
|
+
fieldLabel: validatedData.fieldLabel,
|
|
15
|
+
placeHolder: validatedData.placeHolder
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
toJSON() {
|
|
20
|
+
return { ...this.data
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { SessionMetricsSchema } from '../../schema';
|
|
3
|
+
export default class SessionMetrics {
|
|
4
|
+
constructor() {
|
|
5
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
+
const validatedData = validateSchema({
|
|
7
|
+
schema: SessionMetricsSchema,
|
|
8
|
+
data,
|
|
9
|
+
entityName: 'SessionMetrics'
|
|
10
|
+
});
|
|
11
|
+
this.data = {
|
|
12
|
+
assignee: validatedData.assignee
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
toJSON() {
|
|
17
|
+
return { ...this.data
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { AddOnSchema } from '../../schema';
|
|
3
|
+
import SubscriptionInfo from './SubscriptionInfo';
|
|
4
|
+
export default class AddOn {
|
|
5
|
+
constructor() {
|
|
6
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
const validatedData = validateSchema({
|
|
8
|
+
schema: AddOnSchema,
|
|
9
|
+
data,
|
|
10
|
+
entityName: 'AddOn' // No I18N
|
|
11
|
+
|
|
12
|
+
});
|
|
13
|
+
this.data = {
|
|
14
|
+
name: validatedData.name,
|
|
15
|
+
type: validatedData.type,
|
|
16
|
+
module: validatedData.module,
|
|
17
|
+
cost: validatedData.cost,
|
|
18
|
+
subscriptionInfo: validatedData.subscriptionInfo ? new SubscriptionInfo(validatedData.subscriptionInfo).toJSON() : null
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
toJSON() {
|
|
23
|
+
return this.data;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { LicenseDetailsSchema } from '../../schema';
|
|
3
|
+
export default class LicenseDetails {
|
|
4
|
+
constructor() {
|
|
5
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
+
const validatedData = validateSchema({
|
|
7
|
+
schema: LicenseDetailsSchema,
|
|
8
|
+
data,
|
|
9
|
+
entityName: 'LicenseDetails' // No I18N
|
|
10
|
+
|
|
11
|
+
});
|
|
12
|
+
this.data = {
|
|
13
|
+
paymentSource: validatedData.paymentSource
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
toJSON() {
|
|
18
|
+
return this.data;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { SubscriptionInfoSchema } from '../../schema';
|
|
3
|
+
export default class SubscriptionInfo {
|
|
4
|
+
constructor() {
|
|
5
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
+
const validatedData = validateSchema({
|
|
7
|
+
schema: SubscriptionInfoSchema,
|
|
8
|
+
data,
|
|
9
|
+
entityName: 'SubscriptionInfo' // No I18N
|
|
10
|
+
|
|
11
|
+
});
|
|
12
|
+
this.data = {
|
|
13
|
+
count: validatedData.count,
|
|
14
|
+
available: validatedData.available,
|
|
15
|
+
renewalCount: validatedData.renewalCount,
|
|
16
|
+
renewalThreshold: validatedData.renewalThreshold,
|
|
17
|
+
status: validatedData.status,
|
|
18
|
+
reserved: validatedData.reserved
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
toJSON() {
|
|
23
|
+
return this.data;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { TemplateItemButtonType } from '../../enum';
|
|
3
|
+
import { TemplateItemButtonsSchema } from '../../schema';
|
|
4
|
+
export default class TemplateItemButton {
|
|
5
|
+
constructor() {
|
|
6
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
const validatedData = validateSchema({
|
|
8
|
+
schema: TemplateItemButtonsSchema,
|
|
9
|
+
data,
|
|
10
|
+
entityName: 'TemplateItemButton'
|
|
11
|
+
});
|
|
12
|
+
this.data = {
|
|
13
|
+
type: validatedData.type,
|
|
14
|
+
message: validatedData.message,
|
|
15
|
+
action: validatedData.action
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static isPhoneNumber(type) {
|
|
20
|
+
return type === TemplateItemButtonType.PHONE_NUMBER;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static isURL(type) {
|
|
24
|
+
return type === TemplateItemButtonType.URL;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static isCallToAction(type) {
|
|
28
|
+
return TemplateItemButton.isPhoneNumber(type) || TemplateItemButton.isURL(type);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static isQuickReply(type) {
|
|
32
|
+
return type === TemplateItemButtonType.QUICK_REPLY;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static isOTP(type) {
|
|
36
|
+
return type === TemplateItemButtonType.OTP;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static isCatalog(type) {
|
|
40
|
+
return type === TemplateItemButtonType.CATALOG;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
toJSON() {
|
|
44
|
+
return { ...this.data
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { TemplateItemFooterType } from '../../enum';
|
|
3
|
+
import { TemplateItemFooterSchema } from '../../schema';
|
|
4
|
+
export default class TemplateItemFooter {
|
|
5
|
+
constructor() {
|
|
6
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
const validatedData = validateSchema({
|
|
8
|
+
schema: TemplateItemFooterSchema,
|
|
9
|
+
data,
|
|
10
|
+
entityName: 'TemplateItemFooter'
|
|
11
|
+
});
|
|
12
|
+
this.data = {
|
|
13
|
+
type: validatedData.type,
|
|
14
|
+
message: validatedData.message
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static isText(type) {
|
|
19
|
+
return type === TemplateItemFooterType.TEXT;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
toJSON() {
|
|
23
|
+
return { ...this.data
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { TemplateItemHeaderType } from '../../enum';
|
|
3
|
+
import { TemplateItemHeaderSchema } from '../../schema';
|
|
4
|
+
export default class TemplateItemHeader {
|
|
5
|
+
constructor() {
|
|
6
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
const validatedData = validateSchema({
|
|
8
|
+
schema: TemplateItemHeaderSchema,
|
|
9
|
+
data,
|
|
10
|
+
entityName: 'TemplateItemHeader'
|
|
11
|
+
});
|
|
12
|
+
this.data = {
|
|
13
|
+
type: validatedData.type,
|
|
14
|
+
message: validatedData.message,
|
|
15
|
+
attachment: validatedData.attachment
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static isNone(type) {
|
|
20
|
+
return type === TemplateItemHeaderType.NONE;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static isText(type) {
|
|
24
|
+
return type === TemplateItemHeaderType.TEXT;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static isImage(type) {
|
|
28
|
+
return type === TemplateItemHeaderType.IMAGE;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static isVideo(type) {
|
|
32
|
+
return type === TemplateItemHeaderType.VIDEO;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static isDocument(type) {
|
|
36
|
+
return type === TemplateItemHeaderType.DOCUMENT;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static isMedia(type) {
|
|
40
|
+
return TemplateItemHeader.isImage(type) || TemplateItemHeader.isVideo(type) || TemplateItemHeader.isDocument(type);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
toJSON() {
|
|
44
|
+
return { ...this.data
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}
|