@eventcatalog/core 2.19.5 → 2.19.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/README.md CHANGED
@@ -29,7 +29,7 @@
29
29
 
30
30
 
31
31
 
32
- <h4>Features: Documentation generator for Event Driven Architectures, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
32
+ <h4>Features: Documentation generator for Event Driven Architectures, Integration with any broker, Docs and Code, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
33
33
 
34
34
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
35
35
  [![All Contributors](https://img.shields.io/badge/all_contributors-47-orange.svg?style=flat-square)](#contributors-)
@@ -52,6 +52,7 @@
52
52
  - ⭐ Discoverability feature (search, filter and more) ([demo](https://demo.eventcatalog.dev/discover/events))
53
53
  - ⭐ Document teams and users ([demo](https://demo.eventcatalog.dev/docs/teams/full-stack))
54
54
  - 🤖 Automate your catalogs with [generators](https://www.eventcatalog.dev/docs/development/plugins/plugin-overview) (e.g generate your catalogs from your [AsyncAPI](https://www.eventcatalog.dev/docs/ascynapi)/[OpenAPI](https://www.eventcatalog.dev/docs/openapi) documents)
55
+ - 👨🏼‍💻 Follows [Docs as code](https://www.writethedocs.org/guide/docs-as-code/) principles
55
56
  - ⭐ And much more...
56
57
 
57
58
 
@@ -90,9 +91,9 @@ EventCatalog is focused on discovery and documentation and allows you to:
90
91
 
91
92
  EventCatalog is technology agnostic, which means you can integrate your Catalog with any EDA technology of your choice and any schema formats.
92
93
 
93
- EventCatalog supports a [Plugin Architecture](https://eventcatalog-website-v2.vercel.app/docs/development/plugins/plugin-overview) which will let you generate documentation from your systems.
94
+ EventCatalog supports a [Plugin Architecture](https://github.com/event-catalog/generators) which lets you generate documentation from your systems including OpenAPI, AsyncAPI, Event Brokers and more.
94
95
 
95
- You can read more on [how it works on the website](https://eventcatalog.dev)
96
+ You can read more on [how it works on GitHub](https://github.com/event-catalog/eventcatalog)
96
97
 
97
98
  # Getting Started
98
99
 
@@ -126,8 +127,6 @@ Thank you to our project sponsors.
126
127
  <a href="https://hookdeck.com/?ref=eventcatalog-sponsor" target="_blank" >Learn more</a>
127
128
  </div> -->
128
129
 
129
- <hr />
130
-
131
130
  <div align="center">
132
131
  <img alt="hookdeck" src="./images/sponsors/gravitee-logo-black.svg" width="50%" />
133
132
  <p style="margin: 0; padding: 0;">Manage, secure, and govern every API in your organization</p>
@@ -37,7 +37,7 @@ var import_axios = __toESM(require("axios"), 1);
37
37
  var import_os = __toESM(require("os"), 1);
38
38
 
39
39
  // package.json
40
- var version = "2.19.5";
40
+ var version = "2.19.7";
41
41
 
42
42
  // src/constants.ts
43
43
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-Q6OST5JI.js";
4
- import "../chunk-OKHQFK4L.js";
3
+ } from "../chunk-3CL5OM5M.js";
4
+ import "../chunk-GHC5YZDP.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -106,7 +106,7 @@ var import_axios = __toESM(require("axios"), 1);
106
106
  var import_os = __toESM(require("os"), 1);
107
107
 
108
108
  // package.json
109
- var version = "2.19.5";
109
+ var version = "2.19.7";
110
110
 
111
111
  // src/constants.ts
112
112
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-TWY4P4FZ.js";
4
- import "../chunk-Q6OST5JI.js";
5
- import "../chunk-OKHQFK4L.js";
3
+ } from "../chunk-SBVM6HJV.js";
4
+ import "../chunk-3CL5OM5M.js";
5
+ import "../chunk-GHC5YZDP.js";
6
6
  import "../chunk-E7TXTI7G.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-OKHQFK4L.js";
3
+ } from "./chunk-GHC5YZDP.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.19.5";
2
+ var version = "2.19.7";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-Q6OST5JI.js";
3
+ } from "./chunk-3CL5OM5M.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.19.5";
28
+ var version = "2.19.7";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-OKHQFK4L.js";
3
+ } from "./chunk-GHC5YZDP.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -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.19.5";
164
+ var version = "2.19.7";
165
165
 
166
166
  // src/constants.ts
167
167
  var VERSION = version;
@@ -3,14 +3,14 @@ import {
3
3
  } from "./chunk-SHCMAL37.js";
4
4
  import {
5
5
  log_build_default
6
- } from "./chunk-TWY4P4FZ.js";
7
- import "./chunk-Q6OST5JI.js";
6
+ } from "./chunk-SBVM6HJV.js";
7
+ import "./chunk-3CL5OM5M.js";
8
8
  import {
9
9
  catalogToAstro
10
10
  } from "./chunk-WF34R5UT.js";
11
11
  import {
12
12
  VERSION
13
- } from "./chunk-OKHQFK4L.js";
13
+ } from "./chunk-GHC5YZDP.js";
14
14
  import {
15
15
  generate
16
16
  } from "./chunk-YEQVKHST.js";
@@ -12,7 +12,7 @@ const logo = {
12
12
 
13
13
  <nav
14
14
  id="eventcatalog-header"
15
- class="fixed top-0 left-0 right-0 bg-white border-b border-gray-100 py-3 font-bold text-xl bg-opacity-20 backdrop-blur-sm z-10"
15
+ class="fixed top-0 left-0 right-0 h-header bg-white border-b border-gray-100 py-3 font-bold text-xl bg-opacity-20 backdrop-blur-sm z-10"
16
16
  >
17
17
  <div class="px-4 sm:px-4 lg:px-4">
18
18
  <div class="flex justify-between items-center">
@@ -76,7 +76,7 @@ const logo = {
76
76
  </div>
77
77
  </nav>
78
78
 
79
- <div id="eventcatalog-header-spacer" class="h-16"></div>
79
+ <div id="eventcatalog-header-spacer" class="h-header"></div>
80
80
  <!-- Spacer to prevent content from being hidden under the fixed header -->
81
81
 
82
82
  <script>
@@ -9,34 +9,100 @@ import {
9
9
  useReactTable,
10
10
  type Column,
11
11
  type ColumnFiltersState,
12
- type Row,
13
12
  } from '@tanstack/react-table';
14
- import type { CollectionEntry } from 'astro:content';
15
13
  import DebouncedInput from './DebouncedInput';
16
14
 
17
15
  import { getColumnsByCollection } from './columns';
18
- import { useEffect, useMemo, useState, type EventHandler } from 'react';
19
- import type { CollectionTypes } from '@types';
16
+ import { useEffect, useMemo, useState } from 'react';
17
+ import type { CollectionMessageTypes } from '@types';
20
18
  import { isSameVersion } from '@utils/collections/util';
21
19
 
22
20
  declare module '@tanstack/react-table' {
23
21
  // @ts-ignore
24
22
  interface ColumnMeta<TData extends RowData, TValue> {
25
23
  filterVariant?: 'collection' | 'name' | 'badges';
26
- collectionFilterKey?: string;
24
+ collectionFilterKey?: 'producers' | 'consumers' | 'sends' | 'receives' | 'services';
27
25
  showFilter?: boolean;
28
26
  className?: string;
29
27
  }
30
28
  }
31
29
 
32
- export const Table = ({
30
+ export type TCollectionTypes = 'domains' | 'services' | CollectionMessageTypes | 'flows';
31
+
32
+ export type TData<T extends TCollectionTypes> = {
33
+ collection: T;
34
+ data: {
35
+ id: string;
36
+ name: string;
37
+ summary: string;
38
+ version: string;
39
+ latestVersion?: string; // Defined on getter collection utility
40
+ badges?: Array<{
41
+ id: string; // Where is it defined?
42
+ content: string;
43
+ backgroundColor: string;
44
+ textColor: string;
45
+ icon: any; // Where is it defined?
46
+ }>;
47
+ // ---------------------------------------------------------------------------
48
+ // Domains
49
+ services?: Array<{
50
+ collection: string; // Be more specific;
51
+ data: {
52
+ id: string;
53
+ name: string;
54
+ version: string;
55
+ };
56
+ }>;
57
+ // ---------------------------------------------------------------------------
58
+ // Services
59
+ receives?: Array<{
60
+ collection: string; // Be more specific;
61
+ data: {
62
+ id: string;
63
+ name: string;
64
+ version: string;
65
+ };
66
+ }>;
67
+ sends?: Array<{
68
+ collection: string; // Be more specific;
69
+ data: {
70
+ id: string;
71
+ name: string;
72
+ version: string;
73
+ };
74
+ }>;
75
+ // ---------------------------------------------------------------------------
76
+ // Messages
77
+ producers?: Array<{
78
+ collection: string; // Specify only 'services'?
79
+ data: {
80
+ id: string;
81
+ name: string;
82
+ version: string;
83
+ };
84
+ }>;
85
+ // Only for messages
86
+ consumers?: Array<{
87
+ collection: string; // Specify only 'services'?
88
+ data: {
89
+ id: string;
90
+ name: string;
91
+ version: string;
92
+ };
93
+ }>;
94
+ // ---------------------------------------------------------------------------
95
+ };
96
+ };
97
+
98
+ export const Table = <T extends TCollectionTypes>({
33
99
  data: initialData,
34
100
  collection,
35
101
  mode = 'simple',
36
102
  checkboxLatestId,
37
103
  }: {
38
- data: CollectionEntry<'events'>[];
39
- collection: string;
104
+ data: TData<T>[];
105
+ collection: T;
40
106
  checkboxLatestId: string;
41
107
  mode?: 'simple' | 'full';
42
108
  }) => {
@@ -68,7 +134,6 @@ export const Table = ({
68
134
  const columns = useMemo(() => getColumnsByCollection(collection), [collection]);
69
135
 
70
136
  const table = useReactTable({
71
- // @ts-ignore
72
137
  data,
73
138
  columns,
74
139
  onColumnFiltersChange: setColumnFilters,
@@ -106,7 +171,6 @@ export const Table = ({
106
171
  <div className="text-md">
107
172
  {header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())}
108
173
  </div>
109
- {/* @ts-ignore */}
110
174
  <div className="">
111
175
  {header.column.columnDef.meta?.showFilter !== false && <Filter column={header.column} />}
112
176
  {header.column.columnDef.meta?.showFilter == false && <div className="h-10" />}
@@ -201,23 +265,17 @@ export const Table = ({
201
265
  );
202
266
  };
203
267
 
204
- function Filter({ column }: { column: Column<any, unknown> }) {
205
- const { filterVariant, collectionFilterKey = '' } = column.columnDef.meta ?? {};
268
+ function Filter<T extends TCollectionTypes>({ column }: { column: Column<TData<T>, unknown> }) {
269
+ const { filterVariant, collectionFilterKey } = column.columnDef.meta ?? {};
206
270
 
207
271
  const columnFilterValue = column.getFilterValue();
208
272
 
209
273
  const sortedUniqueValues = useMemo(() => {
210
- if (filterVariant === 'collection') {
274
+ if (filterVariant === 'collection' && collectionFilterKey) {
211
275
  const rows = column.getFacetedRowModel().rows;
212
- const data = rows
213
- .map((row: Row<CollectionEntry<CollectionTypes>>) => {
214
- // @ts-ignore
215
- const items = row.original.data[collectionFilterKey];
216
- return items as CollectionEntry<CollectionTypes>[];
217
- })
218
- .flat();
276
+ const data = rows.map((row) => row.original.data?.[collectionFilterKey] ?? []).flat();
219
277
 
220
- const allItems = data.map((item) => `${item.data.name} (v${item.data.version})`);
278
+ const allItems = data.map((item) => `${item?.data.name} (v${item?.data.version})`);
221
279
  const uniqueItemsInList = Array.from(new Set(allItems));
222
280
 
223
281
  return uniqueItemsInList.sort().slice(0, 2000);
@@ -225,10 +283,9 @@ function Filter({ column }: { column: Column<any, unknown> }) {
225
283
  if (filterVariant === 'name') {
226
284
  const rows = column.getFacetedRowModel().rows;
227
285
  const data = rows
228
- .map((row: Row<CollectionEntry<CollectionTypes>>) => {
229
- // @ts-ignore
286
+ .map((row) => {
230
287
  const data = row.original;
231
- return data as CollectionEntry<CollectionTypes>;
288
+ return data;
232
289
  })
233
290
  .flat();
234
291
 
@@ -1,13 +1,12 @@
1
1
  import { ServerIcon } from '@heroicons/react/20/solid';
2
2
  import { RectangleGroupIcon } from '@heroicons/react/20/solid';
3
3
  import { createColumnHelper } from '@tanstack/react-table';
4
- import type { CollectionEntry } from 'astro:content';
5
- import { filterByBadge, filterByName, filterCollectionByName } from '../filters/custom-filters';
4
+ import { filterByName, filterCollectionByName } from '../filters/custom-filters';
6
5
  import { buildUrl } from '@utils/url-builder';
7
- import { Tag } from 'lucide-react';
8
6
  import { createBadgesColumn } from './SharedColumns';
7
+ import type { TData } from '../Table';
9
8
 
10
- const columnHelper = createColumnHelper<CollectionEntry<'domains'>>();
9
+ const columnHelper = createColumnHelper<TData<'domains'>>();
11
10
 
12
11
  export const columns = () => [
13
12
  columnHelper.accessor('data.name', {
@@ -65,7 +64,7 @@ export const columns = () => [
65
64
 
66
65
  return (
67
66
  <ul>
68
- {services.map((consumer: any) => {
67
+ {services.map((consumer) => {
69
68
  const color = 'pink';
70
69
  return (
71
70
  <li key={consumer.data.id} className="py-1 group ">
@@ -1,11 +1,11 @@
1
1
  import { createColumnHelper } from '@tanstack/react-table';
2
- import type { CollectionEntry } from 'astro:content';
3
2
  import { filterByName } from '../filters/custom-filters';
4
3
  import { buildUrl } from '@utils/url-builder';
5
4
  import { QueueListIcon } from '@heroicons/react/24/solid';
6
5
  import { createBadgesColumn } from './SharedColumns';
6
+ import type { TData } from '../Table';
7
7
 
8
- const columnHelper = createColumnHelper<CollectionEntry<'flows'>>();
8
+ const columnHelper = createColumnHelper<TData<'flows'>>();
9
9
 
10
10
  export const columns = () => [
11
11
  columnHelper.accessor('data.name', {
@@ -1,13 +1,13 @@
1
1
  import { ServerIcon, BoltIcon, ChatBubbleLeftIcon, MagnifyingGlassIcon } from '@heroicons/react/24/solid';
2
2
  import { createColumnHelper } from '@tanstack/react-table';
3
- import type { CollectionMessageTypes } from '@types';
4
- import type { CollectionEntry } from 'astro:content';
5
3
  import { useMemo } from 'react';
6
- import { filterByName, filterCollectionByName, filterByBadge } from '../filters/custom-filters';
4
+ import { filterByName, filterCollectionByName } from '../filters/custom-filters';
7
5
  import { buildUrl } from '@utils/url-builder';
8
6
  import { createBadgesColumn } from './SharedColumns';
7
+ import type { TData } from '../Table';
8
+ import type { CollectionMessageTypes } from '@types';
9
9
 
10
- const columnHelper = createColumnHelper<CollectionEntry<CollectionMessageTypes>>();
10
+ const columnHelper = createColumnHelper<TData<CollectionMessageTypes>>();
11
11
 
12
12
  export const getColorAndIconForMessageType = (type: string) => {
13
13
  switch (type) {
@@ -80,7 +80,7 @@ export const columns = () => [
80
80
  return <div className="font-light text-sm text-gray-400/60 text-left italic">No producers documented</div>;
81
81
  return (
82
82
  <ul className="">
83
- {producers.map((producer: any, index: number) => {
83
+ {producers.map((producer, index) => {
84
84
  return (
85
85
  <li className="py-2 group flex items-center space-x-2" key={`${producer.data.id}-${index}`}>
86
86
  <a
@@ -120,7 +120,7 @@ export const columns = () => [
120
120
 
121
121
  return (
122
122
  <ul>
123
- {consumers.map((consumer: any, index: number) => {
123
+ {consumers.map((consumer, index) => {
124
124
  return (
125
125
  <li key={`${consumer.data.id}-${index}`} className="py-1 group font-light ">
126
126
  <a
@@ -1,13 +1,13 @@
1
1
  import { ServerIcon, BoltIcon, ChatBubbleLeftIcon } from '@heroicons/react/24/solid';
2
2
  import { createColumnHelper } from '@tanstack/react-table';
3
- import type { CollectionEntry } from 'astro:content';
4
3
  import { useMemo, useState } from 'react';
5
4
  import { filterByName, filterCollectionByName } from '../filters/custom-filters';
6
5
  import { buildUrl } from '@utils/url-builder';
7
6
  import { getColorAndIconForMessageType } from './MessageTableColumns';
8
7
  import { createBadgesColumn } from './SharedColumns';
8
+ import type { TData } from '../Table';
9
9
 
10
- const columnHelper = createColumnHelper<CollectionEntry<'services'>>();
10
+ const columnHelper = createColumnHelper<TData<'services'>>();
11
11
 
12
12
  export const columns = () => [
13
13
  columnHelper.accessor('data.name', {
@@ -65,7 +65,7 @@ export const columns = () => [
65
65
 
66
66
  const receiversWithIcons = useMemo(
67
67
  () =>
68
- receives?.map((consumer: any) => {
68
+ receives?.map((consumer) => {
69
69
  const type = consumer.collection.slice(0, -1);
70
70
  return {
71
71
  ...consumer,
@@ -87,7 +87,7 @@ export const columns = () => [
87
87
  )}
88
88
  {isExpanded && (
89
89
  <ul>
90
- {receiversWithIcons.map((consumer: any, index: number) => (
90
+ {receiversWithIcons.map((consumer, index: number) => (
91
91
  <li key={`${consumer.data.id}-${index}`} className="py-1 group font-light ">
92
92
  <a
93
93
  href={buildUrl(`/docs/${consumer.collection}/${consumer.data.id}/${consumer.data.version}`)}
@@ -137,7 +137,7 @@ export const columns = () => [
137
137
  )}
138
138
  {isExpanded && (
139
139
  <ul>
140
- {sends.map((consumer: any, index: number) => {
140
+ {sends.map((consumer, index) => {
141
141
  const type = consumer.collection.slice(0, -1);
142
142
  const color = type === 'event' ? 'orange' : 'blue';
143
143
  const Icon = type === 'event' ? BoltIcon : ChatBubbleLeftIcon;
@@ -1,7 +1,9 @@
1
1
  import { createColumnHelper } from '@tanstack/react-table';
2
2
  import { Tag } from 'lucide-react';
3
3
  import { filterByBadge } from '../filters/custom-filters';
4
- export const createBadgesColumn = <T extends { data: { badges?: any[] } }>(
4
+ import type { TCollectionTypes, TData } from '../Table';
5
+
6
+ export const createBadgesColumn = <T extends { data: Pick<TData<U>['data'], 'badges'> }, U extends TCollectionTypes>(
5
7
  columnHelper: ReturnType<typeof createColumnHelper<T>>
6
8
  ) => {
7
9
  return columnHelper.accessor((row) => row.data.badges, {
@@ -16,7 +18,7 @@ export const createBadgesColumn = <T extends { data: { badges?: any[] } }>(
16
18
 
17
19
  return (
18
20
  <ul>
19
- {badges.map((badge: any, index: number) => {
21
+ {badges.map((badge, index) => {
20
22
  return (
21
23
  <li key={`${badge.id}-${index}`} className="py-1 group font-light ">
22
24
  <div className="group-hover:text-primary flex space-x-1 items-center ">
@@ -1,5 +1,5 @@
1
1
  ---
2
- import { Table } from '@components/Tables/Table';
2
+ import { Table, type TData, type TCollectionTypes } from '@components/Tables/Table';
3
3
  import { QueueListIcon, RectangleGroupIcon, BoltIcon, ChatBubbleLeftIcon } from '@heroicons/react/24/outline';
4
4
  import ServerIcon from '@heroicons/react/24/outline/ServerIcon';
5
5
  import { getCommands } from '@utils/commands';
@@ -20,6 +20,13 @@ const services = await getServices();
20
20
  const domains = await getDomains();
21
21
  const flows = await getFlows();
22
22
 
23
+ export interface Props<T extends TCollectionTypes> {
24
+ title: string;
25
+ subtitle: string;
26
+ data: TData<T>[];
27
+ type: T;
28
+ }
29
+
23
30
  const { title, subtitle, data, type } = Astro.props;
24
31
  const currentPath = Astro.url.pathname;
25
32
 
@@ -202,12 +202,15 @@ const showSideBarOnLoad = currentNavigationItem?.sidebar;
202
202
 
203
203
  <div
204
204
  id="sidebar"
205
- class={`sidebar-transition h-[100vh] max-h-screen px-5 py-4 overflow-y-auto bg-white bg-gradient-to-b from-white to-gray-100 border-r border-gray-200 w-60 shadow-lg ml-16 ${showSideBarOnLoad ? 'block' : 'hidden'}`}
205
+ class={`sidebar-transition h-content px-5 py-4 overflow-y-auto bg-white bg-gradient-to-b from-white to-gray-100 border-r border-gray-200 w-60 shadow-lg ml-16 ${showSideBarOnLoad ? 'block' : 'hidden'}`}
206
206
  >
207
207
  <CatalogResourcesSideBar resources={sideNav} currentPath={currentPath} client:load />
208
208
  </div>
209
209
  </aside>
210
- <main class={`sidebar-transition w-full max-h-screen ${showSideBarOnLoad ? 'ml-0' : 'ml-16'}`} id="content">
210
+ <main
211
+ class={`sidebar-transition w-full max-h-content overflow-y-auto ${showSideBarOnLoad ? 'ml-0' : 'ml-16'}`}
212
+ id="content"
213
+ >
211
214
  <slot />
212
215
  </main>
213
216
  </div>
@@ -1,10 +1,8 @@
1
1
  ---
2
- import DiscoverLayout from '@layouts/DiscoverLayout.astro';
3
- import type { PageTypes } from '@types';
2
+ import DiscoverLayout, { type Props as DiscoverLayoutProps } from '@layouts/DiscoverLayout.astro';
4
3
  import { getFlows } from '@utils/collections/flows';
5
4
 
6
5
  import { pageDataLoader } from '@utils/page-loaders/page-data-loader';
7
- type PageTypesWithFlows = PageTypes | 'flows';
8
6
 
9
7
  export async function getStaticPaths() {
10
8
  const loaders = {
@@ -12,7 +10,7 @@ export async function getStaticPaths() {
12
10
  flows: getFlows,
13
11
  };
14
12
 
15
- const itemTypes: PageTypesWithFlows[] = ['events', 'commands', 'queries', 'services', 'domains', 'flows', 'channels'];
13
+ const itemTypes = ['events', 'commands', 'queries', 'services', 'domains', 'flows'] as const;
16
14
  const allItems = await Promise.all(itemTypes.map((type) => loaders[type]()));
17
15
 
18
16
  return allItems.flatMap((items, index) => ({
@@ -27,11 +25,45 @@ export async function getStaticPaths() {
27
25
  }
28
26
 
29
27
  const { type, data } = Astro.props;
28
+
29
+ function mapToItem(i: any) {
30
+ return {
31
+ collection: i.collection,
32
+ data: {
33
+ id: i.data.id,
34
+ name: i.data.name,
35
+ version: i.data.version,
36
+ },
37
+ };
38
+ }
30
39
  ---
31
40
 
32
41
  <DiscoverLayout
33
42
  title={`${type} (${data.length})`}
34
43
  subtitle={`Find, filter and search for any ${type} in your system.`}
35
- data={data}
44
+ data={data.map(
45
+ (d) =>
46
+ ({
47
+ collection: d.collection,
48
+ data: {
49
+ id: d.data.id,
50
+ name: d.data.name,
51
+ summary: d.data?.summary,
52
+ version: d.data.version,
53
+ latestVersion: d.data?.latestVersion,
54
+ badges: d.data?.badges,
55
+ // @ts-ignore
56
+ consumers: d.data?.consumers?.map(mapToItem) ?? [],
57
+ // @ts-ignore
58
+ producers: d.data?.producers?.map(mapToItem) ?? [],
59
+ // @ts-ignore
60
+ receives: d.data?.receives?.map(mapToItem) ?? [],
61
+ // @ts-ignore
62
+ sends: d.data?.sends?.map(mapToItem) ?? [],
63
+ // @ts-ignore
64
+ services: d.data?.services?.map(mapToItem) ?? [],
65
+ },
66
+ }) as DiscoverLayoutProps<typeof type>['data'][0]
67
+ )}
36
68
  type={type}
37
69
  />
@@ -42,7 +42,7 @@ const pathOnDisk = path.join(process.cwd(), 'public', pathToSpec);
42
42
  const fileExists = fs.existsSync(pathOnDisk);
43
43
  ---
44
44
 
45
- <VerticalSideBarLayout title="OpenAPI Spec" }>
45
+ <VerticalSideBarLayout title="OpenAPI Spec">
46
46
  {
47
47
  !fileExists ? (
48
48
  <div class="text-center h-screen flex flex-col justify-center ">
@@ -65,7 +65,7 @@ const fileExists = fs.existsSync(pathOnDisk);
65
65
  theme="light"
66
66
  schema-style="table"
67
67
  class="relative top-0"
68
- style={{ height: '100vh', width: '100%', zIndex: 100 }}
68
+ style={{ height: '100%', width: '100%', zIndex: 100 }}
69
69
  regular-font="ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji"
70
70
  bg-color="#ffffff"
71
71
  primary-color="#6b21a8"
@@ -1,10 +1,21 @@
1
- /** @type {import('tailwindcss').Config} */
2
1
  import config from './eventcatalog.config.js';
2
+
3
+ const HEADER_HEIGHT = '4rem';
3
4
  const theme = config.theme || {};
5
+
6
+ /** @type {import('tailwindcss').Config} */
4
7
  export default {
5
8
  content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
6
9
  theme: {
7
10
  extend: {
11
+ height: {
12
+ header: HEADER_HEIGHT,
13
+ content: `calc(100vh - ${HEADER_HEIGHT})`,
14
+ },
15
+ spacing: {
16
+ header: HEADER_HEIGHT,
17
+ content: `calc(100vh - ${HEADER_HEIGHT})`,
18
+ },
8
19
  screens: {
9
20
  xxl: '1990px',
10
21
  },
@@ -17,7 +28,7 @@ export default {
17
28
  DEFAULT: '#ff6633',
18
29
  dark: '#cc3300',
19
30
  },
20
- ...theme
31
+ ...theme,
21
32
  },
22
33
  },
23
34
  },
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.19.5",
9
+ "version": "2.19.7",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },