@eventcatalog/core 2.16.5 → 2.17.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/catalog-to-astro-content-directory.cjs +1 -1
- package/dist/{chunk-SSON27NB.js → chunk-7QQO526J.js} +1 -1
- package/dist/{chunk-AUXNC7PZ.js → chunk-KK4PRBGY.js} +1 -1
- package/dist/{chunk-EXL47VH2.js → chunk-PPADPR55.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +2 -2
- package/dist/eventcatalog.js +3 -3
- package/eventcatalog/astro.config.mjs +3 -1
- package/eventcatalog/package.json +7 -7
- package/eventcatalog/src/components/MDX/components.tsx +1 -1
- package/eventcatalog/src/components/SideBars/ChannelSideBar.astro +3 -2
- package/eventcatalog/src/components/SideBars/DomainSideBar.astro +2 -1
- package/eventcatalog/src/components/SideBars/MessageSideBar.astro +2 -1
- package/eventcatalog/src/components/SideBars/ServiceSideBar.astro +2 -1
- package/eventcatalog/src/pages/docs/teams/[id]/index.astro +2 -2
- package/eventcatalog/src/pages/docs/users/[id]/index.astro +1 -1
- package/eventcatalog/src/remark-plugins/directives.ts +109 -0
- package/eventcatalog/src/utils/channels.ts +1 -1
- package/eventcatalog/src/utils/collections/changelogs.ts +1 -1
- package/eventcatalog/src/utils/collections/domains.ts +1 -1
- package/eventcatalog/src/utils/collections/flows.ts +1 -1
- package/eventcatalog/src/utils/collections/services.ts +1 -1
- package/eventcatalog/src/utils/commands.ts +1 -1
- package/eventcatalog/src/utils/events.ts +1 -1
- package/eventcatalog/src/utils/node-graphs/utils/utils.ts +22 -9
- package/eventcatalog/src/utils/queries.ts +1 -1
- package/eventcatalog/src/utils/teams.ts +4 -4
- package/eventcatalog/src/utils/users.ts +6 -6
- package/package.json +9 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-KK4PRBGY.js";
|
|
4
|
+
import "../chunk-7QQO526J.js";
|
|
5
|
+
import "../chunk-PPADPR55.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
|
@@ -35,7 +35,7 @@ __export(catalog_to_astro_content_directory_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(catalog_to_astro_content_directory_exports);
|
|
36
36
|
|
|
37
37
|
// node_modules/tsup/assets/cjs_shims.js
|
|
38
|
-
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(
|
|
38
|
+
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
39
39
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
40
40
|
|
|
41
41
|
// src/catalog-to-astro-content-directory.js
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
));
|
|
24
24
|
|
|
25
25
|
// node_modules/tsup/assets/cjs_shims.js
|
|
26
|
-
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(
|
|
26
|
+
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
27
27
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
28
28
|
|
|
29
29
|
// src/eventcatalog.ts
|
|
@@ -161,7 +161,7 @@ var import_axios = __toESM(require("axios"), 1);
|
|
|
161
161
|
var import_os = __toESM(require("os"), 1);
|
|
162
162
|
|
|
163
163
|
// package.json
|
|
164
|
-
var version = "2.
|
|
164
|
+
var version = "2.17.0";
|
|
165
165
|
|
|
166
166
|
// src/constants.ts
|
|
167
167
|
var VERSION = version;
|
package/dist/eventcatalog.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-KK4PRBGY.js";
|
|
4
|
+
import "./chunk-7QQO526J.js";
|
|
5
5
|
import {
|
|
6
6
|
catalogToAstro
|
|
7
7
|
} from "./chunk-55YPRY5U.js";
|
|
8
8
|
import {
|
|
9
9
|
VERSION
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PPADPR55.js";
|
|
11
11
|
import {
|
|
12
12
|
generate
|
|
13
13
|
} from "./chunk-YEQVKHST.js";
|
|
@@ -5,6 +5,8 @@ import react from '@astrojs/react';
|
|
|
5
5
|
import pagefind from "astro-pagefind";
|
|
6
6
|
import { mermaid } from "./src/remark-plugins/mermaid"
|
|
7
7
|
import { join } from 'node:path';
|
|
8
|
+
import remarkDirective from 'remark-directive';
|
|
9
|
+
import { remarkDirectives } from "./src/remark-plugins/directives"
|
|
8
10
|
|
|
9
11
|
/** @type {import('bin/eventcatalog.config').Config} */
|
|
10
12
|
import config from './eventcatalog.config';
|
|
@@ -42,7 +44,7 @@ export default defineConfig({
|
|
|
42
44
|
mdx({
|
|
43
45
|
// https://docs.astro.build/en/guides/integrations-guide/mdx/#optimize
|
|
44
46
|
optimize: config.mdxOptimize || false,
|
|
45
|
-
remarkPlugins: [mermaid],
|
|
47
|
+
remarkPlugins: [remarkDirective, remarkDirectives, mermaid],
|
|
46
48
|
gfm: false,
|
|
47
49
|
}),
|
|
48
50
|
pagefind(),
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"start": "astro dev"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@astrojs/markdown-remark": "^
|
|
21
|
-
"@astrojs/mdx": "^
|
|
22
|
-
"@astrojs/react": "^
|
|
23
|
-
"@astrojs/tailwind": "^5.1.
|
|
20
|
+
"@astrojs/markdown-remark": "^6.0.1",
|
|
21
|
+
"@astrojs/mdx": "^4.0.2",
|
|
22
|
+
"@astrojs/react": "^4.1.0",
|
|
23
|
+
"@astrojs/tailwind": "^5.1.3",
|
|
24
24
|
"@asyncapi/avro-schema-parser": "^3.0.24",
|
|
25
25
|
"@asyncapi/parser": "^3.4.0",
|
|
26
26
|
"@asyncapi/react-component": "^2.4.3",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"@tailwindcss/typography": "^0.5.13",
|
|
32
32
|
"@tanstack/react-table": "^8.17.3",
|
|
33
33
|
"@xyflow/react": "^12.3.6",
|
|
34
|
-
"astro": "^
|
|
35
|
-
"astro-expressive-code": "^0.
|
|
36
|
-
"astro-pagefind": "^1.
|
|
34
|
+
"astro": "^5.0.5",
|
|
35
|
+
"astro-expressive-code": "^0.38.3",
|
|
36
|
+
"astro-pagefind": "^1.7.0",
|
|
37
37
|
"astro-seo": "^0.8.4",
|
|
38
38
|
"dagre": "^0.8.5",
|
|
39
39
|
"diff": "^7.0.0",
|
|
@@ -33,7 +33,7 @@ const components = (props: any) => {
|
|
|
33
33
|
Steps,
|
|
34
34
|
Tabs,
|
|
35
35
|
TabItem,
|
|
36
|
-
Admonition
|
|
36
|
+
Admonition,
|
|
37
37
|
File: (mdxProp: any) => File({ ...props, ...mdxProp }),
|
|
38
38
|
NodeGraph: (mdxProp: any) => NodeGraphPortal({ ...props.data, ...mdxProp }),
|
|
39
39
|
ChannelInformation: (mdxProp: any) => ChannelInformation({ ...props.data, ...mdxProp }),
|
|
@@ -16,6 +16,7 @@ const { channel } = Astro.props;
|
|
|
16
16
|
|
|
17
17
|
const ownersRaw = channel.data?.owners || [];
|
|
18
18
|
const owners = await Promise.all(ownersRaw.map((o) => getEntry(o)));
|
|
19
|
+
const filteredOwners = owners.filter((o) => o !== undefined);
|
|
19
20
|
|
|
20
21
|
const channelParameters: Record<string, { enum?: string[]; description?: string }> = channel.data.parameters || {};
|
|
21
22
|
const parameters = Object.keys(channelParameters).map((key) => ({
|
|
@@ -37,7 +38,7 @@ const protocolList = protocols.map((p) => ({
|
|
|
37
38
|
icon: p,
|
|
38
39
|
}));
|
|
39
40
|
|
|
40
|
-
const ownersList =
|
|
41
|
+
const ownersList = filteredOwners.map((o) => ({
|
|
41
42
|
label: o.data.name,
|
|
42
43
|
type: o.collection,
|
|
43
44
|
badge: o.collection === 'users' ? o.data.role : 'Team',
|
|
@@ -86,7 +87,7 @@ const messageList = (channel.data.messages ?? []).map((p) => ({
|
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
<OwnersList
|
|
89
|
-
title={`Channel owners (${
|
|
90
|
+
title={`Channel owners (${filteredOwners.length})`}
|
|
90
91
|
owners={ownersList}
|
|
91
92
|
emptyMessage={`This channel does not have any documented owners.`}
|
|
92
93
|
client:load
|
|
@@ -21,6 +21,7 @@ const ubiquitousLanguageDictionary = hasUbiquitousLanguage ? ubiquitousLanguage[
|
|
|
21
21
|
|
|
22
22
|
const ownersRaw = domain.data?.owners || [];
|
|
23
23
|
const owners = await Promise.all(ownersRaw.map((o) => getEntry(o)));
|
|
24
|
+
const filteredOwners = owners.filter((o) => o !== undefined);
|
|
24
25
|
|
|
25
26
|
const serviceList = services.map((p) => ({
|
|
26
27
|
label: p.data.name,
|
|
@@ -37,7 +38,7 @@ const ubiquitousLanguageList = ubiquitousLanguageDictionary?.map((l) => ({
|
|
|
37
38
|
href: buildUrl(`/docs/${domain.collection}/${domain.data.id}/language?id=${l.id}`),
|
|
38
39
|
}));
|
|
39
40
|
|
|
40
|
-
const ownersList =
|
|
41
|
+
const ownersList = filteredOwners.map((o) => ({
|
|
41
42
|
label: o.data.name,
|
|
42
43
|
type: o.collection,
|
|
43
44
|
badge: o.collection === 'users' ? o.data.role : 'Team',
|
|
@@ -20,6 +20,7 @@ const channels = (message.data.messageChannels as CollectionEntry<'channels'>[])
|
|
|
20
20
|
|
|
21
21
|
const ownersRaw = message.data?.owners || [];
|
|
22
22
|
const owners = await Promise.all(ownersRaw.map((o) => getEntry(o)));
|
|
23
|
+
const filteredOwners = owners.filter((o) => o !== undefined);
|
|
23
24
|
|
|
24
25
|
const producerList = producers.map((p) => ({
|
|
25
26
|
label: `${p.data.name}`,
|
|
@@ -35,7 +36,7 @@ const consumerList = consumers.map((p) => ({
|
|
|
35
36
|
href: buildUrl(`/docs/services/${p.data.id}/${p.data.version}`),
|
|
36
37
|
}));
|
|
37
38
|
|
|
38
|
-
const ownersList =
|
|
39
|
+
const ownersList = filteredOwners.map((o) => ({
|
|
39
40
|
label: o.data.name,
|
|
40
41
|
type: o.collection,
|
|
41
42
|
badge: o.collection === 'users' ? o.data.role : 'Team',
|
|
@@ -21,6 +21,7 @@ const receives = (service.data.receives as CollectionEntry<'events'>[]) || [];
|
|
|
21
21
|
|
|
22
22
|
const ownersRaw = service.data?.owners || [];
|
|
23
23
|
const owners = await Promise.all(ownersRaw.map((o) => getEntry(o)));
|
|
24
|
+
const filteredOwners = owners.filter((o) => o !== undefined);
|
|
24
25
|
|
|
25
26
|
const sendsList = sends.map((p) => ({
|
|
26
27
|
label: p.data.name,
|
|
@@ -39,7 +40,7 @@ const receivesList = receives.map((p) => ({
|
|
|
39
40
|
href: buildUrl(`/docs/${p.collection}/${p.data.id}/${p.data.version}`),
|
|
40
41
|
}));
|
|
41
42
|
|
|
42
|
-
const ownersList =
|
|
43
|
+
const ownersList = filteredOwners.map((o) => ({
|
|
43
44
|
label: o.data.name,
|
|
44
45
|
type: o.collection,
|
|
45
46
|
badge: o.collection === 'users' ? o.data.role : 'Team',
|
|
@@ -55,14 +55,14 @@ const ownedDomainsList = domains.map((p) => ({
|
|
|
55
55
|
}));
|
|
56
56
|
|
|
57
57
|
const ownedServicesList = services.map((p) => ({
|
|
58
|
-
label: `${p.data.name}
|
|
58
|
+
label: `${p.data.name}`,
|
|
59
59
|
href: buildUrl(`/docs/${p.collection}/${p.data.id}/${p.data.version}`),
|
|
60
60
|
collection: p.collection,
|
|
61
61
|
tag: `v${p.data.version}`,
|
|
62
62
|
}));
|
|
63
63
|
|
|
64
64
|
const ownedEventsList = [...events, ...commands].map((p) => ({
|
|
65
|
-
label: `${p.data.name}
|
|
65
|
+
label: `${p.data.name}`,
|
|
66
66
|
href: buildUrl(`/docs/${p.collection}/${p.data.id}/${p.data.version}`),
|
|
67
67
|
color: p.collection === 'events' ? 'orange' : 'blue',
|
|
68
68
|
collection: p.collection,
|
|
@@ -43,7 +43,7 @@ const ownedDomainsList = domains.map((p) => ({
|
|
|
43
43
|
}));
|
|
44
44
|
|
|
45
45
|
const ownedServicesList = services.map((p) => ({
|
|
46
|
-
label: `${p.data.name}
|
|
46
|
+
label: `${p.data.name}`,
|
|
47
47
|
href: buildUrl(`/docs/${p.collection}/${p.data.id}/${p.data.version}`),
|
|
48
48
|
collection: p.collection,
|
|
49
49
|
tag: `v${p.data.version}`,
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// src/remark-plugins/directives.js
|
|
2
|
+
import { visit } from 'unist-util-visit';
|
|
3
|
+
|
|
4
|
+
export function remarkDirectives() {
|
|
5
|
+
return (tree: any) => {
|
|
6
|
+
visit(tree, (node) => {
|
|
7
|
+
if (node.type === 'containerDirective') {
|
|
8
|
+
const blockTypes = {
|
|
9
|
+
info: 'bg-blue-50 border-l-4 border-blue-500',
|
|
10
|
+
warning: 'bg-yellow-50 border-l-4 border-yellow-500',
|
|
11
|
+
danger: 'bg-red-50 border-l-4 border-red-500',
|
|
12
|
+
tip: 'bg-green-50 border-l-4 border-green-500',
|
|
13
|
+
note: 'bg-gray-50 border-l-4 border-gray-500',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// Lucide icon paths
|
|
17
|
+
const iconPaths = {
|
|
18
|
+
info: 'M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z',
|
|
19
|
+
warning:
|
|
20
|
+
'M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z',
|
|
21
|
+
danger:
|
|
22
|
+
'M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z',
|
|
23
|
+
tip: 'M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z',
|
|
24
|
+
note: 'M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
node.data = node.data || {};
|
|
28
|
+
node.data.hName = 'div';
|
|
29
|
+
node.data.hProperties = {
|
|
30
|
+
class: `rounded-lg p-4 my-4 ${blockTypes[node.name as keyof typeof blockTypes] || ''}`,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// Create header div that will contain icon and type
|
|
34
|
+
const headerNode = {
|
|
35
|
+
type: 'element',
|
|
36
|
+
data: {
|
|
37
|
+
hName: 'div',
|
|
38
|
+
hProperties: {
|
|
39
|
+
class: 'flex items-center gap-2 font-semibold mb-2',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
children: [
|
|
43
|
+
// Lucide Icon SVG
|
|
44
|
+
{
|
|
45
|
+
type: 'element',
|
|
46
|
+
data: {
|
|
47
|
+
hName: 'svg',
|
|
48
|
+
hProperties: {
|
|
49
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
50
|
+
width: '26',
|
|
51
|
+
height: '26',
|
|
52
|
+
viewBox: '0 0 24 24',
|
|
53
|
+
fill: 'none',
|
|
54
|
+
stroke: 'currentColor',
|
|
55
|
+
strokeWidth: '2',
|
|
56
|
+
strokeLinecap: 'round',
|
|
57
|
+
strokeLinejoin: 'round',
|
|
58
|
+
class: 'lucide',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
children: [
|
|
62
|
+
{
|
|
63
|
+
type: 'element',
|
|
64
|
+
data: {
|
|
65
|
+
hName: 'path',
|
|
66
|
+
hProperties: {
|
|
67
|
+
d: iconPaths[node.name as keyof typeof iconPaths] || '',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
// Type label
|
|
74
|
+
{
|
|
75
|
+
type: 'element',
|
|
76
|
+
data: {
|
|
77
|
+
hName: 'span',
|
|
78
|
+
hProperties: {
|
|
79
|
+
class: '',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
children: [
|
|
83
|
+
{
|
|
84
|
+
type: 'text',
|
|
85
|
+
value: node.name.charAt(0).toUpperCase() + node.name.slice(1),
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// Create content div for the rest of the children
|
|
93
|
+
const contentNode = {
|
|
94
|
+
type: 'element',
|
|
95
|
+
data: {
|
|
96
|
+
hName: 'div',
|
|
97
|
+
hProperties: {
|
|
98
|
+
class: 'prose prose-md w-full !max-w-none ',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
children: node.children,
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// Replace node's children with header and content
|
|
105
|
+
node.children = [headerNode, contentNode];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
}
|
|
@@ -21,7 +21,7 @@ interface Props {
|
|
|
21
21
|
|
|
22
22
|
export const getChannels = async ({ getAllVersions = true }: Props = {}): Promise<Channel[]> => {
|
|
23
23
|
const channels = await getCollection('channels', (query) => {
|
|
24
|
-
return (getAllVersions || !query.
|
|
24
|
+
return (getAllVersions || !query.data?.pathToFile?.includes('versioned')) && query.data.hidden !== true;
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
const { commands, events, queries } = await getMessages();
|
|
@@ -8,7 +8,7 @@ export const getChangeLogs = async (item: CollectionEntry<CollectionTypes>): Pro
|
|
|
8
8
|
|
|
9
9
|
// Get all logs for collection type and filter by given collection
|
|
10
10
|
const logs = await getCollection('changelogs', (log) => {
|
|
11
|
-
return log.id.includes(`${collection}/`) && log.
|
|
11
|
+
return log.id.includes(`${collection}/`) && log.id.includes(slug);
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
const hydratedLogs = logs.map((log) => {
|
|
@@ -14,7 +14,7 @@ interface Props {
|
|
|
14
14
|
export const getDomains = async ({ getAllVersions = true }: Props = {}): Promise<Domain[]> => {
|
|
15
15
|
// Get all the domains that are not versioned
|
|
16
16
|
const domains = await getCollection('domains', (domain) => {
|
|
17
|
-
return (getAllVersions || !domain.
|
|
17
|
+
return (getAllVersions || !domain.data?.pathToFile?.includes('versioned')) && domain.data.hidden !== true;
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
// Get all the services that are not versioned
|
|
@@ -14,7 +14,7 @@ interface Props {
|
|
|
14
14
|
export const getFlows = async ({ getAllVersions = true }: Props = {}): Promise<Flow[]> => {
|
|
15
15
|
// Get flows that are not versioned
|
|
16
16
|
const flows = await getCollection('flows', (flow) => {
|
|
17
|
-
return (getAllVersions || !flow.
|
|
17
|
+
return (getAllVersions || !flow.data.pathToFile?.includes('versioned')) && flow.data.hidden !== true;
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
const events = await getCollection('events');
|
|
@@ -15,7 +15,7 @@ interface Props {
|
|
|
15
15
|
export const getServices = async ({ getAllVersions = true }: Props = {}): Promise<Service[]> => {
|
|
16
16
|
// Get services that are not versioned
|
|
17
17
|
const services = await getCollection('services', (service) => {
|
|
18
|
-
return (getAllVersions || !service.
|
|
18
|
+
return (getAllVersions || !service.data?.pathToFile?.includes('versioned')) && service.data.hidden !== true;
|
|
19
19
|
});
|
|
20
20
|
const events = await getCollection('events');
|
|
21
21
|
const commands = await getCollection('commands');
|
|
@@ -19,7 +19,7 @@ interface Props {
|
|
|
19
19
|
|
|
20
20
|
export const getCommands = async ({ getAllVersions = true }: Props = {}): Promise<Command[]> => {
|
|
21
21
|
const commands = await getCollection('commands', (command) => {
|
|
22
|
-
return (getAllVersions || !command.
|
|
22
|
+
return (getAllVersions || !command.data?.pathToFile?.includes('versioned')) && command.data.hidden !== true;
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
const services = await getCollection('services');
|
|
@@ -19,7 +19,7 @@ interface Props {
|
|
|
19
19
|
|
|
20
20
|
export const getEvents = async ({ getAllVersions = true }: Props = {}): Promise<Event[]> => {
|
|
21
21
|
const events = await getCollection('events', (event) => {
|
|
22
|
-
return (getAllVersions || !event.
|
|
22
|
+
return (getAllVersions || !event.data?.pathToFile?.includes('versioned')) && event.data.hidden !== true;
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
const services = await getCollection('services');
|
|
@@ -1,20 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
// Can't use the CollectionEntry type from astro:content because a client component is using this util
|
|
2
|
+
// import { type CollectionEntry } from 'astro:content';
|
|
2
3
|
import { MarkerType, Position, type Edge, type Node } from '@xyflow/react';
|
|
3
4
|
import dagre from 'dagre';
|
|
4
5
|
import { getItemsFromCollectionByIdAndSemverOrLatest } from '@utils/collections/util';
|
|
5
|
-
|
|
6
|
+
interface BaseCollectionData {
|
|
7
|
+
id: string;
|
|
8
|
+
version: string;
|
|
9
|
+
}
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
interface CollectionItem {
|
|
12
|
+
collection: string;
|
|
13
|
+
data: BaseCollectionData;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface MessageCollectionItem extends CollectionItem {
|
|
17
|
+
collection: 'commands' | 'events' | 'queries';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const generateIdForNode = (node: CollectionItem) => {
|
|
8
21
|
return `${node.data.id}-${node.data.version}`;
|
|
9
22
|
};
|
|
10
23
|
export const generateIdForNodes = (nodes: any) => {
|
|
11
24
|
return nodes.map((node: any) => `${node.data.id}-${node.data.version}`).join('-');
|
|
12
25
|
};
|
|
13
|
-
export const generatedIdForEdge = (source:
|
|
26
|
+
export const generatedIdForEdge = (source: CollectionItem, target: CollectionItem) => {
|
|
14
27
|
return `${source.data.id}-${source.data.version}-${target.data.id}-${target.data.version}`;
|
|
15
28
|
};
|
|
16
29
|
|
|
17
|
-
export const getEdgeLabelForServiceAsTarget = (data:
|
|
30
|
+
export const getEdgeLabelForServiceAsTarget = (data: MessageCollectionItem) => {
|
|
18
31
|
const type = data.collection;
|
|
19
32
|
switch (type) {
|
|
20
33
|
case 'commands':
|
|
@@ -27,7 +40,7 @@ export const getEdgeLabelForServiceAsTarget = (data: CollectionEntry<CollectionM
|
|
|
27
40
|
return 'sends to';
|
|
28
41
|
}
|
|
29
42
|
};
|
|
30
|
-
export const getEdgeLabelForMessageAsSource = (data:
|
|
43
|
+
export const getEdgeLabelForMessageAsSource = (data: MessageCollectionItem) => {
|
|
31
44
|
const type = data.collection;
|
|
32
45
|
switch (type) {
|
|
33
46
|
case 'commands':
|
|
@@ -90,10 +103,10 @@ export const getChannelNodesAndEdges = ({
|
|
|
90
103
|
mode = 'full',
|
|
91
104
|
currentNodes = [],
|
|
92
105
|
}: {
|
|
93
|
-
channels:
|
|
106
|
+
channels: CollectionItem[];
|
|
94
107
|
channelsToRender: { id: string; version: string }[];
|
|
95
|
-
source:
|
|
96
|
-
target:
|
|
108
|
+
source: CollectionItem;
|
|
109
|
+
target: CollectionItem;
|
|
97
110
|
channelToTargetLabel?: string;
|
|
98
111
|
sourceToChannelLabel?: string;
|
|
99
112
|
mode?: 'simple' | 'full';
|
|
@@ -19,7 +19,7 @@ interface Props {
|
|
|
19
19
|
|
|
20
20
|
export const getQueries = async ({ getAllVersions = true }: Props = {}): Promise<Query[]> => {
|
|
21
21
|
const queries = await getCollection('queries', (query) => {
|
|
22
|
-
return (getAllVersions || !query.
|
|
22
|
+
return (getAllVersions || !query.data?.pathToFile?.includes('versioned')) && query.data.hidden !== true;
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
const services = await getCollection('services');
|
|
@@ -19,19 +19,19 @@ export const getTeams = async (): Promise<Team[]> => {
|
|
|
19
19
|
|
|
20
20
|
return teams.map((team) => {
|
|
21
21
|
const ownedDomains = domains.filter((domain) => {
|
|
22
|
-
return domain.data.owners?.find((owner) => owner.
|
|
22
|
+
return domain.data.owners?.find((owner) => owner.id === team.data.id);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
const ownedServices = services.filter((service) => {
|
|
26
|
-
return service.data.owners?.find((owner) => owner.
|
|
26
|
+
return service.data.owners?.find((owner) => owner.id === team.data.id);
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
const ownedEvents = events.filter((event) => {
|
|
30
|
-
return event.data.owners?.find((owner) => owner.
|
|
30
|
+
return event.data.owners?.find((owner) => owner.id === team.data.id);
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
const ownedCommands = commands.filter((command) => {
|
|
34
|
-
return command.data.owners?.find((owner) => owner.
|
|
34
|
+
return command.data.owners?.find((owner) => owner.id === team.data.id);
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
return {
|
|
@@ -28,26 +28,26 @@ export const getUsers = async (): Promise<User[]> => {
|
|
|
28
28
|
|
|
29
29
|
return users.map((user) => {
|
|
30
30
|
const associatedTeams = teams.filter((team) => {
|
|
31
|
-
return team.data.members?.some((member) => member.
|
|
31
|
+
return team.data.members?.some((member) => member.id === user.data.id);
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
const ownedDomains = domains.filter((domain) => {
|
|
35
|
-
return domain.data.owners?.find((owner) => owner.
|
|
35
|
+
return domain.data.owners?.find((owner) => owner.id === user.data.id);
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
const isOwnedByUserOrAssociatedTeam = () => {
|
|
39
|
-
const associatedTeamsSlug: string[] = associatedTeams.map((team) => team.
|
|
39
|
+
const associatedTeamsSlug: string[] = associatedTeams.map((team) => team.id);
|
|
40
40
|
|
|
41
41
|
return ({ data }: { data: { owners?: Array<{ slug: string }> } }) => {
|
|
42
42
|
return data.owners?.some((owner) => owner.slug === user.data.id || associatedTeamsSlug.includes(owner.slug));
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
const ownedServices = services.filter(isOwnedByUserOrAssociatedTeam());
|
|
46
|
+
const ownedServices = services.filter(() => isOwnedByUserOrAssociatedTeam());
|
|
47
47
|
|
|
48
|
-
const ownedEvents = events.filter(isOwnedByUserOrAssociatedTeam());
|
|
48
|
+
const ownedEvents = events.filter(() => isOwnedByUserOrAssociatedTeam());
|
|
49
49
|
|
|
50
|
-
const ownedCommands = commands.filter(isOwnedByUserOrAssociatedTeam());
|
|
50
|
+
const ownedCommands = commands.filter(() => isOwnedByUserOrAssociatedTeam());
|
|
51
51
|
|
|
52
52
|
return {
|
|
53
53
|
...user,
|
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.
|
|
9
|
+
"version": "2.17.0",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"format:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx,json,astro}\""
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@astrojs/markdown-remark": "^
|
|
45
|
-
"@astrojs/mdx": "^
|
|
46
|
-
"@astrojs/react": "^
|
|
47
|
-
"@astrojs/tailwind": "^5.1.
|
|
44
|
+
"@astrojs/markdown-remark": "^6.0.1",
|
|
45
|
+
"@astrojs/mdx": "^4.0.2",
|
|
46
|
+
"@astrojs/react": "^4.1.0",
|
|
47
|
+
"@astrojs/tailwind": "^5.1.3",
|
|
48
48
|
"@asyncapi/avro-schema-parser": "^3.0.24",
|
|
49
49
|
"@asyncapi/react-component": "^2.4.3",
|
|
50
50
|
"@headlessui/react": "^2.0.3",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"@tailwindcss/typography": "^0.5.13",
|
|
56
56
|
"@tanstack/react-table": "^8.17.3",
|
|
57
57
|
"@xyflow/react": "^12.3.6",
|
|
58
|
-
"astro": "^
|
|
59
|
-
"astro-expressive-code": "^0.
|
|
58
|
+
"astro": "^5.0.5",
|
|
59
|
+
"astro-expressive-code": "^0.38.3",
|
|
60
60
|
"astro-pagefind": "^1.6.0",
|
|
61
61
|
"astro-seo": "^0.8.4",
|
|
62
62
|
"axios": "^1.7.7",
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"react": "^18.3.1",
|
|
79
79
|
"react-dom": "^18.3.1",
|
|
80
80
|
"rehype-slug": "^6.0.0",
|
|
81
|
+
"remark-directive": "^3.0.0",
|
|
81
82
|
"remark-gfm": "^3.0.1",
|
|
82
83
|
"rimraf": "^5.0.7",
|
|
83
84
|
"semver": "7.6.3",
|
|
@@ -103,6 +104,6 @@
|
|
|
103
104
|
"prettier-plugin-astro": "^0.14.1",
|
|
104
105
|
"tsup": "^8.1.0",
|
|
105
106
|
"vite-tsconfig-paths": "^4.3.2",
|
|
106
|
-
"vitest": "
|
|
107
|
+
"vitest": "2.1.6"
|
|
107
108
|
}
|
|
108
109
|
}
|