@eventcatalog/sdk 2.7.6 → 2.8.1

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 (60) hide show
  1. package/dist/channels.js +18 -9
  2. package/dist/channels.js.map +1 -1
  3. package/dist/channels.mjs +11 -2
  4. package/dist/channels.mjs.map +1 -1
  5. package/dist/commands.js +14 -5
  6. package/dist/commands.js.map +1 -1
  7. package/dist/commands.mjs +11 -2
  8. package/dist/commands.mjs.map +1 -1
  9. package/dist/containers.d.mts +179 -0
  10. package/dist/containers.d.ts +179 -0
  11. package/dist/containers.js +374 -0
  12. package/dist/containers.js.map +1 -0
  13. package/dist/containers.mjs +331 -0
  14. package/dist/containers.mjs.map +1 -0
  15. package/dist/custom-docs.js +6 -5
  16. package/dist/custom-docs.js.map +1 -1
  17. package/dist/custom-docs.mjs +1 -0
  18. package/dist/custom-docs.mjs.map +1 -1
  19. package/dist/domains.js +17 -8
  20. package/dist/domains.js.map +1 -1
  21. package/dist/domains.mjs +11 -2
  22. package/dist/domains.mjs.map +1 -1
  23. package/dist/entities.js +13 -4
  24. package/dist/entities.js.map +1 -1
  25. package/dist/entities.mjs +11 -2
  26. package/dist/entities.mjs.map +1 -1
  27. package/dist/eventcatalog.js +255 -152
  28. package/dist/eventcatalog.js.map +1 -1
  29. package/dist/eventcatalog.mjs +209 -106
  30. package/dist/eventcatalog.mjs.map +1 -1
  31. package/dist/events.js +14 -5
  32. package/dist/events.js.map +1 -1
  33. package/dist/events.mjs +11 -2
  34. package/dist/events.mjs.map +1 -1
  35. package/dist/index.d.mts +97 -30
  36. package/dist/index.d.ts +97 -30
  37. package/dist/index.js +255 -152
  38. package/dist/index.js.map +1 -1
  39. package/dist/index.mjs +203 -100
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/messages.js +4 -3
  42. package/dist/messages.js.map +1 -1
  43. package/dist/messages.mjs +1 -0
  44. package/dist/messages.mjs.map +1 -1
  45. package/dist/queries.js +14 -5
  46. package/dist/queries.js.map +1 -1
  47. package/dist/queries.mjs +11 -2
  48. package/dist/queries.mjs.map +1 -1
  49. package/dist/services.js +20 -11
  50. package/dist/services.js.map +1 -1
  51. package/dist/services.mjs +11 -2
  52. package/dist/services.mjs.map +1 -1
  53. package/dist/teams.js +9 -8
  54. package/dist/teams.js.map +1 -1
  55. package/dist/teams.mjs +1 -0
  56. package/dist/teams.mjs.map +1 -1
  57. package/dist/types.d.d.mts +24 -1
  58. package/dist/types.d.d.ts +24 -1
  59. package/dist/types.d.js.map +1 -1
  60. package/package.json +1 -1
@@ -35,14 +35,14 @@ __export(eventcatalog_exports, {
35
35
  });
36
36
  module.exports = __toCommonJS(eventcatalog_exports);
37
37
  var import_fs = __toESM(require("fs"));
38
- var import_node_path15 = __toESM(require("path"));
38
+ var import_node_path17 = __toESM(require("path"));
39
39
 
40
40
  // src/index.ts
41
- var import_node_path14 = require("path");
41
+ var import_node_path16 = require("path");
42
42
 
43
43
  // src/events.ts
44
44
  var import_promises2 = __toESM(require("fs/promises"));
45
- var import_node_path2 = require("path");
45
+ var import_node_path3 = require("path");
46
46
 
47
47
  // src/internal/utils.ts
48
48
  var import_glob = require("glob");
@@ -159,6 +159,7 @@ var import_promises = __toESM(require("fs/promises"));
159
159
  var import_node_fs2 = __toESM(require("fs"));
160
160
  var import_semver2 = require("semver");
161
161
  var import_proper_lockfile = require("proper-lockfile");
162
+ var import_node_path2 = require("path");
162
163
  var versionResource = async (catalogDir, id) => {
163
164
  const files = await getFiles(`${catalogDir}/**/index.{md,mdx}`);
164
165
  const matchedFiles = await searchFilesForId(files, id);
@@ -166,16 +167,24 @@ var versionResource = async (catalogDir, id) => {
166
167
  throw new Error(`No resource found with id: ${id}`);
167
168
  }
168
169
  const file = matchedFiles[0];
169
- const sourceDirectory = (0, import_path.dirname)(file);
170
+ const sourceDirectory = (0, import_path.dirname)(file).replace(/\/versioned?\/[^/]+\//, "/");
170
171
  const { data: { version = "0.0.1" } = {} } = import_gray_matter2.default.read(file);
171
172
  const targetDirectory = getVersionedDirectory(sourceDirectory, version);
172
173
  import_node_fs2.default.mkdirSync(targetDirectory, { recursive: true });
174
+ const ignoreListToCopy = ["events", "commands", "queries", "versioned"];
173
175
  await copyDir(catalogDir, sourceDirectory, targetDirectory, (src) => {
174
- return !src.includes("versioned");
176
+ const folderName = (0, import_node_path2.basename)(src);
177
+ if (ignoreListToCopy.includes(folderName)) {
178
+ return false;
179
+ }
180
+ return true;
175
181
  });
176
182
  await import_promises.default.readdir(sourceDirectory).then(async (resourceFiles) => {
177
183
  await Promise.all(
178
184
  resourceFiles.map(async (file2) => {
185
+ if (ignoreListToCopy.includes(file2)) {
186
+ return;
187
+ }
179
188
  if (file2 !== "versioned") {
180
189
  import_node_fs2.default.rmSync((0, import_path.join)(sourceDirectory, file2), { recursive: true });
181
190
  }
@@ -371,11 +380,11 @@ var writeEventToService = (directory) => async (event, service, options = { path
371
380
  throw new Error("Service not found");
372
381
  }
373
382
  let pathForEvent = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/events` : `${resourcePath.directory}/events`;
374
- pathForEvent = (0, import_node_path2.join)(pathForEvent, event.id);
383
+ pathForEvent = (0, import_node_path3.join)(pathForEvent, event.id);
375
384
  await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
376
385
  };
377
386
  var rmEvent = (directory) => async (path5) => {
378
- await import_promises2.default.rm((0, import_node_path2.join)(directory, path5), { recursive: true });
387
+ await import_promises2.default.rm((0, import_node_path3.join)(directory, path5), { recursive: true });
379
388
  };
380
389
  var rmEventById = (directory) => async (id, version, persistFiles) => {
381
390
  await rmResourceById(directory, id, version, { type: "event", persistFiles });
@@ -392,7 +401,7 @@ var eventHasVersion = (directory) => async (id, version) => {
392
401
 
393
402
  // src/commands.ts
394
403
  var import_promises3 = __toESM(require("fs/promises"));
395
- var import_node_path3 = require("path");
404
+ var import_node_path4 = require("path");
396
405
  var getCommand = (directory) => async (id, version, options) => getResource(directory, id, version, { type: "command", ...options });
397
406
  var getCommands = (directory) => async (options) => getResources(directory, { type: "commands", ...options });
398
407
  var writeCommand = (directory) => async (command, options = {
@@ -407,11 +416,11 @@ var writeCommandToService = (directory) => async (command, service, options = {
407
416
  throw new Error("Service not found");
408
417
  }
409
418
  let pathForCommand = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/commands` : `${resourcePath.directory}/commands`;
410
- pathForCommand = (0, import_node_path3.join)(pathForCommand, command.id);
419
+ pathForCommand = (0, import_node_path4.join)(pathForCommand, command.id);
411
420
  await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
412
421
  };
413
422
  var rmCommand = (directory) => async (path5) => {
414
- await import_promises3.default.rm((0, import_node_path3.join)(directory, path5), { recursive: true });
423
+ await import_promises3.default.rm((0, import_node_path4.join)(directory, path5), { recursive: true });
415
424
  };
416
425
  var rmCommandById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "command", persistFiles });
417
426
  var versionCommand = (directory) => async (id) => versionResource(directory, id);
@@ -426,7 +435,7 @@ var commandHasVersion = (directory) => async (id, version) => {
426
435
 
427
436
  // src/queries.ts
428
437
  var import_promises4 = __toESM(require("fs/promises"));
429
- var import_node_path4 = require("path");
438
+ var import_node_path5 = require("path");
430
439
  var getQuery = (directory) => async (id, version, options) => getResource(directory, id, version, { type: "query", ...options });
431
440
  var writeQuery = (directory) => async (query, options = {
432
441
  path: "",
@@ -441,11 +450,11 @@ var writeQueryToService = (directory) => async (query, service, options = { path
441
450
  throw new Error("Service not found");
442
451
  }
443
452
  let pathForQuery = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/queries` : `${resourcePath.directory}/queries`;
444
- pathForQuery = (0, import_node_path4.join)(pathForQuery, query.id);
453
+ pathForQuery = (0, import_node_path5.join)(pathForQuery, query.id);
445
454
  await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
446
455
  };
447
456
  var rmQuery = (directory) => async (path5) => {
448
- await import_promises4.default.rm((0, import_node_path4.join)(directory, path5), { recursive: true });
457
+ await import_promises4.default.rm((0, import_node_path5.join)(directory, path5), { recursive: true });
449
458
  };
450
459
  var rmQueryById = (directory) => async (id, version, persistFiles) => {
451
460
  await rmResourceById(directory, id, version, { type: "query", persistFiles });
@@ -462,7 +471,7 @@ var queryHasVersion = (directory) => async (id, version) => {
462
471
 
463
472
  // src/services.ts
464
473
  var import_promises5 = __toESM(require("fs/promises"));
465
- var import_node_path5 = require("path");
474
+ var import_node_path6 = require("path");
466
475
  var getService = (directory) => async (id, version) => getResource(directory, id, version, { type: "service" });
467
476
  var getServiceByPath = (directory) => async (path5) => {
468
477
  const service = await getResource(directory, void 0, void 0, { type: "service" }, path5);
@@ -494,12 +503,12 @@ var writeVersionedService = (directory) => async (service) => {
494
503
  };
495
504
  var writeServiceToDomain = (directory) => async (service, domain, options = { path: "", format: "mdx", override: false }) => {
496
505
  let pathForService = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/services` : `/${domain.id}/services`;
497
- pathForService = (0, import_node_path5.join)(pathForService, service.id);
506
+ pathForService = (0, import_node_path6.join)(pathForService, service.id);
498
507
  await writeResource(directory, { ...service }, { ...options, path: pathForService, type: "service" });
499
508
  };
500
509
  var versionService = (directory) => async (id) => versionResource(directory, id);
501
510
  var rmService = (directory) => async (path5) => {
502
- await import_promises5.default.rm((0, import_node_path5.join)(directory, path5), { recursive: true });
511
+ await import_promises5.default.rm((0, import_node_path6.join)(directory, path5), { recursive: true });
503
512
  };
504
513
  var rmServiceById = (directory) => async (id, version, persistFiles) => {
505
514
  await rmResourceById(directory, id, version, { type: "service", persistFiles });
@@ -526,7 +535,7 @@ var getSpecificationFilesForService = (directory) => async (id, version) => {
526
535
  throw new Error(`Specification file name for ${fileName} is undefined`);
527
536
  }
528
537
  const rawFile = await getFileFromResource(directory, id, { fileName }, version);
529
- return { key, content: rawFile, fileName, path: (0, import_node_path5.join)((0, import_node_path5.dirname)(filePathToService), fileName) };
538
+ return { key, content: rawFile, fileName, path: (0, import_node_path6.join)((0, import_node_path6.dirname)(filePathToService), fileName) };
530
539
  });
531
540
  specs = await Promise.all(getSpecs);
532
541
  }
@@ -535,7 +544,7 @@ var getSpecificationFilesForService = (directory) => async (id, version) => {
535
544
  var addMessageToService = (directory) => async (id, direction, event, version) => {
536
545
  let service = await getService(directory)(id, version);
537
546
  const servicePath = await getResourcePath(directory, id, version);
538
- const extension = (0, import_node_path5.extname)(servicePath?.fullPath || "");
547
+ const extension = (0, import_node_path6.extname)(servicePath?.fullPath || "");
539
548
  if (direction === "sends") {
540
549
  if (service.sends === void 0) {
541
550
  service.sends = [];
@@ -564,7 +573,7 @@ var addMessageToService = (directory) => async (id, direction, event, version) =
564
573
  throw new Error(`Cannot find service ${id} in the catalog`);
565
574
  }
566
575
  const path5 = existingResource.split(/[\\/]+services/)[0];
567
- const pathToResource = (0, import_node_path5.join)(path5, "services");
576
+ const pathToResource = (0, import_node_path6.join)(path5, "services");
568
577
  await rmServiceById(directory)(id, version);
569
578
  await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
570
579
  };
@@ -574,7 +583,7 @@ var serviceHasVersion = (directory) => async (id, version) => {
574
583
  };
575
584
  var isService = (directory) => async (path5) => {
576
585
  const service = await getServiceByPath(directory)(path5);
577
- const relativePath = (0, import_node_path5.relative)(directory, path5);
586
+ const relativePath = (0, import_node_path6.relative)(directory, path5);
578
587
  const segments = relativePath.split(/[/\\]+/);
579
588
  return !!service && segments.includes("services");
580
589
  };
@@ -582,7 +591,7 @@ var toService = (directory) => async (file) => toResource(directory, file);
582
591
  var addEntityToService = (directory) => async (id, entity, version) => {
583
592
  let service = await getService(directory)(id, version);
584
593
  const servicePath = await getResourcePath(directory, id, version);
585
- const extension = (0, import_node_path5.extname)(servicePath?.fullPath || "");
594
+ const extension = (0, import_node_path6.extname)(servicePath?.fullPath || "");
586
595
  if (service.entities === void 0) {
587
596
  service.entities = [];
588
597
  }
@@ -597,14 +606,14 @@ var addEntityToService = (directory) => async (id, entity, version) => {
597
606
  throw new Error(`Cannot find service ${id} in the catalog`);
598
607
  }
599
608
  const path5 = existingResource.split(/[\\/]+services/)[0];
600
- const pathToResource = (0, import_node_path5.join)(path5, "services");
609
+ const pathToResource = (0, import_node_path6.join)(path5, "services");
601
610
  await rmServiceById(directory)(id, version);
602
611
  await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
603
612
  };
604
613
 
605
614
  // src/domains.ts
606
615
  var import_promises6 = __toESM(require("fs/promises"));
607
- var import_node_path6 = __toESM(require("path"));
616
+ var import_node_path7 = __toESM(require("path"));
608
617
  var import_node_fs3 = __toESM(require("fs"));
609
618
  var import_gray_matter3 = __toESM(require("gray-matter"));
610
619
  var getDomain = (directory) => async (id, version) => getResource(directory, id, version, { type: "domain" });
@@ -630,7 +639,7 @@ var writeDomain = (directory) => async (domain, options = {
630
639
  };
631
640
  var versionDomain = (directory) => async (id) => versionResource(directory, id);
632
641
  var rmDomain = (directory) => async (path5) => {
633
- await import_promises6.default.rm((0, import_node_path6.join)(directory, path5), { recursive: true });
642
+ await import_promises6.default.rm((0, import_node_path7.join)(directory, path5), { recursive: true });
634
643
  };
635
644
  var rmDomainById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "domain", persistFiles });
636
645
  var addFileToDomain = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
@@ -642,7 +651,7 @@ var addUbiquitousLanguageToDomain = (directory) => async (id, ubiquitousLanguage
642
651
  };
643
652
  var getUbiquitousLanguageFromDomain = (directory) => async (id, version) => {
644
653
  const pathToDomain = await findFileById(directory, id, version) || "";
645
- const pathToUbiquitousLanguage = import_node_path6.default.join(import_node_path6.default.dirname(pathToDomain), "ubiquitous-language.mdx");
654
+ const pathToUbiquitousLanguage = import_node_path7.default.join(import_node_path7.default.dirname(pathToDomain), "ubiquitous-language.mdx");
646
655
  const fileExists = import_node_fs3.default.existsSync(pathToUbiquitousLanguage);
647
656
  if (!fileExists) {
648
657
  return void 0;
@@ -657,7 +666,7 @@ var domainHasVersion = (directory) => async (id, version) => {
657
666
  var addServiceToDomain = (directory) => async (id, service, version) => {
658
667
  let domain = await getDomain(directory)(id, version);
659
668
  const domainPath = await getResourcePath(directory, id, version);
660
- const extension = import_node_path6.default.extname(domainPath?.fullPath || "");
669
+ const extension = import_node_path7.default.extname(domainPath?.fullPath || "");
661
670
  if (domain.services === void 0) {
662
671
  domain.services = [];
663
672
  }
@@ -672,7 +681,7 @@ var addServiceToDomain = (directory) => async (id, service, version) => {
672
681
  var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
673
682
  let domain = await getDomain(directory)(id, version);
674
683
  const domainPath = await getResourcePath(directory, id, version);
675
- const extension = import_node_path6.default.extname(domainPath?.fullPath || "");
684
+ const extension = import_node_path7.default.extname(domainPath?.fullPath || "");
676
685
  if (domain.domains === void 0) {
677
686
  domain.domains = [];
678
687
  }
@@ -687,7 +696,7 @@ var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
687
696
  var addEntityToDomain = (directory) => async (id, entity, version) => {
688
697
  let domain = await getDomain(directory)(id, version);
689
698
  const domainPath = await getResourcePath(directory, id, version);
690
- const extension = import_node_path6.default.extname(domainPath?.fullPath || "");
699
+ const extension = import_node_path7.default.extname(domainPath?.fullPath || "");
691
700
  if (domain.entities === void 0) {
692
701
  domain.entities = [];
693
702
  }
@@ -702,12 +711,12 @@ var addEntityToDomain = (directory) => async (id, entity, version) => {
702
711
 
703
712
  // src/channels.ts
704
713
  var import_promises7 = __toESM(require("fs/promises"));
705
- var import_node_path7 = require("path");
714
+ var import_node_path8 = require("path");
706
715
  var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
707
716
  var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
708
717
  var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
709
718
  var rmChannel = (directory) => async (path5) => {
710
- await import_promises7.default.rm((0, import_node_path7.join)(directory, path5), { recursive: true });
719
+ await import_promises7.default.rm((0, import_node_path8.join)(directory, path5), { recursive: true });
711
720
  };
712
721
  var rmChannelById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "channel", persistFiles });
713
722
  var versionChannel = (directory) => async (id) => versionResource(directory, id);
@@ -737,7 +746,7 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
737
746
  const { getMessage, rmMessageById, writeMessage } = functions[collection];
738
747
  const message = await getMessage(directory)(_message.id, _message.version);
739
748
  const messagePath = await getResourcePath(directory, _message.id, _message.version);
740
- const extension = (0, import_node_path7.extname)(messagePath?.fullPath || "");
749
+ const extension = (0, import_node_path8.extname)(messagePath?.fullPath || "");
741
750
  if (!message) throw new Error(`Message ${_message.id} with version ${_message.version} not found`);
742
751
  if (message.channels === void 0) {
743
752
  message.channels = [];
@@ -749,17 +758,17 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
749
758
  throw new Error(`Cannot find message ${id} in the catalog`);
750
759
  }
751
760
  const path5 = existingResource.split(`/[\\/]+${collection}`)[0];
752
- const pathToResource = (0, import_node_path7.join)(path5, collection);
761
+ const pathToResource = (0, import_node_path8.join)(path5, collection);
753
762
  await rmMessageById(directory)(_message.id, _message.version, true);
754
763
  await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
755
764
  };
756
765
 
757
766
  // src/messages.ts
758
- var import_node_path8 = require("path");
767
+ var import_node_path9 = require("path");
759
768
  var import_gray_matter4 = __toESM(require("gray-matter"));
760
769
  var import_semver3 = require("semver");
761
770
  var getMessageBySchemaPath = (directory) => async (path5, options) => {
762
- const pathToMessage = (0, import_node_path8.dirname)(path5);
771
+ const pathToMessage = (0, import_node_path9.dirname)(path5);
763
772
  try {
764
773
  const files = await getFiles(`${directory}/${pathToMessage}/index.{md,mdx}`);
765
774
  if (!files || files.length === 0) {
@@ -851,13 +860,13 @@ var getProducersOfSchema = (directory) => async (path5) => {
851
860
  };
852
861
 
853
862
  // src/custom-docs.ts
854
- var import_node_path9 = __toESM(require("path"));
863
+ var import_node_path10 = __toESM(require("path"));
855
864
  var import_node_fs4 = __toESM(require("fs"));
856
865
  var import_promises8 = __toESM(require("fs/promises"));
857
866
  var import_gray_matter5 = __toESM(require("gray-matter"));
858
867
  var import_slugify = __toESM(require("slugify"));
859
868
  var getCustomDoc = (directory) => async (filePath) => {
860
- const fullPath = import_node_path9.default.join(directory, filePath);
869
+ const fullPath = import_node_path10.default.join(directory, filePath);
861
870
  const fullPathWithExtension = fullPath.endsWith(".mdx") ? fullPath : `${fullPath}.mdx`;
862
871
  const fileExists = import_node_fs4.default.existsSync(fullPathWithExtension);
863
872
  if (!fileExists) {
@@ -876,26 +885,26 @@ var writeCustomDoc = (directory) => async (customDoc, options = { path: "" }) =>
876
885
  const { fileName, ...rest } = customDoc;
877
886
  const name = fileName || (0, import_slugify.default)(customDoc.title, { lower: true });
878
887
  const withExtension = name.endsWith(".mdx") ? name : `${name}.mdx`;
879
- const fullPath = import_node_path9.default.join(directory, options.path || "", withExtension);
880
- import_node_fs4.default.mkdirSync(import_node_path9.default.dirname(fullPath), { recursive: true });
888
+ const fullPath = import_node_path10.default.join(directory, options.path || "", withExtension);
889
+ import_node_fs4.default.mkdirSync(import_node_path10.default.dirname(fullPath), { recursive: true });
881
890
  const document = import_gray_matter5.default.stringify(customDoc.markdown.trim(), rest);
882
891
  import_node_fs4.default.writeFileSync(fullPath, document);
883
892
  };
884
893
  var rmCustomDoc = (directory) => async (filePath) => {
885
894
  const withExtension = filePath.endsWith(".mdx") ? filePath : `${filePath}.mdx`;
886
- await import_promises8.default.rm((0, import_node_path9.join)(directory, withExtension), { recursive: true });
895
+ await import_promises8.default.rm((0, import_node_path10.join)(directory, withExtension), { recursive: true });
887
896
  };
888
897
 
889
898
  // src/teams.ts
890
899
  var import_promises9 = __toESM(require("fs/promises"));
891
900
  var import_node_fs6 = __toESM(require("fs"));
892
- var import_node_path11 = require("path");
901
+ var import_node_path12 = require("path");
893
902
  var import_gray_matter7 = __toESM(require("gray-matter"));
894
- var import_node_path12 = __toESM(require("path"));
903
+ var import_node_path13 = __toESM(require("path"));
895
904
 
896
905
  // src/users.ts
897
906
  var import_node_fs5 = __toESM(require("fs"));
898
- var import_node_path10 = require("path");
907
+ var import_node_path11 = require("path");
899
908
  var import_gray_matter6 = __toESM(require("gray-matter"));
900
909
  var getUser = (catalogDir) => async (id) => {
901
910
  const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);
@@ -933,11 +942,11 @@ var writeUser = (catalogDir) => async (user, options = {}) => {
933
942
  }
934
943
  const { markdown, ...frontmatter } = resource;
935
944
  const document = import_gray_matter6.default.stringify(markdown, frontmatter);
936
- import_node_fs5.default.mkdirSync((0, import_node_path10.join)(catalogDir, ""), { recursive: true });
937
- import_node_fs5.default.writeFileSync((0, import_node_path10.join)(catalogDir, "", `${resource.id}.mdx`), document);
945
+ import_node_fs5.default.mkdirSync((0, import_node_path11.join)(catalogDir, ""), { recursive: true });
946
+ import_node_fs5.default.writeFileSync((0, import_node_path11.join)(catalogDir, "", `${resource.id}.mdx`), document);
938
947
  };
939
948
  var rmUserById = (catalogDir) => async (id) => {
940
- import_node_fs5.default.rmSync((0, import_node_path10.join)(catalogDir, `${id}.mdx`), { recursive: true });
949
+ import_node_fs5.default.rmSync((0, import_node_path11.join)(catalogDir, `${id}.mdx`), { recursive: true });
941
950
  };
942
951
 
943
952
  // src/teams.ts
@@ -975,11 +984,11 @@ var writeTeam = (catalogDir) => async (team, options = {}) => {
975
984
  }
976
985
  const { markdown, ...frontmatter } = resource;
977
986
  const document = import_gray_matter7.default.stringify(markdown, frontmatter);
978
- import_node_fs6.default.mkdirSync((0, import_node_path11.join)(catalogDir, ""), { recursive: true });
979
- import_node_fs6.default.writeFileSync((0, import_node_path11.join)(catalogDir, "", `${resource.id}.mdx`), document);
987
+ import_node_fs6.default.mkdirSync((0, import_node_path12.join)(catalogDir, ""), { recursive: true });
988
+ import_node_fs6.default.writeFileSync((0, import_node_path12.join)(catalogDir, "", `${resource.id}.mdx`), document);
980
989
  };
981
990
  var rmTeamById = (catalogDir) => async (id) => {
982
- await import_promises9.default.rm((0, import_node_path11.join)(catalogDir, `${id}.mdx`), { recursive: true });
991
+ await import_promises9.default.rm((0, import_node_path12.join)(catalogDir, `${id}.mdx`), { recursive: true });
983
992
  };
984
993
  var getOwnersForResource = (catalogDir) => async (id, version) => {
985
994
  const resource = await getResource(catalogDir, id, version);
@@ -987,11 +996,11 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
987
996
  if (!resource) return [];
988
997
  if (!resource.owners) return [];
989
998
  for (const owner of resource.owners) {
990
- const team = await getTeam(import_node_path12.default.join(catalogDir, "teams"))(owner);
999
+ const team = await getTeam(import_node_path13.default.join(catalogDir, "teams"))(owner);
991
1000
  if (team) {
992
1001
  owners.push(team);
993
1002
  } else {
994
- const user = await getUser(import_node_path12.default.join(catalogDir, "users"))(owner);
1003
+ const user = await getUser(import_node_path13.default.join(catalogDir, "users"))(owner);
995
1004
  if (user) {
996
1005
  owners.push(user);
997
1006
  }
@@ -1002,7 +1011,7 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
1002
1011
 
1003
1012
  // src/entities.ts
1004
1013
  var import_promises10 = __toESM(require("fs/promises"));
1005
- var import_node_path13 = require("path");
1014
+ var import_node_path14 = require("path");
1006
1015
  var getEntity = (directory) => async (id, version) => getResource(directory, id, version, { type: "entity" });
1007
1016
  var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
1008
1017
  var writeEntity = (directory) => async (entity, options = {
@@ -1011,7 +1020,7 @@ var writeEntity = (directory) => async (entity, options = {
1011
1020
  format: "mdx"
1012
1021
  }) => writeResource(directory, { ...entity }, { ...options, type: "entity" });
1013
1022
  var rmEntity = (directory) => async (path5) => {
1014
- await import_promises10.default.rm((0, import_node_path13.join)(directory, path5), { recursive: true });
1023
+ await import_promises10.default.rm((0, import_node_path14.join)(directory, path5), { recursive: true });
1015
1024
  };
1016
1025
  var rmEntityById = (directory) => async (id, version, persistFiles) => {
1017
1026
  await rmResourceById(directory, id, version, { type: "entity", persistFiles });
@@ -1022,6 +1031,38 @@ var entityHasVersion = (directory) => async (id, version) => {
1022
1031
  return !!file;
1023
1032
  };
1024
1033
 
1034
+ // src/containers.ts
1035
+ var import_promises11 = __toESM(require("fs/promises"));
1036
+ var import_node_path15 = require("path");
1037
+ var getContainer = (directory) => async (id, version) => getResource(directory, id, version, { type: "container" });
1038
+ var getContainers = (directory) => async (options) => getResources(directory, { type: "containers", latestOnly: options?.latestOnly });
1039
+ var writeContainer = (directory) => async (data, options = {
1040
+ path: "",
1041
+ override: false,
1042
+ format: "mdx"
1043
+ }) => writeResource(directory, { ...data }, { ...options, type: "container" });
1044
+ var versionContainer = (directory) => async (id) => versionResource(directory, id);
1045
+ var rmContainer = (directory) => async (path5) => {
1046
+ await import_promises11.default.rm((0, import_node_path15.join)(directory, path5), { recursive: true });
1047
+ };
1048
+ var rmContainerById = (directory) => async (id, version, persistFiles) => {
1049
+ await rmResourceById(directory, id, version, { type: "container", persistFiles });
1050
+ };
1051
+ var containerHasVersion = (directory) => async (id, version) => {
1052
+ const file = await findFileById(directory, id, version);
1053
+ return !!file;
1054
+ };
1055
+ var addFileToContainer = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
1056
+ var writeContainerToService = (directory) => async (container, service, options = { path: "", format: "mdx", override: false }) => {
1057
+ const resourcePath = await getResourcePath(directory, service.id, service.version);
1058
+ if (!resourcePath) {
1059
+ throw new Error("Service not found");
1060
+ }
1061
+ let pathForContainer = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/containers` : `${resourcePath.directory}/containers`;
1062
+ pathForContainer = (0, import_node_path15.join)(pathForContainer, container.id);
1063
+ await writeResource(directory, { ...container }, { ...options, path: pathForContainer, type: "container" });
1064
+ };
1065
+
1025
1066
  // src/index.ts
1026
1067
  var index_default = (path5) => {
1027
1068
  return {
@@ -1031,13 +1072,13 @@ var index_default = (path5) => {
1031
1072
  * @param version - Optional id of the version to get (supports semver)
1032
1073
  * @returns Event|Undefined
1033
1074
  */
1034
- getEvent: getEvent((0, import_node_path14.join)(path5)),
1075
+ getEvent: getEvent((0, import_node_path16.join)(path5)),
1035
1076
  /**
1036
1077
  * Returns all events from EventCatalog
1037
1078
  * @param latestOnly - optional boolean, set to true to get only latest versions
1038
1079
  * @returns Event[]|Undefined
1039
1080
  */
1040
- getEvents: getEvents((0, import_node_path14.join)(path5)),
1081
+ getEvents: getEvents((0, import_node_path16.join)(path5)),
1041
1082
  /**
1042
1083
  * Adds an event to EventCatalog
1043
1084
  *
@@ -1045,7 +1086,7 @@ var index_default = (path5) => {
1045
1086
  * @param options - Optional options to write the event
1046
1087
  *
1047
1088
  */
1048
- writeEvent: writeEvent((0, import_node_path14.join)(path5, "events")),
1089
+ writeEvent: writeEvent((0, import_node_path16.join)(path5, "events")),
1049
1090
  /**
1050
1091
  * Adds an event to a service in EventCatalog
1051
1092
  *
@@ -1054,26 +1095,26 @@ var index_default = (path5) => {
1054
1095
  * @param options - Optional options to write the event
1055
1096
  *
1056
1097
  */
1057
- writeEventToService: writeEventToService((0, import_node_path14.join)(path5)),
1098
+ writeEventToService: writeEventToService((0, import_node_path16.join)(path5)),
1058
1099
  /**
1059
1100
  * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
1060
1101
  *
1061
1102
  * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
1062
1103
  *
1063
1104
  */
1064
- rmEvent: rmEvent((0, import_node_path14.join)(path5, "events")),
1105
+ rmEvent: rmEvent((0, import_node_path16.join)(path5, "events")),
1065
1106
  /**
1066
1107
  * Remove an event by an Event id
1067
1108
  *
1068
1109
  * @param id - The id of the event you want to remove
1069
1110
  *
1070
1111
  */
1071
- rmEventById: rmEventById((0, import_node_path14.join)(path5)),
1112
+ rmEventById: rmEventById((0, import_node_path16.join)(path5)),
1072
1113
  /**
1073
1114
  * Moves a given event id to the version directory
1074
1115
  * @param directory
1075
1116
  */
1076
- versionEvent: versionEvent((0, import_node_path14.join)(path5)),
1117
+ versionEvent: versionEvent((0, import_node_path16.join)(path5)),
1077
1118
  /**
1078
1119
  * Adds a file to the given event
1079
1120
  * @param id - The id of the event to add the file to
@@ -1081,7 +1122,7 @@ var index_default = (path5) => {
1081
1122
  * @param version - Optional version of the event to add the file to
1082
1123
  * @returns
1083
1124
  */
1084
- addFileToEvent: addFileToEvent((0, import_node_path14.join)(path5)),
1125
+ addFileToEvent: addFileToEvent((0, import_node_path16.join)(path5)),
1085
1126
  /**
1086
1127
  * Adds a schema to the given event
1087
1128
  * @param id - The id of the event to add the schema to
@@ -1089,14 +1130,14 @@ var index_default = (path5) => {
1089
1130
  * @param version - Optional version of the event to add the schema to
1090
1131
  * @returns
1091
1132
  */
1092
- addSchemaToEvent: addSchemaToEvent((0, import_node_path14.join)(path5)),
1133
+ addSchemaToEvent: addSchemaToEvent((0, import_node_path16.join)(path5)),
1093
1134
  /**
1094
1135
  * Check to see if an event version exists
1095
1136
  * @param id - The id of the event
1096
1137
  * @param version - The version of the event (supports semver)
1097
1138
  * @returns
1098
1139
  */
1099
- eventHasVersion: eventHasVersion((0, import_node_path14.join)(path5)),
1140
+ eventHasVersion: eventHasVersion((0, import_node_path16.join)(path5)),
1100
1141
  /**
1101
1142
  * ================================
1102
1143
  * Commands
@@ -1108,13 +1149,13 @@ var index_default = (path5) => {
1108
1149
  * @param version - Optional id of the version to get (supports semver)
1109
1150
  * @returns Command|Undefined
1110
1151
  */
1111
- getCommand: getCommand((0, import_node_path14.join)(path5)),
1152
+ getCommand: getCommand((0, import_node_path16.join)(path5)),
1112
1153
  /**
1113
1154
  * Returns all commands from EventCatalog
1114
1155
  * @param latestOnly - optional boolean, set to true to get only latest versions
1115
1156
  * @returns Command[]|Undefined
1116
1157
  */
1117
- getCommands: getCommands((0, import_node_path14.join)(path5)),
1158
+ getCommands: getCommands((0, import_node_path16.join)(path5)),
1118
1159
  /**
1119
1160
  * Adds an command to EventCatalog
1120
1161
  *
@@ -1122,7 +1163,7 @@ var index_default = (path5) => {
1122
1163
  * @param options - Optional options to write the command
1123
1164
  *
1124
1165
  */
1125
- writeCommand: writeCommand((0, import_node_path14.join)(path5, "commands")),
1166
+ writeCommand: writeCommand((0, import_node_path16.join)(path5, "commands")),
1126
1167
  /**
1127
1168
  * Adds a command to a service in EventCatalog
1128
1169
  *
@@ -1131,26 +1172,26 @@ var index_default = (path5) => {
1131
1172
  * @param options - Optional options to write the command
1132
1173
  *
1133
1174
  */
1134
- writeCommandToService: writeCommandToService((0, import_node_path14.join)(path5)),
1175
+ writeCommandToService: writeCommandToService((0, import_node_path16.join)(path5)),
1135
1176
  /**
1136
1177
  * Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
1137
1178
  *
1138
1179
  * @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
1139
1180
  *
1140
1181
  */
1141
- rmCommand: rmCommand((0, import_node_path14.join)(path5, "commands")),
1182
+ rmCommand: rmCommand((0, import_node_path16.join)(path5, "commands")),
1142
1183
  /**
1143
1184
  * Remove an command by an Event id
1144
1185
  *
1145
1186
  * @param id - The id of the command you want to remove
1146
1187
  *
1147
1188
  */
1148
- rmCommandById: rmCommandById((0, import_node_path14.join)(path5)),
1189
+ rmCommandById: rmCommandById((0, import_node_path16.join)(path5)),
1149
1190
  /**
1150
1191
  * Moves a given command id to the version directory
1151
1192
  * @param directory
1152
1193
  */
1153
- versionCommand: versionCommand((0, import_node_path14.join)(path5)),
1194
+ versionCommand: versionCommand((0, import_node_path16.join)(path5)),
1154
1195
  /**
1155
1196
  * Adds a file to the given command
1156
1197
  * @param id - The id of the command to add the file to
@@ -1158,7 +1199,7 @@ var index_default = (path5) => {
1158
1199
  * @param version - Optional version of the command to add the file to
1159
1200
  * @returns
1160
1201
  */
1161
- addFileToCommand: addFileToCommand((0, import_node_path14.join)(path5)),
1202
+ addFileToCommand: addFileToCommand((0, import_node_path16.join)(path5)),
1162
1203
  /**
1163
1204
  * Adds a schema to the given command
1164
1205
  * @param id - The id of the command to add the schema to
@@ -1166,14 +1207,14 @@ var index_default = (path5) => {
1166
1207
  * @param version - Optional version of the command to add the schema to
1167
1208
  * @returns
1168
1209
  */
1169
- addSchemaToCommand: addSchemaToCommand((0, import_node_path14.join)(path5)),
1210
+ addSchemaToCommand: addSchemaToCommand((0, import_node_path16.join)(path5)),
1170
1211
  /**
1171
1212
  * Check to see if a command version exists
1172
1213
  * @param id - The id of the command
1173
1214
  * @param version - The version of the command (supports semver)
1174
1215
  * @returns
1175
1216
  */
1176
- commandHasVersion: commandHasVersion((0, import_node_path14.join)(path5)),
1217
+ commandHasVersion: commandHasVersion((0, import_node_path16.join)(path5)),
1177
1218
  /**
1178
1219
  * ================================
1179
1220
  * Queries
@@ -1185,13 +1226,13 @@ var index_default = (path5) => {
1185
1226
  * @param version - Optional id of the version to get (supports semver)
1186
1227
  * @returns Query|Undefined
1187
1228
  */
1188
- getQuery: getQuery((0, import_node_path14.join)(path5)),
1229
+ getQuery: getQuery((0, import_node_path16.join)(path5)),
1189
1230
  /**
1190
1231
  * Returns all queries from EventCatalog
1191
1232
  * @param latestOnly - optional boolean, set to true to get only latest versions
1192
1233
  * @returns Query[]|Undefined
1193
1234
  */
1194
- getQueries: getQueries((0, import_node_path14.join)(path5)),
1235
+ getQueries: getQueries((0, import_node_path16.join)(path5)),
1195
1236
  /**
1196
1237
  * Adds a query to EventCatalog
1197
1238
  *
@@ -1199,7 +1240,7 @@ var index_default = (path5) => {
1199
1240
  * @param options - Optional options to write the event
1200
1241
  *
1201
1242
  */
1202
- writeQuery: writeQuery((0, import_node_path14.join)(path5, "queries")),
1243
+ writeQuery: writeQuery((0, import_node_path16.join)(path5, "queries")),
1203
1244
  /**
1204
1245
  * Adds a query to a service in EventCatalog
1205
1246
  *
@@ -1208,26 +1249,26 @@ var index_default = (path5) => {
1208
1249
  * @param options - Optional options to write the query
1209
1250
  *
1210
1251
  */
1211
- writeQueryToService: writeQueryToService((0, import_node_path14.join)(path5)),
1252
+ writeQueryToService: writeQueryToService((0, import_node_path16.join)(path5)),
1212
1253
  /**
1213
1254
  * Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
1214
1255
  *
1215
1256
  * @param path - The path to your query, e.g. `/Orders/GetOrder`
1216
1257
  *
1217
1258
  */
1218
- rmQuery: rmQuery((0, import_node_path14.join)(path5, "queries")),
1259
+ rmQuery: rmQuery((0, import_node_path16.join)(path5, "queries")),
1219
1260
  /**
1220
1261
  * Remove a query by a Query id
1221
1262
  *
1222
1263
  * @param id - The id of the query you want to remove
1223
1264
  *
1224
1265
  */
1225
- rmQueryById: rmQueryById((0, import_node_path14.join)(path5)),
1266
+ rmQueryById: rmQueryById((0, import_node_path16.join)(path5)),
1226
1267
  /**
1227
1268
  * Moves a given query id to the version directory
1228
1269
  * @param directory
1229
1270
  */
1230
- versionQuery: versionQuery((0, import_node_path14.join)(path5)),
1271
+ versionQuery: versionQuery((0, import_node_path16.join)(path5)),
1231
1272
  /**
1232
1273
  * Adds a file to the given query
1233
1274
  * @param id - The id of the query to add the file to
@@ -1235,7 +1276,7 @@ var index_default = (path5) => {
1235
1276
  * @param version - Optional version of the query to add the file to
1236
1277
  * @returns
1237
1278
  */
1238
- addFileToQuery: addFileToQuery((0, import_node_path14.join)(path5)),
1279
+ addFileToQuery: addFileToQuery((0, import_node_path16.join)(path5)),
1239
1280
  /**
1240
1281
  * Adds a schema to the given query
1241
1282
  * @param id - The id of the query to add the schema to
@@ -1243,14 +1284,14 @@ var index_default = (path5) => {
1243
1284
  * @param version - Optional version of the query to add the schema to
1244
1285
  * @returns
1245
1286
  */
1246
- addSchemaToQuery: addSchemaToQuery((0, import_node_path14.join)(path5)),
1287
+ addSchemaToQuery: addSchemaToQuery((0, import_node_path16.join)(path5)),
1247
1288
  /**
1248
1289
  * Check to see if an query version exists
1249
1290
  * @param id - The id of the query
1250
1291
  * @param version - The version of the query (supports semver)
1251
1292
  * @returns
1252
1293
  */
1253
- queryHasVersion: queryHasVersion((0, import_node_path14.join)(path5)),
1294
+ queryHasVersion: queryHasVersion((0, import_node_path16.join)(path5)),
1254
1295
  /**
1255
1296
  * ================================
1256
1297
  * Channels
@@ -1262,13 +1303,13 @@ var index_default = (path5) => {
1262
1303
  * @param version - Optional id of the version to get (supports semver)
1263
1304
  * @returns Channel|Undefined
1264
1305
  */
1265
- getChannel: getChannel((0, import_node_path14.join)(path5)),
1306
+ getChannel: getChannel((0, import_node_path16.join)(path5)),
1266
1307
  /**
1267
1308
  * Returns all channels from EventCatalog
1268
1309
  * @param latestOnly - optional boolean, set to true to get only latest versions
1269
1310
  * @returns Channel[]|Undefined
1270
1311
  */
1271
- getChannels: getChannels((0, import_node_path14.join)(path5)),
1312
+ getChannels: getChannels((0, import_node_path16.join)(path5)),
1272
1313
  /**
1273
1314
  * Adds an channel to EventCatalog
1274
1315
  *
@@ -1276,33 +1317,33 @@ var index_default = (path5) => {
1276
1317
  * @param options - Optional options to write the channel
1277
1318
  *
1278
1319
  */
1279
- writeChannel: writeChannel((0, import_node_path14.join)(path5, "channels")),
1320
+ writeChannel: writeChannel((0, import_node_path16.join)(path5, "channels")),
1280
1321
  /**
1281
1322
  * Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
1282
1323
  *
1283
1324
  * @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
1284
1325
  *
1285
1326
  */
1286
- rmChannel: rmChannel((0, import_node_path14.join)(path5, "channels")),
1327
+ rmChannel: rmChannel((0, import_node_path16.join)(path5, "channels")),
1287
1328
  /**
1288
1329
  * Remove an channel by an Event id
1289
1330
  *
1290
1331
  * @param id - The id of the channel you want to remove
1291
1332
  *
1292
1333
  */
1293
- rmChannelById: rmChannelById((0, import_node_path14.join)(path5)),
1334
+ rmChannelById: rmChannelById((0, import_node_path16.join)(path5)),
1294
1335
  /**
1295
1336
  * Moves a given channel id to the version directory
1296
1337
  * @param directory
1297
1338
  */
1298
- versionChannel: versionChannel((0, import_node_path14.join)(path5)),
1339
+ versionChannel: versionChannel((0, import_node_path16.join)(path5)),
1299
1340
  /**
1300
1341
  * Check to see if a channel version exists
1301
1342
  * @param id - The id of the channel
1302
1343
  * @param version - The version of the channel (supports semver)
1303
1344
  * @returns
1304
1345
  */
1305
- channelHasVersion: channelHasVersion((0, import_node_path14.join)(path5)),
1346
+ channelHasVersion: channelHasVersion((0, import_node_path16.join)(path5)),
1306
1347
  /**
1307
1348
  * Add a channel to an event
1308
1349
  *
@@ -1319,7 +1360,7 @@ var index_default = (path5) => {
1319
1360
  *
1320
1361
  * ```
1321
1362
  */
1322
- addEventToChannel: addMessageToChannel((0, import_node_path14.join)(path5), "events"),
1363
+ addEventToChannel: addMessageToChannel((0, import_node_path16.join)(path5), "events"),
1323
1364
  /**
1324
1365
  * Add a channel to an command
1325
1366
  *
@@ -1336,7 +1377,7 @@ var index_default = (path5) => {
1336
1377
  *
1337
1378
  * ```
1338
1379
  */
1339
- addCommandToChannel: addMessageToChannel((0, import_node_path14.join)(path5), "commands"),
1380
+ addCommandToChannel: addMessageToChannel((0, import_node_path16.join)(path5), "commands"),
1340
1381
  /**
1341
1382
  * Add a channel to an query
1342
1383
  *
@@ -1353,7 +1394,7 @@ var index_default = (path5) => {
1353
1394
  *
1354
1395
  * ```
1355
1396
  */
1356
- addQueryToChannel: addMessageToChannel((0, import_node_path14.join)(path5), "queries"),
1397
+ addQueryToChannel: addMessageToChannel((0, import_node_path16.join)(path5), "queries"),
1357
1398
  /**
1358
1399
  * ================================
1359
1400
  * SERVICES
@@ -1366,14 +1407,14 @@ var index_default = (path5) => {
1366
1407
  * @param options - Optional options to write the event
1367
1408
  *
1368
1409
  */
1369
- writeService: writeService((0, import_node_path14.join)(path5, "services")),
1410
+ writeService: writeService((0, import_node_path16.join)(path5, "services")),
1370
1411
  /**
1371
1412
  * Adds a versioned service to EventCatalog
1372
1413
  *
1373
1414
  * @param service - The service to write
1374
1415
  *
1375
1416
  */
1376
- writeVersionedService: writeVersionedService((0, import_node_path14.join)(path5, "services")),
1417
+ writeVersionedService: writeVersionedService((0, import_node_path16.join)(path5, "services")),
1377
1418
  /**
1378
1419
  * Adds a service to a domain in EventCatalog
1379
1420
  *
@@ -1382,45 +1423,45 @@ var index_default = (path5) => {
1382
1423
  * @param options - Optional options to write the event
1383
1424
  *
1384
1425
  */
1385
- writeServiceToDomain: writeServiceToDomain((0, import_node_path14.join)(path5, "domains")),
1426
+ writeServiceToDomain: writeServiceToDomain((0, import_node_path16.join)(path5, "domains")),
1386
1427
  /**
1387
1428
  * Returns a service from EventCatalog
1388
1429
  * @param id - The id of the service to retrieve
1389
1430
  * @param version - Optional id of the version to get (supports semver)
1390
1431
  * @returns Service|Undefined
1391
1432
  */
1392
- getService: getService((0, import_node_path14.join)(path5)),
1433
+ getService: getService((0, import_node_path16.join)(path5)),
1393
1434
  /**
1394
1435
  * Returns a service from EventCatalog by it's path.
1395
1436
  * @param path - The path to the service to retrieve
1396
1437
  * @returns Service|Undefined
1397
1438
  */
1398
- getServiceByPath: getServiceByPath((0, import_node_path14.join)(path5)),
1439
+ getServiceByPath: getServiceByPath((0, import_node_path16.join)(path5)),
1399
1440
  /**
1400
1441
  * Returns all services from EventCatalog
1401
1442
  * @param latestOnly - optional boolean, set to true to get only latest versions
1402
1443
  * @returns Service[]|Undefined
1403
1444
  */
1404
- getServices: getServices((0, import_node_path14.join)(path5)),
1445
+ getServices: getServices((0, import_node_path16.join)(path5)),
1405
1446
  /**
1406
1447
  * Moves a given service id to the version directory
1407
1448
  * @param directory
1408
1449
  */
1409
- versionService: versionService((0, import_node_path14.join)(path5)),
1450
+ versionService: versionService((0, import_node_path16.join)(path5)),
1410
1451
  /**
1411
1452
  * Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
1412
1453
  *
1413
1454
  * @param path - The path to your service, e.g. `/InventoryService`
1414
1455
  *
1415
1456
  */
1416
- rmService: rmService((0, import_node_path14.join)(path5, "services")),
1457
+ rmService: rmService((0, import_node_path16.join)(path5, "services")),
1417
1458
  /**
1418
1459
  * Remove an service by an service id
1419
1460
  *
1420
1461
  * @param id - The id of the service you want to remove
1421
1462
  *
1422
1463
  */
1423
- rmServiceById: rmServiceById((0, import_node_path14.join)(path5)),
1464
+ rmServiceById: rmServiceById((0, import_node_path16.join)(path5)),
1424
1465
  /**
1425
1466
  * Adds a file to the given service
1426
1467
  * @param id - The id of the service to add the file to
@@ -1428,21 +1469,21 @@ var index_default = (path5) => {
1428
1469
  * @param version - Optional version of the service to add the file to
1429
1470
  * @returns
1430
1471
  */
1431
- addFileToService: addFileToService((0, import_node_path14.join)(path5)),
1472
+ addFileToService: addFileToService((0, import_node_path16.join)(path5)),
1432
1473
  /**
1433
1474
  * Returns the specifications for a given service
1434
1475
  * @param id - The id of the service to retrieve the specifications for
1435
1476
  * @param version - Optional version of the service
1436
1477
  * @returns
1437
1478
  */
1438
- getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path14.join)(path5)),
1479
+ getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path16.join)(path5)),
1439
1480
  /**
1440
1481
  * Check to see if a service version exists
1441
1482
  * @param id - The id of the service
1442
1483
  * @param version - The version of the service (supports semver)
1443
1484
  * @returns
1444
1485
  */
1445
- serviceHasVersion: serviceHasVersion((0, import_node_path14.join)(path5)),
1486
+ serviceHasVersion: serviceHasVersion((0, import_node_path16.join)(path5)),
1446
1487
  /**
1447
1488
  * Add an event to a service by it's id.
1448
1489
  *
@@ -1462,7 +1503,7 @@ var index_default = (path5) => {
1462
1503
  *
1463
1504
  * ```
1464
1505
  */
1465
- addEventToService: addMessageToService((0, import_node_path14.join)(path5)),
1506
+ addEventToService: addMessageToService((0, import_node_path16.join)(path5)),
1466
1507
  /**
1467
1508
  * Add a command to a service by it's id.
1468
1509
  *
@@ -1482,7 +1523,7 @@ var index_default = (path5) => {
1482
1523
  *
1483
1524
  * ```
1484
1525
  */
1485
- addCommandToService: addMessageToService((0, import_node_path14.join)(path5)),
1526
+ addCommandToService: addMessageToService((0, import_node_path16.join)(path5)),
1486
1527
  /**
1487
1528
  * Add a query to a service by it's id.
1488
1529
  *
@@ -1502,7 +1543,7 @@ var index_default = (path5) => {
1502
1543
  *
1503
1544
  * ```
1504
1545
  */
1505
- addQueryToService: addMessageToService((0, import_node_path14.join)(path5)),
1546
+ addQueryToService: addMessageToService((0, import_node_path16.join)(path5)),
1506
1547
  /**
1507
1548
  * Add an entity to a service by its id.
1508
1549
  *
@@ -1520,7 +1561,7 @@ var index_default = (path5) => {
1520
1561
  *
1521
1562
  * ```
1522
1563
  */
1523
- addEntityToService: addEntityToService((0, import_node_path14.join)(path5)),
1564
+ addEntityToService: addEntityToService((0, import_node_path16.join)(path5)),
1524
1565
  /**
1525
1566
  * Check to see if a service exists by it's path.
1526
1567
  *
@@ -1537,13 +1578,13 @@ var index_default = (path5) => {
1537
1578
  * @param path - The path to the service to check
1538
1579
  * @returns boolean
1539
1580
  */
1540
- isService: isService((0, import_node_path14.join)(path5)),
1581
+ isService: isService((0, import_node_path16.join)(path5)),
1541
1582
  /**
1542
1583
  * Converts a file to a service.
1543
1584
  * @param file - The file to convert to a service.
1544
1585
  * @returns The service.
1545
1586
  */
1546
- toService: toService((0, import_node_path14.join)(path5)),
1587
+ toService: toService((0, import_node_path16.join)(path5)),
1547
1588
  /**
1548
1589
  * ================================
1549
1590
  * Domains
@@ -1556,39 +1597,39 @@ var index_default = (path5) => {
1556
1597
  * @param options - Optional options to write the event
1557
1598
  *
1558
1599
  */
1559
- writeDomain: writeDomain((0, import_node_path14.join)(path5, "domains")),
1600
+ writeDomain: writeDomain((0, import_node_path16.join)(path5, "domains")),
1560
1601
  /**
1561
1602
  * Returns a domain from EventCatalog
1562
1603
  * @param id - The id of the domain to retrieve
1563
1604
  * @param version - Optional id of the version to get (supports semver)
1564
1605
  * @returns Domain|Undefined
1565
1606
  */
1566
- getDomain: getDomain((0, import_node_path14.join)(path5, "domains")),
1607
+ getDomain: getDomain((0, import_node_path16.join)(path5, "domains")),
1567
1608
  /**
1568
1609
  * Returns all domains from EventCatalog
1569
1610
  * @param latestOnly - optional boolean, set to true to get only latest versions
1570
1611
  * @returns Domain[]|Undefined
1571
1612
  */
1572
- getDomains: getDomains((0, import_node_path14.join)(path5)),
1613
+ getDomains: getDomains((0, import_node_path16.join)(path5)),
1573
1614
  /**
1574
1615
  * Moves a given domain id to the version directory
1575
1616
  * @param directory
1576
1617
  */
1577
- versionDomain: versionDomain((0, import_node_path14.join)(path5, "domains")),
1618
+ versionDomain: versionDomain((0, import_node_path16.join)(path5, "domains")),
1578
1619
  /**
1579
1620
  * Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
1580
1621
  *
1581
1622
  * @param path - The path to your domain, e.g. `/Payment`
1582
1623
  *
1583
1624
  */
1584
- rmDomain: rmDomain((0, import_node_path14.join)(path5, "domains")),
1625
+ rmDomain: rmDomain((0, import_node_path16.join)(path5, "domains")),
1585
1626
  /**
1586
1627
  * Remove an service by an domain id
1587
1628
  *
1588
1629
  * @param id - The id of the domain you want to remove
1589
1630
  *
1590
1631
  */
1591
- rmDomainById: rmDomainById((0, import_node_path14.join)(path5, "domains")),
1632
+ rmDomainById: rmDomainById((0, import_node_path16.join)(path5, "domains")),
1592
1633
  /**
1593
1634
  * Adds a file to the given domain
1594
1635
  * @param id - The id of the domain to add the file to
@@ -1596,28 +1637,28 @@ var index_default = (path5) => {
1596
1637
  * @param version - Optional version of the domain to add the file to
1597
1638
  * @returns
1598
1639
  */
1599
- addFileToDomain: addFileToDomain((0, import_node_path14.join)(path5, "domains")),
1640
+ addFileToDomain: addFileToDomain((0, import_node_path16.join)(path5, "domains")),
1600
1641
  /**
1601
1642
  * Adds an ubiquitous language dictionary to a domain
1602
1643
  * @param id - The id of the domain to add the ubiquitous language to
1603
1644
  * @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
1604
1645
  * @param version - Optional version of the domain to add the ubiquitous language to
1605
1646
  */
1606
- addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path14.join)(path5, "domains")),
1647
+ addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path16.join)(path5, "domains")),
1607
1648
  /**
1608
1649
  * Get the ubiquitous language dictionary from a domain
1609
1650
  * @param id - The id of the domain to get the ubiquitous language from
1610
1651
  * @param version - Optional version of the domain to get the ubiquitous language from
1611
1652
  * @returns
1612
1653
  */
1613
- getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path14.join)(path5, "domains")),
1654
+ getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path16.join)(path5, "domains")),
1614
1655
  /**
1615
1656
  * Check to see if a domain version exists
1616
1657
  * @param id - The id of the domain
1617
1658
  * @param version - The version of the domain (supports semver)
1618
1659
  * @returns
1619
1660
  */
1620
- domainHasVersion: domainHasVersion((0, import_node_path14.join)(path5)),
1661
+ domainHasVersion: domainHasVersion((0, import_node_path16.join)(path5)),
1621
1662
  /**
1622
1663
  * Adds a given service to a domain
1623
1664
  * @param id - The id of the domain
@@ -1625,7 +1666,7 @@ var index_default = (path5) => {
1625
1666
  * @param version - (Optional) The version of the domain to add the service to
1626
1667
  * @returns
1627
1668
  */
1628
- addServiceToDomain: addServiceToDomain((0, import_node_path14.join)(path5, "domains")),
1669
+ addServiceToDomain: addServiceToDomain((0, import_node_path16.join)(path5, "domains")),
1629
1670
  /**
1630
1671
  * Adds a given subdomain to a domain
1631
1672
  * @param id - The id of the domain
@@ -1633,7 +1674,7 @@ var index_default = (path5) => {
1633
1674
  * @param version - (Optional) The version of the domain to add the subdomain to
1634
1675
  * @returns
1635
1676
  */
1636
- addSubDomainToDomain: addSubDomainToDomain((0, import_node_path14.join)(path5, "domains")),
1677
+ addSubDomainToDomain: addSubDomainToDomain((0, import_node_path16.join)(path5, "domains")),
1637
1678
  /**
1638
1679
  * Adds an entity to a domain
1639
1680
  * @param id - The id of the domain
@@ -1641,7 +1682,7 @@ var index_default = (path5) => {
1641
1682
  * @param version - (Optional) The version of the domain to add the entity to
1642
1683
  * @returns
1643
1684
  */
1644
- addEntityToDomain: addEntityToDomain((0, import_node_path14.join)(path5, "domains")),
1685
+ addEntityToDomain: addEntityToDomain((0, import_node_path16.join)(path5, "domains")),
1645
1686
  /**
1646
1687
  * ================================
1647
1688
  * Teams
@@ -1654,25 +1695,25 @@ var index_default = (path5) => {
1654
1695
  * @param options - Optional options to write the team
1655
1696
  *
1656
1697
  */
1657
- writeTeam: writeTeam((0, import_node_path14.join)(path5, "teams")),
1698
+ writeTeam: writeTeam((0, import_node_path16.join)(path5, "teams")),
1658
1699
  /**
1659
1700
  * Returns a team from EventCatalog
1660
1701
  * @param id - The id of the team to retrieve
1661
1702
  * @returns Team|Undefined
1662
1703
  */
1663
- getTeam: getTeam((0, import_node_path14.join)(path5, "teams")),
1704
+ getTeam: getTeam((0, import_node_path16.join)(path5, "teams")),
1664
1705
  /**
1665
1706
  * Returns all teams from EventCatalog
1666
1707
  * @returns Team[]|Undefined
1667
1708
  */
1668
- getTeams: getTeams((0, import_node_path14.join)(path5, "teams")),
1709
+ getTeams: getTeams((0, import_node_path16.join)(path5, "teams")),
1669
1710
  /**
1670
1711
  * Remove a team by the team id
1671
1712
  *
1672
1713
  * @param id - The id of the team you want to remove
1673
1714
  *
1674
1715
  */
1675
- rmTeamById: rmTeamById((0, import_node_path14.join)(path5, "teams")),
1716
+ rmTeamById: rmTeamById((0, import_node_path16.join)(path5, "teams")),
1676
1717
  /**
1677
1718
  * ================================
1678
1719
  * Users
@@ -1685,25 +1726,25 @@ var index_default = (path5) => {
1685
1726
  * @param options - Optional options to write the user
1686
1727
  *
1687
1728
  */
1688
- writeUser: writeUser((0, import_node_path14.join)(path5, "users")),
1729
+ writeUser: writeUser((0, import_node_path16.join)(path5, "users")),
1689
1730
  /**
1690
1731
  * Returns a user from EventCatalog
1691
1732
  * @param id - The id of the user to retrieve
1692
1733
  * @returns User|Undefined
1693
1734
  */
1694
- getUser: getUser((0, import_node_path14.join)(path5, "users")),
1735
+ getUser: getUser((0, import_node_path16.join)(path5, "users")),
1695
1736
  /**
1696
1737
  * Returns all user from EventCatalog
1697
1738
  * @returns User[]|Undefined
1698
1739
  */
1699
- getUsers: getUsers((0, import_node_path14.join)(path5)),
1740
+ getUsers: getUsers((0, import_node_path16.join)(path5)),
1700
1741
  /**
1701
1742
  * Remove a user by the user id
1702
1743
  *
1703
1744
  * @param id - The id of the user you want to remove
1704
1745
  *
1705
1746
  */
1706
- rmUserById: rmUserById((0, import_node_path14.join)(path5, "users")),
1747
+ rmUserById: rmUserById((0, import_node_path16.join)(path5, "users")),
1707
1748
  /**
1708
1749
  * ================================
1709
1750
  * Custom Docs
@@ -1714,32 +1755,32 @@ var index_default = (path5) => {
1714
1755
  * @param path - The path to the custom doc to retrieve
1715
1756
  * @returns CustomDoc|Undefined
1716
1757
  */
1717
- getCustomDoc: getCustomDoc((0, import_node_path14.join)(path5, "docs")),
1758
+ getCustomDoc: getCustomDoc((0, import_node_path16.join)(path5, "docs")),
1718
1759
  /**
1719
1760
  * Returns all custom docs from EventCatalog
1720
1761
  * @param options - Optional options to get custom docs from a specific path
1721
1762
  * @returns CustomDoc[]|Undefined
1722
1763
  */
1723
- getCustomDocs: getCustomDocs((0, import_node_path14.join)(path5, "docs")),
1764
+ getCustomDocs: getCustomDocs((0, import_node_path16.join)(path5, "docs")),
1724
1765
  /**
1725
1766
  * Writes a custom doc to EventCatalog
1726
1767
  * @param customDoc - The custom doc to write
1727
1768
  * @param options - Optional options to write the custom doc
1728
1769
  *
1729
1770
  */
1730
- writeCustomDoc: writeCustomDoc((0, import_node_path14.join)(path5, "docs")),
1771
+ writeCustomDoc: writeCustomDoc((0, import_node_path16.join)(path5, "docs")),
1731
1772
  /**
1732
1773
  * Removes a custom doc from EventCatalog
1733
1774
  * @param path - The path to the custom doc to remove
1734
1775
  *
1735
1776
  */
1736
- rmCustomDoc: rmCustomDoc((0, import_node_path14.join)(path5, "docs")),
1777
+ rmCustomDoc: rmCustomDoc((0, import_node_path16.join)(path5, "docs")),
1737
1778
  /**
1738
1779
  * Dumps the catalog to a JSON file.
1739
1780
  * @param directory - The directory to dump the catalog to
1740
1781
  * @returns A JSON file with the catalog
1741
1782
  */
1742
- dumpCatalog: dumpCatalog((0, import_node_path14.join)(path5)),
1783
+ dumpCatalog: dumpCatalog((0, import_node_path16.join)(path5)),
1743
1784
  /**
1744
1785
  * Returns the event catalog configuration file.
1745
1786
  * The event catalog configuration file is the file that contains the configuration for the event catalog.
@@ -1747,7 +1788,7 @@ var index_default = (path5) => {
1747
1788
  * @param directory - The directory of the catalog.
1748
1789
  * @returns A JSON object with the configuration for the event catalog.
1749
1790
  */
1750
- getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path14.join)(path5)),
1791
+ getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path16.join)(path5)),
1751
1792
  /**
1752
1793
  * ================================
1753
1794
  * Resources Utils
@@ -1768,33 +1809,33 @@ var index_default = (path5) => {
1768
1809
  * @param path - The path to the message to retrieve
1769
1810
  * @returns Message|Undefined
1770
1811
  */
1771
- getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path14.join)(path5)),
1812
+ getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path16.join)(path5)),
1772
1813
  /**
1773
1814
  * Returns the producers and consumers (services) for a given message
1774
1815
  * @param id - The id of the message to get the producers and consumers for
1775
1816
  * @param version - Optional version of the message
1776
1817
  * @returns { producers: Service[], consumers: Service[] }
1777
1818
  */
