@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
@@ -0,0 +1,255 @@
1
+ // Auto-generated from the OpenAPI spec — do not edit manually.
2
+ var DocumentActionPriority;
3
+ (function (DocumentActionPriority) {
4
+ DocumentActionPriority["Low"] = "Low";
5
+ DocumentActionPriority["Medium"] = "Medium";
6
+ DocumentActionPriority["High"] = "High";
7
+ DocumentActionPriority["Critical"] = "Critical";
8
+ })(DocumentActionPriority || (DocumentActionPriority = {}));
9
+ var DocumentActionStatus;
10
+ (function (DocumentActionStatus) {
11
+ DocumentActionStatus["Unassigned"] = "Unassigned";
12
+ DocumentActionStatus["Pending"] = "Pending";
13
+ DocumentActionStatus["Completed"] = "Completed";
14
+ })(DocumentActionStatus || (DocumentActionStatus = {}));
15
+ var DocumentActionType;
16
+ (function (DocumentActionType) {
17
+ DocumentActionType["Validation"] = "Validation";
18
+ DocumentActionType["Classification"] = "Classification";
19
+ })(DocumentActionType || (DocumentActionType = {}));
20
+
21
+ // Auto-generated from the OpenAPI spec — do not edit manually.
22
+ var ProjectProperties;
23
+ (function (ProjectProperties) {
24
+ ProjectProperties["IsPredefined"] = "IsPredefined";
25
+ ProjectProperties["SupportsTags"] = "SupportsTags";
26
+ ProjectProperties["SupportsVersions"] = "SupportsVersions";
27
+ ProjectProperties["IsSplittingEnabled"] = "IsSplittingEnabled";
28
+ })(ProjectProperties || (ProjectProperties = {}));
29
+ var ProjectType;
30
+ (function (ProjectType) {
31
+ ProjectType["Classic"] = "Classic";
32
+ ProjectType["Modern"] = "Modern";
33
+ ProjectType["IXP"] = "IXP";
34
+ ProjectType["Unknown"] = "Unknown";
35
+ })(ProjectType || (ProjectType = {}));
36
+ var ResourceStatus;
37
+ (function (ResourceStatus) {
38
+ ResourceStatus["Unknown"] = "Unknown";
39
+ ResourceStatus["NotStarted"] = "NotStarted";
40
+ ResourceStatus["ExportInProgress"] = "ExportInProgress";
41
+ ResourceStatus["ExportCompleted"] = "ExportCompleted";
42
+ ResourceStatus["InProgress"] = "InProgress";
43
+ ResourceStatus["Suspended"] = "Suspended";
44
+ ResourceStatus["Resuming"] = "Resuming";
45
+ ResourceStatus["Available"] = "Available";
46
+ ResourceStatus["Error"] = "Error";
47
+ ResourceStatus["Deleting"] = "Deleting";
48
+ })(ResourceStatus || (ResourceStatus = {}));
49
+ var ResourceType;
50
+ (function (ResourceType) {
51
+ ResourceType["Specialized"] = "Specialized";
52
+ ResourceType["Generative"] = "Generative";
53
+ ResourceType["Custom"] = "Custom";
54
+ ResourceType["Unknown"] = "Unknown";
55
+ })(ResourceType || (ResourceType = {}));
56
+
57
+ // Auto-generated from the OpenAPI spec — do not edit manually.
58
+ var MarkupType;
59
+ (function (MarkupType) {
60
+ MarkupType["Unknown"] = "Unknown";
61
+ MarkupType["Circled"] = "Circled";
62
+ MarkupType["Underlined"] = "Underlined";
63
+ MarkupType["Strikethrough"] = "Strikethrough";
64
+ })(MarkupType || (MarkupType = {}));
65
+ var ProcessingSource;
66
+ (function (ProcessingSource) {
67
+ ProcessingSource["Unknown"] = "Unknown";
68
+ ProcessingSource["Ocr"] = "Ocr";
69
+ ProcessingSource["Pdf"] = "Pdf";
70
+ ProcessingSource["PlainText"] = "PlainText";
71
+ ProcessingSource["PdfAndOcr"] = "PdfAndOcr";
72
+ })(ProcessingSource || (ProcessingSource = {}));
73
+ var Rotation;
74
+ (function (Rotation) {
75
+ Rotation["None"] = "None";
76
+ Rotation["Rotated90"] = "Rotated90";
77
+ Rotation["Rotated180"] = "Rotated180";
78
+ Rotation["Rotated270"] = "Rotated270";
79
+ Rotation["Other"] = "Other";
80
+ })(Rotation || (Rotation = {}));
81
+ var SectionType;
82
+ (function (SectionType) {
83
+ SectionType["Vertical"] = "Vertical";
84
+ SectionType["Paragraph"] = "Paragraph";
85
+ SectionType["Header"] = "Header";
86
+ SectionType["Footer"] = "Footer";
87
+ SectionType["Table"] = "Table";
88
+ })(SectionType || (SectionType = {}));
89
+ var TextType;
90
+ (function (TextType) {
91
+ TextType["Unknown"] = "Unknown";
92
+ TextType["Text"] = "Text";
93
+ TextType["Checkbox"] = "Checkbox";
94
+ TextType["Handwriting"] = "Handwriting";
95
+ TextType["Barcode"] = "Barcode";
96
+ TextType["QRcode"] = "QRcode";
97
+ TextType["Stamp"] = "Stamp";
98
+ TextType["Logo"] = "Logo";
99
+ TextType["Circle"] = "Circle";
100
+ TextType["Underline"] = "Underline";
101
+ TextType["Cut"] = "Cut";
102
+ })(TextType || (TextType = {}));
103
+ var WordGroupType;
104
+ (function (WordGroupType) {
105
+ WordGroupType["Sentence"] = "Sentence";
106
+ WordGroupType["TableCell"] = "TableCell";
107
+ WordGroupType["TableRowEnd"] = "TableRowEnd";
108
+ WordGroupType["Heading"] = "Heading";
109
+ WordGroupType["Other"] = "Other";
110
+ })(WordGroupType || (WordGroupType = {}));
111
+
112
+ // Auto-generated from the OpenAPI spec — do not edit manually.
113
+ var ModelKind;
114
+ (function (ModelKind) {
115
+ ModelKind["Classifier"] = "Classifier";
116
+ ModelKind["Extractor"] = "Extractor";
117
+ })(ModelKind || (ModelKind = {}));
118
+ var ModelType;
119
+ (function (ModelType) {
120
+ ModelType["IXP"] = "IXP";
121
+ ModelType["Modern"] = "Modern";
122
+ ModelType["Predefined"] = "Predefined";
123
+ })(ModelType || (ModelType = {}));
124
+
125
+ // Auto-generated from the OpenAPI spec — do not edit manually.
126
+ var ClassifierDocumentTypeType;
127
+ (function (ClassifierDocumentTypeType) {
128
+ ClassifierDocumentTypeType["FormsAi"] = "FormsAi";
129
+ ClassifierDocumentTypeType["SemiStructuredAi"] = "SemiStructuredAi";
130
+ ClassifierDocumentTypeType["Helix"] = "Helix";
131
+ ClassifierDocumentTypeType["Unknown"] = "Unknown";
132
+ })(ClassifierDocumentTypeType || (ClassifierDocumentTypeType = {}));
133
+ var CreateTaskPriority;
134
+ (function (CreateTaskPriority) {
135
+ CreateTaskPriority["Low"] = "Low";
136
+ CreateTaskPriority["Medium"] = "Medium";
137
+ CreateTaskPriority["High"] = "High";
138
+ CreateTaskPriority["Critical"] = "Critical";
139
+ })(CreateTaskPriority || (CreateTaskPriority = {}));
140
+ var GptFieldType;
141
+ (function (GptFieldType) {
142
+ GptFieldType["Address"] = "Address";
143
+ GptFieldType["Boolean"] = "Boolean";
144
+ GptFieldType["Date"] = "Date";
145
+ GptFieldType["Name"] = "Name";
146
+ GptFieldType["Number"] = "Number";
147
+ GptFieldType["Text"] = "Text";
148
+ })(GptFieldType || (GptFieldType = {}));
149
+ var ValidationDisplayMode;
150
+ (function (ValidationDisplayMode) {
151
+ ValidationDisplayMode["Classic"] = "Classic";
152
+ ValidationDisplayMode["Compact"] = "Compact";
153
+ })(ValidationDisplayMode || (ValidationDisplayMode = {}));
154
+
155
+ // Auto-generated from the OpenAPI spec — do not edit manually.
156
+ var ResultsDataSource;
157
+ (function (ResultsDataSource) {
158
+ ResultsDataSource["Automatic"] = "Automatic";
159
+ ResultsDataSource["Manual"] = "Manual";
160
+ ResultsDataSource["ManuallyChanged"] = "ManuallyChanged";
161
+ ResultsDataSource["Defaulted"] = "Defaulted";
162
+ ResultsDataSource["External"] = "External";
163
+ })(ResultsDataSource || (ResultsDataSource = {}));
164
+
165
+ // Auto-generated from the OpenAPI spec — do not edit manually.
166
+ var ComparisonOperator;
167
+ (function (ComparisonOperator) {
168
+ ComparisonOperator["Equals"] = "Equals";
169
+ ComparisonOperator["NotEquals"] = "NotEquals";
170
+ ComparisonOperator["Greater"] = "Greater";
171
+ ComparisonOperator["Less"] = "Less";
172
+ ComparisonOperator["GreaterOrEqual"] = "GreaterOrEqual";
173
+ ComparisonOperator["LessOrEqual"] = "LessOrEqual";
174
+ })(ComparisonOperator || (ComparisonOperator = {}));
175
+ var Criticality;
176
+ (function (Criticality) {
177
+ Criticality["Must"] = "Must";
178
+ Criticality["Should"] = "Should";
179
+ })(Criticality || (Criticality = {}));
180
+ var FieldType;
181
+ (function (FieldType) {
182
+ FieldType["Text"] = "Text";
183
+ FieldType["Number"] = "Number";
184
+ FieldType["Date"] = "Date";
185
+ FieldType["Name"] = "Name";
186
+ FieldType["Address"] = "Address";
187
+ FieldType["Keyword"] = "Keyword";
188
+ FieldType["Set"] = "Set";
189
+ FieldType["Boolean"] = "Boolean";
190
+ FieldType["Table"] = "Table";
191
+ FieldType["Internal"] = "Internal";
192
+ FieldType["FieldGroup"] = "FieldGroup";
193
+ FieldType["MonetaryQuantity"] = "MonetaryQuantity";
194
+ })(FieldType || (FieldType = {}));
195
+ var LogicalOperator;
196
+ (function (LogicalOperator) {
197
+ LogicalOperator["AND"] = "AND";
198
+ LogicalOperator["OR"] = "OR";
199
+ })(LogicalOperator || (LogicalOperator = {}));
200
+ var RuleType;
201
+ (function (RuleType) {
202
+ RuleType["Mandatory"] = "Mandatory";
203
+ RuleType["PossibleValues"] = "PossibleValues";
204
+ RuleType["Regex"] = "Regex";
205
+ RuleType["StartsWith"] = "StartsWith";
206
+ RuleType["EndsWith"] = "EndsWith";
207
+ RuleType["FixedLength"] = "FixedLength";
208
+ RuleType["IsNumeric"] = "IsNumeric";
209
+ RuleType["IsDate"] = "IsDate";
210
+ RuleType["IsEmail"] = "IsEmail";
211
+ RuleType["Contains"] = "Contains";
212
+ RuleType["Expression"] = "Expression";
213
+ RuleType["TableExpression"] = "TableExpression";
214
+ RuleType["IsEmpty"] = "IsEmpty";
215
+ })(RuleType || (RuleType = {}));
216
+
217
+ // Auto-generated from the OpenAPI spec — do not edit manually.
218
+ var ActionStatus;
219
+ (function (ActionStatus) {
220
+ ActionStatus["Unassigned"] = "Unassigned";
221
+ ActionStatus["Pending"] = "Pending";
222
+ ActionStatus["Completed"] = "Completed";
223
+ })(ActionStatus || (ActionStatus = {}));
224
+
225
+ var index = /*#__PURE__*/Object.freeze({
226
+ __proto__: null,
227
+ get ActionStatus () { return ActionStatus; },
228
+ get ClassifierDocumentTypeType () { return ClassifierDocumentTypeType; },
229
+ get ComparisonOperator () { return ComparisonOperator; },
230
+ get CreateTaskPriority () { return CreateTaskPriority; },
231
+ get Criticality () { return Criticality; },
232
+ get DocumentActionPriority () { return DocumentActionPriority; },
233
+ get DocumentActionStatus () { return DocumentActionStatus; },
234
+ get DocumentActionType () { return DocumentActionType; },
235
+ get FieldType () { return FieldType; },
236
+ get GptFieldType () { return GptFieldType; },
237
+ get LogicalOperator () { return LogicalOperator; },
238
+ get MarkupType () { return MarkupType; },
239
+ get ModelKind () { return ModelKind; },
240
+ get ModelType () { return ModelType; },
241
+ get ProcessingSource () { return ProcessingSource; },
242
+ get ProjectProperties () { return ProjectProperties; },
243
+ get ProjectType () { return ProjectType; },
244
+ get ResourceStatus () { return ResourceStatus; },
245
+ get ResourceType () { return ResourceType; },
246
+ get ResultsDataSource () { return ResultsDataSource; },
247
+ get Rotation () { return Rotation; },
248
+ get RuleType () { return RuleType; },
249
+ get SectionType () { return SectionType; },
250
+ get TextType () { return TextType; },
251
+ get ValidationDisplayMode () { return ValidationDisplayMode; },
252
+ get WordGroupType () { return WordGroupType; }
253
+ });
254
+
255
+ export { index as DuFramework };
@@ -506,6 +506,8 @@ class ErrorFactory {
506
506
  }
