@eventcatalog/core 3.28.1 → 3.28.3

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 (29) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/{chunk-622JYJWG.js → chunk-7OY7QEH2.js} +10 -8
  6. package/dist/{chunk-R3IIK7T4.js → chunk-JLGWTWR4.js} +1 -1
  7. package/dist/{chunk-XODNVUAL.js → chunk-KP324TGM.js} +1 -1
  8. package/dist/{chunk-6S2Y7MMY.js → chunk-L36OEOCB.js} +1 -1
  9. package/dist/{chunk-6D46L7XV.js → chunk-LLC66YM2.js} +1 -1
  10. package/dist/{chunk-OLXBO763.js → chunk-SBZBCN3T.js} +1 -1
  11. package/dist/{chunk-BH3JMNAV.js → chunk-YX57AREF.js} +1 -1
  12. package/dist/constants.cjs +1 -1
  13. package/dist/constants.js +1 -1
  14. package/dist/eventcatalog.cjs +11 -9
  15. package/dist/eventcatalog.js +7 -7
  16. package/dist/generate.cjs +1 -1
  17. package/dist/generate.js +3 -3
  18. package/dist/migrations/index.cjs +10 -8
  19. package/dist/migrations/index.js +2 -2
  20. package/dist/migrations/message-channels-to-service-channels.cjs +10 -8
  21. package/dist/migrations/message-channels-to-service-channels.js +1 -1
  22. package/dist/utils/cli-logger.cjs +1 -1
  23. package/dist/utils/cli-logger.js +2 -2
  24. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId].md.ts +75 -0
  25. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId].mdx.ts +75 -0
  26. package/eventcatalog/src/pages/docs/llm/llms-full.txt.ts +6 -3
  27. package/eventcatalog/src/pages/docs/llm/llms.txt.ts +34 -1
  28. package/eventcatalog/src/utils/node-graphs/flows-node-graph.ts +33 -4
  29. package/package.json +2 -2
@@ -37,7 +37,7 @@ var import_axios = __toESM(require("axios"), 1);
37
37
  var import_os = __toESM(require("os"), 1);
38
38
 
39
39
  // package.json
40
- var version = "3.28.1";
40
+ var version = "3.28.3";
41
41
 
42
42
  // src/constants.ts
43
43
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-OLXBO763.js";
4
- import "../chunk-6S2Y7MMY.js";
3
+ } from "../chunk-SBZBCN3T.js";
4
+ import "../chunk-L36OEOCB.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -111,7 +111,7 @@ var import_axios = __toESM(require("axios"), 1);
111
111
  var import_os = __toESM(require("os"), 1);
112
112
 
113
113
  // package.json
114
- var version = "3.28.1";
114
+ var version = "3.28.3";
115
115
 
116
116
  // src/constants.ts
117
117
  var VERSION = version;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-R3IIK7T4.js";
4
- import "../chunk-OLXBO763.js";
3
+ } from "../chunk-JLGWTWR4.js";
4
+ import "../chunk-SBZBCN3T.js";
5
5
  import "../chunk-4UVFXLPI.js";
6
- import "../chunk-6S2Y7MMY.js";
6
+ import "../chunk-L36OEOCB.js";
7
7
  import "../chunk-5T63CXKU.js";
