@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.umd.js CHANGED
@@ -5028,6 +5028,7 @@
5028
5028
  const GUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
5029
5029
  class AuthService {
5030
5030
  constructor(config, executionContext) {
5031
+ this.skipAcrValues = false;
5031
5032
  // Only use stored OAuth context when completing an active callback (URL has ?code=).
5032
5033
  // If stored context exists but we're NOT in a callback, it's stale from a
5033
5034
  // failed/abandoned flow (e.g. scope mismatch, invalid redirect URI) and must
@@ -5119,6 +5120,14 @@
5119
5120
  getTokenManager() {
5120
5121
  return this.tokenManager;
5121
5122
  }
5123
+ /**
5124
+ * Enables the UiPath login picker during OAuth sign-in.
5125
+ *
5126
+ * @internal
5127
+ */
5128
+ setMultiLogin() {
5129
+ this.skipAcrValues = true;
5130
+ }
5122
5131
  /**
5123
5132
  * Authenticates the user based on the provided SDK configuration.
5124
5133
  * This method handles OAuth 2.0 authentication flow only.
@@ -5320,7 +5329,10 @@
5320
5329
  scope: params.scope + ' offline_access',
5321
5330
  state: params.state || this.generateCodeVerifier().slice(0, 16)
5322
5331
  });
5323
- return `${this.config.baseUrl}/${IDENTITY_ENDPOINTS.AUTHORIZE}?${queryParams.toString()}&acr_values=${acrValues}`;
5332
+ const authorizeUrl = `${this.config.baseUrl}/${IDENTITY_ENDPOINTS.AUTHORIZE}?${queryParams.toString()}`;
5333
+ return this.skipAcrValues
5334
+ ? authorizeUrl
5335
+ : `${authorizeUrl}&acr_values=${acrValues}`;
5324
5336
  }
5325
5337
  /**
5326
5338
  * Exchanges the authorization code for an access token and automatically updates the current token
@@ -9209,7 +9221,7 @@
9209
9221
  // Connection string placeholder that will be replaced during build
9210
9222
  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";
9211
9223
  // SDK Version placeholder
9212
- const SDK_VERSION = "1.3.4";
9224
+ const SDK_VERSION = "1.3.6";
9213
9225
  const VERSION = "Version";
9214
9226
  const SERVICE = "Service";
9215
9227
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -9589,7 +9601,7 @@
9589
9601
  return hasAnyValue ? config : null;
9590
9602
  }
9591
9603
 
9592
- var _UiPath_instances, _UiPath_config, _UiPath_authService, _UiPath_initialized, _UiPath_partialConfig, _UiPath_initializeWithConfig, _UiPath_loadConfig;
9604
+ var _UiPath_instances, _UiPath_config, _UiPath_authService, _UiPath_initialized, _UiPath_partialConfig, _UiPath_multiLogin, _UiPath_initializeWithConfig, _UiPath_loadConfig;
9593
9605
  /**
9594
9606
  * UiPath - Core SDK class for authentication and configuration management.
9595
9607
  *
@@ -9629,6 +9641,7 @@
9629
9641
  _UiPath_authService.set(this, void 0);
9630
9642
  _UiPath_initialized.set(this, false);
9631
9643
  _UiPath_partialConfig.set(this, void 0);
9644
+ _UiPath_multiLogin.set(this, false);
9632
9645
  // Load configuration from meta tags
9633
9646
  const configFromMetaTags = loadFromMetaTags();
9634
9647
  // Merge configuration: constructor config overrides meta tags
@@ -9679,6 +9692,15 @@
9679
9692
  throw new Error(`Failed to initialize UiPath SDK: ${errorMessage}`);
9680
9693
  }
9681
9694
  }
9695
+ /**
9696
+ * Enables the UiPath login picker during OAuth sign-in.
9697
+ *
9698
+ * @internal
9699
+ */
9700
+ setMultiLogin() {
9701
+ __classPrivateFieldSet(this, _UiPath_multiLogin, true, "f");
9702
+ __classPrivateFieldGet(this, _UiPath_authService, "f")?.setMultiLogin();
9703
+ }
9682
9704
  /**
9683
9705
  * Check if the SDK has been initialized
9684
9706
  */
@@ -9750,7 +9772,7 @@
9750
9772
  __classPrivateFieldGet(this, _UiPath_authService, "f")?.updateToken(tokenInfo);
9751
9773
  }
9752
9774
  };
9753
- _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) {
9775
+ _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) {
9754
9776
  // Validate and normalize the configuration
9755
9777
  validateConfig(config);
9756
9778
  const hasSecretAuth = hasSecretConfig(config);
@@ -9767,6 +9789,9 @@
9767
9789
  });
9768
9790
  const executionContext = new ExecutionContext();
9769
9791
  __classPrivateFieldSet(this, _UiPath_authService, new AuthService(internalConfig, executionContext), "f");
9792
+ if (__classPrivateFieldGet(this, _UiPath_multiLogin, "f")) {
9793
+ __classPrivateFieldGet(this, _UiPath_authService, "f").setMultiLogin();
9794
+ }
9770
9795
  __classPrivateFieldSet(this, _UiPath_config, internalConfig, "f");
