@bytebase/dbhub 0.4.7 → 0.4.8
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/index.js +10 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2481,6 +2481,12 @@ function getSqliteInMemorySetupSql() {
|
|
|
2481
2481
|
import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2482
2482
|
|
|
2483
2483
|
// src/utils/response-formatter.ts
|
|
2484
|
+
function bigIntReplacer(_key, value) {
|
|
2485
|
+
if (typeof value === "bigint") {
|
|
2486
|
+
return value.toString();
|
|
2487
|
+
}
|
|
2488
|
+
return value;
|
|
2489
|
+
}
|
|
2484
2490
|
function formatSuccessResponse(data, meta = {}) {
|
|
2485
2491
|
return {
|
|
2486
2492
|
success: true,
|
|
@@ -2501,7 +2507,7 @@ function createToolErrorResponse(error, code = "ERROR", details) {
|
|
|
2501
2507
|
content: [
|
|
2502
2508
|
{
|
|
2503
2509
|
type: "text",
|
|
2504
|
-
text: JSON.stringify(formatErrorResponse(error, code, details),
|
|
2510
|
+
text: JSON.stringify(formatErrorResponse(error, code, details), bigIntReplacer, 2),
|
|
2505
2511
|
mimeType: "application/json"
|
|
2506
2512
|
}
|
|
2507
2513
|
],
|
|
@@ -2513,7 +2519,7 @@ function createToolSuccessResponse(data, meta = {}) {
|
|
|
2513
2519
|
content: [
|
|
2514
2520
|
{
|
|
2515
2521
|
type: "text",
|
|
2516
|
-
text: JSON.stringify(formatSuccessResponse(data, meta),
|
|
2522
|
+
text: JSON.stringify(formatSuccessResponse(data, meta), bigIntReplacer, 2),
|
|
2517
2523
|
mimeType: "application/json"
|
|
2518
2524
|
}
|
|
2519
2525
|
]
|
|
@@ -2524,7 +2530,7 @@ function createResourceErrorResponse(uri, error, code = "ERROR", details) {
|
|
|
2524
2530
|
contents: [
|
|
2525
2531
|
{
|
|
2526
2532
|
uri,
|
|
2527
|
-
text: JSON.stringify(formatErrorResponse(error, code, details),
|
|
2533
|
+
text: JSON.stringify(formatErrorResponse(error, code, details), bigIntReplacer, 2),
|
|
2528
2534
|
mimeType: "application/json"
|
|
2529
2535
|
}
|
|
2530
2536
|
]
|
|
@@ -2535,7 +2541,7 @@ function createResourceSuccessResponse(uri, data, meta = {}) {
|
|
|
2535
2541
|
contents: [
|
|
2536
2542
|
{
|
|
2537
2543
|
uri,
|
|
2538
|
-
text: JSON.stringify(formatSuccessResponse(data, meta),
|
|
2544
|
+
text: JSON.stringify(formatSuccessResponse(data, meta), bigIntReplacer, 2),
|
|
2539
2545
|
mimeType: "application/json"
|
|
2540
2546
|
}
|
|
2541
2547
|
]
|