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.
Files changed (120) hide show
  1. package/README.md +149 -46
  2. package/dist/build-metadata.json +1 -1
  3. package/dist/packages/types/src/index.d.ts +102 -0
  4. package/dist/packages/types/src/index.js +76 -0
  5. package/dist/src/cli/commands/app.js +57 -15
  6. package/dist/src/cli/commands/bundle.js +1 -1
  7. package/dist/src/cli/commands/code-env.js +13 -7
  8. package/dist/src/cli/commands/connection.d.ts +9 -0
  9. package/dist/src/cli/commands/connection.js +267 -1
  10. package/dist/src/cli/commands/data-collection.d.ts +2 -0
  11. package/dist/src/cli/commands/data-collection.js +164 -0
  12. package/dist/src/cli/commands/dataset.js +161 -32
  13. package/dist/src/cli/commands/future.js +2 -2
  14. package/dist/src/cli/commands/group.d.ts +2 -0
  15. package/dist/src/cli/commands/group.js +109 -0
  16. package/dist/src/cli/commands/index.js +151 -78
  17. package/dist/src/cli/commands/knowledge-bank.d.ts +2 -0
  18. package/dist/src/cli/commands/knowledge-bank.js +80 -0
  19. package/dist/src/cli/commands/llm.d.ts +2 -0
  20. package/dist/src/cli/commands/llm.js +93 -0
  21. package/dist/src/cli/commands/macro.d.ts +2 -0
  22. package/dist/src/cli/commands/macro.js +221 -0
  23. package/dist/src/cli/commands/ml-task.js +18 -6
  24. package/dist/src/cli/commands/notebook.js +6 -2
  25. package/dist/src/cli/commands/plugin.d.ts +2 -0
  26. package/dist/src/cli/commands/plugin.js +799 -0
  27. package/dist/src/cli/commands/project-folder.d.ts +2 -0
  28. package/dist/src/cli/commands/project-folder.js +197 -0
  29. package/dist/src/cli/commands/project-git.js +14 -54
  30. package/dist/src/cli/commands/project.js +52 -6
  31. package/dist/src/cli/commands/recipe.js +36 -1
  32. package/dist/src/cli/commands/saved-model.d.ts +5 -0
  33. package/dist/src/cli/commands/saved-model.js +388 -1
  34. package/dist/src/cli/commands/scenario.js +138 -1
  35. package/dist/src/cli/commands/user.d.ts +8 -0
  36. package/dist/src/cli/commands/user.js +296 -0
  37. package/dist/src/cli/contract.d.ts +1 -2
  38. package/dist/src/cli/contract.js +1089 -103
  39. package/dist/src/cli/flags.js +30 -1
  40. package/dist/src/cli/helpers/app-successor.d.ts +19 -4
  41. package/dist/src/cli/helpers/app-successor.js +90 -30
  42. package/dist/src/cli/helpers/cleanup.js +3 -1
  43. package/dist/src/cli/helpers/flow-zone.js +1 -2
  44. package/dist/src/cli/output.d.ts +1 -1
  45. package/dist/src/cli/output.js +23 -10
  46. package/dist/src/cli/usage.d.ts +1 -0
  47. package/dist/src/cli/usage.js +47 -1
  48. package/dist/src/cli.js +147 -41
  49. package/dist/src/client.d.ts +83 -5
  50. package/dist/src/client.js +185 -29
  51. package/dist/src/errors.d.ts +3 -0
  52. package/dist/src/errors.js +2 -0
  53. package/dist/src/index.d.ts +16 -7
  54. package/dist/src/index.js +11 -2
  55. package/dist/src/resources/analyses.js +1 -8
  56. package/dist/src/resources/applications.d.ts +8 -6
  57. package/dist/src/resources/applications.js +21 -21
  58. package/dist/src/resources/base.d.ts +4 -0
  59. package/dist/src/resources/base.js +15 -0
  60. package/dist/src/resources/bundles.d.ts +9 -4
  61. package/dist/src/resources/bundles.js +10 -5
  62. package/dist/src/resources/connections.d.ts +78 -1
  63. package/dist/src/resources/connections.js +132 -1
  64. package/dist/src/resources/data-collections.d.ts +118 -0
  65. package/dist/src/resources/data-collections.js +49 -0
  66. package/dist/src/resources/datasets.d.ts +69 -0
  67. package/dist/src/resources/datasets.js +99 -1
  68. package/dist/src/resources/futures.d.ts +4 -1
  69. package/dist/src/resources/futures.js +38 -6
  70. package/dist/src/resources/groups.d.ts +47 -0
  71. package/dist/src/resources/groups.js +56 -0
  72. package/dist/src/resources/jobs.d.ts +8 -13
  73. package/dist/src/resources/jobs.js +41 -16
  74. package/dist/src/resources/knowledge-banks.d.ts +58 -0
  75. package/dist/src/resources/knowledge-banks.js +61 -0
  76. package/dist/src/resources/llms.d.ts +92 -0
  77. package/dist/src/resources/llms.js +62 -0
  78. package/dist/src/resources/macros.d.ts +121 -0
  79. package/dist/src/resources/macros.js +231 -0
  80. package/dist/src/resources/ml-tasks.d.ts +37 -2
  81. package/dist/src/resources/ml-tasks.js +100 -20
  82. package/dist/src/resources/model-evaluation-stores.js +1 -8
  83. package/dist/src/resources/notebooks.d.ts +43 -7
  84. package/dist/src/resources/notebooks.js +53 -13
  85. package/dist/src/resources/plugins.d.ts +265 -0
  86. package/dist/src/resources/plugins.js +458 -0
  87. package/dist/src/resources/project-folders.d.ts +71 -0
  88. package/dist/src/resources/project-folders.js +57 -0
  89. package/dist/src/resources/project-git.d.ts +6 -0
  90. package/dist/src/resources/project-git.js +69 -42
  91. package/dist/src/resources/project-library.d.ts +0 -1
  92. package/dist/src/resources/project-library.js +1 -17
  93. package/dist/src/resources/projects.d.ts +19 -1
  94. package/dist/src/resources/projects.js +27 -1
  95. package/dist/src/resources/recipes.d.ts +15 -1
  96. package/dist/src/resources/recipes.js +73 -6
  97. package/dist/src/resources/saved-models.d.ts +134 -1
  98. package/dist/src/resources/saved-models.js +214 -6
  99. package/dist/src/resources/scenarios.d.ts +105 -0
  100. package/dist/src/resources/scenarios.js +232 -106
  101. package/dist/src/resources/sql.js +5 -1
  102. package/dist/src/resources/users.d.ts +129 -0
  103. package/dist/src/resources/users.js +128 -0
  104. package/dist/src/resources/webapps.d.ts +15 -2
  105. package/dist/src/resources/webapps.js +18 -4
  106. package/dist/src/schemas.d.ts +2 -2
  107. package/dist/src/schemas.js +1 -1
  108. package/dist/src/utils/deep-merge.d.ts +1 -1
  109. package/dist/src/utils/polling.d.ts +20 -0
  110. package/dist/src/utils/polling.js +27 -0
  111. package/dist/src/utils/response-file.js +1 -1
  112. package/dist/src/utils/secret-sanitize.d.ts +54 -0
  113. package/dist/src/utils/secret-sanitize.js +101 -0
  114. package/package.json +6 -5
  115. package/packages/types/dist/index.d.ts +102 -0
  116. package/packages/types/dist/index.js +76 -0
  117. package/plugin.json +1 -1
  118. package/skills/dataiku-dss/SKILL.md +7 -5
  119. package/skills/dataiku-dss/references/app-releases.md +8 -7
  120. package/skills/dataiku-dss/references/discovery.md +4 -4
@@ -48,10 +48,23 @@ export declare class WebappsResource extends BaseResource {
48
48
  /**
49
49
  * Start or restart a webapp backend. The documented endpoint returns a
50
50
  * reference to a future, which is surfaced as-is; settle it with
51
- * {@link restartBackendAndWait} or `client.futures.wait`.
51
+ * {@link restartBackendAndWait} or `client.futures.wait`. DSS 15 returns
52
+ * an empty body (no future) when no async job was spawned — the official
53
+ * Python client tolerates that (`DSSFuture.from_resp` accepts a missing
54
+ * jobId), so an empty response surfaces as `{}` rather than crashing.
52
55
  */
53
56
  startOrRestartBackend(webappId: string, projectKey?: string): Promise<Record<string, unknown>>;
54
- /** Restart a webapp backend and wait for the returned future to settle. */
57
+ /**
58
+ * Restart a webapp backend and wait for the returned future to settle.
59
+ * The documented endpoint returns a reference to a future; with a real
60
+ * jobId this polls that future to completion. An empty response carries
61
+ * NO future to wait on (observed on DSS 15 for a webapp whose backend is
62
+ * not enabled — a no-op restart, not a supported wait target), so the
63
+ * wait reports the missing future explicitly instead of fabricating a
64
+ * result for it. Enable the backend (params.backendEnabled with the
65
+ * params.python code, exactly as the DSS editor does) to get a real
66
+ * restart future.
67
+ */
55
68
  restartBackendAndWait(webappId: string, projectKey?: string, options?: WebappWaitOptions): Promise<FutureWaitResult>;
56
69
  /** Get a webapp backend's state. */
57
70
  getBackendState(webappId: string, projectKey?: string): Promise<Record<string, unknown>>;
@@ -59,18 +59,32 @@ export class WebappsResource extends BaseResource {
59
59
  /**
60
60
  * Start or restart a webapp backend. The documented endpoint returns a
61
61
  * reference to a future, which is surfaced as-is; settle it with
62
- * {@link restartBackendAndWait} or `client.futures.wait`.
62
+ * {@link restartBackendAndWait} or `client.futures.wait`. DSS 15 returns
63
+ * an empty body (no future) when no async job was spawned — the official
64
+ * Python client tolerates that (`DSSFuture.from_resp` accepts a missing
65
+ * jobId), so an empty response surfaces as `{}` rather than crashing.
63
66
  */
64
67
  async startOrRestartBackend(webappId, projectKey) {
65
68
  const id = encodeURIComponent(webappId);
66
- return this.client.put(`/public/api/projects/${this.enc(projectKey)}/webapps/${id}/backend/actions/restart`, {});
69
+ const future = await this.client.put(`/public/api/projects/${this.enc(projectKey)}/webapps/${id}/backend/actions/restart`, {});
70
+ return future ?? {};
67
71
  }
68
- /** Restart a webapp backend and wait for the returned future to settle. */
72
+ /**
73
+ * Restart a webapp backend and wait for the returned future to settle.
74
+ * The documented endpoint returns a reference to a future; with a real
75
+ * jobId this polls that future to completion. An empty response carries
76
+ * NO future to wait on (observed on DSS 15 for a webapp whose backend is
77
+ * not enabled — a no-op restart, not a supported wait target), so the
78
+ * wait reports the missing future explicitly instead of fabricating a
79
+ * result for it. Enable the backend (params.backendEnabled with the
80
+ * params.python code, exactly as the DSS editor does) to get a real
81
+ * restart future.
82
+ */
69
83
  async restartBackendAndWait(webappId, projectKey, options = {}) {
70
84
  const future = await this.startOrRestartBackend(webappId, projectKey);
71
85
  const jobId = future.jobId;
72
86
  if (typeof jobId !== "string" || jobId.length === 0) {
73
- throw new Error("Webapp backend restart did not return a future jobId.");
87
+ throw new ClientValidationError("Webapp backend restart returned no future jobId, so there is nothing to wait on.", "validation_failed", "The restart endpoint returns a future reference only when it starts an async job (a webapp with an enabled Python backend). Enable the backend before restarting with --wait.", { webappId, restartResponseKeys: Object.keys(future), });
74
88
  }
75
89
  return this.client.futures.wait(jobId, {
76
90
  pollIntervalMs: options.pollIntervalMs,
@@ -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, 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 "../packages/types/src/index.js";
7
- 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, SafeParseResult, ScenarioDetails, ScenarioStatus, ScenarioStepRun, ScenarioSummary, ScenarioWaitResult, SqlNotebookCell, SqlNotebookContent, SqlNotebookHistory, SqlNotebookSummary, SqlQueryResponse, SqlQueryResult, SqlQuerySchema, WikiArticleData, WikiArticleMetadata, WikiSettings, WikiTaxonomyNode, } from "../packages/types/src/index.js";
6
+ 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 "../packages/types/src/index.js";
7
+ 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, SafeParseResult, ScenarioDetails, ScenarioStatus, ScenarioStepRun, ScenarioSummary, ScenarioWaitResult, SqlNotebookCell, SqlNotebookContent, SqlNotebookHistory, SqlNotebookSummary, SqlQueryResponse, SqlQueryResult, SqlQuerySchema, WikiArticleData, WikiArticleMetadata, WikiSettings, WikiTaxonomyNode, } from "../packages/types/src/index.js";
@@ -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, 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 "../packages/types/src/index.js";
6
+ 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 "../packages/types/src/index.js";
@@ -1 +1 @@
1
- export declare function deepMerge<T extends Record<string, unknown>>(base: T, patch: Record<string, unknown>): T;
1
+ export declare function deepMerge<T extends object>(base: T, patch: Record<string, unknown>): T & Record<string, unknown>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Shared polling helpers used by every long-running wait loop (jobs, futures,
3
+ * scenarios, macros, Visual ML training, Project Git futures).
4
+ */
5
+ /** Hard ceiling for one adaptive backoff step (ms). */
6
+ export declare const MAX_POLL_INTERVAL_MS = 10000;
7
+ interface ComputeNextPollDelayMsOptions {
8
+ pollCount: number;
9
+ baseIntervalMs: number;
10
+ adaptiveEnabled: boolean;
11
+ }
12
+ /**
13
+ * Compute the next poll delay.
14
+ * When adaptive polling is enabled, the interval doubles every 3 polls,
15
+ * capped at MAX_POLL_INTERVAL_MS (or baseIntervalMs if it's larger).
16
+ */
17
+ export declare function computeNextPollDelayMs({ pollCount, baseIntervalMs, adaptiveEnabled, }: ComputeNextPollDelayMsOptions): number;
18
+ /** Distinguish an exhausted wait deadline from an earlier request timeout. */
19
+ export declare function isRequestDeadlineError(error: unknown, deadlineAt: number): boolean;
20
+ export {};
@@ -0,0 +1,27 @@
1
+ import { DataikuError, } from "../errors.js";
2
+ /**
3
+ * Shared polling helpers used by every long-running wait loop (jobs, futures,
4
+ * scenarios, macros, Visual ML training, Project Git futures).
5
+ */
6
+ /** Hard ceiling for one adaptive backoff step (ms). */
7
+ export const MAX_POLL_INTERVAL_MS = 10_000;
8
+ /**
9
+ * Compute the next poll delay.
10
+ * When adaptive polling is enabled, the interval doubles every 3 polls,
11
+ * capped at MAX_POLL_INTERVAL_MS (or baseIntervalMs if it's larger).
12
+ */
13
+ export function computeNextPollDelayMs({ pollCount, baseIntervalMs, adaptiveEnabled, }) {
14
+ if (!adaptiveEnabled) {
15
+ return baseIntervalMs;
16
+ }
17
+ const step = Math.max(0, Math.floor((pollCount - 1) / 3));
18
+ const interval = baseIntervalMs * 2 ** step;
19
+ return Math.min(interval, Math.max(baseIntervalMs, MAX_POLL_INTERVAL_MS));
20
+ }
21
+ /** Distinguish an exhausted wait deadline from an earlier request timeout. */
22
+ export function isRequestDeadlineError(error, deadlineAt) {
23
+ return Date.now() >= deadlineAt
24
+ && error instanceof DataikuError
25
+ && error.status === 0
26
+ && (error.retry?.timedOut === true || error.statusText === "Request Timeout");
27
+ }
@@ -17,7 +17,7 @@ export async function writeResponseToFile(path, response, permissions = "private
17
17
  mode = 0o666 & ~process.umask();
18
18
  }
19
19
  }
20
- const input = Readable.fromWeb(response.body);
20
+ const input = Readable.from(response.body, { objectMode: false, });
21
21
  const temporaryPath = join(dirname(path), `.${basename(path)}.tmp-${randomUUID()}`);
22
22
  const output = createWriteStream(temporaryPath, { flags: "wx", mode: 0o600, });
23
23
  try {
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Shared recursive secret sanitizer for CLI output and error surfaces.
3
+ *
4
+ * Walks any JSON-like value and:
5
+ * - replaces values under sensitive keys (per-domain key table) with `[redacted]`;
6
+ * - replaces exact occurrences of known secret values anywhere in strings;
7
+ * - optionally redacts userinfo embedded in HTTP(S) URL authorities
8
+ * (`https://user:pass@host/...` -> `https://[redacted]@host/...`).
9
+ *
10
+ * The SDK resource layer forwards values verbatim to DSS over TLS; sanitization
11
+ * is a CLI presentation concern and must never leak secret material instead.
12
+ */
13
+ /** Marker replacing every redacted value or secret occurrence. */
14
+ export declare const SECRET_REDACTED = "[redacted]";
15
+ /** Sensitive keys are matched after stripping `-`/`_` and lowercasing. */
16
+ export declare function normalizeSecretKey(key: string): string;
17
+ export interface SecretSanitizeOptions {
18
+ /**
19
+ * Per-domain table of sensitive keys (normalized form -> true). Policies
20
+ * deliberately differ between domains; never merge them.
21
+ */
22
+ sensitiveKeys: Record<string, true>;
23
+ /**
24
+ * Optional extra predicate over normalized keys for key families a flat
25
+ * table cannot express (e.g. the user `secrets` array).
26
+ */
27
+ isSensitiveKey?: (normalizedKey: string) => boolean;
28
+ /** Exact secret values to replace everywhere in strings. */
29
+ secrets?: string[];
30
+ /** Also redact userinfo embedded in HTTP(S) URL authorities. */
31
+ redactUrlUserinfo?: boolean;
32
+ }
33
+ /**
34
+ * Replace every exact occurrence of each secret so echoed errors cannot leak
35
+ * it. Empty secrets are skipped (an empty needle would corrupt every string).
36
+ */
37
+ export declare function replaceSecrets(text: string, secrets: readonly string[]): string;
38
+ /**
39
+ * Redact the userinfo of every HTTP(S) URL in a string. DSS may contain legacy
40
+ * remotes with credentials in the URL, and Git error text can echo them.
41
+ */
42
+ export declare function redactUrlUserinfo(text: string): string;
43
+ /**
44
+ * Recursively sanitize `value`: strings lose exact secret occurrences (and
45
+ * URL userinfo when enabled), objects redact values under sensitive keys and
46
+ * recurse, arrays recurse. Non-string scalars pass through unchanged.
47
+ */
48
+ export declare function sanitizeSecrets<T>(value: T, options: SecretSanitizeOptions): T;
49
+ /**
50
+ * Scrub secret material from an error's message, stack, and string body.
51
+ * `DataikuError.message` is built at construction, so all three carriers need
52
+ * the same string pass as output values.
53
+ */
54
+ export declare function sanitizeErrorSecrets(error: unknown, options: SecretSanitizeOptions): unknown;
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Shared recursive secret sanitizer for CLI output and error surfaces.
3
+ *
4
+ * Walks any JSON-like value and:
5
+ * - replaces values under sensitive keys (per-domain key table) with `[redacted]`;
6
+ * - replaces exact occurrences of known secret values anywhere in strings;
7
+ * - optionally redacts userinfo embedded in HTTP(S) URL authorities
8
+ * (`https://user:pass@host/...` -> `https://[redacted]@host/...`).
9
+ *
10
+ * The SDK resource layer forwards values verbatim to DSS over TLS; sanitization
11
+ * is a CLI presentation concern and must never leak secret material instead.
12
+ */
13
+ /** Marker replacing every redacted value or secret occurrence. */
14
+ export const SECRET_REDACTED = "[redacted]";
15
+ /** Sensitive keys are matched after stripping `-`/`_` and lowercasing. */
16
+ export function normalizeSecretKey(key) {
17
+ return key.replace(/[-_]/g, "").toLowerCase();
18
+ }
19
+ /**
20
+ * Replace every exact occurrence of each secret so echoed errors cannot leak
21
+ * it. Empty secrets are skipped (an empty needle would corrupt every string).
22
+ */
23
+ export function replaceSecrets(text, secrets) {
24
+ let result = text;
25
+ for (const secret of secrets) {
26
+ if (secret !== "" && secret !== undefined && secret !== null) {
27
+ result = result.split(secret).join(SECRET_REDACTED);
28
+ }
29
+ }
30
+ return result;
31
+ }
32
+ /**
33
+ * Redact the userinfo of every HTTP(S) URL in a string. DSS may contain legacy
34
+ * remotes with credentials in the URL, and Git error text can echo them.
35
+ */
36
+ export function redactUrlUserinfo(text) {
37
+ return text.replace(/https?:[\\/]{1,2}[^\s"'<>]+/giu, (url) => {
38
+ const schemeEnd = url.indexOf(":") + 1;
39
+ let authorityStart = schemeEnd;
40
+ while (url[authorityStart] === "/" || url[authorityStart] === "\\")
41
+ authorityStart++;
42
+ const slash = url.slice(authorityStart).search(/[\\/]/u);
43
+ const authorityEnd = slash === -1 ? url.length : authorityStart + slash;
44
+ const at = url.lastIndexOf("@", authorityEnd - 1);
45
+ if (at < authorityStart)
46
+ return url;
47
+ return `${url.slice(0, authorityStart)}${SECRET_REDACTED}@${url.slice(at + 1)}`;
48
+ });
49
+ }
50
+ /**
51
+ * Recursively sanitize `value`: strings lose exact secret occurrences (and
52
+ * URL userinfo when enabled), objects redact values under sensitive keys and
53
+ * recurse, arrays recurse. Non-string scalars pass through unchanged.
54
+ */
55
+ export function sanitizeSecrets(value, options) {
56
+ const { secrets = [], } = options;
57
+ const stringPass = (text) => {
58
+ const sanitized = options.redactUrlUserinfo ? redactUrlUserinfo(text) : text;
59
+ return replaceSecrets(sanitized, secrets);
60
+ };
61
+ if (typeof value === "string") {
62
+ return stringPass(value);
63
+ }
64
+ if (Array.isArray(value)) {
65
+ return value.map((item) => sanitizeSecrets(item, options));
66
+ }
67
+ if (value !== null && typeof value === "object") {
68
+ const sanitized = {};
69
+ for (const [key, item,] of Object.entries(value)) {
70
+ const normalizedKey = normalizeSecretKey(key);
71
+ sanitized[key] = options.sensitiveKeys[normalizedKey] === true
72
+ || options.isSensitiveKey?.(normalizedKey) === true
73
+ ? SECRET_REDACTED
74
+ : sanitizeSecrets(item, options);
75
+ }
76
+ return sanitized;
77
+ }
78
+ return value;
79
+ }
80
+ /**
81
+ * Scrub secret material from an error's message, stack, and string body.
82
+ * `DataikuError.message` is built at construction, so all three carriers need
83
+ * the same string pass as output values.
84
+ */
85
+ export function sanitizeErrorSecrets(error, options) {
86
+ if (!(error instanceof Error))
87
+ return error;
88
+ const stringPass = (text) => {
89
+ const sanitized = options.redactUrlUserinfo ? redactUrlUserinfo(text) : text;
90
+ return replaceSecrets(sanitized, options.secrets ?? []);
91
+ };
92
+ error.message = stringPass(error.message);
93
+ if (typeof error.stack === "string") {
94
+ error.stack = stringPass(error.stack);
95
+ }
96
+ const errorWithBody = error;
97
+ if (typeof errorWithBody.body === "string") {
98
+ errorWithBody.body = stringPass(errorWithBody.body);
99
+ }
100
+ return error;
101
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dataiku-sdk",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "Dataiku DSS SDK and CLI for programmatic access to DSS REST APIs",
5
5
  "type": "module",
6
6
  "workspaces": [
@@ -25,10 +25,10 @@
25
25
  "build": "tsc && bun scripts/generate-build-metadata.mjs && tsc -p packages/types/tsconfig.json",
26
26
  "prepack": "bun scripts/sync-plugin-version.mjs --check && tsc && bun scripts/generate-build-metadata.mjs && tsc -p packages/types/tsconfig.json",
27
27
  "prepublishOnly": "bun scripts/sync-plugin-version.mjs --check && tsc && bun scripts/generate-build-metadata.mjs && tsc -p packages/types/tsconfig.json",
28
- "check": "tsc --noEmit && bun run check:live && bun scripts/sync-plugin-version.mjs --check",
28
+ "check": "tsc --noEmit && tsc -p tools/oxlint/tsconfig.json && bun run check:live && bun scripts/sync-plugin-version.mjs --check",
29
29
  "version": "bun scripts/sync-plugin-version.mjs && git add plugin.json",
30
- "lint": "oxlint src/ scripts/live-suite.ts tests/live-*.ts",
31
- "lint:fix": "oxlint --fix src/ scripts/live-suite.ts tests/live-*.ts",
30
+ "lint": "oxlint src/ tools/oxlint/ scripts/live-suite.ts tests/live-*.ts",
31
+ "lint:fix": "oxlint --fix src/ tools/oxlint/ scripts/live-suite.ts tests/live-*.ts",
32
32
  "format": "dprint fmt",
33
33
  "format:check": "dprint check",
34
34
  "test": "bun test",
@@ -42,11 +42,12 @@
42
42
  "test:integration:rigorous:mutating": "cross-env RUN_DATAIKU_INTEGRATION=1 RUN_DATAIKU_INTEGRATION_MUTATING=1 bun test tests/integration-rigorous.test.ts"
43
43
  },
44
44
  "devDependencies": {
45
+ "@oxlint/plugins": "1.81.0",
45
46
  "@types/bun": "^1.4.0",
46
47
  "cross-env": "^10.1.0",
47
48
  "dprint": "^0.57.0",
48
49
  "js-tiktoken": "1.0.21",
49
- "oxlint": "^1.81.0",
50
+ "oxlint": "1.81.0",
50
51
  "typescript": "^7.0.2",
51
52
  "typescript-language-server": "6.0.0",
52
53
  "typescript-language-service": "npm:typescript@5.9.3"
@@ -59,6 +59,12 @@ export declare const ProjectMetadataSchema: import("@sinclair/typebox").TObject<
59
59
  }>>;
60
60
  }>;
61
61
  export type ProjectMetadata = Static<typeof ProjectMetadataSchema>;
62
+ export declare const ProjectTagsSchema: import("@sinclair/typebox").TObject<{
63
+ tags: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
64
+ color: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
65
+ }>>;
66
+ }>;
67
+ export type ProjectTags = Static<typeof ProjectTagsSchema>;
62
68
  export declare const DatasetSummarySchema: import("@sinclair/typebox").TObject<{
63
69
  name: import("@sinclair/typebox").TString;
64
70
  type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -308,6 +314,85 @@ export declare const ScenarioWaitResultSchema: import("@sinclair/typebox").TObje
308
314
  }>>>;
309
315
  }>;
310
316
  export type ScenarioWaitResult = Static<typeof ScenarioWaitResultSchema>;
317
+ /** A macro definition as returned by GET /projects/{pk}/runnables/{runnableType}. */
318
+ export declare const MacroDefinitionSchema: import("@sinclair/typebox").TObject<{
319
+ runnableType: import("@sinclair/typebox").TString;
320
+ ownerPluginId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
321
+ meta: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
322
+ label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
323
+ }>>;
324
+ longDescription: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
325
+ resultType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
326
+ extension: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
327
+ mimeType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
328
+ resultLabel: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
329
+ params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
330
+ name: import("@sinclair/typebox").TString;
331
+ type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
332
+ }>>>;
333
+ adminParams: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>>;
334
+ }>;
335
+ export type MacroDefinition = Static<typeof MacroDefinitionSchema>;
336
+ /** One entry of GET /projects/{pk}/runnables (array[Macro]). */
337
+ export declare const MacroSummarySchema: import("@sinclair/typebox").TObject<{
338
+ runnableType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
339
+ /** Owning plugin id as the server returns it (live identifiers are server-authored). */
340
+ ownerPluginId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
341
+ meta: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
342
+ label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
343
+ }>>;
344
+ }>;
345
+ export type MacroSummary = Static<typeof MacroSummarySchema>;
346
+ export declare const MacroSummaryArraySchema: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
347
+ runnableType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
348
+ /** Owning plugin id as the server returns it (live identifiers are server-authored). */
349
+ ownerPluginId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
350
+ meta: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
351
+ label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
352
+ }>>;
353
+ }>>;
354
+ export type MacroSummaryArray = Static<typeof MacroSummaryArraySchema>;
355
+ /**
356
+ * Poll-state response of GET /projects/{pk}/runnables/{runnableType}/state/{run}.
357
+ * While running: `running: true` and optionally a stack of `progress` entries.
358
+ * When finished: `running: false`; on failure `resultError`/`storedError` carry
359
+ * details, otherwise `type` is filled.
360
+ */
361
+ export declare const MacroStateSchema: import("@sinclair/typebox").TObject<{
362
+ exists: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
363
+ running: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
364
+ empty: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
365
+ type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
366
+ progress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
367
+ resultError: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
368
+ storedError: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
369
+ }>;
370
+ export type MacroState = Static<typeof MacroStateSchema>;
371
+ /** Run trigger response of POST /projects/{pk}/runnables/{runnableType}. */
372
+ export declare const MacroRunStartSchema: import("@sinclair/typebox").TObject<{
373
+ runId: import("@sinclair/typebox").TString;
374
+ }>;
375
+ export type MacroRunStart = Static<typeof MacroRunStartSchema>;
376
+ /** Result of {@link MacrosResource.runAndWait}: bounded client-side polling. */
377
+ export declare const MacroWaitResultSchema: import("@sinclair/typebox").TObject<{
378
+ runnableType: import("@sinclair/typebox").TString;
379
+ runId: import("@sinclair/typebox").TString;
380
+ running: import("@sinclair/typebox").TBoolean;
381
+ success: import("@sinclair/typebox").TBoolean;
382
+ elapsedMs: import("@sinclair/typebox").TNumber;
383
+ pollCount: import("@sinclair/typebox").TNumber;
384
+ timedOut: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
385
+ state: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
386
+ exists: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
387
+ running: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
388
+ empty: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
389
+ type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
390
+ progress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
391
+ resultError: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
392
+ storedError: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
393
+ }>>;
394
+ }>;
395
+ export type MacroWaitResult = Static<typeof MacroWaitResultSchema>;
311
396
  export declare const FlowZoneObjectTypeSchema: 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">]>;
