dataiku-sdk 3.2.0 → 3.3.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 +149 -46
- package/dist/build-metadata.json +1 -1
- package/dist/packages/types/src/index.d.ts +102 -0
- package/dist/packages/types/src/index.js +76 -0
- package/dist/src/cli/commands/app.js +57 -15
- package/dist/src/cli/commands/bundle.js +1 -1
- package/dist/src/cli/commands/code-env.js +13 -7
- package/dist/src/cli/commands/connection.d.ts +9 -0
- package/dist/src/cli/commands/connection.js +267 -1
- package/dist/src/cli/commands/data-collection.d.ts +2 -0
- package/dist/src/cli/commands/data-collection.js +164 -0
- package/dist/src/cli/commands/dataset.js +161 -32
- package/dist/src/cli/commands/future.js +2 -2
- package/dist/src/cli/commands/group.d.ts +2 -0
- package/dist/src/cli/commands/group.js +109 -0
- package/dist/src/cli/commands/index.js +151 -78
- package/dist/src/cli/commands/knowledge-bank.d.ts +2 -0
- package/dist/src/cli/commands/knowledge-bank.js +80 -0
- package/dist/src/cli/commands/llm.d.ts +2 -0
- package/dist/src/cli/commands/llm.js +93 -0
- package/dist/src/cli/commands/macro.d.ts +2 -0
- package/dist/src/cli/commands/macro.js +221 -0
- package/dist/src/cli/commands/ml-task.js +18 -6
- package/dist/src/cli/commands/notebook.js +6 -2
- package/dist/src/cli/commands/plugin.d.ts +2 -0
- package/dist/src/cli/commands/plugin.js +799 -0
- package/dist/src/cli/commands/project-folder.d.ts +2 -0
- package/dist/src/cli/commands/project-folder.js +197 -0
- package/dist/src/cli/commands/project-git.js +14 -54
- package/dist/src/cli/commands/project.js +52 -6
- package/dist/src/cli/commands/recipe.js +36 -1
- package/dist/src/cli/commands/saved-model.d.ts +5 -0
- package/dist/src/cli/commands/saved-model.js +388 -1
- package/dist/src/cli/commands/scenario.js +138 -1
- package/dist/src/cli/commands/user.d.ts +8 -0
- package/dist/src/cli/commands/user.js +296 -0
- package/dist/src/cli/contract.d.ts +1 -2
- package/dist/src/cli/contract.js +1089 -103
- package/dist/src/cli/flags.js +30 -1
- package/dist/src/cli/helpers/app-successor.d.ts +19 -4
- package/dist/src/cli/helpers/app-successor.js +90 -30
- package/dist/src/cli/helpers/cleanup.js +3 -1
- package/dist/src/cli/helpers/flow-zone.js +1 -2
- package/dist/src/cli/output.d.ts +1 -1
- package/dist/src/cli/output.js +23 -10
- package/dist/src/cli/usage.d.ts +1 -0
- package/dist/src/cli/usage.js +47 -1
- package/dist/src/cli.js +147 -41
- package/dist/src/client.d.ts +83 -5
- package/dist/src/client.js +185 -29
- package/dist/src/errors.d.ts +3 -0
- package/dist/src/errors.js +2 -0
- package/dist/src/index.d.ts +16 -7
- package/dist/src/index.js +11 -2
- package/dist/src/resources/analyses.js +1 -8
- package/dist/src/resources/applications.d.ts +8 -6
- package/dist/src/resources/applications.js +21 -21
- package/dist/src/resources/base.d.ts +4 -0
- package/dist/src/resources/base.js +15 -0
- package/dist/src/resources/bundles.d.ts +9 -4
- package/dist/src/resources/bundles.js +10 -5
- package/dist/src/resources/connections.d.ts +78 -1
- package/dist/src/resources/connections.js +132 -1
- package/dist/src/resources/data-collections.d.ts +118 -0
- package/dist/src/resources/data-collections.js +49 -0
- package/dist/src/resources/datasets.d.ts +69 -0
- package/dist/src/resources/datasets.js +99 -1
- package/dist/src/resources/futures.d.ts +4 -1
- package/dist/src/resources/futures.js +38 -6
- package/dist/src/resources/groups.d.ts +47 -0
- package/dist/src/resources/groups.js +56 -0
- package/dist/src/resources/jobs.d.ts +8 -13
- package/dist/src/resources/jobs.js +41 -16
- package/dist/src/resources/knowledge-banks.d.ts +58 -0
- package/dist/src/resources/knowledge-banks.js +61 -0
- package/dist/src/resources/llms.d.ts +92 -0
- package/dist/src/resources/llms.js +62 -0
- package/dist/src/resources/macros.d.ts +121 -0
- package/dist/src/resources/macros.js +231 -0
- package/dist/src/resources/ml-tasks.d.ts +37 -2
- package/dist/src/resources/ml-tasks.js +100 -20
- package/dist/src/resources/model-evaluation-stores.js +1 -8
- package/dist/src/resources/notebooks.d.ts +43 -7
- package/dist/src/resources/notebooks.js +53 -13
- package/dist/src/resources/plugins.d.ts +265 -0
- package/dist/src/resources/plugins.js +458 -0
- package/dist/src/resources/project-folders.d.ts +71 -0
- package/dist/src/resources/project-folders.js +57 -0
- package/dist/src/resources/project-git.d.ts +6 -0
- package/dist/src/resources/project-git.js +69 -42
- package/dist/src/resources/project-library.d.ts +0 -1
- package/dist/src/resources/project-library.js +1 -17
- package/dist/src/resources/projects.d.ts +19 -1
- package/dist/src/resources/projects.js +27 -1
- package/dist/src/resources/recipes.d.ts +15 -1
- package/dist/src/resources/recipes.js +73 -6
- package/dist/src/resources/saved-models.d.ts +134 -1
- package/dist/src/resources/saved-models.js +214 -6
- package/dist/src/resources/scenarios.d.ts +105 -0
- package/dist/src/resources/scenarios.js +232 -106
- package/dist/src/resources/sql.js +5 -1
- package/dist/src/resources/users.d.ts +129 -0
- package/dist/src/resources/users.js +128 -0
- package/dist/src/resources/webapps.d.ts +15 -2
- package/dist/src/resources/webapps.js +18 -4
- package/dist/src/schemas.d.ts +2 -2
- package/dist/src/schemas.js +1 -1
- package/dist/src/utils/deep-merge.d.ts +1 -1
- package/dist/src/utils/polling.d.ts +20 -0
- package/dist/src/utils/polling.js +27 -0
- package/dist/src/utils/response-file.js +1 -1
- package/dist/src/utils/secret-sanitize.d.ts +54 -0
- package/dist/src/utils/secret-sanitize.js +101 -0
- package/package.json +6 -5
- package/packages/types/dist/index.d.ts +102 -0
- package/packages/types/dist/index.js +76 -0
- package/plugin.json +1 -1
- package/skills/dataiku-dss/SKILL.md +7 -5
- package/skills/dataiku-dss/references/app-releases.md +8 -7
- package/skills/dataiku-dss/references/discovery.md +4 -4
package/dist/src/client.js
CHANGED
|
@@ -13,19 +13,26 @@ import { CodeEnvsResource, } from "./resources/code-envs.js";
|
|
|
13
13
|
import { ConnectionsResource, } from "./resources/connections.js";
|
|
14
14
|
import { ContinuousActivitiesResource, } from "./resources/continuous-activities.js";
|
|
15
15
|
import { DashboardsResource, } from "./resources/dashboards.js";
|
|
16
|
+
import { DataCollectionsResource, } from "./resources/data-collections.js";
|
|
16
17
|
import { DataQualityResource, } from "./resources/data-quality.js";
|
|
17
18
|
import { DatasetsResource, } from "./resources/datasets.js";
|
|
18
19
|
import { DiscussionsResource, } from "./resources/discussions.js";
|
|
19
20
|
import { FlowZonesResource, } from "./resources/flow-zones.js";
|
|
20
21
|
import { FoldersResource, } from "./resources/folders.js";
|
|
21
22
|
import { FuturesResource, } from "./resources/futures.js";
|
|
23
|
+
import { GroupsResource, } from "./resources/groups.js";
|
|
22
24
|
import { InsightsResource, } from "./resources/insights.js";
|
|
23
25
|
import { JobsResource, } from "./resources/jobs.js";
|
|
26
|
+
import { KnowledgeBanksResource, } from "./resources/knowledge-banks.js";
|
|
27
|
+
import { LlmsResource, } from "./resources/llms.js";
|
|
28
|
+
import { MacrosResource, } from "./resources/macros.js";
|
|
24
29
|
import { MeaningsResource, } from "./resources/meanings.js";
|
|
25
30
|
import { MetricsResource, } from "./resources/metrics.js";
|
|
26
31
|
import { MlTasksResource, } from "./resources/ml-tasks.js";
|
|
27
32
|
import { ModelEvaluationStoresResource, } from "./resources/model-evaluation-stores.js";
|
|
28
33
|
import { NotebooksResource, } from "./resources/notebooks.js";
|
|
34
|
+
import { PluginsResource, } from "./resources/plugins.js";
|
|
35
|
+
import { ProjectFoldersResource, } from "./resources/project-folders.js";
|
|
29
36
|
import { ProjectGitResource, } from "./resources/project-git.js";
|
|
30
37
|
import { ProjectLibraryResource, } from "./resources/project-library.js";
|
|
31
38
|
import { ProjectsResource, } from "./resources/projects.js";
|
|
@@ -35,6 +42,7 @@ import { ScenariosResource, } from "./resources/scenarios.js";
|
|
|
35
42
|
import { SqlResource, } from "./resources/sql.js";
|
|
36
43
|
import { StatisticsResource, } from "./resources/statistics.js";
|
|
37
44
|
import { StreamingEndpointsResource, } from "./resources/streaming-endpoints.js";
|
|
45
|
+
import { UsersResource, } from "./resources/users.js";
|
|
38
46
|
import { VariablesResource, } from "./resources/variables.js";
|
|
39
47
|
import { WebappsResource, } from "./resources/webapps.js";
|
|
40
48
|
import { WikiResource, } from "./resources/wiki.js";
|
|
@@ -173,6 +181,20 @@ function buildFetchTlsOptions(config) {
|
|
|
173
181
|
}
|
|
174
182
|
return tls;
|
|
175
183
|
}
|
|
184
|
+
/**
|
|
185
|
+
* Resolve the total-budget request deadline timestamp for a per-call GET
|
|
186
|
+
* budget: `Date.now() + timeoutMs`. Undefined when no budget is supplied, in
|
|
187
|
+
* which case the client-level per-attempt timeout applies unchanged.
|
|
188
|
+
*/
|
|
189
|
+
function resolveGetDeadlineAt(options) {
|
|
190
|
+
const timeoutMs = options?.timeoutMs;
|
|
191
|
+
if (timeoutMs === undefined)
|
|
192
|
+
return undefined;
|
|
193
|
+
if (!Number.isInteger(timeoutMs) || timeoutMs < 1) {
|
|
194
|
+
throw new ClientValidationError("timeoutMs must be a positive integer.");
|
|
195
|
+
}
|
|
196
|
+
return Date.now() + timeoutMs;
|
|
197
|
+
}
|
|
176
198
|
/**
|
|
177
199
|
* True when the URL embeds userinfo (`https://user:password@host`). Embedded
|
|
178
200
|
* credentials are rejected up front so they can never reach the canonical base
|
|
@@ -240,6 +262,14 @@ export class DataikuClient {
|
|
|
240
262
|
mlTasksResource;
|
|
241
263
|
savedModelsResource;
|
|
242
264
|
modelEvaluationStoresResource;
|
|
265
|
+
projectFoldersResource;
|
|
266
|
+
dataCollectionsResource;
|
|
267
|
+
llmsResource;
|
|
268
|
+
knowledgeBanksResource;
|
|
269
|
+
macrosResource;
|
|
270
|
+
pluginsResource;
|
|
271
|
+
usersResource;
|
|
272
|
+
groupsResource;
|
|
243
273
|
get projects() {
|
|
244
274
|
return (this.projectsResource ??= new ProjectsResource(this));
|
|
245
275
|
}
|
|
@@ -348,6 +378,30 @@ export class DataikuClient {
|
|
|
348
378
|
get modelEvaluationStores() {
|
|
349
379
|
return (this.modelEvaluationStoresResource ??= new ModelEvaluationStoresResource(this));
|
|
350
380
|
}
|
|
381
|
+
get projectFolders() {
|
|
382
|
+
return (this.projectFoldersResource ??= new ProjectFoldersResource(this));
|
|
383
|
+
}
|
|
384
|
+
get dataCollections() {
|
|
385
|
+
return (this.dataCollectionsResource ??= new DataCollectionsResource(this));
|
|
386
|
+
}
|
|
387
|
+
get llms() {
|
|
388
|
+
return (this.llmsResource ??= new LlmsResource(this));
|
|
389
|
+
}
|
|
390
|
+
get knowledgeBanks() {
|
|
391
|
+
return (this.knowledgeBanksResource ??= new KnowledgeBanksResource(this));
|
|
392
|
+
}
|
|
393
|
+
get macros() {
|
|
394
|
+
return (this.macrosResource ??= new MacrosResource(this));
|
|
395
|
+
}
|
|
396
|
+
get plugins() {
|
|
397
|
+
return (this.pluginsResource ??= new PluginsResource(this));
|
|
398
|
+
}
|
|
399
|
+
get users() {
|
|
400
|
+
return (this.usersResource ??= new UsersResource(this));
|
|
401
|
+
}
|
|
402
|
+
get groups() {
|
|
403
|
+
return (this.groupsResource ??= new GroupsResource(this));
|
|
404
|
+
}
|
|
351
405
|
constructor(config) {
|
|
352
406
|
const envUrl = process.env["DATAIKU_URL"]?.trim();
|
|
353
407
|
const envApiKey = process.env["DATAIKU_API_KEY"]?.trim();
|
|
@@ -399,12 +453,10 @@ export class DataikuClient {
|
|
|
399
453
|
throw new Error("projectKey is required — pass it as a parameter or set projectKey in DataikuClientConfig");
|
|
400
454
|
}
|
|
401
455
|
/* ---- public: HTTP verbs ---- */
|
|
402
|
-
async get(path) {
|
|
403
|
-
const
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
});
|
|
407
|
-
return this.parseJsonResponse(res);
|
|
456
|
+
async get(path, options) {
|
|
457
|
+
const deadlineAt = resolveGetDeadlineAt(options);
|
|
458
|
+
const res = await this.fetchWithRetry(`${this.baseUrl}${path}`, { method: "GET", headers: this.getHeaders(), }, undefined, deadlineAt);
|
|
459
|
+
return this.parseJsonResponse(res, deadlineAt);
|
|
408
460
|
}
|
|
409
461
|
/**
|
|
410
462
|
* GET returning the parsed JSON body plus selected response metadata
|
|
@@ -496,6 +548,32 @@ export class DataikuClient {
|
|
|
496
548
|
throw this.buildResponseTooLargeError(res, this.maxResponseBodyBytes);
|
|
497
549
|
return text;
|
|
498
550
|
}
|
|
551
|
+
/** Send raw file contents through the shared authenticated transport. */
|
|
552
|
+
async postRawBody(path, body) {
|
|
553
|
+
const payload = typeof body === "string"
|
|
554
|
+
? body
|
|
555
|
+
: body.buffer instanceof ArrayBuffer
|
|
556
|
+
? new Uint8Array(body.buffer, body.byteOffset, body.byteLength)
|
|
557
|
+
: new Uint8Array(body);
|
|
558
|
+
const response = await this.fetchWithRetry(`${this.baseUrl}${path}`, {
|
|
559
|
+
method: "POST",
|
|
560
|
+
headers: this.getAnyHeaders(),
|
|
561
|
+
body: payload,
|
|
562
|
+
});
|
|
563
|
+
await response.text();
|
|
564
|
+
}
|
|
565
|
+
/** Git endpoints require Basic API-key authentication, unlike the bearer API. */
|
|
566
|
+
async requestGit(method, path, body, deadlineAt) {
|
|
567
|
+
return this.fetchWithRetry(`${this.baseUrl}${path}`, {
|
|
568
|
+
method,
|
|
569
|
+
headers: {
|
|
570
|
+
Authorization: `Basic ${Buffer.from(`${this.apiKey}:`, "utf8").toString("base64")}`,
|
|
571
|
+
Accept: "application/json",
|
|
572
|
+
"Content-Type": "application/json",
|
|
573
|
+
},
|
|
574
|
+
body: body === undefined ? undefined : JSON.stringify(body),
|
|
575
|
+
}, undefined, deadlineAt);
|
|
576
|
+
}
|
|
499
577
|
async postStream(path, body) {
|
|
500
578
|
const res = await this.fetchWithRetry(`${this.baseUrl}${path}`, {
|
|
501
579
|
method: "POST",
|
|
@@ -525,6 +603,54 @@ export class DataikuClient {
|
|
|
525
603
|
body: JSON.stringify(body),
|
|
526
604
|
});
|
|
527
605
|
}
|
|
606
|
+
/**
|
|
607
|
+
* PUT without a request body. A few DSS endpoints (bundle export) reject
|
|
608
|
+
* an empty JSON object body with 400 validation, and the official Python
|
|
609
|
+
* client sends no body at all for them.
|
|
610
|
+
*/
|
|
611
|
+
async putVoidNoBody(path) {
|
|
612
|
+
await this.fetchWithRetry(`${this.baseUrl}${path}`, {
|
|
613
|
+
method: "PUT",
|
|
614
|
+
headers: this.getHeaders(),
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* POST a multipart/form-data body built from explicit parts, with optional
|
|
619
|
+
* query parameters appended to the path, returning the parsed JSON body.
|
|
620
|
+
*
|
|
621
|
+
* A part with `value` becomes a form text field; a part with `blob`
|
|
622
|
+
* (or a `fileName` with no blob) becomes a file part — a `fileName` without
|
|
623
|
+
* blob yields a zero-byte file part, which some DSS import endpoints
|
|
624
|
+
* (e.g. saved-model MLflow version import) require for metadata-only parts.
|
|
625
|
+
* The `Content-Type` header is left to the runtime so the multipart
|
|
626
|
+
* boundary is set correctly.
|
|
627
|
+
*/
|
|
628
|
+
async uploadForm(path, parts, query) {
|
|
629
|
+
const formData = new FormData();
|
|
630
|
+
for (const part of parts) {
|
|
631
|
+
if (part.value !== undefined) {
|
|
632
|
+
formData.append(part.name, part.value);
|
|
633
|
+
continue;
|
|
634
|
+
}
|
|
635
|
+
if ((part.blob ?? null) === null && (part.fileName ?? null) === null) {
|
|
636
|
+
// Filename-less, zero-length field part — the shape the official
|
|
637
|
+
// Python client produces with files={"file": (None, None)} and
|
|
638
|
+
// the one DSS's managed-folder MLflow import requires (a Blob
|
|
639
|
+
// would always add a `filename=` parameter, even when empty).
|
|
640
|
+
formData.append(part.name, "");
|
|
641
|
+
continue;
|
|
642
|
+
}
|
|
643
|
+
const blob = part.blob ?? new Blob([]);
|
|
644
|
+
formData.append(part.name, blob, part.fileName);
|
|
645
|
+
}
|
|
646
|
+
const suffix = query && [...query.keys(),].length > 0 ? `?${query.toString()}` : "";
|
|
647
|
+
const res = await this.fetchWithRetry(`${this.baseUrl}${path}${suffix}`, {
|
|
648
|
+
method: "POST",
|
|
649
|
+
headers: { Authorization: `Bearer ${this.apiKey}`, },
|
|
650
|
+
body: formData,
|
|
651
|
+
});
|
|
652
|
+
return this.parseJsonResponse(res);
|
|
653
|
+
}
|
|
528
654
|
async uploadResponse(path, filePath, fileName) {
|
|
529
655
|
const fileBlob = Bun.file(filePath);
|
|
530
656
|
const formData = new FormData();
|
|
@@ -658,8 +784,8 @@ export class DataikuClient {
|
|
|
658
784
|
}
|
|
659
785
|
return undefined;
|
|
660
786
|
}
|
|
661
|
-
async parseJsonResponse(res) {
|
|
662
|
-
const { text, truncated, } = await this.readBoundedBodyText(res, this.maxResponseBodyBytes);
|
|
787
|
+
async parseJsonResponse(res, deadlineAt) {
|
|
788
|
+
const { text, truncated, } = await this.readBoundedBodyText(res, this.maxResponseBodyBytes, deadlineAt);
|
|
663
789
|
if (truncated)
|
|
664
790
|
throw this.buildResponseTooLargeError(res, this.maxResponseBodyBytes);
|
|
665
791
|
// SAFETY: Empty 2xx responses from DSS are surfaced to callers as undefined
|
|
@@ -677,7 +803,7 @@ export class DataikuClient {
|
|
|
677
803
|
}
|
|
678
804
|
/* ---- private: bounded response body reading ---- */
|
|
679
805
|
/**
|
|
680
|
-
* Read at most `maxBytes` of a
|
|
806
|
+
* Read at most `maxBytes` of a response body as UTF-8 text.
|
|
681
807
|
*
|
|
682
808
|
* The body is consumed with the request deadline still active (measured
|
|
683
809
|
* from the first read): a stalled body throws a DataikuError instead of
|
|
@@ -686,10 +812,15 @@ export class DataikuClient {
|
|
|
686
812
|
* text is trimmed to a UTF-8 character boundary so it never decodes beyond
|
|
687
813
|
* the byte cap.
|
|
688
814
|
*/
|
|
689
|
-
async readBoundedBodyText(res, maxBytes) {
|
|
815
|
+
async readBoundedBodyText(res, maxBytes, deadlineAt) {
|
|
690
816
|
const limit = Math.max(0, Math.floor(maxBytes));
|
|
691
817
|
if (!res.body)
|
|
692
818
|
return { text: "", truncated: false, };
|
|
819
|
+
// Total-budget mode: the read shares the call's absolute deadline, so
|
|
820
|
+
// the budget already spent on attempts/backoff is not re-credited here.
|
|
821
|
+
const bodyTimeoutMs = deadlineAt === undefined
|
|
822
|
+
? this.requestTimeoutMs
|
|
823
|
+
: Math.min(this.requestTimeoutMs, Math.max(1, deadlineAt - Date.now()));
|
|
693
824
|
const reader = res.body.getReader();
|
|
694
825
|
const decoder = new TextDecoder();
|
|
695
826
|
const parts = [];
|
|
@@ -724,10 +855,10 @@ export class DataikuClient {
|
|
|
724
855
|
const startedAt = Date.now();
|
|
725
856
|
try {
|
|
726
857
|
while (bytesRead < limit) {
|
|
727
|
-
const remainingMs =
|
|
858
|
+
const remainingMs = bodyTimeoutMs - (Date.now() - startedAt);
|
|
728
859
|
if (remainingMs <= 0)
|
|
729
|
-
throw buildBodyReadTimeoutError(
|
|
730
|
-
const { done, value, } = await readChunkWithDeadline(reader, remainingMs,
|
|
860
|
+
throw buildBodyReadTimeoutError(bodyTimeoutMs);
|
|
861
|
+
const { done, value, } = await readChunkWithDeadline(reader, remainingMs, bodyTimeoutMs);
|
|
731
862
|
if (done)
|
|
732
863
|
break;
|
|
733
864
|
const room = limit - bytesRead;
|
|
@@ -742,10 +873,10 @@ export class DataikuClient {
|
|
|
742
873
|
}
|
|
743
874
|
if (!truncated && bytesRead >= limit) {
|
|
744
875
|
// Buffer filled exactly on a chunk boundary; peek whether more data remains.
|
|
745
|
-
const remainingMs =
|
|
876
|
+
const remainingMs = bodyTimeoutMs - (Date.now() - startedAt);
|
|
746
877
|
if (remainingMs <= 0)
|
|
747
|
-
throw buildBodyReadTimeoutError(
|
|
748
|
-
const { done, } = await readChunkWithDeadline(reader, remainingMs,
|
|
878
|
+
throw buildBodyReadTimeoutError(bodyTimeoutMs);
|
|
879
|
+
const { done, } = await readChunkWithDeadline(reader, remainingMs, bodyTimeoutMs);
|
|
749
880
|
if (!done)
|
|
750
881
|
truncated = true;
|
|
751
882
|
}
|
|
@@ -838,7 +969,7 @@ export class DataikuClient {
|
|
|
838
969
|
return new DataikuError(res.status, RESPONSE_TOO_LARGE_STATUS_TEXT, `Response body exceeded the ${limit}-byte limit; the body was cancelled after ${limit} bytes.`, undefined, this.requestIdFromHeaders(res.headers));
|
|
839
970
|
}
|
|
840
971
|
/* ---- private: retry loop ---- */
|
|
841
|
-
async fetchWithRetry(url, init, retryMaxAttempts) {
|
|
972
|
+
async fetchWithRetry(url, init, retryMaxAttempts, deadlineAt) {
|
|
842
973
|
const method = (init.method ?? "GET").toUpperCase();
|
|
843
974
|
const retryEnabled = shouldRetryMethod(method) || retryMaxAttempts !== undefined;
|
|
844
975
|
const maxAttempts = retryMaxAttempts === undefined
|
|
@@ -850,11 +981,21 @@ export class DataikuClient {
|
|
|
850
981
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
851
982
|
let timedOut = false;
|
|
852
983
|
const startedAt = Date.now();
|
|
984
|
+
// An overall deadline may shorten, but never extend, the attempt cap.
|
|
985
|
+
const remainingMs = deadlineAt === undefined
|
|
986
|
+
? undefined
|
|
987
|
+
: deadlineAt - startedAt;
|
|
988
|
+
if (remainingMs !== undefined && remainingMs <= 0) {
|
|
989
|
+
throw new DataikuError(0, "Request Timeout", `Request deadline exceeded after ${attempt - 1} attempt(s) and ${delaysMs.length} backoff delay(s).`, buildRetryMetadata(method, retryEnabled, maxAttempts, attempt, delaysMs, true));
|
|
990
|
+
}
|
|
991
|
+
const attemptTimeoutMs = remainingMs === undefined
|
|
992
|
+
? this.requestTimeoutMs
|
|
993
|
+
: Math.min(remainingMs, this.requestTimeoutMs);
|
|
853
994
|
const controller = new AbortController();
|
|
854
995
|
const timeout = setTimeout(() => {
|
|
855
996
|
timedOut = true;
|
|
856
997
|
controller.abort();
|
|
857
|
-
},
|
|
998
|
+
}, attemptTimeoutMs);
|
|
858
999
|
this.logTrace({ phase: "request", method, url, attempt, maxAttempts, });
|
|
859
1000
|
try {
|
|
860
1001
|
const requestInit = {
|
|
@@ -875,30 +1016,45 @@ export class DataikuClient {
|
|
|
875
1016
|
elapsedMs: Date.now() - startedAt,
|
|
876
1017
|
});
|
|
877
1018
|
if (!res.ok) {
|
|
878
|
-
const text = await res.
|
|
1019
|
+
const { text, truncated, } = await this.readBoundedBodyText(res, this.maxResponseBodyBytes, startedAt + attemptTimeoutMs);
|
|
879
1020
|
const canRetry = retryEnabled && attempt < maxAttempts && isTransientError(res.status, text);
|
|
880
1021
|
if (canRetry) {
|
|
881
1022
|
const delayMs = computeBackoffDelayMs(attempt);
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
1023
|
+
// Do not start a retry whose backoff cannot fit in the budget.
|
|
1024
|
+
if (deadlineAt === undefined || Date.now() + delayMs <= deadlineAt) {
|
|
1025
|
+
delaysMs.push(delayMs);
|
|
1026
|
+
await sleep(delayMs);
|
|
1027
|
+
continue;
|
|
1028
|
+
}
|
|
1029
|
+
await sleep(Math.max(0, deadlineAt - Date.now()));
|
|
1030
|
+
throw new DataikuError(0, "Request Timeout", `Request deadline exceeded before backoff retry ${attempt + 1}.`, buildRetryMetadata(method, retryEnabled, maxAttempts, attempt, delaysMs, true));
|
|
885
1031
|
}
|
|
886
|
-
throw new DataikuError(res.status, res.statusText, text, buildRetryMetadata(method, retryEnabled, maxAttempts, attempt, delaysMs, false), this.requestIdFromHeaders(res.headers));
|
|
1032
|
+
throw new DataikuError(res.status, res.statusText, text, buildRetryMetadata(method, retryEnabled, maxAttempts, attempt, delaysMs, false), this.requestIdFromHeaders(res.headers), truncated ? { bodyTruncated: true, } : undefined);
|
|
887
1033
|
}
|
|
888
1034
|
return res;
|
|
889
1035
|
}
|
|
890
1036
|
catch (error) {
|
|
891
|
-
if (error instanceof DataikuError)
|
|
892
|
-
|
|
1037
|
+
if (error instanceof DataikuError) {
|
|
1038
|
+
// A bounded error-body read is still part of this transport attempt.
|
|
1039
|
+
// Preserve the same retry/deadline policy as a fetch body abort.
|
|
1040
|
+
if (error.status !== 0 || error.statusText !== "Request Timeout" || error.retry !== undefined) {
|
|
1041
|
+
throw error;
|
|
1042
|
+
}
|
|
1043
|
+
timedOut = true;
|
|
1044
|
+
}
|
|
893
1045
|
const canRetry = retryEnabled && attempt < maxAttempts;
|
|
894
1046
|
if (canRetry) {
|
|
895
1047
|
const delayMs = computeBackoffDelayMs(attempt);
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
1048
|
+
if (deadlineAt === undefined || Date.now() + delayMs <= deadlineAt) {
|
|
1049
|
+
delaysMs.push(delayMs);
|
|
1050
|
+
await sleep(delayMs);
|
|
1051
|
+
continue;
|
|
1052
|
+
}
|
|
1053
|
+
await sleep(Math.max(0, deadlineAt - Date.now()));
|
|
1054
|
+
throw new DataikuError(0, "Request Timeout", `Request deadline exceeded before backoff retry ${attempt + 1}.`, buildRetryMetadata(method, retryEnabled, maxAttempts, attempt, delaysMs, true));
|
|
899
1055
|
}
|
|
900
1056
|
const detail = timedOut
|
|
901
|
-
? `Request timed out after ${
|
|
1057
|
+
? `Request timed out after ${attemptTimeoutMs}ms`
|
|
902
1058
|
: error instanceof Error
|
|
903
1059
|
? error.message
|
|
904
1060
|
: "Unknown transport error";
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export interface DataikuRetryMetadata {
|
|
|
18
18
|
export interface DataikuErrorTrustedMetadata {
|
|
19
19
|
target?: string;
|
|
20
20
|
elapsedMs?: number;
|
|
21
|
+
/** Set by the transport when the retained response body is only a bounded prefix. */
|
|
22
|
+
bodyTruncated?: boolean;
|
|
21
23
|
}
|
|
22
24
|
export declare function canonicalStatusText(status: number): string;
|
|
23
25
|
export declare class ClientValidationError extends Error {
|
|
@@ -44,6 +46,7 @@ export declare class DataikuError extends Error {
|
|
|
44
46
|
requestId?: string;
|
|
45
47
|
readonly trustedTarget?: string;
|
|
46
48
|
readonly trustedElapsedMs?: number;
|
|
49
|
+
readonly bodyTruncated?: boolean;
|
|
47
50
|
constructor(status: number, statusText: string, body: string, retry?: DataikuRetryMetadata, requestId?: string, trustedMetadata?: DataikuErrorTrustedMetadata);
|
|
48
51
|
get safeMessage(): string;
|
|
49
52
|
private static extractSummary;
|
package/dist/src/errors.js
CHANGED
|
@@ -339,6 +339,7 @@ export class DataikuError extends Error {
|
|
|
339
339
|
requestId;
|
|
340
340
|
trustedTarget;
|
|
341
341
|
trustedElapsedMs;
|
|
342
|
+
bodyTruncated;
|
|
342
343
|
constructor(status, statusText, body, retry, requestId, trustedMetadata) {
|
|
343
344
|
const details = DataikuError.buildDetails(status, body, retry);
|
|
344
345
|
super(details.message);
|
|
@@ -353,6 +354,7 @@ export class DataikuError extends Error {
|
|
|
353
354
|
this.requestId = requestId;
|
|
354
355
|
this.trustedTarget = trustedMetadata?.target;
|
|
355
356
|
this.trustedElapsedMs = trustedMetadata?.elapsedMs;
|
|
357
|
+
this.bodyTruncated = trustedMetadata?.bodyTruncated === true ? true : undefined;
|
|
356
358
|
}
|
|
357
359
|
get safeMessage() {
|
|
358
360
|
const retrySummary = DataikuError.formatRetryMetadata(this.retry);
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DataikuClient, type DataikuClientConfig, type DataikuClientTraceEvent, } from "./client.js";
|
|
1
|
+
export { DataikuClient, type DataikuClientConfig, type DataikuClientTraceEvent, type DataikuGetOptions, type UploadFormPart, } from "./client.js";
|
|
2
2
|
export { type CredentialValidationOptions, type CredentialValidationResult, validateCredentials, } from "./auth.js";
|
|
3
3
|
export { type DssCredentials, getConfigDir, getCredentialsPath, loadCredentials, saveCredentials, } from "./config.js";
|
|
4
4
|
export { ClientValidationError, DataikuError, type DataikuErrorCategory, type DataikuErrorTaxonomy, type DataikuRetryMetadata, } from "./errors.js";
|
|
@@ -8,38 +8,47 @@ export { ApiServicesResource, } from "./resources/api-services.js";
|
|
|
8
8
|
export { ApplicationsResource, } from "./resources/applications.js";
|
|
9
9
|
export { BundlesResource, ProjectDeployerResource, } from "./resources/bundles.js";
|
|
10
10
|
export { CodeEnvsResource, } from "./resources/code-envs.js";
|
|
11
|
-
export { type ConnectionSchemaListOptions, ConnectionsResource, type ConnectionTableListOptions, } from "./resources/connections.js";
|
|
11
|
+
export { type ConnectionAdminInput, type ConnectionSchemaListOptions, ConnectionsResource, type ConnectionTableListOptions, } from "./resources/connections.js";
|
|
12
12
|
export { ContinuousActivitiesResource, } from "./resources/continuous-activities.js";
|
|
13
13
|
export { DashboardsResource, } from "./resources/dashboards.js";
|
|
14
|
+
export { type DataCollectionCreateRequest, type DataCollectionObject, type DataCollectionObjectReferenceType, type DataCollectionPermission, type DataCollectionSettings, DataCollectionsResource, type DataCollectionSummary, } from "./resources/data-collections.js";
|
|
14
15
|
export { DataQualityResource, } from "./resources/data-quality.js";
|
|
15
|
-
export { type DatasetBuildValidationResult, type DatasetCloneOptions, type DatasetCloneResult, type DatasetSchemaColumnInput, DatasetsResource, type UploadDatasetFileOptions, type UploadDatasetFileResult, type UploadedFileMetadata, } from "./resources/datasets.js";
|
|
16
|
+
export { type DatasetBuildValidationResult, type DatasetCloneOptions, type DatasetCloneResult, type DatasetManagedCreateOptions, type DatasetManagedCreateResult, type DatasetSchemaColumnInput, DatasetsResource, type UploadDatasetFileOptions, type UploadDatasetFileResult, type UploadedFileMetadata, } from "./resources/datasets.js";
|
|
16
17
|
export { DiscussionsResource, } from "./resources/discussions.js";
|
|
17
18
|
export { type FlowZoneItemInput, FlowZonesResource, } from "./resources/flow-zones.js";
|
|
18
19
|
export { FoldersResource, } from "./resources/folders.js";
|
|
19
20
|
export { FuturesResource, } from "./resources/futures.js";
|
|
21
|
+
export { type DssGroup, type GroupCreateRequest, GroupsResource, } from "./resources/groups.js";
|
|
20
22
|
export { InsightsResource, } from "./resources/insights.js";
|
|
21
|
-
export {
|
|
23
|
+
export { type JobBuildAndWaitOptions, type JobBuildOptions, type JobBuildTarget, type JobBuildTargetType, type JobLogFilter, type JobLogProgress, type JobLogSummary, type JobLogUnavailableReason, JobsResource, type JobWaitOutcome, parseJobLogProgress, } from "./resources/jobs.js";
|
|
24
|
+
export * from "./resources/knowledge-banks.js";
|
|
25
|
+
export * from "./resources/llms.js";
|
|
26
|
+
export { type MacroResultOptions, type MacroRunFailure, type MacroRunHandle, type MacroRunOptions, type MacroRunWaitedResult, MacrosResource, type MacroWaitOptions, } from "./resources/macros.js";
|
|
22
27
|
export { MeaningsResource, } from "./resources/meanings.js";
|
|
23
28
|
export { MetricsResource, } from "./resources/metrics.js";
|
|
24
29
|
export * from "./resources/ml-tasks.js";
|
|
25
30
|
export * from "./resources/model-evaluation-stores.js";
|
|
26
31
|
export { NotebooksResource, } from "./resources/notebooks.js";
|
|
32
|
+
export { type PluginCodeEnvCreateOptions, type PluginContentItem, type PluginCreateDevOptions, type PluginFileDetails, type PluginGitInstallOptions, type PluginGitRemote, type PluginMissingType, type PluginProjectScopeOptions, type PluginSettings, PluginsResource, type PluginSummary, type PluginUsage, type PluginUsageReport, } from "./resources/plugins.js";
|
|
33
|
+
export { type ProjectFolder, type ProjectFolderPermission, type ProjectFolderSettings, ProjectFoldersResource, } from "./resources/project-folders.js";
|
|
27
34
|
export * from "./resources/project-git.js";
|
|
28
35
|
export { ProjectLibraryResource, } from "./resources/project-library.js";
|
|
29
36
|
export { type FlowMapResult, type ProjectImportProcessResult, type ProjectImportResult, type ProjectImportSettings, type ProjectImportUploadResult, ProjectsResource, } from "./resources/projects.js";
|
|
30
37
|
export { type RecipeCloneOptions, type RecipeCloneResult, type RecipeGraphReference, type RecipeGraphValidationResult, type RecipeRunOptions, type RecipeRunOutput, type RecipeRunResult, RecipesResource, } from "./resources/recipes.js";
|
|
31
38
|
export * from "./resources/saved-models.js";
|
|
32
|
-
export { normalizeScenarioUpdateData, SCENARIO_CANONICAL_EDITABLE_FIELDS, type ScenarioFieldChange, type ScenarioFieldMismatch, type ScenarioScriptRunResult, ScenariosResource, type ScenarioUpdateNormalization, type ScenarioUpdatePreview, scenarioUpdatePreview, type ScenarioUpdateResult, } from "./resources/scenarios.js";
|
|
39
|
+
export { normalizeScenarioUpdateData, SCENARIO_CANONICAL_EDITABLE_FIELDS, type ScenarioActiveUpdateResult, type ScenarioFieldChange, type ScenarioFieldMismatch, type ScenarioLightStatus, type ScenarioRunDetails, type ScenarioRunLog, type ScenarioRunStepReport, type ScenarioRunSummary, type ScenarioScriptRunResult, ScenariosResource, type ScenarioUpdateNormalization, type ScenarioUpdatePreview, scenarioUpdatePreview, type ScenarioUpdateResult, } from "./resources/scenarios.js";
|
|
33
40
|
export { SqlResource, } from "./resources/sql.js";
|
|
34
41
|
export { StatisticsResource, } from "./resources/statistics.js";
|
|
35
42
|
export { StreamingEndpointsResource, } from "./resources/streaming-endpoints.js";
|
|
43
|
+
export { type DssUser, type ExternalUserEntry, type ProvisionRequest, type UserActivity, type UserCreateRequest, UsersResource, } from "./resources/users.js";
|
|
36
44
|
export { VariablesResource, } from "./resources/variables.js";
|
|
37
45
|
export { WebappsResource, } from "./resources/webapps.js";
|
|
38
46
|
export { WikiResource, } from "./resources/wiki.js";
|
|
39
47
|
export { WorkspacesResource, } from "./resources/workspaces.js";
|
|
40
|
-
export {
|
|
48
|
+
export { computeNextPollDelayMs, } from "./utils/polling.js";
|
|
49
|
+
export { BuildModeSchema, CodeEnvActionResultSchema, CodeEnvCreateOptionsSchema, CodeEnvDetailsSchema, CodeEnvGetLogOptionsSchema, CodeEnvLogResultSchema, CodeEnvLogSummaryArraySchema, CodeEnvLogSummarySchema, CodeEnvPackageListSchema, CodeEnvSetPackagesOptionsSchema, CodeEnvSummaryArraySchema, CodeEnvSummarySchema, CodeEnvUpdateImagesOptionsSchema, CodeEnvUpdatePackagesOptionsSchema, CodeEnvUsageArraySchema, CodeEnvVersionForProjectSchema, CodeEnvWaitOptionsSchema, ConnectionSummarySchema, DashboardDetailsSchema, DashboardSummaryArraySchema, DashboardSummarySchema, DataQualityComputeResultSchema, DataQualityProjectStatusSchema, DataQualityRuleArraySchema, DataQualityRuleResultArraySchema, DataQualityRuleResultSchema, DataQualityRuleSchema, DataQualityRulesSchema, DataQualityStatusByPartitionSchema, DataQualityStatusSchema, DataQualityTimelineEntrySchema, DataQualityTimelineSchema, DatasetCreateOptionsSchema, DatasetDetailsSchema, DatasetSchemaSchema, DatasetSummaryArraySchema, DatasetSummarySchema, FlowMapOptionsSchema, FlowZoneArraySchema, FlowZoneCreateOptionsSchema, FlowZoneItemSchema, FlowZoneObjectTypeSchema, FlowZonePositionSchema, FlowZoneSchema, FlowZoneUpdateOptionsSchema, FolderCreateOptionsSchema, FolderDetailsSchema, FolderItemArraySchema, FolderItemSchema, FolderSummaryArraySchema, FolderSummarySchema, FutureStateSchema, FutureWaitResultSchema, InsightDetailsSchema, InsightSummaryArraySchema, InsightSummarySchema, JobSummaryArraySchema, JobSummarySchema, JobWaitResultSchema, JupyterCellSchema, JupyterNotebookContentSchema, JupyterNotebookSummaryArraySchema, JupyterNotebookSummarySchema, MacroDefinitionSchema, MacroRunStartSchema, MacroStateSchema, MacroSummaryArraySchema, MacroSummarySchema, MacroWaitResultSchema, NotebookSessionArraySchema, NotebookSessionSchema, parseSchema, ProjectDetailsSchema, ProjectGitActionResultSchema, ProjectGitDiffResultSchema, ProjectGitFutureResponseSchema, ProjectGitFutureStateSchema, ProjectGitLibrariesSchema, ProjectGitLibrarySchema, ProjectGitLogResultSchema, ProjectGitRemoteSchema, ProjectGitStatusSchema, ProjectGitTagSchema, ProjectGitTagsSchema, ProjectMetadataSchema, ProjectSummaryArraySchema, ProjectSummarySchema, ProjectTagsSchema, ProjectVariablesSchema, RecipeCreateOptionsSchema, RecipeCreateResultSchema, RecipeDetailsSchema, RecipeSummaryArraySchema, RecipeSummarySchema, safeParseSchema, ScenarioDetailsSchema, ScenarioStatusSchema, ScenarioStepRunSchema, ScenarioSummaryArraySchema, ScenarioSummarySchema, ScenarioWaitResultSchema, SqlNotebookCellSchema, SqlNotebookContentSchema, SqlNotebookHistorySchema, SqlNotebookSummaryArraySchema, SqlNotebookSummarySchema, SqlQueryResponseSchema, SqlQueryResultSchema, SqlQuerySchemaSchema, WikiArticleDataArraySchema, WikiArticleDataSchema, WikiArticleMetadataSchema, WikiSettingsSchema, WikiTaxonomyNodeSchema, } from "./schemas.js";
|
|
41
50
|
export type { SafeParseResult, } from "./schemas.js";
|
|
42
|
-
export type { BuildMode, CodeEnvActionResult, CodeEnvCreateOptions, CodeEnvDetails, CodeEnvGetLogOptions, CodeEnvLogResult, CodeEnvLogSummary, CodeEnvPackageList, CodeEnvSetPackagesOptions, CodeEnvSummary, CodeEnvUpdateImagesOptions, CodeEnvUpdatePackagesOptions, CodeEnvUsage, CodeEnvVersionForProject, CodeEnvWaitOptions, ConnectionSummary, DashboardDetails, DashboardSummary, DataQualityComputeResult, DataQualityProjectStatus, DataQualityRule, DataQualityRuleResult, DataQualityRules, DataQualityStatus, DataQualityStatusByPartition, DataQualityTimeline, DataQualityTimelineEntry, DatasetCreateOptions, DatasetDetails, DatasetSchema, DatasetSummary, FlowMapOptions, FlowZone, FlowZoneCreateOptions, FlowZoneItem, FlowZoneObjectType, FlowZonePosition, FlowZoneUpdateOptions, FolderCreateOptions, FolderDetails, FolderItem, FolderSummary, FutureState, FutureWaitResult, InsightDetails, InsightSummary, JobSummary, JobWaitResult, JupyterCell, JupyterNotebookContent, JupyterNotebookSummary, NotebookSession, ProjectDetails, ProjectGitActionResult, ProjectGitDiffResult, ProjectGitFutureResponse, ProjectGitFutureState, ProjectGitLibraries, ProjectGitLibrary, ProjectGitLogResult, ProjectGitRemote, ProjectGitStatus, ProjectGitTag, ProjectGitTags, ProjectMetadata, ProjectSummary, ProjectVariables, RecipeCreateOptions, RecipeCreateResult, RecipeDetails, RecipeSummary, ScenarioDetails, ScenarioStatus, ScenarioStepRun, ScenarioSummary, ScenarioWaitResult, SqlNotebookCell, SqlNotebookContent, SqlNotebookSummary, SqlQueryResponse, SqlQueryResult, SqlQuerySchema, WikiArticleData, WikiArticleMetadata, WikiSettings, WikiTaxonomyNode, } from "./schemas.js";
|
|
51
|
+
export type { BuildMode, CodeEnvActionResult, CodeEnvCreateOptions, CodeEnvDetails, CodeEnvGetLogOptions, CodeEnvLogResult, CodeEnvLogSummary, CodeEnvPackageList, CodeEnvSetPackagesOptions, CodeEnvSummary, CodeEnvUpdateImagesOptions, CodeEnvUpdatePackagesOptions, CodeEnvUsage, CodeEnvVersionForProject, CodeEnvWaitOptions, ConnectionSummary, DashboardDetails, DashboardSummary, DataQualityComputeResult, DataQualityProjectStatus, DataQualityRule, DataQualityRuleResult, DataQualityRules, DataQualityStatus, DataQualityStatusByPartition, DataQualityTimeline, DataQualityTimelineEntry, DatasetCreateOptions, DatasetDetails, DatasetSchema, DatasetSummary, FlowMapOptions, FlowZone, FlowZoneCreateOptions, FlowZoneItem, FlowZoneObjectType, FlowZonePosition, FlowZoneUpdateOptions, FolderCreateOptions, FolderDetails, FolderItem, FolderSummary, FutureState, FutureWaitResult, InsightDetails, InsightSummary, JobSummary, JobWaitResult, JupyterCell, JupyterNotebookContent, JupyterNotebookSummary, MacroDefinition, MacroRunStart, MacroState, MacroSummary, MacroSummaryArray, MacroWaitResult, NotebookSession, ProjectDetails, ProjectGitActionResult, ProjectGitDiffResult, ProjectGitFutureResponse, ProjectGitFutureState, ProjectGitLibraries, ProjectGitLibrary, ProjectGitLogResult, ProjectGitRemote, ProjectGitStatus, ProjectGitTag, ProjectGitTags, ProjectMetadata, ProjectSummary, ProjectTags, ProjectVariables, RecipeCreateOptions, RecipeCreateResult, RecipeDetails, RecipeSummary, ScenarioDetails, ScenarioStatus, ScenarioStepRun, ScenarioSummary, ScenarioWaitResult, SqlNotebookCell, SqlNotebookContent, SqlNotebookSummary, SqlQueryResponse, SqlQueryResult, SqlQuerySchema, WikiArticleData, WikiArticleMetadata, WikiSettings, WikiTaxonomyNode, } from "./schemas.js";
|
|
43
52
|
export { deepMerge, } from "./utils/deep-merge.js";
|
|
44
53
|
export { type AnalyzedFlowMap, type AnalyzedFlowNode, analyzeFlowMap, type FlowMapComponent, type FlowMapDiagnostic, type FlowMapRendering, type FlowMapZone, type FlowRenderFormat, flowTopologyFingerprint, renderFlowMap, } from "./utils/flow-analysis.js";
|
|
45
54
|
export { type NormalizedFlowEdge, type NormalizedFlowMap, type NormalizedFlowNode, normalizeFlowGraph, } from "./utils/flow-map.js";
|
package/dist/src/index.js
CHANGED
|
@@ -15,19 +15,26 @@ export { CodeEnvsResource, } from "./resources/code-envs.js";
|
|
|
15
15
|
export { ConnectionsResource, } from "./resources/connections.js";
|
|
16
16
|
export { ContinuousActivitiesResource, } from "./resources/continuous-activities.js";
|
|
17
17
|
export { DashboardsResource, } from "./resources/dashboards.js";
|
|
18
|
+
export { DataCollectionsResource, } from "./resources/data-collections.js";
|
|
18
19
|
export { DataQualityResource, } from "./resources/data-quality.js";
|
|
19
20
|
export { DatasetsResource, } from "./resources/datasets.js";
|
|
20
21
|
export { DiscussionsResource, } from "./resources/discussions.js";
|
|
21
22
|
export { FlowZonesResource, } from "./resources/flow-zones.js";
|
|
22
23
|
export { FoldersResource, } from "./resources/folders.js";
|
|
23
24
|
export { FuturesResource, } from "./resources/futures.js";
|
|
25
|
+
export { GroupsResource, } from "./resources/groups.js";
|
|
24
26
|
export { InsightsResource, } from "./resources/insights.js";
|
|
25
|
-
export {
|
|
27
|
+
export { JobsResource, parseJobLogProgress, } from "./resources/jobs.js";
|
|
28
|
+
export * from "./resources/knowledge-banks.js";
|
|
29
|
+
export * from "./resources/llms.js";
|
|
30
|
+
export { MacrosResource, } from "./resources/macros.js";
|
|
26
31
|
export { MeaningsResource, } from "./resources/meanings.js";
|
|
27
32
|
export { MetricsResource, } from "./resources/metrics.js";
|
|
28
33
|
export * from "./resources/ml-tasks.js";
|
|
29
34
|
export * from "./resources/model-evaluation-stores.js";
|
|
30
35
|
export { NotebooksResource, } from "./resources/notebooks.js";
|
|
36
|
+
export { PluginsResource, } from "./resources/plugins.js";
|
|
37
|
+
export { ProjectFoldersResource, } from "./resources/project-folders.js";
|
|
31
38
|
export * from "./resources/project-git.js";
|
|
32
39
|
export { ProjectLibraryResource, } from "./resources/project-library.js";
|
|
33
40
|
export { ProjectsResource, } from "./resources/projects.js";
|
|
@@ -37,12 +44,14 @@ export { normalizeScenarioUpdateData, SCENARIO_CANONICAL_EDITABLE_FIELDS, Scenar
|
|
|
37
44
|
export { SqlResource, } from "./resources/sql.js";
|
|
38
45
|
export { StatisticsResource, } from "./resources/statistics.js";
|
|
39
46
|
export { StreamingEndpointsResource, } from "./resources/streaming-endpoints.js";
|
|
47
|
+
export { UsersResource, } from "./resources/users.js";
|
|
40
48
|
export { VariablesResource, } from "./resources/variables.js";
|
|
41
49
|
export { WebappsResource, } from "./resources/webapps.js";
|
|
42
50
|
export { WikiResource, } from "./resources/wiki.js";
|
|
43
51
|
export { WorkspacesResource, } from "./resources/workspaces.js";
|
|
52
|
+
export { computeNextPollDelayMs, } from "./utils/polling.js";
|
|
44
53
|
// Schemas (TypeBox schema objects for runtime validation)
|
|
45
|
-
export { BuildModeSchema, CodeEnvActionResultSchema, CodeEnvCreateOptionsSchema, CodeEnvDetailsSchema, CodeEnvGetLogOptionsSchema, CodeEnvLogResultSchema, CodeEnvLogSummaryArraySchema, CodeEnvLogSummarySchema, CodeEnvPackageListSchema, CodeEnvSetPackagesOptionsSchema, CodeEnvSummaryArraySchema, CodeEnvSummarySchema, CodeEnvUpdateImagesOptionsSchema, CodeEnvUpdatePackagesOptionsSchema, CodeEnvUsageArraySchema, CodeEnvVersionForProjectSchema, CodeEnvWaitOptionsSchema, ConnectionSummarySchema, DashboardDetailsSchema, DashboardSummaryArraySchema, DashboardSummarySchema, DataQualityComputeResultSchema, DataQualityProjectStatusSchema, DataQualityRuleArraySchema, DataQualityRuleResultArraySchema, DataQualityRuleResultSchema, DataQualityRuleSchema, DataQualityRulesSchema, DataQualityStatusByPartitionSchema, DataQualityStatusSchema, DataQualityTimelineEntrySchema, DataQualityTimelineSchema, DatasetCreateOptionsSchema, DatasetDetailsSchema, DatasetSchemaSchema, DatasetSummaryArraySchema, DatasetSummarySchema, FlowMapOptionsSchema, FlowZoneArraySchema, FlowZoneCreateOptionsSchema, FlowZoneItemSchema, FlowZoneObjectTypeSchema, FlowZonePositionSchema, FlowZoneSchema, FlowZoneUpdateOptionsSchema, FolderCreateOptionsSchema, FolderDetailsSchema, FolderItemArraySchema, FolderItemSchema, FolderSummaryArraySchema, FolderSummarySchema, FutureStateSchema, FutureWaitResultSchema, InsightDetailsSchema, InsightSummaryArraySchema, InsightSummarySchema, JobSummaryArraySchema, JobSummarySchema, JobWaitResultSchema, JupyterCellSchema, JupyterNotebookContentSchema, JupyterNotebookSummaryArraySchema, JupyterNotebookSummarySchema, NotebookSessionArraySchema, NotebookSessionSchema, parseSchema, ProjectDetailsSchema, ProjectGitActionResultSchema, ProjectGitDiffResultSchema, ProjectGitFutureResponseSchema, ProjectGitFutureStateSchema, ProjectGitLibrariesSchema, ProjectGitLibrarySchema, ProjectGitLogResultSchema, ProjectGitRemoteSchema, ProjectGitStatusSchema, ProjectGitTagSchema, ProjectGitTagsSchema, ProjectMetadataSchema, ProjectSummaryArraySchema, ProjectSummarySchema, ProjectVariablesSchema, RecipeCreateOptionsSchema, RecipeCreateResultSchema, RecipeDetailsSchema, RecipeSummaryArraySchema, RecipeSummarySchema, safeParseSchema, ScenarioDetailsSchema, ScenarioStatusSchema, ScenarioStepRunSchema, ScenarioSummaryArraySchema, ScenarioSummarySchema, ScenarioWaitResultSchema, SqlNotebookCellSchema, SqlNotebookContentSchema, SqlNotebookHistorySchema, SqlNotebookSummaryArraySchema, SqlNotebookSummarySchema, SqlQueryResponseSchema, SqlQueryResultSchema, SqlQuerySchemaSchema, WikiArticleDataArraySchema, WikiArticleDataSchema, WikiArticleMetadataSchema, WikiSettingsSchema, WikiTaxonomyNodeSchema, } from "./schemas.js";
|
|
54
|
+
export { BuildModeSchema, CodeEnvActionResultSchema, CodeEnvCreateOptionsSchema, CodeEnvDetailsSchema, CodeEnvGetLogOptionsSchema, CodeEnvLogResultSchema, CodeEnvLogSummaryArraySchema, CodeEnvLogSummarySchema, CodeEnvPackageListSchema, CodeEnvSetPackagesOptionsSchema, CodeEnvSummaryArraySchema, CodeEnvSummarySchema, CodeEnvUpdateImagesOptionsSchema, CodeEnvUpdatePackagesOptionsSchema, CodeEnvUsageArraySchema, CodeEnvVersionForProjectSchema, CodeEnvWaitOptionsSchema, ConnectionSummarySchema, DashboardDetailsSchema, DashboardSummaryArraySchema, DashboardSummarySchema, DataQualityComputeResultSchema, DataQualityProjectStatusSchema, DataQualityRuleArraySchema, DataQualityRuleResultArraySchema, DataQualityRuleResultSchema, DataQualityRuleSchema, DataQualityRulesSchema, DataQualityStatusByPartitionSchema, DataQualityStatusSchema, DataQualityTimelineEntrySchema, DataQualityTimelineSchema, DatasetCreateOptionsSchema, DatasetDetailsSchema, DatasetSchemaSchema, DatasetSummaryArraySchema, DatasetSummarySchema, FlowMapOptionsSchema, FlowZoneArraySchema, FlowZoneCreateOptionsSchema, FlowZoneItemSchema, FlowZoneObjectTypeSchema, FlowZonePositionSchema, FlowZoneSchema, FlowZoneUpdateOptionsSchema, FolderCreateOptionsSchema, FolderDetailsSchema, FolderItemArraySchema, FolderItemSchema, FolderSummaryArraySchema, FolderSummarySchema, FutureStateSchema, FutureWaitResultSchema, InsightDetailsSchema, InsightSummaryArraySchema, InsightSummarySchema, JobSummaryArraySchema, JobSummarySchema, JobWaitResultSchema, JupyterCellSchema, JupyterNotebookContentSchema, JupyterNotebookSummaryArraySchema, JupyterNotebookSummarySchema, MacroDefinitionSchema, MacroRunStartSchema, MacroStateSchema, MacroSummaryArraySchema, MacroSummarySchema, MacroWaitResultSchema, NotebookSessionArraySchema, NotebookSessionSchema, parseSchema, ProjectDetailsSchema, ProjectGitActionResultSchema, ProjectGitDiffResultSchema, ProjectGitFutureResponseSchema, ProjectGitFutureStateSchema, ProjectGitLibrariesSchema, ProjectGitLibrarySchema, ProjectGitLogResultSchema, ProjectGitRemoteSchema, ProjectGitStatusSchema, ProjectGitTagSchema, ProjectGitTagsSchema, ProjectMetadataSchema, ProjectSummaryArraySchema, ProjectSummarySchema, ProjectTagsSchema, ProjectVariablesSchema, RecipeCreateOptionsSchema, RecipeCreateResultSchema, RecipeDetailsSchema, RecipeSummaryArraySchema, RecipeSummarySchema, safeParseSchema, ScenarioDetailsSchema, ScenarioStatusSchema, ScenarioStepRunSchema, ScenarioSummaryArraySchema, ScenarioSummarySchema, ScenarioWaitResultSchema, SqlNotebookCellSchema, SqlNotebookContentSchema, SqlNotebookHistorySchema, SqlNotebookSummaryArraySchema, SqlNotebookSummarySchema, SqlQueryResponseSchema, SqlQueryResultSchema, SqlQuerySchemaSchema, WikiArticleDataArraySchema, WikiArticleDataSchema, WikiArticleMetadataSchema, WikiSettingsSchema, WikiTaxonomyNodeSchema, } from "./schemas.js";
|
|
46
55
|
// Utilities
|
|
47
56
|
export { deepMerge, } from "./utils/deep-merge.js";
|
|
48
57
|
export { analyzeFlowMap, flowTopologyFingerprint, renderFlowMap, } from "./utils/flow-analysis.js";
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BaseResource, } from "./base.js";
|
|
3
|
-
function requireNonEmpty(value, name) {
|
|
4
|
-
if (typeof value !== "string" || value.trim().length === 0) {
|
|
5
|
-
throw new UsageError(`${name} must be a non-empty string.`, "validation_failed");
|
|
6
|
-
}
|
|
7
|
-
return value;
|
|
8
|
-
}
|
|
1
|
+
import { BaseResource, requireNonEmpty, } from "./base.js";
|
|
9
2
|
export class AnalysesResource extends BaseResource {
|
|
10
3
|
/** List visual analyses in a project. */
|
|
11
4
|
async list(projectKey) {
|
|
@@ -28,7 +28,7 @@ export interface DeleteAppInstanceOptions {
|
|
|
28
28
|
export type AppManifestReferenceKind = "scenario" | "folder" | "variable";
|
|
29
29
|
/**
|
|
30
30
|
* Source-verifiable app-manifest reference locations. Validation is scoped to
|
|
31
|
-
* homepage tiles so identically named keys in arbitrary custom
|
|
31
|
+
* homepage tiles so identically named keys in arbitrary custom tile `config`
|
|
32
32
|
* objects are never treated as references.
|
|
33
33
|
*/
|
|
34
34
|
export declare const APP_MANIFEST_REFERENCE_KEYS: Record<AppManifestReferenceKind, string[]>;
|
|
@@ -207,11 +207,13 @@ export declare class ApplicationsResource extends BaseResource {
|
|
|
207
207
|
setManifestVersion(update: AppManifestVersionUpdate, projectKey?: string): Promise<AppManifestVersionWriteResult>;
|
|
208
208
|
/**
|
|
209
209
|
* Validate source-verifiable references in app homepage tiles:
|
|
210
|
-
* SCENARIO_RUN scenario IDs,
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
210
|
+
* SCENARIO_RUN scenario IDs, DOWNLOAD_MANAGED_FOLDER_FILE managed-folder IDs,
|
|
211
|
+
* and PROJECT_VARIABLES_EDIT parameter names (which DSS maps to project
|
|
212
|
+
* variables). Tile types outside that set, including custom tiles and their
|
|
213
|
+
* `config` objects, remain opaque and are never parsed for references. The
|
|
214
|
+
* manifest is never mutated. Missing/malformed references are returned
|
|
215
|
+
* deterministically; a reference kind with no applicable tiles does not
|
|
216
|
+
* trigger its project API.
|
|
215
217
|
*/
|
|
216
218
|
validateAppManifest(manifest: unknown, projectKey?: string): Promise<AppManifestValidationResult>;
|
|
217
219
|
/**
|