@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/eventcatalog.js +30 -1
- package/dist/eventcatalog.js.map +1 -1
- package/dist/eventcatalog.mjs +30 -1
- package/dist/eventcatalog.mjs.map +1 -1
- package/dist/index.d.mts +14 -21
- package/dist/index.d.ts +14 -21
- package/dist/index.js +30 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -1
- package/dist/index.mjs.map +1 -1
- package/dist/messages.d.mts +27 -1
- package/dist/messages.d.ts +27 -1
- package/dist/messages.js +24 -3
- package/dist/messages.js.map +1 -1
- package/dist/messages.mjs +21 -2
- package/dist/messages.mjs.map +1 -1
- package/dist/types.d.d.mts +2 -0
- package/dist/types.d.d.ts +2 -0
- package/dist/types.d.js.map +1 -1
- package/package.json +1 -1
package/dist/eventcatalog.js
CHANGED
|
@@ -718,7 +718,6 @@ var getMessageBySchemaPath = (directory) => async (path5, options) => {
|
|
|
718
718
|
}
|
|
719
719
|
return message;
|
|
720
720
|
} catch (error) {
|
|
721
|
-
console.error(`Failed to get message for schema path ${path5}. Error processing directory ${pathToMessage}:`, error);
|
|
722
721
|
if (error instanceof Error) {
|
|
723
722
|
error.message = `Failed to retrieve message from ${pathToMessage}: ${error.message}`;
|
|
724
723
|
throw error;
|
|
@@ -773,6 +772,24 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
|
|
|
773
772
|
}
|
|
774
773
|
return { producers, consumers };
|
|
775
774
|
};
|
|
775
|
+
var getConsumersOfSchema = (directory) => async (path5) => {
|
|
776
|
+
try {
|
|
777
|
+
const message = await getMessageBySchemaPath(directory)(path5);
|
|
778
|
+
const { consumers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
|
|
779
|
+
return consumers;
|
|
780
|
+
} catch (error) {
|
|
781
|
+
return [];
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
var getProducersOfSchema = (directory) => async (path5) => {
|
|
785
|
+
try {
|
|
786
|
+
const message = await getMessageBySchemaPath(directory)(path5);
|
|
787
|
+
const { producers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
|
|
788
|
+
return producers;
|
|
789
|
+
} catch (error) {
|
|
790
|
+
return [];
|
|
791
|
+
}
|
|
792
|
+
};
|
|
776
793
|
|
|
777
794
|
// src/custom-docs.ts
|
|
778
795
|
var import_node_path9 = __toESM(require("path"));
|
|
@@ -1652,6 +1669,18 @@ var index_default = (path5) => {
|
|
|
1652
1669
|
* @returns { producers: Service[], consumers: Service[] }
|
|
1653
1670
|
*/
|
|
1654
1671
|
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path13.join)(path5)),
|
|
1672
|
+
/**
|
|
1673
|
+
* Returns the consumers of a given schema path
|
|
1674
|
+
* @param path - The path to the schema to get the consumers for
|
|
1675
|
+
* @returns Service[]
|
|
1676
|
+
*/
|
|
1677
|
+
getConsumersOfSchema: getConsumersOfSchema((0, import_node_path13.join)(path5)),
|
|
1678
|
+
/**
|
|
1679
|
+
* Returns the producers of a given schema path
|
|
1680
|
+
* @param path - The path to the schema to get the producers for
|
|
1681
|
+
* @returns Service[]
|
|
1682
|
+
*/
|
|
1683
|
+
getProducersOfSchema: getProducersOfSchema((0, import_node_path13.join)(path5)),
|
|
1655
1684
|
/**
|
|
1656
1685
|
* Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
|
|
1657
1686
|
* @param id - The id of the resource to get the owners for
|