@wabot-dev/framework 0.1.0-beta.55 → 0.1.0-beta.57

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.
@@ -1,4 +1,9 @@
1
+ import { ApiKey } from './ApiKey.js';
2
+
1
3
  class ApiKeyRepository {
4
+ findAuthInfo(secret) {
5
+ throw new Error('Method not implemented.');
6
+ }
2
7
  find(id) {
3
8
  throw new Error('Method not implemented.');
4
9
  }
@@ -8,6 +13,23 @@ class ApiKeyRepository {
8
13
  create(item) {
9
14
  throw new Error('Method not implemented.');
10
15
  }
16
+ generate(req) {
17
+ throw new Error('Method not implemented.');
18
+ }
19
+ static async generate(repository, req) {
20
+ const apiKey = new ApiKey(req);
21
+ const pass = apiKey.generatePassword();
22
+ await repository.create(apiKey);
23
+ const id = apiKey.id;
24
+ const secret = ApiKey.deflate({ id, pass });
25
+ return { id, secret };
26
+ }
27
+ static async findAuthInfo(repository, secret) {
28
+ const { id, pass } = ApiKey.inflate(secret);
29
+ const apiKey = await repository.findOrThrow(id);
30
+ apiKey.validatePassword(pass);
31
+ return apiKey.authInfo;
32
+ }
11
33
  }
12
34
 
13
35
  export { ApiKeyRepository };
@@ -3,6 +3,7 @@ import { ApiKey } from './ApiKey.js';
3
3
  import { Pool } from 'pg';
4
4
  import { PgCrudRepository } from '../../../feature/pg/PgCrudRepository.js';
5
5
  import { singleton } from 'tsyringe';
6
+ import { ApiKeyRepository } from './ApiKeyRepository.js';
6
7
 
7
8
  let PgApiKeyRepository = class PgApiKeyRepository extends PgCrudRepository {
8
9
  constructor(pool) {
@@ -12,6 +13,12 @@ let PgApiKeyRepository = class PgApiKeyRepository extends PgCrudRepository {
12
13
  constructor: ApiKey,
13
14
  });
14
15
  }
16
+ findAuthInfo(secret) {
17
+ return ApiKeyRepository.findAuthInfo(this, secret);
18
+ }
19
+ async generate(req) {
20
+ return ApiKeyRepository.generate(this, req);
21
+ }
15
22
  };
