@eventcatalog/core 2.11.2 → 2.11.3
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/pages/index.astro +4 -4
- package/src/utils/messages.ts +19 -5
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/pages/index.astro
CHANGED
|
@@ -17,10 +17,10 @@ import DiscoverInsight from '@components/DiscoverInsight.astro';
|
|
|
17
17
|
import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
|
|
18
18
|
import { BookOpen, BookOpenText, TableProperties, Workflow } from 'lucide-react';
|
|
19
19
|
|
|
20
|
-
const { commands = [], events = [], queries = [] } = await getMessages();
|
|
21
|
-
const domains = await getDomains();
|
|
22
|
-
const services = await getServices();
|
|
23
|
-
const flows = await getFlows();
|
|
20
|
+
const { commands = [], events = [], queries = [] } = await getMessages({ getAllVersions: false });
|
|
21
|
+
const domains = await getDomains({ getAllVersions: false });
|
|
22
|
+
const services = await getServices({ getAllVersions: false });
|
|
23
|
+
const flows = await getFlows({ getAllVersions: false });
|
|
24
24
|
|
|
25
25
|
const getDefaultUrl = (route: string, defaultValue: string) => {
|
|
26
26
|
if (domains.length > 0) return buildUrl(`/${route}/domains/${domains[0].data.id}/${domains[0].data.latestVersion}`);
|
package/src/utils/messages.ts
CHANGED
|
@@ -2,14 +2,28 @@
|
|
|
2
2
|
import { getCommands } from '@utils/commands';
|
|
3
3
|
import { getEvents } from '@utils/events';
|
|
4
4
|
import { getQueries } from './queries';
|
|
5
|
+
import type { CollectionEntry } from 'astro:content';
|
|
5
6
|
export { getCommands } from '@utils/commands';
|
|
6
7
|
export { getEvents } from '@utils/events';
|
|
7
8
|
|
|
9
|
+
interface Props {
|
|
10
|
+
getAllVersions?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type Messages = {
|
|
14
|
+
commands: CollectionEntry<'commands'>[];
|
|
15
|
+
events: CollectionEntry<'events'>[];
|
|
16
|
+
queries: CollectionEntry<'queries'>[];
|
|
17
|
+
};
|
|
8
18
|
// Main function that uses the imported functions
|
|
9
|
-
export const getMessages = async () => {
|
|
10
|
-
const commands = await getCommands();
|
|
11
|
-
const events = await getEvents();
|
|
12
|
-
const queries = await getQueries();
|
|
19
|
+
export const getMessages = async ({ getAllVersions = true }: Props = {}): Promise<Messages> => {
|
|
20
|
+
const commands = await getCommands({ getAllVersions });
|
|
21
|
+
const events = await getEvents({ getAllVersions });
|
|
22
|
+
const queries = await getQueries({ getAllVersions });
|
|
13
23
|
|
|
14
|
-
return {
|
|
24
|
+
return {
|
|
25
|
+
commands: commands as CollectionEntry<'commands'>[],
|
|
26
|
+
events: events as CollectionEntry<'events'>[],
|
|
27
|
+
queries: queries as CollectionEntry<'queries'>[],
|
|
28
|
+
} satisfies Messages;
|
|
15
29
|
};
|