@botpress/sdk 4.9.0 → 4.10.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
2
|
import { BaseIntegration } from './common';
|
|
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 { RegisterHandler as RegisterFunction, UnregisterHandler as UnregisterFunction, WebhookHandler as WebhookFunction, CreateUserHandler as CreateUserFunction, CreateConversationHandler as CreateConversationFunction, ActionHandlers as ActionFunctions, ChannelHandlers as ChannelFunctions, IntegrationOperationHandler as IntegrationOperationFunction } from './server';
|
|
4
4
|
export type IntegrationImplementationProps<TIntegration extends BaseIntegration = BaseIntegration> = {
|
|
5
5
|
register: RegisterFunction<TIntegration>;
|
|
6
6
|
unregister: UnregisterFunction<TIntegration>;
|
|
@@ -15,6 +15,9 @@ export type IntegrationImplementationProps<TIntegration extends BaseIntegration
|
|
|
15
15
|
createConversation?: CreateConversationFunction<TIntegration>;
|
|
16
16
|
actions: ActionFunctions<TIntegration>;
|
|
17
17
|
channels: ChannelFunctions<TIntegration>;
|
|
18
|
+
__advanced?: {
|
|
19
|
+
integrationOperationHandler?: IntegrationOperationFunction<TIntegration>;
|
|
20
|
+
};
|
|
18
21
|
};
|
|
19
22
|
export declare class IntegrationImplementation<TIntegration extends BaseIntegration = BaseIntegration> {
|
|
20
23
|
readonly props: IntegrationImplementationProps<TIntegration>;
|
|
@@ -25,6 +28,7 @@ export declare class IntegrationImplementation<TIntegration extends BaseIntegrat
|
|
|
25
28
|
readonly createUser: IntegrationImplementationProps<TIntegration>['createUser'];
|
|
26
29
|
readonly createConversation: IntegrationImplementationProps<TIntegration>['createConversation'];
|
|
27
30
|
readonly webhook: IntegrationImplementationProps<TIntegration>['handler'];
|
|
31
|
+
readonly integrationOperationHandler: NonNullable<IntegrationImplementationProps<TIntegration>['__advanced']>['integrationOperationHandler'];
|
|
28
32
|
constructor(props: IntegrationImplementationProps<TIntegration>);
|
|
29
33
|
readonly handler: (req: import("../serve").Request) => Promise<import("../serve").Response | void>;
|
|
30
34
|
readonly start: (port?: number) => Promise<Server>;
|
|
@@ -90,6 +90,9 @@ export type ChannelHandlers<TIntegration extends BaseIntegration> = {
|
|
|
90
90
|
};
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
|
+
export type IntegrationOperationHandler<TIntegration extends BaseIntegration> = (props: CommonHandlerProps<TIntegration> & {
|
|
94
|
+
req: Request;
|
|
95
|
+
}) => Promise<Response | void>;
|
|
93
96
|
export type IntegrationHandlers<TIntegration extends BaseIntegration> = {
|
|
94
97
|
register: RegisterHandler<TIntegration>;
|
|
95
98
|
unregister: UnregisterHandler<TIntegration>;
|
|
@@ -98,5 +101,6 @@ export type IntegrationHandlers<TIntegration extends BaseIntegration> = {
|
|
|
98
101
|
createConversation?: CreateConversationHandler<TIntegration>;
|
|
99
102
|
actions: ActionHandlers<TIntegration>;
|
|
100
103
|
channels: ChannelHandlers<TIntegration>;
|
|
104
|
+
integrationOperationHandler?: IntegrationOperationHandler<TIntegration>;
|
|
101
105
|
};
|
|
102
106
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.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": "1.15.
|
|
19
|
+
"@botpress/client": "1.15.3",
|
|
20
20
|
"browser-or-node": "^2.1.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|