@eventcatalog/core 3.31.1 → 3.31.3
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/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-7IGMIOQF.js → chunk-4BGFG4MW.js} +1 -1
- package/dist/{chunk-LWVHWR77.js → chunk-INJR34TF.js} +1 -1
- package/dist/{chunk-QIJOBQZ7.js → chunk-VH65Q3HT.js} +1 -1
- package/dist/{chunk-HVOLSUC2.js → chunk-VZ53X73K.js} +1 -1
- package/dist/{chunk-UY5QDWK7.js → chunk-ZB4D3AZB.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 +5 -5
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/components/SchemaExplorer/AvroSchemaViewer.tsx +25 -18
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +34 -0
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-4BGFG4MW.js";
|
|
4
|
+
import "../chunk-VH65Q3HT.js";
|
|
5
5
|
import "../chunk-4UVFXLPI.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-ZB4D3AZB.js";
|
|
7
7
|
import "../chunk-5T63CXKU.js";
|
|
8
8
|
export {
|
|
9
9
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -114,7 +114,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
114
114
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
115
115
|
|
|
116
116
|
// package.json
|
|
117
|
-
var version = "3.31.
|
|
117
|
+
var version = "3.31.3";
|
|
118
118
|
|
|
119
119
|
// src/constants.ts
|
|
120
120
|
var VERSION = version;
|
package/dist/eventcatalog.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-K3ZVEX2Y.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-4BGFG4MW.js";
|
|
10
|
+
import "./chunk-VH65Q3HT.js";
|
|
11
11
|
import "./chunk-4UVFXLPI.js";
|
|
12
12
|
import {
|
|
13
13
|
runMigrations
|
|
@@ -22,13 +22,13 @@ import {
|
|
|
22
22
|
} from "./chunk-3KXCGYET.js";
|
|
23
23
|
import {
|
|
24
24
|
generate
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-INJR34TF.js";
|
|
26
26
|
import {
|
|
27
27
|
logger
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-VZ53X73K.js";
|
|
29
29
|
import {
|
|
30
30
|
VERSION
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ZB4D3AZB.js";
|
|
32
32
|
import {
|
|
33
33
|
getEventCatalogConfigFile,
|
|
34
34
|
verifyRequiredFieldsAreInCatalogConfigFile
|
package/dist/generate.cjs
CHANGED
package/dist/generate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-INJR34TF.js";
|
|
4
|
+
import "./chunk-VZ53X73K.js";
|
|
5
|
+
import "./chunk-ZB4D3AZB.js";
|
|
6
6
|
import "./chunk-5T63CXKU.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -52,17 +52,31 @@ function formatAvroType(type: any): string {
|
|
|
52
52
|
|
|
53
53
|
// Check if a type has nested fields
|
|
54
54
|
function hasNestedFields(type: any): boolean {
|
|
55
|
-
|
|
55
|
+
if (!type) return false;
|
|
56
56
|
if (typeof type === 'object' && !Array.isArray(type)) {
|
|
57
|
-
|
|
57
|
+
if (type.type === 'record') return !!(type.fields && type.fields.length > 0);
|
|
58
|
+
if (type.type === 'array') return hasNestedFields(type.items);
|
|
59
|
+
if (type.type === 'map') return hasNestedFields(type.values);
|
|
58
60
|
}
|
|
61
|
+
if (Array.isArray(type)) return type.some((t) => hasNestedFields(t));
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
59
64
|
|
|
60
|
-
|
|
65
|
+
// Deep extractor for Records or Enums
|
|
66
|
+
function getNestedType(type: any, target: 'record' | 'enum'): any {
|
|
67
|
+
if (!type) return null;
|
|
68
|
+
if (typeof type === 'object' && !Array.isArray(type)) {
|
|
69
|
+
if (type.type === target) return type;
|
|
70
|
+
if (type.type === 'array') return getNestedType(type.items, target);
|
|
71
|
+
if (type.type === 'map') return getNestedType(type.values, target);
|
|
72
|
+
}
|
|
61
73
|
if (Array.isArray(type)) {
|
|
62
|
-
|
|
74
|
+
for (const t of type) {
|
|
75
|
+
const result = getNestedType(t, target);
|
|
76
|
+
if (result) return result;
|
|
77
|
+
}
|
|
63
78
|
}
|
|
64
|
-
|
|
65
|
-
return false;
|
|
79
|
+
return null;
|
|
66
80
|
}
|
|
67
81
|
|
|
68
82
|
// Check if a field is required (not optional)
|
|
@@ -91,14 +105,6 @@ function isFieldRequired(field: any): boolean {
|
|
|
91
105
|
return true;
|
|
92
106
|
}
|
|
93
107
|
|
|
94
|
-
// Helper function to get the record type from a union if it exists
|
|
95
|
-
function getRecordFromUnion(type: any): any {
|
|
96
|
-
if (Array.isArray(type)) {
|
|
97
|
-
return type.find((t) => typeof t === 'object' && !Array.isArray(t) && t.type === 'record');
|
|
98
|
-
}
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
108
|
// AvroField component - displays a single field with nested support
|
|
103
109
|
const AvroField = ({ field, level, expand, showRequired }: AvroFieldProps) => {
|
|
104
110
|
const [isExpanded, setIsExpanded] = useState(expand);
|
|
@@ -106,8 +112,9 @@ const AvroField = ({ field, level, expand, showRequired }: AvroFieldProps) => {
|
|
|
106
112
|
const indentClass = `pl-${level * 4}`;
|
|
107
113
|
const isRequired = showRequired ? isFieldRequired(field) : undefined;
|
|
108
114
|
|
|
109
|
-
// Get the record
|
|
110
|
-
const recordType =
|
|
115
|
+
// Get the record and enum types by resolving deep nesting
|
|
116
|
+
const recordType = getNestedType(field.type, 'record');
|
|
117
|
+
const enumType = getNestedType(field.type, 'enum');
|
|
111
118
|
|
|
112
119
|
useEffect(() => {
|
|
113
120
|
setIsExpanded(expand);
|
|
@@ -142,10 +149,10 @@ const AvroField = ({ field, level, expand, showRequired }: AvroFieldProps) => {
|
|
|
142
149
|
{field.doc && <p className="text-[rgb(var(--ec-page-text-muted))] text-xs mt-1">{field.doc}</p>}
|
|
143
150
|
|
|
144
151
|
{/* Show enum values if present */}
|
|
145
|
-
{
|
|
152
|
+
{enumType && enumType.symbols && (
|
|
146
153
|
<div className="text-xs text-[rgb(var(--ec-page-text-muted))] mt-1">
|
|
147
154
|
Values:{' '}
|
|
148
|
-
{
|
|
155
|
+
{enumType.symbols.map((s: string) => (
|
|
149
156
|
<code key={s} className="bg-[rgb(var(--ec-content-hover))] px-1 rounded mx-0.5 text-[rgb(var(--ec-page-text))]">
|
|
150
157
|
{s}
|
|
151
158
|
</code>
|
|
@@ -272,6 +272,20 @@ const nodeGraphPropsForPage = nodeGraphs.find((nodeGraph: any) => nodeGraph.id =
|
|
|
272
272
|
|
|
273
273
|
const shouldRenderVersionList =
|
|
274
274
|
shouldRenderSideBarSection(props, 'versions') && props.data.versions && props.data.versions.length > 1;
|
|
275
|
+
const httpOperation =
|
|
276
|
+
['commands', 'queries'].includes(props.collection) && props.data.operation?.path ? props.data.operation : undefined;
|
|
277
|
+
const httpMethodColors: Record<string, { background: string; color: string }> = {
|
|
278
|
+
GET: { background: 'rgba(34,197,94,0.15)', color: '#22c55e' },
|
|
279
|
+
POST: { background: 'rgba(59,130,246,0.15)', color: '#3b82f6' },
|
|
280
|
+
PUT: { background: 'rgba(245,158,11,0.15)', color: '#f59e0b' },
|
|
281
|
+
PATCH: { background: 'rgba(245,158,11,0.15)', color: '#f59e0b' },
|
|
282
|
+
DELETE: { background: 'rgba(239,68,68,0.15)', color: '#ef4444' },
|
|
283
|
+
OPTIONS: { background: 'rgba(139,92,246,0.15)', color: '#8b5cf6' },
|
|
284
|
+
HEAD: { background: 'rgba(107,114,128,0.15)', color: '#6b7280' },
|
|
285
|
+
};
|
|
286
|
+
const httpMethodStyle = httpOperation?.method
|
|
287
|
+
? httpMethodColors[httpOperation.method.toUpperCase()] || { background: '#6b7280', color: '#ffffff' }
|
|
288
|
+
: undefined;
|
|
275
289
|
|
|
276
290
|
// This will render the graph for this page
|
|
277
291
|
nodeGraphs.push({
|
|
@@ -343,6 +357,26 @@ nodeGraphs.push({
|
|
|
343
357
|
</div>
|
|
344
358
|
|
|
345
359
|
<h2 class="text-base pt-4 text-[rgb(var(--ec-page-text-muted))] font-light">{props.data.summary}</h2>
|
|
360
|
+
{
|
|
361
|
+
httpOperation && (
|
|
362
|
+
<div class="pt-4">
|
|
363
|
+
<div
|
|
364
|
+
class="inline-flex max-w-full items-start gap-2 rounded-lg border border-[rgb(var(--ec-page-border))] bg-[rgb(var(--ec-content-hover))] px-3 py-2 text-sm text-[rgb(var(--ec-page-text))]"
|
|
365
|
+
aria-label="HTTP path"
|
|
366
|
+
>
|
|
367
|
+
{httpOperation.method && (
|
|
368
|
+
<span
|
|
369
|
+
class="mt-0.5 shrink-0 rounded-md px-2 py-0.5 font-mono text-xs font-semibold"
|
|
370
|
+
style={`background: ${httpMethodStyle?.background}; color: ${httpMethodStyle?.color};`}
|
|
371
|
+
>
|
|
372
|
+
{httpOperation.method}
|
|
373
|
+
</span>
|
|
374
|
+
)}
|
|
375
|
+
<code class="break-all font-mono text-[rgb(var(--ec-page-text))]">{httpOperation.path}</code>
|
|
376
|
+
</div>
|
|
377
|
+
</div>
|
|
378
|
+
)
|
|
379
|
+
}
|
|
346
380
|
{
|
|
347
381
|
badges && (
|
|
348
382
|
<div class="flex flex-wrap gap-3 pt-6 pb-2">
|