@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,261 +0,0 @@
|
|
|
1
|
-
import { getCollection, type CollectionEntry } from 'astro:content';
|
|
2
|
-
import {
|
|
3
|
-
generateIdForNode,
|
|
4
|
-
createDagreGraph,
|
|
5
|
-
calculatedNodes,
|
|
6
|
-
createEdge,
|
|
7
|
-
getOperationFields,
|
|
8
|
-
layoutDagreGraph,
|
|
9
|
-
} from '@utils/node-graphs/utils/utils';
|
|
10
|
-
import { findInMap, createVersionedMap } from '@utils/collections/util';
|
|
11
|
-
import type { Node, Edge } from '@xyflow/react';
|
|
12
|
-
import { getDomains } from '@utils/collections/domains';
|
|
13
|
-
import type { CollectionMessageTypes } from '@types';
|
|
14
|
-
|
|
15
|
-
interface DomainCanvasData {
|
|
16
|
-
domainNodes: Node[];
|
|
17
|
-
messageNodes: Node[];
|
|
18
|
-
edges: Edge[];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const getDomainsCanvasData = async (): Promise<DomainCanvasData> => {
|
|
22
|
-
let domains = await getDomains({ getAllVersions: false });
|
|
23
|
-
|
|
24
|
-
// only interested in domains that are not parent domains (e.g domains that have subdoamins we dont want to display them here)
|
|
25
|
-
domains = domains.filter((domain) => !domain.data.domains?.length);
|
|
26
|
-
|
|
27
|
-
const domainNodes: Node[] = [];
|
|
28
|
-
const messageNodes: Node[] = [];
|
|
29
|
-
const edges: Edge[] = [];
|
|
30
|
-
|
|
31
|
-
// Create dagre graph for layout
|
|
32
|
-
const dagreGraph = createDagreGraph({ ranksep: 400, nodesep: 200 });
|
|
33
|
-
|
|
34
|
-
// Create a map to store domain data for calculating relationships
|
|
35
|
-
const domainDataMap = new Map();
|
|
36
|
-
|
|
37
|
-
for (let index = 0; index < domains.length; index++) {
|
|
38
|
-
const domain = domains[index];
|
|
39
|
-
const domainNodeId = generateIdForNode(domain);
|
|
40
|
-
const domainServices = domain.data.services as unknown as CollectionEntry<'services'>[];
|
|
41
|
-
|
|
42
|
-
// Count total messages for this domain
|
|
43
|
-
let totalMessages = 0;
|
|
44
|
-
for (const service of domainServices) {
|
|
45
|
-
const receives = service.data.receives ?? [];
|
|
46
|
-
const sends = service.data.sends ?? [];
|
|
47
|
-
totalMessages += receives.length + sends.length;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
domainDataMap.set(domainNodeId, {
|
|
51
|
-
domain,
|
|
52
|
-
services: domainServices,
|
|
53
|
-
servicesCount: domainServices.length,
|
|
54
|
-
messagesCount: totalMessages,
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// Domain Overview Node (position will be calculated by dagre)
|
|
58
|
-
domainNodes.push({
|
|
59
|
-
id: domainNodeId,
|
|
60
|
-
type: 'domains',
|
|
61
|
-
position: { x: 0, y: 0 }, // Temporary position, will be calculated by dagre
|
|
62
|
-
data: {
|
|
63
|
-
mode: 'full',
|
|
64
|
-
domain: {
|
|
65
|
-
...domain,
|
|
66
|
-
data: {
|
|
67
|
-
...domain.data,
|
|
68
|
-
services: domainServices,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
servicesCount: domainServices.length,
|
|
72
|
-
messagesCount: totalMessages,
|
|
73
|
-
},
|
|
74
|
-
sourcePosition: 'right',
|
|
75
|
-
targetPosition: 'left',
|
|
76
|
-
} as Node);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Get all messages for version resolution in parallel
|
|
80
|
-
const [events, commands, queries] = await Promise.all([
|
|
81
|
-
getCollection('events'),
|
|
82
|
-
getCollection('commands'),
|
|
83
|
-
getCollection('queries'),
|
|
84
|
-
]);
|
|
85
|
-
const allMessages = [...events, ...commands, ...queries];
|
|
86
|
-
const messageMap = createVersionedMap(allMessages);
|
|
87
|
-
|
|
88
|
-
// Map to track unique messages and their publishers/consumers across domains
|
|
89
|
-
const messageRelationships = new Map<
|
|
90
|
-
string,
|
|
91
|
-
{
|
|
92
|
-
message: any;
|
|
93
|
-
publishers: Array<{ domainId: string; service: any }>;
|
|
94
|
-
consumers: Array<{ domainId: string; service: any }>;
|
|
95
|
-
}
|
|
96
|
-
>();
|
|
97
|
-
|
|
98
|
-
// Find all message relationships across domains
|
|
99
|
-
domainDataMap.forEach((domainData, domainId) => {
|
|
100
|
-
domainData.services.forEach((service: any) => {
|
|
101
|
-
// Track messages this service sends
|
|
102
|
-
const sendsRaw = service.data.sends ?? [];
|
|
103
|
-
|
|
104
|
-
const sendsHydrated = sendsRaw
|
|
105
|
-
.map((message: any) => findInMap(messageMap, message.id, message.version))
|
|
106
|
-
.filter((e: any) => e !== undefined);
|
|
107
|
-
|
|
108
|
-
sendsHydrated.forEach((sentMessage: any) => {
|
|
109
|
-
const messageKey = `${sentMessage.data.id}-${sentMessage.data.version}`;
|
|
110
|
-
|
|
111
|
-
if (!messageRelationships.has(messageKey)) {
|
|
112
|
-
messageRelationships.set(messageKey, {
|
|
113
|
-
message: sentMessage.data,
|
|
114
|
-
publishers: [],
|
|
115
|
-
consumers: [],
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const relationship = messageRelationships.get(messageKey)!;
|
|
120
|
-
// Add publisher if not already added
|
|
121
|
-
if (!relationship.publishers.some((p) => p.domainId === domainId && p.service.data.id === service.data.id)) {
|
|
122
|
-
relationship.publishers.push({ domainId, service });
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
// Track messages this service receives
|
|
127
|
-
const receivesRaw = service.data.receives ?? [];
|
|
128
|
-
const receivesHydrated = receivesRaw
|
|
129
|
-
.map((message: any) => findInMap(messageMap, message.id, message.version))
|
|
130
|
-
.filter((e: any) => e !== undefined);
|
|
131
|
-
|
|
132
|
-
receivesHydrated.forEach((receivedMessage: any) => {
|
|
133
|
-
const messageKey = `${receivedMessage.data.id}-${receivedMessage.data.version}`;
|
|
134
|
-
|
|
135
|
-
if (!messageRelationships.has(messageKey)) {
|
|
136
|
-
messageRelationships.set(messageKey, {
|
|
137
|
-
message: receivedMessage.data,
|
|
138
|
-
publishers: [],
|
|
139
|
-
consumers: [],
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const relationship = messageRelationships.get(messageKey)!;
|
|
144
|
-
// Add consumer if not already added
|
|
145
|
-
if (!relationship.consumers.some((c) => c.domainId === domainId && c.service.data.id === service.data.id)) {
|
|
146
|
-
relationship.consumers.push({ domainId, service });
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
// Create message nodes and edges for cross-domain relationships
|
|
153
|
-
|
|
154
|
-
// Only create message nodes for messages that cross domain boundaries
|
|
155
|
-
messageRelationships.forEach(({ message, publishers, consumers }, messageKey) => {
|
|
156
|
-
// Check if this message crosses domain boundaries
|
|
157
|
-
const publisherDomains = new Set(publishers.map((p) => p.domainId));
|
|
158
|
-
const consumerDomains = new Set(consumers.map((c) => c.domainId));
|
|
159
|
-
|
|
160
|
-
// Only create a message node if it connects different domains
|
|
161
|
-
const crossesDomainBoundary = [...publisherDomains].some((pubDomain) =>
|
|
162
|
-
[...consumerDomains].some((conDomain) => pubDomain !== conDomain)
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
if (crossesDomainBoundary) {
|
|
166
|
-
// Find the actual message object
|
|
167
|
-
const messageObject = findInMap(messageMap, message.id, message.version) as CollectionEntry<CollectionMessageTypes>;
|
|
168
|
-
|
|
169
|
-
if (messageObject) {
|
|
170
|
-
const messageNodeId = `message-${messageKey}`;
|
|
171
|
-
|
|
172
|
-
// Create a single message node for this unique message
|
|
173
|
-
messageNodes.push({
|
|
174
|
-
id: messageNodeId,
|
|
175
|
-
type: messageObject.collection, // events, commands, or queries
|
|
176
|
-
position: { x: 0, y: 0 }, // Temporary position, will be calculated by dagre
|
|
177
|
-
data: {
|
|
178
|
-
mode: 'simple',
|
|
179
|
-
message: { ...messageObject.data, ...getOperationFields(messageObject.data) },
|
|
180
|
-
},
|
|
181
|
-
sourcePosition: 'right',
|
|
182
|
-
targetPosition: 'left',
|
|
183
|
-
} as Node);
|
|
184
|
-
|
|
185
|
-
// Create edges from all publishers to the message node
|
|
186
|
-
publishers.forEach(({ domainId, service }) => {
|
|
187
|
-
// Only create edge if there's a consumer in a different domain
|
|
188
|
-
const hasExternalConsumer = consumers.some((c) => c.domainId !== domainId);
|
|
189
|
-
|
|
190
|
-
if (hasExternalConsumer) {
|
|
191
|
-
edges.push(
|
|
192
|
-
createEdge({
|
|
193
|
-
id: `edge-${domainId}-${service.data.id}-${messageNodeId}`,
|
|
194
|
-
source: domainId,
|
|
195
|
-
sourceHandle: `${service.data.id}-source`,
|
|
196
|
-
target: messageNodeId,
|
|
197
|
-
type: 'animated',
|
|
198
|
-
animated: true,
|
|
199
|
-
label: 'publishes',
|
|
200
|
-
data: {
|
|
201
|
-
message: { ...messageObject.data },
|
|
202
|
-
type: 'domain-to-message',
|
|
203
|
-
publisherService: service,
|
|
204
|
-
},
|
|
205
|
-
})
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
// Create edges from the message node to all consumers
|
|
211
|
-
consumers.forEach(({ domainId, service }) => {
|
|
212
|
-
// Only create edge if there's a publisher in a different domain
|
|
213
|
-
const hasExternalPublisher = publishers.some((p) => p.domainId !== domainId);
|
|
214
|
-
|
|
215
|
-
if (hasExternalPublisher) {
|
|
216
|
-
edges.push(
|
|
217
|
-
createEdge({
|
|
218
|
-
id: `edge-${messageNodeId}-${domainId}-${service.data.id}`,
|
|
219
|
-
source: messageNodeId,
|
|
220
|
-
target: domainId,
|
|
221
|
-
targetHandle: `${service.data.id}-target`,
|
|
222
|
-
type: 'animated',
|
|
223
|
-
animated: true,
|
|
224
|
-
label: 'consumed by',
|
|
225
|
-
data: {
|
|
226
|
-
message: { ...messageObject.data },
|
|
227
|
-
type: 'message-to-domain',
|
|
228
|
-
consumerService: service,
|
|
229
|
-
},
|
|
230
|
-
})
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
// Add all nodes to dagre graph for layout calculation
|
|
239
|
-
const allNodes = [...domainNodes, ...messageNodes];
|
|
240
|
-
|
|
241
|
-
allNodes.forEach((node) => {
|
|
242
|
-
dagreGraph.setNode(node.id, { width: 250, height: 120 });
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
edges.forEach((edge) => {
|
|
246
|
-
dagreGraph.setEdge(edge.source, edge.target);
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
// Calculate layout using dagre
|
|
250
|
-
layoutDagreGraph(dagreGraph);
|
|
251
|
-
|
|
252
|
-
// Apply calculated positions to nodes
|
|
253
|
-
const layoutedDomainNodes = calculatedNodes(dagreGraph, domainNodes);
|
|
254
|
-
const layoutedMessageNodes = calculatedNodes(dagreGraph, messageNodes);
|
|
255
|
-
|
|
256
|
-
return {
|
|
257
|
-
domainNodes: layoutedDomainNodes,
|
|
258
|
-
messageNodes: layoutedMessageNodes,
|
|
259
|
-
edges,
|
|
260
|
-
};
|
|
261
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { ReactFlowInstance, Node, ReactFlowJsonObject, Edge } from '@xyflow/react';
|
|
2
|
-
|
|
3
|
-
// Define the structure of resource data that can be found in nodes
|
|
4
|
-
interface ResourceData {
|
|
5
|
-
id?: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
summary?: string;
|
|
8
|
-
version?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// Define the possible node data structure
|
|
12
|
-
interface NodeDataWithResources {
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
channel?: ResourceData;
|
|
15
|
-
custom?: ResourceData;
|
|
16
|
-
data?: ResourceData;
|
|
17
|
-
domain?: ResourceData;
|
|
18
|
-
entity?: ResourceData;
|
|
19
|
-
message?: ResourceData;
|
|
20
|
-
flow?: ResourceData;
|
|
21
|
-
agent?: ResourceData;
|
|
22
|
-
agentTool?: ResourceData;
|
|
23
|
-
service?: ResourceData;
|
|
24
|
-
step?: ResourceData;
|
|
25
|
-
user?: ResourceData;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const exportNodeGraphForStudio = (data: ReactFlowJsonObject) => {
|
|
29
|
-
const dataTypes: (keyof NodeDataWithResources)[] = [
|
|
30
|
-
'channel',
|
|
31
|
-
'custom',
|
|
32
|
-
'data',
|
|
33
|
-
'domain',
|
|
34
|
-
'entity',
|
|
35
|
-
'message',
|
|
36
|
-
'flow',
|
|
37
|
-
'agent',
|
|
38
|
-
'agentTool',
|
|
39
|
-
'service',
|
|
40
|
-
'step',
|
|
41
|
-
'user',
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
// try and remove unwanted data for studio
|
|
45
|
-
const nodes = data.nodes.map((node: Node) => {
|
|
46
|
-
let nodeData = node.data as NodeDataWithResources;
|
|
47
|
-
const dataProperties = Object.keys(nodeData) as (keyof NodeDataWithResources)[];
|
|
48
|
-
|
|
49
|
-
// If we find a match.....
|
|
50
|
-
const hasCustomDataType = dataProperties.find((property) => dataTypes.includes(property));
|
|
51
|
-
|
|
52
|
-
if (hasCustomDataType && nodeData[hasCustomDataType]) {
|
|
53
|
-
const resourceData = nodeData[hasCustomDataType] as ResourceData;
|
|
54
|
-
nodeData = {
|
|
55
|
-
...nodeData,
|
|
56
|
-
[hasCustomDataType]: {
|
|
57
|
-
id: resourceData?.id,
|
|
58
|
-
name: resourceData?.name,
|
|
59
|
-
summary: resourceData?.summary,
|
|
60
|
-
version: resourceData?.version,
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return {
|
|
66
|
-
...node,
|
|
67
|
-
data: {
|
|
68
|
-
...nodeData,
|
|
69
|
-
// We dont need these for studio
|
|
70
|
-
source: undefined,
|
|
71
|
-
target: undefined,
|
|
72
|
-
// Studio wants all nodes in full mode
|
|
73
|
-
mode: 'full',
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
const edges = data.edges.map((edge: Edge) => {
|
|
79
|
-
return {
|
|
80
|
-
...edge,
|
|
81
|
-
data: undefined,
|
|
82
|
-
type: 'animatedMessage',
|
|
83
|
-
};
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
return {
|
|
87
|
-
...data,
|
|
88
|
-
nodes,
|
|
89
|
-
edges,
|
|
90
|
-
};
|
|
91
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|