@eventcatalog/core 3.4.0 → 3.4.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/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-VAGFX36R.js → chunk-363MMCIA.js} +1 -1
- package/dist/{chunk-Q4DKMESA.js → chunk-6TCIKRLP.js} +1 -1
- package/dist/{chunk-GLMX3ZTY.js → chunk-E4RUDCKA.js} +1 -1
- package/dist/{chunk-KFZIBXRQ.js → chunk-JKOCGMX6.js} +1 -1
- package/dist/{chunk-MJRHV77M.js → chunk-JMIRAK3A.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +5 -5
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +12 -11
- package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +21 -143
- package/eventcatalog/src/enterprise/mcp/mcp-server.ts +4 -4
- package/eventcatalog/src/env.d.ts +11 -0
- package/eventcatalog/src/pages/diagrams/[id]/[version]/embed.astro +433 -10
- package/eventcatalog/src/pages/diagrams/[id]/[version]/index.astro +21 -100
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +26 -143
- package/eventcatalog/src/types/mcp-modules.d.ts +66 -0
- package/eventcatalog/src/utils/mermaid-zoom.ts +751 -0
- package/package.json +2 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-6TCIKRLP.js";
|
|
4
|
+
import "../chunk-363MMCIA.js";
|
|
5
|
+
import "../chunk-JKOCGMX6.js";
|
|
6
6
|
import "../chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -109,7 +109,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
109
109
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
110
110
|
|
|
111
111
|
// package.json
|
|
112
|
-
var version = "3.4.
|
|
112
|
+
var version = "3.4.2";
|
|
113
113
|
|
|
114
114
|
// src/constants.ts
|
|
115
115
|
var VERSION = version;
|
package/dist/eventcatalog.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-PLNJC7NZ.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-6TCIKRLP.js";
|
|
10
|
+
import "./chunk-363MMCIA.js";
|
|
11
11
|
import {
|
|
12
12
|
runMigrations
|
|
13
13
|
} from "./chunk-BH3JMNAV.js";
|
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
} from "./chunk-5VBIXL6C.js";
|
|
22
22
|
import {
|
|
23
23
|
generate
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-JMIRAK3A.js";
|
|
25
25
|
import {
|
|
26
26
|
logger
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-E4RUDCKA.js";
|
|
28
28
|
import {
|
|
29
29
|
VERSION
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-JKOCGMX6.js";
|
|
31
31
|
import "./chunk-UPONRQSN.js";
|
|
32
32
|
|
|
33
33
|
// src/eventcatalog.ts
|
package/dist/generate.cjs
CHANGED
package/dist/generate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-JMIRAK3A.js";
|
|
4
|
+
import "./chunk-E4RUDCKA.js";
|
|
5
|
+
import "./chunk-JKOCGMX6.js";
|
|
6
6
|
import "./chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -469,6 +469,18 @@ export default function NestedSideBar() {
|
|
|
469
469
|
};
|
|
470
470
|
}, [isInitialized, findAndNavigateToUrl, currentPath]);
|
|
471
471
|
|
|
472
|
+
/**
|
|
473
|
+
* Check if a node is favorited
|
|
474
|
+
* Note: This hook must be defined before any early returns to comply with Rules of Hooks
|
|
475
|
+
*/
|
|
476
|
+
const isFavorited = useCallback(
|
|
477
|
+
(nodeKey: string | null): boolean => {
|
|
478
|
+
if (!nodeKey) return false;
|
|
479
|
+
return favorites.some((fav) => fav.nodeKey === nodeKey);
|
|
480
|
+
},
|
|
481
|
+
[favorites]
|
|
482
|
+
);
|
|
483
|
+
|
|
472
484
|
// Show loading state if no data yet
|
|
473
485
|
if (!data || roots.length === 0) {
|
|
474
486
|
return (
|
|
@@ -583,17 +595,6 @@ export default function NestedSideBar() {
|
|
|
583
595
|
}
|
|
584
596
|
};
|
|
585
597
|
|
|
586
|
-
/**
|
|
587
|
-
* Check if a node is favorited
|
|
588
|
-
*/
|
|
589
|
-
const isFavorited = useCallback(
|
|
590
|
-
(nodeKey: string | null): boolean => {
|
|
591
|
-
if (!nodeKey) return false;
|
|
592
|
-
return favorites.some((fav) => fav.nodeKey === nodeKey);
|
|
593
|
-
},
|
|
594
|
-
[favorites]
|
|
595
|
-
);
|
|
596
|
-
|
|
597
598
|
/**
|
|
598
599
|
* Toggle favorite status for a node
|
|
599
600
|
*/
|
|
@@ -368,157 +368,35 @@ const badges = doc?.badges || [];
|
|
|
368
368
|
|
|
369
369
|
setupObserver();
|
|
370
370
|
|
|
371
|
-
document.addEventListener('astro:page-load', () => {
|
|
372
|
-
const graphs = document.getElementsByClassName('mermaid');
|
|
373
|
-
if (document.getElementsByClassName('mermaid').length > 0) {
|
|
374
|
-
renderDiagrams(graphs);
|
|
375
|
-
}
|
|
376
|
-
});
|
|
377
|
-
|
|
378
|
-
async function renderDiagrams(graphs: any) {
|
|
379
|
-
const { default: mermaid } = await import('mermaid');
|
|
380
|
-
|
|
381
|
-
if (window.eventcatalog.mermaid) {
|
|
382
|
-
const { icons } = await import('@iconify-json/logos');
|
|
383
|
-
// @ts-ignore
|
|
384
|
-
const { iconPacks = [], enableSupportForElkLayout = false } = window.eventcatalog.mermaid ?? {};
|
|
385
|
-
|
|
386
|
-
if (iconPacks.length > 0) {
|
|
387
|
-
const iconPacksToRegister = iconPacks.map((name: string) => {
|
|
388
|
-
return {
|
|
389
|
-
name,
|
|
390
|
-
icons,
|
|
391
|
-
};
|
|
392
|
-
});
|
|
393
|
-
|
|
394
|
-
mermaid.registerIconPacks(iconPacksToRegister);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
if (enableSupportForElkLayout) {
|
|
398
|
-
// @ts-ignore
|
|
399
|
-
const { default: elkLayouts } = await import('@mermaid-js/layout-elk/dist/mermaid-layout-elk.core.mjs');
|
|
400
|
-
mermaid.registerLayoutLoaders(elkLayouts);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
// Detect current theme from data-theme attribute
|
|
405
|
-
const isDarkMode = document.documentElement.getAttribute('data-theme') === 'dark';
|
|
406
|
-
const currentTheme = isDarkMode ? 'dark' : 'default';
|
|
407
|
-
|
|
408
|
-
// Custom theme variables for better readability in dark mode
|
|
409
|
-
const darkThemeVariables = {
|
|
410
|
-
// Sequence diagram - improve text contrast
|
|
411
|
-
signalColor: '#f0f6fc',
|
|
412
|
-
signalTextColor: '#f0f6fc',
|
|
413
|
-
actorTextColor: '#0d1117',
|
|
414
|
-
actorBkg: '#f0f6fc',
|
|
415
|
-
actorBorder: '#484f58',
|
|
416
|
-
actorLineColor: '#6b7280',
|
|
417
|
-
// General text colors
|
|
418
|
-
primaryTextColor: '#f0f6fc',
|
|
419
|
-
secondaryTextColor: '#c9d1d9',
|
|
420
|
-
tertiaryTextColor: '#f0f6fc',
|
|
421
|
-
// Line colors
|
|
422
|
-
lineColor: '#6b7280',
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
mermaid.initialize({
|
|
426
|
-
// fontSize: 2,
|
|
427
|
-
flowchart: {
|
|
428
|
-
curve: 'linear',
|
|
429
|
-
rankSpacing: 0,
|
|
430
|
-
nodeSpacing: 0,
|
|
431
|
-
},
|
|
432
|
-
startOnLoad: false,
|
|
433
|
-
fontFamily: 'var(--sans-font)',
|
|
434
|
-
// @ts-ignore This works, but TS expects a enum for some reason
|
|
435
|
-
theme: currentTheme,
|
|
436
|
-
themeVariables: isDarkMode ? darkThemeVariables : undefined,
|
|
437
|
-
architecture: {
|
|
438
|
-
useMaxWidth: true,
|
|
439
|
-
},
|
|
440
|
-
});
|
|
441
|
-
|
|
442
|
-
for (const graph of graphs) {
|
|
443
|
-
const content = graph.getAttribute('data-content');
|
|
444
|
-
if (!content) continue;
|
|
445
|
-
let svg = document.createElement('svg');
|
|
446
|
-
const id = (svg.id = 'mermaid-' + Math.round(Math.random() * 100000));
|
|
447
|
-
graph.appendChild(svg);
|
|
448
|
-
mermaid.render(id, content).then((result) => {
|
|
449
|
-
graph.innerHTML = result.svg;
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
const graphs = document.getElementsByClassName('mermaid');
|
|
455
|
-
if (document.getElementsByClassName('mermaid').length > 0) {
|
|
456
|
-
renderDiagrams(graphs);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
// Make renderDiagrams available globally for accordion component
|
|
460
|
-
window.renderDiagrams = renderDiagrams;
|
|
461
|
-
|
|
462
371
|
document.addEventListener('astro:page-load', setupObserver);
|
|
463
372
|
</script>
|
|
464
373
|
|
|
465
374
|
<script>
|
|
466
|
-
import
|
|
467
|
-
document.addEventListener('astro:page-load', () => {
|
|
468
|
-
const blocks = document.getElementsByClassName('plantuml');
|
|
469
|
-
if (blocks.length > 0) {
|
|
470
|
-
renderPlantUML(blocks, deflate);
|
|
471
|
-
}
|
|
472
|
-
});
|
|
375
|
+
import { destroyZoomInstances, renderMermaidWithZoom, renderPlantUMLWithZoom } from '@utils/mermaid-zoom';
|
|
473
376
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
const content = block.getAttribute('data-content');
|
|
477
|
-
if (!content) continue;
|
|
478
|
-
|
|
479
|
-
const encoded = encodePlantUML(content, deflate);
|
|
480
|
-
const img = document.createElement('img');
|
|
481
|
-
img.src = `https://www.plantuml.com/plantuml/svg/~1${encoded}`;
|
|
482
|
-
img.alt = 'PlantUML diagram';
|
|
483
|
-
img.loading = 'lazy';
|
|
484
|
-
block.innerHTML = '';
|
|
485
|
-
img.classList.add('mx-auto');
|
|
486
|
-
block.appendChild(img);
|
|
487
|
-
}
|
|
488
|
-
}
|
|
377
|
+
function initDiagrams() {
|
|
378
|
+
destroyZoomInstances();
|
|
489
379
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
return encode64(compressed);
|
|
380
|
+
const mermaidGraphs = document.getElementsByClassName('mermaid');
|
|
381
|
+
if (mermaidGraphs.length > 0) {
|
|
382
|
+
renderMermaidWithZoom(mermaidGraphs, window.eventcatalog?.mermaid);
|
|
494
383
|
}
|
|
495
384
|
|
|
496
|
-
const
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
let i = 0;
|
|
500
|
-
while (i < data.length) {
|
|
501
|
-
let b1 = data[i++];
|
|
502
|
-
let b2 = i < data.length ? data[i++] : 0;
|
|
503
|
-
let b3 = i < data.length ? data[i++] : 0;
|
|
504
|
-
|
|
505
|
-
let c1 = b1 >> 2;
|
|
506
|
-
let c2 = ((b1 & 0x3) << 4) | (b2 >> 4);
|
|
507
|
-
let c3 = ((b2 & 0xf) << 2) | (b3 >> 6);
|
|
508
|
-
let c4 = b3 & 0x3f;
|
|
509
|
-
|
|
510
|
-
str += chars[c1] + chars[c2] + chars[c3] + chars[c4];
|
|
511
|
-
}
|
|
512
|
-
return str;
|
|
513
|
-
};
|
|
514
|
-
|
|
515
|
-
const graphs = document.getElementsByClassName('plantuml');
|
|
516
|
-
if (document.getElementsByClassName('plantuml').length > 0) {
|
|
517
|
-
renderPlantUML(graphs, deflate);
|
|
385
|
+
const plantumlBlocks = document.getElementsByClassName('plantuml');
|
|
386
|
+
if (plantumlBlocks.length > 0) {
|
|
387
|
+
renderPlantUMLWithZoom(plantumlBlocks);
|
|
518
388
|
}
|
|
389
|
+
}
|
|
519
390
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
391
|
+
// Run on initial load and page transitions
|
|
392
|
+
initDiagrams();
|
|
393
|
+
document.addEventListener('astro:page-load', initDiagrams);
|
|
394
|
+
|
|
395
|
+
// Make available globally for accordion component
|
|
396
|
+
window.renderDiagrams = (graphs: HTMLCollectionOf<Element>) => {
|
|
397
|
+
renderMermaidWithZoom(graphs, window.eventcatalog?.mermaid);
|
|
398
|
+
};
|
|
399
|
+
window.renderPlantUML = (blocks: HTMLCollectionOf<Element>) => {
|
|
400
|
+
renderPlantUMLWithZoom(blocks);
|
|
401
|
+
};
|
|
524
402
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { APIRoute } from 'astro';
|
|
2
|
-
import { Hono } from 'hono';
|
|
2
|
+
import { Hono, type Context } from 'hono';
|
|
3
3
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { WebStandardStreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js';
|
|
5
5
|
import { z } from 'zod';
|
|
@@ -396,7 +396,7 @@ function createMcpServer() {
|
|
|
396
396
|
resource.name,
|
|
397
397
|
resource.uri,
|
|
398
398
|
{ description: resource.description, mimeType: 'application/json' },
|
|
399
|
-
async (uri) => {
|
|
399
|
+
async (uri: URL) => {
|
|
400
400
|
const allResources: any[] = [];
|
|
401
401
|
|
|
402
402
|
for (const collectionName of resource.collections) {
|
|
@@ -463,7 +463,7 @@ const mcpResources = [
|
|
|
463
463
|
];
|
|
464
464
|
|
|
465
465
|
// Health check endpoint
|
|
466
|
-
app.get('/', async (c) => {
|
|
466
|
+
app.get('/', async (c: Context) => {
|
|
467
467
|
return c.json({
|
|
468
468
|
name: 'EventCatalog MCP Server',
|
|
469
469
|
version: '1.0.0',
|
|
@@ -475,7 +475,7 @@ app.get('/', async (c) => {
|
|
|
475
475
|
});
|
|
476
476
|
|
|
477
477
|
// MCP protocol endpoint - handles POST requests for MCP protocol
|
|
478
|
-
app.post('/', async (c) => {
|
|
478
|
+
app.post('/', async (c: Context) => {
|
|
479
479
|
try {
|
|
480
480
|
// Connect server to transport if not already connected
|
|
481
481
|
if (!isConnected) {
|
|
@@ -2,3 +2,14 @@
|
|
|
2
2
|
/// <reference types="astro/client" />
|
|
3
3
|
|
|
4
4
|
declare const __EC_TRAILING_SLASH__: boolean;
|
|
5
|
+
|
|
6
|
+
interface EventCatalogConfig {
|
|
7
|
+
mermaid?: {
|
|
8
|
+
iconPacks?: string[];
|
|
9
|
+
enableSupportForElkLayout?: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface Window {
|
|
14
|
+
eventcatalog?: EventCatalogConfig;
|
|
15
|
+
}
|