@eventcatalog/sdk 2.5.4 → 2.6.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 (52) hide show
  1. package/dist/channels.js +2 -1
  2. package/dist/channels.js.map +1 -1
  3. package/dist/channels.mjs +2 -1
  4. package/dist/channels.mjs.map +1 -1
  5. package/dist/commands.js +2 -1
  6. package/dist/commands.js.map +1 -1
  7. package/dist/commands.mjs +2 -1
  8. package/dist/commands.mjs.map +1 -1
  9. package/dist/custom-docs.js.map +1 -1
  10. package/dist/custom-docs.mjs.map +1 -1
  11. package/dist/domains.js +2 -1
  12. package/dist/domains.js.map +1 -1
  13. package/dist/domains.mjs +2 -1
  14. package/dist/domains.mjs.map +1 -1
  15. package/dist/eventcatalog.js +204 -110
  16. package/dist/eventcatalog.js.map +1 -1
  17. package/dist/eventcatalog.mjs +200 -106
  18. package/dist/eventcatalog.mjs.map +1 -1
  19. package/dist/events.d.mts +4 -4
  20. package/dist/events.d.ts +4 -4
  21. package/dist/events.js +2 -1
  22. package/dist/events.js.map +1 -1
  23. package/dist/events.mjs +2 -1
  24. package/dist/events.mjs.map +1 -1
  25. package/dist/index.d.mts +49 -12
  26. package/dist/index.d.ts +49 -12
  27. package/dist/index.js +204 -110
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +200 -106
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/messages.d.mts +37 -0
  32. package/dist/messages.d.ts +37 -0
  33. package/dist/messages.js +271 -0
  34. package/dist/messages.js.map +1 -0
  35. package/dist/messages.mjs +235 -0
  36. package/dist/messages.mjs.map +1 -0
  37. package/dist/queries.js +2 -1
  38. package/dist/queries.js.map +1 -1
  39. package/dist/queries.mjs +2 -1
  40. package/dist/queries.mjs.map +1 -1
  41. package/dist/services.js +2 -1
  42. package/dist/services.js.map +1 -1
  43. package/dist/services.mjs +2 -1
  44. package/dist/services.mjs.map +1 -1
  45. package/dist/teams.js.map +1 -1
  46. package/dist/teams.mjs.map +1 -1
  47. package/dist/types.d.d.mts +2 -2
  48. package/dist/types.d.d.ts +2 -2
  49. package/dist/types.d.js.map +1 -1
  50. package/dist/users.js.map +1 -1
  51. package/dist/users.mjs.map +1 -1
  52. package/package.json +1 -1
@@ -35,10 +35,10 @@ __export(eventcatalog_exports, {
35
35
  });
36
36
  module.exports = __toCommonJS(eventcatalog_exports);
37
37
  var import_fs = __toESM(require("fs"));
38
- var import_node_path12 = __toESM(require("path"));
38
+ var import_node_path13 = __toESM(require("path"));
39
39
 
40
40
  // src/index.ts
41
- var import_node_path11 = require("path");
41
+ var import_node_path12 = require("path");
42
42
 
43
43
  // src/events.ts
44
44
  var import_promises2 = __toESM(require("fs/promises"));
@@ -112,7 +112,8 @@ var readMdxFile = async (path4) => {
112
112
  return { ...frontmatter, markdown };
113
113
  };
114
114
  var searchFilesForId = async (files, id, version) => {
115
- const idRegex = new RegExp(`^id:\\s*(['"]|>-)?\\s*${id}['"]?\\s*$`, "m");
115
+ const escapedId = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
116
+ const idRegex = new RegExp(`^id:\\s*(['"]|>-)?\\s*${escapedId}['"]?\\s*$`, "m");
116
117
  const versionRegex = new RegExp(`^version:\\s*['"]?${version}['"]?\\s*$`, "m");
117
118
  const matches = files.map((file) => {
118
119
  const content = import_node_fs.default.readFileSync(file, "utf-8");
@@ -329,6 +330,12 @@ var getFileFromResource = async (catalogDir, id, file, version) => {
329
330
  var getVersionedDirectory = (sourceDirectory, version) => {
330
331
  return (0, import_path.join)(sourceDirectory, "versioned", version);
331
332
  };
333
+ var isLatestVersion = async (catalogDir, id, version) => {
334
+ const resource = await getResource(catalogDir, id, version);
335
+ if (!resource) return false;
336
+ const pathToResource = await getResourcePath(catalogDir, id, version);
337
+ return !pathToResource?.relativePath.replace(/\\/g, "/").includes("/versioned/");
338
+ };
332
339
 
333
340
  // src/events.ts
334
341
  var getEvent = (directory) => async (id, version, options) => getResource(directory, id, version, { type: "event", ...options });
@@ -670,14 +677,82 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
670
677
  await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
671
678
  };
672
679
 
680
+ // src/messages.ts
681
+ var import_node_path8 = require("path");
682
+ var import_gray_matter4 = __toESM(require("gray-matter"));
683
+ var getMessageBySchemaPath = (directory) => async (path4, options) => {
684
+ const pathToMessage = (0, import_node_path8.dirname)(path4);
685
+ try {
686
+ const files = await getFiles(`${pathToMessage}/index.{md,mdx}`);
687
+ if (!files || files.length === 0) {
688
+ throw new Error(`No message definition file (index.md or index.mdx) found in directory: ${pathToMessage}`);
689
+ }
690
+ const messageFile = files[0];
691
+ const { data } = import_gray_matter4.default.read(messageFile);
692
+ const { id, version } = data;
693
+ if (!id || !version) {
694
+ throw new Error(`Message definition file at ${messageFile} is missing 'id' or 'version' in its frontmatter.`);
695
+ }
696
+ const message = await getResource(directory, id, version, { type: "message", ...options });
697
+ if (!message) {
698
+ throw new Error(`Message resource with id '${id}' and version '${version}' not found, as referenced in ${messageFile}.`);
699
+ }
700
+ return message;
701
+ } catch (error) {
702
+ console.error(`Failed to get message for schema path ${path4}. Error processing directory ${pathToMessage}:`, error);
703
+ if (error instanceof Error) {
704
+ error.message = `Failed to retrieve message from ${pathToMessage}: ${error.message}`;
705
+ throw error;
706
+ }
707
+ throw new Error(`Failed to retrieve message from ${pathToMessage} due to an unknown error.`);
708
+ }
709
+ };
710
+ var getProducersAndConsumersForMessage = (directory) => async (id, version) => {
711
+ const services = await getServices(directory)({ latestOnly: true });
712
+ const message = await getResource(directory, id, version, { type: "message" });
713
+ const isMessageLatestVersion = await isLatestVersion(directory, id, version);
714
+ if (!message) {
715
+ throw new Error(`Message resource with id '${id}' and version '${version}' not found.`);
716
+ }
717
+ const producers = [];
718
+ const consumers = [];
719
+ for (const service of services) {
720
+ const servicePublishesMessage = service.sends?.some((_message) => {
721
+ if (_message.version) {
722
+ return _message.id === message.id && _message.version === message.version;
723
+ }
724
+ if (isMessageLatestVersion && _message.id === message.id) {
725
+ return true;
726
+ }
727
+ return false;
728
+ });
729
+ const serviceSubscribesToMessage = service.receives?.some((_message) => {
730
+ if (_message.version) {
731
+ return _message.id === message.id && _message.version === message.version;
732
+ }
733
+ if (isMessageLatestVersion && _message.id === message.id) {
734
+ return true;
735
+ }
736
+ return false;
737
+ });
738
+ if (servicePublishesMessage) {
739
+ producers.push(service);
740
+ }
741
+ if (serviceSubscribesToMessage) {
742
+ consumers.push(service);
743
+ }
744
+ }
745
+ return { producers, consumers };
746
+ };
747
+
673
748
  // src/custom-docs.ts
674
- var import_node_path8 = __toESM(require("path"));
749
+ var import_node_path9 = __toESM(require("path"));
675
750
  var import_node_fs4 = __toESM(require("fs"));
676
751
  var import_promises8 = __toESM(require("fs/promises"));
677
- var import_gray_matter4 = __toESM(require("gray-matter"));
752
+ var import_gray_matter5 = __toESM(require("gray-matter"));
678
753
  var import_slugify = __toESM(require("slugify"));
679
754
  var getCustomDoc = (directory) => async (filePath) => {
680
- const fullPath = import_node_path8.default.join(directory, filePath);
755
+ const fullPath = import_node_path9.default.join(directory, filePath);
681
756
  const fullPathWithExtension = fullPath.endsWith(".mdx") ? fullPath : `${fullPath}.mdx`;
682
757
  const fileExists = import_node_fs4.default.existsSync(fullPathWithExtension);
683
758
  if (!fileExists) {
@@ -696,26 +771,26 @@ var writeCustomDoc = (directory) => async (customDoc, options = { path: "" }) =>
696
771
  const { fileName, ...rest } = customDoc;
697
772
  const name = fileName || (0, import_slugify.default)(customDoc.title, { lower: true });
698
773
  const withExtension = name.endsWith(".mdx") ? name : `${name}.mdx`;
699
- const fullPath = import_node_path8.default.join(directory, options.path || "", withExtension);
700
- import_node_fs4.default.mkdirSync(import_node_path8.default.dirname(fullPath), { recursive: true });
701
- const document = import_gray_matter4.default.stringify(customDoc.markdown.trim(), rest);
774
+ const fullPath = import_node_path9.default.join(directory, options.path || "", withExtension);
775
+ import_node_fs4.default.mkdirSync(import_node_path9.default.dirname(fullPath), { recursive: true });
776
+ const document = import_gray_matter5.default.stringify(customDoc.markdown.trim(), rest);
702
777
  import_node_fs4.default.writeFileSync(fullPath, document);
703
778
  };
704
779
  var rmCustomDoc = (directory) => async (filePath) => {
705
780
  const withExtension = filePath.endsWith(".mdx") ? filePath : `${filePath}.mdx`;
706
- await import_promises8.default.rm((0, import_node_path8.join)(directory, withExtension), { recursive: true });
781
+ await import_promises8.default.rm((0, import_node_path9.join)(directory, withExtension), { recursive: true });
707
782
  };
708
783
 
709
784
  // src/teams.ts
710
785
  var import_promises9 = __toESM(require("fs/promises"));
711
786
  var import_node_fs5 = __toESM(require("fs"));
712
- var import_node_path9 = require("path");
713
- var import_gray_matter5 = __toESM(require("gray-matter"));
787
+ var import_node_path10 = require("path");
788
+ var import_gray_matter6 = __toESM(require("gray-matter"));
714
789
  var getTeam = (catalogDir) => async (id) => {
715
790
  const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);
716
791
  if (files.length == 0) return void 0;
717
792
  const file = files[0];
718
- const { data, content } = import_gray_matter5.default.read(file);
793
+ const { data, content } = import_gray_matter6.default.read(file);
719
794
  return {
720
795
  ...data,
721
796
  id: data.id,
@@ -727,7 +802,7 @@ var getTeams = (catalogDir) => async (options) => {
727
802
  const files = await getFiles(`${catalogDir}/teams/*.{md,mdx}`);
728
803
  if (files.length === 0) return [];
729
804
  return files.map((file) => {
730
- const { data, content } = import_gray_matter5.default.read(file);
805
+ const { data, content } = import_gray_matter6.default.read(file);
731
806
  return {
732
807
  ...data,
733
808
  id: data.id,
@@ -744,23 +819,23 @@ var writeTeam = (catalogDir) => async (team, options = {}) => {
744
819
  throw new Error(`Failed to write ${resource.id} (team) as it already exists`);
745
820
  }
746
821
  const { markdown, ...frontmatter } = resource;
747
- const document = import_gray_matter5.default.stringify(markdown, frontmatter);
748
- import_node_fs5.default.mkdirSync((0, import_node_path9.join)(catalogDir, ""), { recursive: true });
749
- import_node_fs5.default.writeFileSync((0, import_node_path9.join)(catalogDir, "", `${resource.id}.mdx`), document);
822
+ const document = import_gray_matter6.default.stringify(markdown, frontmatter);
823
+ import_node_fs5.default.mkdirSync((0, import_node_path10.join)(catalogDir, ""), { recursive: true });
824
+ import_node_fs5.default.writeFileSync((0, import_node_path10.join)(catalogDir, "", `${resource.id}.mdx`), document);
750
825
  };
751
826
  var rmTeamById = (catalogDir) => async (id) => {
752
- await import_promises9.default.rm((0, import_node_path9.join)(catalogDir, `${id}.mdx`), { recursive: true });
827
+ await import_promises9.default.rm((0, import_node_path10.join)(catalogDir, `${id}.mdx`), { recursive: true });
753
828
  };
754
829
 
755
830
  // src/users.ts
756
831
  var import_node_fs6 = __toESM(require("fs"));
757
- var import_node_path10 = require("path");
758
- var import_gray_matter6 = __toESM(require("gray-matter"));
832
+ var import_node_path11 = require("path");
833
+ var import_gray_matter7 = __toESM(require("gray-matter"));
759
834
  var getUser = (catalogDir) => async (id) => {
760
835
  const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);
761
836
  if (files.length == 0) return void 0;
762
837
  const file = files[0];
763
- const { data, content } = import_gray_matter6.default.read(file);
838
+ const { data, content } = import_gray_matter7.default.read(file);
764
839
  return {
765
840
  ...data,
766
841
  id: data.id,
@@ -773,7 +848,7 @@ var getUsers = (catalogDir) => async (options) => {
773
848
  const files = await getFiles(`${catalogDir}/users/*.{md,mdx}`);
774
849
  if (files.length === 0) return [];
775
850
  return files.map((file) => {
776
- const { data, content } = import_gray_matter6.default.read(file);
851
+ const { data, content } = import_gray_matter7.default.read(file);
777
852
  return {
778
853
  ...data,
779
854
  id: data.id,
@@ -791,12 +866,12 @@ var writeUser = (catalogDir) => async (user, options = {}) => {
791
866
  throw new Error(`Failed to write ${resource.id} (user) as it already exists`);
792
867
  }
793
868
  const { markdown, ...frontmatter } = resource;
794
- const document = import_gray_matter6.default.stringify(markdown, frontmatter);
795
- import_node_fs6.default.mkdirSync((0, import_node_path10.join)(catalogDir, ""), { recursive: true });
796
- import_node_fs6.default.writeFileSync((0, import_node_path10.join)(catalogDir, "", `${resource.id}.mdx`), document);
869
+ const document = import_gray_matter7.default.stringify(markdown, frontmatter);
870
+ import_node_fs6.default.mkdirSync((0, import_node_path11.join)(catalogDir, ""), { recursive: true });
871
+ import_node_fs6.default.writeFileSync((0, import_node_path11.join)(catalogDir, "", `${resource.id}.mdx`), document);
797
872
  };
798
873
  var rmUserById = (catalogDir) => async (id) => {
799
- import_node_fs6.default.rmSync((0, import_node_path10.join)(catalogDir, `${id}.mdx`), { recursive: true });
874
+ import_node_fs6.default.rmSync((0, import_node_path11.join)(catalogDir, `${id}.mdx`), { recursive: true });
800
875
  };
801
876
 
802
877
  // src/index.ts
@@ -808,13 +883,13 @@ var index_default = (path4) => {
808
883
  * @param version - Optional id of the version to get (supports semver)
809
884
  * @returns Event|Undefined
810
885
  */
811
- getEvent: getEvent((0, import_node_path11.join)(path4)),
886
+ getEvent: getEvent((0, import_node_path12.join)(path4)),
812
887
  /**
813
888
  * Returns all events from EventCatalog
814
889
  * @param latestOnly - optional boolean, set to true to get only latest versions
815
890
  * @returns Event[]|Undefined
816
891
  */
817
- getEvents: getEvents((0, import_node_path11.join)(path4)),
892
+ getEvents: getEvents((0, import_node_path12.join)(path4)),
818
893
  /**
819
894
  * Adds an event to EventCatalog
820
895
  *
@@ -822,7 +897,7 @@ var index_default = (path4) => {
822
897
  * @param options - Optional options to write the event
823
898
  *
824
899
  */
825
- writeEvent: writeEvent((0, import_node_path11.join)(path4, "events")),
900
+ writeEvent: writeEvent((0, import_node_path12.join)(path4, "events")),
826
901
  /**
827
902
  * Adds an event to a service in EventCatalog
828
903
  *
@@ -831,26 +906,26 @@ var index_default = (path4) => {
831
906
  * @param options - Optional options to write the event
832
907
  *
833
908
  */
834
- writeEventToService: writeEventToService((0, import_node_path11.join)(path4)),
909
+ writeEventToService: writeEventToService((0, import_node_path12.join)(path4)),
835
910
  /**
836
911
  * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
837
912
  *
838
913
  * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
839
914
  *
840
915
  */
841
- rmEvent: rmEvent((0, import_node_path11.join)(path4, "events")),
916
+ rmEvent: rmEvent((0, import_node_path12.join)(path4, "events")),
842
917
  /**
843
918
  * Remove an event by an Event id
844
919
  *
845
920
  * @param id - The id of the event you want to remove
846
921
  *
847
922
  */
848
- rmEventById: rmEventById((0, import_node_path11.join)(path4)),
923
+ rmEventById: rmEventById((0, import_node_path12.join)(path4)),
849
924
  /**
850
925
  * Moves a given event id to the version directory
851
926
  * @param directory
852
927
  */
853
- versionEvent: versionEvent((0, import_node_path11.join)(path4)),
928
+ versionEvent: versionEvent((0, import_node_path12.join)(path4)),
854
929
  /**
855
930
  * Adds a file to the given event
856
931
  * @param id - The id of the event to add the file to
@@ -858,7 +933,7 @@ var index_default = (path4) => {
858
933
  * @param version - Optional version of the event to add the file to
859
934
  * @returns
860
935
  */
861
- addFileToEvent: addFileToEvent((0, import_node_path11.join)(path4)),
936
+ addFileToEvent: addFileToEvent((0, import_node_path12.join)(path4)),
862
937
  /**
863
938
  * Adds a schema to the given event
864
939
  * @param id - The id of the event to add the schema to
@@ -866,14 +941,14 @@ var index_default = (path4) => {
866
941
  * @param version - Optional version of the event to add the schema to
867
942
  * @returns
868
943
  */
869
- addSchemaToEvent: addSchemaToEvent((0, import_node_path11.join)(path4)),
944
+ addSchemaToEvent: addSchemaToEvent((0, import_node_path12.join)(path4)),
870
945
  /**
871
946
  * Check to see if an event version exists
872
947
  * @param id - The id of the event
873
948
  * @param version - The version of the event (supports semver)
874
949
  * @returns
875
950
  */
876
- eventHasVersion: eventHasVersion((0, import_node_path11.join)(path4)),
951
+ eventHasVersion: eventHasVersion((0, import_node_path12.join)(path4)),
877
952
  /**
878
953
  * ================================
879
954
  * Commands
@@ -885,13 +960,13 @@ var index_default = (path4) => {
885
960
  * @param version - Optional id of the version to get (supports semver)
886
961
  * @returns Command|Undefined
887
962
  */
888
- getCommand: getCommand((0, import_node_path11.join)(path4)),
963
+ getCommand: getCommand((0, import_node_path12.join)(path4)),
889
964
  /**
890
965
  * Returns all commands from EventCatalog
891
966
  * @param latestOnly - optional boolean, set to true to get only latest versions
892
967
  * @returns Command[]|Undefined
893
968
  */
894
- getCommands: getCommands((0, import_node_path11.join)(path4)),
969
+ getCommands: getCommands((0, import_node_path12.join)(path4)),
895
970
  /**
896
971
  * Adds an command to EventCatalog
897
972
  *
@@ -899,7 +974,7 @@ var index_default = (path4) => {
899
974
  * @param options - Optional options to write the command
900
975
  *
901
976
  */
902
- writeCommand: writeCommand((0, import_node_path11.join)(path4, "commands")),
977
+ writeCommand: writeCommand((0, import_node_path12.join)(path4, "commands")),
903
978
  /**
904
979
  * Adds a command to a service in EventCatalog
905
980
  *
@@ -908,26 +983,26 @@ var index_default = (path4) => {
908
983
  * @param options - Optional options to write the command
909
984
  *
910
985
  */
911
- writeCommandToService: writeCommandToService((0, import_node_path11.join)(path4)),
986
+ writeCommandToService: writeCommandToService((0, import_node_path12.join)(path4)),
912
987
  /**
913
988
  * Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
914
989
  *
915
990
  * @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
916
991
  *
917
992
  */
918
- rmCommand: rmCommand((0, import_node_path11.join)(path4, "commands")),
993
+ rmCommand: rmCommand((0, import_node_path12.join)(path4, "commands")),
919
994
  /**
920
995
  * Remove an command by an Event id
921
996
  *
922
997
  * @param id - The id of the command you want to remove
923
998
  *
924
999
  */
925
- rmCommandById: rmCommandById((0, import_node_path11.join)(path4)),
1000
+ rmCommandById: rmCommandById((0, import_node_path12.join)(path4)),
926
1001
  /**
927
1002
  * Moves a given command id to the version directory
928
1003
  * @param directory
929
1004
  */
930
- versionCommand: versionCommand((0, import_node_path11.join)(path4)),
1005
+ versionCommand: versionCommand((0, import_node_path12.join)(path4)),
931
1006
  /**
932
1007
  * Adds a file to the given command
933
1008
  * @param id - The id of the command to add the file to
@@ -935,7 +1010,7 @@ var index_default = (path4) => {
935
1010
  * @param version - Optional version of the command to add the file to
936
1011
  * @returns
937
1012
  */
938
- addFileToCommand: addFileToCommand((0, import_node_path11.join)(path4)),
1013
+ addFileToCommand: addFileToCommand((0, import_node_path12.join)(path4)),
939
1014
  /**
940
1015
  * Adds a schema to the given command
941
1016
  * @param id - The id of the command to add the schema to
@@ -943,14 +1018,14 @@ var index_default = (path4) => {
943
1018
  * @param version - Optional version of the command to add the schema to
944
1019
  * @returns
945
1020
  */
946
- addSchemaToCommand: addSchemaToCommand((0, import_node_path11.join)(path4)),
1021
+ addSchemaToCommand: addSchemaToCommand((0, import_node_path12.join)(path4)),
947
1022
  /**
948
1023
  * Check to see if a command version exists
949
1024
  * @param id - The id of the command
950
1025
  * @param version - The version of the command (supports semver)
951
1026
  * @returns
952
1027
  */
953
- commandHasVersion: commandHasVersion((0, import_node_path11.join)(path4)),
1028
+ commandHasVersion: commandHasVersion((0, import_node_path12.join)(path4)),
954
1029
  /**
955
1030
  * ================================
956
1031
  * Queries
@@ -962,13 +1037,13 @@ var index_default = (path4) => {
962
1037
  * @param version - Optional id of the version to get (supports semver)
963
1038
  * @returns Query|Undefined
964
1039
  */
965
- getQuery: getQuery((0, import_node_path11.join)(path4)),
1040
+ getQuery: getQuery((0, import_node_path12.join)(path4)),
966
1041
  /**
967
1042
  * Returns all queries from EventCatalog
968
1043
  * @param latestOnly - optional boolean, set to true to get only latest versions
969
1044
  * @returns Query[]|Undefined
970
1045
  */
971
- getQueries: getQueries((0, import_node_path11.join)(path4)),
1046
+ getQueries: getQueries((0, import_node_path12.join)(path4)),
972
1047
  /**
973
1048
  * Adds a query to EventCatalog
974
1049
  *
@@ -976,7 +1051,7 @@ var index_default = (path4) => {
976
1051
  * @param options - Optional options to write the event
977
1052
  *
978
1053
  */
979
- writeQuery: writeQuery((0, import_node_path11.join)(path4, "queries")),
1054
+ writeQuery: writeQuery((0, import_node_path12.join)(path4, "queries")),
980
1055
  /**
981
1056
  * Adds a query to a service in EventCatalog
982
1057
  *
@@ -985,26 +1060,26 @@ var index_default = (path4) => {
985
1060
  * @param options - Optional options to write the query
986
1061
  *
987
1062
  */
988
- writeQueryToService: writeQueryToService((0, import_node_path11.join)(path4)),
1063
+ writeQueryToService: writeQueryToService((0, import_node_path12.join)(path4)),
989
1064
  /**
990
1065
  * Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
991
1066
  *
992
1067
  * @param path - The path to your query, e.g. `/Orders/GetOrder`
993
1068
  *
994
1069
  */
995
- rmQuery: rmQuery((0, import_node_path11.join)(path4, "queries")),
1070
+ rmQuery: rmQuery((0, import_node_path12.join)(path4, "queries")),
996
1071
  /**
997
1072
  * Remove a query by a Query id
998
1073
  *
999
1074
  * @param id - The id of the query you want to remove
1000
1075
  *
1001
1076
  */
1002
- rmQueryById: rmQueryById((0, import_node_path11.join)(path4)),
1077
+ rmQueryById: rmQueryById((0, import_node_path12.join)(path4)),
1003
1078
  /**
1004
1079
  * Moves a given query id to the version directory
1005
1080
  * @param directory
1006
1081
  */
1007
- versionQuery: versionQuery((0, import_node_path11.join)(path4)),
1082
+ versionQuery: versionQuery((0, import_node_path12.join)(path4)),
1008
1083
  /**
1009
1084
  * Adds a file to the given query
1010
1085
  * @param id - The id of the query to add the file to
@@ -1012,7 +1087,7 @@ var index_default = (path4) => {
1012
1087
  * @param version - Optional version of the query to add the file to
1013
1088
  * @returns
1014
1089
  */
1015
- addFileToQuery: addFileToQuery((0, import_node_path11.join)(path4)),
1090
+ addFileToQuery: addFileToQuery((0, import_node_path12.join)(path4)),
1016
1091
  /**
1017
1092
  * Adds a schema to the given query
1018
1093
  * @param id - The id of the query to add the schema to
@@ -1020,14 +1095,14 @@ var index_default = (path4) => {
1020
1095
  * @param version - Optional version of the query to add the schema to
1021
1096
  * @returns
1022
1097
  */
1023
- addSchemaToQuery: addSchemaToQuery((0, import_node_path11.join)(path4)),
1098
+ addSchemaToQuery: addSchemaToQuery((0, import_node_path12.join)(path4)),
1024
1099
  /**
1025
1100
  * Check to see if an query version exists
1026
1101
  * @param id - The id of the query
1027
1102
  * @param version - The version of the query (supports semver)
1028
1103
  * @returns
1029
1104
  */
1030
- queryHasVersion: queryHasVersion((0, import_node_path11.join)(path4)),
1105
+ queryHasVersion: queryHasVersion((0, import_node_path12.join)(path4)),
1031
1106
  /**
1032
1107
  * ================================
1033
1108
  * Channels
@@ -1039,13 +1114,13 @@ var index_default = (path4) => {
1039
1114
  * @param version - Optional id of the version to get (supports semver)
1040
1115
  * @returns Channel|Undefined
1041
1116
  */
1042
- getChannel: getChannel((0, import_node_path11.join)(path4)),
1117
+ getChannel: getChannel((0, import_node_path12.join)(path4)),
1043
1118
  /**
1044
1119
  * Returns all channels from EventCatalog
1045
1120
  * @param latestOnly - optional boolean, set to true to get only latest versions
1046
1121
  * @returns Channel[]|Undefined
1047
1122
  */
1048
- getChannels: getChannels((0, import_node_path11.join)(path4)),
1123
+ getChannels: getChannels((0, import_node_path12.join)(path4)),
1049
1124
  /**
1050
1125
  * Adds an channel to EventCatalog
1051
1126
  *
@@ -1053,33 +1128,33 @@ var index_default = (path4) => {
1053
1128
  * @param options - Optional options to write the channel
1054
1129
  *
1055
1130
  */
1056
- writeChannel: writeChannel((0, import_node_path11.join)(path4, "channels")),
1131
+ writeChannel: writeChannel((0, import_node_path12.join)(path4, "channels")),
1057
1132
  /**
1058
1133
  * Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
1059
1134
  *
1060
1135
  * @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
1061
1136
  *
1062
1137
  */
1063
- rmChannel: rmChannel((0, import_node_path11.join)(path4, "channels")),
1138
+ rmChannel: rmChannel((0, import_node_path12.join)(path4, "channels")),
1064
1139
  /**
1065
1140
  * Remove an channel by an Event id
1066
1141
  *
1067
1142
  * @param id - The id of the channel you want to remove
1068
1143
  *
1069
1144
  */
1070
- rmChannelById: rmChannelById((0, import_node_path11.join)(path4)),
1145
+ rmChannelById: rmChannelById((0, import_node_path12.join)(path4)),
1071
1146
  /**
1072
1147
  * Moves a given channel id to the version directory
1073
1148
  * @param directory
1074
1149
  */
1075
- versionChannel: versionChannel((0, import_node_path11.join)(path4)),
1150
+ versionChannel: versionChannel((0, import_node_path12.join)(path4)),
1076
1151
  /**
1077
1152
  * Check to see if a channel version exists
1078
1153
  * @param id - The id of the channel
1079
1154
  * @param version - The version of the channel (supports semver)
1080
1155
  * @returns
1081
1156
  */
1082
- channelHasVersion: channelHasVersion((0, import_node_path11.join)(path4)),
1157
+ channelHasVersion: channelHasVersion((0, import_node_path12.join)(path4)),
1083
1158
  /**
1084
1159
  * Add a channel to an event
1085
1160
  *
@@ -1096,7 +1171,7 @@ var index_default = (path4) => {
1096
1171
  *
1097
1172
  * ```
1098
1173
  */
1099
- addEventToChannel: addMessageToChannel((0, import_node_path11.join)(path4), "events"),
1174
+ addEventToChannel: addMessageToChannel((0, import_node_path12.join)(path4), "events"),
1100
1175
  /**
1101
1176
  * Add a channel to an command
1102
1177
  *
@@ -1113,7 +1188,7 @@ var index_default = (path4) => {
1113
1188
  *
1114
1189
  * ```
1115
1190
  */
1116
- addCommandToChannel: addMessageToChannel((0, import_node_path11.join)(path4), "commands"),
1191
+ addCommandToChannel: addMessageToChannel((0, import_node_path12.join)(path4), "commands"),
1117
1192
  /**
1118
1193
  * Add a channel to an query
1119
1194
  *
@@ -1130,7 +1205,7 @@ var index_default = (path4) => {
1130
1205
  *
1131
1206
  * ```
1132
1207
  */
1133
- addQueryToChannel: addMessageToChannel((0, import_node_path11.join)(path4), "queries"),
1208
+ addQueryToChannel: addMessageToChannel((0, import_node_path12.join)(path4), "queries"),
1134
1209
  /**
1135
1210
  * ================================
1136
1211
  * SERVICES
@@ -1143,14 +1218,14 @@ var index_default = (path4) => {
1143
1218
  * @param options - Optional options to write the event
1144
1219
  *
1145
1220
  */
1146
- writeService: writeService((0, import_node_path11.join)(path4, "services")),
1221
+ writeService: writeService((0, import_node_path12.join)(path4, "services")),
1147
1222
  /**
1148
1223
  * Adds a versioned service to EventCatalog
1149
1224
  *
1150
1225
  * @param service - The service to write
1151
1226
  *
1152
1227
  */
1153
- writeVersionedService: writeVersionedService((0, import_node_path11.join)(path4, "services")),
1228
+ writeVersionedService: writeVersionedService((0, import_node_path12.join)(path4, "services")),
1154
1229
  /**
1155
1230
  * Adds a service to a domain in EventCatalog
1156
1231
  *
@@ -1159,39 +1234,39 @@ var index_default = (path4) => {
1159
1234
  * @param options - Optional options to write the event
1160
1235
  *
1161
1236
  */
1162
- writeServiceToDomain: writeServiceToDomain((0, import_node_path11.join)(path4, "domains")),
1237
+ writeServiceToDomain: writeServiceToDomain((0, import_node_path12.join)(path4, "domains")),
1163
1238
  /**
1164
1239
  * Returns a service from EventCatalog
1165
1240
  * @param id - The id of the service to retrieve
1166
1241
  * @param version - Optional id of the version to get (supports semver)
1167
1242
  * @returns Service|Undefined
1168
1243
  */
1169
- getService: getService((0, import_node_path11.join)(path4)),
1244
+ getService: getService((0, import_node_path12.join)(path4)),
1170
1245
  /**
1171
1246
  * Returns all services from EventCatalog
1172
1247
  * @param latestOnly - optional boolean, set to true to get only latest versions
1173
1248
  * @returns Service[]|Undefined
1174
1249
  */
1175
- getServices: getServices((0, import_node_path11.join)(path4)),
1250
+ getServices: getServices((0, import_node_path12.join)(path4)),
1176
1251
  /**
1177
1252
  * Moves a given service id to the version directory
1178
1253
  * @param directory
1179
1254
  */
1180
- versionService: versionService((0, import_node_path11.join)(path4)),
1255
+ versionService: versionService((0, import_node_path12.join)(path4)),
1181
1256
  /**
1182
1257
  * Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
1183
1258
  *
1184
1259
  * @param path - The path to your service, e.g. `/InventoryService`
1185
1260
  *
1186
1261
  */
1187
- rmService: rmService((0, import_node_path11.join)(path4, "services")),
1262
+ rmService: rmService((0, import_node_path12.join)(path4, "services")),
1188
1263
  /**
1189
1264
  * Remove an service by an service id
1190
1265
  *
1191
1266
  * @param id - The id of the service you want to remove
1192
1267
  *
1193
1268
  */
1194
- rmServiceById: rmServiceById((0, import_node_path11.join)(path4)),
1269
+ rmServiceById: rmServiceById((0, import_node_path12.join)(path4)),
1195
1270
  /**
1196
1271
  * Adds a file to the given service
1197
1272
  * @param id - The id of the service to add the file to
@@ -1199,21 +1274,21 @@ var index_default = (path4) => {
1199
1274
  * @param version - Optional version of the service to add the file to
1200
1275
  * @returns
1201
1276
  */
1202
- addFileToService: addFileToService((0, import_node_path11.join)(path4)),
1277
+ addFileToService: addFileToService((0, import_node_path12.join)(path4)),
1203
1278
  /**
1204
1279
  * Returns the specifications for a given service
1205
1280
  * @param id - The id of the service to retrieve the specifications for
1206
1281
  * @param version - Optional version of the service
1207
1282
  * @returns
1208
1283
  */
1209
- getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path11.join)(path4)),
1284
+ getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path12.join)(path4)),
1210
1285
  /**
1211
1286
  * Check to see if a service version exists
1212
1287
  * @param id - The id of the service
1213
1288
  * @param version - The version of the service (supports semver)
1214
1289
  * @returns
1215
1290
  */
1216
- serviceHasVersion: serviceHasVersion((0, import_node_path11.join)(path4)),
1291
+ serviceHasVersion: serviceHasVersion((0, import_node_path12.join)(path4)),
1217
1292
  /**
1218
1293
  * Add an event to a service by it's id.
1219
1294
  *
@@ -1233,7 +1308,7 @@ var index_default = (path4) => {
1233
1308
  *
1234
1309
  * ```
1235
1310
  */
1236
- addEventToService: addMessageToService((0, import_node_path11.join)(path4)),
1311
+ addEventToService: addMessageToService((0, import_node_path12.join)(path4)),
1237
1312
  /**
1238
1313
  * Add a command to a service by it's id.
1239
1314
  *
@@ -1253,7 +1328,7 @@ var index_default = (path4) => {
1253
1328
  *
1254
1329
  * ```
1255
1330
  */
1256
- addCommandToService: addMessageToService((0, import_node_path11.join)(path4)),
1331
+ addCommandToService: addMessageToService((0, import_node_path12.join)(path4)),
1257
1332
  /**
1258
1333
  * Add a query to a service by it's id.
1259
1334
  *
@@ -1273,7 +1348,7 @@ var index_default = (path4) => {
1273
1348
  *
1274
1349
  * ```
1275
1350
  */
1276
- addQueryToService: addMessageToService((0, import_node_path11.join)(path4)),
1351
+ addQueryToService: addMessageToService((0, import_node_path12.join)(path4)),
1277
1352
  /**
1278
1353
  * ================================
1279
1354
  * Domains
@@ -1286,39 +1361,39 @@ var index_default = (path4) => {
1286
1361
  * @param options - Optional options to write the event
1287
1362
  *
1288
1363
  */
1289
- writeDomain: writeDomain((0, import_node_path11.join)(path4, "domains")),
1364
+ writeDomain: writeDomain((0, import_node_path12.join)(path4, "domains")),
1290
1365
  /**
1291
1366
  * Returns a domain from EventCatalog
1292
1367
  * @param id - The id of the domain to retrieve
1293
1368
  * @param version - Optional id of the version to get (supports semver)
1294
1369
  * @returns Domain|Undefined
1295
1370
  */
1296
- getDomain: getDomain((0, import_node_path11.join)(path4, "domains")),
1371
+ getDomain: getDomain((0, import_node_path12.join)(path4, "domains")),
1297
1372
  /**
1298
1373
  * Returns all domains from EventCatalog
1299
1374
  * @param latestOnly - optional boolean, set to true to get only latest versions
1300
1375
  * @returns Domain[]|Undefined
1301
1376
  */
1302
- getDomains: getDomains((0, import_node_path11.join)(path4)),
1377
+ getDomains: getDomains((0, import_node_path12.join)(path4)),
1303
1378
  /**
1304
1379
  * Moves a given domain id to the version directory
1305
1380
  * @param directory
1306
1381
  */
1307
- versionDomain: versionDomain((0, import_node_path11.join)(path4, "domains")),
1382
+ versionDomain: versionDomain((0, import_node_path12.join)(path4, "domains")),
1308
1383
  /**
1309
1384
  * Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
1310
1385
  *
1311
1386
  * @param path - The path to your domain, e.g. `/Payment`
1312
1387
  *
1313
1388
  */
1314
- rmDomain: rmDomain((0, import_node_path11.join)(path4, "domains")),
1389
+ rmDomain: rmDomain((0, import_node_path12.join)(path4, "domains")),
1315
1390
  /**
1316
1391
  * Remove an service by an domain id
1317
1392
  *
1318
1393
  * @param id - The id of the domain you want to remove
1319
1394
  *
1320
1395
  */
1321
- rmDomainById: rmDomainById((0, import_node_path11.join)(path4, "domains")),
1396
+ rmDomainById: rmDomainById((0, import_node_path12.join)(path4, "domains")),
1322
1397
  /**
1323
1398
  * Adds a file to the given domain
1324
1399
  * @param id - The id of the domain to add the file to
@@ -1326,28 +1401,28 @@ var index_default = (path4) => {
1326
1401
  * @param version - Optional version of the domain to add the file to
1327
1402
  * @returns
1328
1403
  */
1329
- addFileToDomain: addFileToDomain((0, import_node_path11.join)(path4, "domains")),
1404
+ addFileToDomain: addFileToDomain((0, import_node_path12.join)(path4, "domains")),
1330
1405
  /**
1331
1406
  * Adds an ubiquitous language dictionary to a domain
1332
1407
  * @param id - The id of the domain to add the ubiquitous language to
1333
1408
  * @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
1334
1409
  * @param version - Optional version of the domain to add the ubiquitous language to
1335
1410
  */
1336
- addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path11.join)(path4, "domains")),
1411
+ addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path12.join)(path4, "domains")),
1337
1412
  /**
1338
1413
  * Get the ubiquitous language dictionary from a domain
1339
1414
  * @param id - The id of the domain to get the ubiquitous language from
1340
1415
  * @param version - Optional version of the domain to get the ubiquitous language from
1341
1416
  * @returns
1342
1417
  */
1343
- getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path11.join)(path4, "domains")),
1418
+ getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path12.join)(path4, "domains")),
1344
1419
  /**
1345
1420
  * Check to see if a domain version exists
1346
1421
  * @param id - The id of the domain
1347
1422
  * @param version - The version of the domain (supports semver)
1348
1423
  * @returns
1349
1424
  */
1350
- domainHasVersion: domainHasVersion((0, import_node_path11.join)(path4)),
1425
+ domainHasVersion: domainHasVersion((0, import_node_path12.join)(path4)),
1351
1426
  /**
1352
1427
  * Adds a given service to a domain
1353
1428
  * @param id - The id of the domain
@@ -1355,7 +1430,7 @@ var index_default = (path4) => {
1355
1430
  * @param version - (Optional) The version of the domain to add the service to
1356
1431
  * @returns
1357
1432
  */
1358
- addServiceToDomain: addServiceToDomain((0, import_node_path11.join)(path4, "domains")),
1433
+ addServiceToDomain: addServiceToDomain((0, import_node_path12.join)(path4, "domains")),
1359
1434
  /**
1360
1435
  * Adds a given subdomain to a domain
1361
1436
  * @param id - The id of the domain
@@ -1363,7 +1438,7 @@ var index_default = (path4) => {
1363
1438
  * @param version - (Optional) The version of the domain to add the subdomain to
1364
1439
  * @returns
1365
1440
  */
1366
- addSubDomainToDomain: addSubDomainToDomain((0, import_node_path11.join)(path4, "domains")),
1441
+ addSubDomainToDomain: addSubDomainToDomain((0, import_node_path12.join)(path4, "domains")),
1367
1442
  /**
1368
1443
  * ================================
1369
1444
  * Teams
@@ -1376,25 +1451,25 @@ var index_default = (path4) => {
1376
1451
  * @param options - Optional options to write the team
1377
1452
  *
1378
1453
  */
1379
- writeTeam: writeTeam((0, import_node_path11.join)(path4, "teams")),
1454
+ writeTeam: writeTeam((0, import_node_path12.join)(path4, "teams")),
1380
1455
  /**
1381
1456
  * Returns a team from EventCatalog
1382
1457
  * @param id - The id of the team to retrieve
1383
1458
  * @returns Team|Undefined
1384
1459
  */
1385
- getTeam: getTeam((0, import_node_path11.join)(path4, "teams")),
1460
+ getTeam: getTeam((0, import_node_path12.join)(path4, "teams")),
1386
1461
  /**
1387
1462
  * Returns all teams from EventCatalog
1388
1463
  * @returns Team[]|Undefined
1389
1464
  */
1390
- getTeams: getTeams((0, import_node_path11.join)(path4)),
1465
+ getTeams: getTeams((0, import_node_path12.join)(path4)),
1391
1466
  /**
1392
1467
  * Remove a team by the team id
1393
1468
  *
1394
1469
  * @param id - The id of the team you want to remove
1395
1470
  *
1396
1471
  */
1397
- rmTeamById: rmTeamById((0, import_node_path11.join)(path4, "teams")),
1472
+ rmTeamById: rmTeamById((0, import_node_path12.join)(path4, "teams")),
1398
1473
  /**
1399
1474
  * ================================
1400
1475
  * Users
@@ -1407,25 +1482,25 @@ var index_default = (path4) => {
1407
1482
  * @param options - Optional options to write the user
1408
1483
  *
1409
1484
  */
1410
- writeUser: writeUser((0, import_node_path11.join)(path4, "users")),
1485
+ writeUser: writeUser((0, import_node_path12.join)(path4, "users")),
1411
1486
  /**
1412
1487
  * Returns a user from EventCatalog
1413
1488
  * @param id - The id of the user to retrieve
1414
1489
  * @returns User|Undefined
1415
1490
  */
1416
- getUser: getUser((0, import_node_path11.join)(path4, "users")),
1491
+ getUser: getUser((0, import_node_path12.join)(path4, "users")),
1417
1492
  /**
1418
1493
  * Returns all user from EventCatalog
1419
1494
  * @returns User[]|Undefined
1420
1495
  */
1421
- getUsers: getUsers((0, import_node_path11.join)(path4)),
1496
+ getUsers: getUsers((0, import_node_path12.join)(path4)),
1422
1497
  /**
1423
1498
  * Remove a user by the user id
1424
1499
  *
1425
1500
  * @param id - The id of the user you want to remove
1426
1501
  *
1427
1502
  */
1428
- rmUserById: rmUserById((0, import_node_path11.join)(path4, "users")),
1503
+ rmUserById: rmUserById((0, import_node_path12.join)(path4, "users")),
1429
1504
  /**
1430
1505
  * ================================
1431
1506
  * Custom Docs
@@ -1436,32 +1511,32 @@ var index_default = (path4) => {
1436
1511
  * @param path - The path to the custom doc to retrieve
1437
1512
  * @returns CustomDoc|Undefined
1438
1513
  */
1439
- getCustomDoc: getCustomDoc((0, import_node_path11.join)(path4, "docs")),
1514
+ getCustomDoc: getCustomDoc((0, import_node_path12.join)(path4, "docs")),
1440
1515
  /**
1441
1516
  * Returns all custom docs from EventCatalog
1442
1517
  * @param options - Optional options to get custom docs from a specific path
1443
1518
  * @returns CustomDoc[]|Undefined
1444
1519
  */
1445
- getCustomDocs: getCustomDocs((0, import_node_path11.join)(path4, "docs")),
1520
+ getCustomDocs: getCustomDocs((0, import_node_path12.join)(path4, "docs")),
1446
1521
  /**
1447
1522
  * Writes a custom doc to EventCatalog
1448
1523
  * @param customDoc - The custom doc to write
1449
1524
  * @param options - Optional options to write the custom doc
1450
1525
  *
1451
1526
  */
1452
- writeCustomDoc: writeCustomDoc((0, import_node_path11.join)(path4, "docs")),
1527
+ writeCustomDoc: writeCustomDoc((0, import_node_path12.join)(path4, "docs")),
1453
1528
  /**
1454
1529
  * Removes a custom doc from EventCatalog
1455
1530
  * @param path - The path to the custom doc to remove
1456
1531
  *
1457
1532
  */
1458
- rmCustomDoc: rmCustomDoc((0, import_node_path11.join)(path4, "docs")),
1533
+ rmCustomDoc: rmCustomDoc((0, import_node_path12.join)(path4, "docs")),
1459
1534
  /**
1460
1535
  * Dumps the catalog to a JSON file.
1461
1536
  * @param directory - The directory to dump the catalog to
1462
1537
  * @returns A JSON file with the catalog
1463
1538
  */
1464
- dumpCatalog: dumpCatalog((0, import_node_path11.join)(path4)),
1539
+ dumpCatalog: dumpCatalog((0, import_node_path12.join)(path4)),
1465
1540
  /**
1466
1541
  * Returns the event catalog configuration file.
1467
1542
  * The event catalog configuration file is the file that contains the configuration for the event catalog.
@@ -1469,7 +1544,7 @@ var index_default = (path4) => {
1469
1544
  * @param directory - The directory of the catalog.
1470
1545
  * @returns A JSON object with the configuration for the event catalog.
1471
1546
  */
1472
- getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path11.join)(path4)),
1547
+ getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path12.join)(path4)),
1473
1548
  /**
1474
1549
  * ================================
1475
1550
  * Resources Utils
@@ -1478,7 +1553,26 @@ var index_default = (path4) => {
1478
1553
  /**
1479
1554
  * Returns the path to a given resource by id and version
1480
1555
  */
