@eventcatalog/core 3.31.1 → 3.31.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 = "3.31.1";
40
+ var version = "3.31.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-QIJOBQZ7.js";
4
- import "../chunk-UY5QDWK7.js";
3
+ } from "../chunk-DL3PF5MS.js";
4
+ import "../chunk-UOKUSIKW.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -111,7 +111,7 @@ var import_axios = __toESM(require("axios"), 1);
111
111
  var import_os = __toESM(require("os"), 1);
112
112
 
113
113
  // package.json
114
- var version = "3.31.1";
114
+ var version = "3.31.2";
115
115
 
116
116
  // src/constants.ts
117
117
  var VERSION = version;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-7IGMIOQF.js";
4
- import "../chunk-QIJOBQZ7.js";
3
+ } from "../chunk-IPGFRHRL.js";
4
+ import "../chunk-DL3PF5MS.js";
5
5
  import "../chunk-4UVFXLPI.js";
6
- import "../chunk-UY5QDWK7.js";
6
+ import "../chunk-UOKUSIKW.js";
7
7
  import "../chunk-5T63CXKU.js";
8
8
  export {
9
9
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-UY5QDWK7.js";
3
+ } from "./chunk-UOKUSIKW.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-HVOLSUC2.js";
3
+ } from "./chunk-5VANHNV3.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-UY5QDWK7.js";
3
+ } from "./chunk-UOKUSIKW.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-QIJOBQZ7.js";
3
+ } from "./chunk-DL3PF5MS.js";
4
4
  import {
5
5
  countResources,
6
6
  serializeCounts
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "3.31.1";
2
+ var version = "3.31.2";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "3.31.1";
28
+ var version = "3.31.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-UY5QDWK7.js";
3
+ } from "./chunk-UOKUSIKW.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -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.1";
117
+ var version = "3.31.2";
118
118
 
119
119
  // src/constants.ts
120
120
  var VERSION = version;
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-K3ZVEX2Y.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-7IGMIOQF.js";
10
- import "./chunk-QIJOBQZ7.js";
9
+ } from "./chunk-IPGFRHRL.js";
10
+ import "./chunk-DL3PF5MS.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-LWVHWR77.js";
25
+ } from "./chunk-7FECQ5B3.js";
26
26
  import {
27
27
  logger
28
- } from "./chunk-HVOLSUC2.js";
28
+ } from "./chunk-5VANHNV3.js";
29
29
  import {
30
30
  VERSION
31
- } from "./chunk-UY5QDWK7.js";
31
+ } from "./chunk-UOKUSIKW.js";
32
32
  import {
33
33
  getEventCatalogConfigFile,
34
34
  verifyRequiredFieldsAreInCatalogConfigFile
package/dist/generate.cjs CHANGED
@@ -78,7 +78,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
78
78
  var import_picocolors = __toESM(require("picocolors"), 1);
79
79
 
80
80
  // package.json
81
- var version = "3.31.1";
81
+ var version = "3.31.2";
82
82
 
83
83
  // src/constants.ts
84
84
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-LWVHWR77.js";
4
- import "./chunk-HVOLSUC2.js";
5
- import "./chunk-UY5QDWK7.js";
3
+ } from "./chunk-7FECQ5B3.js";
4
+ import "./chunk-5VANHNV3.js";
5
+ import "./chunk-UOKUSIKW.js";
6
6
  import "./chunk-5T63CXKU.js";
7
7
  export {
8
8
  generate
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "3.31.1";
39
+ var version = "3.31.2";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "../chunk-HVOLSUC2.js";
4
- import "../chunk-UY5QDWK7.js";
3
+ } from "../chunk-5VANHNV3.js";
4
+ import "../chunk-UOKUSIKW.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -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
- // Check if it's a direct record type
55
+ if (!type) return false;
56
56
  if (typeof type === 'object' && !Array.isArray(type)) {
57
- return type.type === 'record' && type.fields && type.fields.length > 0;
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
- // Check if it's a union type that contains a record
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
- return type.some((t) => typeof t === 'object' && !Array.isArray(t) && t.type === 'record' && t.fields && t.fields.length > 0);
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 type, either directly or from within a union
110
- const recordType = typeof field.type === 'object' && field.type.type === 'record' ? field.type : getRecordFromUnion(field.type);
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
- {field.type?.type === 'enum' && field.type.symbols && (
152
+ {enumType && enumType.symbols && (
146
153
  <div className="text-xs text-[rgb(var(--ec-page-text-muted))] mt-1">
147
154
  Values:{' '}
148
- {field.type.symbols.map((s: string) => (
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>
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "SEE LICENSE IN LICENSE",
9
9
  "type": "module",
10
- "version": "3.31.1",
10
+ "version": "3.31.2",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },