@zohoim/client-sdk 1.0.0-poc70 → 1.0.0-poc71
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 +6 -1
- package/es/domain/dto/bots/getBotRequest.js +9 -0
- package/es/domain/dto/bots/index.js +2 -1
- package/es/domain/interfaces/repositories/bots/IBotRepository.js +7 -1
- package/es/infrastructure/api/bots/BotAPI.js +11 -1
- package/es/infrastructure/api/registry/bots/botAPIRegistry.js +7 -2
- package/es/infrastructure/repositories/bots/BotRepository.js +10 -1
- package/package.json +1 -1
|
@@ -12,9 +12,14 @@ export default class BotService extends IBotRepository {
|
|
|
12
12
|
return this.botRepository.getBots(request);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
async getBot(request) {
|
|
16
|
+
return this.botRepository.getBot(request);
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
toJSON() {
|
|
16
20
|
return {
|
|
17
|
-
getBots: this.getBots.bind(this)
|
|
21
|
+
getBots: this.getBots.bind(this),
|
|
22
|
+
getBot: this.getBot.bind(this)
|
|
18
23
|
};
|
|
19
24
|
}
|
|
20
25
|
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default as getBotsRequest } from "./getBotsRequest";
|
|
1
|
+
export { default as getBotsRequest } from "./getBotsRequest";
|
|
2
|
+
export { default as getBotRequest } from "./getBotRequest";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleNames } from "../../../../core/constants";
|
|
2
2
|
import BaseAPI from "../../../../infrastructure/api/BaseAPI";
|
|
3
|
-
import { getBotsRequest } from "../../../dto";
|
|
3
|
+
import { getBotsRequest, getBotRequest } from "../../../dto";
|
|
4
4
|
export default class IBotRepository extends BaseAPI {
|
|
5
5
|
constructor() {
|
|
6
6
|
super({
|
|
@@ -12,6 +12,12 @@ export default class IBotRepository extends BaseAPI {
|
|
|
12
12
|
async getBots() {
|
|
13
13
|
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getBotsRequest();
|
|
14
14
|
throw new Error('Method not implemented');
|
|
15
|
+
} // eslint-disable-next-line no-unused-vars
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
async getBot() {
|
|
19
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getBotRequest();
|
|
20
|
+
throw new Error('Method not implemented');
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getBotsRequest } from "../../../domain/dto";
|
|
1
|
+
import { getBotsRequest, getBotRequest } from "../../../domain/dto";
|
|
2
2
|
import { IBotRepository } from "../../../domain/interfaces/repositories";
|
|
3
3
|
export default class BotAPI extends IBotRepository {
|
|
4
4
|
async getBots() {
|
|
@@ -11,4 +11,14 @@ export default class BotAPI extends IBotRepository {
|
|
|
11
11
|
return httpRequest;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
async getBot() {
|
|
15
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getBotRequest();
|
|
16
|
+
const operation = 'getBot';
|
|
17
|
+
const httpRequest = await this.request({
|
|
18
|
+
request,
|
|
19
|
+
operation
|
|
20
|
+
});
|
|
21
|
+
return httpRequest;
|
|
22
|
+
}
|
|
23
|
+
|
|
14
24
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTTP_METHODS } from "../../../../core/constants";
|
|
2
|
-
import { getBotsRequest } from "../../../../domain/dto";
|
|
2
|
+
import { getBotsRequest, getBotRequest } from "../../../../domain/dto";
|
|
3
3
|
import createAPIRegistry from "../createAPIRegistry";
|
|
4
4
|
import constructBotEndPoint from "./constructBotEndPoint";
|
|
5
5
|
|
|
@@ -7,6 +7,11 @@ function getBots() {
|
|
|
7
7
|
return createAPIRegistry(constructBotEndPoint(), HTTP_METHODS.GET, getBotsRequest());
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
function getBot() {
|
|
11
|
+
return createAPIRegistry(constructBotEndPoint('/:botId'), HTTP_METHODS.GET, getBotRequest());
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
export default {
|
|
11
|
-
getBots
|
|
15
|
+
getBots,
|
|
16
|
+
getBot
|
|
12
17
|
};
|
|
@@ -40,9 +40,18 @@ export default class BotRepository extends IBotRepository {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
async getBot(request) {
|
|
44
|
+
return this.invokeAPI({
|
|
45
|
+
operation: 'getBot',
|
|
46
|
+
request,
|
|
47
|
+
responseType: ResponseTypes.LIST
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
43
51
|
toJSON() {
|
|
44
52
|
return {
|
|
45
|
-
getBots: this.getBots.bind(this)
|
|
53
|
+
getBots: this.getBots.bind(this),
|
|
54
|
+
getBot: this.getBot.bind(this)
|
|
46
55
|
};
|
|
47
56
|
}
|
|
48
57
|
|