@botpress/sdk 4.2.0 → 4.3.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 +4 -4
- package/dist/bot/client/types.d.ts +1 -1
- package/dist/bot/implementation.d.ts +10 -0
- package/dist/bot/server/types.d.ts +33 -2
- package/dist/fixtures.d.ts +8 -0
- package/dist/index.cjs +21 -21
- package/dist/index.cjs.map +3 -3
- package/dist/index.mjs +18 -18
- package/dist/index.mjs.map +3 -3
- package/dist/plugin/implementation.d.ts +10 -0
- package/dist/plugin/server/types.d.ts +42 -1
- package/package.json +1 -1
|
@@ -33,10 +33,20 @@ export declare class PluginImplementation<TPlugin extends BasePlugin = BasePlugi
|
|
|
33
33
|
beforeIncomingMessage: <T extends utils.types.StringKeys<HookHandlersMap<TPlugin>["before_incoming_message"]>>(type: T, handler: HookHandlers<TPlugin>["before_incoming_message"][T]) => void;
|
|
34
34
|
beforeOutgoingMessage: <T extends utils.types.StringKeys<HookHandlersMap<TPlugin>["before_outgoing_message"]>>(type: T, handler: HookHandlers<TPlugin>["before_outgoing_message"][T]) => void;
|
|
35
35
|
beforeOutgoingCallAction: <T extends utils.types.StringKeys<HookHandlersMap<TPlugin>["before_outgoing_call_action"]>>(type: T, handler: HookHandlers<TPlugin>["before_outgoing_call_action"][T]) => void;
|
|
36
|
+
/**
|
|
37
|
+
* # EXPERIMENTAL
|
|
38
|
+
* This API is experimental and may change in the future.
|
|
39
|
+
*/
|
|
40
|
+
beforeIncomingCallAction: <T extends utils.types.StringKeys<HookHandlersMap<TPlugin>["before_incoming_call_action"]>>(type: T, handler: HookHandlers<TPlugin>["before_incoming_call_action"][T]) => void;
|
|
36
41
|
afterIncomingEvent: <T extends utils.types.StringKeys<HookHandlersMap<TPlugin>["after_incoming_event"]>>(type: T, handler: HookHandlers<TPlugin>["after_incoming_event"][T]) => void;
|
|
37
42
|
afterIncomingMessage: <T extends utils.types.StringKeys<HookHandlersMap<TPlugin>["after_incoming_message"]>>(type: T, handler: HookHandlers<TPlugin>["after_incoming_message"][T]) => void;
|
|
38
43
|
afterOutgoingMessage: <T extends utils.types.StringKeys<HookHandlersMap<TPlugin>["after_outgoing_message"]>>(type: T, handler: HookHandlers<TPlugin>["after_outgoing_message"][T]) => void;
|
|
39
44
|
afterOutgoingCallAction: <T extends utils.types.StringKeys<HookHandlersMap<TPlugin>["after_outgoing_call_action"]>>(type: T, handler: HookHandlers<TPlugin>["after_outgoing_call_action"][T]) => void;
|
|
45
|
+
/**
|
|
46
|
+
* # EXPERIMENTAL
|
|
47
|
+
* This API is experimental and may change in the future.
|
|
48
|
+
*/
|
|
49
|
+
afterIncomingCallAction: <T extends utils.types.StringKeys<HookHandlersMap<TPlugin>["after_incoming_call_action"]>>(type: T, handler: HookHandlers<TPlugin>["after_incoming_call_action"][T]) => void;
|
|
40
50
|
/**
|
|
41
51
|
* # EXPERIMENTAL
|
|
42
52
|
* This API is experimental and may change in the future.
|
|
@@ -46,15 +46,38 @@ type _OutgoingCallActionRequests<TPlugin extends common.BasePlugin> = {
|
|
|
46
46
|
};
|
|
47
47
|
type _OutgoingCallActionResponses<TPlugin extends common.BasePlugin> = {
|
|
48
48
|
[K in utils.StringKeys<bot.EnumerateActionOutputs<TPlugin>>]: utils.Merge<client.ClientOutputs['callAction'], {
|
|
49
|
+
type: K;
|
|
49
50
|
output: bot.EnumerateActionOutputs<TPlugin>[K];
|
|
50
51
|
}>;
|
|
51
52
|
};
|
|
53
|
+
type _IncomingCallActionRequests<TPlugin extends common.BasePlugin> = {
|
|
54
|
+
[K in utils.StringKeys<TPlugin['actions']>]: {
|
|
55
|
+
type: K;
|
|
56
|
+
input: TPlugin['actions'][K]['input'];
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
type _IncomingCallActionResponses<TPlugin extends common.BasePlugin> = {
|
|
60
|
+
[K in utils.StringKeys<TPlugin['actions']>]: {
|
|
61
|
+
type: K;
|
|
62
|
+
output: TPlugin['actions'][K]['output'];
|
|
63
|
+
};
|
|
64
|
+
};
|
|
52
65
|
export type AnyIncomingEvent<_TPlugin extends common.BasePlugin> = client.Event;
|
|
53
66
|
export type AnyIncomingMessage<_TPlugin extends common.BasePlugin> = client.Message;
|
|
54
67
|
export type AnyOutgoingMessageRequest<_TPlugin extends common.BasePlugin> = client.ClientInputs['createMessage'];
|
|
55
68
|
export type AnyOutgoingMessageResponse<_TPlugin extends common.BasePlugin> = client.ClientOutputs['createMessage'];
|
|
56
69
|
export type AnyOutgoingCallActionRequest<_TPlugin extends common.BasePlugin> = client.ClientInputs['callAction'];
|
|
57
|
-
export type AnyOutgoingCallActionResponse<_TPlugin extends common.BasePlugin> = client.ClientOutputs['callAction']
|
|
70
|
+
export type AnyOutgoingCallActionResponse<_TPlugin extends common.BasePlugin> = client.ClientOutputs['callAction'] & {
|
|
71
|
+
type: string;
|
|
72
|
+
};
|
|
73
|
+
export type AnyIncomingCallActionRequest<_TPlugin extends common.BasePlugin> = {
|
|
74
|
+
type: string;
|
|
75
|
+
input: Record<string, unknown>;
|
|
76
|
+
};
|
|
77
|
+
export type AnyIncomingCallActionResponse<_TPlugin extends common.BasePlugin> = {
|
|
78
|
+
type: string;
|
|
79
|
+
output: Record<string, unknown>;
|
|
80
|
+
};
|
|
58
81
|
export type IncomingEvents<TPlugin extends common.BasePlugin> = _IncomingEvents<TPlugin> & {
|
|
59
82
|
'*': AnyIncomingEvent<TPlugin>;
|
|
60
83
|
};
|
|
@@ -76,6 +99,12 @@ export type OutgoingCallActionRequests<TPlugin extends common.BasePlugin> = _Out
|
|
|
76
99
|
export type OutgoingCallActionResponses<TPlugin extends common.BasePlugin> = _OutgoingCallActionResponses<TPlugin> & {
|
|
77
100
|
'*': AnyOutgoingCallActionResponse<TPlugin>;
|
|
78
101
|
};
|
|
102
|
+
export type IncomingCallActionRequest<TPlugin extends common.BasePlugin> = _IncomingCallActionRequests<TPlugin> & {
|
|
103
|
+
'*': AnyIncomingCallActionRequest<TPlugin>;
|
|
104
|
+
};
|
|
105
|
+
export type IncomingCallActionResponse<TPlugin extends common.BasePlugin> = _IncomingCallActionResponses<TPlugin> & {
|
|
106
|
+
'*': AnyIncomingCallActionResponse<TPlugin>;
|
|
107
|
+
};
|
|
79
108
|
export type PluginClient<_TPlugin extends common.BasePlugin> = bot.BotSpecificClient<common.BasePlugin>;
|
|
80
109
|
export type CommonHandlerProps<TPlugin extends common.BasePlugin> = {
|
|
81
110
|
ctx: bot.BotContext;
|
|
@@ -181,6 +210,12 @@ export type HookDefinitions<TPlugin extends common.BasePlugin> = {
|
|
|
181
210
|
'*': AnyOutgoingCallActionRequest<TPlugin>;
|
|
182
211
|
};
|
|
183
212
|
}>;
|
|
213
|
+
before_incoming_call_action: HookDefinition<{
|
|
214
|
+
stoppable: true;
|
|
215
|
+
data: _IncomingCallActionRequests<TPlugin> & {
|
|
216
|
+
'*': AnyIncomingCallActionRequest<TPlugin>;
|
|
217
|
+
};
|
|
218
|
+
}>;
|
|
184
219
|
after_incoming_event: HookDefinition<{
|
|
185
220
|
stoppable: true;
|
|
186
221
|
data: _IncomingEvents<TPlugin> & {
|
|
@@ -205,6 +240,12 @@ export type HookDefinitions<TPlugin extends common.BasePlugin> = {
|
|
|
205
240
|
'*': AnyOutgoingCallActionResponse<TPlugin>;
|
|
206
241
|
};
|
|
207
242
|
}>;
|
|
243
|
+
after_incoming_call_action: HookDefinition<{
|
|
244
|
+
stoppable: true;
|
|
245
|
+
data: _IncomingCallActionResponses<TPlugin> & {
|
|
246
|
+
'*': AnyIncomingCallActionResponse<TPlugin>;
|
|
247
|
+
};
|
|
248
|
+
}>;
|
|
208
249
|
};
|
|
209
250
|
export type HookData<TPlugin extends common.BasePlugin> = {
|
|
210
251
|
[THookType in utils.StringKeys<HookDefinitions<TPlugin>>]: {
|