@botpress/cli 0.0.8 → 0.0.10

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.
Files changed (84) hide show
  1. package/dist/api-client.js +107 -0
  2. package/dist/app/api-utils.js +9 -3
  3. package/dist/app/base.js +1 -3
  4. package/dist/app/errors.js +8 -0
  5. package/dist/app/file-paths.js +28 -31
  6. package/dist/app/index.js +18 -11
  7. package/dist/app/project.js +4 -4
  8. package/dist/app/user.js +73 -23
  9. package/dist/code-generation/action.js +70 -0
  10. package/dist/code-generation/channel.js +51 -0
  11. package/dist/code-generation/configuration.js +40 -0
  12. package/dist/code-generation/const.js +31 -0
  13. package/dist/code-generation/event.js +41 -0
  14. package/dist/code-generation/index.js +80 -0
  15. package/dist/code-generation/integration-impl.js +147 -0
  16. package/dist/code-generation/integration-instance.js +79 -0
  17. package/dist/code-generation/message.js +41 -0
  18. package/dist/code-generation/module.js +115 -0
  19. package/dist/code-generation/typings.js +16 -0
  20. package/dist/command-definitions.js +61 -0
  21. package/dist/command-implementations/add-command.js +124 -0
  22. package/dist/command-implementations/base-command.js +53 -0
  23. package/dist/command-implementations/bot-commands.js +89 -0
  24. package/dist/command-implementations/build-command.js +48 -0
  25. package/dist/command-implementations/bundle-command.js +58 -0
  26. package/dist/command-implementations/deploy-command.js +162 -0
  27. package/dist/command-implementations/dev-command.js +168 -0
  28. package/dist/command-implementations/gen-command.js +58 -0
  29. package/dist/command-implementations/global-command.js +111 -0
  30. package/dist/command-implementations/index.js +78 -0
  31. package/dist/command-implementations/init-command.js +85 -0
  32. package/dist/command-implementations/integration-commands.js +107 -0
  33. package/dist/command-implementations/login-command.js +75 -0
  34. package/dist/command-implementations/logout-command.js +34 -0
  35. package/dist/command-implementations/project-command.js +115 -0
  36. package/dist/command-implementations/serve-command.js +53 -0
  37. package/dist/command-tree.js +59 -0
  38. package/dist/config.js +18 -8
  39. package/dist/consts.js +24 -9
  40. package/dist/errors.js +156 -0
  41. package/dist/index.js +33 -20
  42. package/dist/integration-ref.js +61 -0
  43. package/dist/path-utils.js +7 -4
  44. package/dist/register-yargs.js +85 -0
  45. package/dist/typings.js +16 -0
  46. package/dist/utils/cache-utils.js +99 -0
  47. package/dist/utils/esbuild-utils.js +89 -0
  48. package/dist/utils/event-emitter.js +62 -0
  49. package/dist/utils/file-watcher.js +68 -0
  50. package/dist/utils/index.js +55 -0
  51. package/dist/utils/path-utils.js +83 -0
  52. package/dist/utils/prompt-utils.js +75 -0
  53. package/dist/utils/require-utils.js +49 -0
  54. package/dist/utils/string-utils.js +38 -0
  55. package/package.json +7 -5
  56. package/templates/echo-bot/.botpress/project.cache.json +1 -0
  57. package/templates/echo-bot/package.json +22 -0
  58. package/templates/echo-bot/readme.md +5 -0
  59. package/templates/echo-bot/src/index.ts +44 -0
  60. package/templates/echo-bot/tsconfig.json +15 -0
  61. package/templates/empty-integration/.botpress/implementation/actions/index.ts +7 -0
  62. package/templates/empty-integration/.botpress/implementation/channels/channel/audio.ts +10 -0
  63. package/templates/empty-integration/.botpress/implementation/channels/channel/card.ts +17 -0
  64. package/templates/empty-integration/.botpress/implementation/channels/channel/carousel.ts +19 -0
  65. package/templates/empty-integration/.botpress/implementation/channels/channel/choice.ts +14 -0
  66. package/templates/empty-integration/.botpress/implementation/channels/channel/dropdown.ts +14 -0
  67. package/templates/empty-integration/.botpress/implementation/channels/channel/file.ts +11 -0
  68. package/templates/empty-integration/.botpress/implementation/channels/channel/image.ts +10 -0
  69. package/templates/empty-integration/.botpress/implementation/channels/channel/index.ts +40 -0
  70. package/templates/empty-integration/.botpress/implementation/channels/channel/location.ts +11 -0
  71. package/templates/empty-integration/.botpress/implementation/channels/channel/markdown.ts +10 -0
  72. package/templates/empty-integration/.botpress/implementation/channels/channel/text.ts +10 -0
  73. package/templates/empty-integration/.botpress/implementation/channels/channel/video.ts +10 -0
  74. package/templates/empty-integration/.botpress/implementation/channels/index.ts +10 -0
  75. package/templates/empty-integration/.botpress/implementation/configuration.ts +10 -0
  76. package/templates/empty-integration/.botpress/implementation/events/index.ts +7 -0
  77. package/templates/empty-integration/.botpress/implementation/index.ts +17 -0
  78. package/templates/empty-integration/.botpress/index.ts +1 -0
  79. package/templates/empty-integration/.botpress/project.cache.json +1 -0
  80. package/templates/empty-integration/integration.definition.ts +13 -0
  81. package/templates/empty-integration/package.json +22 -0
  82. package/templates/empty-integration/readme.md +5 -0
  83. package/templates/empty-integration/src/index.ts +58 -0
  84. package/templates/empty-integration/tsconfig.json +15 -0
