@botpress/api 0.39.0 → 0.39.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.
- package/dist/index.js +17 -7
- package/package.json +2 -2
- package/src/gen/openapi.json +1 -1
- package/src/gen/state.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -268809,7 +268809,7 @@ __export(src_exports, {
|
|
|
268809
268809
|
});
|
|
268810
268810
|
module.exports = __toCommonJS(src_exports);
|
|
268811
268811
|
|
|
268812
|
-
// ../../node_modules/.pnpm/@bpinternal+opapi@0.10.
|
|
268812
|
+
// ../../node_modules/.pnpm/@bpinternal+opapi@0.10.22_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
|
|
268813
268813
|
var import_zod_openapi = __toESM(require_src(), 1);
|
|
268814
268814
|
var import_zod_openapi2 = __toESM(require_src(), 1);
|
|
268815
268815
|
var import_path = __toESM(require("path"), 1);
|
|
@@ -268855,7 +268855,7 @@ var title = (str2) => {
|
|
|
268855
268855
|
return str2.split(/(?=[A-Z])|[\.\-\s_]/).map((s2) => s2.trim()).filter((s2) => !!s2).map((s2) => capitalize(s2.toLowerCase())).join(" ");
|
|
268856
268856
|
};
|
|
268857
268857
|
|
|
268858
|
-
// ../../node_modules/.pnpm/@bpinternal+opapi@0.10.
|
|
268858
|
+
// ../../node_modules/.pnpm/@bpinternal+opapi@0.10.22_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
|
|
268859
268859
|
var import_decompress = __toESM(require_decompress(), 1);
|
|
268860
268860
|
var import_fs3 = __toESM(require("fs"), 1);
|
|
268861
268861
|
var import_promises = __toESM(require("fs/promises"), 1);
|
|
@@ -272048,7 +272048,7 @@ var {
|
|
|
272048
272048
|
mergeConfig: mergeConfig2
|
|
272049
272049
|
} = axios_default;
|
|
272050
272050
|
|
|
272051
|
-
// ../../node_modules/.pnpm/@bpinternal+opapi@0.10.
|
|
272051
|
+
// ../../node_modules/.pnpm/@bpinternal+opapi@0.10.22_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
|
|
272052
272052
|
var import_json_schema_to_typescript = __toESM(require_src3(), 1);
|
|
272053
272053
|
var import_fs4 = __toESM(require("fs"), 1);
|
|
272054
272054
|
var import_path3 = __toESM(require("path"), 1);
|
|
@@ -276384,7 +276384,7 @@ async function openapiTS(schema3, options = {}) {
|
|
|
276384
276384
|
}
|
|
276385
276385
|
var dist_default = openapiTS;
|
|
276386
276386
|
|
|
276387
|
-
// ../../node_modules/.pnpm/@bpinternal+opapi@0.10.
|
|
276387
|
+
// ../../node_modules/.pnpm/@bpinternal+opapi@0.10.22_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
|
|
276388
276388
|
var import_openapi3_ts = __toESM(require_dist3(), 1);
|
|
276389
276389
|
var import_verror2 = __toESM(require_verror(), 1);
|
|
276390
276390
|
var import_verror3 = __toESM(require_verror(), 1);
|
|
@@ -280025,7 +280025,7 @@ var z = /* @__PURE__ */ Object.freeze({
|
|
|
280025
280025
|
ZodError
|
|
280026
280026
|
});
|
|
280027
280027
|
|
|
280028
|
-
// ../../node_modules/.pnpm/@bpinternal+opapi@0.10.
|
|
280028
|
+
// ../../node_modules/.pnpm/@bpinternal+opapi@0.10.22_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
|
|
280029
280029
|
var import_openapi_parser = __toESM(require_lib9(), 1);
|
|
280030
280030
|
var import_json_schema_to_typescript2 = __toESM(require_src3(), 1);
|
|
280031
280031
|
var import_zod_openapi4 = __toESM(require_src(), 1);
|
|
@@ -282304,6 +282304,7 @@ var exportJsonSchemas = (schemas) => async (outDir, opts = {}) => {
|
|
|
282304
282304
|
await import_promises4.default.writeFile(indexPath, indexCode);
|
|
282305
282305
|
};
|
|
282306
282306
|
var CONTENT2 = `import qs from 'qs'
|
|
282307
|
+
import { isAxiosError } from 'axios'
|
|
282307
282308
|
import { isApiError } from './errors'
|
|
282308
282309
|
import * as types from './typings'
|
|
282309
282310
|
|
|
@@ -282404,7 +282405,16 @@ export class Router {
|
|
|
282404
282405
|
}
|
|
282405
282406
|
|
|
282406
282407
|
const getErrorBody = (thrown: unknown) => {
|
|
282407
|
-
if (thrown
|
|
282408
|
+
if (isAxiosError(thrown)) {
|
|
282409
|
+
const data = thrown.response?.data
|
|
282410
|
+
const statusCode = thrown.response?.status
|
|
282411
|
+
|
|
282412
|
+
if (!data) {
|
|
282413
|
+
return \`\${thrown.message} (no response data) (Status Code: \${statusCode})\`
|
|
282414
|
+
}
|
|
282415
|
+
|
|
282416
|
+
return \`\${data.message || data.error?.message || data.error || data.body || thrown.message} (Status Code: \${statusCode})\`
|
|
282417
|
+
} else if (thrown instanceof Error) {
|
|
282408
282418
|
return thrown.message
|
|
282409
282419
|
}
|
|
282410
282420
|
try {
|
|
@@ -293785,7 +293795,7 @@ var state = {
|
|
|
293785
293795
|
"title": "Botpress API",
|
|
293786
293796
|
"description": "API for Botpress Cloud",
|
|
293787
293797
|
"server": "https://api.botpress.cloud",
|
|
293788
|
-
"version": "0.39.
|
|
293798
|
+
"version": "0.39.1",
|
|
293789
293799
|
"prefix": "v1"
|
|
293790
293800
|
},
|
|
293791
293801
|
"errors": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/api",
|
|
3
|
-
"version": "0.39.
|
|
3
|
+
"version": "0.39.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/src/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -23,6 +23,6 @@
|
|
|
23
23
|
"zod": "^3.22.4"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@bpinternal/opapi": "0.10.
|
|
26
|
+
"@bpinternal/opapi": "0.10.22"
|
|
27
27
|
}
|
|
28
28
|
}
|