@botpress/cli 0.6.13 → 0.6.15

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/e2e/index.ts CHANGED
@@ -34,6 +34,10 @@ const configSchema = {
34
34
  type: 'string',
35
35
  demandOption: true,
36
36
  },
37
+ workspaceHandle: {
38
+ type: 'string',
39
+ demandOption: true,
40
+ },
37
41
  token: {
38
42
  type: 'string',
39
43
  demandOption: true,
@@ -8,8 +8,6 @@ import defaults from '../defaults'
8
8
  import { Test } from '../typings'
9
9
  import * as utils from '../utils'
10
10
 
11
- const HANDLE = 'botpress'
12
-
13
11
  const fetchIntegration = async (client: Client, integrationName: string): Promise<ApiIntegration | undefined> => {
14
12
  const integrations = await fetchAllIntegrations(client)
15
13
  return integrations.find(({ name }) => name === integrationName)
@@ -17,13 +15,14 @@ const fetchIntegration = async (client: Client, integrationName: string): Promis
17
15
 
18
16
  export const createDeployIntegration: Test = {
19
17
  name: 'cli should allow creating, building, deploying and mannaging an integration',
20
- handler: async ({ tmpDir, dependencies, logger, ...creds }) => {
18
+ handler: async ({ tmpDir, dependencies, workspaceHandle, logger, ...creds }) => {
21
19
  const botpressHomeDir = pathlib.join(tmpDir, '.botpresshome')
22
20
  const baseDir = pathlib.join(tmpDir, 'integrations')
23
21
 
24
22
  const integrationSuffix = uuid.v4().replace(/-/g, '')
25
- const integrationName = `${HANDLE}/myintegration${integrationSuffix}`
26
- const integrationDirName = `${HANDLE}-myintegration${integrationSuffix}`
23
+ const name = `myintegration${integrationSuffix}`
24
+ const integrationName = `${workspaceHandle}/${name}`
25
+ const integrationDirName = `${workspaceHandle}-${name}`
27
26
  const integrationDir = pathlib.join(baseDir, integrationDirName)
28
27
 
29
28
  const argv = {
@@ -43,8 +42,6 @@ export const createDeployIntegration: Test = {
43
42
  await impl.build({ ...argv, workDir: integrationDir }).then(utils.handleExitCode)
44
43
  await impl.login({ ...argv }).then(utils.handleExitCode)
45
44
 
46
- await client.updateWorkspace({ id: creds.workspaceId, handle: HANDLE })
47
-
48
45
  await impl
49
46
  .deploy({ ...argv, createNewBot: undefined, botId: undefined, workDir: integrationDir })
50
47
  .then(utils.handleExitCode)
@@ -33,11 +33,15 @@ const appendSecretDefinition = (originalTsContent: string, secrets: SecretDef):
33
33
 
34
34
  export const requiredSecrets: Test = {
35
35
  name: 'cli should require required secrets',
36
- handler: async ({ tmpDir, dependencies, ...creds }) => {
36
+ handler: async ({ tmpDir, workspaceHandle, dependencies, ...creds }) => {
37
37
  const botpressHomeDir = pathlib.join(tmpDir, '.botpresshome')
38
38
  const baseDir = pathlib.join(tmpDir, 'integrations')
39
- const integrationName = `myintegration-${uuid.v4()}`.replace(/-/g, '')
40
- const integrationDir = pathlib.join(baseDir, integrationName)
39
+
40
+ const integrationSuffix = uuid.v4().replace(/-/g, '')
41
+ const name = `myintegration${integrationSuffix}`
42
+ const integrationName = `${workspaceHandle}/${name}`
43
+ const integrationDirName = `${workspaceHandle}-${name}`
44
+ const integrationDir = pathlib.join(baseDir, integrationDirName)
41
45
 
42
46
  const definitionPath = pathlib.join(integrationDir, 'integration.definition.ts')
43
47
 
package/e2e/typings.ts CHANGED
@@ -4,6 +4,7 @@ export type TestProps = {
4
4
  logger: Logger
5
5
  tmpDir: string
6
6
  workspaceId: string
7
+ workspaceHandle: string
7
8
  token: string
8
9
  apiUrl: string
9
10
  tunnelUrl: string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/cli",
3
- "version": "0.6.13",
3
+ "version": "0.6.15",
4
4
  "description": "Botpress CLI",
5
5
  "scripts": {
6
6
  "build": "pnpm run bundle && pnpm run template:gen",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "main": "dist/index.js",
22
22
  "dependencies": {
23
- "@botpress/client": "0.12.4",
23
+ "@botpress/client": "0.13.1",
24
24
  "@bpinternal/const": "^0.0.20",
25
25
  "@bpinternal/tunnel": "^0.1.1",
26
26
  "@bpinternal/yargs-extra": "^0.0.3",
@@ -49,7 +49,7 @@
49
49
  "zod": "^3.20.6"
50
50
  },
51
51
  "devDependencies": {
52
- "@botpress/sdk": "0.6.12",
52
+ "@botpress/sdk": "0.6.14",
53
53
  "@bpinternal/log4bot": "^0.0.4",
54
54
  "@types/bluebird": "^3.5.38",
55
55
  "@types/json-schema": "^7.0.11",
@@ -8,8 +8,8 @@
8
8
  "author": "",
9
9
  "license": "MIT",
10
10
  "dependencies": {
11
- "@botpress/client": "0.12.4",
12
- "@botpress/sdk": "0.6.12",
11
+ "@botpress/client": "0.13.1",
12
+ "@botpress/sdk": "0.6.14",
13
13
  "zod": "^3.20.6"
14
14
  },
15
15
  "devDependencies": {
@@ -9,8 +9,8 @@
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@botpress/client": "0.12.4",
13
- "@botpress/sdk": "0.6.12",
12
+ "@botpress/client": "0.13.1",
13
+ "@botpress/sdk": "0.6.14",
14
14
  "zod": "^3.20.6"
15
15
  },
16
16
  "devDependencies": {