dataiku-sdk 0.8.0 → 0.10.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 +5 -4
- package/dist/src/cli.js +1668 -32
- package/dist/src/client.d.ts +61 -2
- package/dist/src/client.js +184 -5
- package/dist/src/index.d.ts +14 -1
- package/dist/src/index.js +13 -0
- package/dist/src/resources/api-deployer.d.ts +66 -0
- package/dist/src/resources/api-deployer.js +79 -0
- package/dist/src/resources/api-services.d.ts +38 -0
- package/dist/src/resources/api-services.js +50 -0
- package/dist/src/resources/applications.d.ts +56 -0
- package/dist/src/resources/applications.js +67 -0
- package/dist/src/resources/bundles.d.ts +53 -0
- package/dist/src/resources/bundles.js +103 -0
- package/dist/src/resources/continuous-activities.d.ts +27 -0
- package/dist/src/resources/continuous-activities.js +22 -0
- package/dist/src/resources/datasets.d.ts +6 -0
- package/dist/src/resources/datasets.js +15 -0
- package/dist/src/resources/discussions.d.ts +26 -0
- package/dist/src/resources/discussions.js +29 -0
- package/dist/src/resources/meanings.d.ts +41 -0
- package/dist/src/resources/meanings.js +33 -0
- package/dist/src/resources/metrics.d.ts +44 -0
- package/dist/src/resources/metrics.js +31 -0
- package/dist/src/resources/project-library.d.ts +38 -0
- package/dist/src/resources/project-library.js +82 -0
- package/dist/src/resources/projects.d.ts +70 -0
- package/dist/src/resources/projects.js +97 -0
- package/dist/src/resources/recipes.js +10 -8
- package/dist/src/resources/scenarios.d.ts +3 -0
- package/dist/src/resources/scenarios.js +8 -1
- package/dist/src/resources/statistics.d.ts +56 -0
- package/dist/src/resources/statistics.js +51 -0
- package/dist/src/resources/streaming-endpoints.d.ts +45 -0
- package/dist/src/resources/streaming-endpoints.js +36 -0
- package/dist/src/resources/webapps.d.ts +27 -0
- package/dist/src/resources/webapps.js +36 -0
- package/dist/src/resources/workspaces.d.ts +59 -0
- package/dist/src/resources/workspaces.js +31 -0
- package/dist/src/skill.js +6 -4
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BaseResource, } from "./base.js";
|
|
2
|
+
export class WebappsResource extends BaseResource {
|
|
3
|
+
/** List all webapps in a project. */
|
|
4
|
+
async list(projectKey) {
|
|
5
|
+
return this.client.get(`/public/api/projects/${this.enc(projectKey)}/webapps/`);
|
|
6
|
+
}
|
|
7
|
+
/** Get one webapp's settings. */
|
|
8
|
+
async getSettings(webappId, projectKey) {
|
|
9
|
+
const id = encodeURIComponent(webappId);
|
|
10
|
+
return this.client.get(`/public/api/projects/${this.enc(projectKey)}/webapps/${id}`);
|
|
11
|
+
}
|
|
12
|
+
/** Create a webapp. */
|
|
13
|
+
async create(body, projectKey) {
|
|
14
|
+
return this.client.post(`/public/api/projects/${this.enc(projectKey)}/webapps/`, body);
|
|
15
|
+
}
|
|
16
|
+
/** Update one webapp's settings. */
|
|
17
|
+
async updateSettings(webappId, body, projectKey) {
|
|
18
|
+
const id = encodeURIComponent(webappId);
|
|
19
|
+
return this.client.put(`/public/api/projects/${this.enc(projectKey)}/webapps/${id}`, body);
|
|
20
|
+
}
|
|
21
|
+
/** Stop a webapp backend. */
|
|
22
|
+
async stopBackend(webappId, projectKey) {
|
|
23
|
+
const id = encodeURIComponent(webappId);
|
|
24
|
+
await this.client.putVoid(`/public/api/projects/${this.enc(projectKey)}/webapps/${id}/backend/actions/stop`, {});
|
|
25
|
+
}
|
|
26
|
+
/** Start or restart a webapp backend. */
|
|
27
|
+
async startOrRestartBackend(webappId, projectKey) {
|
|
28
|
+
const id = encodeURIComponent(webappId);
|
|
29
|
+
await this.client.putVoid(`/public/api/projects/${this.enc(projectKey)}/webapps/${id}/backend/actions/restart`, {});
|
|
30
|
+
}
|
|
31
|
+
/** Get a webapp backend's state. */
|
|
32
|
+
async getBackendState(webappId, projectKey) {
|
|
33
|
+
const id = encodeURIComponent(webappId);
|
|
34
|
+
return this.client.get(`/public/api/projects/${this.enc(projectKey)}/webapps/${id}/backend/state`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { BaseResource } from "./base.js";
|
|
2
|
+
export type WorkspaceObjectReferenceType = "DATASET" | "ARTICLE" | "DASHBOARD" | (string & {});
|
|
3
|
+
export interface WorkspacePermissionItem extends Record<string, unknown> {
|
|
4
|
+
group?: string;
|
|
5
|
+
user?: string;
|
|
6
|
+
admin?: boolean;
|
|
7
|
+
write?: boolean;
|
|
8
|
+
read?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface WorkspaceListItem extends Record<string, unknown> {
|
|
11
|
+
workspaceKey?: string;
|
|
12
|
+
displayName?: string;
|
|
13
|
+
color?: string | null;
|
|
14
|
+
description?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface WorkspaceSettings extends WorkspaceListItem {
|
|
17
|
+
permissions?: WorkspacePermissionItem[] | null;
|
|
18
|
+
}
|
|
19
|
+
export interface WorkspaceCreateRequest extends Record<string, unknown> {
|
|
20
|
+
workspaceKey: string;
|
|
21
|
+
displayName: string;
|
|
22
|
+
color?: string | null;
|
|
23
|
+
description?: string | null;
|
|
24
|
+
permissions?: WorkspacePermissionItem[] | null;
|
|
25
|
+
}
|
|
26
|
+
export interface WorkspaceObjectReference extends Record<string, unknown> {
|
|
27
|
+
projectKey?: string;
|
|
28
|
+
type?: WorkspaceObjectReferenceType;
|
|
29
|
+
id?: string;
|
|
30
|
+
workspaceKey?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface WorkspaceHtmlLinkObject extends Record<string, unknown> {
|
|
33
|
+
name: string;
|
|
34
|
+
url: string;
|
|
35
|
+
description?: string | null;
|
|
36
|
+
}
|
|
37
|
+
export interface WorkspaceObject extends Record<string, unknown> {
|
|
38
|
+
id?: string;
|
|
39
|
+
reference?: WorkspaceObjectReference;
|
|
40
|
+
appId?: string;
|
|
41
|
+
htmlLink?: WorkspaceHtmlLinkObject;
|
|
42
|
+
}
|
|
43
|
+
export type WorkspaceObjectInput = WorkspaceObject;
|
|
44
|
+
export declare class WorkspacesResource extends BaseResource {
|
|
45
|
+
/** List workspaces visible to the API key. */
|
|
46
|
+
list(): Promise<WorkspaceListItem[]>;
|
|
47
|
+
/** Get workspace settings. */
|
|
48
|
+
get(workspaceKey: string): Promise<WorkspaceSettings>;
|
|
49
|
+
/** Create a workspace. DSS returns a text confirmation. */
|
|
50
|
+
create(body: WorkspaceCreateRequest): Promise<string>;
|
|
51
|
+
/** Replace workspace settings. */
|
|
52
|
+
updateSettings(workspaceKey: string, body: WorkspaceSettings): Promise<void>;
|
|
53
|
+
/** Delete a workspace. */
|
|
54
|
+
delete(workspaceKey: string): Promise<void>;
|
|
55
|
+
/** List objects in a workspace. */
|
|
56
|
+
listObjects(workspaceKey: string): Promise<WorkspaceObject[]>;
|
|
57
|
+
/** Add an object to a workspace. */
|
|
58
|
+
addObject(workspaceKey: string, object: WorkspaceObjectInput): Promise<WorkspaceObject>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseResource, } from "./base.js";
|
|
2
|
+
export class WorkspacesResource extends BaseResource {
|
|
3
|
+
/** List workspaces visible to the API key. */
|
|
4
|
+
async list() {
|
|
5
|
+
return this.client.get("/public/api/workspaces/");
|
|
6
|
+
}
|
|
7
|
+
/** Get workspace settings. */
|
|
8
|
+
async get(workspaceKey) {
|
|
9
|
+
return this.client.get(`/public/api/workspaces/${encodeURIComponent(workspaceKey)}`);
|
|
10
|
+
}
|
|
11
|
+
/** Create a workspace. DSS returns a text confirmation. */
|
|
12
|
+
async create(body) {
|
|
13
|
+
return this.client.postText("/public/api/workspaces/", body);
|
|
14
|
+
}
|
|
15
|
+
/** Replace workspace settings. */
|
|
16
|
+
async updateSettings(workspaceKey, body) {
|
|
17
|
+
await this.client.putVoid(`/public/api/workspaces/${encodeURIComponent(workspaceKey)}`, body);
|
|
18
|
+
}
|
|
19
|
+
/** Delete a workspace. */
|
|
20
|
+
async delete(workspaceKey) {
|
|
21
|
+
await this.client.del(`/public/api/workspaces/${encodeURIComponent(workspaceKey)}`);
|
|
22
|
+
}
|
|
23
|
+
/** List objects in a workspace. */
|
|
24
|
+
async listObjects(workspaceKey) {
|
|
25
|
+
return this.client.get(`/public/api/workspaces/${encodeURIComponent(workspaceKey)}/objects`);
|
|
26
|
+
}
|
|
27
|
+
/** Add an object to a workspace. */
|
|
28
|
+
async addObject(workspaceKey, object) {
|
|
29
|
+
return this.client.post(`/public/api/workspaces/${encodeURIComponent(workspaceKey)}/objects`, object);
|
|
30
|
+
}
|
|
31
|
+
}
|
package/dist/src/skill.js
CHANGED
|
@@ -11,8 +11,8 @@ If the installed \`dss\` binary is unavailable but the repository checkout is th
|
|
|
11
11
|
## Contract
|
|
12
12
|
|
|
13
13
|
- Success writes exactly one JSON result to stdout.
|
|
14
|
-
- Failure writes exactly one
|
|
15
|
-
- \`--verbose\`
|
|
14
|
+
- Failure writes exactly one JSONL error event to stderr with \`type:"error"\`, \`ok:false\`, \`error\`, \`code\`, and \`exitCode\`.
|
|
15
|
+
- Non-fatal warnings and \`--verbose\` HTTP traces are JSONL stderr events (\`type:"warning"\` / \`type:"trace"\`), never prose.
|
|
16
16
|
- No prompts, help screens, tables, banners, or prose output are part of the contract.
|
|
17
17
|
- Exit codes: 0 success, 1 usage/configuration error, 2 DSS or internal error, 3 transient/retryable DSS error, 4 completed command with failed long-running DSS work.
|
|
18
18
|
- \`--raw\` is the only stdout escape hatch: recipe payload commands emit raw bytes to stdout unless \`--output PATH\` is also set; with \`--output\`, stdout is the JSON string equal to \`PATH\` and the file receives exact raw bytes.
|
|
@@ -21,10 +21,11 @@ If the installed \`dss\` binary is unavailable but the repository checkout is th
|
|
|
21
21
|
## Discover commands
|
|
22
22
|
|
|
23
23
|
\`\`\`bash
|
|
24
|
+
dss agent contract
|
|
24
25
|
dss commands run
|
|
25
26
|
\`\`\`
|
|
26
27
|
|
|
27
|
-
The registry is the canonical schema for resources, actions, flags, positional arguments, side effects, auth requirements, output shape, idempotency, dry-run support, payload schemas, cleanup hints, and exit codes. Use it before choosing command syntax.
|
|
28
|
+
Use \`dss agent contract\` once to check \`agentContractVersion\`, stderr event schemas, non-JSON escape hatches, and compatibility rules. The command registry from \`dss commands run\` is the canonical schema for resources, actions, flags, positional arguments, side effects, auth requirements, output shape, idempotency, dry-run support, structured examples, payload schemas, unsafe outputs, cleanup hints, and exit codes. Use it before choosing command syntax.
|
|
28
29
|
Credential lookup order is flags first, then \`DATAIKU_*\` environment variables, then saved credentials.
|
|
29
30
|
Set \`DATAIKU_DISABLE_ENV=1\` when a test must ignore both \`.env\` files and \`DATAIKU_*\` environment variables.
|
|
30
31
|
When \`.env\` loading is enabled, the CLI reads \`.env\` from the command's current working directory first and then the CLI build/root directory; the invocation directory wins on conflicting keys. Put test-specific \`.env\` files in the directory where you invoke \`dss\`.
|
|
@@ -91,10 +92,11 @@ Mutations print a small JSON ack to stdout and exit 0 on success (e.g. \`{"updat
|
|
|
91
92
|
|
|
92
93
|
## Error envelope
|
|
93
94
|
|
|
94
|
-
Parse stderr as JSON
|
|
95
|
+
Parse each stderr line as JSON; on non-zero exit the final line is an error event:
|
|
95
96
|
|
|
96
97
|
\`\`\`json
|
|
97
98
|
{
|
|
99
|
+
"type": "error",
|
|
98
100
|
"ok": false,
|
|
99
101
|
"error": "Missing API key.",
|
|
100
102
|
"code": "usage_error",
|