@zohoim/client-sdk 1.0.0-poc98 → 1.0.0-replyAreaPoc1
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/agents/AgentService.js +1 -1
- package/es/application/services/agents/index.js +1 -1
- package/es/application/services/bots/BotService.js +1 -1
- package/es/application/services/bots/index.js +1 -1
- package/es/application/services/cannedMessages/CannedMessageService.js +51 -0
- package/es/application/services/cannedMessages/index.js +2 -0
- package/es/application/services/channels/ChannelAgentService.js +1 -1
- package/es/application/services/channels/ChannelService.js +1 -1
- package/es/application/services/channels/index.js +2 -2
- package/es/application/services/contacts/ContactService.js +1 -1
- package/es/application/services/contacts/index.js +1 -1
- package/es/application/services/index.js +8 -6
- package/es/application/services/messages/MessageService.js +6 -1
- package/es/application/services/messages/index.js +1 -1
- package/es/application/services/sessions/SessionService.js +1 -1
- package/es/application/services/sessions/index.js +1 -1
- package/es/application/services/templateMessages/TemplateMessageService.js +26 -0
- package/es/application/services/templateMessages/index.js +2 -0
- package/es/core/constants/ModuleNames.js +4 -1
- package/es/core/constants/index.js +2 -2
- package/es/core/errors/index.js +2 -2
- package/es/core/utils/index.js +2 -2
- package/es/core/utils/validateSchema.js +1 -1
- package/es/domain/dto/agents/getAgentsRequest.js +1 -1
- package/es/domain/dto/agents/index.js +1 -1
- package/es/domain/dto/bots/getBotRequest.js +1 -1
- package/es/domain/dto/bots/getBotsRequest.js +1 -1
- package/es/domain/dto/bots/index.js +2 -2
- package/es/domain/dto/cannedMessages/createCannedMessageRequest.js +13 -0
- package/es/domain/dto/cannedMessages/deleteCannedMessageRequest.js +13 -0
- package/es/domain/dto/cannedMessages/disableCannedMessageRequest.js +13 -0
- package/es/domain/dto/cannedMessages/enableCannedMessageRequest.js +13 -0
- package/es/domain/dto/cannedMessages/getCannedMessageRequest.js +13 -0
- package/es/domain/dto/cannedMessages/getCannedMessagesRequest.js +18 -0
- package/es/domain/dto/cannedMessages/index.js +7 -0
- package/es/domain/dto/cannedMessages/updateCannedMessageRequest.js +13 -0
- package/es/domain/dto/channels/agents/getChannelAgentsRequest.js +1 -1
- package/es/domain/dto/channels/agents/index.js +1 -1
- package/es/domain/dto/channels/getChannelsRequest.js +1 -1
- package/es/domain/dto/channels/index.js +2 -2
- package/es/domain/dto/contacts/getContactsRequest.js +1 -1
- package/es/domain/dto/contacts/index.js +1 -1
- package/es/domain/dto/index.js +8 -6
- package/es/domain/dto/messages/deleteMessageRequest.js +1 -1
- package/es/domain/dto/messages/getFullContentRequest.js +1 -1
- package/es/domain/dto/messages/getMessageRequest.js +14 -0
- package/es/domain/dto/messages/getMessagesRequest.js +1 -1
- package/es/domain/dto/messages/index.js +9 -8
- package/es/domain/dto/messages/initiateSessionRequest.js +2 -1
- package/es/domain/dto/messages/resendMessageRequest.js +1 -1
- package/es/domain/dto/messages/searchMessagesRequest.js +1 -1
- package/es/domain/dto/messages/sendAttachmentRequest.js +1 -2
- package/es/domain/dto/messages/sendMessageRequest.js +3 -1
- package/es/domain/dto/sessions/getSessionAttachmentsRequest.js +1 -1
- package/es/domain/dto/sessions/getSessionLastMessagesRequest.js +1 -1
- package/es/domain/dto/sessions/getSessionRequest.js +1 -1
- package/es/domain/dto/sessions/getSessionsRequest.js +1 -1
- package/es/domain/dto/sessions/index.js +8 -8
- package/es/domain/dto/sessions/markSessionAsReadRequest.js +6 -2
- package/es/domain/dto/sessions/pickupSessionRequest.js +1 -1
- package/es/domain/dto/sessions/updateSessionAssigneeRequest.js +1 -1
- package/es/domain/dto/sessions/updateSessionStatusRequest.js +1 -1
- package/es/domain/dto/templateMessages/getTemplateCreditExhaustStatusRequest.js +11 -0
- package/es/domain/dto/templateMessages/getTemplateLanguagesRequest.js +7 -0
- package/es/domain/dto/templateMessages/index.js +2 -0
- package/es/domain/entities/Actor/Actor.js +7 -3
- package/es/domain/entities/Actor/index.js +1 -1
- package/es/domain/entities/Agent/Agent.js +2 -2
- package/es/domain/entities/Agent/index.js +1 -1
- package/es/domain/entities/Attachment/Attachment.js +2 -2
- package/es/domain/entities/Attachment/index.js +1 -1
- package/es/domain/entities/Bot/Bot.js +2 -2
- package/es/domain/entities/Bot/index.js +1 -1
- package/es/domain/entities/CannedMessage/CannedMessage.js +52 -0
- package/es/domain/entities/CannedMessage/index.js +2 -0
- package/es/domain/entities/Channel/Channel.js +2 -2
- package/es/domain/entities/Channel/index.js +1 -1
- package/es/domain/entities/Contact/Contact.js +2 -2
- package/es/domain/entities/Contact/index.js +1 -1
- package/es/domain/entities/CustomReplyExtension/CustomReplyExtension.js +22 -0
- package/es/domain/entities/CustomReplyExtension/index.js +2 -0
- package/es/domain/entities/IntegrationService/IntegrationService.js +3 -3
- package/es/domain/entities/IntegrationService/index.js +1 -1
- package/es/domain/entities/Message/Action.js +3 -3
- package/es/domain/entities/Message/ExternalInfo.js +11 -2
- package/es/domain/entities/Message/Info.js +10 -5
- package/es/domain/entities/Message/InfoTarget.js +2 -2
- package/es/domain/entities/Message/Location.js +2 -2
- package/es/domain/entities/Message/Message.js +69 -10
- package/es/domain/entities/Message/MessageWithSession.js +4 -4
- package/es/domain/entities/Message/index.js +7 -7
- package/es/domain/entities/Session/Session.js +26 -6
- package/es/domain/entities/Session/index.js +1 -1
- package/es/domain/entities/TemplateMessage/TemplateCreditExhaustStatus.js +24 -0
- package/es/domain/entities/TemplateMessage/TemplateLanguage.js +18 -0
- package/es/domain/entities/TemplateMessage/index.js +3 -0
- package/es/domain/entities/index.js +12 -9
- package/es/domain/enum/actor/ActorType.js +1 -1
- package/es/domain/enum/actor/index.js +1 -1
- package/es/domain/enum/attachment/index.js +1 -1
- package/es/domain/enum/bot/index.js +1 -1
- package/es/domain/enum/cannedMessage/CannedMessageStatus.js +6 -0
- package/es/domain/enum/cannedMessage/index.js +2 -0
- package/es/domain/enum/index.js +8 -6
- package/es/domain/enum/integrationServices/index.js +1 -1
- package/es/domain/enum/message/MessageDirection.js +2 -2
- package/es/domain/enum/message/MessageMeta.js +4 -0
- package/es/domain/enum/message/MetaSystemMessageType.js +8 -0
- package/es/domain/enum/message/index.js +13 -11
- package/es/domain/enum/session/index.js +2 -2
- package/es/domain/enum/templateMessage/TemplateCreditExhaustStatusCode.js +4 -0
- package/es/domain/enum/templateMessage/TemplateLanguage.js +74 -0
- package/es/domain/enum/templateMessage/index.js +3 -0
- package/es/domain/interfaces/index.js +2 -2
- package/es/domain/interfaces/repositories/agents/IAgentRepository.js +3 -3
- package/es/domain/interfaces/repositories/agents/index.js +1 -1
- package/es/domain/interfaces/repositories/bots/IBotRepository.js +3 -3
- package/es/domain/interfaces/repositories/bots/index.js +1 -1
- package/es/domain/interfaces/repositories/cannedMessages/ICannedMessageRepository.js +47 -0
- package/es/domain/interfaces/repositories/cannedMessages/index.js +2 -0
- package/es/domain/interfaces/repositories/channels/IChannelAgentRepository.js +3 -3
- package/es/domain/interfaces/repositories/channels/IChannelRepository.js +3 -3
- package/es/domain/interfaces/repositories/channels/index.js +2 -2
- package/es/domain/interfaces/repositories/contacts/IContactRepository.js +3 -3
- package/es/domain/interfaces/repositories/contacts/index.js +1 -1
- package/es/domain/interfaces/repositories/index.js +8 -6
- package/es/domain/interfaces/repositories/messages/IMessageRepository.js +8 -3
- package/es/domain/interfaces/repositories/messages/index.js +1 -1
- package/es/domain/interfaces/repositories/sessions/ISessionRepository.js +3 -3
- package/es/domain/interfaces/repositories/sessions/index.js +1 -1
- package/es/domain/interfaces/repositories/templateMessages/ITemplateMessageRepository.js +21 -0
- package/es/domain/interfaces/repositories/templateMessages/index.js +2 -0
- package/es/domain/schema/actor/ActorSchema.js +1 -1
- package/es/domain/schema/actor/AgentSchema.js +1 -1
- package/es/domain/schema/actor/index.js +2 -2
- package/es/domain/schema/attachment/AttachmentSchema.js +1 -1
- package/es/domain/schema/attachment/index.js +1 -1
- package/es/domain/schema/bot/BotSchema.js +1 -1
- package/es/domain/schema/bot/index.js +1 -1
- package/es/domain/schema/cannedMessage/CannedMessageSchema.js +54 -0
- package/es/domain/schema/cannedMessage/index.js +2 -0
- package/es/domain/schema/channel/ChannelSchema.js +1 -1
- package/es/domain/schema/channel/index.js +1 -1
- package/es/domain/schema/contact/index.js +1 -1
- package/es/domain/schema/customReplyExtension/CustomReplyExtensionSchema.js +28 -0
- package/es/domain/schema/customReplyExtension/index.js +2 -0
- package/es/domain/schema/index.js +11 -8
- package/es/domain/schema/integrationService/IntegrationServiceSchema.js +1 -1
- package/es/domain/schema/integrationService/index.js +1 -1
- package/es/domain/schema/message/ActionSchema.js +1 -1
- package/es/domain/schema/message/ExternalInfoSchema.js +1 -1
- package/es/domain/schema/message/InfoSchema.js +2 -2
- package/es/domain/schema/message/InfoTargetSchema.js +1 -1
- package/es/domain/schema/message/MessageSchema.js +11 -7
- package/es/domain/schema/message/MessageWithSessionSchema.js +2 -2
- package/es/domain/schema/message/index.js +7 -7
- package/es/domain/schema/session/SessionSchema.js +2 -2
- package/es/domain/schema/session/index.js +1 -1
- package/es/domain/schema/templateMessage/TemplateCreditExhaustStatusSchema.js +13 -0
- package/es/domain/schema/templateMessage/TemplateLanguageSchema.js +13 -0
- package/es/domain/schema/templateMessage/index.js +3 -0
- package/es/frameworks/managers/ModuleFactory.js +25 -7
- package/es/frameworks/managers/ModuleManager.js +3 -3
- package/es/frameworks/managers/index.js +1 -1
- package/es/frameworks/sdk/IMSDK.js +13 -3
- package/es/frameworks/sdk/agents/AgentSDK.js +2 -2
- package/es/frameworks/sdk/agents/index.js +1 -1
- package/es/frameworks/sdk/bots/BotSDK.js +2 -2
- package/es/frameworks/sdk/bots/index.js +1 -1
- package/es/frameworks/sdk/cannedMessages/CannedMessageSDK.js +30 -0
- package/es/frameworks/sdk/cannedMessages/index.js +2 -0
- package/es/frameworks/sdk/channels/ChannelSDK.js +2 -2
- package/es/frameworks/sdk/channels/index.js +1 -1
- package/es/frameworks/sdk/contacts/ContactSDK.js +2 -2
- package/es/frameworks/sdk/contacts/index.js +1 -1
- package/es/frameworks/sdk/index.js +1 -1
- package/es/frameworks/sdk/messages/MessageSDK.js +2 -2
- package/es/frameworks/sdk/messages/index.js +1 -1
- package/es/frameworks/sdk/sessions/SessionSDK.js +2 -2
- package/es/frameworks/sdk/sessions/index.js +1 -1
- package/es/frameworks/sdk/templateMessages/TemplateMessageSDK.js +30 -0
- package/es/frameworks/sdk/templateMessages/index.js +2 -0
- package/es/index.js +8 -8
- package/es/infrastructure/adapters/agents/AgentAdapter.js +4 -4
- package/es/infrastructure/adapters/agents/index.js +1 -1
- package/es/infrastructure/adapters/attachments/AttachmentAdapter.js +3 -3
- package/es/infrastructure/adapters/attachments/index.js +1 -1
- package/es/infrastructure/adapters/bots/BotAdapter.js +3 -3
- package/es/infrastructure/adapters/bots/index.js +1 -1
- package/es/infrastructure/adapters/cannedMessages/CannedMessageAdapter.js +28 -0
- package/es/infrastructure/adapters/cannedMessages/index.js +2 -0
- package/es/infrastructure/adapters/channels/ChannelAdapter.js +3 -3
- package/es/infrastructure/adapters/channels/ChannelAgentAdapter.js +3 -3
- package/es/infrastructure/adapters/channels/index.js +2 -2
- package/es/infrastructure/adapters/contacts/ContactAdapter.js +3 -3
- package/es/infrastructure/adapters/contacts/index.js +1 -1
- package/es/infrastructure/adapters/customReplyExtension/CustomReplyExtensionAdapter.js +24 -0
- package/es/infrastructure/adapters/customReplyExtension/index.js +2 -0
- package/es/infrastructure/adapters/index.js +10 -7
- package/es/infrastructure/adapters/messages/MessageAdapter.js +3 -3
- package/es/infrastructure/adapters/messages/MessageWithSessionAdapter.js +4 -4
- package/es/infrastructure/adapters/messages/index.js +1 -1
- package/es/infrastructure/adapters/sessions/SessionAdapter.js +3 -3
- package/es/infrastructure/adapters/sessions/index.js +1 -1
- package/es/infrastructure/adapters/templateMessages/TemplateCreditExhaustStatusAdapter.js +21 -0
- package/es/infrastructure/adapters/templateMessages/TemplateLanguageAdapter.js +20 -0
- package/es/infrastructure/adapters/templateMessages/index.js +3 -0
- package/es/infrastructure/api/BaseAPI.js +13 -60
- package/es/infrastructure/api/UrlBuilder.js +53 -0
- package/es/infrastructure/api/agents/AgentAPI.js +2 -2
- package/es/infrastructure/api/agents/index.js +1 -1
- package/es/infrastructure/api/bots/BotAPI.js +2 -2
- package/es/infrastructure/api/bots/index.js +1 -1
- package/es/infrastructure/api/cannedMessages/CannedMessageAPI.js +74 -0
- package/es/infrastructure/api/cannedMessages/index.js +2 -0
- package/es/infrastructure/api/channels/ChannelAPI.js +2 -2
- package/es/infrastructure/api/channels/ChannelAgentAPI.js +2 -2
- package/es/infrastructure/api/channels/index.js +2 -2
- package/es/infrastructure/api/contacts/ContactAPI.js +2 -2
- package/es/infrastructure/api/contacts/index.js +1 -1
- package/es/infrastructure/api/index.js +8 -6
- package/es/infrastructure/api/messages/MessageAPI.js +12 -2
- package/es/infrastructure/api/messages/index.js +1 -1
- package/es/infrastructure/api/registry/agents/agentAPIRegistry.js +4 -4
- package/es/infrastructure/api/registry/agents/constructAgentEndPoint.js +1 -1
- package/es/infrastructure/api/registry/agents/index.js +1 -1
- package/es/infrastructure/api/registry/bots/botAPIRegistry.js +4 -4
- package/es/infrastructure/api/registry/bots/constructBotEndPoint.js +1 -1
- package/es/infrastructure/api/registry/bots/index.js +1 -1
- package/es/infrastructure/api/registry/cannedMessages/cannedMessageAPIRegistry.js +48 -0
- package/es/infrastructure/api/registry/cannedMessages/constructCannedMessageEndPoint.js +10 -0
- package/es/infrastructure/api/registry/cannedMessages/index.js +2 -0
- package/es/infrastructure/api/registry/channels/channelAPIRegistry.js +5 -5
- package/es/infrastructure/api/registry/channels/channelAgentAPIRegistry.js +4 -4
- package/es/infrastructure/api/registry/channels/constructChannelEndPoint.js +1 -1
- package/es/infrastructure/api/registry/channels/index.js +1 -1
- package/es/infrastructure/api/registry/contacts/constructContactEndPoint.js +1 -1
- package/es/infrastructure/api/registry/contacts/contactAPIRegistry.js +4 -4
- package/es/infrastructure/api/registry/contacts/index.js +1 -1
- package/es/infrastructure/api/registry/getRegistryConfig.js +10 -8
- package/es/infrastructure/api/registry/index.js +1 -1
- package/es/infrastructure/api/registry/messages/constructMessageEndPoint.js +1 -1
- package/es/infrastructure/api/registry/messages/index.js +1 -1
- package/es/infrastructure/api/registry/messages/messageAPIRegistry.js +11 -6
- package/es/infrastructure/api/registry/sessions/constructSessionEndPoint.js +1 -1
- package/es/infrastructure/api/registry/sessions/index.js +1 -1
- package/es/infrastructure/api/registry/sessions/sessionAPIRegistry.js +5 -5
- package/es/infrastructure/api/sessions/SessionAPI.js +2 -2
- package/es/infrastructure/api/sessions/index.js +1 -1
- package/es/infrastructure/api/templateMessages/TemplateMessageAPI.js +24 -0
- package/es/infrastructure/api/templateMessages/index.js +2 -0
- package/es/infrastructure/config/index.js +1 -1
- package/es/infrastructure/repositories/agents/AgentRepository.js +4 -4
- package/es/infrastructure/repositories/agents/index.js +1 -1
- package/es/infrastructure/repositories/bots/BotRepository.js +4 -4
- package/es/infrastructure/repositories/bots/index.js +1 -1
- package/es/infrastructure/repositories/cannedMessages/CannedMessageRepository.js +97 -0
- package/es/infrastructure/repositories/cannedMessages/index.js +2 -0
- package/es/infrastructure/repositories/channels/ChannelAgentRepository.js +4 -4
- package/es/infrastructure/repositories/channels/ChannelRepository.js +4 -4
- package/es/infrastructure/repositories/channels/index.js +2 -2
- package/es/infrastructure/repositories/contacts/ContactRepository.js +4 -4
- package/es/infrastructure/repositories/contacts/index.js +1 -1
- package/es/infrastructure/repositories/index.js +8 -6
- package/es/infrastructure/repositories/messages/MessageRepository.js +13 -5
- package/es/infrastructure/repositories/messages/index.js +1 -1
- package/es/infrastructure/repositories/sessions/SessionRepository.js +4 -4
- package/es/infrastructure/repositories/sessions/index.js +1 -1
- package/es/infrastructure/repositories/templateMessages/TemplateMessageRepository.js +77 -0
- package/es/infrastructure/repositories/templateMessages/index.js +2 -0
- package/package.json +7 -8
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AdapterError } from '../../../core/errors';
|
|
2
|
+
import { TemplateCreditExhaustStatus } from '../../../domain/entities';
|
|
3
|
+
import { IAdapter } from '../../../domain/interfaces';
|
|
4
|
+
export default class TemplateCreditExhaustStatusAdapter extends IAdapter {
|
|
5
|
+
adapt(templateCreditExhaustStatusData) {
|
|
6
|
+
if (!templateCreditExhaustStatusData) {
|
|
7
|
+
throw new AdapterError('Template Credit Exhaust Status data is required');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
return new TemplateCreditExhaustStatus({
|
|
12
|
+
code: templateCreditExhaustStatusData.code,
|
|
13
|
+
error: templateCreditExhaustStatusData.error,
|
|
14
|
+
message: templateCreditExhaustStatusData.message
|
|
15
|
+
}).toJSON();
|
|
16
|
+
} catch (error) {
|
|
17
|
+
throw new AdapterError(`Failed to adapt Template Credit Exhaust Status: ${error.message}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AdapterError } from '../../../core/errors';
|
|
2
|
+
import { TemplateLanguage } from '../../../domain/entities';
|
|
3
|
+
import { IAdapter } from '../../../domain/interfaces';
|
|
4
|
+
export default class TemplateLanguageAdapter extends IAdapter {
|
|
5
|
+
adapt(templateLanguageData) {
|
|
6
|
+
if (!templateLanguageData) {
|
|
7
|
+
throw new AdapterError('templateLanguage data is required');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
return new TemplateLanguage({
|
|
12
|
+
code: templateLanguageData.code,
|
|
13
|
+
language: templateLanguageData.language
|
|
14
|
+
}).toJSON();
|
|
15
|
+
} catch (error) {
|
|
16
|
+
throw new AdapterError(`Failed to adapt TemplateLanguage: ${error.message}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ResponseTypes } from
|
|
2
|
-
import { ResponseUtils } from
|
|
3
|
-
import configRegistry from
|
|
4
|
-
import { getRegistryConfig } from
|
|
1
|
+
import { ResponseTypes } from '../../core/constants';
|
|
2
|
+
import { ResponseUtils } from '../../core/utils';
|
|
3
|
+
import configRegistry from '../config/configRegistry';
|
|
4
|
+
import { getRegistryConfig } from './registry';
|
|
5
|
+
import UrlBuilder from './UrlBuilder';
|
|
5
6
|
export default class BaseAPI {
|
|
6
7
|
constructor() {
|
|
7
8
|
let {
|
|
@@ -9,78 +10,30 @@ export default class BaseAPI {
|
|
|
9
10
|
configProvider = configRegistry,
|
|
10
11
|
registryProvider = {
|
|
11
12
|
getRegistryConfig
|
|
12
|
-
}
|
|
13
|
+
},
|
|
14
|
+
urlBuilder = new UrlBuilder()
|
|
13
15
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
14
16
|
this.configProvider = configProvider;
|
|
15
17
|
this.registryProvider = registryProvider;
|
|
16
18
|
this.httpClient = this.configProvider.getHttpClient();
|
|
17
19
|
this.baseURL = this.configProvider.getBaseURL();
|
|
18
20
|
this.module = module;
|
|
21
|
+
this.urlBuilder = urlBuilder;
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
let _url = url;
|
|
23
|
-
Object.entries(params).forEach(_ref => {
|
|
24
|
-
let [key, value] = _ref;
|
|
25
|
-
_url = url.replace(`:${key}`, value);
|
|
26
|
-
});
|
|
27
|
-
return _url;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
buildUrl(_ref2) {
|
|
31
|
-
let {
|
|
32
|
-
url,
|
|
33
|
-
params,
|
|
34
|
-
query
|
|
35
|
-
} = _ref2;
|
|
36
|
-
|
|
37
|
-
const _params = params || {};
|
|
38
|
-
|
|
39
|
-
const _query = query || {};
|
|
40
|
-
|
|
41
|
-
let _url = this.replacePathParams(url, _params);
|
|
42
|
-
|
|
43
|
-
if (this.baseURL) {
|
|
44
|
-
_url = `${this.baseURL}${_url}`;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const queryString = this.buildQuery(_query);
|
|
48
|
-
|
|
49
|
-
if (queryString) {
|
|
50
|
-
return `${_url}?${queryString}`;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return _url;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
buildQuery(query) {
|
|
57
|
-
const filteredQuery = Object.entries(query).filter(_ref3 => {
|
|
58
|
-
let [, value] = _ref3;
|
|
59
|
-
return value !== undefined && value !== null && value !== '';
|
|
60
|
-
}).reduce((acc, _ref4) => {
|
|
61
|
-
let [key, value] = _ref4;
|
|
62
|
-
acc[key] = value;
|
|
63
|
-
return acc;
|
|
64
|
-
}, {});
|
|
65
|
-
return Object.entries(filteredQuery).map(_ref5 => {
|
|
66
|
-
let [key, value] = _ref5;
|
|
67
|
-
return `${key}=${value}`;
|
|
68
|
-
}).join('&');
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async request(_ref6) {
|
|
24
|
+
async request(_ref) {
|
|
72
25
|
let {
|
|
73
26
|
request,
|
|
74
27
|
operation,
|
|
75
28
|
header
|
|
76
|
-
} =
|
|
29
|
+
} = _ref;
|
|
77
30
|
const config = this.registryProvider.getRegistryConfig(this.module, operation);
|
|
78
31
|
|
|
79
32
|
if (!config) {
|
|
80
33
|
throw new Error(`Operation "${operation}" not found in registry for module "${this.module}"`);
|
|
81
34
|
}
|
|
82
35
|
|
|
83
|
-
const url = this.buildUrl({
|
|
36
|
+
const url = this.urlBuilder.buildUrl({
|
|
84
37
|
url: config.endpoint,
|
|
85
38
|
params: request.params || {},
|
|
86
39
|
query: request.query || {}
|
|
@@ -125,7 +78,7 @@ export default class BaseAPI {
|
|
|
125
78
|
Object.prototype.hasOwnProperty.call(customPrototype, methodName);
|
|
126
79
|
}
|
|
127
80
|
|
|
128
|
-
async executeAPICall(
|
|
81
|
+
async executeAPICall(_ref2) {
|
|
129
82
|
let {
|
|
130
83
|
operation,
|
|
131
84
|
request,
|
|
@@ -133,7 +86,7 @@ export default class BaseAPI {
|
|
|
133
86
|
customAPI,
|
|
134
87
|
adapter,
|
|
135
88
|
responseType = ResponseTypes.SINGLE
|
|
136
|
-
} =
|
|
89
|
+
} = _ref2;
|
|
137
90
|
const response = await apiProxy[operation](request);
|
|
138
91
|
const isOverridden = this.isMethodOverridden(customAPI, operation);
|
|
139
92
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export default class UrlBuilder {
|
|
2
|
+
constructor(baseURL) {
|
|
3
|
+
this.baseURL = baseURL;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
replacePathParams(url, params) {
|
|
7
|
+
let processedUrl = url;
|
|
8
|
+
Object.entries(params).forEach(_ref => {
|
|
9
|
+
let [key, value] = _ref;
|
|
10
|
+
processedUrl = processedUrl.replace(`:${key}`, value);
|
|
11
|
+
});
|
|
12
|
+
return processedUrl;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
buildUrl(_ref2) {
|
|
16
|
+
let {
|
|
17
|
+
url,
|
|
18
|
+
params,
|
|
19
|
+
query
|
|
20
|
+
} = _ref2;
|
|
21
|
+
const paramsObj = params || {};
|
|
22
|
+
const queryObj = query || {};
|
|
23
|
+
let processedUrl = this.replacePathParams(url, paramsObj);
|
|
24
|
+
|
|
25
|
+
if (this.baseURL) {
|
|
26
|
+
processedUrl = `${this.baseURL}${processedUrl}`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const queryString = this.buildQuery(queryObj);
|
|
30
|
+
|
|
31
|
+
if (queryString) {
|
|
32
|
+
return `${processedUrl}?${queryString}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return processedUrl;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
buildQuery(query) {
|
|
39
|
+
const filteredQuery = Object.entries(query).filter(_ref3 => {
|
|
40
|
+
let [, value] = _ref3;
|
|
41
|
+
return value !== undefined && value !== null && value !== '';
|
|
42
|
+
}).reduce((acc, _ref4) => {
|
|
43
|
+
let [key, value] = _ref4;
|
|
44
|
+
acc[key] = value;
|
|
45
|
+
return acc;
|
|
46
|
+
}, {});
|
|
47
|
+
return Object.entries(filteredQuery).map(_ref5 => {
|
|
48
|
+
let [key, value] = _ref5;
|
|
49
|
+
return `${key}=${value}`;
|
|
50
|
+
}).join('&');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getAgentsRequest } from
|
|
2
|
-
import { IAgentRepository } from
|
|
1
|
+
import { getAgentsRequest } from '../../../domain/dto';
|
|
2
|
+
import { IAgentRepository } from '../../../domain/interfaces/repositories';
|
|
3
3
|
export default class AgentAPI extends IAgentRepository {
|
|
4
4
|
async getAgents() {
|
|
5
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getAgentsRequest();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import AgentAPI from
|
|
1
|
+
import AgentAPI from './AgentAPI';
|
|
2
2
|
export { AgentAPI };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getBotsRequest, getBotRequest } from
|
|
2
|
-
import { IBotRepository } from
|
|
1
|
+
import { getBotsRequest, getBotRequest } from '../../../domain/dto';
|
|
2
|
+
import { IBotRepository } from '../../../domain/interfaces/repositories';
|
|
3
3
|
export default class BotAPI extends IBotRepository {
|
|
4
4
|
async getBots() {
|
|
5
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getBotsRequest();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import BotAPI from
|
|
1
|
+
import BotAPI from './BotAPI';
|
|
2
2
|
export { BotAPI };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { getCannedMessageRequest, getCannedMessagesRequest, createCannedMessageRequest, updateCannedMessageRequest, deleteCannedMessageRequest, enableCannedMessageRequest, disableCannedMessageRequest } from '../../../domain/dto';
|
|
2
|
+
import { ICannedMessageRepository } from '../../../domain/interfaces/repositories';
|
|
3
|
+
export default class CannedMessageAPI extends ICannedMessageRepository {
|
|
4
|
+
async getCannedMessages() {
|
|
5
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getCannedMessagesRequest();
|
|
6
|
+
const operation = 'getCannedMessages';
|
|
7
|
+
const httpRequest = await this.request({
|
|
8
|
+
operation,
|
|
9
|
+
request
|
|
10
|
+
});
|
|
11
|
+
return httpRequest;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async getCannedMessage() {
|
|
15
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getCannedMessageRequest();
|
|
16
|
+
const operation = 'getCannedMessage';
|
|
17
|
+
const httpRequest = await this.request({
|
|
18
|
+
operation,
|
|
19
|
+
request
|
|
20
|
+
});
|
|
21
|
+
return httpRequest;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async createCannedMessage() {
|
|
25
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : createCannedMessageRequest();
|
|
26
|
+
const operation = 'createCannedMessage';
|
|
27
|
+
const httpRequest = await this.request({
|
|
28
|
+
operation,
|
|
29
|
+
request
|
|
30
|
+
});
|
|
31
|
+
return httpRequest;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async updateCannedMessage() {
|
|
35
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : updateCannedMessageRequest();
|
|
36
|
+
const operation = 'updateCannedMessage';
|
|
37
|
+
const httpRequest = await this.request({
|
|
38
|
+
operation,
|
|
39
|
+
request
|
|
40
|
+
});
|
|
41
|
+
return httpRequest;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async deleteCannedMessage() {
|
|
45
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : deleteCannedMessageRequest();
|
|
46
|
+
const operation = 'deleteCannedMessage';
|
|
47
|
+
const httpRequest = await this.request({
|
|
48
|
+
operation,
|
|
49
|
+
request
|
|
50
|
+
});
|
|
51
|
+
return httpRequest;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async enableCannedMessage() {
|
|
55
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : enableCannedMessageRequest();
|
|
56
|
+
const operation = 'enableCannedMessage';
|
|
57
|
+
const httpRequest = await this.request({
|
|
58
|
+
operation,
|
|
59
|
+
request
|
|
60
|
+
});
|
|
61
|
+
return httpRequest;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async disableCannedMessage() {
|
|
65
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : disableCannedMessageRequest();
|
|
66
|
+
const operation = 'disableCannedMessage';
|
|
67
|
+
const httpRequest = await this.request({
|
|
68
|
+
operation,
|
|
69
|
+
request
|
|
70
|
+
});
|
|
71
|
+
return httpRequest;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getChannelsRequest } from
|
|
2
|
-
import { IChannelRepository } from
|
|
1
|
+
import { getChannelsRequest } from '../../../domain/dto';
|
|
2
|
+
import { IChannelRepository } from '../../../domain/interfaces/repositories';
|
|
3
3
|
export default class ChannelAPI extends IChannelRepository {
|
|
4
4
|
async getChannels() {
|
|
5
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getChannelsRequest();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getChannelAgentsRequest } from
|
|
2
|
-
import { IChannelAgentRepository } from
|
|
1
|
+
import { getChannelAgentsRequest } from '../../../domain/dto';
|
|
2
|
+
import { IChannelAgentRepository } from '../../../domain/interfaces/repositories';
|
|
3
3
|
export default class ChannelAgentAPI extends IChannelAgentRepository {
|
|
4
4
|
async getAgents() {
|
|
5
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getChannelAgentsRequest();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import ChannelAgentAPI from
|
|
2
|
-
import ChannelAPI from
|
|
1
|
+
import ChannelAgentAPI from './ChannelAgentAPI';
|
|
2
|
+
import ChannelAPI from './ChannelAPI';
|
|
3
3
|
export { ChannelAgentAPI, ChannelAPI };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getContactsRequest } from
|
|
2
|
-
import { IContactRepository } from
|
|
1
|
+
import { getContactsRequest } from '../../../domain/dto';
|
|
2
|
+
import { IContactRepository } from '../../../domain/interfaces/repositories';
|
|
3
3
|
export default class ContactAPI extends IContactRepository {
|
|
4
4
|
async getContacts() {
|
|
5
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getContactsRequest();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import ContactAPI from
|
|
1
|
+
import ContactAPI from './ContactAPI';
|
|
2
2
|
export { ContactAPI };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
1
|
+
export * from './channels';
|
|
2
|
+
export * from './sessions';
|
|
3
|
+
export * from './bots';
|
|
4
|
+
export * from './messages';
|
|
5
|
+
export * from './agents';
|
|
6
|
+
export * from './contacts';
|
|
7
|
+
export * from './cannedMessages';
|
|
8
|
+
export * from './templateMessages';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getMessagesRequest, deleteMessageRequest, getFullContentRequest, resendMessageRequest, sendAttachmentRequest, sendMessageRequest, initiateSessionRequest, searchMessagesRequest } from
|
|
2
|
-
import { IMessageRepository } from
|
|
1
|
+
import { getMessagesRequest, deleteMessageRequest, getFullContentRequest, resendMessageRequest, sendAttachmentRequest, sendMessageRequest, initiateSessionRequest, searchMessagesRequest, getMessageRequest } from '../../../domain/dto';
|
|
2
|
+
import { IMessageRepository } from '../../../domain/interfaces/repositories';
|
|
3
3
|
export default class MessageAPI extends IMessageRepository {
|
|
4
4
|
async getMessages() {
|
|
5
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getMessagesRequest();
|
|
@@ -11,6 +11,16 @@ export default class MessageAPI extends IMessageRepository {
|
|
|
11
11
|
return httpRequest;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
async getMessage() {
|
|
15
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getMessageRequest();
|
|
16
|
+
const operation = 'getMessage';
|
|
17
|
+
const httpRequest = await this.request({
|
|
18
|
+
operation,
|
|
19
|
+
request
|
|
20
|
+
});
|
|
21
|
+
return httpRequest;
|
|
22
|
+
}
|
|
23
|
+
|
|
14
24
|
async getFullContent() {
|
|
15
25
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getFullContentRequest();
|
|
16
26
|
const operation = 'getFullContent';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import MessageAPI from
|
|
1
|
+
import MessageAPI from './MessageAPI';
|
|
2
2
|
export { MessageAPI };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { HTTP_METHODS } from
|
|
2
|
-
import { getAgentsRequest } from
|
|
3
|
-
import createAPIRegistry from
|
|
4
|
-
import constructAgentEndPoint from
|
|
1
|
+
import { HTTP_METHODS } from '../../../../core/constants';
|
|
2
|
+
import { getAgentsRequest } from '../../../../domain/dto';
|
|
3
|
+
import createAPIRegistry from '../createAPIRegistry';
|
|
4
|
+
import constructAgentEndPoint from './constructAgentEndPoint';
|
|
5
5
|
|
|
6
6
|
function getAgents() {
|
|
7
7
|
return createAPIRegistry(constructAgentEndPoint(), HTTP_METHODS.GET, getAgentsRequest());
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import agentAPIRegistry from
|
|
1
|
+
import agentAPIRegistry from './agentAPIRegistry';
|
|
2
2
|
export { agentAPIRegistry };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { HTTP_METHODS } from
|
|
2
|
-
import { getBotsRequest, getBotRequest } from
|
|
3
|
-
import createAPIRegistry from
|
|
4
|
-
import constructBotEndPoint from
|
|
1
|
+
import { HTTP_METHODS } from '../../../../core/constants';
|
|
2
|
+
import { getBotsRequest, getBotRequest } from '../../../../domain/dto';
|
|
3
|
+
import createAPIRegistry from '../createAPIRegistry';
|
|
4
|
+
import constructBotEndPoint from './constructBotEndPoint';
|
|
5
5
|
|
|
6
6
|
function getBots() {
|
|
7
7
|
return createAPIRegistry(constructBotEndPoint(), HTTP_METHODS.GET, getBotsRequest());
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import botAPIRegistry from
|
|
1
|
+
import botAPIRegistry from './botAPIRegistry';
|
|
2
2
|
export { botAPIRegistry };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { HTTP_METHODS } from '../../../../core/constants';
|
|
2
|
+
import { getCannedMessageRequest, getCannedMessagesRequest, createCannedMessageRequest, updateCannedMessageRequest, deleteCannedMessageRequest, enableCannedMessageRequest, disableCannedMessageRequest } from '../../../../domain/dto';
|
|
3
|
+
import constructCannedMessageEndPoint from './constructCannedMessageEndPoint';
|
|
4
|
+
import createAPIRegistry from '../createAPIRegistry';
|
|
5
|
+
const SINGLE_SESSION_URL = '/:sessionId';
|
|
6
|
+
const MESSAGES_URL = `${SINGLE_SESSION_URL}/messages`;
|
|
7
|
+
const SINGLE_MESSAGE_URL = `${MESSAGES_URL}/:messageId`;
|
|
8
|
+
const FULL_CONTENT_URL = `${SINGLE_MESSAGE_URL}/fullContent`;
|
|
9
|
+
const RESEND_MESSAGE_URL = `${SINGLE_MESSAGE_URL}/resend`;
|
|
10
|
+
const ATTACHMENTS_URL = `${SINGLE_SESSION_URL}/attachments`;
|
|
11
|
+
|
|
12
|
+
function getCannedMessages() {
|
|
13
|
+
return createAPIRegistry(constructCannedMessageEndPoint(MESSAGES_URL), HTTP_METHODS.GET, getCannedMessagesRequest());
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function getCannedMessage() {
|
|
17
|
+
return createAPIRegistry(constructCannedMessageEndPoint(SINGLE_MESSAGE_URL), HTTP_METHODS.GET, getCannedMessageRequest());
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function createCannedMessage() {
|
|
21
|
+
return createAPIRegistry(constructCannedMessageEndPoint(FULL_CONTENT_URL), HTTP_METHODS.POST, createCannedMessageRequest());
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function updateCannedMessage() {
|
|
25
|
+
return createAPIRegistry(constructCannedMessageEndPoint(MESSAGES_URL), HTTP_METHODS.PATCH, updateCannedMessageRequest());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function enableCannedMessage() {
|
|
29
|
+
return createAPIRegistry(constructCannedMessageEndPoint(ATTACHMENTS_URL), HTTP_METHODS.PATCH, enableCannedMessageRequest());
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function disableCannedMessage() {
|
|
33
|
+
return createAPIRegistry(constructCannedMessageEndPoint(RESEND_MESSAGE_URL), HTTP_METHODS.PATCH, disableCannedMessageRequest());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function deleteCannedMessage() {
|
|
37
|
+
return createAPIRegistry(constructCannedMessageEndPoint(SINGLE_MESSAGE_URL), HTTP_METHODS.DELETE, deleteCannedMessageRequest());
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
getCannedMessage,
|
|
42
|
+
getCannedMessages,
|
|
43
|
+
createCannedMessage,
|
|
44
|
+
updateCannedMessage,
|
|
45
|
+
deleteCannedMessage,
|
|
46
|
+
enableCannedMessage,
|
|
47
|
+
disableCannedMessage
|
|
48
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { HTTP_METHODS } from
|
|
2
|
-
import { getChannelsRequest } from
|
|
3
|
-
import createAPIRegistry from
|
|
4
|
-
import channelAgentAPIRegistry from
|
|
5
|
-
import constructChannelEndPoint from
|
|
1
|
+
import { HTTP_METHODS } from '../../../../core/constants';
|
|
2
|
+
import { getChannelsRequest } from '../../../../domain/dto';
|
|
3
|
+
import createAPIRegistry from '../createAPIRegistry';
|
|
4
|
+
import channelAgentAPIRegistry from './channelAgentAPIRegistry';
|
|
5
|
+
import constructChannelEndPoint from './constructChannelEndPoint';
|
|
6
6
|
|
|
7
7
|
function getChannels() {
|
|
8
8
|
return createAPIRegistry(constructChannelEndPoint(), HTTP_METHODS.GET, getChannelsRequest());
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { HTTP_METHODS } from
|
|
2
|
-
import { getChannelAgentsRequest } from
|
|
3
|
-
import createAPIRegistry from
|
|
4
|
-
import constructChannelEndPoint from
|
|
1
|
+
import { HTTP_METHODS } from '../../../../core/constants';
|
|
2
|
+
import { getChannelAgentsRequest } from '../../../../domain/dto';
|
|
3
|
+
import createAPIRegistry from '../createAPIRegistry';
|
|
4
|
+
import constructChannelEndPoint from './constructChannelEndPoint';
|
|
5
5
|
|
|
6
6
|
function getAgents() {
|
|
7
7
|
return createAPIRegistry(constructChannelEndPoint('/:channelId/agents'), HTTP_METHODS.GET, getChannelAgentsRequest());
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import channelAPIRegistry from
|
|
1
|
+
import channelAPIRegistry from './channelAPIRegistry';
|
|
2
2
|
export { channelAPIRegistry };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { HTTP_METHODS } from
|
|
2
|
-
import { getContactsRequest } from
|
|
3
|
-
import createAPIRegistry from
|
|
4
|
-
import constructContactEndPoint from
|
|
1
|
+
import { HTTP_METHODS } from '../../../../core/constants';
|
|
2
|
+
import { getContactsRequest } from '../../../../domain/dto';
|
|
3
|
+
import createAPIRegistry from '../createAPIRegistry';
|
|
4
|
+
import constructContactEndPoint from './constructContactEndPoint';
|
|
5
5
|
|
|
6
6
|
function getContacts() {
|
|
7
7
|
return createAPIRegistry(constructContactEndPoint(), HTTP_METHODS.GET, getContactsRequest());
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import contactAPIRegistry from
|
|
1
|
+
import contactAPIRegistry from './contactAPIRegistry';
|
|
2
2
|
export { contactAPIRegistry };
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import selectn from 'selectn';
|
|
2
|
-
import { channelAPIRegistry } from
|
|
3
|
-
import { sessionAPIRegistry } from
|
|
4
|
-
import { botAPIRegistry } from
|
|
5
|
-
import { messageAPIRegistry } from
|
|
6
|
-
import { agentAPIRegistry } from
|
|
7
|
-
import { contactAPIRegistry } from
|
|
8
|
-
import {
|
|
2
|
+
import { channelAPIRegistry } from './channels';
|
|
3
|
+
import { sessionAPIRegistry } from './sessions';
|
|
4
|
+
import { botAPIRegistry } from './bots';
|
|
5
|
+
import { messageAPIRegistry } from './messages';
|
|
6
|
+
import { agentAPIRegistry } from './agents';
|
|
7
|
+
import { contactAPIRegistry } from './contacts';
|
|
8
|
+
import { cannedMessageAPIRegistry } from './cannedMessages';
|
|
9
|
+
import { ModuleNames } from '../../../core/constants';
|
|
9
10
|
const APIRegistry = {
|
|
10
11
|
[ModuleNames.CHANNELS]: channelAPIRegistry,
|
|
11
12
|
[ModuleNames.SESSIONS]: sessionAPIRegistry,
|
|
12
13
|
[ModuleNames.BOTS]: botAPIRegistry,
|
|
13
14
|
[ModuleNames.MESSAGES]: messageAPIRegistry,
|
|
14
15
|
[ModuleNames.AGENTS]: agentAPIRegistry,
|
|
15
|
-
[ModuleNames.CONTACTS]: contactAPIRegistry
|
|
16
|
+
[ModuleNames.CONTACTS]: contactAPIRegistry,
|
|
17
|
+
[ModuleNames.CANNED_MESSAGES]: cannedMessageAPIRegistry
|
|
16
18
|
};
|
|
17
19
|
export default function getRegistryConfig(module, operation) {
|
|
18
20
|
const moduleConfig = selectn(module, APIRegistry);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import getRegistryConfig from
|
|
1
|
+
import getRegistryConfig from './getRegistryConfig';
|
|
2
2
|
export { getRegistryConfig };
|