@eventcatalog/core 2.61.1 → 2.61.3
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-RPWUOJ3F.js → chunk-BMTNHR7C.js} +1 -1
- package/dist/{chunk-MDWG55PH.js → chunk-EICO7E3X.js} +1 -1
- package/dist/{chunk-CMVDQ42N.js → chunk-LLJZTUOG.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +3 -3
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/ai-provider.ts +8 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +8 -3
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/_[filename].data.ts +1 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +8 -2
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/_[filename].data.ts +1 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/[filename].astro +9 -3
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/_[filename].data.ts +1 -0
- package/eventcatalog/src/utils/url-builder.ts +1 -8
- 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-EICO7E3X.js";
|
|
4
|
+
import "../chunk-BMTNHR7C.js";
|
|
5
|
+
import "../chunk-LLJZTUOG.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
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-EICO7E3X.js";
|
|
10
|
+
import "./chunk-BMTNHR7C.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro,
|
|
13
13
|
checkAndConvertMdToMdx
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import "./chunk-55D645EH.js";
|
|
16
16
|
import {
|
|
17
17
|
VERSION
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LLJZTUOG.js";
|
|
19
19
|
import {
|
|
20
20
|
getProjectOutDir,
|
|
21
21
|
isAuthEnabled,
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { getBaseURL } from '@utils/url-builder';
|
|
2
1
|
import { streamText, tool, type LanguageModel, type UIMessage, stepCountIs, convertToModelMessages } from 'ai';
|
|
3
2
|
import { z } from 'astro/zod';
|
|
3
|
+
import config from '@config';
|
|
4
|
+
|
|
5
|
+
const getBaseURL = () => {
|
|
6
|
+
if (import.meta.env.MODE === 'development') {
|
|
7
|
+
return `http://localhost:${config.port || 3000}`;
|
|
8
|
+
}
|
|
9
|
+
return config.homepageLink || 'https://eventcatalog.dev/';
|
|
10
|
+
};
|
|
4
11
|
|
|
5
12
|
export const getEventCatalogResources = async () => {
|
|
6
13
|
const baseUrl = process.env.EVENTCATALOG_URL || getBaseURL();
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
import path from 'path';
|
|
3
2
|
import { createElement } from 'react';
|
|
4
3
|
import { renderToString } from 'react-dom/server';
|
|
5
4
|
import { Parser } from '@asyncapi/parser';
|
|
@@ -18,17 +17,23 @@ export const prerender = Page.prerender;
|
|
|
18
17
|
export const getStaticPaths = Page.getStaticPaths;
|
|
19
18
|
|
|
20
19
|
// Get data
|
|
21
|
-
const { collection, data, filePath, filename } = await Page.getData(Astro);
|
|
20
|
+
const { collection, data, filePath, filename, path: relativeSpecPath } = await Page.getData(Astro);
|
|
22
21
|
|
|
23
22
|
const fileName = filename || 'asyncapi.yaml';
|
|
24
23
|
const pathToSpec = getAbsoluteFilePathForAstroFile(filePath, fileName);
|
|
25
24
|
const fileExists = fs.existsSync(pathToSpec);
|
|
25
|
+
const isRemote = relativeSpecPath.includes('https://');
|
|
26
26
|
let content = '';
|
|
27
27
|
|
|
28
|
-
if (fileExists) {
|
|
28
|
+
if (fileExists && !isRemote) {
|
|
29
29
|
content = fs.readFileSync(pathToSpec, 'utf8');
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
if (isRemote) {
|
|
33
|
+
// Fetch the content from the remote path
|
|
34
|
+
content = await fetch(relativeSpecPath).then((res) => res.text());
|
|
35
|
+
}
|
|
36
|
+
|
|
32
37
|
// AsyncAPI parser will parser schemas for users, they can turn this off.
|
|
33
38
|
const parseSchemas = Config?.asyncAPI?.renderParsedSchemas ?? true;
|
|
34
39
|
const parsed = await new Parser({ schemaParsers: [AvroSchemaParser()] }).parse(content, { parseSchemas });
|
|
@@ -15,17 +15,23 @@ export const prerender = Page.prerender;
|
|
|
15
15
|
export const getStaticPaths = Page.getStaticPaths;
|
|
16
16
|
|
|
17
17
|
// Get data
|
|
18
|
-
const { collection, data, filePath, filename } = await Page.getData(Astro);
|
|
18
|
+
const { collection, data, filePath, filename, path: relativeSpecPath } = await Page.getData(Astro);
|
|
19
19
|
|
|
20
20
|
const fileName = filename || 'schema.graphql';
|
|
21
21
|
const pathToSpec = getAbsoluteFilePathForAstroFile(filePath, fileName);
|
|
22
22
|
const fileExists = fs.existsSync(pathToSpec);
|
|
23
|
+
const isRemote = relativeSpecPath.includes('https://');
|
|
23
24
|
let content = '';
|
|
24
25
|
|
|
25
|
-
if (fileExists) {
|
|
26
|
+
if (fileExists && !isRemote) {
|
|
26
27
|
content = fs.readFileSync(pathToSpec, 'utf8');
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
if (isRemote) {
|
|
31
|
+
// Fetch the content from the remote path
|
|
32
|
+
content = await fetch(relativeSpecPath).then((res) => res.text());
|
|
33
|
+
}
|
|
34
|
+
|
|
29
35
|
// Create comprehensive page title
|
|
30
36
|
const pageTitle = `${collection} | ${data.name} | GraphQL Schema`.replace(/^\w/, (c) => c.toUpperCase());
|
|
31
37
|
|
|
@@ -15,11 +15,12 @@ export const getStaticPaths = Page.getStaticPaths;
|
|
|
15
15
|
const props = await Page.getData(Astro);
|
|
16
16
|
|
|
17
17
|
// @ts-ignore
|
|
18
|
-
const { collection, data, catalog, filePath, filename } = props;
|
|
18
|
+
const { collection, data, catalog, filePath, filename, path: relativeSpecPath } = props;
|
|
19
19
|
const fileName = filename || 'openapi.yml';
|
|
20
20
|
|
|
21
21
|
const pathToSpec = getAbsoluteFilePathForAstroFile(filePath, fileName);
|
|
22
22
|
const fileExists = fs.existsSync(pathToSpec);
|
|
23
|
+
const isRemote = relativeSpecPath.includes('https://');
|
|
23
24
|
|
|
24
25
|
let content = '';
|
|
25
26
|
|
|
@@ -35,14 +36,19 @@ const pagefindAttributes =
|
|
|
35
36
|
}
|
|
36
37
|
: {};
|
|
37
38
|
|
|
38
|
-
if (fileExists) {
|
|
39
|
+
if (fileExists && !isRemote) {
|
|
39
40
|
content = fs.readFileSync(pathToSpec, 'utf8');
|
|
40
41
|
}
|
|
42
|
+
|
|
43
|
+
if (isRemote) {
|
|
44
|
+
// Fetch the content from the remote path
|
|
45
|
+
content = await fetch(relativeSpecPath).then((res) => res.text());
|
|
46
|
+
}
|
|
41
47
|
---
|
|
42
48
|
|
|
43
49
|
<VerticalSideBarLayout title={pageTitle}>
|
|
44
50
|
{
|
|
45
|
-
!fileExists ? (
|
|
51
|
+
!fileExists && !isRemote ? (
|
|
46
52
|
<div class="text-center h-screen flex flex-col justify-center ">
|
|
47
53
|
<DocumentMinusIcon className="mx-auto h-12 w-12 text-gray-400" />
|
|
48
54
|
<h3 class="mt-2 text-sm font-semibold text-gray-900">No OpenAPI spec file found</h3>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import config
|
|
1
|
+
// Don't import config here, as it breaks in the client, as path cannot be resolved.
|
|
2
2
|
|
|
3
3
|
const cleanUrl = (url: string) => {
|
|
4
4
|
return url.replace(/\/+/g, '/');
|
|
@@ -62,10 +62,3 @@ export const toMarkdownUrl = (url: string) => {
|
|
|
62
62
|
|
|
63
63
|
return url + '.mdx';
|
|
64
64
|
};
|
|
65
|
-
|
|
66
|
-
export const getBaseURL = () => {
|
|
67
|
-
if (import.meta.env.MODE === 'development') {
|
|
68
|
-
return `http://localhost:${config.port || 3000}`;
|
|
69
|
-
}
|
|
70
|
-
return config.homepageLink || 'https://eventcatalog.dev/';
|
|
71
|
-
};
|