@uipath/uipath-typescript 1.4.0 → 1.4.1

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 (48) hide show
  1. package/dist/agent-memory/index.cjs +16 -9
  2. package/dist/agent-memory/index.mjs +16 -9
  3. package/dist/agents/index.cjs +278 -9
  4. package/dist/agents/index.d.ts +465 -6
  5. package/dist/agents/index.mjs +279 -10
  6. package/dist/assets/index.cjs +16 -9
  7. package/dist/assets/index.mjs +16 -9
  8. package/dist/attachments/index.cjs +16 -9
  9. package/dist/attachments/index.mjs +16 -9
  10. package/dist/buckets/index.cjs +114 -124
  11. package/dist/buckets/index.d.ts +197 -84
  12. package/dist/buckets/index.mjs +114 -124
  13. package/dist/cases/index.cjs +79 -13
  14. package/dist/cases/index.d.ts +30 -3
  15. package/dist/cases/index.mjs +79 -13
  16. package/dist/conversational-agent/index.cjs +16 -9
  17. package/dist/conversational-agent/index.mjs +16 -9
  18. package/dist/core/index.cjs +35 -6
  19. package/dist/core/index.mjs +35 -6
  20. package/dist/entities/index.cjs +253 -69
  21. package/dist/entities/index.d.ts +343 -116
  22. package/dist/entities/index.mjs +253 -69
  23. package/dist/feedback/index.cjs +16 -9
  24. package/dist/feedback/index.mjs +16 -9
  25. package/dist/governance/index.cjs +16 -9
  26. package/dist/governance/index.mjs +16 -9
  27. package/dist/index.cjs +529 -193
  28. package/dist/index.d.ts +2141 -750
  29. package/dist/index.mjs +529 -194
  30. package/dist/index.umd.js +529 -193
  31. package/dist/jobs/index.cjs +16 -9
  32. package/dist/jobs/index.mjs +16 -9
  33. package/dist/maestro-processes/index.cjs +16 -9
  34. package/dist/maestro-processes/index.mjs +16 -9
  35. package/dist/orchestrator-du-module/index.cjs +1788 -0
  36. package/dist/orchestrator-du-module/index.d.ts +757 -0
  37. package/dist/orchestrator-du-module/index.mjs +1785 -0
  38. package/dist/processes/index.cjs +16 -9
  39. package/dist/processes/index.mjs +16 -9
  40. package/dist/queues/index.cjs +16 -9
  41. package/dist/queues/index.mjs +16 -9
  42. package/dist/tasks/index.cjs +79 -13
  43. package/dist/tasks/index.d.ts +109 -4
  44. package/dist/tasks/index.mjs +80 -14
  45. package/dist/traces/index.cjs +303 -9
  46. package/dist/traces/index.d.ts +482 -2
  47. package/dist/traces/index.mjs +302 -10
  48. package/package.json +11 -1
@@ -285,22 +285,49 @@ interface RawTaskGetResponse extends TaskBaseResponse {
285
285
  actionLabel?: string | null;
286
286
  taskSlaDetails?: TaskSlaDetail[] | null;
287
287
  completedByUser?: UserLoginInfo | null;
288
- taskAssignmentCriteria?: string;
288
+ taskAssignmentCriteria?: TaskAssignmentCriteria;
289
289
  taskAssignees?: UserLoginInfo[] | null;
290
290
  taskSource?: TaskSource | null;
291
291
  processingTime?: number | null;
292
292
  data?: Record<string, unknown> | null;
293
293
  }
294
+ /**
295
+ * Defines how a task assignment is distributed.
296
+ *
297
+ * Defaults to {@link TaskAssignmentCriteria.SingleUser} (a direct single-user
298
+ * assignment) when not specified. The group-based criteria tell Action Center
299
+ * how to distribute the task across the members of a directory group.
300
+ */
301
+ declare enum TaskAssignmentCriteria {
302
+ /** Assigned to a single user, like a direct assignment. */
303
+ SingleUser = "SingleUser",
304
+ /** Assigned to the group member with the fewest pending tasks. */
305
+ Workload = "Workload",
306
+ /** Assigned to all users in the group. */
307
+ AllUsers = "AllUsers",
308
+ /** Assigned in a round-robin manner across the group's members. */
309
+ RoundRobin = "RoundRobin"
310
+ }
294
311
  /**
295
312
  * Options for task assignment operations when called from a task instance
296
- * Requires either userId or userNameOrEmail, but not both
313
+ * Requires either userId or userNameOrEmail, but not both. Optionally accepts
314
+ * an assignment criteria; defaults to a single-user assignment, set a group
315
+ * criteria (e.g. {@link TaskAssignmentCriteria.AllUsers}) for a directory group.
297
316
  */