9771
9796
  // Store internals in SDKInternalsRegistry (not visible on instance)
9772
9797
  SDKInternalsRegistry.set(this, {
@@ -11618,6 +11643,20 @@
11618
11643
  return params;
11619
11644
  }
11620
11645
 
11646
+ /**
11647
+ * Names of the per-field SQL constraint properties (i.e. the contents of `sqlType`
11648
+ * excluding its `name`). Used internally to validate user-supplied constraints
11649
+ * against the set of constraints that each `EntityFieldDataType` accepts.
11650
+ *
11651
+ * Enum values match the corresponding property names on `EntityCreateFieldOptions`.
11652
+ */
11653
+ var EntityFieldConstraint;
11654
+ (function (EntityFieldConstraint) {
11655
+ EntityFieldConstraint["LengthLimit"] = "lengthLimit";
11656
+ EntityFieldConstraint["MaxValue"] = "maxValue";
11657
+ EntityFieldConstraint["MinValue"] = "minValue";
11658
+ EntityFieldConstraint["DecimalPrecision"] = "decimalPrecision";
11659
+ })(EntityFieldConstraint || (EntityFieldConstraint = {}));
11621
11660
  /**
11622
11661
  * Entity field data types (SQL types from API)
11623
11662
  */
@@ -11680,6 +11719,70 @@
11680
11719
  [exports.FieldDisplayType.AutoNumber]: exports.EntityFieldDataType.AUTO_NUMBER,
11681
11720
  [exports.FieldDisplayType.Relationship]: exports.EntityFieldDataType.RELATIONSHIP,
11682
11721
  };
11722
+ /**
11723
+ * Default and fixed sqlType constraint values applied when the user does not provide them.
11724
+ * The API requires these to be present on field creation — without them the field
11725
+ * is stored in an incomplete state, causing "Field type cannot be changed" errors
11726
+ * when the UI later tries to edit advanced options.
11727
+ */
11728
+ const ENTITY_FIELD_CONSTRAINT_DEFAULTS = {
11729
+ STRING_LENGTH_LIMIT: 200,
11730
+ MULTILINE_TEXT_LENGTH_LIMIT: 200,
11731
+ /** Fixed (non-overridable) length limit on DECIMAL payloads*/
11732
+ DECIMAL_LENGTH_LIMIT: 1000,
11733
+ DECIMAL_PRECISION: 2,
11734
+ /** Fixed (non-overridable) length limit for BIT (BOOLEAN) fields */
11735
+ BOOLEAN_LENGTH_LIMIT: 100,
11736
+ /** Fixed (non-overridable) length limit for DATE / DATETIMEOFFSET fields */
11737
+ DATE_LENGTH_LIMIT: 1000,
11738
+ /** Fixed (non-overridable) length limit for UNIQUEIDENTIFIER-backed FILE and RELATIONSHIP fields */
11739
+ UNIQUEIDENTIFIER_LENGTH_LIMIT: 300,
11740
+ /** Fixed (non-overridable) length limit for CHOICE_SET_MULTIPLE fields */
11741
+ CHOICE_SET_MULTIPLE_LENGTH_LIMIT: 4000,
11742
+ NUMERIC_MAX_VALUE: 1000000000000,
11743
+ NUMERIC_MIN_VALUE: -1e12,
11744
+ };
11745
+ /**
11746
+ * Per-field-type spec describing which {@link EntityFieldConstraint}s the user
11747
+ * may supply on create / update, and the inclusive value range for each.
11748
+ *
11749
+ * Source of truth: the platform's `Constants.cs` constraint table. Keys absent
11750
+ * from a type's spec are not user-configurable for that type; passing one
11751
+ * throws a `ValidationError`. Field types absent from this map (BOOLEAN, DATE,
11752
+ * DATETIME, DATETIME_WITH_TZ, FILE, RELATIONSHIP, UUID, CHOICE_SET_SINGLE,
11753
+ * CHOICE_SET_MULTIPLE, AUTO_NUMBER) accept no user-supplied constraints.
11754
+ */
11755
+ const ENTITY_FIELD_CONSTRAINT_SPEC = {
11756
+ [exports.EntityFieldDataType.STRING]: {
11757
+ [EntityFieldConstraint.LengthLimit]: { min: 1, max: 4000 },
11758
+ },
11759
+ [exports.EntityFieldDataType.MULTILINE_TEXT]: {
11760
+ [EntityFieldConstraint.LengthLimit]: { min: 1, max: 10000 },
11761
+ },
11762
+ [exports.EntityFieldDataType.INTEGER]: {
11763
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
11764
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
11765
+ },
11766
+ [exports.EntityFieldDataType.BIG_INTEGER]: {
11767
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
11768
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
11769
+ },
11770
+ [exports.EntityFieldDataType.DECIMAL]: {
11771
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
11772
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
11773
+ [EntityFieldConstraint.DecimalPrecision]: { min: 0, max: 10 },
11774
+ },
11775
+ [exports.EntityFieldDataType.FLOAT]: {
11776
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
11777
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
11778
+ [EntityFieldConstraint.DecimalPrecision]: { min: 0, max: 10 },
11779
+ },
11780
+ [exports.EntityFieldDataType.DOUBLE]: {
11781
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
11782
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
11783
+ [EntityFieldConstraint.DecimalPrecision]: { min: 0, max: 10 },
11784
+ },
11785
+ };
11683
11786
  /**
11684
11787
  * Maps SQL field types to friendly display names
11685
11788
  */
