@botpress/api 0.38.3 → 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 +24 -9
- package/dist/src/gen/state.d.ts +5 -0
- package/package.json +2 -2
- package/src/gen/openapi.json +1 -1
- package/src/gen/state.ts +8 -3
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 {
|
|
@@ -292050,7 +292060,7 @@ var state = {
|
|
|
292050
292060
|
"expiresAt": {
|
|
292051
292061
|
"type": "string",
|
|
292052
292062
|
"format": "date-time",
|
|
292053
|
-
"description": "Expiry timestamp in ISO 8601 format with UTC timezone. After expiry, the File will be deleted. Must be in the future. Cannot be more than
|
|
292063
|
+
"description": "Expiry timestamp in ISO 8601 format with UTC timezone. After expiry, the File will be deleted. Must be in the future. Cannot be more than 90 days from now. The value up to minutes is considered. Seconds and milliseconds are ignored."
|
|
292054
292064
|
}
|
|
292055
292065
|
},
|
|
292056
292066
|
"required": [
|
|
@@ -292512,7 +292522,7 @@ var state = {
|
|
|
292512
292522
|
"expiresAt": {
|
|
292513
292523
|
"type": "string",
|
|
292514
292524
|
"format": "date-time",
|
|
292515
|
-
"description": "Expiry timestamp in ISO 8601 format with UTC timezone. After expiry, the File will be deleted. Must be in the future. Cannot be more than
|
|
292525
|
+
"description": "Expiry timestamp in ISO 8601 format with UTC timezone. After expiry, the File will be deleted. Must be in the future. Cannot be more than 90 days from now. The value up to minutes is considered. Seconds and milliseconds are ignored. Omit to keep the existing expiry intact. Set to `null` to remove the expiry.",
|
|
292516
292526
|
"nullable": true
|
|
292517
292527
|
}
|
|
292518
292528
|
},
|
|
@@ -292663,6 +292673,11 @@ var state = {
|
|
|
292663
292673
|
"in": "query",
|
|
292664
292674
|
"type": "integer",
|
|
292665
292675
|
"description": "The maximum number of passages to return."
|
|
292676
|
+
},
|
|
292677
|
+
"includeBreadcrumb": {
|
|
292678
|
+
"in": "query",
|
|
292679
|
+
"type": "boolean",
|
|
292680
|
+
"description": "Prepend a breadcrumb to each passage, containing the title and subtitle(s) the passage belongs to in the file."
|
|
292666
292681
|
}
|
|
292667
292682
|
},
|
|
292668
292683
|
"response": {
|
|
@@ -293780,7 +293795,7 @@ var state = {
|
|
|
293780
293795
|
"title": "Botpress API",
|
|
293781
293796
|
"description": "API for Botpress Cloud",
|
|
293782
293797
|
"server": "https://api.botpress.cloud",
|
|
293783
|
-
"version": "0.
|
|
293798
|
+
"version": "0.39.1",
|
|
293784
293799
|
"prefix": "v1"
|
|
293785
293800
|
},
|
|
293786
293801
|
"errors": [
|
package/dist/src/gen/state.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/api",
|
|
3
|
-
"version": "0.
|
|
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
|
}
|