@botpress/sdk 3.1.0 → 3.2.0
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/index.d.ts +1 -1
- package/dist/bot/client/types.d.ts +1 -1
- package/dist/bot/{types → common}/generic.d.ts +2 -2
- package/dist/bot/{types → common}/index.d.ts +1 -1
- package/dist/bot/implementation.d.ts +1 -1
- package/dist/bot/index.d.ts +1 -1
- package/dist/bot/server/index.d.ts +1 -1
- package/dist/bot/server/types.d.ts +59 -59
- package/dist/fixtures.d.ts +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +24 -24
- package/dist/index.mjs.map +4 -4
- package/dist/integration/client/index.d.ts +1 -1
- package/dist/integration/client/types.d.ts +1 -1
- package/dist/integration/{types → common}/index.d.ts +1 -1
- package/dist/integration/implementation.d.ts +1 -1
- package/dist/integration/index.d.ts +1 -1
- package/dist/integration/server/index.d.ts +1 -1
- package/dist/integration/server/types.d.ts +1 -1
- package/dist/interface/index.d.ts +1 -1
- package/dist/plugin/action-proxy/proxy.d.ts +1 -1
- package/dist/plugin/action-proxy/types.d.ts +1 -1
- package/dist/plugin/{types → common}/generic.d.ts +2 -2
- package/dist/plugin/{types → common}/index.d.ts +1 -1
- package/dist/plugin/definition.d.ts +8 -0
- package/dist/plugin/implementation.d.ts +1 -1
- package/dist/plugin/index.d.ts +1 -1
- package/dist/plugin/interface-resolution.d.ts +1 -1
- package/dist/plugin/server/types.d.ts +45 -45
- package/package.json +2 -2
- /package/dist/bot/{types → common}/generic.test.d.ts +0 -0
- /package/dist/bot/{types/common.d.ts → common/types.d.ts} +0 -0
- /package/dist/bot/{types/common.test.d.ts → common/types.test.d.ts} +0 -0
- /package/dist/integration/{types → common}/generic.d.ts +0 -0
- /package/dist/integration/{types → common}/generic.test.d.ts +0 -0
- /package/dist/integration/{types/common.d.ts → common/types.d.ts} +0 -0
- /package/dist/interface/{types → common}/generic.d.ts +0 -0
- /package/dist/interface/{types → common}/generic.test.d.ts +0 -0
- /package/dist/interface/{types → common}/index.d.ts +0 -0
- /package/dist/plugin/{types → common}/generic.test.d.ts +0 -0
- /package/dist/plugin/{types/common.d.ts → common/types.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as client from '@botpress/client';
|
|
2
2
|
import * as utils from '../../utils/type-utils';
|
|
3
|
-
import * as common from '../
|
|
3
|
+
import * as common from '../common';
|
|
4
4
|
type BaseChannelDefinition = common.BaseIntegration['channels'][string];
|
|
5
5
|
type GetChannelByName<TIntegration extends common.BaseIntegration, TChannelName extends keyof TIntegration['channels']> = utils.Cast<TIntegration['channels'][TChannelName], BaseChannelDefinition>;
|
|
6
6
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './generic';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
|
+
import { BaseIntegration } from './common';
|
|
2
3
|
import { RegisterHandler as RegisterFunction, UnregisterHandler as UnregisterFunction, WebhookHandler as WebhookFunction, CreateUserHandler as CreateUserFunction, CreateConversationHandler as CreateConversationFunction, ActionHandlers as ActionFunctions, ChannelHandlers as ChannelFunctions } from './server';
|
|
3
|
-
import { BaseIntegration } from './types';
|
|
4
4
|
export type IntegrationImplementationProps<TIntegration extends BaseIntegration = BaseIntegration> = {
|
|
5
5
|
register: RegisterFunction<TIntegration>;
|
|
6
6
|
unregister: UnregisterFunction<TIntegration>;
|
|
@@ -2,7 +2,7 @@ import { type Conversation, type Message, type User } from '@botpress/client';
|
|
|
2
2
|
import { Request, Response } from '../../serve';
|
|
3
3
|
import { Cast, Merge, ValueOf } from '../../utils/type-utils';
|
|
4
4
|
import { IntegrationSpecificClient } from '../client';
|
|
5
|
-
import { BaseIntegration, ToTags } from '../
|
|
5
|
+
import { BaseIntegration, ToTags } from '../common';
|
|
6
6
|
import { type IntegrationLogger } from './integration-logger';
|
|
7
7
|
type IntegrationOperation = 'webhook_received' | 'message_created' | 'action_triggered' | 'register' | 'unregister' | 'ping' | 'create_user' | 'create_conversation';
|
|
8
8
|
type IntegrationContextConfig<TIntegration extends BaseIntegration> = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './definition';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './common';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Client } from '@botpress/client';
|
|
2
2
|
import { BotSpecificClient } from '../../bot';
|
|
3
|
-
import { BasePlugin, PluginInterfaceExtensions } from '../
|
|
3
|
+
import { BasePlugin, PluginInterfaceExtensions } from '../common';
|
|
4
4
|
import { ActionProxy } from './types';
|
|
5
5
|
export declare const proxyActions: <TPlugin extends BasePlugin>(client: BotSpecificClient<TPlugin> | Client, interfaces: PluginInterfaceExtensions<TPlugin>) => ActionProxy<TPlugin>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as utils from '../../utils/type-utils';
|
|
2
|
-
import { BasePlugin } from '../
|
|
2
|
+
import { BasePlugin } from '../common';
|
|
3
3
|
type IntegrationActionProxy<TPlugin extends BasePlugin> = {
|
|
4
4
|
[TIntegrationName in keyof TPlugin['integrations']]: {
|
|
5
5
|
[TActionName in keyof TPlugin['integrations'][TIntegrationName]['actions']]: (input: TPlugin['integrations'][TIntegrationName]['actions'][TActionName]['input']) => Promise<TPlugin['integrations'][TIntegrationName]['actions'][TActionName]['output']>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseIntegration, DefaultIntegration, InputBaseIntegration } from '../../integration/
|
|
2
|
-
import { BaseInterface, InputBaseInterface, DefaultInterface } from '../../interface/
|
|
1
|
+
import { BaseIntegration, DefaultIntegration, InputBaseIntegration } from '../../integration/common/generic';
|
|
2
|
+
import { BaseInterface, InputBaseInterface, DefaultInterface } from '../../interface/common/generic';
|
|
3
3
|
import * as utils from '../../utils/type-utils';
|
|
4
4
|
export type BaseAction = {
|
|
5
5
|
input: any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './types';
|
|
2
2
|
export * from './generic';
|
|
@@ -12,6 +12,10 @@ type BaseTables = Record<string, ZuiObjectSchema>;
|
|
|
12
12
|
export type PluginDefinitionProps<TName extends string = string, TVersion extends string = string, TConfig extends BaseConfig = BaseConfig, TStates extends BaseStates = BaseStates, TEvents extends BaseEvents = BaseEvents, TActions extends BaseActions = BaseActions, TInterfaces extends BaseInterfaces = BaseInterfaces, TIntegrations extends BaseIntegrations = BaseIntegrations, TTables extends BaseTables = BaseTables> = {
|
|
13
13
|
name: TName;
|
|
14
14
|
version: TVersion;
|
|
15
|
+
title?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
icon?: string;
|
|
18
|
+
readme?: string;
|
|
15
19
|
integrations?: {
|
|
16
20
|
[K in keyof TIntegrations]: IntegrationPackage;
|
|
17
21
|
};
|
|
@@ -40,6 +44,10 @@ export declare class PluginDefinition<TName extends string = string, TVersion ex
|
|
|
40
44
|
readonly props: PluginDefinitionProps<TName, TVersion, TConfig, TStates, TEvents, TActions, TInterfaces, TIntegrations, TTables>;
|
|
41
45
|
readonly name: this['props']['name'];
|
|
42
46
|
readonly version: this['props']['version'];
|
|
47
|
+
readonly title: this['props']['title'];
|
|
48
|
+
readonly description: this['props']['description'];
|
|
49
|
+
readonly icon: this['props']['icon'];
|
|
50
|
+
readonly readme: this['props']['readme'];
|
|
43
51
|
readonly integrations: this['props']['integrations'];
|
|
44
52
|
readonly interfaces: this['props']['interfaces'];
|
|
45
53
|
readonly user: this['props']['user'];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageHandlersMap as BotMessageHandlersMap, EventHandlersMap as BotEventHandlersMap, StateExpiredHandlersMap as BotStateExpiredHandlersMap, HookHandlersMap as BotHookHandlersMap, ActionHandlers as BotActionHandlers, BotHandlers } from '../bot';
|
|
2
|
+
import { BasePlugin, PluginInterfaceExtensions } from './common';
|
|
2
3
|
import { MessageHandlersMap, MessageHandlers, EventHandlersMap, EventHandlers, StateExpiredHandlersMap, StateExpiredHandlers, HookData, HookHandlers, ActionHandlers, PluginConfiguration } from './server/types';
|
|
3
|
-
import { BasePlugin, PluginInterfaceExtensions } from './types';
|
|
4
4
|
export type PluginImplementationProps<TPlugin extends BasePlugin = BasePlugin> = {
|
|
5
5
|
actions: ActionHandlers<TPlugin>;
|
|
6
6
|
};
|
package/dist/plugin/index.d.ts
CHANGED
|
@@ -2,33 +2,33 @@ import * as client from '@botpress/client';
|
|
|
2
2
|
import * as bot from '../../bot';
|
|
3
3
|
import * as utils from '../../utils/type-utils';
|
|
4
4
|
import * as proxy from '../action-proxy';
|
|
5
|
-
import * as
|
|
6
|
-
type EnumeratePluginEvents<TPlugin extends
|
|
7
|
-
type _IncomingEvents<TPlugin extends
|
|
5
|
+
import * as common from '../common';
|
|
6
|
+
type EnumeratePluginEvents<TPlugin extends common.BasePlugin> = bot.EnumerateEvents<TPlugin> & common.EnumerateInterfaceEvents<TPlugin>;
|
|
7
|
+
type _IncomingEvents<TPlugin extends common.BasePlugin> = {
|
|
8
8
|
[K in keyof EnumeratePluginEvents<TPlugin>]: utils.Merge<client.Event, {
|
|
9
9
|
type: K;
|
|
10
10
|
payload: EnumeratePluginEvents<TPlugin>[K];
|
|
11
11
|
}>;
|
|
12
12
|
};
|
|
13
|
-
type _IncomingMessages<TPlugin extends
|
|
13
|
+
type _IncomingMessages<TPlugin extends common.BasePlugin> = {
|
|
14
14
|
[K in keyof bot.GetMessages<TPlugin>]: utils.Merge<client.Message, {
|
|
15
15
|
type: K;
|
|
16
16
|
payload: bot.GetMessages<TPlugin>[K];
|
|
17
17
|
}>;
|
|
18
18
|
};
|
|
19
|
-
type _IncomingStates<TPlugin extends
|
|
19
|
+
type _IncomingStates<TPlugin extends common.BasePlugin> = {
|
|
20
20
|
[K in keyof bot.EnumerateStates<TPlugin>]: utils.Merge<client.State, {
|
|
21
21
|
name: K;
|
|
22
22
|
payload: bot.EnumerateStates<TPlugin>[K];
|
|
23
23
|
}>;
|
|
24
24
|
};
|
|
25
|
-
type _OutgoingMessageRequests<TPlugin extends
|
|
25
|
+
type _OutgoingMessageRequests<TPlugin extends common.BasePlugin> = {
|
|
26
26
|
[K in keyof bot.GetMessages<TPlugin>]: utils.Merge<client.ClientInputs['createMessage'], {
|
|
27
27
|
type: K;
|
|
28
28
|
payload: bot.GetMessages<TPlugin>[K];
|
|
29
29
|
}>;
|
|
30
30
|
};
|
|
31
|
-
type _OutgoingMessageResponses<TPlugin extends
|
|
31
|
+
type _OutgoingMessageResponses<TPlugin extends common.BasePlugin> = {
|
|
32
32
|
[K in keyof bot.GetMessages<TPlugin>]: utils.Merge<client.ClientOutputs['createMessage'], {
|
|
33
33
|
message: utils.Merge<client.Message, {
|
|
34
34
|
type: K;
|
|
@@ -36,55 +36,55 @@ type _OutgoingMessageResponses<TPlugin extends types.BasePlugin> = {
|
|
|
36
36
|
}>;
|
|
37
37
|
}>;
|
|
38
38
|
};
|
|
39
|
-
type _OutgoingCallActionRequests<TPlugin extends
|
|
39
|
+
type _OutgoingCallActionRequests<TPlugin extends common.BasePlugin> = {
|
|
40
40
|
[K in keyof bot.EnumerateActionInputs<TPlugin>]: utils.Merge<client.ClientInputs['callAction'], {
|
|
41
41
|
type: K;
|
|
42
42
|
input: bot.EnumerateActionInputs<TPlugin>[K];
|
|
43
43
|
}>;
|
|
44
44
|
};
|
|
45
|
-
type _OutgoingCallActionResponses<TPlugin extends
|
|
45
|
+
type _OutgoingCallActionResponses<TPlugin extends common.BasePlugin> = {
|
|
46
46
|
[K in keyof bot.EnumerateActionOutputs<TPlugin>]: utils.Merge<client.ClientOutputs['callAction'], {
|
|
47
47
|
output: bot.EnumerateActionOutputs<TPlugin>[K];
|
|
48
48
|
}>;
|
|
49
49
|
};
|
|
50
|
-
export type AnyIncomingEvent<_TPlugin extends
|
|
51
|
-
export type AnyIncomingMessage<_TPlugin extends
|
|
52
|
-
export type AnyOutgoingMessageRequest<_TPlugin extends
|
|
53
|
-
export type AnyOutgoingMessageResponse<_TPlugin extends
|
|
54
|
-
export type AnyOutgoingCallActionRequest<_TPlugin extends
|
|
55
|
-
export type AnyOutgoingCallActionResponse<_TPlugin extends
|
|
56
|
-
export type IncomingEvents<TPlugin extends
|
|
50
|
+
export type AnyIncomingEvent<_TPlugin extends common.BasePlugin> = client.Event;
|
|
51
|
+
export type AnyIncomingMessage<_TPlugin extends common.BasePlugin> = client.Message;
|
|
52
|
+
export type AnyOutgoingMessageRequest<_TPlugin extends common.BasePlugin> = client.ClientInputs['createMessage'];
|
|
53
|
+
export type AnyOutgoingMessageResponse<_TPlugin extends common.BasePlugin> = client.ClientOutputs['createMessage'];
|
|
54
|
+
export type AnyOutgoingCallActionRequest<_TPlugin extends common.BasePlugin> = client.ClientInputs['callAction'];
|
|
55
|
+
export type AnyOutgoingCallActionResponse<_TPlugin extends common.BasePlugin> = client.ClientOutputs['callAction'];
|
|
56
|
+
export type IncomingEvents<TPlugin extends common.BasePlugin> = _IncomingEvents<TPlugin> & {
|
|
57
57
|
'*': AnyIncomingEvent<TPlugin>;
|
|
58
58
|
};
|
|
59
|
-
export type IncomingMessages<TPlugin extends
|
|
59
|
+
export type IncomingMessages<TPlugin extends common.BasePlugin> = _IncomingMessages<TPlugin> & {
|
|
60
60
|
'*': AnyIncomingMessage<TPlugin>;
|
|
61
61
|
};
|
|
62
|
-
export type IncomingStates<_TPlugin extends
|
|
62
|
+
export type IncomingStates<_TPlugin extends common.BasePlugin> = _IncomingStates<_TPlugin> & {
|
|
63
63
|
'*': client.State;
|
|
64
64
|
};
|
|
65
|
-
export type OutgoingMessageRequests<TPlugin extends
|
|
65
|
+
export type OutgoingMessageRequests<TPlugin extends common.BasePlugin> = _OutgoingMessageRequests<TPlugin> & {
|
|
66
66
|
'*': AnyOutgoingMessageRequest<TPlugin>;
|
|
67
67
|
};
|
|
68
|
-
export type OutgoingMessageResponses<TPlugin extends
|
|
68
|
+
export type OutgoingMessageResponses<TPlugin extends common.BasePlugin> = _OutgoingMessageResponses<TPlugin> & {
|
|
69
69
|
'*': AnyOutgoingMessageResponse<TPlugin>;
|
|
70
70
|
};
|
|
71
|
-
export type OutgoingCallActionRequests<TPlugin extends
|
|
71
|
+
export type OutgoingCallActionRequests<TPlugin extends common.BasePlugin> = _OutgoingCallActionRequests<TPlugin> & {
|
|
72
72
|
'*': AnyOutgoingCallActionRequest<TPlugin>;
|
|
73
73
|
};
|
|
74
|
-
export type OutgoingCallActionResponses<TPlugin extends
|
|
74
|
+
export type OutgoingCallActionResponses<TPlugin extends common.BasePlugin> = _OutgoingCallActionResponses<TPlugin> & {
|
|
75
75
|
'*': AnyOutgoingCallActionResponse<TPlugin>;
|
|
76
76
|
};
|
|
77
|
-
export type PluginClient<_TPlugin extends
|
|
78
|
-
export type PluginConfiguration<TPlugin extends
|
|
79
|
-
export type CommonHandlerProps<TPlugin extends
|
|
77
|
+
export type PluginClient<_TPlugin extends common.BasePlugin> = bot.BotSpecificClient<common.BasePlugin>;
|
|
78
|
+
export type PluginConfiguration<TPlugin extends common.BasePlugin> = TPlugin['configuration'];
|
|
79
|
+
export type CommonHandlerProps<TPlugin extends common.BasePlugin> = {
|
|
80
80
|
ctx: bot.BotContext;
|
|
81
81
|
logger: bot.BotLogger;
|
|
82
82
|
client: PluginClient<TPlugin>;
|
|
83
83
|
configuration: PluginConfiguration<TPlugin>;
|
|
84
|
-
interfaces:
|
|
84
|
+
interfaces: common.PluginInterfaceExtensions<TPlugin>;
|
|
85
85
|
actions: proxy.ActionProxy<TPlugin>;
|
|
86
86
|
};
|
|
87
|
-
export type MessagePayloads<TPlugin extends
|
|
87
|
+
export type MessagePayloads<TPlugin extends common.BasePlugin> = {
|
|
88
88
|
[K in keyof IncomingMessages<TPlugin>]: CommonHandlerProps<TPlugin> & {
|
|
89
89
|
message: IncomingMessages<TPlugin>[K];
|
|
90
90
|
user: client.User;
|
|
@@ -98,32 +98,32 @@ export type MessagePayloads<TPlugin extends types.BasePlugin> = {
|
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
100
|
};
|
|
101
|
-
export type MessageHandlers<TPlugin extends
|
|
101
|
+
export type MessageHandlers<TPlugin extends common.BasePlugin> = {
|
|
102
102
|
[K in keyof IncomingMessages<TPlugin>]: (args: MessagePayloads<TPlugin>[K]) => Promise<void>;
|
|
103
103
|
};
|
|
104
|
-
export type EventPayloads<TPlugin extends
|
|
104
|
+
export type EventPayloads<TPlugin extends common.BasePlugin> = {
|
|
105
105
|
[K in keyof IncomingEvents<TPlugin>]: CommonHandlerProps<TPlugin> & {
|
|
106
106
|
event: IncomingEvents<TPlugin>[K];
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
|
-
export type EventHandlers<TPlugin extends
|
|
109
|
+
export type EventHandlers<TPlugin extends common.BasePlugin> = {
|
|
110
110
|
[K in keyof IncomingEvents<TPlugin>]: (args: EventPayloads<TPlugin>[K]) => Promise<void>;
|
|
111
111
|
};
|
|
112
|
-
export type StateExpiredPayloads<TPlugin extends
|
|
112
|
+
export type StateExpiredPayloads<TPlugin extends common.BasePlugin> = {
|
|
113
113
|
[K in keyof IncomingStates<TPlugin>]: CommonHandlerProps<TPlugin> & {
|
|
114
114
|
state: IncomingStates<TPlugin>[K];
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
|
-
export type StateExpiredHandlers<TPlugin extends
|
|
117
|
+
export type StateExpiredHandlers<TPlugin extends common.BasePlugin> = {
|
|
118
118
|
[K in keyof IncomingStates<TPlugin>]: (args: StateExpiredPayloads<TPlugin>[K]) => Promise<void>;
|
|
119
119
|
};
|
|
120
|
-
export type ActionHandlerPayloads<TPlugin extends
|
|
120
|
+
export type ActionHandlerPayloads<TPlugin extends common.BasePlugin> = {
|
|
121
121
|
[K in keyof TPlugin['actions']]: CommonHandlerProps<TPlugin> & {
|
|
122
122
|
type?: K;
|
|
123
123
|
input: TPlugin['actions'][K]['input'];
|
|
124
124
|
};
|
|
125
125
|
};
|
|
126
|
-
export type ActionHandlers<TPlugin extends
|
|
126
|
+
export type ActionHandlers<TPlugin extends common.BasePlugin> = {
|
|
127
127
|
[K in keyof TPlugin['actions']]: (props: ActionHandlerPayloads<TPlugin>[K]) => Promise<TPlugin['actions'][K]['output']>;
|
|
128
128
|
};
|
|
129
129
|
type BaseHookDefinition = {
|
|
@@ -140,8 +140,8 @@ type HookDefinition<THookDef extends BaseHookDefinition = BaseHookDefinition> =
|
|
|
140
140
|
* - before_incoming_call_action
|
|
141
141
|
* - after_incoming_call_action
|
|
142
142
|
*/
|
|
143
|
-
export type HookDefinitionType = keyof HookDefinitions<
|
|
144
|
-
export type HookDefinitions<TPlugin extends
|
|
143
|
+
export type HookDefinitionType = keyof HookDefinitions<common.BasePlugin>;
|
|
144
|
+
export type HookDefinitions<TPlugin extends common.BasePlugin> = {
|
|
145
145
|
before_incoming_event: HookDefinition<{
|
|
146
146
|
stoppable: true;
|
|
147
147
|
data: _IncomingEvents<TPlugin> & {
|
|
@@ -191,19 +191,19 @@ export type HookDefinitions<TPlugin extends types.BasePlugin> = {
|
|
|
191
191
|
};
|
|
192
192
|
}>;
|
|
193
193
|
};
|
|
194
|
-
export type HookData<TPlugin extends
|
|
194
|
+
export type HookData<TPlugin extends common.BasePlugin> = {
|
|
195
195
|
[H in keyof HookDefinitions<TPlugin>]: {
|
|
196
196
|
[T in keyof HookDefinitions<TPlugin>[H]['data']]: HookDefinitions<TPlugin>[H]['data'][T];
|
|
197
197
|
};
|
|
198
198
|
};
|
|
199
|
-
export type HookInputs<TPlugin extends
|
|
199
|
+
export type HookInputs<TPlugin extends common.BasePlugin> = {
|
|
200
200
|
[H in keyof HookData<TPlugin>]: {
|
|
201
201
|
[T in keyof HookData<TPlugin>[H]]: CommonHandlerProps<TPlugin> & {
|
|
202
202
|
data: HookData<TPlugin>[H][T];
|
|
203
203
|
};
|
|
204
204
|
};
|
|
205
205
|
};
|
|
206
|
-
export type HookOutputs<TPlugin extends
|
|
206
|
+
export type HookOutputs<TPlugin extends common.BasePlugin> = {
|
|
207
207
|
[H in keyof HookData<TPlugin>]: {
|
|
208
208
|
[T in keyof HookData<TPlugin>[H]]: {
|
|
209
209
|
data?: HookData<TPlugin>[H][T];
|
|
@@ -212,26 +212,26 @@ export type HookOutputs<TPlugin extends types.BasePlugin> = {
|
|
|
212
212
|
} : {});
|
|
213
213
|
};
|
|
214
214
|
};
|
|
215
|
-
export type HookHandlers<TPlugin extends
|
|
215
|
+
export type HookHandlers<TPlugin extends common.BasePlugin> = {
|
|
216
216
|
[H in keyof HookData<TPlugin>]: {
|
|
217
217
|
[T in keyof HookData<TPlugin>[H]]: (input: HookInputs<TPlugin>[H][T]) => Promise<HookOutputs<TPlugin>[H][T] | undefined>;
|
|
218
218
|
};
|
|
219
219
|
};
|
|
220
|
-
export type MessageHandlersMap<TPlugin extends
|
|
220
|
+
export type MessageHandlersMap<TPlugin extends common.BasePlugin> = {
|
|
221
221
|
[T in keyof IncomingMessages<TPlugin>]?: MessageHandlers<TPlugin>[T][];
|
|
222
222
|
};
|
|
223
|
-
export type EventHandlersMap<TPlugin extends
|
|
223
|
+
export type EventHandlersMap<TPlugin extends common.BasePlugin> = {
|
|
224
224
|
[T in keyof IncomingEvents<TPlugin>]?: EventHandlers<TPlugin>[T][];
|
|
225
225
|
};
|
|
226
|
-
export type StateExpiredHandlersMap<TPlugin extends
|
|
226
|
+
export type StateExpiredHandlersMap<TPlugin extends common.BasePlugin> = {
|
|
227
227
|
[T in keyof IncomingStates<TPlugin>]?: StateExpiredHandlers<TPlugin>[T][];
|
|
228
228
|
};
|
|
229
|
-
export type HookHandlersMap<TPlugin extends
|
|
229
|
+
export type HookHandlersMap<TPlugin extends common.BasePlugin> = {
|
|
230
230
|
[H in keyof HookData<TPlugin>]: {
|
|
231
231
|
[T in keyof HookData<TPlugin>[H]]?: HookHandlers<TPlugin>[H][T][];
|
|
232
232
|
};
|
|
233
233
|
};
|
|
234
|
-
export type PluginHandlers<TPlugin extends
|
|
234
|
+
export type PluginHandlers<TPlugin extends common.BasePlugin> = {
|
|
235
235
|
actionHandlers: ActionHandlers<TPlugin>;
|
|
236
236
|
messageHandlers: MessageHandlersMap<TPlugin>;
|
|
237
237
|
eventHandlers: EventHandlersMap<TPlugin>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Botpress SDK",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"author": "",
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@botpress/client": "0.
|
|
19
|
+
"@botpress/client": "0.45.0",
|
|
20
20
|
"browser-or-node": "^2.1.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|