@zohoim/client-sdk 1.0.0-poc64 → 1.0.0-poc65
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/core/constants/ResponseTypes.js +4 -0
- package/es/core/constants/index.js +2 -1
- package/es/infrastructure/api/BaseAPI.js +31 -3
- package/es/infrastructure/repositories/agents/AgentRepository.js +23 -9
- package/es/infrastructure/repositories/bots/BotRepository.js +23 -9
- package/es/infrastructure/repositories/channels/ChannelAgentRepository.js +23 -9
- package/es/infrastructure/repositories/channels/ChannelRepository.js +23 -9
- package/es/infrastructure/repositories/contacts/ContactRepository.js +23 -9
- package/es/infrastructure/repositories/messages/MessageRepository.js +54 -59
- package/es/infrastructure/repositories/sessions/SessionRepository.js +51 -57
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HttpMethods } from '@zohoim/http-client';
|
|
2
2
|
import ModuleNames from "./ModuleNames";
|
|
3
|
+
import { LIST, SINGLE, NONE } from "./ResponseTypes";
|
|
3
4
|
const IM_API_PREFIX = '/api/v1';
|
|
4
5
|
const HTTP_METHODS = HttpMethods;
|
|
5
|
-
export { ModuleNames, IM_API_PREFIX, HTTP_METHODS };
|
|
6
|
+
export { ModuleNames, IM_API_PREFIX, HTTP_METHODS, LIST, SINGLE, NONE };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LIST, NONE, SINGLE } from "../../core/constants";
|
|
2
|
+
import { ResponseUtils } from "../../core/utils";
|
|
1
3
|
import configRegistry from "../config/configRegistry";
|
|
2
4
|
import { getRegistryConfig } from "./registry";
|
|
3
5
|
export default class BaseAPI {
|
|
@@ -60,15 +62,18 @@ export default class BaseAPI {
|
|
|
60
62
|
acc[key] = value;
|
|
61
63
|
return acc;
|
|
62
64
|
}, {});
|
|
63
|
-
return
|
|
65
|
+
return Object.entries(filteredQuery).map(_ref5 => {
|
|
66
|
+
let [key, value] = _ref5;
|
|
67
|
+
return `${key}=${value}`;
|
|
68
|
+
}).join('&');
|
|
64
69
|
}
|
|
65
70
|
|
|
66
|
-
async request(
|
|
71
|
+
async request(_ref6) {
|
|
67
72
|
let {
|
|
68
73
|
request,
|
|
69
74
|
operation,
|
|
70
75
|
header
|
|
71
|
-
} =
|
|
76
|
+
} = _ref6;
|
|
72
77
|
const config = this.registryProvider.getRegistryConfig(this.module, operation);
|
|
73
78
|
|
|
74
79
|
if (!config) {
|
|
@@ -116,4 +121,27 @@ export default class BaseAPI {
|
|
|
116
121
|
Object.prototype.hasOwnProperty.call(customPrototype, methodName);
|
|
117
122
|
}
|
|
118
123
|
|
|
124
|
+
async executeAPICall(_ref7) {
|
|
125
|
+
let {
|
|
126
|
+
operation,
|
|
127
|
+
request,
|
|
128
|
+
apiProxy,
|
|
129
|
+
customAPI,
|
|
130
|
+
adapter,
|
|
131
|
+
responseType = SINGLE
|
|
132
|
+
} = _ref7;
|
|
133
|
+
const response = await apiProxy[operation](request);
|
|
134
|
+
const isOverridden = this.isMethodOverridden(customAPI, operation);
|
|
135
|
+
|
|
136
|
+
if (isOverridden) {
|
|
137
|
+
return response;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (responseType === NONE || !adapter) {
|
|
141
|
+
return response;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return responseType === LIST ? ResponseUtils.adaptListResponse(response, adapter.adapt) : ResponseUtils.adaptSingleResponse(response, adapter.adapt);
|
|
145
|
+
}
|
|
146
|
+
|
|
119
147
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ResponseUtils } from "../../../core/utils";
|
|
2
1
|
import { IAgentRepository } from "../../../domain/interfaces/repositories";
|
|
3
2
|
import { AgentAdapter } from "../../adapters";
|
|
4
3
|
import { AgentAPI } from "../../api";
|
|
4
|
+
import { LIST } from "../../../core/constants";
|
|
5
5
|
export default class AgentRepository extends IAgentRepository {
|
|
6
6
|
constructor(_ref) {
|
|
7
7
|
let {
|
|
@@ -15,15 +15,29 @@ export default class AgentRepository extends IAgentRepository {
|
|
|
15
15
|
this.agentAdapter = agentAdapter || new AgentAdapter();
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
async
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
18
|
+
async invokeAPI(_ref2) {
|
|
19
|
+
let {
|
|
20
|
+
operation,
|
|
21
|
+
request,
|
|
22
|
+
adapter = this.agentAdapter,
|
|
23
|
+
responseType
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return this.executeAPICall({
|
|
26
|
+
operation,
|
|
27
|
+
request,
|
|
28
|
+
apiProxy: this.agentAPI,
|
|
29
|
+
customAPI: this.customAPI,
|
|
30
|
+
adapter,
|
|
31
|
+
responseType
|
|
32
|
+
});
|
|
33
|
+
}
|
|
25
34
|
|
|
26
|
-
|
|
35
|
+
async getAgents(request) {
|
|
36
|
+
return this.invokeAPI({
|
|
37
|
+
operation: 'getAgents',
|
|
38
|
+
request,
|
|
39
|
+
responseType: LIST
|
|
40
|
+
});
|
|
27
41
|
}
|
|
28
42
|
|
|
29
43
|
toJSON() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ResponseUtils } from "../../../core/utils";
|
|
2
1
|
import { IBotRepository } from "../../../domain/interfaces/repositories";
|
|
3
2
|
import { BotAdapter } from "../../adapters";
|
|
4
3
|
import { BotAPI } from "../../api";
|
|
4
|
+
import { LIST } from "../../../core/constants";
|
|
5
5
|
export default class BotRepository extends IBotRepository {
|
|
6
6
|
constructor(_ref) {
|
|
7
7
|
let {
|
|
@@ -15,15 +15,29 @@ export default class BotRepository extends IBotRepository {
|
|
|
15
15
|
this.botAdapter = botAdapter || new BotAdapter();
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
async
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
18
|
+
async invokeAPI(_ref2) {
|
|
19
|
+
let {
|
|
20
|
+
operation,
|
|
21
|
+
request,
|
|
22
|
+
adapter = this.botAdapter,
|
|
23
|
+
responseType
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return this.executeAPICall({
|
|
26
|
+
operation,
|
|
27
|
+
request,
|
|
28
|
+
apiProxy: this.botAPI,
|
|
29
|
+
customAPI: this.customAPI,
|
|
30
|
+
adapter,
|
|
31
|
+
responseType
|
|
32
|
+
});
|
|
33
|
+
}
|
|
25
34
|
|
|
26
|
-
|
|
35
|
+
async getBots(request) {
|
|
36
|
+
return this.invokeAPI({
|
|
37
|
+
operation: 'getBots',
|
|
38
|
+
request,
|
|
39
|
+
responseType: LIST
|
|
40
|
+
});
|
|
27
41
|
}
|
|
28
42
|
|
|
29
43
|
toJSON() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ResponseUtils } from "../../../core/utils";
|
|
2
1
|
import { IChannelAgentRepository } from "../../../domain/interfaces/repositories";
|
|
3
2
|
import { ChannelAgentAdapter } from "../../adapters";
|
|
4
3
|
import { ChannelAgentAPI } from "../../api";
|
|
4
|
+
import { LIST } from "../../../core/constants";
|
|
5
5
|
export default class ChannelAgentRepository extends IChannelAgentRepository {
|
|
6
6
|
constructor(_ref) {
|
|
7
7
|
let {
|
|
@@ -15,15 +15,29 @@ export default class ChannelAgentRepository extends IChannelAgentRepository {
|
|
|
15
15
|
this.channelAgentAdapter = channelAgentAdapter || new ChannelAgentAdapter();
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
async
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
18
|
+
async invokeAPI(_ref2) {
|
|
19
|
+
let {
|
|
20
|
+
operation,
|
|
21
|
+
request,
|
|
22
|
+
adapter = this.channelAgentAdapter,
|
|
23
|
+
responseType
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return this.executeAPICall({
|
|
26
|
+
operation,
|
|
27
|
+
request,
|
|
28
|
+
apiProxy: this.channelAgentAPI,
|
|
29
|
+
customAPI: this.customAPI,
|
|
30
|
+
adapter,
|
|
31
|
+
responseType
|
|
32
|
+
});
|
|
33
|
+
}
|
|
25
34
|
|
|
26
|
-
|
|
35
|
+
async getAgents(request) {
|
|
36
|
+
return this.invokeAPI({
|
|
37
|
+
operation: 'getAgents',
|
|
38
|
+
request,
|
|
39
|
+
responseType: LIST
|
|
40
|
+
});
|
|
27
41
|
}
|
|
28
42
|
|
|
29
43
|
toJSON() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ResponseUtils } from "../../../core/utils";
|
|
2
1
|
import { IChannelRepository } from "../../../domain/interfaces/repositories";
|
|
3
2
|
import { ChannelAdapter } from "../../adapters";
|
|
4
3
|
import { ChannelAPI } from "../../api";
|
|
4
|
+
import { LIST } from "../../../core/constants";
|
|
5
5
|
export default class ChannelRepository extends IChannelRepository {
|
|
6
6
|
constructor() {
|
|
7
7
|
let {
|
|
@@ -15,15 +15,29 @@ export default class ChannelRepository extends IChannelRepository {
|
|
|
15
15
|
this.channelAdapter = channelAdapter || new ChannelAdapter();
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
async
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
18
|
+
async invokeAPI(_ref) {
|
|
19
|
+
let {
|
|
20
|
+
operation,
|
|
21
|
+
request,
|
|
22
|
+
adapter = this.channelAdapter,
|
|
23
|
+
responseType
|
|
24
|
+
} = _ref;
|
|
25
|
+
return this.executeAPICall({
|
|
26
|
+
operation,
|
|
27
|
+
request,
|
|
28
|
+
apiProxy: this.channelAPI,
|
|
29
|
+
customAPI: this.customAPI,
|
|
30
|
+
adapter,
|
|
31
|
+
responseType
|
|
32
|
+
});
|
|
33
|
+
}
|
|
25
34
|
|
|
26
|
-
|
|
35
|
+
async getChannels(request) {
|
|
36
|
+
return this.invokeAPI({
|
|
37
|
+
operation: 'getChannels',
|
|
38
|
+
request,
|
|
39
|
+
responseType: LIST
|
|
40
|
+
});
|
|
27
41
|
}
|
|
28
42
|
|
|
29
43
|
toJSON() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ResponseUtils } from "../../../core/utils";
|
|
2
1
|
import { IContactRepository } from "../../../domain/interfaces/repositories";
|
|
3
2
|
import { ContactAdapter } from "../../adapters";
|
|
4
3
|
import { ContactAPI } from "../../api";
|
|
4
|
+
import { LIST } from "../../../core/constants";
|
|
5
5
|
export default class ContactRepository extends IContactRepository {
|
|
6
6
|
constructor(_ref) {
|
|
7
7
|
let {
|
|
@@ -15,15 +15,29 @@ export default class ContactRepository extends IContactRepository {
|
|
|
15
15
|
this.contactAdapter = contactAdapter || new ContactAdapter();
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
async
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
18
|
+
async invokeAPI(_ref2) {
|
|
19
|
+
let {
|
|
20
|
+
operation,
|
|
21
|
+
request,
|
|
22
|
+
adapter = this.contactAdapter,
|
|
23
|
+
responseType
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return this.executeAPICall({
|
|
26
|
+
operation,
|
|
27
|
+
request,
|
|
28
|
+
apiProxy: this.contactAPI,
|
|
29
|
+
customAPI: this.customAPI,
|
|
30
|
+
adapter,
|
|
31
|
+
responseType
|
|
32
|
+
});
|
|
33
|
+
}
|
|
25
34
|
|
|
26
|
-
|
|
35
|
+
async getContacts(request) {
|
|
36
|
+
return this.invokeAPI({
|
|
37
|
+
operation: 'getContacts',
|
|
38
|
+
request,
|
|
39
|
+
responseType: LIST
|
|
40
|
+
});
|
|
27
41
|
}
|
|
28
42
|
|
|
29
43
|
toJSON() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MessageAdapter } from "../../adapters";
|
|
2
|
-
import { ResponseUtils } from "../../../core/utils";
|
|
3
2
|
import { MessageAPI } from "../../api";
|
|
4
3
|
import { IMessageRepository } from "../../../domain/interfaces/repositories/messages";
|
|
5
4
|
import MessageWithSessionAdapter from "../../adapters/messages/MessageWithSessionAdapter";
|
|
5
|
+
import { LIST, NONE } from "../../../core/constants";
|
|
6
6
|
export default class MessageRepository extends IMessageRepository {
|
|
7
7
|
constructor(_ref) {
|
|
8
8
|
let {
|
|
@@ -18,86 +18,81 @@ export default class MessageRepository extends IMessageRepository {
|
|
|
18
18
|
this.messageWithSessionAdapter = messageWithSessionAdapter || new MessageWithSessionAdapter();
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
async
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
21
|
+
async invokeAPI(_ref2) {
|
|
22
|
+
let {
|
|
23
|
+
operation,
|
|
24
|
+
request,
|
|
25
|
+
adapter = this.messageAdapter,
|
|
26
|
+
responseType
|
|
27
|
+
} = _ref2;
|
|
28
|
+
return this.executeAPICall({
|
|
29
|
+
operation,
|
|
30
|
+
request,
|
|
31
|
+
apiProxy: this.messageAPI,
|
|
32
|
+
customAPI: this.customAPI,
|
|
33
|
+
adapter,
|
|
34
|
+
responseType
|
|
35
|
+
});
|
|
36
|
+
}
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
async getMessages(request) {
|
|
39
|
+
return this.invokeAPI({
|
|
40
|
+
operation: 'getMessages',
|
|
41
|
+
request,
|
|
42
|
+
responseType: LIST
|
|
43
|
+
});
|
|
30
44
|
}
|
|
31
45
|
|
|
32
46
|
async getFullContent(request) {
|
|
33
|
-
|
|
34
|
-
|
|
47
|
+
return this.invokeAPI({
|
|
48
|
+
operation: 'getFullContent',
|
|
49
|
+
request,
|
|
50
|
+
responseType: NONE
|
|
51
|
+
});
|
|
35
52
|
}
|
|
36
53
|
|
|
37
54
|
async sendMessage(request) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return response;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return ResponseUtils.adaptSingleResponse(response, this.messageAdapter.adapt);
|
|
55
|
+
return this.invokeAPI({
|
|
56
|
+
operation: 'sendMessage',
|
|
57
|
+
request
|
|
58
|
+
});
|
|
46
59
|
}
|
|
47
60
|
|
|
48
61
|
async sendAttachment(request) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return response;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return ResponseUtils.adaptSingleResponse(response, this.messageAdapter.adapt);
|
|
62
|
+
return this.invokeAPI({
|
|
63
|
+
operation: 'sendAttachment',
|
|
64
|
+
request
|
|
65
|
+
});
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
async resendMessage(request) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return response;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return ResponseUtils.adaptSingleResponse(response, this.messageAdapter.adapt);
|
|
69
|
+
return this.invokeAPI({
|
|
70
|
+
operation: 'resendMessage',
|
|
71
|
+
request
|
|
72
|
+
});
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
async deleteMessage(request) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return response;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return ResponseUtils.adaptSingleResponse(response, this.messageAdapter.adapt);
|
|
76
|
+
return this.invokeAPI({
|
|
77
|
+
operation: 'deleteMessage',
|
|
78
|
+
request
|
|
79
|
+
});
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
async initiateSession(request) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return response;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return ResponseUtils.adaptSingleResponse(response, this.messageAdapter.adapt);
|
|
83
|
+
return this.invokeAPI({
|
|
84
|
+
operation: 'initiateSession',
|
|
85
|
+
request
|
|
86
|
+
});
|
|
90
87
|
}
|
|
91
88
|
|
|
92
89
|
async searchMessages(request) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return ResponseUtils.adaptListResponse(response, this.messageWithSessionAdapter.adapt);
|
|
90
|
+
return this.invokeAPI({
|
|
91
|
+
operation: 'searchMessages',
|
|
92
|
+
request,
|
|
93
|
+
adapter: this.messageWithSessionAdapter,
|
|
94
|
+
responseType: LIST
|
|
95
|
+
});
|
|
101
96
|
}
|
|
102
97
|
|
|
103
98
|
toJSON() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AttachmentAdapter, MessageAdapter, SessionAdapter } from "../../adapters/index";
|
|
2
|
-
import { ResponseUtils } from "../../../core/utils";
|
|
3
2
|
import { ISessionRepository } from "../../../domain/interfaces/repositories";
|
|
4
3
|
import { SessionAPI } from "../../api";
|
|
4
|
+
import { LIST } from "../../../core/constants";
|
|
5
5
|
export default class SessionRepository extends ISessionRepository {
|
|
6
6
|
constructor(_ref) {
|
|
7
7
|
let {
|
|
@@ -19,81 +19,75 @@ export default class SessionRepository extends ISessionRepository {
|
|
|
19
19
|
this.messageAdapter = messageAdapter || new MessageAdapter();
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
async
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
22
|
+
async invokeAPI(_ref2) {
|
|
23
|
+
let {
|
|
24
|
+
operation,
|
|
25
|
+
request,
|
|
26
|
+
adapter = this.sessionAdapter,
|
|
27
|
+
responseType
|
|
28
|
+
} = _ref2;
|
|
29
|
+
return this.executeAPICall({
|
|
30
|
+
operation,
|
|
31
|
+
request,
|
|
32
|
+
apiProxy: this.sessionAPI,
|
|
33
|
+
customAPI: this.customAPI,
|
|
34
|
+
adapter,
|
|
35
|
+
responseType
|
|
36
|
+
});
|
|
37
|
+
}
|
|
29
38
|
|
|
30
|
-
|
|
39
|
+
async updateAssignee(request) {
|
|
40
|
+
return this.invokeAPI({
|
|
41
|
+
operation: 'updateAssignee',
|
|
42
|
+
request
|
|
43
|
+
});
|
|
31
44
|
}
|
|
32
45
|
|
|
33
46
|
async getSessions(request) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return ResponseUtils.adaptListResponse(response, this.sessionAdapter.adapt);
|
|
47
|
+
return this.invokeAPI({
|
|
48
|
+
operation: 'getSessions',
|
|
49
|
+
request,
|
|
50
|
+
responseType: LIST
|
|
51
|
+
});
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
async getSession(request) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return response;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return ResponseUtils.adaptSingleResponse(response, this.sessionAdapter.adapt);
|
|
55
|
+
return this.invokeAPI({
|
|
56
|
+
operation: 'getSession',
|
|
57
|
+
request
|
|
58
|
+
});
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
async getSessionAttachments(request) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return ResponseUtils.adaptListResponse(response, this.attachmentAdapter.adapt);
|
|
62
|
+
return this.invokeAPI({
|
|
63
|
+
operation: 'getSessionAttachments',
|
|
64
|
+
request,
|
|
65
|
+
adapter: this.attachmentAdapter,
|
|
66
|
+
responseType: LIST
|
|
67
|
+
});
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
async getSessionLastMessages(request) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return ResponseUtils.adaptListResponse(response, this.messageAdapter.adapt);
|
|
71
|
+
return this.invokeAPI({
|
|
72
|
+
operation: 'getSessionLastMessages',
|
|
73
|
+
request,
|
|
74
|
+
adapter: this.messageAdapter,
|
|
75
|
+
responseType: LIST
|
|
76
|
+
});
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
async markSessionAsRead(request) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return response;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return ResponseUtils.adaptSingleResponse(response, this.sessionAdapter.adapt);
|
|
80
|
+
return this.invokeAPI({
|
|
81
|
+
operation: 'markSessionAsRead',
|
|
82
|
+
request
|
|
83
|
+
});
|
|
86
84
|
}
|
|
87
85
|
|
|
88
86
|
async updateSessionStatus(request) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return response;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return ResponseUtils.adaptSingleResponse(response, this.sessionAdapter.adapt);
|
|
87
|
+
return this.invokeAPI({
|
|
88
|
+
operation: 'updateSessionStatus',
|
|
89
|
+
request
|
|
90
|
+
});
|
|
97
91
|
}
|
|
98
92
|
|
|
99
93
|
toJSON() {
|