@uipath/data-fabric-tool 1.206.0-preview.301 → 1.207.0-preview.305
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/choice-sets-inline-1gv2mydg.js +173 -0
- package/dist/{entities-inline-rc94wgsw.js → entities-inline-0gpc75xj.js} +428 -823
- package/dist/{federated-payload-x2tz7x2g.js → federated-payload-4mb89pe9.js} +309 -7
- package/dist/index.js +9 -6
- package/dist/{packager-tool-8h3n7zh5.js → packager-tool-0whbpj17.js} +255 -248
- package/dist/packager-tool-34pcyhns.js +11 -0
- package/dist/packager-tool-3wzz1wn4.js +37 -0
- package/dist/{packager-tool-0j0r03b9.js → packager-tool-4amqsjff.js} +46 -1077
- package/dist/packager-tool-745zeysc.js +52 -0
- package/dist/{packager-tool-t8qhcdsv.js → packager-tool-fafs34c9.js} +384 -97
- package/dist/packager-tool-kt0mxbv8.js +1455 -0
- package/dist/{packager-tool-gj7vsn2f.js → packager-tool-skeew4e3.js} +2741 -2566
- package/dist/{packager-tool-b1anyew3.js → packager-tool-spr308qr.js} +13043 -13001
- package/dist/packager-tool-yxv0qfms.js +64 -0
- package/dist/packager-tool-zwqkr7z9.js +2197 -0
- package/dist/packager-tool.js +5 -3
- package/dist/sdk-client-d91ez016.js +13 -0
- package/dist/tool.js +9 -6
- package/package.json +2 -2
- package/dist/packager-tool-cbbznax3.js +0 -101
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getFileSystem,
|
|
3
|
+
RESULTS,
|
|
3
4
|
extractErrorMessage,
|
|
4
5
|
runChecks,
|
|
5
|
-
RESULTS,
|
|
6
6
|
Option,
|
|
7
7
|
logger,
|
|
8
8
|
OutputFormatter,
|
|
@@ -17,31 +17,38 @@ import {
|
|
|
17
17
|
findFilePayloadKeys,
|
|
18
18
|
findIsUniqueInUpdateFields,
|
|
19
19
|
validateFieldsPayload
|
|
20
|
-
} from "./packager-tool-
|
|
20
|
+
} from "./packager-tool-skeew4e3.js";
|
|
21
21
|
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} from "./packager-tool-
|
|
22
|
+
validateName,
|
|
23
|
+
catchError
|
|
24
|
+
} from "./packager-tool-0whbpj17.js";
|
|
25
25
|
import {
|
|
26
|
-
getAuthContext,
|
|
27
26
|
EntityFieldDataType,
|
|
28
27
|
EntityClass,
|
|
29
|
-
DataFabricDirectoryEntityTypeName
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
DataFabricDirectoryEntityTypeName
|
|
29
|
+
} from "./packager-tool-spr308qr.js";
|
|
30
|
+
import {
|
|
31
|
+
getAuthenticatedContext2,
|
|
32
|
+
connectOrFail2
|
|
33
|
+
} from "./packager-tool-3wzz1wn4.js";
|
|
34
|
+
import {
|
|
35
|
+
LOCAL_REFERENCE_KEY_NAMES
|
|
36
|
+
} from "./packager-tool-34pcyhns.js";
|
|
32
37
|
import {
|
|
33
|
-
fail,
|
|
34
|
-
failInvalidArgument,
|
|
35
|
-
requireDestructiveConfirmation,
|
|
36
38
|
readFileBinary,
|
|
37
39
|
readJsonInput
|
|
38
|
-
} from "./packager-tool-
|
|
40
|
+
} from "./packager-tool-745zeysc.js";
|
|
41
|
+
import {
|
|
42
|
+
fail,
|
|
43
|
+
failInvalidArgument,
|
|
44
|
+
requireDestructiveConfirmation
|
|
45
|
+
} from "./packager-tool-yxv0qfms.js";
|
|
39
46
|
// package.json
|
|
40
47
|
var package_default = {
|
|
41
48
|
name: "@uipath/data-fabric-tool",
|
|
42
49
|
author: "UiPath",
|
|
43
50
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
44
|
-
version: "1.
|
|
51
|
+
version: "1.207.0-preview.305",
|
|
45
52
|
description: "Manage Data Fabric entities and records.",
|
|
46
53
|
publishConfig: {
|
|
47
54
|
registry: "https://npm.pkg.github.com/"
|
|
@@ -81,26 +88,6 @@ var package_default = {
|
|
|
81
88
|
}
|
|
82
89
|
};
|
|
83
90
|
|
|
84
|
-
// src/utils/sdk-client.ts
|
|
85
|
-
var getAuthenticatedContext = () => getAuthContext();
|
|
86
|
-
var createDataFabricClient = async (tenantOverride) => {
|
|
87
|
-
const ctx = await getAuthenticatedContext();
|
|
88
|
-
return new UiPath({
|
|
89
|
-
secret: ctx.accessToken,
|
|
90
|
-
baseUrl: ctx.baseUrl,
|
|
91
|
-
orgName: ctx.organizationName,
|
|
92
|
-
tenantName: tenantOverride || ctx.tenantName
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
var connectOrFail = async (tenantOverride) => {
|
|
96
|
-
const [clientError, sdk] = await catchError(createDataFabricClient(tenantOverride));
|
|
97
|
-
if (clientError) {
|
|
98
|
-
fail("Error connecting to Data Fabric", await extractErrorMessage(clientError));
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
return sdk;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
91
|
// src/commands/choice-sets.ts
|
|
105
92
|
var OUTPUT_CODES = {
|
|
106
93
|
ChoiceSetList: "ChoiceSetList",
|
|
@@ -183,8 +170,8 @@ var CHOICE_SETS_UPDATE_EXAMPLES = [
|
|
|
183
170
|
];
|
|
184
171
|
var CHOICE_SETS_DELETE_EXAMPLES = [
|
|
185
172
|
{
|
|
186
|
-
Description: "Delete a choice set (irreversible — requires --
|
|
187
|
-
Command: 'uip df choice-sets delete c1d2e3f4-0000-0000-0000-000000000001 --
|
|
173
|
+
Description: "Delete a choice set (irreversible — requires --yes and --reason).",
|
|
174
|
+
Command: 'uip df choice-sets delete c1d2e3f4-0000-0000-0000-000000000001 --yes --reason "no longer used"',
|
|
188
175
|
Output: {
|
|
189
176
|
Code: OUTPUT_CODES.ChoiceSetDeleted,
|
|
190
177
|
Data: {
|
|
@@ -194,13 +181,161 @@ var CHOICE_SETS_DELETE_EXAMPLES = [
|
|
|
194
181
|
}
|
|
195
182
|
}
|
|
196
183
|
];
|
|
184
|
+
var LOCAL_CHOICE_SETS_LIST_EXAMPLES = [
|
|
185
|
+
{
|
|
186
|
+
Description: "List the choice sets authored in the solution on disk. No login; run inside the solution directory.",
|
|
187
|
+
Command: "uip df choice-sets list --local",
|
|
188
|
+
Output: {
|
|
189
|
+
Code: "InlineChoiceSetList",
|
|
190
|
+
Data: [
|
|
191
|
+
{
|
|
192
|
+
Name: "OrderStatus",
|
|
193
|
+
DisplayName: "OrderStatus",
|
|
194
|
+
ValueCount: 3,
|
|
195
|
+
ResourceFile: "/work/Sol/resources/solution_folder/choiceSet/OrderStatus.json"
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
];
|
|
201
|
+
var LOCAL_CHOICE_SETS_GET_EXAMPLES = [
|
|
202
|
+
{
|
|
203
|
+
Description: "List the values of a choice set authored on disk, by name. A value added with --local has no 'NumberId' until the solution deploys, which assigns it: 0, 1, 2… in order for a new choice set, the next free number for one already deployed. 'NumberId' appears only on a value that has one in the file.",
|
|
204
|
+
Command: "uip df choice-sets list-values OrderStatus --local",
|
|
205
|
+
Output: {
|
|
206
|
+
Code: "InlineChoiceSetValues",
|
|
207
|
+
Data: {
|
|
208
|
+
Name: "OrderStatus",
|
|
209
|
+
ResourceFile: "/work/Sol/resources/solution_folder/choiceSet/OrderStatus.json",
|
|
210
|
+
Values: [
|
|
211
|
+
{ Name: "Open", DisplayName: "Open" },
|
|
212
|
+
{ Name: "Closed", DisplayName: "Closed" }
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
];
|
|
218
|
+
var LOCAL_CHOICE_SETS_CREATE_EXAMPLES = [
|
|
219
|
+
{
|
|
220
|
+
Description: "Create a choice set in the solution on disk. It is written to resources/solution_folder/choiceSet/<Name>.json and reaches a tenant when the solution deploys. Names are 3-100 letters and digits.",
|
|
221
|
+
Command: "uip df choice-sets create OrderStatus --local",
|
|
222
|
+
Output: {
|
|
223
|
+
Code: "InlineChoiceSetCreated",
|
|
224
|
+
Data: {
|
|
225
|
+
Name: "OrderStatus",
|
|
226
|
+
DisplayName: "OrderStatus",
|
|
227
|
+
ResourceFile: "/work/Sol/resources/solution_folder/choiceSet/OrderStatus.json"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
];
|
|
232
|
+
var LOCAL_CHOICE_SETS_DELETE_EXAMPLES = [
|
|
233
|
+
{
|
|
234
|
+
Description: "Delete a choice set authored on disk. Local only, so it takes --yes and no --reason.",
|
|
235
|
+
Command: "uip df choice-sets delete OrderStatus --local --yes",
|
|
236
|
+
Output: {
|
|
237
|
+
Code: "InlineChoiceSetDeleted",
|
|
238
|
+
Data: {
|
|
239
|
+
Name: "OrderStatus",
|
|
240
|
+
ResourceFile: "/work/Sol/resources/solution_folder/choiceSet/OrderStatus.json"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
];
|
|
245
|
+
var LOCAL_VALUES_CREATE_EXAMPLES = [
|
|
246
|
+
{
|
|
247
|
+
Description: "Add a value to a choice set authored on disk. The choice set is named, not addressed by id. Without --display-name the display name is the value name. The value gets no NumberId here: the deploy assigns it, so a number already used on the tenant is never handed out again.",
|
|
248
|
+
Command: 'uip df choice-set-values create OrderStatus Open --local --display-name "Open"',
|
|
249
|
+
Output: {
|
|
250
|
+
Code: "InlineChoiceSetValueCreated",
|
|
251
|
+
Data: {
|
|
252
|
+
ChoiceSet: "OrderStatus",
|
|
253
|
+
Name: "Open",
|
|
254
|
+
DisplayName: "Open",
|
|
255
|
+
ResourceFile: "/work/Sol/resources/solution_folder/choiceSet/OrderStatus.json"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
];
|
|
260
|
+
var LOCAL_VALUES_DELETE_EXAMPLES = [
|
|
261
|
+
{
|
|
262
|
+
Description: "Delete values from a choice set authored on disk, by name. All names must exist or nothing is removed. A choice set already deployed keeps deleted values after an upgrade, which adds values by name and removes none; the output's Warning says how to remove them on the tenant.",
|
|
263
|
+
Command: "uip df choice-set-values delete OrderStatus --local --names Open Closed --yes",
|
|
264
|
+
Output: {
|
|
265
|
+
Code: "InlineChoiceSetValuesDeleted",
|
|
266
|
+
Data: {
|
|
267
|
+
ChoiceSet: "OrderStatus",
|
|
268
|
+
DeletedNames: ["Open", "Closed"],
|
|
269
|
+
ResourceFile: "/work/Sol/resources/solution_folder/choiceSet/OrderStatus.json"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
];
|
|
274
|
+
var LOCAL_OPTION_DESCRIPTION = "Act on choice sets authored in the local solution instead of the tenant. No login required; nothing exists on a tenant until the solution deploys.";
|
|
275
|
+
function rejectMisplacedLocalOptions(options, tenantOnly, localOnly = []) {
|
|
276
|
+
const flag = (name) => `--${name.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}`;
|
|
277
|
+
const present = (names) => names.filter((name) => options[name] !== undefined && options[name] !== false);
|
|
278
|
+
if (options.local === true) {
|
|
279
|
+
const offenders = present(tenantOnly);
|
|
280
|
+
if (offenders.length > 0) {
|
|
281
|
+
failInvalidArgument(`${offenders.map(flag).join(", ")} ${offenders.length === 1 ? "does" : "do"} not apply with --local`, "A locally authored choice set has no tenant and no folder until the solution deploys, so there is nothing for these to address. Drop them, or drop --local to act on the tenant.");
|
|
282
|
+
return true;
|
|
283
|
+
}
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
const offenders = present(localOnly);
|
|
287
|
+
if (offenders.length > 0) {
|
|
288
|
+
failInvalidArgument(`${offenders.map(flag).join(", ")} ${offenders.length === 1 ? "requires" : "require"} --local`, "These act on the choice set files in the solution on disk. Without --local the command acts on the tenant, which never reads them. Add --local, or drop them.");
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
async function loadLocalHandlersAsync() {
|
|
294
|
+
const {
|
|
295
|
+
LOCAL_AUTHORING_AVAILABLE,
|
|
296
|
+
runLocalChoiceSetCreate,
|
|
297
|
+
runLocalChoiceSetDelete,
|
|
298
|
+
runLocalChoiceSetList,
|
|
299
|
+
runLocalChoiceSetValues,
|
|
300
|
+
runLocalValueCreate,
|
|
301
|
+
runLocalValuesDelete
|
|
302
|
+
} = await import("./choice-sets-inline-1gv2mydg.js");
|
|
303
|
+
if (LOCAL_AUTHORING_AVAILABLE !== true) {
|
|
304
|
+
failInvalidArgument("--local is not available in this environment", "Local authoring reads and writes the solution on disk, which this build cannot reach. Run the command with the uip CLI on a machine that has the solution checked out.");
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
runLocalChoiceSetCreate,
|
|
309
|
+
runLocalChoiceSetDelete,
|
|
310
|
+
runLocalChoiceSetList,
|
|
311
|
+
runLocalChoiceSetValues,
|
|
312
|
+
runLocalValueCreate,
|
|
313
|
+
runLocalValuesDelete
|
|
314
|
+
};
|
|
315
|
+
}
|
|
197
316
|
var registerChoiceSetsCommand = (program) => {
|
|
198
317
|
const choiceSets = program.command("choice-sets").description("Manage Data Fabric choice sets — the enumerated value lists referenced by CHOICE_SET_SINGLE/CHOICE_SET_MULTIPLE entity fields. " + "Use 'list'/'list-values' to inspect, and 'create'/'update'/'delete' to manage them. Manage individual values with 'df choice-set-values'.");
|
|
199
|
-
choiceSets.command("list").description("List all Data Fabric choice sets").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--folder-key <key>", "Folder key (GUID) to scope the listing to a specific folder").option("--include-folders", "List tenant-level choice sets together with choice sets from every folder you can see. Mutually exclusive with --folder-key.").
|
|
318
|
+
choiceSets.command("list").description("List all Data Fabric choice sets").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--folder-key <key>", "Folder key (GUID) to scope the listing to a specific folder").option("--include-folders", "List tenant-level choice sets together with choice sets from every folder you can see. Mutually exclusive with --folder-key.").option("--local", LOCAL_OPTION_DESCRIPTION).examples([
|
|
319
|
+
...CHOICE_SETS_LIST_EXAMPLES,
|
|
320
|
+
...LOCAL_CHOICE_SETS_LIST_EXAMPLES
|
|
321
|
+
]).trackedAction(processContext, async (options) => {
|
|
322
|
+
if (rejectMisplacedLocalOptions(options, [
|
|
323
|
+
"folderKey",
|
|
324
|
+
"includeFolders",
|
|
325
|
+
"tenant"
|
|
326
|
+
])) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
if (options.local) {
|
|
330
|
+
const local = await loadLocalHandlersAsync();
|
|
331
|
+
if (local === undefined)
|
|
332
|
+
return;
|
|
333
|
+
return local.runLocalChoiceSetList();
|
|
334
|
+
}
|
|
200
335
|
if (options.folderKey !== undefined && options.includeFolders === true) {
|
|
201
336
|
return fail("--folder-key and --include-folders are mutually exclusive", "Use --folder-key to list a single folder, or --include-folders to list tenant + folder choice sets together.");
|
|
202
337
|
}
|
|
203
|
-
const sdk = await
|
|
338
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
204
339
|
if (!sdk)
|
|
205
340
|
return;
|
|
206
341
|
const listOpts = {
|
|
@@ -221,7 +356,25 @@ var registerChoiceSetsCommand = (program) => {
|
|
|
221
356
|
Data: result ?? []
|
|
222
357
|
});
|
|
223
358
|
});
|
|
224
|
-
choiceSets.command("list-values").description("List the values of a Data Fabric choice set").argument("<choice-set-id>", "Choice set ID").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-l, --limit <number>", "Number of values to return per page
|
|
359
|
+
choiceSets.command("list-values").description("List the values of a Data Fabric choice set").argument("<choice-set-id>", "Choice set ID; with --local, the choice set name").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-l, --limit <number>", "Number of values to return per page (default 50)").option("-o, --offset <number>", "Start from the page containing this record index (rounded down to the nearest page boundary; mutually exclusive with --cursor)").option("--cursor <cursor>", "Pagination cursor from a previous response to fetch the next page").option("--folder-key <key>", "Folder key (GUID) of the folder containing the choice set (for folder-scoped choice sets)").option("--local", LOCAL_OPTION_DESCRIPTION).examples([
|
|
360
|
+
...CHOICE_SETS_GET_EXAMPLES,
|
|
361
|
+
...LOCAL_CHOICE_SETS_GET_EXAMPLES
|
|
362
|
+
]).trackedAction(processContext, async (choiceSetId, options) => {
|
|
363
|
+
if (rejectMisplacedLocalOptions(options, [
|
|
364
|
+
"cursor",
|
|
365
|
+
"folderKey",
|
|
366
|
+
"limit",
|
|
367
|
+
"offset",
|
|
368
|
+
"tenant"
|
|
369
|
+
])) {
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
if (options.local) {
|
|
373
|
+
const local = await loadLocalHandlersAsync();
|
|
374
|
+
if (local === undefined)
|
|
375
|
+
return;
|
|
376
|
+
return local.runLocalChoiceSetValues(choiceSetId);
|
|
377
|
+
}
|
|
225
378
|
const pageSize = Number(options.limit ?? "50");
|
|
226
379
|
if (Number.isNaN(pageSize) || pageSize < 1) {
|
|
227
380
|
return fail("Invalid --limit value", "Provide a positive integer for --limit.");
|
|
@@ -237,7 +390,7 @@ var registerChoiceSetsCommand = (program) => {
|
|
|
237
390
|
}
|
|
238
391
|
jumpToPage = Math.floor(offsetValue / pageSize) + 1;
|
|
239
392
|
}
|
|
240
|
-
const sdk = await
|
|
393
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
241
394
|
if (!sdk)
|
|
242
395
|
return;
|
|
243
396
|
const paginationOptions = options.cursor !== undefined ? { pageSize, cursor: { value: options.cursor } } : jumpToPage !== undefined ? { pageSize, jumpToPage } : { pageSize };
|
|
@@ -254,7 +407,22 @@ var registerChoiceSetsCommand = (program) => {
|
|
|
254
407
|
Data: result
|
|
255
408
|
});
|
|
256
409
|
});
|
|
257
|
-
choiceSets.command("create").description("Create a new Data Fabric choice set").argument("<name>", "Choice set name (must start with a letter; letters, numbers, and underscores only)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--display-name <name>", "Human-readable display name").option("--description <text>", "Choice set description").option("--folder-key <uuid>", "UUID of the folder to place the choice set in (defaults to the tenant-level folder)").
|
|
410
|
+
choiceSets.command("create").description("Create a new Data Fabric choice set").argument("<name>", "Choice set name (must start with a letter; letters, numbers, and underscores only)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--display-name <name>", "Human-readable display name").option("--description <text>", "Choice set description").option("--folder-key <uuid>", "UUID of the folder to place the choice set in (defaults to the tenant-level folder)").option("--local", LOCAL_OPTION_DESCRIPTION).examples([
|
|
411
|
+
...CHOICE_SETS_CREATE_EXAMPLES,
|
|
412
|
+
...LOCAL_CHOICE_SETS_CREATE_EXAMPLES
|
|
413
|
+
]).trackedAction(processContext, async (name, options) => {
|
|
414
|
+
if (rejectMisplacedLocalOptions(options, [
|
|
415
|
+
"folderKey",
|
|
416
|
+
"tenant"
|
|
417
|
+
])) {
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
if (options.local) {
|
|
421
|
+
const local = await loadLocalHandlersAsync();
|
|
422
|
+
if (local === undefined)
|
|
423
|
+
return;
|
|
424
|
+
return local.runLocalChoiceSetCreate(name, options);
|
|
425
|
+
}
|
|
258
426
|
const nameErr = validateName(name, "choice set");
|
|
259
427
|
if (nameErr)
|
|
260
428
|
return fail(nameErr.message, nameErr.instructions);
|
|
@@ -264,7 +432,7 @@ var registerChoiceSetsCommand = (program) => {
|
|
|
264
432
|
}, "Choice set");
|
|
265
433
|
if (metadataErr)
|
|
266
434
|
return fail(metadataErr.message, metadataErr.instructions);
|
|
267
|
-
const sdk = await
|
|
435
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
268
436
|
if (!sdk)
|
|
269
437
|
return;
|
|
270
438
|
const createOpts = {
|
|
@@ -299,7 +467,7 @@ var registerChoiceSetsCommand = (program) => {
|
|
|
299
467
|
}, "Choice set");
|
|
300
468
|
if (metadataErr)
|
|
301
469
|
return fail(metadataErr.message, metadataErr.instructions);
|
|
302
|
-
const sdk = await
|
|
470
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
303
471
|
if (!sdk)
|
|
304
472
|
return;
|
|
305
473
|
const updateOpts = {
|
|
@@ -324,11 +492,27 @@ var registerChoiceSetsCommand = (program) => {
|
|
|
324
492
|
Data: { ID: choiceSetId }
|
|
325
493
|
});
|
|
326
494
|
});
|
|
327
|
-
choiceSets.command("delete").description("Delete a Data Fabric choice set (irreversible)").argument("<choice-set-id>", "Choice set ID").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-y, --yes", "
|
|
495
|
+
choiceSets.command("delete").description("Delete a Data Fabric choice set (irreversible)").argument("<choice-set-id>", "Choice set ID; with --local, the choice set name").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-y, --yes", "Required. Confirm this irreversible operation; the CLI never prompts").addOption(new Option("--confirm", "Deprecated alias for --yes").hideHelp()).option("--reason <reason>", "Required for a tenant delete; not used with --local. Reason for the deletion — echoed back in the response so the caller can log it").option("--folder-key <key>", "Folder key (GUID) of the folder containing the choice set (for folder-scoped choice sets)").option("--local", LOCAL_OPTION_DESCRIPTION).examples([
|
|
496
|
+
...CHOICE_SETS_DELETE_EXAMPLES,
|
|
497
|
+
...LOCAL_CHOICE_SETS_DELETE_EXAMPLES
|
|
498
|
+
]).trackedAction(processContext, async (choiceSetId, options) => {
|
|
499
|
+
if (rejectMisplacedLocalOptions(options, [
|
|
500
|
+
"folderKey",
|
|
501
|
+
"reason",
|
|
502
|
+
"tenant"
|
|
503
|
+
])) {
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
if (options.local) {
|
|
507
|
+
const local = await loadLocalHandlersAsync();
|
|
508
|
+
if (local === undefined)
|
|
509
|
+
return;
|
|
510
|
+
return local.runLocalChoiceSetDelete(choiceSetId, options);
|
|
511
|
+
}
|
|
328
512
|
const reason = requireDestructiveConfirmation(options, `delete choice set '${choiceSetId}'`, 'Pass --reason "<text>" to record why the choice set is being deleted.');
|
|
329
513
|
if (reason === null)
|
|
330
514
|
return;
|
|
331
|
-
const sdk = await
|
|
515
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
332
516
|
if (!sdk)
|
|
333
517
|
return;
|
|
334
518
|
const deleteOpts = {
|
|
@@ -380,8 +564,8 @@ var CHOICE_SET_VALUES_UPDATE_EXAMPLES = [
|
|
|
380
564
|
];
|
|
381
565
|
var CHOICE_SET_VALUES_DELETE_EXAMPLES = [
|
|
382
566
|
{
|
|
383
|
-
Description: "Delete one or more values from a choice set (irreversible — requires --
|
|
384
|
-
Command: 'uip df choice-set-values delete c1d2e3f4-0000-0000-0000-000000000001 --ids v1000000-0000-0000-0000-000000000001,v1000000-0000-0000-0000-000000000002 --
|
|
567
|
+
Description: "Delete one or more values from a choice set (irreversible — requires --yes and --reason). Pass value IDs as a comma-separated list.",
|
|
568
|
+
Command: 'uip df choice-set-values delete c1d2e3f4-0000-0000-0000-000000000001 --ids v1000000-0000-0000-0000-000000000001,v1000000-0000-0000-0000-000000000002 --yes --reason "deprecated categories"',
|
|
385
569
|
Output: {
|
|
386
570
|
Code: OUTPUT_CODES.ChoiceSetValuesDeleted,
|
|
387
571
|
Data: {
|
|
@@ -396,8 +580,23 @@ var CHOICE_SET_VALUES_DELETE_EXAMPLES = [
|
|
|
396
580
|
}
|
|
397
581
|
];
|
|
398
582
|
var registerChoiceSetValuesCommand = (program) => {
|
|
399
|
-
const values = program.command("choice-set-values").description("Manage the individual values of a Data Fabric choice set.
|
|
400
|
-
values.command("create").description("Add a value to a Data Fabric choice set").argument("<choice-set-id>", "Choice set ID").argument("<name>", "Value name (must start with a letter; letters and numbers only)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--display-name <name>", "Human-readable display name").option("--folder-key <key>", "Folder key (GUID) of the folder containing the choice set (required for folder-scoped choice sets)").
|
|
583
|
+
const values = program.command("choice-set-values").description("Manage the individual values of a Data Fabric choice set. Use 'df choice-sets list-values <choice-set-id>' to list existing values and their IDs.");
|
|
584
|
+
values.command("create").description("Add a value to a Data Fabric choice set").argument("<choice-set-id>", "Choice set ID; with --local, the choice set name").argument("<name>", "Value name (must start with a letter; letters and numbers only)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--display-name <name>", "Human-readable display name").option("--folder-key <key>", "Folder key (GUID) of the folder containing the choice set (required for folder-scoped choice sets)").option("--local", LOCAL_OPTION_DESCRIPTION).examples([
|
|
585
|
+
...CHOICE_SET_VALUES_CREATE_EXAMPLES,
|
|
586
|
+
...LOCAL_VALUES_CREATE_EXAMPLES
|
|
587
|
+
]).trackedAction(processContext, async (choiceSetId, name, options) => {
|
|
588
|
+
if (rejectMisplacedLocalOptions(options, [
|
|
589
|
+
"folderKey",
|
|
590
|
+
"tenant"
|
|
591
|
+
])) {
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
if (options.local) {
|
|
595
|
+
const local = await loadLocalHandlersAsync();
|
|
596
|
+
if (local === undefined)
|
|
597
|
+
return;
|
|
598
|
+
return local.runLocalValueCreate(choiceSetId, name, options);
|
|
599
|
+
}
|
|
401
600
|
const nameErr = validateChoiceValueName(name);
|
|
402
601
|
if (nameErr)
|
|
403
602
|
return fail(nameErr.message, nameErr.instructions);
|
|
@@ -406,7 +605,7 @@ var registerChoiceSetValuesCommand = (program) => {
|
|
|
406
605
|
if (displayErr)
|
|
407
606
|
return fail(displayErr.message, displayErr.instructions);
|
|
408
607
|
}
|
|
409
|
-
const sdk = await
|
|
608
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
410
609
|
if (!sdk)
|
|
411
610
|
return;
|
|
412
611
|
const insertOpts = {
|
|
@@ -432,7 +631,7 @@ var registerChoiceSetValuesCommand = (program) => {
|
|
|
432
631
|
const displayErr = validateChoiceValueDisplayName(displayName);
|
|
433
632
|
if (displayErr)
|
|
434
633
|
return fail(displayErr.message, displayErr.instructions);
|
|
435
|
-
const sdk = await
|
|
634
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
436
635
|
if (!sdk)
|
|
437
636
|
return;
|
|
438
637
|
const updateOpts = {
|
|
@@ -451,7 +650,19 @@ var registerChoiceSetValuesCommand = (program) => {
|
|
|
451
650
|
Data: result
|
|
452
651
|
});
|
|
453
652
|
});
|
|
454
|
-
values.command("delete").description("Delete values from a Data Fabric choice set (irreversible)").argument("<choice-set-id>", "Choice set ID").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--ids <ids>", "Comma-separated list of value IDs to delete").option("-y, --yes", "
|
|
653
|
+
values.command("delete").description("Delete values from a Data Fabric choice set (irreversible)").argument("<choice-set-id>", "Choice set ID; with --local, the choice set name").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--ids <ids>", "Comma-separated list of value IDs to delete").option("--names <names...>", "With --local: the names of the values to delete, space- or comma-separated. Local values have no id. Put the choice set name before --names: a word after it is read as a value name.").option("-y, --yes", "Required. Confirm this irreversible operation; the CLI never prompts").addOption(new Option("--confirm", "Deprecated alias for --yes").hideHelp()).option("--reason <reason>", "Required for a tenant delete; not used with --local. Reason for the deletion — echoed back in the response so the caller can log it").option("--folder-key <key>", "Folder key (GUID) of the folder containing the choice set (required for folder-scoped choice sets)").option("--local", LOCAL_OPTION_DESCRIPTION).examples([
|
|
654
|
+
...CHOICE_SET_VALUES_DELETE_EXAMPLES,
|
|
655
|
+
...LOCAL_VALUES_DELETE_EXAMPLES
|
|
656
|
+
]).trackedAction(processContext, async (choiceSetId, options) => {
|
|
657
|
+
if (rejectMisplacedLocalOptions(options, ["folderKey", "ids", "reason", "tenant"], ["names"])) {
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
if (options.local) {
|
|
661
|
+
const local = await loadLocalHandlersAsync();
|
|
662
|
+
if (local === undefined)
|
|
663
|
+
return;
|
|
664
|
+
return local.runLocalValuesDelete(choiceSetId, options);
|
|
665
|
+
}
|
|
455
666
|
const valueIds = (options.ids ?? "").split(",").map((id) => id.trim()).filter((id) => id.length > 0);
|
|
456
667
|
if (valueIds.length === 0) {
|
|
457
668
|
return fail("No value IDs provided", "Pass --ids <id,id,...> with at least one value ID to delete.");
|
|
@@ -459,7 +670,7 @@ var registerChoiceSetValuesCommand = (program) => {
|
|
|
459
670
|
const reason = requireDestructiveConfirmation(options, `delete ${valueIds.length} value(s) from choice set '${choiceSetId}'`, 'Pass --reason "<text>" to record why the values are being deleted.');
|
|
460
671
|
if (reason === null)
|
|
461
672
|
return;
|
|
462
|
-
const sdk = await
|
|
673
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
463
674
|
if (!sdk)
|
|
464
675
|
return;
|
|
465
676
|
const deleteOpts = {
|
|
@@ -501,7 +712,7 @@ var CONNECTORS_LIST_EXAMPLES = [
|
|
|
501
712
|
var registerConnectorsCommand = (program) => {
|
|
502
713
|
const connectors = program.command("connectors").description("Data Fabric federated-source connectors");
|
|
503
714
|
connectors.command("list").description("List Integration Service connectors supported as federated Data Fabric sources").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).examples(CONNECTORS_LIST_EXAMPLES).trackedAction(processContext, async (options) => {
|
|
504
|
-
const [authError, ctx] = await catchError(
|
|
715
|
+
const [authError, ctx] = await catchError(getAuthenticatedContext2());
|
|
505
716
|
if (authError) {
|
|
506
717
|
return fail("Not logged in", await extractErrorMessage(authError));
|
|
507
718
|
}
|
|
@@ -619,7 +830,7 @@ var registerDirectoryCommand = (program) => {
|
|
|
619
830
|
if (skip === null || skip < 0) {
|
|
620
831
|
return fail(`Invalid --offset value '${options.offset}'`, "Provide a non-negative integer for --offset.");
|
|
621
832
|
}
|
|
622
|
-
const sdk = await
|
|
833
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
623
834
|
if (!sdk)
|
|
624
835
|
return;
|
|
625
836
|
const listOptions = { skip, top };
|
|
@@ -642,7 +853,7 @@ var registerDirectoryCommand = (program) => {
|
|
|
642
853
|
if (roleIds.length === 0) {
|
|
643
854
|
return fail("No role IDs provided", "Provide at least one role ID via --role-ids. Use 'df roles list' to see available roles.");
|
|
644
855
|
}
|
|
645
|
-
const sdk = await
|
|
856
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
646
857
|
if (!sdk)
|
|
647
858
|
return;
|
|
648
859
|
const assignOptions = {
|
|
@@ -663,11 +874,11 @@ var registerDirectoryCommand = (program) => {
|
|
|
663
874
|
Data: result ?? []
|
|
664
875
|
});
|
|
665
876
|
});
|
|
666
|
-
directory.command("revoke-roles").description("Revoke all direct Data Fabric roles from one or more principals").argument("<principal-ids...>", "Principal external ID(s)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-y, --yes", "
|
|
877
|
+
directory.command("revoke-roles").description("Revoke all direct Data Fabric roles from one or more principals").argument("<principal-ids...>", "Principal external ID(s)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-y, --yes", "Required. Confirm this irreversible operation; the CLI never prompts").addOption(new Option("--confirm", "Deprecated alias for --yes").hideHelp()).option("--reason <reason>", "Required. Reason for the revocation — echoed back in the response so the caller can log it").examples(DIRECTORY_REVOKE_ROLES_EXAMPLES).trackedAction(processContext, async (principalIds, options) => {
|
|
667
878
|
const reason = requireDestructiveConfirmation(options, `revoke all Data Fabric roles from ${principalIds.length} principal(s)`, 'Pass --reason "<text>" to record why the roles are being revoked.');
|
|
668
879
|
if (reason === null)
|
|
669
880
|
return;
|
|
670
|
-
const sdk = await
|
|
881
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
671
882
|
if (!sdk)
|
|
672
883
|
return;
|
|
673
884
|
const [revokeError] = await catchError(sdk.entities.directory.revokeRoles(principalIds));
|
|
@@ -751,8 +962,8 @@ var ENTITIES_GET_EXAMPLES = [
|
|
|
751
962
|
];
|
|
752
963
|
var ENTITIES_DELETE_EXAMPLES = [
|
|
753
964
|
{
|
|
754
|
-
Description: "Delete an entity (irreversible — requires --
|
|
755
|
-
Command: 'uip df entities delete a1b2c3d4-0000-0000-0000-000000000001 --
|
|
965
|
+
Description: "Delete an entity (irreversible — requires --yes and --reason)",
|
|
966
|
+
Command: 'uip df entities delete a1b2c3d4-0000-0000-0000-000000000001 --yes --reason "test entity cleanup"',
|
|
756
967
|
Output: {
|
|
757
968
|
Code: "EntityDeleted",
|
|
758
969
|
Data: {
|
|
@@ -856,6 +1067,49 @@ var LOCAL_CREATE_EXAMPLES = [
|
|
|
856
1067
|
Created: "project"
|
|
857
1068
|
}
|
|
858
1069
|
}
|
|
1070
|
+
},
|
|
1071
|
+
{
|
|
1072
|
+
Description: "Create an entity with a relationship and a choice-set field. A local field names its target — an entity or choice set already in the solution, or the entity itself — instead of passing an id; 'referenceFieldName' defaults to 'Id'. The targets are recorded in the resource's dependencies.",
|
|
1073
|
+
Command: `uip df entities create SalesOrder --local --project-name Sales --body '{"fields":[{"name":"status","type":"CHOICE_SET_SINGLE","choiceSetName":"OrderStatus"},{"name":"customer","type":"RELATIONSHIP","referenceEntityName":"Customer"},{"name":"parent","type":"RELATIONSHIP","referenceEntityName":"SalesOrder"}]}'`,
|
|
1074
|
+
Output: {
|
|
1075
|
+
Code: "InlineEntityCreated",
|
|
1076
|
+
Data: {
|
|
1077
|
+
Project: "Sales",
|
|
1078
|
+
Entity: "SalesOrder",
|
|
1079
|
+
EntityFile: "/workspace/Sol/Sales/SalesOrder.entity",
|
|
1080
|
+
ResourceFile: "/workspace/Sol/resources/solution_folder/entity/native/SalesOrder.json",
|
|
1081
|
+
Created: "entity",
|
|
1082
|
+
Fields: ["status", "customer", "parent"]
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
Description: "Create a federated entity over a native entity in the solution. A source names its entity ('entityName') or a connection resource of the solution ('connectionName' + 'object', which needs 'uip login'); a join side names its source's object and its connection or entity name. The entity is one file, entity/federated/<Name>.json, with no Entity project; it cannot be updated with --local — delete and create it again.",
|
|
1088
|
+
Command: `uip df entities create AccountsView --local --body '{"externalFields":[{"entityName":"Customer","fields":["name"]}]}'`,
|
|
1089
|
+
Output: {
|
|
1090
|
+
Code: "InlineEntityCreated",
|
|
1091
|
+
Data: {
|
|
1092
|
+
Entity: "AccountsView",
|
|
1093
|
+
ResourceFile: "/workspace/Sol/resources/solution_folder/entity/federated/AccountsView.json",
|
|
1094
|
+
Created: "entity",
|
|
1095
|
+
Federated: true,
|
|
1096
|
+
Fields: ["name"]
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
Description: "Create a federated entity over a connector object, here a Salesforce 'Account'. 'connectionName' names a Connection resource of the solution (add it with 'uip solution resources add --source remote --kind Connection --name Salesforce'); the object's fields are read from that connection, so this needs 'uip login'.",
|
|
1102
|
+
Command: `uip df entities create SalesforceAccounts --local --body '{"externalFields":[{"connectionName":"Salesforce","object":"Account","fields":["Name","Industry","AnnualRevenue"]}]}'`,
|
|
1103
|
+
Output: {
|
|
1104
|
+
Code: "InlineEntityCreated",
|
|
1105
|
+
Data: {
|
|
1106
|
+
Entity: "SalesforceAccounts",
|
|
1107
|
+
ResourceFile: "/workspace/Sol/resources/solution_folder/entity/federated/SalesforceAccounts.json",
|
|
1108
|
+
Created: "entity",
|
|
1109
|
+
Federated: true,
|
|
1110
|
+
Fields: ["Name", "Industry", "AnnualRevenue"]
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
859
1113
|
}
|
|
860
1114
|
];
|
|
861
1115
|
var LOCAL_LIST_EXAMPLES = [
|
|
@@ -913,6 +1167,18 @@ var LOCAL_UPDATE_EXAMPLES = [
|
|
|
913
1167
|
Fields: ["OrderNumber", "Amount"]
|
|
914
1168
|
}
|
|
915
1169
|
}
|
|
1170
|
+
},
|
|
1171
|
+
{
|
|
1172
|
+
Description: "Add a multiple-choice field and a relationship to an entity authored on disk. 'choiceSetName' and 'referenceEntityName' name resources in the solution; a target that is missing, or a relationship that would close a cycle, is refused and nothing is written.",
|
|
1173
|
+
Command: `uip df entities update SalesOrder --local --body '{"addFields":[{"name":"channels","type":"CHOICE_SET_MULTIPLE","choiceSetName":"SalesChannel"},{"name":"billTo","type":"RELATIONSHIP","referenceEntityName":"Customer"}]}'`,
|
|
1174
|
+
Output: {
|
|
1175
|
+
Code: "InlineEntityUpdated",
|
|
1176
|
+
Data: {
|
|
1177
|
+
Project: "Sales",
|
|
1178
|
+
Entity: "SalesOrder",
|
|
1179
|
+
Fields: ["status", "customer", "parent", "channels", "billTo"]
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
916
1182
|
}
|
|
917
1183
|
];
|
|
918
1184
|
var LOCAL_DELETE_EXAMPLES = [
|
|
@@ -1096,7 +1362,22 @@ function combineValidationIssues(issues) {
|
|
|
1096
1362
|
`)
|
|
1097
1363
|
};
|
|
1098
1364
|
}
|
|
1099
|
-
|
|
1365
|
+
var LOCAL_ONLY_FIELD_KEYS = LOCAL_REFERENCE_KEY_NAMES;
|
|
1366
|
+
function findLocalOnlyFieldKeys(fields) {
|
|
1367
|
+
for (const field of Array.isArray(fields) ? fields : []) {
|
|
1368
|
+
if (typeof field !== "object" || field === null)
|
|
1369
|
+
continue;
|
|
1370
|
+
const present = LOCAL_ONLY_FIELD_KEYS.filter((key) => field[key] !== undefined);
|
|
1371
|
+
if (present.length > 0) {
|
|
1372
|
+
return {
|
|
1373
|
+
message: `${present.map((key) => `'${key}'`).join(", ")} ${present.length === 1 ? "requires" : "require"} --local`,
|
|
1374
|
+
instructions: "These name a reference target in the solution on disk. On the tenant, pass 'referenceEntityId' + 'referenceFieldId' (RELATIONSHIP) or 'choiceSetId' (CHOICE_SET_*), or add --local to author the entity in the solution."
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
return null;
|
|
1379
|
+
}
|
|
1380
|
+
function rejectMisplacedLocalOptions2(options, tenantOnly, localOnly = []) {
|
|
1100
1381
|
const flag = (name) => `--${name.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}`;
|
|
1101
1382
|
if (options.local === true) {
|
|
1102
1383
|
const offenders = tenantOnly.filter((name) => options[name] !== undefined && options[name] !== false);
|
|
@@ -1117,7 +1398,7 @@ function rejectMisplacedLocalOptions(options, tenantOnly, localOnly = []) {
|
|
|
1117
1398
|
}
|
|
1118
1399
|
return false;
|
|
1119
1400
|
}
|
|
1120
|
-
async function
|
|
1401
|
+
async function loadLocalHandlersAsync2() {
|
|
1121
1402
|
const {
|
|
1122
1403
|
LOCAL_AUTHORING_AVAILABLE,
|
|
1123
1404
|
runLocalCreate,
|
|
@@ -1126,7 +1407,7 @@ async function loadLocalHandlersAsync() {
|
|
|
1126
1407
|
runLocalList,
|
|
1127
1408
|
runLocalUpdate,
|
|
1128
1409
|
runLocalValidate
|
|
1129
|
-
} = await import("./entities-inline-
|
|
1410
|
+
} = await import("./entities-inline-0gpc75xj.js");
|
|
1130
1411
|
if (LOCAL_AUTHORING_AVAILABLE !== true) {
|
|
1131
1412
|
failInvalidArgument("--local is not available in this environment", "Local authoring reads and writes the solution on disk, which this build cannot reach. Run the command with the uip CLI on a machine that has the solution checked out.");
|
|
1132
1413
|
return;
|
|
@@ -1146,13 +1427,13 @@ var registerEntitiesCommand = (program) => {
|
|
|
1146
1427
|
if (!options.local) {
|
|
1147
1428
|
return failInvalidArgument("'entities validate' requires --local", "Tenant entities are validated by the server on write. This checks entities authored in a solution on disk.");
|
|
1148
1429
|
}
|
|
1149
|
-
const local = await
|
|
1430
|
+
const local = await loadLocalHandlersAsync2();
|
|
1150
1431
|
if (local === undefined)
|
|
1151
1432
|
return;
|
|
1152
1433
|
return local.runLocalValidate(name, options);
|
|
1153
1434
|
});
|
|
1154
1435
|
entities.command("list").description("List all Data Fabric entities").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--native-only", "Show only native entities (exclude federated entities with external connections)").option("--federated-only", "Show only federated entities (those backed by external connections). Mutually exclusive with --native-only; omit both to list all.").option("--folder-key <key>", "Folder key (GUID) to scope the listing to a specific folder").option("--include-folders", "List tenant-level entities together with entities from every folder you can see. Mutually exclusive with --folder-key.").option("--local", "Act on entities authored in the local solution instead of the tenant. No login required; nothing exists on a tenant until the solution deploys.").option("--project-name <name>", "With --local: list only this Entity project. Omitted, every Entity project in the solution is listed.").examples([...ENTITIES_LIST_EXAMPLES, ...LOCAL_LIST_EXAMPLES]).trackedAction(processContext, async (options) => {
|
|
1155
|
-
if (
|
|
1436
|
+
if (rejectMisplacedLocalOptions2(options, [
|
|
1156
1437
|
"folderKey",
|
|
1157
1438
|
"includeFolders",
|
|
1158
1439
|
"nativeOnly",
|
|
@@ -1162,7 +1443,7 @@ var registerEntitiesCommand = (program) => {
|
|
|
1162
1443
|
return;
|
|
1163
1444
|
}
|
|
1164
1445
|
if (options.local) {
|
|
1165
|
-
const local = await
|
|
1446
|
+
const local = await loadLocalHandlersAsync2();
|
|
1166
1447
|
if (local === undefined)
|
|
1167
1448
|
return;
|
|
1168
1449
|
return local.runLocalList(options);
|
|
@@ -1173,7 +1454,7 @@ var registerEntitiesCommand = (program) => {
|
|
|
1173
1454
|
if (options.nativeOnly === true && options.federatedOnly === true) {
|
|
1174
1455
|
return fail("--native-only and --federated-only are mutually exclusive", "Pass one to filter by class, or omit both to list all entities.");
|
|
1175
1456
|
}
|
|
1176
|
-
const sdk = await
|
|
1457
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
1177
1458
|
if (!sdk)
|
|
1178
1459
|
return;
|
|
1179
1460
|
const listOpts = {
|
|
@@ -1203,19 +1484,19 @@ var registerEntitiesCommand = (program) => {
|
|
|
1203
1484
|
});
|
|
1204
1485
|
});
|
|
1205
1486
|
entities.command("get").description("Get schema details of a Data Fabric entity").argument("<id>", "Entity ID on the tenant; with --local, the entity name").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--folder-key <key>", "Folder key (GUID) of the folder containing the entity (for folder-scoped entities)").option("--local", "Act on entities authored in the local solution instead of the tenant. No login required; nothing exists on a tenant until the solution deploys.").option("--project-name <name>", "With --local: the Entity project that owns the entity. Optional — omitted, the owner is found by name, since entity names are solution-wide unique.").examples([...ENTITIES_GET_EXAMPLES, ...LOCAL_GET_EXAMPLES]).trackedAction(processContext, async (id, options) => {
|
|
1206
|
-
if (
|
|
1487
|
+
if (rejectMisplacedLocalOptions2(options, [
|
|
1207
1488
|
"folderKey",
|
|
1208
1489
|
"tenant"
|
|
1209
1490
|
])) {
|
|
1210
1491
|
return;
|
|
1211
1492
|
}
|
|
1212
1493
|
if (options.local) {
|
|
1213
|
-
const local = await
|
|
1494
|
+
const local = await loadLocalHandlersAsync2();
|
|
1214
1495
|
if (local === undefined)
|
|
1215
1496
|
return;
|
|
1216
1497
|
return local.runLocalGet(id, options);
|
|
1217
1498
|
}
|
|
1218
|
-
const sdk = await
|
|
1499
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
1219
1500
|
if (!sdk)
|
|
1220
1501
|
return;
|
|
1221
1502
|
const [getError, entity] = await catchError(sdk.entities.getById(id, options.folderKey !== undefined ? { folderKey: options.folderKey } : undefined));
|
|
@@ -1232,15 +1513,15 @@ var registerEntitiesCommand = (program) => {
|
|
|
1232
1513
|
Data: e
|
|
1233
1514
|
});
|
|
1234
1515
|
});
|
|
1235
|
-
entities.command("create").description("Create a new Data Fabric entity").argument("<name>", "Entity name (must start with a letter; letters, numbers, and underscores only)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-f, --file <path>", `Path to JSON file with entity definition. Native entity: 'fields' array required. Federated entity: an 'externalFields' array where each source is either 'connectionId' + 'object' + 'fields' (a connector source) or 'entityId' + 'fields' (a native, entity-backed source). The primary source is derived from the joins (the source every join starts from). 'fields' entries are external field names, or objects to override a column: '{"source","name","type","direction","searchable","sortable"}' (only 'source' is required). Optional 'joins': '{"source","relatedSource","sourceField","relatedField","sourceConnectionId","relatedConnectionId"}' — 'sourceConnectionId'/'relatedConnectionId' are required on every join and identify each side (a connector 'connectionId', or the 'entityId' for a native source), since two sources can share an object name on different connections. Every join's 'source' must be the primary, every other source must be joined directly to it, one field pair per source pair. Optional: displayName, description, isRbacEnabled, isAnalyticsEnabled.`).option("--body <json>", "Inline JSON entity definition. A field object copied from 'df entities get' is also accepted and normalized to the write shape.").option("--folder-key <key>", "Folder key (GUID) of the target folder (for folder-scoped entities)").option("--local", "Act on entities authored in the local solution instead of the tenant. No login required; nothing exists on a tenant until the solution deploys.").option("--project-name <name>", "With --local: the Entity project to create the entity in, scaffolded and registered if it does not exist. Optional — omitted, the project is named after the entity.").examples([...ENTITIES_CREATE_EXAMPLES, ...LOCAL_CREATE_EXAMPLES]).trackedAction(processContext, async (name, options) => {
|
|
1236
|
-
if (
|
|
1516
|
+
entities.command("create").description("Create a new Data Fabric entity").argument("<name>", "Entity name (must start with a letter; letters, numbers, and underscores only)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-f, --file <path>", `Path to JSON file with entity definition. Native entity: 'fields' array required. Federated entity: an 'externalFields' array where each source is either 'connectionId' + 'object' + 'fields' (a connector source) or 'entityId' + 'fields' (a native, entity-backed source). The primary source is derived from the joins (the source every join starts from). 'fields' entries are external field names, or objects to override a column: '{"source","name","type","direction","searchable","sortable"}' (only 'source' is required). Optional 'joins': '{"source","relatedSource","sourceField","relatedField","sourceConnectionId","relatedConnectionId"}' — 'sourceConnectionId'/'relatedConnectionId' are required on every join and identify each side (a connector 'connectionId', or the 'entityId' for a native source), since two sources can share an object name on different connections. Every join's 'source' must be the primary, every other source must be joined directly to it, one field pair per source pair. Optional: displayName, description, isRbacEnabled, isAnalyticsEnabled.`).option("--body <json>", "Inline JSON entity definition. A field object copied from 'df entities get' is also accepted and normalized to the write shape.").option("--folder-key <key>", "Folder key (GUID) of the target folder (for folder-scoped entities)").option("--local", "Act on entities authored in the local solution instead of the tenant. No login required, except for a federated entity with a connector source, whose fields are read from the connection; nothing exists on a tenant until the solution deploys.").option("--project-name <name>", "With --local: the Entity project to create the entity in, scaffolded and registered if it does not exist. Optional — omitted, the project is named after the entity.").examples([...ENTITIES_CREATE_EXAMPLES, ...LOCAL_CREATE_EXAMPLES]).trackedAction(processContext, async (name, options) => {
|
|
1517
|
+
if (rejectMisplacedLocalOptions2(options, [
|
|
1237
1518
|
"folderKey",
|
|
1238
1519
|
"tenant"
|
|
1239
1520
|
])) {
|
|
1240
1521
|
return;
|
|
1241
1522
|
}
|
|
1242
1523
|
if (options.local) {
|
|
1243
|
-
const local = await
|
|
1524
|
+
const local = await loadLocalHandlersAsync2();
|
|
1244
1525
|
if (local === undefined)
|
|
1245
1526
|
return;
|
|
1246
1527
|
return local.runLocalCreate(name, options);
|
|
@@ -1275,13 +1556,14 @@ var registerEntitiesCommand = (program) => {
|
|
|
1275
1556
|
return fail("Invalid field type in fields", `Valid types: ${VALID_FIELD_TYPES_LIST}`);
|
|
1276
1557
|
}
|
|
1277
1558
|
const err = runChecks([
|
|
1559
|
+
() => findLocalOnlyFieldKeys(definition.fields),
|
|
1278
1560
|
() => validateName(name, "entity"),
|
|
1279
1561
|
() => validateSchemaMetadata(definition, "Entity"),
|
|
1280
1562
|
() => validateFieldsPayload(nativeFields, name, true)
|
|
1281
1563
|
]);
|
|
1282
1564
|
if (err)
|
|
1283
1565
|
return fail(err.message, err.instructions);
|
|
1284
|
-
const sdk = await
|
|
1566
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
1285
1567
|
if (!sdk)
|
|
1286
1568
|
return;
|
|
1287
1569
|
if (isFederated) {
|
|
@@ -1289,7 +1571,7 @@ var registerEntitiesCommand = (program) => {
|
|
|
1289
1571
|
createFederatedMetadataProvider,
|
|
1290
1572
|
expandFederatedCreate,
|
|
1291
1573
|
validateFederatedTopology
|
|
1292
|
-
} = await import("./federated-payload-
|
|
1574
|
+
} = await import("./federated-payload-4mb89pe9.js");
|
|
1293
1575
|
try {
|
|
1294
1576
|
validateFederatedTopology(definition.externalFields, definition.joins ?? []);
|
|
1295
1577
|
} catch (err) {
|
|
@@ -1343,7 +1625,7 @@ var registerEntitiesCommand = (program) => {
|
|
|
1343
1625
|
});
|
|
1344
1626
|
});
|
|
1345
1627
|
entities.command("update").description("Update schema or metadata of a Data Fabric entity").argument("<id>", "Entity ID on the tenant; with --local, the entity name").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-f, --file <path>", "Path to JSON file with update options. Field shapes: addFields [{name,type,...}], updateFields [{id,...}], removeFields [{name}]. Do not paste a full copied field object into updateFields; pass id plus only changed flat properties. Also accepts the entity metadata keys displayName, description and isRbacEnabled. Federated source/join deltas — every reference to an existing source needs both 'sourceObjectName' and 'sourceConnectionId' (a connector connectionId, or the entityId for a native source), since two sources can share an object name on different connections: 'addExternalSources' [{connectionId,object,fields}] or [{entityId,fields}] (same source shape as create); 'joins' [{source,relatedSource,sourceField,relatedField,sourceConnectionId,relatedConnectionId}] to connect an added source to the primary (all names + connection ids required); 'addExternalFields' [{sourceObjectName,sourceConnectionId,fields}] (fields as in create); 'removeExternalSources' [{sourceObjectName,sourceConnectionId},...]; 'removeExternalFields' [{sourceObjectName,sourceConnectionId,fieldNames}] (fieldNames are the entity's column names, not the external field names); 'updateSourceJoin' [{sourceObjectName,sourceConnectionId,relatedSourceObjectName,relatedSourceConnectionId,sourceJoinField,relatedSourceJoinField}] changes only the join fields of an existing join (not its sources, direction or type); 'replaceJoins' [same shape as 'joins'] is the complete new join set and is how you change the primary source (every join starts from the new primary, every other source is joined once; cannot be combined with 'joins' or 'updateSourceJoin'); 'updateExternalConnection' [{sourceObjectName,sourceConnectionId,newConnectionId}] swaps a connector source's connection (same connector only, connection must be enabled and expose the object; keeps its fields and joins; a mapped field the new connection lacks is dropped with a warning, along with any join that uses it, and needs --yes --reason). A join cannot be removed on its own: every source but the primary stays joined. Removing a source also removes its joins, and so does removing a join field, so pass 'replaceJoins' when that leaves a source unjoined. A source must keep at least one field. remove* and replaceJoins require --yes --reason.").option("--body <json>", "Inline JSON update options (use `-` to read from stdin). Field shapes: addFields [{name,type,...}], updateFields [{id,...}], removeFields [{name}]. Do not paste a full copied field object into updateFields; pass id plus only changed flat properties. Also accepts the entity metadata keys displayName, description and isRbacEnabled. Federated source/join deltas — every reference to an existing source needs both 'sourceObjectName' and 'sourceConnectionId' (a connector connectionId, or the entityId for a native source), since two sources can share an object name on different connections: 'addExternalSources' [{connectionId,object,fields}] or [{entityId,fields}] (same source shape as create); 'joins' [{source,relatedSource,sourceField,relatedField,sourceConnectionId,relatedConnectionId}] to connect an added source to the primary (all names + connection ids required); 'addExternalFields' [{sourceObjectName,sourceConnectionId,fields}] (fields as in create); 'removeExternalSources' [{sourceObjectName,sourceConnectionId},...]; 'removeExternalFields' [{sourceObjectName,sourceConnectionId,fieldNames}] (fieldNames are the entity's column names, not the external field names); 'updateSourceJoin' [{sourceObjectName,sourceConnectionId,relatedSourceObjectName,relatedSourceConnectionId,sourceJoinField,relatedSourceJoinField}] changes only the join fields of an existing join (not its sources, direction or type); 'replaceJoins' [same shape as 'joins'] is the complete new join set and is how you change the primary source (every join starts from the new primary, every other source is joined once; cannot be combined with 'joins' or 'updateSourceJoin'); 'updateExternalConnection' [{sourceObjectName,sourceConnectionId,newConnectionId}] swaps a connector source's connection (same connector only, connection must be enabled and expose the object; keeps its fields and joins; a mapped field the new connection lacks is dropped with a warning, along with any join that uses it, and needs --yes --reason). A join cannot be removed on its own: every source but the primary stays joined. Removing a source also removes its joins, and so does removing a join field, so pass 'replaceJoins' when that leaves a source unjoined. A source must keep at least one field. remove* and replaceJoins require --yes --reason.").option("-y, --yes", "Required when 'removeFields' is non-empty — acknowledges the field deletion is irreversible").addOption(new Option("--confirm", "Deprecated alias for --yes").hideHelp()).option("--reason <reason>", "Required when 'removeFields' is non-empty — echoed back in the response so the caller can log it").option("--folder-key <key>", "Folder key (GUID) of the folder containing the entity (for folder-scoped entities)").option("--local", "Act on entities authored in the local solution instead of the tenant. No login required; nothing exists on a tenant until the solution deploys.").option("--project-name <name>", "With --local: the Entity project that owns the entity. Optional — omitted, the owner is found by name, since entity names are solution-wide unique.").examples([...ENTITIES_UPDATE_EXAMPLES, ...LOCAL_UPDATE_EXAMPLES]).trackedAction(processContext, async (id, options) => {
|
|
1346
|
-
if (
|
|
1628
|
+
if (rejectMisplacedLocalOptions2(options, [
|
|
1347
1629
|
"folderKey",
|
|
1348
1630
|
"reason",
|
|
1349
1631
|
"tenant"
|
|
@@ -1351,7 +1633,7 @@ var registerEntitiesCommand = (program) => {
|
|
|
1351
1633
|
return;
|
|
1352
1634
|
}
|
|
1353
1635
|
if (options.local) {
|
|
1354
|
-
const local = await
|
|
1636
|
+
const local = await loadLocalHandlersAsync2();
|
|
1355
1637
|
if (local === undefined)
|
|
1356
1638
|
return;
|
|
1357
1639
|
return local.runLocalUpdate(id, options);
|
|
@@ -1390,6 +1672,11 @@ var registerEntitiesCommand = (program) => {
|
|
|
1390
1672
|
const metadataErr = validateSchemaMetadata(input, "Entity");
|
|
1391
1673
|
if (metadataErr)
|
|
1392
1674
|
validationIssues.push(metadataErr);
|
|
1675
|
+
for (const key of ["addFields", "updateFields"]) {
|
|
1676
|
+
const localOnly = findLocalOnlyFieldKeys(input[key]);
|
|
1677
|
+
if (localOnly)
|
|
1678
|
+
validationIssues.push(localOnly);
|
|
1679
|
+
}
|
|
1393
1680
|
const addFields = getUpdateArray(input, "addFields", ADD_FIELDS_ARRAY_INSTRUCTIONS, validationIssues);
|
|
1394
1681
|
const updateFields = getUpdateArray(input, "updateFields", UPDATE_FIELDS_ARRAY_INSTRUCTIONS, validationIssues);
|
|
1395
1682
|
const removeFields = getUpdateArray(input, "removeFields", REMOVE_FIELDS_ARRAY_INSTRUCTIONS, validationIssues);
|
|
@@ -1478,7 +1765,7 @@ var registerEntitiesCommand = (program) => {
|
|
|
1478
1765
|
return;
|
|
1479
1766
|
trimmedReason = reason;
|
|
1480
1767
|
}
|
|
1481
|
-
const sdk = await
|
|
1768
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
1482
1769
|
if (!sdk)
|
|
1483
1770
|
return;
|
|
1484
1771
|
const warnings = [];
|
|
@@ -1490,7 +1777,7 @@ var registerEntitiesCommand = (program) => {
|
|
|
1490
1777
|
existingSources,
|
|
1491
1778
|
expandFederatedUpdate,
|
|
1492
1779
|
sourceKey
|
|
1493
|
-
} = await import("./federated-payload-
|
|
1780
|
+
} = await import("./federated-payload-4mb89pe9.js");
|
|
1494
1781
|
const [entityErr, entity] = await catchError(sdk.entities.getById(id, options.folderKey ? { folderKey: options.folderKey } : undefined));
|
|
1495
1782
|
if (entityErr || !entity) {
|
|
1496
1783
|
return fail(`Could not read entity '${id}' to build the federated update`, "Check the entity id exists and you have access — 'df entities get <id>' (add --folder-key for a folder-scoped entity). If it exists, the service may be briefly unavailable; retry.");
|
|
@@ -1573,12 +1860,12 @@ var registerEntitiesCommand = (program) => {
|
|
|
1573
1860
|
}
|
|
1574
1861
|
});
|
|
1575
1862
|
});
|
|
1576
|
-
entities.command("delete").description("Delete a Data Fabric entity (irreversible)").argument("<id>", "Entity ID on the tenant; with --local, the entity name").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-y, --yes", "
|
|
1577
|
-
if (
|
|
1863
|
+
entities.command("delete").description("Delete a Data Fabric entity (irreversible)").argument("<id>", "Entity ID on the tenant; with --local, the entity name").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-y, --yes", "Required. Confirm this irreversible operation; the CLI never prompts").addOption(new Option("--confirm", "Deprecated alias for --yes").hideHelp()).option("--reason <reason>", "Required for tenant deletion. Explain why the entity is being deleted; the response echoes it for logging. Do not use with --local").option("--folder-key <key>", "Folder key (GUID) of the folder containing the entity (for folder-scoped entities)").option("--local", "Act on entities authored in the local solution instead of the tenant. No login required; nothing exists on a tenant until the solution deploys.").option("--project-name <name>", "With --local: the Entity project that owns the entity. Optional — omitted, the owner is found by name; with --force and no owner at all, an orphaned definition resource is cleaned up.").option("--force", "With --local: delete a stub/resource pair that does not verify — anything 'entities list --local' reports with a Problem — or a definition resource no project declares any more (no --project-name needed for that). Every check runs before anything is removed: a resource another project still declares, or one describing a referenced platform entity, is refused and nothing changes.").examples([...ENTITIES_DELETE_EXAMPLES, ...LOCAL_DELETE_EXAMPLES]).trackedAction(processContext, async (id, options) => {
|
|
1864
|
+
if (rejectMisplacedLocalOptions2(options, ["folderKey", "reason", "tenant"], ["force"])) {
|
|
1578
1865
|
return;
|
|
1579
1866
|
}
|
|
1580
1867
|
if (options.local) {
|
|
1581
|
-
const local = await
|
|
1868
|
+
const local = await loadLocalHandlersAsync2();
|
|
1582
1869
|
if (local === undefined)
|
|
1583
1870
|
return;
|
|
1584
1871
|
return local.runLocalDelete(id, options);
|
|
@@ -1586,7 +1873,7 @@ var registerEntitiesCommand = (program) => {
|
|
|
1586
1873
|
const reason = requireDestructiveConfirmation(options, `delete entity '${id}'`, 'Pass --reason "<text>" to record why the entity is being deleted.');
|
|
1587
1874
|
if (reason === null)
|
|
1588
1875
|
return;
|
|
1589
|
-
const sdk = await
|
|
1876
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
1590
1877
|
if (!sdk)
|
|
1591
1878
|
return;
|
|
1592
1879
|
const entityService = sdk.entities;
|
|
@@ -1653,7 +1940,7 @@ var registerFilesCommand = (program) => {
|
|
|
1653
1940
|
if (!options.file) {
|
|
1654
1941
|
return fail("A file path is required", "Provide a file path via --file.");
|
|
1655
1942
|
}
|
|
1656
|
-
const sdk = await
|
|
1943
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
1657
1944
|
if (!sdk)
|
|
1658
1945
|
return;
|
|
1659
1946
|
const [readError, fileContent] = await catchError(readFileBinary(options.file));
|
|
@@ -1678,7 +1965,7 @@ var registerFilesCommand = (program) => {
|
|
|
1678
1965
|
});
|
|
1679
1966
|
});
|
|
1680
1967
|
files.command("download").description("Download a file from a field on an entity record").argument("<entity-id>", "Entity ID").argument("<record-id>", "Record ID").argument("<field-name>", "Name of the file field (case-sensitive)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--destination <path>", "Output file path (defaults to <record-id>_<field-name>.bin)").option("--folder-key <key>", "Folder key (GUID) of the folder containing the entity (for folder-scoped entities)").examples(FILES_DOWNLOAD_EXAMPLES).trackedAction(processContext, async (entityId, recordId, fieldName, options) => {
|
|
1681
|
-
const sdk = await
|
|
1968
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
1682
1969
|
if (!sdk)
|
|
1683
1970
|
return;
|
|
1684
1971
|
const [downloadError, blob] = await catchError(sdk.entities.downloadAttachment({ id: entityId }, recordId, fieldName, options.folderKey !== undefined ? { folderKey: options.folderKey } : undefined));
|
|
@@ -1705,11 +1992,11 @@ var registerFilesCommand = (program) => {
|
|
|
1705
1992
|
}
|
|
1706
1993
|
});
|
|
1707
1994
|
});
|
|
1708
|
-
files.command("delete").description("Delete a file from a field on an entity record").argument("<entity-id>", "Entity ID").argument("<record-id>", "Record ID").argument("<field-name>", "Name of the file field (case-sensitive)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-y, --yes", "
|
|
1995
|
+
files.command("delete").description("Delete a file from a field on an entity record").argument("<entity-id>", "Entity ID").argument("<record-id>", "Record ID").argument("<field-name>", "Name of the file field (case-sensitive)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-y, --yes", "Required. Confirm this irreversible operation; the CLI never prompts").addOption(new Option("--confirm", "Deprecated alias for --yes").hideHelp()).option("--reason <reason>", "Required. Reason for the deletion — echoed back in the response so the caller can log it").option("--folder-key <key>", "Folder key (GUID) of the folder containing the entity (for folder-scoped entities)").examples(FILES_DELETE_EXAMPLES).trackedAction(processContext, async (entityId, recordId, fieldName, options) => {
|
|
1709
1996
|
const reason = requireDestructiveConfirmation(options, `delete the file in field '${fieldName}'`, 'Pass --reason "<text>" to record why the file is being deleted.');
|
|
1710
1997
|
if (reason === null)
|
|
1711
1998
|
return;
|
|
1712
|
-
const sdk = await
|
|
1999
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
1713
2000
|
if (!sdk)
|
|
1714
2001
|
return;
|
|
1715
2002
|
const [deleteError] = await catchError(sdk.entities.deleteAttachment({ id: entityId }, recordId, fieldName, options.folderKey !== undefined ? { folderKey: options.folderKey } : undefined));
|
|
@@ -2012,7 +2299,7 @@ var registerRecordsCommand = (program) => {
|
|
|
2012
2299
|
}
|
|
2013
2300
|
jumpToPage = Math.floor(offsetValue / pageSize) + 1;
|
|
2014
2301
|
}
|
|
2015
|
-
const sdk = await
|
|
2302
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
2016
2303
|
if (!sdk)
|
|
2017
2304
|
return;
|
|
2018
2305
|
const listPaginationOptions = options.cursor !== undefined ? { pageSize, cursor: { value: options.cursor } } : jumpToPage !== undefined ? { pageSize, jumpToPage } : { pageSize };
|
|
@@ -2032,7 +2319,7 @@ var registerRecordsCommand = (program) => {
|
|
|
2032
2319
|
});
|
|
2033
2320
|
});
|
|
2034
2321
|
records.command("get").description("Get a single record by ID").argument("<id>", "Entity ID").argument("<key>", "Record ID").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--folder-key <key>", "Folder key (GUID) of the folder containing the entity (for folder-scoped entities)").examples(RECORDS_GET_EXAMPLES).trackedAction(processContext, async (entityId, recordId, options) => {
|
|
2035
|
-
const sdk = await
|
|
2322
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
2036
2323
|
if (!sdk)
|
|
2037
2324
|
return;
|
|
2038
2325
|
const [getError, record] = await catchError(sdk.entities.getRecordById(entityId, recordId, options.folderKey !== undefined ? { folderKey: options.folderKey } : undefined));
|
|
@@ -2053,7 +2340,7 @@ var registerRecordsCommand = (program) => {
|
|
|
2053
2340
|
if (parseError) {
|
|
2054
2341
|
return fail("Error parsing input data", parseError.message);
|
|
2055
2342
|
}
|
|
2056
|
-
const sdk = await
|
|
2343
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
2057
2344
|
if (!sdk)
|
|
2058
2345
|
return;
|
|
2059
2346
|
const data = rawData;
|
|
@@ -2100,7 +2387,7 @@ var registerRecordsCommand = (program) => {
|
|
|
2100
2387
|
if (parseError) {
|
|
2101
2388
|
return fail("Error parsing input data", parseError.message);
|
|
2102
2389
|
}
|
|
2103
|
-
const sdk = await
|
|
2390
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
2104
2391
|
if (!sdk)
|
|
2105
2392
|
return;
|
|
2106
2393
|
const data = rawData;
|
|
@@ -2184,7 +2471,7 @@ var registerRecordsCommand = (program) => {
|
|
|
2184
2471
|
if (aggregateErr)
|
|
2185
2472
|
return fail(aggregateErr.message, aggregateErr.instructions);
|
|
2186
2473
|
}
|
|
2187
|
-
const sdk = await
|
|
2474
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
2188
2475
|
if (!sdk)
|
|
2189
2476
|
return;
|
|
2190
2477
|
const queryPaginationOptions = options.cursor !== undefined ? { pageSize, cursor: { value: options.cursor } } : jumpToPage !== undefined ? { pageSize, jumpToPage } : { pageSize };
|
|
@@ -2216,7 +2503,7 @@ var registerRecordsCommand = (program) => {
|
|
|
2216
2503
|
if (refusal !== undefined) {
|
|
2217
2504
|
return failInvalidArgument(refusal, `Remove line breaks and doubled quotes ("") from quoted cells and close every quote, then import again. To keep those values, insert the rows with 'uip df records insert ${entityId} --file <records.json>', which stores them exactly.`);
|
|
2218
2505
|
}
|
|
2219
|
-
const sdk = await
|
|
2506
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
2220
2507
|
if (!sdk)
|
|
2221
2508
|
return;
|
|
2222
2509
|
const fs = getFileSystem();
|
|
@@ -2241,11 +2528,11 @@ var registerRecordsCommand = (program) => {
|
|
|
2241
2528
|
}
|
|
2242
2529
|
});
|
|
2243
2530
|
});
|
|
2244
|
-
records.command("delete").description("Delete records from a Data Fabric entity").argument("<id>", "Entity ID").argument("<key...>", "Record IDs to delete").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-y, --yes", "
|
|
2531
|
+
records.command("delete").description("Delete records from a Data Fabric entity").argument("<id>", "Entity ID").argument("<key...>", "Record IDs to delete").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-y, --yes", "Required. Confirm this irreversible operation; the CLI never prompts").addOption(new Option("--confirm", "Deprecated alias for --yes").hideHelp()).option("--reason <reason>", "Required for deletion. Explain why the records are being deleted; the response echoes it for logging").option("--folder-key <key>", "Folder key (GUID) of the folder containing the entity (for folder-scoped entities)").examples(RECORDS_DELETE_EXAMPLES).trackedAction(processContext, async (entityId, recordIds, options) => {
|
|
2245
2532
|
const reason = requireDestructiveConfirmation(options, `delete ${recordIds.length} record(s) from entity '${entityId}'`, 'Pass --reason "<text>" to record why the records are being deleted.');
|
|
2246
2533
|
if (reason === null)
|
|
2247
2534
|
return;
|
|
2248
|
-
const sdk = await
|
|
2535
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
2249
2536
|
if (!sdk)
|
|
2250
2537
|
return;
|
|
2251
2538
|
const [deleteError, result] = await catchError(sdk.entities.deleteRecords({ id: entityId }, recordIds, options.folderKey !== undefined ? { folderKey: options.folderKey } : undefined));
|
|
@@ -2300,7 +2587,7 @@ var ROLES_LIST_EXAMPLES = [
|
|
|
2300
2587
|
var registerRolesCommand = (program) => {
|
|
2301
2588
|
const roles = program.command("roles", { hidden: true }).description("Manage Data Fabric access roles");
|
|
2302
2589
|
roles.command("list").description("List Data Fabric access roles").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--no-stats", "Skip role statistics (directory entity counts) in the response").option("--folder-key <key>", "Folder key (GUID) for folder-scoped role requests").examples(ROLES_LIST_EXAMPLES).trackedAction(processContext, async (options) => {
|
|
2303
|
-
const sdk = await
|
|
2590
|
+
const sdk = await connectOrFail2(options.tenant);
|
|
2304
2591
|
if (!sdk)
|
|
2305
2592
|
return;
|
|
2306
2593
|
const getAllOptions = {
|
|
@@ -2341,4 +2628,4 @@ var registerCommands2 = async (program) => {
|
|
|
2341
2628
|
|
|
2342
2629
|
export { metadata2, registerCommands2 };
|
|
2343
2630
|
|
|
2344
|
-
//# debugId=
|
|
2631
|
+
//# debugId=6F38A33839F0825064756E2164756E21
|