@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { parseSchemaForViewer } from '@components/SchemaExplorer/parse-schema';
|
|
2
|
+
import { getLanguageForHighlight } from '@components/SchemaExplorer/utils';
|
|
3
|
+
import { getSchemaExtensionForFormat } from '@utils/collections/schemas';
|
|
4
|
+
import type { SchemaViewerSchema } from './apps/schema-viewer/shared';
|
|
5
|
+
|
|
6
|
+
type SchemaToolResult = { name?: string; format?: string; url?: string; code: string };
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The schemas returned by getSchemaForResource, ready for the schema viewer: parsed for its Properties tab
|
|
10
|
+
* and with the language to highlight them in, the same way EventCatalog's schema pages do.
|
|
11
|
+
*/
|
|
12
|
+
export const toSchemaViewerSchemas = (schemas: SchemaToolResult[]): SchemaViewerSchema[] =>
|
|
13
|
+
schemas.map((schema) => {
|
|
14
|
+
// Schemas in the schemas collection have a format (jsonschema, avro, protobuf), others a file extension
|
|
15
|
+
const format = schema.format ?? schema.url?.split('.').pop() ?? '';
|
|
16
|
+
const extension = getSchemaExtensionForFormat(format);
|
|
17
|
+
return {
|
|
18
|
+
...parseSchemaForViewer(extension, schema.code),
|
|
19
|
+
...(schemas.length > 1 && { name: schema.name ?? schema.url?.split('/').pop() ?? format }),
|
|
20
|
+
format,
|
|
21
|
+
language: getLanguageForHighlight(extension),
|
|
22
|
+
code: schema.code,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
@@ -1,40 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Licensed under the EventCatalog Commercial License.
|
|
3
|
-
* See /packages/core/eventcatalog/src/enterprise/LICENSE
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* Shared catalog tools for accessing EventCatalog resources.
|
|
8
3
|
* Used by both the AI Chat feature and MCP Server.
|
|
9
4
|
*/
|
|
10
|
-
import { getCollection
|
|
5
|
+
import { getCollection } from 'astro:content';
|
|
11
6
|
import { z } from 'zod';
|
|
12
7
|
import { getSchemasFromResource, getSchemaFormatFromURL } from '@utils/collections/schemas';
|
|
13
8
|
import { getItemsFromCollectionByIdAndSemverOrLatest } from '@utils/collections/util';
|
|
14
9
|
import { getUbiquitousLanguageWithSubdomains } from '@utils/collections/domains';
|
|
15
10
|
import { getAbsoluteFilePathForAstroFile } from '@utils/files';
|
|
16
11
|
import fs from 'node:fs';
|
|
17
|
-
import {
|
|
18
|
-
import { getNodesAndEdges as getNodesAndEdgesForAgent } from '@utils/node-graphs/agents-node-graph';
|
|
12
|
+
import { getArchitectureDiagramGraph } from '@utils/node-graphs/architecture-diagram';
|
|
19
13
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} from '@utils/node-graphs/
|
|
24
|
-
import { getNodesAndEdges as getNodesAndEdgesForDomain } from '@utils/node-graphs/domains-node-graph';
|
|
25
|
-
import { getNodesAndEdges as getNodesAndEdgesForFlows } from '@utils/node-graphs/flows-node-graph';
|
|
26
|
-
import { getNodesAndEdges as getNodesAndEdgesForDataProduct } from '@utils/node-graphs/data-products-node-graph';
|
|
27
|
-
import { getNodesAndEdges as getNodesAndEdgesForContainer } from '@utils/node-graphs/container-node-graph';
|
|
28
|
-
import { getNodesAndEdges as getNodesAndEdgesForSystem } from '@utils/node-graphs/systems-node-graph';
|
|
14
|
+
ARCHITECTURE_DIAGRAM_COLLECTIONS,
|
|
15
|
+
isArchitectureDiagramCollection,
|
|
16
|
+
type ArchitectureDiagramDetail,
|
|
17
|
+
} from '@utils/node-graphs/architecture-diagram-types';
|
|
29
18
|
import { convertToMermaid } from '@utils/node-graphs/export-mermaid';
|
|
30
|
-
import config from '@config';
|
|
31
19
|
import { glob } from 'glob';
|
|
32
20
|
import path from 'node:path';
|
|
33
21
|
import {
|
|
34
22
|
buildDocsSearchIndex,
|
|
35
23
|
chunkMarkdownByHeadings,
|
|
36
24
|
type DocsSearchIndex,
|
|
37
|
-
} from '@
|
|
25
|
+
} from '@features/custom-documentation/utils/docs-search';
|
|
38
26
|
|
|
39
27
|
const MESSAGE_COLLECTIONS = new Set(['events', 'commands', 'queries']);
|
|
40
28
|
const LIKEC4_SOURCE_PATTERN = '**/*.{c4,likec4}';
|
|
@@ -209,34 +197,35 @@ export const resourceCollectionSchema = z.enum([
|
|
|
209
197
|
'data-products',
|
|
210
198
|
]);
|
|
211
199
|
|
|
212
|
-
export const visualiserCollectionSchema = z.enum(
|
|
213
|
-
'events',
|
|
214
|
-
'commands',
|
|
215
|
-
'queries',
|
|
216
|
-
'agents',
|
|
217
|
-
'services',
|
|
218
|
-
'domains',
|
|
219
|
-
'systems',
|
|
220
|
-
'flows',
|
|
221
|
-
'containers',
|
|
222
|
-
'data-products',
|
|
223
|
-
]);
|
|
200
|
+
export const visualiserCollectionSchema = z.enum(ARCHITECTURE_DIAGRAM_COLLECTIONS);
|
|
224
201
|
|
|
225
202
|
// ============================================
|
|
226
203
|
// Tool implementations (core logic)
|
|
227
204
|
// ============================================
|
|
228
205
|
|
|
206
|
+
/**
|
|
207
|
+
* Find a catalog entry by id and version. When no version (or 'latest') is given, the latest version is returned.
|
|
208
|
+
*/
|
|
209
|
+
async function findEntry(collection: string, id: string, version?: string): Promise<any | undefined> {
|
|
210
|
+
const entries = await getCollection(collection as any);
|
|
211
|
+
return getItemsFromCollectionByIdAndSemverOrLatest(entries as any[], id, version)[0];
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const describeVersion = (version?: string) => version ?? 'latest';
|
|
215
|
+
|
|
229
216
|
/**
|
|
230
217
|
* Get resources from a collection with optional pagination and search
|
|
231
218
|
*/
|
|
232
219
|
export async function getResources(params: { collection: string; cursor?: string; search?: string }) {
|
|
233
220
|
const resources = await getCollection(params.collection as any);
|
|
234
|
-
let allResults = resources
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
221
|
+
let allResults = resources
|
|
222
|
+
.filter((resource: any) => resource.data.hidden !== true)
|
|
223
|
+
.map((resource: any) => ({
|
|
224
|
+
id: resource.data.id,
|
|
225
|
+
version: resource.data.version,
|
|
226
|
+
name: resource.data.name,
|
|
227
|
+
summary: resource.data.summary,
|
|
228
|
+
}));
|
|
240
229
|
|
|
241
230
|
// Apply search filter if provided
|
|
242
231
|
if (params.search) {
|
|
@@ -263,46 +252,90 @@ export async function getResources(params: { collection: string; cursor?: string
|
|
|
263
252
|
}
|
|
264
253
|
|
|
265
254
|
/**
|
|
266
|
-
* Get a specific resource by id and version
|
|
255
|
+
* Get a specific resource by id and version (defaults to the latest version).
|
|
256
|
+
* Returns the frontmatter and markdown body only, not internal Astro entry fields such as file paths.
|
|
267
257
|
*/
|
|
268
|
-
export async function getResource(params: { collection: string; id: string; version
|
|
269
|
-
const resource = await
|
|
258
|
+
export async function getResource(params: { collection: string; id: string; version?: string }) {
|
|
259
|
+
const resource = await findEntry(params.collection, params.id, params.version);
|
|
270
260
|
|
|
271
261
|
if (!resource) {
|
|
272
|
-
return { error: `Resource not found: ${params.id}
|
|
262
|
+
return { error: `Resource not found: ${params.id} (${describeVersion(params.version)}) in ${params.collection}` };
|
|
273
263
|
}
|
|
274
264
|
|
|
275
|
-
return
|
|
265
|
+
return {
|
|
266
|
+
id: resource.data.id,
|
|
267
|
+
version: resource.data.version,
|
|
268
|
+
collection: params.collection,
|
|
269
|
+
data: resource.data,
|
|
270
|
+
body: resource.body,
|
|
271
|
+
};
|
|
276
272
|
}
|
|
277
273
|
|
|
274
|
+
type MessagePointer = { id: string; version?: string };
|
|
275
|
+
|
|
278
276
|
/**
|
|
279
|
-
*
|
|
277
|
+
* Resolve a sends/receives pointer to the documented message it points at
|
|
278
|
+
*/
|
|
279
|
+
const resolveMessagePointer = (messages: any[], pointer: MessagePointer) => {
|
|
280
|
+
const message = getItemsFromCollectionByIdAndSemverOrLatest(messages, pointer.id, pointer.version)[0];
|
|
281
|
+
|
|
282
|
+
if (!message) {
|
|
283
|
+
return { id: pointer.id, version: describeVersion(pointer.version), notFound: true };
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return {
|
|
287
|
+
id: message.data.id,
|
|
288
|
+
version: message.data.version,
|
|
289
|
+
name: message.data.name || message.data.id,
|
|
290
|
+
summary: message.data.summary,
|
|
291
|
+
collection: message.collection,
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Get the messages (events, commands, queries) a resource sends and receives, resolved to their catalog entries
|
|
280
297
|
*/
|
|
281
298
|
export async function getMessagesProducedOrConsumedByResource(params: {
|
|
282
299
|
resourceId: string;
|
|
283
|
-
resourceVersion
|
|
300
|
+
resourceVersion?: string;
|
|
284
301
|
resourceCollection: string;
|
|
285
302
|
}) {
|
|
286
|
-
const resource = await
|
|
303
|
+
const resource = await findEntry(params.resourceCollection, params.resourceId, params.resourceVersion);
|
|
287
304
|
|
|
288
305
|
if (!resource) {
|
|
289
306
|
return {
|
|
290
|
-
error: `Resource not found with id ${params.resourceId} and version ${params.resourceVersion} and collection ${params.resourceCollection}`,
|
|
307
|
+
error: `Resource not found with id ${params.resourceId} and version ${describeVersion(params.resourceVersion)} and collection ${params.resourceCollection}`,
|
|
291
308
|
};
|
|
292
309
|
}
|
|
293
310
|
|
|
294
|
-
|
|
311
|
+
const [events, commands, queries] = await Promise.all([
|
|
312
|
+
getCollection('events'),
|
|
313
|
+
getCollection('commands'),
|
|
314
|
+
getCollection('queries'),
|
|
315
|
+
]);
|
|
316
|
+
const messages = [...events, ...commands, ...queries];
|
|
317
|
+
|
|
318
|
+
return {
|
|
319
|
+
resource: {
|
|
320
|
+
id: resource.data.id,
|
|
321
|
+
version: resource.data.version,
|
|
322
|
+
name: resource.data.name || resource.data.id,
|
|
323
|
+
collection: params.resourceCollection,
|
|
324
|
+
},
|
|
325
|
+
sends: (resource.data.sends || []).map((pointer: MessagePointer) => resolveMessagePointer(messages, pointer)),
|
|
326
|
+
receives: (resource.data.receives || []).map((pointer: MessagePointer) => resolveMessagePointer(messages, pointer)),
|
|
327
|
+
};
|
|
295
328
|
}
|
|
296
329
|
|
|
297
330
|
/**
|
|
298
331
|
* Get schema or specifications for a resource
|
|
299
332
|
*/
|
|
300
|
-
export async function getSchemaForResource(params: { resourceId: string; resourceVersion
|
|
301
|
-
const resource = await
|
|
333
|
+
export async function getSchemaForResource(params: { resourceId: string; resourceVersion?: string; resourceCollection: string }) {
|
|
334
|
+
const resource = await findEntry(params.resourceCollection, params.resourceId, params.resourceVersion);
|
|
302
335
|
|
|
303
336
|
if (!resource) {
|
|
304
337
|
return {
|
|
305
|
-
error: `Resource not found with id ${params.resourceId} and version ${params.resourceVersion} and collection ${params.resourceCollection}`,
|
|
338
|
+
error: `Resource not found with id ${params.resourceId} and version ${describeVersion(params.resourceVersion)} and collection ${params.resourceCollection}`,
|
|
306
339
|
};
|
|
307
340
|
}
|
|
308
341
|
|
|
@@ -312,7 +345,7 @@ export async function getSchemaForResource(params: { resourceId: string; resourc
|
|
|
312
345
|
(schema) =>
|
|
313
346
|
schema.data.message.collectionName === params.resourceCollection &&
|
|
314
347
|
schema.data.message.id === params.resourceId &&
|
|
315
|
-
schema.data.message.version ===
|
|
348
|
+
schema.data.message.version === resource.data.version
|
|
316
349
|
);
|
|
317
350
|
|
|
318
351
|
if (schemas.length > 0) {
|
|
@@ -390,30 +423,31 @@ export async function findResourcesByOwner(params: { ownerId: string }) {
|
|
|
390
423
|
/**
|
|
391
424
|
* Get resources that produce (send) a specific message
|
|
392
425
|
*/
|
|
393
|
-
export async function getProducersOfMessage(params: { messageId: string; messageVersion
|
|
426
|
+
export async function getProducersOfMessage(params: { messageId: string; messageVersion?: string; messageCollection: string }) {
|
|
394
427
|
const [services, agents] = await Promise.all([getCollection('services'), getCollection('agents')]);
|
|
395
428
|
const routableResources = [...services, ...agents];
|
|
396
|
-
const message = await
|
|
429
|
+
const message = await findEntry(params.messageCollection, params.messageId, params.messageVersion);
|
|
397
430
|
|
|
398
431
|
if (!message) {
|
|
399
432
|
return {
|
|
400
|
-
error: `Message not found: ${params.messageId}
|
|
433
|
+
error: `Message not found: ${params.messageId} (${describeVersion(params.messageVersion)}) in ${params.messageCollection}`,
|
|
401
434
|
};
|
|
402
435
|
}
|
|
436
|
+
const messageVersion = message.data.version;
|
|
403
437
|
|
|
404
438
|
const producers = routableResources.filter((resource) => {
|
|
405
439
|
const sends = (resource.data as any).sends || [];
|
|
406
440
|
return sends.some((send: any) => {
|
|
407
441
|
const idMatch = send.id === params.messageId;
|
|
408
442
|
if (!send.version || send.version === 'latest') return idMatch;
|
|
409
|
-
return idMatch && send.version ===
|
|
443
|
+
return idMatch && send.version === messageVersion;
|
|
410
444
|
});
|
|
411
445
|
});
|
|
412
446
|
|
|
413
447
|
return {
|
|
414
448
|
message: {
|
|
415
449
|
id: params.messageId,
|
|
416
|
-
version:
|
|
450
|
+
version: messageVersion,
|
|
417
451
|
collection: params.messageCollection,
|
|
418
452
|
},
|
|
419
453
|
producers: producers.map((s) => ({
|
|
@@ -469,30 +503,31 @@ export async function getC4Diagram(params: { viewId?: string }) {
|
|
|
469
503
|
/**
|
|
470
504
|
* Get resources that consume (receive) a specific message
|
|
471
505
|
*/
|
|
472
|
-
export async function getConsumersOfMessage(params: { messageId: string; messageVersion
|
|
506
|
+
export async function getConsumersOfMessage(params: { messageId: string; messageVersion?: string; messageCollection: string }) {
|
|
473
507
|
const [services, agents] = await Promise.all([getCollection('services'), getCollection('agents')]);
|
|
474
508
|
const routableResources = [...services, ...agents];
|
|
475
|
-
const message = await
|
|
509
|
+
const message = await findEntry(params.messageCollection, params.messageId, params.messageVersion);
|
|
476
510
|
|
|
477
511
|
if (!message) {
|
|
478
512
|
return {
|
|
479
|
-
error: `Message not found: ${params.messageId}
|
|
513
|
+
error: `Message not found: ${params.messageId} (${describeVersion(params.messageVersion)}) in ${params.messageCollection}`,
|
|
480
514
|
};
|
|
481
515
|
}
|
|
516
|
+
const messageVersion = message.data.version;
|
|
482
517
|
|
|
483
518
|
const consumers = routableResources.filter((resource) => {
|
|
484
519
|
const receives = (resource.data as any).receives || [];
|
|
485
520
|
return receives.some((receive: any) => {
|
|
486
521
|
const idMatch = receive.id === params.messageId;
|
|
487
522
|
if (!receive.version || receive.version === 'latest') return idMatch;
|
|
488
|
-
return idMatch && receive.version ===
|
|
523
|
+
return idMatch && receive.version === messageVersion;
|
|
489
524
|
});
|
|
490
525
|
});
|
|
491
526
|
|
|
492
527
|
return {
|
|
493
528
|
message: {
|
|
494
529
|
id: params.messageId,
|
|
495
|
-
version:
|
|
530
|
+
version: messageVersion,
|
|
496
531
|
collection: params.messageCollection,
|
|
497
532
|
},
|
|
498
533
|
consumers: consumers.map((s) => ({
|
|
@@ -509,16 +544,17 @@ export async function getConsumersOfMessage(params: { messageId: string; message
|
|
|
509
544
|
* Analyze the impact of changing a message (event, command, query)
|
|
510
545
|
* Returns all affected services (producers and consumers) and their owners
|
|
511
546
|
*/
|
|
512
|
-
export async function analyzeChangeImpact(params: { messageId: string; messageVersion
|
|
547
|
+
export async function analyzeChangeImpact(params: { messageId: string; messageVersion?: string; messageCollection: string }) {
|
|
513
548
|
const [services, agents] = await Promise.all([getCollection('services'), getCollection('agents')]);
|
|
514
549
|
const routableResources = [...services, ...agents];
|
|
515
|
-
const message = await
|
|
550
|
+
const message = await findEntry(params.messageCollection, params.messageId, params.messageVersion);
|
|
516
551
|
|
|
517
552
|
if (!message) {
|
|
518
553
|
return {
|
|
519
|
-
error: `Message not found: ${params.messageId}
|
|
554
|
+
error: `Message not found: ${params.messageId} (${describeVersion(params.messageVersion)}) in ${params.messageCollection}`,
|
|
520
555
|
};
|
|
521
556
|
}
|
|
557
|
+
const messageVersion = message.data.version;
|
|
522
558
|
|
|
523
559
|
// Find producers
|
|
524
560
|
const producers = routableResources.filter((resource) => {
|
|
@@ -552,7 +588,7 @@ export async function analyzeChangeImpact(params: { messageId: string; messageVe
|
|
|
552
588
|
return {
|
|
553
589
|
message: {
|
|
554
590
|
id: params.messageId,
|
|
555
|
-
version:
|
|
591
|
+
version: messageVersion,
|
|
556
592
|
collection: params.messageCollection,
|
|
557
593
|
name: (message.data as any).name || params.messageId,
|
|
558
594
|
},
|
|
@@ -589,11 +625,11 @@ export async function analyzeChangeImpact(params: { messageId: string; messageVe
|
|
|
589
625
|
* Get detailed information about a flow (state machine / business process)
|
|
590
626
|
* Returns the flow with its steps, description, and related services
|
|
591
627
|
*/
|
|
592
|
-
export async function explainBusinessFlow(params: { flowId: string; flowVersion
|
|
593
|
-
const flow = await
|
|
628
|
+
export async function explainBusinessFlow(params: { flowId: string; flowVersion?: string }) {
|
|
629
|
+
const flow = await findEntry('flows', params.flowId, params.flowVersion);
|
|
594
630
|
|
|
595
631
|
if (!flow) {
|
|
596
|
-
return { error: `Flow not found: ${params.flowId}
|
|
632
|
+
return { error: `Flow not found: ${params.flowId} (${describeVersion(params.flowVersion)})` };
|
|
597
633
|
}
|
|
598
634
|
|
|
599
635
|
// Get related services and agents that use this flow
|
|
@@ -881,12 +917,12 @@ export async function explainUbiquitousLanguageTerms(params: { domainId: string;
|
|
|
881
917
|
* Get the inputs (resources consumed) for a data product
|
|
882
918
|
* Returns fully hydrated input resources
|
|
883
919
|
*/
|
|
884
|
-
export async function getDataProductInputs(params: { dataProductId: string; dataProductVersion
|
|
885
|
-
const dataProduct = await
|
|
920
|
+
export async function getDataProductInputs(params: { dataProductId: string; dataProductVersion?: string }) {
|
|
921
|
+
const dataProduct = await findEntry('data-products', params.dataProductId, params.dataProductVersion);
|
|
886
922
|
|
|
887
923
|
if (!dataProduct) {
|
|
888
924
|
return {
|
|
889
|
-
error: `Data product not found: ${params.dataProductId}
|
|
925
|
+
error: `Data product not found: ${params.dataProductId} (${describeVersion(params.dataProductVersion)})`,
|
|
890
926
|
};
|
|
891
927
|
}
|
|
892
928
|
|
|
@@ -895,7 +931,7 @@ export async function getDataProductInputs(params: { dataProductId: string; data
|
|
|
895
931
|
if (inputPointers.length === 0) {
|
|
896
932
|
return {
|
|
897
933
|
dataProductId: params.dataProductId,
|
|
898
|
-
dataProductVersion:
|
|
934
|
+
dataProductVersion: dataProduct.data.version,
|
|
899
935
|
message: 'No inputs found for this data product',
|
|
900
936
|
inputs: [],
|
|
901
937
|
};
|
|
@@ -932,7 +968,7 @@ export async function getDataProductInputs(params: { dataProductId: string; data
|
|
|
932
968
|
|
|
933
969
|
return {
|
|
934
970
|
dataProductId: params.dataProductId,
|
|
935
|
-
dataProductVersion:
|
|
971
|
+
dataProductVersion: dataProduct.data.version,
|
|
936
972
|
dataProductName: (dataProduct.data as any).name || params.dataProductId,
|
|
937
973
|
inputs: hydratedInputs,
|
|
938
974
|
totalCount: hydratedInputs.length,
|
|
@@ -943,12 +979,12 @@ export async function getDataProductInputs(params: { dataProductId: string; data
|
|
|
943
979
|
* Get the outputs (resources produced) for a data product
|
|
944
980
|
* Returns fully hydrated output resources with their contracts
|
|
945
981
|
*/
|
|
946
|
-
export async function getDataProductOutputs(params: { dataProductId: string; dataProductVersion
|
|
947
|
-
const dataProduct = await
|
|
982
|
+
export async function getDataProductOutputs(params: { dataProductId: string; dataProductVersion?: string }) {
|
|
983
|
+
const dataProduct = await findEntry('data-products', params.dataProductId, params.dataProductVersion);
|
|
948
984
|
|
|
949
985
|
if (!dataProduct) {
|
|
950
986
|
return {
|
|
951
|
-
error: `Data product not found: ${params.dataProductId}
|
|
987
|
+
error: `Data product not found: ${params.dataProductId} (${describeVersion(params.dataProductVersion)})`,
|
|
952
988
|
};
|
|
953
989
|
}
|
|
954
990
|
|
|
@@ -957,7 +993,7 @@ export async function getDataProductOutputs(params: { dataProductId: string; dat
|
|
|
957
993
|
if (outputPointers.length === 0) {
|
|
958
994
|
return {
|
|
959
995
|
dataProductId: params.dataProductId,
|
|
960
|
-
dataProductVersion:
|
|
996
|
+
dataProductVersion: dataProduct.data.version,
|
|
961
997
|
message: 'No outputs found for this data product',
|
|
962
998
|
outputs: [],
|
|
963
999
|
};
|
|
@@ -1016,7 +1052,7 @@ export async function getDataProductOutputs(params: { dataProductId: string; dat
|
|
|
1016
1052
|
|
|
1017
1053
|
return {
|
|
1018
1054
|
dataProductId: params.dataProductId,
|
|
1019
|
-
dataProductVersion:
|
|
1055
|
+
dataProductVersion: dataProduct.data.version,
|
|
1020
1056
|
dataProductName: (dataProduct.data as any).name || params.dataProductId,
|
|
1021
1057
|
outputs: hydratedOutputs,
|
|
1022
1058
|
totalCount: hydratedOutputs.length,
|
|
@@ -1027,44 +1063,37 @@ export async function getDataProductOutputs(params: { dataProductId: string; dat
|
|
|
1027
1063
|
// Architecture Diagram (Mermaid) tools
|
|
1028
1064
|
// ============================================
|
|
1029
1065
|
|
|
1030
|
-
const getNodesAndEdgesFunctions = {
|
|
1031
|
-
agents: getNodesAndEdgesForAgent,
|
|
1032
|
-
services: getNodesAndEdgesForService,
|
|
1033
|
-
events: getNodesAndEdgesForEvents,
|
|
1034
|
-
commands: getNodesAndEdgesForCommands,
|
|
1035
|
-
queries: getNodesAndEdgesForQueries,
|
|
1036
|
-
domains: getNodesAndEdgesForDomain,
|
|
1037
|
-
flows: getNodesAndEdgesForFlows,
|
|
1038
|
-
containers: getNodesAndEdgesForContainer,
|
|
1039
|
-
'data-products': getNodesAndEdgesForDataProduct,
|
|
1040
|
-
systems: getNodesAndEdgesForSystem,
|
|
1041
|
-
};
|
|
1042
|
-
|
|
1043
1066
|
/**
|
|
1044
1067
|
* Get the architecture diagram for a resource as Mermaid code
|
|
1045
1068
|
* Returns flowchart syntax that can be rendered or used for understanding architecture
|
|
1046
1069
|
*/
|
|
1047
1070
|
export async function getArchitectureDiagramAsMermaid(params: {
|
|
1048
1071
|
resourceId: string;
|
|
1049
|
-
resourceVersion
|
|
1072
|
+
resourceVersion?: string;
|
|
1050
1073
|
resourceCollection: string;
|
|
1074
|
+
detail?: ArchitectureDiagramDetail;
|
|
1051
1075
|
}) {
|
|
1052
|
-
const { resourceId,
|
|
1076
|
+
const { resourceId, resourceCollection, detail = 'full' } = params;
|
|
1053
1077
|
|
|
1054
1078
|
// Validate the collection is supported for visualisation
|
|
1055
|
-
if (!(resourceCollection
|
|
1079
|
+
if (!isArchitectureDiagramCollection(resourceCollection)) {
|
|
1056
1080
|
return {
|
|
1057
|
-
error: `Collection '${resourceCollection}' does not support architecture diagrams. Supported collections: ${
|
|
1081
|
+
error: `Collection '${resourceCollection}' does not support architecture diagrams. Supported collections: ${ARCHITECTURE_DIAGRAM_COLLECTIONS.join(', ')}`,
|
|
1058
1082
|
};
|
|
1059
1083
|
}
|
|
1060
1084
|
|
|
1085
|
+
const resource = await findEntry(resourceCollection, resourceId, params.resourceVersion);
|
|
1086
|
+
if (!resource) {
|
|
1087
|
+
return { error: `Resource not found: ${resourceId} (${describeVersion(params.resourceVersion)}) in ${resourceCollection}` };
|
|
1088
|
+
}
|
|
1089
|
+
const resourceVersion: string = resource.data.version;
|
|
1090
|
+
|
|
1061
1091
|
try {
|
|
1062
|
-
|
|
1063
|
-
|
|
1092
|
+
const { nodes, edges } = await getArchitectureDiagramGraph({
|
|
1093
|
+
collection: resourceCollection,
|
|
1064
1094
|
id: resourceId,
|
|
1065
1095
|
version: resourceVersion,
|
|
1066
|
-
|
|
1067
|
-
channelRenderMode: config.visualiser?.channels?.renderMode === 'single' ? 'single' : 'flat',
|
|
1096
|
+
detail,
|
|
1068
1097
|
});
|
|
1069
1098
|
|
|
1070
1099
|
if (!nodes || nodes.length === 0) {
|
|
@@ -1083,6 +1112,7 @@ export async function getArchitectureDiagramAsMermaid(params: {
|
|
|
1083
1112
|
resourceId,
|
|
1084
1113
|
resourceVersion,
|
|
1085
1114
|
resourceCollection,
|
|
1115
|
+
detail,
|
|
1086
1116
|
mermaidCode,
|
|
1087
1117
|
nodeCount: nodes.length,
|
|
1088
1118
|
edgeCount: edges.length,
|
|
@@ -1229,9 +1259,10 @@ export async function getCustomDoc(params: { id: string; section?: string }) {
|
|
|
1229
1259
|
export const toolDescriptions = {
|
|
1230
1260
|
getResources:
|
|
1231
1261
|
'Use this tool to get events, agents, services, commands, queries, flows, domains, channels, entities from EventCatalog. Supports pagination via cursor and filtering by search term (searches name, id, and summary).',
|
|
1232
|
-
getResource:
|
|
1262
|
+
getResource:
|
|
1263
|
+
'Use this tool to get a specific resource from EventCatalog by its id. Returns the frontmatter and markdown documentation. Omit the version to get the latest version.',
|
|
1233
1264
|
getMessagesProducedOrConsumedByResource:
|
|
1234
|
-
'Use this tool to get the messages
|
|
1265
|
+
'Use this tool to get the messages (events, commands, queries) a service, agent or domain sends and receives. Each message is resolved to its catalog id, version, name and summary; messages that are referenced but not documented in the catalog are marked notFound. Omit the version to use the latest version of the resource.',
|
|
1235
1266
|
getSchemaForResource:
|
|
1236
1267
|
'Use this tool to get the schema or specifications (openapi or asyncapi or graphql) for a resource by its id and version',
|
|
1237
1268
|
findResourcesByOwner:
|
|
@@ -1261,7 +1292,7 @@ export const toolDescriptions = {
|
|
|
1261
1292
|
getDataProductOutputs:
|
|
1262
1293
|
'Use this tool to get the outputs (resources produced) for a data product. Returns fully hydrated output resources with their id, version, name, summary, collection type, and data contracts (if defined). Data contracts include the contract name, path, format, type, and content.',
|
|
1263
1294
|
getArchitectureDiagramAsMermaid:
|
|
1264
|
-
'Use this tool
|
|
1295
|
+
'Use this tool first when you need an overview of how part of the architecture fits together. Returns the architecture diagram for a resource as Mermaid flowchart code, built the same way as its Diagram page in EventCatalog: the resources it connects to (services, agents, systems, domains, events, commands, queries, channels, data stores), with labelled edges (e.g. publishes, subscribes to, invokes). Systems and domains appear as subgraphs, so you can see what is inside a boundary and what is outside it. For domains and systems, pass detail "overview" for just the domains, systems and their relationships (smaller), or "full" (default) to include services, messages and channels. One call replaces walking producers and consumers one at a time, and the Mermaid can be shown to the user or added to docs and pull requests. Supported collections: events, commands, queries, agents, services, domains, systems, flows, containers, data-products.',
|
|
1265
1296
|
getCustomDocs:
|
|
1266
1297
|
'Use this tool to list the custom documentation pages in EventCatalog (guides, runbooks, architecture notes, onboarding docs, etc.). Returns page ids, titles, and summaries without page content. Supports pagination via cursor and filtering by search term (searches title, id, and summary).',
|
|
1267
1298
|
searchCustomDocs:
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Licensed under the EventCatalog Commercial License.
|
|
3
|
-
* See /packages/core/eventcatalog/src/enterprise/LICENSE
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
1
|
import type { APIRoute } from 'astro';
|
|
7
2
|
import fs from 'node:fs';
|
|
8
3
|
import { getLayoutFilePath } from '@utils/node-graphs/layout-persistence';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import SEO from '../components/Seo.astro';
|
|
3
|
-
import AnalyticsHead from '../
|
|
4
|
-
import AnalyticsTracker from '../
|
|
3
|
+
import AnalyticsHead from '../features/analytics/components/AnalyticsHead.astro';
|
|
4
|
+
import AnalyticsTracker from '../features/analytics/components/AnalyticsTracker.astro';
|
|
5
5
|
import NavigationProgress from '../components/NavigationProgress.astro';
|
|
6
6
|
import config from '@config';
|
|
7
7
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { buildUrl } from '@utils/url-builder';
|
|
3
|
-
import { showEventCatalogBranding } from '@utils/feature';
|
|
4
3
|
const { className } = Astro.props;
|
|
5
4
|
---
|
|
6
5
|
|
|
@@ -8,42 +7,35 @@ const { className } = Astro.props;
|
|
|
8
7
|
transition:persist="site-footer"
|
|
9
8
|
class={`relative py-4 space-y-8 border-t border-[rgb(var(--ec-page-border))] ${className}`}
|
|
10
9
|
>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
href="https://eventcatalog.dev"
|
|
43
|
-
>
|
|
44
|
-
Powered by EventCatalog
|
|
45
|
-
</a>
|
|
46
|
-
</div>
|
|
47
|
-
)
|
|
48
|
-
}
|
|
10
|
+
<div class="flex justify-between items-center py-8 text-[rgb(var(--ec-page-text-muted))] text-sm font-light">
|
|
11
|
+
<div class="flex space-x-5">
|
|
12
|
+
<a href="https://github.com/event-catalog/eventcatalog" target="_blank" aria-label="View EventCatalog on GitHub">
|
|
13
|
+
<svg
|
|
14
|
+
class="w-5 h-5 bg-[rgb(var(--ec-icon-color))] hover:bg-[rgb(var(--ec-accent))]"
|
|
15
|
+
style={`mask-image: url("${buildUrl('/icons/github.svg', true)}"); mask-repeat: no-repeat; mask-position: center center;`}
|
|
16
|
+
aria-hidden="true"></svg>
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://x.com/event_catalog" target="_blank" aria-label="Follow EventCatalog on X (Twitter)">
|
|
19
|
+
<span class="sr-only">X (Twitter)</span>
|
|
20
|
+
<svg
|
|
21
|
+
class="w-5 h-5 bg-[rgb(var(--ec-icon-color))] hover:bg-[rgb(var(--ec-accent))]"
|
|
22
|
+
style={`mask-image: url("${buildUrl('/icons/x-twitter.svg', true)}"); mask-repeat: no-repeat; mask-position: center center;`}
|
|
23
|
+
aria-hidden="true"></svg>
|
|
24
|
+
</a>
|
|
25
|
+
<a href="https://www.youtube.com/@event-catalog" target="_blank" aria-label="Watch EventCatalog on YouTube">
|
|
26
|
+
<span class="sr-only">YouTube</span>
|
|
27
|
+
<svg
|
|
28
|
+
class="w-5 h-5 bg-[rgb(var(--ec-icon-color))] hover:bg-[rgb(var(--ec-accent))]"
|
|
29
|
+
style={`mask-image: url("${buildUrl('/icons/youtube.svg', true)}"); mask-repeat: no-repeat; mask-position: center center;`}
|
|
30
|
+
aria-hidden="true"></svg>
|
|
31
|
+
</a>
|
|
32
|
+
</div>
|
|
33
|
+
<a
|
|
34
|
+
target="_blank"
|
|
35
|
+
class="hover:text-[rgb(var(--ec-accent))] hover:underline text-[rgb(var(--ec-icon-color))] font-light not-prose"
|
|
36
|
+
href="https://eventcatalog.dev"
|
|
37
|
+
>
|
|
38
|
+
Powered by EventCatalog
|
|
39
|
+
</a>
|
|
40
|
+
</div>
|
|
49
41
|
</footer>
|