dataiku-sdk 3.0.0 → 3.2.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 (109) hide show
  1. package/README.md +246 -19
  2. package/dist/build-metadata.json +1 -1
  3. package/dist/packages/types/src/index.d.ts +39 -4
  4. package/dist/packages/types/src/index.js +31 -2
  5. package/dist/src/auth.js +1 -1
  6. package/dist/src/cli/coerce.js +11 -2
  7. package/dist/src/cli/commands/analysis.js +4 -3
  8. package/dist/src/cli/commands/api-service.js +66 -18
  9. package/dist/src/cli/commands/app.js +4 -3
  10. package/dist/src/cli/commands/bundle.js +51 -16
  11. package/dist/src/cli/commands/code-env.js +219 -57
  12. package/dist/src/cli/commands/code.d.ts +19 -0
  13. package/dist/src/cli/commands/code.js +87 -15
  14. package/dist/src/cli/commands/dashboard.js +7 -6
  15. package/dist/src/cli/commands/data-quality.js +9 -8
  16. package/dist/src/cli/commands/dataset.js +17 -11
  17. package/dist/src/cli/commands/doctor.js +4 -2
  18. package/dist/src/cli/commands/flow-zone.js +42 -13
  19. package/dist/src/cli/commands/folder.js +9 -8
  20. package/dist/src/cli/commands/future.js +2 -1
  21. package/dist/src/cli/commands/insight.js +8 -7
  22. package/dist/src/cli/commands/job.js +4 -3
  23. package/dist/src/cli/commands/meaning.js +5 -4
  24. package/dist/src/cli/commands/ml-task.js +3 -2
  25. package/dist/src/cli/commands/model-evaluation-store.js +4 -3
  26. package/dist/src/cli/commands/notebook.js +82 -50
  27. package/dist/src/cli/commands/project-git.js +8 -5
  28. package/dist/src/cli/commands/project-library.d.ts +21 -0
  29. package/dist/src/cli/commands/project-library.js +128 -56
  30. package/dist/src/cli/commands/project.js +19 -4
  31. package/dist/src/cli/commands/recipe.js +51 -25
  32. package/dist/src/cli/commands/saved-model.js +4 -3
  33. package/dist/src/cli/commands/scenario.js +9 -8
  34. package/dist/src/cli/commands/sql.d.ts +10 -0
  35. package/dist/src/cli/commands/sql.js +42 -19
  36. package/dist/src/cli/commands/statistics.js +7 -6
  37. package/dist/src/cli/commands/variable.js +2 -1
  38. package/dist/src/cli/commands/webapp.js +68 -13
  39. package/dist/src/cli/commands/wiki.js +7 -6
  40. package/dist/src/cli/contract.d.ts +16 -1
  41. package/dist/src/cli/contract.js +967 -186
  42. package/dist/src/cli/env.d.ts +9 -0
  43. package/dist/src/cli/env.js +20 -2
  44. package/dist/src/cli/flags.d.ts +4 -0
  45. package/dist/src/cli/flags.js +29 -1
  46. package/dist/src/cli/helpers/cleanup.js +104 -3
  47. package/dist/src/cli/helpers/flow-zone.d.ts +3 -0
  48. package/dist/src/cli/helpers/flow-zone.js +33 -3
  49. package/dist/src/cli/helpers/recipe.d.ts +20 -0
  50. package/dist/src/cli/helpers/recipe.js +158 -3
  51. package/dist/src/cli/output.d.ts +2 -0
  52. package/dist/src/cli/output.js +33 -6
  53. package/dist/src/cli/runtime.d.ts +35 -1
  54. package/dist/src/cli/runtime.js +125 -18
  55. package/dist/src/cli/types.d.ts +7 -0
  56. package/dist/src/cli.js +226 -95
  57. package/dist/src/client.d.ts +63 -1
  58. package/dist/src/client.js +305 -53
  59. package/dist/src/errors.d.ts +8 -2
  60. package/dist/src/errors.js +42 -0
  61. package/dist/src/index.d.ts +4 -3
  62. package/dist/src/index.js +2 -1
  63. package/dist/src/resources/api-services.d.ts +48 -6
  64. package/dist/src/resources/api-services.js +54 -8
  65. package/dist/src/resources/bundles.d.ts +51 -6
  66. package/dist/src/resources/bundles.js +39 -9
  67. package/dist/src/resources/code-envs.d.ts +25 -3
  68. package/dist/src/resources/code-envs.js +104 -2
  69. package/dist/src/resources/datasets.d.ts +20 -0
  70. package/dist/src/resources/datasets.js +232 -52
  71. package/dist/src/resources/folders.js +2 -1
  72. package/dist/src/resources/jobs.d.ts +35 -10
  73. package/dist/src/resources/jobs.js +92 -17
  74. package/dist/src/resources/notebooks.d.ts +77 -7
  75. package/dist/src/resources/notebooks.js +143 -19
  76. package/dist/src/resources/project-git.d.ts +12 -0
  77. package/dist/src/resources/project-git.js +39 -8
  78. package/dist/src/resources/project-library.d.ts +122 -7
  79. package/dist/src/resources/project-library.js +494 -25
  80. package/dist/src/resources/projects.d.ts +5 -4
  81. package/dist/src/resources/projects.js +21 -19
  82. package/dist/src/resources/scenarios.d.ts +30 -0
  83. package/dist/src/resources/scenarios.js +73 -27
  84. package/dist/src/resources/sql.d.ts +6 -0
  85. package/dist/src/resources/sql.js +23 -3
  86. package/dist/src/resources/webapps.d.ts +35 -4
  87. package/dist/src/resources/webapps.js +54 -5
  88. package/dist/src/schemas.d.ts +2 -2
  89. package/dist/src/schemas.js +1 -1
  90. package/dist/src/skill.d.ts +18 -0
  91. package/dist/src/skill.js +93 -9
  92. package/dist/src/utils/flow-analysis.d.ts +53 -0
  93. package/dist/src/utils/flow-analysis.js +382 -0
  94. package/dist/src/utils/project-archive.d.ts +41 -2
  95. package/dist/src/utils/project-archive.js +159 -16
  96. package/dist/src/utils/response-file.d.ts +2 -0
  97. package/dist/src/utils/response-file.js +34 -0
  98. package/package.json +9 -7
  99. package/packages/types/dist/index.d.ts +39 -4
  100. package/packages/types/dist/index.js +31 -2
  101. package/plugin.json +1 -1
  102. package/skills/dataiku-dss/SKILL.md +44 -197
  103. package/skills/dataiku-dss/references/app-releases.md +27 -0
  104. package/skills/dataiku-dss/references/authentication.md +39 -0
  105. package/skills/dataiku-dss/references/coding.md +8 -0
  106. package/skills/dataiku-dss/references/discovery.md +30 -0
  107. package/skills/dataiku-dss/references/flow-maps.md +12 -0
  108. package/skills/dataiku-dss/references/mutations.md +33 -0
  109. package/skills/dataiku-dss/references/troubleshooting.md +29 -0
