@eventcatalog/core 3.48.4 → 4.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/catalog-to-astro-content-directory.cjs +1 -1
- package/dist/chunk-BWN544LB.js +73 -0
- package/dist/{chunk-XNVSSL4W.js → chunk-JTZT2SDF.js} +1 -1
- package/dist/{chunk-JY4H7A4S.js → chunk-M2ZRT7KQ.js} +1 -1
- package/dist/{chunk-SY4XL6OQ.js → chunk-MBVTS76Q.js} +1 -1
- package/dist/{chunk-KDLSBQRP.js → chunk-TZTPGQGL.js} +1 -1
- package/dist/{chunk-FNDSHOV2.js → chunk-U5OTNDVQ.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/core-node-modules.cjs +108 -0
- package/dist/core-node-modules.d.cts +7 -0
- package/dist/core-node-modules.d.ts +7 -0
- package/dist/core-node-modules.js +8 -0
- package/dist/docs/development/components/components/15-prompt.md +5 -1
- package/dist/eventcatalog.cjs +124 -48
- package/dist/eventcatalog.js +26 -15
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/astro.config.mjs +27 -23
- package/eventcatalog/public/icons/languages/java.svg +1 -0
- package/eventcatalog/public/icons/payments/stripe.svg +1 -0
- package/eventcatalog/src/components/Badge.astro +10 -10
- package/eventcatalog/src/components/CopyAsMarkdown.tsx +154 -0
- package/eventcatalog/src/components/Grids/DomainGrid.tsx +207 -44
- package/eventcatalog/src/components/Grids/MessageGrid.tsx +0 -20
- package/eventcatalog/src/components/Grids/SystemGrid.tsx +185 -0
- package/eventcatalog/src/components/MDX/ADRTable/ADRTable.astro +99 -0
- package/eventcatalog/src/components/MDX/ADRTable/ADRTable.client.tsx +400 -0
- package/eventcatalog/src/components/MDX/ContextDiagram/ContextDiagramPortal.tsx +21 -0
- package/eventcatalog/src/components/MDX/NodeGraph/AstroNodeGraph.tsx +1 -0
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +42 -6
- package/eventcatalog/src/components/MDX/Prompt/Prompt.astro +62 -9
- package/eventcatalog/src/components/MDX/ResourceRef/ResourceRef.astro +8 -1
- package/eventcatalog/src/components/MDX/SystemContextMap/SystemContextMapPortal.tsx +22 -0
- package/eventcatalog/src/components/MDX/components.tsx +7 -0
- package/eventcatalog/src/components/SchemaExplorer/SchemaExplorer.tsx +1 -1
- package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +67 -37
- package/eventcatalog/src/components/Tables/Discover/DiscoverTable.tsx +47 -0
- package/eventcatalog/src/components/Tables/Discover/FilterComponents.tsx +10 -2
- package/eventcatalog/src/components/Tables/Discover/columns.tsx +115 -27
- package/eventcatalog/src/components/Tables/Discover/index.ts +7 -1
- package/eventcatalog/src/components/Tables/SystemResources/SystemResourcesTable.tsx +267 -0
- package/eventcatalog/src/content.config.ts +96 -8
- package/eventcatalog/src/enterprise/collections/resource-docs-utils.ts +4 -1
- package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +12 -13
- package/eventcatalog/src/enterprise/custom-documentation/utils/custom-docs.ts +6 -0
- package/eventcatalog/src/enterprise/feature.ts +3 -1
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +96 -140
- package/eventcatalog/src/layouts/VisualiserLayout.astro +66 -0
- package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/_index.data.ts +4 -2
- package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/index.astro +2 -0
- package/eventcatalog/src/pages/diagrams/[id]/[version]/index.astro +15 -15
- package/eventcatalog/src/pages/discover/[type]/_index.data.ts +1 -0
- package/eventcatalog/src/pages/discover/[type]/index.astro +47 -2
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +15 -14
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +13 -14
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/_index.data.ts +1 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/_index.data.ts +11 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +81 -26
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/_index.data.ts +89 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/index.astro +85 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version].md.ts +2 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version].mdx.ts +2 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/_index.data.ts +1 -0
- package/eventcatalog/src/pages/docs/teams/[id]/index.astro +24 -1
- package/eventcatalog/src/pages/docs/users/[id]/index.astro +24 -1
- package/eventcatalog/src/pages/index.astro +30 -7
- package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/_index.data.ts +1 -0
- package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/index.astro +1 -1
- package/eventcatalog/src/pages/visualiser/[type]/[id]/[version].mermaid.ts +3 -0
- package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/systems-context/_index.data.ts +94 -0
- package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/systems-context/index.astro +51 -0
- package/eventcatalog/src/pages/visualiser/system-context-map/index.astro +41 -0
- package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/context/_index.data.ts +91 -0
- package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/context/index.astro +51 -0
- package/eventcatalog/src/stores/sidebar-store/builders/adr.ts +3 -1
- package/eventcatalog/src/stores/sidebar-store/builders/agent.ts +3 -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 +127 -49
- package/eventcatalog/src/stores/sidebar-store/builders/message.ts +1 -1
- package/eventcatalog/src/stores/sidebar-store/builders/service.ts +4 -2
- package/eventcatalog/src/stores/sidebar-store/builders/shared.ts +2 -1
- package/eventcatalog/src/stores/sidebar-store/builders/system.ts +166 -0
- package/eventcatalog/src/stores/sidebar-store/state.ts +99 -6
- package/eventcatalog/src/types/index.ts +2 -0
- package/eventcatalog/src/utils/collection-colors.ts +6 -1
- package/eventcatalog/src/utils/collections/domains.ts +35 -0
- package/eventcatalog/src/utils/collections/icons.ts +4 -5
- package/eventcatalog/src/utils/collections/systems.ts +110 -0
- package/eventcatalog/src/utils/collections/teams.ts +15 -10
- package/eventcatalog/src/utils/collections/users.ts +7 -4
- package/eventcatalog/src/utils/collections/util.ts +2 -0
- package/eventcatalog/src/utils/icon-map.ts +20 -0
- package/eventcatalog/src/utils/icon.ts +11 -0
- package/eventcatalog/src/utils/node-graphs/container-node-graph.ts +12 -2
- package/eventcatalog/src/utils/node-graphs/domains-node-graph.ts +0 -170
- package/eventcatalog/src/utils/node-graphs/system-context-node-graph.ts +400 -0
- package/eventcatalog/src/utils/node-graphs/systems-node-graph.ts +208 -0
- package/eventcatalog/src/utils/node-graphs/utils/utils.ts +12 -0
- package/eventcatalog/src/utils/page-loaders/page-data-loader.ts +2 -0
- package/package.json +17 -14
- package/eventcatalog/src/pages/visualiser/context-map/index.astro +0 -30
|
@@ -490,6 +490,12 @@ const services = defineCollection({
|
|
|
490
490
|
'domains/*/subdomains/*/services/*/index.(md|mdx)',
|
|
491
491
|
'domains/*/subdomains/*/services/*/versioned/*/index.(md|mdx)',
|
|
492
492
|
|
|
493
|
+
// Capture services inside systems
|
|
494
|
+
'systems/*/services/*/index.(md|mdx)',
|
|
495
|
+
'systems/*/services/*/versioned/*/index.(md|mdx)',
|
|
496
|
+
'domains/*/systems/*/services/*/index.(md|mdx)',
|
|
497
|
+
'domains/*/systems/*/services/*/versioned/*/index.(md|mdx)',
|
|
498
|
+
|
|
493
499
|
// Capture services in the root
|
|
494
500
|
'services/*/index.(md|mdx)', // ✅ Capture only services markdown files
|
|
495
501
|
'services/*/versioned/*/index.(md|mdx)', // ✅ Capture versioned files inside services
|
|
@@ -591,6 +597,7 @@ const adrResourcePointer = adrPointer.extend({
|
|
|
591
597
|
'flow',
|
|
592
598
|
'channel',
|
|
593
599
|
'domain',
|
|
600
|
+
'system',
|
|
594
601
|
'user',
|
|
595
602
|
'team',
|
|
596
603
|
'container',
|
|
@@ -703,10 +710,10 @@ const resourceDocs = defineCollection({
|
|
|
703
710
|
// Resource-level docs are restricted to known resource paths.
|
|
704
711
|
// This avoids scanning external docs such as node_modules/**/docs.
|
|
705
712
|
pattern: withIgnoredBuildArtifacts([
|
|
706
|
-
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products}/**/docs/**/*.@(md|mdx)',
|
|
707
|
-
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products}/**/docs/*.@(md|mdx)',
|
|
708
|
-
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products}/**/versioned/*/docs/**/*.@(md|mdx)',
|
|
709
|
-
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products}/**/versioned/*/docs/*.@(md|mdx)',
|
|
713
|
+
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/docs/**/*.@(md|mdx)',
|
|
714
|
+
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/docs/*.@(md|mdx)',
|
|
715
|
+
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/versioned/*/docs/**/*.@(md|mdx)',
|
|
716
|
+
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/versioned/*/docs/*.@(md|mdx)',
|
|
710
717
|
'domains/**/docs/**/*.@(md|mdx)',
|
|
711
718
|
'domains/**/docs/*.@(md|mdx)',
|
|
712
719
|
]),
|
|
@@ -718,10 +725,10 @@ const resourceDocs = defineCollection({
|
|
|
718
725
|
const resourceDocCategories = defineCollection({
|
|
719
726
|
loader: glob({
|
|
720
727
|
pattern: withIgnoredBuildArtifacts([
|
|
721
|
-
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products}/**/docs/**/category.json',
|
|
722
|
-
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products}/**/docs/**/_category_.json',
|
|
723
|
-
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products}/**/versioned/*/docs/**/category.json',
|
|
724
|
-
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products}/**/versioned/*/docs/**/_category_.json',
|
|
728
|
+
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/docs/**/category.json',
|
|
729
|
+
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/docs/**/_category_.json',
|
|
730
|
+
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/versioned/*/docs/**/category.json',
|
|
731
|
+
'{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/versioned/*/docs/**/_category_.json',
|
|
725
732
|
'domains/**/docs/**/category.json',
|
|
726
733
|
'domains/**/docs/**/_category_.json',
|
|
727
734
|
'domains/**/docs/category.json',
|
|
@@ -753,6 +760,7 @@ const domains = defineCollection({
|
|
|
753
760
|
services: z.array(pointer).optional(),
|
|
754
761
|
agents: z.array(pointer).optional(),
|
|
755
762
|
domains: z.array(pointer).optional(),
|
|
763
|
+
systems: z.array(pointer).optional(),
|
|
756
764
|
entities: z.array(pointer).optional(),
|
|
757
765
|
'data-products': z.array(pointer).optional(),
|
|
758
766
|
flows: z.array(pointer).optional(),
|
|
@@ -762,6 +770,7 @@ const domains = defineCollection({
|
|
|
762
770
|
.object({
|
|
763
771
|
parentDomains: detailPanelPropertySchema.optional(),
|
|
764
772
|
subdomains: detailPanelPropertySchema.optional(),
|
|
773
|
+
systems: detailPanelPropertySchema.optional(),
|
|
765
774
|
services: detailPanelPropertySchema.optional(),
|
|
766
775
|
entities: detailPanelPropertySchema.optional(),
|
|
767
776
|
messages: detailPanelPropertySchema.optional(),
|
|
@@ -777,6 +786,84 @@ const domains = defineCollection({
|
|
|
777
786
|
.extend(baseSchema.shape),
|
|
778
787
|
});
|
|
779
788
|
|
|
789
|
+
// A relationship from one system to another, used by the System Diagram.
|
|
790
|
+
// Source-declared and one-directional. The `label` describes the edge; a relationship
|
|
791
|
+
// without a label is treated as having no edge (it is skipped when drawing the diagram).
|
|
792
|
+
const systemRelationshipPointer = z.object({
|
|
793
|
+
id: z.string(),
|
|
794
|
+
version: z.string().optional().default('latest'),
|
|
795
|
+
label: z.string().optional(),
|
|
796
|
+
});
|
|
797
|
+
|
|
798
|
+
// An actor (a person/role) that interacts with a system on the Context Diagram.
|
|
799
|
+
// Actors are inline (not a collection) — `id` is the actor's node id, used to
|
|
800
|
+
// de-duplicate the same actor referenced from multiple systems.
|
|
801
|
+
// `direction` controls the edge arrow: `inbound` = actor -> system (e.g. "logs into"),
|
|
802
|
+
// `outbound` = system -> actor (e.g. "sends email to"). Defaults to inbound.
|
|
803
|
+
const systemActorRelationship = z.object({
|
|
804
|
+
id: z.string(),
|
|
805
|
+
name: z.string().optional(),
|
|
806
|
+
label: z.string().optional(),
|
|
807
|
+
direction: z.enum(['inbound', 'outbound']).optional().default('inbound'),
|
|
808
|
+
});
|
|
809
|
+
|
|
810
|
+
const systems = defineCollection({
|
|
811
|
+
loader: glob({
|
|
812
|
+
pattern: withIgnoredBuildArtifacts([
|
|
813
|
+
'**/systems/**/index.(md|mdx)',
|
|
814
|
+
'**/systems/**/versioned/*/index.(md|mdx)',
|
|
815
|
+
// Systems can contain nested resource folders (containers, diagrams, services, etc.).
|
|
816
|
+
// Those nested resources are loaded by their own collections — exclude their index files
|
|
817
|
+
// here so they are not mistaken for systems. Nested `systems/` folders are still allowed.
|
|
818
|
+
'!**/systems/**/agents/**',
|
|
819
|
+
'!**/systems/**/services/**',
|
|
820
|
+
'!**/systems/**/events/**',
|
|
821
|
+
'!**/systems/**/commands/**',
|
|
822
|
+
'!**/systems/**/queries/**',
|
|
823
|
+
'!**/systems/**/flows/**',
|
|
824
|
+
'!**/systems/**/channels/**',
|
|
825
|
+
'!**/systems/**/entities/**',
|
|
826
|
+
'!**/systems/**/containers/**',
|
|
827
|
+
'!**/systems/**/diagrams/**',
|
|
828
|
+
'!**/systems/**/data-products/**',
|
|
829
|
+
'!**/systems/**/adrs/**',
|
|
830
|
+
'!**/systems/**/docs/**',
|
|
831
|
+
]),
|
|
832
|
+
base: projectDirBase,
|
|
833
|
+
generateId: ({ data }) => {
|
|
834
|
+
return `${data.id}-${data.version}`;
|
|
835
|
+
},
|
|
836
|
+
}),
|
|
837
|
+
schema: z
|
|
838
|
+
.object({
|
|
839
|
+
// Whether the system belongs to your organisation (`internal`) or is a
|
|
840
|
+
// third-party/SaaS system you integrate with (`external`, e.g. "Resend",
|
|
841
|
+
// "Stripe"). External systems are shaded in the node-graph. Defaults to internal.
|
|
842
|
+
scope: z.enum(['internal', 'external']).optional().default('internal'),
|
|
843
|
+
services: z.array(pointer).optional(),
|
|
844
|
+
flows: z.array(pointer).optional(),
|
|
845
|
+
entities: z.array(pointer).optional(),
|
|
846
|
+
containers: z.array(pointer).optional(),
|
|
847
|
+
relationships: z.array(systemRelationshipPointer).optional(),
|
|
848
|
+
actors: z.array(systemActorRelationship).optional(),
|
|
849
|
+
detailsPanel: z
|
|
850
|
+
.object({
|
|
851
|
+
versions: detailPanelPropertySchema.optional(),
|
|
852
|
+
repository: detailPanelPropertySchema.optional(),
|
|
853
|
+
owners: detailPanelPropertySchema.optional(),
|
|
854
|
+
changelog: detailPanelPropertySchema.optional(),
|
|
855
|
+
attachments: detailPanelPropertySchema.optional(),
|
|
856
|
+
services: detailPanelPropertySchema.optional(),
|
|
857
|
+
flows: detailPanelPropertySchema.optional(),
|
|
858
|
+
entities: detailPanelPropertySchema.optional(),
|
|
859
|
+
containers: detailPanelPropertySchema.optional(),
|
|
860
|
+
diagrams: detailPanelPropertySchema.optional(),
|
|
861
|
+
})
|
|
862
|
+
.optional(),
|
|
863
|
+
})
|
|
864
|
+
.extend(baseSchema.shape),
|
|
865
|
+
});
|
|
866
|
+
|
|
780
867
|
const channels = defineCollection({
|
|
781
868
|
loader: glob({
|
|
782
869
|
pattern: withIgnoredBuildArtifacts(['**/channels/**/index.(md|mdx)', '**/channels/**/versioned/*/index.(md|mdx)']),
|
|
@@ -1064,6 +1151,7 @@ export const collections = {
|
|
|
1064
1151
|
users,
|
|
1065
1152
|
teams,
|
|
1066
1153
|
domains,
|
|
1154
|
+
systems,
|
|
1067
1155
|
flows,
|
|
1068
1156
|
pages,
|
|
1069
1157
|
changelogs,
|
|
@@ -15,6 +15,7 @@ const CACHE_ENABLED = process.env.DISABLE_EVENTCATALOG_CACHE !== 'true';
|
|
|
15
15
|
export type ResourceCollection =
|
|
16
16
|
| 'agents'
|
|
17
17
|
| 'domains'
|
|
18
|
+
| 'systems'
|
|
18
19
|
| 'services'
|
|
19
20
|
| 'events'
|
|
20
21
|
| 'commands'
|
|
@@ -283,10 +284,11 @@ const getResourceLookups = async (): Promise<Record<ResourceCollection, Resource
|
|
|
283
284
|
}
|
|
284
285
|
|
|
285
286
|
const lookupPromise = (async () => {
|
|
286
|
-
const [agents, domains, services, events, commands, queries, flows, containers, channels, entities, dataProducts] =
|
|
287
|
+
const [agents, domains, systems, services, events, commands, queries, flows, containers, channels, entities, dataProducts] =
|
|
287
288
|
await Promise.all([
|
|
288
289
|
getCollection('agents'),
|
|
289
290
|
getCollection('domains'),
|
|
291
|
+
getCollection('systems'),
|
|
290
292
|
getCollection('services'),
|
|
291
293
|
getCollection('events'),
|
|
292
294
|
getCollection('commands'),
|
|
@@ -301,6 +303,7 @@ const getResourceLookups = async (): Promise<Record<ResourceCollection, Resource
|
|
|
301
303
|
return {
|
|
302
304
|
agents: buildLookup(agents),
|
|
303
305
|
domains: buildLookup(domains),
|
|
306
|
+
systems: buildLookup(systems),
|
|
304
307
|
services: buildLookup(services),
|
|
305
308
|
events: buildLookup(events),
|
|
306
309
|
commands: buildLookup(commands),
|
|
@@ -97,32 +97,31 @@ const editUrl =
|
|
|
97
97
|
<span class="text-xs md:text-sm font-semibold text-[rgb(var(--ec-accent))] capitalize">{sectionLabel}</span>
|
|
98
98
|
)
|
|
99
99
|
}
|
|
100
|
-
<div class="flex
|
|
100
|
+
<div class="flex items-center gap-4">
|
|
101
101
|
<h2 id="doc-page-header" class="text-2xl md:text-4xl font-bold text-[rgb(var(--ec-page-text))]">
|
|
102
102
|
{doc.title}
|
|
103
103
|
</h2>
|
|
104
|
-
<div class="hidden lg:block shrink-0">
|
|
105
|
-
<CopyAsMarkdown
|
|
106
|
-
client:only="react"
|
|
107
|
-
schemas={[]}
|
|
108
|
-
chatEnabled={isEventCatalogChatEnabled()}
|
|
109
|
-
markdownDownloadEnabled={isMarkdownDownloadEnabled()}
|
|
110
|
-
rssFeedEnabled={isRSSEnabled()}
|
|
111
|
-
editUrl={editUrl}
|
|
112
|
-
preferChatAsDefault={isEventCatalogChatEnabled()}
|
|
113
|
-
/>
|
|
114
|
-
</div>
|
|
115
104
|
</div>
|
|
116
105
|
<p class="text-base text-[rgb(var(--ec-page-text-muted))] font-light">{doc.summary}</p>
|
|
117
106
|
{
|
|
118
107
|
badges && badges.length > 0 && (
|
|
119
|
-
<div class="flex flex-wrap gap-
|
|
108
|
+
<div class="flex flex-wrap gap-1.5 py-1">
|
|
120
109
|
{badges.map((badge: any) => {
|
|
121
110
|
return <Badge badge={badge} />;
|
|
122
111
|
})}
|
|
123
112
|
</div>
|
|
124
113
|
)
|
|
125
114
|
}
|
|
115
|
+
<CopyAsMarkdown
|
|
116
|
+
client:only="react"
|
|
117
|
+
variant="toolbar"
|
|
118
|
+
schemas={[]}
|
|
119
|
+
chatEnabled={isEventCatalogChatEnabled()}
|
|
120
|
+
markdownDownloadEnabled={isMarkdownDownloadEnabled()}
|
|
121
|
+
rssFeedEnabled={isRSSEnabled()}
|
|
122
|
+
editUrl={editUrl}
|
|
123
|
+
preferChatAsDefault={isEventCatalogChatEnabled()}
|
|
124
|
+
/>
|
|
126
125
|
</div>
|
|
127
126
|
</div>
|
|
128
127
|
<div class="prose prose-md max-w-none py-4 w-full text-[15px]">
|
|
@@ -269,3 +269,9 @@ export const getNavigationItems = async (): Promise<SidebarItem[]> => {
|
|
|
269
269
|
const configuredSidebar = config.customDocs?.sidebar || [];
|
|
270
270
|
return processSidebarItems(configuredSidebar as SideBarConfigurationItem[]);
|
|
271
271
|
};
|
|
272
|
+
|
|
273
|
+
export const getFirstNavigationPage = async (): Promise<AdjacentPage | null> => {
|
|
274
|
+
const navigationItems = await getNavigationItems();
|
|
275
|
+
const flatPages = flattenNavigationItems(navigationItems);
|
|
276
|
+
return flatPages[0] || null;
|
|
277
|
+
};
|
|
@@ -49,7 +49,9 @@ export const isEventCatalogChatEnabled = () => {
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
export const isEventCatalogUpgradeEnabled = () => !isEventCatalogStarterEnabled() && !isEventCatalogScaleEnabled();
|
|
52
|
-
|
|
52
|
+
|
|
53
|
+
// Custom landing pages are always enabled now.
|
|
54
|
+
export const isCustomLandingPageEnabled = () => true;
|
|
53
55
|
|
|
54
56
|
export const isAuthEnabled = () => {
|
|
55
57
|
const isAuthEnabledInCatalog = config?.auth?.enabled ?? false;
|
|
@@ -5,33 +5,23 @@ interface Props {
|
|
|
5
5
|
description?: string;
|
|
6
6
|
showNestedSideBar?: boolean;
|
|
7
7
|
showHeader?: boolean;
|
|
8
|
+
// When true, the main content uses a reduced horizontal padding instead of the
|
|
9
|
+
// default 5rem. Used by wide pages such as the custom landing page.
|
|
10
|
+
reducedContentPadding?: boolean;
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
import {
|
|
11
14
|
TableProperties,
|
|
12
|
-
|
|
13
|
-
BookOpen,
|
|
14
|
-
BookText,
|
|
15
|
+
House,
|
|
15
16
|
FileText,
|
|
16
17
|
SquareDashedMousePointerIcon,
|
|
17
18
|
FileCode,
|
|
18
19
|
Waypoints,
|
|
19
20
|
PanelLeftClose,
|
|
20
|
-
Database,
|
|
21
21
|
UserRound,
|
|
22
22
|
UsersRound,
|
|
23
23
|
Settings,
|
|
24
24
|
} from 'lucide-react';
|
|
25
|
-
import {
|
|
26
|
-
RectangleGroupIcon,
|
|
27
|
-
GlobeAltIcon,
|
|
28
|
-
CubeIcon,
|
|
29
|
-
BoltIcon,
|
|
30
|
-
ChatBubbleLeftIcon,
|
|
31
|
-
MagnifyingGlassIcon,
|
|
32
|
-
QueueListIcon,
|
|
33
|
-
} from '@heroicons/react/24/outline';
|
|
34
|
-
import ServerIcon from '@heroicons/react/24/outline/ServerIcon';
|
|
35
25
|
import BaseLayout from './BaseLayout.astro';
|
|
36
26
|
import Header from '../components/Header.astro';
|
|
37
27
|
import SideNav from '../components/SideNav/SideNav.astro';
|
|
@@ -58,6 +48,7 @@ import { ClientRouter } from 'astro:transitions';
|
|
|
58
48
|
|
|
59
49
|
import { getCommands } from '@utils/collections/commands';
|
|
60
50
|
import { getDomains } from '@utils/collections/domains';
|
|
51
|
+
import { getSystems } from '@utils/collections/systems';
|
|
61
52
|
import { getEvents } from '@utils/collections/events';
|
|
62
53
|
import { getServices } from '@utils/collections/services';
|
|
63
54
|
import { getAgents } from '@utils/collections/agents';
|
|
@@ -69,10 +60,12 @@ import { isCollectionVisibleInCatalog } from '@eventcatalog';
|
|
|
69
60
|
import { buildUrl } from '@utils/url-builder';
|
|
70
61
|
import { getQueries } from '@utils/collections/queries';
|
|
71
62
|
import { filterSidebarItems } from '@utils/sidebar-visibility';
|
|
63
|
+
import { getFirstNavigationPage } from '@enterprise/custom-documentation/utils/custom-docs';
|
|
72
64
|
|
|
73
65
|
import { isEmbedEnabled, isCustomStylesEnabled, isEventCatalogScaleEnabled, isCustomDocsEnabled, isSSR } from '@utils/feature';
|
|
74
66
|
|
|
75
67
|
const customDocs = await getCollection('customPages');
|
|
68
|
+
const firstCustomDocsPage = isCustomDocsEnabled() && customDocs.length > 0 ? await getFirstNavigationPage() : null;
|
|
76
69
|
|
|
77
70
|
let events: any[] = [];
|
|
78
71
|
let commands: any[] = [];
|
|
@@ -81,11 +74,12 @@ let services: any[] = [];
|
|
|
81
74
|
let agents: any[] = [];
|
|
82
75
|
let adrs: any[] = [];
|
|
83
76
|
let domains: any[] = [];
|
|
77
|
+
let systems: any[] = [];
|
|
84
78
|
let flows: any[] = [];
|
|
85
79
|
let containers: any[] = [];
|
|
86
80
|
let dataProducts: any[] = [];
|
|
87
81
|
|
|
88
|
-
[events, commands, queries, services, agents, adrs, domains, flows, containers, dataProducts] = await Promise.all([
|
|
82
|
+
[events, commands, queries, services, agents, adrs, domains, systems, flows, containers, dataProducts] = await Promise.all([
|
|
89
83
|
getEvents({ getAllVersions: false, hydrateServices: false }),
|
|
90
84
|
getCommands({ getAllVersions: false, hydrateServices: false }),
|
|
91
85
|
getQueries({ getAllVersions: false, hydrateServices: false }),
|
|
@@ -93,6 +87,7 @@ let dataProducts: any[] = [];
|
|
|
93
87
|
getAgents({ getAllVersions: false }),
|
|
94
88
|
getAdrs({ getAllVersions: false }),
|
|
95
89
|
getDomains({ getAllVersions: false }),
|
|
90
|
+
getSystems({ getAllVersions: false }),
|
|
96
91
|
getFlows({ getAllVersions: false }),
|
|
97
92
|
getContainers({ getAllVersions: false }),
|
|
98
93
|
getDataProducts({ getAllVersions: false }),
|
|
@@ -109,7 +104,7 @@ const currentPath = Astro.url.pathname;
|
|
|
109
104
|
|
|
110
105
|
const getDefaultUrl = (route: string, defaultValue: string) => {
|
|
111
106
|
if (route === 'docs/custom') {
|
|
112
|
-
return
|
|
107
|
+
return firstCustomDocsPage ? buildUrl(`/${route}/${firstCustomDocsPage.slug}`) : buildUrl(defaultValue);
|
|
113
108
|
}
|
|
114
109
|
|
|
115
110
|
const collections = [
|
|
@@ -143,8 +138,8 @@ const navigationItems = filterSidebarItems(
|
|
|
143
138
|
[
|
|
144
139
|
{
|
|
145
140
|
id: '/',
|
|
146
|
-
label: '
|
|
147
|
-
icon:
|
|
141
|
+
label: 'Home',
|
|
142
|
+
icon: House,
|
|
148
143
|
href: buildUrl(config.landingPage || '/'),
|
|
149
144
|
current:
|
|
150
145
|
currentPath === '/' ||
|
|
@@ -165,24 +160,6 @@ const navigationItems = filterSidebarItems(
|
|
|
165
160
|
isPremium: true,
|
|
166
161
|
visible: isCustomDocsEnabled() && customDocs.length > 0,
|
|
167
162
|
},
|
|
168
|
-
{
|
|
169
|
-
id: '/schemas/explorer',
|
|
170
|
-
label: 'Schemas',
|
|
171
|
-
icon: FileCode,
|
|
172
|
-
href: buildUrl('/schemas/explorer'),
|
|
173
|
-
current: currentPath.includes('/schemas/explorer') && !currentPath.includes('/schemas/fields'),
|
|
174
|
-
},
|
|
175
|
-
...(isSSR()
|
|
176
|
-
? [
|
|
177
|
-
{
|
|
178
|
-
id: '/schemas/fields',
|
|
179
|
-
label: 'Schema Insights',
|
|
180
|
-
icon: Waypoints,
|
|
181
|
-
href: buildUrl('/schemas/fields'),
|
|
182
|
-
current: currentPath.includes('/schemas/fields'),
|
|
183
|
-
},
|
|
184
|
-
]
|
|
185
|
-
: []),
|
|
186
163
|
],
|
|
187
164
|
userSideBarConfiguration
|
|
188
165
|
);
|
|
@@ -211,113 +188,69 @@ const premiumFeatures: Array<{
|
|
|
211
188
|
|
|
212
189
|
const internalServices = services.filter((service) => !service.data.externalSystem);
|
|
213
190
|
const externalSystems = services.filter((service) => service.data.externalSystem);
|
|
191
|
+
const discoverTargets = [
|
|
192
|
+
{ id: '/discover/domains', aliases: ['/discover'], href: buildUrl('/discover/domains'), count: domains.length },
|
|
193
|
+
{ id: '/discover/systems', aliases: ['/discover'], href: buildUrl('/discover/systems'), count: systems.length },
|
|
194
|
+
{
|
|
195
|
+
id: '/discover/services',
|
|
196
|
+
aliases: ['/discover'],
|
|
197
|
+
href: buildUrl('/discover/services'),
|
|
198
|
+
count: internalServices.length,
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: '/discover/external-systems',
|
|
202
|
+
aliases: ['/discover'],
|
|
203
|
+
href: buildUrl('/discover/external-systems'),
|
|
204
|
+
count: externalSystems.length,
|
|
205
|
+
},
|
|
206
|
+
{ id: '/discover/agents', aliases: ['/discover'], href: buildUrl('/discover/agents'), count: agents.length },
|
|
207
|
+
{ id: '/discover/adrs', aliases: ['/discover'], href: buildUrl('/discover/adrs'), count: adrs.length },
|
|
208
|
+
{
|
|
209
|
+
id: '/discover/data-products',
|
|
210
|
+
aliases: ['/discover'],
|
|
211
|
+
href: buildUrl('/discover/data-products'),
|
|
212
|
+
count: dataProducts.length,
|
|
213
|
+
},
|
|
214
|
+
{ id: '/discover/containers', aliases: ['/discover'], href: buildUrl('/discover/containers'), count: containers.length },
|
|
215
|
+
{ id: '/discover/events', aliases: ['/discover'], href: buildUrl('/discover/events'), count: events.length },
|
|
216
|
+
{ id: '/discover/commands', aliases: ['/discover'], href: buildUrl('/discover/commands'), count: commands.length },
|
|
217
|
+
{ id: '/discover/queries', aliases: ['/discover'], href: buildUrl('/discover/queries'), count: queries.length },
|
|
218
|
+
{ id: '/discover/flows', aliases: ['/discover'], href: buildUrl('/discover/flows'), count: flows.length },
|
|
219
|
+
];
|
|
220
|
+
const defaultDiscoverTarget = filterSidebarItems(discoverTargets, userSideBarConfiguration).find((target) => target.count > 0);
|
|
214
221
|
|
|
215
222
|
const browseItems = filterSidebarItems(
|
|
216
223
|
[
|
|
217
224
|
{
|
|
218
|
-
id: '/discover
|
|
219
|
-
aliases: ['/discover'],
|
|
220
|
-
label: 'Agents',
|
|
221
|
-
icon: BotMessageSquare,
|
|
222
|
-
href: buildUrl('/discover/agents'),
|
|
223
|
-
current: currentPath === buildUrl('/discover/agents'),
|
|
224
|
-
visible: agents.length > 0,
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
id: '/discover/adrs',
|
|
228
|
-
aliases: ['/discover'],
|
|
229
|
-
label: 'Decision Records',
|
|
230
|
-
icon: BookText,
|
|
231
|
-
href: buildUrl('/discover/adrs'),
|
|
232
|
-
current: currentPath === buildUrl('/discover/adrs'),
|
|
233
|
-
visible: adrs.length > 0,
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
id: '/discover/data-products',
|
|
237
|
-
aliases: ['/discover'],
|
|
238
|
-
label: 'Data Products',
|
|
239
|
-
icon: CubeIcon,
|
|
240
|
-
href: buildUrl('/discover/data-products'),
|
|
241
|
-
current: currentPath === buildUrl('/discover/data-products'),
|
|
242
|
-
visible: dataProducts.length > 0,
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
id: '/discover/containers',
|
|
246
|
-
aliases: ['/discover'],
|
|
247
|
-
label: 'Data Stores',
|
|
248
|
-
icon: Database,
|
|
249
|
-
href: buildUrl('/discover/containers'),
|
|
250
|
-
current: currentPath === buildUrl('/discover/containers'),
|
|
251
|
-
visible: containers.length > 0,
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
id: '/discover/domains',
|
|
255
|
-
aliases: ['/discover'],
|
|
256
|
-
label: 'Domains',
|
|
257
|
-
icon: RectangleGroupIcon,
|
|
258
|
-
href: buildUrl('/discover/domains'),
|
|
259
|
-
current: currentPath === buildUrl('/discover/domains'),
|
|
260
|
-
visible: domains.length > 0,
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
id: '/discover/services',
|
|
264
|
-
aliases: ['/discover'],
|
|
265
|
-
label: 'Services',
|
|
266
|
-
icon: ServerIcon,
|
|
267
|
-
href: buildUrl('/discover/services'),
|
|
268
|
-
current: currentPath === buildUrl('/discover/services'),
|
|
269
|
-
visible: internalServices.length > 0,
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
id: '/discover/external-systems',
|
|
225
|
+
id: '/discover',
|
|
273
226
|
aliases: ['/discover'],
|
|
274
|
-
label: '
|
|
275
|
-
icon:
|
|
276
|
-
href: buildUrl('/discover/
|
|
277
|
-
current: currentPath === buildUrl('/discover/
|
|
278
|
-
visible:
|
|
227
|
+
label: 'Resources',
|
|
228
|
+
icon: TableProperties,
|
|
229
|
+
href: defaultDiscoverTarget?.href ?? buildUrl('/discover/domains'),
|
|
230
|
+
current: currentPath === buildUrl('/discover') || currentPath.startsWith(buildUrl('/discover/', true)),
|
|
231
|
+
visible: Boolean(defaultDiscoverTarget),
|
|
279
232
|
},
|
|
280
233
|
{
|
|
281
|
-
id: '/
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
current: currentPath === buildUrl('/discover/events'),
|
|
287
|
-
visible: events.length > 0,
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
id: '/discover/commands',
|
|
291
|
-
aliases: ['/discover'],
|
|
292
|
-
label: 'Commands',
|
|
293
|
-
icon: ChatBubbleLeftIcon,
|
|
294
|
-
href: buildUrl('/discover/commands'),
|
|
295
|
-
current: currentPath === buildUrl('/discover/commands'),
|
|
296
|
-
visible: commands.length > 0,
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
id: '/discover/queries',
|
|
300
|
-
aliases: ['/discover'],
|
|
301
|
-
label: 'Queries',
|
|
302
|
-
icon: MagnifyingGlassIcon,
|
|
303
|
-
href: buildUrl('/discover/queries'),
|
|
304
|
-
current: currentPath === buildUrl('/discover/queries'),
|
|
305
|
-
visible: queries.length > 0,
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
id: '/discover/flows',
|
|
309
|
-
aliases: ['/discover'],
|
|
310
|
-
label: 'Flows',
|
|
311
|
-
icon: QueueListIcon,
|
|
312
|
-
href: buildUrl('/discover/flows'),
|
|
313
|
-
current: currentPath === buildUrl('/discover/flows'),
|
|
314
|
-
visible: flows.length > 0,
|
|
234
|
+
id: '/schemas/explorer',
|
|
235
|
+
label: 'Schemas & APIs',
|
|
236
|
+
icon: FileCode,
|
|
237
|
+
href: buildUrl('/schemas/explorer'),
|
|
238
|
+
current: currentPath.includes('/schemas/explorer') && !currentPath.includes('/schemas/fields'),
|
|
315
239
|
},
|
|
240
|
+
...(isSSR()
|
|
241
|
+
? [
|
|
242
|
+
{
|
|
243
|
+
id: '/schemas/fields',
|
|
244
|
+
label: 'Schema Insights',
|
|
245
|
+
icon: Waypoints,
|
|
246
|
+
href: buildUrl('/schemas/fields'),
|
|
247
|
+
current: currentPath.includes('/schemas/fields'),
|
|
248
|
+
},
|
|
249
|
+
]
|
|
250
|
+
: []),
|
|
316
251
|
],
|
|
317
252
|
userSideBarConfiguration
|
|
318
|
-
)
|
|
319
|
-
.filter((item) => item.visible !== false)
|
|
320
|
-
.sort((a, b) => a.label.localeCompare(b.label));
|
|
253
|
+
).filter((item) => item.visible !== false);
|
|
321
254
|
|
|
322
255
|
const organizationItems = filterSidebarItems(
|
|
323
256
|
[
|
|
@@ -356,7 +289,7 @@ const settingsItems = filterSidebarItems(
|
|
|
356
289
|
);
|
|
357
290
|
|
|
358
291
|
const currentNavigationItem = [...navigationItems, ...studioNavigationItem, ...premiumFeatures].find((item) => item.current);
|
|
359
|
-
const { title, description, showNestedSideBar = true, showHeader = true } = Astro.props;
|
|
292
|
+
const { title, description, showNestedSideBar = true, showHeader = true, reducedContentPadding = false } = Astro.props;
|
|
360
293
|
|
|
361
294
|
const canPageBeEmbedded = isEmbedEnabled();
|
|
362
295
|
const verticalNavAutoCollapsePaths = [buildUrl('/discover', true), buildUrl('/docs', true)];
|
|
@@ -420,6 +353,10 @@ const verticalNavAutoCollapsePaths = [buildUrl('/discover', true), buildUrl('/do
|
|
|
420
353
|
padding-left: var(--ec-app-content-padding-left);
|
|
421
354
|
padding-right: var(--ec-app-content-padding-right);
|
|
422
355
|
}
|
|
356
|
+
.app-content-wrapper--reduced-padding {
|
|
357
|
+
--ec-app-content-padding-left: 2rem;
|
|
358
|
+
--ec-app-content-padding-right: 2rem;
|
|
359
|
+
}
|
|
423
360
|
.app-shell {
|
|
424
361
|
min-height: calc(100vh - 4rem);
|
|
425
362
|
flex: 1;
|
|
@@ -458,8 +395,9 @@ const verticalNavAutoCollapsePaths = [buildUrl('/discover', true), buildUrl('/do
|
|
|
458
395
|
.vertical-nav-rail[data-collapsed='true'] .nav-secondary-item,
|
|
459
396
|
.vertical-nav-rail[data-collapsed='true'] #vertical-nav-toggle {
|
|
460
397
|
justify-content: center;
|
|
461
|
-
|
|
462
|
-
|
|
398
|
+
width: 2.5rem;
|
|
399
|
+
height: 2.5rem;
|
|
400
|
+
padding: 0;
|
|
463
401
|
}
|
|
464
402
|
:root[data-vertical-nav-collapsed='true'] .vertical-nav-rail .nav-brand-link,
|
|
465
403
|
.vertical-nav-rail[data-collapsed='true'] .nav-brand-link {
|
|
@@ -468,13 +406,26 @@ const verticalNavAutoCollapsePaths = [buildUrl('/discover', true), buildUrl('/do
|
|
|
468
406
|
}
|
|
469
407
|
:root[data-vertical-nav-collapsed='true'] .vertical-nav-rail nav,
|
|
470
408
|
.vertical-nav-rail[data-collapsed='true'] nav {
|
|
409
|
+
align-items: center;
|
|
410
|
+
gap: 0.75rem;
|
|
471
411
|
padding-left: 0.25rem;
|
|
472
412
|
padding-right: 0.25rem;
|
|
473
413
|
}
|
|
474
414
|
:root[data-vertical-nav-collapsed='true'] .vertical-nav-rail .rail-divider,
|
|
475
415
|
.vertical-nav-rail[data-collapsed='true'] .rail-divider {
|
|
476
|
-
|
|
477
|
-
|
|
416
|
+
display: none;
|
|
417
|
+
}
|
|
418
|
+
:root[data-vertical-nav-collapsed='true'] .vertical-nav-rail nav > .mt-auto,
|
|
419
|
+
.vertical-nav-rail[data-collapsed='true'] nav > .mt-auto {
|
|
420
|
+
margin-top: auto !important;
|
|
421
|
+
padding-top: 0;
|
|
422
|
+
}
|
|
423
|
+
:root[data-vertical-nav-collapsed='true'] .vertical-nav-rail nav + div,
|
|
424
|
+
.vertical-nav-rail[data-collapsed='true'] nav + div {
|
|
425
|
+
border-top: 0;
|
|
426
|
+
display: flex;
|
|
427
|
+
justify-content: center;
|
|
428
|
+
padding: 0.75rem 0.25rem;
|
|
478
429
|
}
|
|
479
430
|
:root[data-vertical-nav-collapsed='true'] .vertical-nav-rail .nav-premium-icon,
|
|
480
431
|
.vertical-nav-rail[data-collapsed='true'] .nav-premium-icon {
|
|
@@ -745,7 +696,7 @@ const verticalNavAutoCollapsePaths = [buildUrl('/discover', true), buildUrl('/do
|
|
|
745
696
|
Astro.slots.has('sidebar-content') ? (
|
|
746
697
|
<slot />
|
|
747
698
|
) : (
|
|
748
|
-
<div class=
|
|
699
|
+
<div class={`app-content-wrapper ${reducedContentPadding ? 'app-content-wrapper--reduced-padding' : ''}`}>
|
|
749
700
|
<slot />
|
|
750
701
|
</div>
|
|
751
702
|
)
|
|
@@ -814,6 +765,10 @@ const verticalNavAutoCollapsePaths = [buildUrl('/discover', true), buildUrl('/do
|
|
|
814
765
|
return pathname.includes('/schemas/fields');
|
|
815
766
|
}
|
|
816
767
|
|
|
768
|
+
if (id === '/discover') {
|
|
769
|
+
return pathname === '/discover' || pathname.includes('/discover/');
|
|
770
|
+
}
|
|
771
|
+
|
|
817
772
|
if (id === '/studio') {
|
|
818
773
|
return pathname.includes('/studio');
|
|
819
774
|
}
|
|
@@ -844,9 +799,10 @@ const verticalNavAutoCollapsePaths = [buildUrl('/discover', true), buildUrl('/do
|
|
|
844
799
|
});
|
|
845
800
|
|
|
846
801
|
secondaryNavItems.forEach((item) => {
|
|
802
|
+
const id = item.getAttribute('id');
|
|
847
803
|
const href = item.getAttribute('href');
|
|
848
804
|
const targetPath = href ? new URL(href, window.location.origin).pathname : null;
|
|
849
|
-
const isCurrent = targetPath ? pathname === targetPath : false;
|
|
805
|
+
const isCurrent = id === '/discover' ? isNavItemCurrent(id, pathname) : targetPath ? pathname === targetPath : false;
|
|
850
806
|
|
|
851
807
|
if (isCurrent) {
|
|
852
808
|
item.classList.remove(...INACTIVE_NAV_CLASSES);
|