dataiku-sdk 0.8.0 → 0.9.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 (39) hide show
  1. package/dist/src/cli.js +1259 -4
  2. package/dist/src/client.d.ts +46 -0
  3. package/dist/src/client.js +158 -0
  4. package/dist/src/index.d.ts +13 -0
  5. package/dist/src/index.js +13 -0
  6. package/dist/src/resources/api-deployer.d.ts +66 -0
  7. package/dist/src/resources/api-deployer.js +79 -0
  8. package/dist/src/resources/api-services.d.ts +38 -0
  9. package/dist/src/resources/api-services.js +50 -0
  10. package/dist/src/resources/applications.d.ts +56 -0
  11. package/dist/src/resources/applications.js +67 -0
  12. package/dist/src/resources/bundles.d.ts +53 -0
  13. package/dist/src/resources/bundles.js +103 -0
  14. package/dist/src/resources/continuous-activities.d.ts +27 -0
  15. package/dist/src/resources/continuous-activities.js +22 -0
  16. package/dist/src/resources/datasets.d.ts +6 -0
  17. package/dist/src/resources/datasets.js +15 -0
  18. package/dist/src/resources/discussions.d.ts +26 -0
  19. package/dist/src/resources/discussions.js +29 -0
  20. package/dist/src/resources/meanings.d.ts +41 -0
  21. package/dist/src/resources/meanings.js +33 -0
  22. package/dist/src/resources/metrics.d.ts +44 -0
  23. package/dist/src/resources/metrics.js +31 -0
  24. package/dist/src/resources/project-library.d.ts +38 -0
  25. package/dist/src/resources/project-library.js +82 -0
  26. package/dist/src/resources/projects.d.ts +70 -0
  27. package/dist/src/resources/projects.js +97 -0
  28. package/dist/src/resources/recipes.js +10 -8
  29. package/dist/src/resources/scenarios.d.ts +3 -0
  30. package/dist/src/resources/scenarios.js +8 -1
  31. package/dist/src/resources/statistics.d.ts +56 -0
  32. package/dist/src/resources/statistics.js +51 -0
  33. package/dist/src/resources/streaming-endpoints.d.ts +45 -0
  34. package/dist/src/resources/streaming-endpoints.js +36 -0
  35. package/dist/src/resources/webapps.d.ts +27 -0
  36. package/dist/src/resources/webapps.js +36 -0
  37. package/dist/src/resources/workspaces.d.ts +59 -0
  38. package/dist/src/resources/workspaces.js +31 -0
  39. package/package.json +1 -1
@@ -1,21 +1,34 @@
1
1
  import { type Static, type TSchema } from "@sinclair/typebox";
2
+ import { ApiDeployerResource } from "./resources/api-deployer.js";
3
+ import { ApiServicesResource } from "./resources/api-services.js";
4
+ import { ApplicationsResource } from "./resources/applications.js";
5
+ import { BundlesResource, ProjectDeployerResource } from "./resources/bundles.js";
2
6
  import { CodeEnvsResource } from "./resources/code-envs.js";
3
7
  import { ConnectionsResource } from "./resources/connections.js";
8
+ import { ContinuousActivitiesResource } from "./resources/continuous-activities.js";
4
9
  import { DashboardsResource } from "./resources/dashboards.js";
5
10
  import { DataQualityResource } from "./resources/data-quality.js";
6
11
  import { DatasetsResource } from "./resources/datasets.js";
12
+ import { DiscussionsResource } from "./resources/discussions.js";
7
13
  import { FlowZonesResource } from "./resources/flow-zones.js";
8
14
  import { FoldersResource } from "./resources/folders.js";
9
15
  import { FuturesResource } from "./resources/futures.js";
10
16
  import { InsightsResource } from "./resources/insights.js";
11
17
  import { JobsResource } from "./resources/jobs.js";
18
+ import { MeaningsResource } from "./resources/meanings.js";
19
+ import { MetricsResource } from "./resources/metrics.js";
12
20
  import { NotebooksResource } from "./resources/notebooks.js";
21
+ import { ProjectLibraryResource } from "./resources/project-library.js";
13
22
  import { ProjectsResource } from "./resources/projects.js";
14
23
  import { RecipesResource } from "./resources/recipes.js";
15
24
  import { ScenariosResource } from "./resources/scenarios.js";
16
25
  import { SqlResource } from "./resources/sql.js";
26
+ import { StatisticsResource } from "./resources/statistics.js";
27
+ import { StreamingEndpointsResource } from "./resources/streaming-endpoints.js";
17
28
  import { VariablesResource } from "./resources/variables.js";
29
+ import { WebappsResource } from "./resources/webapps.js";
18
30
  import { WikiResource } from "./resources/wiki.js";