@@ -8,6 +8,8 @@ export function dataikuErrorCode(category) {
8
8
  return "validation_failed";
9
9
  case "transient":
10
10
  return "transient";
11
+ case "unexpected_response":
12
+ return "unexpected_response";
11
13
  case "unknown":
12
14
  return "internal_error";
13
15
  }
@@ -17,11 +19,21 @@ const CANONICAL_STATUS_TEXT = {
17
19
  401: "Unauthorized",
18
20
  403: "Forbidden",
19
21
  404: "Not Found",
22
+ 405: "Method Not Allowed",
23
+ 406: "Not Acceptable",
20
24
  408: "Request Timeout",
21
25
  409: "Conflict",
26
+ 410: "Gone",
27
+ 412: "Precondition Failed",
28
+ 413: "Payload Too Large",
29
+ 415: "Unsupported Media Type",
30
+ 416: "Range Not Satisfiable",
31
+ 418: "I'm a Teapot",
22
32
  422: "Unprocessable Entity",
23
33
  425: "Too Early",
34
+ 426: "Upgrade Required",
24
35
  429: "Too Many Requests",
36
+ 451: "Unavailable For Legal Reasons",
25
37
  500: "Internal Server Error",
26
38
  501: "Not Implemented",
27
39
  502: "Bad Gateway",
@@ -43,6 +55,12 @@ export class ClientValidationError extends Error {
43
55
  this.details = details;
44
56
  }
45
57
  }
58
+ /**
59
+ * Message prefix the client stamps on a 2xx body that is not JSON. The
60
+ * classifier recognizes exactly this prefix, so the parse-failure path and the
61
+ * taxonomy stay in sync as one contract.
62
+ */
63
+ export const NON_JSON_RESPONSE_MARKER = "Expected JSON response body but got non-JSON content";
46
64
  const TLS_CERTIFICATE_HINT = "TLS certificate verification failed. Trust the DSS/corporate CA with --ca-cert PATH or NODE_EXTRA_CA_CERTS; use --insecure only for temporary troubleshooting.";
47
65
  const BUSINESS_APPS_API_UNAVAILABLE_HINT = "Business Apps API is not available on this DSS instance. Use classic app commands or check DSS version/feature availability.";
48
66
  const MAX_ERROR_SUMMARY_LENGTH = 200;
@@ -141,6 +159,18 @@ export function classifyDataikuError(status, body) {
141
159
  retryHint: "Network/transport failure. Retry with backoff and verify DSS URL reachability.",
142
160
  };
143
161
  }
162
+ // A 2xx response carrying a non-JSON body is a response-contract violation,
163
+ // not a transport fault: HTTP succeeded, but an intermediary (proxy, SSO or
164
+ // login page, HTML gateway) answered in place of the DSS API. Only the client's
165
+ // own parse-failure marker produces this prefix.
166
+ if (status >= 200 && status < 300
167
+ && lowerBody.startsWith(NON_JSON_RESPONSE_MARKER.toLowerCase())) {
168
+ return {
169
+ category: "unexpected_response",
170
+ retryable: false,
171
+ retryHint: "DSS returned a non-JSON response to a JSON API request (typically a proxy, gateway, or login page). Verify the DSS URL and that no intermediary serves HTML; do not retry unchanged.",
172
+ };
173
+ }
144
174
  const isSqlInputConnectionMismatch = (status === 400 || status >= 500)
145
175
  && lowerBody.includes("s3 dataset")
146
176
  && lowerBody.includes("athena connection");
@@ -210,6 +240,8 @@ export function classifyDataikuError(status, body) {
210
240
  && (lowerBody.includes("column_not_found")
211
241
  || lowerBody.includes("table_not_found")
212
242
  || lowerBody.includes("no_such_table")
243
+ || lowerBody.includes("no such column")
244
+ || lowerBody.includes("no such table")
213
245
  || lowerBody.includes("column does not exist"));
214
246
  if (isSqlEngineValidation) {
215
247
  return {
@@ -280,6 +312,16 @@ export function classifyDataikuError(status, body) {
280
312
  retryHint: "Retry with exponential backoff. If it persists, check DSS availability and upstream proxies.",
281
313
  };
282
314
  }
315
+ // Any remaining HTTP error status is an API-contract mismatch: the endpoint,
316
+ // resource, or DSS feature/version does not support this request. It is
317
+ // non-retryable — retrying unchanged cannot succeed.
318
+ if (status >= 400) {
319
+ return {
320
+ category: "unexpected_response",
321
+ retryable: false,
322
+ retryHint: "The DSS API rejected the request with an unrecognized HTTP status. Verify the endpoint, resource, and DSS feature/version availability; do not retry unchanged.",
323
+ };
324
+ }
283
325
  return {
284
326
  category: "unknown",
285
327
  retryable: false,
@@ -18,7 +18,7 @@ export { type FlowZoneItemInput, FlowZonesResource, } from "./resources/flow-zon
18
18
  export { FoldersResource, } from "./resources/folders.js";
19
19
  export { FuturesResource, } from "./resources/futures.js";
20
20
  export { InsightsResource, } from "./resources/insights.js";
21
- export { computeNextPollDelayMs, type JobBuildAndWaitOptions, type JobBuildOptions, type JobBuildTarget, type JobBuildTargetType, type JobLogFilter, type JobLogProgress, type JobLogSummary, JobsResource, parseJobLogProgress, } from "./resources/jobs.js";
21
+ export { computeNextPollDelayMs, type JobBuildAndWaitOptions, type JobBuildOptions, type JobBuildTarget, type JobBuildTargetType, type JobLogFilter, type JobLogProgress, type JobLogSummary, type JobLogUnavailableReason, JobsResource, type JobWaitOutcome, parseJobLogProgress, } from "./resources/jobs.js";
22
22
  export { MeaningsResource, } from "./resources/meanings.js";
23
23
  export { MetricsResource, } from "./resources/metrics.js";
24
24
  export * from "./resources/ml-tasks.js";
@@ -37,10 +37,11 @@ export { VariablesResource, } from "./resources/variables.js";
37
37
  export { WebappsResource, } from "./resources/webapps.js";
38
38
  export { WikiResource, } from "./resources/wiki.js";
39
39
  export { WorkspacesResource, } from "./resources/workspaces.js";
40
- 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, 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, SqlNotebookSummaryArraySchema, SqlNotebookSummarySchema, SqlQueryResponseSchema, SqlQueryResultSchema, SqlQuerySchemaSchema, WikiArticleDataArraySchema, WikiArticleDataSchema, WikiArticleMetadataSchema, WikiSettingsSchema, WikiTaxonomyNodeSchema, } from "./schemas.js";
40
+ 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 "./schemas.js";
41
41
  export type { SafeParseResult, } from "./schemas.js";
42
- 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, 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, ScenarioDetails, ScenarioStatus, ScenarioStepRun, ScenarioSummary, ScenarioWaitResult, SqlNotebookCell, SqlNotebookContent, SqlNotebookSummary, SqlQueryResponse, SqlQueryResult, SqlQuerySchema, WikiArticleData, WikiArticleMetadata, WikiSettings, WikiTaxonomyNode, } from "./schemas.js";
42
+ 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, ScenarioDetails, ScenarioStatus, ScenarioStepRun, ScenarioSummary, ScenarioWaitResult, SqlNotebookCell, SqlNotebookContent, SqlNotebookSummary, SqlQueryResponse, SqlQueryResult, SqlQuerySchema, WikiArticleData, WikiArticleMetadata, WikiSettings, WikiTaxonomyNode, } from "./schemas.js";
43
43
  export { deepMerge, } from "./utils/deep-merge.js";
