@or-sdk/hitl 0.36.2 → 0.36.3

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 (47) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/api/Sessions.js +4 -3
  3. package/dist/cjs/api/Sessions.js.map +1 -1
  4. package/dist/esm/api/Sessions.js +3 -2
  5. package/dist/esm/api/Sessions.js.map +1 -1
  6. package/dist/types/HITL.d.ts +13 -0
  7. package/dist/types/HITL.d.ts.map +1 -1
  8. package/dist/types/api/Agents.d.ts +347 -0
  9. package/dist/types/api/Agents.d.ts.map +1 -1
  10. package/dist/types/api/CannedMessages.d.ts +168 -0
  11. package/dist/types/api/CannedMessages.d.ts.map +1 -1
  12. package/dist/types/api/Commands.d.ts +46 -0
  13. package/dist/types/api/Commands.d.ts.map +1 -1
  14. package/dist/types/api/Conferences.d.ts +120 -0
  15. package/dist/types/api/Conferences.d.ts.map +1 -1
  16. package/dist/types/api/ContactRuleGroups.d.ts +131 -0
  17. package/dist/types/api/ContactRuleGroups.d.ts.map +1 -1
  18. package/dist/types/api/Contacts.d.ts +37 -0
  19. package/dist/types/api/Contacts.d.ts.map +1 -1
  20. package/dist/types/api/ContactsMeta.d.ts +33 -0
  21. package/dist/types/api/ContactsMeta.d.ts.map +1 -1
  22. package/dist/types/api/EventTemplates.d.ts +135 -0
  23. package/dist/types/api/EventTemplates.d.ts.map +1 -1
  24. package/dist/types/api/Filters.d.ts +215 -0
  25. package/dist/types/api/Filters.d.ts.map +1 -1
  26. package/dist/types/api/Helpers.d.ts +33 -0
  27. package/dist/types/api/Helpers.d.ts.map +1 -1
  28. package/dist/types/api/Listeners.d.ts +150 -0
  29. package/dist/types/api/Listeners.d.ts.map +1 -1
  30. package/dist/types/api/Migrations.d.ts +222 -0
  31. package/dist/types/api/Migrations.d.ts.map +1 -1
  32. package/dist/types/api/RuleGroups.d.ts +127 -0
  33. package/dist/types/api/RuleGroups.d.ts.map +1 -1
  34. package/dist/types/api/SessionEvents.d.ts +145 -0
  35. package/dist/types/api/SessionEvents.d.ts.map +1 -1
  36. package/dist/types/api/SessionRelations.d.ts +109 -0
  37. package/dist/types/api/SessionRelations.d.ts.map +1 -1
  38. package/dist/types/api/Sessions.d.ts +455 -1
  39. package/dist/types/api/Sessions.d.ts.map +1 -1
  40. package/dist/types/api/Settings.d.ts +145 -0
  41. package/dist/types/api/Settings.d.ts.map +1 -1
  42. package/dist/types/api/Tasks.d.ts +39 -0
  43. package/dist/types/api/Tasks.d.ts.map +1 -1
  44. package/dist/types/api/Versions.d.ts +80 -0
  45. package/dist/types/api/Versions.d.ts.map +1 -1
  46. package/package.json +2 -2
  47. package/src/api/Sessions.ts +2 -1
@@ -1,19 +1,241 @@
1
1
  import { ApiVersionOptions } from '../types';
2
2
  import { GetMigrationsOptions, GetMigrationsResponse, RunMigrationsOptions, RunMigrationsResponse, CreateDefaultRecordsResponse, GetMigrationsInfoResponse, GetRunMigrationsStatusResponse, GetDefaultRecordsOptions, GetDefaultRecordsResponse, SyncDefaultRecordsOptions, SyncDefaultRecordsResponse } from '../types/migrations';
3
3
  import { HITLBase } from './HITLBase';
