@contractspec/example.integration-hub 3.7.7 → 3.8.2
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 +4 -1
- package/dist/docs/index.js +2 -1
- package/dist/docs/integration-hub.docblock.js +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +669 -177
- package/dist/integration-hub.feature.js +202 -0
- package/dist/node/docs/index.js +2 -1
- package/dist/node/docs/integration-hub.docblock.js +2 -1
- package/dist/node/index.js +669 -177
- package/dist/node/integration-hub.feature.js +202 -0
- package/dist/node/ui/IntegrationDashboard.js +646 -172
- package/dist/node/ui/IntegrationDashboard.visualizations.js +250 -0
- package/dist/node/ui/index.js +661 -177
- package/dist/node/ui/renderers/index.js +216 -5
- package/dist/node/ui/renderers/integration.markdown.js +216 -5
- package/dist/node/ui/tables/ConnectionsTable.js +211 -0
- package/dist/node/ui/tables/IntegrationTables.js +361 -0
- package/dist/node/ui/tables/SyncConfigsTable.js +230 -0
- package/dist/node/ui/tables/integration-table.shared.js +84 -0
- package/dist/node/visualizations/catalog.js +137 -0
- package/dist/node/visualizations/index.js +211 -0
- package/dist/node/visualizations/selectors.js +204 -0
- package/dist/ui/IntegrationDashboard.js +646 -172
- package/dist/ui/IntegrationDashboard.visualizations.d.ts +6 -0
- package/dist/ui/IntegrationDashboard.visualizations.js +251 -0
- package/dist/ui/index.js +661 -177
- package/dist/ui/renderers/index.js +216 -5
- package/dist/ui/renderers/integration.markdown.js +216 -5
- package/dist/ui/tables/ConnectionsTable.d.ts +4 -0
- package/dist/ui/tables/ConnectionsTable.js +212 -0
- package/dist/ui/tables/IntegrationTables.d.ts +2 -0
- package/dist/ui/tables/IntegrationTables.js +362 -0
- package/dist/ui/tables/IntegrationTables.smoke.test.d.ts +1 -0
- package/dist/ui/tables/SyncConfigsTable.d.ts +4 -0
- package/dist/ui/tables/SyncConfigsTable.js +231 -0
- package/dist/ui/tables/integration-table.shared.d.ts +18 -0
- package/dist/ui/tables/integration-table.shared.js +85 -0
- package/dist/visualizations/catalog.d.ts +11 -0
- package/dist/visualizations/catalog.js +138 -0
- package/dist/visualizations/index.d.ts +2 -0
- package/dist/visualizations/index.js +212 -0
- package/dist/visualizations/selectors.d.ts +10 -0
- package/dist/visualizations/selectors.js +205 -0
- package/dist/visualizations/selectors.test.d.ts +1 -0
- package/package.json +108 -10
package/dist/node/index.js
CHANGED
|
@@ -1197,9 +1197,257 @@ function useIntegrationData(projectId = "local-project") {
|
|
|
1197
1197
|
// src/ui/hooks/index.ts
|
|
1198
1198
|
"use client";
|
|
1199
1199
|
|
|
1200
|
+
// src/visualizations/catalog.ts
|
|
1201
|
+
import {
|
|
1202
|
+
defineVisualization,
|
|
1203
|
+
VisualizationRegistry
|
|
1204
|
+
} from "@contractspec/lib.contracts-spec/visualizations";
|
|
1205
|
+
var INTEGRATION_LIST_REF = {
|
|
1206
|
+
key: "integration.list",
|
|
1207
|
+
version: "1.0.0"
|
|
1208
|
+
};
|
|
1209
|
+
var CONNECTION_LIST_REF = {
|
|
1210
|
+
key: "integration.connection.list",
|
|
1211
|
+
version: "1.0.0"
|
|
1212
|
+
};
|
|
1213
|
+
var SYNC_CONFIG_REF = {
|
|
1214
|
+
key: "integration.syncConfig.list",
|
|
1215
|
+
version: "1.0.0"
|
|
1216
|
+
};
|
|
1217
|
+
var META = {
|
|
1218
|
+
version: "1.0.0",
|
|
1219
|
+
domain: "integration",
|
|
1220
|
+
stability: "experimental",
|
|
1221
|
+
owners: ["@example.integration-hub"],
|
|
1222
|
+
tags: ["integration", "visualization", "sync"]
|
|
1223
|
+
};
|
|
1224
|
+
var IntegrationTypeVisualization = defineVisualization({
|
|
1225
|
+
meta: {
|
|
1226
|
+
...META,
|
|
1227
|
+
key: "integration-hub.visualization.integration-types",
|
|
1228
|
+
title: "Integration Types",
|
|
1229
|
+
description: "Distribution of configured integration categories.",
|
|
1230
|
+
goal: "Show where integration coverage is concentrated.",
|
|
1231
|
+
context: "Integration overview."
|
|
1232
|
+
},
|
|
1233
|
+
source: { primary: INTEGRATION_LIST_REF, resultPath: "data" },
|
|
1234
|
+
visualization: {
|
|
1235
|
+
kind: "pie",
|
|
1236
|
+
nameDimension: "type",
|
|
1237
|
+
valueMeasure: "count",
|
|
1238
|
+
dimensions: [
|
|
1239
|
+
{ key: "type", label: "Type", dataPath: "type", type: "category" }
|
|
1240
|
+
],
|
|
1241
|
+
measures: [
|
|
1242
|
+
{ key: "count", label: "Count", dataPath: "count", format: "number" }
|
|
1243
|
+
],
|
|
1244
|
+
table: { caption: "Integration counts by type." }
|
|
1245
|
+
}
|
|
1246
|
+
});
|
|
1247
|
+
var ConnectionStatusVisualization = defineVisualization({
|
|
1248
|
+
meta: {
|
|
1249
|
+
...META,
|
|
1250
|
+
key: "integration-hub.visualization.connection-status",
|
|
1251
|
+
title: "Connection Status",
|
|
1252
|
+
description: "Status distribution across configured connections.",
|
|
1253
|
+
goal: "Highlight connection health and instability.",
|
|
1254
|
+
context: "Connection monitoring."
|
|
1255
|
+
},
|
|
1256
|
+
source: { primary: CONNECTION_LIST_REF, resultPath: "data" },
|
|
1257
|
+
visualization: {
|
|
1258
|
+
kind: "cartesian",
|
|
1259
|
+
variant: "bar",
|
|
1260
|
+
xDimension: "status",
|
|
1261
|
+
yMeasures: ["count"],
|
|
1262
|
+
dimensions: [
|
|
1263
|
+
{ key: "status", label: "Status", dataPath: "status", type: "category" }
|
|
1264
|
+
],
|
|
1265
|
+
measures: [
|
|
1266
|
+
{
|
|
1267
|
+
key: "count",
|
|
1268
|
+
label: "Connections",
|
|
1269
|
+
dataPath: "count",
|
|
1270
|
+
format: "number",
|
|
1271
|
+
color: "#1d4ed8"
|
|
1272
|
+
}
|
|
1273
|
+
],
|
|
1274
|
+
table: { caption: "Connection counts by status." }
|
|
1275
|
+
}
|
|
1276
|
+
});
|
|
1277
|
+
var HealthySyncMetricVisualization = defineVisualization({
|
|
1278
|
+
meta: {
|
|
1279
|
+
...META,
|
|
1280
|
+
key: "integration-hub.visualization.sync-healthy",
|
|
1281
|
+
title: "Healthy Syncs",
|
|
1282
|
+
description: "Sync configurations currently healthy or recently successful.",
|
|
1283
|
+
goal: "Summarize healthy synchronization capacity.",
|
|
1284
|
+
context: "Sync-state comparison."
|
|
1285
|
+
},
|
|
1286
|
+
source: { primary: SYNC_CONFIG_REF, resultPath: "data" },
|
|
1287
|
+
visualization: {
|
|
1288
|
+
kind: "metric",
|
|
1289
|
+
measure: "value",
|
|
1290
|
+
measures: [
|
|
1291
|
+
{ key: "value", label: "Syncs", dataPath: "value", format: "number" }
|
|
1292
|
+
],
|
|
1293
|
+
table: { caption: "Healthy sync count." }
|
|
1294
|
+
}
|
|
1295
|
+
});
|
|
1296
|
+
var AttentionSyncMetricVisualization = defineVisualization({
|
|
1297
|
+
meta: {
|
|
1298
|
+
...META,
|
|
1299
|
+
key: "integration-hub.visualization.sync-attention",
|
|
1300
|
+
title: "Attention Needed",
|
|
1301
|
+
description: "Sync configurations paused, failing, or otherwise needing review.",
|
|
1302
|
+
goal: "Summarize syncs needing action.",
|
|
1303
|
+
context: "Sync-state comparison."
|
|
1304
|
+
},
|
|
1305
|
+
source: { primary: SYNC_CONFIG_REF, resultPath: "data" },
|
|
1306
|
+
visualization: {
|
|
1307
|
+
kind: "metric",
|
|
1308
|
+
measure: "value",
|
|
1309
|
+
measures: [
|
|
1310
|
+
{ key: "value", label: "Syncs", dataPath: "value", format: "number" }
|
|
1311
|
+
],
|
|
1312
|
+
table: { caption: "Syncs requiring attention." }
|
|
1313
|
+
}
|
|
1314
|
+
});
|
|
1315
|
+
var IntegrationVisualizationSpecs = [
|
|
1316
|
+
IntegrationTypeVisualization,
|
|
1317
|
+
ConnectionStatusVisualization,
|
|
1318
|
+
HealthySyncMetricVisualization,
|
|
1319
|
+
AttentionSyncMetricVisualization
|
|
1320
|
+
];
|
|
1321
|
+
var IntegrationVisualizationRegistry = new VisualizationRegistry([
|
|
1322
|
+
...IntegrationVisualizationSpecs
|
|
1323
|
+
]);
|
|
1324
|
+
var IntegrationVisualizationRefs = IntegrationVisualizationSpecs.map((spec) => ({
|
|
1325
|
+
key: spec.meta.key,
|
|
1326
|
+
version: spec.meta.version
|
|
1327
|
+
}));
|
|
1328
|
+
|
|
1329
|
+
// src/visualizations/selectors.ts
|
|
1330
|
+
function isHealthySync(status) {
|
|
1331
|
+
return status === "ACTIVE" || status === "SUCCESS";
|
|
1332
|
+
}
|
|
1333
|
+
function createIntegrationVisualizationSections(integrations, connections, syncConfigs) {
|
|
1334
|
+
const integrationTypes = new Map;
|
|
1335
|
+
const connectionStatuses = new Map;
|
|
1336
|
+
let healthySyncs = 0;
|
|
1337
|
+
let attentionSyncs = 0;
|
|
1338
|
+
for (const integration of integrations) {
|
|
1339
|
+
integrationTypes.set(integration.type, (integrationTypes.get(integration.type) ?? 0) + 1);
|
|
1340
|
+
}
|
|
1341
|
+
for (const connection of connections) {
|
|
1342
|
+
connectionStatuses.set(connection.status, (connectionStatuses.get(connection.status) ?? 0) + 1);
|
|
1343
|
+
}
|
|
1344
|
+
for (const syncConfig of syncConfigs) {
|
|
1345
|
+
if (isHealthySync(syncConfig.status)) {
|
|
1346
|
+
healthySyncs += 1;
|
|
1347
|
+
} else {
|
|
1348
|
+
attentionSyncs += 1;
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
const primaryItems = [
|
|
1352
|
+
{
|
|
1353
|
+
key: "integration-types",
|
|
1354
|
+
spec: IntegrationTypeVisualization,
|
|
1355
|
+
data: {
|
|
1356
|
+
data: Array.from(integrationTypes.entries()).map(([type, count]) => ({
|
|
1357
|
+
type,
|
|
1358
|
+
count
|
|
1359
|
+
}))
|
|
1360
|
+
},
|
|
1361
|
+
title: "Integration Types",
|
|
1362
|
+
description: "Configured integrations grouped by category.",
|
|
1363
|
+
height: 260
|
|
1364
|
+
},
|
|
1365
|
+
{
|
|
1366
|
+
key: "connection-status",
|
|
1367
|
+
spec: ConnectionStatusVisualization,
|
|
1368
|
+
data: {
|
|
1369
|
+
data: Array.from(connectionStatuses.entries()).map(([status, count]) => ({
|
|
1370
|
+
status,
|
|
1371
|
+
count
|
|
1372
|
+
}))
|
|
1373
|
+
},
|
|
1374
|
+
title: "Connection Status",
|
|
1375
|
+
description: "Operational health across current connections."
|
|
1376
|
+
}
|
|
1377
|
+
];
|
|
1378
|
+
const comparisonItems = [
|
|
1379
|
+
{
|
|
1380
|
+
key: "healthy-syncs",
|
|
1381
|
+
spec: HealthySyncMetricVisualization,
|
|
1382
|
+
data: { data: [{ value: healthySyncs }] },
|
|
1383
|
+
title: "Healthy Syncs",
|
|
1384
|
+
description: "Active or recently successful sync configurations.",
|
|
1385
|
+
height: 200
|
|
1386
|
+
},
|
|
1387
|
+
{
|
|
1388
|
+
key: "attention-syncs",
|
|
1389
|
+
spec: AttentionSyncMetricVisualization,
|
|
1390
|
+
data: { data: [{ value: attentionSyncs }] },
|
|
1391
|
+
title: "Attention Needed",
|
|
1392
|
+
description: "Paused, failed, or degraded sync configurations.",
|
|
1393
|
+
height: 200
|
|
1394
|
+
}
|
|
1395
|
+
];
|
|
1396
|
+
return {
|
|
1397
|
+
primaryItems,
|
|
1398
|
+
comparisonItems
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
// src/ui/IntegrationDashboard.visualizations.tsx
|
|
1402
|
+
import {
|
|
1403
|
+
ComparisonView,
|
|
1404
|
+
VisualizationCard,
|
|
1405
|
+
VisualizationGrid
|
|
1406
|
+
} from "@contractspec/lib.design-system";
|
|
1407
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
1408
|
+
"use client";
|
|
1409
|
+
function IntegrationVisualizationOverview({
|
|
1410
|
+
integrations,
|
|
1411
|
+
connections,
|
|
1412
|
+
syncConfigs
|
|
1413
|
+
}) {
|
|
1414
|
+
const { primaryItems, comparisonItems } = createIntegrationVisualizationSections(integrations, connections, syncConfigs);
|
|
1415
|
+
return /* @__PURE__ */ jsxDEV("section", {
|
|
1416
|
+
className: "space-y-4",
|
|
1417
|
+
children: [
|
|
1418
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
1419
|
+
children: [
|
|
1420
|
+
/* @__PURE__ */ jsxDEV("h3", {
|
|
1421
|
+
className: "font-semibold text-lg",
|
|
1422
|
+
children: "Integration Visualizations"
|
|
1423
|
+
}, undefined, false, undefined, this),
|
|
1424
|
+
/* @__PURE__ */ jsxDEV("p", {
|
|
1425
|
+
className: "text-muted-foreground text-sm",
|
|
1426
|
+
children: "Contract-backed charts for integration coverage and sync health."
|
|
1427
|
+
}, undefined, false, undefined, this)
|
|
1428
|
+
]
|
|
1429
|
+
}, undefined, true, undefined, this),
|
|
1430
|
+
/* @__PURE__ */ jsxDEV(VisualizationGrid, {
|
|
1431
|
+
children: primaryItems.map((item) => /* @__PURE__ */ jsxDEV(VisualizationCard, {
|
|
1432
|
+
data: item.data,
|
|
1433
|
+
description: item.description,
|
|
1434
|
+
height: item.height,
|
|
1435
|
+
spec: item.spec,
|
|
1436
|
+
title: item.title
|
|
1437
|
+
}, item.key, false, undefined, this))
|
|
1438
|
+
}, undefined, false, undefined, this),
|
|
1439
|
+
/* @__PURE__ */ jsxDEV(ComparisonView, {
|
|
1440
|
+
description: "Comparison surface for healthy versus attention-needed syncs.",
|
|
1441
|
+
items: comparisonItems,
|
|
1442
|
+
title: "Sync-State Comparison"
|
|
1443
|
+
}, undefined, false, undefined, this)
|
|
1444
|
+
]
|
|
1445
|
+
}, undefined, true, undefined, this);
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1200
1448
|
// src/ui/IntegrationHubChat.tsx
|
|
1201
1449
|
import { ChatWithSidebar } from "@contractspec/module.ai-chat";
|
|
1202
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
1450
|
+
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
1203
1451
|
"use client";
|
|
1204
1452
|
var DEFAULT_SUGGESTIONS = [
|
|
1205
1453
|
"List my integrations",
|
|
@@ -1215,9 +1463,9 @@ function IntegrationHubChat({
|
|
|
1215
1463
|
systemPrompt = DEFAULT_SYSTEM_PROMPT,
|
|
1216
1464
|
className
|
|
1217
1465
|
}) {
|
|
1218
|
-
return /* @__PURE__ */
|
|
1466
|
+
return /* @__PURE__ */ jsxDEV2("div", {
|
|
1219
1467
|
className: className ?? "flex h-[500px] flex-col",
|
|
1220
|
-
children: /* @__PURE__ */
|
|
1468
|
+
children: /* @__PURE__ */ jsxDEV2(ChatWithSidebar, {
|
|
1221
1469
|
className: "flex-1",
|
|
1222
1470
|
systemPrompt,
|
|
1223
1471
|
proxyUrl,
|
|
@@ -1229,16 +1477,373 @@ function IntegrationHubChat({
|
|
|
1229
1477
|
}, undefined, false, undefined, this);
|
|
1230
1478
|
}
|
|
1231
1479
|
|
|
1480
|
+
// src/ui/tables/integration-table.shared.tsx
|
|
1481
|
+
import { Button } from "@contractspec/lib.design-system";
|
|
1482
|
+
import { Badge } from "@contractspec/lib.ui-kit-web/ui/badge";
|
|
1483
|
+
import { HStack } from "@contractspec/lib.ui-kit-web/ui/stack";
|
|
1484
|
+
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
1485
|
+
"use client";
|
|
1486
|
+
var STATUS_VARIANTS = {
|
|
1487
|
+
ACTIVE: "default",
|
|
1488
|
+
CONNECTED: "default",
|
|
1489
|
+
SUCCESS: "default",
|
|
1490
|
+
PENDING: "secondary",
|
|
1491
|
+
PAUSED: "secondary",
|
|
1492
|
+
ERROR: "destructive",
|
|
1493
|
+
DISCONNECTED: "outline"
|
|
1494
|
+
};
|
|
1495
|
+
function formatDateTime(value) {
|
|
1496
|
+
return value ? value.toLocaleString() : "Never";
|
|
1497
|
+
}
|
|
1498
|
+
function formatJson(value) {
|
|
1499
|
+
return value ? JSON.stringify(value, null, 2) : "No configuration";
|
|
1500
|
+
}
|
|
1501
|
+
function StatusBadge({ status }) {
|
|
1502
|
+
return /* @__PURE__ */ jsxDEV3(Badge, {
|
|
1503
|
+
variant: STATUS_VARIANTS[status] ?? "outline",
|
|
1504
|
+
children: status
|
|
1505
|
+
}, undefined, false, undefined, this);
|
|
1506
|
+
}
|
|
1507
|
+
function IntegrationTableToolbar({
|
|
1508
|
+
controller,
|
|
1509
|
+
label,
|
|
1510
|
+
toggleColumnId,
|
|
1511
|
+
toggleVisibleLabel,
|
|
1512
|
+
toggleHiddenLabel,
|
|
1513
|
+
pinColumnId,
|
|
1514
|
+
pinLabel,
|
|
1515
|
+
resizeColumnId,
|
|
1516
|
+
resizeLabel
|
|
1517
|
+
}) {
|
|
1518
|
+
const firstRow = controller.rows[0];
|
|
1519
|
+
const toggleColumn = controller.columns.find((column) => column.id === toggleColumnId);
|
|
1520
|
+
const pinColumn = controller.columns.find((column) => column.id === pinColumnId);
|
|
1521
|
+
const resizeColumn = controller.columns.find((column) => column.id === resizeColumnId);
|
|
1522
|
+
const pinTarget = pinColumn?.pinState === "left" ? false : "left";
|
|
1523
|
+
return /* @__PURE__ */ jsxDEV3(HStack, {
|
|
1524
|
+
gap: "sm",
|
|
1525
|
+
className: "flex-wrap",
|
|
1526
|
+
children: [
|
|
1527
|
+
/* @__PURE__ */ jsxDEV3(Badge, {
|
|
1528
|
+
variant: "outline",
|
|
1529
|
+
children: label
|
|
1530
|
+
}, undefined, false, undefined, this),
|
|
1531
|
+
/* @__PURE__ */ jsxDEV3(Button, {
|
|
1532
|
+
variant: "outline",
|
|
1533
|
+
size: "sm",
|
|
1534
|
+
onPress: () => firstRow?.toggleExpanded?.(!firstRow?.isExpanded),
|
|
1535
|
+
children: "Expand First Row"
|
|
1536
|
+
}, undefined, false, undefined, this),
|
|
1537
|
+
/* @__PURE__ */ jsxDEV3(Button, {
|
|
1538
|
+
variant: "outline",
|
|
1539
|
+
size: "sm",
|
|
1540
|
+
onPress: () => toggleColumn?.toggleVisibility?.(!toggleColumn?.visible),
|
|
1541
|
+
children: toggleColumn?.visible ? toggleVisibleLabel : toggleHiddenLabel
|
|
1542
|
+
}, undefined, false, undefined, this),
|
|
1543
|
+
/* @__PURE__ */ jsxDEV3(Button, {
|
|
1544
|
+
variant: "outline",
|
|
1545
|
+
size: "sm",
|
|
1546
|
+
onPress: () => pinColumn?.pin?.(pinTarget),
|
|
1547
|
+
children: pinColumn?.pinState === "left" ? `Unpin ${pinLabel}` : `Pin ${pinLabel}`
|
|
1548
|
+
}, undefined, false, undefined, this),
|
|
1549
|
+
/* @__PURE__ */ jsxDEV3(Button, {
|
|
1550
|
+
variant: "outline",
|
|
1551
|
+
size: "sm",
|
|
1552
|
+
onPress: () => resizeColumn?.resizeBy?.(40),
|
|
1553
|
+
children: resizeLabel
|
|
1554
|
+
}, undefined, false, undefined, this)
|
|
1555
|
+
]
|
|
1556
|
+
}, undefined, true, undefined, this);
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
// src/ui/tables/ConnectionsTable.tsx
|
|
1560
|
+
import { DataTable } from "@contractspec/lib.design-system";
|
|
1561
|
+
import { useContractTable } from "@contractspec/lib.presentation-runtime-react";
|
|
1562
|
+
import { VStack } from "@contractspec/lib.ui-kit-web/ui/stack";
|
|
1563
|
+
import { Text } from "@contractspec/lib.ui-kit-web/ui/text";
|
|
1564
|
+
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
1565
|
+
"use client";
|
|
1566
|
+
function ConnectionsTable({
|
|
1567
|
+
connections
|
|
1568
|
+
}) {
|
|
1569
|
+
const controller = useContractTable({
|
|
1570
|
+
data: connections,
|
|
1571
|
+
columns: [
|
|
1572
|
+
{
|
|
1573
|
+
id: "connection",
|
|
1574
|
+
header: "Connection",
|
|
1575
|
+
label: "Connection",
|
|
1576
|
+
accessor: (connection) => connection.name,
|
|
1577
|
+
cell: ({ item }) => /* @__PURE__ */ jsxDEV4(VStack, {
|
|
1578
|
+
gap: "xs",
|
|
1579
|
+
children: [
|
|
1580
|
+
/* @__PURE__ */ jsxDEV4(Text, {
|
|
1581
|
+
className: "font-medium text-sm",
|
|
1582
|
+
children: item.name
|
|
1583
|
+
}, undefined, false, undefined, this),
|
|
1584
|
+
/* @__PURE__ */ jsxDEV4(Text, {
|
|
1585
|
+
className: "text-muted-foreground text-xs",
|
|
1586
|
+
children: [
|
|
1587
|
+
"Created ",
|
|
1588
|
+
item.createdAt.toLocaleDateString()
|
|
1589
|
+
]
|
|
1590
|
+
}, undefined, true, undefined, this)
|
|
1591
|
+
]
|
|
1592
|
+
}, undefined, true, undefined, this),
|
|
1593
|
+
size: 240,
|
|
1594
|
+
minSize: 180,
|
|
1595
|
+
canSort: true,
|
|
1596
|
+
canPin: true,
|
|
1597
|
+
canResize: true
|
|
1598
|
+
},
|
|
1599
|
+
{
|
|
1600
|
+
id: "status",
|
|
1601
|
+
header: "Status",
|
|
1602
|
+
label: "Status",
|
|
1603
|
+
accessorKey: "status",
|
|
1604
|
+
cell: ({ value }) => /* @__PURE__ */ jsxDEV4(StatusBadge, {
|
|
1605
|
+
status: String(value)
|
|
1606
|
+
}, undefined, false, undefined, this),
|
|
1607
|
+
size: 150,
|
|
1608
|
+
canSort: true,
|
|
1609
|
+
canPin: true,
|
|
1610
|
+
canResize: true
|
|
1611
|
+
},
|
|
1612
|
+
{
|
|
1613
|
+
id: "lastSyncAt",
|
|
1614
|
+
header: "Last Sync",
|
|
1615
|
+
label: "Last Sync",
|
|
1616
|
+
accessor: (connection) => connection.lastSyncAt?.getTime() ?? 0,
|
|
1617
|
+
cell: ({ item }) => formatDateTime(item.lastSyncAt),
|
|
1618
|
+
size: 200,
|
|
1619
|
+
canSort: true,
|
|
1620
|
+
canHide: true,
|
|
1621
|
+
canResize: true
|
|
1622
|
+
},
|
|
1623
|
+
{
|
|
1624
|
+
id: "errorMessage",
|
|
1625
|
+
header: "Errors",
|
|
1626
|
+
label: "Errors",
|
|
1627
|
+
accessor: (connection) => connection.errorMessage ?? "",
|
|
1628
|
+
cell: ({ value }) => String(value || "No errors"),
|
|
1629
|
+
size: 240,
|
|
1630
|
+
canHide: true,
|
|
1631
|
+
canResize: true
|
|
1632
|
+
}
|
|
1633
|
+
],
|
|
1634
|
+
initialState: {
|
|
1635
|
+
pagination: { pageIndex: 0, pageSize: 3 },
|
|
1636
|
+
columnVisibility: { errorMessage: false },
|
|
1637
|
+
columnPinning: { left: ["connection"], right: [] }
|
|
1638
|
+
},
|
|
1639
|
+
renderExpandedContent: (connection) => /* @__PURE__ */ jsxDEV4(VStack, {
|
|
1640
|
+
gap: "sm",
|
|
1641
|
+
className: "py-2",
|
|
1642
|
+
children: [
|
|
1643
|
+
/* @__PURE__ */ jsxDEV4(Text, {
|
|
1644
|
+
className: "font-medium text-sm",
|
|
1645
|
+
children: "Credentials"
|
|
1646
|
+
}, undefined, false, undefined, this),
|
|
1647
|
+
/* @__PURE__ */ jsxDEV4("pre", {
|
|
1648
|
+
className: "overflow-auto rounded-md bg-muted/40 p-3 text-xs",
|
|
1649
|
+
children: formatJson(connection.credentials)
|
|
1650
|
+
}, undefined, false, undefined, this),
|
|
1651
|
+
/* @__PURE__ */ jsxDEV4(Text, {
|
|
1652
|
+
className: "font-medium text-sm",
|
|
1653
|
+
children: "Config"
|
|
1654
|
+
}, undefined, false, undefined, this),
|
|
1655
|
+
/* @__PURE__ */ jsxDEV4("pre", {
|
|
1656
|
+
className: "overflow-auto rounded-md bg-muted/40 p-3 text-xs",
|
|
1657
|
+
children: formatJson(connection.config)
|
|
1658
|
+
}, undefined, false, undefined, this),
|
|
1659
|
+
/* @__PURE__ */ jsxDEV4(Text, {
|
|
1660
|
+
className: "text-muted-foreground text-sm",
|
|
1661
|
+
children: connection.errorMessage ?? "No sync errors recorded."
|
|
1662
|
+
}, undefined, false, undefined, this)
|
|
1663
|
+
]
|
|
1664
|
+
}, undefined, true, undefined, this),
|
|
1665
|
+
getCanExpand: () => true
|
|
1666
|
+
});
|
|
1667
|
+
return /* @__PURE__ */ jsxDEV4(DataTable, {
|
|
1668
|
+
controller,
|
|
1669
|
+
title: "Connections",
|
|
1670
|
+
description: "Client-mode ContractSpec table with visibility, pinning, resizing, and expanded diagnostics.",
|
|
1671
|
+
toolbar: /* @__PURE__ */ jsxDEV4(IntegrationTableToolbar, {
|
|
1672
|
+
controller,
|
|
1673
|
+
label: `${connections.length} total connections`,
|
|
1674
|
+
toggleColumnId: "errorMessage",
|
|
1675
|
+
toggleVisibleLabel: "Hide Error Column",
|
|
1676
|
+
toggleHiddenLabel: "Show Error Column",
|
|
1677
|
+
pinColumnId: "status",
|
|
1678
|
+
pinLabel: "Status",
|
|
1679
|
+
resizeColumnId: "connection",
|
|
1680
|
+
resizeLabel: "Widen Connection"
|
|
1681
|
+
}, undefined, false, undefined, this),
|
|
1682
|
+
emptyState: /* @__PURE__ */ jsxDEV4("div", {
|
|
1683
|
+
className: "rounded-md border border-dashed p-8 text-center text-muted-foreground text-sm",
|
|
1684
|
+
children: "No connections found"
|
|
1685
|
+
}, undefined, false, undefined, this)
|
|
1686
|
+
}, undefined, false, undefined, this);
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
// src/ui/tables/SyncConfigsTable.tsx
|
|
1690
|
+
import { DataTable as DataTable2 } from "@contractspec/lib.design-system";
|
|
1691
|
+
import { useContractTable as useContractTable2 } from "@contractspec/lib.presentation-runtime-react";
|
|
1692
|
+
import { VStack as VStack2 } from "@contractspec/lib.ui-kit-web/ui/stack";
|
|
1693
|
+
import { Text as Text2 } from "@contractspec/lib.ui-kit-web/ui/text";
|
|
1694
|
+
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
|
1695
|
+
"use client";
|
|
1696
|
+
function SyncConfigsTable({
|
|
1697
|
+
syncConfigs
|
|
1698
|
+
}) {
|
|
1699
|
+
const controller = useContractTable2({
|
|
1700
|
+
data: syncConfigs,
|
|
1701
|
+
columns: [
|
|
1702
|
+
{
|
|
1703
|
+
id: "sync",
|
|
1704
|
+
header: "Sync Config",
|
|
1705
|
+
label: "Sync Config",
|
|
1706
|
+
accessor: (sync) => sync.name,
|
|
1707
|
+
cell: ({ item }) => /* @__PURE__ */ jsxDEV5(VStack2, {
|
|
1708
|
+
gap: "xs",
|
|
1709
|
+
children: [
|
|
1710
|
+
/* @__PURE__ */ jsxDEV5(Text2, {
|
|
1711
|
+
className: "font-medium text-sm",
|
|
1712
|
+
children: item.name
|
|
1713
|
+
}, undefined, false, undefined, this),
|
|
1714
|
+
/* @__PURE__ */ jsxDEV5(Text2, {
|
|
1715
|
+
className: "text-muted-foreground text-xs",
|
|
1716
|
+
children: [
|
|
1717
|
+
item.sourceEntity,
|
|
1718
|
+
" → ",
|
|
1719
|
+
item.targetEntity
|
|
1720
|
+
]
|
|
1721
|
+
}, undefined, true, undefined, this)
|
|
1722
|
+
]
|
|
1723
|
+
}, undefined, true, undefined, this),
|
|
1724
|
+
size: 260,
|
|
1725
|
+
minSize: 200,
|
|
1726
|
+
canSort: true,
|
|
1727
|
+
canPin: true,
|
|
1728
|
+
canResize: true
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
id: "frequency",
|
|
1732
|
+
header: "Frequency",
|
|
1733
|
+
label: "Frequency",
|
|
1734
|
+
accessorKey: "frequency",
|
|
1735
|
+
size: 160,
|
|
1736
|
+
canSort: true,
|
|
1737
|
+
canHide: true,
|
|
1738
|
+
canResize: true
|
|
1739
|
+
},
|
|
1740
|
+
{
|
|
1741
|
+
id: "status",
|
|
1742
|
+
header: "Status",
|
|
1743
|
+
label: "Status",
|
|
1744
|
+
accessorKey: "status",
|
|
1745
|
+
cell: ({ value }) => /* @__PURE__ */ jsxDEV5(StatusBadge, {
|
|
1746
|
+
status: String(value)
|
|
1747
|
+
}, undefined, false, undefined, this),
|
|
1748
|
+
size: 150,
|
|
1749
|
+
canSort: true,
|
|
1750
|
+
canPin: true,
|
|
1751
|
+
canResize: true
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
id: "recordsSynced",
|
|
1755
|
+
header: "Records",
|
|
1756
|
+
label: "Records",
|
|
1757
|
+
accessorKey: "recordsSynced",
|
|
1758
|
+
align: "right",
|
|
1759
|
+
size: 140,
|
|
1760
|
+
canSort: true,
|
|
1761
|
+
canResize: true
|
|
1762
|
+
},
|
|
1763
|
+
{
|
|
1764
|
+
id: "lastRunAt",
|
|
1765
|
+
header: "Last Run",
|
|
1766
|
+
label: "Last Run",
|
|
1767
|
+
accessor: (sync) => sync.lastRunAt?.getTime() ?? 0,
|
|
1768
|
+
cell: ({ item }) => formatDateTime(item.lastRunAt),
|
|
1769
|
+
size: 200,
|
|
1770
|
+
canSort: true,
|
|
1771
|
+
canHide: true,
|
|
1772
|
+
canResize: true
|
|
1773
|
+
}
|
|
1774
|
+
],
|
|
1775
|
+
initialState: {
|
|
1776
|
+
pagination: { pageIndex: 0, pageSize: 3 },
|
|
1777
|
+
columnVisibility: { lastRunAt: false },
|
|
1778
|
+
columnPinning: { left: ["sync"], right: [] }
|
|
1779
|
+
},
|
|
1780
|
+
renderExpandedContent: (sync) => /* @__PURE__ */ jsxDEV5(VStack2, {
|
|
1781
|
+
gap: "sm",
|
|
1782
|
+
className: "py-2",
|
|
1783
|
+
children: [
|
|
1784
|
+
/* @__PURE__ */ jsxDEV5(Text2, {
|
|
1785
|
+
className: "text-muted-foreground text-sm",
|
|
1786
|
+
children: [
|
|
1787
|
+
"Connection ",
|
|
1788
|
+
sync.connectionId
|
|
1789
|
+
]
|
|
1790
|
+
}, undefined, true, undefined, this),
|
|
1791
|
+
/* @__PURE__ */ jsxDEV5(Text2, {
|
|
1792
|
+
className: "text-muted-foreground text-sm",
|
|
1793
|
+
children: [
|
|
1794
|
+
"Last run: ",
|
|
1795
|
+
formatDateTime(sync.lastRunAt)
|
|
1796
|
+
]
|
|
1797
|
+
}, undefined, true, undefined, this),
|
|
1798
|
+
/* @__PURE__ */ jsxDEV5(Text2, {
|
|
1799
|
+
className: "text-muted-foreground text-sm",
|
|
1800
|
+
children: [
|
|
1801
|
+
"Last status: ",
|
|
1802
|
+
sync.lastRunStatus ?? "No runs recorded"
|
|
1803
|
+
]
|
|
1804
|
+
}, undefined, true, undefined, this),
|
|
1805
|
+
/* @__PURE__ */ jsxDEV5(Text2, {
|
|
1806
|
+
className: "text-muted-foreground text-sm",
|
|
1807
|
+
children: [
|
|
1808
|
+
"Updated ",
|
|
1809
|
+
sync.updatedAt.toLocaleString()
|
|
1810
|
+
]
|
|
1811
|
+
}, undefined, true, undefined, this)
|
|
1812
|
+
]
|
|
1813
|
+
}, undefined, true, undefined, this),
|
|
1814
|
+
getCanExpand: () => true
|
|
1815
|
+
});
|
|
1816
|
+
return /* @__PURE__ */ jsxDEV5(DataTable2, {
|
|
1817
|
+
controller,
|
|
1818
|
+
title: "Sync Configs",
|
|
1819
|
+
description: "Shared table primitives applied to sync monitoring without changing the surrounding dashboard layout.",
|
|
1820
|
+
toolbar: /* @__PURE__ */ jsxDEV5(IntegrationTableToolbar, {
|
|
1821
|
+
controller,
|
|
1822
|
+
label: `${syncConfigs.length} syncs`,
|
|
1823
|
+
toggleColumnId: "lastRunAt",
|
|
1824
|
+
toggleVisibleLabel: "Hide Last Run",
|
|
1825
|
+
toggleHiddenLabel: "Show Last Run",
|
|
1826
|
+
pinColumnId: "status",
|
|
1827
|
+
pinLabel: "Status",
|
|
1828
|
+
resizeColumnId: "sync",
|
|
1829
|
+
resizeLabel: "Widen Sync"
|
|
1830
|
+
}, undefined, false, undefined, this),
|
|
1831
|
+
emptyState: /* @__PURE__ */ jsxDEV5("div", {
|
|
1832
|
+
className: "rounded-md border border-dashed p-8 text-center text-muted-foreground text-sm",
|
|
1833
|
+
children: "No sync configurations found"
|
|
1834
|
+
}, undefined, false, undefined, this)
|
|
1835
|
+
}, undefined, false, undefined, this);
|
|
1836
|
+
}
|
|
1232
1837
|
// src/ui/IntegrationDashboard.tsx
|
|
1233
1838
|
import {
|
|
1234
|
-
Button,
|
|
1839
|
+
Button as Button2,
|
|
1235
1840
|
ErrorState,
|
|
1236
1841
|
LoaderBlock,
|
|
1237
1842
|
StatCard,
|
|
1238
1843
|
StatCardGroup
|
|
1239
1844
|
} from "@contractspec/lib.design-system";
|
|
1240
1845
|
import { useState as useState2 } from "react";
|
|
1241
|
-
import { jsxDEV as
|
|
1846
|
+
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
1242
1847
|
"use client";
|
|
1243
1848
|
var STATUS_COLORS = {
|
|
1244
1849
|
ACTIVE: "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",
|
|
@@ -1275,32 +1880,32 @@ function IntegrationDashboard() {
|
|
|
1275
1880
|
{ id: "chat", label: "Chat", icon: "\uD83D\uDCAC" }
|
|
1276
1881
|
];
|
|
1277
1882
|
if (loading) {
|
|
1278
|
-
return /* @__PURE__ */
|
|
1883
|
+
return /* @__PURE__ */ jsxDEV6(LoaderBlock, {
|
|
1279
1884
|
label: "Loading Integrations..."
|
|
1280
1885
|
}, undefined, false, undefined, this);
|
|
1281
1886
|
}
|
|
1282
1887
|
if (error) {
|
|
1283
|
-
return /* @__PURE__ */
|
|
1888
|
+
return /* @__PURE__ */ jsxDEV6(ErrorState, {
|
|
1284
1889
|
title: "Failed to load Integrations",
|
|
1285
1890
|
description: error.message,
|
|
1286
1891
|
onRetry: refetch,
|
|
1287
1892
|
retryLabel: "Retry"
|
|
1288
1893
|
}, undefined, false, undefined, this);
|
|
1289
1894
|
}
|
|
1290
|
-
return /* @__PURE__ */
|
|
1895
|
+
return /* @__PURE__ */ jsxDEV6("div", {
|
|
1291
1896
|
className: "space-y-6",
|
|
1292
1897
|
children: [
|
|
1293
|
-
/* @__PURE__ */
|
|
1898
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
1294
1899
|
className: "flex items-center justify-between",
|
|
1295
1900
|
children: [
|
|
1296
|
-
/* @__PURE__ */
|
|
1901
|
+
/* @__PURE__ */ jsxDEV6("h2", {
|
|
1297
1902
|
className: "font-bold text-2xl",
|
|
1298
1903
|
children: "Integration Hub"
|
|
1299
1904
|
}, undefined, false, undefined, this),
|
|
1300
|
-
/* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ jsxDEV6(Button2, {
|
|
1301
1906
|
onClick: () => alert("Add integration modal"),
|
|
1302
1907
|
children: [
|
|
1303
|
-
/* @__PURE__ */
|
|
1908
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
1304
1909
|
className: "mr-2",
|
|
1305
1910
|
children: "+"
|
|
1306
1911
|
}, undefined, false, undefined, this),
|
|
@@ -1309,66 +1914,71 @@ function IntegrationDashboard() {
|
|
|
1309
1914
|
}, undefined, true, undefined, this)
|
|
1310
1915
|
]
|
|
1311
1916
|
}, undefined, true, undefined, this),
|
|
1312
|
-
/* @__PURE__ */
|
|
1917
|
+
/* @__PURE__ */ jsxDEV6(StatCardGroup, {
|
|
1313
1918
|
children: [
|
|
1314
|
-
/* @__PURE__ */
|
|
1919
|
+
/* @__PURE__ */ jsxDEV6(StatCard, {
|
|
1315
1920
|
label: "Integrations",
|
|
1316
1921
|
value: stats.totalIntegrations,
|
|
1317
1922
|
hint: `${stats.activeIntegrations} active`
|
|
1318
1923
|
}, undefined, false, undefined, this),
|
|
1319
|
-
/* @__PURE__ */
|
|
1924
|
+
/* @__PURE__ */ jsxDEV6(StatCard, {
|
|
1320
1925
|
label: "Connections",
|
|
1321
1926
|
value: stats.totalConnections,
|
|
1322
1927
|
hint: `${stats.connectedCount} connected`
|
|
1323
1928
|
}, undefined, false, undefined, this),
|
|
1324
|
-
/* @__PURE__ */
|
|
1929
|
+
/* @__PURE__ */ jsxDEV6(StatCard, {
|
|
1325
1930
|
label: "Syncs",
|
|
1326
1931
|
value: stats.totalSyncs,
|
|
1327
1932
|
hint: `${stats.activeSyncs} active`
|
|
1328
1933
|
}, undefined, false, undefined, this)
|
|
1329
1934
|
]
|
|
1330
1935
|
}, undefined, true, undefined, this),
|
|
1331
|
-
/* @__PURE__ */
|
|
1936
|
+
/* @__PURE__ */ jsxDEV6(IntegrationVisualizationOverview, {
|
|
1937
|
+
connections,
|
|
1938
|
+
integrations,
|
|
1939
|
+
syncConfigs
|
|
1940
|
+
}, undefined, false, undefined, this),
|
|
1941
|
+
/* @__PURE__ */ jsxDEV6("nav", {
|
|
1332
1942
|
className: "flex gap-1 rounded-lg bg-muted p-1",
|
|
1333
1943
|
role: "tablist",
|
|
1334
|
-
children: tabs.map((tab) => /* @__PURE__ */
|
|
1944
|
+
children: tabs.map((tab) => /* @__PURE__ */ jsxDEV6(Button2, {
|
|
1335
1945
|
type: "button",
|
|
1336
1946
|
role: "tab",
|
|
1337
1947
|
"aria-selected": activeTab === tab.id,
|
|
1338
1948
|
onClick: () => setActiveTab(tab.id),
|
|
1339
1949
|
className: `flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 font-medium text-sm transition-colors ${activeTab === tab.id ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
1340
1950
|
children: [
|
|
1341
|
-
/* @__PURE__ */
|
|
1951
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
1342
1952
|
children: tab.icon
|
|
1343
1953
|
}, undefined, false, undefined, this),
|
|
1344
1954
|
tab.label
|
|
1345
1955
|
]
|
|
1346
1956
|
}, tab.id, true, undefined, this))
|
|
1347
1957
|
}, undefined, false, undefined, this),
|
|
1348
|
-
/* @__PURE__ */
|
|
1958
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
1349
1959
|
className: "min-h-[400px]",
|
|
1350
1960
|
role: "tabpanel",
|
|
1351
1961
|
children: [
|
|
1352
|
-
activeTab === "integrations" && /* @__PURE__ */
|
|
1962
|
+
activeTab === "integrations" && /* @__PURE__ */ jsxDEV6("div", {
|
|
1353
1963
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
1354
1964
|
children: [
|
|
1355
|
-
integrations.map((integration) => /* @__PURE__ */
|
|
1965
|
+
integrations.map((integration) => /* @__PURE__ */ jsxDEV6("div", {
|
|
1356
1966
|
className: "cursor-pointer rounded-lg border border-border bg-card p-4 transition-colors hover:bg-muted/50",
|
|
1357
1967
|
children: [
|
|
1358
|
-
/* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
1359
1969
|
className: "mb-3 flex items-center gap-3",
|
|
1360
1970
|
children: [
|
|
1361
|
-
/* @__PURE__ */
|
|
1971
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
1362
1972
|
className: "text-2xl",
|
|
1363
1973
|
children: TYPE_ICONS[integration.type] ?? "⚙️"
|
|
1364
1974
|
}, undefined, false, undefined, this),
|
|
1365
|
-
/* @__PURE__ */
|
|
1975
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
1366
1976
|
children: [
|
|
1367
|
-
/* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ jsxDEV6("h3", {
|
|
1368
1978
|
className: "font-medium",
|
|
1369
1979
|
children: integration.name
|
|
1370
1980
|
}, undefined, false, undefined, this),
|
|
1371
|
-
/* @__PURE__ */
|
|
1981
|
+
/* @__PURE__ */ jsxDEV6("p", {
|
|
1372
1982
|
className: "text-muted-foreground text-sm",
|
|
1373
1983
|
children: integration.type
|
|
1374
1984
|
}, undefined, false, undefined, this)
|
|
@@ -1376,14 +1986,14 @@ function IntegrationDashboard() {
|
|
|
1376
1986
|
}, undefined, true, undefined, this)
|
|
1377
1987
|
]
|
|
1378
1988
|
}, undefined, true, undefined, this),
|
|
1379
|
-
/* @__PURE__ */
|
|
1989
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
1380
1990
|
className: "flex items-center justify-between",
|
|
1381
1991
|
children: [
|
|
1382
|
-
/* @__PURE__ */
|
|
1992
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
1383
1993
|
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[integration.status] ?? ""}`,
|
|
1384
1994
|
children: integration.status
|
|
1385
1995
|
}, undefined, false, undefined, this),
|
|
1386
|
-
/* @__PURE__ */
|
|
1996
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
1387
1997
|
className: "text-muted-foreground text-xs",
|
|
1388
1998
|
children: integration.createdAt.toLocaleDateString()
|
|
1389
1999
|
}, undefined, false, undefined, this)
|
|
@@ -1391,75 +2001,16 @@ function IntegrationDashboard() {
|
|
|
1391
2001
|
}, undefined, true, undefined, this)
|
|
1392
2002
|
]
|
|
1393
2003
|
}, integration.id, true, undefined, this)),
|
|
1394
|
-
integrations.length === 0 && /* @__PURE__ */
|
|
2004
|
+
integrations.length === 0 && /* @__PURE__ */ jsxDEV6("div", {
|
|
1395
2005
|
className: "col-span-full flex h-64 items-center justify-center text-muted-foreground",
|
|
1396
2006
|
children: "No integrations configured"
|
|
1397
2007
|
}, undefined, false, undefined, this)
|
|
1398
2008
|
]
|
|
1399
2009
|
}, undefined, true, undefined, this),
|
|
1400
|
-
activeTab === "connections" && /* @__PURE__ */
|
|
1401
|
-
|
|
1402
|
-
children: /* @__PURE__ */ jsxDEV2("table", {
|
|
1403
|
-
className: "w-full",
|
|
1404
|
-
children: [
|
|
1405
|
-
/* @__PURE__ */ jsxDEV2("thead", {
|
|
1406
|
-
className: "border-border border-b bg-muted/30",
|
|
1407
|
-
children: /* @__PURE__ */ jsxDEV2("tr", {
|
|
1408
|
-
children: [
|
|
1409
|
-
/* @__PURE__ */ jsxDEV2("th", {
|
|
1410
|
-
className: "px-4 py-3 text-left font-medium text-sm",
|
|
1411
|
-
children: "Connection"
|
|
1412
|
-
}, undefined, false, undefined, this),
|
|
1413
|
-
/* @__PURE__ */ jsxDEV2("th", {
|
|
1414
|
-
className: "px-4 py-3 text-left font-medium text-sm",
|
|
1415
|
-
children: "Status"
|
|
1416
|
-
}, undefined, false, undefined, this),
|
|
1417
|
-
/* @__PURE__ */ jsxDEV2("th", {
|
|
1418
|
-
className: "px-4 py-3 text-left font-medium text-sm",
|
|
1419
|
-
children: "Last Sync"
|
|
1420
|
-
}, undefined, false, undefined, this)
|
|
1421
|
-
]
|
|
1422
|
-
}, undefined, true, undefined, this)
|
|
1423
|
-
}, undefined, false, undefined, this),
|
|
1424
|
-
/* @__PURE__ */ jsxDEV2("tbody", {
|
|
1425
|
-
className: "divide-y divide-border",
|
|
1426
|
-
children: [
|
|
1427
|
-
connections.map((conn) => /* @__PURE__ */ jsxDEV2("tr", {
|
|
1428
|
-
className: "hover:bg-muted/50",
|
|
1429
|
-
children: [
|
|
1430
|
-
/* @__PURE__ */ jsxDEV2("td", {
|
|
1431
|
-
className: "px-4 py-3",
|
|
1432
|
-
children: /* @__PURE__ */ jsxDEV2("div", {
|
|
1433
|
-
className: "font-medium",
|
|
1434
|
-
children: conn.name
|
|
1435
|
-
}, undefined, false, undefined, this)
|
|
1436
|
-
}, undefined, false, undefined, this),
|
|
1437
|
-
/* @__PURE__ */ jsxDEV2("td", {
|
|
1438
|
-
className: "px-4 py-3",
|
|
1439
|
-
children: /* @__PURE__ */ jsxDEV2("span", {
|
|
1440
|
-
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[conn.status] ?? ""}`,
|
|
1441
|
-
children: conn.status
|
|
1442
|
-
}, undefined, false, undefined, this)
|
|
1443
|
-
}, undefined, false, undefined, this),
|
|
1444
|
-
/* @__PURE__ */ jsxDEV2("td", {
|
|
1445
|
-
className: "px-4 py-3 text-muted-foreground text-sm",
|
|
1446
|
-
children: conn.lastSyncAt?.toLocaleString() ?? "Never"
|
|
1447
|
-
}, undefined, false, undefined, this)
|
|
1448
|
-
]
|
|
1449
|
-
}, conn.id, true, undefined, this)),
|
|
1450
|
-
connections.length === 0 && /* @__PURE__ */ jsxDEV2("tr", {
|
|
1451
|
-
children: /* @__PURE__ */ jsxDEV2("td", {
|
|
1452
|
-
colSpan: 3,
|
|
1453
|
-
className: "px-4 py-8 text-center text-muted-foreground",
|
|
1454
|
-
children: "No connections found"
|
|
1455
|
-
}, undefined, false, undefined, this)
|
|
1456
|
-
}, undefined, false, undefined, this)
|
|
1457
|
-
]
|
|
1458
|
-
}, undefined, true, undefined, this)
|
|
1459
|
-
]
|
|
1460
|
-
}, undefined, true, undefined, this)
|
|
2010
|
+
activeTab === "connections" && /* @__PURE__ */ jsxDEV6(ConnectionsTable, {
|
|
2011
|
+
connections
|
|
1461
2012
|
}, undefined, false, undefined, this),
|
|
1462
|
-
activeTab === "chat" && /* @__PURE__ */
|
|
2013
|
+
activeTab === "chat" && /* @__PURE__ */ jsxDEV6(IntegrationHubChat, {
|
|
1463
2014
|
proxyUrl: "/api/chat",
|
|
1464
2015
|
thinkingLevel: "thinking",
|
|
1465
2016
|
suggestions: [
|
|
@@ -1469,85 +2020,8 @@ function IntegrationDashboard() {
|
|
|
1469
2020
|
],
|
|
1470
2021
|
className: "min-h-[400px]"
|
|
1471
2022
|
}, undefined, false, undefined, this),
|
|
1472
|
-
activeTab === "syncs" && /* @__PURE__ */
|
|
1473
|
-
|
|
1474
|
-
children: /* @__PURE__ */ jsxDEV2("table", {
|
|
1475
|
-
className: "w-full",
|
|
1476
|
-
children: [
|
|
1477
|
-
/* @__PURE__ */ jsxDEV2("thead", {
|
|
1478
|
-
className: "border-border border-b bg-muted/30",
|
|
1479
|
-
children: /* @__PURE__ */ jsxDEV2("tr", {
|
|
1480
|
-
children: [
|
|
1481
|
-
/* @__PURE__ */ jsxDEV2("th", {
|
|
1482
|
-
className: "px-4 py-3 text-left font-medium text-sm",
|
|
1483
|
-
children: "Sync Config"
|
|
1484
|
-
}, undefined, false, undefined, this),
|
|
1485
|
-
/* @__PURE__ */ jsxDEV2("th", {
|
|
1486
|
-
className: "px-4 py-3 text-left font-medium text-sm",
|
|
1487
|
-
children: "Frequency"
|
|
1488
|
-
}, undefined, false, undefined, this),
|
|
1489
|
-
/* @__PURE__ */ jsxDEV2("th", {
|
|
1490
|
-
className: "px-4 py-3 text-left font-medium text-sm",
|
|
1491
|
-
children: "Status"
|
|
1492
|
-
}, undefined, false, undefined, this),
|
|
1493
|
-
/* @__PURE__ */ jsxDEV2("th", {
|
|
1494
|
-
className: "px-4 py-3 text-left font-medium text-sm",
|
|
1495
|
-
children: "Records"
|
|
1496
|
-
}, undefined, false, undefined, this)
|
|
1497
|
-
]
|
|
1498
|
-
}, undefined, true, undefined, this)
|
|
1499
|
-
}, undefined, false, undefined, this),
|
|
1500
|
-
/* @__PURE__ */ jsxDEV2("tbody", {
|
|
1501
|
-
className: "divide-y divide-border",
|
|
1502
|
-
children: [
|
|
1503
|
-
syncConfigs.map((sync) => /* @__PURE__ */ jsxDEV2("tr", {
|
|
1504
|
-
className: "hover:bg-muted/50",
|
|
1505
|
-
children: [
|
|
1506
|
-
/* @__PURE__ */ jsxDEV2("td", {
|
|
1507
|
-
className: "px-4 py-3",
|
|
1508
|
-
children: [
|
|
1509
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
1510
|
-
className: "font-medium",
|
|
1511
|
-
children: sync.name
|
|
1512
|
-
}, undefined, false, undefined, this),
|
|
1513
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
1514
|
-
className: "text-muted-foreground text-sm",
|
|
1515
|
-
children: [
|
|
1516
|
-
sync.sourceEntity,
|
|
1517
|
-
" → ",
|
|
1518
|
-
sync.targetEntity
|
|
1519
|
-
]
|
|
1520
|
-
}, undefined, true, undefined, this)
|
|
1521
|
-
]
|
|
1522
|
-
}, undefined, true, undefined, this),
|
|
1523
|
-
/* @__PURE__ */ jsxDEV2("td", {
|
|
1524
|
-
className: "px-4 py-3 text-sm",
|
|
1525
|
-
children: sync.frequency
|
|
1526
|
-
}, undefined, false, undefined, this),
|
|
1527
|
-
/* @__PURE__ */ jsxDEV2("td", {
|
|
1528
|
-
className: "px-4 py-3",
|
|
1529
|
-
children: /* @__PURE__ */ jsxDEV2("span", {
|
|
1530
|
-
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[sync.status] ?? ""}`,
|
|
1531
|
-
children: sync.status
|
|
1532
|
-
}, undefined, false, undefined, this)
|
|
1533
|
-
}, undefined, false, undefined, this),
|
|
1534
|
-
/* @__PURE__ */ jsxDEV2("td", {
|
|
1535
|
-
className: "px-4 py-3 text-muted-foreground text-sm",
|
|
1536
|
-
children: sync.recordsSynced.toLocaleString()
|
|
1537
|
-
}, undefined, false, undefined, this)
|
|
1538
|
-
]
|
|
1539
|
-
}, sync.id, true, undefined, this)),
|
|
1540
|
-
syncConfigs.length === 0 && /* @__PURE__ */ jsxDEV2("tr", {
|
|
1541
|
-
children: /* @__PURE__ */ jsxDEV2("td", {
|
|
1542
|
-
colSpan: 4,
|
|
1543
|
-
className: "px-4 py-8 text-center text-muted-foreground",
|
|
1544
|
-
children: "No sync configurations found"
|
|
1545
|
-
}, undefined, false, undefined, this)
|
|
1546
|
-
}, undefined, false, undefined, this)
|
|
1547
|
-
]
|
|
1548
|
-
}, undefined, true, undefined, this)
|
|
1549
|
-
]
|
|
1550
|
-
}, undefined, true, undefined, this)
|
|
2023
|
+
activeTab === "syncs" && /* @__PURE__ */ jsxDEV6(SyncConfigsTable, {
|
|
2024
|
+
syncConfigs
|
|
1551
2025
|
}, undefined, false, undefined, this)
|
|
1552
2026
|
]
|
|
1553
2027
|
}, undefined, true, undefined, this)
|
|
@@ -1692,6 +2166,7 @@ var integrationDashboardMarkdownRenderer = {
|
|
|
1692
2166
|
const integrations = mockIntegrations;
|
|
1693
2167
|
const connections = mockConnections;
|
|
1694
2168
|
const syncs = mockSyncConfigs;
|
|
2169
|
+
const visualizations = createIntegrationVisualizationSections(integrations, connections, syncs);
|
|
1695
2170
|
const activeIntegrations = integrations.filter((i) => i.status === "ACTIVE");
|
|
1696
2171
|
const connectedConnections = connections.filter((c) => c.status === "CONNECTED");
|
|
1697
2172
|
const errorConnections = connections.filter((c) => c.status === "ERROR");
|
|
@@ -1711,12 +2186,21 @@ var integrationDashboardMarkdownRenderer = {
|
|
|
1711
2186
|
`| Error Connections | ${errorConnections.length} |`,
|
|
1712
2187
|
`| Sync Configs | ${syncs.length} |`,
|
|
1713
2188
|
`| Records Synced (24h) | ${totalRecordsSynced.toLocaleString()} |`,
|
|
1714
|
-
""
|
|
1715
|
-
"## Integrations",
|
|
1716
|
-
"",
|
|
1717
|
-
"| Name | Type | Connections | Status |",
|
|
1718
|
-
"|------|------|-------------|--------|"
|
|
2189
|
+
""
|
|
1719
2190
|
];
|
|
2191
|
+
lines.push("## Visualization Overview");
|
|
2192
|
+
lines.push("");
|
|
2193
|
+
for (const item of [
|
|
2194
|
+
...visualizations.primaryItems,
|
|
2195
|
+
...visualizations.comparisonItems
|
|
2196
|
+
]) {
|
|
2197
|
+
lines.push(`- **${item.title}** via \`${item.spec.meta.key}\``);
|
|
2198
|
+
}
|
|
2199
|
+
lines.push("");
|
|
2200
|
+
lines.push("## Integrations");
|
|
2201
|
+
lines.push("");
|
|
2202
|
+
lines.push("| Name | Type | Connections | Status |");
|
|
2203
|
+
lines.push("|------|------|-------------|--------|");
|
|
1720
2204
|
for (const integration of integrations) {
|
|
1721
2205
|
const statusIcon = integration.status === "ACTIVE" ? "\uD83D\uDFE2" : "⚫";
|
|
1722
2206
|
lines.push(`| ${integration.name} | ${integration.type} | ${integration.connectionCount} | ${statusIcon} ${integration.status} |`);
|
|
@@ -1830,6 +2314,7 @@ export {
|
|
|
1830
2314
|
integrationDashboardMarkdownRenderer,
|
|
1831
2315
|
hasChanges,
|
|
1832
2316
|
createSyncEngine,
|
|
2317
|
+
createIntegrationVisualizationSections,
|
|
1833
2318
|
createIntegrationHandlers,
|
|
1834
2319
|
connectionListMarkdownRenderer,
|
|
1835
2320
|
computeChecksum,
|
|
@@ -1843,10 +2328,15 @@ export {
|
|
|
1843
2328
|
ListSyncRunsOutputModel,
|
|
1844
2329
|
ListSyncRunsInputModel,
|
|
1845
2330
|
ListSyncRunsContract,
|
|
2331
|
+
IntegrationVisualizationSpecs,
|
|
2332
|
+
IntegrationVisualizationRegistry,
|
|
2333
|
+
IntegrationVisualizationRefs,
|
|
2334
|
+
IntegrationTypeVisualization,
|
|
1846
2335
|
IntegrationStatusEnum,
|
|
1847
2336
|
IntegrationModel,
|
|
1848
2337
|
IntegrationHubChat,
|
|
1849
2338
|
IntegrationDashboard,
|
|
2339
|
+
HealthySyncMetricVisualization,
|
|
1850
2340
|
FieldMappingModel,
|
|
1851
2341
|
CreateSyncConfigInputModel,
|
|
1852
2342
|
CreateSyncConfigContract,
|
|
@@ -1854,10 +2344,12 @@ export {
|
|
|
1854
2344
|
CreateIntegrationContract,
|
|
1855
2345
|
CreateConnectionInputModel,
|
|
1856
2346
|
CreateConnectionContract,
|
|
2347
|
+
ConnectionStatusVisualization,
|
|
1857
2348
|
ConnectionStatusEnum,
|
|
1858
2349
|
ConnectionModel,
|
|
1859
2350
|
BasicSyncEngine,
|
|
1860
2351
|
BasicFieldTransformer,
|
|
2352
|
+
AttentionSyncMetricVisualization,
|
|
1861
2353
|
AddFieldMappingInputModel,
|
|
1862
2354
|
AddFieldMappingContract
|
|
1863
2355
|
};
|