@uipath/uipath-typescript 1.2.0 → 1.2.2

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 (40) hide show
  1. package/dist/assets/index.cjs +1 -1
  2. package/dist/assets/index.d.ts +2 -1
  3. package/dist/assets/index.mjs +1 -1
  4. package/dist/attachments/index.cjs +1944 -0
  5. package/dist/attachments/index.d.ts +399 -0
  6. package/dist/attachments/index.mjs +1941 -0
  7. package/dist/buckets/index.cjs +1 -1
  8. package/dist/buckets/index.d.ts +4 -2
  9. package/dist/buckets/index.mjs +1 -1
  10. package/dist/cases/index.cjs +95 -48
  11. package/dist/cases/index.d.ts +31 -2
  12. package/dist/cases/index.mjs +95 -48
  13. package/dist/conversational-agent/index.cjs +38 -7
  14. package/dist/conversational-agent/index.d.ts +72 -6
  15. package/dist/conversational-agent/index.mjs +38 -7
  16. package/dist/core/index.cjs +118 -17
  17. package/dist/core/index.d.ts +26 -2
  18. package/dist/core/index.mjs +118 -17
  19. package/dist/entities/index.cjs +48 -1
  20. package/dist/entities/index.d.ts +106 -19
  21. package/dist/entities/index.mjs +48 -1
  22. package/dist/index.cjs +585 -267
  23. package/dist/index.d.ts +595 -67
  24. package/dist/index.mjs +586 -268
  25. package/dist/index.umd.js +582 -264
  26. package/dist/jobs/index.cjs +2036 -0
  27. package/dist/jobs/index.d.ts +724 -0
  28. package/dist/jobs/index.mjs +2033 -0
  29. package/dist/maestro-processes/index.cjs +1 -1
  30. package/dist/maestro-processes/index.mjs +1 -1
  31. package/dist/processes/index.cjs +67 -1
  32. package/dist/processes/index.d.ts +80 -15
  33. package/dist/processes/index.mjs +68 -2
  34. package/dist/queues/index.cjs +1 -1
  35. package/dist/queues/index.d.ts +2 -1
  36. package/dist/queues/index.mjs +1 -1
  37. package/dist/tasks/index.cjs +1319 -1272
  38. package/dist/tasks/index.d.ts +331 -287
  39. package/dist/tasks/index.mjs +1319 -1272
  40. package/package.json +25 -3