312
397
  export type FlowZoneObjectType = Static<typeof FlowZoneObjectTypeSchema>;
313
398
  export declare const FlowZoneItemSchema: import("@sinclair/typebox").TObject<{
@@ -658,6 +743,11 @@ export declare const SqlNotebookCellSchema: import("@sinclair/typebox").TObject<
658
743
  id: import("@sinclair/typebox").TString;
659
744
  type: import("@sinclair/typebox").TString;
660
745
  name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
746
+ /**
747
+ * Cell source. DSS enforces a JSON string here: an array fails to parse
748
+ * server-side (`Expected a string but was BEGIN_ARRAY ... $.cells[0].code`),
749
+ * so the official-client example's line-array form does not apply to SQL.
750
+ */
661
751
  code: import("@sinclair/typebox").TString;
662
752
  }>;
663
753
  export type SqlNotebookCell = Static<typeof SqlNotebookCellSchema>;
@@ -668,12 +758,24 @@ export declare const SqlNotebookSummarySchema: import("@sinclair/typebox").TObje
668
758
  connection: import("@sinclair/typebox").TString;
669
759
  }>;
670
760
  export type SqlNotebookSummary = Static<typeof SqlNotebookSummarySchema>;
761
+ /**
762
+ * A SQL notebook's content as returned by GET. The notebook record carries
763
+ * the server-allocated `id` (a request-supplied `id` is rejected on create)
764
+ * plus `name`/`projectKey`/`isRunning` and similar receipt fields via
765
+ * `additionalProperties`; requests supply `connection` + `cells` (and
766
+ * optionally `name` as the display handle).
767
+ */
671
768
  export declare const SqlNotebookContentSchema: import("@sinclair/typebox").TObject<{
672
769
  connection: import("@sinclair/typebox").TString;
673
770
  cells: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
674
771
  id: import("@sinclair/typebox").TString;
675
772
  type: import("@sinclair/typebox").TString;
676
773
  name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
774
+ /**
775
+ * Cell source. DSS enforces a JSON string here: an array fails to parse
776
+ * server-side (`Expected a string but was BEGIN_ARRAY ... $.cells[0].code`),
777
+ * so the official-client example's line-array form does not apply to SQL.
778
+ */
677
779
  code: import("@sinclair/typebox").TString;
678
780
  }>>;
