@holocronlab/botruntime-sdk 6.13.3
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/LICENSE +8 -0
- package/dist/base-logger.d.ts +34 -0
- package/dist/base-logger.test.d.ts +1 -0
- package/dist/bot/bot-logger.d.ts +18 -0
- package/dist/bot/client/index.d.ts +80 -0
- package/dist/bot/client/types.d.ts +254 -0
- package/dist/bot/client/types.test.d.ts +1 -0
- package/dist/bot/common/generic.d.ts +41 -0
- package/dist/bot/common/generic.test.d.ts +1 -0
- package/dist/bot/common/index.d.ts +2 -0
- package/dist/bot/common/types.d.ts +54 -0
- package/dist/bot/common/types.test.d.ts +1 -0
- package/dist/bot/definition.d.ts +214 -0
- package/dist/bot/definition.test.d.ts +1 -0
- package/dist/bot/implementation.d.ts +72 -0
- package/dist/bot/implementation.test.d.ts +1 -0
- package/dist/bot/index.d.ts +6 -0
- package/dist/bot/server/context.d.ts +2 -0
- package/dist/bot/server/index.d.ts +5 -0
- package/dist/bot/server/responses.d.ts +3 -0
- package/dist/bot/server/types.d.ts +423 -0
- package/dist/bot/server/types.test.d.ts +1 -0
- package/dist/bot/server/workflows/update-handler.d.ts +3 -0
- package/dist/bot/server/workflows/update-type-conv.d.ts +2 -0
- package/dist/bot/workflow-proxy/index.d.ts +2 -0
- package/dist/bot/workflow-proxy/proxy.d.ts +17 -0
- package/dist/bot/workflow-proxy/types.d.ts +80 -0
- package/dist/bot/workflow-proxy/types.test.d.ts +1 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/recurring-events.d.ts +9 -0
- package/dist/common/recurring-events.test.d.ts +1 -0
- package/dist/common/types.d.ts +8 -0
- package/dist/consts.d.ts +11 -0
- package/dist/errors.d.ts +19 -0
- package/dist/fixtures.d.ts +357 -0
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.mjs +34 -0
- package/dist/index.mjs.map +7 -0
- package/dist/integration/client/index.d.ts +55 -0
- package/dist/integration/client/sub-types.d.ts +27 -0
- package/dist/integration/client/sub-types.test.d.ts +1 -0
- package/dist/integration/client/types.d.ts +209 -0
- package/dist/integration/client/types.test.d.ts +1 -0
- package/dist/integration/common/generic.d.ts +57 -0
- package/dist/integration/common/generic.test.d.ts +1 -0
- package/dist/integration/common/index.d.ts +1 -0
- package/dist/integration/definition/branded-schema.d.ts +21 -0
- package/dist/integration/definition/definition.test.d.ts +1 -0
- package/dist/integration/definition/generic.d.ts +9 -0
- package/dist/integration/definition/index.d.ts +130 -0
- package/dist/integration/definition/types.d.ts +119 -0
- package/dist/integration/implementation.d.ts +37 -0
- package/dist/integration/index.d.ts +5 -0
- package/dist/integration/server/action-metadata.d.ts +9 -0
- package/dist/integration/server/context.d.ts +4 -0
- package/dist/integration/server/index.d.ts +6 -0
- package/dist/integration/server/integration-logger.d.ts +36 -0
- package/dist/integration/server/types.d.ts +108 -0
- package/dist/interface/common/generic.d.ts +34 -0
- package/dist/interface/common/generic.test.d.ts +1 -0
- package/dist/interface/common/index.d.ts +1 -0
- package/dist/interface/definition.d.ts +87 -0
- package/dist/interface/index.d.ts +2 -0
- package/dist/interface/resolve.d.ts +18 -0
- package/dist/log.d.ts +7 -0
- package/dist/message.d.ts +742 -0
- package/dist/package.d.ts +64 -0
- package/dist/plugin/action-proxy/index.d.ts +2 -0
- package/dist/plugin/action-proxy/proxy.d.ts +5 -0
- package/dist/plugin/action-proxy/types.d.ts +14 -0
- package/dist/plugin/action-proxy/types.test.d.ts +1 -0
- package/dist/plugin/common/generic.d.ts +63 -0
- package/dist/plugin/common/generic.test.d.ts +1 -0
- package/dist/plugin/common/index.d.ts +2 -0
- package/dist/plugin/common/types.d.ts +59 -0
- package/dist/plugin/conversation-proxy/index.d.ts +2 -0
- package/dist/plugin/conversation-proxy/proxy.d.ts +13 -0
- package/dist/plugin/conversation-proxy/types.d.ts +54 -0
- package/dist/plugin/conversation-proxy/types.test.d.ts +1 -0
- package/dist/plugin/definition.d.ts +152 -0
- package/dist/plugin/definition.test.d.ts +1 -0
- package/dist/plugin/event-proxy/index.d.ts +2 -0
- package/dist/plugin/event-proxy/proxy.d.ts +5 -0
- package/dist/plugin/event-proxy/types.d.ts +19 -0
- package/dist/plugin/event-proxy/types.test.d.ts +1 -0
- package/dist/plugin/implementation.d.ts +71 -0
- package/dist/plugin/implementation.test.d.ts +1 -0
- package/dist/plugin/index.d.ts +4 -0
- package/dist/plugin/message-proxy/index.d.ts +2 -0
- package/dist/plugin/message-proxy/proxy.d.ts +13 -0
- package/dist/plugin/message-proxy/types.d.ts +22 -0
- package/dist/plugin/server/index.d.ts +1 -0
- package/dist/plugin/server/types.d.ts +505 -0
- package/dist/plugin/server/types.test.d.ts +1 -0
- package/dist/plugin/state-proxy/index.d.ts +2 -0
- package/dist/plugin/state-proxy/proxy.d.ts +5 -0
- package/dist/plugin/state-proxy/types.d.ts +29 -0
- package/dist/plugin/state-proxy/types.test.d.ts +1 -0
- package/dist/plugin/tag-prefixer.d.ts +10 -0
- package/dist/plugin/tag-prefixer.test.d.ts +1 -0
- package/dist/plugin/user-proxy/index.d.ts +2 -0
- package/dist/plugin/user-proxy/proxy.d.ts +14 -0
- package/dist/plugin/user-proxy/types.d.ts +30 -0
- package/dist/public-consts.d.ts +9 -0
- package/dist/retry.d.ts +2 -0
- package/dist/retry.test.d.ts +1 -0
- package/dist/schema.d.ts +18 -0
- package/dist/serve.d.ts +38 -0
- package/dist/utils/api-paging-utils.d.ts +43 -0
- package/dist/utils/api-paging-utils.test.d.ts +1 -0
- package/dist/utils/array-utils.d.ts +2 -0
- package/dist/utils/error-utils.d.ts +4 -0
- package/dist/utils/function-utils.d.ts +2 -0
- package/dist/utils/function-utils.test.d.ts +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/record-utils.d.ts +6 -0
- package/dist/utils/record-utils.test.d.ts +1 -0
- package/dist/utils/type-utils.d.ts +63 -0
- package/dist/utils/type-utils.test.d.ts +1 -0
- package/dist/version-utils.d.ts +18 -0
- package/dist/version.d.ts +1 -0
- package/dist/zui.d.ts +9 -0
- package/package.json +59 -0
- package/readme.md +11 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { Table } from '@holocronlab/botruntime-client';
|
|
2
|
+
import { SchemaTransformOptions } from '../common/types';
|
|
3
|
+
import { IntegrationPackage, PluginPackage } from '../package';
|
|
4
|
+
import { PluginInterfaceExtension, PluginIntegrationExtension } from '../plugin';
|
|
5
|
+
import { SchemaDefinition } from '../schema';
|
|
6
|
+
import { ValueOf, Merge, StringKeys } from '../utils/type-utils';
|
|
7
|
+
import { z } from '../zui';
|
|
8
|
+
type BaseConfig = z.ZuiObjectSchema;
|
|
9
|
+
type BaseStates = Record<string, z.ZuiObjectOrRefSchema>;
|
|
10
|
+
type BaseEvents = Record<string, z.ZuiObjectOrRefSchema>;
|
|
11
|
+
type BaseActions = Record<string, z.ZuiObjectOrRefSchema>;
|
|
12
|
+
type BaseTables = Record<string, z.ZuiObjectOrRefSchema>;
|
|
13
|
+
type BaseWorkflows = Record<string, z.ZuiObjectSchema>;
|
|
14
|
+
export type TagDefinition = {
|
|
15
|
+
title?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
};
|
|
18
|
+
export type StateType = 'conversation' | 'user' | 'bot' | 'workflow';
|
|
19
|
+
export type StateDefinition<TState extends BaseStates[string] = BaseStates[string]> = SchemaDefinition<TState> & {
|
|
20
|
+
type: StateType;
|
|
21
|
+
expiry?: number;
|
|
22
|
+
};
|
|
23
|
+
export type RecurringEventDefinition<TEvents extends BaseEvents = BaseEvents> = {
|
|
24
|
+
[K in keyof TEvents]: {
|
|
25
|
+
type: K;
|
|
26
|
+
payload: z.infer<TEvents[K]>;
|
|
27
|
+
schedule: {
|
|
28
|
+
cron: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}[keyof TEvents];
|
|
32
|
+
export type EventDefinition<TEvent extends BaseEvents[string] = BaseEvents[string]> = SchemaDefinition<TEvent> & {
|
|
33
|
+
recurrence?: {
|
|
34
|
+
cron: string;
|
|
35
|
+
payload: z.input<TEvent>;
|
|
36
|
+
};
|
|
37
|
+
attributes?: Record<string, string>;
|
|
38
|
+
};
|
|
39
|
+
export type ConfigurationDefinition<TConfig extends BaseConfig = BaseConfig> = SchemaDefinition<TConfig>;
|
|
40
|
+
export type UserDefinition = {
|
|
41
|
+
tags?: Record<string, TagDefinition>;
|
|
42
|
+
};
|
|
43
|
+
export type ConversationDefinition = {
|
|
44
|
+
tags?: Record<string, TagDefinition>;
|
|
45
|
+
};
|
|
46
|
+
export type MessageDefinition = {
|
|
47
|
+
tags?: Record<string, TagDefinition>;
|
|
48
|
+
};
|
|
49
|
+
export type SecretDefinition = {
|
|
50
|
+
optional?: boolean;
|
|
51
|
+
description?: string;
|
|
52
|
+
};
|
|
53
|
+
export type ActionDefinition<TAction extends BaseActions[string] = BaseActions[string]> = {
|
|
54
|
+
title?: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
input: SchemaDefinition<TAction>;
|
|
57
|
+
output: SchemaDefinition<z.ZuiObjectOrRefSchema>;
|
|
58
|
+
attributes?: Record<string, string>;
|
|
59
|
+
};
|
|
60
|
+
export type WorkflowDefinition<TWorkflow extends BaseWorkflows[string] = BaseWorkflows[string]> = {
|
|
61
|
+
title?: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
input: SchemaDefinition<TWorkflow>;
|
|
64
|
+
output: SchemaDefinition<z.ZuiObjectSchema>;
|
|
65
|
+
tags?: Record<string, TagDefinition>;
|
|
66
|
+
};
|
|
67
|
+
export type TableDefinition<TTable extends BaseTables[string] = BaseTables[string]> = Merge<Omit<Table, 'id' | 'createdAt' | 'updatedAt' | 'name'>, {
|
|
68
|
+
schema: TTable;
|
|
69
|
+
}>;
|
|
70
|
+
export type ResolvedIntegrationConfigInstance<I extends IntegrationPackage = IntegrationPackage> = {
|
|
71
|
+
enabled?: boolean;
|
|
72
|
+
alias: string;
|
|
73
|
+
disabledChannels?: StringKeys<NonNullable<I['definition']['channels']>>[];
|
|
74
|
+
} & ({
|
|
75
|
+
configurationType?: null;
|
|
76
|
+
configuration: z.input<NonNullable<I['definition']['configuration']>['schema']>;
|
|
77
|
+
} | ValueOf<{
|
|
78
|
+
[K in StringKeys<NonNullable<I['definition']['configurations']>>]: {
|
|
79
|
+
configurationType: K;
|
|
80
|
+
configuration: z.input<NonNullable<I['definition']['configurations']>[K]['schema']>;
|
|
81
|
+
};
|
|
82
|
+
}>);
|
|
83
|
+
type IntegrationConfigInstance<I extends IntegrationPackage = IntegrationPackage> = Omit<ResolvedIntegrationConfigInstance<I>, 'alias'> & {
|
|
84
|
+
alias?: string;
|
|
85
|
+
};
|
|
86
|
+
type _ResolvedPluginConfigInstance<P extends PluginPackage = PluginPackage> = {
|
|
87
|
+
alias: string;
|
|
88
|
+
configuration: z.input<NonNullable<P['definition']['configuration']>['schema']>;
|
|
89
|
+
interfaces: {
|
|
90
|
+
[I in keyof NonNullable<P['definition']['interfaces']>]: PluginInterfaceExtension;
|
|
91
|
+
};
|
|
92
|
+
integrations: {
|
|
93
|
+
[I in keyof NonNullable<P['definition']['integrations']>]: PluginIntegrationExtension;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
type PluginConfigInstance<P extends PluginPackage = PluginPackage> = Omit<_ResolvedPluginConfigInstance<P>, 'alias' | 'integrations' | 'interfaces'> & {
|
|
97
|
+
alias?: string;
|
|
98
|
+
/** Backing integrations for the plugin's dependencies */
|
|
99
|
+
dependencies: {
|
|
100
|
+
[K in StringKeys<NonNullable<P['definition']['interfaces']>>]: {
|
|
101
|
+
/**
|
|
102
|
+
* Alias of the integration to use to fullfil this dependency.
|
|
103
|
+
*
|
|
104
|
+
* This is the alias given when adding the integration to the bot
|
|
105
|
+
* via `addIntegration()`.
|
|
106
|
+
*/
|
|
107
|
+
integrationAlias: string;
|
|
108
|
+
/**
|
|
109
|
+
* Alias of the interface within the integration.
|
|
110
|
+
*
|
|
111
|
+
* This is the alias defined by the integration package for the
|
|
112
|
+
* interface it implements.
|
|
113
|
+
*/
|
|
114
|
+
integrationInterfaceAlias: string;
|
|
115
|
+
};
|
|
116
|
+
} & {
|
|
117
|
+
[K in StringKeys<NonNullable<P['definition']['integrations']>>]: {
|
|
118
|
+
/**
|
|
119
|
+
* Alias of the integration to use to fullfil this dependency.
|
|
120
|
+
*
|
|
121
|
+
* This is the alias given when adding the integration to the bot
|
|
122
|
+
* via `addIntegration()`.
|
|
123
|
+
*/
|
|
124
|
+
integrationAlias: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
export type IntegrationInstance = IntegrationPackage & ResolvedIntegrationConfigInstance;
|
|
129
|
+
export type PluginInstance = PluginPackage & _ResolvedPluginConfigInstance;
|
|
130
|
+
export type BotDefinitionProps<TStates extends BaseStates = BaseStates, TEvents extends BaseEvents = BaseEvents, TActions extends BaseActions = BaseActions, TTables extends BaseTables = BaseTables, TWorkflows extends BaseWorkflows = BaseWorkflows> = {
|
|
131
|
+
integrations?: {
|
|
132
|
+
[K: string]: IntegrationInstance;
|
|
133
|
+
};
|
|
134
|
+
plugins?: {
|
|
135
|
+
[K: string]: PluginInstance;
|
|
136
|
+
};
|
|
137
|
+
user?: UserDefinition;
|
|
138
|
+
conversation?: ConversationDefinition;
|
|
139
|
+
message?: MessageDefinition;
|
|
140
|
+
states?: {
|
|
141
|
+
[K in keyof TStates]: StateDefinition<TStates[K]>;
|
|
142
|
+
};
|
|
143
|
+
configuration?: ConfigurationDefinition;
|
|
144
|
+
events?: {
|
|
145
|
+
[K in keyof TEvents]: EventDefinition<TEvents[K]>;
|
|
146
|
+
};
|
|
147
|
+
/** @deprecated Use the `recurrence` field on each event in `events` instead. */
|
|
148
|
+
recurringEvents?: Record<string, RecurringEventDefinition<TEvents>>;
|
|
149
|
+
actions?: {
|
|
150
|
+
[K in keyof TActions]: ActionDefinition<TActions[K]>;
|
|
151
|
+
};
|
|
152
|
+
tables?: {
|
|
153
|
+
[K in keyof TTables]: TableDefinition<TTables[K]>;
|
|
154
|
+
};
|
|
155
|
+
secrets?: Record<string, SecretDefinition>;
|
|
156
|
+
/**
|
|
157
|
+
* # EXPERIMENTAL
|
|
158
|
+
* This API is experimental and may change in the future.
|
|
159
|
+
*/
|
|
160
|
+
workflows?: {
|
|
161
|
+
[K in keyof TWorkflows]: WorkflowDefinition<TWorkflows[K]>;
|
|
162
|
+
};
|
|
163
|
+
attributes?: Record<string, string>;
|
|
164
|
+
__advanced?: SchemaTransformOptions;
|
|
165
|
+
};
|
|
166
|
+
export declare class BotDefinition<TStates extends BaseStates = BaseStates, TEvents extends BaseEvents = BaseEvents, TActions extends BaseActions = BaseActions, TTables extends BaseTables = BaseTables, TWorkflows extends BaseWorkflows = BaseWorkflows> {
|
|
167
|
+
readonly props: BotDefinitionProps<TStates, TEvents, TActions, TTables, TWorkflows>;
|
|
168
|
+
readonly integrations: this['props']['integrations'];
|
|
169
|
+
readonly plugins: this['props']['plugins'];
|
|
170
|
+
readonly user: this['props']['user'];
|
|
171
|
+
readonly conversation: this['props']['conversation'];
|
|
172
|
+
readonly message: this['props']['message'];
|
|
173
|
+
readonly states: this['props']['states'];
|
|
174
|
+
readonly configuration: this['props']['configuration'];
|
|
175
|
+
readonly events: this['props']['events'];
|
|
176
|
+
readonly recurringEvents: this['props']['recurringEvents'];
|
|
177
|
+
readonly actions: this['props']['actions'];
|
|
178
|
+
readonly tables: this['props']['tables'];
|
|
179
|
+
readonly secrets: this['props']['secrets'];
|
|
180
|
+
readonly workflows: this['props']['workflows'];
|
|
181
|
+
readonly attributes: this['props']['attributes'];
|
|
182
|
+
readonly __advanced: this['props']['__advanced'];
|
|
183
|
+
/** Bot definition with plugins merged into it */
|
|
184
|
+
readonly withPlugins: Pick<this['props'], 'user' | 'conversation' | 'message' | 'states' | 'events' | 'recurringEvents' | 'actions' | 'tables' | 'workflows'>;
|
|
185
|
+
constructor(props: BotDefinitionProps<TStates, TEvents, TActions, TTables, TWorkflows>);
|
|
186
|
+
get metadata(): {
|
|
187
|
+
readonly sdkVersion: string;
|
|
188
|
+
};
|
|
189
|
+
readonly clone?: (overrides?: Partial<BotDefinitionProps>) => BotDefinition;
|
|
190
|
+
addIntegration<I extends IntegrationPackage>(integrationPkg: I, config?: IntegrationConfigInstance<I>): this;
|
|
191
|
+
addPlugin<P extends PluginPackage>(pluginPkg: P, config: PluginConfigInstance<P>): this;
|
|
192
|
+
private _mergeUser;
|
|
193
|
+
private _mergeConversation;
|
|
194
|
+
private _mergeMessage;
|
|
195
|
+
private _mergeStates;
|
|
196
|
+
private _mergeEvents;
|
|
197
|
+
private _mergeRecurringEvents;
|
|
198
|
+
private _mergeActions;
|
|
199
|
+
private _mergeTables;
|
|
200
|
+
private _mergeWorkflows;
|
|
201
|
+
private _prefixKeysWithPluginAlias;
|
|
202
|
+
/**
|
|
203
|
+
* Returns a copy of the bot definition where all interface entity references
|
|
204
|
+
* are resolved to the base entity schema as extended by the backing
|
|
205
|
+
* integration.
|
|
206
|
+
*/
|
|
207
|
+
dereferencePluginEntities(): this;
|
|
208
|
+
private _buildZuiReferenceMap;
|
|
209
|
+
private _dereferenceZuiSchema;
|
|
210
|
+
private _dereferenceDefinitionSchemas;
|
|
211
|
+
private _dereferenceDefinitionSchema;
|
|
212
|
+
private _dereferenceActionDefinitionSchemas;
|
|
213
|
+
}
|
|
214
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Server } from 'node:http';
|
|
2
|
+
import { BasePlugin, PluginImplementation } from '../plugin';
|
|
3
|
+
import * as utils from '../utils';
|
|
4
|
+
import { BaseBot } from './common';
|
|
5
|
+
import { MessageHandlers, EventHandlers, StateExpiredHandlers, HookHandlers, WorkflowHandlers, MessageHandlersMap, EventHandlersMap, StateExpiredHandlersMap, HookHandlersMap, WorkflowHandlersMap, UnimplementedActionHandlers, InjectedBotHandlers, RegisterHandler } from './server';
|
|
6
|
+
export type BotImplementationProps<TBot extends BaseBot = BaseBot, TPlugins extends Record<string, BasePlugin> = {}> = {
|
|
7
|
+
register?: RegisterHandler<TBot>;
|
|
8
|
+
actions: UnimplementedActionHandlers<TBot, TPlugins>;
|
|
9
|
+
plugins: {
|
|
10
|
+
[K in utils.types.StringKeys<TPlugins>]: PluginImplementation<TPlugins[K]>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare class BotImplementation<TBot extends BaseBot = BaseBot, TPlugins extends Record<string, BasePlugin> = {}> implements InjectedBotHandlers<TBot> {
|
|
14
|
+
readonly props: BotImplementationProps<TBot, TPlugins>;
|
|
15
|
+
private _registerHandler;
|
|
16
|
+
private _actionHandlers;
|
|
17
|
+
private _messageHandlers;
|
|
18
|
+
private _eventHandlers;
|
|
19
|
+
private _stateExpiredHandlers;
|
|
20
|
+
private _hookHandlers;
|
|
21
|
+
private _workflowHandlers;
|
|
22
|
+
private _plugins;
|
|
23
|
+
private _registerOrder;
|
|
24
|
+
constructor(props: BotImplementationProps<TBot, TPlugins>);
|
|
25
|
+
get registerHandler(): RegisterHandler<TBot> | undefined;
|
|
26
|
+
get actionHandlers(): InjectedBotHandlers<TBot>['actionHandlers'];
|
|
27
|
+
get messageHandlers(): InjectedBotHandlers<TBot>['messageHandlers'];
|
|
28
|
+
get eventHandlers(): InjectedBotHandlers<TBot>['eventHandlers'];
|
|
29
|
+
get stateExpiredHandlers(): InjectedBotHandlers<TBot>['stateExpiredHandlers'];
|
|
30
|
+
get hookHandlers(): InjectedBotHandlers<TBot>['hookHandlers'];
|
|
31
|
+
get workflowHandlers(): InjectedBotHandlers<TBot>['workflowHandlers'];
|
|
32
|
+
readonly on: {
|
|
33
|
+
message: <T extends utils.types.StringKeys<MessageHandlersMap<TBot>>>(type: T, handler: MessageHandlers<TBot>[T]) => void;
|
|
34
|
+
event: <T extends utils.types.StringKeys<EventHandlersMap<TBot>>>(type: T, handler: EventHandlers<TBot>[T]) => void;
|
|
35
|
+
stateExpired: <T extends utils.types.StringKeys<StateExpiredHandlersMap<TBot>>>(type: T, handler: StateExpiredHandlers<TBot>[T]) => void;
|
|
36
|
+
beforeIncomingEvent: <T extends utils.types.StringKeys<HookHandlersMap<TBot>["before_incoming_event"]>>(type: T, handler: HookHandlers<TBot>["before_incoming_event"][T]) => void;
|
|
37
|
+
beforeIncomingMessage: <T extends utils.types.StringKeys<HookHandlersMap<TBot>["before_incoming_message"]>>(type: T, handler: HookHandlers<TBot>["before_incoming_message"][T]) => void;
|
|
38
|
+
beforeOutgoingMessage: <T extends utils.types.StringKeys<HookHandlersMap<TBot>["before_outgoing_message"]>>(type: T, handler: HookHandlers<TBot>["before_outgoing_message"][T]) => void;
|
|
39
|
+
beforeOutgoingCallAction: <T extends utils.types.StringKeys<HookHandlersMap<TBot>["before_outgoing_call_action"]>>(type: T, handler: HookHandlers<TBot>["before_outgoing_call_action"][T]) => void;
|
|
40
|
+
/**
|
|
41
|
+
* # EXPERIMENTAL
|
|
42
|
+
* This API is experimental and may change in the future.
|
|
43
|
+
*/
|
|
44
|
+
beforeIncomingCallAction: <T extends utils.types.StringKeys<HookHandlersMap<TBot>["before_incoming_call_action"]>>(type: T, handler: HookHandlers<TBot>["before_incoming_call_action"][T]) => void;
|
|
45
|
+
afterIncomingEvent: <T extends utils.types.StringKeys<HookHandlersMap<TBot>["after_incoming_event"]>>(type: T, handler: HookHandlers<TBot>["after_incoming_event"][T]) => void;
|
|
46
|
+
afterIncomingMessage: <T extends utils.types.StringKeys<HookHandlersMap<TBot>["after_incoming_message"]>>(type: T, handler: HookHandlers<TBot>["after_incoming_message"][T]) => void;
|
|
47
|
+
afterOutgoingMessage: <T extends utils.types.StringKeys<HookHandlersMap<TBot>["after_outgoing_message"]>>(type: T, handler: HookHandlers<TBot>["after_outgoing_message"][T]) => void;
|
|
48
|
+
afterOutgoingCallAction: <T extends utils.types.StringKeys<HookHandlersMap<TBot>["after_outgoing_call_action"]>>(type: T, handler: HookHandlers<TBot>["after_outgoing_call_action"][T]) => void;
|
|
49
|
+
/**
|
|
50
|
+
* # EXPERIMENTAL
|
|
51
|
+
* This API is experimental and may change in the future.
|
|
52
|
+
*/
|
|
53
|
+
afterIncomingCallAction: <T extends utils.types.StringKeys<HookHandlersMap<TBot>["after_incoming_call_action"]>>(type: T, handler: HookHandlers<TBot>["after_incoming_call_action"][T]) => void;
|
|
54
|
+
/**
|
|
55
|
+
* # EXPERIMENTAL
|
|
56
|
+
* This API is experimental and may change in the future.
|
|
57
|
+
*/
|
|
58
|
+
workflowStart: <T extends utils.types.StringKeys<WorkflowHandlersMap<TBot>["started"]>>(type: T, handler: WorkflowHandlers<TBot>[T]) => void;
|
|
59
|
+
/**
|
|
60
|
+
* # EXPERIMENTAL
|
|
61
|
+
* This API is experimental and may change in the future.
|
|
62
|
+
*/
|
|
63
|
+
workflowContinue: <T extends utils.types.StringKeys<WorkflowHandlersMap<TBot>["continued"]>>(type: T, handler: WorkflowHandlers<TBot>[T]) => void;
|
|
64
|
+
/**
|
|
65
|
+
* # EXPERIMENTAL
|
|
66
|
+
* This API is experimental and may change in the future.
|
|
67
|
+
*/
|
|
68
|
+
workflowTimeout: <T extends utils.types.StringKeys<WorkflowHandlersMap<TBot>["timed_out"]>>(type: T, handler: WorkflowHandlers<TBot>[T]) => void;
|
|
69
|
+
};
|
|
70
|
+
readonly handler: (req: import("../serve").Request) => Promise<import("../serve").Response | void>;
|
|
71
|
+
readonly start: (port?: number) => Promise<Server>;
|
|
72
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Request, Response } from '../../serve';
|
|
2
|
+
import * as common from '../common';
|
|
3
|
+
import * as types from './types';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export declare const botHandler: (bot: types.BotHandlers<common.BaseBot>) => (req: Request) => Promise<Response | void>;
|