@uipath/uipath-typescript 1.3.3 → 1.3.5

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 (38) hide show
  1. package/dist/assets/index.cjs +8 -1
  2. package/dist/assets/index.mjs +8 -1
  3. package/dist/attachments/index.cjs +8 -1
  4. package/dist/attachments/index.mjs +8 -1
  5. package/dist/buckets/index.cjs +8 -1
  6. package/dist/buckets/index.mjs +8 -1
  7. package/dist/cases/index.cjs +8 -1
  8. package/dist/cases/index.mjs +8 -1
  9. package/dist/conversational-agent/index.cjs +8 -1
  10. package/dist/conversational-agent/index.d.ts +29 -2
  11. package/dist/conversational-agent/index.mjs +8 -1
  12. package/dist/core/index.cjs +1 -1
  13. package/dist/core/index.d.ts +1 -1
  14. package/dist/core/index.mjs +1 -1
  15. package/dist/document-understanding/index.cjs +257 -0
  16. package/dist/document-understanding/index.d.ts +1185 -0
  17. package/dist/document-understanding/index.mjs +255 -0
  18. package/dist/entities/index.cjs +277 -15
  19. package/dist/entities/index.d.ts +135 -0
  20. package/dist/entities/index.mjs +277 -15
  21. package/dist/feedback/index.cjs +8 -1
  22. package/dist/feedback/index.mjs +8 -1
  23. package/dist/index.cjs +578 -15
  24. package/dist/index.d.ts +1384 -9
  25. package/dist/index.mjs +580 -18
  26. package/dist/index.umd.js +578 -15
  27. package/dist/jobs/index.cjs +54 -1
  28. package/dist/jobs/index.d.ts +52 -0
  29. package/dist/jobs/index.mjs +54 -1
  30. package/dist/maestro-processes/index.cjs +8 -1
  31. package/dist/maestro-processes/index.mjs +8 -1
  32. package/dist/processes/index.cjs +8 -1
  33. package/dist/processes/index.mjs +8 -1
  34. package/dist/queues/index.cjs +8 -1
  35. package/dist/queues/index.mjs +8 -1
  36. package/dist/tasks/index.cjs +8 -1
  37. package/dist/tasks/index.mjs +8 -1
  38. package/package.json +12 -2
package/dist/index.cjs CHANGED
@@ -4538,6 +4538,7 @@ const JOB_ENDPOINTS = {
4538
4538
  GET_BY_KEY: (identifier) => `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.GetByKey(identifier=${identifier})`,
4539
4539
  STOP: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.StopJobs`,
4540
4540
  RESUME: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.ResumeJob`,
4541
+ RESTART: `${ORCHESTRATOR_BASE}/odata/Jobs/UiPath.Server.Configuration.OData.RestartJob`,
4541
4542
  };
4542
4543
  /**
4543
4544
  * Orchestrator Asset Service Endpoints
@@ -4609,6 +4610,7 @@ const DATA_FABRIC_ENDPOINTS = {
4609
4610
  BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
4610
4611
  UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
4611
4612
  UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
4613
+ DELETE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete/${recordId}`,
4612
4614
  DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
4613
4615
  UPSERT: `${DATAFABRIC_BASE}/api/Entity`,
4614
4616
  DELETE: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
@@ -5450,7 +5452,7 @@ function normalizeBaseUrl(url) {
5450
5452
  // Connection string placeholder that will be replaced during build
5451
5453
  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";
5452
5454
  // SDK Version placeholder
5453
- const SDK_VERSION = "1.3.3";
5455
+ const SDK_VERSION = "1.3.5";
5454
5456
  const VERSION = "Version";
5455
5457
  const SERVICE = "Service";
5456
5458
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -6285,6 +6287,8 @@ class ErrorFactory {
6285
6287
 
6286
6288
  const FOLDER_KEY = 'X-UIPATH-FolderKey';
6287
6289
  const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
6290
+ const TRACEPARENT = 'traceparent';
6291
+ const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
6288
6292
  /**
6289
6293
  * Content type constants for HTTP requests/responses
6290
6294
  */