@@ -12279,6 +12382,13 @@
12279
12382
  * { fieldName: "product_name", type: EntityFieldDataType.STRING, isRequired: true, isUnique: true },
12280
12383
  * { fieldName: "price", type: EntityFieldDataType.INTEGER, defaultValue: "0" },
12281
12384
  * ], { displayName: "Product Catalog", description: "Our product catalog", isRbacEnabled: true });
12385
+ *
12386
+ * // With advanced sqlType constraints (lengthLimit, decimalPrecision, maxValue, minValue) and defaultValue
12387
+ * const ordersId = await entities.create("orders", [
12388
+ * { fieldName: "product_name", type: EntityFieldDataType.STRING, isRequired: true, isUnique: true, lengthLimit: 500 },
12389
+ * { fieldName: "price", type: EntityFieldDataType.DECIMAL, decimalPrecision: 4, maxValue: 999999, minValue: 0 },
12390
+ * { fieldName: "quantity", type: EntityFieldDataType.INTEGER, maxValue: 10000, minValue: 1, defaultValue: "0" },
12391
+ * ]);
12282
12392
  * ```
12283
12393
  * @internal
12284
12394
  */
@@ -12352,6 +12462,17 @@
12352
12462
  * updateFields: [{ id: "<fieldId>", displayName: "Unit Price", isRequired: true }],
12353
12463
  * displayName: "Price Catalog",
12354
12464
  * });
12465
+ *
12466
+ * // Add a STRING/DECIMAL field with explicit advanced sqlType constraints and defaultValue
12467
+ * await entities.updateById("<entityId>", {
12468
+ * addFields: [
12469
+ * { fieldName: "summary", type: EntityFieldDataType.STRING, lengthLimit: 500, defaultValue: "summary" },
12470
+ * { fieldName: "amount", type: EntityFieldDataType.DECIMAL, decimalPrecision: 4, maxValue: 999999, minValue: 0 },
12471
+ * ],
12472
+ * updateFields: [
12473
+ * { id: "<fieldId>", lengthLimit: 1000 },
12474
+ * ],
12475
+ * });
12355
12476
  * ```
12356
12477
  * @internal
12357
12478
  */
@@ -12395,6 +12516,21 @@
12395
12516
  const update = updateMap.get(f.id ?? '');
12396
12517
  if (!update)
12397
12518
  return f;
12519
+ const constraintUpdate = {
12520
+ ...(update.lengthLimit !== undefined && { lengthLimit: update.lengthLimit }),
12521
+ ...(update.maxValue !== undefined && { maxValue: update.maxValue }),
12522
+ ...(update.minValue !== undefined && { minValue: update.minValue }),
12523
+ ...(update.decimalPrecision !== undefined && { decimalPrecision: update.decimalPrecision }),
12524
+ };
12525
+ const hasConstraintUpdate = Object.keys(constraintUpdate).length > 0;
12526
+ if (hasConstraintUpdate) {
12527
+ if (!f.sqlType) {
12528
+ throw new ValidationError({
12529
+ message: `Cannot update constraints on field '${f.name}' (id: ${f.id}) — the field is missing sqlType metadata in the entity definition.`,
12530
+ });
12531
+ }
12532
+ this.validateFieldConstraints(this.resolveFieldDataType(f), update, f.name);
12533
+ }
12398
12534
  return {
12399
12535
  ...f,
12400
12536
  ...(update.displayName !== undefined && { displayName: update.displayName }),
@@ -12404,6 +12540,7 @@
12404
12540
  ...(update.isRbacEnabled !== undefined && { isRbacEnabled: update.isRbacEnabled }),
12405
12541
  ...(update.isEncrypted !== undefined && { isEncrypted: update.isEncrypted }),
12406
12542
  ...(update.defaultValue !== undefined && { defaultValue: update.defaultValue }),
12543
+ ...(hasConstraintUpdate && f.sqlType && { sqlType: { ...f.sqlType, ...constraintUpdate } }),
12407
12544
  };
12408
12545
  });
12409
12546
  }
@@ -12453,24 +12590,27 @@
12453
12590
  let transformedField = transformData(field, EntityMap);
12454
12591
  // Map field type: prefer fieldDisplayType for types that share SQL types (File, ChoiceSet, AutoNumber)
