@eventcatalog/core 2.62.1 → 2.63.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 (30) 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-IWFL6VRS.js → chunk-GA274FBN.js} +1 -1
  6. package/dist/{chunk-4BYDUGYI.js → chunk-I2FMV7LN.js} +1 -1
  7. package/dist/{chunk-GZ2SVHEA.js → chunk-IRFM5IS7.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/src/components/Tables/Table.tsx +10 -2
  15. package/eventcatalog/src/components/Tables/columns/ContainersTableColumns.tsx +10 -8
  16. package/eventcatalog/src/components/Tables/columns/DomainTableColumns.tsx +8 -6
  17. package/eventcatalog/src/components/Tables/columns/FlowTableColumns.tsx +9 -7
  18. package/eventcatalog/src/components/Tables/columns/MessageTableColumns.tsx +9 -7
  19. package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +9 -7
  20. package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +4 -2
  21. package/eventcatalog/src/components/Tables/columns/TeamsTableColumns.tsx +12 -8
  22. package/eventcatalog/src/components/Tables/columns/UserTableColumns.tsx +14 -9
  23. package/eventcatalog/src/components/Tables/columns/index.tsx +9 -8
  24. package/eventcatalog/src/content.config.ts +3 -2
  25. package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +1 -0
  26. package/eventcatalog/src/layouts/DirectoryLayout.astro +21 -22
  27. package/eventcatalog/src/layouts/DiscoverLayout.astro +26 -12
  28. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +1 -0
  29. package/eventcatalog/src/types/index.ts +9 -0
  30. package/package.json +1 -1
@@ -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.62.1";
40
+ var version = "2.63.0";
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-4BYDUGYI.js";
4
- import "../chunk-GZ2SVHEA.js";
3
+ } from "../chunk-I2FMV7LN.js";
4
+ import "../chunk-IRFM5IS7.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.62.1";
109
+ var version = "2.63.0";
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-IWFL6VRS.js";
4
- import "../chunk-4BYDUGYI.js";
5
- import "../chunk-GZ2SVHEA.js";
3
+ } from "../chunk-GA274FBN.js";
4
+ import "../chunk-I2FMV7LN.js";
5
+ import "../chunk-IRFM5IS7.js";
6
6
  import "../chunk-UPONRQSN.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-4BYDUGYI.js";
3
+ } from "./chunk-I2FMV7LN.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-GZ2SVHEA.js";
3
+ } from "./chunk-IRFM5IS7.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.62.1";
2
+ var version = "2.63.0";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.62.1";
28
+ var version = "2.63.0";
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-GZ2SVHEA.js";
3
+ } from "./chunk-IRFM5IS7.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -157,7 +157,7 @@ var import_axios = __toESM(require("axios"), 1);
157
157
  var import_os = __toESM(require("os"), 1);
158
158
 
159
159
  // package.json
160
- var version = "2.62.1";
160
+ var version = "2.63.0";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -31,6 +31,13 @@ type AutoGeneratedSideBarConfig = {
31
31
  };
32
32
  collapsed?: boolean;
33
33
  };
34
+ type TableConfiguration = {
35
+ columns: {
36
+ [key: string]: {
37
+ visible?: boolean;
38
+ };
39
+ };
40
+ };
34
41
  interface Config {
35
42
  title: string;
36
43
  tagline: false;
@@ -109,6 +116,33 @@ interface Config {
109
116
  description?: string;
110
117
  shortName?: string;
111
118
  }[];
119
+ users?: {
120
+ tableConfiguration?: TableConfiguration;
121
+ };
122
+ teams?: {
123
+ tableConfiguration?: TableConfiguration;
124
+ };
125
+ events?: {
126
+ tableConfiguration?: TableConfiguration;
127
+ };
128
+ services?: {
129
+ tableConfiguration?: TableConfiguration;
130
+ };
131
+ domains?: {
132
+ tableConfiguration?: TableConfiguration;
133
+ };
134
+ flows?: {
135
+ tableConfiguration?: TableConfiguration;
136
+ };
137
+ containers?: {
138
+ tableConfiguration?: TableConfiguration;
139
+ };
140
+ commands?: {
141
+ tableConfiguration?: TableConfiguration;
142
+ };
143
+ queries?: {
144
+ tableConfiguration?: TableConfiguration;
145
+ };
112
146
  }
113
147
 
114
148
  export type { Config, SideBarConfig };
@@ -31,6 +31,13 @@ type AutoGeneratedSideBarConfig = {
31
31
  };
32
32
  collapsed?: boolean;
33
33
  };
