@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.
@@ -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 = "2.39.0";
40
+ var version = "2.39.1";
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-7TGRVLSE.js";
4
- import "../chunk-PG6VTEEI.js";
3
+ } from "../chunk-NM2UM3ZE.js";
4
+ import "../chunk-UXUHWEGF.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 = "2.39.0";
109
+ var version = "2.39.1";
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-YFIADR2I.js";
4
- import "../chunk-7TGRVLSE.js";
5
- import "../chunk-PG6VTEEI.js";
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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-7TGRVLSE.js";
3
+ } from "./chunk-NM2UM3ZE.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-PG6VTEEI.js";
3
+ } from "./chunk-UXUHWEGF.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.39.0";
2
+ var version = "2.39.1";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.39.0";
28
+ var version = "2.39.1";
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-PG6VTEEI.js";
3
+ } from "./chunk-UXUHWEGF.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -157,7 +157,7 @@ var import_axios = __toESM(require("axios"), 1);
157
157
  var import_os = __toESM(require("os"), 1);
158
158
 
159
159
  // package.json
160
- var version = "2.39.0";
160
+ var version = "2.39.1";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -6,15 +6,15 @@ import {
6
6
  } from "./chunk-DCLTVJDP.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-YFIADR2I.js";
10
- import "./chunk-7TGRVLSE.js";
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-PG6VTEEI.js";
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
- const hasOpenAPISpec = !!props.data.specifications?.openapiPath;
140
- const hasAsyncAPISpec = !!props.data.specifications?.asyncapiPath;
141
-
142
- if (hasOpenAPISpec) {
143
- badges.push({
144
- backgroundColor: 'white',
145
- textColor: 'gray',
146
- content: 'OpenAPI Spec',
147
- iconURL: buildUrl('/icons/openapi.svg', true),
148
- class: 'text-black hover:underline',
149
- id: 'open-api-badge',
150
- url: buildUrl(`/docs/${props.collection}/${props.data.id}/${props.data.version}/spec`),
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 (hasAsyncAPISpec) {
155
- badges.push({
156
- backgroundColor: 'white',
157
- textColor: 'gray',
158
- content: 'AsyncAPI Spec',
159
- iconURL: buildUrl('/icons/asyncapi.svg', true),
160
- class: 'text-black hover:underline',
161
- id: 'asyncapi-badge',
162
- url: buildUrl(`/docs/${props.collection}/${props.data.id}/${props.data.version}/asyncapi`),
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 asyncapiPath = resource?.data?.specifications?.asyncapiPath;
39
- const openapiPath = resource?.data?.specifications?.openapiPath;
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 = [];
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": "2.39.0",
9
+ "version": "2.39.1",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },