dataiku-sdk 3.1.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.
- package/README.md +253 -38
- package/dist/build-metadata.json +1 -1
- package/dist/packages/types/src/index.d.ts +102 -0
- package/dist/packages/types/src/index.js +76 -0
- package/dist/src/auth.js +1 -1
- package/dist/src/cli/coerce.js +11 -2
- package/dist/src/cli/commands/analysis.js +4 -3
- package/dist/src/cli/commands/api-service.js +5 -3
- package/dist/src/cli/commands/app.js +61 -18
- package/dist/src/cli/commands/bundle.js +3 -2
- package/dist/src/cli/commands/code-env.js +23 -16
- package/dist/src/cli/commands/connection.d.ts +9 -0
- package/dist/src/cli/commands/connection.js +267 -1
- package/dist/src/cli/commands/dashboard.js +7 -6
- package/dist/src/cli/commands/data-collection.d.ts +2 -0
- package/dist/src/cli/commands/data-collection.js +164 -0
- package/dist/src/cli/commands/data-quality.js +9 -8
- package/dist/src/cli/commands/dataset.js +170 -40
- package/dist/src/cli/commands/doctor.js +4 -2
- package/dist/src/cli/commands/flow-zone.js +9 -8
- package/dist/src/cli/commands/folder.js +9 -8
- package/dist/src/cli/commands/future.js +4 -3
- package/dist/src/cli/commands/group.d.ts +2 -0
- package/dist/src/cli/commands/group.js +109 -0
- package/dist/src/cli/commands/index.js +151 -78
- package/dist/src/cli/commands/insight.js +8 -7
- package/dist/src/cli/commands/job.js +4 -3
- package/dist/src/cli/commands/knowledge-bank.d.ts +2 -0
- package/dist/src/cli/commands/knowledge-bank.js +80 -0
- package/dist/src/cli/commands/llm.d.ts +2 -0
- package/dist/src/cli/commands/llm.js +93 -0
- package/dist/src/cli/commands/macro.d.ts +2 -0
- package/dist/src/cli/commands/macro.js +221 -0
- package/dist/src/cli/commands/meaning.js +5 -4
- package/dist/src/cli/commands/ml-task.js +21 -8
- package/dist/src/cli/commands/model-evaluation-store.js +4 -3
- package/dist/src/cli/commands/notebook.js +17 -12
- package/dist/src/cli/commands/plugin.d.ts +2 -0
- package/dist/src/cli/commands/plugin.js +799 -0
- package/dist/src/cli/commands/project-folder.d.ts +2 -0
- package/dist/src/cli/commands/project-folder.js +197 -0
- package/dist/src/cli/commands/project-git.js +14 -54
- package/dist/src/cli/commands/project-library.js +7 -6
- package/dist/src/cli/commands/project.js +55 -8
- package/dist/src/cli/commands/recipe.js +50 -14
- package/dist/src/cli/commands/saved-model.d.ts +5 -0
- package/dist/src/cli/commands/saved-model.js +392 -4
- package/dist/src/cli/commands/scenario.js +147 -9
- package/dist/src/cli/commands/sql.js +3 -2
- package/dist/src/cli/commands/statistics.js +7 -6
- package/dist/src/cli/commands/user.d.ts +8 -0
- package/dist/src/cli/commands/user.js +296 -0
- package/dist/src/cli/commands/variable.js +2 -1
- package/dist/src/cli/commands/webapp.js +2 -1
- package/dist/src/cli/commands/wiki.js +7 -6
- package/dist/src/cli/contract.d.ts +2 -3
- package/dist/src/cli/contract.js +1167 -163
- package/dist/src/cli/flags.d.ts +4 -0
- package/dist/src/cli/flags.js +50 -2
- package/dist/src/cli/helpers/app-successor.d.ts +19 -4
- package/dist/src/cli/helpers/app-successor.js +90 -30
- package/dist/src/cli/helpers/cleanup.js +3 -1
- package/dist/src/cli/helpers/flow-zone.js +1 -2
- package/dist/src/cli/output.d.ts +1 -1
- package/dist/src/cli/output.js +23 -10
- package/dist/src/cli/usage.d.ts +1 -0
- package/dist/src/cli/usage.js +47 -1
- package/dist/src/cli.js +225 -95
- package/dist/src/client.d.ts +86 -6
- package/dist/src/client.js +263 -50
- package/dist/src/errors.d.ts +3 -0
- package/dist/src/errors.js +4 -0
- package/dist/src/index.d.ts +16 -7
- package/dist/src/index.js +11 -2
- package/dist/src/resources/analyses.js +1 -8
- package/dist/src/resources/applications.d.ts +8 -6
- package/dist/src/resources/applications.js +21 -21
- package/dist/src/resources/base.d.ts +4 -0
- package/dist/src/resources/base.js +15 -0
- package/dist/src/resources/bundles.d.ts +9 -4
- package/dist/src/resources/bundles.js +10 -5
- package/dist/src/resources/connections.d.ts +78 -1
- package/dist/src/resources/connections.js +132 -1
- package/dist/src/resources/data-collections.d.ts +118 -0
- package/dist/src/resources/data-collections.js +49 -0
- package/dist/src/resources/datasets.d.ts +69 -0
- package/dist/src/resources/datasets.js +99 -1
- package/dist/src/resources/folders.js +2 -1
- package/dist/src/resources/futures.d.ts +4 -1
- package/dist/src/resources/futures.js +38 -6
- package/dist/src/resources/groups.d.ts +47 -0
- package/dist/src/resources/groups.js +56 -0
- package/dist/src/resources/jobs.d.ts +8 -13
- package/dist/src/resources/jobs.js +41 -16
- package/dist/src/resources/knowledge-banks.d.ts +58 -0
- package/dist/src/resources/knowledge-banks.js +61 -0
- package/dist/src/resources/llms.d.ts +92 -0
- package/dist/src/resources/llms.js +62 -0
- package/dist/src/resources/macros.d.ts +121 -0
- package/dist/src/resources/macros.js +231 -0
- package/dist/src/resources/ml-tasks.d.ts +37 -2
- package/dist/src/resources/ml-tasks.js +100 -20
- package/dist/src/resources/model-evaluation-stores.js +1 -8
- package/dist/src/resources/notebooks.d.ts +43 -7
- package/dist/src/resources/notebooks.js +53 -13
- package/dist/src/resources/plugins.d.ts +265 -0
- package/dist/src/resources/plugins.js +458 -0
- package/dist/src/resources/project-folders.d.ts +71 -0
- package/dist/src/resources/project-folders.js +57 -0
- package/dist/src/resources/project-git.d.ts +6 -0
- package/dist/src/resources/project-git.js +69 -42
- package/dist/src/resources/project-library.d.ts +0 -1
- package/dist/src/resources/project-library.js +1 -17
- package/dist/src/resources/projects.d.ts +19 -3
- package/dist/src/resources/projects.js +30 -18
- package/dist/src/resources/recipes.d.ts +15 -1
- package/dist/src/resources/recipes.js +73 -6
- package/dist/src/resources/saved-models.d.ts +134 -1
- package/dist/src/resources/saved-models.js +214 -6
- package/dist/src/resources/scenarios.d.ts +105 -0
- package/dist/src/resources/scenarios.js +232 -106
- package/dist/src/resources/sql.js +5 -1
- package/dist/src/resources/users.d.ts +129 -0
- package/dist/src/resources/users.js +128 -0
- package/dist/src/resources/webapps.d.ts +15 -2
- package/dist/src/resources/webapps.js +18 -4
- package/dist/src/schemas.d.ts +2 -2
- package/dist/src/schemas.js +1 -1
- package/dist/src/skill.d.ts +13 -4
- package/dist/src/skill.js +75 -24
- package/dist/src/utils/deep-merge.d.ts +1 -1
- package/dist/src/utils/polling.d.ts +20 -0
- package/dist/src/utils/polling.js +27 -0
- package/dist/src/utils/response-file.d.ts +2 -0
- package/dist/src/utils/response-file.js +34 -0
- package/dist/src/utils/secret-sanitize.d.ts +54 -0
- package/dist/src/utils/secret-sanitize.js +101 -0
- package/package.json +8 -5
- package/packages/types/dist/index.d.ts +102 -0
- package/packages/types/dist/index.js +76 -0
- package/plugin.json +1 -1
- package/skills/dataiku-dss/SKILL.md +47 -225
- package/skills/dataiku-dss/references/app-releases.md +28 -0
- package/skills/dataiku-dss/references/authentication.md +39 -0
- package/skills/dataiku-dss/references/coding.md +8 -0
- package/skills/dataiku-dss/references/discovery.md +30 -0
- package/skills/dataiku-dss/references/flow-maps.md +12 -0
- package/skills/dataiku-dss/references/mutations.md +33 -0
- package/skills/dataiku-dss/references/troubleshooting.md +29 -0
package/dist/src/errors.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export interface DataikuRetryMetadata {
|
|
|
18
18
|
export interface DataikuErrorTrustedMetadata {
|
|
19
19
|
target?: string;
|
|
20
20
|
elapsedMs?: number;
|
|
21
|
+
/** Set by the transport when the retained response body is only a bounded prefix. */
|
|
22
|
+
bodyTruncated?: boolean;
|
|
21
23
|
}
|
|
22
24
|
export declare function canonicalStatusText(status: number): string;
|
|
23
25
|
export declare class ClientValidationError extends Error {
|
|
@@ -44,6 +46,7 @@ export declare class DataikuError extends Error {
|
|
|
44
46
|
requestId?: string;
|
|
45
47
|
readonly trustedTarget?: string;
|
|
46
48
|
readonly trustedElapsedMs?: number;
|
|
49
|
+
readonly bodyTruncated?: boolean;
|
|
47
50
|
constructor(status: number, statusText: string, body: string, retry?: DataikuRetryMetadata, requestId?: string, trustedMetadata?: DataikuErrorTrustedMetadata);
|
|
48
51
|
get safeMessage(): string;
|
|
49
52
|
private static extractSummary;
|
package/dist/src/errors.js
CHANGED
|
@@ -240,6 +240,8 @@ export function classifyDataikuError(status, body) {
|
|
|
240
240
|
&& (lowerBody.includes("column_not_found")
|
|
241
241
|
|| lowerBody.includes("table_not_found")
|
|
242
242
|
|| lowerBody.includes("no_such_table")
|
|
243
|
+
|| lowerBody.includes("no such column")
|
|
244
|
+
|| lowerBody.includes("no such table")
|
|
243
245
|
|| lowerBody.includes("column does not exist"));
|
|
244
246
|
if (isSqlEngineValidation) {
|
|
245
247
|
return {
|
|
@@ -337,6 +339,7 @@ export class DataikuError extends Error {
|
|
|
337
339
|
requestId;
|
|
338
340
|
trustedTarget;
|
|
339
341
|
trustedElapsedMs;
|
|
342
|
+
bodyTruncated;
|
|
340
343
|
constructor(status, statusText, body, retry, requestId, trustedMetadata) {
|
|
341
344
|
const details = DataikuError.buildDetails(status, body, retry);
|
|
342
345
|
super(details.message);
|
|
@@ -351,6 +354,7 @@ export class DataikuError extends Error {
|
|
|
351
354
|
this.requestId = requestId;
|
|
352
355
|
this.trustedTarget = trustedMetadata?.target;
|
|
353
356
|
this.trustedElapsedMs = trustedMetadata?.elapsedMs;
|
|
357
|
+
this.bodyTruncated = trustedMetadata?.bodyTruncated === true ? true : undefined;
|
|
354
358
|
}
|
|
355
359
|
get safeMessage() {
|
|
356
360
|
const retrySummary = DataikuError.formatRetryMetadata(this.retry);
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DataikuClient, type DataikuClientConfig, type DataikuClientTraceEvent, } from "./client.js";
|
|
1
|
+
export { DataikuClient, type DataikuClientConfig, type DataikuClientTraceEvent, type DataikuGetOptions, type UploadFormPart, } from "./client.js";
|
|
2
2
|
export { type CredentialValidationOptions, type CredentialValidationResult, validateCredentials, } from "./auth.js";
|
|
3
3
|
export { type DssCredentials, getConfigDir, getCredentialsPath, loadCredentials, saveCredentials, } from "./config.js";
|
|
4
4
|
export { ClientValidationError, DataikuError, type DataikuErrorCategory, type DataikuErrorTaxonomy, type DataikuRetryMetadata, } from "./errors.js";
|
|
@@ -8,38 +8,47 @@ export { ApiServicesResource, } from "./resources/api-services.js";
|
|
|
8
8
|
export { ApplicationsResource, } from "./resources/applications.js";
|
|
9
9
|
export { BundlesResource, ProjectDeployerResource, } from "./resources/bundles.js";
|
|
10
10
|
export { CodeEnvsResource, } from "./resources/code-envs.js";
|
|
11
|
-
export { type ConnectionSchemaListOptions, ConnectionsResource, type ConnectionTableListOptions, } from "./resources/connections.js";
|
|
11
|
+
export { type ConnectionAdminInput, type ConnectionSchemaListOptions, ConnectionsResource, type ConnectionTableListOptions, } from "./resources/connections.js";
|
|
12
12
|
export { ContinuousActivitiesResource, } from "./resources/continuous-activities.js";
|
|
13
13
|
export { DashboardsResource, } from "./resources/dashboards.js";
|
|
14
|
+
export { type DataCollectionCreateRequest, type DataCollectionObject, type DataCollectionObjectReferenceType, type DataCollectionPermission, type DataCollectionSettings, DataCollectionsResource, type DataCollectionSummary, } from "./resources/data-collections.js";
|
|
14
15
|
export { DataQualityResource, } from "./resources/data-quality.js";
|
|
15
|
-
export { type DatasetBuildValidationResult, type DatasetCloneOptions, type DatasetCloneResult, type DatasetSchemaColumnInput, DatasetsResource, type UploadDatasetFileOptions, type UploadDatasetFileResult, type UploadedFileMetadata, } from "./resources/datasets.js";
|
|
16
|
+
export { type DatasetBuildValidationResult, type DatasetCloneOptions, type DatasetCloneResult, type DatasetManagedCreateOptions, type DatasetManagedCreateResult, type DatasetSchemaColumnInput, DatasetsResource, type UploadDatasetFileOptions, type UploadDatasetFileResult, type UploadedFileMetadata, } from "./resources/datasets.js";
|
|
16
17
|
export { DiscussionsResource, } from "./resources/discussions.js";
|
|
17
18
|
export { type FlowZoneItemInput, FlowZonesResource, } from "./resources/flow-zones.js";
|
|
18
19
|
export { FoldersResource, } from "./resources/folders.js";
|
|
19
20
|
export { FuturesResource, } from "./resources/futures.js";
|
|
21
|
+
export { type DssGroup, type GroupCreateRequest, GroupsResource, } from "./resources/groups.js";
|
|
20
22
|
export { InsightsResource, } from "./resources/insights.js";
|
|
21
|
-
export {
|
|
23
|
+
export { type JobBuildAndWaitOptions, type JobBuildOptions, type JobBuildTarget, type JobBuildTargetType, type JobLogFilter, type JobLogProgress, type JobLogSummary, type JobLogUnavailableReason, JobsResource, type JobWaitOutcome, parseJobLogProgress, } from "./resources/jobs.js";
|
|
24
|
+
export * from "./resources/knowledge-banks.js";
|
|
25
|
+
export * from "./resources/llms.js";
|
|
26
|
+
export { type MacroResultOptions, type MacroRunFailure, type MacroRunHandle, type MacroRunOptions, type MacroRunWaitedResult, MacrosResource, type MacroWaitOptions, } from "./resources/macros.js";
|
|
22
27
|
export { MeaningsResource, } from "./resources/meanings.js";
|
|
23
28
|
export { MetricsResource, } from "./resources/metrics.js";
|
|
24
29
|
export * from "./resources/ml-tasks.js";
|
|
25
30
|
export * from "./resources/model-evaluation-stores.js";
|
|
26
31
|
export { NotebooksResource, } from "./resources/notebooks.js";
|
|
32
|
+
export { type PluginCodeEnvCreateOptions, type PluginContentItem, type PluginCreateDevOptions, type PluginFileDetails, type PluginGitInstallOptions, type PluginGitRemote, type PluginMissingType, type PluginProjectScopeOptions, type PluginSettings, PluginsResource, type PluginSummary, type PluginUsage, type PluginUsageReport, } from "./resources/plugins.js";
|
|
33
|
+
export { type ProjectFolder, type ProjectFolderPermission, type ProjectFolderSettings, ProjectFoldersResource, } from "./resources/project-folders.js";
|
|
27
34
|
export * from "./resources/project-git.js";
|
|
28
35
|
export { ProjectLibraryResource, } from "./resources/project-library.js";
|
|
29
36
|
export { type FlowMapResult, type ProjectImportProcessResult, type ProjectImportResult, type ProjectImportSettings, type ProjectImportUploadResult, ProjectsResource, } from "./resources/projects.js";
|
|
30
37
|
export { type RecipeCloneOptions, type RecipeCloneResult, type RecipeGraphReference, type RecipeGraphValidationResult, type RecipeRunOptions, type RecipeRunOutput, type RecipeRunResult, RecipesResource, } from "./resources/recipes.js";
|
|
31
38
|
export * from "./resources/saved-models.js";
|
|
32
|
-
export { normalizeScenarioUpdateData, SCENARIO_CANONICAL_EDITABLE_FIELDS, type ScenarioFieldChange, type ScenarioFieldMismatch, type ScenarioScriptRunResult, ScenariosResource, type ScenarioUpdateNormalization, type ScenarioUpdatePreview, scenarioUpdatePreview, type ScenarioUpdateResult, } from "./resources/scenarios.js";
|
|
39
|
+
export { normalizeScenarioUpdateData, SCENARIO_CANONICAL_EDITABLE_FIELDS, type ScenarioActiveUpdateResult, type ScenarioFieldChange, type ScenarioFieldMismatch, type ScenarioLightStatus, type ScenarioRunDetails, type ScenarioRunLog, type ScenarioRunStepReport, type ScenarioRunSummary, type ScenarioScriptRunResult, ScenariosResource, type ScenarioUpdateNormalization, type ScenarioUpdatePreview, scenarioUpdatePreview, type ScenarioUpdateResult, } from "./resources/scenarios.js";
|
|
33
40
|
export { SqlResource, } from "./resources/sql.js";
|
|
34
41
|
export { StatisticsResource, } from "./resources/statistics.js";
|
|
35
42
|
export { StreamingEndpointsResource, } from "./resources/streaming-endpoints.js";
|
|
43
|
+
export { type DssUser, type ExternalUserEntry, type ProvisionRequest, type UserActivity, type UserCreateRequest, UsersResource, } from "./resources/users.js";
|
|
36
44
|
export { VariablesResource, } from "./resources/variables.js";
|
|
37
45
|
export { WebappsResource, } from "./resources/webapps.js";
|
|
38
46
|
export { WikiResource, } from "./resources/wiki.js";
|
|
39
47
|
export { WorkspacesResource, } from "./resources/workspaces.js";
|
|
40
|
-
export {
|
|
48
|
+
export { computeNextPollDelayMs, } from "./utils/polling.js";
|
|
49
|
+
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 "./schemas.js";
|
|
41
50
|
export type { SafeParseResult, } 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";
|
|
51
|
+
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, ScenarioDetails, ScenarioStatus, ScenarioStepRun, ScenarioSummary, ScenarioWaitResult, SqlNotebookCell, SqlNotebookContent, SqlNotebookSummary, SqlQueryResponse, SqlQueryResult, SqlQuerySchema, WikiArticleData, WikiArticleMetadata, WikiSettings, WikiTaxonomyNode, } from "./schemas.js";
|
|
43
52
|
export { deepMerge, } from "./utils/deep-merge.js";
|
|
44
53
|
export { type AnalyzedFlowMap, type AnalyzedFlowNode, analyzeFlowMap, type FlowMapComponent, type FlowMapDiagnostic, type FlowMapRendering, type FlowMapZone, type FlowRenderFormat, flowTopologyFingerprint, renderFlowMap, } from "./utils/flow-analysis.js";
|
|
45
54
|
export { type NormalizedFlowEdge, type NormalizedFlowMap, type NormalizedFlowNode, normalizeFlowGraph, } from "./utils/flow-map.js";
|
package/dist/src/index.js
CHANGED
|
@@ -15,19 +15,26 @@ export { CodeEnvsResource, } from "./resources/code-envs.js";
|
|
|
15
15
|
export { ConnectionsResource, } from "./resources/connections.js";
|
|
16
16
|
export { ContinuousActivitiesResource, } from "./resources/continuous-activities.js";
|
|
17
17
|
export { DashboardsResource, } from "./resources/dashboards.js";
|
|
18
|
+
export { DataCollectionsResource, } from "./resources/data-collections.js";
|
|
18
19
|
export { DataQualityResource, } from "./resources/data-quality.js";
|
|
19
20
|
export { DatasetsResource, } from "./resources/datasets.js";
|
|
20
21
|
export { DiscussionsResource, } from "./resources/discussions.js";
|
|
21
22
|
export { FlowZonesResource, } from "./resources/flow-zones.js";
|
|
22
23
|
export { FoldersResource, } from "./resources/folders.js";
|
|
23
24
|
export { FuturesResource, } from "./resources/futures.js";
|
|
25
|
+
export { GroupsResource, } from "./resources/groups.js";
|
|
24
26
|
export { InsightsResource, } from "./resources/insights.js";
|
|
25
|
-
export {
|
|
27
|
+
export { JobsResource, parseJobLogProgress, } from "./resources/jobs.js";
|
|
28
|
+
export * from "./resources/knowledge-banks.js";
|
|
29
|
+
export * from "./resources/llms.js";
|
|
30
|
+
export { MacrosResource, } from "./resources/macros.js";
|
|
26
31
|
export { MeaningsResource, } from "./resources/meanings.js";
|
|
27
32
|
export { MetricsResource, } from "./resources/metrics.js";
|
|
28
33
|
export * from "./resources/ml-tasks.js";
|
|
29
34
|
export * from "./resources/model-evaluation-stores.js";
|
|
30
35
|
export { NotebooksResource, } from "./resources/notebooks.js";
|
|
36
|
+
export { PluginsResource, } from "./resources/plugins.js";
|
|
37
|
+
export { ProjectFoldersResource, } from "./resources/project-folders.js";
|
|
31
38
|
export * from "./resources/project-git.js";
|
|
32
39
|
export { ProjectLibraryResource, } from "./resources/project-library.js";
|
|
33
40
|
export { ProjectsResource, } from "./resources/projects.js";
|
|
@@ -37,12 +44,14 @@ export { normalizeScenarioUpdateData, SCENARIO_CANONICAL_EDITABLE_FIELDS, Scenar
|
|
|
37
44
|
export { SqlResource, } from "./resources/sql.js";
|
|
38
45
|
export { StatisticsResource, } from "./resources/statistics.js";
|
|
39
46
|
export { StreamingEndpointsResource, } from "./resources/streaming-endpoints.js";
|
|
47
|
+
export { UsersResource, } from "./resources/users.js";
|
|
40
48
|
export { VariablesResource, } from "./resources/variables.js";
|
|
41
49
|
export { WebappsResource, } from "./resources/webapps.js";
|
|
42
50
|
export { WikiResource, } from "./resources/wiki.js";
|
|
43
51
|
export { WorkspacesResource, } from "./resources/workspaces.js";
|
|
52
|
+
export { computeNextPollDelayMs, } from "./utils/polling.js";
|
|
44
53
|
// Schemas (TypeBox schema objects for runtime validation)
|
|
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";
|
|
54
|
+
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 "./schemas.js";
|
|
46
55
|
// Utilities
|
|
47
56
|
export { deepMerge, } from "./utils/deep-merge.js";
|
|
48
57
|
export { analyzeFlowMap, flowTopologyFingerprint, renderFlowMap, } from "./utils/flow-analysis.js";
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BaseResource, } from "./base.js";
|
|
3
|
-
function requireNonEmpty(value, name) {
|
|
4
|
-
if (typeof value !== "string" || value.trim().length === 0) {
|
|
5
|
-
throw new UsageError(`${name} must be a non-empty string.`, "validation_failed");
|
|
6
|
-
}
|
|
7
|
-
return value;
|
|
8
|
-
}
|
|
1
|
+
import { BaseResource, requireNonEmpty, } from "./base.js";
|
|
9
2
|
export class AnalysesResource extends BaseResource {
|
|
10
3
|
/** List visual analyses in a project. */
|
|
11
4
|
async list(projectKey) {
|
|
@@ -28,7 +28,7 @@ export interface DeleteAppInstanceOptions {
|
|
|
28
28
|
export type AppManifestReferenceKind = "scenario" | "folder" | "variable";
|
|
29
29
|
/**
|
|
30
30
|
* Source-verifiable app-manifest reference locations. Validation is scoped to
|
|
31
|
-
* homepage tiles so identically named keys in arbitrary custom
|
|
31
|
+
* homepage tiles so identically named keys in arbitrary custom tile `config`
|
|
32
32
|
* objects are never treated as references.
|
|
33
33
|
*/
|
|
34
34
|
export declare const APP_MANIFEST_REFERENCE_KEYS: Record<AppManifestReferenceKind, string[]>;
|
|
@@ -207,11 +207,13 @@ export declare class ApplicationsResource extends BaseResource {
|
|
|
207
207
|
setManifestVersion(update: AppManifestVersionUpdate, projectKey?: string): Promise<AppManifestVersionWriteResult>;
|
|
208
208
|
/**
|
|
209
209
|
* Validate source-verifiable references in app homepage tiles:
|
|
210
|
-
* SCENARIO_RUN scenario IDs,
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
210
|
+
* SCENARIO_RUN scenario IDs, DOWNLOAD_MANAGED_FOLDER_FILE managed-folder IDs,
|
|
211
|
+
* and PROJECT_VARIABLES_EDIT parameter names (which DSS maps to project
|
|
212
|
+
* variables). Tile types outside that set, including custom tiles and their
|
|
213
|
+
* `config` objects, remain opaque and are never parsed for references. The
|
|
214
|
+
* manifest is never mutated. Missing/malformed references are returned
|
|
215
|
+
* deterministically; a reference kind with no applicable tiles does not
|
|
216
|
+
* trigger its project API.
|
|
215
217
|
*/
|
|
216
218
|
validateAppManifest(manifest: unknown, projectKey?: string): Promise<AppManifestValidationResult>;
|
|
217
219
|
/**
|
|
@@ -4,13 +4,13 @@ import { compareStrings, stableHash, stableJson, } from "../utils/stable-hash.js
|
|
|
4
4
|
import { BaseResource, } from "./base.js";
|
|
5
5
|
/**
|
|
6
6
|
* Source-verifiable app-manifest reference locations. Validation is scoped to
|
|
7
|
-
* homepage tiles so identically named keys in arbitrary custom
|
|
7
|
+
* homepage tiles so identically named keys in arbitrary custom tile `config`
|
|
8
8
|
* objects are never treated as references.
|
|
9
9
|
*/
|
|
10
10
|
export const APP_MANIFEST_REFERENCE_KEYS = {
|
|
11
11
|
scenario: ["SCENARIO_RUN.scenarioId",],
|
|
12
|
-
folder: ["
|
|
13
|
-
variable: ["params[].name",],
|
|
12
|
+
folder: ["DOWNLOAD_MANAGED_FOLDER_FILE.folderId",],
|
|
13
|
+
variable: ["PROJECT_VARIABLES_EDIT.params[].name",],
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* The only concurrency control the public app-manifest endpoint permits. DSS
|
|
@@ -382,11 +382,13 @@ export class ApplicationsResource extends BaseResource {
|
|
|
382
382
|
}
|
|
383
383
|
/**
|
|
384
384
|
* Validate source-verifiable references in app homepage tiles:
|
|
385
|
-
* SCENARIO_RUN scenario IDs,
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
385
|
+
* SCENARIO_RUN scenario IDs, DOWNLOAD_MANAGED_FOLDER_FILE managed-folder IDs,
|
|
386
|
+
* and PROJECT_VARIABLES_EDIT parameter names (which DSS maps to project
|
|
387
|
+
* variables). Tile types outside that set, including custom tiles and their
|
|
388
|
+
* `config` objects, remain opaque and are never parsed for references. The
|
|
389
|
+
* manifest is never mutated. Missing/malformed references are returned
|
|
390
|
+
* deterministically; a reference kind with no applicable tiles does not
|
|
391
|
+
* trigger its project API.
|
|
390
392
|
*/
|
|
391
393
|
async validateAppManifest(manifest, projectKey) {
|
|
392
394
|
const pk = this.resolveProjectKey(projectKey);
|
|
@@ -416,21 +418,19 @@ export class ApplicationsResource extends BaseResource {
|
|
|
416
418
|
if (tile["type"] === "SCENARIO_RUN") {
|
|
417
419
|
collectReferenceValue(tile["scenarioId"], propertyPath(tilePath, "scenarioId"), "scenarioId", "scenario", references, referenceIssues);
|
|
418
420
|
}
|
|
419
|
-
if (tile["type"] === "
|
|
420
|
-
|
|
421
|
-
if (!Object.prototype.hasOwnProperty.call(tile, key))
|
|
422
|
-
continue;
|
|
423
|
-
collectReferenceValue(tile[key], propertyPath(tilePath, key), key, "folder", references, referenceIssues);
|
|
424
|
-
}
|
|
421
|
+
if (tile["type"] === "DOWNLOAD_MANAGED_FOLDER_FILE") {
|
|
422
|
+
collectReferenceValue(tile["folderId"], propertyPath(tilePath, "folderId"), "folderId", "folder", references, referenceIssues);
|
|
425
423
|
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
for (let paramIndex = 0; paramIndex < params.length; paramIndex += 1) {
|
|
430
|
-
const param = params[paramIndex];
|
|
431
|
-
if (!isPlainRecord(param))
|
|
424
|
+
if (tile["type"] === "PROJECT_VARIABLES_EDIT") {
|
|
425
|
+
const params = tile["params"];
|
|
426
|
+
if (!Array.isArray(params))
|
|
432
427
|
continue;
|
|
433
|
-
|
|
428
|
+
for (let paramIndex = 0; paramIndex < params.length; paramIndex += 1) {
|
|
429
|
+
const param = params[paramIndex];
|
|
430
|
+
if (!isPlainRecord(param))
|
|
431
|
+
continue;
|
|
432
|
+
collectReferenceValue(param["name"], `${propertyPath(tilePath, "params")}[${paramIndex}]["name"]`, "name", "variable", references, referenceIssues);
|
|
433
|
+
}
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { DataikuClient } from "../client.js";
|
|
2
|
+
/** Never disguise an unexpected successful HTTP payload as an empty listing. */
|
|
3
|
+
export declare function requireArrayResponse<T>(value: unknown, operation: string): T[];
|
|
4
|
+
/** Validate identifiers without changing significant whitespace or encoding. */
|
|
5
|
+
export declare function requireNonEmpty(value: unknown, name: string): string;
|
|
2
6
|
export declare abstract class BaseResource {
|
|
3
7
|
protected readonly client: DataikuClient;
|
|
4
8
|
constructor(client: DataikuClient);
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
import { ClientValidationError, DataikuError, } from "../errors.js";
|
|
2
|
+
/** Never disguise an unexpected successful HTTP payload as an empty listing. */
|
|
3
|
+
export function requireArrayResponse(value, operation) {
|
|
4
|
+
if (!Array.isArray(value)) {
|
|
5
|
+
throw new DataikuError(200, "Unexpected Response", `${operation}: DSS did not return an array.`);
|
|
6
|
+
}
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
/** Validate identifiers without changing significant whitespace or encoding. */
|
|
10
|
+
export function requireNonEmpty(value, name) {
|
|
11
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
12
|
+
throw new ClientValidationError(`${name} must be a non-empty string.`, "validation_failed");
|
|
13
|
+
}
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
1
16
|
export class BaseResource {
|
|
2
17
|
client;
|
|
3
18
|
constructor(client) {
|
|
@@ -31,10 +31,15 @@ export declare class BundlesResource extends BaseResource {
|
|
|
31
31
|
/** List bundles exported from a project on the Design node. */
|
|
32
32
|
listExported(projectKey?: string): Promise<Record<string, unknown>[]>;
|
|
33
33
|
/**
|
|
34
|
-
* Create
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
34
|
+
* Create an exported Design-node bundle. The documented optional
|
|
35
|
+
* parameters are forwarded as query parameters: `releaseNotes` when
|
|
36
|
+
* provided, and `evaluateProjectStandardsChecks` (defaults to true,
|
|
37
|
+
* matching the official client which always sends it). The official
|
|
38
|
+
* client sends this PUT without a request body, and this resource
|
|
39
|
+
* mirrors that; DSS 15 additionally refuses re-exporting an existing
|
|
40
|
+
* bundle id ("Bundle <id> already exists"), so the documented
|
|
41
|
+
* "create or overwrite" claim does not hold — callers must delete the
|
|
42
|
+
* bundle first to replace it.
|
|
38
43
|
*/
|
|
39
44
|
exportBundle(bundleId: string, projectKey?: string, options?: BundleExportOptions): Promise<void>;
|
|
40
45
|
/** Delete an exported Design-node bundle. */
|
|
@@ -6,17 +6,22 @@ export class BundlesResource extends BaseResource {
|
|
|
6
6
|
return res.bundles ?? [];
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Create
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* Create an exported Design-node bundle. The documented optional
|
|
10
|
+
* parameters are forwarded as query parameters: `releaseNotes` when
|
|
11
|
+
* provided, and `evaluateProjectStandardsChecks` (defaults to true,
|
|
12
|
+
* matching the official client which always sends it). The official
|
|
13
|
+
* client sends this PUT without a request body, and this resource
|
|
14
|
+
* mirrors that; DSS 15 additionally refuses re-exporting an existing
|
|
15
|
+
* bundle id ("Bundle <id> already exists"), so the documented
|
|
16
|
+
* "create or overwrite" claim does not hold — callers must delete the
|
|
17
|
+
* bundle first to replace it.
|
|
13
18
|
*/
|
|
14
19
|
async exportBundle(bundleId, projectKey, options = {}) {
|
|
15
20
|
const params = new URLSearchParams();
|
|
16
21
|
if (options.releaseNotes !== undefined)
|
|
17
22
|
params.set("releaseNotes", options.releaseNotes);
|
|
18
23
|
params.set("evaluateProjectStandardsChecks", String(options.evaluateProjectStandardsChecks ?? true));
|
|
19
|
-
await this.client.
|
|
24
|
+
await this.client.putVoidNoBody(`/public/api/projects/${this.enc(projectKey)}/bundles/exported/${encodeURIComponent(bundleId)}?${params.toString()}`);
|
|
20
25
|
}
|
|
21
26
|
/** Delete an exported Design-node bundle. */
|
|
22
27
|
async deleteExported(bundleId, projectKey) {
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import type { DataikuClient } from "../client.js";
|
|
2
|
-
import type
|
|
2
|
+
import { type ConnectionSummary, type FutureState } from "../schemas.js";
|
|
3
3
|
import { BaseResource } from "./base.js";
|
|
4
|
+
/**
|
|
5
|
+
* Connection definition for admin create/update. `name` and `type` are
|
|
6
|
+
* required on create; params are connection-type specific per the docs and may
|
|
7
|
+
* carry credentials (e.g. `params.password`), which this SDK forwards verbatim
|
|
8
|
+
* over TLS and never logs.
|
|
9
|
+
*/
|
|
10
|
+
export interface ConnectionAdminInput extends Record<string, unknown> {
|
|
11
|
+
name?: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
params?: Record<string, unknown>;
|
|
14
|
+
allowWrite?: boolean;
|
|
15
|
+
allowManagedDatasets?: boolean;
|
|
16
|
+
usableBy?: string;
|
|
17
|
+
allowedGroups?: string[];
|
|
18
|
+
}
|
|
4
19
|
export declare function resolveAdminManagedStorageConnection(client: DataikuClient, capability: "allowManagedDatasets" | "allowManagedFolders", preferredName?: string): Promise<string | undefined>;
|
|
5
20
|
export interface ConnectionSchemaListOptions {
|
|
6
21
|
connection: string;
|
|
@@ -31,4 +46,66 @@ export declare class ConnectionsResource extends BaseResource {
|
|
|
31
46
|
}): Promise<ConnectionSummary[]>;
|
|
32
47
|
schemas(opts: ConnectionSchemaListOptions): Promise<string[]>;
|
|
33
48
|
tables(opts: ConnectionTableListOptions): Promise<Record<string, unknown>>;
|
|
49
|
+
/**
|
|
50
|
+
* Lists all connections on the DSS instance (Admin required). Returns the
|
|
51
|
+
* documented dictionary of connection name to Connection object. Connection
|
|
52
|
+
* params may contain credentials (e.g. `params.password`); the SDK returns
|
|
53
|
+
* the server payload faithfully, and CLI output/plan layers redact them.
|
|
54
|
+
*/
|
|
55
|
+
adminList(): Promise<Record<string, Record<string, unknown>>>;
|
|
56
|
+
/** Gets one connection by name (Admin required). */
|
|
57
|
+
adminGet(connectionName: string): Promise<Record<string, unknown>>;
|
|
58
|
+
/**
|
|
59
|
+
* Creates a connection (Admin required). Body is the Connection definition
|
|
60
|
+
* (`{name, type, params, ...}`); params are connection-type specific per
|
|
61
|
+
* the docs. DSS answers 200 with an empty body.
|
|
62
|
+
*/
|
|
63
|
+
adminCreate(body: ConnectionAdminInput): Promise<Record<string, unknown>>;
|
|
64
|
+
/**
|
|
65
|
+
* Updates a connection (Admin required). Per the docs the body MUST have
|
|
66
|
+
* been obtained from a prior GET at the same URL; `type` and `name` may not
|
|
67
|
+
* be modified and undocumented attributes should pass through unchanged.
|
|
68
|
+
* DSS answers 204 with an empty body.
|
|
69
|
+
*/
|
|
70
|
+
adminUpdate(connectionName: string, body: ConnectionAdminInput): Promise<Record<string, unknown>>;
|
|
71
|
+
/**
|
|
72
|
+
* Deletes a connection (Admin required). Per the docs DSS performs no check
|
|
73
|
+
* that the connection is not in use by a dataset, so this is destructive.
|
|
74
|
+
*/
|
|
75
|
+
adminDelete(connectionName: string): Promise<{
|
|
76
|
+
deleted: string;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Tests whether a connection is available. Routed like the official
|
|
80
|
+
* dataikuapi Python client (`DSSConnection.test()`):
|
|
81
|
+
* `GET /connections/{connectionName}/test` — a pure availability test, not
|
|
82
|
+
* a settings read. Returns an error when testing is not supported for the
|
|
83
|
+
* connection type; the result carries `connectionOK` (true when available).
|
|
84
|
+
* The REST reference documents a same-URL "Test connection" variant of
|
|
85
|
+
* `GET /admin/connections/{name}`; this route is preferred because it
|
|
86
|
+
* cannot be confused with a settings retrieval.
|
|
87
|
+
*/
|
|
88
|
+
adminTest(connectionName: string): Promise<Record<string, unknown>>;
|
|
89
|
+
/**
|
|
90
|
+
* Prepares the import of selected SQL or Hive tables (WRITE_CONF required).
|
|
91
|
+
* `keys` entries carry `{connectionName, name}` plus optional
|
|
92
|
+
* `catalog`/`schema`; Hive keys use the `@virtual(hive-jdbc):...`
|
|
93
|
+
* connection-name form documented by DSS. Returns a future reference; poll
|
|
94
|
+
* with `client.futures` when the result is not inline.
|
|
95
|
+
*/
|
|
96
|
+
prepareTablesImport(opts: {
|
|
97
|
+
keys: Array<Record<string, unknown>>;
|
|
98
|
+
projectKey?: string;
|
|
99
|
+
}): Promise<FutureState>;
|
|
100
|
+
/**
|
|
101
|
+
* Performs an import from table candidates (WRITE_CONF required). At least
|
|
102
|
+
* one of `sqlImportCandidates` or `hiveImportCandidates` must be supplied;
|
|
103
|
+
* shapes follow the DSS SQL/Hive import candidate objects. Returns a future
|
|
104
|
+
* reference; poll with `client.futures`.
|
|
105
|
+
*/
|
|
106
|
+
executeTablesImport(opts: {
|
|
107
|
+
sqlImportCandidates?: Array<Record<string, unknown>>;
|
|
108
|
+
hiveImportCandidates?: Array<Record<string, unknown>>;
|
|
109
|
+
projectKey?: string;
|
|
110
|
+
}): Promise<FutureState>;
|
|
34
111
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClientValidationError, } from "../errors.js";
|
|
2
|
+
import { FutureStateSchema, } from "../schemas.js";
|
|
3
|
+
import { BaseResource, requireNonEmpty, } from "./base.js";
|
|
2
4
|
// ---------------------------------------------------------------------------
|
|
3
5
|
// Helpers
|
|
4
6
|
// ---------------------------------------------------------------------------
|
|
@@ -9,6 +11,12 @@ function normalizeConnectionNames(value) {
|
|
|
9
11
|
.filter((v) => typeof v === "string" && v.length > 0)
|
|
10
12
|
.sort();
|
|
11
13
|
}
|
|
14
|
+
function validateConnectionAdminInput(body, method) {
|
|
15
|
+
if (body === null || body === undefined || typeof body !== "object" || Array.isArray(body)) {
|
|
16
|
+
throw new ClientValidationError(`${method}: body must be a Connection object.`);
|
|
17
|
+
}
|
|
18
|
+
return body;
|
|
19
|
+
}
|
|
12
20
|
export async function resolveAdminManagedStorageConnection(client, capability, preferredName) {
|
|
13
21
|
try {
|
|
14
22
|
const raw = await client.get("/public/api/admin/connections/");
|
|
@@ -156,4 +164,127 @@ export class ConnectionsResource extends BaseResource {
|
|
|
156
164
|
params.set("schemaName", opts.schema);
|
|
157
165
|
return this.client.get(`/public/api/projects/${encodeURIComponent(pk)}/datasets/tables-import/actions/list-tables?${params.toString()}`);
|
|
158
166
|
}
|
|
167
|
+
/* ----------------------------------------------------------------- */
|
|
168
|
+
/* Admin connection management (GET/POST/PUT/DELETE /admin/connections) */
|
|
169
|
+
/* ----------------------------------------------------------------- */
|
|
170
|
+
/**
|
|
171
|
+
* Lists all connections on the DSS instance (Admin required). Returns the
|
|
172
|
+
* documented dictionary of connection name to Connection object. Connection
|
|
173
|
+
* params may contain credentials (e.g. `params.password`); the SDK returns
|
|
174
|
+
* the server payload faithfully, and CLI output/plan layers redact them.
|
|
175
|
+
*/
|
|
176
|
+
async adminList() {
|
|
177
|
+
const raw = await this.client.get("/public/api/admin/connections");
|
|
178
|
+
if (raw === undefined || raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
179
|
+
return {};
|
|
180
|
+
}
|
|
181
|
+
return raw;
|
|
182
|
+
}
|
|
183
|
+
/** Gets one connection by name (Admin required). */
|
|
184
|
+
async adminGet(connectionName) {
|
|
185
|
+
const enc = requireNonEmpty(connectionName, "connectionName").trim();
|
|
186
|
+
return this.client.get(`/public/api/admin/connections/${encodeURIComponent(enc)}`);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Creates a connection (Admin required). Body is the Connection definition
|
|
190
|
+
* (`{name, type, params, ...}`); params are connection-type specific per
|
|
191
|
+
* the docs. DSS answers 200 with an empty body.
|
|
192
|
+
*/
|
|
193
|
+
async adminCreate(body) {
|
|
194
|
+
const validated = validateConnectionAdminInput(body, "connections.adminCreate");
|
|
195
|
+
const raw = await this.client.post("/public/api/admin/connections", validated);
|
|
196
|
+
return raw !== undefined && raw !== null && typeof raw === "object" && !Array.isArray(raw)
|
|
197
|
+
? raw
|
|
198
|
+
: {};
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Updates a connection (Admin required). Per the docs the body MUST have
|
|
202
|
+
* been obtained from a prior GET at the same URL; `type` and `name` may not
|
|
203
|
+
* be modified and undocumented attributes should pass through unchanged.
|
|
204
|
+
* DSS answers 204 with an empty body.
|
|
205
|
+
*/
|
|
206
|
+
async adminUpdate(connectionName, body) {
|
|
207
|
+
const enc = requireNonEmpty(connectionName, "connectionName").trim();
|
|
208
|
+
const validated = validateConnectionAdminInput(body, "connections.adminUpdate");
|
|
209
|
+
const raw = await this.client.put(`/public/api/admin/connections/${encodeURIComponent(enc)}`, validated);
|
|
210
|
+
return raw !== undefined && raw !== null && typeof raw === "object" && !Array.isArray(raw)
|
|
211
|
+
? raw
|
|
212
|
+
: {};
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Deletes a connection (Admin required). Per the docs DSS performs no check
|
|
216
|
+
* that the connection is not in use by a dataset, so this is destructive.
|
|
217
|
+
*/
|
|
218
|
+
async adminDelete(connectionName) {
|
|
219
|
+
const enc = requireNonEmpty(connectionName, "connectionName").trim();
|
|
220
|
+
await this.client.del(`/public/api/admin/connections/${encodeURIComponent(enc)}`);
|
|
221
|
+
return { deleted: enc, };
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Tests whether a connection is available. Routed like the official
|
|
225
|
+
* dataikuapi Python client (`DSSConnection.test()`):
|
|
226
|
+
* `GET /connections/{connectionName}/test` — a pure availability test, not
|
|
227
|
+
* a settings read. Returns an error when testing is not supported for the
|
|
228
|
+
* connection type; the result carries `connectionOK` (true when available).
|
|
229
|
+
* The REST reference documents a same-URL "Test connection" variant of
|
|
230
|
+
* `GET /admin/connections/{name}`; this route is preferred because it
|
|
231
|
+
* cannot be confused with a settings retrieval.
|
|
232
|
+
*/
|
|
233
|
+
async adminTest(connectionName) {
|
|
234
|
+
const enc = requireNonEmpty(connectionName, "connectionName").trim();
|
|
235
|
+
const raw = await this.client.get(`/public/api/connections/${encodeURIComponent(enc)}/test`);
|
|
236
|
+
return raw !== undefined && raw !== null && typeof raw === "object" && !Array.isArray(raw)
|
|
237
|
+
? raw
|
|
238
|
+
: {};
|
|
239
|
+
}
|
|
240
|
+
/* ----------------------------------------------------------------- */
|
|
241
|
+
/* Tables import (prepare-from-keys / execute-from-candidates) */
|
|
242
|
+
/* ----------------------------------------------------------------- */
|
|
243
|
+
/**
|
|
244
|
+
* Prepares the import of selected SQL or Hive tables (WRITE_CONF required).
|
|
245
|
+
* `keys` entries carry `{connectionName, name}` plus optional
|
|
246
|
+
* `catalog`/`schema`; Hive keys use the `@virtual(hive-jdbc):...`
|
|
247
|
+
* connection-name form documented by DSS. Returns a future reference; poll
|
|
248
|
+
* with `client.futures` when the result is not inline.
|
|
249
|
+
*/
|
|
250
|
+
async prepareTablesImport(opts) {
|
|
251
|
+
if (!Array.isArray(opts?.keys) || opts.keys.length === 0
|
|
252
|
+
|| opts.keys.some((k) => k === null || typeof k !== "object" || Array.isArray(k))) {
|
|
253
|
+
throw new ClientValidationError("connections.prepareTablesImport: keys must be a non-empty array of key objects.");
|
|
254
|
+
}
|
|
255
|
+
for (const key of opts.keys) {
|
|
256
|
+
const connectionName = key["connectionName"];
|
|
257
|
+
const name = key["name"];
|
|
258
|
+
if (typeof connectionName !== "string" || connectionName.trim().length === 0
|
|
259
|
+
|| typeof name !== "string" || name.trim().length === 0) {
|
|
260
|
+
throw new ClientValidationError("connections.prepareTablesImport: each key must carry non-empty string connectionName and name per the DSS tables-import contract.");
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
const pk = this.resolveProjectKey(opts.projectKey);
|
|
264
|
+
const raw = await this.client.post(`/public/api/projects/${encodeURIComponent(pk)}/datasets/tables-import/actions/prepare-from-keys`, { keys: opts.keys, });
|
|
265
|
+
return this.client.safeParse(FutureStateSchema, raw, "connections.prepareTablesImport");
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Performs an import from table candidates (WRITE_CONF required). At least
|
|
269
|
+
* one of `sqlImportCandidates` or `hiveImportCandidates` must be supplied;
|
|
270
|
+
* shapes follow the DSS SQL/Hive import candidate objects. Returns a future
|
|
271
|
+
* reference; poll with `client.futures`.
|
|
272
|
+
*/
|
|
273
|
+
async executeTablesImport(opts) {
|
|
274
|
+
const sql = opts?.sqlImportCandidates;
|
|
275
|
+
const hive = opts?.hiveImportCandidates;
|
|
276
|
+
if ((sql !== undefined && (!Array.isArray(sql) || sql.length === 0))
|
|
277
|
+
|| (hive !== undefined && (!Array.isArray(hive) || hive.length === 0))
|
|
278
|
+
|| (sql === undefined && hive === undefined)) {
|
|
279
|
+
throw new ClientValidationError("connections.executeTablesImport: sqlImportCandidates or hiveImportCandidates must be a non-empty array (at least one required).");
|
|
280
|
+
}
|
|
281
|
+
const pk = this.resolveProjectKey(opts.projectKey);
|
|
282
|
+
const body = {};
|
|
283
|
+
if (sql !== undefined)
|
|
284
|
+
body.sqlImportCandidates = sql;
|
|
285
|
+
if (hive !== undefined)
|
|
286
|
+
body.hiveImportCandidates = hive;
|
|
287
|
+
const raw = await this.client.post(`/public/api/projects/${encodeURIComponent(pk)}/datasets/tables-import/actions/execute-from-candidates`, body);
|
|
288
|
+
return this.client.safeParse(FutureStateSchema, raw, "connections.executeTablesImport");
|
|
289
|
+
}
|
|
159
290
|
}
|