679
781
  }>;
@@ -113,6 +113,9 @@ export const ProjectMetadataSchema = Type.Object({
113
113
  }, { additionalProperties: true, }))),
114
114
  }, { additionalProperties: true, })),
115
115
  }, { additionalProperties: true, });
116
+ export const ProjectTagsSchema = Type.Object({
117
+ tags: Type.Record(Type.String(), Type.Object({ color: Type.Optional(Type.String()), }, { additionalProperties: true, }), { additionalProperties: true, }),
118
+ }, { additionalProperties: true, });
116
119
  // ---------------------------------------------------------------------------
117
120
  // Datasets
118
121
  // ---------------------------------------------------------------------------
@@ -347,6 +350,67 @@ export const ScenarioWaitResultSchema = Type.Object({
347
350
  steps: Type.Optional(Type.Array(ScenarioStepRunSchema)),
348
351
  });
349
352
  // ---------------------------------------------------------------------------
353
+ // Macros (runnables)
354
+ // ---------------------------------------------------------------------------
355
+ /** A macro definition as returned by GET /projects/{pk}/runnables/{runnableType}. */
356
+ export const MacroDefinitionSchema = Type.Object({
357
+ runnableType: Type.String(),
358
+ ownerPluginId: Type.Optional(Type.String()),
359
+ meta: Type.Optional(Type.Object({
360
+ label: Type.Optional(Type.String()),
361
+ }, { additionalProperties: true, })),
362
+ longDescription: Type.Optional(Type.String()),
363
+ resultType: Type.Optional(Type.String()),
364
+ extension: Type.Optional(Type.String()),
365
+ mimeType: Type.Optional(Type.String()),
366
+ resultLabel: Type.Optional(Type.String()),
367
+ params: Type.Optional(Type.Array(Type.Object({
368
+ name: Type.String(),
369
+ type: Type.Optional(Type.String()),
370
+ }, { additionalProperties: true, }))),
371
+ adminParams: Type.Optional(Type.Array(Type.Unknown())),
372
+ }, { additionalProperties: true, });
373
+ /** One entry of GET /projects/{pk}/runnables (array[Macro]). */
374
+ export const MacroSummarySchema = Type.Object({
375
+ runnableType: Type.Optional(Type.String()),
376
+ /** Owning plugin id as the server returns it (live identifiers are server-authored). */
377
+ ownerPluginId: Type.Optional(Type.String()),
378
+ meta: Type.Optional(Type.Object({
379
+ label: Type.Optional(Type.String()),
380
+ }, { additionalProperties: true, })),
381
+ }, { additionalProperties: true, });
382
+ export const MacroSummaryArraySchema = Type.Array(MacroSummarySchema);
383
+ /**
384
+ * Poll-state response of GET /projects/{pk}/runnables/{runnableType}/state/{run}.
385
+ * While running: `running: true` and optionally a stack of `progress` entries.
386
+ * When finished: `running: false`; on failure `resultError`/`storedError` carry
387
+ * details, otherwise `type` is filled.
388
+ */
389
+ export const MacroStateSchema = Type.Object({
390
+ exists: Type.Optional(Type.Boolean()),
391
+ running: Type.Optional(Type.Boolean()),
392
+ empty: Type.Optional(Type.Boolean()),
393
+ type: Type.Optional(Type.String()),
394
+ progress: Type.Optional(Type.Unknown()),
395
+ resultError: Type.Optional(Type.Unknown()),
396
+ storedError: Type.Optional(Type.Unknown()),
397
+ }, { additionalProperties: true, });
398
+ /** Run trigger response of POST /projects/{pk}/runnables/{runnableType}. */
399
+ export const MacroRunStartSchema = Type.Object({
400
+ runId: Type.String(),
401
+ }, { additionalProperties: true, });
402
+ /** Result of {@link MacrosResource.runAndWait}: bounded client-side polling. */
403
+ export const MacroWaitResultSchema = Type.Object({
404
+ runnableType: Type.String(),
405
+ runId: Type.String(),
406
+ running: Type.Boolean(),
407
+ success: Type.Boolean(),
408
+ elapsedMs: Type.Number(),
409
+ pollCount: Type.Number(),
410
+ timedOut: Type.Optional(Type.Boolean()),
411
+ state: Type.Optional(MacroStateSchema),
412
+ }, { additionalProperties: true, });
413
+ // ---------------------------------------------------------------------------
350
414
  // Flow zones
