@botpress/cli 4.16.1 → 4.16.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.
@@ -1,32 +1,32 @@
1
1
 
2
- > @botpress/cli@4.16.1 build /home/runner/work/botpress/botpress/packages/cli
2
+ > @botpress/cli@4.16.2 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.16.1 bundle /home/runner/work/botpress/botpress/packages/cli
6
+ > @botpress/cli@4.16.2 bundle /home/runner/work/botpress/botpress/packages/cli
7
7
  > ts-node -T build.ts
8
8
 
9
9
 
10
- > @botpress/cli@4.16.1 template:gen /home/runner/work/botpress/botpress/packages/cli
10
+ > @botpress/cli@4.16.2 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.16.1
14
- 🤖 Botpress CLI v4.16.1
15
- 🤖 Botpress CLI v4.16.1
16
- 🤖 Botpress CLI v4.16.1
13
+ 🤖 Botpress CLI v4.16.2
14
+ 🤖 Botpress CLI v4.16.2
15
+ 🤖 Botpress CLI v4.16.2
16
+ 🤖 Botpress CLI v4.16.2
17
+ ○ Generating typings for integration hello-world...
17
18
  ○ Generating typings for bot...
18
19
  ✓ Typings available at .botpress
19
20
 
20
- ○ Generating typings for integration empty-integration...
21
21
  ✓ Typings available at .botpress
22
22
 
23
23
  ○ Generating typings for plugin empty-plugin...
24
24
  ✓ Typings available at .botpress
25
25
 
26
- ○ Generating typings for integration hello-world...
26
+ ○ Generating typings for integration empty-integration...
27
27
  ✓ Typings available at .botpress
28
28
 
29
- 🤖 Botpress CLI v4.16.1
29
+ 🤖 Botpress CLI v4.16.2
30
30
  ○ Generating typings for integration webhook-message...
31
31
  ✓ Typings available at .botpress
32
32
 
@@ -65,10 +65,12 @@ class ListProfilesCommand extends import_global_command.GlobalCommand {
65
65
  }
