@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.d.mts CHANGED
@@ -250,14 +250,21 @@ declare const _default: (path: string) => {
250
250
  */
251
251
  writeQueryToService: (query: Query, service: {
252
252
  id: string;
253
- version? /**
253
+ version?: string;
254
+ }, options?: {
255
+ path
256
+ /**
257
+ * Returns a command from EventCatalog
258
+ * @param id - The id of the command to retrieve
259
+ * @param version - Optional id of the version to get (supports semver)
260
+ * @returns Command|Undefined
261
+ */
262
+ ? /**
254
263
  * Returns a command from EventCatalog
255
264
  * @param id - The id of the command to retrieve
256
265
  * @param version - Optional id of the version to get (supports semver)
257
266
  * @returns Command|Undefined
258
267
  */: string;
259
- }, options?: {
260
- path?: string;
261
268
  format?: "md" | "mdx";
262
269
  override?: boolean;
263
270
  }) => Promise<void>;
@@ -823,6 +830,14 @@ declare const _default: (path: string) => {
823
830
  dumpCatalog: (options?: {
824
831
  includeMarkdown?: boolean;
825
832
  }) => Promise<EventCatalogObject>;
833
+ /**
834
+ * Returns the event catalog configuration file.
835
+ * The event catalog configuration file is the file that contains the configuration for the event catalog.
836
+ *
837
+ * @param directory - The directory of the catalog.
838
+ * @returns A JSON object with the configuration for the event catalog.
839
+ */
840
+ getEventCatalogConfigurationFile: () => Promise<any>;
826
841
  /**
827
842
  * ================================
828
843
  * Resources Utils
package/dist/index.d.ts CHANGED
@@ -250,14 +250,21 @@ declare const _default: (path: string) => {
250
250
  */
251
251
  writeQueryToService: (query: Query, service: {
252
252
  id: string;
253
- version? /**
253
+ version?: string;
254
+ }, options?: {
255
+ path
256
+ /**
257
+ * Returns a command from EventCatalog
258
+ * @param id - The id of the command to retrieve
259
+ * @param version - Optional id of the version to get (supports semver)
260
+ * @returns Command|Undefined
261
+ */
262
+ ? /**
254
263
  * Returns a command from EventCatalog
255
264
  * @param id - The id of the command to retrieve
256
265
  * @param version - Optional id of the version to get (supports semver)
257
266
  * @returns Command|Undefined
258
267
  */: string;
259
- }, options?: {
260
- path?: string;
261
268
  format?: "md" | "mdx";
262
269
  override?: boolean;
263
270
  }) => Promise<void>;
@@ -823,6 +830,14 @@ declare const _default: (path: string) => {
823
830
  dumpCatalog: (options?: {
824
831
  includeMarkdown?: boolean;
825
832
  }) => Promise<EventCatalogObject>;
833
+ /**
834
+ * Returns the event catalog configuration file.
835
+ * The event catalog configuration file is the file that contains the configuration for the event catalog.
836
+ *
837
+ * @param directory - The directory of the catalog.
838
+ * @returns A JSON object with the configuration for the event catalog.
839
+ */
840
+ getEventCatalogConfigurationFile: () => Promise<any>;
826
841
  /**
827
842
  * ================================
828
843
  * Resources Utils
package/dist/index.js CHANGED
@@ -434,7 +434,7 @@ var import_node_path5 = require("path");
434
434
  var getService = (directory) => async (id, version) => getResource(directory, id, version, { type: "service" });
435
435
  var getServices = (directory) => async (options) => getResources(directory, {
436
436
  type: "services",
437
- ignore: ["**/events/**", "**/commands/**", "**/queries/**"],
437
+ ignore: ["**/events/**", "**/commands/**", "**/queries/**", "**/entities/**"],
438
438
  ...options
439
439
  });
440
440
  var writeService = (directory) => async (service, options = {
@@ -536,7 +536,7 @@ var import_gray_matter3 = __toESM(require("gray-matter"));
536
536
  var getDomain = (directory) => async (id, version) => getResource(directory, id, version, { type: "domain" });
537
537
  var getDomains = (directory) => async (options) => getResources(directory, {
538
538
  type: "domains",
539
- ignore: ["**/services/**", "**/events/**", "**/commands/**", "**/queries/**", "**/flows/**"],
539
+ ignore: ["**/services/**", "**/events/**", "**/commands/**", "**/queries/**", "**/flows/**", "**/entities/**"],
540
540
  ...options
541
541
  });
542
542
  var writeDomain = (directory) => async (domain, options = {
@@ -832,6 +832,16 @@ var filterCollection = (collection, options) => {
832
832
  markdown: options?.includeMarkdown ? item.markdown : void 0
833
833
  }));
834
834
  };
835
+ var getEventCatalogConfigurationFile = (directory) => async () => {
836
+ try {
837
+ const path4 = (0, import_node_path11.join)(directory, "eventcatalog.config.js");
838
+ const configModule = await import(path4);
839
+ return configModule.default;
840
+ } catch (error) {
841
+ console.error("Error getting event catalog configuration file", error);
842
+ return null;
843
+ }
844
+ };
835
845
  var dumpCatalog = (directory) => async (options) => {
836
846
  const { getDomains: getDomains2, getServices: getServices2, getEvents: getEvents2, getQueries: getQueries2, getCommands: getCommands2, getChannels: getChannels2, getTeams: getTeams2, getUsers: getUsers2 } = index_default(directory);
837
847
  const { includeMarkdown = true } = options || {};
@@ -1544,6 +1554,14 @@ var index_default = (path4) => {
1544
1554
  * @returns A JSON file with the catalog
1545
1555
  */
1546
1556
  dumpCatalog: dumpCatalog((0, import_node_path12.join)(path4)),
1557
+ /**
1558
+ * Returns the event catalog configuration file.
1559
+ * The event catalog configuration file is the file that contains the configuration for the event catalog.
1560
+ *
1561
+ * @param directory - The directory of the catalog.
1562
+ * @returns A JSON object with the configuration for the event catalog.
1563
+ */
1564
+ getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path12.join)(path4)),
1547
1565
  /**
1548
1566
  * ================================
1549
1567
  * Resources Utils