@wabot-dev/framework 0.1.0-beta.6 → 0.1.0-beta.61
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/dist/src/addon/async/pg/PgJobRepository.js +26 -0
- package/dist/src/addon/auth/api-key/@apiKeyConnectionGuard.js +16 -0
- package/dist/src/addon/auth/api-key/@apiKeyGuard.js +17 -0
- package/dist/src/addon/auth/api-key/ApiKey.js +53 -0
- package/dist/src/addon/auth/api-key/ApiKeyConnectionGuardMiddleware.js +57 -0
- package/dist/src/addon/auth/api-key/ApiKeyGuardMiddleware.js +45 -0
- package/dist/src/addon/auth/api-key/ApiKeyRepository.js +35 -0
- package/dist/src/addon/auth/api-key/PgApiKeyRepository.js +28 -0
- package/dist/src/addon/auth/api-key/RemoteApiKeyRepository.js +42 -0
- package/dist/src/addon/auth/jwt/@jwtConnectionGuard.js +16 -0
- package/dist/src/addon/auth/jwt/@jwtGuard.js +17 -0
- package/dist/src/addon/auth/jwt/Jwt.js +53 -0
- package/dist/src/addon/auth/jwt/JwtAccessAndRefreshTokenDto.js +20 -0
- package/dist/src/addon/auth/jwt/JwtConfig.js +28 -0
- package/dist/src/addon/auth/jwt/JwtConnectionGuardMiddleware.js +57 -0
- package/dist/src/addon/auth/jwt/JwtGuardMiddleware.js +45 -0
- package/dist/src/addon/auth/jwt/JwtRefreshToken.js +56 -0
- package/dist/src/addon/auth/jwt/JwtRefreshTokenRepository.js +25 -0
- package/dist/src/addon/auth/jwt/JwtSigner.js +36 -0
- package/dist/src/addon/auth/jwt/JwtTokenDto.js +22 -0
- package/dist/src/addon/auth/jwt/PgJwtRefreshTokenRepository.js +21 -0
- package/dist/src/addon/chat-bot/anthropic/AnthropicChatAdapter.js +135 -0
- package/dist/src/addon/chat-bot/deepseek/DeepSeekChatAdapter.js +137 -0
- package/dist/src/addon/chat-bot/google/GoogleChatAdapter.js +128 -0
- package/dist/src/addon/chat-bot/openia/OpenaiChatAdapter.js +117 -0
- package/dist/src/{pre-made/repository/chat → addon/chat-bot}/pg/PgChatMemory.js +6 -4
- package/dist/src/{pre-made/repository/chat → addon/chat-bot}/pg/PgChatRepository.js +6 -5
- package/dist/src/{pre-made/repository/chat → addon/chat-bot}/ram/RamChatRepository.js +2 -2
- package/dist/src/addon/chat-bot/wabot/WabotChatAdapter.js +41 -0
- package/dist/src/addon/chat-controller/cmd/@cmd.js +23 -0
- package/dist/src/{channels → addon/chat-controller}/cmd/CmdChannel.js +4 -26
- package/dist/src/{channels → addon/chat-controller}/socket/@socket.js +9 -4
- package/dist/src/{channels → addon/chat-controller}/socket/SocketChannel.js +5 -23
- package/dist/src/{channels → addon/chat-controller}/socket/SocketChannelConfig.js +1 -1
- package/dist/src/{channels → addon/chat-controller}/telegram/@telegram.js +9 -4
- package/dist/src/{channels → addon/chat-controller}/telegram/TelegramChannel.js +4 -22
- package/dist/src/addon/chat-controller/whatsapp/@whatsApp.js +25 -0
- package/dist/src/{channels → addon/chat-controller}/whatsapp/EnvWhatsAppRepository.js +3 -3
- package/dist/src/{channels → addon/chat-controller}/whatsapp/PgWhatsAppRepository.js +2 -2
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsApp.js +2 -4
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppChannel.js +6 -18
- package/dist/src/addon/chat-controller/whatsapp/WhatsAppReceiver.js +10 -0
- package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppSender.js +20 -41
- package/dist/src/addon/chat-controller/whatsapp/cloud-api/WhatsAppReceiverByCloudApi.js +97 -0
- package/dist/src/{channels/whatsapp → addon/chat-controller/whatsapp/cloud-api}/WhatsAppSenderByCloudApi.js +26 -20
- package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppProxyContracts.js +5 -0
- package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppReceiverByWabotProxy.js +65 -0
- package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppSenderByWabotProxy.js +60 -0
- package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppWabotProxyConnection.js +45 -0
- package/dist/src/addon/mindset/html/HtmlModule.js +70 -0
- package/dist/src/core/auth/Auth.js +24 -0
- package/dist/src/core/{Persistent.js → entity/Entity.js} +24 -12
- package/dist/src/core/env/Env.js +39 -0
- package/dist/src/core/error/CustomError.js +15 -0
- package/dist/src/core/injection/index.js +4 -0
- package/dist/src/core/mapper/Mapper.js +42 -0
- package/dist/src/core/password/Password.js +30 -0
- package/dist/src/core/random/Random.js +65 -0
- package/dist/src/core/storable/Storable.js +8 -0
- package/dist/src/core/validation/core/validateArray.js +51 -0
- package/dist/src/core/validation/core/validateIsOptional.js +5 -0
- package/dist/src/core/validation/core/validateModel.js +36 -0
- package/dist/src/core/validation/metadata/@isArray.js +18 -0
- package/dist/src/core/validation/metadata/@isModel.js +18 -0
- package/dist/src/core/validation/metadata/@isOptional.js +17 -0
- package/dist/src/core/validation/metadata/ValidationMetadataStore.js +98 -0
- package/dist/src/core/validation/modelInfo.js +9 -0
- package/dist/src/core/validation/validate.js +11 -0
- package/dist/src/core/validation/validators/is-boolean/@isBoolean.js +17 -0
- package/dist/src/core/validation/validators/is-boolean/validateIsBoolean.js +12 -0
- package/dist/src/core/validation/validators/is-date/@isDate.js +17 -0
- package/dist/src/core/validation/validators/is-date/validateIsDate.js +16 -0
- package/dist/src/core/validation/validators/is-in/@isIn.js +18 -0
- package/dist/src/core/validation/validators/is-in/validateIsIn.js +12 -0
- package/dist/src/core/validation/validators/is-not-empty/@isNotEmpty.js +17 -0
- package/dist/src/core/validation/validators/is-not-empty/validateIsNotEmpty.js +12 -0
- package/dist/src/core/validation/validators/is-number/@isNumber.js +17 -0
- package/dist/src/core/validation/validators/is-number/validateIsNumber.js +12 -0
- package/dist/src/core/validation/validators/is-present/@isPresent.js +17 -0
- package/dist/src/core/validation/validators/is-present/validateIsPresent.js +12 -0
- package/dist/src/core/validation/validators/is-string/@isString.js +17 -0
- package/dist/src/core/validation/validators/is-string/validateIsString.js +12 -0
- package/dist/src/core/validation/validators/max/@max.js +18 -0
- package/dist/src/core/validation/validators/max/validateMax.js +17 -0
- package/dist/src/core/validation/validators/min/@min.js +18 -0
- package/dist/src/core/validation/validators/min/validateMin.js +17 -0
- package/dist/src/feature/async/@command.js +11 -0
- package/dist/src/feature/async/@commandHandler.js +12 -0
- package/dist/src/feature/async/Async.js +38 -0
- package/dist/src/feature/async/Command.js +9 -0
- package/dist/src/feature/async/CommandMetadataStore.js +38 -0
- package/dist/src/feature/async/Job.js +27 -0
- package/dist/src/feature/async/JobRepository.js +31 -0
- package/dist/src/feature/async/JobRunner.js +48 -0
- package/dist/src/feature/async/JobsEventsHub.js +36 -0
- package/dist/src/feature/async/runCommandHandlers.js +29 -0
- package/dist/src/{core/chat → feature/chat-bot}/Chat.js +2 -2
- package/dist/src/feature/chat-bot/ChatAdapter.js +7 -0
- package/dist/src/feature/chat-bot/ChatBot.js +73 -0
- package/dist/src/feature/chat-bot/ChatItem.js +24 -0
- package/dist/src/feature/chat-bot/ChatMemory.js +10 -0
- package/dist/src/{core/chat/repository/IChatRepository.js → feature/chat-bot/ChatRepository.js} +2 -8
- package/dist/src/feature/chat-bot/IChatItem.js +3 -0
- package/dist/src/{chatbot → feature/chat-bot}/metadata/@chatBot.js +1 -1
- package/dist/src/{chatbot → feature/chat-bot}/metadata/ChatBotMetadataStore.js +1 -1
- package/dist/src/{controller/channel → feature/chat-controller}/ChatResolver.js +6 -4
- package/dist/src/{controller → feature/chat-controller}/metadata/ControllerMetadataStore.js +1 -1
- package/dist/src/{controller → feature/chat-controller}/metadata/controller/@chatController.js +1 -1
- package/dist/src/feature/chat-controller/runChatControllers.js +69 -0
- package/dist/src/{channels → feature}/express/ExpressProvider.js +2 -4
- package/dist/src/{channels → feature}/http/HttpServerProvider.js +2 -2
- package/dist/src/{mindset → feature/mindset}/IMindset.js +3 -0
- package/dist/src/{mindset → feature/mindset}/MindsetOperator.js +69 -42
- package/dist/src/{mindset → feature/mindset}/metadata/MindsetMetadataStore.js +1 -1
- package/dist/src/{mindset → feature/mindset}/metadata/functions/@mindsetFunction.js +1 -1
- package/dist/src/{mindset → feature/mindset}/metadata/mindsets/@mindset.js +1 -1
- package/dist/src/{mindset → feature/mindset}/metadata/modules/@mindsetModule.js +1 -2
- package/dist/src/{mindset → feature/mindset}/metadata/params/@param.js +1 -1
- package/dist/src/feature/money/Money.js +61 -0
- package/dist/src/feature/money/MoneyDto.js +22 -0
- package/dist/src/{repository → feature}/pg/PgCrudRepository.js +30 -9
- package/dist/src/{repository → feature}/pg/PgRepositoryBase.js +2 -2
- package/dist/src/feature/rest-controller/injection-tokens.js +4 -0
- package/dist/src/feature/rest-controller/metadata/@middleware.js +16 -0
- package/dist/src/feature/rest-controller/metadata/@onDelete.js +7 -0
- package/dist/src/feature/rest-controller/metadata/@onGet.js +7 -0
- package/dist/src/feature/rest-controller/metadata/@onPost.js +7 -0
- package/dist/src/feature/rest-controller/metadata/@onPut.js +7 -0
- package/dist/src/feature/rest-controller/metadata/@restController.js +15 -0
- package/dist/src/feature/rest-controller/metadata/RestControllerMetadataStore.js +50 -0
- package/dist/src/feature/rest-controller/metadata/methodDecorator.js +19 -0
- package/dist/src/feature/rest-controller/runRestControllers.js +103 -0
- package/dist/src/{channels → feature}/socket/SocketServerProvider.js +2 -2
- package/dist/src/feature/socket-controller/metadata/@connectionMiddleware.js +16 -0
- package/dist/src/feature/socket-controller/metadata/@socketConnection.js +18 -0
- package/dist/src/feature/socket-controller/metadata/@socketController.js +15 -0
- package/dist/src/feature/socket-controller/metadata/@socketEvent.js +18 -0
- package/dist/src/feature/socket-controller/metadata/SocketControllerMetadataStore.js +65 -0
- package/dist/src/feature/socket-controller/runSocketControllers.js +99 -0
- package/dist/src/index.d.ts +1210 -576
- package/dist/src/index.js +147 -76
- package/package.json +10 -4
- package/dist/src/ai/deepseek/DeepSeekChatBotAdapter.js +0 -106
- package/dist/src/ai/openia/OpenaiChatBotAdapter.js +0 -88
- package/dist/src/channels/cmd/@cmd.js +0 -18
- package/dist/src/channels/wabot/WabotDevConnection.js +0 -57
- package/dist/src/channels/wabot/WabotDevSocketContracts.js +0 -10
- package/dist/src/channels/whatsapp/@whatsapp.js +0 -20
- package/dist/src/channels/whatsapp/WhatsAppReceiver.js +0 -59
- package/dist/src/channels/whatsapp/WhatsAppReceiverByDevConnection.js +0 -32
- package/dist/src/channels/whatsapp/WhatsAppReceiverByWebHook.js +0 -63
- package/dist/src/channels/whatsapp/WhatsAppSenderByDevConnection.js +0 -61
- package/dist/src/chatbot/ChatBot.js +0 -51
- package/dist/src/chatbot/ChatBotAdapter.js +0 -72
- package/dist/src/controller/channel/UserResolver.js +0 -21
- package/dist/src/core/IMessageContext.js +0 -12
- package/dist/src/core/chat/ChatItem.js +0 -15
- package/dist/src/core/chat/repository/IChatMemory.js +0 -10
- package/dist/src/core/user/IUserRepository.js +0 -19
- package/dist/src/core/user/User.js +0 -26
- package/dist/src/env/WabotEnv.js +0 -27
- package/dist/src/injection/index.js +0 -4
- package/dist/src/mindset/metadata/params/@isOptional.js +0 -21
- package/dist/src/pre-made/module/authentication/AuthenticationModule.js +0 -97
- package/dist/src/pre-made/module/authentication/requests/SendOneTimePasswordRequest.js +0 -25
- package/dist/src/pre-made/module/authentication/requests/ValidateOneTimePasswordRequest.js +0 -25
- package/dist/src/pre-made/module/register-user/RegisterUserModule.js +0 -56
- package/dist/src/pre-made/module/register-user/requests/RegisterUserWithEmailRequest.js +0 -25
- package/dist/src/pre-made/repository/user/pg/PgUserRepository.js +0 -33
- package/dist/src/pre-made/repository/user/ram/RamUserRepository.js +0 -27
- package/dist/src/pre-made/service/EmailService.js +0 -13
- package/dist/src/pre-made/service/OtpService.js +0 -14
- package/dist/src/server/prepareChatContainer.js +0 -43
- package/dist/src/server/runChannel.js +0 -27
- package/dist/src/server/runServer.js +0 -40
- /package/dist/src/{pre-made/repository/chat → addon/chat-bot}/ram/RamChatMemory.js +0 -0
- /package/dist/src/{channels → addon/chat-controller}/telegram/TelegramChannelConfig.js +0 -0
- /package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppChannelConfig.js +0 -0
- /package/dist/src/{channels → addon/chat-controller}/whatsapp/WhatsAppRepository.js +0 -0
- /package/dist/src/{injection → core/injection}/Container.js +0 -0
- /package/dist/src/{logger → core/logger}/Logger.js +0 -0
- /package/dist/src/{mindset → feature/mindset}/metadata/functions/decoratorNames.js +0 -0
- /package/dist/src/{mindset → feature/mindset}/metadata/mindsets/decoratorNames.js +0 -0
- /package/dist/src/{mindset → feature/mindset}/metadata/modules/decoratorNames.js +0 -0
- /package/dist/src/{mindset → feature/mindset}/metadata/params/decoratorNames.js +0 -0
package/dist/src/index.d.ts
CHANGED
|
@@ -1,183 +1,434 @@
|
|
|
1
|
+
import * as tsyringe from 'tsyringe';
|
|
2
|
+
import { DependencyContainer as DependencyContainer$1 } from 'tsyringe';
|
|
3
|
+
export { DependencyContainer } from 'tsyringe';
|
|
1
4
|
import InjectionToken from 'tsyringe/dist/typings/providers/injection-token';
|
|
2
5
|
import DependencyContainer, { PreResolutionInterceptorCallback, PostResolutionInterceptorCallback } from 'tsyringe/dist/typings/types/dependency-container';
|
|
3
6
|
import InterceptionOptions from 'tsyringe/dist/typings/types/interceptor-options';
|
|
4
7
|
import { Server } from 'http';
|
|
5
|
-
import { Express } from 'express';
|
|
6
|
-
import
|
|
7
|
-
import { Socket } from 'socket.io-client';
|
|
8
|
+
import { Express, Request, Response } from 'express';
|
|
9
|
+
import * as big_js from 'big.js';
|
|
8
10
|
import { Pool } from 'pg';
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
11
|
+
import { Server as Server$1, Socket } from 'socket.io';
|
|
12
|
+
import { Algorithm } from 'jsonwebtoken';
|
|
13
|
+
import { Socket as Socket$1 } from 'socket.io-client';
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
type IPrimitive = null | number | string | boolean | undefined;
|
|
16
|
+
type IStorableData = {
|
|
17
|
+
[key: string]: IPrimitive | IPrimitive[] | IStorableData | IStorableData[];
|
|
18
|
+
};
|
|
19
|
+
declare class Storable<D extends IStorableData> {
|
|
20
|
+
protected data: D;
|
|
21
|
+
constructor(data: D);
|
|
15
22
|
}
|
|
16
23
|
|
|
17
|
-
declare
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
interface IMindsetFunctionDecoration {
|
|
22
|
-
decorationName: string;
|
|
23
|
-
functionName: string;
|
|
24
|
-
constructor: Function;
|
|
25
|
-
paramsTypes: Function[];
|
|
26
|
-
decorationConfig: any;
|
|
24
|
+
declare class Auth<D extends IStorableData> {
|
|
25
|
+
private authInfo;
|
|
26
|
+
require(): D;
|
|
27
|
+
assign(authInfo: D): void;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
interface
|
|
30
|
+
interface IEntityData extends IStorableData {
|
|
30
31
|
id?: string;
|
|
31
32
|
createdAt?: number | null;
|
|
32
33
|
discardedAt?: number | null;
|
|
33
34
|
}
|
|
34
|
-
declare class
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
declare class Entity<D extends IEntityData> extends Storable<D> {
|
|
36
|
+
get id(): string;
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated use id
|
|
39
|
+
*/
|
|
37
40
|
getId(): string;
|
|
41
|
+
get createdAt(): Date;
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated use createdAt
|
|
44
|
+
*/
|
|
38
45
|
getCreatedAt(): Date;
|
|
39
|
-
update(newData: D): void;
|
|
46
|
+
update(newData: Omit<D, 'id' | 'createdAt' | 'discardedAt'>): void;
|
|
40
47
|
wasCreated(): boolean;
|
|
41
48
|
validate(): void;
|
|
42
|
-
discard(): void;
|
|
43
49
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
channelName: string;
|
|
49
|
-
id: string;
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated Should use IEntityData
|
|
52
|
+
*/
|
|
53
|
+
interface IPersistentData extends IEntityData {
|
|
50
54
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated Should use Entity
|
|
57
|
+
*/
|
|
58
|
+
declare class Persistent<D extends IPersistentData> extends Entity<D> {
|
|
54
59
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
|
|
61
|
+
type IEnvType = 'development' | 'staging' | 'testing' | 'production';
|
|
62
|
+
declare class Env {
|
|
63
|
+
private envType;
|
|
64
|
+
constructor();
|
|
65
|
+
isDevelopment(): boolean;
|
|
66
|
+
isProduction(): boolean;
|
|
67
|
+
isTesting(): boolean;
|
|
68
|
+
requireString(varName: string, options?: {
|
|
69
|
+
default?: string;
|
|
70
|
+
}): string;
|
|
71
|
+
requireNumber(varName: string, options?: {
|
|
72
|
+
default?: number;
|
|
73
|
+
}): number;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface ICustomErrorData {
|
|
77
|
+
message: string;
|
|
78
|
+
humanMessage?: string;
|
|
79
|
+
code?: string;
|
|
80
|
+
httpCode?: number;
|
|
81
|
+
cause?: Error;
|
|
82
|
+
info?: any;
|
|
83
|
+
}
|
|
84
|
+
declare class CustomError extends Error {
|
|
85
|
+
humanMessage?: string;
|
|
86
|
+
code?: string;
|
|
87
|
+
httpCode?: number;
|
|
88
|
+
info?: any;
|
|
89
|
+
constructor(data: ICustomErrorData);
|
|
63
90
|
}
|
|
64
91
|
|
|
65
|
-
|
|
92
|
+
type IConstructor<T> = new (...args: any[]) => T;
|
|
93
|
+
|
|
94
|
+
declare class Container implements DependencyContainer {
|
|
95
|
+
register(token: unknown, provider: unknown, options?: unknown): DependencyContainer;
|
|
96
|
+
registerSingleton(from: unknown, to?: unknown): DependencyContainer;
|
|
97
|
+
registerType<T>(from: InjectionToken<T>, to: InjectionToken<T>): DependencyContainer;
|
|
98
|
+
registerInstance<T>(token: InjectionToken<T>, instance: T): DependencyContainer;
|
|
99
|
+
resolve<T>(token: InjectionToken<T>): T;
|
|
100
|
+
resolveAll<T>(token: InjectionToken<T>): T[];
|
|
101
|
+
isRegistered<T>(token: InjectionToken<T>, recursive?: boolean): boolean;
|
|
102
|
+
reset(): void;
|
|
103
|
+
clearInstances(): void;
|
|
104
|
+
createChildContainer(): DependencyContainer;
|
|
105
|
+
beforeResolution<T>(token: InjectionToken<T>, callback: PreResolutionInterceptorCallback<T>, options?: InterceptionOptions): void;
|
|
106
|
+
afterResolution<T>(token: InjectionToken<T>, callback: PostResolutionInterceptorCallback<T>, options?: InterceptionOptions): void;
|
|
107
|
+
dispose(): Promise<void> | void;
|
|
66
108
|
}
|
|
67
109
|
|
|
68
|
-
|
|
110
|
+
declare const injectable: typeof tsyringe.injectable;
|
|
111
|
+
declare const container: tsyringe.DependencyContainer;
|
|
112
|
+
declare const singleton: typeof tsyringe.singleton;
|
|
113
|
+
declare const inject: typeof tsyringe.inject;
|
|
114
|
+
declare const scoped: typeof tsyringe.scoped;
|
|
115
|
+
declare const Lifecycle: typeof tsyringe.Lifecycle;
|
|
116
|
+
|
|
117
|
+
declare class Logger {
|
|
118
|
+
private debuggers;
|
|
119
|
+
constructor(name: string);
|
|
120
|
+
trace(...args: any[]): void;
|
|
121
|
+
debug(...args: any[]): void;
|
|
122
|
+
info(...args: any[]): void;
|
|
123
|
+
warn(...args: any[]): void;
|
|
124
|
+
error(...args: any[]): void;
|
|
125
|
+
fatal(...args: any[]): void;
|
|
126
|
+
private log;
|
|
69
127
|
}
|
|
70
128
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
id: string;
|
|
129
|
+
declare class Mapper {
|
|
130
|
+
map<T>(data: any, ctor: IConstructor<T>): T;
|
|
74
131
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
};
|
|
132
|
+
|
|
133
|
+
interface PasswordHashOptions {
|
|
134
|
+
password: string;
|
|
135
|
+
saltLength?: number;
|
|
136
|
+
keyLength?: number;
|
|
81
137
|
}
|
|
82
|
-
declare class
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
138
|
+
declare class Password {
|
|
139
|
+
static hash(options: PasswordHashOptions): string;
|
|
140
|
+
static isValid(req: {
|
|
141
|
+
password: string;
|
|
142
|
+
hash: string;
|
|
143
|
+
}): boolean;
|
|
144
|
+
static generate(length: number): string;
|
|
88
145
|
}
|
|
89
146
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
147
|
+
declare class Random {
|
|
148
|
+
static integer(options: {
|
|
149
|
+
min: number;
|
|
150
|
+
max: number;
|
|
151
|
+
}): number;
|
|
152
|
+
static slug(name: string, options: {
|
|
153
|
+
randomLength: number;
|
|
154
|
+
}): string;
|
|
155
|
+
static alphaNumeric(length: number): string;
|
|
156
|
+
static alphaNumericLowerCase(length: number): string;
|
|
157
|
+
static numberCode(length: number): string;
|
|
100
158
|
}
|
|
101
159
|
|
|
102
|
-
interface
|
|
103
|
-
id: string
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
160
|
+
interface ICrudRepository<T> {
|
|
161
|
+
find(id: string): Promise<T | null>;
|
|
162
|
+
findOrThrow(id: string): Promise<T>;
|
|
163
|
+
findByIds(ids: string[]): Promise<T[]>;
|
|
164
|
+
findAll(id: string): Promise<T[]>;
|
|
165
|
+
create(item: T): Promise<void>;
|
|
166
|
+
update(item: T): Promise<void>;
|
|
167
|
+
delete(item: T): Promise<void>;
|
|
107
168
|
}
|
|
108
169
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
170
|
+
declare function isModel(model: IConstructor<any>): (target: object, propertyKey: string | symbol) => void;
|
|
171
|
+
|
|
172
|
+
declare function isOptional(): (target: object, propertyKey: string | symbol) => void;
|
|
173
|
+
|
|
174
|
+
interface IValidationError {
|
|
175
|
+
description: string;
|
|
176
|
+
}
|
|
177
|
+
interface IModelValidationError extends IValidationError {
|
|
178
|
+
properties: {
|
|
179
|
+
[key: string]: string[];
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
interface IArrayValidationError extends IValidationError {
|
|
183
|
+
items: (IValidationError[] | null)[];
|
|
184
|
+
}
|
|
185
|
+
type IValidationResult<V> = {
|
|
186
|
+
value: V;
|
|
187
|
+
error?: undefined;
|
|
188
|
+
} | {
|
|
189
|
+
value?: undefined;
|
|
190
|
+
error: IValidationError;
|
|
112
191
|
};
|
|
113
|
-
type
|
|
114
|
-
|
|
115
|
-
|
|
192
|
+
type IModelValidationResult<V> = {
|
|
193
|
+
value: V;
|
|
194
|
+
error?: undefined;
|
|
195
|
+
} | {
|
|
196
|
+
value?: undefined;
|
|
197
|
+
error: IModelValidationError;
|
|
116
198
|
};
|
|
117
|
-
type
|
|
118
|
-
|
|
119
|
-
|
|
199
|
+
type IArrayValidationResult<V> = {
|
|
200
|
+
value: V[];
|
|
201
|
+
error?: undefined;
|
|
202
|
+
} | {
|
|
203
|
+
value?: undefined;
|
|
204
|
+
error: IArrayValidationError;
|
|
120
205
|
};
|
|
121
|
-
type
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
206
|
+
type IValidator<V = any, O = any> = (value: V, options: O) => IValidationResult<V>;
|
|
207
|
+
interface IPropertyValidatorInfo {
|
|
208
|
+
propertyName: string;
|
|
209
|
+
validator: IValidator;
|
|
210
|
+
validatorOptions?: any;
|
|
211
|
+
}
|
|
212
|
+
type IModelValidatorsInfo<V> = {
|
|
213
|
+
modelConstructor: IConstructor<V>;
|
|
214
|
+
properties: {
|
|
215
|
+
[prop: string]: {
|
|
216
|
+
isOptional?: boolean;
|
|
217
|
+
validators?: IPropertyValidatorInfo[];
|
|
218
|
+
} | undefined;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
interface IValidateArrayOptions {
|
|
223
|
+
minLength?: number;
|
|
224
|
+
maxLength?: number;
|
|
225
|
+
}
|
|
226
|
+
interface IValidateArrayOptionsWithItemsValidators extends IValidateArrayOptions {
|
|
227
|
+
itemsValidator?: {
|
|
228
|
+
validator: IValidator;
|
|
229
|
+
options: any;
|
|
230
|
+
}[];
|
|
130
231
|
}
|
|
232
|
+
declare function validateArray(value: any, options?: IValidateArrayOptionsWithItemsValidators): IArrayValidationResult<any>;
|
|
131
233
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
234
|
+
declare function isArray(options?: IValidateArrayOptions): (target: object, propertyKey: string | symbol) => void;
|
|
235
|
+
|
|
236
|
+
interface IValidatorMetadata {
|
|
237
|
+
modelConstructor: IConstructor<any>;
|
|
238
|
+
propertyName: string;
|
|
239
|
+
validator: IValidator;
|
|
240
|
+
validatorOptions?: any;
|
|
135
241
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
242
|
+
|
|
243
|
+
declare class ValidationMetadataStore {
|
|
244
|
+
private validators;
|
|
245
|
+
saveValidatorMetadata(validatorMetadata: IValidatorMetadata): void;
|
|
246
|
+
getModelValidatorsInfo<V>(modelConstructor: IConstructor<V>): IModelValidatorsInfo<V>;
|
|
247
|
+
private getConstructorPropertiesValidatorsInfo;
|
|
139
248
|
}
|
|
140
249
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
250
|
+
declare function validateModel<V>(value: any, info: IModelValidatorsInfo<V>): IModelValidationResult<V>;
|
|
251
|
+
|
|
252
|
+
declare function validate<V>(value: any, modelConstructor: IConstructor<V>): IModelValidationResult<V>;
|
|
253
|
+
|
|
254
|
+
declare function modelInfo<V>(modelConstructor: IConstructor<V>): IModelValidatorsInfo<V>;
|
|
255
|
+
|
|
256
|
+
declare function isBoolean(): (target: object, propertyKey: string | symbol) => void;
|
|
257
|
+
|
|
258
|
+
declare function validateIsBoolean(value: any): IValidationResult<boolean>;
|
|
259
|
+
|
|
260
|
+
declare function isDate(): (target: object, propertyKey: string | symbol) => void;
|
|
261
|
+
|
|
262
|
+
declare function validateIsDate(value: any): IValidationResult<Date>;
|
|
263
|
+
|
|
264
|
+
interface IValidateIsInOptions {
|
|
265
|
+
values: (number | string | boolean | null)[];
|
|
145
266
|
}
|
|
146
|
-
declare
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
267
|
+
declare function validateIsIn(value: any, options: IValidateIsInOptions): IValidationResult<any>;
|
|
268
|
+
|
|
269
|
+
declare function isIn(values: IValidateIsInOptions['values']): (target: object, propertyKey: string | symbol) => void;
|
|
270
|
+
|
|
271
|
+
declare function isNotEmpty(): (target: object, propertyKey: string | symbol) => void;
|
|
272
|
+
|
|
273
|
+
declare function validateIsNotEmpty(value: any): IValidationResult<any>;
|
|
274
|
+
|
|
275
|
+
declare function isNumber(): (target: object, propertyKey: string | symbol) => void;
|
|
276
|
+
|
|
277
|
+
declare function validateIsNumber(value: any): IValidationResult<number>;
|
|
278
|
+
|
|
279
|
+
declare function isPresent(): (target: object, propertyKey: string | symbol) => void;
|
|
280
|
+
|
|
281
|
+
declare function validateIsPresent(value: any): IValidationResult<any>;
|
|
282
|
+
|
|
283
|
+
declare function isString(): (target: object, propertyKey: string | symbol) => void;
|
|
284
|
+
|
|
285
|
+
declare function validateIsString(value: any): IValidationResult<string>;
|
|
286
|
+
|
|
287
|
+
declare function max(limit: any): (target: object, propertyKey: string | symbol) => void;
|
|
288
|
+
|
|
289
|
+
interface IValidateMaxOptions {
|
|
290
|
+
limit: any;
|
|
150
291
|
}
|
|
292
|
+
declare function validateMax(value: any, options: IValidateMaxOptions): IValidationResult<any>;
|
|
151
293
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
294
|
+
declare function min(limit: any): (target: object, propertyKey: string | symbol) => void;
|
|
295
|
+
|
|
296
|
+
interface IValidateMinOptions {
|
|
297
|
+
limit: any;
|
|
156
298
|
}
|
|
157
|
-
declare
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
299
|
+
declare function validateMin(value: any, options: IValidateMinOptions): IValidationResult<any>;
|
|
300
|
+
|
|
301
|
+
interface ICommandConfig {
|
|
302
|
+
name?: string;
|
|
161
303
|
}
|
|
304
|
+
declare function command(config?: ICommandConfig): (target: IConstructor<any>) => void;
|
|
162
305
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
chat: Chat;
|
|
166
|
-
user: User | null;
|
|
306
|
+
declare class Command<T extends IStorableData> extends Storable<T> {
|
|
307
|
+
getData(): T;
|
|
167
308
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
user: User | null;
|
|
172
|
-
constructor(message: IConnectionChatMessage, chat: Chat, user: User | null);
|
|
309
|
+
|
|
310
|
+
interface ICommandHandler<C extends Command<any>> {
|
|
311
|
+
handle(command: C): void | Promise<void>;
|
|
173
312
|
}
|
|
174
313
|
|
|
175
|
-
interface
|
|
176
|
-
|
|
177
|
-
rev(input: T2): T1;
|
|
314
|
+
interface ICommandHandlerConfig<C extends Command<any>> {
|
|
315
|
+
command: IConstructor<C>;
|
|
178
316
|
}
|
|
317
|
+
declare function commandHandler<C extends Command<any>>(config: ICommandHandlerConfig<C>): (target: IConstructor<ICommandHandler<C>>) => void;
|
|
179
318
|
|
|
180
|
-
|
|
319
|
+
declare class CommandMetadataStore {
|
|
320
|
+
private handlersMap;
|
|
321
|
+
private handlersInverseMap;
|
|
322
|
+
private commandsMap;
|
|
323
|
+
private commandsInverseMap;
|
|
324
|
+
registerCommand(command: IConstructor<Command<any>>, commandName: string): void;
|
|
325
|
+
registerHandler(command: IConstructor<Command<any>>, handlerConstructor: IConstructor<ICommandHandler<any>>): void;
|
|
326
|
+
getHandlerForCommandName(commandName: string): IConstructor<ICommandHandler<any>> | null;
|
|
327
|
+
getCommandNameForHandler(handlerConstructor: IConstructor<ICommandHandler<any>>): string | null;
|
|
328
|
+
getCommandName(command: IConstructor<Command<any>>): string | null;
|
|
329
|
+
getCommandForCommandName(commandName: string): IConstructor<Command<any>> | null;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
interface IJobData extends IEntityData {
|
|
333
|
+
commandName: string;
|
|
334
|
+
commandData: any;
|
|
335
|
+
startedAt?: number;
|
|
336
|
+
successAt?: number;
|
|
337
|
+
failedAt?: number;
|
|
338
|
+
retryAt?: number;
|
|
339
|
+
error?: {
|
|
340
|
+
message: string;
|
|
341
|
+
stack?: string;
|
|
342
|
+
info?: any;
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
declare class Job extends Entity<IJobData> {
|
|
346
|
+
get commandName(): string;
|
|
347
|
+
hasFinished(): boolean;
|
|
348
|
+
setAsStarted(): void;
|
|
349
|
+
setAsSuccess(): void;
|
|
350
|
+
setAsFailed(error: Error): void;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
interface IJobRepository extends ICrudRepository<Job> {
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
declare class JobRepository implements IJobRepository {
|
|
357
|
+
find(id: string): Promise<Job | null>;
|
|
358
|
+
findOrThrow(id: string): Promise<Job>;
|
|
359
|
+
findByIds(ids: string[]): Promise<Job[]>;
|
|
360
|
+
findAll(id: string): Promise<Job[]>;
|
|
361
|
+
create(item: Job): Promise<void>;
|
|
362
|
+
update(item: Job): Promise<void>;
|
|
363
|
+
delete(item: Job): Promise<void>;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
interface IJobEvent extends IStorableData {
|
|
367
|
+
jobId: string;
|
|
368
|
+
type: 'created';
|
|
369
|
+
}
|
|
370
|
+
type IJobEventListener = (event: IJobEvent) => void | Promise<void>;
|
|
371
|
+
declare class JobsEventsHub {
|
|
372
|
+
private logger;
|
|
373
|
+
private jobsEventsListener;
|
|
374
|
+
notifyJobCreated(job: Job): void;
|
|
375
|
+
listenJobsEvents(listener: IJobEventListener): void;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
declare class Async {
|
|
379
|
+
private jobRepository;
|
|
380
|
+
private handlerContainer;
|
|
381
|
+
private jobsEventsHub;
|
|
382
|
+
constructor(jobRepository: JobRepository, handlerContainer: CommandMetadataStore, jobsEventsHub: JobsEventsHub);
|
|
383
|
+
run<T extends IStorableData>(command: Command<T>): Promise<Job>;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
declare class JobRunner {
|
|
387
|
+
private jobRepository;
|
|
388
|
+
private handlerContainer;
|
|
389
|
+
private logger;
|
|
390
|
+
constructor(jobRepository: JobRepository, handlerContainer: CommandMetadataStore);
|
|
391
|
+
run(job: Job): Promise<void>;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
declare function runAsyncCommandHandlers(handlers: IConstructor<ICommandHandler<any>>[]): void;
|
|
395
|
+
|
|
396
|
+
interface IChatConnection extends IStorableData {
|
|
397
|
+
channelName: string;
|
|
398
|
+
id: string;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
type IChatType = 'PRIVATE' | 'GROUP';
|
|
402
|
+
|
|
403
|
+
interface IChatData extends IEntityData {
|
|
404
|
+
type: IChatType;
|
|
405
|
+
connections: IChatConnection[];
|
|
406
|
+
}
|
|
407
|
+
declare class Chat extends Entity<IChatData> {
|
|
408
|
+
constructor(data: IChatData);
|
|
409
|
+
isPrivate(): boolean;
|
|
410
|
+
isGroup(): boolean;
|
|
411
|
+
hasConnection(connection: IChatConnection): boolean;
|
|
412
|
+
private validatePrivateChat;
|
|
413
|
+
private validateGroupChat;
|
|
414
|
+
validate(): void;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
interface IMindsetFunctionConfig {
|
|
418
|
+
description: string;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
declare function mindsetFunction(config: IMindsetFunctionConfig): (target: object, propertyKey: string | symbol) => void;
|
|
422
|
+
|
|
423
|
+
declare const MINDSET_FUNCTION_DECORATION_FUNCTION = "mindsetFunction";
|
|
424
|
+
|
|
425
|
+
interface IMindsetFunctionDecoration {
|
|
426
|
+
decorationName: string;
|
|
427
|
+
functionName: string;
|
|
428
|
+
constructor: Function;
|
|
429
|
+
paramsTypes: Function[];
|
|
430
|
+
decorationConfig: any;
|
|
431
|
+
}
|
|
181
432
|
|
|
182
433
|
interface IMindsetIdentity {
|
|
183
434
|
name: string;
|
|
@@ -186,15 +437,21 @@ interface IMindsetIdentity {
|
|
|
186
437
|
personality?: string;
|
|
187
438
|
emotions?: string;
|
|
188
439
|
}
|
|
440
|
+
interface IMindsetLlm {
|
|
441
|
+
provider?: string;
|
|
442
|
+
model: string;
|
|
443
|
+
}
|
|
189
444
|
interface IMindset {
|
|
190
445
|
identity(): Promise<IMindsetIdentity>;
|
|
191
446
|
skills(): Promise<string>;
|
|
192
447
|
limits(): Promise<string>;
|
|
448
|
+
llms(): Promise<IMindsetLlm[]>;
|
|
193
449
|
}
|
|
194
450
|
declare class Mindset implements IMindset {
|
|
195
451
|
identity(): Promise<IMindsetIdentity>;
|
|
196
452
|
skills(): Promise<string>;
|
|
197
453
|
limits(): Promise<string>;
|
|
454
|
+
llms(): Promise<IMindsetLlm[]>;
|
|
198
455
|
}
|
|
199
456
|
|
|
200
457
|
interface IMindsetConfig {
|
|
@@ -226,8 +483,6 @@ interface IMindsetModuleDecoration {
|
|
|
226
483
|
decorationConfig: any;
|
|
227
484
|
}
|
|
228
485
|
|
|
229
|
-
declare function isOptional(): PropertyDecorator;
|
|
230
|
-
|
|
231
486
|
interface IParamConfig {
|
|
232
487
|
name?: string;
|
|
233
488
|
optional?: boolean;
|
|
@@ -285,26 +540,17 @@ declare class MindsetMetadataStore {
|
|
|
285
540
|
getMindsetMetadata(ctor: Function): IMindsetMetadata;
|
|
286
541
|
}
|
|
287
542
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
createChildContainer(): DependencyContainer;
|
|
299
|
-
beforeResolution<T>(token: InjectionToken<T>, callback: PreResolutionInterceptorCallback<T>, options?: InterceptionOptions): void;
|
|
300
|
-
afterResolution<T>(token: InjectionToken<T>, callback: PostResolutionInterceptorCallback<T>, options?: InterceptionOptions): void;
|
|
301
|
-
dispose(): Promise<void> | void;
|
|
543
|
+
interface IMindsetToolParameter {
|
|
544
|
+
type: string;
|
|
545
|
+
name: string;
|
|
546
|
+
description: string;
|
|
547
|
+
}
|
|
548
|
+
interface IMindsetTool {
|
|
549
|
+
language: string;
|
|
550
|
+
name: string;
|
|
551
|
+
description: string;
|
|
552
|
+
parameters: IMindsetToolParameter[];
|
|
302
553
|
}
|
|
303
|
-
|
|
304
|
-
declare const injectable: typeof tsyringe.injectable;
|
|
305
|
-
declare const container: tsyringe.DependencyContainer;
|
|
306
|
-
declare const singleton: typeof tsyringe.singleton;
|
|
307
|
-
declare const inject: typeof tsyringe.inject;
|
|
308
554
|
|
|
309
555
|
declare class MindsetOperator implements IMindset {
|
|
310
556
|
private mindset;
|
|
@@ -314,99 +560,124 @@ declare class MindsetOperator implements IMindset {
|
|
|
314
560
|
identity(): Promise<IMindsetIdentity>;
|
|
315
561
|
skills(): Promise<string>;
|
|
316
562
|
limits(): Promise<string>;
|
|
563
|
+
llms(): Promise<IMindsetLlm[]>;
|
|
564
|
+
systemPrompt(): Promise<string>;
|
|
565
|
+
tools(): IMindsetTool[];
|
|
566
|
+
protected tool(fn: IMindsetFunctionMetadata, module: IMindsetModuleMetadata): IMindsetTool;
|
|
567
|
+
protected toolParameter(param: IMindsetFunctionParamMetadata): IMindsetToolParameter;
|
|
317
568
|
callFunction(name: string, params: string): Promise<string>;
|
|
318
|
-
allFunctionsDescriptors(): Promise<{
|
|
319
|
-
readonly type: "function";
|
|
320
|
-
readonly name: string;
|
|
321
|
-
readonly description: string;
|
|
322
|
-
readonly parameters: {
|
|
323
|
-
readonly type: "object";
|
|
324
|
-
readonly properties: {};
|
|
325
|
-
readonly required: string[];
|
|
326
|
-
};
|
|
327
|
-
}[]>;
|
|
328
|
-
private functionDescriptor;
|
|
329
|
-
private toolParam;
|
|
330
569
|
}
|
|
331
570
|
|
|
332
|
-
|
|
571
|
+
interface IChatMessage extends IStorableData {
|
|
572
|
+
senderId?: string;
|
|
573
|
+
senderName?: string;
|
|
574
|
+
text?: string;
|
|
575
|
+
}
|
|
333
576
|
|
|
334
|
-
interface
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
577
|
+
interface IFunctionCall extends IStorableData {
|
|
578
|
+
id: string;
|
|
579
|
+
name: string;
|
|
580
|
+
arguments?: string;
|
|
581
|
+
result?: string;
|
|
338
582
|
}
|
|
339
583
|
|
|
340
|
-
declare
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
584
|
+
declare const chatItemTypeOptions: readonly ["botMessage", "humanMessage", "functionCall"];
|
|
585
|
+
type IBotMessageItem = {
|
|
586
|
+
type: 'botMessage';
|
|
587
|
+
botMessage: IChatMessage;
|
|
588
|
+
};
|
|
589
|
+
type IHumanMessageItem = {
|
|
590
|
+
type: 'humanMessage';
|
|
591
|
+
humanMessage: IChatMessage;
|
|
592
|
+
};
|
|
593
|
+
type IFunctionCallItem = {
|
|
594
|
+
type: 'functionCall';
|
|
595
|
+
functionCall: IFunctionCall;
|
|
596
|
+
};
|
|
597
|
+
type IChatItem = IBotMessageItem | IHumanMessageItem | IFunctionCallItem;
|
|
598
|
+
type IChatItemType = (typeof chatItemTypeOptions)[number];
|
|
599
|
+
|
|
600
|
+
interface ILanguageModelUsage {
|
|
601
|
+
inputTokens: number;
|
|
602
|
+
outputTokens: number;
|
|
344
603
|
}
|
|
345
604
|
|
|
346
|
-
interface
|
|
347
|
-
|
|
605
|
+
interface IChatAdapterNextItemReq {
|
|
606
|
+
model: string;
|
|
607
|
+
systemPrompt: string;
|
|
608
|
+
tools: IMindsetTool[];
|
|
609
|
+
prevItems: IChatItem[];
|
|
348
610
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
generateNextChatItem(chatItems: ChatItem[]): Promise<ChatItem>;
|
|
353
|
-
protected systemPrompt(): Promise<string>;
|
|
354
|
-
protected buildBotMessageItem(text: string): Promise<ChatItem>;
|
|
355
|
-
protected buildFunctionCallItem(id: string, functionName: string, functionArguments: string): Promise<ChatItem>;
|
|
611
|
+
interface IChatAdapterNextItemRes {
|
|
612
|
+
chatItem: IChatItem;
|
|
613
|
+
usage: ILanguageModelUsage;
|
|
356
614
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
sendMessage(message: IChatMessage, callback: (message: IChatMessage) => void): void | Promise<void>;
|
|
615
|
+
interface IChatAdapter {
|
|
616
|
+
nextItem(req: IChatAdapterNextItemReq): Promise<IChatAdapterNextItemRes>;
|
|
360
617
|
}
|
|
361
618
|
|
|
362
|
-
declare class
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
sendMessage(message: IConnectionChatMessage, callback: (message: IChatMessage) => void): Promise<void>;
|
|
367
|
-
protected processLoop(callback: (message: IChatMessage) => void): Promise<void>;
|
|
619
|
+
declare class ChatAdapter implements IChatAdapter {
|
|
620
|
+
nextItem(req: IChatAdapterNextItemReq & {
|
|
621
|
+
provider?: string;
|
|
622
|
+
}): Promise<IChatAdapterNextItemRes>;
|
|
368
623
|
}
|
|
369
624
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
625
|
+
type IChatItemData = IEntityData & IChatItem;
|
|
626
|
+
declare class ChatItem extends Entity<IChatItemData> {
|
|
627
|
+
get type(): "botMessage" | "humanMessage" | "functionCall";
|
|
628
|
+
get botMessage(): IChatMessage;
|
|
629
|
+
get functionCall(): IFunctionCall;
|
|
630
|
+
setFunctionResult(result: string): void;
|
|
631
|
+
getData(): IChatItemData;
|
|
377
632
|
}
|
|
378
633
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
private logger;
|
|
383
|
-
constructor(mindset: MindsetOperator);
|
|
384
|
-
generateNextChatItem(chatItems: ChatItem[]): Promise<ChatItem>;
|
|
385
|
-
private mapChatItems;
|
|
634
|
+
interface IChatMemory {
|
|
635
|
+
findLastItems(count: number): Promise<ChatItem[]>;
|
|
636
|
+
create(item: ChatItem): Promise<void>;
|
|
386
637
|
}
|
|
387
638
|
|
|
388
|
-
declare
|
|
639
|
+
declare class ChatMemory implements IChatMemory {
|
|
640
|
+
findLastItems(count: number): Promise<ChatItem[]>;
|
|
641
|
+
create(item: ChatItem): Promise<void>;
|
|
642
|
+
}
|
|
389
643
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
constructor(chatRepository: ChatRepository);
|
|
393
|
-
resolve(connection: IChatConnection): Promise<Chat>;
|
|
394
|
-
private resolveGroupChat;
|
|
395
|
-
private resolvePrivateChat;
|
|
644
|
+
interface IChatBot {
|
|
645
|
+
sendMessage(message: IChatMessage, callback: (message: IChatMessage) => void): void | Promise<void>;
|
|
396
646
|
}
|
|
397
647
|
|
|
398
|
-
|
|
399
|
-
|
|
648
|
+
declare class ChatBot implements IChatBot {
|
|
649
|
+
private memory;
|
|
650
|
+
private adapter;
|
|
651
|
+
private mindset;
|
|
652
|
+
constructor(memory: ChatMemory, adapter: ChatAdapter, mindset: MindsetOperator);
|
|
653
|
+
sendMessage(message: IChatMessage, callback: (message: IChatMessage) => void): Promise<void>;
|
|
654
|
+
protected processLoop(callback: (message: IChatMessage) => void): Promise<void>;
|
|
400
655
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
656
|
+
|
|
657
|
+
interface IChatRepository {
|
|
658
|
+
create(chat: Chat): Promise<void>;
|
|
659
|
+
findByConnection(query: IChatConnection): Promise<Chat | null>;
|
|
660
|
+
findMemory(chatId: string): Promise<IChatMemory | null>;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
declare class ChatRepository implements IChatRepository {
|
|
664
|
+
create(chat: Chat): Promise<void>;
|
|
665
|
+
findByConnection(query: IChatConnection): Promise<Chat | null>;
|
|
666
|
+
findMemory(chatId: string): Promise<IChatMemory | null>;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
declare function chatBot(mindset: IConstructor<IMindset>): (target: object, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
|
|
670
|
+
|
|
671
|
+
interface IChatBotMetadata {
|
|
672
|
+
constructor: IConstructor<any>;
|
|
673
|
+
mindsetConstructor: IConstructor<IMindset>;
|
|
674
|
+
injectionToken: string;
|
|
404
675
|
}
|
|
405
676
|
|
|
406
|
-
declare class
|
|
407
|
-
private
|
|
408
|
-
|
|
409
|
-
|
|
677
|
+
declare class ChatBotMetadataStore {
|
|
678
|
+
private chatBots;
|
|
679
|
+
saveChatBotMetadata(chatBot: IChatBotMetadata): void;
|
|
680
|
+
getChatBotsMetadata(): IChatBotMetadata[];
|
|
410
681
|
}
|
|
411
682
|
|
|
412
683
|
interface IchatControllerConfig {
|
|
@@ -418,6 +689,20 @@ interface IChatControllerMetadata {
|
|
|
418
689
|
controllerConstructor: Function;
|
|
419
690
|
}
|
|
420
691
|
|
|
692
|
+
interface IReceivedMessage {
|
|
693
|
+
message: IChatMessage;
|
|
694
|
+
reply: (message: IChatMessage) => void;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
interface IChannelMessage extends IReceivedMessage {
|
|
698
|
+
chatConnection: IChatConnection;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
interface IChatChannel {
|
|
702
|
+
listen(callback: (received: IChannelMessage) => void): void;
|
|
703
|
+
connect(): void;
|
|
704
|
+
}
|
|
705
|
+
|
|
421
706
|
interface IChannelMetadata {
|
|
422
707
|
controllerConstructor: IConstructor<any>;
|
|
423
708
|
functionName: string;
|
|
@@ -436,16 +721,20 @@ declare class ControllerMetadataStore {
|
|
|
436
721
|
} | null;
|
|
437
722
|
}
|
|
438
723
|
|
|
439
|
-
declare class
|
|
440
|
-
private
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
private
|
|
444
|
-
|
|
445
|
-
listen(callback: (message: IReceivedMessage) => void): void;
|
|
446
|
-
connect(): void;
|
|
724
|
+
declare class ChatResolver {
|
|
725
|
+
private chatRepository;
|
|
726
|
+
constructor(chatRepository: ChatRepository);
|
|
727
|
+
resolve(connection: IChatConnection): Promise<Chat>;
|
|
728
|
+
private resolveGroupChat;
|
|
729
|
+
private resolvePrivateChat;
|
|
447
730
|
}
|
|
448
731
|
|
|
732
|
+
interface IMessageContext extends IReceivedMessage {
|
|
733
|
+
chat: Chat;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
declare function runChatControllers(controllers: IConstructor<any>[]): void;
|
|
737
|
+
|
|
449
738
|
declare class HttpServerProvider {
|
|
450
739
|
server: Server | null;
|
|
451
740
|
private listening;
|
|
@@ -464,16 +753,152 @@ declare class ExpressProvider {
|
|
|
464
753
|
private createExpress;
|
|
465
754
|
}
|
|
466
755
|
|
|
467
|
-
interface
|
|
468
|
-
|
|
756
|
+
interface IMoneyData extends IStorableData {
|
|
757
|
+
amount: string;
|
|
758
|
+
currency: string;
|
|
759
|
+
}
|
|
760
|
+
declare class Money extends Storable<IMoneyData> {
|
|
761
|
+
getData(): {
|
|
762
|
+
[key: string]: IPrimitive | IStorableData | IPrimitive[] | IStorableData[];
|
|
763
|
+
amount: string;
|
|
764
|
+
currency: string;
|
|
765
|
+
};
|
|
766
|
+
get amount(): big_js.Big;
|
|
767
|
+
get currency(): string;
|
|
768
|
+
plus(money: Money): Money;
|
|
769
|
+
minus(money: Money): Money;
|
|
770
|
+
times(value: bigint | string): Money;
|
|
771
|
+
div(value: bigint | string): Money;
|
|
772
|
+
negative(): Money;
|
|
773
|
+
isGretterThan(money: Money): boolean;
|
|
774
|
+
protected validateEqualCurrencies(left: string, right: string): void;
|
|
775
|
+
static zero(currency: string): Money;
|
|
469
776
|
}
|
|
470
777
|
|
|
471
|
-
declare class
|
|
472
|
-
|
|
473
|
-
|
|
778
|
+
declare class MoneyDto {
|
|
779
|
+
amount: string;
|
|
780
|
+
currency: string;
|
|
474
781
|
}
|
|
475
782
|
|
|
476
|
-
|
|
783
|
+
type IPgRepositoryConfig<P extends Entity<IEntityData>> = {
|
|
784
|
+
schema?: string;
|
|
785
|
+
table: string;
|
|
786
|
+
constructor: IConstructor<P>;
|
|
787
|
+
add?: {
|
|
788
|
+
columns: {
|
|
789
|
+
[column: string]: {
|
|
790
|
+
type: string;
|
|
791
|
+
value: (item: P) => boolean | number | string | null | Date;
|
|
792
|
+
};
|
|
793
|
+
};
|
|
794
|
+
};
|
|
795
|
+
};
|
|
796
|
+
|
|
797
|
+
declare class PgRepositoryBase<P extends Entity<IEntityData>> {
|
|
798
|
+
protected pool: Pool;
|
|
799
|
+
protected config: IPgRepositoryConfig<any>;
|
|
800
|
+
private tableIsCreated;
|
|
801
|
+
protected schema: string;
|
|
802
|
+
protected table: string;
|
|
803
|
+
protected columnsList: string[];
|
|
804
|
+
protected columnsAndTypes: string;
|
|
805
|
+
protected columns: string;
|
|
806
|
+
protected vars: string;
|
|
807
|
+
protected updates: string;
|
|
808
|
+
addColumns: {
|
|
809
|
+
[columns: string]: {
|
|
810
|
+
type: string;
|
|
811
|
+
value: (item: P) => number | boolean | string | null | Date;
|
|
812
|
+
};
|
|
813
|
+
};
|
|
814
|
+
constructor(pool: Pool, config: IPgRepositoryConfig<any>);
|
|
815
|
+
protected values(item: P): (string | number | boolean | Date | null)[];
|
|
816
|
+
protected exec(sql: string, values: any[]): Promise<void>;
|
|
817
|
+
protected query(sql: string, values: any[]): Promise<P[]>;
|
|
818
|
+
protected connect(): Promise<Pool>;
|
|
819
|
+
protected ensureTable(): Promise<void>;
|
|
820
|
+
protected ensureColumns(): Promise<void>;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
declare class PgCrudRepository<P extends Entity<IEntityData>> extends PgRepositoryBase<P> implements ICrudRepository<P> {
|
|
824
|
+
protected readonly config: IPgRepositoryConfig<P>;
|
|
825
|
+
constructor(pool: Pool, config: IPgRepositoryConfig<P>);
|
|
826
|
+
find(id: string): Promise<P | null>;
|
|
827
|
+
findByIds(ids: string[]): Promise<P[]>;
|
|
828
|
+
findOrThrow(id: string): Promise<P>;
|
|
829
|
+
findAll(): Promise<P[]>;
|
|
830
|
+
create(item: P): Promise<void>;
|
|
831
|
+
update(item: P): Promise<void>;
|
|
832
|
+
delete(item: P): Promise<void>;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
interface IEndPointConfig {
|
|
836
|
+
path?: string;
|
|
837
|
+
disableJsonParser?: boolean;
|
|
838
|
+
disableUrlEncodedParser?: boolean;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
declare function onGet(config?: string | IEndPointConfig): (target: object, propertyKey: string | symbol) => void;
|
|
842
|
+
|
|
843
|
+
interface IMiddleware {
|
|
844
|
+
handle(req: Request, res: Response, container: DependencyContainer$1): Promise<void>;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
declare function middleware(middlewareConstructor: IConstructor<IMiddleware>): (target: object, propertyKey: string | symbol) => void;
|
|
848
|
+
|
|
849
|
+
declare function onPost(config?: string | IEndPointConfig): (target: object, propertyKey: string | symbol) => void;
|
|
850
|
+
|
|
851
|
+
declare function onPut(config?: string | IEndPointConfig): (target: object, propertyKey: string | symbol) => void;
|
|
852
|
+
|
|
853
|
+
declare function onDelete(config?: string | IEndPointConfig): (target: object, propertyKey: string | symbol) => void;
|
|
854
|
+
|
|
855
|
+
interface IRestControllerConfig {
|
|
856
|
+
path: string;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
declare function restController(config: string | IRestControllerConfig): (target: IConstructor<any>) => void;
|
|
860
|
+
|
|
861
|
+
interface IEndPointMetadata {
|
|
862
|
+
method: 'get' | 'post' | 'put' | 'delete';
|
|
863
|
+
config?: IEndPointConfig;
|
|
864
|
+
controllerConstructor: IConstructor<any>;
|
|
865
|
+
functionName: string;
|
|
866
|
+
paramsTypes: any[];
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
interface IMiddlewareMetadata {
|
|
870
|
+
controllerConstructor: IConstructor<any>;
|
|
871
|
+
functionName: string;
|
|
872
|
+
middlewareConstructor: IConstructor<IMiddleware>;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
interface IRestControllerMetadata {
|
|
876
|
+
controllerConstructor: IConstructor<any>;
|
|
877
|
+
path: string;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
declare class RestControllerMetadataStore {
|
|
881
|
+
private endPoints;
|
|
882
|
+
private middlewares;
|
|
883
|
+
private restControllers;
|
|
884
|
+
saveControllerMetadata(controllerMetadata: IRestControllerMetadata): void;
|
|
885
|
+
saveEndPointMetadata(endPointMetadata: IEndPointMetadata): void;
|
|
886
|
+
saveMiddlewareMetadata(middlewareMetadata: IMiddlewareMetadata): void;
|
|
887
|
+
getControllerEndPointsInfo(controllerConstructor: IConstructor<any>): {
|
|
888
|
+
middlewares: IMiddlewareMetadata[];
|
|
889
|
+
controller: IRestControllerMetadata;
|
|
890
|
+
method: "get" | "post" | "put" | "delete";
|
|
891
|
+
config?: IEndPointConfig;
|
|
892
|
+
controllerConstructor: IConstructor<any>;
|
|
893
|
+
functionName: string;
|
|
894
|
+
paramsTypes: any[];
|
|
895
|
+
}[];
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
declare function runRestControllers(controllers: IConstructor<any>[]): void;
|
|
899
|
+
|
|
900
|
+
declare const EXPRESS_REQ = "EXPRESS_REQ";
|
|
901
|
+
declare const EXPRESS_RES = "EXPRESS_RES";
|
|
477
902
|
|
|
478
903
|
declare class SocketServerProvider {
|
|
479
904
|
private httpServerProvider;
|
|
@@ -485,138 +910,422 @@ declare class SocketServerProvider {
|
|
|
485
910
|
private createSocketServer;
|
|
486
911
|
}
|
|
487
912
|
|
|
488
|
-
interface
|
|
489
|
-
|
|
490
|
-
userId: string;
|
|
491
|
-
senderName: string;
|
|
492
|
-
text: string;
|
|
913
|
+
interface IConnectionMiddleware {
|
|
914
|
+
handle(socket: Socket, container: DependencyContainer$1): Promise<void>;
|
|
493
915
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
private callBack;
|
|
500
|
-
private server;
|
|
501
|
-
constructor(config: SocketChannelConfig, socketServerProvider: SocketServerProvider, chatResolver: ChatResolver, userResolver: UserResolver);
|
|
502
|
-
listen(callback: (message: IReceivedMessage) => void): void;
|
|
503
|
-
connect(): void;
|
|
916
|
+
|
|
917
|
+
declare function connectionMiddleware(middlewareConstructor: IConstructor<IConnectionMiddleware>): (target: object, propertyKey: string | symbol) => void;
|
|
918
|
+
|
|
919
|
+
interface ISocketConnectionConfig {
|
|
920
|
+
namespace: string;
|
|
504
921
|
}
|
|
505
922
|
|
|
506
|
-
|
|
507
|
-
|
|
923
|
+
declare function socketConnection(config?: string | ISocketConnectionConfig): (target: object, propertyKey: string | symbol) => void;
|
|
924
|
+
|
|
925
|
+
interface ISocketControllerConfig {
|
|
926
|
+
namespace: string;
|
|
508
927
|
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
928
|
+
|
|
929
|
+
declare function socketController(config?: string | ISocketControllerConfig): (target: IConstructor<any>) => void;
|
|
930
|
+
|
|
931
|
+
interface ISocketEventConfig {
|
|
932
|
+
namespace?: string;
|
|
933
|
+
event: string;
|
|
512
934
|
}
|
|
513
935
|
|
|
514
|
-
declare function
|
|
936
|
+
declare function socketEvent(config: string | ISocketEventConfig): (target: object, propertyKey: string | symbol) => void;
|
|
515
937
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
private bot;
|
|
521
|
-
constructor(config: TelegramChannelConfig, chatResolver: ChatResolver, userResolver: UserResolver);
|
|
522
|
-
listen(callback: (message: IReceivedMessage) => void): void;
|
|
523
|
-
connect(): void;
|
|
938
|
+
interface IConnectionMiddlewareMetadata {
|
|
939
|
+
controllerConstructor: IConstructor<any>;
|
|
940
|
+
functionName: string;
|
|
941
|
+
middlewareConstructor: IConstructor<IConnectionMiddleware>;
|
|
524
942
|
}
|
|
525
943
|
|
|
526
|
-
interface
|
|
527
|
-
|
|
528
|
-
|
|
944
|
+
interface ISocketConnectionMetadata {
|
|
945
|
+
config?: ISocketConnectionConfig;
|
|
946
|
+
controllerConstructor: IConstructor<any>;
|
|
947
|
+
functionName: string;
|
|
948
|
+
paramsTypes: any[];
|
|
529
949
|
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
950
|
+
|
|
951
|
+
interface ISocketControllerMetadata {
|
|
952
|
+
controllerConstructor: IConstructor<any>;
|
|
953
|
+
config?: ISocketControllerConfig;
|
|
533
954
|
}
|
|
534
955
|
|
|
535
|
-
|
|
956
|
+
interface ISocketEventMetadata {
|
|
957
|
+
config: ISocketEventConfig;
|
|
958
|
+
controllerConstructor: IConstructor<any>;
|
|
959
|
+
functionName: string;
|
|
960
|
+
paramsTypes: any[];
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
declare class SocketControllerMetadataStore {
|
|
964
|
+
private socketControllers;
|
|
965
|
+
private socketConnections;
|
|
966
|
+
private socketEvents;
|
|
967
|
+
private connectionMiddlewares;
|
|
968
|
+
saveControllerMetadata(controllerMetadata: ISocketControllerMetadata): void;
|
|
969
|
+
saveSocketConnectionMetadata(socketConnectionMetadata: ISocketConnectionMetadata): void;
|
|
970
|
+
saveSocketEventMetadata(socketEventMetadata: ISocketEventMetadata): void;
|
|
971
|
+
saveConnectionMiddlewareMetadata(middlewareMetadata: IConnectionMiddlewareMetadata): void;
|
|
972
|
+
getControllerSockerConnectionsInfo(controllerConstructor: IConstructor<any>): {
|
|
973
|
+
events: ISocketEventMetadata[];
|
|
974
|
+
connectionMiddlewares: IConnectionMiddlewareMetadata[];
|
|
975
|
+
controller: ISocketControllerMetadata;
|
|
976
|
+
config?: ISocketConnectionConfig;
|
|
977
|
+
controllerConstructor: IConstructor<any>;
|
|
978
|
+
functionName: string;
|
|
979
|
+
paramsTypes: any[];
|
|
980
|
+
}[];
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
declare function runSocketControllers(controllers: IConstructor<any>[]): void;
|
|
984
|
+
|
|
985
|
+
declare class PgJobRepository extends PgCrudRepository<Job> implements IJobRepository {
|
|
986
|
+
constructor(pool: Pool);
|
|
987
|
+
}
|
|
536
988
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
989
|
+
declare function apiKeyConnectionGuard(): (target: object, propertyKey: string | symbol) => void;
|
|
990
|
+
|
|
991
|
+
declare function apiKeyGuard(): (target: object, propertyKey: string | symbol) => void;
|
|
992
|
+
|
|
993
|
+
interface IApiKeyData<A extends IStorableData> extends IEntityData {
|
|
994
|
+
passwordHash?: string;
|
|
995
|
+
authInfo: A;
|
|
996
|
+
name: string;
|
|
997
|
+
}
|
|
998
|
+
declare class ApiKey<A extends IStorableData> extends Entity<IApiKeyData<A>> {
|
|
999
|
+
get authInfo(): A;
|
|
1000
|
+
setAuthInfo(authInfo: A): void;
|
|
1001
|
+
generatePassword(): string;
|
|
1002
|
+
isValidPassword(password: string): boolean;
|
|
1003
|
+
validatePassword(password: string): void;
|
|
1004
|
+
static inflate(secret: string): {
|
|
1005
|
+
id: string;
|
|
1006
|
+
pass: string;
|
|
552
1007
|
};
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
parameters: IWhatsAppTemplateParameter[];
|
|
1008
|
+
static deflate(data: {
|
|
1009
|
+
id: string;
|
|
1010
|
+
pass: string;
|
|
1011
|
+
}): string;
|
|
558
1012
|
}
|
|
559
1013
|
|
|
560
|
-
interface
|
|
561
|
-
|
|
562
|
-
|
|
1014
|
+
interface IApiKeyRepository<A extends IStorableData> {
|
|
1015
|
+
find(id: string): Promise<ApiKey<A> | null>;
|
|
1016
|
+
findOrThrow(id: string): Promise<ApiKey<A>>;
|
|
1017
|
+
create(item: ApiKey<A>): Promise<void>;
|
|
1018
|
+
generate(req: IGenerateApiKeyReq<A>): Promise<IGenerateApiKeyRes>;
|
|
1019
|
+
findAuthInfo(secret: string): Promise<A>;
|
|
1020
|
+
}
|
|
1021
|
+
interface IGenerateApiKeyReq<A extends IStorableData> extends IStorableData {
|
|
1022
|
+
name: string;
|
|
1023
|
+
authInfo: A;
|
|
563
1024
|
}
|
|
564
|
-
interface
|
|
1025
|
+
interface IGenerateApiKeyRes {
|
|
565
1026
|
id: string;
|
|
566
|
-
|
|
1027
|
+
secret: string;
|
|
567
1028
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
1029
|
+
|
|
1030
|
+
declare class ApiKeyRepository<A extends IStorableData> implements IApiKeyRepository<A> {
|
|
1031
|
+
findAuthInfo(secret: string): Promise<A>;
|
|
1032
|
+
find(id: string): Promise<ApiKey<A> | null>;
|
|
1033
|
+
findOrThrow(id: string): Promise<ApiKey<A>>;
|
|
1034
|
+
create(item: ApiKey<A>): Promise<void>;
|
|
1035
|
+
generate(req: IGenerateApiKeyReq<A>): Promise<IGenerateApiKeyRes>;
|
|
1036
|
+
static generate(repository: ApiKeyRepository<any>, req: IGenerateApiKeyReq<any>): Promise<{
|
|
1037
|
+
id: string;
|
|
1038
|
+
secret: string;
|
|
1039
|
+
}>;
|
|
1040
|
+
static findAuthInfo<A extends IStorableData>(repository: ApiKeyRepository<A>, secret: string): Promise<A>;
|
|
572
1041
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
1042
|
+
|
|
1043
|
+
declare class ApiKeyConnectionGuardMiddleware implements IConnectionMiddleware {
|
|
1044
|
+
private apiKeyRepository;
|
|
1045
|
+
private auth;
|
|
1046
|
+
constructor(apiKeyRepository: ApiKeyRepository<any>, auth: Auth<any>);
|
|
1047
|
+
handle(socket: Socket, container: DependencyContainer$1): Promise<void>;
|
|
578
1048
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
1049
|
+
|
|
1050
|
+
declare class ApiKeyGuardMiddleware implements IMiddleware {
|
|
1051
|
+
private apiKeyRepository;
|
|
1052
|
+
private auth;
|
|
1053
|
+
constructor(apiKeyRepository: ApiKeyRepository<any>, auth: Auth<any>);
|
|
1054
|
+
handle(req: Request, res: Response, container: DependencyContainer$1): Promise<void>;
|
|
582
1055
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
1056
|
+
|
|
1057
|
+
declare class PgApiKeyRepository<A extends IStorableData> extends PgCrudRepository<ApiKey<A>> implements IApiKeyRepository<A> {
|
|
1058
|
+
constructor(pool: Pool);
|
|
1059
|
+
findAuthInfo(secret: string): Promise<A>;
|
|
1060
|
+
generate(req: IGenerateApiKeyReq<A>): Promise<IGenerateApiKeyRes>;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
declare class RemoteApiKeyRepository<A extends IStorableData> implements IApiKeyRepository<A> {
|
|
1064
|
+
private fetcher;
|
|
1065
|
+
private cacheSeconds;
|
|
1066
|
+
private cache;
|
|
1067
|
+
constructor(fetcher: (id: string) => Promise<ApiKey<A> | null>, cacheSeconds: number);
|
|
1068
|
+
find(id: string): Promise<ApiKey<A> | null>;
|
|
1069
|
+
findOrThrow(id: string): Promise<ApiKey<A>>;
|
|
1070
|
+
findAuthInfo(secret: string): Promise<A>;
|
|
1071
|
+
create(item: ApiKey<A>): Promise<void>;
|
|
1072
|
+
generate(req: IGenerateApiKeyReq<A>): Promise<IGenerateApiKeyRes>;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
declare function jwtConnectionGuard(): (target: object, propertyKey: string | symbol) => void;
|
|
1076
|
+
|
|
1077
|
+
declare function jwtGuard(): (target: object, propertyKey: string | symbol) => void;
|
|
1078
|
+
|
|
1079
|
+
interface IJwtRefreshTokenData<A extends IStorableData> extends IEntityData {
|
|
1080
|
+
authInfo: A;
|
|
1081
|
+
passwordHash?: string;
|
|
1082
|
+
expirationTime: number;
|
|
1083
|
+
}
|
|
1084
|
+
declare class JwtRefreshToken<A extends IStorableData> extends Entity<IJwtRefreshTokenData<A>> {
|
|
1085
|
+
get authInfo(): A;
|
|
1086
|
+
get expirationTime(): Date;
|
|
1087
|
+
generatePassword(): string;
|
|
1088
|
+
isValidPassword(password: string): boolean;
|
|
1089
|
+
validatePassword(password: string): void;
|
|
1090
|
+
static inflate(secret: string): {
|
|
1091
|
+
id: string;
|
|
1092
|
+
pass: string;
|
|
586
1093
|
};
|
|
587
|
-
|
|
1094
|
+
static deflate(data: {
|
|
1095
|
+
id: string;
|
|
1096
|
+
pass: string;
|
|
1097
|
+
}): string;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
interface IJwtRefreshTokenRepository<D extends IStorableData> extends ICrudRepository<JwtRefreshToken<D>> {
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
declare class JwtTokenDto {
|
|
1104
|
+
token?: string;
|
|
1105
|
+
expiration?: Date;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
declare class JwtAccessAndRefreshTokenDto {
|
|
1109
|
+
access?: JwtTokenDto;
|
|
1110
|
+
refresh?: JwtTokenDto;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
declare class JwtConfig {
|
|
1114
|
+
secretOrPublicKey: string;
|
|
1115
|
+
secretOrPrivateKey: string;
|
|
1116
|
+
algorithm: Algorithm;
|
|
1117
|
+
accessExpirationSeconds: number;
|
|
1118
|
+
refreshExpirationSeconds: number;
|
|
1119
|
+
constructor(env: Env);
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
declare class JwtSigner {
|
|
1123
|
+
private config;
|
|
1124
|
+
private mapper;
|
|
1125
|
+
constructor(config: JwtConfig, mapper: Mapper);
|
|
1126
|
+
signAccessToken<D extends IStorableData>(info: D | JwtRefreshToken<any>): Promise<JwtTokenDto>;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
declare class JwtRefreshTokenRepository<D extends IStorableData> implements IJwtRefreshTokenRepository<D> {
|
|
1130
|
+
find(id: string): Promise<JwtRefreshToken<D> | null>;
|
|
1131
|
+
findOrThrow(id: string): Promise<JwtRefreshToken<D>>;
|
|
1132
|
+
findByIds(ids: string[]): Promise<JwtRefreshToken<D>[]>;
|
|
1133
|
+
findAll(id: string): Promise<JwtRefreshToken<D>[]>;
|
|
1134
|
+
create(item: JwtRefreshToken<D>): Promise<void>;
|
|
1135
|
+
update(item: JwtRefreshToken<D>): Promise<void>;
|
|
1136
|
+
delete(item: JwtRefreshToken<D>): Promise<void>;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
declare class Jwt {
|
|
1140
|
+
private auth;
|
|
1141
|
+
private jwtSigner;
|
|
1142
|
+
private jwtRefreshTokenRepository;
|
|
1143
|
+
private config;
|
|
1144
|
+
constructor(auth: Auth<any>, jwtSigner: JwtSigner, jwtRefreshTokenRepository: JwtRefreshTokenRepository<any>, config: JwtConfig);
|
|
1145
|
+
createToken(): Promise<JwtAccessAndRefreshTokenDto>;
|
|
1146
|
+
refreshToken(refreshSecret: string): Promise<JwtTokenDto>;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
declare class JwtConnectionGuardMiddleware implements IConnectionMiddleware {
|
|
1150
|
+
private config;
|
|
1151
|
+
private auth;
|
|
1152
|
+
constructor(config: JwtConfig, auth: Auth<any>);
|
|
1153
|
+
handle(socket: Socket, container: DependencyContainer$1): Promise<void>;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
declare class JwtGuardMiddleware implements IMiddleware {
|
|
1157
|
+
private config;
|
|
1158
|
+
private auth;
|
|
1159
|
+
constructor(config: JwtConfig, auth: Auth<any>);
|
|
1160
|
+
handle(req: Request, res: Response, container: DependencyContainer$1): Promise<void>;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
declare class PgJwtRefreshTokenRepository<D extends IStorableData> extends PgCrudRepository<JwtRefreshToken<D>> implements IJwtRefreshTokenRepository<D> {
|
|
1164
|
+
constructor(pool: Pool);
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
declare class AnthropicChatAdapter implements IChatAdapter {
|
|
1168
|
+
private env;
|
|
1169
|
+
private anthropic;
|
|
1170
|
+
private logger;
|
|
1171
|
+
constructor(env: Env);
|
|
1172
|
+
nextItem(req: IChatAdapterNextItemReq): Promise<IChatAdapterNextItemRes>;
|
|
1173
|
+
private mapChatItems;
|
|
1174
|
+
private mapHumanMessage;
|
|
1175
|
+
private mapBotMessage;
|
|
1176
|
+
private mapFunctionCall;
|
|
1177
|
+
private mapTool;
|
|
1178
|
+
private mapResponse;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
declare class DeepSeekChatAdapter implements IChatAdapter {
|
|
1182
|
+
private deepSeek;
|
|
1183
|
+
private logger;
|
|
1184
|
+
constructor();
|
|
1185
|
+
nextItem(req: IChatAdapterNextItemReq): Promise<IChatAdapterNextItemRes>;
|
|
1186
|
+
private mapChatItems;
|
|
1187
|
+
private mapHumanMessage;
|
|
1188
|
+
private mapBotMessage;
|
|
1189
|
+
private mapFunctionCall;
|
|
1190
|
+
private mapTool;
|
|
1191
|
+
private mapResponse;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
declare class GoogleChatAdapter implements IChatAdapter {
|
|
1195
|
+
private env;
|
|
1196
|
+
private openai;
|
|
1197
|
+
private logger;
|
|
1198
|
+
constructor(env: Env);
|
|
1199
|
+
nextItem(req: IChatAdapterNextItemReq): Promise<IChatAdapterNextItemRes>;
|
|
1200
|
+
private mapChatItems;
|
|
1201
|
+
private mapHumanMessage;
|
|
1202
|
+
private mapBotMessage;
|
|
1203
|
+
private mapFunctionCall;
|
|
1204
|
+
private mapTool;
|
|
1205
|
+
private mapResponse;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
declare class OpenaiChatAdapter implements IChatAdapter {
|
|
1209
|
+
private openai;
|
|
1210
|
+
private logger;
|
|
1211
|
+
nextItem(req: IChatAdapterNextItemReq): Promise<IChatAdapterNextItemRes>;
|
|
1212
|
+
private mapChatItems;
|
|
1213
|
+
private mapConectionMessage;
|
|
1214
|
+
private mapBotMessage;
|
|
1215
|
+
private mapFunctionCall;
|
|
1216
|
+
private mapTool;
|
|
1217
|
+
private mapResponse;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
declare class PgChatRepository extends PgCrudRepository<Chat> implements IChatRepository {
|
|
1221
|
+
constructor(pool: Pool);
|
|
1222
|
+
findByConnection(query: IChatConnection): Promise<Chat | null>;
|
|
1223
|
+
findMemory(chatId: string): Promise<IChatMemory | null>;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
declare class PgChatMemory extends PgCrudRepository<ChatItem> implements IChatMemory {
|
|
1227
|
+
private chatId;
|
|
1228
|
+
constructor(pool: Pool, chatId: string);
|
|
1229
|
+
findLastItems(count: number): Promise<ChatItem[]>;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
declare class RamChatMemory implements IChatMemory {
|
|
1233
|
+
private memory;
|
|
1234
|
+
findLastItems(count: number): Promise<ChatItem[]>;
|
|
1235
|
+
create(item: ChatItem): Promise<void>;
|
|
1236
|
+
clearMemory(): Promise<void>;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
declare class RamChatRepository implements IChatRepository {
|
|
1240
|
+
private items;
|
|
1241
|
+
private memories;
|
|
1242
|
+
create(chat: Chat): Promise<void>;
|
|
1243
|
+
findByConnection(query: IChatConnection): Promise<Chat | null>;
|
|
1244
|
+
findMemory(chatId: string): Promise<IChatMemory | null>;
|
|
1245
|
+
private getMemory;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
declare class WabotChatAdapter implements IChatAdapter {
|
|
1249
|
+
private apiKey;
|
|
1250
|
+
private baseUrl;
|
|
1251
|
+
private logger;
|
|
1252
|
+
constructor(env: Env);
|
|
1253
|
+
nextItem(req: IChatAdapterNextItemReq): Promise<IChatAdapterNextItemRes>;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
declare function cmd(): (target: object, propertyKey: string | symbol) => void;
|
|
1257
|
+
|
|
1258
|
+
declare class CmdChannel implements IChatChannel {
|
|
1259
|
+
private rl;
|
|
1260
|
+
private callBack;
|
|
1261
|
+
listen(callback: (message: IChannelMessage) => void): void;
|
|
1262
|
+
connect(): void;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
interface ISocketChannelConfig {
|
|
1266
|
+
channel: string;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
declare class SocketChannelConfig implements ISocketChannelConfig {
|
|
1270
|
+
channel: string;
|
|
1271
|
+
constructor(channel: string);
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
declare function socket(config: SocketChannelConfig): (target: object, propertyKey: string | symbol) => void;
|
|
1275
|
+
|
|
1276
|
+
interface ISocketChannelReceivedMessage {
|
|
1277
|
+
chatId: string;
|
|
1278
|
+
userId: string;
|
|
1279
|
+
senderName: string;
|
|
1280
|
+
text: string;
|
|
1281
|
+
}
|
|
1282
|
+
declare class SocketChannel implements IChatChannel {
|
|
1283
|
+
private config;
|
|
1284
|
+
private socketServerProvider;
|
|
1285
|
+
private callBack;
|
|
1286
|
+
private server;
|
|
1287
|
+
constructor(config: SocketChannelConfig, socketServerProvider: SocketServerProvider);
|
|
1288
|
+
listen(callback: (message: IChannelMessage) => void): void;
|
|
1289
|
+
connect(): void;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
interface ITelegramChannelConfig {
|
|
1293
|
+
botToken: string;
|
|
588
1294
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
id: string;
|
|
593
|
-
timestamp: string;
|
|
594
|
-
type: string;
|
|
1295
|
+
declare class TelegramChannelConfig implements ITelegramChannelConfig {
|
|
1296
|
+
botToken: string;
|
|
1297
|
+
constructor(botToken: string);
|
|
595
1298
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
1299
|
+
|
|
1300
|
+
declare function telegram(config: ITelegramChannelConfig): (target: object, propertyKey: string | symbol) => void;
|
|
1301
|
+
|
|
1302
|
+
declare class TelegramChannel implements IChatChannel {
|
|
1303
|
+
private config;
|
|
1304
|
+
private bot;
|
|
1305
|
+
constructor(config: TelegramChannelConfig);
|
|
1306
|
+
listen(callback: (message: IChannelMessage) => void): void;
|
|
1307
|
+
connect(): void;
|
|
601
1308
|
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
1309
|
+
|
|
1310
|
+
interface IWhatsappChannelConfig {
|
|
1311
|
+
number: string;
|
|
1312
|
+
proxy?: string;
|
|
1313
|
+
}
|
|
1314
|
+
declare class WhatsappChannelConfig implements IWhatsappChannelConfig {
|
|
1315
|
+
number: string;
|
|
1316
|
+
constructor(number: string);
|
|
610
1317
|
}
|
|
611
1318
|
|
|
612
|
-
|
|
1319
|
+
declare function whatsApp(config: string | IWhatsappChannelConfig): (target: object, propertyKey: string | symbol) => void;
|
|
1320
|
+
|
|
1321
|
+
interface IWhatsAppBusinessNumber extends IStorableData {
|
|
613
1322
|
id: string;
|
|
614
1323
|
number: string;
|
|
615
1324
|
}
|
|
616
|
-
interface IWhatsAppBusinessAccount {
|
|
1325
|
+
interface IWhatsAppBusinessAccount extends IStorableData {
|
|
617
1326
|
id: string;
|
|
618
1327
|
}
|
|
619
|
-
interface IWhatsAppData extends
|
|
1328
|
+
interface IWhatsAppData extends IEntityData {
|
|
620
1329
|
slug: string;
|
|
621
1330
|
verifyToken: string;
|
|
622
1331
|
appSecret: string;
|
|
@@ -624,7 +1333,7 @@ interface IWhatsAppData extends IPersistentData {
|
|
|
624
1333
|
businessAccount: IWhatsAppBusinessAccount;
|
|
625
1334
|
businessNumbers: IWhatsAppBusinessNumber[];
|
|
626
1335
|
}
|
|
627
|
-
declare class WhatsApp extends
|
|
1336
|
+
declare class WhatsApp extends Entity<IWhatsAppData> {
|
|
628
1337
|
getVerifyToken(): string;
|
|
629
1338
|
getSlug(): string;
|
|
630
1339
|
getBusinessAccount(): IWhatsAppBusinessAccount;
|
|
@@ -635,57 +1344,88 @@ declare class WhatsApp extends Persistent<IWhatsAppData> {
|
|
|
635
1344
|
getBussinessNumber(number: string): IWhatsAppBusinessNumber | null;
|
|
636
1345
|
}
|
|
637
1346
|
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
1347
|
+
interface IWhatsAppRepository {
|
|
1348
|
+
findBySlug(slug: string): Promise<WhatsApp | null>;
|
|
1349
|
+
findByBusinessNumber(number: string): Promise<WhatsApp | null>;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
declare class EnvWhatsAppRepository implements IWhatsAppRepository {
|
|
1353
|
+
private env;
|
|
1354
|
+
constructor(env: Env);
|
|
1355
|
+
findBySlug(slug: string): Promise<WhatsApp | null>;
|
|
1356
|
+
findByBusinessNumber(number: string): Promise<WhatsApp | null>;
|
|
1357
|
+
private getFromEnvVars;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
declare class PgWhatsAppRepository extends PgCrudRepository<WhatsApp> implements IWhatsAppRepository {
|
|
1361
|
+
constructor(pool: Pool);
|
|
1362
|
+
findBySlug(slug: string): Promise<WhatsApp | null>;
|
|
1363
|
+
findByBusinessNumber(number: string): Promise<WhatsApp | null>;
|
|
648
1364
|
}
|
|
649
1365
|
|
|
650
|
-
type IWhatsAppMessageListener = (message:
|
|
1366
|
+
type IWhatsAppMessageListener = (message: Omit<IChannelMessage, 'reply'>) => Promise<void>;
|
|
651
1367
|
interface IListenWhatsAppMessageRequest {
|
|
652
1368
|
to: string;
|
|
653
1369
|
listener: IWhatsAppMessageListener;
|
|
654
1370
|
}
|
|
655
|
-
declare
|
|
656
|
-
|
|
657
|
-
private listeners;
|
|
658
|
-
constructor(logger: Logger);
|
|
659
|
-
abstract connect(): Promise<void>;
|
|
1371
|
+
declare class WhatsAppReceiver {
|
|
1372
|
+
connect(): Promise<void>;
|
|
660
1373
|
listenMessage(request: IListenWhatsAppMessageRequest): void;
|
|
661
|
-
protected handlePayload(payload: IWhatsAppWebhookPayload): Promise<void>;
|
|
662
|
-
private emmitMessage;
|
|
663
1374
|
}
|
|
664
1375
|
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
1376
|
+
type IWhatsAppCloudTemplateParameter = {
|
|
1377
|
+
type: 'text';
|
|
1378
|
+
text: string;
|
|
1379
|
+
parameter_name?: string;
|
|
1380
|
+
} | {
|
|
1381
|
+
type: 'currency';
|
|
1382
|
+
currency: {
|
|
1383
|
+
fallback_value: string;
|
|
1384
|
+
code: string;
|
|
1385
|
+
amount_1000: number;
|
|
1386
|
+
};
|
|
1387
|
+
} | {
|
|
1388
|
+
type: 'date_time';
|
|
1389
|
+
date_time: {
|
|
1390
|
+
fallback_value: string;
|
|
1391
|
+
};
|
|
1392
|
+
};
|
|
1393
|
+
interface IWhatsAppCloudTemplateMessage {
|
|
1394
|
+
templateName: string;
|
|
1395
|
+
languageCode: string;
|
|
1396
|
+
parameters: IWhatsAppCloudTemplateParameter[];
|
|
668
1397
|
}
|
|
669
1398
|
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
1399
|
+
interface IWhatsAppCloudTemplateResponse {
|
|
1400
|
+
data: IWhatsAppCloudTemplate[];
|
|
1401
|
+
paging: IWhatsAppCloudApiPaging;
|
|
673
1402
|
}
|
|
674
|
-
|
|
675
|
-
interface IWhatsAppTemplate {
|
|
1403
|
+
interface IWhatsAppCloudTemplate {
|
|
676
1404
|
name: string;
|
|
677
1405
|
parameter_format: 'POSITIONAL' | 'OTHER';
|
|
678
|
-
components:
|
|
1406
|
+
components: IWhatsAppCloudTemplateComponent[];
|
|
679
1407
|
language: string;
|
|
680
1408
|
status: string;
|
|
681
1409
|
category: string;
|
|
682
1410
|
id: string;
|
|
683
1411
|
}
|
|
684
|
-
interface
|
|
1412
|
+
interface IWhatsAppCloudTemplateComponent {
|
|
685
1413
|
type: 'HEADER' | 'BODY' | 'FOOTER';
|
|
686
1414
|
format?: 'TEXT';
|
|
687
1415
|
text?: string;
|
|
688
1416
|
}
|
|
1417
|
+
interface IWhatsAppCloudApiPaging {
|
|
1418
|
+
cursors: IWhatsAppCloudApiCursors;
|
|
1419
|
+
}
|
|
1420
|
+
interface IWhatsAppCloudApiCursors {
|
|
1421
|
+
before: string;
|
|
1422
|
+
after: string;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
declare class WhatsAppRepository implements IWhatsAppRepository {
|
|
1426
|
+
findBySlug(slug: string): Promise<WhatsApp | null>;
|
|
1427
|
+
findByBusinessNumber(number: string): Promise<WhatsApp | null>;
|
|
1428
|
+
}
|
|
689
1429
|
|
|
690
1430
|
interface ISendWhatsAppRequest {
|
|
691
1431
|
from: string;
|
|
@@ -695,7 +1435,7 @@ interface ISendWhatsAppRequest {
|
|
|
695
1435
|
interface ISendWhatsAppTemplateRequest {
|
|
696
1436
|
from: string;
|
|
697
1437
|
to: string;
|
|
698
|
-
templateMessage:
|
|
1438
|
+
templateMessage: IWhatsAppCloudTemplateMessage;
|
|
699
1439
|
senderName: string;
|
|
700
1440
|
}
|
|
701
1441
|
interface IGetWhatsAppTemplateRequest {
|
|
@@ -706,270 +1446,164 @@ interface IGetWhatsAppTemplateRequest {
|
|
|
706
1446
|
interface IWhatsAppSenderOptions {
|
|
707
1447
|
writeChatMemory?: boolean;
|
|
708
1448
|
}
|
|
709
|
-
declare
|
|
710
|
-
protected logger: Logger;
|
|
1449
|
+
declare class WhatsAppSender {
|
|
711
1450
|
protected chatRepository: ChatRepository;
|
|
712
1451
|
protected chatResolver: ChatResolver;
|
|
713
1452
|
protected whatsAppRepository: WhatsAppRepository;
|
|
714
|
-
constructor(
|
|
715
|
-
protected abstract handleSendRequest(request: ISendWhatsAppRequest): Promise<void>;
|
|
716
|
-
protected abstract handleSendTemplateRequest(request: ISendWhatsAppTemplateRequest): Promise<void>;
|
|
717
|
-
protected abstract handleGetWhatsAppTemplate(request: IGetWhatsAppTemplateRequest): Promise<IWhatsAppTemplate | null>;
|
|
1453
|
+
constructor(chatRepository: ChatRepository, chatResolver: ChatResolver, whatsAppRepository: WhatsAppRepository);
|
|
718
1454
|
sendWhatsApp(request: ISendWhatsAppRequest, options?: IWhatsAppSenderOptions): Promise<void>;
|
|
719
1455
|
sendWhatsAppTemplate(request: ISendWhatsAppTemplateRequest, options?: IWhatsAppSenderOptions): Promise<void>;
|
|
720
|
-
getWhatsAppTemplate(request: IGetWhatsAppTemplateRequest): Promise<
|
|
721
|
-
protected
|
|
1456
|
+
protected getWhatsAppTemplate(request: IGetWhatsAppTemplateRequest): Promise<IWhatsAppCloudTemplate | null>;
|
|
1457
|
+
protected mapTemplateToChatMessage(request: ISendWhatsAppTemplateRequest): Promise<IChatMessage>;
|
|
722
1458
|
protected writePrivateChatMemory(message: IChatMessage, to: string): Promise<void>;
|
|
723
|
-
|
|
1459
|
+
protected replaceTemplateParameters(template: string, data: IWhatsAppCloudTemplateParameter[]): string;
|
|
724
1460
|
}
|
|
725
1461
|
|
|
726
1462
|
declare class WhatsAppChannel implements IChatChannel {
|
|
727
1463
|
private config;
|
|
728
|
-
private chatResolver;
|
|
729
|
-
private userResolver;
|
|
730
1464
|
private sender;
|
|
731
1465
|
private receiver;
|
|
732
1466
|
private logger;
|
|
733
|
-
constructor(config: WhatsappChannelConfig,
|
|
734
|
-
listen(callback: (message:
|
|
1467
|
+
constructor(config: WhatsappChannelConfig, sender: WhatsAppSender, receiver: WhatsAppReceiver);
|
|
1468
|
+
listen(callback: (message: IChannelMessage) => void): void;
|
|
735
1469
|
connect(): void;
|
|
736
1470
|
}
|
|
737
1471
|
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
private devToken;
|
|
742
|
-
private logger;
|
|
743
|
-
static isTokenAvailable(): boolean;
|
|
744
|
-
constructor();
|
|
745
|
-
getSocket(): Promise<Socket>;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
declare class WhatsAppReceiverByDevConnection extends WhatsAppReceiver {
|
|
749
|
-
private wabotDevConnection;
|
|
750
|
-
constructor(wabotDevConnection: WabotDevConnection);
|
|
751
|
-
connect(): Promise<void>;
|
|
1472
|
+
interface IWhatsAppCloudWebhookPayload {
|
|
1473
|
+
object: 'whatsapp_business_account';
|
|
1474
|
+
entry: IWhatsAppCloudEntry[];
|
|
752
1475
|
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
private whatsAppRepository;
|
|
757
|
-
private expressApp;
|
|
758
|
-
private webhookPath;
|
|
759
|
-
constructor(expressProvider: ExpressProvider, whatsAppRepository: WhatsAppRepository);
|
|
760
|
-
connect(): Promise<void>;
|
|
1476
|
+
interface IWhatsAppCloudEntry {
|
|
1477
|
+
id: string;
|
|
1478
|
+
changes: IWhatsAppCloudChange[];
|
|
761
1479
|
}
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
handleSendRequest(request: ISendWhatsAppRequest): Promise<void>;
|
|
767
|
-
handleSendTemplateRequest(request: ISendWhatsAppTemplateRequest): Promise<void>;
|
|
768
|
-
handleGetWhatsAppTemplate(request: IGetWhatsAppTemplateRequest): Promise<IWhatsAppTemplate | null>;
|
|
1480
|
+
type IWhatsAppCloudChange = IWhatsAppCloudMessagesChange;
|
|
1481
|
+
interface IWhatsAppCloudMessagesChange {
|
|
1482
|
+
value: IWhatsAppCloudMessagesChangeValue;
|
|
1483
|
+
field: 'messages';
|
|
769
1484
|
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
handleGetWhatsAppTemplate(request: IGetWhatsAppTemplateRequest): Promise<IWhatsAppTemplate | null>;
|
|
1485
|
+
interface IWhatsAppCloudMessagesChangeValue {
|
|
1486
|
+
messaging_product: 'whatsapp';
|
|
1487
|
+
metadata: IWhatsAppCloudMessageMetadata;
|
|
1488
|
+
contacts?: IWhatsAppCloudContact[];
|
|
1489
|
+
messages?: IWhatsAppCloudMessage[];
|
|
776
1490
|
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
findAll(id: string): Promise<T[]>;
|
|
781
|
-
create(item: T): Promise<void>;
|
|
782
|
-
update(item: T): Promise<void>;
|
|
783
|
-
discard(item: T): Promise<void>;
|
|
1491
|
+
interface IWhatsAppCloudMessageMetadata {
|
|
1492
|
+
display_phone_number: string;
|
|
1493
|
+
phone_number_id: string;
|
|
784
1494
|
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
table: string;
|
|
789
|
-
constructor: IConstructor<P>;
|
|
790
|
-
add?: {
|
|
791
|
-
columns: {
|
|
792
|
-
[column: string]: {
|
|
793
|
-
type: string;
|
|
794
|
-
value: (item: P) => boolean | number | string | null | Date;
|
|
795
|
-
};
|
|
796
|
-
};
|
|
797
|
-
};
|
|
798
|
-
};
|
|
799
|
-
|
|
800
|
-
declare class PgRepositoryBase<P extends Persistent> {
|
|
801
|
-
protected pool: Pool;
|
|
802
|
-
protected config: IPgRepositoryConfig<any>;
|
|
803
|
-
private tableIsCreated;
|
|
804
|
-
schema: string;
|
|
805
|
-
table: string;
|
|
806
|
-
columnsList: string[];
|
|
807
|
-
columnsAndTypes: string;
|
|
808
|
-
columns: string;
|
|
809
|
-
vars: string;
|
|
810
|
-
updates: string;
|
|
811
|
-
addColumns: {
|
|
812
|
-
[columns: string]: {
|
|
813
|
-
type: string;
|
|
814
|
-
value: (item: P) => number | boolean | string | null | Date;
|
|
815
|
-
};
|
|
1495
|
+
interface IWhatsAppCloudContact {
|
|
1496
|
+
profile: {
|
|
1497
|
+
name: string;
|
|
816
1498
|
};
|
|
817
|
-
|
|
818
|
-
values(item: P): (string | number | boolean | Date | null)[];
|
|
819
|
-
protected exec(sql: string, values: any[]): Promise<void>;
|
|
820
|
-
protected query(sql: string, values: any[]): Promise<any[]>;
|
|
821
|
-
protected connect(): Promise<Pool>;
|
|
822
|
-
protected ensureTable(): Promise<void>;
|
|
823
|
-
protected ensureColumns(): Promise<void>;
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
declare class PgCrudRepository<P extends Persistent> extends PgRepositoryBase<P> implements ICrudRepository<P> {
|
|
827
|
-
protected readonly config: IPgRepositoryConfig<P>;
|
|
828
|
-
constructor(pool: Pool, config: IPgRepositoryConfig<P>);
|
|
829
|
-
find(id: string): Promise<P | null>;
|
|
830
|
-
findAll(): Promise<P[]>;
|
|
831
|
-
create(item: P): Promise<void>;
|
|
832
|
-
update(item: P): Promise<void>;
|
|
833
|
-
discard(item: P): Promise<void>;
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
declare class PgWhatsAppRepository extends PgCrudRepository<WhatsApp> implements IWhatsAppRepository {
|
|
837
|
-
constructor(pool: Pool);
|
|
838
|
-
findBySlug(slug: string): Promise<WhatsApp | null>;
|
|
839
|
-
findByBusinessNumber(number: string): Promise<WhatsApp | null>;
|
|
1499
|
+
wa_id: string;
|
|
840
1500
|
}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
isProduction(): boolean;
|
|
848
|
-
requireString(varName: string): string;
|
|
1501
|
+
type IWhatsAppCloudMessage = IWhatsAppCloudTextMessage | IWhatsAppCloudAudioMessage;
|
|
1502
|
+
interface IWhatsAppCloudBaseMessage {
|
|
1503
|
+
from: string;
|
|
1504
|
+
id: string;
|
|
1505
|
+
timestamp: string;
|
|
1506
|
+
type: string;
|
|
849
1507
|
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
findByBusinessNumber(number: string): Promise<WhatsApp | null>;
|
|
856
|
-
private getFromEnvVars;
|
|
1508
|
+
interface IWhatsAppCloudTextMessage extends IWhatsAppCloudBaseMessage {
|
|
1509
|
+
type: 'text';
|
|
1510
|
+
text: {
|
|
1511
|
+
body: string;
|
|
1512
|
+
};
|
|
857
1513
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
chatBotAdapter: IConstructor<IChatBotAdapter>;
|
|
1514
|
+
interface IWhatsAppCloudAudioMessage extends IWhatsAppCloudBaseMessage {
|
|
1515
|
+
type: 'audio';
|
|
1516
|
+
audio: {
|
|
1517
|
+
mime_type: string;
|
|
1518
|
+
sha256: string;
|
|
1519
|
+
id: string;
|
|
1520
|
+
voice: boolean;
|
|
1521
|
+
};
|
|
867
1522
|
}
|
|
868
|
-
declare function runChannel(props: IrunChannelProps): void;
|
|
869
1523
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
1524
|
+
declare class WhatsAppReceiverByCloudApi extends WhatsAppReceiver {
|
|
1525
|
+
private expressProvider;
|
|
1526
|
+
private whatsAppRepository;
|
|
1527
|
+
private listeners;
|
|
1528
|
+
private expressApp;
|
|
1529
|
+
private logger;
|
|
1530
|
+
private webhookPath;
|
|
1531
|
+
constructor(expressProvider: ExpressProvider, whatsAppRepository: WhatsAppRepository);
|
|
1532
|
+
connect(): Promise<void>;
|
|
1533
|
+
listenMessage(request: IListenWhatsAppMessageRequest): void;
|
|
1534
|
+
protected handlePayload(payload: IWhatsAppCloudWebhookPayload): Promise<void>;
|
|
1535
|
+
private emmitMessage;
|
|
878
1536
|
}
|
|
879
|
-
declare function runServer(config: IServerConfig): void;
|
|
880
1537
|
|
|
881
|
-
declare class
|
|
882
|
-
|
|
883
|
-
|
|
1538
|
+
declare class WhatsAppSenderByCloudApi extends WhatsAppSender {
|
|
1539
|
+
private logger;
|
|
1540
|
+
constructor(chatRepository: ChatRepository, chatResolver: ChatResolver, whatsAppRepository: WhatsAppRepository);
|
|
1541
|
+
sendWhatsApp(request: ISendWhatsAppRequest, options?: IWhatsAppSenderOptions): Promise<void>;
|
|
1542
|
+
sendWhatsAppTemplate(request: ISendWhatsAppTemplateRequest, options?: IWhatsAppSenderOptions): Promise<void>;
|
|
1543
|
+
protected getWhatsAppTemplate(request: IGetWhatsAppTemplateRequest): Promise<IWhatsAppCloudTemplate | null>;
|
|
884
1544
|
}
|
|
885
1545
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
otp: string;
|
|
1546
|
+
interface IWhatsAppProxyMessageContent {
|
|
1547
|
+
text: string;
|
|
889
1548
|
}
|
|
890
1549
|
|
|
891
|
-
interface
|
|
1550
|
+
interface IWhatsAppProxyMessage {
|
|
892
1551
|
from: string;
|
|
893
1552
|
to: string;
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
}
|
|
897
|
-
interface IEmailService {
|
|
898
|
-
sendEmail(request: ISendEmailRequest): Promise<void>;
|
|
899
|
-
}
|
|
900
|
-
declare class EmailService implements IEmailService {
|
|
901
|
-
sendEmail(request: ISendEmailRequest): Promise<void>;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
interface IOtpService {
|
|
905
|
-
generate(): Promise<string>;
|
|
906
|
-
}
|
|
907
|
-
declare class OtpService implements IOtpService {
|
|
908
|
-
generate(): Promise<string>;
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
declare class AuthenticationModule {
|
|
912
|
-
private userRepository;
|
|
913
|
-
private emailService;
|
|
914
|
-
private otpService;
|
|
915
|
-
private context;
|
|
916
|
-
constructor(userRepository: UserRepository, emailService: EmailService, otpService: OtpService, context: MessageContext);
|
|
917
|
-
sendOneTimePassword(request: SendOneTimePasswordRequest): Promise<string>;
|
|
918
|
-
validateOneTimePassword(request: ValidateOneTimePasswordRequest): Promise<string>;
|
|
919
|
-
protected generateOtpEmailHtml(otp: string, user: User): Promise<string>;
|
|
920
|
-
protected generateOtpEmailSubject(): Promise<string>;
|
|
1553
|
+
senderName?: string;
|
|
1554
|
+
content: IWhatsAppProxyMessageContent;
|
|
921
1555
|
}
|
|
922
1556
|
|
|
923
|
-
declare
|
|
924
|
-
|
|
925
|
-
|
|
1557
|
+
declare const WHATSAPP_PROXY_SEND_MESSAGE_EVENT: "sendMessage";
|
|
1558
|
+
interface IWhatsAppProxySendMessageEventReq {
|
|
1559
|
+
event: typeof WHATSAPP_PROXY_SEND_MESSAGE_EVENT;
|
|
1560
|
+
data: IWhatsAppProxyMessage;
|
|
926
1561
|
}
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
constructor(userRepository: UserRepository, context: MessageContext);
|
|
932
|
-
registerUserWithEmail(request: RegisterUserWithEmailRequest): Promise<string>;
|
|
1562
|
+
declare const WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT: "listenMessage";
|
|
1563
|
+
interface IWhatsAppProxyListenMessageEventReq {
|
|
1564
|
+
event: typeof WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT;
|
|
1565
|
+
data: IWhatsAppProxyListenMessageEventData;
|
|
933
1566
|
}
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
findByConnection(query: IUserConnection): Promise<User | null>;
|
|
1567
|
+
interface IWhatsAppProxyListenMessageEventData {
|
|
1568
|
+
from?: string[];
|
|
1569
|
+
to: string[];
|
|
938
1570
|
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
findByConnection(query: IUserConnection): Promise<User | null>;
|
|
944
|
-
update(chat: User): Promise<void>;
|
|
1571
|
+
declare const WHATSAPP_MESSAGE_EVENT: "message";
|
|
1572
|
+
interface IWhatsAppProxyMessageEventReq {
|
|
1573
|
+
event: typeof WHATSAPP_MESSAGE_EVENT;
|
|
1574
|
+
data: IWhatsAppProxyMessage;
|
|
945
1575
|
}
|
|
946
1576
|
|
|
947
|
-
declare class
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
1577
|
+
declare class WhatsAppWabotProxyConnection {
|
|
1578
|
+
private baseUrl;
|
|
1579
|
+
private socket;
|
|
1580
|
+
private apiKey;
|
|
1581
|
+
private logger;
|
|
1582
|
+
constructor(env: Env);
|
|
1583
|
+
getSocket(): Promise<Socket$1>;
|
|
951
1584
|
}
|
|
952
1585
|
|
|
953
|
-
declare class
|
|
954
|
-
private
|
|
955
|
-
|
|
956
|
-
|
|
1586
|
+
declare class WhatsAppReceiverByWabotProxy extends WhatsAppReceiver {
|
|
1587
|
+
private connection;
|
|
1588
|
+
private loger;
|
|
1589
|
+
constructor(connection: WhatsAppWabotProxyConnection);
|
|
1590
|
+
connect(): Promise<void>;
|
|
1591
|
+
listenMessage(request: IListenWhatsAppMessageRequest): void;
|
|
957
1592
|
}
|
|
958
1593
|
|
|
959
|
-
declare class
|
|
960
|
-
private
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
1594
|
+
declare class WhatsAppSenderByWabotProxy extends WhatsAppSender {
|
|
1595
|
+
private wabotDevConnection;
|
|
1596
|
+
private logger;
|
|
1597
|
+
constructor(wabotDevConnection: WhatsAppWabotProxyConnection, chatRepository: ChatRepository, chatResolver: ChatResolver, whatsAppRepository: WhatsAppRepository);
|
|
1598
|
+
sendWhatsApp(request: ISendWhatsAppRequest, options?: IWhatsAppSenderOptions): Promise<void>;
|
|
964
1599
|
}
|
|
965
1600
|
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
create(chat: Chat): Promise<void>;
|
|
970
|
-
findByConnection(query: IChatConnection): Promise<Chat | null>;
|
|
971
|
-
findMemory(chatId: string): Promise<IChatMemory | null>;
|
|
972
|
-
private getMemory;
|
|
1601
|
+
interface IHtmlModuleOptions {
|
|
1602
|
+
url: string;
|
|
1603
|
+
title: string;
|
|
973
1604
|
}
|
|
1605
|
+
declare function HtmlModule(options: IHtmlModuleOptions): {
|
|
1606
|
+
new (): {};
|
|
1607
|
+
};
|
|
974
1608
|
|
|
975
|
-
export {
|
|
1609
|
+
export { AnthropicChatAdapter, ApiKey, ApiKeyConnectionGuardMiddleware, ApiKeyGuardMiddleware, ApiKeyRepository, Async, Auth, Chat, ChatAdapter, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatRepository, ChatResolver, CmdChannel, Command, CommandMetadataStore, Container, ControllerMetadataStore, CustomError, DeepSeekChatAdapter, EXPRESS_REQ, EXPRESS_RES, Entity, Env, EnvWhatsAppRepository, ExpressProvider, GoogleChatAdapter, HtmlModule, HttpServerProvider, type IApiKeyData, type IApiKeyRepository, type IArrayValidationError, type IArrayValidationResult, type IBotMessageItem, type IChannelMessage, type IChannelMetadata, type IChatAdapter, type IChatAdapterNextItemReq, type IChatAdapterNextItemRes, type IChatBot, type IChatBotMetadata, type IChatChannel, type IChatConnection, type IChatControllerMetadata, type IChatData, type IChatItem, type IChatItemData, type IChatItemType, type IChatMemory, type IChatMessage, type IChatRepository, type IChatType, type ICommandConfig, type ICommandHandler, type ICommandHandlerConfig, type IConnectionMiddleware, type IConnectionMiddlewareMetadata, type IConstructor, type ICrudRepository, type ICustomErrorData, type IEndPointConfig, type IEndPointMetadata, type IEntityData, type IEnvType, type IFunctionCall, type IFunctionCallItem, type IGenerateApiKeyReq, type IGenerateApiKeyRes, type IGetWhatsAppTemplateRequest, type IHtmlModuleOptions, type IHumanMessageItem, type IJobData, type IJobEvent, type IJobEventListener, type IJobRepository, type IJwtRefreshTokenData, type IJwtRefreshTokenRepository, type ILanguageModelUsage, type IListenWhatsAppMessageRequest, type IMessageContext, type IMiddleware, type IMiddlewareMetadata, type IMindset, type IMindsetDecoration, type IMindsetFunctionConfig, type IMindsetFunctionDecoration, type IMindsetFunctionMetadata, type IMindsetFunctionParamMetadata, type IMindsetIdentity, type IMindsetLlm, type IMindsetMetadata, type IMindsetModuleConfig, type IMindsetModuleDecoration, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IMoneyData, type IParamConfig, type IParamDecoration, type IPersistentData, type IPgRepositoryConfig, type IPrimitive, type IPropertyValidatorInfo, type IReceivedMessage, type IRestControllerConfig, type IRestControllerMetadata, type ISendWhatsAppRequest, type ISendWhatsAppTemplateRequest, type ISocketChannelConfig, type ISocketChannelReceivedMessage, type ISocketConnectionConfig, type ISocketConnectionMetadata, type ISocketControllerConfig, type ISocketControllerMetadata, type ISocketEventConfig, type ISocketEventMetadata, type IStorableData, type ITelegramChannelConfig, type IValidateArrayOptions, type IValidateArrayOptionsWithItemsValidators, type IValidateIsInOptions, type IValidateMaxOptions, type IValidateMinOptions, type IValidationError, type IValidationResult, type IValidator, type IValidatorMetadata, type IWhatsAppBusinessAccount, type IWhatsAppBusinessNumber, type IWhatsAppCloudContact, type IWhatsAppCloudMessage, type IWhatsAppCloudMessageMetadata, type IWhatsAppCloudTemplate, type IWhatsAppCloudTemplateComponent, type IWhatsAppCloudTemplateMessage, type IWhatsAppCloudTemplateParameter, type IWhatsAppCloudTemplateResponse, type IWhatsAppCloudWebhookPayload, type IWhatsAppData, type IWhatsAppMessageListener, type IWhatsAppProxyListenMessageEventData, type IWhatsAppProxyListenMessageEventReq, type IWhatsAppProxyMessage, type IWhatsAppProxyMessageContent, type IWhatsAppProxyMessageEventReq, type IWhatsAppProxySendMessageEventReq, type IWhatsAppRepository, type IWhatsAppSenderOptions, type IWhatsappChannelConfig, type IchatControllerConfig, Job, JobRepository, JobRunner, JobsEventsHub, Jwt, JwtAccessAndRefreshTokenDto, JwtConfig, JwtConnectionGuardMiddleware, JwtGuardMiddleware, JwtRefreshToken, JwtRefreshTokenRepository, JwtSigner, JwtTokenDto, Lifecycle, Logger, MINDSET_DECORATION_MINDSET, MINDSET_FUNCTION_DECORATION_FUNCTION, MINDSET_MODULE_DECORATION_MODULE, Mapper, Mindset, MindsetMetadataStore, MindsetOperator, Money, MoneyDto, OpenaiChatAdapter, PARAM_DECORATION_IS_OPTIONAL, PARAM_DECORATION_PARAM, Password, type PasswordHashOptions, Persistent, PgApiKeyRepository, PgChatMemory, PgChatRepository, PgCrudRepository, PgJobRepository, PgJwtRefreshTokenRepository, PgRepositoryBase, PgWhatsAppRepository, RamChatMemory, RamChatRepository, Random, RemoteApiKeyRepository, RestControllerMetadataStore, SocketChannel, SocketChannelConfig, SocketControllerMetadataStore, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, ValidationMetadataStore, WHATSAPP_MESSAGE_EVENT, WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT, WHATSAPP_PROXY_SEND_MESSAGE_EVENT, WabotChatAdapter, WhatsApp, WhatsAppChannel, WhatsAppReceiver, WhatsAppReceiverByCloudApi, WhatsAppReceiverByWabotProxy, WhatsAppRepository, WhatsAppSender, WhatsAppSenderByCloudApi, WhatsAppSenderByWabotProxy, WhatsAppWabotProxyConnection, WhatsappChannelConfig, apiKeyConnectionGuard, apiKeyGuard, chatBot, chatController, chatItemTypeOptions, cmd, command, commandHandler, connectionMiddleware, container, inject, injectable, isArray, isBoolean, isDate, isIn, isModel, isNotEmpty, isNumber, isOptional, isPresent, isString, jwtConnectionGuard, jwtGuard, max, middleware, min, mindset, mindsetFunction, mindsetModule, modelInfo, onDelete, onGet, onPost, onPut, param, restController, runAsyncCommandHandlers, runChatControllers, runRestControllers, runSocketControllers, scoped, singleton, socket, socketConnection, socketController, socketEvent, telegram, validate, validateArray, validateIsBoolean, validateIsDate, validateIsIn, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsString, validateMax, validateMin, validateModel, whatsApp };
|