@uipath/uipath-typescript 1.3.11 → 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 (59) hide show
  1. package/dist/agent-memory/index.cjs +1772 -0
  2. package/dist/agent-memory/index.d.ts +588 -0
  3. package/dist/agent-memory/index.mjs +1770 -0
  4. package/dist/agents/index.cjs +1995 -0
  5. package/dist/agents/index.d.ts +961 -0
  6. package/dist/agents/index.mjs +1993 -0
  7. package/dist/assets/index.cjs +171 -39
  8. package/dist/assets/index.d.ts +84 -5
  9. package/dist/assets/index.mjs +171 -39
  10. package/dist/attachments/index.cjs +53 -15
  11. package/dist/attachments/index.d.ts +1 -0
  12. package/dist/attachments/index.mjs +53 -15
  13. package/dist/buckets/index.cjs +151 -130
  14. package/dist/buckets/index.d.ts +198 -84
  15. package/dist/buckets/index.mjs +151 -130
  16. package/dist/cases/index.cjs +220 -23
  17. package/dist/cases/index.d.ts +148 -10
  18. package/dist/cases/index.mjs +220 -24
  19. package/dist/conversational-agent/index.cjs +140 -66
  20. package/dist/conversational-agent/index.d.ts +190 -122
  21. package/dist/conversational-agent/index.mjs +140 -66
  22. package/dist/core/index.cjs +445 -108
  23. package/dist/core/index.d.ts +15 -0
  24. package/dist/core/index.mjs +445 -108
  25. package/dist/entities/index.cjs +365 -102
  26. package/dist/entities/index.d.ts +446 -114
  27. package/dist/entities/index.mjs +365 -102
  28. package/dist/feedback/index.cjs +53 -15
  29. package/dist/feedback/index.d.ts +1 -0
  30. package/dist/feedback/index.mjs +53 -15
  31. package/dist/governance/index.cjs +1789 -0
  32. package/dist/governance/index.d.ts +598 -0
  33. package/dist/governance/index.mjs +1787 -0
  34. package/dist/index.cjs +1453 -444
  35. package/dist/index.d.ts +4150 -1742
  36. package/dist/index.mjs +1452 -445
  37. package/dist/index.umd.js +5035 -4009
  38. package/dist/jobs/index.cjs +53 -15
  39. package/dist/jobs/index.d.ts +1 -0
  40. package/dist/jobs/index.mjs +53 -15
  41. package/dist/maestro-processes/index.cjs +189 -27
  42. package/dist/maestro-processes/index.d.ts +131 -9
  43. package/dist/maestro-processes/index.mjs +189 -27
  44. package/dist/orchestrator-du-module/index.cjs +1788 -0
  45. package/dist/orchestrator-du-module/index.d.ts +757 -0
  46. package/dist/orchestrator-du-module/index.mjs +1785 -0
  47. package/dist/processes/index.cjs +53 -15
  48. package/dist/processes/index.d.ts +1 -0
  49. package/dist/processes/index.mjs +53 -15
  50. package/dist/queues/index.cjs +53 -15
  51. package/dist/queues/index.d.ts +1 -0
  52. package/dist/queues/index.mjs +53 -15
  53. package/dist/tasks/index.cjs +116 -19
  54. package/dist/tasks/index.d.ts +110 -4
  55. package/dist/tasks/index.mjs +117 -20
  56. package/dist/traces/index.cjs +340 -15
  57. package/dist/traces/index.d.ts +483 -2
  58. package/dist/traces/index.mjs +339 -16
  59. package/package.json +42 -2
@@ -386,6 +386,24 @@ exports.TaskActivityType = void 0;
386
386
  TaskActivityType["BulkCompleted"] = "BulkCompleted";
387
387
  TaskActivityType["FirstOpened"] = "FirstOpened";
388
388
  })(exports.TaskActivityType || (exports.TaskActivityType = {}));
