@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.cjs CHANGED
@@ -4514,6 +4514,8 @@ const BUCKET_ENDPOINTS = {
4514
4514
  GET_FILE_META_DATA: (id) => `${ORCHESTRATOR_BASE}/api/Buckets/${id}/ListFiles`,
4515
4515
  GET_READ_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetReadUri`,
4516
4516
  GET_WRITE_URI: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetWriteUri`,
4517
+ DELETE_FILE: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.DeleteFile`,
4518
+ GET_FILES: (id) => `${ORCHESTRATOR_BASE}/odata/Buckets(${id})/UiPath.Server.Configuration.OData.GetFiles`,
4517
4519
  };
4518
4520
  /**
4519
4521
  * Orchestrator Process Service Endpoints
@@ -4596,6 +4598,8 @@ const MAESTRO_ENDPOINTS = {
4596
4598
  TOP_PROCESSES_BY_RUN_COUNT: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcessesByRunCount`,
4597
4599
  /** Top processes ranked by failure count */
4598
4600
  TOP_PROCESSES_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcesseswithFailure`,
4601
+ /** Top elements ranked by failure count */
4602
+ TOP_ELEMENTS_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopElementswithFailure`,
4599
4603
  /** Instance status aggregated by date for time-series charts */
4600
4604
  INSTANCE_STATUS_BY_DATE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceStatusByDate`,
4601
4605
  /** Top processes ranked by total duration */
@@ -4639,6 +4643,12 @@ const DATA_FABRIC_ENDPOINTS = {
4639
4643
  CHOICESETS: {
4640
4644
  GET_ALL: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
4641
4645
  GET_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/query_expansion`,
4646
+ CREATE: `${DATAFABRIC_BASE}/api/Entity/choiceset`,
4647
+ UPDATE: (choiceSetId) => `${DATAFABRIC_BASE}/api/Entity/${choiceSetId}/metadata`,
4648
+ DELETE: (choiceSetId) => `${DATAFABRIC_BASE}/api/Entity/${choiceSetId}/delete`,
4649
+ INSERT_BY_NAME: (choiceSetName) => `${DATAFABRIC_BASE}/api/EntityService/${choiceSetName}/choiceset/insert`,
4650
+ UPDATE_BY_NAME: (choiceSetName, valueId) => `${DATAFABRIC_BASE}/api/EntityService/${choiceSetName}/choiceset/${valueId}/update`,
4651
+ DELETE_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/choiceset/delete`,
4642
4652
  },
4643
4653
  };
4644
4654
 
@@ -5484,7 +5494,7 @@ function normalizeBaseUrl(url) {
5484
5494
  * SDK's public API.
5485
5495
  */
5486
5496
  /** SDK version placeholder — patched by the SDK publish workflow. */
5487
- const SDK_VERSION = '1.3.9';
5497
+ const SDK_VERSION = '1.3.11';
5488
5498
  const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
5489
5499
  const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
5490
5500
  const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
@@ -6210,14 +6220,25 @@ class ApiClient {
6210
6220
  if (!text) {
6211
6221
  return undefined;
6212
6222
  }
6213
- return JSON.parse(text);
6223
+ try {
6224
+ return JSON.parse(text);
6225
+ }
6226
+ catch (error) {
6227
+ if (error instanceof SyntaxError) {
6228
+ throw new ServerError({
6229
+ message: `Server returned non-JSON response (${response.status} ${response.url}): ${error.message}`,
6230
+ statusCode: response.status,
6231
+ });
6232
+ }
6233
+ throw error;
6234
+ }
6214
6235
  }
6215
6236
  catch (error) {
6216
6237
  // If it's already one of our errors, re-throw it
6217
6238
  if (error.type && error.type.includes('Error')) {
6218
6239
  throw error;
6219
6240
  }
6220
- // Otherwise, it's likely a network error
6241
+ // Otherwise, it's a genuine network/fetch failure
6221
6242
  throw ErrorFactory.createNetworkError(error);
6222
6243
  }
6223
6244
  }
@@ -7113,9 +7134,9 @@ class PaginationHelpers {
7113
7134
  * @returns Promise resolving to a paginated result
7114
7135
  */
7115
7136
  static async getAllPaginated(params) {
7116
- const { serviceAccess, getEndpoint, folderId, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
7137
+ const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
7117
7138
  const endpoint = getEndpoint(folderId);
7118
- const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
7139
+ const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
7119
7140
  const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
7120
7141
  headers,
7121
7142
  params: additionalParams,
@@ -7143,13 +7164,13 @@ class PaginationHelpers {
7143
7164
  * @returns Promise resolving to an object with data and totalCount
7144
7165
  */
7145
7166
  static async getAllNonPaginated(params) {
7146
- const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
7167
+ const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
7147
7168
  // Set default field names
7148
7169
  const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
7149
7170
  const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
7150
7171
  // Determine endpoint and headers based on folderId
7151
7172
  const endpoint = folderId ? getByFolderEndpoint : getAllEndpoint;
7152
- const headers = folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {};
7173
+ const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
7153
7174
  // Make the API call based on method
7154
7175
  let response;
7155
7176
  if (method === HTTP_METHODS.POST) {
@@ -7208,6 +7229,7 @@ class PaginationHelpers {
7208
7229
  serviceAccess: config.serviceAccess,
7209
7230
  getEndpoint: config.getEndpoint,
7210
7231
  folderId,
7232
+ headers: config.headers,
7211
7233
  paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
7212
7234
  additionalParams: prefixedOptions,
7213
7235
  transformFn: config.transformFn,
@@ -7225,6 +7247,7 @@ class PaginationHelpers {
7225
7247
  getAllEndpoint: config.getEndpoint(),
7226
7248
  getByFolderEndpoint: byFolderEndpoint,
7227
7249
  folderId,
7250
+ headers: config.headers,
7228
7251
  additionalParams: prefixedOptions,
7229
7252
  transformFn: config.transformFn,
7230
7253
  method: config.method,
@@ -8517,10 +8540,6 @@ class EntityService extends BaseService {
8517
8540
  * @internal
8518
8541
  */
8519
8542
  async create(name, fields, options) {
8520
- this.validateName(name, 'entity');
8521
- for (const field of fields) {
8522
- this.validateName(field.fieldName, 'field');
8523
- }
8524
8543
  const opts = options ?? {};
8525
8544
  const payload = {
8526
8545
  ...(opts.description !== undefined && { description: opts.description }),
@@ -8663,6 +8682,7 @@ class EntityService extends BaseService {
8663
8682
  ...(update.isUnique !== undefined && { isUnique: update.isUnique }),
8664
8683
  ...(update.isRbacEnabled !== undefined && { isRbacEnabled: update.isRbacEnabled }),
8665
8684
  ...(update.isEncrypted !== undefined && { isEncrypted: update.isEncrypted }),
8685
+ ...(update.isHiddenField !== undefined && { isHiddenField: update.isHiddenField }),
8666
8686
  ...(update.defaultValue !== undefined && { defaultValue: update.defaultValue }),
8667
8687
  ...(hasConstraintUpdate && f.sqlType && { sqlType: { ...f.sqlType, ...constraintUpdate } }),
8668
8688
  };
@@ -8671,9 +8691,6 @@ class EntityService extends BaseService {
8671
8691
  // Build and append new fields
8672
8692
  const newFields = [];
8673
8693
  if (options.addFields?.length) {
8674
- for (const field of options.addFields) {
8675
- this.validateName(field.fieldName, 'field');
8676
- }
8677
8694
  newFields.push(...options.addFields.map(f => this.buildSchemaFieldPayload(f)));
8678
8695
  }
8679
8696
  await this.post(DATA_FABRIC_ENDPOINTS.ENTITY.UPSERT, {
@@ -8774,9 +8791,15 @@ class EntityService extends BaseService {
8774
8791
  }
8775
8792
  /** Converts a user-facing EntityCreateFieldOptions to the raw API field payload */
8776
8793
  buildSchemaFieldPayload(field) {
8777
- this.validateName(field.fieldName, 'field');
8778
8794
  const fieldType = field.type ?? exports.EntityFieldDataType.STRING;
8779
8795
  this.validateFieldConstraints(fieldType, field, field.fieldName);
8796
+ const isRelationship = fieldType === exports.EntityFieldDataType.RELATIONSHIP;
8797
+ const isFile = fieldType === exports.EntityFieldDataType.FILE;
8798
+ if ((isRelationship || isFile) && (!field.referenceEntityId || !field.referenceFieldId)) {
8799
+ throw new ValidationError({
8800
+ message: `Field '${field.fieldName}' of type ${fieldType} requires both referenceEntityId and referenceFieldId (UUIDs of the target entity and field).`,
8801
+ });
8802
+ }
8780
8803
  const mapping = EntitySchemaFieldTypeMap[fieldType];
8781
8804
  return {
8782
8805
  name: field.fieldName,
@@ -8791,10 +8814,13 @@ class EntityService extends BaseService {
8791
8814
  isUnique: field.isUnique ?? false,
8792
8815
  isRbacEnabled: field.isRbacEnabled ?? false,
8793
8816
  isEncrypted: field.isEncrypted ?? false,
8817
+ isHiddenField: field.isHiddenField ?? false,
8794
8818
  ...(field.defaultValue !== undefined && { defaultValue: field.defaultValue }),
8795
8819
  ...(field.choiceSetId !== undefined && { choiceSetId: field.choiceSetId }),
8796
- ...(field.referenceEntityName !== undefined && { referenceEntityName: field.referenceEntityName }),
8797
- ...(field.referenceFieldName !== undefined && { referenceFieldName: field.referenceFieldName }),
8820
+ ...((isRelationship || isFile) && { isForeignKey: true }),
8821
+ ...(isRelationship && { referenceType: exports.ReferenceType.ManyToOne }),
8822
+ ...(field.referenceEntityId !== undefined && { referenceEntity: { id: field.referenceEntityId } }),
8823
+ ...(field.referenceFieldId !== undefined && { referenceField: { id: field.referenceFieldId } }),
8798
8824
  };
8799
8825
  }
8800
8826
  /**
@@ -8898,24 +8924,7 @@ class EntityService extends BaseService {
8898
8924
  return {};
8899
8925
  }
8900
8926
  }
8901
- validateName(name, context) {
8902
- if (name.length < 3 || name.length > 100 || !/^[a-zA-Z]\w*$/.test(name)) {
8903
- const suggestion = name.replace(/\W/g, '').replace(/^[0-9_]+/, '');
8904
- const defaultName = `My${context.charAt(0).toUpperCase() + context.slice(1)}`;
8905
- throw new ValidationError({
8906
- message: `Invalid ${context} name '${name}'. Must start with a letter, contain only letters, numbers, and underscores, 3–100 characters (e.g., "${suggestion || defaultName}").`
8907
- });
8908
- }
8909
- if (context === 'field' && EntityService.RESERVED_FIELD_NAMES.has(name)) {
8910
- throw new ValidationError({
8911
- message: `Field name '${name}' is reserved. Reserved names: ${[...EntityService.RESERVED_FIELD_NAMES].join(', ')}.`
8912
- });
8913
- }
8914
- }
8915
8927
  }
8916
- EntityService.RESERVED_FIELD_NAMES = new Set([
8917
- 'Id', 'CreatedBy', 'CreateTime', 'UpdatedBy', 'UpdateTime'
8918
- ]);
8919
8928
  __decorate([
8920
8929
  track('Entities.GetById')
8921
8930
  ], EntityService.prototype, "getById", null);
@@ -9012,7 +9021,7 @@ class ChoiceSetService extends BaseService {
9012
9021
  *
9013
9022
  * @example
9014
9023
  * ```typescript
9015
- * import { ChoiceSets } from '@uipath/uipath-typescript/choicesets';
9024
+ * import { ChoiceSets } from '@uipath/uipath-typescript/entities';
9016
9025
  *
9017
9026
  * const choiceSets = new ChoiceSets(sdk);
9018
9027
  *
@@ -9061,6 +9070,188 @@ class ChoiceSetService extends BaseService {
9061
9070
  }
9062
9071
  }, options);
