@uipath/uipath-typescript 1.3.4 → 1.3.6

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/README.md +1 -1
  2. package/dist/assets/index.cjs +1 -1
  3. package/dist/assets/index.mjs +1 -1
  4. package/dist/attachments/index.cjs +1 -1
  5. package/dist/attachments/index.mjs +1 -1
  6. package/dist/buckets/index.cjs +1 -1
  7. package/dist/buckets/index.mjs +1 -1
  8. package/dist/cases/index.cjs +1 -1
  9. package/dist/cases/index.mjs +1 -1
  10. package/dist/conversational-agent/index.cjs +1 -1
  11. package/dist/conversational-agent/index.mjs +1 -1
  12. package/dist/core/index.cjs +29 -4
  13. package/dist/core/index.d.ts +11 -1
  14. package/dist/core/index.mjs +29 -4
  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 +236 -15
  19. package/dist/entities/index.d.ts +81 -0
  20. package/dist/entities/index.mjs +236 -15
  21. package/dist/feedback/index.cjs +38 -4
  22. package/dist/feedback/index.d.ts +52 -1
  23. package/dist/feedback/index.mjs +38 -4
  24. package/dist/index.cjs +519 -18
  25. package/dist/index.d.ts +1313 -8
  26. package/dist/index.mjs +521 -21
  27. package/dist/index.umd.js +519 -18
  28. package/dist/jobs/index.cjs +1 -1
  29. package/dist/jobs/index.mjs +1 -1
  30. package/dist/maestro-processes/index.cjs +1 -1
  31. package/dist/maestro-processes/index.mjs +1 -1
  32. package/dist/processes/index.cjs +1 -1
  33. package/dist/processes/index.mjs +1 -1
  34. package/dist/queues/index.cjs +1 -1
  35. package/dist/queues/index.mjs +1 -1
  36. package/dist/tasks/index.cjs +1 -1
  37. package/dist/tasks/index.mjs +1 -1
  38. package/package.json +11 -1
