@eventcatalog/sdk 2.5.0 → 2.5.2

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
@@ -400,7 +400,7 @@ import { join as join6, dirname as dirname4, extname } from "path";
400
400
  var getService = (directory) => async (id, version) => getResource(directory, id, version, { type: "service" });
401
401
  var getServices = (directory) => async (options) => getResources(directory, {
402
402
  type: "services",
403
- ignore: ["**/events/**", "**/commands/**", "**/queries/**"],
403
+ ignore: ["**/events/**", "**/commands/**", "**/queries/**", "**/entities/**"],
404
404
  ...options
405
405
  });
406
406
  var writeService = (directory) => async (service, options = {
@@ -502,7 +502,7 @@ import matter3 from "gray-matter";
502
502
  var getDomain = (directory) => async (id, version) => getResource(directory, id, version, { type: "domain" });
503
503
  var getDomains = (directory) => async (options) => getResources(directory, {
504
504
  type: "domains",
505
- ignore: ["**/services/**", "**/events/**", "**/commands/**", "**/queries/**", "**/flows/**"],
505
+ ignore: ["**/services/**", "**/events/**", "**/commands/**", "**/queries/**", "**/flows/**", "**/entities/**"],
506
506
  ...options
507
507
  });
508
508
  var writeDomain = (directory) => async (domain, options = {
@@ -798,6 +798,16 @@ var filterCollection = (collection, options) => {
798
798
  markdown: options?.includeMarkdown ? item.markdown : void 0
799
799
  }));
800
800
  };
801
+ var getEventCatalogConfigurationFile = (directory) => async () => {
802
+ try {
803
+ const path4 = join12(directory, "eventcatalog.config.js");
804
+ const configModule = await import(path4);
805
+ return configModule.default;
806
+ } catch (error) {
807
+ console.error("Error getting event catalog configuration file", error);
808
+ return null;
809
+ }
810
+ };
801
811
  var dumpCatalog = (directory) => async (options) => {
802
812
  const { getDomains: getDomains2, getServices: getServices2, getEvents: getEvents2, getQueries: getQueries2, getCommands: getCommands2, getChannels: getChannels2, getTeams: getTeams2, getUsers: getUsers2 } = index_default(directory);
803
813
  const { includeMarkdown = true } = options || {};
@@ -1510,6 +1520,14 @@ var index_default = (path4) => {
1510
1520
  * @returns A JSON file with the catalog
1511
1521
  */
1512
1522
  dumpCatalog: dumpCatalog(join13(path4)),
1523
+ /**
1524
+ * Returns the event catalog configuration file.
1525
+ * The event catalog configuration file is the file that contains the configuration for the event catalog.
1526
+ *
1527
+ * @param directory - The directory of the catalog.
1528
+ * @returns A JSON object with the configuration for the event catalog.
1529
+ */
1530
+ getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(join13(path4)),
1513
1531
  /**
1514
1532
  * ================================
1515
1533
  * Resources Utils