@uipath/uipath-typescript 1.3.0 → 1.3.1

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 (41) hide show
  1. package/dist/assets/index.cjs +5 -8
  2. package/dist/assets/index.d.ts +3 -1
  3. package/dist/assets/index.mjs +5 -8
  4. package/dist/attachments/index.cjs +5 -8
  5. package/dist/attachments/index.d.ts +3 -1
  6. package/dist/attachments/index.mjs +5 -8
  7. package/dist/buckets/index.cjs +5 -8
  8. package/dist/buckets/index.d.ts +3 -1
  9. package/dist/buckets/index.mjs +5 -8
  10. package/dist/cases/index.cjs +5 -8
  11. package/dist/cases/index.d.ts +3 -1
  12. package/dist/cases/index.mjs +5 -8
  13. package/dist/conversational-agent/index.cjs +38 -16
  14. package/dist/conversational-agent/index.d.ts +26 -4
  15. package/dist/conversational-agent/index.mjs +38 -16
  16. package/dist/core/index.cjs +2 -2
  17. package/dist/core/index.d.ts +2 -2
  18. package/dist/core/index.mjs +2 -2
  19. package/dist/entities/index.cjs +680 -284
  20. package/dist/entities/index.d.ts +559 -45
  21. package/dist/entities/index.mjs +681 -285
  22. package/dist/index.cjs +515 -86
  23. package/dist/index.d.ts +604 -52
  24. package/dist/index.mjs +516 -87
  25. package/dist/index.umd.js +515 -86
  26. package/dist/jobs/index.cjs +57 -27
  27. package/dist/jobs/index.d.ts +70 -11
  28. package/dist/jobs/index.mjs +57 -27
  29. package/dist/maestro-processes/index.cjs +5 -8
  30. package/dist/maestro-processes/index.d.ts +3 -1
  31. package/dist/maestro-processes/index.mjs +5 -8
  32. package/dist/processes/index.cjs +5 -8
  33. package/dist/processes/index.d.ts +3 -1
  34. package/dist/processes/index.mjs +5 -8
  35. package/dist/queues/index.cjs +5 -8
  36. package/dist/queues/index.d.ts +3 -1
  37. package/dist/queues/index.mjs +5 -8
  38. package/dist/tasks/index.cjs +5 -8
  39. package/dist/tasks/index.d.ts +3 -1
  40. package/dist/tasks/index.mjs +5 -8
  41. package/package.json +1 -1