4
+ /**
5
+ * Manages database migrations and default records in the system
6
+ *
7
+ * This class provides functionality to:
8
+ * - Manage database migrations
9
+ * - Handle default records for tables
10
+ * - Monitor migration status
11
+ * - Control migration locks
12
+ *
13
+ * @remarks
14
+ * - All methods in this class interact with the `/migrations` endpoint
15
+ * @public
16
+ */
4
17
  export declare class Migrations extends HITLBase {
5
18
  protected static readonly MODULE_URL = "migrations";
6
19
  protected static DEFAULT_RECORDS_URL: string;
7
20
  protected static MIGRATIONS_INFO_URL: string;
8
21
  protected static MIGRATIONS_LOCK_URL: string;
9
22
  protected static MIGRATIONS_STATUS_URL: string;
23
+ /**
24
+ * Retrieves a list of pending migrations
25
+ *
26
+ * @param options - Configuration parameters for retrieving migrations
27
+ *
28
+ * Optional parameters:
29
+ * - `appVersion` - (string) Application version to check migrations against
30
+ * - `timeout` - (number) Request timeout in milliseconds
31
+ * - `version` - (string | number) API version to use
32
+ *
33
+ * @returns {Promise<GetMigrationsResponse>} Promise resolving to the list of pending migrations
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * const migrations = await hitlApi.migrations.getListOfMigrations({
38
+ * appVersion: '0.81.0',
39
+ * });
40
+ * ```
41
+ *
42
+ * @remarks
43
+ * Makes a GET request to the `/migrations` endpoint
44
+ * @public
45
+ */
10
46
  static getListOfMigrations({ appVersion, ...options }?: GetMigrationsOptions): Promise<GetMigrationsResponse>;
47
+ /**
48
+ * Executes pending migrations
49
+ *
50
+ * @param options - Configuration parameters for running migrations
51
+ *
52
+ * Optional parameters:
53
+ * - `appVersion` - (string) Version of the application to migrate for
54
+ * - `meta` - (object) Additional metadata for the migration
55
+ * - `method` - ("up" | "down") Direction of migration, either "up" or "down"
56
+ * - `name` - (string) Name of specific migration to run
57
+ * - `timeout` - (number) Request timeout in milliseconds
58
+ * - `version` - (string | number) API version to use
59
+ *
60
+ * @returns {Promise<void>} Promise that resolves when migrations are complete
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * // Run all migrations up to latest version
65
+ * await migrationApi.runAllMigrations();
66
+ *
67
+ * // Run specific migration with metadata
68
+ * await migrationApi.runAllMigrations({
69
+ * name: "27-create-contact-rule-groups-table",
70
+ * method: "up",
71
+ * meta: {
72
+ * appVersion: "0.81.0",
73
+ * }
74
+ * });
75
+ * ```
76
+ *
77
+ * @remarks
78
+ * Makes a POST request to the `/migrations` endpoint
79
+ * @public
80
+ */
11
81
  static runAllMigrations({ meta, ...options }?: RunMigrationsOptions): Promise<RunMigrationsResponse>;
82
+ /**
83
+ * Retrieves the current status of running migrations
84
+ *
85
+ * @param options - Configuration parameters
86
+ *
87
+ * Optional parameters:
88
+ * - `timeout` - (number) Request timeout in milliseconds
89
+ * - `version` - (string | number) API version to use
90
+ *
91
+ * @returns {Promise<GetRunMigrationsStatusResponse>} Promise resolving to the migration status
92
+ *
93
+ * @example
94
+ * ```typescript
95
+ * const status = await hitlApi.migrations.getRunMigrationsStatus();
96
+ * ```
97
+ *
98
+ * @remarks
99
+ * Makes a GET request to the `/migrations/status` endpoint
100
+ * @public
101
+ */
12
102
  static getRunMigrationsStatus(options?: ApiVersionOptions): Promise<GetRunMigrationsStatusResponse>;
103
+ /**
104
+ * Removes the migrations table lock that is set during migration runs
105
+ *
106
+ * @param options - Configuration parameters
107
+ *
108
+ * Optional parameters:
109
+ * - `timeout` - (number) Request timeout in milliseconds
110
+ * - `version` - (string | number) API version to use
111
+ *
112
+ * @returns {Promise<void>} Promise that resolves when the lock is deleted
113
+ *
114
+ * @example
115
+ * ```typescript
116
+ * await hitlApi.migrations.deleteMigrationsTableLock();
117
+ * ```
118
+ *
119
+ * @remarks
120
+ * Makes a DELETE request to the `/migrations/lock` endpoint
121
+ * @public
122
+ */
13
123
  static deleteMigrationsTableLock(options?: ApiVersionOptions): Promise<unknown>;
124
+ /**
125
+ * Retrieves migration compatibility information with UI versions
126
+ *
127
+ * @param options - Configuration parameters
128
+ *
129
+ * Optional parameters:
130
+ * - `timeout` - (number) Request timeout in milliseconds
131
+ * - `version` - (string | number) API version to use
132
+ *
133
+ * @returns {Promise<GetMigrationsInfoResponse>} Promise resolving to the migrations compatibility info
134
+ *
135
+ * @example
136
+ * ```typescript
137
+ * const info = await hitlApi.migrations.getMigrationsInfo();
138
+ * ```
139
+ *
140
+ * @remarks
141
+ * Makes a GET request to the `/migrations/info` endpoint
142
+ * @public
143
+ */
14
144
  static getMigrationsInfo(options?: ApiVersionOptions): Promise<GetMigrationsInfoResponse>;
145
+ /**
146
+ * Retrieves default records for specific tables
147
+ *
148
+ * Supported tables:
149
+ * - settings
150
+ * - filters
151
+ * - event_templates
152
+ * - rule_groups
153
+ *
154
+ * @param options - Configuration parameters for retrieving default records
155
+ *
156
+ * Required parameters:
157
+ * - `tableName` - ({@link DEFAULT_DATA_TABLE_NAME}) Name of the table to retrieve default records from
158
+ *
159
+ * Optional parameters:
160
+ * - `timeout` - (number) Request timeout in milliseconds
161
+ * - `version` - (string | number) API version to use
162
+ *
163
+ * @returns {Promise<GetDefaultRecordsResponse>} Promise resolving to the default records
164
+ *
165
+ * @example
166
+ * ```typescript
167
+ * const records = await hitlApi.migrations.getTableDefaultRecords({
168
+ * tableName: 'EVENT_TEMPLATES'
169
+ * });
170
+ * ```
171
+ *
172
+ * @remarks
173
+ * Makes a GET request to the `/migrations/default-records` endpoint
174
+ * @public
175
+ */
15
176
  static getTableDefaultRecords(options: GetDefaultRecordsOptions): Promise<GetDefaultRecordsResponse>;
177
+ /**
178
+ * Creates default records for specific tables
179
+ *
180
+ * Supported tables:
181
+ * - settings
182
+ * - filters
183
+ * - event_templates
184
+ * - rule_groups
185
+ *
186
+ * @param options - Configuration parameters
187
+ *
188
+ * Optional parameters:
189
+ * - `timeout` - (number) Request timeout in milliseconds
190
+ * - `version` - (string | number) API version to use
191
+ *
192
+ * @returns {Promise<CreateDefaultRecordsResponse>} Promise resolving to the created records
193
+ *
194
+ * @example
195
+ * ```typescript
196
+ * const result = await hitlApi.migrations.createTableDefaultRecords();
197
+ * ```
198
+ *
199
+ * @remarks
200
+ * Makes a POST request to the `/migrations/default-records` endpoint
201
+ * @public
202
+ */
16
203
  static createTableDefaultRecords(options?: ApiVersionOptions): Promise<CreateDefaultRecordsResponse>;
204
+ /**
205
+ * Synchronizes default records for specific tables
206
+ *
207
+ * Supported tables:
208
+ * - settings
209
+ * - filters
210
+ * - event_templates
211
+ * - rule_groups
212
+ *
213
+ * @param options - Configuration parameters for syncing records
214
+ *
215
+ * Optional parameters:
216
+ * - `keys` - (string[]) Array of specific record keys to synchronize. If not provided, all records will be synchronized
217
+ * - `timeout` - (number) Request timeout in milliseconds
218
+ * - `version` - (string | number) API version to use
219
+ *
220
+ * @returns {Promise<SyncDefaultRecordsResponse>} Promise resolving to the sync results
221
+ *
222
+ * @example
223
+ * // Sync all default records
224
+ * await tableApi.syncTableDefaultRecords({
225
+ * tableName: DEFAULT_DATA_TABLE_NAME.FILTERS
226
+ * });
227
+ *
228
+ * // Sync specific records by keys
229
+ * await tableApi.syncTableDefaultRecords({
230
+ * tableName: DEFAULT_DATA_TABLE_NAME.FILTERS,
231
+ * keys: ['filter-id-1', 'filter-id-3']
232
+ * });
233
+ * ```
234
+ *
235
+ * @remarks
236
+ * Makes a PUT request to the `/migrations/default-records` endpoint
237
+ * @public
238
+ */
17
239
  static syncTableDefaultRecords(options: SyncDefaultRecordsOptions): Promise<SyncDefaultRecordsResponse>;
18
240
  }
