dataiku-sdk 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -0
- package/bin/dss.js +39 -13
- package/dist/packages/types/src/index.d.ts +21 -0
- package/dist/packages/types/src/index.js +7 -0
- package/dist/src/cli.js +1237 -505
- package/dist/src/client.d.ts +18 -17
- package/dist/src/client.js +49 -36
- package/dist/src/config.d.ts +0 -2
- package/dist/src/config.js +1 -16
- package/dist/src/errors.d.ts +2 -1
- package/dist/src/errors.js +3 -1
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.js +2 -2
- package/dist/src/resources/datasets.d.ts +21 -7
- package/dist/src/resources/datasets.js +85 -70
- package/dist/src/resources/flow-zones.d.ts +1 -1
- package/dist/src/resources/flow-zones.js +3 -1
- package/dist/src/resources/jobs.d.ts +1 -0
- package/dist/src/resources/jobs.js +1 -1
- package/dist/src/resources/recipes.d.ts +1 -0
- package/dist/src/resources/recipes.js +42 -2
- package/dist/src/resources/scenarios.d.ts +24 -0
- package/dist/src/resources/scenarios.js +161 -0
- package/dist/src/schemas.d.ts +2 -2
- package/dist/src/schemas.js +1 -1
- package/dist/src/skill.d.ts +5 -0
- package/dist/src/skill.js +93 -100
- package/dist/src/utils/cleanup-ledger.js +22 -1
- package/package.json +2 -1
- package/packages/types/dist/index.d.ts +21 -0
- package/packages/types/dist/index.js +7 -0
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { appendFile, mkdir, readFile, } from "node:fs/promises";
|
|
2
2
|
import { dirname, resolve, } from "node:path";
|
|
3
|
+
function isCleanupLedgerEntry(value) {
|
|
4
|
+
if (!value || typeof value !== "object")
|
|
5
|
+
return false;
|
|
6
|
+
const candidate = value;
|
|
7
|
+
if (typeof candidate.ts !== "string")
|
|
8
|
+
return false;
|
|
9
|
+
if (typeof candidate.action !== "string")
|
|
10
|
+
return false;
|
|
11
|
+
if (typeof candidate.resource !== "string")
|
|
12
|
+
return false;
|
|
13
|
+
if (!candidate.cleanup || typeof candidate.cleanup !== "object")
|
|
14
|
+
return false;
|
|
15
|
+
const cleanup = candidate.cleanup;
|
|
16
|
+
return Array.isArray(cleanup.argv) && cleanup.argv.every((arg) => typeof arg === "string");
|
|
17
|
+
}
|
|
3
18
|
export async function appendCleanupLedgerEntry(filePath, entry) {
|
|
4
19
|
const resolved = resolve(filePath);
|
|
5
20
|
await mkdir(dirname(resolved), { recursive: true, });
|
|
@@ -11,5 +26,11 @@ export async function readCleanupLedger(filePath) {
|
|
|
11
26
|
.split(/\r?\n/)
|
|
12
27
|
.map((line) => line.trim())
|
|
13
28
|
.filter((line) => line.length > 0)
|
|
14
|
-
.map((line) =>
|
|
29
|
+
.map((line, index) => {
|
|
30
|
+
const parsed = JSON.parse(line);
|
|
31
|
+
if (!isCleanupLedgerEntry(parsed)) {
|
|
32
|
+
throw new Error(`Invalid cleanup ledger entry at line ${index + 1}`);
|
|
33
|
+
}
|
|
34
|
+
return parsed;
|
|
35
|
+
});
|
|
15
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dataiku-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Dataiku DSS SDK and CLI for programmatic access to DSS REST APIs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsc && cd packages/types && npx tsc",
|
|
24
|
+
"prepack": "bun run build",
|
|
24
25
|
"prepublishOnly": "bun run build",
|
|
25
26
|
"check": "tsc --noEmit",
|
|
26
27
|
"lint": "oxlint src/",
|
|
@@ -282,6 +282,11 @@ export declare const FlowZoneItemSchema: import("@sinclair/typebox").TObject<{
|
|
|
282
282
|
projectKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
283
283
|
}>;
|
|
284
284
|
export type FlowZoneItem = Static<typeof FlowZoneItemSchema>;
|
|
285
|
+
export declare const FlowZonePositionSchema: import("@sinclair/typebox").TObject<{
|
|
286
|
+
x: import("@sinclair/typebox").TNumber;
|
|
287
|
+
y: import("@sinclair/typebox").TNumber;
|
|
288
|
+
}>;
|
|
289
|
+
export type FlowZonePosition = Static<typeof FlowZonePositionSchema>;
|
|
285
290
|
export declare const FlowZoneSchema: import("@sinclair/typebox").TObject<{
|
|
286
291
|
id: import("@sinclair/typebox").TString;
|
|
287
292
|
name: import("@sinclair/typebox").TString;
|
|
@@ -297,6 +302,10 @@ export declare const FlowZoneSchema: import("@sinclair/typebox").TObject<{
|
|
|
297
302
|
objectType: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"DATASET">, import("@sinclair/typebox").TLiteral<"MANAGED_FOLDER">, import("@sinclair/typebox").TLiteral<"SAVED_MODEL">, import("@sinclair/typebox").TLiteral<"RECIPE">, import("@sinclair/typebox").TLiteral<"MODEL_EVALUATION_STORE">, import("@sinclair/typebox").TLiteral<"STREAMING_ENDPOINT">, import("@sinclair/typebox").TLiteral<"LABELING_TASK">, import("@sinclair/typebox").TLiteral<"RETRIEVABLE_KNOWLEDGE">]>;
|
|
298
303
|
projectKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
299
304
|
}>>>;
|
|
305
|
+
position: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
306
|
+
x: import("@sinclair/typebox").TNumber;
|
|
307
|
+
y: import("@sinclair/typebox").TNumber;
|
|
308
|
+
}>>;
|
|
300
309
|
}>;
|
|
301
310
|
export type FlowZone = Static<typeof FlowZoneSchema>;
|
|
302
311
|
export declare const FlowZoneArraySchema: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
@@ -314,17 +323,29 @@ export declare const FlowZoneArraySchema: import("@sinclair/typebox").TArray<imp
|
|
|
314
323
|
objectType: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"DATASET">, import("@sinclair/typebox").TLiteral<"MANAGED_FOLDER">, import("@sinclair/typebox").TLiteral<"SAVED_MODEL">, import("@sinclair/typebox").TLiteral<"RECIPE">, import("@sinclair/typebox").TLiteral<"MODEL_EVALUATION_STORE">, import("@sinclair/typebox").TLiteral<"STREAMING_ENDPOINT">, import("@sinclair/typebox").TLiteral<"LABELING_TASK">, import("@sinclair/typebox").TLiteral<"RETRIEVABLE_KNOWLEDGE">]>;
|
|
315
324
|
projectKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
316
325
|
}>>>;
|
|
326
|
+
position: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
327
|
+
x: import("@sinclair/typebox").TNumber;
|
|
328
|
+
y: import("@sinclair/typebox").TNumber;
|
|
329
|
+
}>>;
|
|
317
330
|
}>>;
|
|
318
331
|
export declare const FlowZoneCreateOptionsSchema: import("@sinclair/typebox").TObject<{
|
|
319
332
|
name: import("@sinclair/typebox").TString;
|
|
320
333
|
color: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
321
334
|
projectKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
335
|
+
position: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
336
|
+
x: import("@sinclair/typebox").TNumber;
|
|
337
|
+
y: import("@sinclair/typebox").TNumber;
|
|
338
|
+
}>>;
|
|
322
339
|
}>;
|
|
323
340
|
export type FlowZoneCreateOptions = Static<typeof FlowZoneCreateOptionsSchema>;
|
|
324
341
|
export declare const FlowZoneUpdateOptionsSchema: import("@sinclair/typebox").TObject<{
|
|
325
342
|
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
326
343
|
color: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
327
344
|
projectKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
345
|
+
position: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
346
|
+
x: import("@sinclair/typebox").TNumber;
|
|
347
|
+
y: import("@sinclair/typebox").TNumber;
|
|
348
|
+
}>>;
|
|
328
349
|
}>;
|
|
329
350
|
export type FlowZoneUpdateOptions = Static<typeof FlowZoneUpdateOptionsSchema>;
|
|
330
351
|
export declare const FolderCreateOptionsSchema: import("@sinclair/typebox").TObject<{
|
|
@@ -340,6 +340,10 @@ export const FlowZoneItemSchema = Type.Object({
|
|
|
340
340
|
objectType: FlowZoneObjectTypeSchema,
|
|
341
341
|
projectKey: Type.Optional(Type.String()),
|
|
342
342
|
}, { additionalProperties: true, });
|
|
343
|
+
export const FlowZonePositionSchema = Type.Object({
|
|
344
|
+
x: Type.Number(),
|
|
345
|
+
y: Type.Number(),
|
|
346
|
+
}, { additionalProperties: false, });
|
|
343
347
|
export const FlowZoneSchema = Type.Object({
|
|
344
348
|
id: Type.String(),
|
|
345
349
|
name: Type.String(),
|
|
@@ -347,17 +351,20 @@ export const FlowZoneSchema = Type.Object({
|
|
|
347
351
|
projectKey: Type.Optional(Type.String()),
|
|
348
352
|
items: Type.Optional(Type.Array(FlowZoneItemSchema)),
|
|
349
353
|
shared: Type.Optional(Type.Array(FlowZoneItemSchema)),
|
|
354
|
+
position: Type.Optional(FlowZonePositionSchema),
|
|
350
355
|
}, { additionalProperties: true, });
|
|
351
356
|
export const FlowZoneArraySchema = Type.Array(FlowZoneSchema);
|
|
352
357
|
export const FlowZoneCreateOptionsSchema = Type.Object({
|
|
353
358
|
name: Type.String(),
|
|
354
359
|
color: Type.Optional(Type.String()),
|
|
355
360
|
projectKey: Type.Optional(Type.String()),
|
|
361
|
+
position: Type.Optional(FlowZonePositionSchema),
|
|
356
362
|
}, { additionalProperties: false, });
|
|
357
363
|
export const FlowZoneUpdateOptionsSchema = Type.Object({
|
|
358
364
|
name: Type.Optional(Type.String()),
|
|
359
365
|
color: Type.Optional(Type.String()),
|
|
360
366
|
projectKey: Type.Optional(Type.String()),
|
|
367
|
+
position: Type.Optional(FlowZonePositionSchema),
|
|
361
368
|
}, { additionalProperties: false, });
|
|
362
369
|
// ---------------------------------------------------------------------------
|
|
363
370
|
// Folders
|