@@ -0,0 +1,10 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ export interface Markdown {
9
+ markdown: string;
10
+ }
@@ -0,0 +1,10 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ export interface Text {
9
+ text: string;
10
+ }
@@ -0,0 +1,10 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ export interface Video {
9
+ videoUrl: string;
10
+ }
@@ -0,0 +1,10 @@
1
+ /* tslint:disable */
2
+ // This file is generated
3
+ // Do not edit this file
4
+
5
+ import type * as channel from "./channel/index";
6
+ export * as channel from "./channel/index";
7
+
8
+ export type Channels = {
9
+ channel: channel.ChannelChannel;
10
+ }
@@ -0,0 +1,10 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ export interface Configuration {
9
+ [k: string]: unknown;
10
+ }
@@ -0,0 +1,7 @@
1
+ /* tslint:disable */
2
+ // This file is generated
3
+ // Do not edit this file
4
+
5
+
6
+ export type Events = {
7
+ }
@@ -0,0 +1,17 @@
1
+ /* tslint:disable */
2
+ // This file is generated
3
+ // Do not edit this file
4
+
5
+ import { Integration } from "@botpress/sdk";
6
+
7
+ import type * as configuration from "./configuration";
8
+ import type * as actions from "./actions/index";
9
+ import type * as channels from "./channels/index";
10
+ import type * as events from "./events/index";
11
+ export * as configuration from "./configuration";
12
+ export * as actions from "./actions/index";
13
+ export * as channels from "./channels/index";
14
+ export * as events from "./events/index";
15
+
16
+ export class IntegrationEmpty
17
+ extends Integration<configuration.Configuration, actions.Actions, channels.Channels, events.Events> {}
@@ -0,0 +1 @@
1
+ export * from './implementation'
@@ -0,0 +1,13 @@
1
+ import { IntegrationDefinition, messages } from '@botpress/sdk'
2
+ import { version } from './package.json'
3
+
4
+ export default new IntegrationDefinition({
5
+ name: 'empty',
6
+ version,
7
+ public: true,
8
+ channels: {
9
+ channel: {
10
+ messages: { ...messages.defaults },
11
+ },
12
+ },
13
+ })
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@botpresshub/empty-integration",
3
+ "version": "0.1.0",
4
+ "description": "Integration with no content",
5
+ "scripts": {
6
+ "type-check": "tsc --noEmit"
7
+ },
8
+ "keywords": [],
9
+ "private": true,
10
+ "author": "",
11
+ "license": "MIT",
12
+ "dependencies": {
13
+ "@botpress/client": "0.0.10",
14
+ "@botpress/sdk": "0.0.8",
15
+ "zod": "^3.20.6"
16
+ },
17
+ "devDependencies": {
18
+ "@types/node": "^18.11.17",
19
+ "ts-node": "^10.9.1",
20
+ "typescript": "^4.9.4"
21
+ }
22
+ }
@@ -0,0 +1,5 @@
1
+ # Empty Integration
2
+
3
+ ## Description
4
+
5
+ Integration with no content.
@@ -0,0 +1,58 @@
1
+ import * as botpress from '.botpress'
2
+
3
+ const logger = console
4
+ logger.info('starting integration')
5
+
6
+ class NotImplementedError extends Error {
7
+ constructor() {
8
+ super('Not implemented')
9
+ }
10
+ }
11
+
12
+ export default new botpress.IntegrationEmpty({
13
+ register: async () => {},
14
+ unregister: async () => {},
15
+ actions: {},
16
+ channels: {
17
+ channel: {
18
+ messages: {
19
+ text: async () => {
20
+ throw new NotImplementedError()
21
+ },
22
+ image: async () => {
23
+ throw new NotImplementedError()
24
+ },
25
+ markdown: async () => {
26
+ throw new NotImplementedError()
27
+ },
28
+ audio: async () => {
29
+ throw new NotImplementedError()
30
+ },
31
+ video: async () => {
32
+ throw new NotImplementedError()
33
+ },
34
+ file: async () => {
35
+ throw new NotImplementedError()
36
+ },
37
+ location: async () => {
38
+ throw new NotImplementedError()
39
+ },
40
+ carousel: async () => {
41
+ throw new NotImplementedError()
42
+ },
43
+ card: async () => {
44
+ throw new NotImplementedError()
45
+ },
46
+ choice: async () => {
47
+ throw new NotImplementedError()
48
+ },
49
+ dropdown: async () => {
50
+ throw new NotImplementedError()
51
+ },
52
+ },
53
+ },
54
+ },
55
+ handler: async () => {
56
+ throw new NotImplementedError()
57
+ },
58
+ })
@@ -0,0 +1,15 @@
1
+ {
2
+ "extends": "@tsconfig/node18-strictest/tsconfig.json",
3
+ "compilerOptions": {
4
+ "target": "es2017",
5
+ "baseUrl": ".",
6
+ "outDir": "dist",
7
+ "checkJs": false,
8
+ "incremental": true,
9
+ "exactOptionalPropertyTypes": false,
10
+ "resolveJsonModule": true,
11
+ "noPropertyAccessFromIndexSignature": false,
12
+ "noUnusedLocals": false
13
+ },
14
+ "include": [".botpress/**/*", "src/**/*", "./*.ts", "./*.json"]
15
+ }