@uipath/uipath-typescript 1.3.11 → 1.4.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.
- package/dist/agent-memory/index.cjs +1772 -0
- package/dist/agent-memory/index.d.ts +588 -0
- package/dist/agent-memory/index.mjs +1770 -0
- package/dist/agents/index.cjs +1995 -0
- package/dist/agents/index.d.ts +961 -0
- package/dist/agents/index.mjs +1993 -0
- package/dist/assets/index.cjs +171 -39
- package/dist/assets/index.d.ts +84 -5
- package/dist/assets/index.mjs +171 -39
- package/dist/attachments/index.cjs +53 -15
- package/dist/attachments/index.d.ts +1 -0
- package/dist/attachments/index.mjs +53 -15
- package/dist/buckets/index.cjs +151 -130
- package/dist/buckets/index.d.ts +198 -84
- package/dist/buckets/index.mjs +151 -130
- package/dist/cases/index.cjs +220 -23
- package/dist/cases/index.d.ts +148 -10
- package/dist/cases/index.mjs +220 -24
- package/dist/conversational-agent/index.cjs +140 -66
- package/dist/conversational-agent/index.d.ts +190 -122
- package/dist/conversational-agent/index.mjs +140 -66
- package/dist/core/index.cjs +445 -108
- package/dist/core/index.d.ts +15 -0
- package/dist/core/index.mjs +445 -108
- package/dist/entities/index.cjs +365 -102
- package/dist/entities/index.d.ts +446 -114
- package/dist/entities/index.mjs +365 -102
- package/dist/feedback/index.cjs +53 -15
- package/dist/feedback/index.d.ts +1 -0
- package/dist/feedback/index.mjs +53 -15
- package/dist/governance/index.cjs +1789 -0
- package/dist/governance/index.d.ts +598 -0
- package/dist/governance/index.mjs +1787 -0
- package/dist/index.cjs +1453 -444
- package/dist/index.d.ts +4150 -1742
- package/dist/index.mjs +1452 -445
- package/dist/index.umd.js +5035 -4009
- package/dist/jobs/index.cjs +53 -15
- package/dist/jobs/index.d.ts +1 -0
- package/dist/jobs/index.mjs +53 -15
- package/dist/maestro-processes/index.cjs +189 -27
- package/dist/maestro-processes/index.d.ts +131 -9
- package/dist/maestro-processes/index.mjs +189 -27
- package/dist/orchestrator-du-module/index.cjs +1788 -0
- package/dist/orchestrator-du-module/index.d.ts +757 -0
- package/dist/orchestrator-du-module/index.mjs +1785 -0
- package/dist/processes/index.cjs +53 -15
- package/dist/processes/index.d.ts +1 -0
- package/dist/processes/index.mjs +53 -15
- package/dist/queues/index.cjs +53 -15
- package/dist/queues/index.d.ts +1 -0
- package/dist/queues/index.mjs +53 -15
- package/dist/tasks/index.cjs +116 -19
- package/dist/tasks/index.d.ts +110 -4
- package/dist/tasks/index.mjs +117 -20
- package/dist/traces/index.cjs +340 -15
- package/dist/traces/index.d.ts +483 -2
- package/dist/traces/index.mjs +339 -16
- package/package.json +42 -2
package/dist/entities/index.d.ts
CHANGED
|
@@ -107,6 +107,7 @@ interface RequestWithPaginationOptions extends RequestSpec {
|
|
|
107
107
|
tokenParam?: string;
|
|
108
108
|
countParam?: string;
|
|
109
109
|
convertToSkip?: boolean;
|
|
110
|
+
zeroBased?: boolean;
|
|
110
111
|
};
|
|
111
112
|
};
|
|
112
113
|
}
|
|
@@ -299,6 +300,24 @@ declare class BaseService {
|
|
|
299
300
|
private determineHasMorePages;
|
|
300
301
|
}
|
|
301
302
|
|
|
303
|
+
/**
|
|
304
|
+
* Shared types for the Data Fabric domain — used by both Entities and ChoiceSets.
|
|
305
|
+
* Lives here (not in either service's `*.types.ts`) to avoid cross-domain coupling
|
|
306
|
+
* between sibling services.
|
|
307
|
+
*/
|
|
308
|
+
/**
|
|
309
|
+
* Common shape for every folder-scoped Data Fabric operation.
|
|
310
|
+
* Forwarded on the wire as the `X-UIPATH-FolderKey` header.
|
|
311
|
+
*/
|
|
312
|
+
interface EntityFolderScopedOptions {
|
|
313
|
+
/**
|
|
314
|
+
* Key identifying the folder the entity belongs to. Omit for tenant-level entities.
|
|
315
|
+
*
|
|
316
|
+
* @experimental Folder-scoped Data Fabric is in preview — the contract may change.
|
|
317
|
+
*/
|
|
318
|
+
folderKey?: string;
|
|
319
|
+
}
|
|
320
|
+
|
|
302
321
|
/**
|
|
303
322
|
* Entity field data type names (SQL-level types returned by the API)
|
|
304
323
|
*/
|
|
@@ -341,7 +360,7 @@ interface EntityRecord {
|
|
|
341
360
|
type EntityGetRecordsByIdOptions = {
|
|
342
361
|
/** Level of entity expansion (default: 0) */
|
|
343
362
|
expansionLevel?: number;
|
|
344
|
-
} & PaginationOptions;
|
|
363
|
+
} & PaginationOptions & EntityFolderScopedOptions;
|
|
345
364
|
/**
|
|
346
365
|
* Options for getting all records of an entity
|
|
347
366
|
*/
|
|
@@ -349,14 +368,14 @@ type EntityGetAllRecordsOptions = EntityGetRecordsByIdOptions;
|
|
|
349
368
|
/**
|
|
350
369
|
* Options for getting a single entity record by entity ID and record ID
|
|
351
370
|
*/
|
|
352
|
-
interface EntityGetRecordByIdOptions {
|
|
371
|
+
interface EntityGetRecordByIdOptions extends EntityFolderScopedOptions {
|
|
353
372
|
/** Level of entity expansion (default: 0) */
|
|
354
373
|
expansionLevel?: number;
|
|
355
374
|
}
|
|
356
375
|
/**
|
|
357
376
|
* Common options for entity operations that modify multiple records
|
|
358
377
|
*/
|
|
359
|
-
interface EntityOperationOptions {
|
|
378
|
+
interface EntityOperationOptions extends EntityFolderScopedOptions {
|
|
360
379
|
/** Level of entity expansion (default: 0) */
|
|
361
380
|
expansionLevel?: number;
|
|
362
381
|
/** Whether to fail on first error (default: false) */
|
|
@@ -366,7 +385,7 @@ interface EntityOperationOptions {
|
|
|
366
385
|
* Options for inserting a single record into an entity
|
|
367
386
|
* @deprecated Use {@link EntityInsertRecordOptions} instead for better clarity on inserting a single record into an entity. This type will be removed in future versions.
|
|
368
387
|
*/
|
|
369
|
-
interface EntityInsertOptions {
|
|
388
|
+
interface EntityInsertOptions extends EntityFolderScopedOptions {
|
|
370
389
|
/** Level of entity expansion (default: 0) */
|
|
371
390
|
expansionLevel?: number;
|
|
372
391
|
}
|
|
@@ -406,7 +425,7 @@ interface EntityUpdateRecordsOptions extends EntityOperationOptions {
|
|
|
406
425
|
* Options for deleting data from an entity
|
|
407
426
|
* @deprecated Use {@link EntityDeleteRecordsOptions} instead for better clarity on deleting records from an entity. This type will be removed in future versions.
|
|
408
427
|
*/
|
|
409
|
-
interface EntityDeleteOptions {
|
|
428
|
+
interface EntityDeleteOptions extends EntityFolderScopedOptions {
|
|
410
429
|
/** Whether to fail on first error (default: false) */
|
|
411
430
|
failOnFirst?: boolean;
|
|
412
431
|
}
|
|
@@ -415,6 +434,10 @@ interface EntityDeleteOptions {
|
|
|
415
434
|
*/
|
|
416
435
|
interface EntityDeleteRecordsOptions extends EntityDeleteOptions {
|
|
417
436
|
}
|
|
437
|
+
interface EntityDeleteRecordByIdOptions extends EntityFolderScopedOptions {
|
|
438
|
+
}
|
|
439
|
+
interface EntityImportRecordsByIdOptions extends EntityFolderScopedOptions {
|
|
440
|
+
}
|
|
418
441
|
/**
|
|
419
442
|
* Logical operator for combining query filter groups
|
|
420
443
|
*/
|
|
@@ -523,7 +546,7 @@ type EntityQueryRecordsOptions = {
|
|
|
523
546
|
aggregates?: EntityAggregate[];
|
|
524
547
|
/** Field names to group aggregate results by. */
|
|
525
548
|
groupBy?: string[];
|
|
526
|
-
} & PaginationOptions;
|
|
549
|
+
} & PaginationOptions & EntityFolderScopedOptions;
|
|
527
550
|
/**
|
|
528
551
|
* Response from querying entity records
|
|
529
552
|
*/
|
|
@@ -579,17 +602,35 @@ interface EntityCreateFieldOptions extends EntityFieldBase {
|
|
|
579
602
|
referenceEntityId?: string;
|
|
580
603
|
/** UUID of the referenced field on the target entity (required when `type` is `RELATIONSHIP` or `FILE`) */
|
|
581
604
|
referenceFieldId?: string;
|
|
605
|
+
/**
|
|
606
|
+
* Folder key of the reference target when it lives outside the source's folder. Pass `'00000000-0000-0000-0000-000000000000'` for tenant-level system targets.
|
|
607
|
+
*
|
|
608
|
+
* @experimental Folder-scoped Data Fabric is in preview — the contract may change.
|
|
609
|
+
*/
|
|
610
|
+
referenceFolderKey?: string;
|
|
611
|
+
}
|
|
612
|
+
interface EntityGetAllOptions extends EntityFolderScopedOptions {
|
|
613
|
+
/**
|
|
614
|
+
* When `true`, returns tenant-level and folder-level entities together.
|
|
615
|
+
* Omit (or `false`, the default) to return only tenant-level entities.
|
|
616
|
+
* Ignored when `folderKey` is provided — `folderKey` is preferred over `includeFolderEntities` when both are set.
|
|
617
|
+
*
|
|
618
|
+
* @experimental Folder-scoped Data Fabric is in preview — the contract may change.
|
|
619
|
+
*/
|
|
620
|
+
includeFolderEntities?: boolean;
|
|
621
|
+
}
|
|
622
|
+
interface EntityGetByIdOptions extends EntityFolderScopedOptions {
|
|
623
|
+
}
|
|
624
|
+
interface EntityDeleteByIdOptions extends EntityFolderScopedOptions {
|
|
582
625
|
}
|
|
583
626
|
/**
|
|
584
627
|
* Options for creating a new Data Fabric entity
|
|
585
628
|
*/
|
|
586
|
-
interface EntityCreateOptions {
|
|
629
|
+
interface EntityCreateOptions extends EntityFolderScopedOptions {
|
|
587
630
|
/** Human-readable display name shown in the UI (defaults to `name` if omitted) */
|
|
588
631
|
displayName?: string;
|
|
589
632
|
/** Optional entity description */
|
|
590
633
|
description?: string;
|
|
591
|
-
/** UUID of the folder to place the entity in (defaults to the tenant-level folder) */
|
|
592
|
-
folderKey?: string;
|
|
593
634
|
/** Whether role-based access control is enabled for this entity (default: false) */
|
|
594
635
|
isRbacEnabled?: boolean;
|
|
595
636
|
/** Whether Analytics integration is enabled for this entity (default: false) */
|
|
@@ -618,7 +659,7 @@ interface EntityRemoveFieldOptions {
|
|
|
618
659
|
* (`displayName`, `description`, `isRbacEnabled`) can be combined; each is applied
|
|
619
660
|
* only when the corresponding fields are provided.
|
|
620
661
|
*/
|
|
621
|
-
interface EntityUpdateByIdOptions {
|
|
662
|
+
interface EntityUpdateByIdOptions extends EntityFolderScopedOptions {
|
|
622
663
|
/** New fields to add */
|
|
623
664
|
addFields?: EntityCreateFieldOptions[];
|
|
624
665
|
/** Fields to remove, each identified by field name */
|
|
@@ -650,10 +691,20 @@ type EntityFileType = Blob | File | Uint8Array;
|
|
|
650
691
|
/**
|
|
651
692
|
* Optional options for uploading an attachment to an entity record
|
|
652
693
|
*/
|
|
653
|
-
interface EntityUploadAttachmentOptions {
|
|
694
|
+
interface EntityUploadAttachmentOptions extends EntityFolderScopedOptions {
|
|
654
695
|
/** Optional expansion level (default: 0) */
|
|
655
696
|
expansionLevel?: number;
|
|
656
697
|
}
|
|
698
|
+
/**
|
|
699
|
+
* Optional options for downloading an attachment from an entity record
|
|
700
|
+
*/
|
|
701
|
+
interface EntityDownloadAttachmentOptions extends EntityFolderScopedOptions {
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Optional options for deleting an attachment from an entity record
|
|
705
|
+
*/
|
|
706
|
+
interface EntityDeleteAttachmentOptions extends EntityFolderScopedOptions {
|
|
707
|
+
}
|
|
657
708
|
/**
|
|
658
709
|
* Response from uploading an attachment to an entity record
|
|
659
710
|
*/
|
|
@@ -914,23 +965,35 @@ interface RawEntityGetResponse {
|
|
|
914
965
|
*/
|
|
915
966
|
interface EntityServiceModel {
|
|
916
967
|
/**
|
|
917
|
-
* Gets
|
|
968
|
+
* Gets entities in the tenant.
|
|
918
969
|
*
|
|
919
|
-
*
|
|
970
|
+
* Three call modes:
|
|
971
|
+
* - `getAll()` — default. Returns only tenant-level entities.
|
|
972
|
+
* - `getAll({ folderKey: "<uuid>" })` — preferred for folder-scoped data. Returns only entities in that folder.
|
|
973
|
+
* - `getAll({ includeFolderEntities: true })` — returns tenant-level **and** folder-level entities together. `folderKey` is preferred over `includeFolderEntities` when both are set.
|
|
974
|
+
*
|
|
975
|
+
* @param options - Optional {@link EntityGetAllOptions} (`folderKey` to list a single folder's entities — preferred when scoping to a folder; `includeFolderEntities: true` to list tenant + folder entities together) The `folderKey` property is **experimental**.
|
|
976
|
+
* @returns Promise resolving to an array of entity metadata
|
|
920
977
|
* {@link EntityGetResponse}
|
|
921
978
|
* @example
|
|
922
979
|
* ```typescript
|
|
923
|
-
* //
|
|
924
|
-
* const
|
|
980
|
+
* // Tenant-only (default)
|
|
981
|
+
* const tenantEntities = await entities.getAll();
|
|
982
|
+
*
|
|
983
|
+
* // A single folder's entities (preferred when targeting a specific folder)
|
|
984
|
+
* const folderEntities = await entities.getAll({ folderKey: "<folderKey>" });
|
|
985
|
+
*
|
|
986
|
+
* // Tenant + folder entities together
|
|
987
|
+
* const allEntities = await entities.getAll({ includeFolderEntities: true });
|
|
925
988
|
*
|
|
926
989
|
* // Iterate through entities
|
|
927
|
-
*
|
|
990
|
+
* tenantEntities.forEach(entity => {
|
|
928
991
|
* console.log(`Entity: ${entity.displayName} (${entity.name})`);
|
|
929
992
|
* console.log(`Type: ${entity.entityType}`);
|
|
930
993
|
* });
|
|
931
994
|
*
|
|
932
995
|
* // Find a specific entity by name
|
|
933
|
-
* const customerEntity =
|
|
996
|
+
* const customerEntity = tenantEntities.find(e => e.name === 'Customer');
|
|
934
997
|
*
|
|
935
998
|
* // Use entity methods directly
|
|
936
999
|
* if (customerEntity) {
|
|
@@ -948,11 +1011,12 @@ interface EntityServiceModel {
|
|
|
948
1011
|
* }
|
|
949
1012
|
* ```
|
|
950
1013
|
*/
|
|
951
|
-
getAll(): Promise<EntityGetResponse[]>;
|
|
1014
|
+
getAll(options?: EntityGetAllOptions): Promise<EntityGetResponse[]>;
|
|
952
1015
|
/**
|
|
953
1016
|
* Gets entity metadata by entity ID with attached operation methods
|
|
954
1017
|
*
|
|
955
1018
|
* @param id - UUID of the entity
|
|
1019
|
+
* @param options - Optional {@link EntityGetByIdOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
956
1020
|
* @returns Promise resolving to entity metadata with operation methods
|
|
957
1021
|
* {@link EntityGetResponse}
|
|
958
1022
|
* @example
|
|
@@ -965,6 +1029,9 @@ interface EntityServiceModel {
|
|
|
965
1029
|
* // Get entity metadata with methods
|
|
966
1030
|
* const entity = await entities.getById("<entityId>");
|
|
967
1031
|
*
|
|
1032
|
+
* // Folder-scoped: pass the entity's folder key
|
|
1033
|
+
* const folderEntity = await entities.getById("<entityId>", { folderKey: "<folderKey>" });
|
|
1034
|
+
*
|
|
968
1035
|
* // Call operations directly on the entity
|
|
969
1036
|
* const records = await entity.getAllRecords();
|
|
970
1037
|
*
|
|
@@ -984,12 +1051,12 @@ interface EntityServiceModel {
|
|
|
984
1051
|
* ]);
|
|
985
1052
|
* ```
|
|
986
1053
|
*/
|
|
987
|
-
getById(id: string): Promise<EntityGetResponse>;
|
|
1054
|
+
getById(id: string, options?: EntityGetByIdOptions): Promise<EntityGetResponse>;
|
|
988
1055
|
/**
|
|
989
1056
|
* Gets entity records by entity ID
|
|
990
1057
|
*
|
|
991
1058
|
* @param entityId - UUID of the entity
|
|
992
|
-
* @param options - Query options
|
|
1059
|
+
* @param options - Query options The `folderKey` property is **experimental**.
|
|
993
1060
|
* @returns Promise resolving to either an array of entity records NonPaginatedResponse<EntityRecord> or a PaginatedResponse<EntityRecord> when pagination options are used.
|
|
994
1061
|
* {@link EntityRecord}
|
|
995
1062
|
* @example
|
|
@@ -1013,6 +1080,9 @@ interface EntityServiceModel {
|
|
|
1013
1080
|
* cursor: paginatedResponse.nextCursor,
|
|
1014
1081
|
* expansionLevel: 1
|
|
1015
1082
|
* });
|
|
1083
|
+
*
|
|
1084
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1085
|
+
* const records = await entities.getAllRecords("<entityId>", { folderKey: "<folderKey>" });
|
|
1016
1086
|
* ```
|
|
1017
1087
|
*/
|
|
1018
1088
|
getAllRecords<T extends EntityGetAllRecordsOptions = EntityGetAllRecordsOptions>(entityId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
|
|
@@ -1026,7 +1096,7 @@ interface EntityServiceModel {
|
|
|
1026
1096
|
*
|
|
1027
1097
|
* @param entityId - UUID of the entity
|
|
1028
1098
|
* @param recordId - UUID of the record
|
|
1029
|
-
* @param options - Query options
|
|
1099
|
+
* @param options - Query options The `folderKey` property is **experimental**.
|
|
1030
1100
|
* @returns Promise resolving to a single entity record
|
|
1031
1101
|
* {@link EntityRecord}
|
|
1032
1102
|
* @example
|
|
@@ -1042,6 +1112,11 @@ interface EntityServiceModel {
|
|
|
1042
1112
|
* const record = await entities.getRecordById(<entityId>, recordId, {
|
|
1043
1113
|
* expansionLevel: 1
|
|
1044
1114
|
* });
|
|
1115
|
+
*
|
|
1116
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1117
|
+
* const record = await entities.getRecordById(<entityId>, recordId, {
|
|
1118
|
+
* folderKey: "<folderKey>"
|
|
1119
|
+
* });
|
|
1045
1120
|
* ```
|
|
1046
1121
|
*/
|
|
1047
1122
|
getRecordById(entityId: string, recordId: string, options?: EntityGetRecordByIdOptions): Promise<EntityRecord>;
|
|
@@ -1053,7 +1128,7 @@ interface EntityServiceModel {
|
|
|
1053
1128
|
*
|
|
1054
1129
|
* @param id - UUID of the entity
|
|
1055
1130
|
* @param data - Record to insert
|
|
1056
|
-
* @param options - Insert options
|
|
1131
|
+
* @param options - Insert options The `folderKey` property is **experimental**.
|
|
1057
1132
|
* @returns Promise resolving to the inserted record with generated record ID
|
|
1058
1133
|
* {@link EntityInsertResponse}
|
|
1059
1134
|
* @example
|
|
@@ -1065,6 +1140,11 @@ interface EntityServiceModel {
|
|
|
1065
1140
|
* const result = await entities.insertRecordById(<entityId>, { name: "John", age: 30 }, {
|
|
1066
1141
|
* expansionLevel: 1
|
|
1067
1142
|
* });
|
|
1143
|
+
*
|
|
1144
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1145
|
+
* await entities.insertRecordById(<entityId>, { name: "John", age: 30 }, {
|
|
1146
|
+
* folderKey: "<folderKey>"
|
|
1147
|
+
* });
|
|
1068
1148
|
* ```
|
|
1069
1149
|
*/
|
|
1070
1150
|
insertRecordById(id: string, data: Record<string, any>, options?: EntityInsertRecordOptions): Promise<EntityInsertResponse>;
|
|
@@ -1081,7 +1161,7 @@ interface EntityServiceModel {
|
|
|
1081
1161
|
*
|
|
1082
1162
|
* @param id - UUID of the entity
|
|
1083
1163
|
* @param data - Array of records to insert
|
|
1084
|
-
* @param options - Insert options
|
|
1164
|
+
* @param options - Insert options The `folderKey` property is **experimental**.
|
|
1085
1165
|
* @returns Promise resolving to insert response
|
|
1086
1166
|
* {@link EntityBatchInsertResponse}
|
|
1087
1167
|
* @example
|
|
@@ -1100,6 +1180,12 @@ interface EntityServiceModel {
|
|
|
1100
1180
|
* expansionLevel: 1,
|
|
1101
1181
|
* failOnFirst: true
|
|
1102
1182
|
* });
|
|
1183
|
+
*
|
|
1184
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1185
|
+
* await entities.insertRecordsById(<entityId>, [
|
|
1186
|
+
* { name: "John", age: 30 },
|
|
1187
|
+
* { name: "Jane", age: 25 }
|
|
1188
|
+
* ], { folderKey: "<folderKey>" });
|
|
1103
1189
|
* ```
|
|
1104
1190
|
*/
|
|
1105
1191
|
insertRecordsById(id: string, data: Record<string, any>[], options?: EntityInsertRecordsOptions): Promise<EntityBatchInsertResponse>;
|
|
@@ -1117,7 +1203,7 @@ interface EntityServiceModel {
|
|
|
1117
1203
|
* @param entityId - UUID of the entity
|
|
1118
1204
|
* @param recordId - UUID of the record to update
|
|
1119
1205
|
* @param data - Key-value pairs of fields to update
|
|
1120
|
-
* @param options - Update options
|
|
1206
|
+
* @param options - Update options The `folderKey` property is **experimental**.
|
|
1121
1207
|
* @returns Promise resolving to the updated record
|
|
1122
1208
|
* {@link EntityUpdateRecordResponse}
|
|
1123
1209
|
* @example
|
|
@@ -1129,6 +1215,11 @@ interface EntityServiceModel {
|
|
|
1129
1215
|
* const result = await entities.updateRecordById(<entityId>, <recordId>, { name: "John Updated", age: 31 }, {
|
|
1130
1216
|
* expansionLevel: 1
|
|
1131
1217
|
* });
|
|
1218
|
+
*
|
|
1219
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1220
|
+
* await entities.updateRecordById(<entityId>, <recordId>, { name: "John Updated" }, {
|
|
1221
|
+
* folderKey: "<folderKey>"
|
|
1222
|
+
* });
|
|
1132
1223
|
* ```
|
|
1133
1224
|
*/
|
|
1134
1225
|
updateRecordById(entityId: string, recordId: string, data: Record<string, any>, options?: EntityUpdateRecordOptions): Promise<EntityUpdateRecordResponse>;
|
|
@@ -1139,7 +1230,7 @@ interface EntityServiceModel {
|
|
|
1139
1230
|
*
|
|
1140
1231
|
* @param id - UUID of the entity
|
|
1141
1232
|
* @param data - Array of records to update. Each record MUST contain the record id.
|
|
1142
|
-
* @param options - Update options
|
|
1233
|
+
* @param options - Update options The `folderKey` property is **experimental**.
|
|
1143
1234
|
* @returns Promise resolving to update response
|
|
1144
1235
|
* {@link EntityUpdateResponse}
|
|
1145
1236
|
* @example
|
|
@@ -1158,6 +1249,11 @@ interface EntityServiceModel {
|
|
|
1158
1249
|
* expansionLevel: 1,
|
|
1159
1250
|
* failOnFirst: true
|
|
1160
1251
|
* });
|
|
1252
|
+
*
|
|
1253
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1254
|
+
* await entities.updateRecordsById(<entityId>, [
|
|
1255
|
+
* { Id: "123", name: "John Updated" }
|
|
1256
|
+
* ], { folderKey: "<folderKey>" });
|
|
1161
1257
|
* ```
|
|
1162
1258
|
*/
|
|
1163
1259
|
updateRecordsById(id: string, data: EntityRecord[], options?: EntityUpdateRecordsOptions): Promise<EntityUpdateResponse>;
|
|
@@ -1168,7 +1264,7 @@ interface EntityServiceModel {
|
|
|
1168
1264
|
*
|
|
1169
1265
|
* @param id - UUID of the entity
|
|
1170
1266
|
* @param recordIds - Array of record UUIDs to delete
|
|
1171
|
-
* @param options - Delete options
|
|
1267
|
+
* @param options - Delete options The `folderKey` property is **experimental**.
|
|
1172
1268
|
* @returns Promise resolving to delete response
|
|
1173
1269
|
* {@link EntityDeleteResponse}
|
|
1174
1270
|
* @example
|
|
@@ -1177,6 +1273,11 @@ interface EntityServiceModel {
|
|
|
1177
1273
|
* const result = await entities.deleteRecordsById(<entityId>, [
|
|
1178
1274
|
* <recordId-1>, <recordId-2>
|
|
1179
1275
|
* ]);
|
|
1276
|
+
*
|
|
1277
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1278
|
+
* await entities.deleteRecordsById(<entityId>, [
|
|
1279
|
+
* <recordId-1>, <recordId-2>
|
|
1280
|
+
* ], { folderKey: "<folderKey>" });
|
|
1180
1281
|
* ```
|
|
1181
1282
|
*/
|
|
1182
1283
|
deleteRecordsById(id: string, recordIds: string[], options?: EntityDeleteRecordsOptions): Promise<EntityDeleteResponse>;
|
|
@@ -1188,6 +1289,7 @@ interface EntityServiceModel {
|
|
|
1188
1289
|
*
|
|
1189
1290
|
* @param entityId - UUID of the entity
|
|
1190
1291
|
* @param recordId - UUID of the record to delete
|
|
1292
|
+
* @param options - Optional {@link EntityDeleteRecordByIdOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
1191
1293
|
* @returns Promise resolving to void on success
|
|
1192
1294
|
* @example
|
|
1193
1295
|
* ```typescript
|
|
@@ -1196,14 +1298,17 @@ interface EntityServiceModel {
|
|
|
1196
1298
|
* const entities = new Entities(sdk);
|
|
1197
1299
|
*
|
|
1198
1300
|
* await entities.deleteRecordById("<entityId>", "<recordId>");
|
|
1301
|
+
*
|
|
1302
|
+
* // Folder-scoped: pass the entity's folder key
|
|
1303
|
+
* await entities.deleteRecordById("<entityId>", "<recordId>", { folderKey: "<folderKey>" });
|
|
1199
1304
|
* ```
|
|
1200
1305
|
*/
|
|
1201
|
-
deleteRecordById(entityId: string, recordId: string): Promise<void>;
|
|
1306
|
+
deleteRecordById(entityId: string, recordId: string, options?: EntityDeleteRecordByIdOptions): Promise<void>;
|
|
1202
1307
|
/**
|
|
1203
1308
|
* Queries entity records with filters, sorting, aggregates, and SDK-managed pagination
|
|
1204
1309
|
*
|
|
1205
1310
|
* @param id - UUID of the entity
|
|
1206
|
-
* @param options - Query options including filterGroup, selectedFields, sortOptions, aggregates, groupBy, and pagination
|
|
1311
|
+
* @param options - Query options including filterGroup, selectedFields, sortOptions, aggregates, groupBy, and pagination The `folderKey` property is **experimental**.
|
|
1207
1312
|
* @returns Promise resolving to {@link NonPaginatedResponse} without pagination options,
|
|
1208
1313
|
* or {@link PaginatedResponse} when `pageSize`, `cursor`, or `jumpToPage` are provided
|
|
1209
1314
|
* @example
|
|
@@ -1237,6 +1342,12 @@ interface EntityServiceModel {
|
|
|
1237
1342
|
* ],
|
|
1238
1343
|
* });
|
|
1239
1344
|
*
|
|
1345
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1346
|
+
* await entities.queryRecordsById(<id>, {
|
|
1347
|
+
* filterGroup: { queryFilters: [{ fieldName: "status", operator: QueryFilterOperator.Equals, value: "active" }] },
|
|
1348
|
+
* folderKey: "<folderKey>",
|
|
1349
|
+
* });
|
|
1350
|
+
*
|
|
1240
1351
|
* // Aggregate: total sum and average across all records (no grouping)
|
|
1241
1352
|
* await entities.queryRecordsById(<id>, {
|
|
1242
1353
|
* aggregates: [
|
|
@@ -1252,6 +1363,7 @@ interface EntityServiceModel {
|
|
|
1252
1363
|
*
|
|
1253
1364
|
* @param id - UUID of the entity
|
|
1254
1365
|
* @param file - CSV file to import as a Blob or File or Uint8Array
|
|
1366
|
+
* @param options - Optional {@link EntityImportRecordsByIdOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
1255
1367
|
* @returns Promise resolving to {@link EntityImportRecordsResponse} with record counts
|
|
1256
1368
|
* @example
|
|
1257
1369
|
* ```typescript
|
|
@@ -1259,16 +1371,19 @@ interface EntityServiceModel {
|
|
|
1259
1371
|
* const fileInput = document.getElementById('csv-input') as HTMLInputElement;
|
|
1260
1372
|
* const result = await entities.importRecordsById(<id>, fileInput.files[0]);
|
|
1261
1373
|
* console.log(`Inserted ${result.insertedRecords} of ${result.totalRecords} records`);
|
|
1374
|
+
*
|
|
1375
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1376
|
+
* await entities.importRecordsById(<id>, fileInput.files[0], { folderKey: "<folderKey>" });
|
|
1262
1377
|
* ```
|
|
1263
|
-
* @internal
|
|
1264
1378
|
*/
|
|
1265
|
-
importRecordsById(id: string, file: EntityFileType): Promise<EntityImportRecordsResponse>;
|
|
1379
|
+
importRecordsById(id: string, file: EntityFileType, options?: EntityImportRecordsByIdOptions): Promise<EntityImportRecordsResponse>;
|
|
1266
1380
|
/**
|
|
1267
1381
|
* Downloads an attachment stored in a File-type field of an entity record.
|
|
1268
1382
|
*
|
|
1269
1383
|
* @param entityId - UUID of the entity
|
|
1270
1384
|
* @param recordId - UUID of the record containing the attachment
|
|
1271
1385
|
* @param fieldName - Name of the File-type field containing the attachment
|
|
1386
|
+
* @param options - Optional {@link EntityDownloadAttachmentOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
1272
1387
|
* @returns Promise resolving to Blob containing the file content
|
|
1273
1388
|
* @example
|
|
1274
1389
|
* ```typescript
|
|
@@ -1315,7 +1430,7 @@ interface EntityServiceModel {
|
|
|
1315
1430
|
* fs.writeFileSync('attachment.pdf', buffer);
|
|
1316
1431
|
* ```
|
|
1317
1432
|
*/
|
|
1318
|
-
downloadAttachment(entityId: string, recordId: string, fieldName: string): Promise<Blob>;
|
|
1433
|
+
downloadAttachment(entityId: string, recordId: string, fieldName: string, options?: EntityDownloadAttachmentOptions): Promise<Blob>;
|
|
1319
1434
|
/**
|
|
1320
1435
|
* Uploads an attachment to a File-type field of an entity record.
|
|
1321
1436
|
*
|
|
@@ -1325,7 +1440,7 @@ interface EntityServiceModel {
|
|
|
1325
1440
|
* @param recordId - UUID of the record to upload the attachment to
|
|
1326
1441
|
* @param fieldName - Name of the File-type field
|
|
1327
1442
|
* @param file - File to upload (Blob, File, or Uint8Array)
|
|
1328
|
-
* @param options - Optional {@link EntityUploadAttachmentOptions} (e.g. expansionLevel)
|
|
1443
|
+
* @param options - Optional {@link EntityUploadAttachmentOptions} (e.g. `expansionLevel`, `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
1329
1444
|
* @returns Promise resolving to {@link EntityUploadAttachmentResponse}
|
|
1330
1445
|
* @example
|
|
1331
1446
|
* ```typescript
|
|
@@ -1346,6 +1461,9 @@ interface EntityServiceModel {
|
|
|
1346
1461
|
* const file = fileInput.files[0];
|
|
1347
1462
|
* const response = await entities.uploadAttachment(entityId, recordId, 'Documents', file);
|
|
1348
1463
|
*
|
|
1464
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1465
|
+
* await entities.uploadAttachment(entityId, recordId, 'Documents', file, { folderKey: "<folderKey>" });
|
|
1466
|
+
*
|
|
1349
1467
|
* // Node.js: Upload a file from disk
|
|
1350
1468
|
* const fileBuffer = fs.readFileSync('document.pdf');
|
|
1351
1469
|
* const blob = new Blob([fileBuffer], { type: 'application/pdf' });
|
|
@@ -1359,6 +1477,7 @@ interface EntityServiceModel {
|
|
|
1359
1477
|
* @param entityId - UUID of the entity
|
|
1360
1478
|
* @param recordId - UUID of the record containing the attachment
|
|
1361
1479
|
* @param fieldName - Name of the File-type field containing the attachment
|
|
1480
|
+
* @param options - Optional {@link EntityDeleteAttachmentOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
1362
1481
|
* @returns Promise resolving to {@link EntityDeleteAttachmentResponse}
|
|
1363
1482
|
* @example
|
|
1364
1483
|
* ```typescript
|
|
@@ -1382,14 +1501,14 @@ interface EntityServiceModel {
|
|
|
1382
1501
|
* await entity.deleteAttachment(recordId, 'Documents');
|
|
1383
1502
|
* ```
|
|
1384
1503
|
*/
|
|
1385
|
-
deleteAttachment(entityId: string, recordId: string, fieldName: string): Promise<EntityDeleteAttachmentResponse>;
|
|
1504
|
+
deleteAttachment(entityId: string, recordId: string, fieldName: string, options?: EntityDeleteAttachmentOptions): Promise<EntityDeleteAttachmentResponse>;
|
|
1386
1505
|
/**
|
|
1387
1506
|
* Creates a new Data Fabric entity with the given schema
|
|
1388
1507
|
*
|
|
1389
1508
|
* @param name - Entity name — must start with a letter, letters/numbers/underscores only
|
|
1390
1509
|
* (e.g., `"productCatalog"`).
|
|
1391
1510
|
* @param fields - Array of field definitions
|
|
1392
|
-
* @param options - Optional entity-level settings ({@link EntityCreateOptions})
|
|
1511
|
+
* @param options - Optional entity-level settings ({@link EntityCreateOptions}) The `folderKey` property is **experimental**.
|
|
1393
1512
|
* @returns Promise resolving to the ID of the created entity
|
|
1394
1513
|
* @example
|
|
1395
1514
|
* ```typescript
|
|
@@ -1408,6 +1527,24 @@ interface EntityServiceModel {
|
|
|
1408
1527
|
* { fieldName: "price", type: EntityFieldDataType.DECIMAL, decimalPrecision: 4, maxValue: 999999, minValue: 0 },
|
|
1409
1528
|
* { fieldName: "quantity", type: EntityFieldDataType.INTEGER, maxValue: 10000, minValue: 1, defaultValue: "0" },
|
|
1410
1529
|
* ]);
|
|
1530
|
+
*
|
|
1531
|
+
* // Cross-folder references — link a folder-scoped entity to entities and
|
|
1532
|
+
* // system choice sets that live in another folder or at the tenant level.
|
|
1533
|
+
* await entities.create("orderLine", [
|
|
1534
|
+
* {
|
|
1535
|
+
* fieldName: "order",
|
|
1536
|
+
* type: EntityFieldDataType.RELATIONSHIP,
|
|
1537
|
+
* referenceEntityId: "<orderEntityId>",
|
|
1538
|
+
* referenceFieldId: "<orderEntityPkId>",
|
|
1539
|
+
* referenceFolderKey: "<otherFolderKey>", // target lives in a different folder
|
|
1540
|
+
* },
|
|
1541
|
+
* {
|
|
1542
|
+
* fieldName: "userType",
|
|
1543
|
+
* type: EntityFieldDataType.CHOICE_SET_SINGLE,
|
|
1544
|
+
* choiceSetId: "<systemUserTypeChoiceSetId>", // tenant-level system choice set
|
|
1545
|
+
* // referenceFolderKey omitted → SDK looks up the target at tenant scope
|
|
1546
|
+
* },
|
|
1547
|
+
* ], { folderKey: "<sourceFolderKey>" });
|
|
1411
1548
|
* ```
|
|
1412
1549
|
* @internal
|
|
1413
1550
|
*/
|
|
@@ -1416,14 +1553,18 @@ interface EntityServiceModel {
|
|
|
1416
1553
|
* Deletes a Data Fabric entity and all its records
|
|
1417
1554
|
*
|
|
1418
1555
|
* @param id - UUID of the entity to delete
|
|
1556
|
+
* @param options - Optional {@link EntityDeleteByIdOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
1419
1557
|
* @returns Promise resolving when the entity is deleted
|
|
1420
1558
|
* @example
|
|
1421
1559
|
* ```typescript
|
|
1422
1560
|
* await entities.deleteById(<id>);
|
|
1561
|
+
*
|
|
1562
|
+
* // Folder-scoped: pass the entity's folder key
|
|
1563
|
+
* await entities.deleteById(<id>, { folderKey: "<folderKey>" });
|
|
1423
1564
|
* ```
|
|
1424
1565
|
* @internal
|
|
1425
1566
|
*/
|
|
1426
|
-
deleteById(id: string): Promise<void>;
|
|
1567
|
+
deleteById(id: string, options?: EntityDeleteByIdOptions): Promise<void>;
|
|
1427
1568
|
/**
|
|
1428
1569
|
* Updates an existing Data Fabric entity — schema and/or metadata.
|
|
1429
1570
|
*
|
|
@@ -1432,8 +1573,7 @@ interface EntityServiceModel {
|
|
|
1432
1573
|
* only when the corresponding fields are provided.
|
|
1433
1574
|
*
|
|
1434
1575
|
* @param id - UUID of the entity to update
|
|
1435
|
-
* @param
|
|
1436
|
-
* @param options - Changes to apply ({@link EntityUpdateByIdOptions})
|
|
1576
|
+
* @param options - Changes to apply ({@link EntityUpdateByIdOptions}) The `folderKey` property is **experimental**.
|
|
1437
1577
|
* @returns Promise resolving when the update is complete
|
|
1438
1578
|
*
|
|
1439
1579
|
* @example
|
|
@@ -1466,6 +1606,12 @@ interface EntityServiceModel {
|
|
|
1466
1606
|
* { id: <fieldId>, lengthLimit: 1000 },
|
|
1467
1607
|
* ],
|
|
1468
1608
|
* });
|
|
1609
|
+
*
|
|
1610
|
+
* // Folder-scoped entity: add a field to an entity that lives in a non-tenant folder
|
|
1611
|
+
* await entities.updateById(<id>, {
|
|
1612
|
+
* folderKey: "<folderKey>",
|
|
1613
|
+
* addFields: [{ fieldName: "notes", type: EntityFieldDataType.MULTILINE_TEXT }],
|
|
1614
|
+
* });
|
|
1469
1615
|
* ```
|
|
1470
1616
|
* @internal
|
|
1471
1617
|
*/
|
|
@@ -1538,13 +1684,14 @@ interface EntityMethods {
|
|
|
1538
1684
|
* Use this method if you need trigger events to fire for the deleted record.
|
|
1539
1685
|
*
|
|
1540
1686
|
* @param recordId - UUID of the record to delete
|
|
1687
|
+
* @param options - Optional {@link EntityDeleteRecordByIdOptions} (e.g. `folderKey` for folder-scoped entities)
|
|
1541
1688
|
* @returns Promise resolving to void on success
|
|
1542
1689
|
*/
|
|
1543
|
-
deleteRecord(recordId: string): Promise<void>;
|
|
1690
|
+
deleteRecord(recordId: string, options?: EntityDeleteRecordByIdOptions): Promise<void>;
|
|
1544
1691
|
/**
|
|
1545
1692
|
* Get all records from this entity
|
|
1546
1693
|
*
|
|
1547
|
-
* @param options - Query options
|
|
1694
|
+
* @param options - Query options The `folderKey` property is **experimental**.
|
|
1548
1695
|
* @returns Promise resolving to query response
|
|
1549
1696
|
*/
|
|
1550
1697
|
getAllRecords<T extends EntityGetAllRecordsOptions = EntityGetAllRecordsOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
|
|
@@ -1561,16 +1708,17 @@ interface EntityMethods {
|
|
|
1561
1708
|
*
|
|
1562
1709
|
* @param recordId - UUID of the record containing the attachment
|
|
1563
1710
|
* @param fieldName - Name of the File-type field containing the attachment
|
|
1711
|
+
* @param options - Optional {@link EntityDownloadAttachmentOptions} (e.g. folderKey) The `folderKey` property is **experimental**.
|
|
1564
1712
|
* @returns Promise resolving to Blob containing the file content
|
|
1565
1713
|
*/
|
|
1566
|
-
downloadAttachment(recordId: string, fieldName: string): Promise<Blob>;
|
|
1714
|
+
downloadAttachment(recordId: string, fieldName: string, options?: EntityDownloadAttachmentOptions): Promise<Blob>;
|
|
1567
1715
|
/**
|
|
1568
1716
|
* Uploads an attachment to a File-type field of an entity record
|
|
1569
1717
|
*
|
|
1570
1718
|
* @param recordId - UUID of the record to upload the attachment to
|
|
1571
1719
|
* @param fieldName - Name of the File-type field
|
|
1572
1720
|
* @param file - File to upload (Blob, File, or Uint8Array)
|
|
1573
|
-
* @param options - Optional {@link EntityUploadAttachmentOptions} (e.g. expansionLevel)
|
|
1721
|
+
* @param options - Optional {@link EntityUploadAttachmentOptions} (e.g. expansionLevel, folderKey) The `folderKey` property is **experimental**.
|
|
1574
1722
|
* @returns Promise resolving to {@link EntityUploadAttachmentResponse}
|
|
1575
1723
|
*/
|
|
1576
1724
|
uploadAttachment(recordId: string, fieldName: string, file: EntityFileType, options?: EntityUploadAttachmentOptions): Promise<EntityUploadAttachmentResponse>;
|
|
@@ -1579,9 +1727,10 @@ interface EntityMethods {
|
|
|
1579
1727
|
*
|
|
1580
1728
|
* @param recordId - UUID of the record containing the attachment
|
|
1581
1729
|
* @param fieldName - Name of the File-type field containing the attachment
|
|
1730
|
+
* @param options - Optional {@link EntityDeleteAttachmentOptions} (e.g. folderKey) The `folderKey` property is **experimental**.
|
|
1582
1731
|
* @returns Promise resolving to {@link EntityDeleteAttachmentResponse}
|
|
1583
1732
|
*/
|
|
1584
|
-
deleteAttachment(recordId: string, fieldName: string): Promise<EntityDeleteAttachmentResponse>;
|
|
1733
|
+
deleteAttachment(recordId: string, fieldName: string, options?: EntityDeleteAttachmentOptions): Promise<EntityDeleteAttachmentResponse>;
|
|
1585
1734
|
/**
|
|
1586
1735
|
* @deprecated Use {@link insertRecord} instead.
|
|
1587
1736
|
* @hidden
|
|
@@ -1637,6 +1786,7 @@ interface EntityMethods {
|
|
|
1637
1786
|
* Imports records from a CSV file into this entity
|
|
1638
1787
|
*
|
|
1639
1788
|
* @param file - CSV file to import as a Blob, File, or Uint8Array
|
|
1789
|
+
* @param options - Optional {@link EntityImportRecordsByIdOptions} (e.g. `folderKey` for folder-scoped entities)
|
|
1640
1790
|
* @returns Promise resolving to {@link EntityImportRecordsResponse} with record counts
|
|
1641
1791
|
* @example
|
|
1642
1792
|
* ```typescript
|
|
@@ -1644,9 +1794,12 @@ interface EntityMethods {
|
|
|
1644
1794
|
* const fileInput = document.getElementById('csv-input') as HTMLInputElement;
|
|
1645
1795
|
* const result = await entity.importRecords(fileInput.files[0]);
|
|
1646
1796
|
* console.log(`Inserted ${result.insertedRecords} of ${result.totalRecords} records`);
|
|
1797
|
+
*
|
|
1798
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1799
|
+
* await entity.importRecords(fileInput.files[0], { folderKey: "<folderKey>" });
|
|
1647
1800
|
* ```
|
|
1648
1801
|
*/
|
|
1649
|
-
importRecords(file: EntityFileType): Promise<EntityImportRecordsResponse>;
|
|
1802
|
+
importRecords(file: EntityFileType, options?: EntityImportRecordsByIdOptions): Promise<EntityImportRecordsResponse>;
|
|
1650
1803
|
/**
|
|
1651
1804
|
* @deprecated Use {@link getAllRecords} instead.
|
|
1652
1805
|
* @hidden
|
|
@@ -1655,15 +1808,19 @@ interface EntityMethods {
|
|
|
1655
1808
|
/**
|
|
1656
1809
|
* Deletes this entity and all its records
|
|
1657
1810
|
*
|
|
1811
|
+
* @param options - Optional {@link EntityDeleteByIdOptions} (e.g. `folderKey` for folder-scoped entities)
|
|
1658
1812
|
* @returns Promise resolving when the entity is deleted
|
|
1659
1813
|
* @example
|
|
1660
1814
|
* ```typescript
|
|
1661
1815
|
* const entity = await entities.getById(<id>);
|
|
1662
1816
|
* await entity.delete();
|
|
1817
|
+
*
|
|
1818
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1819
|
+
* await entity.delete({ folderKey: "<folderKey>" });
|
|
1663
1820
|
* ```
|
|
1664
1821
|
* @internal
|
|
1665
1822
|
*/
|
|
1666
|
-
delete(): Promise<void>;
|
|
1823
|
+
delete(options?: EntityDeleteByIdOptions): Promise<void>;
|
|
1667
1824
|
/**
|
|
1668
1825
|
* Updates this entity — schema and/or metadata.
|
|
1669
1826
|
*
|
|
@@ -1710,6 +1867,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1710
1867
|
* Gets entity metadata by entity ID with attached operation methods
|
|
1711
1868
|
*
|
|
1712
1869
|
* @param id - UUID of the entity
|
|
1870
|
+
* @param options - Optional {@link EntityGetByIdOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
1713
1871
|
* @returns Promise resolving to entity metadata with schema information and operation methods
|
|
1714
1872
|
*
|
|
1715
1873
|
* @example
|
|
@@ -1719,6 +1877,9 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1719
1877
|
* const entities = new Entities(sdk);
|
|
1720
1878
|
* const entity = await entities.getById("<entityId>");
|
|
1721
1879
|
*
|
|
1880
|
+
* // Folder-scoped: pass the entity's folder key
|
|
1881
|
+
* const folderEntity = await entities.getById("<entityId>", { folderKey: "<folderKey>" });
|
|
1882
|
+
*
|
|
1722
1883
|
* // Call operations directly on the entity
|
|
1723
1884
|
* const records = await entity.getAllRecords();
|
|
1724
1885
|
*
|
|
@@ -1732,12 +1893,12 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1732
1893
|
* ]);
|
|
1733
1894
|
* ```
|
|
1734
1895
|
*/
|
|
1735
|
-
getById(id: string): Promise<EntityGetResponse>;
|
|
1896
|
+
getById(id: string, options?: EntityGetByIdOptions): Promise<EntityGetResponse>;
|
|
1736
1897
|
/**
|
|
1737
1898
|
* Gets entity records by entity ID
|
|
1738
1899
|
*
|
|
1739
1900
|
* @param entityId - UUID of the entity
|
|
1740
|
-
* @param options - Query options including expansionLevel and pagination options
|
|
1901
|
+
* @param options - Query options including expansionLevel and pagination options The `folderKey` property is **experimental**.
|
|
1741
1902
|
* @returns Promise resolving to an array of entity records or paginated response
|
|
1742
1903
|
*
|
|
1743
1904
|
* @example
|
|
@@ -1765,6 +1926,9 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1765
1926
|
* cursor: paginatedResponse.nextCursor,
|
|
1766
1927
|
* expansionLevel: 1
|
|
1767
1928
|
* });
|
|
1929
|
+
*
|
|
1930
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1931
|
+
* const records = await entities.getAllRecords("<entityId>", { folderKey: "<folderKey>" });
|
|
1768
1932
|
* ```
|
|
1769
1933
|
*/
|
|
1770
1934
|
getAllRecords<T extends EntityGetAllRecordsOptions = EntityGetAllRecordsOptions>(entityId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
|
|
@@ -1773,7 +1937,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1773
1937
|
*
|
|
1774
1938
|
* @param entityId - UUID of the entity
|
|
1775
1939
|
* @param recordId - UUID of the record
|
|
1776
|
-
* @param options - Query options including expansionLevel
|
|
1940
|
+
* @param options - Query options including `expansionLevel` and `folderKey` The `folderKey` property is **experimental**.
|
|
1777
1941
|
* @returns Promise resolving to the entity record
|
|
1778
1942
|
*
|
|
1779
1943
|
* @example
|
|
@@ -1785,6 +1949,11 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1785
1949
|
* const record = await sdk.entities.getRecordById(<entityId>, <recordId>, {
|
|
1786
1950
|
* expansionLevel: 1
|
|
1787
1951
|
* });
|
|
1952
|
+
*
|
|
1953
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1954
|
+
* const record = await sdk.entities.getRecordById(<entityId>, <recordId>, {
|
|
1955
|
+
* folderKey: "<folderKey>"
|
|
1956
|
+
* });
|
|
1788
1957
|
* ```
|
|
1789
1958
|
*/
|
|
1790
1959
|
getRecordById(entityId: string, recordId: string, options?: EntityGetRecordByIdOptions): Promise<EntityRecord>;
|
|
@@ -1793,7 +1962,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1793
1962
|
*
|
|
1794
1963
|
* @param entityId - UUID of the entity
|
|
1795
1964
|
* @param data - Record to insert
|
|
1796
|
-
* @param options - Insert options
|
|
1965
|
+
* @param options - Insert options The `folderKey` property is **experimental**.
|
|
1797
1966
|
* @returns Promise resolving to the inserted record with generated record ID
|
|
1798
1967
|
*
|
|
1799
1968
|
* @example
|
|
@@ -1809,6 +1978,11 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1809
1978
|
* const result = await entities.insertRecordById("<entityId>", { name: "John", age: 30 }, {
|
|
1810
1979
|
* expansionLevel: 1
|
|
1811
1980
|
* });
|
|
1981
|
+
*
|
|
1982
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
1983
|
+
* await entities.insertRecordById("<entityId>", { name: "John", age: 30 }, {
|
|
1984
|
+
* folderKey: "<folderKey>"
|
|
1985
|
+
* });
|
|
1812
1986
|
* ```
|
|
1813
1987
|
*/
|
|
1814
1988
|
insertRecordById(id: string, data: Record<string, any>, options?: EntityInsertRecordOptions): Promise<EntityInsertResponse>;
|
|
@@ -1817,7 +1991,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1817
1991
|
*
|
|
1818
1992
|
* @param entityId - UUID of the entity
|
|
1819
1993
|
* @param data - Array of records to insert
|
|
1820
|
-
* @param options - Insert options
|
|
1994
|
+
* @param options - Insert options The `folderKey` property is **experimental**.
|
|
1821
1995
|
* @returns Promise resolving to insert response
|
|
1822
1996
|
*
|
|
1823
1997
|
* @example
|
|
@@ -1840,6 +2014,12 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1840
2014
|
* expansionLevel: 1,
|
|
1841
2015
|
* failOnFirst: true
|
|
1842
2016
|
* });
|
|
2017
|
+
*
|
|
2018
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
2019
|
+
* await entities.insertRecordsById("<entityId>", [
|
|
2020
|
+
* { name: "John", age: 30 },
|
|
2021
|
+
* { name: "Jane", age: 25 }
|
|
2022
|
+
* ], { folderKey: "<folderKey>" });
|
|
1843
2023
|
* ```
|
|
1844
2024
|
*/
|
|
1845
2025
|
insertRecordsById(id: string, data: Record<string, any>[], options?: EntityInsertRecordsOptions): Promise<EntityBatchInsertResponse>;
|
|
@@ -1849,7 +2029,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1849
2029
|
* @param entityId - UUID of the entity
|
|
1850
2030
|
* @param recordId - UUID of the record to update
|
|
1851
2031
|
* @param data - Key-value pairs of fields to update
|
|
1852
|
-
* @param options - Update options
|
|
2032
|
+
* @param options - Update options The `folderKey` property is **experimental**.
|
|
1853
2033
|
* @returns Promise resolving to the updated record
|
|
1854
2034
|
*
|
|
1855
2035
|
* @example
|
|
@@ -1865,6 +2045,11 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1865
2045
|
* const result = await entities.updateRecordById("<entityId>", "<recordId>", { name: "John Updated", age: 31 }, {
|
|
1866
2046
|
* expansionLevel: 1
|
|
1867
2047
|
* });
|
|
2048
|
+
*
|
|
2049
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
2050
|
+
* await entities.updateRecordById("<entityId>", "<recordId>", { name: "John Updated" }, {
|
|
2051
|
+
* folderKey: "<folderKey>"
|
|
2052
|
+
* });
|
|
1868
2053
|
* ```
|
|
1869
2054
|
*/
|
|
1870
2055
|
updateRecordById(entityId: string, recordId: string, data: Record<string, any>, options?: EntityUpdateRecordOptions): Promise<EntityUpdateRecordResponse>;
|
|
@@ -1874,7 +2059,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1874
2059
|
* @param entityId - UUID of the entity
|
|
1875
2060
|
* @param data - Array of records to update. Each record MUST contain the record Id,
|
|
1876
2061
|
* otherwise the update will fail.
|
|
1877
|
-
* @param options - Update options
|
|
2062
|
+
* @param options - Update options The `folderKey` property is **experimental**.
|
|
1878
2063
|
* @returns Promise resolving to update response
|
|
1879
2064
|
*
|
|
1880
2065
|
* @example
|
|
@@ -1897,6 +2082,11 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1897
2082
|
* expansionLevel: 1,
|
|
1898
2083
|
* failOnFirst: true
|
|
1899
2084
|
* });
|
|
2085
|
+
*
|
|
2086
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
2087
|
+
* await entities.updateRecordsById("<entityId>", [
|
|
2088
|
+
* { Id: "123", name: "John Updated" }
|
|
2089
|
+
* ], { folderKey: "<folderKey>" });
|
|
1900
2090
|
* ```
|
|
1901
2091
|
*/
|
|
1902
2092
|
updateRecordsById(id: string, data: EntityRecord[], options?: EntityUpdateRecordsOptions): Promise<EntityUpdateResponse>;
|
|
@@ -1907,7 +2097,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1907
2097
|
*
|
|
1908
2098
|
* @param entityId - UUID of the entity
|
|
1909
2099
|
* @param recordIds - Array of record UUIDs to delete
|
|
1910
|
-
* @param options - Delete options
|
|
2100
|
+
* @param options - Delete options The `folderKey` property is **experimental**.
|
|
1911
2101
|
* @returns Promise resolving to delete response
|
|
1912
2102
|
*
|
|
1913
2103
|
* @example
|
|
@@ -1920,6 +2110,11 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1920
2110
|
* const result = await entities.deleteRecordsById("<entityId>", [
|
|
1921
2111
|
* "<recordId-1>", "<recordId-2>"
|
|
1922
2112
|
* ]);
|
|
2113
|
+
*
|
|
2114
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
2115
|
+
* await entities.deleteRecordsById("<entityId>", [
|
|
2116
|
+
* "<recordId-1>", "<recordId-2>"
|
|
2117
|
+
* ], { folderKey: "<folderKey>" });
|
|
1923
2118
|
* ```
|
|
1924
2119
|
*/
|
|
1925
2120
|
deleteRecordsById(id: string, recordIds: string[], options?: EntityDeleteRecordsOptions): Promise<EntityDeleteResponse>;
|
|
@@ -1931,6 +2126,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1931
2126
|
*
|
|
1932
2127
|
* @param entityId - UUID of the entity
|
|
1933
2128
|
* @param recordId - UUID of the record to delete
|
|
2129
|
+
* @param options - Optional {@link EntityDeleteRecordByIdOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
1934
2130
|
* @returns Promise resolving to void on success
|
|
1935
2131
|
* @example
|
|
1936
2132
|
* ```typescript
|
|
@@ -1939,12 +2135,21 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1939
2135
|
* const entities = new Entities(sdk);
|
|
1940
2136
|
*
|
|
1941
2137
|
* await entities.deleteRecordById("<entityId>", "<recordId>");
|
|
2138
|
+
*
|
|
2139
|
+
* // Folder-scoped: pass the entity's folder key
|
|
2140
|
+
* await entities.deleteRecordById("<entityId>", "<recordId>", { folderKey: "<folderKey>" });
|
|
1942
2141
|
* ```
|
|
1943
2142
|
*/
|
|
1944
|
-
deleteRecordById(entityId: string, recordId: string): Promise<void>;
|
|
2143
|
+
deleteRecordById(entityId: string, recordId: string, options?: EntityDeleteRecordByIdOptions): Promise<void>;
|
|
1945
2144
|
/**
|
|
1946
|
-
* Gets
|
|
2145
|
+
* Gets entities in the tenant.
|
|
2146
|
+
*
|
|
2147
|
+
* Three call modes:
|
|
2148
|
+
* - `getAll()` — default. Returns only tenant-level entities.
|
|
2149
|
+
* - `getAll({ folderKey: "<uuid>" })` — preferred for folder-scoped data. Returns only entities in that folder.
|
|
2150
|
+
* - `getAll({ includeFolderEntities: true })` — returns tenant-level **and** folder-level entities together. `folderKey` is preferred over `includeFolderEntities` when both are set.
|
|
1947
2151
|
*
|
|
2152
|
+
* @param options - Optional {@link EntityGetAllOptions} (`folderKey` to list a single folder's entities — preferred when scoping to a folder; `includeFolderEntities: true` to list tenant + folder entities together) The `folderKey` property is **experimental**.
|
|
1948
2153
|
* @returns Promise resolving to an array of entity metadata
|
|
1949
2154
|
*
|
|
1950
2155
|
* @example
|
|
@@ -1953,19 +2158,25 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
1953
2158
|
*
|
|
1954
2159
|
* const entities = new Entities(sdk);
|
|
1955
2160
|
*
|
|
1956
|
-
* //
|
|
1957
|
-
* const
|
|
2161
|
+
* // Tenant-only (default)
|
|
2162
|
+
* const tenantEntities = await entities.getAll();
|
|
2163
|
+
*
|
|
2164
|
+
* // A single folder's entities (preferred when targeting a specific folder)
|
|
2165
|
+
* const folderEntities = await entities.getAll({ folderKey: "<folderKey>" });
|
|
2166
|
+
*
|
|
2167
|
+
* // Tenant + folder entities together
|
|
2168
|
+
* const allEntities = await entities.getAll({ includeFolderEntities: true });
|
|
1958
2169
|
*
|
|
1959
2170
|
* // Call operations on an entity
|
|
1960
|
-
* const records = await
|
|
2171
|
+
* const records = await tenantEntities[0].getAllRecords();
|
|
1961
2172
|
* ```
|
|
1962
2173
|
*/
|
|
1963
|
-
getAll(): Promise<EntityGetResponse[]>;
|
|
2174
|
+
getAll(options?: EntityGetAllOptions): Promise<EntityGetResponse[]>;
|
|
1964
2175
|
/**
|
|
1965
2176
|
* Queries entity records with filters, sorting, aggregates, and pagination
|
|
1966
2177
|
*
|
|
1967
2178
|
* @param id - UUID of the entity
|
|
1968
|
-
* @param options - Query options including filterGroup, selectedFields, sortOptions, aggregates, groupBy, and pagination
|
|
2179
|
+
* @param options - Query options including filterGroup, selectedFields, sortOptions, aggregates, groupBy, and pagination The `folderKey` property is **experimental**.
|
|
1969
2180
|
* @returns Promise resolving to {@link NonPaginatedResponse} without pagination options,
|
|
1970
2181
|
* or {@link PaginatedResponse} when `pageSize`, `cursor`, or `jumpToPage` are provided
|
|
1971
2182
|
*
|
|
@@ -2012,6 +2223,12 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2012
2223
|
* { function: EntityAggregateFunction.Avg, field: "amount", alias: "avgAmount" },
|
|
2013
2224
|
* ],
|
|
2014
2225
|
* });
|
|
2226
|
+
*
|
|
2227
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
2228
|
+
* await entities.queryRecordsById("<entityId>", {
|
|
2229
|
+
* filterGroup: { queryFilters: [{ fieldName: "status", operator: QueryFilterOperator.Equals, value: "active" }] },
|
|
2230
|
+
* folderKey: "<folderKey>",
|
|
2231
|
+
* });
|
|
2015
2232
|
* ```
|
|
2016
2233
|
*/
|
|
2017
2234
|
queryRecordsById<T extends EntityQueryRecordsOptions = EntityQueryRecordsOptions>(id: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<EntityRecord> : NonPaginatedResponse<EntityRecord>>;
|
|
@@ -2020,6 +2237,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2020
2237
|
*
|
|
2021
2238
|
* @param id - UUID of the entity
|
|
2022
2239
|
* @param file - CSV file to import (Blob, File, or Uint8Array)
|
|
2240
|
+
* @param options - Optional {@link EntityImportRecordsByIdOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
2023
2241
|
* @returns Promise resolving to import result with record counts
|
|
2024
2242
|
*
|
|
2025
2243
|
* @example
|
|
@@ -2040,16 +2258,19 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2040
2258
|
* if (result.errorFileLink) {
|
|
2041
2259
|
* console.log(`Error file link: ${result.errorFileLink}`);
|
|
2042
2260
|
* }
|
|
2261
|
+
*
|
|
2262
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
2263
|
+
* await entities.importRecordsById("<entityId>", fileInput.files[0], { folderKey: "<folderKey>" });
|
|
2043
2264
|
* ```
|
|
2044
|
-
* @internal
|
|
2045
2265
|
*/
|
|
2046
|
-
importRecordsById(id: string, file: EntityFileType): Promise<EntityImportRecordsResponse>;
|
|
2266
|
+
importRecordsById(id: string, file: EntityFileType, options?: EntityImportRecordsByIdOptions): Promise<EntityImportRecordsResponse>;
|
|
2047
2267
|
/**
|
|
2048
2268
|
* Downloads an attachment from an entity record field
|
|
2049
2269
|
*
|
|
2050
2270
|
* @param entityId - UUID of the entity
|
|
2051
2271
|
* @param recordId - UUID of the record containing the attachment
|
|
2052
2272
|
* @param fieldName - Name of the File-type field containing the attachment
|
|
2273
|
+
* @param options - Optional {@link EntityDownloadAttachmentOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
2053
2274
|
* @returns Promise resolving to Blob containing the file content
|
|
2054
2275
|
*
|
|
2055
2276
|
* @example
|
|
@@ -2068,9 +2289,12 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2068
2289
|
*
|
|
2069
2290
|
* // Download attachment for a specific record and field
|
|
2070
2291
|
* const blob = await entities.downloadAttachment(entityId, recordId, 'Documents');
|
|
2292
|
+
*
|
|
2293
|
+
* // Folder-scoped: pass the entity's folder key
|
|
2294
|
+
* const blob = await entities.downloadAttachment(entityId, recordId, 'Documents', { folderKey: "<folderKey>" });
|
|
2071
2295
|
* ```
|
|
2072
2296
|
*/
|
|
2073
|
-
downloadAttachment(entityId: string, recordId: string, fieldName: string): Promise<Blob>;
|
|
2297
|
+
downloadAttachment(entityId: string, recordId: string, fieldName: string, options?: EntityDownloadAttachmentOptions): Promise<Blob>;
|
|
2074
2298
|
/**
|
|
2075
2299
|
* Uploads an attachment to a File-type field of an entity record
|
|
2076
2300
|
*
|
|
@@ -2078,7 +2302,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2078
2302
|
* @param recordId - UUID of the record to upload the attachment to
|
|
2079
2303
|
* @param fieldName - Name of the File-type field
|
|
2080
2304
|
* @param file - File to upload (Blob, File, or Uint8Array)
|
|
2081
|
-
* @param options - Optional {@link EntityUploadAttachmentOptions} (e.g. expansionLevel)
|
|
2305
|
+
* @param options - Optional {@link EntityUploadAttachmentOptions} (e.g. `expansionLevel`, `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
2082
2306
|
* @returns Promise resolving to {@link EntityUploadAttachmentResponse}
|
|
2083
2307
|
*
|
|
2084
2308
|
* @example
|
|
@@ -2097,6 +2321,9 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2097
2321
|
*
|
|
2098
2322
|
* // Upload a file attachment
|
|
2099
2323
|
* const response = await entities.uploadAttachment(entityId, recordId, 'Documents', file);
|
|
2324
|
+
*
|
|
2325
|
+
* // Folder-scoped entity: pass the entity's folder key
|
|
2326
|
+
* await entities.uploadAttachment(entityId, recordId, 'Documents', file, { folderKey: "<folderKey>" });
|
|
2100
2327
|
* ```
|
|
2101
2328
|
*/
|
|
2102
2329
|
uploadAttachment(entityId: string, recordId: string, fieldName: string, file: EntityFileType, options?: EntityUploadAttachmentOptions): Promise<EntityUploadAttachmentResponse>;
|
|
@@ -2106,6 +2333,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2106
2333
|
* @param entityId - UUID of the entity
|
|
2107
2334
|
* @param recordId - UUID of the record containing the attachment
|
|
2108
2335
|
* @param fieldName - Name of the File-type field containing the attachment
|
|
2336
|
+
* @param options - Optional {@link EntityDeleteAttachmentOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
2109
2337
|
* @returns Promise resolving to {@link EntityDeleteAttachmentResponse}
|
|
2110
2338
|
*
|
|
2111
2339
|
* @example
|
|
@@ -2124,9 +2352,12 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2124
2352
|
*
|
|
2125
2353
|
* // Delete attachment for a specific record and field
|
|
2126
2354
|
* await entities.deleteAttachment(entityId, recordId, 'Documents');
|
|
2355
|
+
*
|
|
2356
|
+
* // Folder-scoped: pass the entity's folder key
|
|
2357
|
+
* await entities.deleteAttachment(entityId, recordId, 'Documents', { folderKey: "<folderKey>" });
|
|
2127
2358
|
* ```
|
|
2128
2359
|
*/
|
|
2129
|
-
deleteAttachment(entityId: string, recordId: string, fieldName: string): Promise<EntityDeleteAttachmentResponse>;
|
|
2360
|
+
deleteAttachment(entityId: string, recordId: string, fieldName: string, options?: EntityDeleteAttachmentOptions): Promise<EntityDeleteAttachmentResponse>;
|
|
2130
2361
|
/**
|
|
2131
2362
|
* @hidden
|
|
2132
2363
|
* @deprecated Use {@link getAllRecords} instead.
|
|
@@ -2148,7 +2379,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2148
2379
|
* @param name - Entity name — must start with a letter and contain
|
|
2149
2380
|
* only letters, numbers, and underscores (e.g., `"productCatalog"`).
|
|
2150
2381
|
* @param fields - Array of field definitions
|
|
2151
|
-
* @param options - Optional entity-level settings ({@link EntityCreateOptions})
|
|
2382
|
+
* @param options - Optional entity-level settings ({@link EntityCreateOptions}) The `folderKey` property is **experimental**.
|
|
2152
2383
|
* @returns Promise resolving to the ID of the created entity
|
|
2153
2384
|
*
|
|
2154
2385
|
* @example
|
|
@@ -2164,6 +2395,24 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2164
2395
|
* { fieldName: "price", type: EntityFieldDataType.DECIMAL, decimalPrecision: 4, maxValue: 999999, minValue: 0 },
|
|
2165
2396
|
* { fieldName: "quantity", type: EntityFieldDataType.INTEGER, maxValue: 10000, minValue: 1, defaultValue: "0" },
|
|
2166
2397
|
* ]);
|
|
2398
|
+
*
|
|
2399
|
+
* // Cross-folder references — link a folder-scoped entity to entities and
|
|
2400
|
+
* // system choice sets that live in another folder or at the tenant level.
|
|
2401
|
+
* await entities.create("orderLine", [
|
|
2402
|
+
* {
|
|
2403
|
+
* fieldName: "order",
|
|
2404
|
+
* type: EntityFieldDataType.RELATIONSHIP,
|
|
2405
|
+
* referenceEntityId: "<orderEntityId>",
|
|
2406
|
+
* referenceFieldId: "<orderEntityPkId>",
|
|
2407
|
+
* referenceFolderKey: "<otherFolderKey>", // target lives in a different folder
|
|
2408
|
+
* },
|
|
2409
|
+
* {
|
|
2410
|
+
* fieldName: "userType",
|
|
2411
|
+
* type: EntityFieldDataType.CHOICE_SET_SINGLE,
|
|
2412
|
+
* choiceSetId: "<systemUserTypeChoiceSetId>", // tenant-level system choice set
|
|
2413
|
+
* // referenceFolderKey omitted → SDK looks up the target at tenant scope
|
|
2414
|
+
* },
|
|
2415
|
+
* ], { folderKey: "<sourceFolderKey>" });
|
|
2167
2416
|
* ```
|
|
2168
2417
|
* @internal
|
|
2169
2418
|
*/
|
|
@@ -2172,15 +2421,19 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2172
2421
|
* Deletes a Data Fabric entity and all its records
|
|
2173
2422
|
*
|
|
2174
2423
|
* @param id - UUID of the entity to delete
|
|
2424
|
+
* @param options - Optional {@link EntityDeleteByIdOptions} (e.g. `folderKey` for folder-scoped entities) The `folderKey` property is **experimental**.
|
|
2175
2425
|
* @returns Promise resolving when the entity is deleted
|
|
2176
2426
|
*
|
|
2177
2427
|
* @example
|
|
2178
2428
|
* ```typescript
|
|
2179
2429
|
* await entities.deleteById("<entityId>");
|
|
2430
|
+
*
|
|
2431
|
+
* // Folder-scoped: pass the entity's folder key
|
|
2432
|
+
* await entities.deleteById("<entityId>", { folderKey: "<folderKey>" });
|
|
2180
2433
|
* ```
|
|
2181
2434
|
* @internal
|
|
2182
2435
|
*/
|
|
2183
|
-
deleteById(id: string): Promise<void>;
|
|
2436
|
+
deleteById(id: string, options?: EntityDeleteByIdOptions): Promise<void>;
|
|
2184
2437
|
/**
|
|
2185
2438
|
* Updates an existing Data Fabric entity — schema and/or metadata.
|
|
2186
2439
|
*
|
|
@@ -2193,7 +2446,7 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2193
2446
|
* overwrite each other's changes.
|
|
2194
2447
|
*
|
|
2195
2448
|
* @param id - UUID of the entity to update
|
|
2196
|
-
* @param options - Changes to apply ({@link EntityUpdateByIdOptions})
|
|
2449
|
+
* @param options - Changes to apply ({@link EntityUpdateByIdOptions}) The `folderKey` property is **experimental**.
|
|
2197
2450
|
* @returns Promise resolving when the update is complete
|
|
2198
2451
|
*
|
|
2199
2452
|
* @example
|
|
@@ -2226,6 +2479,12 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2226
2479
|
* { id: "<fieldId>", lengthLimit: 1000 },
|
|
2227
2480
|
* ],
|
|
2228
2481
|
* });
|
|
2482
|
+
*
|
|
2483
|
+
* // Folder-scoped entity: add a field to an entity that lives in a non-tenant folder
|
|
2484
|
+
* await entities.updateById("<entityId>", {
|
|
2485
|
+
* folderKey: "<folderKey>",
|
|
2486
|
+
* addFields: [{ fieldName: "notes", type: EntityFieldDataType.MULTILINE_TEXT }],
|
|
2487
|
+
* });
|
|
2229
2488
|
* ```
|
|
2230
2489
|
* @internal
|
|
2231
2490
|
*/
|
|
@@ -2270,6 +2529,8 @@ declare class EntityService extends BaseService implements EntityServiceModel {
|
|
|
2270
2529
|
* @private
|
|
2271
2530
|
*/
|
|
2272
2531
|
private mapExternalFields;
|
|
2532
|
+
private buildFieldsWithReferenceMeta;
|
|
2533
|
+
private buildReferenceMeta;
|
|
2273
2534
|
/** Converts a user-facing EntityCreateFieldOptions to the raw API field payload */
|
|
2274
2535
|
private buildSchemaFieldPayload;
|
|
2275
2536
|
/**
|
|
@@ -2343,40 +2604,54 @@ interface ChoiceSetGetResponse {
|
|
|
2343
2604
|
/** User ID of the record owner */
|
|
2344
2605
|
recordOwner?: string;
|
|
2345
2606
|
}
|
|
2607
|
+
interface ChoiceSetGetAllOptions extends EntityFolderScopedOptions {
|
|
2608
|
+
/**
|
|
2609
|
+
* When `true`, also returns folder-level choice sets alongside tenant ones.
|
|
2610
|
+
* Omit (or `false`, the default) to return only tenant-level choice sets.
|
|
2611
|
+
* Ignored when `folderKey` is provided — `folderKey` is preferred over `includeFolderChoiceSets` when both are set.
|
|
2612
|
+
*
|
|
2613
|
+
* @experimental Folder-scoped Data Fabric is in preview — the contract may change.
|
|
2614
|
+
*/
|
|
2615
|
+
includeFolderChoiceSets?: boolean;
|
|
2616
|
+
}
|
|
2346
2617
|
/**
|
|
2347
2618
|
* Options for getting choice set values by choice set ID
|
|
2348
2619
|
*/
|
|
2349
|
-
type ChoiceSetGetByIdOptions = PaginationOptions;
|
|
2620
|
+
type ChoiceSetGetByIdOptions = PaginationOptions & EntityFolderScopedOptions;
|
|
2350
2621
|
/**
|
|
2351
2622
|
* Options for creating a new choice set
|
|
2352
2623
|
*/
|
|
2353
|
-
interface ChoiceSetCreateOptions {
|
|
2624
|
+
interface ChoiceSetCreateOptions extends EntityFolderScopedOptions {
|
|
2354
2625
|
/** Human-readable display name */
|
|
2355
2626
|
displayName?: string;
|
|
2356
2627
|
/** Optional choice set description */
|
|
2357
2628
|
description?: string;
|
|
2358
|
-
/** UUID of the folder to place the choice set in (defaults to the tenant-level folder) */
|
|
2359
|
-
folderKey?: string;
|
|
2360
2629
|
}
|
|
2361
2630
|
/**
|
|
2362
2631
|
* Options for updating an existing choice set's metadata
|
|
2363
2632
|
*/
|
|
2364
|
-
interface ChoiceSetUpdateOptions {
|
|
2633
|
+
interface ChoiceSetUpdateOptions extends EntityFolderScopedOptions {
|
|
2365
2634
|
/** New display name for the choice set */
|
|
2366
2635
|
displayName?: string;
|
|
2367
2636
|
/** New description for the choice set */
|
|
2368
2637
|
description?: string;
|
|
2369
2638
|
}
|
|
2639
|
+
interface ChoiceSetDeleteByIdOptions extends EntityFolderScopedOptions {
|
|
2640
|
+
}
|
|
2370
2641
|
/**
|
|
2371
2642
|
* Optional fields when inserting a single value into a choice set.
|
|
2372
2643
|
*
|
|
2373
2644
|
* The required `name` identifier is passed as a positional argument to
|
|
2374
2645
|
* `insertValueById`.
|
|
2375
2646
|
*/
|
|
2376
|
-
interface ChoiceSetValueInsertOptions {
|
|
2647
|
+
interface ChoiceSetValueInsertOptions extends EntityFolderScopedOptions {
|
|
2377
2648
|
/** Human-readable display name */
|
|
2378
2649
|
displayName?: string;
|
|
2379
2650
|
}
|
|
2651
|
+
interface ChoiceSetValueUpdateOptions extends EntityFolderScopedOptions {
|
|
2652
|
+
}
|
|
2653
|
+
interface ChoiceSetValueDeleteOptions extends EntityFolderScopedOptions {
|
|
2654
|
+
}
|
|
2380
2655
|
/**
|
|
2381
2656
|
* Response returned after inserting a choice-set value — the full value object.
|
|
2382
2657
|
*/
|
|
@@ -2406,33 +2681,32 @@ interface ChoiceSetValueUpdateResponse extends ChoiceSetGetResponse {
|
|
|
2406
2681
|
*/
|
|
2407
2682
|
interface ChoiceSetServiceModel {
|
|
2408
2683
|
/**
|
|
2409
|
-
* Gets
|
|
2684
|
+
* Gets choice sets in the tenant.
|
|
2685
|
+
*
|
|
2686
|
+
* Three call modes:
|
|
2687
|
+
* - `getAll()` — default. Returns only tenant-level choice sets.
|
|
2688
|
+
* - `getAll({ folderKey: "<uuid>" })` — preferred for folder-scoped data. Returns only choice sets in that folder.
|
|
2689
|
+
* - `getAll({ includeFolderChoiceSets: true })` — returns tenant-level **and** folder-level choice sets together. `folderKey` is preferred over `includeFolderChoiceSets` when both are set.
|
|
2410
2690
|
*
|
|
2691
|
+
* @param options - Optional {@link ChoiceSetGetAllOptions} (`folderKey` to list a single folder's choice sets — preferred when scoping to a folder; `includeFolderChoiceSets: true` to list tenant + folder choice sets together) The `folderKey` property is **experimental**.
|
|
2411
2692
|
* @returns Promise resolving to an array of choice set metadata
|
|
2412
2693
|
* {@link ChoiceSetGetAllResponse}
|
|
2413
2694
|
* @example
|
|
2414
2695
|
* ```typescript
|
|
2415
|
-
* //
|
|
2416
|
-
* const
|
|
2696
|
+
* // Tenant-only (default)
|
|
2697
|
+
* const tenantChoiceSets = await choicesets.getAll();
|
|
2417
2698
|
*
|
|
2418
|
-
* //
|
|
2419
|
-
*
|
|
2420
|
-
* console.log(`ChoiceSet: ${choiceSet.displayName} (${choiceSet.name})`);
|
|
2421
|
-
* console.log(`Description: ${choiceSet.description}`);
|
|
2422
|
-
* console.log(`Created by: ${choiceSet.createdBy}`);
|
|
2423
|
-
* });
|
|
2699
|
+
* // A single folder's choice sets (preferred when targeting a specific folder)
|
|
2700
|
+
* const folderChoiceSets = await choicesets.getAll({ folderKey: "<folderKey>" });
|
|
2424
2701
|
*
|
|
2425
|
-
* //
|
|
2426
|
-
* const
|
|
2702
|
+
* // Tenant + folder choice sets together
|
|
2703
|
+
* const allChoiceSets = await choicesets.getAll({ includeFolderChoiceSets: true });
|
|
2427
2704
|
*
|
|
2428
|
-
* //
|
|
2429
|
-
*
|
|
2430
|
-
* console.log(`Last updated: ${expenseTypes.updatedTime}`);
|
|
2431
|
-
* console.log(`Updated by: ${expenseTypes.updatedBy}`);
|
|
2432
|
-
* }
|
|
2705
|
+
* // Find a specific choice set by name
|
|
2706
|
+
* const expenseTypes = tenantChoiceSets.find(cs => cs.name === 'ExpenseTypes');
|
|
2433
2707
|
* ```
|
|
2434
2708
|
*/
|
|
2435
|
-
getAll(): Promise<ChoiceSetGetAllResponse[]>;
|
|
2709
|
+
getAll(options?: ChoiceSetGetAllOptions): Promise<ChoiceSetGetAllResponse[]>;
|
|
2436
2710
|
/**
|
|
2437
2711
|
* Gets choice set values by choice set ID with optional pagination
|
|
2438
2712
|
*
|
|
@@ -2441,7 +2715,7 @@ interface ChoiceSetServiceModel {
|
|
|
2441
2715
|
* - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
|
|
2442
2716
|
*
|
|
2443
2717
|
* @param choiceSetId - UUID of the choice set
|
|
2444
|
-
* @param options - Pagination options
|
|
2718
|
+
* @param options - Pagination options and optional `folderKey` (omit for tenant-level choice sets) The `folderKey` property is **experimental**.
|
|
2445
2719
|
* @returns Promise resolving to choice set values or paginated result
|
|
2446
2720
|
* {@link ChoiceSetGetResponse}
|
|
2447
2721
|
* @example
|
|
@@ -2466,6 +2740,9 @@ interface ChoiceSetServiceModel {
|
|
|
2466
2740
|
* if (page1.hasNextPage) {
|
|
2467
2741
|
* const page2 = await choicesets.getById(choiceSetId, { cursor: page1.nextCursor });
|
|
2468
2742
|
* }
|
|
2743
|
+
*
|
|
2744
|
+
* // Folder-scoped choice set
|
|
2745
|
+
* const folderValues = await choicesets.getById(choiceSetId, { folderKey: "<folderKey>" });
|
|
2469
2746
|
* ```
|
|
2470
2747
|
*/
|
|
2471
2748
|
getById<T extends ChoiceSetGetByIdOptions = ChoiceSetGetByIdOptions>(choiceSetId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ChoiceSetGetResponse> : NonPaginatedResponse<ChoiceSetGetResponse>>;
|
|
@@ -2475,7 +2752,7 @@ interface ChoiceSetServiceModel {
|
|
|
2475
2752
|
* @param name - Choice set name. Must start with a
|
|
2476
2753
|
* letter, may contain only letters, numbers, and underscores, length
|
|
2477
2754
|
* 3–100 characters (e.g., `"expenseTypes"`).
|
|
2478
|
-
* @param options - Optional choice-set-level settings ({@link ChoiceSetCreateOptions})
|
|
2755
|
+
* @param options - Optional choice-set-level settings ({@link ChoiceSetCreateOptions}) The `folderKey` property is **experimental**.
|
|
2479
2756
|
* @returns Promise resolving to the UUID of the created choice set
|
|
2480
2757
|
*
|
|
2481
2758
|
* @example
|
|
@@ -2499,7 +2776,7 @@ interface ChoiceSetServiceModel {
|
|
|
2499
2776
|
* the call throws `ValidationError` if both are omitted.
|
|
2500
2777
|
*
|
|
2501
2778
|
* @param choiceSetId - UUID of the choice set to update
|
|
2502
|
-
* @param options - Metadata fields to change ({@link ChoiceSetUpdateOptions})
|
|
2779
|
+
* @param options - Metadata fields to change ({@link ChoiceSetUpdateOptions}) The `folderKey` property is **experimental**.
|
|
2503
2780
|
* @returns Promise resolving when the update is complete
|
|
2504
2781
|
*
|
|
2505
2782
|
* @example
|
|
@@ -2520,6 +2797,7 @@ interface ChoiceSetServiceModel {
|
|
|
2520
2797
|
* Deletes a Data Fabric choice set and all its values.
|
|
2521
2798
|
*
|
|
2522
2799
|
* @param choiceSetId - UUID of the choice set to delete
|
|
2800
|
+
* @param options - Optional {@link ChoiceSetDeleteByIdOptions} — pass `folderKey` for folder-scoped choice sets; omit for tenant-level The `folderKey` property is **experimental**.
|
|
2523
2801
|
* @returns Promise resolving when the choice set is deleted
|
|
2524
2802
|
*
|
|
2525
2803
|
* @example
|
|
@@ -2529,16 +2807,19 @@ interface ChoiceSetServiceModel {
|
|
|
2529
2807
|
* const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
|
|
2530
2808
|
*
|
|
2531
2809
|
* await choicesets.deleteById(expenseTypes.id);
|
|
2810
|
+
*
|
|
2811
|
+
* // Folder-scoped choice set
|
|
2812
|
+
* await choicesets.deleteById(expenseTypes.id, { folderKey: "<folderKey>" });
|
|
2532
2813
|
* ```
|
|
2533
2814
|
* @internal
|
|
2534
2815
|
*/
|
|
2535
|
-
deleteById(choiceSetId: string): Promise<void>;
|
|
2816
|
+
deleteById(choiceSetId: string, options?: ChoiceSetDeleteByIdOptions): Promise<void>;
|
|
2536
2817
|
/**
|
|
2537
2818
|
* Inserts a single value into a choice set.
|
|
2538
2819
|
*
|
|
2539
2820
|
* @param choiceSetId - UUID of the parent choice set
|
|
2540
2821
|
* @param name - Identifier name of the new value (e.g., `"TRAVEL"`)
|
|
2541
|
-
* @param options - Optional fields ({@link ChoiceSetValueInsertOptions})
|
|
2822
|
+
* @param options - Optional fields ({@link ChoiceSetValueInsertOptions}) The `folderKey` property is **experimental**.
|
|
2542
2823
|
* @returns Promise resolving to the inserted value ({@link ChoiceSetValueInsertResponse})
|
|
2543
2824
|
*
|
|
2544
2825
|
* @example
|
|
@@ -2551,6 +2832,12 @@ interface ChoiceSetServiceModel {
|
|
|
2551
2832
|
* displayName: 'Travel',
|
|
2552
2833
|
* });
|
|
2553
2834
|
* console.log(inserted.id);
|
|
2835
|
+
*
|
|
2836
|
+
* // Folder-scoped choice set: folderKey is required on the wire
|
|
2837
|
+
* await choicesets.insertValueById(expenseTypes.id, 'TRAVEL', {
|
|
2838
|
+
* displayName: 'Travel',
|
|
2839
|
+
* folderKey: "<folderKey>",
|
|
2840
|
+
* });
|
|
2554
2841
|
* ```
|
|
2555
2842
|
* @internal
|
|
2556
2843
|
*/
|
|
@@ -2564,6 +2851,7 @@ interface ChoiceSetServiceModel {
|
|
|
2564
2851
|
* @param choiceSetId - UUID of the parent choice set
|
|
2565
2852
|
* @param valueId - UUID of the value to update
|
|
2566
2853
|
* @param displayName - New human-readable display name for the value
|
|
2854
|
+
* @param options - Optional {@link ChoiceSetValueUpdateOptions} — pass `folderKey` for folder-scoped choice sets; omit for tenant-level. The `folderKey` property is **experimental**.
|
|
2567
2855
|
* @returns Promise resolving to the updated value ({@link ChoiceSetValueUpdateResponse})
|
|
2568
2856
|
*
|
|
2569
2857
|
* @example
|
|
@@ -2575,15 +2863,21 @@ interface ChoiceSetServiceModel {
|
|
|
2575
2863
|
* const travel = values.items.find(v => v.name === 'TRAVEL');
|
|
2576
2864
|
*
|
|
2577
2865
|
* await choicesets.updateValueById(expenseTypes.id, travel.id, 'Business Travel');
|
|
2866
|
+
*
|
|
2867
|
+
* // Folder-scoped choice set: folderKey is required on the wire
|
|
2868
|
+
* await choicesets.updateValueById(expenseTypes.id, travel.id, 'Business Travel', {
|
|
2869
|
+
* folderKey: "<folderKey>",
|
|
2870
|
+
* });
|
|
2578
2871
|
* ```
|
|
2579
2872
|
* @internal
|
|
2580
2873
|
*/
|
|
2581
|
-
updateValueById(choiceSetId: string, valueId: string, displayName: string): Promise<ChoiceSetValueUpdateResponse>;
|
|
2874
|
+
updateValueById(choiceSetId: string, valueId: string, displayName: string, options?: ChoiceSetValueUpdateOptions): Promise<ChoiceSetValueUpdateResponse>;
|
|
2582
2875
|
/**
|
|
2583
2876
|
* Deletes one or more values from a choice set.
|
|
2584
2877
|
*
|
|
2585
2878
|
* @param choiceSetId - UUID of the parent choice set
|
|
2586
2879
|
* @param valueIds - Array of value UUIDs to delete
|
|
2880
|
+
* @param options - Optional {@link ChoiceSetValueDeleteOptions} — pass `folderKey` for folder-scoped choice sets; omit for tenant-level The `folderKey` property is **experimental**.
|
|
2587
2881
|
* @returns Promise resolving when the values are deleted
|
|
2588
2882
|
*
|
|
2589
2883
|
* @example
|
|
@@ -2593,16 +2887,25 @@ interface ChoiceSetServiceModel {
|
|
|
2593
2887
|
* const idsToDelete = values.items.slice(0, 2).map(v => v.id);
|
|
2594
2888
|
*
|
|
2595
2889
|
* await choicesets.deleteValuesById('<choiceSetId>', idsToDelete);
|
|
2890
|
+
*
|
|
2891
|
+
* // Folder-scoped choice set
|
|
2892
|
+
* await choicesets.deleteValuesById('<choiceSetId>', idsToDelete, { folderKey: "<folderKey>" });
|
|
2596
2893
|
* ```
|
|
2597
2894
|
* @internal
|
|
2598
2895
|
*/
|
|
2599
|
-
deleteValuesById(choiceSetId: string, valueIds: string[]): Promise<void>;
|
|
2896
|
+
deleteValuesById(choiceSetId: string, valueIds: string[], options?: ChoiceSetValueDeleteOptions): Promise<void>;
|
|
2600
2897
|
}
|
|
2601
2898
|
|
|
2602
2899
|
declare class ChoiceSetService extends BaseService implements ChoiceSetServiceModel {
|
|
2603
2900
|
/**
|
|
2604
|
-
* Gets
|
|
2901
|
+
* Gets choice sets in the tenant.
|
|
2605
2902
|
*
|
|
2903
|
+
* Three call modes:
|
|
2904
|
+
* - `getAll()` — default. Returns only tenant-level choice sets.
|
|
2905
|
+
* - `getAll({ folderKey: "<uuid>" })` — preferred for folder-scoped data. Returns only choice sets in that folder.
|
|
2906
|
+
* - `getAll({ includeFolderChoiceSets: true })` — returns tenant-level **and** folder-level choice sets together. `folderKey` is preferred over `includeFolderChoiceSets` when both are set.
|
|
2907
|
+
*
|
|
2908
|
+
* @param options - Optional {@link ChoiceSetGetAllOptions} (`folderKey` to list a single folder's choice sets — preferred when scoping to a folder; `includeFolderChoiceSets: true` to list tenant + folder choice sets together) The `folderKey` property is **experimental**.
|
|
2606
2909
|
* @returns Promise resolving to an array of choice set metadata
|
|
2607
2910
|
*
|
|
2608
2911
|
* @example
|
|
@@ -2611,17 +2914,23 @@ declare class ChoiceSetService extends BaseService implements ChoiceSetServiceMo
|
|
|
2611
2914
|
*
|
|
2612
2915
|
* const choiceSets = new ChoiceSets(sdk);
|
|
2613
2916
|
*
|
|
2614
|
-
* //
|
|
2615
|
-
* const
|
|
2917
|
+
* // Tenant-only (default)
|
|
2918
|
+
* const tenantChoiceSets = await choiceSets.getAll();
|
|
2616
2919
|
*
|
|
2617
|
-
* //
|
|
2618
|
-
*
|
|
2619
|
-
*
|
|
2620
|
-
*
|
|
2621
|
-
* });
|
|
2920
|
+
* // A single folder's choice sets (preferred when targeting a specific folder)
|
|
2921
|
+
* const folderChoiceSets = await choiceSets.getAll({ folderKey: "<folderKey>" });
|
|
2922
|
+
*
|
|
2923
|
+
* // Tenant + folder choice sets together
|
|
2924
|
+
* const allChoiceSets = await choiceSets.getAll({ includeFolderChoiceSets: true });
|
|
2622
2925
|
* ```
|
|
2623
2926
|
*/
|
|
2624
|
-
getAll(): Promise<ChoiceSetGetAllResponse[]>;
|
|
2927
|
+
getAll(options?: ChoiceSetGetAllOptions): Promise<ChoiceSetGetAllResponse[]>;
|
|
2928
|
+
/**
|
|
2929
|
+
* Internal helper that performs the choice-set fetch. Kept separate from the
|
|
2930
|
+
* public `getAll()` so that internal callers (e.g. `resolveChoiceSetName`)
|
|
2931
|
+
* can reuse it without triggering double `@track` telemetry.
|
|
2932
|
+
*/
|
|
2933
|
+
private fetchAllChoiceSets;
|
|
2625
2934
|
/**
|
|
2626
2935
|
* Gets choice set values by choice set ID with optional pagination
|
|
2627
2936
|
*
|
|
@@ -2630,7 +2939,7 @@ declare class ChoiceSetService extends BaseService implements ChoiceSetServiceMo
|
|
|
2630
2939
|
* - A PaginatedResponse with navigation cursors (when any pagination parameter is provided)
|
|
2631
2940
|
*
|
|
2632
2941
|
* @param choiceSetId - UUID of the choice set
|
|
2633
|
-
* @param options - Pagination options
|
|
2942
|
+
* @param options - Pagination options and optional `folderKey` for folder-scoped choice sets The `folderKey` property is **experimental**.
|
|
2634
2943
|
* @returns Promise resolving to choice set values or paginated result
|
|
2635
2944
|
*
|
|
2636
2945
|
* @example
|
|
@@ -2659,6 +2968,9 @@ declare class ChoiceSetService extends BaseService implements ChoiceSetServiceMo
|
|
|
2659
2968
|
* if (page1.hasNextPage) {
|
|
2660
2969
|
* const page2 = await choiceSets.getById(choiceSetId, { cursor: page1.nextCursor });
|
|
2661
2970
|
* }
|
|
2971
|
+
*
|
|
2972
|
+
* // Folder-scoped choice set
|
|
2973
|
+
* const folderValues = await choiceSets.getById(choiceSetId, { folderKey: "<folderKey>" });
|
|
2662
2974
|
* ```
|
|
2663
2975
|
*/
|
|
2664
2976
|
getById<T extends ChoiceSetGetByIdOptions = ChoiceSetGetByIdOptions>(choiceSetId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ChoiceSetGetResponse> : NonPaginatedResponse<ChoiceSetGetResponse>>;
|
|
@@ -2668,7 +2980,7 @@ declare class ChoiceSetService extends BaseService implements ChoiceSetServiceMo
|
|
|
2668
2980
|
* @param name - Choice set name. Must start with a
|
|
2669
2981
|
* letter, may contain only letters, numbers, and underscores, length
|
|
2670
2982
|
* 3–100 characters (e.g., `"expenseTypes"`).
|
|
2671
|
-
* @param options - Optional choice-set-level settings ({@link ChoiceSetCreateOptions})
|
|
2983
|
+
* @param options - Optional choice-set-level settings ({@link ChoiceSetCreateOptions}) The `folderKey` property is **experimental**.
|
|
2672
2984
|
* @returns Promise resolving to the UUID of the created choice set
|
|
2673
2985
|
*
|
|
2674
2986
|
* @example
|
|
@@ -2696,7 +3008,7 @@ declare class ChoiceSetService extends BaseService implements ChoiceSetServiceMo
|
|
|
2696
3008
|
* the call throws `ValidationError` if both are omitted.
|
|
2697
3009
|
*
|
|
2698
3010
|
* @param choiceSetId - UUID of the choice set to update
|
|
2699
|
-
* @param options - Metadata fields to change ({@link ChoiceSetUpdateOptions})
|
|
3011
|
+
* @param options - Metadata fields to change ({@link ChoiceSetUpdateOptions}) The `folderKey` property is **experimental**.
|
|
2700
3012
|
* @returns Promise resolving when the update is complete
|
|
2701
3013
|
*
|
|
2702
3014
|
* @example
|
|
@@ -2717,6 +3029,7 @@ declare class ChoiceSetService extends BaseService implements ChoiceSetServiceMo
|
|
|
2717
3029
|
* Deletes a Data Fabric choice set and all its values.
|
|
2718
3030
|
*
|
|
2719
3031
|
* @param choiceSetId - UUID of the choice set to delete
|
|
3032
|
+
* @param options - Optional {@link ChoiceSetDeleteByIdOptions} (e.g. `folderKey` for folder-scoped choice sets) The `folderKey` property is **experimental**.
|
|
2720
3033
|
* @returns Promise resolving when the choice set is deleted
|
|
2721
3034
|
*
|
|
2722
3035
|
* @example
|
|
@@ -2726,16 +3039,19 @@ declare class ChoiceSetService extends BaseService implements ChoiceSetServiceMo
|
|
|
2726
3039
|
* const expenseTypes = allChoiceSets.find(cs => cs.name === 'expense_types');
|
|
2727
3040
|
*
|
|
2728
3041
|
* await choicesets.deleteById(expenseTypes.id);
|
|
3042
|
+
*
|
|
3043
|
+
* // Folder-scoped choice set
|
|
3044
|
+
* await choicesets.deleteById(expenseTypes.id, { folderKey: "<folderKey>" });
|
|
2729
3045
|
* ```
|
|
2730
3046
|
* @internal
|
|
2731
3047
|
*/
|
|
2732
|
-
deleteById(choiceSetId: string): Promise<void>;
|
|
3048
|
+
deleteById(choiceSetId: string, options?: ChoiceSetDeleteByIdOptions): Promise<void>;
|
|
2733
3049
|
/**
|
|
2734
3050
|
* Inserts a single value into a choice set.
|
|
2735
3051
|
*
|
|
2736
3052
|
* @param choiceSetId - UUID of the parent choice set
|
|
2737
3053
|
* @param name - Identifier name of the new value (e.g., `"TRAVEL"`)
|
|
2738
|
-
* @param options - Optional fields ({@link ChoiceSetValueInsertOptions})
|
|
3054
|
+
* @param options - Optional fields ({@link ChoiceSetValueInsertOptions}) The `folderKey` property is **experimental**.
|
|
2739
3055
|
* @returns Promise resolving to the inserted value ({@link ChoiceSetValueInsertResponse})
|
|
2740
3056
|
*
|
|
2741
3057
|
* @example
|
|
@@ -2748,6 +3064,12 @@ declare class ChoiceSetService extends BaseService implements ChoiceSetServiceMo
|
|
|
2748
3064
|
* displayName: 'Travel',
|
|
2749
3065
|
* });
|
|
2750
3066
|
* console.log(inserted.id);
|
|
3067
|
+
*
|
|
3068
|
+
* // Folder-scoped choice set: folderKey is required on the wire
|
|
3069
|
+
* await choicesets.insertValueById(expenseTypes.id, 'TRAVEL', {
|
|
3070
|
+
* displayName: 'Travel',
|
|
3071
|
+
* folderKey: "<folderKey>",
|
|
3072
|
+
* });
|
|
2751
3073
|
* ```
|
|
2752
3074
|
* @internal
|
|
2753
3075
|
*/
|
|
@@ -2761,6 +3083,7 @@ declare class ChoiceSetService extends BaseService implements ChoiceSetServiceMo
|
|
|
2761
3083
|
* @param choiceSetId - UUID of the parent choice set
|
|
2762
3084
|
* @param valueId - UUID of the value to update
|
|
2763
3085
|
* @param displayName - New human-readable display name for the value
|
|
3086
|
+
* @param options - Optional {@link ChoiceSetValueUpdateOptions} — pass `folderKey` for folder-scoped choice sets; omit for tenant-level. The `folderKey` property is **experimental**.
|
|
2764
3087
|
* @returns Promise resolving to the updated value ({@link ChoiceSetValueUpdateResponse})
|
|
2765
3088
|
*
|
|
2766
3089
|
* @example
|
|
@@ -2772,15 +3095,21 @@ declare class ChoiceSetService extends BaseService implements ChoiceSetServiceMo
|
|
|
2772
3095
|
* const travel = values.items.find(v => v.name === 'TRAVEL');
|
|
2773
3096
|
*
|
|
2774
3097
|
* await choicesets.updateValueById(expenseTypes.id, travel.id, 'Business Travel');
|
|
3098
|
+
*
|
|
3099
|
+
* // Folder-scoped choice set: folderKey is required on the wire
|
|
3100
|
+
* await choicesets.updateValueById(expenseTypes.id, travel.id, 'Business Travel', {
|
|
3101
|
+
* folderKey: "<folderKey>",
|
|
3102
|
+
* });
|
|
2775
3103
|
* ```
|
|
2776
3104
|
* @internal
|
|
2777
3105
|
*/
|
|
2778
|
-
updateValueById(choiceSetId: string, valueId: string, displayName: string): Promise<ChoiceSetValueUpdateResponse>;
|
|
3106
|
+
updateValueById(choiceSetId: string, valueId: string, displayName: string, options?: ChoiceSetValueUpdateOptions): Promise<ChoiceSetValueUpdateResponse>;
|
|
2779
3107
|
/**
|
|
2780
3108
|
* Deletes one or more values from a choice set.
|
|
2781
3109
|
*
|
|
2782
3110
|
* @param choiceSetId - UUID of the parent choice set
|
|
2783
3111
|
* @param valueIds - Array of value UUIDs to delete
|
|
3112
|
+
* @param options - Optional {@link ChoiceSetValueDeleteOptions} (e.g. `folderKey` for folder-scoped choice sets) The `folderKey` property is **experimental**.
|
|
2784
3113
|
* @returns Promise resolving when the values are deleted
|
|
2785
3114
|
*
|
|
2786
3115
|
* @example
|
|
@@ -2790,12 +3119,15 @@ declare class ChoiceSetService extends BaseService implements ChoiceSetServiceMo
|
|
|
2790
3119
|
* const idsToDelete = values.items.slice(0, 2).map(v => v.id);
|
|
2791
3120
|
*
|
|
2792
3121
|
* await choicesets.deleteValuesById('<choiceSetId>', idsToDelete);
|
|
3122
|
+
*
|
|
3123
|
+
* // Folder-scoped choice set
|
|
3124
|
+
* await choicesets.deleteValuesById('<choiceSetId>', idsToDelete, { folderKey: "<folderKey>" });
|
|
2793
3125
|
* ```
|
|
2794
3126
|
* @internal
|
|
2795
3127
|
*/
|
|
2796
|
-
deleteValuesById(choiceSetId: string, valueIds: string[]): Promise<void>;
|
|
3128
|
+
deleteValuesById(choiceSetId: string, valueIds: string[], options?: ChoiceSetValueDeleteOptions): Promise<void>;
|
|
2797
3129
|
private resolveChoiceSetName;
|
|
2798
3130
|
}
|
|
2799
3131
|
|
|
2800
3132
|
export { ChoiceSetService, ChoiceSetService as ChoiceSets, DataDirectionType, EntityService as Entities, EntityAggregateFunction, EntityFieldDataType, EntityService, EntityType, FieldDisplayType, JoinType, LogicalOperator, QueryFilterOperator, ReferenceType, createEntityWithMethods };
|
|
2801
|
-
export type { ChoiceSetCreateOptions, ChoiceSetGetAllResponse, ChoiceSetGetByIdOptions, ChoiceSetGetResponse, ChoiceSetServiceModel, ChoiceSetUpdateOptions, ChoiceSetValueInsertOptions, ChoiceSetValueInsertResponse, ChoiceSetValueUpdateResponse, EntityAggregate, 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 };
|
|
3133
|
+
export type { ChoiceSetCreateOptions, ChoiceSetDeleteByIdOptions, ChoiceSetGetAllOptions, ChoiceSetGetAllResponse, ChoiceSetGetByIdOptions, ChoiceSetGetResponse, ChoiceSetServiceModel, ChoiceSetUpdateOptions, ChoiceSetValueDeleteOptions, ChoiceSetValueInsertOptions, ChoiceSetValueInsertResponse, ChoiceSetValueUpdateOptions, ChoiceSetValueUpdateResponse, EntityAggregate, EntityBatchInsertOptions, EntityBatchInsertResponse, EntityCreateFieldOptions, EntityCreateOptions, EntityDeleteAttachmentOptions, EntityDeleteAttachmentResponse, EntityDeleteByIdOptions, EntityDeleteOptions, EntityDeleteRecordByIdOptions, EntityDeleteRecordsOptions, EntityDeleteResponse, EntityDownloadAttachmentOptions, EntityFieldBase, EntityFieldUpdateOptions, EntityFileType, EntityFolderScopedOptions, EntityGetAllOptions, EntityGetAllRecordsOptions, EntityGetByIdOptions, EntityGetRecordByIdOptions, EntityGetRecordsByIdOptions, EntityGetResponse, EntityImportRecordsByIdOptions, 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 };
|