@eventcatalog/sdk 2.6.7 → 2.6.8
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/package.json +1 -1
package/dist/eventcatalog.mjs
CHANGED
|
@@ -683,7 +683,6 @@ var getMessageBySchemaPath = (directory) => async (path5, options) => {
|
|
|
683
683
|
}
|
|
684
684
|
return message;
|
|
685
685
|
} catch (error) {
|
|
686
|
-
console.error(`Failed to get message for schema path ${path5}. Error processing directory ${pathToMessage}:`, error);
|
|
687
686
|
if (error instanceof Error) {
|
|
688
687
|
error.message = `Failed to retrieve message from ${pathToMessage}: ${error.message}`;
|
|
689
688
|
throw error;
|
|
@@ -738,6 +737,24 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
|
|
|
738
737
|
}
|
|
739
738
|
return { producers, consumers };
|
|
740
739
|
};
|
|
740
|
+
var getConsumersOfSchema = (directory) => async (path5) => {
|
|
741
|
+
try {
|
|
742
|
+
const message = await getMessageBySchemaPath(directory)(path5);
|
|
743
|
+
const { consumers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
|
|
744
|
+
return consumers;
|
|
745
|
+
} catch (error) {
|
|
746
|
+
return [];
|
|
747
|
+
}
|
|
748
|
+
};
|
|
749
|
+
var getProducersOfSchema = (directory) => async (path5) => {
|
|
750
|
+
try {
|
|
751
|
+
const message = await getMessageBySchemaPath(directory)(path5);
|
|
752
|
+
const { producers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
|
|
753
|
+
return producers;
|
|
754
|
+
} catch (error) {
|
|
755
|
+
return [];
|
|
756
|
+
}
|
|
757
|
+
};
|
|
741
758
|
|
|
742
759
|
// src/custom-docs.ts
|
|
743
760
|
import path2, { join as join10 } from "path";
|
|
@@ -1617,6 +1634,18 @@ var index_default = (path5) => {
|
|
|
1617
1634
|
* @returns { producers: Service[], consumers: Service[] }
|
|
1618
1635
|
*/
|
|
1619
1636
|
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join13(path5)),
|
|
1637
|
+
/**
|
|
1638
|
+
* Returns the consumers of a given schema path
|
|
1639
|
+
* @param path - The path to the schema to get the consumers for
|
|
1640
|
+
* @returns Service[]
|
|
1641
|
+
*/
|
|
1642
|
+
getConsumersOfSchema: getConsumersOfSchema(join13(path5)),
|
|
1643
|
+
/**
|
|
1644
|
+
* Returns the producers of a given schema path
|
|
1645
|
+
* @param path - The path to the schema to get the producers for
|
|
1646
|
+
* @returns Service[]
|
|
1647
|
+
*/
|
|
1648
|
+
getProducersOfSchema: getProducersOfSchema(join13(path5)),
|
|
1620
1649
|
/**
|
|
1621
1650
|
* Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
|
|
1622
1651
|
* @param id - The id of the resource to get the owners for
|