@or-sdk/hitl 0.36.5 → 0.37.0-beta.4145.0

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.
Files changed (86) hide show
  1. package/dist/cjs/HITL.js +1 -0
  2. package/dist/cjs/HITL.js.map +1 -1
  3. package/dist/cjs/api/Commands.js +2 -1
  4. package/dist/cjs/api/Commands.js.map +1 -1
  5. package/dist/cjs/api/ScheduledMessages.js +138 -0
  6. package/dist/cjs/api/ScheduledMessages.js.map +1 -0
  7. package/dist/cjs/api/Sessions.js.map +1 -1
  8. package/dist/cjs/api/index.js +3 -1
  9. package/dist/cjs/api/index.js.map +1 -1
  10. package/dist/cjs/types/index.js +2 -1
  11. package/dist/cjs/types/index.js.map +1 -1
  12. package/dist/cjs/types/scheduled-messages.js +3 -0
  13. package/dist/cjs/types/scheduled-messages.js.map +1 -0
  14. package/dist/esm/HITL.js +2 -1
  15. package/dist/esm/HITL.js.map +1 -1
  16. package/dist/esm/api/Commands.js +2 -1
  17. package/dist/esm/api/Commands.js.map +1 -1
  18. package/dist/esm/api/ScheduledMessages.js +57 -0
  19. package/dist/esm/api/ScheduledMessages.js.map +1 -0
  20. package/dist/esm/api/Sessions.js.map +1 -1
  21. package/dist/esm/api/index.js +1 -0
  22. package/dist/esm/api/index.js.map +1 -1
  23. package/dist/esm/types/index.js +2 -0
  24. package/dist/esm/types/index.js.map +1 -1
  25. package/dist/esm/types/scheduled-messages.js +2 -0
  26. package/dist/esm/types/scheduled-messages.js.map +1 -0
  27. package/dist/types/HITL.d.ts +15 -1
  28. package/dist/types/HITL.d.ts.map +1 -1
  29. package/dist/types/api/Agents.d.ts +347 -0
  30. package/dist/types/api/Agents.d.ts.map +1 -1
  31. package/dist/types/api/CannedMessages.d.ts +168 -0
  32. package/dist/types/api/CannedMessages.d.ts.map +1 -1
  33. package/dist/types/api/Commands.d.ts +49 -1
  34. package/dist/types/api/Commands.d.ts.map +1 -1
  35. package/dist/types/api/Conferences.d.ts +120 -0
  36. package/dist/types/api/Conferences.d.ts.map +1 -1
  37. package/dist/types/api/ContactRuleGroups.d.ts +131 -0
  38. package/dist/types/api/ContactRuleGroups.d.ts.map +1 -1
  39. package/dist/types/api/Contacts.d.ts +37 -0
  40. package/dist/types/api/Contacts.d.ts.map +1 -1
  41. package/dist/types/api/ContactsMeta.d.ts +33 -0
  42. package/dist/types/api/ContactsMeta.d.ts.map +1 -1
  43. package/dist/types/api/EventTemplates.d.ts +135 -0
  44. package/dist/types/api/EventTemplates.d.ts.map +1 -1
  45. package/dist/types/api/Filters.d.ts +215 -0
  46. package/dist/types/api/Filters.d.ts.map +1 -1
  47. package/dist/types/api/HITLBase.d.ts +5 -0
  48. package/dist/types/api/HITLBase.d.ts.map +1 -1
  49. package/dist/types/api/Helpers.d.ts +33 -0
  50. package/dist/types/api/Helpers.d.ts.map +1 -1
  51. package/dist/types/api/Listeners.d.ts +150 -0
  52. package/dist/types/api/Listeners.d.ts.map +1 -1
  53. package/dist/types/api/Migrations.d.ts +222 -0
  54. package/dist/types/api/Migrations.d.ts.map +1 -1
  55. package/dist/types/api/RuleGroups.d.ts +127 -0
  56. package/dist/types/api/RuleGroups.d.ts.map +1 -1
  57. package/dist/types/api/ScheduledMessages.d.ts +177 -0
  58. package/dist/types/api/ScheduledMessages.d.ts.map +1 -0
  59. package/dist/types/api/SessionEvents.d.ts +145 -0
  60. package/dist/types/api/SessionEvents.d.ts.map +1 -1
  61. package/dist/types/api/SessionRelations.d.ts +109 -0
  62. package/dist/types/api/SessionRelations.d.ts.map +1 -1
  63. package/dist/types/api/Sessions.d.ts +456 -0
  64. package/dist/types/api/Sessions.d.ts.map +1 -1
  65. package/dist/types/api/Settings.d.ts +145 -0
  66. package/dist/types/api/Settings.d.ts.map +1 -1
  67. package/dist/types/api/Tasks.d.ts +39 -0
  68. package/dist/types/api/Tasks.d.ts.map +1 -1
  69. package/dist/types/api/Versions.d.ts +80 -0
  70. package/dist/types/api/Versions.d.ts.map +1 -1
  71. package/dist/types/api/index.d.ts +1 -0
  72. package/dist/types/api/index.d.ts.map +1 -1
  73. package/dist/types/types/agents.d.ts +3 -0
  74. package/dist/types/types/agents.d.ts.map +1 -1
  75. package/dist/types/types/index.d.ts +1 -0
  76. package/dist/types/types/index.d.ts.map +1 -1
  77. package/dist/types/types/scheduled-messages.d.ts +16 -0
  78. package/dist/types/types/scheduled-messages.d.ts.map +1 -0
  79. package/package.json +3 -4
  80. package/src/HITL.ts +3 -0
  81. package/src/api/Commands.ts +5 -2
  82. package/src/api/ScheduledMessages.ts +244 -0
  83. package/src/api/Sessions.ts +3 -1
  84. package/src/api/index.ts +1 -0
  85. package/src/types/index.ts +1 -0
  86. package/src/types/scheduled-messages.ts +23 -0
