@uipath/uipath-typescript 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) 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/document-understanding/index.cjs +84 -84
  21. package/dist/document-understanding/index.d.ts +2 -1
  22. package/dist/document-understanding/index.mjs +1 -1
  23. package/dist/entities/index.cjs +253 -69
  24. package/dist/entities/index.d.ts +343 -116
  25. package/dist/entities/index.mjs +253 -69
  26. package/dist/feedback/index.cjs +16 -9
  27. package/dist/feedback/index.mjs +16 -9
  28. package/dist/governance/index.cjs +16 -9
  29. package/dist/governance/index.mjs +16 -9
  30. package/dist/index.cjs +529 -193
  31. package/dist/index.d.ts +2141 -750
  32. package/dist/index.mjs +529 -194
  33. package/dist/index.umd.js +529 -193
  34. package/dist/jobs/index.cjs +16 -9
  35. package/dist/jobs/index.mjs +16 -9
  36. package/dist/maestro-processes/index.cjs +16 -9
  37. package/dist/maestro-processes/index.mjs +16 -9
  38. package/dist/orchestrator-du-module/index.cjs +1788 -0
  39. package/dist/orchestrator-du-module/index.d.ts +757 -0
  40. package/dist/orchestrator-du-module/index.mjs +1785 -0
  41. package/dist/processes/index.cjs +16 -9
  42. package/dist/processes/index.mjs +16 -9
  43. package/dist/queues/index.cjs +16 -9
  44. package/dist/queues/index.mjs +16 -9
  45. package/dist/tasks/index.cjs +79 -13
  46. package/dist/tasks/index.d.ts +109 -4
  47. package/dist/tasks/index.mjs +80 -14
  48. package/dist/traces/index.cjs +303 -9
  49. package/dist/traces/index.d.ts +482 -2
  50. package/dist/traces/index.mjs +302 -10
  51. package/package.json +11 -1
package/dist/index.umd.js CHANGED
@@ -4500,6 +4500,24 @@
4500
4500
  TaskActivityType["BulkCompleted"] = "BulkCompleted";
4501
4501
  TaskActivityType["FirstOpened"] = "FirstOpened";
4502
4502
  })(exports.TaskActivityType || (exports.TaskActivityType = {}));
4503
+ /**
4504
+ * Defines how a task assignment is distributed.
4505
+ *
4506
+ * Defaults to {@link TaskAssignmentCriteria.SingleUser} (a direct single-user
4507
+ * assignment) when not specified. The group-based criteria tell Action Center
4508
+ * how to distribute the task across the members of a directory group.
4509
+ */
4510
+ exports.TaskAssignmentCriteria = void 0;
4511
+ (function (TaskAssignmentCriteria) {
4512
+ /** Assigned to a single user, like a direct assignment. */
4513
+ TaskAssignmentCriteria["SingleUser"] = "SingleUser";
4514
+ /** Assigned to the group member with the fewest pending tasks. */
4515
+ TaskAssignmentCriteria["Workload"] = "Workload";
4516
+ /** Assigned to all users in the group. */
4517
+ TaskAssignmentCriteria["AllUsers"] = "AllUsers";
4518
+ /** Assigned in a round-robin manner across the group's members. */
4519
+ TaskAssignmentCriteria["RoundRobin"] = "RoundRobin";
4520
+ })(exports.TaskAssignmentCriteria || (exports.TaskAssignmentCriteria = {}));
4503
4521
 
4504
4522
  /**
4505
4523
  * Base path constants for different services
@@ -4656,6 +4674,9 @@
4656
4674
  const DATA_FABRIC_ENDPOINTS = {
4657
4675
  ENTITY: {
4658
4676
  GET_ALL: `${DATAFABRIC_BASE}/api/Entity`,
4677
+ // Lists tenant-level and folder-level entities together.
4678
+ // Used by getAll when includeFolderEntities is true.
4679
+ GET_ALL_V2: `${DATAFABRIC_BASE}/api/v2/Entity`,
4659
4680
  GET_ENTITY_RECORDS: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read`,
4660
4681
  GET_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
4661
4682
  GET_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read/${recordId}`,
@@ -4739,6 +4760,15 @@
4739
4760
  return true;
4740
4761
  return new Date() >= tokenInfo.expiresAt;
4741
4762
  }
4763
+ /**
4764
+ * The validated host origin when the app is running as a trusted, generic
4765
+ * host-embedded app (`?host=embed&basedomain=<origin>` with an allowlisted
4766
+ * UiPath origin); otherwise null. Shared by TokenManager (to create the
4767
+ * EmbeddedTokenManager) and UiPath init (to seed an empty token so getValidToken
4768
+ * can bootstrap the postMessage token flow), which previously duplicated this
4769
+ * condition inline.
4770
+ */
4771
+ const trustedEmbeddingOrigin = isHostEmbedded && embeddingOrigin && isValidHostOrigin(embeddingOrigin) ? embeddingOrigin : null;
4742
4772
  /**
4743
4773
  * Waits for the next window message that satisfies `filter`.
4744
4774
  * Rejects if the AbortSignal fires before a matching message arrives.
@@ -9081,7 +9111,7 @@
9081
9111
  * SDK's public API.
9082
9112
  */
9083
9113
  /** SDK version placeholder — patched by the SDK publish workflow. */
9084
- const SDK_VERSION = '1.4.0';
9114
+ const SDK_VERSION = '1.4.2';
9085
9115
  const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
9086
9116
  const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
9087
9117
  const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
@@ -9261,8 +9291,8 @@
9261
9291
  this.actionCenterTokenManager = new ActionCenterTokenManager(config, (tokenInfo) => this.setToken(tokenInfo));
9262
9292
  this.isOAuth = false;
9263
9293
  }
9264
- else if (isHostEmbedded && embeddingOrigin && isValidHostOrigin(embeddingOrigin)) {
9265
- this.embeddedTokenManager = new EmbeddedTokenManager(embeddingOrigin, config, tokenInfo => this.setToken(tokenInfo));
9294
+ else if (trustedEmbeddingOrigin) {
9295
+ this.embeddedTokenManager = new EmbeddedTokenManager(trustedEmbeddingOrigin, config, tokenInfo => this.setToken(tokenInfo));
9266
9296
  this.isOAuth = false;
9267
9297
  }
9268
9298
  }
@@ -10321,10 +10351,12 @@
10321
10351
  });
10322
10352
  // Track SDK initialization
10323
10353
  trackEvent('Sdk.Auth');
10324
- /** Auto-initialize for secret-based auth
10325
- * When viewed in Action Center, initialize tokenInfo with empty token. When an sdk call is made Action Center passes the token to sdk.
10354
+ /** Auto-initialize for secret-based auth, Action Center, and generic host-embedded apps.
10355
+ * When viewed in Action Center or embedded in a UiPath host frame via the UIP protocol,
10356
+ * initialize tokenInfo with an empty token so getValidToken() can bootstrap via postMessage.
10357
+ * When an sdk call is made, the host passes the token to the sdk.
10326
10358
  */
