@appaflytech/wappa-mcp 0.0.10 → 0.0.12
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/README.md +40 -0
- package/dist/auth.d.ts +25 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +35 -0
- package/dist/auth.js.map +1 -1
- package/dist/client.d.ts +39 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +159 -6
- package/dist/client.js.map +1 -1
- package/dist/factory.d.ts +32 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +286 -0
- package/dist/factory.js.map +1 -0
- package/dist/http/auth.d.ts +33 -0
- package/dist/http/auth.d.ts.map +1 -0
- package/dist/http/auth.js +55 -0
- package/dist/http/auth.js.map +1 -0
- package/dist/http/session.d.ts +30 -0
- package/dist/http/session.d.ts.map +1 -0
- package/dist/http/session.js +56 -0
- package/dist/http/session.js.map +1 -0
- package/dist/http/transport.d.ts +21 -0
- package/dist/http/transport.d.ts.map +1 -0
- package/dist/http/transport.js +101 -0
- package/dist/http/transport.js.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -262
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +25 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +94 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/ai-chat-sessions.d.ts +143 -0
- package/dist/tools/ai-chat-sessions.d.ts.map +1 -0
- package/dist/tools/ai-chat-sessions.js +144 -0
- package/dist/tools/ai-chat-sessions.js.map +1 -0
- package/dist/tools/app-users.d.ts +440 -0
- package/dist/tools/app-users.d.ts.map +1 -0
- package/dist/tools/app-users.js +347 -0
- package/dist/tools/app-users.js.map +1 -0
- package/dist/tools/component-categories.d.ts +157 -0
- package/dist/tools/component-categories.d.ts.map +1 -0
- package/dist/tools/component-categories.js +162 -0
- package/dist/tools/component-categories.js.map +1 -0
- package/dist/tools/countries.d.ts +148 -0
- package/dist/tools/countries.d.ts.map +1 -0
- package/dist/tools/countries.js +142 -0
- package/dist/tools/countries.js.map +1 -0
- package/dist/tools/db-routines.d.ts +229 -0
- package/dist/tools/db-routines.d.ts.map +1 -0
- package/dist/tools/db-routines.js +233 -0
- package/dist/tools/db-routines.js.map +1 -0
- package/dist/tools/dynamic-entities.d.ts +166 -0
- package/dist/tools/dynamic-entities.d.ts.map +1 -1
- package/dist/tools/dynamic-entities.js +156 -0
- package/dist/tools/dynamic-entities.js.map +1 -1
- package/dist/tools/entities.d.ts +119 -0
- package/dist/tools/entities.d.ts.map +1 -1
- package/dist/tools/entities.js +413 -4
- package/dist/tools/entities.js.map +1 -1
- package/dist/tools/error-logs.d.ts +67 -0
- package/dist/tools/error-logs.d.ts.map +1 -0
- package/dist/tools/error-logs.js +74 -0
- package/dist/tools/error-logs.js.map +1 -0
- package/dist/tools/general.d.ts.map +1 -1
- package/dist/tools/general.js +218 -0
- package/dist/tools/general.js.map +1 -1
- package/dist/tools/layouts.d.ts +21 -0
- package/dist/tools/layouts.d.ts.map +1 -1
- package/dist/tools/layouts.js +20 -2
- package/dist/tools/layouts.js.map +1 -1
- package/dist/tools/operations.d.ts +184 -0
- package/dist/tools/operations.d.ts.map +1 -0
- package/dist/tools/operations.js +217 -0
- package/dist/tools/operations.js.map +1 -0
- package/dist/tools/organizations.d.ts +178 -0
- package/dist/tools/organizations.d.ts.map +1 -0
- package/dist/tools/organizations.js +158 -0
- package/dist/tools/organizations.js.map +1 -0
- package/dist/tools/page-entities.d.ts +522 -0
- package/dist/tools/page-entities.d.ts.map +1 -0
- package/dist/tools/page-entities.js +535 -0
- package/dist/tools/page-entities.js.map +1 -0
- package/dist/tools/pages.d.ts +226 -0
- package/dist/tools/pages.d.ts.map +1 -1
- package/dist/tools/pages.js +473 -17
- package/dist/tools/pages.js.map +1 -1
- package/dist/tools/plans.d.ts +293 -0
- package/dist/tools/plans.d.ts.map +1 -0
- package/dist/tools/plans.js +213 -0
- package/dist/tools/plans.js.map +1 -0
- package/dist/tools/plugins.d.ts +230 -0
- package/dist/tools/plugins.d.ts.map +1 -0
- package/dist/tools/plugins.js +218 -0
- package/dist/tools/plugins.js.map +1 -0
- package/dist/tools/push-notifications.d.ts +261 -0
- package/dist/tools/push-notifications.d.ts.map +1 -0
- package/dist/tools/push-notifications.js +246 -0
- package/dist/tools/push-notifications.js.map +1 -0
- package/dist/tools/queries.d.ts +274 -0
- package/dist/tools/queries.d.ts.map +1 -1
- package/dist/tools/queries.js +319 -17
- package/dist/tools/queries.js.map +1 -1
- package/dist/tools/query-categories.d.ts +192 -0
- package/dist/tools/query-categories.d.ts.map +1 -0
- package/dist/tools/query-categories.js +204 -0
- package/dist/tools/query-categories.js.map +1 -0
- package/dist/tools/regions.d.ts +148 -0
- package/dist/tools/regions.d.ts.map +1 -0
- package/dist/tools/regions.js +148 -0
- package/dist/tools/regions.js.map +1 -0
- package/dist/tools/roles.d.ts +284 -0
- package/dist/tools/roles.d.ts.map +1 -0
- package/dist/tools/roles.js +291 -0
- package/dist/tools/roles.js.map +1 -0
- package/dist/tools/settings.d.ts +160 -0
- package/dist/tools/settings.d.ts.map +1 -0
- package/dist/tools/settings.js +187 -0
- package/dist/tools/settings.js.map +1 -0
- package/dist/tools/showcases.d.ts +184 -0
- package/dist/tools/showcases.d.ts.map +1 -0
- package/dist/tools/showcases.js +179 -0
- package/dist/tools/showcases.js.map +1 -0
- package/dist/tools/storage.d.ts +297 -0
- package/dist/tools/storage.d.ts.map +1 -0
- package/dist/tools/storage.js +302 -0
- package/dist/tools/storage.js.map +1 -0
- package/dist/tools/subscriptions.d.ts +166 -0
- package/dist/tools/subscriptions.d.ts.map +1 -0
- package/dist/tools/subscriptions.js +144 -0
- package/dist/tools/subscriptions.js.map +1 -0
- package/dist/tools/system-tools.d.ts +124 -0
- package/dist/tools/system-tools.d.ts.map +1 -0
- package/dist/tools/system-tools.js +147 -0
- package/dist/tools/system-tools.js.map +1 -0
- package/dist/tools/system-variables.d.ts +167 -0
- package/dist/tools/system-variables.d.ts.map +1 -0
- package/dist/tools/system-variables.js +176 -0
- package/dist/tools/system-variables.js.map +1 -0
- package/dist/tools/users.d.ts +266 -0
- package/dist/tools/users.d.ts.map +1 -0
- package/dist/tools/users.js +235 -0
- package/dist/tools/users.js.map +1 -0
- package/dist/tools/workflows.d.ts +278 -0
- package/dist/tools/workflows.d.ts.map +1 -0
- package/dist/tools/workflows.js +267 -0
- package/dist/tools/workflows.js.map +1 -0
- package/package.json +12 -3
package/dist/tools/queries.d.ts
CHANGED
|
@@ -126,6 +126,10 @@ export declare function getQueryTools(client: WapClient): {
|
|
|
126
126
|
type: string;
|
|
127
127
|
description: string;
|
|
128
128
|
};
|
|
129
|
+
queryMaps: {
|
|
130
|
+
type: string;
|
|
131
|
+
description: string;
|
|
132
|
+
};
|
|
129
133
|
cache: {
|
|
130
134
|
type: string;
|
|
131
135
|
description: string;
|
|
@@ -195,6 +199,10 @@ export declare function getQueryTools(client: WapClient): {
|
|
|
195
199
|
type: string;
|
|
196
200
|
description: string;
|
|
197
201
|
};
|
|
202
|
+
queryMaps: {
|
|
203
|
+
type: string;
|
|
204
|
+
description: string;
|
|
205
|
+
};
|
|
198
206
|
cache: {
|
|
199
207
|
type: string;
|
|
200
208
|
description: string;
|
|
@@ -238,5 +246,271 @@ export declare function getQueryTools(client: WapClient): {
|
|
|
238
246
|
}[];
|
|
239
247
|
}>;
|
|
240
248
|
};
|
|
249
|
+
get_query_map: {
|
|
250
|
+
description: string;
|
|
251
|
+
inputSchema: {
|
|
252
|
+
type: "object";
|
|
253
|
+
properties: {
|
|
254
|
+
id: {
|
|
255
|
+
type: string;
|
|
256
|
+
description: string;
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
required: string[];
|
|
260
|
+
};
|
|
261
|
+
handler: (args: {
|
|
262
|
+
id: string;
|
|
263
|
+
}) => Promise<{
|
|
264
|
+
content: {
|
|
265
|
+
type: "text";
|
|
266
|
+
text: string;
|
|
267
|
+
}[];
|
|
268
|
+
}>;
|
|
269
|
+
};
|
|
270
|
+
get_query_related_models: {
|
|
271
|
+
description: string;
|
|
272
|
+
inputSchema: {
|
|
273
|
+
type: "object";
|
|
274
|
+
properties: {
|
|
275
|
+
id: {
|
|
276
|
+
type: string;
|
|
277
|
+
description: string;
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
required: string[];
|
|
281
|
+
};
|
|
282
|
+
handler: (args: {
|
|
283
|
+
id: string;
|
|
284
|
+
}) => Promise<{
|
|
285
|
+
content: {
|
|
286
|
+
type: "text";
|
|
287
|
+
text: string;
|
|
288
|
+
}[];
|
|
289
|
+
}>;
|
|
290
|
+
};
|
|
291
|
+
preview_query: {
|
|
292
|
+
description: string;
|
|
293
|
+
inputSchema: {
|
|
294
|
+
type: "object";
|
|
295
|
+
properties: {
|
|
296
|
+
data: {
|
|
297
|
+
type: string;
|
|
298
|
+
description: string;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
required: string[];
|
|
302
|
+
};
|
|
303
|
+
handler: (args: {
|
|
304
|
+
data: Record<string, unknown>;
|
|
305
|
+
}) => Promise<{
|
|
306
|
+
content: {
|
|
307
|
+
type: "text";
|
|
308
|
+
text: string;
|
|
309
|
+
}[];
|
|
310
|
+
}>;
|
|
311
|
+
};
|
|
312
|
+
upsert_bulk_queries: {
|
|
313
|
+
description: string;
|
|
314
|
+
inputSchema: {
|
|
315
|
+
type: "object";
|
|
316
|
+
properties: {
|
|
317
|
+
queries: {
|
|
318
|
+
type: string;
|
|
319
|
+
description: string;
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
required: string[];
|
|
323
|
+
};
|
|
324
|
+
handler: (args: {
|
|
325
|
+
queries: unknown[];
|
|
326
|
+
}) => Promise<{
|
|
327
|
+
content: {
|
|
328
|
+
type: "text";
|
|
329
|
+
text: string;
|
|
330
|
+
}[];
|
|
331
|
+
}>;
|
|
332
|
+
};
|
|
333
|
+
ai_raw_query_generator: {
|
|
334
|
+
description: string;
|
|
335
|
+
inputSchema: {
|
|
336
|
+
type: "object";
|
|
337
|
+
properties: {
|
|
338
|
+
prompt: {
|
|
339
|
+
type: string;
|
|
340
|
+
description: string;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
required: string[];
|
|
344
|
+
};
|
|
345
|
+
handler: (args: {
|
|
346
|
+
prompt: string;
|
|
347
|
+
}) => Promise<{
|
|
348
|
+
content: {
|
|
349
|
+
type: "text";
|
|
350
|
+
text: string;
|
|
351
|
+
}[];
|
|
352
|
+
}>;
|
|
353
|
+
};
|
|
354
|
+
ai_raw_query_chat: {
|
|
355
|
+
description: string;
|
|
356
|
+
inputSchema: {
|
|
357
|
+
type: "object";
|
|
358
|
+
properties: {
|
|
359
|
+
messages: {
|
|
360
|
+
type: string;
|
|
361
|
+
description: string;
|
|
362
|
+
};
|
|
363
|
+
currentQuery: {
|
|
364
|
+
type: string;
|
|
365
|
+
description: string;
|
|
366
|
+
};
|
|
367
|
+
currentParameters: {
|
|
368
|
+
type: string;
|
|
369
|
+
description: string;
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
required: string[];
|
|
373
|
+
};
|
|
374
|
+
handler: (args: {
|
|
375
|
+
messages: Array<{
|
|
376
|
+
role: string;
|
|
377
|
+
content: string;
|
|
378
|
+
}>;
|
|
379
|
+
currentQuery?: string;
|
|
380
|
+
currentParameters?: string;
|
|
381
|
+
}) => Promise<{
|
|
382
|
+
content: {
|
|
383
|
+
type: "text";
|
|
384
|
+
text: string;
|
|
385
|
+
}[];
|
|
386
|
+
}>;
|
|
387
|
+
};
|
|
388
|
+
run_query_v2: {
|
|
389
|
+
description: string;
|
|
390
|
+
inputSchema: {
|
|
391
|
+
type: "object";
|
|
392
|
+
properties: {
|
|
393
|
+
name: {
|
|
394
|
+
type: string;
|
|
395
|
+
description: string;
|
|
396
|
+
};
|
|
397
|
+
queryParams: {
|
|
398
|
+
type: string;
|
|
399
|
+
description: string;
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
required: string[];
|
|
403
|
+
};
|
|
404
|
+
handler: (args: {
|
|
405
|
+
name: string;
|
|
406
|
+
queryParams?: Record<string, string>;
|
|
407
|
+
}) => Promise<{
|
|
408
|
+
content: {
|
|
409
|
+
type: "text";
|
|
410
|
+
text: string;
|
|
411
|
+
}[];
|
|
412
|
+
}>;
|
|
413
|
+
};
|
|
414
|
+
run_query_with_body: {
|
|
415
|
+
description: string;
|
|
416
|
+
inputSchema: {
|
|
417
|
+
type: "object";
|
|
418
|
+
properties: {
|
|
419
|
+
name: {
|
|
420
|
+
type: string;
|
|
421
|
+
description: string;
|
|
422
|
+
};
|
|
423
|
+
parameters: {
|
|
424
|
+
type: string;
|
|
425
|
+
description: string;
|
|
426
|
+
};
|
|
427
|
+
columns: {
|
|
428
|
+
type: string;
|
|
429
|
+
description: string;
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
required: string[];
|
|
433
|
+
};
|
|
434
|
+
handler: (args: {
|
|
435
|
+
name: string;
|
|
436
|
+
parameters?: Record<string, unknown> | null;
|
|
437
|
+
columns?: unknown[];
|
|
438
|
+
}) => Promise<{
|
|
439
|
+
content: {
|
|
440
|
+
type: "text";
|
|
441
|
+
text: string;
|
|
442
|
+
}[];
|
|
443
|
+
}>;
|
|
444
|
+
};
|
|
445
|
+
preview_query_v2: {
|
|
446
|
+
description: string;
|
|
447
|
+
inputSchema: {
|
|
448
|
+
type: "object";
|
|
449
|
+
properties: {
|
|
450
|
+
data: {
|
|
451
|
+
type: string;
|
|
452
|
+
description: string;
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
required: string[];
|
|
456
|
+
};
|
|
457
|
+
handler: (args: {
|
|
458
|
+
data: Record<string, unknown>;
|
|
459
|
+
}) => Promise<{
|
|
460
|
+
content: {
|
|
461
|
+
type: "text";
|
|
462
|
+
text: string;
|
|
463
|
+
}[];
|
|
464
|
+
}>;
|
|
465
|
+
};
|
|
466
|
+
run_query_form: {
|
|
467
|
+
description: string;
|
|
468
|
+
inputSchema: {
|
|
469
|
+
type: "object";
|
|
470
|
+
properties: {
|
|
471
|
+
name: {
|
|
472
|
+
type: string;
|
|
473
|
+
description: string;
|
|
474
|
+
};
|
|
475
|
+
files: {
|
|
476
|
+
type: string;
|
|
477
|
+
description: string;
|
|
478
|
+
};
|
|
479
|
+
columns: {
|
|
480
|
+
type: string;
|
|
481
|
+
description: string;
|
|
482
|
+
};
|
|
483
|
+
pairing: {
|
|
484
|
+
type: string;
|
|
485
|
+
description: string;
|
|
486
|
+
};
|
|
487
|
+
parameters: {
|
|
488
|
+
type: string;
|
|
489
|
+
description: string;
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
required: string[];
|
|
493
|
+
};
|
|
494
|
+
handler: (args: {
|
|
495
|
+
name: string;
|
|
496
|
+
files: Array<{
|
|
497
|
+
filename: string;
|
|
498
|
+
contentBase64?: string;
|
|
499
|
+
contentType?: string;
|
|
500
|
+
path?: string;
|
|
501
|
+
}>;
|
|
502
|
+
columns?: unknown[];
|
|
503
|
+
pairing?: Array<{
|
|
504
|
+
Column: string;
|
|
505
|
+
Filename: string;
|
|
506
|
+
}>;
|
|
507
|
+
parameters?: Record<string, unknown>;
|
|
508
|
+
}) => Promise<{
|
|
509
|
+
content: {
|
|
510
|
+
type: "text";
|
|
511
|
+
text: string;
|
|
512
|
+
}[];
|
|
513
|
+
}>;
|
|
514
|
+
};
|
|
241
515
|
};
|
|
242
516
|
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/tools/queries.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsBnB;YACpB,IAAI,CAAC,EAAE,MAAM,C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AO,CAAC,EAAE,KAAK,CAAC;gBAAE,MAAM,EAAE,MAAM,CAAC;gBAAC,QAAQ,EAAE,MAAM,CAAA;aAAE,CAAC,CAAC;YACtD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;SACtC;;;;;;;EA8CN"}
|
package/dist/tools/queries.js
CHANGED
|
@@ -34,8 +34,7 @@ export function getQueryTools(client) {
|
|
|
34
34
|
params.type = args.type;
|
|
35
35
|
if (args.pageIndex !== undefined)
|
|
36
36
|
params.pageIndex = String(args.pageIndex);
|
|
37
|
-
|
|
38
|
-
params.pageLength = String(args.pageLength);
|
|
37
|
+
params.pageLength = String(args.pageLength ?? 200);
|
|
39
38
|
const result = await client.getQueries(params);
|
|
40
39
|
return {
|
|
41
40
|
content: [
|
|
@@ -132,6 +131,10 @@ export function getQueryTools(client) {
|
|
|
132
131
|
type: "array",
|
|
133
132
|
description: "Query parametre tanımları: [{ name, type, defaultValue }]",
|
|
134
133
|
},
|
|
134
|
+
queryMaps: {
|
|
135
|
+
type: "array",
|
|
136
|
+
description: "Mevcut query sonuç kolonlarının alias ve type eşleştirmeleri. Örn: [{ name: 'Image', type: 'image', alias: 'img', path: 'img', isMultiple: false }]"
|
|
137
|
+
},
|
|
135
138
|
cache: {
|
|
136
139
|
type: "object",
|
|
137
140
|
description: "Önbellekleme: { enabled: bool, durationSeconds: number }",
|
|
@@ -164,6 +167,7 @@ export function getQueryTools(client) {
|
|
|
164
167
|
// tolerates empty lists better than nulls
|
|
165
168
|
httpMethod: "get",
|
|
166
169
|
parameters: [],
|
|
170
|
+
queryMaps: [],
|
|
167
171
|
rawQueryMap: [],
|
|
168
172
|
...incoming,
|
|
169
173
|
type,
|
|
@@ -206,6 +210,7 @@ export function getQueryTools(client) {
|
|
|
206
210
|
description: 'Yanıt biçimi (non-raw): { type: "single" | "multiple" }',
|
|
207
211
|
},
|
|
208
212
|
parameters: { type: "array", description: "Parametre tanımları" },
|
|
213
|
+
queryMaps: { type: "array", description: "Query kolon eşleştirmeleri" },
|
|
209
214
|
cache: { type: "object", description: "Önbellekleme ayarları" },
|
|
210
215
|
transformTemplate: {
|
|
211
216
|
type: "string",
|
|
@@ -229,21 +234,30 @@ export function getQueryTools(client) {
|
|
|
229
234
|
catch {
|
|
230
235
|
/* fall through with empty base */
|
|
231
236
|
}
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
237
|
+
const hasCurrent = current &&
|
|
238
|
+
typeof current === "object" &&
|
|
239
|
+
Object.keys(current).length > 0;
|
|
240
|
+
const data = hasCurrent
|
|
241
|
+
? {
|
|
242
|
+
name: current.name ?? current.Name,
|
|
243
|
+
title: current.title ?? current.Title,
|
|
244
|
+
type: current.type ?? current.Type,
|
|
245
|
+
rawQuery: current.rawQuery ?? current.RawQuery,
|
|
246
|
+
schema: current.schema ?? current.Schema,
|
|
247
|
+
response: current.response ?? current.Response,
|
|
248
|
+
parameters: current.parameters ?? current.Parameters,
|
|
249
|
+
rawQueryMap: current.rawQueryMap ?? current.RawQueryMap,
|
|
250
|
+
cache: current.cache ?? current.Cache,
|
|
251
|
+
transformTemplate: current.transformTemplate ?? current.TransformTemplate,
|
|
252
|
+
httpMethod: current.httpMethod ?? current.HttpMethod,
|
|
253
|
+
categoryId: current.categoryId ?? current.CategoryId,
|
|
254
|
+
...patch,
|
|
255
|
+
}
|
|
256
|
+
: { ...patch };
|
|
257
|
+
for (const key of Object.keys(data)) {
|
|
258
|
+
if (data[key] === undefined)
|
|
259
|
+
delete data[key];
|
|
260
|
+
}
|
|
247
261
|
// Apply the same raw-query defaults used by create_query so the
|
|
248
262
|
// backend's QueryAggregate constructor doesn't blow up on nulls.
|
|
249
263
|
if (data.type === "raw") {
|
|
@@ -283,6 +297,294 @@ export function getQueryTools(client) {
|
|
|
283
297
|
};
|
|
284
298
|
},
|
|
285
299
|
},
|
|
300
|
+
// ─── Get Query Map ────────────────────────────────────
|
|
301
|
+
get_query_map: {
|
|
302
|
+
description: "Bir query'nin response (sonuç) kolon haritasını getirir. Her kolonun name/path/alias/type bilgisini içerir. Widget/component alanlarını query sonucuna bağlarken kullanılır.",
|
|
303
|
+
inputSchema: {
|
|
304
|
+
type: "object",
|
|
305
|
+
properties: {
|
|
306
|
+
id: { type: "string", description: "Query ID (GUID)" },
|
|
307
|
+
},
|
|
308
|
+
required: ["id"],
|
|
309
|
+
},
|
|
310
|
+
handler: async (args) => {
|
|
311
|
+
const result = await client.request("GET", `/{site}/Queries/${args.id}/query-map`);
|
|
312
|
+
return {
|
|
313
|
+
content: [
|
|
314
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
315
|
+
],
|
|
316
|
+
};
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
// ─── Get Query Related Models ─────────────────────────
|
|
320
|
+
get_query_related_models: {
|
|
321
|
+
description: "Bir query'nin ilişkili olduğu modelleri getirir: bu query'yi kullanan entity'ler, layout'lar ve sayfalar. Query silmeden önce bağımlılıkları görmek için kullanılır.",
|
|
322
|
+
inputSchema: {
|
|
323
|
+
type: "object",
|
|
324
|
+
properties: {
|
|
325
|
+
id: { type: "string", description: "Query ID (GUID)" },
|
|
326
|
+
},
|
|
327
|
+
required: ["id"],
|
|
328
|
+
},
|
|
329
|
+
handler: async (args) => {
|
|
330
|
+
const result = await client.request("GET", `/{site}/Queries/${args.id}/related-models`);
|
|
331
|
+
return {
|
|
332
|
+
content: [
|
|
333
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
334
|
+
],
|
|
335
|
+
};
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
// ─── Preview Query ────────────────────────────────────
|
|
339
|
+
preview_query: {
|
|
340
|
+
description: `Bir query tanımını KAYDETMEDEN çalıştırıp önizler. Henüz oluşturulmamış/güncellenmemiş bir query payload'ını test etmek için kullanılır.
|
|
341
|
+
'data': Tam query gövdesi (create_query ile aynı alanlar): { name, title, type, rawQuery?, schema?, response?, parameters?, cache?, transformTemplate?, isCustomTransformTemplate?, version? }.`,
|
|
342
|
+
inputSchema: {
|
|
343
|
+
type: "object",
|
|
344
|
+
properties: {
|
|
345
|
+
data: {
|
|
346
|
+
type: "object",
|
|
347
|
+
description: "Önizlenecek tam query gövdesi: { name, title, type, rawQuery?, schema?, response?, parameters?, cache?, transformTemplate?, isCustomTransformTemplate?, version? }",
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
required: ["data"],
|
|
351
|
+
},
|
|
352
|
+
handler: async (args) => {
|
|
353
|
+
const result = await client.request("POST", "/{site}/Queries/preview", args.data);
|
|
354
|
+
return {
|
|
355
|
+
content: [
|
|
356
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
357
|
+
],
|
|
358
|
+
};
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
// ─── Upsert Bulk Queries ──────────────────────────────
|
|
362
|
+
upsert_bulk_queries: {
|
|
363
|
+
description: "Birden fazla query'yi tek istekte toplu olarak ekler/günceller (upsert). 'queries': query gövdelerinden oluşan dizi (her biri create_query ile aynı alanları içerir).",
|
|
364
|
+
inputSchema: {
|
|
365
|
+
type: "object",
|
|
366
|
+
properties: {
|
|
367
|
+
queries: {
|
|
368
|
+
type: "array",
|
|
369
|
+
description: "Eklenecek/güncellenecek query gövdeleri dizisi. Her eleman: { name, title, type, rawQuery?, schema?, response?, parameters?, cache?, ... }",
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
required: ["queries"],
|
|
373
|
+
},
|
|
374
|
+
handler: async (args) => {
|
|
375
|
+
const result = await client.upsertBulkQueries(args.queries);
|
|
376
|
+
return {
|
|
377
|
+
content: [
|
|
378
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
379
|
+
],
|
|
380
|
+
};
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
// ─── AI Raw SQL Generator ─────────────────────────────
|
|
384
|
+
ai_raw_query_generator: {
|
|
385
|
+
description: "AI ile doğal dil prompt'undan ham (raw) SQL sorgusu üretir. Üretilen sorgu, parametreler ve süre bilgilerini döndürür. Sıfırdan SQL yazmak için kullanılır.",
|
|
386
|
+
inputSchema: {
|
|
387
|
+
type: "object",
|
|
388
|
+
properties: {
|
|
389
|
+
prompt: {
|
|
390
|
+
type: "string",
|
|
391
|
+
description: 'Doğal dil açıklaması (örn: "Son 30 günde oluşturulan aktif kullanıcıları listele")',
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
required: ["prompt"],
|
|
395
|
+
},
|
|
396
|
+
handler: async (args) => {
|
|
397
|
+
const result = await client.request("POST", "/{site}/Queries/ai-raw-generator", { prompt: args.prompt });
|
|
398
|
+
return {
|
|
399
|
+
content: [
|
|
400
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
401
|
+
],
|
|
402
|
+
};
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
// ─── AI Raw SQL Chat ──────────────────────────────────
|
|
406
|
+
ai_raw_query_chat: {
|
|
407
|
+
description: `AI ile sohbet ederek mevcut ham (raw) SQL sorgusunu iyileştirir/değiştirir. Konuşma geçmişi ve mevcut sorgu bağlamıyla yeni sorgu önerir.
|
|
408
|
+
'messages': Sohbet geçmişi [{ role: "user" | "assistant", content }].
|
|
409
|
+
'currentQuery': Üzerinde çalışılan mevcut SQL sorgusu.
|
|
410
|
+
'currentParameters': Mevcut sorgu parametreleri (string).`,
|
|
411
|
+
inputSchema: {
|
|
412
|
+
type: "object",
|
|
413
|
+
properties: {
|
|
414
|
+
messages: {
|
|
415
|
+
type: "array",
|
|
416
|
+
description: 'Sohbet mesajları dizisi: [{ role: "user" | "assistant", content: string }]',
|
|
417
|
+
},
|
|
418
|
+
currentQuery: {
|
|
419
|
+
type: "string",
|
|
420
|
+
description: "Üzerinde çalışılan mevcut SQL sorgusu",
|
|
421
|
+
},
|
|
422
|
+
currentParameters: {
|
|
423
|
+
type: "string",
|
|
424
|
+
description: "Mevcut sorgu parametreleri (string olarak)",
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
required: ["messages"],
|
|
428
|
+
},
|
|
429
|
+
handler: async (args) => {
|
|
430
|
+
const result = await client.request("POST", "/{site}/Queries/ai-raw-chat", {
|
|
431
|
+
messages: args.messages,
|
|
432
|
+
currentQuery: args.currentQuery ?? "",
|
|
433
|
+
currentParameters: args.currentParameters ?? "",
|
|
434
|
+
});
|
|
435
|
+
return {
|
|
436
|
+
content: [
|
|
437
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
438
|
+
],
|
|
439
|
+
};
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
// ─── Run Query (v2) ───────────────────────────────────
|
|
443
|
+
run_query_v2: {
|
|
444
|
+
description: "Kayıtlı bir query'yi v2 motoruyla çalıştırır (GET {name}/run-v2). 'queryParams' ile sorgu parametreleri geçirilir. Standart çalıştırma için wappa_run_query kullanın; v2 yalnızca yeni sorgu motoru gerekiyorsa.",
|
|
445
|
+
inputSchema: {
|
|
446
|
+
type: "object",
|
|
447
|
+
properties: {
|
|
448
|
+
name: { type: "string", description: "Çalıştırılacak query adı" },
|
|
449
|
+
queryParams: {
|
|
450
|
+
type: "object",
|
|
451
|
+
description: "Sorgu parametreleri (key-value)",
|
|
452
|
+
},
|
|
453
|
+
},
|
|
454
|
+
required: ["name"],
|
|
455
|
+
},
|
|
456
|
+
handler: async (args) => {
|
|
457
|
+
const result = await client.request("GET", `/{site}/Queries/${args.name}/run-v2`, undefined, args.queryParams);
|
|
458
|
+
return {
|
|
459
|
+
content: [
|
|
460
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
461
|
+
],
|
|
462
|
+
};
|
|
463
|
+
},
|
|
464
|
+
},
|
|
465
|
+
// ─── Run Query with Body ──────────────────────────────
|
|
466
|
+
run_query_with_body: {
|
|
467
|
+
description: `Kayıtlı bir query'yi gövde (body) ile çalıştırır (POST {name}/run). Parametreleri ve kolon eşleştirmelerini gövdede gönderir — dosya OLMADAN dinamik kayıt oluşturma/çalıştırma için. Dosya gerekiyorsa wappa_run_query_form kullanın.
|
|
468
|
+
'parameters': Sorgu parametreleri objesi (key-value).
|
|
469
|
+
'columns': Dinamik entity kolon değerleri dizisi (örn: [{ name, data: { value, refs } }]).`,
|
|
470
|
+
inputSchema: {
|
|
471
|
+
type: "object",
|
|
472
|
+
properties: {
|
|
473
|
+
name: { type: "string", description: "Çalıştırılacak query adı" },
|
|
474
|
+
parameters: {
|
|
475
|
+
type: "object",
|
|
476
|
+
description: "Sorgu parametreleri (key-value). Yoksa null gönderilir.",
|
|
477
|
+
},
|
|
478
|
+
columns: {
|
|
479
|
+
type: "array",
|
|
480
|
+
description: "Dinamik kolon değerleri: [{ name, data: { value, refs, columns? } }]",
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
required: ["name"],
|
|
484
|
+
},
|
|
485
|
+
handler: async (args) => {
|
|
486
|
+
const result = await client.request("POST", `/{site}/Queries/${args.name}/run`, {
|
|
487
|
+
parameters: args.parameters ?? null,
|
|
488
|
+
columns: args.columns ?? [],
|
|
489
|
+
});
|
|
490
|
+
return {
|
|
491
|
+
content: [
|
|
492
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
493
|
+
],
|
|
494
|
+
};
|
|
495
|
+
},
|
|
496
|
+
},
|
|
497
|
+
// ─── Preview Query (v2) ───────────────────────────────
|
|
498
|
+
preview_query_v2: {
|
|
499
|
+
description: "Bir query tanımını v2 motoruyla kaydetmeden önizler/çalıştırır (POST preview-v2). Tam query gövdesini 'data' objesinde alır. Standart önizleme için wappa_preview_query kullanın.",
|
|
500
|
+
inputSchema: {
|
|
501
|
+
type: "object",
|
|
502
|
+
properties: {
|
|
503
|
+
data: {
|
|
504
|
+
type: "object",
|
|
505
|
+
description: "Önizlenecek query tanımı (PreviewQueryRequest gövdesi: source, expressions, parameters vb.)",
|
|
506
|
+
},
|
|
507
|
+
},
|
|
508
|
+
required: ["data"],
|
|
509
|
+
},
|
|
510
|
+
handler: async (args) => {
|
|
511
|
+
const result = await client.request("POST", "/{site}/Queries/preview-v2", args.data);
|
|
512
|
+
return {
|
|
513
|
+
content: [
|
|
514
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
515
|
+
],
|
|
516
|
+
};
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
// ─── Run Query (form / file upload) ───────────────────
|
|
520
|
+
run_query_form: {
|
|
521
|
+
description: `Kayıtlı bir query'yi DOSYA YÜKLEYEREK çalıştırır (POST {name}/run-form, multipart/form-data). Dosya ekli dinamik kayıt oluşturmak için kullanılır (örn: resimli form gönderimi — 'dert' uygulamasındaki gibi).
|
|
522
|
+
Form alanları backend'e 'dert' istemcisiyle birebir aynı formatta gönderilir: dosyalar 'files' parçası olarak; 'columns' ve 'pairing' JSON string olarak.
|
|
523
|
+
'files': Yüklenecek dosyalar — her biri { filename, contentBase64, contentType? } VEYA { filename, path } (yerel dosya yolu okunur). Birden fazla dosya verilebilir.
|
|
524
|
+
'columns': Dinamik kolon değerleri dizisi (örn: [{ name: "resim", data: { refs: [], value: "" } }]).
|
|
525
|
+
'pairing': Dosya↔kolon eşleştirmesi: [{ Column: "resim", Filename: "<dosya adı>" }].
|
|
526
|
+
'parameters': (Opsiyonel) sorgu parametreleri objesi.`,
|
|
527
|
+
inputSchema: {
|
|
528
|
+
type: "object",
|
|
529
|
+
properties: {
|
|
530
|
+
name: {
|
|
531
|
+
type: "string",
|
|
532
|
+
description: 'Çalıştırılacak query adı (örn: "create-app-dertlistesi")',
|
|
533
|
+
},
|
|
534
|
+
files: {
|
|
535
|
+
type: "array",
|
|
536
|
+
description: "Yüklenecek dosyalar: [{ filename, contentBase64, contentType? }] veya [{ filename, path }]",
|
|
537
|
+
},
|
|
538
|
+
columns: {
|
|
539
|
+
type: "array",
|
|
540
|
+
description: "Dinamik kolon değerleri: [{ name, data: { value, refs } }] (JSON string olarak gönderilir)",
|
|
541
|
+
},
|
|
542
|
+
pairing: {
|
|
543
|
+
type: "array",
|
|
544
|
+
description: 'Dosya↔kolon eşleştirmesi: [{ Column: "resim", Filename: "foto.jpg" }] (JSON string olarak gönderilir)',
|
|
545
|
+
},
|
|
546
|
+
parameters: {
|
|
547
|
+
type: "object",
|
|
548
|
+
description: "Opsiyonel sorgu parametreleri (key-value)",
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
required: ["name", "files"],
|
|
552
|
+
},
|
|
553
|
+
handler: async (args) => {
|
|
554
|
+
// Resolve any local file paths to base64 (so the client only deals with base64).
|
|
555
|
+
const { readFile } = await import("node:fs/promises");
|
|
556
|
+
const files = [];
|
|
557
|
+
for (const f of args.files ?? []) {
|
|
558
|
+
let contentBase64 = f.contentBase64;
|
|
559
|
+
if (!contentBase64 && f.path) {
|
|
560
|
+
const buf = await readFile(f.path);
|
|
561
|
+
contentBase64 = buf.toString("base64");
|
|
562
|
+
}
|
|
563
|
+
if (!contentBase64) {
|
|
564
|
+
throw new Error(`Dosya '${f.filename}' için contentBase64 veya path verilmedi`);
|
|
565
|
+
}
|
|
566
|
+
files.push({
|
|
567
|
+
filename: f.filename,
|
|
568
|
+
contentBase64,
|
|
569
|
+
contentType: f.contentType,
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
// Mirror the dert client form field shape exactly.
|
|
573
|
+
const fields = {};
|
|
574
|
+
if (args.columns !== undefined)
|
|
575
|
+
fields.columns = args.columns;
|
|
576
|
+
if (args.pairing !== undefined)
|
|
577
|
+
fields.pairing = args.pairing;
|
|
578
|
+
if (args.parameters !== undefined)
|
|
579
|
+
fields.parameters = args.parameters;
|
|
580
|
+
const result = await client.requestMultipart("POST", `/{site}/Queries/${args.name}/run-form`, fields, files);
|
|
581
|
+
return {
|
|
582
|
+
content: [
|
|
583
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
584
|
+
],
|
|
585
|
+
};
|
|
586
|
+
},
|
|
587
|
+
},
|
|
286
588
|
};
|
|
287
589
|
}
|
|
288
590
|
//# sourceMappingURL=queries.js.map
|