389
+ /**
390
+ * Defines how a task assignment is distributed.
391
+ *
392
+ * Defaults to {@link TaskAssignmentCriteria.SingleUser} (a direct single-user
393
+ * assignment) when not specified. The group-based criteria tell Action Center
394
+ * how to distribute the task across the members of a directory group.
395
+ */
396
+ exports.TaskAssignmentCriteria = void 0;
397
+ (function (TaskAssignmentCriteria) {
398
+ /** Assigned to a single user, like a direct assignment. */
399
+ TaskAssignmentCriteria["SingleUser"] = "SingleUser";
400
+ /** Assigned to the group member with the fewest pending tasks. */
401
+ TaskAssignmentCriteria["Workload"] = "Workload";
402
+ /** Assigned to all users in the group. */
403
+ TaskAssignmentCriteria["AllUsers"] = "AllUsers";
404
+ /** Assigned in a round-robin manner across the group's members. */
405
+ TaskAssignmentCriteria["RoundRobin"] = "RoundRobin";
406
+ })(exports.TaskAssignmentCriteria || (exports.TaskAssignmentCriteria = {}));
389
407
 
390
408
  /**
391
409
  * Maps numeric TaskStatus values (from API) to TaskStatus enum values.
@@ -463,17 +481,19 @@ function createTaskMethods(taskData, service) {
463
481
  async assign(options) {
464
482
  if (!taskData.id)
465
483
  throw new Error('Task ID is undefined');
484
+ const criteria = options.assignmentCriteria !== undefined ? { assignmentCriteria: options.assignmentCriteria } : {};
466
485
  const assignmentOptions = 'userId' in options && options.userId !== undefined
467
- ? { taskId: taskData.id, userId: options.userId }
468
- : { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail };
486
+ ? { taskId: taskData.id, userId: options.userId, ...criteria }
487
+ : { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail, ...criteria };
469
488
  return service.assign(assignmentOptions);
470
489
  },
471
490
  async reassign(options) {
472
491
  if (!taskData.id)
473
492
  throw new Error('Task ID is undefined');
493
+ const criteria = options.assignmentCriteria !== undefined ? { assignmentCriteria: options.assignmentCriteria } : {};
474
494
  const assignmentOptions = 'userId' in options && options.userId !== undefined
475
- ? { taskId: taskData.id, userId: options.userId }
476
- : { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail };
495
+ ? { taskId: taskData.id, userId: options.userId, ...criteria }
496
+ : { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail, ...criteria };
477
497
  return service.reassign(assignmentOptions);
478
498
  },
479
499
  async unassign() {
@@ -979,6 +999,32 @@ function getLimitedPageSize(pageSize) {
979
999
  */
980
1000
  const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
981
1001
  isBrowser && window.self != window.top && window.location.href.includes('source=ActionCenter');
1002
+ const _params = isBrowser ? new URLSearchParams(window.location.search) : null;
1003
+ /**
1004
+ * True when the coded app has been loaded inside a host frame that explicitly
1005
+ * opted into token delegation by adding `?host=embed` to the iframe src URL.
1006
+ */
1007
+ const isHostEmbedded = isBrowser && window.self !== window.top && _params?.get('host') === 'embed';
1008
+ /**
1009
+ * The validated parent origin, read from the `?basedomain=` query param set
1010
+ * by the embedding host in the iframe src URL.
1011
+ * Mirrors the same mechanism used by ActionCenterTokenManager.
1012
+ * Non-null only when `?host=embed` is present and `?basedomain=` is a valid URL.
1013
+ */
1014
+ (() => {
1015
+ if (!isHostEmbedded)
1016
+ return null;
1017
+ const basedomain = _params?.get('basedomain');
1018
+ if (!basedomain)
1019
+ return null;
1020
+ try {
1021
+ return new URL(basedomain).origin;
1022
+ }
1023
+ catch {
1024
+ console.warn('embeddingOrigin: basedomain query param is not a valid URL', basedomain);
1025
+ return null;
1026
+ }
1027
+ })();
982
1028
 
983
1029
  /**
984
1030
  * Base64 encoding/decoding
@@ -1159,12 +1205,18 @@ class PaginationHelpers {
1159
1205
  * @returns Promise resolving to a paginated result
1160
1206
  */
