@botpress/cli 0.6.10 → 0.6.12

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.
@@ -30,7 +30,14 @@ __export(integration_body_exports, {
30
30
  module.exports = __toCommonJS(integration_body_exports);
31
31
  var utils = __toESM(require("../utils"));
32
32
  const prepareCreateIntegrationBody = (integration) => ({
33
- ...integration,
33
+ name: integration.name,
34
+ version: integration.version,
35
+ title: integration.title,
36
+ description: integration.description,
37
+ icon: integration.icon,
38
+ readme: integration.readme,
39
+ user: integration.user,
40
+ identifier: integration.identifier,
34
41
  secrets: void 0,
35
42
  configuration: integration.configuration ? {
36
43
  ...integration.configuration,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/api/integration-body.ts"],
4
- "sourcesContent": ["import type { Client, Integration } from '@botpress/client'\nimport * as sdk from '@botpress/sdk'\nimport * as utils from '../utils'\n\nexport type CreateIntegrationBody = Parameters<Client['createIntegration']>[0]\nexport type UpdateIntegrationBody = Parameters<Client['updateIntegration']>[0]\n\ntype UpdateIntegrationChannelsBody = NonNullable<UpdateIntegrationBody['channels']>\ntype UpdateIntegrationChannelBody = UpdateIntegrationChannelsBody[string]\n\ntype Channels = Integration['channels']\ntype Channel = Integration['channels'][string]\n\nexport const prepareCreateIntegrationBody = (integration: sdk.IntegrationDefinition): CreateIntegrationBody => ({\n ...integration,\n secrets: undefined,\n configuration: integration.configuration\n ? {\n ...integration.configuration,\n schema: utils.schema.mapZodToJsonSchema(integration.configuration),\n }\n : undefined,\n events: integration.events\n ? utils.records.mapValues(integration.events, (event) => ({\n ...event,\n schema: utils.schema.mapZodToJsonSchema(event),\n }))\n : undefined,\n actions: integration.actions\n ? utils.records.mapValues(integration.actions, (action) => ({\n ...action,\n input: {\n ...action.input,\n schema: utils.schema.mapZodToJsonSchema(action.input),\n },\n output: {\n ...action.output,\n schema: utils.schema.mapZodToJsonSchema(action.output),\n },\n }))\n : undefined,\n channels: integration.channels\n ? utils.records.mapValues(integration.channels, (channel) => ({\n ...channel,\n messages: utils.records.mapValues(channel.messages, (message) => ({\n ...message,\n schema: utils.schema.mapZodToJsonSchema(message),\n })),\n }))\n : undefined,\n states: integration.states\n ? utils.records.mapValues(integration.states, (state) => ({\n ...state,\n schema: utils.schema.mapZodToJsonSchema(state),\n }))\n : undefined,\n entities: integration.entities\n ? utils.records.mapValues(integration.entities, (entity) => ({\n ...entity,\n schema: utils.schema.mapZodToJsonSchema(entity),\n }))\n : undefined,\n})\n\nexport const prepareUpdateIntegrationBody = (\n localIntegration: UpdateIntegrationBody,\n remoteIntegration: Integration\n): UpdateIntegrationBody => {\n const actions = utils.records.setNullOnMissingValues(localIntegration.actions, remoteIntegration.actions)\n const events = utils.records.setNullOnMissingValues(localIntegration.events, remoteIntegration.events)\n const states = utils.records.setNullOnMissingValues(localIntegration.states, remoteIntegration.states)\n const entities = utils.records.setNullOnMissingValues(localIntegration.entities, remoteIntegration.entities)\n const user = {\n ...localIntegration.user,\n tags: utils.records.setNullOnMissingValues(localIntegration.user?.tags, remoteIntegration.user?.tags),\n }\n\n const channels = prepareUpdateIntegrationChannelsBody(localIntegration.channels ?? {}, remoteIntegration.channels)\n\n return {\n ...localIntegration,\n actions,\n events,\n states,\n entities,\n user,\n channels,\n }\n}\n\nconst prepareUpdateIntegrationChannelsBody = (\n localChannels: UpdateIntegrationChannelsBody,\n remoteChannels: Channels\n): UpdateIntegrationChannelsBody => {\n const channelBody: UpdateIntegrationChannelsBody = {}\n\n const zipped = utils.records.zipObjects(localChannels, remoteChannels)\n for (const [channelName, [localChannel, remoteChannel]] of Object.entries(zipped)) {\n if (localChannel && remoteChannel) {\n // channel has to be updated\n channelBody[channelName] = prepareUpdateIntegrationChannelBody(localChannel, remoteChannel)\n } else if (localChannel) {\n // channel has to be created\n channelBody[channelName] = localChannel\n continue\n } else if (remoteChannel) {\n // channel has to be deleted\n channelBody[channelName] = null\n continue\n }\n }\n\n return channelBody\n}\n\nconst prepareUpdateIntegrationChannelBody = (\n localChannel: UpdateIntegrationChannelBody,\n remoteChannel: Channel\n): UpdateIntegrationChannelBody => ({\n ...localChannel,\n messages: utils.records.setNullOnMissingValues(localChannel?.messages, remoteChannel.messages),\n message: {\n ...localChannel?.message,\n tags: utils.records.setNullOnMissingValues(localChannel?.message?.tags, remoteChannel.message.tags),\n },\n conversation: {\n ...localChannel?.conversation,\n tags: utils.records.setNullOnMissingValues(localChannel?.conversation?.tags, remoteChannel.conversation.tags),\n },\n})\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AAWhB,MAAM,+BAA+B,CAAC,iBAAmE;AAAA,EAC9G,GAAG;AAAA,EACH,SAAS;AAAA,EACT,eAAe,YAAY,gBACvB;AAAA,IACE,GAAG,YAAY;AAAA,IACf,QAAQ,MAAM,OAAO,mBAAmB,YAAY,aAAa;AAAA,EACnE,IACA;AAAA,EACJ,QAAQ,YAAY,SAChB,MAAM,QAAQ,UAAU,YAAY,QAAQ,CAAC,WAAW;AAAA,IACtD,GAAG;AAAA,IACH,QAAQ,MAAM,OAAO,mBAAmB,KAAK;AAAA,EAC/C,EAAE,IACF;AAAA,EACJ,SAAS,YAAY,UACjB,MAAM,QAAQ,UAAU,YAAY,SAAS,CAAC,YAAY;AAAA,IACxD,GAAG;AAAA,IACH,OAAO;AAAA,MACL,GAAG,OAAO;AAAA,MACV,QAAQ,MAAM,OAAO,mBAAmB,OAAO,KAAK;AAAA,IACtD;AAAA,IACA,QAAQ;AAAA,MACN,GAAG,OAAO;AAAA,MACV,QAAQ,MAAM,OAAO,mBAAmB,OAAO,MAAM;AAAA,IACvD;AAAA,EACF,EAAE,IACF;AAAA,EACJ,UAAU,YAAY,WAClB,MAAM,QAAQ,UAAU,YAAY,UAAU,CAAC,aAAa;AAAA,IAC1D,GAAG;AAAA,IACH,UAAU,MAAM,QAAQ,UAAU,QAAQ,U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Ac,aAAa,CAAC,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjF,QAAI,gBAAgB,eAAe;AAEjC,kBAAY,eAAe,oCAAoC,cAAc,aAAa;AAAA,IAC5F,WAAW,cAAc;AAEvB,kBAAY,eAAe;AAC3B;AAAA,IACF,WAAW,eAAe;AAExB,kBAAY,eAAe;AAC3B;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,sCAAsC,CAC1C,cACA,mBACkC;AAAA,EAClC,GAAG;AAAA,EACH,UAAU,MAAM,QAAQ,uBAAuB,cAAc,UAAU,cAAc,QAAQ;AAAA,EAC7F,SAAS;AAAA,IACP,GAAG,cAAc;AAAA,IACjB,MAAM,MAAM,QAAQ,uBAAuB,cAAc,SAAS,MAAM,cAAc,QAAQ,IAAI;AAAA,EACpG;AAAA,EACA,cAAc;AAAA,IACZ,GAAG,cAAc;AAAA,IACjB,MAAM,MAAM,QAAQ,uBAAuB,cAAc,cAAc,MAAM,cAAc,aAAa,IAAI;AAAA,EAC9G;AACF;",
4
+ "sourcesContent": ["import type { Client, Integration } from '@botpress/client'\nimport * as sdk from '@botpress/sdk'\nimport * as utils from '../utils'\n\nexport type CreateIntegrationBody = Parameters<Client['createIntegration']>[0]\nexport type UpdateIntegrationBody = Parameters<Client['updateIntegration']>[0]\n\ntype UpdateIntegrationChannelsBody = NonNullable<UpdateIntegrationBody['channels']>\ntype UpdateIntegrationChannelBody = UpdateIntegrationChannelsBody[string]\n\ntype Channels = Integration['channels']\ntype Channel = Integration['channels'][string]\n\nexport const prepareCreateIntegrationBody = (integration: sdk.IntegrationDefinition): CreateIntegrationBody => ({\n name: integration.name,\n version: integration.version,\n title: integration.title,\n description: integration.description,\n icon: integration.icon,\n readme: integration.readme,\n user: integration.user,\n identifier: integration.identifier,\n secrets: undefined,\n configuration: integration.configuration\n ? {\n ...integration.configuration,\n schema: utils.schema.mapZodToJsonSchema(integration.configuration),\n }\n : undefined,\n events: integration.events\n ? utils.records.mapValues(integration.events, (event) => ({\n ...event,\n schema: utils.schema.mapZodToJsonSchema(event),\n }))\n : undefined,\n actions: integration.actions\n ? utils.records.mapValues(integration.actions, (action) => ({\n ...action,\n input: {\n ...action.input,\n schema: utils.schema.mapZodToJsonSchema(action.input),\n },\n output: {\n ...action.output,\n schema: utils.schema.mapZodToJsonSchema(action.output),\n },\n }))\n : undefined,\n channels: integration.channels\n ? utils.records.mapValues(integration.channels, (channel) => ({\n ...channel,\n messages: utils.records.mapValues(channel.messages, (message) => ({\n ...message,\n schema: utils.schema.mapZodToJsonSchema(message),\n })),\n }))\n : undefined,\n states: integration.states\n ? utils.records.mapValues(integration.states, (state) => ({\n ...state,\n schema: utils.schema.mapZodToJsonSchema(state),\n }))\n : undefined,\n entities: integration.entities\n ? utils.records.mapValues(integration.entities, (entity) => ({\n ...entity,\n schema: utils.schema.mapZodToJsonSchema(entity),\n }))\n : undefined,\n})\n\nexport const prepareUpdateIntegrationBody = (\n localIntegration: UpdateIntegrationBody,\n remoteIntegration: Integration\n): UpdateIntegrationBody => {\n const actions = utils.records.setNullOnMissingValues(localIntegration.actions, remoteIntegration.actions)\n const events = utils.records.setNullOnMissingValues(localIntegration.events, remoteIntegration.events)\n const states = utils.records.setNullOnMissingValues(localIntegration.states, remoteIntegration.states)\n const entities = utils.records.setNullOnMissingValues(localIntegration.entities, remoteIntegration.entities)\n const user = {\n ...localIntegration.user,\n tags: utils.records.setNullOnMissingValues(localIntegration.user?.tags, remoteIntegration.user?.tags),\n }\n\n const channels = prepareUpdateIntegrationChannelsBody(localIntegration.channels ?? {}, remoteIntegration.channels)\n\n return {\n ...localIntegration,\n actions,\n events,\n states,\n entities,\n user,\n channels,\n }\n}\n\nconst prepareUpdateIntegrationChannelsBody = (\n localChannels: UpdateIntegrationChannelsBody,\n remoteChannels: Channels\n): UpdateIntegrationChannelsBody => {\n const channelBody: UpdateIntegrationChannelsBody = {}\n\n const zipped = utils.records.zipObjects(localChannels, remoteChannels)\n for (const [channelName, [localChannel, remoteChannel]] of Object.entries(zipped)) {\n if (localChannel && remoteChannel) {\n // channel has to be updated\n channelBody[channelName] = prepareUpdateIntegrationChannelBody(localChannel, remoteChannel)\n } else if (localChannel) {\n // channel has to be created\n channelBody[channelName] = localChannel\n continue\n } else if (remoteChannel) {\n // channel has to be deleted\n channelBody[channelName] = null\n continue\n }\n }\n\n return channelBody\n}\n\nconst prepareUpdateIntegrationChannelBody = (\n localChannel: UpdateIntegrationChannelBody,\n remoteChannel: Channel\n): UpdateIntegrationChannelBody => ({\n ...localChannel,\n messages: utils.records.setNullOnMissingValues(localChannel?.messages, remoteChannel.messages),\n message: {\n ...localChannel?.message,\n tags: utils.records.setNullOnMissingValues(localChannel?.message?.tags, remoteChannel.message.tags),\n },\n conversation: {\n ...localChannel?.conversation,\n tags: utils.records.setNullOnMissingValues(localChannel?.conversation?.tags, remoteChannel.conversation.tags),\n },\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AAWhB,MAAM,+BAA+B,CAAC,iBAAmE;AAAA,EAC9G,MAAM,YAAY;AAAA,EAClB,SAAS,YAAY;AAAA,EACrB,OAAO,YAAY;AAAA,EACnB,aAAa,YAAY;AAAA,EACzB,MAAM,YAAY;AAAA,EAClB,QAAQ,YAAY;AAAA,EACpB,MAAM,YAAY;AAAA,EAClB,YAAY,YAAY;AAAA,EACxB,SAAS;AAAA,EACT,eAAe,YAAY,gBACvB;AAAA,IACE,GAAG,YAAY;AAAA,IACf,QAAQ,MAAM,OAAO,mBAAmB,YAAY,aAAa;AAAA,EACnE,IACA;AAAA,EACJ,QAAQ,YAAY,SAChB,MAAM,QAAQ,UAAU,YAAY,QAAQ,CAAC,WAAW;AAAA,IACtD,GAAG;AAAA,IACH,QAAQ,MAAM,OAAO,mBAAmB,KAAK;AAAA,EAC/C,EAAE,IACF;AAAA,EACJ,SAAS,YAAY,UACjB,MAAM,QAAQ,UAAU,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AAM,MAAM,QAAQ,uBAAuB,iBAAiB,MAAM,MAAM,kBAAkB,MAAM,IAAI;AAAA,EACtG;AAEA,QAAM,WAAW,qCAAqC,iBAAiB,YAAY,CAAC,GAAG,kBAAkB,QAAQ;AAEjH,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEA,MAAM,uCAAuC,CAC3C,eACA,mBACkC;AAClC,QAAM,cAA6C,CAAC;AAEpD,QAAM,SAAS,MAAM,QAAQ,WAAW,eAAe,cAAc;AACrE,aAAW,CAAC,aAAa,CAAC,cAAc,aAAa,CAAC,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjF,QAAI,gBAAgB,eAAe;AAEjC,kBAAY,eAAe,oCAAoC,cAAc,aAAa;AAAA,IAC5F,WAAW,cAAc;AAEvB,kBAAY,eAAe;AAC3B;AAAA,IACF,WAAW,eAAe;AAExB,kBAAY,eAAe;AAC3B;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,sCAAsC,CAC1C,cACA,mBACkC;AAAA,EAClC,GAAG;AAAA,EACH,UAAU,MAAM,QAAQ,uBAAuB,cAAc,UAAU,cAAc,QAAQ;AAAA,EAC7F,SAAS;AAAA,IACP,GAAG,cAAc;AAAA,IACjB,MAAM,MAAM,QAAQ,uBAAuB,cAAc,SAAS,MAAM,cAAc,QAAQ,IAAI;AAAA,EACpG;AAAA,EACA,cAAc;AAAA,IACZ,GAAG,cAAc;AAAA,IACjB,MAAM,MAAM,QAAQ,uBAAuB,cAAc,cAAc,MAAM,cAAc,aAAa,IAAI;AAAA,EAC9G;AACF;",
6
6
  "names": []
7
7
  }
@@ -52,6 +52,7 @@ var command_definitions_default = {
52
52
  generate: { description: "Generate typings for intellisense", schema: config.schemas.generate, alias: "gen" },
53
53
  bundle: { description: "Bundle a botpress project", schema: config.schemas.bundle },
54
54
  build: { description: "Generate typings and bundle a botpress project", schema: config.schemas.build },
55
+ read: { description: "Read and parse an integration definition", schema: config.schemas.read },
55
56
  serve: { description: "Serve your project locally", schema: config.schemas.serve },
56
57
  deploy: { description: "Deploy your project to the cloud", schema: config.schemas.deploy },
57
58
  add: { description: "Install an integration in your bot", schema: config.schemas.add },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/command-definitions.ts"],
4
- "sourcesContent": ["import type { DefinitionTree } from './command-tree'\nimport * as config from './config'\n\nexport default {\n login: { description: 'Login to Botpress Cloud', schema: config.schemas.login },\n logout: { description: 'Logout of Botpress Cloud', schema: config.schemas.logout },\n bots: {\n description: 'Bot related commands',\n subcommands: {\n create: { description: 'Create new bot', schema: config.schemas.createBot, alias: 'new' },\n get: { description: 'Get bot', schema: config.schemas.getBot },\n delete: { description: 'Delete bot', schema: config.schemas.deleteBot },\n list: { description: 'List bots', schema: config.schemas.listBots, alias: 'ls' },\n },\n },\n integrations: {\n description: 'Integration related commands',\n subcommands: {\n get: { description: 'Get integration', schema: config.schemas.getIntegration },\n delete: { description: 'Delete integration', schema: config.schemas.deleteIntegration },\n list: { description: 'List integrations', schema: config.schemas.listIntegrations, alias: 'ls' },\n },\n },\n init: { description: 'Initialize a new project', schema: config.schemas.init },\n generate: { description: 'Generate typings for intellisense', schema: config.schemas.generate, alias: 'gen' },\n bundle: { description: 'Bundle a botpress project', schema: config.schemas.bundle },\n build: { description: 'Generate typings and bundle a botpress project', schema: config.schemas.build },\n serve: { description: 'Serve your project locally', schema: config.schemas.serve },\n deploy: { description: 'Deploy your project to the cloud', schema: config.schemas.deploy },\n add: { description: 'Install an integration in your bot', schema: config.schemas.add },\n dev: { description: 'Run your project in dev mode', schema: config.schemas.dev },\n} satisfies DefinitionTree\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AAExB,IAAO,8BAAQ;AAAA,EACb,OAAO,EAAE,aAAa,2BAA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E,aAAa,gCAAgC,QAAQ,OAAO,QAAQ,IAAI;AACjF;",
4
+ "sourcesContent": ["import type { DefinitionTree } from './command-tree'\nimport * as config from './config'\n\nexport default {\n login: { description: 'Login to Botpress Cloud', schema: config.schemas.login },\n logout: { description: 'Logout of Botpress Cloud', schema: config.schemas.logout },\n bots: {\n description: 'Bot related commands',\n subcommands: {\n create: { description: 'Create new bot', schema: config.schemas.createBot, alias: 'new' },\n get: { description: 'Get bot', schema: config.schemas.getBot },\n delete: { description: 'Delete bot', schema: config.schemas.deleteBot },\n list: { description: 'List bots', schema: config.schemas.listBots, alias: 'ls' },\n },\n },\n integrations: {\n description: 'Integration related commands',\n subcommands: {\n get: { description: 'Get integration', schema: config.schemas.getIntegration },\n delete: { description: 'Delete integration', schema: config.schemas.deleteIntegration },\n list: { description: 'List integrations', schema: config.schemas.listIntegrations, alias: 'ls' },\n },\n },\n init: { description: 'Initialize a new project', schema: config.schemas.init },\n generate: { description: 'Generate typings for intellisense', schema: config.schemas.generate, alias: 'gen' },\n bundle: { description: 'Bundle a botpress project', schema: config.schemas.bundle },\n build: { description: 'Generate typings and bundle a botpress project', schema: config.schemas.build },\n read: { description: 'Read and parse an integration definition', schema: config.schemas.read },\n serve: { description: 'Serve your project locally', schema: config.schemas.serve },\n deploy: { description: 'Deploy your project to the cloud', schema: config.schemas.deploy },\n add: { description: 'Install an integration in your bot', schema: config.schemas.add },\n dev: { description: 'Run your project in dev mode', schema: config.schemas.dev },\n} satisfies DefinitionTree\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AAExB,IAAO,8BAAQ;AAAA,EACb,OAAO,EAAE,aAAa,2BAA2B,QAAQ,OAAO,QAAQ,MAAM;AAAA,EAC9E,QAAQ,EAAE,aAAa,4BAA4B,QAAQ,OAAO,QAAQ,OAAO;AAAA,EACjF,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,aAAa;AAAA,MACX,Q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Command extends import_project_command.ProjectCommand {
103
103
  identifier: {
104
104
  extractScript: identifierExtractScriptFileContent,
105
105
  fallbackHandlerScript: fallbackHandlerScriptFileContent
106
- }
106
+ },
107
+ public: this.argv.public
107
108
  };
108
109
  const startedMessage = `Deploying integration ${import_chalk.default.bold(integrationDef.name)} v${integrationDef.version}...`;
109
110
  const successMessage = "Integration deployed";
@@ -111,7 +112,8 @@ class DeployCommand extends import_project_command.ProjectCommand {
111
112
  const updateBody = (0, import_integration_body.prepareUpdateIntegrationBody)(
112
113
  {
113
114
  id: integration.id,
114
- ...createBody
115
+ ...createBody,
116
+ public: this.argv.public
115
117
  },
116
118
  integration
117
119
  );
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/command-implementations/deploy-command.ts"],
4
- "sourcesContent": ["import type * as client from '@botpress/client'\nimport type * as sdk from '@botpress/sdk'\nimport chalk from 'chalk'\nimport * as fs from 'fs'\nimport { prepareCreateBotBody, prepareUpdateBotBody } from '../api/bot-body'\nimport type { ApiClient } from '../api/client'\nimport {\n prepareUpdateIntegrationBody,\n CreateIntegrationBody,\n prepareCreateIntegrationBody,\n} from '../api/integration-body'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport * as utils from '../utils'\nimport { BuildCommand } from './build-command'\nimport { ProjectCommand } from './project-command'\n\nexport type DeployCommandDefinition = typeof commandDefinitions.deploy\nexport class DeployCommand extends ProjectCommand<DeployCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n if (!this.argv.noBuild) {\n await this._runBuild() // This ensures the bundle is always synced with source code\n }\n\n const integrationDef = await this.readIntegrationDefinitionFromFS()\n if (integrationDef) {\n return this._deployIntegration(api, integrationDef)\n }\n return this._deployBot(api, this.argv.botId, this.argv.createNewBot)\n }\n\n private async _runBuild() {\n return new BuildCommand(this.api, this.prompt, this.logger, this.argv).run()\n }\n\n private async _deployIntegration(api: ApiClient, integrationDef: sdk.IntegrationDefinition) {\n const outfile = this.projectPaths.abs.outFile\n const code = await fs.promises.readFile(outfile, 'utf-8')\n\n const {\n name,\n version,\n icon: iconRelativeFilePath,\n readme: readmeRelativeFilePath,\n identifier,\n configuration,\n } = integrationDef\n\n if (iconRelativeFilePath && !iconRelativeFilePath.toLowerCase().endsWith('.svg')) {\n throw new errors.BotpressCLIError('Icon must be an SVG file')\n }\n\n const iconFileContent = await this._readMediaFile('icon', iconRelativeFilePath)\n const readmeFileContent = await this._readMediaFile('readme', readmeRelativeFilePath)\n const identifierExtractScriptFileContent = await this._readFile(identifier?.extractScript)\n const fallbackHandlerScriptFileContent = await this._readFile(identifier?.fallbackHandlerScript)\n const identifierLinkTemplateFileContent = await this._readFile(configuration?.identifier?.linkTemplateScript)\n\n const integration = await api.findIntegration({ type: 'name', name, version })\n if (integration && !integration.workspaceId) {\n throw new errors.BotpressCLIError(\n `Public integration ${integrationDef.name} v${integrationDef.version} is already deployed in another workspace.`\n )\n }\n\n let message: string\n if (integration) {\n this.logger.warn('Integration already exists. If you decide to deploy, it will overwrite the existing one.')\n message = `Are you sure you want to override integration ${integrationDef.name} v${integrationDef.version}?`\n } else {\n message = `Are you sure you want to deploy integration ${integrationDef.name} v${integrationDef.version}?`\n }\n\n const confirm = await this.prompt.confirm(message)\n if (!confirm) {\n this.logger.log('Aborted')\n return\n }\n\n let createBody: CreateIntegrationBody = prepareCreateIntegrationBody(integrationDef)\n createBody = {\n ...createBody,\n code,\n icon: iconFileContent,\n readme: readmeFileContent,\n configuration: {\n ...createBody.configuration,\n identifier: {\n ...(createBody.configuration?.identifier ?? {}),\n linkTemplateScript: identifierLinkTemplateFileContent,\n },\n },\n identifier: {\n extractScript: identifierExtractScriptFileContent,\n fallbackHandlerScript: fallbackHandlerScriptFileContent,\n },\n }\n\n const startedMessage = `Deploying integration ${chalk.bold(integrationDef.name)} v${integrationDef.version}...`\n const successMessage = 'Integration deployed'\n if (integration) {\n const updateBody = prepareUpdateIntegrationBody(\n {\n id: integration.id,\n ...createBody,\n },\n integration\n )\n\n const { secrets: knownSecrets } = integration\n updateBody.secrets = await this.promptSecrets(integrationDef, this.argv, { knownSecrets })\n this._detectDeprecatedFeatures(integrationDef, { allowDeprecated: true })\n\n const line = this.logger.line()\n line.started(startedMessage)\n await api.client.updateIntegration(updateBody).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not update integration \"${integrationDef.name}\"`)\n })\n line.success(successMessage)\n } else {\n const createSecrets = await this.promptSecrets(integrationDef, this.argv)\n createBody.secrets = utils.records.filterValues(createSecrets, utils.guards.is.notNull)\n this._detectDeprecatedFeatures(integrationDef, this.argv)\n\n const line = this.logger.line()\n line.started(startedMessage)\n await api.client.createIntegration(createBody).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not create integration \"${integrationDef.name}\"`)\n })\n line.success(successMessage)\n }\n }\n\n private _detectDeprecatedFeatures(\n integrationDef: sdk.IntegrationDefinition,\n opts: { allowDeprecated?: boolean } = {}\n ) {\n const deprecatedFields: string[] = []\n const { user, channels } = integrationDef\n if (user?.creation?.enabled) {\n deprecatedFields.push('user.creation')\n }\n\n for (const [channelName, channel] of Object.entries(channels ?? {})) {\n if (channel?.conversation?.creation?.enabled) {\n deprecatedFields.push(`channels.${channelName}.creation`)\n }\n }\n\n if (!deprecatedFields.length) {\n return\n }\n\n const errorMessage = `The following fields of the integration's definition are deprecated: ${deprecatedFields.join(\n ', '\n )}`\n\n if (opts.allowDeprecated) {\n this.logger.warn(errorMessage)\n } else {\n throw new errors.BotpressCLIError(errorMessage)\n }\n }\n\n private _readFile = async (filePath: string | undefined): Promise<string | undefined> => {\n if (!filePath) {\n return undefined\n }\n\n const absoluteFilePath = utils.path.absoluteFrom(this.projectPaths.abs.workDir, filePath)\n return fs.promises.readFile(absoluteFilePath, 'utf-8').catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not read file \"${absoluteFilePath}\"`)\n })\n }\n\n private _readMediaFile = async (\n filePurpose: 'icon' | 'readme',\n filePath: string | undefined\n ): Promise<string | undefined> => {\n if (!filePath) {\n return undefined\n }\n\n const absoluteFilePath = utils.path.absoluteFrom(this.projectPaths.abs.workDir, filePath)\n return fs.promises.readFile(absoluteFilePath, 'base64').catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not read ${filePurpose} file \"${absoluteFilePath}\"`)\n })\n }\n\n private async _deployBot(api: ApiClient, argvBotId: string | undefined, argvCreateNew: boolean | undefined) {\n const outfile = this.projectPaths.abs.outFile\n const code = await fs.promises.readFile(outfile, 'utf-8')\n const { default: botImpl } = utils.require.requireJsFile<{ default: sdk.Bot }>(outfile)\n\n let bot: client.Bot\n if (argvBotId && argvCreateNew) {\n throw new errors.BotpressCLIError('Cannot specify both --botId and --createNew')\n } else if (argvCreateNew) {\n const confirm = await this.prompt.confirm('Are you sure you want to create a new bot ?')\n if (!confirm) {\n this.logger.log('Aborted')\n return\n }\n\n bot = await this._createNewBot(api)\n } else {\n bot = await this._getExistingBot(api, argvBotId)\n\n const confirm = await this.prompt.confirm(`Are you sure you want to deploy the bot \"${bot.name}\"?`)\n if (!confirm) {\n this.logger.log('Aborted')\n return\n }\n }\n\n const line = this.logger.line()\n line.started(`Deploying bot ${chalk.bold(bot.name)}...`)\n\n const integrationInstances = await this.fetchBotIntegrationInstances(botImpl, api)\n const updateBotBody = prepareUpdateBotBody(\n {\n ...prepareCreateBotBody(botImpl),\n id: bot.id,\n code,\n integrations: integrationInstances,\n },\n bot\n )\n\n const { bot: updatedBot } = await api.client.updateBot(updateBotBody).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not update bot \"${bot.name}\"`)\n })\n line.success('Bot deployed')\n this.displayWebhookUrls(updatedBot)\n }\n\n private async _createNewBot(api: ApiClient): Promise<client.Bot> {\n const line = this.logger.line()\n const { bot: createdBot } = await api.client.createBot({}).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not create bot')\n })\n line.success(`Bot created with ID \"${createdBot.id}\" and name \"${createdBot.name}\"`)\n await this.projectCache.set('botId', createdBot.id)\n return createdBot\n }\n\n private async _getExistingBot(api: ApiClient, botId: string | undefined): Promise<client.Bot> {\n const promptedBotId = await this.projectCache.sync('botId', botId, async (defaultId) => {\n const userBots = await api\n .listAllPages(api.client.listBots, (r) => r.bots)\n .catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not fetch existing bots')\n })\n\n if (!userBots.length) {\n throw new errors.NoBotsFoundError()\n }\n\n const initial = userBots.find((bot) => bot.id === defaultId)\n\n const prompted = await this.prompt.select('Which bot do you want to deploy?', {\n initial: initial && { title: initial.name, value: initial.id },\n choices: userBots.map((bot) => ({ title: bot.name, value: bot.id })),\n })\n\n if (!prompted) {\n throw new errors.ParamRequiredError('Bot Id')\n }\n\n return prompted\n })\n\n const { bot: fetchedBot } = await api.client.getBot({ id: promptedBotId }).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not get bot info')\n })\n\n return fetchedBot\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAkB;AAClB,SAAoB;AACpB,sBAA2D;AAE3D,8BAIO;AAEP,aAAwB;AACxB,YAAuB;AACvB,2BAA6B;AAC7B,6BAA+B;AAGxB,MAAM,sBAAsB,sCAAwC;AAAA,EACzE,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAE3D,QAAI,CAAC,KAAK,KAAK,SAAS;AACtB,YAAM,KAAK,UAAU;AAAA,IACvB;AAEA,UAAM,iBAAiB,MAAM,KAAK,gCAAgC;AAClE,QAAI,gBAAgB;AAClB,aAAO,KAAK,mBAAmB,KAAK,cAAc;AAAA,IACpD;AACA,WAAO,KAAK,WAAW,KAAK,KAAK,KAAK,OAAO,KAAK,KAAK,YAAY;AAAA,EACrE;AAAA,EAEA,MAAc,YAAY;AACxB,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WAAW,IAAI,MAAM,IAAI,OAAO,OAAO,EAAE,IAAI,cAAc,CAAC,EAAE,MAAM,CAAC,WAAW;AAC3F,YAAM,OAAO,iBAAiB,KAAK,QAAQ,wBAAwB;AAAA,IACrE,CAAC;AAED,WAAO;AAAA,EACT;AACF;",
4
+ "sourcesContent": ["import type * as client from '@botpress/client'\nimport type * as sdk from '@botpress/sdk'\nimport chalk from 'chalk'\nimport * as fs from 'fs'\nimport { prepareCreateBotBody, prepareUpdateBotBody } from '../api/bot-body'\nimport type { ApiClient } from '../api/client'\nimport {\n prepareUpdateIntegrationBody,\n CreateIntegrationBody,\n prepareCreateIntegrationBody,\n} from '../api/integration-body'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport * as utils from '../utils'\nimport { BuildCommand } from './build-command'\nimport { ProjectCommand } from './project-command'\n\nexport type DeployCommandDefinition = typeof commandDefinitions.deploy\nexport class DeployCommand extends ProjectCommand<DeployCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n if (!this.argv.noBuild) {\n await this._runBuild() // This ensures the bundle is always synced with source code\n }\n\n const integrationDef = await this.readIntegrationDefinitionFromFS()\n if (integrationDef) {\n return this._deployIntegration(api, integrationDef)\n }\n return this._deployBot(api, this.argv.botId, this.argv.createNewBot)\n }\n\n private async _runBuild() {\n return new BuildCommand(this.api, this.prompt, this.logger, this.argv).run()\n }\n\n private async _deployIntegration(api: ApiClient, integrationDef: sdk.IntegrationDefinition) {\n const outfile = this.projectPaths.abs.outFile\n const code = await fs.promises.readFile(outfile, 'utf-8')\n\n const {\n name,\n version,\n icon: iconRelativeFilePath,\n readme: readmeRelativeFilePath,\n identifier,\n configuration,\n } = integrationDef\n\n if (iconRelativeFilePath && !iconRelativeFilePath.toLowerCase().endsWith('.svg')) {\n throw new errors.BotpressCLIError('Icon must be an SVG file')\n }\n\n const iconFileContent = await this._readMediaFile('icon', iconRelativeFilePath)\n const readmeFileContent = await this._readMediaFile('readme', readmeRelativeFilePath)\n const identifierExtractScriptFileContent = await this._readFile(identifier?.extractScript)\n const fallbackHandlerScriptFileContent = await this._readFile(identifier?.fallbackHandlerScript)\n const identifierLinkTemplateFileContent = await this._readFile(configuration?.identifier?.linkTemplateScript)\n\n const integration = await api.findIntegration({ type: 'name', name, version })\n if (integration && !integration.workspaceId) {\n throw new errors.BotpressCLIError(\n `Public integration ${integrationDef.name} v${integrationDef.version} is already deployed in another workspace.`\n )\n }\n\n let message: string\n if (integration) {\n this.logger.warn('Integration already exists. If you decide to deploy, it will overwrite the existing one.')\n message = `Are you sure you want to override integration ${integrationDef.name} v${integrationDef.version}?`\n } else {\n message = `Are you sure you want to deploy integration ${integrationDef.name} v${integrationDef.version}?`\n }\n\n const confirm = await this.prompt.confirm(message)\n if (!confirm) {\n this.logger.log('Aborted')\n return\n }\n\n let createBody: CreateIntegrationBody = prepareCreateIntegrationBody(integrationDef)\n createBody = {\n ...createBody,\n code,\n icon: iconFileContent,\n readme: readmeFileContent,\n configuration: {\n ...createBody.configuration,\n identifier: {\n ...(createBody.configuration?.identifier ?? {}),\n linkTemplateScript: identifierLinkTemplateFileContent,\n },\n },\n identifier: {\n extractScript: identifierExtractScriptFileContent,\n fallbackHandlerScript: fallbackHandlerScriptFileContent,\n },\n public: this.argv.public,\n }\n\n const startedMessage = `Deploying integration ${chalk.bold(integrationDef.name)} v${integrationDef.version}...`\n const successMessage = 'Integration deployed'\n if (integration) {\n const updateBody = prepareUpdateIntegrationBody(\n {\n id: integration.id,\n ...createBody,\n public: this.argv.public,\n },\n integration\n )\n\n const { secrets: knownSecrets } = integration\n updateBody.secrets = await this.promptSecrets(integrationDef, this.argv, { knownSecrets })\n this._detectDeprecatedFeatures(integrationDef, { allowDeprecated: true })\n\n const line = this.logger.line()\n line.started(startedMessage)\n await api.client.updateIntegration(updateBody).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not update integration \"${integrationDef.name}\"`)\n })\n line.success(successMessage)\n } else {\n const createSecrets = await this.promptSecrets(integrationDef, this.argv)\n createBody.secrets = utils.records.filterValues(createSecrets, utils.guards.is.notNull)\n this._detectDeprecatedFeatures(integrationDef, this.argv)\n\n const line = this.logger.line()\n line.started(startedMessage)\n await api.client.createIntegration(createBody).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not create integration \"${integrationDef.name}\"`)\n })\n line.success(successMessage)\n }\n }\n\n private _detectDeprecatedFeatures(\n integrationDef: sdk.IntegrationDefinition,\n opts: { allowDeprecated?: boolean } = {}\n ) {\n const deprecatedFields: string[] = []\n const { user, channels } = integrationDef\n if (user?.creation?.enabled) {\n deprecatedFields.push('user.creation')\n }\n\n for (const [channelName, channel] of Object.entries(channels ?? {})) {\n if (channel?.conversation?.creation?.enabled) {\n deprecatedFields.push(`channels.${channelName}.creation`)\n }\n }\n\n if (!deprecatedFields.length) {\n return\n }\n\n const errorMessage = `The following fields of the integration's definition are deprecated: ${deprecatedFields.join(\n ', '\n )}`\n\n if (opts.allowDeprecated) {\n this.logger.warn(errorMessage)\n } else {\n throw new errors.BotpressCLIError(errorMessage)\n }\n }\n\n private _readFile = async (filePath: string | undefined): Promise<string | undefined> => {\n if (!filePath) {\n return undefined\n }\n\n const absoluteFilePath = utils.path.absoluteFrom(this.projectPaths.abs.workDir, filePath)\n return fs.promises.readFile(absoluteFilePath, 'utf-8').catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not read file \"${absoluteFilePath}\"`)\n })\n }\n\n private _readMediaFile = async (\n filePurpose: 'icon' | 'readme',\n filePath: string | undefined\n ): Promise<string | undefined> => {\n if (!filePath) {\n return undefined\n }\n\n const absoluteFilePath = utils.path.absoluteFrom(this.projectPaths.abs.workDir, filePath)\n return fs.promises.readFile(absoluteFilePath, 'base64').catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not read ${filePurpose} file \"${absoluteFilePath}\"`)\n })\n }\n\n private async _deployBot(api: ApiClient, argvBotId: string | undefined, argvCreateNew: boolean | undefined) {\n const outfile = this.projectPaths.abs.outFile\n const code = await fs.promises.readFile(outfile, 'utf-8')\n const { default: botImpl } = utils.require.requireJsFile<{ default: sdk.Bot }>(outfile)\n\n let bot: client.Bot\n if (argvBotId && argvCreateNew) {\n throw new errors.BotpressCLIError('Cannot specify both --botId and --createNew')\n } else if (argvCreateNew) {\n const confirm = await this.prompt.confirm('Are you sure you want to create a new bot ?')\n if (!confirm) {\n this.logger.log('Aborted')\n return\n }\n\n bot = await this._createNewBot(api)\n } else {\n bot = await this._getExistingBot(api, argvBotId)\n\n const confirm = await this.prompt.confirm(`Are you sure you want to deploy the bot \"${bot.name}\"?`)\n if (!confirm) {\n this.logger.log('Aborted')\n return\n }\n }\n\n const line = this.logger.line()\n line.started(`Deploying bot ${chalk.bold(bot.name)}...`)\n\n const integrationInstances = await this.fetchBotIntegrationInstances(botImpl, api)\n const updateBotBody = prepareUpdateBotBody(\n {\n ...prepareCreateBotBody(botImpl),\n id: bot.id,\n code,\n integrations: integrationInstances,\n },\n bot\n )\n\n const { bot: updatedBot } = await api.client.updateBot(updateBotBody).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not update bot \"${bot.name}\"`)\n })\n line.success('Bot deployed')\n this.displayWebhookUrls(updatedBot)\n }\n\n private async _createNewBot(api: ApiClient): Promise<client.Bot> {\n const line = this.logger.line()\n const { bot: createdBot } = await api.client.createBot({}).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not create bot')\n })\n line.success(`Bot created with ID \"${createdBot.id}\" and name \"${createdBot.name}\"`)\n await this.projectCache.set('botId', createdBot.id)\n return createdBot\n }\n\n private async _getExistingBot(api: ApiClient, botId: string | undefined): Promise<client.Bot> {\n const promptedBotId = await this.projectCache.sync('botId', botId, async (defaultId) => {\n const userBots = await api\n .listAllPages(api.client.listBots, (r) => r.bots)\n .catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not fetch existing bots')\n })\n\n if (!userBots.length) {\n throw new errors.NoBotsFoundError()\n }\n\n const initial = userBots.find((bot) => bot.id === defaultId)\n\n const prompted = await this.prompt.select('Which bot do you want to deploy?', {\n initial: initial && { title: initial.name, value: initial.id },\n choices: userBots.map((bot) => ({ title: bot.name, value: bot.id })),\n })\n\n if (!prompted) {\n throw new errors.ParamRequiredError('Bot Id')\n }\n\n return prompted\n })\n\n const { bot: fetchedBot } = await api.client.getBot({ id: promptedBotId }).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not get bot info')\n })\n\n return fetchedBot\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAkB;AAClB,SAAoB;AACpB,sBAA2D;AAE3D,8BAIO;AAEP,aAAwB;AACxB,YAAuB;AACvB,2BAA6B;AAC7B,6BAA+B;AAGxB,MAAM,sBAAsB,sCAAwC;AAAA,EACzE,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAE3D,QAAI,CAAC,KAAK,KAAK,SAAS;AACtB,YAAM,KAAK,UAAU;AAAA,IACvB;AAEA,UAAM,iBAAiB,MAAM,KAAK,gCAAgC;AAClE,QAAI,gBAAgB;AAClB,aAAO,KAAK,mBAAmB,KAAK,cAAc;AAAA,IACpD;AACA,WAAO,KAAK,WAAW,KAAK,KAAK,KAAK,OAAO,KAAK,KAAK,YAAY;AAAA,EACrE;AAAA,EAEA,MAAc,YAAY;AACxB,WAAO,IAAI,kCAAa,KAAK,KAAK,KAAK,QAAQ,KAAK,QAAQ,KAAK,IAAI,EAAE,IAAI;AAAA,EAC7E;AAAA,EAEA,MAAc,mBAAmB,KAAgB,gBAA2C;AAC1F,UAAM,UAAU,KAAK,aAAa,IAAI;AACtC,UAAM,OAAO,MAAM,GAAG,SAAS,SAAS,SAAS,OAAO;AAExD,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA,MAAM;AAAA,MAC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 var import_init_command = require("./init-command");
41
41
  var integrations = __toESM(require("./integration-commands"));
42
42
  var import_login_command = require("./login-command");
43
43
  var import_logout_command = require("./logout-command");
44
+ var import_read_command = require("./read-command");
44
45
  var import_serve_command = require("./serve-command");
45
46
  const getHandler = (cls) => async (argv) => {
46
47
  const logger = new import_logger.Logger(argv);
@@ -69,6 +70,7 @@ var command_implementations_default = {
69
70
  generate: getHandler(import_gen_command.GenerateCommand),
70
71
  bundle: getHandler(import_bundle_command.BundleCommand),
71
72
  build: getHandler(import_build_command.BuildCommand),
73
+ read: getHandler(import_read_command.ReadCommand),
72
74
  serve: getHandler(import_serve_command.ServeCommand),
73
75
  deploy: getHandler(import_deploy_command.DeployCommand),
74
76
  add: getHandler(import_add_command.AddCommand),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/command-implementations/index.ts"],
4
- "sourcesContent": ["import { ApiClient } from '../api/client'\nimport type commandDefinitions from '../command-definitions'\nimport type { ImplementationTree } from '../command-tree'\nimport { Logger } from '../logger'\nimport type { CommandArgv } from '../typings'\nimport * as utils from '../utils'\nimport { AddCommand } from './add-command'\nimport type { BaseCommand } from './base-command'\nimport * as bots from './bot-commands'\nimport { BuildCommand } from './build-command'\nimport { BundleCommand } from './bundle-command'\nimport { DeployCommand } from './deploy-command'\nimport { DevCommand } from './dev-command'\nimport { GenerateCommand } from './gen-command'\nimport type { GlobalCommand, GlobalCommandDefinition } from './global-command'\nimport { InitCommand } from './init-command'\nimport * as integrations from './integration-commands'\nimport { LoginCommand } from './login-command'\nimport { LogoutCommand } from './logout-command'\nimport { ServeCommand } from './serve-command'\n\ntype GlobalCtor<C extends GlobalCommandDefinition> = new (\n ...args: ConstructorParameters<typeof GlobalCommand<C>>\n) => BaseCommand<C>\n\nconst getHandler =\n <C extends GlobalCommandDefinition>(cls: GlobalCtor<C>) =>\n async (argv: CommandArgv<C>) => {\n const logger = new Logger(argv)\n const prompt = new utils.prompt.CLIPrompt(argv, logger)\n return new cls(ApiClient, prompt, logger, argv).handler()\n }\n\nexport default {\n login: getHandler(LoginCommand),\n logout: getHandler(LogoutCommand),\n bots: {\n subcommands: {\n create: getHandler(bots.CreateBotCommand),\n get: getHandler(bots.GetBotCommand),\n delete: getHandler(bots.DeleteBotCommand),\n list: getHandler(bots.ListBotsCommand),\n },\n },\n integrations: {\n subcommands: {\n get: getHandler(integrations.GetIntegrationCommand),\n list: getHandler(integrations.ListIntegrationsCommand),\n delete: getHandler(integrations.DeleteIntegrationCommand),\n },\n },\n init: getHandler(InitCommand),\n generate: getHandler(GenerateCommand),\n bundle: getHandler(BundleCommand),\n build: getHandler(BuildCommand),\n serve: getHandler(ServeCommand),\n deploy: getHandler(DeployCommand),\n add: getHandler(AddCommand),\n dev: getHandler(DevCommand),\n} satisfies ImplementationTree<typeof commandDefinitions>\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA0B;AAG1B,oBAAuB;AAEvB,YAAuB;AACvB,yBAA2B;AAE3B,WAAsB;AACtB,2BAA6B;AAC7B,4BAA8B;AAC9B,4BAA8B;AAC9B,yBAA2B;AAC3B,yBAAgC;AAEhC,0BAA4B;AAC5B,mBAA8B;AAC9B,2BAA6B;AAC7B,4BAA8B;AAC9B,2BAA6B;AAM7B,MAAM,aACJ,CAAoC,QACpC,OAAO,SAAyB;AAC9B,QAAM,SAAS,IAAI,qBAAO,IAAI;AAC9B,QAAM,SAAS,IAAI,MAAM,OAAO,UAAU,MAAM,MAAM;AACtD,SAAO,IAAI,IAAI,yBAAW,QAAQ,QAAQ,IAAI,EAAE,QAAQ;AAC1D;AAEF,IAAO,kCAAQ;AAAA,EACb,OAAO,WAAW,iCAAY;AAAA,EAC9B,QAAQ,WAAW,mCAAa;AAAA,EAChC,MAAM;AAAA,IACJ,aAAa;AAAA,MACX,QAAQ,WAAW,KAAK,gBAAgB;AAAA,MACxC,KAAK,WAAW,KAAK,aAAa;AAAA,MAClC,QAAQ,WAAW,KAAK,gBAAgB;AAAA,MACxC,MAAM,WAAW,KAAK,eAAe;AAAA,IACvC;AAAA,EACF;AAAA,EACA,cAAc;AAAA,IACZ,aAAa;AAAA,MACX,KAAK,WAAW,aAAa,qBAAqB;AAAA,MAClD,MAAM,WAAW,aAAa,uBAAuB;AAAA,MACrD,QAAQ,WAAW,aAAa,wBAAwB;AAAA,IAC1D;AAAA,EACF;AAAA,EACA,MAAM,WAAW,+BAAW;AAAA,EAC5B,UAAU,WAAW,kCAAe;AAAA,EACpC,QAAQ,WAAW,mCAAa;AAAA,EAChC,OAAO,WAAW,iCAAY;AAAA,EAC9B,OAAO,WAAW,iCAAY;AAAA,EAC9B,QAAQ,WAAW,mCAAa;AAAA,EAChC,KAAK,WAAW,6BAAU;AAAA,EAC1B,KAAK,WAAW,6BAAU;AAC5B;",
4
+ "sourcesContent": ["import { ApiClient } from '../api/client'\nimport type commandDefinitions from '../command-definitions'\nimport type { ImplementationTree } from '../command-tree'\nimport { Logger } from '../logger'\nimport type { CommandArgv } from '../typings'\nimport * as utils from '../utils'\nimport { AddCommand } from './add-command'\nimport type { BaseCommand } from './base-command'\nimport * as bots from './bot-commands'\nimport { BuildCommand } from './build-command'\nimport { BundleCommand } from './bundle-command'\nimport { DeployCommand } from './deploy-command'\nimport { DevCommand } from './dev-command'\nimport { GenerateCommand } from './gen-command'\nimport type { GlobalCommand, GlobalCommandDefinition } from './global-command'\nimport { InitCommand } from './init-command'\nimport * as integrations from './integration-commands'\nimport { LoginCommand } from './login-command'\nimport { LogoutCommand } from './logout-command'\nimport { ReadCommand } from './read-command'\nimport { ServeCommand } from './serve-command'\n\ntype GlobalCtor<C extends GlobalCommandDefinition> = new (\n ...args: ConstructorParameters<typeof GlobalCommand<C>>\n) => BaseCommand<C>\n\nconst getHandler =\n <C extends GlobalCommandDefinition>(cls: GlobalCtor<C>) =>\n async (argv: CommandArgv<C>) => {\n const logger = new Logger(argv)\n const prompt = new utils.prompt.CLIPrompt(argv, logger)\n return new cls(ApiClient, prompt, logger, argv).handler()\n }\n\nexport default {\n login: getHandler(LoginCommand),\n logout: getHandler(LogoutCommand),\n bots: {\n subcommands: {\n create: getHandler(bots.CreateBotCommand),\n get: getHandler(bots.GetBotCommand),\n delete: getHandler(bots.DeleteBotCommand),\n list: getHandler(bots.ListBotsCommand),\n },\n },\n integrations: {\n subcommands: {\n get: getHandler(integrations.GetIntegrationCommand),\n list: getHandler(integrations.ListIntegrationsCommand),\n delete: getHandler(integrations.DeleteIntegrationCommand),\n },\n },\n init: getHandler(InitCommand),\n generate: getHandler(GenerateCommand),\n bundle: getHandler(BundleCommand),\n build: getHandler(BuildCommand),\n read: getHandler(ReadCommand),\n serve: getHandler(ServeCommand),\n deploy: getHandler(DeployCommand),\n add: getHandler(AddCommand),\n dev: getHandler(DevCommand),\n} satisfies ImplementationTree<typeof commandDefinitions>\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA0B;AAG1B,oBAAuB;AAEvB,YAAuB;AACvB,yBAA2B;AAE3B,WAAsB;AACtB,2BAA6B;AAC7B,4BAA8B;AAC9B,4BAA8B;AAC9B,yBAA2B;AAC3B,yBAAgC;AAEhC,0BAA4B;AAC5B,mBAA8B;AAC9B,2BAA6B;AAC7B,4BAA8B;AAC9B,0BAA4B;AAC5B,2BAA6B;AAM7B,MAAM,aACJ,CAAoC,QACpC,OAAO,SAAyB;AAC9B,QAAM,SAAS,IAAI,qBAAO,IAAI;AAC9B,QAAM,SAAS,IAAI,MAAM,OAAO,UAAU,MAAM,MAAM;AACtD,SAAO,IAAI,IAAI,yBAAW,QAAQ,QAAQ,IAAI,EAAE,QAAQ;AAC1D;AAEF,IAAO,kCAAQ;AAAA,EACb,OAAO,WAAW,iCAAY;AAAA,EAC9B,QAAQ,WAAW,mCAAa;AAAA,EAChC,MAAM;AAAA,IACJ,aAAa;AAAA,MACX,QAAQ,WAAW,KAAK,gBAAgB;AAAA,MACxC,KAAK,WAAW,KAAK,aAAa;AAAA,MAClC,QAAQ,WAAW,KAAK,gBAAgB;AAAA,MACxC,MAAM,WAAW,KAAK,eAAe;AAAA,IACvC;AAAA,EACF;AAAA,EACA,cAAc;AAAA,IACZ,aAAa;AAAA,MACX,KAAK,WAAW,aAAa,qBAAqB;AAAA,MAClD,MAAM,WAAW,aAAa,uBAAuB;AAAA,MACrD,QAAQ,WAAW,aAAa,wBAAwB;AAAA,IAC1D;AAAA,EACF;AAAA,EACA,MAAM,WAAW,+BAAW;AAAA,EAC5B,UAAU,WAAW,kCAAe;AAAA,EACpC,QAAQ,WAAW,mCAAa;AAAA,EAChC,OAAO,WAAW,iCAAY;AAAA,EAC9B,MAAM,WAAW,+BAAW;AAAA,EAC5B,OAAO,WAAW,iCAAY;AAAA,EAC9B,QAAQ,WAAW,mCAAa;AAAA,EAChC,KAAK,WAAW,6BAAU;AAAA,EAC1B,KAAK,WAAW,6BAAU;AAC5B;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var read_command_exports = {};
26
+ __export(read_command_exports, {
27
+ ReadCommand: () => ReadCommand
28
+ });
29
+ module.exports = __toCommonJS(read_command_exports);
30
+ var import_integration_body = require("../api/integration-body");
31
+ var errors = __toESM(require("../errors"));
32
+ var import_project_command = require("./project-command");
33
+ class ReadCommand extends import_project_command.ProjectCommand {
34
+ async run() {
35
+ const integrationDef = await this.readIntegrationDefinitionFromFS();
36
+ if (!integrationDef) {
37
+ throw new errors.ExclusiveIntegrationFeatureError();
38
+ }
39
+ const parsed = (0, import_integration_body.prepareCreateIntegrationBody)(integrationDef);
40
+ this.logger.json(parsed);
41
+ }
42
+ }
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ ReadCommand
46
+ });
47
+ //# sourceMappingURL=read-command.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/command-implementations/read-command.ts"],
4
+ "sourcesContent": ["import { prepareCreateIntegrationBody } from '../api/integration-body'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { ProjectCommand } from './project-command'\n\nexport type ReadCommandDefinition = typeof commandDefinitions.read\nexport class ReadCommand extends ProjectCommand<ReadCommandDefinition> {\n public async run(): Promise<void> {\n const integrationDef = await this.readIntegrationDefinitionFromFS()\n if (!integrationDef) {\n throw new errors.ExclusiveIntegrationFeatureError()\n }\n const parsed = prepareCreateIntegrationBody(integrationDef)\n this.logger.json(parsed)\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAA6C;AAE7C,aAAwB;AACxB,6BAA+B;AAGxB,MAAM,oBAAoB,sCAAsC;AAAA,EACrE,MAAa,MAAqB;AAChC,UAAM,iBAAiB,MAAM,KAAK,gCAAgC;AAClE,QAAI,CAAC,gBAAgB;AACnB,YAAM,IAAI,OAAO,iCAAiC;AAAA,IACpD;AACA,UAAM,aAAS,sDAA6B,cAAc;AAC1D,SAAK,OAAO,KAAK,MAAM;AAAA,EACzB;AACF;",
6
+ "names": []
7
+ }
package/dist/config.js CHANGED
@@ -80,6 +80,11 @@ const dev = {
80
80
  description: "List only dev bots / dev integrations",
81
81
  default: false
82
82
  };
83
+ const isPublic = {
84
+ type: "boolean",
85
+ description: "Weither or not to deploy the integration publicly",
86
+ default: false
87
+ };
83
88
  const globalSchema = {
84
89
  verbose: {
85
90
  type: "boolean",
@@ -129,6 +134,9 @@ const buildSchema = {
129
134
  ...projectSchema,
130
135
  sourceMap
131
136
  };
137
+ const readSchema = {
138
+ ...projectSchema
139
+ };
132
140
  const serveSchema = {
133
141
  ...projectSchema,
134
142
  ...secretsSchema,
@@ -142,6 +150,7 @@ const deploySchema = {
142
150
  noBuild,
143
151
  createNewBot: { type: "boolean", description: "Create a new bot when deploying. Only used when deploying a bot" },
144
152
  sourceMap,
153
+ public: isPublic,
145
154
  allowDeprecated: {
146
155
  type: "boolean",
147
156
  description: "Allow deprecated features in the project",
@@ -235,6 +244,7 @@ const schemas = {
235
244
  generate: generateSchema,
236
245
  bundle: bundleSchema,
237
246
  build: buildSchema,
247
+ read: readSchema,
238
248
  serve: serveSchema,
239
249
  deploy: deploySchema,
240
250
  add: addSchema,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/config.ts"],
4
- "sourcesContent": ["import * as consts from './consts'\nimport type { CommandOption, CommandSchema } from './typings'\n\n// command options\n\nconst port = {\n type: 'number',\n description: 'The port to use',\n} satisfies CommandOption\n\nconst workDir = {\n type: 'string',\n description: 'The path to the project',\n default: process.cwd(),\n} satisfies CommandOption\n\nconst noBuild = {\n type: 'boolean',\n description: 'Skip the build step',\n default: false,\n} satisfies CommandOption\n\nconst apiUrl = {\n type: 'string',\n description: 'The URL of the Botpress server',\n} satisfies CommandOption\n\nconst token = {\n type: 'string',\n description: 'You Personal Access Token ',\n} satisfies CommandOption\n\nconst workspaceId = {\n type: 'string',\n description: 'The Workspace Id to deploy to',\n} satisfies CommandOption\n\nconst secrets = {\n type: 'string',\n description: 'Values for the integration secrets',\n array: true,\n default: [],\n} satisfies CommandOption\n\nconst botRef = {\n type: 'string',\n description: 'The bot ID. Bot Name is not supported.',\n demandOption: true,\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst integrationRef = {\n type: 'string',\n description: 'The integration ID or name with optionnal version. Ex: teams or teams@0.2.0',\n demandOption: true,\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst sourceMap = { type: 'boolean', description: 'Generate sourcemaps', default: false } satisfies CommandOption\n\nconst dev = {\n type: 'boolean',\n description: 'List only dev bots / dev integrations',\n default: false,\n} satisfies CommandOption\n\n// base schemas\n\nconst globalSchema = {\n verbose: {\n type: 'boolean',\n description: 'Enable verbose logging',\n alias: 'v',\n default: false,\n },\n confirm: {\n type: 'boolean',\n description: 'Confirm all prompts',\n alias: 'y',\n default: false,\n },\n json: {\n type: 'boolean',\n description: 'Prevent logging anything else than raw json in stdout. Useful for piping output to other tools',\n default: false,\n },\n botpressHome: {\n type: 'string',\n description: 'The path to the Botpress home directory',\n default: consts.defaultBotpressHome,\n },\n} satisfies CommandSchema\n\nconst projectSchema = {\n ...globalSchema,\n entryPoint: { type: 'string', description: 'The entry point of the project', default: consts.defaultEntrypoint },\n outDir: { type: 'string', description: 'The output directory', default: consts.defaultOutputFolder },\n workDir,\n} satisfies CommandSchema\n\nconst credentialsSchema = {\n apiUrl,\n workspaceId,\n token,\n} satisfies CommandSchema\n\nconst secretsSchema = {\n secrets,\n} satisfies CommandSchema\n\n// command schemas\n\nconst generateSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\nconst bundleSchema = {\n ...projectSchema,\n sourceMap,\n} satisfies CommandSchema\n\nconst buildSchema = {\n ...projectSchema,\n sourceMap,\n} satisfies CommandSchema\n\nconst serveSchema = {\n ...projectSchema,\n ...secretsSchema,\n port,\n} satisfies CommandSchema\n\nconst deploySchema = {\n ...projectSchema,\n ...credentialsSchema,\n ...secretsSchema,\n botId: { type: 'string', description: 'The bot ID to deploy. Only used when deploying a bot' },\n noBuild,\n createNewBot: { type: 'boolean', description: 'Create a new bot when deploying. Only used when deploying a bot' },\n sourceMap,\n allowDeprecated: {\n type: 'boolean',\n description: 'Allow deprecated features in the project',\n default: false,\n },\n} satisfies CommandSchema\n\nconst devSchema = {\n ...projectSchema,\n ...credentialsSchema,\n ...secretsSchema,\n sourceMap,\n port,\n tunnelUrl: {\n type: 'string',\n description: 'The tunnel HTTP URL to use',\n default: consts.defaultTunnelUrl,\n },\n} satisfies CommandSchema\n\nconst addSchema = {\n ...projectSchema,\n ...credentialsSchema,\n integrationRef,\n} satisfies CommandSchema\n\nconst loginSchema = {\n ...globalSchema,\n token,\n workspaceId,\n apiUrl: { ...apiUrl, default: consts.defaultBotpressApiUrl },\n} satisfies CommandSchema\n\nconst logoutSchema = {\n ...globalSchema,\n} satisfies CommandSchema\n\nconst createBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n name: { type: 'string', description: 'The name of the bot to create' },\n} satisfies CommandSchema\n\nconst getBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n botRef,\n} satisfies CommandSchema\n\nconst deleteBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n botRef,\n} satisfies CommandSchema\n\nconst listBotsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n dev,\n} satisfies CommandSchema\n\nconst getIntegrationSchema = {\n ...globalSchema,\n ...credentialsSchema,\n integrationRef,\n} satisfies CommandSchema\n\nconst listIntegrationsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n name: { type: 'string', description: 'The name filter when listing integrations' },\n versionNumber: { type: 'string', description: 'The version filter when listing integrations' },\n dev,\n} satisfies CommandSchema\n\nconst deleteIntegrationSchema = {\n ...globalSchema,\n ...credentialsSchema,\n integrationRef,\n} satisfies CommandSchema\n\nconst initSchema = {\n ...globalSchema,\n workDir,\n type: { type: 'string', choices: ['bot', 'integration'] as const },\n name: { type: 'string', description: 'The name of the project' },\n} satisfies CommandSchema\n\n// exports\n\nexport const schemas = {\n global: globalSchema,\n project: projectSchema,\n credentials: credentialsSchema,\n secrets: secretsSchema,\n\n login: loginSchema,\n logout: logoutSchema,\n createBot: createBotSchema,\n getBot: getBotSchema,\n deleteBot: deleteBotSchema,\n listBots: listBotsSchema,\n getIntegration: getIntegrationSchema,\n listIntegrations: listIntegrationsSchema,\n deleteIntegration: deleteIntegrationSchema,\n init: initSchema,\n generate: generateSchema,\n bundle: bundleSchema,\n build: buildSchema,\n serve: serveSchema,\n deploy: deploySchema,\n add: addSchema,\n dev: devSchema,\n} as const\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AAKxB,MAAM,OAAO;AAAA,EACX,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS,QAAQ,IAAI;AACvB;AAEA,MAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS;AACX;AAEA,MAAM,SAAS;AAAA,EACb,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,QAAQ;AAAA,EACZ,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,cAAc;AAAA,EAClB,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,OAAO;AAAA,EACP,SAAS,CAAC;AACZ;AAEA,MAAM,SAAS;AAAA,EACb,MAAM;AAAA,EACN,aAAa;AAAA,EACb,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,KAAK;AACP;AAEA,MAAM,iBAAiB;AAAA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AAAA,EACjB,GAAG;AAAA,EACH;AAAA,EACA,MAAM,EAAE,MAAM,UAAU,SAAS,CAAC,OAAO,aAAa,EAAW;AAAA,EACjE,MAAM,EAAE,MAAM,UAAU,aAAa,0BAA0B;AACjE;AAIO,MAAM,UAAU;AAAA,EACrB,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS;AAAA,EAET,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,KAAK;AACP;",
4
+ "sourcesContent": ["import * as consts from './consts'\nimport type { CommandOption, CommandSchema } from './typings'\n\n// command options\n\nconst port = {\n type: 'number',\n description: 'The port to use',\n} satisfies CommandOption\n\nconst workDir = {\n type: 'string',\n description: 'The path to the project',\n default: process.cwd(),\n} satisfies CommandOption\n\nconst noBuild = {\n type: 'boolean',\n description: 'Skip the build step',\n default: false,\n} satisfies CommandOption\n\nconst apiUrl = {\n type: 'string',\n description: 'The URL of the Botpress server',\n} satisfies CommandOption\n\nconst token = {\n type: 'string',\n description: 'You Personal Access Token ',\n} satisfies CommandOption\n\nconst workspaceId = {\n type: 'string',\n description: 'The Workspace Id to deploy to',\n} satisfies CommandOption\n\nconst secrets = {\n type: 'string',\n description: 'Values for the integration secrets',\n array: true,\n default: [],\n} satisfies CommandOption\n\nconst botRef = {\n type: 'string',\n description: 'The bot ID. Bot Name is not supported.',\n demandOption: true,\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst integrationRef = {\n type: 'string',\n description: 'The integration ID or name with optionnal version. Ex: teams or teams@0.2.0',\n demandOption: true,\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst sourceMap = { type: 'boolean', description: 'Generate sourcemaps', default: false } satisfies CommandOption\n\nconst dev = {\n type: 'boolean',\n description: 'List only dev bots / dev integrations',\n default: false,\n} satisfies CommandOption\n\nconst isPublic = {\n type: 'boolean',\n description: 'Weither or not to deploy the integration publicly',\n default: false,\n} satisfies CommandOption\n\n// base schemas\n\nconst globalSchema = {\n verbose: {\n type: 'boolean',\n description: 'Enable verbose logging',\n alias: 'v',\n default: false,\n },\n confirm: {\n type: 'boolean',\n description: 'Confirm all prompts',\n alias: 'y',\n default: false,\n },\n json: {\n type: 'boolean',\n description: 'Prevent logging anything else than raw json in stdout. Useful for piping output to other tools',\n default: false,\n },\n botpressHome: {\n type: 'string',\n description: 'The path to the Botpress home directory',\n default: consts.defaultBotpressHome,\n },\n} satisfies CommandSchema\n\nconst projectSchema = {\n ...globalSchema,\n entryPoint: { type: 'string', description: 'The entry point of the project', default: consts.defaultEntrypoint },\n outDir: { type: 'string', description: 'The output directory', default: consts.defaultOutputFolder },\n workDir,\n} satisfies CommandSchema\n\nconst credentialsSchema = {\n apiUrl,\n workspaceId,\n token,\n} satisfies CommandSchema\n\nconst secretsSchema = {\n secrets,\n} satisfies CommandSchema\n\n// command schemas\n\nconst generateSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\nconst bundleSchema = {\n ...projectSchema,\n sourceMap,\n} satisfies CommandSchema\n\nconst buildSchema = {\n ...projectSchema,\n sourceMap,\n} satisfies CommandSchema\n\nconst readSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\nconst serveSchema = {\n ...projectSchema,\n ...secretsSchema,\n port,\n} satisfies CommandSchema\n\nconst deploySchema = {\n ...projectSchema,\n ...credentialsSchema,\n ...secretsSchema,\n botId: { type: 'string', description: 'The bot ID to deploy. Only used when deploying a bot' },\n noBuild,\n createNewBot: { type: 'boolean', description: 'Create a new bot when deploying. Only used when deploying a bot' },\n sourceMap,\n public: isPublic,\n allowDeprecated: {\n type: 'boolean',\n description: 'Allow deprecated features in the project',\n default: false,\n },\n} satisfies CommandSchema\n\nconst devSchema = {\n ...projectSchema,\n ...credentialsSchema,\n ...secretsSchema,\n sourceMap,\n port,\n tunnelUrl: {\n type: 'string',\n description: 'The tunnel HTTP URL to use',\n default: consts.defaultTunnelUrl,\n },\n} satisfies CommandSchema\n\nconst addSchema = {\n ...projectSchema,\n ...credentialsSchema,\n integrationRef,\n} satisfies CommandSchema\n\nconst loginSchema = {\n ...globalSchema,\n token,\n workspaceId,\n apiUrl: { ...apiUrl, default: consts.defaultBotpressApiUrl },\n} satisfies CommandSchema\n\nconst logoutSchema = {\n ...globalSchema,\n} satisfies CommandSchema\n\nconst createBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n name: { type: 'string', description: 'The name of the bot to create' },\n} satisfies CommandSchema\n\nconst getBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n botRef,\n} satisfies CommandSchema\n\nconst deleteBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n botRef,\n} satisfies CommandSchema\n\nconst listBotsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n dev,\n} satisfies CommandSchema\n\nconst getIntegrationSchema = {\n ...globalSchema,\n ...credentialsSchema,\n integrationRef,\n} satisfies CommandSchema\n\nconst listIntegrationsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n name: { type: 'string', description: 'The name filter when listing integrations' },\n versionNumber: { type: 'string', description: 'The version filter when listing integrations' },\n dev,\n} satisfies CommandSchema\n\nconst deleteIntegrationSchema = {\n ...globalSchema,\n ...credentialsSchema,\n integrationRef,\n} satisfies CommandSchema\n\nconst initSchema = {\n ...globalSchema,\n workDir,\n type: { type: 'string', choices: ['bot', 'integration'] as const },\n name: { type: 'string', description: 'The name of the project' },\n} satisfies CommandSchema\n\n// exports\n\nexport const schemas = {\n global: globalSchema,\n project: projectSchema,\n credentials: credentialsSchema,\n secrets: secretsSchema,\n\n login: loginSchema,\n logout: logoutSchema,\n createBot: createBotSchema,\n getBot: getBotSchema,\n deleteBot: deleteBotSchema,\n listBots: listBotsSchema,\n getIntegration: getIntegrationSchema,\n listIntegrations: listIntegrationsSchema,\n deleteIntegration: deleteIntegrationSchema,\n init: initSchema,\n generate: generateSchema,\n bundle: bundleSchema,\n build: buildSchema,\n read: readSchema,\n serve: serveSchema,\n deploy: deploySchema,\n add: addSchema,\n dev: devSchema,\n} as const\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AAKxB,MAAM,OAAO;AAAA,EACX,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS,QAAQ,IAAI;AACvB;AAEA,MAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS;AACX;AAEA,MAAM,SAAS;AAAA,EACb,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,QAAQ;AAAA,EACZ,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,cAAc;AAAA,EAClB,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,OAAO;AAAA,EACP,SAAS,CAAC;AACZ;AAEA,MAAM,SAAS;AAAA,EACb,MAAM;AAAA,EACN,aAAa;AAAA,EACb,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,KAAK;AACP;AAEA,MAAM,iBAAiB;AAAA,EACrB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,KAAK;AACP;AAEA,MAAM,YAAY,EAAE,MAAM,WAAW,aAAa,uBAAuB,SAAS,MAAM;AAExF,MAAM,MAAM;AAAA,EACV,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS;AACX;AAEA,MAAM,WAAW;AAAA,EACf,MAAM;AAAA,EACN,aAAa;AAAA,EACb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AIO,MAAM,UAAU;AAAA,EACrB,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS;AAAA,EAET,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,KAAK;AACP;",
6
6
  "names": []
7
7
  }
@@ -31,6 +31,8 @@ var import_boxen = __toESM(require("boxen"));
31
31
  var import_chalk = __toESM(require("chalk"));
32
32
  var import_lodash = __toESM(require("lodash"));
33
33
  var import_util = __toESM(require("util"));
34
+ var utils = __toESM(require("../utils"));
35
+ const STDOUT_CHUNK_SIZE = 100;
34
36
  const DEFAULT_OPTIONS = { verbose: false };
35
37
  const NO_COLOR = (str) => str;
36
38
  const PINK = [255, 100, 255];
@@ -104,23 +106,23 @@ class BaseLogger {
104
106
  const msg = import_util.default.inspect(data, { colors: true, depth });
105
107
  this.log(msg);
106
108
  }
107
- debug(message, metadata) {
109
+ debug(message) {
108
110
  if (!this.opts.verbose) {
109
111
  return;
110
112
  }
111
- this.log(import_chalk.default.grey(message), { metadata, prefix: { symbol: "\u25CF", fg: "blue" } });
113
+ this.log(import_chalk.default.grey(message), { prefix: { symbol: "\u25CF", fg: "blue" } });
112
114
  }
113
- started(message, metadata) {
114
- this.log(message, { metadata, prefix: { symbol: "\u25CB", fg: "purple" } });
115
+ started(message) {
116
+ this.log(message, { prefix: { symbol: "\u25CB", fg: "purple" } });
115
117
  }
116
- success(message, metadata) {
117
- this.log(message, { metadata, prefix: { symbol: "\u2713", fg: "green" } });
118
+ success(message) {
119
+ this.log(message, { prefix: { symbol: "\u2713", fg: "green" } });
118
120
  }
119
- warn(message, metadata) {
120
- this.log(message, { metadata, prefix: { symbol: "\u26A0", fg: "yellow" } });
121
+ warn(message) {
122
+ this.log(message, { prefix: { symbol: "\u26A0", fg: "yellow" } });
121
123
  }
122
- error(message, metadata) {
123
- this.log(message, { metadata, prefix: { symbol: "\xD7", fg: "red" }, stderr: true });
124
+ error(message) {
125
+ this.log(message, { prefix: { symbol: "\xD7", fg: "red" }, stderr: true });
124
126
  }
125
127
  box(message) {
126
128
  const box = (0, import_boxen.default)(message, BOX_OPTIONS);
@@ -151,6 +153,11 @@ class BaseLogger {
151
153
  return renderer.default;
152
154
  }
153
155
  }
156
+ render(message, stream = process.stdout) {
157
+ for (const chunk of utils.string.chunkString(message, STDOUT_CHUNK_SIZE)) {
158
+ stream.write(chunk);
159
+ }
160
+ }
154
161
  }
155
162
  // Annotate the CommonJS export names for ESM import in node:
156
163
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/logger/base-logger.ts"],
4
- "sourcesContent": ["import boxen from 'boxen'\nimport chalk from 'chalk'\nimport _ from 'lodash'\nimport util from 'util'\n\nexport type LoggerOptions = {\n verbose: boolean\n json?: boolean // prevents loggin anything else than json\n}\n\nconst DEFAULT_OPTIONS: LoggerOptions = { verbose: false }\n\ntype ChalkColor = (str: string) => string\nconst NO_COLOR: ChalkColor = (str: string) => str\n\nconst PINK = [255, 100, 255] as const\nconst ORANGE = [255, 165, 0] as const\nconst PURPLE = [128, 0, 128] as const\n\nconst BG_COLORS: Record<Color, ChalkColor> = {\n blue: chalk.bgBlueBright,\n green: chalk.bgGreenBright,\n yellow: chalk.bgYellowBright,\n red: chalk.bgRedBright,\n white: chalk.bgWhite,\n pink: (str: string) => chalk.bgRgb(...PINK)(str),\n orange: (str: string) => chalk.bgRgb(...ORANGE)(str),\n purple: (str: string) => chalk.bgRgb(...PURPLE)(str),\n}\n\nconst FG_COLORS: Record<Color, ChalkColor> = {\n blue: chalk.blueBright,\n green: chalk.green,\n yellow: chalk.yellowBright,\n red: chalk.red,\n white: chalk.white,\n pink: (str: string) => chalk.rgb(...PINK)(str),\n orange: (str: string) => chalk.rgb(...ORANGE)(str),\n purple: (str: string) => chalk.rgb(...PURPLE)(str),\n}\n\ntype Symbol = '\u2713' | '\u26A0' | '\u00D7' | '\u25CF' | ' ' | '\u25CB'\ntype Color = 'blue' | 'green' | 'yellow' | 'red' | 'pink' | 'white' | 'orange' | 'purple'\ntype LogPrefix = { symbol: Symbol; fg?: Color; bg?: Color; indent?: number } | string\ntype SymbolRenderer<T extends Symbol> = { default: T; windows?: string; mac?: string }\n\ntype LogProps = {\n metadata: any\n prefix: LogPrefix\n stderr?: boolean\n}\n\ntype PrintProps = {\n metadata: any\n prefix: string\n stderr?: boolean\n}\n\nconst checkmark: SymbolRenderer<'\u2713'> = {\n default: '\u2713',\n windows: '\u221A',\n mac: '\u2714',\n}\n\nconst cross: SymbolRenderer<'\u00D7'> = {\n default: '\u00D7',\n mac: '\u2716',\n}\n\nconst danger: SymbolRenderer<'\u26A0'> = { default: '\u26A0' }\nconst circle: SymbolRenderer<'\u25CB'> = { default: '\u25CB' }\nconst disc: SymbolRenderer<'\u25CF'> = { default: '\u25CF' }\nconst space: SymbolRenderer<' '> = { default: ' ' }\n\nconst renderers: Record<Symbol, SymbolRenderer<Symbol>> = {\n '\u2713': checkmark,\n '\u00D7': cross,\n '\u26A0': danger,\n '\u25CB': circle,\n '\u25CF': disc,\n ' ': space,\n}\n\nconst BOX_OPTIONS: boxen.Options = {\n padding: 1,\n margin: 1,\n borderStyle: 'round',\n borderColor: 'yellow',\n}\n\nexport abstract class BaseLogger {\n protected opts: LoggerOptions\n\n constructor(opts: Partial<LoggerOptions> = {}) {\n this.opts = { ...DEFAULT_OPTIONS, ...opts }\n }\n\n public log(message: string, props: Partial<LogProps> = {}): void {\n if (this.opts.json && !props.stderr) {\n return\n }\n\n const prefix = this._resolvePrefix(props.prefix)\n this.print(message, { ...props, prefix })\n }\n\n public json(data: any, opts: Partial<{ depth: number }> = { depth: Infinity }): void {\n if (this.opts.json) {\n this.print(JSON.stringify(data, undefined, 2))\n return\n }\n\n const { depth } = opts\n const msg = util.inspect(data, { colors: true, depth })\n this.log(msg)\n }\n\n public debug(message: string, metadata?: any): void {\n if (!this.opts.verbose) {\n return\n }\n this.log(chalk.grey(message), { metadata, prefix: { symbol: '\u25CF', fg: 'blue' } })\n }\n\n public started(message: string, metadata?: any): void {\n this.log(message, { metadata, prefix: { symbol: '\u25CB', fg: 'purple' } })\n }\n\n public success(message: string, metadata?: any): void {\n this.log(message, { metadata, prefix: { symbol: '\u2713', fg: 'green' } })\n }\n\n public warn(message: string, metadata?: any): void {\n this.log(message, { metadata, prefix: { symbol: '\u26A0', fg: 'yellow' } })\n }\n\n public error(message: string, metadata?: any): void {\n this.log(message, { metadata, prefix: { symbol: '\u00D7', fg: 'red' }, stderr: true })\n }\n\n public box(message: string): void {\n const box = boxen(message, BOX_OPTIONS)\n this.log(box)\n }\n\n protected abstract print(message: string, props?: Partial<PrintProps>): void\n\n private _resolvePrefix(prefix: LogPrefix | undefined): string | undefined {\n if (!prefix) {\n return\n }\n\n if (_.isString(prefix)) {\n return prefix\n }\n\n const { symbol, fg, bg, indent } = prefix\n const renderedSymbol = this._renderSymbol(symbol)\n const fgcolor = fg ? FG_COLORS[fg] : NO_COLOR\n const bgcolor = bg ? BG_COLORS[bg] : NO_COLOR\n const indentStr = indent ? ' '.repeat(indent) : ''\n const symbolStr = fgcolor(bgcolor(renderedSymbol))\n return `${indentStr}${symbolStr}`\n }\n\n private _renderSymbol(symbol: Symbol): string {\n const renderer = renderers[symbol]\n if (process.platform === 'win32') {\n return renderer.windows || renderer.default\n } else if (process.platform === 'darwin') {\n return renderer.mac || renderer.default\n } else {\n return renderer.default\n }\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB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AO,SAAS;AAAA,IAClB;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import boxen from 'boxen'\nimport chalk from 'chalk'\nimport _ from 'lodash'\nimport util from 'util'\nimport * as utils from '../utils'\n\nexport type LoggerOptions = {\n verbose: boolean\n json?: boolean // prevents loggin anything else than json\n}\n\nconst STDOUT_CHUNK_SIZE = 100\nconst DEFAULT_OPTIONS: LoggerOptions = { verbose: false }\n\ntype ChalkColor = (str: string) => string\nconst NO_COLOR: ChalkColor = (str: string) => str\n\nconst PINK = [255, 100, 255] as const\nconst ORANGE = [255, 165, 0] as const\nconst PURPLE = [128, 0, 128] as const\n\nconst BG_COLORS: Record<Color, ChalkColor> = {\n blue: chalk.bgBlueBright,\n green: chalk.bgGreenBright,\n yellow: chalk.bgYellowBright,\n red: chalk.bgRedBright,\n white: chalk.bgWhite,\n pink: (str: string) => chalk.bgRgb(...PINK)(str),\n orange: (str: string) => chalk.bgRgb(...ORANGE)(str),\n purple: (str: string) => chalk.bgRgb(...PURPLE)(str),\n}\n\nconst FG_COLORS: Record<Color, ChalkColor> = {\n blue: chalk.blueBright,\n green: chalk.green,\n yellow: chalk.yellowBright,\n red: chalk.red,\n white: chalk.white,\n pink: (str: string) => chalk.rgb(...PINK)(str),\n orange: (str: string) => chalk.rgb(...ORANGE)(str),\n purple: (str: string) => chalk.rgb(...PURPLE)(str),\n}\n\ntype Symbol = '\u2713' | '\u26A0' | '\u00D7' | '\u25CF' | ' ' | '\u25CB'\ntype Color = 'blue' | 'green' | 'yellow' | 'red' | 'pink' | 'white' | 'orange' | 'purple'\ntype LogPrefix = { symbol: Symbol; fg?: Color; bg?: Color; indent?: number } | string\ntype SymbolRenderer<T extends Symbol> = { default: T; windows?: string; mac?: string }\n\ntype LogProps = {\n prefix: LogPrefix\n stderr?: boolean\n}\n\ntype PrintProps = {\n metadata: any\n prefix: string\n stderr?: boolean\n}\n\nconst checkmark: SymbolRenderer<'\u2713'> = {\n default: '\u2713',\n windows: '\u221A',\n mac: '\u2714',\n}\n\nconst cross: SymbolRenderer<'\u00D7'> = {\n default: '\u00D7',\n mac: '\u2716',\n}\n\nconst danger: SymbolRenderer<'\u26A0'> = { default: '\u26A0' }\nconst circle: SymbolRenderer<'\u25CB'> = { default: '\u25CB' }\nconst disc: SymbolRenderer<'\u25CF'> = { default: '\u25CF' }\nconst space: SymbolRenderer<' '> = { default: ' ' }\n\nconst renderers: Record<Symbol, SymbolRenderer<Symbol>> = {\n '\u2713': checkmark,\n '\u00D7': cross,\n '\u26A0': danger,\n '\u25CB': circle,\n '\u25CF': disc,\n ' ': space,\n}\n\nconst BOX_OPTIONS: boxen.Options = {\n padding: 1,\n margin: 1,\n borderStyle: 'round',\n borderColor: 'yellow',\n}\n\nexport abstract class BaseLogger {\n protected opts: LoggerOptions\n\n constructor(opts: Partial<LoggerOptions> = {}) {\n this.opts = { ...DEFAULT_OPTIONS, ...opts }\n }\n\n public log(message: string, props: Partial<LogProps> = {}): void {\n if (this.opts.json && !props.stderr) {\n return\n }\n\n const prefix = this._resolvePrefix(props.prefix)\n this.print(message, { ...props, prefix })\n }\n\n public json(data: any, opts: Partial<{ depth: number }> = { depth: Infinity }): void {\n if (this.opts.json) {\n this.print(JSON.stringify(data, undefined, 2))\n return\n }\n\n const { depth } = opts\n const msg = util.inspect(data, { colors: true, depth })\n this.log(msg)\n }\n\n public debug(message: string): void {\n if (!this.opts.verbose) {\n return\n }\n this.log(chalk.grey(message), { prefix: { symbol: '\u25CF', fg: 'blue' } })\n }\n\n public started(message: string): void {\n this.log(message, { prefix: { symbol: '\u25CB', fg: 'purple' } })\n }\n\n public success(message: string): void {\n this.log(message, { prefix: { symbol: '\u2713', fg: 'green' } })\n }\n\n public warn(message: string): void {\n this.log(message, { prefix: { symbol: '\u26A0', fg: 'yellow' } })\n }\n\n public error(message: string): void {\n this.log(message, { prefix: { symbol: '\u00D7', fg: 'red' }, stderr: true })\n }\n\n public box(message: string): void {\n const box = boxen(message, BOX_OPTIONS)\n this.log(box)\n }\n\n protected abstract print(message: string, props?: Partial<PrintProps>): void\n\n private _resolvePrefix(prefix: LogPrefix | undefined): string | undefined {\n if (!prefix) {\n return\n }\n\n if (_.isString(prefix)) {\n return prefix\n }\n\n const { symbol, fg, bg, indent } = prefix\n const renderedSymbol = this._renderSymbol(symbol)\n const fgcolor = fg ? FG_COLORS[fg] : NO_COLOR\n const bgcolor = bg ? BG_COLORS[bg] : NO_COLOR\n const indentStr = indent ? ' '.repeat(indent) : ''\n const symbolStr = fgcolor(bgcolor(renderedSymbol))\n return `${indentStr}${symbolStr}`\n }\n\n private _renderSymbol(symbol: Symbol): string {\n const renderer = renderers[symbol]\n if (process.platform === 'win32') {\n return renderer.windows || renderer.default\n } else if (process.platform === 'darwin') {\n return renderer.mac || renderer.default\n } else {\n return renderer.default\n }\n }\n\n protected render(message: string, stream: NodeJS.WriteStream = process.stdout): void {\n // chunking the message ensures that the process won't exit before the message is fully written\n for (const chunk of utils.string.chunkString(message, STDOUT_CHUNK_SIZE)) {\n stream.write(chunk)\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,mBAAkB;AAClB,oBAAc;AACd,kBAAiB;AACjB,YAAuB;AAOvB,MAAM,oBAAoB;AAC1B,MAAM,kBAAiC,EAAE,SAAS,MAAM;AAGxD,MAAM,WAAuB,CAAC,QAAgB;AAE9C,MAAM,OAAO,CAAC,KAAK,KAAK,GAAG;AAC3B,MAAM,SAAS,CAAC,KAAK,KAAK,CAAC;AAC3B,MAAM,SAAS,CAAC,KAAK,GAAG,GAAG;AAE3B,MAAM,YAAuC;AAAA,EAC3C,MAAM,aAAAA,QAAM;AAAA,EACZ,OAAO,aAAAA,QAAM;AAAA,EACb,QAAQ,aAAAA,QAAM;AAAA,EACd,KAAK,aAAAA,QAAM;AAAA,EACX,OAAO,aAAAA,QAAM;AAAA,EACb,MAAM,CAAC,QAAgB,aAAAA,QA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SAAuB;AAChC,UAAM,UAAM,aAAAE,SAAM,SAAS,WAAW;AACtC,SAAK,IAAI,GAAG;AAAA,EACd;AAAA,EAIQ,eAAe,QAAmD;AACxE,QAAI,CAAC,QAAQ;AACX;AAAA,IACF;AAEA,QAAI,cAAAC,QAAE,SAAS,MAAM,GAAG;AACtB,aAAO;AAAA,IACT;AAEA,UAAM,EAAE,QAAQ,IAAI,IAAI,OAAO,IAAI;AACnC,UAAM,iBAAiB,KAAK,cAAc,MAAM;AAChD,UAAM,UAAU,KAAK,UAAU,MAAM;AACrC,UAAM,UAAU,KAAK,UAAU,MAAM;AACrC,UAAM,YAAY,SAAS,IAAI,OAAO,MAAM,IAAI;AAChD,UAAM,YAAY,QAAQ,QAAQ,cAAc,CAAC;AACjD,WAAO,GAAG,YAAY;AAAA,EACxB;AAAA,EAEQ,cAAc,QAAwB;AAC5C,UAAM,WAAW,UAAU;AAC3B,QAAI,QAAQ,aAAa,SAAS;AAChC,aAAO,SAAS,WAAW,SAAS;AAAA,IACtC,WAAW,QAAQ,aAAa,UAAU;AACxC,aAAO,SAAS,OAAO,SAAS;AAAA,IAClC,OAAO;AACL,aAAO,SAAS;AAAA,IAClB;AAAA,EACF;AAAA,EAEU,OAAO,SAAiB,SAA6B,QAAQ,QAAc;AAEnF,eAAW,SAAS,MAAM,OAAO,YAAY,SAAS,iBAAiB,GAAG;AACxE,aAAO,MAAM,KAAK;AAAA,IACpB;AAAA,EACF;AACF;",
6
6
  "names": ["chalk", "util", "boxen", "_"]
7
7
  }
@@ -27,13 +27,15 @@ class Logger extends import_base_logger.BaseLogger {
27
27
  static _previousLine;
28
28
  print(message, props = {}) {
29
29
  this.cleanup();
30
- const log = props.stderr ? console.error : console.info;
31
- const { metadata, prefix } = props;
30
+ const stream = props.stderr ? process.stderr : process.stdout;
31
+ const { prefix } = props;
32
32
  if (prefix) {
33
- log(prefix, message, metadata ?? "");
33
+ this.render(`${prefix} ${message}
34
+ `, stream);
34
35
  return;
35
36
  }
36
- log(message, metadata ?? "");
37
+ this.render(`${message}
38
+ `, stream);
37
39
  }
38
40
  line() {
39
41
  this.cleanup();
@@ -65,13 +67,13 @@ class SingleLineLogger extends import_base_logger.BaseLogger {
65
67
  return;
66
68
  }
67
69
  (0, import_readline.clearLine)(process.stdout, 0);
68
- const { metadata, prefix } = props;
70
+ const { prefix } = props;
69
71
  (0, import_readline.cursorTo)(process.stdout, 0);
70
72
  if (prefix) {
71
- process.stdout.write(`${prefix} ${message} ${metadata ?? ""}`);
73
+ this.render(`${prefix} ${message}`);
72
74
  return;
73
75
  }
74
- process.stdout.write(`${message} ${metadata ?? ""}`);
76
+ this.render(message);
75
77
  }
76
78
  }
77
79
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/logger/index.ts"],
4
- "sourcesContent": ["/* eslint-disable no-console */\nimport { cursorTo, clearLine } from 'readline'\nimport { BaseLogger, LoggerOptions } from './base-logger'\n\nexport class Logger extends BaseLogger {\n private static _previousLine: SingleLineLogger | undefined // this is global to the whole process\n\n protected print(message: string, props: Partial<{ metadata: any; prefix: string; stderr?: boolean }> = {}): void {\n this.cleanup()\n const log = props.stderr ? console.error : console.info\n const { metadata, prefix } = props\n if (prefix) {\n log(prefix, message, metadata ?? '')\n return\n }\n log(message, metadata ?? '')\n }\n\n public line(): SingleLineLogger {\n this.cleanup()\n const currentLine = new SingleLineLogger({ ...this.opts })\n Logger._previousLine = currentLine\n return currentLine\n }\n\n public cleanup(): void {\n if (Logger._previousLine) {\n Logger._previousLine.commit()\n Logger._previousLine = undefined\n }\n }\n}\n\nclass SingleLineLogger extends BaseLogger {\n private _commited = false\n\n constructor(opts: LoggerOptions) {\n super(opts)\n }\n\n public commit(): void {\n if (this._commited) {\n return\n }\n this._commited = true\n console.log()\n }\n\n protected print(message: string, props: Partial<{ metadata: any; prefix: string }> = {}): void {\n if (this._commited) {\n return\n }\n\n clearLine(process.stdout, 0)\n const { metadata, prefix } = props\n cursorTo(process.stdout, 0)\n if (prefix) {\n process.stdout.write(`${prefix} ${message} ${metadata ?? ''}`)\n return\n }\n process.stdout.write(`${message} ${metadata ?? ''}`)\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAoC;AACpC,yBAA0C;AAEnC,MAAM,eAAe,8BAAW;AAAA,EACrC,OAAe;AAAA,EAEL,MAAM,SAAiB,QAAsE,CAAC,GAAS;AAC/G,SAAK,QAAQ;AACb,UAAM,MAAM,MAAM,SAAS,QAAQ,QAAQ,QAAQ;AACnD,UAAM,EAAE,UAAU,OAAO,IAAI;AAC7B,QAAI,QAAQ;AACV,UAAI,QAAQ,SAAS,YAAY,EAAE;AACnC;AAAA,IACF;AACA,QAAI,SAAS,YAAY,EAAE;AAAA,EAC7B;AAAA,EAEO,OAAyB;AAC9B,SAAK,QAAQ;AACb,UAAM,cAAc,IAAI,iBAAiB,EAAE,GAAG,KAAK,KAAK,CAAC;AACzD,WAAO,gBAAgB;AACvB,WAAO;AAAA,EACT;AAAA,EAEO,UAAgB;AACrB,QAAI,OAAO,eAAe;AACxB,aAAO,cAAc,OAAO;AAC5B,aAAO,gBAAgB;AAAA,IACzB;AAAA,EACF;AACF;AAEA,MAAM,yBAAyB,8BAAW;AAAA,EAChC,YAAY;AAAA,EAEpB,YAAY,MAAqB;AAC/B,UAAM,IAAI;AAAA,EACZ;AAAA,EAEO,SAAe;AACpB,QAAI,KAAK,WAAW;AAClB;AAAA,IACF;AACA,SAAK,YAAY;AACjB,YAAQ,IAAI;AAAA,EACd;AAAA,EAEU,MAAM,SAAiB,QAAoD,CAAC,GAAS;AAC7F,QAAI,KAAK,WAAW;AAClB;AAAA,IACF;AAEA,mCAAU,QAAQ,QAAQ,CAAC;AAC3B,UAAM,EAAE,UAAU,OAAO,IAAI;AAC7B,kCAAS,QAAQ,QAAQ,CAAC;AAC1B,QAAI,QAAQ;AACV,cAAQ,OAAO,MAAM,GAAG,UAAU,WAAW,YAAY,IAAI;AAC7D;AAAA,IACF;AACA,YAAQ,OAAO,MAAM,GAAG,WAAW,YAAY,IAAI;AAAA,EACrD;AACF;",
4
+ "sourcesContent": ["/* eslint-disable no-console */\nimport { cursorTo, clearLine } from 'readline'\nimport { BaseLogger, LoggerOptions } from './base-logger'\n\nexport class Logger extends BaseLogger {\n private static _previousLine: SingleLineLogger | undefined // this is global to the whole process\n\n protected print(message: string, props: Partial<{ prefix: string; stderr?: boolean }> = {}): void {\n this.cleanup()\n const stream = props.stderr ? process.stderr : process.stdout\n const { prefix } = props\n if (prefix) {\n this.render(`${prefix} ${message}\\n`, stream)\n return\n }\n this.render(`${message}\\n`, stream)\n }\n\n public line(): SingleLineLogger {\n this.cleanup()\n const currentLine = new SingleLineLogger({ ...this.opts })\n Logger._previousLine = currentLine\n return currentLine\n }\n\n public cleanup(): void {\n if (Logger._previousLine) {\n Logger._previousLine.commit()\n Logger._previousLine = undefined\n }\n }\n}\n\nclass SingleLineLogger extends BaseLogger {\n private _commited = false\n\n constructor(opts: LoggerOptions) {\n super(opts)\n }\n\n public commit(): void {\n if (this._commited) {\n return\n }\n this._commited = true\n console.log()\n }\n\n protected print(message: string, props: Partial<{ prefix: string }> = {}): void {\n if (this._commited) {\n return\n }\n\n clearLine(process.stdout, 0)\n const { prefix } = props\n cursorTo(process.stdout, 0)\n if (prefix) {\n this.render(`${prefix} ${message}`)\n return\n }\n this.render(message)\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAoC;AACpC,yBAA0C;AAEnC,MAAM,eAAe,8BAAW;AAAA,EACrC,OAAe;AAAA,EAEL,MAAM,SAAiB,QAAuD,CAAC,GAAS;AAChG,SAAK,QAAQ;AACb,UAAM,SAAS,MAAM,SAAS,QAAQ,SAAS,QAAQ;AACvD,UAAM,EAAE,OAAO,IAAI;AACnB,QAAI,QAAQ;AACV,WAAK,OAAO,GAAG,UAAU;AAAA,GAAa,MAAM;AAC5C;AAAA,IACF;AACA,SAAK,OAAO,GAAG;AAAA,GAAa,MAAM;AAAA,EACpC;AAAA,EAEO,OAAyB;AAC9B,SAAK,QAAQ;AACb,UAAM,cAAc,IAAI,iBAAiB,EAAE,GAAG,KAAK,KAAK,CAAC;AACzD,WAAO,gBAAgB;AACvB,WAAO;AAAA,EACT;AAAA,EAEO,UAAgB;AACrB,QAAI,OAAO,eAAe;AACxB,aAAO,cAAc,OAAO;AAC5B,aAAO,gBAAgB;AAAA,IACzB;AAAA,EACF;AACF;AAEA,MAAM,yBAAyB,8BAAW;AAAA,EAChC,YAAY;AAAA,EAEpB,YAAY,MAAqB;AAC/B,UAAM,IAAI;AAAA,EACZ;AAAA,EAEO,SAAe;AACpB,QAAI,KAAK,WAAW;AAClB;AAAA,IACF;AACA,SAAK,YAAY;AACjB,YAAQ,IAAI;AAAA,EACd;AAAA,EAEU,MAAM,SAAiB,QAAqC,CAAC,GAAS;AAC9E,QAAI,KAAK,WAAW;AAClB;AAAA,IACF;AAEA,mCAAU,QAAQ,QAAQ,CAAC;AAC3B,UAAM,EAAE,OAAO,IAAI;AACnB,kCAAS,QAAQ,QAAQ,CAAC;AAC1B,QAAI,QAAQ;AACV,WAAK,OAAO,GAAG,UAAU,SAAS;AAClC;AAAA,IACF;AACA,SAAK,OAAO,OAAO;AAAA,EACrB;AACF;",
6
6
  "names": []
7
7
  }
@@ -18,6 +18,7 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var string_utils_exports = {};
20
20
  __export(string_utils_exports, {
21
+ chunkString: () => chunkString,
21
22
  splitOnce: () => splitOnce
22
23
  });
23
24
  module.exports = __toCommonJS(string_utils_exports);
@@ -28,8 +29,14 @@ const splitOnce = (text, separator) => {
28
29
  }
29
30
  return [text.slice(0, index), text.slice(index + 1)];
30
31
  };
32
+ function* chunkString(input, chunkSize) {
33
+ for (let i = 0; i < input.length; i += chunkSize) {
34
+ yield input.slice(i, i + chunkSize);
35
+ }
36
+ }
31
37
  // Annotate the CommonJS export names for ESM import in node:
32
38
  0 && (module.exports = {
39
+ chunkString,
33
40
  splitOnce
34
41
  });
35
42
  //# sourceMappingURL=string-utils.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/string-utils.ts"],
4
- "sourcesContent": ["export const splitOnce = (text: string, separator: string): [string, string | undefined] => {\n const index = text.indexOf(separator)\n if (index === -1) {\n return [text, undefined]\n }\n return [text.slice(0, index), text.slice(index + 1)]\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,YAAY,CAAC,MAAc,cAAoD;AAC1F,QAAM,QAAQ,KAAK,QAAQ,SAAS;AACpC,MAAI,UAAU,IAAI;AAChB,WAAO,CAAC,MAAM,MAAS;AAAA,EACzB;AACA,SAAO,CAAC,KAAK,MAAM,GAAG,KAAK,GAAG,KAAK,MAAM,QAAQ,CAAC,CAAC;AACrD;",
4
+ "sourcesContent": ["export const splitOnce = (text: string, separator: string): [string, string | undefined] => {\n const index = text.indexOf(separator)\n if (index === -1) {\n return [text, undefined]\n }\n return [text.slice(0, index), text.slice(index + 1)]\n}\n\nexport function* chunkString(input: string, chunkSize: number): Generator<string, void, void> {\n for (let i = 0; i < input.length; i += chunkSize) {\n yield input.slice(i, i + chunkSize)\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,YAAY,CAAC,MAAc,cAAoD;AAC1F,QAAM,QAAQ,KAAK,QAAQ,SAAS;AACpC,MAAI,UAAU,IAAI;AAChB,WAAO,CAAC,MAAM,MAAS;AAAA,EACzB;AACA,SAAO,CAAC,KAAK,MAAM,GAAG,KAAK,GAAG,KAAK,MAAM,QAAQ,CAAC,CAAC;AACrD;AAEO,UAAU,YAAY,OAAe,WAAkD;AAC5F,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,WAAW;AAChD,UAAM,MAAM,MAAM,GAAG,IAAI,SAAS;AAAA,EACpC;AACF;",
6
6
  "names": []
7
7
  }
package/e2e/defaults.ts CHANGED
@@ -9,6 +9,7 @@ const json = false
9
9
  const entryPoint = consts.defaultEntrypoint
10
10
  const outDir = consts.defaultOutputFolder
11
11
  const allowDeprecated = false
12
+ const isPublic = false
12
13
  export default {
13
14
  noBuild,
14
15
  secrets,
@@ -19,4 +20,5 @@ export default {
19
20
  entryPoint,
20
21
  outDir,
21
22
  allowDeprecated,
23
+ public: isPublic,
22
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/cli",
3
- "version": "0.6.10",
3
+ "version": "0.6.12",
4
4
  "description": "Botpress CLI",
5
5
  "scripts": {
6
6
  "build": "pnpm run bundle && pnpm run template:gen",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "main": "dist/index.js",
22
22
  "dependencies": {
23
- "@botpress/client": "0.12.2",
23
+ "@botpress/client": "0.12.3",
24
24
  "@bpinternal/const": "^0.0.20",
25
25
  "@bpinternal/tunnel": "^0.1.1",
26
26
  "@bpinternal/yargs-extra": "^0.0.3",
@@ -49,7 +49,7 @@
49
49
  "zod": "^3.20.6"
50
50
  },
51
51
  "devDependencies": {
52
- "@botpress/sdk": "0.6.9",
52
+ "@botpress/sdk": "0.6.11",
53
53
  "@bpinternal/log4bot": "^0.0.4",
54
54
  "@types/bluebird": "^3.5.38",
55
55
  "@types/json-schema": "^7.0.11",
@@ -8,8 +8,8 @@
8
8
  "author": "",
9
9
  "license": "MIT",
10
10
  "dependencies": {
11
- "@botpress/client": "0.12.2",
12
- "@botpress/sdk": "0.6.9",
11
+ "@botpress/client": "0.12.3",
12
+ "@botpress/sdk": "0.6.11",
13
13
  "zod": "^3.20.6"
14
14
  },
15
15
  "devDependencies": {
@@ -9,8 +9,8 @@
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@botpress/client": "0.12.2",
13
- "@botpress/sdk": "0.6.9",
12
+ "@botpress/client": "0.12.3",
13
+ "@botpress/sdk": "0.6.11",
14
14
  "zod": "^3.20.6"
15
15
  },
16
16
  "devDependencies": {