dataiku-sdk 3.6.1 → 3.7.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 +14 -6
- package/bin/bun-version.js +14 -0
- package/bin/dss.js +11 -15
- package/dist/build-metadata.json +1 -1
- package/dist/packages/types/src/index.d.ts +74 -1
- package/dist/packages/types/src/index.js +53 -1
- package/dist/src/cli/coerce.d.ts +1 -0
- package/dist/src/cli/coerce.js +19 -15
- package/dist/src/cli/command-syntax.json +3521 -416
- package/dist/src/cli/commands/analysis.js +19 -1
- package/dist/src/cli/commands/bundle.js +22 -0
- package/dist/src/cli/commands/connection.js +26 -2
- package/dist/src/cli/commands/data-quality.js +33 -1
- package/dist/src/cli/commands/dataset.js +35 -4
- package/dist/src/cli/commands/discussion.js +15 -0
- package/dist/src/cli/commands/doctor.js +1 -1
- package/dist/src/cli/commands/flow.d.ts +5 -0
- package/dist/src/cli/commands/flow.js +57 -0
- package/dist/src/cli/commands/future.js +8 -0
- package/dist/src/cli/commands/index.js +6 -0
- package/dist/src/cli/commands/job.js +29 -6
- package/dist/src/cli/commands/metrics.js +21 -1
- package/dist/src/cli/commands/ml-task.d.ts +5 -0
- package/dist/src/cli/commands/ml-task.js +86 -16
- package/dist/src/cli/commands/mlflow.d.ts +11 -0
- package/dist/src/cli/commands/mlflow.js +121 -0
- package/dist/src/cli/commands/plugin.js +5 -11
- package/dist/src/cli/commands/project-deployer.js +70 -0
- package/dist/src/cli/commands/project-library.js +2 -5
- package/dist/src/cli/commands/project.js +8 -0
- package/dist/src/cli/commands/recipe.d.ts +9 -0
- package/dist/src/cli/commands/recipe.js +93 -7
- package/dist/src/cli/commands/saved-model.d.ts +1 -1
- package/dist/src/cli/commands/saved-model.js +9 -76
- package/dist/src/cli/commands/streaming-endpoint.js +30 -1
- package/dist/src/cli/commands/webapp.js +8 -0
- package/dist/src/cli/commands/wiki.js +22 -0
- package/dist/src/cli/commands/workspace.js +8 -0
- package/dist/src/cli/contract.d.ts +16 -15
- package/dist/src/cli/contract.js +139 -3404
- package/dist/src/cli/doctor.d.ts +13 -0
- package/dist/src/cli/doctor.js +41 -1
- package/dist/src/cli/flags.d.ts +7 -1
- package/dist/src/cli/flags.js +78 -6
- package/dist/src/cli/helpers/app-successor.js +1 -2
- package/dist/src/cli/helpers/documentation.d.ts +21 -0
- package/dist/src/cli/helpers/documentation.js +53 -0
- package/dist/src/cli/helpers/trained-model.d.ts +26 -0
- package/dist/src/cli/helpers/trained-model.js +144 -0
- package/dist/src/cli/list-output.d.ts +7 -0
- package/dist/src/cli/list-output.js +77 -0
- package/dist/src/cli/list-shapes.d.ts +21 -0
- package/dist/src/cli/list-shapes.js +111 -0
- package/dist/src/cli/output-schemas.d.ts +0 -14
- package/dist/src/cli/output-schemas.js +4 -7
- package/dist/src/cli/output.d.ts +0 -1
- package/dist/src/cli/output.js +27 -19
- package/dist/src/cli/plans.d.ts +14 -0
- package/dist/src/cli/plans.js +3684 -0
- package/dist/src/cli/usage.d.ts +7 -0
- package/dist/src/cli/usage.js +20 -1
- package/dist/src/cli/version.d.ts +2 -2
- package/dist/src/cli/version.js +2 -2
- package/dist/src/cli.js +127 -113
- package/dist/src/client.d.ts +52 -43
- package/dist/src/client.js +267 -96
- package/dist/src/errors.d.ts +11 -1
- package/dist/src/errors.js +31 -47
- package/dist/src/generated/action-output-schemas.json +345 -89
- package/dist/src/index.d.ts +5 -1
- package/dist/src/index.js +3 -0
- package/dist/src/resources/analyses.d.ts +8 -0
- package/dist/src/resources/analyses.js +13 -1
- package/dist/src/resources/bundles.d.ts +34 -0
- package/dist/src/resources/bundles.js +67 -0
- package/dist/src/resources/connections.d.ts +9 -0
- package/dist/src/resources/connections.js +15 -0
- package/dist/src/resources/data-quality.d.ts +20 -0
- package/dist/src/resources/data-quality.js +30 -0
- package/dist/src/resources/dataset-create.d.ts +19 -0
- package/dist/src/resources/dataset-create.js +66 -0
- package/dist/src/resources/datasets.d.ts +25 -15
- package/dist/src/resources/datasets.js +59 -111
- package/dist/src/resources/discussions.d.ts +5 -0
- package/dist/src/resources/discussions.js +7 -0
- package/dist/src/resources/documentation.d.ts +25 -0
- package/dist/src/resources/documentation.js +16 -0
- package/dist/src/resources/flow.d.ts +48 -0
- package/dist/src/resources/flow.js +65 -0
- package/dist/src/resources/futures.d.ts +23 -0
- package/dist/src/resources/futures.js +32 -0
- package/dist/src/resources/jobs.js +102 -2
- package/dist/src/resources/metrics.d.ts +10 -0
- package/dist/src/resources/metrics.js +10 -0
- package/dist/src/resources/ml-tasks.d.ts +65 -2
- package/dist/src/resources/ml-tasks.js +102 -28
- package/dist/src/resources/mlflow-extension.d.ts +73 -0
- package/dist/src/resources/mlflow-extension.js +105 -0
- package/dist/src/resources/projects.d.ts +6 -0
- package/dist/src/resources/projects.js +8 -0
- package/dist/src/resources/recipe-create.d.ts +65 -0
- package/dist/src/resources/recipe-create.js +338 -0
- package/dist/src/resources/recipes.d.ts +28 -29
- package/dist/src/resources/recipes.js +126 -245
- package/dist/src/resources/saved-models.d.ts +10 -6
- package/dist/src/resources/saved-models.js +16 -14
- package/dist/src/resources/scenarios.js +8 -14
- package/dist/src/resources/streaming-endpoints.d.ts +12 -0
- package/dist/src/resources/streaming-endpoints.js +15 -0
- package/dist/src/resources/trained-model.d.ts +60 -0
- package/dist/src/resources/trained-model.js +98 -0
- package/dist/src/resources/webapps.d.ts +8 -0
- package/dist/src/resources/webapps.js +10 -0
- package/dist/src/resources/wiki.d.ts +5 -0
- package/dist/src/resources/wiki.js +7 -0
- package/dist/src/resources/workspaces.d.ts +2 -0
- package/dist/src/resources/workspaces.js +4 -0
- package/dist/src/utils/response-file.js +20 -9
- package/dist/src/utils/secret-sanitize.d.ts +7 -0
- package/dist/src/utils/secret-sanitize.js +46 -0
- package/package.json +25 -26
- package/plugin.json +1 -1
- package/skills/dataiku-dss/SKILL.md +1 -1
- package/skills/dataiku-dss/references/authentication.md +3 -1
- package/skills/dataiku-dss/references/coding.md +1 -0
- package/skills/dataiku-dss/references/discovery.md +4 -6
- package/skills/dataiku-dss/references/troubleshooting.md +3 -2
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compact `RESOURCE.list` item shapes, as plain data shared by the runtime
|
|
3
|
+
* mapper (src/cli/list-output.ts) and the discovery output schemas
|
|
4
|
+
* (src/cli/output-schemas.ts), so the advertised schema is the emitted shape.
|
|
5
|
+
*/
|
|
6
|
+
const STRING = { type: ["string", "null",], };
|
|
7
|
+
const BOOLEAN = { type: ["boolean", "null",], };
|
|
8
|
+
const NUMBER = { type: ["number", "null",], };
|
|
9
|
+
const STRINGS = { type: "array", items: { type: "string", }, };
|
|
10
|
+
const field = (path, schema) => ({
|
|
11
|
+
path,
|
|
12
|
+
schema,
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Lists whose DSS objects are large: the identifier the follow-up get/build
|
|
16
|
+
* commands take, the kind, and the one or two attributes that decide what to
|
|
17
|
+
* call next. Lists not named here keep the DSS objects.
|
|
18
|
+
*/
|
|
19
|
+
export const COMPACT_LIST_FIELDS = {
|
|
20
|
+
project: {
|
|
21
|
+
projectKey: field("projectKey", STRING),
|
|
22
|
+
name: field("name", STRING),
|
|
23
|
+
ownerLogin: field("ownerLogin", STRING),
|
|
24
|
+
},
|
|
25
|
+
dataset: {
|
|
26
|
+
name: field("name", STRING),
|
|
27
|
+
type: field("type", STRING),
|
|
28
|
+
managed: field("managed", BOOLEAN),
|
|
29
|
+
connection: field("params.connection", STRING),
|
|
30
|
+
},
|
|
31
|
+
recipe: {
|
|
32
|
+
name: field("name", STRING),
|
|
33
|
+
type: field("type", STRING),
|
|
34
|
+
inputs: { path: "inputs", roleRefs: true, schema: STRINGS, },
|
|
35
|
+
outputs: { path: "outputs", roleRefs: true, schema: STRINGS, },
|
|
36
|
+
},
|
|
37
|
+
scenario: {
|
|
38
|
+
id: field("id", STRING),
|
|
39
|
+
name: field("name", STRING),
|
|
40
|
+
type: field("type", STRING),
|
|
41
|
+
active: field("active", BOOLEAN),
|
|
42
|
+
running: field("running", BOOLEAN),
|
|
43
|
+
},
|
|
44
|
+
folder: {
|
|
45
|
+
id: field("id", STRING),
|
|
46
|
+
name: field("name", STRING),
|
|
47
|
+
type: field("type", STRING),
|
|
48
|
+
connection: field("params.connection", STRING),
|
|
49
|
+
},
|
|
50
|
+
job: {
|
|
51
|
+
id: field("def.id", STRING),
|
|
52
|
+
name: field("def.name", STRING),
|
|
53
|
+
type: field("def.type", STRING),
|
|
54
|
+
state: field("state", STRING),
|
|
55
|
+
startTime: field("startTime", NUMBER),
|
|
56
|
+
endTime: field("endTime", NUMBER),
|
|
57
|
+
},
|
|
58
|
+
"code-env": {
|
|
59
|
+
envName: field("envName", STRING),
|
|
60
|
+
envLang: field("envLang", STRING),
|
|
61
|
+
deploymentMode: field("deploymentMode", STRING),
|
|
62
|
+
},
|
|
63
|
+
future: {
|
|
64
|
+
jobId: field("jobId", STRING),
|
|
65
|
+
owner: field("owner", STRING),
|
|
66
|
+
alive: field("alive", BOOLEAN),
|
|
67
|
+
hasResult: field("hasResult", BOOLEAN),
|
|
68
|
+
runningTime: field("runningTime", NUMBER),
|
|
69
|
+
},
|
|
70
|
+
user: {
|
|
71
|
+
login: field("login", STRING),
|
|
72
|
+
displayName: field("displayName", STRING),
|
|
73
|
+
userProfile: field("userProfile", STRING),
|
|
74
|
+
groups: field("groups", STRINGS),
|
|
75
|
+
enabled: field("enabled", BOOLEAN),
|
|
76
|
+
},
|
|
77
|
+
group: {
|
|
78
|
+
name: field("name", STRING),
|
|
79
|
+
description: field("description", STRING),
|
|
80
|
+
admin: field("admin", BOOLEAN),
|
|
81
|
+
},
|
|
82
|
+
plugin: {
|
|
83
|
+
id: field("id", STRING),
|
|
84
|
+
version: field("version", STRING),
|
|
85
|
+
label: field("meta.label", STRING),
|
|
86
|
+
},
|
|
87
|
+
macro: {
|
|
88
|
+
runnableType: field("runnableType", STRING),
|
|
89
|
+
ownerPluginId: field("ownerPluginId", STRING),
|
|
90
|
+
label: field("meta.label", STRING),
|
|
91
|
+
},
|
|
92
|
+
meaning: {
|
|
93
|
+
id: field("id", STRING),
|
|
94
|
+
label: field("label", STRING),
|
|
95
|
+
type: field("type", STRING),
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
/** Discovery output schemas of the compact `RESOURCE.list` defaults. */
|
|
99
|
+
export function compactListOutputSchemas() {
|
|
100
|
+
return Object.fromEntries(Object.entries(COMPACT_LIST_FIELDS).map(([resource, fields,]) => [
|
|
101
|
+
`${resource}.list`,
|
|
102
|
+
{
|
|
103
|
+
type: "array",
|
|
104
|
+
items: {
|
|
105
|
+
type: "object",
|
|
106
|
+
additionalProperties: false,
|
|
107
|
+
properties: Object.fromEntries(Object.entries(fields).map(([name, spec,]) => [name, spec.schema,])),
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
]));
|
|
111
|
+
}
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical discovery output schemas, keyed by `resource.action`.
|
|
3
|
-
*
|
|
4
|
-
* TypeBox definitions from `packages/types` plus the inline literal schemas
|
|
5
|
-
* that exist only on the CLI side (code-env log envelope, code.run outcome,
|
|
6
|
-
* project-library payloads, notebook saves, sql.query handoff envelope).
|
|
7
|
-
* `scripts/generate-action-output-schemas.mjs` serializes this map into
|
|
8
|
-
* `src/generated/action-output-schemas.json`; discovery (src/cli/contract.ts)
|
|
9
|
-
* reads that generated JSON as plain data, so the TypeBox schema graph never
|
|
10
|
-
* loads on the discovery path. SDK validation keeps using the TypeBox schema
|
|
11
|
-
* objects from `packages/types` directly.
|
|
12
|
-
*
|
|
13
|
-
* Imported by the generator and the discovery parity test only.
|
|
14
|
-
*/
|
|
15
1
|
/**
|
|
16
2
|
* Canonical TypeBox-derived output schemas, keyed by `resource.action`. This is
|
|
17
3
|
* the single source of truth for `src/generated/action-output-schemas.json`,
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Imported by the generator and the discovery parity test only.
|
|
14
14
|
*/
|
|
15
|
+
import { compactListOutputSchemas, } from "./list-shapes.js";
|
|
15
16
|
const PROJECT_LIBRARY_ITEM_OUTPUT_SCHEMA = {
|
|
16
17
|
type: "object",
|
|
17
18
|
additionalProperties: false,
|
|
@@ -62,9 +63,8 @@ let commandOutputSchemas;
|
|
|
62
63
|
export function typeBoxCommandOutputSchemas() {
|
|
63
64
|
if (commandOutputSchemas)
|
|
64
65
|
return commandOutputSchemas;
|
|
65
|
-
const { CodeEnvDetailsSchema, CodeEnvLogSummaryArraySchema,
|
|
66
|
+
const { CodeEnvDetailsSchema, CodeEnvLogSummaryArraySchema, CodeEnvUsageArraySchema, CodeEnvVersionForProjectSchema, DatasetDetailsSchema, DatasetSchemaSchema, FlowZoneArraySchema, FlowZoneSchema, JobWaitResultSchema, JupyterNotebookContentSchema, JupyterNotebookSummaryArraySchema, NotebookSessionArraySchema, ProjectDetailsSchema, ProjectMetadataSchema, ScenarioDetailsSchema, ScenarioStatusSchema, SqlNotebookContentSchema, SqlNotebookHistorySchema, SqlNotebookSummaryArraySchema, SqlQueryResponseSchema, } = require("../schemas.js");
|
|
66
67
|
return commandOutputSchemas = {
|
|
67
|
-
"code-env.list": CodeEnvSummaryArraySchema,
|
|
68
68
|
"code-env.get": CodeEnvDetailsSchema,
|
|
69
69
|
"code-env.list-logs": CodeEnvLogSummaryArraySchema,
|
|
70
70
|
"code-env.get-log": {
|
|
@@ -196,17 +196,12 @@ export function typeBoxCommandOutputSchemas() {
|
|
|
196
196
|
maxLines: { type: "integer", minimum: 0, },
|
|
197
197
|
},
|
|
198
198
|
},
|
|
199
|
-
"project.list": ProjectSummaryArraySchema,
|
|
200
199
|
"project.get": ProjectDetailsSchema,
|
|
201
200
|
"project.metadata": ProjectMetadataSchema,
|
|
202
|
-
"dataset.list": DatasetSummaryArraySchema,
|
|
203
201
|
"dataset.get": DatasetDetailsSchema,
|
|
204
202
|
"dataset.schema": DatasetSchemaSchema,
|
|
205
|
-
"recipe.list": RecipeSummaryArraySchema,
|
|
206
|
-
"job.list": JobSummaryArraySchema,
|
|
207
203
|
"job.wait": JobWaitResultSchema,
|
|
208
204
|
"job.monitor": JobWaitResultSchema,
|
|
209
|
-
"scenario.list": ScenarioSummaryArraySchema,
|
|
210
205
|
"scenario.get": ScenarioDetailsSchema,
|
|
211
206
|
"scenario.status": ScenarioStatusSchema,
|
|
212
207
|
"flow-zone.list": FlowZoneArraySchema,
|
|
@@ -229,5 +224,7 @@ export function typeBoxCommandOutputSchemas() {
|
|
|
229
224
|
},
|
|
230
225
|
],
|
|
231
226
|
},
|
|
227
|
+
// `*.list` defaults to compact items; `--full` returns the DSS objects.
|
|
228
|
+
...compactListOutputSchemas(),
|
|
232
229
|
};
|
|
233
230
|
}
|
package/dist/src/cli/output.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export declare function pickResultFields(item: unknown, fields: string[]): unkno
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function projectResultFields(result: unknown, fields: string[], availableFieldNames?: () => string[]): unknown;
|
|
14
14
|
export declare function writeCommandResult(result: unknown): void;
|
|
15
|
-
export declare function transientBodyWithTargetContext(body: string, target: string, elapsedMs: number): string;
|
|
16
15
|
export declare function addTransientTargetContext(error: unknown, target: string, elapsedMs: number): never;
|
|
17
16
|
export declare function isFailedWaitResult(result: unknown): boolean;
|
|
18
17
|
export declare function isAssertionFailureResult(result: unknown): boolean;
|
package/dist/src/cli/output.js
CHANGED
|
@@ -34,6 +34,29 @@ function resolveFieldPath(source, field) {
|
|
|
34
34
|
}
|
|
35
35
|
return { found: true, value: current ?? null, };
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Keys available at the deepest parent object a dotted field actually reaches.
|
|
39
|
+
* A miss like `recipe.params` is ambiguous — the path may be unsupported or the
|
|
40
|
+
* key may merely be absent — so listing sibling keys under the resolved parent
|
|
41
|
+
* (`recipe.type`, `recipe.name`, ...) shows nested paths work and points at
|
|
42
|
+
* real alternatives; a plain top-level miss keeps listing top-level keys.
|
|
43
|
+
*/
|
|
44
|
+
function availableFieldsFor(records, field) {
|
|
45
|
+
const segments = field.split(".");
|
|
46
|
+
const parentPath = segments.slice(0, -1).join(".");
|
|
47
|
+
const keys = new Set();
|
|
48
|
+
for (const record of records) {
|
|
49
|
+
const parent = parentPath === ""
|
|
50
|
+
? record
|
|
51
|
+
: resolveFieldPath(record, parentPath).value;
|
|
52
|
+
if (parent === null || typeof parent !== "object" || Array.isArray(parent))
|
|
53
|
+
continue;
|
|
54
|
+
for (const key of Object.keys(parent)) {
|
|
55
|
+
keys.add(parentPath === "" ? key : `${parentPath}.${key}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return [...keys,].sort();
|
|
59
|
+
}
|
|
37
60
|
export function pickResultFields(item, fields) {
|
|
38
61
|
if (!item || typeof item !== "object" || Array.isArray(item))
|
|
39
62
|
return item;
|
|
@@ -54,8 +77,9 @@ function warnUnknownProjectionFields(result, fields, availableFieldNames) {
|
|
|
54
77
|
const unknownFields = fields.filter((field) => !records.some((record) => resolveFieldPath(record, field).found));
|
|
55
78
|
if (unknownFields.length === 0)
|
|
56
79
|
return;
|
|
57
|
-
const
|
|
58
|
-
|
|
80
|
+
const explicitNames = availableFieldNames?.();
|
|
81
|
+
const availableFields = explicitNames
|
|
82
|
+
?? [...new Set(unknownFields.flatMap((field) => availableFieldsFor(records, field))),].sort();
|
|
59
83
|
enqueueCliWarning({
|
|
60
84
|
code: "field_projection_missing",
|
|
61
85
|
fields: unknownFields,
|
|
@@ -81,25 +105,9 @@ export function writeCommandResult(result) {
|
|
|
81
105
|
flushCliWarnings();
|
|
82
106
|
process.stdout.write(`${JSON.stringify(projected ?? { ok: true, })}\n`);
|
|
83
107
|
}
|
|
84
|
-
export function transientBodyWithTargetContext(body, target, elapsedMs) {
|
|
85
|
-
try {
|
|
86
|
-
const parsed = JSON.parse(body);
|
|
87
|
-
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
88
|
-
const record = parsed;
|
|
89
|
-
const message = typeof record.message === "string" && record.message.length > 0
|
|
90
|
-
? `Target: ${target}\nElapsed: ${elapsedMs}ms\n${record.message}`
|
|
91
|
-
: `Target: ${target}\nElapsed: ${elapsedMs}ms`;
|
|
92
|
-
return JSON.stringify({ ...record, message, target, elapsedMs, });
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
catch {
|
|
96
|
-
// Non-JSON DSS bodies are wrapped as text below.
|
|
97
|
-
}
|
|
98
|
-
return `Target: ${target}\nElapsed: ${elapsedMs}ms\n${body}`;
|
|
99
|
-
}
|
|
100
108
|
export function addTransientTargetContext(error, target, elapsedMs) {
|
|
101
109
|
if (error instanceof DataikuError && error.category === "transient") {
|
|
102
|
-
throw new DataikuError(error.status, error.statusText,
|
|
110
|
+
throw new DataikuError(error.status, error.statusText, error.body, error.retry, error.requestId, { target, elapsedMs, bodyTruncated: error.bodyTruncated, });
|
|
103
111
|
}
|
|
104
112
|
throw error;
|
|
105
113
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type CommandRegistryEntry } from "./contract.js";
|
|
2
|
+
import type { CommandMeta } from "./types.js";
|
|
3
|
+
export declare function commandPlanShape(resource: string, action: string, args: string[], flags: Record<string, string | boolean>, entry: CommandRegistryEntry, projectKey: string | undefined): {
|
|
4
|
+
endpoint?: string;
|
|
5
|
+
exact?: boolean;
|
|
6
|
+
identifiers?: Record<string, unknown>;
|
|
7
|
+
method?: string;
|
|
8
|
+
payload?: unknown;
|
|
9
|
+
localWrites?: unknown;
|
|
10
|
+
reason?: string;
|
|
11
|
+
wait?: unknown;
|
|
12
|
+
requests?: unknown;
|
|
13
|
+
};
|
|
14
|
+
export declare function buildMutationPlan(resource: string, action: string, meta: CommandMeta, args: string[], flags: Record<string, string | boolean>): Record<string, unknown>;
|