@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
package/LICENSE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Copyright 2023 Botpress Technologies, Inc.
|
|
2
|
+
Portions Copyright (c) 2026 HolocronLab.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
|
+
|
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type LogLevel = 'info' | 'debug' | 'warn' | 'error';
|
|
2
|
+
export type IssueLogEvent = {
|
|
3
|
+
type: 'issue';
|
|
4
|
+
code: string;
|
|
5
|
+
category: 'user_code' | 'limits' | 'configuration' | 'other';
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
data: Record<string, {
|
|
9
|
+
raw: string;
|
|
10
|
+
pretty?: string;
|
|
11
|
+
}>;
|
|
12
|
+
/** This groups by data fields */
|
|
13
|
+
groupBy: string[];
|
|
14
|
+
traceId?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare abstract class BaseLogger<TOptions extends object> {
|
|
17
|
+
protected defaultOptions: TOptions;
|
|
18
|
+
protected constructor(defaultOptions: TOptions);
|
|
19
|
+
abstract with(options: TOptions): BaseLogger<TOptions>;
|
|
20
|
+
info(...args: Parameters<typeof console.info>): void;
|
|
21
|
+
debug(...args: Parameters<typeof console.debug>): void;
|
|
22
|
+
warn(...args: Parameters<typeof console.warn>): void;
|
|
23
|
+
error(...args: Parameters<typeof console.error>): void;
|
|
24
|
+
issue(args: IssueLogEvent): void;
|
|
25
|
+
/**
|
|
26
|
+
* Identity fields merged into every issue line so downstream ingestion can
|
|
27
|
+
* attribute and validate the issue without out-of-band context.
|
|
28
|
+
*/
|
|
29
|
+
protected getIssueContext(): Record<string, string>;
|
|
30
|
+
private _log;
|
|
31
|
+
private _serializeMessage;
|
|
32
|
+
protected getJsonMessage(level: LogLevel, msg: string): string;
|
|
33
|
+
private _getConsoleMethod;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseLogger } from '../base-logger';
|
|
2
|
+
type BotLogOptions = {
|
|
3
|
+
userId?: string;
|
|
4
|
+
conversationId?: string;
|
|
5
|
+
workflowId?: string;
|
|
6
|
+
eventId?: string;
|
|
7
|
+
messageId?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class BotLogger extends BaseLogger<BotLogOptions> {
|
|
10
|
+
constructor(options?: BotLogOptions);
|
|
11
|
+
with(options: BotLogOptions): BotLogger;
|
|
12
|
+
withUserId(userId: string): BotLogger;
|
|
13
|
+
withConversationId(conversationId: string): BotLogger;
|
|
14
|
+
withWorkflowId(workflowId: string): BotLogger;
|
|
15
|
+
withEventId(eventId: string): BotLogger;
|
|
16
|
+
withMessageId(messageId: string): BotLogger;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as client from '@holocronlab/botruntime-client';
|
|
2
|
+
import * as common from '../common';
|
|
3
|
+
import * as types from './types';
|
|
4
|
+
export * from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Just like the regular botpress client, but typed with the bot's properties.
|
|
7
|
+
*/
|
|
8
|
+
export declare class BotSpecificClient<TBot extends common.BaseBot> implements types.ClientOperations<TBot> {
|
|
9
|
+
private _client;
|
|
10
|
+
private _hooks;
|
|
11
|
+
constructor(_client: client.Client, _hooks?: types.ClientHooks);
|
|
12
|
+
/**
|
|
13
|
+
* Access the underlying Botpress client.
|
|
14
|
+
* This is useful for operations that are not available in the BotSpecificClient.
|
|
15
|
+
* You probably shouldn't use this directly if you don't know what you're doing.
|
|
16
|
+
*/
|
|
17
|
+
get _inner(): client.Client;
|
|
18
|
+
getConversation: types.GetConversation<TBot>;
|
|
19
|
+
listConversations: types.ListConversations<TBot>;
|
|
20
|
+
updateConversation: types.UpdateConversation<TBot>;
|
|
21
|
+
deleteConversation: types.DeleteConversation<TBot>;
|
|
22
|
+
listParticipants: types.ListParticipants<TBot>;
|
|
23
|
+
addParticipant: types.AddParticipant<TBot>;
|
|
24
|
+
getParticipant: types.GetParticipant<TBot>;
|
|
25
|
+
removeParticipant: types.RemoveParticipant<TBot>;
|
|
26
|
+
createEvent: types.CreateEvent<TBot>;
|
|
27
|
+
getEvent: types.GetEvent<TBot>;
|
|
28
|
+
listEvents: types.ListEvents<TBot>;
|
|
29
|
+
createMessage: types.CreateMessage<TBot>;
|
|
30
|
+
getMessage: types.GetMessage<TBot>;
|
|
31
|
+
updateMessage: types.UpdateMessage<TBot>;
|
|
32
|
+
listMessages: types.ListMessages<TBot>;
|
|
33
|
+
deleteMessage: types.DeleteMessage<TBot>;
|
|
34
|
+
getUser: types.GetUser<TBot>;
|
|
35
|
+
listUsers: types.ListUsers<TBot>;
|
|
36
|
+
updateUser: types.UpdateUser<TBot>;
|
|
37
|
+
deleteUser: types.DeleteUser<TBot>;
|
|
38
|
+
getState: types.GetState<TBot>;
|
|
39
|
+
setState: types.SetState<TBot>;
|
|
40
|
+
getOrSetState: types.GetOrSetState<TBot>;
|
|
41
|
+
patchState: types.PatchState<TBot>;
|
|
42
|
+
callAction: types.CallAction<TBot>;
|
|
43
|
+
uploadFile: types.UploadFile<TBot>;
|
|
44
|
+
upsertFile: types.UpsertFile<TBot>;
|
|
45
|
+
deleteFile: types.DeleteFile<TBot>;
|
|
46
|
+
listFiles: types.ListFiles<TBot>;
|
|
47
|
+
getFile: types.GetFile<TBot>;
|
|
48
|
+
updateFileMetadata: types.UpdateFileMetadata<TBot>;
|
|
49
|
+
searchFiles: types.SearchFiles<TBot>;
|
|
50
|
+
trackAnalytics: types.TrackAnalytics<TBot>;
|
|
51
|
+
getTableRow: types.GetTableRow<TBot>;
|
|
52
|
+
createTableRows: types.CreateTableRows<TBot>;
|
|
53
|
+
findTableRows: types.FindTableRows<TBot>;
|
|
54
|
+
deleteTableRows: types.DeleteTableRows<TBot>;
|
|
55
|
+
updateTableRows: types.UpdateTableRows<TBot>;
|
|
56
|
+
upsertTableRows: types.UpsertTableRows<TBot>;
|
|
57
|
+
createWorkflow: types.CreateWorkflow<TBot>;
|
|
58
|
+
getOrCreateWorkflow: types.GetOrCreateWorkflow<TBot>;
|
|
59
|
+
getWorkflow: types.GetWorkflow<TBot>;
|
|
60
|
+
updateWorkflow: types.UpdateWorkflow<TBot>;
|
|
61
|
+
deleteWorkflow: types.DeleteWorkflow<TBot>;
|
|
62
|
+
listWorkflows: types.ListWorkflows<TBot>;
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated Use `callAction` to delegate the conversation creation to an integration.
|
|
65
|
+
*/
|
|
66
|
+
createConversation: types.CreateConversation<TBot>;
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated Use `callAction` to delegate the conversation creation to an integration.
|
|
69
|
+
*/
|
|
70
|
+
getOrCreateConversation: types.GetOrCreateConversation<TBot>;
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated Use `callAction` to delegate the user creation to an integration.
|
|
73
|
+
*/
|
|
74
|
+
createUser: types.CreateUser<TBot>;
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated Use `callAction` to delegate the user creation to an integration.
|
|
77
|
+
*/
|
|
78
|
+
getOrCreateUser: types.GetOrCreateUser<TBot>;
|
|
79
|
+
private _run;
|
|
80
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import * as client from '@holocronlab/botruntime-client';
|
|
2
|
+
import * as utils from '../../utils/type-utils';
|
|
3
|
+
import * as common from '../common';
|
|
4
|
+
type Arg<F extends (...args: any[]) => any> = Parameters<F>[number];
|
|
5
|
+
type Res<F extends (...args: any[]) => any> = ReturnType<F>;
|
|
6
|
+
type EventResponse<TBot extends common.BaseBot> = {
|
|
7
|
+
event: {
|
|
8
|
+
[K in keyof common.EnumerateEvents<TBot>]: utils.Merge<client.Event, {
|
|
9
|
+
type: K;
|
|
10
|
+
payload: common.EnumerateEvents<TBot>[K];
|
|
11
|
+
}>;
|
|
12
|
+
}[keyof common.EnumerateEvents<TBot>];
|
|
13
|
+
};
|
|
14
|
+
type MessageResponse<TBot extends common.BaseBot, TMessage extends keyof common.GetMessages<TBot> = keyof common.GetMessages<TBot>> = {
|
|
15
|
+
message: utils.ValueOf<{
|
|
16
|
+
[K in keyof common.GetMessages<TBot> as K extends TMessage ? K : never]: utils.Merge<client.Message, {
|
|
17
|
+
type: K;
|
|
18
|
+
payload: common.GetMessages<TBot>[K];
|
|
19
|
+
}>;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
type StateResponse<TBot extends common.BaseBot, TState extends keyof TBot['states'] = keyof TBot['states']> = utils.Merge<Awaited<Res<client.Client['getState']>>, {
|
|
23
|
+
state: utils.Merge<Awaited<Res<client.Client['getState']>>['state'], {
|
|
24
|
+
type: utils.Cast<TBot['states'][TState]['type'], string>;
|
|
25
|
+
payload: TBot['states'][TState]['payload'];
|
|
26
|
+
}>;
|
|
27
|
+
}>;
|
|
28
|
+
export type CreateConversation<_TBot extends common.BaseBot> = client.Client['createConversation'];
|
|
29
|
+
export type GetConversation<_TBot extends common.BaseBot> = client.Client['getConversation'];
|
|
30
|
+
export type ListConversations<_TBot extends common.BaseBot> = client.Client['listConversations'];
|
|
31
|
+
export type GetOrCreateConversation<_TBot extends common.BaseBot> = client.Client['getOrCreateConversation'];
|
|
32
|
+
export type UpdateConversation<_TBot extends common.BaseBot> = client.Client['updateConversation'];
|
|
33
|
+
export type DeleteConversation<_TBot extends common.BaseBot> = client.Client['deleteConversation'];
|
|
34
|
+
export type ListParticipants<_TBot extends common.BaseBot> = client.Client['listParticipants'];
|
|
35
|
+
export type AddParticipant<_TBot extends common.BaseBot> = client.Client['addParticipant'];
|
|
36
|
+
export type GetParticipant<_TBot extends common.BaseBot> = client.Client['getParticipant'];
|
|
37
|
+
export type RemoveParticipant<_TBot extends common.BaseBot> = client.Client['removeParticipant'];
|
|
38
|
+
export type CreateEvent<TBot extends common.BaseBot> = <TEvent extends keyof TBot['events']>(x: utils.Merge<Arg<client.Client['createEvent']>, {
|
|
39
|
+
type: utils.Cast<TEvent, string>;
|
|
40
|
+
payload: TBot['events'][TEvent];
|
|
41
|
+
}>) => Promise<EventResponse<TBot>>;
|
|
42
|
+
export type GetEvent<TBot extends common.BaseBot> = (x: Arg<client.Client['getEvent']>) => Promise<EventResponse<TBot>>;
|
|
43
|
+
export type ListEvents<_TBot extends common.BaseBot> = client.Client['listEvents'];
|
|
44
|
+
export type CreateMessage<TBot extends common.BaseBot> = <TMessage extends keyof common.GetMessages<TBot>>(x: utils.Merge<Arg<client.Client['createMessage']>, {
|
|
45
|
+
type: utils.Cast<TMessage, string>;
|
|
46
|
+
payload: utils.Cast<common.GetMessages<TBot>[TMessage], Record<string, any>>;
|
|
47
|
+
}>) => Promise<MessageResponse<TBot, TMessage>>;
|
|
48
|
+
export type GetMessage<TBot extends common.BaseBot> = (x: Arg<client.Client['getMessage']>) => Promise<MessageResponse<TBot>>;
|
|
49
|
+
export type UpdateMessage<TBot extends common.BaseBot> = (x: Arg<client.Client['updateMessage']>) => Promise<MessageResponse<TBot>>;
|
|
50
|
+
export type ListMessages<_TBot extends common.BaseBot> = client.Client['listMessages'];
|
|
51
|
+
export type DeleteMessage<_TBot extends common.BaseBot> = client.Client['deleteMessage'];
|
|
52
|
+
export type CreateUser<_TBot extends common.BaseBot> = client.Client['createUser'];
|
|
53
|
+
export type GetUser<_TBot extends common.BaseBot> = client.Client['getUser'];
|
|
54
|
+
export type ListUsers<_TBot extends common.BaseBot> = client.Client['listUsers'];
|
|
55
|
+
export type GetOrCreateUser<_TBot extends common.BaseBot> = client.Client['getOrCreateUser'];
|
|
56
|
+
export type UpdateUser<_TBot extends common.BaseBot> = client.Client['updateUser'];
|
|
57
|
+
export type DeleteUser<_TBot extends common.BaseBot> = client.Client['deleteUser'];
|
|
58
|
+
export type GetState<TBot extends common.BaseBot> = <TState extends keyof TBot['states']>(x: utils.Merge<Arg<client.Client['getState']>, {
|
|
59
|
+
name: utils.Cast<TState, string>;
|
|
60
|
+
type: utils.Cast<TBot['states'][TState]['type'], string>;
|
|
61
|
+
}>) => Promise<StateResponse<TBot, TState>>;
|
|
62
|
+
export type SetState<TBot extends common.BaseBot> = <TState extends keyof TBot['states']>(x: utils.Merge<Arg<client.Client['setState']>, {
|
|
63
|
+
name: utils.Cast<TState, string>;
|
|
64
|
+
type: utils.Cast<TBot['states'][TState]['type'], string>;
|
|
65
|
+
payload: TBot['states'][TState]['payload'] | null;
|
|
66
|
+
}>) => Promise<StateResponse<TBot, TState>>;
|
|
67
|
+
export type GetOrSetState<TBot extends common.BaseBot> = <TState extends keyof TBot['states']>(x: utils.Merge<Arg<client.Client['getOrSetState']>, {
|
|
68
|
+
name: utils.Cast<TState, string>;
|
|
69
|
+
type: utils.Cast<TBot['states'][TState]['type'], string>;
|
|
70
|
+
payload: TBot['states'][TState]['payload'];
|
|
71
|
+
}>) => Promise<StateResponse<TBot, TState>>;
|
|
72
|
+
export type PatchState<TBot extends common.BaseBot> = <TState extends keyof TBot['states']>(x: utils.Merge<Arg<client.Client['patchState']>, {
|
|
73
|
+
name: utils.Cast<TState, string>;
|
|
74
|
+
type: utils.Cast<TBot['states'][TState]['type'], string>;
|
|
75
|
+
payload: Partial<TBot['states'][TState]['payload']>;
|
|
76
|
+
}>) => Promise<StateResponse<TBot, TState>>;
|
|
77
|
+
export type CallAction<TBot extends common.BaseBot> = <ActionType extends keyof common.EnumerateActions<TBot>>(x: utils.Merge<Arg<client.Client['callAction']>, {
|
|
78
|
+
type: utils.Cast<ActionType, string>;
|
|
79
|
+
input: utils.Cast<common.EnumerateActions<TBot>[ActionType], common.IntegrationInstanceActionDefinition>['input'];
|
|
80
|
+
}>) => Promise<utils.Merge<Awaited<Res<client.Client['callAction']>>, {
|
|
81
|
+
output: utils.Cast<common.EnumerateActions<TBot>[ActionType], common.IntegrationInstanceActionDefinition>['output'];
|
|
82
|
+
}>>;
|
|
83
|
+
export type UploadFile<_TBot extends common.BaseBot> = client.Client['uploadFile'];
|
|
84
|
+
export type UpsertFile<_TBot extends common.BaseBot> = client.Client['upsertFile'];
|
|
85
|
+
export type DeleteFile<_TBot extends common.BaseBot> = client.Client['deleteFile'];
|
|
86
|
+
export type ListFiles<_TBot extends common.BaseBot> = client.Client['listFiles'];
|
|
87
|
+
export type GetFile<_TBot extends common.BaseBot> = client.Client['getFile'];
|
|
88
|
+
export type UpdateFileMetadata<_TBot extends common.BaseBot> = client.Client['updateFileMetadata'];
|
|
89
|
+
export type SearchFiles<_TBot extends common.BaseBot> = client.Client['searchFiles'];
|
|
90
|
+
export type CreateWorkflow<TBot extends common.BaseBot> = <TWorkflowName extends utils.StringKeys<TBot['workflows']>>(x: utils.Merge<Arg<client.Client['createWorkflow']>, {
|
|
91
|
+
name: utils.Cast<TWorkflowName, string>;
|
|
92
|
+
input: utils.Cast<TBot['workflows'][TWorkflowName], common.IntegrationInstanceActionDefinition>['input'];
|
|
93
|
+
tags?: utils.AtLeastOneProperty<TBot['workflows'][TWorkflowName]['tags']>;
|
|
94
|
+
}>) => Promise<Readonly<{
|
|
95
|
+
workflow: utils.Merge<Awaited<Res<client.Client['createWorkflow']>>['workflow'], {
|
|
96
|
+
name: NoInfer<TWorkflowName>;
|
|
97
|
+
}>;
|
|
98
|
+
}>>;
|
|
99
|
+
export type GetOrCreateWorkflow<TBot extends common.BaseBot> = <TWorkflowName extends utils.StringKeys<TBot['workflows']>>(x: utils.Merge<Arg<client.Client['getOrCreateWorkflow']>, {
|
|
100
|
+
name: utils.Cast<TWorkflowName, string>;
|
|
101
|
+
input: utils.Cast<TBot['workflows'][TWorkflowName], common.IntegrationInstanceActionDefinition>['input'];
|
|
102
|
+
tags?: utils.AtLeastOneProperty<TBot['workflows'][TWorkflowName]['tags']>;
|
|
103
|
+
}>) => Promise<Readonly<{
|
|
104
|
+
workflow: utils.Merge<Awaited<Res<client.Client['getOrCreateWorkflow']>>['workflow'], {
|
|
105
|
+
name: NoInfer<TWorkflowName>;
|
|
106
|
+
}>;
|
|
107
|
+
}>>;
|
|
108
|
+
export type GetWorkflow<_TBot extends common.BaseBot> = client.Client['getWorkflow'];
|
|
109
|
+
export type UpdateWorkflow<_TBot extends common.BaseBot> = client.Client['updateWorkflow'];
|
|
110
|
+
export type DeleteWorkflow<_TBot extends common.BaseBot> = client.Client['deleteWorkflow'];
|
|
111
|
+
export type ListWorkflows<TBot extends common.BaseBot> = <TWorkflowName extends utils.StringKeys<TBot['workflows']>>(x: utils.Merge<Arg<client.Client['listWorkflows']>, {
|
|
112
|
+
name?: utils.Cast<TWorkflowName, string>;
|
|
113
|
+
tags?: utils.AtLeastOneProperty<TBot['workflows'][TWorkflowName]['tags']>;
|
|
114
|
+
}>) => Promise<Readonly<Awaited<Res<client.Client['listWorkflows']>>>>;
|
|
115
|
+
export type GetTableRow<TBot extends common.BaseBot> = <TableName extends keyof common.EnumerateTables<TBot>, Columns = utils.Cast<common.EnumerateTables<TBot>[TableName], Record<string, any>>>(x: utils.Merge<Arg<client.Client['getTableRow']>, {
|
|
116
|
+
table: utils.Cast<TableName, string>;
|
|
117
|
+
id: client.Row['id'];
|
|
118
|
+
}>) => Promise<Readonly<utils.Merge<Awaited<Res<client.Client['getTableRow']>>, {
|
|
119
|
+
row: Awaited<Res<client.Client['getTableRow']>>['row'] & Columns;
|
|
120
|
+
}>>>;
|
|
121
|
+
export type CreateTableRows<TBot extends common.BaseBot> = <TableName extends keyof common.EnumerateTables<TBot>, Columns = utils.Cast<common.EnumerateTables<TBot>[TableName], Record<string, any>>>(x: utils.Merge<Arg<client.Client['createTableRows']>, {
|
|
122
|
+
table: utils.Cast<TableName, string>;
|
|
123
|
+
rows: utils.AtLeastOne<utils.Cast<common.EnumerateTables<TBot>[TableName], Record<string, any>>>;
|
|
124
|
+
}>) => Promise<Readonly<utils.Merge<Awaited<Res<client.Client['createTableRows']>>, {
|
|
125
|
+
rows: Awaited<Res<client.Client['createTableRows']>>['rows'] & Columns[];
|
|
126
|
+
}>>>;
|
|
127
|
+
type TableRowQueryGroup = 'key' | 'avg' | 'max' | 'min' | 'sum' | 'count';
|
|
128
|
+
type TableRowExtraColumns = {
|
|
129
|
+
/**
|
|
130
|
+
* Unique identifier for the row.
|
|
131
|
+
*/
|
|
132
|
+
id: number;
|
|
133
|
+
/**
|
|
134
|
+
* Timestamp of row creation.
|
|
135
|
+
*/
|
|
136
|
+
createdAt: string;
|
|
137
|
+
/**
|
|
138
|
+
* Timestamp of the last row update.
|
|
139
|
+
*/
|
|
140
|
+
updatedAt: string;
|
|
141
|
+
};
|
|
142
|
+
type TableRowFilter<TBot extends common.BaseBot, TableName extends keyof common.EnumerateTables<TBot>, Columns = utils.Cast<common.EnumerateTables<TBot>[TableName], Record<string, any>> & TableRowExtraColumns> = TableRowColumnFilters<Columns> | TableRowLogicalFilter<TBot, TableName, Columns>;
|
|
143
|
+
type TableRowColumnFilters<Columns> = utils.AtLeastOneProperty<{
|
|
144
|
+
[K in Extract<keyof Columns, string>]: TableColumnComparisonFilter<Columns[K]>;
|
|
145
|
+
}>;
|
|
146
|
+
type TableRowLogicalFilter<TBot extends common.BaseBot, TableName extends keyof common.EnumerateTables<TBot>, Columns = utils.Cast<common.EnumerateTables<TBot>[TableName], Record<string, any>> & TableRowExtraColumns> = utils.ExactlyOneProperty<{
|
|
147
|
+
$and: utils.AtLeastOne<TableRowFilter<TBot, TableName, Columns>>;
|
|
148
|
+
$or: utils.AtLeastOne<TableRowFilter<TBot, TableName, Columns>>;
|
|
149
|
+
$not: TableRowColumnFilters<Columns>;
|
|
150
|
+
}>;
|
|
151
|
+
type TableColumnComparisonFilter<ColumnType> = ColumnType | utils.ExactlyOneProperty<{
|
|
152
|
+
$eq: ColumnType;
|
|
153
|
+
$gt: ColumnType;
|
|
154
|
+
$gte: ColumnType;
|
|
155
|
+
$lt: ColumnType;
|
|
156
|
+
$lte: ColumnType;
|
|
157
|
+
$ne: ColumnType;
|
|
158
|
+
$mod: [number, number];
|
|
159
|
+
$in: utils.AtLeastOne<ColumnType>;
|
|
160
|
+
$nin: utils.AtLeastOne<ColumnType>;
|
|
161
|
+
$exists: boolean;
|
|
162
|
+
$size: number;
|
|
163
|
+
}>;
|
|
164
|
+
export type FindTableRows<TBot extends common.BaseBot> = <TableName extends keyof common.EnumerateTables<TBot>, Columns = utils.Cast<common.EnumerateTables<TBot>[TableName], Record<string, any>> & TableRowExtraColumns>(x: utils.Merge<Arg<client.Client['findTableRows']>, {
|
|
165
|
+
table: utils.Cast<TableName, string>;
|
|
166
|
+
filter?: TableRowFilter<TBot, NoInfer<TableName>, NoInfer<Columns>>;
|
|
167
|
+
group?: NoInfer<utils.AtLeastOneProperty<{
|
|
168
|
+
[K in Extract<keyof Columns, string>]: TableRowQueryGroup | TableRowQueryGroup[];
|
|
169
|
+
}>>;
|
|
170
|
+
orderBy?: NoInfer<Extract<keyof Columns, string>>;
|
|
171
|
+
}>) => Promise<Readonly<utils.Merge<Awaited<Res<client.Client['findTableRows']>>, {
|
|
172
|
+
rows: Awaited<Res<client.Client['findTableRows']>>['rows'] & Columns[];
|
|
173
|
+
}>>>;
|
|
174
|
+
export type DeleteTableRows<TBot extends common.BaseBot> = <TableName extends keyof common.EnumerateTables<TBot>>(x: utils.Merge<Arg<client.Client['deleteTableRows']>, {
|
|
175
|
+
table: utils.Cast<TableName, string>;
|
|
176
|
+
filter?: TableRowFilter<TBot, TableName>;
|
|
177
|
+
}>) => Promise<Readonly<Awaited<Res<client.Client['deleteTableRows']>>>>;
|
|
178
|
+
export type UpdateTableRows<TBot extends common.BaseBot> = <TableName extends keyof common.EnumerateTables<TBot>, Columns = utils.Cast<common.EnumerateTables<TBot>[TableName], Record<string, any>>>(x: utils.Merge<Arg<client.Client['updateTableRows']>, {
|
|
179
|
+
table: utils.Cast<TableName, string>;
|
|
180
|
+
rows: utils.AtLeastOne<utils.Cast<common.EnumerateTables<TBot>[TableName], Record<string, any>> & {
|
|
181
|
+
id: number;
|
|
182
|
+
}>;
|
|
183
|
+
}>) => Promise<Readonly<utils.Merge<Awaited<Res<client.Client['updateTableRows']>>, {
|
|
184
|
+
rows: Awaited<Res<client.Client['updateTableRows']>>['rows'] & Columns[];
|
|
185
|
+
}>>>;
|
|
186
|
+
export type UpsertTableRows<TBot extends common.BaseBot> = <TableName extends keyof common.EnumerateTables<TBot>, Columns = utils.Cast<common.EnumerateTables<TBot>[TableName], Record<string, any>>>(x: utils.Merge<Arg<client.Client['upsertTableRows']>, {
|
|
187
|
+
table: utils.Cast<TableName, string>;
|
|
188
|
+
rows: utils.AtLeastOne<utils.Cast<common.EnumerateTables<TBot>[TableName], Record<string, any>> & {
|
|
189
|
+
id?: number;
|
|
190
|
+
}>;
|
|
191
|
+
keyColumn?: NoInfer<Extract<keyof common.EnumerateTables<TBot>[TableName], string>> | 'id';
|
|
192
|
+
}>) => Promise<Readonly<utils.Merge<Awaited<Res<client.Client['upsertTableRows']>>, {
|
|
193
|
+
inserted: Awaited<Res<client.Client['upsertTableRows']>>['inserted'] & Columns[];
|
|
194
|
+
updated: Awaited<Res<client.Client['upsertTableRows']>>['updated'] & Columns[];
|
|
195
|
+
}>>>;
|
|
196
|
+
export type TrackAnalytics<_TBot extends common.BaseBot> = client.Client['trackAnalytics'];
|
|
197
|
+
export type ClientOperations<TBot extends common.BaseBot> = {
|
|
198
|
+
getConversation: GetConversation<TBot>;
|
|
199
|
+
listConversations: ListConversations<TBot>;
|
|
200
|
+
updateConversation: UpdateConversation<TBot>;
|
|
201
|
+
deleteConversation: DeleteConversation<TBot>;
|
|
202
|
+
listParticipants: ListParticipants<TBot>;
|
|
203
|
+
addParticipant: AddParticipant<TBot>;
|
|
204
|
+
getParticipant: GetParticipant<TBot>;
|
|
205
|
+
removeParticipant: RemoveParticipant<TBot>;
|
|
206
|
+
getEvent: GetEvent<TBot>;
|
|
207
|
+
createEvent: CreateEvent<TBot>;
|
|
208
|
+
listEvents: ListEvents<TBot>;
|
|
209
|
+
createMessage: CreateMessage<TBot>;
|
|
210
|
+
getMessage: GetMessage<TBot>;
|
|
211
|
+
updateMessage: UpdateMessage<TBot>;
|
|
212
|
+
listMessages: ListMessages<TBot>;
|
|
213
|
+
deleteMessage: DeleteMessage<TBot>;
|
|
214
|
+
getUser: GetUser<TBot>;
|
|
215
|
+
listUsers: ListUsers<TBot>;
|
|
216
|
+
updateUser: UpdateUser<TBot>;
|
|
217
|
+
deleteUser: DeleteUser<TBot>;
|
|
218
|
+
getState: GetState<TBot>;
|
|
219
|
+
setState: SetState<TBot>;
|
|
220
|
+
getOrSetState: GetOrSetState<TBot>;
|
|
221
|
+
patchState: PatchState<TBot>;
|
|
222
|
+
callAction: CallAction<TBot>;
|
|
223
|
+
uploadFile: UploadFile<TBot>;
|
|
224
|
+
upsertFile: UpsertFile<TBot>;
|
|
225
|
+
deleteFile: DeleteFile<TBot>;
|
|
226
|
+
listFiles: ListFiles<TBot>;
|
|
227
|
+
getFile: GetFile<TBot>;
|
|
228
|
+
updateFileMetadata: UpdateFileMetadata<TBot>;
|
|
229
|
+
searchFiles: SearchFiles<TBot>;
|
|
230
|
+
trackAnalytics: TrackAnalytics<TBot>;
|
|
231
|
+
getTableRow: GetTableRow<TBot>;
|
|
232
|
+
createTableRows: CreateTableRows<TBot>;
|
|
233
|
+
findTableRows: FindTableRows<TBot>;
|
|
234
|
+
deleteTableRows: DeleteTableRows<TBot>;
|
|
235
|
+
updateTableRows: UpdateTableRows<TBot>;
|
|
236
|
+
upsertTableRows: UpsertTableRows<TBot>;
|
|
237
|
+
};
|
|
238
|
+
export type ClientInputs<TBot extends common.BaseBot> = {
|
|
239
|
+
[K in keyof ClientOperations<TBot>]: Arg<ClientOperations<TBot>[K]>;
|
|
240
|
+
};
|
|
241
|
+
export type ClientOutputs<TBot extends common.BaseBot> = {
|
|
242
|
+
[K in keyof ClientOperations<TBot>]: Awaited<Res<ClientOperations<TBot>[K]>>;
|
|
243
|
+
};
|
|
244
|
+
type ClientHooksBefore = {
|
|
245
|
+
[K in client.Operation]?: (x: client.ClientInputs[K]) => Promise<client.ClientInputs[K]>;
|
|
246
|
+
};
|
|
247
|
+
type ClientHooksAfter = {
|
|
248
|
+
[K in client.Operation]?: (y: client.ClientOutputs[K], x: client.ClientInputs[K]) => Promise<client.ClientOutputs[K]>;
|
|
249
|
+
};
|
|
250
|
+
export type ClientHooks = {
|
|
251
|
+
before: ClientHooksBefore;
|
|
252
|
+
after: ClientHooksAfter;
|
|
253
|
+
};
|
|
254
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BaseIntegration, DefaultIntegration, InputBaseIntegration } from '../../integration/common/generic';
|
|
2
|
+
import * as utils from '../../utils/type-utils';
|
|
3
|
+
import * as def from '../definition';
|
|
4
|
+
export * from '../../integration/common/generic';
|
|
5
|
+
export type BaseAction = {
|
|
6
|
+
input: any;
|
|
7
|
+
output: any;
|
|
8
|
+
};
|
|
9
|
+
export type BaseTable = {
|
|
10
|
+
[k: string]: any;
|
|
11
|
+
};
|
|
12
|
+
export type BaseWorkflow = {
|
|
13
|
+
input: any;
|
|
14
|
+
output: any;
|
|
15
|
+
tags?: {
|
|
16
|
+
[k: string]: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type BaseState = {
|
|
20
|
+
type: def.StateType;
|
|
21
|
+
payload: any;
|
|
22
|
+
};
|
|
23
|
+
export type BaseBot = {
|
|
24
|
+
integrations: Record<string, BaseIntegration>;
|
|
25
|
+
events: Record<string, any>;
|
|
26
|
+
states: Record<string, BaseState>;
|
|
27
|
+
actions: Record<string, BaseAction>;
|
|
28
|
+
tables: Record<string, BaseTable>;
|
|
29
|
+
workflows: Record<string, BaseWorkflow>;
|
|
30
|
+
};
|
|
31
|
+
export type InputBaseBot = utils.DeepPartial<BaseBot>;
|
|
32
|
+
export type DefaultBot<B extends InputBaseBot> = {
|
|
33
|
+
events: utils.Default<B['events'], BaseBot['events']>;
|
|
34
|
+
states: utils.Default<B['states'], BaseBot['states']>;
|
|
35
|
+
actions: utils.Default<B['actions'], BaseBot['actions']>;
|
|
36
|
+
integrations: undefined extends B['integrations'] ? BaseBot['integrations'] : {
|
|
37
|
+
[K in keyof B['integrations']]: DefaultIntegration<utils.Cast<B['integrations'][K], InputBaseIntegration>>;
|
|
38
|
+
};
|
|
39
|
+
tables: utils.Default<B['tables'], BaseBot['tables']>;
|
|
40
|
+
workflows: utils.Default<B['workflows'], BaseBot['workflows']>;
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Join, UnionToIntersection, Split, Cast } from '../../utils/type-utils';
|
|
2
|
+
import { BaseBot } from './generic';
|
|
3
|
+
export type IntegrationInstanceDefinition = BaseBot['integrations'][string];
|
|
4
|
+
export type IntegrationInstanceConfigurationDefinition = IntegrationInstanceDefinition['configuration'];
|
|
5
|
+
export type IntegrationInstanceActionDefinition = IntegrationInstanceDefinition['actions'][string];
|
|
6
|
+
export type IntegrationInstanceChannelDefinition = IntegrationInstanceDefinition['channels'][string];
|
|
7
|
+
export type IntegrationInstanceMessageDefinition = IntegrationInstanceChannelDefinition['messages'][string];
|
|
8
|
+
export type IntegrationInstanceEventDefinition = IntegrationInstanceDefinition['events'][string];
|
|
9
|
+
export type IntegrationInstanceStateDefinition = IntegrationInstanceDefinition['states'][string];
|
|
10
|
+
export type IntegrationInstanceUserDefinition = IntegrationInstanceDefinition['user'];
|
|
11
|
+
type ActionKey<TIntegrationName extends string, TActionName extends string> = string extends TIntegrationName ? string : string extends TActionName ? string : Join<[TIntegrationName, ':', TActionName]>;
|
|
12
|
+
export type EnumerateActions<TBot extends BaseBot> = UnionToIntersection<{
|
|
13
|
+
[TIntegrationName in keyof TBot['integrations']]: {
|
|
14
|
+
[TActionName in keyof TBot['integrations'][TIntegrationName]['actions'] as ActionKey<Cast<TIntegrationName, string>, Cast<TActionName, string>>]: TBot['integrations'][TIntegrationName]['actions'][TActionName];
|
|
15
|
+
};
|
|
16
|
+
}[keyof TBot['integrations']]> & {};
|
|
17
|
+
export type EnumerateActionInputs<TBot extends BaseBot> = {
|
|
18
|
+
[K in keyof EnumerateActions<TBot>]: Cast<EnumerateActions<TBot>[K], IntegrationInstanceActionDefinition>['input'];
|
|
19
|
+
};
|
|
20
|
+
export type EnumerateActionOutputs<TBot extends BaseBot> = {
|
|
21
|
+
[K in keyof EnumerateActions<TBot>]: Cast<EnumerateActions<TBot>[K], IntegrationInstanceActionDefinition>['output'];
|
|
22
|
+
};
|
|
23
|
+
type EventKey<TIntegrationName extends string, TEventName extends string> = string extends TIntegrationName ? string : string extends TEventName ? string : Join<[TIntegrationName, ':', TEventName]>;
|
|
24
|
+
export type EnumerateEvents<TBot extends BaseBot> = UnionToIntersection<{
|
|
25
|
+
[TIntegrationName in keyof TBot['integrations']]: {
|
|
26
|
+
[TEventName in keyof TBot['integrations'][TIntegrationName]['events'] as EventKey<Cast<TIntegrationName, string>, Cast<TEventName, string>>]: TBot['integrations'][TIntegrationName]['events'][TEventName];
|
|
27
|
+
};
|
|
28
|
+
}[keyof TBot['integrations']]> & {
|
|
29
|
+
[TEventName in keyof TBot['events']]: TBot['events'][TEventName];
|
|
30
|
+
};
|
|
31
|
+
type ChannelKey<TIntegrationName extends string, TChannelName extends string> = string extends TIntegrationName ? string : string extends TChannelName ? string : Join<[TIntegrationName, ':', TChannelName]>;
|
|
32
|
+
export type EnumerateChannels<TBot extends BaseBot> = UnionToIntersection<{
|
|
33
|
+
[TIntegrationName in keyof TBot['integrations']]: {
|
|
34
|
+
[TChannelName in keyof TBot['integrations'][TIntegrationName]['channels'] as ChannelKey<Cast<TIntegrationName, string>, Cast<TChannelName, string>>]: TBot['integrations'][TIntegrationName]['channels'][TChannelName];
|
|
35
|
+
};
|
|
36
|
+
}[keyof TBot['integrations']]> & {};
|
|
37
|
+
type MessageKey<TIntegrationName extends string, TChannelName extends string, TMessageName extends string> = string extends TIntegrationName ? string : string extends TChannelName ? string : string extends TMessageName ? string : Join<[TIntegrationName, ':', TChannelName, ':', TMessageName]>;
|
|
38
|
+
export type EnumerateMessages<TBot extends BaseBot> = UnionToIntersection<{
|
|
39
|
+
[TIntegrationName in keyof TBot['integrations']]: {
|
|
40
|
+
[TChannelName in keyof TBot['integrations'][TIntegrationName]['channels']]: {
|
|
41
|
+
[TMessageName in keyof TBot['integrations'][TIntegrationName]['channels'][TChannelName]['messages'] as MessageKey<Cast<TIntegrationName, string>, Cast<TChannelName, string>, Cast<TMessageName, string>>]: TBot['integrations'][TIntegrationName]['channels'][TChannelName]['messages'][TMessageName];
|
|
42
|
+
};
|
|
43
|
+
}[keyof TBot['integrations'][TIntegrationName]['channels']];
|
|
44
|
+
}[keyof TBot['integrations']]> & {};
|
|
45
|
+
export type GetMessages<TBot extends BaseBot> = {
|
|
46
|
+
[K in keyof EnumerateMessages<TBot> as Cast<Split<K, ':'>[2], string>]: EnumerateMessages<TBot>[K];
|
|
47
|
+
};
|
|
48
|
+
export type EnumerateStates<TBot extends BaseBot> = {
|
|
49
|
+
[K in keyof TBot['states']]: TBot['states'][K];
|
|
50
|
+
};
|
|
51
|
+
export type EnumerateTables<TBot extends BaseBot> = {
|
|
52
|
+
[K in keyof TBot['tables']]: TBot['tables'][K];
|
|
53
|
+
};
|
|
54
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|