@botpress/cli 4.14.1 → 4.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +11 -11
- package/dist/command-implementations/global-command.js +1 -0
- package/dist/command-implementations/global-command.js.map +2 -2
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/consts.js +1 -1
- package/dist/consts.js.map +1 -1
- package/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/cli@4.14.
|
|
2
|
+
> @botpress/cli@4.14.2 build /home/runner/work/botpress/botpress/packages/cli
|
|
3
3
|
> pnpm run bundle && pnpm run template:gen
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @botpress/cli@4.14.
|
|
6
|
+
> @botpress/cli@4.14.2 bundle /home/runner/work/botpress/botpress/packages/cli
|
|
7
7
|
> ts-node -T build.ts
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @botpress/cli@4.14.
|
|
10
|
+
> @botpress/cli@4.14.2 template:gen /home/runner/work/botpress/botpress/packages/cli
|
|
11
11
|
> pnpm -r --stream -F @bp-templates/* exec bp gen
|
|
12
12
|
|
|
13
|
-
🤖 Botpress CLI v4.14.
|
|
14
|
-
🤖 Botpress CLI v4.14.
|
|
15
|
-
🤖 Botpress CLI v4.14.
|
|
16
|
-
🤖 Botpress CLI v4.14.
|
|
13
|
+
🤖 Botpress CLI v4.14.2
|
|
14
|
+
🤖 Botpress CLI v4.14.2
|
|
15
|
+
🤖 Botpress CLI v4.14.2
|
|
16
|
+
🤖 Botpress CLI v4.14.2
|
|
17
|
+
○ Generating typings for bot...
|
|
17
18
|
○ Generating typings for plugin empty-plugin...
|
|
18
19
|
✓ Typings available at .botpress
|
|
19
20
|
|
|
20
|
-
○ Generating typings for bot...
|
|
21
21
|
✓ Typings available at .botpress
|
|
22
22
|
|
|
23
|
-
○ Generating typings for integration
|
|
23
|
+
○ Generating typings for integration empty-integration...
|
|
24
24
|
✓ Typings available at .botpress
|
|
25
25
|
|
|
26
|
-
○ Generating typings for integration
|
|
26
|
+
○ Generating typings for integration hello-world...
|
|
27
27
|
✓ Typings available at .botpress
|
|
28
28
|
|
|
29
|
-
🤖 Botpress CLI v4.14.
|
|
29
|
+
🤖 Botpress CLI v4.14.2
|
|
30
30
|
○ Generating typings for integration webhook-message...
|
|
31
31
|
✓ Typings available at .botpress
|
|
32
32
|
|
|
@@ -95,6 +95,7 @@ class GlobalCommand extends import_base_command.BaseCommand {
|
|
|
95
95
|
}
|
|
96
96
|
;
|
|
97
97
|
({ token, workspaceId, apiUrl } = await this._readProfileFromFS(this.argv.profile));
|
|
98
|
+
this.logger.log(`Using profile "${this.argv.profile}"`, { prefix: "\u{1F464}" });
|
|
98
99
|
} else {
|
|
99
100
|
token = credentials.token ?? await cache.get("token");
|
|
100
101
|
workspaceId = credentials.workspaceId ?? await cache.get("workspaceId");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/command-implementations/global-command.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from '@botpress/sdk'\nimport type { YargsConfig } from '@bpinternal/yargs-extra'\nimport chalk from 'chalk'\nimport * as fs from 'fs'\nimport latestVersion from 'latest-version'\nimport _ from 'lodash'\nimport semver from 'semver'\nimport type { ApiClientFactory } from '../api/client'\nimport * as config from '../config'\nimport * as consts from '../consts'\nimport * as errors from '../errors'\nimport type { CommandArgv, CommandDefinition } from '../typings'\nimport * as utils from '../utils'\nimport { BaseCommand } from './base-command'\n\nexport type GlobalCommandDefinition = CommandDefinition<typeof config.schemas.global>\nexport type GlobalCache = { apiUrl: string; token: string; workspaceId: string }\n\nexport type ConfigurableGlobalPaths = {\n botpressHomeDir: string\n cliRootDir: utils.path.AbsolutePath\n profilesPath: string\n}\nexport type ConstantGlobalPaths = typeof consts.fromHomeDir & typeof consts.fromCliRootDir\nexport type AllGlobalPaths = ConfigurableGlobalPaths & ConstantGlobalPaths\n\nconst profileCredentialSchema = z.object({ apiUrl: z.string(), workspaceId: z.string(), token: z.string() })\ntype ProfileCredentials = z.infer<typeof profileCredentialSchema>\n\nclass GlobalPaths extends utils.path.PathStore<keyof AllGlobalPaths> {\n public constructor(argv: CommandArgv<GlobalCommandDefinition>) {\n const absBotpressHome = utils.path.absoluteFrom(utils.path.cwd(), argv.botpressHome)\n super({\n cliRootDir: consts.cliRootDir,\n botpressHomeDir: absBotpressHome,\n profilesPath: utils.path.absoluteFrom(absBotpressHome, consts.profileFileName),\n ..._.mapValues(consts.fromHomeDir, (p) => utils.path.absoluteFrom(absBotpressHome, p)),\n ..._.mapValues(consts.fromCliRootDir, (p) => utils.path.absoluteFrom(consts.cliRootDir, p)),\n })\n }\n}\n\nexport abstract class GlobalCommand<C extends GlobalCommandDefinition> extends BaseCommand<C> {\n protected api: ApiClientFactory\n protected prompt: utils.prompt.CLIPrompt\n private _pkgJson: utils.pkgJson.PackageJson | undefined\n\n public constructor(\n api: ApiClientFactory,\n prompt: utils.prompt.CLIPrompt,\n ...args: ConstructorParameters<typeof BaseCommand<C>>\n ) {\n super(...args)\n this.api = api\n this.prompt = prompt\n }\n\n protected get globalPaths() {\n return new GlobalPaths(this.argv)\n }\n\n protected get globalCache() {\n return new utils.cache.FSKeyValueCache<GlobalCache>(this.globalPaths.abs.globalCacheFile)\n }\n\n protected override async bootstrap() {\n const pkgJson = await this.readPkgJson()\n const versionText = chalk.bold(`v${pkgJson.version}`)\n this.logger.log(`Botpress CLI ${versionText}`, { prefix: '\uD83E\uDD16' })\n\n await this._notifyUpdateCli()\n\n const paths = this.globalPaths\n if (paths.abs.botpressHomeDir !== consts.defaultBotpressHome) {\n this.logger.log(`Using custom botpress home: ${paths.abs.botpressHomeDir}`, { prefix: '\uD83C\uDFE0' })\n }\n }\n\n protected override teardown = async () => {\n this.logger.cleanup()\n }\n\n protected async getAuthenticatedClient(credentials: Partial<YargsConfig<typeof config.schemas.credentials>>) {\n const cache = this.globalCache\n\n let token: string | undefined\n let workspaceId: string | undefined\n let apiUrl: string | undefined\n\n if (this.argv.profile) {\n if (credentials.token || credentials.workspaceId || credentials.apiUrl) {\n this.logger.warn(\n 'You are currently using credential command line arguments or environment variables as well as a profile. Your profile has overwritten the variables'\n )\n }\n ;({ token, workspaceId, apiUrl } = await this._readProfileFromFS(this.argv.profile))\n } else {\n token = credentials.token ?? (await cache.get('token'))\n workspaceId = credentials.workspaceId ?? (await cache.get('workspaceId'))\n apiUrl = credentials.apiUrl ?? (await cache.get('apiUrl'))\n }\n\n if (!(token && workspaceId && apiUrl)) {\n return null\n }\n\n if (apiUrl !== consts.defaultBotpressApiUrl) {\n this.logger.log(`Using custom url ${apiUrl}`, { prefix: '\uD83D\uDD17' })\n }\n\n return this.api.newClient({ apiUrl, token, workspaceId }, this.logger)\n }\n\n private async _readProfileFromFS(profile: string): Promise<ProfileCredentials> {\n if (!fs.existsSync(this.globalPaths.abs.profilesPath)) {\n throw new errors.BotpressCLIError(`Profile file not found at \"${this.globalPaths.abs.profilesPath}\"`)\n }\n const fileContent = await fs.promises.readFile(this.globalPaths.abs.profilesPath, 'utf-8')\n const parsedProfiles = JSON.parse(fileContent)\n\n const zodParseResult = z.record(profileCredentialSchema).safeParse(parsedProfiles, {})\n if (!zodParseResult.success) {\n throw errors.BotpressCLIError.wrap(zodParseResult.error, 'Error parsing profiles: ')\n }\n\n const profileData = parsedProfiles[profile]\n if (!profileData) {\n throw new errors.BotpressCLIError(\n `Profile \"${profile}\" not found in \"${this.globalPaths.abs.profilesPath}\". Found profiles '${Object.keys(parsedProfiles).join(\"', '\")}'.`\n )\n }\n\n return parsedProfiles[profile]\n }\n\n protected async ensureLoginAndCreateClient(credentials: YargsConfig<typeof config.schemas.credentials>) {\n const client = await this.getAuthenticatedClient(credentials)\n\n if (client === null) {\n throw new errors.NotLoggedInError()\n }\n\n return client\n }\n\n private readonly _notifyUpdateCli = async (): Promise<void> => {\n try {\n this.logger.debug('Checking if cli is up to date')\n\n const pkgJson = await this.readPkgJson()\n if (!pkgJson.version) {\n throw new errors.BotpressCLIError('Could not find version in package.json')\n }\n\n const latest = await latestVersion(pkgJson.name)\n const isOutdated = semver.lt(pkgJson.version, latest)\n if (isOutdated) {\n this.logger.box(\n [\n `${chalk.bold('Update available')} ${chalk.dim(pkgJson.version)} \u2192 ${chalk.green(latest)}`,\n '',\n 'To update, run:',\n ` for npm ${chalk.cyan(`npm i -g ${pkgJson.name}`)}`,\n ` for yarn ${chalk.cyan(`yarn global add ${pkgJson.name}`)}`,\n ` for pnpm ${chalk.cyan(`pnpm i -g ${pkgJson.name}`)}`,\n ].join('\\n')\n )\n }\n } catch (thrown) {\n const err = errors.BotpressCLIError.map(thrown)\n this.logger.debug(`Failed to check if cli is up to date: ${err.message}`)\n }\n }\n\n protected async readPkgJson(): Promise<utils.pkgJson.PackageJson> {\n if (this._pkgJson) {\n return this._pkgJson\n }\n const { cliRootDir } = this.globalPaths.abs\n const pkgJson = await utils.pkgJson.readPackageJson(cliRootDir)\n if (!pkgJson) {\n throw new errors.BotpressCLIError(`Could not find package.json at \"${cliRootDir}\"`)\n }\n\n this._pkgJson = pkgJson\n return pkgJson\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAElB,mBAAkB;AAClB,SAAoB;AACpB,4BAA0B;AAC1B,oBAAc;AACd,oBAAmB;AAGnB,aAAwB;AACxB,aAAwB;AAExB,YAAuB;AACvB,0BAA4B;AAa5B,MAAM,0BAA0B,aAAE,OAAO,EAAE,QAAQ,aAAE,OAAO,GAAG,aAAa,aAAE,OAAO,GAAG,OAAO,aAAE,OAAO,EAAE,CAAC;AAG3G,MAAM,oBAAoB,MAAM,KAAK,UAAgC;AAAA,EAC5D,YAAY,MAA4C;AAC7D,UAAM,kBAAkB,MA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UAAM,QAAQ,KAAK;AAEnB,QAAI;AACJ,QAAI;AACJ,QAAI;AAEJ,QAAI,KAAK,KAAK,SAAS;AACrB,UAAI,YAAY,SAAS,YAAY,eAAe,YAAY,QAAQ;AACtE,aAAK,OAAO;AAAA,UACV;AAAA,QACF;AAAA,MACF;AACA;AAAC,OAAC,EAAE,OAAO,aAAa,OAAO,IAAI,MAAM,KAAK,mBAAmB,KAAK,KAAK,OAAO;AAAA,
|
|
4
|
+
"sourcesContent": ["import { z } from '@botpress/sdk'\nimport type { YargsConfig } from '@bpinternal/yargs-extra'\nimport chalk from 'chalk'\nimport * as fs from 'fs'\nimport latestVersion from 'latest-version'\nimport _ from 'lodash'\nimport semver from 'semver'\nimport type { ApiClientFactory } from '../api/client'\nimport * as config from '../config'\nimport * as consts from '../consts'\nimport * as errors from '../errors'\nimport type { CommandArgv, CommandDefinition } from '../typings'\nimport * as utils from '../utils'\nimport { BaseCommand } from './base-command'\n\nexport type GlobalCommandDefinition = CommandDefinition<typeof config.schemas.global>\nexport type GlobalCache = { apiUrl: string; token: string; workspaceId: string }\n\nexport type ConfigurableGlobalPaths = {\n botpressHomeDir: string\n cliRootDir: utils.path.AbsolutePath\n profilesPath: string\n}\nexport type ConstantGlobalPaths = typeof consts.fromHomeDir & typeof consts.fromCliRootDir\nexport type AllGlobalPaths = ConfigurableGlobalPaths & ConstantGlobalPaths\n\nconst profileCredentialSchema = z.object({ apiUrl: z.string(), workspaceId: z.string(), token: z.string() })\ntype ProfileCredentials = z.infer<typeof profileCredentialSchema>\n\nclass GlobalPaths extends utils.path.PathStore<keyof AllGlobalPaths> {\n public constructor(argv: CommandArgv<GlobalCommandDefinition>) {\n const absBotpressHome = utils.path.absoluteFrom(utils.path.cwd(), argv.botpressHome)\n super({\n cliRootDir: consts.cliRootDir,\n botpressHomeDir: absBotpressHome,\n profilesPath: utils.path.absoluteFrom(absBotpressHome, consts.profileFileName),\n ..._.mapValues(consts.fromHomeDir, (p) => utils.path.absoluteFrom(absBotpressHome, p)),\n ..._.mapValues(consts.fromCliRootDir, (p) => utils.path.absoluteFrom(consts.cliRootDir, p)),\n })\n }\n}\n\nexport abstract class GlobalCommand<C extends GlobalCommandDefinition> extends BaseCommand<C> {\n protected api: ApiClientFactory\n protected prompt: utils.prompt.CLIPrompt\n private _pkgJson: utils.pkgJson.PackageJson | undefined\n\n public constructor(\n api: ApiClientFactory,\n prompt: utils.prompt.CLIPrompt,\n ...args: ConstructorParameters<typeof BaseCommand<C>>\n ) {\n super(...args)\n this.api = api\n this.prompt = prompt\n }\n\n protected get globalPaths() {\n return new GlobalPaths(this.argv)\n }\n\n protected get globalCache() {\n return new utils.cache.FSKeyValueCache<GlobalCache>(this.globalPaths.abs.globalCacheFile)\n }\n\n protected override async bootstrap() {\n const pkgJson = await this.readPkgJson()\n const versionText = chalk.bold(`v${pkgJson.version}`)\n this.logger.log(`Botpress CLI ${versionText}`, { prefix: '\uD83E\uDD16' })\n\n await this._notifyUpdateCli()\n\n const paths = this.globalPaths\n if (paths.abs.botpressHomeDir !== consts.defaultBotpressHome) {\n this.logger.log(`Using custom botpress home: ${paths.abs.botpressHomeDir}`, { prefix: '\uD83C\uDFE0' })\n }\n }\n\n protected override teardown = async () => {\n this.logger.cleanup()\n }\n\n protected async getAuthenticatedClient(credentials: Partial<YargsConfig<typeof config.schemas.credentials>>) {\n const cache = this.globalCache\n\n let token: string | undefined\n let workspaceId: string | undefined\n let apiUrl: string | undefined\n\n if (this.argv.profile) {\n if (credentials.token || credentials.workspaceId || credentials.apiUrl) {\n this.logger.warn(\n 'You are currently using credential command line arguments or environment variables as well as a profile. Your profile has overwritten the variables'\n )\n }\n ;({ token, workspaceId, apiUrl } = await this._readProfileFromFS(this.argv.profile))\n this.logger.log(`Using profile \"${this.argv.profile}\"`, { prefix: '\uD83D\uDC64' })\n } else {\n token = credentials.token ?? (await cache.get('token'))\n workspaceId = credentials.workspaceId ?? (await cache.get('workspaceId'))\n apiUrl = credentials.apiUrl ?? (await cache.get('apiUrl'))\n }\n\n if (!(token && workspaceId && apiUrl)) {\n return null\n }\n\n if (apiUrl !== consts.defaultBotpressApiUrl) {\n this.logger.log(`Using custom url ${apiUrl}`, { prefix: '\uD83D\uDD17' })\n }\n\n return this.api.newClient({ apiUrl, token, workspaceId }, this.logger)\n }\n\n private async _readProfileFromFS(profile: string): Promise<ProfileCredentials> {\n if (!fs.existsSync(this.globalPaths.abs.profilesPath)) {\n throw new errors.BotpressCLIError(`Profile file not found at \"${this.globalPaths.abs.profilesPath}\"`)\n }\n const fileContent = await fs.promises.readFile(this.globalPaths.abs.profilesPath, 'utf-8')\n const parsedProfiles = JSON.parse(fileContent)\n\n const zodParseResult = z.record(profileCredentialSchema).safeParse(parsedProfiles, {})\n if (!zodParseResult.success) {\n throw errors.BotpressCLIError.wrap(zodParseResult.error, 'Error parsing profiles: ')\n }\n\n const profileData = parsedProfiles[profile]\n if (!profileData) {\n throw new errors.BotpressCLIError(\n `Profile \"${profile}\" not found in \"${this.globalPaths.abs.profilesPath}\". Found profiles '${Object.keys(parsedProfiles).join(\"', '\")}'.`\n )\n }\n\n return parsedProfiles[profile]\n }\n\n protected async ensureLoginAndCreateClient(credentials: YargsConfig<typeof config.schemas.credentials>) {\n const client = await this.getAuthenticatedClient(credentials)\n\n if (client === null) {\n throw new errors.NotLoggedInError()\n }\n\n return client\n }\n\n private readonly _notifyUpdateCli = async (): Promise<void> => {\n try {\n this.logger.debug('Checking if cli is up to date')\n\n const pkgJson = await this.readPkgJson()\n if (!pkgJson.version) {\n throw new errors.BotpressCLIError('Could not find version in package.json')\n }\n\n const latest = await latestVersion(pkgJson.name)\n const isOutdated = semver.lt(pkgJson.version, latest)\n if (isOutdated) {\n this.logger.box(\n [\n `${chalk.bold('Update available')} ${chalk.dim(pkgJson.version)} \u2192 ${chalk.green(latest)}`,\n '',\n 'To update, run:',\n ` for npm ${chalk.cyan(`npm i -g ${pkgJson.name}`)}`,\n ` for yarn ${chalk.cyan(`yarn global add ${pkgJson.name}`)}`,\n ` for pnpm ${chalk.cyan(`pnpm i -g ${pkgJson.name}`)}`,\n ].join('\\n')\n )\n }\n } catch (thrown) {\n const err = errors.BotpressCLIError.map(thrown)\n this.logger.debug(`Failed to check if cli is up to date: ${err.message}`)\n }\n }\n\n protected async readPkgJson(): Promise<utils.pkgJson.PackageJson> {\n if (this._pkgJson) {\n return this._pkgJson\n }\n const { cliRootDir } = this.globalPaths.abs\n const pkgJson = await utils.pkgJson.readPackageJson(cliRootDir)\n if (!pkgJson) {\n throw new errors.BotpressCLIError(`Could not find package.json at \"${cliRootDir}\"`)\n }\n\n this._pkgJson = pkgJson\n return pkgJson\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAElB,mBAAkB;AAClB,SAAoB;AACpB,4BAA0B;AAC1B,oBAAc;AACd,oBAAmB;AAGnB,aAAwB;AACxB,aAAwB;AAExB,YAAuB;AACvB,0BAA4B;AAa5B,MAAM,0BAA0B,aAAE,OAAO,EAAE,QAAQ,aAAE,OAAO,GAAG,aAAa,aAAE,OAAO,GAAG,OAAO,aAAE,OAAO,EAAE,CAAC;AAG3G,MAAM,oBAAoB,MAAM,KAAK,UAAgC;AAAA,EAC5D,YAAY,MAA4C;AAC7D,UAAM,kBAAkB,MAAM,KAAK,aAAa,MAAM,KAAK,IAAI,GAAG,KAAK,YAAY;AACnF,UAAM;AAAA,MACJ,YAAY,OAAO;AAAA,MACnB,iBAAiB;AAAA,MACjB,cAAc,MAAM,KAAK,aAAa,iBAAiB,OAAO,eAAe;AAAA,MAC7E,GAAG,cAAAA,QAAE,UAAU,OAAO,aAAa,CAAC,MAAM,MAAM,KAAK,aAAa,iBAAiB,CAAC,CAAC;AAAA,MACrF,GAAG,cAAAA,QAAE,UAAU,OAAO,gBAAgB,CAAC,MAAM,MAAM,KAAK,aAAa,OAAO,YAAY,CAAC,CAAC;AAAA,IAC5F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/dist/config.js
CHANGED
|
@@ -135,7 +135,7 @@ const globalSchema = {
|
|
|
135
135
|
},
|
|
136
136
|
profile: {
|
|
137
137
|
type: "string",
|
|
138
|
-
description: "The CLI profile defined in the $BP_BOTPRESS_HOME
|
|
138
|
+
description: "The CLI profile defined in the $BP_BOTPRESS_HOME/profiles.json json format file"
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
141
|
const projectSchema = {
|
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\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 profile: {\n type: 'string',\n description: 'The CLI profile defined in the $BP_BOTPRESS_HOME/.profiles json format file',\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 visibility: {\n type: 'string',\n choices: ['public', 'private', 'unlisted'] as const,\n description:\n 'The visibility of the project. By default, projects are always private. Unlisted visibility is only supported for integrations.',\n default: 'private',\n },\n public: {\n type: 'boolean',\n description: 'DEPRECATED: Please use \"--visibility public\" instead.',\n default: false,\n deprecated: true,\n } satisfies CommandOption,\n allowDeprecated: {\n type: 'boolean',\n description: 'Allow deprecated features in the project',\n default: false,\n },\n} as const 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"],
|
|
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\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 profile: {\n type: 'string',\n description: 'The CLI profile defined in the $BP_BOTPRESS_HOME/profiles.json json format file',\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 visibility: {\n type: 'string',\n choices: ['public', 'private', 'unlisted'] as const,\n description:\n 'The visibility of the project. By default, projects are always private. Unlisted visibility is only supported for integrations.',\n default: 'private',\n },\n public: {\n type: 'boolean',\n description: 'DEPRECATED: Please use \"--visibility public\" instead.',\n default: false,\n deprecated: true,\n } satisfies CommandOption,\n allowDeprecated: {\n type: 'boolean',\n description: 'Allow deprecated features in the project',\n default: false,\n },\n} as const 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
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,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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/consts.js
CHANGED
|
@@ -60,7 +60,7 @@ const cliRootDir = import_root.CLI_ROOT_DIR;
|
|
|
60
60
|
const installDirName = "bp_modules";
|
|
61
61
|
const outDirName = ".botpress";
|
|
62
62
|
const distDirName = "dist";
|
|
63
|
-
const profileFileName = ".
|
|
63
|
+
const profileFileName = "profiles.json";
|
|
64
64
|
const fromCliRootDir = {};
|
|
65
65
|
const fromHomeDir = {
|
|
66
66
|
globalCacheFile: "global.cache.json"
|
package/dist/consts.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/consts.ts"],
|
|
4
|
-
"sourcesContent": ["import os from 'os'\nimport pathlib from 'path'\nimport { CLI_ROOT_DIR } from './root'\n\n// configurable\n\nexport const defaultBotpressHome = pathlib.join(os.homedir(), '.botpress')\nexport const defaultWorkDir = process.cwd()\nexport const defaultInstallPath = process.cwd()\nexport const defaultBotpressApiUrl = 'https://api.botpress.cloud'\nexport const defaultBotpressAppUrl = 'https://app.botpress.cloud'\nexport const defaultTunnelUrl = 'https://tunnel.botpress.cloud'\nexport const defaultChatApiUrl = 'https://chat.botpress.cloud'\n\n// not configurable\n\nexport const cliRootDir = CLI_ROOT_DIR\nexport const installDirName = 'bp_modules'\nexport const outDirName = '.botpress'\nexport const distDirName = 'dist'\nexport const profileFileName = '.
|
|
4
|
+
"sourcesContent": ["import os from 'os'\nimport pathlib from 'path'\nimport { CLI_ROOT_DIR } from './root'\n\n// configurable\n\nexport const defaultBotpressHome = pathlib.join(os.homedir(), '.botpress')\nexport const defaultWorkDir = process.cwd()\nexport const defaultInstallPath = process.cwd()\nexport const defaultBotpressApiUrl = 'https://api.botpress.cloud'\nexport const defaultBotpressAppUrl = 'https://app.botpress.cloud'\nexport const defaultTunnelUrl = 'https://tunnel.botpress.cloud'\nexport const defaultChatApiUrl = 'https://chat.botpress.cloud'\n\n// not configurable\n\nexport const cliRootDir = CLI_ROOT_DIR\nexport const installDirName = 'bp_modules'\nexport const outDirName = '.botpress'\nexport const distDirName = 'dist'\nexport const profileFileName = 'profiles.json'\n\nexport const fromCliRootDir = {}\n\nexport const fromHomeDir = {\n globalCacheFile: 'global.cache.json',\n}\n\nexport const fromOutDir = {\n distDir: distDirName,\n outFileCJS: pathlib.join(distDirName, 'index.cjs'),\n outFileESM: pathlib.join(distDirName, 'index.mjs'),\n implementationDir: 'implementation',\n pluginsDir: 'plugins',\n secretsDir: 'secrets',\n projectCacheFile: 'project.cache.json',\n}\n\nexport const fromWorkDir = {\n integrationDefinition: 'integration.definition.ts',\n interfaceDefinition: 'interface.definition.ts',\n botDefinition: 'bot.definition.ts',\n pluginDefinition: 'plugin.definition.ts',\n entryPoint: pathlib.join('src', 'index.ts'),\n outDir: outDirName,\n distDir: pathlib.join(outDirName, fromOutDir.distDir),\n outFileCJS: pathlib.join(outDirName, fromOutDir.outFileCJS),\n outFileESM: pathlib.join(outDirName, fromOutDir.outFileESM),\n implementationDir: pathlib.join(outDirName, fromOutDir.implementationDir),\n pluginsDir: pathlib.join(outDirName, fromOutDir.pluginsDir),\n secretsDir: pathlib.join(outDirName, fromOutDir.secretsDir),\n projectCacheFile: pathlib.join(outDirName, fromOutDir.projectCacheFile),\n}\n"],
|
|
5
5
|
"mappings":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