@@ -227,6 +227,8 @@ declare class BaseService {
227
227
  *
228
228
  * @param instance - UiPath SDK instance providing authentication and configuration.
229
229
  * Services receive this via dependency injection in the modular pattern.
230
+ * @param headers - Optional default headers to include in every request (e.g. `x-uipath-external-user-id` for
231
+ * CAS external-app auth)
230
232
  *
231
233
  * @example
232
234
  * ```typescript
@@ -246,7 +248,7 @@ declare class BaseService {
246
248
  * const entities = new Entities(sdk);
247
249
  * ```
248
250
  */
249
- constructor(instance: IUiPath);
251
+ constructor(instance: IUiPath, headers?: Record<string, string>);
250
252
  /**
251
253
  * Gets a valid authentication token, refreshing if necessary.
252
254
  * Use this when you need to manually add Authorization headers (e.g., direct uploads).
@@ -290,7 +292,7 @@ declare class BaseService {
290
292
  }
291
293
 
292
294
  /**
293
- * Entity field type names
295
+ * Entity field data type names (SQL-level types returned by the API)
294
296
  */
295
297
  declare enum EntityFieldDataType {
296
298
  UUID = "UUID",
@@ -304,7 +306,12 @@ declare enum EntityFieldDataType {
304
306
  DATE = "DATE",
305
307
  BOOLEAN = "BOOLEAN",
306
308
  BIG_INTEGER = "BIG_INTEGER",
307
- MULTILINE_TEXT = "MULTILINE_TEXT"
309
+ MULTILINE_TEXT = "MULTILINE_TEXT",
310
+ FILE = "FILE",
311
+ CHOICE_SET_SINGLE = "CHOICE_SET_SINGLE",
312
+ CHOICE_SET_MULTIPLE = "CHOICE_SET_MULTIPLE",
313
+ AUTO_NUMBER = "AUTO_NUMBER",
314
+ RELATIONSHIP = "RELATIONSHIP"
308
315
  }
309
316
  /**
310
317
  * Represents a single entity record
@@ -400,6 +407,196 @@ interface EntityDeleteOptions {
400
407
  */
401
408
  interface EntityDeleteRecordsOptions extends EntityDeleteOptions {
402
409
  }
410
+ /**
411
+ * Logical operator for combining query filter groups
412
+ */
413
+ declare enum LogicalOperator {
414
+ /** Combine conditions with AND — all conditions must match */
415
+ And = 0,
416
+ /** Combine conditions with OR — any condition must match */
417
+ Or = 1
418
+ }
419
+ /**
420
+ * Comparison operators for entity query filters.
421
+ * Not all operators are valid for all field types.
422
+ */
423
+ declare enum QueryFilterOperator {
424
+ Equals = "=",
425
+ NotEquals = "!=",
426
+ GreaterThan = ">",
427
+ LessThan = "<",
428
+ GreaterThanOrEqual = ">=",
429
+ LessThanOrEqual = "<=",
430
+ Contains = "contains",
431
+ NotContains = "not contains",
432
+ StartsWith = "startswith",
433
+ EndsWith = "endswith",
434
+ In = "in",
435
+ NotIn = "not in"
436
+ }
437
+ /**
438
+ * A single filter condition for querying entity records
439
+ *
440
+ * Values are always strings. For numeric or boolean fields, pass the string representation
441
+ * (e.g., `"42"`, `"true"`). For `In` / `NotIn` operators, use {@link valueList} instead of `value`.
442
+ */
443
+ interface EntityQueryFilter {
444
+ /** Name of the field to filter on */
445
+ fieldName: string;
446
+ /** Comparison operator */
447
+ operator: QueryFilterOperator;
448
+ /** Value to compare against (always a string; omit when using `valueList`) */
449
+ value?: string;
450
+ /** List of values for `in` / `not in` operators */
451
+ valueList?: string[];
452
+ }
453
+ /**
454
+ * A group of query filters combined with a logical operator
455
+ */
456
+ interface EntityQueryFilterGroup {
457
+ /** Logical operator applied between filters in `queryFilters` (default: AND) */
458
+ logicalOperator?: LogicalOperator;
459
+ /** Logical operator applied between sibling filter groups (default: AND) */
460
+ continueLogicalOperator?: LogicalOperator;
461
+ /** Array of filter conditions */
462
+ queryFilters?: EntityQueryFilter[];
463
+ /** Nested filter groups for complex boolean expressions */
464
+ filterGroups?: EntityQueryFilterGroup[];
465
+ }
466
+ /**
467
+ * Sort option for query results
468
+ */
469
+ interface EntityQuerySortOption {
470
+ /** Name of the field to sort by */
471
+ fieldName: string;
472
+ /** Whether to sort in descending order (default: false) */
473
+ isDescending?: boolean;
474
+ }
475
+ /**
476
+ * Options for querying entity records with filters, sorting, and pagination.
477
+ *
478
+ * Use `pageSize`, `cursor`, or `jumpToPage` for SDK-managed pagination.
479
+ * The SDK computes and manages offset parameters automatically.
480
+ */
481
+ type EntityQueryRecordsOptions = {
482
+ /** Filter conditions to apply */
483
+ filterGroup?: EntityQueryFilterGroup;
484
+ /** List of field names to include in results (returns all fields if omitted) */
485
+ selectedFields?: string[];
486
+ /** Sort options for the results */
487
+ sortOptions?: EntityQuerySortOption[];
488
+ /** Level of entity expansion for related fields (default: 0) */
489
+ expansionLevel?: number;
490
+ } & PaginationOptions;
491
+ /**
492
+ * Response from querying entity records
493
+ */
494
+ interface EntityQueryRecordsResponse {
495
+ /** Array of matching entity records */
496
+ items: EntityRecord[];
497
+ /** Total number of records matching the filter (before pagination) */
498
+ totalCount: number;
499
+ }
500
+ /**
501
+ * Common field properties shared across field definition and update types
502
+ */
503
+ interface EntityFieldBase {
504
+ /** Human-readable display name shown in the UI (defaults to `name` if omitted) */
505
+ displayName?: string;
506
+ /** Optional field description */
507
+ description?: string;
508
+ /** Whether the field is required (default: false) */
509
+ isRequired?: boolean;
510
+ /** Whether the field value must be unique across records (default: false) */
511
+ isUnique?: boolean;
512
+ /** Whether role-based access control is enabled for this field (default: false) */
513
+ isRbacEnabled?: boolean;
514
+ /** Whether the field value is encrypted at rest (default: false) */
515
+ isEncrypted?: boolean;
516
+ /** Default value for the field */
517
+ defaultValue?: string;
518
+ }
519
+ /**
520
+ * User-facing field definition for creating or updating entity schemas
521
+ */
522
+ interface EntityCreateFieldOptions extends EntityFieldBase {
523
+ /**
524
+ * Field name — must start with a letter and contain only
525
+ * letters, numbers, and underscores (e.g., `"productName"`).
526
+ */
527
+ fieldName: string;
528
+ /** Field data type — one of the {@link EntityFieldDataType} values (default: STRING) */
529
+ type?: EntityFieldDataType;
530
+ /** Choice set ID for choice-set fields */
531
+ choiceSetId?: string;
532
+ /** Name of the referenced entity for relationship fields */
533
+ referenceEntityName?: string;
534
+ /** Name of the field in the referenced entity */
535
+ referenceFieldName?: string;
536
+ }
537
+ /**
538
+ * Options for creating a new Data Fabric entity
539
+ */
540
+ interface EntityCreateOptions {
541
+ /** Human-readable display name shown in the UI (defaults to `name` if omitted) */
542
+ displayName?: string;
543
+ /** Optional entity description */
544
+ description?: string;
545
+ /** UUID of the folder to place the entity in (defaults to the tenant-level folder) */
546
+ folderKey?: string;
547
+ /** Whether role-based access control is enabled for this entity (default: false) */
548
+ isRbacEnabled?: boolean;
549
+ /** Whether Analytics integration is enabled for this entity (default: false) */
550
+ isAnalyticsEnabled?: boolean;
551
+ /** External field source definitions (default: empty) */
552
+ externalFields?: ExternalField[];
553
+ }
554
+ /**
555
+ * Identifies a field by its ID and supplies metadata updates to apply
556
+ */
557
+ interface EntityFieldUpdateOptions extends EntityFieldBase {
558
+ /** ID of the field to update */
559
+ id: string;
560
+ }
561
+ /**
562
+ * Identifies a field to remove by its name
563
+ */
564
+ interface EntityRemoveFieldOptions {
565
+ /** Name of the field to remove */
566
+ fieldName: string;
567
+ }
568
+ /**
569
+ * Options for updating an existing entity — schema and/or metadata in a single call.
570
+ *
571
+ * Schema changes (`addFields`, `removeFields`, `updateFields`) and metadata changes
572
+ * (`displayName`, `description`, `isRbacEnabled`) can be combined; each is applied
573
+ * only when the corresponding fields are provided.
574
+ */
575
+ interface EntityUpdateByIdOptions {
576
+ /** New fields to add */
577
+ addFields?: EntityCreateFieldOptions[];
578
+ /** Fields to remove, each identified by field name */
579
+ removeFields?: EntityRemoveFieldOptions[];
580
+ /** Fields to update, each identified by its field ID */
581
+ updateFields?: EntityFieldUpdateOptions[];
582
+ /** New display name for the entity */
583
+ displayName?: string;
584
+ /** New description for the entity */
585
+ description?: string;
586
+ /** Whether role-based access control is enabled for this entity */
587
+ isRbacEnabled?: boolean;
588
+ }
589
+ /**
590
+ * Response from a bulk import operation
591
+ */
592
+ interface EntityImportRecordsResponse {
593
+ /** Total number of records in the import file */
594
+ totalRecords: number;
595
+ /** Number of records successfully inserted */
596
+ insertedRecords: number;
597
+ /** Link to download the error file (if any records failed) */
598
+ errorFileLink?: string | null;
599
+ }
403
600
  /**
404
601
  * Supported file types for attachment upload
405
602
  */
@@ -520,6 +717,17 @@ interface Field {
520
717
  id: string;
521
718
  definition?: FieldMetaData;
522
719
  }
720
+ /**
721
+ * SQL type metadata
722
+ */
723
+ interface SqlType {
724
+ /** Raw SQL type name (e.g., `"NVARCHAR"`, `"INT"`, `"UNIQUEIDENTIFIER"`) */
725
+ name: string;
726
+ lengthLimit?: number;
727
+ maxValue?: number;
728
+ minValue?: number;
729
+ decimalPrecision?: number;
730
+ }
523
731
  /**
524
732
  * Detailed field definition
525
733
  */
@@ -531,25 +739,33 @@ interface FieldMetaData {
531
739
  isExternalField: boolean;
532
740
  isHiddenField: boolean;
533
741
  isUnique: boolean;
534
- referenceName?: string;
535
- referenceEntity?: RawEntityGetResponse;
536
- referenceChoiceSet?: RawEntityGetResponse;
537
- referenceField?: Field;
538
- referenceType: ReferenceType;
539
- fieldDataType: FieldDataType;
540
742
  isRequired: boolean;
541
- displayName: string;
542
- description: string;
743
+ isSystemField: boolean;
744
+ isAttachment: boolean;
745
+ isEncrypted: boolean;
746
+ isRbacEnabled: boolean;
747
+ fieldDisplayType: FieldDisplayType;
748
+ /** Transformed field data type — present after SDK transformation */
749
+ fieldDataType: FieldDataType;
543
750
  createdTime: string;
544
751
  createdBy: string;
545
- updatedTime: string;
752
+ /** Raw SQL type from API — present on raw GET responses, used on write payloads */
753
+ sqlType?: SqlType;
754
+ updatedTime?: string;
546
755
  updatedBy?: string;
547
- isSystemField: boolean;
548
- fieldDisplayType?: FieldDisplayType;
756
+ displayName?: string;
757
+ description?: string;
758
+ referenceName?: string;
759
+ referenceEntity?: RawEntityGetResponse;
760
+ referenceChoiceSet?: RawEntityGetResponse;
761
+ referenceField?: Field;
762
+ referenceType?: ReferenceType;
549
763
  choiceSetId?: string;
550
764
  defaultValue?: string;
551
- isAttachment: boolean;
552
- isRbacEnabled: boolean;
765
+ /** Name of the referenced entity (used on write payloads for relationship fields) */
766
+ referenceEntityName?: string;
767
+ /** Name of the field in the referenced entity (used on write payloads for relationship fields) */
768
+ referenceFieldName?: string;
553
769
  }
554
770
  /**
555
771
  * External object details
@@ -620,8 +836,9 @@ interface RawEntityGetResponse {
620
836
  name: string;
621
837
  displayName: string;
622
838
  entityType: EntityType;
623
- description: string;
839
+ description?: string;
624
840
  fields: FieldMetaData[];
841
+ folderId?: string;
625
842
  externalFields?: ExternalSourceFields[];
626
843
  sourceJoinCriterias?: SourceJoinCriteria[];
627
844
  recordCount?: number;
@@ -629,6 +846,7 @@ interface RawEntityGetResponse {
629
846
  usedStorageSizeInMB?: number;
630
847
  attachmentSizeInByte?: number;
631
848
  isRbacEnabled: boolean;
849
+ isInsightsEnabled?: boolean;
632
850
  id: string;
633
851
  createdBy: string;
634
852
  createdTime: string;
@@ -703,7 +921,7 @@ interface EntityServiceModel {
703
921
  * const choicesets = new ChoiceSets(sdk);
704
922
  *
705
923
  * // Get entity metadata with methods
706
- * const entity = await entities.getById(<entityId>);
924
+ * const entity = await entities.getById("<entityId>");
707
925
  *
708
926
  * // Call operations directly on the entity
709
927
  * const records = await entity.getAllRecords();
@@ -735,7 +953,7 @@ interface EntityServiceModel {
735
953
  * @example
736
954
  * ```typescript
737
955
  * // Basic usage (non-paginated)
738
- * const records = await entities.getAllRecords(<entityId>);
956
+ * const records = await entities.getAllRecords("<entityId>");
739
957
  *
740
958
  * // With expansion level
741
959
  * const records = await entities.getAllRecords(<entityId>, {
@@ -772,7 +990,7 @@ interface EntityServiceModel {
772
990
  * @example
773
991
  * ```typescript
774
992
  * // First, get records to obtain the record ID
775
- * const records = await entities.getAllRecords(<entityId>);
993
+ * const records = await entities.getAllRecords("<entityId>");
776
994
  * // Get the recordId for the record
777
995
  * const recordId = records.items[0].Id;
778
996
  * // Get the record
@@ -901,11 +1119,6 @@ interface EntityServiceModel {
901
1119
  * ```
902
1120
  */
903
1121
  updateRecordsById(id: string, data: EntityRecord[], options?: EntityUpdateRecordsOptions): Promise<EntityUpdateResponse>;
904
- /**
905
- * @deprecated Use {@link updateRecordsById} instead.
906
- * @hidden
907
- */
908
- updateById(id: string, data: EntityRecord[], options?: EntityUpdateOptions): Promise<EntityUpdateResponse>;
909
1122
  /**
910
1123
  * Deletes data from an entity by entity ID
911
1124
  *
@@ -924,10 +1137,52 @@ interface EntityServiceModel {
924
1137
  */
925
1138
  deleteRecordsById(id: string, recordIds: string[], options?: EntityDeleteRecordsOptions): Promise<EntityDeleteResponse>;
926
1139
  /**
927
- * @deprecated Use {@link deleteRecordsById} instead.
928
- * @hidden
1140
+ * Queries entity records with filters, sorting, and SDK-managed pagination
1141
+ *
1142
+ * @param id - UUID of the entity
1143
+ * @param options - Query options including filterGroup, selectedFields, sortOptions, and pagination
1144
+ * @returns Promise resolving to {@link NonPaginatedResponse} without pagination options,
1145
+ * or {@link PaginatedResponse} when `pageSize`, `cursor`, or `jumpToPage` are provided
1146
+ * @example
1147
+ * ```typescript
1148
+ * import { Entities, LogicalOperator, QueryFilterOperator } from '@uipath/uipath-typescript/entities';
1149
+ *
1150
+ * const entities = new Entities(sdk);
1151
+ *
1152
+ * // Non-paginated query with a filter
1153
+ * const result = await entities.queryRecordsById(<id>, {
1154
+ * filterGroup: {
1155
+ * logicalOperator: LogicalOperator.And,
1156
+ * queryFilters: [{ fieldName: "status", operator: QueryFilterOperator.Equals, value: "active" }]
1157
+ * },
1158
+ * sortOptions: [{ fieldName: "createdTime", isDescending: true }],
1159
+ * });
1160
+ * console.log(`Found ${result.totalCount} records`);
1161
+ *
1162
+ * // With pagination
1163
+ * const page1 = await entities.queryRecordsById(<id>, { pageSize: 25 });
1164
+ * if (page1.hasNextPage) {
1165
+ * const page2 = await entities.queryRecordsById(<id>, { cursor: page1.nextCursor });
1166
+ * }
1167
+ * ```
929
1168
  */
930
- deleteById(id: string, recordIds: string[], options?: EntityDeleteOptions): Promise<EntityDeleteResponse>;
1169
+ queryRecordsById<T extends EntityQueryRecordsOptions = EntityQueryRecordsOptions>(id: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
1170
+ /**
1171
+ * Imports records from a CSV file into an entity
1172
+ *
1173
+ * @param id - UUID of the entity
1174
+ * @param file - CSV file to import as a Blob or File or Uint8Array
1175
+ * @returns Promise resolving to {@link EntityImportRecordsResponse} with record counts
1176
+ * @example
1177
+ * ```typescript
1178
+ * // Browser: upload from file input
1179
+ * const fileInput = document.getElementById('csv-input') as HTMLInputElement;
1180
+ * const result = await entities.importRecordsById(<id>, fileInput.files[0]);
1181
+ * console.log(`Inserted ${result.insertedRecords} of ${result.totalRecords} records`);
1182
+ * ```
1183
+ * @internal
1184
+ */
1185
+ importRecordsById(id: string, file: EntityFileType): Promise<EntityImportRecordsResponse>;
931
1186
  /**
932
1187
  * Downloads an attachment stored in a File-type field of an entity record.
933
1188
  *
@@ -1048,6 +1303,75 @@ interface EntityServiceModel {
1048
1303
  * ```
1049
1304
  */
1050
1305
  deleteAttachment(entityId: string, recordId: string, fieldName: string): Promise<EntityDeleteAttachmentResponse>;
1306
+ /**
1307
+ * Creates a new Data Fabric entity with the given schema
1308
+ *
1309
+ * @param name - Entity name — must start with a letter, letters/numbers/underscores only
1310
+ * (e.g., `"productCatalog"`).
1311
+ * @param fields - Array of field definitions
1312
+ * @param options - Optional entity-level settings ({@link EntityCreateOptions})
1313
+ * @returns Promise resolving to the ID of the created entity
1314
+ * @example
1315
+ * ```typescript
1316
+ * import { Entities } from '@uipath/uipath-typescript/entities';
1317
+ *
1318
+ * const entities = new Entities(sdk);
1319
+ *
1320
+ * const id = await entities.create("product_catalog", [
1321
+ * { fieldName: "product_name", type: EntityFieldDataType.STRING, isRequired: true, isUnique: true },
1322
+ * { fieldName: "price", type: EntityFieldDataType.INTEGER, defaultValue: "0" },
1323
+ * ], { displayName: "Product Catalog", description: "Our product catalog", isRbacEnabled: true });
1324
+ * ```
1325
+ * @internal
1326
+ */
1327
+ create(name: string, fields: EntityCreateFieldOptions[], options?: EntityCreateOptions): Promise<string>;
1328
+ /**
1329
+ * Deletes a Data Fabric entity and all its records
1330
+ *
1331
+ * @param id - UUID of the entity to delete
1332
+ * @returns Promise resolving when the entity is deleted
1333
+ * @example
1334
+ * ```typescript
1335
+ * await entities.deleteById(<id>);
1336
+ * ```
1337
+ * @internal
1338
+ */
1339
+ deleteById(id: string): Promise<void>;
1340
+ /**
1341
+ * Updates an existing Data Fabric entity — schema and/or metadata.
1342
+ *
1343
+ * Pass any combination of schema fields (`addFields`, `removeFields`, `updateFields`) and
1344
+ * metadata fields (`displayName`, `description`, `isRbacEnabled`). Each group is applied
1345
+ * only when the corresponding fields are provided.
1346
+ *
1347
+ * @param id - UUID of the entity to update
1348
+ * @param name - name of the entity (required by the API)
1349
+ * @param options - Changes to apply ({@link EntityUpdateByIdOptions})
1350
+ * @returns Promise resolving when the update is complete
1351
+ *
1352
+ * @example
1353
+ * ```typescript
1354
+ * // Schema-only: add a field and remove another
1355
+ * await entities.updateById(<id>, {
1356
+ * addFields: [{ fieldName: "notes", type: EntityFieldDataType.MULTILINE_TEXT }],
1357
+ * removeFields: [{ fieldName: "old_field" }],
1358
+ * });
1359
+ *
1360
+ * // Metadata-only: rename the entity
1361
+ * await entities.updateById(<id>, {
1362
+ * displayName: "My Updated Entity",
1363
+ * description: "Updated description",
1364
+ * });
1365
+ *
1366
+ * // Combined: update a field and rename at the same time
1367
+ * await entities.updateById(<id>, {
1368
+ * updateFields: [{ id: <fieldId>, displayName: "Unit Price", isRequired: true }],
1369
+ * displayName: "Price Catalog",
1370
+ * });
1371
+ * ```
1372
+ * @internal
1373
+ */
1374
+ updateById(id: string, options?: EntityUpdateByIdOptions): Promise<void>;
1051
1375
  }
1052
1376
  /**
1053
1377
  * Entity methods interface - defines operations that can be performed on an entity
@@ -1159,29 +1483,81 @@ interface EntityMethods {
1159
1483
  */
1160
1484
  batchInsert(data: Record<string, any>[], options?: EntityBatchInsertOptions): Promise<EntityBatchInsertResponse>;
1161
1485
  /**
1162
- * @deprecated Use {@link updateRecords} instead.
1163
- * @hidden
1164
- */
1165
- update(data: EntityRecord[], options?: EntityUpdateOptions): Promise<EntityUpdateResponse>;
1486
+ * Queries records in this entity with filters, sorting, and SDK-managed pagination
1487
+ *
1488
+ * @param options - Query options including filterGroup, selectedFields, sortOptions, and pagination
1489
+ * @returns Promise resolving to {@link NonPaginatedResponse} without pagination options,
1490
+ * or {@link PaginatedResponse} when `pageSize`, `cursor`, or `jumpToPage` are provided
1491
+ * @example
1492
+ * ```typescript
1493
+ * const entity = await entities.getById(<entityId>);
1494
+ * const result = await entity.queryRecords({
1495
+ * filterGroup: {
1496
+ * logicalOperator: LogicalOperator.And,
1497
+ * queryFilters: [{ fieldName: "status", operator: QueryFilterOperator.Equals, value: "active" }]
1498
+ * },
1499
+ * sortOptions: [{ fieldName: "createdTime", isDescending: true }],
1500
+ * });
1501
+ * console.log(`Found ${result.totalCount} records`);
1502
+ * ```
1503
+ */
1504
+ queryRecords<T extends EntityQueryRecordsOptions = EntityQueryRecordsOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
1166
1505
  /**
1167
- * @deprecated Use {@link deleteRecords} instead.
1168
- * @hidden
1506
+ * Imports records from a CSV file into this entity
1507
+ *
1508
+ * @param file - CSV file to import as a Blob, File, or Uint8Array
1509
+ * @returns Promise resolving to {@link EntityImportRecordsResponse} with record counts
1510
+ * @example
1511
+ * ```typescript
1512
+ * const entity = await entities.getById(<entityId>);
1513
+ * const fileInput = document.getElementById('csv-input') as HTMLInputElement;
1514
+ * const result = await entity.importRecords(fileInput.files[0]);
1515
+ * console.log(`Inserted ${result.insertedRecords} of ${result.totalRecords} records`);
1516
+ * ```
1169
1517
  */
1170
- delete(recordIds: string[], options?: EntityDeleteOptions): Promise<EntityDeleteResponse>;
1518
+ importRecords(file: EntityFileType): Promise<EntityImportRecordsResponse>;
1171
1519
  /**
1172
1520
  * @deprecated Use {@link getAllRecords} instead.
1173
1521
  * @hidden
1174
1522
  */
1175
1523
  getRecords<T extends EntityGetRecordsByIdOptions = EntityGetRecordsByIdOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
1524
+ /**
1525
+ * Deletes this entity and all its records
1526
+ *
1527
+ * @returns Promise resolving when the entity is deleted
1528
+ * @example
1529
+ * ```typescript
1530
+ * const entity = await entities.getById(<id>);
1531
+ * await entity.delete();
1532
+ * ```
1533
+ * @internal
1534
+ */
1535
+ delete(): Promise<void>;
1536
+ /**
1537
+ * Updates this entity — schema and/or metadata.
1538
+ *
1539
+ * @param options - Changes to apply ({@link EntityUpdateByIdOptions})
1540
+ * @returns Promise resolving when the update is complete
1541
+ * @example
1542
+ * ```typescript
1543
+ * const entity = await entities.getById(<id>);
1544
+ * await entity.update({
1545
+ * displayName: "Updated Name",
1546
+ * addFields: [{ fieldName: "notes", type: EntityFieldDataType.MULTILINE_TEXT }],
1547
+ * });
1548
+ * ```
1549
+ * @internal
1550
+ */
1551
+ update(options?: EntityUpdateByIdOptions): Promise<void>;
1176
1552
  }
1177
1553
  /**
1178
1554
  * Entity with methods combining metadata with operation methods
1179
1555
  */
1180
1556
  type EntityGetResponse = RawEntityGetResponse & EntityMethods;
1181
1557
  /**
1182
- * Creates an actionable entity metadata by combining entity with operational methods
1558
+ * Creates an actionable entity by combining entity metadata with data and management methods
1183
1559
  *
1184
- * @param entityData - Entity metadata
1560
+ * @param entityMetadata - Entity metadata
1185
1561
  * @param service - The entity service instance
1186
1562
  * @returns Entity metadata with added methods
1187
1563
  */
@@ -1425,6 +1801,72 @@ declare class EntityService extends BaseService implements EntityServiceModel {
1425
1801
  * ```
1426
1802
  */
1427
1803
  getAll(): Promise<EntityGetResponse[]>;
1804
+ /**
1805
+ * Queries entity records with filters, sorting, and pagination
1806
+ *
1807
+ * @param id - UUID of the entity
1808
+ * @param options - Query options including filterGroup, selectedFields, sortOptions, and pagination
1809
+ * @returns Promise resolving to {@link NonPaginatedResponse} without pagination options,
1810
+ * or {@link PaginatedResponse} when `pageSize`, `cursor`, or `jumpToPage` are provided
1811
+ *
1812
+ * @example
1813
+ * ```typescript
1814
+ * import { Entities, LogicalOperator, QueryFilterOperator } from '@uipath/uipath-typescript/entities';
1815
+ *
1816
+ * const entities = new Entities(sdk);
1817
+ *
1818
+ * // Non-paginated query with a filter
1819
+ * const result = await entities.queryRecordsById("<entityId>", {
1820
+ * filterGroup: {
1821
+ * logicalOperator: LogicalOperator.And,
1822
+ * queryFilters: [
1823
+ * { fieldName: "status", operator: QueryFilterOperator.Equals, value: "active" }
1824
+ * ]
1825
+ * },
1826
+ * sortOptions: [{ fieldName: "created_at", isDescending: true }],
1827
+ * });
1828
+ * console.log(`Found ${result.totalCount} records`);
1829
+ *
1830
+ * // With pagination
1831
+ * const page1 = await entities.queryRecordsById("<entityId>", {
1832
+ * filterGroup: { queryFilters: [{ fieldName: "status", operator: QueryFilterOperator.Equals, value: "active" }] },
1833
+ * pageSize: 25,
1834
+ * });
1835
+ * if (page1.hasNextPage) {
1836
+ * const page2 = await entities.queryRecordsById("<entityId>", { cursor: page1.nextCursor });
1837
+ * }
1838
+ * ```
1839
+ */
1840
+ queryRecordsById<T extends EntityQueryRecordsOptions = EntityQueryRecordsOptions>(id: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
1841
+ /**
1842
+ * Imports records from a CSV file into an entity
1843
+ *
1844
+ * @param id - UUID of the entity
1845
+ * @param file - CSV file to import (Blob, File, or Uint8Array)
1846
+ * @returns Promise resolving to import result with record counts
1847
+ *
1848
+ * @example
1849
+ * ```typescript
1850
+ * import { Entities } from '@uipath/uipath-typescript/entities';
1851
+ *
1852
+ * const entities = new Entities(sdk);
1853
+ *
1854
+ * // Browser: upload from file input
1855
+ * const fileInput = document.getElementById('csv-input') as HTMLInputElement;
1856
+ * const result = await entities.importRecordsById("<entityId>", fileInput.files[0]);
1857
+ *
1858
+ * // Node.js: read from disk
1859
+ * const fileBuffer = fs.readFileSync('records.csv');
1860
+ * const result = await entities.importRecordsById("<entityId>", new Blob([fileBuffer], { type: 'text/csv' }));
1861
+ *
1862
+ * console.log(`Inserted ${result.insertedRecords} of ${result.totalRecords} records`);
1863
+ * if (result.errorFileLink) {
1864
+ * console.log(`Error file link: ${result.errorFileLink}`);
1865
+ * }
1866
+ * ```
1867
+ * @internal
1868
+ */
1869
+ importRecordsById(id: string, file: EntityFileType): Promise<EntityImportRecordsResponse>;
1428
1870
  /**
1429
1871
  * Downloads an attachment from an entity record field
1430
1872
  *
@@ -1524,15 +1966,83 @@ declare class EntityService extends BaseService implements EntityServiceModel {
1524
1966
  */
1525
1967
  batchInsertById(id: string, data: Record<string, any>[], options?: EntityBatchInsertOptions): Promise<EntityBatchInsertResponse>;
1526
1968
  /**
1527
- * @hidden
1528
- * @deprecated Use {@link updateRecordsById} instead.
1969
+ * Creates a new Data Fabric entity with the given schema
1970
+ *
1971
+ * @param name - Entity name — must start with a letter and contain
1972
+ * only letters, numbers, and underscores (e.g., `"productCatalog"`).
1973
+ * @param fields - Array of field definitions
1974
+ * @param options - Optional entity-level settings ({@link EntityCreateOptions})
1975
+ * @returns Promise resolving to the ID of the created entity
1976
+ *
1977
+ * @example
1978
+ * ```typescript
1979
+ * const entityId = await entities.create("product_catalog", [
1980
+ * { fieldName: "product_name", type: EntityFieldDataType.STRING, isRequired: true, isUnique: true },
1981
+ * { fieldName: "price", type: EntityFieldDataType.INTEGER, defaultValue: "0" },
1982
+ * ], { displayName: "Product Catalog", description: "Our product catalog", isRbacEnabled: true });
1983
+ * ```
1984
+ * @internal
1529
1985
  */
1530
- updateById(id: string, data: EntityRecord[], options?: EntityUpdateOptions): Promise<EntityUpdateResponse>;
1986
+ create(name: string, fields: EntityCreateFieldOptions[], options?: EntityCreateOptions): Promise<string>;
1531
1987
  /**
1532
- * @hidden
1533
- * @deprecated Use {@link deleteRecordsById} instead.
1988
+ * Deletes a Data Fabric entity and all its records
1989
+ *
1990
+ * @param id - UUID of the entity to delete
1991
+ * @returns Promise resolving when the entity is deleted
1992
+ *
1993
+ * @example
1994
+ * ```typescript
1995
+ * await entities.deleteById("<entityId>");
1996
+ * ```
1997
+ * @internal
1998
+ */
1999
+ deleteById(id: string): Promise<void>;
2000
+ /**
2001
+ * Updates an existing Data Fabric entity — schema and/or metadata.
2002
+ *
2003
+ * Provide any combination of schema fields (`addFields`, `removeFields`, `updateFields`) and
2004
+ * metadata fields (`displayName`, `description`, `isRbacEnabled`). Each group is applied
2005
+ * only when the corresponding fields are present.
2006
+ *
2007
+ * **Warning:** Schema changes (`addFields`, `removeFields`, `updateFields`) use a
2008
+ * read-modify-write pattern — concurrent calls on the same entity may silently
2009
+ * overwrite each other's changes.
2010
+ *
2011
+ * @param id - UUID of the entity to update
2012
+ * @param options - Changes to apply ({@link EntityUpdateByIdOptions})
2013
+ * @returns Promise resolving when the update is complete
2014
+ *
2015
+ * @example
2016
+ * ```typescript
2017
+ * // Schema-only
2018
+ * await entities.updateById("<entityId>", {
2019
+ * addFields: [{ fieldName: "notes", type: EntityFieldDataType.MULTILINE_TEXT }],
2020
+ * removeFields: [{ fieldName: "old_field" }],
2021
+ * });
2022
+ *
2023
+ * // Metadata-only
2024
+ * await entities.updateById("<entityId>", {
2025
+ * displayName: "My Updated Entity",
2026
+ * description: "Updated description",
2027
+ * });
2028
+ *
2029
+ * // Combined
2030
+ * await entities.updateById("<entityId>", {
2031
+ * updateFields: [{ id: "<fieldId>", displayName: "Unit Price", isRequired: true }],
2032
+ * displayName: "Price Catalog",
2033
+ * });
2034
+ * ```
2035
+ * @internal
2036
+ */
2037
+ updateById(id: string, options?: EntityUpdateByIdOptions): Promise<void>;
2038
+ /**
2039
+ * Fetches the current entity schema, applies the field delta, then posts the full updated schema.
2040
+ *
2041
+ * @param entityId - UUID of the entity to update
2042
+ * @param options - Field changes to apply
2043
+ * @private
1534
2044
  */
1535
- deleteById(id: string, recordIds: string[], options?: EntityDeleteOptions): Promise<EntityDeleteResponse>;
2045
+ private applySchemaUpdate;
1536
2046
  /**
1537
2047
  * Orchestrates all field mapping transformations
1538
2048
  *
@@ -1558,6 +2068,10 @@ declare class EntityService extends BaseService implements EntityServiceModel {
1558
2068
  * @private
1559
2069
  */
1560
2070
  private mapExternalFields;
2071
+ /** Converts a user-facing EntityCreateFieldOptions to the raw API field payload */
2072
+ private buildSchemaFieldPayload;
2073
+ private static readonly RESERVED_FIELD_NAMES;
2074
+ private validateName;
1561
2075
  }
1562
2076
 
1563
2077
  /**
@@ -1758,5 +2272,5 @@ declare class ChoiceSetService extends BaseService implements ChoiceSetServiceMo
1758
2272
  getById<T extends ChoiceSetGetByIdOptions = ChoiceSetGetByIdOptions>(choiceSetId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ChoiceSetGetResponse> : NonPaginatedResponse<ChoiceSetGetResponse>>;
1759
2273
  }
1760
2274
 
1761
- export { ChoiceSetService, ChoiceSetService as ChoiceSets, DataDirectionType, EntityService as Entities, EntityFieldDataType, EntityService, EntityType, FieldDisplayType, JoinType, ReferenceType, createEntityWithMethods };
1762
- export type { ChoiceSetGetAllResponse, ChoiceSetGetByIdOptions, ChoiceSetGetResponse, ChoiceSetServiceModel, EntityBatchInsertOptions, EntityBatchInsertResponse, EntityDeleteAttachmentResponse, EntityDeleteOptions, EntityDeleteRecordsOptions, EntityDeleteResponse, EntityFileType, EntityGetAllRecordsOptions, EntityGetRecordByIdOptions, EntityGetRecordsByIdOptions, EntityGetResponse, EntityInsertOptions, EntityInsertRecordOptions, EntityInsertRecordsOptions, EntityInsertResponse, EntityMethods, EntityOperationOptions, EntityOperationResponse, EntityRecord, EntityServiceModel, EntityUpdateOptions, EntityUpdateRecordOptions, EntityUpdateRecordResponse, EntityUpdateRecordsOptions, EntityUpdateResponse, EntityUploadAttachmentOptions, EntityUploadAttachmentResponse, ExternalConnection, ExternalField, ExternalFieldMapping, ExternalObject, ExternalSourceFields, FailureRecord, Field, FieldDataType, FieldMetaData, RawEntityGetResponse, SourceJoinCriteria };
2275
+ export { ChoiceSetService, ChoiceSetService as ChoiceSets, DataDirectionType, EntityService as Entities, EntityFieldDataType, EntityService, EntityType, FieldDisplayType, JoinType, LogicalOperator, QueryFilterOperator, ReferenceType, createEntityWithMethods };
2276
+ export type { ChoiceSetGetAllResponse, ChoiceSetGetByIdOptions, ChoiceSetGetResponse, ChoiceSetServiceModel, EntityBatchInsertOptions, EntityBatchInsertResponse, EntityCreateFieldOptions, EntityCreateOptions, EntityDeleteAttachmentResponse, EntityDeleteOptions, EntityDeleteRecordsOptions, EntityDeleteResponse, EntityFieldBase, EntityFieldUpdateOptions, EntityFileType, EntityGetAllRecordsOptions, EntityGetRecordByIdOptions, EntityGetRecordsByIdOptions, EntityGetResponse, EntityImportRecordsResponse, EntityInsertOptions, EntityInsertRecordOptions, EntityInsertRecordsOptions, EntityInsertResponse, EntityMethods, EntityOperationOptions, EntityOperationResponse, EntityQueryFilter, EntityQueryFilterGroup, EntityQueryRecordsOptions, EntityQueryRecordsResponse, EntityQuerySortOption, EntityRecord, EntityRemoveFieldOptions, EntityServiceModel, EntityUpdateByIdOptions, EntityUpdateOptions, EntityUpdateRecordOptions, EntityUpdateRecordResponse, EntityUpdateRecordsOptions, EntityUpdateResponse, EntityUploadAttachmentOptions, EntityUploadAttachmentResponse, ExternalConnection, ExternalField, ExternalFieldMapping, ExternalObject, ExternalSourceFields, FailureRecord, Field, FieldDataType, FieldMetaData, RawEntityGetResponse, SourceJoinCriteria, SqlType };