@wabot-dev/framework 0.1.0-beta.47 → 0.1.0-beta.49

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,9 @@ class ApiKey extends Entity {
6
6
  get authInfo() {
7
7
  return this.data.authInfo;
8
8
  }
9
+ setAuthInfo(authInfo) {
10
+ this.data.authInfo = authInfo;
11
+ }
9
12
  generatePassword() {
10
13
  if (this.data.passwordHash) {
11
14
  throw new Error('This api key, already has a secret');
@@ -21,7 +24,7 @@ class ApiKey extends Entity {
21
24
  }
22
25
  validatePassword(password) {
23
26
  if (!this.isValidPassword(password)) {
24
- throw new CustomError({ message: 'Invalid Api key', httpCode: 401 });
27
+ throw new CustomError({ message: 'invalid api key', httpCode: 401 });
25
28
  }
26
29
  }
27
30
  static inflate(secret) {
@@ -29,16 +32,20 @@ class ApiKey extends Entity {
29
32
  const json = Buffer.from(secret, 'base64').toString('utf-8');
30
33
  const data = JSON.parse(json);
31
34
  if (!data.id || !data.pass) {
32
- throw new Error('Invalid secret structure');
35
+ throw new Error('invalid secret structure');
33
36
  }
34
37
  return data;
35
38
  }
36
39
  catch (err) {
37
- throw new Error('Failed to inflate secret: ' + err.message);
40
+ throw new Error('fail to inflate secret: ' + err.message);
38
41
  }
39
42
  }
40
43
  static deflate(data) {
41
- const json = JSON.stringify(data);
44
+ const { id, pass } = data;
45
+ if (!id || !pass) {
46
+ throw new Error('id and pass required');
47
+ }
48
+ const json = JSON.stringify({ id, pass });
42
49
  return Buffer.from(json, 'utf-8').toString('base64');
43
50
  }
44
51
  }
@@ -4,28 +4,50 @@ import { JwtRefreshTokenRepository } from './JwtRefreshTokenRepository.js';
4
4
  import { JwtRefreshToken } from './JwtRefreshToken.js';
5
5
  import { injectable } from '../../../core/injection/index.js';
6
6
  import { Auth } from '../../../core/auth/Auth.js';
7
+ import { JwtConfig } from './JwtConfig.js';
7
8
 
8
9
  let Jwt = class Jwt {
9
10
  auth;
10
11
  jwtSigner;
11
12
  jwtRefreshTokenRepository;
12
- constructor(auth, jwtSigner, jwtRefreshTokenRepository) {
13
+ config;
14
+ constructor(auth, jwtSigner, jwtRefreshTokenRepository, config) {
13
15
  this.auth = auth;
14
16
  this.jwtSigner = jwtSigner;
15
17
  this.jwtRefreshTokenRepository = jwtRefreshTokenRepository;
18
+ this.config = config;
16
19
  }
17
20
  async createToken() {
18
21
  const authInfo = this.auth.require();
19
- const refreshToken = new JwtRefreshToken({ authInfo });
22
+ const refreshToken = new JwtRefreshToken({
23
+ authInfo,
24
+ expirationTime: new Date().getTime() + this.config.refreshExpirationSeconds * 1000,
25
+ });
26
+ const refreshPassword = refreshToken.generatePassword();
20
27
  await this.jwtRefreshTokenRepository.create(refreshToken);
21
- return await this.jwtSigner.signAccessAndRefreshToken(refreshToken);
28
+ const access = await this.jwtSigner.signAccessToken(refreshToken);
29
+ const refresh = {
30
+ token: JwtRefreshToken.deflate({ id: refreshToken.id, pass: refreshPassword }),
31
+ expiration: new Date(refreshToken.expirationTime),
32
+ };
33
+ return {
34
+ access,
35
+ refresh,
36
+ };
37
+ }
38
+ async refreshToken(refreshSecret) {
39
+ const { id, pass } = JwtRefreshToken.inflate(refreshSecret);
40
+ const refreshToken = await this.jwtRefreshTokenRepository.findOrThrow(id);
41
+ refreshToken.validatePassword(pass);
42
+ return this.jwtSigner.signAccessToken(refreshToken);
22
43
  }
23
44
  };
24
45
  Jwt = __decorate([
25
46
  injectable(),
26
47
  __metadata("design:paramtypes", [Auth,
27
48
  JwtSigner,
28
- JwtRefreshTokenRepository])
49
+ JwtRefreshTokenRepository,
50
+ JwtConfig])
29
51
  ], Jwt);
30
52
 
31
53
  export { Jwt };
@@ -1,9 +1,56 @@
1
1
  import { Entity } from '../../../core/entity/Entity.js';
2
+ import { CustomError } from '../../../core/error/CustomError.js';
3
+ import { Password } from '../../../core/password/Password.js';
2
4
 
3
5
  class JwtRefreshToken extends Entity {
4
6
  get authInfo() {
5
7
  return this.data.authInfo;
6
8
  }
9
+ get expirationTime() {
10
+ return new Date(this.data.expirationTime);
11
+ }
12
+ generatePassword() {
13
+ if (this.data.passwordHash) {
14
+ throw new Error('This api key, already has a secret');
15
+ }
16
+ const password = Password.generate(64);
17
+ this.data.passwordHash = Password.hash({ password: password });
18
+ return password;
19
+ }
20
+ isValidPassword(password) {
21
+ if (new Date().getTime() > this.data.expirationTime) {
22
+ return false;
23
+ }
24
+ if (!this.data.passwordHash)
25
+ return false;
26
+ return Password.isValid({ password: password, hash: this.data.passwordHash });
27
+ }
28
+ validatePassword(password) {
29
+ if (!this.isValidPassword(password)) {
30
+ throw new CustomError({ message: 'Invalid Api key', httpCode: 401 });
31
+ }
32
+ }
33
+ static inflate(secret) {
34
+ try {
35
+ const json = Buffer.from(secret, 'base64').toString('utf-8');
36
+ const data = JSON.parse(json);
37
+ if (!data.id || !data.pass) {
38
+ throw new Error('invalid secret structure');
39
+ }
40
+ return data;
41
+ }
42
+ catch (err) {
43
+ throw new Error('fail to inflate secret: ' + err.message);
44
+ }
45
+ }
46
+ static deflate(data) {
47
+ const { id, pass } = data;
48
+ if (!id || !pass) {
49
+ throw new Error('id and pass required');
50
+ }
51
+ const json = JSON.stringify({ id, pass });
52
+ return Buffer.from(json, 'utf-8').toString('base64');
53
+ }
7
54
  }
8
55
 
9
56
  export { JwtRefreshToken };
@@ -1,11 +1,10 @@
1
1
  import { __decorate, __metadata } from 'tslib';
2
- import { JwtConfig } from './JwtConfig.js';
3
2
  import jwt from 'jsonwebtoken';
3
+ import { JwtConfig } from './JwtConfig.js';
4
4
  import { JwtTokenDto } from './JwtTokenDto.js';
5
- import { JwtRefreshToken } from './JwtRefreshToken.js';
6
- import { JwtAccessAndRefreshTokenDto } from './JwtAccessAndRefreshTokenDto.js';
7
5
  import { injectable } from '../../../core/injection/index.js';
8
6
  import { Mapper } from '../../../core/mapper/Mapper.js';
7
+ import { JwtRefreshToken } from './JwtRefreshToken.js';
9
8
 
10
9
  let JwtSigner = class JwtSigner {
11
10
  config;
@@ -27,22 +26,11 @@ let JwtSigner = class JwtSigner {
27
26
  const expiration = new Date().getTime() + this.config.accessExpirationSeconds * 1000;
28
27
  return this.mapper.map({ token, expiration }, JwtTokenDto);
29
28
  }
30
- async signRefreshToken(refreshToken) {
31
- const token = jwt.sign({ refreshTokenId: refreshToken.id }, this.config.secretOrPrivateKey, {
32
- expiresIn: this.config.refreshExpirationSeconds,
33
- });
34
- const expiration = new Date().getTime() + this.config.refreshExpirationSeconds * 1000;
35
- return this.mapper.map({ token, expiration }, JwtTokenDto);
36
- }
37
- async signAccessAndRefreshToken(refreshToken) {
38
- const access = await this.signAccessToken(refreshToken);
39
- const refresh = await this.signRefreshToken(refreshToken);
40
- return this.mapper.map({ access, refresh }, JwtAccessAndRefreshTokenDto);
41
- }
42
29
  };
43
30
  JwtSigner = __decorate([
44
31
  injectable(),
45
- __metadata("design:paramtypes", [JwtConfig, Mapper])
32
+ __metadata("design:paramtypes", [JwtConfig,
33
+ Mapper])
46
34
  ], JwtSigner);
47
35
 
48
36
  export { JwtSigner };
@@ -19,6 +19,9 @@ class PgCrudRepository extends PgRepositoryBase {
19
19
  return items.at(0) ?? null;
20
20
  }
21
21
  async findByIds(ids) {
22
+ if (ids.length === 0) {
23
+ return [];
24
+ }
22
25
  const sql = `
23
26
  SELECT ${this.columns}
24
27
  FROM ${this.table}
@@ -969,43 +969,46 @@ declare class PgJobRepository extends PgCrudRepository<Job> implements IJobRepos
969
969
 
970
970
  declare function apiKeyGuard(): (target: object, propertyKey: string | symbol) => void;
971
971
 
972
- interface IApiKeyData extends IEntityData {
972
+ interface IApiKeyData<A extends IStorableData> extends IEntityData {
973
973
  passwordHash?: string;
974
- authInfo: IStorableData;
975
- }
976
- interface IApiKeySecretData {
977
- id: string;
978
- pass: string;
974
+ authInfo: A;
979
975
  }
980
- declare class ApiKey extends Entity<IApiKeyData> {
981
- get authInfo(): IStorableData;
976
+ declare class ApiKey<A extends IStorableData> extends Entity<IApiKeyData<A>> {
977
+ get authInfo(): A;
978
+ setAuthInfo(authInfo: A): void;
982
979
  generatePassword(): string;
983
980
  isValidPassword(password: string): boolean;
984
981
  validatePassword(password: string): void;
985
- static inflate(secret: string): IApiKeySecretData;
986
- static deflate(data: IApiKeySecretData): string;
982
+ static inflate(secret: string): {
983
+ id: string;
984
+ pass: string;
985
+ };
986
+ static deflate(data: {
987
+ id: string;
988
+ pass: string;
989
+ }): string;
987
990
  }
988
991
 
989
- interface IApiKeyRepository {
990
- find(id: string): Promise<ApiKey | null>;
991
- findOrThrow(id: string): Promise<ApiKey>;
992
- create(item: ApiKey): Promise<void>;
992
+ interface IApiKeyRepository<A extends IStorableData> {
993
+ find(id: string): Promise<ApiKey<A> | null>;
994
+ findOrThrow(id: string): Promise<ApiKey<A>>;
995
+ create(item: ApiKey<A>): Promise<void>;
993
996
  }
994
997
 
995
- declare class ApiKeyRepository implements IApiKeyRepository {
996
- find(id: string): Promise<ApiKey | null>;
997
- findOrThrow(id: string): Promise<ApiKey>;
998
- create(item: ApiKey): Promise<void>;
998
+ declare class ApiKeyRepository<A extends IStorableData> implements IApiKeyRepository<A> {
999
+ find(id: string): Promise<ApiKey<A> | null>;
1000
+ findOrThrow(id: string): Promise<ApiKey<A>>;
1001
+ create(item: ApiKey<A>): Promise<void>;
999
1002
  }
1000
1003
 
1001
1004
  declare class ApiKeyGuardMiddleware implements IMiddleware {
1002
1005
  private apiKeyRepository;
1003
1006
  private auth;
1004
- constructor(apiKeyRepository: ApiKeyRepository, auth: Auth<any>);
1007
+ constructor(apiKeyRepository: ApiKeyRepository<any>, auth: Auth<any>);
1005
1008
  handle(req: Request, res: Response, container: DependencyContainer$1): Promise<void>;
1006
1009
  }
1007
1010
 
1008
- declare class PgApiKeyRepository extends PgCrudRepository<ApiKey> implements IApiKeyRepository {
1011
+ declare class PgApiKeyRepository<A extends IStorableData> extends PgCrudRepository<ApiKey<A>> implements IApiKeyRepository<A> {
1009
1012
  constructor(pool: Pool);
1010
1013
  }
1011
1014
 
@@ -1015,9 +1018,23 @@ declare function jwtGuard(): (target: object, propertyKey: string | symbol) => v
1015
1018
 
1016
1019
  interface IJwtRefreshTokenData<A extends IStorableData> extends IEntityData {
1017
1020
  authInfo: A;
1021
+ passwordHash?: string;
1022
+ expirationTime: number;
1018
1023
  }
1019
1024
  declare class JwtRefreshToken<A extends IStorableData> extends Entity<IJwtRefreshTokenData<A>> {
1020
1025
  get authInfo(): A;
1026
+ get expirationTime(): Date;
1027
+ generatePassword(): string;
1028
+ isValidPassword(password: string): boolean;
1029
+ validatePassword(password: string): void;
1030
+ static inflate(secret: string): {
1031
+ id: string;
1032
+ pass: string;
1033
+ };
1034
+ static deflate(data: {
1035
+ id: string;
1036
+ pass: string;
1037
+ }): string;
1021
1038
  }
1022
1039
 
1023
1040
  interface IJwtRefreshTokenRepository<D extends IStorableData> extends ICrudRepository<JwtRefreshToken<D>> {
@@ -1047,8 +1064,6 @@ declare class JwtSigner {
1047
1064
  private mapper;
1048
1065
  constructor(config: JwtConfig, mapper: Mapper);
1049
1066
  signAccessToken<D extends IStorableData>(info: D | JwtRefreshToken<any>): Promise<JwtTokenDto>;
1050
- signRefreshToken(refreshToken: JwtRefreshToken<any>): Promise<JwtTokenDto>;
1051
- signAccessAndRefreshToken(refreshToken: JwtRefreshToken<any>): Promise<JwtAccessAndRefreshTokenDto>;
1052
1067
  }
1053
1068
 
1054
1069
  declare class JwtRefreshTokenRepository<D extends IStorableData> implements IJwtRefreshTokenRepository<D> {
@@ -1065,8 +1080,10 @@ declare class Jwt {
1065
1080
  private auth;
1066
1081
  private jwtSigner;
1067
1082
  private jwtRefreshTokenRepository;
1068
- constructor(auth: Auth<any>, jwtSigner: JwtSigner, jwtRefreshTokenRepository: JwtRefreshTokenRepository<any>);
1083
+ private config;
1084
+ constructor(auth: Auth<any>, jwtSigner: JwtSigner, jwtRefreshTokenRepository: JwtRefreshTokenRepository<any>, config: JwtConfig);
1069
1085
  createToken(): Promise<JwtAccessAndRefreshTokenDto>;
1086
+ refreshToken(refreshSecret: string): Promise<JwtTokenDto>;
1070
1087
  }
1071
1088
 
1072
1089
  declare class JwtConnectionGuardMiddleware implements IConnectionMiddleware {
@@ -1529,4 +1546,4 @@ declare function HtmlModule(options: IHtmlModuleOptions): {
1529
1546
  new (): {};
1530
1547
  };
1531
1548
 
1532
- export { AnthropicChatAdapter, ApiKey, 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 IApiKeySecretData, 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 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 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, 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, apiKeyGuard, chatBot, chatController, chatItemTypeOptions, cmd, command, commandHandler, connectionMiddleware, container, get, inject, injectable, isArray, isBoolean, isDate, isModel, isNotEmpty, isNumber, isOptional, isPresent, isString, jwtConnectionGuard, jwtGuard, max, middleware, min, mindset, mindsetFunction, mindsetModule, modelInfo, param, post, restController, runAsyncCommandHandlers, runChatControllers, runRestControllers, runSocketControllers, scoped, singleton, socket, socketConnection, socketController, socketEvent, telegram, validate, validateArray, validateIsBoolean, validateIsDate, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsString, validateMax, validateMin, validateModel, whatsApp };
1549
+ export { AnthropicChatAdapter, ApiKey, 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 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 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, 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, apiKeyGuard, chatBot, chatController, chatItemTypeOptions, cmd, command, commandHandler, connectionMiddleware, container, get, inject, injectable, isArray, isBoolean, isDate, isModel, isNotEmpty, isNumber, isOptional, isPresent, isString, jwtConnectionGuard, jwtGuard, max, middleware, min, mindset, mindsetFunction, mindsetModule, modelInfo, param, post, restController, runAsyncCommandHandlers, runChatControllers, runRestControllers, runSocketControllers, scoped, singleton, socket, socketConnection, socketController, socketEvent, telegram, validate, validateArray, validateIsBoolean, validateIsDate, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsString, validateMax, validateMin, validateModel, whatsApp };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wabot-dev/framework",
3
- "version": "0.1.0-beta.47",
3
+ "version": "0.1.0-beta.49",
4
4
  "description": "Framework for IA Chat Bots",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",