@zohoim/client-sdk 0.0.4 → 0.0.5
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/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 +6 -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/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/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 +6 -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/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/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/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/index.js +9 -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/index.js +6 -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/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/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 +6 -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/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/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/index.js +8 -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/frameworks/managers/ModuleFactory.js +7 -7
- package/es/frameworks/managers/ModuleManager.js +2 -2
- package/es/frameworks/managers/index.js +1 -1
- package/es/frameworks/sdk/IMSDK.js +3 -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/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/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/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/index.js +7 -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/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/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 +6 -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/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 +7 -7
- 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/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/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 +6 -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/package.json +7 -8
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import AgentService from
|
|
1
|
+
import AgentService from './AgentService';
|
|
2
2
|
export { AgentService };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import BotService from
|
|
1
|
+
import BotService from './BotService';
|
|
2
2
|
export { BotService };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IChannelAgentRepository } from
|
|
1
|
+
import { IChannelAgentRepository } from '../../../domain/interfaces/repositories';
|
|
2
2
|
export default class ChannelAgentService extends IChannelAgentRepository {
|
|
3
3
|
constructor(_ref) {
|
|
4
4
|
let {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import ChannelAgentService from
|
|
2
|
-
import ChannelService from
|
|
1
|
+
import ChannelAgentService from './ChannelAgentService';
|
|
2
|
+
import ChannelService from './ChannelService';
|
|
3
3
|
export { ChannelService, ChannelAgentService };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import ContactService from
|
|
1
|
+
import ContactService from './ContactService';
|
|
2
2
|
export { ContactService };
|
|
@@ -1,6 +1,6 @@
|
|
|
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';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IMessageRepository } from
|
|
1
|
+
import { IMessageRepository } from '../../../domain/interfaces/repositories';
|
|
2
2
|
export default class MessageService extends IMessageRepository {
|
|
3
3
|
constructor(_ref) {
|
|
4
4
|
let {
|
|
@@ -12,6 +12,10 @@ export default class MessageService extends IMessageRepository {
|
|
|
12
12
|
return this.messageRepository.getMessages(request);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
async getMessage(request) {
|
|
16
|
+
return this.messageRepository.getMessage(request);
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
async getFullContent(request) {
|
|
16
20
|
return this.messageRepository.getFullContent(request);
|
|
17
21
|
}
|
|
@@ -43,6 +47,7 @@ export default class MessageService extends IMessageRepository {
|
|
|
43
47
|
toJSON() {
|
|
44
48
|
return {
|
|
45
49
|
getMessages: this.getMessages.bind(this),
|
|
50
|
+
getMessage: this.getMessage.bind(this),
|
|
46
51
|
getFullContent: this.getFullContent.bind(this),
|
|
47
52
|
sendMessage: this.sendMessage.bind(this),
|
|
48
53
|
sendAttachment: this.sendAttachment.bind(this),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import MessageService from
|
|
1
|
+
import MessageService from './MessageService';
|
|
2
2
|
export { MessageService };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import SessionService from
|
|
1
|
+
import SessionService from './SessionService';
|
|
2
2
|
export { SessionService };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpMethods } from '@zohoim/http-client';
|
|
2
|
-
import ModuleNames from
|
|
3
|
-
import ResponseTypes from
|
|
2
|
+
import ModuleNames from './ModuleNames';
|
|
3
|
+
import ResponseTypes from './ResponseTypes';
|
|
4
4
|
const IM_API_PREFIX = '/api/v1';
|
|
5
5
|
const HTTP_METHODS = HttpMethods;
|
|
6
6
|
export { ModuleNames, IM_API_PREFIX, HTTP_METHODS, ResponseTypes };
|
package/es/core/errors/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import AdapterError from
|
|
2
|
-
import ValidationError from
|
|
1
|
+
import AdapterError from './AdapterError';
|
|
2
|
+
import ValidationError from './ValidationError';
|
|
3
3
|
export { ValidationError, AdapterError };
|
package/es/core/utils/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import ResponseUtils from
|
|
2
|
-
import { validateSchema } from
|
|
1
|
+
import ResponseUtils from './ResponseUtils';
|
|
2
|
+
import { validateSchema } from './validateSchema';
|
|
3
3
|
export { validateSchema, ResponseUtils };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationError } from
|
|
1
|
+
import { ValidationError } from '../errors'; // function validateSchemaKeys(schema, data) {
|
|
2
2
|
// Object.keys(schema).forEach((key) => {
|
|
3
3
|
// if (!(key in data)) {
|
|
4
4
|
// throw new ValidationError(`Key '${key}' is missing in the data`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as getAgentsRequest } from
|
|
1
|
+
export { default as getAgentsRequest } from './getAgentsRequest';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as getBotsRequest } from
|
|
2
|
-
export { default as getBotRequest } from
|
|
1
|
+
export { default as getBotsRequest } from './getBotsRequest';
|
|
2
|
+
export { default as getBotRequest } from './getBotRequest';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as getChannelAgentsRequest } from
|
|
1
|
+
export { default as getChannelAgentsRequest } from './getChannelAgentsRequest';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import getChannelsRequest from
|
|
2
|
-
export * from
|
|
1
|
+
import getChannelsRequest from './getChannelsRequest';
|
|
2
|
+
export * from './agents';
|
|
3
3
|
export { getChannelsRequest };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as getContactsRequest } from
|
|
1
|
+
export { default as getContactsRequest } from './getContactsRequest';
|
package/es/domain/dto/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function getMessageRequest() {
|
|
4
|
+
let {
|
|
5
|
+
params = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withParams({
|
|
8
|
+
sessionId: null,
|
|
9
|
+
messageId: null,
|
|
10
|
+
...params
|
|
11
|
+
}).build();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default getMessageRequest;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { default as getMessagesRequest } from
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
1
|
+
export { default as getMessagesRequest } from './getMessagesRequest';
|
|
2
|
+
export { default as getMessageRequest } from './getMessageRequest';
|
|
3
|
+
export { default as deleteMessageRequest } from './deleteMessageRequest';
|
|
4
|
+
export { default as getFullContentRequest } from './getFullContentRequest';
|
|
5
|
+
export { default as resendMessageRequest } from './resendMessageRequest';
|
|
6
|
+
export { default as sendAttachmentRequest } from './sendAttachmentRequest';
|
|
7
|
+
export { default as sendMessageRequest } from './sendMessageRequest';
|
|
8
|
+
export { default as initiateSessionRequest } from './initiateSessionRequest';
|
|
9
|
+
export { default as searchMessagesRequest } from './searchMessagesRequest';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import RequestBuilder from
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
2
|
|
|
3
3
|
function initiateSessionRequest() {
|
|
4
4
|
let {
|
|
@@ -14,6 +14,7 @@ function initiateSessionRequest() {
|
|
|
14
14
|
cannedMessageId: null,
|
|
15
15
|
language: null,
|
|
16
16
|
parameters: {},
|
|
17
|
+
message: null,
|
|
17
18
|
...body
|
|
18
19
|
}).build();
|
|
19
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import RequestBuilder from
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
2
|
|
|
3
3
|
function sendAttachmentRequest() {
|
|
4
4
|
let {
|
|
@@ -7,7 +7,6 @@ function sendAttachmentRequest() {
|
|
|
7
7
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8
8
|
return new RequestBuilder().withParams({
|
|
9
9
|
sessionId: null,
|
|
10
|
-
messageId: null,
|
|
11
10
|
...params
|
|
12
11
|
}).withBody({
|
|
13
12
|
message: null,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import RequestBuilder from
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
2
|
|
|
3
3
|
function sendMessageRequest() {
|
|
4
4
|
let {
|
|
@@ -10,6 +10,8 @@ function sendMessageRequest() {
|
|
|
10
10
|
...params
|
|
11
11
|
}).withBody({
|
|
12
12
|
message: null,
|
|
13
|
+
replyToMessageId: null,
|
|
14
|
+
meta: null,
|
|
13
15
|
...body
|
|
14
16
|
}).build();
|
|
15
17
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { default as updateSessionAssigneeRequest } from
|
|
2
|
-
export { default as getSessionsRequest } from
|
|
3
|
-
export { default as getSessionRequest } from
|
|
4
|
-
export { default as getSessionAttachmentsRequest } from
|
|
5
|
-
export { default as getSessionLastMessagesRequest } from
|
|
6
|
-
export { default as markSessionAsReadRequest } from
|
|
7
|
-
export { default as updateSessionStatusRequest } from
|
|
8
|
-
export { default as pickupSessionRequest } from
|
|
1
|
+
export { default as updateSessionAssigneeRequest } from './updateSessionAssigneeRequest';
|
|
2
|
+
export { default as getSessionsRequest } from './getSessionsRequest';
|
|
3
|
+
export { default as getSessionRequest } from './getSessionRequest';
|
|
4
|
+
export { default as getSessionAttachmentsRequest } from './getSessionAttachmentsRequest';
|
|
5
|
+
export { default as getSessionLastMessagesRequest } from './getSessionLastMessagesRequest';
|
|
6
|
+
export { default as markSessionAsReadRequest } from './markSessionAsReadRequest';
|
|
7
|
+
export { default as updateSessionStatusRequest } from './updateSessionStatusRequest';
|
|
8
|
+
export { default as pickupSessionRequest } from './pickupSessionRequest';
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import RequestBuilder from
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
2
|
|
|
3
3
|
function markSessionAsReadRequest() {
|
|
4
4
|
let {
|
|
5
|
-
body = {}
|
|
5
|
+
body = {},
|
|
6
|
+
params = {}
|
|
6
7
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
8
|
return new RequestBuilder().withBody({
|
|
8
9
|
lastSeenMessageId: null,
|
|
9
10
|
...body
|
|
11
|
+
}).withParams({
|
|
12
|
+
sessionId: null,
|
|
13
|
+
...params
|
|
10
14
|
}).build();
|
|
11
15
|
}
|
|
12
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { validateSchema } from
|
|
2
|
-
import { ActorType } from
|
|
3
|
-
import { ActorSchema } from
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { ActorType } from '../../enum';
|
|
3
|
+
import { ActorSchema } from '../../schema';
|
|
4
4
|
export default class Actor {
|
|
5
5
|
constructor() {
|
|
6
6
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -21,6 +21,10 @@ export default class Actor {
|
|
|
21
21
|
return type === ActorType.BOT;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
static isSystem(type) {
|
|
25
|
+
return type === ActorType.SYSTEM;
|
|
26
|
+
}
|
|
27
|
+
|
|
24
28
|
static isEndUser(type) {
|
|
25
29
|
return type === ActorType.ENDUSER;
|
|
26
30
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import Actor from
|
|
1
|
+
import Actor from './Actor';
|
|
2
2
|
export { Actor };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { validateSchema } from
|
|
2
|
-
import { AgentSchema } from
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { AgentSchema } from '../../schema';
|
|
3
3
|
export default class Agent {
|
|
4
4
|
constructor() {
|
|
5
5
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import Agent from
|
|
1
|
+
import Agent from './Agent';
|
|
2
2
|
export { Agent };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { validateSchema } from
|
|
2
|
-
import { AttachmentSchema } from
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { AttachmentSchema } from '../../schema';
|
|
3
3
|
export default class Attachment {
|
|
4
4
|
constructor() {
|
|
5
5
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import Attachment from
|
|
1
|
+
import Attachment from './Attachment';
|
|
2
2
|
export { Attachment };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { validateSchema } from
|
|
2
|
-
import { BotSchema } from
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { BotSchema } from '../../schema';
|
|
3
3
|
export default class Bot {
|
|
4
4
|
constructor() {
|
|
5
5
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import Bot from
|
|
1
|
+
import Bot from './Bot';
|
|
2
2
|
export { Bot };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { validateSchema } from
|
|
2
|
-
import { ChannelSchema } from
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { ChannelSchema } from '../../schema';
|
|
3
3
|
export default class Channel {
|
|
4
4
|
constructor() {
|
|
5
5
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import Channel from
|
|
1
|
+
import Channel from './Channel';
|
|
2
2
|
export { Channel };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { validateSchema } from
|
|
2
|
-
import { ContactSchema } from
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { ContactSchema } from '../../schema';
|
|
3
3
|
export default class Contact {
|
|
4
4
|
constructor() {
|
|
5
5
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import Contact from
|
|
1
|
+
import Contact from './Contact';
|
|
2
2
|
export { Contact };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { validateSchema } from
|
|
2
|
-
import { IntegrationServices } from
|
|
3
|
-
import { IntegrationServiceSchema } from
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { IntegrationServices } from '../../enum';
|
|
3
|
+
import { IntegrationServiceSchema } from '../../schema';
|
|
4
4
|
export default class IntegrationService {
|
|
5
5
|
constructor() {
|
|
6
6
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import IntegrationService from
|
|
1
|
+
import IntegrationService from './IntegrationService';
|
|
2
2
|
export { IntegrationService };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { validateSchema } from
|
|
2
|
-
import { ActionType } from
|
|
3
|
-
import { ActionSchema } from
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { ActionType } from '../../enum';
|
|
3
|
+
import { ActionSchema } from '../../schema';
|
|
4
4
|
export default class Action {
|
|
5
5
|
constructor() {
|
|
6
6
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { validateSchema } from
|
|
2
|
-
import {
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { ExternalInfoAction } from '../../enum';
|
|
3
|
+
import { ExternalInfoSchema } from '../../schema';
|
|
3
4
|
export default class ExternalInfo {
|
|
4
5
|
constructor() {
|
|
5
6
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -9,6 +10,14 @@ export default class ExternalInfo {
|
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
12
|
|
|
13
|
+
static isGCConversationEnded(action) {
|
|
14
|
+
return action === ExternalInfoAction.GC_CONVERSATION_ENDED;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static isZIAConversationEnded(action) {
|
|
18
|
+
return action === ExternalInfoAction.ZIA_CONVERSATION_ENDED;
|
|
19
|
+
}
|
|
20
|
+
|
|
12
21
|
toJSON() {
|
|
13
22
|
return { ...this.data
|
|
14
23
|
};
|