@botpress/cli 4.20.0 → 4.20.2
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-build.log +11 -11
- package/dist/code-generation/generators.js +1 -1
- package/dist/code-generation/generators.js.map +2 -2
- package/package.json +2 -2
- package/templates/empty-bot/package.json +1 -1
- package/templates/empty-integration/package.json +1 -1
- package/templates/empty-plugin/package.json +1 -1
- package/templates/hello-world/package.json +1 -1
- package/templates/webhook-message/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/cli@4.20.
|
|
2
|
+
> @botpress/cli@4.20.2 build /home/runner/work/botpress/botpress/packages/cli
|
|
3
3
|
> pnpm run build:types && pnpm run bundle && pnpm run template:gen
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @botpress/cli@4.20.
|
|
6
|
+
> @botpress/cli@4.20.2 build:types /home/runner/work/botpress/botpress/packages/cli
|
|
7
7
|
> tsc -p ./tsconfig.build.json
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @botpress/cli@4.20.
|
|
10
|
+
> @botpress/cli@4.20.2 bundle /home/runner/work/botpress/botpress/packages/cli
|
|
11
11
|
> ts-node -T build.ts
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
> @botpress/cli@4.20.
|
|
14
|
+
> @botpress/cli@4.20.2 template:gen /home/runner/work/botpress/botpress/packages/cli
|
|
15
15
|
> pnpm -r --stream -F @bp-templates/* exec bp gen
|
|
16
16
|
|
|
17
|
-
🤖 Botpress CLI v4.20.
|
|
18
|
-
🤖 Botpress CLI v4.20.
|
|
19
|
-
🤖 Botpress CLI v4.20.
|
|
20
|
-
🤖 Botpress CLI v4.20.
|
|
17
|
+
🤖 Botpress CLI v4.20.2
|
|
18
|
+
🤖 Botpress CLI v4.20.2
|
|
19
|
+
🤖 Botpress CLI v4.20.2
|
|
20
|
+
🤖 Botpress CLI v4.20.2
|
|
21
|
+
○ Generating typings for integration hello-world...
|
|
21
22
|
○ Generating typings for bot...
|
|
22
23
|
✓ Typings available at .botpress
|
|
23
24
|
|
|
24
25
|
○ Generating typings for integration empty-integration...
|
|
25
26
|
✓ Typings available at .botpress
|
|
26
27
|
|
|
27
|
-
○ Generating typings for integration hello-world...
|
|
28
|
-
○ Generating typings for plugin empty-plugin...
|
|
29
28
|
✓ Typings available at .botpress
|
|
30
29
|
|
|
30
|
+
○ Generating typings for plugin empty-plugin...
|
|
31
31
|
✓ Typings available at .botpress
|
|
32
32
|
|
|
33
|
-
🤖 Botpress CLI v4.20.
|
|
33
|
+
🤖 Botpress CLI v4.20.2
|
|
34
34
|
○ Generating typings for integration webhook-message...
|
|
35
35
|
✓ Typings available at .botpress
|
|
36
36
|
|
|
@@ -43,7 +43,7 @@ var prettier = __toESM(require("prettier"));
|
|
|
43
43
|
var utils = __toESM(require("../utils"));
|
|
44
44
|
var consts = __toESM(require("./consts"));
|
|
45
45
|
const zuiSchemaToTypeScriptType = async (zuiSchema, name) => {
|
|
46
|
-
let code = zuiSchema.toTypescriptType();
|
|
46
|
+
let code = zuiSchema.toTypescriptType({ treatDefaultAsOptional: true });
|
|
47
47
|
code = `export type ${name} = ${code}`;
|
|
48
48
|
code = await prettier.format(code, { parser: "typescript" });
|
|
49
49
|
return [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/code-generation/generators.ts"],
|
|
4
|
-
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport { JSONSchema7 } from 'json-schema'\nimport _ from 'lodash'\nimport * as prettier from 'prettier'\nimport * as utils from '../utils'\nimport * as consts from './consts'\n\nexport type Primitive = string | number | boolean | null | undefined\n\nexport const zuiSchemaToTypeScriptType = async (zuiSchema: sdk.z.Schema, name: string): Promise<string> => {\n let code = zuiSchema.toTypescriptType()\n code = `export type ${name} = ${code}`\n code = await prettier.format(code, { parser: 'typescript' })\n return [\n //\n consts.GENERATED_HEADER,\n code,\n ].join('\\n')\n}\n\nexport const jsonSchemaToTypescriptZuiSchema = async (\n schema: JSONSchema7,\n name: string,\n extraProps: Record<string, string> = {}\n): Promise<string> => {\n schema = await utils.schema.dereferenceSchema(schema)\n const zuiSchema = sdk.transforms.fromJSONSchemaLegacy(schema)\n\n const allProps = {\n ...extraProps,\n schema: zuiSchema.toTypescriptSchema(),\n }\n\n let code = [\n consts.GENERATED_HEADER,\n 'import { z } from \"@botpress/sdk\"',\n `export const ${name} = ${typescriptValuesToRecordString(allProps)}`,\n ].join('\\n')\n code = await prettier.format(code, { parser: 'typescript' })\n return code\n}\n\nexport const stringifySingleLine = (x: object): string => {\n return JSON.stringify(x, null, 1).replace(/\\n */g, ' ')\n}\n\nexport function primitiveToTypescriptValue(x: Primitive): string {\n if (typeof x === 'undefined') {\n return 'undefined'\n }\n return JSON.stringify(x)\n}\n\nexport function primitiveRecordToTypescriptValues(x: Record<string, Primitive>): Record<string, string> {\n return _(x)\n .toPairs()\n .filter(([_key, value]) => value !== undefined)\n .map(([key, value]) => [key, primitiveToTypescriptValue(value)])\n .fromPairs()\n .value()\n}\n\nexport const primitiveRecordToRecordString = (record: Record<string, Primitive>): string =>\n typescriptValuesToRecordString(primitiveRecordToTypescriptValues(record))\n\nexport const typescriptValuesToRecordString = (record: Record<string, string>): string =>\n ['{', ...Object.entries(record).map(([key, value]) => ` ${key}: ${value},`), '}'].join('\\n')\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAAqB;AAErB,oBAAc;AACd,eAA0B;AAC1B,YAAuB;AACvB,aAAwB;AAIjB,MAAM,4BAA4B,OAAO,WAAyB,SAAkC;AACzG,MAAI,OAAO,UAAU,iBAAiB;
|
|
4
|
+
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport { JSONSchema7 } from 'json-schema'\nimport _ from 'lodash'\nimport * as prettier from 'prettier'\nimport * as utils from '../utils'\nimport * as consts from './consts'\n\nexport type Primitive = string | number | boolean | null | undefined\n\nexport const zuiSchemaToTypeScriptType = async (zuiSchema: sdk.z.Schema, name: string): Promise<string> => {\n let code = zuiSchema.toTypescriptType({ treatDefaultAsOptional: true })\n code = `export type ${name} = ${code}`\n code = await prettier.format(code, { parser: 'typescript' })\n return [\n //\n consts.GENERATED_HEADER,\n code,\n ].join('\\n')\n}\n\nexport const jsonSchemaToTypescriptZuiSchema = async (\n schema: JSONSchema7,\n name: string,\n extraProps: Record<string, string> = {}\n): Promise<string> => {\n schema = await utils.schema.dereferenceSchema(schema)\n const zuiSchema = sdk.transforms.fromJSONSchemaLegacy(schema)\n\n const allProps = {\n ...extraProps,\n schema: zuiSchema.toTypescriptSchema(),\n }\n\n let code = [\n consts.GENERATED_HEADER,\n 'import { z } from \"@botpress/sdk\"',\n `export const ${name} = ${typescriptValuesToRecordString(allProps)}`,\n ].join('\\n')\n code = await prettier.format(code, { parser: 'typescript' })\n return code\n}\n\nexport const stringifySingleLine = (x: object): string => {\n return JSON.stringify(x, null, 1).replace(/\\n */g, ' ')\n}\n\nexport function primitiveToTypescriptValue(x: Primitive): string {\n if (typeof x === 'undefined') {\n return 'undefined'\n }\n return JSON.stringify(x)\n}\n\nexport function primitiveRecordToTypescriptValues(x: Record<string, Primitive>): Record<string, string> {\n return _(x)\n .toPairs()\n .filter(([_key, value]) => value !== undefined)\n .map(([key, value]) => [key, primitiveToTypescriptValue(value)])\n .fromPairs()\n .value()\n}\n\nexport const primitiveRecordToRecordString = (record: Record<string, Primitive>): string =>\n typescriptValuesToRecordString(primitiveRecordToTypescriptValues(record))\n\nexport const typescriptValuesToRecordString = (record: Record<string, string>): string =>\n ['{', ...Object.entries(record).map(([key, value]) => ` ${key}: ${value},`), '}'].join('\\n')\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;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K,KAAK,MAAM,CAAC,KAAK,2BAA2B,KAAK,CAAC,CAAC,EAC9D,UAAU,EACV,MAAM;AACX;AAEO,MAAM,gCAAgC,CAAC,WAC5C,+BAA+B,kCAAkC,MAAM,CAAC;AAEnE,MAAM,iCAAiC,CAAC,WAC7C,CAAC,KAAK,GAAG,OAAO,QAAQ,MAAM,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,KAAK,GAAG,KAAK,KAAK,GAAG,GAAG,GAAG,EAAE,KAAK,IAAI;",
|
|
6
6
|
"names": ["_"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/cli",
|
|
3
|
-
"version": "4.20.
|
|
3
|
+
"version": "4.20.2",
|
|
4
4
|
"description": "Botpress CLI",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "pnpm run build:types && pnpm run bundle && pnpm run template:gen",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@apidevtools/json-schema-ref-parser": "^11.7.0",
|
|
28
28
|
"@botpress/chat": "0.5.2",
|
|
29
29
|
"@botpress/client": "1.26.0",
|
|
30
|
-
"@botpress/sdk": "4.17.
|
|
30
|
+
"@botpress/sdk": "4.17.2",
|
|
31
31
|
"@bpinternal/const": "^0.1.0",
|
|
32
32
|
"@bpinternal/tunnel": "^0.1.1",
|
|
33
33
|
"@bpinternal/yargs-extra": "^0.0.3",
|