@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.
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-OWR2FPYN.js → chunk-GDNZSDL4.js} +1 -1
- package/dist/{chunk-ID5N5C66.js → chunk-HVITNJND.js} +1 -1
- package/dist/{chunk-3D5MD2OX.js → chunk-SXOMOZU7.js} +1 -1
- package/dist/{chunk-PBH3ZP2J.js → chunk-TTSVZOOO.js} +1 -1
- package/dist/{chunk-H2IMKKZF.js → chunk-URNXOM2X.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.config.d.cts +4 -0
- package/dist/eventcatalog.config.d.ts +4 -0
- package/dist/eventcatalog.js +5 -5
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/pages/docs/teams/[id].mdx.ts +36 -0
- package/eventcatalog/src/pages/docs/users/[id].mdx.ts +36 -0
- package/eventcatalog/src/utils/feature.ts +3 -2
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
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
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -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.
|
|
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;
|
package/dist/eventcatalog.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-PLNJC7NZ.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
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-
|
|
26
|
+
} from "./chunk-HVITNJND.js";
|
|
27
27
|
import {
|
|
28
28
|
logger
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-GDNZSDL4.js";
|
|
30
30
|
import {
|
|
31
31
|
VERSION
|
|
32
|
-
} from "./chunk-
|
|
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.
|
|
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-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
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
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -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
|
|
56
|
-
return (
|
|
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';
|