dataiku-sdk 0.12.7 → 1.0.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.
Files changed (51) hide show
  1. package/README.md +60 -14
  2. package/bin/dss.js +1 -1
  3. package/dist/packages/types/src/index.d.ts +128 -3
  4. package/dist/packages/types/src/index.js +106 -3
  5. package/dist/src/cli/coerce.d.ts +2 -1
  6. package/dist/src/cli/coerce.js +84 -26
  7. package/dist/src/cli/commands/app.js +6 -6
  8. package/dist/src/cli/commands/code.js +2 -2
  9. package/dist/src/cli/commands/data-quality.js +8 -8
  10. package/dist/src/cli/commands/dataset.js +11 -7
  11. package/dist/src/cli/commands/folder.js +5 -4
  12. package/dist/src/cli/commands/future.js +2 -2
  13. package/dist/src/cli/commands/index.js +2 -0
  14. package/dist/src/cli/commands/job.js +11 -11
  15. package/dist/src/cli/commands/notebook.js +1 -1
  16. package/dist/src/cli/commands/project-git.d.ts +2 -0
  17. package/dist/src/cli/commands/project-git.js +563 -0
  18. package/dist/src/cli/commands/project.js +2 -2
  19. package/dist/src/cli/commands/recipe.js +14 -17
  20. package/dist/src/cli/commands/scenario.js +4 -4
  21. package/dist/src/cli/contract.d.ts +5 -4
  22. package/dist/src/cli/contract.js +413 -55
  23. package/dist/src/cli/doctor.js +6 -6
  24. package/dist/src/cli/flags.js +21 -2
  25. package/dist/src/cli/helpers/dataset.js +1 -1
  26. package/dist/src/cli/output.d.ts +2 -1
  27. package/dist/src/cli/output.js +2 -6
  28. package/dist/src/cli/usage.d.ts +1 -1
  29. package/dist/src/cli/usage.js +2 -1
  30. package/dist/src/cli/version.d.ts +2 -2
  31. package/dist/src/cli/version.js +2 -2
  32. package/dist/src/cli.js +43 -26
  33. package/dist/src/client.d.ts +3 -0
  34. package/dist/src/client.js +5 -0
  35. package/dist/src/errors.d.ts +1 -1
  36. package/dist/src/index.d.ts +3 -2
  37. package/dist/src/index.js +2 -1
  38. package/dist/src/resources/connections.d.ts +3 -1
  39. package/dist/src/resources/connections.js +82 -21
  40. package/dist/src/resources/datasets.js +42 -2
  41. package/dist/src/resources/folders.js +7 -3
  42. package/dist/src/resources/project-git.d.ts +154 -0
  43. package/dist/src/resources/project-git.js +427 -0
  44. package/dist/src/resources/recipes.js +4 -4
  45. package/dist/src/schemas.d.ts +2 -2
  46. package/dist/src/schemas.js +1 -1
  47. package/package.json +1 -1
  48. package/packages/types/dist/index.d.ts +128 -3
  49. package/packages/types/dist/index.js +106 -3
  50. package/plugin.json +1 -1
  51. package/skills/dataiku-dss/SKILL.md +26 -19
