@eventcatalog/sdk 2.8.3 → 2.8.4

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.
Files changed (59) hide show
  1. package/dist/channels.js +19 -18
  2. package/dist/channels.js.map +1 -1
  3. package/dist/channels.mjs +14 -13
  4. package/dist/channels.mjs.map +1 -1
  5. package/dist/commands.js +14 -13
  6. package/dist/commands.js.map +1 -1
  7. package/dist/commands.mjs +12 -11
  8. package/dist/commands.mjs.map +1 -1
  9. package/dist/containers.js +14 -13
  10. package/dist/containers.js.map +1 -1
  11. package/dist/containers.mjs +12 -11
  12. package/dist/containers.mjs.map +1 -1
  13. package/dist/custom-docs.js +8 -7
  14. package/dist/custom-docs.js.map +1 -1
  15. package/dist/custom-docs.mjs +7 -6
  16. package/dist/custom-docs.mjs.map +1 -1
  17. package/dist/data-stores.js +14 -13
  18. package/dist/data-stores.js.map +1 -1
  19. package/dist/data-stores.mjs +12 -11
  20. package/dist/data-stores.mjs.map +1 -1
  21. package/dist/domains.js +19 -18
  22. package/dist/domains.js.map +1 -1
  23. package/dist/domains.mjs +19 -18
  24. package/dist/domains.mjs.map +1 -1
  25. package/dist/entities.js +13 -12
  26. package/dist/entities.js.map +1 -1
  27. package/dist/entities.mjs +12 -11
  28. package/dist/entities.mjs.map +1 -1
  29. package/dist/eventcatalog.js +211 -201
  30. package/dist/eventcatalog.js.map +1 -1
  31. package/dist/eventcatalog.mjs +182 -172
  32. package/dist/eventcatalog.mjs.map +1 -1
  33. package/dist/events.js +14 -13
  34. package/dist/events.js.map +1 -1
  35. package/dist/events.mjs +12 -11
  36. package/dist/events.mjs.map +1 -1
  37. package/dist/index.d.mts +5 -8
  38. package/dist/index.d.ts +5 -8
  39. package/dist/index.js +211 -201
  40. package/dist/index.js.map +1 -1
  41. package/dist/index.mjs +182 -172
  42. package/dist/index.mjs.map +1 -1
  43. package/dist/messages.js +13 -12
  44. package/dist/messages.js.map +1 -1
  45. package/dist/messages.mjs +11 -10
  46. package/dist/messages.mjs.map +1 -1
  47. package/dist/queries.js +14 -13
  48. package/dist/queries.js.map +1 -1
  49. package/dist/queries.mjs +12 -11
  50. package/dist/queries.mjs.map +1 -1
  51. package/dist/services.js +31 -30
  52. package/dist/services.js.map +1 -1
  53. package/dist/services.mjs +25 -24
  54. package/dist/services.mjs.map +1 -1
  55. package/dist/teams.js +13 -12
  56. package/dist/teams.js.map +1 -1
  57. package/dist/teams.mjs +8 -7
  58. package/dist/teams.mjs.map +1 -1
  59. package/package.json +2 -2
@@ -35,14 +35,14 @@ __export(eventcatalog_exports, {
35
35
  });
36
36
  module.exports = __toCommonJS(eventcatalog_exports);
37
37
  var import_fs = __toESM(require("fs"));
38
- var import_node_path17 = __toESM(require("path"));
38
+ var import_node_path18 = __toESM(require("path"));
39
39
 
40
40
  // src/index.ts
41
- var import_node_path16 = require("path");
41
+ var import_node_path17 = require("path");
42
42
 
43
43
  // src/events.ts
44
44
  var import_promises2 = __toESM(require("fs/promises"));
45
- var import_node_path3 = require("path");
45
+ var import_node_path4 = require("path");
46
46
 
47
47
  // src/internal/utils.ts
48
48
  var import_glob = require("glob");
