dataiku-sdk 0.12.7 → 1.1.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 (61) hide show
  1. package/README.md +93 -15
  2. package/bin/dss.js +21 -2
  3. package/dist/build-metadata.json +1 -0
  4. package/dist/packages/types/src/index.d.ts +128 -3
  5. package/dist/packages/types/src/index.js +106 -3
  6. package/dist/src/cli/coerce.d.ts +2 -1
  7. package/dist/src/cli/coerce.js +84 -26
  8. package/dist/src/cli/commands/app.js +6 -6
  9. package/dist/src/cli/commands/code.js +2 -2
  10. package/dist/src/cli/commands/data-quality.js +50 -8
  11. package/dist/src/cli/commands/dataset.d.ts +23 -0
  12. package/dist/src/cli/commands/dataset.js +197 -12
  13. package/dist/src/cli/commands/folder.js +5 -4
  14. package/dist/src/cli/commands/future.js +2 -2
  15. package/dist/src/cli/commands/index.js +2 -0
  16. package/dist/src/cli/commands/job.js +26 -13
  17. package/dist/src/cli/commands/notebook.js +1 -1
  18. package/dist/src/cli/commands/project-git.d.ts +2 -0
  19. package/dist/src/cli/commands/project-git.js +563 -0
  20. package/dist/src/cli/commands/project.js +118 -14
  21. package/dist/src/cli/commands/recipe.js +14 -17
  22. package/dist/src/cli/commands/scenario.js +4 -4
  23. package/dist/src/cli/contract.d.ts +6 -4
  24. package/dist/src/cli/contract.js +595 -68
  25. package/dist/src/cli/doctor.d.ts +12 -2
  26. package/dist/src/cli/doctor.js +50 -19
  27. package/dist/src/cli/flags.js +23 -2
  28. package/dist/src/cli/helpers/cleanup.js +30 -1
  29. package/dist/src/cli/helpers/dataset.js +1 -1
  30. package/dist/src/cli/output.d.ts +5 -2
  31. package/dist/src/cli/output.js +13 -12
  32. package/dist/src/cli/types.d.ts +2 -0
  33. package/dist/src/cli/usage.d.ts +1 -1
  34. package/dist/src/cli/usage.js +2 -1
  35. package/dist/src/cli/version.d.ts +48 -6
  36. package/dist/src/cli/version.js +177 -11
  37. package/dist/src/cli.js +94 -39
  38. package/dist/src/client.d.ts +31 -1
  39. package/dist/src/client.js +39 -7
  40. package/dist/src/errors.d.ts +1 -1
  41. package/dist/src/index.d.ts +6 -4
  42. package/dist/src/index.js +3 -1
  43. package/dist/src/resources/connections.d.ts +3 -1
  44. package/dist/src/resources/connections.js +82 -21
  45. package/dist/src/resources/datasets.d.ts +43 -0
  46. package/dist/src/resources/datasets.js +241 -30
  47. package/dist/src/resources/folders.js +7 -3
  48. package/dist/src/resources/project-git.d.ts +154 -0
  49. package/dist/src/resources/project-git.js +427 -0
  50. package/dist/src/resources/projects.d.ts +36 -3
  51. package/dist/src/resources/projects.js +127 -16
  52. package/dist/src/resources/recipes.js +4 -4
  53. package/dist/src/schemas.d.ts +2 -2
  54. package/dist/src/schemas.js +1 -1
  55. package/dist/src/utils/project-archive.d.ts +32 -0
  56. package/dist/src/utils/project-archive.js +624 -0
  57. package/package.json +6 -5
  58. package/packages/types/dist/index.d.ts +128 -3
  59. package/packages/types/dist/index.js +106 -3
  60. package/plugin.json +1 -1
  61. package/skills/dataiku-dss/SKILL.md +26 -19
@@ -33,6 +33,19 @@ function firstNumberPath(value, paths) {
33
33
  }
34
34
  return undefined;
35
35
  }
36
+ function aggregateJobWaitResults(jobs, until) {
37
+ if (jobs.length === 1)
38
+ return jobs[0];
39
+ const failed = jobs.find((job) => !job.success);
40
+ return {
41
+ elapsedMs: jobs.reduce((maximum, job) => Math.max(maximum, job.elapsedMs), 0),
42
+ jobs,
43
+ pollCount: jobs.reduce((total, job) => total + job.pollCount, 0),
44
+ state: failed?.state ?? "DONE",
45
+ success: failed === undefined,
46
+ until,
47
+ };
48
+ }
36
49
  function jobSummaryId(job, fallback) {
37
50
  return stringPath(job, ["baseStatus", "def", "id",])
38
51
  ?? stringPath(job, ["def", "id",])
@@ -67,7 +80,7 @@ function filteredJobList(jobs, flags) {
67
80
  return false;
68
81
  return true;
69
82
  });
70
- const limit = flags["latest"] === true ? 1 : num(flags["limit"]);
83
+ const limit = flags["latest"] === true ? 1 : num(flags["limit"], "--limit");
71
84
  if (limit !== undefined)
72
85
  result = result.slice(0, Math.max(0, limit));
73
86
  return result;
@@ -259,9 +272,9 @@ export const jobCommands = {
259
272
  const options = {
260
273
  buildMode: f["build-mode"],
261
274
  partition: f["partition"],
262
- pollIntervalMs: num(f["poll-interval"]),
275
+ pollIntervalMs: num(f["poll-interval"], "--poll-interval"),
263
276
  targetType: jobBuildTargetTypeFromFlags(f),
264
- timeoutMs: num(f["timeout"]),
277
+ timeoutMs: num(f["timeout"], "--timeout"),
265
278
  };
266
279
  if (f["dry-run"] === true) {
267
280
  return {
@@ -297,8 +310,8 @@ export const jobCommands = {
297
310
  logFilter: jobLogFilterFromFlag(f["log-filter"]),
298
311
  maxLogLines: maxLogLinesFromFlags(f),
299
312
  partition: f["partition"],
300
- pollIntervalMs: num(f["poll-interval"]),
301
- timeoutMs: num(f["timeout"]),
313
+ pollIntervalMs: num(f["poll-interval"], "--poll-interval"),
314
+ timeoutMs: num(f["timeout"], "--timeout"),
302
315
  summary: f["summary"] === true,
303
316
  targetType: jobBuildTargetTypeFromFlags(f),
304
317
  };
@@ -331,8 +344,8 @@ export const jobCommands = {
331
344
  includeLogs: f["include-logs"] === true,
332
345
  logFilter: jobLogFilterFromFlag(f["log-filter"]),
333
346
  maxLogLines: maxLogLinesFromFlags(f),
334
- pollIntervalMs: num(f["poll-interval"]),
335
- timeoutMs: num(f["timeout"]),
347
+ pollIntervalMs: num(f["poll-interval"], "--poll-interval"),
348
+ timeoutMs: num(f["timeout"], "--timeout"),
336
349
  summary: f["summary"] === true,
337
350
  projectKey: f["project-key"],
338
351
  });
@@ -351,13 +364,13 @@ export const jobCommands = {
351
364
  includeLogs: f["include-logs"] === true,
352
365
  logFilter: jobLogFilterFromFlag(f["log-filter"]),
353
366
  maxLogLines: maxLogLinesFromFlags(f),
354
- pollIntervalMs: num(f["poll-interval"]),
355
- timeoutMs: num(f["timeout"]),
367
+ pollIntervalMs: num(f["poll-interval"], "--poll-interval"),
368
+ timeoutMs: num(f["timeout"], "--timeout"),
356
369
  summary: f["summary"] !== false,
357
370
  projectKey: f["project-key"],
358
371
  };
359
372
  const jobs = await Promise.all(a.map((jobId) => c.jobs.wait(jobId, options)));
360
- return a.length === 1 ? jobs[0] : { jobs, until: f["until"] ?? "all-done", };
373
+ return aggregateJobWaitResults(jobs, String(f["until"] ?? "all-done"));
361
374
  },
362
375
  usage: "dss job monitor <id...> [--summary] [--include-logs] [--log-filter stdout|stderr|user|errors] [--max-log-lines N] [--timeout MS] [--poll-interval MS] [--until all-done] [--project-key KEY]",
363
376
  description: "Monitor one or more existing jobs and summarize progress counters from logs.",
@@ -370,13 +383,13 @@ export const jobCommands = {
370
383
  includeLogs: f["include-logs"] === true,
371
384
  logFilter: jobLogFilterFromFlag(f["log-filter"]),
372
385
  maxLogLines: maxLogLinesFromFlags(f),
373
- pollIntervalMs: num(f["poll-interval"]),
374
- timeoutMs: num(f["timeout"]),
386
+ pollIntervalMs: num(f["poll-interval"], "--poll-interval"),
387
+ timeoutMs: num(f["timeout"], "--timeout"),
375
388
  summary: true,
376
389
  projectKey: f["project-key"],
377
390
  };
378
391
  const jobs = await Promise.all(a.map((jobId) => c.jobs.wait(jobId, options)));
379
- return a.length === 1 ? jobs[0] : { jobs, until: f["until"] ?? "all-done", };
392
+ return aggregateJobWaitResults(jobs, String(f["until"] ?? "all-done"));
380
393
  },
381
394
  usage: "dss job watch <id...> [--include-logs] [--log-filter stdout|stderr|user|errors] [--max-log-lines N] [--timeout MS] [--poll-interval MS] [--until all-done] [--project-key KEY]",
382
395
  description: "Watch one or more existing jobs with progress extraction enabled.",
@@ -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>;