dataiku-sdk 0.10.0 → 0.10.1

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.
@@ -13,6 +13,7 @@ export function dataikuErrorCode(category) {
13
13
  }
14
14
  }
15
15
  const TLS_CERTIFICATE_HINT = "TLS certificate verification failed. Trust the DSS/corporate CA with --ca-cert PATH or NODE_EXTRA_CA_CERTS; use --insecure only for temporary troubleshooting.";
16
+ const BUSINESS_APPS_API_UNAVAILABLE_HINT = "Business Apps API is not available on this DSS instance. Use classic app commands or check DSS version/feature availability.";
16
17
  function isCertificateTrustFailure(lowerBody) {
17
18
  return lowerBody.includes("unable to verify the first certificate")
18
19
  || lowerBody.includes("unable to get local issuer certificate")
@@ -25,6 +26,23 @@ function isCertificateTrustFailure(lowerBody) {
25
26
  || lowerBody.includes("err_tls_cert_altname_invalid")
26
27
  || (lowerBody.includes("certificate") && lowerBody.includes("verify"));
27
28
  }
29
+ function hasDelimitedPath(body, path) {
30
+ let index = body.indexOf(path);
31
+ while (index !== -1) {
32
+ const after = body[index + path.length];
33
+ if (after === undefined || after === "\n" || after === "\r" || after === " " || after === "\t"
34
+ || after === '"' || after === "'" || after === "`" || after === "}" || after === ")"
35
+ || after === "]")
36
+ return true;
37
+ index = body.indexOf(path, index + path.length);
38
+ }
39
+ return false;
40
+ }
41
+ function isBusinessAppsApiRootNotFound(lowerBody) {
42
+ return hasDelimitedPath(lowerBody, "/public/api/business-apps/")
43
+ || hasDelimitedPath(lowerBody, "/dip/publicapi/business-apps/")
44
+ || hasDelimitedPath(lowerBody, "/publicapi/business-apps/");
45
+ }
28
46
  export function classifyDataikuError(status, body) {
29
47
  const lowerBody = body.toLowerCase();
30
48
  if (status === 0) {
@@ -108,6 +126,13 @@ export function classifyDataikuError(status, body) {
108
126
  };
109
127
  }
110
128
  if (status === 404) {
129
+ if (isBusinessAppsApiRootNotFound(lowerBody)) {
130
+ return {
131
+ category: "not_found",
132
+ retryable: false,
133
+ retryHint: BUSINESS_APPS_API_UNAVAILABLE_HINT,
134
+ };
135
+ }
111
136
  const isHtmlGatewayResponse = lowerBody.includes("<!doctype html>");
112
137
  return {
113
138
  category: "not_found",
@@ -7,11 +7,11 @@ export class BundlesResource extends BaseResource {
7
7
  }
8
8
  /** Create or overwrite an exported Design-node bundle. */
9
9
  async exportBundle(bundleId, projectKey) {
10
- await this.client.putVoid(`/public/api/projects/${this.enc(projectKey)}/bundles/exported/?bundleId=${encodeURIComponent(bundleId)}`, {});
10
+ await this.client.putVoid(`/public/api/projects/${this.enc(projectKey)}/bundles/exported/${encodeURIComponent(bundleId)}`, {});
11
11
  }
12
12
  /** Delete an exported Design-node bundle. */
13
13
  async deleteExported(bundleId, projectKey) {
14
- await this.client.del(`/public/api/projects/${this.enc(projectKey)}/bundles/exported/?bundleId=${encodeURIComponent(bundleId)}`);
14
+ await this.client.del(`/public/api/projects/${this.enc(projectKey)}/bundles/exported/${encodeURIComponent(bundleId)}`);
15
15
  }
16
16
  /** Download an exported Design-node bundle archive. */
17
17
  async downloadExportedArchive(bundleId, projectKey) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dataiku-sdk",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Dataiku DSS SDK and CLI for programmatic access to DSS REST APIs",
5
5
  "type": "module",
6
6
  "workspaces": [