dataiku-sdk 3.6.1 → 3.8.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.
Files changed (139) hide show
  1. package/README.md +14 -6
  2. package/bin/bun-version.js +14 -0
  3. package/bin/dss.js +11 -15
  4. package/dist/build-metadata.json +1 -1
  5. package/dist/packages/types/src/index.d.ts +114 -5
  6. package/dist/packages/types/src/index.js +75 -2
  7. package/dist/src/cli/coerce.d.ts +2 -0
  8. package/dist/src/cli/coerce.js +20 -16
  9. package/dist/src/cli/command-syntax.json +3369 -144
  10. package/dist/src/cli/commands/analysis.js +19 -1
  11. package/dist/src/cli/commands/bundle.js +22 -0
  12. package/dist/src/cli/commands/connection.js +26 -2
  13. package/dist/src/cli/commands/data-quality.js +33 -1
  14. package/dist/src/cli/commands/dataset.js +76 -9
  15. package/dist/src/cli/commands/discussion.js +15 -0
  16. package/dist/src/cli/commands/doctor.js +1 -1
  17. package/dist/src/cli/commands/flow-zone.js +241 -46
  18. package/dist/src/cli/commands/flow.d.ts +5 -0
  19. package/dist/src/cli/commands/flow.js +57 -0
  20. package/dist/src/cli/commands/future.js +8 -0
  21. package/dist/src/cli/commands/index.js +6 -0
  22. package/dist/src/cli/commands/job.js +44 -6
  23. package/dist/src/cli/commands/metrics.js +21 -1
  24. package/dist/src/cli/commands/ml-task.d.ts +5 -0
  25. package/dist/src/cli/commands/ml-task.js +86 -16
  26. package/dist/src/cli/commands/mlflow.d.ts +11 -0
  27. package/dist/src/cli/commands/mlflow.js +121 -0
  28. package/dist/src/cli/commands/plugin.js +5 -11
  29. package/dist/src/cli/commands/project-deployer.js +70 -0
  30. package/dist/src/cli/commands/project-library.js +2 -5
  31. package/dist/src/cli/commands/project.js +8 -0
  32. package/dist/src/cli/commands/recipe.d.ts +13 -0
  33. package/dist/src/cli/commands/recipe.js +130 -7
  34. package/dist/src/cli/commands/saved-model.d.ts +1 -1
  35. package/dist/src/cli/commands/saved-model.js +9 -76
  36. package/dist/src/cli/commands/streaming-endpoint.js +30 -1
  37. package/dist/src/cli/commands/webapp.js +8 -0
  38. package/dist/src/cli/commands/wiki.js +78 -0
  39. package/dist/src/cli/commands/workspace.js +8 -0
  40. package/dist/src/cli/contract.d.ts +16 -15
  41. package/dist/src/cli/contract.js +150 -3407
  42. package/dist/src/cli/doctor.d.ts +13 -0
  43. package/dist/src/cli/doctor.js +43 -1
  44. package/dist/src/cli/flags.d.ts +14 -1
  45. package/dist/src/cli/flags.js +106 -8
  46. package/dist/src/cli/helpers/app-successor.js +1 -2
  47. package/dist/src/cli/helpers/dataset.d.ts +12 -0
  48. package/dist/src/cli/helpers/dataset.js +36 -0
  49. package/dist/src/cli/helpers/documentation.d.ts +21 -0
  50. package/dist/src/cli/helpers/documentation.js +53 -0
  51. package/dist/src/cli/helpers/flow-zone.d.ts +21 -0
  52. package/dist/src/cli/helpers/flow-zone.js +144 -4
  53. package/dist/src/cli/helpers/trained-model.d.ts +26 -0
  54. package/dist/src/cli/helpers/trained-model.js +144 -0
  55. package/dist/src/cli/list-output.d.ts +7 -0
  56. package/dist/src/cli/list-output.js +77 -0
  57. package/dist/src/cli/list-shapes.d.ts +21 -0
  58. package/dist/src/cli/list-shapes.js +111 -0
  59. package/dist/src/cli/output-schemas.d.ts +0 -14
  60. package/dist/src/cli/output-schemas.js +4 -7
  61. package/dist/src/cli/output.d.ts +0 -1
  62. package/dist/src/cli/output.js +33 -19
  63. package/dist/src/cli/plans.d.ts +14 -0
  64. package/dist/src/cli/plans.js +3740 -0
  65. package/dist/src/cli/types.d.ts +2 -0
  66. package/dist/src/cli/usage.d.ts +7 -0
  67. package/dist/src/cli/usage.js +20 -1
  68. package/dist/src/cli/version.d.ts +2 -2
  69. package/dist/src/cli/version.js +2 -2
  70. package/dist/src/cli.js +137 -115
  71. package/dist/src/client.d.ts +52 -43
  72. package/dist/src/client.js +267 -96
  73. package/dist/src/errors.d.ts +22 -2
  74. package/dist/src/errors.js +49 -50
  75. package/dist/src/generated/action-output-schemas.json +345 -89
  76. package/dist/src/index.d.ts +5 -1
  77. package/dist/src/index.js +3 -0
  78. package/dist/src/resources/analyses.d.ts +8 -0
  79. package/dist/src/resources/analyses.js +13 -1
  80. package/dist/src/resources/bundles.d.ts +34 -0
  81. package/dist/src/resources/bundles.js +67 -0
  82. package/dist/src/resources/connections.d.ts +9 -0
  83. package/dist/src/resources/connections.js +15 -0
  84. package/dist/src/resources/data-quality.d.ts +20 -0
  85. package/dist/src/resources/data-quality.js +30 -0
  86. package/dist/src/resources/dataset-create.d.ts +38 -0
  87. package/dist/src/resources/dataset-create.js +135 -0
  88. package/dist/src/resources/datasets.d.ts +46 -15
  89. package/dist/src/resources/datasets.js +120 -112
  90. package/dist/src/resources/discussions.d.ts +5 -0
  91. package/dist/src/resources/discussions.js +7 -0
  92. package/dist/src/resources/documentation.d.ts +25 -0
  93. package/dist/src/resources/documentation.js +16 -0
  94. package/dist/src/resources/flow-zones.d.ts +29 -3
  95. package/dist/src/resources/flow-zones.js +53 -3
  96. package/dist/src/resources/flow.d.ts +48 -0
  97. package/dist/src/resources/flow.js +65 -0
  98. package/dist/src/resources/futures.d.ts +23 -0
  99. package/dist/src/resources/futures.js +32 -0
  100. package/dist/src/resources/jobs.d.ts +34 -0
  101. package/dist/src/resources/jobs.js +170 -3
  102. package/dist/src/resources/metrics.d.ts +10 -0
  103. package/dist/src/resources/metrics.js +10 -0
  104. package/dist/src/resources/ml-tasks.d.ts +65 -2
  105. package/dist/src/resources/ml-tasks.js +102 -28
  106. package/dist/src/resources/mlflow-extension.d.ts +73 -0
  107. package/dist/src/resources/mlflow-extension.js +105 -0
  108. package/dist/src/resources/projects.d.ts +15 -0
  109. package/dist/src/resources/projects.js +18 -3
  110. package/dist/src/resources/recipe-create.d.ts +79 -0
  111. package/dist/src/resources/recipe-create.js +454 -0
  112. package/dist/src/resources/recipes.d.ts +28 -29
  113. package/dist/src/resources/recipes.js +201 -267
  114. package/dist/src/resources/saved-models.d.ts +10 -6
  115. package/dist/src/resources/saved-models.js +16 -14
  116. package/dist/src/resources/scenarios.js +8 -14
  117. package/dist/src/resources/sql.js +52 -13
  118. package/dist/src/resources/streaming-endpoints.d.ts +12 -0
  119. package/dist/src/resources/streaming-endpoints.js +15 -0
  120. package/dist/src/resources/trained-model.d.ts +60 -0
  121. package/dist/src/resources/trained-model.js +98 -0
  122. package/dist/src/resources/webapps.d.ts +8 -0
  123. package/dist/src/resources/webapps.js +10 -0
  124. package/dist/src/resources/wiki.d.ts +52 -1
  125. package/dist/src/resources/wiki.js +96 -0
  126. package/dist/src/resources/workspaces.d.ts +2 -0
  127. package/dist/src/resources/workspaces.js +4 -0
  128. package/dist/src/utils/flow-analysis.js +4 -0
  129. package/dist/src/utils/response-file.js +20 -9
  130. package/dist/src/utils/secret-sanitize.d.ts +7 -0
  131. package/dist/src/utils/secret-sanitize.js +46 -0
  132. package/package.json +25 -26
  133. package/plugin.json +1 -1
  134. package/skills/dataiku-dss/SKILL.md +1 -1
  135. package/skills/dataiku-dss/references/authentication.md +3 -1
  136. package/skills/dataiku-dss/references/coding.md +1 -0
  137. package/skills/dataiku-dss/references/discovery.md +4 -6
  138. package/skills/dataiku-dss/references/flow-maps.md +2 -2
  139. package/skills/dataiku-dss/references/troubleshooting.md +3 -2
package/README.md CHANGED
@@ -4,7 +4,7 @@ Agent-only TypeScript SDK and `dss` CLI for Dataiku DSS automation.
4
4
 
5
5
  ## API coverage
6
6
 
7
- The SDK and CLI include scenario run management; project, recipe, and dataset metadata; managed datasets, lineage, and table imports; external saved models and MLflow imports; LLM completions and embeddings; knowledge banks; project folders and data collections; users, groups, connections, macros, and plugin administration. Discover exact inputs with `dss commands run` and scoped command contracts rather than assuming flags from API field names. MLflow archive/folder imports and evaluations resolve the external container config explicitly: DSS 15 requires the `containerExecConfigName` parameter, so the SDK/CLI send `NONE` rather than omitting it (the plan surface matches the executed request).
7
+ The SDK and CLI include scenario run management; project, recipe, and dataset metadata; managed datasets, lineage, and table imports; flow schema propagation and documentation; grouping and prepare recipes built from flags; Visual ML tasks, model diagnostics (subpopulation analyses, partial dependencies, time series residuals) and model documentation for lab models and saved-model versions; external saved models, MLflow imports, and the MLflow experiment-tracking extension; Project Deployer infrastructures, deployments, and published projects; LLM completions and embeddings; knowledge banks; project folders and data collections; users, groups, connections, macros, and plugin administration. Discover exact inputs with `dss commands run` and scoped command contracts rather than assuming flags from API field names. MLflow archive/folder imports and evaluations resolve the external container config explicitly: DSS 15 requires the `containerExecConfigName` parameter, so the SDK/CLI send `NONE` rather than omitting it (the plan surface matches the executed request).
8
8
 
