@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.
@@ -37,7 +37,7 @@ var import_axios = __toESM(require("axios"), 1);
37
37
  var import_os = __toESM(require("os"), 1);
38
38
 
39
39
  // package.json
40
- var version = "2.55.0";
40
+ var version = "2.55.2";
41
41
 
42
42
  // src/constants.ts
43
43
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-HVIAPJSO.js";
4
- import "../chunk-C2SLLLIQ.js";
3
+ } from "../chunk-IDIX2ZKS.js";
4
+ import "../chunk-GVFJKTWB.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -106,7 +106,7 @@ var import_axios = __toESM(require("axios"), 1);
106
106
  var import_os = __toESM(require("os"), 1);
107
107
 
108
108
  // package.json
109
- var version = "2.55.0";
109
+ var version = "2.55.2";
110
110
 
111
111
  // src/constants.ts
112
112
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-MYOJ2HFW.js";
4
- import "../chunk-HVIAPJSO.js";
5
- import "../chunk-C2SLLLIQ.js";
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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-HVIAPJSO.js";
3
+ } from "./chunk-IDIX2ZKS.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.55.0";
2
+ var version = "2.55.2";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-C2SLLLIQ.js";
3
+ } from "./chunk-GVFJKTWB.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.55.0";
28
+ var version = "2.55.2";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-C2SLLLIQ.js";
3
+ } from "./chunk-GVFJKTWB.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -157,7 +157,7 @@ var import_axios = __toESM(require("axios"), 1);
157
157
  var import_os = __toESM(require("os"), 1);
158
158
 
159
159
  // package.json
160
- var version = "2.55.0";
160
+ var version = "2.55.2";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-MYOJ2HFW.js";
10
- import "./chunk-HVIAPJSO.js";
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-C2SLLLIQ.js";
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
- const { description, properties, required = [], variants } = processedSchema;
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(processedSchema);
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.0",
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.4",
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",