19
241
  //# sourceMappingURL=Migrations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Migrations.d.ts","sourceRoot":"","sources":["../../../src/api/Migrations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAGL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,EAC5B,yBAAyB,EACzB,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAetC,qBAAa,UAAW,SAAQ,QAAQ;IACtC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,gBAAgB;IACpD,SAAS,CAAC,MAAM,CAAC,mBAAmB,SAAqB;IACzD,SAAS,CAAC,MAAM,CAAC,mBAAmB,SAAU;IAC9C,SAAS,CAAC,MAAM,CAAC,mBAAmB,SAAU;IAC9C,SAAS,CAAC,MAAM,CAAC,qBAAqB,SAAY;WAyB9B,mBAAmB,CACrC,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,GAAE,oBAAyB,GACpD,OAAO,CAAC,qBAAqB,CAAC;WA4Cb,gBAAgB,CAClC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,GAAE,oBAAyB,GAC9C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GAAE,oBAAyB,GACpD,OAAO,CAAC,qBAAqB,CAAC;IAUjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;WACiB,gBAAgB,CAClC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,GAAE,oBAAyB,GAC9C,OAAO,CAAC,qBAAqB,CAAC;IAejC;;;;;;;;;;;;;;;;;;;OAmBG;WACiB,sBAAsB,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,8BAA8B,CAAC;IAUpH;;;;;;;;;;;;;;;;;;;OAmBG;WACiB,yBAAyB,CAAC,OAAO,GAAE,iBAAsB;IAW7E;;;;;;;;;;;;;;;;;;;OAmBG;WACiB,iBAAiB,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAU1G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;WACiB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAejH;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;WACiB,yBAAyB,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAWrH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;WACiB,uBAAuB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;CAcrH"}
