@wabot-dev/framework 0.9.0 → 0.9.2

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.
Files changed (56) hide show
  1. package/dist/src/addon/async/in-memory/InMemoryCronJobRepository.js +45 -0
  2. package/dist/src/addon/async/in-memory/InMemoryJobRepository.js +75 -0
  3. package/dist/src/addon/async/in-memory/index.js +2 -0
  4. package/dist/src/addon/async/pg/PgJobRepository.js +1 -0
  5. package/dist/src/addon/async/pg/PgTransactionAdapter.js +25 -0
  6. package/dist/src/addon/async/pg/index.js +3 -0
  7. package/dist/src/addon/chat-bot/{ram/RamChatMemory.js → in-memory/InMemoryChatMemory.js} +2 -2
  8. package/dist/src/addon/chat-bot/{ram/RamChatRepository.js → in-memory/InMemoryChatRepository.js} +6 -6
  9. package/dist/src/addon/chat-bot/in-memory/index.js +2 -0
  10. package/dist/src/addon/chat-bot/pg/index.js +2 -0
  11. package/dist/src/addon/chat-controller/socket/@socket.js +3 -1
  12. package/dist/src/addon/chat-controller/socket/SocketChannelConfig.js +4 -4
  13. package/dist/src/addon/chat-controller/whatsapp/WhatsAppSender.js +2 -72
  14. package/dist/src/addon/chat-controller/whatsapp/{WhatsAppReceiver.js → cloud-api/WhatsAppApiReceiver.js} +2 -2
  15. package/dist/src/addon/chat-controller/whatsapp/cloud-api/WhatsAppApiSender.js +67 -0
  16. package/dist/src/addon/chat-controller/whatsapp/cloud-api/WhatsAppReceiverByCloudApi.js +5 -7
  17. package/dist/src/addon/chat-controller/whatsapp/wasender/@wasender.js +23 -0
  18. package/dist/src/addon/chat-controller/{wasender/WhatsAppByWasenderChannel.js → whatsapp/wasender/WasenderChannel.js} +20 -20
  19. package/dist/src/addon/chat-controller/{wasender/WhatsAppByWasenderChannelConfig.js → whatsapp/wasender/WasenderChannelConfig.js} +3 -3
  20. package/dist/src/addon/chat-controller/whatsapp/wasender/WasenderChannelName.js +3 -0
  21. package/dist/src/addon/chat-controller/{wasender/WhatsAppReceiverByWasender.js → whatsapp/wasender/WasenderReceiver.js} +7 -7
  22. package/dist/src/addon/chat-controller/{wasender/WhatsAppSenderByWasender.js → whatsapp/wasender/WasenderSender.js} +8 -5
  23. package/dist/src/addon/chat-controller/{wasender → whatsapp/wasender}/WasenderWebhookController.js +4 -4
  24. package/dist/src/addon/lock/InMemoryLockKey.js +45 -0
  25. package/dist/src/addon/lock/InMemoryLocker.js +15 -0
  26. package/dist/src/addon/lock/index.js +2 -0
  27. package/dist/src/core/config/resolver.js +19 -1
  28. package/dist/src/feature/async/{@cron.js → @cronHandler.js} +2 -2
  29. package/dist/src/feature/async/@transaction.js +22 -0
  30. package/dist/src/feature/async/AsyncMetadataStore.js +6 -0
  31. package/dist/src/feature/async/TransactionMetadataStore.js +28 -0
  32. package/dist/src/feature/chat-controller/metadata/ControllerMetadataStore.js +3 -0
  33. package/dist/src/feature/pg/index.js +13 -0
  34. package/dist/src/feature/project-runner/ProjectRunner.js +253 -0
  35. package/dist/src/feature/rest-controller/metadata/RestControllerMetadataStore.js +3 -0
  36. package/dist/src/feature/socket-controller/metadata/SocketControllerMetadataStore.js +3 -0
  37. package/dist/src/index.d.ts +195 -261
  38. package/dist/src/index.js +23 -29
  39. package/package.json +6 -6
  40. package/dist/src/addon/chat-controller/wasender/@whatsAppByWasender.js +0 -20
  41. package/dist/src/addon/chat-controller/wasender/whatsAppByWasenderChannelName.js +0 -3
  42. package/dist/src/addon/chat-controller/whatsapp/@whatsApp.js +0 -20
  43. package/dist/src/addon/chat-controller/whatsapp/EnvWhatsAppRepository.js +0 -49
  44. package/dist/src/addon/chat-controller/whatsapp/PgWhatsAppRepository.js +0 -48
  45. package/dist/src/addon/chat-controller/whatsapp/WhatsApp.js +0 -30
  46. package/dist/src/addon/chat-controller/whatsapp/WhatsAppChannel.js +0 -58
  47. package/dist/src/addon/chat-controller/whatsapp/WhatsAppChannelConfig.js +0 -8
  48. package/dist/src/addon/chat-controller/whatsapp/WhatsAppRepository.js +0 -10
  49. package/dist/src/addon/chat-controller/whatsapp/cloud-api/WhatsAppSenderByCloudApi.js +0 -133
  50. package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppProxyContracts.js +0 -5
  51. package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppReceiverByWabotProxy.js +0 -67
  52. package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppSenderByWabotProxy.js +0 -63
  53. package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppWabotProxyConnection.js +0 -45
  54. package/dist/src/core/config/decorators.js +0 -22
  55. /package/dist/src/addon/chat-controller/whatsapp/{whatsAppChannelName.js → cloud-api/whatsAppChannelName.js} +0 -0
  56. /package/dist/src/addon/chat-controller/{wasender → whatsapp/wasender}/extractNumberFromWasenderKey.js +0 -0
@@ -11,7 +11,6 @@ import { Pool, PoolClient } from 'pg';
11
11
  import { AsyncLocalStorage } from 'node:async_hooks';
12
12
  import { Server as Server$1, Socket } from 'socket.io';
13
13
  import { Algorithm } from 'jsonwebtoken';
14
- import { Socket as Socket$1 } from 'socket.io-client';
15
14
  import { Wasender } from 'wasenderapi';
16
15
 
17
16
  type IStorablePrimitive = null | number | string | boolean | undefined;
@@ -32,21 +31,27 @@ declare class Auth<D> {
32
31
  }
33
32
 
34
33
  type ConfigReferenceType = 'string' | 'number' | 'boolean' | 'object' | 'string-array' | 'number-array' | 'boolean-array';
