@zohoim/client-sdk 1.0.0-canned08 → 1.0.0-leftPanelPoc1
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/cannedMessages/CannedMessageService.js +1 -21
- package/es/application/services/channels/ChannelService.js +6 -1
- package/es/application/services/index.js +3 -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/templateMessages/TemplateMessageService.js +1 -6
- package/es/application/services/userPreferences/UserPreferenceService.js +26 -0
- package/es/application/services/userPreferences/index.js +2 -0
- package/es/core/constants/ModuleNames.js +3 -1
- package/es/domain/dto/cannedMessages/index.js +1 -5
- package/es/domain/dto/{cannedMessages/deleteTranslationRequest.js → channels/getChannelRequest.js} +3 -4
- package/es/domain/dto/channels/getChannelsRequest.js +3 -1
- package/es/domain/dto/channels/index.js +2 -1
- package/es/domain/dto/index.js +3 -1
- package/es/domain/dto/{templateMessages/getTemplateTagsRequest.js → integrationServices/getIntegrationsRequest.js} +2 -2
- package/es/domain/dto/integrationServices/index.js +1 -0
- package/es/domain/dto/sessions/getSessionMetricsRequest.js +16 -0
- package/es/domain/dto/sessions/index.js +2 -1
- package/es/domain/dto/templateMessages/index.js +1 -2
- 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/entities/CannedMessage/CannedMessage.js +6 -34
- package/es/domain/entities/CannedMessage/index.js +1 -2
- package/es/domain/entities/Channel/Channel.js +20 -4
- package/es/domain/entities/IntegrationService/IntegrationService.js +8 -1
- package/es/domain/entities/Session/SessionMetrics.js +21 -0
- package/es/domain/entities/Session/index.js +2 -1
- package/es/domain/entities/TemplateMessage/index.js +1 -4
- package/es/domain/entities/UserPreference/UserPreference.js +26 -0
- package/es/domain/entities/UserPreference/index.js +2 -0
- package/es/domain/entities/index.js +1 -1
- package/es/domain/enum/cannedMessage/CannedMessageStatus.js +1 -11
- package/es/domain/enum/cannedMessage/CannedMessageType.js +1 -3
- package/es/domain/enum/cannedMessage/TemplateItemButtonType.js +1 -7
- package/es/domain/enum/cannedMessage/TemplateItemHeaderType.js +1 -3
- package/es/domain/enum/index.js +2 -1
- package/es/domain/enum/session/AssigneeFilter.js +6 -0
- package/es/domain/enum/session/SessionStatus.js +2 -1
- package/es/domain/enum/session/index.js +2 -1
- package/es/domain/enum/userPreference/CollapseSidePanel.js +5 -0
- package/es/domain/enum/userPreference/index.js +2 -0
- package/es/domain/interfaces/repositories/cannedMessages/ICannedMessageRepository.js +1 -21
- package/es/domain/interfaces/repositories/channels/IChannelRepository.js +7 -1
- package/es/domain/interfaces/repositories/index.js +3 -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/templateMessages/ITemplateMessageRepository.js +1 -7
- package/es/domain/interfaces/repositories/userPreferences/IUserPreferenceRepository.js +23 -0
- package/es/domain/interfaces/repositories/userPreferences/index.js +2 -0
- package/es/domain/schema/cannedMessage/CannedMessageSchema.js +0 -12
- package/es/domain/schema/cannedMessage/TemplateItem/TemplateItemButtonsSchema.js +1 -1
- package/es/domain/schema/cannedMessage/TranslationsSchema.js +1 -1
- package/es/domain/schema/cannedMessage/index.js +1 -3
- package/es/domain/schema/channel/ChannelSchema.js +35 -5
- package/es/domain/schema/index.js +1 -1
- package/es/domain/schema/integrationService/IntegrationServiceSchema.js +12 -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/userPreference/UserPreferenceSchema.js +9 -0
- package/es/domain/schema/userPreference/index.js +2 -0
- package/es/frameworks/managers/ModuleFactory.js +18 -0
- package/es/frameworks/managers/ModuleManager.js +1 -1
- package/es/frameworks/sdk/IMSDK.js +10 -0
- package/es/frameworks/sdk/integrationServices/IntegrationServiceSDK.js +30 -0
- package/es/frameworks/sdk/integrationServices/index.js +2 -0
- package/es/frameworks/sdk/userPreferences/UserPreferencesSDK.js +30 -0
- package/es/frameworks/sdk/userPreferences/index.js +2 -0
- package/es/infrastructure/adapters/cannedMessages/CannedMessageAdapter.js +2 -3
- package/es/infrastructure/adapters/cannedMessages/index.js +1 -2
- package/es/infrastructure/adapters/channels/ChannelAdapter.js +15 -2
- package/es/infrastructure/adapters/index.js +2 -1
- package/es/infrastructure/adapters/integrationServices/IntegrationServiceAdapter.js +25 -0
- package/es/infrastructure/adapters/integrationServices/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/userPreferences/UserPreferenceAdapter.js +19 -0
- package/es/infrastructure/adapters/userPreferences/index.js +2 -0
- package/es/infrastructure/api/cannedMessages/CannedMessageAPI.js +1 -41
- package/es/infrastructure/api/index.js +3 -1
- package/es/infrastructure/api/integrationServices/IntegrationServiceAPI.js +14 -0
- package/es/infrastructure/api/integrationServices/index.js +2 -0
- package/es/infrastructure/api/registry/cannedMessages/cannedMessageAPIRegistry.js +2 -22
- package/es/infrastructure/api/registry/getRegistryConfig.js +5 -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 +8 -2
- package/es/infrastructure/api/registry/templateMessages/templateMessageAPIRegistry.js +2 -7
- 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/sessions/SessionAPI.js +11 -1
- package/es/infrastructure/api/templateMessages/TemplateMessageAPI.js +1 -11
- package/es/infrastructure/api/userPreferences/UserPreferenceAPI.js +24 -0
- package/es/infrastructure/api/userPreferences/index.js +2 -0
- package/es/infrastructure/repositories/cannedMessages/CannedMessageRepository.js +7 -50
- package/es/infrastructure/repositories/channels/ChannelRepository.js +10 -1
- package/es/infrastructure/repositories/index.js +3 -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/templateMessages/TemplateMessageRepository.js +1 -10
- package/es/infrastructure/repositories/userPreferences/UserPreferenceRepository.js +58 -0
- package/es/infrastructure/repositories/userPreferences/index.js +2 -0
- package/package.json +1 -1
- package/es/domain/dto/cannedMessages/addTranslationRequest.js +0 -18
- package/es/domain/dto/cannedMessages/getCannedPlaceholdersRequest.js +0 -10
- package/es/domain/dto/cannedMessages/updateTranslationRequest.js +0 -18
- package/es/domain/entities/CannedMessage/Translation.js +0 -48
- package/es/domain/entities/Placeholder/Placeholder.js +0 -24
- package/es/domain/entities/Placeholder/index.js +0 -2
- package/es/domain/entities/TemplateMessage/TemplateItemButton.js +0 -48
- package/es/domain/entities/TemplateMessage/TemplateItemFooter.js +0 -27
- package/es/domain/entities/TemplateMessage/TemplateItemHeader.js +0 -48
- package/es/domain/schema/placeholder/PlaceholderSchema.js +0 -19
- package/es/domain/schema/placeholder/index.js +0 -2
- package/es/infrastructure/adapters/cannedMessages/TranslationAdapter.js +0 -27
- package/es/infrastructure/adapters/placeholders/PlaceholderAdapter.js +0 -22
- package/es/infrastructure/adapters/placeholders/index.js +0 -2
|
@@ -36,22 +36,6 @@ 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
|
-
|
|
55
39
|
toJSON() {
|
|
56
40
|
return {
|
|
57
41
|
getCannedMessages: this.getCannedMessages.bind(this),
|
|
@@ -60,11 +44,7 @@ export default class CannedMessageService extends ICannedMessageRepository {
|
|
|
60
44
|
deleteCannedMessage: this.deleteCannedMessage.bind(this),
|
|
61
45
|
updateCannedMessage: this.updateCannedMessage.bind(this),
|
|
62
46
|
enableCannedMessage: this.enableCannedMessage.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)
|
|
47
|
+
disableCannedMessage: this.disableCannedMessage.bind(this)
|
|
68
48
|
};
|
|
69
49
|
}
|
|
70
50
|
|
|
@@ -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
|
|
|
@@ -5,4 +5,6 @@ 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';
|
|
@@ -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
|
|
|
@@ -16,15 +16,10 @@ 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
|
-
|
|
23
19
|
toJSON() {
|
|
24
20
|
return {
|
|
25
21
|
getTemplateLanguages: this.getTemplateLanguages.bind(this),
|
|
26
|
-
getWhatsAppTemplateCreditExhaustStatus: this.getWhatsAppTemplateCreditExhaustStatus.bind(this)
|
|
27
|
-
getTemplateTags: this.getTemplateTags.bind(this)
|
|
22
|
+
getWhatsAppTemplateCreditExhaustStatus: this.getWhatsAppTemplateCreditExhaustStatus.bind(this)
|
|
28
23
|
};
|
|
29
24
|
}
|
|
30
25
|
|
|
@@ -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
|
+
}
|
|
@@ -7,6 +7,8 @@ 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'
|
|
11
13
|
};
|
|
12
14
|
export default ModuleNames;
|
|
@@ -4,8 +4,4 @@ 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';
|
|
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';
|
|
7
|
+
export { default as updateCannedMessageRequest } from './updateCannedMessageRequest';
|
package/es/domain/dto/{cannedMessages/deleteTranslationRequest.js → channels/getChannelRequest.js}
RENAMED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import RequestBuilder from '../RequestBuilder';
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function getChannelRequest() {
|
|
4
4
|
let {
|
|
5
5
|
params = {}
|
|
6
6
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
7
|
return new RequestBuilder().withParams({
|
|
8
|
-
|
|
9
|
-
translationId: null,
|
|
8
|
+
channelId: null,
|
|
10
9
|
...params
|
|
11
10
|
}).build();
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
export default
|
|
13
|
+
export default getChannelRequest;
|
package/es/domain/dto/index.js
CHANGED
|
@@ -5,4 +5,6 @@ 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';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as getIntegrationsRequest } from './getIntegrationsRequest';
|
|
@@ -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';
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { default as getTemplateLanguagesRequest } from './getTemplateLanguagesRequest';
|
|
2
|
-
export { default as getTemplateCreditExhaustStatusRequest } from './getTemplateCreditExhaustStatusRequest';
|
|
3
|
-
export { default as getTemplateTagsRequest } from './getTemplateTagsRequest';
|
|
2
|
+
export { default as getTemplateCreditExhaustStatusRequest } from './getTemplateCreditExhaustStatusRequest';
|
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
import { validateSchema } from '../../../core/utils';
|
|
2
|
-
import { CannedMessageStatus
|
|
2
|
+
import { CannedMessageStatus } from '../../enum';
|
|
3
3
|
import { CannedMessageSchema } from '../../schema';
|
|
4
4
|
import { Actor } from '../Actor';
|
|
5
|
-
import Translation from './Translation';
|
|
6
5
|
export default class CannedMessage {
|
|
7
6
|
constructor() {
|
|
8
7
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9
8
|
const validatedData = validateSchema({
|
|
10
9
|
schema: CannedMessageSchema,
|
|
11
10
|
data,
|
|
12
|
-
entityName:
|
|
11
|
+
entityName: 'CannedMessage'
|
|
13
12
|
});
|
|
14
13
|
let {
|
|
15
|
-
createdBy
|
|
16
|
-
translations
|
|
14
|
+
createdBy
|
|
17
15
|
} = validatedData;
|
|
18
16
|
|
|
19
17
|
if (createdBy && typeof createdBy === 'object' && !Array.isArray(createdBy)) {
|
|
20
|
-
createdBy = new Actor(createdBy)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (Array.isArray(translations)) {
|
|
24
|
-
translations = translations.map(item => new Translation(item).toJSON());
|
|
18
|
+
createdBy = new Actor(createdBy);
|
|
25
19
|
}
|
|
26
20
|
|
|
27
21
|
this.data = {
|
|
@@ -39,10 +33,8 @@ export default class CannedMessage {
|
|
|
39
33
|
isPrivate: validatedData.isPrivate,
|
|
40
34
|
rejectionReason: validatedData.rejectionReason,
|
|
41
35
|
modifiedTime: validatedData.modifiedTime,
|
|
42
|
-
translations,
|
|
43
|
-
parameters: validatedData.parameters
|
|
44
|
-
primaryLanguage: validatedData.primaryLanguage,
|
|
45
|
-
wabaId: validatedData.wabaId
|
|
36
|
+
translations: validatedData.translations,
|
|
37
|
+
parameters: validatedData.parameters
|
|
46
38
|
};
|
|
47
39
|
}
|
|
48
40
|
|
|
@@ -58,26 +50,6 @@ export default class CannedMessage {
|
|
|
58
50
|
return status === CannedMessageStatus.PENDING;
|
|
59
51
|
}
|
|
60
52
|
|
|
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
|
-
|
|
81
53
|
toJSON() {
|
|
82
54
|
return { ...this.data
|
|
83
55
|
};
|
|
@@ -10,32 +10,48 @@ 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;
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
toJSON() {
|
|
27
35
|
return {
|
|
28
36
|
id: this.id,
|
|
29
|
-
|
|
37
|
+
integrationServiceType: this.integrationServiceType,
|
|
38
|
+
integrationServiceId: this.integrationServiceId,
|
|
30
39
|
name: this.name,
|
|
31
40
|
defaultBotId: this.defaultBotId,
|
|
32
41
|
isActive: this.isActive,
|
|
42
|
+
isDeleted: this.isDeleted,
|
|
43
|
+
isSandBox: this.isSandBox,
|
|
33
44
|
createdTime: this.createdTime,
|
|
34
45
|
accountName: this.accountName,
|
|
46
|
+
universalLink: this.universalLink,
|
|
35
47
|
isSubscribed: this.isSubscribed,
|
|
36
48
|
createdBy: this.createdBy,
|
|
37
49
|
isOwner: this.isOwner,
|
|
38
|
-
photoURL: this.photoURL
|
|
50
|
+
photoURL: this.photoURL,
|
|
51
|
+
configParams: this.configParams,
|
|
52
|
+
authorizationPending: this.authorizationPending,
|
|
53
|
+
meta: this.meta,
|
|
54
|
+
logoURL: this.logoURL
|
|
39
55
|
};
|
|
40
56
|
}
|
|
41
57
|
|
|
@@ -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,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
|
+
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import TemplateLanguage from './TemplateLanguage';
|
|
2
2
|
import TemplateCreditExhaustStatus from './TemplateCreditExhaustStatus';
|
|
3
|
-
|
|
4
|
-
import TemplateItemHeader from './TemplateItemHeader';
|
|
5
|
-
import TemplateItemFooter from './TemplateItemFooter';
|
|
6
|
-
export { TemplateLanguage, TemplateCreditExhaustStatus, TemplateItemButton, TemplateItemHeader, TemplateItemFooter };
|
|
3
|
+
export { TemplateLanguage, TemplateCreditExhaustStatus };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { UserPreferenceSchema } from '../../schema';
|
|
3
|
+
import { CollapseSidePanel } from '../../enum';
|
|
4
|
+
export default class UserPreference {
|
|
5
|
+
constructor() {
|
|
6
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
const validatedData = validateSchema({
|
|
8
|
+
schema: UserPreferenceSchema,
|
|
9
|
+
data,
|
|
10
|
+
entityName: 'UserPreference'
|
|
11
|
+
});
|
|
12
|
+
this.data = {
|
|
13
|
+
collapseSidePanel: validatedData.collapseSidePanel
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static isCollpseView(view) {
|
|
18
|
+
return view === CollapseSidePanel.ENABLED;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
toJSON() {
|
|
22
|
+
return { ...this.data
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -2,16 +2,6 @@ const CannedMessageStatus = {
|
|
|
2
2
|
APPROVED: 'APPROVED',
|
|
3
3
|
PENDING: 'PENDING',
|
|
4
4
|
REJECTED: 'REJECTED',
|
|
5
|
-
FAILED: 'FAILED'
|
|
6
|
-
DELETION_IN_PROGRESS: 'DELETION_IN_PROGRESS',
|
|
7
|
-
DELETION_FAILED: 'DELETION_FAILED',
|
|
8
|
-
PARTIALLY_APPROVED: 'PARTIALLY_APPROVED',
|
|
9
|
-
UNKNOWN: 'UNKNOWN',
|
|
10
|
-
IN_APPEAL: 'IN_APPEAL',
|
|
11
|
-
PENDING_DELETION: 'PENDING_DELETION',
|
|
12
|
-
DELETED: 'DELETED',
|
|
13
|
-
DISABLED: 'DISABLED',
|
|
14
|
-
PAUSED: 'PAUSED',
|
|
15
|
-
LIMIT_EXCEEDED: 'LIMIT_EXCEEDED'
|
|
5
|
+
FAILED: 'FAILED'
|
|
16
6
|
};
|
|
17
7
|
export default CannedMessageStatus;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
const TemplateItemButtonType = {
|
|
2
2
|
QUICK_REPLY: 'QUICK_REPLY',
|
|
3
3
|
URL: 'URL',
|
|
4
|
-
PHONE_NUMBER: 'PHONE_NUMBER'
|
|
5
|
-
OTP: 'OTP',
|
|
6
|
-
CATALOG: 'CATALOG',
|
|
7
|
-
MPM: 'MPM',
|
|
8
|
-
CALL_PERMISSION_REQUEST: 'CALL_PERMISSION_REQUEST',
|
|
9
|
-
VOICE_CALL: 'VOICE_CALL',
|
|
10
|
-
NONE: 'NONE'
|
|
4
|
+
PHONE_NUMBER: 'PHONE_NUMBER'
|
|
11
5
|
};
|
|
12
6
|
export default TemplateItemButtonType;
|
package/es/domain/enum/index.js
CHANGED