@eventcatalog/core 4.1.5 → 4.2.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.
Files changed (34) 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-E6IUV4GX.js → chunk-A6SWOPJ4.js} +1 -1
  6. package/dist/{chunk-G74MXXTG.js → chunk-DTQ2MXRB.js} +1 -1
  7. package/dist/{chunk-X77TET65.js → chunk-PUTZR6SV.js} +1 -1
  8. package/dist/{chunk-GIU3S4CI.js → chunk-RQ36O7QA.js} +1 -1
  9. package/dist/{chunk-DIUAURE2.js → chunk-V6UMVNX4.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/eventcatalog.cjs +36 -23
  13. package/dist/eventcatalog.js +41 -28
  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/src/components/Lineage/LineageScenarioSwitcher.tsx +65 -0
  19. package/eventcatalog/src/content.config.ts +9 -0
  20. package/eventcatalog/src/pages/docs/[type]/[id]/[version].md.ts +3 -1
  21. package/eventcatalog/src/pages/docs/[type]/[id]/[version].mdx.ts +4 -2
  22. package/eventcatalog/src/pages/triggers/[type]/[id]/[version]/_index.data.ts +66 -0
  23. package/eventcatalog/src/pages/triggers/[type]/[id]/[version]/index.astro +201 -0
  24. package/eventcatalog/src/stores/sidebar-store/builders/message.ts +31 -1
  25. package/eventcatalog/src/stores/sidebar-store/state.ts +22 -4
  26. package/eventcatalog/src/utils/collections/commands.ts +1 -1
  27. package/eventcatalog/src/utils/collections/message-triggers.ts +118 -0
  28. package/eventcatalog/src/utils/file-diffs.ts +4 -2
  29. package/eventcatalog/src/utils/node-graphs/container-node-graph.ts +2 -1
  30. package/eventcatalog/src/utils/node-graphs/message-lineage.ts +131 -0
  31. package/eventcatalog/src/utils/node-graphs/message-node-graph.ts +119 -1
  32. package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +15 -1
  33. package/eventcatalog/src/utils/node-graphs/utils/utils.ts +14 -4
  34. 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.5";
39
+ var version = "4.2.1";
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-GIU3S4CI.js";
4
- import "../chunk-X77TET65.js";
3
+ } from "../chunk-RQ36O7QA.js";
4
+ import "../chunk-PUTZR6SV.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.5";
143
+ var version = "4.2.1";
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-DIUAURE2.js";
4
- import "../chunk-GIU3S4CI.js";
3
+ } from "../chunk-V6UMVNX4.js";
4
+ import "../chunk-RQ36O7QA.js";
5
5
  import "../chunk-K2XIENVT.js";
6
- import "../chunk-X77TET65.js";
6
+ import "../chunk-PUTZR6SV.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
  logger
3
- } from "./chunk-G74MXXTG.js";
3
+ } from "./chunk-DTQ2MXRB.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-X77TET65.js";
3
+ } from "./chunk-PUTZR6SV.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "4.1.5";
2
+ var version = "4.2.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-X77TET65.js";
3
+ } from "./chunk-PUTZR6SV.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import os from "os";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-GIU3S4CI.js";
3
+ } from "./chunk-RQ36O7QA.js";
4
4
  import {
5
5
  countResources,
6
6
  serializeCounts
@@ -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.5";
28
+ var version = "4.2.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-X77TET65.js";
3
+ } from "./chunk-PUTZR6SV.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.5";
147
+ var version = "4.2.1";
148
148
 
149
149
  // src/constants.ts
150
150
  var VERSION = version;
