@eventcatalog/core 5.0.0-beta.2 → 5.0.0-beta.20

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.
Files changed (204) hide show
  1. package/LICENSE +234 -134
  2. package/README.md +5 -5
  3. package/dist/analytics/analytics.cjs +18 -3
  4. package/dist/analytics/analytics.d.cts +1 -1
  5. package/dist/analytics/analytics.d.ts +1 -1
  6. package/dist/analytics/analytics.js +3 -2
  7. package/dist/analytics/log-build.cjs +71 -35
  8. package/dist/analytics/log-build.js +5 -4
  9. package/dist/analytics/telemetry.cjs +42 -0
  10. package/dist/analytics/telemetry.d.cts +20 -0
  11. package/dist/analytics/telemetry.d.ts +20 -0
  12. package/dist/analytics/telemetry.js +8 -0
  13. package/dist/catalog-runtime.cjs +1 -1
  14. package/dist/{chunk-HGRFXTFC.js → chunk-3VQSVQTU.js} +1 -1
  15. package/dist/{chunk-KIDISU6X.js → chunk-5ZUN2TXB.js} +56 -33
  16. package/dist/{chunk-TQLRG35T.js → chunk-AWOO63ME.js} +71 -45
  17. package/dist/chunk-CPW6G62V.js +17 -0
  18. package/dist/{chunk-4J2ZM2HX.js → chunk-F236OJZD.js} +1 -1
  19. package/dist/{chunk-XARPIXWF.js → chunk-FWH5T6U4.js} +9 -3
  20. package/dist/{chunk-62EV4IJA.js → chunk-R2X4ZEF6.js} +1 -1
  21. package/dist/constants.cjs +1 -1
  22. package/dist/constants.js +1 -1
  23. package/dist/eventcatalog.cjs +214 -129
  24. package/dist/eventcatalog.config.d.cts +59 -1
  25. package/dist/eventcatalog.config.d.ts +59 -1
  26. package/dist/eventcatalog.js +39 -15
  27. package/dist/federation/federate.js +2 -2
  28. package/dist/generate.cjs +1 -1
  29. package/dist/generate.js +3 -3
  30. package/dist/runtime-dependencies/@eventcatalog__visualiser__studio-fonts.css.mjs +3 -0
  31. package/dist/runtime-dependencies/@eventcatalog__visualiser__studio.css.mjs +3 -0
  32. package/dist/runtime-dependencies/@eventcatalog__visualiser__studio.mjs +3 -0
  33. package/dist/runtime-dependencies/@hocuspocus__provider.mjs +3 -0
  34. package/dist/runtime-dependencies/@hocuspocus__server.mjs +3 -0
  35. package/dist/runtime-dependencies/@mcp-b__webmcp-local-relay.mjs +3 -0
  36. package/dist/runtime-dependencies/@mcp-b__webmcp-polyfill.mjs +3 -0
  37. package/dist/runtime-dependencies/htmlparser2.mjs +3 -0
  38. package/dist/runtime-dependencies/manifest.json +13 -1
  39. package/dist/runtime-dependencies/react-hotkeys-hook.mjs +3 -0
  40. package/dist/runtime-dependencies/react-syntax-highlighter__dist__cjs__create-element.js.mjs +3 -0
  41. package/dist/runtime-dependencies/y-protocols.mjs +3 -0
  42. package/dist/runtime-dependencies/y-protocols__awareness.mjs +3 -0
  43. package/dist/runtime-dependencies/yjs.mjs +3 -0
  44. package/dist/utils/cli-logger.cjs +1 -1
  45. package/dist/utils/cli-logger.js +2 -2
  46. package/dist/utils/license-status.cjs +71 -45
  47. package/dist/utils/license-status.d.cts +14 -5
  48. package/dist/utils/license-status.d.ts +14 -5
  49. package/dist/utils/license-status.js +1 -1
  50. package/eventcatalog/astro.config.mjs +23 -1
  51. package/eventcatalog/integrations/skip-startup-reload.mjs +31 -0
  52. package/eventcatalog/integrations/stable-dependency-order.mjs +29 -0
  53. package/eventcatalog/integrations/storage.mjs +20 -0
  54. package/eventcatalog/integrations/studio-server.mjs +32 -0
  55. package/eventcatalog/src/components/CatalogGraph/CatalogForceGraph.tsx +39 -0
  56. package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +2 -0
  57. package/eventcatalog/src/components/Grids/utils.tsx +0 -23
  58. package/eventcatalog/src/components/Header.astro +3 -3
  59. package/eventcatalog/src/components/MDX/CodeGroup/CodeGroup.tsx +6 -1
  60. package/eventcatalog/src/components/MDX/NodeGraph/AstroNodeGraph.tsx +42 -3
  61. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +5 -1
  62. package/eventcatalog/src/components/NavigationProgress.astro +7 -0
  63. package/eventcatalog/src/components/SchemaExplorer/ApiContentViewer.tsx +2 -0
  64. package/eventcatalog/src/components/SchemaExplorer/ExamplesViewer.tsx +2 -0
  65. package/eventcatalog/src/components/SchemaExplorer/SchemaCodeModal.tsx +2 -0
  66. package/eventcatalog/src/components/SchemaExplorer/SchemaContentViewer.tsx +2 -0
  67. package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +12 -4
  68. package/eventcatalog/src/components/Search/SearchDataLoader.astro +16 -28
  69. package/eventcatalog/src/components/Search/SearchModal.tsx +2 -10
  70. package/eventcatalog/src/components/Search/search-utils.ts +26 -0
  71. package/eventcatalog/src/components/Seo.astro +5 -1
  72. package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +53 -83
  73. package/eventcatalog/src/components/SideNav/NestedSideBar/storage.ts +2 -0
  74. package/eventcatalog/src/components/SideNav/NestedSideBar/utils.ts +131 -0
  75. package/eventcatalog/src/components/SideNav/SideNav.astro +9 -1
  76. package/eventcatalog/src/components/Tables/Discover/DiscoverTable.tsx +4 -62
  77. package/eventcatalog/src/components/Tables/Discover/columns.tsx +17 -150
  78. package/eventcatalog/src/components/Tables/Resources/ResourcesTable.tsx +425 -0
  79. package/eventcatalog/src/components/Tables/RowActionsMenu.tsx +157 -0
  80. package/eventcatalog/src/components/Tables/TablePagination.tsx +82 -0
  81. package/eventcatalog/src/features/ai/chat-api.ts +3 -3
  82. package/eventcatalog/src/features/auth/error.astro +4 -2
  83. package/eventcatalog/src/features/auth/login.astro +2 -1
  84. package/eventcatalog/src/features/auth/middleware/middleware-auth.ts +10 -0
  85. package/eventcatalog/src/features/auth/unauthorized.astro +1 -1
  86. package/eventcatalog/src/features/fields/pages/fields.astro +1 -1
  87. package/eventcatalog/src/features/integrations/eventcatalog-features.ts +34 -1
  88. package/eventcatalog/src/features/mcp/apps/architecture-diagram/node-chat.tsx +6 -45
  89. package/eventcatalog/src/features/mcp/apps/canvas/shared.ts +47 -0
  90. package/eventcatalog/src/features/mcp/apps/canvas/styles.css +24 -0
  91. package/eventcatalog/src/features/mcp/apps/canvas/view.tsx +278 -0
  92. package/eventcatalog/src/features/mcp/apps/generated/canvas.html +272 -0
  93. package/eventcatalog/src/features/mcp/apps/generated/viewer.html +77 -76
  94. package/eventcatalog/src/features/mcp/apps/shared/app-view.tsx +2 -1
  95. package/eventcatalog/src/features/mcp/mcp-apps.ts +6 -3
  96. package/eventcatalog/src/features/mcp/mcp-server.ts +36 -5
  97. package/eventcatalog/src/features/server/start.ts +25 -0
  98. package/eventcatalog/src/features/storage/database.ts +88 -0
  99. package/eventcatalog/src/features/storage/migrations.ts +85 -0
  100. package/eventcatalog/src/features/storage/sql/database.sql +5 -0
  101. package/eventcatalog/src/features/storage/sql/migrations/0001-studio-canvases.sql +12 -0
  102. package/eventcatalog/src/features/storage/sql/migrations.sql +15 -0
  103. package/eventcatalog/src/features/storage/sql.ts +28 -0
  104. package/eventcatalog/src/features/studio/agent-choreography.ts +384 -0
  105. package/eventcatalog/src/features/studio/agents.ts +28 -0
  106. package/eventcatalog/src/features/studio/api/canvases-api.ts +219 -0
  107. package/eventcatalog/src/features/studio/api/canvases.ts +25 -0
  108. package/eventcatalog/src/features/studio/api/client.ts +40 -0
  109. package/eventcatalog/src/features/studio/canvas-actions.ts +540 -0
  110. package/eventcatalog/src/features/studio/canvas-preview.ts +52 -0
  111. package/eventcatalog/src/features/studio/catalog-resources.ts +155 -0
  112. package/eventcatalog/src/features/studio/catalog.ts +173 -0
  113. package/eventcatalog/src/features/studio/components/CanvasHeader.tsx +518 -0
  114. package/eventcatalog/src/features/studio/components/CanvasStatusMenu.tsx +118 -0
  115. package/eventcatalog/src/features/studio/components/ConnectAgentDialog.tsx +434 -0
  116. package/eventcatalog/src/features/studio/components/ConnectionsChooser.tsx +143 -0
  117. package/eventcatalog/src/features/studio/components/DeleteCanvasDialog.tsx +65 -0
  118. package/eventcatalog/src/features/studio/components/Dialog.tsx +60 -0
  119. package/eventcatalog/src/features/studio/components/JoinForm.tsx +109 -0
  120. package/eventcatalog/src/features/studio/components/LeftPanel.tsx +203 -0
  121. package/eventcatalog/src/features/studio/components/NodeDetails.tsx +183 -0
  122. package/eventcatalog/src/features/studio/components/OpenInStudioDialog.tsx +79 -0
  123. package/eventcatalog/src/features/studio/components/Presence.tsx +293 -0
  124. package/eventcatalog/src/features/studio/components/ShareDialog.tsx +396 -0
  125. package/eventcatalog/src/features/studio/components/ShortcutsDialog.tsx +41 -0
  126. package/eventcatalog/src/features/studio/components/StudioDesigner.tsx +2091 -0
  127. package/eventcatalog/src/features/studio/components/StudioNotice.astro +24 -0
  128. package/eventcatalog/src/features/studio/document-name.ts +7 -0
  129. package/eventcatalog/src/features/studio/from-visualiser.ts +138 -0
  130. package/eventcatalog/src/features/studio/hooks/presence-sender.ts +63 -0
  131. package/eventcatalog/src/features/studio/hooks/presence-store.ts +119 -0
  132. package/eventcatalog/src/features/studio/hooks/use-canvas-webmcp.ts +353 -0
  133. package/eventcatalog/src/features/studio/hooks/use-comments.ts +54 -0
  134. package/eventcatalog/src/features/studio/hooks/use-follow-camera.ts +109 -0
  135. package/eventcatalog/src/features/studio/hooks/use-studio-flow.ts +782 -0
  136. package/eventcatalog/src/features/studio/identity.ts +59 -0
  137. package/eventcatalog/src/features/studio/limits.ts +2 -0
  138. package/eventcatalog/src/features/studio/pages/[id].astro +69 -0
  139. package/eventcatalog/src/features/studio/pages/index.astro +784 -0
  140. package/eventcatalog/src/features/studio/pages/webmcp-relay.ts +27 -0
  141. package/eventcatalog/src/features/studio/server/canvas-mcp.ts +495 -0
  142. package/eventcatalog/src/features/studio/server/runtime.ts +498 -0
  143. package/eventcatalog/src/features/studio/server/sign-in.ts +18 -0
  144. package/eventcatalog/src/features/studio/server/sql/storage.sql +18 -0
  145. package/eventcatalog/src/features/studio/server/storage.ts +90 -0
  146. package/eventcatalog/src/features/studio/server/tool-icons.ts +30 -0
  147. package/eventcatalog/src/features/studio/tool-sync.ts +75 -0
  148. package/eventcatalog/src/layouts/BaseLayout.astro +4 -4
  149. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +13 -7
  150. package/eventcatalog/src/pages/_index.astro +1 -1
  151. package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/_index.data.spec.ts +52 -63
  152. package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/_index.data.ts +34 -46
  153. package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/index.astro +11 -29
  154. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/_ResourcesPage.astro +79 -0
  155. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/_index.data.spec.ts +32 -14
  156. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/_index.data.ts +63 -58
  157. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/index.astro +2 -62
  158. package/eventcatalog/src/pages/docs/[type]/[id]/index.astro +1 -1
  159. package/eventcatalog/src/pages/docs/services/[id]/[version]/resources/index.astro +13 -0
  160. package/eventcatalog/src/pages/index.astro +1 -1
  161. package/eventcatalog/src/pages/schemas/explorer/index.astro +1 -1
  162. package/eventcatalog/src/pages/visualiser/[type]/[id]/index.astro +1 -1
  163. package/eventcatalog/src/stores/sidebar-store/builders/domain.ts +24 -42
  164. package/eventcatalog/src/stores/sidebar-store/builders/flow.ts +2 -0
  165. package/eventcatalog/src/stores/sidebar-store/builders/message.ts +2 -0
  166. package/eventcatalog/src/stores/sidebar-store/builders/service.ts +23 -23
  167. package/eventcatalog/src/stores/sidebar-store/builders/shared.ts +13 -0
  168. package/eventcatalog/src/stores/sidebar-store/builders/system.ts +18 -27
  169. package/eventcatalog/src/stores/sidebar-store/state.ts +5 -0
  170. package/eventcatalog/src/styles/tailwind.css +2 -2
  171. package/eventcatalog/src/types/react-syntax-highlighter.d.ts +10 -0
  172. package/eventcatalog/src/utils/collections/channels.ts +56 -1
  173. package/eventcatalog/src/utils/collections/flows.ts +50 -1
  174. package/eventcatalog/src/utils/collections/message-connections.ts +60 -0
  175. package/eventcatalog/src/utils/collections/message-triggers.ts +2 -1
  176. package/eventcatalog/src/utils/collections/resource-owners.ts +193 -0
  177. package/eventcatalog/src/utils/collections/resources.ts +310 -0
  178. package/eventcatalog/src/utils/collections/util.ts +31 -0
  179. package/eventcatalog/src/utils/feature.ts +8 -0
  180. package/eventcatalog/src/utils/git.ts +11 -5
  181. package/eventcatalog/src/utils/link-validation.ts +25 -19
  182. package/eventcatalog/src/utils/node-graphs/domain-entity-map.ts +3 -1
  183. package/eventcatalog/src/utils/node-graphs/domain-levels-node-graph.ts +3 -3
  184. package/eventcatalog/src/utils/node-graphs/export-mermaid.ts +0 -2
  185. package/eventcatalog/src/utils/node-graphs/layout-node-graph.ts +20 -1
  186. package/eventcatalog/src/utils/node-graphs/node-resource.ts +67 -0
  187. package/eventcatalog/src/utils/node-graphs/systems-node-graph.ts +1 -1
  188. package/eventcatalog/src/utils/page-title.ts +15 -0
  189. package/eventcatalog/src/utils/syntax-highlighter-renderer.ts +64 -0
  190. package/eventcatalog/src/utils/trial.ts +1 -1
  191. package/package.json +22 -16
  192. package/dist/runtime-dependencies/shelljs.mjs +0 -3
  193. package/eventcatalog/public/studio-bg.png +0 -0
  194. package/eventcatalog/src/components/Grids/DomainGrid.tsx +0 -838
  195. package/eventcatalog/src/components/Grids/MessageGrid.tsx +0 -344
  196. package/eventcatalog/src/components/Grids/SystemGrid.tsx +0 -185
  197. package/eventcatalog/src/components/Grids/components.tsx +0 -170
  198. package/eventcatalog/src/components/Grids/message-link.ts +0 -38
  199. package/eventcatalog/src/components/Studio/StudioPageModal.tsx +0 -150
  200. package/eventcatalog/src/components/Tables/SystemResources/SystemResourcesTable.tsx +0 -294
  201. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/_resources.spec.ts +0 -65
  202. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/_resources.ts +0 -46
  203. package/eventcatalog/src/pages/studio.astro +0 -316
  204. package/dist/{chunk-AYNZXUB5.js → chunk-KHACCTW2.js} +3 -3
