@eventcatalog/core 3.0.0-beta.12 → 3.0.0-beta.13

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.0.0-beta.12";
40
+ var version = "3.0.0-beta.13";
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-PBH3ZP2J.js";
4
- import "../chunk-3D5MD2OX.js";
3
+ } from "../chunk-TTSVZOOO.js";
4
+ import "../chunk-SXOMOZU7.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 = "3.0.0-beta.12";
109
+ var version = "3.0.0-beta.13";
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-H2IMKKZF.js";
4
- import "../chunk-PBH3ZP2J.js";
5
- import "../chunk-3D5MD2OX.js";
3
+ } from "../chunk-URNXOM2X.js";
4
+ import "../chunk-TTSVZOOO.js";
5
+ import "../chunk-SXOMOZU7.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
  VERSION
3
- } from "./chunk-3D5MD2OX.js";
3
+ } from "./chunk-SXOMOZU7.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-OWR2FPYN.js";
3
+ } from "./chunk-GDNZSDL4.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "3.0.0-beta.12";
2
+ var version = "3.0.0-beta.13";
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-3D5MD2OX.js";
3
+ } from "./chunk-SXOMOZU7.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-PBH3ZP2J.js";
3
+ } from "./chunk-TTSVZOOO.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "3.0.0-beta.12";
28
+ var version = "3.0.0-beta.13";
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-3D5MD2OX.js";
3
+ } from "./chunk-SXOMOZU7.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -109,7 +109,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
109
109
  var import_picocolors = __toESM(require("picocolors"), 1);
110
110
 
111
111
  // package.json
112
- var version = "3.0.0-beta.12";
112
+ var version = "3.0.0-beta.13";
113
113
 
114
114
  // src/constants.ts
115
115
  var VERSION = version;
@@ -44,6 +44,9 @@ type PagesConfiguration = {
44
44
  icon?: string;
45
45
  pages?: string[];
46
46
  };
