@botpress/cli 4.8.4 → 4.8.6

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.
@@ -1,32 +1,32 @@
1
1
 
2
- > @botpress/cli@4.8.4 build /home/runner/work/botpress/botpress/packages/cli
2
+ > @botpress/cli@4.8.6 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.4 bundle /home/runner/work/botpress/botpress/packages/cli
6
+ > @botpress/cli@4.8.6 bundle /home/runner/work/botpress/botpress/packages/cli
7
7
  > ts-node -T build.ts
8
8
 
9
9
 
10
- > @botpress/cli@4.8.4 template:gen /home/runner/work/botpress/botpress/packages/cli
10
+ > @botpress/cli@4.8.6 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.4
14
- 🤖 Botpress CLI v4.8.4
15
- 🤖 Botpress CLI v4.8.4
16
- 🤖 Botpress CLI v4.8.4
17
- ○ Generating typings for integration empty-integration...
13
+ 🤖 Botpress CLI v4.8.6
14
+ 🤖 Botpress CLI v4.8.6
15
+ 🤖 Botpress CLI v4.8.6
16
+ 🤖 Botpress CLI v4.8.6
17
+ ○ Generating typings for plugin empty-plugin...
18
18
  ✓ Typings available at .botpress
19
19
 
20
20
  ○ Generating typings for bot...
21
21
  ✓ Typings available at .botpress
22
22
 
23
- ○ Generating typings for plugin empty-plugin...
24
23
  ○ Generating typings for integration hello-world...
24
+ ○ Generating typings for integration empty-integration...
25
25
  ✓ Typings available at .botpress
26
26
 
27
27
  ✓ Typings available at .botpress
28
28
 
29
- 🤖 Botpress CLI v4.8.4
29
+ 🤖 Botpress CLI v4.8.6
30
30
  ○ Generating typings for integration webhook-message...
31
31
  ✓ Typings available at .botpress
32
32
 
@@ -59,12 +59,12 @@ const validateBotDefinition = (b) => {
59
59
  );
60
60
  }
61
61
  }
62
- const interfaceDepdencies = plugin.definition.interfaces ?? {};
63
- for (const dep of Object.values(interfaceDepdencies)) {
64
- const interfaceImpl = plugin.interfaces[dep.name];
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 interfaceDepdencies = plugin.definition.interfaces ?? {}\n for (const dep of Object.values(interfaceDepdencies)) {\n const interfaceImpl = plugin.interfaces[dep.name]\n if (!interfaceImpl) {\n throw new errors.BotpressCLIError(\n `Plugin \"${pluginName}\" has a dependency on interface \"${dep.name}@${dep.version}\", 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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AAsB,QAA6B;AACpF,QAAM,uBAAuB,OAAO,QAAQ,EAAE,gBAAgB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;AACpF,SAAO,qBAAqB;AAAA,IAC1B,CAAC,gBAAgB,YAAY,SAAS,IAAI,QAAQ,YAAY,YAAY,IAAI;AAAA,EAChF;AACF;",
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,MAAM,KAAK,OAAO,QAAQ,EAAE,WAAW,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+1,6 @@
1
1
  {
2
2
  "name": "@botpress/cli",
3
- "version": "4.8.4",
3
+ "version": "4.8.6",
4
4
  "description": "Botpress CLI",
5
5
  "scripts": {
6
6
  "build": "pnpm run bundle && pnpm run template:gen",
@@ -22,7 +22,7 @@
22
22
  "@apidevtools/json-schema-ref-parser": "^11.7.0",
23
23
  "@botpress/chat": "0.5.1",
24
24
  "@botpress/client": "1.15.1",
25
- "@botpress/sdk": "4.8.3",
25
+ "@botpress/sdk": "4.8.5",
26
26
  "@bpinternal/const": "^0.1.0",
27
27
  "@bpinternal/tunnel": "^0.1.1",
28
28
  "@bpinternal/yargs-extra": "^0.0.3",
@@ -6,7 +6,7 @@
6
6
  "private": true,
7
7
  "dependencies": {
8
8
  "@botpress/client": "1.15.1",
9
- "@botpress/sdk": "4.8.3"
9
+ "@botpress/sdk": "4.8.5"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@types/node": "^18.19.67",
@@ -7,7 +7,7 @@
7
7
  "private": true,
8
8
  "dependencies": {
9
9
  "@botpress/client": "1.15.1",
10
- "@botpress/sdk": "4.8.3"
10
+ "@botpress/sdk": "4.8.5"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/node": "^18.19.67",
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "private": true,
8
8
  "dependencies": {
9
- "@botpress/sdk": "4.8.3"
9
+ "@botpress/sdk": "4.8.5"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@types/node": "^18.19.67",
@@ -7,7 +7,7 @@
7
7
  "private": true,
8
8
  "dependencies": {
9
9
  "@botpress/client": "1.15.1",
10
- "@botpress/sdk": "4.8.3"
10
+ "@botpress/sdk": "4.8.5"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/node": "^18.19.67",
@@ -7,7 +7,7 @@
7
7
  "private": true,
8
8
  "dependencies": {
9
9
  "@botpress/client": "1.15.1",
10
- "@botpress/sdk": "4.8.3",
10
+ "@botpress/sdk": "4.8.5",
11
11
  "axios": "^1.6.8"
12
12
  },
13
13
  "devDependencies": {