@eventcatalog/core 2.62.1 → 2.64.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.
Files changed (64) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/{chunk-4BYDUGYI.js → chunk-6AMZOBWI.js} +1 -1
  6. package/dist/{chunk-GZ2SVHEA.js → chunk-CWGFHLMX.js} +1 -1
  7. package/dist/{chunk-IWFL6VRS.js → chunk-PLMTJHGH.js} +1 -1
  8. package/dist/constants.cjs +1 -1
  9. package/dist/constants.js +1 -1
  10. package/dist/eventcatalog.cjs +1 -1
  11. package/dist/eventcatalog.config.d.cts +34 -0
  12. package/dist/eventcatalog.config.d.ts +34 -0
  13. package/dist/eventcatalog.js +3 -3
  14. package/eventcatalog/astro.config.mjs +2 -1
  15. package/eventcatalog/public/icons/avro.svg +21 -0
  16. package/eventcatalog/public/icons/json-schema.svg +6 -0
  17. package/eventcatalog/public/icons/proto.svg +10 -0
  18. package/eventcatalog/src/components/Grids/utils.tsx +5 -3
  19. package/eventcatalog/src/components/MDX/RemoteFile.astro +5 -11
  20. package/eventcatalog/src/components/MDX/SchemaViewer/SchemaViewerRoot.astro +41 -6
  21. package/eventcatalog/src/components/SchemaExplorer/ApiAccessSection.tsx +139 -0
  22. package/eventcatalog/src/components/SchemaExplorer/AvroSchemaViewer.tsx +423 -0
  23. package/eventcatalog/src/components/SchemaExplorer/DiffViewer.tsx +102 -0
  24. package/eventcatalog/src/components/SchemaExplorer/JSONSchemaViewer.tsx +740 -0
  25. package/eventcatalog/src/components/SchemaExplorer/OwnersSection.tsx +56 -0
  26. package/eventcatalog/src/components/SchemaExplorer/Pagination.tsx +33 -0
  27. package/eventcatalog/src/components/SchemaExplorer/ProducersConsumersSection.tsx +91 -0
  28. package/eventcatalog/src/components/SchemaExplorer/SchemaCodeModal.tsx +93 -0
  29. package/eventcatalog/src/components/SchemaExplorer/SchemaContentViewer.tsx +130 -0
  30. package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsHeader.tsx +181 -0
  31. package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +232 -0
  32. package/eventcatalog/src/components/SchemaExplorer/SchemaExplorer.tsx +415 -0
  33. package/eventcatalog/src/components/SchemaExplorer/SchemaFilters.tsx +174 -0
  34. package/eventcatalog/src/components/SchemaExplorer/SchemaListItem.tsx +73 -0
  35. package/eventcatalog/src/components/SchemaExplorer/SchemaViewerModal.tsx +77 -0
  36. package/eventcatalog/src/components/SchemaExplorer/VersionHistoryModal.tsx +72 -0
  37. package/eventcatalog/src/components/SchemaExplorer/types.ts +45 -0
  38. package/eventcatalog/src/components/SchemaExplorer/utils.ts +81 -0
  39. package/eventcatalog/src/components/SideNav/ListViewSideBar/index.tsx +33 -2
  40. package/eventcatalog/src/components/Tables/Table.tsx +10 -2
  41. package/eventcatalog/src/components/Tables/columns/ContainersTableColumns.tsx +10 -8
  42. package/eventcatalog/src/components/Tables/columns/DomainTableColumns.tsx +8 -6
  43. package/eventcatalog/src/components/Tables/columns/FlowTableColumns.tsx +9 -7
  44. package/eventcatalog/src/components/Tables/columns/MessageTableColumns.tsx +11 -9
  45. package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +9 -7
  46. package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +4 -2
  47. package/eventcatalog/src/components/Tables/columns/TeamsTableColumns.tsx +12 -8
  48. package/eventcatalog/src/components/Tables/columns/UserTableColumns.tsx +14 -9
  49. package/eventcatalog/src/components/Tables/columns/index.tsx +9 -8
  50. package/eventcatalog/src/content.config.ts +3 -2
  51. package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +1 -0
  52. package/eventcatalog/src/layouts/DirectoryLayout.astro +21 -22
  53. package/eventcatalog/src/layouts/DiscoverLayout.astro +26 -12
  54. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +10 -0
  55. package/eventcatalog/src/pages/api/schemas/[collection]/[id]/[version]/index.ts +45 -0
  56. package/eventcatalog/src/pages/api/schemas/services/[id]/[version]/[specification]/index.ts +51 -0
  57. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +1 -0
  58. package/eventcatalog/src/pages/docs/llm/schemas.txt.ts +86 -0
  59. package/eventcatalog/src/pages/schemas/index.astro +175 -0
  60. package/eventcatalog/src/types/index.ts +9 -0
  61. package/eventcatalog/src/utils/files.ts +9 -0
  62. package/package.json +1 -1
  63. package/eventcatalog/src/components/MDX/SchemaViewer/SchemaProperty.astro +0 -204
  64. package/eventcatalog/src/components/MDX/SchemaViewer/SchemaViewer.astro +0 -705
