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.
Files changed (41) hide show
  1. package/README.md +5 -4
  2. package/dist/src/cli.js +1668 -32
  3. package/dist/src/client.d.ts +61 -2
  4. package/dist/src/client.js +184 -5
  5. package/dist/src/index.d.ts +14 -1
  6. package/dist/src/index.js +13 -0
  7. package/dist/src/resources/api-deployer.d.ts +66 -0
  8. package/dist/src/resources/api-deployer.js +79 -0
  9. package/dist/src/resources/api-services.d.ts +38 -0
  10. package/dist/src/resources/api-services.js +50 -0
  11. package/dist/src/resources/applications.d.ts +56 -0
  12. package/dist/src/resources/applications.js +67 -0
  13. package/dist/src/resources/bundles.d.ts +53 -0
  14. package/dist/src/resources/bundles.js +103 -0
  15. package/dist/src/resources/continuous-activities.d.ts +27 -0
  16. package/dist/src/resources/continuous-activities.js +22 -0
  17. package/dist/src/resources/datasets.d.ts +6 -0
  18. package/dist/src/resources/datasets.js +15 -0
  19. package/dist/src/resources/discussions.d.ts +26 -0
  20. package/dist/src/resources/discussions.js +29 -0
  21. package/dist/src/resources/meanings.d.ts +41 -0
  22. package/dist/src/resources/meanings.js +33 -0
  23. package/dist/src/resources/metrics.d.ts +44 -0
  24. package/dist/src/resources/metrics.js +31 -0
  25. package/dist/src/resources/project-library.d.ts +38 -0
  26. package/dist/src/resources/project-library.js +82 -0
  27. package/dist/src/resources/projects.d.ts +70 -0
  28. package/dist/src/resources/projects.js +97 -0
  29. package/dist/src/resources/recipes.js +10 -8
  30. package/dist/src/resources/scenarios.d.ts +3 -0
  31. package/dist/src/resources/scenarios.js +8 -1
  32. package/dist/src/resources/statistics.d.ts +56 -0
  33. package/dist/src/resources/statistics.js +51 -0
  34. package/dist/src/resources/streaming-endpoints.d.ts +45 -0
  35. package/dist/src/resources/streaming-endpoints.js +36 -0
  36. package/dist/src/resources/webapps.d.ts +27 -0
  37. package/dist/src/resources/webapps.js +36 -0
  38. package/dist/src/resources/workspaces.d.ts +59 -0
  39. package/dist/src/resources/workspaces.js +31 -0
  40. package/dist/src/skill.js +6 -4
  41. package/package.json +1 -1
@@ -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
+ }
@@ -0,0 +1,56 @@
1
+ import { BaseResource } from "./base.js";
2
+ export interface AppListItem extends Record<string, unknown> {
3
+ appId?: string;
4
+ projectKey?: string;
5
+ name?: string;
6
+ }
7
+ export interface AppInstanceRef extends Record<string, unknown> {
8
+ appId?: string;
9
+ projectKey?: string;
10
+ jobId?: string;
11
+ }
12
+ export interface BusinessAppListItem extends Record<string, unknown> {
13
+ id?: string;
14
+ projectKey?: string;
15
+ name?: string;
16
+ }
17
+ export interface BusinessAppInstanceUserPermissions extends Record<string, unknown> {
18
+ login?: string;
19
+ admin?: boolean;
20
+ readProjectContent?: boolean;
21
+ writeProjectContent?: boolean;
22
+ }
23
+ export declare class ApplicationsResource extends BaseResource {
24
+ /** List all Dataiku Apps. */
25
+ listApps(): Promise<AppListItem[]>;
26
+ /** Get the manifest for a Dataiku App template. */
27
+ getAppManifest(appId: string): Promise<Record<string, unknown>>;
28
+ /** List instances created from a Dataiku App template. */
29
+ listInstances(appId: string): Promise<AppInstanceRef[]>;
30
+ /** Create an instance from a Dataiku App template. */
31
+ createInstance(appId: string, body: Record<string, unknown>): Promise<AppInstanceRef>;
32
+ /** Get the manifest for an app instance project. */
33
+ getInstanceManifest(projectKey?: string): Promise<Record<string, unknown>>;
34
+ /** Save the manifest for an app instance project. */
35
+ saveInstanceManifest(manifest: Record<string, unknown>, projectKey?: string): Promise<void>;
36
+ /** Delete an app instance project. */
37
+ deleteInstance(projectKey?: string): Promise<void>;
38
+ /** List all Business Apps. */
39
+ listBusinessApps(): Promise<BusinessAppListItem[]>;
40
+ /** Get Business App details. */
41
+ getBusinessApp(id: string): Promise<Record<string, unknown>>;
42
+ /** Get Business App settings. */
43
+ getBusinessAppSettings(id: string): Promise<Record<string, unknown>>;
44
+ /** Save Business App settings. */
45
+ saveBusinessAppSettings(id: string, body: Record<string, unknown>): Promise<void>;
46
+ /** List instances of a Business App. */
47
+ listBusinessAppInstances(id: string): Promise<AppInstanceRef[]>;
48
+ /** Create an instance of a Business App. */
49
+ createBusinessAppInstance(id: string, body: Record<string, unknown>): Promise<AppInstanceRef>;
50
+ /** Upgrade a Business App instance to the latest version. */
51
+ upgradeBusinessAppInstance(id: string, projectKey: string): Promise<AppInstanceRef>;
52
+ /** Get a user's effective permissions on a Business App instance. */
53
+ getBusinessAppInstanceUserPermissions(id: string, projectKey: string, user: string): Promise<BusinessAppInstanceUserPermissions>;
54
+ /** Install or upgrade a Business App from an archive. */
55
+ installBusinessAppFromArchive(filePath: string): Promise<void>;
56
+ }
@@ -0,0 +1,67 @@
1
+ import { BaseResource, } from "./base.js";
2
+ export class ApplicationsResource extends BaseResource {
3
+ /** List all Dataiku Apps. */
4
+ async listApps() {
5
+ return this.client.get("/public/api/apps/");
6
+ }
7
+ /** Get the manifest for a Dataiku App template. */
8
+ async getAppManifest(appId) {
9
+ return this.client.get(`/public/api/apps/${encodeURIComponent(appId)}/`);
10
+ }
11
+ /** List instances created from a Dataiku App template. */
12
+ async listInstances(appId) {
13
+ return this.client.get(`/public/api/apps/${encodeURIComponent(appId)}/instances/`);
14
+ }
15
+ /** Create an instance from a Dataiku App template. */
16
+ async createInstance(appId, body) {
17
+ return this.client.post(`/public/api/apps/${encodeURIComponent(appId)}/instances`, body);
18
+ }
19
+ /** Get the manifest for an app instance project. */
20
+ async getInstanceManifest(projectKey) {
21
+ return this.client.get(`/public/api/projects/${this.enc(projectKey)}/app-manifest`);
22
+ }
23
+ /** Save the manifest for an app instance project. */
24
+ async saveInstanceManifest(manifest, projectKey) {
25
+ await this.client.putVoid(`/public/api/projects/${this.enc(projectKey)}/app-manifest`, manifest);
26
+ }
27
+ /** Delete an app instance project. */
28
+ async deleteInstance(projectKey) {
29
+ await this.client.del(`/public/api/projects/${this.enc(projectKey)}`);
30
+ }
31
+ /** List all Business Apps. */
32
+ async listBusinessApps() {
33
+ return this.client.get("/public/api/business-apps/");
34
+ }
35
+ /** Get Business App details. */
36
+ async getBusinessApp(id) {
37
+ return this.client.get(`/public/api/business-apps/${encodeURIComponent(id)}`);
38
+ }
39
+ /** Get Business App settings. */
40
+ async getBusinessAppSettings(id) {
41
+ return this.client.get(`/public/api/business-apps/${encodeURIComponent(id)}/settings`);
42
+ }
43
+ /** Save Business App settings. */
44
+ async saveBusinessAppSettings(id, body) {
45
+ await this.client.putVoid(`/public/api/business-apps/${encodeURIComponent(id)}/settings`, body);
46
+ }
47
+ /** List instances of a Business App. */
48
+ async listBusinessAppInstances(id) {
49
+ return this.client.get(`/public/api/business-apps/${encodeURIComponent(id)}/instances`);
50
+ }
51
+ /** Create an instance of a Business App. */
52
+ async createBusinessAppInstance(id, body) {
53
+ return this.client.post(`/public/api/business-apps/${encodeURIComponent(id)}/instances`, body);
54
+ }
55
+ /** Upgrade a Business App instance to the latest version. */
56
+ async upgradeBusinessAppInstance(id, projectKey) {
57
+ return this.client.post(`/public/api/business-apps/${encodeURIComponent(id)}/instances/${encodeURIComponent(projectKey)}/upgrade`, {});
58
+ }
59
+ /** Get a user's effective permissions on a Business App instance. */
60
+ async getBusinessAppInstanceUserPermissions(id, projectKey, user) {
61
+ return this.client.get(`/public/api/business-apps/${encodeURIComponent(id)}/instances/${encodeURIComponent(projectKey)}/permissions/${encodeURIComponent(user)}`);
62
+ }
63
+ /** Install or upgrade a Business App from an archive. */
64
+ async installBusinessAppFromArchive(filePath) {
65
+ await this.client.upload("/public/api/business-apps/install-from-archive", filePath);
66
+ }
67
+ }
@@ -0,0 +1,53 @@
1
+ import { BaseResource } from "./base.js";
2
+ export declare class BundlesResource extends BaseResource {
3
+ /** List bundles exported from a project on the Design node. */
4
+ listExported(projectKey?: string): Promise<Record<string, unknown>[]>;
5
+ /** Create or overwrite an exported Design-node bundle. */
6
+ exportBundle(bundleId: string, projectKey?: string): Promise<void>;
7
+ /** Delete an exported Design-node bundle. */
8
+ deleteExported(bundleId: string, projectKey?: string): Promise<void>;
9
+ /** Download an exported Design-node bundle archive. */
10
+ downloadExportedArchive(bundleId: string, projectKey?: string): Promise<Response>;
11
+ /** Publish a Design-node bundle to the Project Deployer. */
12
+ publish(bundleId: string, projectKey?: string): Promise<Record<string, unknown>>;
13
+ /** List bundles imported into a project on the Automation node. */
14
+ listImported(projectKey?: string): Promise<Record<string, unknown>[]>;
15
+ /** Import a server-side bundle archive into an Automation-node project. */
16
+ importFromArchive(archivePath: string, projectKey?: string): Promise<Record<string, unknown>>;
17
+ /** Import a local bundle archive stream into an Automation-node project. */
18
+ importFromStream(filePath: string, projectKey?: string): Promise<void>;
19
+ /** Activate an imported Automation-node bundle. */
20
+ activate(bundleId: string, projectKey?: string): Promise<Record<string, unknown>>;
21
+ /** Preload an imported Automation-node bundle. */
22
+ preload(bundleId: string, projectKey?: string): Promise<Record<string, unknown>>;
23
+ /** Delete an imported Automation-node bundle. */
24
+ deleteImported(bundleId: string, projectKey?: string): Promise<void>;
25
+ }
26
+ export declare class ProjectDeployerResource extends BaseResource {
27
+ /** List published projects in the Project Deployer. */
28
+ listProjects(): Promise<Record<string, unknown>[]>;
29
+ /** Create a Project Deployer published project. */
30
+ createProject(body: Record<string, unknown>): Promise<Record<string, unknown>>;
31
+ /** Upload a project bundle archive to the Project Deployer. */
32
+ uploadBundle(filePath: string): Promise<void>;
33
+ /** Get a Project Deployer published project's status. */
34
+ getProjectStatus(publishedProjectKey: string): Promise<Record<string, unknown>>;
35
+ /** List Project Deployer deployments. */
36
+ listDeployments(): Promise<Record<string, unknown>[]>;
37
+ /** Create a Project Deployer deployment. */
38
+ createDeployment(body: Record<string, unknown>): Promise<Record<string, unknown>>;
39
+ /** Get a Project Deployer deployment. */
40
+ getDeployment(deploymentId: string): Promise<Record<string, unknown>>;
41
+ /** Get a Project Deployer deployment's full status. */
42
+ getDeploymentStatus(deploymentId: string): Promise<Record<string, unknown>>;
43
+ /** Save Project Deployer deployment settings. */
44
+ saveDeploymentSettings(deploymentId: string, body: Record<string, unknown>): Promise<void>;
45
+ /** Start a Project Deployer deployment update. */
46
+ startUpdate(deploymentId: string): Promise<Record<string, unknown>>;
47
+ /** Delete a Project Deployer deployment. */
48
+ deleteDeployment(deploymentId: string): Promise<void>;
49
+ /** List Project Deployer infrastructures. */
50
+ listInfras(): Promise<Record<string, unknown>[]>;
51
+ /** Create a Project Deployer infrastructure. */
52
+ createInfra(body: Record<string, unknown>): Promise<Record<string, unknown>>;
53
+ }
@@ -0,0 +1,103 @@
1
+ import { BaseResource, } from "./base.js";
2
+ export class BundlesResource extends BaseResource {
3
+ /** List bundles exported from a project on the Design node. */
4
+ async listExported(projectKey) {
5
+ const res = await this.client.get(`/public/api/projects/${this.enc(projectKey)}/bundles/exported`);
6
+ return res.bundles ?? [];
7
+ }
8
+ /** Create or overwrite an exported Design-node bundle. */
9
+ async exportBundle(bundleId, projectKey) {
10
+ await this.client.putVoid(`/public/api/projects/${this.enc(projectKey)}/bundles/exported/?bundleId=${encodeURIComponent(bundleId)}`, {});
11
+ }
12
+ /** Delete an exported Design-node bundle. */
13
+ async deleteExported(bundleId, projectKey) {
14
+ await this.client.del(`/public/api/projects/${this.enc(projectKey)}/bundles/exported/?bundleId=${encodeURIComponent(bundleId)}`);
15
+ }
16
+ /** Download an exported Design-node bundle archive. */
17
+ async downloadExportedArchive(bundleId, projectKey) {
18
+ return this.client.stream(`/public/api/projects/${this.enc(projectKey)}/bundles/exported/${encodeURIComponent(bundleId)}/archive`);
19
+ }
20
+ /** Publish a Design-node bundle to the Project Deployer. */
21
+ async publish(bundleId, projectKey) {
22
+ return this.client.post(`/public/api/projects/${this.enc(projectKey)}/bundles/${encodeURIComponent(bundleId)}/publish`, {});
23
+ }
24
+ /** List bundles imported into a project on the Automation node. */
25
+ async listImported(projectKey) {
26
+ const res = await this.client.get(`/public/api/projects/${this.enc(projectKey)}/bundles/imported`);
27
+ return res.bundles ?? [];
28
+ }
29
+ /** Import a server-side bundle archive into an Automation-node project. */
30
+ async importFromArchive(archivePath, projectKey) {
31
+ return this.client.post(`/public/api/projects/${this.enc(projectKey)}/bundles/imported/actions/importFromArchive?archivePath=${encodeURIComponent(archivePath)}`, {});
32
+ }
33
+ /** Import a local bundle archive stream into an Automation-node project. */
34
+ async importFromStream(filePath, projectKey) {
35
+ await this.client.upload(`/public/api/projects/${this.enc(projectKey)}/bundles/imported/actions/importFromStream`, filePath);
36
+ }
37
+ /** Activate an imported Automation-node bundle. */
38
+ async activate(bundleId, projectKey) {
39
+ return this.client.post(`/public/api/projects/${this.enc(projectKey)}/bundles/imported/${encodeURIComponent(bundleId)}/actions/activate`, {});
40
+ }
41
+ /** Preload an imported Automation-node bundle. */
42
+ async preload(bundleId, projectKey) {
43
+ return this.client.post(`/public/api/projects/${this.enc(projectKey)}/bundles/imported/${encodeURIComponent(bundleId)}/actions/preload`, {});
44
+ }
45
+ /** Delete an imported Automation-node bundle. */
46
+ async deleteImported(bundleId, projectKey) {
47
+ await this.client.del(`/public/api/projects/${this.enc(projectKey)}/bundles/imported/${encodeURIComponent(bundleId)}`);
48
+ }
49
+ }
50
+ export class ProjectDeployerResource extends BaseResource {
51
+ /** List published projects in the Project Deployer. */
52
+ async listProjects() {
53
+ return this.client.get("/public/api/project-deployer/projects");
54
+ }
55
+ /** Create a Project Deployer published project. */
56
+ async createProject(body) {
57
+ return this.client.post("/public/api/project-deployer/projects", body);
58
+ }
59
+ /** Upload a project bundle archive to the Project Deployer. */
60
+ async uploadBundle(filePath) {
61
+ await this.client.upload("/public/api/project-deployer/projects/bundles", filePath);
62
+ }
63
+ /** Get a Project Deployer published project's status. */
64
+ async getProjectStatus(publishedProjectKey) {
65
+ return this.client.get(`/public/api/project-deployer/projects/${encodeURIComponent(publishedProjectKey)}`);
66
+ }
67
+ /** List Project Deployer deployments. */
68
+ async listDeployments() {
69
+ return this.client.get("/public/api/project-deployer/deployments");
70
+ }
71
+ /** Create a Project Deployer deployment. */
72
+ async createDeployment(body) {
73
+ return this.client.post("/public/api/project-deployer/deployments", body);
74
+ }
75
+ /** Get a Project Deployer deployment. */
76
+ async getDeployment(deploymentId) {
77
+ return this.client.get(`/public/api/project-deployer/deployments/${encodeURIComponent(deploymentId)}`);
78
+ }
79
+ /** Get a Project Deployer deployment's full status. */
80
+ async getDeploymentStatus(deploymentId) {
81
+ return this.client.get(`/public/api/project-deployer/deployments/${encodeURIComponent(deploymentId)}/status`);
82
+ }
83
+ /** Save Project Deployer deployment settings. */
84
+ async saveDeploymentSettings(deploymentId, body) {
85
+ await this.client.putVoid(`/public/api/project-deployer/deployments/${encodeURIComponent(deploymentId)}/settings`, body);
86
+ }
87
+ /** Start a Project Deployer deployment update. */
88
+ async startUpdate(deploymentId) {
89
+ return this.client.post(`/public/api/project-deployer/deployments/${encodeURIComponent(deploymentId)}/actions/update`, {});
90
+ }
91
+ /** Delete a Project Deployer deployment. */
92
+ async deleteDeployment(deploymentId) {
93
+ await this.client.del(`/public/api/project-deployer/deployments/${encodeURIComponent(deploymentId)}`);
94
+ }
95
+ /** List Project Deployer infrastructures. */
96
+ async listInfras() {
97
+ return this.client.get("/public/api/project-deployer/infras");
98
+ }
99
+ /** Create a Project Deployer infrastructure. */
100
+ async createInfra(body) {
101
+ return this.client.post("/public/api/project-deployer/infras", body);
102
+ }
103
+ }
@@ -0,0 +1,27 @@
1
+ import { BaseResource } from "./base.js";
2
+ export interface ContinuousActivityListItem extends Record<string, unknown> {
3
+ projectKey: string;
4
+ recipeId: string;
5
+ }
6
+ export interface ContinuousActivityLoopParams extends Record<string, unknown> {
7
+ abortAfterCrashes?: number;
8
+ initialRestartDelayMS?: number;
9
+ restartDelayIncMS?: number;
10
+ maxRestartDelayMS?: number;
11
+ }
12
+ export interface ContinuousActivityStatus extends Record<string, unknown> {
13
+ desiredState?: string;
14
+ mainLoopState?: Record<string, unknown> | null;
15
+ }
16
+ export type ContinuousActivityStartResult = Record<string, unknown>;
17
+ export declare class ContinuousActivitiesResource extends BaseResource {
18
+ /** List continuous activities in a project, including their definitions and states. */
19
+ list(projectKey?: string): Promise<ContinuousActivityListItem[]>;
20
+ /** Get the current status of a continuous recipe activity. */
21
+ getStatus(recipeId: string, projectKey?: string): Promise<ContinuousActivityStatus>;
22
+ /** Start a continuous recipe activity. */
23
+ start(recipeId: string, loop?: ContinuousActivityLoopParams, projectKey?: string): Promise<ContinuousActivityStartResult>;
24
+ /** Stop a continuous recipe activity. */
25
+ stop(recipeId: string, projectKey?: string): Promise<void>;
26
+ private activityPath;
27
+ }
@@ -0,0 +1,22 @@
1
+ import { BaseResource, } from "./base.js";
2
+ export class ContinuousActivitiesResource extends BaseResource {
3
+ /** List continuous activities in a project, including their definitions and states. */
4
+ async list(projectKey) {
5
+ return this.client.get(`/public/api/projects/${this.enc(projectKey)}/continuous-activities/`);
6
+ }
7
+ /** Get the current status of a continuous recipe activity. */
8
+ async getStatus(recipeId, projectKey) {
9
+ return this.client.get(`${this.activityPath(recipeId, projectKey)}/`);
10
+ }
11
+ /** Start a continuous recipe activity. */
12
+ async start(recipeId, loop, projectKey) {
13
+ return this.client.post(`${this.activityPath(recipeId, projectKey)}/start`, loop ?? {});
14
+ }
15
+ /** Stop a continuous recipe activity. */
16
+ async stop(recipeId, projectKey) {
17
+ await this.client.postText(`${this.activityPath(recipeId, projectKey)}/stop`);
18
+ }
19
+ activityPath(recipeId, projectKey) {
20
+ return `/public/api/projects/${this.enc(projectKey)}/continuous-activities/${encodeURIComponent(recipeId)}`;
21
+ }
22
+ }
@@ -105,4 +105,10 @@ export declare class DatasetsResource extends BaseResource {
105
105
  update(datasetName: string, data: Record<string, unknown>, projectKey?: string): Promise<void>;
106
106
  /** Delete a dataset. */
107
107
  delete(datasetName: string, projectKey?: string): Promise<void>;
108
+ /** List all partitions of a partitioned dataset. */
109
+ listPartitions(datasetName: string, projectKey?: string): Promise<string[]>;
110
+ /** Clear a dataset's data. Omit `partitions` to clear the whole dataset. */
111
+ clear(datasetName: string, partitions?: string, projectKey?: string): Promise<void>;
112
+ /** Rename a dataset, updating downstream flow references. */
113
+ rename(oldName: string, newName: string, projectKey?: string): Promise<void>;
108
114
  }