package/dist/index.cjs CHANGED
@@ -5026,6 +5026,7 @@ class TokenManager {
5026
5026
  const GUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
5027
5027
  class AuthService {
5028
5028
  constructor(config, executionContext) {
5029
+ this.skipAcrValues = false;
5029
5030
  // Only use stored OAuth context when completing an active callback (URL has ?code=).
5030
5031
  // If stored context exists but we're NOT in a callback, it's stale from a
5031
5032
  // failed/abandoned flow (e.g. scope mismatch, invalid redirect URI) and must
@@ -5117,6 +5118,14 @@ class AuthService {
5117
5118
  getTokenManager() {
5118
5119
  return this.tokenManager;
5119
5120
  }
5121
+ /**
5122
+ * Enables the UiPath login picker during OAuth sign-in.
5123
+ *
5124
+ * @internal
5125
+ */
5126
+ setMultiLogin() {
5127
+ this.skipAcrValues = true;
5128
+ }
5120
5129
  /**
5121
5130
  * Authenticates the user based on the provided SDK configuration.
5122
5131
  * This method handles OAuth 2.0 authentication flow only.
@@ -5318,7 +5327,10 @@ class AuthService {
5318
5327
  scope: params.scope + ' offline_access',
5319
5328
  state: params.state || this.generateCodeVerifier().slice(0, 16)
5320
5329
  });
5321
- return `${this.config.baseUrl}/${IDENTITY_ENDPOINTS.AUTHORIZE}?${queryParams.toString()}&acr_values=${acrValues}`;
5330
+ const authorizeUrl = `${this.config.baseUrl}/${IDENTITY_ENDPOINTS.AUTHORIZE}?${queryParams.toString()}`;
5331
+ return this.skipAcrValues
5332
+ ? authorizeUrl
5333
+ : `${authorizeUrl}&acr_values=${acrValues}`;
5322
5334
  }
5323
5335
  /**
5324
5336
  * Exchanges the authorization code for an access token and automatically updates the current token
@@ -5452,7 +5464,7 @@ function normalizeBaseUrl(url) {
5452
5464
  // Connection string placeholder that will be replaced during build
5453
5465
  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";
5454
5466
  // SDK Version placeholder
5455
- const SDK_VERSION = "1.3.4";
5467
+ const SDK_VERSION = "1.3.6";
5456
5468
  const VERSION = "Version";
5457
5469
  const SERVICE = "Service";
5458
5470
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -5832,7 +5844,7 @@ function loadFromMetaTags() {
5832
5844
  return hasAnyValue ? config : null;
5833
5845
  }
5834
5846
 
5835
- var _UiPath_instances, _UiPath_config, _UiPath_authService, _UiPath_initialized, _UiPath_partialConfig, _UiPath_initializeWithConfig, _UiPath_loadConfig;
5847
+ var _UiPath_instances, _UiPath_config, _UiPath_authService, _UiPath_initialized, _UiPath_partialConfig, _UiPath_multiLogin, _UiPath_initializeWithConfig, _UiPath_loadConfig;
5836
5848
  /**
5837
5849
  * UiPath - Core SDK class for authentication and configuration management.
5838
5850
  *
@@ -5872,6 +5884,7 @@ let UiPath$1 = class UiPath {
5872
5884
  _UiPath_authService.set(this, void 0);
5873
5885
  _UiPath_initialized.set(this, false);
5874
5886
  _UiPath_partialConfig.set(this, void 0);
5887
+ _UiPath_multiLogin.set(this, false);
5875
5888
  // Load configuration from meta tags
5876
5889
  const configFromMetaTags = loadFromMetaTags();
5877
5890
  // Merge configuration: constructor config overrides meta tags
@@ -5922,6 +5935,15 @@ let UiPath$1 = class UiPath {
5922
5935
  throw new Error(`Failed to initialize UiPath SDK: ${errorMessage}`);
5923
5936
  }
5924
5937
  }
5938
+ /**
5939
+ * Enables the UiPath login picker during OAuth sign-in.
5940
+ *
5941
+ * @internal
5942
+ */
5943
+ setMultiLogin() {
5944
+ __classPrivateFieldSet(this, _UiPath_multiLogin, true, "f");
5945
+ __classPrivateFieldGet(this, _UiPath_authService, "f")?.setMultiLogin();
5946
+ }
5925
5947
  /**
5926
5948
  * Check if the SDK has been initialized
5927
5949
  */
@@ -5993,7 +6015,7 @@ let UiPath$1 = class UiPath {
5993
6015
  __classPrivateFieldGet(this, _UiPath_authService, "f")?.updateToken(tokenInfo);
5994
6016
  }
5995
6017
  };
5996
- _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_initialized = new WeakMap(), _UiPath_partialConfig = new WeakMap(), _UiPath_instances = new WeakSet(), _UiPath_initializeWithConfig = function _UiPath_initializeWithConfig(config) {
6018
+ _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_initialized = new WeakMap(), _UiPath_partialConfig = new WeakMap(), _UiPath_multiLogin = new WeakMap(), _UiPath_instances = new WeakSet(), _UiPath_initializeWithConfig = function _UiPath_initializeWithConfig(config) {
5997
6019
  // Validate and normalize the configuration
5998
6020
  validateConfig(config);
5999
6021
  const hasSecretAuth = hasSecretConfig(config);
@@ -6010,6 +6032,9 @@ _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_ini
6010
6032
  });
6011
6033
  const executionContext = new ExecutionContext();
6012
6034
  __classPrivateFieldSet(this, _UiPath_authService, new AuthService(internalConfig, executionContext), "f");
6035
+ if (__classPrivateFieldGet(this, _UiPath_multiLogin, "f")) {
6036
+ __classPrivateFieldGet(this, _UiPath_authService, "f").setMultiLogin();
6037
+ }
6013
6038
  __classPrivateFieldSet(this, _UiPath_config, internalConfig, "f");
6014
6039
  // Store internals in SDKInternalsRegistry (not visible on instance)
6015
6040
  SDKInternalsRegistry.set(this, {
@@ -7861,6 +7886,20 @@ function createParams(paramsObj = {}) {
7861
7886
  return params;
7862
7887
  }
7863
7888
 
7889
+ /**
7890
+ * Names of the per-field SQL constraint properties (i.e. the contents of `sqlType`
7891
+ * excluding its `name`). Used internally to validate user-supplied constraints
7892
+ * against the set of constraints that each `EntityFieldDataType` accepts.
7893
+ *
7894
+ * Enum values match the corresponding property names on `EntityCreateFieldOptions`.
7895
+ */
7896
+ var EntityFieldConstraint;
7897
+ (function (EntityFieldConstraint) {
7898
+ EntityFieldConstraint["LengthLimit"] = "lengthLimit";
7899
+ EntityFieldConstraint["MaxValue"] = "maxValue";
7900
+ EntityFieldConstraint["MinValue"] = "minValue";
7901
+ EntityFieldConstraint["DecimalPrecision"] = "decimalPrecision";
7902
+ })(EntityFieldConstraint || (EntityFieldConstraint = {}));
7864
7903
  /**
7865
7904
  * Entity field data types (SQL types from API)
7866
7905
  */
@@ -7923,6 +7962,70 @@ const FieldDisplayTypeToDataType = {
7923
7962
  [exports.FieldDisplayType.AutoNumber]: exports.EntityFieldDataType.AUTO_NUMBER,
7924
7963
  [exports.FieldDisplayType.Relationship]: exports.EntityFieldDataType.RELATIONSHIP,
7925
7964
  };
7965
+ /**
7966
+ * Default and fixed sqlType constraint values applied when the user does not provide them.
7967
+ * The API requires these to be present on field creation — without them the field
7968
+ * is stored in an incomplete state, causing "Field type cannot be changed" errors
7969
+ * when the UI later tries to edit advanced options.
7970
+ */
7971
+ const ENTITY_FIELD_CONSTRAINT_DEFAULTS = {
7972
+ STRING_LENGTH_LIMIT: 200,
7973
+ MULTILINE_TEXT_LENGTH_LIMIT: 200,
7974
+ /** Fixed (non-overridable) length limit on DECIMAL payloads*/
7975
+ DECIMAL_LENGTH_LIMIT: 1000,
7976
+ DECIMAL_PRECISION: 2,
7977
+ /** Fixed (non-overridable) length limit for BIT (BOOLEAN) fields */
7978
+ BOOLEAN_LENGTH_LIMIT: 100,
7979
+ /** Fixed (non-overridable) length limit for DATE / DATETIMEOFFSET fields */
7980
+ DATE_LENGTH_LIMIT: 1000,
7981
+ /** Fixed (non-overridable) length limit for UNIQUEIDENTIFIER-backed FILE and RELATIONSHIP fields */
7982
+ UNIQUEIDENTIFIER_LENGTH_LIMIT: 300,
7983
+ /** Fixed (non-overridable) length limit for CHOICE_SET_MULTIPLE fields */
7984
+ CHOICE_SET_MULTIPLE_LENGTH_LIMIT: 4000,
7985
+ NUMERIC_MAX_VALUE: 1000000000000,
7986
+ NUMERIC_MIN_VALUE: -1e12,
7987
+ };
7988
+ /**
7989
+ * Per-field-type spec describing which {@link EntityFieldConstraint}s the user
7990
+ * may supply on create / update, and the inclusive value range for each.
7991
+ *
7992
+ * Source of truth: the platform's `Constants.cs` constraint table. Keys absent
7993
+ * from a type's spec are not user-configurable for that type; passing one
7994
+ * throws a `ValidationError`. Field types absent from this map (BOOLEAN, DATE,
7995
+ * DATETIME, DATETIME_WITH_TZ, FILE, RELATIONSHIP, UUID, CHOICE_SET_SINGLE,
7996
+ * CHOICE_SET_MULTIPLE, AUTO_NUMBER) accept no user-supplied constraints.
7997
+ */
7998
+ const ENTITY_FIELD_CONSTRAINT_SPEC = {
7999
+ [exports.EntityFieldDataType.STRING]: {
8000
+ [EntityFieldConstraint.LengthLimit]: { min: 1, max: 4000 },
8001
+ },
8002
+ [exports.EntityFieldDataType.MULTILINE_TEXT]: {
8003
+ [EntityFieldConstraint.LengthLimit]: { min: 1, max: 10000 },
8004
+ },
8005
+ [exports.EntityFieldDataType.INTEGER]: {
8006
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
8007
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
8008
+ },
8009
+ [exports.EntityFieldDataType.BIG_INTEGER]: {
8010
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
8011
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
8012
+ },
8013
+ [exports.EntityFieldDataType.DECIMAL]: {
8014
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
8015
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
8016
+ [EntityFieldConstraint.DecimalPrecision]: { min: 0, max: 10 },
8017
+ },
8018
+ [exports.EntityFieldDataType.FLOAT]: {
8019
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
8020
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
8021
+ [EntityFieldConstraint.DecimalPrecision]: { min: 0, max: 10 },
8022
+ },
8023
+ [exports.EntityFieldDataType.DOUBLE]: {
8024
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
8025
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
8026
+ [EntityFieldConstraint.DecimalPrecision]: { min: 0, max: 10 },
8027
+ },
8028
+ };
7926
8029
  /**
7927
8030
  * Maps SQL field types to friendly display names
7928
8031
  */
@@ -8522,6 +8625,13 @@ class EntityService extends BaseService {
8522
8625
  * { fieldName: "product_name", type: EntityFieldDataType.STRING, isRequired: true, isUnique: true },
8523
8626
  * { fieldName: "price", type: EntityFieldDataType.INTEGER, defaultValue: "0" },
8524
8627
  * ], { displayName: "Product Catalog", description: "Our product catalog", isRbacEnabled: true });
8628
+ *
8629
+ * // With advanced sqlType constraints (lengthLimit, decimalPrecision, maxValue, minValue) and defaultValue
8630
+ * const ordersId = await entities.create("orders", [
8631
+ * { fieldName: "product_name", type: EntityFieldDataType.STRING, isRequired: true, isUnique: true, lengthLimit: 500 },
8632
+ * { fieldName: "price", type: EntityFieldDataType.DECIMAL, decimalPrecision: 4, maxValue: 999999, minValue: 0 },
8633
+ * { fieldName: "quantity", type: EntityFieldDataType.INTEGER, maxValue: 10000, minValue: 1, defaultValue: "0" },
8634
+ * ]);
8525
8635
  * ```
8526
8636
  * @internal
8527
8637
  */
@@ -8595,6 +8705,17 @@ class EntityService extends BaseService {
8595
8705
  * updateFields: [{ id: "<fieldId>", displayName: "Unit Price", isRequired: true }],
8596
8706
  * displayName: "Price Catalog",
8597
8707
  * });
8708
+ *
8709
+ * // Add a STRING/DECIMAL field with explicit advanced sqlType constraints and defaultValue
8710
+ * await entities.updateById("<entityId>", {
8711
+ * addFields: [
8712
+ * { fieldName: "summary", type: EntityFieldDataType.STRING, lengthLimit: 500, defaultValue: "summary" },
8713
+ * { fieldName: "amount", type: EntityFieldDataType.DECIMAL, decimalPrecision: 4, maxValue: 999999, minValue: 0 },
8714
+ * ],
8715
+ * updateFields: [
8716
+ * { id: "<fieldId>", lengthLimit: 1000 },
8717
+ * ],
8718
+ * });
8598
8719
  * ```
8599
8720
  * @internal
8600
8721
  */
@@ -8638,6 +8759,21 @@ class EntityService extends BaseService {
8638
8759
  const update = updateMap.get(f.id ?? '');
8639
8760
  if (!update)
8640
8761
  return f;
8762
+ const constraintUpdate = {
8763
+ ...(update.lengthLimit !== undefined && { lengthLimit: update.lengthLimit }),
8764
+ ...(update.maxValue !== undefined && { maxValue: update.maxValue }),
8765
+ ...(update.minValue !== undefined && { minValue: update.minValue }),
8766
+ ...(update.decimalPrecision !== undefined && { decimalPrecision: update.decimalPrecision }),
8767
+ };
8768
+ const hasConstraintUpdate = Object.keys(constraintUpdate).length > 0;
8769
+ if (hasConstraintUpdate) {
8770
+ if (!f.sqlType) {
8771
+ throw new ValidationError({
8772
+ message: `Cannot update constraints on field '${f.name}' (id: ${f.id}) — the field is missing sqlType metadata in the entity definition.`,
8773
+ });
8774
+ }
8775
+ this.validateFieldConstraints(this.resolveFieldDataType(f), update, f.name);
8776
+ }
8641
8777
  return {
8642
8778
  ...f,
8643
8779
  ...(update.displayName !== undefined && { displayName: update.displayName }),
@@ -8647,6 +8783,7 @@ class EntityService extends BaseService {
8647
8783
  ...(update.isRbacEnabled !== undefined && { isRbacEnabled: update.isRbacEnabled }),
8648
8784
  ...(update.isEncrypted !== undefined && { isEncrypted: update.isEncrypted }),
8649
8785
  ...(update.defaultValue !== undefined && { defaultValue: update.defaultValue }),
8786
+ ...(hasConstraintUpdate && f.sqlType && { sqlType: { ...f.sqlType, ...constraintUpdate } }),
8650
8787
  };
8651
8788
  });
8652
8789
  }
@@ -8696,24 +8833,27 @@ class EntityService extends BaseService {
8696
8833
  let transformedField = transformData(field, EntityMap);
8697
8834
  // Map field type: prefer fieldDisplayType for types that share SQL types (File, ChoiceSet, AutoNumber)
8698
8835
  if (transformedField.fieldDataType?.name) {
8699
- const displayTypeMapped = transformedField.fieldDisplayType
8700
- ? FieldDisplayTypeToDataType[transformedField.fieldDisplayType]
8701
- : undefined;
8702
- if (displayTypeMapped) {
8703
- transformedField.fieldDataType.name = displayTypeMapped;
8704
- }
8705
- else {
8706
- const rawSqlTypeName = field.sqlType?.name;
8707
- const mapped = rawSqlTypeName ? EntityFieldTypeMap[rawSqlTypeName] : undefined;
8708
- if (mapped) {
8709
- transformedField.fieldDataType.name = mapped;
8710
- }
8836
+ const mapped = this.tryResolveFieldDataType(transformedField.fieldDisplayType, field.sqlType?.name);
8837
+ if (mapped) {
8838
+ transformedField.fieldDataType.name = mapped;
8711
8839
  }
8712
8840
  }
8713
8841
  this.transformNestedReferences(transformedField);
8714
8842
  return transformedField;
8715
8843
  });
8716
8844
  }
8845
+ /**
8846
+ * Resolves an {@link EntityFieldDataType} from a field's `fieldDisplayType` and
8847
+ * raw SQL type name. Prefers `fieldDisplayType` to disambiguate types that
8848
+ * share a SQL type (FILE, CHOICE_SET_*, AUTO_NUMBER, RELATIONSHIP); falls back
8849
+ * to the SQL-type-name mapping. Returns `undefined` if neither resolves.
8850
+ */
8851
+ tryResolveFieldDataType(fieldDisplayType, sqlTypeName) {
8852
+ const displayMapped = fieldDisplayType ? FieldDisplayTypeToDataType[fieldDisplayType] : undefined;
8853
+ if (displayMapped)
8854
+ return displayMapped;
8855
+ return sqlTypeName ? EntityFieldTypeMap[sqlTypeName] : undefined;
8856
+ }
8717
8857
  /**
8718
8858
  * Transforms nested reference objects in field metadata
8719
8859
  */
@@ -8754,11 +8894,16 @@ class EntityService extends BaseService {
8754
8894
  /** Converts a user-facing EntityCreateFieldOptions to the raw API field payload */
8755
8895
  buildSchemaFieldPayload(field) {
8756
8896
  this.validateName(field.fieldName, 'field');
8757
- const mapping = EntitySchemaFieldTypeMap[field.type ?? exports.EntityFieldDataType.STRING];
8897
+ const fieldType = field.type ?? exports.EntityFieldDataType.STRING;
8898
+ this.validateFieldConstraints(fieldType, field, field.fieldName);
8899
+ const mapping = EntitySchemaFieldTypeMap[fieldType];
8758
8900
  return {
8759
8901
  name: field.fieldName,
8760
8902
  displayName: field.displayName ?? field.fieldName,
8761
- sqlType: { name: mapping.sqlTypeName },
8903
+ sqlType: {
8904
+ name: mapping.sqlTypeName,
8905
+ ...this.buildSqlTypeConstraints(fieldType, field),
8906
+ },
8762
8907
  fieldDisplayType: mapping.fieldDisplayType,
8763
8908
  description: field.description ?? '',
8764
8909
  isRequired: field.isRequired ?? false,
@@ -8771,6 +8916,107 @@ class EntityService extends BaseService {
8771
8916
  ...(field.referenceFieldName !== undefined && { referenceFieldName: field.referenceFieldName }),
8772
8917
  };
8773
8918
  }
8919
+ /**
8920
+ * Derives the user-facing {@link EntityFieldDataType} for a field on the raw
8921
+ * API response. Throws if the field's `fieldDisplayType` and `sqlType.name`
8922
+ * are both unmappable.
8923
+ */
8924
+ resolveFieldDataType(f) {
8925
+ const mapped = this.tryResolveFieldDataType(f.fieldDisplayType, f.sqlType?.name);
8926
+ if (!mapped) {
8927
+ throw new ValidationError({
8928
+ message: `Cannot determine field type for '${f.name}' (id: ${f.id}) — sqlType '${f.sqlType?.name ?? '(missing)'}' and fieldDisplayType '${f.fieldDisplayType ?? '(missing)'}' are both unrecognized.`,
8929
+ });
8930
+ }
8931
+ return mapped;
8932
+ }
8933
+ /**
8934
+ * Validates that the user-supplied constraint properties on a field are
8935
+ * supported by the field's data type. Throws a `ValidationError` listing
8936
+ * any unsupported properties.
8937
+ */
8938
+ validateFieldConstraints(type, field, fieldName) {
8939
+ const spec = ENTITY_FIELD_CONSTRAINT_SPEC[type] ?? {};
8940
+ const supported = Object.keys(spec);
8941
+ const provided = Object.values(EntityFieldConstraint).filter(name => field[name] !== undefined);
8942
+ const unsupported = provided.filter(p => !(p in spec));
8943
+ if (unsupported.length > 0) {
8944
+ const allowedDesc = supported.length > 0 ? supported.join(', ') : 'none';
8945
+ throw new ValidationError({
8946
+ message: `Field '${fieldName}' of type ${type} does not accept ${unsupported.join(', ')}. Allowed constraints for this type: ${allowedDesc}.`,
8947
+ });
8948
+ }
8949
+ // Range check: each user-supplied constraint must be within its allowed bounds.
8950
+ for (const name of provided) {
8951
+ const range = spec[name];
8952
+ const value = field[name];
8953
+ if (range && value !== undefined && (value < range.min || value > range.max)) {
8954
+ throw new ValidationError({
8955
+ message: `Field '${fieldName}' of type ${type} has ${name} ${value} out of range [${range.min}, ${range.max}].`,
8956
+ });
8957
+ }
8958
+ }
8959
+ // Cross-field check: when both bounds are user-supplied in the same call,
8960
+ // minValue must be strictly less than maxValue.
8961
+ if (field.minValue !== undefined && field.maxValue !== undefined && field.minValue >= field.maxValue) {
8962
+ throw new ValidationError({
8963
+ message: `Field '${fieldName}' of type ${type} has minValue ${field.minValue} >= maxValue ${field.maxValue}. minValue must be strictly less than maxValue.`,
8964
+ });
8965
+ }
8966
+ }
8967
+ /**
8968
+ * Returns the sqlType constraint fields for a given field type.
8969
+ *
8970
+ * The API requires specific constraint properties to be set per SQL type;
8971
+ * without them the field is stored in an incomplete state, causing
8972
+ * "Field type cannot be changed" errors when the UI later tries to edit
8973
+ * advanced options. User-supplied values from `EntityCreateFieldOptions`
8974
+ * override the defaults where the type accepts overrides.
8975
+ */
8976
+ buildSqlTypeConstraints(type, field) {
8977
+ const defaults = ENTITY_FIELD_CONSTRAINT_DEFAULTS;
8978
+ switch (type) {
8979
+ case exports.EntityFieldDataType.STRING:
8980
+ return { lengthLimit: field.lengthLimit ?? defaults.STRING_LENGTH_LIMIT };
8981
+ case exports.EntityFieldDataType.MULTILINE_TEXT:
8982
+ return { lengthLimit: field.lengthLimit ?? defaults.MULTILINE_TEXT_LENGTH_LIMIT };
8983
+ case exports.EntityFieldDataType.DECIMAL:
8984
+ return {
8985
+ lengthLimit: defaults.DECIMAL_LENGTH_LIMIT,
8986
+ decimalPrecision: field.decimalPrecision ?? defaults.DECIMAL_PRECISION,
8987
+ maxValue: field.maxValue ?? defaults.NUMERIC_MAX_VALUE,
8988
+ minValue: field.minValue ?? defaults.NUMERIC_MIN_VALUE,
8989
+ };
8990
+ case exports.EntityFieldDataType.BOOLEAN:
8991
+ return { lengthLimit: defaults.BOOLEAN_LENGTH_LIMIT };
8992
+ case exports.EntityFieldDataType.DATE:
8993
+ case exports.EntityFieldDataType.DATETIME_WITH_TZ:
8994
+ return { lengthLimit: defaults.DATE_LENGTH_LIMIT };
8995
+ case exports.EntityFieldDataType.INTEGER:
8996
+ case exports.EntityFieldDataType.BIG_INTEGER:
8997
+ return {
8998
+ maxValue: field.maxValue ?? defaults.NUMERIC_MAX_VALUE,
8999
+ minValue: field.minValue ?? defaults.NUMERIC_MIN_VALUE,
9000
+ };
9001
+ case exports.EntityFieldDataType.FLOAT:
9002
+ case exports.EntityFieldDataType.DOUBLE:
9003
+ return {
9004
+ decimalPrecision: field.decimalPrecision ?? defaults.DECIMAL_PRECISION,
9005
+ maxValue: field.maxValue ?? defaults.NUMERIC_MAX_VALUE,
9006
+ minValue: field.minValue ?? defaults.NUMERIC_MIN_VALUE,
9007
+ };
9008
+ case exports.EntityFieldDataType.FILE:
9009
+ case exports.EntityFieldDataType.RELATIONSHIP:
9010
+ // UNIQUEIDENTIFIER fixed lengthLimit (300)
9011
+ return { lengthLimit: defaults.UNIQUEIDENTIFIER_LENGTH_LIMIT };
9012
+ case exports.EntityFieldDataType.CHOICE_SET_MULTIPLE:
9013
+ // CHOICE_SET_MULTIPLE fixed lengthLimit (4000)
9014
+ return { lengthLimit: defaults.CHOICE_SET_MULTIPLE_LENGTH_LIMIT };
9015
+ default:
9016
+ // UUID, CHOICE_SET_SINGLE, AUTO_NUMBER, DATETIME — (sqlType: { name })
9017
+ return {};
9018
+ }
9019
+ }
8774
9020
  validateName(name, context) {
8775
9021
  if (name.length < 3 || name.length > 100 || !/^[a-zA-Z]\w*$/.test(name)) {
8776
9022
  const suggestion = name.replace(/\W/g, '').replace(/^[0-9_]+/, '');
@@ -12779,6 +13025,260 @@ exports.FeedbackStatus = void 0;
12779
13025
  FeedbackStatus[FeedbackStatus["Dismissed"] = 2] = "Dismissed";
12780
13026
  })(exports.FeedbackStatus || (exports.FeedbackStatus = {}));
12781
13027
 
13028
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13029
+ var DocumentActionPriority;
13030
+ (function (DocumentActionPriority) {
13031
+ DocumentActionPriority["Low"] = "Low";
13032
+ DocumentActionPriority["Medium"] = "Medium";
13033
+ DocumentActionPriority["High"] = "High";
13034
+ DocumentActionPriority["Critical"] = "Critical";
13035
+ })(DocumentActionPriority || (DocumentActionPriority = {}));
13036
+ var DocumentActionStatus;
13037
+ (function (DocumentActionStatus) {
13038
+ DocumentActionStatus["Unassigned"] = "Unassigned";
13039
+ DocumentActionStatus["Pending"] = "Pending";
13040
+ DocumentActionStatus["Completed"] = "Completed";
13041
+ })(DocumentActionStatus || (DocumentActionStatus = {}));
13042
+ var DocumentActionType;
13043
+ (function (DocumentActionType) {
13044
+ DocumentActionType["Validation"] = "Validation";
13045
+ DocumentActionType["Classification"] = "Classification";
13046
+ })(DocumentActionType || (DocumentActionType = {}));
13047
+
13048
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13049
+ var ProjectProperties;
13050
+ (function (ProjectProperties) {
13051
+ ProjectProperties["IsPredefined"] = "IsPredefined";
13052
+ ProjectProperties["SupportsTags"] = "SupportsTags";
13053
+ ProjectProperties["SupportsVersions"] = "SupportsVersions";
13054
+ ProjectProperties["IsSplittingEnabled"] = "IsSplittingEnabled";
13055
+ })(ProjectProperties || (ProjectProperties = {}));
13056
+ var ProjectType;
13057
+ (function (ProjectType) {
13058
+ ProjectType["Classic"] = "Classic";
13059
+ ProjectType["Modern"] = "Modern";
13060
+ ProjectType["IXP"] = "IXP";
13061
+ ProjectType["Unknown"] = "Unknown";
13062
+ })(ProjectType || (ProjectType = {}));
13063
+ var ResourceStatus;
13064
+ (function (ResourceStatus) {
13065
+ ResourceStatus["Unknown"] = "Unknown";
13066
+ ResourceStatus["NotStarted"] = "NotStarted";
13067
+ ResourceStatus["ExportInProgress"] = "ExportInProgress";
13068
+ ResourceStatus["ExportCompleted"] = "ExportCompleted";
13069
+ ResourceStatus["InProgress"] = "InProgress";
13070
+ ResourceStatus["Suspended"] = "Suspended";
13071
+ ResourceStatus["Resuming"] = "Resuming";
13072
+ ResourceStatus["Available"] = "Available";
13073
+ ResourceStatus["Error"] = "Error";
13074
+ ResourceStatus["Deleting"] = "Deleting";
13075
+ })(ResourceStatus || (ResourceStatus = {}));
13076
+ var ResourceType;
13077
+ (function (ResourceType) {
13078
+ ResourceType["Specialized"] = "Specialized";
13079
+ ResourceType["Generative"] = "Generative";
13080
+ ResourceType["Custom"] = "Custom";
13081
+ ResourceType["Unknown"] = "Unknown";
13082
+ })(ResourceType || (ResourceType = {}));
13083
+
13084
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13085
+ var MarkupType;
13086
+ (function (MarkupType) {
13087
+ MarkupType["Unknown"] = "Unknown";
13088
+ MarkupType["Circled"] = "Circled";
13089
+ MarkupType["Underlined"] = "Underlined";
13090
+ MarkupType["Strikethrough"] = "Strikethrough";
13091
+ })(MarkupType || (MarkupType = {}));
13092
+ var ProcessingSource;
13093
+ (function (ProcessingSource) {
13094
+ ProcessingSource["Unknown"] = "Unknown";
13095
+ ProcessingSource["Ocr"] = "Ocr";
13096
+ ProcessingSource["Pdf"] = "Pdf";
13097
+ ProcessingSource["PlainText"] = "PlainText";
13098
+ ProcessingSource["PdfAndOcr"] = "PdfAndOcr";
13099
+ })(ProcessingSource || (ProcessingSource = {}));
13100
+ var Rotation;
13101
+ (function (Rotation) {
13102
+ Rotation["None"] = "None";
13103
+ Rotation["Rotated90"] = "Rotated90";
13104
+ Rotation["Rotated180"] = "Rotated180";
13105
+ Rotation["Rotated270"] = "Rotated270";
13106
+ Rotation["Other"] = "Other";
13107
+ })(Rotation || (Rotation = {}));
13108
+ var SectionType;
13109
+ (function (SectionType) {
13110
+ SectionType["Vertical"] = "Vertical";
13111
+ SectionType["Paragraph"] = "Paragraph";
13112
+ SectionType["Header"] = "Header";
13113
+ SectionType["Footer"] = "Footer";
13114
+ SectionType["Table"] = "Table";
13115
+ })(SectionType || (SectionType = {}));
13116
+ var TextType;
13117
+ (function (TextType) {
13118
+ TextType["Unknown"] = "Unknown";
13119
+ TextType["Text"] = "Text";
13120
+ TextType["Checkbox"] = "Checkbox";
13121
+ TextType["Handwriting"] = "Handwriting";
13122
+ TextType["Barcode"] = "Barcode";
13123
+ TextType["QRcode"] = "QRcode";
13124
+ TextType["Stamp"] = "Stamp";
13125
+ TextType["Logo"] = "Logo";
13126
+ TextType["Circle"] = "Circle";
13127
+ TextType["Underline"] = "Underline";
13128
+ TextType["Cut"] = "Cut";
13129
+ })(TextType || (TextType = {}));
13130
+ var WordGroupType;
13131
+ (function (WordGroupType) {
13132
+ WordGroupType["Sentence"] = "Sentence";
13133
+ WordGroupType["TableCell"] = "TableCell";
13134
+ WordGroupType["TableRowEnd"] = "TableRowEnd";
13135
+ WordGroupType["Heading"] = "Heading";
13136
+ WordGroupType["Other"] = "Other";
13137
+ })(WordGroupType || (WordGroupType = {}));
13138
+
13139
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13140
+ var ModelKind;
13141
+ (function (ModelKind) {
13142
+ ModelKind["Classifier"] = "Classifier";
13143
+ ModelKind["Extractor"] = "Extractor";
13144
+ })(ModelKind || (ModelKind = {}));
13145
+ var ModelType;
13146
+ (function (ModelType) {
13147
+ ModelType["IXP"] = "IXP";
13148
+ ModelType["Modern"] = "Modern";
13149
+ ModelType["Predefined"] = "Predefined";
13150
+ })(ModelType || (ModelType = {}));
13151
+
13152
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13153
+ var ClassifierDocumentTypeType;
13154
+ (function (ClassifierDocumentTypeType) {
13155
+ ClassifierDocumentTypeType["FormsAi"] = "FormsAi";
13156
+ ClassifierDocumentTypeType["SemiStructuredAi"] = "SemiStructuredAi";
13157
+ ClassifierDocumentTypeType["Helix"] = "Helix";
13158
+ ClassifierDocumentTypeType["Unknown"] = "Unknown";
13159
+ })(ClassifierDocumentTypeType || (ClassifierDocumentTypeType = {}));
13160
+ var CreateTaskPriority;
13161
+ (function (CreateTaskPriority) {
13162
+ CreateTaskPriority["Low"] = "Low";
13163
+ CreateTaskPriority["Medium"] = "Medium";
13164
+ CreateTaskPriority["High"] = "High";
13165
+ CreateTaskPriority["Critical"] = "Critical";
13166
+ })(CreateTaskPriority || (CreateTaskPriority = {}));
13167
+ var GptFieldType;
13168
+ (function (GptFieldType) {
13169
+ GptFieldType["Address"] = "Address";
13170
+ GptFieldType["Boolean"] = "Boolean";
13171
+ GptFieldType["Date"] = "Date";
13172
+ GptFieldType["Name"] = "Name";
13173
+ GptFieldType["Number"] = "Number";
13174
+ GptFieldType["Text"] = "Text";
13175
+ })(GptFieldType || (GptFieldType = {}));
13176
+ var ValidationDisplayMode;
13177
+ (function (ValidationDisplayMode) {
13178
+ ValidationDisplayMode["Classic"] = "Classic";
13179
+ ValidationDisplayMode["Compact"] = "Compact";
13180
+ })(ValidationDisplayMode || (ValidationDisplayMode = {}));
13181
+
13182
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13183
+ var ResultsDataSource;
13184
+ (function (ResultsDataSource) {
13185
+ ResultsDataSource["Automatic"] = "Automatic";
13186
+ ResultsDataSource["Manual"] = "Manual";
13187
+ ResultsDataSource["ManuallyChanged"] = "ManuallyChanged";
13188
+ ResultsDataSource["Defaulted"] = "Defaulted";
13189
+ ResultsDataSource["External"] = "External";
13190
+ })(ResultsDataSource || (ResultsDataSource = {}));
13191
+
13192
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13193
+ var ComparisonOperator;
13194
+ (function (ComparisonOperator) {
13195
+ ComparisonOperator["Equals"] = "Equals";
13196
+ ComparisonOperator["NotEquals"] = "NotEquals";
13197
+ ComparisonOperator["Greater"] = "Greater";
13198
+ ComparisonOperator["Less"] = "Less";
13199
+ ComparisonOperator["GreaterOrEqual"] = "GreaterOrEqual";
13200
+ ComparisonOperator["LessOrEqual"] = "LessOrEqual";
13201
+ })(ComparisonOperator || (ComparisonOperator = {}));
13202
+ var Criticality;
13203
+ (function (Criticality) {
13204
+ Criticality["Must"] = "Must";
13205
+ Criticality["Should"] = "Should";
13206
+ })(Criticality || (Criticality = {}));
13207
+ var FieldType;
13208
+ (function (FieldType) {
13209
+ FieldType["Text"] = "Text";
13210
+ FieldType["Number"] = "Number";
13211
+ FieldType["Date"] = "Date";
13212
+ FieldType["Name"] = "Name";
13213
+ FieldType["Address"] = "Address";
13214
+ FieldType["Keyword"] = "Keyword";
13215
+ FieldType["Set"] = "Set";
13216
+ FieldType["Boolean"] = "Boolean";
13217
+ FieldType["Table"] = "Table";
13218
+ FieldType["Internal"] = "Internal";
13219
+ FieldType["FieldGroup"] = "FieldGroup";
13220
+ FieldType["MonetaryQuantity"] = "MonetaryQuantity";
13221
+ })(FieldType || (FieldType = {}));
13222
+ var LogicalOperator;
13223
+ (function (LogicalOperator) {
13224
+ LogicalOperator["AND"] = "AND";
13225
+ LogicalOperator["OR"] = "OR";
13226
+ })(LogicalOperator || (LogicalOperator = {}));
13227
+ var RuleType;
13228
+ (function (RuleType) {
13229
+ RuleType["Mandatory"] = "Mandatory";
13230
+ RuleType["PossibleValues"] = "PossibleValues";
13231
+ RuleType["Regex"] = "Regex";
13232
+ RuleType["StartsWith"] = "StartsWith";
13233
+ RuleType["EndsWith"] = "EndsWith";
13234
+ RuleType["FixedLength"] = "FixedLength";
13235
+ RuleType["IsNumeric"] = "IsNumeric";
13236
+ RuleType["IsDate"] = "IsDate";
13237
+ RuleType["IsEmail"] = "IsEmail";
13238
+ RuleType["Contains"] = "Contains";
13239
+ RuleType["Expression"] = "Expression";
13240
+ RuleType["TableExpression"] = "TableExpression";
13241
+ RuleType["IsEmpty"] = "IsEmpty";
13242
+ })(RuleType || (RuleType = {}));
13243
+
13244
+ // Auto-generated from the OpenAPI spec — do not edit manually.
13245
+ var ActionStatus;
13246
+ (function (ActionStatus) {
13247
+ ActionStatus["Unassigned"] = "Unassigned";
13248
+ ActionStatus["Pending"] = "Pending";
13249
+ ActionStatus["Completed"] = "Completed";
13250
+ })(ActionStatus || (ActionStatus = {}));
13251
+
13252
+ var index = /*#__PURE__*/Object.freeze({
13253
+ __proto__: null,
13254
+ get ActionStatus () { return ActionStatus; },
13255
+ get ClassifierDocumentTypeType () { return ClassifierDocumentTypeType; },
13256
+ get ComparisonOperator () { return ComparisonOperator; },
13257
+ get CreateTaskPriority () { return CreateTaskPriority; },
13258
+ get Criticality () { return Criticality; },
13259
+ get DocumentActionPriority () { return DocumentActionPriority; },
13260
+ get DocumentActionStatus () { return DocumentActionStatus; },
13261
+ get DocumentActionType () { return DocumentActionType; },
13262
+ get FieldType () { return FieldType; },
13263
+ get GptFieldType () { return GptFieldType; },
13264
+ get LogicalOperator () { return LogicalOperator; },
13265
+ get MarkupType () { return MarkupType; },
13266
+ get ModelKind () { return ModelKind; },
13267
+ get ModelType () { return ModelType; },
13268
+ get ProcessingSource () { return ProcessingSource; },
13269
+ get ProjectProperties () { return ProjectProperties; },
13270
+ get ProjectType () { return ProjectType; },
13271
+ get ResourceStatus () { return ResourceStatus; },
13272
+ get ResourceType () { return ResourceType; },
13273
+ get ResultsDataSource () { return ResultsDataSource; },
13274
+ get Rotation () { return Rotation; },
13275
+ get RuleType () { return RuleType; },
13276
+ get SectionType () { return SectionType; },
13277
+ get TextType () { return TextType; },
13278
+ get ValidationDisplayMode () { return ValidationDisplayMode; },
13279
+ get WordGroupType () { return WordGroupType; }
13280
+ });
13281
+
12782
13282
  /**
12783
13283
  * Asset resolution utilities for UiPath Coded Apps
12784
13284
  *
@@ -12869,6 +13369,7 @@ exports.ConversationMap = ConversationMap;
12869
13369
  exports.DEFAULT_ITEMS_FIELD = DEFAULT_ITEMS_FIELD;
12870
13370
  exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE;
12871
13371
  exports.DEFAULT_TOTAL_COUNT_FIELD = DEFAULT_TOTAL_COUNT_FIELD;
13372
+ exports.DuFramework = index;
12872
13373
  exports.ErrorType = ErrorType;
12873
13374
  exports.ExchangeMap = ExchangeMap;
12874
13375
  exports.HttpStatus = HttpStatus;