@@ -1,10 +1,137 @@
1
1
  import { SearchRuleGroupsOptions, SearchRuleGroupsResponse, RuleGroup, CreateRuleGroupOptions, UpdateRuleGroupOptions, DeleteRuleGroupOptions } from '../types/rule-groups';
2
2
  import { HITLBase } from './HITLBase';
3
+ /**
4
+ * Manages rule groups in the system
5
+ *
6
+ * This class provides functionality to manage rule groups, including searching,
7
+ * creating, updating, and deleting rule groups.
8
+ *
9
+ * Key features:
10
+ * - Search and retrieve rule groups
11
+ * - Create new rule groups
12
+ * - Update existing rule groups
13
+ * - Delete rule groups
14
+ *
15
+ * @remarks
16
+ * - All methods in this class interact with the `/rule-groups` endpoint
17
+ * @public
18
+ */
3
19
  export declare class RuleGroups extends HITLBase {
4
20
  protected static MODULE_URL: string;
21
+ /**
22
+ * Searches for rule groups or retrieves specific groups
23
+ *
24
+ * @param options - Configuration parameters for the rule groups search
25
+ *
26
+ * Optional parameters:
27
+ * - `groupIdList` - (string[]) List of specific group IDs to retrieve
28
+ * - `timeout` - (number) Request timeout in milliseconds
29
+ * - `version` - (string | number) API version to use
30
+ *
31
+ * @returns {Promise<SearchRuleGroupsResponse | RuleGroup>} Promise resolving to:
32
+ * - Either a list of rule groups or a single rule group if specific ID is provided
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * // Search all rule groups
37
+ * const response = await hitlApi.ruleGroups.searchRuleGroups();
38
+ *
39
+ * // Search specific rule groups
40
+ * const groups = await hitlApi.ruleGroups.searchRuleGroups({
41
+ * groupIdList: ['group-1', 'group-2']
42
+ * });
43
+ * ```
44
+ *
45
+ * @remarks
46
+ * Makes a GET request to the `/rule-groups` endpoint
47
+ * @public
48
+ */
5
49
  static searchRuleGroups({ groupIdList, ...options }?: SearchRuleGroupsOptions): Promise<SearchRuleGroupsResponse | RuleGroup>;
50
+ /**
51
+ * Creates a new rule group
52
+ *
53
+ * @param options - Configuration parameters for creating the rule group
54
+ *
55
+ * Required parameters:
56
+ * - `groupId` - (string) Unique identifier for the group
57
+ * - `name` - (string) Name of the rule group
58
+ * - `rules` - (RuleDefinition[]) Array of rules for the group
59
+ *
60
+ * Optional parameters:
61
+ * - `timeout` - (number) Request timeout in milliseconds
62
+ * - `version` - (string | number) API version to use
63
+ *
64
+ * @returns {Promise<RuleGroup>} Promise resolving to the created rule group
65
+ *
66
+ * @example
67
+ * ```typescript
68
+ * const newGroup = await hitlApi.ruleGroups.createRuleGroup({
69
+ * groupId: 'group-1',
70
+ * name: 'Allow sms',
71
+ * rules: ['sms']
72
+ * });
73
+ * ```
74
+ *
75
+ * @remarks
76
+ * Makes a POST request to the `/rule-groups` endpoint
77
+ * @public
78
+ */
6
79
  static createRuleGroup({ groupId, name, rules, ...options }: CreateRuleGroupOptions): Promise<RuleGroup>;
80
+ /**
81
+ * Updates an existing rule group
82
+ *
83
+ * @param options - Configuration parameters for updating the rule group
84
+ *
85
+ * Required parameters:
86
+ * - `groupId` - (string) ID of the group to update
87
+ * - `name` - (string) Updated name for the rule group
88
+ * - `rules` - (RuleDefinition[]) Updated array of rules
89
+ *
90
+ * Optional parameters:
91
+ * - `timeout` - (number) Request timeout in milliseconds
92
+ * - `version` - (string | number) API version to use
93
+ *
94
+ * @returns {Promise<RuleGroup>} Promise resolving to the updated rule group
95
+ *
96
+ * @example
97
+ * ```typescript
98
+ * const updatedGroup = await hitlApi.ruleGroups.updateRuleGroup({
99
+ * groupId: 'group-1',
100
+ * name: 'Default sms',
101
+ * rules: ['sms', 'hitl']
102
+ * });
103
+ * ```
104
+ *
105
+ * @remarks
106
+ * Makes a PUT request to the `/rule-groups` endpoint
107
+ * @public
108
+ */
7
109
  static updateRuleGroup({ groupId, name, rules, ...options }: UpdateRuleGroupOptions): Promise<RuleGroup>;
110
+ /**
111
+ * Deletes a rule group
112
+ *
113
+ * @param options - Configuration parameters for deleting the rule group
114
+ *
115
+ * Required parameters:
116
+ * - `groupId` - (string) ID of the group to delete
117
+ *
118
+ * Optional parameters:
119
+ * - `timeout` - (number) Request timeout in milliseconds
120
+ * - `version` - (string | number) API version to use
121
+ *
122
+ * @returns {Promise<void>} Promise that resolves when deletion is complete
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * await hitlApi.ruleGroups.deleteRuleGroup({
127
+ * groupId: 'group-1'
128
+ * });
129
+ * ```
130
+ *
131
+ * @remarks
132
+ * Makes a DELETE request to the `/rule-groups` endpoint
133
+ * @public
134
+ */
8
135
  static deleteRuleGroup({ groupId, ...options }: DeleteRuleGroupOptions): Promise<void>;
9
136
  }