9063
9072
  }
9073
+ /**
9074
+ * Creates a new Data Fabric choice set
9075
+ *
9076
+ * @param name - Choice set name. Must start with a
9077
+ * letter, may contain only letters, numbers, and underscores, length
9078
+ * 3–100 characters (e.g., `"expenseTypes"`).
9079
+ * @param options - Optional choice-set-level settings ({@link ChoiceSetCreateOptions})
9080
+ * @returns Promise resolving to the UUID of the created choice set
9081
+ *
9082
+ * @example
9083
+ * ```typescript
9084
+ * import { ChoiceSets } from '@uipath/uipath-typescript/entities';
9085
+ *
9086
+ * const choicesets = new ChoiceSets(sdk);
9087
+ *
9088
+ * // Minimal create
9089
+ * const expenseTypesId = await choicesets.create("expense_types");
9090
+ *
9091
+ * // With display name and description
9092
+ * const priorityLevelsId = await choicesets.create("priority_levels", {
9093
+ * displayName: "Priority Levels",
9094
+ * description: "Ticket priority categories",
9095
+ * });
9096
+ * ```
9097
+ * @internal
9098
+ */
9099
+ async create(name, options) {
9100
+ const opts = options ?? {};
9101
+ const payload = {
9102
+ ...(opts.description !== undefined && { description: opts.description }),
9103
+ ...(opts.displayName !== undefined && { displayName: opts.displayName }),
9104
+ entityDefinition: {
9105
+ name,
9106
+ fields: [],
9107
+ folderId: opts.folderKey ?? DATA_FABRIC_TENANT_FOLDER_ID,
9108
+ },
9109
+ };
9110
+ const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.CREATE, payload);
9111
+ return response.data;
9112
+ }
9113
+ /**
9114
+ * Updates an existing choice set's metadata (display name and/or description).
9115
+ *
9116
+ * **At least one of `displayName` or `description` must be provided** —
9117
+ * the call throws `ValidationError` if both are omitted.
9118
+ *
9119
+ * @param choiceSetId - UUID of the choice set to update
9120
+ * @param options - Metadata fields to change ({@link ChoiceSetUpdateOptions})
9121
+ * @returns Promise resolving when the update is complete
9122
+ *
9123
+ * @example
9124
+ * ```typescript
9125
+ * // First, get the choice set ID using getAll()
9126
+ * const allChoiceSets = await choicesets.getAll();
9127
+ * const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
9128
+ *
9129
+ * await choicesets.updateById(expenseTypes.id, {
9130
+ * displayName: "Expense Categories",
9131
+ * description: "Updated description",
9132
+ * });
9133
+ * ```
9134
+ * @internal
9135
+ */
9136
+ async updateById(choiceSetId, options) {
9137
+ if (options.displayName === undefined && options.description === undefined) {
9138
+ throw new ValidationError({
9139
+ message: 'updateById requires at least one of displayName or description.',
9140
+ });
9141
+ }
9142
+ await this.patch(DATA_FABRIC_ENDPOINTS.CHOICESETS.UPDATE(choiceSetId), {
9143
+ ...(options.displayName !== undefined && { displayName: options.displayName }),
9144
+ ...(options.description !== undefined && { description: options.description }),
9145
+ });
9146
+ }
9147
+ /**
9148
+ * Deletes a Data Fabric choice set and all its values.
9149
+ *
9150
+ * @param choiceSetId - UUID of the choice set to delete
9151
+ * @returns Promise resolving when the choice set is deleted
9152
+ *
9153
+ * @example
9154
+ * ```typescript
9155
+ * // First, get the choice set ID using getAll()
9156
+ * const allChoiceSets = await choicesets.getAll();
9157
+ * const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
9158
+ *
9159
+ * await choicesets.deleteById(expenseTypes.id);
9160
+ * ```
9161
+ * @internal
9162
+ */
9163
+ async deleteById(choiceSetId) {
9164
+ await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.DELETE(choiceSetId), {});
9165
+ }
9166
+ /**
9167
+ * Inserts a single value into a choice set.
9168
+ *
9169
+ * @param choiceSetId - UUID of the parent choice set
9170
+ * @param name - Identifier name of the new value (e.g., `"TRAVEL"`)
9171
+ * @param options - Optional fields ({@link ChoiceSetValueInsertOptions})
9172
+ * @returns Promise resolving to the inserted value ({@link ChoiceSetValueInsertResponse})
9173
+ *
9174
+ * @example
9175
+ * ```typescript
9176
+ * // First, get the choice set ID using getAll()
9177
+ * const allChoiceSets = await choicesets.getAll();
9178
+ * const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
9179
+ *
9180
+ * const inserted = await choicesets.insertValueById(expenseTypes.id, 'TRAVEL', {
9181
+ * displayName: 'Travel',
9182
+ * });
9183
+ * console.log(inserted.id);
9184
+ * ```
9185
+ * @internal
9186
+ */
9187
+ async insertValueById(choiceSetId, name, options) {
9188
+ const choiceSetName = await this.resolveChoiceSetName(choiceSetId);
9189
+ const payload = {
9190
+ Name: name,
9191
+ ...(options?.displayName !== undefined && { DisplayName: options.displayName }),
9192
+ };
9193
+ const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.INSERT_BY_NAME(choiceSetName), payload);
9194
+ const camelCased = pascalToCamelCaseKeys(response.data);
9195
+ return transformData(camelCased, EntityMap);
9196
+ }
9197
+ /**
9198
+ * Updates an existing choice-set value's display name.
9199
+ *
9200
+ * Only `displayName` is mutable; the value's `name` (identifier) is fixed at
9201
+ * insert time and cannot be changed.
9202
+ *
9203
+ * @param choiceSetId - UUID of the parent choice set
9204
+ * @param valueId - UUID of the value to update
9205
+ * @param displayName - New human-readable display name for the value
9206
+ * @returns Promise resolving to the updated value ({@link ChoiceSetValueUpdateResponse})
9207
+ *
9208
+ * @example
9209
+ * ```typescript
9210
+ * // Get the choice set ID from getAll() and the value ID from getById()
9211
+ * const allChoiceSets = await choicesets.getAll();
9212
+ * const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
9213
+ * const values = await choicesets.getById(expenseTypes.id);
9214
+ * const travel = values.items.find(v => v.name === 'TRAVEL');
9215
+ *
9216
+ * await choicesets.updateValueById(expenseTypes.id, travel.id, 'Business Travel');
9217
+ * ```
9218
+ * @internal
9219
+ */
9220
+ async updateValueById(choiceSetId, valueId, displayName) {
9221
+ const choiceSetName = await this.resolveChoiceSetName(choiceSetId);
9222
+ const payload = { DisplayName: displayName };
9223
+ const response = await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.UPDATE_BY_NAME(choiceSetName, valueId), payload);
9224
+ const camelCased = pascalToCamelCaseKeys(response.data);
9225
+ return transformData(camelCased, EntityMap);
9226
+ }
9227
+ /**
9228
+ * Deletes one or more values from a choice set.
9229
+ *
9230
+ * @param choiceSetId - UUID of the parent choice set
9231
+ * @param valueIds - Array of value UUIDs to delete
9232
+ * @returns Promise resolving when the values are deleted
9233
+ *
9234
+ * @example
9235
+ * ```typescript
9236
+ * // Get the value IDs from getById()
9237
+ * const values = await choicesets.getById('<choiceSetId>');
9238
+ * const idsToDelete = values.items.slice(0, 2).map(v => v.id);
9239
+ *
9240
+ * await choicesets.deleteValuesById('<choiceSetId>', idsToDelete);
9241
+ * ```
9242
+ * @internal
9243
+ */
9244
+ async deleteValuesById(choiceSetId, valueIds) {
9245
+ await this.post(DATA_FABRIC_ENDPOINTS.CHOICESETS.DELETE_BY_ID(choiceSetId), valueIds);
9246
+ }
9247
+ async resolveChoiceSetName(choiceSetId) {
9248
+ const all = await this.getAll();
9249
+ const match = all.find(cs => cs.id === choiceSetId);
9250
+ if (!match) {
9251
+ throw new NotFoundError({ message: `Choice set with id '${choiceSetId}' not found.` });
9252
+ }
9253
+ return match.name;
9254
+ }
9064
9255
  }
