@eventcatalog/core 2.42.0 → 2.42.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.42.0";
40
+ var version = "2.42.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-BYWZ6BFW.js";
4
- import "../chunk-M5NGWRPO.js";
3
+ } from "../chunk-V4HWGD4W.js";
4
+ import "../chunk-TRONGJTE.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.42.0";
109
+ var version = "2.42.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-6XRQ4VOZ.js";
4
- import "../chunk-BYWZ6BFW.js";
5
- import "../chunk-M5NGWRPO.js";
3
+ } from "../chunk-BMQTJBZQ.js";
4
+ import "../chunk-V4HWGD4W.js";
5
+ import "../chunk-TRONGJTE.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-BYWZ6BFW.js";
3
+ } from "./chunk-V4HWGD4W.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.42.0";
2
+ var version = "2.42.1";
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-M5NGWRPO.js";
3
+ } from "./chunk-TRONGJTE.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.42.0";
28
+ var version = "2.42.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-M5NGWRPO.js";
3
+ } from "./chunk-TRONGJTE.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.42.0";
160
+ var version = "2.42.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-6XRQ4VOZ.js";
10
- import "./chunk-BYWZ6BFW.js";
9
+ } from "./chunk-BMQTJBZQ.js";
10
+ import "./chunk-V4HWGD4W.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-M5NGWRPO.js";
17
+ } from "./chunk-TRONGJTE.js";
18
18
  import {
19
19
  isBackstagePluginEnabled,
20
20
  isEventCatalogScaleEnabled,
@@ -8,7 +8,7 @@ import { buildUrl } from '@utils/url-builder';
8
8
  import { ScrollText } from 'lucide-react';
9
9
  import RepositoryList from '@components/Lists/RepositoryList.astro';
10
10
  import { getOwner } from '@utils/collections/owners';
11
-
11
+ import { getProducersAndConsumersForChannel } from '@utils/collections/services';
12
12
  interface Props {
13
13
  channel: CollectionEntry<'channels'>;
14
14
  }
@@ -18,6 +18,7 @@ const { channel } = Astro.props;
18
18
  const ownersRaw = channel.data?.owners || [];
19
19
  const owners = await Promise.all<ReturnType<typeof getOwner>>(ownersRaw.map(getOwner));
20
20
  const filteredOwners = owners.filter((o) => o !== undefined);
21
+ const { producers, consumers } = await getProducersAndConsumersForChannel(channel);
21
22
 
22
23
  const channelParameters: Record<string, { enum?: string[]; description?: string }> = channel.data.parameters || {};
23
24
  const parameters = Object.keys(channelParameters).map((key) => ({
@@ -55,10 +56,52 @@ const messageList = (channel.data.messages ?? []).map((p) => ({
55
56
  tag: `v${p.version}`,
56
57
  href: buildUrl(`/docs/${p.collection}/${p.id}/${p.version}`),
57
58
  }));
59
+
60
+ const producersList = producers.map((p) => ({
61
+ label: p.data.name,
62
+ badge: p.collection,
63
+ color: 'pink',
64
+ collection: p.collection,
65
+ tag: `v${p.data.version}`,
66
+ href: buildUrl(`/docs/${p.collection}/${p.data.id}/${p.data.version}`),
67
+ }));
68
+
69
+ const consumersList = consumers.map((c) => ({
70
+ label: c.data.name,
71
+ badge: c.collection,
72
+ color: 'blue',
73
+ collection: c.collection,
74
+ tag: `v${c.data.version}`,
75
+ href: buildUrl(`/docs/${c.collection}/${c.data.id}/${c.data.version}`),
76
+ }));
58
77
  ---
59
78
 
60
79
  <aside class="sticky top-28 left-0 space-y-8 h-full overflow-y-auto py-4">
61
80
  <div class="">
81
+ {
82
+ producersList.length > 0 && (
83
+ <PillListFlat
84
+ title={`Producers (${producersList.length})`}
85
+ pills={producersList}
86
+ emptyMessage={`This channel does not have any producers.`}
87
+ color="pink"
88
+ client:load
89
+ />
90
+ )
91
+ }
92
+
93
+ {
94
+ consumersList.length > 0 && (
95
+ <PillListFlat
96
+ title={`Consumers (${consumersList.length})`}
97
+ pills={consumersList}
98
+ emptyMessage={`This channel does not have any consumers.`}
99
+ color="blue"
100
+ client:load
101
+ />
102
+ )
103
+ }
104
+
62
105
  {
63
106
  messageList.length > 0 && (
64
107
  <PillListFlat
@@ -157,3 +157,30 @@ export const getSpecificationsForService = (service: CollectionEntry<CollectionT
157
157
  filenameWithoutExtension: path.basename(spec.path, path.extname(spec.path)),
158
158
  }));
159
159
  };
160
+
161
+ // Get services for channel
162
+ export const getProducersAndConsumersForChannel = async (channel: CollectionEntry<'channels'>) => {
163
+ const messages = channel.data.messages ?? [];
164
+ const services = await getServices({ getAllVersions: false });
165
+
166
+ const producers = services.filter((service) => {
167
+ const sends = service.data.sends ?? [];
168
+ return sends.some((send) => {
169
+ // @ts-ignore
170
+ return messages.some((m) => m.id === send.data.id);
171
+ });
172
+ });
173
+
174
+ const consumers = services.filter((service) => {
175
+ const receives = service.data.receives ?? [];
176
+ return receives.some((receive) => {
177
+ // @ts-ignore
178
+ return messages.some((m) => m.id === receive.data.id);
179
+ });
180
+ });
181
+
182
+ return {
183
+ producers: producers ?? [],
184
+ consumers: consumers ?? [],
185
+ };
186
+ };
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.42.0",
9
+ "version": "2.42.1",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },