@eventcatalog/core 2.39.0 → 2.39.1
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-YFIADR2I.js → chunk-L4LXL56Q.js} +1 -1
- package/dist/{chunk-7TGRVLSE.js → chunk-NM2UM3ZE.js} +1 -1
- package/dist/{chunk-PG6VTEEI.js → chunk-UXUHWEGF.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/components/MDX/NodeGraph/Nodes/Service.tsx +6 -6
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +34 -23
- package/eventcatalog/src/utils/collections/schemas.ts +7 -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-L4LXL56Q.js";
|
|
4
|
+
import "../chunk-NM2UM3ZE.js";
|
|
5
|
+
import "../chunk-UXUHWEGF.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.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,15 +6,15 @@ import {
|
|
|
6
6
|
} from "./chunk-DCLTVJDP.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-L4LXL56Q.js";
|
|
10
|
+
import "./chunk-NM2UM3ZE.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro,
|
|
13
13
|
checkAndConvertMdToMdx
|
|
14
14
|
} from "./chunk-SLEMYHTU.js";
|
|
15
15
|
import {
|
|
16
16
|
VERSION
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UXUHWEGF.js";
|
|
18
18
|
import {
|
|
19
19
|
isBackstagePluginEnabled,
|
|
20
20
|
isEventCatalogScaleEnabled,
|
|
@@ -29,8 +29,8 @@ export default function ServiceNode({ data, sourcePosition, targetPosition }: an
|
|
|
29
29
|
const nodeLabel = label || service?.data?.sidebar?.badge || 'Service';
|
|
30
30
|
const fontSize = nodeLabel.length > 10 ? '7px' : '9px';
|
|
31
31
|
|
|
32
|
-
let asyncApiFiles = Array.isArray(specifications) ? specifications?.filter((spec) => spec.type === 'asyncapi') : [];
|
|
33
|
-
let openApiFiles = Array.isArray(specifications) ? specifications?.filter((spec) => spec.type === 'openapi') : [];
|
|
32
|
+
let asyncApiFiles = Array.isArray(specifications) ? specifications?.filter((spec) => spec.type === 'asyncapi') : ([] as any);
|
|
33
|
+
let openApiFiles = Array.isArray(specifications) ? specifications?.filter((spec) => spec.type === 'openapi') : ([] as any);
|
|
34
34
|
|
|
35
35
|
if (!Array.isArray(specifications) && specifications?.asyncapiPath) {
|
|
36
36
|
asyncApiFiles.push({ path: specifications.asyncapiPath, type: 'asyncapi', name: 'AsyncAPI' });
|
|
@@ -41,13 +41,13 @@ export default function ServiceNode({ data, sourcePosition, targetPosition }: an
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// Add filename on asyncApiFiles and openApiFiles
|
|
44
|
-
asyncApiFiles = asyncApiFiles.map((file) => {
|
|
44
|
+
asyncApiFiles = asyncApiFiles.map((file: any) => {
|
|
45
45
|
return {
|
|
46
46
|
...file,
|
|
47
47
|
filename: file.path.split('/').pop()?.split('.').shift(),
|
|
48
48
|
};
|
|
49
49
|
});
|
|
50
|
-
openApiFiles = openApiFiles.map((file) => {
|
|
50
|
+
openApiFiles = openApiFiles.map((file: any) => {
|
|
51
51
|
return {
|
|
52
52
|
...file,
|
|
53
53
|
filename: file.path.split('/').pop()?.split('.').shift(),
|
|
@@ -120,7 +120,7 @@ export default function ServiceNode({ data, sourcePosition, targetPosition }: an
|
|
|
120
120
|
</ContextMenu.Item>
|
|
121
121
|
<ContextMenu.Separator className="h-[1px] bg-gray-200 m-1" />
|
|
122
122
|
{asyncApiFiles.length > 0 &&
|
|
123
|
-
asyncApiFiles.map((file) => (
|
|
123
|
+
asyncApiFiles.map((file: any) => (
|
|
124
124
|
<ContextMenu.Item asChild key={file.path}>
|
|
125
125
|
<a
|
|
126
126
|
href={buildUrl(`/docs/services/${id}/${version}/asyncapi/${file.filename}`)}
|
|
@@ -133,7 +133,7 @@ export default function ServiceNode({ data, sourcePosition, targetPosition }: an
|
|
|
133
133
|
</ContextMenu.Item>
|
|
134
134
|
))}
|
|
135
135
|
{openApiFiles.length > 0 &&
|
|
136
|
-
openApiFiles.map((file) => (
|
|
136
|
+
openApiFiles.map((file: any) => (
|
|
137
137
|
<ContextMenu.Item asChild key={file.path}>
|
|
138
138
|
<a
|
|
139
139
|
href={buildUrl(`/docs/services/${id}/${version}/spec/${file.filename}`)}
|
|
@@ -8,6 +8,8 @@ import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
|
|
|
8
8
|
import SchemaViewer from '@components/MDX/SchemaViewer/SchemaViewerRoot.astro';
|
|
9
9
|
import Admonition from '@components/MDX/Admonition';
|
|
10
10
|
|
|
11
|
+
import { getSpecificationsForService } from '@utils/collections/services';
|
|
12
|
+
|
|
11
13
|
import { resourceToCollectionMap, collectionToResourceMap } from '@utils/collections/util';
|
|
12
14
|
|
|
13
15
|
// SideBars
|
|
@@ -136,31 +138,40 @@ const getBadge = () => {
|
|
|
136
138
|
|
|
137
139
|
const getSpecificationBadges = () => {
|
|
138
140
|
const badges = [];
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
141
|
+
|
|
142
|
+
const specifications = getSpecificationsForService(props);
|
|
143
|
+
|
|
144
|
+
const asyncapiSpecs = specifications.filter((spec) => spec.type === 'asyncapi');
|
|
145
|
+
const openapiSpecs = specifications.filter((spec) => spec.type === 'openapi');
|
|
146
|
+
|
|
147
|
+
if (openapiSpecs.length > 0) {
|
|
148
|
+
for (const spec of openapiSpecs) {
|
|
149
|
+
badges.push({
|
|
150
|
+
backgroundColor: 'white',
|
|
151
|
+
textColor: 'gray',
|
|
152
|
+
content: spec.name || 'OpenAPI Spec',
|
|
153
|
+
iconURL: buildUrl('/icons/openapi.svg', true),
|
|
154
|
+
class: 'text-black hover:underline',
|
|
155
|
+
id: 'open-api-badge',
|
|
156
|
+
url: buildUrl(`/docs/${props.collection}/${props.data.id}/${props.data.version}/spec/${spec.filenameWithoutExtension}`),
|
|
157
|
+
});
|
|
158
|
+
}
|
|
152
159
|
}
|
|
153
160
|
|
|
154
|
-
if (
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
if (asyncapiSpecs.length > 0) {
|
|
162
|
+
for (const spec of asyncapiSpecs) {
|
|
163
|
+
badges.push({
|
|
164
|
+
backgroundColor: 'white',
|
|
165
|
+
textColor: 'gray',
|
|
166
|
+
content: spec.name || 'AsyncAPI Spec',
|
|
167
|
+
iconURL: buildUrl('/icons/asyncapi.svg', true),
|
|
168
|
+
class: 'text-black hover:underline',
|
|
169
|
+
id: 'asyncapi-badge',
|
|
170
|
+
url: buildUrl(
|
|
171
|
+
`/docs/${props.collection}/${props.data.id}/${props.data.version}/asyncapi/${spec.filenameWithoutExtension}`
|
|
172
|
+
),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
164
175
|
}
|
|
165
176
|
|
|
166
177
|
return badges;
|
|
@@ -35,8 +35,13 @@ export const getSchemasFromResource = (resource: CollectionEntry<PageTypes>): Sc
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
if (resource.collection === 'services') {
|
|
38
|
-
const
|
|
39
|
-
const
|
|
38
|
+
const specifications = resource?.data?.specifications;
|
|
39
|
+
const asyncapiPath = Array.isArray(specifications)
|
|
40
|
+
? specifications.find((spec) => spec.type === 'asyncapi')?.path
|
|
41
|
+
: specifications?.asyncapiPath;
|
|
42
|
+
const openapiPath = Array.isArray(specifications)
|
|
43
|
+
? specifications.find((spec) => spec.type === 'openapi')?.path
|
|
44
|
+
: specifications?.openapiPath;
|
|
40
45
|
// @ts-ignore
|
|
41
46
|
const publicPath = resource?.catalog?.publicPath;
|
|
42
47
|
const schemas = [];
|