@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
@@ -1,204 +0,0 @@
1
- ---
2
- import SchemaProp from './SchemaProperty.astro';
3
-
4
- interface Props {
5
- name: string;
6
- details: any;
7
- isRequired: boolean;
8
- level: number;
9
- isListItem?: boolean;
10
- expand?: boolean;
11
- }
12
-
13
- const { name, details, isRequired, level, isListItem = false, expand = false } = Astro.props;
14
-
15
- const hasNestedProperties = details.type === 'object' && details.properties && Object.keys(details.properties).length > 0;
16
- const hasArrayItems = details.type === 'array' && details.items;
17
- const hasArrayItemProperties =
18
- hasArrayItems &&
19
- ((details.items.type === 'object' && details.items.properties) ||
20
- details.items.allOf ||
21
- details.items.oneOf ||
22
- details.items.$ref);
23
- const isCollapsible = hasNestedProperties || hasArrayItemProperties;
24
-
25
- // Using template literal for class calculation remains safe
26
- const indentationClass = `pl-${level * 3}`;
27
-
28
- const contentId = `prop-${name}-${level}-${Math.random().toString(36).substring(2, 7)}`;
29
- ---
30
-
31
- {/* Using simpler border class */}
32
- <div class:list={['property-container mb-1.5 border-l border-gray-100 relative', indentationClass]}>
33
- <div class="flex items-start space-x-1.5">
34
- {
35
- isCollapsible && (
36
- <button
37
- type="button"
38
- aria-expanded={expand ? 'true' : 'false'}
39
- aria-controls={contentId}
40
- class="property-toggle text-gray-500 hover:text-gray-700 pt-0.5 focus:outline-none w-3 text-center flex-shrink-0"
41
- >
42
- <span class:list={['icon-collapsed font-mono text-xs', { hidden: expand }]}>&gt;</span>
43
- <span class:list={['icon-expanded font-mono text-xs', { hidden: !expand }]}>v</span>
44
- </button>
45
- )
46
- }
47
- {!isCollapsible && <div class="w-3 h-4 flex-shrink-0" />}
48
-
49
- <div class="flex-grow">
50
- <div class="flex justify-between items-baseline">
51
- <div>
52
- <span class="font-semibold text-gray-800 text-sm">{name}</span>
53
- <span class="ml-1.5 text-purple-600 font-mono text-xs">
54
- {/* Expressions using ternary operators are generally safe */}
55
- {details.type}
56
- {details.type === 'array' && details.items?.type ? `[${details.items.type}]` : ''}
57
- {details.format ? `<${details.format}>` : ''}
58
- {details._refPath && <span class="text-blue-600 ml-1">→ {details._refName || details._refPath}</span>}
59
- {details._refNotFound && <span class="text-red-600 ml-1">❌ ref not found</span>}
60
- {
61
- details.const !== undefined && (
62
- <span>
63
- constant: <code>{details.const}</code>
64
- </span>
65
- )
66
- }
67
- </span>
68
- </div>
69
- {isRequired && <span class="text-red-600 text-xs ml-3 flex-shrink-0">required</span>}
70
- </div>
71
-
72
- {details.description && <p class="text-gray-500 text-xs mt-0.5">{details.description}</p>}
73
- {
74
- details.title && details.title !== details.description && (
75
- <p class="text-gray-500 text-xs mt-0.5 italic">Title: {details.title}</p>
76
- )
77
- }
78
-
79
- {/* Reverted arbitrary text size to standard 'text-xs' */}
80
- <div class="text-xs text-gray-500 mt-0.5 space-y-0">
81
- {
82
- details.pattern && (
83
- <div>
84
- Match pattern: <code class="bg-gray-100 px-1 rounded text-gray-800 font-thin py-0.5">{details.pattern}</code>
85
- </div>
86
- )
87
- }
88
- {
89
- details.minimum !== undefined && (
90
- <div>
91
- Minimum: <code class="bg-gray-100 px-1 rounded text-gray-800 font-thin py-0.5">{details.minimum}</code>
92
- </div>
93
- )
94
- }
95
- {
96
- details.maximum !== undefined && (
97
- <div>
98
- Maximum: <code class="bg-gray-100 px-1 rounded text-gray-800 font-thin py-0.5">{details.maximum}</code>
99
- </div>
100
- )
101
- }
102
- {
103
- details.minLength !== undefined && (
104
- <div>
105
- Min length: <code class="bg-gray-100 px-1 rounded text-gray-800 font-thin py-0.5">{details.minLength}</code>
106
- </div>
107
- )
108
- }
109
- {
110
- details.maxLength !== undefined && (
111
- <div>
112
- Max length: <code class="bg-gray-100 px-1 rounded text-gray-800 font-thin py-0.5">{details.maxLength}</code>
113
- </div>
114
- )
115
- }
116
- {
117
- details.enum && (
118
- <div>
119
- <span class="text-xs inline-block">Allowed values:</span>
120
-
121
- {/* Map function rendering standard elements */}
122
- {details.enum.map((val: string) => (
123
- <span class="text-xs">
124
- <code class="bg-gray-100 px-1 rounded text-gray-800 font-thin py-0.5">{val}</code>
125
- </span>
126
- ))}
127
- </div>
128
- )
129
- }
130
- </div>
131
-
132
- {
133
- (hasNestedProperties || hasArrayItems) && (
134
- // class:list with conditional object is standard and should be safe
135
- <div id={contentId} class:list={['nested-content mt-1', { hidden: isCollapsible && !expand }]}>
136
- {/* Recursive component calls */}
137
- {hasNestedProperties &&
138
- details.properties &&
139
- Object.entries(details.properties).map(([nestedName, nestedDetails]) => (
140
- <SchemaProp
141
- name={nestedName}
142
- details={nestedDetails}
143
- isRequired={details.required?.includes(nestedName) ?? false}
144
- level={level + 1}
145
- expand={expand}
146
- />
147
- ))}
148
-
149
- {hasArrayItemProperties && (
150
- <div class="mt-1 border-l border-dashed border-gray-400 pl-3 ml-1.5">
151
- <span class="text-xs italic text-gray-500 block mb-1">Item Details:</span>
152
- {details.items.properties &&
153
- Object.entries(details.items.properties).map(([itemPropName, itemPropDetails]) => (
154
- <SchemaProp
155
- name={itemPropName}
156
- details={itemPropDetails}
157
- isRequired={details.items.required?.includes(itemPropName) ?? false}
158
- level={level + 1}
159
- isListItem={true}
160
- expand={expand}
161
- />
162
- ))}
163
- {(details.items.allOf || details.items.oneOf || details.items.$ref) && !details.items.properties && (
164
- <div class="text-xs text-gray-500 mt-1">
165
- Complex array item schema detected. The properties should be processed by the parent SchemaViewer.
166
- </div>
167
- )}
168
- </div>
169
- )}
170
- </div>
171
- )
172
- }
173
- </div>
174
- </div>
175
- </div>
176
-
177
- {/* Script tag content remains the same */}
178
- <script is:inline>
179
- function setupPropertyToggle() {
180
- document.querySelectorAll('.property-toggle').forEach((button) => {
181
- if (button.dataset.listenerAttached) return;
182
- button.dataset.listenerAttached = 'true';
183
-
184
- button.addEventListener('click', () => {
185
- const contentId = button.getAttribute('aria-controls');
186
- const content = document.getElementById(contentId);
187
- const isExpanded = button.getAttribute('aria-expanded') === 'true';
188
- const iconCollapsed = button.querySelector('.icon-collapsed');
189
- const iconExpanded = button.querySelector('.icon-expanded');
190
-
191
- if (content) {
192
- button.setAttribute('aria-expanded', String(!isExpanded));
193
- content.classList.toggle('hidden');
194
- iconCollapsed?.classList.toggle('hidden', !isExpanded);
195
- iconExpanded?.classList.toggle('hidden', isExpanded);
196
- }
197
- });
198
- });
199
- }
200
-
201
- setupPropertyToggle();
202
-
203
- document.addEventListener('astro:page-load', setupPropertyToggle);
204
- </script>