@@ -1,74 +1,79 @@
1
1
  import { isSSR } from '@utils/feature';
2
2
  import { HybridPage } from '@utils/page-loaders/hybrid-page';
3
- import { hasResources } from './_resources';
3
+ import type { ResourceOwner, ResourceOwnerCollection } from '@utils/collections/resources';
4
+ import {
5
+ createResourcesCatalog,
6
+ findOwnerWithResources,
7
+ getOwnersWithResources,
8
+ RESOURCE_OWNER_COLLECTIONS,
9
+ } from '@utils/collections/resource-owners';
4
10
 
5
- // The Resources page lists the resources directly attached to a single system or
6
- // domain. It is only available for systems and domains — every other resource type 404s.
7
- const SUPPORTED_TYPES = ['systems', 'domains'] as const;
8
- type SupportedType = (typeof SUPPORTED_TYPES)[number];
11
+ // The Resources page lists the resources attached to a single system, domain, service, flow,
12
+ // channel or message. Every other resource type 404s.
13
+ //
14
+ // Services have their own route (pages/docs/services/[id]/[version]/resources), because the
15
+ // version-less alias /docs/services/[id]/[docType]/[docId] outranks this generic route and
16
+ // would otherwise catch /docs/services/{id}/{version}/resources.
17
+ const GENERIC_ROUTE_TYPES = RESOURCE_OWNER_COLLECTIONS.filter((type) => type !== 'services');
9
18
 
