@eventcatalog/core 2.64.4 → 2.65.0-beta.0
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-MDWC22V7.js → chunk-2ZXSFW7J.js} +1 -1
- package/dist/chunk-622JYJWG.js +109 -0
- package/dist/{chunk-KEEW2PJ4.js → chunk-6MJGAOPK.js} +1 -1
- package/dist/chunk-BH3JMNAV.js +12 -0
- package/dist/{chunk-BXXJNRMA.js → chunk-GGFP7ZBX.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +139 -24
- package/dist/eventcatalog.js +9 -3
- package/dist/migrations/index.cjs +150 -0
- package/dist/migrations/index.d.cts +3 -0
- package/dist/migrations/index.d.ts +3 -0
- package/dist/migrations/index.js +7 -0
- package/dist/migrations/message-channels-to-service-channels.cjs +139 -0
- package/dist/migrations/message-channels-to-service-channels.d.cts +6 -0
- package/dist/migrations/message-channels-to-service-channels.d.ts +6 -0
- package/dist/migrations/message-channels-to-service-channels.js +6 -0
- package/eventcatalog/src/components/MDX/NodeGraph/Edges/AnimatedMessageEdge.tsx +42 -28
- package/eventcatalog/src/components/SideNav/ListViewSideBar/index.tsx +41 -35
- package/eventcatalog/src/content.config.ts +31 -3
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/ai-provider.ts +0 -4
- package/eventcatalog/src/hooks/eventcatalog-visualizer.ts +35 -15
- package/eventcatalog/src/utils/channels.ts +73 -1
- package/eventcatalog/src/utils/collections/util.ts +7 -0
- package/eventcatalog/src/utils/node-graphs/channel-node-graph.ts +75 -0
- package/eventcatalog/src/utils/node-graphs/message-node-graph.ts +856 -61
- package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +46 -70
- package/eventcatalog/src/utils/node-graphs/utils/utils.ts +26 -80
- package/package.json +2 -2
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { CollectionEntry } from 'astro:content';
|
|
2
|
+
import { createEdge, createNode, generatedIdForEdge, generateIdForNode, getColorFromString } from './utils/utils';
|
|
3
|
+
import { type Node, type Edge } from '@xyflow/react';
|
|
4
|
+
|
|
5
|
+
interface CollectionItem {
|
|
6
|
+
collection: string;
|
|
7
|
+
data: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const getNodesAndEdgesForChannelChain = ({
|
|
11
|
+
source,
|
|
12
|
+
target,
|
|
13
|
+
channelChain = [],
|
|
14
|
+
mode = 'simple',
|
|
15
|
+
}: {
|
|
16
|
+
source: CollectionItem;
|
|
17
|
+
target: CollectionItem;
|
|
18
|
+
channelChain: CollectionEntry<'channels'>[];
|
|
19
|
+
mode?: 'simple' | 'full';
|
|
20
|
+
}) => {
|
|
21
|
+
const nodes: Node[] = [];
|
|
22
|
+
const edges: Edge[] = [];
|
|
23
|
+
|
|
24
|
+
// We found a channel chain, we need to render all the channels in the chain
|
|
25
|
+
for (const channel of channelChain) {
|
|
26
|
+
nodes.push(
|
|
27
|
+
createNode({
|
|
28
|
+
id: generateIdForNode(channel),
|
|
29
|
+
type: channel.collection,
|
|
30
|
+
data: { mode, channel: { ...channel.data, ...channel } },
|
|
31
|
+
position: { x: 0, y: 0 },
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Connect the source to the first channel in the chain
|
|
37
|
+
edges.push(
|
|
38
|
+
createEdge({
|
|
39
|
+
id: generatedIdForEdge(source, channelChain[0]),
|
|
40
|
+
source: generateIdForNode(source),
|
|
41
|
+
target: generateIdForNode(channelChain[0]),
|
|
42
|
+
label: 'routes to',
|
|
43
|
+
data: { customColor: getColorFromString(source.data.id) },
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
// Make sure all the channels in the chain are connected together
|
|
48
|
+
for (const channel of channelChain) {
|
|
49
|
+
const index = channelChain.findIndex((c) => c.id === channel.id);
|
|
50
|
+
if (channelChain[index + 1]) {
|
|
51
|
+
edges.push(
|
|
52
|
+
createEdge({
|
|
53
|
+
id: generatedIdForEdge(channel, channelChain[index + 1]),
|
|
54
|
+
source: generateIdForNode(channel),
|
|
55
|
+
target: generateIdForNode(channelChain[index + 1]),
|
|
56
|
+
label: `routes to`,
|
|
57
|
+
data: { customColor: getColorFromString(source.data.id) },
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Connect the last channel to the target
|
|
64
|
+
edges.push(
|
|
65
|
+
createEdge({
|
|
66
|
+
id: generatedIdForEdge(channelChain[channelChain.length - 1], target),
|
|
67
|
+
source: generateIdForNode(channelChain[channelChain.length - 1]),
|
|
68
|
+
target: generateIdForNode(target),
|
|
69
|
+
label: 'consumes',
|
|
70
|
+
data: { customColor: getColorFromString(source.data.id) },
|
|
71
|
+
})
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
return { nodes, edges };
|
|
75
|
+
};
|