@botpress/cli 5.5.0 → 5.5.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 +12 -12
- package/dist/command-implementations/lint-command.js +13 -6
- package/dist/command-implementations/lint-command.js.map +2 -2
- package/dist/linter/base-linter.d.ts +16 -2
- package/dist/linter/base-linter.js +29 -4
- package/dist/linter/base-linter.js.map +3 -3
- package/dist/linter/ruleset-functions.d.ts +8 -0
- package/dist/linter/ruleset-functions.js +75 -0
- package/dist/linter/ruleset-functions.js.map +7 -0
- package/dist/linter/ruleset-tests/common.d.ts +1 -2
- package/dist/linter/ruleset-tests/common.js.map +1 -1
- package/dist/linter/rulesets/bot.ruleset.d.ts +1 -141
- package/dist/linter/rulesets/bot.ruleset.js +29 -28
- package/dist/linter/rulesets/bot.ruleset.js.map +2 -2
- package/dist/linter/rulesets/integration.ruleset.d.ts +1 -336
- package/dist/linter/rulesets/integration.ruleset.js +63 -62
- package/dist/linter/rulesets/integration.ruleset.js.map +2 -2
- package/dist/linter/rulesets/interface.ruleset.d.ts +1 -101
- package/dist/linter/rulesets/interface.ruleset.js +21 -20
- package/dist/linter/rulesets/interface.ruleset.js.map +2 -2
- package/package.json +4 -4
- package/templates/empty-bot/package.json +2 -2
- package/templates/empty-integration/package.json +2 -2
- package/templates/empty-plugin/package.json +1 -1
- package/templates/hello-world/package.json +2 -2
- package/templates/webhook-message/package.json +2 -2
|
@@ -22,13 +22,14 @@ __export(interface_ruleset_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(interface_ruleset_exports);
|
|
24
24
|
var import_spectral_functions = require("@stoplight/spectral-functions");
|
|
25
|
+
var import_ruleset_functions = require("../ruleset-functions");
|
|
25
26
|
var import_spectral_functions2 = require("../spectral-functions");
|
|
26
|
-
const INTERFACE_RULESET = {
|
|
27
|
+
const INTERFACE_RULESET = (0, import_ruleset_functions.preprocessRuleset)({
|
|
27
28
|
extends: [],
|
|
28
29
|
rules: {
|
|
29
30
|
"action-inputparams-should-have-a-title": {
|
|
30
|
-
description: "All action input parameters
|
|
31
|
-
message: "{{description}}: {{error}}
|
|
31
|
+
description: "All action input parameters {{callToAction}} have a title",
|
|
32
|
+
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema",
|
|
32
33
|
severity: "warn",
|
|
33
34
|
given: "$.actions[*].input..schema.properties[*].x-zui",
|
|
34
35
|
then: [
|
|
@@ -42,8 +43,8 @@ const INTERFACE_RULESET = {
|
|
|
42
43
|
]
|
|
43
44
|
},
|
|
44
45
|
"action-inputparams-must-have-a-description": {
|
|
45
|
-
description: "All action input parameters
|
|
46
|
-
message: "{{description}}: {{error}}
|
|
46
|
+
description: "All action input parameters {{callToAction}} have a description",
|
|
47
|
+
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema",
|
|
47
48
|
severity: "error",
|
|
48
49
|
given: "$.actions[*].input..schema.properties[*]",
|
|
49
50
|
then: [
|
|
@@ -57,8 +58,8 @@ const INTERFACE_RULESET = {
|
|
|
57
58
|
]
|
|
58
59
|
},
|
|
59
60
|
"action-outputparams-should-have-a-title": {
|
|
60
|
-
description: "All action output parameters
|
|
61
|
-
message: "{{description}}: {{error}}
|
|
61
|
+
description: "All action output parameters {{callToAction}} have a title",
|
|
62
|
+
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema",
|
|
62
63
|
severity: "warn",
|
|
63
64
|
given: "$.actions[*].output..schema.properties[*].x-zui",
|
|
64
65
|
then: [
|
|
@@ -72,8 +73,8 @@ const INTERFACE_RULESET = {
|
|
|
72
73
|
]
|
|
73
74
|
},
|
|
74
75
|
"action-outputparams-must-have-a-description": {
|
|
75
|
-
description: "All action output parameters
|
|
76
|
-
message: "{{description}}: {{error}}
|
|
76
|
+
description: "All action output parameters {{callToAction}} have a description",
|
|
77
|
+
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema",
|
|
77
78
|
severity: "error",
|
|
78
79
|
given: "$.actions[*].output..schema.properties[*]",
|
|
79
80
|
then: [
|
|
@@ -87,8 +88,8 @@ const INTERFACE_RULESET = {
|
|
|
87
88
|
]
|
|
88
89
|
},
|
|
89
90
|
"event-outputparams-should-have-title": {
|
|
90
|
-
description: "All event output parameters
|
|
91
|
-
message: "{{description}}: {{error}}
|
|
91
|
+
description: "All event output parameters {{callToAction}} have a title",
|
|
92
|
+
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema",
|
|
92
93
|
severity: "warn",
|
|
93
94
|
given: "$.events[*]..schema.properties[*]",
|
|
94
95
|
then: [
|
|
@@ -102,8 +103,8 @@ const INTERFACE_RULESET = {
|
|
|
102
103
|
]
|
|
103
104
|
},
|
|
104
105
|
"event-outputparams-must-have-description": {
|
|
105
|
-
description: "All event output parameters
|
|
106
|
-
message: "{{description}}: {{error}}
|
|
106
|
+
description: "All event output parameters {{callToAction}} have a description",
|
|
107
|
+
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema",
|
|
107
108
|
severity: "error",
|
|
108
109
|
given: "$.events[*]..schema.properties[*]",
|
|
109
110
|
then: [
|
|
@@ -117,20 +118,20 @@ const INTERFACE_RULESET = {
|
|
|
117
118
|
]
|
|
118
119
|
},
|
|
119
120
|
"legacy-zui-title-should-be-removed": {
|
|
120
|
-
description: "Legacy ZUI title fields (ui.title)
|
|
121
|
+
description: "Legacy ZUI title fields (ui.title) {{callToAction}} be removed. Please use .title() in your Zod schemas instead",
|
|
121
122
|
severity: "error",
|
|
122
123
|
given: "$..ui[*].title",
|
|
123
124
|
then: [{ function: import_spectral_functions.falsy }]
|
|
124
125
|
},
|
|
125
126
|
"legacy-zui-examples-should-be-removed": {
|
|
126
|
-
description: "Legacy ZUI examples fields (ui.examples)
|
|
127
|
+
description: "Legacy ZUI examples fields (ui.examples) {{callToAction}} be removed. There are currently no alternatives",
|
|
127
128
|
severity: "hint",
|
|
128
129
|
given: "$..ui[*].examples",
|
|
129
130
|
then: [{ function: import_spectral_functions.falsy }]
|
|
130
131
|
},
|
|
131
132
|
"entity-fields-should-have-a-title": {
|
|
132
|
-
description: "All entity fields
|
|
133
|
-
message: "{{description}}: {{error}}
|
|
133
|
+
description: "All entity fields {{callToAction}} have a title",
|
|
134
|
+
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema",
|
|
134
135
|
severity: "warn",
|
|
135
136
|
given: "$.entities[*]..schema.properties[*]",
|
|
136
137
|
then: [
|
|
@@ -144,8 +145,8 @@ const INTERFACE_RULESET = {
|
|
|
144
145
|
]
|
|
145
146
|
},
|
|
146
147
|
"entity-fields-must-have-a-description": {
|
|
147
|
-
description: "All entity fields
|
|
148
|
-
message: "{{description}}: {{error}}
|
|
148
|
+
description: "All entity fields {{callToAction}} have a description",
|
|
149
|
+
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema",
|
|
149
150
|
severity: "error",
|
|
150
151
|
given: "$.entities[*]..schema.properties[*]",
|
|
151
152
|
then: [
|
|
@@ -159,7 +160,7 @@ const INTERFACE_RULESET = {
|
|
|
159
160
|
]
|
|
160
161
|
}
|
|
161
162
|
}
|
|
162
|
-
};
|
|
163
|
+
});
|
|
163
164
|
// Annotate the CommonJS export names for ESM import in node:
|
|
164
165
|
0 && (module.exports = {
|
|
165
166
|
INTERFACE_RULESET
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/linter/rulesets/interface.ruleset.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import { falsy } from '@stoplight/spectral-functions'\nimport { preprocessRuleset } from '../ruleset-functions'\nimport { descriptionFallbackExtractor, titleFallbackExtractor, truthyWithMessage } from '../spectral-functions'\n\nexport const INTERFACE_RULESET = preprocessRuleset({\n extends: [],\n rules: {\n 'action-inputparams-should-have-a-title': {\n description: 'All action input parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.actions[*].input..schema.properties[*].x-zui',\n then: [\n {\n field: 'title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `input parameter \"${path.at(isFallback ? -5 : -3)}\" of action \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'action-inputparams-must-have-a-description': {\n description: 'All action input parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.actions[*].input..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `input parameter \"${path.at(isFallback ? -4 : -2)}\" of action \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'action-outputparams-should-have-a-title': {\n description: 'All action output parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.actions[*].output..schema.properties[*].x-zui',\n then: [\n {\n field: 'title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -5 : -3)}\" of action \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'action-outputparams-must-have-a-description': {\n description: 'All action output parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.actions[*].output..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -4 : -2)}\" of action \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'event-outputparams-should-have-title': {\n description: 'All event output parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.events[*]..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -5 : -3)}\" of event \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'event-outputparams-must-have-description': {\n description: 'All event output parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.events[*]..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -4 : -2)}\" of event \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'legacy-zui-title-should-be-removed': {\n description:\n 'Legacy ZUI title fields (ui.title) {{callToAction}} be removed. Please use .title() in your Zod schemas instead',\n severity: 'error',\n given: '$..ui[*].title',\n then: [{ function: falsy }],\n },\n 'legacy-zui-examples-should-be-removed': {\n description:\n 'Legacy ZUI examples fields (ui.examples) {{callToAction}} be removed. There are currently no alternatives',\n severity: 'hint',\n given: '$..ui[*].examples',\n then: [{ function: falsy }],\n },\n 'entity-fields-should-have-a-title': {\n description: 'All entity fields {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.entities[*]..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `field \"${path.at(isFallback ? -5 : -3)}\" of entity \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'entity-fields-must-have-a-description': {\n description: 'All entity fields {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.entities[*]..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `field \"${path.at(isFallback ? -4 : -2)}\" of entity \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n },\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAAsB;AACtB,+BAAkC;AAClC,IAAAA,6BAAwF;AAEjF,MAAM,wBAAoB,4CAAkB;AAAA,EACjD,SAAS,CAAC;AAAA,EACV,OAAO;AAAA,IACL,0CAA0C;AAAA,MACxC,aAAa;AAAA,MACb,SACE;AAAA,MACF,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,UACP,cAAU,8CAAkB;AAAA,YAC1B,eAAe,CAAC,EAAE,MAAM,WAAW,MACjC,oBAAoB,KAAK,GAAG,aAAa,KAAK,EAAE,CAAC,gBAAgB,KAAK,CAAC,CAAC;AAAA,YAC1E,mBAAmB;AAAA,UACrB,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,IACA,8CAA8C;AAAA,MAC5C,aAAa;AAAA,MACb,SACE;AAAA,MACF,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,UACP,cAAU,8CAAkB;AAAA,YAC1B,eAAe,CAAC,EAAE,MAAM,WAAW,MACjC,oBAAoB,KAAK,GAAG,aAAa,KAAK,EAAE,CAAC,gBAAgB,KAAK,CAAC,CAAC;AAAA,YAC1E,mBAAmB;AAAA,UACrB,CAAC;AAAA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GED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/cli",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.2",
|
|
4
4
|
"description": "Botpress CLI",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "pnpm run build:types && pnpm run bundle && pnpm run template:gen",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@apidevtools/json-schema-ref-parser": "^11.7.0",
|
|
29
29
|
"@botpress/chat": "0.5.4",
|
|
30
|
-
"@botpress/client": "1.
|
|
31
|
-
"@botpress/sdk": "5.3.
|
|
30
|
+
"@botpress/client": "1.33.0",
|
|
31
|
+
"@botpress/sdk": "5.3.4",
|
|
32
32
|
"@bpinternal/const": "^0.1.0",
|
|
33
33
|
"@bpinternal/tunnel": "^0.1.1",
|
|
34
34
|
"@bpinternal/verel": "^0.2.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@types/semver": "^7.3.11",
|
|
67
67
|
"@types/tmp": "^0.2.3",
|
|
68
68
|
"@types/uuid": "^9.0.1",
|
|
69
|
-
"find-process": "^
|
|
69
|
+
"find-process": "^2.0.0",
|
|
70
70
|
"glob": "^9.3.4",
|
|
71
71
|
"tmp": "^0.2.1"
|
|
72
72
|
},
|