@zohoim/client-sdk 1.0.0-poc50 → 1.0.0-poc51

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.
Files changed (41) hide show
  1. package/es/application/services/contacts/ContactService.js +1 -6
  2. package/es/application/services/messages/MessageService.js +3 -3
  3. package/es/domain/dto/contacts/index.js +1 -2
  4. package/es/domain/dto/messages/index.js +1 -1
  5. package/es/domain/dto/messages/{getSearchedMessagesRequest.js → searchMessagesRequest.js} +2 -2
  6. package/es/domain/entities/Agent/Agent.js +5 -2
  7. package/es/domain/entities/Contact/Contact.js +1 -1
  8. package/es/domain/enum/message/ActionSubType.js +6 -0
  9. package/es/domain/enum/message/ActionType.js +6 -0
  10. package/es/domain/enum/message/ExternalInfoAction.js +9 -0
  11. package/es/domain/enum/message/InfoAction.js +17 -0
  12. package/es/domain/enum/message/InfoSessionStatus.js +10 -0
  13. package/es/domain/enum/message/index.js +6 -1
  14. package/es/domain/interfaces/repositories/contacts/IContactRepository.js +1 -6
  15. package/es/domain/interfaces/repositories/messages/IMessageRepository.js +1 -1
  16. package/es/domain/schema/actor/AgentSchema.js +5 -1
  17. package/es/domain/schema/message/ActionSchema.js +5 -2
  18. package/es/domain/schema/message/ExternalInfoSchema.js +3 -1
  19. package/es/domain/schema/message/InfoSchema.js +5 -2
  20. package/es/infrastructure/adapters/agents/{agentAdapter.js → AgentAdapter.js} +5 -3
  21. package/es/infrastructure/adapters/agents/index.js +1 -1
  22. package/es/infrastructure/adapters/attachments/AttachmentAdapter.js +1 -1
  23. package/es/infrastructure/adapters/bots/BotAdapter.js +1 -1
  24. package/es/infrastructure/adapters/channels/ChannelAdapter.js +1 -1
  25. package/es/infrastructure/adapters/channels/ChannelAgentAdapter.js +1 -1
  26. package/es/infrastructure/adapters/contacts/{contactAdapter.js → ContactAdapter.js} +1 -1
  27. package/es/infrastructure/adapters/contacts/index.js +1 -1
  28. package/es/infrastructure/adapters/index.js +1 -1
  29. package/es/infrastructure/adapters/{message → messages}/MessageAdapter.js +1 -1
  30. package/es/infrastructure/adapters/{message → messages}/MessageWithSessionAdapter.js +1 -1
  31. package/es/infrastructure/adapters/sessions/SessionAdapter.js +1 -1
  32. package/es/infrastructure/api/contacts/ContactAPI.js +1 -11
  33. package/es/infrastructure/api/messages/MessageAPI.js +4 -4
  34. package/es/infrastructure/api/registry/contacts/contactAPIRegistry.js +2 -7
  35. package/es/infrastructure/api/registry/messages/constructMessageEndPoint.js +2 -8
  36. package/es/infrastructure/api/registry/messages/messageAPIRegistry.js +4 -4
  37. package/es/infrastructure/repositories/contacts/ContactRepository.js +1 -7
  38. package/es/infrastructure/repositories/messages/MessageRepository.js +4 -4
  39. package/package.json +1 -1
  40. package/es/domain/dto/contacts/searchContactsRequest.js +0 -11
  41. /package/es/infrastructure/adapters/{message → messages}/index.js +0 -0
@@ -12,14 +12,9 @@ export default class ContactService extends IContactRepository {
12
12
  return this.contactRepository.getContacts(request);
13
13
  }
14
14
 
15
- async searchContacts(request) {
16
- return this.contactRepository.searchContacts(request);
17
- }
18
-
19
15
  toJSON() {
20
16
  return {
21
- getContacts: this.getContacts.bind(this),
22
- searchContacts: this.searchContacts.bind(this)
17
+ getContacts: this.getContacts.bind(this)
23
18
  };
24
19
  }
