@eventcatalog/core 3.28.3 → 3.28.4
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-SBZBCN3T.js → chunk-34MH7O22.js} +1 -1
- package/dist/{chunk-L36OEOCB.js → chunk-45JFXFTE.js} +1 -1
- package/dist/{chunk-LLC66YM2.js → chunk-4FMLF7P3.js} +1 -1
- package/dist/{chunk-JLGWTWR4.js → chunk-BGEC3Y5J.js} +1 -1
- package/dist/{chunk-KP324TGM.js → chunk-TSBHPGIL.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/JSONSchemaViewer.tsx +23 -9
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-BGEC3Y5J.js";
|
|
4
|
+
import "../chunk-34MH7O22.js";
|
|
5
5
|
import "../chunk-4UVFXLPI.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-45JFXFTE.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.28.
|
|
117
|
+
var version = "3.28.4";
|
|
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-PLNJC7NZ.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-BGEC3Y5J.js";
|
|
10
|
+
import "./chunk-34MH7O22.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-TSBHPGIL.js";
|
|
26
26
|
import {
|
|
27
27
|
logger
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-4FMLF7P3.js";
|
|
29
29
|
import {
|
|
30
30
|
VERSION
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-45JFXFTE.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-TSBHPGIL.js";
|
|
4
|
+
import "./chunk-4FMLF7P3.js";
|
|
5
|
+
import "./chunk-45JFXFTE.js";
|
|
6
6
|
import "./chunk-5T63CXKU.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -19,6 +19,18 @@ interface SchemaPropertyProps {
|
|
|
19
19
|
expand: boolean;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
// JSON Schema allows `type` to be a string or an array of strings (e.g. ["object", "null"]).
|
|
23
|
+
// These helpers normalise both forms so the rest of the viewer can treat type checks uniformly.
|
|
24
|
+
function hasType(type: any, candidate: string): boolean {
|
|
25
|
+
if (Array.isArray(type)) return type.includes(candidate);
|
|
26
|
+
return type === candidate;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function formatType(type: any): string {
|
|
30
|
+
if (Array.isArray(type)) return type.join(' | ');
|
|
31
|
+
return type ?? '';
|
|
32
|
+
}
|
|
33
|
+
|
|
22
34
|
// Helper function to count properties recursively
|
|
23
35
|
function countProperties(obj: any): number {
|
|
24
36
|
if (!obj || typeof obj !== 'object') return 0;
|
|
@@ -196,7 +208,7 @@ function processSchema(schema: any, rootSchema?: any): any {
|
|
|
196
208
|
}
|
|
197
209
|
|
|
198
210
|
// Process array items
|
|
199
|
-
if (schema.type
|
|
211
|
+
if (hasType(schema.type, 'array') && schema.items) {
|
|
200
212
|
schema = { ...schema, items: processSchema(schema.items, root) };
|
|
201
213
|
}
|
|
202
214
|
|
|
@@ -269,11 +281,11 @@ const SchemaProperty = ({ name, details, isRequired, level, isListItem = false,
|
|
|
269
281
|
setIsExpanded(expand);
|
|
270
282
|
}, [expand]);
|
|
271
283
|
|
|
272
|
-
const hasNestedProperties = details.type
|
|
273
|
-
const hasArrayItems = details.type
|
|
284
|
+
const hasNestedProperties = hasType(details.type, 'object') && details.properties && Object.keys(details.properties).length > 0;
|
|
285
|
+
const hasArrayItems = hasType(details.type, 'array') && details.items;
|
|
274
286
|
const hasArrayItemProperties =
|
|
275
287
|
hasArrayItems &&
|
|
276
|
-
((details.items.type
|
|
288
|
+
((hasType(details.items.type, 'object') && details.items.properties) ||
|
|
277
289
|
details.items.allOf ||
|
|
278
290
|
details.items.oneOf ||
|
|
279
291
|
details.items.anyOf ||
|
|
@@ -307,8 +319,8 @@ const SchemaProperty = ({ name, details, isRequired, level, isListItem = false,
|
|
|
307
319
|
<div>
|
|
308
320
|
<span className="font-semibold text-[rgb(var(--ec-page-text))] text-sm">{name}</span>
|
|
309
321
|
<span className="ml-1.5 text-[rgb(var(--ec-accent))] font-mono text-xs">
|
|
310
|
-
{hasVariants ? (details.variantType === 'anyOf' ? 'anyOf' : 'oneOf') : details.type}
|
|
311
|
-
{details.type
|
|
322
|
+
{hasVariants ? (details.variantType === 'anyOf' ? 'anyOf' : 'oneOf') : formatType(details.type)}
|
|
323
|
+
{hasType(details.type, 'array') && details.items?.type ? `[${formatType(details.items.type)}]` : ''}
|
|
312
324
|
{details.format ? `<${details.format}>` : ''}
|
|
313
325
|
{details._refPath && (
|
|
314
326
|
<span className="text-blue-600 dark:text-blue-400 ml-1">→ {details._refName || details._refPath}</span>
|
|
@@ -513,9 +525,9 @@ export default function JSONSchemaViewer({
|
|
|
513
525
|
let display = processedSchema;
|
|
514
526
|
let isArray = false;
|
|
515
527
|
|
|
516
|
-
if (processedSchema.type
|
|
528
|
+
if (hasType(processedSchema.type, 'array') && processedSchema.items) {
|
|
517
529
|
isArray = true;
|
|
518
|
-
if (processedSchema.items.type
|
|
530
|
+
if (hasType(processedSchema.items.type, 'object') && processedSchema.items.properties) {
|
|
519
531
|
display = {
|
|
520
532
|
...processedSchema.items,
|
|
521
533
|
description: processedSchema.description || processedSchema.items.description,
|
|
@@ -838,7 +850,9 @@ export default function JSONSchemaViewer({
|
|
|
838
850
|
<div className="text-[rgb(var(--ec-page-text-muted))] text-sm">
|
|
839
851
|
<p>
|
|
840
852
|
This array contains items of type:{' '}
|
|
841
|
-
<span className="font-mono text-blue-600 dark:text-blue-400">
|
|
853
|
+
<span className="font-mono text-blue-600 dark:text-blue-400">
|
|
854
|
+
{processedSchema.items?.type ? formatType(processedSchema.items.type) : 'unknown'}
|
|
855
|
+
</span>
|
|
842
856
|
</p>
|
|
843
857
|
{processedSchema.items?.description && (
|
|
844
858
|
<p className="text-xs mt-2 text-[rgb(var(--ec-page-text-muted))]">{processedSchema.items.description}</p>
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "3.28.
|
|
10
|
+
"version": "3.28.4",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -103,9 +103,9 @@
|
|
|
103
103
|
"update-notifier": "^7.3.1",
|
|
104
104
|
"uuid": "^10.0.0",
|
|
105
105
|
"zod": "^4.3.6",
|
|
106
|
-
"@eventcatalog/linter": "1.0.21",
|
|
107
106
|
"@eventcatalog/sdk": "2.20.0",
|
|
108
|
-
"@eventcatalog/visualiser": "^3.18.4"
|
|
107
|
+
"@eventcatalog/visualiser": "^3.18.4",
|
|
108
|
+
"@eventcatalog/linter": "1.0.21"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@astrojs/check": "^0.9.8",
|