1778
- getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path14.join)(path5)),
1819
+ getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path16.join)(path5)),
1779
1820
  /**
1780
1821
  * Returns the consumers of a given schema path
1781
1822
  * @param path - The path to the schema to get the consumers for
1782
1823
  * @returns Service[]
1783
1824
  */
1784
- getConsumersOfSchema: getConsumersOfSchema((0, import_node_path14.join)(path5)),
1825
+ getConsumersOfSchema: getConsumersOfSchema((0, import_node_path16.join)(path5)),
1785
1826
  /**
1786
1827
  * Returns the producers of a given schema path
1787
1828
  * @param path - The path to the schema to get the producers for
1788
1829
  * @returns Service[]
1789
1830
  */
1790
- getProducersOfSchema: getProducersOfSchema((0, import_node_path14.join)(path5)),
1831
+ getProducersOfSchema: getProducersOfSchema((0, import_node_path16.join)(path5)),
1791
1832
  /**
1792
1833
  * Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
1793
1834
  * @param id - The id of the resource to get the owners for
1794
1835
  * @param version - Optional version of the resource
1795
1836
  * @returns { owners: User[] }
1796
1837
  */
1797
- getOwnersForResource: getOwnersForResource((0, import_node_path14.join)(path5)),
1838
+ getOwnersForResource: getOwnersForResource((0, import_node_path16.join)(path5)),
1798
1839
  /**
1799
1840
  * ================================
1800
1841
  * Entities
@@ -1806,13 +1847,13 @@ var index_default = (path5) => {
1806
1847
  * @param version - Optional id of the version to get (supports semver)
1807
1848
  * @returns Entity|Undefined
1808
1849
  */
