@eventcatalog/core 2.33.5 → 2.33.7
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-3H3JI5WP.js → chunk-4BTH6TJB.js} +1 -1
- package/dist/{chunk-AECMEWQ4.js → chunk-NL4PYW7O.js} +1 -1
- package/dist/{chunk-QUTVOUHZ.js → chunk-VENFKOAJ.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 +3 -0
- package/dist/eventcatalog.config.d.ts +3 -0
- package/dist/eventcatalog.js +3 -3
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.tsx +13 -10
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Channel.tsx +16 -10
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Command.tsx +15 -7
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Event.tsx +15 -8
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Query.tsx +15 -10
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Service.tsx +17 -8
- package/eventcatalog/src/content.config.ts +18 -7
- package/eventcatalog/src/pages/api/catalog.ts +26 -0
- package/package.json +2 -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-VENFKOAJ.js";
|
|
4
|
+
import "../chunk-4BTH6TJB.js";
|
|
5
|
+
import "../chunk-NL4PYW7O.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-UKJ7F5WR.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-VENFKOAJ.js";
|
|
10
|
+
import "./chunk-4BTH6TJB.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro,
|
|
13
13
|
checkAndConvertMdToMdx
|
|
14
14
|
} from "./chunk-7SI5EVOX.js";
|
|
15
15
|
import {
|
|
16
16
|
VERSION
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NL4PYW7O.js";
|
|
18
18
|
import {
|
|
19
19
|
isBackstagePluginEnabled,
|
|
20
20
|
isEventCatalogScaleEnabled,
|
|
@@ -232,21 +232,24 @@ const NodeGraphBuilder = ({
|
|
|
232
232
|
);
|
|
233
233
|
|
|
234
234
|
const getNodesByCollectionWithColors = useCallback((nodes: Node[]) => {
|
|
235
|
-
const
|
|
236
|
-
events: 'orange',
|
|
237
|
-
services: 'pink',
|
|
238
|
-
commands: 'blue',
|
|
239
|
-
queries: 'green',
|
|
240
|
-
channels: 'gray',
|
|
235
|
+
const colorClasses = {
|
|
236
|
+
events: 'bg-orange-600',
|
|
237
|
+
services: 'bg-pink-600',
|
|
238
|
+
commands: 'bg-blue-600',
|
|
239
|
+
queries: 'bg-green-600',
|
|
240
|
+
channels: 'bg-gray-600',
|
|
241
|
+
externalSystem: 'bg-pink-600',
|
|
242
|
+
actor: 'bg-yellow-500',
|
|
243
|
+
step: 'bg-gray-700',
|
|
241
244
|
};
|
|
242
245
|
|
|
243
|
-
return nodes.reduce((acc: { [key: string]: { count: number;
|
|
246
|
+
return nodes.reduce((acc: { [key: string]: { count: number; colorClass: string } }, node) => {
|
|
244
247
|
const collection = node.type;
|
|
245
248
|
if (collection) {
|
|
246
249
|
if (acc[collection]) {
|
|
247
250
|
acc[collection].count += 1;
|
|
248
251
|
} else {
|
|
249
|
-
acc[collection] = { count: 1,
|
|
252
|
+
acc[collection] = { count: 1, colorClass: colorClasses[collection as keyof typeof colorClasses] || 'bg-black' };
|
|
250
253
|
}
|
|
251
254
|
}
|
|
252
255
|
return acc;
|
|
@@ -348,13 +351,13 @@ const NodeGraphBuilder = ({
|
|
|
348
351
|
<Panel position="bottom-right">
|
|
349
352
|
<div className=" bg-white font-light px-4 text-[12px] shadow-md py-1 rounded-md">
|
|
350
353
|
<ul className="m-0 p-0 ">
|
|
351
|
-
{Object.entries(legend).map(([key, { count,
|
|
354
|
+
{Object.entries(legend).map(([key, { count, colorClass }]) => (
|
|
352
355
|
<li
|
|
353
356
|
key={key}
|
|
354
357
|
className="flex space-x-2 items-center text-[10px] cursor-pointer hover:text-purple-600 hover:underline"
|
|
355
358
|
onClick={() => handleLegendClick(key)}
|
|
356
359
|
>
|
|
357
|
-
<span className={`w-2 h-2 block
|
|
360
|
+
<span className={`w-2 h-2 block ${colorClass}`} />
|
|
358
361
|
<span className="block capitalize">
|
|
359
362
|
{key} ({count})
|
|
360
363
|
</span>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { BoltIcon } from '@heroicons/react/16/solid';
|
|
2
1
|
import { ArrowsRightLeftIcon } from '@heroicons/react/20/solid';
|
|
3
|
-
import type { CollectionMessageTypes
|
|
2
|
+
import type { CollectionMessageTypes } from '@types';
|
|
4
3
|
import type { CollectionEntry } from 'astro:content';
|
|
5
4
|
import { Handle } from '@xyflow/react';
|
|
6
5
|
import * as ContextMenu from '@radix-ui/react-context-menu';
|
|
7
6
|
import { buildUrl } from '@utils/url-builder';
|
|
8
|
-
|
|
7
|
+
import { getIcon } from '@utils/badges';
|
|
9
8
|
interface Data {
|
|
10
9
|
title: string;
|
|
11
10
|
label: string;
|
|
@@ -43,11 +42,16 @@ const getIconForProtocol = (icon: keyof typeof protocolIcons) => {
|
|
|
43
42
|
export default function ChannelNode({ data, sourcePosition, targetPosition }: any) {
|
|
44
43
|
const { mode, channel, source, target } = data as Data;
|
|
45
44
|
|
|
46
|
-
const { id, name, version, summary, owners = [], address, protocols = [] } = channel.data;
|
|
45
|
+
const { id, name, version, summary, owners = [], address, protocols = [], styles } = channel.data;
|
|
47
46
|
const protocol = protocols[0];
|
|
47
|
+
const { node: { color = 'gray', icon = 'ArrowsRightLeftIcon', label } = {} } = styles || {};
|
|
48
48
|
|
|
49
49
|
const Icon = getIconForProtocol(protocol);
|
|
50
50
|
|
|
51
|
+
const SideBarIcon = getIcon(icon);
|
|
52
|
+
const nodeLabel = label || channel?.data?.sidebar?.badge || 'Channel';
|
|
53
|
+
const fontSize = nodeLabel.length > 10 ? '7px' : '9px';
|
|
54
|
+
|
|
51
55
|
const getAddress = () => {
|
|
52
56
|
const sourceChannel = source.data.channels?.find((channel) => channel.id === id);
|
|
53
57
|
const targetChannel = target.data.channels?.find((channel) => channel.id === id);
|
|
@@ -74,19 +78,21 @@ export default function ChannelNode({ data, sourcePosition, targetPosition }: an
|
|
|
74
78
|
<div
|
|
75
79
|
className={classNames(
|
|
76
80
|
mode === 'simple' ? 'min-h-[3em]' : 'min-h-[6.5em]',
|
|
77
|
-
|
|
81
|
+
`w-full rounded-md border flex justify-start bg-white text-black border-${color}-400 transform `
|
|
78
82
|
)}
|
|
79
83
|
>
|
|
80
84
|
<div
|
|
81
85
|
className={classNames(
|
|
82
|
-
|
|
83
|
-
`border-r-[1px] border-
|
|
86
|
+
`bg-gradient-to-b from-${color}-500 to-${color}-700 relative flex items-center w-5 justify-center rounded-l-sm text-${color}-100`,
|
|
87
|
+
`border-r-[1px] border-${color}-500`
|
|
84
88
|
)}
|
|
85
89
|
>
|
|
86
|
-
<
|
|
90
|
+
{SideBarIcon && <SideBarIcon className="w-4 h-4 opacity-90 text-white absolute top-1 " />}
|
|
87
91
|
{mode === 'full' && (
|
|
88
|
-
<span
|
|
89
|
-
|
|
92
|
+
<span
|
|
93
|
+
className={`rotate -rotate-90 w-1/2 text-center absolute bottom-1 text-[${fontSize}] text-white font-bold uppercase tracking-[3px] `}
|
|
94
|
+
>
|
|
95
|
+
{nodeLabel}
|
|
90
96
|
</span>
|
|
91
97
|
)}
|
|
92
98
|
</div>
|
|
@@ -2,6 +2,7 @@ import { ChatBubbleLeftIcon } from '@heroicons/react/16/solid';
|
|
|
2
2
|
import type { CollectionEntry } from 'astro:content';
|
|
3
3
|
import { Handle } from '@xyflow/react';
|
|
4
4
|
import MessageContextMenu from './MessageContextMenu';
|
|
5
|
+
import { getIcon } from '@utils/badges';
|
|
5
6
|
|
|
6
7
|
interface Data {
|
|
7
8
|
title: string;
|
|
@@ -21,21 +22,28 @@ function classNames(...classes: any) {
|
|
|
21
22
|
export default function CommandNode({ data, sourcePosition, targetPosition }: any) {
|
|
22
23
|
const { mode, message } = data as Data;
|
|
23
24
|
|
|
24
|
-
const { id, name, version, summary, owners = [], producers = [], consumers = [], schemaPath } = message.data;
|
|
25
|
+
const { id, name, version, summary, owners = [], producers = [], consumers = [], schemaPath, styles } = message.data;
|
|
26
|
+
const { node: { color = 'blue', icon = 'ChatBubbleLeftIcon', label } = {} } = styles || {};
|
|
27
|
+
|
|
28
|
+
const Icon = getIcon(icon);
|
|
29
|
+
const nodeLabel = label || message?.data?.sidebar?.badge || 'Command';
|
|
30
|
+
const fontSize = nodeLabel.length > 10 ? '7px' : '9px';
|
|
25
31
|
|
|
26
32
|
return (
|
|
27
33
|
<MessageContextMenu message={message} messageType="commands">
|
|
28
|
-
<div className={classNames(
|
|
34
|
+
<div className={classNames(`w-full rounded-md border flex justify-start bg-white text-black border-${color}-400`)}>
|
|
29
35
|
<div
|
|
30
36
|
className={classNames(
|
|
31
|
-
|
|
32
|
-
`border-r-[1px] border-
|
|
37
|
+
`bg-gradient-to-b from-${color}-500 to-${color}-700 relative flex items-center w-5 justify-center rounded-l-sm text-${color}-100`,
|
|
38
|
+
`border-r-[1px] border-${color}-500`
|
|
33
39
|
)}
|
|
34
40
|
>
|
|
35
|
-
<
|
|
41
|
+
{Icon && <Icon className="w-4 h-4 opacity-90 text-white absolute top-1 " />}
|
|
36
42
|
{mode === 'full' && (
|
|
37
|
-
<span
|
|
38
|
-
|
|
43
|
+
<span
|
|
44
|
+
className={`rotate -rotate-90 w-1/2 text-center absolute bottom-1 text-[${fontSize}] text-white font-bold uppercase tracking-[3px] `}
|
|
45
|
+
>
|
|
46
|
+
{nodeLabel}
|
|
39
47
|
</span>
|
|
40
48
|
)}
|
|
41
49
|
</div>
|
|
@@ -2,7 +2,7 @@ import { BoltIcon } from '@heroicons/react/16/solid';
|
|
|
2
2
|
import type { CollectionEntry } from 'astro:content';
|
|
3
3
|
import { Handle } from '@xyflow/react';
|
|
4
4
|
import MessageContextMenu from './MessageContextMenu';
|
|
5
|
-
|
|
5
|
+
import { getIcon } from '@utils/badges';
|
|
6
6
|
interface Data {
|
|
7
7
|
title: string;
|
|
8
8
|
label: string;
|
|
@@ -20,21 +20,28 @@ function classNames(...classes: any) {
|
|
|
20
20
|
|
|
21
21
|
export default function EventNode({ data, sourcePosition, targetPosition }: any) {
|
|
22
22
|
const { mode, message } = data as Data;
|
|
23
|
-
const { name, version, summary, owners = [], producers = [], consumers = [] } = message.data;
|
|
23
|
+
const { name, version, summary, owners = [], producers = [], consumers = [], styles } = message.data;
|
|
24
|
+
const { node: { color = 'orange', icon = 'BoltIcon', label } = {} } = styles || {};
|
|
25
|
+
|
|
26
|
+
const Icon = getIcon(icon);
|
|
27
|
+
const nodeLabel = label || message?.data?.sidebar?.badge || 'Event';
|
|
28
|
+
const fontSize = nodeLabel.length > 10 ? '7px' : '9px';
|
|
24
29
|
|
|
25
30
|
return (
|
|
26
31
|
<MessageContextMenu message={message} messageType="events">
|
|
27
|
-
<div className={classNames(
|
|
32
|
+
<div className={classNames(`w-full rounded-md border flex justify-start bg-white text-black border-${color}-400`)}>
|
|
28
33
|
<div
|
|
29
34
|
className={classNames(
|
|
30
|
-
|
|
31
|
-
`border-r-[1px] border-
|
|
35
|
+
`bg-gradient-to-b from-${color}-500 to-${color}-700 relative flex items-center w-5 justify-center rounded-l-sm text-${color}-100`,
|
|
36
|
+
`border-r-[1px] border-${color}-500`
|
|
32
37
|
)}
|
|
33
38
|
>
|
|
34
|
-
<
|
|
39
|
+
{Icon && <Icon className="w-4 h-4 opacity-90 text-white absolute top-1 " />}
|
|
35
40
|
{mode === 'full' && (
|
|
36
|
-
<span
|
|
37
|
-
|
|
41
|
+
<span
|
|
42
|
+
className={`rotate -rotate-90 w-1/2 text-center absolute bottom-1 text-[${fontSize}] text-white font-bold uppercase tracking-[3px] `}
|
|
43
|
+
>
|
|
44
|
+
{nodeLabel}
|
|
38
45
|
</span>
|
|
39
46
|
)}
|
|
40
47
|
</div>
|
|
@@ -2,6 +2,7 @@ import { MagnifyingGlassIcon } from '@heroicons/react/16/solid';
|
|
|
2
2
|
import type { CollectionEntry } from 'astro:content';
|
|
3
3
|
import { Handle } from '@xyflow/react';
|
|
4
4
|
import MessageContextMenu from './MessageContextMenu';
|
|
5
|
+
import { getIcon } from '@utils/badges';
|
|
5
6
|
interface Data {
|
|
6
7
|
title: string;
|
|
7
8
|
label: string;
|
|
@@ -9,8 +10,6 @@ interface Data {
|
|
|
9
10
|
color: string;
|
|
10
11
|
mode: 'simple' | 'full';
|
|
11
12
|
message: CollectionEntry<'queries'>;
|
|
12
|
-
showTarget?: boolean;
|
|
13
|
-
showSource?: boolean;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
function classNames(...classes: any) {
|
|
@@ -18,26 +17,32 @@ function classNames(...classes: any) {
|
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
export default function QueryNode({ data, sourcePosition, targetPosition }: any) {
|
|
21
|
-
const { mode, message
|
|
20
|
+
const { mode, message } = data as Data;
|
|
22
21
|
|
|
23
|
-
const { name, version, summary, owners = [], producers = [], consumers = [] } = message.data;
|
|
22
|
+
const { name, version, summary, owners = [], producers = [], consumers = [], styles } = message.data;
|
|
23
|
+
const { node: { color = 'green', icon = 'MagnifyingGlassIcon', label } = {} } = styles || {};
|
|
24
24
|
|
|
25
|
+
const Icon = getIcon(icon);
|
|
26
|
+
const nodeLabel = label || message?.data?.sidebar?.badge || 'Query';
|
|
27
|
+
const fontSize = nodeLabel.length > 10 ? '7px' : '9px';
|
|
25
28
|
const renderTarget = true;
|
|
26
29
|
const renderSource = true;
|
|
27
30
|
|
|
28
31
|
return (
|
|
29
32
|
<MessageContextMenu message={message} messageType="queries">
|
|
30
|
-
<div className={classNames(
|
|
33
|
+
<div className={classNames(`w-full rounded-md border flex justify-start bg-white text-black border-${color}-400`)}>
|
|
31
34
|
<div
|
|
32
35
|
className={classNames(
|
|
33
|
-
|
|
34
|
-
`border-r-[1px] border-
|
|
36
|
+
`bg-gradient-to-b from-${color}-500 to-${color}-700 relative flex items-center w-5 justify-center rounded-l-sm text-${color}-100`,
|
|
37
|
+
`border-r-[1px] border-${color}-500`
|
|
35
38
|
)}
|
|
36
39
|
>
|
|
37
|
-
<
|
|
40
|
+
{Icon && <Icon className="w-4 h-4 opacity-90 text-white absolute top-1 " />}
|
|
38
41
|
{mode === 'full' && (
|
|
39
|
-
<span
|
|
40
|
-
|
|
42
|
+
<span
|
|
43
|
+
className={`rotate -rotate-90 w-1/2 text-center absolute bottom-1 text-[${fontSize}] text-white font-bold uppercase tracking-[3px] `}
|
|
44
|
+
>
|
|
45
|
+
{nodeLabel}
|
|
41
46
|
</span>
|
|
42
47
|
)}
|
|
43
48
|
</div>
|
|
@@ -3,6 +3,7 @@ import type { CollectionEntry } from 'astro:content';
|
|
|
3
3
|
import { Handle } from '@xyflow/react';
|
|
4
4
|
import * as ContextMenu from '@radix-ui/react-context-menu';
|
|
5
5
|
import { buildUrl } from '@utils/url-builder';
|
|
6
|
+
import { getIcon } from '@utils/badges';
|
|
6
7
|
|
|
7
8
|
interface Data {
|
|
8
9
|
label: string;
|
|
@@ -19,9 +20,15 @@ function classNames(...classes: any) {
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export default function ServiceNode({ data, sourcePosition, targetPosition }: any) {
|
|
22
|
-
const {
|
|
23
|
+
const { mode, service } = data as Data;
|
|
24
|
+
|
|
25
|
+
const { id, version, owners = [], sends = [], receives = [], name, specifications, repository, styles } = service.data;
|
|
26
|
+
const { node: { color = 'pink', icon = 'ServerIcon', label } = {} } = styles || {};
|
|
27
|
+
|
|
28
|
+
const Icon = getIcon(icon);
|
|
29
|
+
const nodeLabel = label || service?.data?.sidebar?.badge || 'Service';
|
|
30
|
+
const fontSize = nodeLabel.length > 10 ? '7px' : '9px';
|
|
23
31
|
|
|
24
|
-
const { id, version, owners = [], sends = [], receives = [], name, specifications, repository } = service.data;
|
|
25
32
|
const asyncApiPath = specifications?.asyncapiPath;
|
|
26
33
|
const openApiPath = specifications?.openapiPath;
|
|
27
34
|
const repositoryUrl = repository?.url;
|
|
@@ -29,17 +36,19 @@ export default function ServiceNode({ data, sourcePosition, targetPosition }: an
|
|
|
29
36
|
return (
|
|
30
37
|
<ContextMenu.Root>
|
|
31
38
|
<ContextMenu.Trigger>
|
|
32
|
-
<div className={classNames(
|
|
39
|
+
<div className={classNames(`w-full rounded-md border flex justify-start bg-white text-black border-${color}-400`)}>
|
|
33
40
|
<div
|
|
34
41
|
className={classNames(
|
|
35
|
-
|
|
36
|
-
`border-r-[1px] border-
|
|
42
|
+
`bg-gradient-to-b from-${color}-500 to-${color}-700 relative flex items-center w-5 justify-center rounded-l-sm text-${color}-100`,
|
|
43
|
+
`border-r-[1px] border-${color}-500`
|
|
37
44
|
)}
|
|
38
45
|
>
|
|
39
|
-
<
|
|
46
|
+
{Icon && <Icon className="w-4 h-4 opacity-90 text-white absolute top-1 " />}
|
|
40
47
|
{mode === 'full' && (
|
|
41
|
-
<span
|
|
42
|
-
|
|
48
|
+
<span
|
|
49
|
+
className={`rotate -rotate-90 w-1/2 text-center absolute bottom-1 text-[${fontSize}] text-white font-bold uppercase tracking-[3px] `}
|
|
50
|
+
>
|
|
51
|
+
{nodeLabel}
|
|
43
52
|
</span>
|
|
44
53
|
)}
|
|
45
54
|
</div>
|
|
@@ -14,7 +14,7 @@ export const projectDirBase = (() => {
|
|
|
14
14
|
|
|
15
15
|
const pages = defineCollection({
|
|
16
16
|
loader: glob({
|
|
17
|
-
pattern: ['**/pages/*.(md|mdx)'
|
|
17
|
+
pattern: ['**/pages/*.(md|mdx)'],
|
|
18
18
|
base: projectDirBase,
|
|
19
19
|
}),
|
|
20
20
|
schema: z
|
|
@@ -43,7 +43,7 @@ const resourcePointer = z.object({
|
|
|
43
43
|
|
|
44
44
|
const changelogs = defineCollection({
|
|
45
45
|
loader: glob({
|
|
46
|
-
pattern: ['**/changelog.(md|mdx)'
|
|
46
|
+
pattern: ['**/changelog.(md|mdx)'],
|
|
47
47
|
base: projectDirBase,
|
|
48
48
|
}),
|
|
49
49
|
schema: z.object({
|
|
@@ -104,6 +104,17 @@ const baseSchema = z.object({
|
|
|
104
104
|
})
|
|
105
105
|
)
|
|
106
106
|
.optional(),
|
|
107
|
+
styles: z
|
|
108
|
+
.object({
|
|
109
|
+
node: z
|
|
110
|
+
.object({
|
|
111
|
+
color: z.string().optional(),
|
|
112
|
+
icon: z.string().optional(),
|
|
113
|
+
label: z.string().optional(),
|
|
114
|
+
})
|
|
115
|
+
.optional(),
|
|
116
|
+
})
|
|
117
|
+
.optional(),
|
|
107
118
|
// Used by eventcatalog
|
|
108
119
|
versions: z.array(z.string()).optional(),
|
|
109
120
|
latestVersion: z.string().optional(),
|
|
@@ -133,7 +144,7 @@ const flowStep = z
|
|
|
133
144
|
|
|
134
145
|
const flows = defineCollection({
|
|
135
146
|
loader: glob({
|
|
136
|
-
pattern: ['**/flows/*/index.(md|mdx)', '**/flows/*/versioned/*/index.(md|mdx)'
|
|
147
|
+
pattern: ['**/flows/*/index.(md|mdx)', '**/flows/*/versioned/*/index.(md|mdx)'],
|
|
137
148
|
base: projectDirBase,
|
|
138
149
|
generateId: ({ data }) => {
|
|
139
150
|
return `${data.id}-${data.version}`;
|
|
@@ -203,7 +214,7 @@ const flows = defineCollection({
|
|
|
203
214
|
|
|
204
215
|
const events = defineCollection({
|
|
205
216
|
loader: glob({
|
|
206
|
-
pattern: ['**/events/*/index.(md|mdx)', '**/events/*/versioned/*/index.(md|mdx)'
|
|
217
|
+
pattern: ['**/events/*/index.(md|mdx)', '**/events/*/versioned/*/index.(md|mdx)'],
|
|
207
218
|
base: projectDirBase,
|
|
208
219
|
generateId: ({ data, ...rest }) => {
|
|
209
220
|
return `${data.id}-${data.version}`;
|
|
@@ -222,7 +233,7 @@ const events = defineCollection({
|
|
|
222
233
|
|
|
223
234
|
const commands = defineCollection({
|
|
224
235
|
loader: glob({
|
|
225
|
-
pattern: ['**/commands/*/index.(md|mdx)', '**/commands/*/versioned/*/index.(md|mdx)'
|
|
236
|
+
pattern: ['**/commands/*/index.(md|mdx)', '**/commands/*/versioned/*/index.(md|mdx)'],
|
|
226
237
|
base: projectDirBase,
|
|
227
238
|
generateId: ({ data }) => {
|
|
228
239
|
return `${data.id}-${data.version}`;
|
|
@@ -241,7 +252,7 @@ const commands = defineCollection({
|
|
|
241
252
|
|
|
242
253
|
const queries = defineCollection({
|
|
243
254
|
loader: glob({
|
|
244
|
-
pattern: ['**/queries/*/index.(md|mdx)', '**/queries/*/versioned/*/index.(md|mdx)'
|
|
255
|
+
pattern: ['**/queries/*/index.(md|mdx)', '**/queries/*/versioned/*/index.(md|mdx)'],
|
|
245
256
|
base: projectDirBase,
|
|
246
257
|
generateId: ({ data }) => {
|
|
247
258
|
return `${data.id}-${data.version}`;
|
|
@@ -309,7 +320,7 @@ const domains = defineCollection({
|
|
|
309
320
|
|
|
310
321
|
const channels = defineCollection({
|
|
311
322
|
loader: glob({
|
|
312
|
-
pattern: ['**/channels/*/index.(md|mdx)', '**/channels/*/versioned/*/index.(md|mdx)'
|
|
323
|
+
pattern: ['**/channels/*/index.(md|mdx)', '**/channels/*/versioned/*/index.(md|mdx)'],
|
|
313
324
|
base: projectDirBase,
|
|
314
325
|
generateId: ({ data }) => {
|
|
315
326
|
return `${data.id}-${data.version}`;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { APIRoute } from 'astro';
|
|
2
|
+
import utils from '@eventcatalog/sdk';
|
|
3
|
+
import config from '@config';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Route the will dump the whole catalog as JSON (without markdown)
|
|
7
|
+
* Experimental API
|
|
8
|
+
* @param param0
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export const GET: APIRoute = async ({ params, request }) => {
|
|
12
|
+
if (!config.api?.fullCatalogAPIEnabled) {
|
|
13
|
+
return new Response(JSON.stringify({ error: 'Full catalog API is not enabled' }), {
|
|
14
|
+
status: 404,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { dumpCatalog } = utils(process.env.PROJECT_DIR || '');
|
|
19
|
+
const catalog = await dumpCatalog({ includeMarkdown: false });
|
|
20
|
+
|
|
21
|
+
return new Response(JSON.stringify(catalog), {
|
|
22
|
+
headers: {
|
|
23
|
+
'Content-Type': 'application/json',
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
};
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/event-catalog/eventcatalog.git"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
|
-
"version": "2.33.
|
|
9
|
+
"version": "2.33.7",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@asyncapi/parser": "^3.4.0",
|
|
31
31
|
"@asyncapi/react-component": "^2.4.3",
|
|
32
32
|
"@eventcatalog/generator-ai": "^1.0.0",
|
|
33
|
+
"@eventcatalog/sdk": "^2.2.3",
|
|
33
34
|
"@fontsource/inter": "^5.2.5",
|
|
34
35
|
"@headlessui/react": "^2.0.3",
|
|
35
36
|
"@heroicons/react": "^2.1.3",
|