@eventcatalog/core 4.12.2 → 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-IVVM67LN.js → chunk-CR6AK5LR.js} +1 -1
- package/dist/{chunk-GTIC4R74.js → chunk-LR7AGRHN.js} +13 -16
- package/dist/chunk-TQLRG35T.js +203 -0
- package/dist/{chunk-WK4J6FP3.js → chunk-TWN43V4T.js} +1 -1
- package/dist/{chunk-ZW3MYAWF.js → chunk-WAIADKQE.js} +1 -1
- package/dist/{chunk-RPVA2SZY.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 +30 -93
- 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 +2 -3
- 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 -90
- 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/catalog-force-graph.ts +1 -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 +62 -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 +153 -45
- 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
|
@@ -1,32 +1,17 @@
|
|
|
1
1
|
import { getCollection } from 'astro:content';
|
|
2
2
|
import type { CollectionEntry } from 'astro:content';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
calculatedNodes,
|
|
6
|
-
createEdge,
|
|
7
|
-
generateIdForNode,
|
|
8
|
-
buildContextMenuForSystem,
|
|
9
|
-
DEFAULT_NODE_HEIGHT,
|
|
10
|
-
layoutDagreGraph,
|
|
11
|
-
} from '@utils/node-graphs/utils/utils';
|
|
3
|
+
import { createEdge, generateIdForNode, buildContextMenuForSystem } from '@utils/node-graphs/utils/utils';
|
|
4
|
+
import { layoutNodeGraph } from '@utils/node-graphs/layout-node-graph';
|
|
12
5
|
import { MarkerType } from '@xyflow/react';
|
|
13
6
|
import { createVersionedMap, findInMap } from '@utils/collections/util';
|
|
14
7
|
|
|
15
|
-
type DagreGraph = any;
|
|
16
|
-
|
|
17
8
|
interface NodesAndEdgesProps {
|
|
18
9
|
id: string;
|
|
19
10
|
version: string;
|
|
20
|
-
defaultFlow?: DagreGraph;
|
|
21
11
|
mode?: 'simple' | 'full';
|
|
22
12
|
layout?: boolean;
|
|
23
13
|
}
|
|
24
14
|
|
|
25
|
-
// System nodes are wider than the default to fit the system name + summary comfortably.
|
|
26
|
-
const SYSTEM_NODE_WIDTH = 270;
|
|
27
|
-
// Actor nodes are narrower than systems — a compact pill with an icon + name.
|
|
28
|
-
const ACTOR_NODE_WIDTH = 180;
|
|
29
|
-
|
|
30
15
|
type SystemActor = {
|
|
31
16
|
id: string;
|
|
32
17
|
name?: string;
|
|
@@ -52,7 +37,6 @@ interface ContextGraphFromSeedsProps {
|
|
|
52
37
|
seedSystems: CollectionEntry<'systems'>[];
|
|
53
38
|
systemMap: Map<string, CollectionEntry<'systems'>[]>;
|
|
54
39
|
serviceMap: Map<string, CollectionEntry<'services'>[]>;
|
|
55
|
-
defaultFlow?: DagreGraph;
|
|
56
40
|
mode?: 'simple' | 'full';
|
|
57
41
|
layout?: boolean;
|
|
58
42
|
}
|
|
@@ -67,15 +51,13 @@ interface ContextGraphFromSeedsProps {
|
|
|
67
51
|
* (relationships without a label are intentionally not drawn). Actors are rendered
|
|
68
52
|
* inline and deduped across all systems.
|
|
69
53
|
*/
|
|
70
|
-
const buildContextGraphFromSeeds = ({
|
|
54
|
+
const buildContextGraphFromSeeds = async ({
|
|
71
55
|
seedSystems,
|
|
72
56
|
systemMap,
|
|
73
57
|
serviceMap,
|
|
74
|
-
defaultFlow,
|
|
75
58
|
mode = 'simple',
|
|
76
59
|
layout = true,
|
|
77
60
|
}: ContextGraphFromSeedsProps) => {
|
|
78
|
-
const flow = defaultFlow || createDagreGraph({ ranksep: 280, nodesep: 80, edgesep: 50 });
|
|
79
61
|
const nodes = new Map<string, any>();
|
|
80
62
|
const edges = new Map<string, any>();
|
|
81
63
|
|
|
@@ -89,8 +71,6 @@ const buildContextGraphFromSeeds = ({
|
|
|
89
71
|
}, 0);
|
|
90
72
|
};
|
|
91
73
|
|
|
92
|
-
// Actor node ids, tracked so they can be sized differently during layout.
|
|
93
|
-
const actorNodeIds = new Set<string>();
|
|
94
74
|
// System node ids, tracked so we can detect reciprocal system-to-system
|
|
95
75
|
// relationships and collapse them into a single double-headed edge.
|
|
96
76
|
const systemNodeIds = new Set<string>();
|
|
@@ -118,7 +98,6 @@ const buildContextGraphFromSeeds = ({
|
|
|
118
98
|
const nodeId = `actor-${actor.id}`;
|
|
119
99
|
if (nodes.has(nodeId)) return nodeId;
|
|
120
100
|
|
|
121
|
-
actorNodeIds.add(nodeId);
|
|
122
101
|
nodes.set(nodeId, {
|
|
123
102
|
id: nodeId,
|
|
124
103
|
type: 'context-actor',
|
|
@@ -292,30 +271,15 @@ const buildContextGraphFromSeeds = ({
|
|
|
292
271
|
mergedEdgeKeys.add(reverseId);
|
|
293
272
|
}
|
|
294
273
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
flow.setNode(node.id, {
|
|
298
|
-
width: actorNodeIds.has(node.id) ? ACTOR_NODE_WIDTH : SYSTEM_NODE_WIDTH,
|
|
299
|
-
height: DEFAULT_NODE_HEIGHT,
|
|
300
|
-
})
|
|
301
|
-
);
|
|
302
|
-
edges.forEach((edge) => flow.setEdge(edge.source, edge.target));
|
|
303
|
-
|
|
304
|
-
if (layout) {
|
|
305
|
-
layoutDagreGraph(flow);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
return {
|
|
309
|
-
nodes: calculatedNodes(flow, Array.from(nodes.values())),
|
|
310
|
-
edges: [...edges.values()],
|
|
311
|
-
};
|
|
274
|
+
const graph = { nodes: [...nodes.values()], edges: [...edges.values()] };
|
|
275
|
+
return layout ? layoutNodeGraph(graph) : graph;
|
|
312
276
|
};
|
|
313
277
|
|
|
314
278
|
/**
|
|
315
279
|
* Builds the System Diagram for a single system, seeding the traversal from
|
|
316
280
|
* that system and walking its relationships and actors outward.
|
|
317
281
|
*/
|
|
318
|
-
export const getNodesAndEdges = async ({ id, version,
|
|
282
|
+
export const getNodesAndEdges = async ({ id, version, mode = 'simple', layout = true }: NodesAndEdgesProps) => {
|
|
319
283
|
const [allSystems, allServices] = await Promise.all([getCollection('systems'), getCollection('services')]);
|
|
320
284
|
const systemMap = createVersionedMap(allSystems);
|
|
321
285
|
const serviceMap = createVersionedMap(allServices);
|
|
@@ -327,7 +291,14 @@ export const getNodesAndEdges = async ({ id, version, defaultFlow, mode = 'simpl
|
|
|
327
291
|
return { nodes: [], edges: [] };
|
|
328
292
|
}
|
|
329
293
|
|
|
330
|
-
|
|
294
|
+
const graph = await buildContextGraphFromSeeds({ seedSystems: [rootSystem], systemMap, serviceMap, mode, layout });
|
|
295
|
+
|
|
296
|
+
// Mark the system being viewed, like other resource graphs do
|
|
297
|
+
const rootNodeId = generateIdForNode(rootSystem);
|
|
298
|
+
return {
|
|
299
|
+
...graph,
|
|
300
|
+
nodes: graph.nodes.map((node: any) => (node.id === rootNodeId ? { ...node, data: { ...node.data, isFocused: true } } : node)),
|
|
301
|
+
};
|
|
331
302
|
};
|
|
332
303
|
|
|
333
304
|
/**
|
|
@@ -336,13 +307,7 @@ export const getNodesAndEdges = async ({ id, version, defaultFlow, mode = 'simpl
|
|
|
336
307
|
* the domain's systems plus any related systems they point at (or that point at them),
|
|
337
308
|
* with actors rendered inline — giving a single context view across the domain.
|
|
338
309
|
*/
|
|
339
|
-
export const getNodesAndEdgesForDomainSystems = async ({
|
|
340
|
-
id,
|
|
341
|
-
version,
|
|
342
|
-
defaultFlow,
|
|
343
|
-
mode = 'simple',
|
|
344
|
-
layout = true,
|
|
345
|
-
}: NodesAndEdgesProps) => {
|
|
310
|
+
export const getNodesAndEdgesForDomainSystems = async ({ id, version, mode = 'simple', layout = true }: NodesAndEdgesProps) => {
|
|
346
311
|
const [allDomains, allSystems, allServices] = await Promise.all([
|
|
347
312
|
getCollection('domains'),
|
|
348
313
|
getCollection('systems'),
|
|
@@ -367,11 +332,10 @@ export const getNodesAndEdgesForDomainSystems = async ({
|
|
|
367
332
|
return { nodes: [], edges: [] };
|
|
368
333
|
}
|
|
369
334
|
|
|
370
|
-
return buildContextGraphFromSeeds({ seedSystems, systemMap, serviceMap,
|
|
335
|
+
return buildContextGraphFromSeeds({ seedSystems, systemMap, serviceMap, mode, layout });
|
|
371
336
|
};
|
|
372
337
|
|
|
373
338
|
interface AllSystemsProps {
|
|
374
|
-
defaultFlow?: DagreGraph;
|
|
375
339
|
mode?: 'simple' | 'full';
|
|
376
340
|
layout?: boolean;
|
|
377
341
|
}
|
|
@@ -381,7 +345,7 @@ interface AllSystemsProps {
|
|
|
381
345
|
* seed, so the traversal draws all systems, the relationships between them, and the
|
|
382
346
|
* actors around them — a single map of how every system in the catalog relates.
|
|
383
347
|
*/
|
|
384
|
-
export const getNodesAndEdgesForAllSystems = async ({
|
|
348
|
+
export const getNodesAndEdgesForAllSystems = async ({ mode = 'simple', layout = true }: AllSystemsProps = {}) => {
|
|
385
349
|
const [allSystems, allServices] = await Promise.all([getCollection('systems'), getCollection('services')]);
|
|
386
350
|
const systemMap = createVersionedMap(allSystems);
|
|
387
351
|
const serviceMap = createVersionedMap(allServices);
|
|
@@ -396,5 +360,5 @@ export const getNodesAndEdgesForAllSystems = async ({ defaultFlow, mode = 'simpl
|
|
|
396
360
|
return { nodes: [], edges: [] };
|
|
397
361
|
}
|
|
398
362
|
|
|
399
|
-
return buildContextGraphFromSeeds({ seedSystems, systemMap, serviceMap,
|
|
363
|
+
return buildContextGraphFromSeeds({ seedSystems, systemMap, serviceMap, mode, layout });
|
|
400
364
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { getNodesAndEdges as getSystemContextNodesAndEdges } from './system-context-node-graph';
|
|
2
|
+
import { getNodesAndEdges as getSystemNodesAndEdges } from './systems-node-graph';
|
|
3
|
+
import { layoutLevels } from '@utils/node-graphs/layout-node-graph';
|
|
4
|
+
|
|
5
|
+
interface NodesAndEdgesProps {
|
|
6
|
+
id: string;
|
|
7
|
+
version: string;
|
|
8
|
+
mode?: 'simple' | 'full';
|
|
9
|
+
channelRenderMode?: 'single' | 'flat';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const CACHE_ENABLED = process.env.DISABLE_EVENTCATALOG_CACHE !== 'true';
|
|
13
|
+
|
|
14
|
+
// Built once for each system version and options
|
|
15
|
+
const levelsCache = new Map<string, ReturnType<typeof buildLevels>>();
|
|
16
|
+
|
|
17
|
+
export const getNodesAndEdges = (props: NodesAndEdgesProps) => {
|
|
18
|
+
if (!CACHE_ENABLED) return buildLevels(props);
|
|
19
|
+
const { id, version, mode = 'simple', channelRenderMode } = props;
|
|
20
|
+
const key = [id, version, mode, channelRenderMode].join('/');
|
|
21
|
+
if (!levelsCache.has(key)) levelsCache.set(key, buildLevels(props));
|
|
22
|
+
return levelsCache.get(key)!;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A system's resource diagram shown inside its context diagram: the system's node
|
|
27
|
+
* is replaced by the expanded system group (services, data stores, messages...),
|
|
28
|
+
* and the system's relationships and actors connect to the group instead.
|
|
29
|
+
* Returns level 1 too (`overview`, the context diagram) and the graph without
|
|
30
|
+
* its messages and channels (`hiddenMessages`).
|
|
31
|
+
*/
|
|
32
|
+
const buildLevels = async ({ id, version, mode = 'simple', channelRenderMode }: NodesAndEdgesProps) => {
|
|
33
|
+
const [context, system] = await Promise.all([
|
|
34
|
+
getSystemContextNodesAndEdges({ id, version, mode, layout: false }),
|
|
35
|
+
getSystemNodesAndEdges({ id, version, mode, channelRenderMode, wrapInSystemGroup: true, layout: false }),
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
const group = system.nodes.find((node: any) => node.type === 'system-group');
|
|
39
|
+
const rootSystemNode = context.nodes.find((node: any) => node.data?.isFocused);
|
|
40
|
+
if (!group || !rootSystemNode) return layoutLevels(system, context);
|
|
41
|
+
|
|
42
|
+
const systemNodeIds = new Set(system.nodes.map((node: any) => node.id));
|
|
43
|
+
const contextNodes = context.nodes.filter((node: any) => node.id !== rootSystemNode.id && !systemNodeIds.has(node.id));
|
|
44
|
+
const toGroup = (nodeId: string) => (nodeId === rootSystemNode.id ? group.id : nodeId);
|
|
45
|
+
const contextEdges = context.edges.map((edge: any) => ({
|
|
46
|
+
...edge,
|
|
47
|
+
id: `context-${edge.id}`,
|
|
48
|
+
source: toGroup(edge.source),
|
|
49
|
+
target: toGroup(edge.target),
|
|
50
|
+
}));
|
|
51
|
+
|
|
52
|
+
// Lay the context and the expanded system out together
|
|
53
|
+
const detailed = {
|
|
54
|
+
// Parent must come before its children in the array for React Flow
|
|
55
|
+
nodes: [group, ...contextNodes, ...system.nodes.filter((node: any) => node.id !== group.id)],
|
|
56
|
+
edges: [...system.edges, ...contextEdges],
|
|
57
|
+
};
|
|
58
|
+
return layoutLevels(detailed, context);
|
|
59
|
+
};
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
import { getCollection } from 'astro:content';
|
|
2
|
-
import {
|
|
3
|
-
createDagreGraph,
|
|
4
|
-
calculatedNodes,
|
|
5
|
-
DEFAULT_NODE_WIDTH,
|
|
6
|
-
DEFAULT_NODE_HEIGHT,
|
|
7
|
-
layoutDagreGraph,
|
|
8
|
-
} from '@utils/node-graphs/utils/utils';
|
|
2
|
+
import { layoutNodeGraph } from '@utils/node-graphs/layout-node-graph';
|
|
9
3
|
import { getNodesAndEdges as getServicesNodeAndEdges } from './services-node-graph';
|
|
10
4
|
import { getNodesAndEdges as getContainerNodeAndEdges } from './container-node-graph';
|
|
11
5
|
import merge from 'lodash.merge';
|
|
12
6
|
import { createVersionedMap, findInMap } from '@utils/collections/util';
|
|
13
7
|
|
|
14
|
-
type DagreGraph = any;
|
|
15
|
-
|
|
16
8
|
interface NodesAndEdgesProps {
|
|
17
9
|
id: string;
|
|
18
10
|
version: string;
|
|
19
|
-
defaultFlow?: DagreGraph;
|
|
20
11
|
mode?: 'simple' | 'full';
|
|
21
12
|
group?: boolean;
|
|
22
13
|
// When true, wraps the whole system graph in a single parent boundary node
|
|
@@ -29,14 +20,12 @@ interface NodesAndEdgesProps {
|
|
|
29
20
|
export const getNodesAndEdges = async ({
|
|
30
21
|
id,
|
|
31
22
|
version,
|
|
32
|
-
defaultFlow,
|
|
33
23
|
mode = 'simple',
|
|
34
24
|
group = false,
|
|
35
25
|
wrapInSystemGroup = false,
|
|
36
26
|
channelRenderMode = 'flat',
|
|
37
27
|
layout = true,
|
|
38
28
|
}: NodesAndEdgesProps) => {
|
|
39
|
-
const flow = defaultFlow || createDagreGraph({ ranksep: 360, nodesep: 50, edgesep: 50 });
|
|
40
29
|
let nodes = new Map(),
|
|
41
30
|
edges = new Map();
|
|
42
31
|
|
|
@@ -80,7 +69,6 @@ export const getNodesAndEdges = async ({
|
|
|
80
69
|
const { nodes: serviceNodes, edges: serviceEdges } = await getServicesNodeAndEdges({
|
|
81
70
|
id: service.id,
|
|
82
71
|
version: service.version,
|
|
83
|
-
defaultFlow: flow,
|
|
84
72
|
mode,
|
|
85
73
|
renderAllEdges: true,
|
|
86
74
|
channelRenderMode,
|
|
@@ -105,7 +93,6 @@ export const getNodesAndEdges = async ({
|
|
|
105
93
|
const { nodes: containerNodes, edges: containerEdges } = await getContainerNodeAndEdges({
|
|
106
94
|
id: container.id,
|
|
107
95
|
version: container.version,
|
|
108
|
-
defaultFlow: flow,
|
|
109
96
|
mode,
|
|
110
97
|
channelRenderMode,
|
|
111
98
|
layout: false,
|
|
@@ -118,6 +105,12 @@ export const getNodesAndEdges = async ({
|
|
|
118
105
|
containerEdges.forEach((e) => edges.set(e.id, e));
|
|
119
106
|
}
|
|
120
107
|
|
|
108
|
+
// The graphs merged above each mark their own service / data store as the one
|
|
109
|
+
// being viewed, but here the system is (see the system group below)
|
|
110
|
+
nodes.forEach((n) => {
|
|
111
|
+
if (n.data?.isFocused) nodes.set(n.id, { ...n, data: { ...n.data, isFocused: false } });
|
|
112
|
+
});
|
|
113
|
+
|
|
121
114
|
// Add group node to the graph (used when a system is rendered inside another view)
|
|
122
115
|
if (group) {
|
|
123
116
|
nodes.forEach((n) => {
|
|
@@ -125,89 +118,36 @@ export const getNodesAndEdges = async ({
|
|
|
125
118
|
});
|
|
126
119
|
}
|
|
127
120
|
|
|
128
|
-
if (layout) {
|
|
129
|
-
layoutDagreGraph(flow);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
let laidOutNodes = calculatedNodes(flow, Array.from(nodes.values()));
|
|
133
|
-
|
|
134
121
|
// Wrap everything inside a single parent "system group" boundary node, so all
|
|
135
|
-
// the services / data stores / messages visibly belong to one system
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (wrapInSystemGroup && layout && laidOutNodes.length > 0) {
|
|
139
|
-
laidOutNodes = wrapNodesInSystemGroup(laidOutNodes, flow, system);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return {
|
|
143
|
-
nodes: laidOutNodes,
|
|
122
|
+
// the services / data stores / messages visibly belong to one system
|
|
123
|
+
const graph = {
|
|
124
|
+
nodes: wrapInSystemGroup && nodes.size > 0 ? wrapNodesInSystemGroup([...nodes.values()], system) : [...nodes.values()],
|
|
144
125
|
edges: [...edges.values()],
|
|
145
126
|
};
|
|
146
|
-
};
|
|
147
127
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const GROUP_PADDING_Y = 100;
|
|
151
|
-
const GROUP_HEADER_HEIGHT = 64;
|
|
128
|
+
return layout ? layoutNodeGraph(graph) : graph;
|
|
129
|
+
};
|
|
152
130
|
|
|
153
131
|
/**
|
|
154
|
-
* Wraps a
|
|
155
|
-
*
|
|
156
|
-
* The rest of the app uses dagre's node position directly as the ReactFlow
|
|
157
|
-
* position, so we stay in that same coordinate space. Child nodes under a
|
|
158
|
-
* `parentId` are positioned relative to the parent, so we:
|
|
159
|
-
* 1. compute the bounding box of all nodes (using dagre position + size),
|
|
160
|
-
* 2. create a parent group node at the box origin (minus padding/header),
|
|
161
|
-
* 3. re-home every node as a child, offset by the group origin.
|
|
132
|
+
* Wraps a system's nodes in one parent `system-group` node (sized to fit them
|
|
133
|
+
* when the graph is laid out), so they visibly belong to the system.
|
|
162
134
|
*/
|
|
163
|
-
const wrapNodesInSystemGroup = (
|
|
164
|
-
let minX = Infinity;
|
|
165
|
-
let minY = Infinity;
|
|
166
|
-
let maxX = -Infinity;
|
|
167
|
-
let maxY = -Infinity;
|
|
168
|
-
|
|
169
|
-
for (const node of laidOutNodes) {
|
|
170
|
-
const dims = flow.node(node.id) || {};
|
|
171
|
-
const width = dims.width ?? DEFAULT_NODE_WIDTH;
|
|
172
|
-
const height = dims.height ?? DEFAULT_NODE_HEIGHT;
|
|
173
|
-
|
|
174
|
-
minX = Math.min(minX, node.position.x);
|
|
175
|
-
minY = Math.min(minY, node.position.y);
|
|
176
|
-
maxX = Math.max(maxX, node.position.x + width);
|
|
177
|
-
maxY = Math.max(maxY, node.position.y + height);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// Origin of the group box (room for padding + the header banner at the top).
|
|
181
|
-
const groupX = minX - GROUP_PADDING_X;
|
|
182
|
-
const groupY = minY - GROUP_PADDING_Y - GROUP_HEADER_HEIGHT;
|
|
183
|
-
const groupWidth = maxX - minX + GROUP_PADDING_X * 2;
|
|
184
|
-
const groupHeight = maxY - minY + GROUP_PADDING_Y * 2 + GROUP_HEADER_HEIGHT;
|
|
185
|
-
|
|
135
|
+
const wrapNodesInSystemGroup = (systemNodes: any[], system: any) => {
|
|
186
136
|
const groupId = `system-group-${system.data.id}-${system.data.version}`;
|
|
187
137
|
|
|
188
138
|
const groupNode = {
|
|
189
139
|
id: groupId,
|
|
190
140
|
type: 'system-group',
|
|
191
|
-
position: { x:
|
|
141
|
+
position: { x: 0, y: 0 },
|
|
192
142
|
draggable: false,
|
|
193
143
|
selectable: false,
|
|
194
|
-
style: { width: groupWidth, height: groupHeight },
|
|
195
144
|
data: {
|
|
196
145
|
system: { name: system.data.name, version: system.data.version },
|
|
146
|
+
// The system is the resource being viewed on its own diagram
|
|
147
|
+
isFocused: true,
|
|
197
148
|
},
|
|
198
149
|
};
|
|
199
150
|
|
|
200
|
-
//
|
|
201
|
-
|
|
202
|
-
...node,
|
|
203
|
-
parentId: groupId,
|
|
204
|
-
extent: 'parent',
|
|
205
|
-
position: {
|
|
206
|
-
x: node.position.x - groupX,
|
|
207
|
-
y: node.position.y - groupY,
|
|
208
|
-
},
|
|
209
|
-
}));
|
|
210
|
-
|
|
211
|
-
// Parent must come before its children in the array for ReactFlow.
|
|
212
|
-
return [groupNode, ...childNodes];
|
|
151
|
+
// Parent must come before its children in the array for React Flow
|
|
152
|
+
return [groupNode, ...systemNodes.map((node) => ({ ...node, parentId: groupId, extent: 'parent' }))];
|
|
213
153
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Can't use the CollectionEntry type from astro:content because a client component is using this util
|
|
2
2
|
|
|
3
3
|
import { MarkerType, Position, type Edge, type Node } from '@xyflow/react';
|
|
4
|
-
import dagre from 'dagre';
|
|
5
4
|
import { getItemsFromCollectionByIdAndSemverOrLatest, versionMatches as versionMatchesUtil } from '@utils/collections/util';
|
|
6
5
|
import { buildUrl } from '@utils/url-builder';
|
|
7
6
|
|
|
@@ -91,52 +90,6 @@ export const getEdgeLabelForMessageAsSource = (data: MessageCollectionItem, thro
|
|
|
91
90
|
}
|
|
92
91
|
};
|
|
93
92
|
|
|
94
|
-
export const calculatedNodes = (flow: dagre.graphlib.Graph, nodes: Node[]) => {
|
|
95
|
-
return nodes.map((node: any) => {
|
|
96
|
-
const { x, y } = flow.node(node.id);
|
|
97
|
-
return { ...node, position: { x, y } };
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export const DEFAULT_NODE_WIDTH = 150;
|
|
102
|
-
export const DEFAULT_NODE_HEIGHT = 120;
|
|
103
|
-
|
|
104
|
-
// Creates a new dagre graph
|
|
105
|
-
export const createDagreGraph = ({ ranksep = 180, nodesep = 50, ...rest }: any) => {
|
|
106
|
-
const graph = new dagre.graphlib.Graph({ compound: true });
|
|
107
|
-
graph.setGraph({ rankdir: 'LR', ranksep, nodesep, ...rest });
|
|
108
|
-
graph.setDefaultEdgeLabel(() => ({}));
|
|
109
|
-
return graph;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* network-simplex produces the nicest layered layout but is O(V·E) and hangs on
|
|
114
|
-
* large architecture maps. tight-tree keeps the same LR layering with far less
|
|
115
|
-
* work. Callers can still force a ranker via createDagreGraph({ ranker }).
|
|
116
|
-
*/
|
|
117
|
-
export const LARGE_GRAPH_NODE_THRESHOLD = 80;
|
|
118
|
-
export const LARGE_GRAPH_EDGE_THRESHOLD = 200;
|
|
119
|
-
export const LARGE_GRAPH_RANKER = 'tight-tree';
|
|
120
|
-
|
|
121
|
-
export const selectDagreRanker = (nodeCount: number, edgeCount: number, explicitRanker?: string) => {
|
|
122
|
-
if (explicitRanker) return explicitRanker;
|
|
123
|
-
if (nodeCount >= LARGE_GRAPH_NODE_THRESHOLD || edgeCount >= LARGE_GRAPH_EDGE_THRESHOLD) {
|
|
124
|
-
return LARGE_GRAPH_RANKER;
|
|
125
|
-
}
|
|
126
|
-
return undefined;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export const layoutDagreGraph = (flow: dagre.graphlib.Graph) => {
|
|
130
|
-
const label = (flow.graph() || {}) as { ranker?: string };
|
|
131
|
-
const nodeCount = flow.nodeCount();
|
|
132
|
-
const edgeCount = flow.edgeCount();
|
|
133
|
-
const ranker = selectDagreRanker(nodeCount, edgeCount, label.ranker);
|
|
134
|
-
if (ranker && label.ranker !== ranker) {
|
|
135
|
-
flow.setGraph({ ...label, ranker });
|
|
136
|
-
}
|
|
137
|
-
dagre.layout(flow);
|
|
138
|
-
};
|
|
139
|
-
|
|
140
93
|
export const createEdge = (edgeOptions: Edge) => {
|
|
141
94
|
return {
|
|
142
95
|
label: 'subscribed by',
|
|
@@ -167,8 +120,6 @@ export const createNode = (values: Node): Node => {
|
|
|
167
120
|
};
|
|
168
121
|
};
|
|
169
122
|
|
|
170
|
-
type DagreGraph = any;
|
|
171
|
-
|
|
172
123
|
type ContextMenuItem = {
|
|
173
124
|
label: string;
|
|
174
125
|
href: string;
|
|
@@ -370,7 +321,7 @@ export const buildContextMenuForSystem = ({ id, version }: { id: string; version
|
|
|
370
321
|
return [
|
|
371
322
|
{ label: 'Read documentation', href: buildUrl(`/docs/systems/${id}/${version}`) },
|
|
372
323
|
{ label: 'Focus node', href: buildUrl(`/visualiser/systems/${id}/${version}`) },
|
|
373
|
-
{ label: 'View context', href: buildUrl(`/visualiser/systems/${id}/${version}
|
|
324
|
+
{ label: 'View context', href: buildUrl(`/visualiser/systems/${id}/${version}?level=1`) },
|
|
374
325
|
];
|
|
375
326
|
};
|
|
376
327
|
|
|
@@ -438,31 +389,3 @@ export const partitionMessagesByGroup = (
|
|
|
438
389
|
|
|
439
390
|
return { grouped, ungrouped };
|
|
440
391
|
};
|
|
441
|
-
|
|
442
|
-
export const getNodesAndEdgesFromDagre = ({
|
|
443
|
-
nodes,
|
|
444
|
-
edges,
|
|
445
|
-
defaultFlow,
|
|
446
|
-
}: {
|
|
447
|
-
nodes: Node[];
|
|
448
|
-
edges: Edge[];
|
|
449
|
-
defaultFlow?: DagreGraph;
|
|
450
|
-
}) => {
|
|
451
|
-
const flow = defaultFlow || createDagreGraph({ ranksep: 300, nodesep: 50 });
|
|
452
|
-
|
|
453
|
-
nodes.forEach((node: any) => {
|
|
454
|
-
flow.setNode(node.id, { width: DEFAULT_NODE_WIDTH, height: DEFAULT_NODE_HEIGHT });
|
|
455
|
-
});
|
|
456
|
-
|
|
457
|
-
edges.forEach((edge: any) => {
|
|
458
|
-
flow.setEdge(edge.source, edge.target);
|
|
459
|
-
});
|
|
460
|
-
|
|
461
|
-
// Render the diagram in memory getting the X and Y
|
|
462
|
-
layoutDagreGraph(flow);
|
|
463
|
-
|
|
464
|
-
return {
|
|
465
|
-
nodes: calculatedNodes(flow, nodes),
|
|
466
|
-
edges,
|
|
467
|
-
};
|
|
468
|
-
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const TRIAL_LENGTH_DAYS = 90;
|
|
2
|
+
|
|
3
|
+
export const LICENSE_FAQ_URL = 'https://www.eventcatalog.dev/license-faq';
|
|
4
|
+
|
|
5
|
+
// Where a commercial license is renewed
|
|
6
|
+
export const LICENSE_RENEW_URL = 'https://eventcatalog.cloud';
|
|
7
|
+
|
|
8
|
+
const DAY_IN_MS = 24 * 60 * 60 * 1000;
|
|
9
|
+
|
|
10
|
+
export type TrialStatus = {
|
|
11
|
+
daysLeft: number;
|
|
12
|
+
ended: boolean;
|
|
13
|
+
endsAt: Date;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The trial started at `tsd` (unix ms, written to eventcatalog.config.js when the catalog was
|
|
18
|
+
* created) and lasts TRIAL_LENGTH_DAYS. Undefined when there is no valid start date.
|
|
19
|
+
*/
|
|
20
|
+
export const getTrialStatus = (tsd: unknown, now = Date.now()): TrialStatus | undefined => {
|
|
21
|
+
if (typeof tsd !== 'number' || !Number.isFinite(tsd) || tsd <= 0) return;
|
|
22
|
+
const endsAt = tsd + TRIAL_LENGTH_DAYS * DAY_IN_MS;
|
|
23
|
+
const daysLeft = Math.max(0, Math.ceil((endsAt - now) / DAY_IN_MS));
|
|
24
|
+
return { daysLeft, ended: daysLeft === 0, endsAt: new Date(endsAt) };
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// A licensed catalog only shows its license in the dev header when it's about to expire
|
|
28
|
+
export const LICENSE_REMINDER_DAYS = 30;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Days left on the license, once fewer than LICENSE_REMINDER_DAYS remain. Undefined before then.
|
|
32
|
+
*/
|
|
33
|
+
export const getLicenseDaysLeft = (licensedUntil: Date, now = Date.now()): number | undefined => {
|
|
34
|
+
const daysLeft = Math.max(0, Math.ceil((licensedUntil.getTime() - now) / DAY_IN_MS));
|
|
35
|
+
return daysLeft < LICENSE_REMINDER_DAYS ? daysLeft : undefined;
|
|
36
|
+
};
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@types": ["src/types/index.ts"],
|
|
15
15
|
"@utils/*": ["src/utils/*"],
|
|
16
16
|
"@layouts/*": ["src/layouts/*"],
|
|
17
|
-
"@
|
|
17
|
+
"@features/*": ["src/features/*"],
|
|
18
18
|
"auth:config": ["./auth.config.ts"],
|
|
19
19
|
"@stores/*": ["src/stores/*"]
|
|
20
20
|
},
|
package/package.json
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/event-catalog/eventcatalog.git"
|
|
7
7
|
},
|
|
8
|
-
"license": "
|
|
8
|
+
"license": "BUSL-1.1",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "
|
|
10
|
+
"version": "5.0.0-beta.0",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"!eventcatalog/src/snippets/",
|
|
43
43
|
"!eventcatalog/src/generated-ai/",
|
|
44
44
|
"bin/",
|
|
45
|
-
"dist/"
|
|
45
|
+
"dist/",
|
|
46
|
+
"NOTICE"
|
|
46
47
|
],
|
|
47
48
|
"dependencies": {
|
|
48
49
|
"@ai-sdk/react": "^4.0.109",
|
|
@@ -55,13 +56,14 @@
|
|
|
55
56
|
"@asyncapi/parser": "^3.6.0",
|
|
56
57
|
"@asyncapi/react-component": "3.1.0",
|
|
57
58
|
"@auth/core": "^0.41.3",
|
|
58
|
-
"@eventcatalog/license": "^0.0.
|
|
59
|
+
"@eventcatalog/license": "^0.0.9",
|
|
59
60
|
"@fontsource/inter": "^5.2.5",
|
|
60
61
|
"@headlessui/react": "^2.0.3",
|
|
61
62
|
"@heroicons/react": "^2.1.3",
|
|
62
63
|
"@iconify-json/logos": "^1.2.4",
|
|
63
64
|
"@mermaid-js/layout-elk": "^0.2.0",
|
|
64
|
-
"@modelcontextprotocol/
|
|
65
|
+
"@modelcontextprotocol/ext-apps": "^1.7.5",
|
|
66
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
65
67
|
"@nanostores/react": "^1.0.0",
|
|
66
68
|
"@parcel/watcher": "^2.4.1",
|
|
67
69
|
"@radix-ui/react-context-menu": "^2.2.6",
|
|
@@ -85,7 +87,6 @@
|
|
|
85
87
|
"d3-force": "3.0.0",
|
|
86
88
|
"d3-selection": "3.0.0",
|
|
87
89
|
"d3-zoom": "3.0.0",
|
|
88
|
-
"dagre": "^0.8.5",
|
|
89
90
|
"diff": "^8.0.3",
|
|
90
91
|
"diff2html": "^3.4.56",
|
|
91
92
|
"dotenv": "^16.5.0",
|
|
@@ -133,9 +134,9 @@
|
|
|
133
134
|
"update-notifier": "^7.3.1",
|
|
134
135
|
"uuid": "^11.1.1",
|
|
135
136
|
"zod": "^4.3.6",
|
|
136
|
-
"@eventcatalog/linter": "1.
|
|
137
|
-
"@eventcatalog/
|
|
138
|
-
"@eventcatalog/
|
|
137
|
+
"@eventcatalog/linter": "1.2.0-beta.0",
|
|
138
|
+
"@eventcatalog/visualiser": "^5.0.0-beta.0",
|
|
139
|
+
"@eventcatalog/sdk": "2.30.0-beta.0"
|
|
139
140
|
},
|
|
140
141
|
"devDependencies": {
|
|
141
142
|
"@astrojs/check": "^0.9.10",
|
|
@@ -143,7 +144,6 @@
|
|
|
143
144
|
"@types/d3-force": "^3.0.10",
|
|
144
145
|
"@types/d3-selection": "^3.0.11",
|
|
145
146
|
"@types/d3-zoom": "^3.0.8",
|
|
146
|
-
"@types/dagre": "^0.7.52",
|
|
147
147
|
"@types/diff": "^5.2.2",
|
|
148
148
|
"@types/js-yaml": "^4.0.9",
|
|
149
149
|
"@types/jsonwebtoken": "^9.0.10",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
},
|
|
170
170
|
"scripts": {
|
|
171
171
|
"dev": "astro dev",
|
|
172
|
-
"build:bin": "tsup && node scripts/build-runtime-dependencies.mjs && node scripts/copy-docs-to-dist.mjs",
|
|
172
|
+
"build:bin": "tsup && node scripts/build-runtime-dependencies.mjs && node scripts/copy-docs-to-dist.mjs && node scripts/build-mcp-apps.mjs",
|
|
173
173
|
"test": "cross-env DISABLE_EVENTCATALOG_CACHE=true vitest",
|
|
174
174
|
"test:ci": "node scripts/ci/test.js",
|
|
175
175
|
"start": "astro dev",
|
package/dist/chunk-FV56YFM4.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/federation/entitlement.ts
|
|
21
|
-
var entitlement_exports = {};
|
|
22
|
-
__export(entitlement_exports, {
|
|
23
|
-
isFederationEnabled: () => isFederationEnabled
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(entitlement_exports);
|
|
26
|
-
var import_license = require("@eventcatalog/license");
|
|
27
|
-
var isFederationEnabled = () => (0, import_license.isEventCatalogEnterpriseEnabled)();
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
isFederationEnabled
|
|
31
|
-
});
|