1809
- getEntity: getEntity((0, import_node_path14.join)(path5)),
1850
+ getEntity: getEntity((0, import_node_path16.join)(path5)),
1810
1851
  /**
1811
1852
  * Returns all entities from EventCatalog
1812
1853
  * @param latestOnly - optional boolean, set to true to get only latest versions
1813
1854
  * @returns Entity[]|Undefined
1814
1855
  */
1815
- getEntities: getEntities((0, import_node_path14.join)(path5)),
1856
+ getEntities: getEntities((0, import_node_path16.join)(path5)),
1816
1857
  /**
1817
1858
  * Adds an entity to EventCatalog
1818
1859
  *
@@ -1820,33 +1861,95 @@ var index_default = (path5) => {
1820
1861
  * @param options - Optional options to write the entity
1821
1862
  *
1822
1863
  */
1823
- writeEntity: writeEntity((0, import_node_path14.join)(path5, "entities")),
1864
+ writeEntity: writeEntity((0, import_node_path16.join)(path5, "entities")),
1824
1865
  /**
1825
1866
  * Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
1826
1867
  *
1827
1868
  * @param path - The path to your entity, e.g. `/User`
1828
1869
  *
1829
1870
  */
1830
- rmEntity: rmEntity((0, import_node_path14.join)(path5, "entities")),
1871
+ rmEntity: rmEntity((0, import_node_path16.join)(path5, "entities")),
1831
1872
  /**
1832
1873
  * Remove an entity by an entity id
1833
1874
  *
1834
1875
  * @param id - The id of the entity you want to remove
1835
1876
  *
1836
1877
  */
1837
- rmEntityById: rmEntityById((0, import_node_path14.join)(path5)),
1878
+ rmEntityById: rmEntityById((0, import_node_path16.join)(path5)),
1838
1879
  /**
1839
1880
  * Moves a given entity id to the version directory
1840
1881
  * @param id - The id of the entity to version
1841
1882
  */
1842
- versionEntity: versionEntity((0, import_node_path14.join)(path5)),
1883
+ versionEntity: versionEntity((0, import_node_path16.join)(path5)),
1843
1884
  /**
1844
1885
  * Check to see if an entity version exists
1845
1886
  * @param id - The id of the entity
1846
1887
  * @param version - The version of the entity (supports semver)
1847
1888
  * @returns
1848
1889
  */
1849
- entityHasVersion: entityHasVersion((0, import_node_path14.join)(path5))
1890
+ entityHasVersion: entityHasVersion((0, import_node_path16.join)(path5)),
1891
+ /**
1892
+ * ================================
1893
+ * Data Stores
1894
+ * ================================
1895
+ */
1896
+ /**
1897
+ * Adds a data store to EventCatalog
1898
+ * @param dataStore - The data store to write
1899
+ * @param options - Optional options to write the data store
1900
+ *
1901
+ */
1902
+ writeDataStore: writeContainer((0, import_node_path16.join)(path5, "containers")),
1903
+ /**
1904
+ * Returns a container from EventCatalog
1905
+ * @param id - The id of the container to retrieve
1906
+ * @param version - Optional id of the version to get (supports semver)
1907
+ * @returns Container|Undefined
1908
+ */
1909
+ getDataStore: getContainer((0, import_node_path16.join)(path5)),
1910
+ /**
1911
+ * Returns all data stores from EventCatalog
1912
+ * @param latestOnly - optional boolean, set to true to get only latest versions
1913
+ * @returns Container[]|Undefined
1914
+ */
1915
+ getDataStores: getContainers((0, import_node_path16.join)(path5)),
1916
+ /**
1917
+ * Version a data store by its id
1918
+ * @param id - The id of the data store to version
1919
+ */
1920
+ versionDataStore: versionContainer((0, import_node_path16.join)(path5, "containers")),
1921
+ /**
1922
+ * Remove a data store by its path
1923
+ * @param path - The path to the data store to remove
1924
+ */
1925
+ rmDataStore: rmContainer((0, import_node_path16.join)(path5, "containers")),
1926
+ /**
1927
+ * Remove a data store by its id
1928
+ * @param id - The id of the data store to remove
1929
+ */
1930
+ rmDataStoreById: rmContainerById((0, import_node_path16.join)(path5)),
1931
+ /**
1932
+ * Check to see if a data store version exists
1933
+ * @param id - The id of the data store
1934
+ * @param version - The version of the data store (supports semver)
1935
+ * @returns
1936
+ */
1937
+ dataStoreHasVersion: containerHasVersion((0, import_node_path16.join)(path5)),
1938
+ /**
1939
+ * Adds a file to a data store by its id
1940
+ * @param id - The id of the data store to add the file to
1941
+ * @param file - File contents to add including the content and the file name
1942
+ * @param version - Optional version of the data store to add the file to
1943
+ * @returns
1944
+ */
1945
+ addFileToDataStore: addFileToContainer((0, import_node_path16.join)(path5)),
1946
+ /**
1947
+ * Writes a data store to a service by its id
1948
+ * @param dataStore - The data store to write
1949
+ * @param service - The service to write the data store to
1950
+ * @returns
1951
+ */
1952
+ writeDataStoreToService: writeContainerToService((0, import_node_path16.join)(path5))
1850
1953
  };
1851
1954
  };
1852
1955
 
@@ -1854,7 +1957,7 @@ var index_default = (path5) => {
1854
1957
  var DUMP_VERSION = "0.0.1";
1855
1958
  var getEventCatalogVersion = async (catalogDir) => {
1856
1959
  try {
1857
- const packageJson = import_fs.default.readFileSync((0, import_node_path15.join)(catalogDir, "package.json"), "utf8");
1960
+ const packageJson = import_fs.default.readFileSync((0, import_node_path17.join)(catalogDir, "package.json"), "utf8");
1858
1961
  const packageJsonObject = JSON.parse(packageJson);
1859
1962
  return packageJsonObject["dependencies"]["@eventcatalog/core"];
1860
1963
  } catch (error) {
@@ -1867,7 +1970,7 @@ var hydrateResource = async (catalogDir, resources = [], { attachSchema = false
1867
1970
  const resourcePath = await getResourcePath(catalogDir, resource.id, resource.version);
1868
1971
  let schema = "";
1869
1972
  if (resource.schemaPath && resourcePath?.fullPath) {
1870
- const pathToSchema = import_node_path15.default.join(import_node_path15.default.dirname(resourcePath?.fullPath), resource.schemaPath);
1973
+ const pathToSchema = import_node_path17.default.join(import_node_path17.default.dirname(resourcePath?.fullPath), resource.schemaPath);
1871
1974
  if (import_fs.default.existsSync(pathToSchema)) {
1872
1975
  schema = import_fs.default.readFileSync(pathToSchema, "utf8");
1873
1976
  }
@@ -1888,7 +1991,7 @@ var filterCollection = (collection, options) => {
1888
1991
  };
1889
1992
  var getEventCatalogConfigurationFile = (directory) => async () => {
1890
1993
  try {
1891
- const path5 = (0, import_node_path15.join)(directory, "eventcatalog.config.js");
1994
+ const path5 = (0, import_node_path17.join)(directory, "eventcatalog.config.js");
1892
1995
  const configModule = await import(path5);
1893
1996
  return configModule.default;
1894
1997
  } catch (error) {