9
9
  The [DSS 15 coverage matrix](docs/API-COVERAGE-DSS-15.md) maps documented operations to SDK methods and CLI actions, records documentation discrepancies, and identifies remaining gaps. A [machine-readable matrix](docs/API-COVERAGE-DSS-15.json) is also available. Coverage is not full DSS parity or live compatibility certification: availability depends on DSS version, permissions, licensing, and installed capabilities. One known documentation discrepancy: `plugin git-branches` is served by GET on DSS 15 (the same route rejects POST with 405 `rawMethodPOSTnotsupported`, contrary to the public docs).
10
10
 
@@ -16,7 +16,7 @@ Malformed user/group listings and scenario run histories fail explicitly instead
16
16
 
17
17
  ## Platform support
18
18
 
19
- The published `dss` CLI requires Bun >= 1.4.0 and supports Linux, macOS, and Windows. CI runs the minimum (Bun 1.4.0) and the latest release (1.4.2) on all three operating systems. The runtime dependency is pure JavaScript, so the same package also runs on every Bun-supported x64 and ARM64 system.
19
+ The published `dss` CLI requires Bun >= 1.4.2 and supports Linux, macOS, and Windows. CI runs Bun 1.4.2 on all three operating systems. The runtime dependency is pure JavaScript, so the same package also runs on every Bun-supported x64 and ARM64 system.
20
20
 
21
21
  Run directly with Bun:
22
22
 
@@ -29,7 +29,7 @@ Or install the npm binary:
29
29
  ```text
30
30
  npm install --global dataiku-sdk
31
31
  ```
32
- The installed `dss` bin bootstraps Bun with automatic `.env` preloading disabled, so Bun >= 1.4.0 must be on `PATH`; the CLI's own `.env` handling stays authoritative. `bunx --bun` forces Bun's Node-compatibility mode, which provides the same no-preload guarantee across operating systems.
32
+ The installed `dss` bin bootstraps Bun with automatic `.env` preloading disabled, so Bun >= 1.4.2 must be on `PATH`; the CLI's own `.env` handling stays authoritative. `bunx --bun` forces Bun's Node-compatibility mode, which provides the same no-preload guarantee across operating systems.
33
33
 
34
34
  Bun is the only supported runtime and the package manager. Examples below assume an installed `dss` binary. From a checkout, use `bun --no-env-file src/cli.ts ...` or the packaged launcher `bun --no-env-file ./bin/dss.js ...`. From another working directory, pass the checkout's absolute `bin/dss.js` path to Bun.
35
35
  `--no-env-file` disables Bun's automatic preloading only; the CLI still applies its documented `.env` handling unless `DATAIKU_DISABLE_ENV=1` is set.
