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