8
8
  export {
9
9
  log_build_default as default
@@ -79,14 +79,16 @@ var message_channels_to_service_channels_default = async (dir) => {
79
79
  const messagesTheServiceSendsThatNeedUpdating = data.sends?.filter((send) => messagesWithChannels.some((message) => message.id === send.id)) ?? [];
80
80
  const messagesTheServiceReceivesThatNeedUpdating = data.receives?.filter((receive) => messagesWithChannels.some((message) => message.id === receive.id)) ?? [];
81
81
  if (messagesTheServiceSendsThatNeedUpdating.length > 0 || messagesTheServiceReceivesThatNeedUpdating.length > 0) {
82
- const newSends = messagesTheServiceSendsThatNeedUpdating.map((send) => ({
83
- ...send,
84
- to: messagesWithChannels.map((message) => message.id === send.id ? message.channels : []).flat().filter((channel) => channel !== null)
85
- }));
86
- const newReceives = messagesTheServiceReceivesThatNeedUpdating.map((receive) => ({
87
- ...receive,
88
- from: messagesWithChannels.map((message) => message.id === receive.id ? message.channels : []).flat().filter((channel) => channel !== null)
89
- }));
82
+ const newSends = (data.sends ?? []).map((send) => {
83
+ const match = messagesWithChannels.find((message) => message.id === send.id);
84
+ if (!match) return send;
85
+ return { ...send, to: (match.channels ?? []).filter((channel) => channel !== null) };
86
+ });
87
+ const newReceives = (data.receives ?? []).map((receive) => {
88
+ const match = messagesWithChannels.find((message) => message.id === receive.id);
89
+ if (!match) return receive;
90
+ return { ...receive, from: (match.channels ?? []).filter((channel) => channel !== null) };
91
+ });
90
92
  const newData = {
91
93
  ...data,
92
94
  ...newSends.length > 0 ? { sends: newSends } : {},
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-OLXBO763.js";
3
+ } from "./chunk-SBZBCN3T.js";
4
4
  import {
5
5
  countResources,
6
6
  serializeCounts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-6D46L7XV.js";
3
+ } from "./chunk-LLC66YM2.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "3.28.1";
2
+ var version = "3.28.3";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-6S2Y7MMY.js";
3
+ } from "./chunk-L36OEOCB.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-6S2Y7MMY.js";
3
+ } from "./chunk-L36OEOCB.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  message_channels_to_service_channels_default
3
- } from "./chunk-622JYJWG.js";
3
+ } from "./chunk-7OY7QEH2.js";
4
4
 
5
5
  // src/migrations/index.ts
6
6
  var runMigrations = async (dir) => {
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "3.28.1";
28
+ var version = "3.28.3";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-6S2Y7MMY.js";
3
+ } from "./chunk-L36OEOCB.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -114,7 +114,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
114
114
  var import_picocolors = __toESM(require("picocolors"), 1);
115
115
 
116
116
  // package.json
117
- var version = "3.28.1";
117
+ var version = "3.28.3";
118
118
 
119
119
  // src/constants.ts
120
120
  var VERSION = version;
@@ -669,14 +669,16 @@ var message_channels_to_service_channels_default = async (dir2) => {
669
669
  const messagesTheServiceSendsThatNeedUpdating = data.sends?.filter((send) => messagesWithChannels.some((message) => message.id === send.id)) ?? [];
670
670
  const messagesTheServiceReceivesThatNeedUpdating = data.receives?.filter((receive) => messagesWithChannels.some((message) => message.id === receive.id)) ?? [];
671
671
  if (messagesTheServiceSendsThatNeedUpdating.length > 0 || messagesTheServiceReceivesThatNeedUpdating.length > 0) {
672
- const newSends = messagesTheServiceSendsThatNeedUpdating.map((send) => ({
673
- ...send,
674
- to: messagesWithChannels.map((message) => message.id === send.id ? message.channels : []).flat().filter((channel) => channel !== null)
675
- }));
676
- const newReceives = messagesTheServiceReceivesThatNeedUpdating.map((receive) => ({
677
- ...receive,
678
- from: messagesWithChannels.map((message) => message.id === receive.id ? message.channels : []).flat().filter((channel) => channel !== null)
679
- }));
672
+ const newSends = (data.sends ?? []).map((send) => {
673
+ const match = messagesWithChannels.find((message) => message.id === send.id);
674
+ if (!match) return send;
675
+ return { ...send, to: (match.channels ?? []).filter((channel) => channel !== null) };
676
+ });
677
+ const newReceives = (data.receives ?? []).map((receive) => {
678
+ const match = messagesWithChannels.find((message) => message.id === receive.id);
679
+ if (!match) return receive;
680
+ return { ...receive, from: (match.channels ?? []).filter((channel) => channel !== null) };
681
+ });
680
682
  const newData = {
681
683
  ...data,
682
684
  ...newSends.length > 0 ? { sends: newSends } : {},
@@ -6,13 +6,13 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-R3IIK7T4.js";
10
- import "./chunk-OLXBO763.js";
9
+ } from "./chunk-JLGWTWR4.js";
10
+ import "./chunk-SBZBCN3T.js";
11
11
  import "./chunk-4UVFXLPI.js";
12
12
  import {
13
13
  runMigrations
14
- } from "./chunk-BH3JMNAV.js";
15
- import "./chunk-622JYJWG.js";
14
+ } from "./chunk-YX57AREF.js";
15
+ import "./chunk-7OY7QEH2.js";
16
16
  import {
17
17
  catalogToAstro
18
18
  } from "./chunk-YDXB3BD2.js";
@@ -22,13 +22,13 @@ import {
22
22
  } from "./chunk-3KXCGYET.js";
23
23
  import {
24
24
  generate
25
- } from "./chunk-XODNVUAL.js";
25
+ } from "./chunk-KP324TGM.js";
26
26
  import {
27
27
  logger
28
- } from "./chunk-6D46L7XV.js";
28
+ } from "./chunk-LLC66YM2.js";
29
29
  import {
30
30
  VERSION
31
- } from "./chunk-6S2Y7MMY.js";
31
+ } from "./chunk-L36OEOCB.js";
32
32
  import {
33
33
  getEventCatalogConfigFile,
34
34
  verifyRequiredFieldsAreInCatalogConfigFile
package/dist/generate.cjs CHANGED
@@ -78,7 +78,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
78
78
  var import_picocolors = __toESM(require("picocolors"), 1);
79
79
 
80
80
  // package.json
81
- var version = "3.28.1";
81
+ var version = "3.28.3";
82
82
 
83
83
  // src/constants.ts
84
84
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-XODNVUAL.js";
4
- import "./chunk-6D46L7XV.js";
5
- import "./chunk-6S2Y7MMY.js";
3
+ } from "./chunk-KP324TGM.js";
4
+ import "./chunk-LLC66YM2.js";
5
+ import "./chunk-L36OEOCB.js";
6
6
  import "./chunk-5T63CXKU.js";