1481
- getResourcePath
1556
+ getResourcePath,
1557
+ /**
1558
+ * ================================
1559
+ * General Message Utils
1560
+ * ================================
1561
+ */
1562
+ /**
1563
+ * Returns a message from EventCatalog by a given schema path.
1564
+ *
1565
+ * @param path - The path to the message to retrieve
1566
+ * @returns Message|Undefined
1567
+ */
1568
+ getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path12.join)(path4)),
1569
+ /**
1570
+ * Returns the producers and consumers (services) for a given message
1571
+ * @param id - The id of the message to get the producers and consumers for
1572
+ * @param version - Optional version of the message
1573
+ * @returns { producers: Service[], consumers: Service[] }
1574
+ */
1575
+ getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path12.join)(path4))
1482
1576
  };
1483
1577
  };
1484
1578
 
@@ -1486,7 +1580,7 @@ var index_default = (path4) => {
1486
1580
  var DUMP_VERSION = "0.0.1";
1487
1581
  var getEventCatalogVersion = async (catalogDir) => {
1488
1582
  try {
1489
- const packageJson = import_fs.default.readFileSync((0, import_node_path12.join)(catalogDir, "package.json"), "utf8");
1583
+ const packageJson = import_fs.default.readFileSync((0, import_node_path13.join)(catalogDir, "package.json"), "utf8");
1490
1584
  const packageJsonObject = JSON.parse(packageJson);
1491
1585
  return packageJsonObject["dependencies"]["@eventcatalog/core"];
1492
1586
  } catch (error) {
@@ -1499,7 +1593,7 @@ var hydrateResource = async (catalogDir, resources = [], { attachSchema = false
1499
1593
  const resourcePath = await getResourcePath(catalogDir, resource.id, resource.version);
1500
1594
  let schema = "";
1501
1595
  if (resource.schemaPath && resourcePath?.fullPath) {
1502
- const pathToSchema = import_node_path12.default.join(import_node_path12.default.dirname(resourcePath?.fullPath), resource.schemaPath);
1596
+ const pathToSchema = import_node_path13.default.join(import_node_path13.default.dirname(resourcePath?.fullPath), resource.schemaPath);
1503
1597
  if (import_fs.default.existsSync(pathToSchema)) {
1504
1598
  schema = import_fs.default.readFileSync(pathToSchema, "utf8");
1505
1599
  }
@@ -1520,7 +1614,7 @@ var filterCollection = (collection, options) => {
1520
1614
  };
1521
1615
  var getEventCatalogConfigurationFile = (directory) => async () => {
1522
1616
  try {
1523
- const path4 = (0, import_node_path12.join)(directory, "eventcatalog.config.js");
1617
+ const path4 = (0, import_node_path13.join)(directory, "eventcatalog.config.js");
1524
1618
  const configModule = await import(path4);
1525
1619
  return configModule.default;
1526
1620
  } catch (error) {