@eventcatalog/core 3.19.1 → 3.19.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.
@@ -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 = "3.19.1";
40
+ var version = "3.19.2";
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-FK7TCLJJ.js";
4
- import "../chunk-NXKN2YAU.js";
3
+ } from "../chunk-GQZQOHQ6.js";
4
+ import "../chunk-ZHTPK6EP.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -111,7 +111,7 @@ var import_axios = __toESM(require("axios"), 1);
111
111
  var import_os = __toESM(require("os"), 1);
112
112
 
113
113
  // package.json
114
- var version = "3.19.1";
114
+ var version = "3.19.2";
115
115
 
116
116
  // src/constants.ts
117
117
  var VERSION = version;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-26A45SNU.js";
4
- import "../chunk-FK7TCLJJ.js";
3
+ } from "../chunk-6IYYCXKO.js";
4
+ import "../chunk-GQZQOHQ6.js";
5
5
  import "../chunk-4UVFXLPI.js";
6
- import "../chunk-NXKN2YAU.js";
6
+ import "../chunk-ZHTPK6EP.js";
7
7
  import "../chunk-5T63CXKU.js";
8
8
  export {
9
9
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-FK7TCLJJ.js";
3
+ } from "./chunk-GQZQOHQ6.js";
4
4
  import {
5
5
  countResources,
6
6
  serializeCounts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-NXKN2YAU.js";
3
+ } from "./chunk-ZHTPK6EP.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-6OQXRJWI.js";
3
+ } from "./chunk-ZKN3CMF6.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "3.19.1";
2
+ var version = "3.19.2";
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-NXKN2YAU.js";
3
+ } from "./chunk-ZHTPK6EP.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "3.19.1";
28
+ var version = "3.19.2";
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-NXKN2YAU.js";
3
+ } from "./chunk-ZHTPK6EP.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -114,7 +114,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
114
114
  var import_picocolors = __toESM(require("picocolors"), 1);
115
115
 
116
116
  // package.json
117
- var version = "3.19.1";
117
+ var version = "3.19.2";
118
118
 
119
119
  // src/constants.ts
120
120
  var VERSION = version;
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-26A45SNU.js";
10
- import "./chunk-FK7TCLJJ.js";
9
+ } from "./chunk-6IYYCXKO.js";
10
+ import "./chunk-GQZQOHQ6.js";
11
11
  import "./chunk-4UVFXLPI.js";
12
12
  import {
13
13
  runMigrations
@@ -22,13 +22,13 @@ import {
22
22
  } from "./chunk-3KXCGYET.js";
23
23
  import {
24
24
  generate
25
- } from "./chunk-XKHNXR3Q.js";
25
+ } from "./chunk-WUBGLZHM.js";
26
26
  import {
27
27
  logger
28
- } from "./chunk-6OQXRJWI.js";
28
+ } from "./chunk-ZKN3CMF6.js";
29
29
  import {
30
30
  VERSION
31
- } from "./chunk-NXKN2YAU.js";
31
+ } from "./chunk-ZHTPK6EP.js";
32
32
  import {
33
33
  getEventCatalogConfigFile,
34
34
  verifyRequiredFieldsAreInCatalogConfigFile
package/dist/generate.cjs CHANGED
@@ -78,7 +78,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
78
78
  var import_picocolors = __toESM(require("picocolors"), 1);
79
79
 
80
80
  // package.json
81
- var version = "3.19.1";
81
+ var version = "3.19.2";
82
82
 
83
83
  // src/constants.ts
84
84
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-XKHNXR3Q.js";
4
- import "./chunk-6OQXRJWI.js";
5
- import "./chunk-NXKN2YAU.js";
3
+ } from "./chunk-WUBGLZHM.js";
4
+ import "./chunk-ZKN3CMF6.js";
5
+ import "./chunk-ZHTPK6EP.js";
6
6
  import "./chunk-5T63CXKU.js";
7
7
  export {
8
8
  generate
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "3.19.1";
39
+ var version = "3.19.2";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "../chunk-6OQXRJWI.js";
4
- import "../chunk-NXKN2YAU.js";
3
+ } from "../chunk-ZKN3CMF6.js";
4
+ import "../chunk-ZHTPK6EP.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -16,7 +16,12 @@ import {
16
16
  import { isVisualiserEnabled } from '@utils/feature';
