@wabot-dev/framework 0.1.0-beta.37 → 0.1.0-beta.39

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.
@@ -2,6 +2,7 @@ import { __decorate, __metadata } from 'tslib';
2
2
  import { Logger } from '../../../core/logger/Logger.js';
3
3
  import { WhatsAppReceiver } from './WhatsAppReceiver.js';
4
4
  import { ExpressProvider } from '../../../feature/express/ExpressProvider.js';
5
+ import { json } from 'express';
5
6
  import { WhatsAppRepository } from './WhatsAppRepository.js';
6
7
  import { singleton } from '../../../core/injection/index.js';
7
8
 
@@ -17,7 +18,7 @@ let WhatsAppReceiverByWebHook = class WhatsAppReceiverByWebHook extends WhatsApp
17
18
  this.expressApp = this.expressProvider.getExpress();
18
19
  }
19
20
  async connect() {
20
- this.expressApp.get(this.webhookPath, async (req, res) => {
21
+ this.expressApp.get(this.webhookPath, json(), async (req, res) => {
21
22
  try {
22
23
  let mode = req.query['hub.mode'];
23
24
  let token = req.query['hub.verify_token'];
@@ -39,7 +40,7 @@ let WhatsAppReceiverByWebHook = class WhatsAppReceiverByWebHook extends WhatsApp
39
40
  return;
40
41
  }
41
42
  });
42
- this.expressApp.post(this.webhookPath, (req, res) => {
43
+ this.expressApp.post(this.webhookPath, json(), (req, res) => {
43
44
  const payload = req.body;
44
45
  this.handlePayload(payload);
45
46
  res.sendStatus(200);
@@ -0,0 +1,22 @@
1
+ import { __decorate, __metadata } from 'tslib';
2
+ import '../../core/injection/index.js';
3
+ import '../../core/validation/metadata/ValidationMetadataStore.js';
4
+ import { isNotEmpty } from '../validation/is-not-empty/@isNotEmpty.js';
5
+ import { isString } from '../validation/is-string/@isString.js';
6
+
7
+ class MoneyDto {
8
+ amount = '';
9
+ currency = '';
10
+ }
11
+ __decorate([
12
+ isString(),
13
+ isNotEmpty(),
14
+ __metadata("design:type", String)
15
+ ], MoneyDto.prototype, "amount", void 0);
16
+ __decorate([
17
+ isString(),
18
+ isNotEmpty(),
19
+ __metadata("design:type", String)
20
+ ], MoneyDto.prototype, "currency", void 0);
21
+
22
+ export { MoneyDto };
@@ -1,11 +1,11 @@
1
1
  import '../../../core/injection/index.js';
2
2
  import '../../../feature/rest-controller/metadata/RestControllerMetadataStore.js';
3
3
  import { middleware } from '../../../feature/rest-controller/metadata/@middleware.js';
4
- import 'path';
5
4
  import 'debug';
6
- import '../../../feature/express/ExpressProvider.js';
7
5
  import '../../../core/validation/metadata/ValidationMetadataStore.js';
8
- import '../../../feature/rest-controller/auth/Auth.js';
6
+ import '../../../feature/express/ExpressProvider.js';
7
+ import 'express';
8
+ import 'path';
9
9
  import { JwtGuardMiddleware } from './JwtGuardMiddleware.js';
10
10
 
11
11
  function jwtGuard() {
@@ -3,12 +3,7 @@ import { JwtSigner } from './JwtSigner.js';
3
3
  import { JwtRefreshTokenRepository } from './JwtRefreshTokenRepository.js';
4
4
  import { JwtRefreshToken } from './JwtRefreshToken.js';
5
5
  import { injectable } from '../../../core/injection/index.js';
6
- import '../../../feature/rest-controller/metadata/RestControllerMetadataStore.js';
7
- import 'path';
8
- import 'debug';
9
- import '../../../feature/express/ExpressProvider.js';
10
- import '../../../core/validation/metadata/ValidationMetadataStore.js';
11
- import { Auth } from '../../../feature/rest-controller/auth/Auth.js';
6
+ import { Auth } from '../../../core/auth/Auth.js';
12
7
 
13
8
  let Jwt = class Jwt {
14
9
  auth;
@@ -1,14 +1,9 @@
1
1
  import { __decorate, __metadata } from 'tslib';
2
2
  import { CustomError } from '../../../core/error/CustomError.js';
3
3
  import { injectable } from '../../../core/injection/index.js';
4
- import '../../../feature/rest-controller/metadata/RestControllerMetadataStore.js';
5
- import 'path';
6
- import 'debug';
7
- import '../../../feature/express/ExpressProvider.js';
8
- import '../../../core/validation/metadata/ValidationMetadataStore.js';
9
- import { Auth } from '../../../feature/rest-controller/auth/Auth.js';
10
4
  import jwt from 'jsonwebtoken';
11
5
  import { JwtConfig } from './JwtConfig.js';
6
+ import { Auth } from '../../../core/auth/Auth.js';
12
7
 
13
8
  let JwtGuardMiddleware = class JwtGuardMiddleware {
14
9
  config;
@@ -1,6 +1,6 @@
1
1
  import { __decorate } from 'tslib';
2
- import { CustomError } from '../../../core/error/CustomError.js';
3
- import { scoped, Lifecycle } from '../../../core/injection/index.js';
2
+ import { CustomError } from '../error/CustomError.js';
3
+ import { scoped, Lifecycle } from '../injection/index.js';
4
4
 
5
5
  let Auth = class Auth {
6
6
  authInfo = null;
@@ -1,7 +1,6 @@
1
1
  import { __decorate, __metadata } from 'tslib';
2
2
  import { HttpServerProvider } from '../http/HttpServerProvider.js';
3
3
  import express from 'express';
4
- import bodyParser from 'body-parser';
5
4
  import { Logger } from '../../core/logger/Logger.js';
6
5
  import { singleton } from '../../core/injection/index.js';
7
6
 
@@ -23,7 +22,6 @@ let ExpressProvider = class ExpressProvider {
23
22
  }
24
23
  createExpress() {
25
24
  const expressApp = express();
26
- expressApp.use(bodyParser.json());
27
25
  expressApp.use((req, res, next) => {
28
26
  const start = process.hrtime();
29
27
  res.on('finish', () => {
@@ -0,0 +1,61 @@
1
+ import { Storable } from '../../core/storable/Storable.js';
2
+ import { Big } from 'big.js';
3
+
4
+ Big.strict = true;
5
+ class Money extends Storable {
6
+ getData() {
7
+ return { ...this.data };
8
+ }
9
+ get amount() {
10
+ return Big(this.data.amount);
11
+ }
12
+ get currency() {
13
+ return this.data.currency;
14
+ }
15
+ plus(money) {
16
+ this.validateEqualCurrencies(this.data.currency, money.data.currency);
17
+ return new Money({
18
+ amount: this.amount.plus(money.amount).toFixed(6),
19
+ currency: this.currency,
20
+ });
21
+ }
22
+ minus(money) {
23
+ this.validateEqualCurrencies(this.data.currency, money.data.currency);
24
+ return new Money({
25
+ amount: this.amount.minus(money.amount).toFixed(6),
26
+ currency: this.currency,
27
+ });
28
+ }
29
+ times(value) {
30
+ return new Money({
31
+ amount: this.amount.times(new Big(String(value))).toFixed(6),
32
+ currency: this.currency,
33
+ });
34
+ }
35
+ div(value) {
36
+ return new Money({
37
+ amount: this.amount.div(new Big(String(value))).toFixed(6),
38
+ currency: this.currency,
39
+ });
40
+ }
41
+ negative() {
42
+ return new Money({
43
+ amount: new Big('0').minus(this.amount).toFixed(6),
44
+ currency: this.currency,
45
+ });
46
+ }
47
+ isGretterThan(money) {
48
+ this.validateEqualCurrencies(this.data.currency, money.data.currency);
49
+ return this.amount.gt(money.amount);
50
+ }
51
+ validateEqualCurrencies(left, right) {
52
+ if (left !== right) {
53
+ throw new Error(`Is not posible operate with diferent currencies: '${left}' and '${right}'`);
54
+ }
55
+ }
56
+ static zero(currency) {
57
+ return new Money({ currency, amount: '0' });
58
+ }
59
+ }
60
+
61
+ export { Money };
@@ -8,9 +8,9 @@ function get(config) {
8
8
  const store = container.resolve(RestControllerMetadataStore);
9
9
  store.saveEndPointMetadata({
10
10
  controllerConstructor: target.constructor,
11
- functionName,
12
11
  method: 'get',
13
- path: typeof config === 'string' ? config : config?.path,
12
+ config: typeof config === 'string' ? { path: config } : config,
13
+ functionName,
14
14
  paramsTypes,
15
15
  });
16
16
  };
@@ -8,9 +8,9 @@ function post(config) {
8
8
  const store = container.resolve(RestControllerMetadataStore);
9
9
  store.saveEndPointMetadata({
10
10
  controllerConstructor: target.constructor,
11
- functionName,
12
11
  method: 'post',
13
- path: typeof config === 'string' ? config : config?.path,
12
+ config: typeof config === 'string' ? { path: config } : config,
13
+ functionName,
14
14
  paramsTypes,
15
15
  });
16
16
  };
@@ -1,12 +1,13 @@
1
- import path from 'path';
1
+ import { CustomError } from '../../core/error/CustomError.js';
2
2
  import { container } from '../../core/injection/index.js';
3
- import { RestControllerMetadataStore } from './metadata/RestControllerMetadataStore.js';
4
3
  import { Logger } from '../../core/logger/Logger.js';
5
- import { ExpressProvider } from '../express/ExpressProvider.js';
6
4
  import '../../core/validation/metadata/ValidationMetadataStore.js';
7
5
  import { validate } from '../../core/validation/validate.js';
8
- import { CustomError } from '../../core/error/CustomError.js';
6
+ import { ExpressProvider } from '../express/ExpressProvider.js';
7
+ import { json, urlencoded } from 'express';
8
+ import path from 'path';
9
9
  import { EXPRESS_REQ, EXPRESS_RES } from './injection-tokens.js';
10
+ import { RestControllerMetadataStore } from './metadata/RestControllerMetadataStore.js';
10
11
 
11
12
  function buildRequest(req) {
12
13
  return Object.assign({}, req.body, req.query, req.params);
@@ -20,9 +21,18 @@ function runRestControllers(controllers) {
20
21
  const endPoints = metadataStore.getControllerEndPointsInfo(controller);
21
22
  endPoints.forEach((endPoint) => {
22
23
  const method = endPoint.method;
23
- const route = path.join(endPoint.controller.path, endPoint.path ?? '').replaceAll('\\', '/');
24
+ const route = path
25
+ .join(endPoint.controller.path, endPoint.config?.path ?? '')
26
+ .replaceAll('\\', '/');
24
27
  logger.info(`config ${endPoint.method.toUpperCase()} ${route}`);
25
- expressApp[method](route, async (req, res) => {
28
+ const rawMiddlewares = [];
29
+ if (!endPoint.config?.disableJsonParser) {
30
+ rawMiddlewares.push(json());
31
+ }
32
+ if (!endPoint.config?.disableUrlEncodedParser) {
33
+ rawMiddlewares.push(urlencoded({ extended: true }));
34
+ }
35
+ expressApp[method](route, ...rawMiddlewares, async (req, res) => {
26
36
  const requestContainer = container.createChildContainer();
27
37
  requestContainer.register(EXPRESS_REQ, { useValue: req });
28
38
  requestContainer.register(EXPRESS_RES, { useValue: req });
@@ -7,6 +7,7 @@ import InterceptionOptions from 'tsyringe/dist/typings/types/interceptor-options
7
7
  import { Server } from 'http';
8
8
  import { Express, Request, Response } from 'express';
9
9
  import { Server as Server$1 } from 'socket.io';
10
+ import * as big_js from 'big.js';
10
11
  import { Pool } from 'pg';
11
12
  import { Socket } from 'socket.io-client';
12
13
  import { Algorithm } from 'jsonwebtoken';
@@ -20,6 +21,12 @@ declare class Storable<D extends IStorableData> {
20
21
  constructor(data: D);
21
22
  }
22
23
 
24
+ declare class Auth<D extends IStorableData> {
25
+ private authInfo;
26
+ require(): D;
27
+ assign(authInfo: D): void;
28
+ }
29
+
23
30
  interface IEntityData extends IStorableData {
24
31
  id?: string;
25
32
  createdAt?: number | null;
@@ -670,11 +677,13 @@ declare class ExpressProvider {
670
677
  private createExpress;
671
678
  }
672
679
 
673
- interface IGetConfig {
680
+ interface IEndPointConfig {
674
681
  path?: string;
682
+ disableJsonParser?: boolean;
683
+ disableUrlEncodedParser?: boolean;
675
684
  }
676
685
 
677
- declare function get(config?: string | IGetConfig): (target: object, propertyKey: string | symbol) => void;
686
+ declare function get(config?: string | IEndPointConfig): (target: object, propertyKey: string | symbol) => void;
678
687
 
679
688
  interface IMiddleware {
680
689
  handle(req: Request, res: Response, container: DependencyContainer$1): Promise<void>;
@@ -682,11 +691,7 @@ interface IMiddleware {
682
691
 
683
692
  declare function middleware(middlewareConstructor: IConstructor<IMiddleware>): (target: object, propertyKey: string | symbol) => void;
684
693
 
685
- interface IPostConfig {
686
- path?: string;
687
- }
688
-
689
- declare function post(config?: string | IPostConfig): (target: object, propertyKey: string | symbol) => void;
694
+ declare function post(config?: string | IEndPointConfig): (target: object, propertyKey: string | symbol) => void;
690
695
 
691
696
  interface IRestControllerConfig {
692
697
  path: string;
@@ -696,7 +701,7 @@ declare function restController(config: string | IRestControllerConfig): (target
696
701
 
697
702
  interface IEndPointMetadata {
698
703
  method: 'get' | 'post';
699
- path?: string;
704
+ config?: IEndPointConfig;
700
705
  controllerConstructor: IConstructor<any>;
701
706
  functionName: string;
702
707
  paramsTypes: any[];
@@ -724,7 +729,7 @@ declare class RestControllerMetadataStore {
724
729
  middlewares: IMiddlewareMetadata[];
725
730
  controller: IRestControllerMetadata;
726
731
  method: "get" | "post";
727
- path?: string;
732
+ config?: IEndPointConfig;
728
733
  controllerConstructor: IConstructor<any>;
729
734
  functionName: string;
730
735
  paramsTypes: any[];
@@ -733,12 +738,6 @@ declare class RestControllerMetadataStore {
733
738
 
734
739
  declare function runRestControllers(controllers: IConstructor<any>[]): void;
735
740
 
736
- declare class Auth<D extends IStorableData> {
737
- private authInfo;
738
- require(): D;
739
- assign(authInfo: D): void;
740
- }
741
-
742
741
  declare const EXPRESS_REQ = "EXPRESS_REQ";
743
742
  declare const EXPRESS_RES = "EXPRESS_RES";
744
743
 
@@ -752,6 +751,28 @@ declare class SocketServerProvider {
752
751
  private createSocketServer;
753
752
  }
754
753
 
754
+ interface IMoneyData extends IStorableData {
755
+ amount: string;
756
+ currency: string;
757
+ }
758
+ declare class Money extends Storable<IMoneyData> {
759
+ getData(): {
760
+ [key: string]: IPrimitive | IStorableData | IPrimitive[] | IStorableData[];
761
+ amount: string;
762
+ currency: string;
763
+ };
764
+ get amount(): big_js.Big;
765
+ get currency(): string;
766
+ plus(money: Money): Money;
767
+ minus(money: Money): Money;
768
+ times(value: bigint | string): Money;
769
+ div(value: bigint | string): Money;
770
+ negative(): Money;
771
+ isGretterThan(money: Money): boolean;
772
+ protected validateEqualCurrencies(left: string, right: string): void;
773
+ static zero(currency: string): Money;
774
+ }
775
+
755
776
  type IPgRepositoryConfig<P extends Entity<IEntityData>> = {
756
777
  schema?: string;
757
778
  table: string;
@@ -1308,4 +1329,9 @@ interface IValidateMaxOptions {
1308
1329
  }
1309
1330
  declare function validateMax(value: any, options: IValidateMaxOptions): IValidationResult<any>;
1310
1331
 
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 };
1332
+ declare class MoneyDto {
1333
+ amount: string;
1334
+ currency: string;
1335
+ }
1336
+
1337
+ 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 IEndPointConfig, type IEndPointMetadata, type IEntityData, type IEnvType, type IFunctionCall, type IFunctionCallItem, 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 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 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, Money, MoneyDto, 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
@@ -1,3 +1,4 @@
1
+ export { Auth } from './core/auth/Auth.js';
1
2
  export { Entity, Persistent } from './core/entity/Entity.js';
2
3
  export { Env } from './core/env/Env.js';
3
4
  export { CustomError } from './core/error/CustomError.js';
@@ -56,9 +57,9 @@ export { post } from './feature/rest-controller/metadata/@post.js';
56
57
  export { restController } from './feature/rest-controller/metadata/@restController.js';
57
58
  export { RestControllerMetadataStore } from './feature/rest-controller/metadata/RestControllerMetadataStore.js';
58
59
  export { runRestControllers } from './feature/rest-controller/runRestControllers.js';
59
- export { Auth } from './feature/rest-controller/auth/Auth.js';
60
60
  export { EXPRESS_REQ, EXPRESS_RES } from './feature/rest-controller/injection-tokens.js';
61
61
  export { SocketServerProvider } from './feature/socket/SocketServerProvider.js';
62
+ export { Money } from './feature/money/Money.js';
62
63
  export { PgJobRepository } from './addon/async/pg/PgJobRepository.js';
63
64
  export { ClaudeChatAdapter } from './addon/chat-bot/claude/ClaudeChatAdapter.js';
64
65
  export { DeepSeekChatAdapter } from './addon/chat-bot/deepseek/DeepSeekChatAdapter.js';
@@ -117,4 +118,5 @@ export { min } from './addon/validation/min/@min.js';
117
118
  export { validateMin } from './addon/validation/min/validateMin.js';
118
119
  export { max } from './addon/validation/max/@max.js';
119
120
  export { validateMax } from './addon/validation/max/validateMax.js';
121
+ export { MoneyDto } from './addon/money/MoneyDto.js';
120
122
  export { Container } from './core/injection/Container.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wabot-dev/framework",
3
- "version": "0.1.0-beta.37",
3
+ "version": "0.1.0-beta.39",
4
4
  "description": "Framework for IA Chat Bots",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -24,6 +24,7 @@
24
24
  "@rollup/plugin-json": "6.1.0",
25
25
  "@rollup/plugin-node-resolve": "16.0.1",
26
26
  "@rollup/plugin-typescript": "12.1.2",
27
+ "@types/big.js": "^6.2.2",
27
28
  "@types/html-to-text": "^9.0.4",
28
29
  "@types/node": "22.14.1",
29
30
  "@types/react": "^19.1.2",
@@ -42,6 +43,7 @@
42
43
  "@types/jsonwebtoken": "^9.0.10",
43
44
  "@types/pg": "^8.11.14",
44
45
  "@yucacodes/ts": "^0.0.4",
46
+ "big.js": "^7.0.1",
45
47
  "body-parser": "^2.2.0",
46
48
  "debug": "^4.4.0",
47
49
  "dotenv": "^16.5.0",