@eventcatalog/core 4.1.4 → 4.2.0

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.
Files changed (44) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/{chunk-RAB6LGHN.js → chunk-47LY7DY2.js} +1 -1
  6. package/dist/{chunk-TCK7WEEE.js → chunk-4FWALA6J.js} +1 -1
  7. package/dist/{chunk-CAYWT7E4.js → chunk-J7T5HUHY.js} +1 -1
  8. package/dist/{chunk-B3HQOT3D.js → chunk-KPDU47YJ.js} +1 -1
  9. package/dist/{chunk-ZLQUICJD.js → chunk-QKPPJU43.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/eventcatalog.cjs +1 -1
  13. package/dist/eventcatalog.js +5 -5
  14. package/dist/generate.cjs +1 -1
  15. package/dist/generate.js +3 -3
  16. package/dist/utils/cli-logger.cjs +1 -1
  17. package/dist/utils/cli-logger.js +2 -2
  18. package/eventcatalog/public/android-chrome-192x192.png +0 -0
  19. package/eventcatalog/public/android-chrome-512x512.png +0 -0
  20. package/eventcatalog/public/apple-touch-icon.png +0 -0
  21. package/eventcatalog/public/favicon-16x16.png +0 -0
  22. package/eventcatalog/public/favicon-32x32.png +0 -0
  23. package/eventcatalog/public/favicon-48x48.png +0 -0
  24. package/eventcatalog/public/favicon-96x96.png +0 -0
  25. package/eventcatalog/public/favicon.ico +0 -0
  26. package/eventcatalog/public/favicon.svg +8 -0
  27. package/eventcatalog/src/components/Lineage/LineageScenarioSwitcher.tsx +65 -0
  28. package/eventcatalog/src/components/Seo.astro +5 -1
  29. package/eventcatalog/src/content.config.ts +9 -0
  30. package/eventcatalog/src/enterprise/auth/error.astro +3 -1
  31. package/eventcatalog/src/enterprise/auth/login.astro +3 -1
  32. package/eventcatalog/src/pages/studio.astro +3 -1
  33. package/eventcatalog/src/pages/triggers/[type]/[id]/[version]/_index.data.ts +66 -0
  34. package/eventcatalog/src/pages/triggers/[type]/[id]/[version]/index.astro +201 -0
  35. package/eventcatalog/src/stores/sidebar-store/builders/message.ts +31 -1
  36. package/eventcatalog/src/stores/sidebar-store/state.ts +22 -4
  37. package/eventcatalog/src/utils/collections/commands.ts +1 -1
  38. package/eventcatalog/src/utils/collections/message-triggers.ts +118 -0
  39. package/eventcatalog/src/utils/node-graphs/container-node-graph.ts +2 -1
  40. package/eventcatalog/src/utils/node-graphs/message-lineage.ts +131 -0
  41. package/eventcatalog/src/utils/node-graphs/message-node-graph.ts +119 -1
  42. package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +15 -1
  43. package/eventcatalog/src/utils/node-graphs/utils/utils.ts +14 -4
  44. package/package.json +4 -4
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(analytics_exports);
36
36
  var import_os = __toESM(require("os"), 1);
37
37
 
38
38
  // package.json
39
- var version = "4.1.4";
39
+ var version = "4.2.0";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-CAYWT7E4.js";
4
- import "../chunk-TCK7WEEE.js";
3
+ } from "../chunk-J7T5HUHY.js";
4
+ import "../chunk-4FWALA6J.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -140,7 +140,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
140
140
  var import_os = __toESM(require("os"), 1);
141
141
 
142
142
  // package.json
143
- var version = "4.1.4";
143
+ var version = "4.2.0";
144
144
 
145
145
  // src/constants.ts
146
146
  var VERSION = version;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-RAB6LGHN.js";
4
- import "../chunk-CAYWT7E4.js";
3
+ } from "../chunk-47LY7DY2.js";
4
+ import "../chunk-J7T5HUHY.js";
5
5
  import "../chunk-K2XIENVT.js";
6
- import "../chunk-TCK7WEEE.js";
6
+ import "../chunk-4FWALA6J.js";
7
7
  import "../chunk-6QENHZZP.js";
8
8
  export {
9
9
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-CAYWT7E4.js";
3
+ } from "./chunk-J7T5HUHY.js";
4
4
  import {
5
5
  countResources,
6
6
  serializeCounts
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "4.1.4";
2
+ var version = "4.2.0";
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-TCK7WEEE.js";
3
+ } from "./chunk-4FWALA6J.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import os from "os";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-TCK7WEEE.js";
3
+ } from "./chunk-4FWALA6J.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-B3HQOT3D.js";
3
+ } from "./chunk-KPDU47YJ.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "4.1.4";
28
+ var version = "4.2.0";
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-TCK7WEEE.js";
3
+ } from "./chunk-4FWALA6J.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -144,7 +144,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
144
144
  var import_picocolors = __toESM(require("picocolors"), 1);
