@eventcatalog/core 2.61.1 → 2.61.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/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-BYJ6RQTT.js} +1 -1
- package/dist/{chunk-CMVDQ42N.js → chunk-PN45L4LR.js} +1 -1
- package/dist/{chunk-MDWG55PH.js → chunk-RQJ7FPSK.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/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/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-RQJ7FPSK.js";
|
|
4
|
+
import "../chunk-BYJ6RQTT.js";
|
|
5
|
+
import "../chunk-PN45L4LR.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-RQJ7FPSK.js";
|
|
10
|
+
import "./chunk-BYJ6RQTT.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-PN45L4LR.js";
|
|
19
19
|
import {
|
|
20
20
|
getProjectOutDir,
|
|
21
21
|
isAuthEnabled,
|
|
@@ -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>
|