@@ -201,21 +201,29 @@ essentials: exactly one compact JSON value on stdout per command (void success i
201
201
  failures as one structured JSON error object on stdout with a nonzero exit code, stderr reserved
202
202
  for JSONL diagnostics only, and exit codes `0` success / `1` usage error / `2` DSS or internal
203
203
  error / `3` transient DSS error / `4` failed long-running result or assertion. `--retries N`
204
- controls idempotent GET retries only; `dss sql query --start-retries N` retries transient failures
204
+ controls idempotent GET retries only, and only transient failures (408/425/429, 5xx without a known
205
+ non-transient cause, connection resets, timeouts) are retried: a refused connection, unknown host,
206
+ bad URL, or untrusted certificate fails at once. `dss sql query --start-retries N` retries transient failures
205
207
  while starting a query. For portable multi-step mutations, prefer `dss batch`; shell chaining and
206
208
  pipeline exit semantics differ across platforms.
207
209
 
210
+ `*.list` commands print compact items (identifiers, kind, next-step fields) by default; `--full`
211
+ returns the DSS objects, `--contains TEXT` filters on identifiers, and `--limit N` caps the count
212
+ with a `list_truncated` warning.
213
+
208
214
  Discover the command surface with scoped calls:
209
215
 
210
216
  ```text
211
217
  dss commands run
218
+ dss commands run --contains "propagate schema"
212
219
  dss commands run --fields dataset.create.usage,dataset.create.description,dataset.create.flags,dataset.create.examples
213
220
  dss commands run --output commands.json
214
221
  dss agent contract --fields protocol,agentContractVersion,cli,stdio,planning,compatibility
215
222
  ```
216
223
 
217
- `dss commands run` prints the compact resource/action summary; registry entries never dump to stdout — they travel only via `--output PATH`. See the canonical skill for
218
- the full `--fields` projection rules and planning workflow.
224
+ `dss commands run` prints the compact resource/action summary, and `--contains TEXT` finds the top 5
225
+ actions for a concept; registry entries never dump to stdout — they travel only via `--output PATH`.
226
+ See the canonical skill for the full `--fields` projection rules and planning workflow.
219
227
 
220
228
  ## Agent skill installation
221
229
 
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Whether a Bun version string is at least `minimum`, comparing only the
3
+ * release part (major.minor.patch). Canary builds print e.g.
4
+ * `1.4.3-canary.12+abc`; npm-style semver ranges (and Bun.semver) reject every
5
+ * prerelease, which would lock out anyone on a canary channel.
6
+ */
7
+ export function versionAtLeast(actual, minimum,) {
8
+ const a = actual.split(/[-+]/,)[0].split(".",).map(Number,);
9
+ const m = minimum.split(".",).map(Number,);
10
+ for (let i = 0; i < m.length; i++) {
11
+ if ((a[i] ?? 0) !== m[i]) return (a[i] ?? 0) > m[i];
12
+ }
13
+ return true;
14
+ }
package/bin/dss.js CHANGED
@@ -7,6 +7,7 @@ import { spawnSync, } from "node:child_process";
7
7
  import { readFileSync, } from "node:fs";
8
8
  import * as path from "node:path";
9
9
  import { fileURLToPath, pathToFileURL, } from "node:url";
10
+ import { versionAtLeast, } from "./bun-version.js";
10
11
 
11
12
  const runningUnderBun = typeof process.versions.bun === "string";
12
13
  const bunNodeCompatibilityMode = runningUnderBun
@@ -25,17 +26,6 @@ const MINIMUM_BUN = JSON.parse(
25
26
  readFileSync(fileURLToPath(new URL("../package.json", import.meta.url,),), "utf-8",),
26
27
  ).engines.bun.replace(/^>=/, "",);
27
28
 
28
- /** Whether dotted version `actual` is >= `minimum` (numeric per part). */
29
- function versionAtLeast(actual, minimum,) {
30
- // Compare the release part only: canary builds print e.g. 1.4.3-canary.12+abc.
31
- const a = actual.split(/[-+]/,)[0].split(".",).map(Number,);
32
- const m = minimum.split(".",).map(Number,);
33
- for (let i = 0; i < m.length; i++) {
34
- if ((a[i] ?? 0) !== m[i]) return (a[i] ?? 0) > m[i];
35
- }
36
- return true;
37
- }
38
-
39
29
  if (!runningUnderBun) {
40
30
  // Check before spawning: an old Bun may reject --no-env-file during argument
41
31
  // parsing, before any launcher code could report a JSON error.
@@ -47,7 +37,11 @@ if (!runningUnderBun) {
47
37
  ["--no-env-file", fileURLToPath(import.meta.url,), ...process.argv.slice(2,),],
48
38
  { stdio: "inherit", env: process.env, },
49
39
  )
50
- : { error: new Error(found ? `Bun ${found} is older than ${MINIMUM_BUN}.` : "bun not found",), };
40
+ : {
41
+ error: new Error(
42
+ found ? `Bun ${found} is older than the required ${MINIMUM_BUN}.` : "bun not found",
43
+ ),
44
+ };
51
45
  if (result.error) {
52
46
  process.stdout.write(`${
53
47
  JSON.stringify({
@@ -57,7 +51,9 @@ if (!runningUnderBun) {
57
51
  code: "internal_error",
58
52
  category: "internal",
59
53
  exitCode: 2,
60
- hint: `Install Bun >= ${MINIMUM_BUN} and ensure \`bun\` is on PATH.`,
54
+ hint: found
55
+ ? `Update Bun to ${MINIMUM_BUN} or newer: run \`bun upgrade\`.`
56
+ : `Install Bun ${MINIMUM_BUN} or newer (https://bun.sh) and ensure \`bun\` is on PATH.`,
61
57
  },)
62
58
  }\n`,);
63
59
  process.exitCode = 2;
@@ -66,7 +62,7 @@ if (!runningUnderBun) {
66
62
  } else {
67
63
  process.exitCode = result.status ?? 1;
68
64
  }
69
- } else if (!Bun.semver.satisfies(Bun.version, `>=${MINIMUM_BUN}`,)) {
65
+ } else if (!versionAtLeast(Bun.version, MINIMUM_BUN,)) {
70
66
  process.stdout.write(`${
71
67
  JSON.stringify({
72
68
  type: "error",
@@ -75,7 +71,7 @@ if (!runningUnderBun) {
75
71
  code: "internal_error",
76
72
  category: "internal",
77
73
  exitCode: 2,
78
- hint: `Upgrade Bun to >= ${MINIMUM_BUN} (bun upgrade).`,
74
+ hint: `Update Bun to ${MINIMUM_BUN} or newer: run \`bun upgrade\`.`,
79
75
  },)
80
76
  }\n`,);
81
77
  process.exitCode = 2;
@@ -1 +1 @@
1
- {"format":1,"buildRevision":"dae7b426ec392ff4a62bcf07fab199e02080a0f6"}
1
+ {"format":1,"buildRevision":"6814ed4e3da988eccd85f9f50d79e1da66253b0a"}
@@ -124,6 +124,7 @@ export declare const DatasetCreateOptionsSchema: import("@sinclair/typebox").TOb
124
124
  table: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
125
125
  dbSchema: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
126
126
  catalog: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
127
+ query: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
127
128
  formatType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
128
129
  formatParams: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
129
130
  managed: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
@@ -166,20 +167,101 @@ export declare const RecipeCreateOptionsSchema: import("@sinclair/typebox").TObj
166
167
  fuzzyNormalize: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
167
168
  projectKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
168
169
  outputFolder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
170
+ /** Grouping: key columns. */
171
+ groupBy: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
172
+ /** Grouping: `COL:FN[+FN]` specs (count, countDistinct, sum, avg, min, max, median, stddev, first, last, concat, ...). */
173
+ aggregate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
174
+ /** Grouping: ordering column for first/last aggregates. */
175
+ orderBy: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
176
+ /** Prepare: `OLD=NEW` column renames. */
177
+ rename: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
178
+ /** Prepare: `COL=VALUE` fills for empty cells. */
179
+ fillEmpty: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
180
+ /** Prepare: one `NAME=GREL_EXPRESSION` computed column. */
181
+ formula: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
182
+ /** Prepare: keep only rows where this GREL expression is true. */
183
+ filter: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
184
+ /** Prepare: columns to remove. */
185
+ dropColumns: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
186
+ /** Prepare: the only columns to keep. */
187
+ keepColumns: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
188
+ /**
189
+ * Prepare: order of the option groups (`rename`, `fillEmpty`, `formula`, `filter`,
190
+ * `dropColumns`, `keepColumns`); the CLI passes the order the flags were typed in.
191
+ * Groups left out follow in that default order.
192
+ */
193
+ stepOrder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
169
194
  }>;
170
195
  export type RecipeCreateOptions = Static<typeof RecipeCreateOptionsSchema>;
171
196
  export declare const RecipeCreateResultSchema: import("@sinclair/typebox").TObject<{
172
197
  recipeName: import("@sinclair/typebox").TString;
198
+ /** The `--name` that was asked for, present only when DSS created the recipe under a different name. */
199
+ requestedName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
173
200
  type: import("@sinclair/typebox").TString;
174
201
  createdDatasets: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
175
202
  joinConfigured: import("@sinclair/typebox").TBoolean;
203
+ /** Grouping keys/aggregates or prepare steps from flags were written to the payload. */
204
+ payloadConfigured: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
176
205
  outputProvisioningFallbackUsed: import("@sinclair/typebox").TBoolean;
177
206
  outputFolder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
178
207
  temporaryOutputDataset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
179
208
  temporaryOutputDatasetDeleted: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
180
- syncOutputSchemaPropagated: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
209
+ /** Output datasets whose schema DSS computed and the client applied after creation. */
210
+ outputSchemaUpdated: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
211
+ /** Why DSS could not compute the output schema; the recipe itself was created. */
212
+ outputSchemaUpdateError: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
181
213
  }>;
182
214
  export type RecipeCreateResult = Static<typeof RecipeCreateResultSchema>;
215
+ /** One output from GET /recipes/{name}/schema-update (dataikuapi compute_schema_updates). */
216
+ export declare const RecipeSchemaUpdateComputableSchema: import("@sinclair/typebox").TObject<{
217
+ type: import("@sinclair/typebox").TString;
218
+ id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
219
+ datasetName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
220
+ previousSchemaWasEmpty: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
221
+ incompatibilities: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
222
+ newSchema: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
223
+ columns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
224
+ }>>;
225
+ }>;
226
+ export type RecipeSchemaUpdateComputable = Static<typeof RecipeSchemaUpdateComputableSchema>;
227
+ export declare const RecipeSchemaUpdatesSchema: import("@sinclair/typebox").TObject<{
228
+ totalIncompatibilities: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
229
+ computables: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
230
+ type: import("@sinclair/typebox").TString;
231
+ id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
232
+ datasetName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
233
+ previousSchemaWasEmpty: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
234
+ incompatibilities: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
235
+ newSchema: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
236
+ columns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
237
+ }>>;
238
+ }>>;
239
+ recipeChanges: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>>;
240
+ }>;
241
+ export type RecipeSchemaUpdates = Static<typeof RecipeSchemaUpdatesSchema>;
242
+ export declare const RecipeUpdateSchemaResultSchema: import("@sinclair/typebox").TObject<{
243
+ recipeName: import("@sinclair/typebox").TString;
244
+ /** Output ids whose schema was replaced by the DSS-computed schema. */
245
+ updated: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
246
+ /** Output ids whose schema differs from the computed one but was left as is (`derivedOutputs`, `dryRun`). */
247
+ pending: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
248
+ /** Output ids whose current schema already matches. */
249
+ unchanged: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
250
+ totalIncompatibilities: import("@sinclair/typebox").TNumber;
251
+ computables: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
252
+ type: import("@sinclair/typebox").TString;
253
+ id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
254
+ datasetName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
255
+ previousSchemaWasEmpty: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
256
+ incompatibilities: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
257
+ newSchema: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
258
+ columns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
259
+ }>>;
260
+ }>>;
261
+ /** `datasetsNeedingAction` entries from the DSS apply responses. */
262
+ datasetsNeedingAction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>>;
263
+ }>;
264
+ export type RecipeUpdateSchemaResult = Static<typeof RecipeUpdateSchemaResultSchema>;
183
265
  export declare const JobSummarySchema: import("@sinclair/typebox").TObject<{
184
266
  def: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
185
267
  id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -457,14 +539,15 @@ export declare const FlowZoneCreateOptionsSchema: import("@sinclair/typebox").TO
457
539
  }>>;
458
540
  }>;
459
541
  export type FlowZoneCreateOptions = Static<typeof FlowZoneCreateOptionsSchema>;
542
+ /**
543
+ * DSS's public `PUT /flow/zones/{id}` persists name and color but silently
544
+ * ignores `position`; repositioning an existing zone goes through
545
+ * `flowZones.recreate`, which creates a replacement zone at the new position.
546
+ */
460
547
  export declare const FlowZoneUpdateOptionsSchema: import("@sinclair/typebox").TObject<{
461
548
  name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
462
549
  color: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
463
550
  projectKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
464
- position: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
465
- x: import("@sinclair/typebox").TNumber;
466
- y: import("@sinclair/typebox").TNumber;
467
- }>>;
468
551
  }>;
469
552
  export type FlowZoneUpdateOptions = Static<typeof FlowZoneUpdateOptionsSchema>;
470
553
  export declare const FolderCreateOptionsSchema: import("@sinclair/typebox").TObject<{
@@ -602,10 +685,24 @@ export declare const WikiSettingsSchema: import("@sinclair/typebox").TObject<{
602
685
  homeArticleId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
603
686
  }>;
604
687
  export type WikiSettings = Static<typeof WikiSettingsSchema>;
688
+ /** One entry of a wiki article's `attachments` (uploaded FILE or linked DSS object). */
689
+ export declare const WikiArticleAttachmentSchema: import("@sinclair/typebox").TObject<{
690
+ attachmentType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
691
+ smartId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
692
+ taggableType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
693
+ details: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
694
+ }>;
695
+ export type WikiArticleAttachment = Static<typeof WikiArticleAttachmentSchema>;
605
696
  export declare const WikiArticleMetadataSchema: import("@sinclair/typebox").TObject<{
606
697
  id: import("@sinclair/typebox").TString;
607
698
  name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
608
699
  projectKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
700
+ attachments: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
701
+ attachmentType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
702
+ smartId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
703
+ taggableType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
704
+ details: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
705
+ }>>>;
609
706
  }>;
610
707
  export type WikiArticleMetadata = Static<typeof WikiArticleMetadataSchema>;
611
708
  export declare const WikiArticleDataSchema: import("@sinclair/typebox").TObject<{
@@ -613,6 +710,12 @@ export declare const WikiArticleDataSchema: import("@sinclair/typebox").TObject<
613
710
  id: import("@sinclair/typebox").TString;
614
711
  name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
615
712
  projectKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
713
+ attachments: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
714
+ attachmentType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
715
+ smartId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
716
+ taggableType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
717
+ details: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
718
+ }>>>;
616
719
  }>;
617
720
  payload: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
618
721
  }>;
@@ -998,6 +1101,12 @@ export declare const WikiArticleDataArraySchema: import("@sinclair/typebox").TAr
998
1101
  id: import("@sinclair/typebox").TString;
999
1102
  name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
1000
1103
  projectKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
1104
+ attachments: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
1105
+ attachmentType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
1106
+ smartId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
1107
+ taggableType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
1108
+ details: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
1109
+ }>>>;
1001
1110
  }>;
1002
1111
  payload: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
1003
1112
  }>>;
@@ -169,6 +169,7 @@ export const DatasetCreateOptionsSchema = Type.Object({
169
169
  table: Type.Optional(Type.String()),
170
170
  dbSchema: Type.Optional(Type.String()),
171
171
  catalog: Type.Optional(Type.String()),
172
+ query: Type.Optional(Type.String()),
172
173
  formatType: Type.Optional(Type.String()),
173
174
  formatParams: Type.Optional(Type.Record(Type.String(), Type.Unknown())),
174
175
  managed: Type.Optional(Type.Boolean()),
@@ -211,17 +212,77 @@ export const RecipeCreateOptionsSchema = Type.Object({
211
212
  fuzzyNormalize: Type.Optional(Type.Boolean()),
212
213
  projectKey: Type.Optional(Type.String()),
213
214
  outputFolder: Type.Optional(Type.String()),
215
+ /** Grouping: key columns. */
216
+ groupBy: Type.Optional(Type.Array(Type.String())),
217
+ /** Grouping: `COL:FN[+FN]` specs (count, countDistinct, sum, avg, min, max, median, stddev, first, last, concat, ...). */
218
+ aggregate: Type.Optional(Type.Array(Type.String())),
219
+ /** Grouping: ordering column for first/last aggregates. */
220
+ orderBy: Type.Optional(Type.String()),
221
+ /** Prepare: `OLD=NEW` column renames. */
222
+ rename: Type.Optional(Type.Array(Type.String())),
223
+ /** Prepare: `COL=VALUE` fills for empty cells. */
224
+ fillEmpty: Type.Optional(Type.Array(Type.String())),
225
+ /** Prepare: one `NAME=GREL_EXPRESSION` computed column. */
226
+ formula: Type.Optional(Type.String()),
227
+ /** Prepare: keep only rows where this GREL expression is true. */
228
+ filter: Type.Optional(Type.String()),
229
+ /** Prepare: columns to remove. */
230
+ dropColumns: Type.Optional(Type.Array(Type.String())),
231
+ /** Prepare: the only columns to keep. */
232
+ keepColumns: Type.Optional(Type.Array(Type.String())),
233
+ /**
234
+ * Prepare: order of the option groups (`rename`, `fillEmpty`, `formula`, `filter`,
235
+ * `dropColumns`, `keepColumns`); the CLI passes the order the flags were typed in.
236
+ * Groups left out follow in that default order.
237
+ */
238
+ stepOrder: Type.Optional(Type.Array(Type.String())),
214
239
  });
215
240
  export const RecipeCreateResultSchema = Type.Object({
216
241
  recipeName: Type.String(),
242
+ /** The `--name` that was asked for, present only when DSS created the recipe under a different name. */
243
+ requestedName: Type.Optional(Type.String()),
217
244
  type: Type.String(),
218
245
  createdDatasets: Type.Array(Type.String()),
219
246
  joinConfigured: Type.Boolean(),
247
+ /** Grouping keys/aggregates or prepare steps from flags were written to the payload. */
248
+ payloadConfigured: Type.Optional(Type.Boolean()),
220
249
  outputProvisioningFallbackUsed: Type.Boolean(),
221
250
  outputFolder: Type.Optional(Type.String()),
222
251
  temporaryOutputDataset: Type.Optional(Type.String()),
223
252
  temporaryOutputDatasetDeleted: Type.Optional(Type.Boolean()),
224
- syncOutputSchemaPropagated: Type.Optional(Type.Array(Type.String())),
253
+ /** Output datasets whose schema DSS computed and the client applied after creation. */
254
+ outputSchemaUpdated: Type.Optional(Type.Array(Type.String())),
255
+ /** Why DSS could not compute the output schema; the recipe itself was created. */
256
+ outputSchemaUpdateError: Type.Optional(Type.String()),
257
+ });
258
+ /** One output from GET /recipes/{name}/schema-update (dataikuapi compute_schema_updates). */
259
+ export const RecipeSchemaUpdateComputableSchema = Type.Object({
260
+ type: Type.String(),
261
+ id: Type.Optional(Type.String()),
262
+ datasetName: Type.Optional(Type.String()),
263
+ previousSchemaWasEmpty: Type.Optional(Type.Boolean()),
264
+ incompatibilities: Type.Optional(Type.Array(Type.String())),
265
+ newSchema: Type.Optional(Type.Object({
266
+ columns: Type.Array(Type.Record(Type.String(), Type.Unknown())),
267
+ }, { additionalProperties: true, })),
268
+ }, { additionalProperties: true, });
269
+ export const RecipeSchemaUpdatesSchema = Type.Object({
270
+ totalIncompatibilities: Type.Optional(Type.Number()),
271
+ computables: Type.Array(RecipeSchemaUpdateComputableSchema),
272
+ recipeChanges: Type.Optional(Type.Array(Type.Unknown())),
273
+ }, { additionalProperties: true, });
274
+ export const RecipeUpdateSchemaResultSchema = Type.Object({
275
+ recipeName: Type.String(),
276
+ /** Output ids whose schema was replaced by the DSS-computed schema. */
277
+ updated: Type.Array(Type.String()),
278
+ /** Output ids whose schema differs from the computed one but was left as is (`derivedOutputs`, `dryRun`). */
279
+ pending: Type.Array(Type.String()),
280
+ /** Output ids whose current schema already matches. */
281
+ unchanged: Type.Array(Type.String()),
282
+ totalIncompatibilities: Type.Number(),
283
+ computables: Type.Array(RecipeSchemaUpdateComputableSchema),
284
+ /** `datasetsNeedingAction` entries from the DSS apply responses. */
285
+ datasetsNeedingAction: Type.Optional(Type.Array(Type.Unknown())),
225
286
  });
226
287
  // ---------------------------------------------------------------------------
227
288
  // Jobs
@@ -448,11 +509,15 @@ export const FlowZoneCreateOptionsSchema = Type.Object({
448
509
  projectKey: Type.Optional(Type.String()),
449
510
  position: Type.Optional(FlowZonePositionSchema),
450
511
  }, { additionalProperties: false, });
512
+ /**
513
+ * DSS's public `PUT /flow/zones/{id}` persists name and color but silently
514
+ * ignores `position`; repositioning an existing zone goes through
515
+ * `flowZones.recreate`, which creates a replacement zone at the new position.
516
+ */
451
517
  export const FlowZoneUpdateOptionsSchema = Type.Object({
452
518
  name: Type.Optional(Type.String()),
453
519
  color: Type.Optional(Type.String()),
454
520
  projectKey: Type.Optional(Type.String()),
455
- position: Type.Optional(FlowZonePositionSchema),
456
521
  }, { additionalProperties: false, });
457
522
  // ---------------------------------------------------------------------------
458
523
  // Folders
@@ -579,10 +644,18 @@ export const WikiSettingsSchema = Type.Object({
579
644
  taxonomy: Type.Optional(Type.Array(WikiTaxonomyNodeSchema)),
580
645
  homeArticleId: Type.Optional(Type.String()),
581
646
  }, { additionalProperties: true, });
647
+ /** One entry of a wiki article's `attachments` (uploaded FILE or linked DSS object). */
648
+ export const WikiArticleAttachmentSchema = Type.Object({
649
+ attachmentType: Type.Optional(Type.String()),
650
+ smartId: Type.Optional(Type.String()),
651
+ taggableType: Type.Optional(Type.String()),
652
+ details: Type.Optional(Type.Record(Type.String(), Type.Unknown())),
653
+ }, { additionalProperties: true, });
582
654
  export const WikiArticleMetadataSchema = Type.Object({
583
655
  id: Type.String(),
584
656
  name: Type.Optional(Type.String()),
585
657
  projectKey: Type.Optional(Type.String()),
658
+ attachments: Type.Optional(Type.Array(WikiArticleAttachmentSchema)),
586
659
  }, { additionalProperties: true, });
587
660
  export const WikiArticleDataSchema = Type.Object({
588
661
  article: WikiArticleMetadataSchema,
@@ -20,6 +20,8 @@ export declare function expectJsonObject(value: unknown, source: string): Record
20
20
  export declare function parseJsonObject(text: string, source: string): Record<string, unknown>;
21
21
  export declare function json(v: string | boolean | undefined, source?: string): Record<string, unknown> | undefined;
22
22
  export declare function readStdinText(): string;
23
+ export declare function readInputText(path: string, flag: string): string;
24
+ export declare function seenJsonInputCredentials(): readonly string[];
23
25
  export declare function jsonInput(flags: Record<string, string | boolean>): Record<string, unknown> | undefined;
24
26
  export declare function unknownJsonInput(flags: Record<string, string | boolean>): unknown;
25
27
  export declare function schemaColumnsInput(flags: Record<string, string | boolean>, usage: string): Array<{
@@ -1,4 +1,5 @@
1
1
  import { readFileSync, } from "node:fs";
2
+ import { credentialValues, } from "../utils/secret-sanitize.js";
2
3
  import { UsageError, } from "./usage.js";
3
4
  function safeValuePreview(value) {
4
5
  return value.length <= 32 ? value : `${value.slice(0, 32)}…`;
@@ -164,7 +165,7 @@ function selectSingleSource(flags, sourceFlags) {
164
165
  }
165
166
  return provided[0];
166
167
  }
167
- function readInputText(path, flag) {
168
+ export function readInputText(path, flag) {
168
169
  try {
169
170
  return readFileSync(path, "utf-8");
170
171
  }
@@ -173,31 +174,34 @@ function readInputText(path, flag) {
173
174
  throw new UsageError(`Could not read ${flag} file: ${path}`, "validation_failed", "Verify that the path names an existing, readable file.", { flag, path, ...(cause ? { cause, } : {}), });
174
175
  }
175
176
  }
177
+ /**
178
+ * Credential values seen in this process's JSON inputs. DSS error text can
179
+ * echo the request payload, so error reports redact these.
180
+ */
181
+ const jsonInputCredentials = [];
182
+ export function seenJsonInputCredentials() {
183
+ return jsonInputCredentials;
184
+ }
185
+ function parseJsonSource(text, source, kind) {
186
+ const value = kind === "object" ? parseJsonObject(text, source) : parseJsonValue(text, source);
187
+ jsonInputCredentials.push(...credentialValues(value));
188
+ return value;
189
+ }
176
190
  function resolveJsonSourceText(flags, kind) {
177
191
  const source = selectSingleSource(flags, JSON_SOURCE_FLAGS);
178
192
  if (source === undefined)
179
193
  return undefined;
180
- if (source === "stdin") {
181
- const jsonText = readStdinText();
182
- return kind === "object"
183
- ? parseJsonObject(jsonText, "stdin")
184
- : parseJsonValue(jsonText, "stdin");
185
- }
194
+ if (source === "stdin")
195
+ return parseJsonSource(readStdinText(), "stdin", kind);
186
196
  if (source === "data-file") {
187
197
  const fileValue = flags["data-file"];
188
198
  if (typeof fileValue === "string") {
189
- const jsonText = readInputText(fileValue, "--data-file");
190
- return kind === "object"
191
- ? parseJsonObject(jsonText, fileValue)
192
- : parseJsonValue(jsonText, fileValue);
199
+ return parseJsonSource(readInputText(fileValue, "--data-file"), fileValue, kind);
193
200
  }
194
201
  }
195
202
  const dataValue = flags["data"];
196
- if (typeof dataValue === "string") {
197
- return kind === "object"
198
- ? parseJsonObject(dataValue, "--data")
199
- : parseJsonValue(dataValue, "--data");
200
- }
203
+ if (typeof dataValue === "string")
204
+ return parseJsonSource(dataValue, "--data", kind);
201
205
  throw new UsageError("JSON input source is present but has no value.", "invalid_flag_value");
202
206
  }
203
207
  export function jsonInput(flags) {