12455
12592
  if (transformedField.fieldDataType?.name) {
12456
- const displayTypeMapped = transformedField.fieldDisplayType
12457
- ? FieldDisplayTypeToDataType[transformedField.fieldDisplayType]
12458
- : undefined;
12459
- if (displayTypeMapped) {
12460
- transformedField.fieldDataType.name = displayTypeMapped;
12461
- }
12462
- else {
12463
- const rawSqlTypeName = field.sqlType?.name;
12464
- const mapped = rawSqlTypeName ? EntityFieldTypeMap[rawSqlTypeName] : undefined;
12465
- if (mapped) {
12466
- transformedField.fieldDataType.name = mapped;
12467
- }
12593
+ const mapped = this.tryResolveFieldDataType(transformedField.fieldDisplayType, field.sqlType?.name);
12594
+ if (mapped) {
12595
+ transformedField.fieldDataType.name = mapped;
12468
12596
  }
12469
12597
  }
12470
12598
  this.transformNestedReferences(transformedField);
12471
12599
  return transformedField;
12472
12600
  });
12473
12601
  }
12602
+ /**
12603
+ * Resolves an {@link EntityFieldDataType} from a field's `fieldDisplayType` and
12604
+ * raw SQL type name. Prefers `fieldDisplayType` to disambiguate types that
12605
+ * share a SQL type (FILE, CHOICE_SET_*, AUTO_NUMBER, RELATIONSHIP); falls back
12606
+ * to the SQL-type-name mapping. Returns `undefined` if neither resolves.
12607
+ */
12608
+ tryResolveFieldDataType(fieldDisplayType, sqlTypeName) {
12609
+ const displayMapped = fieldDisplayType ? FieldDisplayTypeToDataType[fieldDisplayType] : undefined;
12610
+ if (displayMapped)
12611
+ return displayMapped;
12612
+ return sqlTypeName ? EntityFieldTypeMap[sqlTypeName] : undefined;
12613
+ }
12474
12614
  /**
12475
12615
  * Transforms nested reference objects in field metadata
12476
12616
  */
@@ -12511,11 +12651,16 @@
12511
12651
  /** Converts a user-facing EntityCreateFieldOptions to the raw API field payload */
12512
12652
  buildSchemaFieldPayload(field) {
12513
12653
  this.validateName(field.fieldName, 'field');
12514
- const mapping = EntitySchemaFieldTypeMap[field.type ?? exports.EntityFieldDataType.STRING];
12654
+ const fieldType = field.type ?? exports.EntityFieldDataType.STRING;
12655
+ this.validateFieldConstraints(fieldType, field, field.fieldName);
12656
+ const mapping = EntitySchemaFieldTypeMap[fieldType];
12515
12657
  return {
12516
12658
  name: field.fieldName,
12517
12659
  displayName: field.displayName ?? field.fieldName,
12518
- sqlType: { name: mapping.sqlTypeName },
12660
+ sqlType: {
12661
+ name: mapping.sqlTypeName,
12662
+ ...this.buildSqlTypeConstraints(fieldType, field),
12663
+ },
12519
12664
  fieldDisplayType: mapping.fieldDisplayType,
12520
12665
  description: field.description ?? '',
12521
12666
  isRequired: field.isRequired ?? false,
@@ -12528,6 +12673,107 @@
12528
12673
  ...(field.referenceFieldName !== undefined && { referenceFieldName: field.referenceFieldName }),
12529
12674
  };
12530
12675
  }
