@eventcatalog/core 3.0.0-beta.2 → 3.0.0-beta.21

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.
Files changed (103) hide show
  1. package/README.md +10 -0
  2. package/dist/__mocks__/astro-content.cjs +32 -0
  3. package/dist/__mocks__/astro-content.d.cts +13 -0
  4. package/dist/__mocks__/astro-content.d.ts +13 -0
  5. package/dist/__mocks__/astro-content.js +7 -0
  6. package/dist/analytics/analytics.cjs +1 -1
  7. package/dist/analytics/analytics.js +2 -2
  8. package/dist/analytics/log-build.cjs +1 -1
  9. package/dist/analytics/log-build.js +3 -3
  10. package/dist/{chunk-JSONCD7V.js → chunk-2FUEBPD3.js} +1 -1
  11. package/dist/{chunk-3W6JYTHP.js → chunk-HABY2LVH.js} +6 -2
  12. package/dist/{chunk-H4QHE5YZ.js → chunk-KQAMO3R4.js} +1 -1
  13. package/dist/chunk-Q6KRYWPV.js +44 -0
  14. package/dist/{chunk-PQL6O5YA.js → chunk-RRP2B7BL.js} +1 -1
  15. package/dist/constants.cjs +1 -1
  16. package/dist/constants.js +1 -1
  17. package/dist/eventcatalog.cjs +84 -65
  18. package/dist/eventcatalog.config.d.cts +4 -0
  19. package/dist/eventcatalog.config.d.ts +4 -0
  20. package/dist/eventcatalog.js +45 -57
  21. package/dist/generate.cjs +48 -2
  22. package/dist/generate.js +3 -1
  23. package/dist/utils/cli-logger.cjs +82 -0
  24. package/dist/utils/cli-logger.d.cts +10 -0
  25. package/dist/utils/cli-logger.d.ts +10 -0
  26. package/dist/utils/cli-logger.js +7 -0
  27. package/eventcatalog/astro.config.mjs +4 -1
  28. package/eventcatalog/integrations/ecstudio-watcher.mjs +1 -1
  29. package/eventcatalog/integrations/eventcatalog-features.ts +69 -0
  30. package/eventcatalog/public/icons/asyncapi-black.svg +2 -0
  31. package/eventcatalog/public/icons/graphql-black.svg +1 -0
  32. package/eventcatalog/public/icons/openapi-black.svg +1 -0
  33. package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +821 -0
  34. package/eventcatalog/src/components/ChatPanel/ChatPanelButton.tsx +24 -0
  35. package/eventcatalog/src/components/Grids/DomainGrid.tsx +1 -3
  36. package/eventcatalog/src/components/Grids/MessageGrid.tsx +8 -8
  37. package/eventcatalog/src/components/Header.astro +25 -5
  38. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.tsx +14 -3
  39. package/eventcatalog/src/components/Search/Search.astro +2 -2
  40. package/eventcatalog/src/components/Search/SearchModal.tsx +16 -7
  41. package/eventcatalog/src/components/SideNav/NestedSideBar/SearchBar.tsx +9 -2
  42. package/eventcatalog/src/components/SideNav/NestedSideBar/builders/domain.ts +7 -6
  43. package/eventcatalog/src/components/SideNav/NestedSideBar/builders/service.ts +6 -3
  44. package/eventcatalog/src/components/SideNav/NestedSideBar/builders/shared.ts +1 -0
  45. package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +23 -8
  46. package/eventcatalog/src/components/SideNav/NestedSideBar/sidebar-builder.ts +57 -11
  47. package/eventcatalog/src/content.config.ts +1 -10
  48. package/eventcatalog/src/enterprise/ai/chat-api.ts +262 -0
  49. package/eventcatalog/src/enterprise/auth/[...auth].ts +3 -0
  50. package/eventcatalog/src/enterprise/auth/login.astro +420 -0
  51. package/eventcatalog/src/enterprise/collections/index.ts +0 -1
  52. package/eventcatalog/src/layouts/Footer.astro +8 -5
  53. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +30 -19
  54. package/eventcatalog/src/pages/_index.astro +8 -9
  55. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +19 -3
  56. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/index.astro +7 -7
  57. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +1 -1
  58. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +5 -5
  59. package/eventcatalog/src/pages/docs/teams/[id].mdx.ts +36 -0
  60. package/eventcatalog/src/pages/docs/users/[id].mdx.ts +36 -0
  61. package/eventcatalog/src/pages/schemas/explorer/_index.data.ts +178 -0
  62. package/eventcatalog/src/pages/schemas/explorer/index.astro +5 -155
  63. package/eventcatalog/src/remark-plugins/directives.ts +30 -9
  64. package/eventcatalog/src/utils/collections/schemas.ts +31 -7
  65. package/eventcatalog/src/utils/feature.ts +8 -4
  66. package/eventcatalog/src/utils/resource-files.ts +86 -0
  67. package/package.json +12 -15
  68. package/default-files-for-collections/changelogs.md +0 -5
  69. package/default-files-for-collections/channels.md +0 -8
  70. package/default-files-for-collections/commands.md +0 -8
  71. package/default-files-for-collections/domains.md +0 -8
  72. package/default-files-for-collections/events.md +0 -8
  73. package/default-files-for-collections/flows.md +0 -11
  74. package/default-files-for-collections/queries.md +0 -8
  75. package/default-files-for-collections/services.md +0 -8
  76. package/default-files-for-collections/ubiquitousLanguages.md +0 -7
  77. package/eventcatalog/src/enterprise/collections/chat-prompts.ts +0 -32
  78. package/eventcatalog/src/enterprise/eventcatalog-chat/components/Chat.tsx +0 -60
  79. package/eventcatalog/src/enterprise/eventcatalog-chat/components/ChatMessage.tsx +0 -414
  80. package/eventcatalog/src/enterprise/eventcatalog-chat/components/ChatSidebar.tsx +0 -169
  81. package/eventcatalog/src/enterprise/eventcatalog-chat/components/InputModal.tsx +0 -244
  82. package/eventcatalog/src/enterprise/eventcatalog-chat/components/MentionInput.tsx +0 -211
  83. package/eventcatalog/src/enterprise/eventcatalog-chat/components/WelcomePromptArea.tsx +0 -176
  84. package/eventcatalog/src/enterprise/eventcatalog-chat/components/default-prompts.ts +0 -93
  85. package/eventcatalog/src/enterprise/eventcatalog-chat/components/hooks/ChatProvider.tsx +0 -143
  86. package/eventcatalog/src/enterprise/eventcatalog-chat/components/windows/ChatWindow.server.tsx +0 -387
  87. package/eventcatalog/src/enterprise/eventcatalog-chat/pages/api/chat.ts +0 -59
  88. package/eventcatalog/src/enterprise/eventcatalog-chat/pages/chat/index.astro +0 -104
  89. package/eventcatalog/src/enterprise/eventcatalog-chat/providers/ai-provider.ts +0 -140
  90. package/eventcatalog/src/enterprise/eventcatalog-chat/providers/anthropic.ts +0 -28
  91. package/eventcatalog/src/enterprise/eventcatalog-chat/providers/google.ts +0 -41
  92. package/eventcatalog/src/enterprise/eventcatalog-chat/providers/index.ts +0 -26
  93. package/eventcatalog/src/enterprise/eventcatalog-chat/providers/openai.ts +0 -61
  94. package/eventcatalog/src/enterprise/eventcatalog-chat/utils/chat-prompts.ts +0 -50
  95. package/eventcatalog/src/pages/auth/login.astro +0 -280
  96. package/eventcatalog/src/pages/chat/feature.astro +0 -179
  97. package/eventcatalog/src/pages/chat/index.astro +0 -10
  98. package/eventcatalog/src/pages/nav-index.json.ts +0 -30
  99. /package/eventcatalog/src/{pages → enterprise}/auth/error.astro +0 -0
  100. /package/eventcatalog/src/{middleware-auth.ts → enterprise/auth/middleware/middleware-auth.ts} +0 -0
  101. /package/eventcatalog/src/{middleware.ts → enterprise/auth/middleware/middleware.ts} +0 -0
  102. /package/eventcatalog/src/{pages/unauthorized/index.astro → enterprise/auth/unauthorized.astro} +0 -0
  103. /package/eventcatalog/src/{pages → enterprise}/plans/index.astro +0 -0
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-PQL6O5YA.js";
10
- import "./chunk-JSONCD7V.js";
9
+ } from "./chunk-RRP2B7BL.js";
10
+ import "./chunk-2FUEBPD3.js";
11
11
  import {
12
12
  runMigrations
13
13
  } from "./chunk-BH3JMNAV.js";
@@ -18,15 +18,17 @@ import {
18
18
  } from "./chunk-R2BJ7MJG.js";
19
19
  import "./chunk-55D645EH.js";
20
20
  import {
21
- VERSION
22
- } from "./chunk-H4QHE5YZ.js";
23
- import {
24
- isAuthEnabled,
25
21
  isOutputServer
26
22
  } from "./chunk-5VBIXL6C.js";
27
23
  import {
28
24
  generate
29
- } from "./chunk-3W6JYTHP.js";
25
+ } from "./chunk-HABY2LVH.js";
26
+ import {
27
+ logger
28
+ } from "./chunk-Q6KRYWPV.js";
29
+ import {
30
+ VERSION
31
+ } from "./chunk-KQAMO3R4.js";
30
32
  import "./chunk-UPONRQSN.js";
31
33
 
32
34
  // src/eventcatalog.ts
@@ -73,47 +75,31 @@ var copyCore = () => {
73
75
  }
74
76
  });
75
77
  };
76
- var copyServerFiles = async () => {
77
- const isServerOutput = await isOutputServer();
78
- if (fs.existsSync(join(core, "src/pages/api/server"))) {
79
- fs.rmSync(join(core, "src/pages/api/server"), { recursive: true });
80
- }
81
- if (!isServerOutput) {
82
- if (fs.existsSync(join(core, "src/pages/api/chat.ts"))) {
83
- fs.rmSync(join(core, "src/pages/api/chat.ts"));
84
- }
85
- if (fs.existsSync(join(core, "src/pages/api/[...auth].ts"))) {
86
- fs.rmSync(join(core, "src/pages/api/[...auth].ts"));
87
- }
88
- return;
89
- }
90
- fs.cpSync(join(eventCatalogDir, "src/enterprise/eventcatalog-chat/pages/api"), join(core, "src/pages/api"), {
91
- recursive: true
92
- });
93
- };
94
- var createAuthFileIfNotExists = async (hasRequiredLicense) => {
95
- const authEnabled = await isAuthEnabled();
96
- const isSRR = await isOutputServer();
97
- try {
98
- if (authEnabled && hasRequiredLicense && isSRR) {
99
- console.log("Creating auth file");
100
- fs.writeFileSync(
101
- join(core, "src/pages/api/[...auth].ts"),
102
- `import { AstroAuth } from 'auth-astro/server';
103
- export const prerender = false;
104
- export const { GET, POST } = AstroAuth();
105
- `
106
- );
107
- }
108
- } catch (error) {
109
- }
110
- };
111
78
  var clearCore = () => {
112
79
  if (fs.existsSync(core)) fs.rmSync(core, { recursive: true });
113
80
  };
114
81
  var checkForUpdate = () => {
115
82
  const installedVersion = getInstalledEventCatalogVersion();
116
83
  if (!installedVersion) return;
84
+ const majorVersion = parseInt(installedVersion.replace(/[^0-9.]/g, "").split(".")[0], 10);
85
+ if (majorVersion < 3) {
86
+ const v3Message = `\u{1F680} EventCatalog V3 is now available in beta!
87
+
88
+ You are currently on version ${installedVersion}.
89
+ V3 brings exciting new features and improvements.
90
+
91
+ Upgrade now: npm i @eventcatalog/core@beta`;
92
+ console.log(
93
+ boxen(v3Message, {
94
+ padding: 1,
95
+ margin: 1,
96
+ align: "center",
97
+ borderColor: "magenta",
98
+ borderStyle: "round"
99
+ })
100
+ );
101
+ return;
102
+ }
117
103
  const pkg = { name: "@eventcatalog/core", version: installedVersion };
118
104
  const notifier = updateNotifier({ pkg, updateCheckInterval: 0 });
119
105
  if (notifier.update) {
@@ -140,14 +126,17 @@ Run npm i @eventcatalog/core to update`;
140
126
  }
141
127
  };
142
128
  program.command("dev").description("Run development server of EventCatalog").option("-d, --debug", "Output EventCatalog application information into your terminal").option("--force-recreate", "Recreate the eventcatalog-core directory", false).action(async (options, command) => {
143
- console.log("Setting up EventCatalog....");
129
+ logger.welcome();
130
+ logger.info("Setting up EventCatalog...", "eventcatalog");
131
+ const isServer = await isOutputServer();
132
+ logger.info(isServer ? "EventCatalog is running in Server Mode" : "EventCatalog is running in Static Mode", "config");
144
133
  if (fs.existsSync(path.join(dir, ".env"))) {
145
134
  dotenv.config({ path: path.join(dir, ".env") });
146
135
  }
147
136
  if (options.debug) {
148
- console.log("Debug mode enabled");
149
- console.log("PROJECT_DIR", dir);
150
- console.log("CATALOG_DIR", core);
137
+ logger.info("Debug mode enabled", "debug");
138
+ logger.info(`PROJECT_DIR: ${dir}`, "debug");
139
+ logger.info(`CATALOG_DIR: ${core}`, "debug");
151
140
  }
152
141
  if (options.forceRecreate) clearCore();
153
142
  copyCore();
@@ -155,14 +144,12 @@ program.command("dev").description("Run development server of EventCatalog").opt
155
144
  await checkAndConvertMdToMdx(dir, core);
156
145
  await runMigrations(dir);
157
146
  await catalogToAstro(dir, core);
158
- await copyServerFiles();
159
147
  const canEmbedPages = await isFeatureEnabled(
160
148
  "@eventcatalog/backstage-plugin-eventcatalog",
161
149
  process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
162
150
  );
163
151
  const isEventCatalogStarter = await isEventCatalogStarterEnabled();
164
152
  const isEventCatalogScale = await isEventCatalogScaleEnabled();
165
- await createAuthFileIfNotExists(isEventCatalogScale);
166
153
  checkForUpdate();
167
154
  let watchUnsub;
168
155
  try {
@@ -195,20 +182,21 @@ program.command("dev").description("Run development server of EventCatalog").opt
195
182
  }
196
183
  });
197
184
  program.command("build").description("Run build of EventCatalog").action(async (options, command) => {
198
- console.log("Building EventCatalog...");
185
+ logger.welcome();
186
+ logger.info("Building EventCatalog...", "build");
187
+ const isServer = await isOutputServer();
188
+ logger.info(isServer ? "EventCatalog is running in Server Mode" : "EventCatalog is running in Static Mode", "config");
199
189
  if (fs.existsSync(path.join(dir, ".env"))) {
200
190
  dotenv.config({ path: path.join(dir, ".env") });
201
191
  }
202
192
  copyCore();
203
- await copyServerFiles();
204
- const canEmbedPages = await isFeatureEnabled(
193
+ const isBackstagePluginEnabled = await isFeatureEnabled(
205
194
  "@eventcatalog/backstage-plugin-eventcatalog",
206
195
  process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
207
196
  );
208
197
  const isEventCatalogStarter = await isEventCatalogStarterEnabled();
209
198
  const isEventCatalogScale = await isEventCatalogScaleEnabled();
210
- const isServerOutput = await isOutputServer();
211
- await createAuthFileIfNotExists(isEventCatalogScale);
199
+ const canEmbedPages = isBackstagePluginEnabled || isEventCatalogScale;
212
200
  await log_build_default(dir, {
213
201
  isEventCatalogStarterEnabled: isEventCatalogStarter,
214
202
  isEventCatalogScaleEnabled: isEventCatalogScale,
@@ -259,7 +247,8 @@ var startServerCatalog = ({
259
247
  );
260
248
  };
261
249
  program.command("preview").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
262
- console.log("Starting preview of your build...");
250
+ logger.welcome();
251
+ logger.info("Starting preview of your build...", "preview");
263
252
  if (fs.existsSync(path.join(dir, ".env"))) {
264
253
  dotenv.config({ path: path.join(dir, ".env") });
265
254
  }
@@ -269,12 +258,11 @@ program.command("preview").description("Serves the contents of your eventcatalog
269
258
  );
270
259
  const isEventCatalogStarter = await isEventCatalogStarterEnabled();
271
260
  const isEventCatalogScale = await isEventCatalogScaleEnabled();
272
- await copyServerFiles();
273
- await createAuthFileIfNotExists(isEventCatalogScale);
274
261
  previewCatalog({ command, canEmbedPages: canEmbedPages || isEventCatalogScale, isEventCatalogStarter, isEventCatalogScale });
275
262
  });
276
263
  program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
277
- console.log("Starting preview of your build...");
264
+ logger.welcome();
265
+ logger.info("Starting preview of your build...", "preview");
278
266
  if (fs.existsSync(path.join(dir, ".env"))) {
279
267
  dotenv.config({ path: path.join(dir, ".env") });
280
268
  }
package/dist/generate.cjs CHANGED
@@ -69,6 +69,51 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
69
69
  }
70
70
  };
71
71
 
72
+ // src/utils/cli-logger.ts
73
+ var import_picocolors = __toESM(require("picocolors"), 1);
74
+
75
+ // package.json
76
+ var version = "3.0.0-beta.21";
77
+
78
+ // src/constants.ts
79
+ var VERSION = version;
80
+
81
+ // src/utils/cli-logger.ts
82
+ var getTimestamp = () => {
83
+ const now = /* @__PURE__ */ new Date();
84
+ return now.toLocaleTimeString("en-US", { hour12: false });
85
+ };
86
+ var formatMessage = (tag, message, tagColor) => {
87
+ return `${import_picocolors.default.dim(getTimestamp())} ${tagColor(`[${tag}]`)} ${message}`;
88
+ };
89
+ var logger = {
90
+ welcome: () => {
91
+ console.log();
92
+ console.log(import_picocolors.default.magenta(import_picocolors.default.bold("\u{1F680} EventCatalog")) + import_picocolors.default.dim(` (v${VERSION})`));
93
+ console.log(import_picocolors.default.dim("https://eventcatalog.dev"));
94
+ console.log();
95
+ console.log(
96
+ import_picocolors.default.dim("If you like the project, we would appreciate a star on GitHub \u2764\uFE0F - ") + import_picocolors.default.bold("https://github.com/event-catalog/eventcatalog/stargazers")
97
+ );
98
+ console.log();
99
+ },
100
+ info: (message, tag = "info") => {
101
+ console.log(formatMessage(tag, message, import_picocolors.default.blue));
102
+ },
103
+ success: (message, tag = "success") => {
104
+ console.log(formatMessage(tag, message, import_picocolors.default.green));
105
+ },
106
+ error: (message, tag = "error") => {
107
+ console.log(formatMessage(tag, message, import_picocolors.default.red));
108
+ },
109
+ warning: (message, tag = "warn") => {
110
+ console.log(formatMessage(tag, message, import_picocolors.default.yellow));
111
+ },
112
+ dim: (message) => {
113
+ console.log(import_picocolors.default.dim(message));
114
+ }
115
+ };
116
+
72
117
  // src/generate.js
73
118
  function getDefaultExport(importedModule) {
74
119
  if (importedModule === null || typeof importedModule !== "object") {
@@ -87,7 +132,7 @@ var generate = async (PROJECT_DIRECTORY) => {
87
132
  const config = await getEventCatalogConfigFile(PROJECT_DIRECTORY);
88
133
  const { generators = [] } = config;
89
134
  if (!generators.length) {
90
- console.log("No configured generators found, skipping generation");
135
+ logger.info("No configured generators found, skipping generation", "generator");
91
136
  return;
92
137
  }
93
138
  for (const generator of generators) {
@@ -104,7 +149,8 @@ var generate = async (PROJECT_DIRECTORY) => {
104
149
  const generator2 = getDefaultExport(importedGenerator);
105
150
  await generator2({ eventCatalogConfig: {} }, pluginConfig);
106
151
  } catch (error) {
107
- console.error("Error loading plugin:", error);
152
+ logger.error("Error loading plugin:", "generator");
153
+ console.error(error);
108
154
  await cleanup(PROJECT_DIRECTORY);
109
155
  return;
110
156
  }
package/dist/generate.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-3W6JYTHP.js";
3
+ } from "./chunk-HABY2LVH.js";
4
+ import "./chunk-Q6KRYWPV.js";
5
+ import "./chunk-KQAMO3R4.js";
4
6
  import "./chunk-UPONRQSN.js";
5
7
  export {
6
8
  generate
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/utils/cli-logger.ts
31
+ var cli_logger_exports = {};
32
+ __export(cli_logger_exports, {
33
+ logger: () => logger
34
+ });
35
+ module.exports = __toCommonJS(cli_logger_exports);
36
+ var import_picocolors = __toESM(require("picocolors"), 1);
37
+
38
+ // package.json
39
+ var version = "3.0.0-beta.21";
40
+
41
+ // src/constants.ts
42
+ var VERSION = version;
43
+
44
+ // src/utils/cli-logger.ts
45
+ var getTimestamp = () => {
46
+ const now = /* @__PURE__ */ new Date();
47
+ return now.toLocaleTimeString("en-US", { hour12: false });
48
+ };
49
+ var formatMessage = (tag, message, tagColor) => {
50
+ return `${import_picocolors.default.dim(getTimestamp())} ${tagColor(`[${tag}]`)} ${message}`;
51
+ };
52
+ var logger = {
53
+ welcome: () => {
54
+ console.log();
55
+ console.log(import_picocolors.default.magenta(import_picocolors.default.bold("\u{1F680} EventCatalog")) + import_picocolors.default.dim(` (v${VERSION})`));
56
+ console.log(import_picocolors.default.dim("https://eventcatalog.dev"));
57
+ console.log();
58
+ console.log(
59
+ import_picocolors.default.dim("If you like the project, we would appreciate a star on GitHub \u2764\uFE0F - ") + import_picocolors.default.bold("https://github.com/event-catalog/eventcatalog/stargazers")
60
+ );
61
+ console.log();
62
+ },
63
+ info: (message, tag = "info") => {
64
+ console.log(formatMessage(tag, message, import_picocolors.default.blue));
65
+ },
66
+ success: (message, tag = "success") => {
67
+ console.log(formatMessage(tag, message, import_picocolors.default.green));
68
+ },
69
+ error: (message, tag = "error") => {
70
+ console.log(formatMessage(tag, message, import_picocolors.default.red));
71
+ },
72
+ warning: (message, tag = "warn") => {
73
+ console.log(formatMessage(tag, message, import_picocolors.default.yellow));
74
+ },
75
+ dim: (message) => {
76
+ console.log(import_picocolors.default.dim(message));
77
+ }
78
+ };
79
+ // Annotate the CommonJS export names for ESM import in node:
80
+ 0 && (module.exports = {
81
+ logger
82
+ });
@@ -0,0 +1,10 @@
1
+ declare const logger: {
2
+ welcome: () => void;
3
+ info: (message: string, tag?: string) => void;
4
+ success: (message: string, tag?: string) => void;
5
+ error: (message: string, tag?: string) => void;
6
+ warning: (message: string, tag?: string) => void;
7
+ dim: (message: string) => void;
8
+ };
9
+
10
+ export { logger };
@@ -0,0 +1,10 @@
1
+ declare const logger: {
2
+ welcome: () => void;
3
+ info: (message: string, tag?: string) => void;
4
+ success: (message: string, tag?: string) => void;
5
+ error: (message: string, tag?: string) => void;
6
+ warning: (message: string, tag?: string) => void;
7
+ dim: (message: string) => void;
8
+ };
9
+
10
+ export { logger };
@@ -0,0 +1,7 @@
1
+ import {
2
+ logger
3
+ } from "../chunk-Q6KRYWPV.js";
4
+ import "../chunk-KQAMO3R4.js";
5
+ export {
6
+ logger
7
+ };
@@ -20,12 +20,14 @@ import rehypeExpressiveCode from 'rehype-expressive-code'
20
20
  import config from './eventcatalog.config';
21
21
  import expressiveCode from 'astro-expressive-code';
22
22
  import ecstudioWatcher from './integrations/ecstudio-watcher.mjs';
23
+ import eventCatalogIntegration from './integrations/eventcatalog-features.ts';
23
24
 
24
25
  const projectDirectory = process.env.PROJECT_DIR || process.cwd();
25
26
  const base = config.base || '/';
26
27
  const host = config.host || false;
27
28
  const compress = config.compress ?? false;
28
29
 
30
+
29
31
  const expressiveCodeConfig = {
30
32
  themes: ['andromeeda'],
31
33
  defaultProps: {
@@ -89,6 +91,7 @@ export default defineConfig({
89
91
  CSS: false,
90
92
  }),
91
93
  ecstudioWatcher(),
94
+ eventCatalogIntegration(),
92
95
  ].filter(Boolean),
93
96
  vite: {
94
97
  define: {
@@ -119,7 +122,7 @@ export default defineConfig({
119
122
  }
120
123
  },
121
124
  ssr: {
122
- external: ['eventcatalog.auth.js'],
125
+ external: ['eventcatalog.auth.js', 'eventcatalog.chat.js'],
123
126
  }
124
127
  }
125
128
  });
@@ -55,7 +55,7 @@ export default function ecstudioWatcher() {
55
55
  // Also add the root directory to watch for new files
56
56
  server.watcher.add(rootDir);
57
57
 
58
- console.log('Set up dynamic .ecstudio file watcher with content refresh');
58
+ // console.log('Set up dynamic .ecstudio file watcher with content refresh');
59
59
  },
60
60
  },
61
61
  };
@@ -0,0 +1,69 @@
1
+ import type { AstroIntegration } from 'astro';
2
+ import path from 'path';
3
+ import {
4
+ isEventCatalogChatEnabled,
5
+ isAuthEnabled,
6
+ isEventCatalogScaleEnabled,
7
+ isEventCatalogStarterEnabled,
8
+ } from '../src/utils/feature';
9
+
10
+ const catalogDirectory = process.env.CATALOG_DIR || process.cwd();
11
+
12
+ const configureAuthentication = (params: {
13
+ injectRoute: (route: { pattern: string; entrypoint: string }) => void;
14
+ addMiddleware: (middleware: { entrypoint: string; order: 'pre' }) => void;
15
+ }) => {
16
+ params.injectRoute({
17
+ pattern: '/api/[...auth]',
18
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/auth/[...auth].ts'),
19
+ });
20
+ params.injectRoute({
21
+ pattern: '/auth/login',
22
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/auth/login.astro'),
23
+ });
24
+ params.injectRoute({
25
+ pattern: '/auth/error',
26
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/auth/error.astro'),
27
+ });
28
+
29
+ params.injectRoute({
30
+ pattern: '/unauthorized',
31
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/auth/unauthorized.astro'),
32
+ });
33
+
34
+ // Add the authentication middleware
35
+ params.addMiddleware({
36
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/auth/middleware/middleware.ts'),
37
+ order: 'pre',
38
+ });
39
+ };
40
+
41
+ export default function eventCatalogIntegration(): AstroIntegration {
42
+ return {
43
+ name: 'eventcatalog',
44
+ hooks: {
45
+ 'astro:config:setup': (params) => {
46
+ // Handle routes for AI features
47
+ if (isEventCatalogChatEnabled()) {
48
+ params.injectRoute({
49
+ pattern: '/api/chat',
50
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/ai/chat-api.ts'),
51
+ });
52
+ }
53
+
54
+ // Handle routes for authentication
55
+ if (isAuthEnabled()) {
56
+ configureAuthentication(params);
57
+ }
58
+
59
+ // If non paying user, add the plans route into the project
60
+ if (!isEventCatalogStarterEnabled() && !isEventCatalogScaleEnabled()) {
61
+ params.injectRoute({
62
+ pattern: '/plans',
63
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/plans/index.astro'),
64
+ });
65
+ }
66
+ },
67
+ },
68
+ };
69
+ }
@@ -0,0 +1,2 @@
1
+
2
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 155.51 155.51"><defs><style>.cls-1{fill:"#000"}.cls-2{fill:'#000'}.cls-3{fill:"#000"}.cls-4{fill:"#000";}.cls-5{fill:#fff;}</style><linearGradient id="linear-gradient" x1="133.74" y1="21.76" x2="24.84" y2="130.67" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#2dccfd"/><stop offset="1" stop-color="#ad20e2"/></linearGradient><linearGradient id="linear-gradient-2" x1="6471.36" y1="6969.64" x2="6362.46" y2="7078.54" gradientTransform="translate(7103.38 -6337.62) rotate(90)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#a829e2"/><stop offset="0.05" stop-color="#a829e2" stop-opacity="0.84"/><stop offset="0.11" stop-color="#a829e2" stop-opacity="0.67"/><stop offset="0.18" stop-color="#a829e2" stop-opacity="0.51"/><stop offset="0.25" stop-color="#a829e2" stop-opacity="0.38"/><stop offset="0.33" stop-color="#a829e2" stop-opacity="0.28"/><stop offset="0.43" stop-color="#a829e2" stop-opacity="0.2"/><stop offset="0.54" stop-color="#a829e2" stop-opacity="0.14"/><stop offset="0.68" stop-color="#a829e2" stop-opacity="0.11"/><stop offset="1" stop-color="#a829e2" stop-opacity="0.1"/></linearGradient><linearGradient id="linear-gradient-3" x1="13419.24" y1="632.02" x2="13310.33" y2="740.92" gradientTransform="translate(13441 765.76) rotate(180)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#e50e99"/><stop offset="1" stop-color="#a829e2" stop-opacity="0.1"/></linearGradient><linearGradient id="linear-gradient-4" x1="138.74" y1="-7.39" x2="29.84" y2="101.52" gradientTransform="translate(-5 29.16)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#21d4fd"/><stop offset="0.03" stop-color="#27cdfc" stop-opacity="0.96"/><stop offset="0.23" stop-color="#4e9cf4" stop-opacity="0.7"/><stop offset="0.43" stop-color="#6e73ee" stop-opacity="0.49"/><stop offset="0.61" stop-color="#8753e9" stop-opacity="0.32"/><stop offset="0.77" stop-color="#993ce5" stop-opacity="0.2"/><stop offset="0.9" stop-color="#a42ee3" stop-opacity="0.13"/><stop offset="1" stop-color="#a829e2" stop-opacity="0.1"/></linearGradient></defs><rect class="cls-1" x="8.88" y="8.88" width="137.75" height="137.75" rx="32.58"/><rect class="cls-2" x="8.88" y="8.88" width="137.75" height="137.75" rx="32.58"/><rect class="cls-3" x="8.88" y="8.88" width="137.75" height="137.75" rx="32.58"/><rect class="cls-4" x="8.88" y="8.88" width="137.75" height="137.75" rx="32.58"/><g id="New_lines" data-name="New lines"><polygon class="cls-5" points="53.35 63.21 49.25 68.86 81.27 92.1 81.49 92.26 85.59 86.61 53.57 63.37 53.35 63.21"/><polygon class="cls-5" points="74.27 63.37 74.05 63.21 69.95 68.86 101.97 92.1 102.19 92.26 106.29 86.61 74.27 63.37"/><path class="cls-5" d="M77.78,34.29c-17.35,0-31.48,10.79-31.48,24.06v.27h7v-.27c0-9.42,11-17.08,24.5-17.08s24.51,7.66,24.51,17.08v.27h7v-.27C109.27,45.08,95.14,34.29,77.78,34.29Z"/><path class="cls-5" d="M102.23,97.16c0,9.42-11,17.08-24.51,17.08s-24.5-7.66-24.5-17.08v-.27h-7v.27c0,13.26,14.13,24,31.48,24s31.49-10.79,31.49-24v-.27h-7Z"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg viewBox="-16 0 288 288" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid" fill="#000000"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g fill-rule="evenodd"> <path d="M152.575995,32.9634453 L211.722058,67.1124427 C213.387503,65.348329 215.332859,63.7907081 217.539734,62.5088708 C229.806457,55.4573413 245.452038,59.6441869 252.577021,71.9109101 C259.62855,84.1776333 255.441705,99.8232143 243.174982,106.948197 C240.984974,108.207124 238.684929,109.10784 236.343812,109.66832 L236.343812,177.99302 C238.659582,178.554683 240.934429,179.449686 243.101528,180.695443 C255.441705,187.820426 259.62855,203.466007 252.503568,215.73273 C245.452038,227.999453 229.733004,232.186299 217.46628,225.13477 C215.024105,223.730884 212.902189,221.983449 211.125456,219.988103 L152.340162,253.928803 C153.180519,256.46808 153.635248,259.18431 153.635248,262.008393 C153.635248,276.111452 142.176512,287.64364 128,287.64364 C113.823488,287.64364 102.364752,276.184905 102.364752,262.008393 C102.364752,259.488481 102.726802,257.054441 103.40181,254.755362 L44.2714887,220.615454 C42.6238257,222.34493 40.705394,223.873378 38.5337196,225.13477 C26.193543,232.186299 10.547962,227.999453 3.49643248,215.73273 C-3.55509701,203.466007 0.631748621,187.820426 12.8984718,180.695443 C15.0673397,179.448669 17.3418356,178.553222 19.6561876,177.991646 L19.6561876,109.66832 C17.3150714,109.10784 15.0150257,108.207124 12.8250184,106.948197 C0.558295189,99.8966677 -3.62855044,84.1776333 3.42297904,71.9109101 C10.4745085,59.6441869 26.193543,55.4573413 38.4602662,62.5088708 C40.6551374,63.7837361 42.5913269,65.3313931 44.2507413,67.0836756 L103.41276,32.9254664 C102.730718,30.6154532 102.364752,28.1687503 102.364752,25.6352478 C102.364752,11.4587354 113.823488,0 128,0 C142.176512,0 153.635248,11.4587354 153.635248,25.6352478 C153.635248,28.1826393 153.265258,30.6422768 152.575995,32.9634453 Z M146.413638,43.4848713 L205.700555,77.715193 C203.867899,84.1516888 204.540515,91.2885638 208.137694,97.5461579 C211.746601,103.824151 217.625783,107.985785 224.150543,109.607654 L224.150543,178.017842 C223.818032,178.099463 223.48718,178.187674 223.158201,178.282419 L145.72529,44.1686182 C145.959017,43.9450469 146.18851,43.7170876 146.413638,43.4848713 Z M110.29093,44.1841203 L32.8593279,178.295656 C32.524559,178.19844 32.1878611,178.108015 31.8494573,178.024438 L31.8494573,109.607654 C38.3742168,107.985785 44.2533992,103.824151 47.8623055,97.5461579 C51.466599,91.276189 52.1347497,84.1234583 50.2885426,77.6770157 L109.558747,43.4563434 C109.797913,43.7038019 110.042027,43.9464469 110.29093,44.1841203 Z M135.162749,50.259763 L212.576817,184.340928 C210.844241,185.99279 209.317376,187.91755 208.064241,190.097482 C206.818484,192.264581 205.923481,194.539429 205.361818,196.855198 L50.6395564,196.855198 C50.0779798,194.540846 49.1825333,192.26635 47.9357589,190.097482 C46.6776713,187.931497 45.1539248,186.017428 43.4300297,184.372667 L120.858821,50.2659993 C123.124941,50.9200822 125.520915,51.2704957 128,51.2704957 C130.486952,51.2704957 132.890265,50.9178547 135.162749,50.259763 Z M146.958084,244.737995 L205.860107,210.729899 C205.683398,210.174924 205.525483,209.614096 205.38664,209.048468 L50.6067643,209.048468 C50.5246888,209.380792 50.4360084,209.711472 50.3407792,210.040295 L109.531782,244.215239 C114.192298,239.378545 120.739739,236.373145 128,236.373145 C135.518379,236.373145 142.272352,239.596041 146.958084,244.737995 Z" fill="#000"> </path> </g> </g></svg>
@@ -0,0 +1 @@
1
+ <svg viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid" fill="#000000"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g> <path d="M127.059657,255.996921 C58.8506544,255.526472 -0.457073619,198.918442 0.00265506057,126.998303 C0.444649399,57.7958628 57.9516598,-0.468967577 129.11002,0.00284555012 C198.267128,0.462386081 256.613109,57.8667711 255.995136,128.194199 C256.568091,197.883453 197.934268,256.489189 127.059657,255.996921 Z M127.059657,255.996921 C58.8506544,255.526472 -0.457073619,198.918442 0.00265506057,126.998303 C0.444649399,57.7958628 57.9516598,-0.468967577 129.11002,0.00284555012 C198.267128,0.462386081 256.613109,57.8667711 255.995136,128.194199 C256.568091,197.883453 197.934268,256.489189 127.059657,255.996921 Z" fill="#FFFFFF"> </path> <path d="M127.184644,238.997327 C68.0323765,238.589271 16.6036091,189.498744 17.0023028,127.131428 C17.3860285,67.1185953 67.2554,16.5917106 128.963117,17.0024872 C188.934544,17.4010221 239.531905,67.1825241 238.995778,128.169251 C239.492444,188.602381 188.64743,239.424426 127.184644,238.997327 Z M127.184644,238.997327 C68.0323765,238.589271 16.6036091,189.498744 17.0023028,127.131428 C17.3860285,67.1185953 67.2554,16.5917106 128.963117,17.0024872 C188.934544,17.4010221 239.531905,67.1825241 238.995778,128.169251 C239.492444,188.602381 188.64743,239.424426 127.184644,238.997327 Z" fill="#000"> </path> <path d="M169.327319,127.956161 C169.042723,133.246373 164.421106,137.639224 159.866213,136.872586 C159.844426,136.872586 159.821277,136.872586 159.798128,136.872586 C154.753021,136.879395 150.658383,132.794288 150.652936,127.749182 C150.824511,122.690458 155.019915,118.703395 160.08,118.789182 C165.125106,118.813692 169.59966,123.077182 169.327319,127.956161 Z M88.2011915,179.220161 C90.1034894,179.27599 92.0071489,179.235139 94.2008511,179.235139 L94.2008511,193.021012 C80.5661277,195.326373 69.3348085,191.455054 66.5787234,179.929607 C65.6350638,175.69199 65.0549787,171.380841 64.8425532,167.04382 C64.5497872,162.452161 65.0563404,157.808756 64.706383,153.225267 C63.7368511,140.613182 62.1028085,136.30748 50,135.711054 L50,120.014714 C50.8674043,119.81182 51.7470638,119.662033 52.6321702,119.562629 C59.2677447,119.23582 62.0646809,117.201437 63.5489362,110.665267 C64.2243404,106.992756 64.6246809,103.275309 64.7431489,99.5428839 C65.268766,92.3258627 65.0822128,84.991735 66.2845957,77.8918201 C68.0221277,67.6245861 74.3962553,62.6366712 84.9249362,62.0783733 C87.9206809,61.9176925 90.9259574,62.0538627 94.3206809,62.0538627 L94.3206809,76.1447563 C92.9235745,76.2441605 91.6435745,76.4470542 90.3717447,76.4089265 C81.7916596,76.146118 81.3477447,79.0683308 80.7213617,86.1709691 C80.3305532,90.6250967 80.8697872,95.1554797 80.5661277,99.6245861 C80.2488511,104.071905 79.6537872,108.496075 78.7850213,112.869863 C77.547234,119.208586 73.6500426,123.922799 68.2495319,127.92348 C78.7332766,134.745607 79.9261277,145.346458 80.6069787,156.110714 C80.9732766,161.895224 80.8057872,167.720586 81.3926809,173.476501 C81.8502128,177.944246 83.5877447,179.08399 88.2011915,179.220161 Z M97.0372766,118.789182 C97.0917447,118.789182 97.1448511,118.789182 97.1993191,118.789182 C102.211745,118.872246 106.209702,123.002288 106.126638,128.016075 C106.126638,128.180841 106.121191,128.344246 106.11166,128.50765 C105.829787,133.407054 101.630298,137.149012 96.7308936,136.867139 C96.5334468,136.871224 96.3373617,136.867139 96.1399149,136.857607 C91.1506383,136.609778 87.3065532,132.36399 87.554383,127.374714 C87.8022128,122.385437 92.048,118.541352 97.0372766,118.789182 Z M128.273362,118.789182 C133.755574,118.746969 137.396766,122.29965 137.425362,127.719224 C137.455319,133.284501 134.003404,136.845352 128.556596,136.868501 C123.017191,136.893012 119.370553,133.389352 119.340596,128.002458 C119.324255,127.727395 119.32017,127.452331 119.32834,127.177267 C119.482213,122.390884 123.486979,118.635309 128.273362,118.789182 Z M193.673191,111.92348 C195.131574,117.370288 197.970723,119.284841 203.704851,119.546288 C204.644426,119.589863 205.579915,119.749182 206.868085,119.892161 L206.868085,135.584416 C206.170894,135.813182 205.456,135.984756 204.730213,136.096416 C197.046128,136.574373 193.54383,139.726714 192.76766,147.431224 C192.272,152.349692 192.312851,157.322629 191.972426,162.258799 C191.829447,167.678373 191.336511,173.082969 190.49634,178.438544 C188.535489,188.142033 182.477277,192.982884 172.467404,193.573863 C169.245617,193.764501 166.000681,193.60382 162.526979,193.60382 L162.526979,179.578288 C164.396596,179.462544 166.046979,179.303224 167.701447,179.263735 C173.682043,179.120756 175.796766,177.192586 176.089532,171.252841 C176.413617,164.727565 176.555234,158.194118 176.846638,151.66748 C177.270128,142.233607 179.853277,133.806033 188.641702,127.922118 C183.612936,124.336756 179.575489,119.994288 178.529702,114.138969 C177.264681,107.041778 176.85617,99.7879903 176.175319,92.5913946 C175.838979,88.9937776 175.855319,85.3648414 175.504,81.7699478 C175.125447,77.8890967 172.459234,76.5464584 168.926979,76.4593095 C166.903489,76.4102882 164.87183,76.4497776 162.284596,76.4497776 L162.284596,62.7537776 C178.793872,60.0126712 190.198128,65.5057776 191.257532,81.3015222 C191.701447,87.9343733 191.636085,94.5985435 192.060936,101.231395 C192.247489,104.839905 192.786723,108.421182 193.673191,111.92348 Z" fill="#FFFFFF"> </path> </g> </g></svg>