@uipath/uipath-typescript 1.3.9 → 1.3.11

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 (39) hide show
  1. package/dist/assets/index.cjs +19 -6
  2. package/dist/assets/index.mjs +19 -6
  3. package/dist/attachments/index.cjs +19 -6
  4. package/dist/attachments/index.mjs +19 -6
  5. package/dist/buckets/index.cjs +141 -6
  6. package/dist/buckets/index.d.ts +164 -1
  7. package/dist/buckets/index.mjs +141 -6
  8. package/dist/cases/index.cjs +70 -6
  9. package/dist/cases/index.d.ts +91 -1
  10. package/dist/cases/index.mjs +70 -6
  11. package/dist/conversational-agent/index.cjs +19 -6
  12. package/dist/conversational-agent/index.mjs +19 -6
  13. package/dist/core/index.cjs +1 -1
  14. package/dist/core/index.mjs +1 -1
  15. package/dist/entities/index.cjs +239 -34
  16. package/dist/entities/index.d.ts +311 -12
  17. package/dist/entities/index.mjs +239 -34
  18. package/dist/feedback/index.cjs +19 -6
  19. package/dist/feedback/index.mjs +19 -6
  20. package/dist/index.cjs +490 -64
  21. package/dist/index.d.ts +714 -36
  22. package/dist/index.mjs +490 -64
  23. package/dist/index.umd.js +491 -65
  24. package/dist/jobs/index.cjs +19 -6
  25. package/dist/jobs/index.mjs +19 -6
  26. package/dist/maestro-processes/index.cjs +70 -6
  27. package/dist/maestro-processes/index.d.ts +91 -1
  28. package/dist/maestro-processes/index.mjs +70 -6
  29. package/dist/processes/index.cjs +47 -35
  30. package/dist/processes/index.d.ts +76 -26
  31. package/dist/processes/index.mjs +47 -35
  32. package/dist/queues/index.cjs +19 -6
  33. package/dist/queues/index.mjs +19 -6
  34. package/dist/tasks/index.cjs +19 -6
  35. package/dist/tasks/index.mjs +19 -6
  36. package/dist/traces/index.cjs +1902 -0
  37. package/dist/traces/index.d.ts +565 -0
  38. package/dist/traces/index.mjs +1900 -0
  39. package/package.json +12 -2
package/dist/index.umd.js CHANGED
@@ -4516,6 +4516,8 @@
4516
4516
  GET_FILE_META_DATA: (id) => `${ORCHESTRATOR_BASE}/api/Buckets/${id}/ListFiles`,
4517
4517
  GET_READ_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetReadUri`,
4518
4518
  GET_WRITE_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetWriteUri`,
4519
+ DELETE_FILE: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.DeleteFile`,
4520
+ GET_FILES: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetFiles`,
4519
4521
  };
4520
4522
  /**
4521
4523
  * Orchestrator Process Service Endpoints
@@ -4598,6 +4600,8 @@
4598
4600
  TOP_PROCESSES_BY_RUN_COUNT: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcessesByRunCount`,
4599
4601
  /** Top processes ranked by failure count */
4600
4602
  TOP_PROCESSES_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcesseswithFailure`,
4603
+ /** Top elements ranked by failure count */
4604
+ TOP_ELEMENTS_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopElementswithFailure`,
4601
4605
  /** Instance status aggregated by date for time-series charts */
4602
4606
  INSTANCE_STATUS_BY_DATE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceStatusByDate`,
4603
4607
  /** Top processes ranked by total duration */
@@ -4641,6 +4645,12 @@
4641
4645
  CHOICESETS: {
4642
4646
  GET_ALL: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
4643
4647
  GET_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/query_expansion`,
