@botpress/sdk 3.1.0 → 3.3.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 +52 -3
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +26 -26
- package/dist/index.mjs.map +4 -4
- package/dist/integration/client/index.d.ts +1 -1
- package/dist/integration/client/sub-types.d.ts +30 -0
- package/dist/integration/client/types.d.ts +26 -33
- package/dist/integration/{types → common}/index.d.ts +1 -1
- package/dist/integration/common/types.d.ts +2 -0
- 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/common/generic.test.d.ts +1 -0
- 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 +7 -3
- package/dist/integration/types/common.d.ts +0 -4
- /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/generic.test.d.ts → client/sub-types.test.d.ts} +0 -0
- /package/dist/integration/{types → common}/generic.d.ts +0 -0
- /package/dist/{interface/types → integration/common}/generic.test.d.ts +0 -0
- /package/dist/interface/{types → common}/generic.d.ts +0 -0
- /package/dist/{plugin/types → interface/common}/generic.test.d.ts +0 -0
- /package/dist/interface/{types → common}/index.d.ts +0 -0
- /package/dist/plugin/{types/common.d.ts → common/types.d.ts} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/sdk@3.
|
|
2
|
+
> @botpress/sdk@3.3.0 build /home/runner/work/botpress/botpress/packages/sdk
|
|
3
3
|
> pnpm build:type && pnpm build:node && pnpm build:browser
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @botpress/sdk@3.
|
|
6
|
+
> @botpress/sdk@3.3.0 build:type /home/runner/work/botpress/botpress/packages/sdk
|
|
7
7
|
> tsc --emitDeclarationOnly --declaration
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @botpress/sdk@3.
|
|
10
|
+
> @botpress/sdk@3.3.0 build:node /home/runner/work/botpress/botpress/packages/sdk
|
|
11
11
|
> ts-node -T ./build.ts --node
|
|
12
12
|
|
|
13
13
|
Done
|
|
14
14
|
|
|
15
|
-
> @botpress/sdk@3.
|
|
15
|
+
> @botpress/sdk@3.3.0 build:browser /home/runner/work/botpress/botpress/packages/sdk
|
|
16
16
|
> ts-node -T ./build.ts --browser
|
|
17
17
|
|
|
18
18
|
Done
|
|
@@ -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 Arg<F extends (...args: any[]) => any> = Parameters<F>[number];
|
|
5
5
|
type Res<F extends (...args: any[]) => any> = ReturnType<F>;
|
|
6
6
|
type EventResponse<TBot extends common.BaseBot> = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseIntegration, DefaultIntegration, InputBaseIntegration } from '../../integration/
|
|
1
|
+
import { BaseIntegration, DefaultIntegration, InputBaseIntegration } from '../../integration/common/generic';
|
|
2
2
|
import * as utils from '../../utils/type-utils';
|
|
3
|
-
export * from '../../integration/
|
|
3
|
+
export * from '../../integration/common/generic';
|
|
4
4
|
export type BaseAction = {
|
|
5
5
|
input: any;
|
|
6
6
|
output: any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './generic';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
2
|
import { BasePlugin, PluginImplementation } from '../plugin';
|
|
3
|
+
import { BaseBot } from './common';
|
|
3
4
|
import { MessageHandlersMap, MessageHandlers, EventHandlersMap, EventHandlers, StateExpiredHandlersMap, StateExpiredHandlers, HookHandlersMap, HookData, HookHandlers, ActionHandlers, BotHandlers, UnimplementedActionHandlers } from './server';
|
|
4
|
-
import { BaseBot } from './types';
|
|
5
5
|
export type BotImplementationProps<TBot extends BaseBot = BaseBot, TPlugins extends Record<string, BasePlugin> = {}> = {
|
|
6
6
|
actions: UnimplementedActionHandlers<TBot, TPlugins>;
|
|
7
7
|
plugins: {
|
package/dist/bot/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Request, Response } from '../../serve';
|
|
2
|
-
import * as common from '../
|
|
2
|
+
import * as common from '../common';
|
|
3
3
|
import * as types from './types';
|
|
4
4
|
export * from './types';
|
|
5
5
|
export declare const botHandler: (bot: types.BotHandlers<common.BaseBot>) => (req: Request) => Promise<Response | void>;
|
|
@@ -3,7 +3,7 @@ import * as plugin from '../../plugin';
|
|
|
3
3
|
import * as utils from '../../utils/type-utils';
|
|
4
4
|
import { type BotLogger } from '../bot-logger';
|
|
5
5
|
import { BotSpecificClient } from '../client';
|
|
6
|
-
import * as
|
|
6
|
+
import * as common from '../common';
|
|
7
7
|
export type BotOperation = 'event_received' | 'register' | 'unregister' | 'ping' | 'action_triggered';
|
|
8
8
|
export type BotContext = {
|
|
9
9
|
botId: string;
|
|
@@ -13,83 +13,83 @@ export type BotContext = {
|
|
|
13
13
|
payload: string;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
type _IncomingEvents<TBot extends
|
|
17
|
-
[K in keyof
|
|
16
|
+
type _IncomingEvents<TBot extends common.BaseBot> = {
|
|
17
|
+
[K in keyof common.EnumerateEvents<TBot>]: utils.Merge<client.Event, {
|
|
18
18
|
type: K;
|
|
19
|
-
payload:
|
|
19
|
+
payload: common.EnumerateEvents<TBot>[K];
|
|
20
20
|
}>;
|
|
21
21
|
};
|
|
22
|
-
type _IncomingMessages<TBot extends
|
|
23
|
-
[K in keyof
|
|
22
|
+
type _IncomingMessages<TBot extends common.BaseBot> = {
|
|
23
|
+
[K in keyof common.GetMessages<TBot>]: utils.Merge<client.Message, {
|
|
24
24
|
type: K;
|
|
25
|
-
payload:
|
|
25
|
+
payload: common.GetMessages<TBot>[K];
|
|
26
26
|
}>;
|
|
27
27
|
};
|
|
28
|
-
type _IncomingStates<TBot extends
|
|
29
|
-
[K in keyof
|
|
28
|
+
type _IncomingStates<TBot extends common.BaseBot> = {
|
|
29
|
+
[K in keyof common.EnumerateStates<TBot>]: utils.Merge<client.State, {
|
|
30
30
|
name: K;
|
|
31
|
-
payload:
|
|
31
|
+
payload: common.EnumerateStates<TBot>[K];
|
|
32
32
|
}>;
|
|
33
33
|
};
|
|
34
|
-
type _OutgoingMessageRequests<TBot extends
|
|
35
|
-
[K in keyof
|
|
34
|
+
type _OutgoingMessageRequests<TBot extends common.BaseBot> = {
|
|
35
|
+
[K in keyof common.GetMessages<TBot>]: utils.Merge<client.ClientInputs['createMessage'], {
|
|
36
36
|
type: K;
|
|
37
|
-
payload:
|
|
37
|
+
payload: common.GetMessages<TBot>[K];
|
|
38
38
|
}>;
|
|
39
39
|
};
|
|
40
|
-
type _OutgoingMessageResponses<TBot extends
|
|
41
|
-
[K in keyof
|
|
40
|
+
type _OutgoingMessageResponses<TBot extends common.BaseBot> = {
|
|
41
|
+
[K in keyof common.GetMessages<TBot>]: utils.Merge<client.ClientOutputs['createMessage'], {
|
|
42
42
|
message: utils.Merge<client.Message, {
|
|
43
43
|
type: K;
|
|
44
|
-
payload:
|
|
44
|
+
payload: common.GetMessages<TBot>[K];
|
|
45
45
|
}>;
|
|
46
46
|
}>;
|
|
47
47
|
};
|
|
48
|
-
type _OutgoingCallActionRequests<TBot extends
|
|
49
|
-
[K in keyof
|
|
48
|
+
type _OutgoingCallActionRequests<TBot extends common.BaseBot> = {
|
|
49
|
+
[K in keyof common.EnumerateActionInputs<TBot>]: utils.Merge<client.ClientInputs['callAction'], {
|
|
50
50
|
type: K;
|
|
51
|
-
input:
|
|
51
|
+
input: common.EnumerateActionInputs<TBot>[K];
|
|
52
52
|
}>;
|
|
53
53
|
};
|
|
54
|
-
type _OutgoingCallActionResponses<TBot extends
|
|
55
|
-
[K in keyof
|
|
56
|
-
output:
|
|
54
|
+
type _OutgoingCallActionResponses<TBot extends common.BaseBot> = {
|
|
55
|
+
[K in keyof common.EnumerateActionOutputs<TBot>]: utils.Merge<client.ClientOutputs['callAction'], {
|
|
56
|
+
output: common.EnumerateActionOutputs<TBot>[K];
|
|
57
57
|
}>;
|
|
58
58
|
};
|
|
59
|
-
export type AnyIncomingEvent<TBot extends
|
|
60
|
-
export type AnyIncomingMessage<TBot extends
|
|
61
|
-
export type AnyOutgoingMessageRequest<TBot extends
|
|
62
|
-
export type AnyOutgoingMessageResponse<TBot extends
|
|
63
|
-
export type AnyOutgoingCallActionRequest<TBot extends
|
|
64
|
-
export type AnyOutgoingCallActionResponse<TBot extends
|
|
65
|
-
export type IncomingEvents<TBot extends
|
|
59
|
+
export type AnyIncomingEvent<TBot extends common.BaseBot> = utils.ValueOf<_IncomingEvents<TBot>>;
|
|
60
|
+
export type AnyIncomingMessage<TBot extends common.BaseBot> = utils.ValueOf<_IncomingMessages<TBot>>;
|
|
61
|
+
export type AnyOutgoingMessageRequest<TBot extends common.BaseBot> = utils.ValueOf<_OutgoingMessageRequests<TBot>>;
|
|
62
|
+
export type AnyOutgoingMessageResponse<TBot extends common.BaseBot> = utils.ValueOf<_OutgoingMessageResponses<TBot>>;
|
|
63
|
+
export type AnyOutgoingCallActionRequest<TBot extends common.BaseBot> = utils.ValueOf<_OutgoingCallActionRequests<TBot>>;
|
|
64
|
+
export type AnyOutgoingCallActionResponse<TBot extends common.BaseBot> = utils.ValueOf<_OutgoingCallActionResponses<TBot>>;
|
|
65
|
+
export type IncomingEvents<TBot extends common.BaseBot> = _IncomingEvents<TBot> & {
|
|
66
66
|
'*': AnyIncomingEvent<TBot>;
|
|
67
67
|
};
|
|
68
|
-
export type IncomingMessages<TBot extends
|
|
68
|
+
export type IncomingMessages<TBot extends common.BaseBot> = _IncomingMessages<TBot> & {
|
|
69
69
|
'*': AnyIncomingMessage<TBot>;
|
|
70
70
|
};
|
|
71
|
-
export type IncomingStates<_TBot extends
|
|
71
|
+
export type IncomingStates<_TBot extends common.BaseBot> = _IncomingStates<_TBot> & {
|
|
72
72
|
'*': client.State;
|
|
73
73
|
};
|
|
74
|
-
export type OutgoingMessageRequests<TBot extends
|
|
74
|
+
export type OutgoingMessageRequests<TBot extends common.BaseBot> = _OutgoingMessageRequests<TBot> & {
|
|
75
75
|
'*': AnyOutgoingMessageRequest<TBot>;
|
|
76
76
|
};
|
|
77
|
-
export type OutgoingMessageResponses<TBot extends
|
|
77
|
+
export type OutgoingMessageResponses<TBot extends common.BaseBot> = _OutgoingMessageResponses<TBot> & {
|
|
78
78
|
'*': AnyOutgoingMessageResponse<TBot>;
|
|
79
79
|
};
|
|
80
|
-
export type OutgoingCallActionRequests<TBot extends
|
|
80
|
+
export type OutgoingCallActionRequests<TBot extends common.BaseBot> = _OutgoingCallActionRequests<TBot> & {
|
|
81
81
|
'*': AnyOutgoingCallActionRequest<TBot>;
|
|
82
82
|
};
|
|
83
|
-
export type OutgoingCallActionResponses<TBot extends
|
|
83
|
+
export type OutgoingCallActionResponses<TBot extends common.BaseBot> = _OutgoingCallActionResponses<TBot> & {
|
|
84
84
|
'*': AnyOutgoingCallActionResponse<TBot>;
|
|
85
85
|
};
|
|
86
|
-
export type BotClient<TBot extends
|
|
87
|
-
export type CommonHandlerProps<TBot extends
|
|
86
|
+
export type BotClient<TBot extends common.BaseBot> = BotSpecificClient<TBot>;
|
|
87
|
+
export type CommonHandlerProps<TBot extends common.BaseBot> = {
|
|
88
88
|
ctx: BotContext;
|
|
89
89
|
logger: BotLogger;
|
|
90
90
|
client: BotClient<TBot>;
|
|
91
91
|
};
|
|
92
|
-
export type MessagePayloads<TBot extends
|
|
92
|
+
export type MessagePayloads<TBot extends common.BaseBot> = {
|
|
93
93
|
[K in keyof IncomingMessages<TBot>]: CommonHandlerProps<TBot> & {
|
|
94
94
|
message: IncomingMessages<TBot>[K];
|
|
95
95
|
user: client.User;
|
|
@@ -103,32 +103,32 @@ export type MessagePayloads<TBot extends types.BaseBot> = {
|
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
105
|
};
|
|
106
|
-
export type MessageHandlers<TBot extends
|
|
106
|
+
export type MessageHandlers<TBot extends common.BaseBot> = {
|
|
107
107
|
[K in keyof IncomingMessages<TBot>]: (args: MessagePayloads<TBot>[K]) => Promise<void>;
|
|
108
108
|
};
|
|
109
|
-
export type EventPayloads<TBot extends
|
|
109
|
+
export type EventPayloads<TBot extends common.BaseBot> = {
|
|
110
110
|
[K in keyof IncomingEvents<TBot>]: CommonHandlerProps<TBot> & {
|
|
111
111
|
event: IncomingEvents<TBot>[K];
|
|
112
112
|
};
|
|
113
113
|
};
|
|
114
|
-
export type EventHandlers<TBot extends
|
|
114
|
+
export type EventHandlers<TBot extends common.BaseBot> = {
|
|
115
115
|
[K in keyof IncomingEvents<TBot>]: (args: EventPayloads<TBot>[K]) => Promise<void>;
|
|
116
116
|
};
|
|
117
|
-
export type StateExpiredPayloads<TBot extends
|
|
117
|
+
export type StateExpiredPayloads<TBot extends common.BaseBot> = {
|
|
118
118
|
[K in keyof IncomingStates<TBot>]: CommonHandlerProps<TBot> & {
|
|
119
119
|
state: IncomingStates<TBot>[K];
|
|
120
120
|
};
|
|
121
121
|
};
|
|
122
|
-
export type StateExpiredHandlers<TBot extends
|
|
122
|
+
export type StateExpiredHandlers<TBot extends common.BaseBot> = {
|
|
123
123
|
[K in keyof IncomingStates<TBot>]: (args: StateExpiredPayloads<TBot>[K]) => Promise<void>;
|
|
124
124
|
};
|
|
125
|
-
export type ActionHandlerPayloads<TBot extends
|
|
125
|
+
export type ActionHandlerPayloads<TBot extends common.BaseBot> = {
|
|
126
126
|
[K in keyof TBot['actions']]: CommonHandlerProps<TBot> & {
|
|
127
127
|
type?: K;
|
|
128
128
|
input: TBot['actions'][K]['input'];
|
|
129
129
|
};
|
|
130
130
|
};
|
|
131
|
-
export type ActionHandlers<TBot extends
|
|
131
|
+
export type ActionHandlers<TBot extends common.BaseBot> = {
|
|
132
132
|
[K in keyof TBot['actions']]: (props: ActionHandlerPayloads<TBot>[K]) => Promise<TBot['actions'][K]['output']>;
|
|
133
133
|
};
|
|
134
134
|
type BaseHookDefinition = {
|
|
@@ -145,7 +145,7 @@ type HookDefinition<THookDef extends BaseHookDefinition = BaseHookDefinition> =
|
|
|
145
145
|
* - before_incoming_call_action
|
|
146
146
|
* - after_incoming_call_action
|
|
147
147
|
*/
|
|
148
|
-
export type HookDefinitions<TBot extends
|
|
148
|
+
export type HookDefinitions<TBot extends common.BaseBot> = {
|
|
149
149
|
before_incoming_event: HookDefinition<{
|
|
150
150
|
stoppable: true;
|
|
151
151
|
data: _IncomingEvents<TBot> & {
|
|
@@ -195,19 +195,19 @@ export type HookDefinitions<TBot extends types.BaseBot> = {
|
|
|
195
195
|
};
|
|
196
196
|
}>;
|
|
197
197
|
};
|
|
198
|
-
export type HookData<TBot extends
|
|
198
|
+
export type HookData<TBot extends common.BaseBot> = {
|
|
199
199
|
[H in keyof HookDefinitions<TBot>]: {
|
|
200
200
|
[T in keyof HookDefinitions<TBot>[H]['data']]: HookDefinitions<TBot>[H]['data'][T];
|
|
201
201
|
};
|
|
202
202
|
};
|
|
203
|
-
export type HookInputs<TBot extends
|
|
203
|
+
export type HookInputs<TBot extends common.BaseBot> = {
|
|
204
204
|
[H in keyof HookData<TBot>]: {
|
|
205
205
|
[T in keyof HookData<TBot>[H]]: CommonHandlerProps<TBot> & {
|
|
206
206
|
data: HookData<TBot>[H][T];
|
|
207
207
|
};
|
|
208
208
|
};
|
|
209
209
|
};
|
|
210
|
-
export type HookOutputs<TBot extends
|
|
210
|
+
export type HookOutputs<TBot extends common.BaseBot> = {
|
|
211
211
|
[H in keyof HookData<TBot>]: {
|
|
212
212
|
[T in keyof HookData<TBot>[H]]: {
|
|
213
213
|
data?: HookData<TBot>[H][T];
|
|
@@ -216,21 +216,21 @@ export type HookOutputs<TBot extends types.BaseBot> = {
|
|
|
216
216
|
} : {});
|
|
217
217
|
};
|
|
218
218
|
};
|
|
219
|
-
export type HookHandlers<TBot extends
|
|
219
|
+
export type HookHandlers<TBot extends common.BaseBot> = {
|
|
220
220
|
[H in keyof HookData<TBot>]: {
|
|
221
221
|
[T in keyof HookData<TBot>[H]]: (input: HookInputs<TBot>[H][T]) => Promise<HookOutputs<TBot>[H][T] | undefined>;
|
|
222
222
|
};
|
|
223
223
|
};
|
|
224
|
-
export type MessageHandlersMap<TBot extends
|
|
224
|
+
export type MessageHandlersMap<TBot extends common.BaseBot> = {
|
|
225
225
|
[T in keyof IncomingMessages<TBot>]?: MessageHandlers<TBot>[T][];
|
|
226
226
|
};
|
|
227
|
-
export type EventHandlersMap<TBot extends
|
|
227
|
+
export type EventHandlersMap<TBot extends common.BaseBot> = {
|
|
228
228
|
[T in keyof IncomingEvents<TBot>]?: EventHandlers<TBot>[T][];
|
|
229
229
|
};
|
|
230
|
-
export type StateExpiredHandlersMap<TBot extends
|
|
230
|
+
export type StateExpiredHandlersMap<TBot extends common.BaseBot> = {
|
|
231
231
|
[T in keyof IncomingStates<TBot>]?: StateExpiredHandlers<TBot>[T][];
|
|
232
232
|
};
|
|
233
|
-
export type HookHandlersMap<TBot extends
|
|
233
|
+
export type HookHandlersMap<TBot extends common.BaseBot> = {
|
|
234
234
|
[H in keyof HookData<TBot>]: {
|
|
235
235
|
[T in keyof HookData<TBot>[H]]?: HookHandlers<TBot>[H][T][];
|
|
236
236
|
};
|
|
@@ -240,21 +240,21 @@ export type HookHandlersMap<TBot extends types.BaseBot> = {
|
|
|
240
240
|
* the consumer of this type shouldnt be able to access "*" directly;
|
|
241
241
|
* "*" is meant the user who registers an handler, not for the user who calls the handler
|
|
242
242
|
*/
|
|
243
|
-
export type BotHandlers<TBot extends
|
|
243
|
+
export type BotHandlers<TBot extends common.BaseBot> = {
|
|
244
244
|
actionHandlers: ActionHandlers<TBot>;
|
|
245
245
|
messageHandlers: MessageHandlersMap<TBot>;
|
|
246
246
|
eventHandlers: EventHandlersMap<TBot>;
|
|
247
247
|
stateExpiredHandlers: StateExpiredHandlersMap<TBot>;
|
|
248
248
|
hookHandlers: HookHandlersMap<TBot>;
|
|
249
249
|
};
|
|
250
|
-
type ImplementedActions<_TBot extends
|
|
250
|
+
type ImplementedActions<_TBot extends common.BaseBot, TPlugins extends Record<string, plugin.BasePlugin>> = utils.UnionToIntersection<utils.ValueOf<{
|
|
251
251
|
[K in keyof TPlugins]: TPlugins[K]['actions'];
|
|
252
252
|
}>>;
|
|
253
|
-
type UnimplementedActions<TBot extends
|
|
254
|
-
export type ImplementedActionHandlers<TBot extends
|
|
253
|
+
type UnimplementedActions<TBot extends common.BaseBot, TPlugins extends Record<string, plugin.BasePlugin>> = Omit<TBot['actions'], keyof ImplementedActions<TBot, TPlugins>>;
|
|
254
|
+
export type ImplementedActionHandlers<TBot extends common.BaseBot, TPlugins extends Record<string, plugin.BasePlugin>> = {
|
|
255
255
|
[K in keyof ImplementedActions<TBot, TPlugins>]: ActionHandlers<TBot>[utils.Cast<K, keyof ActionHandlers<TBot>>];
|
|
256
256
|
};
|
|
257
|
-
export type UnimplementedActionHandlers<TBot extends
|
|
257
|
+
export type UnimplementedActionHandlers<TBot extends common.BaseBot, TPlugins extends Record<string, plugin.BasePlugin>> = {
|
|
258
258
|
[K in keyof UnimplementedActions<TBot, TPlugins>]: ActionHandlers<TBot>[utils.Cast<K, keyof ActionHandlers<TBot>>];
|
|
259
259
|
};
|
|
260
260
|
export {};
|
package/dist/fixtures.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DefaultBot } from './bot/
|
|
2
|
-
import { DefaultChannel, DefaultIntegration } from './integration/
|
|
3
|
-
import { DefaultPlugin } from './plugin/
|
|
1
|
+
import { DefaultBot } from './bot/common/generic';
|
|
2
|
+
import { DefaultChannel, DefaultIntegration } from './integration/common/generic';
|
|
3
|
+
import { DefaultPlugin } from './plugin/common/generic';
|
|
4
4
|
type _FooBarBazIntegration = {
|
|
5
5
|
actions: {
|
|
6
6
|
doFoo: {
|
|
@@ -46,6 +46,20 @@ type _FooBarBazIntegration = {
|
|
|
46
46
|
foo: string;
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
+
message: {
|
|
50
|
+
tags: {
|
|
51
|
+
fooMessageTag1: '';
|
|
52
|
+
fooMessageTag2: '';
|
|
53
|
+
fooMessageTag3: '';
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
conversation: {
|
|
57
|
+
tags: {
|
|
58
|
+
fooConversationTag1: '';
|
|
59
|
+
fooConversationTag2: '';
|
|
60
|
+
fooConversationTag3: '';
|
|
61
|
+
};
|
|
62
|
+
};
|
|
49
63
|
}>;
|
|
50
64
|
channelBar: DefaultChannel<{
|
|
51
65
|
messages: {
|
|
@@ -53,6 +67,20 @@ type _FooBarBazIntegration = {
|
|
|
53
67
|
bar: number;
|
|
54
68
|
};
|
|
55
69
|
};
|
|
70
|
+
message: {
|
|
71
|
+
tags: {
|
|
72
|
+
barMessageTag1: '';
|
|
73
|
+
barMessageTag2: '';
|
|
74
|
+
barMessageTag3: '';
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
conversation: {
|
|
78
|
+
tags: {
|
|
79
|
+
barConversationTag1: '';
|
|
80
|
+
barConversationTag2: '';
|
|
81
|
+
barConversationTag3: '';
|
|
82
|
+
};
|
|
83
|
+
};
|
|
56
84
|
}>;
|
|
57
85
|
channelBaz: DefaultChannel<{
|
|
58
86
|
messages: {
|
|
@@ -60,8 +88,29 @@ type _FooBarBazIntegration = {
|
|
|
60
88
|
baz: boolean;
|
|
61
89
|
};
|
|
62
90
|
};
|
|
91
|
+
message: {
|
|
92
|
+
tags: {
|
|
93
|
+
bazMessageTag1: '';
|
|
94
|
+
bazMessageTag2: '';
|
|
95
|
+
bazMessageTag3: '';
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
conversation: {
|
|
99
|
+
tags: {
|
|
100
|
+
bazConversationTag1: '';
|
|
101
|
+
bazConversationTag2: '';
|
|
102
|
+
bazConversationTag3: '';
|
|
103
|
+
};
|
|
104
|
+
};
|
|
63
105
|
}>;
|
|
64
106
|
};
|
|
107
|
+
user: {
|
|
108
|
+
tags: {
|
|
109
|
+
fooUserTag1: '';
|
|
110
|
+
fooUserTag2: '';
|
|
111
|
+
fooUserTag3: '';
|
|
112
|
+
};
|
|
113
|
+
};
|
|
65
114
|
};
|
|
66
115
|
type _TotoTutuTataInterface = {
|
|
67
116
|
actions: {
|