1161
1207
  static async getAllPaginated(params) {
1162
- const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1208
+ const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1163
1209
  const endpoint = getEndpoint(folderId);
1164
1210
  const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
1211
+ // On POST, the caller's options go in the body; queryParams stays in the URL.
1212
+ // On GET, everything is URL — queryParams merges with additionalParams.
1213
+ const isPost = method === HTTP_METHODS.POST;
1214
+ const requestSpec = isPost
1215
+ ? { body: additionalParams, params: queryParams }
1216
+ : { params: { ...additionalParams, ...queryParams } };
1165
1217
  const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
1166
1218
  headers,
1167
- params: additionalParams,
1219
+ ...requestSpec,
1168
1220
  pagination: {
1169
1221
  paginationType: options.paginationType || PaginationType.OFFSET,
1170
1222
  itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
@@ -1189,7 +1241,7 @@ class PaginationHelpers {
1189
1241
  * @returns Promise resolving to an object with data and totalCount
1190
1242
  */
1191
1243
  static async getAllNonPaginated(params) {
1192
- const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1244
+ const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1193
1245
  // Set default field names
1194
1246
  const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
1195
1247
  const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
@@ -1199,17 +1251,18 @@ class PaginationHelpers {
1199
1251
  // Make the API call based on method
1200
1252
  let response;
1201
1253
  if (method === HTTP_METHODS.POST) {
1202
- response = await serviceAccess.post(endpoint, additionalParams, { headers });
1254
+ response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
1203
1255
  }
1204
1256
  else {
1205
1257
  response = await serviceAccess.get(endpoint, {
1206
- params: additionalParams,
1258
+ params: { ...additionalParams, ...queryParams },
1207
1259
  headers
1208
1260
  });
1209
1261
  }
1210
1262
  // Extract and transform items from response
1211
- // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1212
- const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
1263
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
1264
+ // itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
1265
+ const rawItems = Array.isArray(response.data) ? response.data : resolveNestedField(response.data, itemsField);
1213
1266
  const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
1214
1267
  const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
1215
1268
  // Parse items - automatically handle JSON string responses
@@ -1255,8 +1308,9 @@ class PaginationHelpers {
1255
1308
  getEndpoint: config.getEndpoint,
1256
1309
  folderId,
1257
1310
  headers: config.headers,
1258
- paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
1311
+ paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
1259
1312
  additionalParams: prefixedOptions,
1313
+ queryParams: config.queryParams,
1260
1314
  transformFn: config.transformFn,
1261
1315
  method: config.method,
1262
1316
  options: {
@@ -1274,6 +1328,7 @@ class PaginationHelpers {
1274
1328
  folderId,
1275
1329
  headers: config.headers,
1276
1330
  additionalParams: prefixedOptions,
1331
+ queryParams: config.queryParams,
1277
1332
  transformFn: config.transformFn,
1278
1333
  method: config.method,
1279
1334
  options: {
@@ -1896,18 +1951,17 @@ class BaseService {
1896
1951
  const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
1897
1952
  // Prepare request parameters based on pagination type
1898
1953
  const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
1899
- // For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
1954
+ // Route pagination state to wherever the API expects it (body for POST, URL for GET).
1955
+ // Caller-supplied options.body / options.params are respected as-is — the api-client
1956
+ // already handles params (URL) and body (request body) independently for every method.
1900
1957
  if (method.toUpperCase() === 'POST') {
1901
1958
  const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
1902
1959
  options.body = {
1903
1960
  ...existingBody,
1904
- ...options.params,
1905
1961
  ...requestParams
1906
1962
  };
1907
- options.params = undefined;
1908
1963
  }
1909
1964
  else {
1910
- // Merge pagination parameters with existing parameters
1911
1965
  options.params = {
1912
1966
  ...options.params,
1913
1967
  ...requestParams
@@ -1944,6 +1998,8 @@ class BaseService {
1944
1998
  // When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
1945
1999
  // When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
1946
2000
  const convertToSkip = paginationParams?.convertToSkip ?? true;
2001
+ // When true, sends pageNumber - 1 (for 0-based APIs). Default false (1-based).
2002
+ const zeroBased = paginationParams?.zeroBased ?? false;
1947
2003
  requestParams[pageSizeParam] = limitedPageSize;
1948
2004
  if (convertToSkip) {
1949
2005
  if (params.pageNumber && params.pageNumber > 1) {
@@ -1951,7 +2007,8 @@ class BaseService {
1951
2007
  }
1952
2008
  }
1953
2009
  else {
1954
- requestParams[offsetParam] = params.pageNumber || 1;
2010
+ const sdkPageNumber = params.pageNumber || 1;
2011
+ requestParams[offsetParam] = zeroBased ? sdkPageNumber - 1 : sdkPageNumber;
1955
2012
  }
1956
2013
  {
1957
2014
  requestParams[countParam] = true;
@@ -1980,8 +2037,9 @@ class BaseService {
1980
2037
  const totalCountField = fields.totalCountField || 'totalRecordCount';
1981
2038
  const continuationTokenField = fields.continuationTokenField || 'continuationToken';
1982
2039
  // Extract items and metadata
1983
- // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1984
- const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
2040
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
2041
+ // itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
2042
+ const items = Array.isArray(response.data) ? response.data : (resolveNestedField(response.data, itemsField) || []);
1985
2043
  const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
1986
2044
  const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
1987
2045
  const continuationToken = response.data[continuationTokenField];
@@ -2306,6 +2364,26 @@ class TaskService extends BaseService {
2306
2364
  * }
2307
2365
  * ]);
2308
2366
  * ```
2367
+ *
2368
+ * @example Group assignment
2369
+ * ```typescript
2370
+ * import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
2371
+ *
2372
+ * // Assign to a directory group by userId + criteria — Action Center
2373
+ * // distributes the task across the group's members based on the criteria
2374
+ * const result = await tasks.assign({
2375
+ * taskId: 123,
2376
+ * userId: 456, // a DirectoryGroup id from tasks.getUsers()
2377
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
2378
+ * });
2379
+ *
2380
+ * // ...or identify the group by name instead of id
2381
+ * const result2 = await tasks.assign({
2382
+ * taskId: 123,
2383
+ * userNameOrEmail: "My Group",
2384
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
2385
+ * });
2386
+ * ```
2309
2387
  */
2310
2388
  async assign(taskAssignments) {
2311
2389
  // Normalize input to array
@@ -2357,6 +2435,25 @@ class TaskService extends BaseService {
2357
2435
  * }
2358
2436
  * ]);
2359
2437
  * ```
2438
+ *
2439
+ * @example Group reassignment
2440
+ * ```typescript
2441
+ * import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
2442
+ *
2443
+ * // Reassign to a directory group by userId + criteria
2444
+ * const result = await tasks.reassign({
2445
+ * taskId: 123,
2446
+ * userId: 456, // a DirectoryGroup id from tasks.getUsers()
2447
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
2448
+ * });
2449
+ *
2450
+ * // ...or identify the group by name instead of id
2451
+ * const result2 = await tasks.reassign({
2452
+ * taskId: 123,
2453
+ * userNameOrEmail: "My Group",
2454
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
2455
+ * });
2456
+ * ```
2360
2457
  */
2361
2458
  async reassign(taskAssignments) {
2362
2459
  // Normalize input to array
@@ -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
  /**
@@ -705,6 +771,7 @@ interface RequestWithPaginationOptions extends RequestSpec {
705
771
  tokenParam?: string;
706
772
  countParam?: string;
707
773
  convertToSkip?: boolean;
774
+ zeroBased?: boolean;
708
775
  };
709
776
  };
710
777
  }
@@ -1065,6 +1132,26 @@ declare class TaskService extends BaseService implements TaskServiceModel {
1065
1132
  * }
1066
1133
  * ]);
1067
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
+ * ```
1068
1155
  */
1069
1156
  assign(taskAssignments: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
1070
1157
  /**
@@ -1103,6 +1190,25 @@ declare class TaskService extends BaseService implements TaskServiceModel {
1103
1190
  * }
1104
1191
  * ]);
1105
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
+ * ```
1106
1212
  */
1107
1213
  reassign(taskAssignments: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise<OperationResponse<TaskAssignmentOptions[] | TaskAssignmentResponse[]>>;
1108
1214
  /**
@@ -1187,5 +1293,5 @@ declare class TaskService extends BaseService implements TaskServiceModel {
1187
1293
  private addDefaultExpand;
1188
1294
  }
1189
1295
 
1190
- 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 };
1191
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 };