4648
+ CREATE: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
4649
+ UPDATE: (choiceSetId) => `${DATAFABRIC_BASE}/api/Entity/${choiceSetId}/metadata`,
4650
+ DELETE: (choiceSetId) => `${DATAFABRIC_BASE}/api/Entity/${choiceSetId}/delete`,
4651
+ INSERT_BY_NAME: (choiceSetName) => `${DATAFABRIC_BASE}/api/EntityService/${choiceSetName}/choiceset/insert`,
4652
+ UPDATE_BY_NAME: (choiceSetName, valueId) => `${DATAFABRIC_BASE}/api/EntityService/${choiceSetName}/choiceset/${valueId}/update`,
4653
+ DELETE_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/choiceset/delete`,
4644
4654
  },
4645
4655
  };
4646
4656
 
@@ -9239,7 +9249,7 @@
9239
9249
  * shared across all consumers and is patched into this file at publish time.
9240
9250
  */
9241
9251
  // Connection string placeholder that will be replaced during build
9242
- const CONNECTION_STRING = '$CONNECTION_STRING';
9252
+ const CONNECTION_STRING = 'InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037';
9243
9253
  const VERSION = 'Version';
9244
9254
  const SERVICE = 'Service';
9245
9255
  const CLOUD_ORGANIZATION_NAME = 'CloudOrganizationName';
@@ -9565,7 +9575,7 @@
9565
9575
  * SDK's public API.
9566
9576
  */
9567
9577
  /** SDK version placeholder — patched by the SDK publish workflow. */
9568
- const SDK_VERSION = '1.3.9';
9578
+ const SDK_VERSION = '1.3.11';
9569
9579
  const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
9570
9580
  const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
9571
9581
  const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
@@ -10291,14 +10301,25 @@
10291
10301
  if (!text) {
10292
10302
  return undefined;
10293
10303
  }
10294
- return JSON.parse(text);
10304
+ try {
10305
+ return JSON.parse(text);
10306
+ }
10307
+ catch (error) {
10308
+ if (error instanceof SyntaxError) {
10309
+ throw new ServerError({
10310
+ message: `Server returned non-JSON response (${response.status} ${response.url}): ${error.message}`,
10311
+ statusCode: response.status,
10312
+ });
10313
+ }
10314
+ throw error;
10315
+ }
10295
10316
  }
10296
10317
  catch (error) {
10297
10318
  // If it's already one of our errors, re-throw it
10298
10319
  if (error.type && error.type.includes('Error')) {
10299
10320
  throw error;
10300
10321
  }
10301
- // Otherwise, it's likely a network error
10322
+ // Otherwise, it's a genuine network/fetch failure
10302
10323
  throw ErrorFactory.createNetworkError(error);
10303
10324
  }
10304
10325
  }
@@ -11194,9 +11215,9 @@
11194
11215
  * @returns Promise resolving to a paginated result
11195
11216
  */
11196
11217
  static async getAllPaginated(params) {
11197
- const { serviceAccess, getEndpoint, folderId, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
11218
+ const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
11198
11219
  const endpoint = getEndpoint(folderId);
11199
- const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
11220
+ const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
11200
11221
  const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
11201
11222
  headers,
11202
11223
  params: additionalParams,
@@ -11224,13 +11245,13 @@
11224
11245
  * @returns Promise resolving to an object with data and totalCount
11225
11246
  */
11226
11247
  static async getAllNonPaginated(params) {
11227
- const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
11248
+ const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
11228
11249
  // Set default field names
11229
11250
  const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
11230
11251
  const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
11231
11252
  // Determine endpoint and headers based on folderId
11232
11253
  const endpoint = folderId ? getByFolderEndpoint : getAllEndpoint;
11233
- const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
11254
+ const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
11234
11255
  // Make the API call based on method
11235
11256
  let response;
11236
11257
  if (method === HTTP_METHODS.POST) {
@@ -11289,6 +11310,7 @@
11289
11310
  serviceAccess: config.serviceAccess,
11290
11311
  getEndpoint: config.getEndpoint,
11291
11312
  folderId,
11313
+ headers: config.headers,
11292
11314
  paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
11293
11315
  additionalParams: prefixedOptions,
11294
11316
  transformFn: config.transformFn,
@@ -11306,6 +11328,7 @@
11306
11328
  getAllEndpoint: config.getEndpoint(),
11307
11329
  getByFolderEndpoint: byFolderEndpoint,
11308
11330
  folderId,
11331
+ headers: config.headers,
11309
11332
  additionalParams: prefixedOptions,
11310
11333
  transformFn: config.transformFn,
11311
11334
  method: config.method,
@@ -12598,10 +12621,6 @@
12598
12621
  * @internal
12599
12622
  */
12600
12623
  async create(name, fields, options) {
12601
- this.validateName(name, 'entity');
12602
- for (const field of fields) {
12603
- this.validateName(field.fieldName, 'field');
12604
- }
12605
12624
  const opts = options ?? {};
12606
12625
  const payload = {
12607
12626
  ...(opts.description !== undefined && { description: opts.description }),
@@ -12744,6 +12763,7 @@
12744
12763
  ...(update.isUnique !== undefined && { isUnique: update.isUnique }),
12745
12764
  ...(update.isRbacEnabled !== undefined && { isRbacEnabled: update.isRbacEnabled }),
12746
12765
  ...(update.isEncrypted !== undefined && { isEncrypted: update.isEncrypted }),
12766
+ ...(update.isHiddenField !== undefined && { isHiddenField: update.isHiddenField }),
12747
12767
  ...(update.defaultValue !== undefined && { defaultValue: update.defaultValue }),
12748
12768
  ...(hasConstraintUpdate && f.sqlType && { sqlType: { ...f.sqlType, ...constraintUpdate } }),
12749
12769
  };
@@ -12752,9 +12772,6 @@
12752
12772
  // Build and append new fields
12753
12773
  const newFields = [];
12754
12774
  if (options.addFields?.length) {
12755
- for (const field of options.addFields) {
12756
- this.validateName(field.fieldName, 'field');
12757
- }
12758
12775
  newFields.push(...options.addFields.map(f => this.buildSchemaFieldPayload(f)));
12759
12776
  }
12760
12777
  await this.post(DATA_FABRIC_ENDPOINTS.ENTITY.UPSERT, {
@@ -12855,9 +12872,15 @@
12855
12872
  }
12856
12873
  /** Converts a user-facing EntityCreateFieldOptions to the raw API field payload */
12857
12874
  buildSchemaFieldPayload(field) {
12858
- this.validateName(field.fieldName, 'field');
12859
12875
  const fieldType = field.type ?? exports.EntityFieldDataType.STRING;
12860
12876
  this.validateFieldConstraints(fieldType, field, field.fieldName);
12877
+ const isRelationship = fieldType === exports.EntityFieldDataType.RELATIONSHIP;
12878
+ const isFile = fieldType === exports.EntityFieldDataType.FILE;
12879
+ if ((isRelationship || isFile) && (!field.referenceEntityId || !field.referenceFieldId)) {
12880
+ throw new ValidationError({
12881
+ message: `Field '${field.fieldName}' of type ${fieldType} requires both referenceEntityId and referenceFieldId (UUIDs of the target entity and field).`,
12882
+ });
12883
+ }
12861
12884
  const mapping = EntitySchemaFieldTypeMap[fieldType];
12862
12885
  return {
12863
12886
  name: field.fieldName,
@@ -12872,10 +12895,13 @@
12872
12895
  isUnique: field.isUnique ?? false,
12873
12896
  isRbacEnabled: field.isRbacEnabled ?? false,
12874
12897
  isEncrypted: field.isEncrypted ?? false,
12898
+ isHiddenField: field.isHiddenField ?? false,
12875
12899
  ...(field.defaultValue !== undefined && { defaultValue: field.defaultValue }),
12876
12900
  ...(field.choiceSetId !== undefined && { choiceSetId: field.choiceSetId }),
12877
- ...(field.referenceEntityName !== undefined && { referenceEntityName: field.referenceEntityName }),
12878
- ...(field.referenceFieldName !== undefined && { referenceFieldName: field.referenceFieldName }),
12901
+ ...((isRelationship || isFile) && { isForeignKey: true }),
12902
+ ...(isRelationship && { referenceType: exports.ReferenceType.ManyToOne }),
12903
+ ...(field.referenceEntityId !== undefined && { referenceEntity: { id: field.referenceEntityId } }),
12904
+ ...(field.referenceFieldId !== undefined && { referenceField: { id: field.referenceFieldId } }),
12879
12905
  };
12880
12906
  }
12881
12907
  /**
@@ -12979,24 +13005,7 @@
12979
13005
  return {};
12980
13006
  }
12981
13007
  }
12982
- validateName(name, context) {
12983
- if (name.length < 3 || name.length > 100 || !/^[a-zA-Z]\w*$/.test(name)) {
12984
- const suggestion = name.replace(/\W/g, '').replace(/^[0-9_]+/, '');
12985
- const defaultName = `My${context.charAt(0).toUpperCase() + context.slice(1)}`;
12986
- throw new ValidationError({
12987
- message: `Invalid ${context} name '${name}'. Must start with a letter, contain only letters, numbers, and underscores, 3–100 characters (e.g., "${suggestion || defaultName}").`
12988
- });
12989
- }
12990
- if (context === 'field' && EntityService.RESERVED_FIELD_NAMES.has(name)) {
12991
- throw new ValidationError({
12992
- message: `Field name '${name}' is reserved. Reserved names: ${[...EntityService.RESERVED_FIELD_NAMES].join(', ')}.`
12993
- });
12994
- }
12995
- }
12996
13008
  }
12997
- EntityService.RESERVED_FIELD_NAMES = new Set([
12998
- 'Id', 'CreatedBy', 'CreateTime', 'UpdatedBy', 'UpdateTime'
12999
- ]);
13000
13009
  __decorate([
13001
13010
  track('Entities.GetById')
13002
13011
  ], EntityService.prototype, "getById", null);
@@ -13093,7 +13102,7 @@
13093
13102
  *
13094
13103
  * @example
13095
13104
  * ```typescript
13096
- * import { ChoiceSets } from '@uipath/uipath-typescript/choicesets';
13105
+ * import { ChoiceSets } from '@uipath/uipath-typescript/entities';
13097
13106
  *
13098
13107
  * const choiceSets = new ChoiceSets(sdk);
13099
13108
  *
@@ -13142,6 +13151,188 @@
13142
13151
  }
13143
13152
  }, options);
13144
13153
  }
13154
+ /**
13155
+ * Creates a new Data Fabric choice set
13156
+ *
13157
+ * @param name - Choice set name. Must start with a
13158
+ * letter, may contain only letters, numbers, and underscores, length
13159
+ * 3–100 characters (e.g., `"expenseTypes"`).
13160
+ * @param options - Optional choice-set-level settings ({@link ChoiceSetCreateOptions})
13161
+ * @returns Promise resolving to the UUID of the created choice set
13162
+ *
13163
+ * @example
13164
+ * ```typescript
13165
+ * import { ChoiceSets } from '@uipath/uipath-typescript/entities';
13166
+ *
13167
+ * const choicesets = new ChoiceSets(sdk);
13168
+ *
13169
+ * // Minimal create
13170
+ * const expenseTypesId = await choicesets.create("expense_types");
13171
+ *
13172
+ * // With display name and description
13173
+ * const priorityLevelsId = await choicesets.create("priority_levels", {
13174
+ * displayName: "Priority Levels",
13175
+ * description: "Ticket priority categories",
13176
+ * });
13177
+ * ```
13178
+ * @internal
13179
+ */
13180
+ async create(name, options) {
13181
+ const opts = options ?? {};
13182
+ const payload = {
13183
+ ...(opts.description !== undefined && { description: opts.description }),
13184
+ ...(opts.displayName !== undefined && { displayName: opts.displayName }),
13185
+ entityDefinition: {
13186
+ name,
13187
+ fields: [],
13188
+ folderId: opts.folderKey ?? DATA_FABRIC_TENANT_FOLDER_ID,
13189
+ },
13190
+ };
13191
+ const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.CREATE, payload);
13192
+ return response.data;
13193
+ }
13194
+ /**
13195
+ * Updates an existing choice set's metadata (display name and/or description).
13196
+ *
13197
+ * **At least one of `displayName` or `description` must be provided** —
13198
+ * the call throws `ValidationError` if both are omitted.
13199
+ *
13200
+ * @param choiceSetId - UUID of the choice set to update
13201
+ * @param options - Metadata fields to change ({@link ChoiceSetUpdateOptions})
13202
+ * @returns Promise resolving when the update is complete
13203
+ *
13204
+ * @example
13205
+ * ```typescript
13206
+ * // First, get the choice set ID using getAll()
13207
+ * const allChoiceSets = await choicesets.getAll();
13208
+ * const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
13209
+ *
13210
+ * await choicesets.updateById(expenseTypes.id, {
13211
+ * displayName: "Expense Categories",
13212
+ * description: "Updated description",
13213
+ * });
13214
+ * ```
13215
+ * @internal
13216
+ */
13217
+ async updateById(choiceSetId, options) {
13218
+ if (options.displayName === undefined && options.description === undefined) {
13219
+ throw new ValidationError({
13220
+ message: 'updateById requires at least one of displayName or description.',
13221
+ });
13222
+ }
13223
+ await this.patch(DATA_FABRIC_ENDPOINTS.CHOICESETS.UPDATE(choiceSetId), {
13224
+ ...(options.displayName !== undefined && { displayName: options.displayName }),
13225
+ ...(options.description !== undefined && { description: options.description }),
13226
+ });
13227
+ }
13228
+ /**
13229
+ * Deletes a Data Fabric choice set and all its values.
13230
+ *
13231
+ * @param choiceSetId - UUID of the choice set to delete
13232
+ * @returns Promise resolving when the choice set is deleted
13233
+ *
13234
+ * @example
13235
+ * ```typescript
13236
+ * // First, get the choice set ID using getAll()
13237
+ * const allChoiceSets = await choicesets.getAll();
13238
+ * const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
13239
+ *
13240
+ * await choicesets.deleteById(expenseTypes.id);
13241
+ * ```
13242
+ * @internal
13243
+ */
13244
+ async deleteById(choiceSetId) {
13245
+ await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.DELETE(choiceSetId), {});
13246
+ }
13247
+ /**
13248
+ * Inserts a single value into a choice set.
13249
+ *
13250
+ * @param choiceSetId - UUID of the parent choice set
13251
+ * @param name - Identifier name of the new value (e.g., `"TRAVEL"`)
13252
+ * @param options - Optional fields ({@link ChoiceSetValueInsertOptions})
13253
+ * @returns Promise resolving to the inserted value ({@link ChoiceSetValueInsertResponse})
13254
+ *
13255
+ * @example
13256
+ * ```typescript
13257
+ * // First, get the choice set ID using getAll()
13258
+ * const allChoiceSets = await choicesets.getAll();
13259
+ * const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
13260
+ *
13261
+ * const inserted = await choicesets.insertValueById(expenseTypes.id, 'TRAVEL', {
13262
+ * displayName: 'Travel',
13263
+ * });
13264
+ * console.log(inserted.id);
13265
+ * ```
13266
+ * @internal
13267
+ */
13268
+ async insertValueById(choiceSetId, name, options) {
13269
+ const choiceSetName = await this.resolveChoiceSetName(choiceSetId);
13270
+ const payload = {
13271
+ Name: name,
13272
+ ...(options?.displayName !== undefined && { DisplayName: options.displayName }),
13273
+ };
13274
+ const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.INSERT_BY_NAME(choiceSetName), payload);
13275
+ const camelCased = pascalToCamelCaseKeys(response.data);
13276
+ return transformData(camelCased, EntityMap);
13277
+ }
13278
+ /**
13279
+ * Updates an existing choice-set value's display name.
13280
+ *
13281
+ * Only `displayName` is mutable; the value's `name` (identifier) is fixed at
13282
+ * insert time and cannot be changed.
13283
+ *
13284
+ * @param choiceSetId - UUID of the parent choice set
13285
+ * @param valueId - UUID of the value to update
13286
+ * @param displayName - New human-readable display name for the value
13287
+ * @returns Promise resolving to the updated value ({@link ChoiceSetValueUpdateResponse})
13288
+ *
13289
+ * @example
13290
+ * ```typescript
13291
+ * // Get the choice set ID from getAll() and the value ID from getById()
13292
+ * const allChoiceSets = await choicesets.getAll();
13293
+ * const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
13294
+ * const values = await choicesets.getById(expenseTypes.id);
13295
+ * const travel = values.items.find(v => v.name === 'TRAVEL');
13296
+ *
13297
+ * await choicesets.updateValueById(expenseTypes.id, travel.id, 'Business Travel');
13298
+ * ```
13299
+ * @internal
13300
+ */
13301
+ async updateValueById(choiceSetId, valueId, displayName) {
13302
+ const choiceSetName = await this.resolveChoiceSetName(choiceSetId);
13303
+ const payload = { DisplayName: displayName };
13304
+ const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.UPDATE_BY_NAME(choiceSetName, valueId), payload);
13305
+ const camelCased = pascalToCamelCaseKeys(response.data);
13306
+ return transformData(camelCased, EntityMap);
13307
+ }
13308
+ /**
13309
+ * Deletes one or more values from a choice set.
13310
+ *
13311
+ * @param choiceSetId - UUID of the parent choice set
13312
+ * @param valueIds - Array of value UUIDs to delete
13313
+ * @returns Promise resolving when the values are deleted
13314
+ *
13315
+ * @example
13316
+ * ```typescript
13317
+ * // Get the value IDs from getById()
13318
+ * const values = await choicesets.getById('<choiceSetId>');
13319
+ * const idsToDelete = values.items.slice(0, 2).map(v => v.id);
13320
+ *
13321
+ * await choicesets.deleteValuesById('<choiceSetId>', idsToDelete);
13322
+ * ```
13323
+ * @internal
13324
+ */
13325
+ async deleteValuesById(choiceSetId, valueIds) {
13326
+ await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.DELETE_BY_ID(choiceSetId), valueIds);
13327
+ }
13328
+ async resolveChoiceSetName(choiceSetId) {
13329
+ const all = await this.getAll();
13330
+ const match = all.find(cs => cs.id === choiceSetId);
13331
+ if (!match) {
13332
+ throw new NotFoundError({ message: `Choice set with id '${choiceSetId}' not found.` });
13333
+ }
13334
+ return match.name;
13335
+ }
13145
13336
  }
