@eventcatalog/core 4.12.3 → 5.0.0-beta.0
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/LICENSE +226 -95
- package/NOTICE +30 -0
- package/README.md +3 -2
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +43 -16
- package/dist/analytics/log-build.d.cts +6 -5
- package/dist/analytics/log-build.d.ts +6 -5
- package/dist/analytics/log-build.js +4 -3
- package/dist/{chunk-U4YJSTGV.js → chunk-AYNZXUB5.js} +2 -10
- package/dist/{chunk-TV3YAWKQ.js → chunk-CR6AK5LR.js} +1 -1
- package/dist/{chunk-M577VUOX.js → chunk-LR7AGRHN.js} +13 -16
- package/dist/chunk-TQLRG35T.js +203 -0
- package/dist/{chunk-HPC6KUDQ.js → chunk-TWN43V4T.js} +1 -1
- package/dist/{chunk-ZYTCBNB3.js → chunk-WAIADKQE.js} +1 -1
- package/dist/{chunk-5BPN6QEC.js → chunk-ZHKEARLJ.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +407 -291
- package/dist/eventcatalog.config.d.cts +2 -3
- package/dist/eventcatalog.config.d.ts +2 -3
- package/dist/eventcatalog.js +35 -98
- package/dist/federation/content-cache.d.cts +0 -5
- package/dist/federation/content-cache.d.ts +0 -5
- package/dist/federation/diagnostics.d.cts +0 -5
- package/dist/federation/diagnostics.d.ts +0 -5
- package/dist/federation/federate.cjs +0 -9
- package/dist/federation/federate.d.cts +0 -5
- package/dist/federation/federate.d.ts +0 -5
- package/dist/federation/federate.js +4 -5
- package/dist/federation/filesystem-source-provider.d.cts +0 -5
- package/dist/federation/filesystem-source-provider.d.ts +0 -5
- package/dist/federation/github-source-provider.d.cts +0 -5
- package/dist/federation/github-source-provider.d.ts +0 -5
- package/dist/federation/output-transaction.d.cts +0 -4
- package/dist/federation/output-transaction.d.ts +0 -4
- package/dist/federation/public-assets.d.cts +0 -5
- package/dist/federation/public-assets.d.ts +0 -5
- package/dist/federation/source-provider.d.cts +0 -5
- package/dist/federation/source-provider.d.ts +0 -5
- package/dist/federation/types.d.cts +0 -5
- package/dist/federation/types.d.ts +0 -5
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/license-C1y-56bb.d.cts +23 -0
- package/dist/license-C1y-56bb.d.ts +23 -0
- package/dist/runtime-dependencies/@eventcatalog__visualiser__layout.mjs +3 -0
- package/dist/runtime-dependencies/@modelcontextprotocol__ext-apps.mjs +3 -0
- package/dist/runtime-dependencies/@modelcontextprotocol__ext-apps__react.mjs +3 -0
- package/dist/runtime-dependencies/@modelcontextprotocol__ext-apps__server.mjs +3 -0
- package/dist/runtime-dependencies/@modelcontextprotocol__sdk__types.js.mjs +3 -0
- package/dist/runtime-dependencies/manifest.json +12 -1
- package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__languages__prism__graphql.mjs +3 -0
- package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__languages__prism__json.mjs +3 -0
- package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__languages__prism__markup.mjs +3 -0
- package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__languages__prism__protobuf.mjs +3 -0
- package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__languages__prism__yaml.mjs +3 -0
- package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__styles__prism__one-dark.mjs +3 -0
- package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__styles__prism__one-light.mjs +3 -0
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/dist/utils/license-status.cjs +240 -0
- package/dist/utils/license-status.d.cts +28 -0
- package/dist/utils/license-status.d.ts +28 -0
- package/dist/utils/license-status.js +12 -0
- package/eventcatalog/astro.config.mjs +1 -1
- package/eventcatalog/integrations/eventcatalog-runtime.mjs +1 -1
- package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +29 -19
- package/eventcatalog/src/components/ChatPanel/OfflineReply.tsx +74 -0
- package/eventcatalog/src/components/FieldsExplorer/FieldFilters.tsx +24 -28
- package/eventcatalog/src/components/FieldsExplorer/FieldNodeGraph.tsx +16 -11
- package/eventcatalog/src/components/FieldsExplorer/FieldsExplorer.tsx +4 -218
- package/eventcatalog/src/components/FieldsExplorer/FieldsTable.tsx +27 -36
- package/eventcatalog/src/components/Header.astro +43 -58
- package/eventcatalog/src/components/Lists/PillListFlat.styles.css +17 -17
- package/eventcatalog/src/components/MDX/EntityMap/EntityMap.astro +1 -1
- package/eventcatalog/src/components/MDX/Flow/Flow.astro +4 -0
- package/eventcatalog/src/components/MDX/NodeGraph/AstroNodeGraph.tsx +14 -0
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +49 -18
- package/eventcatalog/src/components/MDX/RemoteFile.astro +2 -24
- package/eventcatalog/src/components/SchemaExplorer/ApiAccessSection.tsx +59 -93
- package/eventcatalog/src/components/SchemaExplorer/ApiContentViewer.tsx +1 -32
- package/eventcatalog/src/components/SchemaExplorer/DiffViewer.tsx +20 -67
- package/eventcatalog/src/components/SchemaExplorer/SchemaContentViewer.tsx +2 -11
- package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +11 -60
- package/eventcatalog/src/components/SchemaExplorer/SchemaExplorer.tsx +1 -3
- package/eventcatalog/src/components/SchemaExplorer/SchemaPageViewer.tsx +0 -3
- package/eventcatalog/src/components/SchemaExplorer/VersionHistoryModal.tsx +2 -9
- package/eventcatalog/src/components/SchemaExplorer/parse-schema.ts +46 -0
- package/eventcatalog/src/components/SchemaExplorer/utils.ts +11 -0
- package/eventcatalog/src/components/Settings/AssistantSettingsForm.tsx +2 -9
- package/eventcatalog/src/components/Settings/LicenseSettings.tsx +288 -0
- package/eventcatalog/src/components/Settings/LlmAccessSettingsForm.tsx +3 -19
- package/eventcatalog/src/components/Settings/McpSettingsForm.tsx +85 -30
- package/eventcatalog/src/components/Settings/SettingsShared.tsx +7 -75
- package/eventcatalog/src/components/SideNav/CustomDocsNav.astro +2 -2
- package/eventcatalog/src/components/TrialBadge.astro +82 -0
- package/eventcatalog/src/content.config.ts +9 -96
- package/eventcatalog/src/{enterprise → features}/ai/chat-api.ts +22 -34
- package/eventcatalog/src/{enterprise → features}/analytics/adapters/ga4.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/analytics/adapters/gtm.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/analytics/adapters/posthog.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/analytics/components/AnalyticsHead.astro +2 -4
- package/eventcatalog/src/{enterprise → features}/analytics/components/AnalyticsTracker.astro +2 -4
- package/eventcatalog/src/{enterprise → features}/analytics/tracker.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/api/catalog.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/auth/[...auth].ts +0 -5
- package/eventcatalog/src/{enterprise → features}/auth/middleware/middleware-auth.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/auth/middleware/middleware.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/collections/custom-pages.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/collections/index.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/collections/resource-docs.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/custom-documentation/collection.ts +0 -5
- package/eventcatalog/src/features/custom-documentation/components/CustomDocsNav/CustomDocsNav.astro +9 -0
- package/eventcatalog/src/{enterprise → features}/custom-documentation/components/CustomDocsNav/CustomDocsNavWrapper.tsx +0 -5
- package/eventcatalog/src/{enterprise → features}/custom-documentation/components/CustomDocsNav/components/NestedItem.tsx +1 -6
- package/eventcatalog/src/{enterprise → features}/custom-documentation/components/CustomDocsNav/components/NoResultsFound.tsx +0 -5
- package/eventcatalog/src/{enterprise → features}/custom-documentation/components/CustomDocsNav/index.tsx +1 -6
- package/eventcatalog/src/{enterprise → features}/custom-documentation/components/CustomDocsNav/types.ts +0 -5
- package/eventcatalog/src/{enterprise/custom-documentation/pages/docs/custom/index.astro → features/custom-documentation/components/CustomDocumentationPage.astro} +5 -5
- package/eventcatalog/src/{enterprise → features}/custom-documentation/utils/badge-styles.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/custom-documentation/utils/custom-docs.ts +1 -6
- package/eventcatalog/src/{enterprise → features}/custom-documentation/utils/docs-search.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/custom-pages/routes.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/directory/user-team-directory.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/fields/field-extractor.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/fields/field-indexer.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/fields/fields-db.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/fields/pages/api/fields.ts +1 -6
- package/eventcatalog/src/{enterprise → features}/fields/pages/fields.astro +1 -2
- package/eventcatalog/src/{enterprise → features}/integrations/eventcatalog-features.ts +17 -75
- package/eventcatalog/src/features/mcp/apps/architecture-diagram/links.ts +59 -0
- package/eventcatalog/src/features/mcp/apps/architecture-diagram/node-chat.tsx +299 -0
- package/eventcatalog/src/features/mcp/apps/architecture-diagram/shared.ts +14 -0
- package/eventcatalog/src/features/mcp/apps/architecture-diagram/view.tsx +454 -0
- package/eventcatalog/src/features/mcp/apps/generated/viewer.html +432 -0
- package/eventcatalog/src/features/mcp/apps/mermaid-stub.ts +10 -0
- package/eventcatalog/src/features/mcp/apps/schema-viewer/schema-code.tsx +65 -0
- package/eventcatalog/src/features/mcp/apps/schema-viewer/shared.ts +23 -0
- package/eventcatalog/src/features/mcp/apps/schema-viewer/view.tsx +170 -0
- package/eventcatalog/src/features/mcp/apps/shared/app-view.tsx +98 -0
- package/eventcatalog/src/features/mcp/apps/shared/resource-types.ts +15 -0
- package/eventcatalog/src/features/mcp/apps/viewer/shared.ts +24 -0
- package/eventcatalog/src/features/mcp/apps/viewer/styles.css +25 -0
- package/eventcatalog/src/features/mcp/apps/viewer/view.tsx +59 -0
- package/eventcatalog/src/features/mcp/mcp-app-icons.ts +63 -0
- package/eventcatalog/src/features/mcp/mcp-apps.ts +160 -0
- package/eventcatalog/src/{enterprise → features}/mcp/mcp-auth.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/mcp/mcp-scope.ts +7 -7
- package/eventcatalog/src/{enterprise → features}/mcp/mcp-scoped-tools.ts +47 -40
- package/eventcatalog/src/{enterprise → features}/mcp/mcp-server.ts +347 -34
- package/eventcatalog/src/{enterprise → features}/mcp/oauth-protected-resource.ts +0 -5
- package/eventcatalog/src/features/mcp/schema-viewer.ts +24 -0
- package/eventcatalog/src/{enterprise → features}/tools/catalog-tools.ts +133 -102
- package/eventcatalog/src/features/tools/index.ts +5 -0
- package/eventcatalog/src/{enterprise → features}/visualizer-layout/reset.ts +0 -5
- package/eventcatalog/src/{enterprise → features}/visualizer-layout/save.ts +0 -5
- package/eventcatalog/src/layouts/BaseLayout.astro +2 -2
- package/eventcatalog/src/layouts/Footer.astro +31 -39
- package/eventcatalog/src/layouts/SettingsLayout.astro +6 -6
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +7 -37
- package/eventcatalog/src/{enterprise → pages}/api/schemas/[collection]/[id]/[version]/index.ts +0 -22
- package/eventcatalog/src/{enterprise → pages}/api/schemas/services/[id]/[version]/[specification]/index.ts +0 -19
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/_index.data.ts +2 -6
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +1 -5
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/_index.data.ts +2 -6
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +1 -5
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId].md.ts +2 -6
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId].mdx.ts +2 -6
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +9 -5
- package/eventcatalog/src/pages/docs/custom/[...path]/index.astro +12 -0
- package/eventcatalog/src/{enterprise/custom-documentation/pages/docs/custom/root-index.astro → pages/docs/custom/index.astro} +1 -23
- package/eventcatalog/src/pages/docs/llm/llms-full.txt.ts +4 -9
- package/eventcatalog/src/pages/docs/llm/llms.txt.ts +4 -4
- package/eventcatalog/src/pages/docs/llm/schemas.txt.ts +0 -11
- package/eventcatalog/src/pages/docs/services/[id]/[docType]/[docId]/index.astro +2 -2
- package/eventcatalog/src/pages/index.astro +2 -2
- package/eventcatalog/src/pages/schemas/[type]/[id]/[version]/index.astro +0 -3
- package/eventcatalog/src/pages/schemas/explorer/index.astro +1 -4
- package/eventcatalog/src/pages/settings/assistant.astro +2 -4
- package/eventcatalog/src/pages/settings/license.astro +18 -0
- package/eventcatalog/src/pages/settings/llm-access.astro +1 -4
- package/eventcatalog/src/pages/settings/mcp.astro +33 -4
- package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/_index.data.ts +1 -2
- package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/data/index.astro +2 -45
- package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/entity-map/index.astro +1 -1
- package/eventcatalog/src/pages/visualiser/[type]/[id]/[version].mermaid.ts +7 -109
- package/eventcatalog/src/pages/visualiser/_mermaid-route.ts +78 -0
- package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/_index.data.ts +44 -0
- package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/entity-map/index.astro +1 -1
- package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/index.astro +56 -0
- package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/systems-context/index.astro +3 -40
- package/eventcatalog/src/pages/visualiser/domains/[id]/[version].mermaid.ts +20 -0
- package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/_index.data.ts +29 -0
- package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/context/index.astro +3 -38
- package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/index.astro +56 -0
- package/eventcatalog/src/pages/visualiser/systems/[id]/[version].mermaid.ts +20 -0
- package/eventcatalog/src/stores/sidebar-store/builders/agent.ts +1 -1
- package/eventcatalog/src/stores/sidebar-store/builders/container.ts +1 -1
- package/eventcatalog/src/stores/sidebar-store/builders/data-product.ts +1 -1
- package/eventcatalog/src/stores/sidebar-store/builders/domain.ts +7 -32
- package/eventcatalog/src/stores/sidebar-store/builders/entity.ts +1 -1
- package/eventcatalog/src/stores/sidebar-store/builders/message.ts +1 -1
- package/eventcatalog/src/stores/sidebar-store/builders/service.ts +2 -8
- package/eventcatalog/src/stores/sidebar-store/builders/system.ts +2 -12
- package/eventcatalog/src/stores/sidebar-store/custom-sidebar.ts +0 -10
- package/eventcatalog/src/stores/sidebar-store/state.ts +4 -6
- package/eventcatalog/src/styles/theme.css +22 -18
- package/eventcatalog/src/styles/themes/forest.css +8 -8
- package/eventcatalog/src/styles/themes/ocean.css +8 -8
- package/eventcatalog/src/styles/themes/sapphire.css +8 -8
- package/eventcatalog/src/styles/themes/sunset.css +8 -8
- package/eventcatalog/src/utils/clipboard.ts +4 -4
- package/eventcatalog/src/utils/collections/flow-step-schema.ts +117 -0
- package/eventcatalog/src/utils/collections/pointer-schema.ts +7 -0
- package/eventcatalog/src/utils/collections/resource-docs.ts +677 -14
- package/eventcatalog/src/utils/collections/schema-loader.ts +0 -5
- package/eventcatalog/src/utils/feature.ts +14 -23
- package/eventcatalog/src/utils/license.ts +114 -0
- package/eventcatalog/src/utils/node-graphs/architecture-diagram-types.ts +32 -0
- package/eventcatalog/src/utils/node-graphs/architecture-diagram.ts +84 -0
- package/eventcatalog/src/utils/node-graphs/channel-node-graph.ts +4 -25
- package/eventcatalog/src/utils/node-graphs/container-node-graph.ts +12 -39
- package/eventcatalog/src/utils/node-graphs/data-products-node-graph.ts +11 -27
- package/eventcatalog/src/utils/node-graphs/domain-levels-node-graph.ts +679 -0
- package/eventcatalog/src/utils/node-graphs/domains-node-graph.ts +3 -20
- package/eventcatalog/src/utils/node-graphs/export-mermaid.ts +51 -4
- package/eventcatalog/src/utils/node-graphs/field-node-graph.ts +8 -23
- package/eventcatalog/src/utils/node-graphs/flow-lanes.ts +119 -0
- package/eventcatalog/src/utils/node-graphs/flows-node-graph.ts +133 -47
- package/eventcatalog/src/utils/node-graphs/layout-node-graph.ts +28 -0
- package/eventcatalog/src/utils/node-graphs/layout-persistence.ts +3 -3
- package/eventcatalog/src/utils/node-graphs/message-node-graph.ts +16 -34
- package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +11 -25
- package/eventcatalog/src/utils/node-graphs/system-context-node-graph.ts +18 -54
- package/eventcatalog/src/utils/node-graphs/system-levels-node-graph.ts +59 -0
- package/eventcatalog/src/utils/node-graphs/systems-node-graph.ts +20 -80
- package/eventcatalog/src/utils/node-graphs/utils/utils.ts +1 -78
- package/eventcatalog/src/utils/trial.ts +36 -0
- package/eventcatalog/tsconfig.json +1 -1
- package/package.json +11 -11
- package/dist/chunk-FV56YFM4.js +0 -7
- package/dist/federation/entitlement.cjs +0 -31
- package/dist/federation/entitlement.d.cts +0 -12
- package/dist/federation/entitlement.d.ts +0 -12
- package/dist/federation/entitlement.js +0 -6
- package/dist/runtime-dependencies/dagre.mjs +0 -3
- package/eventcatalog/src/components/Settings/BillingSettingsForm.tsx +0 -265
- package/eventcatalog/src/enterprise/LICENSE +0 -57
- package/eventcatalog/src/enterprise/README.md +0 -5
- package/eventcatalog/src/enterprise/collections/resource-docs-utils.ts +0 -691
- package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/CustomDocsNav.astro +0 -9
- package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/[...path]/index.astro +0 -18
- package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/feature.astro +0 -171
- package/eventcatalog/src/enterprise/feature.ts +0 -75
- package/eventcatalog/src/enterprise/tools/index.ts +0 -10
- package/eventcatalog/src/hooks/eventcatalog-visualizer.ts +0 -126
- package/eventcatalog/src/pages/settings/billing.astro +0 -17
- package/eventcatalog/src/pages/visualiser/domain-integrations/index.astro +0 -26
- package/eventcatalog/src/types/mcp-modules.d.ts +0 -67
- package/eventcatalog/src/utils/node-graphs/domains-canvas.ts +0 -261
- package/eventcatalog/src/utils/node-graphs/export-node-graph.ts +0 -91
- /package/eventcatalog/src/{enterprise → features}/auth/error.astro +0 -0
- /package/eventcatalog/src/{enterprise → features}/auth/login.astro +0 -0
- /package/eventcatalog/src/{enterprise → features}/auth/unauthorized.astro +0 -0
- /package/eventcatalog/src/{enterprise/custom-documentation/pages → pages}/docs/custom/[...path]/_index.data.ts +0 -0
- /package/eventcatalog/src/{enterprise/custom-documentation/pages → pages}/docs/custom/[...path].mdx.ts +0 -0
|
@@ -3,7 +3,7 @@ import fs from 'node:fs';
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import SettingsLayout from '@layouts/SettingsLayout.astro';
|
|
5
5
|
import { AssistantSettingsForm } from '@components/Settings/AssistantSettingsForm';
|
|
6
|
-
import { isDevMode, isSSR
|
|
6
|
+
import { isDevMode, isSSR } from '@utils/feature';
|
|
7
7
|
import { buildUrl } from '@utils/url-builder';
|
|
8
8
|
import config from '@config';
|
|
9
9
|
|
|
@@ -16,9 +16,8 @@ const initial = {
|
|
|
16
16
|
|
|
17
17
|
const projectRoot = process.env.PROJECT_DIR ?? process.cwd();
|
|
18
18
|
const hasChatConfigFile = fs.existsSync(path.join(projectRoot, 'eventcatalog.chat.js'));
|
|
19
|
-
const hasPlan = isEventCatalogStarterEnabled() || isEventCatalogScaleEnabled();
|
|
20
19
|
const inSSR = isSSR();
|
|
21
|
-
const chatAvailable =
|
|
20
|
+
const chatAvailable = hasChatConfigFile && inSSR;
|
|
22
21
|
|
|
23
22
|
const apiBase = buildUrl('/api/settings');
|
|
24
23
|
---
|
|
@@ -29,7 +28,6 @@ const apiBase = buildUrl('/api/settings');
|
|
|
29
28
|
canEdit={canEdit}
|
|
30
29
|
initial={initial}
|
|
31
30
|
chatAvailable={chatAvailable}
|
|
32
|
-
hasPlan={hasPlan}
|
|
33
31
|
inSSR={inSSR}
|
|
34
32
|
hasChatConfigFile={hasChatConfigFile}
|
|
35
33
|
apiBase={apiBase}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
import SettingsLayout from '@layouts/SettingsLayout.astro';
|
|
3
|
+
import { LicenseSettings, type LicenseProps } from '@components/Settings/LicenseSettings';
|
|
4
|
+
import catalog from '@utils/eventcatalog-config/catalog';
|
|
5
|
+
import { getLicenseStatus } from '@utils/license';
|
|
6
|
+
|
|
7
|
+
const status = await getLicenseStatus();
|
|
8
|
+
// Dates as unix ms, so the page can count the days left in the browser (it's prerendered in static builds)
|
|
9
|
+
const license: LicenseProps =
|
|
10
|
+
status.state === 'licensed' || status.state === 'expired'
|
|
11
|
+
? { ...status, issuedAt: status.issuedAt?.getTime(), expiresAt: status.expiresAt?.getTime() }
|
|
12
|
+
: status;
|
|
13
|
+
const trialStartedAt = typeof catalog?.tsd === 'number' ? catalog.tsd : undefined;
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<SettingsLayout title="License" active="license">
|
|
17
|
+
<LicenseSettings client:load license={license} trialStartedAt={trialStartedAt} renderedAt={Date.now()} />
|
|
18
|
+
</SettingsLayout>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import SettingsLayout from '@layouts/SettingsLayout.astro';
|
|
3
3
|
import { LlmAccessSettingsForm } from '@components/Settings/LlmAccessSettingsForm';
|
|
4
|
-
import { isDevMode
|
|
4
|
+
import { isDevMode } from '@utils/feature';
|
|
5
5
|
import { buildUrl } from '@utils/url-builder';
|
|
6
6
|
import config from '@config';
|
|
7
7
|
|
|
@@ -12,8 +12,6 @@ const initial = {
|
|
|
12
12
|
chatEnabled: config?.chat?.enabled ?? true,
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const hasScalePlan = isEventCatalogScaleEnabled();
|
|
16
|
-
|
|
17
15
|
const apiBase = buildUrl('/api/settings');
|
|
18
16
|
const llmsTxtUrl = buildUrl('/llms.txt');
|
|
19
17
|
const llmsFullTxtUrl = buildUrl('/llms-full.txt');
|
|
@@ -25,7 +23,6 @@ const schemasTxtUrl = buildUrl('/docs/llm/schemas.txt');
|
|
|
25
23
|
client:load
|
|
26
24
|
canEdit={canEdit}
|
|
27
25
|
initial={initial}
|
|
28
|
-
hasScalePlan={hasScalePlan}
|
|
29
26
|
apiBase={apiBase}
|
|
30
27
|
llmsTxtUrl={llmsTxtUrl}
|
|
31
28
|
llmsFullTxtUrl={llmsFullTxtUrl}
|
|
@@ -1,14 +1,43 @@
|
|
|
1
1
|
---
|
|
2
2
|
import SettingsLayout from '@layouts/SettingsLayout.astro';
|
|
3
|
-
import { McpSettingsForm } from '@components/Settings/McpSettingsForm';
|
|
4
|
-
import {
|
|
3
|
+
import { McpSettingsForm, type DomainMcpServer } from '@components/Settings/McpSettingsForm';
|
|
4
|
+
import { getDomains } from '@utils/collections/domains';
|
|
5
|
+
import { resolveMcpScope } from '@features/mcp/mcp-scope';
|
|
6
|
+
import { isSSR } from '@utils/feature';
|
|
5
7
|
import { buildUrl } from '@utils/url-builder';
|
|
6
8
|
|
|
7
|
-
const hasScalePlan = isEventCatalogScaleEnabled();
|
|
8
9
|
const inSSR = isSSR();
|
|
9
10
|
const mcpUrl = buildUrl('/docs/mcp');
|
|
11
|
+
|
|
12
|
+
// Each domain has its own MCP server, scoped to the domain and the resources in it (latest version)
|
|
13
|
+
const domains = await getDomains({ getAllVersions: false });
|
|
14
|
+
// What each domain's MCP server serves: the resources in its scope
|
|
15
|
+
const countScope = async (id: string) => {
|
|
16
|
+
try {
|
|
17
|
+
const scope = await resolveMcpScope({ kind: 'domain', id });
|
|
18
|
+
return {
|
|
19
|
+
services: scope.list('services').length,
|
|
20
|
+
messages: ['events', 'commands', 'queries'].reduce((count, collection) => count + scope.list(collection).length, 0),
|
|
21
|
+
};
|
|
22
|
+
} catch {
|
|
23
|
+
return { services: 0, messages: 0 };
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const domainServers: DomainMcpServer[] = (
|
|
28
|
+
await Promise.all(
|
|
29
|
+
domains.map(async (domain) => ({
|
|
30
|
+
id: domain.data.id,
|
|
31
|
+
name: domain.data.name,
|
|
32
|
+
summary: domain.data.summary,
|
|
33
|
+
...(await countScope(domain.data.id)),
|
|
34
|
+
docsUrl: buildUrl(`/docs/domains/${domain.data.id}/${domain.data.version}`),
|
|
35
|
+
url: buildUrl(`/docs/mcp/domains/${encodeURIComponent(domain.data.id)}`, true),
|
|
36
|
+
}))
|
|
37
|
+
)
|
|
38
|
+
).sort((a, b) => a.name.localeCompare(b.name));
|
|
10
39
|
---
|
|
11
40
|
|
|
12
41
|
<SettingsLayout title="MCP" active="mcp">
|
|
13
|
-
<McpSettingsForm client:load
|
|
42
|
+
<McpSettingsForm client:load inSSR={inSSR} mcpUrl={mcpUrl} domainServers={domainServers} />
|
|
14
43
|
</SettingsLayout>
|
|
@@ -26,12 +26,11 @@ export class Page extends HybridPage {
|
|
|
26
26
|
'events',
|
|
27
27
|
'commands',
|
|
28
28
|
'queries',
|
|
29
|
-
'domains',
|
|
30
29
|
'flows',
|
|
31
30
|
'containers',
|
|
32
31
|
'channels',
|
|
33
32
|
'data-products',
|
|
34
|
-
|
|
33
|
+
// systems and domains have their own pages (pages/visualiser/systems|domains/[id]/[version])
|
|
35
34
|
];
|
|
36
35
|
const allItems = await Promise.all(itemTypes.map((type) => loaders[type]()));
|
|
37
36
|
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
|
|
3
|
-
import VisualiserLayout from '@layouts/VisualiserLayout.astro';
|
|
4
2
|
import { buildUrl } from '@utils/url-builder';
|
|
5
|
-
import { ClientRouter } from 'astro:transitions';
|
|
6
3
|
|
|
7
4
|
import { Page } from './_index.data';
|
|
8
5
|
|
|
@@ -12,46 +9,6 @@ export const getStaticPaths = Page.getStaticPaths;
|
|
|
12
9
|
// Get data
|
|
13
10
|
const props = await Page.getData(Astro);
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
collection,
|
|
18
|
-
} = props;
|
|
12
|
+
// The service's data stores are shown at level 2 of its visualiser page
|
|
13
|
+
return Astro.redirect(buildUrl(`/visualiser/services/${props.data.id}/${props.data.version}?level=2`));
|
|
19
14
|
---
|
|
20
|
-
|
|
21
|
-
<VisualiserLayout title={`Visualiser | ${props.data.name} (${props.collection})`} description={props.data.summary}>
|
|
22
|
-
<div class="m-4">
|
|
23
|
-
<div
|
|
24
|
-
class="h-[calc(100vh-130px)] w-full relative border border-[rgb(var(--ec-page-border))] rounded-md"
|
|
25
|
-
id={`${id}-portal`}
|
|
26
|
-
transition:animate="fade"
|
|
27
|
-
>
|
|
28
|
-
</div>
|
|
29
|
-
<NodeGraph
|
|
30
|
-
id={id}
|
|
31
|
-
collection={`${collection}-containers`}
|
|
32
|
-
title={`${props.data.name} (v${props.data.version}) - Data`}
|
|
33
|
-
mode="full"
|
|
34
|
-
linkTo="visualiser"
|
|
35
|
-
version={props.data.version}
|
|
36
|
-
linksToVisualiser={false}
|
|
37
|
-
href={{
|
|
38
|
-
label: `Open documentation for ${props.data.name} v${props.data.version}`,
|
|
39
|
-
url: buildUrl(`/docs/${props.collection}/${props.data.id}/${props.data.version}`),
|
|
40
|
-
}}
|
|
41
|
-
/>
|
|
42
|
-
</div>
|
|
43
|
-
<ClientRouter />
|
|
44
|
-
</VisualiserLayout>
|
|
45
|
-
|
|
46
|
-
<script define:vars={{ id }}>
|
|
47
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
48
|
-
const urlSearchParams = new URLSearchParams(window.location.search);
|
|
49
|
-
const params = Object.fromEntries(urlSearchParams.entries());
|
|
50
|
-
const embeded = params.embed === 'true' ? true : false;
|
|
51
|
-
const viewport = document.getElementById(`${id}-portal`);
|
|
52
|
-
|
|
53
|
-
if (embeded) {
|
|
54
|
-
viewport.style.height = 'calc(100vh - 30px)';
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
</script>
|
|
@@ -28,7 +28,7 @@ const {
|
|
|
28
28
|
<NodeGraph
|
|
29
29
|
id={id}
|
|
30
30
|
collection={`${collection}-entities`}
|
|
31
|
-
title={`${props.data.name} (v${props.data.version}) - Entity
|
|
31
|
+
title={`${props.data.name} (v${props.data.version}) - Entity Diagram`}
|
|
32
32
|
mode="full"
|
|
33
33
|
linkTo="visualiser"
|
|
34
34
|
version={props.data.version}
|
|
@@ -4,128 +4,26 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Returns plain text mermaid flowchart syntax that can be used by LLMs,
|
|
6
6
|
* documentation tools, or pasted into mermaid-compatible renderers.
|
|
7
|
+
* Domains and systems are served by their own routes (visualiser/domains and visualiser/systems).
|
|
7
8
|
*/
|
|
8
9
|
import type { APIRoute, GetStaticPaths } from 'astro';
|
|
9
|
-
import { isAuthEnabled
|
|
10
|
-
import {
|
|
11
|
-
import { getNodesAndEdges as getNodesAndEdgesForService } from '@utils/node-graphs/services-node-graph';
|
|
12
|
-
import {
|
|
13
|
-
getNodesAndEdgesForCommands,
|
|
14
|
-
getNodesAndEdgesForEvents,
|
|
15
|
-
getNodesAndEdgesForQueries,
|
|
16
|
-
} from '@utils/node-graphs/message-node-graph';
|
|
17
|
-
import { getNodesAndEdges as getNodesAndEdgesForDomain } from '@utils/node-graphs/domains-node-graph';
|
|
18
|
-
import { getNodesAndEdges as getNodesAndEdgesForFlows } from '@utils/node-graphs/flows-node-graph';
|
|
19
|
-
import { getNodesAndEdges as getNodesAndEdgesForDataProduct } from '@utils/node-graphs/data-products-node-graph';
|
|
20
|
-
import { getNodesAndEdges as getNodesAndEdgesForContainer } from '@utils/node-graphs/container-node-graph';
|
|
21
|
-
import { getNodesAndEdges as getNodesAndEdgesForSystem } from '@utils/node-graphs/systems-node-graph';
|
|
22
|
-
import { convertToMermaid } from '@utils/node-graphs/export-mermaid';
|
|
23
|
-
import config from '@config';
|
|
24
|
-
import type { PageTypes } from '@types';
|
|
25
|
-
|
|
26
|
-
type PageTypesWithFlows = PageTypes | 'flows';
|
|
10
|
+
import { isAuthEnabled } from '@utils/feature';
|
|
11
|
+
import { createMermaidDiagramResponse, getMermaidDiagramPaths } from '../../_mermaid-route';
|
|
27
12
|
|
|
28
13
|
// Prerender static pages when auth is disabled, use SSR when auth is enabled
|
|
29
14
|
export const prerender = !isAuthEnabled();
|
|
30
15
|
|
|
31
|
-
const getNodesAndEdgesFunctions = {
|
|
32
|
-
services: getNodesAndEdgesForService,
|
|
33
|
-
events: getNodesAndEdgesForEvents,
|
|
34
|
-
commands: getNodesAndEdgesForCommands,
|
|
35
|
-
queries: getNodesAndEdgesForQueries,
|
|
36
|
-
domains: getNodesAndEdgesForDomain,
|
|
37
|
-
flows: getNodesAndEdgesForFlows,
|
|
38
|
-
containers: getNodesAndEdgesForContainer,
|
|
39
|
-
'data-products': getNodesAndEdgesForDataProduct,
|
|
40
|
-
systems: getNodesAndEdgesForSystem,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
16
|
export const getStaticPaths: GetStaticPaths = async () => {
|
|
44
|
-
|
|
45
|
-
return [];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const { getFlows } = await import('@utils/collections/flows');
|
|
49
|
-
|
|
50
|
-
const loaders = {
|
|
51
|
-
...pageDataLoader,
|
|
52
|
-
flows: getFlows,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const itemTypes: PageTypesWithFlows[] = [
|
|
17
|
+
const paths = await getMermaidDiagramPaths([
|
|
56
18
|
'events',
|
|
57
19
|
'commands',
|
|
58
20
|
'queries',
|
|
59
21
|
'services',
|
|
60
|
-
'domains',
|
|
61
22
|
'flows',
|
|
62
23
|
'containers',
|
|
63
24
|
'data-products',
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const allItems = await Promise.all(itemTypes.map((type) => loaders[type]()));
|
|
68
|
-
|
|
69
|
-
return allItems.flatMap((items, index) =>
|
|
70
|
-
items
|
|
71
|
-
.filter((item) => item.data.visualiser !== false)
|
|
72
|
-
.map((item) => ({
|
|
73
|
-
params: {
|
|
74
|
-
type: itemTypes[index],
|
|
75
|
-
id: item.data.id,
|
|
76
|
-
version: item.data.version,
|
|
77
|
-
},
|
|
78
|
-
}))
|
|
79
|
-
);
|
|
25
|
+
]);
|
|
26
|
+
return paths.map((params) => ({ params }));
|
|
80
27
|
};
|
|
81
28
|
|
|
82
|
-
export const GET: APIRoute = async ({ params }) =>
|
|
83
|
-
const { type, id, version } = params;
|
|
84
|
-
|
|
85
|
-
if (!type || !id || !version || !isVisualiserEnabled()) {
|
|
86
|
-
return new Response('Not found', { status: 404 });
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Validate the type is supported
|
|
90
|
-
if (!(type in getNodesAndEdgesFunctions)) {
|
|
91
|
-
return new Response(`Unsupported type: ${type}`, { status: 400 });
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
try {
|
|
95
|
-
// Get nodes and edges for this resource
|
|
96
|
-
const { nodes, edges } = await getNodesAndEdgesFunctions[type as keyof typeof getNodesAndEdgesFunctions]({
|
|
97
|
-
id,
|
|
98
|
-
version,
|
|
99
|
-
mode: 'full',
|
|
100
|
-
channelRenderMode: config.visualiser?.channels?.renderMode === 'single' ? 'single' : 'flat',
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
if (!nodes || nodes.length === 0) {
|
|
104
|
-
return new Response('No diagram data available', { status: 404 });
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Convert to mermaid
|
|
108
|
-
const mermaidCode = convertToMermaid(nodes, edges, {
|
|
109
|
-
includeStyles: true,
|
|
110
|
-
direction: 'LR',
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
// Add header comment with metadata
|
|
114
|
-
const header = `%% EventCatalog Mermaid Diagram
|
|
115
|
-
%% Resource: ${type}/${id} (v${version})
|
|
116
|
-
%% Generated: ${new Date().toISOString()}
|
|
117
|
-
|
|
118
|
-
`;
|
|
119
|
-
|
|
120
|
-
return new Response(header + mermaidCode, {
|
|
121
|
-
status: 200,
|
|
122
|
-
headers: {
|
|
123
|
-
'Content-Type': 'text/plain; charset=utf-8',
|
|
124
|
-
'Cache-Control': 'public, max-age=3600',
|
|
125
|
-
},
|
|
126
|
-
});
|
|
127
|
-
} catch (error) {
|
|
128
|
-
console.error('Error generating mermaid diagram:', error);
|
|
129
|
-
return new Response('Failed to generate diagram', { status: 500 });
|
|
130
|
-
}
|
|
131
|
-
};
|
|
29
|
+
export const GET: APIRoute = async ({ params }) => createMermaidDiagramResponse(params);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serves a resource's architecture diagram as Mermaid at /visualiser/{type}/{id}/{version}.mermaid,
|
|
3
|
+
* as plain text that can be used by LLMs, documentation tools, or pasted into Mermaid renderers.
|
|
4
|
+
*
|
|
5
|
+
* Domains and systems have their own routes next to their Diagram pages
|
|
6
|
+
* (visualiser/domains/[id]/[version]), which would otherwise handle these requests first.
|
|
7
|
+
*/
|
|
8
|
+
import { isAuthEnabled, isVisualiserEnabled } from '@utils/feature';
|
|
9
|
+
import { pageDataLoader } from '@utils/page-loaders/page-data-loader';
|
|
10
|
+
import { getArchitectureDiagramGraph } from '@utils/node-graphs/architecture-diagram';
|
|
11
|
+
import { isArchitectureDiagramCollection } from '@utils/node-graphs/architecture-diagram-types';
|
|
12
|
+
import { convertToMermaid } from '@utils/node-graphs/export-mermaid';
|
|
13
|
+
import type { PageTypes } from '@types';
|
|
14
|
+
|
|
15
|
+
export type MermaidDiagramType =
|
|
16
|
+
| Extract<PageTypes, 'events' | 'commands' | 'queries' | 'services' | 'domains' | 'containers' | 'data-products' | 'systems'>
|
|
17
|
+
| 'flows';
|
|
18
|
+
|
|
19
|
+
/** Every version of each type that has a diagram, for building the Mermaid files in static builds */
|
|
20
|
+
export async function getMermaidDiagramPaths(types: MermaidDiagramType[]) {
|
|
21
|
+
if (isAuthEnabled() || !isVisualiserEnabled()) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const { getFlows } = await import('@utils/collections/flows');
|
|
26
|
+
const loaders = { ...pageDataLoader, flows: getFlows };
|
|
27
|
+
|
|
28
|
+
const allItems = await Promise.all(types.map((type) => loaders[type]()));
|
|
29
|
+
|
|
30
|
+
return allItems.flatMap((items, index) =>
|
|
31
|
+
items
|
|
32
|
+
.filter((item: any) => item.data.visualiser !== false)
|
|
33
|
+
.map((item: any) => ({ type: types[index], id: item.data.id as string, version: item.data.version as string }))
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function createMermaidDiagramResponse({ type, id, version }: { type?: string; id?: string; version?: string }) {
|
|
38
|
+
if (!type || !id || !version || !isVisualiserEnabled()) {
|
|
39
|
+
return new Response('Not found', { status: 404 });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Validate the type is supported
|
|
43
|
+
if (!isArchitectureDiagramCollection(type)) {
|
|
44
|
+
return new Response(`Unsupported type: ${type}`, { status: 400 });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
// Built the same way as the resource's Diagram page
|
|
49
|
+
const { nodes, edges } = await getArchitectureDiagramGraph({ collection: type, id, version });
|
|
50
|
+
|
|
51
|
+
if (!nodes || nodes.length === 0) {
|
|
52
|
+
return new Response('No diagram data available', { status: 404 });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const mermaidCode = convertToMermaid(nodes, edges, {
|
|
56
|
+
includeStyles: true,
|
|
57
|
+
direction: 'LR',
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Add header comment with metadata
|
|
61
|
+
const header = `%% EventCatalog Mermaid Diagram
|
|
62
|
+
%% Resource: ${type}/${id} (v${version})
|
|
63
|
+
%% Generated: ${new Date().toISOString()}
|
|
64
|
+
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
return new Response(header + mermaidCode, {
|
|
68
|
+
status: 200,
|
|
69
|
+
headers: {
|
|
70
|
+
'Content-Type': 'text/plain; charset=utf-8',
|
|
71
|
+
'Cache-Control': 'public, max-age=3600',
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.error('Error generating mermaid diagram:', error);
|
|
76
|
+
return new Response('Failed to generate diagram', { status: 500 });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { isAuthEnabled, isVisualiserEnabled } from '@utils/feature';
|
|
2
|
+
import { getDomains } from '@utils/collections/domains';
|
|
3
|
+
import { Page as SystemsContextPage } from './systems-context/_index.data';
|
|
4
|
+
|
|
5
|
+
// A domain's visualiser page, with levels from the domains it talks to down to
|
|
6
|
+
// its messages. Same data as the old System Diagram page (which now redirects
|
|
7
|
+
// here), but every domain gets a page.
|
|
8
|
+
export class Page extends SystemsContextPage {
|
|
9
|
+
static async getStaticPaths(): Promise<Array<{ params: any; props: any }>> {
|
|
10
|
+
if (isAuthEnabled() || !isVisualiserEnabled()) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Every version of each domain has a page (the sidebar links to the version viewed)
|
|
15
|
+
const domains = await getDomains();
|
|
16
|
+
|
|
17
|
+
return domains
|
|
18
|
+
.filter((domain) => domain.data.visualiser !== false)
|
|
19
|
+
.map((domain) => ({
|
|
20
|
+
params: {
|
|
21
|
+
id: domain.data.id,
|
|
22
|
+
version: domain.data.version,
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
type: 'domains',
|
|
26
|
+
...domain,
|
|
27
|
+
},
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
protected static async fetchData(params: any) {
|
|
32
|
+
const { id, version } = params;
|
|
33
|
+
|
|
34
|
+
if (!id || !version || !isVisualiserEnabled()) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const domains = await getDomains();
|
|
39
|
+
return (
|
|
40
|
+
domains.find((domain) => domain.data.id === id && domain.data.version === version && domain.data.visualiser !== false) ??
|
|
41
|
+
null
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -28,7 +28,7 @@ const {
|
|
|
28
28
|
<NodeGraph
|
|
29
29
|
id={id}
|
|
30
30
|
collection={`${collection}-entities`}
|
|
31
|
-
title={`${props.data.name} (v${props.data.version}) - Entity
|
|
31
|
+
title={`${props.data.name} (v${props.data.version}) - Entity Diagram`}
|
|
32
32
|
mode="full"
|
|
33
33
|
linkTo="visualiser"
|
|
34
34
|
version={props.data.version}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
|
|
3
|
+
import VisualiserLayout from '@layouts/VisualiserLayout.astro';
|
|
4
|
+
import { buildUrl } from '@utils/url-builder';
|
|
5
|
+
import { ClientRouter } from 'astro:transitions';
|
|
6
|
+
|
|
7
|
+
import { Page } from './_index.data';
|
|
8
|
+
|
|
9
|
+
export const prerender = Page.prerender;
|
|
10
|
+
export const getStaticPaths = Page.getStaticPaths;
|
|
11
|
+
|
|
12
|
+
// Get data
|
|
13
|
+
const props = await Page.getData(Astro);
|
|
14
|
+
|
|
15
|
+
const {
|
|
16
|
+
data: { id },
|
|
17
|
+
} = props;
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<VisualiserLayout title={`Visualiser | ${props.data.name} (domains)`} description={props.data.summary}>
|
|
21
|
+
<div id="domain-visualiser-page" class="p-2">
|
|
22
|
+
<div
|
|
23
|
+
class="domain-visualiser-viewport h-[calc(100vh-5rem)] w-full relative border border-[rgb(var(--ec-page-border))]"
|
|
24
|
+
id={`${id}-portal`}
|
|
25
|
+
transition:name="visualiser-graph"
|
|
26
|
+
>
|
|
27
|
+
</div>
|
|
28
|
+
<NodeGraph
|
|
29
|
+
id={id}
|
|
30
|
+
collection="domains-levels"
|
|
31
|
+
overview={{ label: 'domains it talks to' }}
|
|
32
|
+
title={`${props.data.name} (v${props.data.version})`}
|
|
33
|
+
mode="full"
|
|
34
|
+
linkTo="visualiser"
|
|
35
|
+
version={props.data.version}
|
|
36
|
+
linksToVisualiser={false}
|
|
37
|
+
zoomOnScroll={true}
|
|
38
|
+
href={{
|
|
39
|
+
label: `Open documentation for ${props.data.name} v${props.data.version}`,
|
|
40
|
+
url: buildUrl(`/docs/domains/${props.data.id}/${props.data.version}`),
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
<ClientRouter />
|
|
45
|
+
</VisualiserLayout>
|
|
46
|
+
|
|
47
|
+
<style is:global>
|
|
48
|
+
html[data-embedded='true'] #domain-visualiser-page {
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
height: 100vh;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
html[data-embedded='true'] #domain-visualiser-page .domain-visualiser-viewport {
|
|
54
|
+
height: 100%;
|
|
55
|
+
}
|
|
56
|
+
</style>
|
package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/systems-context/index.astro
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
3
|
-
import VisualiserLayout from '@layouts/VisualiserLayout.astro';
|
|
4
|
-
import { ClientRouter } from 'astro:transitions';
|
|
2
|
+
import { buildUrl } from '@utils/url-builder';
|
|
5
3
|
|
|
6
4
|
import { Page } from './_index.data';
|
|
7
5
|
|
|
@@ -11,41 +9,6 @@ export const getStaticPaths = Page.getStaticPaths;
|
|
|
11
9
|
// Get data
|
|
12
10
|
const props = await Page.getData(Astro);
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} = props;
|
|
12
|
+
// The System Diagram is now level 1 of the domain's visualiser page
|
|
13
|
+
return Astro.redirect(buildUrl(`/visualiser/domains/${props.data.id}/${props.data.version}?level=1`));
|
|
17
14
|
---
|
|
18
|
-
|
|
19
|
-
<VisualiserLayout title={`Visualiser | ${props.data.name} - System Context`} description={props.data.summary}>
|
|
20
|
-
<div class="p-2">
|
|
21
|
-
<div
|
|
22
|
-
class="h-[calc(100vh-5rem)] w-full relative border border-[rgb(var(--ec-page-border))]"
|
|
23
|
-
id={`${id}-portal`}
|
|
24
|
-
transition:name="visualiser-graph"
|
|
25
|
-
>
|
|
26
|
-
</div>
|
|
27
|
-
<NodeGraph
|
|
28
|
-
id={id}
|
|
29
|
-
collection="domains-systems-context"
|
|
30
|
-
title={`${props.data.name} (v${props.data.version}) - System Context`}
|
|
31
|
-
mode="full"
|
|
32
|
-
linkTo="visualiser"
|
|
33
|
-
version={props.data.version}
|
|
34
|
-
linksToVisualiser={false}
|
|
35
|
-
/>
|
|
36
|
-
</div>
|
|
37
|
-
<ClientRouter />
|
|
38
|
-
</VisualiserLayout>
|
|
39
|
-
|
|
40
|
-
<script define:vars={{ id }}>
|
|
41
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
42
|
-
const urlSearchParams = new URLSearchParams(window.location.search);
|
|
43
|
-
const params = Object.fromEntries(urlSearchParams.entries());
|
|
44
|
-
const embeded = params.embed === 'true' ? true : false;
|
|
45
|
-
const viewport = document.getElementById(`${id}-portal`);
|
|
46
|
-
|
|
47
|
-
if (embeded) {
|
|
48
|
-
viewport.style.height = 'calc(100vh - 30px)';
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API endpoint to return mermaid diagram code for a domains visualiser page
|
|
3
|
+
* URL: /visualiser/domains/{id}/{version}.mermaid
|
|
4
|
+
*
|
|
5
|
+
* Lives next to the domains Diagram page, which would otherwise handle these requests
|
|
6
|
+
* before the generic visualiser/[type]/[id]/[version].mermaid route.
|
|
7
|
+
*/
|
|
8
|
+
import type { APIRoute, GetStaticPaths } from 'astro';
|
|
9
|
+
import { isAuthEnabled } from '@utils/feature';
|
|
10
|
+
import { createMermaidDiagramResponse, getMermaidDiagramPaths } from '../../_mermaid-route';
|
|
11
|
+
|
|
12
|
+
// Prerender static pages when auth is disabled, use SSR when auth is enabled
|
|
13
|
+
export const prerender = !isAuthEnabled();
|
|
14
|
+
|
|
15
|
+
export const getStaticPaths: GetStaticPaths = async () => {
|
|
16
|
+
const paths = await getMermaidDiagramPaths(['domains']);
|
|
17
|
+
return paths.map(({ id, version }) => ({ params: { id, version } }));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const GET: APIRoute = async ({ params }) => createMermaidDiagramResponse({ ...params, type: 'domains' });
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { isAuthEnabled, isVisualiserEnabled } from '@utils/feature';
|
|
2
|
+
import { getSystems } from '@utils/collections/systems';
|
|
3
|
+
import { Page as ContextPage } from './context/_index.data';
|
|
4
|
+
|
|
5
|
+
// A system's visualiser page, with levels from its context diagram down to its
|
|
6
|
+
// messages. Same data as the System Context page, but every system gets a page
|
|
7
|
+
// (the context level is optional, the system's resources always exist).
|
|
8
|
+
export class Page extends ContextPage {
|
|
9
|
+
static async getStaticPaths(): Promise<Array<{ params: any; props: any }>> {
|
|
10
|
+
if (isAuthEnabled() || !isVisualiserEnabled()) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const systems = await getSystems();
|
|
15
|
+
|
|
16
|
+
return systems
|
|
17
|
+
.filter((system) => system.data.visualiser !== false)
|
|
18
|
+
.map((system) => ({
|
|
19
|
+
params: {
|
|
20
|
+
id: system.data.id,
|
|
21
|
+
version: system.data.version,
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
type: 'systems',
|
|
25
|
+
...system,
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
}
|