@zohoim/client-sdk 1.0.0-poc41 → 1.0.0-poc43
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/bots/BotService.js +21 -0
- package/es/application/services/channels/ChannelAgentService.js +21 -0
- package/es/application/services/channels/ChannelService.js +21 -0
- package/es/{domain → application}/services/channels/index.js +1 -1
- package/es/application/services/sessions/SessionService.js +21 -0
- package/es/{infrastructure/interfaces/api → domain/dto}/bots/getBotsRequest.js +2 -6
- package/es/domain/dto/channels/agents/getChannelAgentsRequest.js +13 -0
- package/es/{infrastructure/interfaces/api → domain/dto}/channels/getChannelsRequest.js +2 -6
- package/es/domain/dto/sessions/updateSessionAssigneeRequest.js +12 -0
- package/es/domain/interfaces/index.js +1 -3
- package/es/domain/interfaces/{bots/IBot.js → repositories/bots/IBotRepository.js} +2 -3
- package/es/domain/interfaces/repositories/bots/index.js +2 -0
- package/es/domain/interfaces/{channels/IChannelAgent.js → repositories/channels/IChannelAgentRepository.js} +2 -3
- package/es/domain/interfaces/{channels/IChannel.js → repositories/channels/IChannelRepository.js} +2 -3
- package/es/domain/interfaces/repositories/channels/index.js +3 -0
- package/es/domain/interfaces/repositories/index.js +3 -0
- package/es/domain/interfaces/{sessions/ISession.js → repositories/sessions/ISessionRepository.js} +2 -3
- package/es/domain/interfaces/repositories/sessions/index.js +2 -0
- package/es/{infrastructure → frameworks}/sdk/IMSDK.js +1 -1
- package/es/frameworks/sdk/bots/BotSDK.js +30 -0
- package/es/{infrastructure → frameworks}/sdk/channels/ChannelSDK.js +10 -3
- package/es/frameworks/sdk/sessions/SessionSDK.js +30 -0
- package/es/index.js +6 -6
- package/es/{domain/interfaces → infrastructure/api}/BaseAPI.js +24 -18
- package/es/infrastructure/api/bots/BotAPI.js +3 -3
- package/es/infrastructure/api/channels/ChannelAPI.js +3 -3
- package/es/infrastructure/api/channels/ChannelAgentAPI.js +3 -3
- package/es/{config → infrastructure/api}/registry/bots/botAPIRegistry.js +2 -2
- package/es/{config → infrastructure/api}/registry/channels/channelAPIRegistry.js +2 -2
- package/es/{config → infrastructure/api}/registry/channels/channelAgentAPIRegistry.js +2 -2
- package/es/{config → infrastructure/api}/registry/getRegistryConfig.js +1 -1
- package/es/{config → infrastructure/api}/registry/sessions/sessionAPIRegistry.js +2 -2
- package/es/infrastructure/api/sessions/SessionAPI.js +3 -3
- package/es/{domain/services/bots/BotService.js → infrastructure/repositories/bots/BotRepository.js} +4 -4
- package/es/infrastructure/repositories/bots/index.js +2 -0
- package/es/{domain/services/channels/ChannelAgentService.js → infrastructure/repositories/channels/ChannelAgentRepository.js} +4 -4
- package/es/{domain/services/channels/ChannelService.js → infrastructure/repositories/channels/ChannelRepository.js} +4 -4
- package/es/infrastructure/repositories/channels/index.js +3 -0
- package/es/infrastructure/repositories/index.js +3 -0
- package/es/{domain/services/sessions/SessionService.js → infrastructure/repositories/sessions/SessionRepository.js} +4 -4
- package/es/infrastructure/repositories/sessions/index.js +2 -0
- package/package.json +1 -1
- package/es/domain/interfaces/bots/index.js +0 -2
- package/es/domain/interfaces/channels/index.js +0 -3
- package/es/domain/interfaces/sessions/index.js +0 -2
- package/es/infrastructure/interfaces/api/base/index.js +0 -2
- package/es/infrastructure/interfaces/api/channels/agents/getChannelAgentsRequest.js +0 -19
- package/es/infrastructure/interfaces/api/sessions/updateSessionAssigneeRequest.js +0 -18
- package/es/infrastructure/interfaces/index.js +0 -1
- package/es/infrastructure/sdk/bots/BotSDK.js +0 -20
- package/es/infrastructure/sdk/sessions/SessionSDK.js +0 -20
- /package/es/{domain → application}/services/bots/index.js +0 -0
- /package/es/{domain → application}/services/index.js +0 -0
- /package/es/{domain → application}/services/sessions/index.js +0 -0
- /package/es/{infrastructure/interfaces/api/base → domain/dto}/RequestBuilder.js +0 -0
- /package/es/{infrastructure/interfaces/api → domain/dto}/bots/index.js +0 -0
- /package/es/{infrastructure/interfaces/api → domain/dto}/channels/agents/index.js +0 -0
- /package/es/{infrastructure/interfaces/api → domain/dto}/channels/index.js +0 -0
- /package/es/{infrastructure/interfaces/api → domain/dto}/index.js +0 -0
- /package/es/{infrastructure/interfaces/api → domain/dto}/sessions/index.js +0 -0
- /package/es/{infrastructure → frameworks}/managers/ModuleFactory.js +0 -0
- /package/es/{infrastructure → frameworks}/managers/ModuleManager.js +0 -0
- /package/es/{infrastructure → frameworks}/managers/index.js +0 -0
- /package/es/{infrastructure → frameworks}/sdk/bots/index.js +0 -0
- /package/es/{infrastructure → frameworks}/sdk/channels/index.js +0 -0
- /package/es/{infrastructure → frameworks}/sdk/index.js +0 -0
- /package/es/{infrastructure → frameworks}/sdk/sessions/index.js +0 -0
- /package/es/{config → infrastructure/api}/registry/bots/constructBotEndPoint.js +0 -0
- /package/es/{config → infrastructure/api}/registry/bots/index.js +0 -0
- /package/es/{config → infrastructure/api}/registry/channels/constructChannelEndPoint.js +0 -0
- /package/es/{config → infrastructure/api}/registry/channels/index.js +0 -0
- /package/es/{config → infrastructure/api}/registry/createAPIRegistry.js +0 -0
- /package/es/{config → infrastructure/api}/registry/createBaseUrl.js +0 -0
- /package/es/{config → infrastructure/api}/registry/index.js +0 -0
- /package/es/{config → infrastructure/api}/registry/sessions/constructSessionEndPoint.js +0 -0
- /package/es/{config → infrastructure/api}/registry/sessions/index.js +0 -0
- /package/es/infrastructure/{sdk/config → config}/configRegistry.js +0 -0
- /package/es/infrastructure/{sdk/config → config}/index.js +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IBotRepository } from "../../../domain/interfaces/repositories";
|
|
2
|
+
export default class BotService extends IBotRepository {
|
|
3
|
+
constructor(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
botRepository
|
|
6
|
+
} = _ref;
|
|
7
|
+
super();
|
|
8
|
+
this.botRepository = botRepository;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async getBots(request) {
|
|
12
|
+
return this.botRepository.getBots(request);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
getBots: this.getBots.bind(this)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IChannelAgentRepository } from "../../../domain/interfaces/repositories";
|
|
2
|
+
export default class ChannelAgentService extends IChannelAgentRepository {
|
|
3
|
+
constructor(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
channelAgentRepository
|
|
6
|
+
} = _ref;
|
|
7
|
+
super();
|
|
8
|
+
this.channelAgentRepository = channelAgentRepository;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async getAgents(request) {
|
|
12
|
+
return this.channelAgentRepository.getAgents(request);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
getAgents: this.getAgents.bind(this)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IChannelRepository } from "../../../domain/interfaces/repositories";
|
|
2
|
+
export default class ChannelService extends IChannelRepository {
|
|
3
|
+
constructor(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
channelRepository
|
|
6
|
+
} = _ref;
|
|
7
|
+
super();
|
|
8
|
+
this.channelRepository = channelRepository;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async getChannels(request) {
|
|
12
|
+
return this.channelRepository.getChannels(request);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
getChannels: this.getChannels.bind(this)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ISessionRepository } from "../../../domain/interfaces/repositories";
|
|
2
|
+
export default class SessionService extends ISessionRepository {
|
|
3
|
+
constructor(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
sessionRepository
|
|
6
|
+
} = _ref;
|
|
7
|
+
super();
|
|
8
|
+
this.sessionRepository = sessionRepository;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async updateAssignee(request) {
|
|
12
|
+
return this.sessionRepository.updateAssignee(request);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
updateAssignee: this.updateAssignee.bind(this)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import RequestBuilder from "../RequestBuilder";
|
|
2
2
|
|
|
3
3
|
function getBotsRequest() {
|
|
4
|
-
let {
|
|
5
|
-
query = {}
|
|
6
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
4
|
return new RequestBuilder().withQuery({
|
|
8
5
|
from: 0,
|
|
9
6
|
limit: 10,
|
|
@@ -11,8 +8,7 @@ function getBotsRequest() {
|
|
|
11
8
|
botServiceId: null,
|
|
12
9
|
externalAccountId: null,
|
|
13
10
|
searchStr: null,
|
|
14
|
-
isActive: false
|
|
15
|
-
...query
|
|
11
|
+
isActive: false
|
|
16
12
|
}).build();
|
|
17
13
|
}
|
|
18
14
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import RequestBuilder from "../../RequestBuilder";
|
|
2
|
+
|
|
3
|
+
function getChannelAgentsRequest() {
|
|
4
|
+
return new RequestBuilder().withQuery({
|
|
5
|
+
from: 0,
|
|
6
|
+
limit: 10,
|
|
7
|
+
searchStr: null
|
|
8
|
+
}).withParams({
|
|
9
|
+
channelId: null
|
|
10
|
+
}).build();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default getChannelAgentsRequest;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import RequestBuilder from "../RequestBuilder";
|
|
2
2
|
|
|
3
3
|
function getChannelsRequest() {
|
|
4
|
-
let {
|
|
5
|
-
query = {}
|
|
6
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
4
|
return new RequestBuilder().withQuery({
|
|
8
5
|
from: null,
|
|
9
6
|
limit: null,
|
|
@@ -19,8 +16,7 @@ function getChannelsRequest() {
|
|
|
19
16
|
channelIds: null,
|
|
20
17
|
include: null,
|
|
21
18
|
// meta|configParams
|
|
22
|
-
includeUnsubscribed: null
|
|
23
|
-
...query
|
|
19
|
+
includeUnsubscribed: null
|
|
24
20
|
}).build();
|
|
25
21
|
}
|
|
26
22
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import RequestBuilder from "../RequestBuilder";
|
|
2
|
+
|
|
3
|
+
function updateSessionAssigneeRequest() {
|
|
4
|
+
return new RequestBuilder().withParams({
|
|
5
|
+
sessionId: null
|
|
6
|
+
}).withBody({
|
|
7
|
+
agentId: null,
|
|
8
|
+
botId: null
|
|
9
|
+
}).build();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default updateSessionAssigneeRequest;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { getBotsRequest } from "../../../
|
|
2
|
-
|
|
3
|
-
export default class IBot extends BaseAPI {
|
|
1
|
+
import { getBotsRequest } from "../../../dto";
|
|
2
|
+
export default class IBotRepository {
|
|
4
3
|
// eslint-disable-next-line no-unused-vars
|
|
5
4
|
async getBots() {
|
|
6
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getBotsRequest();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { getChannelAgentsRequest } from "../../../
|
|
2
|
-
|
|
3
|
-
export default class IChannelAgent extends BaseAPI {
|
|
1
|
+
import { getChannelAgentsRequest } from "../../../dto";
|
|
2
|
+
export default class IChannelAgentRepository {
|
|
4
3
|
// eslint-disable-next-line no-unused-vars
|
|
5
4
|
getAgents() {
|
|
6
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getChannelAgentsRequest();
|
package/es/domain/interfaces/{channels/IChannel.js → repositories/channels/IChannelRepository.js}
RENAMED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { getChannelsRequest } from "../../../
|
|
2
|
-
|
|
3
|
-
export default class IChannel extends BaseAPI {
|
|
1
|
+
import { getChannelsRequest } from "../../../dto";
|
|
2
|
+
export default class IChannelRepository {
|
|
4
3
|
// eslint-disable-next-line no-unused-vars
|
|
5
4
|
getChannels() {
|
|
6
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getChannelsRequest();
|
package/es/domain/interfaces/{sessions/ISession.js → repositories/sessions/ISessionRepository.js}
RENAMED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { updateSessionAssigneeRequest } from "../../../
|
|
2
|
-
|
|
3
|
-
export default class ISession extends BaseAPI {
|
|
1
|
+
import { updateSessionAssigneeRequest } from "../../../dto";
|
|
2
|
+
export default class ISessionRepository {
|
|
4
3
|
// eslint-disable-next-line no-unused-vars
|
|
5
4
|
updateAssignee() {
|
|
6
5
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : updateSessionAssigneeRequest();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleNames } from "../../core/constants";
|
|
2
|
+
import configRegistry from "../../infrastructure/config/configRegistry";
|
|
2
3
|
import { ModuleManager } from "../managers";
|
|
3
|
-
import { configRegistry } from "./config";
|
|
4
4
|
export default class IMSDK {
|
|
5
5
|
constructor(_ref) {
|
|
6
6
|
let {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BotService } from "../../../application/services";
|
|
2
|
+
import { BotRepository } from "../../../infrastructure/repositories";
|
|
3
|
+
|
|
4
|
+
class BotSDK {
|
|
5
|
+
constructor(_ref) {
|
|
6
|
+
let {
|
|
7
|
+
config
|
|
8
|
+
} = _ref;
|
|
9
|
+
const {
|
|
10
|
+
botAPI,
|
|
11
|
+
botAdapter
|
|
12
|
+
} = config;
|
|
13
|
+
const botRepository = new BotRepository({
|
|
14
|
+
botAPI,
|
|
15
|
+
botAdapter
|
|
16
|
+
}).toJSON();
|
|
17
|
+
const botService = new BotService({
|
|
18
|
+
botRepository
|
|
19
|
+
}).toJSON();
|
|
20
|
+
this.services = { ...botService
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
toJSON() {
|
|
25
|
+
return this.services;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default BotSDK;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ChannelAgentService, ChannelService } from "../../../
|
|
1
|
+
import { ChannelAgentService, ChannelService } from "../../../application/services";
|
|
2
|
+
import { ChannelAgentRepository, ChannelRepository } from "../../../infrastructure/repositories";
|
|
2
3
|
export default class ChannelSDK {
|
|
3
4
|
constructor(_ref) {
|
|
4
5
|
let {
|
|
@@ -10,14 +11,20 @@ export default class ChannelSDK {
|
|
|
10
11
|
channelAgentAPI,
|
|
11
12
|
channelAgentAdapter
|
|
12
13
|
} = config;
|
|
13
|
-
const
|
|
14
|
+
const channelAgentRepository = new ChannelAgentRepository({
|
|
14
15
|
channelAgentAPI,
|
|
15
16
|
channelAgentAdapter
|
|
16
17
|
}).toJSON();
|
|
17
|
-
const
|
|
18
|
+
const channelRepository = new ChannelRepository({
|
|
18
19
|
channelAPI,
|
|
19
20
|
channelAdapter
|
|
20
21
|
}).toJSON();
|
|
22
|
+
const channelService = new ChannelService({
|
|
23
|
+
channelRepository
|
|
24
|
+
}).toJSON();
|
|
25
|
+
const channelAgentService = new ChannelAgentService({
|
|
26
|
+
channelAgentRepository
|
|
27
|
+
}).toJSON();
|
|
21
28
|
this.services = { ...channelService,
|
|
22
29
|
agents: channelAgentService
|
|
23
30
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SessionService } from "../../../application/services";
|
|
2
|
+
import { SessionRepository } from "../../../infrastructure/repositories";
|
|
3
|
+
|
|
4
|
+
class SessionSDK {
|
|
5
|
+
constructor(_ref) {
|
|
6
|
+
let {
|
|
7
|
+
config
|
|
8
|
+
} = _ref;
|
|
9
|
+
const {
|
|
10
|
+
sessionAPI,
|
|
11
|
+
sessionAdapter
|
|
12
|
+
} = config;
|
|
13
|
+
const sessionRepository = new SessionRepository({
|
|
14
|
+
sessionAPI,
|
|
15
|
+
sessionAdapter
|
|
16
|
+
}).toJSON();
|
|
17
|
+
const sessionService = new SessionService({
|
|
18
|
+
sessionRepository
|
|
19
|
+
}).toJSON();
|
|
20
|
+
this.services = { ...sessionService
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
toJSON() {
|
|
25
|
+
return this.services;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default SessionSDK;
|
package/es/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
// domain
|
|
2
|
+
export * from "./domain/dto";
|
|
1
3
|
export * from "./domain/entities";
|
|
2
4
|
export * from "./domain/enum";
|
|
3
|
-
export * from "./domain/interfaces";
|
|
4
|
-
|
|
5
|
-
export * from "./
|
|
6
|
-
|
|
7
|
-
export * from "./infrastructure/api";
|
|
8
|
-
export * from "./infrastructure/interfaces/api";
|
|
5
|
+
export * from "./domain/interfaces"; // frameworks
|
|
6
|
+
|
|
7
|
+
export * from "./frameworks/sdk"; // core
|
|
8
|
+
|
|
9
9
|
export * from "./core/constants";
|
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import configRegistry from "../config/configRegistry";
|
|
2
|
+
import { getRegistryConfig } from "./registry";
|
|
3
3
|
export default class BaseAPI {
|
|
4
|
-
constructor(
|
|
4
|
+
constructor() {
|
|
5
5
|
let {
|
|
6
|
-
module
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
module,
|
|
7
|
+
configProvider = configRegistry,
|
|
8
|
+
registryProvider = {
|
|
9
|
+
getRegistryConfig
|
|
10
|
+
}
|
|
11
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
12
|
+
this.configProvider = configProvider;
|
|
13
|
+
this.registryProvider = registryProvider;
|
|
14
|
+
this.httpClient = this.configProvider.getHttpClient();
|
|
15
|
+
this.baseURL = this.configProvider.getBaseURL();
|
|
10
16
|
this.module = module;
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
replacePathParams(url, params) {
|
|
14
20
|
let _url = url;
|
|
15
|
-
Object.entries(params).forEach(
|
|
16
|
-
let [key, value] =
|
|
21
|
+
Object.entries(params).forEach(_ref => {
|
|
22
|
+
let [key, value] = _ref;
|
|
17
23
|
_url = url.replace(`:${key}`, value);
|
|
18
24
|
});
|
|
19
25
|
return _url;
|
|
20
26
|
}
|
|
21
27
|
|
|
22
|
-
buildUrl(
|
|
28
|
+
buildUrl(_ref2) {
|
|
23
29
|
let {
|
|
24
30
|
url,
|
|
25
31
|
params,
|
|
26
32
|
query
|
|
27
|
-
} =
|
|
33
|
+
} = _ref2;
|
|
28
34
|
|
|
29
35
|
const _params = params || {};
|
|
30
36
|
|
|
@@ -46,24 +52,24 @@ export default class BaseAPI {
|
|
|
46
52
|
}
|
|
47
53
|
|
|
48
54
|
buildQuery(query) {
|
|
49
|
-
const filteredQuery = Object.entries(query).filter(
|
|
50
|
-
let [, value] =
|
|
55
|
+
const filteredQuery = Object.entries(query).filter(_ref3 => {
|
|
56
|
+
let [, value] = _ref3;
|
|
51
57
|
return value !== undefined && value !== null && value !== '';
|
|
52
|
-
}).reduce((acc,
|
|
53
|
-
let [key, value] =
|
|
58
|
+
}).reduce((acc, _ref4) => {
|
|
59
|
+
let [key, value] = _ref4;
|
|
54
60
|
acc[key] = value;
|
|
55
61
|
return acc;
|
|
56
62
|
}, {});
|
|
57
63
|
return new URLSearchParams(filteredQuery).toString();
|
|
58
64
|
}
|
|
59
65
|
|
|
60
|
-
async request(
|
|
66
|
+
async request(_ref5) {
|
|
61
67
|
let {
|
|
62
68
|
request,
|
|
63
69
|
operation,
|
|
64
70
|
header
|
|
65
|
-
} =
|
|
66
|
-
const config = getRegistryConfig(this.module, operation);
|
|
71
|
+
} = _ref5;
|
|
72
|
+
const config = this.registryProvider.getRegistryConfig(this.module, operation);
|
|
67
73
|
|
|
68
74
|
if (!config) {
|
|
69
75
|
throw new Error(`Operation "${operation}" not found in registry for module "${this.module}"`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModuleNames } from "../../../core/constants";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
export default class BotAPI extends
|
|
2
|
+
import { getBotsRequest } from "../../../domain/dto";
|
|
3
|
+
import BaseAPI from "../BaseAPI";
|
|
4
|
+
export default class BotAPI extends BaseAPI {
|
|
5
5
|
constructor() {
|
|
6
6
|
super({
|
|
7
7
|
module: ModuleNames.BOTS
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModuleNames } from "../../../core/constants";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
export default class ChannelAPI extends
|
|
2
|
+
import { getChannelsRequest } from "../../../domain/dto";
|
|
3
|
+
import BaseAPI from "../BaseAPI";
|
|
4
|
+
export default class ChannelAPI extends BaseAPI {
|
|
5
5
|
constructor() {
|
|
6
6
|
super({
|
|
7
7
|
module: ModuleNames.CHANNELS
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModuleNames } from "../../../core/constants";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
export default class ChannelAgentAPI extends
|
|
2
|
+
import { getChannelAgentsRequest } from "../../../domain/dto";
|
|
3
|
+
import BaseAPI from "../BaseAPI";
|
|
4
|
+
export default class ChannelAgentAPI extends BaseAPI {
|
|
5
5
|
constructor() {
|
|
6
6
|
super({
|
|
7
7
|
module: `${ModuleNames.CHANNELS}.agents`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HTTP_METHODS } from "
|
|
2
|
-
import { getBotsRequest } from "
|
|
1
|
+
import { HTTP_METHODS } from "../../../../core/constants";
|
|
2
|
+
import { getBotsRequest } from "../../../../domain/dto";
|
|
3
3
|
import createAPIRegistry from "../createAPIRegistry";
|
|
4
4
|
import constructBotEndPoint from "./constructBotEndPoint";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HTTP_METHODS } from "
|
|
2
|
-
import { getChannelsRequest } from "
|
|
1
|
+
import { HTTP_METHODS } from "../../../../core/constants";
|
|
2
|
+
import { getChannelsRequest } from "../../../../domain/dto";
|
|
3
3
|
import createAPIRegistry from "../createAPIRegistry";
|
|
4
4
|
import channelAgentAPIRegistry from "./channelAgentAPIRegistry";
|
|
5
5
|
import constructChannelEndPoint from "./constructChannelEndPoint";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HTTP_METHODS } from "
|
|
2
|
-
import { getChannelAgentsRequest } from "
|
|
1
|
+
import { HTTP_METHODS } from "../../../../core/constants";
|
|
2
|
+
import { getChannelAgentsRequest } from "../../../../domain/dto";
|
|
3
3
|
import createAPIRegistry from "../createAPIRegistry";
|
|
4
4
|
import constructChannelEndPoint from "./constructChannelEndPoint";
|
|
5
5
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import selectn from 'selectn';
|
|
2
2
|
import { channelAPIRegistry } from "./channels";
|
|
3
|
-
import { ModuleNames } from "../../core/constants";
|
|
4
3
|
import { sessionAPIRegistry } from "./sessions";
|
|
5
4
|
import { botAPIRegistry } from "./bots";
|
|
5
|
+
import { ModuleNames } from "../../../core/constants";
|
|
6
6
|
const APIRegistry = {
|
|
7
7
|
[ModuleNames.CHANNELS]: channelAPIRegistry,
|
|
8
8
|
[ModuleNames.SESSIONS]: sessionAPIRegistry,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HTTP_METHODS } from "
|
|
2
|
-
import { updateSessionAssigneeRequest } from "
|
|
1
|
+
import { HTTP_METHODS } from "../../../../core/constants";
|
|
2
|
+
import { updateSessionAssigneeRequest } from "../../../../domain/dto";
|
|
3
3
|
import createAPIRegistry from "../createAPIRegistry";
|
|
4
4
|
import constructSessionEndPoint from "./constructSessionEndPoint";
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModuleNames } from "../../../core/constants";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
export default class SessionAPI extends
|
|
2
|
+
import { updateSessionAssigneeRequest } from "../../../domain/dto";
|
|
3
|
+
import BaseAPI from "../BaseAPI";
|
|
4
|
+
export default class SessionAPI extends BaseAPI {
|
|
5
5
|
constructor() {
|
|
6
6
|
super({
|
|
7
7
|
module: ModuleNames.SESSIONS
|
package/es/{domain/services/bots/BotService.js → infrastructure/repositories/bots/BotRepository.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ResponseUtils } from "../../../core/utils";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export default class
|
|
2
|
+
import { IBotRepository } from "../../../domain/interfaces/repositories";
|
|
3
|
+
import { BotAdapter } from "../../adapters";
|
|
4
|
+
import { BotAPI } from "../../api";
|
|
5
|
+
export default class BotRepository extends IBotRepository {
|
|
6
6
|
constructor(_ref) {
|
|
7
7
|
let {
|
|
8
8
|
botAPI,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ResponseUtils } from "../../../core/utils";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export default class
|
|
2
|
+
import { IChannelAgentRepository } from "../../../domain/interfaces/repositories";
|
|
3
|
+
import { ChannelAgentAdapter } from "../../adapters";
|
|
4
|
+
import { ChannelAgentAPI } from "../../api";
|
|
5
|
+
export default class ChannelAgentRepository extends IChannelAgentRepository {
|
|
6
6
|
constructor(_ref) {
|
|
7
7
|
let {
|
|
8
8
|
channelAgentAPI,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ResponseUtils } from "../../../core/utils";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export default class
|
|
2
|
+
import { IChannelRepository } from "../../../domain/interfaces/repositories";
|
|
3
|
+
import { ChannelAdapter } from "../../adapters";
|
|
4
|
+
import { ChannelAPI } from "../../api";
|
|
5
|
+
export default class ChannelRepository extends IChannelRepository {
|
|
6
6
|
constructor() {
|
|
7
7
|
let {
|
|
8
8
|
channelAPI,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ResponseUtils } from "../../../core/utils";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export default class
|
|
2
|
+
import { ISessionRepository } from "../../../domain/interfaces/repositories";
|
|
3
|
+
import { SessionAdapter } from "../../adapters";
|
|
4
|
+
import { SessionAPI } from "../../api";
|
|
5
|
+
export default class SessionRepository extends ISessionRepository {
|
|
6
6
|
constructor(_ref) {
|
|
7
7
|
let {
|
|
8
8
|
sessionAPI,
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { RequestBuilder } from "../../base";
|
|
2
|
-
|
|
3
|
-
function getChannelAgentsRequest() {
|
|
4
|
-
let {
|
|
5
|
-
query = {},
|
|
6
|
-
params = {}
|
|
7
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8
|
-
return new RequestBuilder().withQuery({
|
|
9
|
-
from: 0,
|
|
10
|
-
limit: 10,
|
|
11
|
-
searchStr: null,
|
|
12
|
-
...query
|
|
13
|
-
}).withParams({
|
|
14
|
-
channelId: null,
|
|
15
|
-
...params
|
|
16
|
-
}).build();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default getChannelAgentsRequest;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { RequestBuilder } from "../base";
|
|
2
|
-
|
|
3
|
-
function updateSessionAssigneeRequest() {
|
|
4
|
-
let {
|
|
5
|
-
params = {},
|
|
6
|
-
body = {}
|
|
7
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8
|
-
return new RequestBuilder().withParams({
|
|
9
|
-
sessionId: null,
|
|
10
|
-
...params
|
|
11
|
-
}).withBody({
|
|
12
|
-
agentId: null,
|
|
13
|
-
botId: null,
|
|
14
|
-
...body
|
|
15
|
-
}).build();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default updateSessionAssigneeRequest;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./api";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BotService } from "../../../domain/services";
|
|
2
|
-
|
|
3
|
-
class BotSDK extends BotService {
|
|
4
|
-
constructor(_ref) {
|
|
5
|
-
let {
|
|
6
|
-
config
|
|
7
|
-
} = _ref;
|
|
8
|
-
const {
|
|
9
|
-
botAPI,
|
|
10
|
-
botAdapter
|
|
11
|
-
} = config;
|
|
12
|
-
super({
|
|
13
|
-
botAPI,
|
|
14
|
-
botAdapter
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default BotSDK;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SessionService } from "../../../domain/services";
|
|
2
|
-
|
|
3
|
-
class SessionSDK extends SessionService {
|
|
4
|
-
constructor(_ref) {
|
|
5
|
-
let {
|
|
6
|
-
config
|
|
7
|
-
} = _ref;
|
|
8
|
-
const {
|
|
9
|
-
sessionAPI,
|
|
10
|
-
sessionAdapter
|
|
11
|
-
} = config;
|
|
12
|
-
super({
|
|
13
|
-
sessionAPI,
|
|
14
|
-
sessionAdapter
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default SessionSDK;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|