351
415
  // ---------------------------------------------------------------------------
352
416
  export const FlowZoneObjectTypeSchema = Type.Union([
@@ -631,6 +695,11 @@ export const SqlNotebookCellSchema = Type.Object({
631
695
  id: Type.String(),
632
696
  type: Type.String(),
633
697
  name: Type.Optional(Type.String()),
698
+ /**
699
+ * Cell source. DSS enforces a JSON string here: an array fails to parse
700
+ * server-side (`Expected a string but was BEGIN_ARRAY ... $.cells[0].code`),
701
+ * so the official-client example's line-array form does not apply to SQL.
702
+ */
634
703
  code: Type.String(),
635
704
  }, { additionalProperties: true, });
636
705
  export const SqlNotebookSummarySchema = Type.Object({
@@ -639,6 +708,13 @@ export const SqlNotebookSummarySchema = Type.Object({
639
708
  language: Type.String(),
640
709
  connection: Type.String(),
641
710
  }, { additionalProperties: true, });
711
+ /**
712
+ * A SQL notebook's content as returned by GET. The notebook record carries
713
+ * the server-allocated `id` (a request-supplied `id` is rejected on create)
714
+ * plus `name`/`projectKey`/`isRunning` and similar receipt fields via
715
+ * `additionalProperties`; requests supply `connection` + `cells` (and
716
+ * optionally `name` as the display handle).
717
+ */
642
718
  export const SqlNotebookContentSchema = Type.Object({
643
719
  connection: Type.String(),
644
720
  cells: Type.Array(SqlNotebookCellSchema),
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "dataiku-sdk",
4
- "version": "3.2.0",
4
+ "version": "3.3.0",
5
5
  "description": "Dataiku DSS SDK and agent-oriented CLI for programmatic access to DSS REST APIs.",
6
6
  "homepage": "https://github.com/clssck/dataiku-sdk",
7
7
  "repository": "https://github.com/clssck/dataiku-sdk",
@@ -21,13 +21,15 @@ Bootstrap once:
21
21
  ```text
22
22
  dss agent contract --fields protocol,agentContractVersion,cli,stdio,planning,compatibility
23
23
  ```
24
- Find actions: `dss commands run`. Before invoking, discover exact syntax:
24
+ Known resource: `dss agent contract --fields commands.actions.dataset`; otherwise `dss commands run`.
25
+ For reads, discover compact syntax:
25
26
  ```text
26
- dss commands run --fields dataset.create.usage,dataset.create.description,dataset.create.flags,dataset.create.examples
27
+ dss commands run --fields dataset.preview.usage,dataset.preview.description,dataset.preview.flags,dataset.preview.examples
27
28
  ```
28
- Use `--fields RESOURCE.ACTION` for payload schemas, side effects, auth, idempotency,
29
- dry-run, cleanup, or output details. Combine paths in one request. Never load the full
30
- registry into context; export only if needed: `dss commands run --output commands.json`.
29
+ For writes, fetch `--fields RESOURCE.ACTION` once, directly: the full entry includes
30
+ syntax, payload schemas, side effects, auth, idempotency, dry-run, cleanup, and output.
31
+ Combine paths in one request. Never load the full registry into context; export only
32
+ if needed: `dss commands run --output commands.json`.
31
33
 
32
34
  ## Safety and results
33
35