dataiku-sdk 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/build-metadata.json +1 -1
- package/dist/src/cli/command-syntax.json +14524 -0
- package/dist/src/cli/commands/analysis.js +6 -9
- package/dist/src/cli/commands/api-deployer.js +15 -33
- package/dist/src/cli/commands/api-service.js +17 -27
- package/dist/src/cli/commands/app.js +22 -39
- package/dist/src/cli/commands/bundle.js +15 -24
- package/dist/src/cli/commands/business-app.js +10 -17
- package/dist/src/cli/commands/code-env.js +23 -36
- package/dist/src/cli/commands/code.js +4 -4
- package/dist/src/cli/commands/connection.js +12 -22
- package/dist/src/cli/commands/continuous-activity.js +6 -9
- package/dist/src/cli/commands/dashboard.js +8 -13
- package/dist/src/cli/commands/data-collection.js +9 -16
- package/dist/src/cli/commands/data-quality.js +14 -26
- package/dist/src/cli/commands/dataset.js +27 -50
- package/dist/src/cli/commands/discussion.js +7 -10
- package/dist/src/cli/commands/doctor.js +3 -3
- package/dist/src/cli/commands/flow-zone.js +8 -17
- package/dist/src/cli/commands/folder.js +12 -20
- package/dist/src/cli/commands/future.js +7 -10
- package/dist/src/cli/commands/group.js +7 -11
- package/dist/src/cli/commands/insight.js +7 -11
- package/dist/src/cli/commands/job.js +13 -23
- package/dist/src/cli/commands/knowledge-bank.js +5 -6
- package/dist/src/cli/commands/llm.js +5 -8
- package/dist/src/cli/commands/macro.js +9 -16
- package/dist/src/cli/commands/meaning.js +7 -11
- package/dist/src/cli/commands/metrics.js +7 -10
- package/dist/src/cli/commands/ml-task.js +12 -20
- package/dist/src/cli/commands/model-evaluation-store.js +7 -11
- package/dist/src/cli/commands/notebook.js +15 -27
- package/dist/src/cli/commands/plugin.js +35 -68
- package/dist/src/cli/commands/project-deployer.js +10 -22
- package/dist/src/cli/commands/project-folder.js +10 -17
- package/dist/src/cli/commands/project-git.js +38 -70
- package/dist/src/cli/commands/project-library.js +15 -23
- package/dist/src/cli/commands/project.js +9 -26
- package/dist/src/cli/commands/recipe.d.ts +16 -0
- package/dist/src/cli/commands/recipe.js +83 -94
- package/dist/src/cli/commands/saved-model.js +23 -39
- package/dist/src/cli/commands/scenario.js +20 -34
- package/dist/src/cli/commands/sql.js +4 -4
- package/dist/src/cli/commands/statistics.js +11 -18
- package/dist/src/cli/commands/streaming-endpoint.js +7 -11
- package/dist/src/cli/commands/user.js +11 -22
- package/dist/src/cli/commands/variable.js +3 -4
- package/dist/src/cli/commands/webapp.js +10 -16
- package/dist/src/cli/commands/wiki.js +9 -13
- package/dist/src/cli/commands/workspace.js +8 -14
- package/dist/src/cli/contract.d.ts +5 -15
- package/dist/src/cli/contract.js +156 -253
- package/dist/src/cli/doctor.js +1 -0
- package/dist/src/cli/env.d.ts +2 -0
- package/dist/src/cli/env.js +15 -1
- package/dist/src/cli/helpers/app-permissions.js +2 -1
- package/dist/src/cli/helpers/flow-zone.js +2 -1
- package/dist/src/cli/helpers/recipe.js +2 -1
- package/dist/src/cli/syntax.d.ts +83 -0
- package/dist/src/cli/syntax.js +217 -0
- package/dist/src/cli/types.d.ts +3 -0
- package/dist/src/cli/usage.d.ts +1 -1
- package/dist/src/cli/usage.js +4 -2
- package/dist/src/cli/version.js +2 -0
- package/dist/src/cli.js +37 -64
- package/dist/src/client.js +7 -6
- package/dist/src/errors.d.ts +12 -1
- package/dist/src/errors.js +28 -3
- package/dist/src/index.d.ts +1 -3
- package/dist/src/index.js +2 -2
- package/dist/src/resources/api-services.js +2 -3
- package/dist/src/resources/applications.js +2 -4
- package/dist/src/resources/code-envs.js +2 -2
- package/dist/src/resources/data-quality.js +4 -3
- package/dist/src/resources/datasets.d.ts +13 -0
- package/dist/src/resources/datasets.js +5 -4
- package/dist/src/resources/flow-zones.js +4 -2
- package/dist/src/resources/folders.js +4 -2
- package/dist/src/resources/futures.js +1 -3
- package/dist/src/resources/insights.js +3 -2
- package/dist/src/resources/jobs.js +4 -6
- package/dist/src/resources/macros.js +2 -4
- package/dist/src/resources/notebooks.js +2 -3
- package/dist/src/resources/project-git.js +9 -11
- package/dist/src/resources/project-library.d.ts +0 -2
- package/dist/src/resources/project-library.js +2 -7
- package/dist/src/resources/projects.js +4 -3
- package/dist/src/resources/recipes.d.ts +28 -0
- package/dist/src/resources/recipes.js +116 -84
- package/dist/src/resources/sql.js +8 -3
- package/dist/src/resources/statistics.js +2 -1
- package/dist/src/resources/variables.js +2 -1
- package/dist/src/resources/webapps.js +2 -3
- package/dist/src/schemas.d.ts +1 -2
- package/dist/src/schemas.js +1 -1
- package/dist/src/skill.js +6 -7
- package/dist/src/utils/cleanup-ledger.js +9 -8
- package/dist/src/utils/polling.d.ts +3 -0
- package/dist/src/utils/polling.js +3 -0
- package/dist/src/utils/project-archive.js +2 -2
- package/dist/src/utils/stable-hash.d.ts +3 -1
- package/dist/src/utils/stable-hash.js +2 -0
- package/package.json +4 -4
- package/plugin.json +1 -1
- package/skills/dataiku-dss/SKILL.md +2 -3
- package/skills/dataiku-dss/references/authentication.md +3 -3
- package/skills/dataiku-dss/references/coding.md +1 -1
- package/dist/src/utils/pagination.d.ts +0 -8
- package/dist/src/utils/pagination.js +0 -23
|
@@ -5,6 +5,7 @@ import { executionMode, } from "../flags.js";
|
|
|
5
5
|
import { datasetSourceSummary, } from "../helpers/dataset.js";
|
|
6
6
|
import { moveCreatedItemsToZone, resolveFlowZoneIdFromFlags, } from "../helpers/flow-zone.js";
|
|
7
7
|
import { enqueueCliWarning, readIfExists, skipResult, } from "../output.js";
|
|
8
|
+
import { commandUsage, withUsage, } from "../syntax.js";
|
|
8
9
|
import { requireArgs, UsageError, } from "../usage.js";
|
|
9
10
|
const MAX_SCHEMA_DIFFERENCES = 50;
|
|
10
11
|
function isPlainObject(value) {
|
|
@@ -97,82 +98,74 @@ export function compareDatasetSchemas(expected, actual) {
|
|
|
97
98
|
differencesTruncated: acc.items.length < acc.total,
|
|
98
99
|
};
|
|
99
100
|
}
|
|
100
|
-
export const datasetCommands = {
|
|
101
|
+
export const datasetCommands = withUsage("dataset", {
|
|
101
102
|
list: {
|
|
102
103
|
handler: (c, _a, f) => c.datasets.list(f["project-key"]),
|
|
103
|
-
usage: "dss dataset list [--project-key KEY]",
|
|
104
104
|
description: "List all datasets in a project.",
|
|
105
105
|
examples: ["dss dataset list", "dss dataset list --project-key MYPROJ",],
|
|
106
106
|
},
|
|
107
107
|
rename: {
|
|
108
108
|
handler: async (c, a, f) => {
|
|
109
|
-
requireArgs(a, 2, "
|
|
109
|
+
requireArgs(a, 2, commandUsage("dataset", "rename"));
|
|
110
110
|
await c.datasets.rename(a[0], a[1], f["project-key"]);
|
|
111
111
|
return { renamed: a[0], to: a[1], };
|
|
112
112
|
},
|
|
113
|
-
usage: "dss dataset rename <oldName> <newName> [--project-key KEY]",
|
|
114
113
|
description: "Rename a dataset (updates downstream flow references).",
|
|
115
114
|
examples: ["dss dataset rename old_ds new_ds",],
|
|
116
115
|
},
|
|
117
116
|
"list-partitions": {
|
|
118
117
|
handler: (c, a, f) => {
|
|
119
|
-
requireArgs(a, 1, "
|
|
118
|
+
requireArgs(a, 1, commandUsage("dataset", "list-partitions"));
|
|
120
119
|
return c.datasets.listPartitions(a[0], f["project-key"]);
|
|
121
120
|
},
|
|
122
|
-
usage: "dss dataset list-partitions <name> [--project-key KEY]",
|
|
123
121
|
description: "List the partitions of a partitioned dataset.",
|
|
124
122
|
examples: ["dss dataset list-partitions events",],
|
|
125
123
|
},
|
|
126
124
|
clear: {
|
|
127
125
|
handler: async (c, a, f) => {
|
|
128
|
-
requireArgs(a, 1, "
|
|
126
|
+
requireArgs(a, 1, commandUsage("dataset", "clear"));
|
|
129
127
|
const partitions = f["partitions"];
|
|
130
128
|
await c.datasets.clear(a[0], partitions, f["project-key"]);
|
|
131
129
|
return { cleared: a[0], partitions: partitions ?? "ALL", };
|
|
132
130
|
},
|
|
133
|
-
usage: "dss dataset clear <name> [--partitions SPEC] [--project-key KEY]",
|
|
134
131
|
description: "Clear a dataset's data (all, or a partition spec); keeps the dataset.",
|
|
135
132
|
examples: ["dss dataset clear staging", "dss dataset clear events --partitions 2024-01",],
|
|
136
133
|
},
|
|
137
134
|
get: {
|
|
138
135
|
handler: (c, a, f) => {
|
|
139
|
-
requireArgs(a, 1, "
|
|
136
|
+
requireArgs(a, 1, commandUsage("dataset", "get"));
|
|
140
137
|
return c.datasets.get(a[0], f["project-key"]);
|
|
141
138
|
},
|
|
142
|
-
usage: "dss dataset get <name> [--project-key KEY]",
|
|
143
139
|
description: "Get full settings for a dataset.",
|
|
144
140
|
examples: ["dss dataset get orders", "dss dataset get orders --project-key MYPROJ",],
|
|
145
141
|
},
|
|
146
142
|
schema: {
|
|
147
143
|
handler: (c, a, f) => {
|
|
148
|
-
requireArgs(a, 1, "
|
|
144
|
+
requireArgs(a, 1, commandUsage("dataset", "schema"));
|
|
149
145
|
return c.datasets.schema(a[0], f["project-key"]);
|
|
150
146
|
},
|
|
151
|
-
usage: "dss dataset schema <name> [--project-key KEY]",
|
|
152
147
|
description: "Show the column schema of a dataset.",
|
|
153
148
|
examples: ["dss dataset schema orders",],
|
|
154
149
|
},
|
|
155
150
|
source: {
|
|
156
151
|
handler: async (c, a, f) => {
|
|
157
|
-
requireArgs(a, 1, "
|
|
152
|
+
requireArgs(a, 1, commandUsage("dataset", "source"));
|
|
158
153
|
return datasetSourceSummary(await c.datasets.get(a[0], f["project-key"]));
|
|
159
154
|
},
|
|
160
|
-
usage: "dss dataset source <name> [--project-key KEY]",
|
|
161
155
|
description: "Show backing connection, catalog/schema/table, path, and format for a dataset.",
|
|
162
156
|
examples: ["dss dataset source orders",],
|
|
163
157
|
},
|
|
164
158
|
files: {
|
|
165
159
|
handler: (c, a, f) => {
|
|
166
|
-
requireArgs(a, 1, "
|
|
160
|
+
requireArgs(a, 1, commandUsage("dataset", "files"));
|
|
167
161
|
return c.datasets.listUploadedFiles(a[0], f["project-key"]);
|
|
168
162
|
},
|
|
169
|
-
usage: "dss dataset files <name> [--project-key KEY]",
|
|
170
163
|
description: "List files stored by an UploadedFiles dataset.",
|
|
171
164
|
examples: ["dss dataset files uploaded_input",],
|
|
172
165
|
},
|
|
173
166
|
"upload-file": {
|
|
174
167
|
handler: (c, a, f) => {
|
|
175
|
-
const usage = "
|
|
168
|
+
const usage = commandUsage("dataset", "upload-file");
|
|
176
169
|
requireArgs(a, 2, usage);
|
|
177
170
|
const fileName = f["file-name"];
|
|
178
171
|
if (!fileName || fileName.trim() === "") {
|
|
@@ -183,7 +176,6 @@ export const datasetCommands = {
|
|
|
183
176
|
projectKey: f["project-key"],
|
|
184
177
|
});
|
|
185
178
|
},
|
|
186
|
-
usage: "dss dataset upload-file <name> <localPath> --file-name NAME [--project-key KEY]",
|
|
187
179
|
description: "Add one new file to an UploadedFiles dataset and verify the stored byte length.",
|
|
188
180
|
examples: [
|
|
189
181
|
"dss dataset upload-file uploaded_input ./input.csv --file-name input.csv",
|
|
@@ -191,7 +183,7 @@ export const datasetCommands = {
|
|
|
191
183
|
},
|
|
192
184
|
"refresh-schema": {
|
|
193
185
|
handler: async (c, a, f) => {
|
|
194
|
-
const usage = "
|
|
186
|
+
const usage = commandUsage("dataset", "refresh-schema");
|
|
195
187
|
requireArgs(a, 1, usage);
|
|
196
188
|
const columns = schemaColumnsInput(f, usage);
|
|
197
189
|
const pk = f["project-key"];
|
|
@@ -209,7 +201,6 @@ export const datasetCommands = {
|
|
|
209
201
|
await c.datasets.updateSchema(a[0], columns, pk);
|
|
210
202
|
return { updated: a[0], resource: "dataset", schema: { columns, }, };
|
|
211
203
|
},
|
|
212
|
-
usage: "dss dataset refresh-schema <name> (--data JSON | --data-file PATH | --stdin) [--dry-run] [--project-key KEY]",
|
|
213
204
|
description: "Replace a dataset schema through the DSS schema endpoint.",
|
|
214
205
|
examples: [
|
|
215
206
|
`dss dataset refresh-schema orders --data '{"columns":[{"name":"id","type":"bigint"}]}' --dry-run`,
|
|
@@ -217,16 +208,15 @@ export const datasetCommands = {
|
|
|
217
208
|
},
|
|
218
209
|
"validate-build": {
|
|
219
210
|
handler: (c, a, f) => {
|
|
220
|
-
requireArgs(a, 1, "
|
|
211
|
+
requireArgs(a, 1, commandUsage("dataset", "validate-build"));
|
|
221
212
|
return c.datasets.validateBuildSettings(a[0], f["project-key"]);
|
|
222
213
|
},
|
|
223
|
-
usage: "dss dataset validate-build <name> [--project-key KEY]",
|
|
224
214
|
description: "Check common dataset settings that can make file-backed builds fail.",
|
|
225
215
|
examples: ["dss dataset validate-build orders",],
|
|
226
216
|
},
|
|
227
217
|
preview: {
|
|
228
218
|
handler: async (c, a, f) => {
|
|
229
|
-
const previewUsage = "
|
|
219
|
+
const previewUsage = commandUsage("dataset", "preview");
|
|
230
220
|
requireArgs(a, 1, previewUsage);
|
|
231
221
|
const maxRows = num(f["max-rows"], "--max-rows");
|
|
232
222
|
if (maxRows !== undefined && (!Number.isSafeInteger(maxRows) || maxRows <= 0 || maxRows > 500)) {
|
|
@@ -251,13 +241,12 @@ export const datasetCommands = {
|
|
|
251
241
|
}
|
|
252
242
|
return result;
|
|
253
243
|
},
|
|
254
|
-
usage: "dss dataset preview <name> [--max-rows N] [--rows N] [--project-key KEY] [--timeout MS]",
|
|
255
244
|
description: "Preview dataset rows (--rows is an alias for --max-rows). Returns { columns, rows, rowCount, truncated, limit }; when the dataset has more rows than the cap, truncated is true and a dataset_preview_truncated warning is written to stderr.",
|
|
256
245
|
examples: ["dss dataset preview orders", "dss dataset preview orders --rows 5",],
|
|
257
246
|
},
|
|
258
247
|
"assert-count": {
|
|
259
248
|
handler: async (c, a, f) => {
|
|
260
|
-
const assertUsage = "
|
|
249
|
+
const assertUsage = commandUsage("dataset", "assert-count");
|
|
261
250
|
requireArgs(a, 1, assertUsage);
|
|
262
251
|
const expected = num(f["expected"], "--expected");
|
|
263
252
|
if (expected === undefined || !Number.isSafeInteger(expected) || expected < 0) {
|
|
@@ -267,13 +256,12 @@ export const datasetCommands = {
|
|
|
267
256
|
const result = await c.datasets.assertRowCount(a[0], expected, f["project-key"]);
|
|
268
257
|
return { ...result, dataset: a[0], };
|
|
269
258
|
},
|
|
270
|
-
usage: "dss dataset assert-count <dataset> --expected N [--project-key KEY]",
|
|
271
259
|
description: "Stream the dataset and assert it holds exactly --expected rows, probing at most N+1 rows. Returns { satisfied, expected, count, exact }; a mismatch exits 4 with assertion_failed.",
|
|
272
260
|
examples: ["dss dataset assert-count orders --expected 1000",],
|
|
273
261
|
},
|
|
274
262
|
"assert-schema": {
|
|
275
263
|
handler: async (c, a, f) => {
|
|
276
|
-
const assertUsage = "
|
|
264
|
+
const assertUsage = commandUsage("dataset", "assert-schema");
|
|
277
265
|
requireArgs(a, 1, assertUsage);
|
|
278
266
|
const expected = unknownJsonInput(f);
|
|
279
267
|
if (expected === undefined) {
|
|
@@ -291,7 +279,6 @@ export const datasetCommands = {
|
|
|
291
279
|
differences: comparison.differences,
|
|
292
280
|
};
|
|
293
281
|
},
|
|
294
|
-
usage: "dss dataset assert-schema <dataset> (--data JSON | --data-file PATH | --stdin) [--project-key KEY]",
|
|
295
282
|
description: "Assert the dataset's full schema equals the expected schema object; reports concise per-path differences with sha256 subtree hashes. A mismatch exits 4 with assertion_failed.",
|
|
296
283
|
examples: [
|
|
297
284
|
`dss dataset assert-schema orders --data-file expected-schema.json`,
|
|
@@ -300,16 +287,15 @@ export const datasetCommands = {
|
|
|
300
287
|
},
|
|
301
288
|
metadata: {
|
|
302
289
|
handler: (c, a, f) => {
|
|
303
|
-
requireArgs(a, 1, "
|
|
290
|
+
requireArgs(a, 1, commandUsage("dataset", "metadata"));
|
|
304
291
|
return c.datasets.metadata(a[0], f["project-key"]);
|
|
305
292
|
},
|
|
306
|
-
usage: "dss dataset metadata <name> [--project-key KEY]",
|
|
307
293
|
description: "Get dataset-level metadata.",
|
|
308
294
|
examples: ["dss dataset metadata orders",],
|
|
309
295
|
},
|
|
310
296
|
"metadata-set": {
|
|
311
297
|
handler: async (c, a, f) => {
|
|
312
|
-
const usage = "
|
|
298
|
+
const usage = commandUsage("dataset", "metadata-set");
|
|
313
299
|
requireArgs(a, 1, usage);
|
|
314
300
|
// Validated identically for live, --plan, and --dry-run: the JSON
|
|
315
301
|
// input replaces the server metadata object verbatim (faithful PUT;
|
|
@@ -334,7 +320,6 @@ export const datasetCommands = {
|
|
|
334
320
|
const updated = await c.datasets.updateMetadata(a[0], metadata, pk);
|
|
335
321
|
return { updated: a[0], resource: "dataset", metadata: updated, };
|
|
336
322
|
},
|
|
337
|
-
usage: "dss dataset metadata-set <name> (--data JSON | --data-file PATH | --stdin) [--dry-run] [--project-key KEY]",
|
|
338
323
|
description: "Replace dataset-level metadata with the given JSON object (faithful PUT: GET, edit, PUT full object; no merge).",
|
|
339
324
|
examples: [
|
|
340
325
|
`dss dataset metadata-set orders --data '{"label":"Orders","tags":["prod"]}' --dry-run`,
|
|
@@ -348,7 +333,7 @@ export const datasetCommands = {
|
|
|
348
333
|
const connection = f["connection"];
|
|
349
334
|
const dsType = f["type"];
|
|
350
335
|
if (!name || !dsType) {
|
|
351
|
-
throw new UsageError(
|
|
336
|
+
throw new UsageError(`--name and --type are required. Usage: ${commandUsage("dataset", "create")}`);
|
|
352
337
|
}
|
|
353
338
|
if (!connection && dsType.toLowerCase() !== "uploadedfiles") {
|
|
354
339
|
throw new UsageError("--connection is required unless --type is UploadedFiles.");
|
|
@@ -382,7 +367,6 @@ export const datasetCommands = {
|
|
|
382
367
|
const moved = await moveCreatedItemsToZone(c, f, [{ objectId: name, objectType: "DATASET", },], pk);
|
|
383
368
|
return { created: name, resource: "dataset", ...moved, };
|
|
384
369
|
},
|
|
385
|
-
usage: "dss dataset create --name NAME --type TYPE [--connection CONN] [--zone ZONE|--zone-id ID] [--if-not-exists] [--dry-run] [--project-key KEY]",
|
|
386
370
|
description: "Create a new dataset. UploadedFiles uses the server's default upload connection when omitted.",
|
|
387
371
|
examples: [
|
|
388
372
|
"dss dataset create --name uploads --type UploadedFiles",
|
|
@@ -392,7 +376,7 @@ export const datasetCommands = {
|
|
|
392
376
|
},
|
|
393
377
|
"create-managed": {
|
|
394
378
|
handler: async (c, _a, f) => {
|
|
395
|
-
const usage = "
|
|
379
|
+
const usage = commandUsage("dataset", "create-managed");
|
|
396
380
|
const name = f["name"];
|
|
397
381
|
if (!name || name.trim() === "") {
|
|
398
382
|
throw new UsageError(`--name is required. Usage: ${usage}`);
|
|
@@ -446,7 +430,6 @@ export const datasetCommands = {
|
|
|
446
430
|
creationSettings: created.creationSettings,
|
|
447
431
|
};
|
|
448
432
|
},
|
|
449
|
-
usage: "dss dataset create-managed --name NAME --connection CONN [--type-option-id ID] [--format-option-id ID] [--copy-partitioning-from REF] [--partitioning-folder] [--dry-run] [--project-key KEY]",
|
|
450
433
|
description: "Create a managed dataset via the dedicated endpoint: DSS derives storage/format details; you pick name, connection, and optional type/format/partitioning options.",
|
|
451
434
|
examples: [
|
|
452
435
|
"dss dataset create-managed --name orders_copy --connection filesystem_managed",
|
|
@@ -456,16 +439,15 @@ export const datasetCommands = {
|
|
|
456
439
|
},
|
|
457
440
|
info: {
|
|
458
441
|
handler: (c, a, f) => {
|
|
459
|
-
requireArgs(a, 1, "
|
|
442
|
+
requireArgs(a, 1, commandUsage("dataset", "info"));
|
|
460
443
|
return c.datasets.info(a[0], f["project-key"]);
|
|
461
444
|
},
|
|
462
|
-
usage: "dss dataset info <name> [--project-key KEY]",
|
|
463
445
|
description: "Get the full info object for a dataset (type, parameters, last build information, schema, etc.).",
|
|
464
446
|
examples: ["dss dataset info orders", "dss dataset info orders --project-key MYPROJ",],
|
|
465
447
|
},
|
|
466
448
|
"column-lineage": {
|
|
467
449
|
handler: (c, a, f) => {
|
|
468
|
-
const usage = "
|
|
450
|
+
const usage = commandUsage("dataset", "column-lineage");
|
|
469
451
|
requireArgs(a, 2, usage);
|
|
470
452
|
const maxDatasetCount = num(f["max-dataset-count"], "--max-dataset-count");
|
|
471
453
|
if (maxDatasetCount !== undefined
|
|
@@ -478,7 +460,6 @@ export const datasetCommands = {
|
|
|
478
460
|
projectKey: f["project-key"],
|
|
479
461
|
});
|
|
480
462
|
},
|
|
481
|
-
usage: "dss dataset column-lineage <name> <column> [--max-dataset-count N] [--project-key KEY]",
|
|
482
463
|
description: "Get the full column lineage (auto-computed and manual) of a column; includes local and foreign project relations.",
|
|
483
464
|
examples: [
|
|
484
465
|
"dss dataset column-lineage orders customer_id",
|
|
@@ -487,7 +468,7 @@ export const datasetCommands = {
|
|
|
487
468
|
},
|
|
488
469
|
download: {
|
|
489
470
|
handler: async (c, a, f) => {
|
|
490
|
-
requireArgs(a, 1, "
|
|
471
|
+
requireArgs(a, 1, commandUsage("dataset", "download"));
|
|
491
472
|
const result = await c.datasets.download(a[0], {
|
|
492
473
|
outputPath: f["output"],
|
|
493
474
|
projectKey: f["project-key"],
|
|
@@ -516,7 +497,6 @@ export const datasetCommands = {
|
|
|
516
497
|
}
|
|
517
498
|
return result;
|
|
518
499
|
},
|
|
519
|
-
usage: "dss dataset download <name> [--output PATH] [--limit N] [--raw-data] [--project-key KEY]",
|
|
520
500
|
description: "Download up to --limit rows (default 100k) as CSV and return { path, rows, truncated, limit }. Formula-like cells are neutralized for spreadsheets; --raw-data preserves exact bytes. Warnings report truncation and the default output path.",
|
|
521
501
|
examples: [
|
|
522
502
|
"dss dataset download orders",
|
|
@@ -526,7 +506,7 @@ export const datasetCommands = {
|
|
|
526
506
|
},
|
|
527
507
|
clone: {
|
|
528
508
|
handler: async (c, a, f) => {
|
|
529
|
-
const usage = "
|
|
509
|
+
const usage = commandUsage("dataset", "clone");
|
|
530
510
|
requireArgs(a, 2, usage);
|
|
531
511
|
const pk = f["project-key"];
|
|
532
512
|
const opts = {
|
|
@@ -556,7 +536,6 @@ export const datasetCommands = {
|
|
|
556
536
|
const moved = await moveCreatedItemsToZone(c, f, [{ objectId: a[1], objectType: "DATASET", },], pk);
|
|
557
537
|
return { ...cloned, resource: "dataset", ...moved, };
|
|
558
538
|
},
|
|
559
|
-
usage: "dss dataset clone <source> <target> [--path PATH] [--table TABLE] [--metastore-table TABLE] [--allow-same-path] [--zone ZONE|--zone-id ID] [--dry-run] [--project-key KEY]",
|
|
560
539
|
description: "Clone dataset settings into a new dataset, with storage/table overrides.",
|
|
561
540
|
examples: [
|
|
562
541
|
"dss dataset clone source_ds experiment_ds --path /dataiku/TEST/experiment_ds --dry-run",
|
|
@@ -565,7 +544,7 @@ export const datasetCommands = {
|
|
|
565
544
|
},
|
|
566
545
|
delete: {
|
|
567
546
|
handler: async (c, a, f) => {
|
|
568
|
-
requireArgs(a, 1, "
|
|
547
|
+
requireArgs(a, 1, commandUsage("dataset", "delete"));
|
|
569
548
|
const pk = f["project-key"];
|
|
570
549
|
if (executionMode(f).dryRun || f["if-exists"] === true) {
|
|
571
550
|
const current = await readIfExists(() => c.datasets.get(a[0], pk));
|
|
@@ -578,16 +557,15 @@ export const datasetCommands = {
|
|
|
578
557
|
await c.datasets.delete(a[0], pk);
|
|
579
558
|
return { deleted: a[0], resource: "dataset", };
|
|
580
559
|
},
|
|
581
|
-
usage: "dss dataset delete <name> [--if-exists] [--dry-run] [--project-key KEY]",
|
|
582
560
|
description: "Delete a dataset.",
|
|
583
561
|
examples: ["dss dataset delete orders", "dss dataset delete orders --if-exists",],
|
|
584
562
|
},
|
|
585
563
|
update: {
|
|
586
564
|
handler: async (c, a, f) => {
|
|
587
|
-
requireArgs(a, 1, "
|
|
565
|
+
requireArgs(a, 1, commandUsage("dataset", "update"));
|
|
588
566
|
const data = jsonInput(f);
|
|
589
567
|
if (!data) {
|
|
590
|
-
throw new UsageError(
|
|
568
|
+
throw new UsageError(`--data, --data-file, or --stdin is required. Usage: ${commandUsage("dataset", "update")}`);
|
|
591
569
|
}
|
|
592
570
|
const pk = f["project-key"];
|
|
593
571
|
if (executionMode(f).dryRun) {
|
|
@@ -598,11 +576,10 @@ export const datasetCommands = {
|
|
|
598
576
|
await c.datasets.update(a[0], data, pk);
|
|
599
577
|
return { updated: a[0], resource: "dataset", };
|
|
600
578
|
},
|
|
601
|
-
usage: "dss dataset update <name> (--data '{...}' | --data-file PATH | --stdin) [--dry-run] [--project-key KEY]",
|
|
602
579
|
description: "Update dataset settings via JSON merge.",
|
|
603
580
|
examples: [
|
|
604
581
|
'dss dataset update orders --data \'{"tags":["production"]}\' --dry-run',
|
|
605
582
|
"echo '{\"tags\":[]}' | dss dataset update orders --stdin",
|
|
606
583
|
],
|
|
607
584
|
},
|
|
608
|
-
};
|
|
585
|
+
});
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
+
import { commandUsage, withUsage, } from "../syntax.js";
|
|
1
2
|
import { requireArgs, UsageError, } from "../usage.js";
|
|
2
|
-
export const discussionCommands = {
|
|
3
|
+
export const discussionCommands = withUsage("discussion", {
|
|
3
4
|
list: {
|
|
4
5
|
handler: (c, a, f) => {
|
|
5
|
-
requireArgs(a, 2, "
|
|
6
|
+
requireArgs(a, 2, commandUsage("discussion", "list"));
|
|
6
7
|
return c.discussions.list(a[0], a[1], f["project-key"]);
|
|
7
8
|
},
|
|
8
|
-
usage: "dss discussion list <objectType> <objectId> [--project-key KEY]",
|
|
9
9
|
description: "List discussions attached to a project object.",
|
|
10
10
|
examples: ["dss discussion list DATASET customers",],
|
|
11
11
|
},
|
|
12
12
|
get: {
|
|
13
13
|
handler: (c, a, f) => {
|
|
14
|
-
requireArgs(a, 3, "
|
|
14
|
+
requireArgs(a, 3, commandUsage("discussion", "get"));
|
|
15
15
|
return c.discussions.get(a[0], a[1], a[2], f["project-key"]);
|
|
16
16
|
},
|
|
17
|
-
usage: "dss discussion get <objectType> <objectId> <discussionId> [--project-key KEY]",
|
|
18
17
|
description: "Get one discussion with its replies.",
|
|
19
18
|
examples: ["dss discussion get DATASET customers d123",],
|
|
20
19
|
},
|
|
21
20
|
create: {
|
|
22
21
|
handler: (c, a, f) => {
|
|
23
|
-
requireArgs(a, 2, "
|
|
22
|
+
requireArgs(a, 2, commandUsage("discussion", "create"));
|
|
24
23
|
const topic = f["topic"];
|
|
25
24
|
const reply = f["reply"];
|
|
26
25
|
if (!topic || !reply) {
|
|
@@ -28,20 +27,18 @@ export const discussionCommands = {
|
|
|
28
27
|
}
|
|
29
28
|
return c.discussions.create(a[0], a[1], topic, reply, f["project-key"]);
|
|
30
29
|
},
|
|
31
|
-
usage: "dss discussion create <objectType> <objectId> --topic TEXT --reply TEXT [--project-key KEY]",
|
|
32
30
|
description: "Create a discussion with its first reply.",
|
|
33
31
|
examples: ["dss discussion create DATASET customers --topic Schema --reply Please-review",],
|
|
34
32
|
},
|
|
35
33
|
reply: {
|
|
36
34
|
handler: (c, a, f) => {
|
|
37
|
-
requireArgs(a, 3, "
|
|
35
|
+
requireArgs(a, 3, commandUsage("discussion", "reply"));
|
|
38
36
|
const text = f["text"];
|
|
39
37
|
if (!text)
|
|
40
38
|
throw new UsageError("--text is required.", "missing_required_flag");
|
|
41
39
|
return c.discussions.reply(a[0], a[1], a[2], text, f["project-key"]);
|
|
42
40
|
},
|
|
43
|
-
usage: "dss discussion reply <objectType> <objectId> <discussionId> --text TEXT [--project-key KEY]",
|
|
44
41
|
description: "Add a reply to an existing discussion.",
|
|
45
42
|
examples: ["dss discussion reply DATASET customers d123 --text Done",],
|
|
46
43
|
},
|
|
47
|
-
};
|
|
44
|
+
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { withUsage, } from "../syntax.js";
|
|
2
|
+
export const doctorCommands = withUsage("doctor", {
|
|
2
3
|
run: {
|
|
3
4
|
handler: async (_c, _a, f) => {
|
|
4
5
|
const { runDoctor, } = await import("../doctor.js");
|
|
5
6
|
return (await runDoctor(f)).result;
|
|
6
7
|
},
|
|
7
|
-
usage: "dss doctor [--project-key KEY] [--capabilities] [--fast]",
|
|
8
8
|
description: "Run JSON diagnostics for DSS credentials, connectivity, and project access.",
|
|
9
9
|
examples: ["dss doctor", "dss doctor --project-key MYPROJ", "dss doctor --capabilities --fast",],
|
|
10
10
|
},
|
|
11
|
-
};
|
|
11
|
+
});
|
|
@@ -3,8 +3,9 @@ import { deepMerge, } from "../../utils/deep-merge.js";
|
|
|
3
3
|
import { executionMode, } from "../flags.js";
|
|
4
4
|
import { ensureFlowZonePlanTarget, findFlowZoneForPlan, flowZoneColor, flowZoneContains, flowZoneCurrentPosition, flowZoneDetailSummary, flowZoneId, flowZoneMoveDelta, flowZoneMoveItems, flowZoneName, flowZoneOrganizeStep, flowZonePlanFromZones, flowZonePlanItemKeys, flowZonePruneItems, flowZoneSamePosition, flowZoneSummary, readFlowZoneOrganizePlan, resolveFlowZoneIdFromFlags, throwFlowZoneValidationError, validateFlowZoneOrganizeObjects, } from "../helpers/flow-zone.js";
|
|
5
5
|
import { readIfExists, skipResult, } from "../output.js";
|
|
6
|
+
import { commandUsage, withUsage, } from "../syntax.js";
|
|
6
7
|
import { requireArgs, UsageError, } from "../usage.js";
|
|
7
|
-
export const flowZoneCommands = {
|
|
8
|
+
export const flowZoneCommands = withUsage("flow-zone", {
|
|
8
9
|
list: {
|
|
9
10
|
handler: async (c, _a, f) => {
|
|
10
11
|
const zones = await c.flowZones.list(f["project-key"]);
|
|
@@ -14,7 +15,6 @@ export const flowZoneCommands = {
|
|
|
14
15
|
const object = objects.length === 1 ? objects[0] : undefined;
|
|
15
16
|
return zones.map((zone) => flowZoneSummary(zone, object));
|
|
16
17
|
},
|
|
17
|
-
usage: "dss flow-zone list [--summary] [--object TYPE:ID] [--project-key KEY]",
|
|
18
18
|
description: "List flow zones in a project, optionally as compact summaries.",
|
|
19
19
|
examples: ["dss flow-zone list", "dss flow-zone list --summary --object RECIPE:compute_orders",],
|
|
20
20
|
},
|
|
@@ -38,7 +38,6 @@ export const flowZoneCommands = {
|
|
|
38
38
|
.filter((zone) => flowZoneContains(zone, object))
|
|
39
39
|
.map((zone) => flowZoneSummary(zone, object));
|
|
40
40
|
},
|
|
41
|
-
usage: "dss flow-zone find [name-or-id] [--object TYPE:ID | --dataset DS | --recipe R | --folder F] [--project-key KEY]",
|
|
42
41
|
description: "Find flow zones by name/id or by contained flow object.",
|
|
43
42
|
examples: [
|
|
44
43
|
"dss flow-zone find ATH_SNW_MAP_FRG49",
|
|
@@ -48,10 +47,9 @@ export const flowZoneCommands = {
|
|
|
48
47
|
},
|
|
49
48
|
get: {
|
|
50
49
|
handler: (c, a, f) => {
|
|
51
|
-
requireArgs(a, 1, "
|
|
50
|
+
requireArgs(a, 1, commandUsage("flow-zone", "get"));
|
|
52
51
|
return c.flowZones.get(flowZoneId(a[0]), f["project-key"]);
|
|
53
52
|
},
|
|
54
|
-
usage: "dss flow-zone get <id> [--project-key KEY]",
|
|
55
53
|
description: "Get a flow zone by id.",
|
|
56
54
|
examples: ["dss flow-zone get ZONE_ID",],
|
|
57
55
|
},
|
|
@@ -84,7 +82,6 @@ export const flowZoneCommands = {
|
|
|
84
82
|
const created = await c.flowZones.create(payload);
|
|
85
83
|
return { created: created.id, resource: "flow-zone", ...created, };
|
|
86
84
|
},
|
|
87
|
-
usage: "dss flow-zone create --name NAME [--color #RRGGBB] [--if-not-exists] [--dry-run] [--project-key KEY]",
|
|
88
85
|
description: "Create a flow zone.",
|
|
89
86
|
examples: [
|
|
90
87
|
"dss flow-zone create --name Exports",
|
|
@@ -93,7 +90,7 @@ export const flowZoneCommands = {
|
|
|
93
90
|
},
|
|
94
91
|
update: {
|
|
95
92
|
handler: async (c, a, f) => {
|
|
96
|
-
requireArgs(a, 1, "
|
|
93
|
+
requireArgs(a, 1, commandUsage("flow-zone", "update"));
|
|
97
94
|
if (typeof f["name"] !== "string" && typeof f["color"] !== "string") {
|
|
98
95
|
throw new UsageError("--name and/or --color is required.");
|
|
99
96
|
}
|
|
@@ -111,13 +108,12 @@ export const flowZoneCommands = {
|
|
|
111
108
|
}
|
|
112
109
|
return c.flowZones.update(zoneId, patch);
|
|
113
110
|
},
|
|
114
|
-
usage: "dss flow-zone update <id> [--name NAME] [--color #RRGGBB] [--dry-run] [--project-key KEY]",
|
|
115
111
|
description: "Update flow zone settings.",
|
|
116
112
|
examples: ["dss flow-zone update ZONE_ID --name Exports --color '#2ab1ac' --dry-run",],
|
|
117
113
|
},
|
|
118
114
|
delete: {
|
|
119
115
|
handler: async (c, a, f) => {
|
|
120
|
-
requireArgs(a, 1, "
|
|
116
|
+
requireArgs(a, 1, commandUsage("flow-zone", "delete"));
|
|
121
117
|
const zoneId = flowZoneId(a[0]);
|
|
122
118
|
if (executionMode(f).dryRun || f["if-exists"] === true) {
|
|
123
119
|
const current = await readIfExists(() => c.flowZones.get(zoneId, f["project-key"]));
|
|
@@ -130,7 +126,6 @@ export const flowZoneCommands = {
|
|
|
130
126
|
await c.flowZones.delete(zoneId, f["project-key"]);
|
|
131
127
|
return { deleted: zoneId, resource: "flow-zone", };
|
|
132
128
|
},
|
|
133
|
-
usage: "dss flow-zone delete <id> [--if-exists] [--dry-run] [--project-key KEY]",
|
|
134
129
|
description: "Delete a flow zone. DSS moves zone items back to the default zone.",
|
|
135
130
|
examples: [
|
|
136
131
|
"dss flow-zone delete ZONE_ID --dry-run",
|
|
@@ -142,7 +137,7 @@ export const flowZoneCommands = {
|
|
|
142
137
|
const pk = f["project-key"];
|
|
143
138
|
const zoneId = a[0] ? flowZoneId(a[0]) : await resolveFlowZoneIdFromFlags(c, f, pk);
|
|
144
139
|
if (!zoneId) {
|
|
145
|
-
throw new UsageError(
|
|
140
|
+
throw new UsageError(`A zone id or --zone/--zone-id is required. Usage: ${commandUsage("flow-zone", "move")}`);
|
|
146
141
|
}
|
|
147
142
|
const items = flowZoneMoveItems(f);
|
|
148
143
|
if (items.length === 0) {
|
|
@@ -159,7 +154,6 @@ export const flowZoneCommands = {
|
|
|
159
154
|
}
|
|
160
155
|
return c.flowZones.moveItems(zoneId, items, pk);
|
|
161
156
|
},
|
|
162
|
-
usage: "dss flow-zone move [id] [--zone ZONE|--zone-id ID] [--dataset DS[,DS2]] [--recipe R] [--folder F] [--object TYPE:ID] [--dry-run] [--project-key KEY]",
|
|
163
157
|
description: "Move datasets, recipes, managed folders, or other flow objects into a zone by id or --zone name.",
|
|
164
158
|
examples: [
|
|
165
159
|
"dss flow-zone move ZONE_ID --dataset orders --dry-run",
|
|
@@ -177,13 +171,12 @@ export const flowZoneCommands = {
|
|
|
177
171
|
]);
|
|
178
172
|
return flowZonePlanFromZones(zones, topologyFingerprint);
|
|
179
173
|
},
|
|
180
|
-
usage: "dss flow-zone plan [--project-key KEY]",
|
|
181
174
|
description: "Export current visual flow-zone organization as an organize-compatible plan.",
|
|
182
175
|
examples: ["dss flow-zone plan --project-key MYPROJ",],
|
|
183
176
|
},
|
|
184
177
|
organize: {
|
|
185
178
|
handler: async (c, _a, f) => {
|
|
186
|
-
const usage = "
|
|
179
|
+
const usage = commandUsage("flow-zone", "organize");
|
|
187
180
|
const pk = f["project-key"];
|
|
188
181
|
const plan = readFlowZoneOrganizePlan(f, usage);
|
|
189
182
|
const sync = f["sync"] === true;
|
|
@@ -292,7 +285,6 @@ export const flowZoneCommands = {
|
|
|
292
285
|
pruned,
|
|
293
286
|
};
|
|
294
287
|
},
|
|
295
|
-
usage: "dss flow-zone organize (--data JSON|--data-file PATH|--file PATH|--stdin) [--sync] [--validate-objects] [--dry-run] [--project-key KEY]",
|
|
296
288
|
description: "Create/update flow zones and move objects from a declarative visual organization plan.",
|
|
297
289
|
examples: [
|
|
298
290
|
"dss flow-zone organize --file flow-zones.json --dry-run",
|
|
@@ -304,8 +296,7 @@ export const flowZoneCommands = {
|
|
|
304
296
|
const id = a[0] === undefined ? undefined : flowZoneId(a[0]);
|
|
305
297
|
return c.flowZones.graph(id, f["project-key"]);
|
|
306
298
|
},
|
|
307
|
-
usage: "dss flow-zone graph [<id>] [--project-key KEY]",
|
|
308
299
|
description: "Get the full flow graph or the graph for a single flow zone.",
|
|
309
300
|
examples: ["dss flow-zone graph", "dss flow-zone graph ZONE_ID",],
|
|
310
301
|
},
|
|
311
|
-
};
|
|
302
|
+
});
|