31
+ import { WorkspacesResource } from "./resources/workspaces.js";
19
32
  export interface DataikuClientConfig {
20
33
  /** DSS base URL (e.g. https://dss.example.com) */
21
34
  url: string;
@@ -67,6 +80,20 @@ export declare class DataikuClient {
67
80
  private sqlResource?;
68
81
  private notebooksResource?;
69
82
  private wikiResource?;
83
+ private applicationsResource?;
84
+ private webappsResource?;
85
+ private apiServicesResource?;
86
+ private apiDeployerResource?;
87
+ private bundlesResource?;
88
+ private projectDeployerResource?;
89
+ private projectLibraryResource?;
90
+ private streamingEndpointsResource?;
91
+ private continuousActivitiesResource?;
92
+ private statisticsResource?;
93
+ private discussionsResource?;
94
+ private workspacesResource?;
95
+ private metricsResource?;
96
+ private meaningsResource?;
70
97
  get projects(): ProjectsResource;
71
98
  get datasets(): DatasetsResource;
72
99
  get dashboards(): DashboardsResource;
@@ -84,12 +111,31 @@ export declare class DataikuClient {
84
111
  get sql(): SqlResource;
85
112
  get notebooks(): NotebooksResource;
86
113
  get wiki(): WikiResource;
114
+ get applications(): ApplicationsResource;
115
+ get webapps(): WebappsResource;
116
+ get apiServices(): ApiServicesResource;
117
+ get apiDeployer(): ApiDeployerResource;
118
+ get bundles(): BundlesResource;
119
+ get projectDeployer(): ProjectDeployerResource;
120
+ get projectLibrary(): ProjectLibraryResource;
121
+ get streamingEndpoints(): StreamingEndpointsResource;
122
+ get continuousActivities(): ContinuousActivitiesResource;
123
+ get statistics(): StatisticsResource;
124
+ get discussions(): DiscussionsResource;
125
+ get workspaces(): WorkspacesResource;
126
+ get metrics(): MetricsResource;
127
+ get meanings(): MeaningsResource;
87
128
  constructor(config: DataikuClientConfig);
88
129
  getRequestTimeoutMs(): number;
89
130
  resolveProjectKey(paramValue?: string): string;
90
131
  get<T = unknown>(path: string): Promise<T>;
91
132
  getText(path: string): Promise<string>;
133
+ getTextLimited(path: string, maxBytes: number): Promise<{
134
+ text: string;
135
+ truncated: boolean;
136
+ }>;
92
137
  post<T = unknown>(path: string, body?: unknown): Promise<T>;
138
+ postText(path: string, body?: unknown): Promise<string>;
93
139
  put<T = unknown>(path: string, body: unknown): Promise<T>;
94
140
  del(path: string): Promise<void>;
95
141
  putVoid(path: string, body: unknown): Promise<void>;
@@ -3,23 +3,36 @@ import { getCACertificates, } from "node:tls";
3
3
  import { Value, } from "@sinclair/typebox/value";
4
4
  import { safeParseSchema, } from "./schemas.js";
5
5
  import { classifyDataikuError, DataikuError, } from "./errors.js";
6
+ import { ApiDeployerResource, } from "./resources/api-deployer.js";
7
+ import { ApiServicesResource, } from "./resources/api-services.js";
8
+ import { ApplicationsResource, } from "./resources/applications.js";
9
+ import { BundlesResource, ProjectDeployerResource, } from "./resources/bundles.js";
6
10
  import { CodeEnvsResource, } from "./resources/code-envs.js";
7
11
  import { ConnectionsResource, } from "./resources/connections.js";
12
+ import { ContinuousActivitiesResource, } from "./resources/continuous-activities.js";
8
13
  import { DashboardsResource, } from "./resources/dashboards.js";
9
14
  import { DataQualityResource, } from "./resources/data-quality.js";
10
15
  import { DatasetsResource, } from "./resources/datasets.js";
16
+ import { DiscussionsResource, } from "./resources/discussions.js";
11
17
  import { FlowZonesResource, } from "./resources/flow-zones.js";
12
18
  import { FoldersResource, } from "./resources/folders.js";
13
19
  import { FuturesResource, } from "./resources/futures.js";
14
20
  import { InsightsResource, } from "./resources/insights.js";
15
21
  import { JobsResource, } from "./resources/jobs.js";
22
+ import { MeaningsResource, } from "./resources/meanings.js";
23
+ import { MetricsResource, } from "./resources/metrics.js";
16
24
  import { NotebooksResource, } from "./resources/notebooks.js";
25
+ import { ProjectLibraryResource, } from "./resources/project-library.js";
17
26
  import { ProjectsResource, } from "./resources/projects.js";
18
27
  import { RecipesResource, } from "./resources/recipes.js";
19
28
  import { ScenariosResource, } from "./resources/scenarios.js";
20
29
  import { SqlResource, } from "./resources/sql.js";
30
+ import { StatisticsResource, } from "./resources/statistics.js";
31
+ import { StreamingEndpointsResource, } from "./resources/streaming-endpoints.js";
21
32
  import { VariablesResource, } from "./resources/variables.js";
33
+ import { WebappsResource, } from "./resources/webapps.js";
22
34
  import { WikiResource, } from "./resources/wiki.js";
35
+ import { WorkspacesResource, } from "./resources/workspaces.js";
23
36
  /* ------------------------------------------------------------------ */
24
37
  /* Constants */
25
38
  /* ------------------------------------------------------------------ */
@@ -46,6 +59,43 @@ function isTransientError(status, body) {
46
59
  function shouldRetryMethod(method) {
47
60
  return method.toUpperCase() === "GET";
48
61
  }
62
+ function concatBytes(chunks, total) {
63
+ const out = new Uint8Array(total);
64
+ let offset = 0;
65
+ for (const chunk of chunks) {
66
+ out.set(chunk, offset);
67
+ offset += chunk.byteLength;
68
+ }
69
+ return out;
70
+ }
71
+ /**
72
+ * Drop a trailing incomplete UTF-8 multibyte sequence so the bytes end on a
73
+ * character boundary. Guarantees the decoded string re-encodes to no more bytes
74
+ * than the input, so a byte cap is never exceeded by a replacement character.
75
+ */
76
+ function trimToUtf8Boundary(bytes) {
77
+ let i = bytes.length - 1;
78
+ let continuation = 0;
79
+ while (i >= 0 && (bytes[i] & 0xC0) === 0x80) {
80
+ i--;
81
+ continuation++;
82
+ }
83
+ if (i < 0)
84
+ return bytes;
85
+ const lead = bytes[i];
86
+ let expected;
87
+ if ((lead & 0x80) === 0x00)
88
+ expected = 1;
89
+ else if ((lead & 0xE0) === 0xC0)
90
+ expected = 2;
91
+ else if ((lead & 0xF0) === 0xE0)
92
+ expected = 3;
93
+ else if ((lead & 0xF8) === 0xF0)
94
+ expected = 4;
95
+ else
96
+ return bytes;
97
+ return continuation + 1 < expected ? bytes.subarray(0, i) : bytes;
98
+ }
49
99
  function buildRetryMetadata(method, enabled, maxAttempts, attempts, delaysMs, timedOut) {
50
100
  return {
51
101
  method,
@@ -108,6 +158,20 @@ export class DataikuClient {
108
158
  sqlResource;
109
159
  notebooksResource;
110
160
  wikiResource;
161
+ applicationsResource;
162
+ webappsResource;
163
+ apiServicesResource;
164
+ apiDeployerResource;
165
+ bundlesResource;
166
+ projectDeployerResource;
167
+ projectLibraryResource;
168
+ streamingEndpointsResource;
169
+ continuousActivitiesResource;
170
+ statisticsResource;
171
+ discussionsResource;
172
+ workspacesResource;
173
+ metricsResource;
174
+ meaningsResource;
111
175
  get projects() {
112
176
  return (this.projectsResource ??= new ProjectsResource(this));
113
177
  }
@@ -159,6 +223,48 @@ export class DataikuClient {
159
223
  get wiki() {
160
224
  return (this.wikiResource ??= new WikiResource(this));
161
225
  }
226
+ get applications() {
227
+ return (this.applicationsResource ??= new ApplicationsResource(this));
228
+ }
229
+ get webapps() {
230
+ return (this.webappsResource ??= new WebappsResource(this));
231
+ }
232
+ get apiServices() {
233
+ return (this.apiServicesResource ??= new ApiServicesResource(this));
234
+ }
235
+ get apiDeployer() {
236
+ return (this.apiDeployerResource ??= new ApiDeployerResource(this));
237
+ }
238
+ get bundles() {
239
+ return (this.bundlesResource ??= new BundlesResource(this));
240
+ }
241
+ get projectDeployer() {
242
+ return (this.projectDeployerResource ??= new ProjectDeployerResource(this));
243
+ }
244
+ get projectLibrary() {
245
+ return (this.projectLibraryResource ??= new ProjectLibraryResource(this));
246
+ }
247
+ get streamingEndpoints() {
248
+ return (this.streamingEndpointsResource ??= new StreamingEndpointsResource(this));
249
+ }
250
+ get continuousActivities() {
251
+ return (this.continuousActivitiesResource ??= new ContinuousActivitiesResource(this));
252
+ }
253
+ get statistics() {
254
+ return (this.statisticsResource ??= new StatisticsResource(this));
255
+ }
256
+ get discussions() {
257
+ return (this.discussionsResource ??= new DiscussionsResource(this));
258
+ }
259
+ get workspaces() {
260
+ return (this.workspacesResource ??= new WorkspacesResource(this));
261
+ }
262
+ get metrics() {
263
+ return (this.metricsResource ??= new MetricsResource(this));
264
+ }
265
+ get meanings() {
266
+ return (this.meaningsResource ??= new MeaningsResource(this));
267
+ }
162
268
  constructor(config) {
163
269
  const url = config.url?.trim();
164
270
  if (!url)
@@ -203,6 +309,50 @@ export class DataikuClient {
203
309
  });
204
310
  return res.text();
205
311
  }
312
+ async getTextLimited(path, maxBytes) {
313
+ const limit = Math.max(0, Math.floor(maxBytes));
314
+ const res = await this.fetchWithRetry(`${this.baseUrl}${path}`, {
315
+ method: "GET",
316
+ headers: this.getAnyHeaders(),
317
+ });
318
+ if (!res.body)
319
+ return { text: "", truncated: false, };
320
+ const reader = res.body.getReader();
321
+ const chunks = [];
322
+ let bytesRead = 0;
323
+ let truncated = false;
324
+ try {
325
+ while (bytesRead < limit) {
326
+ const { done, value, } = await reader.read();
327
+ if (done)
328
+ break;
329
+ const room = limit - bytesRead;
330
+ if (value.byteLength > room) {
331
+ chunks.push(value.slice(0, room));
332
+ bytesRead += room;
333
+ truncated = true;
334
+ break;
335
+ }
336
+ chunks.push(value);
337
+ bytesRead += value.byteLength;
338
+ }
339
+ if (!truncated && bytesRead >= limit) {
340
+ // Buffer filled exactly on a chunk boundary; peek whether more data remains.
341
+ const { done, } = await reader.read();
342
+ if (!done)
343
+ truncated = true;
344
+ }
345
+ }
346
+ finally {
347
+ await reader.cancel();
348
+ }
349
+ const collected = concatBytes(chunks, bytesRead);
350
+ // On truncation, drop any trailing partial UTF-8 character so the decoded
351
+ // text never re-encodes beyond the byte cap (a stream-flush would otherwise
352
+ // emit a 3-byte replacement char for a split multibyte sequence).
353
+ const usable = truncated ? trimToUtf8Boundary(collected) : collected;
354
+ return { text: new TextDecoder().decode(usable), truncated, };
355
+ }
206
356
  async post(path, body) {
207
357
  const res = await this.fetchWithRetry(`${this.baseUrl}${path}`, {
208
358
  method: "POST",
@@ -211,6 +361,14 @@ export class DataikuClient {
211
361
  });
212
362
  return this.parseJsonResponse(res);
213
363
  }
364
+ async postText(path, body) {
365
+ const res = await this.fetchWithRetry(`${this.baseUrl}${path}`, {
366
+ method: "POST",
367
+ headers: this.getHeaders(),
368
+ body: body !== undefined ? JSON.stringify(body) : undefined,
369
+ });
370
+ return res.text();
371
+ }
214
372
  async put(path, body) {
215
373
  const res = await this.fetchWithRetry(`${this.baseUrl}${path}`, {
216
374
  method: "PUT",
@@ -2,23 +2,36 @@ export { DataikuClient, type DataikuClientConfig, } 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 { DataikuError, type DataikuErrorCategory, type DataikuErrorTaxonomy, type DataikuRetryMetadata, } from "./errors.js";
5
+ export { ApiDeployerResource, } from "./resources/api-deployer.js";
6
+ export { ApiServicesResource, } from "./resources/api-services.js";
7
+ export { ApplicationsResource, } from "./resources/applications.js";
8
+ export { BundlesResource, ProjectDeployerResource, } from "./resources/bundles.js";
5
9
  export { CodeEnvsResource, } from "./resources/code-envs.js";
6
10
  export { type ConnectionSchemaListOptions, ConnectionsResource, type ConnectionTableListOptions, } from "./resources/connections.js";
11
+ export { ContinuousActivitiesResource, } from "./resources/continuous-activities.js";
7
12
  export { DashboardsResource, } from "./resources/dashboards.js";
8
13
  export { DataQualityResource, } from "./resources/data-quality.js";
9
14
  export { type DatasetBuildValidationResult, type DatasetCloneOptions, type DatasetCloneResult, type DatasetSchemaColumnInput, DatasetsResource, } from "./resources/datasets.js";
15
+ export { DiscussionsResource, } from "./resources/discussions.js";
10
16
  export { type FlowZoneItemInput, FlowZonesResource, } from "./resources/flow-zones.js";
11
17
  export { FoldersResource, } from "./resources/folders.js";
12
18
  export { FuturesResource, } from "./resources/futures.js";
13
19
  export { InsightsResource, } from "./resources/insights.js";
14
20
  export { computeNextPollDelayMs, type JobBuildAndWaitOptions, type JobBuildOptions, type JobBuildTarget, type JobBuildTargetType, type JobLogFilter, type JobLogProgress, type JobLogSummary, JobsResource, parseJobLogProgress, } from "./resources/jobs.js";
21
+ export { MeaningsResource, } from "./resources/meanings.js";
22
+ export { MetricsResource, } from "./resources/metrics.js";
15
23
  export { NotebooksResource, } from "./resources/notebooks.js";
24
+ export { ProjectLibraryResource, } from "./resources/project-library.js";
16
25
  export { type FlowMapResult, ProjectsResource, } from "./resources/projects.js";
17
26
  export { type RecipeCloneOptions, type RecipeCloneResult, type RecipeGraphReference, type RecipeGraphValidationResult, type RecipeRunOptions, type RecipeRunOutput, type RecipeRunResult, RecipesResource, } from "./resources/recipes.js";
18
27
  export { normalizeScenarioUpdateData, SCENARIO_CANONICAL_EDITABLE_FIELDS, type ScenarioFieldChange, type ScenarioFieldMismatch, type ScenarioScriptRunResult, ScenariosResource, type ScenarioUpdateNormalization, type ScenarioUpdatePreview, scenarioUpdatePreview, type ScenarioUpdateResult, } from "./resources/scenarios.js";
19
28
  export { SqlResource, } from "./resources/sql.js";
29
+ export { StatisticsResource, } from "./resources/statistics.js";
30
+ export { StreamingEndpointsResource, } from "./resources/streaming-endpoints.js";
20
31
  export { VariablesResource, } from "./resources/variables.js";
32
+ export { WebappsResource, } from "./resources/webapps.js";
21
33
  export { WikiResource, } from "./resources/wiki.js";
34
+ export { WorkspacesResource, } from "./resources/workspaces.js";
22
35
  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, ProjectMetadataSchema, ProjectSummaryArraySchema, ProjectSummarySchema, ProjectVariablesSchema, RecipeCreateOptionsSchema, RecipeCreateResultSchema, RecipeDetailsSchema, RecipeSummaryArraySchema, RecipeSummarySchema, safeParseSchema, ScenarioDetailsSchema, ScenarioStatusSchema, ScenarioSummaryArraySchema, ScenarioSummarySchema, ScenarioWaitResultSchema, SqlNotebookCellSchema, SqlNotebookContentSchema, SqlNotebookSummaryArraySchema, SqlNotebookSummarySchema, SqlQueryResponseSchema, SqlQueryResultSchema, SqlQuerySchemaSchema, WikiArticleDataArraySchema, WikiArticleDataSchema, WikiArticleMetadataSchema, WikiSettingsSchema, WikiTaxonomyNodeSchema, } from "./schemas.js";
23
36
  export type { SafeParseResult, } from "./schemas.js";
24
37
  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, ProjectMetadata, ProjectSummary, ProjectVariables, RecipeCreateOptions, RecipeCreateResult, RecipeDetails, RecipeSummary, ScenarioDetails, ScenarioStatus, ScenarioSummary, ScenarioWaitResult, SqlNotebookCell, SqlNotebookContent, SqlNotebookSummary, SqlQueryResponse, SqlQueryResult, SqlQuerySchema, WikiArticleData, WikiArticleMetadata, WikiSettings, WikiTaxonomyNode, } from "./schemas.js";
package/dist/src/index.js CHANGED
@@ -6,23 +6,36 @@ export { getConfigDir, getCredentialsPath, loadCredentials, saveCredentials, } f
6
6
  // Errors
7
7
  export { DataikuError, } from "./errors.js";
8
8
  // Resources (for advanced use / extension)
9
+ export { ApiDeployerResource, } from "./resources/api-deployer.js";
10
+ export { ApiServicesResource, } from "./resources/api-services.js";
11
+ export { ApplicationsResource, } from "./resources/applications.js";
12
+ export { BundlesResource, ProjectDeployerResource, } from "./resources/bundles.js";
9
13
  export { CodeEnvsResource, } from "./resources/code-envs.js";
10
14
  export { ConnectionsResource, } from "./resources/connections.js";
15
+ export { ContinuousActivitiesResource, } from "./resources/continuous-activities.js";
11
16
  export { DashboardsResource, } from "./resources/dashboards.js";
12
17
  export { DataQualityResource, } from "./resources/data-quality.js";
13
18
  export { DatasetsResource, } from "./resources/datasets.js";
19
+ export { DiscussionsResource, } from "./resources/discussions.js";
14
20
  export { FlowZonesResource, } from "./resources/flow-zones.js";
15
21
  export { FoldersResource, } from "./resources/folders.js";
16
22
  export { FuturesResource, } from "./resources/futures.js";
17
23
  export { InsightsResource, } from "./resources/insights.js";
18
24
  export { computeNextPollDelayMs, JobsResource, parseJobLogProgress, } from "./resources/jobs.js";
25
+ export { MeaningsResource, } from "./resources/meanings.js";
26
+ export { MetricsResource, } from "./resources/metrics.js";
19
27
  export { NotebooksResource, } from "./resources/notebooks.js";
28
+ export { ProjectLibraryResource, } from "./resources/project-library.js";
20
29
  export { ProjectsResource, } from "./resources/projects.js";
21
30
  export { RecipesResource, } from "./resources/recipes.js";
22
31
  export { normalizeScenarioUpdateData, SCENARIO_CANONICAL_EDITABLE_FIELDS, ScenariosResource, scenarioUpdatePreview, } from "./resources/scenarios.js";
23
32
  export { SqlResource, } from "./resources/sql.js";
33
+ export { StatisticsResource, } from "./resources/statistics.js";
34
+ export { StreamingEndpointsResource, } from "./resources/streaming-endpoints.js";
24
35
  export { VariablesResource, } from "./resources/variables.js";
36
+ export { WebappsResource, } from "./resources/webapps.js";
25
37
  export { WikiResource, } from "./resources/wiki.js";
38
+ export { WorkspacesResource, } from "./resources/workspaces.js";
26
39
  // Schemas (TypeBox schema objects for runtime validation)
27
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, ProjectMetadataSchema, ProjectSummaryArraySchema, ProjectSummarySchema, ProjectVariablesSchema, RecipeCreateOptionsSchema, RecipeCreateResultSchema, RecipeDetailsSchema, RecipeSummaryArraySchema, RecipeSummarySchema, safeParseSchema, ScenarioDetailsSchema, ScenarioStatusSchema, ScenarioSummaryArraySchema, ScenarioSummarySchema, ScenarioWaitResultSchema, SqlNotebookCellSchema, SqlNotebookContentSchema, SqlNotebookSummaryArraySchema, SqlNotebookSummarySchema, SqlQueryResponseSchema, SqlQueryResultSchema, SqlQuerySchemaSchema, WikiArticleDataArraySchema, WikiArticleDataSchema, WikiArticleMetadataSchema, WikiSettingsSchema, WikiTaxonomyNodeSchema, } from "./schemas.js";
28
41
  // Utilities
@@ -0,0 +1,66 @@
1
+ import { BaseResource } from "./base.js";
2
+ export interface ApiDeployerInfra extends Record<string, unknown> {
3
+ id?: string;
4
+ }
5
+ export interface ApiDeployerStage extends Record<string, unknown> {
6
+ id?: string;
7
+ }
8
+ export interface ApiDeployerService extends Record<string, unknown> {
9
+ id?: string;
10
+ publishedServiceId?: string;
11
+ }
12
+ export interface ApiDeployerDeployment extends Record<string, unknown> {
13
+ id?: string;
14
+ deploymentId?: string;
15
+ }
16
+ export interface ApiDeployerDeploymentStatus extends Record<string, unknown> {
17
+ id?: string;
18
+ deploymentId?: string;
19
+ }
20
+ export interface ApiDeployerDeploymentSettings extends Record<string, unknown> {
21
+ id?: string;
22
+ deploymentId?: string;
23
+ }
24
+ export interface ApiDeployerActionResult extends Record<string, unknown> {
25
+ jobId?: string;
26
+ }
27
+ export declare class ApiDeployerResource extends BaseResource {
28
+ /** List API Deployer infrastructures. */
29
+ listInfras(): Promise<ApiDeployerInfra[]>;
30
+ /** Create an API Deployer infrastructure. */
31
+ createInfra(body: Record<string, unknown>): Promise<ApiDeployerInfra>;
32
+ /** Get an API Deployer infrastructure. */
33
+ getInfra(infraId: string): Promise<ApiDeployerInfra>;
34
+ /** Delete an API Deployer infrastructure. */
35
+ deleteInfra(infraId: string): Promise<void>;
36
+ /** List API Deployer stages. */
37
+ listStages(): Promise<ApiDeployerStage[]>;
38
+ /** List published API Deployer services. */
39
+ listServices(): Promise<ApiDeployerService[]>;
40
+ /** Create a published API Deployer service. */
41
+ createService(body: Record<string, unknown>): Promise<ApiDeployerService>;
42
+ /** Get a published API Deployer service. */
43
+ getService(serviceId: string): Promise<ApiDeployerService>;
44
+ /** Delete a published API Deployer service. */
45
+ deleteService(serviceId: string): Promise<void>;
46
+ /** Publish a service version archive to the API Deployer. */
47
+ publishServiceVersion(serviceId: string, filePath: string): Promise<void>;
48
+ /** Delete a published service version. */
49
+ deleteServiceVersion(serviceId: string, version: string): Promise<void>;
50
+ /** List API Deployer deployments. */
51
+ listDeployments(): Promise<ApiDeployerDeployment[]>;
52
+ /** Create an API Deployer deployment. */
53
+ createDeployment(body: Record<string, unknown>): Promise<ApiDeployerDeployment>;
54
+ /** Get an API Deployer deployment. */
55
+ getDeployment(deploymentId: string): Promise<ApiDeployerDeployment>;
56
+ /** Get an API Deployer deployment's full status. */
57
+ getDeploymentStatus(deploymentId: string): Promise<ApiDeployerDeploymentStatus>;
58
+ /** Get API Deployer deployment settings. */
59
+ getDeploymentSettings(deploymentId: string): Promise<ApiDeployerDeploymentSettings>;
60
+ /** Save API Deployer deployment settings. */
61
+ saveDeploymentSettings(deploymentId: string, body: Record<string, unknown>): Promise<void>;
62
+ /** Start an API Deployer deployment update. */
63
+ startDeploymentUpdate(deploymentId: string): Promise<ApiDeployerActionResult>;
64
+ /** Delete an API Deployer deployment. */
65
+ deleteDeployment(deploymentId: string): Promise<void>;
66
+ }
@@ -0,0 +1,79 @@
1
+ import { BaseResource, } from "./base.js";
2
+ export class ApiDeployerResource extends BaseResource {
3
+ /** List API Deployer infrastructures. */
4
+ async listInfras() {
5
+ return this.client.get("/public/api/api-deployer/infras");
6
+ }
7
+ /** Create an API Deployer infrastructure. */
8
+ async createInfra(body) {
9
+ return this.client.post("/public/api/api-deployer/infras", body);
10
+ }
11
+ /** Get an API Deployer infrastructure. */
12
+ async getInfra(infraId) {
13
+ return this.client.get(`/public/api/api-deployer/infras/${encodeURIComponent(infraId)}`);
14
+ }
15
+ /** Delete an API Deployer infrastructure. */
16
+ async deleteInfra(infraId) {
17
+ await this.client.del(`/public/api/api-deployer/infras/${encodeURIComponent(infraId)}`);
18
+ }
19
+ /** List API Deployer stages. */
20
+ async listStages() {
21
+ return this.client.get("/public/api/api-deployer/stages");
22
+ }
23
+ /** List published API Deployer services. */
24
+ async listServices() {
25
+ return this.client.get("/public/api/api-deployer/services");
26
+ }
27
+ /** Create a published API Deployer service. */
28
+ async createService(body) {
29
+ return this.client.post("/public/api/api-deployer/services", body);
30
+ }
31
+ /** Get a published API Deployer service. */
32
+ async getService(serviceId) {
33
+ return this.client.get(`/public/api/api-deployer/services/${encodeURIComponent(serviceId)}`);
34
+ }
35
+ /** Delete a published API Deployer service. */
36
+ async deleteService(serviceId) {
37
+ await this.client.del(`/public/api/api-deployer/services/${encodeURIComponent(serviceId)}`);
38
+ }
39
+ /** Publish a service version archive to the API Deployer. */
40
+ async publishServiceVersion(serviceId, filePath) {
41
+ await this.client.upload(`/public/api/api-deployer/services/${encodeURIComponent(serviceId)}/versions`, filePath);
42
+ }
43
+ /** Delete a published service version. */
44
+ async deleteServiceVersion(serviceId, version) {
45
+ await this.client.del(`/public/api/api-deployer/services/${encodeURIComponent(serviceId)}/versions/${encodeURIComponent(version)}`);
46
+ }
47
+ /** List API Deployer deployments. */
48
+ async listDeployments() {
49
+ return this.client.get("/public/api/api-deployer/deployments");
50
+ }
51
+ /** Create an API Deployer deployment. */
52
+ async createDeployment(body) {
53
+ return this.client.post("/public/api/api-deployer/deployments", body);
54
+ }
55
+ /** Get an API Deployer deployment. */
56
+ async getDeployment(deploymentId) {
57
+ return this.client.get(`/public/api/api-deployer/deployments/${encodeURIComponent(deploymentId)}`);
58
+ }
59
+ /** Get an API Deployer deployment's full status. */
60
+ async getDeploymentStatus(deploymentId) {
61
+ return this.client.get(`/public/api/api-deployer/deployments/${encodeURIComponent(deploymentId)}/status`);
62
+ }
63
+ /** Get API Deployer deployment settings. */
64
+ async getDeploymentSettings(deploymentId) {
65
+ return this.client.get(`/public/api/api-deployer/deployments/${encodeURIComponent(deploymentId)}/settings`);
66
+ }
67
+ /** Save API Deployer deployment settings. */
68
+ async saveDeploymentSettings(deploymentId, body) {
69
+ await this.client.putVoid(`/public/api/api-deployer/deployments/${encodeURIComponent(deploymentId)}/settings`, body);
70
+ }
71
+ /** Start an API Deployer deployment update. */
72
+ async startDeploymentUpdate(deploymentId) {
73
+ return this.client.post(`/public/api/api-deployer/deployments/${encodeURIComponent(deploymentId)}/actions/update`, {});
74
+ }
75
+ /** Delete an API Deployer deployment. */
76
+ async deleteDeployment(deploymentId) {
77
+ await this.client.del(`/public/api/api-deployer/deployments/${encodeURIComponent(deploymentId)}`);
78
+ }
79
+ }
@@ -0,0 +1,38 @@
1
+ import { BaseResource } from "./base.js";
2
+ export interface ApiServiceListItem extends Record<string, unknown> {
3
+ id?: string;
4
+ serviceId?: string;
5
+ name?: string;
6
+ }
7
+ export interface ApiServicePackageListItem extends Record<string, unknown> {
8
+ id?: string;
9
+ packageId?: string;
10
+ serviceId?: string;
11
+ }
12
+ export type ApiServiceActionResult = Record<string, unknown> | undefined;
13
+ export declare class ApiServicesResource extends BaseResource {
14
+ /** List API services in a project. */
15
+ list(projectKey?: string): Promise<ApiServiceListItem[]>;
16
+ /** Create an empty API service shell. */
17
+ create(serviceId: string, projectKey?: string): Promise<ApiServiceActionResult>;
18
+ /** Get API service settings, including endpoint definitions. */
19
+ 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>;
22
+ /** List deployable packages for an API service. */
23
+ listPackages(serviceId: string, projectKey?: string): Promise<ApiServicePackageListItem[]>;
24
+ /** Get an API service package summary. */
25
+ getPackageSummary(serviceId: string, packageId: string, projectKey?: string): Promise<Record<string, unknown>>;
26
+ /** Create a deployable package from the current service state. */
27
+ createPackage(serviceId: string, packageId: string, projectKey?: string): Promise<{
28
+ message: string;
29
+ }>;
30
+ /** Delete an API service package. */
31
+ deletePackage(serviceId: string, packageId: string, projectKey?: string): Promise<void>;
32
+ /** Download an API service package archive. */
33
+ downloadPackageArchive(serviceId: string, packageId: string, projectKey?: string): Promise<Response>;
34
+ /** Publish an API service package to the API Deployer. */
35
+ publishPackage(serviceId: string, packageId: string, projectKey?: string): Promise<ApiServiceActionResult>;
36
+ private servicePath;
37
+ private packagePath;
38
+ }
@@ -0,0 +1,50 @@
1
+ import { BaseResource, } from "./base.js";
2
+ export class ApiServicesResource extends BaseResource {
3
+ /** List API services in a project. */
4
+ async list(projectKey) {
5
+ return this.client.get(`/public/api/projects/${this.enc(projectKey)}/apiservices/`);
6
+ }
7
+ /** Create an empty API service shell. */
8
+ async create(serviceId, projectKey) {
9
+ return this.client.post(this.servicePath(serviceId, projectKey), {});
10
+ }
11
+ /** Get API service settings, including endpoint definitions. */
12
+ async getSettings(serviceId, projectKey) {
13
+ return this.client.get(`${this.servicePath(serviceId, projectKey)}/settings`);
14
+ }
15
+ /** Save API service settings. */
16
+ async saveSettings(serviceId, body, projectKey) {
17
+ return this.client.put(`${this.servicePath(serviceId, projectKey)}/settings`, body);
18
+ }
19
+ /** List deployable packages for an API service. */
20
+ async listPackages(serviceId, projectKey) {
21
+ return this.client.get(`${this.servicePath(serviceId, projectKey)}/packages`);
22
+ }
23
+ /** Get an API service package summary. */
24
+ async getPackageSummary(serviceId, packageId, projectKey) {
25
+ return this.client.get(`${this.packagePath(serviceId, packageId, projectKey)}/summary`);
26
+ }
27
+ /** Create a deployable package from the current service state. */
28
+ async createPackage(serviceId, packageId, projectKey) {
29
+ const message = await this.client.postText(this.packagePath(serviceId, packageId, projectKey), {});
30
+ return { message, };
31
+ }
32
+ /** Delete an API service package. */
33
+ async deletePackage(serviceId, packageId, projectKey) {
34
+ await this.client.del(this.packagePath(serviceId, packageId, projectKey));
35
+ }
36
+ /** Download an API service package archive. */
37
+ async downloadPackageArchive(serviceId, packageId, projectKey) {
38
+ return this.client.stream(`${this.packagePath(serviceId, packageId, projectKey)}/archive`);
39
+ }
40
+ /** Publish an API service package to the API Deployer. */
41
+ async publishPackage(serviceId, packageId, projectKey) {
42
+ return this.client.post(`${this.packagePath(serviceId, packageId, projectKey)}/publish`, {});
43
+ }
44
+ servicePath(serviceId, projectKey) {
45
+ return `/public/api/projects/${this.enc(projectKey)}/apiservices/${encodeURIComponent(serviceId)}`;
46
+ }
47
+ packagePath(serviceId, packageId, projectKey) {
48
+ return `${this.servicePath(serviceId, projectKey)}/packages/${encodeURIComponent(packageId)}`;
49
+ }
50
+ }