@eventcatalog/core 2.55.0 → 2.55.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/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-MYOJ2HFW.js → chunk-5LLK3UBP.js} +1 -1
- package/dist/{chunk-C2SLLLIQ.js → chunk-GVFJKTWB.js} +1 -1
- package/dist/{chunk-HVIAPJSO.js → chunk-IDIX2ZKS.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/MDX/SchemaViewer/SchemaViewer.astro +59 -3
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-5LLK3UBP.js";
|
|
4
|
+
import "../chunk-IDIX2ZKS.js";
|
|
5
|
+
import "../chunk-GVFJKTWB.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-5LLK3UBP.js";
|
|
10
|
+
import "./chunk-IDIX2ZKS.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-GVFJKTWB.js";
|
|
19
19
|
import {
|
|
20
20
|
getProjectOutDir,
|
|
21
21
|
isAuthEnabled,
|
|
@@ -37,6 +37,10 @@ function countProperties(obj: any): number {
|
|
|
37
37
|
if (obj.items) {
|
|
38
38
|
count += countProperties(obj.items);
|
|
39
39
|
}
|
|
40
|
+
// Handle root array items that have been processed
|
|
41
|
+
if (obj._isRootArrayItem && obj._rootArraySchema?.items) {
|
|
42
|
+
// Don't double count, we're already counting the properties above
|
|
43
|
+
}
|
|
40
44
|
return count;
|
|
41
45
|
}
|
|
42
46
|
|
|
@@ -213,10 +217,36 @@ function processSchema(schema: any, rootSchema?: any): any {
|
|
|
213
217
|
}
|
|
214
218
|
|
|
215
219
|
const processedSchema = processSchema(schema);
|
|
216
|
-
|
|
220
|
+
|
|
221
|
+
// Handle root-level array schemas
|
|
222
|
+
let displaySchema = processedSchema;
|
|
223
|
+
let isRootArray = false;
|
|
224
|
+
|
|
225
|
+
if (processedSchema.type === 'array' && processedSchema.items) {
|
|
226
|
+
isRootArray = true;
|
|
227
|
+
// For root arrays, we want to display the items' properties
|
|
228
|
+
if (processedSchema.items.type === 'object' && processedSchema.items.properties) {
|
|
229
|
+
displaySchema = {
|
|
230
|
+
...processedSchema.items,
|
|
231
|
+
description: processedSchema.description || processedSchema.items.description,
|
|
232
|
+
_isRootArrayItem: true,
|
|
233
|
+
_rootArraySchema: processedSchema,
|
|
234
|
+
};
|
|
235
|
+
} else if (processedSchema.items.allOf || processedSchema.items.oneOf || processedSchema.items.$ref) {
|
|
236
|
+
// Process complex array item schemas
|
|
237
|
+
displaySchema = {
|
|
238
|
+
...processSchema(processedSchema.items),
|
|
239
|
+
description: processedSchema.description || processedSchema.items.description,
|
|
240
|
+
_isRootArrayItem: true,
|
|
241
|
+
_rootArraySchema: processedSchema,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const { description, properties, required = [], variants } = displaySchema;
|
|
217
247
|
|
|
218
248
|
// Count total properties after processing
|
|
219
|
-
const totalProperties = countProperties(
|
|
249
|
+
const totalProperties = countProperties(displaySchema);
|
|
220
250
|
|
|
221
251
|
// Generate a unique ID for this instance
|
|
222
252
|
const instanceId = `${id}-${Math.random().toString(36).substring(2, 9)}`;
|
|
@@ -293,6 +323,19 @@ const instanceId = `${id}-${Math.random().toString(36).substring(2, 9)}`;
|
|
|
293
323
|
</div>
|
|
294
324
|
)
|
|
295
325
|
}
|
|
326
|
+
{
|
|
327
|
+
isRootArray && (
|
|
328
|
+
<div class="mb-4 p-3 bg-blue-50 border border-blue-200 rounded-md">
|
|
329
|
+
<div class="flex items-center space-x-2">
|
|
330
|
+
<span class="text-blue-600 font-medium text-sm">Array Schema</span>
|
|
331
|
+
<span class="text-blue-500 font-mono text-xs">array[object]</span>
|
|
332
|
+
</div>
|
|
333
|
+
<p class="text-blue-700 text-xs mt-1">
|
|
334
|
+
This schema defines an array of objects. Each item in the array has the properties shown below.
|
|
335
|
+
</p>
|
|
336
|
+
</div>
|
|
337
|
+
)
|
|
338
|
+
}
|
|
296
339
|
{description && <p class="text-gray-600 text-xs mb-5">{description}</p>}
|
|
297
340
|
|
|
298
341
|
{
|
|
@@ -345,7 +388,20 @@ const instanceId = `${id}-${Math.random().toString(36).substring(2, 9)}`;
|
|
|
345
388
|
)
|
|
346
389
|
}
|
|
347
390
|
|
|
348
|
-
{!properties && <p class="text-gray-500 text-sm">Schema does not contain any properties.</p>}
|
|
391
|
+
{!properties && !isRootArray && <p class="text-gray-500 text-sm">Schema does not contain any properties.</p>}
|
|
392
|
+
{
|
|
393
|
+
!properties && isRootArray && (
|
|
394
|
+
<div class="text-center py-8">
|
|
395
|
+
<div class="text-gray-500 text-sm">
|
|
396
|
+
<p>
|
|
397
|
+
This array contains items of type:{' '}
|
|
398
|
+
<span class="font-mono text-blue-600">{processedSchema.items?.type || 'unknown'}</span>
|
|
399
|
+
</p>
|
|
400
|
+
{processedSchema.items?.description && <p class="text-xs mt-2 text-gray-600">{processedSchema.items.description}</p>}
|
|
401
|
+
</div>
|
|
402
|
+
</div>
|
|
403
|
+
)
|
|
404
|
+
}
|
|
349
405
|
</div>
|
|
350
406
|
</div>
|
|
351
407
|
|
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.55.
|
|
9
|
+
"version": "2.55.2",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@eventcatalog/generator-ai": "^1.1.0",
|
|
38
38
|
"@eventcatalog/linter": "^0.0.2",
|
|
39
39
|
"@eventcatalog/sdk": "^2.2.7",
|
|
40
|
-
"@eventcatalog/visualizer": "^0.0.
|
|
40
|
+
"@eventcatalog/visualizer": "^0.0.5",
|
|
41
41
|
"@fontsource/inter": "^5.2.5",
|
|
42
42
|
"@headlessui/react": "^2.0.3",
|
|
43
43
|
"@heroicons/react": "^2.1.3",
|