@trops/dash-core 0.1.59 → 0.1.60
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.esm.js +70 -19
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +70 -19
- package/dist/index.js.map +1 -1
- package/dist/mcp/mcpServerCatalog.json +4 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -27372,30 +27372,38 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27372
27372
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
27373
27373
|
isCustom = _useState14[0],
|
|
27374
27374
|
setIsCustom = _useState14[1];
|
|
27375
|
-
|
|
27376
|
-
// Configuration form state
|
|
27377
|
-
var _useState15 = useState(""),
|
|
27375
|
+
var _useState15 = useState(false),
|
|
27378
27376
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
27379
|
-
|
|
27380
|
-
|
|
27381
|
-
var _useState17 = useState(
|
|
27377
|
+
isAuthorizing = _useState16[0],
|
|
27378
|
+
setIsAuthorizing = _useState16[1];
|
|
27379
|
+
var _useState17 = useState(null),
|
|
27382
27380
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
27383
|
-
|
|
27384
|
-
|
|
27385
|
-
var _useState19 = useState({}),
|
|
27386
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
27387
|
-
formErrors = _useState20[0],
|
|
27388
|
-
setFormErrors = _useState20[1];
|
|
27381
|
+
authResult = _useState18[0],
|
|
27382
|
+
setAuthResult = _useState18[1];
|
|
27389
27383
|
|
|
27390
|
-
//
|
|
27391
|
-
var
|
|
27384
|
+
// Configuration form state
|
|
27385
|
+
var _useState19 = useState(""),
|
|
27386
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
27387
|
+
providerName = _useState20[0],
|
|
27388
|
+
setProviderName = _useState20[1];
|
|
27389
|
+
var _useState21 = useState({}),
|
|
27392
27390
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
27393
|
-
|
|
27394
|
-
|
|
27395
|
-
var _useState23 = useState(
|
|
27391
|
+
credentialData = _useState22[0],
|
|
27392
|
+
setCredentialData = _useState22[1];
|
|
27393
|
+
var _useState23 = useState({}),
|
|
27396
27394
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
27397
|
-
|
|
27398
|
-
|
|
27395
|
+
formErrors = _useState24[0],
|
|
27396
|
+
setFormErrors = _useState24[1];
|
|
27397
|
+
|
|
27398
|
+
// Advanced config row state
|
|
27399
|
+
var _useState25 = useState([]),
|
|
27400
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
27401
|
+
envMappingRows = _useState26[0],
|
|
27402
|
+
setEnvMappingRows = _useState26[1];
|
|
27403
|
+
var _useState27 = useState([]),
|
|
27404
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
27405
|
+
headerRows = _useState28[0],
|
|
27406
|
+
setHeaderRows = _useState28[1];
|
|
27399
27407
|
var rowIdRef = useRef(0);
|
|
27400
27408
|
var nextRowId = function nextRowId() {
|
|
27401
27409
|
return "cat_".concat(++rowIdRef.current);
|
|
@@ -27442,6 +27450,7 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27442
27450
|
setSelectedServer(server);
|
|
27443
27451
|
setIsConfiguring(true);
|
|
27444
27452
|
setTestResult(null);
|
|
27453
|
+
setAuthResult(null);
|
|
27445
27454
|
setProviderName(server.name);
|
|
27446
27455
|
setCredentialData({});
|
|
27447
27456
|
setFormErrors({});
|
|
@@ -27513,6 +27522,33 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27513
27522
|
});
|
|
27514
27523
|
};
|
|
27515
27524
|
|
|
27525
|
+
// Handle authorize (OAuth browser flow)
|
|
27526
|
+
var handleAuthorize = function handleAuthorize() {
|
|
27527
|
+
if (!dashApi || !(selectedServer !== null && selectedServer !== void 0 && selectedServer.authCommand)) return;
|
|
27528
|
+
setIsAuthorizing(true);
|
|
27529
|
+
setAuthResult(null);
|
|
27530
|
+
dashApi.mcpRunAuth(effectiveMcpConfig, credentialData, selectedServer.authCommand, function (event, result) {
|
|
27531
|
+
if (result.error) {
|
|
27532
|
+
setAuthResult({
|
|
27533
|
+
success: false,
|
|
27534
|
+
message: result.message
|
|
27535
|
+
});
|
|
27536
|
+
} else {
|
|
27537
|
+
setAuthResult({
|
|
27538
|
+
success: true,
|
|
27539
|
+
message: "Authorized!"
|
|
27540
|
+
});
|
|
27541
|
+
}
|
|
27542
|
+
setIsAuthorizing(false);
|
|
27543
|
+
}, function (event, err) {
|
|
27544
|
+
setAuthResult({
|
|
27545
|
+
success: false,
|
|
27546
|
+
message: (err === null || err === void 0 ? void 0 : err.message) || "Authorization failed"
|
|
27547
|
+
});
|
|
27548
|
+
setIsAuthorizing(false);
|
|
27549
|
+
});
|
|
27550
|
+
};
|
|
27551
|
+
|
|
27516
27552
|
// Handle save
|
|
27517
27553
|
var handleSaveProvider = function handleSaveProvider() {
|
|
27518
27554
|
if (!selectedServer || !validateForm()) return;
|
|
@@ -27536,6 +27572,7 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27536
27572
|
setIsConfiguring(false);
|
|
27537
27573
|
setIsCustom(false);
|
|
27538
27574
|
setTestResult(null);
|
|
27575
|
+
setAuthResult(null);
|
|
27539
27576
|
setProviderName("");
|
|
27540
27577
|
setCredentialData({});
|
|
27541
27578
|
setFormErrors({});
|
|
@@ -27724,6 +27761,16 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27724
27761
|
})]
|
|
27725
27762
|
}, field.key);
|
|
27726
27763
|
})]
|
|
27764
|
+
}), authResult && /*#__PURE__*/jsx("div", {
|
|
27765
|
+
className: "p-3 rounded-lg text-sm ".concat(authResult.success ? "bg-green-900/30 border border-green-700 text-green-300" : "bg-red-900/30 border border-red-700 text-red-300"),
|
|
27766
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
27767
|
+
className: "flex items-center gap-2",
|
|
27768
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
27769
|
+
icon: authResult.success ? "circle-check" : "circle-exclamation"
|
|
27770
|
+
}), /*#__PURE__*/jsx("span", {
|
|
27771
|
+
children: authResult.message
|
|
27772
|
+
})]
|
|
27773
|
+
})
|
|
27727
27774
|
}), testResult && /*#__PURE__*/jsxs("div", {
|
|
27728
27775
|
className: "p-3 rounded-lg text-sm ".concat(testResult.success ? "bg-green-900/30 border border-green-700 text-green-300" : "bg-red-900/30 border border-red-700 text-red-300"),
|
|
27729
27776
|
children: [/*#__PURE__*/jsxs("div", {
|
|
@@ -27755,6 +27802,10 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27755
27802
|
title: "Cancel",
|
|
27756
27803
|
onClick: onCancel,
|
|
27757
27804
|
size: "sm"
|
|
27805
|
+
}), (selectedServer === null || selectedServer === void 0 ? void 0 : selectedServer.authCommand) && /*#__PURE__*/jsx(Button, {
|
|
27806
|
+
title: isAuthorizing ? "Authorizing..." : "Authorize",
|
|
27807
|
+
onClick: handleAuthorize,
|
|
27808
|
+
size: "sm"
|
|
27758
27809
|
}), /*#__PURE__*/jsx(Button, {
|
|
27759
27810
|
title: isTesting ? "Testing..." : "Test Connection",
|
|
27760
27811
|
onClick: handleTestConnection,
|