145
145
 
146
146
  // package.json
147
- var version = "4.1.4";
147
+ var version = "4.2.0";
148
148
 
149
149
  // src/constants.ts
150
150
  var VERSION = version;
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  log_build_default
3
- } from "./chunk-RAB6LGHN.js";
3
+ } from "./chunk-47LY7DY2.js";
4
4
  import {
5
5
  runMigrations
6
6
  } from "./chunk-XUAF2H54.js";
7
7
  import "./chunk-CA4U2JP7.js";
8
8
  import {
9
9
  generate
10
- } from "./chunk-ZLQUICJD.js";
10
+ } from "./chunk-QKPPJU43.js";
11
11
  import {
12
12
  logger
13
- } from "./chunk-B3HQOT3D.js";
13
+ } from "./chunk-KPDU47YJ.js";
14
14
  import {
15
15
  resolve_catalog_dependencies_default
16
16
  } from "./chunk-LHR4G2UO.js";
@@ -20,7 +20,7 @@ import {
20
20
  import {
21
21
  watch
22
22
  } from "./chunk-CAJUIMDJ.js";
23
- import "./chunk-CAYWT7E4.js";
23
+ import "./chunk-J7T5HUHY.js";
24
24
  import "./chunk-K2XIENVT.js";
25
25
  import {
26
26
  catalogToAstro
@@ -28,7 +28,7 @@ import {
28
28
  import "./chunk-W5JQON7Z.js";
29
29
  import {
30
30
  VERSION
31
- } from "./chunk-TCK7WEEE.js";
31
+ } from "./chunk-4FWALA6J.js";
32
32
  import {
33
33
  linkCoreNodeModules,
34
34
  resolveInstalledCoreNodeModules
package/dist/generate.cjs CHANGED
@@ -108,7 +108,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
108
108
  var import_picocolors = __toESM(require("picocolors"), 1);
109
109
 
110
110
  // package.json
111
- var version = "4.1.4";
111
+ var version = "4.2.0";
112
112
 
113
113
  // src/constants.ts
114
114
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-ZLQUICJD.js";
4
- import "./chunk-B3HQOT3D.js";
5
- import "./chunk-TCK7WEEE.js";
3
+ } from "./chunk-QKPPJU43.js";
4
+ import "./chunk-KPDU47YJ.js";
5
+ import "./chunk-4FWALA6J.js";
6
6
  import "./chunk-6QENHZZP.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 = "4.1.4";
39
+ var version = "4.2.0";
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-B3HQOT3D.js";
4
- import "../chunk-TCK7WEEE.js";
3
+ } from "../chunk-KPDU47YJ.js";
4
+ import "../chunk-4FWALA6J.js";
5
5
  export {
6
6
  logger
7
7
  };
Binary file
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="58 54 1133 1133" role="img" aria-labelledby="t">
2
+ <title id="t">Reading cat logo</title>
3
+ <style>
4
+ path { fill: #000; }
5
+ @media (prefers-color-scheme: dark) { path { fill: #fff; } }
6
+ </style>
7
+ <path fill-rule="evenodd" d="M 445 55 c -174.6 0.5 -188.1 0.7 -196.5 2.3 -20.7 4.1 -35.3 8.5 -51 15.3 -66.7 28.8 -114.7 86.9 -130.3 157.9 l -2.6 12 -0.4 371 c -0.2 261 0 373.8 0.8 380.5 4.6 40.7 21.8 79.6 49.8 113 36.8 43.9 89.5 72.4 144.2 77.9 5.9 0.6 148.2 1.1 372.5 1.3 345.2 0.3 363.5 0.2 373 -1.5 32.1 -5.7 58.7 -16.4 85.5 -34.2 53.2 -35.3 89.1 -93.6 96 -156 0.8 -7.2 1 -114.8 0.8 -381.5 l -0.3 -371.5 -2.2 -10.4 c -7.7 -35.9 -18.8 -61.1 -38.9 -88.2 -9.5 -12.8 -30.7 -34.1 -43.4 -43.5 -34.4 -25.6 -73.7 -40.9 -113.5 -44.3 -12.5 -1.1 -182.7 -1.1 -543.5 -0.1 z m -26.3 152.5 c 30.7 11.6 86.7 67 122.9 121.6 l 8.4 12.6 9.7 -2.3 c 13.3 -3.3 30.3 -6.1 44.8 -7.5 15.1 -1.5 51.8 -0.6 67.5 1.6 10.1 1.4 37.1 6.8 40.5 8.1 0.7 0.3 3.6 -3.4 7.1 -8.8 18.3 -29.1 37.9 -53.5 64.7 -80.7 31.8 -32.2 53.3 -47 68.5 -47.1 10.5 -0 16.2 4.1 22.3 16.1 11.6 23 17.3 80.8 15 153.1 l -1 33.7 6 14.7 c 3.2 8 7.8 20.4 10 27.5 2.3 7.1 4.5 12.9 4.9 12.9 0.4 -0 5 -1.5 10.1 -3.4 29.8 -10.8 61.4 -20.5 89.6 -27.5 20 -5.1 21.5 -5.1 25.9 -0.7 2.9 2.9 3.4 4.1 3.4 7.9 0 3.4 -0.6 5.3 -2.5 7.5 -2.9 3.5 -4.7 4.3 -18 7.7 -23.9 6.3 -83.7 25.2 -103 32.5 -2 0.8 -2 1.2 -1 10.6 0.5 5.3 1.5 9.9 2 10 0.6 0.2 16.8 2.4 36 4.9 69.6 9.1 85.9 11.5 89.4 13.3 10.1 5.1 7.6 20.4 -3.6 21.9 -3.7 0.5 -26.4 -2.1 -63.3 -7.2 -18.4 -2.6 -56.7 -7.5 -58 -7.5 -0.4 -0 -1 0.8 -1.2 1.8 -0.4 1.4 -2.9 2.3 -11.4 4.1 -50.2 10.3 -130.1 33.1 -167.9 47.8 -35.1 13.6 -69.4 33.4 -96.1 55.6 -6.6 5.4 -10.1 7.7 -10.9 7.1 -0.7 -0.5 -5.8 -4.6 -11.5 -9.2 -25 -20.2 -55.1 -37.5 -88.5 -50.7 -39.3 -15.6 -111.9 -36.5 -170.7 -49.1 -15.1 -3.2 -17.8 -4.1 -17.8 -5.6 0 -2.4 0.4 -2.4 -35 2.2 -16.8 2.2 -42.6 5.7 -57.5 7.6 -14.8 2 -28.8 3.3 -31 3 -5.9 -0.7 -9.5 -5.1 -9.5 -11.5 0 -5.7 2.4 -9.4 7.3 -11 3.2 -1.1 62.2 -9.4 103.2 -14.6 11.6 -1.5 21.3 -3 21.7 -3.3 0.3 -0.4 0.9 -5 1.3 -10.3 l 0.7 -9.6 -30.3 -10.1 c -24.9 -8.3 -73.2 -22.8 -85.2 -25.6 -1.5 -0.4 -4.1 -1.9 -5.8 -3.4 -2.6 -2.3 -3.3 -3.8 -3.7 -8 -0.4 -4.7 -0.2 -5.4 2.5 -8.1 1.7 -1.6 4.3 -3.3 5.8 -3.7 5.8 -1.4 46 9.3 88.5 23.7 16.2 5.5 30.3 10.3 31.2 10.6 1 0.3 2 -0.1 2.2 -0.8 4.6 -14.9 9 -27.2 14 -39.4 l 6.2 -15 -1 -32.5 c -1.5 -48.5 0.9 -93.8 6.4 -122.4 5 -25.8 12 -40.4 21.9 -45.6 5.4 -2.9 15.3 -2.6 23.8 0.5 z m -67.6 364.4 c 81.9 16.7 161.5 40.4 199.3 59.3 11.7 5.9 29.8 16.7 34.1 20.3 l 3 2.6 -9.5 -0.4 c -8.7 -0.4 -15.5 -2.1 -78.5 -19.7 -37.9 -10.6 -76 -21.2 -84.5 -23.5 -56.6 -15.7 -123.4 -34.6 -123.8 -35 -0.6 -0.6 13.5 -2.8 37.3 -5.8 6.4 -0.8 8.6 -0.6 22.6 2.2 z m 589.5 -0.4 c 10.4 1.4 20.4 2.8 22.3 3.2 3.4 0.6 -40.5 13.5 -170.9 50.2 -20.1 5.7 -42.6 12 -50 14.1 -50.1 14.2 -53.5 15 -60.8 15 -4 -0 -7.2 -0.3 -7.2 -0.8 0 -2.1 28.9 -19.2 45.8 -27.1 36.1 -16.7 110.6 -38.3 193.2 -55.9 6.6 -1.4 7.1 -1.4 27.6 1.3 z m -672.2 33.1 c 13.2 3.6 31.1 8.5 39.6 10.9 8.5 2.4 35.3 9.8 59.5 16.4 52.5 14.3 120.5 33 167.5 46.1 22.9 6.3 23.5 6.6 24.9 9.6 0.8 1.8 1.1 45.6 1.1 162.2 0 175.7 0.4 164.2 -5.9 164.2 -1.5 -0 -12.4 -2.7 -24.2 -6.1 -20.6 -5.8 -66.3 -18.6 -188.9 -52.7 -31.6 -8.8 -63.1 -17.5 -70 -19.2 -13 -3.3 -16.3 -4.8 -17.9 -7.8 -1.1 -2.1 -7.2 -104.7 -15.6 -262.7 -1.3 -25.9 -2.7 -50.5 -3.1 -54.7 -0.6 -7.3 -0.5 -7.8 2 -10.2 1.4 -1.5 3.5 -2.6 4.7 -2.6 1.2 -0 13 3 26.3 6.6 z m 748.1 -5.6 c 3.9 1.5 4.4 4.2 3.4 19.5 -0.8 12.4 -4.2 70.9 -15 256 -2.6 46 -3.3 53.3 -4.8 55.5 -1.9 2.6 1.3 1.6 -78.6 23.9 -9.9 2.8 -34.2 9.6 -54 15.1 -19.8 5.6 -50.4 14.1 -68 19 -17.6 4.9 -45.7 12.8 -62.5 17.5 -16.7 4.7 -31.7 8.5 -33.2 8.5 -6.3 -0 -5.9 11.3 -5.6 -165.1 0.2 -88.2 0.7 -161.2 1.2 -162.1 0.9 -1.9 4.6 -3.1 32.6 -10.7 10.2 -2.8 25.9 -7.1 35 -9.6 9.1 -2.5 32 -8.9 51 -14.1 47.4 -13.1 124.2 -34.5 168.5 -46.9 14.3 -4 26.3 -7.4 26.7 -7.4 0.4 -0.1 1.8 0.3 3.3 0.9 z m -351.7 95.3 c 0.9 0.7 1.2 35.1 1.2 166.7 l 0 165.9 -2.2 1.3 c -1.8 1 -10.2 1.3 -35.1 1.3 -31.4 -0 -32.9 -0.1 -34.3 -1.9 -2.1 -2.9 -2.1 -330.7 0 -332.8 1.1 -1.2 7.6 -1.4 35.2 -1.4 18.7 0.1 34.5 0.5 35.2 0.9 z"/>
8
+ </svg>
@@ -0,0 +1,65 @@
1
+ import { CheckIcon, ChevronDownIcon } from '@heroicons/react/20/solid';
2
+ import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
3
+ import { useState } from 'react';
4
+
5
+ interface Props {
6
+ conditions: string[];
7
+ }
8
+
9
+ export default function LineageScenarioSwitcher({ conditions }: Props) {
10
+ const [selectedIndex, setSelectedIndex] = useState(0);
11
+ const selectedCondition = conditions[selectedIndex];
12
+
13
+ return (
14
+ <DropdownMenu.Root>
15
+ <DropdownMenu.Trigger asChild>
16
+ <button
17
+ type="button"
18
+ className="group inline-flex max-w-full items-center gap-1.5 rounded-md border border-[rgb(var(--ec-dropdown-border)/0.8)] bg-[rgb(var(--ec-dropdown-bg))] px-2 py-1 align-middle text-sm font-semibold text-[rgb(var(--ec-page-text))] shadow-sm transition-colors hover:border-[rgb(var(--ec-accent)/0.5)] hover:bg-[rgb(var(--ec-dropdown-hover))] focus:outline-hidden focus:ring-2 focus:ring-[rgb(var(--ec-accent)/0.3)]"
19
+ aria-label={`Select scenario. Scenario ${selectedIndex + 1} of ${conditions.length}: ${selectedCondition}`}
20
+ >
21
+ <span className="min-w-0 max-w-xl truncate">{selectedCondition}</span>
22
+ <span className="shrink-0 rounded bg-[rgb(var(--ec-accent-subtle))] px-1.5 py-0.5 text-[10px] font-semibold tabular-nums text-[rgb(var(--ec-accent-text))]">
23
+ {selectedIndex + 1}/{conditions.length}
24
+ </span>
25
+ <ChevronDownIcon className="h-3.5 w-3.5 shrink-0 text-[rgb(var(--ec-page-text-muted))] transition-transform group-data-[state=open]:rotate-180" />
26
+ </button>
27
+ </DropdownMenu.Trigger>
28
+
29
+ <DropdownMenu.Portal>
30
+ <DropdownMenu.Content
31
+ align="start"
32
+ sideOffset={6}
33
+ collisionPadding={12}
34
+ className="z-[1000] max-h-80 w-[min(36rem,calc(100vw-1.5rem))] overflow-y-auto rounded-xl border border-[rgb(var(--ec-dropdown-border)/0.8)] bg-[rgb(var(--ec-dropdown-bg))] p-1.5 shadow-[0_20px_56px_rgb(0_0_0/0.22)]"
35
+ >
36
+ <div className="px-2.5 pb-2 pt-1.5">
37
+ <p className="text-xs font-semibold text-[rgb(var(--ec-dropdown-text))]">Choose a scenario</p>
38
+ <p className="pt-0.5 text-[11px] font-normal text-[rgb(var(--ec-page-text-muted))]">
39
+ This message path is shared by {conditions.length} conditions.
40
+ </p>
41
+ </div>
42
+ <DropdownMenu.Separator className="mb-1 h-px bg-[rgb(var(--ec-dropdown-border)/0.7)]" />
43
+ <DropdownMenu.RadioGroup value={String(selectedIndex)} onValueChange={(value) => setSelectedIndex(Number(value))}>
44
+ {conditions.map((condition, index) => (
45
+ <DropdownMenu.RadioItem
46
+ key={`${condition}-${index}`}
47
+ value={String(index)}
48
+ className="relative flex cursor-pointer select-none items-start gap-2.5 rounded-lg px-2.5 py-2 pr-9 text-sm font-normal leading-5 text-[rgb(var(--ec-dropdown-text))] outline-hidden transition-colors data-[highlighted]:bg-[rgb(var(--ec-dropdown-hover))]"
49
+ >
50
+ <span className="mt-0.5 flex h-5 min-w-5 items-center justify-center rounded-md bg-[rgb(var(--ec-accent-subtle))] px-1 text-[10px] font-semibold tabular-nums text-[rgb(var(--ec-accent-text))]">
51
+ {index + 1}
52
+ </span>
53
+ <span>{condition}</span>
54
+ <DropdownMenu.ItemIndicator className="absolute right-2.5 top-2.5 text-[rgb(var(--ec-accent))]">
55
+ <CheckIcon className="h-4 w-4" />
56
+ </DropdownMenu.ItemIndicator>
57
+ </DropdownMenu.RadioItem>
58
+ ))}
59
+ </DropdownMenu.RadioGroup>
60
+ <DropdownMenu.Arrow className="fill-[rgb(var(--ec-dropdown-bg))]" />
61
+ </DropdownMenu.Content>
62
+ </DropdownMenu.Portal>
63
+ </DropdownMenu.Root>
64
+ );
65
+ }
@@ -25,7 +25,11 @@ if (typeof _image === 'string') {
25
25
  <meta charset="UTF-8" />
26
26
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
27
27
  <meta name="viewport" content="width=device-width" />
28
- <link rel="icon" type="image/png" href={buildUrl('/logo.png', true)} />
28
+ <link rel="icon" href={buildUrl('/favicon.ico', true)} sizes="any" />
29
+ <link rel="icon" type="image/svg+xml" href={buildUrl('/favicon.svg', true)} />
30
+ <link rel="icon" type="image/png" sizes="32x32" href={buildUrl('/favicon-32x32.png', true)} />
31
+ <link rel="icon" type="image/png" sizes="16x16" href={buildUrl('/favicon-16x16.png', true)} />
32
+ <link rel="apple-touch-icon" href={buildUrl('/apple-touch-icon.png', true)} />
29
33
 
30
34
  <SEO
31
35
  title={title}
@@ -87,11 +87,18 @@ const sendsPointer = z.object({
87
87
  .optional(),
88
88
  });
89
89
 
90
+ const triggersPointer = z.object({
91
+ id: z.string(),
92
+ version: z.string().optional().default('latest'),
93
+ condition: z.string().optional(),
94
+ });
95
+
90
96
  const receivesPointer = z.object({
91
97
  id: z.string(),
92
98
  version: z.string().optional().default('latest'),
93
99
  fields: z.array(z.string()).optional(),
94
100
  group: z.string().optional(),
101
+ triggers: z.array(triggersPointer).optional(),
95
102
  from: z
96
103
  .array(
97
104
  z.object({
@@ -355,6 +362,8 @@ const operationSchema = z
355
362
  const messageDetailsPanelPropertySchema = z.object({
356
363
  producers: detailPanelPropertySchema.optional(),
357
364
  consumers: detailPanelPropertySchema.optional(),
365
+ triggers: detailPanelPropertySchema.optional(),
366
+ triggeredBy: detailPanelPropertySchema.optional(),
358
367
  channels: detailPanelPropertySchema.optional(),
359
368
  versions: detailPanelPropertySchema.optional(),
360
369
  repository: detailPanelPropertySchema.optional(),
@@ -21,7 +21,9 @@ const errorMessage = errorMessages[error] || errorMessages.Default;
21
21
  <head>
22
22
  <meta charset="UTF-8" />
23
23
  <meta name="viewport" content="width=device-width" />
24
- <link rel="icon" type="image/png" href="/logo.png" />
24
+ <link rel="icon" href="/favicon.ico" sizes="any" />
25
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
26
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
25
27
  <meta name="generator" content={Astro.generator} />
26
28
  <title>Authentication Error - EventCatalog</title>
27
29
  </head>
@@ -102,7 +102,9 @@ const providerConfig = {
102
102
  <head>
103
103
  <meta charset="UTF-8" />
104
104
  <meta name="viewport" content="width=device-width" />
105
- <link rel="icon" type="image/png" href="/logo.png" />
105
+ <link rel="icon" href="/favicon.ico" sizes="any" />
106
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
107
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
106
108
  <meta name="generator" content={Astro.generator} />
107
109
  <title>Sign In | {title}</title>
108
110
  <link rel="preconnect" href="https://fonts.googleapis.com" />
@@ -42,7 +42,9 @@ const hasResources = resourcesToShow.length > 0;
42
42
  <head>
43
43
  <meta charset="UTF-8" />
44
44
  <meta name="viewport" content="width=device-width" />
45
- <link rel="icon" type="image/png" href="/logo.png" />
45
+ <link rel="icon" href="/favicon.ico" sizes="any" />
46
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
47
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
46
48
  <meta name="generator" content={Astro.generator} />
47
49
  <title>EventCatalog Studio</title>
48
50
  </head>
@@ -0,0 +1,66 @@
1
+ import { getCollection, type CollectionEntry } from 'astro:content';
2
+ import { getMessagesWithTriggerPaths, type MessageReceiver } from '@utils/collections/message-triggers';
3
+ import { isSSR } from '@utils/feature';
4
+ import { HybridPage } from '@utils/page-loaders/hybrid-page';
5
+ import type { CollectionMessageTypes } from '@types';
6
+
7
+ const MESSAGE_TYPES: CollectionMessageTypes[] = ['events', 'commands', 'queries'];
8
+
9
+ const loadTriggerPathResources = async () => {
10
+ const { pageDataLoader } = await import('@utils/page-loaders/page-data-loader');
11
+ const [messageCollections, services, agents, domains] = await Promise.all([
12
+ Promise.all(MESSAGE_TYPES.map((type) => pageDataLoader[type]())),
13
+ getCollection('services'),
14
+ getCollection('agents'),
15
+ getCollection('domains'),
16
+ ]);
17
+
18
+ return {
19
+ allMessages: messageCollections.flat() as CollectionEntry<CollectionMessageTypes>[],
20
+ receivers: [...services, ...agents, ...domains] as MessageReceiver[],
21
+ };
22
+ };
23
+
24
+ export class Page extends HybridPage {
25
+ static get prerender(): boolean {
26
+ return !isSSR();
27
+ }
28
+
29
+ static async getStaticPaths(): Promise<Array<{ params: any; props: any }>> {
30
+ if (isSSR()) return [];
31
+
32
+ const { allMessages, receivers } = await loadTriggerPathResources();
33
+ const messagesWithTriggerPaths = getMessagesWithTriggerPaths(receivers, allMessages);
34
+
35
+ return messagesWithTriggerPaths.map((item) => ({
36
+ params: {
37
+ type: item.collection,
38
+ id: item.data.id,
39
+ version: item.data.version,
40
+ },
41
+ props: {
42
+ type: item.collection,
43
+ ...item,
44
+ },
45
+ }));
46
+ }
47
+
48
+ protected static async fetchData(params: any) {
49
+ const { type, id, version } = params;
50
+ if (!type || !id || !version || !MESSAGE_TYPES.includes(type)) return null;
51
+
52
+ const { allMessages, receivers } = await loadTriggerPathResources();
53
+ const item = allMessages.find((entry) => entry.collection === type && entry.data.id === id && entry.data.version === version);
54
+ if (!item) return null;
55
+
56
+ const hasTriggerPaths = getMessagesWithTriggerPaths(receivers, allMessages).includes(item);
57
+ return hasTriggerPaths ? { type, ...item } : null;
58
+ }
59
+
60
+ protected static createNotFoundResponse(): Response {
61
+ return new Response(null, {
62
+ status: 404,
63
+ statusText: 'Message trigger paths not found',
64
+ });
65
+ }
66
+ }
@@ -0,0 +1,201 @@
1
+ ---
2
+ import { getCollection, type CollectionEntry } from 'astro:content';
3
+
4
+ import LineageScenarioSwitcher from '@components/Lineage/LineageScenarioSwitcher';
5
+ import AstroNodeGraph from '@components/MDX/NodeGraph/AstroNodeGraph';
6
+ import ResourceRef from '@components/MDX/ResourceRef/ResourceRef.astro';
7
+ import Footer from '@layouts/Footer.astro';
8
+ import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
9
+ import { getTriggeredByOfMessage, getTriggersOfMessage, type MessageReceiver } from '@utils/collections/message-triggers';
10
+ import { buildMessageLineageGraph, groupMessageLineageGraphs } from '@utils/node-graphs/message-lineage';
11
+ import type { CollectionMessageTypes } from '@types';
12
+
13
+ import { Page } from './_index.data';
14
+
15
+ export const prerender = Page.prerender;
16
+ export const getStaticPaths = Page.getStaticPaths;
17
+
18
+ const props = await Page.getData(Astro);
19
+ const { data } = props as CollectionEntry<CollectionMessageTypes>;
20
+ const currentMessage = props as CollectionEntry<CollectionMessageTypes>;
21
+
22
+ const [events, commands, queries, services, agents, domains] = await Promise.all([
23
+ getCollection('events'),
24
+ getCollection('commands'),
25
+ getCollection('queries'),
26
+ getCollection('services'),
27
+ getCollection('agents'),
28
+ getCollection('domains'),
29
+ ]);
30
+
31
+ const allMessages = [...events, ...commands, ...queries] as CollectionEntry<CollectionMessageTypes>[];
32
+ const receivers = [...services, ...agents, ...domains] as MessageReceiver[];
33
+
34
+ const triggeredByRows = groupMessageLineageGraphs(
35
+ getTriggeredByOfMessage(receivers, currentMessage, allMessages).map((relation) =>
36
+ buildMessageLineageGraph({ currentMessage, relation, direction: 'triggeredBy' })
37
+ )
38
+ );
39
+ const triggerRows = groupMessageLineageGraphs(
40
+ getTriggersOfMessage(receivers, currentMessage, allMessages).map((relation) =>
41
+ buildMessageLineageGraph({ currentMessage, relation, direction: 'triggers' })
42
+ )
43
+ );
44
+
45
+ const resourceTypeByCollection = {
46
+ events: 'event',
47
+ commands: 'command',
48
+ queries: 'query',
49
+ services: 'service',
50
+ domains: 'domain',
51
+ agents: 'agent',
52
+ } as const;
53
+ const resourceType = (resource: CollectionEntry<CollectionMessageTypes> | MessageReceiver) =>
54
+ resourceTypeByCollection[resource.collection];
55
+ const conditionText = (condition: string) => condition.replace(/^when\s+/i, '');
56
+ const scenarioConditions = (row: (typeof triggeredByRows)[number]) =>
57
+ row.scenarios.map(({ condition }) => (condition ? conditionText(condition) : 'No condition specified'));
58
+ ---
59
+
60
+ <VerticalSideBarLayout title={`Trigger paths | ${data.name}`} description={`Message trigger paths for ${data.name}`}>
61
+ <main class="w-full min-h-full bg-[rgb(var(--ec-page-bg))] py-8">
62
+ <header class="border-b border-[rgb(var(--ec-page-border))] py-5">
63
+ <div class="text-sm font-semibold text-[rgb(var(--ec-accent))]">Trigger paths</div>
64
+ <h1 class="pt-3 text-2xl md:text-4xl font-bold text-[rgb(var(--ec-page-text))]">{data.name}</h1>
65
+ <p class="pt-3 text-base text-[rgb(var(--ec-page-text-muted))] font-light">
66
+ Explore the direct messages that trigger this message and the messages it can trigger.
67
+ </p>
68
+ </header>
69
+
70
+ <div class="space-y-10 py-8">
71
+ {
72
+ triggeredByRows.length > 0 && (
73
+ <section aria-labelledby="triggered-by-heading">
74
+ <div class="space-y-5">
75
+ {triggeredByRows.map((row, index) => (
76
+ <article class="lineage-row overflow-hidden rounded-xl border border-[rgb(var(--ec-page-border))] bg-[rgb(var(--ec-card-bg))] shadow-sm">
77
+ <div class="border-b border-[rgb(var(--ec-page-border))] px-5 py-4">
78
+ <h3 class="text-sm md:text-base font-medium text-[rgb(var(--ec-page-text))]">
79
+ <ResourceRef type={resourceType(row.target)} version={row.target.data.version}>
80
+ {row.target.data.id}
81
+ </ResourceRef>{' '}
82
+ is triggered by{' '}
83
+ <ResourceRef type={resourceType(row.source)} version={row.source.data.version}>
84
+ {row.source.data.id}
85
+ </ResourceRef>
86
+ {row.scenarios.length === 1 && row.scenarios[0].condition && (
87
+ <>
88
+ {' '}
89
+ when <span class="font-semibold">{conditionText(row.scenarios[0].condition)}</span>
90
+ </>
91
+ )}
92
+ {row.scenarios.length > 1 && (
93
+ <>
94
+ {' '}
95
+ when <LineageScenarioSwitcher client:visible conditions={scenarioConditions(row)} />
96
+ </>
97
+ )}{' '}
98
+ via{' '}
99
+ <ResourceRef type={resourceType(row.receiver)} version={row.receiver.data.version}>
100
+ {row.receiver.data.id}
101
+ </ResourceRef>
102
+ </h3>
103
+ </div>
104
+ <div
105
+ id={`${data.id}-triggered-by-${index}-portal`}
106
+ class="lineage-graph h-[250px] w-full bg-[rgb(var(--ec-page-bg))]"
107
+ />
108
+ <AstroNodeGraph
109
+ client:only="react"
110
+ id={`${data.id}-triggered-by-${index}`}
111
+ portalId={`${data.id}-triggered-by-${index}-portal`}
112
+ nodes={row.nodes}
113
+ edges={row.edges}
114
+ mode="simple"
115
+ linkTo="docs"
116
+ includeKey={false}
117
+ showSearch={false}
118
+ zoomOnScroll={false}
119
+ disableMessageAnimation={true}
120
+ />
121
+ </article>
122
+ ))}
123
+ </div>
124
+ </section>
125
+ )
126
+ }
127
+
128
+ {
129
+ triggerRows.length > 0 && (
130
+ <section aria-label="Messages triggered by this message">
131
+ <div class="space-y-5">
132
+ {triggerRows.map((row, index) => (
133
+ <article class="lineage-row overflow-hidden rounded-xl border border-[rgb(var(--ec-page-border))] bg-[rgb(var(--ec-card-bg))] shadow-sm">
134
+ <div class="border-b border-[rgb(var(--ec-page-border))] px-5 py-4">
135
+ <h3 class="text-sm md:text-base font-medium text-[rgb(var(--ec-page-text))]">
136
+ <ResourceRef type={resourceType(row.target)} version={row.target.data.version}>
137
+ {row.target.data.id}
138
+ </ResourceRef>{' '}
139
+ is triggered by{' '}
140
+ <ResourceRef type={resourceType(row.source)} version={row.source.data.version}>
141
+ {row.source.data.id}
142
+ </ResourceRef>
143
+ {row.scenarios.length === 1 && row.scenarios[0].condition && (
144
+ <>
145
+ {' '}
146
+ when <span class="font-semibold">{conditionText(row.scenarios[0].condition)}</span>
147
+ </>
148
+ )}
149
+ {row.scenarios.length > 1 && (
150
+ <>
151
+ {' '}
152
+ when <LineageScenarioSwitcher client:visible conditions={scenarioConditions(row)} />
153
+ </>
154
+ )}{' '}
155
+ via{' '}
156
+ <ResourceRef type={resourceType(row.receiver)} version={row.receiver.data.version}>
157
+ {row.receiver.data.id}
158
+ </ResourceRef>
159
+ </h3>
160
+ </div>
161
+ <div
162
+ id={`${data.id}-triggers-${index}-portal`}
163
+ class="lineage-graph h-[250px] w-full bg-[rgb(var(--ec-page-bg))]"
164
+ />
165
+ <AstroNodeGraph
166
+ client:only="react"
167
+ id={`${data.id}-triggers-${index}`}
168
+ portalId={`${data.id}-triggers-${index}-portal`}
169
+ nodes={row.nodes}
170
+ edges={row.edges}
171
+ mode="simple"
172
+ linkTo="docs"
173
+ includeKey={false}
174
+ showSearch={false}
175
+ zoomOnScroll={false}
176
+ disableMessageAnimation={true}
177
+ />
178
+ </article>
179
+ ))}
180
+ </div>
181
+ </section>
182
+ )
183
+ }
184
+ </div>
185
+
186
+ <Footer />
187
+ </main>
188
+ </VerticalSideBarLayout>
189
+
190
+ <style is:global>
191
+ .lineage-row {
192
+ content-visibility: auto;
193
+ contain-intrinsic-size: 330px;
194
+ }
195
+
196
+ .lineage-graph .react-flow__panel.top,
197
+ .lineage-graph .react-flow__controls,
198
+ .lineage-graph .react-flow__attribution {
199
+ display: none;
200
+ }
201
+ </style>