44
+ export { type AnalyzedFlowMap, type AnalyzedFlowNode, analyzeFlowMap, type FlowMapComponent, type FlowMapDiagnostic, type FlowMapRendering, type FlowMapZone, type FlowRenderFormat, flowTopologyFingerprint, renderFlowMap, } from "./utils/flow-analysis.js";
44
45
  export { type NormalizedFlowEdge, type NormalizedFlowMap, type NormalizedFlowNode, normalizeFlowGraph, } from "./utils/flow-map.js";
45
46
  export * from "./utils/project-archive.js";
46
47
  export { sanitizeFileName, } from "./utils/sanitize.js";
package/dist/src/index.js CHANGED
@@ -42,9 +42,10 @@ export { WebappsResource, } from "./resources/webapps.js";
42
42
  export { WikiResource, } from "./resources/wiki.js";
43
43
  export { WorkspacesResource, } from "./resources/workspaces.js";
44
44
  // Schemas (TypeBox schema objects for runtime validation)
45
- 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, 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, SqlNotebookSummaryArraySchema, SqlNotebookSummarySchema, SqlQueryResponseSchema, SqlQueryResultSchema, SqlQuerySchemaSchema, WikiArticleDataArraySchema, WikiArticleDataSchema, WikiArticleMetadataSchema, WikiSettingsSchema, WikiTaxonomyNodeSchema, } from "./schemas.js";
45
+ 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 "./schemas.js";
46
46
  // Utilities
47
47
  export { deepMerge, } from "./utils/deep-merge.js";
48
+ export { analyzeFlowMap, flowTopologyFingerprint, renderFlowMap, } from "./utils/flow-analysis.js";
48
49
  export { normalizeFlowGraph, } from "./utils/flow-map.js";
49
50
  export * from "./utils/project-archive.js";
50
51
  export { sanitizeFileName, } from "./utils/sanitize.js";
@@ -9,6 +9,32 @@ export interface ApiServicePackageListItem extends Record<string, unknown> {
9
9
  packageId?: string;
10
10
  serviceId?: string;
11
11
  }
12
+ /**
13
+ * 64-hex SHA-256 hash of the service settings as last fetched, used as a
14
+ * non-atomic stale-read guard: the write is refused when the settings already
15
+ * differ at the verification read. DSS exposes no conditional write, so a
16
+ * writer committing between that read and the PUT is still not detected.
17
+ */
18
+ export interface ApiServiceSaveOptions {
19
+ expectHash?: string;
20
+ }
21
+ /** Optional, documented parameters of the package-generation endpoint. */
22
+ export interface ApiServiceCreatePackageOptions {
23
+ releaseNotes?: string;
24
+ }
25
+ /**
26
+ * Optional, documented parameter of the package-publish endpoint: the id of
27
+ * the published service on the API Deployer where the package is deployed
28
+ * (defaults to the service's own id server-side).
29
+ */
30
+ export interface ApiServicePublishOptions {
31
+ publishedServiceId?: string;
32
+ }
33
+ export interface ApiServicePackageListItem extends Record<string, unknown> {
34
+ id?: string;
35
+ packageId?: string;
36
+ serviceId?: string;
37
+ }
12
38
  export type ApiServiceActionResult = Record<string, unknown> | undefined;
