@eventcatalog/sdk 2.6.7 → 2.6.9

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.
package/dist/index.mjs CHANGED
@@ -679,7 +679,6 @@ var getMessageBySchemaPath = (directory) => async (path5, options) => {
679
679
  }
680
680
  return message;
681
681
  } catch (error) {
682
- console.error(`Failed to get message for schema path ${path5}. Error processing directory ${pathToMessage}:`, error);
683
682
  if (error instanceof Error) {
684
683
  error.message = `Failed to retrieve message from ${pathToMessage}: ${error.message}`;
685
684
  throw error;
@@ -734,6 +733,24 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
734
733
  }
735
734
  return { producers, consumers };
736
735
  };
736
+ var getConsumersOfSchema = (directory) => async (path5) => {
737
+ try {
738
+ const message = await getMessageBySchemaPath(directory)(path5);
739
+ const { consumers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
740
+ return consumers;
741
+ } catch (error) {
742
+ return [];
743
+ }
744
+ };
745
+ var getProducersOfSchema = (directory) => async (path5) => {
746
+ try {
747
+ const message = await getMessageBySchemaPath(directory)(path5);
748
+ const { producers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
749
+ return producers;
750
+ } catch (error) {
751
+ return [];
752
+ }
753
+ };
737
754
 
738
755
  // src/custom-docs.ts
739
756
  import path2, { join as join10 } from "path";
@@ -1710,6 +1727,18 @@ var index_default = (path5) => {
1710
1727
  * @returns { producers: Service[], consumers: Service[] }
1711
1728
  */
1712
1729
  getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join14(path5)),
1730
+ /**
1731
+ * Returns the consumers of a given schema path
1732
+ * @param path - The path to the schema to get the consumers for
1733
+ * @returns Service[]
1734
+ */
1735
+ getConsumersOfSchema: getConsumersOfSchema(join14(path5)),
1736
+ /**
1737
+ * Returns the producers of a given schema path
1738
+ * @param path - The path to the schema to get the producers for
1739
+ * @returns Service[]
1740
+ */
1741
+ getProducersOfSchema: getProducersOfSchema(join14(path5)),
1713
1742
  /**
1714
1743
  * Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
1715
1744
  * @param id - The id of the resource to get the owners for