@@ -6338,8 +6342,13 @@ class ApiClient {
6338
6342
  if (isFormData) {
6339
6343
  delete defaultHeaders['Content-Type'];
6340
6344
  }
6345
+ const traceId = crypto.randomUUID().replace(/-/g, '');
6346
+ const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
6347
+ const traceparentValue = `00-${traceId}-${spanId}-01`;
6341
6348
  const headers = {
6342
6349
  ...defaultHeaders,
6350
+ [TRACEPARENT]: traceparentValue,
6351
+ [UIPATH_TRACEPARENT_ID]: traceparentValue,
6343
6352
  ...options.headers
6344
6353
  };
6345
6354
  // Convert params to URLSearchParams
@@ -7643,6 +7652,13 @@ function createEntityMethods(entityData, service) {
7643
7652
  throw new Error('Entity ID is undefined');
7644
7653
  return service.deleteRecordsById(entityData.id, recordIds, options);
7645
7654
  },
7655
+ async deleteRecord(recordId) {
7656
+ if (!entityData.id)
7657
+ throw new Error('Entity ID is undefined');
7658
+ if (!recordId)
7659
+ throw new Error('Record ID is undefined');
7660
+ return service.deleteRecordById(entityData.id, recordId);
7661
+ },
7646
7662
  async getAllRecords(options) {
7647
7663
  if (!entityData.id)
7648
7664
  throw new Error('Entity ID is undefined');
@@ -7845,6 +7861,20 @@ function createParams(paramsObj = {}) {
7845
7861
  return params;
7846
7862
  }
7847
7863
 
7864
+ /**
7865
+ * Names of the per-field SQL constraint properties (i.e. the contents of `sqlType`
7866
+ * excluding its `name`). Used internally to validate user-supplied constraints
7867
+ * against the set of constraints that each `EntityFieldDataType` accepts.
7868
+ *
7869
+ * Enum values match the corresponding property names on `EntityCreateFieldOptions`.
7870
+ */
7871
+ var EntityFieldConstraint;
7872
+ (function (EntityFieldConstraint) {
7873
+ EntityFieldConstraint["LengthLimit"] = "lengthLimit";
7874
+ EntityFieldConstraint["MaxValue"] = "maxValue";
7875
+ EntityFieldConstraint["MinValue"] = "minValue";
7876
+ EntityFieldConstraint["DecimalPrecision"] = "decimalPrecision";
7877
+ })(EntityFieldConstraint || (EntityFieldConstraint = {}));
7848
7878
  /**
7849
7879
  * Entity field data types (SQL types from API)
7850
7880
  */
@@ -7907,6 +7937,70 @@ const FieldDisplayTypeToDataType = {
7907
7937
  [exports.FieldDisplayType.AutoNumber]: exports.EntityFieldDataType.AUTO_NUMBER,
7908
7938
  [exports.FieldDisplayType.Relationship]: exports.EntityFieldDataType.RELATIONSHIP,
7909
7939
  };
7940
+ /**
7941
+ * Default and fixed sqlType constraint values applied when the user does not provide them.
7942
+ * The API requires these to be present on field creation — without them the field
7943
+ * is stored in an incomplete state, causing "Field type cannot be changed" errors
7944
+ * when the UI later tries to edit advanced options.
7945
+ */
7946
+ const ENTITY_FIELD_CONSTRAINT_DEFAULTS = {
7947
+ STRING_LENGTH_LIMIT: 200,
7948
+ MULTILINE_TEXT_LENGTH_LIMIT: 200,
7949
+ /** Fixed (non-overridable) length limit on DECIMAL payloads*/
7950
+ DECIMAL_LENGTH_LIMIT: 1000,
7951
+ DECIMAL_PRECISION: 2,
7952
+ /** Fixed (non-overridable) length limit for BIT (BOOLEAN) fields */
7953
+ BOOLEAN_LENGTH_LIMIT: 100,
7954
+ /** Fixed (non-overridable) length limit for DATE / DATETIMEOFFSET fields */
7955
+ DATE_LENGTH_LIMIT: 1000,
7956
+ /** Fixed (non-overridable) length limit for UNIQUEIDENTIFIER-backed FILE and RELATIONSHIP fields */
7957
+ UNIQUEIDENTIFIER_LENGTH_LIMIT: 300,
7958
+ /** Fixed (non-overridable) length limit for CHOICE_SET_MULTIPLE fields */
7959
+ CHOICE_SET_MULTIPLE_LENGTH_LIMIT: 4000,
7960
+ NUMERIC_MAX_VALUE: 1000000000000,
7961
+ NUMERIC_MIN_VALUE: -1e12,
7962
+ };
7963
+ /**
7964
+ * Per-field-type spec describing which {@link EntityFieldConstraint}s the user
7965
+ * may supply on create / update, and the inclusive value range for each.
7966
+ *
7967
+ * Source of truth: the platform's `Constants.cs` constraint table. Keys absent
7968
+ * from a type's spec are not user-configurable for that type; passing one
7969
+ * throws a `ValidationError`. Field types absent from this map (BOOLEAN, DATE,
7970
+ * DATETIME, DATETIME_WITH_TZ, FILE, RELATIONSHIP, UUID, CHOICE_SET_SINGLE,
7971
+ * CHOICE_SET_MULTIPLE, AUTO_NUMBER) accept no user-supplied constraints.
7972
+ */
7973
+ const ENTITY_FIELD_CONSTRAINT_SPEC = {
7974
+ [exports.EntityFieldDataType.STRING]: {
7975
+ [EntityFieldConstraint.LengthLimit]: { min: 1, max: 4000 },
7976
+ },
7977
+ [exports.EntityFieldDataType.MULTILINE_TEXT]: {
7978
+ [EntityFieldConstraint.LengthLimit]: { min: 1, max: 10000 },
7979
+ },
7980
+ [exports.EntityFieldDataType.INTEGER]: {
7981
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
7982
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
7983
+ },
7984
+ [exports.EntityFieldDataType.BIG_INTEGER]: {
7985
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
7986
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
7987
+ },
7988
+ [exports.EntityFieldDataType.DECIMAL]: {
7989
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
7990
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
7991
+ [EntityFieldConstraint.DecimalPrecision]: { min: 0, max: 10 },
7992
+ },
7993
+ [exports.EntityFieldDataType.FLOAT]: {
7994
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
7995
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
7996
+ [EntityFieldConstraint.DecimalPrecision]: { min: 0, max: 10 },
7997
+ },
7998
+ [exports.EntityFieldDataType.DOUBLE]: {
7999
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
8000
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
8001
+ [EntityFieldConstraint.DecimalPrecision]: { min: 0, max: 10 },
8002
+ },
8003
+ };
7910
8004
  /**
7911
8005
  * Maps SQL field types to friendly display names
7912
8006
  */
@@ -8195,6 +8289,8 @@ class EntityService extends BaseService {
8195
8289
  /**
8196
8290
  * Deletes data from an entity by entity ID
8197
8291
  *
8292
+ * Note: Records deleted using deleteRecordsById will not trigger Data Fabric trigger events. Use {@link deleteRecordById} if you need trigger events to fire for the deleted record.
8293
+ *
8198
8294
  * @param entityId - UUID of the entity
8199
8295
  * @param recordIds - Array of record UUIDs to delete
8200
8296
  * @param options - Delete options
@@ -8222,6 +8318,27 @@ class EntityService extends BaseService {
8222
8318
  });
8223
8319
  return response.data;
8224
8320
  }
8321
+ /**
8322
+ * Deletes a single record from an entity by entity ID and record ID
8323
+ *
8324
+ * Note: Data Fabric supports trigger events only on individual deletes, not on deleting multiple records.
8325
+ * Use this method if you need trigger events to fire for the deleted record.
8326
+ *
8327
+ * @param entityId - UUID of the entity
8328
+ * @param recordId - UUID of the record to delete
8329
+ * @returns Promise resolving to void on success
8330
+ * @example
8331
+ * ```typescript
8332
+ * import { Entities } from '@uipath/uipath-typescript/entities';
8333
+ *
8334
+ * const entities = new Entities(sdk);
8335
+ *
8336
+ * await entities.deleteRecordById("<entityId>", "<recordId>");
8337
+ * ```
8338
+ */
8339
+ async deleteRecordById(entityId, recordId) {
8340
+ await this.delete(DATA_FABRIC_ENDPOINTS.ENTITY.DELETE_RECORD_BY_ID(entityId, recordId));
8341
+ }
8225
8342
  /**
8226
8343
  * Gets all entities in the system
8227
8344
  *
@@ -8483,6 +8600,13 @@ class EntityService extends BaseService {
8483
8600
  * { fieldName: "product_name", type: EntityFieldDataType.STRING, isRequired: true, isUnique: true },
8484
8601
  * { fieldName: "price", type: EntityFieldDataType.INTEGER, defaultValue: "0" },
8485
8602
  * ], { displayName: "Product Catalog", description: "Our product catalog", isRbacEnabled: true });
8603
+ *
8604
+ * // With advanced sqlType constraints (lengthLimit, decimalPrecision, maxValue, minValue) and defaultValue
8605
+ * const ordersId = await entities.create("orders", [
8606
+ * { fieldName: "product_name", type: EntityFieldDataType.STRING, isRequired: true, isUnique: true, lengthLimit: 500 },
8607
+ * { fieldName: "price", type: EntityFieldDataType.DECIMAL, decimalPrecision: 4, maxValue: 999999, minValue: 0 },
8608
+ * { fieldName: "quantity", type: EntityFieldDataType.INTEGER, maxValue: 10000, minValue: 1, defaultValue: "0" },
8609
+ * ]);
8486
8610
  * ```
8487
8611
  * @internal
8488
8612
  */
@@ -8556,6 +8680,17 @@ class EntityService extends BaseService {
8556
8680
  * updateFields: [{ id: "<fieldId>", displayName: "Unit Price", isRequired: true }],
8557
8681
  * displayName: "Price Catalog",
8558
8682
  * });
8683
+ *
8684
+ * // Add a STRING/DECIMAL field with explicit advanced sqlType constraints and defaultValue
8685
+ * await entities.updateById("<entityId>", {
8686
+ * addFields: [
8687
+ * { fieldName: "summary", type: EntityFieldDataType.STRING, lengthLimit: 500, defaultValue: "summary" },
8688
+ * { fieldName: "amount", type: EntityFieldDataType.DECIMAL, decimalPrecision: 4, maxValue: 999999, minValue: 0 },
8689
+ * ],
8690
+ * updateFields: [
8691
+ * { id: "<fieldId>", lengthLimit: 1000 },
8692
+ * ],
8693
+ * });
8559
8694
  * ```
8560
8695
  * @internal
8561
8696
  */
@@ -8599,6 +8734,21 @@ class EntityService extends BaseService {
8599
8734
  const update = updateMap.get(f.id ?? '');
8600
8735
  if (!update)
8601
8736
  return f;
8737
+ const constraintUpdate = {
8738
+ ...(update.lengthLimit !== undefined && { lengthLimit: update.lengthLimit }),
8739
+ ...(update.maxValue !== undefined && { maxValue: update.maxValue }),
8740
+ ...(update.minValue !== undefined && { minValue: update.minValue }),
8741
+ ...(update.decimalPrecision !== undefined && { decimalPrecision: update.decimalPrecision }),
8742
+ };
8743
+ const hasConstraintUpdate = Object.keys(constraintUpdate).length > 0;
8744
+ if (hasConstraintUpdate) {
8745
+ if (!f.sqlType) {
8746
+ throw new ValidationError({
8747
+ message: `Cannot update constraints on field '${f.name}' (id: ${f.id}) — the field is missing sqlType metadata in the entity definition.`,
8748
+ });
8749
+ }
8750
+ this.validateFieldConstraints(this.resolveFieldDataType(f), update, f.name);
8751
+ }
8602
8752
  return {
8603
8753
  ...f,
8604
8754
  ...(update.displayName !== undefined && { displayName: update.displayName }),
@@ -8608,6 +8758,7 @@ class EntityService extends BaseService {
8608
8758
  ...(update.isRbacEnabled !== undefined && { isRbacEnabled: update.isRbacEnabled }),
8609
8759
  ...(update.isEncrypted !== undefined && { isEncrypted: update.isEncrypted }),
8610
8760
  ...(update.defaultValue !== undefined && { defaultValue: update.defaultValue }),
8761
+ ...(hasConstraintUpdate && f.sqlType && { sqlType: { ...f.sqlType, ...constraintUpdate } }),
8611
8762
  };
8612
8763
  });
8613
8764
  }
@@ -8657,24 +8808,27 @@ class EntityService extends BaseService {
8657
8808
  let transformedField = transformData(field, EntityMap);
8658
8809
  // Map field type: prefer fieldDisplayType for types that share SQL types (File, ChoiceSet, AutoNumber)
8659
8810
  if (transformedField.fieldDataType?.name) {
8660
- const displayTypeMapped = transformedField.fieldDisplayType
8661
- ? FieldDisplayTypeToDataType[transformedField.fieldDisplayType]
8662
- : undefined;
8663
- if (displayTypeMapped) {
8664
- transformedField.fieldDataType.name = displayTypeMapped;
8665
- }
8666
- else {
8667
- const rawSqlTypeName = field.sqlType?.name;
8668
- const mapped = rawSqlTypeName ? EntityFieldTypeMap[rawSqlTypeName] : undefined;
8669
- if (mapped) {
8670
- transformedField.fieldDataType.name = mapped;
8671
- }
8811
+ const mapped = this.tryResolveFieldDataType(transformedField.fieldDisplayType, field.sqlType?.name);
8812
+ if (mapped) {
8813
+ transformedField.fieldDataType.name = mapped;
8672
8814
  }
8673
8815
  }
8674
8816
  this.transformNestedReferences(transformedField);
8675
8817
  return transformedField;
8676
8818
  });
8677
8819
  }
8820
+ /**
8821
+ * Resolves an {@link EntityFieldDataType} from a field's `fieldDisplayType` and
8822
+ * raw SQL type name. Prefers `fieldDisplayType` to disambiguate types that
8823
+ * share a SQL type (FILE, CHOICE_SET_*, AUTO_NUMBER, RELATIONSHIP); falls back
8824
+ * to the SQL-type-name mapping. Returns `undefined` if neither resolves.
8825
+ */
8826
+ tryResolveFieldDataType(fieldDisplayType, sqlTypeName) {
8827
+ const displayMapped = fieldDisplayType ? FieldDisplayTypeToDataType[fieldDisplayType] : undefined;
8828
+ if (displayMapped)
8829
+ return displayMapped;
8830
+ return sqlTypeName ? EntityFieldTypeMap[sqlTypeName] : undefined;
8831
+ }
8678
8832
  /**
8679
8833
  * Transforms nested reference objects in field metadata
8680
8834
  */
@@ -8715,11 +8869,16 @@ class EntityService extends BaseService {
8715
8869
  /** Converts a user-facing EntityCreateFieldOptions to the raw API field payload */
8716
8870
  buildSchemaFieldPayload(field) {
8717
8871
  this.validateName(field.fieldName, 'field');
8718
- const mapping = EntitySchemaFieldTypeMap[field.type ?? exports.EntityFieldDataType.STRING];
8872
+ const fieldType = field.type ?? exports.EntityFieldDataType.STRING;
8873
+ this.validateFieldConstraints(fieldType, field, field.fieldName);
8874
+ const mapping = EntitySchemaFieldTypeMap[fieldType];
8719
8875
  return {
8720
8876
  name: field.fieldName,
8721
8877
  displayName: field.displayName ?? field.fieldName,
8722
- sqlType: { name: mapping.sqlTypeName },
8878
+ sqlType: {
8879
+ name: mapping.sqlTypeName,
8880
+ ...this.buildSqlTypeConstraints(fieldType, field),
8881
+ },
8723
8882
  fieldDisplayType: mapping.fieldDisplayType,
8724
8883
  description: field.description ?? '',
8725
8884
  isRequired: field.isRequired ?? false,
@@ -8732,6 +8891,107 @@ class EntityService extends BaseService {
8732
8891
  ...(field.referenceFieldName !== undefined && { referenceFieldName: field.referenceFieldName }),
8733
8892
  };
8734
8893
  }
8894
+ /**
8895
+ * Derives the user-facing {@link EntityFieldDataType} for a field on the raw
8896
+ * API response. Throws if the field's `fieldDisplayType` and `sqlType.name`
8897
+ * are both unmappable.
8898
+ */
8899
+ resolveFieldDataType(f) {
8900
+ const mapped = this.tryResolveFieldDataType(f.fieldDisplayType, f.sqlType?.name);
8901
+ if (!mapped) {
8902
+ throw new ValidationError({
8903
+ message: `Cannot determine field type for '${f.name}' (id: ${f.id}) — sqlType '${f.sqlType?.name ?? '(missing)'}' and fieldDisplayType '${f.fieldDisplayType ?? '(missing)'}' are both unrecognized.`,
8904
+ });
8905
+ }
8906
+ return mapped;
8907
+ }
8908
+ /**
8909
+ * Validates that the user-supplied constraint properties on a field are
8910
+ * supported by the field's data type. Throws a `ValidationError` listing
8911
+ * any unsupported properties.
8912
+ */
8913
+ validateFieldConstraints(type, field, fieldName) {
8914
+ const spec = ENTITY_FIELD_CONSTRAINT_SPEC[type] ?? {};
8915
+ const supported = Object.keys(spec);
8916
+ const provided = Object.values(EntityFieldConstraint).filter(name => field[name] !== undefined);
8917
+ const unsupported = provided.filter(p => !(p in spec));
8918
+ if (unsupported.length > 0) {
8919
+ const allowedDesc = supported.length > 0 ? supported.join(', ') : 'none';
8920
+ throw new ValidationError({
8921
+ message: `Field '${fieldName}' of type ${type} does not accept ${unsupported.join(', ')}. Allowed constraints for this type: ${allowedDesc}.`,
8922
+ });
8923
+ }
8924
+ // Range check: each user-supplied constraint must be within its allowed bounds.
8925
+ for (const name of provided) {
8926
+ const range = spec[name];
8927
+ const value = field[name];
8928
+ if (range && value !== undefined && (value < range.min || value > range.max)) {
8929
+ throw new ValidationError({
8930
+ message: `Field '${fieldName}' of type ${type} has ${name} ${value} out of range [${range.min}, ${range.max}].`,
8931
+ });
8932
+ }
8933
+ }
8934
+ // Cross-field check: when both bounds are user-supplied in the same call,
8935
+ // minValue must be strictly less than maxValue.
8936
+ if (field.minValue !== undefined && field.maxValue !== undefined && field.minValue >= field.maxValue) {
8937
+ throw new ValidationError({
8938
+ message: `Field '${fieldName}' of type ${type} has minValue ${field.minValue} >= maxValue ${field.maxValue}. minValue must be strictly less than maxValue.`,
8939
+ });
8940
+ }
8941
+ }
8942
+ /**
8943
+ * Returns the sqlType constraint fields for a given field type.
8944
+ *
8945
+ * The API requires specific constraint properties to be set per SQL type;
8946
+ * without them the field is stored in an incomplete state, causing
8947
+ * "Field type cannot be changed" errors when the UI later tries to edit
8948
+ * advanced options. User-supplied values from `EntityCreateFieldOptions`
8949
+ * override the defaults where the type accepts overrides.
8950
+ */
8951
+ buildSqlTypeConstraints(type, field) {
8952
+ const defaults = ENTITY_FIELD_CONSTRAINT_DEFAULTS;
8953
+ switch (type) {
8954
+ case exports.EntityFieldDataType.STRING:
8955
+ return { lengthLimit: field.lengthLimit ?? defaults.STRING_LENGTH_LIMIT };
8956
+ case exports.EntityFieldDataType.MULTILINE_TEXT:
8957
+ return { lengthLimit: field.lengthLimit ?? defaults.MULTILINE_TEXT_LENGTH_LIMIT };
8958
+ case exports.EntityFieldDataType.DECIMAL:
8959
+ return {
8960
+ lengthLimit: defaults.DECIMAL_LENGTH_LIMIT,
8961
+ decimalPrecision: field.decimalPrecision ?? defaults.DECIMAL_PRECISION,
8962
+ maxValue: field.maxValue ?? defaults.NUMERIC_MAX_VALUE,
8963
+ minValue: field.minValue ?? defaults.NUMERIC_MIN_VALUE,
8964
+ };
8965
+ case exports.EntityFieldDataType.BOOLEAN:
8966
+ return { lengthLimit: defaults.BOOLEAN_LENGTH_LIMIT };
8967
+ case exports.EntityFieldDataType.DATE:
8968
+ case exports.EntityFieldDataType.DATETIME_WITH_TZ:
8969
+ return { lengthLimit: defaults.DATE_LENGTH_LIMIT };
8970
+ case exports.EntityFieldDataType.INTEGER:
8971
+ case exports.EntityFieldDataType.BIG_INTEGER:
8972
+ return {
8973
+ maxValue: field.maxValue ?? defaults.NUMERIC_MAX_VALUE,
8974
+ minValue: field.minValue ?? defaults.NUMERIC_MIN_VALUE,
8975
+ };
8976
+ case exports.EntityFieldDataType.FLOAT:
8977
+ case exports.EntityFieldDataType.DOUBLE:
8978
+ return {
8979
+ decimalPrecision: field.decimalPrecision ?? defaults.DECIMAL_PRECISION,
8980
+ maxValue: field.maxValue ?? defaults.NUMERIC_MAX_VALUE,
8981
+ minValue: field.minValue ?? defaults.NUMERIC_MIN_VALUE,
8982
+ };
8983
+ case exports.EntityFieldDataType.FILE:
8984
+ case exports.EntityFieldDataType.RELATIONSHIP:
8985
+ // UNIQUEIDENTIFIER fixed lengthLimit (300)
8986
+ return { lengthLimit: defaults.UNIQUEIDENTIFIER_LENGTH_LIMIT };
8987
+ case exports.EntityFieldDataType.CHOICE_SET_MULTIPLE:
8988
+ // CHOICE_SET_MULTIPLE fixed lengthLimit (4000)
8989
+ return { lengthLimit: defaults.CHOICE_SET_MULTIPLE_LENGTH_LIMIT };
8990
+ default:
8991
+ // UUID, CHOICE_SET_SINGLE, AUTO_NUMBER, DATETIME — (sqlType: { name })
8992
+ return {};
8993
+ }
8994
+ }
8735
8995
  validateName(name, context) {
8736
8996
  if (name.length < 3 || name.length > 100 || !/^[a-zA-Z]\w*$/.test(name)) {
8737
8997
  const suggestion = name.replace(/\W/g, '').replace(/^[0-9_]+/, '');
@@ -8774,6 +9034,9 @@ __decorate([
8774
9034
  __decorate([
8775
9035
  track('Entities.DeleteRecordsById')
8776
9036
  ], EntityService.prototype, "deleteRecordsById", null);
9037
+ __decorate([
9038
+ track('Entities.DeleteRecordById')
9039
+ ], EntityService.prototype, "deleteRecordById", null);
8777
9040
  __decorate([
8778
9041
  track('Entities.GetAll')
8779
9042
  ], EntityService.prototype, "getAll", null);
@@ -11398,6 +11661,13 @@ function createJobMethods(jobData, service) {
11398
11661
  throw new Error('Job folderId is undefined');
11399
11662
  return service.resume(jobData.key, jobData.folderId, options);
11400
11663
  },
11664
+ async restart() {
11665
+ if (!jobData.key)
11666
+ throw new Error('Job key is undefined');
11667
+ if (!jobData.folderId)
11668
+ throw new Error('Job folderId is undefined');
11669
+ return service.restart(jobData.key, jobData.folderId);
11670
+ },
11401
11671
  };
11402
11672
  }
11403
11673
  /**
@@ -11897,6 +12167,41 @@ class JobService extends FolderScopedService {
11897
12167
  }
11898
12168
  await this.post(JOB_ENDPOINTS.RESUME, body, { headers });
11899
12169
  }
12170
+ /**
12171
+ * Restarts a job in a final state (Successful, Faulted, or Stopped).
12172
+ *
12173
+ * Creates a **new** job execution from a previously successful, faulted, or stopped job.
12174
+ * The new job has its own unique `key`, starts in `Pending` state, and uses
12175
+ * the same process and input arguments as the original job.
12176
+ *
12177
+ * To monitor the new job's progress, poll with {@link getById}
12178
+ * using the returned job's key until the state reaches a final value.
12179
+ *
12180
+ * @param jobKey - The unique key (GUID) of the job to restart
12181
+ * @param folderId - The folder ID where the job resides
12182
+ * @returns Promise resolving to the new {@link JobGetResponse} with full job details
12183
+ *
12184
+ * @example
12185
+ * ```typescript
12186
+ * // Restart a faulted job
12187
+ * const newJob = await jobs.restart(<jobKey>, <folderId>);
12188
+ * console.log(newJob.state); // 'Pending'
12189
+ * console.log(newJob.key); // new job key (different from original)
12190
+ * ```
12191
+ */
12192
+ async restart(jobKey, folderId) {
12193
+ if (!jobKey) {
12194
+ throw new ValidationError({ message: 'jobKey is required for restart' });
12195
+ }
12196
+ if (!folderId) {
12197
+ throw new ValidationError({ message: 'folderId is required for restart' });
12198
+ }
12199
+ const [jobId] = await this.resolveJobKeys([jobKey], folderId);
12200
+ const headers = createHeaders({ [FOLDER_ID]: folderId });
12201
+ const response = await this.post(JOB_ENDPOINTS.RESTART, { jobId }, { headers });
12202
+ const rawJob = transformData(pascalToCamelCaseKeys(response.data), JobMap);
12203
+ return createJobWithMethods(rawJob, this);
12204
+ }
11900
12205
  /**
11901
12206
  * Downloads the output file content via the Attachments API.
11902
12207
  * 1. Fetches blob access info from the attachment using AttachmentService
@@ -11984,6 +12289,9 @@ __decorate([
11984
12289
  __decorate([
11985
12290
  track('Jobs.Resume')
11986
12291
  ], JobService.prototype, "resume", null);
12292
+ __decorate([
12293
+ track('Jobs.Restart')
12294
+ ], JobService.prototype, "restart", null);
11987
12295
 
11988
12296
  /**
11989
12297
  * Enum for job sub-state
@@ -12692,6 +13000,260 @@ exports.FeedbackStatus = void 0;
12692
13000
  FeedbackStatus[FeedbackStatus["Dismissed"] = 2] = "Dismissed";
12693
13001
  })(exports.FeedbackStatus || (exports.FeedbackStatus = {}));
12694
13002
 
13003
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13004
+ var DocumentActionPriority;
13005
+ (function (DocumentActionPriority) {
13006
+ DocumentActionPriority["Low"] = "Low";
13007
+ DocumentActionPriority["Medium"] = "Medium";
13008
+ DocumentActionPriority["High"] = "High";
13009
+ DocumentActionPriority["Critical"] = "Critical";
13010
+ })(DocumentActionPriority || (DocumentActionPriority = {}));
13011
+ var DocumentActionStatus;
13012
+ (function (DocumentActionStatus) {
13013
+ DocumentActionStatus["Unassigned"] = "Unassigned";
13014
+ DocumentActionStatus["Pending"] = "Pending";
13015
+ DocumentActionStatus["Completed"] = "Completed";
13016
+ })(DocumentActionStatus || (DocumentActionStatus = {}));
13017
+ var DocumentActionType;
13018
+ (function (DocumentActionType) {
13019
+ DocumentActionType["Validation"] = "Validation";
13020
+ DocumentActionType["Classification"] = "Classification";
13021
+ })(DocumentActionType || (DocumentActionType = {}));
13022
+
13023
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13024
+ var ProjectProperties;
13025
+ (function (ProjectProperties) {
13026
+ ProjectProperties["IsPredefined"] = "IsPredefined";
13027
+ ProjectProperties["SupportsTags"] = "SupportsTags";
13028
+ ProjectProperties["SupportsVersions"] = "SupportsVersions";
13029
+ ProjectProperties["IsSplittingEnabled"] = "IsSplittingEnabled";
13030
+ })(ProjectProperties || (ProjectProperties = {}));
13031
+ var ProjectType;
13032
+ (function (ProjectType) {
13033
+ ProjectType["Classic"] = "Classic";
13034
+ ProjectType["Modern"] = "Modern";
13035
+ ProjectType["IXP"] = "IXP";
13036
+ ProjectType["Unknown"] = "Unknown";
13037
+ })(ProjectType || (ProjectType = {}));
13038
+ var ResourceStatus;
13039
+ (function (ResourceStatus) {
13040
+ ResourceStatus["Unknown"] = "Unknown";
13041
+ ResourceStatus["NotStarted"] = "NotStarted";
13042
+ ResourceStatus["ExportInProgress"] = "ExportInProgress";
13043
+ ResourceStatus["ExportCompleted"] = "ExportCompleted";
13044
+ ResourceStatus["InProgress"] = "InProgress";
13045
+ ResourceStatus["Suspended"] = "Suspended";
13046
+ ResourceStatus["Resuming"] = "Resuming";
13047
+ ResourceStatus["Available"] = "Available";
13048
+ ResourceStatus["Error"] = "Error";
13049
+ ResourceStatus["Deleting"] = "Deleting";
13050
+ })(ResourceStatus || (ResourceStatus = {}));
13051
+ var ResourceType;
13052
+ (function (ResourceType) {
13053
+ ResourceType["Specialized"] = "Specialized";
13054
+ ResourceType["Generative"] = "Generative";
13055
+ ResourceType["Custom"] = "Custom";
13056
+ ResourceType["Unknown"] = "Unknown";
13057
+ })(ResourceType || (ResourceType = {}));
13058
+
13059
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13060
+ var MarkupType;
13061
+ (function (MarkupType) {
13062
+ MarkupType["Unknown"] = "Unknown";
13063
+ MarkupType["Circled"] = "Circled";
13064
+ MarkupType["Underlined"] = "Underlined";
13065
+ MarkupType["Strikethrough"] = "Strikethrough";
13066
+ })(MarkupType || (MarkupType = {}));
13067
+ var ProcessingSource;
13068
+ (function (ProcessingSource) {
13069
+ ProcessingSource["Unknown"] = "Unknown";
13070
+ ProcessingSource["Ocr"] = "Ocr";
13071
+ ProcessingSource["Pdf"] = "Pdf";
13072
+ ProcessingSource["PlainText"] = "PlainText";
13073
+ ProcessingSource["PdfAndOcr"] = "PdfAndOcr";
13074
+ })(ProcessingSource || (ProcessingSource = {}));
13075
+ var Rotation;
13076
+ (function (Rotation) {
13077
+ Rotation["None"] = "None";
13078
+ Rotation["Rotated90"] = "Rotated90";
13079
+ Rotation["Rotated180"] = "Rotated180";
13080
+ Rotation["Rotated270"] = "Rotated270";
13081
+ Rotation["Other"] = "Other";
13082
+ })(Rotation || (Rotation = {}));
13083
+ var SectionType;
13084
+ (function (SectionType) {
13085
+ SectionType["Vertical"] = "Vertical";
13086
+ SectionType["Paragraph"] = "Paragraph";
13087
+ SectionType["Header"] = "Header";
13088
+ SectionType["Footer"] = "Footer";
13089
+ SectionType["Table"] = "Table";
13090
+ })(SectionType || (SectionType = {}));
13091
+ var TextType;
13092
+ (function (TextType) {
13093
+ TextType["Unknown"] = "Unknown";
13094
+ TextType["Text"] = "Text";
13095
+ TextType["Checkbox"] = "Checkbox";
13096
+ TextType["Handwriting"] = "Handwriting";
13097
+ TextType["Barcode"] = "Barcode";
13098
+ TextType["QRcode"] = "QRcode";
13099
+ TextType["Stamp"] = "Stamp";
13100
+ TextType["Logo"] = "Logo";
13101
+ TextType["Circle"] = "Circle";
13102
+ TextType["Underline"] = "Underline";
13103
+ TextType["Cut"] = "Cut";
13104
+ })(TextType || (TextType = {}));
13105
+ var WordGroupType;
13106
+ (function (WordGroupType) {
13107
+ WordGroupType["Sentence"] = "Sentence";
13108
+ WordGroupType["TableCell"] = "TableCell";
13109
+ WordGroupType["TableRowEnd"] = "TableRowEnd";
13110
+ WordGroupType["Heading"] = "Heading";
13111
+ WordGroupType["Other"] = "Other";
13112
+ })(WordGroupType || (WordGroupType = {}));
13113
+
13114
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13115
+ var ModelKind;
13116
+ (function (ModelKind) {
13117
+ ModelKind["Classifier"] = "Classifier";
13118
+ ModelKind["Extractor"] = "Extractor";
13119
+ })(ModelKind || (ModelKind = {}));
13120
+ var ModelType;
13121
+ (function (ModelType) {
13122
+ ModelType["IXP"] = "IXP";
13123
+ ModelType["Modern"] = "Modern";
13124
+ ModelType["Predefined"] = "Predefined";
13125
+ })(ModelType || (ModelType = {}));
13126
+
13127
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13128
+ var ClassifierDocumentTypeType;
13129
+ (function (ClassifierDocumentTypeType) {
13130
+ ClassifierDocumentTypeType["FormsAi"] = "FormsAi";
13131
+ ClassifierDocumentTypeType["SemiStructuredAi"] = "SemiStructuredAi";
13132
+ ClassifierDocumentTypeType["Helix"] = "Helix";
13133
+ ClassifierDocumentTypeType["Unknown"] = "Unknown";
13134
+ })(ClassifierDocumentTypeType || (ClassifierDocumentTypeType = {}));
13135
+ var CreateTaskPriority;
13136
+ (function (CreateTaskPriority) {
13137
+ CreateTaskPriority["Low"] = "Low";
13138
+ CreateTaskPriority["Medium"] = "Medium";
13139
+ CreateTaskPriority["High"] = "High";
13140
+ CreateTaskPriority["Critical"] = "Critical";
13141
+ })(CreateTaskPriority || (CreateTaskPriority = {}));
13142
+ var GptFieldType;
13143
+ (function (GptFieldType) {
13144
+ GptFieldType["Address"] = "Address";
13145
+ GptFieldType["Boolean"] = "Boolean";
13146
+ GptFieldType["Date"] = "Date";
13147
+ GptFieldType["Name"] = "Name";
13148
+ GptFieldType["Number"] = "Number";
13149
+ GptFieldType["Text"] = "Text";
13150
+ })(GptFieldType || (GptFieldType = {}));
13151
+ var ValidationDisplayMode;
13152
+ (function (ValidationDisplayMode) {
13153
+ ValidationDisplayMode["Classic"] = "Classic";
13154
+ ValidationDisplayMode["Compact"] = "Compact";
13155
+ })(ValidationDisplayMode || (ValidationDisplayMode = {}));
13156
+
13157
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13158
+ var ResultsDataSource;
13159
+ (function (ResultsDataSource) {
13160
+ ResultsDataSource["Automatic"] = "Automatic";
13161
+ ResultsDataSource["Manual"] = "Manual";
13162
+ ResultsDataSource["ManuallyChanged"] = "ManuallyChanged";
13163
+ ResultsDataSource["Defaulted"] = "Defaulted";
13164
+ ResultsDataSource["External"] = "External";
13165
+ })(ResultsDataSource || (ResultsDataSource = {}));
13166
+
13167
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13168
+ var ComparisonOperator;
13169
+ (function (ComparisonOperator) {
13170
+ ComparisonOperator["Equals"] = "Equals";
13171
+ ComparisonOperator["NotEquals"] = "NotEquals";
13172
+ ComparisonOperator["Greater"] = "Greater";
13173
+ ComparisonOperator["Less"] = "Less";
13174
+ ComparisonOperator["GreaterOrEqual"] = "GreaterOrEqual";
13175
+ ComparisonOperator["LessOrEqual"] = "LessOrEqual";
13176
+ })(ComparisonOperator || (ComparisonOperator = {}));
13177
+ var Criticality;
13178
+ (function (Criticality) {
13179
+ Criticality["Must"] = "Must";
13180
+ Criticality["Should"] = "Should";
13181
+ })(Criticality || (Criticality = {}));
13182
+ var FieldType;
13183
+ (function (FieldType) {
13184
+ FieldType["Text"] = "Text";
13185
+ FieldType["Number"] = "Number";
13186
+ FieldType["Date"] = "Date";
13187
+ FieldType["Name"] = "Name";
13188
+ FieldType["Address"] = "Address";
13189
+ FieldType["Keyword"] = "Keyword";
13190
+ FieldType["Set"] = "Set";
13191
+ FieldType["Boolean"] = "Boolean";
13192
+ FieldType["Table"] = "Table";
13193
+ FieldType["Internal"] = "Internal";
13194
+ FieldType["FieldGroup"] = "FieldGroup";
13195
+ FieldType["MonetaryQuantity"] = "MonetaryQuantity";
13196
+ })(FieldType || (FieldType = {}));
13197
+ var LogicalOperator;
13198
+ (function (LogicalOperator) {
13199
+ LogicalOperator["AND"] = "AND";
13200
+ LogicalOperator["OR"] = "OR";
13201
+ })(LogicalOperator || (LogicalOperator = {}));
13202
+ var RuleType;
13203
+ (function (RuleType) {
13204
+ RuleType["Mandatory"] = "Mandatory";
13205
+ RuleType["PossibleValues"] = "PossibleValues";
13206
+ RuleType["Regex"] = "Regex";
13207
+ RuleType["StartsWith"] = "StartsWith";
13208
+ RuleType["EndsWith"] = "EndsWith";
13209
+ RuleType["FixedLength"] = "FixedLength";
13210
+ RuleType["IsNumeric"] = "IsNumeric";
13211
+ RuleType["IsDate"] = "IsDate";
13212
+ RuleType["IsEmail"] = "IsEmail";
13213
+ RuleType["Contains"] = "Contains";
13214
+ RuleType["Expression"] = "Expression";
13215
+ RuleType["TableExpression"] = "TableExpression";
13216
+ RuleType["IsEmpty"] = "IsEmpty";
13217
+ })(RuleType || (RuleType = {}));
13218
+
13219
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13220
+ var ActionStatus;
13221
+ (function (ActionStatus) {
13222
+ ActionStatus["Unassigned"] = "Unassigned";
13223
+ ActionStatus["Pending"] = "Pending";
13224
+ ActionStatus["Completed"] = "Completed";
13225
+ })(ActionStatus || (ActionStatus = {}));
13226
+
13227
+ var index = /*#__PURE__*/Object.freeze({
13228
+ __proto__: null,
13229
+ get ActionStatus () { return ActionStatus; },
13230
+ get ClassifierDocumentTypeType () { return ClassifierDocumentTypeType; },
13231
+ get ComparisonOperator () { return ComparisonOperator; },
13232
+ get CreateTaskPriority () { return CreateTaskPriority; },
13233
+ get Criticality () { return Criticality; },
13234
+ get DocumentActionPriority () { return DocumentActionPriority; },
13235
+ get DocumentActionStatus () { return DocumentActionStatus; },
13236
+ get DocumentActionType () { return DocumentActionType; },
13237
+ get FieldType () { return FieldType; },
13238
+ get GptFieldType () { return GptFieldType; },
13239
+ get LogicalOperator () { return LogicalOperator; },
13240
+ get MarkupType () { return MarkupType; },
13241
+ get ModelKind () { return ModelKind; },
13242
+ get ModelType () { return ModelType; },
13243
+ get ProcessingSource () { return ProcessingSource; },
13244
+ get ProjectProperties () { return ProjectProperties; },
13245
+ get ProjectType () { return ProjectType; },
13246
+ get ResourceStatus () { return ResourceStatus; },
13247
+ get ResourceType () { return ResourceType; },
13248
+ get ResultsDataSource () { return ResultsDataSource; },
13249
+ get Rotation () { return Rotation; },
13250
+ get RuleType () { return RuleType; },
13251
+ get SectionType () { return SectionType; },
13252
+ get TextType () { return TextType; },
13253
+ get ValidationDisplayMode () { return ValidationDisplayMode; },
13254
+ get WordGroupType () { return WordGroupType; }
13255
+ });
13256
+
12695
13257
  /**
12696
13258
  * Asset resolution utilities for UiPath Coded Apps
12697
13259
  *
@@ -12782,6 +13344,7 @@ exports.ConversationMap = ConversationMap;
12782
13344
  exports.DEFAULT_ITEMS_FIELD = DEFAULT_ITEMS_FIELD;
12783
13345
  exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE;
12784
13346
  exports.DEFAULT_TOTAL_COUNT_FIELD = DEFAULT_TOTAL_COUNT_FIELD;
13347
+ exports.DuFramework = index;
12785
13348
  exports.ErrorType = ErrorType;
12786
13349
  exports.ExchangeMap = ExchangeMap;
12787
13350
  exports.HttpStatus = HttpStatus;