25
20
 
@@ -36,8 +36,8 @@ export default class MessageService extends IMessageRepository {
36
36
  return this.messageRepository.initiateSession(request);
37
37
  }
38
38
 
39
- async getSearchedMessages(request) {
40
- return this.messageRepository.getSearchedMessages(request);
39
+ async searchMessages(request) {
40
+ return this.messageRepository.searchMessages(request);
41
41
  }
42
42
 
43
43
  toJSON() {
@@ -49,7 +49,7 @@ export default class MessageService extends IMessageRepository {
49
49
  resendMessage: this.resendMessage.bind(this),
50
50
  deleteMessage: this.deleteMessage.bind(this),
51
51
  initiateSession: this.initiateSession.bind(this),
52
- getSearchedMessages: this.getSearchedMessages.bind(this)
52
+ searchMessages: this.searchMessages.bind(this)
53
53
  };
54
54
  }
55
55
 
@@ -1,2 +1 @@
1
- export { default as getContactsRequest } from "./getContactsRequest";
2
- export { default as searchContactsRequest } from "./searchContactsRequest";
1
+ export { default as getContactsRequest } from "./getContactsRequest";
@@ -5,4 +5,4 @@ export { default as resendMessageRequest } from "./resendMessageRequest";
5
5
  export { default as sendAttachmentRequest } from "./sendAttachmentRequest";
6
6
  export { default as sendMessageRequest } from "./sendMessageRequest";
7
7
  export { default as initiateSessionRequest } from "./initiateSessionRequest";
8
- export { default as getSearchedMessagesRequest } from "./getSearchedMessagesRequest";
8
+ export { default as searchMessagesRequest } from "./searchMessagesRequest";
@@ -1,6 +1,6 @@
1
1
  import RequestBuilder from "../RequestBuilder";
2
2
 
3
- function getSearchedMessagesRequest() {
3
+ function searchMessagesRequest() {
4
4
  let {
5
5
  query = {}
6
6
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -19,4 +19,4 @@ function getSearchedMessagesRequest() {
19
19
  }).build();
20
20
  }
21
21
 
22
- export default getSearchedMessagesRequest;
22
+ export default searchMessagesRequest;
@@ -6,10 +6,13 @@ export default class Agent {
6
6
  const validatedData = validateSchema(AgentSchema, data);
7
7
  this.data = {
8
8
  id: validatedData.id,
9
- name: validatedData.name,
9
+ firstName: validatedData.firstName,
10
+ lastName: validatedData.lastName,
10
11
  email: validatedData.email,
11
- photoURL: validatedData.photoURL || '',
12
+ photoURL: validatedData.photoURL || null,
12
13
  zuid: validatedData.zuid,
14
+ role: validatedData.role,
15
+ status: validatedData.status,
13
16
  type: validatedData.type
14
17
  };
15
18
  }
@@ -8,7 +8,7 @@ export default class Contact {
8
8
  id: validatedData.id,
9
9
  name: validatedData.name,
10
10
  email: validatedData.email,
11
- photoURL: validatedData.photoURL || '',
11
+ photoURL: validatedData.photoURL || null,
12
12
  mobile: validatedData.mobile,
13
13
  phone: validatedData.phone
14
14
  };
@@ -0,0 +1,6 @@
1
+ const ActionSubType = {
2
+ CONNECTION_AUTHENTICATE: 'CONNECTION_AUTHENTICATE',
3
+ AGENT: 'AGENT',
4
+ UN_IDENTIFIED: 'UN_IDENTIFIED'
5
+ };
6
+ export default ActionSubType;
@@ -0,0 +1,6 @@
1
+ const ActionType = {
2
+ TRANSAFER: 'TRANSAFER',
3
+ REDIRECT_URL: 'REDIRECT_URL',
4
+ UN_INDENTIFIED: 'UN_IDENTIFIED'
5
+ };
6
+ export default ActionType;
@@ -0,0 +1,9 @@
1
+ const ExternalInfoAction = {
2
+ UN_IDENTIFIED: "UN_IDENTIFIED",
3
+ GC_CONVERSATION_ENDED: "GC_CONVERSATION_ENDED",
4
+ ZIA_CONVERSATION_ENDED: "ZIA_CONVERSATION_ENDED",
5
+ NEW_FOLLOWER: "NEW_FOLLOWER",
6
+ CHAT_BLOCKED: "CHAT_BLOCKED",
7
+ CHAT_UNBLOCKED: "CHAT_UNBLOCKED"
8
+ };
9
+ export default ExternalInfoAction;
@@ -0,0 +1,17 @@
1
+ const InfoAction = {
2
+ UN_IDENTIFIED: "UN_IDENTIFIED",
3
+ END_SESSION: "END_SESSION",
4
+ BLOCK_SESSION: "BLOCK_SESSION",
5
+ UNBLOCK_SESSION: "UNBLOCK_SESSION",
6
+ CHAT_AUTO_ASSIGN: "CHAT_AUTO_ASSIGN",
7
+ CHAT_ACCEPT: "CHAT_ACCEPT",
8
+ CHAT_REOPEN: "CHAT_REOPEN",
9
+ CHAT_TRANSFER: "CHAT_TRANSFER",
10
+ ADD_PARTICIPANT: "ADD_PARTICIPANT",
11
+ REMOVE_PARTICIPANT: "REMOVE_PARTICIPANT",
12
+ CHAT_REOPENED_ON_TRANSFER: "CHAT_REOPENED_ON_TRANSFER",
13
+ CHAT_INITIATION: "CHAT_INITIATION",
14
+ USER_LEFT: "USER_LEFT",
15
+ USER_JOINED: "USER_JOINED"
16
+ };
17
+ export default InfoAction;
@@ -0,0 +1,10 @@
1
+ const InfoSessionStatus = {
2
+ CREATED: "CREATED",
3
+ OPEN: "OPEN",
4
+ ON_PROGRESS: "ON_PROGRESS",
5
+ ON_HOLD: "ON_HOLD",
6
+ ENDED: "ENDED",
7
+ BLOCKED: "BLOCKED",
8
+ MISSED: "MISSED"
9
+ };
10
+ export default InfoSessionStatus;
@@ -2,4 +2,9 @@ import MessageTypes from "./MessageType";
2
2
  import MessageStatus from "./MessageStatus";
3
3
  import MessageDirection from "./MessageDirection";
4
4
  import MessageContentType from "./MessageContentType";
5
- export { MessageTypes, MessageStatus, MessageDirection, MessageContentType };
5
+ import ActionType from "./ActionType";
6
+ import ExternalInfoAction from "./ExternalInfoAction";
7
+ import InfoSessionStatus from "./InfoSessionStatus";
8
+ import InfoAction from "./InfoAction";
9
+ import ActionSubType from "./ActionSubType";
10
+ export { MessageTypes, MessageStatus, MessageDirection, MessageContentType, ActionType, ActionSubType, ExternalInfoAction, InfoSessionStatus, InfoAction };
@@ -1,4 +1,4 @@
1
- import { getContactsRequest, searchContactsRequest } from "../../../dto";
1
+ import { getContactsRequest } from "../../../dto";
2
2
  export default class IContactRepository {
3
3
  // eslint-disable-next-line no-unused-vars
4
4
  async getContacts() {
@@ -6,9 +6,4 @@ export default class IContactRepository {
6
6
  throw new Error('Method not implemented');
7
7
  }
8
8
 
9
- async searchContacts() {
10
- let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : searchContactsRequest();
11
- throw new Error('Method not implemented');
12
- }
13
-
14
9
  }
@@ -36,7 +36,7 @@ export default class IMessageRepository {
36
36
  throw new Error('Method not implemented.');
37
37
  }
38
38
 
39
- getSearchedMessages() {
39
+ searchMessages() {
40
40
  throw new Error('Method not implemented.');
41
41
  }
42
42
 
@@ -4,7 +4,11 @@ const AgentSchema = {
4
4
  type: 'string',
5
5
  required: true
6
6
  },
7
- name: {
7
+ firstName: {
8
+ type: 'string',
9
+ required: true
10
+ },
11
+ lastName: {
8
12
  type: 'string',
9
13
  required: true
10
14
  },
@@ -1,11 +1,14 @@
1
+ import { ActionType, ActionSubType } from "../../enum";
1
2
  const ActionSchema = {
2
3
  type: {
3
4
  type: 'string',
4
- required: true
5
+ required: true,
6
+ enum: Object.values(ActionType)
5
7
  },
6
8
  subType: {
7
9
  type: 'string',
8
- required: true
10
+ required: true,
11
+ enum: Object.values(ActionSubType)
9
12
  },
10
13
  value: {
11
14
  type: 'string',
@@ -1,7 +1,9 @@
1
+ import { ExternalInfoAction } from "../../enum";
1
2
  const ExternalInfoSchema = {
2
3
  action: {
3
4
  type: 'string',
4
- required: true
5
+ required: true,
6
+ enum: Object.values(ExternalInfoAction)
5
7
  }
6
8
  };
7
9
  export default ExternalInfoSchema;
@@ -1,3 +1,4 @@
1
+ import { InfoSessionStatus, InfoAction } from "../../enum";
1
2
  import { ActorSchema } from "../actor";
2
3
  const InfoSchema = {
3
4
  actor: {
@@ -7,11 +8,13 @@ const InfoSchema = {
7
8
  },
8
9
  action: {
9
10
  type: 'string',
10
- required: true
11
+ required: true,
12
+ enum: Object.values(InfoAction)
11
13
  },
12
14
  sessionStatus: {
13
15
  type: 'string',
14
- required: false
16
+ required: false,
17
+ enum: Object.values(InfoSessionStatus)
15
18
  },
16
19
  targets: {
17
20
  type: 'array',
@@ -1,6 +1,8 @@
1
+ import { AGENT } from 'imclient/src/constants/constants';
1
2
  import { AdapterError } from "../../../core/errors";
2
3
  import { Agent } from "../../../domain/entities";
3
- import IAdapter from "../../../domain/interfaces/IAdapter";
4
+ import { ActorType } from "../../../domain/enum";
5
+ import { IAdapter } from "../../../domain/interfaces";
4
6
  export default class AgentAdapter extends IAdapter {
5
7
  adapt(agentData) {
6
8
  if (!agentData) {
@@ -10,14 +12,14 @@ export default class AgentAdapter extends IAdapter {
10
12
  try {
11
13
  return new Agent({
12
14
  id: agentData.id,
13
- name: agentData.name,
14
15
  firstName: agentData.firstName,
15
16
  lastName: agentData.lastName,
16
17
  email: agentData.email,
17
18
  zuid: agentData.zuid,
18
19
  status: agentData.status,
19
20
  role: agentData.rolePermissionType,
20
- photoURL: agentData.photoURL
21
+ photoURL: agentData.photoURL,
22
+ type: [ActorType.AGENT]
21
23
  }).toJSON();
22
24
  } catch (error) {
23
25
  throw new AdapterError(`Failed to adapt Agent: ${error.message}`);
@@ -1,2 +1,2 @@
1
- import AgentAdapter from "./agentAdapter";
1
+ import AgentAdapter from "./AgentAdapter";
2
2
  export { AgentAdapter };
@@ -1,6 +1,6 @@
1
1
  import { AdapterError } from "../../../core/errors";
2
2
  import { Attachment } from "../../../domain/entities";
3
- import IAdapter from "../../../domain/interfaces/IAdapter";
3
+ import { IAdapter } from "../../../domain/interfaces";
4
4
  export default class AttachmentAdapter extends IAdapter {
5
5
  adapt(attachmentData) {
6
6
  if (!attachmentData) {
@@ -1,6 +1,6 @@
1
1
  import { AdapterError } from "../../../core/errors";
2
2
  import { Bot } from "../../../domain/entities";
3
- import IAdapter from "../../../domain/interfaces/IAdapter";
3
+ import { IAdapter } from "../../../domain/interfaces";
4
4
  export default class BotAdapter extends IAdapter {
5
5
  adapt(botData) {
6
6
  if (!botData) {
@@ -1,6 +1,6 @@
1
1
  import { AdapterError } from "../../../core/errors";
2
2
  import { Channel } from "../../../domain/entities";
3
- import IAdapter from "../../../domain/interfaces/IAdapter";
3
+ import { IAdapter } from "../../../domain/interfaces";
4
4
  export default class ChannelAdapter extends IAdapter {
5
5
  adapt(rawChannel) {
6
6
  if (!rawChannel) {
@@ -1,6 +1,6 @@
1
1
  import { AdapterError } from "../../../core/errors";
2
2
  import { Agent } from "../../../domain/entities";
3
- import IAdapter from "../../../domain/interfaces/IAdapter";
3
+ import { IAdapter } from "../../../domain/interfaces";
4
4
  export default class ChannelAgentAdapter extends IAdapter {
5
5
  /**
6
6
  * Adapts channel agent data to Agent entity
@@ -1,6 +1,6 @@
1
1
  import { AdapterError } from "../../../core/errors";
2
2
  import { Contact } from "../../../domain/entities";
3
- import IAdapter from "../../../domain/interfaces/IAdapter";
3
+ import { IAdapter } from "../../../domain/interfaces";
4
4
  export default class ContactAdapter extends IAdapter {
5
5
  adapt(contactData) {
6
6
  if (!contactData) {
@@ -1,2 +1,2 @@
1
- import ContactAdapter from "./contactAdapter";
1
+ import ContactAdapter from "./ContactAdapter";
2
2
  export { ContactAdapter };
@@ -2,6 +2,6 @@ export * from "./channels";
2
2
  export * from "./sessions";
3
3
  export * from "./bots";
4
4
  export * from "./attachments";
5
- export * from "./message";
5
+ export * from "./messages";
6
6
  export * from "./agents";
7
7
  export * from "./contacts";
@@ -1,6 +1,6 @@
1
1
  import { AdapterError } from "../../../core/errors";
2
2
  import { Message } from "../../../domain/entities";
3
- import IAdapter from "../../../domain/interfaces/IAdapter";
3
+ import { IAdapter } from "../../../domain/interfaces";
4
4
  export default class MessageAdapter extends IAdapter {
5
5
  adapt(messageData) {
6
6
  if (!messageData) {
@@ -1,6 +1,6 @@
1
1
  import { AdapterError } from "../../../core/errors";
2
2
  import { MessageWithSession } from "../../../domain/entities";
3
- import IAdapter from "../../../domain/interfaces/IAdapter";
3
+ import { IAdapter } from "../../../domain/interfaces";
4
4
  import { MessageAdapter, SessionAdapter } from "../index";
5
5
  export default class MessageWithSessionAdapter extends IAdapter {
6
6
  adapt(messageData) {
@@ -1,6 +1,6 @@
1
1
  import { AdapterError } from "../../../core/errors";
2
2
  import { Session } from "../../../domain/entities";
3
- import IAdapter from "../../../domain/interfaces/IAdapter";
3
+ import { IAdapter } from "../../../domain/interfaces";
4
4
  export default class SessionAdapter extends IAdapter {
5
5
  adapt(sessionData) {
6
6
  if (!sessionData) {
@@ -1,5 +1,5 @@
1
1
  import { ModuleNames } from "../../../core/constants";
2
- import { getContactsRequest, searchContactsRequest } from "../../../domain/dto";
2
+ import { getContactsRequest } from "../../../domain/dto";
3
3
  import BaseAPI from "../BaseAPI";
4
4
  export default class ContactAPI extends BaseAPI {
5
5
  constructor() {
@@ -18,14 +18,4 @@ export default class ContactAPI extends BaseAPI {
18
18
  return httpRequest;
19
19
  }
20
20
 
21
- async searchContacts() {
22
- let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : searchContactsRequest();
23
- const operation = 'searchContacts';
24
- const httpRequest = await this.request({
25
- request,
26
- operation
27
- });
28
- return httpRequest;
29
- }
30
-
31
21
  }
@@ -1,5 +1,5 @@
1
1
  import { ModuleNames } from "../../../core/constants";
2
- import { getMessagesRequest, deleteMessageRequest, getFullContentRequest, resendMessageRequest, sendAttachmentRequest, sendMessageRequest, initiateSessionRequest, getSearchedMessagesRequest } from "../../../domain/dto";
2
+ import { getMessagesRequest, deleteMessageRequest, getFullContentRequest, resendMessageRequest, sendAttachmentRequest, sendMessageRequest, initiateSessionRequest, searchMessagesRequest } from "../../../domain/dto";
3
3
  import BaseAPI from "../BaseAPI";
4
4
  export default class MessageAPI extends BaseAPI {
5
5
  constructor() {
@@ -78,9 +78,9 @@ export default class MessageAPI extends BaseAPI {
78
78
  return httpRequest;
79
79
  }
80
80
 
81
- async getSearchedMessages() {
82
- let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getSearchedMessagesRequest();
83
- const operation = 'getSearchedMessages';
81
+ async searchMessages() {
82
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : searchMessagesRequest();
83
+ const operation = 'searchMessages';
84
84
  const httpRequest = await this.request({
85
85
  operation,
86
86
  request
@@ -1,5 +1,5 @@
1
1
  import { HTTP_METHODS } from "../../../../core/constants";
2
- import { getContactsRequest, searchContactsRequest } from "../../../../domain/dto";
2
+ import { getContactsRequest } from "../../../../domain/dto";
3
3
  import createAPIRegistry from "../createAPIRegistry";
4
4
  import constructContactEndPoint from "./constructContactEndPoint";
5
5
 
@@ -7,11 +7,6 @@ function getContacts() {
7
7
  return createAPIRegistry(constructContactEndPoint(), HTTP_METHODS.GET, getContactsRequest());
8
8
  }
9
9
 
10
- function searchContacts() {
11
- return createAPIRegistry(constructContactEndPoint(), HTTP_METHODS.GET, searchContactsRequest());
12
- }
13
-
14
10
  export default {
15
- getContacts,
16
- searchContacts
11
+ getContacts
17
12
  };
@@ -1,10 +1,4 @@
1
- import createBaseUrl from "../createBaseUrl";
1
+ import constructSessionEndPoint from "../sessions/constructSessionEndPoint";
2
2
  export default function constructMessageEndPoint(extra) {
3
- const base = '/sessions';
4
-
5
- if (extra) {
6
- return createBaseUrl(base + extra);
7
- }
8
-
9
- return createBaseUrl(base);
3
+ return constructSessionEndPoint(extra);
10
4
  }
@@ -1,5 +1,5 @@
1
1
  import { HTTP_METHODS } from "../../../../core/constants";
2
- import { deleteMessageRequest, getFullContentRequest, getMessagesRequest, initiateSessionRequest, resendMessageRequest, sendAttachmentRequest, sendMessageRequest, getSearchedMessagesRequest } from "../../../../domain/dto";
2
+ import { deleteMessageRequest, getFullContentRequest, getMessagesRequest, initiateSessionRequest, resendMessageRequest, sendAttachmentRequest, sendMessageRequest, searchMessagesRequest } from "../../../../domain/dto";
3
3
  import constructChannelEndPoint from "../channels/constructChannelEndPoint";
4
4
  import constructMessageEndPoint from "./constructMessageEndPoint";
5
5
  import createAPIRegistry from "../createAPIRegistry";
@@ -41,8 +41,8 @@ function initiateSession() {
41
41
  return createAPIRegistry(constructChannelEndPoint(INITIATE_SESSION_URL), HTTP_METHODS.POST, initiateSessionRequest());
42
42
  }
43
43
 
44
- function getSearchedMessages() {
45
- return createAPIRegistry(createBaseUrl(SEARCH_MESSAGES_URL), HTTP_METHODS.GET, getSearchedMessagesRequest());
44
+ function searchMessages() {
45
+ return createAPIRegistry(createBaseUrl(SEARCH_MESSAGES_URL), HTTP_METHODS.GET, searchMessagesRequest());
46
46
  }
47
47
 
48
48
  export default {
@@ -53,5 +53,5 @@ export default {
53
53
  resendMessage,
54
54
  deleteMessage,
55
55
  initiateSession,
56
- getSearchedMessages
56
+ searchMessages
57
57
  };
@@ -18,15 +18,9 @@ export default class ContactRepository extends IContactRepository {
18
18
  return ResponseUtils.adaptListResponse(response, this.contactAdapter.adapt);
19
19
  }
20
20
 
21
- async searchContacts(request) {
22
- const response = await this.contactAPI.searchContacts(request);
23
- return ResponseUtils.adaptListResponse(response, this.contactAdapter.adapt);
24
- }
25
-
26
21
  toJSON() {
27
22
  return {
28
- getContacts: this.getContacts.bind(this),
29
- searchContacts: this.searchContacts.bind(this)
23
+ getContacts: this.getContacts.bind(this)
30
24
  };
31
25
  }
32
26
 
@@ -2,7 +2,7 @@ import { MessageAdapter } from "../../adapters";
2
2
  import { ResponseUtils } from "../../../core/utils";
3
3
  import { MessageAPI } from "../../api";
4
4
  import { IMessageRepository } from "../../../domain/interfaces/repositories/messages";
5
- import MessageWithSessionAdapter from "../../adapters/message/MessageWithSessionAdapter";
5
+ import MessageWithSessionAdapter from "../../adapters/messages/MessageWithSessionAdapter";
6
6
  export default class MessageRepository extends IMessageRepository {
7
7
  constructor(_ref) {
8
8
  let {
@@ -51,8 +51,8 @@ export default class MessageRepository extends IMessageRepository {
51
51
  return ResponseUtils.adaptSingleResponse(response, this.messageAdapter.adapt);
52
52
  }
53
53
 
54
- async getSearchedMessages(request) {
55
- const response = await this.messageAPI.getSearchedMessages(request);
54
+ async searchMessages(request) {
55
+ const response = await this.messageAPI.searchMessages(request);
56
56
  return ResponseUtils.adaptListResponse(response, this.messageWithSessionAdapter.adapt);
57
57
  }
58
58
 
@@ -65,7 +65,7 @@ export default class MessageRepository extends IMessageRepository {
65
65
  resendMessage: this.resendMessage.bind(this),
66
66
  deleteMessage: this.deleteMessage.bind(this),
67
67
  initiateSession: this.initiateSession.bind(this),
68
- getSearchedMessages: this.getSearchedMessages.bind(this)
68
+ searchMessages: this.searchMessages.bind(this)
69
69
  };
70
70
  }
71
71
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/client-sdk",
3
- "version": "1.0.0-poc50",
3
+ "version": "1.0.0-poc51",
4
4
  "description": "To have the client sdk for the IM",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",
@@ -1,11 +0,0 @@
1
- import RequestBuilder from "../RequestBuilder";
2
-
3
- function searchContactsRequest() {
4
- return new RequestBuilder().withQuery({
5
- from: 0,
6
- limit: 10,
7
- searchStr: null
8
- }).build();
9
- }
10
-
11
- export default searchContactsRequest;