66
66
  class UseProfileCommand extends import_global_command.GlobalCommand {
67
67
  async run() {
68
+ const logSuccess = (profileName) => this.logger.success(`Now using profile "${profileName}"`);
68
69
  if (this.argv.profileToUse) {
69
70
  const profile2 = await this.readProfileFromFS(this.argv.profileToUse);
70
71
  await this.globalCache.set("activeProfile", this.argv.profileToUse);
71
72
  await _updateGlobalCache({ globalCache: this.globalCache, profileName: this.argv.profileToUse, profile: profile2 });
73
+ logSuccess(this.argv.profileToUse);
72
74
  return;
73
75
  }
74
76
  const profiles = await this.readProfilesFromFS();
@@ -87,6 +89,7 @@ class UseProfileCommand extends import_global_command.GlobalCommand {
87
89
  throw new errors.BotpressCLIError("The selected profile could not be read");
88
90
  await this.globalCache.set("activeProfile", selectedProfile);
89
91
  await _updateGlobalCache({ globalCache: this.globalCache, profileName: selectedProfile, profile });
92
+ logSuccess(selectedProfile);
90
93
  }
91
94
  }
92
95
  const _updateGlobalCache = async (props) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/command-implementations/profile-commands.ts"],
4
- "sourcesContent": ["import chalk from 'chalk'\nimport type commandDefinitions from '../command-definitions'\nimport * as consts from '../consts'\nimport * as errors from '../errors'\nimport * as utils from '../utils'\nimport { GlobalCache, GlobalCommand, ProfileCredentials } from './global-command'\n\nexport type ActiveProfileCommandDefinition = typeof commandDefinitions.profiles.subcommands.active\nexport class ActiveProfileCommand extends GlobalCommand<ActiveProfileCommandDefinition> {\n public async run(): Promise<void> {\n let activeProfileName = await this.globalCache.get('activeProfile')\n\n if (!activeProfileName) {\n this.logger.log(`No active profile set, defaulting to ${consts.defaultProfileName}`)\n activeProfileName = consts.defaultProfileName\n await this.globalCache.set('activeProfile', activeProfileName)\n }\n\n const profile = await this.readProfileFromFS(activeProfileName)\n this.logger.log('Active profile:')\n this.logger.json({ [activeProfileName]: profile })\n }\n}\n\nexport type ListProfilesCommandDefinition = typeof commandDefinitions.profiles.subcommands.list\nexport class ListProfilesCommand extends GlobalCommand<ListProfilesCommandDefinition> {\n public async run(): Promise<void> {\n const profiles = await this.readProfilesFromFS()\n if (Object.keys(profiles).length === 0) {\n this.logger.log('No profiles found')\n return\n }\n const activeProfileName = await this.globalCache.get('activeProfile')\n const profileNames = Object.keys(profiles)\n this.logger.log(`Active profile: '${chalk.bold(activeProfileName)}'`)\n this.logger.json(profileNames)\n }\n}\n\nexport type UseProfileCommandDefinition = typeof commandDefinitions.profiles.subcommands.use\nexport class UseProfileCommand extends GlobalCommand<UseProfileCommandDefinition> {\n public async run(): Promise<void> {\n if (this.argv.profileToUse) {\n const profile = await this.readProfileFromFS(this.argv.profileToUse)\n await this.globalCache.set('activeProfile', this.argv.profileToUse)\n await _updateGlobalCache({ globalCache: this.globalCache, profileName: this.argv.profileToUse, profile })\n return\n }\n const profiles = await this.readProfilesFromFS()\n const choices = Object.entries(profiles).map(([profileName, _]) => ({\n title: profileName,\n description: '',\n value: profileName,\n }))\n const selectedProfile = await this.prompt.select('Select the profile you want to use.', { choices })\n\n if (!selectedProfile) {\n this.logger.log('No profile selected, aborting.')\n return\n }\n\n const profile = profiles[selectedProfile]\n if (!profile) throw new errors.BotpressCLIError('The selected profile could not be read')\n await this.globalCache.set('activeProfile', selectedProfile)\n await _updateGlobalCache({ globalCache: this.globalCache, profileName: selectedProfile, profile })\n }\n}\n\nconst _updateGlobalCache = async (props: {\n globalCache: utils.cache.FSKeyValueCache<GlobalCache>\n profileName: string\n profile: ProfileCredentials\n}): Promise<void> => {\n await props.globalCache.set('activeProfile', props.profileName)\n await props.globalCache.set('apiUrl', props.profile.apiUrl)\n await props.globalCache.set('token', props.profile.token)\n await props.globalCache.set('workspaceId', props.profile.workspaceId)\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,aAAwB;AACxB,aAAwB;AAExB,4BAA+D;AAGxD,MAAM,6BAA6B,oCAA8C;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A,MACP,aAAa;AAAA,MACb,OAAO;AAAA,IACT,EAAE;AACF,UAAM,kBAAkB,MAAM,KAAK,OAAO,OAAO,uCAAuC,EAAE,QAAQ,CAAC;AAEnG,QAAI,CAAC,iBAAiB;AACpB,WAAK,OAAO,IAAI,gCAAgC;AAChD;AAAA,IACF;AAEA,UAAM,UAAU,SAAS,eAAe;AACxC,QAAI,CAAC;AAAS,YAAM,IAAI,OAAO,iBAAiB,wCAAwC;AACxF,UAAM,KAAK,YAAY,IAAI,iBAAiB,eAAe;AAC3D,UAAM,mBAAmB,EAAE,aAAa,KAAK,aAAa,aAAa,iBAAiB,QAAQ,CAAC;AAAA,EACnG;AACF;AAEA,MAAM,qBAAqB,OAAO,UAIb;AACnB,QAAM,MAAM,YAAY,IAAI,iBAAiB,MAAM,WAAW;AAC9D,QAAM,MAAM,YAAY,IAAI,UAAU,MAAM,QAAQ,MAAM;AAC1D,QAAM,MAAM,YAAY,IAAI,SAAS,MAAM,QAAQ,KAAK;AACxD,QAAM,MAAM,YAAY,IAAI,eAAe,MAAM,QAAQ,WAAW;AACtE;",
4
+ "sourcesContent": ["import chalk from 'chalk'\nimport type commandDefinitions from '../command-definitions'\nimport * as consts from '../consts'\nimport * as errors from '../errors'\nimport * as utils from '../utils'\nimport { GlobalCache, GlobalCommand, ProfileCredentials } from './global-command'\n\nexport type ActiveProfileCommandDefinition = typeof commandDefinitions.profiles.subcommands.active\nexport class ActiveProfileCommand extends GlobalCommand<ActiveProfileCommandDefinition> {\n public async run(): Promise<void> {\n let activeProfileName = await this.globalCache.get('activeProfile')\n\n if (!activeProfileName) {\n this.logger.log(`No active profile set, defaulting to ${consts.defaultProfileName}`)\n activeProfileName = consts.defaultProfileName\n await this.globalCache.set('activeProfile', activeProfileName)\n }\n\n const profile = await this.readProfileFromFS(activeProfileName)\n this.logger.log('Active profile:')\n this.logger.json({ [activeProfileName]: profile })\n }\n}\n\nexport type ListProfilesCommandDefinition = typeof commandDefinitions.profiles.subcommands.list\nexport class ListProfilesCommand extends GlobalCommand<ListProfilesCommandDefinition> {\n public async run(): Promise<void> {\n const profiles = await this.readProfilesFromFS()\n if (Object.keys(profiles).length === 0) {\n this.logger.log('No profiles found')\n return\n }\n const activeProfileName = await this.globalCache.get('activeProfile')\n const profileNames = Object.keys(profiles)\n this.logger.log(`Active profile: '${chalk.bold(activeProfileName)}'`)\n this.logger.json(profileNames)\n }\n}\n\nexport type UseProfileCommandDefinition = typeof commandDefinitions.profiles.subcommands.use\nexport class UseProfileCommand extends GlobalCommand<UseProfileCommandDefinition> {\n public async run(): Promise<void> {\n const logSuccess = (profileName: string) => this.logger.success(`Now using profile \"${profileName}\"`)\n\n if (this.argv.profileToUse) {\n const profile = await this.readProfileFromFS(this.argv.profileToUse)\n await this.globalCache.set('activeProfile', this.argv.profileToUse)\n await _updateGlobalCache({ globalCache: this.globalCache, profileName: this.argv.profileToUse, profile })\n logSuccess(this.argv.profileToUse)\n return\n }\n const profiles = await this.readProfilesFromFS()\n const choices = Object.entries(profiles).map(([profileName, _]) => ({\n title: profileName,\n description: '',\n value: profileName,\n }))\n const selectedProfile = await this.prompt.select('Select the profile you want to use.', { choices })\n\n if (!selectedProfile) {\n this.logger.log('No profile selected, aborting.')\n return\n }\n\n const profile = profiles[selectedProfile]\n if (!profile) throw new errors.BotpressCLIError('The selected profile could not be read')\n await this.globalCache.set('activeProfile', selectedProfile)\n await _updateGlobalCache({ globalCache: this.globalCache, profileName: selectedProfile, profile })\n logSuccess(selectedProfile)\n }\n}\n\nconst _updateGlobalCache = async (props: {\n globalCache: utils.cache.FSKeyValueCache<GlobalCache>\n profileName: string\n profile: ProfileCredentials\n}): Promise<void> => {\n await props.globalCache.set('activeProfile', props.profileName)\n await props.globalCache.set('apiUrl', props.profile.apiUrl)\n await props.globalCache.set('token', props.profile.token)\n await props.globalCache.set('workspaceId', props.profile.workspaceId)\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;A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AAA,SAAQ,CAAC;AACxG,iBAAW,KAAK,KAAK,YAAY;AACjC;AAAA,IACF;AACA,UAAM,WAAW,MAAM,KAAK,mBAAmB;AAC/C,UAAM,UAAU,OAAO,QAAQ,QAAQ,EAAE,IAAI,CAAC,CAAC,aAAa,CAAC,OAAO;AAAA,MAClE,OAAO;AAAA,MACP,aAAa;AAAA,MACb,OAAO;AAAA,IACT,EAAE;AACF,UAAM,kBAAkB,MAAM,KAAK,OAAO,OAAO,uCAAuC,EAAE,QAAQ,CAAC;AAEnG,QAAI,CAAC,iBAAiB;AACpB,WAAK,OAAO,IAAI,gCAAgC;AAChD;AAAA,IACF;AAEA,UAAM,UAAU,SAAS,eAAe;AACxC,QAAI,CAAC;AAAS,YAAM,IAAI,OAAO,iBAAiB,wCAAwC;AACxF,UAAM,KAAK,YAAY,IAAI,iBAAiB,eAAe;AAC3D,UAAM,mBAAmB,EAAE,aAAa,KAAK,aAAa,aAAa,iBAAiB,QAAQ,CAAC;AACjG,eAAW,eAAe;AAAA,EAC5B;AACF;AAEA,MAAM,qBAAqB,OAAO,UAIb;AACnB,QAAM,MAAM,YAAY,IAAI,iBAAiB,MAAM,WAAW;AAC9D,QAAM,MAAM,YAAY,IAAI,UAAU,MAAM,QAAQ,MAAM;AAC1D,QAAM,MAAM,YAAY,IAAI,SAAS,MAAM,QAAQ,KAAK;AACxD,QAAM,MAAM,YAAY,IAAI,eAAe,MAAM,QAAQ,WAAW;AACtE;",
6
6
  "names": ["chalk", "profile"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/cli",
3
- "version": "4.16.1",
3
+ "version": "4.16.2",
4
4
  "description": "Botpress CLI",
5
5
  "scripts": {
6
6
  "build": "pnpm run bundle && pnpm run template:gen",