12676
+ /**
12677
+ * Derives the user-facing {@link EntityFieldDataType} for a field on the raw
12678
+ * API response. Throws if the field's `fieldDisplayType` and `sqlType.name`
12679
+ * are both unmappable.
12680
+ */
12681
+ resolveFieldDataType(f) {
12682
+ const mapped = this.tryResolveFieldDataType(f.fieldDisplayType, f.sqlType?.name);
12683
+ if (!mapped) {
12684
+ throw new ValidationError({
12685
+ message: `Cannot determine field type for '${f.name}' (id: ${f.id}) — sqlType '${f.sqlType?.name ?? '(missing)'}' and fieldDisplayType '${f.fieldDisplayType ?? '(missing)'}' are both unrecognized.`,
12686
+ });
12687
+ }
12688
+ return mapped;
12689
+ }
12690
+ /**
12691
+ * Validates that the user-supplied constraint properties on a field are
12692
+ * supported by the field's data type. Throws a `ValidationError` listing
12693
+ * any unsupported properties.
12694
+ */
12695
+ validateFieldConstraints(type, field, fieldName) {
12696
+ const spec = ENTITY_FIELD_CONSTRAINT_SPEC[type] ?? {};
12697
+ const supported = Object.keys(spec);
12698
+ const provided = Object.values(EntityFieldConstraint).filter(name => field[name] !== undefined);
12699
+ const unsupported = provided.filter(p => !(p in spec));
12700
+ if (unsupported.length > 0) {
12701
+ const allowedDesc = supported.length > 0 ? supported.join(', ') : 'none';
12702
+ throw new ValidationError({
12703
+ message: `Field '${fieldName}' of type ${type} does not accept ${unsupported.join(', ')}. Allowed constraints for this type: ${allowedDesc}.`,
12704
+ });
12705
+ }
12706
+ // Range check: each user-supplied constraint must be within its allowed bounds.
12707
+ for (const name of provided) {
12708
+ const range = spec[name];
12709
+ const value = field[name];
12710
+ if (range && value !== undefined && (value < range.min || value > range.max)) {
12711
+ throw new ValidationError({
12712
+ message: `Field '${fieldName}' of type ${type} has ${name} ${value} out of range [${range.min}, ${range.max}].`,
12713
+ });
12714
+ }
12715
+ }
12716
+ // Cross-field check: when both bounds are user-supplied in the same call,
12717
+ // minValue must be strictly less than maxValue.
12718
+ if (field.minValue !== undefined && field.maxValue !== undefined && field.minValue >= field.maxValue) {
12719
+ throw new ValidationError({
12720
+ message: `Field '${fieldName}' of type ${type} has minValue ${field.minValue} >= maxValue ${field.maxValue}. minValue must be strictly less than maxValue.`,
12721
+ });
12722
+ }
12723
+ }
12724
+ /**
12725
+ * Returns the sqlType constraint fields for a given field type.
12726
+ *
12727
+ * The API requires specific constraint properties to be set per SQL type;
12728
+ * without them the field is stored in an incomplete state, causing
12729
+ * "Field type cannot be changed" errors when the UI later tries to edit
12730
+ * advanced options. User-supplied values from `EntityCreateFieldOptions`
12731
+ * override the defaults where the type accepts overrides.
12732
+ */
12733
+ buildSqlTypeConstraints(type, field) {
12734
+ const defaults = ENTITY_FIELD_CONSTRAINT_DEFAULTS;
12735
+ switch (type) {
12736
+ case exports.EntityFieldDataType.STRING:
12737
+ return { lengthLimit: field.lengthLimit ?? defaults.STRING_LENGTH_LIMIT };
12738
+ case exports.EntityFieldDataType.MULTILINE_TEXT:
12739
+ return { lengthLimit: field.lengthLimit ?? defaults.MULTILINE_TEXT_LENGTH_LIMIT };
12740
+ case exports.EntityFieldDataType.DECIMAL:
12741
+ return {
12742
+ lengthLimit: defaults.DECIMAL_LENGTH_LIMIT,
12743
+ decimalPrecision: field.decimalPrecision ?? defaults.DECIMAL_PRECISION,
12744
+ maxValue: field.maxValue ?? defaults.NUMERIC_MAX_VALUE,
12745
+ minValue: field.minValue ?? defaults.NUMERIC_MIN_VALUE,
12746
+ };
12747
+ case exports.EntityFieldDataType.BOOLEAN:
12748
+ return { lengthLimit: defaults.BOOLEAN_LENGTH_LIMIT };
12749
+ case exports.EntityFieldDataType.DATE:
12750
+ case exports.EntityFieldDataType.DATETIME_WITH_TZ:
12751
+ return { lengthLimit: defaults.DATE_LENGTH_LIMIT };
12752
+ case exports.EntityFieldDataType.INTEGER:
12753
+ case exports.EntityFieldDataType.BIG_INTEGER:
12754
+ return {
12755
+ maxValue: field.maxValue ?? defaults.NUMERIC_MAX_VALUE,
12756
+ minValue: field.minValue ?? defaults.NUMERIC_MIN_VALUE,
12757
+ };
12758
+ case exports.EntityFieldDataType.FLOAT:
12759
+ case exports.EntityFieldDataType.DOUBLE:
12760
+ return {
12761
+ decimalPrecision: field.decimalPrecision ?? defaults.DECIMAL_PRECISION,
12762
+ maxValue: field.maxValue ?? defaults.NUMERIC_MAX_VALUE,
12763
+ minValue: field.minValue ?? defaults.NUMERIC_MIN_VALUE,
12764
+ };
12765
+ case exports.EntityFieldDataType.FILE:
12766
+ case exports.EntityFieldDataType.RELATIONSHIP:
12767
+ // UNIQUEIDENTIFIER fixed lengthLimit (300)
12768
+ return { lengthLimit: defaults.UNIQUEIDENTIFIER_LENGTH_LIMIT };
12769
+ case exports.EntityFieldDataType.CHOICE_SET_MULTIPLE:
12770
+ // CHOICE_SET_MULTIPLE fixed lengthLimit (4000)
12771
+ return { lengthLimit: defaults.CHOICE_SET_MULTIPLE_LENGTH_LIMIT };
12772
+ default:
12773
+ // UUID, CHOICE_SET_SINGLE, AUTO_NUMBER, DATETIME — (sqlType: { name })
12774
+ return {};
12775
+ }
12776
+ }
12531
12777
  validateName(name, context) {
12532
12778
  if (name.length < 3 || name.length > 100 || !/^[a-zA-Z]\w*$/.test(name)) {
12533
12779
  const suggestion = name.replace(/\W/g, '').replace(/^[0-9_]+/, '');
@@ -16536,6 +16782,260 @@
16536
16782
  FeedbackStatus[FeedbackStatus["Dismissed"] = 2] = "Dismissed";
16537
16783
  })(exports.FeedbackStatus || (exports.FeedbackStatus = {}));
16538
16784
 
