@botpress/cli 0.8.38 → 0.8.40

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,20 +1,20 @@
1
1
 
2
- > @botpress/cli@0.8.38 build /home/runner/work/botpress/botpress/packages/cli
2
+ > @botpress/cli@0.8.40 build /home/runner/work/botpress/botpress/packages/cli
3
3
  > pnpm run bundle && pnpm run template:gen
4
4
 
5
5
 
6
- > @botpress/cli@0.8.38 bundle /home/runner/work/botpress/botpress/packages/cli
6
+ > @botpress/cli@0.8.40 bundle /home/runner/work/botpress/botpress/packages/cli
7
7
  > ts-node -T build.ts
8
8
 
9
9
 
10
- > @botpress/cli@0.8.38 template:gen /home/runner/work/botpress/botpress/packages/cli
10
+ > @botpress/cli@0.8.40 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 v0.8.38
14
- šŸ¤– Botpress CLI v0.8.38
15
- šŸ¤– Botpress CLI v0.8.38
16
- šŸ¤– Botpress CLI v0.8.38
13
+ šŸ¤– Botpress CLI v0.8.40
14
+ šŸ¤– Botpress CLI v0.8.40
15
+ šŸ¤– Botpress CLI v0.8.40
16
+ šŸ¤– Botpress CLI v0.8.40
17
17
  ⚠ No typings to generate for bot projects
18
- ā—‹ Generating typings for integration webhook-message...ā—‹ Generating typings for integration empty-integration...ā—‹ Generating typings for integration hello-world...āœ“ Typings available at .botpress
18
+ ā—‹ Generating typings for integration hello-world...ā—‹ Generating typings for integration webhook-message...ā—‹ Generating typings for integration empty-integration...āœ“ Typings available at .botpress
19
19
  āœ“ Typings available at .botpress
20
20
  āœ“ Typings available at .botpress
@@ -124,6 +124,10 @@ class ApiClient {
124
124
  }
125
125
  return this.findIntegration({ type: "id", id: previous.id });
126
126
  }
127
+ async findBotByName(name) {
128
+ const allBots = await this.listAllPages(this.client.listBots, (r) => r.bots);
129
+ return allBots.find((b) => b.name === name);
130
+ }
127
131
  }
128
132
  // Annotate the CommonJS export names for ESM import in node:
