@botpress/cli 3.4.0 → 3.5.1
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/code-generation/bot-implementation/bot-implementation.js +9 -0
- package/dist/code-generation/bot-implementation/bot-implementation.js.map +2 -2
- package/dist/code-generation/bot-implementation/bot-plugins/index.js +3 -3
- package/dist/code-generation/bot-implementation/bot-plugins/index.js.map +2 -2
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js +4 -4
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js.map +2 -2
- package/dist/code-generation/bot-implementation/bot-typings/index.js +11 -2
- package/dist/code-generation/bot-implementation/bot-typings/index.js.map +2 -2
- package/dist/code-generation/bot-implementation/bot-typings/workflows-module.js +104 -0
- package/dist/code-generation/bot-implementation/bot-typings/workflows-module.js.map +7 -0
- package/dist/code-generation/plugin-implementation/plugin-implementation.js +9 -0
- package/dist/code-generation/plugin-implementation/plugin-implementation.js.map +2 -2
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js +24 -11
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js.map +2 -2
- package/dist/code-generation/plugin-implementation/plugin-typings/workflows-module.js +104 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/workflows-module.js.map +7 -0
- package/dist/code-generation/typings.js.map +1 -1
- package/dist/command-implementations/deploy-command.js +1 -2
- package/dist/command-implementations/deploy-command.js.map +2 -2
- package/dist/sdk/validate-bot.js +5 -1
- package/dist/sdk/validate-bot.js.map +2 -2
- package/dist/sdk/validate-bot.test.js +131 -0
- package/dist/sdk/validate-bot.test.js.map +7 -0
- package/package.json +3 -3
- package/templates/empty-bot/.botpress/implementation/index.ts +9 -0
- package/templates/empty-bot/.botpress/implementation/typings/index.ts +3 -0
- package/templates/empty-bot/.botpress/implementation/typings/workflows/index.ts +6 -0
- package/templates/empty-bot/package.json +2 -2
- package/templates/empty-integration/package.json +2 -2
- package/templates/empty-plugin/.botpress/implementation/index.ts +9 -0
- package/templates/empty-plugin/.botpress/implementation/typings/index.ts +5 -0
- package/templates/empty-plugin/.botpress/implementation/typings/workflows/index.ts +6 -0
- package/templates/empty-plugin/package.json +1 -1
- package/templates/hello-world/package.json +2 -2
- package/templates/webhook-message/package.json +2 -2
|
@@ -37,9 +37,18 @@ export type EventHandlers = Required<{
|
|
|
37
37
|
export type MessageHandlers = Required<{
|
|
38
38
|
[K in keyof BotHandlers['messageHandlers']]: NonNullable<BotHandlers['messageHandlers'][K]>[number]
|
|
39
39
|
}>
|
|
40
|
+
export type WorkflowHandlers = {
|
|
41
|
+
[TWorkflowName in keyof Required<BotHandlers['workflowHandlers'][keyof BotHandlers['workflowHandlers']]>]:
|
|
42
|
+
Required<BotHandlers['workflowHandlers'][keyof BotHandlers['workflowHandlers']]>[TWorkflowName] extends
|
|
43
|
+
({ handler: infer U })[] ? U : never
|
|
44
|
+
}
|
|
40
45
|
|
|
41
46
|
export type MessageHandlerProps = Parameters<MessageHandlers['*']>[0]
|
|
42
47
|
export type EventHandlerProps = Parameters<EventHandlers['*']>[0]
|
|
48
|
+
export type WorkflowHandlerProps = {
|
|
49
|
+
[TWorkflowName in keyof WorkflowHandlers]: WorkflowHandlers[TWorkflowName] extends
|
|
50
|
+
(..._: infer U) => any ? U[0] : never
|
|
51
|
+
}
|
|
43
52
|
|
|
44
53
|
export type Client = (MessageHandlerProps | EventHandlerProps)['client']
|
|
45
54
|
export type ClientOperation = keyof {
|
|
@@ -7,12 +7,14 @@ import * as events from './events'
|
|
|
7
7
|
import * as states from './states'
|
|
8
8
|
import * as actions from './actions'
|
|
9
9
|
import * as tables from './tables/index'
|
|
10
|
+
import * as workflows from './workflows'
|
|
10
11
|
|
|
11
12
|
export * as integrations from './integrations/index'
|
|
12
13
|
export * as events from './events/index'
|
|
13
14
|
export * as states from './states/index'
|
|
14
15
|
export * as actions from './actions'
|
|
15
16
|
export * as tables from './tables/index'
|
|
17
|
+
export * as workflows from './workflows'
|
|
16
18
|
|
|
17
19
|
export type TBot = {
|
|
18
20
|
integrations: integrations.Integrations
|
|
@@ -20,4 +22,5 @@ export type TBot = {
|
|
|
20
22
|
states: states.States
|
|
21
23
|
actions: actions.Actions
|
|
22
24
|
tables: tables.Tables
|
|
25
|
+
workflows: workflows.Workflows
|
|
23
26
|
}
|
|
@@ -31,6 +31,11 @@ export type HookHandlers = Required<{
|
|
|
31
31
|
[K in keyof PluginHandlers['hookHandlers'][H]]: NonNullable<PluginHandlers['hookHandlers'][H][K]>[number]
|
|
32
32
|
}>
|
|
33
33
|
}>
|
|
34
|
+
export type WorkflowHandlers = {
|
|
35
|
+
[TWorkflowName in keyof Required<PluginHandlers['workflowHandlers'][keyof PluginHandlers['workflowHandlers']]>]:
|
|
36
|
+
Required<PluginHandlers['workflowHandlers'][keyof PluginHandlers['workflowHandlers']]>[TWorkflowName] extends
|
|
37
|
+
({ handler: infer U })[] ? U : never
|
|
38
|
+
}
|
|
34
39
|
|
|
35
40
|
export type AnyMessageHandler = MessageHandlers['*']
|
|
36
41
|
export type AnyEventHandler = EventHandlers['*']
|
|
@@ -45,6 +50,10 @@ export type ActionHandlerProps = Parameters<AnyActionHandler>[0]
|
|
|
45
50
|
export type HookHandlerProps = {
|
|
46
51
|
[H in keyof AnyHookHanders]: Parameters<NonNullable<AnyHookHanders[H]>>[0]
|
|
47
52
|
}
|
|
53
|
+
export type WorkflowHandlerProps = {
|
|
54
|
+
[TWorkflowName in keyof WorkflowHandlers]: WorkflowHandlers[TWorkflowName] extends
|
|
55
|
+
(..._: infer U) => any ? U[0] : never
|
|
56
|
+
}
|
|
48
57
|
|
|
49
58
|
export type Client = (MessageHandlerProps | EventHandlerProps)['client']
|
|
50
59
|
export type ClientOperation = keyof {
|
|
@@ -9,6 +9,7 @@ import * as events from './events'
|
|
|
9
9
|
import * as states from './states'
|
|
10
10
|
import * as actions from './actions'
|
|
11
11
|
import * as tables from './tables/index'
|
|
12
|
+
import * as workflows from './workflows'
|
|
12
13
|
|
|
13
14
|
export * as integrations from './integrations/index'
|
|
14
15
|
export * as interfaces from './interfaces/index'
|
|
@@ -17,8 +18,11 @@ export * as events from './events/index'
|
|
|
17
18
|
export * as states from './states/index'
|
|
18
19
|
export * as actions from './actions'
|
|
19
20
|
export * as tables from './tables/index'
|
|
21
|
+
export * as workflows from './workflows'
|
|
20
22
|
|
|
21
23
|
export type TPlugin = {
|
|
24
|
+
name: "empty-plugin"
|
|
25
|
+
version: "1.0.0"
|
|
22
26
|
integrations: integrations.Integrations
|
|
23
27
|
interfaces: interfaces.Interfaces
|
|
24
28
|
configuration: configuration.Configuration
|
|
@@ -26,4 +30,5 @@ export type TPlugin = {
|
|
|
26
30
|
states: states.States
|
|
27
31
|
actions: actions.Actions
|
|
28
32
|
tables: tables.Tables
|
|
33
|
+
workflows: workflows.Workflows
|
|
29
34
|
}
|