@@ -552,4 +552,19 @@ export class DatasetsResource extends BaseResource {
552
552
  const dsEnc = encodeURIComponent(datasetName);
553
553
  await this.client.del(`/public/api/projects/${this.enc(projectKey)}/datasets/${dsEnc}`);
554
554
  }
555
+ /** List all partitions of a partitioned dataset. */
556
+ async listPartitions(datasetName, projectKey) {
557
+ const dsEnc = encodeURIComponent(datasetName);
558
+ return this.client.get(`/public/api/projects/${this.enc(projectKey)}/datasets/${dsEnc}/partitions`);
559
+ }
560
+ /** Clear a dataset's data. Omit `partitions` to clear the whole dataset. */
561
+ async clear(datasetName, partitions, projectKey) {
562
+ const dsEnc = encodeURIComponent(datasetName);
563
+ const query = partitions ? `?partitions=${encodeURIComponent(partitions)}` : "";
564
+ await this.client.del(`/public/api/projects/${this.enc(projectKey)}/datasets/${dsEnc}/data${query}`);
565
+ }
566
+ /** Rename a dataset, updating downstream flow references. */
567
+ async rename(oldName, newName, projectKey) {
568
+ await this.client.postText(`/public/api/projects/${this.enc(projectKey)}/actions/renameDataset`, { oldName, newName, });
569
+ }
555
570
  }
