@eventcatalog/core 2.25.1 → 2.26.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/README.md +7 -3
- 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 -7
- package/dist/catalog-to-astro-content-directory.js +2 -2
- package/dist/{chunk-7JDTB3U5.js → chunk-FIY5JLSQ.js} +0 -2
- package/dist/{chunk-OZLFIB46.js → chunk-JCGLXXSE.js} +1 -1
- package/dist/{chunk-O33THQNO.js → chunk-M7ERKXSB.js} +1 -1
- package/dist/{chunk-VCR3LHZR.js → chunk-R2NILSWL.js} +2 -6
- package/dist/{chunk-DZIMF2ES.js → chunk-TOTPAQ4C.js} +1 -1
- package/dist/{chunk-OW2FQPYP.js → chunk-WUCY3QHK.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +2 -8
- package/dist/eventcatalog.js +6 -6
- package/dist/map-catalog-to-astro.cjs +0 -2
- package/dist/map-catalog-to-astro.js +1 -1
- package/dist/watcher.cjs +0 -2
- package/dist/watcher.js +2 -2
- package/eventcatalog/src/components/Lists/OwnersList.tsx +3 -2
- package/eventcatalog/src/components/Lists/PillListFlat.tsx +6 -4
- package/eventcatalog/src/components/Lists/RepositoryList.astro +3 -2
- package/eventcatalog/src/components/Lists/VersionList.astro +3 -22
- package/eventcatalog/src/components/MDX/MessageTable/MessageTable.astro +87 -0
- package/eventcatalog/src/components/MDX/MessageTable/MessageTable.client.tsx +430 -0
- package/eventcatalog/src/components/MDX/components.tsx +2 -0
- package/eventcatalog/src/components/SideBars/DomainSideBar.astro +38 -1
- package/eventcatalog/src/components/SideBars/ServiceSideBar.astro +22 -17
- package/eventcatalog/src/{content/config.ts → content.config.ts} +12 -2
- package/eventcatalog/src/enterprise/ai-assistant/components/ChatSidebar.tsx +0 -1
- package/eventcatalog/src/pages/chat/index.astro +1 -1
- package/eventcatalog/src/pages/docs/teams/[id]/index.astro +6 -13
- package/eventcatalog/src/pages/docs/users/[id]/index.astro +7 -13
- package/eventcatalog/src/utils/collections/domains.ts +27 -0
- package/eventcatalog/src/utils/users.ts +2 -2
- package/package.json +1 -1
- package/default-files-for-collections/teams.md +0 -11
- package/default-files-for-collections/users.md +0 -11
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import components from '@components/MDX/components';
|
|
3
3
|
|
|
4
4
|
// SideBars
|
|
5
|
+
import { render } from 'astro:content';
|
|
5
6
|
import type { CollectionEntry } from 'astro:content';
|
|
6
7
|
import OwnersList from '@components/Lists/OwnersList';
|
|
7
8
|
import PillListFlat from '@components/Lists/PillListFlat';
|
|
@@ -11,23 +12,16 @@ import { buildUrl } from '@utils/url-builder';
|
|
|
11
12
|
import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
|
|
12
13
|
|
|
13
14
|
export async function getStaticPaths() {
|
|
14
|
-
const
|
|
15
|
+
const users = await getUsers();
|
|
15
16
|
|
|
16
|
-
return
|
|
17
|
-
params: {
|
|
18
|
-
|
|
19
|
-
id: team.data.id,
|
|
20
|
-
},
|
|
21
|
-
props: {
|
|
22
|
-
type: 'team',
|
|
23
|
-
...team,
|
|
24
|
-
},
|
|
17
|
+
return users.map((user) => ({
|
|
18
|
+
params: { id: user.data.id },
|
|
19
|
+
props: user,
|
|
25
20
|
}));
|
|
26
21
|
}
|
|
27
22
|
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
const { Content } = await render();
|
|
23
|
+
const props = Astro.props;
|
|
24
|
+
const { Content } = await render(props);
|
|
31
25
|
|
|
32
26
|
const domains = props.data.ownedDomains as CollectionEntry<'domains'>[];
|
|
33
27
|
const services = props.data.ownedServices as CollectionEntry<'services'>[];
|
|
@@ -2,6 +2,7 @@ import { getItemsFromCollectionByIdAndSemverOrLatest, getVersionForCollectionIte
|
|
|
2
2
|
import { getCollection } from 'astro:content';
|
|
3
3
|
import type { CollectionEntry } from 'astro:content';
|
|
4
4
|
import path from 'path';
|
|
5
|
+
import type { CollectionMessageTypes } from '@types';
|
|
5
6
|
|
|
6
7
|
const PROJECT_DIR = process.env.PROJECT_DIR || process.cwd();
|
|
7
8
|
|
|
@@ -73,6 +74,32 @@ export const getDomains = async ({ getAllVersions = true }: Props = {}): Promise
|
|
|
73
74
|
return cachedDomains[cacheKey];
|
|
74
75
|
};
|
|
75
76
|
|
|
77
|
+
export const getMessagesForDomain = async (
|
|
78
|
+
domain: Domain
|
|
79
|
+
): Promise<{ sends: CollectionEntry<CollectionMessageTypes>[]; receives: CollectionEntry<CollectionMessageTypes>[] }> => {
|
|
80
|
+
// We already have the services from the domain
|
|
81
|
+
const services = domain.data.services as unknown as CollectionEntry<'services'>[];
|
|
82
|
+
|
|
83
|
+
const events = await getCollection('events');
|
|
84
|
+
const commands = await getCollection('commands');
|
|
85
|
+
const queries = await getCollection('queries');
|
|
86
|
+
|
|
87
|
+
const allMessages = [...events, ...commands, ...queries];
|
|
88
|
+
|
|
89
|
+
const sends = services.flatMap((service) => service.data.sends || []);
|
|
90
|
+
const receives = services.flatMap((service) => service.data.receives || []);
|
|
91
|
+
|
|
92
|
+
const sendsMessages = sends.map((send) => getItemsFromCollectionByIdAndSemverOrLatest(allMessages, send.id, send.version));
|
|
93
|
+
const receivesMessages = receives.map((receive) =>
|
|
94
|
+
getItemsFromCollectionByIdAndSemverOrLatest(allMessages, receive.id, receive.version)
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
sends: sendsMessages.flat(),
|
|
99
|
+
receives: receivesMessages.flat(),
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
|
|
76
103
|
export const getUbiquitousLanguage = async (domain: Domain): Promise<UbiquitousLanguage[]> => {
|
|
77
104
|
const ubiquitousLanguages = await getCollection('ubiquitousLanguages', (ubiquitousLanguage: UbiquitousLanguage) => {
|
|
78
105
|
return ubiquitousLanguage.slug.startsWith(`${domain.collection}/${domain.slug}`);
|
|
@@ -32,8 +32,8 @@ export const getUsers = async (): Promise<User[]> => {
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
const isOwnedByUserOrAssociatedTeam = (item: CollectionEntry<CollectionTypes>) => {
|
|
35
|
-
const
|
|
36
|
-
return item.data.owners?.some((owner) => owner.id === user.data.id ||
|
|
35
|
+
const associatedTeamsId: string[] = associatedTeams.map((team) => team.data.id);
|
|
36
|
+
return item.data.owners?.some((owner) => owner.id === user.data.id || associatedTeamsId.includes(owner.id));
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
const ownedServices = services.filter(isOwnedByUserOrAssociatedTeam);
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: dboyne
|
|
3
|
-
name: David Boyne
|
|
4
|
-
avatarUrl: "https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png"
|
|
5
|
-
role: Lead developer
|
|
6
|
-
email: test@test.com
|
|
7
|
-
hidden: true
|
|
8
|
-
slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<!-- Do not delete this file, required for EC, you an ignore this file -->
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: dboyne
|
|
3
|
-
name: David Boyne
|
|
4
|
-
avatarUrl: "https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png"
|
|
5
|
-
role: Lead developer
|
|
6
|
-
email: test@test.com
|
|
7
|
-
hidden: true
|
|
8
|
-
slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<!-- Do not delete this file, required for EC, you an ignore this file -->
|