10
- const isSupportedType = (type: string): type is SupportedType => SUPPORTED_TYPES.includes(type as SupportedType);
19
+ type RouteParams = { type?: string; id?: string; version?: string };
11
20
 
12
- export const loadResourceOwner = async (type: SupportedType) => {
13
- if (type === 'systems') {
14
- const { getSystems } = await import('@utils/collections/systems');
15
- return getSystems();
16
- }
17
- const { getDomains } = await import('@utils/collections/domains');
18
- return getDomains({ includeServicesInSubdomains: false });
19
- };
21
+ const createResourcesPage = ({
22
+ types,
23
+ toParams,
24
+ typeOf,
25
+ }: {
26
+ types: ResourceOwnerCollection[];
27
+ toParams: (type: ResourceOwnerCollection, owner: ResourceOwner) => RouteParams;
28
+ typeOf: (params: RouteParams) => string | undefined;
29
+ }) =>
30
+ class extends HybridPage {
31
+ static get prerender(): boolean {
32
+ return !isSSR();
33
+ }
20
34
 
21
- export class Page extends HybridPage {
22
- static get prerender(): boolean {
23
- return !isSSR();
24
- }
35
+ static async getStaticPaths(): Promise<Array<{ params: RouteParams; props: ResourceOwner }>> {
36
+ if (isSSR()) {
37
+ return [];
38
+ }
25
39
 
26
- static async getStaticPaths(): Promise<Array<{ params: any; props: any }>> {
27
- if (isSSR()) {
28
- return [];
40
+ const catalog = createResourcesCatalog();
41
+ const paths: Array<{ params: RouteParams; props: ResourceOwner }> = [];
42
+ for (const type of types) {
43
+ for (const owner of await getOwnersWithResources(type, catalog)) {
44
+ paths.push({ params: toParams(type, owner), props: owner });
45
+ }
46
+ }
47
+ return paths;
29
48
  }
30
49
 
31
- const owners = await Promise.all(SUPPORTED_TYPES.map((type) => loadResourceOwner(type)));
32
-
33
- return SUPPORTED_TYPES.flatMap((type, index) =>
34
- owners[index]
35
- .filter((owner) => hasResources(owner, type))
36
- .map((owner) => ({
37
- params: {
38
- type,
39
- id: owner.data.id,
40
- version: owner.data.version,
41
- },
42
- props: {
43
- ...owner,
44
- },
45
- }))
46
- );
47
- }
50
+ protected static async fetchData(params: RouteParams) {
51
+ const type = typeOf(params);
52
+ const { id, version } = params;
48
53
 
49
- protected static async fetchData(params: any) {
50
- const { type, id, version } = params;
54
+ if (!type || !id || !version || !types.includes(type as ResourceOwnerCollection)) {
55
+ return null;
56
+ }
51
57
 
52
- if (!type || !id || !version || !isSupportedType(type)) {
53
- return null;
58
+ return findOwnerWithResources(type as ResourceOwnerCollection, id, version);
54
59
  }
55
60
 
56
- const owners = await loadResourceOwner(type);
57
- const owner = owners.find((o) => o.data.id === id && o.data.version === version);
58
-
59
- if (!owner || !hasResources(owner, type)) {
60
- return null;
61
+ protected static createNotFoundResponse(): Response {
62
+ return new Response(null, {
63
+ status: 404,
64
+ statusText: 'Resources not found',
65
+ });
61
66
  }
67
+ };
62
68
 
63
- return {
64
- ...owner,
65
- };
66
- }
69
+ export const Page = createResourcesPage({
70
+ types: GENERIC_ROUTE_TYPES,
71
+ toParams: (type, owner) => ({ type, id: owner.data.id, version: owner.data.version }),
72
+ typeOf: (params) => params.type,
73
+ });
67
74
 
68
- protected static createNotFoundResponse(): Response {
69
- return new Response(null, {
70
- status: 404,
71
- statusText: 'Resources not found',
72
- });
73
- }
74
- }
75
+ export const ServicePage = createResourcesPage({
76
+ types: ['services'],
77
+ toParams: (_type, owner) => ({ id: owner.data.id, version: owner.data.version }),
78
+ typeOf: () => 'services',
79
+ });
@@ -1,71 +1,11 @@
1
1
  ---
2
- import Footer from '@layouts/Footer.astro';
3
- import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
4
- import { buildUrl } from '@utils/url-builder';
5
- import {
6
- SystemResourcesTable,
7
- type SystemResourceItem,
8
- type SystemResourceCollection,
9
- } from '@components/Tables/SystemResources/SystemResourcesTable';
10
- import { getResourceGroups, type ResourceOwnerCollection } from './_resources';
11
-
2
+ import ResourcesPage from './_ResourcesPage.astro';
12
3
  import { Page } from './_index.data';
13
4
 
14
5
  export const prerender = Page.prerender;
15
6
  export const getStaticPaths = Page.getStaticPaths;
16
7
 
17
8
  const resourceOwner = await Page.getData(Astro);
18
- const { data } = resourceOwner;
19
- const ownerCollection = resourceOwner.collection as ResourceOwnerCollection;
20
-
21
- // Only show resources directly attached to this system/domain. Domain child resources
22
- // are not flattened, so services inside a child system remain on that system's page.
23
- const resourceGroups = getResourceGroups(data, ownerCollection);
24
-
25
- const hrefForResource = (collection: SystemResourceCollection, id: string, version: string) => {
26
- if (collection === 'entities') {
27
- return buildUrl(`/docs/entities/${id}/${version}`);
28
- }
29
- return buildUrl(`/docs/${collection}/${id}/${version}`);
30
- };
31
-
32
- const ownerTypeLabel = ownerCollection === 'domains' ? 'Domain' : 'System';
33
-
34
- const resources: SystemResourceItem[] = resourceGroups.flatMap(({ collection, items }) =>
35
- items.map((item: any) => ({
36
- collection,
37
- id: item.data.id,
38
- name: item.data.name || item.data.id,
39
- version: item.data.version,
40
- summary: item.data.summary,
41
- icon: item.data?.styles?.icon,
42
- href: hrefForResource(collection, item.data.id, item.data.version),
43
- }))
44
- );
45
9
  ---
46
10
 
47
- <VerticalSideBarLayout title={`${data.name} | Resources`}>
48
- <main class="flex docs-layout min-h-full bg-[rgb(var(--ec-page-bg))]">
49
- <div class="flex docs-layout w-full">
50
- <div class="w-full min-w-0 lg:mr-2 xl:pr-12 py-8 bg-[rgb(var(--ec-page-bg))]">
51
- {/* Header mirrors the resource page (docs/[type]/[id]/[version]/index.astro). */}
52
- <div class="border-b border-[rgb(var(--ec-page-border))] md:pb-3 pt-4">
53
- <div class="flex flex-col gap-4">
54
- <span class="text-xs md:text-sm font-semibold text-[rgb(var(--ec-accent))] capitalize">{ownerTypeLabel}</span>
55
- <h2 id="doc-page-header" class="text-2xl md:text-4xl font-bold text-[rgb(var(--ec-page-text))]">
56
- {data.name} Resources
57
- </h2>
58
- </div>
59
- <p class="text-base pt-4 pb-1 text-[rgb(var(--ec-page-text-muted))] font-light">
60
- {resources.length} {resources.length === 1 ? 'resource' : 'resources'} mapped to the {data.name}{' '}
61
- {ownerTypeLabel.toLowerCase()}.
62
- </p>
63
- </div>
64
-
65
- <div class="pt-8 pb-4 w-full">
66
- <SystemResourcesTable resources={resources} client:only="react" />
67
- </div>
68
- </div>
69
- </div>
70
- </main>
71
- </VerticalSideBarLayout>
11
+ <ResourcesPage resourceOwner={resourceOwner} />
@@ -17,7 +17,7 @@ const redirectUrl = buildUrl(pathname + '/' + props.data.latestVersion, false, t
17
17
  <!doctype html>
18
18
  <html lang="en">
19
19
  <head>
20
- <Seo title={`EventCatalog | ${pageTitle}`} ogTitle={pageTitle} />
20
+ <Seo title={pageTitle} />
21
21
  </head>
22
22
  <body>
23
23
  <p>You are being redirected to <a href={redirectUrl}>{redirectUrl}</a></p>
@@ -0,0 +1,13 @@
1
+ ---
2
+ // Services need their own Resources route: /docs/services/[id]/[docType]/[docId] outranks
3
+ // the generic /docs/[type]/[id]/[version]/resources route and would catch these URLs.
4
+ import ResourcesPage from '../../../../[type]/[id]/[version]/resources/_ResourcesPage.astro';
5
+ import { ServicePage } from '../../../../[type]/[id]/[version]/resources/_index.data';
6
+
7
+ export const prerender = ServicePage.prerender;
8
+ export const getStaticPaths = ServicePage.getStaticPaths;
9
+
10
+ const resourceOwner = await ServicePage.getData(Astro);
11
+ ---
12
+
13
+ <ResourcesPage resourceOwner={resourceOwner} />
@@ -60,7 +60,7 @@ if (config.landingPage) {
60
60
 
61
61
  {
62
62
  CustomContent ? (
63
- <VerticalSideBarLayout title="EventCatalog" reducedContentPadding>
63
+ <VerticalSideBarLayout reducedContentPadding>
64
64
  <main class="flex docs-layout h-full">
65
65
  <div class="flex docs-layout w-full">
66
66
  <div class="w-full overflow-y-auto py-8">
@@ -11,7 +11,7 @@ export const getStaticPaths = Page.getStaticPaths;
11
11
  const { schemas } = await Page.getData(Astro);
12
12
  ---
13
13
 
14
- <VerticalSideBarLayout title="Schema Explorer - EventCatalog" showNestedSideBar={false}>
14
+ <VerticalSideBarLayout title="Schema Explorer" showNestedSideBar={false}>
15
15
  <style is:global>
16
16
  .react-flow__attribution {
17
17
  display: none;
@@ -53,7 +53,7 @@ const redirectUrl = buildUrl(pathname + '/' + props.data.latestVersion, false, t
53
53
  <!doctype html>
54
54
  <html lang="en">
55
55
  <head>
56
- <Seo title={`EventCatalog | ${pageTitle}`} ogTitle={pageTitle} />
56
+ <Seo title={pageTitle} />
57
57
  </head>
58
58
  <body>
59
59
  <p>You are being redirected to <a href={redirectUrl}>{redirectUrl}</a></p>
@@ -11,6 +11,7 @@ import {
11
11
  buildDiagramNavItems,
12
12
  buildResourceDocsSection,
13
13
  buildArchitectureDecisionsSection,
14
+ buildResourcesLink,
14
15
  } from './shared';
15
16
  import { isVisualiserEnabled, isChangelogEnabled } from '@utils/feature';
16
17
  import { pluralizeMessageType } from '@utils/collections/messages';
@@ -131,19 +132,6 @@ export const buildDomainSections = (
131
132
  const sortedReceivesMessages = [...receivesMessages].sort(byResourceName);
132
133
  const renderMessages = shouldRenderSideBarSection(domain, 'messages');
133
134
 
134
- // The Resources page/link only makes sense when the domain has direct resources.
135
- // Keep this aligned with the resource groups rendered by the page.
136
- const hasResources =
137
- subDomains.length > 0 ||
138
- systemsInDomain.length > 0 ||
139
- agentsInDomain.length > 0 ||
140
- dataProductsInDomain.length > 0 ||
141
- allServicesInDomain.length > 0 ||
142
- domainFlows.length > 0 ||
143
- entitiesInDomain.length > 0 ||
144
- sendsMessages.length > 0 ||
145
- receivesMessages.length > 0;
146
-
147
135
  // Diagrams
148
136
  const domainDiagrams = domain.data.diagrams || [];
149
137
  const diagramNavItems = buildDiagramNavItems(domainDiagrams, context.diagrams);
@@ -223,10 +211,7 @@ export const buildDomainSections = (
223
211
  'quick-reference': buildQuickReferenceSection(
224
212
  [
225
213
  { title: 'Overview', href: buildUrl(`/docs/domains/${domain.data.id}/${domain.data.version}`) },
226
- hasResources && {
227
- title: 'Domain Resources',
228
- href: buildUrl(`/docs/domains/${domain.data.id}/${domain.data.version}/resources`),
229
- },
214
+ buildResourcesLink(context, 'domains', domain.data.id, domain.data.version),
230
215
  renderUbiquitousLanguage && {
231
216
  title: 'Ubiquitous Language',
232
217
  href: buildUrl(`/docs/domains/${domain.data.id}/language`),
@@ -239,31 +224,28 @@ export const buildDomainSections = (
239
224
  ].filter(Boolean) as { title: string; href: string }[]
240
225
  ),
241
226
  documentation: docsSection,
242
- architecture: {
243
- type: 'group',
244
- title: 'Architecture',
245
- icon: 'Workflow',
246
- pages: [
247
- {
248
- type: 'item',
249
- title: 'Overview',
250
- href: buildUrl(`/architecture/domains/${domain.data.id}/${domain.data.version}`),
251
- },
252
- // The domain's diagram, with levels from the domains it talks to down to
253
- // its messages
254
- renderVisualiser && {
255
- type: 'item',
256
- title: 'Diagram',
257
- href: buildUrl(`/visualiser/domains/${domain.data.id}/${domain.data.version}`),
258
- },
259
- renderEntities &&
260
- renderVisualiser && {
261
- type: 'item',
262
- title: 'Entity Diagram',
263
- href: buildUrl(`/visualiser/domains/${domain.data.id}/${domain.data.version}/entity-map`),
264
- },
265
- ].filter(Boolean) as ChildRef[],
266
- },
227
+ // Every Architecture link is a visualiser view, so the group is left out when the visualiser is off.
228
+ architecture: renderVisualiser
229
+ ? {
230
+ type: 'group',
231
+ title: 'Architecture',
232
+ icon: 'Workflow',
233
+ pages: [
234
+ // The domain's diagram, with levels from the domains it talks to down to
235
+ // its messages
236
+ {
237
+ type: 'item',
238
+ title: 'Diagram',
239
+ href: buildUrl(`/visualiser/domains/${domain.data.id}/${domain.data.version}`),
240
+ },
241
+ renderEntities && {
242
+ type: 'item',
243
+ title: 'Entity Diagram',
244
+ href: buildUrl(`/visualiser/domains/${domain.data.id}/${domain.data.version}/entity-map`),
245
+ },
246
+ ].filter(Boolean) as ChildRef[],
247
+ }
248
+ : null,
267
249
  diagrams: hasDiagrams
268
250
  ? {
269
251
  type: 'group',
@@ -6,6 +6,7 @@ import {
6
6
  buildResourceDocsSection,
7
7
  shouldRenderSideBarSection,
8
8
  buildArchitectureDecisionsSection,
9
+ buildResourcesLink,
9
10
  } from './shared';
10
11
  import { isChangelogEnabled } from '@utils/feature';
11
12
  import { createVersionedMap, findInMap } from '@utils/collections/util';
@@ -157,6 +158,7 @@ export const buildFlowSections = (flow: CollectionEntry<'flows'>, context: Resou
157
158
  'quick-reference': buildQuickReferenceSection(
158
159
  [
159
160
  { title: 'Overview', href: buildUrl(`/docs/flows/${flow.data.id}/${flow.data.version}`) },
161
+ buildResourcesLink(context, 'flows', flow.data.id, flow.data.version),
160
162
  isChangelogEnabled() &&
161
163
  shouldRenderSideBarSection(flow, 'changelog') && {
162
164
  title: 'Changelog',
@@ -11,6 +11,7 @@ import {
11
11
  buildDiagramNavItems,
12
12
  buildResourceDocsSection,
13
13
  buildArchitectureDecisionsSection,
14
+ buildResourcesLink,
14
15
  } from './shared';
15
16
  import { isVisualiserEnabled, isChangelogEnabled } from '@utils/feature';
16
17
  import { iconFieldsForResource } from '@utils/icon';
@@ -137,6 +138,7 @@ export const buildMessageSections = (
137
138
  title: 'Overview',
138
139
  href: buildUrl(`/docs/${collection}/${message.data.id}/${message.data.version}`),
139
140
  },
141
+ buildResourcesLink(context, collection, message.data.id, message.data.version),
140
142
  isChangelogEnabled() &&
141
143
  shouldRenderSideBarSection(message, 'changelog') && {
142
144
  title: 'Changelog',
@@ -13,6 +13,7 @@ import {
13
13
  buildDiagramNavItems,
14
14
  buildResourceDocsSection,
15
15
  buildArchitectureDecisionsSection,
16
+ buildResourcesLink,
16
17
  } from './shared';
17
18
  import { isVisualiserEnabled, isChangelogEnabled } from '@utils/feature';
18
19
  import { pluralizeMessageType } from '@utils/collections/messages';
@@ -98,6 +99,7 @@ export const buildServiceSections = (
98
99
  const hasAttachments = service.data.attachments && service.data.attachments.length > 0;
99
100
 
100
101
  const hasDataStores = dataStoresInService.length > 0;
102
+
101
103
  const resourceGroups = service.data.resourceGroups || [];
102
104
  const hasResourceGroups = resourceGroups.length > 0;
103
105
 
@@ -126,6 +128,7 @@ export const buildServiceSections = (
126
128
  'quick-reference': buildQuickReferenceSection(
127
129
  [
128
130
  { title: 'Overview', href: buildUrl(docsBasePath) },
131
+ buildResourcesLink(context, 'services', service.data.id, service.data.version),
129
132
  isChangelogEnabled() &&
130
133
  shouldRenderSideBarSection(service, 'changelog') && {
131
134
  title: 'Changelog',
@@ -134,29 +137,26 @@ export const buildServiceSections = (
134
137
  ].filter(Boolean) as { title: string; href: string }[]
135
138
  ),
136
139
  documentation: docsSection,
137
- architecture: {
138
- type: 'group',
139
- title: 'Architecture',
140
- icon: 'Workflow',
141
- pages: [
142
- {
143
- type: 'item',
144
- title: 'Overview',
145
- href: buildUrl(`/architecture/services/${service.data.id}/${service.data.version}`),
146
- },
147
- renderVisualiser && {
148
- type: 'item',
149
- title: 'Diagram',
150
- href: buildUrl(`/visualiser/services/${service.data.id}/${service.data.version}`),
151
- },
152
- renderVisualiser &&
153
- renderEntities && {
154
- type: 'item',
155
- title: 'Entity Diagram',
156
- href: buildUrl(`/visualiser/services/${service.data.id}/${service.data.version}/entity-map`),
157
- },
158
- ].filter(Boolean) as ChildRef[],
159
- },
140
+ // Every Architecture link is a visualiser view, so the group is left out when the visualiser is off.
141
+ architecture: renderVisualiser
142
+ ? {
143
+ type: 'group',
144
+ title: 'Architecture',
145
+ icon: 'Workflow',
146
+ pages: [
147
+ {
148
+ type: 'item',
149
+ title: 'Diagram',
150
+ href: buildUrl(`/visualiser/services/${service.data.id}/${service.data.version}`),
151
+ },
152
+ renderEntities && {
153
+ type: 'item',
154
+ title: 'Entity Diagram',
155
+ href: buildUrl(`/visualiser/services/${service.data.id}/${service.data.version}/entity-map`),
156
+ },
157
+ ].filter(Boolean) as ChildRef[],
158
+ }
159
+ : null,
160
160
  diagrams: hasDiagrams
161
161
  ? {
162
162
  type: 'group',
@@ -79,8 +79,21 @@ export type ResourceGroupContext = {
79
79
  teams?: CollectionEntry<'teams'>[];
80
80
  resourceDocs: ResourceDocEntry[];
81
81
  resourceDocCategories: ResourceDocCategoryEntry[];
82
+ /** `collection:id:version` of every resource with a Resources page (see getResourcesPageKeys). */
83
+ resourcesPages?: Set<string>;
82
84
  };
83
85
 
86
+ /** The Quick Reference link to a resource's Resources page, when it has one. */
87
+ export const buildResourcesLink = (
88
+ context: Pick<ResourceGroupContext, 'resourcesPages'>,
89
+ collection: string,
90
+ id: string,
91
+ version: string
92
+ ) =>
93
+ context.resourcesPages?.has(`${collection}:${id}:${version}`)
94
+ ? { title: 'Resources', href: buildUrl(`/docs/${collection}/${id}/${version}/resources`) }
95
+ : false;
96
+
84
97
  export const buildQuickReferenceSection = (items: { title: string; href: string }[]): NavNode => ({
85
98
  type: 'group',
86
99
  title: 'Quick Reference',
@@ -10,6 +10,7 @@ import {
10
10
  buildDiagramNavItems,
11
11
  buildResourceDocsSection,
12
12
  buildArchitectureDecisionsSection,
13
+ buildResourcesLink,
13
14
  } from './shared';
14
15
  import { isChangelogEnabled, isVisualiserEnabled } from '@utils/feature';
15
16
  import { customIconFieldsForResource } from '@utils/icon';
@@ -74,11 +75,6 @@ export const buildSystemSections = (
74
75
  const containersInSystem = [...(system.data.containers || [])].sort(byResourceName);
75
76
  const renderContainers = containersInSystem.length > 0 && shouldRenderSideBarSection(system, 'containers');
76
77
 
77
- // The Resources page/link only makes sense when the system actually has resources
78
- // attached (services, flows, entities or data stores). Mirrors what the page renders.
79
- const hasResources =
80
- servicesInSystem.length > 0 || flowsInSystem.length > 0 || entitiesInSystem.length > 0 || containersInSystem.length > 0;
81
-
82
78
  const systemDiagrams = system.data.diagrams || [];
83
79
  const diagramNavItems = buildDiagramNavItems(systemDiagrams, context.diagrams);
84
80
  const hasDiagrams = diagramNavItems.length > 0 && shouldRenderSideBarSection(system, 'diagrams');
@@ -138,10 +134,7 @@ export const buildSystemSections = (
138
134
  title: 'Overview',
139
135
  href: buildUrl(`/docs/systems/${system.data.id}/${system.data.version}`),
140
136
  },
141
- hasResources && {
142
- title: 'System Resources',
143
- href: buildUrl(`/docs/systems/${system.data.id}/${system.data.version}/resources`),
144
- },
137
+ buildResourcesLink(context, 'systems', system.data.id, system.data.version),
145
138
  isChangelogEnabled() &&
146
139
  shouldRenderSideBarSection(system, 'changelog') && {
147
140
  title: 'Changelog',
@@ -150,24 +143,22 @@ export const buildSystemSections = (
150
143
  ].filter(Boolean) as { title: string; href: string }[]
151
144
  ),
152
145
  documentation: docsSection,
153
- architecture: {
154
- type: 'group',
155
- title: 'Architecture',
156
- icon: 'Workflow',
157
- pages: [
158
- {
159
- type: 'item',
160
- title: 'Overview',
161
- href: buildUrl(`/architecture/systems/${system.data.id}/${system.data.version}`),
162
- },
163
- // The system's diagram, with levels from its context down to its messages
164
- renderVisualiser && {
165
- type: 'item',
166
- title: 'Diagram',
167
- href: buildUrl(`/visualiser/systems/${system.data.id}/${system.data.version}`),
168
- },
169
- ].filter(Boolean) as ChildRef[],
170
- },
146
+ // Every Architecture link is a visualiser view, so the group is left out when the visualiser is off.
147
+ architecture: renderVisualiser
148
+ ? {
149
+ type: 'group',
150
+ title: 'Architecture',
151
+ icon: 'Workflow',
152
+ pages: [
153
+ // The system's diagram, with levels from its context down to its messages
154
+ {
155
+ type: 'item',
156
+ title: 'Diagram',
157
+ href: buildUrl(`/visualiser/systems/${system.data.id}/${system.data.version}`),
158
+ },
159
+ ],
160
+ }
161
+ : null,
171
162
  diagrams: hasDiagrams
172
163
  ? {
173
164
  type: 'group',
@@ -38,9 +38,11 @@ import { iconFieldsForResource } from '@utils/icon';
38
38
  import {
39
39
  buildQuickReferenceSection,
40
40
  buildResourceDocsSection,
41
+ buildResourcesLink,
41
42
  shouldRenderSideBarSection,
42
43
  withArchitectureDecisionsSection,
43
44
  } from './builders/shared';
45
+ import { getResourcesPageKeys } from '@utils/collections/resource-owners';
44
46
  import { isArchitectureGraphEnabled, isChangelogEnabled } from '@utils/feature';
45
47
  import { collectMessageIdsWithFieldUsage } from '@utils/collections/field-usage';
46
48
 
@@ -355,6 +357,8 @@ export const getNestedSideBarData = async (): Promise<NavigationData> => {
355
357
  teams,
356
358
  resourceDocs,
357
359
  resourceDocCategories,
360
+ // Same rule the Resources pages are built from, so a link never points at a missing page.
361
+ resourcesPages: await getResourcesPageKeys(),
358
362
  };
359
363
 
360
364
  // Process all domains with their owners first (async)
@@ -801,6 +805,7 @@ export const getNestedSideBarData = async (): Promise<NavigationData> => {
801
805
  title: 'Overview',
802
806
  href: buildUrl(`/docs/${channel.collection}/${channel.data.id}/${channel.data.version}`),
803
807
  },
808
+ buildResourcesLink(context, 'channels', channel.data.id, channel.data.version),
804
809
  isChangelogEnabled() &&
805
810
  shouldRenderSideBarSection(channel, 'changelog') && {
806
811
  title: 'Changelog',
@@ -171,7 +171,7 @@
171
171
  * scanning, so we explicitly declare them here.
172
172
  *
173
173
  * Colors used: orange, blue, green, emerald, amber, violet, pink, purple, gray, yellow, teal, cyan, indigo
174
- * Used in: SchemaListItem, Grids/components, SchemaExplorer, MessageGrid
174
+ * Used in: SchemaListItem, SchemaExplorer
175
175
  */
176
176
  @source inline("bg-{orange,blue,green,emerald,amber,violet,pink,purple,gray,yellow,teal,cyan,indigo}-{50,100}");
177
177
  @source inline("bg-{orange,blue,green,emerald,amber,violet,pink,purple,gray,yellow,teal,cyan,indigo}-500/{10,20}");
@@ -180,7 +180,7 @@
180
180
  @source inline("ring-2");
181
181
  @source inline("ring-{orange,blue,green,emerald,amber,violet,pink,purple,gray,yellow,teal,cyan,indigo}-500");
182
182
 
183
- /* Border color variants for MessageGrid cards */
183
+ /* Border color variants built at runtime (e.g. hover borders in MessageTableColumns) */
184
184
  @source inline("border-{orange,blue,green,emerald,amber,violet,pink,purple,gray,yellow,teal,cyan,indigo}-{200,300}");
185
185
  @source inline("{dark:,}border-{orange,blue,green,emerald,amber,violet,pink,purple,gray,yellow,teal,cyan,indigo}-500/{30,50}");
186
186
  @source inline("{hover:,dark:hover:,}border-{orange,blue,green,emerald,amber,violet,pink,purple,gray,yellow,teal,cyan,indigo}-{300,400,500,500/50}");
@@ -12,3 +12,13 @@ declare module 'react-syntax-highlighter' {
12
12
  }
13
13
 
14
14
  declare module 'react-syntax-highlighter/dist/esm/styles/prism/material-light';
15
+
16
+ declare module 'react-syntax-highlighter/dist/cjs/create-element.js' {
17
+ import type { CSSProperties } from 'react';
18
+
19
+ export function createStyleObject(
20
+ classNames: string[],
21
+ elementStyle?: CSSProperties,
22
+ stylesheet?: { [selector: string]: CSSProperties }
23
+ ): CSSProperties;
24
+ }