17
17
  import { pluralizeMessageType } from '@utils/collections/messages';
18
18
 
19
- export const buildServiceNode = (service: CollectionEntry<'services'>, owners: any[], context: ResourceGroupContext): NavNode => {
19
+ export const buildServiceNode = (
20
+ service: CollectionEntry<'services'>,
21
+ owners: any[],
22
+ context: ResourceGroupContext,
23
+ serviceChannels: CollectionEntry<'channels'>[] = []
24
+ ): NavNode => {
20
25
  const sendsMessages = service.data.sends || [];
21
26
  const receivesMessages = service.data.receives || [];
22
27
  const serviceEntities = service.data.entities || [];
@@ -165,6 +170,12 @@ export const buildServiceNode = (service: CollectionEntry<'services'>, owners: a
165
170
  (receive) => `${pluralizeMessageType(receive as any)}:${(receive as any).data.id}:${(receive as any).data.version}`
166
171
  ),
167
172
  },
173
+ serviceChannels.length > 0 && {
174
+ type: 'group',
175
+ title: 'Channels',
176
+ icon: 'ArrowRightLeft',
177
+ pages: serviceChannels.map((channel) => `channel:${(channel as any).data.id}:${(channel as any).data.version}`),
178
+ },
168
179
  hasFlows && {
169
180
  type: 'group',
170
181
  title: 'Flows',
@@ -1,3 +1,5 @@
1
+ import { getCollection } from 'astro:content';
2
+ import type { CollectionEntry } from 'astro:content';
1
3
  import { getContainers } from '@utils/collections/containers';
2
4
  import { getDomains } from '@utils/collections/domains';
3
5
  import { getServices } from '@utils/collections/services';
@@ -20,6 +22,7 @@ import { buildDataProductNode } from './builders/data-product';
20
22
  import config from '@config';
21
23
  import { getDesigns } from '@utils/collections/designs';
22
24
  import { getChannels } from '@utils/collections/channels';
25
+ import { createVersionedMap, findInMap } from '@utils/collections/util';
23
26
  import { buildQuickReferenceSection, buildResourceDocsSection } from './builders/shared';
24
27
 
25
28
  export type { NavigationData, NavNode, ChildRef };
@@ -149,10 +152,47 @@ export const getNestedSideBarData = async (): Promise<NavigationData> => {
149
152
  {} as Record<string, NavNode | string>
150
153
  );
151
154
 
155
+ // Compute channels for each service from raw sends[].to / receives[].from pointers
156
+ const rawServices = await getCollection('services');
157
+ const channelMap = createVersionedMap(channels);
158
+ const serviceChannelsMap = new Map<string, CollectionEntry<'channels'>[]>();
159
+
160
+ for (const service of services) {
161
+ const rawService = rawServices.find((s) => s.data.id === service.data.id && s.data.version === service.data.version);
162
+ if (!rawService) continue;
163
+
164
+ const pointers: Array<{ id: string; version?: string }> = [];
165
+ for (const send of rawService.data.sends ?? []) {
166
+ for (const ch of send.to ?? []) {
167
+ pointers.push({ id: ch.id, version: ch.version });
168
+ }
169
+ }
170
+ for (const receive of rawService.data.receives ?? []) {
171
+ for (const ch of receive.from ?? []) {
172
+ pointers.push({ id: ch.id, version: ch.version });
173
+ }
174
+ }
175
+
176
+ const seen = new Set<string>();
177
+ const resolved: CollectionEntry<'channels'>[] = [];
178
+ for (const pointer of pointers) {
179
+ const key = `${pointer.id}-${pointer.version ?? 'latest'}`;
180
+ if (seen.has(key)) continue;
181
+ seen.add(key);
182
+ const match = findInMap(channelMap, pointer.id, pointer.version);
183
+ if (match) resolved.push(match as CollectionEntry<'channels'>);
184
+ }
185
+
186
+ if (resolved.length > 0) {
187
+ serviceChannelsMap.set(`${service.data.id}:${service.data.version}`, resolved);
188
+ }
189
+ }
190
+
152
191
  const serviceNodes = servicesWithOwners.reduce(
153
192
  (acc, { service, owners }) => {
154
193
  const versionedKey = `service:${service.data.id}:${service.data.version}`;
155
- acc[versionedKey] = buildServiceNode(service, owners, context);
194
+ const serviceChannels = serviceChannelsMap.get(`${service.data.id}:${service.data.version}`) || [];
195
+ acc[versionedKey] = buildServiceNode(service, owners, context, serviceChannels);
156
196
  if (service.data.latestVersion === service.data.version) {
157
197
  // Store reference to versioned key instead of duplicating the full node
158
198
  acc[`service:${service.data.id}`] = versionedKey;
@@ -3,7 +3,14 @@ import type { CollectionEntry } from 'astro:content';
3
3
  import semver from 'semver';
4
4
  import type { CollectionMessageTypes, CollectionTypes } from '@types';
5
5
  import { getDomains, getDomainsForService } from './domains';
6
- import { createVersionedMap, findInMap, versionMatches, processSpecifications } from '@utils/collections/util';
6
+ import {
7
+ createVersionedMap,
8
+ findInMap,
9
+ versionMatches,
10
+ processSpecifications,
11
+ getItemsFromCollectionByIdAndSemverOrLatest,
12
+ } from '@utils/collections/util';
13
+ import { getChannels } from './channels';
7
14
 
8
15
  export type Service = CollectionEntry<'services'>;
9
16
 
@@ -182,6 +189,47 @@ export const getProducersAndConsumersForChannel = async (channel: CollectionEntr
182
189
  consumers: consumers ?? [],
183
190
  };
184
191
  };
192
+ export const getChannelsForService = async (serviceId: string, version?: string): Promise<CollectionEntry<'channels'>[]> => {
193
+ const allServices = await getCollection('services');
194
+ const allChannels = await getChannels({ getAllVersions: true });
195
+
196
+ const matched = getItemsFromCollectionByIdAndSemverOrLatest(allServices, serviceId, version);
197
+ const service = matched[0];
198
+ if (!service) return [];
199
+
200
+ const sends = service.data.sends ?? [];
201
+ const receives = service.data.receives ?? [];
202
+
203
+ const channelPointers: Array<{ id: string; version?: string }> = [];
204
+
205
+ for (const send of sends) {
206
+ for (const channel of send.to ?? []) {
207
+ channelPointers.push({ id: channel.id, version: channel.version });
208
+ }
209
+ }
210
+
211
+ for (const receive of receives) {
212
+ for (const channel of receive.from ?? []) {
213
+ channelPointers.push({ id: channel.id, version: channel.version });
214
+ }
215
+ }
216
+
217
+ const channelMap = createVersionedMap(allChannels);
218
+ const seen = new Set<string>();
219
+ const channels: CollectionEntry<'channels'>[] = [];
220
+
221
+ for (const pointer of channelPointers) {
222
+ const key = `${pointer.id}-${pointer.version ?? 'latest'}`;
223
+ if (seen.has(key)) continue;
224
+ seen.add(key);
225
+
226
+ const match = findInMap(channelMap, pointer.id, pointer.version);
227
+ if (match) channels.push(match as CollectionEntry<'channels'>);
228
+ }
229
+
230
+ return channels;
231
+ };
232
+
185
233
  export const getServicesNotInAnyDomain = async (): Promise<Service[]> => {
186
234
  const services = await getServices({ getAllVersions: false });
187
235
 
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": "3.19.1",
9
+ "version": "3.19.2",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -103,7 +103,7 @@
103
103
  "zod": "^3.25.0",
104
104
  "@eventcatalog/linter": "1.0.8",
105
105
  "@eventcatalog/sdk": "2.15.1",
106
- "@eventcatalog/visualiser": "^3.15.2"
106
+ "@eventcatalog/visualiser": "^3.15.3"
107
107
  },
108
108
  "devDependencies": {
109
109
  "@astrojs/check": "^0.9.6",