9065
9256
  __decorate([
9066
9257
  track('Choicesets.GetAll')
@@ -9068,6 +9259,24 @@ __decorate([
9068
9259
  __decorate([
9069
9260
  track('Choicesets.GetById')
9070
9261
  ], ChoiceSetService.prototype, "getById", null);
9262
+ __decorate([
9263
+ track('Choicesets.Create')
9264
+ ], ChoiceSetService.prototype, "create", null);
9265
+ __decorate([
9266
+ track('Choicesets.UpdateById')
9267
+ ], ChoiceSetService.prototype, "updateById", null);
9268
+ __decorate([
9269
+ track('Choicesets.DeleteById')
9270
+ ], ChoiceSetService.prototype, "deleteById", null);
9271
+ __decorate([
9272
+ track('Choicesets.InsertValueById')
9273
+ ], ChoiceSetService.prototype, "insertValueById", null);
9274
+ __decorate([
9275
+ track('Choicesets.UpdateValueById')
9276
+ ], ChoiceSetService.prototype, "updateValueById", null);
9277
+ __decorate([
9278
+ track('Choicesets.DeleteValuesById')
9279
+ ], ChoiceSetService.prototype, "deleteValuesById", null);
9071
9280
 
9072
9281
  /**
9073
9282
  * Maestro Process Models
@@ -9996,6 +10205,52 @@ class MaestroProcessesService extends BaseService {
9996
10205
  const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, false, options));
9997
10206
  return (data ?? []).map(process => ({ ...process, name: process.packageId }));
9998
10207
  }
10208
+ /**
10209
+ * Get the top 10 BPMN elements ranked by failure count within a time range.
10210
+ *
10211
+ * Returns an array of up to 10 elements sorted by how many times they failed,
10212
+ * useful for identifying the most error-prone activities in processes.
10213
+ *
10214
+ * @param startTime - Start of the time range to query
10215
+ * @param endTime - End of the time range to query
10216
+ * @param options - Optional filters (packageId, processKey, version)
10217
+ * @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
10218
+ * @example
10219
+ * ```typescript
10220
+ * import { MaestroProcesses } from '@uipath/uipath-typescript/maestro-processes';
10221
+ *
10222
+ * const maestroProcesses = new MaestroProcesses(sdk);
10223
+ *
10224
+ * // Get top failing elements for the last 7 days
10225
+ * const topFailing = await maestroProcesses.getTopElementFailedCount(
10226
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
10227
+ * new Date()
10228
+ * );
10229
+ *
10230
+ * for (const element of topFailing) {
10231
+ * console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
10232
+ * }
10233
+ * ```
10234
+ *
10235
+ * @example
10236
+ * ```typescript
10237
+ * // Get top failing elements for a specific process
10238
+ * const filtered = await maestroProcesses.getTopElementFailedCount(
10239
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
10240
+ * new Date(),
10241
+ * { processKey: '<processKey>' }
10242
+ * );
10243
+ * ```
10244
+ */
10245
+ async getTopElementFailedCount(startTime, endTime, options) {
10246
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_ELEMENTS_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, false, options));
10247
+ return (data ?? []).map(item => ({
10248
+ elementName: item.elementName,
10249
+ elementType: item.elementType,
10250
+ processKey: item.processKey,
10251
+ failedCount: item.count,
10252
+ }));
10253
+ }
9999
10254
  /**
10000
10255
  * Get all instances status counts aggregated by date for maestro processes.
10001
10256
  *
@@ -10136,6 +10391,9 @@ __decorate([
10136
10391
  __decorate([
10137
10392
  track('MaestroProcesses.GetTopRunCount')
10138
10393
  ], MaestroProcessesService.prototype, "getTopRunCount", null);
10394
+ __decorate([
10395
+ track('MaestroProcesses.GetTopElementFailedCount')
10396
+ ], MaestroProcessesService.prototype, "getTopElementFailedCount", null);
10139
10397
  __decorate([
10140
10398
  track('MaestroProcesses.GetInstanceStatusTimeline')
10141
10399
  ], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);
@@ -10270,6 +10528,52 @@ class CasesService extends BaseService {
10270
10528
  const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, true, options));
10271
10529
  return (data ?? []).map(process => ({ ...process, name: this.extractCaseName(process.packageId) }));
10272
10530
  }
10531
+ /**
10532
+ * Get the top 10 BPMN elements ranked by failure count within a time range.
10533
+ *
10534
+ * Returns an array of up to 10 elements sorted by how many times they failed,
10535
+ * useful for identifying the most error-prone activities in case processes.
10536
+ *
10537
+ * @param startTime - Start of the time range to query
10538
+ * @param endTime - End of the time range to query
10539
+ * @param options - Optional filters (packageId, processKey, version)
10540
+ * @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
10541
+ * @example
10542
+ * ```typescript
10543
+ * import { Cases } from '@uipath/uipath-typescript/cases';
10544
+ *
10545
+ * const cases = new Cases(sdk);
10546
+ *
10547
+ * // Get top failing elements for the last 7 days
10548
+ * const topFailing = await cases.getTopElementFailedCount(
10549
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
10550
+ * new Date()
10551
+ * );
10552
+ *
10553
+ * for (const element of topFailing) {
10554
+ * console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
10555
+ * }
10556
+ * ```
10557
+ *
10558
+ * @example
10559
+ * ```typescript
10560
+ * // Get top failing elements for a specific process
10561
+ * const filtered = await cases.getTopElementFailedCount(
10562
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
10563
+ * new Date(),
10564
+ * { processKey: '<processKey>' }
10565
+ * );
10566
+ * ```
10567
+ */
10568
+ async getTopElementFailedCount(startTime, endTime, options) {
10569
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_ELEMENTS_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, true, options));
10570
+ return (data ?? []).map(item => ({
10571
+ elementName: item.elementName,
10572
+ elementType: item.elementType,
10573
+ processKey: item.processKey,
10574
+ failedCount: item.count,
10575
+ }));
10576
+ }
10273
10577
  /**
10274
10578
  * Get all instances status counts aggregated by date for case management processes.
10275
10579
  *
@@ -10425,6 +10729,9 @@ __decorate([
10425
10729
  __decorate([
10426
10730
  track('Cases.GetTopRunCount')
10427
10731
  ], CasesService.prototype, "getTopRunCount", null);
10732
+ __decorate([
10733
+ track('Cases.GetTopElementFailedCount')
10734
+ ], CasesService.prototype, "getTopElementFailedCount", null);
10428
10735
  __decorate([
10429
10736
  track('Cases.GetInstanceStatusTimeline')
10430
10737
  ], CasesService.prototype, "getInstanceStatusTimeline", null);
@@ -12321,6 +12628,120 @@ class BucketService extends FolderScopedService {
12321
12628
  }
12322
12629
  return transformedData;
12323
12630
  }
12631
+ /**
12632
+ * Lists all files in a bucket.
12633
+ *
12634
+ * Returns a flat, recursive listing of all files in the bucket. Supports regex filtering
12635
+ * and filter / orderby / select / expand. {@link BucketFile} entries include
12636
+ * `isDirectory` so callers can distinguish folders from files.
12637
+ *
12638
+ * The method returns either:
12639
+ * - A NonPaginatedResponse with items array (when no pagination parameters are provided)
12640
+ * - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
12641
+ *
12642
+ * @param bucketId - The ID of the bucket
12643
+ * @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`) and optional parameters for regex filtering, query options, and pagination
12644
+ * @returns Promise resolving to either an array of files NonPaginatedResponse<BucketFile> or a PaginatedResponse<BucketFile> when pagination options are used.
12645
+ *
12646
+ * @example
12647
+ * ```typescript
12648
+ * import { Buckets } from '@uipath/uipath-typescript/buckets';
12649
+ *
12650
+ * const buckets = new Buckets(sdk);
12651
+ *
12652
+ * // List all files in the bucket
12653
+ * const files = await buckets.getFiles(<bucketId>, { folderId: <folderId> });
12654
+ *
12655
+ * // Filter by regex pattern
12656
+ * const pdfs = await buckets.getFiles(<bucketId>, {
12657
+ * folderId: <folderId>,
12658
+ * fileNameRegex: '.*\\.pdf$'
12659
+ * });
12660
+ *
12661
+ * // First page with pagination
12662
+ * const page1 = await buckets.getFiles(<bucketId>, { folderId: <folderId>, pageSize: 10 });
12663
+ *
12664
+ * // Navigate using cursor
12665
+ * if (page1.hasNextPage) {
12666
+ * const page2 = await buckets.getFiles(<bucketId>, { folderId: <folderId>, cursor: page1.nextCursor });
12667
+ * }
12668
+ *
12669
+ * // Jump to specific page
12670
+ * const page5 = await buckets.getFiles(<bucketId>, {
12671
+ * folderId: <folderId>,
12672
+ * jumpToPage: 5,
12673
+ * pageSize: 10
12674
+ * });
12675
+ * ```
12676
+ */
12677
+ async getFiles(bucketId, options) {
12678
+ if (!bucketId) {
12679
+ throw new ValidationError({ message: 'bucketId is required for getFiles' });
12680
+ }
12681
+ const { folderId, folderKey, folderPath, ...restOptions } = options ?? {};
12682
+ const headers = resolveFolderHeaders({
12683
+ folderId,
12684
+ folderKey,
12685
+ folderPath,
12686
+ resourceType: 'Buckets.getFiles',
12687
+ fallbackFolderKey: this.config.folderKey,
12688
+ });
12689
+ const transformBucketFile = (file) => transformData(pascalToCamelCaseKeys(file), BucketMap);
12690
+ return PaginationHelpers.getAll({
12691
+ serviceAccess: this.createPaginationServiceAccess(),
12692
+ getEndpoint: () => BUCKET_ENDPOINTS.GET_FILES(bucketId),
12693
+ transformFn: transformBucketFile,
12694
+ pagination: {
12695
+ paginationType: PaginationType.OFFSET,
12696
+ itemsField: ODATA_PAGINATION.ITEMS_FIELD,
12697
+ totalCountField: ODATA_PAGINATION.TOTAL_COUNT_FIELD,
12698
+ paginationParams: {
12699
+ pageSizeParam: ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM,
12700
+ offsetParam: ODATA_OFFSET_PARAMS.OFFSET_PARAM,
12701
+ countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM,
12702
+ },
12703
+ },
12704
+ excludeFromPrefix: ['directory', 'recursive', 'fileNameRegex'],
12705
+ headers,
12706
+ }, { ...restOptions, directory: '/', recursive: true });
12707
+ }
12708
+ /**
12709
+ * Deletes a file from a bucket
12710
+ *
12711
+ * @param bucketId - The ID of the bucket
12712
+ * @param path - The full path to the file to delete
12713
+ * @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`)
12714
+ * @returns Promise resolving when the file is deleted
12715
+ *
12716
+ * @example
12717
+ * ```typescript
12718
+ * import { Buckets } from '@uipath/uipath-typescript/buckets';
12719
+ *
12720
+ * const buckets = new Buckets(sdk);
12721
+ *
12722
+ * // Delete a file from a bucket
12723
+ * await buckets.deleteFile(<bucketId>, '/folder/file.pdf', { folderId: <folderId> });
12724
+ * ```
12725
+ */
12726
+ async deleteFile(bucketId, path, options) {
12727
+ if (!bucketId) {
12728
+ throw new ValidationError({ message: 'bucketId is required for deleteFile' });
12729
+ }
12730
+ if (!path) {
12731
+ throw new ValidationError({ message: 'path is required for deleteFile' });
12732
+ }
12733
+ const headers = resolveFolderHeaders({
12734
+ folderId: options?.folderId,
12735
+ folderKey: options?.folderKey,
12736
+ folderPath: options?.folderPath,
12737
+ resourceType: 'Buckets.deleteFile',
12738
+ fallbackFolderKey: this.config.folderKey,
12739
+ });
12740
+ await this.delete(BUCKET_ENDPOINTS.DELETE_FILE(bucketId), {
12741
+ params: { path },
12742
+ headers,
12743
+ });
12744
+ }
12324
12745
  /**
12325
12746
  * Gets a direct upload URL for a file in the bucket
12326
12747
  *
@@ -12354,6 +12775,12 @@ __decorate([
12354
12775
  __decorate([
12355
12776
  track('Buckets.GetReadUri')
12356
12777
  ], BucketService.prototype, "getReadUri", null);
12778
+ __decorate([
12779
+ track('Buckets.GetFiles')
12780
+ ], BucketService.prototype, "getFiles", null);
12781
+ __decorate([
12782
+ track('Buckets.DeleteFile')
12783
+ ], BucketService.prototype, "deleteFile", null);
12357
12784
 
12358
12785
  exports.BucketOptions = void 0;
12359
12786
  (function (BucketOptions) {
@@ -13151,33 +13578,32 @@ class ProcessService extends FolderScopedService {
13151
13578
  }
13152
13579
  }, options);
13153
13580
  }
13154
- /**
13155
- * Starts a process execution (job)
13156
- *
13157
- * @param request - Process start request body
13158
- * @param folderId - Required folder ID
13159
- * @param options - Optional query parameters
13160
- * @returns Promise resolving to the created jobs
13161
- *
13162
- * @example
13163
- * ```typescript
13164
- * import { Processes } from '@uipath/uipath-typescript/processes';
13165
- *
13166
- * const processes = new Processes(sdk);
13167
- *
13168
- * // Start a process by process key
13169
- * const jobs = await processes.start({
13170
- * processKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
13171
- * }, 123); // folderId is required
13172
- *
13173
- * // Start a process by name with specific robots
13174
- * const jobs = await processes.start({
13175
- * processName: "MyProcess"
13176
- * }, 123); // folderId is required
13177
- * ```
13178
- */
13179
- async start(request, folderId, options = {}) {
13180
- const headers = createHeaders({ [FOLDER_ID]: folderId });
13581
+ async start(request, optionsOrFolderId, legacyOptions) {
13582
+ // Normalize the two overload forms into a single internal shape.
13583
+ let folderId;
13584
+ let folderKey;
13585
+ let folderPath;
13586
+ let queryOptions;
13587
+ if (typeof optionsOrFolderId === 'number') {
13588
+ // Deprecated positional form: start(request, folderId, options?)
13589
+ folderId = optionsOrFolderId;
13590
+ queryOptions = legacyOptions ?? {};
13591
+ }
13592
+ else {
13593
+ // Preferred form: start(request, options?)
13594
+ const { folderId: fid, folderKey: fkey, folderPath: fpath, ...rest } = optionsOrFolderId ?? {};
13595
+ folderId = fid;
13596
+ folderKey = fkey;
13597
+ folderPath = fpath;
13598
+ queryOptions = rest;
13599
+ }
13600
+ const headers = resolveFolderHeaders({
13601
+ folderId,
13602
+ folderKey,
13603
+ folderPath,
13604
+ resourceType: 'processes.start',
13605
+ fallbackFolderKey: this.config.folderKey,
13606
+ });
13181
13607
  // Transform SDK field names to API field names (e.g., processKey → releaseKey)
13182
13608
  const apiRequest = transformRequest(request, ProcessMap);
13183
13609
  // Create the request object according to API spec
@@ -13185,8 +13611,8 @@ class ProcessService extends FolderScopedService {
13185
13611
  startInfo: apiRequest
13186
13612
  };
13187
13613
  // Prefix all query parameter keys with '$' for OData
13188
- const keysToPrefix = Object.keys(options);
13189
- const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
13614
+ const keysToPrefix = Object.keys(queryOptions);
13615
+ const apiOptions = addPrefixToKeys(queryOptions, ODATA_PREFIX, keysToPrefix);
13190
13616
  const response = await this.post(PROCESS_ENDPOINTS.START_PROCESS, requestBody, {
13191
13617
  params: apiOptions,
13192
13618
  headers