@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.mjs CHANGED
@@ -20,13 +20,13 @@ var versionExists = async (catalogDir, id, version) => {
20
20
  var findFileById = async (catalogDir, id, version) => {
21
21
  const files = await getFiles(`${catalogDir}/**/index.{md,mdx}`);
22
22
  const matchedFiles = await searchFilesForId(files, id) || [];
23
- const latestVersion = matchedFiles.find((path5) => !path5.includes("versioned"));
23
+ const latestVersion = matchedFiles.find((path6) => !path6.includes("versioned"));
24
24
  if (!version) {
25
25
  return latestVersion;
26
26
  }
27
- const parsedFiles = matchedFiles.map((path5) => {
28
- const { data } = matter.read(path5);
29
- return { ...data, path: path5 };
27
+ const parsedFiles = matchedFiles.map((path6) => {
28
+ const { data } = matter.read(path6);
29
+ return { ...data, path: path6 };
30
30
  });
31
31
  const semverRange = validRange(version);
32
32
  if (semverRange && valid(version)) {
@@ -67,8 +67,8 @@ var getFiles = async (pattern, ignore = "") => {
67
67
  );
68
68
  }
69
69
  };
70
- var readMdxFile = async (path5) => {
71
- const { data } = matter.read(path5);
70
+ var readMdxFile = async (path6) => {
71
+ const { data } = matter.read(path6);
72
72
  const { markdown, ...frontmatter } = data;
73
73
  return { ...frontmatter, markdown };
74
74
  };
@@ -121,6 +121,7 @@ import fsSync2 from "fs";
121
121
  import { satisfies as satisfies2 } from "semver";
122
122
  import { lock, unlock } from "proper-lockfile";
123
123
  import { basename as basename2 } from "path";
124
+ import path from "path";
124
125
  var versionResource = async (catalogDir, id) => {
125
126
  const files = await getFiles(`${catalogDir}/**/index.{md,mdx}`);
126
127
  const matchedFiles = await searchFilesForId(files, id);
@@ -160,8 +161,8 @@ var writeResource = async (catalogDir, resource, options = {
160
161
  versionExistingContent: false,
161
162
  format: "mdx"
162
163
  }) => {
163
- const path5 = options.path || `/${resource.id}`;
164
- const fullPath = join2(catalogDir, path5);
164
+ const path6 = options.path || `/${resource.id}`;
165
+ const fullPath = join2(catalogDir, path6);
165
166
  const format = options.format || "mdx";
166
167
  fsSync2.mkdirSync(fullPath, { recursive: true });
167
168
  const lockPath = join2(fullPath, `index.${format}`);
@@ -227,6 +228,11 @@ var getResourcePath = async (catalogDir, id, version) => {
227
228
  directory: dirname2(file.replace(catalogDir, ""))
228
229
  };
229
230
  };
231
+ var getResourceFolderName = async (catalogDir, id, version) => {
232
+ const paths = await getResourcePath(catalogDir, id, version);
233
+ if (!paths) return;
234
+ return paths?.directory.split(path.sep).filter(Boolean).pop();
235
+ };
230
236
  var toResource = async (catalogDir, rawContents) => {
231
237
  const { data, content } = matter2(rawContents);
232
238
  return {
@@ -288,16 +294,16 @@ var rmResourceById = async (catalogDir, id, version, options) => {
288
294
  );
289
295
  }
290
296
  };
291
- var waitForFileRemoval = async (path5, maxRetries = 50, delay = 10) => {
297
+ var waitForFileRemoval = async (path6, maxRetries = 50, delay = 10) => {
292
298
  for (let i = 0; i < maxRetries; i++) {
293
299
  try {
294
- await fs.access(path5);
300
+ await fs.access(path6);
295
301
  await new Promise((resolve2) => setTimeout(resolve2, delay));
296
302
  } catch (error) {
297
303
  return;
298
304
  }
299
305
  }
300
- throw new Error(`File/directory ${path5} was not removed after ${maxRetries} attempts`);
306
+ throw new Error(`File/directory ${path6} was not removed after ${maxRetries} attempts`);
301
307
  };
302
308
  var addFileToResource = async (catalogDir, id, file, version) => {
303
309
  const pathToResource = await findFileById(catalogDir, id, version);
@@ -344,8 +350,8 @@ var writeEventToService = (directory) => async (event, service, options = { path
344
350
  pathForEvent = join3(pathForEvent, event.id);
345
351
  await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
346
352
  };
347
- var rmEvent = (directory) => async (path5) => {
348
- await fs2.rm(join3(directory, path5), { recursive: true });
353
+ var rmEvent = (directory) => async (path6) => {
354
+ await fs2.rm(join3(directory, path6), { recursive: true });
349
355
  };
350
356
  var rmEventById = (directory) => async (id, version, persistFiles) => {
351
357
  await rmResourceById(directory, id, version, { type: "event", persistFiles });
@@ -380,8 +386,8 @@ var writeCommandToService = (directory) => async (command, service, options = {
380
386
  pathForCommand = join4(pathForCommand, command.id);
381
387
  await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
382
388
  };
383
- var rmCommand = (directory) => async (path5) => {
384
- await fs3.rm(join4(directory, path5), { recursive: true });
389
+ var rmCommand = (directory) => async (path6) => {
390
+ await fs3.rm(join4(directory, path6), { recursive: true });
385
391
  };
386
392
  var rmCommandById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "command", persistFiles });
387
393
  var versionCommand = (directory) => async (id) => versionResource(directory, id);
@@ -414,8 +420,8 @@ var writeQueryToService = (directory) => async (query, service, options = { path
414
420
  pathForQuery = join5(pathForQuery, query.id);
415
421
  await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
416
422
  };
417
- var rmQuery = (directory) => async (path5) => {
418
- await fs4.rm(join5(directory, path5), { recursive: true });
423
+ var rmQuery = (directory) => async (path6) => {
424
+ await fs4.rm(join5(directory, path6), { recursive: true });
419
425
  };
420
426
  var rmQueryById = (directory) => async (id, version, persistFiles) => {
421
427
  await rmResourceById(directory, id, version, { type: "query", persistFiles });
@@ -434,8 +440,8 @@ var queryHasVersion = (directory) => async (id, version) => {
434
440
  import fs5 from "fs/promises";
435
441
  import { join as join6, dirname as dirname4, extname, relative as relative2 } from "path";
436
442
  var getService = (directory) => async (id, version) => getResource(directory, id, version, { type: "service" });
437
- var getServiceByPath = (directory) => async (path5) => {
438
- const service = await getResource(directory, void 0, void 0, { type: "service" }, path5);
443
+ var getServiceByPath = (directory) => async (path6) => {
444
+ const service = await getResource(directory, void 0, void 0, { type: "service" }, path6);
439
445
  return service;
440
446
  };
441
447
  var getServices = (directory) => async (options) => getResources(directory, {
@@ -459,8 +465,8 @@ var writeService = (directory) => async (service, options = {
459
465
  };
460
466
  var writeVersionedService = (directory) => async (service) => {
461
467
  const resource = { ...service };
462
- const path5 = getVersionedDirectory(service.id, service.version);
463
- return await writeService(directory)(resource, { path: path5 });
468
+ const path6 = getVersionedDirectory(service.id, service.version);
469
+ return await writeService(directory)(resource, { path: path6 });
464
470
  };
465
471
  var writeServiceToDomain = (directory) => async (service, domain, options = { path: "", format: "mdx", override: false }) => {
466
472
  let pathForService = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/services` : `/${domain.id}/services`;
@@ -468,8 +474,8 @@ var writeServiceToDomain = (directory) => async (service, domain, options = { pa
468
474
  await writeResource(directory, { ...service }, { ...options, path: pathForService, type: "service" });
469
475
  };
470
476
  var versionService = (directory) => async (id) => versionResource(directory, id);
471
- var rmService = (directory) => async (path5) => {
472
- await fs5.rm(join6(directory, path5), { recursive: true });
477
+ var rmService = (directory) => async (path6) => {
478
+ await fs5.rm(join6(directory, path6), { recursive: true });
473
479
  };
474
480
  var rmServiceById = (directory) => async (id, version, persistFiles) => {
475
481
  await rmResourceById(directory, id, version, { type: "service", persistFiles });
@@ -533,8 +539,8 @@ var addMessageToService = (directory) => async (id, direction, event, version) =
533
539
  if (!existingResource) {
534
540
  throw new Error(`Cannot find service ${id} in the catalog`);
535
541
  }
536
- const path5 = existingResource.split(/[\\/]+services/)[0];
537
- const pathToResource = join6(path5, "services");
542
+ const path6 = existingResource.split(/[\\/]+services/)[0];
543
+ const pathToResource = join6(path6, "services");
538
544
  await rmServiceById(directory)(id, version);
539
545
  await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
540
546
  };
@@ -542,9 +548,9 @@ var serviceHasVersion = (directory) => async (id, version) => {
542
548
  const file = await findFileById(directory, id, version);
543
549
  return !!file;
544
550
  };
545
- var isService = (directory) => async (path5) => {
546
- const service = await getServiceByPath(directory)(path5);
547
- const relativePath = relative2(directory, path5);
551
+ var isService = (directory) => async (path6) => {
552
+ const service = await getServiceByPath(directory)(path6);
553
+ const relativePath = relative2(directory, path6);
548
554
  const segments = relativePath.split(/[/\\]+/);
549
555
  return !!service && segments.includes("services");
550
556
  };
@@ -566,8 +572,8 @@ var addEntityToService = (directory) => async (id, entity, version) => {
566
572
  if (!existingResource) {
567
573
  throw new Error(`Cannot find service ${id} in the catalog`);
568
574
  }
569
- const path5 = existingResource.split(/[\\/]+services/)[0];
570
- const pathToResource = join6(path5, "services");
575
+ const path6 = existingResource.split(/[\\/]+services/)[0];
576
+ const pathToResource = join6(path6, "services");
571
577
  await rmServiceById(directory)(id, version);
572
578
  await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
573
579
  };
@@ -602,15 +608,15 @@ var addDataStoreToService = (directory) => async (id, operation, dataStore, vers
602
608
  if (!existingResource) {
603
609
  throw new Error(`Cannot find service ${id} in the catalog`);
604
610
  }
605
- const path5 = existingResource.split(/[\\/]+services/)[0];
606
- const pathToResource = join6(path5, "services");
611
+ const path6 = existingResource.split(/[\\/]+services/)[0];
612
+ const pathToResource = join6(path6, "services");
607
613
  await rmServiceById(directory)(id, version);
608
614
  await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
609
615
  };
610
616
 
611
617
  // src/domains.ts
612
618
  import fs6 from "fs/promises";
613
- import path, { join as join7 } from "path";
619
+ import path2, { join as join7 } from "path";
614
620
  import fsSync3 from "fs";
615
621
  import matter3 from "gray-matter";
616
622
  var getDomain = (directory) => async (id, version) => getResource(directory, id, version, { type: "domain" });
@@ -635,8 +641,8 @@ var writeDomain = (directory) => async (domain, options = {
635
641
  return await writeResource(directory, resource, { ...options, type: "domain" });
636
642
  };
637
643
  var versionDomain = (directory) => async (id) => versionResource(directory, id);
638
- var rmDomain = (directory) => async (path5) => {
639
- await fs6.rm(join7(directory, path5), { recursive: true });
644
+ var rmDomain = (directory) => async (path6) => {
645
+ await fs6.rm(join7(directory, path6), { recursive: true });
640
646
  };
641
647
  var rmDomainById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "domain", persistFiles });
642
648
  var addFileToDomain = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
@@ -648,7 +654,7 @@ var addUbiquitousLanguageToDomain = (directory) => async (id, ubiquitousLanguage
648
654
  };
649
655
  var getUbiquitousLanguageFromDomain = (directory) => async (id, version) => {
650
656
  const pathToDomain = await findFileById(directory, id, version) || "";
651
- const pathToUbiquitousLanguage = path.join(path.dirname(pathToDomain), "ubiquitous-language.mdx");
657
+ const pathToUbiquitousLanguage = path2.join(path2.dirname(pathToDomain), "ubiquitous-language.mdx");
652
658
  const fileExists = fsSync3.existsSync(pathToUbiquitousLanguage);
653
659
  if (!fileExists) {
654
660
  return void 0;
@@ -663,7 +669,7 @@ var domainHasVersion = (directory) => async (id, version) => {
663
669
  var addServiceToDomain = (directory) => async (id, service, version) => {
664
670
  let domain = await getDomain(directory)(id, version);
665
671
  const domainPath = await getResourcePath(directory, id, version);
666
- const extension = path.extname(domainPath?.fullPath || "");
672
+ const extension = path2.extname(domainPath?.fullPath || "");
667
673
  if (domain.services === void 0) {
668
674
  domain.services = [];
669
675
  }
@@ -678,7 +684,7 @@ var addServiceToDomain = (directory) => async (id, service, version) => {
678
684
  var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
679
685
  let domain = await getDomain(directory)(id, version);
680
686
  const domainPath = await getResourcePath(directory, id, version);
681
- const extension = path.extname(domainPath?.fullPath || "");
687
+ const extension = path2.extname(domainPath?.fullPath || "");
682
688
  if (domain.domains === void 0) {
683
689
  domain.domains = [];
684
690
  }
@@ -693,7 +699,7 @@ var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
693
699
  var addEntityToDomain = (directory) => async (id, entity, version) => {
694
700
  let domain = await getDomain(directory)(id, version);
695
701
  const domainPath = await getResourcePath(directory, id, version);
696
- const extension = path.extname(domainPath?.fullPath || "");
702
+ const extension = path2.extname(domainPath?.fullPath || "");
697
703
  if (domain.entities === void 0) {
698
704
  domain.entities = [];
699
705
  }
@@ -712,8 +718,8 @@ import { join as join8, extname as extname2 } from "path";
712
718
  var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
713
719
  var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
714
720
  var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
715
- var rmChannel = (directory) => async (path5) => {
716
- await fs7.rm(join8(directory, path5), { recursive: true });
721
+ var rmChannel = (directory) => async (path6) => {
722
+ await fs7.rm(join8(directory, path6), { recursive: true });
717
723
  };
718
724
  var rmChannelById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "channel", persistFiles });
719
725
  var versionChannel = (directory) => async (id) => versionResource(directory, id);
@@ -754,8 +760,8 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
754
760
  if (!existingResource) {
755
761
  throw new Error(`Cannot find message ${id} in the catalog`);
756
762
  }
757
- const path5 = existingResource.split(`/[\\/]+${collection}`)[0];
758
- const pathToResource = join8(path5, collection);
763
+ const path6 = existingResource.split(`/[\\/]+${collection}`)[0];
764
+ const pathToResource = join8(path6, collection);
759
765
  await rmMessageById(directory)(_message.id, _message.version, true);
760
766
  await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
761
767
  };
@@ -764,8 +770,8 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
764
770
  import { dirname as dirname5 } from "path";
765
771
  import matter4 from "gray-matter";
766
772
  import { satisfies as satisfies3, validRange as validRange2 } from "semver";
767
- var getMessageBySchemaPath = (directory) => async (path5, options) => {
768
- const pathToMessage = dirname5(path5);
773
+ var getMessageBySchemaPath = (directory) => async (path6, options) => {
774
+ const pathToMessage = dirname5(path6);
769
775
  try {
770
776
  const files = await getFiles(`${directory}/${pathToMessage}/index.{md,mdx}`);
771
777
  if (!files || files.length === 0) {
@@ -837,18 +843,18 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
837
843
  }
838
844
  return { producers, consumers };
839
845
  };
840
- var getConsumersOfSchema = (directory) => async (path5) => {
846
+ var getConsumersOfSchema = (directory) => async (path6) => {
841
847
  try {
842
- const message = await getMessageBySchemaPath(directory)(path5);
848
+ const message = await getMessageBySchemaPath(directory)(path6);
843
849
  const { consumers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
844
850
  return consumers;
845
851
  } catch (error) {
846
852
  return [];
847
853
  }
848
854
  };
849
- var getProducersOfSchema = (directory) => async (path5) => {
855
+ var getProducersOfSchema = (directory) => async (path6) => {
850
856
  try {
851
- const message = await getMessageBySchemaPath(directory)(path5);
857
+ const message = await getMessageBySchemaPath(directory)(path6);
852
858
  const { producers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
853
859
  return producers;
854
860
  } catch (error) {
@@ -857,13 +863,13 @@ var getProducersOfSchema = (directory) => async (path5) => {
857
863
  };
858
864
 
859
865
  // src/custom-docs.ts
860
- import path2, { join as join10 } from "path";
866
+ import path3, { join as join10 } from "path";
861
867
  import fsSync4 from "fs";
862
868
  import fs8 from "fs/promises";
863
869
  import matter5 from "gray-matter";
864
870
  import slugify from "slugify";
865
871
  var getCustomDoc = (directory) => async (filePath) => {
866
- const fullPath = path2.join(directory, filePath);
872
+ const fullPath = path3.join(directory, filePath);
867
873
  const fullPathWithExtension = fullPath.endsWith(".mdx") ? fullPath : `${fullPath}.mdx`;
868
874
  const fileExists = fsSync4.existsSync(fullPathWithExtension);
869
875
  if (!fileExists) {
@@ -882,8 +888,8 @@ var writeCustomDoc = (directory) => async (customDoc, options = { path: "" }) =>
882
888
  const { fileName, ...rest } = customDoc;
883
889
  const name = fileName || slugify(customDoc.title, { lower: true });
884
890
  const withExtension = name.endsWith(".mdx") ? name : `${name}.mdx`;
885
- const fullPath = path2.join(directory, options.path || "", withExtension);
886
- fsSync4.mkdirSync(path2.dirname(fullPath), { recursive: true });
891
+ const fullPath = path3.join(directory, options.path || "", withExtension);
892
+ fsSync4.mkdirSync(path3.dirname(fullPath), { recursive: true });
887
893
  const document = matter5.stringify(customDoc.markdown.trim(), rest);
888
894
  fsSync4.writeFileSync(fullPath, document);
889
895
  };
@@ -897,7 +903,7 @@ import fs9 from "fs/promises";
897
903
  import fsSync6 from "fs";
898
904
  import { join as join12 } from "path";
899
905
  import matter7 from "gray-matter";
900
- import path3 from "path";
906
+ import path4 from "path";
901
907
 
902
908
  // src/users.ts
903
909
  import fsSync5 from "fs";
@@ -993,11 +999,11 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
993
999
  if (!resource) return [];
994
1000
  if (!resource.owners) return [];
995
1001
  for (const owner of resource.owners) {
996
- const team = await getTeam(path3.join(catalogDir, "teams"))(owner);
1002
+ const team = await getTeam(path4.join(catalogDir, "teams"))(owner);
997
1003
  if (team) {
998
1004
  owners.push(team);
999
1005
  } else {
1000
- const user = await getUser(path3.join(catalogDir, "users"))(owner);
1006
+ const user = await getUser(path4.join(catalogDir, "users"))(owner);
1001
1007
  if (user) {
1002
1008
  owners.push(user);
1003
1009
  }
@@ -1008,7 +1014,7 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
1008
1014
 
1009
1015
  // src/eventcatalog.ts
1010
1016
  import fs10 from "fs";
1011
- import path4, { join as join13 } from "path";
1017
+ import path5, { join as join13 } from "path";
1012
1018
  var DUMP_VERSION = "0.0.1";
1013
1019
  var getEventCatalogVersion = async (catalogDir) => {
1014
1020
  try {
@@ -1025,7 +1031,7 @@ var hydrateResource = async (catalogDir, resources = [], { attachSchema = false
1025
1031
  const resourcePath = await getResourcePath(catalogDir, resource.id, resource.version);
1026
1032
  let schema = "";
1027
1033
  if (resource.schemaPath && resourcePath?.fullPath) {
1028
- const pathToSchema = path4.join(path4.dirname(resourcePath?.fullPath), resource.schemaPath);
1034
+ const pathToSchema = path5.join(path5.dirname(resourcePath?.fullPath), resource.schemaPath);
1029
1035
  if (fs10.existsSync(pathToSchema)) {
1030
1036
  schema = fs10.readFileSync(pathToSchema, "utf8");
1031
1037
  }
@@ -1046,8 +1052,8 @@ var filterCollection = (collection, options) => {
1046
1052
  };
1047
1053
  var getEventCatalogConfigurationFile = (directory) => async () => {
1048
1054
  try {
1049
- const path5 = join13(directory, "eventcatalog.config.js");
1050
- const configModule = await import(path5);
1055
+ const path6 = join13(directory, "eventcatalog.config.js");
1056
+ const configModule = await import(path6);
1051
1057
  return configModule.default;
1052
1058
  } catch (error) {
1053
1059
  console.error("Error getting event catalog configuration file", error);
@@ -1113,8 +1119,8 @@ var writeEntity = (directory) => async (entity, options = {
1113
1119
  override: false,
1114
1120
  format: "mdx"
1115
1121
  }) => writeResource(directory, { ...entity }, { ...options, type: "entity" });
1116
- var rmEntity = (directory) => async (path5) => {
1117
- await fs11.rm(join14(directory, path5), { recursive: true });
1122
+ var rmEntity = (directory) => async (path6) => {
1123
+ await fs11.rm(join14(directory, path6), { recursive: true });
1118
1124
  };
1119
1125
  var rmEntityById = (directory) => async (id, version, persistFiles) => {
1120
1126
  await rmResourceById(directory, id, version, { type: "entity", persistFiles });
@@ -1136,8 +1142,8 @@ var writeContainer = (directory) => async (data, options = {
1136
1142
  format: "mdx"
1137
1143
  }) => writeResource(directory, { ...data }, { ...options, type: "container" });
1138
1144
  var versionContainer = (directory) => async (id) => versionResource(directory, id);
1139
- var rmContainer = (directory) => async (path5) => {
1140
- await fs12.rm(join15(directory, path5), { recursive: true });
1145
+ var rmContainer = (directory) => async (path6) => {
1146
+ await fs12.rm(join15(directory, path6), { recursive: true });
1141
1147
  };
1142
1148
  var rmContainerById = (directory) => async (id, version, persistFiles) => {
1143
1149
  await rmResourceById(directory, id, version, { type: "container", persistFiles });
@@ -1169,7 +1175,7 @@ var addFileToDataStore = addFileToContainer;
1169
1175
  var writeDataStoreToService = writeContainerToService;
1170
1176
 
1171
1177
  // src/index.ts
1172
- var index_default = (path5) => {
1178
+ var index_default = (path6) => {
1173
1179
  return {
1174
1180
  /**
1175
1181
  * Returns an events from EventCatalog
@@ -1177,13 +1183,13 @@ var index_default = (path5) => {
1177
1183
  * @param version - Optional id of the version to get (supports semver)
1178
1184
  * @returns Event|Undefined
1179
1185
  */
1180
- getEvent: getEvent(join16(path5)),
1186
+ getEvent: getEvent(join16(path6)),
1181
1187
  /**
1182
1188
  * Returns all events from EventCatalog
1183
1189
  * @param latestOnly - optional boolean, set to true to get only latest versions
1184
1190
  * @returns Event[]|Undefined
1185
1191
  */
1186
- getEvents: getEvents(join16(path5)),
1192
+ getEvents: getEvents(join16(path6)),
1187
1193
  /**
1188
1194
  * Adds an event to EventCatalog
1189
1195
  *
@@ -1191,7 +1197,7 @@ var index_default = (path5) => {
1191
1197
  * @param options - Optional options to write the event
1192
1198
  *
1193
1199
  */
1194
- writeEvent: writeEvent(join16(path5, "events")),
1200
+ writeEvent: writeEvent(join16(path6, "events")),
1195
1201
  /**
1196
1202
  * Adds an event to a service in EventCatalog
1197
1203
  *
@@ -1200,26 +1206,26 @@ var index_default = (path5) => {
1200
1206
  * @param options - Optional options to write the event
1201
1207
  *
1202
1208
  */
1203
- writeEventToService: writeEventToService(join16(path5)),
1209
+ writeEventToService: writeEventToService(join16(path6)),
1204
1210
  /**
1205
1211
  * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
1206
1212
  *
1207
1213
  * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
1208
1214
  *
1209
1215
  */
1210
- rmEvent: rmEvent(join16(path5, "events")),
1216
+ rmEvent: rmEvent(join16(path6, "events")),
1211
1217
  /**
1212
1218
  * Remove an event by an Event id
1213
1219
  *
1214
1220
  * @param id - The id of the event you want to remove
1215
1221
  *
1216
1222
  */
1217
- rmEventById: rmEventById(join16(path5)),
1223
+ rmEventById: rmEventById(join16(path6)),
1218
1224
  /**
1219
1225
  * Moves a given event id to the version directory
1220
1226
  * @param directory
1221
1227
  */
1222
- versionEvent: versionEvent(join16(path5)),
1228
+ versionEvent: versionEvent(join16(path6)),
1223
1229
  /**
1224
1230
  * Adds a file to the given event
1225
1231
  * @param id - The id of the event to add the file to
@@ -1227,7 +1233,7 @@ var index_default = (path5) => {
1227
1233
  * @param version - Optional version of the event to add the file to
1228
1234
  * @returns
1229
1235
  */
1230
- addFileToEvent: addFileToEvent(join16(path5)),
1236
+ addFileToEvent: addFileToEvent(join16(path6)),
1231
1237
  /**
1232
1238
  * Adds a schema to the given event
1233
1239
  * @param id - The id of the event to add the schema to
@@ -1235,14 +1241,14 @@ var index_default = (path5) => {
1235
1241
  * @param version - Optional version of the event to add the schema to
1236
1242
  * @returns
1237
1243
  */
1238
- addSchemaToEvent: addSchemaToEvent(join16(path5)),
1244
+ addSchemaToEvent: addSchemaToEvent(join16(path6)),
1239
1245
  /**
1240
1246
  * Check to see if an event version exists
1241
1247
  * @param id - The id of the event
1242
1248
  * @param version - The version of the event (supports semver)
1243
1249
  * @returns
1244
1250
  */
1245
- eventHasVersion: eventHasVersion(join16(path5)),
1251
+ eventHasVersion: eventHasVersion(join16(path6)),
1246
1252
  /**
1247
1253
  * ================================
1248
1254
  * Commands
@@ -1254,13 +1260,13 @@ var index_default = (path5) => {
1254
1260
  * @param version - Optional id of the version to get (supports semver)
1255
1261
  * @returns Command|Undefined
1256
1262
  */
1257
- getCommand: getCommand(join16(path5)),
1263
+ getCommand: getCommand(join16(path6)),
1258
1264
  /**
1259
1265
  * Returns all commands from EventCatalog
1260
1266
  * @param latestOnly - optional boolean, set to true to get only latest versions
1261
1267
  * @returns Command[]|Undefined
1262
1268
  */
1263
- getCommands: getCommands(join16(path5)),
1269
+ getCommands: getCommands(join16(path6)),
1264
1270
  /**
1265
1271
  * Adds an command to EventCatalog
1266
1272
  *
@@ -1268,7 +1274,7 @@ var index_default = (path5) => {
1268
1274
  * @param options - Optional options to write the command
1269
1275
  *
1270
1276
  */
1271
- writeCommand: writeCommand(join16(path5, "commands")),
1277
+ writeCommand: writeCommand(join16(path6, "commands")),
1272
1278
  /**
1273
1279
  * Adds a command to a service in EventCatalog
1274
1280
  *
@@ -1277,26 +1283,26 @@ var index_default = (path5) => {
1277
1283
  * @param options - Optional options to write the command
1278
1284
  *
1279
1285
  */
1280
- writeCommandToService: writeCommandToService(join16(path5)),
1286
+ writeCommandToService: writeCommandToService(join16(path6)),
1281
1287
  /**
1282
1288
  * Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
1283
1289
  *
1284
1290
  * @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
1285
1291
  *
1286
1292
  */
1287
- rmCommand: rmCommand(join16(path5, "commands")),
1293
+ rmCommand: rmCommand(join16(path6, "commands")),
1288
1294
  /**
1289
1295
  * Remove an command by an Event id
1290
1296
  *
1291
1297
  * @param id - The id of the command you want to remove
1292
1298
  *
1293
1299
  */
1294
- rmCommandById: rmCommandById(join16(path5)),
1300
+ rmCommandById: rmCommandById(join16(path6)),
1295
1301
  /**
1296
1302
  * Moves a given command id to the version directory
1297
1303
  * @param directory
1298
1304
  */
1299
- versionCommand: versionCommand(join16(path5)),
1305
+ versionCommand: versionCommand(join16(path6)),
1300
1306
  /**
1301
1307
  * Adds a file to the given command
1302
1308
  * @param id - The id of the command to add the file to
@@ -1304,7 +1310,7 @@ var index_default = (path5) => {
1304
1310
  * @param version - Optional version of the command to add the file to
1305
1311
  * @returns
1306
1312
  */
1307
- addFileToCommand: addFileToCommand(join16(path5)),
1313
+ addFileToCommand: addFileToCommand(join16(path6)),
1308
1314
  /**
1309
1315
  * Adds a schema to the given command
1310
1316
  * @param id - The id of the command to add the schema to
@@ -1312,14 +1318,14 @@ var index_default = (path5) => {
1312
1318
  * @param version - Optional version of the command to add the schema to
1313
1319
  * @returns
1314
1320
  */
1315
- addSchemaToCommand: addSchemaToCommand(join16(path5)),
1321
+ addSchemaToCommand: addSchemaToCommand(join16(path6)),
1316
1322
  /**
1317
1323
  * Check to see if a command version exists
1318
1324
  * @param id - The id of the command
1319
1325
  * @param version - The version of the command (supports semver)
1320
1326
  * @returns
1321
1327
  */
1322
- commandHasVersion: commandHasVersion(join16(path5)),
1328
+ commandHasVersion: commandHasVersion(join16(path6)),
1323
1329
  /**
1324
1330
  * ================================
1325
1331
  * Queries
@@ -1331,13 +1337,13 @@ var index_default = (path5) => {
1331
1337
  * @param version - Optional id of the version to get (supports semver)
1332
1338
  * @returns Query|Undefined
1333
1339
  */
1334
- getQuery: getQuery(join16(path5)),
1340
+ getQuery: getQuery(join16(path6)),
1335
1341
  /**
1336
1342
  * Returns all queries from EventCatalog
1337
1343
  * @param latestOnly - optional boolean, set to true to get only latest versions
1338
1344
  * @returns Query[]|Undefined
1339
1345
  */
1340
- getQueries: getQueries(join16(path5)),
1346
+ getQueries: getQueries(join16(path6)),
1341
1347
  /**
1342
1348
  * Adds a query to EventCatalog
1343
1349
  *
@@ -1345,7 +1351,7 @@ var index_default = (path5) => {
1345
1351
  * @param options - Optional options to write the event
1346
1352
  *
1347
1353
  */
1348
- writeQuery: writeQuery(join16(path5, "queries")),
1354
+ writeQuery: writeQuery(join16(path6, "queries")),
1349
1355
  /**
1350
1356
  * Adds a query to a service in EventCatalog
1351
1357
  *
@@ -1354,26 +1360,26 @@ var index_default = (path5) => {
1354
1360
  * @param options - Optional options to write the query
1355
1361
  *
1356
1362
  */
1357
- writeQueryToService: writeQueryToService(join16(path5)),
1363
+ writeQueryToService: writeQueryToService(join16(path6)),
1358
1364
  /**
1359
1365
  * Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
1360
1366
  *
1361
1367
  * @param path - The path to your query, e.g. `/Orders/GetOrder`
1362
1368
  *
1363
1369
  */
1364
- rmQuery: rmQuery(join16(path5, "queries")),
1370
+ rmQuery: rmQuery(join16(path6, "queries")),
1365
1371
  /**
1366
1372
  * Remove a query by a Query id
1367
1373
  *
1368
1374
  * @param id - The id of the query you want to remove
1369
1375
  *
1370
1376
  */
1371
- rmQueryById: rmQueryById(join16(path5)),
1377
+ rmQueryById: rmQueryById(join16(path6)),
1372
1378
  /**
1373
1379
  * Moves a given query id to the version directory
1374
1380
  * @param directory
1375
1381
  */
1376
- versionQuery: versionQuery(join16(path5)),
1382
+ versionQuery: versionQuery(join16(path6)),
1377
1383
  /**
1378
1384
  * Adds a file to the given query
1379
1385
  * @param id - The id of the query to add the file to
@@ -1381,7 +1387,7 @@ var index_default = (path5) => {
1381
1387
  * @param version - Optional version of the query to add the file to
1382
1388
  * @returns
1383
1389
  */
1384
- addFileToQuery: addFileToQuery(join16(path5)),
1390
+ addFileToQuery: addFileToQuery(join16(path6)),
1385
1391
  /**
1386
1392
  * Adds a schema to the given query
1387
1393
  * @param id - The id of the query to add the schema to
@@ -1389,14 +1395,14 @@ var index_default = (path5) => {
1389
1395
  * @param version - Optional version of the query to add the schema to
1390
1396
  * @returns
1391
1397
  */
1392
- addSchemaToQuery: addSchemaToQuery(join16(path5)),
1398
+ addSchemaToQuery: addSchemaToQuery(join16(path6)),
1393
1399
  /**
1394
1400
  * Check to see if an query version exists
1395
1401
  * @param id - The id of the query
1396
1402
  * @param version - The version of the query (supports semver)
1397
1403
  * @returns
1398
1404
  */
1399
- queryHasVersion: queryHasVersion(join16(path5)),
1405
+ queryHasVersion: queryHasVersion(join16(path6)),
1400
1406
  /**
1401
1407
  * ================================
1402
1408
  * Channels
@@ -1408,13 +1414,13 @@ var index_default = (path5) => {
1408
1414
  * @param version - Optional id of the version to get (supports semver)
1409
1415
  * @returns Channel|Undefined
1410
1416
  */
1411
- getChannel: getChannel(join16(path5)),
1417
+ getChannel: getChannel(join16(path6)),
1412
1418
  /**
1413
1419
  * Returns all channels from EventCatalog
1414
1420
  * @param latestOnly - optional boolean, set to true to get only latest versions
1415
1421
  * @returns Channel[]|Undefined
1416
1422
  */
1417
- getChannels: getChannels(join16(path5)),
1423
+ getChannels: getChannels(join16(path6)),
1418
1424
  /**
1419
1425
  * Adds an channel to EventCatalog
1420
1426
  *
@@ -1422,33 +1428,33 @@ var index_default = (path5) => {
1422
1428
  * @param options - Optional options to write the channel
1423
1429
  *
1424
1430
  */
1425
- writeChannel: writeChannel(join16(path5, "channels")),
1431
+ writeChannel: writeChannel(join16(path6, "channels")),
1426
1432
  /**
1427
1433
  * Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
1428
1434
  *
1429
1435
  * @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
1430
1436
  *
1431
1437
  */
1432
- rmChannel: rmChannel(join16(path5, "channels")),
1438
+ rmChannel: rmChannel(join16(path6, "channels")),
1433
1439
  /**
1434
1440
  * Remove an channel by an Event id
1435
1441
  *
1436
1442
  * @param id - The id of the channel you want to remove
1437
1443
  *
1438
1444
  */
1439
- rmChannelById: rmChannelById(join16(path5)),
1445
+ rmChannelById: rmChannelById(join16(path6)),
1440
1446
  /**
1441
1447
  * Moves a given channel id to the version directory
1442
1448
  * @param directory
1443
1449
  */
1444
- versionChannel: versionChannel(join16(path5)),
1450
+ versionChannel: versionChannel(join16(path6)),
1445
1451
  /**
1446
1452
  * Check to see if a channel version exists
1447
1453
  * @param id - The id of the channel
1448
1454
  * @param version - The version of the channel (supports semver)
1449
1455
  * @returns
1450
1456
  */
1451
- channelHasVersion: channelHasVersion(join16(path5)),
1457
+ channelHasVersion: channelHasVersion(join16(path6)),
1452
1458
  /**
1453
1459
  * Add a channel to an event
1454
1460
  *
@@ -1465,7 +1471,7 @@ var index_default = (path5) => {
1465
1471
  *
1466
1472
  * ```
1467
1473
  */
1468
- addEventToChannel: addMessageToChannel(join16(path5), "events"),
1474
+ addEventToChannel: addMessageToChannel(join16(path6), "events"),
1469
1475
  /**
1470
1476
  * Add a channel to an command
1471
1477
  *
@@ -1482,7 +1488,7 @@ var index_default = (path5) => {
1482
1488
  *
1483
1489
  * ```
1484
1490
  */
1485
- addCommandToChannel: addMessageToChannel(join16(path5), "commands"),
1491
+ addCommandToChannel: addMessageToChannel(join16(path6), "commands"),
1486
1492
  /**
1487
1493
  * Add a channel to an query
1488
1494
  *
@@ -1499,7 +1505,7 @@ var index_default = (path5) => {
1499
1505
  *
1500
1506
  * ```
1501
1507
  */
1502
- addQueryToChannel: addMessageToChannel(join16(path5), "queries"),
1508
+ addQueryToChannel: addMessageToChannel(join16(path6), "queries"),
1503
1509
  /**
1504
1510
  * ================================
1505
1511
  * SERVICES
@@ -1512,14 +1518,14 @@ var index_default = (path5) => {
1512
1518
  * @param options - Optional options to write the event
1513
1519
  *
1514
1520
  */
1515
- writeService: writeService(join16(path5, "services")),
1521
+ writeService: writeService(join16(path6, "services")),
1516
1522
  /**
1517
1523
  * Adds a versioned service to EventCatalog
1518
1524
  *
1519
1525
  * @param service - The service to write
1520
1526
  *
1521
1527
  */
1522
- writeVersionedService: writeVersionedService(join16(path5, "services")),
1528
+ writeVersionedService: writeVersionedService(join16(path6, "services")),
1523
1529
  /**
1524
1530
  * Adds a service to a domain in EventCatalog
1525
1531
  *
@@ -1528,45 +1534,45 @@ var index_default = (path5) => {
1528
1534
  * @param options - Optional options to write the event
1529
1535
  *
1530
1536
  */
1531
- writeServiceToDomain: writeServiceToDomain(join16(path5, "domains")),
1537
+ writeServiceToDomain: writeServiceToDomain(join16(path6, "domains")),
1532
1538
  /**
1533
1539
  * Returns a service from EventCatalog
1534
1540
  * @param id - The id of the service to retrieve
1535
1541
  * @param version - Optional id of the version to get (supports semver)
1536
1542
  * @returns Service|Undefined
1537
1543
  */
1538
- getService: getService(join16(path5)),
1544
+ getService: getService(join16(path6)),
1539
1545
  /**
1540
1546
  * Returns a service from EventCatalog by it's path.
1541
1547
  * @param path - The path to the service to retrieve
1542
1548
  * @returns Service|Undefined
1543
1549
  */
1544
- getServiceByPath: getServiceByPath(join16(path5)),
1550
+ getServiceByPath: getServiceByPath(join16(path6)),
1545
1551
  /**
1546
1552
  * Returns all services from EventCatalog
1547
1553
  * @param latestOnly - optional boolean, set to true to get only latest versions
1548
1554
  * @returns Service[]|Undefined
1549
1555
  */
1550
- getServices: getServices(join16(path5)),
1556
+ getServices: getServices(join16(path6)),
1551
1557
  /**
1552
1558
  * Moves a given service id to the version directory
1553
1559
  * @param directory
1554
1560
  */
1555
- versionService: versionService(join16(path5)),
1561
+ versionService: versionService(join16(path6)),
1556
1562
  /**
1557
1563
  * Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
1558
1564
  *
1559
1565
  * @param path - The path to your service, e.g. `/InventoryService`
1560
1566
  *
1561
1567
  */
1562
- rmService: rmService(join16(path5, "services")),
1568
+ rmService: rmService(join16(path6, "services")),
1563
1569
  /**
1564
1570
  * Remove an service by an service id
1565
1571
  *
1566
1572
  * @param id - The id of the service you want to remove
1567
1573
  *
1568
1574
  */
1569
- rmServiceById: rmServiceById(join16(path5)),
1575
+ rmServiceById: rmServiceById(join16(path6)),
1570
1576
  /**
1571
1577
  * Adds a file to the given service
1572
1578
  * @param id - The id of the service to add the file to
@@ -1574,21 +1580,21 @@ var index_default = (path5) => {
1574
1580
  * @param version - Optional version of the service to add the file to
1575
1581
  * @returns
1576
1582
  */
1577
- addFileToService: addFileToService(join16(path5)),
1583
+ addFileToService: addFileToService(join16(path6)),
1578
1584
  /**
1579
1585
  * Returns the specifications for a given service
1580
1586
  * @param id - The id of the service to retrieve the specifications for
1581
1587
  * @param version - Optional version of the service
1582
1588
  * @returns
1583
1589
  */
1584
- getSpecificationFilesForService: getSpecificationFilesForService(join16(path5)),
1590
+ getSpecificationFilesForService: getSpecificationFilesForService(join16(path6)),
1585
1591
  /**
1586
1592
  * Check to see if a service version exists
1587
1593
  * @param id - The id of the service
1588
1594
  * @param version - The version of the service (supports semver)
1589
1595
  * @returns
1590
1596
  */
1591
- serviceHasVersion: serviceHasVersion(join16(path5)),
1597
+ serviceHasVersion: serviceHasVersion(join16(path6)),
1592
1598
  /**
1593
1599
  * Add an event to a service by it's id.
1594
1600
  *
@@ -1608,7 +1614,7 @@ var index_default = (path5) => {
1608
1614
  *
1609
1615
  * ```
1610
1616
  */
1611
- addEventToService: addMessageToService(join16(path5)),
1617
+ addEventToService: addMessageToService(join16(path6)),
1612
1618
  /**
1613
1619
  * Add a data store to a service by it's id.
1614
1620
  *
@@ -1625,7 +1631,7 @@ var index_default = (path5) => {
1625
1631
  *
1626
1632
  * ```
1627
1633
  */
1628
- addDataStoreToService: addDataStoreToService(join16(path5)),
1634
+ addDataStoreToService: addDataStoreToService(join16(path6)),
1629
1635
  /**
1630
1636
  * Add a command to a service by it's id.
1631
1637
  *
@@ -1645,7 +1651,7 @@ var index_default = (path5) => {
1645
1651
  *
1646
1652
  * ```
1647
1653
  */
1648
- addCommandToService: addMessageToService(join16(path5)),
1654
+ addCommandToService: addMessageToService(join16(path6)),
1649
1655
  /**
1650
1656
  * Add a query to a service by it's id.
1651
1657
  *
@@ -1665,7 +1671,7 @@ var index_default = (path5) => {
1665
1671
  *
1666
1672
  * ```
1667
1673
  */
1668
- addQueryToService: addMessageToService(join16(path5)),
1674
+ addQueryToService: addMessageToService(join16(path6)),
1669
1675
  /**
1670
1676
  * Add an entity to a service by its id.
1671
1677
  *
@@ -1683,7 +1689,7 @@ var index_default = (path5) => {
1683
1689
  *
1684
1690
  * ```
1685
1691
  */
1686
- addEntityToService: addEntityToService(join16(path5)),
1692
+ addEntityToService: addEntityToService(join16(path6)),
1687
1693
  /**
1688
1694
  * Check to see if a service exists by it's path.
1689
1695
  *
@@ -1700,13 +1706,13 @@ var index_default = (path5) => {
1700
1706
  * @param path - The path to the service to check
1701
1707
  * @returns boolean
1702
1708
  */
1703
- isService: isService(join16(path5)),
1709
+ isService: isService(join16(path6)),
1704
1710
  /**
1705
1711
  * Converts a file to a service.
1706
1712
  * @param file - The file to convert to a service.
1707
1713
  * @returns The service.
1708
1714
  */
1709
- toService: toService(join16(path5)),
1715
+ toService: toService(join16(path6)),
1710
1716
  /**
1711
1717
  * ================================
1712
1718
  * Domains
@@ -1719,39 +1725,39 @@ var index_default = (path5) => {
1719
1725
  * @param options - Optional options to write the event
1720
1726
  *
1721
1727
  */
1722
- writeDomain: writeDomain(join16(path5, "domains")),
1728
+ writeDomain: writeDomain(join16(path6, "domains")),
1723
1729
  /**
1724
1730
  * Returns a domain from EventCatalog
1725
1731
  * @param id - The id of the domain to retrieve
1726
1732
  * @param version - Optional id of the version to get (supports semver)
1727
1733
  * @returns Domain|Undefined
1728
1734
  */
1729
- getDomain: getDomain(join16(path5, "domains")),
1735
+ getDomain: getDomain(join16(path6, "domains")),
1730
1736
  /**
1731
1737
  * Returns all domains from EventCatalog
1732
1738
  * @param latestOnly - optional boolean, set to true to get only latest versions
1733
1739
  * @returns Domain[]|Undefined
1734
1740
  */
1735
- getDomains: getDomains(join16(path5)),
1741
+ getDomains: getDomains(join16(path6)),
1736
1742
  /**
1737
1743
  * Moves a given domain id to the version directory
1738
1744
  * @param directory
1739
1745
  */
1740
- versionDomain: versionDomain(join16(path5, "domains")),
1746
+ versionDomain: versionDomain(join16(path6, "domains")),
1741
1747
  /**
1742
1748
  * Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
1743
1749
  *
1744
1750
  * @param path - The path to your domain, e.g. `/Payment`
1745
1751
  *
1746
1752
  */
1747
- rmDomain: rmDomain(join16(path5, "domains")),
1753
+ rmDomain: rmDomain(join16(path6, "domains")),
1748
1754
  /**
1749
1755
  * Remove an service by an domain id
1750
1756
  *
1751
1757
  * @param id - The id of the domain you want to remove
1752
1758
  *
1753
1759
  */
1754
- rmDomainById: rmDomainById(join16(path5, "domains")),
1760
+ rmDomainById: rmDomainById(join16(path6, "domains")),
1755
1761
  /**
1756
1762
  * Adds a file to the given domain
1757
1763
  * @param id - The id of the domain to add the file to
@@ -1759,28 +1765,28 @@ var index_default = (path5) => {
1759
1765
  * @param version - Optional version of the domain to add the file to
1760
1766
  * @returns
1761
1767
  */
1762
- addFileToDomain: addFileToDomain(join16(path5, "domains")),
1768
+ addFileToDomain: addFileToDomain(join16(path6, "domains")),
1763
1769
  /**
1764
1770
  * Adds an ubiquitous language dictionary to a domain
1765
1771
  * @param id - The id of the domain to add the ubiquitous language to
1766
1772
  * @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
1767
1773
  * @param version - Optional version of the domain to add the ubiquitous language to
1768
1774
  */
1769
- addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(join16(path5, "domains")),
1775
+ addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(join16(path6, "domains")),
1770
1776
  /**
1771
1777
  * Get the ubiquitous language dictionary from a domain
1772
1778
  * @param id - The id of the domain to get the ubiquitous language from
1773
1779
  * @param version - Optional version of the domain to get the ubiquitous language from
1774
1780
  * @returns
1775
1781
  */
1776
- getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(join16(path5, "domains")),
1782
+ getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(join16(path6, "domains")),
1777
1783
  /**
1778
1784
  * Check to see if a domain version exists
1779
1785
  * @param id - The id of the domain
1780
1786
  * @param version - The version of the domain (supports semver)
1781
1787
  * @returns
1782
1788
  */
1783
- domainHasVersion: domainHasVersion(join16(path5)),
1789
+ domainHasVersion: domainHasVersion(join16(path6)),
1784
1790
  /**
1785
1791
  * Adds a given service to a domain
1786
1792
  * @param id - The id of the domain
@@ -1788,7 +1794,7 @@ var index_default = (path5) => {
1788
1794
  * @param version - (Optional) The version of the domain to add the service to
1789
1795
  * @returns
1790
1796
  */
1791
- addServiceToDomain: addServiceToDomain(join16(path5, "domains")),
1797
+ addServiceToDomain: addServiceToDomain(join16(path6, "domains")),
1792
1798
  /**
1793
1799
  * Adds a given subdomain to a domain
1794
1800
  * @param id - The id of the domain
@@ -1796,7 +1802,7 @@ var index_default = (path5) => {
1796
1802
  * @param version - (Optional) The version of the domain to add the subdomain to
1797
1803
  * @returns
1798
1804
  */
1799
- addSubDomainToDomain: addSubDomainToDomain(join16(path5, "domains")),
1805
+ addSubDomainToDomain: addSubDomainToDomain(join16(path6, "domains")),
1800
1806
  /**
1801
1807
  * Adds an entity to a domain
1802
1808
  * @param id - The id of the domain
@@ -1804,7 +1810,7 @@ var index_default = (path5) => {
1804
1810
  * @param version - (Optional) The version of the domain to add the entity to
1805
1811
  * @returns
1806
1812
  */
1807
- addEntityToDomain: addEntityToDomain(join16(path5, "domains")),
1813
+ addEntityToDomain: addEntityToDomain(join16(path6, "domains")),
1808
1814
  /**
1809
1815
  * ================================
1810
1816
  * Teams
@@ -1817,25 +1823,25 @@ var index_default = (path5) => {
1817
1823
  * @param options - Optional options to write the team
1818
1824
  *
1819
1825
  */
1820
- writeTeam: writeTeam(join16(path5, "teams")),
1826
+ writeTeam: writeTeam(join16(path6, "teams")),
1821
1827
  /**
1822
1828
  * Returns a team from EventCatalog
1823
1829
  * @param id - The id of the team to retrieve
1824
1830
  * @returns Team|Undefined
1825
1831
  */
1826
- getTeam: getTeam(join16(path5, "teams")),
1832
+ getTeam: getTeam(join16(path6, "teams")),
1827
1833
  /**
1828
1834
  * Returns all teams from EventCatalog
1829
1835
  * @returns Team[]|Undefined
1830
1836
  */
1831
- getTeams: getTeams(join16(path5, "teams")),
1837
+ getTeams: getTeams(join16(path6, "teams")),
1832
1838
  /**
1833
1839
  * Remove a team by the team id
1834
1840
  *
1835
1841
  * @param id - The id of the team you want to remove
1836
1842
  *
1837
1843
  */
1838
- rmTeamById: rmTeamById(join16(path5, "teams")),
1844
+ rmTeamById: rmTeamById(join16(path6, "teams")),
1839
1845
  /**
1840
1846
  * ================================
1841
1847
  * Users
@@ -1848,25 +1854,25 @@ var index_default = (path5) => {
1848
1854
  * @param options - Optional options to write the user
1849
1855
  *
1850
1856
  */
1851
- writeUser: writeUser(join16(path5, "users")),
1857
+ writeUser: writeUser(join16(path6, "users")),
1852
1858
  /**
1853
1859
  * Returns a user from EventCatalog
1854
1860
  * @param id - The id of the user to retrieve
1855
1861
  * @returns User|Undefined
1856
1862
  */
1857
- getUser: getUser(join16(path5, "users")),
1863
+ getUser: getUser(join16(path6, "users")),
1858
1864
  /**
1859
1865
  * Returns all user from EventCatalog
1860
1866
  * @returns User[]|Undefined
1861
1867
  */
1862
- getUsers: getUsers(join16(path5)),
1868
+ getUsers: getUsers(join16(path6)),
1863
1869
  /**
1864
1870
  * Remove a user by the user id
1865
1871
  *
1866
1872
  * @param id - The id of the user you want to remove
1867
1873
  *
1868
1874
  */
1869
- rmUserById: rmUserById(join16(path5, "users")),
1875
+ rmUserById: rmUserById(join16(path6, "users")),
1870
1876
  /**
1871
1877
  * ================================
1872
1878
  * Custom Docs
@@ -1877,32 +1883,32 @@ var index_default = (path5) => {
1877
1883
  * @param path - The path to the custom doc to retrieve
1878
1884
  * @returns CustomDoc|Undefined
1879
1885
  */
1880
- getCustomDoc: getCustomDoc(join16(path5, "docs")),
1886
+ getCustomDoc: getCustomDoc(join16(path6, "docs")),
1881
1887
  /**
1882
1888
  * Returns all custom docs from EventCatalog
1883
1889
  * @param options - Optional options to get custom docs from a specific path
1884
1890
  * @returns CustomDoc[]|Undefined
1885
1891
  */
1886
- getCustomDocs: getCustomDocs(join16(path5, "docs")),
1892
+ getCustomDocs: getCustomDocs(join16(path6, "docs")),
1887
1893
  /**
1888
1894
  * Writes a custom doc to EventCatalog
1889
1895
  * @param customDoc - The custom doc to write
1890
1896
  * @param options - Optional options to write the custom doc
1891
1897
  *
1892
1898
  */
1893
- writeCustomDoc: writeCustomDoc(join16(path5, "docs")),
1899
+ writeCustomDoc: writeCustomDoc(join16(path6, "docs")),
1894
1900
  /**
1895
1901
  * Removes a custom doc from EventCatalog
1896
1902
  * @param path - The path to the custom doc to remove
1897
1903
  *
1898
1904
  */
1899
- rmCustomDoc: rmCustomDoc(join16(path5, "docs")),
1905
+ rmCustomDoc: rmCustomDoc(join16(path6, "docs")),
1900
1906
  /**
1901
1907
  * Dumps the catalog to a JSON file.
1902
1908
  * @param directory - The directory to dump the catalog to
1903
1909
  * @returns A JSON file with the catalog
1904
1910
  */
1905
- dumpCatalog: dumpCatalog(join16(path5)),
1911
+ dumpCatalog: dumpCatalog(join16(path6)),
1906
1912
  /**
1907
1913
  * Returns the event catalog configuration file.
1908
1914
  * The event catalog configuration file is the file that contains the configuration for the event catalog.
@@ -1910,7 +1916,7 @@ var index_default = (path5) => {
1910
1916
  * @param directory - The directory of the catalog.
1911
1917
  * @returns A JSON object with the configuration for the event catalog.
1912
1918
  */
1913
- getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(join16(path5)),
1919
+ getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(join16(path6)),
1914
1920
  /**
1915
1921
  * ================================
1916
1922
  * Resources Utils
@@ -1920,6 +1926,10 @@ var index_default = (path5) => {
1920
1926
  * Returns the path to a given resource by id and version
1921
1927
  */
1922
1928
  getResourcePath,
1929
+ /**
1930
+ * Returns the folder name of a given resource
1931
+ */
1932
+ getResourceFolderName,
1923
1933
  /**
1924
1934
  * ================================
1925
1935
  * General Message Utils
@@ -1931,33 +1941,33 @@ var index_default = (path5) => {
1931
1941
  * @param path - The path to the message to retrieve
1932
1942
  * @returns Message|Undefined
1933
1943
  */
1934
- getMessageBySchemaPath: getMessageBySchemaPath(join16(path5)),
1944
+ getMessageBySchemaPath: getMessageBySchemaPath(join16(path6)),
1935
1945
  /**
1936
1946
  * Returns the producers and consumers (services) for a given message
1937
1947
  * @param id - The id of the message to get the producers and consumers for
1938
1948
  * @param version - Optional version of the message
1939
1949
  * @returns { producers: Service[], consumers: Service[] }
1940
1950
  */
1941
- getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join16(path5)),
1951
+ getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join16(path6)),
1942
1952
  /**
1943
1953
  * Returns the consumers of a given schema path
1944
1954
  * @param path - The path to the schema to get the consumers for
1945
1955
  * @returns Service[]
1946
1956
  */
1947
- getConsumersOfSchema: getConsumersOfSchema(join16(path5)),
1957
+ getConsumersOfSchema: getConsumersOfSchema(join16(path6)),
1948
1958
  /**
1949
1959
  * Returns the producers of a given schema path
1950
1960
  * @param path - The path to the schema to get the producers for
1951
1961
  * @returns Service[]
1952
1962
  */
1953
- getProducersOfSchema: getProducersOfSchema(join16(path5)),
1963
+ getProducersOfSchema: getProducersOfSchema(join16(path6)),
1954
1964
  /**
1955
1965
  * Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
1956
1966
  * @param id - The id of the resource to get the owners for
1957
1967
  * @param version - Optional version of the resource
1958
1968
  * @returns { owners: User[] }
1959
1969
  */
1960
- getOwnersForResource: getOwnersForResource(join16(path5)),
1970
+ getOwnersForResource: getOwnersForResource(join16(path6)),
1961
1971
  /**
1962
1972
  * ================================
1963
1973
  * Entities
@@ -1969,13 +1979,13 @@ var index_default = (path5) => {
1969
1979
  * @param version - Optional id of the version to get (supports semver)
1970
1980
  * @returns Entity|Undefined
1971
1981
  */
1972
- getEntity: getEntity(join16(path5)),
1982
+ getEntity: getEntity(join16(path6)),
1973
1983
  /**
1974
1984
  * Returns all entities from EventCatalog
1975
1985
  * @param latestOnly - optional boolean, set to true to get only latest versions
1976
1986
  * @returns Entity[]|Undefined
1977
1987
  */
1978
- getEntities: getEntities(join16(path5)),
1988
+ getEntities: getEntities(join16(path6)),
1979
1989
  /**
1980
1990
  * Adds an entity to EventCatalog
1981
1991
  *
@@ -1983,33 +1993,33 @@ var index_default = (path5) => {
1983
1993
  * @param options - Optional options to write the entity
1984
1994
  *
1985
1995
  */
1986
- writeEntity: writeEntity(join16(path5, "entities")),
1996
+ writeEntity: writeEntity(join16(path6, "entities")),
1987
1997
  /**
1988
1998
  * Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
1989
1999
  *
1990
2000
  * @param path - The path to your entity, e.g. `/User`
1991
2001
  *
1992
2002
  */
1993
- rmEntity: rmEntity(join16(path5, "entities")),
2003
+ rmEntity: rmEntity(join16(path6, "entities")),
1994
2004
  /**
1995
2005
  * Remove an entity by an entity id
1996
2006
  *
1997
2007
  * @param id - The id of the entity you want to remove
1998
2008
  *
1999
2009
  */
2000
- rmEntityById: rmEntityById(join16(path5)),
2010
+ rmEntityById: rmEntityById(join16(path6)),
2001
2011
  /**
2002
2012
  * Moves a given entity id to the version directory
2003
2013
  * @param id - The id of the entity to version
2004
2014
  */
2005
- versionEntity: versionEntity(join16(path5)),
2015
+ versionEntity: versionEntity(join16(path6)),
2006
2016
  /**
2007
2017
  * Check to see if an entity version exists
2008
2018
  * @param id - The id of the entity
2009
2019
  * @param version - The version of the entity (supports semver)
2010
2020
  * @returns
2011
2021
  */
2012
- entityHasVersion: entityHasVersion(join16(path5)),
2022
+ entityHasVersion: entityHasVersion(join16(path6)),
2013
2023
  /**
2014
2024
  * ================================
2015
2025
  * Data Stores
@@ -2021,42 +2031,42 @@ var index_default = (path5) => {
2021
2031
  * @param options - Optional options to write the data store
2022
2032
  *
2023
2033
  */
2024
- writeDataStore: writeDataStore(join16(path5, "containers")),
2034
+ writeDataStore: writeDataStore(join16(path6, "containers")),
2025
2035
  /**
2026
2036
  * Returns a data store from EventCatalog
2027
2037
  * @param id - The id of the data store to retrieve
2028
2038
  * @param version - Optional id of the version to get (supports semver)
2029
2039
  * @returns Container|Undefined
2030
2040
  */
2031
- getDataStore: getDataStore(join16(path5)),
2041
+ getDataStore: getDataStore(join16(path6)),
2032
2042
  /**
2033
2043
  * Returns all data stores from EventCatalog
2034
2044
  * @param latestOnly - optional boolean, set to true to get only latest versions
2035
2045
  * @returns Container[]|Undefined
2036
2046
  */
2037
- getDataStores: getDataStores(join16(path5)),
2047
+ getDataStores: getDataStores(join16(path6)),
2038
2048
  /**
2039
2049
  * Version a data store by its id
2040
2050
  * @param id - The id of the data store to version
2041
2051
  */
2042
- versionDataStore: versionDataStore(join16(path5, "containers")),
2052
+ versionDataStore: versionDataStore(join16(path6, "containers")),
2043
2053
  /**
2044
2054
  * Remove a data store by its path
2045
2055
  * @param path - The path to the data store to remove
2046
2056
  */
2047
- rmDataStore: rmDataStore(join16(path5, "containers")),
2057
+ rmDataStore: rmDataStore(join16(path6, "containers")),
2048
2058
  /**
2049
2059
  * Remove a data store by its id
2050
2060
  * @param id - The id of the data store to remove
2051
2061
  */
2052
- rmDataStoreById: rmDataStoreById(join16(path5)),
2062
+ rmDataStoreById: rmDataStoreById(join16(path6)),
2053
2063
  /**
2054
2064
  * Check to see if a data store version exists
2055
2065
  * @param id - The id of the data store
2056
2066
  * @param version - The version of the data store (supports semver)
2057
2067
  * @returns
2058
2068
  */
2059
- dataStoreHasVersion: dataStoreHasVersion(join16(path5)),
2069
+ dataStoreHasVersion: dataStoreHasVersion(join16(path6)),
2060
2070
  /**
2061
2071
  * Adds a file to a data store by its id
2062
2072
  * @param id - The id of the data store to add the file to
@@ -2064,14 +2074,14 @@ var index_default = (path5) => {
2064
2074
  * @param version - Optional version of the data store to add the file to
2065
2075
  * @returns
2066
2076
  */
2067
- addFileToDataStore: addFileToDataStore(join16(path5)),
2077
+ addFileToDataStore: addFileToDataStore(join16(path6)),
2068
2078
  /**
2069
2079
  * Writes a data store to a service by its id
2070
2080
  * @param dataStore - The data store to write
2071
2081
  * @param service - The service to write the data store to
2072
2082
  * @returns
2073
2083
  */
2074
- writeDataStoreToService: writeDataStoreToService(join16(path5))
2084
+ writeDataStoreToService: writeDataStoreToService(join16(path6))
2075
2085
  };
2076
2086
  };
2077
2087
  export {