@eventcatalog/core 2.65.0-beta.0 → 2.65.0-beta.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/README.md CHANGED
@@ -34,7 +34,7 @@
34
34
  <h4>Features: Documentation for Event Driven Architectures, Integration with any broker, Generator from your OpenAPI and AsyncAPI documents, Docs and Code, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
35
35
 
36
36
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
37
- [![All Contributors](https://img.shields.io/badge/all_contributors-66-orange.svg?style=flat-square)](#contributors-)
37
+ [![All Contributors](https://img.shields.io/badge/all_contributors-67-orange.svg?style=flat-square)](#contributors-)
38
38
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
39
39
 
40
40
  [Read the Docs](https://www.eventcatalog.dev/docs/development/getting-started/introduction) | [View Demo](https://demo.eventcatalog.dev)
@@ -272,6 +272,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
272
272
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/reisingerf"><img src="https://avatars.githubusercontent.com/u/31906163?v=4?s=100" width="100px;" alt="reisingerf"/><br /><sub><b>reisingerf</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=reisingerf" title="Documentation">📖</a></td>
273
273
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/jbarette-rossel"><img src="https://avatars.githubusercontent.com/u/162966566?v=4?s=100" width="100px;" alt="Jonathan Barette"/><br /><sub><b>Jonathan Barette</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=jbarette-rossel" title="Code">💻</a></td>
274
274
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/mumundum"><img src="https://avatars.githubusercontent.com/u/196062898?v=4?s=100" width="100px;" alt="mumundum"/><br /><sub><b>mumundum</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=mumundum" title="Code">💻</a></td>
275
+ <td align="center" valign="top" width="14.28%"><a href="https://www.argonus.tech"><img src="https://avatars.githubusercontent.com/u/9743549?v=4?s=100" width="100px;" alt="Piotr Rybarczyk"/><br /><sub><b>Piotr Rybarczyk</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/issues?q=author%3AArgonus" title="Bug reports">🐛</a></td>
275
276
  </tr>
276
277
  </tbody>
277
278
  </table>
@@ -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.65.0-beta.0";
40
+ var version = "2.65.0-beta.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-2ZXSFW7J.js";
4
- import "../chunk-6MJGAOPK.js";
3
+ } from "../chunk-HH3PA5HC.js";
4
+ import "../chunk-TXHHRRSK.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.65.0-beta.0";
109
+ var version = "2.65.0-beta.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-GGFP7ZBX.js";
4
- import "../chunk-2ZXSFW7J.js";
5
- import "../chunk-6MJGAOPK.js";
3
+ } from "../chunk-BY4A6ISY.js";
4
+ import "../chunk-HH3PA5HC.js";
5
+ import "../chunk-TXHHRRSK.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-2ZXSFW7J.js";
3
+ } from "./chunk-HH3PA5HC.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-6MJGAOPK.js";
3
+ } from "./chunk-TXHHRRSK.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.65.0-beta.0";
2
+ var version = "2.65.0-beta.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 = "2.65.0-beta.0";
28
+ var version = "2.65.0-beta.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-6MJGAOPK.js";
3
+ } from "./chunk-TXHHRRSK.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.65.0-beta.0";
160
+ var version = "2.65.0-beta.2";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -674,6 +674,12 @@ var copyServerFiles = async () => {
674
674
  import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/server"), { recursive: true });
675
675
  }
676
676
  if (!isServerOutput) {
677
+ if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/chat.ts"))) {
678
+ import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/chat.ts"));
679
+ }
680
+ if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"))) {
681
+ import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"));
682
+ }
677
683
  return;
678
684
  }
679
685
  import_fs2.default.cpSync((0, import_node_path7.join)(eventCatalogDir, "src/enterprise/eventcatalog-chat/pages/api"), (0, import_node_path7.join)(core, "src/pages/api"), {
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-GGFP7ZBX.js";
10
- import "./chunk-2ZXSFW7J.js";
9
+ } from "./chunk-BY4A6ISY.js";
10
+ import "./chunk-HH3PA5HC.js";
11
11
  import {
12
12
  runMigrations
13
13
  } from "./chunk-BH3JMNAV.js";
@@ -19,7 +19,7 @@ import {
19
19
  import "./chunk-55D645EH.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-6MJGAOPK.js";
22
+ } from "./chunk-TXHHRRSK.js";
23
23
  import {
24
24
  getProjectOutDir,
25
25
  isAuthEnabled,
@@ -80,6 +80,12 @@ var copyServerFiles = async () => {
80
80
  fs.rmSync(join(core, "src/pages/api/server"), { recursive: true });
81
81
  }
82
82
  if (!isServerOutput) {
83
+ if (fs.existsSync(join(core, "src/pages/api/chat.ts"))) {
84
+ fs.rmSync(join(core, "src/pages/api/chat.ts"));
85
+ }
86
+ if (fs.existsSync(join(core, "src/pages/api/[...auth].ts"))) {
87
+ fs.rmSync(join(core, "src/pages/api/[...auth].ts"));
88
+ }
83
89
  return;
84
90
  }
85
91
  fs.cpSync(join(eventCatalogDir, "src/enterprise/eventcatalog-chat/pages/api"), join(core, "src/pages/api"), {
@@ -24,8 +24,8 @@ function formatAvroType(type: any): string {
24
24
  }
25
25
 
26
26
  if (Array.isArray(type)) {
27
- // Union type - show all options
28
- return type.join(' | ');
27
+ // Union type - show all options, properly formatting each member
28
+ return type.map((t) => formatAvroType(t)).join(' | ');
29
29
  }
30
30
 
31
31
  if (typeof type === 'object') {
@@ -52,9 +52,16 @@ 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
56
  if (typeof type === 'object' && !Array.isArray(type)) {
56
57
  return type.type === 'record' && type.fields && type.fields.length > 0;
57
58
  }
59
+
60
+ // Check if it's a union type that contains a record
61
+ if (Array.isArray(type)) {
62
+ return type.some((t) => typeof t === 'object' && !Array.isArray(t) && t.type === 'record' && t.fields && t.fields.length > 0);
63
+ }
64
+
58
65
  return false;
59
66
  }
60
67
 
@@ -84,6 +91,14 @@ function isFieldRequired(field: any): boolean {
84
91
  return true;
85
92
  }
86
93
 
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
+
87
102
  // AvroField component - displays a single field with nested support
88
103
  const AvroField = ({ field, level, expand, showRequired }: AvroFieldProps) => {
89
104
  const [isExpanded, setIsExpanded] = useState(expand);
@@ -91,34 +106,35 @@ const AvroField = ({ field, level, expand, showRequired }: AvroFieldProps) => {
91
106
  const indentClass = `pl-${level * 4}`;
92
107
  const isRequired = showRequired ? isFieldRequired(field) : undefined;
93
108
 
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);
111
+
94
112
  useEffect(() => {
95
113
  setIsExpanded(expand);
96
114
  }, [expand]);
97
115
 
98
116
  return (
99
117
  <div className={`avro-field-container mb-2 border-l border-gray-200 ${indentClass}`}>
100
- <div className="flex items-start space-x-2">
118
+ <div className="flex space-x-2">
101
119
  {/* Collapse/Expand button */}
102
- {hasNested ? (
103
- <button
104
- onClick={() => setIsExpanded(!isExpanded)}
105
- className="avro-field-toggle text-gray-500 hover:text-gray-700 pt-0.5 w-4 text-center flex-shrink-0"
106
- aria-expanded={isExpanded}
107
- >
108
- <span className="font-mono text-xs">{isExpanded ? '▼' : '▶'}</span>
109
- </button>
110
- ) : (
111
- <div className="w-4" />
112
- )}
120
+ <div className="flex-shrink-0 w-4 pt-0.5">
121
+ {hasNested ? (
122
+ <button
123
+ onClick={() => setIsExpanded(!isExpanded)}
124
+ className="avro-field-toggle text-gray-500 hover:text-gray-700 w-4 text-center"
125
+ aria-expanded={isExpanded}
126
+ >
127
+ <span className="font-mono text-xs">{isExpanded ? '▼' : '▶'}</span>
128
+ </button>
129
+ ) : null}
130
+ </div>
113
131
 
114
132
  {/* Field details */}
115
- <div className="flex-grow">
116
- <div className="flex justify-between items-baseline">
117
- <div>
118
- <span className="avro-field-name font-semibold text-gray-800 text-sm">{field.name}</span>
119
- <span className="ml-1.5 text-purple-600 font-mono text-xs">{formatAvroType(field.type)}</span>
120
- </div>
121
- {showRequired && isRequired && <span className="text-red-600 text-xs ml-3 flex-shrink-0">required</span>}
133
+ <div className="flex-grow min-w-0">
134
+ <div className="flex flex-wrap items-baseline gap-x-1.5 gap-y-1">
135
+ <span className="avro-field-name font-semibold text-gray-800 text-sm">{field.name}</span>
136
+ <span className="text-purple-600 font-mono text-xs">{formatAvroType(field.type)}</span>
137
+ {showRequired && isRequired && <span className="text-red-600 text-xs ml-auto flex-shrink-0">required</span>}
122
138
  </div>
123
139
 
124
140
  {field.doc && <p className="text-gray-600 text-xs mt-1">{field.doc}</p>}
@@ -136,9 +152,9 @@ const AvroField = ({ field, level, expand, showRequired }: AvroFieldProps) => {
136
152
  )}
137
153
 
138
154
  {/* Nested fields for record types */}
139
- {hasNested && (
155
+ {hasNested && recordType && (
140
156
  <div className={`avro-nested-content mt-2 ${!isExpanded ? 'hidden' : ''}`}>
141
- {field.type.fields.map((nestedField: any) => (
157
+ {recordType.fields.map((nestedField: any) => (
142
158
  <AvroField
143
159
  key={nestedField.name}
144
160
  field={nestedField}
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.65.0-beta.0",
9
+ "version": "2.65.0-beta.2",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -25,11 +25,11 @@
25
25
  "@ai-sdk/google": "^2.0.17",
26
26
  "@ai-sdk/openai": "^2.0.42",
27
27
  "@ai-sdk/react": "^2.0.60",
28
- "@astrojs/markdown-remark": "^6.3.8",
29
- "@astrojs/mdx": "^4.3.9",
30
- "@astrojs/node": "^9.5.0",
31
- "@astrojs/react": "^4.4.1",
32
- "@astrojs/rss": "^4.0.13",
28
+ "@astrojs/markdown-remark": "^6.3.9",
29
+ "@astrojs/mdx": "^4.3.12",
30
+ "@astrojs/node": "^9.5.1",
31
+ "@astrojs/react": "^4.4.2",
32
+ "@astrojs/rss": "^4.0.14",
33
33
  "@astrojs/tailwind": "^6.0.2",
34
34
  "@asyncapi/avro-schema-parser": "^3.0.24",
35
35
  "@asyncapi/parser": "^3.4.0",
@@ -56,7 +56,7 @@
56
56
  "@tanstack/react-table": "^8.17.3",
57
57
  "@xyflow/react": "^12.3.6",
58
58
  "ai": "^5.0.60",
59
- "astro": "^5.15.3",
59
+ "astro": "^5.16.0",
60
60
  "astro-compress": "^2.3.8",
61
61
  "astro-expressive-code": "^0.41.3",
62
62
  "astro-seo": "^0.8.4",