@@ -1905,7 +1905,7 @@ var startDevPrewarm = ({
1905
1905
  };
1906
1906
  var createAstroLineFilter = () => {
1907
1907
  return (line) => {
1908
- return line.includes("[glob-loader]") || /The collection.*does not exist/.test(line);
1908
+ return line.includes("[glob-loader]") || /^\s*The collection ".*" does not exist or is empty\. Please check your content config file for errors\.\s*$/.test(line);
1909
1909
  };
1910
1910
  };
1911
1911
  var createAstroDevLineFilter = () => {
@@ -2244,34 +2244,43 @@ program.command("build").description("Run build of EventCatalog").action(async (
2244
2244
  logger.info(`Indexed ${result.records} page(s) into ${import_node_path11.default.relative(dir, result.outputPath)}`, "search");
2245
2245
  }
2246
2246
  });
2247
- var previewCatalog = ({
2247
+ var previewCatalog = async ({
2248
2248
  command,
2249
2249
  canEmbedPages = false,
2250
2250
  isEventCatalogStarter = false,
2251
2251
  isEventCatalogScale = false
2252
2252
  }) => {
2253
- (0, import_node_child_process.execSync)(
2254
- `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} npx astro preview ${command.args.join(" ").trim()}`,
2255
- {
2256
- cwd: core,
2257
- stdio: "inherit"
2258
- }
2259
- );
2253
+ await runCommandWithFilteredOutput({
2254
+ command: `npx astro preview ${command.args.join(" ").trim()}`,
2255
+ cwd: core,
2256
+ env: {
2257
+ PROJECT_DIR: dir,
2258
+ CATALOG_DIR: core,
2259
+ ENABLE_EMBED: String(canEmbedPages),
2260
+ EVENTCATALOG_STARTER: String(isEventCatalogStarter),
2261
+ EVENTCATALOG_SCALE: String(isEventCatalogScale)
2262
+ },
2263
+ shouldFilterLine: createAstroLineFilter()
2264
+ });
2260
2265
  };
2261
- var startServerCatalog = ({
2262
- command,
2266
+ var startServerCatalog = async ({
2263
2267
  canEmbedPages = false,
2264
2268
  isEventCatalogStarter = false,
2265
2269
  isEventCatalogScale = false
2266
2270
  }) => {
2267
2271
  const serverEntryPath = import_node_path11.default.join(dir, "dist", "server", "entry.mjs");
2268
- (0, import_node_child_process.execSync)(
2269
- `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} node "${serverEntryPath}"`,
2270
- {
2271
- cwd: core,
2272
- stdio: "inherit"
2273
- }
2274
- );
2272
+ await runCommandWithFilteredOutput({
2273
+ command: `node "${serverEntryPath}"`,
2274
+ cwd: core,
2275
+ env: {
2276
+ PROJECT_DIR: dir,
2277
+ CATALOG_DIR: core,
2278
+ ENABLE_EMBED: String(canEmbedPages),
2279
+ EVENTCATALOG_STARTER: String(isEventCatalogStarter),
2280
+ EVENTCATALOG_SCALE: String(isEventCatalogScale)
2281
+ },
2282
+ shouldFilterLine: createAstroLineFilter()
2283
+ });
2275
2284
  };
2276
2285
  program.command("preview").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
2277
2286
  logger.welcome();
@@ -2285,7 +2294,12 @@ program.command("preview").description("Serves the contents of your eventcatalog
2285
2294
  );
2286
2295
  const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
2287
2296
  const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
2288
- previewCatalog({ command, canEmbedPages: canEmbedPages || isEventCatalogScale, isEventCatalogStarter, isEventCatalogScale });
2297
+ await previewCatalog({
2298
+ command,
2299
+ canEmbedPages: canEmbedPages || isEventCatalogScale,
2300
+ isEventCatalogStarter,
2301
+ isEventCatalogScale
2302
+ });
2289
2303
  });
2290
2304
  program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
2291
2305
  logger.welcome();
@@ -2301,14 +2315,13 @@ program.command("start").description("Serves the contents of your eventcatalog b
2301
2315
  const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
2302
2316
  const isServerOutput = await isOutputServer();
2303
2317
  if (isServerOutput) {
2304
- startServerCatalog({
2305
- command,
2318
+ await startServerCatalog({
2306
2319
  canEmbedPages: canEmbedPages || isEventCatalogScale,
2307
2320
  isEventCatalogStarter,
2308
2321
  isEventCatalogScale
2309
2322
  });
2310
2323
  } else {
2311
- previewCatalog({
2324
+ await previewCatalog({
2312
2325
  command,
2313
2326
  canEmbedPages: canEmbedPages || isEventCatalogScale,
2314
2327
  isEventCatalogStarter,
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  log_build_default
3
- } from "./chunk-DIUAURE2.js";
3
+ } from "./chunk-V6UMVNX4.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-E6IUV4GX.js";
10
+ } from "./chunk-A6SWOPJ4.js";
11
11
  import {
12
12
  logger
13
- } from "./chunk-G74MXXTG.js";
13
+ } from "./chunk-DTQ2MXRB.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-GIU3S4CI.js";
23
+ import "./chunk-RQ36O7QA.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-X77TET65.js";
31
+ } from "./chunk-PUTZR6SV.js";
32
32
  import {
33
33
  linkCoreNodeModules,
34
34
  resolveInstalledCoreNodeModules
@@ -46,7 +46,7 @@ import {
46
46
 
47
47
  // src/eventcatalog.ts
48
48
  import { Command } from "commander";
49
- import { execSync, spawn } from "child_process";
49
+ import { spawn } from "child_process";
50
50
  import { join } from "path";
51
51
  import http from "http";
52
52
  import fs3 from "fs";
@@ -679,7 +679,7 @@ var startDevPrewarm = ({
679
679
  };
680
680
  var createAstroLineFilter = () => {
681
681
  return (line) => {
682
- return line.includes("[glob-loader]") || /The collection.*does not exist/.test(line);
682
+ return line.includes("[glob-loader]") || /^\s*The collection ".*" does not exist or is empty\. Please check your content config file for errors\.\s*$/.test(line);
683
683
  };
684
684
  };
685
685
  var createAstroDevLineFilter = () => {
@@ -1018,34 +1018,43 @@ program.command("build").description("Run build of EventCatalog").action(async (
1018
1018
  logger.info(`Indexed ${result.records} page(s) into ${path2.relative(dir, result.outputPath)}`, "search");
1019
1019
  }
1020
1020
  });
1021
- var previewCatalog = ({
1021
+ var previewCatalog = async ({
1022
1022
  command,
1023
1023
  canEmbedPages = false,
1024
1024
  isEventCatalogStarter = false,
1025
1025
  isEventCatalogScale = false
1026
1026
  }) => {
1027
- execSync(
1028
- `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} npx astro preview ${command.args.join(" ").trim()}`,
1029
- {
1030
- cwd: core,
1031
- stdio: "inherit"
1032
- }
1033
- );
1027
+ await runCommandWithFilteredOutput({
1028
+ command: `npx astro preview ${command.args.join(" ").trim()}`,
1029
+ cwd: core,
1030
+ env: {
1031
+ PROJECT_DIR: dir,
1032
+ CATALOG_DIR: core,
1033
+ ENABLE_EMBED: String(canEmbedPages),
1034
+ EVENTCATALOG_STARTER: String(isEventCatalogStarter),
1035
+ EVENTCATALOG_SCALE: String(isEventCatalogScale)
1036
+ },
1037
+ shouldFilterLine: createAstroLineFilter()
1038
+ });
1034
1039
  };
1035
- var startServerCatalog = ({
1036
- command,
1040
+ var startServerCatalog = async ({
1037
1041
  canEmbedPages = false,
1038
1042
  isEventCatalogStarter = false,
1039
1043
  isEventCatalogScale = false
1040
1044
  }) => {
1041
1045
  const serverEntryPath = path2.join(dir, "dist", "server", "entry.mjs");
1042
- execSync(
1043
- `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} node "${serverEntryPath}"`,
1044
- {
1045
- cwd: core,
1046
- stdio: "inherit"
1047
- }
1048
- );
1046
+ await runCommandWithFilteredOutput({
1047
+ command: `node "${serverEntryPath}"`,
1048
+ cwd: core,
1049
+ env: {
1050
+ PROJECT_DIR: dir,
1051
+ CATALOG_DIR: core,
1052
+ ENABLE_EMBED: String(canEmbedPages),
1053
+ EVENTCATALOG_STARTER: String(isEventCatalogStarter),
1054
+ EVENTCATALOG_SCALE: String(isEventCatalogScale)
1055
+ },
1056
+ shouldFilterLine: createAstroLineFilter()
1057
+ });
1049
1058
  };
1050
1059
  program.command("preview").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
1051
1060
  logger.welcome();
@@ -1059,7 +1068,12 @@ program.command("preview").description("Serves the contents of your eventcatalog
1059
1068
  );
1060
1069
  const isEventCatalogStarter = await isEventCatalogStarterEnabled();
1061
1070
  const isEventCatalogScale = await isEventCatalogScaleEnabled();
1062
- previewCatalog({ command, canEmbedPages: canEmbedPages || isEventCatalogScale, isEventCatalogStarter, isEventCatalogScale });
1071
+ await previewCatalog({
1072
+ command,
1073
+ canEmbedPages: canEmbedPages || isEventCatalogScale,
1074
+ isEventCatalogStarter,
1075
+ isEventCatalogScale
1076
+ });
1063
1077
  });
1064
1078
  program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
1065
1079
  logger.welcome();
@@ -1075,14 +1089,13 @@ program.command("start").description("Serves the contents of your eventcatalog b
1075
1089
  const isEventCatalogScale = await isEventCatalogScaleEnabled();
1076
1090
  const isServerOutput = await isOutputServer();
1077
1091
  if (isServerOutput) {
1078
- startServerCatalog({
1079
- command,
1092
+ await startServerCatalog({
1080
1093
  canEmbedPages: canEmbedPages || isEventCatalogScale,
1081
1094
  isEventCatalogStarter,
1082
1095
  isEventCatalogScale
1083
1096
  });
1084
1097
  } else {
1085
- previewCatalog({
1098
+ await previewCatalog({
1086
1099
  command,
1087
1100
  canEmbedPages: canEmbedPages || isEventCatalogScale,
1088
1101
  isEventCatalogStarter,
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.5";
111
+ var version = "4.2.1";
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-E6IUV4GX.js";
4
- import "./chunk-G74MXXTG.js";
5
- import "./chunk-X77TET65.js";
3
+ } from "./chunk-A6SWOPJ4.js";
4
+ import "./chunk-DTQ2MXRB.js";
5
+ import "./chunk-PUTZR6SV.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.5";
39
+ var version = "4.2.1";
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-G74MXXTG.js";
4
- import "../chunk-X77TET65.js";
3
+ } from "../chunk-DTQ2MXRB.js";
4
+ import "../chunk-PUTZR6SV.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -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
+ }
@@ -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(),
@@ -9,6 +9,7 @@ import config from '@config';
9
9
  import fs from 'fs';
10
10
  import { isLLMSTxtEnabled } from '@utils/feature';
11
11
  import { filterMarkdownForAgents } from '@utils/llms';
12
+ import { getAbsoluteFilePathForAstroFile } from '@utils/files';
12
13
 
13
14
  const events = await getCollection('events');
14
15
  const agents = await getCollection('agents');
@@ -67,7 +68,8 @@ export const GET: APIRoute = async ({ params, props }) => {
67
68
 
68
69
  const content = props?.content ?? findContent(params);
69
70
  if (content?.filePath) {
70
- const file = filterMarkdownForAgents(fs.readFileSync(content.filePath, 'utf8'));
71
+ const absoluteFilePath = getAbsoluteFilePathForAstroFile(content.filePath);
72
+ const file = filterMarkdownForAgents(fs.readFileSync(absoluteFilePath, 'utf8'));
71
73
  return new Response(file, { status: 200 });
72
74
  }
73
75
 
@@ -8,6 +8,7 @@ import config from '@config';
8
8
  import fs from 'fs';
9
9
  import { addSchemaToMarkdown, filterMarkdownForAgents } from '@utils/llms';
10
10
  import { isLLMSTxtEnabled, isSSR } from '@utils/feature';
11
+ import { getAbsoluteFilePathForAstroFile } from '@utils/files';
11
12
  const events = await getCollection('events');
12
13
  const agents = await getCollection('agents');
13
14
  const commands = await getCollection('commands');
@@ -67,10 +68,11 @@ export const GET: APIRoute = async ({ params, props }) => {
67
68
 
68
69
  const content = props?.content ?? findContent(params);
69
70
  if (content?.filePath) {
70
- let file = fs.readFileSync(content.filePath, 'utf8');
71
+ const absoluteFilePath = getAbsoluteFilePathForAstroFile(content.filePath);
72
+ let file = fs.readFileSync(absoluteFilePath, 'utf8');
71
73
 
72
74
  try {
73
- file = addSchemaToMarkdown(content, file);
75
+ file = addSchemaToMarkdown({ ...content, filePath: absoluteFilePath }, file);
74
76
  } catch (error) {
75
77
  console.log('Warning: Cant find the schema for', content.data.id, content.data.version);
76
78
  }
@@ -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
+ }