@@ -6,13 +6,13 @@ import { DatabaseIcon } from 'lucide-react';
6
6
  import { createBadgesColumn } from './SharedColumns';
7
7
  import type { TData } from '../Table';
8
8
  import { filterCollectionByName } from '../filters/custom-filters';
9
-
9
+ import type { TableConfiguration } from '@types';
10
10
  const columnHelper = createColumnHelper<TData<'containers'>>();
11
11
 
12
- export const columns = () => [
12
+ export const columns = (tableConfiguration: TableConfiguration) => [
13
13
  columnHelper.accessor('data.name', {
14
14
  id: 'name',
15
- header: () => <span>Storage</span>,
15
+ header: () => <span>{tableConfiguration.columns?.name?.label || 'Storage'}</span>,
16
16
  cell: (info) => {
17
17
  const containerRaw = info.row.original;
18
18
  const color = 'blue';
@@ -44,7 +44,7 @@ export const columns = () => [
44
44
  }),
45
45
  columnHelper.accessor('data.summary', {
46
46
  id: 'summary',
47
- header: () => 'Summary',
47
+ header: () => <span>{tableConfiguration.columns?.summary?.label || 'Summary'}</span>,
48
48
  cell: (info) => <span className="font-light ">{info.renderValue()}</span>,
49
49
  footer: (info) => info.column.id,
50
50
  meta: {
@@ -53,7 +53,8 @@ export const columns = () => [
53
53
  },
54
54
  }),
55
55
  columnHelper.accessor('data.servicesThatWriteToContainer', {
56
- header: () => <span>Writes</span>,
56
+ id: 'writes',
57
+ header: () => <span>{tableConfiguration.columns?.writes?.label || 'Writes'}</span>,
57
58
  meta: {
58
59
  filterVariant: 'collection',
59
60
  collectionFilterKey: 'servicesThatWriteToContainer',
@@ -92,7 +93,8 @@ export const columns = () => [
92
93
  filterFn: filterCollectionByName('servicesThatWriteToContainer'),
93
94
  }),
94
95
  columnHelper.accessor('data.servicesThatReadFromContainer', {
95
- header: () => <span>Reads</span>,
96
+ id: 'reads',
97
+ header: () => <span>{tableConfiguration.columns?.reads?.label || 'Reads'}</span>,
96
98
  meta: {
97
99
  filterVariant: 'collection',
98
100
  collectionFilterKey: 'servicesThatReadFromContainer',
@@ -130,9 +132,9 @@ export const columns = () => [
130
132
  footer: (info) => info.column.id,
131
133
  filterFn: filterCollectionByName('servicesThatReadFromContainer'),
132
134
  }),
133
- createBadgesColumn(columnHelper),
135
+ createBadgesColumn(columnHelper, tableConfiguration),
134
136
  columnHelper.accessor('data.name', {
135
- header: () => <span />,
137
+ header: () => <span>{tableConfiguration.columns?.actions?.label || 'Actions'}</span>,
136
138
  cell: (info) => {
137
139
  const container = info.row.original;
138
140
  return (
@@ -4,13 +4,14 @@ import { filterByName, filterCollectionByName } from '../filters/custom-filters'
4
4
  import { buildUrl } from '@utils/url-builder';
5
5
  import { createBadgesColumn } from './SharedColumns';
6
6
  import type { TData } from '../Table';
7
+ import type { TableConfiguration } from '@types';
7
8
 
8
9
  const columnHelper = createColumnHelper<TData<'domains'>>();
9
10
 
10
- export const columns = () => [
11
+ export const columns = (tableConfiguration: TableConfiguration) => [
11
12
  columnHelper.accessor('data.name', {
12
13
  id: 'name',
13
- header: () => <span>Domain</span>,
14
+ header: () => <span>{tableConfiguration.columns?.name?.label || 'Domain'}</span>,
14
15
  cell: (info) => {
15
16
  const messageRaw = info.row.original;
16
17
  const color = 'yellow';
@@ -42,7 +43,7 @@ export const columns = () => [
42
43
  }),
43
44
  columnHelper.accessor('data.summary', {
44
45
  id: 'summary',
45
- header: () => 'Summary',
46
+ header: () => <span>{tableConfiguration.columns?.summary?.label || 'Summary'}</span>,
46
47
  cell: (info) => (
47
48
  <span className="font-light ">
48
49
  {info.renderValue()} {info.row.original.data.draft ? ' (Draft)' : ''}
@@ -55,6 +56,7 @@ export const columns = () => [
55
56
  },
56
57
  }),
57
58
  columnHelper.accessor('data.services', {
59
+ id: 'services',
58
60
  header: () => <span>Services</span>,
59
61
  meta: {
60
62
  filterVariant: 'collection',
@@ -94,9 +96,10 @@ export const columns = () => [
94
96
  },
95
97
  filterFn: filterCollectionByName('services'),
96
98
  }),
97
- createBadgesColumn(columnHelper),
99
+ createBadgesColumn(columnHelper, tableConfiguration),
98
100
  columnHelper.accessor('data.name', {
99
- header: () => <span />,
101
+ id: 'actions',
102
+ header: () => <span>{tableConfiguration.columns?.actions?.label || 'Actions'}</span>,
100
103
  cell: (info) => {
101
104
  const domain = info.row.original;
102
105
  return (
@@ -108,7 +111,6 @@ export const columns = () => [
108
111
  </a>
109
112
  );
110
113
  },
111
- id: 'actions',
112
114
  meta: {
113
115
  showFilter: false,
114
116
  },
@@ -4,13 +4,14 @@ import { buildUrl } from '@utils/url-builder';
4
4
  import { QueueListIcon } from '@heroicons/react/24/solid';
5
5
  import { createBadgesColumn } from './SharedColumns';
6
6
  import type { TData } from '../Table';
7
+ import type { TableConfiguration } from '@types';
7
8
 
8
9
  const columnHelper = createColumnHelper<TData<'flows'>>();
9
10
 
10
- export const columns = () => [
11
+ export const columns = (tableConfiguration: TableConfiguration) => [
11
12
  columnHelper.accessor('data.name', {
12
13
  id: 'name',
13
- header: () => <span>Flow</span>,
14
+ header: () => <span>{tableConfiguration.columns?.name?.label || 'Flow'}</span>,
14
15
  cell: (info) => {
15
16
  const flowRaw = info.row.original;
16
17
  const color = 'teal';
@@ -41,7 +42,8 @@ export const columns = () => [
41
42
  filterFn: filterByName,
42
43
  }),
43
44
  columnHelper.accessor('data.version', {
44
- header: () => <span>Version</span>,
45
+ id: 'version',
46
+ header: () => <span>{tableConfiguration.columns?.version?.label || 'Version'}</span>,
45
47
  cell: (info) => {
46
48
  const service = info.row.original;
47
49
  return (
@@ -52,7 +54,7 @@ export const columns = () => [
52
54
  }),
53
55
  columnHelper.accessor('data.summary', {
54
56
  id: 'summary',
55
- header: () => 'Summary',
57
+ header: () => <span>{tableConfiguration.columns?.summary?.label || 'Summary'}</span>,
56
58
  cell: (info) => <span className="font-light ">{info.renderValue()}</span>,
57
59
  footer: (info) => info.column.id,
58
60
  meta: {
@@ -60,9 +62,10 @@ export const columns = () => [
60
62
  className: 'max-w-md',
61
63
  },
62
64
  }),
63
- createBadgesColumn(columnHelper),
65
+ createBadgesColumn(columnHelper, tableConfiguration),
64
66
  columnHelper.accessor('data.name', {
65
- header: () => <span />,
67
+ id: 'actions',
68
+ header: () => <span>{tableConfiguration.columns?.actions?.label || 'Actions'}</span>,
66
69
  cell: (info) => {
67
70
  const domain = info.row.original;
68
71
  return (
@@ -74,7 +77,6 @@ export const columns = () => [
74
77
  </a>
75
78
  );
76
79
  },
77
- id: 'actions',
78
80
  meta: {
79
81
  showFilter: false,
80
82
  },
@@ -5,7 +5,7 @@ import { filterByName, filterCollectionByName } from '../filters/custom-filters'
5
5
  import { buildUrl } from '@utils/url-builder';
6
6
  import { createBadgesColumn } from './SharedColumns';
7
7
  import type { TData } from '../Table';
8
- import type { CollectionMessageTypes } from '@types';
8
+ import type { CollectionMessageTypes, TableConfiguration } from '@types';
9
9
 
10
10
  const columnHelper = createColumnHelper<TData<CollectionMessageTypes>>();
11
11
 
@@ -23,10 +23,10 @@ export const getColorAndIconForMessageType = (type: string) => {
23
23
  }
24
24
  };
25
25
 
26
- export const columns = () => [
26
+ export const columns = (tableConfiguration: TableConfiguration) => [
27
27
  columnHelper.accessor('data.name', {
28
28
  id: 'name',
29
- header: () => <span>Message</span>,
29
+ header: () => <span>{tableConfiguration.columns?.name?.label || 'Name'}</span>,
30
30
  cell: (info) => {
31
31
  const messageRaw = info.row.original;
32
32
  const type = useMemo(() => messageRaw.collection.slice(0, -1), [messageRaw.collection]);
@@ -59,7 +59,7 @@ export const columns = () => [
59
59
 
60
60
  columnHelper.accessor('data.summary', {
61
61
  id: 'summary',
62
- header: () => 'Summary',
62
+ header: () => <span>{tableConfiguration.columns?.summary?.label || 'Summary'}</span>,
63
63
  cell: (info) => (
64
64
  <span className="font-light ">
65
65
  {info.renderValue()} {info.row.original.data.draft ? ' (Draft)' : ''}
@@ -73,7 +73,8 @@ export const columns = () => [
73
73
  }),
74
74
 
75
75
  columnHelper.accessor('data.producers', {
76
- header: () => <span>Producers</span>,
76
+ id: 'producers',
77
+ header: () => <span>{tableConfiguration.columns?.producers?.label || 'Producers'}</span>,
77
78
  meta: {
78
79
  filterVariant: 'collection',
79
80
  collectionFilterKey: 'producers',
@@ -112,7 +113,8 @@ export const columns = () => [
112
113
  filterFn: filterCollectionByName('producers'),
113
114
  }),
114
115
  columnHelper.accessor('data.consumers', {
115
- header: () => <span>Consumers</span>,
116
+ id: 'consumers',
117
+ header: () => <span>{tableConfiguration.columns?.consumers?.label || 'Consumers'}</span>,
116
118
  meta: {
117
119
  filterVariant: 'collection',
118
120
  collectionFilterKey: 'consumers',
@@ -151,9 +153,10 @@ export const columns = () => [
151
153
  footer: (info) => info.column.id,
152
154
  filterFn: filterCollectionByName('consumers'),
153
155
  }),
154
- createBadgesColumn(columnHelper),
156
+ createBadgesColumn(columnHelper, tableConfiguration),
155
157
  columnHelper.accessor('data.name', {
156
- header: () => <span />,
158
+ id: 'actions',
159
+ header: () => <span>{tableConfiguration.columns?.actions?.label || 'Actions'}</span>,
157
160
  cell: (info) => {
158
161
  const domain = info.row.original;
159
162
  return (
@@ -165,7 +168,6 @@ export const columns = () => [
165
168
  </a>
166
169
  );
167
170
  },
168
- id: 'actions',
169
171
  meta: {
170
172
  showFilter: false,
171
173
  },
@@ -6,13 +6,13 @@ import { buildUrl } from '@utils/url-builder';
6
6
  import { getColorAndIconForCollection } from '@utils/collections/icons';
7
7
  import { createBadgesColumn } from './SharedColumns';
8
8
  import type { TData } from '../Table';
9
-
9
+ import type { TableConfiguration } from '@types';
10
10
  const columnHelper = createColumnHelper<TData<'services'>>();
11
11
 
12
- export const columns = () => [
12
+ export const columns = (tableConfiguration: TableConfiguration) => [
13
13
  columnHelper.accessor('data.name', {
14
14
  id: 'name',
15
- header: () => <span>Service</span>,
15
+ header: () => <span>{tableConfiguration.columns?.name?.label || 'Service'}</span>,
16
16
  cell: (info) => {
17
17
  const messageRaw = info.row.original;
18
18
  const color = 'pink';
@@ -43,7 +43,7 @@ export const columns = () => [
43
43
  }),
44
44
  columnHelper.accessor('data.summary', {
45
45
  id: 'summary',
46
- header: () => 'Summary',
46
+ header: () => <span>{tableConfiguration.columns?.summary?.label || 'Summary'}</span>,
47
47
  cell: (info) => (
48
48
  <span className="font-light ">
49
49
  {info.renderValue()} {info.row.original.data.draft ? ' (Draft)' : ''}
@@ -56,6 +56,7 @@ export const columns = () => [
56
56
  },
57
57
  }),
58
58
  columnHelper.accessor('data.receives', {
59
+ id: 'receives',
59
60
  header: () => <span>Receives</span>,
60
61
  meta: {
61
62
  filterVariant: 'collection',
@@ -117,6 +118,7 @@ export const columns = () => [
117
118
  filterFn: filterCollectionByName('receives'),
118
119
  }),
119
120
  columnHelper.accessor('data.sends', {
121
+ id: 'sends',
120
122
  header: () => <span>Sends</span>,
121
123
  meta: {
122
124
  filterVariant: 'collection',
@@ -177,9 +179,10 @@ export const columns = () => [
177
179
  },
178
180
  filterFn: filterCollectionByName('sends'),
179
181
  }),
180
- createBadgesColumn(columnHelper),
182
+ createBadgesColumn(columnHelper, tableConfiguration),
181
183
  columnHelper.accessor('data.name', {
182
- header: () => <span />,
184
+ id: 'actions',
185
+ header: () => <span>{tableConfiguration.columns?.actions?.label || 'Actions'}</span>,
183
186
  cell: (info) => {
184
187
  const domain = info.row.original;
185
188
  return (
@@ -191,7 +194,6 @@ export const columns = () => [
191
194
  </a>
192
195
  );
193
196
  },
194
- id: 'actions',
195
197
  meta: {
196
198
  showFilter: false,
197
199
  },
@@ -3,13 +3,15 @@ import { Tag } from 'lucide-react';
3
3
  import { filterByBadge } from '../filters/custom-filters';
4
4
  import type { TCollectionTypes, TData } from '../Table';
5
5
  import { getIcon } from '@utils/badges';
6
+ import type { TableConfiguration } from '@types';
6
7
 
7
8
  export const createBadgesColumn = <T extends { data: Pick<TData<U>['data'], 'badges'> }, U extends TCollectionTypes>(
8
- columnHelper: ReturnType<typeof createColumnHelper<T>>
9
+ columnHelper: ReturnType<typeof createColumnHelper<T>>,
10
+ tableConfiguration: TableConfiguration
9
11
  ) => {
10
12
  return columnHelper.accessor((row) => row.data.badges, {
11
13
  id: 'badges',
12
- header: () => <span>Badges</span>,
14
+ header: () => <span>{tableConfiguration.columns?.badges?.label || 'Badges'}</span>,
13
15
  cell: (info) => {
14
16
  const item = info.row.original;
15
17
  const badges = item.data.badges || [];
@@ -7,13 +7,13 @@ import type { TData } from '../Table';
7
7
  import type { CollectionUserTypes } from '@types';
8
8
  import type { CollectionEntry } from 'astro:content';
9
9
  import { ServerIcon, BoltIcon, ChatBubbleLeftIcon } from '@heroicons/react/24/solid';
10
-
10
+ import type { TableConfiguration } from '@types';
11
11
  const columnHelper = createColumnHelper<TData<CollectionUserTypes>>();
12
12
 
13
- export const columns = () => [
13
+ export const columns = (tableConfiguration: TableConfiguration) => [
14
14
  columnHelper.accessor('data.name', {
15
15
  id: 'name',
16
- header: () => <span>Name</span>,
16
+ header: () => <span>{tableConfiguration.columns?.name?.label || 'Name'}</span>,
17
17
  cell: (info) => {
18
18
  const messageRaw = info.row.original;
19
19
  const type = useMemo(() => messageRaw.collection.slice(0, -1), [messageRaw.collection]);
@@ -42,7 +42,8 @@ export const columns = () => [
42
42
  }),
43
43
 
44
44
  columnHelper.accessor('data.ownedEvents', {
45
- header: () => <span>Owned events</span>,
45
+ id: 'ownedEvents',
46
+ header: () => <span>{tableConfiguration.columns?.ownedEvents?.label || 'Owned events'}</span>,
46
47
  meta: {
47
48
  filterVariant: 'collection',
48
49
  collectionFilterKey: 'ownedEvents',
@@ -94,7 +95,8 @@ export const columns = () => [
94
95
  }),
95
96
 
96
97
  columnHelper.accessor('data.ownedCommands', {
97
- header: () => <span>Owned commands</span>,
98
+ id: 'ownedCommands',
99
+ header: () => <span>{tableConfiguration.columns?.ownedCommands?.label || 'Owned commands'}</span>,
98
100
  meta: {
99
101
  filterVariant: 'collection',
100
102
  collectionFilterKey: 'ownedCommands',
@@ -148,7 +150,8 @@ export const columns = () => [
148
150
  }),
149
151
 
150
152
  columnHelper.accessor('data.ownedQueries', {
151
- header: () => <span>Owned queries</span>,
153
+ id: 'ownedQueries',
154
+ header: () => <span>{tableConfiguration.columns?.ownedQueries?.label || 'Owned queries'}</span>,
152
155
  meta: {
153
156
  filterVariant: 'collection',
154
157
  collectionFilterKey: 'ownedQueries',
@@ -202,7 +205,8 @@ export const columns = () => [
202
205
  }),
203
206
 
204
207
  columnHelper.accessor('data.ownedServices', {
205
- header: () => <span>Owned Services</span>,
208
+ id: 'ownedServices',
209
+ header: () => <span>{tableConfiguration.columns?.ownedServices?.label || 'Owned Services'}</span>,
206
210
  meta: {
207
211
  filterVariant: 'collection',
208
212
  collectionFilterKey: 'ownedServices',
@@ -254,7 +258,7 @@ export const columns = () => [
254
258
  }),
255
259
 
256
260
  columnHelper.accessor('data.name', {
257
- header: () => <span />,
261
+ header: () => <span>{tableConfiguration.columns?.actions?.label || 'Actions'}</span>,
258
262
  cell: (info) => {
259
263
  const domain = info.row.original;
260
264
  return (
@@ -7,13 +7,13 @@ import type { CollectionUserTypes } from '@types';
7
7
  import { User, Users } from 'lucide-react';
8
8
  import type { CollectionEntry } from 'astro:content';
9
9
  import { ServerIcon, BoltIcon, ChatBubbleLeftIcon, MagnifyingGlassIcon } from '@heroicons/react/24/solid';
10
-
10
+ import type { TableConfiguration } from '@types';
11
11
  const columnHelper = createColumnHelper<TData<CollectionUserTypes>>();
12
12
 
13
- export const columns = () => [
13
+ export const columns = (tableConfiguration: TableConfiguration) => [
14
14
  columnHelper.accessor('data.name', {
15
15
  id: 'name',
16
- header: () => <span>Name</span>,
16
+ header: () => <span>{tableConfiguration.columns?.name?.label || 'Name'}</span>,
17
17
  cell: (info) => {
18
18
  const messageRaw = info.row.original;
19
19
  const type = useMemo(() => messageRaw.collection.slice(0, -1), [messageRaw.collection]);
@@ -42,7 +42,8 @@ export const columns = () => [
42
42
  }),
43
43
 
44
44
  columnHelper.accessor('data.ownedEvents', {
45
- header: () => <span>Owned events</span>,
45
+ id: 'ownedEvents',
46
+ header: () => <span>{tableConfiguration.columns?.ownedEvents?.label || 'Owned events'}</span>,
46
47
  meta: {
47
48
  filterVariant: 'collection',
48
49
  collectionFilterKey: 'ownedEvents',
@@ -94,7 +95,8 @@ export const columns = () => [
94
95
  }),
95
96
 
96
97
  columnHelper.accessor('data.ownedCommands', {
97
- header: () => <span>Owned commands</span>,
98
+ id: 'ownedCommands',
99
+ header: () => <span>{tableConfiguration.columns?.ownedCommands?.label || 'Owned commands'}</span>,
98
100
  meta: {
99
101
  filterVariant: 'collection',
100
102
  collectionFilterKey: 'ownedCommands',
@@ -148,7 +150,8 @@ export const columns = () => [
148
150
  }),
149
151
 
150
152
  columnHelper.accessor('data.ownedQueries', {
151
- header: () => <span>Owned queries</span>,
153
+ id: 'ownedQueries',
154
+ header: () => <span>{tableConfiguration.columns?.ownedQueries?.label || 'Owned queries'}</span>,
152
155
  meta: {
153
156
  filterVariant: 'collection',
154
157
  collectionFilterKey: 'ownedQueries',
@@ -202,7 +205,8 @@ export const columns = () => [
202
205
  }),
203
206
 
204
207
  columnHelper.accessor('data.ownedServices', {
205
- header: () => <span>Owned Services</span>,
208
+ id: 'ownedServices',
209
+ header: () => <span>{tableConfiguration.columns?.ownedServices?.label || 'Owned Services'}</span>,
206
210
  meta: {
207
211
  filterVariant: 'collection',
208
212
  collectionFilterKey: 'ownedServices',
@@ -253,7 +257,8 @@ export const columns = () => [
253
257
  filterFn: filterCollectionByName('ownedServices'),
254
258
  }),
255
259
  columnHelper.accessor('data.associatedTeams', {
256
- header: () => <span>Teams</span>,
260
+ id: 'associatedTeams',
261
+ header: () => <span>{tableConfiguration.columns?.associatedTeams?.label || 'Teams'}</span>,
257
262
  meta: {
258
263
  filterVariant: 'collection',
259
264
  collectionFilterKey: 'associatedTeams',
@@ -304,7 +309,7 @@ export const columns = () => [
304
309
  filterFn: filterCollectionByName('associatedTeams'),
305
310
  }),
306
311
  columnHelper.accessor('data.name', {
307
- header: () => <span />,
312
+ header: () => <span>{tableConfiguration.columns?.actions?.label || 'Actions'}</span>,
308
313
  cell: (info) => {
309
314
  const domain = info.row.original;
310
315
  return (
@@ -5,24 +5,25 @@ import { columns as DomainTableColumns } from './DomainTableColumns';
5
5
  import { columns as FlowTableColumns } from './FlowTableColumns';
6
6
  import { columns as TeamsTableColumns } from './TeamsTableColumns';
7
7
  import { columns as ContainerTableColumns } from './ContainersTableColumns';
8
- export const getColumnsByCollection = (collection: string): any => {
8
+ import type { TableConfiguration } from '@types';
9
+ export const getColumnsByCollection = (collection: string, tableConfiguration: TableConfiguration): any => {
9
10
  switch (collection) {
10
11
  case 'events':
11
12
  case 'commands':
12
13
  case 'queries':
13
- return MessageTableColumns();
14
+ return MessageTableColumns(tableConfiguration);
14
15
  case 'services':
15
- return ServiceTableColumns();
16
+ return ServiceTableColumns(tableConfiguration);
16
17
  case 'domains':
17
- return DomainTableColumns();
18
+ return DomainTableColumns(tableConfiguration);
18
19
  case 'flows':
19
- return FlowTableColumns();
20
+ return FlowTableColumns(tableConfiguration);
20
21
  case 'users':
21
- return UserTableColumns();
22
+ return UserTableColumns(tableConfiguration);
22
23
  case 'teams':
23
- return TeamsTableColumns();
24
+ return TeamsTableColumns(tableConfiguration);
24
25
  case 'containers':
25
- return ContainerTableColumns();
26
+ return ContainerTableColumns(tableConfiguration);
26
27
  default:
27
28
  return [];
28
29
  }
@@ -46,7 +46,7 @@ const channelPointer = z
46
46
 
47
47
  const resourcePointer = z.object({
48
48
  id: z.string(),
49
- version: z.union([z.string(), z.number()]).optional().default('latest'),
49
+ version: z.string().optional().default('latest'),
50
50
  type: z.enum(['service', 'event', 'command', 'query', 'flow', 'channel', 'domain', 'user', 'team', 'container']),
51
51
  });
52
52
 
@@ -79,7 +79,8 @@ const baseSchema = z.object({
79
79
  id: z.string(),
80
80
  name: z.string(),
81
81
  summary: z.string().optional(),
82
- version: z.union([z.string(), z.number()]),
82
+ // version: z.union([z.string(), z.number()]),
83
+ version: z.string(),
83
84
  draft: z.union([z.boolean(), z.object({ title: z.string().optional(), message: z.string() })]).optional(),
84
85
  badges: z.array(badge).optional(),
85
86
  owners: z.array(ownerReference).optional(),
@@ -377,6 +377,7 @@ const badges = doc?.badges || [];
377
377
  }
378
378
 
379
379
  if (enableSupportForElkLayout) {
380
+ // @ts-ignore
380
381
  const { default: elkLayouts } = await import('@mermaid-js/layout-elk/dist/mermaid-layout-elk.core.mjs');
381
382
  mermaid.registerLayoutLoaders(elkLayouts);
382
383
  }
@@ -1,20 +1,11 @@
1
1
  ---
2
2
  import { Table, type TData, type TCollectionTypes } from '@components/Tables/Table';
3
- import { QueueListIcon, RectangleGroupIcon, BoltIcon, ChatBubbleLeftIcon } from '@heroicons/react/24/outline';
4
- import ServerIcon from '@heroicons/react/24/outline/ServerIcon';
5
- import { getCommands } from '@utils/commands';
6
- import { getDomains } from '@utils/collections/domains';
7
- import { getFlows } from '@utils/collections/flows';
8
- import { getEvents } from '@utils/events';
9
- import { getServices } from '@utils/collections/services';
10
3
  import { buildUrl } from '@utils/url-builder';
11
- import { getQueries } from '@utils/queries';
12
- import { MagnifyingGlassIcon } from '@heroicons/react/20/solid';
13
4
  import VerticalSideBarLayout from './VerticalSideBarLayout.astro';
14
- import Checkbox from '@components/Checkbox.astro';
15
5
  import { User, Users } from 'lucide-react';
16
6
  import { getUsers } from '@utils/users';
17
7
  import { getTeams } from '@utils/teams';
8
+ import config from '@config';
18
9
 
19
10
  const users = await getUsers();
20
11
  const teams = await getTeams();
@@ -32,6 +23,9 @@ const currentPath = Astro.url.pathname;
32
23
  const checkboxLatestId = 'latest-only';
33
24
  const checkboxDraftsId = 'drafts-only';
34
25
 
26
+ // @ts-ignore
27
+ const tableConfiguration = config[type as keyof typeof config]?.tableConfiguration ?? { columns: {} };
28
+
35
29
  const tabs = [
36
30
  {
37
31
  label: `Users (${users.length})`,
@@ -40,6 +34,7 @@ const tabs = [
40
34
  icon: User,
41
35
  activeColor: 'orange',
42
36
  enabled: users.length > 0,
37
+ visible: users.length > 0,
43
38
  },
44
39
  {
45
40
  label: `Teams (${teams.length})`,
@@ -48,6 +43,7 @@ const tabs = [
48
43
  icon: Users,
49
44
  activeColor: 'blue',
50
45
  enabled: teams.length > 0,
46
+ visible: teams.length > 0,
51
47
  },
52
48
  ];
53
49
  ---
@@ -59,18 +55,20 @@ const tabs = [
59
55
  <div class="border-b border-gray-200">
60
56
  <nav class="flex space-x-8 -mb-0.5 pl-6" aria-label="Tabs">
61
57
  {
62
- tabs.map((tab) => (
63
- <a
64
- href={tab.href}
65
- class={` text-black group inline-flex items-center py-4 px-1 text-sm font-light ${tab.isActive ? `border-${tab.activeColor}-500 border-b-[2px] text-${tab.activeColor}-500` : 'opacity-80'} ${!tab.enabled ? 'disabled' : ''}`}
66
- aria-current="page"
67
- >
68
- <tab.icon
69
- className={`w-6 h-6 -ml-0.5 mr-2 ${tab.isActive ? `text-${tab.activeColor}-500` : 'text-gray-500'}`}
70
- />
71
- <span>{tab.label}</span>
72
- </a>
73
- ))
58
+ tabs
59
+ .filter((tab) => tab.visible)
60
+ .map((tab) => (
61
+ <a
62
+ href={tab.href}
63
+ class={` text-black group inline-flex items-center py-4 px-1 text-sm font-light ${tab.isActive ? `border-${tab.activeColor}-500 border-b-[2px] text-${tab.activeColor}-500` : 'opacity-80'} ${!tab.enabled ? 'disabled' : ''}`}
64
+ aria-current="page"
65
+ >
66
+ <tab.icon
67
+ className={`w-6 h-6 -ml-0.5 mr-2 ${tab.isActive ? `text-${tab.activeColor}-500` : 'text-gray-500'}`}
68
+ />
69
+ <span>{tab.label}</span>
70
+ </a>
71
+ ))
74
72
  }
75
73
  </nav>
76
74
  </div>
@@ -94,6 +92,7 @@ const tabs = [
94
92
  checkboxDraftsId={checkboxDraftsId}
95
93
  data={data}
96
94
  collection={type}
95
+ tableConfiguration={tableConfiguration}
97
96
  client:load
98
97
  />
99
98
  </div>