@wabot-dev/framework 0.1.0-beta.36 → 0.1.0-beta.37
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.
|
@@ -6,6 +6,7 @@ import { ExpressProvider } from '../express/ExpressProvider.js';
|
|
|
6
6
|
import '../../core/validation/metadata/ValidationMetadataStore.js';
|
|
7
7
|
import { validate } from '../../core/validation/validate.js';
|
|
8
8
|
import { CustomError } from '../../core/error/CustomError.js';
|
|
9
|
+
import { EXPRESS_REQ, EXPRESS_RES } from './injection-tokens.js';
|
|
9
10
|
|
|
10
11
|
function buildRequest(req) {
|
|
11
12
|
return Object.assign({}, req.body, req.query, req.params);
|
|
@@ -23,6 +24,8 @@ function runRestControllers(controllers) {
|
|
|
23
24
|
logger.info(`config ${endPoint.method.toUpperCase()} ${route}`);
|
|
24
25
|
expressApp[method](route, async (req, res) => {
|
|
25
26
|
const requestContainer = container.createChildContainer();
|
|
27
|
+
requestContainer.register(EXPRESS_REQ, { useValue: req });
|
|
28
|
+
requestContainer.register(EXPRESS_RES, { useValue: req });
|
|
26
29
|
try {
|
|
27
30
|
const middlewares = endPoint.middlewares.map((x) => requestContainer.resolve(x.middlewareConstructor));
|
|
28
31
|
for (const middleware of middlewares) {
|
package/dist/src/index.d.ts
CHANGED
|
@@ -739,6 +739,9 @@ declare class Auth<D extends IStorableData> {
|
|
|
739
739
|
assign(authInfo: D): void;
|
|
740
740
|
}
|
|
741
741
|
|
|
742
|
+
declare const EXPRESS_REQ = "EXPRESS_REQ";
|
|
743
|
+
declare const EXPRESS_RES = "EXPRESS_RES";
|
|
744
|
+
|
|
742
745
|
declare class SocketServerProvider {
|
|
743
746
|
private httpServerProvider;
|
|
744
747
|
private socketServer;
|
|
@@ -1305,4 +1308,4 @@ interface IValidateMaxOptions {
|
|
|
1305
1308
|
}
|
|
1306
1309
|
declare function validateMax(value: any, options: IValidateMaxOptions): IValidationResult<any>;
|
|
1307
1310
|
|
|
1308
|
-
export { Async, Auth, Chat, ChatAdapter, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatRepository, ChatResolver, ClaudeChatAdapter, CmdChannel, Command, CommandMetadataStore, Container, ControllerMetadataStore, CustomError, DeepSeekChatAdapter, Entity, Env, EnvWhatsAppRepository, ExpressProvider, GeminiChatAdapter, HtmlModule, HttpServerProvider, 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 IConstructor, type ICrudRepository, type ICustomErrorData, type IEndPointMetadata, type IEntityData, type IEnvType, type IFunctionCall, type IFunctionCallItem, type IGetConfig, type IGetWhatsAppTemplateRequest, type IHtmlModuleOptions, type IHumanMessageItem, type IJobData, type IJobEvent, type IJobEventListener, type IJobRepository, type IJwtRefreshTokenData, type ILanguageModelUsage, type IListenWhatsAppMessageRequest, type IMessageContext, type IMessageMetadata, type IMiddleware, type IMiddlewareMetadata, type IMindset, type IMindsetDecoration, type IMindsetFunctionConfig, type IMindsetFunctionDecoration, type IMindsetFunctionMetadata, type IMindsetFunctionParamMetadata, type IMindsetIdentity, type IMindsetMetadata, type IMindsetModuleConfig, type IMindsetModuleDecoration, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IParamConfig, type IParamDecoration, type IPersistentData, type IPgRepositoryConfig, type IPostConfig, type IPrimitive, type IPropertyValidatorInfo, type IReceivedMessage, type IRestControllerConfig, type IRestControllerMetadata, type ISendWhatsAppRequest, type ISendWhatsAppTemplateRequest, type ISocketChannelConfig, type ISocketChannelReceivedMessage, type IStorableData, type ITelegramChannelConfig, type IValidateArrayOptions, type IValidateArrayOptionsWithItemsValidators, type IValidateMaxOptions, type IValidateMinOptions, type IValidationError, type IValidationResult, type IValidator, type IValidatorMetadata, type IWhatsAppBusinessAccount, type IWhatsAppBusinessNumber, type IWhatsAppContact, type IWhatsAppData, type IWhatsAppMessage, type IWhatsAppMessageListener, type IWhatsAppRepository, type IWhatsAppSenderOptions, type IWhatsAppTemplate, type IWhatsAppTemplateComponent, type IWhatsAppTemplateMessage, type IWhatsAppTemplateParameter, type IWhatsAppTemplateResponse, type IWhatsAppWebhookPayload, type IWhatsappChannelConfig, type IchatControllerConfig, Job, JobRepository, JobRunner, JobsEventsHub, Jwt, JwtAccessAndRefreshTokenDto, JwtConfig, JwtGuardMiddleware, JwtRefreshToken, JwtRefreshTokenRepository, JwtSigner, JwtTokenDto, Lifecycle, Logger, MINDSET_DECORATION_MINDSET, MINDSET_FUNCTION_DECORATION_FUNCTION, MINDSET_MODULE_DECORATION_MODULE, Mapper, Mindset, MindsetMetadataStore, MindsetOperator, OpenaiChatAdapter, PARAM_DECORATION_IS_OPTIONAL, PARAM_DECORATION_PARAM, Persistent, PgChatMemory, PgChatRepository, PgCrudRepository, PgJobRepository, PgRepositoryBase, PgWhatsAppRepository, RamChatMemory, RamChatRepository, Random, RestControllerMetadataStore, SocketChannel, SocketChannelConfig, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, ValidationMetadataStore, WhatsApp, WhatsAppChannel, WhatsAppReceiver, WhatsAppReceiverByDevConnection, WhatsAppReceiverByWebHook, WhatsAppRepository, WhatsAppSender, WhatsAppSenderByCloudApi, WhatsAppSenderByDevConnection, WhatsappChannelConfig, chatBot, chatController, chatItemTypeOptions, cmd, command, commandHandler, container, get, inject, injectable, isArray, isBoolean, isDate, isModel, isNotEmpty, isNumber, isOptional, isPresent, isString, jwtGuard, max, middleware, min, mindset, mindsetFunction, mindsetModule, modelInfo, param, post, restController, runAsyncCommandHandlers, runChatControllers, runRestControllers, scoped, singleton, socket, telegram, validate, validateArray, validateIsBoolean, validateIsDate, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsString, validateMax, validateMin, validateModel, whatsapp };
|
|
1311
|
+
export { Async, Auth, Chat, ChatAdapter, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatRepository, ChatResolver, ClaudeChatAdapter, CmdChannel, Command, CommandMetadataStore, Container, ControllerMetadataStore, CustomError, DeepSeekChatAdapter, EXPRESS_REQ, EXPRESS_RES, Entity, Env, EnvWhatsAppRepository, ExpressProvider, GeminiChatAdapter, HtmlModule, HttpServerProvider, 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 IConstructor, type ICrudRepository, type ICustomErrorData, type IEndPointMetadata, type IEntityData, type IEnvType, type IFunctionCall, type IFunctionCallItem, type IGetConfig, type IGetWhatsAppTemplateRequest, type IHtmlModuleOptions, type IHumanMessageItem, type IJobData, type IJobEvent, type IJobEventListener, type IJobRepository, type IJwtRefreshTokenData, type ILanguageModelUsage, type IListenWhatsAppMessageRequest, type IMessageContext, type IMessageMetadata, type IMiddleware, type IMiddlewareMetadata, type IMindset, type IMindsetDecoration, type IMindsetFunctionConfig, type IMindsetFunctionDecoration, type IMindsetFunctionMetadata, type IMindsetFunctionParamMetadata, type IMindsetIdentity, type IMindsetMetadata, type IMindsetModuleConfig, type IMindsetModuleDecoration, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IParamConfig, type IParamDecoration, type IPersistentData, type IPgRepositoryConfig, type IPostConfig, type IPrimitive, type IPropertyValidatorInfo, type IReceivedMessage, type IRestControllerConfig, type IRestControllerMetadata, type ISendWhatsAppRequest, type ISendWhatsAppTemplateRequest, type ISocketChannelConfig, type ISocketChannelReceivedMessage, type IStorableData, type ITelegramChannelConfig, type IValidateArrayOptions, type IValidateArrayOptionsWithItemsValidators, type IValidateMaxOptions, type IValidateMinOptions, type IValidationError, type IValidationResult, type IValidator, type IValidatorMetadata, type IWhatsAppBusinessAccount, type IWhatsAppBusinessNumber, type IWhatsAppContact, type IWhatsAppData, type IWhatsAppMessage, type IWhatsAppMessageListener, type IWhatsAppRepository, type IWhatsAppSenderOptions, type IWhatsAppTemplate, type IWhatsAppTemplateComponent, type IWhatsAppTemplateMessage, type IWhatsAppTemplateParameter, type IWhatsAppTemplateResponse, type IWhatsAppWebhookPayload, type IWhatsappChannelConfig, type IchatControllerConfig, Job, JobRepository, JobRunner, JobsEventsHub, Jwt, JwtAccessAndRefreshTokenDto, JwtConfig, JwtGuardMiddleware, JwtRefreshToken, JwtRefreshTokenRepository, JwtSigner, JwtTokenDto, Lifecycle, Logger, MINDSET_DECORATION_MINDSET, MINDSET_FUNCTION_DECORATION_FUNCTION, MINDSET_MODULE_DECORATION_MODULE, Mapper, Mindset, MindsetMetadataStore, MindsetOperator, OpenaiChatAdapter, PARAM_DECORATION_IS_OPTIONAL, PARAM_DECORATION_PARAM, Persistent, PgChatMemory, PgChatRepository, PgCrudRepository, PgJobRepository, PgRepositoryBase, PgWhatsAppRepository, RamChatMemory, RamChatRepository, Random, RestControllerMetadataStore, SocketChannel, SocketChannelConfig, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, ValidationMetadataStore, WhatsApp, WhatsAppChannel, WhatsAppReceiver, WhatsAppReceiverByDevConnection, WhatsAppReceiverByWebHook, WhatsAppRepository, WhatsAppSender, WhatsAppSenderByCloudApi, WhatsAppSenderByDevConnection, WhatsappChannelConfig, chatBot, chatController, chatItemTypeOptions, cmd, command, commandHandler, container, get, inject, injectable, isArray, isBoolean, isDate, isModel, isNotEmpty, isNumber, isOptional, isPresent, isString, jwtGuard, max, middleware, min, mindset, mindsetFunction, mindsetModule, modelInfo, param, post, restController, runAsyncCommandHandlers, runChatControllers, runRestControllers, scoped, singleton, socket, telegram, validate, validateArray, validateIsBoolean, validateIsDate, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsString, validateMax, validateMin, validateModel, whatsapp };
|
package/dist/src/index.js
CHANGED
|
@@ -57,6 +57,7 @@ export { restController } from './feature/rest-controller/metadata/@restControll
|
|
|
57
57
|
export { RestControllerMetadataStore } from './feature/rest-controller/metadata/RestControllerMetadataStore.js';
|
|
58
58
|
export { runRestControllers } from './feature/rest-controller/runRestControllers.js';
|
|
59
59
|
export { Auth } from './feature/rest-controller/auth/Auth.js';
|
|
60
|
+
export { EXPRESS_REQ, EXPRESS_RES } from './feature/rest-controller/injection-tokens.js';
|
|
60
61
|
export { SocketServerProvider } from './feature/socket/SocketServerProvider.js';
|
|
61
62
|
export { PgJobRepository } from './addon/async/pg/PgJobRepository.js';
|
|
62
63
|
export { ClaudeChatAdapter } from './addon/chat-bot/claude/ClaudeChatAdapter.js';
|