@eventcatalog/core 4.9.0 → 4.10.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/{chunk-HKVOSQTD.js → chunk-OC2RGFPU.js} +1 -1
- package/dist/{chunk-MPHX5C7M.js → chunk-PHG7KEUH.js} +1 -1
- package/dist/{chunk-LVGQ23LR.js → chunk-QIV7LWVJ.js} +1 -1
- package/dist/{chunk-XQHS36GO.js → chunk-SQNVL7PI.js} +1 -1
- package/dist/{chunk-3CGSSMTK.js → chunk-T2HLSITU.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +5 -5
- 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 +6 -0
- package/eventcatalog/src/components/Badge.astro +3 -1
- package/eventcatalog/src/components/CatalogGraph/CatalogForceGraph.tsx +260 -175
- package/eventcatalog/src/components/FieldsExplorer/FieldNodeGraph.tsx +0 -5
- package/eventcatalog/src/components/MDX/ArchitectureGraph/ArchitectureGraph.astro +62 -0
- package/eventcatalog/src/components/MDX/ArchitectureGraph/ArchitectureGraphPortal.tsx +22 -0
- package/eventcatalog/src/components/MDX/ArchitectureGraph/AstroArchitectureGraph.tsx +42 -0
- package/eventcatalog/src/components/MDX/Design/Design.astro +2 -0
- package/eventcatalog/src/components/MDX/EntityMap/EntityMap.astro +2 -0
- package/eventcatalog/src/components/MDX/Flow/Flow.astro +2 -0
- package/eventcatalog/src/components/MDX/NodeGraph/AstroNodeGraph.tsx +5 -7
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +5 -0
- package/eventcatalog/src/components/MDX/components.tsx +13 -0
- package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +121 -88
- package/eventcatalog/src/components/SideNav/NestedSideBar/storage.ts +55 -7
- package/eventcatalog/src/components/SideNav/NestedSideBar/utils.spec.ts +59 -15
- package/eventcatalog/src/components/SideNav/NestedSideBar/utils.ts +53 -7
- package/eventcatalog/src/content.config.ts +70 -0
- package/eventcatalog/src/enterprise/collections/resource-docs-utils.ts +19 -0
- package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +46 -1
- package/eventcatalog/src/enterprise/fields/pages/fields.astro +2 -0
- package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/index.astro +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +16 -15
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +21 -17
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +45 -4
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/index.astro +16 -8
- package/eventcatalog/src/pages/docs/[type]/[id]/language/[dictionaryId]/index.astro +48 -65
- package/eventcatalog/src/pages/docs/[type]/[id]/language/index.astro +45 -18
- package/eventcatalog/src/pages/docs/teams/[id]/index.astro +1 -1
- package/eventcatalog/src/pages/docs/users/[id]/index.astro +1 -1
- package/eventcatalog/src/pages/index.astro +34 -2
- package/eventcatalog/src/pages/schemas/[type]/[id]/[version]/index.astro +5 -1
- package/eventcatalog/src/pages/triggers/[type]/[id]/[version]/index.astro +2 -0
- package/eventcatalog/src/pages/visualiser/designs/[id]/index.astro +2 -0
- package/eventcatalog/src/pages/visualiser/graph/index.astro +2 -23
- package/eventcatalog/src/stores/sidebar-store/builders/adr.ts +96 -34
- package/eventcatalog/src/stores/sidebar-store/builders/agent.ts +167 -75
- package/eventcatalog/src/stores/sidebar-store/builders/container.ts +135 -59
- package/eventcatalog/src/stores/sidebar-store/builders/data-product.ts +144 -58
- package/eventcatalog/src/stores/sidebar-store/builders/domain.ts +306 -188
- package/eventcatalog/src/stores/sidebar-store/builders/entity.ts +108 -39
- package/eventcatalog/src/stores/sidebar-store/builders/flow.ts +147 -63
- package/eventcatalog/src/stores/sidebar-store/builders/message.ts +212 -121
- package/eventcatalog/src/stores/sidebar-store/builders/service.ts +223 -127
- package/eventcatalog/src/stores/sidebar-store/builders/shared.ts +3 -23
- package/eventcatalog/src/stores/sidebar-store/builders/system.ts +187 -97
- package/eventcatalog/src/stores/sidebar-store/custom-sidebar.ts +678 -0
- package/eventcatalog/src/stores/sidebar-store/state.ts +66 -36
- package/eventcatalog/src/styles/tailwind.css +82 -0
- package/eventcatalog/src/utils/collections/resource-docs.ts +1 -0
- package/eventcatalog/src/utils/node-graphs/catalog-force-graph.ts +41 -0
- package/package.json +1 -1
|
@@ -11,21 +11,67 @@ import {
|
|
|
11
11
|
buildAttachmentsSection,
|
|
12
12
|
buildDiagramNavItems,
|
|
13
13
|
buildResourceDocsSection,
|
|
14
|
+
buildArchitectureDecisionsSection,
|
|
14
15
|
} from './shared';
|
|
15
16
|
import { isChangelogEnabled } from '@utils/feature';
|
|
16
17
|
import { isVisualiserEnabled } from '@utils/feature';
|
|
17
18
|
import { pluralizeMessageType } from '@utils/collections/messages';
|
|
18
19
|
import { iconFieldsForResource } from '@utils/icon';
|
|
20
|
+
import { resolveSidebarPages, toCustomSidebarContext, type SidebarSpec } from '../custom-sidebar';
|
|
19
21
|
|
|
20
22
|
const uniqueRefs = (refs: string[]) => [...new Set(refs)];
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Predefined sidebar sections for an agent, keyed by the token users reference from
|
|
26
|
+
* `sidebar.json` (e.g. `$quick-reference`). Each token is the kebab-cased title of the
|
|
27
|
+
* section as it appears in the default sidebar.
|
|
28
|
+
*/
|
|
29
|
+
export type AgentSectionKey =
|
|
30
|
+
| 'quick-reference'
|
|
31
|
+
| 'documentation'
|
|
32
|
+
| 'architecture'
|
|
33
|
+
| 'diagrams'
|
|
34
|
+
| 'resource-groups'
|
|
35
|
+
| 'state-and-persistence'
|
|
36
|
+
| 'outbound-messages'
|
|
37
|
+
| 'inbound-messages'
|
|
38
|
+
| 'channels'
|
|
39
|
+
| 'flows'
|
|
40
|
+
| 'decision-records'
|
|
41
|
+
| 'owners'
|
|
42
|
+
| 'code'
|
|
43
|
+
| 'attachments';
|
|
44
|
+
|
|
45
|
+
export type AgentSections = Record<AgentSectionKey, NavNode | NavNode[] | null>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Order of sections in the default (generated) sidebar. `decision-records` is deliberately
|
|
49
|
+
* absent — in default mode it is inserted before Owners by `withArchitectureDecisionsSection`
|
|
50
|
+
* in state.ts, and only becomes a first-class token for custom sidebars.
|
|
51
|
+
*/
|
|
52
|
+
export const DEFAULT_AGENT_SECTION_ORDER: AgentSectionKey[] = [
|
|
53
|
+
'quick-reference',
|
|
54
|
+
'documentation',
|
|
55
|
+
'architecture',
|
|
56
|
+
'diagrams',
|
|
57
|
+
'resource-groups',
|
|
58
|
+
'state-and-persistence',
|
|
59
|
+
'outbound-messages',
|
|
60
|
+
'inbound-messages',
|
|
61
|
+
'channels',
|
|
62
|
+
'flows',
|
|
63
|
+
'owners',
|
|
64
|
+
'code',
|
|
65
|
+
'attachments',
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
export const buildAgentSections = (
|
|
23
69
|
agent: CollectionEntry<'agents'>,
|
|
24
70
|
owners: any[],
|
|
25
71
|
context: ResourceGroupContext,
|
|
26
72
|
agentChannels: CollectionEntry<'channels'>[] = [],
|
|
27
73
|
flowRefs: string[] = []
|
|
28
|
-
):
|
|
74
|
+
): AgentSections => {
|
|
29
75
|
const sendsMessages = agent.data.sends || [];
|
|
30
76
|
const receivesMessages = agent.data.receives || [];
|
|
31
77
|
|
|
@@ -60,84 +106,130 @@ export const buildAgentNode = (
|
|
|
60
106
|
const diagramNavItems = buildDiagramNavItems(agentDiagrams, context.diagrams);
|
|
61
107
|
const hasDiagrams = diagramNavItems.length > 0;
|
|
62
108
|
|
|
109
|
+
return {
|
|
110
|
+
'quick-reference': buildQuickReferenceSection(
|
|
111
|
+
[
|
|
112
|
+
{ title: 'Overview', href: buildUrl(`/docs/agents/${agent.data.id}/${agent.data.version}`) },
|
|
113
|
+
isChangelogEnabled() &&
|
|
114
|
+
shouldRenderSideBarSection(agent, 'changelog') && {
|
|
115
|
+
title: 'Changelog',
|
|
116
|
+
href: buildUrl(`/docs/agents/${agent.data.id}/${agent.data.version}/changelog`),
|
|
117
|
+
},
|
|
118
|
+
].filter(Boolean) as { title: string; href: string }[]
|
|
119
|
+
),
|
|
120
|
+
documentation: docsSection,
|
|
121
|
+
architecture: renderVisualiser
|
|
122
|
+
? {
|
|
123
|
+
type: 'group',
|
|
124
|
+
title: 'Architecture',
|
|
125
|
+
icon: 'Workflow',
|
|
126
|
+
pages: [
|
|
127
|
+
{
|
|
128
|
+
type: 'item',
|
|
129
|
+
title: 'Map',
|
|
130
|
+
href: buildUrl(`/visualiser/agents/${agent.data.id}/${agent.data.version}`),
|
|
131
|
+
},
|
|
132
|
+
].filter(Boolean) as ChildRef[],
|
|
133
|
+
}
|
|
134
|
+
: null,
|
|
135
|
+
diagrams: hasDiagrams
|
|
136
|
+
? {
|
|
137
|
+
type: 'group',
|
|
138
|
+
title: 'Diagrams',
|
|
139
|
+
icon: 'FileImage',
|
|
140
|
+
pages: diagramNavItems,
|
|
141
|
+
}
|
|
142
|
+
: null,
|
|
143
|
+
'resource-groups': renderResourceGroups
|
|
144
|
+
? (buildResourceGroupSections(resourceGroups, context).filter(Boolean) as NavNode[])
|
|
145
|
+
: null,
|
|
146
|
+
'state-and-persistence': hasDataStores
|
|
147
|
+
? {
|
|
148
|
+
type: 'group',
|
|
149
|
+
title: 'State and Persistence',
|
|
150
|
+
icon: 'Database',
|
|
151
|
+
pages: dataStoresInAgent.map(
|
|
152
|
+
(dataStore) => `container:${(dataStore as any).data.id}:${(dataStore as any).data.version}`
|
|
153
|
+
),
|
|
154
|
+
}
|
|
155
|
+
: null,
|
|
156
|
+
'outbound-messages':
|
|
157
|
+
sendsMessages.length > 0 && renderMessages
|
|
158
|
+
? {
|
|
159
|
+
type: 'group',
|
|
160
|
+
title: 'Outbound Messages',
|
|
161
|
+
icon: 'Mail',
|
|
162
|
+
pages: sendsMessages.map(
|
|
163
|
+
(message) => `${pluralizeMessageType(message as any)}:${(message as any).data.id}:${(message as any).data.version}`
|
|
164
|
+
),
|
|
165
|
+
}
|
|
166
|
+
: null,
|
|
167
|
+
'inbound-messages':
|
|
168
|
+
receivesMessages.length > 0 && renderMessages
|
|
169
|
+
? {
|
|
170
|
+
type: 'group',
|
|
171
|
+
title: 'Inbound Messages',
|
|
172
|
+
icon: 'Mail',
|
|
173
|
+
pages: receivesMessages.map(
|
|
174
|
+
(receive) => `${pluralizeMessageType(receive as any)}:${(receive as any).data.id}:${(receive as any).data.version}`
|
|
175
|
+
),
|
|
176
|
+
}
|
|
177
|
+
: null,
|
|
178
|
+
channels:
|
|
179
|
+
agentChannels.length > 0
|
|
180
|
+
? {
|
|
181
|
+
type: 'group',
|
|
182
|
+
title: 'Channels',
|
|
183
|
+
icon: 'ArrowRightLeft',
|
|
184
|
+
pages: agentChannels.map((channel) => `channel:${(channel as any).data.id}:${(channel as any).data.version}`),
|
|
185
|
+
}
|
|
186
|
+
: null,
|
|
187
|
+
flows: hasFlows
|
|
188
|
+
? {
|
|
189
|
+
type: 'group',
|
|
190
|
+
// If the agent declares its own flows it owns them ("Flows"); otherwise it is
|
|
191
|
+
// only referenced as a step in someone else's flow ("Appears in flows").
|
|
192
|
+
title: agentFlows.length > 0 ? 'Flows' : 'Appears in flows',
|
|
193
|
+
icon: 'Waypoints',
|
|
194
|
+
pages: agentFlowRefs,
|
|
195
|
+
}
|
|
196
|
+
: null,
|
|
197
|
+
'decision-records': shouldRenderSideBarSection(agent, 'architectureDecisions')
|
|
198
|
+
? buildArchitectureDecisionsSection(agent, context.adrs || [])
|
|
199
|
+
: null,
|
|
200
|
+
owners: renderOwners ? buildOwnersSection(owners) : null,
|
|
201
|
+
code: renderRepository ? buildRepositorySection(agent.data.repository as { url: string; language: string }) : null,
|
|
202
|
+
attachments: hasAttachments ? buildAttachmentsSection(agent.data.attachments as any[]) : null,
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export type BuildAgentNodeOptions = {
|
|
207
|
+
/** A parsed `sidebar.json` for this agent. When present it replaces the generated sidebar. */
|
|
208
|
+
sidebar?: SidebarSpec;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
export const buildAgentNode = (
|
|
212
|
+
agent: CollectionEntry<'agents'>,
|
|
213
|
+
owners: any[],
|
|
214
|
+
context: ResourceGroupContext,
|
|
215
|
+
agentChannels: CollectionEntry<'channels'>[] = [],
|
|
216
|
+
flowRefs: string[] = [],
|
|
217
|
+
options: BuildAgentNodeOptions = {}
|
|
218
|
+
): NavNode => {
|
|
219
|
+
const sections = buildAgentSections(agent, owners, context, agentChannels, flowRefs);
|
|
220
|
+
|
|
221
|
+
const pages = resolveSidebarPages(sections, DEFAULT_AGENT_SECTION_ORDER, {
|
|
222
|
+
sidebar: options.sidebar,
|
|
223
|
+
resource: { collection: 'agents', id: agent.data.id, version: agent.data.version, entry: agent },
|
|
224
|
+
context: toCustomSidebarContext(context),
|
|
225
|
+
});
|
|
226
|
+
|
|
63
227
|
return {
|
|
64
228
|
type: 'item',
|
|
65
229
|
title: agent.data.name,
|
|
66
230
|
badge: 'Agent',
|
|
67
231
|
summary: agent.data.summary,
|
|
68
232
|
...iconFieldsForResource(agent.data, 'Bot'),
|
|
69
|
-
pages
|
|
70
|
-
buildQuickReferenceSection(
|
|
71
|
-
[
|
|
72
|
-
{ title: 'Overview', href: buildUrl(`/docs/agents/${agent.data.id}/${agent.data.version}`) },
|
|
73
|
-
isChangelogEnabled() &&
|
|
74
|
-
shouldRenderSideBarSection(agent, 'changelog') && {
|
|
75
|
-
title: 'Changelog',
|
|
76
|
-
href: buildUrl(`/docs/agents/${agent.data.id}/${agent.data.version}/changelog`),
|
|
77
|
-
},
|
|
78
|
-
].filter(Boolean) as { title: string; href: string }[]
|
|
79
|
-
),
|
|
80
|
-
docsSection,
|
|
81
|
-
renderVisualiser && {
|
|
82
|
-
type: 'group',
|
|
83
|
-
title: 'Architecture',
|
|
84
|
-
icon: 'Workflow',
|
|
85
|
-
pages: [
|
|
86
|
-
{
|
|
87
|
-
type: 'item',
|
|
88
|
-
title: 'Map',
|
|
89
|
-
href: buildUrl(`/visualiser/agents/${agent.data.id}/${agent.data.version}`),
|
|
90
|
-
},
|
|
91
|
-
].filter(Boolean) as ChildRef[],
|
|
92
|
-
},
|
|
93
|
-
hasDiagrams && {
|
|
94
|
-
type: 'group',
|
|
95
|
-
title: 'Diagrams',
|
|
96
|
-
icon: 'FileImage',
|
|
97
|
-
pages: diagramNavItems,
|
|
98
|
-
},
|
|
99
|
-
renderResourceGroups && buildResourceGroupSections(resourceGroups, context),
|
|
100
|
-
hasDataStores && {
|
|
101
|
-
type: 'group',
|
|
102
|
-
title: 'State and Persistence',
|
|
103
|
-
icon: 'Database',
|
|
104
|
-
pages: dataStoresInAgent.map((dataStore) => `container:${(dataStore as any).data.id}:${(dataStore as any).data.version}`),
|
|
105
|
-
},
|
|
106
|
-
sendsMessages.length > 0 &&
|
|
107
|
-
renderMessages && {
|
|
108
|
-
type: 'group',
|
|
109
|
-
title: 'Outbound Messages',
|
|
110
|
-
icon: 'Mail',
|
|
111
|
-
pages: sendsMessages.map(
|
|
112
|
-
(message) => `${pluralizeMessageType(message as any)}:${(message as any).data.id}:${(message as any).data.version}`
|
|
113
|
-
),
|
|
114
|
-
},
|
|
115
|
-
receivesMessages.length > 0 &&
|
|
116
|
-
renderMessages && {
|
|
117
|
-
type: 'group',
|
|
118
|
-
title: 'Inbound Messages',
|
|
119
|
-
icon: 'Mail',
|
|
120
|
-
pages: receivesMessages.map(
|
|
121
|
-
(receive) => `${pluralizeMessageType(receive as any)}:${(receive as any).data.id}:${(receive as any).data.version}`
|
|
122
|
-
),
|
|
123
|
-
},
|
|
124
|
-
agentChannels.length > 0 && {
|
|
125
|
-
type: 'group',
|
|
126
|
-
title: 'Channels',
|
|
127
|
-
icon: 'ArrowRightLeft',
|
|
128
|
-
pages: agentChannels.map((channel) => `channel:${(channel as any).data.id}:${(channel as any).data.version}`),
|
|
129
|
-
},
|
|
130
|
-
hasFlows && {
|
|
131
|
-
type: 'group',
|
|
132
|
-
// If the agent declares its own flows it owns them ("Flows"); otherwise it is
|
|
133
|
-
// only referenced as a step in someone else's flow ("Appears in flows").
|
|
134
|
-
title: agentFlows.length > 0 ? 'Flows' : 'Appears in flows',
|
|
135
|
-
icon: 'Waypoints',
|
|
136
|
-
pages: agentFlowRefs,
|
|
137
|
-
},
|
|
138
|
-
renderOwners && buildOwnersSection(owners),
|
|
139
|
-
renderRepository && buildRepositorySection(agent.data.repository as { url: string; language: string }),
|
|
140
|
-
hasAttachments && buildAttachmentsSection(agent.data.attachments as any[]),
|
|
141
|
-
].filter(Boolean) as ChildRef[],
|
|
233
|
+
pages,
|
|
142
234
|
};
|
|
143
235
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CollectionEntry } from 'astro:content';
|
|
2
2
|
import { buildUrl } from '@utils/url-builder';
|
|
3
|
-
import type { NavNode,
|
|
3
|
+
import type { NavNode, ResourceGroupContext } from './shared';
|
|
4
4
|
import {
|
|
5
5
|
buildQuickReferenceSection,
|
|
6
6
|
buildOwnersSection,
|
|
@@ -9,16 +9,56 @@ import {
|
|
|
9
9
|
buildAttachmentsSection,
|
|
10
10
|
buildDiagramNavItems,
|
|
11
11
|
buildResourceDocsSection,
|
|
12
|
+
buildArchitectureDecisionsSection,
|
|
12
13
|
} from './shared';
|
|
13
14
|
import { isVisualiserEnabled, isChangelogEnabled } from '@utils/feature';
|
|
14
15
|
import { iconFieldsForResource } from '@utils/icon';
|
|
16
|
+
import { resolveSidebarPages, toCustomSidebarContext, type SidebarSpec } from '../custom-sidebar';
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Predefined sidebar sections for a container, keyed by the token users reference from
|
|
20
|
+
* `sidebar.json` (e.g. `$quick-reference`). Each token is the kebab-cased title of the
|
|
21
|
+
* section as it appears in the default sidebar.
|
|
22
|
+
*/
|
|
23
|
+
export type ContainerSectionKey =
|
|
24
|
+
| 'quick-reference'
|
|
25
|
+
| 'documentation'
|
|
26
|
+
| 'architecture'
|
|
27
|
+
| 'diagrams'
|
|
28
|
+
| 'writes'
|
|
29
|
+
| 'reads'
|
|
30
|
+
| 'appears-in-flows'
|
|
31
|
+
| 'decision-records'
|
|
32
|
+
| 'owners'
|
|
33
|
+
| 'code'
|
|
34
|
+
| 'attachments';
|
|
35
|
+
|
|
36
|
+
export type ContainerSections = Record<ContainerSectionKey, NavNode | NavNode[] | null>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Order of sections in the default (generated) sidebar. `decision-records` is deliberately
|
|
40
|
+
* absent — in default mode it is inserted before Owners by `withArchitectureDecisionsSection`
|
|
41
|
+
* in state.ts, and only becomes a first-class token for custom sidebars.
|
|
42
|
+
*/
|
|
43
|
+
export const DEFAULT_CONTAINER_SECTION_ORDER: ContainerSectionKey[] = [
|
|
44
|
+
'quick-reference',
|
|
45
|
+
'documentation',
|
|
46
|
+
'architecture',
|
|
47
|
+
'diagrams',
|
|
48
|
+
'writes',
|
|
49
|
+
'reads',
|
|
50
|
+
'appears-in-flows',
|
|
51
|
+
'owners',
|
|
52
|
+
'code',
|
|
53
|
+
'attachments',
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
export const buildContainerSections = (
|
|
17
57
|
container: CollectionEntry<'containers'>,
|
|
18
58
|
owners: any[],
|
|
19
59
|
context: ResourceGroupContext,
|
|
20
60
|
flowRefs: string[] = []
|
|
21
|
-
):
|
|
61
|
+
): ContainerSections => {
|
|
22
62
|
const servicesWritingToContainer = container.data.servicesThatWriteToContainer || [];
|
|
23
63
|
const servicesReadingFromContainer = container.data.servicesThatReadFromContainer || [];
|
|
24
64
|
const dataProductsWritingToContainer = (container.data as any).dataProductsThatWriteToContainer || [];
|
|
@@ -59,67 +99,103 @@ export const buildContainerNode = (
|
|
|
59
99
|
const diagramNavItems = buildDiagramNavItems(containerDiagrams, context.diagrams);
|
|
60
100
|
const hasDiagrams = diagramNavItems.length > 0;
|
|
61
101
|
|
|
102
|
+
return {
|
|
103
|
+
'quick-reference': buildQuickReferenceSection(
|
|
104
|
+
[
|
|
105
|
+
{
|
|
106
|
+
title: 'Overview',
|
|
107
|
+
href: buildUrl(`/docs/containers/${container.data.id}/${container.data.version}`),
|
|
108
|
+
},
|
|
109
|
+
isChangelogEnabled() &&
|
|
110
|
+
shouldRenderSideBarSection(container, 'changelog') && {
|
|
111
|
+
title: 'Changelog',
|
|
112
|
+
href: buildUrl(`/docs/containers/${container.data.id}/${container.data.version}/changelog`),
|
|
113
|
+
},
|
|
114
|
+
].filter(Boolean) as { title: string; href: string }[]
|
|
115
|
+
),
|
|
116
|
+
documentation: docsSection,
|
|
117
|
+
architecture: renderVisualiser
|
|
118
|
+
? {
|
|
119
|
+
type: 'group',
|
|
120
|
+
title: 'Architecture',
|
|
121
|
+
icon: 'Workflow',
|
|
122
|
+
pages: [
|
|
123
|
+
{
|
|
124
|
+
type: 'item',
|
|
125
|
+
title: 'Map',
|
|
126
|
+
href: buildUrl(`/visualiser/containers/${container.data.id}/${container.data.version}`),
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
}
|
|
130
|
+
: null,
|
|
131
|
+
diagrams: hasDiagrams
|
|
132
|
+
? {
|
|
133
|
+
type: 'group',
|
|
134
|
+
title: 'Diagrams',
|
|
135
|
+
icon: 'FileImage',
|
|
136
|
+
pages: diagramNavItems,
|
|
137
|
+
}
|
|
138
|
+
: null,
|
|
139
|
+
writes: renderWrites
|
|
140
|
+
? {
|
|
141
|
+
type: 'group',
|
|
142
|
+
title: 'Writes',
|
|
143
|
+
icon: 'ArrowUpFromLine',
|
|
144
|
+
pages: allWrites,
|
|
145
|
+
}
|
|
146
|
+
: null,
|
|
147
|
+
reads: renderReads
|
|
148
|
+
? {
|
|
149
|
+
type: 'group',
|
|
150
|
+
title: 'Reads',
|
|
151
|
+
icon: 'ArrowDownToLine',
|
|
152
|
+
pages: allReads,
|
|
153
|
+
}
|
|
154
|
+
: null,
|
|
155
|
+
'appears-in-flows': renderFlows
|
|
156
|
+
? {
|
|
157
|
+
type: 'group',
|
|
158
|
+
title: 'Appears in flows',
|
|
159
|
+
icon: 'Waypoints',
|
|
160
|
+
pages: flowRefs,
|
|
161
|
+
visible: flowRefs.length > 0,
|
|
162
|
+
}
|
|
163
|
+
: null,
|
|
164
|
+
'decision-records': shouldRenderSideBarSection(container, 'architectureDecisions')
|
|
165
|
+
? buildArchitectureDecisionsSection(container, context.adrs || [])
|
|
166
|
+
: null,
|
|
167
|
+
owners: renderOwners ? buildOwnersSection(owners) : null,
|
|
168
|
+
code: renderRepository ? buildRepositorySection(container.data.repository as { url: string; language: string }) : null,
|
|
169
|
+
attachments: hasAttachments ? buildAttachmentsSection(container.data.attachments as any[]) : null,
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export type BuildContainerNodeOptions = {
|
|
174
|
+
/** A parsed `sidebar.json` for this container. When present it replaces the generated sidebar. */
|
|
175
|
+
sidebar?: SidebarSpec;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export const buildContainerNode = (
|
|
179
|
+
container: CollectionEntry<'containers'>,
|
|
180
|
+
owners: any[],
|
|
181
|
+
context: ResourceGroupContext,
|
|
182
|
+
flowRefs: string[] = [],
|
|
183
|
+
options: BuildContainerNodeOptions = {}
|
|
184
|
+
): NavNode => {
|
|
185
|
+
const sections = buildContainerSections(container, owners, context, flowRefs);
|
|
186
|
+
|
|
187
|
+
const pages = resolveSidebarPages(sections, DEFAULT_CONTAINER_SECTION_ORDER, {
|
|
188
|
+
sidebar: options.sidebar,
|
|
189
|
+
resource: { collection: 'containers', id: container.data.id, version: container.data.version, entry: container },
|
|
190
|
+
context: toCustomSidebarContext(context),
|
|
191
|
+
});
|
|
192
|
+
|
|
62
193
|
return {
|
|
63
194
|
type: 'item',
|
|
64
195
|
title: container.data.name,
|
|
65
196
|
badge: 'Container',
|
|
66
197
|
summary: container.data.summary,
|
|
67
198
|
...iconFieldsForResource(container.data, 'Database'),
|
|
68
|
-
pages
|
|
69
|
-
buildQuickReferenceSection(
|
|
70
|
-
[
|
|
71
|
-
{
|
|
72
|
-
title: 'Overview',
|
|
73
|
-
href: buildUrl(`/docs/containers/${container.data.id}/${container.data.version}`),
|
|
74
|
-
},
|
|
75
|
-
isChangelogEnabled() &&
|
|
76
|
-
shouldRenderSideBarSection(container, 'changelog') && {
|
|
77
|
-
title: 'Changelog',
|
|
78
|
-
href: buildUrl(`/docs/containers/${container.data.id}/${container.data.version}/changelog`),
|
|
79
|
-
},
|
|
80
|
-
].filter(Boolean) as { title: string; href: string }[]
|
|
81
|
-
),
|
|
82
|
-
docsSection,
|
|
83
|
-
renderVisualiser && {
|
|
84
|
-
type: 'group',
|
|
85
|
-
title: 'Architecture',
|
|
86
|
-
icon: 'Workflow',
|
|
87
|
-
pages: [
|
|
88
|
-
{
|
|
89
|
-
type: 'item',
|
|
90
|
-
title: 'Map',
|
|
91
|
-
href: buildUrl(`/visualiser/containers/${container.data.id}/${container.data.version}`),
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
},
|
|
95
|
-
hasDiagrams && {
|
|
96
|
-
type: 'group',
|
|
97
|
-
title: 'Diagrams',
|
|
98
|
-
icon: 'FileImage',
|
|
99
|
-
pages: diagramNavItems,
|
|
100
|
-
},
|
|
101
|
-
renderWrites && {
|
|
102
|
-
type: 'group',
|
|
103
|
-
title: 'Writes',
|
|
104
|
-
icon: 'ArrowUpFromLine',
|
|
105
|
-
pages: allWrites,
|
|
106
|
-
},
|
|
107
|
-
renderReads && {
|
|
108
|
-
type: 'group',
|
|
109
|
-
title: 'Reads',
|
|
110
|
-
icon: 'ArrowDownToLine',
|
|
111
|
-
pages: allReads,
|
|
112
|
-
},
|
|
113
|
-
renderFlows && {
|
|
114
|
-
type: 'group',
|
|
115
|
-
title: 'Appears in flows',
|
|
116
|
-
icon: 'Waypoints',
|
|
117
|
-
pages: flowRefs,
|
|
118
|
-
visible: flowRefs.length > 0,
|
|
119
|
-
},
|
|
120
|
-
renderOwners && buildOwnersSection(owners),
|
|
121
|
-
renderRepository && buildRepositorySection(container.data.repository as { url: string; language: string }),
|
|
122
|
-
hasAttachments && buildAttachmentsSection(container.data.attachments as any[]),
|
|
123
|
-
].filter(Boolean) as ChildRef[],
|
|
199
|
+
pages,
|
|
124
200
|
};
|
|
125
201
|
};
|