129
133
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/api/client.ts"],
4
- "sourcesContent": ["import * as client from '@botpress/client'\nimport _ from 'lodash'\nimport { formatIntegrationRef, ApiIntegrationRef as IntegrationRef, NameIntegrationRef } from '../integration-ref'\nimport type { Logger } from '../logger'\nimport { findPreviousIntegrationVersion } from './find-previous-version'\nimport * as paging from './paging'\nimport {\n ApiClientProps,\n PublicIntegration,\n PrivateIntegration,\n Integration,\n Requests,\n Responses,\n Interface,\n} from './types'\n\nexport * from './types'\n\n/**\n * This class is used to wrap the Botpress API and provide a more convenient way to interact with it.\n */\nexport class ApiClient {\n public readonly client: client.Client\n public readonly url: string\n public readonly token: string\n public readonly workspaceId: string\n\n public static newClient = (props: ApiClientProps, logger: Logger) => new ApiClient(props, logger)\n\n public constructor(props: ApiClientProps, private _logger: Logger) {\n const { apiUrl, token, workspaceId } = props\n this.client = new client.Client({ apiUrl, token, workspaceId })\n this.url = apiUrl\n this.token = token\n this.workspaceId = workspaceId\n }\n\n public get isBotpressWorkspace(): boolean {\n return [\n '6a76fa10-e150-4ff6-8f59-a300feec06c1',\n '95de33eb-1551-4af9-9088-e5dcb02efd09',\n '11111111-1111-1111-aaaa-111111111111',\n ].includes(this.workspaceId)\n }\n\n public async getWorkspace(): Promise<Responses['getWorkspace']> {\n return this.client.getWorkspace({ id: this.workspaceId })\n }\n\n public async updateWorkspace(props: Omit<Requests['updateWorkspace'], 'id'>): Promise<Responses['updateWorkspace']> {\n return this.client.updateWorkspace({ id: this.workspaceId, ...props })\n }\n\n public async findIntegration(ref: IntegrationRef): Promise<Integration | undefined> {\n const formatted = formatIntegrationRef(ref)\n\n const privateIntegration = await this.findPrivateIntegration(ref)\n if (privateIntegration) {\n this._logger.debug(`Found integration \"${formatted}\" in workspace`)\n return privateIntegration\n }\n\n const publicIntegration = await this.findPublicIntegration(ref)\n if (publicIntegration) {\n this._logger.debug(`Found integration \"${formatted}\" in hub`)\n return publicIntegration\n }\n\n return\n }\n\n public async findPrivateIntegration(ref: IntegrationRef): Promise<PrivateIntegration | undefined> {\n const { workspaceId } = this\n if (ref.type === 'id') {\n return this.validateStatus(\n () => this.client.getIntegration(ref).then((r) => ({ ...r.integration, workspaceId })),\n 404\n )\n }\n return this.validateStatus(\n () => this.client.getIntegrationByName(ref).then((r) => ({ ...r.integration, workspaceId })),\n 404\n )\n }\n\n public async findPublicIntegration(ref: IntegrationRef): Promise<PublicIntegration | undefined> {\n if (ref.type === 'id') {\n return this.validateStatus(() => this.client.getPublicIntegrationById(ref).then((r) => r.integration), 404)\n }\n return this.validateStatus(() => this.client.getPublicIntegration(ref).then((r) => r.integration), 404)\n }\n\n public async findPublicInterface(ref: IntegrationRef): Promise<Interface | undefined> {\n if (ref.type === 'id') {\n return this.validateStatus(() => this.client.getInterface(ref).then((r) => r.interface), 404)\n }\n return this.validateStatus(() => this.client.getInterfaceByName(ref).then((r) => r.interface), 404)\n }\n\n public async testLogin(): Promise<void> {\n await this.client.listBots({})\n }\n\n public listAllPages = paging.listAllPages\n\n public async validateStatus<V>(fn: () => Promise<V>, allowedStatuses: number | number[]): Promise<V | undefined> {\n try {\n const v = await fn()\n return v\n } catch (err) {\n const allowedStatusesArray = _.isArray(allowedStatuses) ? allowedStatuses : [allowedStatuses]\n const isAllowed = client.isApiError(err) && err.code && allowedStatusesArray.includes(err.code)\n if (isAllowed) {\n return\n }\n throw err\n }\n }\n\n public async findPreviousIntegrationVersion(ref: NameIntegrationRef): Promise<Integration | undefined> {\n const previous = await findPreviousIntegrationVersion(this.client, ref)\n if (!previous) {\n return\n }\n return this.findIntegration({ type: 'id', id: previous.id })\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AACxB,oBAAc;AACd,6BAA8F;AAE9F,mCAA+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,UAAI,WAAW;AACb;AAAA,MACF;AACA,YAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEA,MAAa,+BAA+B,KAA2D;AACrG,UAAM,WAAW,UAAM,6DAA+B,KAAK,QAAQ,GAAG;AACtE,QAAI,CAAC,UAAU;AACb;AAAA,IACF;AACA,WAAO,KAAK,gBAAgB,EAAE,MAAM,MAAM,IAAI,SAAS,GAAG,CAAC;AAAA,EAC7D;AACF;",
4
+ "sourcesContent": ["import * as client from '@botpress/client'\nimport _ from 'lodash'\nimport { formatIntegrationRef, ApiIntegrationRef as IntegrationRef, NameIntegrationRef } from '../integration-ref'\nimport type { Logger } from '../logger'\nimport { findPreviousIntegrationVersion } from './find-previous-version'\nimport * as paging from './paging'\nimport {\n ApiClientProps,\n PublicIntegration,\n PrivateIntegration,\n Integration,\n Requests,\n Responses,\n Interface,\n BotSummary,\n} from './types'\n\nexport * from './types'\n\n/**\n * This class is used to wrap the Botpress API and provide a more convenient way to interact with it.\n */\nexport class ApiClient {\n public readonly client: client.Client\n public readonly url: string\n public readonly token: string\n public readonly workspaceId: string\n\n public static newClient = (props: ApiClientProps, logger: Logger) => new ApiClient(props, logger)\n\n public constructor(props: ApiClientProps, private _logger: Logger) {\n const { apiUrl, token, workspaceId } = props\n this.client = new client.Client({ apiUrl, token, workspaceId })\n this.url = apiUrl\n this.token = token\n this.workspaceId = workspaceId\n }\n\n public get isBotpressWorkspace(): boolean {\n return [\n '6a76fa10-e150-4ff6-8f59-a300feec06c1',\n '95de33eb-1551-4af9-9088-e5dcb02efd09',\n '11111111-1111-1111-aaaa-111111111111',\n ].includes(this.workspaceId)\n }\n\n public async getWorkspace(): Promise<Responses['getWorkspace']> {\n return this.client.getWorkspace({ id: this.workspaceId })\n }\n\n public async updateWorkspace(props: Omit<Requests['updateWorkspace'], 'id'>): Promise<Responses['updateWorkspace']> {\n return this.client.updateWorkspace({ id: this.workspaceId, ...props })\n }\n\n public async findIntegration(ref: IntegrationRef): Promise<Integration | undefined> {\n const formatted = formatIntegrationRef(ref)\n\n const privateIntegration = await this.findPrivateIntegration(ref)\n if (privateIntegration) {\n this._logger.debug(`Found integration \"${formatted}\" in workspace`)\n return privateIntegration\n }\n\n const publicIntegration = await this.findPublicIntegration(ref)\n if (publicIntegration) {\n this._logger.debug(`Found integration \"${formatted}\" in hub`)\n return publicIntegration\n }\n\n return\n }\n\n public async findPrivateIntegration(ref: IntegrationRef): Promise<PrivateIntegration | undefined> {\n const { workspaceId } = this\n if (ref.type === 'id') {\n return this.validateStatus(\n () => this.client.getIntegration(ref).then((r) => ({ ...r.integration, workspaceId })),\n 404\n )\n }\n return this.validateStatus(\n () => this.client.getIntegrationByName(ref).then((r) => ({ ...r.integration, workspaceId })),\n 404\n )\n }\n\n public async findPublicIntegration(ref: IntegrationRef): Promise<PublicIntegration | undefined> {\n if (ref.type === 'id') {\n return this.validateStatus(() => this.client.getPublicIntegrationById(ref).then((r) => r.integration), 404)\n }\n return this.validateStatus(() => this.client.getPublicIntegration(ref).then((r) => r.integration), 404)\n }\n\n public async findPublicInterface(ref: IntegrationRef): Promise<Interface | undefined> {\n if (ref.type === 'id') {\n return this.validateStatus(() => this.client.getInterface(ref).then((r) => r.interface), 404)\n }\n return this.validateStatus(() => this.client.getInterfaceByName(ref).then((r) => r.interface), 404)\n }\n\n public async testLogin(): Promise<void> {\n await this.client.listBots({})\n }\n\n public listAllPages = paging.listAllPages\n\n public async validateStatus<V>(fn: () => Promise<V>, allowedStatuses: number | number[]): Promise<V | undefined> {\n try {\n const v = await fn()\n return v\n } catch (err) {\n const allowedStatusesArray = _.isArray(allowedStatuses) ? allowedStatuses : [allowedStatuses]\n const isAllowed = client.isApiError(err) && err.code && allowedStatusesArray.includes(err.code)\n if (isAllowed) {\n return\n }\n throw err\n }\n }\n\n public async findPreviousIntegrationVersion(ref: NameIntegrationRef): Promise<Integration | undefined> {\n const previous = await findPreviousIntegrationVersion(this.client, ref)\n if (!previous) {\n return\n }\n return this.findIntegration({ type: 'id', id: previous.id })\n }\n\n public async findBotByName(name: string): Promise<BotSummary | undefined> {\n // api does not allow filtering bots by name\n const allBots = await this.listAllPages(this.client.listBots, (r) => r.bots)\n return allBots.find((b) => b.name === name)\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AACxB,oBAAc;AACd,6BAA8F;AAE9F,mCAA+C;AAC/C,aAAwB;AAYxB,2BAAc,oBAjBd;AAsBO,MAAM,UAAU;AAAA,EAQd,YAAY,OAA+B,SAAiB;AAAjB;AAChD,UAAM,EAAE,QAAQ,OAAO,YAAY,IAAI;AACvC,SAAK,SAAS,IAAI,OAAO,OAAO,EAAE,QAAQ,OAAO,YAAY,CAAC;AAC9D,SAAK,MAAM;AACX,SAAK,QAAQ;AACb,SAAK,cAAc;AAAA,EACrB;AAAA,EAbgB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEhB,OAAc,YAAY,CAAC,OAAuB,WAAmB,IAAI,UAAU,OAAO,MAAM;AAAA,EAUhG,IAAW,sBAA+B;AACxC,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,SAAS,KAAK,WAAW;AAAA,EAC7B;AAAA,EAEA,MAAa,eAAmD;AAC9D,WAAO,KAAK,OAAO,aAAa,EAAE,IAAI,KAAK,YAAY,CAAC;AAAA,EAC1D;AAAA,EAEA,MAAa,gBAAgB,OAAuF;AAClH,WAAO,KAAK,OAAO,gBAAgB,EAAE,IAAI,KAAK,aAAa,GAAG,MAAM,CAAC;AAAA,EACvE;AAAA,EAEA,MAAa,gBAAgB,KAAuD;AAClF,UAAM,gBAAY,6CAAqB,GAAG;AAE1C,UAAM,qBAAqB,MAAM,KAAK,uBAAuB,GAAG;AAChE,QAAI,oBAAoB;AACtB,WAAK,QAAQ,MAAM,sBAAsB,yBAAyB;AAClE,aAAO;AAAA,IACT;AAEA,UAAM,oBAAoB,MAAM,KAAK,sB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Aa,eAAkB,IAAsB,iBAA4D;AAC/G,QAAI;AACF,YAAM,IAAI,MAAM,GAAG;AACnB,aAAO;AAAA,IACT,SAAS,KAAP;AACA,YAAM,uBAAuB,cAAAA,QAAE,QAAQ,eAAe,IAAI,kBAAkB,CAAC,eAAe;AAC5F,YAAM,YAAY,OAAO,WAAW,GAAG,KAAK,IAAI,QAAQ,qBAAqB,SAAS,IAAI,IAAI;AAC9F,UAAI,WAAW;AACb;AAAA,MACF;AACA,YAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEA,MAAa,+BAA+B,KAA2D;AACrG,UAAM,WAAW,UAAM,6DAA+B,KAAK,QAAQ,GAAG;AACtE,QAAI,CAAC,UAAU;AACb;AAAA,IACF;AACA,WAAO,KAAK,gBAAgB,EAAE,MAAM,MAAM,IAAI,SAAS,GAAG,CAAC;AAAA,EAC7D;AAAA,EAEA,MAAa,cAAc,MAA+C;AAExE,UAAM,UAAU,MAAM,KAAK,aAAa,KAAK,OAAO,UAAU,CAAC,MAAM,EAAE,IAAI;AAC3E,WAAO,QAAQ,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI;AAAA,EAC5C;AACF;",
6
6
  "names": ["_"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/api/types.ts"],
4
- "sourcesContent": ["import * as client from '@botpress/client'\nimport { Logger } from 'src/logger'\nimport { ApiClient } from './client'\n\nexport type ApiClientProps = {\n apiUrl: string\n token: string\n workspaceId: string\n}\n\nexport type ApiClientFactory = {\n newClient: (props: ApiClientProps, logger: Logger) => ApiClient\n}\n\nexport type PublicIntegration = client.Integration\nexport type PrivateIntegration = client.Integration & { workspaceId: string }\nexport type Integration = client.Integration & { workspaceId?: string }\nexport type IntegrationSummary = client.ClientOutputs['listIntegrations']['integrations'][number]\n\nexport type Interface = client.Interface\n\nexport type BaseOperation = (...args: any[]) => Promise<any>\nexport type Operations = {\n [K in keyof client.Client as client.Client[K] extends BaseOperation ? K : never]: client.Client[K]\n}\nexport type Requests = {\n [K in keyof Operations]: Parameters<Operations[K]>[0]\n}\nexport type Responses = {\n [K in keyof Operations]: ReturnType<Operations[K]>\n}\n"],
4
+ "sourcesContent": ["import * as client from '@botpress/client'\nimport { Logger } from 'src/logger'\nimport { ApiClient } from './client'\n\nexport type ApiClientProps = {\n apiUrl: string\n token: string\n workspaceId: string\n}\n\nexport type ApiClientFactory = {\n newClient: (props: ApiClientProps, logger: Logger) => ApiClient\n}\n\nexport type PublicIntegration = client.Integration\nexport type PrivateIntegration = client.Integration & { workspaceId: string }\nexport type Integration = client.Integration & { workspaceId?: string }\nexport type IntegrationSummary = client.ClientOutputs['listIntegrations']['integrations'][number]\n\nexport type BotSummary = client.ClientOutputs['listBots']['bots'][number]\n\nexport type Interface = client.Interface\n\nexport type BaseOperation = (...args: any[]) => Promise<any>\nexport type Operations = {\n [K in keyof client.Client as client.Client[K] extends BaseOperation ? K : never]: client.Client[K]\n}\nexport type Requests = {\n [K in keyof Operations]: Parameters<Operations[K]>[0]\n}\nexport type Responses = {\n [K in keyof Operations]: ReturnType<Operations[K]>\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -74,15 +74,34 @@ class DeleteBotCommand extends import_global_command.GlobalCommand {
74
74
  }
75
75
  class CreateBotCommand extends import_global_command.GlobalCommand {
76
76
  async run() {
77
- const { client } = await this.ensureLoginAndCreateClient(this.argv);
77
+ const api = await this.ensureLoginAndCreateClient(this.argv);
78
78
  try {
79
- const { bot } = await client.createBot({ name: this.argv.name });
80
- this.logger.success(`Bot ${import_chalk.default.bold(bot.id)}:`);
81
- this.logger.json(bot);
79
+ if (this.argv.ifNotExists) {
80
+ await this._getOrCreate(api, this.argv.name);
81
+ return;
82
+ }
83
+ await this._create(api, this.argv.name);
82
84
  } catch (thrown) {
83
85
  throw errors.BotpressCLIError.wrap(thrown, "Could not create bot");
84
86
  }
85
87
  }
88
+ _getOrCreate = async (api, name) => {
89
+ if (!name) {
90
+ throw new errors.BotpressCLIError("option --if-not-exists requires that a name be provided");
91
+ }
92
+ const existingBot = await api.findBotByName(name);
93
+ if (existingBot) {
94
+ this.logger.success(`Bot ${import_chalk.default.bold(name)} already exists`);
95
+ this.logger.json(existingBot);
96
+ return;
97
+ }
98
+ return this._create(api, name);
99
+ };
100
+ _create = async (api, name) => {
101
+ const { bot } = await api.client.createBot({ name });
102
+ this.logger.success(`Bot ${import_chalk.default.bold(bot.id)}:`);
103
+ this.logger.json(bot);
104
+ };
86
105
  }
87
106
  // Annotate the CommonJS export names for ESM import in node:
88
107
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/command-implementations/bot-commands.ts"],
4
- "sourcesContent": ["import chalk from 'chalk'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { GlobalCommand } from './global-command'\n\nexport type GetBotCommandDefinition = typeof commandDefinitions.bots.subcommands.get\nexport class GetBotCommand extends GlobalCommand<GetBotCommandDefinition> {\n public async run(): Promise<void> {\n const { client } = await this.ensureLoginAndCreateClient(this.argv)\n\n try {\n const { bot } = await client.getBot({ id: this.argv.botRef })\n this.logger.success(`Bot ${chalk.bold(this.argv.botRef)}:`)\n this.logger.json(bot)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get bot ${this.argv.botRef}`)\n }\n }\n}\n\nexport type ListBotsCommandDefinition = typeof commandDefinitions.bots.subcommands.list\nexport class ListBotsCommand extends GlobalCommand<ListBotsCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n try {\n const { dev } = this.argv\n const bots = await api.listAllPages(\n (x) => api.client.listBots({ ...x, dev }),\n (r) => r.bots\n )\n this.logger.success('Bots:')\n this.logger.json(bots)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not list bots')\n }\n }\n}\n\nexport type DeleteBotCommandDefinition = typeof commandDefinitions.bots.subcommands.delete\nexport class DeleteBotCommand extends GlobalCommand<DeleteBotCommandDefinition> {\n public async run(): Promise<void> {\n const { client } = await this.ensureLoginAndCreateClient(this.argv)\n\n try {\n await client.deleteBot({ id: this.argv.botRef })\n this.logger.success(`Bot ${chalk.bold(this.argv.botRef)} deleted`)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not delete bot ${this.argv.botRef}`)\n }\n }\n}\n\nexport type CreateBotCommandDefinition = typeof commandDefinitions.bots.subcommands.create\nexport class CreateBotCommand extends GlobalCommand<CreateBotCommandDefinition> {\n public async run(): Promise<void> {\n const { client } = await this.ensureLoginAndCreateClient(this.argv)\n\n try {\n const { bot } = await client.createBot({ name: this.argv.name })\n this.logger.success(`Bot ${chalk.bold(bot.id)}:`)\n this.logger.json(bot)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not create bot')\n }\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,aAAwB;AACxB,4BAA8B;AAGvB,MAAM,sBAAsB,oCAAuC;AAAA,EACxE,MAAa,MAAqB;AAChC,UAAM,EAAE,OAAO,IAAI,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAElE,QAAI;AACF,YAAM,EAAE,IAAI,IAAI,MAAM,OAAO,OAAO,EAAE,IAAI,KAAK,KAAK,OAAO,CAAC;AAC5D,WAAK,OAAO,QAAQ,OAAO,aAAAA,QAAM,KAAK,KAAK,KAAK,MAAM,IAAI;AAC1D,WAAK,OAAO,KAAK,GAAG;AAAA,IACtB,SAAS,QAAP;AACA,YAAM,OAAO,iBAAiB,KAAK,QAAQ,qBAAqB,KAAK,KAAK,QAAQ;AAAA,IACpF;AAAA,EACF;AACF;AAGO,MAAM,wBAAwB,oCAAyC;AAAA,EAC5E,MAAa,MAAqB;AAChC,UAAM,MAA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api/client'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { GlobalCommand } from './global-command'\n\nexport type GetBotCommandDefinition = typeof commandDefinitions.bots.subcommands.get\nexport class GetBotCommand extends GlobalCommand<GetBotCommandDefinition> {\n public async run(): Promise<void> {\n const { client } = await this.ensureLoginAndCreateClient(this.argv)\n\n try {\n const { bot } = await client.getBot({ id: this.argv.botRef })\n this.logger.success(`Bot ${chalk.bold(this.argv.botRef)}:`)\n this.logger.json(bot)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get bot ${this.argv.botRef}`)\n }\n }\n}\n\nexport type ListBotsCommandDefinition = typeof commandDefinitions.bots.subcommands.list\nexport class ListBotsCommand extends GlobalCommand<ListBotsCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n try {\n const { dev } = this.argv\n const bots = await api.listAllPages(\n (x) => api.client.listBots({ ...x, dev }),\n (r) => r.bots\n )\n this.logger.success('Bots:')\n this.logger.json(bots)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not list bots')\n }\n }\n}\n\nexport type DeleteBotCommandDefinition = typeof commandDefinitions.bots.subcommands.delete\nexport class DeleteBotCommand extends GlobalCommand<DeleteBotCommandDefinition> {\n public async run(): Promise<void> {\n const { client } = await this.ensureLoginAndCreateClient(this.argv)\n\n try {\n await client.deleteBot({ id: this.argv.botRef })\n this.logger.success(`Bot ${chalk.bold(this.argv.botRef)} deleted`)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not delete bot ${this.argv.botRef}`)\n }\n }\n}\n\nexport type CreateBotCommandDefinition = typeof commandDefinitions.bots.subcommands.create\nexport class CreateBotCommand extends GlobalCommand<CreateBotCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n try {\n if (this.argv.ifNotExists) {\n await this._getOrCreate(api, this.argv.name)\n return\n }\n await this._create(api, this.argv.name)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not create bot')\n }\n }\n\n private _getOrCreate = async (api: ApiClient, name: string | undefined) => {\n if (!name) {\n throw new errors.BotpressCLIError('option --if-not-exists requires that a name be provided')\n }\n const existingBot = await api.findBotByName(name)\n if (existingBot) {\n this.logger.success(`Bot ${chalk.bold(name)} already exists`)\n this.logger.json(existingBot)\n return\n }\n return this._create(api, name)\n }\n\n private _create = async (api: ApiClient, name: string | undefined) => {\n const { bot } = await api.client.createBot({ name })\n this.logger.success(`Bot ${chalk.bold(bot.id)}:`)\n this.logger.json(bot)\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAGlB,aAAwB;AACxB,4BAA8B;AAGvB,MAAM,sBAAsB,oCAAuC;AAAA,EACxE,MAAa,MAAqB;AAChC,UAAM,EAAE,OAAO,IAAI,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAElE,QAAI;AACF,YAAM,EAAE,IAAI,IAAI,MAAM,OAAO,OAAO,EAAE,IAAI,KAAK,KAAK,OAAO,CAAC;AAC5D,WAAK,OAAO,QAAQ,OAAO,aAAAA,QAAM,KAAK,KAAK,KAAK,MAAM,IAAI;AAC1D,WAAK,OAAO,KAAK,GAAG;AAAA,IACtB,SAAS,QAAP;AACA,YAAM,OAAO,iBAAiB,KAAK,QAAQ,qBAAqB,KAAK,KAAK,QAAQ;AAAA,IACpF;AAAA,EACF;AACF;AAGO,MAAM,wBAAwB,oCAAyC;AAAA,EAC5E,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAE3D,QAAI;AACF,YAAM,EAAE,IAAI,IAAI,KAAK;AACrB,YAAM,OAAO,MAAM,IAAI;AAAA,QACrB,CAAC,MAAM,IAAI,OAAO,SAAS,EAAE,GAAG,GAAG,IAAI,CAAC;AAAA,QACxC,CAAC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Q,KAAK,IAAI;AAAA,EAC/B;AAAA,EAEQ,UAAU,OAAO,KAAgB,SAA6B;AACpE,UAAM,EAAE,IAAI,IAAI,MAAM,IAAI,OAAO,UAAU,EAAE,KAAK,CAAC;AACnD,SAAK,OAAO,QAAQ,OAAO,aAAAA,QAAM,KAAK,IAAI,EAAE,IAAI;AAChD,SAAK,OAAO,KAAK,GAAG;AAAA,EACtB;AACF;",
6
6
  "names": ["chalk"]
7
7
  }
package/dist/config.js CHANGED
@@ -190,7 +190,12 @@ const logoutSchema = {
190
190
  const createBotSchema = {
191
191
  ...globalSchema,
192
192
  ...credentialsSchema,
193
- name: { type: "string", description: "The name of the bot to create" }
193
+ name: { type: "string", description: "The name of the bot to create" },
194
+ ifNotExists: {
195
+ type: "boolean",
196
+ description: "Do not create if a bot with the same name already exists",
197
+ default: false
198
+ }
194
199
  };
195
200
  const getBotSchema = {
196
201
  ...globalSchema,
@@ -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 optional version. Ex: teams or teams@0.2.0',\n demandOption: true,\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst interfaceRef = {\n ...integrationRef,\n description: 'The interface ID or name with optional version. Ex: teams or teams@0.2.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 getInterfaceSchema = {\n ...globalSchema,\n ...credentialsSchema,\n interfaceRef,\n} satisfies CommandSchema\n\nconst listInterfacesSchema = {\n ...globalSchema,\n ...credentialsSchema,\n} satisfies CommandSchema\n\nconst deleteInterfaceSchema = {\n ...globalSchema,\n ...credentialsSchema,\n interfaceRef,\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 getInterface: getInterfaceSchema,\n listInterfaces: listInterfacesSchema,\n deleteInterface: deleteInterfaceSchema,\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,OAA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G;AAAA,EACH;AACF;AAEA,MAAM,uBAAuB;AAAA,EAC3B,GAAG;AAAA,EACH,GAAG;AAAA,EACH;AACF;AAEA,MAAM,yBAAyB;AAAA,EAC7B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,EAAE,MAAM,UAAU,aAAa,4CAA4C;AAAA,EACjF,eAAe,EAAE,MAAM,UAAU,aAAa,+CAA+C;AAAA,EAC7F;AACF;AAEA,MAAM,0BAA0B;AAAA,EAC9B,GAAG;AAAA,EACH,GAAG;AAAA,EACH;AACF;AAEA,MAAM,qBAAqB;AAAA,EACzB,GAAG;AAAA,EACH,GAAG;AAAA,EACH;AACF;AAEA,MAAM,uBAAuB;AAAA,EAC3B,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,wBAAwB;AAAA,EAC5B,GAAG;AAAA,EACH,GAAG;AAAA,EACH;AACF;AAEA,MAAM,aAAa;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,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,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;",
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 optional version. Ex: teams or teams@0.2.0',\n demandOption: true,\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst interfaceRef = {\n ...integrationRef,\n description: 'The interface ID or name with optional version. Ex: teams or teams@0.2.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 ifNotExists: {\n type: 'boolean',\n description: 'Do not create if a bot with the same name already exists',\n default: false,\n },\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 getInterfaceSchema = {\n ...globalSchema,\n ...credentialsSchema,\n interfaceRef,\n} satisfies CommandSchema\n\nconst listInterfacesSchema = {\n ...globalSchema,\n ...credentialsSchema,\n} satisfies CommandSchema\n\nconst deleteInterfaceSchema = {\n ...globalSchema,\n ...credentialsSchema,\n interfaceRef,\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 getInterface: getInterfaceSchema,\n listInterfaces: listInterfacesSchema,\n deleteInterface: deleteInterfaceSchema,\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,eAAe;AAAA,EACnB,GAAG;AAAA,EACH,aAAa;AACf;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,SAAS;AACX;AAIA,MAAM,eAAe;AAAA,EACnB,SAAS;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,OAAO;AAAA,IACP,SAAS;A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A,MAAM,aAAa;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,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,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
  }
@@ -34,7 +34,7 @@ export const createDeployBot: Test = {
34
34
  await utils.npmInstall({ workDir: botDir }).then(utils.handleExitCode)
35
35
  await impl.build({ ...argv, workDir: botDir }).then(utils.handleExitCode)
36
36
  await impl.login({ ...argv }).then(utils.handleExitCode)
37
- await impl.bots.subcommands.create({ ...argv, name: botName }).then(utils.handleExitCode)
37
+ await impl.bots.subcommands.create({ ...argv, name: botName, ifNotExists: false }).then(utils.handleExitCode)
38
38
 
39
39
  const bot = await fetchBot(client, botName)
40
40
  if (!bot) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/cli",
3
- "version": "0.8.38",
3
+ "version": "0.8.40",
4
4
  "description": "Botpress CLI",
5
5
  "scripts": {
6
6
  "build": "pnpm run bundle && pnpm run template:gen",
@@ -21,7 +21,7 @@
21
21
  "main": "dist/index.js",
22
22
  "dependencies": {
23
23
  "@botpress/client": "0.23.2",
24
- "@botpress/sdk": "0.8.33",
24
+ "@botpress/sdk": "0.8.34",
25
25
  "@bpinternal/const": "^0.0.20",
26
26
  "@bpinternal/tunnel": "^0.1.1",
27
27
  "@bpinternal/yargs-extra": "^0.0.3",
@@ -6,7 +6,7 @@
6
6
  "private": true,
7
7
  "dependencies": {
8
8
  "@botpress/client": "0.23.2",
9
- "@botpress/sdk": "0.8.33"
9
+ "@botpress/sdk": "0.8.34"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@types/node": "^18.11.17",
@@ -7,7 +7,7 @@
7
7
  "private": true,
8
8
  "dependencies": {
9
9
  "@botpress/client": "0.23.2",
10
- "@botpress/sdk": "0.8.33"
10
+ "@botpress/sdk": "0.8.34"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/node": "^18.11.17",
@@ -7,7 +7,7 @@
7
7
  "private": true,
8
8
  "dependencies": {
9
9
  "@botpress/client": "0.23.2",
10
- "@botpress/sdk": "0.8.33"
10
+ "@botpress/sdk": "0.8.34"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/node": "^18.11.17",
@@ -7,7 +7,7 @@
7
7
  "private": true,
8
8
  "dependencies": {
9
9
  "@botpress/client": "0.23.2",
10
- "@botpress/sdk": "0.8.33",
10
+ "@botpress/sdk": "0.8.34",
11
11
  "axios": "^1.6.8"
12
12
  },
13
13
  "devDependencies": {