34
+ type TableConfiguration = {
35
+ columns: {
36
+ [key: string]: {
37
+ visible?: boolean;
38
+ };
39
+ };
40
+ };
34
41
  interface Config {
35
42
  title: string;
36
43
  tagline: false;
@@ -109,6 +116,33 @@ interface Config {
109
116
  description?: string;
110
117
  shortName?: string;
111
118
  }[];
119
+ users?: {
120
+ tableConfiguration?: TableConfiguration;
121
+ };
122
+ teams?: {
123
+ tableConfiguration?: TableConfiguration;
124
+ };
125
+ events?: {
126
+ tableConfiguration?: TableConfiguration;
127
+ };
128
+ services?: {
129
+ tableConfiguration?: TableConfiguration;
130
+ };
131
+ domains?: {
132
+ tableConfiguration?: TableConfiguration;
133
+ };
134
+ flows?: {
135
+ tableConfiguration?: TableConfiguration;
136
+ };
137
+ containers?: {
138
+ tableConfiguration?: TableConfiguration;
139
+ };
140
+ commands?: {
141
+ tableConfiguration?: TableConfiguration;
142
+ };
143
+ queries?: {
144
+ tableConfiguration?: TableConfiguration;
145
+ };
112
146
  }
113
147
 
114
148
  export type { Config, SideBarConfig };
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-IWFL6VRS.js";
10
- import "./chunk-4BYDUGYI.js";
9
+ } from "./chunk-GA274FBN.js";
10
+ import "./chunk-I2FMV7LN.js";
11
11
  import {
12
12
  catalogToAstro,
13
13
  checkAndConvertMdToMdx
@@ -15,7 +15,7 @@ import {
15
15
  import "./chunk-55D645EH.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-GZ2SVHEA.js";
18
+ } from "./chunk-IRFM5IS7.js";
19
19
  import {
20
20
  getProjectOutDir,
21
21
  isAuthEnabled,
@@ -14,7 +14,7 @@ import DebouncedInput from './DebouncedInput';
14
14
 
15
15
  import { getColumnsByCollection } from './columns';
16
16
  import { useEffect, useMemo, useState } from 'react';
17
- import type { CollectionMessageTypes } from '@types';
17
+ import type { CollectionMessageTypes, TableConfiguration } from '@types';
18
18
  import { isSameVersion } from '@utils/collections/util';
19
19
 
20
20
  declare module '@tanstack/react-table' {
@@ -146,12 +146,14 @@ export const Table = <T extends TCollectionTypes>({
146
146
  mode = 'simple',
147
147
  checkboxLatestId,
148
148
  checkboxDraftsId,
149
+ tableConfiguration,
149
150
  }: {
150
151
  data: TData<T>[];
151
152
  collection: T;
152
153
  checkboxLatestId: string;
153
154
  checkboxDraftsId: string;
154
155
  mode?: 'simple' | 'full';
156
+ tableConfiguration?: TableConfiguration;
155
157
  }) => {
156
158
  const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([]);
157
159
 
@@ -215,7 +217,10 @@ export const Table = <T extends TCollectionTypes>({
215
217
  });
216
218
  }, [initialData, showOnlyLatest, onlyShowDrafts]);
217
219
 
218
- const columns = useMemo(() => getColumnsByCollection(collection), [collection]);
220
+ const columns = useMemo(
221
+ () => getColumnsByCollection(collection, tableConfiguration ?? ({ columns: {} } as TableConfiguration)),
222
+ [collection, tableConfiguration]
223
+ );
219
224
 
220
225
  const table = useReactTable({
221
226
  data: filteredData,
@@ -229,6 +234,9 @@ export const Table = <T extends TCollectionTypes>({
229
234
  getPaginationRowModel: getPaginationRowModel(),
230
235
  state: {
231
236
  columnFilters,
237
+ columnVisibility: Object.fromEntries(
238
+ Object.entries(tableConfiguration?.columns ?? {}).map(([key, value]) => [key, value.visible ?? true])
239
+ ),
232
240
  },
233
241
  });
234
242
 
@@ -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,6 +73,7 @@ export const columns = () => [
73
73
  }),
74
74
 
75
75
  columnHelper.accessor('data.producers', {
76
+ id: 'producers',
76
77
  header: () => <span>Producers</span>,
77
78
  meta: {
78
79
  filterVariant: 'collection',
@@ -112,6 +113,7 @@ export const columns = () => [
112
113
  filterFn: filterCollectionByName('producers'),
113
114
  }),
114
115
  columnHelper.accessor('data.consumers', {
116
+ id: 'consumers',
115
117
  header: () => <span>Consumers</span>,
116
118
  meta: {
117
119
  filterVariant: 'collection',
@@ -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>
@@ -14,6 +14,7 @@ import { DatabaseIcon } from 'lucide-react';
14
14
  import { MagnifyingGlassIcon } from '@heroicons/react/20/solid';
15
15
  import VerticalSideBarLayout from './VerticalSideBarLayout.astro';
16
16
  import Checkbox from '@components/Checkbox.astro';
17
+ import config from '@config';
17
18
 
18
19
  const events = await getEvents();
19
20
  const queries = await getQueries();
@@ -35,6 +36,9 @@ const currentPath = Astro.url.pathname;
35
36
  const checkboxLatestId = 'latest-only';
36
37
  const checkboxDraftsId = 'show-drafts';
37
38
 
39
+ // @ts-ignore
40
+ const tableConfiguration = config[type as keyof typeof config]?.tableConfiguration ?? { columns: {} };
41
+
38
42
  const tabs = [
39
43
  {
40
44
  label: `Events (${events.length})`,
@@ -43,6 +47,7 @@ const tabs = [
43
47
  icon: BoltIcon,
44
48
  activeColor: 'orange',
45
49
  enabled: events.length > 0,
50
+ visible: events.length > 0,
46
51
  },
47
52
  {
48
53
  label: `Commands (${commands.length})`,
@@ -51,6 +56,7 @@ const tabs = [
51
56
  icon: ChatBubbleLeftIcon,
52
57
  activeColor: 'blue',
53
58
  enabled: commands.length > 0,
59
+ visible: commands.length > 0,
54
60
  },
55
61
  {
56
62
  label: `Queries (${queries.length})`,
@@ -59,6 +65,7 @@ const tabs = [
59
65
  icon: MagnifyingGlassIcon,
60
66
  activeColor: 'green',
61
67
  enabled: queries.length > 0,
68
+ visible: queries.length > 0,
62
69
  },
63
70
  {
64
71
  label: `Services (${services.length})`,
@@ -67,6 +74,7 @@ const tabs = [
67
74
  icon: ServerIcon,
68
75
  activeColor: 'pink',
69
76
  enabled: services.length > 0,
77
+ visible: services.length > 0,
70
78
  },
71
79
  {
72
80
  label: `Domains (${domains.length})`,
@@ -75,6 +83,7 @@ const tabs = [
75
83
  icon: RectangleGroupIcon,
76
84
  activeColor: 'yellow',
77
85
  enabled: domains.length > 0,
86
+ visible: domains.length > 0,
78
87
  },
79
88
  {
80
89
  label: `Data (${containers.length})`,
@@ -83,6 +92,7 @@ const tabs = [
83
92
  icon: DatabaseIcon,
84
93
  activeColor: 'blue',
85
94
  enabled: containers.length > 0,
95
+ visible: containers.length > 0,
86
96
  },
87
97
  {
88
98
  label: `Flows (${flows.length})`,
@@ -91,6 +101,7 @@ const tabs = [
91
101
  icon: QueueListIcon,
92
102
  activeColor: 'teal',
93
103
  enabled: flows.length > 0,
104
+ visible: flows.length > 0,
94
105
  },
95
106
  ];
96
107
  ---
@@ -102,18 +113,20 @@ const tabs = [
102
113
  <div class="border-b border-gray-200">
103
114
  <nav class="flex space-x-8 -mb-0.5 pl-6" aria-label="Tabs">
104
115
  {
105
- tabs.map((tab) => (
106
- <a
107
- href={tab.href}
108
- 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' : ''}`}
109
- aria-current="page"
110
- >
111
- <tab.icon
112
- className={`w-6 h-6 -ml-0.5 mr-2 ${tab.isActive ? `text-${tab.activeColor}-500` : 'text-gray-500'}`}
113
- />
114
- <span>{tab.label}</span>
115
- </a>
116
- ))
116
+ tabs
117
+ .filter((tab) => tab.visible)
118
+ .map((tab) => (
119
+ <a
120
+ href={tab.href}
121
+ 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' : ''}`}
122
+ aria-current="page"
123
+ >
124
+ <tab.icon
125
+ className={`w-6 h-6 -ml-0.5 mr-2 ${tab.isActive ? `text-${tab.activeColor}-500` : 'text-gray-500'}`}
126
+ />
127
+ <span>{tab.label}</span>
128
+ </a>
129
+ ))
117
130
  }
118
131
  </nav>
119
132
  </div>
@@ -145,6 +158,7 @@ const tabs = [
145
158
  checkboxDraftsId={checkboxDraftsId}
146
159
  data={data}
147
160
  collection={type}
161
+ tableConfiguration={tableConfiguration}
148
162
  client:load
149
163
  />
150
164
  </div>
@@ -548,6 +548,7 @@ nodeGraphs.push({
548
548
  }
549
549
 
550
550
  if (enableSupportForElkLayout) {
551
+ // @ts-ignore
551
552
  const { default: elkLayouts } = await import('@mermaid-js/layout-elk/dist/mermaid-layout-elk.core.mjs');
552
553
  mermaid.registerLayoutLoaders(elkLayouts);
553
554
  }
@@ -20,3 +20,12 @@ export type PageTypes =
20
20
  | 'flows'
21
21
  | 'entities'
22
22
  | 'containers';
23
+
24
+ export type TableConfiguration = {
25
+ columns: {
26
+ [key: string]: {
27
+ label?: string;
28
+ visible?: boolean;
29
+ };
30
+ };
31
+ };
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.62.1",
9
+ "version": "2.63.0",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },