@botpress/api 1.52.0 → 1.52.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/.turbo/turbo-openapi.log +5 -5
- package/dist/index.js +159 -154
- package/dist/src/index.d.ts +6 -175
- package/package.json +2 -2
- package/src/gen/admin/openapi.json +1 -1
- package/src/gen/admin/state.ts +1 -1
- package/src/gen/files/openapi.json +1 -1
- package/src/gen/files/state.ts +1 -1
- package/src/gen/openapi.json +1 -1
- package/src/gen/runtime/openapi.json +1 -1
- package/src/gen/runtime/state.ts +1 -1
- package/src/gen/state.ts +1 -1
- package/src/gen/tables/openapi.json +1 -1
- package/src/gen/tables/state.ts +1 -1
package/.turbo/turbo-openapi.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/api@1.52.
|
|
2
|
+
> @botpress/api@1.52.1 openapi /home/runner/work/skynet/skynet/packages/public-api
|
|
3
3
|
> es-node openapi/generator.ts && pnpm run build
|
|
4
4
|
|
|
5
5
|
Generating openapi content
|
|
@@ -34,18 +34,18 @@ Saving openapi.json file
|
|
|
34
34
|
|
|
35
35
|
info: Exit with code {"category":"system","code":0,"label":"Shutdown"}
|
|
36
36
|
|
|
37
|
-
> @botpress/api@1.52.
|
|
37
|
+
> @botpress/api@1.52.1 build /home/runner/work/skynet/skynet/packages/public-api
|
|
38
38
|
> pnpm run build:type && pnpm run build:impl
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
> @botpress/api@1.52.
|
|
41
|
+
> @botpress/api@1.52.1 build:type /home/runner/work/skynet/skynet/packages/public-api
|
|
42
42
|
> tsc -p tsconfig.package.json --emitDeclarationOnly
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
> @botpress/api@1.52.
|
|
45
|
+
> @botpress/api@1.52.1 build:impl /home/runner/work/skynet/skynet/packages/public-api
|
|
46
46
|
> esbuild --bundle --platform=node --outfile=dist/index.js src/index.ts
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
dist/index.js 13.9mb ⚠️
|
|
50
50
|
|
|
51
|
-
⚡ Done in
|
|
51
|
+
⚡ Done in 948ms
|
package/dist/index.js
CHANGED
|
@@ -268286,7 +268286,7 @@ __export(src_exports, {
|
|
|
268286
268286
|
});
|
|
268287
268287
|
module.exports = __toCommonJS(src_exports);
|
|
268288
268288
|
|
|
268289
|
-
// ../../node_modules/.pnpm/@bpinternal+opapi@0.
|
|
268289
|
+
// ../../node_modules/.pnpm/@bpinternal+opapi@1.0.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
|
|
268290
268290
|
var import_zod_openapi = __toESM(require_src(), 1);
|
|
268291
268291
|
var import_zod_openapi2 = __toESM(require_src(), 1);
|
|
268292
268292
|
var import_path = __toESM(require("path"), 1);
|
|
@@ -268332,7 +268332,7 @@ var title = (str2) => {
|
|
|
268332
268332
|
return str2.split(/(?=[A-Z])|[\.\-\s_]/).map((s2) => s2.trim()).filter((s2) => !!s2).map((s2) => capitalize(s2.toLowerCase())).join(" ");
|
|
268333
268333
|
};
|
|
268334
268334
|
|
|
268335
|
-
// ../../node_modules/.pnpm/@bpinternal+opapi@0.
|
|
268335
|
+
// ../../node_modules/.pnpm/@bpinternal+opapi@1.0.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
|
|
268336
268336
|
var import_decompress = __toESM(require_decompress(), 1);
|
|
268337
268337
|
var import_fs3 = __toESM(require("fs"), 1);
|
|
268338
268338
|
var import_promises = __toESM(require("fs/promises"), 1);
|
|
@@ -271568,7 +271568,7 @@ var {
|
|
|
271568
271568
|
mergeConfig: mergeConfig2
|
|
271569
271569
|
} = axios_default;
|
|
271570
271570
|
|
|
271571
|
-
// ../../node_modules/.pnpm/@bpinternal+opapi@0.
|
|
271571
|
+
// ../../node_modules/.pnpm/@bpinternal+opapi@1.0.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
|
|
271572
271572
|
var import_json_schema_to_typescript = __toESM(require_src3(), 1);
|
|
271573
271573
|
var import_fs4 = __toESM(require("fs"), 1);
|
|
271574
271574
|
var import_path3 = __toESM(require("path"), 1);
|
|
@@ -275904,7 +275904,7 @@ async function openapiTS(schema3, options = {}) {
|
|
|
275904
275904
|
}
|
|
275905
275905
|
var dist_default = openapiTS;
|
|
275906
275906
|
|
|
275907
|
-
// ../../node_modules/.pnpm/@bpinternal+opapi@0.
|
|
275907
|
+
// ../../node_modules/.pnpm/@bpinternal+opapi@1.0.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
|
|
275908
275908
|
var import_openapi3_ts = __toESM(require_dist3(), 1);
|
|
275909
275909
|
var import_verror2 = __toESM(require_verror(), 1);
|
|
275910
275910
|
var import_verror3 = __toESM(require_verror(), 1);
|
|
@@ -279878,11 +279878,9 @@ var z = /* @__PURE__ */ Object.freeze({
|
|
|
279878
279878
|
ZodError
|
|
279879
279879
|
});
|
|
279880
279880
|
|
|
279881
|
-
// ../../node_modules/.pnpm/@bpinternal+opapi@0.
|
|
279881
|
+
// ../../node_modules/.pnpm/@bpinternal+opapi@1.0.0_openapi-types@12.1.3/node_modules/@bpinternal/opapi/dist/index.mjs
|
|
279882
279882
|
var import_openapi_parser = __toESM(require_lib8(), 1);
|
|
279883
279883
|
var import_json_schema_to_typescript2 = __toESM(require_src3(), 1);
|
|
279884
|
-
var import_zod_openapi4 = __toESM(require_src(), 1);
|
|
279885
|
-
var import_verror4 = __toESM(require_verror(), 1);
|
|
279886
279884
|
var import_path4 = __toESM(require("path"), 1);
|
|
279887
279885
|
var import_fs5 = __toESM(require("fs"), 1);
|
|
279888
279886
|
var import_fs6 = __toESM(require("fs"), 1);
|
|
@@ -279898,6 +279896,8 @@ var import_path6 = __toESM(require("path"), 1);
|
|
|
279898
279896
|
var import_promises4 = __toESM(require("fs/promises"), 1);
|
|
279899
279897
|
var import_json_schema_to_zod = __toESM(require_json_schema_to_zod(), 1);
|
|
279900
279898
|
var import_promises5 = __toESM(require("fs/promises"), 1);
|
|
279899
|
+
var import_zod_openapi4 = __toESM(require_src(), 1);
|
|
279900
|
+
var import_verror4 = __toESM(require_verror(), 1);
|
|
279901
279901
|
var __defProp2 = Object.defineProperty;
|
|
279902
279902
|
var __export2 = (target, all3) => {
|
|
279903
279903
|
for (var name in all3)
|
|
@@ -281811,111 +281811,6 @@ function mapOperationPropsToHandlerProps(operationName, operation) {
|
|
|
281811
281811
|
}
|
|
281812
281812
|
return generateHandlerProps;
|
|
281813
281813
|
}
|
|
281814
|
-
var addOperation = (state6, operationProps) => {
|
|
281815
|
-
var _a, _b, _c;
|
|
281816
|
-
const { name } = operationProps;
|
|
281817
|
-
const responseName = formatResponseName(name);
|
|
281818
|
-
const bodyName = formatBodyName(name);
|
|
281819
|
-
const parameters = createParameters(
|
|
281820
|
-
operationProps.parameters ? objects.mapValues(operationProps.parameters, mapParameter) : void 0,
|
|
281821
|
-
state6.defaultParameters,
|
|
281822
|
-
operationProps.disableDefaultParameters
|
|
281823
|
-
);
|
|
281824
|
-
if (operationProps.path[0] !== "/") {
|
|
281825
|
-
throw new import_verror4.VError(`Invalid path ${operationProps.path}. It must start with a /`);
|
|
281826
|
-
}
|
|
281827
|
-
const path2 = state6.metadata.prefix ? `/${state6.metadata.prefix}${operationProps.path}` : operationProps.path;
|
|
281828
|
-
if (!isAlphanumeric(name)) {
|
|
281829
|
-
throw new import_verror4.VError(`Invalid operation name ${name}. It must be alphanumeric and start with a letter`);
|
|
281830
|
-
}
|
|
281831
|
-
if (state6.operations[name]) {
|
|
281832
|
-
throw new import_verror4.VError(`Operation ${name} already exists`);
|
|
281833
|
-
}
|
|
281834
|
-
state6.refs.responses[formatResponseName(name)] = true;
|
|
281835
|
-
const response = {
|
|
281836
|
-
description: operationProps.response.description,
|
|
281837
|
-
status: operationProps.response.status,
|
|
281838
|
-
schema: generateSchemaFromZod(
|
|
281839
|
-
(0, import_zod_openapi4.extendApi)(operationProps.response.schema, { title: responseName, format: operationProps.response.format }),
|
|
281840
|
-
state6.options
|
|
281841
|
-
)
|
|
281842
|
-
};
|
|
281843
|
-
let operation;
|
|
281844
|
-
if (isOperationWithBodyProps(operationProps)) {
|
|
281845
|
-
state6.refs.requestBodies[formatBodyName(name)] = true;
|
|
281846
|
-
operation = {
|
|
281847
|
-
...operationProps,
|
|
281848
|
-
parameters,
|
|
281849
|
-
path: path2,
|
|
281850
|
-
response,
|
|
281851
|
-
requestBody: {
|
|
281852
|
-
description: operationProps.requestBody.description,
|
|
281853
|
-
schema: generateSchemaFromZod(
|
|
281854
|
-
(0, import_zod_openapi4.extendApi)(operationProps.requestBody.schema, { title: bodyName, format: (_a = operationProps.requestBody) == null ? void 0 : _a.format }),
|
|
281855
|
-
state6.options
|
|
281856
|
-
)
|
|
281857
|
-
}
|
|
281858
|
-
};
|
|
281859
|
-
} else {
|
|
281860
|
-
operation = {
|
|
281861
|
-
...operationProps,
|
|
281862
|
-
method: operationProps.method,
|
|
281863
|
-
parameters,
|
|
281864
|
-
path: path2,
|
|
281865
|
-
response
|
|
281866
|
-
};
|
|
281867
|
-
}
|
|
281868
|
-
validateParametersInPath(path2, parameters);
|
|
281869
|
-
state6.operations[name] = operation;
|
|
281870
|
-
(_c = (_b = state6.sections.find((section) => section.name === operationProps.section)) == null ? void 0 : _b.operations) == null ? void 0 : _c.push(name);
|
|
281871
|
-
};
|
|
281872
|
-
function createParameters(parameters = {}, defaultParameters = {}, disableDefaultParameters = {}) {
|
|
281873
|
-
const params = parameters;
|
|
281874
|
-
Object.entries(defaultParameters).forEach(([name, parameter]) => {
|
|
281875
|
-
const isDefaultParameterEnabled = disableDefaultParameters[name] !== true;
|
|
281876
|
-
if (isDefaultParameterEnabled) {
|
|
281877
|
-
params[name] = parameter;
|
|
281878
|
-
}
|
|
281879
|
-
});
|
|
281880
|
-
return params;
|
|
281881
|
-
}
|
|
281882
|
-
function validateParametersInPath(path2, parameters) {
|
|
281883
|
-
const parametersMapInPath = getParameterFromPath(path2).reduce(
|
|
281884
|
-
(value, current) => {
|
|
281885
|
-
value[current] = false;
|
|
281886
|
-
return value;
|
|
281887
|
-
},
|
|
281888
|
-
{}
|
|
281889
|
-
);
|
|
281890
|
-
if (parameters) {
|
|
281891
|
-
Object.entries(parameters).map(([parameterName, parameter]) => {
|
|
281892
|
-
if (parameter.in === "path") {
|
|
281893
|
-
if (parametersMapInPath[parameterName] === void 0) {
|
|
281894
|
-
throw new import_verror4.VError(`Parameter ${parameterName} is not in path ${path2}`);
|
|
281895
|
-
}
|
|
281896
|
-
parametersMapInPath[parameterName] = true;
|
|
281897
|
-
}
|
|
281898
|
-
});
|
|
281899
|
-
}
|
|
281900
|
-
Object.entries(parametersMapInPath).forEach(([parameterName, isPresent]) => {
|
|
281901
|
-
if (!isPresent) {
|
|
281902
|
-
throw new import_verror4.VError(`Parameter ${parameterName} is not present in path ${path2}`);
|
|
281903
|
-
}
|
|
281904
|
-
});
|
|
281905
|
-
}
|
|
281906
|
-
function getParameterFromPath(path2) {
|
|
281907
|
-
const parameters = [];
|
|
281908
|
-
const regex = /{([^}]+)}/g;
|
|
281909
|
-
let match;
|
|
281910
|
-
while ((match = regex.exec(path2)) !== null) {
|
|
281911
|
-
if (match[1]) {
|
|
281912
|
-
parameters.push(match[1]);
|
|
281913
|
-
} else {
|
|
281914
|
-
throw new import_verror4.VError(`Invalid path parameter ${path2}`);
|
|
281915
|
-
}
|
|
281916
|
-
}
|
|
281917
|
-
return parameters;
|
|
281918
|
-
}
|
|
281919
281814
|
var DEFAULT_IMPORT_PATH = "@bpinternal/opapi";
|
|
281920
281815
|
var exportStateAsTypescript = (state6, dir, opts = {}) => {
|
|
281921
281816
|
import_fs5.default.mkdirSync(dir, { recursive: true });
|
|
@@ -282470,55 +282365,165 @@ var applyExportOptions = (state6, options) => {
|
|
|
282470
282365
|
}
|
|
282471
282366
|
return state6;
|
|
282472
282367
|
};
|
|
282368
|
+
var addOperation = (state6, operationProps) => {
|
|
282369
|
+
var _a, _b, _c;
|
|
282370
|
+
const { name } = operationProps;
|
|
282371
|
+
const responseName = formatResponseName(name);
|
|
282372
|
+
const bodyName = formatBodyName(name);
|
|
282373
|
+
const parameters = createParameters(
|
|
282374
|
+
operationProps.parameters ? objects.mapValues(operationProps.parameters, mapParameter) : void 0,
|
|
282375
|
+
state6.defaultParameters,
|
|
282376
|
+
operationProps.disableDefaultParameters
|
|
282377
|
+
);
|
|
282378
|
+
if (operationProps.path[0] !== "/") {
|
|
282379
|
+
throw new import_verror4.VError(`Invalid path ${operationProps.path}. It must start with a /`);
|
|
282380
|
+
}
|
|
282381
|
+
const path2 = state6.metadata.prefix ? `/${state6.metadata.prefix}${operationProps.path}` : operationProps.path;
|
|
282382
|
+
if (!isAlphanumeric(name)) {
|
|
282383
|
+
throw new import_verror4.VError(`Invalid operation name ${name}. It must be alphanumeric and start with a letter`);
|
|
282384
|
+
}
|
|
282385
|
+
if (state6.operations[name]) {
|
|
282386
|
+
throw new import_verror4.VError(`Operation ${name} already exists`);
|
|
282387
|
+
}
|
|
282388
|
+
state6.refs.responses[formatResponseName(name)] = true;
|
|
282389
|
+
const response = {
|
|
282390
|
+
description: operationProps.response.description,
|
|
282391
|
+
status: operationProps.response.status,
|
|
282392
|
+
schema: generateSchemaFromZod(
|
|
282393
|
+
(0, import_zod_openapi4.extendApi)(operationProps.response.schema, { title: responseName, format: operationProps.response.format }),
|
|
282394
|
+
state6.options
|
|
282395
|
+
)
|
|
282396
|
+
};
|
|
282397
|
+
let operation;
|
|
282398
|
+
if (isOperationWithBodyProps(operationProps)) {
|
|
282399
|
+
state6.refs.requestBodies[formatBodyName(name)] = true;
|
|
282400
|
+
operation = {
|
|
282401
|
+
...operationProps,
|
|
282402
|
+
parameters,
|
|
282403
|
+
path: path2,
|
|
282404
|
+
response,
|
|
282405
|
+
requestBody: {
|
|
282406
|
+
description: operationProps.requestBody.description,
|
|
282407
|
+
schema: generateSchemaFromZod(
|
|
282408
|
+
(0, import_zod_openapi4.extendApi)(operationProps.requestBody.schema, { title: bodyName, format: (_a = operationProps.requestBody) == null ? void 0 : _a.format }),
|
|
282409
|
+
state6.options
|
|
282410
|
+
)
|
|
282411
|
+
}
|
|
282412
|
+
};
|
|
282413
|
+
} else {
|
|
282414
|
+
operation = {
|
|
282415
|
+
...operationProps,
|
|
282416
|
+
method: operationProps.method,
|
|
282417
|
+
parameters,
|
|
282418
|
+
path: path2,
|
|
282419
|
+
response
|
|
282420
|
+
};
|
|
282421
|
+
}
|
|
282422
|
+
validateParametersInPath(path2, parameters);
|
|
282423
|
+
state6.operations[name] = operation;
|
|
282424
|
+
(_c = (_b = state6.sections.find((section) => section.name === operationProps.section)) == null ? void 0 : _b.operations) == null ? void 0 : _c.push(name);
|
|
282425
|
+
};
|
|
282426
|
+
function createParameters(parameters = {}, defaultParameters = {}, disableDefaultParameters = {}) {
|
|
282427
|
+
const params = parameters;
|
|
282428
|
+
Object.entries(defaultParameters).forEach(([name, parameter]) => {
|
|
282429
|
+
const isDefaultParameterEnabled = disableDefaultParameters[name] !== true;
|
|
282430
|
+
if (isDefaultParameterEnabled) {
|
|
282431
|
+
params[name] = parameter;
|
|
282432
|
+
}
|
|
282433
|
+
});
|
|
282434
|
+
return params;
|
|
282435
|
+
}
|
|
282436
|
+
function validateParametersInPath(path2, parameters) {
|
|
282437
|
+
const parametersMapInPath = getParameterFromPath(path2).reduce(
|
|
282438
|
+
(value, current) => {
|
|
282439
|
+
value[current] = false;
|
|
282440
|
+
return value;
|
|
282441
|
+
},
|
|
282442
|
+
{}
|
|
282443
|
+
);
|
|
282444
|
+
if (parameters) {
|
|
282445
|
+
Object.entries(parameters).map(([parameterName, parameter]) => {
|
|
282446
|
+
if (parameter.in === "path") {
|
|
282447
|
+
if (parametersMapInPath[parameterName] === void 0) {
|
|
282448
|
+
throw new import_verror4.VError(`Parameter ${parameterName} is not in path ${path2}`);
|
|
282449
|
+
}
|
|
282450
|
+
parametersMapInPath[parameterName] = true;
|
|
282451
|
+
}
|
|
282452
|
+
});
|
|
282453
|
+
}
|
|
282454
|
+
Object.entries(parametersMapInPath).forEach(([parameterName, isPresent]) => {
|
|
282455
|
+
if (!isPresent) {
|
|
282456
|
+
throw new import_verror4.VError(`Parameter ${parameterName} is not present in path ${path2}`);
|
|
282457
|
+
}
|
|
282458
|
+
});
|
|
282459
|
+
}
|
|
282460
|
+
function getParameterFromPath(path2) {
|
|
282461
|
+
const parameters = [];
|
|
282462
|
+
const regex = /{([^}]+)}/g;
|
|
282463
|
+
let match;
|
|
282464
|
+
while ((match = regex.exec(path2)) !== null) {
|
|
282465
|
+
if (match[1]) {
|
|
282466
|
+
parameters.push(match[1]);
|
|
282467
|
+
} else {
|
|
282468
|
+
throw new import_verror4.VError(`Invalid path parameter ${path2}`);
|
|
282469
|
+
}
|
|
282470
|
+
}
|
|
282471
|
+
return parameters;
|
|
282472
|
+
}
|
|
282473
282473
|
var schema2 = (schema22, schemaObject) => {
|
|
282474
282474
|
const This = schema22.constructor;
|
|
282475
282475
|
const copy = new This(schema22._def);
|
|
282476
282476
|
return (0, import_zod_openapi2.extendApi)(copy, schemaObject);
|
|
282477
282477
|
};
|
|
282478
|
-
|
|
282479
|
-
|
|
282480
|
-
|
|
282481
|
-
|
|
282482
|
-
|
|
282483
|
-
|
|
282484
|
-
|
|
282485
|
-
|
|
282486
|
-
|
|
282487
|
-
|
|
282488
|
-
|
|
282489
|
-
|
|
282490
|
-
|
|
282478
|
+
var OpenApi = class _OpenApi {
|
|
282479
|
+
_state;
|
|
282480
|
+
constructor(props, options = {}) {
|
|
282481
|
+
this._state = createState(props, options);
|
|
282482
|
+
}
|
|
282483
|
+
static fromState(state6) {
|
|
282484
|
+
const openapi = new _OpenApi({ metadata: state6.metadata });
|
|
282485
|
+
openapi._state = state6;
|
|
282486
|
+
return openapi;
|
|
282487
|
+
}
|
|
282488
|
+
getModelRef(name) {
|
|
282489
|
+
return getRef(this._state, "schemas", name);
|
|
282490
|
+
}
|
|
282491
|
+
addOperation(operation) {
|
|
282492
|
+
addOperation(this._state, operation);
|
|
282493
|
+
}
|
|
282494
|
+
exportClient(dir, options) {
|
|
282491
282495
|
if (options.generator === "openapi-generator") {
|
|
282492
|
-
return generateClientWithOpenapiGenerator(
|
|
282496
|
+
return generateClientWithOpenapiGenerator(
|
|
282497
|
+
applyExportOptions(this._state, options),
|
|
282498
|
+
dir,
|
|
282499
|
+
options.endpoint,
|
|
282500
|
+
options.postProcessors
|
|
282501
|
+
);
|
|
282493
282502
|
}
|
|
282494
282503
|
if (options.generator === "opapi") {
|
|
282495
|
-
return generateClientWithOpapi(
|
|
282504
|
+
return generateClientWithOpapi(applyExportOptions(this._state, options), dir);
|
|
282496
282505
|
}
|
|
282497
282506
|
throw new Error("Unknown generator");
|
|
282498
282507
|
}
|
|
282499
|
-
|
|
282500
|
-
|
|
282501
|
-
|
|
282502
|
-
|
|
282503
|
-
|
|
282504
|
-
|
|
282505
|
-
|
|
282506
|
-
|
|
282507
|
-
|
|
282508
|
-
|
|
282509
|
-
|
|
282510
|
-
|
|
282511
|
-
|
|
282512
|
-
|
|
282513
|
-
}
|
|
282508
|
+
exportTypesBySection(dir = ".", options) {
|
|
282509
|
+
return generateTypesBySection(applyExportOptions(this._state, options), dir);
|
|
282510
|
+
}
|
|
282511
|
+
exportServer(dir = ".", useExpressTypes, options) {
|
|
282512
|
+
return generateServer(applyExportOptions(this._state, options), dir, useExpressTypes);
|
|
282513
|
+
}
|
|
282514
|
+
exportOpenapi(dir = ".", options) {
|
|
282515
|
+
return generateOpenapi(applyExportOptions(this._state, options), dir);
|
|
282516
|
+
}
|
|
282517
|
+
exportState(dir = ".", options) {
|
|
282518
|
+
return exportStateAsTypescript(applyExportOptions(this._state, options), dir, options);
|
|
282519
|
+
}
|
|
282520
|
+
exportErrors(dir = ".") {
|
|
282521
|
+
return generateErrorsFile(this._state.errors ?? [], dir);
|
|
282522
|
+
}
|
|
282523
|
+
exportHandler(dir = ".", options) {
|
|
282524
|
+
return generateHandler2(applyExportOptions(this._state, options), dir);
|
|
282525
|
+
}
|
|
282514
282526
|
};
|
|
282515
|
-
function OpenApi(props, opts = {}) {
|
|
282516
|
-
const state6 = createState(props, opts);
|
|
282517
|
-
return createOpapiFromState(state6);
|
|
282518
|
-
}
|
|
282519
|
-
((OpenApi2) => {
|
|
282520
|
-
OpenApi2.fromState = (state6) => createOpapiFromState(state6);
|
|
282521
|
-
})(OpenApi || (OpenApi = {}));
|
|
282522
282527
|
|
|
282523
282528
|
// src/gen/runtime/state.ts
|
|
282524
282529
|
var state_exports = {};
|
|
@@ -286130,7 +286135,7 @@ var state = {
|
|
|
286130
286135
|
"title": "Botpress Runtime API",
|
|
286131
286136
|
"description": "API for Botpress Runtime",
|
|
286132
286137
|
"server": "https://api.botpress.cloud",
|
|
286133
|
-
"version": "1.52.
|
|
286138
|
+
"version": "1.52.1",
|
|
286134
286139
|
"prefix": "v1"
|
|
286135
286140
|
},
|
|
286136
286141
|
"defaultParameters": {
|
|
@@ -302311,7 +302316,7 @@ var state2 = {
|
|
|
302311
302316
|
"title": "Botpress Admin API",
|
|
302312
302317
|
"description": "API for Botpress Cloud Manager",
|
|
302313
302318
|
"server": "https://api.botpress.cloud",
|
|
302314
|
-
"version": "1.52.
|
|
302319
|
+
"version": "1.52.1",
|
|
302315
302320
|
"prefix": "v1"
|
|
302316
302321
|
},
|
|
302317
302322
|
"defaultParameters": {
|
|
@@ -307716,7 +307721,7 @@ var state3 = {
|
|
|
307716
307721
|
"title": "Botpress Files API",
|
|
307717
307722
|
"description": "API for Botpress Files",
|
|
307718
307723
|
"server": "https://api.botpress.cloud",
|
|
307719
|
-
"version": "1.52.
|
|
307724
|
+
"version": "1.52.1",
|
|
307720
307725
|
"prefix": "v1"
|
|
307721
307726
|
},
|
|
307722
307727
|
"defaultParameters": {
|
|
@@ -309974,7 +309979,7 @@ var state4 = {
|
|
|
309974
309979
|
"title": "Botpress Tables API",
|
|
309975
309980
|
"description": "API for Botpress Tables",
|
|
309976
309981
|
"server": "https://api.botpress.cloud",
|
|
309977
|
-
"version": "1.52.
|
|
309982
|
+
"version": "1.52.1",
|
|
309978
309983
|
"prefix": "v1"
|
|
309979
309984
|
},
|
|
309980
309985
|
"defaultParameters": {
|
|
@@ -330744,7 +330749,7 @@ var state5 = {
|
|
|
330744
330749
|
"title": "Botpress API",
|
|
330745
330750
|
"description": "API for Botpress Cloud",
|
|
330746
330751
|
"server": "https://api.botpress.cloud",
|
|
330747
|
-
"version": "1.52.
|
|
330752
|
+
"version": "1.52.1",
|
|
330748
330753
|
"prefix": "v1"
|
|
330749
330754
|
},
|
|
330750
330755
|
"errors": [
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,180 +1,11 @@
|
|
|
1
|
+
import { OpenApi } from '@bpinternal/opapi';
|
|
1
2
|
export * from './gen/state';
|
|
2
|
-
export declare const api:
|
|
3
|
-
getModelRef: (name: "User" | "Conversation" | "Event" | "Message" | "State" | "Task" | "Workflow" | "Bot" | "Integration" | "Interface" | "Plugin" | "Workspace" | "WorkspaceMember" | "Account" | "Usage" | "Issue" | "IssueEvent" | "Activity" | "Version" | "File" | "Table" | "Column" | "Row") => import("@bpinternal/opapi").OpenApiZodAny;
|
|
4
|
-
getState: () => import("@bpinternal/opapi").State<"User" | "Conversation" | "Event" | "Message" | "State" | "Task" | "Workflow" | "Bot" | "Integration" | "Interface" | "Plugin" | "Workspace" | "WorkspaceMember" | "Account" | "Usage" | "Issue" | "IssueEvent" | "Activity" | "Version" | "File" | "Table" | "Column" | "Row", "x-workspace-id", "user" | "conversation" | "event" | "message" | "state" | "hub" | "action" | "task" | "workflow" | "tag" | "bot" | "integration" | "interface" | "plugin" | "workspace" | "workspaceMember" | "account" | "usage" | "quotas" | "helper" | "activity" | "files" | "tables">;
|
|
5
|
-
addOperation: <Path extends string>(operationProps: import("@bpinternal/opapi").Operation<"x-workspace-id", "user" | "conversation" | "event" | "message" | "state" | "hub" | "action" | "task" | "workflow" | "tag" | "bot" | "integration" | "interface" | "plugin" | "workspace" | "workspaceMember" | "account" | "usage" | "quotas" | "helper" | "activity" | "files" | "tables", Path, "zod-schema">) => void;
|
|
6
|
-
exportClient: {
|
|
7
|
-
(dir: string, props: import("@bpinternal/opapi").GenerateClientProps): Promise<void>;
|
|
8
|
-
(dir: string, openapiGeneratorEndpoint: string, props?: (import("@bpinternal/opapi").OpenApiPostProcessors & Partial<{
|
|
9
|
-
ignoreDefaultParameters: boolean;
|
|
10
|
-
ignoreSecurity: boolean;
|
|
11
|
-
}>) | undefined): Promise<void>;
|
|
12
|
-
};
|
|
13
|
-
exportTypesBySection: (dir?: string | undefined, opts?: Partial<{
|
|
14
|
-
ignoreDefaultParameters: boolean;
|
|
15
|
-
ignoreSecurity: boolean;
|
|
16
|
-
}> | undefined) => Promise<void>;
|
|
17
|
-
exportServer: (dir: string | undefined, useExpressTypes: boolean, opts?: Partial<{
|
|
18
|
-
ignoreDefaultParameters: boolean;
|
|
19
|
-
ignoreSecurity: boolean;
|
|
20
|
-
}> | undefined) => Promise<void>;
|
|
21
|
-
exportOpenapi: (dir?: string | undefined, opts?: Partial<{
|
|
22
|
-
ignoreDefaultParameters: boolean;
|
|
23
|
-
ignoreSecurity: boolean;
|
|
24
|
-
}> | undefined) => void;
|
|
25
|
-
exportState: (dir?: string | undefined, opts?: (Partial<{
|
|
26
|
-
importPath: string;
|
|
27
|
-
}> & Partial<{
|
|
28
|
-
ignoreDefaultParameters: boolean;
|
|
29
|
-
ignoreSecurity: boolean;
|
|
30
|
-
}>) | undefined) => void;
|
|
31
|
-
exportErrors: (dir?: string | undefined) => void;
|
|
32
|
-
exportHandler: (dir?: string | undefined, opts?: Partial<{
|
|
33
|
-
ignoreDefaultParameters: boolean;
|
|
34
|
-
ignoreSecurity: boolean;
|
|
35
|
-
}> | undefined) => Promise<void>;
|
|
36
|
-
};
|
|
3
|
+
export declare const api: OpenApi<string, string, string>;
|
|
37
4
|
export * as runtime from './gen/runtime/state';
|
|
38
|
-
export declare const runtimeApi:
|
|
39
|
-
getModelRef: (name: "User" | "Conversation" | "Event" | "Message" | "State" | "Task" | "Workflow") => import("@bpinternal/opapi").OpenApiZodAny;
|
|
40
|
-
getState: () => import("@bpinternal/opapi").State<"User" | "Conversation" | "Event" | "Message" | "State" | "Task" | "Workflow", "x-bot-id" | "x-integration-id" | "x-integration-alias", "user" | "conversation" | "event" | "message" | "state" | "hub" | "action" | "task" | "workflow" | "tag">;
|
|
41
|
-
addOperation: <Path extends string>(operationProps: import("@bpinternal/opapi").Operation<"x-bot-id" | "x-integration-id" | "x-integration-alias", "user" | "conversation" | "event" | "message" | "state" | "hub" | "action" | "task" | "workflow" | "tag", Path, "zod-schema">) => void;
|
|
42
|
-
exportClient: {
|
|
43
|
-
(dir: string, props: import("@bpinternal/opapi").GenerateClientProps): Promise<void>;
|
|
44
|
-
(dir: string, openapiGeneratorEndpoint: string, props?: (import("@bpinternal/opapi").OpenApiPostProcessors & Partial<{
|
|
45
|
-
ignoreDefaultParameters: boolean;
|
|
46
|
-
ignoreSecurity: boolean;
|
|
47
|
-
}>) | undefined): Promise<void>;
|
|
48
|
-
};
|
|
49
|
-
exportTypesBySection: (dir?: string | undefined, opts?: Partial<{
|
|
50
|
-
ignoreDefaultParameters: boolean;
|
|
51
|
-
ignoreSecurity: boolean;
|
|
52
|
-
}> | undefined) => Promise<void>;
|
|
53
|
-
exportServer: (dir: string | undefined, useExpressTypes: boolean, opts?: Partial<{
|
|
54
|
-
ignoreDefaultParameters: boolean;
|
|
55
|
-
ignoreSecurity: boolean;
|
|
56
|
-
}> | undefined) => Promise<void>;
|
|
57
|
-
exportOpenapi: (dir?: string | undefined, opts?: Partial<{
|
|
58
|
-
ignoreDefaultParameters: boolean;
|
|
59
|
-
ignoreSecurity: boolean;
|
|
60
|
-
}> | undefined) => void;
|
|
61
|
-
exportState: (dir?: string | undefined, opts?: (Partial<{
|
|
62
|
-
importPath: string;
|
|
63
|
-
}> & Partial<{
|
|
64
|
-
ignoreDefaultParameters: boolean;
|
|
65
|
-
ignoreSecurity: boolean;
|
|
66
|
-
}>) | undefined) => void;
|
|
67
|
-
exportErrors: (dir?: string | undefined) => void;
|
|
68
|
-
exportHandler: (dir?: string | undefined, opts?: Partial<{
|
|
69
|
-
ignoreDefaultParameters: boolean;
|
|
70
|
-
ignoreSecurity: boolean;
|
|
71
|
-
}> | undefined) => Promise<void>;
|
|
72
|
-
};
|
|
5
|
+
export declare const runtimeApi: OpenApi<string, string, string>;
|
|
73
6
|
export * as admin from './gen/admin/state';
|
|
74
|
-
export declare const adminApi:
|
|
75
|
-
getModelRef: (name: "Bot" | "Integration" | "Interface" | "Plugin" | "Workspace" | "WorkspaceMember" | "Account" | "Usage" | "Issue" | "IssueEvent" | "Activity" | "Version") => import("@bpinternal/opapi").OpenApiZodAny;
|
|
76
|
-
getState: () => import("@bpinternal/opapi").State<"Bot" | "Integration" | "Interface" | "Plugin" | "Workspace" | "WorkspaceMember" | "Account" | "Usage" | "Issue" | "IssueEvent" | "Activity" | "Version", "x-workspace-id" | "x-multiple-integrations", "hub" | "bot" | "integration" | "interface" | "plugin" | "workspace" | "workspaceMember" | "account" | "usage" | "quotas" | "helper" | "activity">;
|
|
77
|
-
addOperation: <Path extends string>(operationProps: import("@bpinternal/opapi").Operation<"x-workspace-id" | "x-multiple-integrations", "hub" | "bot" | "integration" | "interface" | "plugin" | "workspace" | "workspaceMember" | "account" | "usage" | "quotas" | "helper" | "activity", Path, "zod-schema">) => void;
|
|
78
|
-
exportClient: {
|
|
79
|
-
(dir: string, props: import("@bpinternal/opapi").GenerateClientProps): Promise<void>;
|
|
80
|
-
(dir: string, openapiGeneratorEndpoint: string, props?: (import("@bpinternal/opapi").OpenApiPostProcessors & Partial<{
|
|
81
|
-
ignoreDefaultParameters: boolean;
|
|
82
|
-
ignoreSecurity: boolean;
|
|
83
|
-
}>) | undefined): Promise<void>;
|
|
84
|
-
};
|
|
85
|
-
exportTypesBySection: (dir?: string | undefined, opts?: Partial<{
|
|
86
|
-
ignoreDefaultParameters: boolean;
|
|
87
|
-
ignoreSecurity: boolean;
|
|
88
|
-
}> | undefined) => Promise<void>;
|
|
89
|
-
exportServer: (dir: string | undefined, useExpressTypes: boolean, opts?: Partial<{
|
|
90
|
-
ignoreDefaultParameters: boolean;
|
|
91
|
-
ignoreSecurity: boolean;
|
|
92
|
-
}> | undefined) => Promise<void>;
|
|
93
|
-
exportOpenapi: (dir?: string | undefined, opts?: Partial<{
|
|
94
|
-
ignoreDefaultParameters: boolean;
|
|
95
|
-
ignoreSecurity: boolean;
|
|
96
|
-
}> | undefined) => void;
|
|
97
|
-
exportState: (dir?: string | undefined, opts?: (Partial<{
|
|
98
|
-
importPath: string;
|
|
99
|
-
}> & Partial<{
|
|
100
|
-
ignoreDefaultParameters: boolean;
|
|
101
|
-
ignoreSecurity: boolean;
|
|
102
|
-
}>) | undefined) => void;
|
|
103
|
-
exportErrors: (dir?: string | undefined) => void;
|
|
104
|
-
exportHandler: (dir?: string | undefined, opts?: Partial<{
|
|
105
|
-
ignoreDefaultParameters: boolean;
|
|
106
|
-
ignoreSecurity: boolean;
|
|
107
|
-
}> | undefined) => Promise<void>;
|
|
108
|
-
};
|
|
7
|
+
export declare const adminApi: OpenApi<string, string, string>;
|
|
109
8
|
export * as files from './gen/files/state';
|
|
110
|
-
export declare const filesApi:
|
|
111
|
-
getModelRef: (name: "File") => import("@bpinternal/opapi").OpenApiZodAny;
|
|
112
|
-
getState: () => import("@bpinternal/opapi").State<"File", "x-bot-id" | "x-integration-id" | "x-integration-alias" | "x-integration-name" | "x-user-id" | "x-user-role", "files">;
|
|
113
|
-
addOperation: <Path extends string>(operationProps: import("@bpinternal/opapi").Operation<"x-bot-id" | "x-integration-id" | "x-integration-alias" | "x-integration-name" | "x-user-id" | "x-user-role", "files", Path, "zod-schema">) => void;
|
|
114
|
-
exportClient: {
|
|
115
|
-
(dir: string, props: import("@bpinternal/opapi").GenerateClientProps): Promise<void>;
|
|
116
|
-
(dir: string, openapiGeneratorEndpoint: string, props?: (import("@bpinternal/opapi").OpenApiPostProcessors & Partial<{
|
|
117
|
-
ignoreDefaultParameters: boolean;
|
|
118
|
-
ignoreSecurity: boolean;
|
|
119
|
-
}>) | undefined): Promise<void>;
|
|
120
|
-
};
|
|
121
|
-
exportTypesBySection: (dir?: string | undefined, opts?: Partial<{
|
|
122
|
-
ignoreDefaultParameters: boolean;
|
|
123
|
-
ignoreSecurity: boolean;
|
|
124
|
-
}> | undefined) => Promise<void>;
|
|
125
|
-
exportServer: (dir: string | undefined, useExpressTypes: boolean, opts?: Partial<{
|
|
126
|
-
ignoreDefaultParameters: boolean;
|
|
127
|
-
ignoreSecurity: boolean;
|
|
128
|
-
}> | undefined) => Promise<void>;
|
|
129
|
-
exportOpenapi: (dir?: string | undefined, opts?: Partial<{
|
|
130
|
-
ignoreDefaultParameters: boolean;
|
|
131
|
-
ignoreSecurity: boolean;
|
|
132
|
-
}> | undefined) => void;
|
|
133
|
-
exportState: (dir?: string | undefined, opts?: (Partial<{
|
|
134
|
-
importPath: string;
|
|
135
|
-
}> & Partial<{
|
|
136
|
-
ignoreDefaultParameters: boolean;
|
|
137
|
-
ignoreSecurity: boolean;
|
|
138
|
-
}>) | undefined) => void;
|
|
139
|
-
exportErrors: (dir?: string | undefined) => void;
|
|
140
|
-
exportHandler: (dir?: string | undefined, opts?: Partial<{
|
|
141
|
-
ignoreDefaultParameters: boolean;
|
|
142
|
-
ignoreSecurity: boolean;
|
|
143
|
-
}> | undefined) => Promise<void>;
|
|
144
|
-
};
|
|
9
|
+
export declare const filesApi: OpenApi<string, string, string>;
|
|
145
10
|
export * as tables from './gen/tables/state';
|
|
146
|
-
export declare const tablesApi:
|
|
147
|
-
getModelRef: (name: "Table" | "Column" | "Row") => import("@bpinternal/opapi").OpenApiZodAny;
|
|
148
|
-
getState: () => import("@bpinternal/opapi").State<"Table" | "Column" | "Row", "x-bot-id" | "x-integration-id" | "x-integration-alias" | "x-integration-name" | "x-user-id" | "x-user-role", "tables">;
|
|
149
|
-
addOperation: <Path extends string>(operationProps: import("@bpinternal/opapi").Operation<"x-bot-id" | "x-integration-id" | "x-integration-alias" | "x-integration-name" | "x-user-id" | "x-user-role", "tables", Path, "zod-schema">) => void;
|
|
150
|
-
exportClient: {
|
|
151
|
-
(dir: string, props: import("@bpinternal/opapi").GenerateClientProps): Promise<void>;
|
|
152
|
-
(dir: string, openapiGeneratorEndpoint: string, props?: (import("@bpinternal/opapi").OpenApiPostProcessors & Partial<{
|
|
153
|
-
ignoreDefaultParameters: boolean;
|
|
154
|
-
ignoreSecurity: boolean;
|
|
155
|
-
}>) | undefined): Promise<void>;
|
|
156
|
-
};
|
|
157
|
-
exportTypesBySection: (dir?: string | undefined, opts?: Partial<{
|
|
158
|
-
ignoreDefaultParameters: boolean;
|
|
159
|
-
ignoreSecurity: boolean;
|
|
160
|
-
}> | undefined) => Promise<void>;
|
|
161
|
-
exportServer: (dir: string | undefined, useExpressTypes: boolean, opts?: Partial<{
|
|
162
|
-
ignoreDefaultParameters: boolean;
|
|
163
|
-
ignoreSecurity: boolean;
|
|
164
|
-
}> | undefined) => Promise<void>;
|
|
165
|
-
exportOpenapi: (dir?: string | undefined, opts?: Partial<{
|
|
166
|
-
ignoreDefaultParameters: boolean;
|
|
167
|
-
ignoreSecurity: boolean;
|
|
168
|
-
}> | undefined) => void;
|
|
169
|
-
exportState: (dir?: string | undefined, opts?: (Partial<{
|
|
170
|
-
importPath: string;
|
|
171
|
-
}> & Partial<{
|
|
172
|
-
ignoreDefaultParameters: boolean;
|
|
173
|
-
ignoreSecurity: boolean;
|
|
174
|
-
}>) | undefined) => void;
|
|
175
|
-
exportErrors: (dir?: string | undefined) => void;
|
|
176
|
-
exportHandler: (dir?: string | undefined, opts?: Partial<{
|
|
177
|
-
ignoreDefaultParameters: boolean;
|
|
178
|
-
ignoreSecurity: boolean;
|
|
179
|
-
}> | undefined) => Promise<void>;
|
|
180
|
-
};
|
|
11
|
+
export declare const tablesApi: OpenApi<string, string, string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/api",
|
|
3
|
-
"version": "1.52.
|
|
3
|
+
"version": "1.52.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/src/index.d.ts",
|
|
6
6
|
"devDependencies": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@bpinternal/tables-api": "0.17.2"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@bpinternal/opapi": "0.
|
|
18
|
+
"@bpinternal/opapi": "1.0.0"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
21
|
"openapi": "es-node openapi/generator.ts && pnpm run build",
|