13146
13337
  __decorate([
13147
13338
  track('Choicesets.GetAll')
@@ -13149,6 +13340,24 @@
13149
13340
  __decorate([
13150
13341
  track('Choicesets.GetById')
13151
13342
  ], ChoiceSetService.prototype, "getById", null);
13343
+ __decorate([
13344
+ track('Choicesets.Create')
13345
+ ], ChoiceSetService.prototype, "create", null);
13346
+ __decorate([
13347
+ track('Choicesets.UpdateById')
13348
+ ], ChoiceSetService.prototype, "updateById", null);
13349
+ __decorate([
13350
+ track('Choicesets.DeleteById')
13351
+ ], ChoiceSetService.prototype, "deleteById", null);
13352
+ __decorate([
13353
+ track('Choicesets.InsertValueById')
13354
+ ], ChoiceSetService.prototype, "insertValueById", null);
13355
+ __decorate([
13356
+ track('Choicesets.UpdateValueById')
13357
+ ], ChoiceSetService.prototype, "updateValueById", null);
13358
+ __decorate([
13359
+ track('Choicesets.DeleteValuesById')
13360
+ ], ChoiceSetService.prototype, "deleteValuesById", null);
13152
13361
 
13153
13362
  /**
13154
13363
  * Maestro Process Models
@@ -14077,6 +14286,52 @@
14077
14286
  const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, false, options));
14078
14287
  return (data ?? []).map(process => ({ ...process, name: process.packageId }));
14079
14288
  }
14289
+ /**
14290
+ * Get the top 10 BPMN elements ranked by failure count within a time range.
14291
+ *
14292
+ * Returns an array of up to 10 elements sorted by how many times they failed,
14293
+ * useful for identifying the most error-prone activities in processes.
14294
+ *
14295
+ * @param startTime - Start of the time range to query
14296
+ * @param endTime - End of the time range to query
14297
+ * @param options - Optional filters (packageId, processKey, version)
14298
+ * @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
14299
+ * @example
14300
+ * ```typescript
14301
+ * import { MaestroProcesses } from '@uipath/uipath-typescript/maestro-processes';
14302
+ *
14303
+ * const maestroProcesses = new MaestroProcesses(sdk);
14304
+ *
14305
+ * // Get top failing elements for the last 7 days
14306
+ * const topFailing = await maestroProcesses.getTopElementFailedCount(
14307
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
14308
+ * new Date()
14309
+ * );
14310
+ *
14311
+ * for (const element of topFailing) {
14312
+ * console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
14313
+ * }
14314
+ * ```
14315
+ *
14316
+ * @example
14317
+ * ```typescript
14318
+ * // Get top failing elements for a specific process
14319
+ * const filtered = await maestroProcesses.getTopElementFailedCount(
14320
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
14321
+ * new Date(),
14322
+ * { processKey: '<processKey>' }
14323
+ * );
14324
+ * ```
14325
+ */
14326
+ async getTopElementFailedCount(startTime, endTime, options) {
14327
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_ELEMENTS_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, false, options));
14328
+ return (data ?? []).map(item => ({
14329
+ elementName: item.elementName,
14330
+ elementType: item.elementType,
14331
+ processKey: item.processKey,
14332
+ failedCount: item.count,
14333
+ }));
14334
+ }
14080
14335
  /**
14081
14336
  * Get all instances status counts aggregated by date for maestro processes.
14082
14337
  *
@@ -14217,6 +14472,9 @@
14217
14472
  __decorate([
14218
14473
  track('MaestroProcesses.GetTopRunCount')
14219
14474
  ], MaestroProcessesService.prototype, "getTopRunCount", null);
14475
+ __decorate([
14476
+ track('MaestroProcesses.GetTopElementFailedCount')
14477
+ ], MaestroProcessesService.prototype, "getTopElementFailedCount", null);
14220
14478
  __decorate([
14221
14479
  track('MaestroProcesses.GetInstanceStatusTimeline')
14222
14480
  ], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);
@@ -14351,6 +14609,52 @@
14351
14609
  const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, true, options));
14352
14610
  return (data ?? []).map(process => ({ ...process, name: this.extractCaseName(process.packageId) }));
14353
14611
  }
14612
+ /**
14613
+ * Get the top 10 BPMN elements ranked by failure count within a time range.
14614
+ *
14615
+ * Returns an array of up to 10 elements sorted by how many times they failed,
14616
+ * useful for identifying the most error-prone activities in case processes.
14617
+ *
14618
+ * @param startTime - Start of the time range to query
14619
+ * @param endTime - End of the time range to query
14620
+ * @param options - Optional filters (packageId, processKey, version)
14621
+ * @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
14622
+ * @example
14623
+ * ```typescript
14624
+ * import { Cases } from '@uipath/uipath-typescript/cases';
14625
+ *
14626
+ * const cases = new Cases(sdk);
14627
+ *
14628
+ * // Get top failing elements for the last 7 days
14629
+ * const topFailing = await cases.getTopElementFailedCount(
14630
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
14631
+ * new Date()
14632
+ * );
14633
+ *
14634
+ * for (const element of topFailing) {
14635
+ * console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
14636
+ * }
14637
+ * ```
14638
+ *
14639
+ * @example
14640
+ * ```typescript
14641
+ * // Get top failing elements for a specific process
14642
+ * const filtered = await cases.getTopElementFailedCount(
14643
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
14644
+ * new Date(),
14645
+ * { processKey: '<processKey>' }
14646
+ * );
14647
+ * ```
14648
+ */
14649
+ async getTopElementFailedCount(startTime, endTime, options) {
14650
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_ELEMENTS_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, true, options));
14651
+ return (data ?? []).map(item => ({
14652
+ elementName: item.elementName,
14653
+ elementType: item.elementType,
14654
+ processKey: item.processKey,
14655
+ failedCount: item.count,
14656
+ }));
14657
+ }
14354
14658
  /**
14355
14659
  * Get all instances status counts aggregated by date for case management processes.
14356
14660
  *
@@ -14506,6 +14810,9 @@
14506
14810
  __decorate([
14507
14811
  track('Cases.GetTopRunCount')
14508
14812
  ], CasesService.prototype, "getTopRunCount", null);
14813
+ __decorate([
14814
+ track('Cases.GetTopElementFailedCount')
14815
+ ], CasesService.prototype, "getTopElementFailedCount", null);
14509
14816
  __decorate([
14510
14817
  track('Cases.GetInstanceStatusTimeline')
14511
14818
  ], CasesService.prototype, "getInstanceStatusTimeline", null);
@@ -16402,6 +16709,120 @@
16402
16709
  }
16403
16710
  return transformedData;
16404
16711
  }
16712
+ /**
16713
+ * Lists all files in a bucket.
16714
+ *
16715
+ * Returns a flat, recursive listing of all files in the bucket. Supports regex filtering
16716
+ * and filter / orderby / select / expand. {@link BucketFile} entries include
16717
+ * `isDirectory` so callers can distinguish folders from files.
16718
+ *
16719
+ * The method returns either:
16720
+ * - A NonPaginatedResponse with items array (when no pagination parameters are provided)
16721
+ * - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
16722
+ *
16723
+ * @param bucketId - The ID of the bucket
16724
+ * @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`) and optional parameters for regex filtering, query options, and pagination
16725
+ * @returns Promise resolving to either an array of files NonPaginatedResponse<BucketFile> or a PaginatedResponse<BucketFile> when pagination options are used.
16726
+ *
16727
+ * @example
16728
+ * ```typescript
16729
+ * import { Buckets } from '@uipath/uipath-typescript/buckets';
16730
+ *
16731
+ * const buckets = new Buckets(sdk);
16732
+ *
16733
+ * // List all files in the bucket
16734
+ * const files = await buckets.getFiles(<bucketId>, { folderId: <folderId> });
16735
+ *
16736
+ * // Filter by regex pattern
16737
+ * const pdfs = await buckets.getFiles(<bucketId>, {
16738
+ * folderId: <folderId>,
16739
+ * fileNameRegex: '.*\\.pdf$'
16740
+ * });
16741
+ *
16742
+ * // First page with pagination
16743
+ * const page1 = await buckets.getFiles(<bucketId>, { folderId: <folderId>, pageSize: 10 });
16744
+ *
16745
+ * // Navigate using cursor
16746
+ * if (page1.hasNextPage) {
16747
+ * const page2 = await buckets.getFiles(<bucketId>, { folderId: <folderId>, cursor: page1.nextCursor });
16748
+ * }
16749
+ *
16750
+ * // Jump to specific page
16751
+ * const page5 = await buckets.getFiles(<bucketId>, {
16752
+ * folderId: <folderId>,
16753
+ * jumpToPage: 5,
16754
+ * pageSize: 10
16755
+ * });
16756
+ * ```
16757
+ */
16758
+ async getFiles(bucketId, options) {
16759
+ if (!bucketId) {
16760
+ throw new ValidationError({ message: 'bucketId is required for getFiles' });
16761
+ }
16762
+ const { folderId, folderKey, folderPath, ...restOptions } = options ?? {};
16763
+ const headers = resolveFolderHeaders({
16764
+ folderId,
16765
+ folderKey,
16766
+ folderPath,
16767
+ resourceType: 'Buckets.getFiles',
16768
+ fallbackFolderKey: this.config.folderKey,
16769
+ });
16770
+ const transformBucketFile = (file) => transformData(pascalToCamelCaseKeys(file), BucketMap);
16771
+ return PaginationHelpers.getAll({
16772
+ serviceAccess: this.createPaginationServiceAccess(),
16773
+ getEndpoint: () => BUCKET_ENDPOINTS.GET_FILES(bucketId),
16774
+ transformFn: transformBucketFile,
16775
+ pagination: {
16776
+ paginationType: PaginationType.OFFSET,
16777
+ itemsField: ODATA_PAGINATION.ITEMS_FIELD,
16778
+ totalCountField: ODATA_PAGINATION.TOTAL_COUNT_FIELD,
16779
+ paginationParams: {
16780
+ pageSizeParam: ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM,
16781
+ offsetParam: ODATA_OFFSET_PARAMS.OFFSET_PARAM,
16782
+ countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM,
16783
+ },
16784
+ },
16785
+ excludeFromPrefix: ['directory', 'recursive', 'fileNameRegex'],
16786
+ headers,
16787
+ }, { ...restOptions, directory: '/', recursive: true });
16788
+ }
16789
+ /**
16790
+ * Deletes a file from a bucket
16791
+ *
16792
+ * @param bucketId - The ID of the bucket
16793
+ * @param path - The full path to the file to delete
16794
+ * @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`)
16795
+ * @returns Promise resolving when the file is deleted
16796
+ *
16797
+ * @example
16798
+ * ```typescript
16799
+ * import { Buckets } from '@uipath/uipath-typescript/buckets';
16800
+ *
16801
+ * const buckets = new Buckets(sdk);
16802
+ *
16803
+ * // Delete a file from a bucket
16804
+ * await buckets.deleteFile(<bucketId>, '/folder/file.pdf', { folderId: <folderId> });
16805
+ * ```
16806
+ */
16807
+ async deleteFile(bucketId, path, options) {
16808
+ if (!bucketId) {
16809
+ throw new ValidationError({ message: 'bucketId is required for deleteFile' });
16810
+ }
16811
+ if (!path) {
16812
+ throw new ValidationError({ message: 'path is required for deleteFile' });
16813
+ }
16814
+ const headers = resolveFolderHeaders({
16815
+ folderId: options?.folderId,
16816
+ folderKey: options?.folderKey,
16817
+ folderPath: options?.folderPath,
16818
+ resourceType: 'Buckets.deleteFile',
16819
+ fallbackFolderKey: this.config.folderKey,
16820
+ });
16821
+ await this.delete(BUCKET_ENDPOINTS.DELETE_FILE(bucketId), {
16822
+ params: { path },
16823
+ headers,
16824
+ });
16825
+ }
16405
16826
  /**
16406
16827
  * Gets a direct upload URL for a file in the bucket
16407
16828
  *
@@ -16435,6 +16856,12 @@
16435
16856
  __decorate([
16436
16857
  track('Buckets.GetReadUri')
16437
16858
  ], BucketService.prototype, "getReadUri", null);
16859
+ __decorate([
16860
+ track('Buckets.GetFiles')
16861
+ ], BucketService.prototype, "getFiles", null);
16862
+ __decorate([
16863
+ track('Buckets.DeleteFile')
16864
+ ], BucketService.prototype, "deleteFile", null);
16438
16865
 
16439
16866
  exports.BucketOptions = void 0;
16440
16867
  (function (BucketOptions) {
@@ -17232,33 +17659,32 @@
17232
17659
  }
17233
17660
  }, options);
17234
17661
  }
17235
- /**
17236
- * Starts a process execution (job)
17237
- *
17238
- * @param request - Process start request body
17239
- * @param folderId - Required folder ID
17240
- * @param options - Optional query parameters
17241
- * @returns Promise resolving to the created jobs
17242
- *
17243
- * @example
17244
- * ```typescript
17245
- * import { Processes } from '@uipath/uipath-typescript/processes';
17246
- *
17247
- * const processes = new Processes(sdk);
17248
- *
17249
- * // Start a process by process key
17250
- * const jobs = await processes.start({
17251
- * processKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
17252
- * }, 123); // folderId is required
17253
- *
17254
- * // Start a process by name with specific robots
17255
- * const jobs = await processes.start({
17256
- * processName: "MyProcess"
17257
- * }, 123); // folderId is required
17258
- * ```
17259
- */
17260
- async start(request, folderId, options = {}) {
17261
- const headers = createHeaders({ [FOLDER_ID]: folderId });
17662
+ async start(request, optionsOrFolderId, legacyOptions) {
17663
+ // Normalize the two overload forms into a single internal shape.
17664
+ let folderId;
17665
+ let folderKey;
17666
+ let folderPath;
17667
+ let queryOptions;
17668
+ if (typeof optionsOrFolderId === 'number') {
17669
+ // Deprecated positional form: start(request, folderId, options?)
17670
+ folderId = optionsOrFolderId;
17671
+ queryOptions = legacyOptions ?? {};
17672
+ }
17673
+ else {
17674
+ // Preferred form: start(request, options?)
17675
+ const { folderId: fid, folderKey: fkey, folderPath: fpath, ...rest } = optionsOrFolderId ?? {};
17676
+ folderId = fid;
17677
+ folderKey = fkey;
17678
+ folderPath = fpath;
17679
+ queryOptions = rest;
17680
+ }
17681
+ const headers = resolveFolderHeaders({
17682
+ folderId,
17683
+ folderKey,
17684
+ folderPath,
17685
+ resourceType: 'processes.start',
17686
+ fallbackFolderKey: this.config.folderKey,
17687
+ });
17262
17688
  // Transform SDK field names to API field names (e.g., processKey → releaseKey)
17263
17689
  const apiRequest = transformRequest(request, ProcessMap);
17264
17690
  // Create the request object according to API spec
@@ -17266,8 +17692,8 @@
17266
17692
  startInfo: apiRequest
17267
17693
  };
17268
17694
  // Prefix all query parameter keys with '$' for OData
17269
- const keysToPrefix = Object.keys(options);
17270
- const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
17695
+ const keysToPrefix = Object.keys(queryOptions);
17696
+ const apiOptions = addPrefixToKeys(queryOptions, ODATA_PREFIX, keysToPrefix);
17271
17697
  const response = await this.post(PROCESS_ENDPOINTS.START_PROCESS, requestBody, {
17272
17698
  params: apiOptions,
17273
17699
  headers