10
137
  //# sourceMappingURL=RuleGroups.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RuleGroups.d.ts","sourceRoot":"","sources":["../../../src/api/RuleGroups.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAkBtC,qBAAa,UAAW,SAAQ,QAAQ;IACtC,SAAS,CAAC,MAAM,CAAC,UAAU,SAAiB;WA8B9B,gBAAgB,CAC5B,EAAE,WAAW,EAAE,GAAG,OAAO,EAAE,GAAE,uBAA4B,GACxD,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC;WA2ClC,eAAe,CAC3B,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,EAAE,sBAAsB,GAC3D,OAAO,CAAC,SAAS,CAAC;WA4CP,eAAe,CAC3B,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,EAAE,sBAAsB,GAC3D,OAAO,CAAC,SAAS,CAAC;WAwCP,eAAe,CAC3B,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,sBAAsB,GAC9C,OAAO,CAAC,IAAI,CAAC;CAUjB"}
1
+ {"version":3,"file":"RuleGroups.d.ts","sourceRoot":"","sources":["../../../src/api/RuleGroups.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,UAAW,SAAQ,QAAQ;IACtC,SAAS,CAAC,MAAM,CAAC,UAAU,SAAiB;IAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;WACW,gBAAgB,CAC5B,EAAE,WAAW,EAAE,GAAG,OAAO,EAAE,GAAE,uBAA4B,GACxD,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC;IAchD;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;WACW,eAAe,CAC3B,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,EAAE,sBAAsB,GAC3D,OAAO,CAAC,SAAS,CAAC;IAerB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;WACW,eAAe,CAC3B,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,EAAE,sBAAsB,GAC3D,OAAO,CAAC,SAAS,CAAC;IAerB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;WACW,eAAe,CAC3B,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,sBAAsB,GAC9C,OAAO,CAAC,IAAI,CAAC;CAUjB"}
@@ -1,15 +1,160 @@
1
1
  import { GetNewEventsCountOptions, GetNewEventsCountResponse, SaveLastReadEventOptions } from '../types/read-events';
2
2
  import { GetSessionEventsOptions, GetSessionEventsResponse, AddEventsOptions, AddEventsResponse, GetBulkSessionEventsOptions, GetBulkSessionsEventsResponse } from '../types/session-events';
3
3
  import { HITLBase } from './HITLBase';
4
+ /**
5
+ * Manages events for Human-in-the-Loop (HitL) sessions
6
+ *
7
+ * This class provides functionality to:
8
+ * - Retrieve and manage session events
9
+ * - Track event read status
10
+ * - Handle bulk event operations
11
+ * - Manage event counts
12
+ *
13
+ * @remarks
14
+ * - All methods interact with the `/session-events` endpoint
15
+ * @public
16
+ */
4
17
  export declare class SessionEvents extends HITLBase {
5
18
  protected static MODULE_URL: string;
6
19
  protected static GET_BULK_EVENTS_URL: string;
7
20
  protected static GET_EVENTS_COUNT_URL: string;
8
21
  protected static SAVE_READ_EVENT_URL: string;
22
+ /**
23
+ * Retrieves events for a specific HitL session
24
+ *
25
+ * @param options - Configuration parameters for retrieving session events
26
+ *
27
+ * Required parameters:
28
+ * - `sessionId` - (string) ID of the session to retrieve events for
29
+ *
30
+ * Optional parameters:
31
+ * - `timeout` - (number) Request timeout in milliseconds
32
+ * - `version` - (string | number) API version to use
33
+ *
34
+ * @returns {Promise<SessionEvent[]>} Promise resolving to the list of session events
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * const events = await hitlApi.sessionEvents.getSessionEventsList({
39
+ * sessionId: 'session-id'
40
+ * });
41
+ * ```
42
+ *
43
+ * @remarks Makes a GET request to `/session-events`
44
+ * @public
45
+ */
9
46
  static getSessionEventsList(options: GetSessionEventsOptions): Promise<GetSessionEventsResponse>;
47
+ /**
48
+ * Retrieves events for multiple HitL sessions in bulk
49
+ *
50
+ * @param options - Configuration parameters for bulk event retrieval
51
+ *
52
+ * Required parameters:
53
+ * - `sessionIds` - (string[]) Array of session IDs to retrieve events for
54
+ *
55
+ * Optional parameters:
56
+ * - `timeout` - (number) Request timeout in milliseconds
57
+ * - `version` - (string | number) API version to use
58
+ *
59
+ * @returns {Promise<GetBulkSessionsEventsResponse>} Promise resolving to events for multiple sessions
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * const bulkEvents = await hitlApi.sessionEvents.getBulkSessionEventsList({
64
+ * sessionIds: ['session-id-1', 'session-id-2']
65
+ * });
66
+ * ```
67
+ *
68
+ * @remarks Makes a POST request to `/session-events/bulk`
69
+ * @public
70
+ */
10
71
  static getBulkSessionEventsList(options: GetBulkSessionEventsOptions): Promise<GetBulkSessionsEventsResponse>;
72
+ /**
73
+ * Adds new events to a HITL session
74
+ *
75
+ * @param options - Configuration parameters for adding session events
76
+ *
77
+ * Required parameters:
78
+ * - `events` - (Partial<SessionEvent>[]) Array of partial event objects
79
+ * - `sessionId` - (string) ID of the session to add events to
80
+ *
81
+ * Optional parameters:
82
+ * - `timeout` - (number) Request timeout in milliseconds
83
+ * - `version` - (string | number) API version to use
84
+ *
85
+ * @returns {Promise<AddEventsResult>} Promise resolving to the add operation result
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * const result = await hitlApi.sessionEvents.addEvents({
90
+ * sessionId: 'session-id',
91
+ * events: [
92
+ * { type: 'message', content: 'Hello' },
93
+ * { type: 'status', content: 'typing' }
94
+ * ]
95
+ * });
96
+ * ```
97
+ *
98
+ * @remarks Makes a POST request to `/session-events`
99
+ * @public
100
+ */
11
101
  static addEvents({ sessionId, events, ...options }: AddEventsOptions): Promise<AddEventsResponse>;
102
+ /**
103
+ * Retrieves count of unread events for specified sessions
104
+ *
105
+ * @param options - Configuration parameters for retrieving unread events count
106
+ *
107
+ * Required parameters:
108
+ * - `sessionIds` - (string[]) Array of session IDs to get events count for
109
+ *
110
+ * Optional parameters:
111
+ * - `agentId` - (string) ID of the agent to get unread events for
112
+ * - `timeout` - (number) Request timeout in milliseconds
113
+ * - `version` - (string | number) API version to use
114
+ *
115
+ * @returns {Promise<NewEventsCount>} Promise resolving to the unread events count
116
+ *
117
+ * @example
118
+ * ```typescript
119
+ * // Basic usage with required parameters
120
+ * const count = await hitlApi.sessionEvents.getNewEventsCount({
121
+ * sessionIds: ['session-id-1', 'session-id-2']
122
+ * });
123
+ * ```
124
+ *
125
+ * @remarks Makes a GET request to `/sessions-events/get-new-events`
126
+ * @public
127
+ */
12
128
  static getNewEventsCount({ agentId, ...options }: GetNewEventsCountOptions): Promise<GetNewEventsCountResponse>;
129
+ /**
130
+ * Records the last read event for a specific session
131
+ *
132
+ * @param options - Configuration parameters for saving last read event
133
+ *
134
+ * Required parameters:
135
+ * - `eventId` - (string) ID of the last read event
136
+ * - `eventTimestamp` - (string | number) Timestamp of the last read event
137
+ * - `sessionId` - (string) ID of the session
138
+ *
139
+ * Optional parameters:
140
+ * - `agentId` - (string) ID of the agent who read the event
141
+ * - `timeout` - (number) Request timeout in milliseconds
142
+ * - `version` - (string | number) API version to use
143
+ *
144
+ * @returns {Promise<void>} Promise resolving when the read status is saved
145
+ *
146
+ * @example
147
+ * ```typescript
148
+ * await hitlApi.sessionEvents.saveLastReadEvent({
149
+ * sessionId: 'session-id-1',
150
+ * eventId: 'event-id-2',
151
+ * eventTimestamp: Date.now()
152
+ * });
153
+ * ```
154
+ *
155
+ * @remarks Makes a POST request to `/sessions-events/save-read-event`
156
+ * @public
157
+ */
13
158
  static saveReadEventByUserId({ agentId, ...options }: SaveLastReadEventOptions): Promise<void>;
14
159
  }
15
160
  //# sourceMappingURL=SessionEvents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SessionEvents.d.ts","sourceRoot":"","sources":["../../../src/api/SessionEvents.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,2BAA2B,EAC3B,6BAA6B,EAC9B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAetC,qBAAa,aAAc,SAAQ,QAAQ;IACzC,SAAS,CAAC,MAAM,CAAC,UAAU,SAAoB;IAC/C,SAAS,CAAC,MAAM,CAAC,mBAAmB,SAAU;IAC9C,SAAS,CAAC,MAAM,CAAC,oBAAoB,SAAoB;IACzD,SAAS,CAAC,MAAM,CAAC,mBAAmB,SAAqB;WA0BrC,oBAAoB,CACtC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,wBAAwB,CAAC;WAsChB,wBAAwB,CAC1C,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,6BAA6B,CAAC;WA4C3B,SAAS,CACrB,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,gBAAgB,GAClD,OAAO,CAAC,iBAAiB,CAAC;WAsCT,iBAAiB,CACnC,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,wBAAwB,GAChD,OAAO,CAAC,yBAAyB,CAAC;WA6CjB,qBAAqB,CACvC,EAAE,OAAO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;;;;OA4BG;WACiB,qBAAqB,CACvC,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,wBAAwB,GAChD,OAAO,CAAC,IAAI,CAAC;CAejB"}
@@ -1,9 +1,118 @@
1
1
  import { GetSessionRelationsOptions, GetSessionRelationsResponse, CreateSessionRelationsOptions, CreateSessionRelationsResponse, DeleteSessionRelationsOptions } from '../types/session-relations';
2
2
  import { HITLBase } from './HITLBase';
3
+ /**
4
+ * Manages relationships between HitL (Human-in-the-Loop) sessions
5
+ *
6
+ * This class provides functionality to:
7
+ * - Retrieve session relationships
8
+ * - Create new relationships between sessions
9
+ * - Remove existing relationships
10
+ *
11
+ * @remarks
12
+ * - All methods in this class interact with the `/session-relations` endpoint
13
+ * @public
14
+ */
3
15
  export declare class SessionRelations extends HITLBase {
4
16
  protected static MODULE_URL: string;
17
+ /**
18
+ * Retrieves a list of HitL session relations based on specified criteria
19
+ *
20
+ * @param options - Configuration parameters for retrieving HitL session relations
21
+ *
22
+ * Required parameters:
23
+ * - `sessionIds` - (string[]) Array of session IDs to retrieve relations for
24
+ *
25
+ * Optional parameters:
26
+ * - `relations` - (string[]) Array of specific relation types to retrieve
27
+ * - `skipSessions` - (boolean) Whether to skip retrieving session details
28
+ * - `timeout` - (number) Request timeout in milliseconds
29
+ * - `version` - (string | number) API version to use
30
+ *
31
+ * @returns {Promise<GetSessionRelationsResponse>} Promise resolving to session relationships
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * // Get all relations and sessions from this relations for specific sessions
36
+ * const relations = await hitlApi.sessionRelations.getSessionRelations({
37
+ * sessionIds: ['session-id-1', 'session-id-2']
38
+ * });
39
+ *
40
+ * // Get specific relation types with session details skipped
41
+ * const relations = await hitlApi.sessionRelations.getSessionRelations({
42
+ * sessionIds: ['session-id-1'],
43
+ * relations: ['parent', 'child'],
44
+ * skipSessions: true
45
+ * });
46
+ * ```
47
+ *
48
+ * @remarks
49
+ * Makes a GET request to the `/session-relations` endpoint
50
+ * @public
51
+ */
5
52
  static getSessionRelations(options: GetSessionRelationsOptions): Promise<GetSessionRelationsResponse>;
53
+ /**
54
+ * Creates new relations between HitL sessions
55
+ *
56
+ * @param options - Configuration parameters for creating session relations
57
+ *
58
+ * Required parameters:
59
+ * - `relations` - ({@link SessionRelation}[]) Array of session relation objects to create
60
+ *
61
+ * Optional parameters:
62
+ * - `timeout` - (number) Request timeout in milliseconds
63
+ * - `version` - (string | number) API version to use
64
+ *
65
+ * @returns {Promise<SessionRelation[]>} Promise resolving to array of created session relations
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * const created = await hitlApi.sessionRelations.createSessionRelations({
70
+ * relations: [{
71
+ * aSessionId: 'session-id-1',
72
+ * bSessionId: 'session-id-2',
73
+ * relation: 'parent'
74
+ * }, {
75
+ * aSessionId: 'session-id-1',
76
+ * bSessionId: 'session-id-3',
77
+ * relation: 'parent'
78
+ * }]
79
+ * });
80
+ * ```
81
+ *
82
+ * @remarks
83
+ * Makes a POST request to the `/session-relations` endpoint
84
+ * @public
85
+ */
6
86
  static createSessionRelations(options: CreateSessionRelationsOptions): Promise<CreateSessionRelationsResponse>;
87
+ /**
88
+ * Deletes specified HitL session relationships
89
+ *
90
+ * @param options - Configuration parameters for deleting relationships
91
+ *
92
+ * Required parameters:
93
+ * - `relations` - ({@link SessionRelation}[]) Array of session relation objects to delete
94
+ *
95
+ * Optional parameters:
96
+ * - `timeout` - (number) Request timeout in milliseconds
97
+ * - `version` - (string | number) API version to use
98
+ *
99
+ * @returns {Promise<void>} Promise that resolves when deletion is complete
100
+ *
101
+ * @example
102
+ * ```typescript
103
+ * await hitlApi.sessionRelations.deleteSessionRelations({
104
+ * relations: [{
105
+ * aSessionId: 'session-id-1',
106
+ * bSessionId: 'session-id-2',
107
+ * relation: 'parent'
108
+ * }]
109
+ * });
110
+ * ```
111
+ *
112
+ * @remarks
113
+ * Makes a DELETE request to the `/session-relations` endpoint
114
+ * @public
115
+ */
7
116
  static deleteSessionRelations(options: DeleteSessionRelationsOptions): Promise<void>;
8
117
  }
9
118
  //# sourceMappingURL=SessionRelations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SessionRelations.d.ts","sourceRoot":"","sources":["../../../src/api/SessionRelations.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,0BAA0B,EAC1B,2BAA2B,EAC3B,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AActC,qBAAa,gBAAiB,SAAQ,QAAQ;IAC5C,SAAS,CAAC,MAAM,CAAC,UAAU,SAAuB;WAqCpC,mBAAmB,CAC/B,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,2BAA2B,CAAC;WA+CzB,sBAAsB,CAClC,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,8BAA8B,CAAC;WA2C5B,sBAAsB,CAClC,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,IAAI,CAAC;CAajB"}
1
+ {"version":3,"file":"SessionRelations.d.ts","sourceRoot":"","sources":["../../../src/api/SessionRelations.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,0BAA0B,EAC1B,2BAA2B,EAC3B,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAiB,SAAQ,QAAQ;IAC5C,SAAS,CAAC,MAAM,CAAC,UAAU,SAAuB;IAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;WACW,mBAAmB,CAC/B,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,2BAA2B,CAAC;IAcvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;WACW,sBAAsB,CAClC,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,8BAA8B,CAAC;IAc1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;WACW,sBAAsB,CAClC,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,IAAI,CAAC;CAajB"}