16785
+ // Auto-generated from the OpenAPI spec — do not edit manually.
16786
+ var DocumentActionPriority;
16787
+ (function (DocumentActionPriority) {
16788
+ DocumentActionPriority["Low"] = "Low";
16789
+ DocumentActionPriority["Medium"] = "Medium";
16790
+ DocumentActionPriority["High"] = "High";
16791
+ DocumentActionPriority["Critical"] = "Critical";
16792
+ })(DocumentActionPriority || (DocumentActionPriority = {}));
16793
+ var DocumentActionStatus;
16794
+ (function (DocumentActionStatus) {
16795
+ DocumentActionStatus["Unassigned"] = "Unassigned";
16796
+ DocumentActionStatus["Pending"] = "Pending";
16797
+ DocumentActionStatus["Completed"] = "Completed";
16798
+ })(DocumentActionStatus || (DocumentActionStatus = {}));
16799
+ var DocumentActionType;
16800
+ (function (DocumentActionType) {
16801
+ DocumentActionType["Validation"] = "Validation";
16802
+ DocumentActionType["Classification"] = "Classification";
16803
+ })(DocumentActionType || (DocumentActionType = {}));
16804
+
16805
+ // Auto-generated from the OpenAPI spec — do not edit manually.
16806
+ var ProjectProperties;
16807
+ (function (ProjectProperties) {
16808
+ ProjectProperties["IsPredefined"] = "IsPredefined";
16809
+ ProjectProperties["SupportsTags"] = "SupportsTags";
16810
+ ProjectProperties["SupportsVersions"] = "SupportsVersions";
16811
+ ProjectProperties["IsSplittingEnabled"] = "IsSplittingEnabled";
16812
+ })(ProjectProperties || (ProjectProperties = {}));
16813
+ var ProjectType;
16814
+ (function (ProjectType) {
16815
+ ProjectType["Classic"] = "Classic";
16816
+ ProjectType["Modern"] = "Modern";
16817
+ ProjectType["IXP"] = "IXP";
16818
+ ProjectType["Unknown"] = "Unknown";
16819
+ })(ProjectType || (ProjectType = {}));
16820
+ var ResourceStatus;
16821
+ (function (ResourceStatus) {
16822
+ ResourceStatus["Unknown"] = "Unknown";
16823
+ ResourceStatus["NotStarted"] = "NotStarted";
16824
+ ResourceStatus["ExportInProgress"] = "ExportInProgress";
16825
+ ResourceStatus["ExportCompleted"] = "ExportCompleted";
16826
+ ResourceStatus["InProgress"] = "InProgress";
16827
+ ResourceStatus["Suspended"] = "Suspended";
16828
+ ResourceStatus["Resuming"] = "Resuming";
16829
+ ResourceStatus["Available"] = "Available";
16830
+ ResourceStatus["Error"] = "Error";
16831
+ ResourceStatus["Deleting"] = "Deleting";
16832
+ })(ResourceStatus || (ResourceStatus = {}));
16833
+ var ResourceType;
16834
+ (function (ResourceType) {
16835
+ ResourceType["Specialized"] = "Specialized";
16836
+ ResourceType["Generative"] = "Generative";
16837
+ ResourceType["Custom"] = "Custom";
16838
+ ResourceType["Unknown"] = "Unknown";
16839
+ })(ResourceType || (ResourceType = {}));
16840
+
16841
+ // Auto-generated from the OpenAPI spec — do not edit manually.
16842
+ var MarkupType;
16843
+ (function (MarkupType) {
16844
+ MarkupType["Unknown"] = "Unknown";
16845
+ MarkupType["Circled"] = "Circled";
16846
+ MarkupType["Underlined"] = "Underlined";
16847
+ MarkupType["Strikethrough"] = "Strikethrough";
16848
+ })(MarkupType || (MarkupType = {}));
16849
+ var ProcessingSource;
16850
+ (function (ProcessingSource) {
16851
+ ProcessingSource["Unknown"] = "Unknown";
16852
+ ProcessingSource["Ocr"] = "Ocr";
16853
+ ProcessingSource["Pdf"] = "Pdf";
16854
+ ProcessingSource["PlainText"] = "PlainText";
16855
+ ProcessingSource["PdfAndOcr"] = "PdfAndOcr";
16856
+ })(ProcessingSource || (ProcessingSource = {}));
16857
+ var Rotation;
16858
+ (function (Rotation) {
16859
+ Rotation["None"] = "None";
16860
+ Rotation["Rotated90"] = "Rotated90";
16861
+ Rotation["Rotated180"] = "Rotated180";
16862
+ Rotation["Rotated270"] = "Rotated270";
16863
+ Rotation["Other"] = "Other";
16864
+ })(Rotation || (Rotation = {}));
16865
+ var SectionType;
16866
+ (function (SectionType) {
16867
+ SectionType["Vertical"] = "Vertical";
16868
+ SectionType["Paragraph"] = "Paragraph";
16869
+ SectionType["Header"] = "Header";
16870
+ SectionType["Footer"] = "Footer";
16871
+ SectionType["Table"] = "Table";
16872
+ })(SectionType || (SectionType = {}));
16873
+ var TextType;
16874
+ (function (TextType) {
16875
+ TextType["Unknown"] = "Unknown";
16876
+ TextType["Text"] = "Text";
16877
+ TextType["Checkbox"] = "Checkbox";
16878
+ TextType["Handwriting"] = "Handwriting";
16879
+ TextType["Barcode"] = "Barcode";
16880
+ TextType["QRcode"] = "QRcode";
16881
+ TextType["Stamp"] = "Stamp";
16882
+ TextType["Logo"] = "Logo";
16883
+ TextType["Circle"] = "Circle";
16884
+ TextType["Underline"] = "Underline";
16885
+ TextType["Cut"] = "Cut";
16886
+ })(TextType || (TextType = {}));
16887
+ var WordGroupType;
16888
+ (function (WordGroupType) {
16889
+ WordGroupType["Sentence"] = "Sentence";
16890
+ WordGroupType["TableCell"] = "TableCell";
16891
+ WordGroupType["TableRowEnd"] = "TableRowEnd";
16892
+ WordGroupType["Heading"] = "Heading";
16893
+ WordGroupType["Other"] = "Other";
16894
+ })(WordGroupType || (WordGroupType = {}));
16895
+
16896
+ // Auto-generated from the OpenAPI spec — do not edit manually.
16897
+ var ModelKind;
16898
+ (function (ModelKind) {
16899
+ ModelKind["Classifier"] = "Classifier";
16900
+ ModelKind["Extractor"] = "Extractor";
16901
+ })(ModelKind || (ModelKind = {}));
16902
+ var ModelType;
16903
+ (function (ModelType) {
16904
+ ModelType["IXP"] = "IXP";
16905
+ ModelType["Modern"] = "Modern";
16906
+ ModelType["Predefined"] = "Predefined";
16907
+ })(ModelType || (ModelType = {}));
16908
+
16909
+ // Auto-generated from the OpenAPI spec — do not edit manually.
16910
+ var ClassifierDocumentTypeType;
16911
+ (function (ClassifierDocumentTypeType) {
16912
+ ClassifierDocumentTypeType["FormsAi"] = "FormsAi";
16913
+ ClassifierDocumentTypeType["SemiStructuredAi"] = "SemiStructuredAi";
16914
+ ClassifierDocumentTypeType["Helix"] = "Helix";
16915
+ ClassifierDocumentTypeType["Unknown"] = "Unknown";
16916
+ })(ClassifierDocumentTypeType || (ClassifierDocumentTypeType = {}));
16917
+ var CreateTaskPriority;
16918
+ (function (CreateTaskPriority) {
16919
+ CreateTaskPriority["Low"] = "Low";
16920
+ CreateTaskPriority["Medium"] = "Medium";
16921
+ CreateTaskPriority["High"] = "High";
16922
+ CreateTaskPriority["Critical"] = "Critical";
16923
+ })(CreateTaskPriority || (CreateTaskPriority = {}));
16924
+ var GptFieldType;
16925
+ (function (GptFieldType) {
16926
+ GptFieldType["Address"] = "Address";
16927
+ GptFieldType["Boolean"] = "Boolean";
16928
+ GptFieldType["Date"] = "Date";
16929
+ GptFieldType["Name"] = "Name";
16930
+ GptFieldType["Number"] = "Number";
16931
+ GptFieldType["Text"] = "Text";
16932
+ })(GptFieldType || (GptFieldType = {}));
16933
+ var ValidationDisplayMode;
16934
+ (function (ValidationDisplayMode) {
16935
+ ValidationDisplayMode["Classic"] = "Classic";
16936
+ ValidationDisplayMode["Compact"] = "Compact";
16937
+ })(ValidationDisplayMode || (ValidationDisplayMode = {}));
16938
+
16939
+ // Auto-generated from the OpenAPI spec — do not edit manually.
16940
+ var ResultsDataSource;
16941
+ (function (ResultsDataSource) {
16942
+ ResultsDataSource["Automatic"] = "Automatic";
16943
+ ResultsDataSource["Manual"] = "Manual";
16944
+ ResultsDataSource["ManuallyChanged"] = "ManuallyChanged";
16945
+ ResultsDataSource["Defaulted"] = "Defaulted";
16946
+ ResultsDataSource["External"] = "External";
16947
+ })(ResultsDataSource || (ResultsDataSource = {}));
16948
+
16949
+ // Auto-generated from the OpenAPI spec — do not edit manually.
16950
+ var ComparisonOperator;
16951
+ (function (ComparisonOperator) {
16952
+ ComparisonOperator["Equals"] = "Equals";
16953
+ ComparisonOperator["NotEquals"] = "NotEquals";
16954
+ ComparisonOperator["Greater"] = "Greater";
16955
+ ComparisonOperator["Less"] = "Less";
16956
+ ComparisonOperator["GreaterOrEqual"] = "GreaterOrEqual";
16957
+ ComparisonOperator["LessOrEqual"] = "LessOrEqual";
16958
+ })(ComparisonOperator || (ComparisonOperator = {}));
16959
+ var Criticality;
16960
+ (function (Criticality) {
16961
+ Criticality["Must"] = "Must";
16962
+ Criticality["Should"] = "Should";
16963
+ })(Criticality || (Criticality = {}));
16964
+ var FieldType;
16965
+ (function (FieldType) {
16966
+ FieldType["Text"] = "Text";
16967
+ FieldType["Number"] = "Number";
16968
+ FieldType["Date"] = "Date";
16969
+ FieldType["Name"] = "Name";
16970
+ FieldType["Address"] = "Address";
16971
+ FieldType["Keyword"] = "Keyword";
16972
+ FieldType["Set"] = "Set";
16973
+ FieldType["Boolean"] = "Boolean";
16974
+ FieldType["Table"] = "Table";
16975
+ FieldType["Internal"] = "Internal";
16976
+ FieldType["FieldGroup"] = "FieldGroup";
16977
+ FieldType["MonetaryQuantity"] = "MonetaryQuantity";
16978
+ })(FieldType || (FieldType = {}));
16979
+ var LogicalOperator;
16980
+ (function (LogicalOperator) {
16981
+ LogicalOperator["AND"] = "AND";
16982
+ LogicalOperator["OR"] = "OR";
16983
+ })(LogicalOperator || (LogicalOperator = {}));
16984
+ var RuleType;
16985
+ (function (RuleType) {
16986
+ RuleType["Mandatory"] = "Mandatory";
16987
+ RuleType["PossibleValues"] = "PossibleValues";
16988
+ RuleType["Regex"] = "Regex";
16989
+ RuleType["StartsWith"] = "StartsWith";
16990
+ RuleType["EndsWith"] = "EndsWith";
16991
+ RuleType["FixedLength"] = "FixedLength";
16992
+ RuleType["IsNumeric"] = "IsNumeric";
16993
+ RuleType["IsDate"] = "IsDate";
16994
+ RuleType["IsEmail"] = "IsEmail";
16995
+ RuleType["Contains"] = "Contains";
16996
+ RuleType["Expression"] = "Expression";
16997
+ RuleType["TableExpression"] = "TableExpression";
16998
+ RuleType["IsEmpty"] = "IsEmpty";
16999
+ })(RuleType || (RuleType = {}));
17000
+
17001
+ // Auto-generated from the OpenAPI spec — do not edit manually.
17002
+ var ActionStatus;
17003
+ (function (ActionStatus) {
17004
+ ActionStatus["Unassigned"] = "Unassigned";
17005
+ ActionStatus["Pending"] = "Pending";
17006
+ ActionStatus["Completed"] = "Completed";
17007
+ })(ActionStatus || (ActionStatus = {}));
17008
+
17009
+ var index = /*#__PURE__*/Object.freeze({
17010
+ __proto__: null,
17011
+ get ActionStatus () { return ActionStatus; },
17012
+ get ClassifierDocumentTypeType () { return ClassifierDocumentTypeType; },
17013
+ get ComparisonOperator () { return ComparisonOperator; },
17014
+ get CreateTaskPriority () { return CreateTaskPriority; },
17015
+ get Criticality () { return Criticality; },
17016
+ get DocumentActionPriority () { return DocumentActionPriority; },
17017
+ get DocumentActionStatus () { return DocumentActionStatus; },
17018
+ get DocumentActionType () { return DocumentActionType; },
17019
+ get FieldType () { return FieldType; },
17020
+ get GptFieldType () { return GptFieldType; },
17021
+ get LogicalOperator () { return LogicalOperator; },
17022
+ get MarkupType () { return MarkupType; },
17023
+ get ModelKind () { return ModelKind; },
17024
+ get ModelType () { return ModelType; },
17025
+ get ProcessingSource () { return ProcessingSource; },
17026
+ get ProjectProperties () { return ProjectProperties; },
17027
+ get ProjectType () { return ProjectType; },
17028
+ get ResourceStatus () { return ResourceStatus; },
17029
+ get ResourceType () { return ResourceType; },
17030
+ get ResultsDataSource () { return ResultsDataSource; },
17031
+ get Rotation () { return Rotation; },
17032
+ get RuleType () { return RuleType; },
17033
+ get SectionType () { return SectionType; },
17034
+ get TextType () { return TextType; },
17035
+ get ValidationDisplayMode () { return ValidationDisplayMode; },
17036
+ get WordGroupType () { return WordGroupType; }
17037
+ });
17038
+
16539
17039
  /**
16540
17040
  * Asset resolution utilities for UiPath Coded Apps
16541
17041
  *
@@ -16626,6 +17126,7 @@
16626
17126
  exports.DEFAULT_ITEMS_FIELD = DEFAULT_ITEMS_FIELD;
16627
17127
  exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE;
16628
17128
  exports.DEFAULT_TOTAL_COUNT_FIELD = DEFAULT_TOTAL_COUNT_FIELD;
17129
+ exports.DuFramework = index;
16629
17130
  exports.ErrorType = ErrorType;
16630
17131
  exports.ExchangeMap = ExchangeMap;
16631
17132
  exports.HttpStatus = HttpStatus;