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.
- 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 +114 -5
- package/dist/packages/types/src/index.js +75 -2
- package/dist/src/cli/coerce.d.ts +2 -0
- package/dist/src/cli/coerce.js +20 -16
- package/dist/src/cli/command-syntax.json +3369 -144
- 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 +76 -9
- package/dist/src/cli/commands/discussion.js +15 -0
- package/dist/src/cli/commands/doctor.js +1 -1
- package/dist/src/cli/commands/flow-zone.js +241 -46
- 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 +44 -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 +13 -0
- package/dist/src/cli/commands/recipe.js +130 -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 +78 -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 +150 -3407
- package/dist/src/cli/doctor.d.ts +13 -0
- package/dist/src/cli/doctor.js +43 -1
- package/dist/src/cli/flags.d.ts +14 -1
- package/dist/src/cli/flags.js +106 -8
- package/dist/src/cli/helpers/app-successor.js +1 -2
- package/dist/src/cli/helpers/dataset.d.ts +12 -0
- package/dist/src/cli/helpers/dataset.js +36 -0
- package/dist/src/cli/helpers/documentation.d.ts +21 -0
- package/dist/src/cli/helpers/documentation.js +53 -0
- package/dist/src/cli/helpers/flow-zone.d.ts +21 -0
- package/dist/src/cli/helpers/flow-zone.js +144 -4
- 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 +33 -19
- package/dist/src/cli/plans.d.ts +14 -0
- package/dist/src/cli/plans.js +3740 -0
- package/dist/src/cli/types.d.ts +2 -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 +137 -115
- package/dist/src/client.d.ts +52 -43
- package/dist/src/client.js +267 -96
- package/dist/src/errors.d.ts +22 -2
- package/dist/src/errors.js +49 -50
- 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 +38 -0
- package/dist/src/resources/dataset-create.js +135 -0
- package/dist/src/resources/datasets.d.ts +46 -15
- package/dist/src/resources/datasets.js +120 -112
- 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-zones.d.ts +29 -3
- package/dist/src/resources/flow-zones.js +53 -3
- 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.d.ts +34 -0
- package/dist/src/resources/jobs.js +170 -3
- 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 +15 -0
- package/dist/src/resources/projects.js +18 -3
- package/dist/src/resources/recipe-create.d.ts +79 -0
- package/dist/src/resources/recipe-create.js +454 -0
- package/dist/src/resources/recipes.d.ts +28 -29
- package/dist/src/resources/recipes.js +201 -267
- 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/sql.js +52 -13
- 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 +52 -1
- package/dist/src/resources/wiki.js +96 -0
- package/dist/src/resources/workspaces.d.ts +2 -0
- package/dist/src/resources/workspaces.js +4 -0
- package/dist/src/utils/flow-analysis.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/flow-maps.md +2 -2
- package/skills/dataiku-dss/references/troubleshooting.md +3 -2
package/dist/src/errors.js
CHANGED
|
@@ -74,9 +74,15 @@ export const UNEXPECTED_RESPONSE_MARKER = "Unexpected DSS response";
|
|
|
74
74
|
export function unexpectedResponseError(detail, status = 200) {
|
|
75
75
|
return new DataikuError(status, "Unexpected Response", `${UNEXPECTED_RESPONSE_MARKER}: ${detail}`);
|
|
76
76
|
}
|
|
77
|
+
/** Hint for a DSS answer that definitively failed the request (e.g. the database rejected the SQL). */
|
|
78
|
+
const DEFINITE_FAILURE_HINT = "DSS reported that the request failed (for SQL: syntax error, missing object, or missing privileges of the connection's role). Fix the request or grants; do not retry unchanged.";
|
|
77
79
|
/** Prefix for a SQL query failure reported by DSS on a 2xx finish-streaming response. */
|
|
78
80
|
export const SQL_QUERY_FAILED_MARKER = "SQL query failed in DSS";
|
|
79
|
-
const TLS_CERTIFICATE_HINT = "TLS certificate verification failed. Trust the DSS/corporate CA with --ca-cert PATH or NODE_EXTRA_CA_CERTS; use --insecure only for temporary troubleshooting.";
|
|
81
|
+
const TLS_CERTIFICATE_HINT = "TLS certificate verification failed. Trust the DSS/corporate CA with --ca-cert PATH or NODE_EXTRA_CA_CERTS, or save it for every process and directory with `dss auth login --ca-cert PATH` (a project .env applies only when dss runs in that directory); use --insecure only for temporary troubleshooting.";
|
|
82
|
+
/** Generic permission hint; the CLI names the project when the request was project-scoped. */
|
|
83
|
+
export const FORBIDDEN_HINT = "Check API key validity and project permissions for the requested action.";
|
|
84
|
+
/** Generic 404 hint; the CLI names the resource and project when it knows them. */
|
|
85
|
+
export const NOT_FOUND_HINT = "Verify projectKey and object identifiers (dataset/recipe/scenario/folder IDs).";
|
|
80
86
|
const BUSINESS_APPS_API_UNAVAILABLE_HINT = "Business Apps API is not available on this DSS instance. Use classic app commands or check DSS version/feature availability.";
|
|
81
87
|
const MAX_ERROR_SUMMARY_LENGTH = 200;
|
|
82
88
|
function isHtmlResponseBody(body) {
|
|
@@ -136,6 +142,8 @@ function isCertificateTrustFailure(lowerBody) {
|
|
|
136
142
|
|| lowerBody.includes("unable to get local issuer certificate")
|
|
137
143
|
|| lowerBody.includes("unable to verify leaf signature")
|
|
138
144
|
|| lowerBody.includes("self-signed certificate")
|
|
145
|
+
|| lowerBody.includes("self signed certificate")
|
|
146
|
+
|| lowerBody.includes("depth_zero_self_signed_cert")
|
|
139
147
|
|| lowerBody.includes("certificate has expired")
|
|
140
148
|
|| lowerBody.includes("cert_has_expired")
|
|
141
149
|
|| lowerBody.includes("self_signed_cert_in_chain")
|
|
@@ -170,6 +178,15 @@ export function classifyDataikuError(status, body) {
|
|
|
170
178
|
retryHint: TLS_CERTIFICATE_HINT,
|
|
171
179
|
};
|
|
172
180
|
}
|
|
181
|
+
// The same URL fails the same way on every attempt: nothing listens on
|
|
182
|
+
// the port, the host name does not resolve, or the URL is malformed.
|
|
183
|
+
if (/\b(?:connectionrefused|econnrefused|enotfound|err_invalid_url|bad port)\b/.test(lowerBody)) {
|
|
184
|
+
return {
|
|
185
|
+
category: "validation",
|
|
186
|
+
retryable: false,
|
|
187
|
+
retryHint: "DSS is not reachable at this URL. Check --url / DATAIKU_URL (scheme, host, port) and that DSS is running; do not retry unchanged.",
|
|
188
|
+
};
|
|
189
|
+
}
|
|
173
190
|
return {
|
|
174
191
|
category: "transient",
|
|
175
192
|
retryable: true,
|
|
@@ -295,11 +312,7 @@ export function classifyDataikuError(status, body) {
|
|
|
295
312
|
|| (lowerBody.includes("permission")
|
|
296
313
|
&& (lowerBody.includes("cannot use") || lowerBody.includes("not allowed"))));
|
|
297
314
|
if (isServerPermissionLike) {
|
|
298
|
-
return {
|
|
299
|
-
category: "forbidden",
|
|
300
|
-
retryable: false,
|
|
301
|
-
retryHint: "Check API key validity and project permissions for the requested action.",
|
|
302
|
-
};
|
|
315
|
+
return { category: "forbidden", retryable: false, retryHint: FORBIDDEN_HINT, };
|
|
303
316
|
}
|
|
304
317
|
if (status === 404) {
|
|
305
318
|
if (isBusinessAppsApiRootNotFound(lowerBody)) {
|
|
@@ -315,15 +328,11 @@ export function classifyDataikuError(status, body) {
|
|
|
315
328
|
retryable: false,
|
|
316
329
|
retryHint: isHtmlGatewayResponse
|
|
317
330
|
? "Resource was not found (gateway returned HTML). Verify DSS URL, projectKey, and object identifiers."
|
|
318
|
-
:
|
|
331
|
+
: NOT_FOUND_HINT,
|
|
319
332
|
};
|
|
320
333
|
}
|
|
321
334
|
if (status === 401 || status === 403) {
|
|
322
|
-
return {
|
|
323
|
-
category: "forbidden",
|
|
324
|
-
retryable: false,
|
|
325
|
-
retryHint: "Check API key validity and project permissions for the requested action.",
|
|
326
|
-
};
|
|
335
|
+
return { category: "forbidden", retryable: false, retryHint: FORBIDDEN_HINT, };
|
|
327
336
|
}
|
|
328
337
|
if (status === 400 || status === 409 || status === 422) {
|
|
329
338
|
return {
|
|
@@ -367,31 +376,40 @@ export class DataikuError extends Error {
|
|
|
367
376
|
trustedTarget;
|
|
368
377
|
trustedElapsedMs;
|
|
369
378
|
bodyTruncated;
|
|
379
|
+
/** DSS definitively failed the whole operation; see `DataikuErrorTrustedMetadata.definiteFailure`. */
|
|
380
|
+
definiteFailure;
|
|
381
|
+
/** Client-side outcome context (e.g. rollback of partial mutations), surfaced in CLI `details`. */
|
|
382
|
+
details;
|
|
370
383
|
constructor(status, statusText, body, retry, requestId, trustedMetadata) {
|
|
371
|
-
const details = DataikuError.buildDetails(status, body
|
|
384
|
+
const details = DataikuError.buildDetails(status, body);
|
|
372
385
|
super(details.message);
|
|
373
386
|
this.status = status;
|
|
374
387
|
this.statusText = statusText;
|
|
375
388
|
this.body = body;
|
|
376
389
|
this.name = "DataikuError";
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
390
|
+
const definite = trustedMetadata?.definiteFailure === true;
|
|
391
|
+
// A definite DSS refusal is not a transport/server fault: replaying it
|
|
392
|
+
// unchanged cannot succeed. Keep a more specific forbidden/not_found class.
|
|
393
|
+
const reclassify = definite
|
|
394
|
+
&& (details.category === "transient" || details.category === "unknown"
|
|
395
|
+
|| details.category === "unexpected_response");
|
|
396
|
+
this.category = reclassify ? "validation" : details.category;
|
|
397
|
+
this.retryable = reclassify ? false : details.retryable;
|
|
398
|
+
this.retryHint = reclassify ? DEFINITE_FAILURE_HINT : details.retryHint;
|
|
380
399
|
this.retry = retry;
|
|
381
400
|
this.requestId = requestId;
|
|
382
401
|
this.trustedTarget = trustedMetadata?.target;
|
|
383
402
|
this.trustedElapsedMs = trustedMetadata?.elapsedMs;
|
|
384
403
|
this.bodyTruncated = trustedMetadata?.bodyTruncated === true ? true : undefined;
|
|
404
|
+
this.definiteFailure = definite ? true : undefined;
|
|
385
405
|
}
|
|
406
|
+
/** Status line only: never echoes response body text. */
|
|
386
407
|
get safeMessage() {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
`Hint: ${this.retryHint}`,
|
|
393
|
-
...(retrySummary ? [retrySummary,] : []),
|
|
394
|
-
].join("\n");
|
|
408
|
+
return `${this.status} ${canonicalStatusText(this.status)}`;
|
|
409
|
+
}
|
|
410
|
+
/** The DSS message part of `message` (HTML summarized, server paths stripped, bounded). */
|
|
411
|
+
get summary() {
|
|
412
|
+
return this.message.slice(this.safeMessage.length + 2);
|
|
395
413
|
}
|
|
396
414
|
static extractSummary(_status, body) {
|
|
397
415
|
try {
|
|
@@ -406,33 +424,14 @@ export class DataikuError extends Error {
|
|
|
406
424
|
return "(empty response body)";
|
|
407
425
|
return summarizeErrorText(body);
|
|
408
426
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
const delaysPart = shownDelays.length > 0 ? `[${shownDelays.join(", ")}${delaysSuffix}]` : "[]";
|
|
415
|
-
return [
|
|
416
|
-
`Retry attempts: ${retry.attempts}/${retry.maxAttempts}`,
|
|
417
|
-
`Retry policy: ${retry.enabled ? "enabled" : "disabled"} for ${retry.method}`,
|
|
418
|
-
`Retries performed: ${retry.retries}`,
|
|
419
|
-
`Backoff delays (ms): ${delaysPart}`,
|
|
420
|
-
`Timed out: ${retry.timedOut ? "yes" : "no"}`,
|
|
421
|
-
].join(" | ");
|
|
422
|
-
}
|
|
423
|
-
static buildDetails(status, body, retry) {
|
|
424
|
-
const summary = DataikuError.extractSummary(status, body);
|
|
425
|
-
const taxonomy = classifyDataikuError(status, body);
|
|
426
|
-
const retrySummary = DataikuError.formatRetryMetadata(retry);
|
|
427
|
+
/**
|
|
428
|
+
* One line: status plus the DSS message. Category, retryability, hint, and
|
|
429
|
+
* retry metadata are structured fields on the error, not message prose.
|
|
430
|
+
*/
|
|
431
|
+
static buildDetails(status, body) {
|
|
427
432
|
return {
|
|
428
|
-
...
|
|
429
|
-
message:
|
|
430
|
-
`${status} ${canonicalStatusText(status)}: ${summary}`,
|
|
431
|
-
`Error type: ${taxonomy.category}`,
|
|
432
|
-
`Retryable: ${taxonomy.retryable ? "yes" : "no"}`,
|
|
433
|
-
`Hint: ${taxonomy.retryHint}`,
|
|
434
|
-
...(retrySummary ? [retrySummary,] : []),
|
|
435
|
-
].join("\n"),
|
|
433
|
+
...classifyDataikuError(status, body),
|
|
434
|
+
message: `${status} ${canonicalStatusText(status)}: ${DataikuError.extractSummary(status, body).replace(/\s+/g, " ").trim()}`,
|
|
436
435
|
};
|
|
437
436
|
}
|
|
438
437
|
}
|