10327
- if (hasSecretAuth || isInActionCenter) {
10359
+ if (hasSecretAuth || isInActionCenter || trustedEmbeddingOrigin) {
10328
10360
  __classPrivateFieldGet(this, _UiPath_authService, "f").authenticateWithSecret(config.secret ?? '');
10329
10361
  __classPrivateFieldSet(this, _UiPath_initialized, true, "f");
10330
10362
  }
@@ -11550,12 +11582,18 @@
11550
11582
  * @returns Promise resolving to a paginated result
11551
11583
  */
11552
11584
  static async getAllPaginated(params) {
11553
- const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
11585
+ const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
11554
11586
  const endpoint = getEndpoint(folderId);
11555
11587
  const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
11588
+ // On POST, the caller's options go in the body; queryParams stays in the URL.
11589
+ // On GET, everything is URL — queryParams merges with additionalParams.
11590
+ const isPost = method === HTTP_METHODS.POST;
11591
+ const requestSpec = isPost
11592
+ ? { body: additionalParams, params: queryParams }
11593
+ : { params: { ...additionalParams, ...queryParams } };
11556
11594
  const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
11557
11595
  headers,
11558
- params: additionalParams,
11596
+ ...requestSpec,
11559
11597
  pagination: {
11560
11598
  paginationType: options.paginationType || PaginationType.OFFSET,
11561
11599
  itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
@@ -11580,7 +11618,7 @@
11580
11618
  * @returns Promise resolving to an object with data and totalCount
11581
11619
  */
11582
11620
  static async getAllNonPaginated(params) {
11583
- const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
11621
+ const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
11584
11622
  // Set default field names
11585
11623
  const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
11586
11624
  const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
@@ -11590,11 +11628,11 @@
11590
11628
  // Make the API call based on method
11591
11629
  let response;
11592
11630
  if (method === HTTP_METHODS.POST) {
11593
- response = await serviceAccess.post(endpoint, additionalParams, { headers });
11631
+ response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
11594
11632
  }
11595
11633
  else {
11596
11634
  response = await serviceAccess.get(endpoint, {
11597
- params: additionalParams,
11635
+ params: { ...additionalParams, ...queryParams },
11598
11636
  headers
11599
11637
  });
11600
11638
  }
@@ -11649,6 +11687,7 @@
11649
11687
  headers: config.headers,
11650
11688
  paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
11651
11689
  additionalParams: prefixedOptions,
11690
+ queryParams: config.queryParams,
11652
11691
  transformFn: config.transformFn,
11653
11692
  method: config.method,
11654
11693
  options: {
@@ -11666,6 +11705,7 @@
11666
11705
  folderId,
11667
11706
  headers: config.headers,
11668
11707
  additionalParams: prefixedOptions,
11708
+ queryParams: config.queryParams,
11669
11709
  transformFn: config.transformFn,
11670
11710
  method: config.method,
11671
11711
  options: {
@@ -11802,18 +11842,17 @@
11802
11842
  const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
11803
11843
  // Prepare request parameters based on pagination type
11804
11844
  const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
11805
- // For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
11845
+ // Route pagination state to wherever the API expects it (body for POST, URL for GET).
11846
+ // Caller-supplied options.body / options.params are respected as-is — the api-client
11847
+ // already handles params (URL) and body (request body) independently for every method.
11806
11848
  if (method.toUpperCase() === 'POST') {
11807
11849
  const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
11808
11850
  options.body = {
11809
11851
  ...existingBody,
11810
- ...options.params,
11811
11852
  ...requestParams
11812
11853
  };
11813
- options.params = undefined;
11814
11854
  }
11815
11855
  else {
11816
- // Merge pagination parameters with existing parameters
11817
11856
  options.params = {
11818
11857
  ...options.params,
11819
11858
  ...requestParams
@@ -12227,6 +12266,14 @@
12227
12266
  SqlFieldType["MULTILINE"] = "MULTILINE";
12228
12267
  })(SqlFieldType || (SqlFieldType = {}));
12229
12268
 
12269
+ /**
12270
+ * Numeric type IDs that pair with {@link EntityType} on reference payloads
12271
+ * (entityType + entityTypeId travel together in `referenceEntity` /
12272
+ * `referenceChoiceSet` bodies on cross-folder schema upserts).
12273
+ */
12274
+ const ENTITY_TYPE_IDS = {
12275
+ [exports.EntityType.ChoiceSet]: 1,
12276
+ };
12230
12277
  /**
12231
12278
  * Maps fields for Entities
12232
12279
  */
@@ -12360,7 +12407,7 @@
12360
12407
  * Gets entity metadata by entity ID with attached operation methods
12361
12408
  *
12362
12409
  * @param id - UUID of the entity
12363
- * @param options - Optional {@link EntityGetByIdOptions} (e.g. `folderKey` for folder-scoped entities)
12410
+ * @param options - Optional {@link EntityGetByIdOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
12364
12411
  * @returns Promise resolving to entity metadata with schema information and operation methods
12365
12412
  *
12366
12413
  * @example
@@ -12400,7 +12447,7 @@
12400
12447
  * Gets entity records by entity ID
12401
12448
  *
12402
12449
  * @param entityId - UUID of the entity
12403
- * @param options - Query options including expansionLevel and pagination options
12450
+ * @param options - Query options including expansionLevel and pagination options The `folderKey` property is **experimental**.
12404
12451
  * @returns Promise resolving to an array of entity records or paginated response
12405
12452
  *
12406
12453
  * @example
@@ -12428,6 +12475,9 @@
12428
12475
  * cursor: paginatedResponse.nextCursor,
12429
12476
  * expansionLevel: 1
12430
12477
  * });
12478
+ *
12479
+ * // Folder-scoped entity: pass the entity's folder key
12480
+ * const records = await entities.getAllRecords("<entityId>", { folderKey: "<folderKey>" });
12431
12481
  * ```
12432
12482
  */
12433
12483
  async getAllRecords(entityId, options) {
@@ -12457,7 +12507,7 @@
12457
12507
  *
12458
12508
  * @param entityId - UUID of the entity
12459
12509
  * @param recordId - UUID of the record
12460
- * @param options - Query options including expansionLevel
12510
+ * @param options - Query options including `expansionLevel` and `folderKey` The `folderKey` property is **experimental**.
12461
12511
  * @returns Promise resolving to the entity record
12462
12512
  *
12463
12513
  * @example
@@ -12469,6 +12519,11 @@
12469
12519
  * const record = await sdk.entities.getRecordById(<entityId>, <recordId>, {
12470
12520
  * expansionLevel: 1
12471
12521
  * });
12522
+ *
12523
+ * // Folder-scoped entity: pass the entity's folder key
12524
+ * const record = await sdk.entities.getRecordById(<entityId>, <recordId>, {
12525
+ * folderKey: "<folderKey>"
12526
+ * });
12472
12527
  * ```
12473
12528
  */
12474
12529
  async getRecordById(entityId, recordId, options = {}) {
@@ -12483,7 +12538,7 @@
12483
12538
  *
12484
12539
  * @param entityId - UUID of the entity
12485
12540
  * @param data - Record to insert
12486
- * @param options - Insert options
12541
+ * @param options - Insert options The `folderKey` property is **experimental**.
12487
12542
  * @returns Promise resolving to the inserted record with generated record ID
12488
12543
  *
12489
12544
  * @example
@@ -12499,6 +12554,11 @@
12499
12554
  * const result = await entities.insertRecordById("<entityId>", { name: "John", age: 30 }, {
12500
12555
  * expansionLevel: 1
12501
12556
  * });
12557
+ *
12558
+ * // Folder-scoped entity: pass the entity's folder key
12559
+ * await entities.insertRecordById("<entityId>", { name: "John", age: 30 }, {
12560
+ * folderKey: "<folderKey>"
12561
+ * });
12502
12562
  * ```
12503
12563
  */
12504
12564
  async insertRecordById(id, data, options = {}) {
@@ -12516,7 +12576,7 @@
12516
12576
  *
12517
12577
  * @param entityId - UUID of the entity
12518
12578
  * @param data - Array of records to insert
12519
- * @param options - Insert options
12579
+ * @param options - Insert options The `folderKey` property is **experimental**.
12520
12580
  * @returns Promise resolving to insert response
12521
12581
  *
12522
12582
  * @example
@@ -12539,6 +12599,12 @@
12539
12599
  * expansionLevel: 1,
12540
12600
  * failOnFirst: true
12541
12601
  * });
12602
+ *
12603
+ * // Folder-scoped entity: pass the entity's folder key
12604
+ * await entities.insertRecordsById("<entityId>", [
12605
+ * { name: "John", age: 30 },
12606
+ * { name: "Jane", age: 25 }
12607
+ * ], { folderKey: "<folderKey>" });
12542
12608
  * ```
12543
12609
  */
12544
12610
  async insertRecordsById(id, data, options = {}) {
@@ -12558,7 +12624,7 @@
12558
12624
  * @param entityId - UUID of the entity
12559
12625
  * @param recordId - UUID of the record to update
12560
12626
  * @param data - Key-value pairs of fields to update
12561
- * @param options - Update options
12627
+ * @param options - Update options The `folderKey` property is **experimental**.
12562
12628
  * @returns Promise resolving to the updated record
12563
12629
  *
12564
12630
  * @example
@@ -12574,6 +12640,11 @@
12574
12640
  * const result = await entities.updateRecordById("<entityId>", "<recordId>", { name: "John Updated", age: 31 }, {
12575
12641
  * expansionLevel: 1
12576
12642
  * });
12643
+ *
12644
+ * // Folder-scoped entity: pass the entity's folder key
12645
+ * await entities.updateRecordById("<entityId>", "<recordId>", { name: "John Updated" }, {
12646
+ * folderKey: "<folderKey>"
12647
+ * });
12577
12648
  * ```
12578
12649
  */
12579
12650
  async updateRecordById(entityId, recordId, data, options = {}) {
@@ -12592,7 +12663,7 @@
12592
12663
  * @param entityId - UUID of the entity
12593
12664
  * @param data - Array of records to update. Each record MUST contain the record Id,
12594
12665
  * otherwise the update will fail.
12595
- * @param options - Update options
12666
+ * @param options - Update options The `folderKey` property is **experimental**.
12596
12667
  * @returns Promise resolving to update response
12597
12668
  *
12598
12669
  * @example
@@ -12615,6 +12686,11 @@
12615
12686
  * expansionLevel: 1,
12616
12687
  * failOnFirst: true
12617
12688
  * });
12689
+ *
12690
+ * // Folder-scoped entity: pass the entity's folder key
12691
+ * await entities.updateRecordsById("<entityId>", [
12692
+ * { Id: "123", name: "John Updated" }
12693
+ * ], { folderKey: "<folderKey>" });
12618
12694
  * ```
12619
12695
  */
12620
12696
  async updateRecordsById(id, data, options = {}) {
@@ -12635,7 +12711,7 @@
12635
12711
  *
12636
12712
  * @param entityId - UUID of the entity
12637
12713
  * @param recordIds - Array of record UUIDs to delete
12638
- * @param options - Delete options
12714
+ * @param options - Delete options The `folderKey` property is **experimental**.
12639
12715
  * @returns Promise resolving to delete response
12640
12716
  *
12641
12717
  * @example
@@ -12648,6 +12724,11 @@
12648
12724
  * const result = await entities.deleteRecordsById("<entityId>", [
12649
12725
  * "<recordId-1>", "<recordId-2>"
12650
12726
  * ]);
12727
+ *
12728
+ * // Folder-scoped entity: pass the entity's folder key
12729
+ * await entities.deleteRecordsById("<entityId>", [
12730
+ * "<recordId-1>", "<recordId-2>"
12731
+ * ], { folderKey: "<folderKey>" });
12651
12732
  * ```
12652
12733
  */
12653
12734
  async deleteRecordsById(id, recordIds, options = {}) {
@@ -12668,7 +12749,7 @@
12668
12749
  *
12669
12750
  * @param entityId - UUID of the entity
12670
12751
  * @param recordId - UUID of the record to delete
12671
- * @param options - Optional {@link EntityDeleteRecordByIdOptions} (e.g. `folderKey` for folder-scoped entities)
12752
+ * @param options - Optional {@link EntityDeleteRecordByIdOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
12672
12753
  * @returns Promise resolving to void on success
12673
12754
  * @example
12674
12755
  * ```typescript
@@ -12686,8 +12767,14 @@
12686
12767
  await this.delete(DATA_FABRIC_ENDPOINTS.ENTITY.DELETE_RECORD_BY_ID(entityId, recordId), { headers: createHeaders({ [FOLDER_KEY]: options?.folderKey }) });
12687
12768
  }
12688
12769
  /**
12689
- * Gets all entities in the system
12770
+ * Gets entities in the tenant.
12690
12771
  *
12772
+ * Three call modes:
12773
+ * - `getAll()` — default. Returns only tenant-level entities.
12774
+ * - `getAll({ folderKey: "<uuid>" })` — preferred for folder-scoped data. Returns only entities in that folder.
12775
+ * - `getAll({ includeFolderEntities: true })` — returns tenant-level **and** folder-level entities together. `folderKey` is preferred over `includeFolderEntities` when both are set.
12776
+ *
12777
+ * @param options - Optional {@link EntityGetAllOptions} (`folderKey` to list a single folder's entities — preferred when scoping to a folder; `includeFolderEntities: true` to list tenant + folder entities together) The `folderKey` property is **experimental**.
12691
12778
  * @returns Promise resolving to an array of entity metadata
12692
12779
  *
12693
12780
  * @example
@@ -12696,15 +12783,29 @@
12696
12783
  *
12697
12784
  * const entities = new Entities(sdk);
12698
12785
  *
12699
- * // Get all entities
12700
- * const allEntities = await entities.getAll();
12786
+ * // Tenant-only (default)
12787
+ * const tenantEntities = await entities.getAll();
12788
+ *
12789
+ * // A single folder's entities (preferred when targeting a specific folder)
12790
+ * const folderEntities = await entities.getAll({ folderKey: "<folderKey>" });
12791
+ *
12792
+ * // Tenant + folder entities together
12793
+ * const allEntities = await entities.getAll({ includeFolderEntities: true });
12701
12794
  *
12702
12795
  * // Call operations on an entity
12703
- * const records = await allEntities[0].getAllRecords();
12796
+ * const records = await tenantEntities[0].getAllRecords();
12704
12797
  * ```
12705
12798
  */
12706
- async getAll() {
12707
- const response = await this.get(DATA_FABRIC_ENDPOINTS.ENTITY.GET_ALL);
12799
+ async getAll(options) {
12800
+ // folderKey is preferred over includeFolderEntities: when present, scope to that folder
12801
+ // via the v1 endpoint + header. Only when no folderKey is given AND includeFolderEntities
12802
+ // is explicitly true does the SDK switch to the v2 endpoint (returns tenant + folder
12803
+ // entities together). Default (no options or includeFolderEntities omitted) stays on
12804
+ // the v1 endpoint = tenant only.
12805
+ const endpoint = !options?.folderKey && options?.includeFolderEntities
12806
+ ? DATA_FABRIC_ENDPOINTS.ENTITY.GET_ALL_V2
12807
+ : DATA_FABRIC_ENDPOINTS.ENTITY.GET_ALL;
12808
+ const response = await this.get(endpoint, { headers: createHeaders({ [FOLDER_KEY]: options?.folderKey }) });
12708
12809
  // Apply transformations
12709
12810
  const entities = response.data.map(entity => {
12710
12811
  // Transform each entity
@@ -12719,7 +12820,7 @@
12719
12820
  * Queries entity records with filters, sorting, aggregates, and pagination
12720
12821
  *
12721
12822
  * @param id - UUID of the entity
12722
- * @param options - Query options including filterGroup, selectedFields, sortOptions, aggregates, groupBy, and pagination
12823
+ * @param options - Query options including filterGroup, selectedFields, sortOptions, aggregates, groupBy, and pagination The `folderKey` property is **experimental**.
12723
12824
  * @returns Promise resolving to {@link NonPaginatedResponse} without pagination options,
12724
12825
  * or {@link PaginatedResponse} when `pageSize`, `cursor`, or `jumpToPage` are provided
12725
12826
  *
@@ -12766,18 +12867,24 @@
12766
12867
  * { function: EntityAggregateFunction.Avg, field: "amount", alias: "avgAmount" },
12767
12868
  * ],
12768
12869
  * });
12870
+ *
12871
+ * // Folder-scoped entity: pass the entity's folder key
12872
+ * await entities.queryRecordsById("<entityId>", {
12873
+ * filterGroup: { queryFilters: [{ fieldName: "status", operator: QueryFilterOperator.Equals, value: "active" }] },
12874
+ * folderKey: "<folderKey>",
12875
+ * });
12769
12876
  * ```
12770
12877
  */
12771
12878
  async queryRecordsById(id, options) {
12772
- // folderKey is header-only destructure it out so PaginationHelpers doesn't include
12773
- // it in the POST body alongside the query filters.
12774
- const { folderKey, ...rest } = options ?? {};
12879
+ // folderKey is header-only; expansionLevel must be sent as a query param by PaginationHelpers.
12880
+ const { folderKey, expansionLevel, ...rest } = options ?? {};
12775
12881
  const downstreamOptions = options === undefined ? undefined : rest;
12776
12882
  return PaginationHelpers.getAll({
12777
12883
  serviceAccess: this.createPaginationServiceAccess(),
12778
12884
  getEndpoint: () => DATA_FABRIC_ENDPOINTS.ENTITY.QUERY_BY_ID(id),
12779
12885
  method: HTTP_METHODS.POST,
12780
12886
  headers: createHeaders({ [FOLDER_KEY]: folderKey }),
12887
+ queryParams: createParams({ expansionLevel }),
12781
12888
  pagination: {
12782
12889
  paginationType: PaginationType.OFFSET,
12783
12890
  itemsField: ENTITY_PAGINATION.ITEMS_FIELD,
@@ -12788,7 +12895,7 @@
12788
12895
  countParam: ENTITY_OFFSET_PARAMS.COUNT_PARAM
12789
12896
  }
12790
12897
  },
12791
- excludeFromPrefix: ['expansionLevel', 'filterGroup', 'selectedFields', 'sortOptions', 'aggregates', 'groupBy']
12898
+ excludeFromPrefix: ['filterGroup', 'selectedFields', 'sortOptions', 'aggregates', 'groupBy']
12792
12899
  }, downstreamOptions);
12793
12900
  }
12794
12901
  /**
@@ -12796,7 +12903,7 @@
12796
12903
  *
12797
12904
  * @param id - UUID of the entity
12798
12905
  * @param file - CSV file to import (Blob, File, or Uint8Array)
12799
- * @param options - Optional {@link EntityImportRecordsByIdOptions} (e.g. `folderKey` for folder-scoped entities)
12906
+ * @param options - Optional {@link EntityImportRecordsByIdOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
12800
12907
  * @returns Promise resolving to import result with record counts
12801
12908
  *
12802
12909
  * @example
@@ -12839,7 +12946,7 @@
12839
12946
  * @param entityId - UUID of the entity
12840
12947
  * @param recordId - UUID of the record containing the attachment
12841
12948
  * @param fieldName - Name of the File-type field containing the attachment
12842
- * @param options - Optional {@link EntityDownloadAttachmentOptions} (e.g. `folderKey` for folder-scoped entities)
12949
+ * @param options - Optional {@link EntityDownloadAttachmentOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
12843
12950
  * @returns Promise resolving to Blob containing the file content
12844
12951
  *
12845
12952
  * @example
@@ -12877,7 +12984,7 @@
12877
12984
  * @param recordId - UUID of the record to upload the attachment to
12878
12985
  * @param fieldName - Name of the File-type field
12879
12986
  * @param file - File to upload (Blob, File, or Uint8Array)
12880
- * @param options - Optional {@link EntityUploadAttachmentOptions} (e.g. `expansionLevel`, `folderKey` for folder-scoped entities)
12987
+ * @param options - Optional {@link EntityUploadAttachmentOptions} (e.g. `expansionLevel`, `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
12881
12988
  * @returns Promise resolving to {@link EntityUploadAttachmentResponse}
12882
12989
  *
12883
12990
  * @example
@@ -12922,7 +13029,7 @@
12922
13029
  * @param entityId - UUID of the entity
12923
13030
  * @param recordId - UUID of the record containing the attachment
12924
13031
  * @param fieldName - Name of the File-type field containing the attachment
12925
- * @param options - Optional {@link EntityDeleteAttachmentOptions} (e.g. `folderKey` for folder-scoped entities)
13032
+ * @param options - Optional {@link EntityDeleteAttachmentOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
12926
13033
  * @returns Promise resolving to {@link EntityDeleteAttachmentResponse}
12927
13034
  *
12928
13035
  * @example
@@ -12977,7 +13084,7 @@
12977
13084
  * @param name - Entity name — must start with a letter and contain
12978
13085
  * only letters, numbers, and underscores (e.g., `"productCatalog"`).
12979
13086
  * @param fields - Array of field definitions
12980
- * @param options - Optional entity-level settings ({@link EntityCreateOptions})
13087
+ * @param options - Optional entity-level settings ({@link EntityCreateOptions}) The `folderKey` property is **experimental**.
12981
13088
  * @returns Promise resolving to the ID of the created entity
12982
13089
  *
12983
13090
  * @example
@@ -12993,17 +13100,36 @@
12993
13100
  * { fieldName: "price", type: EntityFieldDataType.DECIMAL, decimalPrecision: 4, maxValue: 999999, minValue: 0 },
12994
13101
  * { fieldName: "quantity", type: EntityFieldDataType.INTEGER, maxValue: 10000, minValue: 1, defaultValue: "0" },
12995
13102
  * ]);
13103
+ *
13104
+ * // Cross-folder references — link a folder-scoped entity to entities and
13105
+ * // system choice sets that live in another folder or at the tenant level.
13106
+ * await entities.create("orderLine", [
13107
+ * {
13108
+ * fieldName: "order",
13109
+ * type: EntityFieldDataType.RELATIONSHIP,
13110
+ * referenceEntityId: "<orderEntityId>",
13111
+ * referenceFieldId: "<orderEntityPkId>",
13112
+ * referenceFolderKey: "<otherFolderKey>", // target lives in a different folder
13113
+ * },
13114
+ * {
13115
+ * fieldName: "userType",
13116
+ * type: EntityFieldDataType.CHOICE_SET_SINGLE,
13117
+ * choiceSetId: "<systemUserTypeChoiceSetId>", // tenant-level system choice set
13118
+ * // referenceFolderKey omitted → SDK looks up the target at tenant scope
13119
+ * },
13120
+ * ], { folderKey: "<sourceFolderKey>" });
12996
13121
  * ```
12997
13122
  * @internal
12998
13123
  */
12999
13124
  async create(name, fields, options) {
13000
13125
  const opts = options ?? {};
13126
+ const fieldPayloads = await this.buildFieldsWithReferenceMeta(fields);
13001
13127
  const payload = {
13002
13128
  ...(opts.description !== undefined && { description: opts.description }),
13003
13129
  displayName: opts.displayName ?? name,
13004
13130
  entityDefinition: {
13005
13131
  name,
13006
- fields: fields.map(f => this.buildSchemaFieldPayload(f)),
13132
+ fields: fieldPayloads,
13007
13133
  folderId: opts.folderKey ?? DATA_FABRIC_TENANT_FOLDER_ID,
13008
13134
  isRbacEnabled: opts.isRbacEnabled ?? false,
13009
13135
  isInsightsEnabled: opts.isAnalyticsEnabled ?? false,
@@ -13017,7 +13143,7 @@
13017
13143
  * Deletes a Data Fabric entity and all its records
13018
13144
  *
13019
13145
  * @param id - UUID of the entity to delete
13020
- * @param options - Optional {@link EntityDeleteByIdOptions} (e.g. `folderKey` for folder-scoped entities)
13146
+ * @param options - Optional {@link EntityDeleteByIdOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
13021
13147
  * @returns Promise resolving when the entity is deleted
13022
13148
  *
13023
13149
  * @example
@@ -13044,7 +13170,7 @@
13044
13170
  * overwrite each other's changes.
13045
13171
  *
13046
13172
  * @param id - UUID of the entity to update
13047
- * @param options - Changes to apply ({@link EntityUpdateByIdOptions})
13173
+ * @param options - Changes to apply ({@link EntityUpdateByIdOptions}) The `folderKey` property is **experimental**.
13048
13174
  * @returns Promise resolving when the update is complete
13049
13175
  *
13050
13176
  * @example
@@ -13156,10 +13282,9 @@
13156
13282
  };
13157
13283
  });
13158
13284
  }
13159
- // Build and append new fields
13160
13285
  const newFields = [];
13161
13286
  if (options.addFields?.length) {
13162
- newFields.push(...options.addFields.map(f => this.buildSchemaFieldPayload(f)));
13287
+ newFields.push(...await this.buildFieldsWithReferenceMeta(options.addFields));
13163
13288
  }
13164
13289
  await this.post(DATA_FABRIC_ENDPOINTS.ENTITY.UPSERT, {
13165
13290
  displayName: raw.displayName,
@@ -13257,8 +13382,39 @@
13257
13382
  return externalSource;
13258
13383
  });
13259
13384
  }
13385
+ async buildFieldsWithReferenceMeta(fields) {
13386
+ const metas = await Promise.all(fields.map(f => this.buildReferenceMeta(f)));
13387
+ return fields.map((f, i) => this.buildSchemaFieldPayload(f, metas[i]));
13388
+ }
13389
+ // Choice-set targets resolve server-side by NAME (the API rejects cross-folder
13390
+ // refs with empty target name even when folderId is supplied), so the SDK
13391
+ // fetches the name once for each cross-folder choice-set field. Relationship
13392
+ // targets resolve by folderId — no lookup needed.
13393
+ async buildReferenceMeta(field) {
13394
+ if (field.referenceFolderKey === undefined)
13395
+ return undefined;
13396
+ if (field.referenceEntityId === undefined && field.choiceSetId === undefined)
13397
+ return undefined;
13398
+ const folderId = field.referenceFolderKey;
13399
+ const meta = {};
13400
+ if (field.referenceEntityId !== undefined) {
13401
+ meta.referenceEntity = { id: field.referenceEntityId, folderId };
13402
+ }
13403
+ if (field.choiceSetId !== undefined) {
13404
+ const lookupFolderKey = folderId === DATA_FABRIC_TENANT_FOLDER_ID ? undefined : folderId;
13405
+ const target = await this.get(DATA_FABRIC_ENDPOINTS.ENTITY.GET_BY_ID(field.choiceSetId), { headers: createHeaders({ [FOLDER_KEY]: lookupFolderKey }) });
13406
+ meta.referenceChoiceSet = {
13407
+ id: field.choiceSetId,
13408
+ name: target.data.name,
13409
+ folderId,
13410
+ entityType: exports.EntityType.ChoiceSet,
13411
+ entityTypeId: ENTITY_TYPE_IDS[exports.EntityType.ChoiceSet],
13412
+ };
13413
+ }
13414
+ return meta;
13415
+ }
13260
13416
  /** Converts a user-facing EntityCreateFieldOptions to the raw API field payload */
13261
- buildSchemaFieldPayload(field) {
13417
+ buildSchemaFieldPayload(field, refMeta) {
13262
13418
  const fieldType = field.type ?? exports.EntityFieldDataType.STRING;
13263
13419
  this.validateFieldConstraints(fieldType, field, field.fieldName);
13264
13420
  const isRelationship = fieldType === exports.EntityFieldDataType.RELATIONSHIP;
@@ -13269,6 +13425,10 @@
13269
13425
  });
13270
13426
  }
13271
13427
  const mapping = EntitySchemaFieldTypeMap[fieldType];
13428
+ // Prefer the resolved {id, name, folderId} body so cross-folder targets resolve
13429
+ // server-side; fall back to a bare {id} when no meta was fetched.
13430
+ const referenceEntityBody = refMeta?.referenceEntity ?? (field.referenceEntityId === undefined ? undefined : { id: field.referenceEntityId });
13431
+ const referenceChoiceSetBody = refMeta?.referenceChoiceSet;
13272
13432
  return {
13273
13433
  name: field.fieldName,
13274
13434
  displayName: field.displayName ?? field.fieldName,
@@ -13287,7 +13447,8 @@
13287
13447
  ...(field.choiceSetId !== undefined && { choiceSetId: field.choiceSetId }),
13288
13448
  ...((isRelationship || isFile) && { isForeignKey: true }),
13289
13449
  ...(isRelationship && { referenceType: exports.ReferenceType.ManyToOne }),
13290
- ...(field.referenceEntityId !== undefined && { referenceEntity: { id: field.referenceEntityId } }),
13450
+ ...(referenceEntityBody !== undefined && { referenceEntity: referenceEntityBody }),
13451
+ ...(referenceChoiceSetBody !== undefined && { referenceChoiceSet: referenceChoiceSetBody }),
13291
13452
  ...(field.referenceFieldId !== undefined && { referenceField: { id: field.referenceFieldId } }),
13292
13453
  };
13293
13454
  }
@@ -13450,8 +13611,14 @@
13450
13611
 
13451
13612
  class ChoiceSetService extends BaseService {
13452
13613
  /**
13453
- * Gets all choice sets in the system
13614
+ * Gets choice sets in the tenant.
13454
13615
  *
13616
+ * Three call modes:
13617
+ * - `getAll()` — default. Returns only tenant-level choice sets.
13618
+ * - `getAll({ folderKey: "<uuid>" })` — preferred for folder-scoped data. Returns only choice sets in that folder.
13619
+ * - `getAll({ includeFolderChoiceSets: true })` — returns tenant-level **and** folder-level choice sets together. `folderKey` is preferred over `includeFolderChoiceSets` when both are set.
13620
+ *
13621
+ * @param options - Optional {@link ChoiceSetGetAllOptions} (`folderKey` to list a single folder's choice sets — preferred when scoping to a folder; `includeFolderChoiceSets: true` to list tenant + folder choice sets together) The `folderKey` property is **experimental**.
13455
13622
  * @returns Promise resolving to an array of choice set metadata
13456
13623
  *
13457
13624
  * @example
@@ -13460,18 +13627,33 @@
13460
13627
  *
13461
13628
  * const choiceSets = new ChoiceSets(sdk);
13462
13629
  *
13463
- * // Get all choice sets
13464
- * const allChoiceSets = await choiceSets.getAll();
13630
+ * // Tenant-only (default)
13631
+ * const tenantChoiceSets = await choiceSets.getAll();
13465
13632
  *
13466
- * // Iterate through choice sets
13467
- * allChoiceSets.forEach(choiceSet => {
13468
- * console.log(`ChoiceSet: ${choiceSet.displayName} (${choiceSet.name})`);
13469
- * console.log(`Description: ${choiceSet.description}`);
13470
- * });
13633
+ * // A single folder's choice sets (preferred when targeting a specific folder)
13634
+ * const folderChoiceSets = await choiceSets.getAll({ folderKey: "<folderKey>" });
13635
+ *
13636
+ * // Tenant + folder choice sets together
13637
+ * const allChoiceSets = await choiceSets.getAll({ includeFolderChoiceSets: true });
13471
13638
  * ```
13472
13639
  */
13473
- async getAll() {
13474
- const rawResponse = await this.get(DATA_FABRIC_ENDPOINTS.CHOICESETS.GET_ALL);
13640
+ async getAll(options) {
13641
+ return this.fetchAllChoiceSets(options);
13642
+ }
13643
+ /**
13644
+ * Internal helper that performs the choice-set fetch. Kept separate from the
13645
+ * public `getAll()` so that internal callers (e.g. `resolveChoiceSetName`)
13646
+ * can reuse it without triggering double `@track` telemetry.
13647
+ */
13648
+ async fetchAllChoiceSets(options) {
13649
+ // The choice-set endpoint returns cross-scope results when called without
13650
+ // a folder header. To stay tenant-only by default, send the tenant-marker
13651
+ // UUID as the folder key unless the caller explicitly opts into cross-scope
13652
+ // via includeFolderChoiceSets: true. folderKey is preferred over
13653
+ // includeFolderChoiceSets when both are set.
13654
+ const folderKey = options?.folderKey
13655
+ ?? (options?.includeFolderChoiceSets ? undefined : DATA_FABRIC_TENANT_FOLDER_ID);
13656
+ const rawResponse = await this.get(DATA_FABRIC_ENDPOINTS.CHOICESETS.GET_ALL, { headers: createHeaders({ [FOLDER_KEY]: folderKey }) });
13475
13657
  // Transform field names
13476
13658
  const data = rawResponse.data || [];
13477
13659
  return data.map(choiceSet => transformData(choiceSet, EntityMap));
@@ -13484,7 +13666,7 @@
13484
13666
  * - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
13485
13667
  *
13486
13668
  * @param choiceSetId - UUID of the choice set
13487
- * @param options - Pagination options
13669
+ * @param options - Pagination options and optional `folderKey` for folder-scoped choice sets The `folderKey` property is **experimental**.
13488
13670
  * @returns Promise resolving to choice set values or paginated result
13489
13671
  *
13490
13672
  * @example
@@ -13513,6 +13695,9 @@
13513
13695
  * if (page1.hasNextPage) {
13514
13696
  * const page2 = await choiceSets.getById(choiceSetId, { cursor: page1.nextCursor });
13515
13697
  * }
13698
+ *
13699
+ * // Folder-scoped choice set
13700
+ * const folderValues = await choiceSets.getById(choiceSetId, { folderKey: "<folderKey>" });
13516
13701
  * ```
13517
13702
  */
13518
13703
  async getById(choiceSetId, options) {
@@ -13521,11 +13706,16 @@
13521
13706
  const camelCased = pascalToCamelCaseKeys(item);
13522
13707
  return transformData(camelCased, EntityMap);
13523
13708
  };
13709
+ // folderKey is header-only — destructure it out so PaginationHelpers doesn't
13710
+ // include it in the POST body alongside pagination params.
13711
+ const { folderKey, ...rest } = options ?? {};
13712
+ const downstreamOptions = options === undefined ? undefined : rest;
13524
13713
  return PaginationHelpers.getAll({
13525
13714
  serviceAccess: this.createPaginationServiceAccess(),
13526
13715
  getEndpoint: () => DATA_FABRIC_ENDPOINTS.CHOICESETS.GET_BY_ID(choiceSetId),
13527
13716
  transformFn,
13528
13717
  method: HTTP_METHODS.POST,
13718
+ headers: createHeaders({ [FOLDER_KEY]: folderKey }),
13529
13719
  pagination: {
13530
13720
  paginationType: PaginationType.OFFSET,
13531
13721
  itemsField: CHOICESET_VALUES_PAGINATION.ITEMS_FIELD,
@@ -13536,7 +13726,7 @@
13536
13726
  countParam: ENTITY_OFFSET_PARAMS.COUNT_PARAM
13537
13727
  }
13538
13728
  }
13539
- }, options);
13729
+ }, downstreamOptions);
13540
13730
  }
13541
13731
  /**
13542
13732
  * Creates a new Data Fabric choice set
@@ -13544,7 +13734,7 @@
13544
13734
  * @param name - Choice set name. Must start with a
13545
13735
  * letter, may contain only letters, numbers, and underscores, length
13546
13736
  * 3–100 characters (e.g., `"expenseTypes"`).
13547
- * @param options - Optional choice-set-level settings ({@link ChoiceSetCreateOptions})
13737
+ * @param options - Optional choice-set-level settings ({@link ChoiceSetCreateOptions}) The `folderKey` property is **experimental**.
13548
13738
  * @returns Promise resolving to the UUID of the created choice set
13549
13739
  *
13550
13740
  * @example
@@ -13575,7 +13765,7 @@
13575
13765
  folderId: opts.folderKey ?? DATA_FABRIC_TENANT_FOLDER_ID,
13576
13766
  },
13577
13767
  };
13578
- const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.CREATE, payload);
13768
+ const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.CREATE, payload, { headers: createHeaders({ [FOLDER_KEY]: opts.folderKey }) });
13579
13769
  return response.data;
13580
13770
  }
13581
13771
  /**
@@ -13585,7 +13775,7 @@
13585
13775
  * the call throws `ValidationError` if both are omitted.
13586
13776
  *
13587
13777
  * @param choiceSetId - UUID of the choice set to update
13588
- * @param options - Metadata fields to change ({@link ChoiceSetUpdateOptions})
13778
+ * @param options - Metadata fields to change ({@link ChoiceSetUpdateOptions}) The `folderKey` property is **experimental**.
13589
13779
  * @returns Promise resolving when the update is complete
13590
13780
  *
13591
13781
  * @example
@@ -13610,12 +13800,13 @@
13610
13800
  await this.patch(DATA_FABRIC_ENDPOINTS.CHOICESETS.UPDATE(choiceSetId), {
13611
13801
  ...(options.displayName !== undefined && { displayName: options.displayName }),
13612
13802
  ...(options.description !== undefined && { description: options.description }),
13613
- });
13803
+ }, { headers: createHeaders({ [FOLDER_KEY]: options.folderKey }) });
13614
13804
  }
13615
13805
  /**
13616
13806
  * Deletes a Data Fabric choice set and all its values.
13617
13807
  *
13618
13808
  * @param choiceSetId - UUID of the choice set to delete
13809
+ * @param options - Optional {@link ChoiceSetDeleteByIdOptions} (e.g. `folderKey` for folder-scoped choice sets) The `folderKey` property is **experimental**.
13619
13810
  * @returns Promise resolving when the choice set is deleted
13620
13811
  *
13621
13812
  * @example
@@ -13625,18 +13816,21 @@
13625
13816
  * const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
13626
13817
  *
13627
13818
  * await choicesets.deleteById(expenseTypes.id);
13819
+ *
13820
+ * // Folder-scoped choice set
13821
+ * await choicesets.deleteById(expenseTypes.id, { folderKey: "<folderKey>" });
13628
13822
  * ```
13629
13823
  * @internal
13630
13824
  */
13631
- async deleteById(choiceSetId) {
13632
- await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.DELETE(choiceSetId), {});
13825
+ async deleteById(choiceSetId, options) {
13826
+ await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.DELETE(choiceSetId), {}, { headers: createHeaders({ [FOLDER_KEY]: options?.folderKey }) });
13633
13827
  }
13634
13828
  /**
13635
13829
  * Inserts a single value into a choice set.
13636
13830
  *
13637
13831
  * @param choiceSetId - UUID of the parent choice set
13638
13832
  * @param name - Identifier name of the new value (e.g., `"TRAVEL"`)
13639
- * @param options - Optional fields ({@link ChoiceSetValueInsertOptions})
13833
+ * @param options - Optional fields ({@link ChoiceSetValueInsertOptions}) The `folderKey` property is **experimental**.
13640
13834
  * @returns Promise resolving to the inserted value ({@link ChoiceSetValueInsertResponse})
13641
13835
  *
13642
13836
  * @example
@@ -13649,16 +13843,22 @@
13649
13843
  * displayName: 'Travel',
13650
13844
  * });
13651
13845
  * console.log(inserted.id);
13846
+ *
13847
+ * // Folder-scoped choice set: folderKey is required on the wire
13848
+ * await choicesets.insertValueById(expenseTypes.id, 'TRAVEL', {
13849
+ * displayName: 'Travel',
13850
+ * folderKey: "<folderKey>",
13851
+ * });
13652
13852
  * ```
13653
13853
  * @internal
13654
13854
  */
13655
13855
  async insertValueById(choiceSetId, name, options) {
13656
- const choiceSetName = await this.resolveChoiceSetName(choiceSetId);
13856
+ const choiceSetName = await this.resolveChoiceSetName(choiceSetId, options?.folderKey);
13657
13857
  const payload = {
13658
13858
  Name: name,
13659
13859
  ...(options?.displayName !== undefined && { DisplayName: options.displayName }),
13660
13860
  };
13661
- const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.INSERT_BY_NAME(choiceSetName), payload);
13861
+ const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.INSERT_BY_NAME(choiceSetName), payload, { headers: createHeaders({ [FOLDER_KEY]: options?.folderKey }) });
13662
13862
  const camelCased = pascalToCamelCaseKeys(response.data);
13663
13863
  return transformData(camelCased, EntityMap);
13664
13864
  }
@@ -13671,6 +13871,7 @@
13671
13871
  * @param choiceSetId - UUID of the parent choice set
13672
13872
  * @param valueId - UUID of the value to update
13673
13873
  * @param displayName - New human-readable display name for the value
13874
+ * @param options - Optional {@link ChoiceSetValueUpdateOptions} — pass `folderKey` for folder-scoped choice sets; omit for tenant-level. The `folderKey` property is **experimental**.
13674
13875
  * @returns Promise resolving to the updated value ({@link ChoiceSetValueUpdateResponse})
13675
13876
  *
13676
13877
  * @example
@@ -13682,13 +13883,18 @@
13682
13883
  * const travel = values.items.find(v => v.name === 'TRAVEL');
13683
13884
  *
13684
13885
  * await choicesets.updateValueById(expenseTypes.id, travel.id, 'Business Travel');
13886
+ *
13887
+ * // Folder-scoped choice set: folderKey is required on the wire
13888
+ * await choicesets.updateValueById(expenseTypes.id, travel.id, 'Business Travel', {
13889
+ * folderKey: "<folderKey>",
13890
+ * });
13685
13891
  * ```
13686
13892
  * @internal
13687
13893
  */
13688
- async updateValueById(choiceSetId, valueId, displayName) {
13689
- const choiceSetName = await this.resolveChoiceSetName(choiceSetId);
13894
+ async updateValueById(choiceSetId, valueId, displayName, options) {
13895
+ const choiceSetName = await this.resolveChoiceSetName(choiceSetId, options?.folderKey);
13690
13896
  const payload = { DisplayName: displayName };
13691
- const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.UPDATE_BY_NAME(choiceSetName, valueId), payload);
13897
+ const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.UPDATE_BY_NAME(choiceSetName, valueId), payload, { headers: createHeaders({ [FOLDER_KEY]: options?.folderKey }) });
13692
13898
  const camelCased = pascalToCamelCaseKeys(response.data);
13693
13899
  return transformData(camelCased, EntityMap);
13694
13900
  }
@@ -13697,6 +13903,7 @@
13697
13903
  *
13698
13904
  * @param choiceSetId - UUID of the parent choice set
13699
13905
  * @param valueIds - Array of value UUIDs to delete
13906
+ * @param options - Optional {@link ChoiceSetValueDeleteOptions} (e.g. `folderKey` for folder-scoped choice sets) The `folderKey` property is **experimental**.
13700
13907
  * @returns Promise resolving when the values are deleted
13701
13908
  *
13702
13909
  * @example
@@ -13706,14 +13913,20 @@
13706
13913
  * const idsToDelete = values.items.slice(0, 2).map(v => v.id);
13707
13914
  *
13708
13915
  * await choicesets.deleteValuesById('<choiceSetId>', idsToDelete);
13916
+ *
13917
+ * // Folder-scoped choice set
13918
+ * await choicesets.deleteValuesById('<choiceSetId>', idsToDelete, { folderKey: "<folderKey>" });
13709
13919
  * ```
13710
13920
  * @internal
13711
13921
  */
13712
- async deleteValuesById(choiceSetId, valueIds) {
13713
- await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.DELETE_BY_ID(choiceSetId), valueIds);
13922
+ async deleteValuesById(choiceSetId, valueIds, options) {
13923
+ await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.DELETE_BY_ID(choiceSetId), valueIds, { headers: createHeaders({ [FOLDER_KEY]: options?.folderKey }) });
13714
13924
  }
13715
- async resolveChoiceSetName(choiceSetId) {
13716
- const all = await this.getAll();
13925
+ async resolveChoiceSetName(choiceSetId, folderKey) {
13926
+ // Use the un-tracked helper directly so we don't fire a duplicate
13927
+ // `Choicesets.GetAll` telemetry event for every insertValueById /
13928
+ // updateValueById call.
13929
+ const all = await this.fetchAllChoiceSets(folderKey === undefined ? undefined : { folderKey });
13717
13930
  const match = all.find(cs => cs.id === choiceSetId);
13718
13931
  if (!match) {
13719
13932
  throw new NotFoundError({ message: `Choice set with id '${choiceSetId}' not found.` });
@@ -15482,17 +15695,19 @@
15482
15695
  async assign(options) {
15483
15696
  if (!taskData.id)
15484
15697
  throw new Error('Task ID is undefined');
15698
+ const criteria = options.assignmentCriteria !== undefined ? { assignmentCriteria: options.assignmentCriteria } : {};
15485
15699
  const assignmentOptions = 'userId' in options && options.userId !== undefined
15486
- ? { taskId: taskData.id, userId: options.userId }
15487
- : { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail };
15700
+ ? { taskId: taskData.id, userId: options.userId, ...criteria }
15701
+ : { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail, ...criteria };
15488
15702
  return service.assign(assignmentOptions);
15489
15703
  },
15490
15704
  async reassign(options) {
15491
15705
  if (!taskData.id)
15492
15706
  throw new Error('Task ID is undefined');
15707
+ const criteria = options.assignmentCriteria !== undefined ? { assignmentCriteria: options.assignmentCriteria } : {};
15493
15708
  const assignmentOptions = 'userId' in options && options.userId !== undefined
15494
- ? { taskId: taskData.id, userId: options.userId }
15495
- : { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail };
15709
+ ? { taskId: taskData.id, userId: options.userId, ...criteria }
15710
+ : { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail, ...criteria };
15496
15711
  return service.reassign(assignmentOptions);
15497
15712
  },
15498
15713
  async unassign() {
@@ -15805,6 +16020,26 @@
15805
16020
  * }
15806
16021
  * ]);
15807
16022
  * ```
16023
+ *
16024
+ * @example Group assignment
16025
+ * ```typescript
16026
+ * import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
16027
+ *
16028
+ * // Assign to a directory group by userId + criteria — Action Center
16029
+ * // distributes the task across the group's members based on the criteria
16030
+ * const result = await tasks.assign({
16031
+ * taskId: 123,
16032
+ * userId: 456, // a DirectoryGroup id from tasks.getUsers()
16033
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
16034
+ * });
16035
+ *
16036
+ * // ...or identify the group by name instead of id
16037
+ * const result2 = await tasks.assign({
16038
+ * taskId: 123,
16039
+ * userNameOrEmail: "My Group",
16040
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
16041
+ * });
16042
+ * ```
15808
16043
  */
15809
16044
  async assign(taskAssignments) {
15810
16045
  // Normalize input to array
@@ -15856,6 +16091,25 @@
15856
16091
  * }
15857
16092
  * ]);
15858
16093
  * ```
16094
+ *
16095
+ * @example Group reassignment
16096
+ * ```typescript
16097
+ * import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
16098
+ *
16099
+ * // Reassign to a directory group by userId + criteria
16100
+ * const result = await tasks.reassign({
16101
+ * taskId: 123,
16102
+ * userId: 456, // a DirectoryGroup id from tasks.getUsers()
16103
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
16104
+ * });
16105
+ *
16106
+ * // ...or identify the group by name instead of id
16107
+ * const result2 = await tasks.reassign({
16108
+ * taskId: 123,
16109
+ * userNameOrEmail: "My Group",
16110
+ * assignmentCriteria: TaskAssignmentCriteria.AllUsers
16111
+ * });
16112
+ * ```
15859
16113
  */
15860
16114
  async reassign(taskAssignments) {
15861
16115
  // Normalize input to array
@@ -17141,48 +17395,32 @@
17141
17395
  }
17142
17396
  }, options);
17143
17397
  }
17144
- /**
17145
- * Gets metadata for files in a bucket with optional filtering and pagination
17146
- *
17147
- * The method returns either:
17148
- * - A NonPaginatedResponse with items array (when no pagination parameters are provided)
17149
- * - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
17150
- *
17151
- * @param bucketId - The ID of the bucket to get file metadata from
17152
- * @param folderId - Required folder ID for organization unit context
17153
- * @param options - Optional parameters for filtering, pagination and access URL generation
17154
- * @returns Promise resolving to the list of file metadata in the bucket or paginated result
17155
- *
17156
- * @example
17157
- * ```typescript
17158
- * import { Buckets } from '@uipath/uipath-typescript/buckets';
17159
- *
17160
- * const buckets = new Buckets(sdk);
17161
- *
17162
- * // Get metadata for all files in a bucket
17163
- * const fileMetadata = await buckets.getFileMetaData(123, 456);
17164
- *
17165
- * // Get file metadata with a specific prefix
17166
- * const fileMetadata = await buckets.getFileMetaData(123, 456, {
17167
- * prefix: '/folder1'
17168
- * });
17169
- *
17170
- * // First page with pagination
17171
- * const page1 = await buckets.getFileMetaData(123, 456, { pageSize: 10 });
17172
- *
17173
- * // Navigate using cursor
17174
- * if (page1.hasNextPage) {
17175
- * const page2 = await buckets.getFileMetaData(123, 456, { cursor: page1.nextCursor });
17176
- * }
17177
- * ```
17178
- */
17179
- async getFileMetaData(bucketId, folderId, options) {
17398
+ async getFileMetaData(bucketId, optionsOrFolderId, legacyOptions) {
17180
17399
  if (!bucketId) {
17181
17400
  throw new ValidationError({ message: 'bucketId is required for getFileMetaData' });
17182
17401
  }
17183
- if (!folderId) {
17184
- throw new ValidationError({ message: 'folderId is required for getFileMetaData' });
17402
+ // Normalize the two overload forms into a single internal shape.
17403
+ let folderId;
17404
+ let folderKey;
17405
+ let folderPath;
17406
+ let restOptions;
17407
+ if (typeof optionsOrFolderId === 'number') {
17408
+ // Deprecated positional form: getFileMetaData(bucketId, folderId, options?)
17409
+ folderId = optionsOrFolderId;
17410
+ restOptions = (legacyOptions ?? {});
17411
+ }
17412
+ else {
17413
+ // Preferred form: getFileMetaData(bucketId, options?)
17414
+ const opts = optionsOrFolderId ?? {};
17415
+ ({ folderId, folderKey, folderPath, ...restOptions } = opts);
17185
17416
  }
17417
+ const headers = resolveFolderHeaders({
17418
+ folderId,
17419
+ folderKey,
17420
+ folderPath,
17421
+ resourceType: 'Buckets.getFileMetaData',
17422
+ fallbackFolderKey: this.config.folderKey,
17423
+ });
17186
17424
  // Transformation function for blob items
17187
17425
  const transformBlobItem = (item) => transformData(item, BucketMap);
17188
17426
  return PaginationHelpers.getAll({
@@ -17198,93 +17436,97 @@
17198
17436
  tokenParam: BUCKET_TOKEN_PARAMS.TOKEN_PARAM
17199
17437
  }
17200
17438
  },
17201
- excludeFromPrefix: ['prefix'] // Bucket-specific param, not OData
17202
- }, { ...options, folderId });
17439
+ excludeFromPrefix: ['prefix'], // Bucket-specific param, not OData
17440
+ headers,
17441
+ }, restOptions);
17203
17442
  }
17204
- /**
17205
- * Uploads a file to a bucket
17206
- *
17207
- * @param options - Options for file upload including bucket ID, folder ID, path, content, and optional parameters
17208
- * @returns Promise resolving to a response with success status and HTTP status code
17209
- *
17210
- * @example
17211
- * ```typescript
17212
- * import { Buckets } from '@uipath/uipath-typescript/buckets';
17213
- *
17214
- * const buckets = new Buckets(sdk);
17215
- *
17216
- * // Upload a file from browser
17217
- * const file = new File(['file content'], 'example.txt');
17218
- * const result = await buckets.uploadFile({
17219
- * bucketId: 123,
17220
- * folderId: 456,
17221
- * path: '/folder/example.txt',
17222
- * content: file
17223
- * });
17224
- *
17225
- * // In Node env with Buffer
17226
- * const buffer = Buffer.from('file content');
17227
- * const result = await buckets.uploadFile({
17228
- * bucketId: 123,
17229
- * folderId: 456,
17230
- * path: '/folder/example.txt',
17231
- * content: buffer
17232
- * });
17233
- * ```
17234
- */
17235
- async uploadFile(options) {
17236
- const { bucketId, folderId, path, content } = options;
17443
+ async uploadFile(bucketIdOrOptions, path, content, options) {
17444
+ // Normalize the two overload forms into a single internal shape.
17445
+ let bucketId;
17446
+ let resolvedPath;
17447
+ let resolvedContent;
17448
+ let folderId;
17449
+ let folderKey;
17450
+ let folderPath;
17451
+ if (bucketIdOrOptions !== null && typeof bucketIdOrOptions === 'object') {
17452
+ // Deprecated options-only form: uploadFile({ bucketId, path, content, ... })
17453
+ ({ bucketId, path: resolvedPath, content: resolvedContent, folderId, folderKey, folderPath } = bucketIdOrOptions);
17454
+ }
17455
+ else {
17456
+ // Preferred positional form: uploadFile(bucketId, path, content, options?)
17457
+ bucketId = bucketIdOrOptions;
17458
+ resolvedPath = path;
17459
+ resolvedContent = content;
17460
+ const opts = options ?? {};
17461
+ ({ folderId, folderKey, folderPath } = opts);
17462
+ }
17237
17463
  if (!bucketId) {
17238
17464
  throw new ValidationError({ message: 'bucketId is required for uploadFile' });
17239
17465
  }
17240
- if (!folderId) {
17241
- throw new ValidationError({ message: 'folderId is required for uploadFile' });
17242
- }
17243
- if (!path) {
17466
+ if (!resolvedPath) {
17244
17467
  throw new ValidationError({ message: 'path is required for uploadFile' });
17245
17468
  }
17246
- if (!content) {
17469
+ if (!resolvedContent) {
17247
17470
  throw new ValidationError({ message: 'content is required for uploadFile' });
17248
17471
  }
17472
+ const headers = resolveFolderHeaders({
17473
+ folderId,
17474
+ folderKey,
17475
+ folderPath,
17476
+ resourceType: 'Buckets.uploadFile',
17477
+ fallbackFolderKey: this.config.folderKey,
17478
+ });
17249
17479
  const uriResponse = await this._getWriteUri({
17250
17480
  bucketId,
17251
- folderId,
17252
- path,
17481
+ path: resolvedPath,
17482
+ headers,
17253
17483
  });
17254
17484
  // Upload file to the provided URI
17255
- const response = await this._uploadToUri(uriResponse, content);
17485
+ const response = await this._uploadToUri(uriResponse, resolvedContent);
17256
17486
  return {
17257
17487
  success: response.status >= 200 && response.status < 300,
17258
17488
  statusCode: response.status
17259
17489
  };
17260
17490
  }
17261
- /**
17262
- * Gets a direct download URL for a file in the bucket
17263
- *
17264
- * @param options - Contains bucketId, folderId, file path and optional expiry time
17265
- * @returns Promise resolving to blob file access information
17266
- *
17267
- * @example
17268
- * ```typescript
17269
- * import { Buckets } from '@uipath/uipath-typescript/buckets';
17270
- *
17271
- * const buckets = new Buckets(sdk);
17272
- *
17273
- * // Get download URL for a file
17274
- * const fileAccess = await buckets.getReadUri({
17275
- * bucketId: 123,
17276
- * folderId: 456,
17277
- * path: '/folder/file.pdf'
17278
- * });
17279
- * ```
17280
- */
17281
- async getReadUri(options) {
17282
- const { bucketId, folderId, path, expiryInMinutes, ...restOptions } = options;
17491
+ async getReadUri(bucketIdOrOptions, path, options) {
17492
+ // Normalize the two overload forms into a single internal shape.
17493
+ let bucketId;
17494
+ let resolvedPath;
17495
+ let folderId;
17496
+ let folderKey;
17497
+ let folderPath;
17498
+ let expiryInMinutes;
17499
+ let restOptions;
17500
+ if (bucketIdOrOptions !== null && typeof bucketIdOrOptions === 'object') {
17501
+ // Deprecated options-only form: getReadUri({ bucketId, path, ... })
17502
+ const { bucketId: bid, path: p, expiryInMinutes: e, folderId: fid, folderKey: fkey, folderPath: fpath, ...rest } = bucketIdOrOptions;
17503
+ bucketId = bid;
17504
+ resolvedPath = p;
17505
+ expiryInMinutes = e;
17506
+ folderId = fid;
17507
+ folderKey = fkey;
17508
+ folderPath = fpath;
17509
+ restOptions = rest;
17510
+ }
17511
+ else {
17512
+ // Preferred positional form: getReadUri(bucketId, path, options?)
17513
+ bucketId = bucketIdOrOptions;
17514
+ resolvedPath = path;
17515
+ const opts = options ?? {};
17516
+ ({ expiryInMinutes, folderId, folderKey, folderPath, ...restOptions } = opts);
17517
+ }
17518
+ const headers = resolveFolderHeaders({
17519
+ folderId,
17520
+ folderKey,
17521
+ folderPath,
17522
+ resourceType: 'Buckets.getReadUri',
17523
+ fallbackFolderKey: this.config.folderKey,
17524
+ });
17283
17525
  const queryOptions = {
17284
17526
  expiryInMinutes,
17285
17527
  ...addPrefixToKeys(restOptions, ODATA_PREFIX, Object.keys(restOptions))
17286
17528
  };
17287
- return this._getUri(BUCKET_ENDPOINTS.GET_READ_URI(bucketId), bucketId, folderId, path, queryOptions);
17529
+ return this._getUri(BUCKET_ENDPOINTS.GET_READ_URI(bucketId), bucketId, resolvedPath, headers, queryOptions);
17288
17530
  }
17289
17531
  /**
17290
17532
  * Uploads content to the provided URI
@@ -17314,23 +17556,18 @@
17314
17556
  * Private method to handle common URI request logic
17315
17557
  * @param endpoint - The API endpoint to call
17316
17558
  * @param bucketId - The bucket ID
17317
- * @param folderId - The folder ID
17318
17559
  * @param path - The file path
17560
+ * @param headers - Pre-built folder-context headers (built via `resolveFolderHeaders`)
17319
17561
  * @param queryOptions - Additional query parameters
17320
17562
  * @returns Promise resolving to blob file access information
17321
17563
  */
17322
- async _getUri(endpoint, bucketId, folderId, path, queryOptions = {}) {
17564
+ async _getUri(endpoint, bucketId, path, headers, queryOptions = {}) {
17323
17565
  if (!bucketId) {
17324
17566
  throw new ValidationError({ message: 'bucketId is required for getUri' });
17325
17567
  }
17326
- if (!folderId) {
17327
- throw new ValidationError({ message: 'folderId is required for getUri' });
17328
- }
17329
17568
  if (!path) {
17330
17569
  throw new ValidationError({ message: 'path is required for getUri' });
17331
17570
  }
17332
- // Create headers with required folder ID
17333
- const headers = createHeaders({ [FOLDER_ID]: folderId });
17334
17571
  // Filter out undefined values and build query params
17335
17572
  const queryParams = filterUndefined({
17336
17573
  path,
@@ -17465,16 +17702,16 @@
17465
17702
  /**
17466
17703
  * Gets a direct upload URL for a file in the bucket
17467
17704
  *
17468
- * @param options - Contains bucketId, folderId, file path, optional expiry time
17705
+ * @param options - Contains bucketId, file path, optional expiry time, and pre-built folder-context headers
17469
17706
  * @returns Promise resolving to blob file access information
17470
17707
  */
17471
17708
  async _getWriteUri(options) {
17472
- const { bucketId, folderId, path, expiryInMinutes, ...restOptions } = options;
17709
+ const { bucketId, path, expiryInMinutes, headers, ...restOptions } = options;
17473
17710
  const queryOptions = {
17474
17711
  expiryInMinutes,
17475
17712
  ...addPrefixToKeys(restOptions, ODATA_PREFIX, Object.keys(restOptions))
17476
17713
  };
17477
- return this._getUri(BUCKET_ENDPOINTS.GET_WRITE_URI(bucketId), bucketId, folderId, path, queryOptions);
17714
+ return this._getUri(BUCKET_ENDPOINTS.GET_WRITE_URI(bucketId), bucketId, path, headers, queryOptions);
17478
17715
  }
17479
17716
  }
17480
17717
  __decorate([
@@ -18938,6 +19175,24 @@
18938
19175
  AgentListSortColumn["QuantityPLTU"] = "QuantityPLTU";
18939
19176
  AgentListSortColumn["FolderPath"] = "FolderPath";
18940
19177
  })(exports.AgentListSortColumn || (exports.AgentListSortColumn = {}));
19178
+ /**
19179
+ * Columns available for ordering / grouping the agent errors list.
19180
+ */
19181
+ exports.AgentErrorSortColumn = void 0;
19182
+ (function (AgentErrorSortColumn) {
19183
+ AgentErrorSortColumn["AgentId"] = "AgentId";
19184
+ AgentErrorSortColumn["AgentName"] = "AgentName";
19185
+ AgentErrorSortColumn["ParentProcessName"] = "ParentProcessName";
19186
+ AgentErrorSortColumn["ErrorTitle"] = "ErrorTitle";
19187
+ AgentErrorSortColumn["FirstSeenStartTime"] = "FirstSeenStartTime";
19188
+ AgentErrorSortColumn["ExecutionCount"] = "ExecutionCount";
19189
+ AgentErrorSortColumn["Type"] = "Type";
19190
+ AgentErrorSortColumn["FirstSeenFolderName"] = "FirstSeenFolderName";
19191
+ AgentErrorSortColumn["FirstSeenFolderPath"] = "FirstSeenFolderPath";
19192
+ AgentErrorSortColumn["LastSeenStartTime"] = "LastSeenStartTime";
19193
+ AgentErrorSortColumn["LastSeenFolderName"] = "LastSeenFolderName";
19194
+ AgentErrorSortColumn["LastSeenFolderPath"] = "LastSeenFolderPath";
19195
+ })(exports.AgentErrorSortColumn || (exports.AgentErrorSortColumn = {}));
18941
19196
 
18942
19197
  /**
18943
19198
  * Types for the Agent Memory metrics service.
@@ -19242,6 +19497,86 @@
19242
19497
  PolicyEvaluationResult["SimulatedDeny"] = "SimulatedDeny";
19243
19498
  })(exports.PolicyEvaluationResult || (exports.PolicyEvaluationResult = {}));
19244
19499
 
19500
+ /** Status of a span: whether it completed successfully, with an error, or was not set. */
19501
+ exports.SpanStatus = void 0;
19502
+ (function (SpanStatus) {
19503
+ SpanStatus["Unset"] = "Unset";
19504
+ SpanStatus["Ok"] = "Ok";
19505
+ SpanStatus["Error"] = "Error";
19506
+ /** Span is still in progress. */
19507
+ SpanStatus["Running"] = "Running";
19508
+ /** Span data is hidden from the caller due to tenant/folder permission rules. */
19509
+ SpanStatus["Restricted"] = "Restricted";
19510
+ /** Span was cancelled before completion. */
19511
+ SpanStatus["Cancelled"] = "Cancelled";
19512
+ })(exports.SpanStatus || (exports.SpanStatus = {}));
19513
+ /** Platform source that produced the span. */
19514
+ exports.SpanSource = void 0;
19515
+ (function (SpanSource) {
19516
+ SpanSource["Testing"] = "Testing";
19517
+ SpanSource["Agents"] = "Agents";
19518
+ SpanSource["ProcessOrchestration"] = "ProcessOrchestration";
19519
+ SpanSource["ApiWorkflows"] = "ApiWorkflows";
19520
+ SpanSource["Robots"] = "Robots";
19521
+ SpanSource["ConversationalAgentsService"] = "ConversationalAgentsService";
19522
+ SpanSource["IntegrationServiceTrigger"] = "IntegrationServiceTrigger";
19523
+ SpanSource["Playground"] = "Playground";
19524
+ SpanSource["Governance"] = "Governance";
19525
+ /** Intelligent Experience Platform — unstructured and complex document processing source. */
19526
+ SpanSource["IXPUnstructuredAndComplexDocuments"] = "IXPUnstructuredAndComplexDocuments";
19527
+ /** Agents authored in code (as opposed to visual/no-code designers). */
19528
+ SpanSource["CodedAgents"] = "CodedAgents";
19529
+ /** Intelligent Experience Platform — communications mining source. */
19530
+ SpanSource["IXPCommunicationsMining"] = "IXPCommunicationsMining";
19531
+ /** UiPath Context Grounding — span produced by the Enterprise Context Service for RAG/knowledge-base operations. */
19532
+ SpanSource["EnterpriseContextService"] = "EnterpriseContextService";
19533
+ /** Model Context Protocol — span produced by an MCP server integration. */
19534
+ SpanSource["MCP"] = "MCP";
19535
+ /** Agent-to-Agent — span produced by an A2A protocol call between agents. */
19536
+ SpanSource["A2A"] = "A2A";
19537
+ /** Serverless — span produced by a serverless function execution. */
19538
+ SpanSource["Serverless"] = "Serverless";
19539
+ })(exports.SpanSource || (exports.SpanSource = {}));
19540
+ /** Minimum severity level of events captured in the span. */
19541
+ exports.SpanVerbosityLevel = void 0;
19542
+ (function (SpanVerbosityLevel) {
19543
+ SpanVerbosityLevel["Verbose"] = "Verbose";
19544
+ SpanVerbosityLevel["Trace"] = "Trace";
19545
+ SpanVerbosityLevel["Information"] = "Information";
19546
+ SpanVerbosityLevel["Warning"] = "Warning";
19547
+ SpanVerbosityLevel["Error"] = "Error";
19548
+ SpanVerbosityLevel["Critical"] = "Critical";
19549
+ SpanVerbosityLevel["Off"] = "Off";
19550
+ })(exports.SpanVerbosityLevel || (exports.SpanVerbosityLevel = {}));
19551
+ /** Whether the span was produced during a debug or production runtime. */
19552
+ exports.SpanExecutionType = void 0;
19553
+ (function (SpanExecutionType) {
19554
+ SpanExecutionType["Debug"] = "Debug";
19555
+ SpanExecutionType["Runtime"] = "Runtime";
19556
+ })(exports.SpanExecutionType || (exports.SpanExecutionType = {}));
19557
+ /** Whether the caller has permission to read this span's data. */
19558
+ exports.SpanPermissionStatus = void 0;
19559
+ (function (SpanPermissionStatus) {
19560
+ SpanPermissionStatus["Allow"] = "Allow";
19561
+ /** Some span fields are redacted due to permission constraints (e.g. attributes visible but payload hidden). */
19562
+ SpanPermissionStatus["PartialBlock"] = "PartialBlock";
19563
+ SpanPermissionStatus["Block"] = "Block";
19564
+ })(exports.SpanPermissionStatus || (exports.SpanPermissionStatus = {}));
19565
+ /** Storage provider that created or manages the attachment. */
19566
+ exports.SpanAttachmentProvider = void 0;
19567
+ (function (SpanAttachmentProvider) {
19568
+ SpanAttachmentProvider["Orchestrator"] = "Orchestrator";
19569
+ /** Span attachment stored by the observability platform. */
19570
+ SpanAttachmentProvider["LLMOps"] = "LLMOps";
19571
+ })(exports.SpanAttachmentProvider || (exports.SpanAttachmentProvider = {}));
19572
+ /** Whether the attachment is an input, output, or neither. */
19573
+ exports.SpanAttachmentDirection = void 0;
19574
+ (function (SpanAttachmentDirection) {
19575
+ SpanAttachmentDirection["None"] = "None";
19576
+ SpanAttachmentDirection["In"] = "In";
19577
+ SpanAttachmentDirection["Out"] = "Out";
19578
+ })(exports.SpanAttachmentDirection || (exports.SpanAttachmentDirection = {}));
19579
+
19245
19580
  /**
19246
19581
  * Asset resolution utilities for UiPath Coded Apps
19247
19582
  *
@@ -19318,6 +19653,7 @@
19318
19653
  }
19319
19654
 
19320
19655
  exports.AgentMap = AgentMap;
19656
+ exports.AgentTraceExecutionType = exports.SpanExecutionType;
19321
19657
  exports.AuthenticationError = AuthenticationError;
19322
19658
  exports.AuthorizationError = AuthorizationError;
19323
19659
  exports.ConversationGetAllFilterMap = ConversationGetAllFilterMap;