35
- interface ConfigReference {
34
+ interface ConfigReference<TResolved = unknown> {
36
35
  type: ConfigReferenceType;
37
36
  path: string;
38
37
  default?: string;
39
38
  __isConfigReference: true;
39
+ __resolvedType?: TResolved;
40
40
  }
41
41
 
42
- declare function str(strings: TemplateStringsArray): ConfigReference;
43
- declare function num(strings: TemplateStringsArray): ConfigReference;
44
- declare function bool(strings: TemplateStringsArray): ConfigReference;
45
- declare function obj(strings: TemplateStringsArray): ConfigReference;
46
- declare function strArr(strings: TemplateStringsArray): ConfigReference;
47
- declare function numArr(strings: TemplateStringsArray): ConfigReference;
48
- declare function boolArr(strings: TemplateStringsArray): ConfigReference;
42
+ declare function str(strings: TemplateStringsArray): ConfigReference<string>;
43
+ declare function num(strings: TemplateStringsArray): ConfigReference<number>;
44
+ declare function bool(strings: TemplateStringsArray): ConfigReference<boolean>;
45
+ declare function obj<T = unknown>(strings: TemplateStringsArray): ConfigReference<T>;
46
+ declare function strArr(strings: TemplateStringsArray): ConfigReference<string[]>;
47
+ declare function numArr(strings: TemplateStringsArray): ConfigReference<number[]>;
48
+ declare function boolArr(strings: TemplateStringsArray): ConfigReference<boolean[]>;
49
49
 
50
+ type ResolveConfigValue<V> = V extends ConfigReference<infer R> ? R : V;
51
+ type ResolvedConfig<T> = {
52
+ [K in keyof T]: ResolveConfigValue<T[K]>;
53
+ };
54
+ declare function resolveConfigReferences<T extends Record<string, any>>(config: T): ResolvedConfig<T>;
50
55
  declare class ConfigResolver {
51
56
  static resolve(reference: ConfigReference): unknown;
52
57
  private static loadFromEnv;
@@ -55,8 +60,6 @@ declare class ConfigResolver {
55
60
  private static parseArrayItems;
56
61
  }
57
62
 
58
- declare function resolveConfigReferences<T extends Record<string, any>>(config: T): T;
59
-
60
63
  interface ILockKey {
61
64
  run<T>(fn: () => Promise<T>): Promise<T>;
62
65
  tryRun<T>(fn: () => Promise<T>): Promise<T | undefined>;
@@ -465,7 +468,9 @@ interface ICronConfig {
465
468
  cron: string;
466
469
  disabled?: boolean;
467
470
  }
468
- declare function cron(config: ICronConfig): (target: IConstructor<ICronHandler>) => void;
471
+ declare function cronHandler(config: ICronConfig): (target: IConstructor<ICronHandler>) => void;
472
+
473
+ declare function transaction(dbNames?: readonly string[]): <This, A extends unknown[], R>(_target: object, _propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<(this: This, ...args: A) => Promise<R>>) => TypedPropertyDescriptor<(this: This, ...args: A) => Promise<R>>;
469
474
 
470
475
  interface ICronJobScheduleConfig {
471
476
  name: string;
@@ -494,6 +499,8 @@ declare class AsyncMetadataStore {
494
499
  requireCommandNameForHandler(handlerConstructor: IConstructor<ICommandHandler<any>>): string;
495
500
  getCommandName(command: IConstructor<any>): string | null;
496
501
  getCommandForCommandName(commandName: string): IConstructor<any> | null;
502
+ getAllCommandHandlers(): IConstructor<ICommandHandler<any>>[];
503
+ getAllCronHandlers(): IConstructor<ICronHandler>[];
497
504
  }
498
505
 
499
506
  interface IJobData extends IEntityData {
@@ -661,12 +668,24 @@ declare class CronJobRepository implements ICronJobRepository {
661
668
  findOrThrow(id: string): Promise<CronJob>;
662
669
  }
663
670
 
671
+ interface ITransactionAdapter {
672
+ run<T>(fn: () => Promise<T>): Promise<T>;
673
+ }
674
+
664
675
  declare function runCommandHandlers(handlers: IConstructor<ICommandHandler<any>>[]): void;
665
676
  declare function stopCommandHandlers(handlers: IConstructor<ICommandHandler<any>>[]): void;
666
677
 
667
678
  declare function runCronHandlers(handlers: IConstructor<ICronHandler>[]): void;
668
679
  declare function stopCronHandlers(handlers: IConstructor<ICronHandler>[]): void;
669
680
 
681
+ declare class TransactionMetadataStore {
682
+ private adapters;
683
+ registerAdapter(dbName: string, adapter: ITransactionAdapter): void;
684
+ requireAdapter(dbName: string): ITransactionAdapter;
685
+ requireAdapters(dbNames: readonly string[]): ITransactionAdapter[];
686
+ getAllAdapters(): ITransactionAdapter[];
687
+ }
688
+
670
689
  interface IChatConnection {
671
690
  chatType: 'GROUP' | 'PRIVATE';
672
691
  channelName: string;
@@ -1093,6 +1112,32 @@ declare function runChatAdapters(adapters: IConstructor<IChatAdapter>[]): void;
1093
1112
 
1094
1113
  declare function safeJsonParse<T = unknown>(json: string | undefined | null, context?: string): T;
1095
1114
 
1115
+ interface IProjectRunnerConfig {
1116
+ directories?: string[];
1117
+ connectionString?: string;
1118
+ chatAdapters?: IConstructor<IChatAdapter>[];
1119
+ }
1120
+ declare class ProjectRunner {
1121
+ private directories;
1122
+ private chatAdapters;
1123
+ private connectionString;
1124
+ private isPg;
1125
+ private pool;
1126
+ constructor(config?: IProjectRunnerConfig);
1127
+ run(): Promise<void>;
1128
+ private resolveConnectionString;
1129
+ private initPool;
1130
+ private scanDirectories;
1131
+ private importFiles;
1132
+ private discoverComponents;
1133
+ private registerAdapters;
1134
+ private registerMemoryAdapters;
1135
+ private registerPostgresAdapters;
1136
+ private startComponents;
1137
+ private resolveDefaultChatAdapters;
1138
+ }
1139
+ declare function run(config?: IProjectRunnerConfig): Promise<void>;
1140
+
1096
1141
  interface IchatControllerConfig {
1097
1142
  }
1098
1143
 
@@ -1130,6 +1175,7 @@ declare class ControllerMetadataStore {
1130
1175
  private chatControllers;
1131
1176
  saveChannelMetadata(channelMetadata: IChannelMetadata): void;
1132
1177
  saveChatControllerMetadata(controllerMetadata: IChatControllerMetadata): void;
1178
+ getAllChatControllerConstructors(): Function[];
1133
1179
  getChatControllerMetadata(controllerConstructor: Function): {
1134
1180
  config: IChatControllerMetadata;
1135
1181
  channels: IChannelMetadata[];
@@ -1388,6 +1434,7 @@ declare class RestControllerMetadataStore {
1388
1434
  saveControllerMetadata(controllerMetadata: IRestControllerMetadata): void;
1389
1435
  saveEndPointMetadata(endPointMetadata: IEndPointMetadata): void;
1390
1436
  saveMiddlewareMetadata(middlewareMetadata: IMiddlewareMetadata): void;
1437
+ getAllRestControllerConstructors(): IConstructor<any>[];
1391
1438
  getControllerEndPointsInfo(controllerConstructor: IConstructor<any>): {
1392
1439
  controllerConstructor: IConstructor<any>;
1393
1440
  middlewares: IMiddlewareMetadata[];
@@ -1466,6 +1513,7 @@ declare class SocketControllerMetadataStore {
1466
1513
  saveControllerMetadata(controllerMetadata: ISocketControllerMetadata): void;
1467
1514
  saveSocketEventMetadata(socketEventMetadata: ISocketEventMetadata): void;
1468
1515
  saveHandshakeMiddlewareMetadata(handshakeMetadata: IHandshakeMiddlewareMetadata): void;
1516
+ getAllSocketControllerConstructors(): IConstructor<any>[];
1469
1517
  getSocketControllerInfo(controllerConstructor: IConstructor<any>): {
1470
1518
  controller: ISocketControllerMetadata;
1471
1519
  events: Map<string, ISocketEventMetadata>;
@@ -1475,6 +1523,12 @@ declare class SocketControllerMetadataStore {
1475
1523
 
1476
1524
  declare function runSocketControllers(controllers: IConstructor<any>[]): void;
1477
1525
 
1526
+ declare class PgCronJobRepository extends PgCrudRepository<CronJob> implements ICronJobRepository {
1527
+ constructor(pool: Pool);
1528
+ findDue(date?: Date): Promise<CronJob[]>;
1529
+ findByName(name: string): Promise<CronJob | null>;
1530
+ }
1531
+
1478
1532
  declare class PgJobRepository extends PgCrudRepository<Job> implements IJobRepository {
1479
1533
  constructor(pool: Pool);
1480
1534
  findPendingForRunFrom(date: Date, limit: number): Promise<Job[]>;
@@ -1482,9 +1536,32 @@ declare class PgJobRepository extends PgCrudRepository<Job> implements IJobRepos
1482
1536
  countRunningByCommand(commandName: string): Promise<number>;
1483
1537
  }
1484
1538
 
1485
- declare class PgCronJobRepository extends PgCrudRepository<CronJob> implements ICronJobRepository {
1539
+ declare class PgTransactionAdapter implements ITransactionAdapter {
1540
+ private pool;
1486
1541
  constructor(pool: Pool);
1542
+ run<T>(fn: () => Promise<T>): Promise<T>;
1543
+ }
1544
+
1545
+ declare class InMemoryJobRepository implements IJobRepository {
1546
+ private items;
1547
+ find(id: string): Promise<Job | null>;
1548
+ findOrThrow(id: string): Promise<Job>;
1549
+ findByIds(ids: string[]): Promise<Job[]>;
1550
+ findAll(): Promise<Job[]>;
1551
+ create(item: Job): Promise<void>;
1552
+ update(item: Job): Promise<void>;
1553
+ delete(item: Job): Promise<void>;
1554
+ findPendingForRunFrom(date: Date, limit: number): Promise<Job[]>;
1555
+ findRunningJobs(): Promise<Job[]>;
1556
+ countRunningByCommand(commandName: string): Promise<number>;
1557
+ }
1558
+
1559
+ declare class InMemoryCronJobRepository implements ICronJobRepository {
1560
+ private items;
1561
+ create(cronJob: CronJob): Promise<void>;
1487
1562
  findDue(date?: Date): Promise<CronJob[]>;
1563
+ findOrThrow(id: string): Promise<CronJob>;
1564
+ update(cronJob: CronJob): Promise<void>;
1488
1565
  findByName(name: string): Promise<CronJob | null>;
1489
1566
  }
1490
1567
 
@@ -1767,14 +1844,14 @@ declare class PgChatMemory extends PgCrudRepository<ChatItem> implements IChatMe
1767
1844
  findLastItems(count: number): Promise<ChatItem[]>;
1768
1845
  }
1769
1846
 
1770
- declare class RamChatMemory implements IChatMemory {
1847
+ declare class InMemoryChatMemory implements IChatMemory {
1771
1848
  private memory;
1772
1849
  findLastItems(count: number): Promise<ChatItem[]>;
1773
1850
  create(item: ChatItem): Promise<void>;
1774
1851
  clearMemory(): Promise<void>;
1775
1852
  }
1776
1853
 
1777
- declare class RamChatRepository implements IChatRepository {
1854
+ declare class InMemoryChatRepository implements IChatRepository {
1778
1855
  private items;
1779
1856
  private memories;
1780
1857
  update(chat: Chat): Promise<void>;
@@ -1821,17 +1898,11 @@ declare function writeJsonToFile<T>(filename: string, data: T): void;
1821
1898
  declare function readJsonFromFile<T>(filename: string): T | null;
1822
1899
 
1823
1900
  interface ISocketChannelConfig {
1824
- namespace: string;
1901
+ namespace: string | ConfigReference<string>;
1825
1902
  handshakeMidlewares?: IConstructor<IHandshakeMiddleware>[];
1826
1903
  }
1827
1904
 
1828
- declare class SocketChannelConfig implements ISocketChannelConfig {
1829
- namespace: string;
1830
- handshakeMidlewares?: IConstructor<IHandshakeMiddleware>[] | undefined;
1831
- constructor(namespace: string, handshakeMidlewares?: IConstructor<IHandshakeMiddleware>[] | undefined);
1832
- }
1833
-
1834
- declare function socket(config: SocketChannelConfig): (target: object, propertyKey: string | symbol) => void;
1905
+ declare function socket(config: ISocketChannelConfig): (target: object, propertyKey: string | symbol) => void;
1835
1906
 
1836
1907
  declare const socketChannelName: "SocketChannel";
1837
1908
 
@@ -1844,6 +1915,15 @@ interface ISocketChannelMessage extends ISocketReceivedMessage {
1844
1915
  injectInstances?: [any, any][];
1845
1916
  }
1846
1917
 
1918
+ declare class SocketChannelConfig {
1919
+ namespace: string;
1920
+ handshakeMidlewares?: IConstructor<IHandshakeMiddleware>[];
1921
+ constructor(config: {
1922
+ namespace: string;
1923
+ handshakeMidlewares?: IConstructor<IHandshakeMiddleware>[];
1924
+ });
1925
+ }
1926
+
1847
1927
  declare class SocketChannelMessageFile {
1848
1928
  id: string;
1849
1929
  mimeType: string;
@@ -1910,99 +1990,6 @@ declare class TelegramChannel implements IChatChannel {
1910
1990
  disconnect(): void;
1911
1991
  }
1912
1992
 
1913
- interface IWhatsappChannelConfig {
1914
- number: string;
1915
- proxy?: string;
1916
- }
1917
- declare class WhatsappChannelConfig implements IWhatsappChannelConfig {
1918
- number: string;
1919
- constructor(number: string);
1920
- }
1921
-
1922
- declare function whatsApp(config: string | IWhatsappChannelConfig): (target: object, propertyKey: string | symbol) => void;
1923
-
1924
- interface IWhatsAppBusinessNumber {
1925
- id: string;
1926
- number: string;
1927
- }
1928
- interface IWhatsAppBusinessAccount {
1929
- id: string;
1930
- }
1931
- interface IWhatsAppData extends IEntityData {
1932
- slug: string;
1933
- verifyToken: string;
1934
- appSecret: string;
1935
- accessToken: string;
1936
- businessAccount: IWhatsAppBusinessAccount;
1937
- businessNumbers: IWhatsAppBusinessNumber[];
1938
- }
1939
- declare class WhatsApp extends Entity<IWhatsAppData> {
1940
- getVerifyToken(): string;
1941
- getSlug(): string;
1942
- getBusinessAccount(): IWhatsAppBusinessAccount;
1943
- getAppSecret(): string;
1944
- getBusinessNumbers(): {
1945
- id: string;
1946
- number: string;
1947
- }[];
1948
- getAccessToken(): string;
1949
- hasBusinessNumber(number: string): boolean;
1950
- getBussinessNumber(number: string): IWhatsAppBusinessNumber | null;
1951
- }
1952
-
1953
- interface IWhatsAppRepository {
1954
- findBySlug(slug: string): Promise<WhatsApp | null>;
1955
- findByBusinessNumber(number: string): Promise<WhatsApp | null>;
1956
- }
1957
-
1958
- declare class EnvWhatsAppRepository implements IWhatsAppRepository {
1959
- private env;
1960
- constructor(env: Env);
1961
- findBySlug(slug: string): Promise<WhatsApp | null>;
1962
- findByBusinessNumber(number: string): Promise<WhatsApp | null>;
1963
- private getFromEnvVars;
1964
- }
1965
-
1966
- declare class PgWhatsAppRepository extends PgCrudRepository<WhatsApp> implements IWhatsAppRepository {
1967
- constructor(pool: Pool);
1968
- findBySlug(slug: string): Promise<WhatsApp | null>;
1969
- findByBusinessNumber(number: string): Promise<WhatsApp | null>;
1970
- }
1971
-
1972
- type IWhatsAppMessageListener = (message: Omit<IChannelMessage, 'reply'>) => Promise<void>;
1973
- interface IListenWhatsAppMessageRequest {
1974
- to: string;
1975
- listener: IWhatsAppMessageListener;
1976
- }
1977
- declare class WhatsAppReceiver {
1978
- connect(): Promise<void>;
1979
- disconnect(): void;
1980
- listenMessage(request: IListenWhatsAppMessageRequest): void;
1981
- }
1982
-
1983
- type IWhatsAppCloudTemplateParameter = {
1984
- type: 'text';
1985
- text: string;
1986
- parameter_name?: string;
1987
- } | {
1988
- type: 'currency';
1989
- currency: {
1990
- fallback_value: string;
1991
- code: string;
1992
- amount_1000: number;
1993
- };
1994
- } | {
1995
- type: 'date_time';
1996
- date_time: {
1997
- fallback_value: string;
1998
- };
1999
- };
2000
- interface IWhatsAppCloudTemplateMessage {
2001
- templateName: string;
2002
- languageCode: string;
2003
- parameters: IWhatsAppCloudTemplateParameter[];
2004
- }
2005
-
2006
1993
  interface IWhatsAppCloudTemplateResponse {
2007
1994
  data: IWhatsAppCloudTemplate[];
2008
1995
  paging: IWhatsAppCloudApiPaging;
@@ -2029,66 +2016,6 @@ interface IWhatsAppCloudApiCursors {
2029
2016
  after: string;
2030
2017
  }
2031
2018
 
2032
- declare class WhatsAppRepository implements IWhatsAppRepository {
2033
- findBySlug(slug: string): Promise<WhatsApp | null>;
2034
- findByBusinessNumber(number: string): Promise<WhatsApp | null>;
2035
- }
2036
-
2037
- interface ISendWhatsAppRequest {
2038
- from: string;
2039
- to: string;
2040
- message: IChatMessage;
2041
- }
2042
- interface ISendWhatsAppTemplateRequest {
2043
- from: string;
2044
- to: string;
2045
- templateMessage: IWhatsAppCloudTemplateMessage;
2046
- senderName: string;
2047
- }
2048
- interface IGetWhatsAppTemplateRequest {
2049
- from: string;
2050
- templateName: string;
2051
- languageCode: string;
2052
- }
2053
- interface IWhatsAppSenderOptions {
2054
- writeChatMemory?: boolean;
2055
- }
2056
- declare class WhatsAppSender {
2057
- protected chatRepository: ChatRepository;
2058
- protected chatResolver: ChatResolver;
2059
- protected whatsAppRepository: WhatsAppRepository;
2060
- constructor(chatRepository: ChatRepository, chatResolver: ChatResolver, whatsAppRepository: WhatsAppRepository);
2061
- sendWhatsApp(request: ISendWhatsAppRequest, options?: IWhatsAppSenderOptions): Promise<void>;
2062
- sendWhatsAppTemplate(request: ISendWhatsAppTemplateRequest, options?: IWhatsAppSenderOptions): Promise<void>;
2063
- protected getWhatsAppTemplate(request: IGetWhatsAppTemplateRequest): Promise<IWhatsAppCloudTemplate | null>;
2064
- protected mapTemplateToChatMessage(request: ISendWhatsAppTemplateRequest): Promise<IChatMessage>;
2065
- protected writePrivateChatMemory(message: IChatMessage, to: string): Promise<void>;
2066
- protected replaceTemplateParameters(template: string, data: IWhatsAppCloudTemplateParameter[]): string;
2067
- }
2068
-
2069
- declare const whatsAppChannelName: "WhatsAppChannel";
2070
-
2071
- interface IWhatsAppReceivedMessage extends IReceivedMessage {
2072
- channel: typeof whatsAppChannelName;
2073
- }
2074
-
2075
- interface IWhatsAppChannelMessage extends IWhatsAppReceivedMessage {
2076
- chatConnection: IChatConnection;
2077
- injectInstances?: [any, any][];
2078
- }
2079
-
2080
- declare class WhatsAppChannel implements IChatChannel {
2081
- private config;
2082
- private sender;
2083
- private receiver;
2084
- static channelName: "WhatsAppChannel";
2085
- private logger;
2086
- constructor(config: WhatsappChannelConfig, sender: WhatsAppSender, receiver: WhatsAppReceiver);
2087
- listen(callback: (message: IWhatsAppChannelMessage) => Promise<void>): void;
2088
- connect(): void;
2089
- disconnect(): void;
2090
- }
2091
-
2092
2019
  interface IWhatsAppCloudWebhookPayload {
2093
2020
  object: 'whatsapp_business_account';
2094
2021
  entry: IWhatsAppCloudEntry[];
@@ -2141,95 +2068,84 @@ interface IWhatsAppCloudAudioMessage extends IWhatsAppCloudBaseMessage {
2141
2068
  };
2142
2069
  }
2143
2070
 
2144
- declare class WhatsAppReceiverByCloudApi extends WhatsAppReceiver {
2071
+ type IWhatsAppMessageListener = (message: Omit<IChannelMessage, 'reply'>) => Promise<void>;
2072
+ interface IListenWhatsAppMessageRequest {
2073
+ to: string;
2074
+ listener: IWhatsAppMessageListener;
2075
+ }
2076
+ declare class WhatsAppApiReceiver {
2077
+ connect(): Promise<void>;
2078
+ disconnect(): void;
2079
+ listenMessage(request: IListenWhatsAppMessageRequest): void;
2080
+ }
2081
+
2082
+ declare class WhatsAppReceiverByCloudApi extends WhatsAppApiReceiver {
2145
2083
  private expressProvider;
2146
- private whatsAppRepository;
2147
2084
  private listeners;
2148
2085
  private expressApp;
2149
2086
  private logger;
2150
2087
  private webhookPath;
2151
- constructor(expressProvider: ExpressProvider, whatsAppRepository: WhatsAppRepository);
2088
+ constructor(expressProvider: ExpressProvider);
2152
2089
  connect(): Promise<void>;
2153
2090
  listenMessage(request: IListenWhatsAppMessageRequest): void;
2154
2091
  protected handlePayload(payload: IWhatsAppCloudWebhookPayload): Promise<void>;
2155
2092
  private emmitMessage;
2156
2093
  }
2157
2094
 
2158
- declare class WhatsAppSenderByCloudApi extends WhatsAppSender {
2159
- private logger;
2160
- constructor(chatRepository: ChatRepository, chatResolver: ChatResolver, whatsAppRepository: WhatsAppRepository);
2161
- sendWhatsApp(request: ISendWhatsAppRequest, options?: IWhatsAppSenderOptions): Promise<void>;
2162
- sendWhatsAppTemplate(request: ISendWhatsAppTemplateRequest, options?: IWhatsAppSenderOptions): Promise<void>;
2163
- protected getWhatsAppTemplate(request: IGetWhatsAppTemplateRequest): Promise<IWhatsAppCloudTemplate | null>;
2164
- }
2165
-
2166
- interface IWhatsAppProxyMessageContent {
2095
+ type IWhatsAppTemplateParameter = {
2096
+ type: 'text';
2167
2097
  text: string;
2098
+ parameter_name?: string;
2099
+ } | {
2100
+ type: 'currency';
2101
+ currency: {
2102
+ fallback_value: string;
2103
+ code: string;
2104
+ amount_1000: number;
2105
+ };
2106
+ } | {
2107
+ type: 'date_time';
2108
+ date_time: {
2109
+ fallback_value: string;
2110
+ };
2111
+ };
2112
+ interface IWhatsAppTemplateData {
2113
+ templateName: string;
2114
+ languageCode: string;
2115
+ parameters: IWhatsAppTemplateParameter[];
2168
2116
  }
2169
-
2170
- interface IWhatsAppProxyMessage {
2117
+ interface ISendWhatsAppMessageReq {
2171
2118
  from: string;
2172
2119
  to: string;
2173
- senderName?: string;
2174
- content: IWhatsAppProxyMessageContent;
2175
- }
2176
-
2177
- declare const WHATSAPP_PROXY_SEND_MESSAGE_EVENT: "sendMessage";
2178
- interface IWhatsAppProxySendMessageEventReq {
2179
- event: typeof WHATSAPP_PROXY_SEND_MESSAGE_EVENT;
2180
- data: IWhatsAppProxyMessage;
2181
- }
2182
- declare const WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT: "listenMessage";
2183
- interface IWhatsAppProxyListenMessageEventReq {
2184
- event: typeof WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT;
2185
- data: IWhatsAppProxyListenMessageEventData;
2120
+ message: IChatMessage;
2186
2121
  }
2187
- interface IWhatsAppProxyListenMessageEventData {
2188
- from?: string[];
2122
+ interface ISendWhatsAppTemplateReq {
2123
+ from: string;
2189
2124
  to: string;
2125
+ templateData: IWhatsAppTemplateData;
2126
+ senderName: string;
2190
2127
  }
2191
- declare const WHATSAPP_MESSAGE_EVENT: "message";
2192
- interface IWhatsAppProxyMessageEventReq {
2193
- event: typeof WHATSAPP_MESSAGE_EVENT;
2194
- data: IWhatsAppProxyMessage;
2195
- }
2196
-
2197
- declare class WhatsAppWabotProxyConnection {
2198
- private baseUrl;
2199
- private socket;
2200
- private apiKey;
2201
- private logger;
2202
- constructor(env: Env);
2203
- getSocket(): Promise<Socket$1>;
2204
- }
2205
-
2206
- declare class WhatsAppReceiverByWabotProxy extends WhatsAppReceiver {
2207
- private connection;
2208
- private loger;
2209
- constructor(connection: WhatsAppWabotProxyConnection);
2210
- connect(): Promise<void>;
2211
- listenMessage(request: IListenWhatsAppMessageRequest): void;
2128
+ interface IWhatsAppSender {
2129
+ sendMessage(request: ISendWhatsAppMessageReq): Promise<void>;
2130
+ sendTemplate(request: ISendWhatsAppTemplateReq): Promise<void>;
2212
2131
  }
2213
2132
 
2214
- declare class WhatsAppSenderByWabotProxy extends WhatsAppSender {
2215
- private wabotDevConnection;
2216
- private logger;
2217
- constructor(wabotDevConnection: WhatsAppWabotProxyConnection, chatRepository: ChatRepository, chatResolver: ChatResolver, whatsAppRepository: WhatsAppRepository);
2218
- sendWhatsApp(request: ISendWhatsAppRequest, options?: IWhatsAppSenderOptions): Promise<void>;
2133
+ declare class WhatsAppApiSender implements IWhatsAppSender {
2134
+ private accessToken;
2135
+ private businessNumberId;
2136
+ constructor(accessToken: string, businessNumberId: string);
2137
+ sendMessage(request: ISendWhatsAppMessageReq): Promise<void>;
2138
+ sendTemplate(request: ISendWhatsAppTemplateReq): Promise<void>;
2219
2139
  }
2220
2140
 
2221
- interface IWhatsAppByWasenderChannelConfig {
2222
- apiKey?: string;
2223
- webhookSecret?: string;
2224
- phoneNumber?: string;
2141
+ interface IWasenderChannelConfig {
2142
+ apiKey?: string | ConfigReference<string>;
2143
+ webhookSecret?: string | ConfigReference<string>;
2144
+ phoneNumber?: string | ConfigReference<string>;
2225
2145
  webhookPath?: string;
2226
- retryOptions?: {
2227
- enabled: boolean;
2228
- maxRetries: number;
2229
- };
2230
2146
  }
2231
2147
 
2232
- declare function whatsAppByWasender(config?: IWhatsAppByWasenderChannelConfig): (target: object, propertyKey: string | symbol) => void;
2148
+ declare function wasender(config?: IWasenderChannelConfig): (target: object, propertyKey: string | symbol) => void;
2233
2149
 
2234
2150
  type IWasenderEvent = IWasenderMessageReceivedEvent | IWasenderQrUpdatedEvent;
2235
2151
  interface IWasenderQrUpdatedEvent {
@@ -2276,7 +2192,7 @@ interface IWasenderDeviceListMetadata {
2276
2192
  recipientTimestamp: string;
2277
2193
  }
2278
2194
 
2279
- declare class WhatsAppByWasenderChannelConfig implements IWhatsAppByWasenderChannelConfig {
2195
+ declare class WasenderChannelConfig {
2280
2196
  readonly apiKey?: string;
2281
2197
  readonly webhookSecret?: string;
2282
2198
  readonly phoneNumber?: string;
@@ -2285,40 +2201,45 @@ declare class WhatsAppByWasenderChannelConfig implements IWhatsAppByWasenderChan
2285
2201
  enabled: boolean;
2286
2202
  maxRetries: number;
2287
2203
  };
2288
- constructor(config: IWhatsAppByWasenderChannelConfig);
2204
+ constructor(config: {
2205
+ apiKey?: string;
2206
+ webhookSecret?: string;
2207
+ phoneNumber?: string;
2208
+ webhookPath?: string;
2209
+ });
2289
2210
  }
2290
2211
 
2291
- interface IWhatsAppByWasenderChatMessage extends IChatMessage {
2212
+ interface IWasenderChatMessage extends IChatMessage {
2292
2213
  metadata: {
2293
2214
  whatsAppNumber: string;
2294
2215
  };
2295
2216
  }
2296
2217
 
2297
- declare const whatsAppByWasenderChannelName: "WhatsAppByWasenderChannel";
2218
+ declare const wasenderChannelName: "WhatsAppByWasenderChannel";
2298
2219
 
2299
- interface IWhatsAppByWasenderReceivedMessage extends IReceivedMessage {
2300
- channel: typeof whatsAppByWasenderChannelName;
2301
- message: IWhatsAppByWasenderChatMessage;
2220
+ interface IWasenderReceivedMessage extends IReceivedMessage {
2221
+ channel: typeof wasenderChannelName;
2222
+ message: IWasenderChatMessage;
2302
2223
  }
2303
2224
 
2304
- interface IWhatsAppByWasenderChannelMessage extends IWhatsAppByWasenderReceivedMessage {
2225
+ interface IWasenderChannelMessage extends IWasenderReceivedMessage {
2305
2226
  chatConnection: IChatConnection;
2306
2227
  injectInstances?: [any, any][];
2307
2228
  }
2308
2229
 
2309
- declare class WhatsAppByWasenderChannel implements IChatChannel {
2230
+ declare class WasenderChannel implements IChatChannel {
2310
2231
  private logger;
2311
2232
  private sender;
2312
2233
  private receiver;
2313
2234
  private phoneNumber;
2314
2235
  static channelName: "WhatsAppByWasenderChannel";
2315
- constructor(config: WhatsAppByWasenderChannelConfig, env: Env);
2316
- listen(callback: (message: IWhatsAppByWasenderChannelMessage) => Promise<void>): void;
2236
+ constructor(config: WasenderChannelConfig, env: Env);
2237
+ listen(callback: (message: IWasenderChannelMessage) => Promise<void>): void;
2317
2238
  connect(): void;
2318
2239
  disconnect(): void;
2319
2240
  }
2320
2241
 
2321
- type IWasenderChannelMessageListener = (message: IWhatsAppByWasenderChatMessage, from: string) => Promise<void>;
2242
+ type IWasenderChannelMessageListener = (message: IWasenderChatMessage, from: string) => Promise<void>;
2322
2243
  declare class WasenderWebhookController {
2323
2244
  private wasender;
2324
2245
  private listener;
@@ -2330,7 +2251,7 @@ declare class WasenderWebhookController {
2330
2251
  private getRawBody;
2331
2252
  }
2332
2253
 
2333
- declare class WhatsAppReceiverByWasender {
2254
+ declare class WasenderReceiver {
2334
2255
  private config;
2335
2256
  private wasender;
2336
2257
  private listener;
@@ -2348,23 +2269,36 @@ declare class WhatsAppReceiverByWasender {
2348
2269
  disconnect(): void;
2349
2270
  }
2350
2271
 
2351
- interface ISendByWasenderRequest {
2352
- from: string;
2353
- to: string;
2354
- message: IChatMessage;
2355
- }
2356
- declare class WhatsAppSenderByWasender {
2272
+ declare class WasenderSender implements IWhatsAppSender {
2357
2273
  private wasender;
2358
2274
  private logger;
2359
2275
  constructor(apiKey: string, retryOptions?: {
2360
2276
  enabled: boolean;
2361
2277
  maxRetries: number;
2362
2278
  });
2363
- send(request: ISendByWasenderRequest): Promise<void>;
2279
+ sendMessage(request: ISendWhatsAppMessageReq): Promise<void>;
2280
+ sendTemplate(request: ISendWhatsAppTemplateReq): Promise<void>;
2364
2281
  }
2365
2282
 
2366
2283
  declare function extractNumberFromWasenderMessageKey(key: IWasenderMessageKey): string;
2367
2284
 
2285
+ declare class WhatsAppSender implements IWhatsAppSender {
2286
+ sendMessage(request: ISendWhatsAppMessageReq): Promise<void>;
2287
+ sendTemplate(request: ISendWhatsAppTemplateReq): Promise<void>;
2288
+ }
2289
+
2290
+ declare class InMemoryLockKey implements ILockKey {
2291
+ private readonly key;
2292
+ private static locks;
2293
+ constructor(key: string | number);
2294
+ run<T>(fn: () => Promise<T>): Promise<T>;
2295
+ tryRun<T>(fn: () => Promise<T>): Promise<T | undefined>;
2296
+ }
2297
+
2298
+ declare class InMemoryLocker implements ILocker {
2299
+ withKey(key: string | number | ILockerKey): ILockKey;
2300
+ }
2301
+
2368
2302
  interface IHtmlModuleOptions {
2369
2303
  url: string;
2370
2304
  title: string;
@@ -2373,4 +2307,4 @@ declare function HtmlModule(options: IHtmlModuleOptions): {
2373
2307
  new (): {};
2374
2308
  };
2375
2309
 
2376
- export { AnthropicChatAdapter, ApiKey, ApiKeyGuardMiddleware, ApiKeyHandshakeGuardMiddleware, ApiKeyRepository, Async, AsyncMetadataStore, Auth, Chat, ChatAdapter, ChatAdapterMetadataStore, ChatAdapterRegistry, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatOperator, ChatRepository, ChatResolver, type ClientMap, CmdChannel, type ConfigReference, type ConfigReferenceType, ConfigResolver, Container, ControllerMetadataStore, CronJob, CronJobRepository, CustomError, DeepSeekChatAdapter, DescriptionMetadataStore, EXPRESS_REQ, EXPRESS_RES, Entity, Env, EnvWhatsAppRepository, type ErrorSeverity, ExpressProvider, GoogleChatAdapter, type GoogleChatAdapterV2Options, HtmlModule, HttpServerProvider, type IApiKeyData, type IApiKeyRepository, type IArrayValidationError, type IArrayValidationResult, type IBotMessageItem, type IBuiltQuery, type IChannelMessage, type IChannelMetadata, type IChatAdapter, type IChatAdapterDecoratorConfig, type IChatAdapterMetadata, type IChatAdapterNextItemsReq, type IChatAdapterNextItemsRes, type IChatAssociation, type IChatBot, type IChatBotMetadata, type IChatChannel, type IChatConnection, type IChatControllerMetadata, type IChatData, type IChatItem, type IChatItemData, type IChatItemType, type IChatMemory, type IChatMessage, type IChatMessageDocument, type IChatMessageFile, type IChatMessageImage, type IChatMessagesPrivateFile, type IChatMessagesPublicFile, type IChatRepository, type IChatType, type ICmdChannelMessage, type ICmdReceivedMessage, type ICommandConfig, type ICommandHandler, type ICommandHandlerConfig, type IConstructor, type ICronConfig, type ICronJobData, type ICrudRepository, type ICustomErrorData, type IDescriptionMetadata, type IEndPointConfig, type IEndPointMetadata, type IEntityData, type IEnvType, type IErrorHandlersConfig, type IErrorMonitor, type IErrorMonitorContext, type IExtractChatMessageTextOptions, type IFunctionCall, type IFunctionCallItem, type IGenerateApiKeyReq, type IGenerateApiKeyRes, type IGetWhatsAppTemplateRequest, type IHandshakeMiddleware, type IHandshakeMiddlewareMetadata, type IHtmlModuleOptions, type IHumanMessageItem, type IJobData, type IJobRepository, type IJwtRefreshTokenData, type IJwtRefreshTokenRepository, type ILanguageModelUsage, type IListenWhatsAppMessageRequest, type ILockKey, type ILocker, type ILockerKey, type IMessageContext, type IMiddleware, type IMiddlewareMetadata, type IMindset, type IMindsetConfig, type IMindsetIdentity, type IMindsetLlm, type IMindsetMetadata, type IMindsetModelKind, type IMindsetModelRef, type IMindsetModels, type IMindsetModuleConfig, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IMoneyData, type IPersistentData, type IPgRepositoryConfig, type IPropertyValidatorInfo, type IQueryAst, type IQueryCondition, type IQueryMethodMetadata, type IQueryOrderBy, type IReceivedMessage, type IRemoteApiKeyFetcher, type IRestControllerConfig, type IRestControllerMetadata, type IScheduleAt, type IScheduleDelay, type ISendByWasenderRequest, type ISendWhatsAppRequest, type ISendWhatsAppTemplateRequest, type ISocketChannelConfig, type ISocketChannelMessage, type ISocketChannelReceivedMessage, type ISocketControllerConfig, type ISocketControllerMetadata, type ISocketEventConfig, type ISocketEventMetadata, type ISocketReceivedMessage, type IStorableData, type ITelegramChannelConfig, type ITelegramChannelMessage, type ITelegramReceivedMessage, type IValidateArrayOptions, type IValidateArrayOptionsWithItemsValidators, type IValidateInputShape, type IValidateIsInOptions, type IValidateIsRecordOptions, type IValidateMaxOptions, type IValidateMinOptions, type IValidationError, type IValidationResult, type IValidator, type IValidatorMetadata, type IWasenderChannelMessageListener, type IWasenderDeviceListMetadata, type IWasenderEvent, type IWasenderMessageContent, type IWasenderMessageContextInfo, type IWasenderMessageKey, type IWasenderMessageReceivedData, type IWasenderMessageReceivedEvent, type IWasenderQrUpdatedEvent, type IWhatsAppBusinessAccount, type IWhatsAppBusinessNumber, type IWhatsAppByWasenderChannelConfig, type IWhatsAppByWasenderReceivedMessage, type IWhatsAppChannelMessage, 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 IWhatsAppReceivedMessage, type IWhatsAppRepository, type IWhatsAppSenderOptions, type IWhatsappChannelConfig, type IchatControllerConfig, Job, JobRepository, JobRunner, Jwt, JwtAccessAndRefreshTokenDto, JwtConfig, JwtGuardMiddleware, JwtHandshakeGuardMiddleware, JwtRefreshToken, JwtRefreshTokenRepository, JwtSigner, JwtTokenDto, Lifecycle, Locker, Logger, Mapper, Mindset, MindsetMetadataStore, MindsetOperator, Money, MoneyDto, OpenRouterChatAdapter, OpenaiChatAdapter, Password, type PasswordHashOptions, Persistent, PgApiKeyRepository, PgChatMemory, PgChatRepository, PgCronJobRepository, PgCrudRepository, PgJobRepository, PgJsonRepository, PgJwtRefreshTokenRepository, PgLockKey, PgLocker, PgRepositoryBase, PgRepositoryMetadataStore, PgWhatsAppRepository, type QueryConnector, type QueryOperator, type QueryPrefix, RamChatMemory, RamChatRepository, Random, RemoteApiKeyRepository, RestControllerMetadataStore, RestRequest, SocketChannel, SocketChannelConfig, SocketChannelMessageFile, SocketChannelReceivedMessage, SocketControllerMetadataStore, SocketServerConfig, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, UnionChatAdapter, ValidationMetadataStore, WHATSAPP_MESSAGE_EVENT, WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT, WHATSAPP_PROXY_SEND_MESSAGE_EVENT, WabotChatAdapter, WasenderWebhookController, WhatsApp, WhatsAppByWasenderChannel, WhatsAppByWasenderChannelConfig, WhatsAppChannel, WhatsAppReceiver, WhatsAppReceiverByCloudApi, WhatsAppReceiverByWabotProxy, WhatsAppReceiverByWasender, WhatsAppRepository, WhatsAppSender, WhatsAppSenderByCloudApi, WhatsAppSenderByWabotProxy, WhatsAppSenderByWasender, WhatsAppWabotProxyConnection, WhatsappChannelConfig, apiKeyGuard, apiKeyHandshakeGuard, bool, boolArr, buildQuerySql, chatAdapter, chatBot, chatController, chatItemTypeOptions, cmd, cmdChannelName, command, commandHandler, container, cron, description, errorToPlainObject, extractChatMessageText, extractNumberFromWasenderMessageKey, getClientMap, getPgClient, handshakeMiddlewares, inject, injectable, isArray, isBoolean, isChatMessageEmpty, isDate, isIn, isModel, isNotEmpty, isNumber, isOptional, isPresent, isRecord, isRetryableError, isString, jwtGuard, jwtHandshakeGuard, max, middleware, min, mindset, mindsetModule, modelInfo, num, numArr, obj, onDelete, onGet, onPost, onPut, onSocketEvent, parseQueryMethodName, pgJsonRepository, pgStorage, query, readJsonFromFile, resolveConfigReferences, restController, runChatAdapters, runChatControllers, runCommandHandlers, runCronHandlers, runRestControllers, runSocketControllers, safeJsonParse, scoped, setupErrorHandlers, singleton, socket, socketChannelName, socketController, stopCommandHandlers, stopCronHandlers, str, strArr, telegram, telegramChannelName, validateAndTransform, validateArray, validateIsBoolean, validateIsDate, validateIsIn, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsRecord, validateIsString, validateMax, validateMin, validateModel, whatsApp, whatsAppByWasender, whatsAppByWasenderChannelName, whatsAppChannelName, withPgClient, withPgTransaction, writeJsonToFile };
2310
+ export { AnthropicChatAdapter, ApiKey, ApiKeyGuardMiddleware, ApiKeyHandshakeGuardMiddleware, ApiKeyRepository, Async, AsyncMetadataStore, Auth, Chat, ChatAdapter, ChatAdapterMetadataStore, ChatAdapterRegistry, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatOperator, ChatRepository, ChatResolver, type ClientMap, CmdChannel, type ConfigReference, type ConfigReferenceType, ConfigResolver, Container, ControllerMetadataStore, CronJob, CronJobRepository, CustomError, DeepSeekChatAdapter, DescriptionMetadataStore, EXPRESS_REQ, EXPRESS_RES, Entity, Env, type ErrorSeverity, ExpressProvider, GoogleChatAdapter, type GoogleChatAdapterV2Options, HtmlModule, HttpServerProvider, type IApiKeyData, type IApiKeyRepository, type IArrayValidationError, type IArrayValidationResult, type IBotMessageItem, type IBuiltQuery, type IChannelMessage, type IChannelMetadata, type IChatAdapter, type IChatAdapterDecoratorConfig, type IChatAdapterMetadata, type IChatAdapterNextItemsReq, type IChatAdapterNextItemsRes, type IChatAssociation, type IChatBot, type IChatBotMetadata, type IChatChannel, type IChatConnection, type IChatControllerMetadata, type IChatData, type IChatItem, type IChatItemData, type IChatItemType, type IChatMemory, type IChatMessage, type IChatMessageDocument, type IChatMessageFile, type IChatMessageImage, type IChatMessagesPrivateFile, type IChatMessagesPublicFile, type IChatRepository, type IChatType, type ICmdChannelMessage, type ICmdReceivedMessage, type ICommandConfig, type ICommandHandler, type ICommandHandlerConfig, type IConstructor, type ICronConfig, type ICronHandler, type ICronJobData, type ICronJobRepository, type ICrudRepository, type ICustomErrorData, type IDescriptionMetadata, type IEndPointConfig, type IEndPointMetadata, type IEntityData, type IEnvType, type IErrorHandlersConfig, type IErrorMonitor, type IErrorMonitorContext, type IExtractChatMessageTextOptions, type IFunctionCall, type IFunctionCallItem, type IGenerateApiKeyReq, type IGenerateApiKeyRes, type IHandshakeMiddleware, type IHandshakeMiddlewareMetadata, type IHtmlModuleOptions, type IHumanMessageItem, type IJobData, type IJobRepository, type IJwtRefreshTokenData, type IJwtRefreshTokenRepository, type ILanguageModelUsage, type ILockKey, type ILocker, type ILockerKey, type IMessageContext, type IMiddleware, type IMiddlewareMetadata, type IMindset, type IMindsetConfig, type IMindsetIdentity, type IMindsetLlm, type IMindsetMetadata, type IMindsetModelKind, type IMindsetModelRef, type IMindsetModels, type IMindsetModuleConfig, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IMoneyData, type IPersistentData, type IPgRepositoryConfig, type IProjectRunnerConfig, type IPropertyValidatorInfo, type IQueryAst, type IQueryCondition, type IQueryMethodMetadata, type IQueryOrderBy, type IReceivedMessage, type IRemoteApiKeyFetcher, type IRestControllerConfig, type IRestControllerMetadata, type IScheduleAt, type IScheduleDelay, type ISendWhatsAppMessageReq, type ISendWhatsAppTemplateReq, type ISocketChannelConfig, type ISocketChannelMessage, type ISocketChannelReceivedMessage, type ISocketControllerConfig, type ISocketControllerMetadata, type ISocketEventConfig, type ISocketEventMetadata, type ISocketReceivedMessage, type IStorableData, type ITelegramChannelConfig, type ITelegramChannelMessage, type ITelegramReceivedMessage, type ITransactionAdapter, type IValidateArrayOptions, type IValidateArrayOptionsWithItemsValidators, type IValidateInputShape, type IValidateIsInOptions, type IValidateIsRecordOptions, type IValidateMaxOptions, type IValidateMinOptions, type IValidationError, type IValidationResult, type IValidator, type IValidatorMetadata, type IWasenderChannelConfig, type IWasenderChannelMessageListener, type IWasenderDeviceListMetadata, type IWasenderEvent, type IWasenderMessageContent, type IWasenderMessageContextInfo, type IWasenderMessageKey, type IWasenderMessageReceivedData, type IWasenderMessageReceivedEvent, type IWasenderQrUpdatedEvent, type IWasenderReceivedMessage, type IWhatsAppCloudContact, type IWhatsAppCloudMessage, type IWhatsAppCloudMessageMetadata, type IWhatsAppCloudTemplate, type IWhatsAppCloudTemplateComponent, type IWhatsAppCloudTemplateResponse, type IWhatsAppCloudWebhookPayload, type IWhatsAppSender, type IWhatsAppTemplateData, type IWhatsAppTemplateParameter, type IchatControllerConfig, InMemoryChatMemory, InMemoryChatRepository, InMemoryCronJobRepository, InMemoryJobRepository, InMemoryLockKey, InMemoryLocker, Job, JobRepository, JobRunner, Jwt, JwtAccessAndRefreshTokenDto, JwtConfig, JwtGuardMiddleware, JwtHandshakeGuardMiddleware, JwtRefreshToken, JwtRefreshTokenRepository, JwtSigner, JwtTokenDto, Lifecycle, Locker, Logger, Mapper, Mindset, MindsetMetadataStore, MindsetOperator, Money, MoneyDto, OpenRouterChatAdapter, OpenaiChatAdapter, Password, type PasswordHashOptions, Persistent, PgApiKeyRepository, PgChatMemory, PgChatRepository, PgCronJobRepository, PgCrudRepository, PgJobRepository, PgJsonRepository, PgJwtRefreshTokenRepository, PgLockKey, PgLocker, PgRepositoryBase, PgRepositoryMetadataStore, PgTransactionAdapter, ProjectRunner, type QueryConnector, type QueryOperator, type QueryPrefix, Random, RemoteApiKeyRepository, type ResolvedConfig, RestControllerMetadataStore, RestRequest, SocketChannel, SocketChannelConfig, SocketChannelMessageFile, SocketChannelReceivedMessage, SocketControllerMetadataStore, SocketServerConfig, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, TransactionMetadataStore, UnionChatAdapter, ValidationMetadataStore, WabotChatAdapter, WasenderChannel, WasenderChannelConfig, WasenderReceiver, WasenderSender, WasenderWebhookController, WhatsAppApiSender, WhatsAppReceiverByCloudApi, WhatsAppSender, apiKeyGuard, apiKeyHandshakeGuard, bool, boolArr, buildQuerySql, chatAdapter, chatBot, chatController, chatItemTypeOptions, cmd, cmdChannelName, command, commandHandler, container, cronHandler, description, errorToPlainObject, extractChatMessageText, extractNumberFromWasenderMessageKey, getClientMap, getPgClient, handshakeMiddlewares, inject, injectable, isArray, isBoolean, isChatMessageEmpty, isDate, isIn, isModel, isNotEmpty, isNumber, isOptional, isPresent, isRecord, isRetryableError, isString, jwtGuard, jwtHandshakeGuard, max, middleware, min, mindset, mindsetModule, modelInfo, num, numArr, obj, onDelete, onGet, onPost, onPut, onSocketEvent, parseQueryMethodName, pgJsonRepository, pgStorage, query, readJsonFromFile, resolveConfigReferences, restController, run, runChatAdapters, runChatControllers, runCommandHandlers, runCronHandlers, runRestControllers, runSocketControllers, safeJsonParse, scoped, setupErrorHandlers, singleton, socket, socketChannelName, socketController, stopCommandHandlers, stopCronHandlers, str, strArr, telegram, telegramChannelName, transaction, validateAndTransform, validateArray, validateIsBoolean, validateIsDate, validateIsIn, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsRecord, validateIsString, validateMax, validateMin, validateModel, wasender, wasenderChannelName, withPgClient, withPgTransaction, writeJsonToFile };