@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.js
CHANGED
|
@@ -27391,30 +27391,38 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27391
27391
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
27392
27392
|
isCustom = _useState14[0],
|
|
27393
27393
|
setIsCustom = _useState14[1];
|
|
27394
|
-
|
|
27395
|
-
// Configuration form state
|
|
27396
|
-
var _useState15 = React.useState(""),
|
|
27394
|
+
var _useState15 = React.useState(false),
|
|
27397
27395
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
27398
|
-
|
|
27399
|
-
|
|
27400
|
-
var _useState17 = React.useState(
|
|
27396
|
+
isAuthorizing = _useState16[0],
|
|
27397
|
+
setIsAuthorizing = _useState16[1];
|
|
27398
|
+
var _useState17 = React.useState(null),
|
|
27401
27399
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
27402
|
-
|
|
27403
|
-
|
|
27404
|
-
var _useState19 = React.useState({}),
|
|
27405
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
27406
|
-
formErrors = _useState20[0],
|
|
27407
|
-
setFormErrors = _useState20[1];
|
|
27400
|
+
authResult = _useState18[0],
|
|
27401
|
+
setAuthResult = _useState18[1];
|
|
27408
27402
|
|
|
27409
|
-
//
|
|
27410
|
-
var
|
|
27403
|
+
// Configuration form state
|
|
27404
|
+
var _useState19 = React.useState(""),
|
|
27405
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
27406
|
+
providerName = _useState20[0],
|
|
27407
|
+
setProviderName = _useState20[1];
|
|
27408
|
+
var _useState21 = React.useState({}),
|
|
27411
27409
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
27412
|
-
|
|
27413
|
-
|
|
27414
|
-
var _useState23 = React.useState(
|
|
27410
|
+
credentialData = _useState22[0],
|
|
27411
|
+
setCredentialData = _useState22[1];
|
|
27412
|
+
var _useState23 = React.useState({}),
|
|
27415
27413
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
27416
|
-
|
|
27417
|
-
|
|
27414
|
+
formErrors = _useState24[0],
|
|
27415
|
+
setFormErrors = _useState24[1];
|
|
27416
|
+
|
|
27417
|
+
// Advanced config row state
|
|
27418
|
+
var _useState25 = React.useState([]),
|
|
27419
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
27420
|
+
envMappingRows = _useState26[0],
|
|
27421
|
+
setEnvMappingRows = _useState26[1];
|
|
27422
|
+
var _useState27 = React.useState([]),
|
|
27423
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
27424
|
+
headerRows = _useState28[0],
|
|
27425
|
+
setHeaderRows = _useState28[1];
|
|
27418
27426
|
var rowIdRef = React.useRef(0);
|
|
27419
27427
|
var nextRowId = function nextRowId() {
|
|
27420
27428
|
return "cat_".concat(++rowIdRef.current);
|
|
@@ -27461,6 +27469,7 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27461
27469
|
setSelectedServer(server);
|
|
27462
27470
|
setIsConfiguring(true);
|
|
27463
27471
|
setTestResult(null);
|
|
27472
|
+
setAuthResult(null);
|
|
27464
27473
|
setProviderName(server.name);
|
|
27465
27474
|
setCredentialData({});
|
|
27466
27475
|
setFormErrors({});
|
|
@@ -27532,6 +27541,33 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27532
27541
|
});
|
|
27533
27542
|
};
|
|
27534
27543
|
|
|
27544
|
+
// Handle authorize (OAuth browser flow)
|
|
27545
|
+
var handleAuthorize = function handleAuthorize() {
|
|
27546
|
+
if (!dashApi || !(selectedServer !== null && selectedServer !== void 0 && selectedServer.authCommand)) return;
|
|
27547
|
+
setIsAuthorizing(true);
|
|
27548
|
+
setAuthResult(null);
|
|
27549
|
+
dashApi.mcpRunAuth(effectiveMcpConfig, credentialData, selectedServer.authCommand, function (event, result) {
|
|
27550
|
+
if (result.error) {
|
|
27551
|
+
setAuthResult({
|
|
27552
|
+
success: false,
|
|
27553
|
+
message: result.message
|
|
27554
|
+
});
|
|
27555
|
+
} else {
|
|
27556
|
+
setAuthResult({
|
|
27557
|
+
success: true,
|
|
27558
|
+
message: "Authorized!"
|
|
27559
|
+
});
|
|
27560
|
+
}
|
|
27561
|
+
setIsAuthorizing(false);
|
|
27562
|
+
}, function (event, err) {
|
|
27563
|
+
setAuthResult({
|
|
27564
|
+
success: false,
|
|
27565
|
+
message: (err === null || err === void 0 ? void 0 : err.message) || "Authorization failed"
|
|
27566
|
+
});
|
|
27567
|
+
setIsAuthorizing(false);
|
|
27568
|
+
});
|
|
27569
|
+
};
|
|
27570
|
+
|
|
27535
27571
|
// Handle save
|
|
27536
27572
|
var handleSaveProvider = function handleSaveProvider() {
|
|
27537
27573
|
if (!selectedServer || !validateForm()) return;
|
|
@@ -27555,6 +27591,7 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27555
27591
|
setIsConfiguring(false);
|
|
27556
27592
|
setIsCustom(false);
|
|
27557
27593
|
setTestResult(null);
|
|
27594
|
+
setAuthResult(null);
|
|
27558
27595
|
setProviderName("");
|
|
27559
27596
|
setCredentialData({});
|
|
27560
27597
|
setFormErrors({});
|
|
@@ -27743,6 +27780,16 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27743
27780
|
})]
|
|
27744
27781
|
}, field.key);
|
|
27745
27782
|
})]
|
|
27783
|
+
}), authResult && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27784
|
+
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"),
|
|
27785
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27786
|
+
className: "flex items-center gap-2",
|
|
27787
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27788
|
+
icon: authResult.success ? "circle-check" : "circle-exclamation"
|
|
27789
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
27790
|
+
children: authResult.message
|
|
27791
|
+
})]
|
|
27792
|
+
})
|
|
27746
27793
|
}), testResult && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27747
27794
|
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"),
|
|
27748
27795
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -27774,6 +27821,10 @@ var McpCatalogDetail = function McpCatalogDetail(_ref) {
|
|
|
27774
27821
|
title: "Cancel",
|
|
27775
27822
|
onClick: onCancel,
|
|
27776
27823
|
size: "sm"
|
|
27824
|
+
}), (selectedServer === null || selectedServer === void 0 ? void 0 : selectedServer.authCommand) && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
27825
|
+
title: isAuthorizing ? "Authorizing..." : "Authorize",
|
|
27826
|
+
onClick: handleAuthorize,
|
|
27827
|
+
size: "sm"
|
|
27777
27828
|
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
27778
27829
|
title: isTesting ? "Testing..." : "Test Connection",
|
|
27779
27830
|
onClick: handleTestConnection,
|