@@ -1,5 +1,19 @@
1
1
  import { Session, GetSessionsOptions, GetSessionByIdOptions, GetSessionsResponse, GetQueueSessionOptions, GetQueueSessionResponse, SearchSessionsOptions, SearchSessionsResponse, SearchSessionsWithContactsOptions, SearchSessionsWithContactsResponse, GetInitTriggersOptions, GetInitTriggersResponse, ClaimSessionByAgentOptions, StartConversationOptions, TransferToBotOptions, UpdateSessionOptions, CloseSessionOptions, ReopenSessionOptions, DeleteClosedSessionOptions, CreateSessionsOptions, CreateSessionsResponse, BulkDeleteSessionsOptions } from '../types/sessions';
2
2
  import { HITLBase } from './HITLBase';
3
+ /**
4
+ * Manages Human-in-the-Loop sessions and related operations
5
+ *
6
+ * This class provides functionality to:
7
+ * - Manage session lifecycle (create, update, close, reopen, delete)
8
+ * - Handle session assignments and transfers
9
+ * - Search and retrieve sessions
10
+ * - Manage queue sessions
11
+ *
12
+ * @remarks
13
+ * - Makes requests to the `/sessions` endpoints
14
+ * - For the methods `claimSessionByAgent` and `searchSessionsWithContacts`, you must include `{ version: 2 }` in the parameters for the method to execute correctly.
15
+ * @public
16
+ */
3
17
  export declare class Sessions extends HITLBase {
4
18
  protected static MODULE_URL: string;
5
19
  protected static SEARCH_URL: "search";
@@ -11,21 +25,463 @@ export declare class Sessions extends HITLBase {
11
25
  protected static START_CONVERSATION_URL: "start-conversation";
12
26
  protected static CLOSE_URL: "close";
13
27
  protected static REOPEN_URL: "reopen";
28
+ /**
29
+ * Retrieves a list of HITL sessions
30
+ *
31
+ * @param options - Configuration parameters for retrieving sessions
32
+ *
33
+ * Optional parameters:
34
+ * - `agentId` - (string) ID of agent to filter sessions by
35
+ * - `contactId` - (string) ID of contact to filter sessions by
36
+ * - `ignoreRuleTags` - (boolean) Whether to ignore rule tags in filtering
37
+ * - `limit` - (number) Maximum number of sessions to return
38
+ * - `order` - ('asc' | 'desc') Sort order direction
39
+ * - `orderBy` - (string) Field to sort results by
40
+ * - `page` - ({@link PageOptions}) Pagination options
41
+ * - `projection` - (string[]) Fields to include in the response
42
+ * - `status` - (string[]) Filter by session status(es)
43
+ * - `timeout` - (number) Request timeout in milliseconds
44
+ * - `version` - (string | number) API version to use
45
+ *
46
+ * @returns {Promise<GetSessionsResponse>} Promise resolving to list of sessions
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * // Get all active sessions for an agent
51
+ * const sessions = await hitlApi.sessions.getSessions({
52
+ * status: ['ONGOING', 'CLAIMED'],
53
+ * limit: 50
54
+ * });
55
+ * ```
56
+ *
57
+ * @remarks Makes a GET request to `/hitl/sessions`
58
+ */
14
59
  static getSessions(options?: GetSessionsOptions): Promise<GetSessionsResponse>;
60
+ /**
61
+ * Retrieves a specific HitL session by ID
62
+ *
63
+ * @param options - Configuration parameters for retrieving a session
64
+ *
65
+ * Required parameters:
66
+ * - `sessionId` - (string) ID of the session to retrieve
67
+ *
68
+ * Optional parameters:
69
+ * - `agentId` - (string) ID of agent accessing the session
70
+ * - `ignoreRuleTags` - (boolean) Whether to ignore rule tags in filtering
71
+ * - `projection` - (string[]) Fields to include in the response
72
+ * - `timeout` - (number) Request timeout in milliseconds
73
+ * - `version` - (string | number) API version to use
74
+ *
75
+ * @returns {Promise<Session>} Promise resolving to session details
76
+ *
77
+ * @example
78
+ * ```typescript
79
+ * const session = await hitlApi.sessions.getSessionById({
80
+ * sessionId: 'session-id-1',
81
+ * projection: ['hitlSessionId', 'status', 'transcript']
82
+ * });
83
+ * ```
84
+ *
85
+ * @remarks Makes a GET request to `/sessions/{sessionId}`
86
+ */
15
87
  static getSessionById({ agentId, projection, ...options }: GetSessionByIdOptions): Promise<Session>;
88
+ /**
89
+ * Searches for HitL sessions based on provided criteria
90
+ *
91
+ * @param options - Search configuration and filters
92
+ *
93
+ * Optional parameters:
94
+ * - `agentId` - (string) Filter by assigned agent
95
+ * - `claimedBy` - (string) Filter by currently assigned agent
96
+ * - `claimedByHistory` - (string) Filter by previously assigned agent
97
+ * - `contactIds` - (string[]) Array of contact IDs to filter by
98
+ * - `dateRange` - (DateRangeOptions) Date range filtering options
99
+ * - `meta` - (Record<string, string | number | boolean | MetaWithCondition>) Metadata filters
100
+ * - `needsAction` - (boolean) Filter sessions requiring action
101
+ * - `searchPhrase` - (string) Text search query
102
+ * - `sessionIds` - (string[]) Array of session IDs to filter by
103
+ * - `sessionsSearchOptions` - (SessionSearchOptions) Additional search configuration
104
+ * - `status` - (string[]) Filter by session status(es)
105
+ * - `tags` - (TagsQuery | string[]) Filter by tags
106
+ * - `timeout` - (number) Request timeout in milliseconds
107
+ * - `type` - (string) Filter by session type
108
+ * - `version` - (string | number) API version to use
109
+ *
110
+ * @returns {Promise<SearchSessionsResponse>} Promise resolving to search results
111
+ *
112
+ * @example
113
+ * ```typescript
114
+ * // Search by different options
115
+ * const results = await hitlApi.sessions.searchSessions({
116
+ * claimedBy: BASIC_USER_ID,
117
+ * status: ['ONGOING', 'CLAIMED'],
118
+ * tags: ['wait_for_agent'],
119
+ * type: 'SMS',
120
+ * sessionsSearchOptions: {
121
+ * limit: 25
122
+ * }
123
+ * });
124
+ *
125
+ * // Search by meta with conditions
126
+ * const results = await hitlApi.sessions.searchSessions({
127
+ * meta: {
128
+ * botIdentifier: { value: botIdentifier, condition: 'IS_EQUAL' },
129
+ * hiddenFromHistory: { value: true, condition: 'IS_NOT_EQUAL' },
130
+ * userIdentifier: { value: userIdentifier1.slice(3), condition: 'CONTAINS' },
131
+ * },
132
+ * });
133
+ * ```
134
+ *
135
+ * @remarks Makes a POST request to `/sessions/search`
136
+ */
16
137
  static searchSessions({ agentId, ...options }?: SearchSessionsOptions): Promise<SearchSessionsResponse>;
138
+ /**
139
+ * Searches for HitL sessions and includes associated contact information
140
+ *
141
+ * @param options - Search configuration including contact-related filters
142
+ *
143
+ * Optional parameters:
144
+ * - `agentId` - (string) Filter by assigned agent
145
+ * - `contact` - (ContactSearchParams) Contact search parameters
146
+ * - `contactsSearchOptions` - (ContactSearchOptions) Additional contact search configuration
147
+ * - `dateRange` - (DateRangeOptions) Date range filtering options
148
+ * - `searchPhrase` - (string) Text search query
149
+ * - `sessionsSearchOptions` - (SessionSearchOptions) Additional session search configuration
150
+ * - `tags` - (string[]) Filter by tags
151
+ * - `timeout` - (number) Request timeout in milliseconds
152
+ * - `version` - (string | number) API version to use
153
+ *
154
+ * @returns {Promise<SearchSessionsWithContactsResponse>} Promise resolving to sessions with contact details
155
+ *
156
+ * @example
157
+ * ```typescript
158
+ * const results = await hitlApi.sessions.searchSessionsWithContacts({
159
+ * searchPhrase: 'billing issue',
160
+ * tags: ['vip', 'missed'],
161
+ * limit: 10,
162
+ * version: 2
163
+ * });
164
+ *
165
+ * // Search sessions by contact info
166
+ * const results = await hitlApi.sessions.searchSessionsWithContacts({
167
+ * contact: { name: 'Alison' },
168
+ * contactsSearchOptions: { size: 2 },
169
+ * version: 2
170
+ * });
171
+ * ```
172
+ *
173
+ * @remarks Makes a POST request to `/sessions/search-with-contacts`
174
+ */
17
175
  static searchSessionsWithContacts({ agentId, ...options }?: SearchSessionsWithContactsOptions): Promise<SearchSessionsWithContactsResponse>;
176
+ /**
177
+ * Retrieves the next session in NEEDS_ACTION state from the queue
178
+ *
179
+ * @param options - Queue configuration including agent and rule tags
180
+ *
181
+ * Required parameters:
182
+ * - `agentId` - (string) ID of agent requesting next session
183
+ *
184
+ * Optional parameters:
185
+ * - `ruleTags` - (string[]) Filter sessions by rule tags
186
+ * - `ignoreRuleTags` - (boolean) Whether to ignore rule tags in filtering
187
+ * - `timeout` - (number) Request timeout in milliseconds
188
+ * - `version` - (string | number) API version to use
189
+ *
190
+ * @returns {Promise<GetQueueSessionResponse>} Promise resolving to next available session
191
+ *
192
+ * @example
193
+ * ```typescript
194
+ * // Get next session for agent
195
+ * const session = await hitlApi.sessions.getQueueSession({
196
+ * agentId: 'agent-id'
197
+ * });
198
+ * ```
199
+ *
200
+ * @remarks Makes a GET request to `sessions/helpers/queue`
201
+ */
18
202
  static getQueueSession({ agentId, ruleTags, ...options }: GetQueueSessionOptions): Promise<GetQueueSessionResponse>;
203
+ /**
204
+ * Retrieves available initialization triggers for starting new HitL sessions
205
+ *
206
+ * @param options - Configuration parameters for trigger retrieval
207
+ *
208
+ * Optional parameters:
209
+ * - `timeout` - (number) Request timeout in milliseconds
210
+ * - `version` - (string | number) API version to use
211
+ *
212
+ * @returns {Promise<GetInitTriggersResponse>} Promise resolving to available triggers
213
+ *
214
+ * @example
215
+ * ```typescript
216
+ * // Get all available triggers
217
+ * const triggers = await hitlApi.sessions.getSessionInitTriggers();
218
+ * ```
219
+ *
220
+ * @remarks Makes a GET request to `/sessions/helpers/triggers`
221
+ */
19
222
  static getSessionInitTriggers(options?: GetInitTriggersOptions): Promise<GetInitTriggersResponse>;
223
+ /**
224
+ * Claims a session for a specific agent
225
+ *
226
+ * @param options - Claim configuration including agent and parameters
227
+ *
228
+ * Required parameters:
229
+ * - `sessionId` - (string) ID of session to claim
230
+ * - `claimBy` - (string) ID of agent claiming the session
231
+ *
232
+ * Optional parameters:
233
+ * - `params` - (object) Additional claim parameters
234
+ * - `timeout` - (number) Request timeout in milliseconds
235
+ * - `version` - (string | number) API version to use
236
+ *
237
+ * @returns {Promise<Session>} Promise resolving to the claimed session
238
+ * @remarks Makes a POST request to `/api/v2/hitl/sessions/{sessionId}/claim`
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * // Claim session by current token agent
243
+ * const session = await hitlApi.sessions.claimSessionByAgent({
244
+ * sessionId: 'session-id',
245
+ * version: 2
246
+ * });
247
+ * ```
248
+ */
20
249
  static claimSessionByAgent({ claimBy, params, ...options }: ClaimSessionByAgentOptions): Promise<Session>;
250
+ /**
251
+ * Transfers session control back to the bot
252
+ *
253
+ * @param options - Transfer configuration including agent and parameters
254
+ *
255
+ * Required parameters:
256
+ * - `sessionId` - (string) ID of session to transfer
257
+ * - `agentId` - (string) ID of agent transferring the session
258
+ *
259
+ * Optional parameters:
260
+ * - `params` - (object) Additional transfer parameters
261
+ * - `timeout` - (number) Request timeout in milliseconds
262
+ * - `version` - (string | number) API version to use
263
+ *
264
+ * @returns {Promise<Session>} Promise resolving to transferred session
265
+ * @remarks Makes a POST request to `/api/v2/hitl/sessions/{sessionId}/transfer-to-bot`
266
+ *
267
+ * @example
268
+ * ```typescript
269
+ * // Basic transfer
270
+ * const session = await hitlApi.sessions.transferToBot({
271
+ * sessionId: 'session-id',
272
+ * });
273
+ * ```
274
+ */
21
275
  static transferToBot({ agentId, params, ...options }: TransferToBotOptions): Promise<Session>;
276
+ /**
277
+ * Initiates a new conversation session
278
+ *
279
+ * @param options - Conversation configuration including contact and trigger details
280
+ *
281
+ * Required parameters:
282
+ * - `contactId` - (string) ID of contact to start conversation with
283
+ * - `triggerId` - (string) ID of trigger to initiate conversation
284
+ *
285
+ * Optional parameters:
286
+ * - `params` - (object) Additional conversation parameters
287
+ * - `timeout` - (number) Request timeout in milliseconds
288
+ * - `version` - (string | number) API version to use
289
+ *
290
+ * @returns {Promise<Session>} Promise resolving to new session
291
+ *
292
+ * @example
293
+ * ```typescript
294
+ * // Start basic conversation
295
+ * const session = await hitlApi.sessions.startConversation({
296
+ * contactId: 'contact-id-1',
297
+ * triggerId: 'trigger-id-2'
298
+ * });
299
+ *
300
+ * // Start conversation with parameters
301
+ * const session = await hitlApi.sessions.startConversation({
302
+ * contactId: 'contact-id',
303
+ * triggerId: 'hitl/init-conversation/voice',
304
+ * params: { visibilityTags: [] }
305
+ * });
306
+ * ```
307
+ *
308
+ * @remarks Makes a POST request to `/sessions/start-conversation`
309
+ */
22
310
  static startConversation({ contactId, triggerId, params, ...options }: StartConversationOptions): Promise<Session>;
311
+ /**
312
+ * Updates an existing session with new information
313
+ *
314
+ * @param options - Update configuration including tags and metadata
315
+ *
316
+ * Required parameters:
317
+ * - `sessionId` - (string) ID of session to update
318
+ *
319
+ * Optional parameters:
320
+ * - `tags` - (string[]) New tags for the session
321
+ * - `contactId` - (string) Updated contact ID
322
+ * - `meta` - (object) Updated metadata
323
+ * - `timeout` - (number) Request timeout in milliseconds
324
+ * - `version` - (string | number) API version to use
325
+ *
326
+ * @returns {Promise<Session>} Promise resolving to updated session
327
+ *
328
+ * @example
329
+ * ```typescript
330
+ * const session = await hitlApi.sessions.updateSession({
331
+ * sessionId: 'session-id',
332
+ * tags: ['support'],
333
+ * meta: {
334
+ * status: 'in-progress',
335
+ * priority: 'high',
336
+ * notes: 'Customer requesting callback'
337
+ * }
338
+ * });
339
+ * ```
340
+ *
341
+ * @remarks Makes a PUT request to `/sessions/{sessionId}`
342
+ */
23
343
  static updateSession({ sessionId, tags, contactId, meta, ...options }: UpdateSessionOptions): Promise<Session>;
344
+ /**
345
+ * Creates multiple sessions in bulk
346
+ *
347
+ * @param options - Bulk creation configuration including session details
348
+ *
349
+ * Required parameters:
350
+ * - `sessions` - ({@link Session}[]) Array of session configurations to create
351
+ *
352
+ * Optional parameters:
353
+ * - `timeout` - (number) Request timeout in milliseconds
354
+ * - `version` - (string | number) API version to use
355
+ *
356
+ * @returns {Promise<CreateSessionsResponse>} Promise resolving to creation results
357
+ *
358
+ * @example
359
+ * ```typescript
360
+ * const created = await hitlApi.sessions.createSessions({
361
+ * sessions: [
362
+ * {
363
+ * hitlSessionId: 'session-id',
364
+ * contactId: 'contact-id-1',
365
+ * status: 'CLOSED',
366
+ * isArchived: true,
367
+ * createdAt: new Date('1971'),
368
+ * ruleTags: ['sms'],
369
+ * },
370
+ * {
371
+ * contactId: 'contact-id-2',
372
+ * status: 'ONGOING',
373
+ * ruleTags: ['voice'],
374
+ * },
375
+ * ]
376
+ * });
377
+ * ```
378
+ *
379
+ * @remarks Makes a POST request to `/sessions`
380
+ */
24
381
  static createSessions({ sessions, ...options }: CreateSessionsOptions): Promise<CreateSessionsResponse>;
382
+ /**
383
+ * Closes an active session
384
+ *
385
+ * @param options - Close configuration including session identifier
386
+ *
387
+ * Required parameters:
388
+ * - `sessionId` - (string) ID of session to close
389
+ *
390
+ * Optional parameters:
391
+ * - `timeout` - (number) Request timeout in milliseconds
392
+ * - `version` - (string | number) API version to use
393
+ *
394
+ * @returns {Promise<Session>} Promise resolving to closed session
395
+ *
396
+ * @example
397
+ * ```typescript
398
+ * // Close a session
399
+ * const session = await hitlApi.sessions.closeSession({
400
+ * sessionId: 'session-id'
401
+ * });
402
+ * ```
403
+ *
404
+ * @remarks Makes a POST request to `sessions/{sessionId}/close`
405
+ */
25
406
  static closeSession(options: CloseSessionOptions): Promise<Session>;
407
+ /**
408
+ * Reopens a previously closed session
409
+ *
410
+ * @param options - Reopen configuration including session identifier
411
+ *
412
+ * Required parameters:
413
+ * - `sessionId` - (string) ID of session to reopen
414
+ *
415
+ * Optional parameters:
416
+ * - `startedSessionId` - (string) id of session that started before reopen old session
417
+ * - `timeout` - (number) Request timeout in milliseconds
418
+ * - `version` - (string | number) API version to use
419
+ *
420
+ * @returns {Promise<Session>} Promise resolving to reopened session
421
+ *
422
+ * @example
423
+ * ```typescript
424
+ * // Reopen a session
425
+ * const session = await hitlApi.sessions.reopenSession({
426
+ * sessionId: 'session-id'
427
+ * });
428
+ * ```
429
+ *
430
+ * @remarks Makes a POST request to `/sessions/{sessionId}/reopen`
431
+ */
26
432
  static reopenSession({ startedSessionId, ...options }: ReopenSessionOptions): Promise<Session>;
433
+ /**
434
+ * Deletes a closed session
435
+ *
436
+ * @param options - Delete configuration including session identifier
437
+ *
438
+ * Required parameters:
439
+ * - `sessionId` - (string) ID of session to delete
440
+ *
441
+ * Optional parameters:
442
+ * - `timeout` - (number) Request timeout in milliseconds
443
+ * - `version` - (string | number) API version to use
444
+ *
445
+ * @returns {Promise<void>} Promise resolving when deletion is complete
446
+ *
447
+ * @example
448
+ * ```typescript
449
+ * // Delete a closed session
450
+ * await hitlApi.sessions.deleteClosedSession({
451
+ * sessionId: 'session-id'
452
+ * });
453
+ * ```
454
+ *
455
+ * @remarks Makes a DELETE request to `/sessions/{sessionId}`
456
+ */
27
457
  static deleteClosedSession(options: DeleteClosedSessionOptions): Promise<unknown>;
458
+ /**
459
+ * @deprecated Use bulkDeleteSessions instead
460
+ */
28
461
  static buldDeleteSessions({ sessionIds, ...options }: BulkDeleteSessionsOptions): Promise<unknown>;
462
+ /**
463
+ * Deletes multiple sessions in bulk
464
+ *
465
+ * @param options - Bulk deletion configuration including session identifiers
466
+ *
467
+ * Required parameters:
468
+ * - `sessionIds` - (string[]) Array of session IDs to delete
469
+ *
470
+ * Optional parameters:
471
+ * - `timeout` - (number) Request timeout in milliseconds
472
+ * - `version` - (string | number) API version to use
473
+ *
474
+ * @returns {Promise<void>} Promise resolving when deletion is complete
475
+ * @remarks Makes a DELETE request to `/api/v2/hitl/sessions`
476
+ *
477
+ * @example
478
+ * ```typescript
479
+ * // Delete multiple sessions
480
+ * await hitlApi.sessions.bulkDeleteSessions({
481
+ * sessionIds: ['session-id-1', 'session-id-2', 'session-id-3']
482
+ * });
483
+ * ```
484
+ */
29
485
  static bulkDeleteSessions({ sessionIds, ...options }: BulkDeleteSessionsOptions): Promise<unknown>;
30
486
  }
31
487
  //# sourceMappingURL=Sessions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sessions.d.ts","sourceRoot":"","sources":["../../../src/api/Sessions.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,OAAO,EAEP,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB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,CAAC,OAAO,CAAC;IAgBnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;WACiB,cAAc,CAChC,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,EAAE,qBAAqB,GAC9C,OAAO,CAAC,sBAAsB,CAAC;IAUlC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;WACiB,YAAY,CAC9B,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,OAAO,CAAC;IAcnB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;WACiB,aAAa,CAC/B,EAAE,gBAAgB,EAAE,GAAG,OAAO,EAAE,EAAE,oBAAoB,GACrD,OAAO,CAAC,OAAO,CAAC;IAenB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;WACiB,mBAAmB,CACrC,OAAO,EAAE,0BAA0B;IAWrC;;OAEG;WACiB,kBAAkB,CACpC,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,EAAE,yBAAyB;IAQvD;;;;;;;;;;;;;;;;;;;;;;OAsBG;WACiB,kBAAkB,CACpC,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,EAAE,yBAAyB;CAUxD"}
@@ -1,12 +1,157 @@
1
1
  import { DeleteSettingOptions, GetContactBookInfoSettingOptions, GetSettingsOptions, GetSettingsResponse, UpdateSettingsOptions, UpdateSettingsResponse, Settings as SettingsType } from '../types/settings';
2
2
  import { HITLBase } from './HITLBase';
3
+ /**
4
+ * Manages system settings and configuration
5
+ *
6
+ * This class provides functionality to:
7
+ * - Retrieve and manage system settings
8
+ * - Handle contact book information
9
+ * - Manage rule-based settings
10
+ *
11
+ * Key features:
12
+ * - CRUD operations for settings
13
+ * - Special handling for contact book settings
14
+ * - Support for common and specific settings
15
+ *
16
+ * @remarks
17
+ * - All methods in this class interact with the `/settings` endpoint
18
+ * @public
19
+ */
3
20
  export declare class Settings extends HITLBase {
4
21
  protected static readonly MODULE_URL = "settings";
5
22
  protected static readonly CONTACT_BOOK_INFO_URL = "contact-book-info";
6
23
  protected static readonly IGNORE_RULE_TAGS_HEADER = "X-Ignore-Rule-Tags";
24
+ /**
25
+ * Retrieves system settings
26
+ *
27
+ * @param options - Configuration parameters for retrieving settings
28
+ *
29
+ * Optional parameters:
30
+ * - `agentId` - (string) ID of the agent to get specific settings for
31
+ * - `asRecord` - (boolean) Return settings as a record/object instead of an array
32
+ * - `categories` - (string[]) Filter settings by specific categories
33
+ * - `ignoreRuleTags` - (boolean) Whether to ignore rule tags in the response
34
+ * - `isCommon` - (boolean) Retrieve only common settings
35
+ * - `timeout` - (number) Request timeout in milliseconds
36
+ * - `version` - (string | number) API version to use
37
+ *
38
+ * @returns {Promise<GetSettingsResponse>} Promise resolving to the settings data
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * // Basic usage without options
43
+ * const settings = await hitlApi.settings.getSettings();
44
+ *
45
+ * // Filtered by categories
46
+ * const settings = await hitlApi.settings.getSettings({
47
+ * categories: ['status', 'voice'],
48
+ * isCommon: true,
49
+ * });
50
+ * ```
51
+ *
52
+ * @remarks
53
+ * Makes a GET request to the `/settings` endpoint
54
+ * @public
55
+ */
7
56
  static getSettings({ ignoreRuleTags, ...options }?: GetSettingsOptions): Promise<GetSettingsResponse>;
57
+ /**
58
+ * Retrieves contact book information settings using agent rule groups for triggers
59
+ *
60
+ * @param options - Configuration parameters for retrieving contact book info
61
+ *
62
+ * Optional parameters:
63
+ * - `agentId` - (string) ID of the agent to get specific settings for
64
+ * - `timeout` - (number) Request timeout in milliseconds
65
+ * - `version` - (string | number) API version to use
66
+ *
67
+ * @returns {Promise<SettingsType>} Promise resolving to the contact book settings
68
+ *
69
+ * @example
70
+ * ```typescript
71
+ * const contactBookInfo = await hitlApi.settings.getContactBookInfoSetting();
72
+ * ```
73
+ *
74
+ * @remarks
75
+ * Makes a GET request to the `/settings/contact-book-info` endpoint
76
+ * @public
77
+ */
8
78
  static getContactBookInfoSetting(options?: GetContactBookInfoSettingOptions): Promise<SettingsType>;
79
+ /**
80
+ * Updates system settings
81
+ *
82
+ * @param options - Configuration parameters for updating settings
83
+ *
84
+ * Required parameters:
85
+ * - need to use one of - 'data' or 'settings' from Optional parameters
86
+ *
87
+ * Optional parameters:
88
+ * - `agentId` - (string) ID of the agent whose settings are being updated
89
+ * - `data` - (Record<string, any>) Additional data for the setting update
90
+ * - `isCommon` - (boolean) Whether to update common settings
91
+ * - `settings` - (UpdateSettings[]) Array of settings to be updated
92
+ * - `timeout` - (number) Request timeout in milliseconds
93
+ * - `version` - (string | number) API version to use
94
+ *
95
+ * @returns {Promise<UpdateSettingsResponse>} Promise resolving to the updated settings
96
+ *
97
+ * @example
98
+ * ```typescript
99
+ * // Update common settings
100
+ * const updated = await hitlApi.settings.updateSettings({
101
+ * isCommon: true,
102
+ * data: {
103
+ * "ui-layout": {
104
+ * "header": {},
105
+ * "version": "3.0"
106
+ * },
107
+ * "avatar": {
108
+ * "custom": {
109
+ * "default": "thumbs",
110
+ * "isEnabled": true
111
+ * },
112
+ * "rounded": true,
113
+ * "gravatar": {
114
+ * "default": "robohash",
115
+ * "isEnabled": false
116
+ * }
117
+ * }
118
+ * }});
119
+ * ```
120
+ *
121
+ * @remarks
122
+ * Makes a PUT request to the `/settings` endpoint
123
+ * @public
124
+ */
9
125
  static updateSettings({ isCommon, data, settings, ...options }: UpdateSettingsOptions): Promise<UpdateSettingsResponse>;
126
+ /**
127
+ * Deletes a specific setting
128
+ *
129
+ * @param options - Configuration parameters for deleting the setting
130
+ *
131
+ * Required parameters:
132
+ * - `category` - (string) Category of the setting to delete
133
+ *
134
+ * Optional parameters:
135
+ * - `agentId` - (string) ID of the agent whose setting is being deleted
136
+ * - `categoryItemId` - (string) Specific item ID within the category
137
+ * - `isCommon` - (boolean) Whether to delete from common settings
138
+ * - `timeout` - (number) Request timeout in milliseconds
139
+ * - `version` - (string | number) API version to use
140
+ *
141
+ * @returns {Promise<GetSettingsResponse>} Promise resolving to the remaining settings
142
+ *
143
+ * @example
144
+ * ```typescript
145
+ * const remaining = await hitlApi.settings.deleteSetting({
146
+ * category: 'notifications',
147
+ * isCommon: true
148
+ * });
149
+ * ```
150
+ *
151
+ * @remarks
152
+ * Makes a DELETE request to the `/settings` endpoint
153
+ * @public
154
+ */
10
155
  static deleteSetting(options: DeleteSettingOptions): Promise<GetSettingsResponse>;
11
156
  }
12
157
  //# sourceMappingURL=Settings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../../src/api/Settings.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,gCAAgC,EAChC,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,QAAQ,IAAI,YAAY,EACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAmBtC,qBAAa,QAAS,SAAQ,QAAQ;IACpC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAc;IAClD,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,uBAAuB;IACtE,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,wBAAwB;WAkCrD,WAAW,CAC7B,EAAE,cAAsB,EAAE,GAAG,OAAO,EAAE,GAAE,kBAAuB,GAC9D,OAAO,CAAC,mBAAmB,CAAC;WAoCX,yBAAyB,CAC3C,OAAO,GAAE,gCAAqC,GAC7C,OAAO,CAAC,YAAY,CAAC;WA4DJ,cAAc,CAChC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,EAAE,qBAAqB,GAC9D,OAAO,CAAC,sBAAsB,CAAC;WA4Cd,aAAa,CAC/B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC;CAahC"}
1
+ {"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../../src/api/Settings.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,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