@eventcatalog/core 2.41.1 → 2.42.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-LJRN3X6I.js → chunk-BMQTJBZQ.js} +1 -1
- package/dist/{chunk-ZTIHRJ5F.js → chunk-TRONGJTE.js} +1 -1
- package/dist/{chunk-ZOHANGSK.js → chunk-V4HWGD4W.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.config.d.cts +5 -0
- package/dist/eventcatalog.config.d.ts +5 -0
- package/dist/eventcatalog.js +3 -3
- package/eventcatalog/src/components/SideBars/ChannelSideBar.astro +44 -1
- package/eventcatalog/src/pages/docs/llm/llms.txt.ts +1 -1
- package/eventcatalog/src/utils/collections/services.ts +27 -0
- package/eventcatalog/src/utils/node-graphs/utils/utils.ts +13 -11
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-BMQTJBZQ.js";
|
|
4
|
+
import "../chunk-V4HWGD4W.js";
|
|
5
|
+
import "../chunk-TRONGJTE.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
package/dist/eventcatalog.js
CHANGED
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
} from "./chunk-DCLTVJDP.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-BMQTJBZQ.js";
|
|
10
|
+
import "./chunk-V4HWGD4W.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro,
|
|
13
13
|
checkAndConvertMdToMdx
|
|
14
14
|
} from "./chunk-SLEMYHTU.js";
|
|
15
15
|
import {
|
|
16
16
|
VERSION
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TRONGJTE.js";
|
|
18
18
|
import {
|
|
19
19
|
isBackstagePluginEnabled,
|
|
20
20
|
isEventCatalogScaleEnabled,
|
|
@@ -8,7 +8,7 @@ import { buildUrl } from '@utils/url-builder';
|
|
|
8
8
|
import { ScrollText } from 'lucide-react';
|
|
9
9
|
import RepositoryList from '@components/Lists/RepositoryList.astro';
|
|
10
10
|
import { getOwner } from '@utils/collections/owners';
|
|
11
|
-
|
|
11
|
+
import { getProducersAndConsumersForChannel } from '@utils/collections/services';
|
|
12
12
|
interface Props {
|
|
13
13
|
channel: CollectionEntry<'channels'>;
|
|
14
14
|
}
|
|
@@ -18,6 +18,7 @@ const { channel } = Astro.props;
|
|
|
18
18
|
const ownersRaw = channel.data?.owners || [];
|
|
19
19
|
const owners = await Promise.all<ReturnType<typeof getOwner>>(ownersRaw.map(getOwner));
|
|
20
20
|
const filteredOwners = owners.filter((o) => o !== undefined);
|
|
21
|
+
const { producers, consumers } = await getProducersAndConsumersForChannel(channel);
|
|
21
22
|
|
|
22
23
|
const channelParameters: Record<string, { enum?: string[]; description?: string }> = channel.data.parameters || {};
|
|
23
24
|
const parameters = Object.keys(channelParameters).map((key) => ({
|
|
@@ -55,10 +56,52 @@ const messageList = (channel.data.messages ?? []).map((p) => ({
|
|
|
55
56
|
tag: `v${p.version}`,
|
|
56
57
|
href: buildUrl(`/docs/${p.collection}/${p.id}/${p.version}`),
|
|
57
58
|
}));
|
|
59
|
+
|
|
60
|
+
const producersList = producers.map((p) => ({
|
|
61
|
+
label: p.data.name,
|
|
62
|
+
badge: p.collection,
|
|
63
|
+
color: 'pink',
|
|
64
|
+
collection: p.collection,
|
|
65
|
+
tag: `v${p.data.version}`,
|
|
66
|
+
href: buildUrl(`/docs/${p.collection}/${p.data.id}/${p.data.version}`),
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
const consumersList = consumers.map((c) => ({
|
|
70
|
+
label: c.data.name,
|
|
71
|
+
badge: c.collection,
|
|
72
|
+
color: 'blue',
|
|
73
|
+
collection: c.collection,
|
|
74
|
+
tag: `v${c.data.version}`,
|
|
75
|
+
href: buildUrl(`/docs/${c.collection}/${c.data.id}/${c.data.version}`),
|
|
76
|
+
}));
|
|
58
77
|
---
|
|
59
78
|
|
|
60
79
|
<aside class="sticky top-28 left-0 space-y-8 h-full overflow-y-auto py-4">
|
|
61
80
|
<div class="">
|
|
81
|
+
{
|
|
82
|
+
producersList.length > 0 && (
|
|
83
|
+
<PillListFlat
|
|
84
|
+
title={`Producers (${producersList.length})`}
|
|
85
|
+
pills={producersList}
|
|
86
|
+
emptyMessage={`This channel does not have any producers.`}
|
|
87
|
+
color="pink"
|
|
88
|
+
client:load
|
|
89
|
+
/>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
{
|
|
94
|
+
consumersList.length > 0 && (
|
|
95
|
+
<PillListFlat
|
|
96
|
+
title={`Consumers (${consumersList.length})`}
|
|
97
|
+
pills={consumersList}
|
|
98
|
+
emptyMessage={`This channel does not have any consumers.`}
|
|
99
|
+
color="blue"
|
|
100
|
+
client:load
|
|
101
|
+
/>
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
|
|
62
105
|
{
|
|
63
106
|
messageList.length > 0 && (
|
|
64
107
|
<PillListFlat
|
|
@@ -18,7 +18,7 @@ const customDocs = await getCollection('customPages');
|
|
|
18
18
|
|
|
19
19
|
export const GET: APIRoute = async ({ params, request }) => {
|
|
20
20
|
const url = new URL(request.url);
|
|
21
|
-
const baseUrl = `${url.origin}`;
|
|
21
|
+
const baseUrl = process.env.LLMS_TXT_BASE_URL || `${url.origin}`;
|
|
22
22
|
|
|
23
23
|
const formatVersionedItem = (item: any, type: string) =>
|
|
24
24
|
`- [${item.data.name} - ${item.data.id} - ${item.data.version}](${baseUrl}/docs/${type}/${item.data.id}/${item.data.version}.mdx) - ${item.data.summary}`;
|
|
@@ -157,3 +157,30 @@ export const getSpecificationsForService = (service: CollectionEntry<CollectionT
|
|
|
157
157
|
filenameWithoutExtension: path.basename(spec.path, path.extname(spec.path)),
|
|
158
158
|
}));
|
|
159
159
|
};
|
|
160
|
+
|
|
161
|
+
// Get services for channel
|
|
162
|
+
export const getProducersAndConsumersForChannel = async (channel: CollectionEntry<'channels'>) => {
|
|
163
|
+
const messages = channel.data.messages ?? [];
|
|
164
|
+
const services = await getServices({ getAllVersions: false });
|
|
165
|
+
|
|
166
|
+
const producers = services.filter((service) => {
|
|
167
|
+
const sends = service.data.sends ?? [];
|
|
168
|
+
return sends.some((send) => {
|
|
169
|
+
// @ts-ignore
|
|
170
|
+
return messages.some((m) => m.id === send.data.id);
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
const consumers = services.filter((service) => {
|
|
175
|
+
const receives = service.data.receives ?? [];
|
|
176
|
+
return receives.some((receive) => {
|
|
177
|
+
// @ts-ignore
|
|
178
|
+
return messages.some((m) => m.id === receive.data.id);
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
return {
|
|
183
|
+
producers: producers ?? [],
|
|
184
|
+
consumers: consumers ?? [],
|
|
185
|
+
};
|
|
186
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Can't use the CollectionEntry type from astro:content because a client component is using this util
|
|
2
2
|
// import { type CollectionEntry } from 'astro:content';
|
|
3
|
+
import catalog from '@utils/eventcatalog-config/catalog';
|
|
3
4
|
import { MarkerType, Position, type Edge, type Node } from '@xyflow/react';
|
|
4
5
|
import dagre from 'dagre';
|
|
5
6
|
import { getItemsFromCollectionByIdAndSemverOrLatest } from '@utils/collections/util';
|
|
@@ -121,19 +122,20 @@ export const getChannelNodesAndEdges = ({
|
|
|
121
122
|
.filter((channel) => channel !== undefined);
|
|
122
123
|
|
|
123
124
|
channels.forEach((channel) => {
|
|
124
|
-
const
|
|
125
|
+
const singleChannel = catalog.visualiser?.channels?.renderMode === 'single'; // Only one node per channel, other wise one node per channel connection
|
|
126
|
+
const channelId = singleChannel ? generateIdForNodes([channel]) : generateIdForNodes([source, channel, target]);
|
|
125
127
|
|
|
126
128
|
// Need to check if the channel node is already in the graph
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
129
|
+
if (!currentNodes.find((node) => node.id === channelId)) {
|
|
130
|
+
nodes.push(
|
|
131
|
+
createNode({
|
|
132
|
+
id: channelId,
|
|
133
|
+
data: { title: channel?.data.id, mode, channel, source, target },
|
|
134
|
+
position: { x: 0, y: 0 },
|
|
135
|
+
type: channel?.collection,
|
|
136
|
+
})
|
|
137
|
+
);
|
|
138
|
+
}
|
|
137
139
|
|
|
138
140
|
// if the source (left node) is a service, use the target as the edge message
|
|
139
141
|
const edgeMessage = source.collection === 'services' ? target : source;
|