@eventcatalog/core 2.64.0 → 2.64.2
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 +2 -1
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-PLMTJHGH.js → chunk-7FIWM2J5.js} +1 -1
- package/dist/{chunk-CWGFHLMX.js → chunk-L6DDJ7WN.js} +1 -1
- package/dist/{chunk-6AMZOBWI.js → chunk-OL52GUNP.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +3 -3
- package/eventcatalog/src/components/SchemaExplorer/AvroSchemaViewer.tsx +48 -6
- package/eventcatalog/src/components/SchemaExplorer/SchemaContentViewer.tsx +3 -1
- package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +1 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/_[filename].data.ts +1 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/_[filename].data.ts +1 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/_[filename].data.ts +1 -0
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<h4>Features: Documentation for Event Driven Architectures, Integration with any broker, Generator from your OpenAPI and AsyncAPI documents, Docs and Code, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
|
|
35
35
|
|
|
36
36
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
37
|
-
[](#contributors-)
|
|
38
38
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
39
39
|
|
|
40
40
|
[Read the Docs](https://www.eventcatalog.dev/docs/development/getting-started/introduction) | [View Demo](https://demo.eventcatalog.dev)
|
|
@@ -270,6 +270,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
270
270
|
</tr>
|
|
271
271
|
<tr>
|
|
272
272
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/reisingerf"><img src="https://avatars.githubusercontent.com/u/31906163?v=4?s=100" width="100px;" alt="reisingerf"/><br /><sub><b>reisingerf</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=reisingerf" title="Documentation">📖</a></td>
|
|
273
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jbarette-rossel"><img src="https://avatars.githubusercontent.com/u/162966566?v=4?s=100" width="100px;" alt="Jonathan Barette"/><br /><sub><b>Jonathan Barette</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=jbarette-rossel" title="Code">💻</a></td>
|
|
273
274
|
</tr>
|
|
274
275
|
</tbody>
|
|
275
276
|
</table>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-7FIWM2J5.js";
|
|
4
|
+
import "../chunk-OL52GUNP.js";
|
|
5
|
+
import "../chunk-L6DDJ7WN.js";
|
|
6
6
|
import "../chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
package/dist/eventcatalog.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-PLNJC7NZ.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-7FIWM2J5.js";
|
|
10
|
+
import "./chunk-OL52GUNP.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-
|
|
18
|
+
} from "./chunk-L6DDJ7WN.js";
|
|
19
19
|
import {
|
|
20
20
|
getProjectOutDir,
|
|
21
21
|
isAuthEnabled,
|
|
@@ -6,6 +6,7 @@ interface AvroSchemaViewerProps {
|
|
|
6
6
|
maxHeight?: string;
|
|
7
7
|
expand?: boolean | string;
|
|
8
8
|
search?: boolean | string;
|
|
9
|
+
showRequired?: boolean | string;
|
|
9
10
|
onOpenFullscreen?: () => void;
|
|
10
11
|
}
|
|
11
12
|
|
|
@@ -13,6 +14,7 @@ interface AvroFieldProps {
|
|
|
13
14
|
field: any;
|
|
14
15
|
level: number;
|
|
15
16
|
expand: boolean;
|
|
17
|
+
showRequired?: boolean;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
// Format Avro type for display
|
|
@@ -56,11 +58,38 @@ function hasNestedFields(type: any): boolean {
|
|
|
56
58
|
return false;
|
|
57
59
|
}
|
|
58
60
|
|
|
61
|
+
// Check if a field is required (not optional)
|
|
62
|
+
// A field is optional if:
|
|
63
|
+
// - It has a default value, OR
|
|
64
|
+
// - Its type is null or includes null in a union
|
|
65
|
+
function isFieldRequired(field: any): boolean {
|
|
66
|
+
// If field has a default value, it's optional
|
|
67
|
+
if ('default' in field) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const fieldType = field.type;
|
|
72
|
+
|
|
73
|
+
// If type is null, field is optional
|
|
74
|
+
if (fieldType === 'null') {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// If type is a union (array), check if it includes null
|
|
79
|
+
if (Array.isArray(fieldType)) {
|
|
80
|
+
return !fieldType.includes('null');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Otherwise, field is required
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
|
|
59
87
|
// AvroField component - displays a single field with nested support
|
|
60
|
-
const AvroField = ({ field, level, expand }: AvroFieldProps) => {
|
|
88
|
+
const AvroField = ({ field, level, expand, showRequired }: AvroFieldProps) => {
|
|
61
89
|
const [isExpanded, setIsExpanded] = useState(expand);
|
|
62
90
|
const hasNested = hasNestedFields(field.type);
|
|
63
91
|
const indentClass = `pl-${level * 4}`;
|
|
92
|
+
const isRequired = showRequired ? isFieldRequired(field) : undefined;
|
|
64
93
|
|
|
65
94
|
useEffect(() => {
|
|
66
95
|
setIsExpanded(expand);
|
|
@@ -84,9 +113,12 @@ const AvroField = ({ field, level, expand }: AvroFieldProps) => {
|
|
|
84
113
|
|
|
85
114
|
{/* Field details */}
|
|
86
115
|
<div className="flex-grow">
|
|
87
|
-
<div className="flex items-baseline
|
|
88
|
-
<
|
|
89
|
-
|
|
116
|
+
<div className="flex justify-between items-baseline">
|
|
117
|
+
<div>
|
|
118
|
+
<span className="avro-field-name font-semibold text-gray-800 text-sm">{field.name}</span>
|
|
119
|
+
<span className="ml-1.5 text-purple-600 font-mono text-xs">{formatAvroType(field.type)}</span>
|
|
120
|
+
</div>
|
|
121
|
+
{showRequired && isRequired && <span className="text-red-600 text-xs ml-3 flex-shrink-0">required</span>}
|
|
90
122
|
</div>
|
|
91
123
|
|
|
92
124
|
{field.doc && <p className="text-gray-600 text-xs mt-1">{field.doc}</p>}
|
|
@@ -107,7 +139,13 @@ const AvroField = ({ field, level, expand }: AvroFieldProps) => {
|
|
|
107
139
|
{hasNested && (
|
|
108
140
|
<div className={`avro-nested-content mt-2 ${!isExpanded ? 'hidden' : ''}`}>
|
|
109
141
|
{field.type.fields.map((nestedField: any) => (
|
|
110
|
-
<AvroField
|
|
142
|
+
<AvroField
|
|
143
|
+
key={nestedField.name}
|
|
144
|
+
field={nestedField}
|
|
145
|
+
level={level + 1}
|
|
146
|
+
expand={expand}
|
|
147
|
+
showRequired={showRequired}
|
|
148
|
+
/>
|
|
111
149
|
))}
|
|
112
150
|
</div>
|
|
113
151
|
)}
|
|
@@ -124,10 +162,12 @@ export default function AvroSchemaViewer({
|
|
|
124
162
|
maxHeight,
|
|
125
163
|
expand = false,
|
|
126
164
|
search = true,
|
|
165
|
+
showRequired = false,
|
|
127
166
|
onOpenFullscreen,
|
|
128
167
|
}: AvroSchemaViewerProps) {
|
|
129
168
|
const expandBool = expand === true || expand === 'true';
|
|
130
169
|
const searchBool = search !== false && search !== 'false';
|
|
170
|
+
const showRequiredBool = showRequired === true || showRequired === 'true';
|
|
131
171
|
|
|
132
172
|
const [searchQuery, setSearchQuery] = useState('');
|
|
133
173
|
const [expandAll, setExpandAll] = useState(expandBool);
|
|
@@ -374,7 +414,9 @@ export default function AvroSchemaViewer({
|
|
|
374
414
|
{/* Fields */}
|
|
375
415
|
<div ref={fieldsContainerRef} className="flex-1 px-4 pb-4 overflow-auto">
|
|
376
416
|
{schema.fields && schema.fields.length > 0 ? (
|
|
377
|
-
schema.fields.map((field: any) =>
|
|
417
|
+
schema.fields.map((field: any) => (
|
|
418
|
+
<AvroField key={field.name} field={field} level={0} expand={expandAll} showRequired={showRequiredBool} />
|
|
419
|
+
))
|
|
378
420
|
) : (
|
|
379
421
|
<div className="text-center py-8 text-gray-400">
|
|
380
422
|
<p className="text-sm">No fields defined</p>
|
|
@@ -15,6 +15,7 @@ interface SchemaContentViewerProps {
|
|
|
15
15
|
parsedSchema: any;
|
|
16
16
|
parsedAvroSchema?: any;
|
|
17
17
|
onOpenFullscreen?: () => void;
|
|
18
|
+
showRequired?: boolean;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export default function SchemaContentViewer({
|
|
@@ -24,6 +25,7 @@ export default function SchemaContentViewer({
|
|
|
24
25
|
viewMode,
|
|
25
26
|
parsedSchema,
|
|
26
27
|
parsedAvroSchema,
|
|
28
|
+
showRequired = false,
|
|
27
29
|
onOpenFullscreen,
|
|
28
30
|
}: SchemaContentViewerProps) {
|
|
29
31
|
if (!message.schemaContent) {
|
|
@@ -37,7 +39,7 @@ export default function SchemaContentViewer({
|
|
|
37
39
|
// Render schema viewer based on schema type
|
|
38
40
|
if (viewMode === 'schema') {
|
|
39
41
|
if (parsedAvroSchema) {
|
|
40
|
-
return <AvroSchemaViewer schema={parsedAvroSchema} onOpenFullscreen={onOpenFullscreen} />;
|
|
42
|
+
return <AvroSchemaViewer schema={parsedAvroSchema} onOpenFullscreen={onOpenFullscreen} showRequired={showRequired} />;
|
|
41
43
|
}
|
|
42
44
|
if (parsedSchema) {
|
|
43
45
|
return <JSONSchemaViewer schema={parsedSchema} onOpenFullscreen={onOpenFullscreen} />;
|
|
@@ -190,6 +190,7 @@ export default function SchemaDetailsPanel({
|
|
|
190
190
|
viewMode={schemaViewMode}
|
|
191
191
|
parsedSchema={parsedSchema}
|
|
192
192
|
parsedAvroSchema={parsedAvroSchema}
|
|
193
|
+
showRequired={true}
|
|
193
194
|
onOpenFullscreen={
|
|
194
195
|
schemaViewMode === 'code'
|
|
195
196
|
? () => setIsCodeModalOpen(true)
|
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.64.
|
|
9
|
+
"version": "2.64.2",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"@ai-sdk/openai": "^2.0.42",
|
|
27
27
|
"@ai-sdk/react": "^2.0.60",
|
|
28
28
|
"@ai-sdk/rsc": "^1.0.60",
|
|
29
|
-
"@astrojs/markdown-remark": "^6.3.
|
|
30
|
-
"@astrojs/mdx": "^4.3.
|
|
31
|
-
"@astrojs/node": "^9.
|
|
32
|
-
"@astrojs/react": "^4.4.
|
|
33
|
-
"@astrojs/rss": "^4.0.
|
|
29
|
+
"@astrojs/markdown-remark": "^6.3.8",
|
|
30
|
+
"@astrojs/mdx": "^4.3.9",
|
|
31
|
+
"@astrojs/node": "^9.5.0",
|
|
32
|
+
"@astrojs/react": "^4.4.1",
|
|
33
|
+
"@astrojs/rss": "^4.0.13",
|
|
34
34
|
"@astrojs/tailwind": "^6.0.2",
|
|
35
35
|
"@asyncapi/avro-schema-parser": "^3.0.24",
|
|
36
36
|
"@asyncapi/parser": "^3.4.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@tanstack/react-table": "^8.17.3",
|
|
58
58
|
"@xyflow/react": "^12.3.6",
|
|
59
59
|
"ai": "^5.0.60",
|
|
60
|
-
"astro": "^5.
|
|
60
|
+
"astro": "^5.15.3",
|
|
61
61
|
"astro-compress": "^2.3.8",
|
|
62
62
|
"astro-expressive-code": "^0.41.3",
|
|
63
63
|
"astro-seo": "^0.8.4",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"uuid": "^10.0.0"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@astrojs/check": "^0.9.
|
|
109
|
+
"@astrojs/check": "^0.9.5",
|
|
110
110
|
"@changesets/cli": "^2.27.5",
|
|
111
111
|
"@playwright/test": "^1.48.1",
|
|
112
112
|
"@types/dagre": "^0.7.52",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"tsup": "^8.1.0",
|
|
131
131
|
"vite": "^7.1.7",
|
|
132
132
|
"vite-tsconfig-paths": "^4.3.2",
|
|
133
|
-
"vitest": "2.1.
|
|
133
|
+
"vitest": "2.1.9"
|
|
134
134
|
},
|
|
135
135
|
"scripts": {
|
|
136
136
|
"dev": "astro dev",
|