dataiku-sdk 0.4.0 → 0.5.1
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/bin/dss.js +76 -3
- package/dist/packages/types/src/index.d.ts +275 -0
- package/dist/packages/types/src/index.js +190 -0
- package/dist/src/cli.js +4287 -862
- package/dist/src/client.d.ts +18 -0
- package/dist/src/client.js +30 -0
- package/dist/src/errors.d.ts +2 -0
- package/dist/src/errors.js +45 -1
- package/dist/src/index.d.ts +9 -3
- package/dist/src/index.js +7 -1
- package/dist/src/resources/code-envs.d.ts +9 -1
- package/dist/src/resources/code-envs.js +80 -1
- package/dist/src/resources/connections.d.ts +3 -1
- package/dist/src/resources/connections.js +4 -2
- package/dist/src/resources/dashboards.d.ts +19 -0
- package/dist/src/resources/dashboards.js +30 -0
- package/dist/src/resources/data-quality.d.ts +54 -0
- package/dist/src/resources/data-quality.js +119 -0
- package/dist/src/resources/datasets.js +1 -1
- package/dist/src/resources/flow-zones.d.ts +25 -0
- package/dist/src/resources/flow-zones.js +59 -0
- package/dist/src/resources/folders.d.ts +4 -1
- package/dist/src/resources/folders.js +27 -0
- package/dist/src/resources/futures.d.ts +15 -0
- package/dist/src/resources/futures.js +86 -0
- package/dist/src/resources/insights.d.ts +28 -0
- package/dist/src/resources/insights.js +64 -0
- package/dist/src/resources/jobs.d.ts +7 -4
- package/dist/src/resources/jobs.js +9 -7
- package/dist/src/resources/notebooks.d.ts +6 -4
- package/dist/src/resources/notebooks.js +6 -4
- package/dist/src/resources/recipes.js +115 -66
- package/dist/src/resources/wiki.d.ts +22 -0
- package/dist/src/resources/wiki.js +73 -0
- package/dist/src/schemas.d.ts +2 -2
- package/dist/src/schemas.js +1 -1
- package/dist/src/utils/cleanup-ledger.d.ts +15 -0
- package/dist/src/utils/cleanup-ledger.js +15 -0
- package/node_modules/@sinclair/typebox/package.json +2 -2
- package/node_modules/@sinclair/typebox/readme.md +7 -7
- package/package.json +11 -7
- package/packages/types/dist/index.d.ts +275 -0
- package/packages/types/dist/index.js +190 -0
|
@@ -22,6 +22,10 @@ function asRecord(value) {
|
|
|
22
22
|
return undefined;
|
|
23
23
|
return value;
|
|
24
24
|
}
|
|
25
|
+
const RECIPE_DEFINITION_FIELDS = new Set(["params", "inputs", "outputs", "scriptSettings",]);
|
|
26
|
+
function rootRecipeDefinitionFields(data) {
|
|
27
|
+
return Object.keys(data).filter((key) => RECIPE_DEFINITION_FIELDS.has(key));
|
|
28
|
+
}
|
|
25
29
|
function inferRecipeCodeExtension(recipeType) {
|
|
26
30
|
const normalized = typeof recipeType === "string" ? recipeType.trim().toLowerCase() : "";
|
|
27
31
|
if (!normalized)
|
|
@@ -86,18 +90,19 @@ export class RecipesResource extends BaseResource {
|
|
|
86
90
|
if (!result || !recipe) {
|
|
87
91
|
throw new DataikuError(404, "Not Found", `Recipe "${recipeName}" not found in project "${this.resolveProjectKey(opts?.projectKey)}" (DSS returned empty response).`);
|
|
88
92
|
}
|
|
89
|
-
return { ...result, recipe, };
|
|
93
|
+
return opts?.includePayload ? { ...result, recipe, } : { recipe, };
|
|
90
94
|
}
|
|
91
95
|
/** Create a recipe, with optional output dataset provisioning and join configuration. */
|
|
92
96
|
async create(opts) {
|
|
93
97
|
const pk = this.resolveProjectKey(opts.projectKey);
|
|
94
98
|
const enc = encodeURIComponent(pk);
|
|
95
99
|
const { type, payload, outputConnection: rawConnection, joinType: rawJoinType, } = opts;
|
|
100
|
+
const outputFolder = asString(opts.outputFolder);
|
|
96
101
|
// Build inputs/outputs from simple form (inputDatasets + outputDataset) or
|
|
97
102
|
// advanced form (inputs + outputs); both may coexist — simple form wins when
|
|
98
103
|
// the advanced form is absent.
|
|
99
104
|
const inputDatasets = asStringArray(opts.inputDatasets);
|
|
100
|
-
const
|
|
105
|
+
const requestedOutputDataset = asString(opts.outputDataset);
|
|
101
106
|
let inputs = asRecord(opts.inputs);
|
|
102
107
|
let outputs = asRecord(opts.outputs);
|
|
103
108
|
if (!inputs && inputDatasets) {
|
|
@@ -107,6 +112,15 @@ export class RecipesResource extends BaseResource {
|
|
|
107
112
|
},
|
|
108
113
|
};
|
|
109
114
|
}
|
|
115
|
+
// Auto-generate name if not provided
|
|
116
|
+
const outputNameForDefaultRecipe = requestedOutputDataset ?? outputFolder;
|
|
117
|
+
const name = opts.name ?? (type && outputNameForDefaultRecipe
|
|
118
|
+
? `${type}_${outputNameForDefaultRecipe}`
|
|
119
|
+
: undefined);
|
|
120
|
+
const temporaryOutputDataset = outputFolder && !requestedOutputDataset && name
|
|
121
|
+
? `${name}_folder_output_marker`
|
|
122
|
+
: undefined;
|
|
123
|
+
const outputDataset = requestedOutputDataset ?? temporaryOutputDataset;
|
|
110
124
|
if (!outputs && outputDataset) {
|
|
111
125
|
outputs = {
|
|
112
126
|
main: {
|
|
@@ -114,10 +128,8 @@ export class RecipesResource extends BaseResource {
|
|
|
114
128
|
},
|
|
115
129
|
};
|
|
116
130
|
}
|
|
117
|
-
// Auto-generate name if not provided
|
|
118
|
-
const name = opts.name ?? (type && outputDataset ? `${type}_${outputDataset}` : undefined);
|
|
119
131
|
if (!type || !name || !inputs || !outputs) {
|
|
120
|
-
throw new Error("type and (inputDatasets + outputDataset) or (name + inputs + outputs) are required for create.");
|
|
132
|
+
throw new Error("type and (inputDatasets + outputDataset/outputFolder) or (name + inputs + outputs) are required for create.");
|
|
121
133
|
}
|
|
122
134
|
const recipePrototype = {
|
|
123
135
|
type,
|
|
@@ -136,15 +148,7 @@ export class RecipesResource extends BaseResource {
|
|
|
136
148
|
});
|
|
137
149
|
const createdDatasets = [];
|
|
138
150
|
let usedOutputProvisioningFallback = false;
|
|
139
|
-
|
|
140
|
-
await createRecipe();
|
|
141
|
-
}
|
|
142
|
-
catch (error) {
|
|
143
|
-
if (!shouldRetryRecipeCreateWithOutputProvisioning(error)) {
|
|
144
|
-
throw error;
|
|
145
|
-
}
|
|
146
|
-
usedOutputProvisioningFallback = true;
|
|
147
|
-
// Fetch existing datasets to infer output connection and type
|
|
151
|
+
const provisionOutputDatasets = async () => {
|
|
148
152
|
const existingDs = await this.client.get(`/public/api/projects/${enc}/datasets/`);
|
|
149
153
|
let outputConnection = asString(rawConnection);
|
|
150
154
|
if (!outputConnection) {
|
|
@@ -153,61 +157,75 @@ export class RecipesResource extends BaseResource {
|
|
|
153
157
|
outputConnection = managedDs.params.connection;
|
|
154
158
|
}
|
|
155
159
|
}
|
|
156
|
-
if (outputConnection)
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
name: item.ref,
|
|
190
|
-
type: inferredOutputType,
|
|
191
|
-
params: {
|
|
192
|
-
connection: outputConnection,
|
|
193
|
-
mode: "table",
|
|
194
|
-
table: item.ref,
|
|
195
|
-
...(connectionSample?.params?.schema
|
|
196
|
-
? { schema: connectionSample.params.schema, }
|
|
197
|
-
: {}),
|
|
198
|
-
...(connectionSample?.params?.catalog
|
|
199
|
-
? { catalog: connectionSample.params.catalog, }
|
|
200
|
-
: {}),
|
|
201
|
-
},
|
|
202
|
-
managed: connectionSample?.managed ?? false,
|
|
203
|
-
};
|
|
204
|
-
await this.client.post(`/public/api/projects/${enc}/datasets/`, datasetBody);
|
|
205
|
-
existingNames.add(item.ref);
|
|
206
|
-
createdDatasets.push(item.ref);
|
|
160
|
+
if (!outputConnection)
|
|
161
|
+
return;
|
|
162
|
+
const existingNames = new Set([...existingDs.map((d) => d.name), ...createdDatasets,]);
|
|
163
|
+
const connectionSample = existingDs.find((d) => d.params?.connection === outputConnection && d.type);
|
|
164
|
+
const inferredOutputType = connectionSample?.type ?? "Filesystem";
|
|
165
|
+
const outputRoles = outputs;
|
|
166
|
+
for (const role of Object.values(outputRoles)) {
|
|
167
|
+
for (const item of role.items ?? []) {
|
|
168
|
+
if (!item.ref || existingNames.has(item.ref))
|
|
169
|
+
continue;
|
|
170
|
+
const datasetBody = inferredOutputType === "Filesystem"
|
|
171
|
+
? {
|
|
172
|
+
projectKey: pk,
|
|
173
|
+
name: item.ref,
|
|
174
|
+
type: inferredOutputType,
|
|
175
|
+
params: {
|
|
176
|
+
connection: outputConnection,
|
|
177
|
+
path: `/dataiku/${pk}/${item.ref}`,
|
|
178
|
+
metastoreTableName: item.ref,
|
|
179
|
+
},
|
|
180
|
+
formatType: "csv",
|
|
181
|
+
formatParams: {
|
|
182
|
+
style: "excel",
|
|
183
|
+
charset: "utf8",
|
|
184
|
+
separator: "\t",
|
|
185
|
+
quoteChar: '"',
|
|
186
|
+
escapeChar: "\\",
|
|
187
|
+
dateSerializationFormat: "ISO",
|
|
188
|
+
arrayMapFormat: "json",
|
|
189
|
+
parseHeaderRow: true,
|
|
190
|
+
compress: "gz",
|
|
191
|
+
},
|
|
192
|
+
managed: true,
|
|
207
193
|
}
|
|
208
|
-
|
|
194
|
+
: {
|
|
195
|
+
projectKey: pk,
|
|
196
|
+
name: item.ref,
|
|
197
|
+
type: inferredOutputType,
|
|
198
|
+
params: {
|
|
199
|
+
connection: outputConnection,
|
|
200
|
+
mode: "table",
|
|
201
|
+
table: item.ref,
|
|
202
|
+
...(connectionSample?.params?.schema
|
|
203
|
+
? { schema: connectionSample.params.schema, }
|
|
204
|
+
: {}),
|
|
205
|
+
...(connectionSample?.params?.catalog
|
|
206
|
+
? { catalog: connectionSample.params.catalog, }
|
|
207
|
+
: {}),
|
|
208
|
+
},
|
|
209
|
+
managed: connectionSample?.managed ?? false,
|
|
210
|
+
};
|
|
211
|
+
await this.client.post(`/public/api/projects/${enc}/datasets/`, datasetBody);
|
|
212
|
+
existingNames.add(item.ref);
|
|
213
|
+
if (!createdDatasets.includes(item.ref))
|
|
214
|
+
createdDatasets.push(item.ref);
|
|
209
215
|
}
|
|
210
216
|
}
|
|
217
|
+
};
|
|
218
|
+
try {
|
|
219
|
+
if (rawConnection)
|
|
220
|
+
await provisionOutputDatasets();
|
|
221
|
+
await createRecipe();
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
if (!shouldRetryRecipeCreateWithOutputProvisioning(error)) {
|
|
225
|
+
throw error;
|
|
226
|
+
}
|
|
227
|
+
usedOutputProvisioningFallback = true;
|
|
228
|
+
await provisionOutputDatasets();
|
|
211
229
|
await createRecipe();
|
|
212
230
|
}
|
|
213
231
|
// For join recipes: configure join conditions after creation
|
|
@@ -254,12 +272,39 @@ export class RecipesResource extends BaseResource {
|
|
|
254
272
|
await this.client.put(`/public/api/projects/${enc}/recipes/${rnEnc}`, updatedFull);
|
|
255
273
|
joinConfigured = true;
|
|
256
274
|
}
|
|
275
|
+
let temporaryOutputDatasetDeleted;
|
|
276
|
+
if (outputFolder) {
|
|
277
|
+
await this.update(name, {
|
|
278
|
+
recipe: {
|
|
279
|
+
outputs: {
|
|
280
|
+
main: {
|
|
281
|
+
items: [{ ref: outputFolder, appendMode: false, },],
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
}, pk);
|
|
286
|
+
if (temporaryOutputDataset) {
|
|
287
|
+
try {
|
|
288
|
+
await this.client.del(`/public/api/projects/${enc}/datasets/${encodeURIComponent(temporaryOutputDataset)}`);
|
|
289
|
+
temporaryOutputDatasetDeleted = true;
|
|
290
|
+
const createdIndex = createdDatasets.indexOf(temporaryOutputDataset);
|
|
291
|
+
if (createdIndex !== -1)
|
|
292
|
+
createdDatasets.splice(createdIndex, 1);
|
|
293
|
+
}
|
|
294
|
+
catch {
|
|
295
|
+
temporaryOutputDatasetDeleted = false;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
257
299
|
return {
|
|
258
300
|
recipeName: name,
|
|
259
301
|
type,
|
|
260
302
|
createdDatasets,
|
|
261
303
|
joinConfigured,
|
|
262
304
|
outputProvisioningFallbackUsed: usedOutputProvisioningFallback,
|
|
305
|
+
...(outputFolder ? { outputFolder, } : {}),
|
|
306
|
+
...(temporaryOutputDataset ? { temporaryOutputDataset, } : {}),
|
|
307
|
+
...(temporaryOutputDatasetDeleted !== undefined ? { temporaryOutputDatasetDeleted, } : {}),
|
|
263
308
|
};
|
|
264
309
|
}
|
|
265
310
|
/**
|
|
@@ -274,6 +319,10 @@ export class RecipesResource extends BaseResource {
|
|
|
274
319
|
if (!currentRecipe) {
|
|
275
320
|
throw new Error(`Recipe "${recipeName}" was not found or returned an empty definition.`);
|
|
276
321
|
}
|
|
322
|
+
const misplacedRecipeFields = rootRecipeDefinitionFields(data);
|
|
323
|
+
if (misplacedRecipeFields.length > 0) {
|
|
324
|
+
throw new Error(`Recipe fields ${misplacedRecipeFields.join(", ")} must be nested under "recipe". Example: {"recipe":{"outputs":{...},"params":{...}}}`);
|
|
325
|
+
}
|
|
277
326
|
const mergedRecipe = deepMerge(currentRecipe, asRecord(data.recipe) ?? {});
|
|
278
327
|
const merged = { ...current, ...data, recipe: mergedRecipe, };
|
|
279
328
|
await this.client.put(`/public/api/projects/${enc}/recipes/${rnEnc}`, merged);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { WikiArticleData, WikiSettings } from "../schemas.js";
|
|
2
|
+
import { BaseResource } from "./base.js";
|
|
3
|
+
export interface WikiArticleCreateOptions {
|
|
4
|
+
name: string;
|
|
5
|
+
parent?: string;
|
|
6
|
+
content?: string;
|
|
7
|
+
projectKey?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface WikiArticleUpdateOptions {
|
|
10
|
+
name?: string;
|
|
11
|
+
content?: string;
|
|
12
|
+
data?: Record<string, unknown>;
|
|
13
|
+
projectKey?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class WikiResource extends BaseResource {
|
|
16
|
+
settings(projectKey?: string): Promise<WikiSettings>;
|
|
17
|
+
list(projectKey?: string): Promise<WikiArticleData[]>;
|
|
18
|
+
get(articleIdOrName: string, projectKey?: string): Promise<WikiArticleData>;
|
|
19
|
+
create(opts: WikiArticleCreateOptions): Promise<WikiArticleData>;
|
|
20
|
+
update(articleIdOrName: string, opts: WikiArticleUpdateOptions): Promise<WikiArticleData>;
|
|
21
|
+
delete(articleIdOrName: string, projectKey?: string): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { WikiArticleDataArraySchema, WikiArticleDataSchema, WikiSettingsSchema, } from "../schemas.js";
|
|
2
|
+
import { deepMerge, } from "../utils/deep-merge.js";
|
|
3
|
+
import { BaseResource, } from "./base.js";
|
|
4
|
+
const WIKI_LIST_CONCURRENCY = 4;
|
|
5
|
+
function taxonomyIds(nodes) {
|
|
6
|
+
const ids = [];
|
|
7
|
+
for (const node of nodes ?? []) {
|
|
8
|
+
if (!node || typeof node !== "object" || Array.isArray(node))
|
|
9
|
+
continue;
|
|
10
|
+
const record = node;
|
|
11
|
+
if (typeof record.id === "string" && record.id.length > 0)
|
|
12
|
+
ids.push(record.id);
|
|
13
|
+
if (Array.isArray(record.children))
|
|
14
|
+
ids.push(...taxonomyIds(record.children));
|
|
15
|
+
}
|
|
16
|
+
return ids;
|
|
17
|
+
}
|
|
18
|
+
async function mapWithConcurrency(items, limit, mapper) {
|
|
19
|
+
const results = [];
|
|
20
|
+
let nextIndex = 0;
|
|
21
|
+
async function worker() {
|
|
22
|
+
while (nextIndex < items.length) {
|
|
23
|
+
const index = nextIndex;
|
|
24
|
+
nextIndex++;
|
|
25
|
+
results[index] = await mapper(items[index]);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
await Promise.all(Array.from({ length: Math.min(limit, items.length), }, () => worker()));
|
|
29
|
+
return results;
|
|
30
|
+
}
|
|
31
|
+
export class WikiResource extends BaseResource {
|
|
32
|
+
async settings(projectKey) {
|
|
33
|
+
const raw = await this.client.get(`/public/api/projects/${this.enc(projectKey)}/wiki/`);
|
|
34
|
+
return this.client.safeParse(WikiSettingsSchema, raw, "wiki.settings");
|
|
35
|
+
}
|
|
36
|
+
async list(projectKey) {
|
|
37
|
+
const settings = await this.settings(projectKey);
|
|
38
|
+
const ids = taxonomyIds(settings.taxonomy);
|
|
39
|
+
const articles = await mapWithConcurrency(ids, WIKI_LIST_CONCURRENCY, (id) => this.get(id, projectKey));
|
|
40
|
+
return this.client.safeParse(WikiArticleDataArraySchema, articles, "wiki.list");
|
|
41
|
+
}
|
|
42
|
+
async get(articleIdOrName, projectKey) {
|
|
43
|
+
const raw = await this.client.get(`/public/api/projects/${this.enc(projectKey)}/wiki/${encodeURIComponent(articleIdOrName)}`);
|
|
44
|
+
return this.client.safeParse(WikiArticleDataSchema, raw, "wiki.get");
|
|
45
|
+
}
|
|
46
|
+
async create(opts) {
|
|
47
|
+
const pk = this.resolveProjectKey(opts.projectKey);
|
|
48
|
+
const raw = await this.client.post(`/public/api/projects/${encodeURIComponent(pk)}/wiki/`, {
|
|
49
|
+
projectKey: pk,
|
|
50
|
+
name: opts.name,
|
|
51
|
+
parent: opts.parent ?? null,
|
|
52
|
+
});
|
|
53
|
+
const created = this.client.safeParse(WikiArticleDataSchema, raw, "wiki.create");
|
|
54
|
+
if (opts.content === undefined)
|
|
55
|
+
return created;
|
|
56
|
+
return this.update(created.article.id, { content: opts.content, projectKey: pk, });
|
|
57
|
+
}
|
|
58
|
+
async update(articleIdOrName, opts) {
|
|
59
|
+
const current = await this.get(articleIdOrName, opts.projectKey);
|
|
60
|
+
const patch = opts.data ?? {};
|
|
61
|
+
const next = deepMerge(current, patch);
|
|
62
|
+
if (opts.name !== undefined)
|
|
63
|
+
next.article = { ...next.article, name: opts.name, };
|
|
64
|
+
if (opts.content !== undefined)
|
|
65
|
+
next.payload = opts.content;
|
|
66
|
+
const raw = await this.client.put(`/public/api/projects/${this.enc(opts.projectKey)}/wiki/${encodeURIComponent(current.article.id)}`, next);
|
|
67
|
+
return this.client.safeParse(WikiArticleDataSchema, raw, "wiki.update");
|
|
68
|
+
}
|
|
69
|
+
async delete(articleIdOrName, projectKey) {
|
|
70
|
+
const current = await this.get(articleIdOrName, projectKey);
|
|
71
|
+
await this.client.del(`/public/api/projects/${this.enc(projectKey)}/wiki/${encodeURIComponent(current.article.id)}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
package/dist/src/schemas.d.ts
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* The types package (packages/types/) owns the TypeBox schema definitions.
|
|
4
4
|
* SDK consumers get everything through this re-export.
|
|
5
5
|
*/
|
|
6
|
-
export { BuildModeSchema, CodeEnvDetailsSchema, CodeEnvSummaryArraySchema, CodeEnvSummarySchema, ConnectionSummarySchema, DatasetCreateOptionsSchema, DatasetDetailsSchema, DatasetSchemaSchema, DatasetSummaryArraySchema, DatasetSummarySchema, FlowMapOptionsSchema, FolderDetailsSchema, FolderItemArraySchema, FolderItemSchema, FolderSummaryArraySchema, FolderSummarySchema, JobSummaryArraySchema, JobSummarySchema, JobWaitResultSchema, JupyterCellSchema, JupyterNotebookContentSchema, JupyterNotebookSummaryArraySchema, JupyterNotebookSummarySchema, NotebookSessionArraySchema, NotebookSessionSchema, parseSchema, ProjectDetailsSchema, ProjectMetadataSchema, ProjectSummaryArraySchema, ProjectSummarySchema, ProjectVariablesSchema, RecipeCreateOptionsSchema, RecipeCreateResultSchema, RecipeDetailsSchema, RecipeSummaryArraySchema, RecipeSummarySchema, safeParseSchema, ScenarioDetailsSchema, ScenarioStatusSchema, ScenarioSummaryArraySchema, ScenarioSummarySchema, ScenarioWaitResultSchema, SqlNotebookCellSchema, SqlNotebookContentSchema, SqlNotebookSummaryArraySchema, SqlNotebookSummarySchema, SqlQueryResponseSchema, SqlQueryResultSchema, SqlQuerySchemaSchema, } from "../packages/types/src/index.js";
|
|
7
|
-
export type { BuildMode, CodeEnvDetails, CodeEnvSummary, ConnectionSummary, DatasetCreateOptions, DatasetDetails, DatasetSchema, DatasetSummary, FlowMapOptions, FolderDetails, FolderItem, FolderSummary, JobSummary, JobWaitResult, JupyterCell, JupyterNotebookContent, JupyterNotebookSummary, NotebookSession, ProjectDetails, ProjectMetadata, ProjectSummary, ProjectVariables, RecipeCreateOptions, RecipeCreateResult, RecipeDetails, RecipeSummary, SafeParseResult, ScenarioDetails, ScenarioStatus, ScenarioSummary, ScenarioWaitResult, SqlNotebookCell, SqlNotebookContent, SqlNotebookSummary, SqlQueryResponse, SqlQueryResult, SqlQuerySchema, } from "../packages/types/src/index.js";
|
|
6
|
+
export { BuildModeSchema, CodeEnvActionResultSchema, CodeEnvCreateOptionsSchema, CodeEnvDetailsSchema, CodeEnvPackageListSchema, CodeEnvSetPackagesOptionsSchema, CodeEnvSummaryArraySchema, CodeEnvSummarySchema, CodeEnvUpdatePackagesOptionsSchema, CodeEnvUsageArraySchema, 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, FlowZoneSchema, FlowZoneUpdateOptionsSchema, FolderCreateOptionsSchema, FolderDetailsSchema, FolderItemArraySchema, FolderItemSchema, FolderSummaryArraySchema, FolderSummarySchema, FutureStateSchema, FutureWaitResultSchema, InsightDetailsSchema, InsightSummaryArraySchema, InsightSummarySchema, JobSummaryArraySchema, JobSummarySchema, JobWaitResultSchema, JupyterCellSchema, JupyterNotebookContentSchema, JupyterNotebookSummaryArraySchema, JupyterNotebookSummarySchema, NotebookSessionArraySchema, NotebookSessionSchema, parseSchema, ProjectDetailsSchema, ProjectMetadataSchema, ProjectSummaryArraySchema, ProjectSummarySchema, ProjectVariablesSchema, RecipeCreateOptionsSchema, RecipeCreateResultSchema, RecipeDetailsSchema, RecipeSummaryArraySchema, RecipeSummarySchema, safeParseSchema, ScenarioDetailsSchema, ScenarioStatusSchema, ScenarioSummaryArraySchema, ScenarioSummarySchema, ScenarioWaitResultSchema, SqlNotebookCellSchema, SqlNotebookContentSchema, SqlNotebookSummaryArraySchema, SqlNotebookSummarySchema, SqlQueryResponseSchema, SqlQueryResultSchema, SqlQuerySchemaSchema, WikiArticleDataArraySchema, WikiArticleDataSchema, WikiArticleMetadataSchema, WikiSettingsSchema, WikiTaxonomyNodeSchema, } from "../packages/types/src/index.js";
|
|
7
|
+
export type { BuildMode, CodeEnvActionResult, CodeEnvCreateOptions, CodeEnvDetails, CodeEnvPackageList, CodeEnvSetPackagesOptions, CodeEnvSummary, CodeEnvUpdatePackagesOptions, CodeEnvUsage, CodeEnvWaitOptions, ConnectionSummary, DashboardDetails, DashboardSummary, DataQualityComputeResult, DataQualityProjectStatus, DataQualityRule, DataQualityRuleResult, DataQualityRules, DataQualityStatus, DataQualityStatusByPartition, DataQualityTimeline, DataQualityTimelineEntry, DatasetCreateOptions, DatasetDetails, DatasetSchema, DatasetSummary, FlowMapOptions, FlowZone, FlowZoneCreateOptions, FlowZoneItem, FlowZoneObjectType, FlowZoneUpdateOptions, FolderCreateOptions, FolderDetails, FolderItem, FolderSummary, FutureState, FutureWaitResult, InsightDetails, InsightSummary, JobSummary, JobWaitResult, JupyterCell, JupyterNotebookContent, JupyterNotebookSummary, NotebookSession, ProjectDetails, ProjectMetadata, ProjectSummary, ProjectVariables, RecipeCreateOptions, RecipeCreateResult, RecipeDetails, RecipeSummary, SafeParseResult, ScenarioDetails, ScenarioStatus, ScenarioSummary, ScenarioWaitResult, SqlNotebookCell, SqlNotebookContent, SqlNotebookSummary, SqlQueryResponse, SqlQueryResult, SqlQuerySchema, WikiArticleData, WikiArticleMetadata, WikiSettings, WikiTaxonomyNode, } from "../packages/types/src/index.js";
|
package/dist/src/schemas.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* The types package (packages/types/) owns the TypeBox schema definitions.
|
|
4
4
|
* SDK consumers get everything through this re-export.
|
|
5
5
|
*/
|
|
6
|
-
export { BuildModeSchema, CodeEnvDetailsSchema, CodeEnvSummaryArraySchema, CodeEnvSummarySchema, ConnectionSummarySchema, DatasetCreateOptionsSchema, DatasetDetailsSchema, DatasetSchemaSchema, DatasetSummaryArraySchema, DatasetSummarySchema, FlowMapOptionsSchema, FolderDetailsSchema, FolderItemArraySchema, FolderItemSchema, FolderSummaryArraySchema, FolderSummarySchema, JobSummaryArraySchema, JobSummarySchema, JobWaitResultSchema, JupyterCellSchema, JupyterNotebookContentSchema, JupyterNotebookSummaryArraySchema, JupyterNotebookSummarySchema, NotebookSessionArraySchema, NotebookSessionSchema, parseSchema, ProjectDetailsSchema, ProjectMetadataSchema, ProjectSummaryArraySchema, ProjectSummarySchema, ProjectVariablesSchema, RecipeCreateOptionsSchema, RecipeCreateResultSchema, RecipeDetailsSchema, RecipeSummaryArraySchema, RecipeSummarySchema, safeParseSchema, ScenarioDetailsSchema, ScenarioStatusSchema, ScenarioSummaryArraySchema, ScenarioSummarySchema, ScenarioWaitResultSchema, SqlNotebookCellSchema, SqlNotebookContentSchema, SqlNotebookSummaryArraySchema, SqlNotebookSummarySchema, SqlQueryResponseSchema, SqlQueryResultSchema, SqlQuerySchemaSchema, } from "../packages/types/src/index.js";
|
|
6
|
+
export { BuildModeSchema, CodeEnvActionResultSchema, CodeEnvCreateOptionsSchema, CodeEnvDetailsSchema, CodeEnvPackageListSchema, CodeEnvSetPackagesOptionsSchema, CodeEnvSummaryArraySchema, CodeEnvSummarySchema, CodeEnvUpdatePackagesOptionsSchema, CodeEnvUsageArraySchema, 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, FlowZoneSchema, FlowZoneUpdateOptionsSchema, FolderCreateOptionsSchema, FolderDetailsSchema, FolderItemArraySchema, FolderItemSchema, FolderSummaryArraySchema, FolderSummarySchema, FutureStateSchema, FutureWaitResultSchema, InsightDetailsSchema, InsightSummaryArraySchema, InsightSummarySchema, JobSummaryArraySchema, JobSummarySchema, JobWaitResultSchema, JupyterCellSchema, JupyterNotebookContentSchema, JupyterNotebookSummaryArraySchema, JupyterNotebookSummarySchema, NotebookSessionArraySchema, NotebookSessionSchema, parseSchema, ProjectDetailsSchema, ProjectMetadataSchema, ProjectSummaryArraySchema, ProjectSummarySchema, ProjectVariablesSchema, RecipeCreateOptionsSchema, RecipeCreateResultSchema, RecipeDetailsSchema, RecipeSummaryArraySchema, RecipeSummarySchema, safeParseSchema, ScenarioDetailsSchema, ScenarioStatusSchema, ScenarioSummaryArraySchema, ScenarioSummarySchema, ScenarioWaitResultSchema, SqlNotebookCellSchema, SqlNotebookContentSchema, SqlNotebookSummaryArraySchema, SqlNotebookSummarySchema, SqlQueryResponseSchema, SqlQueryResultSchema, SqlQuerySchemaSchema, WikiArticleDataArraySchema, WikiArticleDataSchema, WikiArticleMetadataSchema, WikiSettingsSchema, WikiTaxonomyNodeSchema, } from "../packages/types/src/index.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type CleanupLedgerAction = "create" | "upload" | "delete" | "update" | "set" | "run" | string;
|
|
2
|
+
export interface CleanupLedgerEntry {
|
|
3
|
+
ts: string;
|
|
4
|
+
action: CleanupLedgerAction;
|
|
5
|
+
resource: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
path?: string;
|
|
9
|
+
projectKey?: string;
|
|
10
|
+
cleanup: {
|
|
11
|
+
argv: string[];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare function appendCleanupLedgerEntry(filePath: string, entry: CleanupLedgerEntry): Promise<void>;
|
|
15
|
+
export declare function readCleanupLedger(filePath: string): Promise<CleanupLedgerEntry[]>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { appendFile, mkdir, readFile, } from "node:fs/promises";
|
|
2
|
+
import { dirname, resolve, } from "node:path";
|
|
3
|
+
export async function appendCleanupLedgerEntry(filePath, entry) {
|
|
4
|
+
const resolved = resolve(filePath);
|
|
5
|
+
await mkdir(dirname(resolved), { recursive: true, });
|
|
6
|
+
await appendFile(resolved, `${JSON.stringify(entry)}\n`, "utf-8");
|
|
7
|
+
}
|
|
8
|
+
export async function readCleanupLedger(filePath) {
|
|
9
|
+
const content = await readFile(resolve(filePath), "utf-8");
|
|
10
|
+
return content
|
|
11
|
+
.split(/\r?\n/)
|
|
12
|
+
.map((line) => line.trim())
|
|
13
|
+
.filter((line) => line.length > 0)
|
|
14
|
+
.map((line) => JSON.parse(line));
|
|
15
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sinclair/typebox",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.49",
|
|
4
4
|
"description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/sinclairzx81/typebox
|
|
15
|
+
"url": "https://github.com/sinclairzx81/sinclair-typebox"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
18
|
"test": "echo test"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<div align='center'>
|
|
2
2
|
|
|
3
|
-
<h1>TypeBox
|
|
3
|
+
<h1>Sinclair TypeBox</h1>
|
|
4
4
|
|
|
5
5
|
<p>Json Schema Type Builder with Static Type Resolution for TypeScript</p>
|
|
6
6
|
|
|
7
|
-
<img src="https://raw.githubusercontent.com/sinclairzx81/typebox
|
|
7
|
+
<img src="https://raw.githubusercontent.com/sinclairzx81/sinclair-typebox/refs/heads/main/typebox.png" />
|
|
8
8
|
|
|
9
9
|
<br />
|
|
10
10
|
<br />
|
|
@@ -16,14 +16,17 @@
|
|
|
16
16
|
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
|
+
|
|
19
20
|
<a name="Install"></a>
|
|
20
21
|
|
|
21
22
|
## Install
|
|
22
23
|
|
|
24
|
+
For the latest version use [TypeBox 1.x](https://github.com/sinclairzx81/typebox)
|
|
25
|
+
|
|
23
26
|
```bash
|
|
24
|
-
$ npm install @sinclair/typebox # TypeBox
|
|
27
|
+
$ npm install @sinclair/typebox # TypeBox 0.x - Long Term Support
|
|
25
28
|
|
|
26
|
-
$ npm install typebox # TypeBox
|
|
29
|
+
$ npm install typebox # TypeBox 1.x - Latest
|
|
27
30
|
```
|
|
28
31
|
|
|
29
32
|
## Example
|
|
@@ -48,13 +51,10 @@ type T = Static<typeof T> // type T = {
|
|
|
48
51
|
// }
|
|
49
52
|
```
|
|
50
53
|
|
|
51
|
-
|
|
52
54
|
<a name="Overview"></a>
|
|
53
55
|
|
|
54
56
|
## Overview
|
|
55
57
|
|
|
56
|
-
> ⚠️ TypeBox versions (pre-1.0) will continue active maintenance through 2026 and beyond. This repository services as the OIDC publishing environment for the `@sinclair/typebox` package scope on NPM. For TypeBox versions 1.0 and above, refer to https://github.com/sinclairzx81/typebox
|
|
57
|
-
|
|
58
58
|
TypeBox is a runtime type builder that creates in-memory Json Schema objects that infer as TypeScript types. The schematics produced by this library are designed to match the static type checking rules of the TypeScript compiler. TypeBox offers a unified type that can be statically checked by TypeScript and runtime asserted using standard Json Schema validation.
|
|
59
59
|
|
|
60
60
|
This library is designed to allow Json Schema to compose similar to how types compose within TypeScript's type system. It can be used as a simple tool to build up complex schematics or integrated into REST and RPC services to help validate data received over the wire.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dataiku-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Dataiku DSS SDK and CLI for programmatic access to DSS REST APIs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
@@ -27,16 +27,20 @@
|
|
|
27
27
|
"lint:fix": "oxlint --fix src/",
|
|
28
28
|
"format": "dprint fmt",
|
|
29
29
|
"format:check": "dprint check",
|
|
30
|
-
"test": "bun test"
|
|
30
|
+
"test": "bun test",
|
|
31
|
+
"test:integration": "RUN_DATAIKU_INTEGRATION=1 bun test tests/integration-playground.test.ts",
|
|
32
|
+
"test:integration:mutating": "RUN_DATAIKU_INTEGRATION=1 RUN_DATAIKU_INTEGRATION_MUTATING=1 bun test tests/integration-playground.test.ts",
|
|
33
|
+
"test:integration:rigorous": "RUN_DATAIKU_INTEGRATION=1 bun test tests/integration-rigorous.test.ts",
|
|
34
|
+
"test:integration:rigorous:mutating": "RUN_DATAIKU_INTEGRATION=1 RUN_DATAIKU_INTEGRATION_MUTATING=1 bun test tests/integration-rigorous.test.ts"
|
|
31
35
|
},
|
|
32
36
|
"devDependencies": {
|
|
33
|
-
"@types/bun": "^1.
|
|
34
|
-
"dprint": "^0.53.
|
|
35
|
-
"oxlint": "^1.
|
|
36
|
-
"typescript": "^5.
|
|
37
|
+
"@types/bun": "^1.3.13",
|
|
38
|
+
"dprint": "^0.53.2",
|
|
39
|
+
"oxlint": "^1.62.0",
|
|
40
|
+
"typescript": "^5.9.3"
|
|
37
41
|
},
|
|
38
42
|
"dependencies": {
|
|
39
|
-
"@sinclair/typebox": "^0.34.
|
|
43
|
+
"@sinclair/typebox": "^0.34.49"
|
|
40
44
|
},
|
|
41
45
|
"bundledDependencies": [
|
|
42
46
|
"@sinclair/typebox"
|