@@ -59,13 +59,13 @@ var versionExists = async (catalogDir, id, version) => {
59
59
  var findFileById = async (catalogDir, id, version) => {
60
60
  const files = await getFiles(`${catalogDir}/**/index.{md,mdx}`);
61
61
  const matchedFiles = await searchFilesForId(files, id) || [];
62
- const latestVersion = matchedFiles.find((path5) => !path5.includes("versioned"));
62
+ const latestVersion = matchedFiles.find((path6) => !path6.includes("versioned"));
63
63
  if (!version) {
64
64
  return latestVersion;
65
65
  }
66
- const parsedFiles = matchedFiles.map((path5) => {
67
- const { data } = import_gray_matter.default.read(path5);
68
- return { ...data, path: path5 };
66
+ const parsedFiles = matchedFiles.map((path6) => {
67
+ const { data } = import_gray_matter.default.read(path6);
68
+ return { ...data, path: path6 };
69
69
  });
70
70
  const semverRange = (0, import_semver.validRange)(version);
71
71
  if (semverRange && (0, import_semver.valid)(version)) {
@@ -106,8 +106,8 @@ var getFiles = async (pattern, ignore = "") => {
106
106
  );
107
107
  }
108
108
  };
109
- var readMdxFile = async (path5) => {
110
- const { data } = import_gray_matter.default.read(path5);
109
+ var readMdxFile = async (path6) => {
110
+ const { data } = import_gray_matter.default.read(path6);
111
111
  const { markdown, ...frontmatter } = data;
112
112
  return { ...frontmatter, markdown };
113
113
  };
@@ -160,6 +160,7 @@ var import_node_fs2 = __toESM(require("fs"));
160
160
  var import_semver2 = require("semver");
161
161
  var import_proper_lockfile = require("proper-lockfile");
162
162
  var import_node_path2 = require("path");
163
+ var import_node_path3 = __toESM(require("path"));
163
164
  var versionResource = async (catalogDir, id) => {
164
165
  const files = await getFiles(`${catalogDir}/**/index.{md,mdx}`);
165
166
  const matchedFiles = await searchFilesForId(files, id);
@@ -199,8 +200,8 @@ var writeResource = async (catalogDir, resource, options = {
199
200
  versionExistingContent: false,
200
201
  format: "mdx"
201
202
  }) => {
202
- const path5 = options.path || `/${resource.id}`;
203
- const fullPath = (0, import_path.join)(catalogDir, path5);
203
+ const path6 = options.path || `/${resource.id}`;
204
+ const fullPath = (0, import_path.join)(catalogDir, path6);
204
205
  const format = options.format || "mdx";
205
206
  import_node_fs2.default.mkdirSync(fullPath, { recursive: true });
206
207
  const lockPath = (0, import_path.join)(fullPath, `index.${format}`);
@@ -266,6 +267,11 @@ var getResourcePath = async (catalogDir, id, version) => {
266
267
  directory: (0, import_path.dirname)(file.replace(catalogDir, ""))
267
268
  };
268
269
  };
270
+ var getResourceFolderName = async (catalogDir, id, version) => {
271
+ const paths = await getResourcePath(catalogDir, id, version);
272
+ if (!paths) return;
273
+ return paths?.directory.split(import_node_path3.default.sep).filter(Boolean).pop();
274
+ };
269
275
  var toResource = async (catalogDir, rawContents) => {
270
276
  const { data, content } = (0, import_gray_matter2.default)(rawContents);
271
277
  return {
@@ -327,16 +333,16 @@ var rmResourceById = async (catalogDir, id, version, options) => {
327
333
  );
328
334
  }
329
335
  };
330
- var waitForFileRemoval = async (path5, maxRetries = 50, delay = 10) => {
336
+ var waitForFileRemoval = async (path6, maxRetries = 50, delay = 10) => {
331
337
  for (let i = 0; i < maxRetries; i++) {
332
338
  try {
333
- await import_promises.default.access(path5);
339
+ await import_promises.default.access(path6);
334
340
  await new Promise((resolve2) => setTimeout(resolve2, delay));
335
341
  } catch (error) {
336
342
  return;
337
343
  }
338
344
  }
339
- throw new Error(`File/directory ${path5} was not removed after ${maxRetries} attempts`);
345
+ throw new Error(`File/directory ${path6} was not removed after ${maxRetries} attempts`);
340
346
  };
341
347
  var addFileToResource = async (catalogDir, id, file, version) => {
342
348
  const pathToResource = await findFileById(catalogDir, id, version);
@@ -380,11 +386,11 @@ var writeEventToService = (directory) => async (event, service, options = { path
380
386
  throw new Error("Service not found");
381
387
  }
382
388
  let pathForEvent = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/events` : `${resourcePath.directory}/events`;
383
- pathForEvent = (0, import_node_path3.join)(pathForEvent, event.id);
389
+ pathForEvent = (0, import_node_path4.join)(pathForEvent, event.id);
384
390
  await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
385
391
  };
386
- var rmEvent = (directory) => async (path5) => {
387
- await import_promises2.default.rm((0, import_node_path3.join)(directory, path5), { recursive: true });
392
+ var rmEvent = (directory) => async (path6) => {
393
+ await import_promises2.default.rm((0, import_node_path4.join)(directory, path6), { recursive: true });
388
394
  };
389
395
  var rmEventById = (directory) => async (id, version, persistFiles) => {
390
396
  await rmResourceById(directory, id, version, { type: "event", persistFiles });
@@ -401,7 +407,7 @@ var eventHasVersion = (directory) => async (id, version) => {
401
407
 
402
408
  // src/commands.ts
403
409
  var import_promises3 = __toESM(require("fs/promises"));
404
- var import_node_path4 = require("path");
410
+ var import_node_path5 = require("path");
405
411
  var getCommand = (directory) => async (id, version, options) => getResource(directory, id, version, { type: "command", ...options });
406
412
  var getCommands = (directory) => async (options) => getResources(directory, { type: "commands", ...options });
407
413
  var writeCommand = (directory) => async (command, options = {
@@ -416,11 +422,11 @@ var writeCommandToService = (directory) => async (command, service, options = {
416
422
  throw new Error("Service not found");
417
423
  }
418
424
  let pathForCommand = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/commands` : `${resourcePath.directory}/commands`;
419
- pathForCommand = (0, import_node_path4.join)(pathForCommand, command.id);
425
+ pathForCommand = (0, import_node_path5.join)(pathForCommand, command.id);
420
426
  await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
421
427
  };
422
- var rmCommand = (directory) => async (path5) => {
423
- await import_promises3.default.rm((0, import_node_path4.join)(directory, path5), { recursive: true });
428
+ var rmCommand = (directory) => async (path6) => {
429
+ await import_promises3.default.rm((0, import_node_path5.join)(directory, path6), { recursive: true });
424
430
  };
425
431
  var rmCommandById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "command", persistFiles });
426
432
  var versionCommand = (directory) => async (id) => versionResource(directory, id);
@@ -435,7 +441,7 @@ var commandHasVersion = (directory) => async (id, version) => {
435
441
 
436
442
  // src/queries.ts
437
443
  var import_promises4 = __toESM(require("fs/promises"));
438
- var import_node_path5 = require("path");
444
+ var import_node_path6 = require("path");
439
445
  var getQuery = (directory) => async (id, version, options) => getResource(directory, id, version, { type: "query", ...options });
440
446
  var writeQuery = (directory) => async (query, options = {
441
447
  path: "",
@@ -450,11 +456,11 @@ var writeQueryToService = (directory) => async (query, service, options = { path
450
456
  throw new Error("Service not found");
451
457
  }
452
458
  let pathForQuery = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/queries` : `${resourcePath.directory}/queries`;
453
- pathForQuery = (0, import_node_path5.join)(pathForQuery, query.id);
459
+ pathForQuery = (0, import_node_path6.join)(pathForQuery, query.id);
454
460
  await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
455
461
  };
456
- var rmQuery = (directory) => async (path5) => {
457
- await import_promises4.default.rm((0, import_node_path5.join)(directory, path5), { recursive: true });
462
+ var rmQuery = (directory) => async (path6) => {
463
+ await import_promises4.default.rm((0, import_node_path6.join)(directory, path6), { recursive: true });
458
464
  };
459
465
  var rmQueryById = (directory) => async (id, version, persistFiles) => {
460
466
  await rmResourceById(directory, id, version, { type: "query", persistFiles });
@@ -471,10 +477,10 @@ var queryHasVersion = (directory) => async (id, version) => {
471
477
 
472
478
  // src/services.ts
473
479
  var import_promises5 = __toESM(require("fs/promises"));
474
- var import_node_path6 = require("path");
480
+ var import_node_path7 = require("path");
475
481
  var getService = (directory) => async (id, version) => getResource(directory, id, version, { type: "service" });
476
- var getServiceByPath = (directory) => async (path5) => {
477
- const service = await getResource(directory, void 0, void 0, { type: "service" }, path5);
482
+ var getServiceByPath = (directory) => async (path6) => {
483
+ const service = await getResource(directory, void 0, void 0, { type: "service" }, path6);
478
484
  return service;
479
485
  };
480
486
  var getServices = (directory) => async (options) => getResources(directory, {
@@ -498,17 +504,17 @@ var writeService = (directory) => async (service, options = {
498
504
  };
499
505
  var writeVersionedService = (directory) => async (service) => {
500
506
  const resource = { ...service };
501
- const path5 = getVersionedDirectory(service.id, service.version);
502
- return await writeService(directory)(resource, { path: path5 });
507
+ const path6 = getVersionedDirectory(service.id, service.version);
508
+ return await writeService(directory)(resource, { path: path6 });
503
509
  };
504
510
  var writeServiceToDomain = (directory) => async (service, domain, options = { path: "", format: "mdx", override: false }) => {
505
511
  let pathForService = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/services` : `/${domain.id}/services`;
506
- pathForService = (0, import_node_path6.join)(pathForService, service.id);
512
+ pathForService = (0, import_node_path7.join)(pathForService, service.id);
507
513
  await writeResource(directory, { ...service }, { ...options, path: pathForService, type: "service" });
508
514
  };
509
515
  var versionService = (directory) => async (id) => versionResource(directory, id);
510
- var rmService = (directory) => async (path5) => {
511
- await import_promises5.default.rm((0, import_node_path6.join)(directory, path5), { recursive: true });
516
+ var rmService = (directory) => async (path6) => {
517
+ await import_promises5.default.rm((0, import_node_path7.join)(directory, path6), { recursive: true });
512
518
  };
513
519
  var rmServiceById = (directory) => async (id, version, persistFiles) => {
514
520
  await rmResourceById(directory, id, version, { type: "service", persistFiles });
@@ -535,7 +541,7 @@ var getSpecificationFilesForService = (directory) => async (id, version) => {
535
541
  throw new Error(`Specification file name for ${fileName} is undefined`);
536
542
  }
537
543
  const rawFile = await getFileFromResource(directory, id, { fileName }, version);
538
- return { key, content: rawFile, fileName, path: (0, import_node_path6.join)((0, import_node_path6.dirname)(filePathToService), fileName) };
544
+ return { key, content: rawFile, fileName, path: (0, import_node_path7.join)((0, import_node_path7.dirname)(filePathToService), fileName) };
539
545
  });
540
546
  specs = await Promise.all(getSpecs);
541
547
  }
@@ -544,7 +550,7 @@ var getSpecificationFilesForService = (directory) => async (id, version) => {
544
550
  var addMessageToService = (directory) => async (id, direction, event, version) => {
545
551
  let service = await getService(directory)(id, version);
546
552
  const servicePath = await getResourcePath(directory, id, version);
547
- const extension = (0, import_node_path6.extname)(servicePath?.fullPath || "");
553
+ const extension = (0, import_node_path7.extname)(servicePath?.fullPath || "");
548
554
  if (direction === "sends") {
549
555
  if (service.sends === void 0) {
550
556
  service.sends = [];
@@ -572,8 +578,8 @@ var addMessageToService = (directory) => async (id, direction, event, version) =
572
578
  if (!existingResource) {
573
579
  throw new Error(`Cannot find service ${id} in the catalog`);
574
580
  }
575
- const path5 = existingResource.split(/[\\/]+services/)[0];
576
- const pathToResource = (0, import_node_path6.join)(path5, "services");
581
+ const path6 = existingResource.split(/[\\/]+services/)[0];
582
+ const pathToResource = (0, import_node_path7.join)(path6, "services");
577
583
  await rmServiceById(directory)(id, version);
578
584
  await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
579
585
  };
@@ -581,9 +587,9 @@ var serviceHasVersion = (directory) => async (id, version) => {
581
587
  const file = await findFileById(directory, id, version);
582
588
  return !!file;
583
589
  };
584
- var isService = (directory) => async (path5) => {
585
- const service = await getServiceByPath(directory)(path5);
586
- const relativePath = (0, import_node_path6.relative)(directory, path5);
590
+ var isService = (directory) => async (path6) => {
591
+ const service = await getServiceByPath(directory)(path6);
592
+ const relativePath = (0, import_node_path7.relative)(directory, path6);
587
593
  const segments = relativePath.split(/[/\\]+/);
588
594
  return !!service && segments.includes("services");
589
595
  };
@@ -591,7 +597,7 @@ var toService = (directory) => async (file) => toResource(directory, file);
591
597
  var addEntityToService = (directory) => async (id, entity, version) => {
592
598
  let service = await getService(directory)(id, version);
593
599
  const servicePath = await getResourcePath(directory, id, version);
594
- const extension = (0, import_node_path6.extname)(servicePath?.fullPath || "");
600
+ const extension = (0, import_node_path7.extname)(servicePath?.fullPath || "");
595
601
  if (service.entities === void 0) {
596
602
  service.entities = [];
597
603
  }
@@ -605,15 +611,15 @@ var addEntityToService = (directory) => async (id, entity, version) => {
605
611
  if (!existingResource) {
606
612
  throw new Error(`Cannot find service ${id} in the catalog`);
607
613
  }
608
- const path5 = existingResource.split(/[\\/]+services/)[0];
609
- const pathToResource = (0, import_node_path6.join)(path5, "services");
614
+ const path6 = existingResource.split(/[\\/]+services/)[0];
615
+ const pathToResource = (0, import_node_path7.join)(path6, "services");
610
616
  await rmServiceById(directory)(id, version);
611
617
  await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
612
618
  };
613
619
  var addDataStoreToService = (directory) => async (id, operation, dataStore, version) => {
614
620
  let service = await getService(directory)(id, version);
615
621
  const servicePath = await getResourcePath(directory, id, version);
616
- const extension = (0, import_node_path6.extname)(servicePath?.fullPath || "");
622
+ const extension = (0, import_node_path7.extname)(servicePath?.fullPath || "");
617
623
  if (operation === "writesTo") {
618
624
  if (service.writesTo === void 0) {
619
625
  service.writesTo = [];
@@ -641,15 +647,15 @@ var addDataStoreToService = (directory) => async (id, operation, dataStore, vers
641
647
  if (!existingResource) {
642
648
  throw new Error(`Cannot find service ${id} in the catalog`);
643
649
  }
644
- const path5 = existingResource.split(/[\\/]+services/)[0];
645
- const pathToResource = (0, import_node_path6.join)(path5, "services");
650
+ const path6 = existingResource.split(/[\\/]+services/)[0];
651
+ const pathToResource = (0, import_node_path7.join)(path6, "services");
646
652
  await rmServiceById(directory)(id, version);
647
653
  await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
648
654
  };
649
655
 
650
656
  // src/domains.ts
651
657
  var import_promises6 = __toESM(require("fs/promises"));
652
- var import_node_path7 = __toESM(require("path"));
658
+ var import_node_path8 = __toESM(require("path"));
653
659
  var import_node_fs3 = __toESM(require("fs"));
654
660
  var import_gray_matter3 = __toESM(require("gray-matter"));
655
661
  var getDomain = (directory) => async (id, version) => getResource(directory, id, version, { type: "domain" });
@@ -674,8 +680,8 @@ var writeDomain = (directory) => async (domain, options = {
674
680
  return await writeResource(directory, resource, { ...options, type: "domain" });
675
681
  };
676
682
  var versionDomain = (directory) => async (id) => versionResource(directory, id);
677
- var rmDomain = (directory) => async (path5) => {
678
- await import_promises6.default.rm((0, import_node_path7.join)(directory, path5), { recursive: true });
683
+ var rmDomain = (directory) => async (path6) => {
684
+ await import_promises6.default.rm((0, import_node_path8.join)(directory, path6), { recursive: true });
679
685
  };
680
686
  var rmDomainById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "domain", persistFiles });
681
687
  var addFileToDomain = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
@@ -687,7 +693,7 @@ var addUbiquitousLanguageToDomain = (directory) => async (id, ubiquitousLanguage
687
693
  };
688
694
  var getUbiquitousLanguageFromDomain = (directory) => async (id, version) => {
689
695
  const pathToDomain = await findFileById(directory, id, version) || "";
690
- const pathToUbiquitousLanguage = import_node_path7.default.join(import_node_path7.default.dirname(pathToDomain), "ubiquitous-language.mdx");
696
+ const pathToUbiquitousLanguage = import_node_path8.default.join(import_node_path8.default.dirname(pathToDomain), "ubiquitous-language.mdx");
691
697
  const fileExists = import_node_fs3.default.existsSync(pathToUbiquitousLanguage);
692
698
  if (!fileExists) {
693
699
  return void 0;
@@ -702,7 +708,7 @@ var domainHasVersion = (directory) => async (id, version) => {
702
708
  var addServiceToDomain = (directory) => async (id, service, version) => {
703
709
  let domain = await getDomain(directory)(id, version);
704
710
  const domainPath = await getResourcePath(directory, id, version);
705
- const extension = import_node_path7.default.extname(domainPath?.fullPath || "");
711
+ const extension = import_node_path8.default.extname(domainPath?.fullPath || "");
706
712
  if (domain.services === void 0) {
707
713
  domain.services = [];
708
714
  }
@@ -717,7 +723,7 @@ var addServiceToDomain = (directory) => async (id, service, version) => {
717
723
  var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
718
724
  let domain = await getDomain(directory)(id, version);
719
725
  const domainPath = await getResourcePath(directory, id, version);
720
- const extension = import_node_path7.default.extname(domainPath?.fullPath || "");
726
+ const extension = import_node_path8.default.extname(domainPath?.fullPath || "");
721
727
  if (domain.domains === void 0) {
722
728
  domain.domains = [];
723
729
  }
@@ -732,7 +738,7 @@ var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
732
738
  var addEntityToDomain = (directory) => async (id, entity, version) => {
733
739
  let domain = await getDomain(directory)(id, version);
734
740
  const domainPath = await getResourcePath(directory, id, version);
735
- const extension = import_node_path7.default.extname(domainPath?.fullPath || "");
741
+ const extension = import_node_path8.default.extname(domainPath?.fullPath || "");
736
742
  if (domain.entities === void 0) {
737
743
  domain.entities = [];
738
744
  }
@@ -747,12 +753,12 @@ var addEntityToDomain = (directory) => async (id, entity, version) => {
747
753
 
748
754
  // src/channels.ts
749
755
  var import_promises7 = __toESM(require("fs/promises"));
750
- var import_node_path8 = require("path");
756
+ var import_node_path9 = require("path");
751
757
  var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
752
758
  var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
753
759
  var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
754
- var rmChannel = (directory) => async (path5) => {
755
- await import_promises7.default.rm((0, import_node_path8.join)(directory, path5), { recursive: true });
760
+ var rmChannel = (directory) => async (path6) => {
761
+ await import_promises7.default.rm((0, import_node_path9.join)(directory, path6), { recursive: true });
756
762
  };
757
763
  var rmChannelById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "channel", persistFiles });
758
764
  var versionChannel = (directory) => async (id) => versionResource(directory, id);
@@ -782,7 +788,7 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
782
788
  const { getMessage, rmMessageById, writeMessage } = functions[collection];
783
789
  const message = await getMessage(directory)(_message.id, _message.version);
784
790
  const messagePath = await getResourcePath(directory, _message.id, _message.version);
785
- const extension = (0, import_node_path8.extname)(messagePath?.fullPath || "");
791
+ const extension = (0, import_node_path9.extname)(messagePath?.fullPath || "");
786
792
  if (!message) throw new Error(`Message ${_message.id} with version ${_message.version} not found`);
787
793
  if (message.channels === void 0) {
788
794
  message.channels = [];
@@ -793,18 +799,18 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
793
799
  if (!existingResource) {
794
800
  throw new Error(`Cannot find message ${id} in the catalog`);
795
801
  }
796
- const path5 = existingResource.split(`/[\\/]+${collection}`)[0];
797
- const pathToResource = (0, import_node_path8.join)(path5, collection);
802
+ const path6 = existingResource.split(`/[\\/]+${collection}`)[0];
803
+ const pathToResource = (0, import_node_path9.join)(path6, collection);
798
804
  await rmMessageById(directory)(_message.id, _message.version, true);
799
805
  await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
800
806
  };
801
807
 
802
808
  // src/messages.ts
803
- var import_node_path9 = require("path");
809
+ var import_node_path10 = require("path");
804
810
  var import_gray_matter4 = __toESM(require("gray-matter"));
805
811
  var import_semver3 = require("semver");
806
- var getMessageBySchemaPath = (directory) => async (path5, options) => {
807
- const pathToMessage = (0, import_node_path9.dirname)(path5);
812
+ var getMessageBySchemaPath = (directory) => async (path6, options) => {
813
+ const pathToMessage = (0, import_node_path10.dirname)(path6);
808
814
  try {
809
815
  const files = await getFiles(`${directory}/${pathToMessage}/index.{md,mdx}`);
810
816
  if (!files || files.length === 0) {
@@ -876,18 +882,18 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
876
882
  }
877
883
  return { producers, consumers };
878
884
  };
879
- var getConsumersOfSchema = (directory) => async (path5) => {
885
+ var getConsumersOfSchema = (directory) => async (path6) => {
880
886
  try {
881
- const message = await getMessageBySchemaPath(directory)(path5);
887
+ const message = await getMessageBySchemaPath(directory)(path6);
882
888
  const { consumers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
883
889
  return consumers;
884
890
  } catch (error) {
885
891
  return [];
886
892
  }
887
893
  };
888
- var getProducersOfSchema = (directory) => async (path5) => {
894
+ var getProducersOfSchema = (directory) => async (path6) => {
889
895
  try {
890
- const message = await getMessageBySchemaPath(directory)(path5);
896
+ const message = await getMessageBySchemaPath(directory)(path6);
891
897
  const { producers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
892
898
  return producers;
893
899
  } catch (error) {
@@ -896,13 +902,13 @@ var getProducersOfSchema = (directory) => async (path5) => {
896
902
  };
897
903
 
898
904
  // src/custom-docs.ts
899
- var import_node_path10 = __toESM(require("path"));
905
+ var import_node_path11 = __toESM(require("path"));
900
906
  var import_node_fs4 = __toESM(require("fs"));
901
907
  var import_promises8 = __toESM(require("fs/promises"));
902
908
  var import_gray_matter5 = __toESM(require("gray-matter"));
903
909
  var import_slugify = __toESM(require("slugify"));
904
910
  var getCustomDoc = (directory) => async (filePath) => {
905
- const fullPath = import_node_path10.default.join(directory, filePath);
911
+ const fullPath = import_node_path11.default.join(directory, filePath);
906
912
  const fullPathWithExtension = fullPath.endsWith(".mdx") ? fullPath : `${fullPath}.mdx`;
907
913
  const fileExists = import_node_fs4.default.existsSync(fullPathWithExtension);
908
914
  if (!fileExists) {
@@ -921,26 +927,26 @@ var writeCustomDoc = (directory) => async (customDoc, options = { path: "" }) =>
921
927
  const { fileName, ...rest } = customDoc;
922
928
  const name = fileName || (0, import_slugify.default)(customDoc.title, { lower: true });
923
929
  const withExtension = name.endsWith(".mdx") ? name : `${name}.mdx`;
924
- const fullPath = import_node_path10.default.join(directory, options.path || "", withExtension);
925
- import_node_fs4.default.mkdirSync(import_node_path10.default.dirname(fullPath), { recursive: true });
930
+ const fullPath = import_node_path11.default.join(directory, options.path || "", withExtension);
931
+ import_node_fs4.default.mkdirSync(import_node_path11.default.dirname(fullPath), { recursive: true });
926
932
  const document = import_gray_matter5.default.stringify(customDoc.markdown.trim(), rest);
927
933
  import_node_fs4.default.writeFileSync(fullPath, document);
928
934
  };
929
935
  var rmCustomDoc = (directory) => async (filePath) => {
930
936
  const withExtension = filePath.endsWith(".mdx") ? filePath : `${filePath}.mdx`;
931
- await import_promises8.default.rm((0, import_node_path10.join)(directory, withExtension), { recursive: true });
937
+ await import_promises8.default.rm((0, import_node_path11.join)(directory, withExtension), { recursive: true });
932
938
  };
933
939
 
934
940
  // src/teams.ts
935
941
  var import_promises9 = __toESM(require("fs/promises"));
936
942
  var import_node_fs6 = __toESM(require("fs"));
937
- var import_node_path12 = require("path");
943
+ var import_node_path13 = require("path");
938
944
  var import_gray_matter7 = __toESM(require("gray-matter"));
939
- var import_node_path13 = __toESM(require("path"));
945
+ var import_node_path14 = __toESM(require("path"));
940
946
 
941
947
  // src/users.ts
942
948
  var import_node_fs5 = __toESM(require("fs"));
943
- var import_node_path11 = require("path");
949
+ var import_node_path12 = require("path");
944
950
  var import_gray_matter6 = __toESM(require("gray-matter"));
945
951
  var getUser = (catalogDir) => async (id) => {
946
952
  const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);
@@ -978,11 +984,11 @@ var writeUser = (catalogDir) => async (user, options = {}) => {
978
984
  }
979
985
  const { markdown, ...frontmatter } = resource;
980
986
  const document = import_gray_matter6.default.stringify(markdown, frontmatter);
981
- import_node_fs5.default.mkdirSync((0, import_node_path11.join)(catalogDir, ""), { recursive: true });
982
- import_node_fs5.default.writeFileSync((0, import_node_path11.join)(catalogDir, "", `${resource.id}.mdx`), document);
987
+ import_node_fs5.default.mkdirSync((0, import_node_path12.join)(catalogDir, ""), { recursive: true });
988
+ import_node_fs5.default.writeFileSync((0, import_node_path12.join)(catalogDir, "", `${resource.id}.mdx`), document);
983
989
  };
984
990
  var rmUserById = (catalogDir) => async (id) => {
985
- import_node_fs5.default.rmSync((0, import_node_path11.join)(catalogDir, `${id}.mdx`), { recursive: true });
991
+ import_node_fs5.default.rmSync((0, import_node_path12.join)(catalogDir, `${id}.mdx`), { recursive: true });
986
992
  };
987
993
 
988
994
  // src/teams.ts
@@ -1020,11 +1026,11 @@ var writeTeam = (catalogDir) => async (team, options = {}) => {
1020
1026
  }
1021
1027
  const { markdown, ...frontmatter } = resource;
1022
1028
  const document = import_gray_matter7.default.stringify(markdown, frontmatter);
1023
- import_node_fs6.default.mkdirSync((0, import_node_path12.join)(catalogDir, ""), { recursive: true });
1024
- import_node_fs6.default.writeFileSync((0, import_node_path12.join)(catalogDir, "", `${resource.id}.mdx`), document);
1029
+ import_node_fs6.default.mkdirSync((0, import_node_path13.join)(catalogDir, ""), { recursive: true });
1030
+ import_node_fs6.default.writeFileSync((0, import_node_path13.join)(catalogDir, "", `${resource.id}.mdx`), document);
1025
1031
  };
1026
1032
  var rmTeamById = (catalogDir) => async (id) => {
1027
- await import_promises9.default.rm((0, import_node_path12.join)(catalogDir, `${id}.mdx`), { recursive: true });
1033
+ await import_promises9.default.rm((0, import_node_path13.join)(catalogDir, `${id}.mdx`), { recursive: true });
1028
1034
  };
1029
1035
  var getOwnersForResource = (catalogDir) => async (id, version) => {
1030
1036
  const resource = await getResource(catalogDir, id, version);
@@ -1032,11 +1038,11 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
1032
1038
  if (!resource) return [];
1033
1039
  if (!resource.owners) return [];
1034
1040
  for (const owner of resource.owners) {
1035
- const team = await getTeam(import_node_path13.default.join(catalogDir, "teams"))(owner);
1041
+ const team = await getTeam(import_node_path14.default.join(catalogDir, "teams"))(owner);
1036
1042
  if (team) {
1037
1043
  owners.push(team);
1038
1044
  } else {
1039
- const user = await getUser(import_node_path13.default.join(catalogDir, "users"))(owner);
1045
+ const user = await getUser(import_node_path14.default.join(catalogDir, "users"))(owner);
1040
1046
  if (user) {
1041
1047
  owners.push(user);
1042
1048
  }
@@ -1047,7 +1053,7 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
1047
1053
 
1048
1054
  // src/entities.ts
1049
1055
  var import_promises10 = __toESM(require("fs/promises"));
1050
- var import_node_path14 = require("path");
1056
+ var import_node_path15 = require("path");
1051
1057
  var getEntity = (directory) => async (id, version) => getResource(directory, id, version, { type: "entity" });
1052
1058
  var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
1053
1059
  var writeEntity = (directory) => async (entity, options = {
@@ -1055,8 +1061,8 @@ var writeEntity = (directory) => async (entity, options = {
1055
1061
  override: false,
1056
1062
  format: "mdx"
1057
1063
  }) => writeResource(directory, { ...entity }, { ...options, type: "entity" });
1058
- var rmEntity = (directory) => async (path5) => {
1059
- await import_promises10.default.rm((0, import_node_path14.join)(directory, path5), { recursive: true });
1064
+ var rmEntity = (directory) => async (path6) => {
1065
+ await import_promises10.default.rm((0, import_node_path15.join)(directory, path6), { recursive: true });
1060
1066
  };
1061
1067
  var rmEntityById = (directory) => async (id, version, persistFiles) => {
1062
1068
  await rmResourceById(directory, id, version, { type: "entity", persistFiles });
@@ -1069,7 +1075,7 @@ var entityHasVersion = (directory) => async (id, version) => {
1069
1075
 
1070
1076
  // src/containers.ts
1071
1077
  var import_promises11 = __toESM(require("fs/promises"));
1072
- var import_node_path15 = require("path");
1078
+ var import_node_path16 = require("path");
1073
1079
  var getContainer = (directory) => async (id, version) => getResource(directory, id, version, { type: "container" });
1074
1080
  var getContainers = (directory) => async (options) => getResources(directory, { type: "containers", latestOnly: options?.latestOnly });
1075
1081
  var writeContainer = (directory) => async (data, options = {
@@ -1078,8 +1084,8 @@ var writeContainer = (directory) => async (data, options = {
1078
1084
  format: "mdx"
1079
1085
  }) => writeResource(directory, { ...data }, { ...options, type: "container" });
1080
1086
  var versionContainer = (directory) => async (id) => versionResource(directory, id);
1081
- var rmContainer = (directory) => async (path5) => {
1082
- await import_promises11.default.rm((0, import_node_path15.join)(directory, path5), { recursive: true });
1087
+ var rmContainer = (directory) => async (path6) => {
1088
+ await import_promises11.default.rm((0, import_node_path16.join)(directory, path6), { recursive: true });
1083
1089
  };
1084
1090
  var rmContainerById = (directory) => async (id, version, persistFiles) => {
1085
1091
  await rmResourceById(directory, id, version, { type: "container", persistFiles });
@@ -1095,7 +1101,7 @@ var writeContainerToService = (directory) => async (container, service, options
1095
1101
  throw new Error("Service not found");
1096
1102
  }
1097
1103
  let pathForContainer = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/containers` : `${resourcePath.directory}/containers`;
1098
- pathForContainer = (0, import_node_path15.join)(pathForContainer, container.id);
1104
+ pathForContainer = (0, import_node_path16.join)(pathForContainer, container.id);
1099
1105
  await writeResource(directory, { ...container }, { ...options, path: pathForContainer, type: "container" });
1100
1106
  };
1101
1107
 
@@ -1111,7 +1117,7 @@ var addFileToDataStore = addFileToContainer;
1111
1117
  var writeDataStoreToService = writeContainerToService;
1112
1118
 
1113
1119
  // src/index.ts
1114
- var index_default = (path5) => {
1120
+ var index_default = (path6) => {
1115
1121
  return {
1116
1122
  /**
1117
1123
  * Returns an events from EventCatalog
@@ -1119,13 +1125,13 @@ var index_default = (path5) => {
1119
1125
  * @param version - Optional id of the version to get (supports semver)
1120
1126
  * @returns Event|Undefined
1121
1127
  */
1122
- getEvent: getEvent((0, import_node_path16.join)(path5)),
1128
+ getEvent: getEvent((0, import_node_path17.join)(path6)),
1123
1129
  /**
1124
1130
  * Returns all events from EventCatalog
1125
1131
  * @param latestOnly - optional boolean, set to true to get only latest versions
1126
1132
  * @returns Event[]|Undefined
1127
1133
  */
1128
- getEvents: getEvents((0, import_node_path16.join)(path5)),
1134
+ getEvents: getEvents((0, import_node_path17.join)(path6)),
1129
1135
  /**
1130
1136
  * Adds an event to EventCatalog
1131
1137
  *
@@ -1133,7 +1139,7 @@ var index_default = (path5) => {
1133
1139
  * @param options - Optional options to write the event
1134
1140
  *
1135
1141
  */
1136
- writeEvent: writeEvent((0, import_node_path16.join)(path5, "events")),
1142
+ writeEvent: writeEvent((0, import_node_path17.join)(path6, "events")),
1137
1143
  /**
1138
1144
  * Adds an event to a service in EventCatalog
1139
1145
  *
@@ -1142,26 +1148,26 @@ var index_default = (path5) => {
1142
1148
  * @param options - Optional options to write the event
1143
1149
  *
1144
1150
  */
1145
- writeEventToService: writeEventToService((0, import_node_path16.join)(path5)),
1151
+ writeEventToService: writeEventToService((0, import_node_path17.join)(path6)),
1146
1152
  /**
1147
1153
  * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
1148
1154
  *
1149
1155
  * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
1150
1156
  *
1151
1157
  */
1152
- rmEvent: rmEvent((0, import_node_path16.join)(path5, "events")),
1158
+ rmEvent: rmEvent((0, import_node_path17.join)(path6, "events")),
1153
1159
  /**
1154
1160
  * Remove an event by an Event id
1155
1161
  *
1156
1162
  * @param id - The id of the event you want to remove
1157
1163
  *
1158
1164
  */
1159
- rmEventById: rmEventById((0, import_node_path16.join)(path5)),
1165
+ rmEventById: rmEventById((0, import_node_path17.join)(path6)),
1160
1166
  /**
1161
1167
  * Moves a given event id to the version directory
1162
1168
  * @param directory
1163
1169
  */
1164
- versionEvent: versionEvent((0, import_node_path16.join)(path5)),
1170
+ versionEvent: versionEvent((0, import_node_path17.join)(path6)),
1165
1171
  /**
1166
1172
  * Adds a file to the given event
1167
1173
  * @param id - The id of the event to add the file to
@@ -1169,7 +1175,7 @@ var index_default = (path5) => {
1169
1175
  * @param version - Optional version of the event to add the file to
1170
1176
  * @returns
1171
1177
  */
1172
- addFileToEvent: addFileToEvent((0, import_node_path16.join)(path5)),
1178
+ addFileToEvent: addFileToEvent((0, import_node_path17.join)(path6)),
1173
1179
  /**
1174
1180
  * Adds a schema to the given event
1175
1181
  * @param id - The id of the event to add the schema to
@@ -1177,14 +1183,14 @@ var index_default = (path5) => {
1177
1183
  * @param version - Optional version of the event to add the schema to
1178
1184
  * @returns
1179
1185
  */
1180
- addSchemaToEvent: addSchemaToEvent((0, import_node_path16.join)(path5)),
1186
+ addSchemaToEvent: addSchemaToEvent((0, import_node_path17.join)(path6)),
1181
1187
  /**
1182
1188
  * Check to see if an event version exists
1183
1189
  * @param id - The id of the event
1184
1190
  * @param version - The version of the event (supports semver)
1185
1191
  * @returns
1186
1192
  */
1187
- eventHasVersion: eventHasVersion((0, import_node_path16.join)(path5)),
1193
+ eventHasVersion: eventHasVersion((0, import_node_path17.join)(path6)),
1188
1194
  /**
1189
1195
  * ================================
1190
1196
  * Commands
@@ -1196,13 +1202,13 @@ var index_default = (path5) => {
1196
1202
  * @param version - Optional id of the version to get (supports semver)
1197
1203
  * @returns Command|Undefined
1198
1204
  */
1199
- getCommand: getCommand((0, import_node_path16.join)(path5)),
1205
+ getCommand: getCommand((0, import_node_path17.join)(path6)),
1200
1206
  /**
1201
1207
  * Returns all commands from EventCatalog
1202
1208
  * @param latestOnly - optional boolean, set to true to get only latest versions
1203
1209
  * @returns Command[]|Undefined
1204
1210
  */
1205
- getCommands: getCommands((0, import_node_path16.join)(path5)),
1211
+ getCommands: getCommands((0, import_node_path17.join)(path6)),
1206
1212
  /**
1207
1213
  * Adds an command to EventCatalog
1208
1214
  *
@@ -1210,7 +1216,7 @@ var index_default = (path5) => {
1210
1216
  * @param options - Optional options to write the command
1211
1217
  *
1212
1218
  */
1213
- writeCommand: writeCommand((0, import_node_path16.join)(path5, "commands")),
1219
+ writeCommand: writeCommand((0, import_node_path17.join)(path6, "commands")),
1214
1220
  /**
1215
1221
  * Adds a command to a service in EventCatalog
1216
1222
  *
@@ -1219,26 +1225,26 @@ var index_default = (path5) => {
1219
1225
  * @param options - Optional options to write the command
1220
1226
  *
1221
1227
  */
1222
- writeCommandToService: writeCommandToService((0, import_node_path16.join)(path5)),
1228
+ writeCommandToService: writeCommandToService((0, import_node_path17.join)(path6)),
1223
1229
  /**
1224
1230
  * Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
1225
1231
  *
1226
1232
  * @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
1227
1233
  *
1228
1234
  */
1229
- rmCommand: rmCommand((0, import_node_path16.join)(path5, "commands")),
1235
+ rmCommand: rmCommand((0, import_node_path17.join)(path6, "commands")),
1230
1236
  /**
1231
1237
  * Remove an command by an Event id
1232
1238
  *
1233
1239
  * @param id - The id of the command you want to remove
1234
1240
  *
1235
1241
  */
1236
- rmCommandById: rmCommandById((0, import_node_path16.join)(path5)),
1242
+ rmCommandById: rmCommandById((0, import_node_path17.join)(path6)),
1237
1243
  /**
1238
1244
  * Moves a given command id to the version directory
1239
1245
  * @param directory
1240
1246
  */
1241
- versionCommand: versionCommand((0, import_node_path16.join)(path5)),
1247
+ versionCommand: versionCommand((0, import_node_path17.join)(path6)),
1242
1248
  /**
1243
1249
  * Adds a file to the given command
1244
1250
  * @param id - The id of the command to add the file to
@@ -1246,7 +1252,7 @@ var index_default = (path5) => {
1246
1252
  * @param version - Optional version of the command to add the file to
1247
1253
  * @returns
1248
1254
  */
1249
- addFileToCommand: addFileToCommand((0, import_node_path16.join)(path5)),
1255
+ addFileToCommand: addFileToCommand((0, import_node_path17.join)(path6)),
1250
1256
  /**
1251
1257
  * Adds a schema to the given command
1252
1258
  * @param id - The id of the command to add the schema to
@@ -1254,14 +1260,14 @@ var index_default = (path5) => {
1254
1260
  * @param version - Optional version of the command to add the schema to
1255
1261
  * @returns
1256
1262
  */
1257
- addSchemaToCommand: addSchemaToCommand((0, import_node_path16.join)(path5)),
1263
+ addSchemaToCommand: addSchemaToCommand((0, import_node_path17.join)(path6)),
1258
1264
  /**
1259
1265
  * Check to see if a command version exists
1260
1266
  * @param id - The id of the command
1261
1267
  * @param version - The version of the command (supports semver)
1262
1268
  * @returns
1263
1269
  */
1264
- commandHasVersion: commandHasVersion((0, import_node_path16.join)(path5)),
1270
+ commandHasVersion: commandHasVersion((0, import_node_path17.join)(path6)),
1265
1271
  /**
1266
1272
  * ================================
1267
1273
  * Queries
@@ -1273,13 +1279,13 @@ var index_default = (path5) => {
1273
1279
  * @param version - Optional id of the version to get (supports semver)
1274
1280
  * @returns Query|Undefined
1275
1281
  */
1276
- getQuery: getQuery((0, import_node_path16.join)(path5)),
1282
+ getQuery: getQuery((0, import_node_path17.join)(path6)),
1277
1283
  /**
1278
1284
  * Returns all queries from EventCatalog
1279
1285
  * @param latestOnly - optional boolean, set to true to get only latest versions
1280
1286
  * @returns Query[]|Undefined
1281
1287
  */
1282
- getQueries: getQueries((0, import_node_path16.join)(path5)),
1288
+ getQueries: getQueries((0, import_node_path17.join)(path6)),
1283
1289
  /**
1284
1290
  * Adds a query to EventCatalog
1285
1291
  *
@@ -1287,7 +1293,7 @@ var index_default = (path5) => {
1287
1293
  * @param options - Optional options to write the event
1288
1294
  *
1289
1295
  */
1290
- writeQuery: writeQuery((0, import_node_path16.join)(path5, "queries")),
1296
+ writeQuery: writeQuery((0, import_node_path17.join)(path6, "queries")),
1291
1297
  /**
1292
1298
  * Adds a query to a service in EventCatalog
1293
1299
  *
@@ -1296,26 +1302,26 @@ var index_default = (path5) => {
1296
1302
  * @param options - Optional options to write the query
1297
1303
  *
1298
1304
  */
1299
- writeQueryToService: writeQueryToService((0, import_node_path16.join)(path5)),
1305
+ writeQueryToService: writeQueryToService((0, import_node_path17.join)(path6)),
1300
1306
  /**
1301
1307
  * Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
1302
1308
  *
1303
1309
  * @param path - The path to your query, e.g. `/Orders/GetOrder`
1304
1310
  *
1305
1311
  */
1306
- rmQuery: rmQuery((0, import_node_path16.join)(path5, "queries")),
1312
+ rmQuery: rmQuery((0, import_node_path17.join)(path6, "queries")),
1307
1313
  /**
1308
1314
  * Remove a query by a Query id
1309
1315
  *
1310
1316
  * @param id - The id of the query you want to remove
1311
1317
  *
1312
1318
  */
1313
- rmQueryById: rmQueryById((0, import_node_path16.join)(path5)),
1319
+ rmQueryById: rmQueryById((0, import_node_path17.join)(path6)),
1314
1320
  /**
1315
1321
  * Moves a given query id to the version directory
1316
1322
  * @param directory
1317
1323
  */
1318
- versionQuery: versionQuery((0, import_node_path16.join)(path5)),
1324
+ versionQuery: versionQuery((0, import_node_path17.join)(path6)),
1319
1325
  /**
1320
1326
  * Adds a file to the given query
1321
1327
  * @param id - The id of the query to add the file to
@@ -1323,7 +1329,7 @@ var index_default = (path5) => {
1323
1329
  * @param version - Optional version of the query to add the file to
1324
1330
  * @returns
1325
1331
  */
1326
- addFileToQuery: addFileToQuery((0, import_node_path16.join)(path5)),
1332
+ addFileToQuery: addFileToQuery((0, import_node_path17.join)(path6)),
1327
1333
  /**
1328
1334
  * Adds a schema to the given query
1329
1335
  * @param id - The id of the query to add the schema to
@@ -1331,14 +1337,14 @@ var index_default = (path5) => {
1331
1337
  * @param version - Optional version of the query to add the schema to
1332
1338
  * @returns
1333
1339
  */
1334
- addSchemaToQuery: addSchemaToQuery((0, import_node_path16.join)(path5)),
1340
+ addSchemaToQuery: addSchemaToQuery((0, import_node_path17.join)(path6)),
1335
1341
  /**
1336
1342
  * Check to see if an query version exists
1337
1343
  * @param id - The id of the query
1338
1344
  * @param version - The version of the query (supports semver)
1339
1345
  * @returns
1340
1346
  */
1341
- queryHasVersion: queryHasVersion((0, import_node_path16.join)(path5)),
1347
+ queryHasVersion: queryHasVersion((0, import_node_path17.join)(path6)),
1342
1348
  /**
1343
1349
  * ================================
1344
1350
  * Channels
@@ -1350,13 +1356,13 @@ var index_default = (path5) => {
1350
1356
  * @param version - Optional id of the version to get (supports semver)
1351
1357
  * @returns Channel|Undefined
1352
1358
  */
1353
- getChannel: getChannel((0, import_node_path16.join)(path5)),
1359
+ getChannel: getChannel((0, import_node_path17.join)(path6)),
1354
1360
  /**
1355
1361
  * Returns all channels from EventCatalog
1356
1362
  * @param latestOnly - optional boolean, set to true to get only latest versions
1357
1363
  * @returns Channel[]|Undefined
1358
1364
  */
1359
- getChannels: getChannels((0, import_node_path16.join)(path5)),
1365
+ getChannels: getChannels((0, import_node_path17.join)(path6)),
1360
1366
  /**
1361
1367
  * Adds an channel to EventCatalog
1362
1368
  *
@@ -1364,33 +1370,33 @@ var index_default = (path5) => {
1364
1370
  * @param options - Optional options to write the channel
1365
1371
  *
1366
1372
  */
1367
- writeChannel: writeChannel((0, import_node_path16.join)(path5, "channels")),
1373
+ writeChannel: writeChannel((0, import_node_path17.join)(path6, "channels")),
1368
1374
  /**
1369
1375
  * Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
1370
1376
  *
1371
1377
  * @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
1372
1378
  *
1373
1379
  */
1374
- rmChannel: rmChannel((0, import_node_path16.join)(path5, "channels")),
1380
+ rmChannel: rmChannel((0, import_node_path17.join)(path6, "channels")),
1375
1381
  /**
1376
1382
  * Remove an channel by an Event id
1377
1383
  *
1378
1384
  * @param id - The id of the channel you want to remove
1379
1385
  *
1380
1386
  */
1381
- rmChannelById: rmChannelById((0, import_node_path16.join)(path5)),
1387
+ rmChannelById: rmChannelById((0, import_node_path17.join)(path6)),
1382
1388
  /**
1383
1389
  * Moves a given channel id to the version directory
1384
1390
  * @param directory
1385
1391
  */
1386
- versionChannel: versionChannel((0, import_node_path16.join)(path5)),
1392
+ versionChannel: versionChannel((0, import_node_path17.join)(path6)),
1387
1393
  /**
1388
1394
  * Check to see if a channel version exists
1389
1395
  * @param id - The id of the channel
1390
1396
  * @param version - The version of the channel (supports semver)
1391
1397
  * @returns
1392
1398
  */
1393
- channelHasVersion: channelHasVersion((0, import_node_path16.join)(path5)),
1399
+ channelHasVersion: channelHasVersion((0, import_node_path17.join)(path6)),
1394
1400
  /**
1395
1401
  * Add a channel to an event
1396
1402
  *
@@ -1407,7 +1413,7 @@ var index_default = (path5) => {
1407
1413
  *
1408
1414
  * ```
1409
1415
  */
1410
- addEventToChannel: addMessageToChannel((0, import_node_path16.join)(path5), "events"),
1416
+ addEventToChannel: addMessageToChannel((0, import_node_path17.join)(path6), "events"),
1411
1417
  /**
1412
1418
  * Add a channel to an command
1413
1419
  *
@@ -1424,7 +1430,7 @@ var index_default = (path5) => {
1424
1430
  *
1425
1431
  * ```
1426
1432
  */
1427
- addCommandToChannel: addMessageToChannel((0, import_node_path16.join)(path5), "commands"),
1433
+ addCommandToChannel: addMessageToChannel((0, import_node_path17.join)(path6), "commands"),
1428
1434
  /**
1429
1435
  * Add a channel to an query
1430
1436
  *
@@ -1441,7 +1447,7 @@ var index_default = (path5) => {
1441
1447
  *
1442
1448
  * ```
1443
1449
  */
1444
- addQueryToChannel: addMessageToChannel((0, import_node_path16.join)(path5), "queries"),
1450
+ addQueryToChannel: addMessageToChannel((0, import_node_path17.join)(path6), "queries"),
1445
1451
  /**
1446
1452
  * ================================
1447
1453
  * SERVICES
@@ -1454,14 +1460,14 @@ var index_default = (path5) => {
1454
1460
  * @param options - Optional options to write the event
1455
1461
  *
1456
1462
  */
1457
- writeService: writeService((0, import_node_path16.join)(path5, "services")),
1463
+ writeService: writeService((0, import_node_path17.join)(path6, "services")),
1458
1464
  /**
1459
1465
  * Adds a versioned service to EventCatalog
1460
1466
  *
1461
1467
  * @param service - The service to write
1462
1468
  *
1463
1469
  */
1464
- writeVersionedService: writeVersionedService((0, import_node_path16.join)(path5, "services")),
1470
+ writeVersionedService: writeVersionedService((0, import_node_path17.join)(path6, "services")),
1465
1471
  /**
1466
1472
  * Adds a service to a domain in EventCatalog
1467
1473
  *
@@ -1470,45 +1476,45 @@ var index_default = (path5) => {
1470
1476
  * @param options - Optional options to write the event
1471
1477
  *
1472
1478
  */
1473
- writeServiceToDomain: writeServiceToDomain((0, import_node_path16.join)(path5, "domains")),
1479
+ writeServiceToDomain: writeServiceToDomain((0, import_node_path17.join)(path6, "domains")),
1474
1480
  /**
1475
1481
  * Returns a service from EventCatalog
1476
1482
  * @param id - The id of the service to retrieve
1477
1483
  * @param version - Optional id of the version to get (supports semver)
1478
1484
  * @returns Service|Undefined
1479
1485
  */
1480
- getService: getService((0, import_node_path16.join)(path5)),
1486
+ getService: getService((0, import_node_path17.join)(path6)),
1481
1487
  /**
1482
1488
  * Returns a service from EventCatalog by it's path.
1483
1489
  * @param path - The path to the service to retrieve
1484
1490
  * @returns Service|Undefined
1485
1491
  */
1486
- getServiceByPath: getServiceByPath((0, import_node_path16.join)(path5)),
1492
+ getServiceByPath: getServiceByPath((0, import_node_path17.join)(path6)),
1487
1493
  /**
1488
1494
  * Returns all services from EventCatalog
1489
1495
  * @param latestOnly - optional boolean, set to true to get only latest versions
1490
1496
  * @returns Service[]|Undefined
1491
1497
  */
1492
- getServices: getServices((0, import_node_path16.join)(path5)),
1498
+ getServices: getServices((0, import_node_path17.join)(path6)),
1493
1499
  /**
1494
1500
  * Moves a given service id to the version directory
1495
1501
  * @param directory
1496
1502
  */
1497
- versionService: versionService((0, import_node_path16.join)(path5)),
1503
+ versionService: versionService((0, import_node_path17.join)(path6)),
1498
1504
  /**
1499
1505
  * Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
1500
1506
  *
1501
1507
  * @param path - The path to your service, e.g. `/InventoryService`
1502
1508
  *
1503
1509
  */
1504
- rmService: rmService((0, import_node_path16.join)(path5, "services")),
1510
+ rmService: rmService((0, import_node_path17.join)(path6, "services")),
1505
1511
  /**
1506
1512
  * Remove an service by an service id
1507
1513
  *
1508
1514
  * @param id - The id of the service you want to remove
1509
1515
  *
1510
1516
  */
1511
- rmServiceById: rmServiceById((0, import_node_path16.join)(path5)),
1517
+ rmServiceById: rmServiceById((0, import_node_path17.join)(path6)),
1512
1518
  /**
1513
1519
  * Adds a file to the given service
1514
1520
  * @param id - The id of the service to add the file to
@@ -1516,21 +1522,21 @@ var index_default = (path5) => {
1516
1522
  * @param version - Optional version of the service to add the file to
1517
1523
  * @returns
1518
1524
  */
1519
- addFileToService: addFileToService((0, import_node_path16.join)(path5)),
1525
+ addFileToService: addFileToService((0, import_node_path17.join)(path6)),
1520
1526
  /**
1521
1527
  * Returns the specifications for a given service
1522
1528
  * @param id - The id of the service to retrieve the specifications for
1523
1529
  * @param version - Optional version of the service
1524
1530
  * @returns
1525
1531
  */
1526
- getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path16.join)(path5)),
1532
+ getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path17.join)(path6)),
1527
1533
  /**
1528
1534
  * Check to see if a service version exists
1529
1535
  * @param id - The id of the service
1530
1536
  * @param version - The version of the service (supports semver)
1531
1537
  * @returns
1532
1538
  */
1533
- serviceHasVersion: serviceHasVersion((0, import_node_path16.join)(path5)),
1539
+ serviceHasVersion: serviceHasVersion((0, import_node_path17.join)(path6)),
1534
1540
  /**
1535
1541
  * Add an event to a service by it's id.
1536
1542
  *
@@ -1550,7 +1556,7 @@ var index_default = (path5) => {
1550
1556
  *
1551
1557
  * ```
1552
1558
  */
1553
- addEventToService: addMessageToService((0, import_node_path16.join)(path5)),
1559
+ addEventToService: addMessageToService((0, import_node_path17.join)(path6)),
1554
1560
  /**
1555
1561
  * Add a data store to a service by it's id.
1556
1562
  *
@@ -1567,7 +1573,7 @@ var index_default = (path5) => {
1567
1573
  *
1568
1574
  * ```
1569
1575
  */
1570
- addDataStoreToService: addDataStoreToService((0, import_node_path16.join)(path5)),
1576
+ addDataStoreToService: addDataStoreToService((0, import_node_path17.join)(path6)),
1571
1577
  /**
1572
1578
  * Add a command to a service by it's id.
1573
1579
  *
@@ -1587,7 +1593,7 @@ var index_default = (path5) => {
1587
1593
  *
1588
1594
  * ```
1589
1595
  */
1590
- addCommandToService: addMessageToService((0, import_node_path16.join)(path5)),
1596
+ addCommandToService: addMessageToService((0, import_node_path17.join)(path6)),
1591
1597
  /**
1592
1598
  * Add a query to a service by it's id.
1593
1599
  *
@@ -1607,7 +1613,7 @@ var index_default = (path5) => {
1607
1613
  *
1608
1614
  * ```
1609
1615
  */
1610
- addQueryToService: addMessageToService((0, import_node_path16.join)(path5)),
1616
+ addQueryToService: addMessageToService((0, import_node_path17.join)(path6)),
1611
1617
  /**
1612
1618
  * Add an entity to a service by its id.
1613
1619
  *
@@ -1625,7 +1631,7 @@ var index_default = (path5) => {
1625
1631
  *
1626
1632
  * ```
1627
1633
  */
1628
- addEntityToService: addEntityToService((0, import_node_path16.join)(path5)),
1634
+ addEntityToService: addEntityToService((0, import_node_path17.join)(path6)),
1629
1635
  /**
1630
1636
  * Check to see if a service exists by it's path.
1631
1637
  *
@@ -1642,13 +1648,13 @@ var index_default = (path5) => {
1642
1648
  * @param path - The path to the service to check
1643
1649
  * @returns boolean
1644
1650
  */
1645
- isService: isService((0, import_node_path16.join)(path5)),
1651
+ isService: isService((0, import_node_path17.join)(path6)),
1646
1652
  /**
1647
1653
  * Converts a file to a service.
1648
1654
  * @param file - The file to convert to a service.
1649
1655
  * @returns The service.
1650
1656
  */
1651
- toService: toService((0, import_node_path16.join)(path5)),
1657
+ toService: toService((0, import_node_path17.join)(path6)),
1652
1658
  /**
1653
1659
  * ================================
1654
1660
  * Domains
@@ -1661,39 +1667,39 @@ var index_default = (path5) => {
1661
1667
  * @param options - Optional options to write the event
1662
1668
  *
1663
1669
  */
1664
- writeDomain: writeDomain((0, import_node_path16.join)(path5, "domains")),
1670
+ writeDomain: writeDomain((0, import_node_path17.join)(path6, "domains")),
1665
1671
  /**
1666
1672
  * Returns a domain from EventCatalog
1667
1673
  * @param id - The id of the domain to retrieve
1668
1674
  * @param version - Optional id of the version to get (supports semver)
1669
1675
  * @returns Domain|Undefined
1670
1676
  */
1671
- getDomain: getDomain((0, import_node_path16.join)(path5, "domains")),
1677
+ getDomain: getDomain((0, import_node_path17.join)(path6, "domains")),
1672
1678
  /**
1673
1679
  * Returns all domains from EventCatalog
1674
1680
  * @param latestOnly - optional boolean, set to true to get only latest versions
1675
1681
  * @returns Domain[]|Undefined
1676
1682
  */
1677
- getDomains: getDomains((0, import_node_path16.join)(path5)),
1683
+ getDomains: getDomains((0, import_node_path17.join)(path6)),
1678
1684
  /**
1679
1685
  * Moves a given domain id to the version directory
1680
1686
  * @param directory
1681
1687
  */
1682
- versionDomain: versionDomain((0, import_node_path16.join)(path5, "domains")),
1688
+ versionDomain: versionDomain((0, import_node_path17.join)(path6, "domains")),
1683
1689
  /**
1684
1690
  * Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
1685
1691
  *
1686
1692
  * @param path - The path to your domain, e.g. `/Payment`
1687
1693
  *
1688
1694
  */
1689
- rmDomain: rmDomain((0, import_node_path16.join)(path5, "domains")),
1695
+ rmDomain: rmDomain((0, import_node_path17.join)(path6, "domains")),
1690
1696
  /**
1691
1697
  * Remove an service by an domain id
1692
1698
  *
1693
1699
  * @param id - The id of the domain you want to remove
1694
1700
  *
1695
1701
  */
1696
- rmDomainById: rmDomainById((0, import_node_path16.join)(path5, "domains")),
1702
+ rmDomainById: rmDomainById((0, import_node_path17.join)(path6, "domains")),
1697
1703
  /**
1698
1704
  * Adds a file to the given domain
1699
1705
  * @param id - The id of the domain to add the file to
@@ -1701,28 +1707,28 @@ var index_default = (path5) => {
1701
1707
  * @param version - Optional version of the domain to add the file to
1702
1708
  * @returns
1703
1709
  */
1704
- addFileToDomain: addFileToDomain((0, import_node_path16.join)(path5, "domains")),
1710
+ addFileToDomain: addFileToDomain((0, import_node_path17.join)(path6, "domains")),
1705
1711
  /**
1706
1712
  * Adds an ubiquitous language dictionary to a domain
1707
1713
  * @param id - The id of the domain to add the ubiquitous language to
1708
1714
  * @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
1709
1715
  * @param version - Optional version of the domain to add the ubiquitous language to
1710
1716
  */
1711
- addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path16.join)(path5, "domains")),
1717
+ addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path17.join)(path6, "domains")),
1712
1718
  /**
1713
1719
  * Get the ubiquitous language dictionary from a domain
1714
1720
  * @param id - The id of the domain to get the ubiquitous language from
1715
1721
  * @param version - Optional version of the domain to get the ubiquitous language from
1716
1722
  * @returns
1717
1723
  */
1718
- getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path16.join)(path5, "domains")),
1724
+ getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path17.join)(path6, "domains")),
1719
1725
  /**
1720
1726
  * Check to see if a domain version exists
1721
1727
  * @param id - The id of the domain
1722
1728
  * @param version - The version of the domain (supports semver)
1723
1729
  * @returns
1724
1730
  */
1725
- domainHasVersion: domainHasVersion((0, import_node_path16.join)(path5)),
1731
+ domainHasVersion: domainHasVersion((0, import_node_path17.join)(path6)),
1726
1732
  /**
1727
1733
  * Adds a given service to a domain
1728
1734
  * @param id - The id of the domain
@@ -1730,7 +1736,7 @@ var index_default = (path5) => {
1730
1736
  * @param version - (Optional) The version of the domain to add the service to
1731
1737
  * @returns
1732
1738
  */
1733
- addServiceToDomain: addServiceToDomain((0, import_node_path16.join)(path5, "domains")),
1739
+ addServiceToDomain: addServiceToDomain((0, import_node_path17.join)(path6, "domains")),
1734
1740
  /**
1735
1741
  * Adds a given subdomain to a domain
1736
1742
  * @param id - The id of the domain
@@ -1738,7 +1744,7 @@ var index_default = (path5) => {
1738
1744
  * @param version - (Optional) The version of the domain to add the subdomain to
1739
1745
  * @returns
1740
1746
  */
1741
- addSubDomainToDomain: addSubDomainToDomain((0, import_node_path16.join)(path5, "domains")),
1747
+ addSubDomainToDomain: addSubDomainToDomain((0, import_node_path17.join)(path6, "domains")),
1742
1748
  /**
1743
1749
  * Adds an entity to a domain
1744
1750
  * @param id - The id of the domain
@@ -1746,7 +1752,7 @@ var index_default = (path5) => {
1746
1752
  * @param version - (Optional) The version of the domain to add the entity to
1747
1753
  * @returns
1748
1754
  */
1749
- addEntityToDomain: addEntityToDomain((0, import_node_path16.join)(path5, "domains")),
1755
+ addEntityToDomain: addEntityToDomain((0, import_node_path17.join)(path6, "domains")),
1750
1756
  /**
1751
1757
  * ================================
1752
1758
  * Teams
@@ -1759,25 +1765,25 @@ var index_default = (path5) => {
1759
1765
  * @param options - Optional options to write the team
1760
1766
  *
1761
1767
  */
1762
- writeTeam: writeTeam((0, import_node_path16.join)(path5, "teams")),
1768
+ writeTeam: writeTeam((0, import_node_path17.join)(path6, "teams")),
1763
1769
  /**
1764
1770
  * Returns a team from EventCatalog
1765
1771
  * @param id - The id of the team to retrieve
1766
1772
  * @returns Team|Undefined
1767
1773
  */
1768
- getTeam: getTeam((0, import_node_path16.join)(path5, "teams")),
1774
+ getTeam: getTeam((0, import_node_path17.join)(path6, "teams")),
1769
1775
  /**
1770
1776
  * Returns all teams from EventCatalog
1771
1777
  * @returns Team[]|Undefined
1772
1778
  */
1773
- getTeams: getTeams((0, import_node_path16.join)(path5, "teams")),
1779
+ getTeams: getTeams((0, import_node_path17.join)(path6, "teams")),
1774
1780
  /**
1775
1781
  * Remove a team by the team id
1776
1782
  *
1777
1783
  * @param id - The id of the team you want to remove
1778
1784
  *
1779
1785
  */
1780
- rmTeamById: rmTeamById((0, import_node_path16.join)(path5, "teams")),
1786
+ rmTeamById: rmTeamById((0, import_node_path17.join)(path6, "teams")),
1781
1787
  /**
1782
1788
  * ================================
1783
1789
  * Users
@@ -1790,25 +1796,25 @@ var index_default = (path5) => {
1790
1796
  * @param options - Optional options to write the user
1791
1797
  *
1792
1798
  */
1793
- writeUser: writeUser((0, import_node_path16.join)(path5, "users")),
1799
+ writeUser: writeUser((0, import_node_path17.join)(path6, "users")),
1794
1800
  /**
1795
1801
  * Returns a user from EventCatalog
1796
1802
  * @param id - The id of the user to retrieve
1797
1803
  * @returns User|Undefined
1798
1804
  */
1799
- getUser: getUser((0, import_node_path16.join)(path5, "users")),
1805
+ getUser: getUser((0, import_node_path17.join)(path6, "users")),
1800
1806
  /**
1801
1807
  * Returns all user from EventCatalog
1802
1808
  * @returns User[]|Undefined
1803
1809
  */
1804
- getUsers: getUsers((0, import_node_path16.join)(path5)),
1810
+ getUsers: getUsers((0, import_node_path17.join)(path6)),
1805
1811
  /**
1806
1812
  * Remove a user by the user id
1807
1813
  *
1808
1814
  * @param id - The id of the user you want to remove
1809
1815
  *
1810
1816
  */
1811
- rmUserById: rmUserById((0, import_node_path16.join)(path5, "users")),
1817
+ rmUserById: rmUserById((0, import_node_path17.join)(path6, "users")),
1812
1818
  /**
1813
1819
  * ================================
1814
1820
  * Custom Docs
@@ -1819,32 +1825,32 @@ var index_default = (path5) => {
1819
1825
  * @param path - The path to the custom doc to retrieve
1820
1826
  * @returns CustomDoc|Undefined
1821
1827
  */
1822
- getCustomDoc: getCustomDoc((0, import_node_path16.join)(path5, "docs")),
1828
+ getCustomDoc: getCustomDoc((0, import_node_path17.join)(path6, "docs")),
1823
1829
  /**
1824
1830
  * Returns all custom docs from EventCatalog
1825
1831
  * @param options - Optional options to get custom docs from a specific path
1826
1832
  * @returns CustomDoc[]|Undefined
1827
1833
  */
1828
- getCustomDocs: getCustomDocs((0, import_node_path16.join)(path5, "docs")),
1834
+ getCustomDocs: getCustomDocs((0, import_node_path17.join)(path6, "docs")),
1829
1835
  /**
1830
1836
  * Writes a custom doc to EventCatalog
1831
1837
  * @param customDoc - The custom doc to write
1832
1838
  * @param options - Optional options to write the custom doc
1833
1839
  *
1834
1840
  */
1835
- writeCustomDoc: writeCustomDoc((0, import_node_path16.join)(path5, "docs")),
1841
+ writeCustomDoc: writeCustomDoc((0, import_node_path17.join)(path6, "docs")),
1836
1842
  /**
1837
1843
  * Removes a custom doc from EventCatalog
1838
1844
  * @param path - The path to the custom doc to remove
1839
1845
  *
1840
1846
  */
1841
- rmCustomDoc: rmCustomDoc((0, import_node_path16.join)(path5, "docs")),
1847
+ rmCustomDoc: rmCustomDoc((0, import_node_path17.join)(path6, "docs")),
1842
1848
  /**
1843
1849
  * Dumps the catalog to a JSON file.
1844
1850
  * @param directory - The directory to dump the catalog to
1845
1851
  * @returns A JSON file with the catalog
1846
1852
  */
1847
- dumpCatalog: dumpCatalog((0, import_node_path16.join)(path5)),
1853
+ dumpCatalog: dumpCatalog((0, import_node_path17.join)(path6)),
1848
1854
  /**
1849
1855
  * Returns the event catalog configuration file.
1850
1856
  * The event catalog configuration file is the file that contains the configuration for the event catalog.
@@ -1852,7 +1858,7 @@ var index_default = (path5) => {
1852
1858
  * @param directory - The directory of the catalog.
1853
1859
  * @returns A JSON object with the configuration for the event catalog.
1854
1860
  */
1855
- getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path16.join)(path5)),
1861
+ getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path17.join)(path6)),
1856
1862
  /**
1857
1863
  * ================================
1858
1864
  * Resources Utils
@@ -1862,6 +1868,10 @@ var index_default = (path5) => {
1862
1868
  * Returns the path to a given resource by id and version
1863
1869
  */
1864
1870
  getResourcePath,
1871
+ /**
1872
+ * Returns the folder name of a given resource
1873
+ */
1874
+ getResourceFolderName,
1865
1875
  /**
1866
1876
  * ================================
1867
1877
  * General Message Utils
@@ -1873,33 +1883,33 @@ var index_default = (path5) => {
1873
1883
  * @param path - The path to the message to retrieve
1874
1884
  * @returns Message|Undefined
1875
1885
  */
1876
- getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path16.join)(path5)),
1886
+ getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path17.join)(path6)),
1877
1887
  /**
1878
1888
  * Returns the producers and consumers (services) for a given message
1879
1889
  * @param id - The id of the message to get the producers and consumers for
1880
1890
  * @param version - Optional version of the message
1881
1891
  * @returns { producers: Service[], consumers: Service[] }
1882
1892
  */
1883
- getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path16.join)(path5)),
1893
+ getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path17.join)(path6)),
1884
1894
  /**
1885
1895
  * Returns the consumers of a given schema path
1886
1896
  * @param path - The path to the schema to get the consumers for
1887
1897
  * @returns Service[]
1888
1898
  */
1889
- getConsumersOfSchema: getConsumersOfSchema((0, import_node_path16.join)(path5)),
1899
+ getConsumersOfSchema: getConsumersOfSchema((0, import_node_path17.join)(path6)),
1890
1900
  /**
1891
1901
  * Returns the producers of a given schema path
1892
1902
  * @param path - The path to the schema to get the producers for
1893
1903
  * @returns Service[]
1894
1904
  */
1895
- getProducersOfSchema: getProducersOfSchema((0, import_node_path16.join)(path5)),
1905
+ getProducersOfSchema: getProducersOfSchema((0, import_node_path17.join)(path6)),
1896
1906
  /**
1897
1907
  * Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
1898
1908
  * @param id - The id of the resource to get the owners for
1899
1909
  * @param version - Optional version of the resource
1900
1910
  * @returns { owners: User[] }
1901
1911
  */
1902
- getOwnersForResource: getOwnersForResource((0, import_node_path16.join)(path5)),
1912
+ getOwnersForResource: getOwnersForResource((0, import_node_path17.join)(path6)),
1903
1913
  /**
1904
1914
  * ================================
1905
1915
  * Entities
@@ -1911,13 +1921,13 @@ var index_default = (path5) => {
1911
1921
  * @param version - Optional id of the version to get (supports semver)
1912
1922
  * @returns Entity|Undefined
1913
1923
  */
1914
- getEntity: getEntity((0, import_node_path16.join)(path5)),
1924
+ getEntity: getEntity((0, import_node_path17.join)(path6)),
1915
1925
  /**
1916
1926
  * Returns all entities from EventCatalog
1917
1927
  * @param latestOnly - optional boolean, set to true to get only latest versions
1918
1928
  * @returns Entity[]|Undefined
1919
1929
  */
1920
- getEntities: getEntities((0, import_node_path16.join)(path5)),
1930
+ getEntities: getEntities((0, import_node_path17.join)(path6)),
1921
1931
  /**
1922
1932
  * Adds an entity to EventCatalog
1923
1933
  *
@@ -1925,33 +1935,33 @@ var index_default = (path5) => {
1925
1935
  * @param options - Optional options to write the entity
1926
1936
  *
1927
1937
  */
1928
- writeEntity: writeEntity((0, import_node_path16.join)(path5, "entities")),
1938
+ writeEntity: writeEntity((0, import_node_path17.join)(path6, "entities")),
1929
1939
  /**
1930
1940
  * Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
1931
1941
  *
1932
1942
  * @param path - The path to your entity, e.g. `/User`
1933
1943
  *
1934
1944
  */
1935
- rmEntity: rmEntity((0, import_node_path16.join)(path5, "entities")),
1945
+ rmEntity: rmEntity((0, import_node_path17.join)(path6, "entities")),
1936
1946
  /**
1937
1947
  * Remove an entity by an entity id
1938
1948
  *
1939
1949
  * @param id - The id of the entity you want to remove
1940
1950
  *
1941
1951
  */
1942
- rmEntityById: rmEntityById((0, import_node_path16.join)(path5)),
1952
+ rmEntityById: rmEntityById((0, import_node_path17.join)(path6)),
1943
1953
  /**
1944
1954
  * Moves a given entity id to the version directory
1945
1955
  * @param id - The id of the entity to version
1946
1956
  */
1947
- versionEntity: versionEntity((0, import_node_path16.join)(path5)),
1957
+ versionEntity: versionEntity((0, import_node_path17.join)(path6)),
1948
1958
  /**
1949
1959
  * Check to see if an entity version exists
1950
1960
  * @param id - The id of the entity
1951
1961
  * @param version - The version of the entity (supports semver)
1952
1962
  * @returns
1953
1963
  */
1954
- entityHasVersion: entityHasVersion((0, import_node_path16.join)(path5)),
1964
+ entityHasVersion: entityHasVersion((0, import_node_path17.join)(path6)),
1955
1965
  /**
1956
1966
  * ================================
1957
1967
  * Data Stores
@@ -1963,42 +1973,42 @@ var index_default = (path5) => {
1963
1973
  * @param options - Optional options to write the data store
1964
1974
  *
1965
1975
  */
1966
- writeDataStore: writeDataStore((0, import_node_path16.join)(path5, "containers")),
1976
+ writeDataStore: writeDataStore((0, import_node_path17.join)(path6, "containers")),
1967
1977
  /**
1968
1978
  * Returns a data store from EventCatalog
1969
1979
  * @param id - The id of the data store to retrieve
1970
1980
  * @param version - Optional id of the version to get (supports semver)
1971
1981
  * @returns Container|Undefined
1972
1982
  */
1973
- getDataStore: getDataStore((0, import_node_path16.join)(path5)),
1983
+ getDataStore: getDataStore((0, import_node_path17.join)(path6)),
1974
1984
  /**
1975
1985
  * Returns all data stores from EventCatalog
1976
1986
  * @param latestOnly - optional boolean, set to true to get only latest versions
1977
1987
  * @returns Container[]|Undefined
1978
1988
  */
1979
- getDataStores: getDataStores((0, import_node_path16.join)(path5)),
1989
+ getDataStores: getDataStores((0, import_node_path17.join)(path6)),
1980
1990
  /**
1981
1991
  * Version a data store by its id
1982
1992
  * @param id - The id of the data store to version
1983
1993
  */
1984
- versionDataStore: versionDataStore((0, import_node_path16.join)(path5, "containers")),
1994
+ versionDataStore: versionDataStore((0, import_node_path17.join)(path6, "containers")),
1985
1995
  /**
1986
1996
  * Remove a data store by its path
1987
1997
  * @param path - The path to the data store to remove
1988
1998
  */
1989
- rmDataStore: rmDataStore((0, import_node_path16.join)(path5, "containers")),
1999
+ rmDataStore: rmDataStore((0, import_node_path17.join)(path6, "containers")),
1990
2000
  /**
1991
2001
  * Remove a data store by its id
1992
2002
  * @param id - The id of the data store to remove
1993
2003
  */
1994
- rmDataStoreById: rmDataStoreById((0, import_node_path16.join)(path5)),
2004
+ rmDataStoreById: rmDataStoreById((0, import_node_path17.join)(path6)),
1995
2005
  /**
1996
2006
  * Check to see if a data store version exists
1997
2007
  * @param id - The id of the data store
1998
2008
  * @param version - The version of the data store (supports semver)
1999
2009
  * @returns
2000
2010
  */
2001
- dataStoreHasVersion: dataStoreHasVersion((0, import_node_path16.join)(path5)),
2011
+ dataStoreHasVersion: dataStoreHasVersion((0, import_node_path17.join)(path6)),
2002
2012
  /**
2003
2013
  * Adds a file to a data store by its id
2004
2014
  * @param id - The id of the data store to add the file to
@@ -2006,14 +2016,14 @@ var index_default = (path5) => {
2006
2016
  * @param version - Optional version of the data store to add the file to
2007
2017
  * @returns
2008
2018
  */
2009
- addFileToDataStore: addFileToDataStore((0, import_node_path16.join)(path5)),
2019
+ addFileToDataStore: addFileToDataStore((0, import_node_path17.join)(path6)),
2010
2020
  /**
2011
2021
  * Writes a data store to a service by its id
2012
2022
  * @param dataStore - The data store to write
2013
2023
  * @param service - The service to write the data store to
2014
2024
  * @returns
2015
2025
  */
2016
- writeDataStoreToService: writeDataStoreToService((0, import_node_path16.join)(path5))
2026
+ writeDataStoreToService: writeDataStoreToService((0, import_node_path17.join)(path6))
2017
2027
  };
2018
2028
  };
2019
2029
 
@@ -2021,7 +2031,7 @@ var index_default = (path5) => {
2021
2031
  var DUMP_VERSION = "0.0.1";
2022
2032
  var getEventCatalogVersion = async (catalogDir) => {
2023
2033
  try {
2024
- const packageJson = import_fs.default.readFileSync((0, import_node_path17.join)(catalogDir, "package.json"), "utf8");
2034
+ const packageJson = import_fs.default.readFileSync((0, import_node_path18.join)(catalogDir, "package.json"), "utf8");
2025
2035
  const packageJsonObject = JSON.parse(packageJson);
2026
2036
  return packageJsonObject["dependencies"]["@eventcatalog/core"];
2027
2037
  } catch (error) {
@@ -2034,7 +2044,7 @@ var hydrateResource = async (catalogDir, resources = [], { attachSchema = false
2034
2044
  const resourcePath = await getResourcePath(catalogDir, resource.id, resource.version);
2035
2045
  let schema = "";
2036
2046
  if (resource.schemaPath && resourcePath?.fullPath) {
2037
- const pathToSchema = import_node_path17.default.join(import_node_path17.default.dirname(resourcePath?.fullPath), resource.schemaPath);
2047
+ const pathToSchema = import_node_path18.default.join(import_node_path18.default.dirname(resourcePath?.fullPath), resource.schemaPath);
2038
2048
  if (import_fs.default.existsSync(pathToSchema)) {
2039
2049
  schema = import_fs.default.readFileSync(pathToSchema, "utf8");
2040
2050
  }
@@ -2055,8 +2065,8 @@ var filterCollection = (collection, options) => {
2055
2065
  };
2056
2066
  var getEventCatalogConfigurationFile = (directory) => async () => {
2057
2067
  try {
2058
- const path5 = (0, import_node_path17.join)(directory, "eventcatalog.config.js");
2059
- const configModule = await import(path5);
2068
+ const path6 = (0, import_node_path18.join)(directory, "eventcatalog.config.js");
2069
+ const configModule = await import(path6);
2060
2070
  return configModule.default;
2061
2071
  } catch (error) {
2062
2072
  console.error("Error getting event catalog configuration file", error);