@@ -358,25 +358,35 @@ interface EntityInsertOptions {
358
358
  /**
359
359
  * Options for inserting a single record into an entity
360
360
  */
361
- type EntityInsertRecordOptions = EntityInsertOptions;
361
+ interface EntityInsertRecordOptions extends EntityInsertOptions {
362
+ }
362
363
  /**
363
364
  * Options for batch inserting data into an entity
364
365
  * @deprecated Use {@link EntityInsertRecordsOptions} instead for better clarity on inserting multiple records into an entity. This type will be removed in future versions.
365
366
  */
366
- type EntityBatchInsertOptions = EntityOperationOptions;
367
+ interface EntityBatchInsertOptions extends EntityOperationOptions {
368
+ }
367
369
  /**
368
370
  * Options for inserting multiple records into an entity
369
371
  */
370
- type EntityInsertRecordsOptions = EntityOperationOptions;
372
+ interface EntityInsertRecordsOptions extends EntityOperationOptions {
373
+ }
374
+ /**
375
+ * Options for updating a single record in an entity
376
+ */
377
+ interface EntityUpdateRecordOptions extends EntityGetRecordByIdOptions {
378
+ }
371
379
  /**
372
380
  * Options for updating data in an entity
373
- * @deprecated Use {@link EntityUpdateRecordOptions} instead for better clarity on updating records in an entity. This type will be removed in future versions.
381
+ * @deprecated Use {@link EntityUpdateRecordsOptions} instead for better clarity on updating records in an entity. This type will be removed in future versions.
374
382
  */
375
- type EntityUpdateOptions = EntityOperationOptions;
383
+ interface EntityUpdateOptions extends EntityOperationOptions {
384
+ }
376
385
  /**
377
386
  * Options for updating data in an entity
378
387
  */
379
- type EntityUpdateRecordsOptions = EntityOperationOptions;
388
+ interface EntityUpdateRecordsOptions extends EntityOperationOptions {
389
+ }
380
390
  /**
381
391
  * Options for deleting data from an entity
382
392
  * @deprecated Use {@link EntityDeleteRecordsOptions} instead for better clarity on deleting records from an entity. This type will be removed in future versions.
@@ -388,7 +398,8 @@ interface EntityDeleteOptions {
388
398
  /**
389
399
  * Options for deleting records in an entity
390
400
  */
391
- type EntityDeleteRecordsOptions = EntityDeleteOptions;
401
+ interface EntityDeleteRecordsOptions extends EntityDeleteOptions {
402
+ }
392
403
  /**
393
404
  * Supported file types for attachment upload
394
405
  */
@@ -427,22 +438,32 @@ interface EntityOperationResponse {
427
438
  failureRecords: FailureRecord[];
428
439
  }
429
440
  /**
430
- * Response from inserting a single record into an entity
431
- * Returns the inserted record with its generated record ID and other fields
441
+ * Response from inserting a single record into an entity.
442
+ * Returns the inserted record with its generated record ID and other fields.
432
443
  */
433
- type EntityInsertResponse = EntityRecord;
444
+ interface EntityInsertResponse extends EntityRecord {
445
+ }
446
+ /**
447
+ * Response from updating a single record in an entity.
448
+ * Returns the updated record.
449
+ */
450
+ interface EntityUpdateRecordResponse extends EntityRecord {
451
+ }
434
452
  /**
435
453
  * Response from batch inserting data into an entity
436
454
  */
437
- type EntityBatchInsertResponse = EntityOperationResponse;
455
+ interface EntityBatchInsertResponse extends EntityOperationResponse {
456
+ }
438
457
  /**
439
458
  * Response from updating data in an entity
440
459
  */
441
- type EntityUpdateResponse = EntityOperationResponse;
460
+ interface EntityUpdateResponse extends EntityOperationResponse {
461
+ }
442
462
  /**
443
463
  * Response from deleting data from an entity
444
464
  */
445
- type EntityDeleteResponse = EntityOperationResponse;
465
+ interface EntityDeleteResponse extends EntityOperationResponse {
466
+ }
446
467
  /**
447
468
  * Entity type enum
448
469
  */
@@ -827,11 +848,37 @@ interface EntityServiceModel {
827
848
  * @hidden
828
849
  */
829
850
  batchInsertById(id: string, data: Record<string, any>[], options?: EntityBatchInsertOptions): Promise<EntityBatchInsertResponse>;
851
+ /**
852
+ * Updates a single record in an entity by entity ID
853
+ *
854
+ * Note: Data Fabric supports trigger events only on individual updates, not on updating multiple records.
855
+ * Use this method if you need trigger events to fire for the updated record.
856
+ *
857
+ * @param entityId - UUID of the entity
858
+ * @param recordId - UUID of the record to update
859
+ * @param data - Key-value pairs of fields to update
860
+ * @param options - Update options
861
+ * @returns Promise resolving to the updated record
862
+ * {@link EntityUpdateRecordResponse}
863
+ * @example
864
+ * ```typescript
865
+ * // Basic usage
866
+ * const result = await entities.updateRecordById(<entityId>, <recordId>, { name: "John Updated", age: 31 });
867
+ *
868
+ * // With options
869
+ * const result = await entities.updateRecordById(<entityId>, <recordId>, { name: "John Updated", age: 31 }, {
870
+ * expansionLevel: 1
871
+ * });
872
+ * ```
873
+ */
874
+ updateRecordById(entityId: string, recordId: string, data: Record<string, any>, options?: EntityUpdateRecordOptions): Promise<EntityUpdateRecordResponse>;
830
875
  /**
831
876
  * Updates data in an entity by entity ID
832
877
  *
878
+ * Note: Records updated using updateRecordsById will not trigger Data Fabric trigger events. Use {@link updateRecordById} if you need trigger events to fire for each updated record.
879
+ *
833
880
  * @param id - UUID of the entity
834
- * @param data - Array of records to update. Each record MUST contain the record Id.
881
+ * @param data - Array of records to update. Each record MUST contain the record id.
835
882
  * @param options - Update options
836
883
  * @returns Promise resolving to update response
837
884
  * {@link EntityUpdateResponse}
@@ -839,14 +886,14 @@ interface EntityServiceModel {
839
886
  * ```typescript
840
887
  * // Basic usage
841
888
  * const result = await entities.updateRecordsById(<entityId>, [
842
- * { Id: "123", name: "John Updated", age: 31 },
843
- * { Id: "456", name: "Jane Updated", age: 26 }
889
+ * { id: "123", name: "John Updated", age: 31 },
890
+ * { id: "456", name: "Jane Updated", age: 26 }
844
891
  * ]);
845
892
  *
846
893
  * // With options
847
894
  * const result = await entities.updateRecordsById(<entityId>, [
848
- * { Id: "123", name: "John Updated", age: 31 },
849
- * { Id: "456", name: "Jane Updated", age: 26 }
895
+ * { id: "123", name: "John Updated", age: 31 },
896
+ * { id: "456", name: "Jane Updated", age: 26 }
850
897
  * ], {
851
898
  * expansionLevel: 1,
852
899
  * failOnFirst: true
@@ -1028,9 +1075,24 @@ interface EntityMethods {
1028
1075
  * @returns Promise resolving to batch insert response
1029
1076
  */
1030
1077
  insertRecords(data: Record<string, any>[], options?: EntityInsertRecordsOptions): Promise<EntityBatchInsertResponse>;
1078
+ /**
1079
+ * Update a single record in this entity
1080
+ *
1081
+ * Note: Data Fabric supports trigger events only on individual updates, not on updating multiple records.
1082
+ * Use this method if you need trigger events to fire for the updated record.
1083
+ *
1084
+ * @param recordId - UUID of the record to update
1085
+ * @param data - Key-value pairs of fields to update
1086
+ * @param options - Update options
1087
+ * @returns Promise resolving to the updated record
1088
+ */
1089
+ updateRecord(recordId: string, data: Record<string, any>, options?: EntityUpdateRecordOptions): Promise<EntityUpdateRecordResponse>;
1031
1090
  /**
1032
1091
  * Update data in this entity
1033
1092
  *
1093
+ * Note: Records updated using updateRecords will not trigger Data Fabric trigger events. Use {@link updateRecord} if you need
1094
+ * trigger events to fire for each updated record.
1095
+ *
1034
1096
  * @param data - Array of records to update. Each record MUST contain the record Id,
1035
1097
  * otherwise the update will fail.
1036
1098
  * @param options - Update options
@@ -1266,6 +1328,31 @@ declare class EntityService extends BaseService implements EntityServiceModel {
1266
1328
  * ```
1267
1329
  */
1268
1330
  insertRecordsById(id: string, data: Record<string, any>[], options?: EntityInsertRecordsOptions): Promise<EntityBatchInsertResponse>;
1331
+ /**
1332
+ * Updates a single record in an entity by entity ID
1333
+ *
1334
+ * @param entityId - UUID of the entity
1335
+ * @param recordId - UUID of the record to update
1336
+ * @param data - Key-value pairs of fields to update
1337
+ * @param options - Update options
1338
+ * @returns Promise resolving to the updated record
1339
+ *
1340
+ * @example
1341
+ * ```typescript
1342
+ * import { Entities } from '@uipath/uipath-typescript/entities';
1343
+ *
1344
+ * const entities = new Entities(sdk);
1345
+ *
1346
+ * // Basic usage
1347
+ * const result = await entities.updateRecordById("<entityId>", "<recordId>", { name: "John Updated", age: 31 });
1348
+ *
1349
+ * // With options
1350
+ * const result = await entities.updateRecordById("<entityId>", "<recordId>", { name: "John Updated", age: 31 }, {
1351
+ * expansionLevel: 1
1352
+ * });
1353
+ * ```
1354
+ */
1355
+ updateRecordById(entityId: string, recordId: string, data: Record<string, any>, options?: EntityUpdateRecordOptions): Promise<EntityUpdateRecordResponse>;
1269
1356
  /**
1270
1357
  * Updates data in an entity by entity ID
1271
1358
  *
@@ -1672,4 +1759,4 @@ declare class ChoiceSetService extends BaseService implements ChoiceSetServiceMo
1672
1759
  }
1673
1760
 
1674
1761
  export { ChoiceSetService, ChoiceSetService as ChoiceSets, DataDirectionType, EntityService as Entities, EntityFieldDataType, EntityService, EntityType, FieldDisplayType, JoinType, ReferenceType, createEntityWithMethods };
1675
- 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, EntityUpdateRecordsOptions, EntityUpdateResponse, EntityUploadAttachmentOptions, EntityUploadAttachmentResponse, ExternalConnection, ExternalField, ExternalFieldMapping, ExternalObject, ExternalSourceFields, FailureRecord, Field, FieldDataType, FieldMetaData, RawEntityGetResponse, SourceJoinCriteria };
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 };
@@ -1647,6 +1647,13 @@ function createEntityMethods(entityData, service) {
1647
1647
  throw new Error('Entity ID is undefined');
1648
1648
  return service.insertRecordsById(entityData.id, data, options);
1649
1649
  },
1650
+ async updateRecord(recordId, data, options) {
1651
+ if (!entityData.id)
1652
+ throw new Error('Entity ID is undefined');
1653
+ if (!recordId)
1654
+ throw new Error('Record ID is undefined');
1655
+ return service.updateRecordById(entityData.id, recordId, data, options);
1656
+ },
1650
1657
  async updateRecords(data, options) {
1651
1658
  if (!entityData.id)
1652
1659
  throw new Error('Entity ID is undefined');
@@ -1732,6 +1739,7 @@ const DATA_FABRIC_ENDPOINTS = {
1732
1739
  GET_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/read/${recordId}`,
1733
1740
  INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert`,
1734
1741
  BATCH_INSERT_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/insert-batch`,
1742
+ UPDATE_RECORD_BY_ID: (entityId, recordId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update/${recordId}`,
1735
1743
  UPDATE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/update-batch`,
1736
1744
  DELETE_BY_ID: (entityId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${entityId}/delete-batch`,
1737
1745
  DOWNLOAD_ATTACHMENT: (entityId, recordId, fieldName) => `${DATAFABRIC_BASE}/api/Attachment/entity/${entityId}/${recordId}/${fieldName}`,
@@ -1893,7 +1901,7 @@ const EntityFieldTypeMap = {
1893
1901
  // Connection string placeholder that will be replaced during build
1894
1902
  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";
1895
1903
  // SDK Version placeholder
1896
- const SDK_VERSION = "1.2.0";
1904
+ const SDK_VERSION = "1.2.2";
1897
1905
  const VERSION = "Version";
1898
1906
  const SERVICE = "Service";
1899
1907
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -2360,6 +2368,42 @@ class EntityService extends BaseService {
2360
2368
  const camelResponse = pascalToCamelCaseKeys(response.data);
2361
2369
  return camelResponse;
2362
2370
  }
2371
+ /**
2372
+ * Updates a single record in an entity by entity ID
2373
+ *
2374
+ * @param entityId - UUID of the entity
2375
+ * @param recordId - UUID of the record to update
2376
+ * @param data - Key-value pairs of fields to update
2377
+ * @param options - Update options
2378
+ * @returns Promise resolving to the updated record
2379
+ *
2380
+ * @example
2381
+ * ```typescript
2382
+ * import { Entities } from '@uipath/uipath-typescript/entities';
2383
+ *
2384
+ * const entities = new Entities(sdk);
2385
+ *
2386
+ * // Basic usage
2387
+ * const result = await entities.updateRecordById("<entityId>", "<recordId>", { name: "John Updated", age: 31 });
2388
+ *
2389
+ * // With options
2390
+ * const result = await entities.updateRecordById("<entityId>", "<recordId>", { name: "John Updated", age: 31 }, {
2391
+ * expansionLevel: 1
2392
+ * });
2393
+ * ```
2394
+ */
2395
+ async updateRecordById(entityId, recordId, data, options = {}) {
2396
+ const params = createParams({
2397
+ expansionLevel: options.expansionLevel
2398
+ });
2399
+ const response = await this.post(DATA_FABRIC_ENDPOINTS.ENTITY.UPDATE_RECORD_BY_ID(entityId, recordId), data, {
2400
+ params,
2401
+ ...options
2402
+ });
2403
+ // Convert PascalCase response to camelCase
2404
+ const camelResponse = pascalToCamelCaseKeys(response.data);
2405
+ return camelResponse;
2406
+ }
2363
2407
  /**
2364
2408
  * Updates data in an entity by entity ID
2365
2409
  *
@@ -2691,6 +2735,9 @@ __decorate([
2691
2735
  __decorate([
2692
2736
  track('Entities.InsertRecordsById')
2693
2737
  ], EntityService.prototype, "insertRecordsById", null);
2738
+ __decorate([
2739
+ track('Entities.UpdateRecordById')
2740
+ ], EntityService.prototype, "updateRecordById", null);
2694
2741
  __decorate([
2695
2742
  track('Entities.UpdateRecordsById')
2696
2743
  ], EntityService.prototype, "updateRecordsById", null);