@botpress/sdk 6.8.0 → 6.9.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 +5 -5
- package/dist/bot/server/types.d.ts +20 -1
- package/dist/index.cjs +18 -18
- package/dist/index.cjs.map +3 -3
- package/dist/index.mjs +13 -13
- package/dist/index.mjs.map +3 -3
- package/dist/plugin/conversation-proxy/types.d.ts +1 -1
- package/dist/plugin/server/types.d.ts +76 -28
- package/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/sdk@6.
|
|
2
|
+
> @botpress/sdk@6.9.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@6.
|
|
6
|
+
> @botpress/sdk@6.9.0 build:type /home/runner/work/botpress/botpress/packages/sdk
|
|
7
7
|
> tsc -p ./tsconfig.package.json --emitDeclarationOnly --declaration
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @botpress/sdk@6.
|
|
10
|
+
> @botpress/sdk@6.9.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@6.
|
|
15
|
+
> @botpress/sdk@6.9.0 build:browser /home/runner/work/botpress/botpress/packages/sdk
|
|
16
16
|
> ts-node -T ./build.ts --browser
|
|
17
17
|
|
|
18
|
-
(node:
|
|
18
|
+
(node:3352) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
|
19
19
|
(Use `node --trace-deprecation ...` to show where the warning was created)
|
|
20
20
|
Done
|
|
@@ -190,6 +190,12 @@ export type WorkflowHandlers<TBot extends common.BaseBot> = {
|
|
|
190
190
|
type BaseHookDefinition = {
|
|
191
191
|
stoppable?: boolean;
|
|
192
192
|
data: any;
|
|
193
|
+
/**
|
|
194
|
+
* Per-hook-type extra props injected into the hook handler input. Only set
|
|
195
|
+
* for hooks where the bot runtime already has the relevant context (e.g.
|
|
196
|
+
* incoming message hooks).
|
|
197
|
+
*/
|
|
198
|
+
extraInputs?: object;
|
|
193
199
|
};
|
|
194
200
|
type HookDefinition<THookDef extends BaseHookDefinition = BaseHookDefinition> = THookDef;
|
|
195
201
|
/**
|
|
@@ -211,6 +217,10 @@ export type HookDefinitions<TBot extends common.BaseBot> = {
|
|
|
211
217
|
data: _IncomingMessages<TBot> & {
|
|
212
218
|
'*': AnyIncomingMessage<TBot>;
|
|
213
219
|
};
|
|
220
|
+
extraInputs: {
|
|
221
|
+
user?: client.User;
|
|
222
|
+
conversation?: client.Conversation;
|
|
223
|
+
};
|
|
214
224
|
}>;
|
|
215
225
|
before_outgoing_message: HookDefinition<{
|
|
216
226
|
stoppable: false;
|
|
@@ -241,6 +251,10 @@ export type HookDefinitions<TBot extends common.BaseBot> = {
|
|
|
241
251
|
data: _IncomingMessages<TBot> & {
|
|
242
252
|
'*': AnyIncomingMessage<TBot>;
|
|
243
253
|
};
|
|
254
|
+
extraInputs: {
|
|
255
|
+
user?: client.User;
|
|
256
|
+
conversation?: client.Conversation;
|
|
257
|
+
};
|
|
244
258
|
}>;
|
|
245
259
|
after_outgoing_message: HookDefinition<{
|
|
246
260
|
stoppable: false;
|
|
@@ -266,9 +280,14 @@ export type HookData<TBot extends common.BaseBot> = {
|
|
|
266
280
|
[THookDataName in utils.StringKeys<HookDefinitions<TBot>[THookType]['data']>]: HookDefinitions<TBot>[THookType]['data'][THookDataName];
|
|
267
281
|
};
|
|
268
282
|
};
|
|
283
|
+
type _HookExtraInputs<TBot extends common.BaseBot> = {
|
|
284
|
+
[THookType in utils.StringKeys<HookDefinitions<TBot>>]: HookDefinitions<TBot>[THookType] extends {
|
|
285
|
+
extraInputs: infer T;
|
|
286
|
+
} ? T : {};
|
|
287
|
+
};
|
|
269
288
|
export type HookInputs<TBot extends common.BaseBot> = {
|
|
270
289
|
[THookType in utils.StringKeys<HookData<TBot>>]: {
|
|
271
|
-
[THookDataName in utils.StringKeys<HookData<TBot>[THookType]>]: ExtendedHandlerProps<TBot> & {
|
|
290
|
+
[THookDataName in utils.StringKeys<HookData<TBot>[THookType]>]: ExtendedHandlerProps<TBot> & _HookExtraInputs<TBot>[THookType] & {
|
|
272
291
|
data: HookData<TBot>[THookType][THookDataName];
|
|
273
292
|
};
|
|
274
293
|
};
|