298
- type TaskAssignOptions = {
317
+ type TaskAssignOptions = ({
299
318
  userId: number;
300
319
  userNameOrEmail?: never;
301
320
  } | {
302
321
  userId?: never;
303
322
  userNameOrEmail: string;
323
+ }) & {
324
+ /**
325
+ * How the assignment is distributed. Optional — defaults to
326
+ * {@link TaskAssignmentCriteria.SingleUser} (a direct single-user assignment).
327
+ * Set a group criteria (e.g. {@link TaskAssignmentCriteria.AllUsers}) to
328
+ * distribute the task across a directory group's members.
329
+ */
330
+ assignmentCriteria?: TaskAssignmentCriteria;
304
331
  };
305
332
  /**
306
333
  * Options for task assignment operations when called from the service
@@ -520,6 +547,26 @@ interface TaskServiceModel {
520
547
  * { taskId: <taskId2>, userNameOrEmail: "user@example.com" }
521
548
  * ]);
522
549
  * ```
550
+ *
551
+ * @example Group assignment
552
+ * ```typescript
553
+ * import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
554
+ *
555
+ * // Assign to a directory group by userId + criteria — Action Center
556
+ * // distributes the task across the group's members based on the criteria
557
+ * const result = await tasks.assign({
558
+ * taskId: <taskId>,
559
+ * userId: <groupId>, // a DirectoryGroup id from tasks.getUsers()
560
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
561
+ * });
562
+ *
563
+ * // ...or identify the group by name instead of id
564
+ * const result2 = await tasks.assign({
565
+ * taskId: <taskId>,
566
+ * userNameOrEmail: "<groupName>",
567
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
568
+ * });
569
+ * ```
523
570
  */
524
571
  assign(options: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
525
572
  /**
@@ -554,6 +601,25 @@ interface TaskServiceModel {
554
601
  * { taskId: <taskId2>, userNameOrEmail: "user@example.com" }
555
602
  * ]);
556
603
  * ```
604
+ *
605
+ * @example Group reassignment
606
+ * ```typescript
607
+ * import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
608
+ *
609
+ * // Reassign to a directory group by userId + criteria
610
+ * const result = await tasks.reassign({
611
+ * taskId: <taskId>,
612
+ * userId: <groupId>, // a DirectoryGroup id from tasks.getUsers()
613
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
614
+ * });
615
+ *
616
+ * // ...or identify the group by name instead of id
617
+ * const result2 = await tasks.reassign({
618
+ * taskId: <taskId>,
619
+ * userNameOrEmail: "<groupName>",
620
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
621
+ * });
622
+ * ```
557
623
  */
558
624
  reassign(options: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
559
625
  /**
@@ -1066,6 +1132,26 @@ declare class TaskService extends BaseService implements TaskServiceModel {
1066
1132
  * }
1067
1133
  * ]);
1068
1134
  * ```
1135
+ *
1136
+ * @example Group assignment
1137
+ * ```typescript
1138
+ * import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
1139
+ *
1140
+ * // Assign to a directory group by userId + criteria — Action Center
1141
+ * // distributes the task across the group's members based on the criteria
1142
+ * const result = await tasks.assign({
1143
+ * taskId: 123,
1144
+ * userId: 456, // a DirectoryGroup id from tasks.getUsers()
1145
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
1146
+ * });
1147
+ *
1148
+ * // ...or identify the group by name instead of id
1149
+ * const result2 = await tasks.assign({
1150
+ * taskId: 123,
1151
+ * userNameOrEmail: "My Group",
1152
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
1153
+ * });
1154
+ * ```
1069
1155
  */
1070
1156
  assign(taskAssignments: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
1071
1157
  /**
@@ -1104,6 +1190,25 @@ declare class TaskService extends BaseService implements TaskServiceModel {
1104
1190
  * }
1105
1191
  * ]);
1106
1192
  * ```
1193
+ *
1194
+ * @example Group reassignment
1195
+ * ```typescript
1196
+ * import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
1197
+ *
1198
+ * // Reassign to a directory group by userId + criteria
1199
+ * const result = await tasks.reassign({
1200
+ * taskId: 123,
1201
+ * userId: 456, // a DirectoryGroup id from tasks.getUsers()
1202
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
1203
+ * });
1204
+ *
1205
+ * // ...or identify the group by name instead of id
1206
+ * const result2 = await tasks.reassign({
1207
+ * taskId: 123,
1208
+ * userNameOrEmail: "My Group",
1209
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
1210
+ * });
1211
+ * ```
1107
1212
  */
1108
1213
  reassign(taskAssignments: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
1109
1214
  /**
@@ -1188,5 +1293,5 @@ declare class TaskService extends BaseService implements TaskServiceModel {
1188
1293
  private addDefaultExpand;
1189
1294
  }
1190
1295
 
1191
- export { TaskActivityType, TaskPriority, TaskService, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskUserType, TaskService as Tasks, createTaskWithMethods };
1296
+ export { TaskActivityType, TaskAssignmentCriteria, TaskPriority, TaskService, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskUserType, TaskService as Tasks, createTaskWithMethods };
1192
1297
  export type { RawTaskCreateResponse, RawTaskGetResponse, Tag, TaskActivity, TaskAssignOptions, TaskAssignment, TaskAssignmentOptions, TaskAssignmentResponse, TaskBaseResponse, TaskCompleteOptions, TaskCompletionOptions, TaskCreateOptions, TaskCreateResponse, TaskGetAllOptions, TaskGetByIdOptions, TaskGetResponse, TaskGetUsersOptions, TaskMethods, TaskServiceModel, TaskSlaDetail, TaskSource, TasksUnassignOptions, UserLoginInfo };
@@ -384,6 +384,24 @@ var TaskActivityType;
384
384
  TaskActivityType["BulkCompleted"] = "BulkCompleted";
385
385
  TaskActivityType["FirstOpened"] = "FirstOpened";
386
386
  })(TaskActivityType || (TaskActivityType = {}));
387
+ /**
388
+ * Defines how a task assignment is distributed.
389
+ *
390
+ * Defaults to {@link TaskAssignmentCriteria.SingleUser} (a direct single-user
391
+ * assignment) when not specified. The group-based criteria tell Action Center
392
+ * how to distribute the task across the members of a directory group.
393
+ */
394
+ var TaskAssignmentCriteria;
395
+ (function (TaskAssignmentCriteria) {
396
+ /** Assigned to a single user, like a direct assignment. */
397
+ TaskAssignmentCriteria["SingleUser"] = "SingleUser";
398
+ /** Assigned to the group member with the fewest pending tasks. */
399
+ TaskAssignmentCriteria["Workload"] = "Workload";
400
+ /** Assigned to all users in the group. */
401
+ TaskAssignmentCriteria["AllUsers"] = "AllUsers";
402
+ /** Assigned in a round-robin manner across the group's members. */
403
+ TaskAssignmentCriteria["RoundRobin"] = "RoundRobin";
404
+ })(TaskAssignmentCriteria || (TaskAssignmentCriteria = {}));
387
405
 
388
406
  /**
389
407
  * Maps numeric TaskStatus values (from API) to TaskStatus enum values.
@@ -461,17 +479,19 @@ function createTaskMethods(taskData, service) {
461
479
  async assign(options) {
462
480
  if (!taskData.id)
463
481
  throw new Error('Task ID is undefined');
482
+ const criteria = options.assignmentCriteria !== undefined ? { assignmentCriteria: options.assignmentCriteria } : {};
464
483
  const assignmentOptions = 'userId' in options && options.userId !== undefined
465
- ? { taskId: taskData.id, userId: options.userId }
466
- : { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail };
484
+ ? { taskId: taskData.id, userId: options.userId, ...criteria }
485
+ : { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail, ...criteria };
467
486
  return service.assign(assignmentOptions);
468
487
  },
469
488
  async reassign(options) {
470
489
  if (!taskData.id)
471
490
  throw new Error('Task ID is undefined');
491
+ const criteria = options.assignmentCriteria !== undefined ? { assignmentCriteria: options.assignmentCriteria } : {};
472
492
  const assignmentOptions = 'userId' in options && options.userId !== undefined
473
- ? { taskId: taskData.id, userId: options.userId }
474
- : { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail };
493
+ ? { taskId: taskData.id, userId: options.userId, ...criteria }
494
+ : { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail, ...criteria };
475
495
  return service.reassign(assignmentOptions);
476
496
  },
477
497
  async unassign() {
@@ -1183,12 +1203,18 @@ class PaginationHelpers {
1183
1203
  * @returns Promise resolving to a paginated result
1184
1204
  */
1185
1205
  static async getAllPaginated(params) {
1186
- const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1206
+ const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1187
1207
  const endpoint = getEndpoint(folderId);
1188
1208
  const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
1209
+ // On POST, the caller's options go in the body; queryParams stays in the URL.
1210
+ // On GET, everything is URL — queryParams merges with additionalParams.
1211
+ const isPost = method === HTTP_METHODS.POST;
1212
+ const requestSpec = isPost
1213
+ ? { body: additionalParams, params: queryParams }
1214
+ : { params: { ...additionalParams, ...queryParams } };
1189
1215
  const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
1190
1216
  headers,
1191
- params: additionalParams,
1217
+ ...requestSpec,
1192
1218
  pagination: {
1193
1219
  paginationType: options.paginationType || PaginationType.OFFSET,
1194
1220
  itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
@@ -1213,7 +1239,7 @@ class PaginationHelpers {
1213
1239
  * @returns Promise resolving to an object with data and totalCount
1214
1240
  */
1215
1241
  static async getAllNonPaginated(params) {
1216
- const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1242
+ const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1217
1243
  // Set default field names
1218
1244
  const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
1219
1245
  const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
@@ -1223,11 +1249,11 @@ class PaginationHelpers {
1223
1249
  // Make the API call based on method
1224
1250
  let response;
1225
1251
  if (method === HTTP_METHODS.POST) {
1226
- response = await serviceAccess.post(endpoint, additionalParams, { headers });
1252
+ response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
1227
1253
  }
1228
1254
  else {
1229
1255
  response = await serviceAccess.get(endpoint, {
1230
- params: additionalParams,
1256
+ params: { ...additionalParams, ...queryParams },
1231
1257
  headers
1232
1258
  });
1233
1259
  }
@@ -1282,6 +1308,7 @@ class PaginationHelpers {
1282
1308
  headers: config.headers,
1283
1309
  paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
1284
1310
  additionalParams: prefixedOptions,
1311
+ queryParams: config.queryParams,
1285
1312
  transformFn: config.transformFn,
1286
1313
  method: config.method,
1287
1314
  options: {
@@ -1299,6 +1326,7 @@ class PaginationHelpers {
1299
1326
  folderId,
1300
1327
  headers: config.headers,
1301
1328
  additionalParams: prefixedOptions,
1329
+ queryParams: config.queryParams,
1302
1330
  transformFn: config.transformFn,
1303
1331
  method: config.method,
1304
1332
  options: {
@@ -1921,18 +1949,17 @@ class BaseService {
1921
1949
  const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
1922
1950
  // Prepare request parameters based on pagination type
1923
1951
  const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
1924
- // For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
1952
+ // Route pagination state to wherever the API expects it (body for POST, URL for GET).
1953
+ // Caller-supplied options.body / options.params are respected as-is — the api-client
1954
+ // already handles params (URL) and body (request body) independently for every method.
1925
1955
  if (method.toUpperCase() === 'POST') {
1926
1956
  const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
1927
1957
  options.body = {
1928
1958
  ...existingBody,
1929
- ...options.params,
1930
1959
  ...requestParams
1931
1960
  };
1932
- options.params = undefined;
1933
1961
  }
1934
1962
  else {
1935
- // Merge pagination parameters with existing parameters
1936
1963
  options.params = {
1937
1964
  ...options.params,
1938
1965
  ...requestParams
@@ -2335,6 +2362,26 @@ class TaskService extends BaseService {
2335
2362
  * }
2336
2363
  * ]);
2337
2364
  * ```
2365
+ *
2366
+ * @example Group assignment
2367
+ * ```typescript
2368
+ * import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
2369
+ *
2370
+ * // Assign to a directory group by userId + criteria — Action Center
2371
+ * // distributes the task across the group's members based on the criteria
2372
+ * const result = await tasks.assign({
2373
+ * taskId: 123,
2374
+ * userId: 456, // a DirectoryGroup id from tasks.getUsers()
2375
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
2376
+ * });
2377
+ *
2378
+ * // ...or identify the group by name instead of id
2379
+ * const result2 = await tasks.assign({
2380
+ * taskId: 123,
2381
+ * userNameOrEmail: "My Group",
2382
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
2383
+ * });
2384
+ * ```
2338
2385
  */
2339
2386
  async assign(taskAssignments) {
2340
2387
  // Normalize input to array
@@ -2386,6 +2433,25 @@ class TaskService extends BaseService {
2386
2433
  * }
2387
2434
  * ]);
2388
2435
  * ```
2436
+ *
2437
+ * @example Group reassignment
2438
+ * ```typescript
2439
+ * import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
2440
+ *
2441
+ * // Reassign to a directory group by userId + criteria
2442
+ * const result = await tasks.reassign({
2443
+ * taskId: 123,
2444
+ * userId: 456, // a DirectoryGroup id from tasks.getUsers()
2445
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
2446
+ * });
2447
+ *
2448
+ * // ...or identify the group by name instead of id
2449
+ * const result2 = await tasks.reassign({
2450
+ * taskId: 123,
2451
+ * userNameOrEmail: "My Group",
2452
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
2453
+ * });
2454
+ * ```
2389
2455
  */
2390
2456
  async reassign(taskAssignments) {
2391
2457
  // Normalize input to array
@@ -2551,4 +2617,4 @@ __decorate([
2551
2617
  track('Tasks.Complete')
2552
2618
  ], TaskService.prototype, "complete", null);
2553
2619
 
2554
- export { TaskActivityType, TaskPriority, TaskService, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskUserType, TaskService as Tasks, createTaskWithMethods };
2620
+ export { TaskActivityType, TaskAssignmentCriteria, TaskPriority, TaskService, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskUserType, TaskService as Tasks, createTaskWithMethods };