@wabot-dev/framework 0.8.2 → 0.9.0
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.
- package/dist/src/addon/async/pg/PgCronJobRepository.js +2 -0
- package/dist/src/addon/async/pg/PgJobRepository.js +2 -0
- package/dist/src/addon/auth/api-key/@apiKeyGuard.js +2 -2
- package/dist/src/addon/auth/api-key/PgApiKeyRepository.js +3 -1
- package/dist/src/addon/auth/jwt/@jwtGuard.js +2 -2
- package/dist/src/addon/auth/jwt/PgJwtRefreshTokenRepository.js +2 -0
- package/dist/src/addon/chat-bot/anthropic/AnthropicChatAdapter.js +38 -14
- package/dist/src/addon/chat-bot/deepseek/DeepSeekChatAdapter.js +42 -13
- package/dist/src/addon/chat-bot/google/GoogleChatAdapter.js +77 -26
- package/dist/src/addon/chat-bot/openia/OpenaiChatAdapter.js +31 -9
- package/dist/src/addon/chat-bot/openrouter/OpenRouterChatAdapter.js +23 -4
- package/dist/src/addon/chat-bot/pg/PgChatMemory.js +6 -1
- package/dist/src/addon/chat-bot/pg/PgChatRepository.js +5 -0
- package/dist/src/addon/chat-bot/ram/RamChatRepository.js +3 -0
- package/dist/src/addon/chat-bot/wabot/WabotChatAdapter.js +9 -0
- package/dist/src/addon/chat-controller/cmd/CmdChannel.js +3 -3
- package/dist/src/addon/chat-controller/wasender/WasenderWebhookController.js +1 -1
- package/dist/src/addon/chat-controller/whatsapp/PgWhatsAppRepository.js +2 -0
- package/dist/src/addon/chat-controller/whatsapp/WhatsAppSender.js +3 -0
- package/dist/src/addon/chat-controller/whatsapp/cloud-api/WhatsAppSenderByCloudApi.js +3 -0
- package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppSenderByWabotProxy.js +3 -0
- package/dist/src/core/config/resolver.js +27 -0
- package/dist/src/core/config/tag-functions.js +10 -1
- package/dist/src/feature/chat-bot/Chat.js +2 -1
- package/dist/src/feature/chat-bot/ChatAdapterRegistry.js +26 -0
- package/dist/src/feature/chat-bot/ChatBot.js +9 -6
- package/dist/src/feature/chat-bot/UnionChatAdapter.js +64 -0
- package/dist/src/feature/chat-bot/isChatMessageEmpty.js +1 -1
- package/dist/src/feature/chat-bot/isRetryableError.js +63 -0
- package/dist/src/feature/chat-bot/metadata/@chatAdapter.js +11 -0
- package/dist/src/feature/chat-bot/metadata/ChatAdapterMetadataStore.js +17 -0
- package/dist/src/feature/chat-bot/runChatAdapters.js +22 -0
- package/dist/src/feature/chat-controller/ChatResolver.js +3 -0
- package/dist/src/feature/chat-controller/runChatControllers.js +3 -0
- package/dist/src/feature/http/HttpServerProvider.js +1 -1
- package/dist/src/feature/mindset/IMindset.js +4 -0
- package/dist/src/feature/mindset/MindsetOperator.js +30 -2
- package/dist/src/feature/pg/pgStorage.js +1 -1
- package/dist/src/feature/pg/query/@pgJsonRepository.js +73 -0
- package/dist/src/feature/pg/query/@query.js +14 -0
- package/dist/src/feature/pg/query/PgJsonRepository.js +23 -0
- package/dist/src/feature/pg/query/PgRepositoryMetadataStore.js +44 -0
- package/dist/src/feature/pg/query/buildQuerySql.js +164 -0
- package/dist/src/feature/pg/query/parseQueryMethodName.js +151 -0
- package/dist/src/feature/pg/withPgClient.js +1 -1
- package/dist/src/feature/rest-controller/runRestControllers.js +2 -2
- package/dist/src/index.d.ts +140 -18
- package/dist/src/index.js +15 -3
- package/dist/src/node_modules/cron-parser/dist/CronFileParser.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import { singleton } from '../../../core/injection/index.js';
|
|
3
|
+
|
|
4
|
+
let PgRepositoryMetadataStore = class PgRepositoryMetadataStore {
|
|
5
|
+
queryMethods = new Map();
|
|
6
|
+
repositoryConfigs = new Map();
|
|
7
|
+
saveQueryMethodMetadata(metadata) {
|
|
8
|
+
let perClass = this.queryMethods.get(metadata.repositoryConstructor);
|
|
9
|
+
if (!perClass) {
|
|
10
|
+
perClass = new Map();
|
|
11
|
+
this.queryMethods.set(metadata.repositoryConstructor, perClass);
|
|
12
|
+
}
|
|
13
|
+
perClass.set(metadata.functionName, metadata);
|
|
14
|
+
}
|
|
15
|
+
saveRepositoryConfig(ctor, config) {
|
|
16
|
+
this.repositoryConfigs.set(ctor, config);
|
|
17
|
+
}
|
|
18
|
+
getRepositoryConfig(ctor) {
|
|
19
|
+
return this.repositoryConfigs.get(ctor);
|
|
20
|
+
}
|
|
21
|
+
getQueryMethods(ctor) {
|
|
22
|
+
const collected = new Map();
|
|
23
|
+
const hierarchy = [];
|
|
24
|
+
let proto = ctor.prototype;
|
|
25
|
+
while (proto && proto.constructor !== Object) {
|
|
26
|
+
hierarchy.unshift(proto.constructor);
|
|
27
|
+
proto = Object.getPrototypeOf(proto);
|
|
28
|
+
}
|
|
29
|
+
for (const cls of hierarchy) {
|
|
30
|
+
const perClass = this.queryMethods.get(cls);
|
|
31
|
+
if (perClass) {
|
|
32
|
+
for (const [name, meta] of perClass) {
|
|
33
|
+
collected.set(name, meta);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return [...collected.values()];
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
PgRepositoryMetadataStore = __decorate([
|
|
41
|
+
singleton()
|
|
42
|
+
], PgRepositoryMetadataStore);
|
|
43
|
+
|
|
44
|
+
export { PgRepositoryMetadataStore };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// Fields stored as top-level columns; routed to the column instead of
|
|
2
|
+
// extracting from the JSON blob (uses the index, preserves native type
|
|
3
|
+
// for ordering/comparison). All other fields fall back to data->>'field',
|
|
4
|
+
// which yields TEXT — so ORDER BY on numeric JSON fields is lexicographic
|
|
5
|
+
// and In/NotIn compares as text. Use add.columns for sortable hot paths.
|
|
6
|
+
const RESERVED_COLUMN_BY_FIELD = {
|
|
7
|
+
id: 'id',
|
|
8
|
+
createdAt: 'created_at',
|
|
9
|
+
};
|
|
10
|
+
function operatorArity(op) {
|
|
11
|
+
if (op === 'IsNull' || op === 'IsNotNull')
|
|
12
|
+
return 0;
|
|
13
|
+
return 1;
|
|
14
|
+
}
|
|
15
|
+
function escapeJsonKey(field) {
|
|
16
|
+
return field.replace(/'/g, "''");
|
|
17
|
+
}
|
|
18
|
+
function isReservedColumn(field) {
|
|
19
|
+
return Object.prototype.hasOwnProperty.call(RESERVED_COLUMN_BY_FIELD, field);
|
|
20
|
+
}
|
|
21
|
+
function fieldRef(field) {
|
|
22
|
+
const reserved = RESERVED_COLUMN_BY_FIELD[field];
|
|
23
|
+
if (reserved)
|
|
24
|
+
return reserved;
|
|
25
|
+
return `data->>'${escapeJsonKey(field)}'`;
|
|
26
|
+
}
|
|
27
|
+
function fieldExpr(field, op) {
|
|
28
|
+
const ref = fieldRef(field);
|
|
29
|
+
if (op === 'Gt' || op === 'Gte' || op === 'Lt' || op === 'Lte') {
|
|
30
|
+
if (isReservedColumn(field))
|
|
31
|
+
return ref;
|
|
32
|
+
return `(${ref})::numeric`;
|
|
33
|
+
}
|
|
34
|
+
return ref;
|
|
35
|
+
}
|
|
36
|
+
function renderCondition(cond, paramIndex) {
|
|
37
|
+
const lhs = fieldExpr(cond.field, cond.operator);
|
|
38
|
+
const reserved = isReservedColumn(cond.field);
|
|
39
|
+
const numCast = reserved ? '' : '::numeric';
|
|
40
|
+
// Note: In/NotIn cast the param to text[]; passing non-text JSON values
|
|
41
|
+
// (numbers, booleans) relies on pg's TEXT serialization. For sortable
|
|
42
|
+
// numeric fields, prefer a typed add.columns column.
|
|
43
|
+
const arrCast = reserved ? '' : '::text[]';
|
|
44
|
+
switch (cond.operator) {
|
|
45
|
+
case 'Equals':
|
|
46
|
+
return `${lhs} = $${paramIndex}`;
|
|
47
|
+
case 'Not':
|
|
48
|
+
return `${lhs} <> $${paramIndex}`;
|
|
49
|
+
case 'Like':
|
|
50
|
+
return `${lhs} LIKE $${paramIndex}`;
|
|
51
|
+
case 'NotLike':
|
|
52
|
+
return `${lhs} NOT LIKE $${paramIndex}`;
|
|
53
|
+
case 'In':
|
|
54
|
+
return `${lhs} = ANY($${paramIndex}${arrCast})`;
|
|
55
|
+
case 'NotIn':
|
|
56
|
+
return `NOT (${lhs} = ANY($${paramIndex}${arrCast}))`;
|
|
57
|
+
case 'Gt':
|
|
58
|
+
return `${lhs} > $${paramIndex}${numCast}`;
|
|
59
|
+
case 'Gte':
|
|
60
|
+
return `${lhs} >= $${paramIndex}${numCast}`;
|
|
61
|
+
case 'Lt':
|
|
62
|
+
return `${lhs} < $${paramIndex}${numCast}`;
|
|
63
|
+
case 'Lte':
|
|
64
|
+
return `${lhs} <= $${paramIndex}${numCast}`;
|
|
65
|
+
// IS NULL matches both missing JSON keys and explicit JSON nulls
|
|
66
|
+
// (PostgreSQL `data->>'k'` returns NULL for both cases).
|
|
67
|
+
case 'IsNull':
|
|
68
|
+
return `${lhs} IS NULL`;
|
|
69
|
+
case 'IsNotNull':
|
|
70
|
+
return `${lhs} IS NOT NULL`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function renderWhere(conditions) {
|
|
74
|
+
if (conditions.length === 0)
|
|
75
|
+
return { sql: '', argCount: 0 };
|
|
76
|
+
const parts = [];
|
|
77
|
+
let paramIndex = 1;
|
|
78
|
+
conditions.forEach((cond, i) => {
|
|
79
|
+
const piece = renderCondition(cond, paramIndex);
|
|
80
|
+
paramIndex += operatorArity(cond.operator);
|
|
81
|
+
if (i === 0) {
|
|
82
|
+
parts.push(piece);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
parts.push((cond.connector ?? 'And').toUpperCase(), piece);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
return { sql: ` WHERE ${parts.join(' ')}`, argCount: paramIndex - 1 };
|
|
89
|
+
}
|
|
90
|
+
function renderOrderBy(ast) {
|
|
91
|
+
if (ast.orderBy.length === 0)
|
|
92
|
+
return '';
|
|
93
|
+
const parts = ast.orderBy.map((o) => `${fieldRef(o.field)} ${o.direction}`);
|
|
94
|
+
return ` ORDER BY ${parts.join(', ')}`;
|
|
95
|
+
}
|
|
96
|
+
function renderLimit(ast) {
|
|
97
|
+
if (ast.prefix === 'findOne')
|
|
98
|
+
return ' LIMIT 1';
|
|
99
|
+
if (ast.limit !== undefined)
|
|
100
|
+
return ` LIMIT ${ast.limit}`;
|
|
101
|
+
return '';
|
|
102
|
+
}
|
|
103
|
+
function buildSelectSql(ast, table, columns) {
|
|
104
|
+
const where = renderWhere(ast.conditions);
|
|
105
|
+
const order = renderOrderBy(ast);
|
|
106
|
+
const limit = renderLimit(ast);
|
|
107
|
+
const sql = `SELECT ${columns} FROM ${table}${where.sql}${order}${limit}`;
|
|
108
|
+
return { sql, argCount: where.argCount };
|
|
109
|
+
}
|
|
110
|
+
function buildCountSql(ast, table) {
|
|
111
|
+
const where = renderWhere(ast.conditions);
|
|
112
|
+
const sql = `SELECT COUNT(*)::int AS count FROM ${table}${where.sql}`;
|
|
113
|
+
return { sql, argCount: where.argCount };
|
|
114
|
+
}
|
|
115
|
+
function buildExistsSql(ast, table) {
|
|
116
|
+
const where = renderWhere(ast.conditions);
|
|
117
|
+
const sql = `SELECT EXISTS(SELECT 1 FROM ${table}${where.sql} LIMIT 1) AS "exists"`;
|
|
118
|
+
return { sql, argCount: where.argCount };
|
|
119
|
+
}
|
|
120
|
+
function buildDeleteSql(ast, table) {
|
|
121
|
+
const where = renderWhere(ast.conditions);
|
|
122
|
+
const sql = `DELETE FROM ${table}${where.sql}`;
|
|
123
|
+
return { sql, argCount: where.argCount };
|
|
124
|
+
}
|
|
125
|
+
function buildQuerySql(ast, table, columns) {
|
|
126
|
+
let sql;
|
|
127
|
+
let argCount;
|
|
128
|
+
switch (ast.prefix) {
|
|
129
|
+
case 'find':
|
|
130
|
+
case 'findOne': {
|
|
131
|
+
const r = buildSelectSql(ast, table, columns);
|
|
132
|
+
sql = r.sql;
|
|
133
|
+
argCount = r.argCount;
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
case 'count': {
|
|
137
|
+
const r = buildCountSql(ast, table);
|
|
138
|
+
sql = r.sql;
|
|
139
|
+
argCount = r.argCount;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
case 'exists': {
|
|
143
|
+
const r = buildExistsSql(ast, table);
|
|
144
|
+
sql = r.sql;
|
|
145
|
+
argCount = r.argCount;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
case 'delete': {
|
|
149
|
+
const r = buildDeleteSql(ast, table);
|
|
150
|
+
sql = r.sql;
|
|
151
|
+
argCount = r.argCount;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const buildParams = (args) => {
|
|
156
|
+
if (args.length !== argCount) {
|
|
157
|
+
throw new Error(`Query expected ${argCount} argument(s), received ${args.length}`);
|
|
158
|
+
}
|
|
159
|
+
return args;
|
|
160
|
+
};
|
|
161
|
+
return { sql, argCount, buildParams };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export { buildQuerySql };
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
const PREFIXES = ['findOne', 'find', 'count', 'exists', 'delete'];
|
|
2
|
+
const OPERATOR_MATCHERS = [
|
|
3
|
+
{ tokens: ['Greater', 'Than', 'Equal'], op: 'Gte' },
|
|
4
|
+
{ tokens: ['Less', 'Than', 'Equal'], op: 'Lte' },
|
|
5
|
+
{ tokens: ['Greater', 'Than'], op: 'Gt' },
|
|
6
|
+
{ tokens: ['Less', 'Than'], op: 'Lt' },
|
|
7
|
+
{ tokens: ['Is', 'Not', 'Null'], op: 'IsNotNull' },
|
|
8
|
+
{ tokens: ['Is', 'Null'], op: 'IsNull' },
|
|
9
|
+
{ tokens: ['Not', 'Like'], op: 'NotLike' },
|
|
10
|
+
{ tokens: ['Not', 'In'], op: 'NotIn' },
|
|
11
|
+
{ tokens: ['Like'], op: 'Like' },
|
|
12
|
+
{ tokens: ['In'], op: 'In' },
|
|
13
|
+
{ tokens: ['Not'], op: 'Not' },
|
|
14
|
+
{ tokens: ['Gte'], op: 'Gte' },
|
|
15
|
+
{ tokens: ['Lte'], op: 'Lte' },
|
|
16
|
+
{ tokens: ['Gt'], op: 'Gt' },
|
|
17
|
+
{ tokens: ['Lt'], op: 'Lt' },
|
|
18
|
+
];
|
|
19
|
+
const CONNECTOR_TOKENS = new Set(['And', 'Or']);
|
|
20
|
+
const FIELD_NAME_REGEX = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
21
|
+
function splitCamelCase(s) {
|
|
22
|
+
return s.match(/[A-Z][a-z0-9]*/g) ?? [];
|
|
23
|
+
}
|
|
24
|
+
function tokensToFieldName(tokens) {
|
|
25
|
+
if (tokens.length === 0) {
|
|
26
|
+
throw new Error('Query method: missing field name');
|
|
27
|
+
}
|
|
28
|
+
const joined = tokens.join('');
|
|
29
|
+
const field = joined.charAt(0).toLowerCase() + joined.slice(1);
|
|
30
|
+
if (!FIELD_NAME_REGEX.test(field)) {
|
|
31
|
+
throw new Error(`Query method: invalid field name "${field}"`);
|
|
32
|
+
}
|
|
33
|
+
return field;
|
|
34
|
+
}
|
|
35
|
+
function matchPrefix(name) {
|
|
36
|
+
for (const prefix of PREFIXES) {
|
|
37
|
+
if (name.startsWith(prefix)) {
|
|
38
|
+
const next = name.charAt(prefix.length);
|
|
39
|
+
if (next === '' || (next >= 'A' && next <= 'Z')) {
|
|
40
|
+
return { prefix, rest: name.slice(prefix.length) };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
throw new Error(`Query method "${name}" must start with one of: ${PREFIXES.join(', ')}`);
|
|
45
|
+
}
|
|
46
|
+
function parseConditionTokens(tokens) {
|
|
47
|
+
for (const matcher of OPERATOR_MATCHERS) {
|
|
48
|
+
if (tokens.length < matcher.tokens.length)
|
|
49
|
+
continue;
|
|
50
|
+
const tail = tokens.slice(tokens.length - matcher.tokens.length);
|
|
51
|
+
if (tail.every((t, i) => t === matcher.tokens[i])) {
|
|
52
|
+
const head = tokens.slice(0, tokens.length - matcher.tokens.length);
|
|
53
|
+
return { field: tokensToFieldName(head), operator: matcher.op };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return { field: tokensToFieldName(tokens), operator: 'Equals' };
|
|
57
|
+
}
|
|
58
|
+
function parseConditions(body) {
|
|
59
|
+
if (body === '')
|
|
60
|
+
return [];
|
|
61
|
+
const tokens = splitCamelCase(body);
|
|
62
|
+
if (tokens.length === 0)
|
|
63
|
+
return [];
|
|
64
|
+
if (CONNECTOR_TOKENS.has(tokens[0])) {
|
|
65
|
+
throw new Error(`Query method: condition cannot start with connector "${tokens[0]}"`);
|
|
66
|
+
}
|
|
67
|
+
const conditions = [];
|
|
68
|
+
let buffer = [];
|
|
69
|
+
let pendingConnector;
|
|
70
|
+
const flush = () => {
|
|
71
|
+
if (buffer.length === 0) {
|
|
72
|
+
throw new Error('Query method: empty condition between connectors');
|
|
73
|
+
}
|
|
74
|
+
const { field, operator } = parseConditionTokens(buffer);
|
|
75
|
+
conditions.push({ field, operator, connector: pendingConnector });
|
|
76
|
+
buffer = [];
|
|
77
|
+
};
|
|
78
|
+
for (const token of tokens) {
|
|
79
|
+
if (CONNECTOR_TOKENS.has(token) && buffer.length > 0) {
|
|
80
|
+
flush();
|
|
81
|
+
pendingConnector = token;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
buffer.push(token);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
flush();
|
|
88
|
+
return conditions;
|
|
89
|
+
}
|
|
90
|
+
function parseOrderBy(body) {
|
|
91
|
+
const tokens = splitCamelCase(body);
|
|
92
|
+
const result = [];
|
|
93
|
+
let buffer = [];
|
|
94
|
+
for (const token of tokens) {
|
|
95
|
+
if (token === 'Asc' || token === 'Desc') {
|
|
96
|
+
if (buffer.length === 0) {
|
|
97
|
+
throw new Error('Query method: OrderBy direction without field');
|
|
98
|
+
}
|
|
99
|
+
result.push({
|
|
100
|
+
field: tokensToFieldName(buffer),
|
|
101
|
+
direction: token === 'Asc' ? 'ASC' : 'DESC',
|
|
102
|
+
});
|
|
103
|
+
buffer = [];
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
buffer.push(token);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (buffer.length > 0) {
|
|
110
|
+
throw new Error(`Query method: OrderBy field "${tokensToFieldName(buffer)}" missing Asc/Desc direction`);
|
|
111
|
+
}
|
|
112
|
+
if (result.length === 0) {
|
|
113
|
+
throw new Error('Query method: OrderBy clause has no fields');
|
|
114
|
+
}
|
|
115
|
+
return result;
|
|
116
|
+
}
|
|
117
|
+
// Conditions are joined left-to-right; the DSL has no parentheses,
|
|
118
|
+
// so SQL precedence applies (AND binds tighter than OR). Group with
|
|
119
|
+
// explicit method names if the implicit precedence is not what you want.
|
|
120
|
+
function parseQueryMethodName(name) {
|
|
121
|
+
const { prefix, rest: afterPrefix } = matchPrefix(name);
|
|
122
|
+
let rest = afterPrefix;
|
|
123
|
+
let limit;
|
|
124
|
+
const limitMatch = rest.match(/Limit(\d+)$/);
|
|
125
|
+
if (limitMatch) {
|
|
126
|
+
if (prefix === 'findOne') {
|
|
127
|
+
throw new Error(`Query method "${name}": findOne implies LIMIT 1; remove the Limit suffix`);
|
|
128
|
+
}
|
|
129
|
+
limit = parseInt(limitMatch[1], 10);
|
|
130
|
+
rest = rest.slice(0, rest.length - limitMatch[0].length);
|
|
131
|
+
}
|
|
132
|
+
let orderBy = [];
|
|
133
|
+
const orderByIdx = rest.indexOf('OrderBy');
|
|
134
|
+
if (orderByIdx >= 0) {
|
|
135
|
+
orderBy = parseOrderBy(rest.slice(orderByIdx + 'OrderBy'.length));
|
|
136
|
+
rest = rest.slice(0, orderByIdx);
|
|
137
|
+
}
|
|
138
|
+
let conditions = [];
|
|
139
|
+
if (rest === '' || rest === 'All') {
|
|
140
|
+
conditions = [];
|
|
141
|
+
}
|
|
142
|
+
else if (rest.startsWith('By')) {
|
|
143
|
+
conditions = parseConditions(rest.slice(2));
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
throw new Error(`Query method "${name}": expected "By<...>" or "All" after prefix, got "${rest}"`);
|
|
147
|
+
}
|
|
148
|
+
return { prefix, conditions, orderBy, limit };
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export { parseQueryMethodName };
|
|
@@ -6,11 +6,11 @@ import { validateModel } from '../../core/validation/core/validateModel.js';
|
|
|
6
6
|
import { ValidationMetadataStore } from '../../core/validation/metadata/ValidationMetadataStore.js';
|
|
7
7
|
import { ExpressProvider } from '../express/ExpressProvider.js';
|
|
8
8
|
import { json, urlencoded } from 'express';
|
|
9
|
-
import path__default from 'path';
|
|
9
|
+
import path__default from 'node:path';
|
|
10
10
|
import { EXPRESS_REQ, EXPRESS_RES } from './injection-tokens.js';
|
|
11
11
|
import { RestControllerMetadataStore } from './metadata/RestControllerMetadataStore.js';
|
|
12
12
|
import { RestRequest } from './RestRequest.js';
|
|
13
|
-
import { IncomingMessage } from 'http';
|
|
13
|
+
import { IncomingMessage } from 'node:http';
|
|
14
14
|
import { Container } from '../../core/injection/Container.js';
|
|
15
15
|
|
|
16
16
|
function buildRequest(req) {
|
package/dist/src/index.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ export { DependencyContainer } from 'tsyringe';
|
|
|
4
4
|
import InjectionToken from 'tsyringe/dist/typings/providers/injection-token';
|
|
5
5
|
import DependencyContainer, { PreResolutionInterceptorCallback, PostResolutionInterceptorCallback } from 'tsyringe/dist/typings/types/dependency-container';
|
|
6
6
|
import InterceptionOptions from 'tsyringe/dist/typings/types/interceptor-options';
|
|
7
|
-
import { Server, IncomingMessage } from 'http';
|
|
7
|
+
import { Server, IncomingMessage } from 'node:http';
|
|
8
8
|
import { Express, Request, Response } from 'express';
|
|
9
9
|
import * as big_js from 'big.js';
|
|
10
10
|
import { Pool, PoolClient } from 'pg';
|
|
11
|
-
import { AsyncLocalStorage } from 'async_hooks';
|
|
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
14
|
import { Socket as Socket$1 } from 'socket.io-client';
|
|
@@ -31,8 +31,9 @@ declare class Auth<D> {
|
|
|
31
31
|
wasOverrided(): boolean;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
type ConfigReferenceType = 'string' | 'number' | 'boolean' | 'object' | 'string-array' | 'number-array' | 'boolean-array';
|
|
34
35
|
interface ConfigReference {
|
|
35
|
-
type:
|
|
36
|
+
type: ConfigReferenceType;
|
|
36
37
|
path: string;
|
|
37
38
|
default?: string;
|
|
38
39
|
__isConfigReference: true;
|
|
@@ -42,12 +43,16 @@ declare function str(strings: TemplateStringsArray): ConfigReference;
|
|
|
42
43
|
declare function num(strings: TemplateStringsArray): ConfigReference;
|
|
43
44
|
declare function bool(strings: TemplateStringsArray): ConfigReference;
|
|
44
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;
|
|
45
49
|
|
|
46
50
|
declare class ConfigResolver {
|
|
47
51
|
static resolve(reference: ConfigReference): unknown;
|
|
48
52
|
private static loadFromEnv;
|
|
49
53
|
private static pathToEnvVar;
|
|
50
54
|
private static coerce;
|
|
55
|
+
private static parseArrayItems;
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
declare function resolveConfigReferences<T extends Record<string, any>>(config: T): T;
|
|
@@ -719,17 +724,34 @@ interface IMindsetIdentity {
|
|
|
719
724
|
personality?: string;
|
|
720
725
|
emotions?: string;
|
|
721
726
|
}
|
|
727
|
+
/** @deprecated use {@link IMindsetModelRef} */
|
|
722
728
|
interface IMindsetLlm {
|
|
723
729
|
provider?: string;
|
|
724
730
|
model: string;
|
|
725
731
|
}
|
|
732
|
+
interface IMindsetModelRef {
|
|
733
|
+
provider?: string;
|
|
734
|
+
model: string;
|
|
735
|
+
}
|
|
736
|
+
type IMindsetModelKind = 'llm' | 'visionLlm' | 'audioLlm' | 'speechToText' | 'textToSpeech' | 'imageGen' | 'embedding';
|
|
737
|
+
interface IMindsetModels {
|
|
738
|
+
llm?: IMindsetModelRef[];
|
|
739
|
+
visionLlm?: IMindsetModelRef[];
|
|
740
|
+
audioLlm?: IMindsetModelRef[];
|
|
741
|
+
speechToText?: IMindsetModelRef[];
|
|
742
|
+
textToSpeech?: IMindsetModelRef[];
|
|
743
|
+
imageGen?: IMindsetModelRef[];
|
|
744
|
+
embedding?: IMindsetModelRef[];
|
|
745
|
+
}
|
|
726
746
|
interface IMindset {
|
|
727
747
|
context(): Promise<string>;
|
|
728
748
|
identity(): Promise<IMindsetIdentity>;
|
|
729
749
|
skills(): Promise<string>;
|
|
730
750
|
limits(): Promise<string>;
|
|
731
751
|
workflow(): Promise<string>;
|
|
732
|
-
|
|
752
|
+
models?(): Promise<IMindsetModels>;
|
|
753
|
+
/** @deprecated implement {@link IMindset.models} instead */
|
|
754
|
+
llms?(): Promise<IMindsetLlm[]>;
|
|
733
755
|
}
|
|
734
756
|
declare class Mindset implements IMindset {
|
|
735
757
|
context(): Promise<string>;
|
|
@@ -737,7 +759,9 @@ declare class Mindset implements IMindset {
|
|
|
737
759
|
skills(): Promise<string>;
|
|
738
760
|
limits(): Promise<string>;
|
|
739
761
|
workflow(): Promise<string>;
|
|
740
|
-
|
|
762
|
+
models?(): Promise<IMindsetModels>;
|
|
763
|
+
/** @deprecated implement {@link Mindset.models} instead */
|
|
764
|
+
llms?(): Promise<IMindsetLlm[]>;
|
|
741
765
|
}
|
|
742
766
|
|
|
743
767
|
interface IMindsetConfig {
|
|
@@ -837,7 +861,10 @@ declare class MindsetOperator implements IMindset {
|
|
|
837
861
|
skills(): Promise<string>;
|
|
838
862
|
limits(): Promise<string>;
|
|
839
863
|
workflow(): Promise<string>;
|
|
864
|
+
/** @deprecated use {@link MindsetOperator.models} */
|
|
840
865
|
llms(): Promise<IMindsetLlm[]>;
|
|
866
|
+
models(): Promise<IMindsetModels>;
|
|
867
|
+
resolveModels(kind: IMindsetModelKind): Promise<IMindsetModelRef[]>;
|
|
841
868
|
systemPrompt(): Promise<string>;
|
|
842
869
|
tools(): IMindsetTool[];
|
|
843
870
|
protected paramDescription(rawDescription: string, rawType: string): string;
|
|
@@ -882,6 +909,7 @@ interface IFunctionCall {
|
|
|
882
909
|
name: string;
|
|
883
910
|
arguments?: string;
|
|
884
911
|
result?: string;
|
|
912
|
+
signature?: string;
|
|
885
913
|
}
|
|
886
914
|
|
|
887
915
|
declare const chatItemTypeOptions: readonly ["botMessage", "humanMessage", "functionCall"];
|
|
@@ -909,10 +937,15 @@ type IChatItemType = (typeof chatItemTypeOptions)[number];
|
|
|
909
937
|
interface ILanguageModelUsage {
|
|
910
938
|
inputTokens: number;
|
|
911
939
|
outputTokens: number;
|
|
940
|
+
cacheReadTokens?: number;
|
|
941
|
+
cacheWriteTokens?: number;
|
|
942
|
+
costUsd?: number;
|
|
943
|
+
provider?: string;
|
|
944
|
+
model?: string;
|
|
912
945
|
}
|
|
913
946
|
|
|
914
947
|
interface IChatAdapterNextItemsReq {
|
|
915
|
-
|
|
948
|
+
models: IMindsetModelRef[];
|
|
916
949
|
systemPrompt: string;
|
|
917
950
|
tools: IMindsetTool[];
|
|
918
951
|
prevItems: IChatItem[];
|
|
@@ -926,9 +959,16 @@ interface IChatAdapter {
|
|
|
926
959
|
}
|
|
927
960
|
|
|
928
961
|
declare class ChatAdapter implements IChatAdapter {
|
|
929
|
-
nextItems(req: IChatAdapterNextItemsReq
|
|
930
|
-
|
|
931
|
-
|
|
962
|
+
nextItems(req: IChatAdapterNextItemsReq): Promise<IChatAdapterNextItemsRes>;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
declare class ChatAdapterRegistry {
|
|
966
|
+
private adapters;
|
|
967
|
+
private order;
|
|
968
|
+
register(provider: string, adapter: IChatAdapter): void;
|
|
969
|
+
get(provider: string): IChatAdapter | undefined;
|
|
970
|
+
defaultProvider(): string | undefined;
|
|
971
|
+
size(): number;
|
|
932
972
|
}
|
|
933
973
|
|
|
934
974
|
type IChatItemData = IEntityData & IChatItem;
|
|
@@ -996,8 +1036,47 @@ declare class ChatOperator {
|
|
|
996
1036
|
removeAssociation(association: IChatAssociation): Promise<void>;
|
|
997
1037
|
}
|
|
998
1038
|
|
|
1039
|
+
declare class UnionChatAdapter implements IChatAdapter {
|
|
1040
|
+
private registry;
|
|
1041
|
+
private logger;
|
|
1042
|
+
constructor(registry: ChatAdapterRegistry);
|
|
1043
|
+
nextItems(req: IChatAdapterNextItemsReq): Promise<IChatAdapterNextItemsRes>;
|
|
1044
|
+
private groupByProvider;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
interface IExtractChatMessageTextOptions {
|
|
1048
|
+
supportedImageMimeTypes?: readonly string[];
|
|
1049
|
+
supportedDocumentMimeTypes?: readonly string[];
|
|
1050
|
+
}
|
|
1051
|
+
declare function extractChatMessageText(message: IChatMessage, options?: IExtractChatMessageTextOptions): string;
|
|
1052
|
+
|
|
1053
|
+
declare function isChatMessageEmpty(message: IChatMessage): boolean;
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* Returns true when an error from a chat adapter is worth retrying with another
|
|
1057
|
+
* model or another adapter (transient/availability issues), false when retrying
|
|
1058
|
+
* would just propagate the same configuration problem (auth, validation).
|
|
1059
|
+
*/
|
|
1060
|
+
declare function isRetryableError(err: unknown): boolean;
|
|
1061
|
+
|
|
1062
|
+
interface IChatAdapterDecoratorConfig {
|
|
1063
|
+
provider: string;
|
|
1064
|
+
}
|
|
1065
|
+
declare function chatAdapter(config: IChatAdapterDecoratorConfig): (target: IConstructor<IChatAdapter>) => void;
|
|
1066
|
+
|
|
999
1067
|
declare function chatBot(mindset: IConstructor<IMindset>): (target: object, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
|
|
1000
1068
|
|
|
1069
|
+
interface IChatAdapterMetadata {
|
|
1070
|
+
constructor: IConstructor<IChatAdapter>;
|
|
1071
|
+
provider: string;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
declare class ChatAdapterMetadataStore {
|
|
1075
|
+
private adapters;
|
|
1076
|
+
save(metadata: IChatAdapterMetadata): void;
|
|
1077
|
+
get(ctor: IConstructor<IChatAdapter>): IChatAdapterMetadata | undefined;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1001
1080
|
interface IChatBotMetadata {
|
|
1002
1081
|
constructor: IConstructor<any>;
|
|
1003
1082
|
mindsetConstructor: IConstructor<IMindset>;
|
|
@@ -1010,15 +1089,9 @@ declare class ChatBotMetadataStore {
|
|
|
1010
1089
|
getChatBotsMetadata(): IChatBotMetadata[];
|
|
1011
1090
|
}
|
|
1012
1091
|
|
|
1013
|
-
declare function
|
|
1014
|
-
|
|
1015
|
-
interface IExtractChatMessageTextOptions {
|
|
1016
|
-
supportedImageMimeTypes?: readonly string[];
|
|
1017
|
-
supportedDocumentMimeTypes?: readonly string[];
|
|
1018
|
-
}
|
|
1019
|
-
declare function extractChatMessageText(message: IChatMessage, options?: IExtractChatMessageTextOptions): string;
|
|
1092
|
+
declare function runChatAdapters(adapters: IConstructor<IChatAdapter>[]): void;
|
|
1020
1093
|
|
|
1021
|
-
declare function
|
|
1094
|
+
declare function safeJsonParse<T = unknown>(json: string | undefined | null, context?: string): T;
|
|
1022
1095
|
|
|
1023
1096
|
interface IchatControllerConfig {
|
|
1024
1097
|
}
|
|
@@ -1201,6 +1274,55 @@ declare const pgStorage: AsyncLocalStorage<ClientMap>;
|
|
|
1201
1274
|
*/
|
|
1202
1275
|
declare function getClientMap(): ClientMap;
|
|
1203
1276
|
|
|
1277
|
+
declare function pgJsonRepository<P extends Entity<IEntityData>>(config: IPgRepositoryConfig<P>): (target: IConstructor<any>) => void;
|
|
1278
|
+
|
|
1279
|
+
declare function query(): (target: object, propertyKey: string | symbol) => void;
|
|
1280
|
+
|
|
1281
|
+
declare class PgJsonRepository<P extends Entity<IEntityData>> extends PgCrudRepository<P> {
|
|
1282
|
+
constructor(pool: Pool);
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
interface IQueryMethodMetadata {
|
|
1286
|
+
repositoryConstructor: IConstructor<any>;
|
|
1287
|
+
functionName: string;
|
|
1288
|
+
}
|
|
1289
|
+
declare class PgRepositoryMetadataStore {
|
|
1290
|
+
private queryMethods;
|
|
1291
|
+
private repositoryConfigs;
|
|
1292
|
+
saveQueryMethodMetadata(metadata: IQueryMethodMetadata): void;
|
|
1293
|
+
saveRepositoryConfig<P extends Entity<IEntityData>>(ctor: IConstructor<any>, config: IPgRepositoryConfig<P>): void;
|
|
1294
|
+
getRepositoryConfig(ctor: IConstructor<any>): IPgRepositoryConfig<any> | undefined;
|
|
1295
|
+
getQueryMethods(ctor: IConstructor<any>): IQueryMethodMetadata[];
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
type QueryPrefix = 'find' | 'findOne' | 'count' | 'exists' | 'delete';
|
|
1299
|
+
type QueryOperator = 'Equals' | 'Not' | 'Like' | 'NotLike' | 'In' | 'NotIn' | 'Gt' | 'Gte' | 'Lt' | 'Lte' | 'IsNull' | 'IsNotNull';
|
|
1300
|
+
type QueryConnector = 'And' | 'Or';
|
|
1301
|
+
interface IQueryCondition {
|
|
1302
|
+
field: string;
|
|
1303
|
+
operator: QueryOperator;
|
|
1304
|
+
connector?: QueryConnector;
|
|
1305
|
+
}
|
|
1306
|
+
interface IQueryOrderBy {
|
|
1307
|
+
field: string;
|
|
1308
|
+
direction: 'ASC' | 'DESC';
|
|
1309
|
+
}
|
|
1310
|
+
interface IQueryAst {
|
|
1311
|
+
prefix: QueryPrefix;
|
|
1312
|
+
conditions: IQueryCondition[];
|
|
1313
|
+
orderBy: IQueryOrderBy[];
|
|
1314
|
+
limit?: number;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
interface IBuiltQuery {
|
|
1318
|
+
sql: string;
|
|
1319
|
+
argCount: number;
|
|
1320
|
+
buildParams: (args: any[]) => any[];
|
|
1321
|
+
}
|
|
1322
|
+
declare function buildQuerySql(ast: IQueryAst, table: string, columns: string): IBuiltQuery;
|
|
1323
|
+
|
|
1324
|
+
declare function parseQueryMethodName(name: string): IQueryAst;
|
|
1325
|
+
|
|
1204
1326
|
/**
|
|
1205
1327
|
* Runs a function with a shared Postgres client for the given pool.
|
|
1206
1328
|
* Reuses the client if already present in the async context.
|
|
@@ -2251,4 +2373,4 @@ declare function HtmlModule(options: IHtmlModuleOptions): {
|
|
|
2251
2373
|
new (): {};
|
|
2252
2374
|
};
|
|
2253
2375
|
|
|
2254
|
-
export { AnthropicChatAdapter, ApiKey, ApiKeyGuardMiddleware, ApiKeyHandshakeGuardMiddleware, ApiKeyRepository, Async, AsyncMetadataStore, Auth, Chat, ChatAdapter, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatOperator, ChatRepository, ChatResolver, type ClientMap, CmdChannel, type ConfigReference, 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 IChannelMessage, type IChannelMetadata, type IChatAdapter, 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 IMindsetModuleConfig, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IMoneyData, type IPersistentData, type IPgRepositoryConfig, type IPropertyValidatorInfo, 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, PgJwtRefreshTokenRepository, PgLockKey, PgLocker, PgRepositoryBase, PgWhatsAppRepository, RamChatMemory, RamChatRepository, Random, RemoteApiKeyRepository, RestControllerMetadataStore, RestRequest, SocketChannel, SocketChannelConfig, SocketChannelMessageFile, SocketChannelReceivedMessage, SocketControllerMetadataStore, SocketServerConfig, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, 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, 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, isString, jwtGuard, jwtHandshakeGuard, max, middleware, min, mindset, mindsetModule, modelInfo, num, obj, onDelete, onGet, onPost, onPut, onSocketEvent, pgStorage, readJsonFromFile, resolveConfigReferences, restController, runChatControllers, runCommandHandlers, runCronHandlers, runRestControllers, runSocketControllers, safeJsonParse, scoped, setupErrorHandlers, singleton, socket, socketChannelName, socketController, stopCommandHandlers, stopCronHandlers, str, telegram, telegramChannelName, validateAndTransform, validateArray, validateIsBoolean, validateIsDate, validateIsIn, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsRecord, validateIsString, validateMax, validateMin, validateModel, whatsApp, whatsAppByWasender, whatsAppByWasenderChannelName, whatsAppChannelName, withPgClient, withPgTransaction, writeJsonToFile };
|
|
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 };
|