7
7
  export {
8
8
  generate
@@ -115,14 +115,16 @@ var message_channels_to_service_channels_default = async (dir) => {
115
115
  const messagesTheServiceSendsThatNeedUpdating = data.sends?.filter((send) => messagesWithChannels.some((message) => message.id === send.id)) ?? [];
116
116
  const messagesTheServiceReceivesThatNeedUpdating = data.receives?.filter((receive) => messagesWithChannels.some((message) => message.id === receive.id)) ?? [];
117
117
  if (messagesTheServiceSendsThatNeedUpdating.length > 0 || messagesTheServiceReceivesThatNeedUpdating.length > 0) {
118
- const newSends = messagesTheServiceSendsThatNeedUpdating.map((send) => ({
119
- ...send,
120
- to: messagesWithChannels.map((message) => message.id === send.id ? message.channels : []).flat().filter((channel) => channel !== null)
121
- }));
122
- const newReceives = messagesTheServiceReceivesThatNeedUpdating.map((receive) => ({
123
- ...receive,
124
- from: messagesWithChannels.map((message) => message.id === receive.id ? message.channels : []).flat().filter((channel) => channel !== null)
125
- }));
118
+ const newSends = (data.sends ?? []).map((send) => {
119
+ const match = messagesWithChannels.find((message) => message.id === send.id);
120
+ if (!match) return send;
121
+ return { ...send, to: (match.channels ?? []).filter((channel) => channel !== null) };
122
+ });
123
+ const newReceives = (data.receives ?? []).map((receive) => {
124
+ const match = messagesWithChannels.find((message) => message.id === receive.id);
125
+ if (!match) return receive;
126
+ return { ...receive, from: (match.channels ?? []).filter((channel) => channel !== null) };
127
+ });
126
128
  const newData = {
127
129
  ...data,
128
130
  ...newSends.length > 0 ? { sends: newSends } : {},
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  runMigrations
3
- } from "../chunk-BH3JMNAV.js";
4
- import "../chunk-622JYJWG.js";
3
+ } from "../chunk-YX57AREF.js";
4
+ import "../chunk-7OY7QEH2.js";
5
5
  export {
6
6
  runMigrations
7
7
  };
@@ -113,14 +113,16 @@ var message_channels_to_service_channels_default = async (dir) => {
113
113
  const messagesTheServiceSendsThatNeedUpdating = data.sends?.filter((send) => messagesWithChannels.some((message) => message.id === send.id)) ?? [];
114
114
  const messagesTheServiceReceivesThatNeedUpdating = data.receives?.filter((receive) => messagesWithChannels.some((message) => message.id === receive.id)) ?? [];
115
115
  if (messagesTheServiceSendsThatNeedUpdating.length > 0 || messagesTheServiceReceivesThatNeedUpdating.length > 0) {
116
- const newSends = messagesTheServiceSendsThatNeedUpdating.map((send) => ({
117
- ...send,
118
- to: messagesWithChannels.map((message) => message.id === send.id ? message.channels : []).flat().filter((channel) => channel !== null)
119
- }));
120
- const newReceives = messagesTheServiceReceivesThatNeedUpdating.map((receive) => ({
121
- ...receive,
122
- from: messagesWithChannels.map((message) => message.id === receive.id ? message.channels : []).flat().filter((channel) => channel !== null)
123
- }));
116
+ const newSends = (data.sends ?? []).map((send) => {
117
+ const match = messagesWithChannels.find((message) => message.id === send.id);
118
+ if (!match) return send;
119
+ return { ...send, to: (match.channels ?? []).filter((channel) => channel !== null) };
120
+ });
121
+ const newReceives = (data.receives ?? []).map((receive) => {
122
+ const match = messagesWithChannels.find((message) => message.id === receive.id);
123
+ if (!match) return receive;
124
+ return { ...receive, from: (match.channels ?? []).filter((channel) => channel !== null) };
125
+ });
124
126
  const newData = {
125
127
  ...data,
126
128
  ...newSends.length > 0 ? { sends: newSends } : {},
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  message_channels_to_service_channels_default
3
- } from "../chunk-622JYJWG.js";
3
+ } from "../chunk-7OY7QEH2.js";
4
4
  export {
5
5
  message_channels_to_service_channels_default as default
6
6
  };
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "3.28.1";
39
+ var version = "3.28.3";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "../chunk-6D46L7XV.js";
4
- import "../chunk-6S2Y7MMY.js";
3
+ } from "../chunk-LLC66YM2.js";
4
+ import "../chunk-L36OEOCB.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -0,0 +1,75 @@
1
+ // Exposes the raw markdown for a resource doc.
2
+ // Example: /docs/services/OrdersService/1.0.0/adrs/01-some-decision.md
3
+ // Used by llms.txt so LLMs can fetch the markdown directly.
4
+
5
+ import type { APIRoute } from 'astro';
6
+ import fs from 'fs';
7
+ import { isLLMSTxtEnabled, isResourceDocsEnabled, isSSR } from '@utils/feature';
8
+ import { getResourceDocs, getResourceDocsForResource, type ResourceCollection } from '@utils/collections/resource-docs';
9
+
10
+ const supportedResourceCollections = new Set<ResourceCollection>([
11
+ 'domains',
12
+ 'services',
13
+ 'events',
14
+ 'commands',
15
+ 'queries',
16
+ 'flows',
17
+ 'containers',
18
+ 'channels',
19
+ 'entities',
20
+ 'data-products',
21
+ ]);
22
+
23
+ export async function getStaticPaths() {
24
+ if (isSSR() || !isLLMSTxtEnabled() || !isResourceDocsEnabled()) {
25
+ return [];
26
+ }
27
+
28
+ const docs = await getResourceDocs();
29
+ const latestDocs = docs.filter((doc) => doc.data.version === doc.data.latestVersion);
30
+
31
+ return latestDocs.map((doc) => ({
32
+ params: {
33
+ type: doc.data.resourceCollection,
34
+ id: doc.data.resourceId,
35
+ version: doc.data.resourceVersion,
36
+ docType: doc.data.type,
37
+ docId: doc.data.id,
38
+ },
39
+ props: { filePath: doc.filePath },
40
+ }));
41
+ }
42
+
43
+ export const GET: APIRoute = async ({ params, props }) => {
44
+ if (!isLLMSTxtEnabled()) {
45
+ return new Response('llms.txt is not enabled for this Catalog.', { status: 404 });
46
+ }
47
+
48
+ if (!isResourceDocsEnabled()) {
49
+ return new Response('Resource docs are not enabled for this Catalog.', { status: 404 });
50
+ }
51
+
52
+ let filePath = (props as { filePath?: string } | undefined)?.filePath;
53
+
54
+ if (!filePath && isSSR()) {
55
+ const type = params.type as ResourceCollection | undefined;
56
+ if (!type || !supportedResourceCollections.has(type)) {
57
+ return new Response('Not found', { status: 404 });
58
+ }
59
+ const docsForResource = await getResourceDocsForResource(type, params.id ?? '', params.version ?? '');
60
+ const doc = docsForResource.find(
61
+ (resourceDoc) =>
62
+ resourceDoc.data.type === params.docType &&
63
+ resourceDoc.data.id === params.docId &&
64
+ resourceDoc.data.version === resourceDoc.data.latestVersion
65
+ );
66
+ filePath = doc?.filePath;
67
+ }
68
+
69
+ if (!filePath) {
70
+ return new Response('Not found', { status: 404 });
71
+ }
72
+
73
+ const file = fs.readFileSync(filePath, 'utf8');
74
+ return new Response(file, { status: 200, headers: { 'Content-Type': 'text/markdown; charset=utf-8' } });
75
+ };
@@ -0,0 +1,75 @@
1
+ // Exposes the raw mdx for a resource doc.
2
+ // Example: /docs/services/OrdersService/1.0.0/adrs/01-some-decision.mdx
3
+ // Used by llms.txt so LLMs can fetch the markdown directly.
4
+
5
+ import type { APIRoute } from 'astro';
6
+ import fs from 'fs';
7
+ import { isLLMSTxtEnabled, isResourceDocsEnabled, isSSR } from '@utils/feature';
8
+ import { getResourceDocs, getResourceDocsForResource, type ResourceCollection } from '@utils/collections/resource-docs';
9
+
10
+ const supportedResourceCollections = new Set<ResourceCollection>([
11
+ 'domains',
12
+ 'services',
13
+ 'events',
14
+ 'commands',
15
+ 'queries',
16
+ 'flows',
17
+ 'containers',
18
+ 'channels',
19
+ 'entities',
20
+ 'data-products',
21
+ ]);
22
+
23
+ export async function getStaticPaths() {
24
+ if (isSSR() || !isLLMSTxtEnabled() || !isResourceDocsEnabled()) {
25
+ return [];
26
+ }
27
+
28
+ const docs = await getResourceDocs();
29
+ const latestDocs = docs.filter((doc) => doc.data.version === doc.data.latestVersion);
30
+
31
+ return latestDocs.map((doc) => ({
32
+ params: {
33
+ type: doc.data.resourceCollection,
34
+ id: doc.data.resourceId,
35
+ version: doc.data.resourceVersion,
36
+ docType: doc.data.type,
37
+ docId: doc.data.id,
38
+ },
39
+ props: { filePath: doc.filePath },
40
+ }));
41
+ }
42
+
43
+ export const GET: APIRoute = async ({ params, props }) => {
44
+ if (!isLLMSTxtEnabled()) {
45
+ return new Response('llms.txt is not enabled for this Catalog.', { status: 404 });
46
+ }
47
+
48
+ if (!isResourceDocsEnabled()) {
49
+ return new Response('Resource docs are not enabled for this Catalog.', { status: 404 });
50
+ }
51
+
52
+ let filePath = (props as { filePath?: string } | undefined)?.filePath;
53
+
54
+ if (!filePath && isSSR()) {
55
+ const type = params.type as ResourceCollection | undefined;
56
+ if (!type || !supportedResourceCollections.has(type)) {
57
+ return new Response('Not found', { status: 404 });
58
+ }
59
+ const docsForResource = await getResourceDocsForResource(type, params.id ?? '', params.version ?? '');
60
+ const doc = docsForResource.find(
61
+ (resourceDoc) =>
62
+ resourceDoc.data.type === params.docType &&
63
+ resourceDoc.data.id === params.docId &&
64
+ resourceDoc.data.version === resourceDoc.data.latestVersion
65
+ );
66
+ filePath = doc?.filePath;
67
+ }
68
+
69
+ if (!filePath) {
70
+ return new Response('Not found', { status: 404 });
71
+ }
72
+
73
+ const file = fs.readFileSync(filePath, 'utf8');
74
+ return new Response(file, { status: 200, headers: { 'Content-Type': 'text/markdown; charset=utf-8' } });
75
+ };
@@ -1,7 +1,7 @@
1
1
  import { getCollection, type CollectionEntry } from 'astro:content';
2
2
  import type { APIRoute } from 'astro';
3
3
  import fs from 'fs';
4
- import { isCustomDocsEnabled } from '@utils/feature';
4
+ import { isCustomDocsEnabled, isResourceDocsEnabled, isLLMSTxtEnabled } from '@utils/feature';
5
5
  import { addSchemaToMarkdown } from '@utils/llms';
6
6
 
7
7
  type AllowedCollections =
@@ -30,8 +30,7 @@ const channels = await getCollection('channels');
30
30
  const flows = await getCollection('flows');
31
31
  const containers = await getCollection('containers');
32
32
  const customDocs = await getCollection('customPages');
33
-
34
- import { isLLMSTxtEnabled } from '@utils/feature';
33
+ const resourceDocs = isResourceDocsEnabled() ? await getCollection('resourceDocs') : [];
35
34
 
36
35
  export const GET: APIRoute = async ({ params, request }) => {
37
36
  if (!isLLMSTxtEnabled()) {
@@ -56,6 +55,10 @@ export const GET: APIRoute = async ({ params, request }) => {
56
55
  resources.push(...(customDocs as CollectionEntry<AllowedCollections>[]));
57
56
  }
58
57
 
58
+ if (isResourceDocsEnabled()) {
59
+ resources.push(...(resourceDocs as CollectionEntry<AllowedCollections>[]));
60
+ }
61
+
59
62
  const content = resources
60
63
  .map((item) => {
61
64
  if (!item.filePath) return '';
@@ -2,8 +2,9 @@ import { getCollection } from 'astro:content';
2
2
  import config from '@config';
3
3
  import type { APIRoute } from 'astro';
4
4
 
5
- import { isCustomDocsEnabled } from '@utils/feature';
5
+ import { isCustomDocsEnabled, isResourceDocsEnabled } from '@utils/feature';
6
6
  import { getUbiquitousLanguage } from '@utils/collections/domains';
7
+ import { getResourceDocs } from '@utils/collections/resource-docs';
7
8
 
8
9
  const events = await getCollection('events');
9
10
  const commands = await getCollection('commands');
@@ -22,6 +23,7 @@ const containers = await getCollection('containers');
22
23
  const entities = await getCollection('entities');
23
24
 
24
25
  const customDocs = await getCollection('customPages');
26
+ const resourceDocsList = isResourceDocsEnabled() ? await getResourceDocs() : [];
25
27
 
26
28
  const ubiquitousLanguages: Record<string, { id: string; version: string; properties: any }[]> = {};
27
29
 
@@ -94,6 +96,36 @@ export const GET: APIRoute = async ({ params, request }) => {
94
96
  const formatCustomDoc = (item: any, route: string) =>
95
97
  `- [${item.data.title}](${baseUrl}/${route}/${item.id.replace('docs\/', '')}.mdx) - ${item.data.summary || ''}`;
96
98
 
99
+ const formatResourceDoc = (doc: any) => {
100
+ const { resourceCollection, resourceId, resourceVersion, type, id } = doc.data;
101
+ const title = doc.data.title || id || doc.id;
102
+ const docUrl = `${baseUrl}/docs/${resourceCollection}/${resourceId}/${resourceVersion}/${type}/${id}.mdx`;
103
+ return `- [${title}](${docUrl})${doc.data.summary ? ` - ${doc.data.summary}` : ''}`;
104
+ };
105
+
106
+ const renderResourceDocs = () => {
107
+ const grouped = new Map<string, { resourceCollection: string; resourceId: string; resourceVersion: string; docs: any[] }>();
108
+
109
+ for (const doc of resourceDocsList) {
110
+ const { resourceCollection, resourceId, resourceVersion } = doc.data;
111
+ const key = `${resourceCollection}:${resourceId}:${resourceVersion}`;
112
+ let group = grouped.get(key);
113
+ if (!group) {
114
+ group = { resourceCollection, resourceId, resourceVersion, docs: [] };
115
+ grouped.set(key, group);
116
+ }
117
+ group.docs.push(doc);
118
+ }
119
+
120
+ return Array.from(grouped.values())
121
+ .map((group) => {
122
+ const parentUrl = `${baseUrl}/docs/${group.resourceCollection}/${group.resourceId}/${group.resourceVersion}.mdx`;
123
+ const heading = `### [${group.resourceId}](${parentUrl}) (${group.resourceCollection})`;
124
+ return [heading, group.docs.map(formatResourceDoc).join('\n')].join('\n');
125
+ })
126
+ .join('\n\n');
127
+ };
128
+
97
129
  const content = [
98
130
  `# ${config.organizationName} EventCatalog Documentation\n`,
99
131
  `> ${config.tagline}\n`,
@@ -127,6 +159,7 @@ export const GET: APIRoute = async ({ params, request }) => {
127
159
  ...(isCustomDocsEnabled()
128
160
  ? ['\n## Custom Docs', customDocs.map((item) => formatCustomDoc(item, 'docs/custom')).join('\n')]
129
161
  : []),
162
+ ...(isResourceDocsEnabled() && resourceDocsList.length > 0 ? ['\n## Resource Docs', renderResourceDocs()] : []),
130
163
  ].join('\n');
131
164
 
132
165
  return new Response(content, {
@@ -1,6 +1,13 @@
1
1
  import { getCollection, type CollectionEntry } from 'astro:content';
2
2
  import dagre from 'dagre';
3
- import { createDagreGraph, calculatedNodes, DEFAULT_NODE_WIDTH, DEFAULT_NODE_HEIGHT } from '@utils/node-graphs/utils/utils';
3
+ import {
4
+ createDagreGraph,
5
+ calculatedNodes,
6
+ DEFAULT_NODE_WIDTH,
7
+ DEFAULT_NODE_HEIGHT,
8
+ buildContextMenuForResource,
9
+ buildContextMenuForService,
10
+ } from '@utils/node-graphs/utils/utils';
4
11
  import { MarkerType } from '@xyflow/react';
5
12
  import type { Node as NodeType } from '@xyflow/react';
6
13
  import { createVersionedMap, findInMap } from '@utils/collections/util';
@@ -101,9 +108,31 @@ export const getNodesAndEdges = async ({ id, defaultFlow, version, mode = 'simpl
101
108
  type: step.type,
102
109
  } as NodeType;
103
110
 
104
- if (step.service) node.data.service = { ...step.service, ...step.service.data };
105
- if (step.flow) node.data.flow = { ...step.flow, ...step.flow.data };
106
- if (step.message) node.data.message = { ...step.message, ...step.message.data };
111
+ if (step.service) {
112
+ node.data.service = { ...step.service, ...step.service.data };
113
+ node.data.contextMenu = buildContextMenuForService({
114
+ id: step.service.data.id,
115
+ version: step.service.data.version,
116
+ specifications: step.service.data.specifications,
117
+ repository: step.service.data.repository,
118
+ });
119
+ }
120
+ if (step.flow) {
121
+ node.data.flow = { ...step.flow, ...step.flow.data };
122
+ node.data.contextMenu = buildContextMenuForResource({
123
+ collection: 'flows',
124
+ id: step.flow.data.id,
125
+ version: step.flow.data.version,
126
+ });
127
+ }
128
+ if (step.message) {
129
+ node.data.message = { ...step.message, ...step.message.data };
130
+ node.data.contextMenu = buildContextMenuForResource({
131
+ collection: step.message.collection,
132
+ id: step.message.data.id,
133
+ version: step.message.data.version,
134
+ });
135
+ }
107
136
  if (step.actor) {
108
137
  node.data.actor = { ...step.actor, ...step.actor.data };
109
138
  node.data = { ...node.data, ...step.actor };
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "SEE LICENSE IN LICENSE",
9
9
  "type": "module",
10
- "version": "3.28.1",
10
+ "version": "3.28.3",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
@@ -105,7 +105,7 @@
105
105
  "zod": "^4.3.6",
106
106
  "@eventcatalog/linter": "1.0.21",
107
107
  "@eventcatalog/sdk": "2.20.0",
108
- "@eventcatalog/visualiser": "^3.18.2"
108
+ "@eventcatalog/visualiser": "^3.18.4"
109
109
  },
110
110
  "devDependencies": {
111
111
  "@astrojs/check": "^0.9.8",