16
23
  PgApiKeyRepository = __decorate([
17
24
  singleton(),
@@ -0,0 +1,42 @@
1
+ import { ApiKeyRepository } from './ApiKeyRepository.js';
2
+
3
+ class RemoteApiKeyRepository {
4
+ fetcher;
5
+ cacheSeconds;
6
+ cache = new Map();
7
+ constructor(fetcher, cacheSeconds) {
8
+ this.fetcher = fetcher;
9
+ this.cacheSeconds = cacheSeconds;
10
+ }
11
+ async find(id) {
12
+ const now = Date.now();
13
+ const cached = this.cache.get(id);
14
+ if (cached && cached.expiresAt > now) {
15
+ return cached.value;
16
+ }
17
+ const result = await this.fetcher(id);
18
+ this.cache.set(id, {
19
+ value: result,
20
+ expiresAt: now + this.cacheSeconds * 1000,
21
+ });
22
+ return result;
23
+ }
24
+ async findOrThrow(id) {
25
+ const result = await this.find(id);
26
+ if (!result) {
27
+ throw new Error(`API key with ID '${id}' not found.`);
28
+ }
29
+ return result;
30
+ }
31
+ findAuthInfo(secret) {
32
+ return ApiKeyRepository.findAuthInfo(this, secret);
33
+ }
34
+ create(item) {
35
+ throw new Error('Method not implemented.');
36
+ }
37
+ async generate(req) {
38
+ throw new Error('Method not implemented.');
39
+ }
40
+ }
41
+
42
+ export { RemoteApiKeyRepository };
@@ -2,122 +2,120 @@ import { __decorate, __metadata } from 'tslib';
2
2
  import { Env } from '../../../core/env/Env.js';
3
3
  import { singleton } from '../../../core/injection/index.js';
4
4
  import { Logger } from '../../../core/logger/Logger.js';
5
- import { GoogleGenAI } from '@google/genai';
5
+ import OpenAI from 'openai';
6
6
 
7
7
  let GoogleChatAdapter = class GoogleChatAdapter {
8
8
  env;
9
- genai;
9
+ openai;
10
10
  logger = new Logger('wabot:google-chat-adapter');
11
11
  constructor(env) {
12
12
  this.env = env;
13
13
  const apiKey = this.env.requireString('GOOGLE_API_KEY');
14
- this.genai = new GoogleGenAI({ apiKey });
14
+ this.openai = new OpenAI({
15
+ apiKey,
16
+ baseURL: 'https://generativelanguage.googleapis.com/v1beta/openai/',
17
+ });
15
18
  }
16
19
  async nextItem(req) {
17
- const geminiInput = [];
18
- geminiInput.push(...this.mapChatItems(req.prevItems, req.systemPrompt));
20
+ const messages = [];
21
+ // Add system prompt as system message
22
+ messages.push({ role: 'system', content: req.systemPrompt });
23
+ // Add previous chat items
24
+ messages.push(...this.mapChatItems(req.prevItems));
19
25
  const tools = req.tools.map((x) => this.mapTool(x));
20
26
  const request = {
21
27
  model: req.model,
22
- contents: geminiInput,
28
+ messages,
23
29
  tools: tools.length > 0 ? tools : undefined,
30
+ tool_choice: 'auto',
24
31
  };
25
32
  this.logger.debug(`Call Gemini API with Request: ${JSON.stringify(request)}`);
26
- const response = await this.genai.models.generateContent(request);
33
+ const response = await this.openai.chat.completions.create(request);
27
34
  return this.mapResponse(response);
28
35
  }
29
- mapChatItems(chatItems, systemPrompt) {
30
- const geminiInput = [];
31
- if (systemPrompt) {
32
- geminiInput.push({ role: 'user', parts: [{ text: 'system: ' + systemPrompt }] });
33
- geminiInput.push({ role: 'model', parts: [{ text: 'I understand.' }] });
34
- }
36
+ mapChatItems(chatItems) {
37
+ const messages = [];
35
38
  for (const chatItem of chatItems) {
36
39
  switch (chatItem.type) {
37
40
  case 'humanMessage':
38
- geminiInput.push(this.mapHumanMessage(chatItem.humanMessage));
41
+ messages.push(this.mapHumanMessage(chatItem.humanMessage));
39
42
  break;
40
43
  case 'botMessage':
41
- geminiInput.push(this.mapBotMessage(chatItem.botMessage));
44
+ messages.push(this.mapBotMessage(chatItem.botMessage));
42
45
  break;
43
46
  case 'functionCall':
44
- geminiInput.push(...this.mapFunctionCall(chatItem.functionCall));
47
+ messages.push(...this.mapFunctionCall(chatItem.functionCall));
45
48
  break;
46
49
  }
47
50
  }
48
- return geminiInput;
51
+ return messages;
49
52
  }
50
53
  mapHumanMessage(item) {
51
54
  if (!item.text) {
52
55
  throw new Error('User message content is empty');
53
56
  }
54
- return { role: 'user', parts: [{ text: item.text }] };
57
+ return { role: 'user', content: item.text };
55
58
  }
56
59
  mapBotMessage(item) {
57
60
  if (!item.text) {
58
61
  throw new Error('Bot message content is empty');
59
62
  }
60
- return { role: 'model', parts: [{ text: item.text }] };
63
+ return { role: 'assistant', content: item.text };
61
64
  }
62
65
  mapFunctionCall(item) {
63
66
  return [
64
67
  {
65
- role: 'model',
66
- parts: [
68
+ role: 'assistant',
69
+ tool_calls: [
67
70
  {
68
- functionCall: {
71
+ id: item.id,
72
+ type: 'function',
73
+ function: {
69
74
  name: item.name,
70
- args: JSON.parse(item.arguments || '{}'),
75
+ arguments: item.arguments || '{}',
71
76
  },
72
77
  },
73
78
  ],
74
79
  },
75
80
  {
76
- role: 'user',
77
- parts: [
78
- {
79
- functionResponse: {
80
- name: item.name,
81
- response: {
82
- result: item.result || 'No result',
83
- },
84
- },
85
- },
86
- ],
81
+ role: 'tool',
82
+ tool_call_id: item.id,
83
+ content: item.result ?? 'No result',
87
84
  },
88
85
  ];
89
86
  }
90
87
  mapTool(tool) {
91
88
  return {
92
- functionDeclarations: [
93
- {
94
- name: tool.name,
95
- description: tool.description,
96
- parameters: {
97
- type: 'object',
98
- properties: tool.parameters.reduce((prev, param) => ({
99
- ...prev,
100
- [param.name]: { type: param.type, description: param.description },
101
- }), {}),
102
- required: tool.parameters.map((param) => param.name),
103
- },
89
+ type: 'function',
90
+ function: {
91
+ name: tool.name,
92
+ description: tool.description,
93
+ parameters: {
94
+ type: 'object',
95
+ properties: tool.parameters.reduce((prev, param) => ({
96
+ ...prev,
97
+ [param.name]: { type: param.type, description: param.description },
98
+ }), {}),
99
+ required: tool.parameters.map((param) => param.name),
100
+ additionalProperties: false,
104
101
  },
105
- ],
102
+ strict: true,
103
+ },
106
104
  };
107
105
  }
108
106
  mapResponse(response) {
109
107
  let chatItem;
110
- const part = response.response.candidates[0].content.parts[0];
111
- if (part.text) {
112
- chatItem = { type: 'botMessage', botMessage: { text: part.text } };
108
+ const { tool_calls: responseFunctionCall, content: responseText } = response.choices?.[0]?.message ?? {};
109
+ if (responseText) {
110
+ chatItem = { type: 'botMessage', botMessage: { text: responseText } };
113
111
  }
114
- else if (part.functionCall) {
112
+ else if (responseFunctionCall && responseFunctionCall[0]?.type === 'function') {
115
113
  chatItem = {
116
114
  type: 'functionCall',
117
115
  functionCall: {
118
- id: `gemini_${Date.now()}`,
119
- name: part.functionCall.name,
120
- arguments: JSON.stringify(part.functionCall.args || {}),
116
+ id: responseFunctionCall[0].id,
117
+ name: responseFunctionCall[0].function.name,
118
+ arguments: responseFunctionCall[0].function.arguments,
121
119
  },
122
120
  };
123
121
  }
@@ -125,10 +123,10 @@ let GoogleChatAdapter = class GoogleChatAdapter {
125
123
  throw new Error('Not supported Gemini Response');
126
124
  }
127
125
  let usage;
128
- if (response.response.usageMetadata) {
126
+ if (response.usage) {
129
127
  usage = {
130
- inputTokens: response.response.usageMetadata.promptTokenCount || 0,
131
- outputTokens: response.response.usageMetadata.candidatesTokenCount || 0,
128
+ inputTokens: response.usage.prompt_tokens,
129
+ outputTokens: response.usage.completion_tokens,
132
130
  };
133
131
  }
134
132
  else {
@@ -5,6 +5,9 @@ class Job extends Entity {
5
5
  get commandName() {
6
6
  return this.data.commandName;
7
7
  }
8
+ hasFinished() {
9
+ return this.data.successAt != null || this.data.failedAt != null;
10
+ }
8
11
  setAsStarted() {
9
12
  this.data.startedAt = new Date().getTime();
10
13
  }
@@ -328,6 +328,7 @@ interface IJobData extends IEntityData {
328
328
  startedAt?: number;
329
329
  successAt?: number;
330
330
  failedAt?: number;
331
+ retryAt?: number;
331
332
  error?: {
332
333
  message: string;
333
334
  stack?: string;
@@ -336,6 +337,7 @@ interface IJobData extends IEntityData {
336
337
  }
337
338
  declare class Job extends Entity<IJobData> {
338
339
  get commandName(): string;
340
+ hasFinished(): boolean;
339
341
  setAsStarted(): void;
340
342
  setAsSuccess(): void;
341
343
  setAsFailed(error: Error): void;
@@ -981,6 +983,7 @@ declare function apiKeyGuard(): (target: object, propertyKey: string | symbol) =
981
983
  interface IApiKeyData<A extends IStorableData> extends IEntityData {
982
984
  passwordHash?: string;
983
985
  authInfo: A;
986
+ name: string;
984
987
  }
985
988
  declare class ApiKey<A extends IStorableData> extends Entity<IApiKeyData<A>> {
986
989
  get authInfo(): A;
@@ -1002,12 +1005,29 @@ interface IApiKeyRepository<A extends IStorableData> {
1002
1005
  find(id: string): Promise<ApiKey<A> | null>;
1003
1006
  findOrThrow(id: string): Promise<ApiKey<A>>;
1004
1007
  create(item: ApiKey<A>): Promise<void>;
1008
+ generate(req: IGenerateApiKeyReq<A>): Promise<IGenerateApiKeyRes>;
1009
+ findAuthInfo(secret: string): Promise<A>;
1010
+ }
1011
+ interface IGenerateApiKeyReq<A extends IStorableData> extends IStorableData {
1012
+ name: string;
1013
+ authInfo: A;
1014
+ }
1015
+ interface IGenerateApiKeyRes {
1016
+ id: string;
1017
+ secret: string;
1005
1018
  }
1006
1019
 
1007
1020
  declare class ApiKeyRepository<A extends IStorableData> implements IApiKeyRepository<A> {
1021
+ findAuthInfo(secret: string): Promise<A>;
1008
1022
  find(id: string): Promise<ApiKey<A> | null>;
1009
1023
  findOrThrow(id: string): Promise<ApiKey<A>>;
1010
1024
  create(item: ApiKey<A>): Promise<void>;
1025
+ generate(req: IGenerateApiKeyReq<A>): Promise<IGenerateApiKeyRes>;
1026
+ static generate(repository: ApiKeyRepository<any>, req: IGenerateApiKeyReq<any>): Promise<{
1027
+ id: string;
1028
+ secret: string;
1029
+ }>;
1030
+ static findAuthInfo<A extends IStorableData>(repository: ApiKeyRepository<A>, secret: string): Promise<A>;
1011
1031
  }
1012
1032
 
1013
1033
  declare class ApiKeyGuardMiddleware implements IMiddleware {
@@ -1019,6 +1039,20 @@ declare class ApiKeyGuardMiddleware implements IMiddleware {
1019
1039
 
1020
1040
  declare class PgApiKeyRepository<A extends IStorableData> extends PgCrudRepository<ApiKey<A>> implements IApiKeyRepository<A> {
1021
1041
  constructor(pool: Pool);
1042
+ findAuthInfo(secret: string): Promise<A>;
1043
+ generate(req: IGenerateApiKeyReq<A>): Promise<IGenerateApiKeyRes>;
1044
+ }
1045
+
1046
+ declare class RemoteApiKeyRepository<A extends IStorableData> implements IApiKeyRepository<A> {
1047
+ private fetcher;
1048
+ private cacheSeconds;
1049
+ private cache;
1050
+ constructor(fetcher: (id: string) => Promise<ApiKey<A> | null>, cacheSeconds: number);
1051
+ find(id: string): Promise<ApiKey<A> | null>;
1052
+ findOrThrow(id: string): Promise<ApiKey<A>>;
1053
+ findAuthInfo(secret: string): Promise<A>;
1054
+ create(item: ApiKey<A>): Promise<void>;
1055
+ generate(req: IGenerateApiKeyReq<A>): Promise<IGenerateApiKeyRes>;
1022
1056
  }
1023
1057
 
1024
1058
  declare function jwtConnectionGuard(): (target: object, propertyKey: string | symbol) => void;
@@ -1142,7 +1176,7 @@ declare class DeepSeekChatAdapter implements IChatAdapter {
1142
1176
 
1143
1177
  declare class GoogleChatAdapter implements IChatAdapter {
1144
1178
  private env;
1145
- private genai;
1179
+ private openai;
1146
1180
  private logger;
1147
1181
  constructor(env: Env);
1148
1182
  nextItem(req: IChatAdapterNextItemReq): Promise<IChatAdapterNextItemRes>;
@@ -1555,4 +1589,4 @@ declare function HtmlModule(options: IHtmlModuleOptions): {
1555
1589
  new (): {};
1556
1590
  };
1557
1591
 
1558
- 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, inject, injectable, isArray, isBoolean, isDate, 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, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsString, validateMax, validateMin, validateModel, whatsApp };
1592
+ 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 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 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, apiKeyGuard, chatBot, chatController, chatItemTypeOptions, cmd, command, commandHandler, connectionMiddleware, container, inject, injectable, isArray, isBoolean, isDate, 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, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsString, validateMax, validateMin, validateModel, whatsApp };
package/dist/src/index.js CHANGED
@@ -94,6 +94,7 @@ export { ApiKey } from './addon/auth/api-key/ApiKey.js';
94
94
  export { ApiKeyGuardMiddleware } from './addon/auth/api-key/ApiKeyGuardMiddleware.js';
95
95
  export { ApiKeyRepository } from './addon/auth/api-key/ApiKeyRepository.js';
96
96
  export { PgApiKeyRepository } from './addon/auth/api-key/PgApiKeyRepository.js';
97
+ export { RemoteApiKeyRepository } from './addon/auth/api-key/RemoteApiKeyRepository.js';
97
98
  export { jwtConnectionGuard } from './addon/auth/jwt/@jwtConnectionGuard.js';
98
99
  export { jwtGuard } from './addon/auth/jwt/@jwtGuard.js';
99
100
  export { Jwt } from './addon/auth/jwt/Jwt.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wabot-dev/framework",
3
- "version": "0.1.0-beta.55",
3
+ "version": "0.1.0-beta.57",
4
4
  "description": "Framework for IA Chat Bots",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",