@@ -0,0 +1,26 @@
1
+ import { BaseResource } from "./base.js";
2
+ export interface DiscussionReply {
3
+ text: string;
4
+ author?: string;
5
+ time?: number;
6
+ editedOn?: number;
7
+ [key: string]: unknown;
8
+ }
9
+ export interface Discussion {
10
+ id: string;
11
+ topic?: string;
12
+ replies?: DiscussionReply[];
13
+ [key: string]: unknown;
14
+ }
15
+ export declare class DiscussionsResource extends BaseResource {
16
+ /** List discussions attached to a project object. */
17
+ list(objectType: string, objectId: string, projectKey?: string): Promise<Discussion[]>;
18
+ /** Get one discussion attached to a project object, including replies. */
19
+ get(objectType: string, objectId: string, discussionId: string, projectKey?: string): Promise<Discussion>;
20
+ /** Create a discussion with its first reply. */
21
+ create(objectType: string, objectId: string, topic: string, reply: string, projectKey?: string): Promise<Discussion>;
22
+ /** Add a reply to an existing discussion. */
23
+ reply(objectType: string, objectId: string, discussionId: string, text: string, projectKey?: string): Promise<Discussion>;
24
+ private objectDiscussionsPath;
25
+ private discussionPath;
26
+ }
@@ -0,0 +1,29 @@
1
+ import { BaseResource, } from "./base.js";
2
+ export class DiscussionsResource extends BaseResource {
3
+ /** List discussions attached to a project object. */
4
+ async list(objectType, objectId, projectKey) {
5
+ return this.client.get(this.objectDiscussionsPath(objectType, objectId, projectKey));
6
+ }
7
+ /** Get one discussion attached to a project object, including replies. */
8
+ async get(objectType, objectId, discussionId, projectKey) {
9
+ return this.client.get(this.discussionPath(objectType, objectId, discussionId, projectKey));
10
+ }
11
+ /** Create a discussion with its first reply. */
12
+ async create(objectType, objectId, topic, reply, projectKey) {
13
+ return this.client.post(this.objectDiscussionsPath(objectType, objectId, projectKey), { topic, reply, });
14
+ }
15
+ /** Add a reply to an existing discussion. */
16
+ async reply(objectType, objectId, discussionId, text, projectKey) {
17
+ return this.client.post(`${this.discussionPath(objectType, objectId, discussionId, projectKey)}/replies/`, { reply: text, });
18
+ }
19
+ objectDiscussionsPath(objectType, objectId, projectKey) {
20
+ const pk = this.enc(projectKey);
21
+ const encodedType = encodeURIComponent(objectType);
22
+ const encodedId = encodeURIComponent(objectId);
23
+ return `/public/api/projects/${pk}/discussions/${encodedType}/${encodedId}/`;
24
+ }
25
+ discussionPath(objectType, objectId, discussionId, projectKey) {
26
+ const collectionPath = this.objectDiscussionsPath(objectType, objectId, projectKey);
27
+ return `${collectionPath}${encodeURIComponent(discussionId)}`;
28
+ }
29
+ }
@@ -0,0 +1,41 @@
1
+ import { BaseResource } from "./base.js";
2
+ export type MeaningType = "DECLARATIVE" | "VALUES_LIST" | "VALUES_MAPPING" | "PATTERN" | (string & {});
3
+ export type MeaningNormalizationMode = "EXACT" | "LOWERCASE" | "NORMALIZED" | (string & {});
4
+ export interface MeaningEntry extends Record<string, unknown> {
5
+ value?: unknown;
6
+ color?: string | null;
7
+ }
8
+ export interface MeaningMapping extends Record<string, unknown> {
9
+ from?: unknown;
10
+ to?: MeaningEntry | null;
11
+ }
12
+ export interface MeaningDefinition extends Record<string, unknown> {
13
+ id?: string;
14
+ label?: string;
15
+ type?: MeaningType;
16
+ description?: string | null;
17
+ entries?: MeaningEntry[] | null;
18
+ mappings?: MeaningMapping[] | null;
19
+ pattern?: string | null;
20
+ normalizationMode?: MeaningNormalizationMode | null;
21
+ detectable?: boolean;
22
+ }
23
+ export interface MeaningCreateBody extends Record<string, unknown> {
24
+ description?: string | null;
25
+ entries?: MeaningEntry[] | null;
26
+ mappings?: MeaningMapping[] | null;
27
+ pattern?: string | null;
28
+ normalizationMode?: MeaningNormalizationMode | null;
29
+ detectable?: boolean;
30
+ }
31
+ export declare class MeaningsResource extends BaseResource {
32
+ /** List all user-defined meanings on the DSS instance. */
33
+ list(): Promise<MeaningDefinition[]>;
34
+ /** Get a user-defined meaning definition. */
35
+ get(meaningId: string): Promise<MeaningDefinition>;
36
+ /** Create a user-defined meaning. DSS returns a text confirmation. */
37
+ create(id: string, label: string, type: MeaningType, body?: MeaningCreateBody): Promise<string>;
38
+ /** Replace a user-defined meaning definition. */
39
+ update(meaningId: string, body: MeaningDefinition): Promise<MeaningDefinition>;
40
+ private meaningPath;
41
+ }
@@ -0,0 +1,33 @@
1
+ import { BaseResource, } from "./base.js";
2
+ export class MeaningsResource extends BaseResource {
3
+ /** List all user-defined meanings on the DSS instance. */
4
+ async list() {
5
+ return this.client.get("/public/api/meanings/");
6
+ }
7
+ /** Get a user-defined meaning definition. */
8
+ async get(meaningId) {
9
+ return this.client.get(this.meaningPath(meaningId));
10
+ }
11
+ /** Create a user-defined meaning. DSS returns a text confirmation. */
12
+ async create(id, label, type, body = {}) {
13
+ return this.client.postText("/public/api/meanings/", {
14
+ ...body,
15
+ id,
16
+ label,
17
+ type,
18
+ description: body.description ?? null,
19
+ entries: body.entries ?? null,
20
+ mappings: body.mappings ?? null,
21
+ pattern: body.pattern ?? null,
22
+ normalizationMode: body.normalizationMode ?? null,
23
+ detectable: body.detectable ?? false,
24
+ });
25
+ }
26
+ /** Replace a user-defined meaning definition. */
27
+ async update(meaningId, body) {
28
+ return this.client.put(this.meaningPath(meaningId), body);
29
+ }
30
+ meaningPath(meaningId) {
31
+ return `/public/api/meanings/${encodeURIComponent(meaningId)}`;
32
+ }
33
+ }
@@ -0,0 +1,44 @@
1
+ import { BaseResource } from "./base.js";
2
+ export interface MetricDescriptor {
3
+ id: string;
4
+ [key: string]: unknown;
5
+ }
6
+ export interface MetricLastValue {
7
+ partition?: string;
8
+ value?: string | number | boolean | null;
9
+ dataType?: string;
10
+ [key: string]: unknown;
11
+ }
12
+ export interface MetricWithLastValues {
13
+ metric: MetricDescriptor;
14
+ lastValues: MetricLastValue[];
15
+ [key: string]: unknown;
16
+ }
17
+ export interface MetricValues {
18
+ metrics: MetricWithLastValues[];
19
+ [key: string]: unknown;
20
+ }
21
+ export interface MetricHistoryValue {
22
+ time?: number;
23
+ value?: string | number | boolean | null;
24
+ dataType?: string;
25
+ [key: string]: unknown;
26
+ }
27
+ export interface MetricHistory {
28
+ metricId?: string;
29
+ values: MetricHistoryValue[];
30
+ [key: string]: unknown;
31
+ }
32
+ export interface MetricComputationReport {
33
+ [key: string]: unknown;
34
+ }
35
+ export declare class MetricsResource extends BaseResource {
36
+ /** Get the last metric values for a dataset's global partition. */
37
+ getDatasetMetrics(datasetName: string, projectKey?: string): Promise<MetricValues>;
38
+ /** Compute the dataset metrics configured in DSS for the default partition. */
39
+ computeDatasetMetrics(datasetName: string, projectKey?: string): Promise<MetricComputationReport>;
40
+ /** Get the last metric values for a managed folder. */
41
+ getFolderMetrics(folderId: string, projectKey?: string): Promise<MetricValues>;
42
+ /** Get the metric history for a dataset's global partition. */
43
+ getDatasetMetricHistory(datasetName: string, metricId: string, projectKey?: string): Promise<MetricHistory>;
44
+ }