@botpress/cli 4.11.2 → 4.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +10 -10
- package/dist/api/client.js +8 -1
- package/dist/api/client.js.map +2 -2
- package/dist/api/retry.js +45 -0
- package/dist/api/retry.js.map +7 -0
- package/dist/command-implementations/plugin-commands.js +3 -2
- package/dist/command-implementations/plugin-commands.js.map +2 -2
- package/dist/config.js +3 -1
- package/dist/config.js.map +2 -2
- package/dist/typings.js.map +1 -1
- package/package.json +3 -3
- package/templates/empty-bot/package.json +3 -3
- package/templates/empty-integration/package.json +3 -3
- package/templates/empty-plugin/package.json +2 -2
- package/templates/hello-world/package.json +3 -3
- package/templates/webhook-message/package.json +3 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/cli@4.
|
|
2
|
+
> @botpress/cli@4.12.0 build /home/runner/work/botpress/botpress/packages/cli
|
|
3
3
|
> pnpm run bundle && pnpm run template:gen
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @botpress/cli@4.
|
|
6
|
+
> @botpress/cli@4.12.0 bundle /home/runner/work/botpress/botpress/packages/cli
|
|
7
7
|
> ts-node -T build.ts
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @botpress/cli@4.
|
|
10
|
+
> @botpress/cli@4.12.0 template:gen /home/runner/work/botpress/botpress/packages/cli
|
|
11
11
|
> pnpm -r --stream -F @bp-templates/* exec bp gen
|
|
12
12
|
|
|
13
|
-
🤖 Botpress CLI v4.
|
|
14
|
-
🤖 Botpress CLI v4.
|
|
15
|
-
🤖 Botpress CLI v4.
|
|
16
|
-
🤖 Botpress CLI v4.
|
|
13
|
+
🤖 Botpress CLI v4.12.0
|
|
14
|
+
🤖 Botpress CLI v4.12.0
|
|
15
|
+
🤖 Botpress CLI v4.12.0
|
|
16
|
+
🤖 Botpress CLI v4.12.0
|
|
17
17
|
○ Generating typings for plugin empty-plugin...
|
|
18
18
|
✓ Typings available at .botpress
|
|
19
19
|
|
|
20
|
-
○ Generating typings for integration hello-world...
|
|
21
20
|
○ Generating typings for integration empty-integration...
|
|
22
|
-
○ Generating typings for bot...
|
|
23
21
|
✓ Typings available at .botpress
|
|
24
22
|
|
|
23
|
+
○ Generating typings for bot...
|
|
24
|
+
○ Generating typings for integration hello-world...
|
|
25
25
|
✓ Typings available at .botpress
|
|
26
26
|
|
|
27
27
|
✓ Typings available at .botpress
|
|
28
28
|
|
|
29
|
-
🤖 Botpress CLI v4.
|
|
29
|
+
🤖 Botpress CLI v4.12.0
|
|
30
30
|
○ Generating typings for integration webhook-message...
|
|
31
31
|
✓ Typings available at .botpress
|
|
32
32
|
|
package/dist/api/client.js
CHANGED
|
@@ -37,12 +37,19 @@ var import_yn = __toESM(require("yn"));
|
|
|
37
37
|
var import_package_ref = require("../package-ref");
|
|
38
38
|
var import_find_previous_version = require("./find-previous-version");
|
|
39
39
|
var paging = __toESM(require("./paging"));
|
|
40
|
+
var retry = __toESM(require("./retry"));
|
|
40
41
|
__reExport(client_exports, require("./types"), module.exports);
|
|
41
42
|
class ApiClient {
|
|
42
43
|
constructor(props, _logger) {
|
|
43
44
|
this._logger = _logger;
|
|
44
45
|
const { apiUrl, token, workspaceId, botId } = props;
|
|
45
|
-
this.client = new client.Client({
|
|
46
|
+
this.client = new client.Client({
|
|
47
|
+
apiUrl,
|
|
48
|
+
token,
|
|
49
|
+
workspaceId,
|
|
50
|
+
botId,
|
|
51
|
+
retry: retry.config
|
|
52
|
+
});
|
|
46
53
|
this.url = apiUrl;
|
|
47
54
|
this.token = token;
|
|
48
55
|
this.workspaceId = workspaceId;
|
package/dist/api/client.js.map
CHANGED
|
@@ -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 yn from 'yn'\nimport type { Logger } from '../logger'\nimport { formatPackageRef, ApiPackageRef, NamePackageRef } from '../package-ref'\nimport * as utils from '../utils'\nimport { findPreviousIntegrationVersion } from './find-previous-version'\nimport * as paging from './paging'\n\nimport {\n ApiClientProps,\n PublicIntegration,\n PrivateIntegration,\n PublicOrPrivateIntegration,\n PublicInterface,\n PrivateInterface,\n PublicOrPrivateInterface,\n PrivatePlugin,\n PublicPlugin,\n PublicOrPrivatePlugin,\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 public readonly botId?: string\n\n public static newClient = (props: ApiClientProps, logger: Logger) => new ApiClient(props, logger)\n\n public constructor(\n props: ApiClientProps,\n private _logger: Logger\n ) {\n const { apiUrl, token, workspaceId, botId } = props\n this.client = new client.Client({
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AACxB,gBAAe;AAEf,yBAAgE;AAEhE,mCAA+C;AAC/C,aAAwB;
|
|
4
|
+
"sourcesContent": ["import * as client from '@botpress/client'\nimport yn from 'yn'\nimport type { Logger } from '../logger'\nimport { formatPackageRef, ApiPackageRef, NamePackageRef } from '../package-ref'\nimport * as utils from '../utils'\nimport { findPreviousIntegrationVersion } from './find-previous-version'\nimport * as paging from './paging'\nimport * as retry from './retry'\n\nimport {\n ApiClientProps,\n PublicIntegration,\n PrivateIntegration,\n PublicOrPrivateIntegration,\n PublicInterface,\n PrivateInterface,\n PublicOrPrivateInterface,\n PrivatePlugin,\n PublicPlugin,\n PublicOrPrivatePlugin,\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 public readonly botId?: string\n\n public static newClient = (props: ApiClientProps, logger: Logger) => new ApiClient(props, logger)\n\n public constructor(\n props: ApiClientProps,\n private _logger: Logger\n ) {\n const { apiUrl, token, workspaceId, botId } = props\n this.client = new client.Client({\n apiUrl,\n token,\n workspaceId,\n botId,\n retry: retry.config,\n })\n this.url = apiUrl\n this.token = token\n this.workspaceId = workspaceId\n this.botId = botId\n }\n\n public get isBotpressWorkspace(): boolean {\n // this environment variable is undocumented and only used internally for dev purposes\n const isBotpressWorkspace = yn(process.env.BP_IS_BOTPRESS_WORKSPACE)\n if (isBotpressWorkspace !== undefined) {\n return isBotpressWorkspace\n }\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<client.ClientOutputs['getWorkspace']> {\n return this.client.getWorkspace({ id: this.workspaceId })\n }\n\n public async findWorkspaceByHandle(handle: string): Promise<client.ClientOutputs['getWorkspace'] | undefined> {\n const { workspaces } = await this.client.listWorkspaces({ handle })\n return workspaces[0] // There should be only one workspace with a given handle\n }\n\n public switchWorkspace(workspaceId: string): ApiClient {\n return ApiClient.newClient({ apiUrl: this.url, token: this.token, workspaceId }, this._logger)\n }\n\n public switchBot(botId: string): ApiClient {\n return ApiClient.newClient(\n { apiUrl: this.url, token: this.token, botId, workspaceId: this.workspaceId },\n this._logger\n )\n }\n\n public async updateWorkspace(\n props: utils.types.SafeOmit<client.ClientInputs['updateWorkspace'], 'id'>\n ): Promise<client.ClientOutputs['updateWorkspace']> {\n return this.client.updateWorkspace({ id: this.workspaceId, ...props })\n }\n\n public async getPublicOrPrivateIntegration(ref: ApiPackageRef): Promise<PublicOrPrivateIntegration> {\n const integration = await this.findPublicOrPrivateIntegration(ref)\n if (!integration) {\n throw new Error(`Integration \"${formatPackageRef(ref)}\" not found`)\n }\n return integration\n }\n\n public async findPublicOrPrivateIntegration(ref: ApiPackageRef): Promise<PublicOrPrivateIntegration | undefined> {\n const formatted = formatPackageRef(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: ApiPackageRef): Promise<PrivateIntegration | undefined> {\n const { workspaceId } = this\n if (ref.type === 'id') {\n return this.client\n .getIntegration(ref)\n .then((r) => ({ ...r.integration, workspaceId }))\n .catch(this._returnUndefinedOnError('ResourceNotFound'))\n }\n return this.client\n .getIntegrationByName(ref)\n .then((r) => ({ ...r.integration, workspaceId }))\n .catch(this._returnUndefinedOnError('ResourceNotFound'))\n }\n\n public async findPublicIntegration(ref: ApiPackageRef): Promise<PublicIntegration | undefined> {\n if (ref.type === 'id') {\n return this.client\n .getPublicIntegrationById(ref)\n .then((r) => ({ ...r.integration, public: true }) as const)\n .catch(this._returnUndefinedOnError('ResourceNotFound'))\n }\n return this.client\n .getPublicIntegration(ref)\n .then((r) => ({ ...r.integration, public: true }) as const)\n .catch(this._returnUndefinedOnError('ResourceNotFound'))\n }\n\n public async findPublicOrPrivateInterface(ref: ApiPackageRef): Promise<PublicOrPrivateInterface | undefined> {\n const formatted = formatPackageRef(ref)\n\n const privateInterface = await this.findPrivateInterface(ref)\n if (privateInterface) {\n this._logger.debug(`Found interface \"${formatted}\" in workspace`)\n return privateInterface\n }\n\n const publicInterface = await this.findPublicInterface(ref)\n if (publicInterface) {\n this._logger.debug(`Found interface \"${formatted}\" in hub`)\n return publicInterface\n }\n\n return\n }\n\n public async findPrivateInterface(ref: ApiPackageRef): Promise<PrivateInterface | undefined> {\n const { workspaceId } = this\n if (ref.type === 'id') {\n return this.client\n .getInterface(ref)\n .then((r) => ({ ...r.interface, workspaceId }))\n .catch(this._returnUndefinedOnError('ResourceNotFound'))\n }\n return this.client\n .getInterfaceByName(ref)\n .then((r) => ({ ...r.interface, workspaceId }))\n .catch(this._returnUndefinedOnError('ResourceNotFound'))\n }\n\n public async getPublicInterface(ref: ApiPackageRef): Promise<PublicInterface> {\n const intrface = await this.findPublicInterface(ref)\n if (!intrface) {\n throw new Error(`Interface \"${formatPackageRef(ref)}\" not found`)\n }\n return intrface\n }\n\n public async findPublicInterface(ref: ApiPackageRef): Promise<PublicInterface | undefined> {\n if (ref.type === 'id') {\n return this.client\n .getPublicInterfaceById(ref)\n .then((r) => ({ ...r.interface, public: true }) as const)\n .catch(this._returnUndefinedOnError('ResourceNotFound'))\n }\n\n return this.client\n .getPublicInterface(ref)\n .then((r) => ({ ...r.interface, public: true }) as const)\n .catch(this._returnUndefinedOnError('ResourceNotFound'))\n }\n\n public async findPublicPlugin(ref: ApiPackageRef): Promise<PublicPlugin | undefined> {\n if (ref.type === 'id') {\n return this.client\n .getPublicPluginById(ref)\n .then((r) => ({ ...r.plugin, public: true }) as const)\n .catch(this._returnUndefinedOnError('ResourceNotFound'))\n }\n\n return this.client\n .getPublicPlugin(ref)\n .then((r) => ({ ...r.plugin, public: true }) as const)\n .catch(this._returnUndefinedOnError('ResourceNotFound'))\n }\n\n public async getPublicOrPrivatePlugin(ref: ApiPackageRef): Promise<PublicOrPrivatePlugin> {\n const plugin = await this.findPublicOrPrivatePlugin(ref)\n if (!plugin) {\n throw new Error(`Plugin \"${formatPackageRef(ref)}\" not found`)\n }\n return plugin\n }\n\n public async findPublicOrPrivatePlugin(ref: ApiPackageRef): Promise<PublicOrPrivatePlugin | undefined> {\n const formatted = formatPackageRef(ref)\n\n const privatePlugin = await this.findPrivatePlugin(ref)\n if (privatePlugin) {\n this._logger.debug(`Found plugin \"${formatted}\" in workspace`)\n return privatePlugin\n }\n\n const publicPlugin = await this.findPublicPlugin(ref)\n if (publicPlugin) {\n this._logger.debug(`Found plugin \"${formatted}\" in hub`)\n return publicPlugin\n }\n\n return\n }\n\n public async findPrivatePlugin(ref: ApiPackageRef): Promise<PrivatePlugin | undefined> {\n const { workspaceId } = this\n if (ref.type === 'id') {\n return this.client\n .getPlugin(ref)\n .then((r) => ({ ...r.plugin, workspaceId }))\n .catch(this._returnUndefinedOnError('ResourceNotFound'))\n }\n return this.client\n .getPluginByName(ref)\n .then((r) => ({ ...r.plugin, workspaceId }))\n .catch(this._returnUndefinedOnError('ResourceNotFound'))\n }\n\n public async testLogin(): Promise<void> {\n await this.client.listBots({})\n }\n\n public listAllPages = paging.listAllPages\n\n public async findPreviousIntegrationVersion(ref: NamePackageRef): Promise<PublicOrPrivateIntegration | undefined> {\n const previous = await findPreviousIntegrationVersion(this.client, ref)\n if (!previous) {\n return\n }\n return this.findPublicOrPrivateIntegration({ 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 private _returnUndefinedOnError =\n (type: client.ApiError['type']) =>\n (thrown: any): undefined => {\n if (client.isApiError(thrown) && thrown.type === type) {\n return\n }\n throw thrown\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AACxB,gBAAe;AAEf,yBAAgE;AAEhE,mCAA+C;AAC/C,aAAwB;AACxB,YAAuB;AAgBvB,2BAAc,oBAvBd;AA4BO,MAAM,UAAU;AAAA,EASd,YACL,OACQ,SACR;AADQ;AAER,UAAM,EAAE,QAAQ,OAAO,aAAa,MAAM,IAAI;AAC9C,SAAK,SAAS,IAAI,OAAO,OAAO;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,MAAM;AAAA,IACf,CAAC;AACD,SAAK,MAAM;AACX,SAAK,QAAQ;AACb,SAAK,cAAc;AACnB,SAAK,QA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C,MAAM,KAAK,wBAAwB,kBAAkB,CAAC;AAAA,EAC3D;AAAA,EAEA,MAAa,YAA2B;AACtC,UAAM,KAAK,OAAO,SAAS,CAAC,CAAC;AAAA,EAC/B;AAAA,EAEO,eAAe,OAAO;AAAA,EAE7B,MAAa,+BAA+B,KAAsE;AAChH,UAAM,WAAW,UAAM,6DAA+B,KAAK,QAAQ,GAAG;AACtE,QAAI,CAAC,UAAU;AACb;AAAA,IACF;AACA,WAAO,KAAK,+BAA+B,EAAE,MAAM,MAAM,IAAI,SAAS,GAAG,CAAC;AAAA,EAC5E;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;AAAA,EAEQ,0BACN,CAAC,SACD,CAAC,WAA2B;AAC1B,QAAI,OAAO,WAAW,MAAM,KAAK,OAAO,SAAS,MAAM;AACrD;AAAA,IACF;AACA,UAAM;AAAA,EACR;AACJ;",
|
|
6
6
|
"names": ["yn"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var retry_exports = {};
|
|
30
|
+
__export(retry_exports, {
|
|
31
|
+
config: () => config
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(retry_exports);
|
|
34
|
+
var client = __toESM(require("@botpress/client"));
|
|
35
|
+
const HTTP_STATUS_TO_RETRY_ON = [429, 500, 502, 503, 504];
|
|
36
|
+
const config = {
|
|
37
|
+
retries: 3,
|
|
38
|
+
retryCondition: (err) => client.axiosRetry.isNetworkOrIdempotentRequestError(err) || HTTP_STATUS_TO_RETRY_ON.includes(err.response?.status ?? 0),
|
|
39
|
+
retryDelay: (retryCount) => retryCount * 1e3
|
|
40
|
+
};
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
config
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/api/retry.ts"],
|
|
4
|
+
"sourcesContent": ["import * as client from '@botpress/client'\n\n// TODO: we probably shouldnt retry on 500 errors, but this is a temporary fix for the botpress repo CI\nconst HTTP_STATUS_TO_RETRY_ON = [429, 500, 502, 503, 504]\nexport const config: client.RetryConfig = {\n retries: 3,\n retryCondition: (err) =>\n client.axiosRetry.isNetworkOrIdempotentRequestError(err) ||\n HTTP_STATUS_TO_RETRY_ON.includes(err.response?.status ?? 0),\n retryDelay: (retryCount) => retryCount * 1000,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AAGxB,MAAM,0BAA0B,CAAC,KAAK,KAAK,KAAK,KAAK,GAAG;AACjD,MAAM,SAA6B;AAAA,EACxC,SAAS;AAAA,EACT,gBAAgB,CAAC,QACf,OAAO,WAAW,kCAAkC,GAAG,KACvD,wBAAwB,SAAS,IAAI,UAAU,UAAU,CAAC;AAAA,EAC5D,YAAY,CAAC,eAAe,aAAa;AAC3C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -64,8 +64,9 @@ class GetPluginCommand extends import_global_command.GlobalCommand {
|
|
|
64
64
|
class ListPluginsCommand extends import_global_command.GlobalCommand {
|
|
65
65
|
async run() {
|
|
66
66
|
const api = await this.ensureLoginAndCreateClient(this.argv);
|
|
67
|
-
const
|
|
68
|
-
const
|
|
67
|
+
const { name, versionNumber: version } = this.argv;
|
|
68
|
+
const privateLister = (req) => api.client.listPlugins({ nextToken: req.nextToken, name, version });
|
|
69
|
+
const publicLister = (req) => api.client.listPublicPlugins({ nextToken: req.nextToken, name, version });
|
|
69
70
|
try {
|
|
70
71
|
const privatePlugins = await api.listAllPages(privateLister, (r) => r.plugins);
|
|
71
72
|
const publicPlugins = await api.listAllPages(publicLister, (r) => r.plugins);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/command-implementations/plugin-commands.ts"],
|
|
4
|
-
"sourcesContent": ["import type * as client from '@botpress/client'\nimport chalk from 'chalk'\nimport _ from 'lodash'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { parsePackageRef } from '../package-ref'\nimport { GlobalCommand } from './global-command'\n\nexport type GetPluginCommandDefinition = typeof commandDefinitions.plugins.subcommands.get\nexport class GetPluginCommand extends GlobalCommand<GetPluginCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.pluginRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.pluginRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot get local plugin')\n }\n\n try {\n const plugin = await api.findPublicOrPrivatePlugin(parsedRef)\n if (plugin) {\n this.logger.success(`Plugin ${chalk.bold(this.argv.pluginRef)}:`)\n this.logger.json(plugin)\n return\n }\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get plugin ${this.argv.pluginRef}`)\n }\n\n throw new errors.BotpressCLIError(`Plugin ${this.argv.pluginRef} not found`)\n }\n}\n\nexport type ListPluginsCommandDefinition = typeof commandDefinitions.plugins.subcommands.list\nexport class ListPluginsCommand extends GlobalCommand<ListPluginsCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n const privateLister = (req: { nextToken?: string })
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,oBAAc;AAEd,aAAwB;AACxB,yBAAgC;AAChC,4BAA8B;AAGvB,MAAM,yBAAyB,oCAA0C;AAAA,EAC9E,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAC3D,UAAM,gBAAY,oCAAgB,KAAK,KAAK,SAAS;AACrD,QAAI,CAAC,WAAW;AACd,YAAM,IAAI,OAAO,6BAA6B,KAAK,KAAK,SAAS;AAAA,IACnE;AACA,QAAI,UAAU,SAAS,QAAQ;AAC7B,YAAM,IAAI,OAAO,iBAAiB,yBAAyB;AAAA,IAC7D;AAEA,QAAI;AACF,YAAM,SAAS,MAAM,IAAI,0BAA0B,SAAS;AAC5D,UAAI,QAAQ;AACV,aAAK,OAAO,QAAQ,UAAU,aAAAA,QAAM,KAAK,KAAK,KAAK,SAAS,IAAI;AAChE,aAAK,OAAO,KAAK,MAAM;AACvB;AAAA,MACF;AAAA,IACF,SAAS,QAAP;AACA,YAAM,OAAO,iBAAiB,KAAK,QAAQ,wBAAwB,KAAK,KAAK,WAAW;AAAA,IAC1F;AAEA,UAAM,IAAI,OAAO,iBAAiB,UAAU,KAAK,KAAK,qBAAqB;AAAA,EAC7E;AACF;AAGO,MAAM,2BAA2B,oCAA4C;AAAA,EAClF,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAE3D,UAAM,gBAAgB,CAAC,
|
|
4
|
+
"sourcesContent": ["import type * as client from '@botpress/client'\nimport chalk from 'chalk'\nimport _ from 'lodash'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { parsePackageRef } from '../package-ref'\nimport { GlobalCommand } from './global-command'\n\nexport type GetPluginCommandDefinition = typeof commandDefinitions.plugins.subcommands.get\nexport class GetPluginCommand extends GlobalCommand<GetPluginCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.pluginRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.pluginRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot get local plugin')\n }\n\n try {\n const plugin = await api.findPublicOrPrivatePlugin(parsedRef)\n if (plugin) {\n this.logger.success(`Plugin ${chalk.bold(this.argv.pluginRef)}:`)\n this.logger.json(plugin)\n return\n }\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get plugin ${this.argv.pluginRef}`)\n }\n\n throw new errors.BotpressCLIError(`Plugin ${this.argv.pluginRef} not found`)\n }\n}\n\nexport type ListPluginsCommandDefinition = typeof commandDefinitions.plugins.subcommands.list\nexport class ListPluginsCommand extends GlobalCommand<ListPluginsCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n const { name, versionNumber: version } = this.argv\n\n const privateLister = (req: { nextToken?: string }) =>\n api.client.listPlugins({ nextToken: req.nextToken, name, version })\n const publicLister = (req: { nextToken?: string }) =>\n api.client.listPublicPlugins({ nextToken: req.nextToken, name, version })\n\n try {\n const privatePlugins = await api.listAllPages(privateLister, (r) => r.plugins)\n const publicPlugins = await api.listAllPages(publicLister, (r) => r.plugins)\n const plugins = _.uniqBy([...privatePlugins, ...publicPlugins], (p) => p.id)\n\n this.logger.success('Plugins:')\n this.logger.json(plugins)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not list plugins')\n }\n }\n}\n\nexport type DeletePluginCommandDefinition = typeof commandDefinitions.plugins.subcommands.delete\nexport class DeletePluginCommand extends GlobalCommand<DeletePluginCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.pluginRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.pluginRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot delete local plugin')\n }\n\n let plugin: client.Plugin | undefined\n try {\n plugin = await api.findPublicOrPrivatePlugin(parsedRef)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get plugin ${this.argv.pluginRef}`)\n }\n\n if (!plugin) {\n throw new errors.BotpressCLIError(`Plugin ${this.argv.pluginRef} not found`)\n }\n\n try {\n await api.client.deletePlugin({ id: plugin.id })\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not delete plugin ${this.argv.p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AK,OAAO,QAAQ,UAAU,aAAAD,QAAM,KAAK,KAAK,KAAK,SAAS,WAAW;AACvE;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["chalk", "_"]
|
|
7
7
|
}
|
package/dist/config.js
CHANGED
|
@@ -290,7 +290,9 @@ const getPluginSchema = {
|
|
|
290
290
|
};
|
|
291
291
|
const listPluginsSchema = {
|
|
292
292
|
...globalSchema,
|
|
293
|
-
...credentialsSchema
|
|
293
|
+
...credentialsSchema,
|
|
294
|
+
name: { type: "string", description: "The name filter when listing plugins" },
|
|
295
|
+
versionNumber: { type: "string", description: "The version filter when listing plugins" }
|
|
294
296
|
};
|
|
295
297
|
const deletePluginSchema = {
|
|
296
298
|
...globalSchema,
|
package/dist/config.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/config.ts"],
|
|
4
|
-
"sourcesContent": ["import * as consts from './consts'\nimport { ProjectTemplates } from './project-templates'\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: consts.defaultWorkDir,\n} satisfies CommandOption\n\nconst noBuild = {\n type: 'boolean',\n description: 'Skip the build step',\n default: false,\n} satisfies CommandOption\n\nconst dryRun = {\n type: 'boolean',\n description: 'Ask the API not to perform the actual operation',\n default: false,\n} as const 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 packageType = {\n type: 'string',\n description:\n 'Either an integration or an interface; helps disambiguate the package type in case both an integration and an interface have the same reference.',\n choices: ['integration', 'interface', 'plugin'] as const,\n} satisfies CommandOption\n\nconst packageRef = {\n type: 'string',\n description:\n 'The package ID or name with optional version. The package can be either an integration or an interface. Ex: teams, teams@0.2.0, llm@5.1.0',\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst integrationRef = {\n ...packageRef,\n demandOption: true,\n description: 'The integration ID or name with optional version. Ex: teams or teams@0.2.0',\n} satisfies CommandOption\n\nconst interfaceRef = {\n ...packageRef,\n demandOption: true,\n description: 'The interface ID or name and version. Ex: llm@5.1.0',\n} satisfies CommandOption\n\nconst pluginRef = {\n ...packageRef,\n demandOption: true,\n description: 'The plugin ID or name and version. Ex: knowledge@0.0.1',\n} satisfies CommandOption\n\nconst sourceMap = { type: 'boolean', description: 'Generate sourcemaps', default: false } satisfies CommandOption\n\nconst minify = { type: 'boolean', description: 'Minify the bundled code', default: true } 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 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 minify,\n} satisfies CommandSchema\n\nconst buildSchema = {\n ...projectSchema,\n sourceMap,\n minify,\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 dryRun,\n createNewBot: { type: 'boolean', description: 'Create a new bot when deploying. Only used when deploying a bot' },\n sourceMap,\n minify,\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 minify,\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 ...globalSchema,\n ...credentialsSchema,\n packageRef,\n packageType,\n installPath: {\n type: 'string',\n description: 'The path where to install the package',\n default: consts.defaultInstallPath,\n },\n useDev: {\n type: 'boolean',\n description: 'If a dev version of the package is found, use it',\n default: false,\n },\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 getPluginSchema = {\n ...globalSchema,\n ...credentialsSchema,\n pluginRef,\n} satisfies CommandSchema\n\nconst listPluginsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n} satisfies CommandSchema\n\nconst deletePluginSchema = {\n ...globalSchema,\n ...credentialsSchema,\n pluginRef,\n} satisfies CommandSchema\n\nconst initSchema = {\n ...globalSchema,\n workDir,\n type: { type: 'string', choices: ['bot', 'integration', 'plugin'] as const },\n template: {\n type: 'string',\n choices: ProjectTemplates.getAllChoices(),\n description: 'The template to use',\n },\n name: { type: 'string', description: 'The name of the project' },\n} satisfies CommandSchema\n\nconst lintSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\nconst chatSchema = {\n ...globalSchema,\n ...credentialsSchema,\n chatApiUrl: {\n type: 'string',\n description: 'The URL of the chat server',\n },\n botId: {\n type: 'string',\n positional: true,\n idx: 0,\n description: 'The bot ID to chat with',\n },\n} satisfies CommandSchema\n\n// exports\n\nexport const schemas = {\n global: globalSchema,\n project: projectSchema,\n credentials: credentialsSchema,\n secrets: secretsSchema,\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 getPlugin: getPluginSchema,\n listPlugins: listPluginsSchema,\n deletePlugin: deletePluginSchema,\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 lint: lintSchema,\n chat: chatSchema,\n} as const\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AACxB,+BAAiC;AAKjC,MAAM,OAAO;AAAA,EACX,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS,OAAO;AAClB;AAEA,MAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS;AACX;AAEA,MAAM,SAAS;AAAA,EACb,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,S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AAC7D;AAEA,MAAM,eAAe;AAAA,EACnB,GAAG;AACL;AAEA,MAAM,kBAAkB;AAAA,EACtB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,EAAE,MAAM,UAAU,aAAa,gCAAgC;AAAA,EACrE,aAAa;AAAA,IACX,MAAM;AAAA,IACN,aAAa;AAAA,IACb,SAAS;AAAA,EACX;AACF;AAEA,MAAM,eAAe;AAAA,EACnB,GAAG;AAAA,EACH,GAAG;AAAA,EACH;AACF;AAEA,MAAM,kBAAkB;AAAA,EACtB,GAAG;AAAA,EACH,GAAG;AAAA,EACH;AACF;AAEA,MAAM,iBAAiB;AAAA,EACrB,GAAG;AAAA,EACH,GAAG;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,kBAAkB;AAAA,EACtB,GAAG;AAAA,EACH,GAAG;AAAA,EACH;AACF;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;
|
|
4
|
+
"sourcesContent": ["import * as consts from './consts'\nimport { ProjectTemplates } from './project-templates'\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: consts.defaultWorkDir,\n} satisfies CommandOption\n\nconst noBuild = {\n type: 'boolean',\n description: 'Skip the build step',\n default: false,\n} satisfies CommandOption\n\nconst dryRun = {\n type: 'boolean',\n description: 'Ask the API not to perform the actual operation',\n default: false,\n} as const 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 packageType = {\n type: 'string',\n description:\n 'Either an integration or an interface; helps disambiguate the package type in case both an integration and an interface have the same reference.',\n choices: ['integration', 'interface', 'plugin'] as const,\n} satisfies CommandOption\n\nconst packageRef = {\n type: 'string',\n description:\n 'The package ID or name with optional version. The package can be either an integration or an interface. Ex: teams, teams@0.2.0, llm@5.1.0',\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst integrationRef = {\n ...packageRef,\n demandOption: true,\n description: 'The integration ID or name with optional version. Ex: teams or teams@0.2.0',\n} satisfies CommandOption\n\nconst interfaceRef = {\n ...packageRef,\n demandOption: true,\n description: 'The interface ID or name and version. Ex: llm@5.1.0',\n} satisfies CommandOption\n\nconst pluginRef = {\n ...packageRef,\n demandOption: true,\n description: 'The plugin ID or name and version. Ex: knowledge@0.0.1',\n} satisfies CommandOption\n\nconst sourceMap = { type: 'boolean', description: 'Generate sourcemaps', default: false } satisfies CommandOption\n\nconst minify = { type: 'boolean', description: 'Minify the bundled code', default: true } 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 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 minify,\n} satisfies CommandSchema\n\nconst buildSchema = {\n ...projectSchema,\n sourceMap,\n minify,\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 dryRun,\n createNewBot: { type: 'boolean', description: 'Create a new bot when deploying. Only used when deploying a bot' },\n sourceMap,\n minify,\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 minify,\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 ...globalSchema,\n ...credentialsSchema,\n packageRef,\n packageType,\n installPath: {\n type: 'string',\n description: 'The path where to install the package',\n default: consts.defaultInstallPath,\n },\n useDev: {\n type: 'boolean',\n description: 'If a dev version of the package is found, use it',\n default: false,\n },\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 getPluginSchema = {\n ...globalSchema,\n ...credentialsSchema,\n pluginRef,\n} satisfies CommandSchema\n\nconst listPluginsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n name: { type: 'string', description: 'The name filter when listing plugins' },\n versionNumber: { type: 'string', description: 'The version filter when listing plugins' },\n} satisfies CommandSchema\n\nconst deletePluginSchema = {\n ...globalSchema,\n ...credentialsSchema,\n pluginRef,\n} satisfies CommandSchema\n\nconst initSchema = {\n ...globalSchema,\n workDir,\n type: { type: 'string', choices: ['bot', 'integration', 'plugin'] as const },\n template: {\n type: 'string',\n choices: ProjectTemplates.getAllChoices(),\n description: 'The template to use',\n },\n name: { type: 'string', description: 'The name of the project' },\n} satisfies CommandSchema\n\nconst lintSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\nconst chatSchema = {\n ...globalSchema,\n ...credentialsSchema,\n chatApiUrl: {\n type: 'string',\n description: 'The URL of the chat server',\n },\n botId: {\n type: 'string',\n positional: true,\n idx: 0,\n description: 'The bot ID to chat with',\n },\n} satisfies CommandSchema\n\n// exports\n\nexport const schemas = {\n global: globalSchema,\n project: projectSchema,\n credentials: credentialsSchema,\n secrets: secretsSchema,\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 getPlugin: getPluginSchema,\n listPlugins: listPluginsSchema,\n deletePlugin: deletePluginSchema,\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 lint: lintSchema,\n chat: chatSchema,\n} as const\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAA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AAA,EACT,aAAa;AAAA,EACb,SAAS;AAAA,EACT,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,WAAW;AAAA,EACX,aAAa;AAAA,EACb,cAAc;AAAA,EACd,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;AAAA,EACL,MAAM;AAAA,EACN,MAAM;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/typings.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/typings.ts"],
|
|
4
|
-
"sourcesContent": ["import type
|
|
4
|
+
"sourcesContent": ["import type { default as yargs, YargsConfig, YargsSchema } from '@bpinternal/yargs-extra'\n\nexport type CommandPositionalOption = yargs.PositionalOptions & { positional: true; idx: number }\nexport type CommandNamedOption = YargsSchema[string] & { positional?: false }\nexport type CommandOption = CommandPositionalOption | CommandNamedOption\nexport type CommandSchema = Record<string, CommandOption>\n\nexport type CommandArgv<C extends CommandDefinition = CommandDefinition> = YargsConfig<C['schema']> & {\n /**\n * Ignored: fixes weird typing issue\n */\n _?: string\n}\n\nexport type CommandDefinition<S extends CommandSchema = CommandSchema> = {\n schema: S\n description?: string\n alias?: string\n}\n\nexport type CommandImplementation<C extends CommandDefinition = CommandDefinition> = (\n argv: CommandArgv<C>\n) => Promise<{ exitCode: number }>\n\nexport type CommandLeaf<C extends CommandDefinition = CommandDefinition> = C & {\n handler: CommandImplementation<C>\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/cli",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0",
|
|
4
4
|
"description": "Botpress CLI",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "pnpm run bundle && pnpm run template:gen",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@apidevtools/json-schema-ref-parser": "^11.7.0",
|
|
23
23
|
"@botpress/chat": "0.5.1",
|
|
24
|
-
"@botpress/client": "1.
|
|
25
|
-
"@botpress/sdk": "4.
|
|
24
|
+
"@botpress/client": "1.20.0",
|
|
25
|
+
"@botpress/sdk": "4.15.0",
|
|
26
26
|
"@bpinternal/const": "^0.1.0",
|
|
27
27
|
"@bpinternal/tunnel": "^0.1.1",
|
|
28
28
|
"@bpinternal/yargs-extra": "^0.0.3",
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
},
|
|
6
6
|
"private": true,
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@botpress/client": "1.
|
|
9
|
-
"@botpress/sdk": "4.
|
|
8
|
+
"@botpress/client": "1.20.0",
|
|
9
|
+
"@botpress/sdk": "4.15.0"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@types/node": "^
|
|
12
|
+
"@types/node": "^22.16.4",
|
|
13
13
|
"typescript": "^5.6.3"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
},
|
|
7
7
|
"private": true,
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@botpress/client": "1.
|
|
10
|
-
"@botpress/sdk": "4.
|
|
9
|
+
"@botpress/client": "1.20.0",
|
|
10
|
+
"@botpress/sdk": "4.15.0"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@types/node": "^
|
|
13
|
+
"@types/node": "^22.16.4",
|
|
14
14
|
"typescript": "^5.6.3"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
},
|
|
7
7
|
"private": true,
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@botpress/client": "1.
|
|
10
|
-
"@botpress/sdk": "4.
|
|
9
|
+
"@botpress/client": "1.20.0",
|
|
10
|
+
"@botpress/sdk": "4.15.0"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@types/node": "^
|
|
13
|
+
"@types/node": "^22.16.4",
|
|
14
14
|
"typescript": "^5.6.3"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
},
|
|
7
7
|
"private": true,
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@botpress/client": "1.
|
|
10
|
-
"@botpress/sdk": "4.
|
|
9
|
+
"@botpress/client": "1.20.0",
|
|
10
|
+
"@botpress/sdk": "4.15.0",
|
|
11
11
|
"axios": "^1.6.8"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@types/node": "^
|
|
14
|
+
"@types/node": "^22.16.4",
|
|
15
15
|
"typescript": "^5.6.3"
|
|
16
16
|
}
|
|
17
17
|
}
|