@settlemint/sdk-mcp 2.1.3 → 2.1.4-main0ca0d06f
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/mcp.js +382 -57
- package/dist/mcp.js.map +9 -9
- package/package.json +4 -4
package/dist/mcp.js
CHANGED
|
@@ -30543,7 +30543,7 @@ var require_webcrypto = __commonJS((exports) => {
|
|
|
30543
30543
|
exports.gcm = /* @__PURE__ */ (() => generate(mode.GCM))();
|
|
30544
30544
|
});
|
|
30545
30545
|
|
|
30546
|
-
// ../../node_modules/@noble/hashes/_assert.js
|
|
30546
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/_assert.js
|
|
30547
30547
|
var require__assert2 = __commonJS((exports) => {
|
|
30548
30548
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30549
30549
|
exports.anumber = anumber;
|
|
@@ -30585,7 +30585,7 @@ var require__assert2 = __commonJS((exports) => {
|
|
|
30585
30585
|
}
|
|
30586
30586
|
});
|
|
30587
30587
|
|
|
30588
|
-
// ../../node_modules/@noble/hashes/cryptoNode.js
|
|
30588
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/cryptoNode.js
|
|
30589
30589
|
var require_cryptoNode2 = __commonJS((exports) => {
|
|
30590
30590
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30591
30591
|
exports.crypto = undefined;
|
|
@@ -30593,7 +30593,7 @@ var require_cryptoNode2 = __commonJS((exports) => {
|
|
|
30593
30593
|
exports.crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
|
|
30594
30594
|
});
|
|
30595
30595
|
|
|
30596
|
-
// ../../node_modules/@noble/hashes/utils.js
|
|
30596
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/utils.js
|
|
30597
30597
|
var require_utils8 = __commonJS((exports) => {
|
|
30598
30598
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
30599
30599
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -30772,7 +30772,7 @@ var require_utils8 = __commonJS((exports) => {
|
|
|
30772
30772
|
}
|
|
30773
30773
|
});
|
|
30774
30774
|
|
|
30775
|
-
// ../../node_modules/@noble/hashes/_md.js
|
|
30775
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/_md.js
|
|
30776
30776
|
var require__md = __commonJS((exports) => {
|
|
30777
30777
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30778
30778
|
exports.HashMD = undefined;
|
|
@@ -30889,7 +30889,7 @@ var require__md = __commonJS((exports) => {
|
|
|
30889
30889
|
exports.HashMD = HashMD;
|
|
30890
30890
|
});
|
|
30891
30891
|
|
|
30892
|
-
// ../../node_modules/@noble/hashes/_u64.js
|
|
30892
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/_u64.js
|
|
30893
30893
|
var require__u64 = __commonJS((exports) => {
|
|
30894
30894
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30895
30895
|
exports.add5L = exports.add5H = exports.add4H = exports.add4L = exports.add3H = exports.add3L = exports.rotlBL = exports.rotlBH = exports.rotlSL = exports.rotlSH = exports.rotr32L = exports.rotr32H = exports.rotrBL = exports.rotrBH = exports.rotrSL = exports.rotrSH = exports.shrSL = exports.shrSH = exports.toBig = undefined;
|
|
@@ -30981,7 +30981,7 @@ var require__u64 = __commonJS((exports) => {
|
|
|
30981
30981
|
exports.default = u64;
|
|
30982
30982
|
});
|
|
30983
30983
|
|
|
30984
|
-
// ../../node_modules/@noble/hashes/sha512.js
|
|
30984
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/sha512.js
|
|
30985
30985
|
var require_sha512 = __commonJS((exports) => {
|
|
30986
30986
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30987
30987
|
exports.sha384 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.SHA384 = exports.SHA512_256 = exports.SHA512_224 = exports.SHA512 = undefined;
|
|
@@ -31262,7 +31262,7 @@ var require_sha512 = __commonJS((exports) => {
|
|
|
31262
31262
|
exports.sha384 = (0, utils_js_1.wrapConstructor)(() => new SHA384);
|
|
31263
31263
|
});
|
|
31264
31264
|
|
|
31265
|
-
// ../../node_modules/@noble/curves/abstract/utils.js
|
|
31265
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/utils.js
|
|
31266
31266
|
var require_utils9 = __commonJS((exports) => {
|
|
31267
31267
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
31268
31268
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -31532,7 +31532,7 @@ var require_utils9 = __commonJS((exports) => {
|
|
|
31532
31532
|
}
|
|
31533
31533
|
});
|
|
31534
31534
|
|
|
31535
|
-
// ../../node_modules/@noble/curves/abstract/modular.js
|
|
31535
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/modular.js
|
|
31536
31536
|
var require_modular = __commonJS((exports) => {
|
|
31537
31537
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31538
31538
|
exports.isNegativeLE = undefined;
|
|
@@ -31867,7 +31867,7 @@ var require_modular = __commonJS((exports) => {
|
|
|
31867
31867
|
}
|
|
31868
31868
|
});
|
|
31869
31869
|
|
|
31870
|
-
// ../../node_modules/@noble/curves/abstract/curve.js
|
|
31870
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/curve.js
|
|
31871
31871
|
var require_curve = __commonJS((exports) => {
|
|
31872
31872
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31873
31873
|
exports.wNAF = wNAF;
|
|
@@ -32109,7 +32109,7 @@ var require_curve = __commonJS((exports) => {
|
|
|
32109
32109
|
}
|
|
32110
32110
|
});
|
|
32111
32111
|
|
|
32112
|
-
// ../../node_modules/@noble/curves/abstract/edwards.js
|
|
32112
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/edwards.js
|
|
32113
32113
|
var require_edwards = __commonJS((exports) => {
|
|
32114
32114
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32115
32115
|
exports.twistedEdwards = twistedEdwards;
|
|
@@ -32471,7 +32471,7 @@ var require_edwards = __commonJS((exports) => {
|
|
|
32471
32471
|
}
|
|
32472
32472
|
});
|
|
32473
32473
|
|
|
32474
|
-
// ../../node_modules/@noble/curves/abstract/hash-to-curve.js
|
|
32474
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/hash-to-curve.js
|
|
32475
32475
|
var require_hash_to_curve = __commonJS((exports) => {
|
|
32476
32476
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32477
32477
|
exports.expand_message_xmd = expand_message_xmd;
|
|
@@ -32618,7 +32618,7 @@ var require_hash_to_curve = __commonJS((exports) => {
|
|
|
32618
32618
|
}
|
|
32619
32619
|
});
|
|
32620
32620
|
|
|
32621
|
-
// ../../node_modules/@noble/curves/abstract/montgomery.js
|
|
32621
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/montgomery.js
|
|
32622
32622
|
var require_montgomery = __commonJS((exports) => {
|
|
32623
32623
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32624
32624
|
exports.montgomery = montgomery;
|
|
@@ -32743,7 +32743,7 @@ var require_montgomery = __commonJS((exports) => {
|
|
|
32743
32743
|
}
|
|
32744
32744
|
});
|
|
32745
32745
|
|
|
32746
|
-
// ../../node_modules/@noble/curves/ed25519.js
|
|
32746
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/ed25519.js
|
|
32747
32747
|
var require_ed25519 = __commonJS((exports) => {
|
|
32748
32748
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32749
32749
|
exports.hash_to_ristretto255 = exports.hashToRistretto255 = exports.RistrettoPoint = exports.encodeToCurve = exports.hashToCurve = exports.edwardsToMontgomery = exports.x25519 = exports.ed25519ph = exports.ed25519ctx = exports.ed25519 = exports.ED25519_TORSION_SUBGROUP = undefined;
|
|
@@ -33110,7 +33110,7 @@ var require_ed25519 = __commonJS((exports) => {
|
|
|
33110
33110
|
exports.hash_to_ristretto255 = exports.hashToRistretto255;
|
|
33111
33111
|
});
|
|
33112
33112
|
|
|
33113
|
-
// ../../node_modules/@noble/hashes/sha256.js
|
|
33113
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/sha256.js
|
|
33114
33114
|
var require_sha256 = __commonJS((exports) => {
|
|
33115
33115
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33116
33116
|
exports.sha224 = exports.sha256 = exports.SHA256 = undefined;
|
|
@@ -33283,7 +33283,7 @@ var require_sha256 = __commonJS((exports) => {
|
|
|
33283
33283
|
exports.sha224 = (0, utils_js_1.wrapConstructor)(() => new SHA224);
|
|
33284
33284
|
});
|
|
33285
33285
|
|
|
33286
|
-
// ../../node_modules/@noble/hashes/hmac.js
|
|
33286
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/hmac.js
|
|
33287
33287
|
var require_hmac = __commonJS((exports) => {
|
|
33288
33288
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33289
33289
|
exports.hmac = exports.HMAC = undefined;
|
|
@@ -33357,7 +33357,7 @@ var require_hmac = __commonJS((exports) => {
|
|
|
33357
33357
|
exports.hmac.create = (hash, key) => new HMAC(hash, key);
|
|
33358
33358
|
});
|
|
33359
33359
|
|
|
33360
|
-
// ../../node_modules/@noble/curves/abstract/weierstrass.js
|
|
33360
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/abstract/weierstrass.js
|
|
33361
33361
|
var require_weierstrass = __commonJS((exports) => {
|
|
33362
33362
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33363
33363
|
exports.DER = exports.DERErr = undefined;
|
|
@@ -34264,7 +34264,7 @@ var require_weierstrass = __commonJS((exports) => {
|
|
|
34264
34264
|
}
|
|
34265
34265
|
});
|
|
34266
34266
|
|
|
34267
|
-
// ../../node_modules/@noble/curves/_shortw_utils.js
|
|
34267
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/_shortw_utils.js
|
|
34268
34268
|
var require__shortw_utils = __commonJS((exports) => {
|
|
34269
34269
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34270
34270
|
exports.getHash = getHash;
|
|
@@ -34286,7 +34286,7 @@ var require__shortw_utils = __commonJS((exports) => {
|
|
|
34286
34286
|
}
|
|
34287
34287
|
});
|
|
34288
34288
|
|
|
34289
|
-
// ../../node_modules/@noble/curves/secp256k1.js
|
|
34289
|
+
// ../../node_modules/eciesjs/node_modules/@noble/curves/secp256k1.js
|
|
34290
34290
|
var require_secp256k1 = __commonJS((exports) => {
|
|
34291
34291
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34292
34292
|
exports.encodeToCurve = exports.hashToCurve = exports.schnorr = exports.secp256k1 = undefined;
|
|
@@ -34612,7 +34612,7 @@ var require_elliptic = __commonJS((exports) => {
|
|
|
34612
34612
|
};
|
|
34613
34613
|
});
|
|
34614
34614
|
|
|
34615
|
-
// ../../node_modules/@noble/hashes/hkdf.js
|
|
34615
|
+
// ../../node_modules/eciesjs/node_modules/@noble/hashes/hkdf.js
|
|
34616
34616
|
var require_hkdf = __commonJS((exports) => {
|
|
34617
34617
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34618
34618
|
exports.hkdf = undefined;
|
|
@@ -54595,14 +54595,17 @@ var JSONRPCRequestSchema = z.object({
|
|
|
54595
54595
|
jsonrpc: z.literal(JSONRPC_VERSION),
|
|
54596
54596
|
id: RequestIdSchema
|
|
54597
54597
|
}).merge(RequestSchema).strict();
|
|
54598
|
+
var isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
|
|
54598
54599
|
var JSONRPCNotificationSchema = z.object({
|
|
54599
54600
|
jsonrpc: z.literal(JSONRPC_VERSION)
|
|
54600
54601
|
}).merge(NotificationSchema).strict();
|
|
54602
|
+
var isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
|
|
54601
54603
|
var JSONRPCResponseSchema = z.object({
|
|
54602
54604
|
jsonrpc: z.literal(JSONRPC_VERSION),
|
|
54603
54605
|
id: RequestIdSchema,
|
|
54604
54606
|
result: ResultSchema
|
|
54605
54607
|
}).strict();
|
|
54608
|
+
var isJSONRPCResponse = (value) => JSONRPCResponseSchema.safeParse(value).success;
|
|
54606
54609
|
var ErrorCode;
|
|
54607
54610
|
(function(ErrorCode2) {
|
|
54608
54611
|
ErrorCode2[ErrorCode2["ConnectionClosed"] = -32000] = "ConnectionClosed";
|
|
@@ -54622,6 +54625,7 @@ var JSONRPCErrorSchema = z.object({
|
|
|
54622
54625
|
data: z.optional(z.unknown())
|
|
54623
54626
|
})
|
|
54624
54627
|
}).strict();
|
|
54628
|
+
var isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success;
|
|
54625
54629
|
var JSONRPCMessageSchema = z.union([
|
|
54626
54630
|
JSONRPCRequestSchema,
|
|
54627
54631
|
JSONRPCNotificationSchema,
|
|
@@ -55072,13 +55076,15 @@ class Protocol {
|
|
|
55072
55076
|
this._transport.onerror = (error) => {
|
|
55073
55077
|
this._onerror(error);
|
|
55074
55078
|
};
|
|
55075
|
-
this._transport.onmessage = (message) => {
|
|
55076
|
-
if (
|
|
55079
|
+
this._transport.onmessage = (message, extra) => {
|
|
55080
|
+
if (isJSONRPCResponse(message) || isJSONRPCError(message)) {
|
|
55077
55081
|
this._onresponse(message);
|
|
55078
|
-
} else if (
|
|
55079
|
-
this._onrequest(message);
|
|
55080
|
-
} else {
|
|
55082
|
+
} else if (isJSONRPCRequest(message)) {
|
|
55083
|
+
this._onrequest(message, extra);
|
|
55084
|
+
} else if (isJSONRPCNotification(message)) {
|
|
55081
55085
|
this._onnotification(message);
|
|
55086
|
+
} else {
|
|
55087
|
+
this._onerror(new Error(`Unknown message type: ${JSON.stringify(message)}`));
|
|
55082
55088
|
}
|
|
55083
55089
|
};
|
|
55084
55090
|
await this._transport.start();
|
|
@@ -55107,7 +55113,7 @@ class Protocol {
|
|
|
55107
55113
|
}
|
|
55108
55114
|
Promise.resolve().then(() => handler(notification)).catch((error) => this._onerror(new Error(`Uncaught error in notification handler: ${error}`)));
|
|
55109
55115
|
}
|
|
55110
|
-
_onrequest(request) {
|
|
55116
|
+
_onrequest(request, extra) {
|
|
55111
55117
|
var _a, _b, _c;
|
|
55112
55118
|
const handler = (_a = this._requestHandlers.get(request.method)) !== null && _a !== undefined ? _a : this.fallbackRequestHandler;
|
|
55113
55119
|
if (handler === undefined) {
|
|
@@ -55123,11 +55129,14 @@ class Protocol {
|
|
|
55123
55129
|
}
|
|
55124
55130
|
const abortController = new AbortController;
|
|
55125
55131
|
this._requestHandlerAbortControllers.set(request.id, abortController);
|
|
55126
|
-
const
|
|
55132
|
+
const fullExtra = {
|
|
55127
55133
|
signal: abortController.signal,
|
|
55128
|
-
sessionId: (_c = this._transport) === null || _c === undefined ? undefined : _c.sessionId
|
|
55134
|
+
sessionId: (_c = this._transport) === null || _c === undefined ? undefined : _c.sessionId,
|
|
55135
|
+
sendNotification: (notification) => this.notification(notification, { relatedRequestId: request.id }),
|
|
55136
|
+
sendRequest: (r, resultSchema, options) => this.request(r, resultSchema, { ...options, relatedRequestId: request.id }),
|
|
55137
|
+
authInfo: extra === null || extra === undefined ? undefined : extra.authInfo
|
|
55129
55138
|
};
|
|
55130
|
-
Promise.resolve().then(() => handler(request,
|
|
55139
|
+
Promise.resolve().then(() => handler(request, fullExtra)).then((result) => {
|
|
55131
55140
|
var _a2;
|
|
55132
55141
|
if (abortController.signal.aborted) {
|
|
55133
55142
|
return;
|
|
@@ -55184,7 +55193,7 @@ class Protocol {
|
|
|
55184
55193
|
this._responseHandlers.delete(messageId);
|
|
55185
55194
|
this._progressHandlers.delete(messageId);
|
|
55186
55195
|
this._cleanupTimeout(messageId);
|
|
55187
|
-
if (
|
|
55196
|
+
if (isJSONRPCResponse(response)) {
|
|
55188
55197
|
handler(response);
|
|
55189
55198
|
} else {
|
|
55190
55199
|
const error = new McpError(response.error.code, response.error.message, response.error.data);
|
|
@@ -55199,6 +55208,7 @@ class Protocol {
|
|
|
55199
55208
|
await ((_a = this._transport) === null || _a === undefined ? undefined : _a.close());
|
|
55200
55209
|
}
|
|
55201
55210
|
request(request, resultSchema, options) {
|
|
55211
|
+
const { relatedRequestId, resumptionToken, onresumptiontoken } = options !== null && options !== undefined ? options : {};
|
|
55202
55212
|
return new Promise((resolve, reject2) => {
|
|
55203
55213
|
var _a, _b, _c, _d, _e;
|
|
55204
55214
|
if (!this._transport) {
|
|
@@ -55234,7 +55244,7 @@ class Protocol {
|
|
|
55234
55244
|
requestId: messageId,
|
|
55235
55245
|
reason: String(reason)
|
|
55236
55246
|
}
|
|
55237
|
-
}).catch((error) => this._onerror(new Error(`Failed to send cancellation: ${error}`)));
|
|
55247
|
+
}, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error) => this._onerror(new Error(`Failed to send cancellation: ${error}`)));
|
|
55238
55248
|
reject2(reason);
|
|
55239
55249
|
};
|
|
55240
55250
|
this._responseHandlers.set(messageId, (response) => {
|
|
@@ -55259,13 +55269,13 @@ class Protocol {
|
|
|
55259
55269
|
const timeout = (_d = options === null || options === undefined ? undefined : options.timeout) !== null && _d !== undefined ? _d : DEFAULT_REQUEST_TIMEOUT_MSEC;
|
|
55260
55270
|
const timeoutHandler = () => cancel(new McpError(ErrorCode.RequestTimeout, "Request timed out", { timeout }));
|
|
55261
55271
|
this._setupTimeout(messageId, timeout, options === null || options === undefined ? undefined : options.maxTotalTimeout, timeoutHandler, (_e = options === null || options === undefined ? undefined : options.resetTimeoutOnProgress) !== null && _e !== undefined ? _e : false);
|
|
55262
|
-
this._transport.send(jsonrpcRequest).catch((error) => {
|
|
55272
|
+
this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error) => {
|
|
55263
55273
|
this._cleanupTimeout(messageId);
|
|
55264
55274
|
reject2(error);
|
|
55265
55275
|
});
|
|
55266
55276
|
});
|
|
55267
55277
|
}
|
|
55268
|
-
async notification(notification) {
|
|
55278
|
+
async notification(notification, options) {
|
|
55269
55279
|
if (!this._transport) {
|
|
55270
55280
|
throw new Error("Not connected");
|
|
55271
55281
|
}
|
|
@@ -55274,12 +55284,14 @@ class Protocol {
|
|
|
55274
55284
|
...notification,
|
|
55275
55285
|
jsonrpc: "2.0"
|
|
55276
55286
|
};
|
|
55277
|
-
await this._transport.send(jsonrpcNotification);
|
|
55287
|
+
await this._transport.send(jsonrpcNotification, options);
|
|
55278
55288
|
}
|
|
55279
55289
|
setRequestHandler(requestSchema, handler) {
|
|
55280
55290
|
const method = requestSchema.shape.method.value;
|
|
55281
55291
|
this.assertRequestHandlerCapability(method);
|
|
55282
|
-
this._requestHandlers.set(method, (request, extra) =>
|
|
55292
|
+
this._requestHandlers.set(method, (request, extra) => {
|
|
55293
|
+
return Promise.resolve(handler(requestSchema.parse(request), extra));
|
|
55294
|
+
});
|
|
55283
55295
|
}
|
|
55284
55296
|
removeRequestHandler(method) {
|
|
55285
55297
|
this._requestHandlers.delete(method);
|
|
@@ -56741,10 +56753,12 @@ class McpServer {
|
|
|
56741
56753
|
this.server.assertCanSetRequestHandler(ListToolsRequestSchema.shape.method.value);
|
|
56742
56754
|
this.server.assertCanSetRequestHandler(CallToolRequestSchema.shape.method.value);
|
|
56743
56755
|
this.server.registerCapabilities({
|
|
56744
|
-
tools: {
|
|
56756
|
+
tools: {
|
|
56757
|
+
listChanged: true
|
|
56758
|
+
}
|
|
56745
56759
|
});
|
|
56746
56760
|
this.server.setRequestHandler(ListToolsRequestSchema, () => ({
|
|
56747
|
-
tools: Object.entries(this._registeredTools).map(([name, tool]) => {
|
|
56761
|
+
tools: Object.entries(this._registeredTools).filter(([, tool]) => tool.enabled).map(([name, tool]) => {
|
|
56748
56762
|
return {
|
|
56749
56763
|
name,
|
|
56750
56764
|
description: tool.description,
|
|
@@ -56759,6 +56773,9 @@ class McpServer {
|
|
|
56759
56773
|
if (!tool) {
|
|
56760
56774
|
throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} not found`);
|
|
56761
56775
|
}
|
|
56776
|
+
if (!tool.enabled) {
|
|
56777
|
+
throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} disabled`);
|
|
56778
|
+
}
|
|
56762
56779
|
if (tool.inputSchema) {
|
|
56763
56780
|
const parseResult = await tool.inputSchema.safeParseAsync(request.params.arguments);
|
|
56764
56781
|
if (!parseResult.success) {
|
|
@@ -56818,7 +56835,10 @@ class McpServer {
|
|
|
56818
56835
|
async handlePromptCompletion(request, ref) {
|
|
56819
56836
|
const prompt = this._registeredPrompts[ref.name];
|
|
56820
56837
|
if (!prompt) {
|
|
56821
|
-
throw new McpError(ErrorCode.InvalidParams, `Prompt ${
|
|
56838
|
+
throw new McpError(ErrorCode.InvalidParams, `Prompt ${ref.name} not found`);
|
|
56839
|
+
}
|
|
56840
|
+
if (!prompt.enabled) {
|
|
56841
|
+
throw new McpError(ErrorCode.InvalidParams, `Prompt ${ref.name} disabled`);
|
|
56822
56842
|
}
|
|
56823
56843
|
if (!prompt.argsSchema) {
|
|
56824
56844
|
return EMPTY_COMPLETION_RESULT;
|
|
@@ -56854,10 +56874,12 @@ class McpServer {
|
|
|
56854
56874
|
this.server.assertCanSetRequestHandler(ListResourceTemplatesRequestSchema.shape.method.value);
|
|
56855
56875
|
this.server.assertCanSetRequestHandler(ReadResourceRequestSchema.shape.method.value);
|
|
56856
56876
|
this.server.registerCapabilities({
|
|
56857
|
-
resources: {
|
|
56877
|
+
resources: {
|
|
56878
|
+
listChanged: true
|
|
56879
|
+
}
|
|
56858
56880
|
});
|
|
56859
56881
|
this.server.setRequestHandler(ListResourcesRequestSchema, async (request, extra) => {
|
|
56860
|
-
const resources = Object.entries(this._registeredResources).map(([uri, resource]) => ({
|
|
56882
|
+
const resources = Object.entries(this._registeredResources).filter(([_, resource]) => resource.enabled).map(([uri, resource]) => ({
|
|
56861
56883
|
uri,
|
|
56862
56884
|
name: resource.name,
|
|
56863
56885
|
...resource.metadata
|
|
@@ -56889,6 +56911,9 @@ class McpServer {
|
|
|
56889
56911
|
const uri = new URL(request.params.uri);
|
|
56890
56912
|
const resource = this._registeredResources[uri.toString()];
|
|
56891
56913
|
if (resource) {
|
|
56914
|
+
if (!resource.enabled) {
|
|
56915
|
+
throw new McpError(ErrorCode.InvalidParams, `Resource ${uri} disabled`);
|
|
56916
|
+
}
|
|
56892
56917
|
return resource.readCallback(uri, extra);
|
|
56893
56918
|
}
|
|
56894
56919
|
for (const template of Object.values(this._registeredResourceTemplates)) {
|
|
@@ -56909,10 +56934,12 @@ class McpServer {
|
|
|
56909
56934
|
this.server.assertCanSetRequestHandler(ListPromptsRequestSchema.shape.method.value);
|
|
56910
56935
|
this.server.assertCanSetRequestHandler(GetPromptRequestSchema.shape.method.value);
|
|
56911
56936
|
this.server.registerCapabilities({
|
|
56912
|
-
prompts: {
|
|
56937
|
+
prompts: {
|
|
56938
|
+
listChanged: true
|
|
56939
|
+
}
|
|
56913
56940
|
});
|
|
56914
56941
|
this.server.setRequestHandler(ListPromptsRequestSchema, () => ({
|
|
56915
|
-
prompts: Object.entries(this._registeredPrompts).map(([name, prompt]) => {
|
|
56942
|
+
prompts: Object.entries(this._registeredPrompts).filter(([, prompt]) => prompt.enabled).map(([name, prompt]) => {
|
|
56916
56943
|
return {
|
|
56917
56944
|
name,
|
|
56918
56945
|
description: prompt.description,
|
|
@@ -56925,6 +56952,9 @@ class McpServer {
|
|
|
56925
56952
|
if (!prompt) {
|
|
56926
56953
|
throw new McpError(ErrorCode.InvalidParams, `Prompt ${request.params.name} not found`);
|
|
56927
56954
|
}
|
|
56955
|
+
if (!prompt.enabled) {
|
|
56956
|
+
throw new McpError(ErrorCode.InvalidParams, `Prompt ${request.params.name} disabled`);
|
|
56957
|
+
}
|
|
56928
56958
|
if (prompt.argsSchema) {
|
|
56929
56959
|
const parseResult = await prompt.argsSchema.safeParseAsync(request.params.arguments);
|
|
56930
56960
|
if (!parseResult.success) {
|
|
@@ -56951,22 +56981,69 @@ class McpServer {
|
|
|
56951
56981
|
if (this._registeredResources[uriOrTemplate]) {
|
|
56952
56982
|
throw new Error(`Resource ${uriOrTemplate} is already registered`);
|
|
56953
56983
|
}
|
|
56954
|
-
|
|
56984
|
+
const registeredResource = {
|
|
56955
56985
|
name,
|
|
56956
56986
|
metadata,
|
|
56957
|
-
readCallback
|
|
56987
|
+
readCallback,
|
|
56988
|
+
enabled: true,
|
|
56989
|
+
disable: () => registeredResource.update({ enabled: false }),
|
|
56990
|
+
enable: () => registeredResource.update({ enabled: true }),
|
|
56991
|
+
remove: () => registeredResource.update({ uri: null }),
|
|
56992
|
+
update: (updates) => {
|
|
56993
|
+
if (typeof updates.uri !== "undefined" && updates.uri !== uriOrTemplate) {
|
|
56994
|
+
delete this._registeredResources[uriOrTemplate];
|
|
56995
|
+
if (updates.uri)
|
|
56996
|
+
this._registeredResources[updates.uri] = registeredResource;
|
|
56997
|
+
}
|
|
56998
|
+
if (typeof updates.name !== "undefined")
|
|
56999
|
+
registeredResource.name = updates.name;
|
|
57000
|
+
if (typeof updates.metadata !== "undefined")
|
|
57001
|
+
registeredResource.metadata = updates.metadata;
|
|
57002
|
+
if (typeof updates.callback !== "undefined")
|
|
57003
|
+
registeredResource.readCallback = updates.callback;
|
|
57004
|
+
if (typeof updates.enabled !== "undefined")
|
|
57005
|
+
registeredResource.enabled = updates.enabled;
|
|
57006
|
+
this.sendResourceListChanged();
|
|
57007
|
+
}
|
|
56958
57008
|
};
|
|
57009
|
+
this._registeredResources[uriOrTemplate] = registeredResource;
|
|
57010
|
+
this.setResourceRequestHandlers();
|
|
57011
|
+
this.sendResourceListChanged();
|
|
57012
|
+
return registeredResource;
|
|
56959
57013
|
} else {
|
|
56960
57014
|
if (this._registeredResourceTemplates[name]) {
|
|
56961
57015
|
throw new Error(`Resource template ${name} is already registered`);
|
|
56962
57016
|
}
|
|
56963
|
-
|
|
57017
|
+
const registeredResourceTemplate = {
|
|
56964
57018
|
resourceTemplate: uriOrTemplate,
|
|
56965
57019
|
metadata,
|
|
56966
|
-
readCallback
|
|
57020
|
+
readCallback,
|
|
57021
|
+
enabled: true,
|
|
57022
|
+
disable: () => registeredResourceTemplate.update({ enabled: false }),
|
|
57023
|
+
enable: () => registeredResourceTemplate.update({ enabled: true }),
|
|
57024
|
+
remove: () => registeredResourceTemplate.update({ name: null }),
|
|
57025
|
+
update: (updates) => {
|
|
57026
|
+
if (typeof updates.name !== "undefined" && updates.name !== name) {
|
|
57027
|
+
delete this._registeredResourceTemplates[name];
|
|
57028
|
+
if (updates.name)
|
|
57029
|
+
this._registeredResourceTemplates[updates.name] = registeredResourceTemplate;
|
|
57030
|
+
}
|
|
57031
|
+
if (typeof updates.template !== "undefined")
|
|
57032
|
+
registeredResourceTemplate.resourceTemplate = updates.template;
|
|
57033
|
+
if (typeof updates.metadata !== "undefined")
|
|
57034
|
+
registeredResourceTemplate.metadata = updates.metadata;
|
|
57035
|
+
if (typeof updates.callback !== "undefined")
|
|
57036
|
+
registeredResourceTemplate.readCallback = updates.callback;
|
|
57037
|
+
if (typeof updates.enabled !== "undefined")
|
|
57038
|
+
registeredResourceTemplate.enabled = updates.enabled;
|
|
57039
|
+
this.sendResourceListChanged();
|
|
57040
|
+
}
|
|
56967
57041
|
};
|
|
57042
|
+
this._registeredResourceTemplates[name] = registeredResourceTemplate;
|
|
57043
|
+
this.setResourceRequestHandlers();
|
|
57044
|
+
this.sendResourceListChanged();
|
|
57045
|
+
return registeredResourceTemplate;
|
|
56968
57046
|
}
|
|
56969
|
-
this.setResourceRequestHandlers();
|
|
56970
57047
|
}
|
|
56971
57048
|
tool(name, ...rest) {
|
|
56972
57049
|
if (this._registeredTools[name]) {
|
|
@@ -56981,12 +57058,35 @@ class McpServer {
|
|
|
56981
57058
|
paramsSchema = rest.shift();
|
|
56982
57059
|
}
|
|
56983
57060
|
const cb = rest[0];
|
|
56984
|
-
|
|
57061
|
+
const registeredTool = {
|
|
56985
57062
|
description,
|
|
56986
57063
|
inputSchema: paramsSchema === undefined ? undefined : z.object(paramsSchema),
|
|
56987
|
-
callback: cb
|
|
57064
|
+
callback: cb,
|
|
57065
|
+
enabled: true,
|
|
57066
|
+
disable: () => registeredTool.update({ enabled: false }),
|
|
57067
|
+
enable: () => registeredTool.update({ enabled: true }),
|
|
57068
|
+
remove: () => registeredTool.update({ name: null }),
|
|
57069
|
+
update: (updates) => {
|
|
57070
|
+
if (typeof updates.name !== "undefined" && updates.name !== name) {
|
|
57071
|
+
delete this._registeredTools[name];
|
|
57072
|
+
if (updates.name)
|
|
57073
|
+
this._registeredTools[updates.name] = registeredTool;
|
|
57074
|
+
}
|
|
57075
|
+
if (typeof updates.description !== "undefined")
|
|
57076
|
+
registeredTool.description = updates.description;
|
|
57077
|
+
if (typeof updates.paramsSchema !== "undefined")
|
|
57078
|
+
registeredTool.inputSchema = z.object(updates.paramsSchema);
|
|
57079
|
+
if (typeof updates.callback !== "undefined")
|
|
57080
|
+
registeredTool.callback = updates.callback;
|
|
57081
|
+
if (typeof updates.enabled !== "undefined")
|
|
57082
|
+
registeredTool.enabled = updates.enabled;
|
|
57083
|
+
this.sendToolListChanged();
|
|
57084
|
+
}
|
|
56988
57085
|
};
|
|
57086
|
+
this._registeredTools[name] = registeredTool;
|
|
56989
57087
|
this.setToolRequestHandlers();
|
|
57088
|
+
this.sendToolListChanged();
|
|
57089
|
+
return registeredTool;
|
|
56990
57090
|
}
|
|
56991
57091
|
prompt(name, ...rest) {
|
|
56992
57092
|
if (this._registeredPrompts[name]) {
|
|
@@ -57001,12 +57101,53 @@ class McpServer {
|
|
|
57001
57101
|
argsSchema = rest.shift();
|
|
57002
57102
|
}
|
|
57003
57103
|
const cb = rest[0];
|
|
57004
|
-
|
|
57104
|
+
const registeredPrompt = {
|
|
57005
57105
|
description,
|
|
57006
57106
|
argsSchema: argsSchema === undefined ? undefined : z.object(argsSchema),
|
|
57007
|
-
callback: cb
|
|
57107
|
+
callback: cb,
|
|
57108
|
+
enabled: true,
|
|
57109
|
+
disable: () => registeredPrompt.update({ enabled: false }),
|
|
57110
|
+
enable: () => registeredPrompt.update({ enabled: true }),
|
|
57111
|
+
remove: () => registeredPrompt.update({ name: null }),
|
|
57112
|
+
update: (updates) => {
|
|
57113
|
+
if (typeof updates.name !== "undefined" && updates.name !== name) {
|
|
57114
|
+
delete this._registeredPrompts[name];
|
|
57115
|
+
if (updates.name)
|
|
57116
|
+
this._registeredPrompts[updates.name] = registeredPrompt;
|
|
57117
|
+
}
|
|
57118
|
+
if (typeof updates.description !== "undefined")
|
|
57119
|
+
registeredPrompt.description = updates.description;
|
|
57120
|
+
if (typeof updates.argsSchema !== "undefined")
|
|
57121
|
+
registeredPrompt.argsSchema = z.object(updates.argsSchema);
|
|
57122
|
+
if (typeof updates.callback !== "undefined")
|
|
57123
|
+
registeredPrompt.callback = updates.callback;
|
|
57124
|
+
if (typeof updates.enabled !== "undefined")
|
|
57125
|
+
registeredPrompt.enabled = updates.enabled;
|
|
57126
|
+
this.sendPromptListChanged();
|
|
57127
|
+
}
|
|
57008
57128
|
};
|
|
57129
|
+
this._registeredPrompts[name] = registeredPrompt;
|
|
57009
57130
|
this.setPromptRequestHandlers();
|
|
57131
|
+
this.sendPromptListChanged();
|
|
57132
|
+
return registeredPrompt;
|
|
57133
|
+
}
|
|
57134
|
+
isConnected() {
|
|
57135
|
+
return this.server.transport !== undefined;
|
|
57136
|
+
}
|
|
57137
|
+
sendResourceListChanged() {
|
|
57138
|
+
if (this.isConnected()) {
|
|
57139
|
+
this.server.sendResourceListChanged();
|
|
57140
|
+
}
|
|
57141
|
+
}
|
|
57142
|
+
sendToolListChanged() {
|
|
57143
|
+
if (this.isConnected()) {
|
|
57144
|
+
this.server.sendToolListChanged();
|
|
57145
|
+
}
|
|
57146
|
+
}
|
|
57147
|
+
sendPromptListChanged() {
|
|
57148
|
+
if (this.isConnected()) {
|
|
57149
|
+
this.server.sendPromptListChanged();
|
|
57150
|
+
}
|
|
57010
57151
|
}
|
|
57011
57152
|
}
|
|
57012
57153
|
var EMPTY_OBJECT_JSON_SCHEMA = {
|
|
@@ -62534,8 +62675,11 @@ var DotEnvSchema = z.object({
|
|
|
62534
62675
|
SETTLEMINT_WORKSPACE: UniqueNameSchema.optional(),
|
|
62535
62676
|
SETTLEMINT_APPLICATION: UniqueNameSchema.optional(),
|
|
62536
62677
|
SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema.optional(),
|
|
62678
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID: z.string().optional(),
|
|
62537
62679
|
SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema.optional(),
|
|
62538
|
-
|
|
62680
|
+
SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT: UrlSchema.optional(),
|
|
62681
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: UniqueNameSchema.optional(),
|
|
62682
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT: UrlSchema.optional(),
|
|
62539
62683
|
SETTLEMINT_HASURA: UniqueNameSchema.optional(),
|
|
62540
62684
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema.optional(),
|
|
62541
62685
|
SETTLEMINT_HASURA_ADMIN_SECRET: z.string().optional(),
|
|
@@ -62639,8 +62783,11 @@ var DotEnvSchema2 = z.object({
|
|
|
62639
62783
|
SETTLEMINT_WORKSPACE: UniqueNameSchema2.optional(),
|
|
62640
62784
|
SETTLEMINT_APPLICATION: UniqueNameSchema2.optional(),
|
|
62641
62785
|
SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema2.optional(),
|
|
62786
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID: z.string().optional(),
|
|
62642
62787
|
SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema2.optional(),
|
|
62643
|
-
|
|
62788
|
+
SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT: UrlSchema2.optional(),
|
|
62789
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: UniqueNameSchema2.optional(),
|
|
62790
|
+
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT: UrlSchema2.optional(),
|
|
62644
62791
|
SETTLEMINT_HASURA: UniqueNameSchema2.optional(),
|
|
62645
62792
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema2.optional(),
|
|
62646
62793
|
SETTLEMINT_HASURA_ADMIN_SECRET: z.string().optional(),
|
|
@@ -62694,7 +62841,7 @@ var {
|
|
|
62694
62841
|
var package_default = {
|
|
62695
62842
|
name: "@settlemint/sdk-mcp",
|
|
62696
62843
|
description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
|
|
62697
|
-
version: "2.1.
|
|
62844
|
+
version: "2.1.4-main0ca0d06f",
|
|
62698
62845
|
type: "module",
|
|
62699
62846
|
private: false,
|
|
62700
62847
|
license: "FSL-1.1-MIT",
|
|
@@ -62735,9 +62882,9 @@ var package_default = {
|
|
|
62735
62882
|
dependencies: {
|
|
62736
62883
|
"@graphql-tools/load": "8.1.0",
|
|
62737
62884
|
"@graphql-tools/url-loader": "8.0.31",
|
|
62738
|
-
"@modelcontextprotocol/sdk": "1.
|
|
62739
|
-
"@settlemint/sdk-js": "2.1.
|
|
62740
|
-
"@settlemint/sdk-utils": "2.1.
|
|
62885
|
+
"@modelcontextprotocol/sdk": "1.10.2",
|
|
62886
|
+
"@settlemint/sdk-js": "2.1.4-main0ca0d06f",
|
|
62887
|
+
"@settlemint/sdk-utils": "2.1.4-main0ca0d06f",
|
|
62741
62888
|
"@commander-js/extra-typings": "11.1.0",
|
|
62742
62889
|
commander: "11.1.0",
|
|
62743
62890
|
zod: "3.24.2"
|
|
@@ -65301,11 +65448,61 @@ var BlockchainNetworkFragment = graphql(`
|
|
|
65301
65448
|
healthStatus
|
|
65302
65449
|
provider
|
|
65303
65450
|
region
|
|
65451
|
+
... on BesuQBFTBlockchainNetwork {
|
|
65452
|
+
chainId
|
|
65453
|
+
}
|
|
65454
|
+
... on BesuIbftv2BlockchainNetwork {
|
|
65455
|
+
chainId
|
|
65456
|
+
}
|
|
65457
|
+
... on GethPoWBlockchainNetwork {
|
|
65458
|
+
chainId
|
|
65459
|
+
}
|
|
65460
|
+
... on GethPoSRinkebyBlockchainNetwork {
|
|
65461
|
+
chainId
|
|
65462
|
+
}
|
|
65463
|
+
... on GethVenidiumBlockchainNetwork {
|
|
65464
|
+
chainId
|
|
65465
|
+
}
|
|
65466
|
+
... on GethGoerliBlockchainNetwork {
|
|
65467
|
+
chainId
|
|
65468
|
+
}
|
|
65469
|
+
... on AvalancheBlockchainNetwork {
|
|
65470
|
+
chainId
|
|
65471
|
+
}
|
|
65472
|
+
... on AvalancheFujiBlockchainNetwork {
|
|
65473
|
+
chainId
|
|
65474
|
+
}
|
|
65475
|
+
... on BscPoWBlockchainNetwork {
|
|
65476
|
+
chainId
|
|
65477
|
+
}
|
|
65478
|
+
... on BscPoWTestnetBlockchainNetwork {
|
|
65479
|
+
chainId
|
|
65480
|
+
}
|
|
65481
|
+
... on PolygonBlockchainNetwork {
|
|
65482
|
+
chainId
|
|
65483
|
+
}
|
|
65484
|
+
... on PolygonMumbaiBlockchainNetwork {
|
|
65485
|
+
chainId
|
|
65486
|
+
}
|
|
65487
|
+
... on PolygonEdgePoABlockchainNetwork {
|
|
65488
|
+
chainId
|
|
65489
|
+
}
|
|
65490
|
+
... on QuorumQBFTBlockchainNetwork {
|
|
65491
|
+
chainId
|
|
65492
|
+
}
|
|
65493
|
+
... on GethCliqueBlockchainNetwork {
|
|
65494
|
+
chainId
|
|
65495
|
+
}
|
|
65304
65496
|
blockchainNodes {
|
|
65305
65497
|
... on BlockchainNode {
|
|
65306
65498
|
id
|
|
65307
65499
|
name
|
|
65308
65500
|
uniqueName
|
|
65501
|
+
endpoints {
|
|
65502
|
+
id
|
|
65503
|
+
label
|
|
65504
|
+
displayValue
|
|
65505
|
+
}
|
|
65309
65506
|
}
|
|
65310
65507
|
}
|
|
65311
65508
|
}
|
|
@@ -65467,6 +65664,51 @@ var BlockchainNodeFragment = graphql(`
|
|
|
65467
65664
|
id
|
|
65468
65665
|
name
|
|
65469
65666
|
uniqueName
|
|
65667
|
+
... on BesuQBFTBlockchainNetwork {
|
|
65668
|
+
chainId
|
|
65669
|
+
}
|
|
65670
|
+
... on BesuIbftv2BlockchainNetwork {
|
|
65671
|
+
chainId
|
|
65672
|
+
}
|
|
65673
|
+
... on GethPoWBlockchainNetwork {
|
|
65674
|
+
chainId
|
|
65675
|
+
}
|
|
65676
|
+
... on GethPoSRinkebyBlockchainNetwork {
|
|
65677
|
+
chainId
|
|
65678
|
+
}
|
|
65679
|
+
... on GethVenidiumBlockchainNetwork {
|
|
65680
|
+
chainId
|
|
65681
|
+
}
|
|
65682
|
+
... on GethGoerliBlockchainNetwork {
|
|
65683
|
+
chainId
|
|
65684
|
+
}
|
|
65685
|
+
... on AvalancheBlockchainNetwork {
|
|
65686
|
+
chainId
|
|
65687
|
+
}
|
|
65688
|
+
... on AvalancheFujiBlockchainNetwork {
|
|
65689
|
+
chainId
|
|
65690
|
+
}
|
|
65691
|
+
... on BscPoWBlockchainNetwork {
|
|
65692
|
+
chainId
|
|
65693
|
+
}
|
|
65694
|
+
... on BscPoWTestnetBlockchainNetwork {
|
|
65695
|
+
chainId
|
|
65696
|
+
}
|
|
65697
|
+
... on PolygonBlockchainNetwork {
|
|
65698
|
+
chainId
|
|
65699
|
+
}
|
|
65700
|
+
... on PolygonMumbaiBlockchainNetwork {
|
|
65701
|
+
chainId
|
|
65702
|
+
}
|
|
65703
|
+
... on PolygonEdgePoABlockchainNetwork {
|
|
65704
|
+
chainId
|
|
65705
|
+
}
|
|
65706
|
+
... on QuorumQBFTBlockchainNetwork {
|
|
65707
|
+
chainId
|
|
65708
|
+
}
|
|
65709
|
+
... on GethCliqueBlockchainNetwork {
|
|
65710
|
+
chainId
|
|
65711
|
+
}
|
|
65470
65712
|
}
|
|
65471
65713
|
}
|
|
65472
65714
|
privateKeys {
|
|
@@ -65710,6 +65952,11 @@ var LoadBalancerFragment = graphql(`
|
|
|
65710
65952
|
healthStatus
|
|
65711
65953
|
provider
|
|
65712
65954
|
region
|
|
65955
|
+
endpoints {
|
|
65956
|
+
id
|
|
65957
|
+
label
|
|
65958
|
+
displayValue
|
|
65959
|
+
}
|
|
65713
65960
|
}
|
|
65714
65961
|
`);
|
|
65715
65962
|
var getLoadBalancer = graphql(`
|
|
@@ -65719,6 +65966,47 @@ var getLoadBalancer = graphql(`
|
|
|
65719
65966
|
}
|
|
65720
65967
|
}
|
|
65721
65968
|
`, [LoadBalancerFragment]);
|
|
65969
|
+
var getLoadBalancers = graphql(`
|
|
65970
|
+
query getLoadBalancers($applicationUniqueName: String!) {
|
|
65971
|
+
loadBalancersByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
65972
|
+
items {
|
|
65973
|
+
...LoadBalancer
|
|
65974
|
+
}
|
|
65975
|
+
}
|
|
65976
|
+
}
|
|
65977
|
+
`, [LoadBalancerFragment]);
|
|
65978
|
+
var createLoadBalancer = graphql(`
|
|
65979
|
+
mutation createLoadBalancer(
|
|
65980
|
+
$applicationId: ID!
|
|
65981
|
+
$blockchainNetworkId: ID!
|
|
65982
|
+
$name: String!
|
|
65983
|
+
$provider: String!
|
|
65984
|
+
$region: String!
|
|
65985
|
+
$size: ClusterServiceSize
|
|
65986
|
+
$type: ClusterServiceType
|
|
65987
|
+
$connectedNodes: [ID!]!
|
|
65988
|
+
) {
|
|
65989
|
+
createLoadBalancer(
|
|
65990
|
+
applicationId: $applicationId
|
|
65991
|
+
blockchainNetworkId: $blockchainNetworkId
|
|
65992
|
+
name: $name
|
|
65993
|
+
provider: $provider
|
|
65994
|
+
region: $region
|
|
65995
|
+
size: $size
|
|
65996
|
+
type: $type
|
|
65997
|
+
connectedNodes: $connectedNodes
|
|
65998
|
+
) {
|
|
65999
|
+
...LoadBalancer
|
|
66000
|
+
}
|
|
66001
|
+
}
|
|
66002
|
+
`, [LoadBalancerFragment]);
|
|
66003
|
+
var restartLoadBalancer = graphql(`
|
|
66004
|
+
mutation RestartLoadBalancer($uniqueName: String!) {
|
|
66005
|
+
restartLoadBalancerByUniqueName(uniqueName: $uniqueName) {
|
|
66006
|
+
...LoadBalancer
|
|
66007
|
+
}
|
|
66008
|
+
}
|
|
66009
|
+
`, [LoadBalancerFragment]);
|
|
65722
66010
|
var loadBalancerRead = (gqlClient) => {
|
|
65723
66011
|
return async (loadBalancerUniqueName) => {
|
|
65724
66012
|
const { loadBalancerByUniqueName: loadBalancer } = await gqlClient.request(getLoadBalancer, {
|
|
@@ -65727,6 +66015,37 @@ var loadBalancerRead = (gqlClient) => {
|
|
|
65727
66015
|
return loadBalancer;
|
|
65728
66016
|
};
|
|
65729
66017
|
};
|
|
66018
|
+
var loadBalancerList = (gqlClient) => {
|
|
66019
|
+
return async (applicationUniqueName) => {
|
|
66020
|
+
const {
|
|
66021
|
+
loadBalancersByUniqueName: { items }
|
|
66022
|
+
} = await gqlClient.request(getLoadBalancers, { applicationUniqueName });
|
|
66023
|
+
return items;
|
|
66024
|
+
};
|
|
66025
|
+
};
|
|
66026
|
+
var loadBalancerCreate = (gqlClient) => {
|
|
66027
|
+
return async (args) => {
|
|
66028
|
+
const { applicationUniqueName, blockchainNetworkUniqueName, connectedNodesUniqueNames, ...otherArgs } = args;
|
|
66029
|
+
const [application, blockchainNetwork, connectedNodes] = await Promise.all([
|
|
66030
|
+
applicationRead(gqlClient)(applicationUniqueName),
|
|
66031
|
+
blockchainNetworkRead(gqlClient)(blockchainNetworkUniqueName),
|
|
66032
|
+
Promise.all(connectedNodesUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient)(uniqueName)))
|
|
66033
|
+
]);
|
|
66034
|
+
const { createLoadBalancer: loadBalancer } = await gqlClient.request(createLoadBalancer, {
|
|
66035
|
+
...otherArgs,
|
|
66036
|
+
applicationId: application.id,
|
|
66037
|
+
blockchainNetworkId: blockchainNetwork.id,
|
|
66038
|
+
connectedNodes: connectedNodes.map((node) => node.id)
|
|
66039
|
+
});
|
|
66040
|
+
return loadBalancer;
|
|
66041
|
+
};
|
|
66042
|
+
};
|
|
66043
|
+
var loadBalancerRestart = (gqlClient) => async (loadBalancerUniqueName) => {
|
|
66044
|
+
const { restartLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(restartLoadBalancer, {
|
|
66045
|
+
uniqueName: loadBalancerUniqueName
|
|
66046
|
+
});
|
|
66047
|
+
return loadBalancer;
|
|
66048
|
+
};
|
|
65730
66049
|
var InsightsFragment = graphql(`
|
|
65731
66050
|
fragment Insights on Insights {
|
|
65732
66051
|
__typename
|
|
@@ -66427,6 +66746,12 @@ function createSettleMintClient(options) {
|
|
|
66427
66746
|
create: blockchainNodeCreate(gqlClient),
|
|
66428
66747
|
restart: blockchainNodeRestart(gqlClient)
|
|
66429
66748
|
},
|
|
66749
|
+
loadBalancer: {
|
|
66750
|
+
list: loadBalancerList(gqlClient),
|
|
66751
|
+
read: loadBalancerRead(gqlClient),
|
|
66752
|
+
create: loadBalancerCreate(gqlClient),
|
|
66753
|
+
restart: loadBalancerRestart(gqlClient)
|
|
66754
|
+
},
|
|
66430
66755
|
middleware: {
|
|
66431
66756
|
list: middlewareList(gqlClient),
|
|
66432
66757
|
read: middlewareRead(gqlClient),
|
|
@@ -68155,4 +68480,4 @@ await main().catch((error2) => {
|
|
|
68155
68480
|
process.exit(1);
|
|
68156
68481
|
});
|
|
68157
68482
|
|
|
68158
|
-
//# debugId=
|
|
68483
|
+
//# debugId=90AE4C46E37C7B3C64756E2164756E21
|