@eventcatalog/core 2.37.2 → 2.37.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.
@@ -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.37.2";
40
+ var version = "2.37.3";
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-7J7J25A5.js";
4
- import "../chunk-BXWTM2JX.js";
3
+ } from "../chunk-RXERG5SL.js";
4
+ import "../chunk-KC74WARE.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.37.2";
109
+ var version = "2.37.3";
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-ARZJXJW7.js";
4
- import "../chunk-7J7J25A5.js";
5
- import "../chunk-BXWTM2JX.js";
3
+ } from "../chunk-JCZFOKW3.js";
4
+ import "../chunk-RXERG5SL.js";
5
+ import "../chunk-KC74WARE.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-7J7J25A5.js";
3
+ } from "./chunk-RXERG5SL.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.37.2";
2
+ var version = "2.37.3";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-BXWTM2JX.js";
3
+ } from "./chunk-KC74WARE.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.37.2";
28
+ var version = "2.37.3";
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-BXWTM2JX.js";
3
+ } from "./chunk-KC74WARE.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.37.2";
160
+ var version = "2.37.3";
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-ARZJXJW7.js";
10
- import "./chunk-7J7J25A5.js";
9
+ } from "./chunk-JCZFOKW3.js";
10
+ import "./chunk-RXERG5SL.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-BXWTM2JX.js";
17
+ } from "./chunk-KC74WARE.js";
18
18
  import {
19
19
  isBackstagePluginEnabled,
20
20
  isEventCatalogScaleEnabled,
@@ -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 { resourceToCollectionMap, collectionToResourceMap } from '@utils/collections/util';
12
+
11
13
  // SideBars
12
14
  import ServiceSideBar from '@components/SideBars/ServiceSideBar.astro';
13
15
  import MessageSideBar from '@components/SideBars/MessageSideBar.astro';
@@ -41,6 +43,8 @@ import { buildUrl } from '@utils/url-builder';
41
43
  import { getSchemasFromResource } from '@utils/collections/schemas';
42
44
  import { isEventCatalogChatEnabled, isMarkdownDownloadEnabled } from '@utils/feature';
43
45
 
46
+ import { getMDXComponentsByName } from '@utils/markdown';
47
+
44
48
  import config from '@config';
45
49
 
46
50
  export async function getStaticPaths() {
@@ -65,6 +69,7 @@ export async function getStaticPaths() {
65
69
  const props = Astro.props;
66
70
 
67
71
  const { Content } = await render(props);
72
+
68
73
  // const { Content } = await props.render();
69
74
 
70
75
  // Capitalize the first letter of a string
@@ -189,6 +194,15 @@ const generatePromptForResource = (props: any) => {
189
194
  Please tell me more about the ${props.collection.slice(0, props.collection.length - 1)} - ${props.data.name} v${props.data.version} in this catalog.
190
195
  `;
191
196
  };
197
+
198
+ // Handle node graphs in the markdown
199
+ let nodeGraphs = getMDXComponentsByName(props.body || '', 'NodeGraph') || [];
200
+
201
+ nodeGraphs.push({
202
+ id: props.data.id,
203
+ version: props.data.version,
204
+ type: collectionToResourceMap[props.collection as keyof typeof collectionToResourceMap],
205
+ });
192
206
  ---
193
207
 
194
208
  <VerticalSideBarLayout title={pageTitle} description={props.data.summary}>
@@ -319,17 +333,27 @@ const generatePromptForResource = (props: any) => {
319
333
  <!-- @ts-ignore -->
320
334
  <!-- <SchemaViewer id={props.data.id} catalog={props.catalog} filePath={props.filePath} /> -->
321
335
  <SchemaViewer id={props.data.id} filePath={props.filePath} />
322
- <NodeGraph
323
- id={props.data.id}
324
- collection={props.collection}
325
- version={props.data.version}
326
- mode="simple"
327
- linksToVisualiser={true}
328
- href={{
329
- label: 'Open in Visualiser',
330
- url: buildUrl(`/visualiser/${props.collection}/${props.data.id}/${props.data.version}`),
331
- }}
332
- />
336
+
337
+ {
338
+ nodeGraphs.length > 0 &&
339
+ nodeGraphs.map((nodeGraph: any) => {
340
+ const collection = resourceToCollectionMap[nodeGraph.type as keyof typeof resourceToCollectionMap];
341
+ return (
342
+ <NodeGraph
343
+ id={nodeGraph.id}
344
+ version={nodeGraph.version}
345
+ collection={collection}
346
+ title={nodeGraph.title}
347
+ mode="simple"
348
+ linksToVisualiser={true}
349
+ href={{
350
+ label: 'Open in Visualiser',
351
+ url: buildUrl(`/visualiser/${collection}/${nodeGraph.id}/${nodeGraph.version}`),
352
+ }}
353
+ />
354
+ );
355
+ })
356
+ }
333
357
  </div>
334
358
  <Footer />
335
359
  </div>
@@ -110,6 +110,18 @@ export const resourceToCollectionMap = {
110
110
  team: 'teams',
111
111
  } as const;
112
112
 
113
+ export const collectionToResourceMap = {
114
+ services: 'service',
115
+ events: 'event',
116
+ commands: 'command',
117
+ queries: 'query',
118
+ domains: 'domain',
119
+ flows: 'flow',
120
+ channels: 'channel',
121
+ users: 'user',
122
+ teams: 'team',
123
+ } as const;
124
+
113
125
  export const getDeprecatedDetails = (item: CollectionEntry<CollectionTypes>) => {
114
126
  let options = {
115
127
  isMarkedAsDeprecated: false,
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.37.2",
9
+ "version": "2.37.3",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },