@eventcatalog/core 3.4.0 → 3.4.1
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-MJRHV77M.js → chunk-56E6QDHD.js} +1 -1
- package/dist/{chunk-Q4DKMESA.js → chunk-6AW5YJSJ.js} +1 -1
- package/dist/{chunk-KFZIBXRQ.js → chunk-7CV7NFRY.js} +1 -1
- package/dist/{chunk-VAGFX36R.js → chunk-IVLW66F7.js} +1 -1
- package/dist/{chunk-GLMX3ZTY.js → chunk-SPL7HGIZ.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/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
|
@@ -571,164 +571,47 @@ nodeGraphs.push({
|
|
|
571
571
|
</script>
|
|
572
572
|
|
|
573
573
|
<script>
|
|
574
|
-
|
|
574
|
+
import { destroyZoomInstances, renderMermaidWithZoom } from '@utils/mermaid-zoom';
|
|
575
|
+
|
|
576
|
+
// Listen for Astro transitions
|
|
575
577
|
document.addEventListener('astro:page-load', () => {
|
|
578
|
+
destroyZoomInstances();
|
|
576
579
|
const graphs = document.getElementsByClassName('mermaid');
|
|
577
|
-
if (
|
|
578
|
-
|
|
580
|
+
if (graphs.length > 0) {
|
|
581
|
+
renderMermaidWithZoom(graphs, window.eventcatalog?.mermaid);
|
|
579
582
|
}
|
|
580
583
|
});
|
|
581
584
|
|
|
582
|
-
|
|
583
|
-
* Renders mermaid diagrams in the page
|
|
584
|
-
* @param {HTMLCollectionOf<HTMLElement>} graphs - The collection of mermaid graph elements
|
|
585
|
-
*/
|
|
586
|
-
async function renderDiagrams(graphs: any) {
|
|
587
|
-
const { default: mermaid } = await import('mermaid');
|
|
588
|
-
|
|
589
|
-
// @ts-ignore
|
|
590
|
-
if (window.eventcatalog.mermaid) {
|
|
591
|
-
const { icons } = await import('@iconify-json/logos');
|
|
592
|
-
// @ts-ignore
|
|
593
|
-
const { iconPacks = [], enableSupportForElkLayout = false } = window.eventcatalog.mermaid ?? {};
|
|
594
|
-
|
|
595
|
-
if (iconPacks.length > 0) {
|
|
596
|
-
const iconPacksToRegister = iconPacks.map((name: any) => {
|
|
597
|
-
return {
|
|
598
|
-
name,
|
|
599
|
-
icons,
|
|
600
|
-
};
|
|
601
|
-
});
|
|
602
|
-
|
|
603
|
-
mermaid.registerIconPacks(iconPacksToRegister);
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
if (enableSupportForElkLayout) {
|
|
607
|
-
// @ts-ignore
|
|
608
|
-
const { default: elkLayouts } = await import('@mermaid-js/layout-elk/dist/mermaid-layout-elk.core.mjs');
|
|
609
|
-
mermaid.registerLayoutLoaders(elkLayouts);
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
// Detect current theme from data-theme attribute
|
|
614
|
-
const isDarkMode = document.documentElement.getAttribute('data-theme') === 'dark';
|
|
615
|
-
const currentTheme = isDarkMode ? 'dark' : 'default';
|
|
616
|
-
|
|
617
|
-
// Custom theme variables for better readability in dark mode
|
|
618
|
-
const darkThemeVariables = {
|
|
619
|
-
// Sequence diagram - improve text contrast
|
|
620
|
-
signalColor: '#f0f6fc',
|
|
621
|
-
signalTextColor: '#f0f6fc',
|
|
622
|
-
actorTextColor: '#0d1117',
|
|
623
|
-
actorBkg: '#f0f6fc',
|
|
624
|
-
actorBorder: '#484f58',
|
|
625
|
-
actorLineColor: '#6b7280',
|
|
626
|
-
// General text colors
|
|
627
|
-
primaryTextColor: '#f0f6fc',
|
|
628
|
-
secondaryTextColor: '#c9d1d9',
|
|
629
|
-
tertiaryTextColor: '#f0f6fc',
|
|
630
|
-
// Line colors
|
|
631
|
-
lineColor: '#6b7280',
|
|
632
|
-
};
|
|
633
|
-
|
|
634
|
-
mermaid.initialize({
|
|
635
|
-
// fontSize: 2,
|
|
636
|
-
flowchart: {
|
|
637
|
-
curve: 'linear',
|
|
638
|
-
rankSpacing: 0,
|
|
639
|
-
nodeSpacing: 0,
|
|
640
|
-
},
|
|
641
|
-
startOnLoad: false,
|
|
642
|
-
fontFamily: 'var(--sans-font)',
|
|
643
|
-
// @ts-ignore This works, but TS expects a enum for some reason
|
|
644
|
-
theme: currentTheme,
|
|
645
|
-
themeVariables: isDarkMode ? darkThemeVariables : undefined,
|
|
646
|
-
architecture: {
|
|
647
|
-
useMaxWidth: true,
|
|
648
|
-
},
|
|
649
|
-
});
|
|
650
|
-
|
|
651
|
-
for (const graph of graphs) {
|
|
652
|
-
const content = graph.getAttribute('data-content');
|
|
653
|
-
if (!content) continue;
|
|
654
|
-
let svg = document.createElement('svg');
|
|
655
|
-
const id = (svg.id = 'mermaid-' + Math.round(Math.random() * 100000));
|
|
656
|
-
graph.appendChild(svg);
|
|
657
|
-
mermaid.render(id, content).then((result) => {
|
|
658
|
-
graph.innerHTML = result.svg;
|
|
659
|
-
});
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
|
|
585
|
+
// Initial render
|
|
663
586
|
const graphs = document.getElementsByClassName('mermaid');
|
|
664
|
-
if (
|
|
665
|
-
|
|
587
|
+
if (graphs.length > 0) {
|
|
588
|
+
renderMermaidWithZoom(graphs, window.eventcatalog?.mermaid);
|
|
666
589
|
}
|
|
667
590
|
|
|
668
|
-
// Make
|
|
669
|
-
window.renderDiagrams =
|
|
591
|
+
// Make available globally for accordion component
|
|
592
|
+
window.renderDiagrams = (graphs: HTMLCollectionOf<Element>) => {
|
|
593
|
+
renderMermaidWithZoom(graphs, window.eventcatalog?.mermaid);
|
|
594
|
+
};
|
|
670
595
|
</script>
|
|
671
596
|
|
|
672
597
|
<script>
|
|
673
|
-
import
|
|
674
|
-
document.addEventListener('astro:page-load', () => {
|
|
675
|
-
const blocks = document.getElementsByClassName('plantuml');
|
|
676
|
-
if (blocks.length > 0) {
|
|
677
|
-
renderPlantUML(blocks, deflate);
|
|
678
|
-
}
|
|
679
|
-
});
|
|
680
|
-
|
|
681
|
-
function renderPlantUML(blocks: any, deflate: any) {
|
|
682
|
-
for (const block of blocks) {
|
|
683
|
-
const content = block.getAttribute('data-content');
|
|
684
|
-
if (!content) continue;
|
|
685
|
-
|
|
686
|
-
const encoded = encodePlantUML(content, deflate);
|
|
687
|
-
const img = document.createElement('img');
|
|
688
|
-
img.src = `https://www.plantuml.com/plantuml/svg/~1${encoded}`;
|
|
689
|
-
img.alt = 'PlantUML diagram';
|
|
690
|
-
img.loading = 'lazy';
|
|
691
|
-
block.innerHTML = '';
|
|
692
|
-
// Add class to the img
|
|
693
|
-
img.classList.add('mx-auto');
|
|
694
|
-
block.appendChild(img);
|
|
695
|
-
}
|
|
696
|
-
}
|
|
598
|
+
import { renderPlantUMLWithZoom } from '@utils/mermaid-zoom';
|
|
697
599
|
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
600
|
+
function initPlantUML() {
|
|
601
|
+
const blocks = document.getElementsByClassName('plantuml');
|
|
602
|
+
if (blocks.length > 0) {
|
|
603
|
+
renderPlantUMLWithZoom(blocks);
|
|
702
604
|
}
|
|
605
|
+
}
|
|
703
606
|
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
let i = 0;
|
|
708
|
-
while (i < data.length) {
|
|
709
|
-
let b1 = data[i++];
|
|
710
|
-
let b2 = i < data.length ? data[i++] : 0;
|
|
711
|
-
let b3 = i < data.length ? data[i++] : 0;
|
|
712
|
-
|
|
713
|
-
let c1 = b1 >> 2;
|
|
714
|
-
let c2 = ((b1 & 0x3) << 4) | (b2 >> 4);
|
|
715
|
-
let c3 = ((b2 & 0xf) << 2) | (b3 >> 6);
|
|
716
|
-
let c4 = b3 & 0x3f;
|
|
717
|
-
|
|
718
|
-
str += chars[c1] + chars[c2] + chars[c3] + chars[c4];
|
|
719
|
-
}
|
|
720
|
-
return str;
|
|
721
|
-
};
|
|
607
|
+
// Run on initial load and page transitions
|
|
608
|
+
initPlantUML();
|
|
609
|
+
document.addEventListener('astro:page-load', initPlantUML);
|
|
722
610
|
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
window.renderPlantUML = (graphs: any) => {
|
|
729
|
-
renderPlantUML(graphs, deflate);
|
|
730
|
-
};
|
|
731
|
-
});
|
|
611
|
+
// Make available globally for accordion component
|
|
612
|
+
window.renderPlantUML = (blocks: HTMLCollectionOf<Element>) => {
|
|
613
|
+
renderPlantUMLWithZoom(blocks);
|
|
614
|
+
};
|
|
732
615
|
</script>
|
|
733
616
|
<script>
|
|
734
617
|
// @ts-nocheck
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type declarations for MCP server dependencies
|
|
3
|
+
* These are used by the enterprise MCP server feature
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
declare module 'hono' {
|
|
7
|
+
export interface Context {
|
|
8
|
+
req: {
|
|
9
|
+
raw: Request;
|
|
10
|
+
};
|
|
11
|
+
json: (data: unknown, status?: number) => Response;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class Hono {
|
|
15
|
+
constructor();
|
|
16
|
+
basePath(path: string): Hono;
|
|
17
|
+
get(path: string, handler: (c: Context) => Response | Promise<Response>): void;
|
|
18
|
+
post(path: string, handler: (c: Context) => Response | Promise<Response>): void;
|
|
19
|
+
fetch(request: Request): Promise<Response>;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare module '@modelcontextprotocol/sdk/server/mcp.js' {
|
|
24
|
+
import { z } from 'zod';
|
|
25
|
+
|
|
26
|
+
export interface ToolConfig {
|
|
27
|
+
description: string;
|
|
28
|
+
inputSchema: z.ZodType<any>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ToolResult {
|
|
32
|
+
content: Array<{ type: 'text'; text: string }>;
|
|
33
|
+
isError?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ResourceConfig {
|
|
37
|
+
description: string;
|
|
38
|
+
mimeType: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ResourceResult {
|
|
42
|
+
contents: Array<{
|
|
43
|
+
uri: string;
|
|
44
|
+
text: string;
|
|
45
|
+
mimeType: string;
|
|
46
|
+
}>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class McpServer {
|
|
50
|
+
constructor(config: { name: string; version: string });
|
|
51
|
+
registerTool(name: string, config: ToolConfig, handler: (params: any) => Promise<ToolResult>): void;
|
|
52
|
+
registerResource(name: string, uri: string, config: ResourceConfig, handler: (uri: URL) => Promise<ResourceResult>): void;
|
|
53
|
+
connect(transport: any): Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare module '@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js' {
|
|
58
|
+
export interface WebStandardStreamableHTTPServerTransportConfig {
|
|
59
|
+
sessionIdGenerator: undefined;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export class WebStandardStreamableHTTPServerTransport {
|
|
63
|
+
constructor(config: WebStandardStreamableHTTPServerTransportConfig);
|
|
64
|
+
handleRequest(request: Request): Promise<Response>;
|
|
65
|
+
}
|
|
66
|
+
}
|