@uipath/uipath-typescript 1.0.0-beta.16 → 1.0.0-beta.18
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.
- package/README.md +1 -1
- package/dist/index.cjs +4104 -94
- package/dist/index.d.cts +415 -44
- package/dist/index.d.mts +415 -44
- package/dist/index.d.ts +415 -44
- package/dist/index.mjs +4104 -94
- package/dist/index.umd.js +3856 -3625
- package/package.json +5 -3
package/dist/index.d.ts
CHANGED
|
@@ -8,23 +8,7 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
8
8
|
clientId: z.ZodOptional<z.ZodString>;
|
|
9
9
|
redirectUri: z.ZodOptional<z.ZodString>;
|
|
10
10
|
scope: z.ZodOptional<z.ZodString>;
|
|
11
|
-
},
|
|
12
|
-
baseUrl: string;
|
|
13
|
-
orgName: string;
|
|
14
|
-
tenantName: string;
|
|
15
|
-
secret?: string | undefined;
|
|
16
|
-
clientId?: string | undefined;
|
|
17
|
-
redirectUri?: string | undefined;
|
|
18
|
-
scope?: string | undefined;
|
|
19
|
-
}, {
|
|
20
|
-
orgName: string;
|
|
21
|
-
tenantName: string;
|
|
22
|
-
baseUrl?: string | undefined;
|
|
23
|
-
secret?: string | undefined;
|
|
24
|
-
clientId?: string | undefined;
|
|
25
|
-
redirectUri?: string | undefined;
|
|
26
|
-
scope?: string | undefined;
|
|
27
|
-
}>;
|
|
11
|
+
}, z.core.$strip>;
|
|
28
12
|
type Config = z.infer<typeof ConfigSchema>;
|
|
29
13
|
|
|
30
14
|
/**
|
|
@@ -109,6 +93,9 @@ interface PaginationServiceAccess {
|
|
|
109
93
|
get<T>(path: string, options?: any): Promise<{
|
|
110
94
|
data: T;
|
|
111
95
|
}>;
|
|
96
|
+
post<T>(path: string, body?: any, options?: any): Promise<{
|
|
97
|
+
data: T;
|
|
98
|
+
}>;
|
|
112
99
|
requestWithPagination<T>(method: string, path: string, paginationOptions: PaginationOptions, options: RequestWithPaginationOptions): Promise<PaginatedResponse<T>>;
|
|
113
100
|
}
|
|
114
101
|
/**
|
|
@@ -470,9 +457,16 @@ interface EntityOperationOptions {
|
|
|
470
457
|
failOnFirst?: boolean;
|
|
471
458
|
}
|
|
472
459
|
/**
|
|
473
|
-
* Options for inserting
|
|
460
|
+
* Options for inserting a single record into an entity
|
|
461
|
+
*/
|
|
462
|
+
interface EntityInsertOptions {
|
|
463
|
+
/** Level of entity expansion (default: 0) */
|
|
464
|
+
expansionLevel?: number;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Options for batch inserting data into an entity
|
|
474
468
|
*/
|
|
475
|
-
type
|
|
469
|
+
type EntityBatchInsertOptions = EntityOperationOptions;
|
|
476
470
|
/**
|
|
477
471
|
* Options for updating data in an entity
|
|
478
472
|
*/
|
|
@@ -484,6 +478,17 @@ interface EntityDeleteOptions {
|
|
|
484
478
|
/** Whether to fail on first error (default: false) */
|
|
485
479
|
failOnFirst?: boolean;
|
|
486
480
|
}
|
|
481
|
+
/**
|
|
482
|
+
* Options for downloading an attachment from an entity record
|
|
483
|
+
*/
|
|
484
|
+
interface EntityDownloadAttachmentOptions {
|
|
485
|
+
/** Entity name */
|
|
486
|
+
entityName: string;
|
|
487
|
+
/** Record ID */
|
|
488
|
+
recordId: string;
|
|
489
|
+
/** Field name containing the attachment */
|
|
490
|
+
fieldName: string;
|
|
491
|
+
}
|
|
487
492
|
/**
|
|
488
493
|
* Represents a failure record in an entity operation
|
|
489
494
|
*/
|
|
@@ -503,9 +508,14 @@ interface EntityOperationResponse {
|
|
|
503
508
|
failureRecords: FailureRecord[];
|
|
504
509
|
}
|
|
505
510
|
/**
|
|
506
|
-
* Response from inserting
|
|
511
|
+
* Response from inserting a single record into an entity
|
|
512
|
+
* Returns the inserted record with its generated record ID and other fields
|
|
507
513
|
*/
|
|
508
|
-
type EntityInsertResponse =
|
|
514
|
+
type EntityInsertResponse = EntityRecord;
|
|
515
|
+
/**
|
|
516
|
+
* Response from batch inserting data into an entity
|
|
517
|
+
*/
|
|
518
|
+
type EntityBatchInsertResponse = EntityOperationResponse;
|
|
509
519
|
/**
|
|
510
520
|
* Response from updating data in an entity
|
|
511
521
|
*/
|
|
@@ -717,8 +727,13 @@ interface EntityServiceModel {
|
|
|
717
727
|
* const records = await customerEntity.getRecords();
|
|
718
728
|
* console.log(`Customer records: ${records.items.length}`);
|
|
719
729
|
*
|
|
720
|
-
*
|
|
721
|
-
*
|
|
730
|
+
* // Insert a single record
|
|
731
|
+
* const insertResult = await customerEntity.insert({ name: "John", age: 30 });
|
|
732
|
+
*
|
|
733
|
+
* // Or batch insert multiple records
|
|
734
|
+
* const batchResult = await customerEntity.batchInsert([
|
|
735
|
+
* { name: "Jane", age: 25 },
|
|
736
|
+
* { name: "Bob", age: 35 }
|
|
722
737
|
* ]);
|
|
723
738
|
* }
|
|
724
739
|
* ```
|
|
@@ -738,8 +753,19 @@ interface EntityServiceModel {
|
|
|
738
753
|
* // Call operations directly on the entity
|
|
739
754
|
* const records = await entity.getRecords();
|
|
740
755
|
*
|
|
741
|
-
*
|
|
742
|
-
*
|
|
756
|
+
* // If a field references a ChoiceSet, get the choiceSetId from records.fields
|
|
757
|
+
* const choiceSetId = records.fields[0].referenceChoiceSet?.id;
|
|
758
|
+
* if (choiceSetId) {
|
|
759
|
+
* const choiceSetValues = await sdk.entities.choicesets.getById(choiceSetId);
|
|
760
|
+
* }
|
|
761
|
+
*
|
|
762
|
+
* // Insert a single record
|
|
763
|
+
* const insertResult = await entity.insert({ name: "John", age: 30 });
|
|
764
|
+
*
|
|
765
|
+
* // Or batch insert multiple records
|
|
766
|
+
* const batchResult = await entity.batchInsert([
|
|
767
|
+
* { name: "Jane", age: 25 },
|
|
768
|
+
* { name: "Bob", age: 35 }
|
|
743
769
|
* ]);
|
|
744
770
|
* ```
|
|
745
771
|
*/
|
|
@@ -776,23 +802,49 @@ interface EntityServiceModel {
|
|
|
776
802
|
*/
|
|
777
803
|
getRecordsById<T extends EntityGetRecordsByIdOptions = EntityGetRecordsByIdOptions>(entityId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
|
|
778
804
|
/**
|
|
779
|
-
* Inserts
|
|
805
|
+
* Inserts a single record into an entity by entity ID
|
|
806
|
+
*
|
|
807
|
+
* Note: Data Fabric supports trigger events only on individual inserts, not on batch inserts.
|
|
808
|
+
* Use this method if you need trigger events to fire for the inserted record.
|
|
809
|
+
*
|
|
810
|
+
* @param id - UUID of the entity
|
|
811
|
+
* @param data - Record to insert
|
|
812
|
+
* @param options - Insert options
|
|
813
|
+
* @returns Promise resolving to the inserted record with generated record ID
|
|
814
|
+
* {@link EntityInsertResponse}
|
|
815
|
+
* @example
|
|
816
|
+
* ```typescript
|
|
817
|
+
* // Basic usage
|
|
818
|
+
* const result = await sdk.entities.insertById(<entityId>, { name: "John", age: 30 });
|
|
819
|
+
*
|
|
820
|
+
* // With options
|
|
821
|
+
* const result = await sdk.entities.insertById(<entityId>, { name: "John", age: 30 }, {
|
|
822
|
+
* expansionLevel: 1
|
|
823
|
+
* });
|
|
824
|
+
* ```
|
|
825
|
+
*/
|
|
826
|
+
insertById(id: string, data: Record<string, any>, options?: EntityInsertOptions): Promise<EntityInsertResponse>;
|
|
827
|
+
/**
|
|
828
|
+
* Inserts one or more records into an entity by entity ID using batch insert
|
|
829
|
+
*
|
|
830
|
+
* Note: Batch inserts do not trigger Data Fabric trigger events. Use {@link insertById} if you need
|
|
831
|
+
* trigger events to fire for each inserted record.
|
|
780
832
|
*
|
|
781
833
|
* @param id - UUID of the entity
|
|
782
834
|
* @param data - Array of records to insert
|
|
783
835
|
* @param options - Insert options
|
|
784
836
|
* @returns Promise resolving to insert response
|
|
785
|
-
* {@link
|
|
837
|
+
* {@link EntityBatchInsertResponse}
|
|
786
838
|
* @example
|
|
787
839
|
* ```typescript
|
|
788
840
|
* // Basic usage
|
|
789
|
-
* const result = await sdk.entities.
|
|
841
|
+
* const result = await sdk.entities.batchInsertById(<entityId>, [
|
|
790
842
|
* { name: "John", age: 30 },
|
|
791
843
|
* { name: "Jane", age: 25 }
|
|
792
844
|
* ]);
|
|
793
845
|
*
|
|
794
846
|
* // With options
|
|
795
|
-
* const result = await sdk.entities.
|
|
847
|
+
* const result = await sdk.entities.batchInsertById(<entityId>, [
|
|
796
848
|
* { name: "John", age: 30 },
|
|
797
849
|
* { name: "Jane", age: 25 }
|
|
798
850
|
* ], {
|
|
@@ -801,7 +853,7 @@ interface EntityServiceModel {
|
|
|
801
853
|
* });
|
|
802
854
|
* ```
|
|
803
855
|
*/
|
|
804
|
-
|
|
856
|
+
batchInsertById(id: string, data: Record<string, any>[], options?: EntityBatchInsertOptions): Promise<EntityBatchInsertResponse>;
|
|
805
857
|
/**
|
|
806
858
|
* Updates data in an entity by entity ID
|
|
807
859
|
*
|
|
@@ -846,19 +898,76 @@ interface EntityServiceModel {
|
|
|
846
898
|
* ```
|
|
847
899
|
*/
|
|
848
900
|
deleteById(id: string, recordIds: string[], options?: EntityDeleteOptions): Promise<EntityDeleteResponse>;
|
|
901
|
+
/**
|
|
902
|
+
* Downloads an attachment stored in a File-type field of an entity record.
|
|
903
|
+
*
|
|
904
|
+
* @param options - Options containing entityName, recordId, and fieldName
|
|
905
|
+
* @returns Promise resolving to Blob containing the file content
|
|
906
|
+
* @example
|
|
907
|
+
* ```typescript
|
|
908
|
+
* // First, get records to obtain the record ID
|
|
909
|
+
* const records = await sdk.entities.getRecordsById(<entityId>);
|
|
910
|
+
* // Get the recordId for the record that contains the attachment
|
|
911
|
+
* const recordId = records.items[0].id;
|
|
912
|
+
*
|
|
913
|
+
* // Download attachment using SDK method
|
|
914
|
+
* const response = await sdk.entities.downloadAttachment({
|
|
915
|
+
* entityName: 'Invoice',
|
|
916
|
+
* recordId: recordId,
|
|
917
|
+
* fieldName: 'Documents'
|
|
918
|
+
* });
|
|
919
|
+
*
|
|
920
|
+
* // Or download using entity method
|
|
921
|
+
* const entity = await sdk.entities.getById(<entityId>);
|
|
922
|
+
* const response = await entity.downloadAttachment(recordId, 'Documents');
|
|
923
|
+
*
|
|
924
|
+
* // Browser: Display Image
|
|
925
|
+
* const url = URL.createObjectURL(response);
|
|
926
|
+
* document.getElementById('image').src = url;
|
|
927
|
+
* // Call URL.revokeObjectURL(url) when done
|
|
928
|
+
*
|
|
929
|
+
* // Browser: Display PDF in iframe
|
|
930
|
+
* const url = URL.createObjectURL(response);
|
|
931
|
+
* document.getElementById('pdf-viewer').src = url;
|
|
932
|
+
* // Call URL.revokeObjectURL(url) when done
|
|
933
|
+
*
|
|
934
|
+
* // Browser: Render PDF with PDF.js
|
|
935
|
+
* const arrayBuffer = await response.arrayBuffer();
|
|
936
|
+
* const pdf = await pdfjsLib.getDocument({ data: arrayBuffer }).promise;
|
|
937
|
+
*
|
|
938
|
+
* // Node.js: Save to file
|
|
939
|
+
* const buffer = Buffer.from(await response.arrayBuffer());
|
|
940
|
+
* fs.writeFileSync('attachment.pdf', buffer);
|
|
941
|
+
* ```
|
|
942
|
+
*/
|
|
943
|
+
downloadAttachment(options: EntityDownloadAttachmentOptions): Promise<Blob>;
|
|
849
944
|
}
|
|
850
945
|
/**
|
|
851
946
|
* Entity methods interface - defines operations that can be performed on an entity
|
|
852
947
|
*/
|
|
853
948
|
interface EntityMethods {
|
|
854
949
|
/**
|
|
855
|
-
* Insert
|
|
950
|
+
* Insert a single record into this entity
|
|
951
|
+
*
|
|
952
|
+
* Note: Data Fabric supports trigger events only on individual inserts, not on batch inserts.
|
|
953
|
+
* Use this method if you need trigger events to fire for the inserted record.
|
|
954
|
+
*
|
|
955
|
+
* @param data - Record to insert
|
|
956
|
+
* @param options - Insert options
|
|
957
|
+
* @returns Promise resolving to the inserted record with generated record ID
|
|
958
|
+
*/
|
|
959
|
+
insert(data: Record<string, any>, options?: EntityInsertOptions): Promise<EntityInsertResponse>;
|
|
960
|
+
/**
|
|
961
|
+
* Insert multiple records into this entity using batch insert
|
|
962
|
+
*
|
|
963
|
+
* Note: Batch inserts do not trigger Data Fabric trigger events. Use {@link insert} if you need
|
|
964
|
+
* trigger events to fire for each inserted record.
|
|
856
965
|
*
|
|
857
966
|
* @param data - Array of records to insert
|
|
858
967
|
* @param options - Insert options
|
|
859
|
-
* @returns Promise resolving to insert response
|
|
968
|
+
* @returns Promise resolving to batch insert response
|
|
860
969
|
*/
|
|
861
|
-
|
|
970
|
+
batchInsert(data: Record<string, any>[], options?: EntityBatchInsertOptions): Promise<EntityBatchInsertResponse>;
|
|
862
971
|
/**
|
|
863
972
|
* Update data in this entity
|
|
864
973
|
*
|
|
@@ -883,6 +992,14 @@ interface EntityMethods {
|
|
|
883
992
|
* @returns Promise resolving to query response
|
|
884
993
|
*/
|
|
885
994
|
getRecords<T extends EntityGetRecordsByIdOptions = EntityGetRecordsByIdOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
|
|
995
|
+
/**
|
|
996
|
+
* Downloads an attachment stored in a File-type field of an entity record
|
|
997
|
+
*
|
|
998
|
+
* @param recordId - UUID of the record containing the attachment
|
|
999
|
+
* @param fieldName - Name of the File-type field containing the attachment
|
|
1000
|
+
* @returns Promise resolving to Blob containing the file content
|
|
1001
|
+
*/
|
|
1002
|
+
downloadAttachment(recordId: string, fieldName: string): Promise<Blob>;
|
|
886
1003
|
}
|
|
887
1004
|
/**
|
|
888
1005
|
* Entity with methods combining metadata with operation methods
|
|
@@ -919,8 +1036,13 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
919
1036
|
* // Call operations directly on the entity
|
|
920
1037
|
* const records = await entity.getRecords();
|
|
921
1038
|
*
|
|
922
|
-
*
|
|
923
|
-
*
|
|
1039
|
+
* // Insert a single record
|
|
1040
|
+
* const insertResult = await entity.insert({ name: "John", age: 30 });
|
|
1041
|
+
*
|
|
1042
|
+
* // Or batch insert multiple records
|
|
1043
|
+
* const batchResult = await entity.batchInsert([
|
|
1044
|
+
* { name: "Jane", age: 25 },
|
|
1045
|
+
* { name: "Bob", age: 35 }
|
|
924
1046
|
* ]);
|
|
925
1047
|
* ```
|
|
926
1048
|
*/
|
|
@@ -957,7 +1079,27 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
957
1079
|
*/
|
|
958
1080
|
getRecordsById<T extends EntityGetRecordsByIdOptions = EntityGetRecordsByIdOptions>(entityId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
|
|
959
1081
|
/**
|
|
960
|
-
* Inserts
|
|
1082
|
+
* Inserts a single record into an entity by entity ID
|
|
1083
|
+
*
|
|
1084
|
+
* @param entityId - UUID of the entity
|
|
1085
|
+
* @param data - Record to insert
|
|
1086
|
+
* @param options - Insert options
|
|
1087
|
+
* @returns Promise resolving to the inserted record with generated record ID
|
|
1088
|
+
*
|
|
1089
|
+
* @example
|
|
1090
|
+
* ```typescript
|
|
1091
|
+
* // Basic usage
|
|
1092
|
+
* const result = await sdk.entities.insertById(<entityId>, { name: "John", age: 30 });
|
|
1093
|
+
*
|
|
1094
|
+
* // With options
|
|
1095
|
+
* const result = await sdk.entities.insertById(<entityId>, { name: "John", age: 30 }, {
|
|
1096
|
+
* expansionLevel: 1
|
|
1097
|
+
* });
|
|
1098
|
+
* ```
|
|
1099
|
+
*/
|
|
1100
|
+
insertById(id: string, data: Record<string, any>, options?: EntityInsertOptions): Promise<EntityInsertResponse>;
|
|
1101
|
+
/**
|
|
1102
|
+
* Inserts data into an entity by entity ID using batch insert
|
|
961
1103
|
*
|
|
962
1104
|
* @param entityId - UUID of the entity
|
|
963
1105
|
* @param data - Array of records to insert
|
|
@@ -967,13 +1109,13 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
967
1109
|
* @example
|
|
968
1110
|
* ```typescript
|
|
969
1111
|
* // Basic usage
|
|
970
|
-
* const result = await sdk.entities.
|
|
1112
|
+
* const result = await sdk.entities.batchInsertById(<entityId>, [
|
|
971
1113
|
* { name: "John", age: 30 },
|
|
972
1114
|
* { name: "Jane", age: 25 }
|
|
973
1115
|
* ]);
|
|
974
1116
|
*
|
|
975
1117
|
* // With options
|
|
976
|
-
* const result = await sdk.entities.
|
|
1118
|
+
* const result = await sdk.entities.batchInsertById(<entityId>, [
|
|
977
1119
|
* { name: "John", age: 30 },
|
|
978
1120
|
* { name: "Jane", age: 25 }
|
|
979
1121
|
* ], {
|
|
@@ -982,7 +1124,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
982
1124
|
* });
|
|
983
1125
|
* ```
|
|
984
1126
|
*/
|
|
985
|
-
|
|
1127
|
+
batchInsertById(id: string, data: Record<string, any>[], options?: EntityBatchInsertOptions): Promise<EntityBatchInsertResponse>;
|
|
986
1128
|
/**
|
|
987
1129
|
* Updates data in an entity by entity ID
|
|
988
1130
|
*
|
|
@@ -1043,6 +1185,22 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1043
1185
|
* ```
|
|
1044
1186
|
*/
|
|
1045
1187
|
getAll(): Promise<EntityGetResponse[]>;
|
|
1188
|
+
/**
|
|
1189
|
+
* Downloads an attachment from an entity record field
|
|
1190
|
+
*
|
|
1191
|
+
* @param options - Options containing entityName, recordId, and fieldName
|
|
1192
|
+
* @returns Promise resolving to Blob containing the file content
|
|
1193
|
+
*
|
|
1194
|
+
* @example
|
|
1195
|
+
* ```typescript
|
|
1196
|
+
* // Download attachment for a specific record and field
|
|
1197
|
+
* const blob = await sdk.entities.downloadAttachment({
|
|
1198
|
+
* entityName: 'Invoice',
|
|
1199
|
+
* recordId: '<record-uuid>',
|
|
1200
|
+
* fieldName: 'Documents'
|
|
1201
|
+
* });
|
|
1202
|
+
*/
|
|
1203
|
+
downloadAttachment(options: EntityDownloadAttachmentOptions): Promise<Blob>;
|
|
1046
1204
|
/**
|
|
1047
1205
|
* Orchestrates all field mapping transformations
|
|
1048
1206
|
*
|
|
@@ -1070,6 +1228,189 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1070
1228
|
private mapExternalFields;
|
|
1071
1229
|
}
|
|
1072
1230
|
|
|
1231
|
+
/**
|
|
1232
|
+
* ChoiceSet Get All Response
|
|
1233
|
+
* Only exposes essential fields to SDK users
|
|
1234
|
+
*/
|
|
1235
|
+
interface ChoiceSetGetAllResponse {
|
|
1236
|
+
/** Name identifier of the choice set */
|
|
1237
|
+
name: string;
|
|
1238
|
+
/** Human-readable display name of the choice set*/
|
|
1239
|
+
displayName: string;
|
|
1240
|
+
/** Description of the choice set */
|
|
1241
|
+
description: string;
|
|
1242
|
+
/** Folder ID where the choice set is located */
|
|
1243
|
+
folderId: string;
|
|
1244
|
+
/** User ID who created the choice set */
|
|
1245
|
+
createdBy: string;
|
|
1246
|
+
/** User ID who last updated the choice set */
|
|
1247
|
+
updatedBy: string;
|
|
1248
|
+
/** Creation timestamp */
|
|
1249
|
+
createdTime: string;
|
|
1250
|
+
/** Last update timestamp */
|
|
1251
|
+
updatedTime: string;
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* Represents a single choice set value/record
|
|
1255
|
+
*/
|
|
1256
|
+
interface ChoiceSetGetResponse {
|
|
1257
|
+
/** Unique identifier for the choice set value */
|
|
1258
|
+
id: string;
|
|
1259
|
+
/** Name of the choice set value */
|
|
1260
|
+
name: string;
|
|
1261
|
+
/** Human-readable display name of the choice set value*/
|
|
1262
|
+
displayName: string;
|
|
1263
|
+
/** Numeric identifier */
|
|
1264
|
+
numberId: number;
|
|
1265
|
+
/** Creation timestamp */
|
|
1266
|
+
createdTime: string;
|
|
1267
|
+
/** Last update timestamp */
|
|
1268
|
+
updatedTime: string;
|
|
1269
|
+
/** User ID who created this value */
|
|
1270
|
+
createdBy?: string;
|
|
1271
|
+
/** User ID who last updated this value */
|
|
1272
|
+
updatedBy?: string;
|
|
1273
|
+
/** User ID of the record owner */
|
|
1274
|
+
recordOwner?: string;
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Options for getting choice set values by choice set ID
|
|
1278
|
+
*/
|
|
1279
|
+
type ChoiceSetGetByIdOptions = PaginationOptions;
|
|
1280
|
+
|
|
1281
|
+
/**
|
|
1282
|
+
* Service for managing UiPath Data Fabric Choice Sets
|
|
1283
|
+
*
|
|
1284
|
+
* Choice Sets are enumerated lists of values that can be used as field types in entities. They enable single-select or multi-select fields, such as expense types, categories, or status values. [UiPath Choice Sets Guide](https://docs.uipath.com/data-service/automation-cloud/latest/user-guide/choice-sets)
|
|
1285
|
+
*/
|
|
1286
|
+
interface ChoiceSetServiceModel {
|
|
1287
|
+
/**
|
|
1288
|
+
* Gets all choice sets in the org
|
|
1289
|
+
*
|
|
1290
|
+
* @returns Promise resolving to an array of choice set metadata
|
|
1291
|
+
* {@link ChoiceSetGetAllResponse}
|
|
1292
|
+
* @example
|
|
1293
|
+
* ```typescript
|
|
1294
|
+
* // Get all choice sets
|
|
1295
|
+
* const choiceSets = await sdk.entities.choicesets.getAll();
|
|
1296
|
+
*
|
|
1297
|
+
* // Iterate through choice sets
|
|
1298
|
+
* choiceSets.forEach(choiceSet => {
|
|
1299
|
+
* console.log(`ChoiceSet: ${choiceSet.displayName} (${choiceSet.name})`);
|
|
1300
|
+
* console.log(`Description: ${choiceSet.description}`);
|
|
1301
|
+
* console.log(`Created by: ${choiceSet.createdBy}`);
|
|
1302
|
+
* });
|
|
1303
|
+
*
|
|
1304
|
+
* // Find a specific choice set by name
|
|
1305
|
+
* const expenseTypes = choiceSets.find(cs => cs.name === 'ExpenseTypes');
|
|
1306
|
+
*
|
|
1307
|
+
* // Check choice set details
|
|
1308
|
+
* if (expenseTypes) {
|
|
1309
|
+
* console.log(`Last updated: ${expenseTypes.updatedTime}`);
|
|
1310
|
+
* console.log(`Updated by: ${expenseTypes.updatedBy}`);
|
|
1311
|
+
* }
|
|
1312
|
+
* ```
|
|
1313
|
+
*/
|
|
1314
|
+
getAll(): Promise<ChoiceSetGetAllResponse[]>;
|
|
1315
|
+
/**
|
|
1316
|
+
* Gets choice set values by choice set ID with optional pagination
|
|
1317
|
+
*
|
|
1318
|
+
* The method returns either:
|
|
1319
|
+
* - A NonPaginatedResponse with items array (when no pagination parameters are provided)
|
|
1320
|
+
* - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
|
|
1321
|
+
*
|
|
1322
|
+
* @param choiceSetId - UUID of the choice set
|
|
1323
|
+
* @param options - Pagination options
|
|
1324
|
+
* @returns Promise resolving to choice set values or paginated result
|
|
1325
|
+
* {@link ChoiceSetGetResponse}
|
|
1326
|
+
* @example
|
|
1327
|
+
* ```typescript
|
|
1328
|
+
* // First, get the choice set ID using getAll()
|
|
1329
|
+
* const choiceSets = await sdk.entities.choicesets.getAll();
|
|
1330
|
+
* const expenseTypes = choiceSets.find(cs => cs.name === 'ExpenseTypes');
|
|
1331
|
+
* const choiceSetId = expenseTypes.id;
|
|
1332
|
+
*
|
|
1333
|
+
* // Get all values (non-paginated)
|
|
1334
|
+
* const values = await sdk.entities.choicesets.getById(choiceSetId);
|
|
1335
|
+
*
|
|
1336
|
+
* // Iterate through choice set values
|
|
1337
|
+
* for (const value of values.items) {
|
|
1338
|
+
* console.log(`Value: ${value.displayName}`);
|
|
1339
|
+
* }
|
|
1340
|
+
*
|
|
1341
|
+
* // First page with pagination
|
|
1342
|
+
* const page1 = await sdk.entities.choicesets.getById(choiceSetId, { pageSize: 10 });
|
|
1343
|
+
*
|
|
1344
|
+
* // Navigate using cursor
|
|
1345
|
+
* if (page1.hasNextPage) {
|
|
1346
|
+
* const page2 = await sdk.entities.choicesets.getById(choiceSetId, { cursor: page1.nextCursor });
|
|
1347
|
+
* }
|
|
1348
|
+
* ```
|
|
1349
|
+
*/
|
|
1350
|
+
getById<T extends ChoiceSetGetByIdOptions = ChoiceSetGetByIdOptions>(choiceSetId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ChoiceSetGetResponse> : NonPaginatedResponse<ChoiceSetGetResponse>>;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
declare class ChoiceSetService extends BaseService implements ChoiceSetServiceModel {
|
|
1354
|
+
/**
|
|
1355
|
+
* @hideconstructor
|
|
1356
|
+
*/
|
|
1357
|
+
constructor(config: Config, executionContext: ExecutionContext, tokenManager: TokenManager);
|
|
1358
|
+
/**
|
|
1359
|
+
* Gets all choice sets in the system
|
|
1360
|
+
*
|
|
1361
|
+
* @returns Promise resolving to an array of choice set metadata
|
|
1362
|
+
*
|
|
1363
|
+
* @example
|
|
1364
|
+
* ```typescript
|
|
1365
|
+
* // Get all choice sets
|
|
1366
|
+
* const choiceSets = await sdk.entities.choicesets.getAll();
|
|
1367
|
+
*
|
|
1368
|
+
* // Iterate through choice sets
|
|
1369
|
+
* choiceSets.forEach(choiceSet => {
|
|
1370
|
+
* console.log(`ChoiceSet: ${choiceSet.displayName} (${choiceSet.name})`);
|
|
1371
|
+
* console.log(`Description: ${choiceSet.description}`);
|
|
1372
|
+
* });
|
|
1373
|
+
* ```
|
|
1374
|
+
*/
|
|
1375
|
+
getAll(): Promise<ChoiceSetGetAllResponse[]>;
|
|
1376
|
+
/**
|
|
1377
|
+
* Gets choice set values by choice set ID with optional pagination
|
|
1378
|
+
*
|
|
1379
|
+
* The method returns either:
|
|
1380
|
+
* - A NonPaginatedResponse with items array (when no pagination parameters are provided)
|
|
1381
|
+
* - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
|
|
1382
|
+
*
|
|
1383
|
+
* @param choiceSetId - UUID of the choice set
|
|
1384
|
+
* @param options - Pagination options
|
|
1385
|
+
* @returns Promise resolving to choice set values or paginated result
|
|
1386
|
+
*
|
|
1387
|
+
* @example
|
|
1388
|
+
* ```typescript
|
|
1389
|
+
* // First, get the choice set ID using getAll()
|
|
1390
|
+
* const choiceSets = await sdk.entities.choicesets.getAll();
|
|
1391
|
+
* const expenseTypes = choiceSets.find(cs => cs.name === 'ExpenseTypes');
|
|
1392
|
+
* const choiceSetId = expenseTypes.id;
|
|
1393
|
+
*
|
|
1394
|
+
* // Get all values (non-paginated)
|
|
1395
|
+
* const values = await sdk.entities.choicesets.getById(choiceSetId);
|
|
1396
|
+
*
|
|
1397
|
+
* // Iterate through choice set values
|
|
1398
|
+
* for (const value of values.items) {
|
|
1399
|
+
* console.log(`Value: ${value.displayName} (${value.name})`);
|
|
1400
|
+
* }
|
|
1401
|
+
*
|
|
1402
|
+
* // First page with pagination
|
|
1403
|
+
* const page1 = await sdk.entities.choicesets.getById(choiceSetId, { pageSize: 10 });
|
|
1404
|
+
*
|
|
1405
|
+
* // Navigate using cursor
|
|
1406
|
+
* if (page1.hasNextPage) {
|
|
1407
|
+
* const page2 = await sdk.entities.choicesets.getById(choiceSetId, { cursor: page1.nextCursor });
|
|
1408
|
+
* }
|
|
1409
|
+
* ```
|
|
1410
|
+
*/
|
|
1411
|
+
getById<T extends ChoiceSetGetByIdOptions = ChoiceSetGetByIdOptions>(choiceSetId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ChoiceSetGetResponse> : NonPaginatedResponse<ChoiceSetGetResponse>>;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1073
1414
|
/**
|
|
1074
1415
|
* Maestro Process Types
|
|
1075
1416
|
* Types and interfaces for Maestro process management
|
|
@@ -2249,6 +2590,14 @@ type TaskGetAllOptions = RequestOptions & PaginationOptions & {
|
|
|
2249
2590
|
* Optional folder ID to filter tasks by folder
|
|
2250
2591
|
*/
|
|
2251
2592
|
folderId?: number;
|
|
2593
|
+
/**
|
|
2594
|
+
* Optional flag to fetch tasks using admin permissions
|
|
2595
|
+
* When true, fetches tasks across folders
|
|
2596
|
+
* where the user has at least Task.View, Task.Edit and TaskAssignment.Create permissions
|
|
2597
|
+
* When false or omitted, fetches tasks across folders
|
|
2598
|
+
* where the user has at least Task.View and Task.Edit permissions
|
|
2599
|
+
*/
|
|
2600
|
+
asTaskAdmin?: boolean;
|
|
2252
2601
|
};
|
|
2253
2602
|
/**
|
|
2254
2603
|
* Query options for getting a task by ID
|
|
@@ -2269,7 +2618,7 @@ interface TaskServiceModel {
|
|
|
2269
2618
|
/**
|
|
2270
2619
|
* Gets all tasks across folders with optional filtering
|
|
2271
2620
|
*
|
|
2272
|
-
* @param options - Query options including optional folderId and pagination options
|
|
2621
|
+
* @param options - Query options including optional folderId, asTaskAdmin flag and pagination options
|
|
2273
2622
|
* @returns Promise resolving to either an array of tasks NonPaginatedResponse<TaskGetResponse> or a PaginatedResponse<TaskGetResponse> when pagination options are used.
|
|
2274
2623
|
* {@link TaskGetResponse}
|
|
2275
2624
|
* @example
|
|
@@ -2282,6 +2631,18 @@ interface TaskServiceModel {
|
|
|
2282
2631
|
* folderId: 123
|
|
2283
2632
|
* });
|
|
2284
2633
|
*
|
|
2634
|
+
* // Get tasks with admin permissions
|
|
2635
|
+
* // This fetches tasks across folders where the user has Task.View, Task.Edit and TaskAssignment.Create permissions
|
|
2636
|
+
* const tasks = await sdk.tasks.getAll({
|
|
2637
|
+
* asTaskAdmin: true
|
|
2638
|
+
* });
|
|
2639
|
+
*
|
|
2640
|
+
* // Get tasks without admin permissions (default)
|
|
2641
|
+
* // This fetches tasks across folders where the user has Task.View and Task.Edit permissions
|
|
2642
|
+
* const tasks = await sdk.tasks.getAll({
|
|
2643
|
+
* asTaskAdmin: false
|
|
2644
|
+
* });
|
|
2645
|
+
*
|
|
2285
2646
|
* // First page with pagination
|
|
2286
2647
|
* const page1 = await sdk.tasks.getAll({ pageSize: 10 });
|
|
2287
2648
|
*
|
|
@@ -4502,7 +4863,7 @@ declare class TaskService extends BaseService implements TaskServiceModel {
|
|
|
4502
4863
|
* - An array of tasks (when no pagination parameters are provided)
|
|
4503
4864
|
* - A paginated result with navigation cursors (when any pagination parameter is provided)
|
|
4504
4865
|
*
|
|
4505
|
-
* @param options - Query options including optional folderId and pagination options
|
|
4866
|
+
* @param options - Query options including optional folderId, asTaskAdmin flag and pagination options
|
|
4506
4867
|
* @returns Promise resolving to an array of tasks or paginated result
|
|
4507
4868
|
*
|
|
4508
4869
|
* @example
|
|
@@ -4515,6 +4876,11 @@ declare class TaskService extends BaseService implements TaskServiceModel {
|
|
|
4515
4876
|
* folderId: 123
|
|
4516
4877
|
* });
|
|
4517
4878
|
*
|
|
4879
|
+
* // Get tasks with admin permissions
|
|
4880
|
+
* const tasks = await sdk.tasks.getAll({
|
|
4881
|
+
* asTaskAdmin: true
|
|
4882
|
+
* });
|
|
4883
|
+
*
|
|
4518
4884
|
* // First page with pagination
|
|
4519
4885
|
* const page1 = await sdk.tasks.getAll({ pageSize: 10 });
|
|
4520
4886
|
*
|
|
@@ -4769,7 +5135,12 @@ declare class UiPath {
|
|
|
4769
5135
|
/**
|
|
4770
5136
|
* Access to Entity service
|
|
4771
5137
|
*/
|
|
4772
|
-
get entities(): EntityService
|
|
5138
|
+
get entities(): EntityService & {
|
|
5139
|
+
/**
|
|
5140
|
+
* Access to ChoiceSet service for managing choice sets
|
|
5141
|
+
*/
|
|
5142
|
+
choicesets: ChoiceSetService;
|
|
5143
|
+
};
|
|
4773
5144
|
/**
|
|
4774
5145
|
* Access to Tasks service
|
|
4775
5146
|
*/
|
|
@@ -5073,7 +5444,7 @@ declare const telemetryClient: TelemetryClient;
|
|
|
5073
5444
|
* SDK Telemetry constants
|
|
5074
5445
|
*/
|
|
5075
5446
|
declare 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";
|
|
5076
|
-
declare const SDK_VERSION = "1.0.0-beta.
|
|
5447
|
+
declare const SDK_VERSION = "1.0.0-beta.18";
|
|
5077
5448
|
declare const VERSION = "Version";
|
|
5078
5449
|
declare const SERVICE = "Service";
|
|
5079
5450
|
declare const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -5089,4 +5460,4 @@ declare const SDK_RUN_EVENT = "Sdk.Run";
|
|
|
5089
5460
|
declare const UNKNOWN = "";
|
|
5090
5461
|
|
|
5091
5462
|
export { APP_NAME, AssetValueScope, AssetValueType, AuthenticationError, AuthorizationError, BucketOptions, CLOUD_CLIENT_ID, CLOUD_ORGANIZATION_NAME, CLOUD_REDIRECT_URI, CLOUD_ROLE_NAME, CLOUD_TENANT_NAME, CLOUD_URL, CONNECTION_STRING, DEFAULT_ITEMS_FIELD, DEFAULT_PAGE_SIZE, DEFAULT_TOTAL_COUNT_FIELD, DataDirectionType, DebugMode, EntityFieldDataType, EntityType, ErrorType, EscalationActionType, EscalationRecipientScope, EscalationTriggerType, FieldDisplayType, HttpStatus, JobPriority, JobState, JobType, JoinType, MAX_PAGE_SIZE, NetworkError, NotFoundError, PackageSourceType, PackageType, ProcessIncidentSeverity, ProcessIncidentStatus, ProcessIncidentType, RateLimitError, ReferenceType, RemoteControlAccess, RobotSize, SDK_LOGGER_NAME, SDK_RUN_EVENT, SDK_SERVICE_NAME, SDK_VERSION, SERVICE, SLADurationUnit, ServerError, StageTaskType, StartStrategy, StopStrategy, TargetFramework, TaskActivityType, TaskPriority, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, UNKNOWN, UiPath, UiPathError, VERSION, ValidationError, createCaseInstanceWithMethods, createEntityWithMethods, createProcessInstanceWithMethods, createProcessWithMethods, createTaskWithMethods, getErrorDetails, getLimitedPageSize, isAuthenticationError, isAuthorizationError, isNetworkError, isNotFoundError, isRateLimitError, isServerError, isUiPathError, isValidationError, telemetryClient, track, trackEvent };
|
|
5092
|
-
export type { ArgumentMetadata, AssetGetAllOptions, AssetGetByIdOptions, AssetGetResponse, AssetServiceModel, BaseConfig, BaseOptions, BlobItem, BodyOptions, BpmnXmlString, BucketGetAllOptions, BucketGetByIdOptions, BucketGetFileMetaDataOptions, BucketGetFileMetaDataResponse, BucketGetFileMetaDataWithPaginationOptions, BucketGetReadUriOptions, BucketGetResponse, BucketGetUriOptions, BucketGetUriResponse, BucketServiceModel, BucketUploadFileOptions, BucketUploadResponse, CaseAppConfig, CaseAppOverview, CaseGetAllResponse, CaseGetStageResponse, CaseInstanceExecutionHistoryResponse, CaseInstanceGetAllOptions, CaseInstanceGetAllWithPaginationOptions, CaseInstanceGetResponse, CaseInstanceMethods, CaseInstanceOperationOptions, CaseInstanceOperationResponse, CaseInstanceRun, CaseInstancesServiceModel, CasesServiceModel, CollectionResponse, CustomKeyValuePair, ElementExecutionMetadata, ElementMetaData, ElementRunMetadata, EntityDeleteOptions, EntityDeleteResponse, EntityGetRecordsByIdOptions, EntityGetResponse, EntityInsertOptions, EntityInsertResponse, EntityMethods, EntityOperationOptions, EntityOperationResponse, EntityRecord, EntityServiceModel, EntityUpdateOptions, EntityUpdateResponse, EscalationAction, EscalationRecipient, EscalationRule, EscalationTriggerMetadata, ExternalConnection, ExternalField, ExternalFieldMapping, ExternalObject, ExternalSourceFields, FailureRecord, Field, FieldDataType, FieldMetaData, FolderProperties, GlobalVariableMetaData, HasPaginationOptions, Headers, HttpMethod, JobAttachment, JobError, Machine, MaestroProcessGetAllResponse, MaestroProcessesServiceModel, NonPaginatedResponse, OAuthFields, OperationResponse, PaginatedResponse, PaginationCursor, PaginationMetadata, PaginationMethodUnion, PaginationOptions, ProcessGetAllOptions, ProcessGetByIdOptions, ProcessGetResponse, ProcessIncidentGetAllResponse, ProcessIncidentGetResponse, ProcessIncidentsServiceModel, ProcessInstanceExecutionHistoryResponse, ProcessInstanceGetAllOptions, ProcessInstanceGetAllWithPaginationOptions, ProcessInstanceGetResponse, ProcessInstanceGetVariablesOptions, ProcessInstanceGetVariablesResponse, ProcessInstanceMethods, ProcessInstanceOperationOptions, ProcessInstanceOperationResponse, ProcessInstanceRun, ProcessInstancesServiceModel, ProcessMethods, ProcessProperties, ProcessServiceModel, ProcessStartRequest, ProcessStartResponse, QueryParams, QueueGetAllOptions, QueueGetByIdOptions, QueueGetResponse, QueueServiceModel, RawCaseInstanceGetResponse, RawEntityGetResponse, RawMaestroProcessGetAllResponse, RawProcessInstanceGetResponse, RawTaskCreateResponse, RawTaskGetResponse, RequestOptions, RequestSpec, ResponseDictionary, ResponseType, RetryOptions, RobotMetadata, SourceJoinCriteria, StageSLA, StageTask, Tag, TaskActivity, TaskAssignOptions, TaskAssignment, TaskAssignmentOptions, TaskAssignmentResponse, TaskBaseResponse, TaskCompleteOptions, TaskCompletionOptions, TaskCreateOptions, TaskCreateResponse, TaskGetAllOptions, TaskGetByIdOptions, TaskGetResponse, TaskGetUsersOptions, TaskMethods, TaskServiceModel, TaskSlaDetail, TaskSource, TasksUnassignOptions, TimeoutOptions, UiPathSDKConfig, UserLoginInfo };
|
|
5463
|
+
export type { ArgumentMetadata, AssetGetAllOptions, AssetGetByIdOptions, AssetGetResponse, AssetServiceModel, BaseConfig, BaseOptions, BlobItem, BodyOptions, BpmnXmlString, BucketGetAllOptions, BucketGetByIdOptions, BucketGetFileMetaDataOptions, BucketGetFileMetaDataResponse, BucketGetFileMetaDataWithPaginationOptions, BucketGetReadUriOptions, BucketGetResponse, BucketGetUriOptions, BucketGetUriResponse, BucketServiceModel, BucketUploadFileOptions, BucketUploadResponse, CaseAppConfig, CaseAppOverview, CaseGetAllResponse, CaseGetStageResponse, CaseInstanceExecutionHistoryResponse, CaseInstanceGetAllOptions, CaseInstanceGetAllWithPaginationOptions, CaseInstanceGetResponse, CaseInstanceMethods, CaseInstanceOperationOptions, CaseInstanceOperationResponse, CaseInstanceRun, CaseInstancesServiceModel, CasesServiceModel, ChoiceSetGetAllResponse, ChoiceSetGetByIdOptions, ChoiceSetGetResponse, ChoiceSetServiceModel, CollectionResponse, CustomKeyValuePair, ElementExecutionMetadata, ElementMetaData, ElementRunMetadata, EntityBatchInsertOptions, EntityBatchInsertResponse, EntityDeleteOptions, EntityDeleteResponse, EntityDownloadAttachmentOptions, EntityGetRecordsByIdOptions, EntityGetResponse, EntityInsertOptions, EntityInsertResponse, EntityMethods, EntityOperationOptions, EntityOperationResponse, EntityRecord, EntityServiceModel, EntityUpdateOptions, EntityUpdateResponse, EscalationAction, EscalationRecipient, EscalationRule, EscalationTriggerMetadata, ExternalConnection, ExternalField, ExternalFieldMapping, ExternalObject, ExternalSourceFields, FailureRecord, Field, FieldDataType, FieldMetaData, FolderProperties, GlobalVariableMetaData, HasPaginationOptions, Headers, HttpMethod, JobAttachment, JobError, Machine, MaestroProcessGetAllResponse, MaestroProcessesServiceModel, NonPaginatedResponse, OAuthFields, OperationResponse, PaginatedResponse, PaginationCursor, PaginationMetadata, PaginationMethodUnion, PaginationOptions, ProcessGetAllOptions, ProcessGetByIdOptions, ProcessGetResponse, ProcessIncidentGetAllResponse, ProcessIncidentGetResponse, ProcessIncidentsServiceModel, ProcessInstanceExecutionHistoryResponse, ProcessInstanceGetAllOptions, ProcessInstanceGetAllWithPaginationOptions, ProcessInstanceGetResponse, ProcessInstanceGetVariablesOptions, ProcessInstanceGetVariablesResponse, ProcessInstanceMethods, ProcessInstanceOperationOptions, ProcessInstanceOperationResponse, ProcessInstanceRun, ProcessInstancesServiceModel, ProcessMethods, ProcessProperties, ProcessServiceModel, ProcessStartRequest, ProcessStartResponse, QueryParams, QueueGetAllOptions, QueueGetByIdOptions, QueueGetResponse, QueueServiceModel, RawCaseInstanceGetResponse, RawEntityGetResponse, RawMaestroProcessGetAllResponse, RawProcessInstanceGetResponse, RawTaskCreateResponse, RawTaskGetResponse, RequestOptions, RequestSpec, ResponseDictionary, ResponseType, RetryOptions, RobotMetadata, SourceJoinCriteria, StageSLA, StageTask, Tag, TaskActivity, TaskAssignOptions, TaskAssignment, TaskAssignmentOptions, TaskAssignmentResponse, TaskBaseResponse, TaskCompleteOptions, TaskCompletionOptions, TaskCreateOptions, TaskCreateResponse, TaskGetAllOptions, TaskGetByIdOptions, TaskGetResponse, TaskGetUsersOptions, TaskMethods, TaskServiceModel, TaskSlaDetail, TaskSource, TasksUnassignOptions, TimeoutOptions, UiPathSDKConfig, UserLoginInfo };
|