507
507
 
508
508
  const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
509
+ const TRACEPARENT = 'traceparent';
510
+ const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
509
511
  /**
510
512
  * Content type constants for HTTP requests/responses
511
513
  */
@@ -559,8 +561,13 @@ class ApiClient {
559
561
  if (isFormData) {
560
562
  delete defaultHeaders['Content-Type'];
561
563
  }
564
+ const traceId = crypto.randomUUID().replace(/-/g, '');
565
+ const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
566
+ const traceparentValue = `00-${traceId}-${spanId}-01`;
562
567
  const headers = {
563
568
  ...defaultHeaders,
569
+ [TRACEPARENT]: traceparentValue,
570
+ [UIPATH_TRACEPARENT_ID]: traceparentValue,
564
571
  ...options.headers
565
572
  };
566
573
  // Convert params to URLSearchParams
@@ -1669,6 +1676,13 @@ function createEntityMethods(entityData, service) {
1669
1676
  throw new Error('Entity ID is undefined');
1670
1677
  return service.deleteRecordsById(entityData.id, recordIds, options);
1671
1678
  },
1679
+ async deleteRecord(recordId) {
1680
+ if (!entityData.id)
1681
+ throw new Error('Entity ID is undefined');
1682
+ if (!recordId)
1683
+ throw new Error('Record ID is undefined');
1684
+ return service.deleteRecordById(entityData.id, recordId);
1685
+ },
1672
1686
  async getAllRecords(options) {
1673
1687
  if (!entityData.id)
1674
1688
  throw new Error('Entity ID is undefined');
@@ -1863,6 +1877,7 @@ const DATA_FABRIC_ENDPOINTS = {
1863
1877
  BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
1864
1878
  UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
1865
1879
  UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
1880
+ DELETE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete/${recordId}`,
1866
1881
  DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
1867
1882
  UPSERT: `${DATAFABRIC_BASE}/api/Entity`,
1868
1883
  DELETE: (entityId) => `${DATAFABRIC_BASE}/api/Entity/${entityId}`,
@@ -1914,6 +1929,20 @@ function createParams(paramsObj = {}) {
1914
1929
  return params;
1915
1930
  }
1916
1931
 
1932
+ /**
1933
+ * Names of the per-field SQL constraint properties (i.e. the contents of `sqlType`
1934
+ * excluding its `name`). Used internally to validate user-supplied constraints
1935
+ * against the set of constraints that each `EntityFieldDataType` accepts.
1936
+ *
1937
+ * Enum values match the corresponding property names on `EntityCreateFieldOptions`.
1938
+ */
1939
+ var EntityFieldConstraint;
1940
+ (function (EntityFieldConstraint) {
1941
+ EntityFieldConstraint["LengthLimit"] = "lengthLimit";
1942
+ EntityFieldConstraint["MaxValue"] = "maxValue";
1943
+ EntityFieldConstraint["MinValue"] = "minValue";
1944
+ EntityFieldConstraint["DecimalPrecision"] = "decimalPrecision";
1945
+ })(EntityFieldConstraint || (EntityFieldConstraint = {}));
1917
1946
  /**
1918
1947
  * Entity field data types (SQL types from API)
1919
1948
  */
@@ -1976,6 +2005,70 @@ const FieldDisplayTypeToDataType = {
1976
2005
  [exports.FieldDisplayType.AutoNumber]: exports.EntityFieldDataType.AUTO_NUMBER,
1977
2006
  [exports.FieldDisplayType.Relationship]: exports.EntityFieldDataType.RELATIONSHIP,
1978
2007
  };
2008
+ /**
2009
+ * Default and fixed sqlType constraint values applied when the user does not provide them.
2010
+ * The API requires these to be present on field creation — without them the field
2011
+ * is stored in an incomplete state, causing "Field type cannot be changed" errors
2012
+ * when the UI later tries to edit advanced options.
2013
+ */
2014
+ const ENTITY_FIELD_CONSTRAINT_DEFAULTS = {
2015
+ STRING_LENGTH_LIMIT: 200,
2016
+ MULTILINE_TEXT_LENGTH_LIMIT: 200,
2017
+ /** Fixed (non-overridable) length limit on DECIMAL payloads*/
2018
+ DECIMAL_LENGTH_LIMIT: 1000,
2019
+ DECIMAL_PRECISION: 2,
2020
+ /** Fixed (non-overridable) length limit for BIT (BOOLEAN) fields */
2021
+ BOOLEAN_LENGTH_LIMIT: 100,
2022
+ /** Fixed (non-overridable) length limit for DATE / DATETIMEOFFSET fields */
2023
+ DATE_LENGTH_LIMIT: 1000,
2024
+ /** Fixed (non-overridable) length limit for UNIQUEIDENTIFIER-backed FILE and RELATIONSHIP fields */
2025
+ UNIQUEIDENTIFIER_LENGTH_LIMIT: 300,
2026
+ /** Fixed (non-overridable) length limit for CHOICE_SET_MULTIPLE fields */
2027
+ CHOICE_SET_MULTIPLE_LENGTH_LIMIT: 4000,
2028
+ NUMERIC_MAX_VALUE: 1000000000000,
2029
+ NUMERIC_MIN_VALUE: -1e12,
2030
+ };
2031
+ /**
2032
+ * Per-field-type spec describing which {@link EntityFieldConstraint}s the user
2033
+ * may supply on create / update, and the inclusive value range for each.
2034
+ *
2035
+ * Source of truth: the platform's `Constants.cs` constraint table. Keys absent
2036
+ * from a type's spec are not user-configurable for that type; passing one
2037
+ * throws a `ValidationError`. Field types absent from this map (BOOLEAN, DATE,
2038
+ * DATETIME, DATETIME_WITH_TZ, FILE, RELATIONSHIP, UUID, CHOICE_SET_SINGLE,
2039
+ * CHOICE_SET_MULTIPLE, AUTO_NUMBER) accept no user-supplied constraints.
2040
+ */
2041
+ const ENTITY_FIELD_CONSTRAINT_SPEC = {
2042
+ [exports.EntityFieldDataType.STRING]: {
2043
+ [EntityFieldConstraint.LengthLimit]: { min: 1, max: 4000 },
2044
+ },
2045
+ [exports.EntityFieldDataType.MULTILINE_TEXT]: {
2046
+ [EntityFieldConstraint.LengthLimit]: { min: 1, max: 10000 },
2047
+ },
2048
+ [exports.EntityFieldDataType.INTEGER]: {
2049
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
2050
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
2051
+ },
2052
+ [exports.EntityFieldDataType.BIG_INTEGER]: {
2053
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
2054
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
2055
+ },
2056
+ [exports.EntityFieldDataType.DECIMAL]: {
2057
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
2058
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
2059
+ [EntityFieldConstraint.DecimalPrecision]: { min: 0, max: 10 },
2060
+ },
2061
+ [exports.EntityFieldDataType.FLOAT]: {
2062
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
2063
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
2064
+ [EntityFieldConstraint.DecimalPrecision]: { min: 0, max: 10 },
2065
+ },
2066
+ [exports.EntityFieldDataType.DOUBLE]: {
2067
+ [EntityFieldConstraint.MaxValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
2068
+ [EntityFieldConstraint.MinValue]: { min: -Number.MAX_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER },
2069
+ [EntityFieldConstraint.DecimalPrecision]: { min: 0, max: 10 },
2070
+ },
2071
+ };
1979
2072
  /**
1980
2073
  * Maps SQL field types to friendly display names
1981
2074
  */
@@ -2000,7 +2093,7 @@ const EntityFieldTypeMap = {
2000
2093
  // Connection string placeholder that will be replaced during build
2001
2094
  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";
2002
2095
  // SDK Version placeholder
2003
- const SDK_VERSION = "1.3.3";
2096
+ const SDK_VERSION = "1.3.5";
2004
2097
  const VERSION = "Version";
2005
2098
  const SERVICE = "Service";
2006
2099
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -2538,6 +2631,8 @@ class EntityService extends BaseService {
2538
2631
  /**
2539
2632
  * Deletes data from an entity by entity ID
2540
2633
  *
2634
+ * 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.
2635
+ *
2541
2636
  * @param entityId - UUID of the entity
2542
2637
  * @param recordIds - Array of record UUIDs to delete
2543
2638
  * @param options - Delete options
@@ -2565,6 +2660,27 @@ class EntityService extends BaseService {
2565
2660
  });
2566
2661
  return response.data;
2567
2662
  }
2663
+ /**
2664
+ * Deletes a single record from an entity by entity ID and record ID
2665
+ *
2666
+ * Note: Data Fabric supports trigger events only on individual deletes, not on deleting multiple records.
2667
+ * Use this method if you need trigger events to fire for the deleted record.
2668
+ *
2669
+ * @param entityId - UUID of the entity
2670
+ * @param recordId - UUID of the record to delete
2671
+ * @returns Promise resolving to void on success
2672
+ * @example
2673
+ * ```typescript
2674
+ * import { Entities } from '@uipath/uipath-typescript/entities';
2675
+ *
2676
+ * const entities = new Entities(sdk);
2677
+ *
2678
+ * await entities.deleteRecordById("<entityId>", "<recordId>");
2679
+ * ```
2680
+ */
2681
+ async deleteRecordById(entityId, recordId) {
2682
+ await this.delete(DATA_FABRIC_ENDPOINTS.ENTITY.DELETE_RECORD_BY_ID(entityId, recordId));
2683
+ }
2568
2684
  /**
2569
2685
  * Gets all entities in the system
2570
2686
  *
@@ -2826,6 +2942,13 @@ class EntityService extends BaseService {
2826
2942
  * { fieldName: "product_name", type: EntityFieldDataType.STRING, isRequired: true, isUnique: true },
2827
2943
  * { fieldName: "price", type: EntityFieldDataType.INTEGER, defaultValue: "0" },
2828
2944
  * ], { displayName: "Product Catalog", description: "Our product catalog", isRbacEnabled: true });
2945
+ *
2946
+ * // With advanced sqlType constraints (lengthLimit, decimalPrecision, maxValue, minValue) and defaultValue
2947
+ * const ordersId = await entities.create("orders", [
2948
+ * { fieldName: "product_name", type: EntityFieldDataType.STRING, isRequired: true, isUnique: true, lengthLimit: 500 },
2949
+ * { fieldName: "price", type: EntityFieldDataType.DECIMAL, decimalPrecision: 4, maxValue: 999999, minValue: 0 },
2950
+ * { fieldName: "quantity", type: EntityFieldDataType.INTEGER, maxValue: 10000, minValue: 1, defaultValue: "0" },
2951
+ * ]);
2829
2952
  * ```
2830
2953
  * @internal
2831
2954
  */
@@ -2899,6 +3022,17 @@ class EntityService extends BaseService {
2899
3022
  * updateFields: [{ id: "<fieldId>", displayName: "Unit Price", isRequired: true }],
2900
3023
  * displayName: "Price Catalog",
2901
3024
  * });
3025
+ *
3026
+ * // Add a STRING/DECIMAL field with explicit advanced sqlType constraints and defaultValue
3027
+ * await entities.updateById("<entityId>", {
3028
+ * addFields: [
3029
+ * { fieldName: "summary", type: EntityFieldDataType.STRING, lengthLimit: 500, defaultValue: "summary" },
3030
+ * { fieldName: "amount", type: EntityFieldDataType.DECIMAL, decimalPrecision: 4, maxValue: 999999, minValue: 0 },
3031
+ * ],
3032
+ * updateFields: [
3033
+ * { id: "<fieldId>", lengthLimit: 1000 },
3034
+ * ],
3035
+ * });
2902
3036
  * ```
2903
3037
  * @internal
2904
3038
  */
@@ -2942,6 +3076,21 @@ class EntityService extends BaseService {
2942
3076
  const update = updateMap.get(f.id ?? '');
2943
3077
  if (!update)
2944
3078
  return f;
3079
+ const constraintUpdate = {
3080
+ ...(update.lengthLimit !== undefined && { lengthLimit: update.lengthLimit }),
3081
+ ...(update.maxValue !== undefined && { maxValue: update.maxValue }),
3082
+ ...(update.minValue !== undefined && { minValue: update.minValue }),
3083
+ ...(update.decimalPrecision !== undefined && { decimalPrecision: update.decimalPrecision }),
3084
+ };
3085
+ const hasConstraintUpdate = Object.keys(constraintUpdate).length > 0;
3086
+ if (hasConstraintUpdate) {
3087
+ if (!f.sqlType) {
3088
+ throw new ValidationError({
3089
+ message: `Cannot update constraints on field '${f.name}' (id: ${f.id}) — the field is missing sqlType metadata in the entity definition.`,
3090
+ });
3091
+ }
3092
+ this.validateFieldConstraints(this.resolveFieldDataType(f), update, f.name);
3093
+ }
2945
3094
  return {
2946
3095
  ...f,
2947
3096
  ...(update.displayName !== undefined && { displayName: update.displayName }),
@@ -2951,6 +3100,7 @@ class EntityService extends BaseService {
2951
3100
  ...(update.isRbacEnabled !== undefined && { isRbacEnabled: update.isRbacEnabled }),
2952
3101
  ...(update.isEncrypted !== undefined && { isEncrypted: update.isEncrypted }),
2953
3102
  ...(update.defaultValue !== undefined && { defaultValue: update.defaultValue }),
3103
+ ...(hasConstraintUpdate && f.sqlType && { sqlType: { ...f.sqlType, ...constraintUpdate } }),
2954
3104
  };
2955
3105
  });
2956
3106
  }
@@ -3000,24 +3150,27 @@ class EntityService extends BaseService {
3000
3150
  let transformedField = transformData(field, EntityMap);
3001
3151
  // Map field type: prefer fieldDisplayType for types that share SQL types (File, ChoiceSet, AutoNumber)
3002
3152
  if (transformedField.fieldDataType?.name) {
3003
- const displayTypeMapped = transformedField.fieldDisplayType
3004
- ? FieldDisplayTypeToDataType[transformedField.fieldDisplayType]
3005
- : undefined;
3006
- if (displayTypeMapped) {
3007
- transformedField.fieldDataType.name = displayTypeMapped;
3008
- }
3009
- else {
3010
- const rawSqlTypeName = field.sqlType?.name;
3011
- const mapped = rawSqlTypeName ? EntityFieldTypeMap[rawSqlTypeName] : undefined;
3012
- if (mapped) {
3013
- transformedField.fieldDataType.name = mapped;
3014
- }
3153
+ const mapped = this.tryResolveFieldDataType(transformedField.fieldDisplayType, field.sqlType?.name);
3154
+ if (mapped) {
3155
+ transformedField.fieldDataType.name = mapped;
3015
3156
  }
3016
3157
  }
3017
3158
  this.transformNestedReferences(transformedField);
3018
3159
  return transformedField;
3019
3160
  });
3020
3161
  }
3162
+ /**
3163
+ * Resolves an {@link EntityFieldDataType} from a field's `fieldDisplayType` and
3164
+ * raw SQL type name. Prefers `fieldDisplayType` to disambiguate types that
3165
+ * share a SQL type (FILE, CHOICE_SET_*, AUTO_NUMBER, RELATIONSHIP); falls back
3166
+ * to the SQL-type-name mapping. Returns `undefined` if neither resolves.
3167
+ */
3168
+ tryResolveFieldDataType(fieldDisplayType, sqlTypeName) {
3169
+ const displayMapped = fieldDisplayType ? FieldDisplayTypeToDataType[fieldDisplayType] : undefined;
3170
+ if (displayMapped)
3171
+ return displayMapped;
3172
+ return sqlTypeName ? EntityFieldTypeMap[sqlTypeName] : undefined;
3173
+ }
3021
3174
  /**
3022
3175
  * Transforms nested reference objects in field metadata
3023
3176
  */
@@ -3058,11 +3211,16 @@ class EntityService extends BaseService {
3058
3211
  /** Converts a user-facing EntityCreateFieldOptions to the raw API field payload */
3059
3212
  buildSchemaFieldPayload(field) {
3060
3213
  this.validateName(field.fieldName, 'field');
3061
- const mapping = EntitySchemaFieldTypeMap[field.type ?? exports.EntityFieldDataType.STRING];
3214
+ const fieldType = field.type ?? exports.EntityFieldDataType.STRING;
3215
+ this.validateFieldConstraints(fieldType, field, field.fieldName);
3216
+ const mapping = EntitySchemaFieldTypeMap[fieldType];
3062
3217
  return {
3063
3218
  name: field.fieldName,
3064
3219
  displayName: field.displayName ?? field.fieldName,
3065
- sqlType: { name: mapping.sqlTypeName },
3220
+ sqlType: {
3221
+ name: mapping.sqlTypeName,
3222
+ ...this.buildSqlTypeConstraints(fieldType, field),
3223
+ },
3066
3224
  fieldDisplayType: mapping.fieldDisplayType,
3067
3225
  description: field.description ?? '',
3068
3226
  isRequired: field.isRequired ?? false,
@@ -3075,6 +3233,107 @@ class EntityService extends BaseService {
3075
3233
  ...(field.referenceFieldName !== undefined && { referenceFieldName: field.referenceFieldName }),
3076
3234
  };
3077
3235
  }
3236
+ /**
3237
+ * Derives the user-facing {@link EntityFieldDataType} for a field on the raw
3238
+ * API response. Throws if the field's `fieldDisplayType` and `sqlType.name`
3239
+ * are both unmappable.
3240
+ */
3241
+ resolveFieldDataType(f) {
3242
+ const mapped = this.tryResolveFieldDataType(f.fieldDisplayType, f.sqlType?.name);
3243
+ if (!mapped) {
3244
+ throw new ValidationError({
3245
+ message: `Cannot determine field type for '${f.name}' (id: ${f.id}) — sqlType '${f.sqlType?.name ?? '(missing)'}' and fieldDisplayType '${f.fieldDisplayType ?? '(missing)'}' are both unrecognized.`,
3246
+ });
3247
+ }
3248
+ return mapped;
3249
+ }
3250
+ /**
3251
+ * Validates that the user-supplied constraint properties on a field are
3252
+ * supported by the field's data type. Throws a `ValidationError` listing
3253
+ * any unsupported properties.
3254
+ */
3255
+ validateFieldConstraints(type, field, fieldName) {
3256
+ const spec = ENTITY_FIELD_CONSTRAINT_SPEC[type] ?? {};
3257
+ const supported = Object.keys(spec);
3258
+ const provided = Object.values(EntityFieldConstraint).filter(name => field[name] !== undefined);
3259
+ const unsupported = provided.filter(p => !(p in spec));
3260
+ if (unsupported.length > 0) {
3261
+ const allowedDesc = supported.length > 0 ? supported.join(', ') : 'none';
3262
+ throw new ValidationError({
3263
+ message: `Field '${fieldName}' of type ${type} does not accept ${unsupported.join(', ')}. Allowed constraints for this type: ${allowedDesc}.`,
3264
+ });
3265
+ }
3266
+ // Range check: each user-supplied constraint must be within its allowed bounds.
3267
+ for (const name of provided) {
3268
+ const range = spec[name];
3269
+ const value = field[name];
3270
+ if (range && value !== undefined && (value < range.min || value > range.max)) {
3271
+ throw new ValidationError({
3272
+ message: `Field '${fieldName}' of type ${type} has ${name} ${value} out of range [${range.min}, ${range.max}].`,
3273
+ });
3274
+ }
3275
+ }
3276
+ // Cross-field check: when both bounds are user-supplied in the same call,
3277
+ // minValue must be strictly less than maxValue.
3278
+ if (field.minValue !== undefined && field.maxValue !== undefined && field.minValue >= field.maxValue) {
3279
+ throw new ValidationError({
3280
+ message: `Field '${fieldName}' of type ${type} has minValue ${field.minValue} >= maxValue ${field.maxValue}. minValue must be strictly less than maxValue.`,
3281
+ });
3282
+ }
3283
+ }
3284
+ /**
3285
+ * Returns the sqlType constraint fields for a given field type.
3286
+ *
3287
+ * The API requires specific constraint properties to be set per SQL type;
3288
+ * without them the field is stored in an incomplete state, causing
3289
+ * "Field type cannot be changed" errors when the UI later tries to edit
3290
+ * advanced options. User-supplied values from `EntityCreateFieldOptions`
3291
+ * override the defaults where the type accepts overrides.
3292
+ */
3293
+ buildSqlTypeConstraints(type, field) {
3294
+ const defaults = ENTITY_FIELD_CONSTRAINT_DEFAULTS;
3295
+ switch (type) {
3296
+ case exports.EntityFieldDataType.STRING:
3297
+ return { lengthLimit: field.lengthLimit ?? defaults.STRING_LENGTH_LIMIT };
3298
+ case exports.EntityFieldDataType.MULTILINE_TEXT:
3299
+ return { lengthLimit: field.lengthLimit ?? defaults.MULTILINE_TEXT_LENGTH_LIMIT };
3300
+ case exports.EntityFieldDataType.DECIMAL:
3301
+ return {
3302
+ lengthLimit: defaults.DECIMAL_LENGTH_LIMIT,
3303
+ decimalPrecision: field.decimalPrecision ?? defaults.DECIMAL_PRECISION,
3304
+ maxValue: field.maxValue ?? defaults.NUMERIC_MAX_VALUE,
3305
+ minValue: field.minValue ?? defaults.NUMERIC_MIN_VALUE,
3306
+ };
3307
+ case exports.EntityFieldDataType.BOOLEAN:
3308
+ return { lengthLimit: defaults.BOOLEAN_LENGTH_LIMIT };
3309
+ case exports.EntityFieldDataType.DATE:
3310
+ case exports.EntityFieldDataType.DATETIME_WITH_TZ:
3311
+ return { lengthLimit: defaults.DATE_LENGTH_LIMIT };
3312
+ case exports.EntityFieldDataType.INTEGER:
3313
+ case exports.EntityFieldDataType.BIG_INTEGER:
3314
+ return {
3315
+ maxValue: field.maxValue ?? defaults.NUMERIC_MAX_VALUE,
3316
+ minValue: field.minValue ?? defaults.NUMERIC_MIN_VALUE,
3317
+ };
3318
+ case exports.EntityFieldDataType.FLOAT:
3319
+ case exports.EntityFieldDataType.DOUBLE:
3320
+ return {
3321
+ decimalPrecision: field.decimalPrecision ?? defaults.DECIMAL_PRECISION,
3322
+ maxValue: field.maxValue ?? defaults.NUMERIC_MAX_VALUE,
3323
+ minValue: field.minValue ?? defaults.NUMERIC_MIN_VALUE,
3324
+ };
3325
+ case exports.EntityFieldDataType.FILE:
3326
+ case exports.EntityFieldDataType.RELATIONSHIP:
3327
+ // UNIQUEIDENTIFIER fixed lengthLimit (300)
3328
+ return { lengthLimit: defaults.UNIQUEIDENTIFIER_LENGTH_LIMIT };
3329
+ case exports.EntityFieldDataType.CHOICE_SET_MULTIPLE:
3330
+ // CHOICE_SET_MULTIPLE fixed lengthLimit (4000)
3331
+ return { lengthLimit: defaults.CHOICE_SET_MULTIPLE_LENGTH_LIMIT };
3332
+ default:
3333
+ // UUID, CHOICE_SET_SINGLE, AUTO_NUMBER, DATETIME — (sqlType: { name })
3334
+ return {};
3335
+ }
3336
+ }
3078
3337
  validateName(name, context) {
3079
3338
  if (name.length < 3 || name.length > 100 || !/^[a-zA-Z]\w*$/.test(name)) {
3080
3339
  const suggestion = name.replace(/\W/g, '').replace(/^[0-9_]+/, '');
@@ -3117,6 +3376,9 @@ __decorate([
3117
3376
  __decorate([
3118
3377
  track('Entities.DeleteRecordsById')
3119
3378
  ], EntityService.prototype, "deleteRecordsById", null);
3379
+ __decorate([
3380
+ track('Entities.DeleteRecordById')
3381
+ ], EntityService.prototype, "deleteRecordById", null);
3120
3382
  __decorate([
3121
3383
  track('Entities.GetAll')
3122
3384
  ], EntityService.prototype, "getAll", null);