@botpress/sdk 3.0.3 → 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.
Files changed (43) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/dist/bot/client/index.d.ts +1 -1
  3. package/dist/bot/client/types.d.ts +1 -1
  4. package/dist/bot/{types → common}/generic.d.ts +2 -2
  5. package/dist/bot/{types → common}/index.d.ts +1 -1
  6. package/dist/bot/implementation.d.ts +1 -1
  7. package/dist/bot/index.d.ts +1 -1
  8. package/dist/bot/server/index.d.ts +1 -1
  9. package/dist/bot/server/types.d.ts +59 -59
  10. package/dist/fixtures.d.ts +3 -3
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.cjs.map +2 -2
  13. package/dist/index.mjs +24 -24
  14. package/dist/index.mjs.map +4 -4
  15. package/dist/integration/client/index.d.ts +1 -1
  16. package/dist/integration/client/types.d.ts +1 -1
  17. package/dist/integration/{types → common}/index.d.ts +1 -1
  18. package/dist/integration/implementation.d.ts +1 -1
  19. package/dist/integration/index.d.ts +1 -1
  20. package/dist/integration/server/index.d.ts +1 -1
  21. package/dist/integration/server/types.d.ts +1 -1
  22. package/dist/interface/index.d.ts +1 -1
  23. package/dist/plugin/action-proxy/proxy.d.ts +1 -1
  24. package/dist/plugin/action-proxy/types.d.ts +1 -1
  25. package/dist/plugin/{types → common}/generic.d.ts +2 -2
  26. package/dist/plugin/{types → common}/index.d.ts +1 -1
  27. package/dist/plugin/definition.d.ts +8 -0
  28. package/dist/plugin/implementation.d.ts +1 -1
  29. package/dist/plugin/index.d.ts +1 -1
  30. package/dist/plugin/interface-resolution.d.ts +1 -1
  31. package/dist/plugin/server/types.d.ts +45 -45
  32. package/package.json +2 -2
  33. /package/dist/bot/{types → common}/generic.test.d.ts +0 -0
  34. /package/dist/bot/{types/common.d.ts → common/types.d.ts} +0 -0
  35. /package/dist/bot/{types/common.test.d.ts → common/types.test.d.ts} +0 -0
  36. /package/dist/integration/{types → common}/generic.d.ts +0 -0
  37. /package/dist/integration/{types → common}/generic.test.d.ts +0 -0
  38. /package/dist/integration/{types/common.d.ts → common/types.d.ts} +0 -0
  39. /package/dist/interface/{types → common}/generic.d.ts +0 -0
  40. /package/dist/interface/{types → common}/generic.test.d.ts +0 -0
  41. /package/dist/interface/{types → common}/index.d.ts +0 -0
  42. /package/dist/plugin/{types → common}/generic.test.d.ts +0 -0
  43. /package/dist/plugin/{types/common.d.ts → common/types.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  import * as client from '@botpress/client';
2
- import * as common from '../types';
2
+ import * as common from '../common';
3
3
  import * as types from './types';
4
4
  export * from './types';
5
5
  /**
@@ -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 '../types';
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 './common';
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,4 +2,4 @@ export * from './definition';
2
2
  export * from './implementation';
3
3
  export * from './client';
4
4
  export * from './server';
5
- export * from './types';
5
+ export * from './common';
@@ -1,5 +1,5 @@
1
1
  import { Request, Response } from '../../serve';
2
- import { BaseIntegration } from '../types';
2
+ import { BaseIntegration } from '../common';
3
3
  import { IntegrationHandlers } from './types';
4
4
  export * from './types';
5
5
  export * from './integration-logger';
@@ -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 '../types';
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 './types';
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 '../types';
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 '../types';
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/types/generic';
2
- import { BaseInterface, InputBaseInterface, DefaultInterface } from '../../interface/types/generic';
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 './common';
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
  };
@@ -1,4 +1,4 @@
1
1
  export * from './definition';
2
2
  export * from './implementation';
3
3
  export * from './server';
4
- export * from './types';
4
+ export * from './common';
@@ -1,4 +1,4 @@
1
- import { PluginInterfaceExtensions } from './types';
1
+ import { PluginInterfaceExtensions } from './common';
2
2
  export type ParsedActionRef = {
3
3
  namespace: string;
4
4
  actionName: string;
@@ -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 types from '../types';
6
- type EnumeratePluginEvents<TPlugin extends types.BasePlugin> = bot.EnumerateEvents<TPlugin> & types.EnumerateInterfaceEvents<TPlugin>;
7
- type _IncomingEvents<TPlugin extends types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = client.Event;
51
- export type AnyIncomingMessage<_TPlugin extends types.BasePlugin> = client.Message;
52
- export type AnyOutgoingMessageRequest<_TPlugin extends types.BasePlugin> = client.ClientInputs['createMessage'];
53
- export type AnyOutgoingMessageResponse<_TPlugin extends types.BasePlugin> = client.ClientOutputs['createMessage'];
54
- export type AnyOutgoingCallActionRequest<_TPlugin extends types.BasePlugin> = client.ClientInputs['callAction'];
55
- export type AnyOutgoingCallActionResponse<_TPlugin extends types.BasePlugin> = client.ClientOutputs['callAction'];
56
- export type IncomingEvents<TPlugin extends types.BasePlugin> = _IncomingEvents<TPlugin> & {
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 types.BasePlugin> = _IncomingMessages<TPlugin> & {
59
+ export type IncomingMessages<TPlugin extends common.BasePlugin> = _IncomingMessages<TPlugin> & {
60
60
  '*': AnyIncomingMessage<TPlugin>;
61
61
  };
62
- export type IncomingStates<_TPlugin extends types.BasePlugin> = _IncomingStates<_TPlugin> & {
62
+ export type IncomingStates<_TPlugin extends common.BasePlugin> = _IncomingStates<_TPlugin> & {
63
63
  '*': client.State;
64
64
  };
65
- export type OutgoingMessageRequests<TPlugin extends types.BasePlugin> = _OutgoingMessageRequests<TPlugin> & {
65
+ export type OutgoingMessageRequests<TPlugin extends common.BasePlugin> = _OutgoingMessageRequests<TPlugin> & {
66
66
  '*': AnyOutgoingMessageRequest<TPlugin>;
67
67
  };
68
- export type OutgoingMessageResponses<TPlugin extends types.BasePlugin> = _OutgoingMessageResponses<TPlugin> & {
68
+ export type OutgoingMessageResponses<TPlugin extends common.BasePlugin> = _OutgoingMessageResponses<TPlugin> & {
69
69
  '*': AnyOutgoingMessageResponse<TPlugin>;
70
70
  };
71
- export type OutgoingCallActionRequests<TPlugin extends types.BasePlugin> = _OutgoingCallActionRequests<TPlugin> & {
71
+ export type OutgoingCallActionRequests<TPlugin extends common.BasePlugin> = _OutgoingCallActionRequests<TPlugin> & {
72
72
  '*': AnyOutgoingCallActionRequest<TPlugin>;
73
73
  };
74
- export type OutgoingCallActionResponses<TPlugin extends types.BasePlugin> = _OutgoingCallActionResponses<TPlugin> & {
74
+ export type OutgoingCallActionResponses<TPlugin extends common.BasePlugin> = _OutgoingCallActionResponses<TPlugin> & {
75
75
  '*': AnyOutgoingCallActionResponse<TPlugin>;
76
76
  };
77
- export type PluginClient<_TPlugin extends types.BasePlugin> = bot.BotSpecificClient<types.BasePlugin>;
78
- export type PluginConfiguration<TPlugin extends types.BasePlugin> = TPlugin['configuration'];
79
- export type CommonHandlerProps<TPlugin extends types.BasePlugin> = {
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: types.PluginInterfaceExtensions<TPlugin>;
84
+ interfaces: common.PluginInterfaceExtensions<TPlugin>;
85
85
  actions: proxy.ActionProxy<TPlugin>;
86
86
  };
87
- export type MessagePayloads<TPlugin extends types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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<types.BasePlugin>;
144
- export type HookDefinitions<TPlugin extends types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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 types.BasePlugin> = {
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.0.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.41.2",
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