@botpress/cli 4.8.4 → 4.8.5
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
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/cli@4.8.
|
|
2
|
+
> @botpress/cli@4.8.5 build /home/runner/work/botpress/botpress/packages/cli
|
|
3
3
|
> pnpm run bundle && pnpm run template:gen
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @botpress/cli@4.8.
|
|
6
|
+
> @botpress/cli@4.8.5 bundle /home/runner/work/botpress/botpress/packages/cli
|
|
7
7
|
> ts-node -T build.ts
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @botpress/cli@4.8.
|
|
10
|
+
> @botpress/cli@4.8.5 template:gen /home/runner/work/botpress/botpress/packages/cli
|
|
11
11
|
> pnpm -r --stream -F @bp-templates/* exec bp gen
|
|
12
12
|
|
|
13
|
-
🤖 Botpress CLI v4.8.
|
|
14
|
-
🤖 Botpress CLI v4.8.
|
|
15
|
-
🤖 Botpress CLI v4.8.
|
|
16
|
-
🤖 Botpress CLI v4.8.
|
|
17
|
-
○ Generating typings for integration empty-integration...
|
|
18
|
-
✓ Typings available at .botpress
|
|
19
|
-
|
|
13
|
+
🤖 Botpress CLI v4.8.5
|
|
14
|
+
🤖 Botpress CLI v4.8.5
|
|
15
|
+
🤖 Botpress CLI v4.8.5
|
|
16
|
+
🤖 Botpress CLI v4.8.5
|
|
20
17
|
○ Generating typings for bot...
|
|
21
18
|
✓ Typings available at .botpress
|
|
22
19
|
|
|
23
|
-
○ Generating typings for plugin empty-plugin...
|
|
24
20
|
○ Generating typings for integration hello-world...
|
|
21
|
+
○ Generating typings for integration empty-integration...
|
|
22
|
+
✓ Typings available at .botpress
|
|
23
|
+
|
|
25
24
|
✓ Typings available at .botpress
|
|
26
25
|
|
|
26
|
+
○ Generating typings for plugin empty-plugin...
|
|
27
27
|
✓ Typings available at .botpress
|
|
28
28
|
|
|
29
|
-
🤖 Botpress CLI v4.8.
|
|
29
|
+
🤖 Botpress CLI v4.8.5
|
|
30
30
|
○ Generating typings for integration webhook-message...
|
|
31
31
|
✓ Typings available at .botpress
|
|
32
32
|
|
package/dist/sdk/validate-bot.js
CHANGED
|
@@ -59,12 +59,12 @@ const validateBotDefinition = (b) => {
|
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
for (const dep of Object.
|
|
64
|
-
const interfaceImpl = plugin.interfaces[
|
|
62
|
+
const interfaceDependencies = plugin.definition.interfaces ?? {};
|
|
63
|
+
for (const [interfaceAlias, dep] of Object.entries(interfaceDependencies)) {
|
|
64
|
+
const interfaceImpl = plugin.interfaces[interfaceAlias];
|
|
65
65
|
if (!interfaceImpl) {
|
|
66
66
|
throw new errors.BotpressCLIError(
|
|
67
|
-
`Plugin "${pluginName}" has a dependency on interface "${dep.name}@${dep.version}", but the bot does not specify an implementation for it.`
|
|
67
|
+
`Plugin "${pluginName}" has a dependency on interface "${dep.name}@${dep.version}" (aliased as "${interfaceAlias}"), but the bot does not specify an implementation for it.`
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
if (!_hasIntegrationDependency(b, interfaceImpl)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/sdk/validate-bot.ts"],
|
|
4
|
-
"sourcesContent": ["import type * as sdk from '@botpress/sdk'\nimport * as errors from '../errors'\nimport * as utils from '../utils'\n\ntype PackageRef = { name: string; version: string }\n\nconst PLUGIN_PREFIX_SEP = '#'\n\nexport const validateBotDefinition = (b: sdk.BotDefinition): void => {\n const { actions, events, states } = b\n\n const invalidActionNames = _nonCamelCaseKeys(actions ?? {})\n if (invalidActionNames.length) {\n throw new errors.BotpressCLIError(\n `The following action names are not in camelCase: ${invalidActionNames.join(', ')}`\n )\n }\n\n const invalidEventNames = _nonCamelCaseKeys(events ?? {})\n if (invalidEventNames.length) {\n throw new errors.BotpressCLIError(`The following event names are not in camelCase: ${invalidEventNames.join(', ')}`)\n }\n\n const invalidStateNames = _nonCamelCaseKeys(states ?? {})\n if (invalidStateNames.length) {\n throw new errors.BotpressCLIError(`The following state names are not in camelCase: ${invalidStateNames.join(', ')}`)\n }\n\n for (const [pluginName, plugin] of Object.entries(b.plugins ?? {})) {\n const integrationDependencies = plugin.definition.integrations ?? {}\n for (const dep of Object.values(integrationDependencies)) {\n if (!_hasIntegrationDependency(b, dep)) {\n throw new errors.BotpressCLIError(\n `Plugin \"${pluginName}\" has a dependency on integration \"${dep.name}@${dep.version}\", but it is not present in the bot definition. Please install it.`\n )\n }\n }\n\n const
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AACxB,YAAuB;AAIvB,MAAM,oBAAoB;AAEnB,MAAM,wBAAwB,CAAC,MAA+B;AACnE,QAAM,EAAE,SAAS,QAAQ,OAAO,IAAI;AAEpC,QAAM,qBAAqB,kBAAkB,WAAW,CAAC,CAAC;AAC1D,MAAI,mBAAmB,QAAQ;AAC7B,UAAM,IAAI,OAAO;AAAA,MACf,oDAAoD,mBAAmB,KAAK,IAAI;AAAA,IAClF;AAAA,EACF;AAEA,QAAM,oBAAoB,kBAAkB,UAAU,CAAC,CAAC;AACxD,MAAI,kBAAkB,QAAQ;AAC5B,UAAM,IAAI,OAAO,iBAAiB,mDAAmD,kBAAkB,KAAK,IAAI,GAAG;AAAA,EACrH;AAEA,QAAM,oBAAoB,kBAAkB,UAAU,CAAC,CAAC;AACxD,MAAI,kBAAkB,QAAQ;AAC5B,UAAM,IAAI,OAAO,iBAAiB,mDAAmD,kBAAkB,KAAK,IAAI,GAAG;AAAA,EACrH;AAEA,aAAW,CAAC,YAAY,MAAM,KAAK,OAAO,QAAQ,EAAE,WAAW,CAAC,CAAC,GAAG;AAClE,UAAM,0BAA0B,OAAO,WAAW,gBAAgB,CAAC;AACnE,eAAW,OAAO,OAAO,OAAO,uBAAuB,GAAG;AACxD,UAAI,CAAC,0BAA0B,GAAG,GAAG,GAAG;AACtC,cAAM,IAAI,OAAO;AAAA,UACf,WAAW,gDAAgD,IAAI,QAAQ,IAAI;AAAA,QAC7E;AAAA,MACF;AAAA,IACF;AAEA,UAAM,
|
|
4
|
+
"sourcesContent": ["import type * as sdk from '@botpress/sdk'\nimport * as errors from '../errors'\nimport * as utils from '../utils'\n\ntype PackageRef = { name: string; version: string }\n\nconst PLUGIN_PREFIX_SEP = '#'\n\nexport const validateBotDefinition = (b: sdk.BotDefinition): void => {\n const { actions, events, states } = b\n\n const invalidActionNames = _nonCamelCaseKeys(actions ?? {})\n if (invalidActionNames.length) {\n throw new errors.BotpressCLIError(\n `The following action names are not in camelCase: ${invalidActionNames.join(', ')}`\n )\n }\n\n const invalidEventNames = _nonCamelCaseKeys(events ?? {})\n if (invalidEventNames.length) {\n throw new errors.BotpressCLIError(`The following event names are not in camelCase: ${invalidEventNames.join(', ')}`)\n }\n\n const invalidStateNames = _nonCamelCaseKeys(states ?? {})\n if (invalidStateNames.length) {\n throw new errors.BotpressCLIError(`The following state names are not in camelCase: ${invalidStateNames.join(', ')}`)\n }\n\n for (const [pluginName, plugin] of Object.entries(b.plugins ?? {})) {\n const integrationDependencies = plugin.definition.integrations ?? {}\n for (const dep of Object.values(integrationDependencies)) {\n if (!_hasIntegrationDependency(b, dep)) {\n throw new errors.BotpressCLIError(\n `Plugin \"${pluginName}\" has a dependency on integration \"${dep.name}@${dep.version}\", but it is not present in the bot definition. Please install it.`\n )\n }\n }\n\n const interfaceDependencies = plugin.definition.interfaces ?? {}\n for (const [interfaceAlias, dep] of Object.entries(interfaceDependencies)) {\n const interfaceImpl = plugin.interfaces[interfaceAlias]\n if (!interfaceImpl) {\n throw new errors.BotpressCLIError(\n `Plugin \"${pluginName}\" has a dependency on interface \"${dep.name}@${dep.version}\" (aliased as \"${interfaceAlias}\"), but the bot does not specify an implementation for it.`\n )\n }\n\n if (!_hasIntegrationDependency(b, interfaceImpl)) {\n throw new errors.BotpressCLIError(\n `Integration \"${interfaceImpl.name}@${interfaceImpl.version}\" is not installed in the bot, but specified as an implementation for interface \"${dep.name}@${dep.version}\"`\n )\n }\n }\n }\n}\n\nconst _nonCamelCaseKeys = (obj: Record<string, any>): string[] =>\n Object.keys(obj).filter((key) => {\n const tokens: string[] = key.split(PLUGIN_PREFIX_SEP, 2)\n return tokens.some((t) => !utils.casing.is.camelCase(t))\n })\n\nconst _hasIntegrationDependency = (b: sdk.BotDefinition, dep: PackageRef): boolean => {\n const integrationInstances = Object.entries(b.integrations ?? {}).map(([_k, v]) => v)\n return integrationInstances.some(\n (integration) => integration.name === dep.name && integration.version === dep.version\n )\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AACxB,YAAuB;AAIvB,MAAM,oBAAoB;AAEnB,MAAM,wBAAwB,CAAC,MAA+B;AACnE,QAAM,EAAE,SAAS,QAAQ,OAAO,IAAI;AAEpC,QAAM,qBAAqB,kBAAkB,WAAW,CAAC,CAAC;AAC1D,MAAI,mBAAmB,QAAQ;AAC7B,UAAM,IAAI,OAAO;AAAA,MACf,oDAAoD,mBAAmB,KAAK,IAAI;AAAA,IAClF;AAAA,EACF;AAEA,QAAM,oBAAoB,kBAAkB,UAAU,CAAC,CAAC;AACxD,MAAI,kBAAkB,QAAQ;AAC5B,UAAM,IAAI,OAAO,iBAAiB,mDAAmD,kBAAkB,KAAK,IAAI,GAAG;AAAA,EACrH;AAEA,QAAM,oBAAoB,kBAAkB,UAAU,CAAC,CAAC;AACxD,MAAI,kBAAkB,QAAQ;AAC5B,UAAM,IAAI,OAAO,iBAAiB,mDAAmD,kBAAkB,KAAK,IAAI,GAAG;AAAA,EACrH;AAEA,aAAW,CAAC,YAAY,MAA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