@uipath/data-fabric-tool 1.197.0 → 1.198.0-preview.80
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/tool.js +674 -177
- package/package.json +2 -2
- package/src/commands/entities.ts +5 -4
- package/src/commands/records.ts +41 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/data-fabric-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.198.0-preview.80",
|
|
5
5
|
"description": "Manage Data Fabric entities and records.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/tool.js",
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"registry": "https://registry.npmjs.org/"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "9b2c3c0f21a256d2f38dd28bc97e72e6f7b10a9c"
|
|
18
18
|
}
|
package/src/commands/entities.ts
CHANGED
|
@@ -147,10 +147,11 @@ const ENTITIES_CREATE_EXAMPLES: CommandExample[] = [
|
|
|
147
147
|
Description:
|
|
148
148
|
"Create an entity with choice-set, relationship, and file fields. " +
|
|
149
149
|
"CHOICE_SET_SINGLE/CHOICE_SET_MULTIPLE require 'choiceSetId' (from 'df choice-sets list'). " +
|
|
150
|
-
"RELATIONSHIP
|
|
151
|
-
"Note: a RELATIONSHIP column on a record always stores the target record's UUID 'Id' (regardless of which 'referenceFieldId' configured the join) — see 'df records insert' for how to write the value."
|
|
150
|
+
"RELATIONSHIP requires 'referenceEntityId' (UUID of the target entity, from 'df entities list') and 'referenceFieldId' (UUID of the field on the target entity, from 'df entities get <target-id>'). " +
|
|
151
|
+
"Note: a RELATIONSHIP column on a record always stores the target record's UUID 'Id' (regardless of which 'referenceFieldId' configured the join) — see 'df records insert' for how to write the value. " +
|
|
152
|
+
"FILE fields take only 'fieldName' and 'type' — the server auto-wires the internal attachment reference; populate them later with 'uip df files upload <entity-id> <record-id> <field-name> --file <path>'.",
|
|
152
153
|
Command:
|
|
153
|
-
'uip df entities create Expense --body \'{"displayName":"Expense","fields":[{"fieldName":"category","type":"CHOICE_SET_SINGLE","choiceSetId":"c1d2e3f4-0000-0000-0000-000000000001","isRequired":true},{"fieldName":"tags","type":"CHOICE_SET_MULTIPLE","choiceSetId":"c1d2e3f4-0000-0000-0000-000000000002"},{"fieldName":"submitter","type":"RELATIONSHIP","referenceEntityId":"a1b2c3d4-0000-0000-0000-000000000010","referenceFieldId":"f1000000-0000-0000-0000-000000000100","isRequired":true},{"fieldName":"receipt","type":"FILE"
|
|
154
|
+
'uip df entities create Expense --body \'{"displayName":"Expense","fields":[{"fieldName":"category","type":"CHOICE_SET_SINGLE","choiceSetId":"c1d2e3f4-0000-0000-0000-000000000001","isRequired":true},{"fieldName":"tags","type":"CHOICE_SET_MULTIPLE","choiceSetId":"c1d2e3f4-0000-0000-0000-000000000002"},{"fieldName":"submitter","type":"RELATIONSHIP","referenceEntityId":"a1b2c3d4-0000-0000-0000-000000000010","referenceFieldId":"f1000000-0000-0000-0000-000000000100","isRequired":true},{"fieldName":"receipt","type":"FILE"}]}\'',
|
|
154
155
|
Output: {
|
|
155
156
|
Code: "EntityCreated",
|
|
156
157
|
Data: { ID: "a1b2c3d4-0000-0000-0000-000000000004" },
|
|
@@ -160,7 +161,7 @@ const ENTITIES_CREATE_EXAMPLES: CommandExample[] = [
|
|
|
160
161
|
Description:
|
|
161
162
|
"Create a folder-scoped entity with cross-folder references. " +
|
|
162
163
|
"Pass '--folder-key' to place the new entity in a folder. " +
|
|
163
|
-
"Per-field 'referenceFolderKey' points a RELATIONSHIP
|
|
164
|
+
"Per-field 'referenceFolderKey' points a RELATIONSHIP or CHOICE_SET_* field at a target that lives in a different folder (or at the tenant level when omitted). " +
|
|
164
165
|
"Get target entity/field IDs from 'df entities list --folder-key <key>' and 'df entities get <id> --folder-key <key>'; get choice-set IDs from 'df choice-sets list --folder-key <key>' (omit '--folder-key' for tenant-level choice sets).",
|
|
165
166
|
Command:
|
|
166
167
|
'uip df entities create OrderLine --folder-key f1000000-0000-0000-0000-000000000050 --body \'{"displayName":"Order Line","fields":[{"fieldName":"order","type":"RELATIONSHIP","referenceEntityId":"a1b2c3d4-0000-0000-0000-000000000010","referenceFieldId":"f1000000-0000-0000-0000-000000000100","referenceFolderKey":"f1000000-0000-0000-0000-000000000060","isRequired":true},{"fieldName":"userType","type":"CHOICE_SET_SINGLE","choiceSetId":"c1d2e3f4-0000-0000-0000-000000000077"}]}\'',
|
package/src/commands/records.ts
CHANGED
|
@@ -161,6 +161,46 @@ const RECORDS_UPDATE_EXAMPLES: CommandExample[] = [
|
|
|
161
161
|
},
|
|
162
162
|
];
|
|
163
163
|
|
|
164
|
+
const RECORDS_QUERY_EXAMPLES: CommandExample[] = [
|
|
165
|
+
{
|
|
166
|
+
Description:
|
|
167
|
+
"Filter records — exact keys: filterGroup / queryFilters / fieldName / operator / value. " +
|
|
168
|
+
"Operators: = != > < >= <= contains 'not contains' startswith endswith in 'not in'. " +
|
|
169
|
+
"Not accepted: 'filters', 'field', '==', 'Equals', 'eq', 'like'.",
|
|
170
|
+
Command:
|
|
171
|
+
"uip df records query a1b2c3d4-0000-0000-0000-000000000001 " +
|
|
172
|
+
'--body \'{"filterGroup":{"logicalOperator":0,"queryFilters":[{"fieldName":"status","operator":"=","value":"Paid"}]}}\'',
|
|
173
|
+
Output: {
|
|
174
|
+
Code: "RecordQuery",
|
|
175
|
+
Data: {
|
|
176
|
+
items: [
|
|
177
|
+
{
|
|
178
|
+
Id: "b2c3d4e5-0000-0000-0000-000000000001",
|
|
179
|
+
status: "Paid",
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
totalCount: 1,
|
|
183
|
+
hasNextPage: false,
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
Description: "Aggregate — COUNT grouped by a field.",
|
|
189
|
+
Command:
|
|
190
|
+
"uip df records query a1b2c3d4-0000-0000-0000-000000000001 " +
|
|
191
|
+
'--body \'{"aggregates":[{"function":"COUNT","field":"Id","alias":"total"}],"groupBy":["status"]}\'',
|
|
192
|
+
Output: {
|
|
193
|
+
Code: "RecordQuery",
|
|
194
|
+
Data: {
|
|
195
|
+
items: [
|
|
196
|
+
{ status: "Paid", total: 12 },
|
|
197
|
+
{ status: "Pending", total: 3 },
|
|
198
|
+
],
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
];
|
|
203
|
+
|
|
164
204
|
const RECORDS_DELETE_EXAMPLES: CommandExample[] = [
|
|
165
205
|
{
|
|
166
206
|
Description: "Delete records by ID",
|
|
@@ -585,6 +625,7 @@ export const registerRecordsCommand = (program: Command) => {
|
|
|
585
625
|
"--folder-key <key>",
|
|
586
626
|
"Folder key (GUID) of the folder containing the entity (for folder-scoped entities)",
|
|
587
627
|
)
|
|
628
|
+
.examples(RECORDS_QUERY_EXAMPLES)
|
|
588
629
|
.trackedAction(
|
|
589
630
|
processContext,
|
|
590
631
|
async (entityId: string, options: QueryOptions) => {
|