@@ -32,9 +32,9 @@ export const codeCommands = {
32
32
  const run = await c.scenarios.runScript(script, {
33
33
  envName: f["env"],
34
34
  projectKey: f["project-key"],
35
- timeoutMs: num(f["timeout"]),
35
+ timeoutMs: num(f["timeout"], "--timeout"),
36
36
  keepScenario: f["keep"] === true,
37
- maxLogBytes: num(f["max-log-bytes"]),
37
+ maxLogBytes: num(f["max-log-bytes"], "--max-log-bytes"),
38
38
  });
39
39
  const result = {
40
40
  outcome: run.outcome,
@@ -164,10 +164,10 @@ export const dataQualityCommands = {
164
164
  handler: (c, a, f) => {
165
165
  requireArgs(a, 1, "dss data-quality history <dataset>");
166
166
  return c.dataQuality.history(a[0], {
167
- minTimestamp: num(f["min-timestamp"]),
168
- maxTimestamp: num(f["max-timestamp"]),
169
- resultsPerPage: num(f["results-per-page"]),
170
- page: num(f["page"]),
167
+ minTimestamp: num(f["min-timestamp"], "--min-timestamp"),
168
+ maxTimestamp: num(f["max-timestamp"], "--max-timestamp"),
169
+ resultsPerPage: num(f["results-per-page"], "--results-per-page"),
170
+ page: num(f["page"], "--page"),
171
171
  ruleId: f["rule-id"],
172
172
  projectKey: f["project-key"],
173
173
  });
@@ -187,8 +187,8 @@ export const dataQualityCommands = {
187
187
  },
188
188
  "project-timeline": {
189
189
  handler: (c, _a, f) => c.dataQuality.projectTimeline({
190
- minTimestamp: num(f["min-timestamp"]),
191
- maxTimestamp: num(f["max-timestamp"]),
190
+ minTimestamp: num(f["min-timestamp"], "--min-timestamp"),
191
+ maxTimestamp: num(f["max-timestamp"], "--max-timestamp"),
192
192
  projectKey: f["project-key"],
193
193
  }),
194
194
  usage: "dss data-quality project-timeline [--min-timestamp MS] [--max-timestamp MS] [--project-key KEY]",
@@ -201,10 +201,10 @@ export const dataQualityCommands = {
201
201
  const pk = f["project-key"];
202
202
  const options = {
203
203
  partition: f["partition"],
204
- pollIntervalMs: num(f["poll-interval"]),
204
+ pollIntervalMs: num(f["poll-interval"], "--poll-interval"),
205
205
  ruleId: f["rule-id"],
206
206
  projectKey: pk,
207
- timeoutMs: num(f["timeout"]),
207
+ timeoutMs: num(f["timeout"], "--timeout"),
208
208
  };
209
209
  if (f["dry-run"] === true) {
210
210
  const params = new URLSearchParams();
@@ -108,9 +108,9 @@ export const datasetCommands = {
108
108
  handler: (c, a, f) => {
109
109
  requireArgs(a, 1, "dss dataset preview <name>");
110
110
  return c.datasets.preview(a[0], {
111
- maxRows: num(f["max-rows"]),
111
+ maxRows: num(f["max-rows"], "--max-rows"),
112
112
  projectKey: f["project-key"],
113
- timeoutMs: num(f["timeout"]),
113
+ timeoutMs: num(f["timeout"], "--timeout"),
114
114
  });
115
115
  },
116
116
  usage: "dss dataset preview <name> [--max-rows N] [--rows N] [--project-key KEY] [--timeout MS]",
@@ -132,7 +132,7 @@ export const datasetCommands = {
132
132
  const result = await c.datasets.download(a[0], {
133
133
  outputPath: f["output"],
134
134
  projectKey: f["project-key"],
135
- limit: num(f["limit"]),
135
+ limit: num(f["limit"], "--limit"),
136
136
  });
137
137
  if (result.truncated) {
138
138
  enqueueCliWarning({
@@ -166,8 +166,11 @@ export const datasetCommands = {
166
166
  const name = f["name"];
167
167
  const connection = f["connection"];
168
168
  const dsType = f["type"];
169
- if (!name || !connection || !dsType) {
170
- throw new UsageError("--name, --connection, and --type are required. Usage: dss dataset create --name NAME --connection CONN --type TYPE");
169
+ if (!name || !dsType) {
170
+ throw new UsageError("--name and --type are required. Usage: dss dataset create --name NAME --type TYPE [--connection CONN]");
171
+ }
172
+ if (!connection && dsType.toLowerCase() !== "uploadedfiles") {
173
+ throw new UsageError("--connection is required unless --type is UploadedFiles.");
171
174
  }
172
175
  const payload = {
173
176
  datasetName: name,
@@ -198,9 +201,10 @@ export const datasetCommands = {
198
201
  const moved = await moveCreatedItemsToZone(c, f, [{ objectId: name, objectType: "DATASET", },], pk);
199
202
  return { created: name, resource: "dataset", ...moved, };
200
203
  },
201
- usage: "dss dataset create --name NAME --connection CONN --type TYPE [--zone ZONE|--zone-id ID] [--if-not-exists] [--dry-run] [--project-key KEY]",
202
- description: "Create a new dataset.",
204
+ usage: "dss dataset create --name NAME --type TYPE [--connection CONN] [--zone ZONE|--zone-id ID] [--if-not-exists] [--dry-run] [--project-key KEY]",
205
+ description: "Create a new dataset. UploadedFiles uses the server's default upload connection when omitted.",
203
206
  examples: [
207
+ "dss dataset create --name uploads --type UploadedFiles",
204
208
  "dss dataset create --name orders --connection filesystem --type Filesystem",
205
209
  "dss dataset create --name orders --connection filesystem --type Filesystem --zone Experiments --dry-run",
206
210
  ],
@@ -18,8 +18,8 @@ export const folderCommands = {
18
18
  const type = f["type"];
19
19
  const connection = f["connection"];
20
20
  const pk = f["project-key"];
21
- if (!name || !type || !connection) {
22
- throw new UsageError("--name, --type, and --connection are required. Usage: dss folder create --name NAME --type TYPE --connection CONN [--path PATH]");
21
+ if (!name) {
22
+ throw new UsageError("--name is required. Usage: dss folder create --name NAME [--type TYPE] [--connection CONN] [--path PATH]");
23
23
  }
24
24
  const payload = {
25
25
  name,
@@ -48,9 +48,10 @@ export const folderCommands = {
48
48
  const created = await c.folders.create(payload);
49
49
  return { created: created.id ?? name, resource: "folder", ...created, };
50
50
  },
51
- usage: "dss folder create --name NAME --type TYPE --connection CONN [--path PATH] [--if-not-exists] [--dry-run] [--project-key KEY]",
52
- description: "Create a managed folder.",
51
+ usage: "dss folder create --name NAME [--type TYPE] [--connection CONN] [--path PATH] [--if-not-exists] [--dry-run] [--project-key KEY]",
52
+ description: "Create a managed folder; when omitted, the connection is selected from writable managed-folder storage and DSS infers the folder type.",
53
53
  examples: [
54
+ "dss folder create --name exports",
54
55
  "dss folder create --name exports --type S3 --connection s3_connection",
55
56
  "dss folder create --name exports --type S3 --connection s3_connection --path /dataiku/MYPROJ/exports --dry-run",
56
57
  ],
@@ -24,8 +24,8 @@ export const futureCommands = {
24
24
  handler: (c, a, f) => {
25
25
  requireArgs(a, 1, "dss future wait <id>");
26
26
  return c.futures.wait(a[0], {
27
- pollIntervalMs: num(f["poll-interval"]),
28
- timeoutMs: num(f["timeout"]),
27
+ pollIntervalMs: num(f["poll-interval"], "--poll-interval"),
28
+ timeoutMs: num(f["timeout"], "--timeout"),
29
29
  });
30
30
  },
31
31
  usage: "dss future wait <id> [--timeout MS] [--poll-interval MS]",
@@ -24,6 +24,7 @@ import { mlTaskCommands, } from "./ml-task.js";
24
24
  import { modelEvaluationStoreCommands, } from "./model-evaluation-store.js";
25
25
  import { notebookCommands, } from "./notebook.js";
26
26
  import { projectDeployerCommands, } from "./project-deployer.js";
27
+ import { projectGitCommands, } from "./project-git.js";
27
28
  import { projectLibraryCommands, } from "./project-library.js";
28
29
  import { projectCommands, } from "./project.js";
29
30
  import { recipeCommands, } from "./recipe.js";
@@ -49,6 +50,7 @@ export const commands = {
49
50
  "api-deployer": apiDeployerCommands,
50
51
  bundle: bundleCommands,
51
52
  "project-deployer": projectDeployerCommands,
53
+ "project-git": projectGitCommands,
52
54
  "project-library": projectLibraryCommands,
53
55
  "streaming-endpoint": streamingEndpointCommands,
54
56
  "continuous-activity": continuousActivityCommands,
@@ -67,7 +67,7 @@ function filteredJobList(jobs, flags) {
67
67
  return false;
68
68
  return true;
69
69
  });
70
- const limit = flags["latest"] === true ? 1 : num(flags["limit"]);
70
+ const limit = flags["latest"] === true ? 1 : num(flags["limit"], "--limit");
71
71
  if (limit !== undefined)
72
72
  result = result.slice(0, Math.max(0, limit));
73
73
  return result;
@@ -259,9 +259,9 @@ export const jobCommands = {
259
259
  const options = {
260
260
  buildMode: f["build-mode"],
261
261
  partition: f["partition"],
262
- pollIntervalMs: num(f["poll-interval"]),
262
+ pollIntervalMs: num(f["poll-interval"], "--poll-interval"),
263
263
  targetType: jobBuildTargetTypeFromFlags(f),
264
- timeoutMs: num(f["timeout"]),
264
+ timeoutMs: num(f["timeout"], "--timeout"),
265
265
  };
266
266
  if (f["dry-run"] === true) {
267
267
  return {
@@ -297,8 +297,8 @@ export const jobCommands = {
297
297
  logFilter: jobLogFilterFromFlag(f["log-filter"]),
298
298
  maxLogLines: maxLogLinesFromFlags(f),
299
299
  partition: f["partition"],
300
- pollIntervalMs: num(f["poll-interval"]),
301
- timeoutMs: num(f["timeout"]),
300
+ pollIntervalMs: num(f["poll-interval"], "--poll-interval"),
301
+ timeoutMs: num(f["timeout"], "--timeout"),
302
302
  summary: f["summary"] === true,
303
303
  targetType: jobBuildTargetTypeFromFlags(f),
304
304
  };
@@ -331,8 +331,8 @@ export const jobCommands = {
331
331
  includeLogs: f["include-logs"] === true,
332
332
  logFilter: jobLogFilterFromFlag(f["log-filter"]),
333
333
  maxLogLines: maxLogLinesFromFlags(f),
334
- pollIntervalMs: num(f["poll-interval"]),
335
- timeoutMs: num(f["timeout"]),
334
+ pollIntervalMs: num(f["poll-interval"], "--poll-interval"),
335
+ timeoutMs: num(f["timeout"], "--timeout"),
336
336
  summary: f["summary"] === true,
337
337
  projectKey: f["project-key"],
338
338
  });
@@ -351,8 +351,8 @@ export const jobCommands = {
351
351
  includeLogs: f["include-logs"] === true,
352
352
  logFilter: jobLogFilterFromFlag(f["log-filter"]),
353
353
  maxLogLines: maxLogLinesFromFlags(f),
354
- pollIntervalMs: num(f["poll-interval"]),
355
- timeoutMs: num(f["timeout"]),
354
+ pollIntervalMs: num(f["poll-interval"], "--poll-interval"),
355
+ timeoutMs: num(f["timeout"], "--timeout"),
356
356
  summary: f["summary"] !== false,
357
357
  projectKey: f["project-key"],
358
358
  };
@@ -370,8 +370,8 @@ export const jobCommands = {
370
370
  includeLogs: f["include-logs"] === true,
371
371
  logFilter: jobLogFilterFromFlag(f["log-filter"]),
372
372
  maxLogLines: maxLogLinesFromFlags(f),
373
- pollIntervalMs: num(f["poll-interval"]),
374
- timeoutMs: num(f["timeout"]),
373
+ pollIntervalMs: num(f["poll-interval"], "--poll-interval"),
374
+ timeoutMs: num(f["timeout"], "--timeout"),
375
375
  summary: true,
376
376
  projectKey: f["project-key"],
377
377
  };
@@ -217,7 +217,7 @@ export const notebookCommands = {
217
217
  const pk = f["project-key"];
218
218
  const options = {
219
219
  cellId: f["cell-id"],
220
- numRunsToRetain: num(f["retain"]),
220
+ numRunsToRetain: num(f["retain"], "--retain"),
221
221
  projectKey: pk,
222
222
  };
223
223
  if (f["dry-run"] === true) {
@@ -0,0 +1,2 @@
1
+ import type { CommandMeta } from "../types.js";
2
+ export declare const projectGitCommands: Record<string, CommandMeta>;