13
39
  export declare class ApiServicesResource extends BaseResource {
14
40
  /** List API services in a project. */
@@ -17,24 +43,40 @@ export declare class ApiServicesResource extends BaseResource {
17
43
  create(serviceId: string, projectKey?: string): Promise<ApiServiceActionResult>;
18
44
  /** Get API service settings, including endpoint definitions. */
19
45
  getSettings(serviceId: string, projectKey?: string): Promise<Record<string, unknown>>;
20
- /** Save API service settings. */
21
- saveSettings(serviceId: string, body: Record<string, unknown>, projectKey?: string): Promise<ApiServiceActionResult>;
46
+ /**
47
+ * Save API service settings with explicit replacement semantics: the body
48
+ * is the complete settings object (fetched via get-settings) and is PUT
49
+ * as-is. With `expectHash` armed, the settings are read first and their
50
+ * stable hash must match, or the write is refused before any PUT.
51
+ */
52
+ saveSettings(serviceId: string, body: Record<string, unknown>, projectKey?: string, options?: ApiServiceSaveOptions): Promise<ApiServiceActionResult>;
22
53
  /** Add a standard prediction endpoint backed by a saved model. */
23
54
  addPredictionEndpoint(serviceId: string, endpointId: string, savedModelId: string, projectKey?: string): Promise<ApiServiceActionResult>;
24
55
  /** List deployable packages for an API service. */
25
56
  listPackages(serviceId: string, projectKey?: string): Promise<ApiServicePackageListItem[]>;
26
57
  /** Get an API service package summary. */
27
58
  getPackageSummary(serviceId: string, packageId: string, projectKey?: string): Promise<Record<string, unknown>>;
28
- /** Create a deployable package from the current service state. */
29
- createPackage(serviceId: string, packageId: string, projectKey?: string): Promise<{
59
+ /**
60
+ * Create a deployable package from the current service state. The
61
+ * documented optional `releaseNotes` parameter is forwarded as the
62
+ * `releaseNotes` query parameter when provided.
63
+ */
64
+ createPackage(serviceId: string, packageId: string, projectKey?: string, options?: ApiServiceCreatePackageOptions): Promise<{
30
65
  message: string;
31
66
  }>;
32
67
  /** Delete an API service package. */
33
68
  deletePackage(serviceId: string, packageId: string, projectKey?: string): Promise<void>;
34
69
  /** Download an API service package archive. */
35
70
  downloadPackageArchive(serviceId: string, packageId: string, projectKey?: string): Promise<Response>;
36
- /** Publish an API service package to the API Deployer. */
37
- publishPackage(serviceId: string, packageId: string, projectKey?: string): Promise<ApiServiceActionResult>;
71
+ /**
72
+ * Publish an API service package to the API Deployer. The documented
73
+ * optional `publishedServiceId` parameter selects the published service
74
+ * the package is deployed to (a new published service is created when no
75
+ * match exists; when omitted, the server falls back to the service's own
76
+ * id). It is forwarded as the `publishedServiceId` query parameter when
77
+ * provided.
78
+ */
79
+ publishPackage(serviceId: string, packageId: string, projectKey?: string, options?: ApiServicePublishOptions): Promise<ApiServiceActionResult>;
38
80
  private servicePath;
39
81
  private packagePath;
40
82
  }
@@ -1,4 +1,21 @@
1
+ import { ClientValidationError, } from "../errors.js";
2
+ import { stableHash, } from "../utils/stable-hash.js";
1
3
  import { BaseResource, } from "./base.js";
4
+ const EXPECT_HASH_PATTERN = /^[0-9a-fA-F]{64}$/;
5
+ function assertExpectedSettingsHash(serviceId, expectHash, current, projectKey) {
6
+ if (!EXPECT_HASH_PATTERN.test(expectHash)) {
7
+ throw new ClientValidationError("Expected API service settings hash must be a 64-character SHA-256 hex digest.", "validation_failed", "Use the hash value returned by a previous read.", { projectKey, serviceId, });
8
+ }
9
+ const actual = stableHash(current);
10
+ if (actual !== expectHash.toLowerCase()) {
11
+ throw new ClientValidationError(`The API service ${JSON.stringify(serviceId)} changed since it was read.`, "validation_failed", "Re-read the service settings and retry with the current hash value.", {
12
+ projectKey,
13
+ serviceId,
14
+ expectedHash: expectHash.toLowerCase(),
15
+ actualHash: actual,
16
+ });
17
+ }
18
+ }
2
19
  export class ApiServicesResource extends BaseResource {
3
20
  /** List API services in a project. */
4
21
  async list(projectKey) {
@@ -12,8 +29,17 @@ export class ApiServicesResource extends BaseResource {
12
29
  async getSettings(serviceId, projectKey) {
13
30
  return this.client.get(`${this.servicePath(serviceId, projectKey)}/settings`);
14
31
  }
15
- /** Save API service settings. */
16
- async saveSettings(serviceId, body, projectKey) {
32
+ /**
33
+ * Save API service settings with explicit replacement semantics: the body
34
+ * is the complete settings object (fetched via get-settings) and is PUT
35
+ * as-is. With `expectHash` armed, the settings are read first and their
36
+ * stable hash must match, or the write is refused before any PUT.
37
+ */
38
+ async saveSettings(serviceId, body, projectKey, options = {}) {
39
+ if (options.expectHash !== undefined) {
40
+ const current = await this.getSettings(serviceId, projectKey);
41
+ assertExpectedSettingsHash(serviceId, options.expectHash, current, projectKey);
42
+ }
17
43
  return this.client.put(`${this.servicePath(serviceId, projectKey)}/settings`, body);
18
44
  }
19
45
  /** Add a standard prediction endpoint backed by a saved model. */
@@ -35,9 +61,17 @@ export class ApiServicesResource extends BaseResource {
35
61
  async getPackageSummary(serviceId, packageId, projectKey) {
36
62
  return this.client.get(`${this.packagePath(serviceId, packageId, projectKey)}/summary`);
37
63
  }
38
- /** Create a deployable package from the current service state. */
39
- async createPackage(serviceId, packageId, projectKey) {
40
- const message = await this.client.postText(this.packagePath(serviceId, packageId, projectKey), {});
64
+ /**
65
+ * Create a deployable package from the current service state. The
66
+ * documented optional `releaseNotes` parameter is forwarded as the
67
+ * `releaseNotes` query parameter when provided.
68
+ */
69
+ async createPackage(serviceId, packageId, projectKey, options = {}) {
70
+ const params = new URLSearchParams();
71
+ if (options.releaseNotes !== undefined)
72
+ params.set("releaseNotes", options.releaseNotes);
73
+ const query = params.size > 0 ? `?${params.toString()}` : "";
74
+ const message = await this.client.postText(`${this.packagePath(serviceId, packageId, projectKey)}${query}`, {});
41
75
  return { message, };
42
76
  }
43
77
  /** Delete an API service package. */
@@ -48,9 +82,21 @@ export class ApiServicesResource extends BaseResource {
48
82
  async downloadPackageArchive(serviceId, packageId, projectKey) {
49
83
  return this.client.stream(`${this.packagePath(serviceId, packageId, projectKey)}/archive`);
50
84
  }
51
- /** Publish an API service package to the API Deployer. */
52
- async publishPackage(serviceId, packageId, projectKey) {
53
- return this.client.post(`${this.packagePath(serviceId, packageId, projectKey)}/publish`, {});
85
+ /**
86
+ * Publish an API service package to the API Deployer. The documented
87
+ * optional `publishedServiceId` parameter selects the published service
88
+ * the package is deployed to (a new published service is created when no
89
+ * match exists; when omitted, the server falls back to the service's own
90
+ * id). It is forwarded as the `publishedServiceId` query parameter when
91
+ * provided.
92
+ */
93
+ async publishPackage(serviceId, packageId, projectKey, options = {}) {
94
+ const params = new URLSearchParams();
95
+ if (options.publishedServiceId !== undefined) {
96
+ params.set("publishedServiceId", options.publishedServiceId);
97
+ }
98
+ const query = params.size > 0 ? `?${params.toString()}` : "";
99
+ return this.client.post(`${this.packagePath(serviceId, packageId, projectKey)}/publish${query}`, {});
54
100
  }
55
101
  servicePath(serviceId, projectKey) {
56
102
  return `/public/api/projects/${this.enc(projectKey)}/apiservices/${encodeURIComponent(serviceId)}`;
@@ -1,23 +1,68 @@
1
1
  import { BaseResource } from "./base.js";
2
+ /**
3
+ * Optional, documented parameters of the bundle-export endpoint:
4
+ * - `releaseNotes`: important changes introduced in the bundle;
5
+ * - `evaluateProjectStandardsChecks`: whether the Project Standards Checks
6
+ * applying to the project should run (defaults to true server-side, and the
7
+ * official client always sends it).
8
+ */
9
+ export interface BundleExportOptions {
10
+ releaseNotes?: string;
11
+ evaluateProjectStandardsChecks?: boolean;
12
+ }
13
+ /**
14
+ * Optional, documented parameter of the bundle-publish endpoint: the key of
15
+ * the published project on the Project Deployer where the bundle is deployed
16
+ * (a new published project is created when no match exists; when omitted, the
17
+ * server falls back to the source project's key).
18
+ */
19
+ export interface BundlePublishOptions {
20
+ publishedProjectKey?: string;
21
+ }
22
+ /**
23
+ * Optional, documented parameter of the bundle-activation endpoint: scenario
24
+ * IDs mapped to whether each scenario should be enabled or disabled upon
25
+ * activation.
26
+ */
27
+ export interface BundleActivateOptions {
28
+ scenariosToEnable?: Record<string, boolean>;
29
+ }
2
30
  export declare class BundlesResource extends BaseResource {
3
31
  /** List bundles exported from a project on the Design node. */
4
32
  listExported(projectKey?: string): Promise<Record<string, unknown>[]>;
5
- /** Create or overwrite an exported Design-node bundle. */
6
- exportBundle(bundleId: string, projectKey?: string): Promise<void>;
33
+ /**
34
+ * Create or overwrite an exported Design-node bundle. The documented
35
+ * optional parameters are forwarded as query parameters:
36
+ * `releaseNotes` when provided, and `evaluateProjectStandardsChecks`
37
+ * (defaults to true, matching the official client which always sends it).
38
+ */
39
+ exportBundle(bundleId: string, projectKey?: string, options?: BundleExportOptions): Promise<void>;
7
40
  /** Delete an exported Design-node bundle. */
8
41
  deleteExported(bundleId: string, projectKey?: string): Promise<void>;
9
42
  /** Download an exported Design-node bundle archive. */
10
43
  downloadExportedArchive(bundleId: string, projectKey?: string): Promise<Response>;
11
- /** Publish a Design-node bundle to the Project Deployer. */
12
- publish(bundleId: string, projectKey?: string): Promise<Record<string, unknown>>;
44
+ /**
45
+ * Publish a Design-node bundle to the Project Deployer. The documented
46
+ * optional `publishedProjectKey` parameter selects the published project
47
+ * the bundle is deployed to (a new published project is created when no
48
+ * match exists; when omitted, the server falls back to the source
49
+ * project's key). It is forwarded as the `publishedProjectKey` query
50
+ * parameter when provided.
51
+ */
52
+ publish(bundleId: string, projectKey?: string, options?: BundlePublishOptions): Promise<Record<string, unknown>>;
13
53
  /** List bundles imported into a project on the Automation node. */
14
54
  listImported(projectKey?: string): Promise<Record<string, unknown>[]>;
15
55
  /** Import a server-side bundle archive into an Automation-node project. */
16
56
  importFromArchive(archivePath: string, projectKey?: string): Promise<Record<string, unknown>>;
17
57
  /** Import a local bundle archive stream into an Automation-node project. */
18
58
  importFromStream(filePath: string, projectKey?: string): Promise<void>;
19
- /** Activate an imported Automation-node bundle. */
20
- activate(bundleId: string, projectKey?: string): Promise<Record<string, unknown>>;
59
+ /**
60
+ * Activate an imported Automation-node bundle. The documented optional
61
+ * `scenariosToEnable` dict (scenario ID → enabled/disabled upon
62
+ * activation) is forwarded as the `scenariosActiveOnActivation` request
63
+ * body when provided.
64
+ */
65
+ activate(bundleId: string, projectKey?: string, options?: BundleActivateOptions): Promise<Record<string, unknown>>;
21
66
  /** Preload an imported Automation-node bundle. */
22
67
  preload(bundleId: string, projectKey?: string): Promise<Record<string, unknown>>;
23
68
  /** Delete an imported Automation-node bundle. */
@@ -5,9 +5,18 @@ export class BundlesResource extends BaseResource {
5
5
  const res = await this.client.get(`/public/api/projects/${this.enc(projectKey)}/bundles/exported`);
6
6
  return res.bundles ?? [];
7
7
  }
8
- /** Create or overwrite an exported Design-node bundle. */
9
- async exportBundle(bundleId, projectKey) {
10
- await this.client.putVoid(`/public/api/projects/${this.enc(projectKey)}/bundles/exported/${encodeURIComponent(bundleId)}`, {});
8
+ /**
9
+ * Create or overwrite an exported Design-node bundle. The documented
10
+ * optional parameters are forwarded as query parameters:
11
+ * `releaseNotes` when provided, and `evaluateProjectStandardsChecks`
12
+ * (defaults to true, matching the official client which always sends it).
13
+ */
14
+ async exportBundle(bundleId, projectKey, options = {}) {
15
+ const params = new URLSearchParams();
16
+ if (options.releaseNotes !== undefined)
17
+ params.set("releaseNotes", options.releaseNotes);
18
+ params.set("evaluateProjectStandardsChecks", String(options.evaluateProjectStandardsChecks ?? true));
19
+ await this.client.putVoid(`/public/api/projects/${this.enc(projectKey)}/bundles/exported/${encodeURIComponent(bundleId)}?${params.toString()}`, {});
11
20
  }
12
21
  /** Delete an exported Design-node bundle. */
13
22
  async deleteExported(bundleId, projectKey) {
@@ -17,9 +26,21 @@ export class BundlesResource extends BaseResource {
17
26
  async downloadExportedArchive(bundleId, projectKey) {
18
27
  return this.client.stream(`/public/api/projects/${this.enc(projectKey)}/bundles/exported/${encodeURIComponent(bundleId)}/archive`);
19
28
  }
20
- /** Publish a Design-node bundle to the Project Deployer. */
21
- async publish(bundleId, projectKey) {
22
- return this.client.post(`/public/api/projects/${this.enc(projectKey)}/bundles/${encodeURIComponent(bundleId)}/publish`, {});
29
+ /**
30
+ * Publish a Design-node bundle to the Project Deployer. The documented
31
+ * optional `publishedProjectKey` parameter selects the published project
32
+ * the bundle is deployed to (a new published project is created when no
33
+ * match exists; when omitted, the server falls back to the source
34
+ * project's key). It is forwarded as the `publishedProjectKey` query
35
+ * parameter when provided.
36
+ */
37
+ async publish(bundleId, projectKey, options = {}) {
38
+ const params = new URLSearchParams();
39
+ if (options.publishedProjectKey !== undefined) {
40
+ params.set("publishedProjectKey", options.publishedProjectKey);
41
+ }
42
+ const query = params.size > 0 ? `?${params.toString()}` : "";
43
+ return this.client.post(`/public/api/projects/${this.enc(projectKey)}/bundles/${encodeURIComponent(bundleId)}/publish${query}`, {});
23
44
  }
24
45
  /** List bundles imported into a project on the Automation node. */
25
46
  async listImported(projectKey) {
@@ -34,9 +55,18 @@ export class BundlesResource extends BaseResource {
34
55
  async importFromStream(filePath, projectKey) {
35
56
  await this.client.upload(`/public/api/projects/${this.enc(projectKey)}/bundles/imported/actions/importFromStream`, filePath);
36
57
  }
37
- /** Activate an imported Automation-node bundle. */
38
- async activate(bundleId, projectKey) {
39
- return this.client.post(`/public/api/projects/${this.enc(projectKey)}/bundles/imported/${encodeURIComponent(bundleId)}/actions/activate`, {});
58
+ /**
59
+ * Activate an imported Automation-node bundle. The documented optional
60
+ * `scenariosToEnable` dict (scenario ID → enabled/disabled upon
61
+ * activation) is forwarded as the `scenariosActiveOnActivation` request
62
+ * body when provided.
63
+ */
64
+ async activate(bundleId, projectKey, options = {}) {
65
+ const body = options.scenariosToEnable !== undefined
66
+ && Object.keys(options.scenariosToEnable).length > 0
67
+ ? { scenariosActiveOnActivation: options.scenariosToEnable, }
68
+ : {};
69
+ return this.client.post(`/public/api/projects/${this.enc(projectKey)}/bundles/imported/${encodeURIComponent(bundleId)}/actions/activate`, body);
40
70
  }
41
71
  /** Preload an imported Automation-node bundle. */
42
72
  async preload(bundleId, projectKey) {
@@ -1,4 +1,4 @@
1
- import type { CodeEnvActionResult, CodeEnvCreateOptions, CodeEnvDetails, CodeEnvPackageList, CodeEnvSetPackagesOptions, CodeEnvSummary, CodeEnvUpdatePackagesOptions, CodeEnvWaitOptions } from "../schemas.js";
1
+ import type { CodeEnvActionResult, CodeEnvCreateOptions, CodeEnvDetails, CodeEnvGetLogOptions, CodeEnvLogResult, CodeEnvLogSummary, CodeEnvPackageList, CodeEnvSetPackagesOptions, CodeEnvSummary, CodeEnvUpdateImagesOptions, CodeEnvUpdatePackagesOptions, CodeEnvVersionForProject, CodeEnvWaitOptions } from "../schemas.js";
2
2
  import { BaseResource } from "./base.js";
3
3
  export declare class CodeEnvsResource extends BaseResource {
4
4
  list(opts?: {
@@ -6,9 +6,31 @@ export declare class CodeEnvsResource extends BaseResource {
6
6
  }): Promise<CodeEnvSummary[]>;
7
7
  get(envLang: string, envName: string): Promise<CodeEnvDetails>;
8
8
  getDefinition(envLang: string, envName: string): Promise<Record<string, unknown>>;
9
+ /** List the build log files DSS keeps for this code environment. */
10
+ listLogs(envLang: string, envName: string): Promise<CodeEnvLogSummary[]>;
11
+ /**
12
+ * Fetch one code-env build log, bounded by default: at most
13
+ * `maxBytes` bytes (default 10 MiB, 0 disables the cap) and the last
14
+ * `maxLines` lines (default 500, 0 disables the tail). Returns what was
15
+ * kept plus the truncation flags so callers can warn instead of
16
+ * silently losing output.
17
+ */
18
+ getLog(envLang: string, envName: string, logName: string, opts?: CodeEnvGetLogOptions): Promise<CodeEnvLogResult>;
19
+ /**
20
+ * Rebuild the Docker image(s) of the code environment to match its
21
+ * settings. `wait: false` returns the raw DSS future payload.
22
+ */
23
+ updateImages(envLang: string, envName: string, opts?: CodeEnvUpdateImagesOptions): Promise<CodeEnvActionResult>;
24
+ /**
25
+ * Resolve the code-env version a project uses (versioned environments on
26
+ * automation nodes); empty `version` for unversioned environments.
27
+ */
28
+ getVersionForProject(envLang: string, envName: string, projectKey: string): Promise<CodeEnvVersionForProject>;
9
29
  create(opts: CodeEnvCreateOptions): Promise<CodeEnvActionResult>;
10
- setDefinition(envLang: string, envName: string, definition: Record<string, unknown>): Promise<CodeEnvActionResult>;
11
- setPackages(envLang: string, envName: string, packages: CodeEnvPackageList, opts?: Pick<CodeEnvSetPackagesOptions, "installCorePackages">): Promise<CodeEnvActionResult>;
30
+ setDefinition(envLang: string, envName: string, definition: Record<string, unknown>, opts?: {
31
+ expectHash?: string;
32
+ }): Promise<CodeEnvActionResult>;
33
+ setPackages(envLang: string, envName: string, packages: CodeEnvPackageList, opts?: Pick<CodeEnvSetPackagesOptions, "installCorePackages" | "expectHash">): Promise<CodeEnvActionResult>;
12
34
  updatePackages(envLang: string, envName: string, opts?: CodeEnvUpdatePackagesOptions): Promise<CodeEnvActionResult>;
13
35
  setJupyterSupport(envLang: string, envName: string, active: boolean, opts?: CodeEnvWaitOptions): Promise<CodeEnvActionResult>;
14
36
  delete(envLang: string, envName: string, opts?: CodeEnvWaitOptions): Promise<CodeEnvActionResult>;