47
+ type AuthConfig = {
48
+ enabled: boolean;
49
+ };
47
50
  interface Config {
48
51
  title: string;
49
52
  tagline: false;
@@ -57,6 +60,7 @@ interface Config {
57
60
  host?: string;
58
61
  trailingSlash?: boolean;
59
62
  output?: 'server' | 'static';
63
+ auth?: AuthConfig;
60
64
  rss?: {
61
65
  enabled: boolean;
62
66
  limit: number;
@@ -44,6 +44,9 @@ type PagesConfiguration = {
44
44
  icon?: string;
45
45
  pages?: string[];
46
46
  };
47
+ type AuthConfig = {
48
+ enabled: boolean;
49
+ };
47
50
  interface Config {
48
51
  title: string;
49
52
  tagline: false;
@@ -57,6 +60,7 @@ interface Config {
57
60
  host?: string;
58
61
  trailingSlash?: boolean;
59
62
  output?: 'server' | 'static';
63
+ auth?: AuthConfig;
60
64
  rss?: {
61
65
  enabled: boolean;
62
66
  limit: number;
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-H2IMKKZF.js";
10
- import "./chunk-PBH3ZP2J.js";
9
+ } from "./chunk-URNXOM2X.js";
10
+ import "./chunk-TTSVZOOO.js";
11
11
  import {
12
12
  runMigrations
13
13
  } from "./chunk-BH3JMNAV.js";
@@ -23,13 +23,13 @@ import {
23
23
  } from "./chunk-5VBIXL6C.js";
24
24
  import {
25
25
  generate
26
- } from "./chunk-ID5N5C66.js";
26
+ } from "./chunk-HVITNJND.js";
27
27
  import {
28
28
  logger
29
- } from "./chunk-OWR2FPYN.js";
29
+ } from "./chunk-GDNZSDL4.js";
30
30
  import {
31
31
  VERSION
32
- } from "./chunk-3D5MD2OX.js";
32
+ } from "./chunk-SXOMOZU7.js";
33
33
  import "./chunk-UPONRQSN.js";
34
34
 
35
35
  // src/eventcatalog.ts
package/dist/generate.cjs CHANGED
@@ -73,7 +73,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
73
73
  var import_picocolors = __toESM(require("picocolors"), 1);
74
74
 
75
75
  // package.json
76
- var version = "3.0.0-beta.12";
76
+ var version = "3.0.0-beta.13";
77
77
 
78
78
  // src/constants.ts
79
79
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-ID5N5C66.js";
4
- import "./chunk-OWR2FPYN.js";
5
- import "./chunk-3D5MD2OX.js";
3
+ } from "./chunk-HVITNJND.js";
4
+ import "./chunk-GDNZSDL4.js";
5
+ import "./chunk-SXOMOZU7.js";
6
6
  import "./chunk-UPONRQSN.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.0.0-beta.12";
39
+ var version = "3.0.0-beta.13";
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-OWR2FPYN.js";
4
- import "../chunk-3D5MD2OX.js";
3
+ } from "../chunk-GDNZSDL4.js";
4
+ import "../chunk-SXOMOZU7.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -0,0 +1,36 @@
1
+ // This file exposes the markdown for EventCatalog in the Url
2
+ // For example http://localhost:3000/docs/teams/full-stack loads the Page and http://localhost:3000/docs/teams/full-stack.mdx loads the markdown
3
+ // This is used for the LLMs to load the markdown for the given item (llms.txt);
4
+
5
+ import type { APIRoute } from 'astro';
6
+ import { getCollection } from 'astro:content';
7
+ import config from '@config';
8
+ import fs from 'fs';
9
+
10
+ const teams = await getCollection('teams');
11
+
12
+ export async function getStaticPaths() {
13
+ // Just return empty array if LLMs are not enabled
14
+ if (!config.llmsTxt?.enabled) {
15
+ return [];
16
+ }
17
+
18
+ return teams.map((team) => ({
19
+ params: { type: 'teams', id: team.data.id },
20
+ props: { content: team },
21
+ }));
22
+ }
23
+
24
+ export const GET: APIRoute = async ({ params, props }) => {
25
+ // Just return empty array if LLMs are not enabled
26
+ if (!config.llmsTxt?.enabled) {
27
+ return new Response('llms.txt is not enabled for this Catalog.', { status: 404 });
28
+ }
29
+
30
+ if (props?.content?.filePath) {
31
+ const file = fs.readFileSync(props.content.filePath, 'utf8');
32
+ return new Response(file, { status: 200 });
33
+ }
34
+
35
+ return new Response('Not found', { status: 404 });
36
+ };
@@ -0,0 +1,36 @@
1
+ // This file exposes the markdown for EventCatalog in the Url
2
+ // For example http://localhost:3000/docs/users/dboyne loads the Page and http://localhost:3000/docs/users/dboyne.mdx loads the markdown
3
+ // This is used for the LLMs to load the markdown for the given item (llms.txt);
4
+
5
+ import type { APIRoute } from 'astro';
6
+ import { getCollection } from 'astro:content';
7
+ import config from '@config';
8
+ import fs from 'fs';
9
+
10
+ const users = await getCollection('users');
11
+
12
+ export async function getStaticPaths() {
13
+ // Just return empty array if LLMs are not enabled
14
+ if (!config.llmsTxt?.enabled) {
15
+ return [];
16
+ }
17
+
18
+ return users.map((user) => ({
19
+ params: { type: 'users', id: user.data.id },
20
+ props: { content: user },
21
+ }));
22
+ }
23
+
24
+ export const GET: APIRoute = async ({ params, props }) => {
25
+ // Just return empty array if LLMs are not enabled
26
+ if (!config.llmsTxt?.enabled) {
27
+ return new Response('llms.txt is not enabled for this Catalog.', { status: 404 });
28
+ }
29
+
30
+ if (props?.content?.filePath) {
31
+ const file = fs.readFileSync(props.content?.filePath, 'utf8');
32
+ return new Response(file, { status: 200 });
33
+ }
34
+
35
+ return new Response('Not found', { status: 404 });
36
+ };
@@ -51,9 +51,10 @@ export const isMarkdownDownloadEnabled = () => config?.llmsTxt?.enabled ?? false
51
51
  export const isLLMSTxtEnabled = () => (config?.llmsTxt?.enabled || isEventCatalogChatEnabled()) ?? false;
52
52
 
53
53
  export const isAuthEnabled = () => {
54
+ const isAuthEnabledInCatalog = config?.auth?.enabled ?? false;
54
55
  const directory = process.env.PROJECT_DIR || process.cwd();
55
- const hasAuthConfig = fs.existsSync(join(directory, 'eventcatalog.auth.js'));
56
- return (hasAuthConfig && isSSR() && isEventCatalogScaleEnabled()) || false;
56
+ const hasAuthConfigurationFile = fs.existsSync(join(directory, 'eventcatalog.auth.js'));
57
+ return (isAuthEnabledInCatalog && hasAuthConfigurationFile && isSSR() && isEventCatalogScaleEnabled()) || false;
57
58
  };
58
59
 
59
60
  export const isSSR = () => config?.output === 'server';
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": "3.0.0-beta.12",
9
+ "version": "3.0.0-beta.13",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },