@or-sdk/hitl 0.36.2-beta.4067.0 → 0.36.2
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/CHANGELOG.md +9 -0
- package/dist/types/api/Agents.d.ts +0 -347
- package/dist/types/api/Agents.d.ts.map +1 -1
- package/dist/types/api/CannedMessages.d.ts +0 -168
- package/dist/types/api/CannedMessages.d.ts.map +1 -1
- package/dist/types/api/Conferences.d.ts +0 -120
- package/dist/types/api/Conferences.d.ts.map +1 -1
- package/dist/types/api/ContactRuleGroups.d.ts +0 -131
- package/dist/types/api/ContactRuleGroups.d.ts.map +1 -1
- package/dist/types/api/EventTemplates.d.ts +0 -135
- package/dist/types/api/EventTemplates.d.ts.map +1 -1
- package/dist/types/api/Filters.d.ts +0 -215
- package/dist/types/api/Filters.d.ts.map +1 -1
- package/dist/types/api/Listeners.d.ts +0 -137
- package/dist/types/api/Listeners.d.ts.map +1 -1
- package/dist/types/api/Migrations.d.ts +0 -222
- package/dist/types/api/Migrations.d.ts.map +1 -1
- package/dist/types/api/RuleGroups.d.ts +0 -127
- package/dist/types/api/RuleGroups.d.ts.map +1 -1
- package/dist/types/api/SessionEvents.d.ts +0 -145
- package/dist/types/api/SessionEvents.d.ts.map +1 -1
- package/dist/types/api/Sessions.d.ts +0 -454
- package/dist/types/api/Sessions.d.ts.map +1 -1
- package/dist/types/api/Settings.d.ts +0 -145
- package/dist/types/api/Settings.d.ts.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.36.2](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/hitl@0.36.1...@or-sdk/hitl@0.36.2) (2026-03-31)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **hitl:** add param for reopen session method ([c33f44e](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/commit/c33f44ecfd9d13943a73997b80d682b0bb845b5e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## [0.36.1](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/hitl@0.36.0...@or-sdk/hitl@0.36.1) (2026-02-25)
|
|
7
16
|
|
|
8
17
|
**Note:** Version bump only for package @or-sdk/hitl
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import { Agent, GetAgentStatusResponse, GetCompleteAgentsOptions, GetCompleteAgentByIdOptions, AgentStatusOptions, SetAgentStatusOptions, GetAgentsOptions, GetAgentsResponse, SearchAgentsOptions, SearchAgentsResponse, UpdateAgentOptions, UpdateAgentResponse, UpdateAgentRuleGroupsOptions, UpdateAgentRuleGroupsResponse, UpdateAgentsStatusByQueryOptions } from '../types/agents';
|
|
2
2
|
import { HITLBase } from './HITLBase';
|
|
3
|
-
/**
|
|
4
|
-
* Manages HitL (Human-in-the-Loop) agents in the system
|
|
5
|
-
*
|
|
6
|
-
* This class provides functionality to:
|
|
7
|
-
* - Retrieve and search agents
|
|
8
|
-
* - Manage agent permissions, status, and additional meta information
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* - All methods in this class interact with the `/agents` endpoint
|
|
12
|
-
* - For the methods `getAgentStatus`, `setAgentStatus`, and `updateAgentsStatusByQuery`, you must pass `{ version: 2 }` in the parameters for the method to execute correctly.
|
|
13
|
-
*
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
3
|
export declare class Agents extends HITLBase {
|
|
17
4
|
protected static MODULE_URL: string;
|
|
18
5
|
protected static AGENT_SEARCH_URL: string;
|
|
@@ -23,352 +10,18 @@ export declare class Agents extends HITLBase {
|
|
|
23
10
|
protected static PING_AGENT_STATUS_URL: string;
|
|
24
11
|
protected static AGENT_STATUS_URL: string;
|
|
25
12
|
protected static UPDATE_AGENTS_STATUS_BY_QUERY_URL: string;
|
|
26
|
-
/**
|
|
27
|
-
* Gets a list of agents with HITL (Human in the Loop) information
|
|
28
|
-
*
|
|
29
|
-
* @param options - Configuration parameters for the agent list request
|
|
30
|
-
*
|
|
31
|
-
* Optional parameters:
|
|
32
|
-
* - `agentIds` - (string[]) List of specific agent identifiers to retrieve
|
|
33
|
-
* - `projection` - (string[]) List of fields to include in the response
|
|
34
|
-
* - `limit` - (number) Maximum number of agents to return
|
|
35
|
-
* - `offset` - (number) Number of agents to skip for pagination
|
|
36
|
-
* - `orderBy` - (string) Field name to order the results by
|
|
37
|
-
* - `order` - ('asc'|'desc') Order direction
|
|
38
|
-
* - `version` - (number) API version
|
|
39
|
-
* - `timeout` - (number) Search timeout in milliseconds
|
|
40
|
-
*
|
|
41
|
-
* @returns {Promise<GetAgentsResponse>} Promise resolving to:
|
|
42
|
-
* - `data` - Array of partial agent objects {@link Agent}
|
|
43
|
-
* - `last` - Optional pagination information:
|
|
44
|
-
* - `id` - Optional ID of the last agent in the list
|
|
45
|
-
* - `accountId` - Optional account ID of the last agent
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```typescript
|
|
49
|
-
* const response = await hitlApi.agents.getAgents({
|
|
50
|
-
* limit: 10,
|
|
51
|
-
* offset: 0,
|
|
52
|
-
* orderBy: 'createdAt',
|
|
53
|
-
* order: 'desc'
|
|
54
|
-
* });
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* Using projection and filtering by specific agents:
|
|
59
|
-
* ```typescript
|
|
60
|
-
* const response = await hitlApi.agents.getAgents({
|
|
61
|
-
* agentIds: ['agent1', 'agent2'],
|
|
62
|
-
* projection: ['id', 'name', 'statusData'],
|
|
63
|
-
* orderBy: 'name',
|
|
64
|
-
* order: 'asc'
|
|
65
|
-
* });
|
|
66
|
-
* ```
|
|
67
|
-
*
|
|
68
|
-
* @remarks
|
|
69
|
-
* Makes a GET request to the `/agents` endpoint
|
|
70
|
-
* @public
|
|
71
|
-
*/
|
|
72
13
|
static getAgents(options?: GetAgentsOptions): Promise<GetAgentsResponse>;
|
|
73
|
-
/**
|
|
74
|
-
* Get Agents list with full info (additional data from Users API DB)
|
|
75
|
-
*
|
|
76
|
-
* @param options - Configuration parameters for the complete agent list request
|
|
77
|
-
*
|
|
78
|
-
* Optional parameters:
|
|
79
|
-
* - `accountId` - (string) Account identifier to filter agents
|
|
80
|
-
* - `version` - (number) API version
|
|
81
|
-
* - `timeout` - (number) Search timeout in milliseconds
|
|
82
|
-
*
|
|
83
|
-
* @returns {Promise<GetAgentsResponse>} Promise resolving to:
|
|
84
|
-
* - `data` - Array of partial agent objects with complete information
|
|
85
|
-
* - `last` - Optional pagination information
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```typescript
|
|
89
|
-
* const response = await hitlApi.agents.getCompleteAgents();
|
|
90
|
-
* ```
|
|
91
|
-
*
|
|
92
|
-
* @remarks
|
|
93
|
-
* Makes a GET request to the `/agents/complete` endpoint
|
|
94
|
-
* @public
|
|
95
|
-
*/
|
|
96
14
|
static getCompleteAgents(options?: GetCompleteAgentsOptions): Promise<GetAgentsResponse>;
|
|
97
|
-
/**
|
|
98
|
-
* Get Agent with full info (additional data from Users API DB)
|
|
99
|
-
*
|
|
100
|
-
* @param options - Configuration parameters for retrieving a complete agent
|
|
101
|
-
*
|
|
102
|
-
* Required parameters:
|
|
103
|
-
* - `agentId` - (string) Identifier of the agent to retrieve complete information for
|
|
104
|
-
*
|
|
105
|
-
* Optional parameters:
|
|
106
|
-
* - `multiUserId` - (string) Multi-user identifier
|
|
107
|
-
* - `accountId` - (string) Account identifier
|
|
108
|
-
* - `version` - (number) API version
|
|
109
|
-
* - `timeout` - (number) Search timeout in milliseconds
|
|
110
|
-
*
|
|
111
|
-
* @returns {Promise<Agent>} Promise resolving to a complete agent object
|
|
112
|
-
*
|
|
113
|
-
* @example
|
|
114
|
-
* ```typescript
|
|
115
|
-
* const agent = await hitlApi.agents.getCompleteAgentById({
|
|
116
|
-
* agentId: 'agent-id',
|
|
117
|
-
* multiUserId: 'multi-id-2'
|
|
118
|
-
* });
|
|
119
|
-
* ```
|
|
120
|
-
*
|
|
121
|
-
* @remarks
|
|
122
|
-
* Makes a GET request to the `/agents/complete/:agentId` endpoint
|
|
123
|
-
* @public
|
|
124
|
-
*/
|
|
125
15
|
static getCompleteAgentById({ accountId, multiUserId, ...options }: GetCompleteAgentByIdOptions & {
|
|
126
16
|
accountId?: string;
|
|
127
17
|
}): Promise<Agent>;
|
|
128
|
-
/**
|
|
129
|
-
* Search Agents by Rule Groups, status etc.
|
|
130
|
-
*
|
|
131
|
-
* @param options - Configuration parameters for the agent search
|
|
132
|
-
*
|
|
133
|
-
* Optional parameters:
|
|
134
|
-
* - `contactRuleGroupIds` - (string[]) Array of contact rule group identifiers
|
|
135
|
-
* - `excludeAgentIds` - (string[]) Array of agent IDs to exclude
|
|
136
|
-
* - `projection` - (string[]) List of fields to include in response
|
|
137
|
-
* - `ruleGroupIds` - (string[]) Array of rule group identifiers to filter by
|
|
138
|
-
* - `ruleTags` - (string[]) Array of rule tags to filter by
|
|
139
|
-
* - `statuses` - ({@link AgentsStatusForSearch}[]) Array of agent statuses
|
|
140
|
-
* - `timeout` - (number) Search timeout in milliseconds
|
|
141
|
-
* - `version` - (string|number) API version
|
|
142
|
-
*
|
|
143
|
-
* @returns {Promise<SearchAgentsResponse>} Promise resolving to:
|
|
144
|
-
* - `data` - Array of partial agent objects matching the search criteria
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```typescript
|
|
148
|
-
* const response = await hitlApi.agents.searchAgents({
|
|
149
|
-
* ruleGroupIds: ['group1', 'group2'],
|
|
150
|
-
* statuses: ['AVAILABLE', 'BUSY'],
|
|
151
|
-
* projection: ['id', 'name', 'statusData']
|
|
152
|
-
* });
|
|
153
|
-
* ```
|
|
154
|
-
*
|
|
155
|
-
* @remarks
|
|
156
|
-
* Makes a POST request to the `/agents/search` endpoint
|
|
157
|
-
* @public
|
|
158
|
-
*/
|
|
159
18
|
static searchAgents(options?: SearchAgentsOptions): Promise<SearchAgentsResponse>;
|
|
160
|
-
/**
|
|
161
|
-
* Updates an agent
|
|
162
|
-
*
|
|
163
|
-
* @param options - Configuration parameters for the agent update request
|
|
164
|
-
*
|
|
165
|
-
* Required parameters:
|
|
166
|
-
* - `agentId` - (string) Identifier of the agent to update
|
|
167
|
-
*
|
|
168
|
-
* Optional parameters:
|
|
169
|
-
* - `ruleGroupIds` - (string[]) Array of rule group identifiers
|
|
170
|
-
* - `contactRuleGroupIds` - (string[]) Array of contact rule group identifiers
|
|
171
|
-
* - `meta` - (Object) Metadata object for the agent
|
|
172
|
-
* - `version` - (number) API version
|
|
173
|
-
* - `timeout` - (number) Search timeout in milliseconds
|
|
174
|
-
*
|
|
175
|
-
* @returns {Promise<UpdateAgentResponse>} Promise resolving to a partial agent object with updated information
|
|
176
|
-
*
|
|
177
|
-
* @example
|
|
178
|
-
* ```typescript
|
|
179
|
-
* const updatedAgent = await hitlApi.agents.updateAgent({
|
|
180
|
-
* agentId: 'agent-id',
|
|
181
|
-
* ruleGroupIds: ['group1', 'group2'],
|
|
182
|
-
* meta: {
|
|
183
|
-
* department: 'Support',
|
|
184
|
-
* skills: ['chat', 'voice']
|
|
185
|
-
* }
|
|
186
|
-
* });
|
|
187
|
-
* ```
|
|
188
|
-
*
|
|
189
|
-
* @remarks
|
|
190
|
-
* Makes a PUT request to the `/agents` endpoint with agentId as a query parameter
|
|
191
|
-
* @public
|
|
192
|
-
*/
|
|
193
19
|
static updateAgent({ agentId, ...options }: UpdateAgentOptions): Promise<UpdateAgentResponse>;
|
|
194
|
-
/**
|
|
195
|
-
* Update Rule Groups for Agent
|
|
196
|
-
*
|
|
197
|
-
* @param options - Configuration parameters for updating agent rule groups
|
|
198
|
-
*
|
|
199
|
-
* Required parameters:
|
|
200
|
-
* - `agentId` - (string) Identifier of the agent to update
|
|
201
|
-
*
|
|
202
|
-
* Optional parameters:
|
|
203
|
-
* - `addRuleGroupIds` - (string[]) Array of rule group IDs to add
|
|
204
|
-
* - `removeRuleGroupIds` - (string[]) Array of rule group IDs to remove
|
|
205
|
-
* - `version` - (number) API version
|
|
206
|
-
* - `timeout` - (number) Search timeout in milliseconds
|
|
207
|
-
*
|
|
208
|
-
* @returns {Promise<UpdateAgentRuleGroupsResponse>} Promise resolving to a partial agent object with updated rule groups
|
|
209
|
-
*
|
|
210
|
-
* @example
|
|
211
|
-
* ```typescript
|
|
212
|
-
* const updatedAgent = await hitlApi.agents.updateAgentRuleGroups({
|
|
213
|
-
* agentId: 'agent-id',
|
|
214
|
-
* addRuleGroupIds: ['group1', 'group2'],
|
|
215
|
-
* removeRuleGroupIds: ['group3', 'group4']
|
|
216
|
-
* });
|
|
217
|
-
* ```
|
|
218
|
-
*
|
|
219
|
-
* @remarks
|
|
220
|
-
* Makes a PUT request to the `/agents/rule-groups` endpoint with agentId as a query parameter
|
|
221
|
-
* @public
|
|
222
|
-
*/
|
|
223
20
|
static updateAgentRuleGroups({ agentId, ...options }: UpdateAgentRuleGroupsOptions): Promise<UpdateAgentRuleGroupsResponse>;
|
|
224
|
-
/**
|
|
225
|
-
* Update Contact Rule Groups for Agent
|
|
226
|
-
*
|
|
227
|
-
* @param options - Configuration parameters for updating agent contact rule groups
|
|
228
|
-
*
|
|
229
|
-
* Required parameters:
|
|
230
|
-
* - `agentId` - (string) Identifier of the agent to update
|
|
231
|
-
*
|
|
232
|
-
* Optional parameters:
|
|
233
|
-
* - `addRuleGroupIds` - (string[]) Array of rule group IDs to add
|
|
234
|
-
* - `removeRuleGroupIds` - (string[]) Array of rule group IDs to remove
|
|
235
|
-
* - `version` - (number) API version
|
|
236
|
-
* - `timeout` - (number) Search timeout in milliseconds
|
|
237
|
-
*
|
|
238
|
-
* @returns {Promise<UpdateAgentRuleGroupsResponse>} Promise resolving to a partial agent object with updated rule groups
|
|
239
|
-
*
|
|
240
|
-
* @example
|
|
241
|
-
* ```typescript
|
|
242
|
-
* const updatedAgent = await hitlApi.agents.updateAgentContactRuleGroups({
|
|
243
|
-
* agentId: 'agent-id',
|
|
244
|
-
* addRuleGroupIds: ['group1', 'group2'],
|
|
245
|
-
* removeRuleGroupIds: ['group3', 'group4']
|
|
246
|
-
* });
|
|
247
|
-
* ```
|
|
248
|
-
*
|
|
249
|
-
* @remarks
|
|
250
|
-
* Makes a PUT request to the `/agents/contact-rule-groups` endpoint with agentId as a query parameter
|
|
251
|
-
* @public
|
|
252
|
-
*/
|
|
253
21
|
static updateAgentContactRuleGroups({ agentId, ...options }: UpdateAgentRuleGroupsOptions): Promise<UpdateAgentRuleGroupsResponse>;
|
|
254
|
-
/**
|
|
255
|
-
* Gets agent status
|
|
256
|
-
*
|
|
257
|
-
* @param options - Configuration parameters for retrieving agent status
|
|
258
|
-
*
|
|
259
|
-
* Optional parameters:
|
|
260
|
-
* - `agentId` - (string) Identifier of the agent
|
|
261
|
-
* - `version` - (number) API version
|
|
262
|
-
* - `timeout` - (number) Search timeout in milliseconds
|
|
263
|
-
*
|
|
264
|
-
* @returns {Promise<GetAgentStatusResponse>} Promise resolving to agent status object
|
|
265
|
-
*
|
|
266
|
-
* @example
|
|
267
|
-
* ```typescript
|
|
268
|
-
* const status = await hitlApi.agents.getAgentStatus({
|
|
269
|
-
* agentId: 'agent-id',
|
|
270
|
-
* version: 2
|
|
271
|
-
* });
|
|
272
|
-
* ```
|
|
273
|
-
*
|
|
274
|
-
* @remarks
|
|
275
|
-
* Makes a GET request to the `/agents/agent-status` endpoint or `/agents/status` endpoint if version is 2
|
|
276
|
-
* @public
|
|
277
|
-
*/
|
|
278
22
|
static getAgentStatus(options?: AgentStatusOptions): Promise<GetAgentStatusResponse>;
|
|
279
|
-
/**
|
|
280
|
-
* Sends an agent status "ping" message to keep the agent "online"
|
|
281
|
-
*
|
|
282
|
-
* @param options - Configuration parameters for the agent status ping
|
|
283
|
-
*
|
|
284
|
-
* Optional parameters:
|
|
285
|
-
* - `agentId` - (string) Identifier of the agent
|
|
286
|
-
* - `version` - (number) API version
|
|
287
|
-
* - `timeout` - (number) Search timeout in milliseconds
|
|
288
|
-
*
|
|
289
|
-
* @returns {Promise<GetAgentStatusResponse>} Promise resolving to updated agent status
|
|
290
|
-
*
|
|
291
|
-
* @example
|
|
292
|
-
* ```typescript
|
|
293
|
-
* const status = await hitlApi.agents.pingAgentStatus();
|
|
294
|
-
* ```
|
|
295
|
-
*
|
|
296
|
-
* @remarks
|
|
297
|
-
* Makes a PUT request to the `/agents/ping-agent-status` endpoint
|
|
298
|
-
* @public
|
|
299
|
-
*/
|
|
300
23
|
static pingAgentStatus(options?: AgentStatusOptions): Promise<GetAgentStatusResponse>;
|
|
301
|
-
/**
|
|
302
|
-
* Set Agent status
|
|
303
|
-
*
|
|
304
|
-
* @param options - Configuration parameters for setting agent status
|
|
305
|
-
*
|
|
306
|
-
* Required parameters:
|
|
307
|
-
* - `agentId` - (string) Identifier of the agent
|
|
308
|
-
* - `statusData` - (Object) Status information:
|
|
309
|
-
*
|
|
310
|
-
* Optional parameters:
|
|
311
|
-
* - `notifyStatusChange` - (boolean) Flag to notify about status change
|
|
312
|
-
* - `statusChangeContext` - (Object) Context data for status change
|
|
313
|
-
* - `version` - (number) API version
|
|
314
|
-
* - `timeout` - (number) Search timeout in milliseconds
|
|
315
|
-
* @returns {Promise<void>} Promise that resolves when status is successfully set
|
|
316
|
-
*
|
|
317
|
-
* @example
|
|
318
|
-
* ```typescript
|
|
319
|
-
* await hitlApi.agents.setAgentStatus({
|
|
320
|
-
* agentId: 'agent-id',
|
|
321
|
-
* statusData: {
|
|
322
|
-
* key: 'busy',
|
|
323
|
-
* order: 1,
|
|
324
|
-
* status: 'BUSY',
|
|
325
|
-
* isBasic: true,
|
|
326
|
-
* expireIn: 60,
|
|
327
|
-
* canToggle: ['on', 'off']
|
|
328
|
-
* },
|
|
329
|
-
* statusChangeContext: {
|
|
330
|
-
* type: 'Manual',
|
|
331
|
-
* source: 'Agent UI'
|
|
332
|
-
* },
|
|
333
|
-
* notifyStatusChange: false,
|
|
334
|
-
* version: 2
|
|
335
|
-
* });
|
|
336
|
-
* ```
|
|
337
|
-
*
|
|
338
|
-
* @remarks
|
|
339
|
-
* Makes a PUT request to the `/agents/status` endpoint with agentId as a query parameter
|
|
340
|
-
* @public
|
|
341
|
-
*/
|
|
342
24
|
static setAgentStatus({ agentId, ...options }: SetAgentStatusOptions): Promise<void>;
|
|
343
|
-
/**
|
|
344
|
-
* Update Agents status by providing a raw SQL query
|
|
345
|
-
*
|
|
346
|
-
* @param options - Configuration parameters for updating agents' status
|
|
347
|
-
*
|
|
348
|
-
* Required parameters:
|
|
349
|
-
* - `query` - (string) SQL query or filter conditions to select agents
|
|
350
|
-
*
|
|
351
|
-
* Optional parameters:
|
|
352
|
-
* - `statusChangeContext` - (Object) Context data for status change
|
|
353
|
-
* - `maxRetries` - (number) Number of retry attempts for concurrent updates
|
|
354
|
-
* - `version` - (number) API version
|
|
355
|
-
* - `timeout` - (number) Search timeout in milliseconds
|
|
356
|
-
*
|
|
357
|
-
* @returns {Promise<any>} Promise resolving to the result of the batch update operation
|
|
358
|
-
*
|
|
359
|
-
* @example
|
|
360
|
-
* ```typescript
|
|
361
|
-
* const result = await hitlApi.agents.updateAgentsStatusByQuery({
|
|
362
|
-
* query: `UPDATE hitl.agents SET status_data = jsonb_set(status_data, '{key}', '"busy"') WHERE status_data->>'key'='available' RETURNING*`,
|
|
363
|
-
* maxRetries: 5,
|
|
364
|
-
* version: 2
|
|
365
|
-
* });
|
|
366
|
-
* ```
|
|
367
|
-
*
|
|
368
|
-
* @remarks
|
|
369
|
-
* Makes a PUT request to the `/agents/status/query` endpoint with retry mechanism for concurrent updates
|
|
370
|
-
* @public
|
|
371
|
-
*/
|
|
372
25
|
static updateAgentsStatusByQuery({ maxRetries, ...options }: UpdateAgentsStatusByQueryOptions): Promise<unknown>;
|
|
373
26
|
}
|
|
374
27
|
//# sourceMappingURL=Agents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agents.d.ts","sourceRoot":"","sources":["../../../src/api/Agents.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,EAGL,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,EAC3B,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,6BAA6B,EAC7B,gCAAgC,EACjC,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Agents.d.ts","sourceRoot":"","sources":["../../../src/api/Agents.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,EAGL,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,EAC3B,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,6BAA6B,EAC7B,gCAAgC,EACjC,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAetC,qBAAa,MAAO,SAAQ,QAAQ;IAClC,SAAS,CAAC,MAAM,CAAC,UAAU,SAAY;IACvC,SAAS,CAAC,MAAM,CAAC,gBAAgB,SAAY;IAC7C,SAAS,CAAC,MAAM,CAAC,eAAe,SAAc;IAC9C,SAAS,CAAC,MAAM,CAAC,oBAAoB,SAAkB;IACvD,SAAS,CAAC,MAAM,CAAC,qBAAqB,SAAiB;IACvD,SAAS,CAAC,MAAM,CAAC,6BAA6B,SAAyB;IACvE,SAAS,CAAC,MAAM,CAAC,qBAAqB,SAAuB;IAC7D,SAAS,CAAC,MAAM,CAAC,gBAAgB,SAAY;IAC7C,SAAS,CAAC,MAAM,CAAC,iCAAiC,SAAkB;WAgDhD,SAAS,CAC3B,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,iBAAiB,CAAC;WAoCT,iBAAiB,CACnC,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,iBAAiB,CAAC;WAwCT,oBAAoB,CACtC,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,EAAE,EAAE,2BAA2B,GAAG;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;KAAE,GAC5F,OAAO,CAAC,KAAK,CAAC;WAgDG,YAAY,CAC9B,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,oBAAoB,CAAC;WAgDZ,WAAW,CAC7B,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,kBAAkB,GAC1C,OAAO,CAAC,mBAAmB,CAAC;WA4CX,qBAAqB,CACvC,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,4BAA4B,GACpD,OAAO,CAAC,6BAA6B,CAAC;WA6CrB,4BAA4B,CAC9C,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,4BAA4B,GACpD,OAAO,CAAC,6BAA6B,CAAC;WAwCrB,cAAc,CAChC,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC;WAoCd,eAAe,CACjC,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC;WAsDd,cAAc,CAChC,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,qBAAqB,GAC7C,OAAO,CAAC,IAAI,CAAC;WA6CI,yBAAyB,CAC3C,EAAE,UAAc,EAAE,GAAG,OAAO,EAAE,EAAE,gCAAgC;CA8BnE"}
|
|
@@ -1,178 +1,10 @@
|
|
|
1
1
|
import { CannedMessage, GetCannedMessagesOptions, GetCannedMessagesResponse, CreateCannedMessageOptions, UpdateCannedMessageOptions, DeleteCannedMessageOptions } from '../types/canned-messages';
|
|
2
2
|
import { HITLBase } from './HITLBase';
|
|
3
|
-
/**
|
|
4
|
-
* Manages canned messages (predefined message templates) in the system
|
|
5
|
-
*
|
|
6
|
-
* This class provides functionality to create, retrieve, update, and delete canned messages.
|
|
7
|
-
* Canned messages are predefined templates that can be used for quick responses in various scenarios.
|
|
8
|
-
*
|
|
9
|
-
* Key features:
|
|
10
|
-
* - Manage message templates with categories and labels
|
|
11
|
-
* - Support for common (shared) messages across agents
|
|
12
|
-
* - Attachment handling capabilities
|
|
13
|
-
* - Rule-based tagging system
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* Basic usage:
|
|
17
|
-
* ```typescript
|
|
18
|
-
* // Get all canned messages
|
|
19
|
-
* const messages = await hitlApi.cannedMessages.getCannedMessages();
|
|
20
|
-
*
|
|
21
|
-
* // Create a new template
|
|
22
|
-
* const newTemplate = await hitlApi.cannedMessages.createCannedMessage({
|
|
23
|
-
* category: 'greeting',
|
|
24
|
-
* text: 'Hello! How can I help you today?',
|
|
25
|
-
* isCommon: true
|
|
26
|
-
* });
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* - All methods in this class interact with the `/canned-messages` endpoint
|
|
31
|
-
* - These methods are available only when you pass `{ version: 1 }` in the parameters.
|
|
32
|
-
* @public
|
|
33
|
-
*/
|
|
34
3
|
export declare class CannedMessages extends HITLBase {
|
|
35
4
|
protected static MODULE_URL: string;
|
|
36
|
-
/**
|
|
37
|
-
* Gets a list of canned messages (message templates)
|
|
38
|
-
*
|
|
39
|
-
* @param options - Configuration parameters for the canned messages list request
|
|
40
|
-
*
|
|
41
|
-
* Optional parameters:
|
|
42
|
-
* - `agentId` - (string) Filter messages by specific agent
|
|
43
|
-
* - `categories` - (string[]) Filter by message categories
|
|
44
|
-
* - `id` - (string) Get specific message by ID
|
|
45
|
-
* - `ignoreRuleTags` - (boolean) Whether to ignore rule tags in filtering
|
|
46
|
-
* - `isCommon` - (boolean) Filter by system or personal message status
|
|
47
|
-
* - `timeout` - (number) Request timeout in milliseconds
|
|
48
|
-
* - `version` - (string | number) API version to use
|
|
49
|
-
*
|
|
50
|
-
* @returns {Promise<GetCannedMessagesResponse | CannedMessage>} Promise resolving to:
|
|
51
|
-
* - `data` - Array of canned message objects {@link CannedMessage}
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```typescript
|
|
55
|
-
* const response = await hitlApi.cannedMessages.getCannedMessages({
|
|
56
|
-
* categories: ['support', 'greeting'],
|
|
57
|
-
* isCommon: true,
|
|
58
|
-
* agentId: 'agent-id-1'
|
|
59
|
-
* });
|
|
60
|
-
* ```
|
|
61
|
-
*
|
|
62
|
-
* @remarks
|
|
63
|
-
* Makes a GET request to the `/canned-messages` endpoint
|
|
64
|
-
* @public
|
|
65
|
-
*/
|
|
66
5
|
static getCannedMessages(options?: GetCannedMessagesOptions): Promise<GetCannedMessagesResponse | CannedMessage>;
|
|
67
|
-
/**
|
|
68
|
-
* Creates a new canned message (message template)
|
|
69
|
-
*
|
|
70
|
-
* @param options - Configuration parameters for creating the canned message
|
|
71
|
-
*
|
|
72
|
-
* Required parameters:
|
|
73
|
-
* - `category` - (string) Category of the message
|
|
74
|
-
* - `text` - (string) Content of the message
|
|
75
|
-
*
|
|
76
|
-
* Optional parameters:
|
|
77
|
-
* - `agentId` - (string) ID of the agent to associate with
|
|
78
|
-
* - `attachments` - (CannedMessageAttachment[]) Array of attachments
|
|
79
|
-
* - `isCommon` - (boolean) Whether the message is system or personal
|
|
80
|
-
* - `label` - (string) Label for the message
|
|
81
|
-
* - `ruleTags` - (string[]) Array of rule tags
|
|
82
|
-
* - `timeout` - (number) Request timeout in milliseconds
|
|
83
|
-
* - `version` - (string | number) API version to use
|
|
84
|
-
*
|
|
85
|
-
* @returns {Promise<CannedMessage>} Promise resolving to the created canned message
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```typescript
|
|
89
|
-
* const newMessage = await hitlApi.cannedMessages.createCannedMessage({
|
|
90
|
-
* category: 'support',
|
|
91
|
-
* text: "Thank you for your patience!",
|
|
92
|
-
* label: "Thank You Response",
|
|
93
|
-
* isCommon: true,
|
|
94
|
-
* ruleTags: ['greeting', 'sms'],
|
|
95
|
-
* attachments: [
|
|
96
|
-
* {
|
|
97
|
-
* "key": "IMAGE.JPG"
|
|
98
|
-
* }
|
|
99
|
-
* ]
|
|
100
|
-
* });
|
|
101
|
-
* ```
|
|
102
|
-
*
|
|
103
|
-
* @remarks
|
|
104
|
-
* Makes a POST request to the `/canned-messages` endpoint
|
|
105
|
-
* @public
|
|
106
|
-
*/
|
|
107
6
|
static createCannedMessage({ isCommon, agentId, ...options }: CreateCannedMessageOptions): Promise<CannedMessage>;
|
|
108
|
-
/**
|
|
109
|
-
* Updates an existing canned message (message template)
|
|
110
|
-
*
|
|
111
|
-
* @param options - Configuration parameters for updating the canned message
|
|
112
|
-
*
|
|
113
|
-
* Required parameters:
|
|
114
|
-
* - `id` - (string) Unique identifier of the message to update
|
|
115
|
-
*
|
|
116
|
-
* Optional parameters:
|
|
117
|
-
* - `attachments` - (CannedMessageAttachment[]) Array of attachments
|
|
118
|
-
* - `category` - (string) New category for the message
|
|
119
|
-
* - `label` - (string) New label for the message
|
|
120
|
-
* - `ruleTags` - (string[]) New array of rule tags
|
|
121
|
-
* - `text` - (string) New content of the message
|
|
122
|
-
* - `timeout` - (number) Request timeout in milliseconds
|
|
123
|
-
* - `version` - (string | number) API version to use
|
|
124
|
-
*
|
|
125
|
-
* System fields (automatically managed):
|
|
126
|
-
* - `createdAt` - (Date) Creation timestamp
|
|
127
|
-
* - `updatedAt` - (Date) Last update timestamp
|
|
128
|
-
*
|
|
129
|
-
* @returns {Promise<CannedMessage>} Promise resolving to the updated canned message
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
132
|
-
* ```typescript
|
|
133
|
-
* const updatedMessage = await hitlApi.cannedMessages.updateCannedMessage({
|
|
134
|
-
* id: "msg-id-1",
|
|
135
|
-
* text: "Updated response text",
|
|
136
|
-
* category: "support",
|
|
137
|
-
* ruleTags: ['sms', 'admin'],
|
|
138
|
-
* attachments: [
|
|
139
|
-
* {
|
|
140
|
-
* "key": "IMAGE_2.JPG"
|
|
141
|
-
* }
|
|
142
|
-
* ]
|
|
143
|
-
* });
|
|
144
|
-
* ```
|
|
145
|
-
*
|
|
146
|
-
* @remarks
|
|
147
|
-
* Makes a PUT request to the `/canned-messages` endpoint
|
|
148
|
-
* @public
|
|
149
|
-
*/
|
|
150
7
|
static updateCannedMessage(options: UpdateCannedMessageOptions): Promise<CannedMessage>;
|
|
151
|
-
/**
|
|
152
|
-
* Deletes a canned message (message template)
|
|
153
|
-
*
|
|
154
|
-
* @param options - Configuration parameters for deleting the canned message
|
|
155
|
-
*
|
|
156
|
-
* Required parameters:
|
|
157
|
-
* - `id` - (string) Unique identifier of the message to delete
|
|
158
|
-
*
|
|
159
|
-
* Optional parameters:
|
|
160
|
-
* - `version` - (string | number) API version to use
|
|
161
|
-
* - `timeout` - (number) Request timeout in milliseconds
|
|
162
|
-
*
|
|
163
|
-
* @returns {Promise<void>} Promise that resolves when deletion is complete
|
|
164
|
-
*
|
|
165
|
-
* @example
|
|
166
|
-
* ```typescript
|
|
167
|
-
* await hitlApi.cannedMessages.deleteCannedMessage({
|
|
168
|
-
* id: "msg-id-1"
|
|
169
|
-
* });
|
|
170
|
-
* ```
|
|
171
|
-
*
|
|
172
|
-
* @remarks
|
|
173
|
-
* Makes a DELETE request to the `/canned-messages` endpoint
|
|
174
|
-
* @public
|
|
175
|
-
*/
|
|
176
8
|
static deleteCannedMessage({ id, ...options }: DeleteCannedMessageOptions): Promise<void>;
|
|
177
9
|
}
|
|
178
10
|
//# sourceMappingURL=CannedMessages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CannedMessages.d.ts","sourceRoot":"","sources":["../../../src/api/CannedMessages.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"CannedMessages.d.ts","sourceRoot":"","sources":["../../../src/api/CannedMessages.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAiCtC,qBAAa,cAAe,SAAQ,QAAQ;IAC1C,SAAS,CAAC,MAAM,CAAC,UAAU,SAAqB;WAgC5B,iBAAiB,CACnC,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,yBAAyB,GAAG,aAAa,CAAC;WAsDjC,mBAAmB,CACrC,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,0BAA0B,GAC5D,OAAO,CAAC,aAAa,CAAC;WA4DL,mBAAmB,CACrC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,aAAa,CAAC;WAuCL,mBAAmB,CACrC,EAAE,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,0BAA0B,GAC7C,OAAO,CAAC,IAAI,CAAC;CAUjB"}
|