@zohoim/client-sdk 1.0.0-poc51 → 1.0.0-poc53
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/domain/entities/Agent/Agent.js +2 -1
- package/es/domain/enum/message/ActionType.js +1 -1
- package/es/domain/interfaces/repositories/agents/IAgentRepository.js +10 -2
- package/es/domain/interfaces/repositories/bots/IBotRepository.js +10 -2
- package/es/domain/interfaces/repositories/channels/IChannelAgentRepository.js +10 -2
- package/es/domain/interfaces/repositories/channels/IChannelRepository.js +10 -2
- package/es/domain/interfaces/repositories/contacts/IContactRepository.js +10 -2
- package/es/domain/interfaces/repositories/messages/IMessageRepository.js +11 -2
- package/es/domain/interfaces/repositories/sessions/ISessionRepository.js +9 -1
- package/es/domain/schema/actor/AgentSchema.js +13 -1
- package/es/index.js +3 -1
- package/es/infrastructure/adapters/agents/AgentAdapter.js +1 -2
- package/es/infrastructure/api/agents/AgentAPI.js +2 -9
- package/es/infrastructure/api/bots/BotAPI.js +2 -9
- package/es/infrastructure/api/channels/ChannelAPI.js +2 -9
- package/es/infrastructure/api/channels/ChannelAgentAPI.js +2 -9
- package/es/infrastructure/api/contacts/ContactAPI.js +2 -9
- package/es/infrastructure/api/messages/MessageAPI.js +2 -9
- package/es/infrastructure/api/sessions/SessionAPI.js +2 -9
- package/package.json +1 -1
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { ModuleNames } from "../../../../core/constants";
|
|
2
|
+
import BaseAPI from "../../../../infrastructure/api/BaseAPI";
|
|
1
3
|
import { getAgentsRequest } from "../../../dto";
|
|
2
|
-
export default class IAgentRepository {
|
|
3
|
-
|
|
4
|
+
export default class IAgentRepository extends BaseAPI {
|
|
5
|
+
constructor() {
|
|
6
|
+
super({
|
|
7
|
+
module: ModuleNames.AGENTS
|
|
8
|
+
});
|
|
9
|
+
} // eslint-disable-next-line no-unused-vars
|
|
10
|
+
|
|
11
|
+
|
|
4
12
|
async getAgents() {
|
|
5
13
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getAgentsRequest();
|
|
6
14
|
throw new Error('Method not implemented');
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { ModuleNames } from "../../../../core/constants";
|
|
2
|
+
import BaseAPI from "../../../../infrastructure/api/BaseAPI";
|
|
1
3
|
import { getBotsRequest } from "../../../dto";
|
|
2
|
-
export default class IBotRepository {
|
|
3
|
-
|
|
4
|
+
export default class IBotRepository extends BaseAPI {
|
|
5
|
+
constructor() {
|
|
6
|
+
super({
|
|
7
|
+
module: ModuleNames.BOTS
|
|
8
|
+
});
|
|
9
|
+
} // eslint-disable-next-line no-unused-vars
|
|
10
|
+
|
|
11
|
+
|
|
4
12
|
async getBots() {
|
|
5
13
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getBotsRequest();
|
|
6
14
|
throw new Error('Method not implemented');
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { ModuleNames } from "../../../../core/constants";
|
|
2
|
+
import BaseAPI from "../../../../infrastructure/api/BaseAPI";
|
|
1
3
|
import { getChannelAgentsRequest } from "../../../dto";
|
|
2
|
-
export default class IChannelAgentRepository {
|
|
3
|
-
|
|
4
|
+
export default class IChannelAgentRepository extends BaseAPI {
|
|
5
|
+
constructor() {
|
|
6
|
+
super({
|
|
7
|
+
module: `${ModuleNames.CHANNELS}.agents`
|
|
8
|
+
});
|
|
9
|
+
} // eslint-disable-next-line no-unused-vars
|
|
10
|
+
|
|
11
|
+
|
|
4
12
|
getAgents() {
|
|
5
13
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getChannelAgentsRequest();
|
|
6
14
|
throw new Error('Method not implemented.');
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { ModuleNames } from "../../../../core/constants";
|
|
2
|
+
import BaseAPI from "../../../../infrastructure/api/BaseAPI";
|
|
1
3
|
import { getChannelsRequest } from "../../../dto";
|
|
2
|
-
export default class IChannelRepository {
|
|
3
|
-
|
|
4
|
+
export default class IChannelRepository extends BaseAPI {
|
|
5
|
+
constructor() {
|
|
6
|
+
super({
|
|
7
|
+
module: ModuleNames.CHANNELS
|
|
8
|
+
});
|
|
9
|
+
} // eslint-disable-next-line no-unused-vars
|
|
10
|
+
|
|
11
|
+
|
|
4
12
|
getChannels() {
|
|
5
13
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getChannelsRequest();
|
|
6
14
|
throw new Error('Method not implemented.');
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { ModuleNames } from "../../../../core/constants";
|
|
2
|
+
import BaseAPI from "../../../../infrastructure/api/BaseAPI";
|
|
1
3
|
import { getContactsRequest } from "../../../dto";
|
|
2
|
-
export default class IContactRepository {
|
|
3
|
-
|
|
4
|
+
export default class IContactRepository extends BaseAPI {
|
|
5
|
+
constructor() {
|
|
6
|
+
super({
|
|
7
|
+
module: ModuleNames.CONTACTS
|
|
8
|
+
});
|
|
9
|
+
} // eslint-disable-next-line no-unused-vars
|
|
10
|
+
|
|
11
|
+
|
|
4
12
|
async getContacts() {
|
|
5
13
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getContactsRequest();
|
|
6
14
|
throw new Error('Method not implemented');
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ModuleNames } from "../../../../core/constants";
|
|
3
|
+
import BaseAPI from "../../../../infrastructure/api/BaseAPI";
|
|
4
|
+
import { getMessagesRequest, deleteMessageRequest, getFullContentRequest, resendMessageRequest, sendAttachmentRequest, sendMessageRequest, initiateSessionRequest, searchMessagesRequest } from "../../../dto";
|
|
5
|
+
export default class IMessageRepository extends BaseAPI {
|
|
6
|
+
constructor() {
|
|
7
|
+
super({
|
|
8
|
+
module: ModuleNames.MESSAGES
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
4
12
|
getMessages() {
|
|
5
13
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getMessagesRequest();
|
|
6
14
|
throw new Error('Method not implemented.');
|
|
@@ -37,6 +45,7 @@ export default class IMessageRepository {
|
|
|
37
45
|
}
|
|
38
46
|
|
|
39
47
|
searchMessages() {
|
|
48
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : searchMessagesRequest();
|
|
40
49
|
throw new Error('Method not implemented.');
|
|
41
50
|
}
|
|
42
51
|
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
|
+
import { ModuleNames } from "../../../../core/constants";
|
|
3
|
+
import BaseAPI from "../../../../infrastructure/api/BaseAPI";
|
|
2
4
|
import { updateSessionAssigneeRequest, getSessionsRequest, getSessionRequest, getSessionAttachmentsRequest, getSessionLastMessagesRequest, markSessionAsReadRequest, updateSessionStatusRequest } from "../../../dto";
|
|
3
|
-
export default class ISessionRepository {
|
|
5
|
+
export default class ISessionRepository extends BaseAPI {
|
|
6
|
+
constructor() {
|
|
7
|
+
super({
|
|
8
|
+
module: ModuleNames.SESSIONS
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
4
12
|
updateAssignee() {
|
|
5
13
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : updateSessionAssigneeRequest();
|
|
6
14
|
throw new Error('Method not implemented.');
|
|
@@ -6,12 +6,16 @@ const AgentSchema = {
|
|
|
6
6
|
},
|
|
7
7
|
firstName: {
|
|
8
8
|
type: 'string',
|
|
9
|
-
required:
|
|
9
|
+
required: false
|
|
10
10
|
},
|
|
11
11
|
lastName: {
|
|
12
12
|
type: 'string',
|
|
13
13
|
required: true
|
|
14
14
|
},
|
|
15
|
+
name: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
15
19
|
email: {
|
|
16
20
|
type: 'string',
|
|
17
21
|
required: true
|
|
@@ -24,6 +28,14 @@ const AgentSchema = {
|
|
|
24
28
|
type: 'string',
|
|
25
29
|
required: true
|
|
26
30
|
},
|
|
31
|
+
role: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
required: false
|
|
34
|
+
},
|
|
35
|
+
status: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
required: false
|
|
38
|
+
},
|
|
27
39
|
type: {
|
|
28
40
|
type: 'string',
|
|
29
41
|
required: true,
|
package/es/index.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
export * from "./domain/dto";
|
|
3
3
|
export * from "./domain/entities";
|
|
4
4
|
export * from "./domain/enum";
|
|
5
|
-
export * from "./domain/interfaces"; //
|
|
5
|
+
export * from "./domain/interfaces"; // infrastructure
|
|
6
|
+
|
|
7
|
+
export * from "./infrastructure/api"; // frameworks
|
|
6
8
|
|
|
7
9
|
export * from "./frameworks/sdk"; // core
|
|
8
10
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AGENT } from 'imclient/src/constants/constants';
|
|
2
1
|
import { AdapterError } from "../../../core/errors";
|
|
3
2
|
import { Agent } from "../../../domain/entities";
|
|
4
3
|
import { ActorType } from "../../../domain/enum";
|
|
@@ -17,7 +16,7 @@ export default class AgentAdapter extends IAdapter {
|
|
|
17
16
|
email: agentData.email,
|
|
18
17
|
zuid: agentData.zuid,
|
|
19
18
|
status: agentData.status,
|
|
20
|
-
role: agentData.
|
|
19
|
+
role: agentData.role,
|
|
21
20
|
photoURL: agentData.photoURL,
|
|
22
21
|
type: [ActorType.AGENT]
|
|
23
22
|
}).toJSON();
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { ModuleNames } from "../../../core/constants";
|
|
2
1
|
import { getAgentsRequest } from "../../../domain/dto";
|
|
3
|
-
import
|
|
4
|
-
export default class AgentAPI extends
|
|
5
|
-
constructor() {
|
|
6
|
-
super({
|
|
7
|
-
module: ModuleNames.AGENTS
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
2
|
+
import { IAgentRepository } from "../../../domain/interfaces/repositories";
|
|
3
|
+
export default class AgentAPI extends IAgentRepository {
|
|
11
4
|
async getAgents() {
|
|
12
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getAgentsRequest();
|
|
13
6
|
const operation = 'getAgents';
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { ModuleNames } from "../../../core/constants";
|
|
2
1
|
import { getBotsRequest } from "../../../domain/dto";
|
|
3
|
-
import
|
|
4
|
-
export default class BotAPI extends
|
|
5
|
-
constructor() {
|
|
6
|
-
super({
|
|
7
|
-
module: ModuleNames.BOTS
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
2
|
+
import { IBotRepository } from "../../../domain/interfaces/repositories";
|
|
3
|
+
export default class BotAPI extends IBotRepository {
|
|
11
4
|
async getBots() {
|
|
12
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getBotsRequest();
|
|
13
6
|
const operation = 'getBots';
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { ModuleNames } from "../../../core/constants";
|
|
2
1
|
import { getChannelsRequest } from "../../../domain/dto";
|
|
3
|
-
import
|
|
4
|
-
export default class ChannelAPI extends
|
|
5
|
-
constructor() {
|
|
6
|
-
super({
|
|
7
|
-
module: ModuleNames.CHANNELS
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
2
|
+
import { IChannelRepository } from "../../../domain/interfaces/repositories";
|
|
3
|
+
export default class ChannelAPI extends IChannelRepository {
|
|
11
4
|
async getChannels() {
|
|
12
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getChannelsRequest();
|
|
13
6
|
const operation = 'getChannels';
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { ModuleNames } from "../../../core/constants";
|
|
2
1
|
import { getChannelAgentsRequest } from "../../../domain/dto";
|
|
3
|
-
import
|
|
4
|
-
export default class ChannelAgentAPI extends
|
|
5
|
-
constructor() {
|
|
6
|
-
super({
|
|
7
|
-
module: `${ModuleNames.CHANNELS}.agents`
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
2
|
+
import { IChannelAgentRepository } from "../../../domain/interfaces/repositories";
|
|
3
|
+
export default class ChannelAgentAPI extends IChannelAgentRepository {
|
|
11
4
|
async getAgents() {
|
|
12
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getChannelAgentsRequest();
|
|
13
6
|
const {
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { ModuleNames } from "../../../core/constants";
|
|
2
1
|
import { getContactsRequest } from "../../../domain/dto";
|
|
3
|
-
import
|
|
4
|
-
export default class ContactAPI extends
|
|
5
|
-
constructor() {
|
|
6
|
-
super({
|
|
7
|
-
module: ModuleNames.CONTACTS
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
2
|
+
import { IContactRepository } from "../../../domain/interfaces/repositories";
|
|
3
|
+
export default class ContactAPI extends IContactRepository {
|
|
11
4
|
async getContacts() {
|
|
12
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getContactsRequest();
|
|
13
6
|
const operation = 'getContacts';
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { ModuleNames } from "../../../core/constants";
|
|
2
1
|
import { getMessagesRequest, deleteMessageRequest, getFullContentRequest, resendMessageRequest, sendAttachmentRequest, sendMessageRequest, initiateSessionRequest, searchMessagesRequest } from "../../../domain/dto";
|
|
3
|
-
import
|
|
4
|
-
export default class MessageAPI extends
|
|
5
|
-
constructor() {
|
|
6
|
-
super({
|
|
7
|
-
module: ModuleNames.MESSAGES
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
2
|
+
import { IMessageRepository } from "../../../domain/interfaces/repositories";
|
|
3
|
+
export default class MessageAPI extends IMessageRepository {
|
|
11
4
|
async getMessages() {
|
|
12
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getMessagesRequest();
|
|
13
6
|
const operation = 'getMessages';
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { ModuleNames } from "../../../core/constants";
|
|
2
1
|
import { updateSessionAssigneeRequest, getSessionsRequest, getSessionRequest, getSessionAttachmentsRequest, getSessionLastMessagesRequest, markSessionAsReadRequest, updateSessionStatusRequest } from "../../../domain/dto";
|
|
3
|
-
import
|
|
4
|
-
export default class SessionAPI extends
|
|
5
|
-
constructor() {
|
|
6
|
-
super({
|
|
7
|
-
module: ModuleNames.SESSIONS
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
2
|
+
import { ISessionRepository } from "../../../domain/interfaces/repositories";
|
|
3
|
+
export default class SessionAPI extends ISessionRepository {
|
|
11
4
|
async updateAssignee() {
|
|
12
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : updateSessionAssigneeRequest();
|
|
13
6
|
const operation = 'updateAssignee';
|