dataiku-sdk 4.0.0 → 4.2.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 +1 -0
- package/dist/build-metadata.json +1 -1
- package/dist/packages/types/src/index.d.ts +5 -1
- package/dist/packages/types/src/index.js +5 -1
- package/dist/src/cli/command-syntax.json +4136 -2756
- package/dist/src/cli/commands/code-env.js +5 -3
- package/dist/src/cli/commands/dataset.js +6 -4
- package/dist/src/cli/commands/future.js +7 -2
- package/dist/src/cli/commands/index.js +4 -0
- package/dist/src/cli/commands/job.js +12 -9
- package/dist/src/cli/commands/messaging-channel.d.ts +17 -0
- package/dist/src/cli/commands/messaging-channel.js +385 -0
- package/dist/src/cli/commands/project-deployer.js +33 -0
- package/dist/src/cli/commands/project.js +30 -0
- package/dist/src/cli/commands/recipe.js +23 -2
- package/dist/src/cli/commands/scenario.d.ts +6 -0
- package/dist/src/cli/commands/scenario.js +495 -17
- package/dist/src/cli/contract.js +20 -4
- package/dist/src/cli/env.d.ts +6 -0
- package/dist/src/cli/env.js +8 -0
- package/dist/src/cli/flags.js +34 -0
- package/dist/src/cli/helpers/cleanup.js +11 -0
- package/dist/src/cli/list-shapes.js +5 -0
- package/dist/src/cli/output.d.ts +2 -0
- package/dist/src/cli/output.js +24 -4
- package/dist/src/cli/plans.js +94 -2
- package/dist/src/cli/read-shapes.js +92 -1
- package/dist/src/cli/result-shapes.d.ts +19 -1
- package/dist/src/cli/result-shapes.js +228 -4
- package/dist/src/cli/selector-suggestions.d.ts +14 -0
- package/dist/src/cli/selector-suggestions.js +56 -0
- package/dist/src/cli/usage.d.ts +1 -1
- package/dist/src/cli/usage.js +36 -4
- package/dist/src/cli/version.d.ts +2 -2
- package/dist/src/cli/version.js +2 -2
- package/dist/src/cli.js +62 -13
- package/dist/src/client.d.ts +16 -4
- package/dist/src/client.js +45 -9
- package/dist/src/errors.d.ts +2 -0
- package/dist/src/errors.js +12 -2
- package/dist/src/generated/action-output-schemas.json +296 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/resources/bundles.d.ts +18 -0
- package/dist/src/resources/bundles.js +26 -0
- package/dist/src/resources/futures.d.ts +3 -0
- package/dist/src/resources/futures.js +5 -1
- package/dist/src/resources/messaging-channels.d.ts +83 -0
- package/dist/src/resources/messaging-channels.js +108 -0
- package/dist/src/resources/projects.d.ts +24 -0
- package/dist/src/resources/projects.js +36 -0
- package/dist/src/resources/recipe-create.d.ts +4 -1
- package/dist/src/resources/recipe-create.js +11 -2
- package/dist/src/resources/scenario-authoring.d.ts +52 -0
- package/dist/src/resources/scenario-authoring.js +216 -0
- package/dist/src/resources/scenarios.d.ts +128 -11
- package/dist/src/resources/scenarios.js +273 -43
- package/dist/src/resources/sql.js +3 -3
- package/dist/src/utils/messaging-channel-secrets.d.ts +17 -0
- package/dist/src/utils/messaging-channel-secrets.js +114 -0
- package/package.json +2 -1
- package/plugin.json +1 -1
- package/skills/dataiku-dss/SKILL.md +15 -16
- package/skills/dataiku-dss/references/discovery.md +2 -2
- package/skills/dataiku-dss/references/notifications.md +29 -0
- package/skills/dataiku-dss/references/troubleshooting.md +1 -0
package/dist/src/client.js
CHANGED
|
@@ -2,7 +2,7 @@ import { readFileSync, } from "node:fs";
|
|
|
2
2
|
import { basename, } from "node:path";
|
|
3
3
|
import { Value, } from "@sinclair/typebox/value";
|
|
4
4
|
import { safeParseSchema, } from "./schemas.js";
|
|
5
|
-
import { classifyDataikuError, ClientValidationError, DataikuError, nonJsonResponseBody, } from "./errors.js";
|
|
5
|
+
import { classifyDataikuError, ClientValidationError, DataikuError, nonJsonResponseBody, RESPONSE_TOO_LARGE_STATUS_TEXT, } from "./errors.js";
|
|
6
6
|
/* ------------------------------------------------------------------ */
|
|
7
7
|
/* Constants */
|
|
8
8
|
/* ------------------------------------------------------------------ */
|
|
@@ -18,7 +18,6 @@ const DEFAULT_REQUEST_TIMEOUT_MS = 30_000;
|
|
|
18
18
|
* streaming methods (stream, postStream) are unaffected.
|
|
19
19
|
*/
|
|
20
20
|
const DEFAULT_MAX_BUFFERED_BODY_BYTES = 50 * 1024 * 1024;
|
|
21
|
-
const RESPONSE_TOO_LARGE_STATUS_TEXT = "Response Too Large";
|
|
22
21
|
/* ------------------------------------------------------------------ */
|
|
23
22
|
/* Helpers */
|
|
24
23
|
/* ------------------------------------------------------------------ */
|
|
@@ -115,6 +114,8 @@ function trimFromUtf8BoundaryStart(bytes) {
|
|
|
115
114
|
function buildBodyReadTimeoutError(timeoutMs) {
|
|
116
115
|
return new DataikuError(0, "Request Timeout", `Request timed out after ${timeoutMs}ms while reading the response body.`);
|
|
117
116
|
}
|
|
117
|
+
/** Total budget of a tail read (e.g. `job log`) as a multiple of the per-chunk stall timeout. */
|
|
118
|
+
const TAIL_READ_TOTAL_BUDGET_FACTOR = 10;
|
|
118
119
|
/**
|
|
119
120
|
* Read the next chunk of a response body under a hard deadline.
|
|
120
121
|
* When `remainingMs` elapses, the stream is cancelled and the caller's
|
|
@@ -255,6 +256,7 @@ export class DataikuClient {
|
|
|
255
256
|
workspacesResource;
|
|
256
257
|
metricsResource;
|
|
257
258
|
meaningsResource;
|
|
259
|
+
messagingChannelsResource;
|
|
258
260
|
analysesResource;
|
|
259
261
|
mlTasksResource;
|
|
260
262
|
savedModelsResource;
|
|
@@ -507,6 +509,13 @@ export class DataikuClient {
|
|
|
507
509
|
}
|
|
508
510
|
return this.meaningsResource;
|
|
509
511
|
}
|
|
512
|
+
get messagingChannels() {
|
|
513
|
+
if (!this.messagingChannelsResource) {
|
|
514
|
+
const { MessagingChannelsResource: Resource, } = require("./resources/messaging-channels.js");
|
|
515
|
+
this.messagingChannelsResource = new Resource(this);
|
|
516
|
+
}
|
|
517
|
+
return this.messagingChannelsResource;
|
|
518
|
+
}
|
|
510
519
|
get analyses() {
|
|
511
520
|
if (!this.analysesResource) {
|
|
512
521
|
const { AnalysesResource: Resource, } = require("./resources/analyses.js");
|
|
@@ -699,7 +708,7 @@ export class DataikuClient {
|
|
|
699
708
|
* the tail is kept and `truncated` is true — so callers that need the end
|
|
700
709
|
* of a large document (e.g. job logs) stay bounded without losing the most
|
|
701
710
|
* recent content. The request timeout applies per received chunk (a stall
|
|
702
|
-
* deadline)
|
|
711
|
+
* deadline); the whole transfer is capped at 10x the request timeout.
|
|
703
712
|
*/
|
|
704
713
|
async getTextTailLimited(path, maxBytes) {
|
|
705
714
|
const limit = Math.max(0, Math.floor(maxBytes));
|
|
@@ -819,6 +828,18 @@ export class DataikuClient {
|
|
|
819
828
|
* boundary is set correctly.
|
|
820
829
|
*/
|
|
821
830
|
async uploadForm(path, parts, query) {
|
|
831
|
+
return this.parseJsonResponse(await this.postFormData(path, parts, query));
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* POST a multipart/form-data body like {@link uploadForm} for endpoints whose
|
|
835
|
+
* success carries no JSON the caller needs (e.g. mail sends): the response
|
|
836
|
+
* body is not parsed, so a non-JSON acknowledgement cannot turn an already
|
|
837
|
+
* applied write into a client error.
|
|
838
|
+
*/
|
|
839
|
+
async uploadFormVoid(path, parts, query) {
|
|
840
|
+
await this.postFormData(path, parts, query);
|
|
841
|
+
}
|
|
842
|
+
async postFormData(path, parts, query) {
|
|
822
843
|
const formData = new FormData();
|
|
823
844
|
for (const part of parts) {
|
|
824
845
|
if (part.value !== undefined) {
|
|
@@ -837,12 +858,11 @@ export class DataikuClient {
|
|
|
837
858
|
formData.append(part.name, blob, part.fileName);
|
|
838
859
|
}
|
|
839
860
|
const suffix = query && [...query.keys(),].length > 0 ? `?${query.toString()}` : "";
|
|
840
|
-
|
|
861
|
+
return this.fetchWithRetry(`${this.baseUrl}${path}${suffix}`, {
|
|
841
862
|
method: "POST",
|
|
842
863
|
headers: { Authorization: `Bearer ${this.apiKey}`, },
|
|
843
864
|
body: formData,
|
|
844
865
|
});
|
|
845
|
-
return this.parseJsonResponse(res);
|
|
846
866
|
}
|
|
847
867
|
async uploadResponse(path, filePath, fileName) {
|
|
848
868
|
const fileBlob = Bun.file(filePath);
|
|
@@ -1090,9 +1110,10 @@ export class DataikuClient {
|
|
|
1090
1110
|
* decoded text never contains a replacement character.
|
|
1091
1111
|
*
|
|
1092
1112
|
* The request timeout applies per chunk (a stall deadline), like the
|
|
1093
|
-
* streaming path: a
|
|
1094
|
-
*
|
|
1095
|
-
*
|
|
1113
|
+
* streaming path: a body that stops sending for longer than the timeout
|
|
1114
|
+
* fails with the body-read timeout error. A total budget of
|
|
1115
|
+
* {@link TAIL_READ_TOTAL_BUDGET_FACTOR} x the request timeout bounds a body
|
|
1116
|
+
* that keeps trickling, with an error naming that limit.
|
|
1096
1117
|
*/
|
|
1097
1118
|
async readBodyTextTail(res, maxBytes) {
|
|
1098
1119
|
const limit = Math.max(0, Math.floor(maxBytes));
|
|
@@ -1103,9 +1124,24 @@ export class DataikuClient {
|
|
|
1103
1124
|
let writeOffset = 0;
|
|
1104
1125
|
let retainedBytes = 0;
|
|
1105
1126
|
let truncated = false;
|
|
1127
|
+
// Stall deadline per chunk, plus an overall cap so a body that trickles
|
|
1128
|
+
// forever still ends; the error names which limit fired.
|
|
1129
|
+
const totalBudgetMs = this.requestTimeoutMs * TAIL_READ_TOTAL_BUDGET_FACTOR;
|
|
1130
|
+
const startedAt = Date.now();
|
|
1106
1131
|
try {
|
|
1107
1132
|
while (true) {
|
|
1108
|
-
const
|
|
1133
|
+
const totalRemainingMs = totalBudgetMs - (Date.now() - startedAt);
|
|
1134
|
+
const totalBound = totalRemainingMs < this.requestTimeoutMs;
|
|
1135
|
+
let chunk;
|
|
1136
|
+
try {
|
|
1137
|
+
chunk = await readChunkWithDeadline(reader, Math.max(0, Math.min(this.requestTimeoutMs, totalRemainingMs)), this.requestTimeoutMs);
|
|
1138
|
+
}
|
|
1139
|
+
catch (error) {
|
|
1140
|
+
if (!totalBound || !(error instanceof DataikuError) || error.status !== 0)
|
|
1141
|
+
throw error;
|
|
1142
|
+
throw new DataikuError(0, "Request Timeout", `Response body was still arriving after ${totalBudgetMs}ms (the total read limit is ${TAIL_READ_TOTAL_BUDGET_FACTOR}x --request-timeout); raise --request-timeout to allow more time.`);
|
|
1143
|
+
}
|
|
1144
|
+
const { done, value, } = chunk;
|
|
1109
1145
|
if (done)
|
|
1110
1146
|
break;
|
|
1111
1147
|
if (limit === 0) {
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export declare const UNEXPECTED_RESPONSE_MARKER = "Unexpected DSS response";
|
|
|
51
51
|
export declare function unexpectedResponseError(detail: string, status?: number): DataikuError;
|
|
52
52
|
/** Prefix for a SQL query failure reported by DSS on a 2xx finish-streaming response. */
|
|
53
53
|
export declare const SQL_QUERY_FAILED_MARKER = "SQL query failed in DSS";
|
|
54
|
+
/** statusText of a DataikuError raised when a response exceeds a client-side byte budget. */
|
|
55
|
+
export declare const RESPONSE_TOO_LARGE_STATUS_TEXT = "Response Too Large";
|
|
54
56
|
/** Generic permission hint; the CLI names the project when the request was project-scoped. */
|
|
55
57
|
export declare const FORBIDDEN_HINT = "Check API key validity and project permissions for the requested action.";
|
|
56
58
|
/** Generic 404 hint; the CLI names the resource and project when it knows them. */
|
package/dist/src/errors.js
CHANGED
|
@@ -78,6 +78,9 @@ export function unexpectedResponseError(detail, status = 200) {
|
|
|
78
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.";
|
|
79
79
|
/** Prefix for a SQL query failure reported by DSS on a 2xx finish-streaming response. */
|
|
80
80
|
export const SQL_QUERY_FAILED_MARKER = "SQL query failed in DSS";
|
|
81
|
+
/** statusText of a DataikuError raised when a response exceeds a client-side byte budget. */
|
|
82
|
+
export const RESPONSE_TOO_LARGE_STATUS_TEXT = "Response Too Large";
|
|
83
|
+
const RESPONSE_TOO_LARGE_HINT = "The response exceeded a client-side size limit; retrying returns the same body. Narrow the request (fewer rows or columns, --preview, --output PATH) instead.";
|
|
81
84
|
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
85
|
/** Generic permission hint; the CLI names the project when the request was project-scoped. */
|
|
83
86
|
export const FORBIDDEN_HINT = "Check API key validity and project permissions for the requested action.";
|
|
@@ -388,14 +391,21 @@ export class DataikuError extends Error {
|
|
|
388
391
|
this.body = body;
|
|
389
392
|
this.name = "DataikuError";
|
|
390
393
|
const definite = trustedMetadata?.definiteFailure === true;
|
|
394
|
+
// A client-side byte budget tripped: the same request returns the same
|
|
395
|
+
// oversized body, so retrying cannot help (it is not a transport fault).
|
|
396
|
+
const overBudget = statusText === RESPONSE_TOO_LARGE_STATUS_TEXT;
|
|
391
397
|
// A definite DSS refusal is not a transport/server fault: replaying it
|
|
392
398
|
// unchanged cannot succeed. Keep a more specific forbidden/not_found class.
|
|
393
|
-
const reclassify = definite
|
|
399
|
+
const reclassify = overBudget || definite
|
|
394
400
|
&& (details.category === "transient" || details.category === "unknown"
|
|
395
401
|
|| details.category === "unexpected_response");
|
|
396
402
|
this.category = reclassify ? "validation" : details.category;
|
|
397
403
|
this.retryable = reclassify ? false : details.retryable;
|
|
398
|
-
this.retryHint =
|
|
404
|
+
this.retryHint = overBudget
|
|
405
|
+
? RESPONSE_TOO_LARGE_HINT
|
|
406
|
+
: reclassify
|
|
407
|
+
? DEFINITE_FAILURE_HINT
|
|
408
|
+
: details.retryHint;
|
|
399
409
|
this.retry = retry;
|
|
400
410
|
this.requestId = requestId;
|
|
401
411
|
this.trustedTarget = trustedMetadata?.target;
|
|
@@ -1125,6 +1125,12 @@
|
|
|
1125
1125
|
"resume": {
|
|
1126
1126
|
"type": "string"
|
|
1127
1127
|
},
|
|
1128
|
+
"resumeArgv": {
|
|
1129
|
+
"type": "array",
|
|
1130
|
+
"items": {
|
|
1131
|
+
"type": "string"
|
|
1132
|
+
}
|
|
1133
|
+
},
|
|
1128
1134
|
"progress": {
|
|
1129
1135
|
"type": "object",
|
|
1130
1136
|
"required": [
|
|
@@ -1199,6 +1205,12 @@
|
|
|
1199
1205
|
"resume": {
|
|
1200
1206
|
"type": "string"
|
|
1201
1207
|
},
|
|
1208
|
+
"resumeArgv": {
|
|
1209
|
+
"type": "array",
|
|
1210
|
+
"items": {
|
|
1211
|
+
"type": "string"
|
|
1212
|
+
}
|
|
1213
|
+
},
|
|
1202
1214
|
"progress": {
|
|
1203
1215
|
"type": "object",
|
|
1204
1216
|
"required": [
|
|
@@ -1288,6 +1300,33 @@
|
|
|
1288
1300
|
}
|
|
1289
1301
|
}
|
|
1290
1302
|
},
|
|
1303
|
+
"messaging-channel.list": {
|
|
1304
|
+
"type": "array",
|
|
1305
|
+
"items": {
|
|
1306
|
+
"type": "object",
|
|
1307
|
+
"additionalProperties": false,
|
|
1308
|
+
"properties": {
|
|
1309
|
+
"id": {
|
|
1310
|
+
"type": [
|
|
1311
|
+
"string",
|
|
1312
|
+
"null"
|
|
1313
|
+
]
|
|
1314
|
+
},
|
|
1315
|
+
"type": {
|
|
1316
|
+
"type": [
|
|
1317
|
+
"string",
|
|
1318
|
+
"null"
|
|
1319
|
+
]
|
|
1320
|
+
},
|
|
1321
|
+
"family": {
|
|
1322
|
+
"type": [
|
|
1323
|
+
"string",
|
|
1324
|
+
"null"
|
|
1325
|
+
]
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
},
|
|
1291
1330
|
"notebook.get-jupyter": {
|
|
1292
1331
|
"additionalProperties": true,
|
|
1293
1332
|
"type": "object",
|
|
@@ -1976,6 +2015,208 @@
|
|
|
1976
2015
|
}
|
|
1977
2016
|
}
|
|
1978
2017
|
},
|
|
2018
|
+
"scenario.get-run": {
|
|
2019
|
+
"type": "object",
|
|
2020
|
+
"additionalProperties": false,
|
|
2021
|
+
"required": [
|
|
2022
|
+
"runId",
|
|
2023
|
+
"steps"
|
|
2024
|
+
],
|
|
2025
|
+
"properties": {
|
|
2026
|
+
"runId": {
|
|
2027
|
+
"type": "string"
|
|
2028
|
+
},
|
|
2029
|
+
"scenarioId": {
|
|
2030
|
+
"type": "string"
|
|
2031
|
+
},
|
|
2032
|
+
"projectKey": {
|
|
2033
|
+
"type": "string"
|
|
2034
|
+
},
|
|
2035
|
+
"outcome": {
|
|
2036
|
+
"type": "string"
|
|
2037
|
+
},
|
|
2038
|
+
"start": {
|
|
2039
|
+
"type": "number"
|
|
2040
|
+
},
|
|
2041
|
+
"end": {
|
|
2042
|
+
"type": "number"
|
|
2043
|
+
},
|
|
2044
|
+
"durationMs": {
|
|
2045
|
+
"type": "number"
|
|
2046
|
+
},
|
|
2047
|
+
"trigger": {
|
|
2048
|
+
"type": "object",
|
|
2049
|
+
"additionalProperties": false,
|
|
2050
|
+
"properties": {
|
|
2051
|
+
"type": {
|
|
2052
|
+
"type": "string"
|
|
2053
|
+
},
|
|
2054
|
+
"name": {
|
|
2055
|
+
"type": "string"
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
},
|
|
2059
|
+
"steps": {
|
|
2060
|
+
"type": "array",
|
|
2061
|
+
"items": {
|
|
2062
|
+
"type": "object",
|
|
2063
|
+
"additionalProperties": false,
|
|
2064
|
+
"properties": {
|
|
2065
|
+
"id": {
|
|
2066
|
+
"type": "string"
|
|
2067
|
+
},
|
|
2068
|
+
"name": {
|
|
2069
|
+
"type": "string"
|
|
2070
|
+
},
|
|
2071
|
+
"type": {
|
|
2072
|
+
"type": "string"
|
|
2073
|
+
},
|
|
2074
|
+
"outcome": {
|
|
2075
|
+
"type": "string"
|
|
2076
|
+
},
|
|
2077
|
+
"message": {
|
|
2078
|
+
"type": "string"
|
|
2079
|
+
},
|
|
2080
|
+
"datasets": {
|
|
2081
|
+
"type": "array",
|
|
2082
|
+
"items": {
|
|
2083
|
+
"type": "object",
|
|
2084
|
+
"additionalProperties": false,
|
|
2085
|
+
"properties": {
|
|
2086
|
+
"dataset": {
|
|
2087
|
+
"type": "string"
|
|
2088
|
+
},
|
|
2089
|
+
"projectKey": {
|
|
2090
|
+
"type": "string"
|
|
2091
|
+
},
|
|
2092
|
+
"partition": {
|
|
2093
|
+
"type": "string"
|
|
2094
|
+
},
|
|
2095
|
+
"outcome": {
|
|
2096
|
+
"type": "string"
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
},
|
|
2101
|
+
"jobs": {
|
|
2102
|
+
"type": "array",
|
|
2103
|
+
"items": {
|
|
2104
|
+
"type": "object",
|
|
2105
|
+
"additionalProperties": false,
|
|
2106
|
+
"properties": {
|
|
2107
|
+
"jobId": {
|
|
2108
|
+
"type": "string"
|
|
2109
|
+
},
|
|
2110
|
+
"outcome": {
|
|
2111
|
+
"type": "string"
|
|
2112
|
+
},
|
|
2113
|
+
"message": {
|
|
2114
|
+
"type": "string"
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
},
|
|
2122
|
+
"failure": {
|
|
2123
|
+
"type": "object",
|
|
2124
|
+
"additionalProperties": false,
|
|
2125
|
+
"properties": {
|
|
2126
|
+
"stepId": {
|
|
2127
|
+
"type": "string"
|
|
2128
|
+
},
|
|
2129
|
+
"jobId": {
|
|
2130
|
+
"type": "string"
|
|
2131
|
+
},
|
|
2132
|
+
"dataset": {
|
|
2133
|
+
"type": "string"
|
|
2134
|
+
},
|
|
2135
|
+
"recipe": {
|
|
2136
|
+
"type": "string"
|
|
2137
|
+
},
|
|
2138
|
+
"inputs": {
|
|
2139
|
+
"type": "array",
|
|
2140
|
+
"items": {
|
|
2141
|
+
"type": "string"
|
|
2142
|
+
}
|
|
2143
|
+
},
|
|
2144
|
+
"message": {
|
|
2145
|
+
"type": "string"
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
},
|
|
2149
|
+
"next": {
|
|
2150
|
+
"type": "array",
|
|
2151
|
+
"description": "Next commands to run, each as an argv array.",
|
|
2152
|
+
"items": {
|
|
2153
|
+
"type": "array",
|
|
2154
|
+
"items": {
|
|
2155
|
+
"type": "string"
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
},
|
|
2159
|
+
"hint": {
|
|
2160
|
+
"type": "string",
|
|
2161
|
+
"description": "Edit-and-rerun commands when the failed recipe is known."
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
},
|
|
2165
|
+
"scenario.last-runs": {
|
|
2166
|
+
"type": "array",
|
|
2167
|
+
"items": {
|
|
2168
|
+
"type": "object",
|
|
2169
|
+
"additionalProperties": false,
|
|
2170
|
+
"required": [
|
|
2171
|
+
"runId"
|
|
2172
|
+
],
|
|
2173
|
+
"properties": {
|
|
2174
|
+
"runId": {
|
|
2175
|
+
"type": "string"
|
|
2176
|
+
},
|
|
2177
|
+
"outcome": {
|
|
2178
|
+
"type": "string"
|
|
2179
|
+
},
|
|
2180
|
+
"start": {
|
|
2181
|
+
"type": "number"
|
|
2182
|
+
},
|
|
2183
|
+
"end": {
|
|
2184
|
+
"type": "number"
|
|
2185
|
+
},
|
|
2186
|
+
"trigger": {
|
|
2187
|
+
"type": "object",
|
|
2188
|
+
"additionalProperties": false,
|
|
2189
|
+
"properties": {
|
|
2190
|
+
"type": {
|
|
2191
|
+
"type": "string"
|
|
2192
|
+
},
|
|
2193
|
+
"name": {
|
|
2194
|
+
"type": "string"
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
},
|
|
2198
|
+
"failure": {
|
|
2199
|
+
"type": "object",
|
|
2200
|
+
"additionalProperties": false,
|
|
2201
|
+
"properties": {
|
|
2202
|
+
"message": {
|
|
2203
|
+
"type": "string"
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
},
|
|
2207
|
+
"next": {
|
|
2208
|
+
"type": "array",
|
|
2209
|
+
"description": "Next commands to run, each as an argv array.",
|
|
2210
|
+
"items": {
|
|
2211
|
+
"type": "array",
|
|
2212
|
+
"items": {
|
|
2213
|
+
"type": "string"
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
},
|
|
1979
2220
|
"scenario.list": {
|
|
1980
2221
|
"type": "array",
|
|
1981
2222
|
"items": {
|
|
@@ -2015,6 +2256,61 @@
|
|
|
2015
2256
|
}
|
|
2016
2257
|
}
|
|
2017
2258
|
},
|
|
2259
|
+
"scenario.runs-by-date": {
|
|
2260
|
+
"type": "array",
|
|
2261
|
+
"items": {
|
|
2262
|
+
"type": "object",
|
|
2263
|
+
"additionalProperties": false,
|
|
2264
|
+
"required": [
|
|
2265
|
+
"runId"
|
|
2266
|
+
],
|
|
2267
|
+
"properties": {
|
|
2268
|
+
"runId": {
|
|
2269
|
+
"type": "string"
|
|
2270
|
+
},
|
|
2271
|
+
"outcome": {
|
|
2272
|
+
"type": "string"
|
|
2273
|
+
},
|
|
2274
|
+
"start": {
|
|
2275
|
+
"type": "number"
|
|
2276
|
+
},
|
|
2277
|
+
"end": {
|
|
2278
|
+
"type": "number"
|
|
2279
|
+
},
|
|
2280
|
+
"trigger": {
|
|
2281
|
+
"type": "object",
|
|
2282
|
+
"additionalProperties": false,
|
|
2283
|
+
"properties": {
|
|
2284
|
+
"type": {
|
|
2285
|
+
"type": "string"
|
|
2286
|
+
},
|
|
2287
|
+
"name": {
|
|
2288
|
+
"type": "string"
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
},
|
|
2292
|
+
"failure": {
|
|
2293
|
+
"type": "object",
|
|
2294
|
+
"additionalProperties": false,
|
|
2295
|
+
"properties": {
|
|
2296
|
+
"message": {
|
|
2297
|
+
"type": "string"
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
},
|
|
2301
|
+
"next": {
|
|
2302
|
+
"type": "array",
|
|
2303
|
+
"description": "Next commands to run, each as an argv array.",
|
|
2304
|
+
"items": {
|
|
2305
|
+
"type": "array",
|
|
2306
|
+
"items": {
|
|
2307
|
+
"type": "string"
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
},
|
|
2018
2314
|
"scenario.status": {
|
|
2019
2315
|
"additionalProperties": true,
|
|
2020
2316
|
"type": "object",
|
package/dist/src/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export * from "./resources/knowledge-banks.js";
|
|
|
27
27
|
export * from "./resources/llms.js";
|
|
28
28
|
export { type MacroResultOptions, type MacroRunFailure, type MacroRunHandle, type MacroRunOptions, type MacroRunWaitedResult, MacrosResource, type MacroWaitOptions, } from "./resources/macros.js";
|
|
29
29
|
export { MeaningsResource, } from "./resources/meanings.js";
|
|
30
|
+
export * from "./resources/messaging-channels.js";
|
|
30
31
|
export { MetricsResource, } from "./resources/metrics.js";
|
|
31
32
|
export * from "./resources/ml-tasks.js";
|
|
32
33
|
export { type MlflowDeployRunOptions, type MlflowExperimentsDatasetOptions, MlflowExtensionResource, type MlflowInferenceInfo, type MlflowPredictionType, } from "./resources/mlflow-extension.js";
|
package/dist/src/index.js
CHANGED
|
@@ -30,6 +30,7 @@ export * from "./resources/knowledge-banks.js";
|
|
|
30
30
|
export * from "./resources/llms.js";
|
|
31
31
|
export { MacrosResource, } from "./resources/macros.js";
|
|
32
32
|
export { MeaningsResource, } from "./resources/meanings.js";
|
|
33
|
+
export * from "./resources/messaging-channels.js";
|
|
33
34
|
export { MetricsResource, } from "./resources/metrics.js";
|
|
34
35
|
export * from "./resources/ml-tasks.js";
|
|
35
36
|
export { MlflowExtensionResource, } from "./resources/mlflow-extension.js";
|
|
@@ -126,6 +126,24 @@ export declare class ProjectDeployerResource extends BaseResource {
|
|
|
126
126
|
getDeploymentSettings(deploymentId: string): Promise<Record<string, unknown>>;
|
|
127
127
|
/** Governance status of the deployment's bundle (or `bundleId`'s): messages on whether it may deploy. */
|
|
128
128
|
getGovernanceStatus(deploymentId: string, bundleId?: string): Promise<Record<string, unknown>>;
|
|
129
|
+
/**
|
|
130
|
+
* Combined last-run outcome of the deployment's test scenarios, worst
|
|
131
|
+
* outcome wins. `bundleId` filters the runs to one bundle;
|
|
132
|
+
* `automationNodeId` is required for multi-node deployments only.
|
|
133
|
+
*/
|
|
134
|
+
getTestingStatus(deploymentId: string, options?: {
|
|
135
|
+
bundleId?: string;
|
|
136
|
+
automationNodeId?: string;
|
|
137
|
+
}): Promise<Record<string, unknown>>;
|
|
138
|
+
/**
|
|
139
|
+
* Run every test scenario of the deployment on its Automation node and
|
|
140
|
+
* return the resulting testing status. The request stays open until the
|
|
141
|
+
* scenarios finish. `automationNodeId` is required for multi-node
|
|
142
|
+
* deployments only.
|
|
143
|
+
*/
|
|
144
|
+
runTestScenarios(deploymentId: string, options?: {
|
|
145
|
+
automationNodeId?: string;
|
|
146
|
+
}): Promise<Record<string, unknown>>;
|
|
129
147
|
/** Delete a published project no deployment uses. */
|
|
130
148
|
deleteProject(publishedProjectKey: string): Promise<void>;
|
|
131
149
|
/** Get a published project's settings (permissions, owner). */
|
|
@@ -186,6 +186,32 @@ export class ProjectDeployerResource extends BaseResource {
|
|
|
186
186
|
const query = bundleId ? `?bundleId=${encodeURIComponent(bundleId)}` : "";
|
|
187
187
|
return this.client.get(`/public/api/project-deployer/deployments/${encodeURIComponent(deploymentId)}/governance-status${query}`);
|
|
188
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Combined last-run outcome of the deployment's test scenarios, worst
|
|
191
|
+
* outcome wins. `bundleId` filters the runs to one bundle;
|
|
192
|
+
* `automationNodeId` is required for multi-node deployments only.
|
|
193
|
+
*/
|
|
194
|
+
async getTestingStatus(deploymentId, options = {}) {
|
|
195
|
+
const query = new URLSearchParams();
|
|
196
|
+
if (options.bundleId)
|
|
197
|
+
query.set("bundleId", options.bundleId);
|
|
198
|
+
if (options.automationNodeId)
|
|
199
|
+
query.set("automationNodeId", options.automationNodeId);
|
|
200
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
201
|
+
return this.client.get(`/public/api/project-deployer/deployments/${encodeURIComponent(deploymentId)}/testing-status${suffix}`);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Run every test scenario of the deployment on its Automation node and
|
|
205
|
+
* return the resulting testing status. The request stays open until the
|
|
206
|
+
* scenarios finish. `automationNodeId` is required for multi-node
|
|
207
|
+
* deployments only.
|
|
208
|
+
*/
|
|
209
|
+
async runTestScenarios(deploymentId, options = {}) {
|
|
210
|
+
const suffix = options.automationNodeId
|
|
211
|
+
? `?automationNodeId=${encodeURIComponent(options.automationNodeId)}`
|
|
212
|
+
: "";
|
|
213
|
+
return this.client.post(`/public/api/project-deployer/deployments/${encodeURIComponent(deploymentId)}/run-test-scenarios${suffix}`);
|
|
214
|
+
}
|
|
189
215
|
/** Delete a published project no deployment uses. */
|
|
190
216
|
async deleteProject(publishedProjectKey) {
|
|
191
217
|
await this.client.del(`/public/api/project-deployer/projects/${encodeURIComponent(publishedProjectKey)}`);
|
|
@@ -21,10 +21,13 @@ export declare class FuturesResource extends BaseResource {
|
|
|
21
21
|
/**
|
|
22
22
|
* Long tasks in progress (GET /futures/): the caller's own by default,
|
|
23
23
|
* every user's with `allUsers`, running scenarios too with `withScenarios`.
|
|
24
|
+
* `scenariosOnly` lists running scenarios and nothing else, like dataikuapi's
|
|
25
|
+
* `list_running_scenarios` (`withScenarios=true&withNotScenarios=false`).
|
|
24
26
|
*/
|
|
25
27
|
list(opts?: {
|
|
26
28
|
allUsers?: boolean;
|
|
27
29
|
withScenarios?: boolean;
|
|
30
|
+
scenariosOnly?: boolean;
|
|
28
31
|
}): Promise<FutureState[]>;
|
|
29
32
|
/** Wait for a started task; a task DSS already finished inline is returned as is. */
|
|
30
33
|
waitTask(task: DssTask, opts?: FutureWaitOptions): Promise<FutureWaitResult | DssTask>;
|
|
@@ -37,12 +37,16 @@ export class FuturesResource extends BaseResource {
|
|
|
37
37
|
/**
|
|
38
38
|
* Long tasks in progress (GET /futures/): the caller's own by default,
|
|
39
39
|
* every user's with `allUsers`, running scenarios too with `withScenarios`.
|
|
40
|
+
* `scenariosOnly` lists running scenarios and nothing else, like dataikuapi's
|
|
41
|
+
* `list_running_scenarios` (`withScenarios=true&withNotScenarios=false`).
|
|
40
42
|
*/
|
|
41
43
|
async list(opts = {}) {
|
|
42
44
|
const query = new URLSearchParams({
|
|
43
45
|
allUsers: String(opts.allUsers === true),
|
|
44
|
-
withScenarios: String(opts.withScenarios === true),
|
|
46
|
+
withScenarios: String(opts.withScenarios === true || opts.scenariosOnly === true),
|
|
45
47
|
});
|
|
48
|
+
if (opts.scenariosOnly === true)
|
|
49
|
+
query.set("withNotScenarios", "false");
|
|
46
50
|
return this.client.get(`/public/api/futures/?${query}`);
|
|
47
51
|
}
|
|
48
52
|
/** Wait for a started task; a task DSS already finished inline is returned as is. */
|