@eventcatalog/sdk 2.24.2 → 2.25.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ __export(src_exports, {
34
34
  default: () => src_default
35
35
  });
36
36
  module.exports = __toCommonJS(src_exports);
37
- var import_node_path25 = require("path");
37
+ var import_node_path26 = require("path");
38
38
 
39
39
  // src/dsl/utils.ts
40
40
  var import_glob = require("glob");
@@ -1352,6 +1352,14 @@ var writeServiceToDomain = (directory) => async (service, domain, options = { pa
1352
1352
  pathForService = (0, import_node_path7.join)(pathForService, service.id);
1353
1353
  await writeResource(directory, { ...service }, { ...options, path: pathForService, type: "service" });
1354
1354
  };
1355
+ var writeServiceToSystem = (directory) => async (service, system, options = { path: "", format: "mdx", override: false }) => {
1356
+ const resourcePath = await getResourcePath(directory, system.id, system.version);
1357
+ if (!resourcePath) {
1358
+ throw new Error("System not found");
1359
+ }
1360
+ const pathForService = (0, import_node_path7.join)(resourcePath.directory, "services", service.id);
1361
+ await writeResource(directory, { ...service }, { ...options, path: pathForService, type: "service" });
1362
+ };
1355
1363
  var versionService = (directory) => async (id) => versionResource(directory, id);
1356
1364
  var rmService = (directory) => async (path9) => {
1357
1365
  await import_promises5.default.rm((0, import_node_path7.join)(directory, path9), { recursive: true });
@@ -1494,15 +1502,129 @@ var addDataStoreToService = (directory) => async (id, operation, dataStore, vers
1494
1502
  await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
1495
1503
  };
1496
1504
 
1497
- // src/agents.ts
1505
+ // src/systems.ts
1498
1506
  var import_promises6 = __toESM(require("fs/promises"));
1499
1507
  var import_node_path8 = require("path");
1508
+ var SYSTEM_RESOURCE_IGNORES = [
1509
+ "**/systems/**/agents/**",
1510
+ "**/systems/**/services/**",
1511
+ "**/systems/**/events/**",
1512
+ "**/systems/**/commands/**",
1513
+ "**/systems/**/queries/**",
1514
+ "**/systems/**/flows/**",
1515
+ "**/systems/**/channels/**",
1516
+ "**/systems/**/entities/**",
1517
+ "**/systems/**/containers/**",
1518
+ "**/systems/**/diagrams/**",
1519
+ "**/systems/**/data-products/**",
1520
+ "**/systems/**/adrs/**",
1521
+ "**/systems/**/docs/**"
1522
+ ];
1523
+ var normalizeResourcePointers = (system) => {
1524
+ const resource = { ...system };
1525
+ if (Array.isArray(system.services)) {
1526
+ resource.services = uniqueVersions(system.services);
1527
+ }
1528
+ if (Array.isArray(system.flows)) {
1529
+ resource.flows = uniqueVersions(system.flows);
1530
+ }
1531
+ if (Array.isArray(system.entities)) {
1532
+ resource.entities = uniqueVersions(system.entities);
1533
+ }
1534
+ if (Array.isArray(system.containers)) {
1535
+ resource.containers = uniqueVersions(system.containers);
1536
+ }
1537
+ return resource;
1538
+ };
1539
+ var persistSystemAtExistingPath = async (directory, system, version) => {
1540
+ const systemPath = await getResourcePath(directory, system.id, version);
1541
+ const extension = (0, import_node_path8.extname)(systemPath?.fullPath || "");
1542
+ if (!systemPath) {
1543
+ throw new Error(`Cannot find system ${system.id} in the catalog`);
1544
+ }
1545
+ await rmSystemById(directory)(system.id, version, true);
1546
+ await writeSystem(directory)(system, {
1547
+ path: systemPath.directory,
1548
+ format: extension === ".md" ? "md" : "mdx"
1549
+ });
1550
+ };
1551
+ var getSystem = (directory) => async (id, version) => getResource(directory, id, version, { type: "system" });
1552
+ var getSystemByPath = (directory) => async (path9) => {
1553
+ const system = await getResource(directory, void 0, void 0, { type: "system" }, path9);
1554
+ return system;
1555
+ };
1556
+ var getSystems = (directory) => async (options) => getResources(directory, {
1557
+ type: "systems",
1558
+ ignore: SYSTEM_RESOURCE_IGNORES,
1559
+ latestOnly: options?.latestOnly
1560
+ });
1561
+ var writeSystem = (directory) => async (system, options = {
1562
+ path: "",
1563
+ override: false,
1564
+ format: "mdx"
1565
+ }) => {
1566
+ const resource = normalizeResourcePointers(system);
1567
+ return await writeResource(directory, resource, { ...options, type: "system" });
1568
+ };
1569
+ var writeSystemToDomain = (directory) => async (system, domain, options = { path: "", format: "mdx", override: false }) => {
1570
+ const resourcePath = await getResourcePath(directory, domain.id, domain.version);
1571
+ if (!resourcePath) {
1572
+ throw new Error("Domain not found");
1573
+ }
1574
+ const pathForSystem = (0, import_node_path8.join)(resourcePath.directory, "systems", system.id);
1575
+ await writeSystem(directory)({ ...system }, { ...options, path: pathForSystem });
1576
+ };
1577
+ var versionSystem = (directory) => async (id) => versionResource(directory, id);
1578
+ var rmSystem = (directory) => async (path9) => {
1579
+ await import_promises6.default.rm((0, import_node_path8.join)(directory, path9), { recursive: true });
1580
+ invalidateFileCache();
1581
+ };
1582
+ var rmSystemById = (directory) => async (id, version, persistFiles) => {
1583
+ await rmResourceById(directory, id, version, { type: "system", persistFiles });
1584
+ };
1585
+ var addFileToSystem = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
1586
+ var systemHasVersion = (directory) => async (id, version) => {
1587
+ const file = await findFileById(directory, id, version);
1588
+ return !!file;
1589
+ };
1590
+ var isSystem = (directory) => async (path9) => {
1591
+ const system = await getSystemByPath(directory)(path9);
1592
+ const relativePath = (0, import_node_path8.relative)(directory, path9);
1593
+ const segments = relativePath.split(/[/\\]+/);
1594
+ return !!system && segments.includes("systems");
1595
+ };
1596
+ var toSystem = (directory) => async (file) => toResource(directory, file);
1597
+ var addResourceToSystem = (directory, resourceField) => async (id, resource, version) => {
1598
+ const system = await getSystem(directory)(id, version);
1599
+ if (!system) {
1600
+ throw new Error(`Cannot find system ${id} in the catalog`);
1601
+ }
1602
+ if (system[resourceField] === void 0) {
1603
+ system[resourceField] = [];
1604
+ }
1605
+ const resourceExistsInList = system[resourceField]?.some(
1606
+ (item) => item.id === resource.id && item.version === resource.version
1607
+ );
1608
+ if (resourceExistsInList) {
1609
+ return;
1610
+ }
1611
+ system[resourceField]?.push(resource);
1612
+ await persistSystemAtExistingPath(directory, system, version);
1613
+ };
1614
+ var addServiceToSystem = (directory) => addResourceToSystem(directory, "services");
1615
+ var addFlowToSystem = (directory) => addResourceToSystem(directory, "flows");
1616
+ var addEntityToSystem = (directory) => addResourceToSystem(directory, "entities");
1617
+ var addContainerToSystem = (directory) => addResourceToSystem(directory, "containers");
1618
+
1619
+ // src/agents.ts
1620
+ var import_promises7 = __toESM(require("fs/promises"));
1621
+ var import_node_path9 = require("path");
1500
1622
  var rewriteAgent = async (directory, id, agent, version) => {
1501
1623
  const agentPath = await getResourcePath(directory, id, version);
1502
1624
  if (!agentPath) {
1503
1625
  throw new Error(`Cannot find agent ${id} in the catalog`);
1504
1626
  }
1505
- const extension = (0, import_node_path8.extname)(agentPath.fullPath);
1627
+ const extension = (0, import_node_path9.extname)(agentPath.fullPath);
1506
1628
  await rmAgentById(directory)(id, version, true);
1507
1629
  await writeAgent(directory)(agent, { path: agentPath.directory, format: extension === ".md" ? "md" : "mdx" });
1508
1630
  };
@@ -1546,12 +1668,12 @@ var writeVersionedAgent = (directory) => async (agent) => {
1546
1668
  };
1547
1669
  var writeAgentToDomain = (directory) => async (agent, domain, options = { path: "", format: "mdx", override: false }) => {
1548
1670
  let pathForAgent = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/agents` : `/${domain.id}/agents`;
1549
- pathForAgent = (0, import_node_path8.join)(pathForAgent, agent.id);
1671
+ pathForAgent = (0, import_node_path9.join)(pathForAgent, agent.id);
1550
1672
  await writeResource(directory, { ...agent }, { ...options, path: pathForAgent, type: "agent" });
1551
1673
  };
1552
1674
  var versionAgent = (directory) => async (id) => versionResource(directory, id);
1553
1675
  var rmAgent = (directory) => async (path9) => {
1554
- await import_promises6.default.rm((0, import_node_path8.join)(directory, path9), { recursive: true });
1676
+ await import_promises7.default.rm((0, import_node_path9.join)(directory, path9), { recursive: true });
1555
1677
  invalidateFileCache();
1556
1678
  };
1557
1679
  var rmAgentById = (directory) => async (id, version, persistFiles) => {
@@ -1625,15 +1747,15 @@ var agentHasVersion = (directory) => async (id, version) => {
1625
1747
  };
1626
1748
  var isAgent = (directory) => async (path9) => {
1627
1749
  const agent = await getAgentByPath(directory)(path9);
1628
- const relativePath = (0, import_node_path8.relative)(directory, path9);
1750
+ const relativePath = (0, import_node_path9.relative)(directory, path9);
1629
1751
  const segments = relativePath.split(/[/\\]+/);
1630
1752
  return !!agent && segments.includes("agents");
1631
1753
  };
1632
1754
  var toAgent = (directory) => async (file) => toResource(directory, file);
1633
1755
 
1634
1756
  // src/domains.ts
1635
- var import_promises7 = __toESM(require("fs/promises"));
1636
- var import_node_path9 = __toESM(require("path"));
1757
+ var import_promises8 = __toESM(require("fs/promises"));
1758
+ var import_node_path10 = __toESM(require("path"));
1637
1759
  var import_node_fs3 = __toESM(require("fs"));
1638
1760
  var import_gray_matter3 = __toESM(require("gray-matter"));
1639
1761
  var resolveDomainWriteDirectory = async (directory, id, version) => {
@@ -1677,6 +1799,9 @@ var writeDomain = (directory) => async (domain, options = {
1677
1799
  if (Array.isArray(domain.domains)) {
1678
1800
  resource.domains = uniqueVersions(domain.domains);
1679
1801
  }
1802
+ if (Array.isArray(domain.systems)) {
1803
+ resource.systems = uniqueVersions(domain.systems);
1804
+ }
1680
1805
  if (Array.isArray(domain.sends)) {
1681
1806
  resource.sends = uniqueVersions(domain.sends);
1682
1807
  }
@@ -1690,7 +1815,7 @@ var writeDomain = (directory) => async (domain, options = {
1690
1815
  };
1691
1816
  var versionDomain = (directory) => async (id) => versionResource(directory, id);
1692
1817
  var rmDomain = (directory) => async (path9) => {
1693
- await import_promises7.default.rm((0, import_node_path9.join)(directory, path9), { recursive: true });
1818
+ await import_promises8.default.rm((0, import_node_path10.join)(directory, path9), { recursive: true });
1694
1819
  invalidateFileCache();
1695
1820
  };
1696
1821
  var rmDomainById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "domain", persistFiles });
@@ -1703,7 +1828,7 @@ var addUbiquitousLanguageToDomain = (directory) => async (id, ubiquitousLanguage
1703
1828
  };
1704
1829
  var getUbiquitousLanguageFromDomain = (directory) => async (id, version) => {
1705
1830
  const pathToDomain = await findFileById(directory, id, version) || "";
1706
- const pathToUbiquitousLanguage = import_node_path9.default.join(import_node_path9.default.dirname(pathToDomain), "ubiquitous-language.mdx");
1831
+ const pathToUbiquitousLanguage = import_node_path10.default.join(import_node_path10.default.dirname(pathToDomain), "ubiquitous-language.mdx");
1707
1832
  const fileExists = import_node_fs3.default.existsSync(pathToUbiquitousLanguage);
1708
1833
  if (!fileExists) {
1709
1834
  return void 0;
@@ -1718,7 +1843,7 @@ var domainHasVersion = (directory) => async (id, version) => {
1718
1843
  var addServiceToDomain = (directory) => async (id, service, version) => {
1719
1844
  let domain = await getDomain(directory)(id, version);
1720
1845
  const domainPath = await getResourcePath(directory, id, version);
1721
- const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1846
+ const extension = import_node_path10.default.extname(domainPath?.fullPath || "");
1722
1847
  if (domain.services === void 0) {
1723
1848
  domain.services = [];
1724
1849
  }
@@ -1734,7 +1859,7 @@ var addServiceToDomain = (directory) => async (id, service, version) => {
1734
1859
  var addAgentToDomain = (directory) => async (id, agent, version) => {
1735
1860
  let domain = await getDomain(directory)(id, version);
1736
1861
  const domainPath = await getResourcePath(directory, id, version);
1737
- const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1862
+ const extension = import_node_path10.default.extname(domainPath?.fullPath || "");
1738
1863
  if (domain.agents === void 0) {
1739
1864
  domain.agents = [];
1740
1865
  }
@@ -1750,7 +1875,7 @@ var addAgentToDomain = (directory) => async (id, agent, version) => {
1750
1875
  var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
1751
1876
  let domain = await getDomain(directory)(id, version);
1752
1877
  const domainPath = await getResourcePath(directory, id, version);
1753
- const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1878
+ const extension = import_node_path10.default.extname(domainPath?.fullPath || "");
1754
1879
  if (domain.domains === void 0) {
1755
1880
  domain.domains = [];
1756
1881
  }
@@ -1763,10 +1888,26 @@ var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
1763
1888
  await rmDomainById(directory)(id, version, true);
1764
1889
  await writeDomain(writeDir)(domain, { format: extension === ".md" ? "md" : "mdx" });
1765
1890
  };
1891
+ var addSystemToDomain = (directory) => async (id, system, version) => {
1892
+ let domain = await getDomain(directory)(id, version);
1893
+ const domainPath = await getResourcePath(directory, id, version);
1894
+ const extension = import_node_path10.default.extname(domainPath?.fullPath || "");
1895
+ if (domain.systems === void 0) {
1896
+ domain.systems = [];
1897
+ }
1898
+ const systemExistsInList = domain.systems.some((s) => s.id === system.id && s.version === system.version);
1899
+ if (systemExistsInList) {
1900
+ return;
1901
+ }
1902
+ domain.systems.push(system);
1903
+ const writeDir = await resolveDomainWriteDirectory(directory, id, version);
1904
+ await rmDomainById(directory)(id, version, true);
1905
+ await writeDomain(writeDir)(domain, { format: extension === ".md" ? "md" : "mdx" });
1906
+ };
1766
1907
  var addEntityToDomain = (directory) => async (id, entity, version) => {
1767
1908
  let domain = await getDomain(directory)(id, version);
1768
1909
  const domainPath = await getResourcePath(directory, id, version);
1769
- const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1910
+ const extension = import_node_path10.default.extname(domainPath?.fullPath || "");
1770
1911
  if (domain.entities === void 0) {
1771
1912
  domain.entities = [];
1772
1913
  }
@@ -1782,7 +1923,7 @@ var addEntityToDomain = (directory) => async (id, entity, version) => {
1782
1923
  var addDataProductToDomain = (directory) => async (id, dataProduct, version) => {
1783
1924
  let domain = await getDomain(directory)(id, version);
1784
1925
  const domainPath = await getResourcePath(directory, id, version);
1785
- const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1926
+ const extension = import_node_path10.default.extname(domainPath?.fullPath || "");
1786
1927
  if (domain.dataProducts === void 0) {
1787
1928
  domain.dataProducts = [];
1788
1929
  }
@@ -1800,7 +1941,7 @@ var addDataProductToDomain = (directory) => async (id, dataProduct, version) =>
1800
1941
  var addMessageToDomain = (directory) => async (id, direction, message, version) => {
1801
1942
  let domain = await getDomain(directory)(id, version);
1802
1943
  const domainPath = await getResourcePath(directory, id, version);
1803
- const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1944
+ const extension = import_node_path10.default.extname(domainPath?.fullPath || "");
1804
1945
  if (direction === "sends") {
1805
1946
  if (domain.sends === void 0) {
1806
1947
  domain.sends = [];
@@ -1830,13 +1971,13 @@ var addMessageToDomain = (directory) => async (id, direction, message, version)
1830
1971
  };
1831
1972
 
1832
1973
  // src/channels.ts
1833
- var import_promises8 = __toESM(require("fs/promises"));
1834
- var import_node_path10 = require("path");
1974
+ var import_promises9 = __toESM(require("fs/promises"));
1975
+ var import_node_path11 = require("path");
1835
1976
  var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
1836
1977
  var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
1837
1978
  var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
1838
1979
  var rmChannel = (directory) => async (path9) => {
1839
- await import_promises8.default.rm((0, import_node_path10.join)(directory, path9), { recursive: true });
1980
+ await import_promises9.default.rm((0, import_node_path11.join)(directory, path9), { recursive: true });
1840
1981
  invalidateFileCache();
1841
1982
  };
1842
1983
  var rmChannelById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "channel", persistFiles });
@@ -1867,7 +2008,7 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
1867
2008
  const { getMessage: getMessage2, rmMessageById, writeMessage } = functions[collection];
1868
2009
  const message = await getMessage2(directory)(_message.id, _message.version);
1869
2010
  const messagePath = await getResourcePath(directory, _message.id, _message.version);
1870
- const extension = (0, import_node_path10.extname)(messagePath?.fullPath || "");
2011
+ const extension = (0, import_node_path11.extname)(messagePath?.fullPath || "");
1871
2012
  if (!message) throw new Error(`Message ${_message.id} with version ${_message.version} not found`);
1872
2013
  if (message.channels === void 0) {
1873
2014
  message.channels = [];
@@ -1879,18 +2020,18 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
1879
2020
  throw new Error(`Cannot find message ${id} in the catalog`);
1880
2021
  }
1881
2022
  const path9 = existingResource.split(new RegExp(`[\\\\/]+${collection}`))[0];
1882
- const pathToResource = (0, import_node_path10.join)(path9, collection);
2023
+ const pathToResource = (0, import_node_path11.join)(path9, collection);
1883
2024
  await rmMessageById(directory)(_message.id, _message.version, true);
1884
2025
  await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
1885
2026
  };
1886
2027
 
1887
2028
  // src/messages.ts
1888
- var import_node_path11 = require("path");
2029
+ var import_node_path12 = require("path");
1889
2030
  var import_node_fs4 = __toESM(require("fs"));
1890
2031
  var import_gray_matter4 = __toESM(require("gray-matter"));
1891
2032
  var import_semver5 = require("semver");
1892
2033
  var getMessageBySchemaPath = (directory) => async (path9, options) => {
1893
- const pathToMessage = (0, import_node_path11.dirname)(path9);
2034
+ const pathToMessage = (0, import_node_path12.dirname)(path9);
1894
2035
  try {
1895
2036
  const files = await getFiles(`${directory}/${pathToMessage}/index.{md,mdx}`);
1896
2037
  if (!files || files.length === 0) {
@@ -1988,8 +2129,8 @@ var getSchemaForMessage = (directory) => async (id, version) => {
1988
2129
  if (!file || !import_node_fs4.default.existsSync(file)) return void 0;
1989
2130
  const { data } = import_gray_matter4.default.read(file);
1990
2131
  if (!data.schemaPath) return void 0;
1991
- const resourceDirectory = (0, import_node_path11.dirname)(file);
1992
- const pathToSchema = (0, import_node_path11.join)(resourceDirectory, data.schemaPath);
2132
+ const resourceDirectory = (0, import_node_path12.dirname)(file);
2133
+ const pathToSchema = (0, import_node_path12.join)(resourceDirectory, data.schemaPath);
1993
2134
  if (!import_node_fs4.default.existsSync(pathToSchema)) return void 0;
1994
2135
  const schema = import_node_fs4.default.readFileSync(pathToSchema, "utf8");
1995
2136
  return {
@@ -1999,13 +2140,13 @@ var getSchemaForMessage = (directory) => async (id, version) => {
1999
2140
  };
2000
2141
 
2001
2142
  // src/custom-docs.ts
2002
- var import_node_path12 = __toESM(require("path"));
2143
+ var import_node_path13 = __toESM(require("path"));
2003
2144
  var import_node_fs5 = __toESM(require("fs"));
2004
- var import_promises9 = __toESM(require("fs/promises"));
2145
+ var import_promises10 = __toESM(require("fs/promises"));
2005
2146
  var import_gray_matter5 = __toESM(require("gray-matter"));
2006
2147
  var import_slugify = __toESM(require("slugify"));
2007
2148
  var getCustomDoc = (directory) => async (filePath) => {
2008
- const fullPath = import_node_path12.default.join(directory, filePath);
2149
+ const fullPath = import_node_path13.default.join(directory, filePath);
2009
2150
  const fullPathWithExtension = fullPath.endsWith(".mdx") ? fullPath : `${fullPath}.mdx`;
2010
2151
  const fileExists = import_node_fs5.default.existsSync(fullPathWithExtension);
2011
2152
  if (!fileExists) {
@@ -2024,39 +2165,39 @@ var writeCustomDoc = (directory) => async (customDoc, options = { path: "" }) =>
2024
2165
  const { fileName, ...rest } = customDoc;
2025
2166
  const name = fileName || (0, import_slugify.default)(customDoc.title, { lower: true });
2026
2167
  const withExtension = name.endsWith(".mdx") ? name : `${name}.mdx`;
2027
- const fullPath = import_node_path12.default.join(directory, options.path || "", withExtension);
2028
- import_node_fs5.default.mkdirSync(import_node_path12.default.dirname(fullPath), { recursive: true });
2168
+ const fullPath = import_node_path13.default.join(directory, options.path || "", withExtension);
2169
+ import_node_fs5.default.mkdirSync(import_node_path13.default.dirname(fullPath), { recursive: true });
2029
2170
  const document = import_gray_matter5.default.stringify(customDoc.markdown.trim(), rest);
2030
2171
  import_node_fs5.default.writeFileSync(fullPath, document);
2031
2172
  invalidateFileCache();
2032
2173
  };
2033
2174
  var rmCustomDoc = (directory) => async (filePath) => {
2034
2175
  const withExtension = filePath.endsWith(".mdx") ? filePath : `${filePath}.mdx`;
2035
- await import_promises9.default.rm((0, import_node_path12.join)(directory, withExtension), { recursive: true });
2176
+ await import_promises10.default.rm((0, import_node_path13.join)(directory, withExtension), { recursive: true });
2036
2177
  invalidateFileCache();
2037
2178
  };
2038
2179
 
2039
2180
  // src/teams.ts
2040
- var import_promises10 = __toESM(require("fs/promises"));
2181
+ var import_promises11 = __toESM(require("fs/promises"));
2041
2182
  var import_node_fs8 = __toESM(require("fs"));
2042
- var import_node_path15 = require("path");
2183
+ var import_node_path16 = require("path");
2043
2184
  var import_gray_matter7 = __toESM(require("gray-matter"));
2044
- var import_node_path16 = __toESM(require("path"));
2185
+ var import_node_path17 = __toESM(require("path"));
2045
2186
 
2046
2187
  // src/users.ts
2047
2188
  var import_node_fs7 = __toESM(require("fs"));
2048
- var import_node_path14 = require("path");
2189
+ var import_node_path15 = require("path");
2049
2190
  var import_gray_matter6 = __toESM(require("gray-matter"));
2050
2191
 
2051
2192
  // src/internal/directory-store.ts
2052
2193
  var import_node_fs6 = __toESM(require("fs"));
2053
- var import_node_path13 = __toESM(require("path"));
2054
- var DIRECTORY_STORE_PATH = import_node_path13.default.join(".eventcatalog", "store", "directory.json");
2194
+ var import_node_path14 = __toESM(require("path"));
2195
+ var DIRECTORY_STORE_PATH = import_node_path14.default.join(".eventcatalog", "store", "directory.json");
2055
2196
  var getCatalogRoot = (catalogDir, collection) => {
2056
- return import_node_path13.default.basename(catalogDir) === collection ? import_node_path13.default.dirname(catalogDir) : catalogDir;
2197
+ return import_node_path14.default.basename(catalogDir) === collection ? import_node_path14.default.dirname(catalogDir) : catalogDir;
2057
2198
  };
2058
2199
  var getDirectoryStorePath = (catalogDir, collection) => {
2059
- return import_node_path13.default.join(getCatalogRoot(catalogDir, collection), DIRECTORY_STORE_PATH);
2200
+ return import_node_path14.default.join(getCatalogRoot(catalogDir, collection), DIRECTORY_STORE_PATH);
2060
2201
  };
2061
2202
  var readDirectoryStoreResources = (catalogDir, collection) => {
2062
2203
  const storePath = getDirectoryStorePath(catalogDir, collection);
@@ -2114,12 +2255,12 @@ var writeUser = (catalogDir) => async (user, options = {}) => {
2114
2255
  }
2115
2256
  const { markdown, ...frontmatter } = resource;
2116
2257
  const document = import_gray_matter6.default.stringify(markdown, frontmatter);
2117
- import_node_fs7.default.mkdirSync((0, import_node_path14.join)(catalogDir, ""), { recursive: true });
2118
- import_node_fs7.default.writeFileSync((0, import_node_path14.join)(catalogDir, "", `${resource.id}.mdx`), document);
2258
+ import_node_fs7.default.mkdirSync((0, import_node_path15.join)(catalogDir, ""), { recursive: true });
2259
+ import_node_fs7.default.writeFileSync((0, import_node_path15.join)(catalogDir, "", `${resource.id}.mdx`), document);
2119
2260
  invalidateFileCache();
2120
2261
  };
2121
2262
  var rmUserById = (catalogDir) => async (id) => {
2122
- import_node_fs7.default.rmSync((0, import_node_path14.join)(catalogDir, `${id}.mdx`), { recursive: true });
2263
+ import_node_fs7.default.rmSync((0, import_node_path15.join)(catalogDir, `${id}.mdx`), { recursive: true });
2123
2264
  invalidateFileCache();
2124
2265
  };
2125
2266
 
@@ -2158,12 +2299,12 @@ var writeTeam = (catalogDir) => async (team, options = {}) => {
2158
2299
  }
2159
2300
  const { markdown, ...frontmatter } = resource;
2160
2301
  const document = import_gray_matter7.default.stringify(markdown, frontmatter);
2161
- import_node_fs8.default.mkdirSync((0, import_node_path15.join)(catalogDir, ""), { recursive: true });
2162
- import_node_fs8.default.writeFileSync((0, import_node_path15.join)(catalogDir, "", `${resource.id}.mdx`), document);
2302
+ import_node_fs8.default.mkdirSync((0, import_node_path16.join)(catalogDir, ""), { recursive: true });
2303
+ import_node_fs8.default.writeFileSync((0, import_node_path16.join)(catalogDir, "", `${resource.id}.mdx`), document);
2163
2304
  invalidateFileCache();
2164
2305
  };
2165
2306
  var rmTeamById = (catalogDir) => async (id) => {
2166
- await import_promises10.default.rm((0, import_node_path15.join)(catalogDir, `${id}.mdx`), { recursive: true });
2307
+ await import_promises11.default.rm((0, import_node_path16.join)(catalogDir, `${id}.mdx`), { recursive: true });
2167
2308
  invalidateFileCache();
2168
2309
  };
2169
2310
  var getOwnersForResource = (catalogDir) => async (id, version) => {
@@ -2172,11 +2313,11 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
2172
2313
  if (!resource) return [];
2173
2314
  if (!resource.owners) return [];
2174
2315
  for (const owner of resource.owners) {
2175
- const team = await getTeam(import_node_path16.default.join(catalogDir, "teams"))(owner);
2316
+ const team = await getTeam(import_node_path17.default.join(catalogDir, "teams"))(owner);
2176
2317
  if (team) {
2177
2318
  owners.push(team);
2178
2319
  } else {
2179
- const user = await getUser(import_node_path16.default.join(catalogDir, "users"))(owner);
2320
+ const user = await getUser(import_node_path17.default.join(catalogDir, "users"))(owner);
2180
2321
  if (user) {
2181
2322
  owners.push(user);
2182
2323
  }
@@ -2187,11 +2328,11 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
2187
2328
 
2188
2329
  // src/eventcatalog.ts
2189
2330
  var import_fs = __toESM(require("fs"));
2190
- var import_node_path17 = __toESM(require("path"));
2331
+ var import_node_path18 = __toESM(require("path"));
2191
2332
  var DUMP_VERSION = "0.0.1";
2192
2333
  var getEventCatalogVersion = async (catalogDir) => {
2193
2334
  try {
2194
- const packageJson = import_fs.default.readFileSync((0, import_node_path17.join)(catalogDir, "package.json"), "utf8");
2335
+ const packageJson = import_fs.default.readFileSync((0, import_node_path18.join)(catalogDir, "package.json"), "utf8");
2195
2336
  const packageJsonObject = JSON.parse(packageJson);
2196
2337
  return packageJsonObject["dependencies"]["@eventcatalog/core"];
2197
2338
  } catch (error) {
@@ -2204,7 +2345,7 @@ var hydrateResource = async (catalogDir, resources = [], { attachSchema = false
2204
2345
  const resourcePath = await getResourcePath(catalogDir, resource.id, resource.version);
2205
2346
  let schema = "";
2206
2347
  if (resource.schemaPath && resourcePath?.fullPath) {
2207
- const pathToSchema = import_node_path17.default.join(import_node_path17.default.dirname(resourcePath?.fullPath), resource.schemaPath);
2348
+ const pathToSchema = import_node_path18.default.join(import_node_path18.default.dirname(resourcePath?.fullPath), resource.schemaPath);
2208
2349
  if (import_fs.default.existsSync(pathToSchema)) {
2209
2350
  schema = import_fs.default.readFileSync(pathToSchema, "utf8");
2210
2351
  }
@@ -2225,7 +2366,7 @@ var filterCollection = (collection, options) => {
2225
2366
  };
2226
2367
  var getEventCatalogConfigurationFile = (directory) => async () => {
2227
2368
  try {
2228
- const path9 = (0, import_node_path17.join)(directory, "eventcatalog.config.js");
2369
+ const path9 = (0, import_node_path18.join)(directory, "eventcatalog.config.js");
2229
2370
  const configModule = await import(path9);
2230
2371
  return configModule.default;
2231
2372
  } catch (error) {
@@ -2236,6 +2377,7 @@ var getEventCatalogConfigurationFile = (directory) => async () => {
2236
2377
  var dumpCatalog = (directory) => async (options) => {
2237
2378
  const {
2238
2379
  getDomains: getDomains2,
2380
+ getSystems: getSystems2,
2239
2381
  getServices: getServices2,
2240
2382
  getAgents: getAgents2,
2241
2383
  getEvents: getEvents2,
@@ -2250,6 +2392,7 @@ var dumpCatalog = (directory) => async (options) => {
2250
2392
  } = src_default(directory);
2251
2393
  const { includeMarkdown = true } = options || {};
2252
2394
  const domains = await getDomains2();
2395
+ const systems = await getSystems2();
2253
2396
  const services = await getServices2();
2254
2397
  const agents = await getAgents2();
2255
2398
  const events = await getEvents2();
@@ -2263,6 +2406,7 @@ var dumpCatalog = (directory) => async (options) => {
2263
2406
  const flows = await getFlows2();
2264
2407
  const [
2265
2408
  hydratedDomains,
2409
+ hydratedSystems,
2266
2410
  hydratedServices,
2267
2411
  hydratedAgents,
2268
2412
  hydratedEvents,
@@ -2276,6 +2420,7 @@ var dumpCatalog = (directory) => async (options) => {
2276
2420
  hydratedFlows
2277
2421
  ] = await Promise.all([
2278
2422
  hydrateResource(directory, domains),
2423
+ hydrateResource(directory, systems),
2279
2424
  hydrateResource(directory, services),
2280
2425
  hydrateResource(directory, agents),
2281
2426
  hydrateResource(directory, events),
@@ -2294,6 +2439,7 @@ var dumpCatalog = (directory) => async (options) => {
2294
2439
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
2295
2440
  resources: {
2296
2441
  domains: filterCollection(hydratedDomains, { includeMarkdown }),
2442
+ systems: filterCollection(hydratedSystems, { includeMarkdown }),
2297
2443
  services: filterCollection(hydratedServices, { includeMarkdown }),
2298
2444
  agents: filterCollection(hydratedAgents, { includeMarkdown }),
2299
2445
  messages: {
@@ -2313,7 +2459,7 @@ var dumpCatalog = (directory) => async (options) => {
2313
2459
 
2314
2460
  // src/snapshots.ts
2315
2461
  var import_node_fs9 = __toESM(require("fs"));
2316
- var import_node_path18 = __toESM(require("path"));
2462
+ var import_node_path19 = __toESM(require("path"));
2317
2463
  var import_node_crypto = require("crypto");
2318
2464
  var import_node_child_process = require("child_process");
2319
2465
  var import_semver6 = require("semver");
@@ -2493,7 +2639,7 @@ var computeRelationshipDiff = (snapshotA, snapshotB) => {
2493
2639
  var SNAPSHOT_VERSION = "1.0.0";
2494
2640
  var getEventCatalogVersion2 = (catalogDir) => {
2495
2641
  try {
2496
- const packageJson = import_node_fs9.default.readFileSync(import_node_path18.default.join(catalogDir, "package.json"), "utf8");
2642
+ const packageJson = import_node_fs9.default.readFileSync(import_node_path19.default.join(catalogDir, "package.json"), "utf8");
2497
2643
  const packageJsonObject = JSON.parse(packageJson);
2498
2644
  return packageJsonObject["dependencies"]?.["@eventcatalog/core"] ?? "unknown";
2499
2645
  } catch {
@@ -2590,10 +2736,10 @@ var createSnapshot = (directory) => {
2590
2736
  channels: snapshotChannels
2591
2737
  }
2592
2738
  };
2593
- const snapshotsDir = outputDir || import_node_path18.default.join(directory, ".snapshots");
2739
+ const snapshotsDir = outputDir || import_node_path19.default.join(directory, ".snapshots");
2594
2740
  import_node_fs9.default.mkdirSync(snapshotsDir, { recursive: true });
2595
2741
  const fileName = `${snapshotLabel}.snapshot.json`;
2596
- const filePath = import_node_path18.default.join(snapshotsDir, fileName);
2742
+ const filePath = import_node_path19.default.join(snapshotsDir, fileName);
2597
2743
  import_node_fs9.default.writeFileSync(filePath, JSON.stringify(snapshot));
2598
2744
  return { filePath, snapshot };
2599
2745
  };
@@ -2624,13 +2770,13 @@ var diffSnapshots = (directory) => async (snapshotAPath, snapshotBPath) => {
2624
2770
  };
2625
2771
  };
2626
2772
  var listSnapshots = (directory) => async () => {
2627
- const snapshotsDir = import_node_path18.default.join(directory, ".snapshots");
2773
+ const snapshotsDir = import_node_path19.default.join(directory, ".snapshots");
2628
2774
  if (!import_node_fs9.default.existsSync(snapshotsDir)) return [];
2629
2775
  const files = import_node_fs9.default.readdirSync(snapshotsDir).filter((f) => f.endsWith(".snapshot.json"));
2630
2776
  const snapshots = [];
2631
2777
  for (const file of files) {
2632
2778
  try {
2633
- const filePath = import_node_path18.default.join(snapshotsDir, file);
2779
+ const filePath = import_node_path19.default.join(snapshotsDir, file);
2634
2780
  const content = JSON.parse(import_node_fs9.default.readFileSync(filePath, "utf-8"));
2635
2781
  snapshots.push({
2636
2782
  label: content.label,
@@ -2645,9 +2791,9 @@ var listSnapshots = (directory) => async () => {
2645
2791
  };
2646
2792
 
2647
2793
  // src/changelogs.ts
2648
- var import_node_path19 = __toESM(require("path"));
2794
+ var import_node_path20 = __toESM(require("path"));
2649
2795
  var import_node_fs10 = __toESM(require("fs"));
2650
- var import_promises11 = __toESM(require("fs/promises"));
2796
+ var import_promises12 = __toESM(require("fs/promises"));
2651
2797
  var import_gray_matter8 = __toESM(require("gray-matter"));
2652
2798
  var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
2653
2799
  const { version, format = "mdx" } = options;
@@ -2655,8 +2801,8 @@ var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
2655
2801
  if (!resourceFile) {
2656
2802
  throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
2657
2803
  }
2658
- const resourceDir = (0, import_node_path19.dirname)(resourceFile);
2659
- const changelogPath = import_node_path19.default.join(resourceDir, `changelog.${format}`);
2804
+ const resourceDir = (0, import_node_path20.dirname)(resourceFile);
2805
+ const changelogPath = import_node_path20.default.join(resourceDir, `changelog.${format}`);
2660
2806
  const { markdown, ...frontmatter } = changelog;
2661
2807
  const fm = { ...frontmatter };
2662
2808
  if (fm.createdAt instanceof Date) {
@@ -2676,9 +2822,9 @@ var appendChangelog = (catalogDir) => async (id, changelog, options = {}) => {
2676
2822
  if (!resourceFile) {
2677
2823
  throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
2678
2824
  }
2679
- const resourceDir = (0, import_node_path19.dirname)(resourceFile);
2680
- const mdxPath = import_node_path19.default.join(resourceDir, "changelog.mdx");
2681
- const mdPath = import_node_path19.default.join(resourceDir, "changelog.md");
2825
+ const resourceDir = (0, import_node_path20.dirname)(resourceFile);
2826
+ const mdxPath = import_node_path20.default.join(resourceDir, "changelog.mdx");
2827
+ const mdPath = import_node_path20.default.join(resourceDir, "changelog.md");
2682
2828
  const existingPath = import_node_fs10.default.existsSync(mdxPath) ? mdxPath : import_node_fs10.default.existsSync(mdPath) ? mdPath : void 0;
2683
2829
  if (!existingPath) {
2684
2830
  return writeChangelog(catalogDir)(id, changelog, options);
@@ -2706,9 +2852,9 @@ var getChangelog = (catalogDir) => async (id, options = {}) => {
2706
2852
  const { version } = options;
2707
2853
  const resourceFile = await findFileById(catalogDir, id, version);
2708
2854
  if (!resourceFile) return void 0;
2709
- const resourceDir = (0, import_node_path19.dirname)(resourceFile);
2710
- const mdxPath = import_node_path19.default.join(resourceDir, "changelog.mdx");
2711
- const mdPath = import_node_path19.default.join(resourceDir, "changelog.md");
2855
+ const resourceDir = (0, import_node_path20.dirname)(resourceFile);
2856
+ const mdxPath = import_node_path20.default.join(resourceDir, "changelog.mdx");
2857
+ const mdPath = import_node_path20.default.join(resourceDir, "changelog.md");
2712
2858
  const changelogPath = import_node_fs10.default.existsSync(mdxPath) ? mdxPath : import_node_fs10.default.existsSync(mdPath) ? mdPath : void 0;
2713
2859
  if (!changelogPath) return void 0;
2714
2860
  const { data, content } = import_gray_matter8.default.read(changelogPath);
@@ -2720,21 +2866,21 @@ var rmChangelog = (catalogDir) => async (id, options = {}) => {
2720
2866
  if (!resourceFile) {
2721
2867
  throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
2722
2868
  }
2723
- const resourceDir = (0, import_node_path19.dirname)(resourceFile);
2724
- const mdxPath = import_node_path19.default.join(resourceDir, "changelog.mdx");
2725
- const mdPath = import_node_path19.default.join(resourceDir, "changelog.md");
2869
+ const resourceDir = (0, import_node_path20.dirname)(resourceFile);
2870
+ const mdxPath = import_node_path20.default.join(resourceDir, "changelog.mdx");
2871
+ const mdPath = import_node_path20.default.join(resourceDir, "changelog.md");
2726
2872
  if (import_node_fs10.default.existsSync(mdxPath)) {
2727
- await import_promises11.default.rm(mdxPath);
2873
+ await import_promises12.default.rm(mdxPath);
2728
2874
  }
2729
2875
  if (import_node_fs10.default.existsSync(mdPath)) {
2730
- await import_promises11.default.rm(mdPath);
2876
+ await import_promises12.default.rm(mdPath);
2731
2877
  }
2732
2878
  invalidateFileCache();
2733
2879
  };
2734
2880
 
2735
2881
  // src/entities.ts
2736
- var import_promises12 = __toESM(require("fs/promises"));
2737
- var import_node_path20 = require("path");
2882
+ var import_promises13 = __toESM(require("fs/promises"));
2883
+ var import_node_path21 = require("path");
2738
2884
  var getEntity = (directory) => async (id, version) => getResource(directory, id, version, { type: "entity" });
2739
2885
  var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
2740
2886
  var writeEntity = (directory) => async (entity, options = {
@@ -2742,8 +2888,16 @@ var writeEntity = (directory) => async (entity, options = {
2742
2888
  override: false,
2743
2889
  format: "mdx"
2744
2890
  }) => writeResource(directory, { ...entity }, { ...options, type: "entity" });
2891
+ var writeEntityToSystem = (directory) => async (entity, system, options = { path: "", format: "mdx", override: false }) => {
2892
+ const resourcePath = await getResourcePath(directory, system.id, system.version);
2893
+ if (!resourcePath) {
2894
+ throw new Error("System not found");
2895
+ }
2896
+ const pathForEntity = (0, import_node_path21.join)(resourcePath.directory, "entities", entity.id);
2897
+ await writeResource(directory, { ...entity }, { ...options, path: pathForEntity, type: "entity" });
2898
+ };
2745
2899
  var rmEntity = (directory) => async (path9) => {
2746
- await import_promises12.default.rm((0, import_node_path20.join)(directory, path9), { recursive: true });
2900
+ await import_promises13.default.rm((0, import_node_path21.join)(directory, path9), { recursive: true });
2747
2901
  invalidateFileCache();
2748
2902
  };
2749
2903
  var rmEntityById = (directory) => async (id, version, persistFiles) => {
@@ -2756,8 +2910,8 @@ var entityHasVersion = (directory) => async (id, version) => {
2756
2910
  };
2757
2911
 
2758
2912
  // src/flows.ts
2759
- var import_promises13 = __toESM(require("fs/promises"));
2760
- var import_node_path21 = require("path");
2913
+ var import_promises14 = __toESM(require("fs/promises"));
2914
+ var import_node_path22 = require("path");
2761
2915
 
2762
2916
  // src/flow-builder.ts
2763
2917
  var cloneStep = (step) => ({
@@ -3239,21 +3393,29 @@ var writeVersionedFlow = (directory) => async (flow) => {
3239
3393
  };
3240
3394
  var writeFlowToDomain = (directory) => async (flow, domain, options = { path: "", format: "mdx", override: false }) => {
3241
3395
  let pathForFlow = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/flows` : `/${domain.id}/flows`;
3242
- pathForFlow = (0, import_node_path21.join)(pathForFlow, flow.id);
3396
+ pathForFlow = (0, import_node_path22.join)(pathForFlow, flow.id);
3243
3397
  await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
3244
3398
  };
3245
3399
  var writeFlowToService = (directory) => async (flow, service, options = { path: "", format: "mdx", override: false }) => {
3246
3400
  let pathForFlow = service.version && service.version !== "latest" ? `/${service.id}/versioned/${service.version}/flows` : `/${service.id}/flows`;
3247
- pathForFlow = (0, import_node_path21.join)(pathForFlow, flow.id);
3401
+ pathForFlow = (0, import_node_path22.join)(pathForFlow, flow.id);
3402
+ await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
3403
+ };
3404
+ var writeFlowToSystem = (directory) => async (flow, system, options = { path: "", format: "mdx", override: false }) => {
3405
+ const resourcePath = await getResourcePath(directory, system.id, system.version);
3406
+ if (!resourcePath) {
3407
+ throw new Error("System not found");
3408
+ }
3409
+ const pathForFlow = (0, import_node_path22.join)(resourcePath.directory, "flows", flow.id);
3248
3410
  await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
3249
3411
  };
3250
3412
  var writeFlowToAgent = (directory) => async (flow, agent, options = { path: "", format: "mdx", override: false }) => {
3251
3413
  let pathForFlow = agent.version && agent.version !== "latest" ? `/${agent.id}/versioned/${agent.version}/flows` : `/${agent.id}/flows`;
3252
- pathForFlow = (0, import_node_path21.join)(pathForFlow, flow.id);
3414
+ pathForFlow = (0, import_node_path22.join)(pathForFlow, flow.id);
3253
3415
  await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
3254
3416
  };
3255
3417
  var rmFlow = (directory) => async (path9) => {
3256
- await import_promises13.default.rm((0, import_node_path21.join)(directory, path9), { recursive: true });
3418
+ await import_promises14.default.rm((0, import_node_path22.join)(directory, path9), { recursive: true });
3257
3419
  invalidateFileCache();
3258
3420
  };
3259
3421
  var rmFlowById = (directory) => async (id, version, persistFiles) => {
@@ -3267,8 +3429,8 @@ var flowHasVersion = (directory) => async (id, version) => {
3267
3429
  var addFileToFlow = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version, { type: "flow" });
3268
3430
 
3269
3431
  // src/containers.ts
3270
- var import_promises14 = __toESM(require("fs/promises"));
3271
- var import_node_path22 = require("path");
3432
+ var import_promises15 = __toESM(require("fs/promises"));
3433
+ var import_node_path23 = require("path");
3272
3434
  var getContainer = (directory) => async (id, version) => getResource(directory, id, version, { type: "container" });
3273
3435
  var getContainers = (directory) => async (options) => getResources(directory, { type: "containers", latestOnly: options?.latestOnly });
3274
3436
  var writeContainer = (directory) => async (data, options = {
@@ -3278,7 +3440,7 @@ var writeContainer = (directory) => async (data, options = {
3278
3440
  }) => writeResource(directory, { ...data }, { ...options, type: "container" });
3279
3441
  var versionContainer = (directory) => async (id) => versionResource(directory, id);
3280
3442
  var rmContainer = (directory) => async (path9) => {
3281
- await import_promises14.default.rm((0, import_node_path22.join)(directory, path9), { recursive: true });
3443
+ await import_promises15.default.rm((0, import_node_path23.join)(directory, path9), { recursive: true });
3282
3444
  invalidateFileCache();
3283
3445
  };
3284
3446
  var rmContainerById = (directory) => async (id, version, persistFiles) => {
@@ -3295,7 +3457,15 @@ var writeContainerToService = (directory) => async (container, service, options
3295
3457
  throw new Error("Service not found");
3296
3458
  }
3297
3459
  let pathForContainer = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/containers` : `${resourcePath.directory}/containers`;
3298
- pathForContainer = (0, import_node_path22.join)(pathForContainer, container.id);
3460
+ pathForContainer = (0, import_node_path23.join)(pathForContainer, container.id);
3461
+ await writeResource(directory, { ...container }, { ...options, path: pathForContainer, type: "container" });
3462
+ };
3463
+ var writeContainerToSystem = (directory) => async (container, system, options = { path: "", format: "mdx", override: false }) => {
3464
+ const resourcePath = await getResourcePath(directory, system.id, system.version);
3465
+ if (!resourcePath) {
3466
+ throw new Error("System not found");
3467
+ }
3468
+ const pathForContainer = (0, import_node_path23.join)(resourcePath.directory, "containers", container.id);
3299
3469
  await writeResource(directory, { ...container }, { ...options, path: pathForContainer, type: "container" });
3300
3470
  };
3301
3471
 
@@ -3309,10 +3479,11 @@ var rmDataStoreById = rmContainerById;
3309
3479
  var dataStoreHasVersion = containerHasVersion;
3310
3480
  var addFileToDataStore = addFileToContainer;
3311
3481
  var writeDataStoreToService = writeContainerToService;
3482
+ var writeDataStoreToSystem = writeContainerToSystem;
3312
3483
 
3313
3484
  // src/data-products.ts
3314
- var import_promises15 = __toESM(require("fs/promises"));
3315
- var import_node_path23 = require("path");
3485
+ var import_promises16 = __toESM(require("fs/promises"));
3486
+ var import_node_path24 = require("path");
3316
3487
  var getDataProduct = (directory) => async (id, version) => getResource(directory, id, version, { type: "data-product" });
3317
3488
  var getDataProducts = (directory) => async (options) => getResources(directory, { type: "data-products", latestOnly: options?.latestOnly });
3318
3489
  var writeDataProduct = (directory) => async (dataProduct, options = {
@@ -3322,11 +3493,11 @@ var writeDataProduct = (directory) => async (dataProduct, options = {
3322
3493
  }) => writeResource(directory, { ...dataProduct }, { ...options, type: "data-product" });
3323
3494
  var writeDataProductToDomain = (directory) => async (dataProduct, domain, options = { path: "", format: "mdx", override: false }) => {
3324
3495
  let pathForDataProduct = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/data-products` : `/${domain.id}/data-products`;
3325
- pathForDataProduct = (0, import_node_path23.join)(pathForDataProduct, dataProduct.id);
3496
+ pathForDataProduct = (0, import_node_path24.join)(pathForDataProduct, dataProduct.id);
3326
3497
  await writeResource(directory, { ...dataProduct }, { ...options, path: pathForDataProduct, type: "data-product" });
3327
3498
  };
3328
3499
  var rmDataProduct = (directory) => async (path9) => {
3329
- await import_promises15.default.rm((0, import_node_path23.join)(directory, path9), { recursive: true });
3500
+ await import_promises16.default.rm((0, import_node_path24.join)(directory, path9), { recursive: true });
3330
3501
  invalidateFileCache();
3331
3502
  };
3332
3503
  var rmDataProductById = (directory) => async (id, version, persistFiles) => {
@@ -3340,8 +3511,8 @@ var dataProductHasVersion = (directory) => async (id, version) => {
3340
3511
  var addFileToDataProduct = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
3341
3512
 
3342
3513
  // src/diagrams.ts
3343
- var import_promises16 = __toESM(require("fs/promises"));
3344
- var import_node_path24 = require("path");
3514
+ var import_promises17 = __toESM(require("fs/promises"));
3515
+ var import_node_path25 = require("path");
3345
3516
  var getDiagram = (directory) => async (id, version) => getResource(directory, id, version, { type: "diagram" });
3346
3517
  var getDiagrams = (directory) => async (options) => getResources(directory, { type: "diagrams", latestOnly: options?.latestOnly });
3347
3518
  var writeDiagram = (directory) => async (diagram, options = {
@@ -3350,7 +3521,7 @@ var writeDiagram = (directory) => async (diagram, options = {
3350
3521
  format: "mdx"
3351
3522
  }) => writeResource(directory, { ...diagram }, { ...options, type: "diagram" });
3352
3523
  var rmDiagram = (directory) => async (path9) => {
3353
- await import_promises16.default.rm((0, import_node_path24.join)(directory, path9), { recursive: true });
3524
+ await import_promises17.default.rm((0, import_node_path25.join)(directory, path9), { recursive: true });
3354
3525
  invalidateFileCache();
3355
3526
  };
3356
3527
  var rmDiagramById = (directory) => async (id, version, persistFiles) => {
@@ -3372,13 +3543,13 @@ var src_default = (path9) => {
3372
3543
  * @param version - Optional id of the version to get (supports semver)
3373
3544
  * @returns Event|Undefined
3374
3545
  */
3375
- getEvent: getEvent((0, import_node_path25.join)(path9)),
3546
+ getEvent: getEvent((0, import_node_path26.join)(path9)),
3376
3547
  /**
3377
3548
  * Returns all events from EventCatalog
3378
3549
  * @param latestOnly - optional boolean, set to true to get only latest versions
3379
3550
  * @returns Event[]|Undefined
3380
3551
  */
3381
- getEvents: getEvents((0, import_node_path25.join)(path9)),
3552
+ getEvents: getEvents((0, import_node_path26.join)(path9)),
3382
3553
  /**
3383
3554
  * Adds an event to EventCatalog
3384
3555
  *
@@ -3386,7 +3557,7 @@ var src_default = (path9) => {
3386
3557
  * @param options - Optional options to write the event
3387
3558
  *
3388
3559
  */
3389
- writeEvent: writeEvent((0, import_node_path25.join)(path9, "events")),
3560
+ writeEvent: writeEvent((0, import_node_path26.join)(path9, "events")),
3390
3561
  /**
3391
3562
  * Adds an event to a service in EventCatalog
3392
3563
  *
@@ -3395,7 +3566,7 @@ var src_default = (path9) => {
3395
3566
  * @param options - Optional options to write the event
3396
3567
  *
3397
3568
  */
3398
- writeEventToService: writeEventToService((0, import_node_path25.join)(path9)),
3569
+ writeEventToService: writeEventToService((0, import_node_path26.join)(path9)),
3399
3570
  /**
3400
3571
  * Adds an event to an agent in EventCatalog
3401
3572
  *
@@ -3404,26 +3575,26 @@ var src_default = (path9) => {
3404
3575
  * @param options - Optional options to write the event
3405
3576
  *
3406
3577
  */
3407
- writeEventToAgent: writeEventToAgent((0, import_node_path25.join)(path9)),
3578
+ writeEventToAgent: writeEventToAgent((0, import_node_path26.join)(path9)),
3408
3579
  /**
3409
3580
  * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
3410
3581
  *
3411
3582
  * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
3412
3583
  *
3413
3584
  */
3414
- rmEvent: rmEvent((0, import_node_path25.join)(path9, "events")),
3585
+ rmEvent: rmEvent((0, import_node_path26.join)(path9, "events")),
3415
3586
  /**
3416
3587
  * Remove an event by an Event id
3417
3588
  *
3418
3589
  * @param id - The id of the event you want to remove
3419
3590
  *
3420
3591
  */
3421
- rmEventById: rmEventById((0, import_node_path25.join)(path9)),
3592
+ rmEventById: rmEventById((0, import_node_path26.join)(path9)),
3422
3593
  /**
3423
3594
  * Moves a given event id to the version directory
3424
3595
  * @param directory
3425
3596
  */
3426
- versionEvent: versionEvent((0, import_node_path25.join)(path9)),
3597
+ versionEvent: versionEvent((0, import_node_path26.join)(path9)),
3427
3598
  /**
3428
3599
  * Adds a file to the given event
3429
3600
  * @param id - The id of the event to add the file to
@@ -3431,7 +3602,7 @@ var src_default = (path9) => {
3431
3602
  * @param version - Optional version of the event to add the file to
3432
3603
  * @returns
3433
3604
  */
3434
- addFileToEvent: addFileToEvent((0, import_node_path25.join)(path9)),
3605
+ addFileToEvent: addFileToEvent((0, import_node_path26.join)(path9)),
3435
3606
  /**
3436
3607
  * Adds a schema to the given event
3437
3608
  * @param id - The id of the event to add the schema to
@@ -3439,17 +3610,17 @@ var src_default = (path9) => {
3439
3610
  * @param version - Optional version of the event to add the schema to
3440
3611
  * @returns
3441
3612
  */
3442
- addSchemaToEvent: addSchemaToEvent((0, import_node_path25.join)(path9)),
3613
+ addSchemaToEvent: addSchemaToEvent((0, import_node_path26.join)(path9)),
3443
3614
  /**
3444
3615
  * Check to see if an event version exists
3445
3616
  * @param id - The id of the event
3446
3617
  * @param version - The version of the event (supports semver)
3447
3618
  * @returns
3448
3619
  */
3449
- eventHasVersion: eventHasVersion((0, import_node_path25.join)(path9)),
3450
- addExampleToEvent: addExampleToEvent((0, import_node_path25.join)(path9)),
3451
- getExamplesFromEvent: getExamplesFromEvent((0, import_node_path25.join)(path9)),
3452
- removeExampleFromEvent: removeExampleFromEvent((0, import_node_path25.join)(path9)),
3620
+ eventHasVersion: eventHasVersion((0, import_node_path26.join)(path9)),
3621
+ addExampleToEvent: addExampleToEvent((0, import_node_path26.join)(path9)),
3622
+ getExamplesFromEvent: getExamplesFromEvent((0, import_node_path26.join)(path9)),
3623
+ removeExampleFromEvent: removeExampleFromEvent((0, import_node_path26.join)(path9)),
3453
3624
  /**
3454
3625
  * ================================
3455
3626
  * Commands
@@ -3461,13 +3632,13 @@ var src_default = (path9) => {
3461
3632
  * @param version - Optional id of the version to get (supports semver)
3462
3633
  * @returns Command|Undefined
3463
3634
  */
3464
- getCommand: getCommand((0, import_node_path25.join)(path9)),
3635
+ getCommand: getCommand((0, import_node_path26.join)(path9)),
3465
3636
  /**
3466
3637
  * Returns all commands from EventCatalog
3467
3638
  * @param latestOnly - optional boolean, set to true to get only latest versions
3468
3639
  * @returns Command[]|Undefined
3469
3640
  */
3470
- getCommands: getCommands((0, import_node_path25.join)(path9)),
3641
+ getCommands: getCommands((0, import_node_path26.join)(path9)),
3471
3642
  /**
3472
3643
  * Adds an command to EventCatalog
3473
3644
  *
@@ -3475,7 +3646,7 @@ var src_default = (path9) => {
3475
3646
  * @param options - Optional options to write the command
3476
3647
  *
3477
3648
  */
3478
- writeCommand: writeCommand((0, import_node_path25.join)(path9, "commands")),
3649
+ writeCommand: writeCommand((0, import_node_path26.join)(path9, "commands")),
3479
3650
  /**
3480
3651
  * Adds a command to a service in EventCatalog
3481
3652
  *
@@ -3484,7 +3655,7 @@ var src_default = (path9) => {
3484
3655
  * @param options - Optional options to write the command
3485
3656
  *
3486
3657
  */
3487
- writeCommandToService: writeCommandToService((0, import_node_path25.join)(path9)),
3658
+ writeCommandToService: writeCommandToService((0, import_node_path26.join)(path9)),
3488
3659
  /**
3489
3660
  * Adds a command to an agent in EventCatalog
3490
3661
  *
@@ -3493,26 +3664,26 @@ var src_default = (path9) => {
3493
3664
  * @param options - Optional options to write the command
3494
3665
  *
3495
3666
  */
3496
- writeCommandToAgent: writeCommandToAgent((0, import_node_path25.join)(path9)),
3667
+ writeCommandToAgent: writeCommandToAgent((0, import_node_path26.join)(path9)),
3497
3668
  /**
3498
3669
  * Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
3499
3670
  *
3500
3671
  * @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
3501
3672
  *
3502
3673
  */
3503
- rmCommand: rmCommand((0, import_node_path25.join)(path9, "commands")),
3674
+ rmCommand: rmCommand((0, import_node_path26.join)(path9, "commands")),
3504
3675
  /**
3505
3676
  * Remove an command by an Event id
3506
3677
  *
3507
3678
  * @param id - The id of the command you want to remove
3508
3679
  *
3509
3680
  */
3510
- rmCommandById: rmCommandById((0, import_node_path25.join)(path9)),
3681
+ rmCommandById: rmCommandById((0, import_node_path26.join)(path9)),
3511
3682
  /**
3512
3683
  * Moves a given command id to the version directory
3513
3684
  * @param directory
3514
3685
  */
3515
- versionCommand: versionCommand((0, import_node_path25.join)(path9)),
3686
+ versionCommand: versionCommand((0, import_node_path26.join)(path9)),
3516
3687
  /**
3517
3688
  * Adds a file to the given command
3518
3689
  * @param id - The id of the command to add the file to
@@ -3520,7 +3691,7 @@ var src_default = (path9) => {
3520
3691
  * @param version - Optional version of the command to add the file to
3521
3692
  * @returns
3522
3693
  */
3523
- addFileToCommand: addFileToCommand((0, import_node_path25.join)(path9)),
3694
+ addFileToCommand: addFileToCommand((0, import_node_path26.join)(path9)),
3524
3695
  /**
3525
3696
  * Adds a schema to the given command
3526
3697
  * @param id - The id of the command to add the schema to
@@ -3528,17 +3699,17 @@ var src_default = (path9) => {
3528
3699
  * @param version - Optional version of the command to add the schema to
3529
3700
  * @returns
3530
3701
  */
3531
- addSchemaToCommand: addSchemaToCommand((0, import_node_path25.join)(path9)),
3702
+ addSchemaToCommand: addSchemaToCommand((0, import_node_path26.join)(path9)),
3532
3703
  /**
3533
3704
  * Check to see if a command version exists
3534
3705
  * @param id - The id of the command
3535
3706
  * @param version - The version of the command (supports semver)
3536
3707
  * @returns
3537
3708
  */
3538
- commandHasVersion: commandHasVersion((0, import_node_path25.join)(path9)),
3539
- addExampleToCommand: addExampleToCommand((0, import_node_path25.join)(path9)),
3540
- getExamplesFromCommand: getExamplesFromCommand((0, import_node_path25.join)(path9)),
3541
- removeExampleFromCommand: removeExampleFromCommand((0, import_node_path25.join)(path9)),
3709
+ commandHasVersion: commandHasVersion((0, import_node_path26.join)(path9)),
3710
+ addExampleToCommand: addExampleToCommand((0, import_node_path26.join)(path9)),
3711
+ getExamplesFromCommand: getExamplesFromCommand((0, import_node_path26.join)(path9)),
3712
+ removeExampleFromCommand: removeExampleFromCommand((0, import_node_path26.join)(path9)),
3542
3713
  /**
3543
3714
  * ================================
3544
3715
  * Queries
@@ -3550,13 +3721,13 @@ var src_default = (path9) => {
3550
3721
  * @param version - Optional id of the version to get (supports semver)
3551
3722
  * @returns Query|Undefined
3552
3723
  */
3553
- getQuery: getQuery((0, import_node_path25.join)(path9)),
3724
+ getQuery: getQuery((0, import_node_path26.join)(path9)),
3554
3725
  /**
3555
3726
  * Returns all queries from EventCatalog
3556
3727
  * @param latestOnly - optional boolean, set to true to get only latest versions
3557
3728
  * @returns Query[]|Undefined
3558
3729
  */
3559
- getQueries: getQueries((0, import_node_path25.join)(path9)),
3730
+ getQueries: getQueries((0, import_node_path26.join)(path9)),
3560
3731
  /**
3561
3732
  * Adds a query to EventCatalog
3562
3733
  *
@@ -3564,7 +3735,7 @@ var src_default = (path9) => {
3564
3735
  * @param options - Optional options to write the event
3565
3736
  *
3566
3737
  */
3567
- writeQuery: writeQuery((0, import_node_path25.join)(path9, "queries")),
3738
+ writeQuery: writeQuery((0, import_node_path26.join)(path9, "queries")),
3568
3739
  /**
3569
3740
  * Adds a query to a service in EventCatalog
3570
3741
  *
@@ -3573,7 +3744,7 @@ var src_default = (path9) => {
3573
3744
  * @param options - Optional options to write the query
3574
3745
  *
3575
3746
  */
3576
- writeQueryToService: writeQueryToService((0, import_node_path25.join)(path9)),
3747
+ writeQueryToService: writeQueryToService((0, import_node_path26.join)(path9)),
3577
3748
  /**
3578
3749
  * Adds a query to an agent in EventCatalog
3579
3750
  *
@@ -3582,26 +3753,26 @@ var src_default = (path9) => {
3582
3753
  * @param options - Optional options to write the query
3583
3754
  *
3584
3755
  */
3585
- writeQueryToAgent: writeQueryToAgent((0, import_node_path25.join)(path9)),
3756
+ writeQueryToAgent: writeQueryToAgent((0, import_node_path26.join)(path9)),
3586
3757
  /**
3587
3758
  * Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
3588
3759
  *
3589
3760
  * @param path - The path to your query, e.g. `/Orders/GetOrder`
3590
3761
  *
3591
3762
  */
3592
- rmQuery: rmQuery((0, import_node_path25.join)(path9, "queries")),
3763
+ rmQuery: rmQuery((0, import_node_path26.join)(path9, "queries")),
3593
3764
  /**
3594
3765
  * Remove a query by a Query id
3595
3766
  *
3596
3767
  * @param id - The id of the query you want to remove
3597
3768
  *
3598
3769
  */
3599
- rmQueryById: rmQueryById((0, import_node_path25.join)(path9)),
3770
+ rmQueryById: rmQueryById((0, import_node_path26.join)(path9)),
3600
3771
  /**
3601
3772
  * Moves a given query id to the version directory
3602
3773
  * @param directory
3603
3774
  */
3604
- versionQuery: versionQuery((0, import_node_path25.join)(path9)),
3775
+ versionQuery: versionQuery((0, import_node_path26.join)(path9)),
3605
3776
  /**
3606
3777
  * Adds a file to the given query
3607
3778
  * @param id - The id of the query to add the file to
@@ -3609,7 +3780,7 @@ var src_default = (path9) => {
3609
3780
  * @param version - Optional version of the query to add the file to
3610
3781
  * @returns
3611
3782
  */
3612
- addFileToQuery: addFileToQuery((0, import_node_path25.join)(path9)),
3783
+ addFileToQuery: addFileToQuery((0, import_node_path26.join)(path9)),
3613
3784
  /**
3614
3785
  * Adds a schema to the given query
3615
3786
  * @param id - The id of the query to add the schema to
@@ -3617,17 +3788,17 @@ var src_default = (path9) => {
3617
3788
  * @param version - Optional version of the query to add the schema to
3618
3789
  * @returns
3619
3790
  */
3620
- addSchemaToQuery: addSchemaToQuery((0, import_node_path25.join)(path9)),
3791
+ addSchemaToQuery: addSchemaToQuery((0, import_node_path26.join)(path9)),
3621
3792
  /**
3622
3793
  * Check to see if an query version exists
3623
3794
  * @param id - The id of the query
3624
3795
  * @param version - The version of the query (supports semver)
3625
3796
  * @returns
3626
3797
  */
3627
- queryHasVersion: queryHasVersion((0, import_node_path25.join)(path9)),
3628
- addExampleToQuery: addExampleToQuery((0, import_node_path25.join)(path9)),
3629
- getExamplesFromQuery: getExamplesFromQuery((0, import_node_path25.join)(path9)),
3630
- removeExampleFromQuery: removeExampleFromQuery((0, import_node_path25.join)(path9)),
3798
+ queryHasVersion: queryHasVersion((0, import_node_path26.join)(path9)),
3799
+ addExampleToQuery: addExampleToQuery((0, import_node_path26.join)(path9)),
3800
+ getExamplesFromQuery: getExamplesFromQuery((0, import_node_path26.join)(path9)),
3801
+ removeExampleFromQuery: removeExampleFromQuery((0, import_node_path26.join)(path9)),
3631
3802
  /**
3632
3803
  * ================================
3633
3804
  * Channels
@@ -3639,13 +3810,13 @@ var src_default = (path9) => {
3639
3810
  * @param version - Optional id of the version to get (supports semver)
3640
3811
  * @returns Channel|Undefined
3641
3812
  */
3642
- getChannel: getChannel((0, import_node_path25.join)(path9)),
3813
+ getChannel: getChannel((0, import_node_path26.join)(path9)),
3643
3814
  /**
3644
3815
  * Returns all channels from EventCatalog
3645
3816
  * @param latestOnly - optional boolean, set to true to get only latest versions
3646
3817
  * @returns Channel[]|Undefined
3647
3818
  */
3648
- getChannels: getChannels((0, import_node_path25.join)(path9)),
3819
+ getChannels: getChannels((0, import_node_path26.join)(path9)),
3649
3820
  /**
3650
3821
  * Adds an channel to EventCatalog
3651
3822
  *
@@ -3653,33 +3824,33 @@ var src_default = (path9) => {
3653
3824
  * @param options - Optional options to write the channel
3654
3825
  *
3655
3826
  */
3656
- writeChannel: writeChannel((0, import_node_path25.join)(path9, "channels")),
3827
+ writeChannel: writeChannel((0, import_node_path26.join)(path9, "channels")),
3657
3828
  /**
3658
3829
  * Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
3659
3830
  *
3660
3831
  * @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
3661
3832
  *
3662
3833
  */
3663
- rmChannel: rmChannel((0, import_node_path25.join)(path9, "channels")),
3834
+ rmChannel: rmChannel((0, import_node_path26.join)(path9, "channels")),
3664
3835
  /**
3665
3836
  * Remove an channel by an Event id
3666
3837
  *
3667
3838
  * @param id - The id of the channel you want to remove
3668
3839
  *
3669
3840
  */
3670
- rmChannelById: rmChannelById((0, import_node_path25.join)(path9)),
3841
+ rmChannelById: rmChannelById((0, import_node_path26.join)(path9)),
3671
3842
  /**
3672
3843
  * Moves a given channel id to the version directory
3673
3844
  * @param directory
3674
3845
  */
3675
- versionChannel: versionChannel((0, import_node_path25.join)(path9)),
3846
+ versionChannel: versionChannel((0, import_node_path26.join)(path9)),
3676
3847
  /**
3677
3848
  * Check to see if a channel version exists
3678
3849
  * @param id - The id of the channel
3679
3850
  * @param version - The version of the channel (supports semver)
3680
3851
  * @returns
3681
3852
  */
3682
- channelHasVersion: channelHasVersion((0, import_node_path25.join)(path9)),
3853
+ channelHasVersion: channelHasVersion((0, import_node_path26.join)(path9)),
3683
3854
  /**
3684
3855
  * Add a channel to an event
3685
3856
  *
@@ -3696,7 +3867,7 @@ var src_default = (path9) => {
3696
3867
  *
3697
3868
  * ```
3698
3869
  */
3699
- addEventToChannel: addMessageToChannel((0, import_node_path25.join)(path9), "events"),
3870
+ addEventToChannel: addMessageToChannel((0, import_node_path26.join)(path9), "events"),
3700
3871
  /**
3701
3872
  * Add a channel to an command
3702
3873
  *
@@ -3713,7 +3884,7 @@ var src_default = (path9) => {
3713
3884
  *
3714
3885
  * ```
3715
3886
  */
3716
- addCommandToChannel: addMessageToChannel((0, import_node_path25.join)(path9), "commands"),
3887
+ addCommandToChannel: addMessageToChannel((0, import_node_path26.join)(path9), "commands"),
3717
3888
  /**
3718
3889
  * Add a channel to an query
3719
3890
  *
@@ -3730,7 +3901,7 @@ var src_default = (path9) => {
3730
3901
  *
3731
3902
  * ```
3732
3903
  */
3733
- addQueryToChannel: addMessageToChannel((0, import_node_path25.join)(path9), "queries"),
3904
+ addQueryToChannel: addMessageToChannel((0, import_node_path26.join)(path9), "queries"),
3734
3905
  /**
3735
3906
  * ================================
3736
3907
  * SERVICES
@@ -3743,14 +3914,14 @@ var src_default = (path9) => {
3743
3914
  * @param options - Optional options to write the event
3744
3915
  *
3745
3916
  */
3746
- writeService: writeService((0, import_node_path25.join)(path9, "services")),
3917
+ writeService: writeService((0, import_node_path26.join)(path9, "services")),
3747
3918
  /**
3748
3919
  * Adds a versioned service to EventCatalog
3749
3920
  *
3750
3921
  * @param service - The service to write
3751
3922
  *
3752
3923
  */
3753
- writeVersionedService: writeVersionedService((0, import_node_path25.join)(path9, "services")),
3924
+ writeVersionedService: writeVersionedService((0, import_node_path26.join)(path9, "services")),
3754
3925
  /**
3755
3926
  * Adds a service to a domain in EventCatalog
3756
3927
  *
@@ -3759,45 +3930,54 @@ var src_default = (path9) => {
3759
3930
  * @param options - Optional options to write the event
3760
3931
  *
3761
3932
  */
3762
- writeServiceToDomain: writeServiceToDomain((0, import_node_path25.join)(path9, "domains")),
3933
+ writeServiceToDomain: writeServiceToDomain((0, import_node_path26.join)(path9, "domains")),
3934
+ /**
3935
+ * Adds a service to a system in EventCatalog
3936
+ *
3937
+ * @param service - The service to write
3938
+ * @param system - The system to add the service to
3939
+ * @param options - Optional options to write the service
3940
+ *
3941
+ */
3942
+ writeServiceToSystem: writeServiceToSystem((0, import_node_path26.join)(path9)),
3763
3943
  /**
3764
3944
  * Returns a service from EventCatalog
3765
3945
  * @param id - The id of the service to retrieve
3766
3946
  * @param version - Optional id of the version to get (supports semver)
3767
3947
  * @returns Service|Undefined
3768
3948
  */
3769
- getService: getService((0, import_node_path25.join)(path9)),
3949
+ getService: getService((0, import_node_path26.join)(path9)),
3770
3950
  /**
3771
3951
  * Returns a service from EventCatalog by it's path.
3772
3952
  * @param path - The path to the service to retrieve
3773
3953
  * @returns Service|Undefined
3774
3954
  */
3775
- getServiceByPath: getServiceByPath((0, import_node_path25.join)(path9)),
3955
+ getServiceByPath: getServiceByPath((0, import_node_path26.join)(path9)),
3776
3956
  /**
3777
3957
  * Returns all services from EventCatalog
3778
3958
  * @param latestOnly - optional boolean, set to true to get only latest versions
3779
3959
  * @returns Service[]|Undefined
3780
3960
  */
3781
- getServices: getServices((0, import_node_path25.join)(path9)),
3961
+ getServices: getServices((0, import_node_path26.join)(path9)),
3782
3962
  /**
3783
3963
  * Moves a given service id to the version directory
3784
3964
  * @param directory
3785
3965
  */
3786
- versionService: versionService((0, import_node_path25.join)(path9)),
3966
+ versionService: versionService((0, import_node_path26.join)(path9)),
3787
3967
  /**
3788
3968
  * Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
3789
3969
  *
3790
3970
  * @param path - The path to your service, e.g. `/InventoryService`
3791
3971
  *
3792
3972
  */
3793
- rmService: rmService((0, import_node_path25.join)(path9, "services")),
3973
+ rmService: rmService((0, import_node_path26.join)(path9, "services")),
3794
3974
  /**
3795
3975
  * Remove an service by an service id
3796
3976
  *
3797
3977
  * @param id - The id of the service you want to remove
3798
3978
  *
3799
3979
  */
3800
- rmServiceById: rmServiceById((0, import_node_path25.join)(path9)),
3980
+ rmServiceById: rmServiceById((0, import_node_path26.join)(path9)),
3801
3981
  /**
3802
3982
  * Adds a file to the given service
3803
3983
  * @param id - The id of the service to add the file to
@@ -3805,21 +3985,21 @@ var src_default = (path9) => {
3805
3985
  * @param version - Optional version of the service to add the file to
3806
3986
  * @returns
3807
3987
  */
3808
- addFileToService: addFileToService((0, import_node_path25.join)(path9)),
3988
+ addFileToService: addFileToService((0, import_node_path26.join)(path9)),
3809
3989
  /**
3810
3990
  * Returns the specifications for a given service
3811
3991
  * @param id - The id of the service to retrieve the specifications for
3812
3992
  * @param version - Optional version of the service
3813
3993
  * @returns
3814
3994
  */
3815
- getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path25.join)(path9)),
3995
+ getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path26.join)(path9)),
3816
3996
  /**
3817
3997
  * Check to see if a service version exists
3818
3998
  * @param id - The id of the service
3819
3999
  * @param version - The version of the service (supports semver)
3820
4000
  * @returns
3821
4001
  */
3822
- serviceHasVersion: serviceHasVersion((0, import_node_path25.join)(path9)),
4002
+ serviceHasVersion: serviceHasVersion((0, import_node_path26.join)(path9)),
3823
4003
  /**
3824
4004
  * Add an event to a service by it's id.
3825
4005
  *
@@ -3839,7 +4019,7 @@ var src_default = (path9) => {
3839
4019
  *
3840
4020
  * ```
3841
4021
  */
3842
- addEventToService: addMessageToService((0, import_node_path25.join)(path9)),
4022
+ addEventToService: addMessageToService((0, import_node_path26.join)(path9)),
3843
4023
  /**
3844
4024
  * Add a data store to a service by it's id.
3845
4025
  *
@@ -3856,7 +4036,7 @@ var src_default = (path9) => {
3856
4036
  *
3857
4037
  * ```
3858
4038
  */
3859
- addDataStoreToService: addDataStoreToService((0, import_node_path25.join)(path9)),
4039
+ addDataStoreToService: addDataStoreToService((0, import_node_path26.join)(path9)),
3860
4040
  /**
3861
4041
  * Add a command to a service by it's id.
3862
4042
  *
@@ -3876,7 +4056,7 @@ var src_default = (path9) => {
3876
4056
  *
3877
4057
  * ```
3878
4058
  */
3879
- addCommandToService: addMessageToService((0, import_node_path25.join)(path9)),
4059
+ addCommandToService: addMessageToService((0, import_node_path26.join)(path9)),
3880
4060
  /**
3881
4061
  * Add a query to a service by it's id.
3882
4062
  *
@@ -3896,7 +4076,7 @@ var src_default = (path9) => {
3896
4076
  *
3897
4077
  * ```
3898
4078
  */
3899
- addQueryToService: addMessageToService((0, import_node_path25.join)(path9)),
4079
+ addQueryToService: addMessageToService((0, import_node_path26.join)(path9)),
3900
4080
  /**
3901
4081
  * Add an entity to a service by its id.
3902
4082
  *
@@ -3914,7 +4094,7 @@ var src_default = (path9) => {
3914
4094
  *
3915
4095
  * ```
3916
4096
  */
3917
- addEntityToService: addEntityToService((0, import_node_path25.join)(path9)),
4097
+ addEntityToService: addEntityToService((0, import_node_path26.join)(path9)),
3918
4098
  /**
3919
4099
  * Check to see if a service exists by it's path.
3920
4100
  *
@@ -3931,36 +4111,57 @@ var src_default = (path9) => {
3931
4111
  * @param path - The path to the service to check
3932
4112
  * @returns boolean
3933
4113
  */
3934
- isService: isService((0, import_node_path25.join)(path9)),
4114
+ isService: isService((0, import_node_path26.join)(path9)),
3935
4115
  /**
3936
4116
  * Converts a file to a service.
3937
4117
  * @param file - The file to convert to a service.
3938
4118
  * @returns The service.
3939
4119
  */
3940
- toService: toService((0, import_node_path25.join)(path9)),
4120
+ toService: toService((0, import_node_path26.join)(path9)),
4121
+ /**
4122
+ * ================================
4123
+ * Systems
4124
+ * ================================
4125
+ */
4126
+ writeSystem: writeSystem((0, import_node_path26.join)(path9, "systems")),
4127
+ writeSystemToDomain: writeSystemToDomain((0, import_node_path26.join)(path9)),
4128
+ getSystem: getSystem((0, import_node_path26.join)(path9)),
4129
+ getSystemByPath: getSystemByPath((0, import_node_path26.join)(path9)),
4130
+ getSystems: getSystems((0, import_node_path26.join)(path9)),
4131
+ versionSystem: versionSystem((0, import_node_path26.join)(path9)),
4132
+ rmSystem: rmSystem((0, import_node_path26.join)(path9, "systems")),
4133
+ rmSystemById: rmSystemById((0, import_node_path26.join)(path9)),
4134
+ addFileToSystem: addFileToSystem((0, import_node_path26.join)(path9)),
4135
+ addServiceToSystem: addServiceToSystem((0, import_node_path26.join)(path9)),
4136
+ addFlowToSystem: addFlowToSystem((0, import_node_path26.join)(path9)),
4137
+ addEntityToSystem: addEntityToSystem((0, import_node_path26.join)(path9)),
4138
+ addContainerToSystem: addContainerToSystem((0, import_node_path26.join)(path9)),
4139
+ systemHasVersion: systemHasVersion((0, import_node_path26.join)(path9)),
4140
+ isSystem: isSystem((0, import_node_path26.join)(path9)),
4141
+ toSystem: toSystem((0, import_node_path26.join)(path9)),
3941
4142
  /**
3942
4143
  * ================================
3943
4144
  * Agents
3944
4145
  * ================================
3945
4146
  */
3946
- writeAgent: writeAgent((0, import_node_path25.join)(path9, "agents")),
3947
- writeVersionedAgent: writeVersionedAgent((0, import_node_path25.join)(path9, "agents")),
3948
- writeAgentToDomain: writeAgentToDomain((0, import_node_path25.join)(path9, "domains")),
3949
- getAgent: getAgent((0, import_node_path25.join)(path9)),
3950
- getAgentByPath: getAgentByPath((0, import_node_path25.join)(path9)),
3951
- getAgents: getAgents((0, import_node_path25.join)(path9)),
3952
- versionAgent: versionAgent((0, import_node_path25.join)(path9)),
3953
- rmAgent: rmAgent((0, import_node_path25.join)(path9, "agents")),
3954
- rmAgentById: rmAgentById((0, import_node_path25.join)(path9)),
3955
- addFileToAgent: addFileToAgent((0, import_node_path25.join)(path9)),
3956
- addEventToAgent: addMessageToAgent((0, import_node_path25.join)(path9)),
3957
- addCommandToAgent: addMessageToAgent((0, import_node_path25.join)(path9)),
3958
- addQueryToAgent: addMessageToAgent((0, import_node_path25.join)(path9)),
3959
- addDataStoreToAgent: addDataStoreToAgent((0, import_node_path25.join)(path9)),
3960
- addFlowToAgent: addFlowToAgent((0, import_node_path25.join)(path9)),
3961
- agentHasVersion: agentHasVersion((0, import_node_path25.join)(path9)),
3962
- isAgent: isAgent((0, import_node_path25.join)(path9)),
3963
- toAgent: toAgent((0, import_node_path25.join)(path9)),
4147
+ writeAgent: writeAgent((0, import_node_path26.join)(path9, "agents")),
4148
+ writeVersionedAgent: writeVersionedAgent((0, import_node_path26.join)(path9, "agents")),
4149
+ writeAgentToDomain: writeAgentToDomain((0, import_node_path26.join)(path9, "domains")),
4150
+ getAgent: getAgent((0, import_node_path26.join)(path9)),
4151
+ getAgentByPath: getAgentByPath((0, import_node_path26.join)(path9)),
4152
+ getAgents: getAgents((0, import_node_path26.join)(path9)),
4153
+ versionAgent: versionAgent((0, import_node_path26.join)(path9)),
4154
+ rmAgent: rmAgent((0, import_node_path26.join)(path9, "agents")),
4155
+ rmAgentById: rmAgentById((0, import_node_path26.join)(path9)),
4156
+ addFileToAgent: addFileToAgent((0, import_node_path26.join)(path9)),
4157
+ addEventToAgent: addMessageToAgent((0, import_node_path26.join)(path9)),
4158
+ addCommandToAgent: addMessageToAgent((0, import_node_path26.join)(path9)),
4159
+ addQueryToAgent: addMessageToAgent((0, import_node_path26.join)(path9)),
4160
+ addDataStoreToAgent: addDataStoreToAgent((0, import_node_path26.join)(path9)),
4161
+ addFlowToAgent: addFlowToAgent((0, import_node_path26.join)(path9)),
4162
+ agentHasVersion: agentHasVersion((0, import_node_path26.join)(path9)),
4163
+ isAgent: isAgent((0, import_node_path26.join)(path9)),
4164
+ toAgent: toAgent((0, import_node_path26.join)(path9)),
3964
4165
  /**
3965
4166
  * ================================
3966
4167
  * Domains
@@ -3973,39 +4174,39 @@ var src_default = (path9) => {
3973
4174
  * @param options - Optional options to write the event
3974
4175
  *
3975
4176
  */
3976
- writeDomain: writeDomain((0, import_node_path25.join)(path9, "domains")),
4177
+ writeDomain: writeDomain((0, import_node_path26.join)(path9, "domains")),
3977
4178
  /**
3978
4179
  * Returns a domain from EventCatalog
3979
4180
  * @param id - The id of the domain to retrieve
3980
4181
  * @param version - Optional id of the version to get (supports semver)
3981
4182
  * @returns Domain|Undefined
3982
4183
  */
3983
- getDomain: getDomain((0, import_node_path25.join)(path9, "domains")),
4184
+ getDomain: getDomain((0, import_node_path26.join)(path9, "domains")),
3984
4185
  /**
3985
4186
  * Returns all domains from EventCatalog
3986
4187
  * @param latestOnly - optional boolean, set to true to get only latest versions
3987
4188
  * @returns Domain[]|Undefined
3988
4189
  */
3989
- getDomains: getDomains((0, import_node_path25.join)(path9)),
4190
+ getDomains: getDomains((0, import_node_path26.join)(path9)),
3990
4191
  /**
3991
4192
  * Moves a given domain id to the version directory
3992
4193
  * @param directory
3993
4194
  */
3994
- versionDomain: versionDomain((0, import_node_path25.join)(path9, "domains")),
4195
+ versionDomain: versionDomain((0, import_node_path26.join)(path9, "domains")),
3995
4196
  /**
3996
4197
  * Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
3997
4198
  *
3998
4199
  * @param path - The path to your domain, e.g. `/Payment`
3999
4200
  *
4000
4201
  */
4001
- rmDomain: rmDomain((0, import_node_path25.join)(path9, "domains")),
4202
+ rmDomain: rmDomain((0, import_node_path26.join)(path9, "domains")),
4002
4203
  /**
4003
4204
  * Remove an service by an domain id
4004
4205
  *
4005
4206
  * @param id - The id of the domain you want to remove
4006
4207
  *
4007
4208
  */
4008
- rmDomainById: rmDomainById((0, import_node_path25.join)(path9, "domains")),
4209
+ rmDomainById: rmDomainById((0, import_node_path26.join)(path9, "domains")),
4009
4210
  /**
4010
4211
  * Adds a file to the given domain
4011
4212
  * @param id - The id of the domain to add the file to
@@ -4013,28 +4214,28 @@ var src_default = (path9) => {
4013
4214
  * @param version - Optional version of the domain to add the file to
4014
4215
  * @returns
4015
4216
  */
4016
- addFileToDomain: addFileToDomain((0, import_node_path25.join)(path9, "domains")),
4217
+ addFileToDomain: addFileToDomain((0, import_node_path26.join)(path9, "domains")),
4017
4218
  /**
4018
4219
  * Adds an ubiquitous language dictionary to a domain
4019
4220
  * @param id - The id of the domain to add the ubiquitous language to
4020
4221
  * @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
4021
4222
  * @param version - Optional version of the domain to add the ubiquitous language to
4022
4223
  */
4023
- addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path25.join)(path9, "domains")),
4224
+ addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path26.join)(path9, "domains")),
4024
4225
  /**
4025
4226
  * Get the ubiquitous language dictionary from a domain
4026
4227
  * @param id - The id of the domain to get the ubiquitous language from
4027
4228
  * @param version - Optional version of the domain to get the ubiquitous language from
4028
4229
  * @returns
4029
4230
  */
4030
- getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path25.join)(path9, "domains")),
4231
+ getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path26.join)(path9, "domains")),
4031
4232
  /**
4032
4233
  * Check to see if a domain version exists
4033
4234
  * @param id - The id of the domain
4034
4235
  * @param version - The version of the domain (supports semver)
4035
4236
  * @returns
4036
4237
  */
4037
- domainHasVersion: domainHasVersion((0, import_node_path25.join)(path9)),
4238
+ domainHasVersion: domainHasVersion((0, import_node_path26.join)(path9)),
4038
4239
  /**
4039
4240
  * Adds a given service to a domain
4040
4241
  * @param id - The id of the domain
@@ -4042,7 +4243,7 @@ var src_default = (path9) => {
4042
4243
  * @param version - (Optional) The version of the domain to add the service to
4043
4244
  * @returns
4044
4245
  */
4045
- addServiceToDomain: addServiceToDomain((0, import_node_path25.join)(path9, "domains")),
4246
+ addServiceToDomain: addServiceToDomain((0, import_node_path26.join)(path9, "domains")),
4046
4247
  /**
4047
4248
  * Adds a given agent to a domain
4048
4249
  * @param id - The id of the domain
@@ -4050,7 +4251,7 @@ var src_default = (path9) => {
4050
4251
  * @param version - (Optional) The version of the domain to add the agent to
4051
4252
  * @returns
4052
4253
  */
4053
- addAgentToDomain: addAgentToDomain((0, import_node_path25.join)(path9, "domains")),
4254
+ addAgentToDomain: addAgentToDomain((0, import_node_path26.join)(path9, "domains")),
4054
4255
  /**
4055
4256
  * Adds a given subdomain to a domain
4056
4257
  * @param id - The id of the domain
@@ -4058,7 +4259,15 @@ var src_default = (path9) => {
4058
4259
  * @param version - (Optional) The version of the domain to add the subdomain to
4059
4260
  * @returns
4060
4261
  */
4061
- addSubDomainToDomain: addSubDomainToDomain((0, import_node_path25.join)(path9, "domains")),
4262
+ addSubDomainToDomain: addSubDomainToDomain((0, import_node_path26.join)(path9, "domains")),
4263
+ /**
4264
+ * Adds a given system to a domain
4265
+ * @param id - The id of the domain
4266
+ * @param system - The id and version of the system to add
4267
+ * @param version - (Optional) The version of the domain to add the system to
4268
+ * @returns
4269
+ */
4270
+ addSystemToDomain: addSystemToDomain((0, import_node_path26.join)(path9, "domains")),
4062
4271
  /**
4063
4272
  * Adds an entity to a domain
4064
4273
  * @param id - The id of the domain
@@ -4066,7 +4275,7 @@ var src_default = (path9) => {
4066
4275
  * @param version - (Optional) The version of the domain to add the entity to
4067
4276
  * @returns
4068
4277
  */
4069
- addEntityToDomain: addEntityToDomain((0, import_node_path25.join)(path9, "domains")),
4278
+ addEntityToDomain: addEntityToDomain((0, import_node_path26.join)(path9, "domains")),
4070
4279
  /**
4071
4280
  * Add an event to a domain by its id.
4072
4281
  *
@@ -4084,7 +4293,7 @@ var src_default = (path9) => {
4084
4293
  *
4085
4294
  * ```
4086
4295
  */
4087
- addEventToDomain: addMessageToDomain((0, import_node_path25.join)(path9, "domains")),
4296
+ addEventToDomain: addMessageToDomain((0, import_node_path26.join)(path9, "domains")),
4088
4297
  /**
4089
4298
  * Add a command to a domain by its id.
4090
4299
  *
@@ -4102,7 +4311,7 @@ var src_default = (path9) => {
4102
4311
  *
4103
4312
  * ```
4104
4313
  */
4105
- addCommandToDomain: addMessageToDomain((0, import_node_path25.join)(path9, "domains")),
4314
+ addCommandToDomain: addMessageToDomain((0, import_node_path26.join)(path9, "domains")),
4106
4315
  /**
4107
4316
  * Add a query to a domain by its id.
4108
4317
  *
@@ -4120,7 +4329,7 @@ var src_default = (path9) => {
4120
4329
  *
4121
4330
  * ```
4122
4331
  */
4123
- addQueryToDomain: addMessageToDomain((0, import_node_path25.join)(path9, "domains")),
4332
+ addQueryToDomain: addMessageToDomain((0, import_node_path26.join)(path9, "domains")),
4124
4333
  /**
4125
4334
  * ================================
4126
4335
  * Teams
@@ -4133,25 +4342,25 @@ var src_default = (path9) => {
4133
4342
  * @param options - Optional options to write the team
4134
4343
  *
4135
4344
  */
4136
- writeTeam: writeTeam((0, import_node_path25.join)(path9, "teams")),
4345
+ writeTeam: writeTeam((0, import_node_path26.join)(path9, "teams")),
4137
4346
  /**
4138
4347
  * Returns a team from EventCatalog
4139
4348
  * @param id - The id of the team to retrieve
4140
4349
  * @returns Team|Undefined
4141
4350
  */
4142
- getTeam: getTeam((0, import_node_path25.join)(path9, "teams")),
4351
+ getTeam: getTeam((0, import_node_path26.join)(path9, "teams")),
4143
4352
  /**
4144
4353
  * Returns all teams from EventCatalog
4145
4354
  * @returns Team[]|Undefined
4146
4355
  */
4147
- getTeams: getTeams((0, import_node_path25.join)(path9, "teams")),
4356
+ getTeams: getTeams((0, import_node_path26.join)(path9, "teams")),
4148
4357
  /**
4149
4358
  * Remove a team by the team id
4150
4359
  *
4151
4360
  * @param id - The id of the team you want to remove
4152
4361
  *
4153
4362
  */
4154
- rmTeamById: rmTeamById((0, import_node_path25.join)(path9, "teams")),
4363
+ rmTeamById: rmTeamById((0, import_node_path26.join)(path9, "teams")),
4155
4364
  /**
4156
4365
  * ================================
4157
4366
  * Users
@@ -4164,25 +4373,25 @@ var src_default = (path9) => {
4164
4373
  * @param options - Optional options to write the user
4165
4374
  *
4166
4375
  */
4167
- writeUser: writeUser((0, import_node_path25.join)(path9, "users")),
4376
+ writeUser: writeUser((0, import_node_path26.join)(path9, "users")),
4168
4377
  /**
4169
4378
  * Returns a user from EventCatalog
4170
4379
  * @param id - The id of the user to retrieve
4171
4380
  * @returns User|Undefined
4172
4381
  */
4173
- getUser: getUser((0, import_node_path25.join)(path9, "users")),
4382
+ getUser: getUser((0, import_node_path26.join)(path9, "users")),
4174
4383
  /**
4175
4384
  * Returns all user from EventCatalog
4176
4385
  * @returns User[]|Undefined
4177
4386
  */
4178
- getUsers: getUsers((0, import_node_path25.join)(path9)),
4387
+ getUsers: getUsers((0, import_node_path26.join)(path9)),
4179
4388
  /**
4180
4389
  * Remove a user by the user id
4181
4390
  *
4182
4391
  * @param id - The id of the user you want to remove
4183
4392
  *
4184
4393
  */
4185
- rmUserById: rmUserById((0, import_node_path25.join)(path9, "users")),
4394
+ rmUserById: rmUserById((0, import_node_path26.join)(path9, "users")),
4186
4395
  /**
4187
4396
  * ================================
4188
4397
  * Custom Docs
@@ -4193,32 +4402,32 @@ var src_default = (path9) => {
4193
4402
  * @param path - The path to the custom doc to retrieve
4194
4403
  * @returns CustomDoc|Undefined
4195
4404
  */
4196
- getCustomDoc: getCustomDoc((0, import_node_path25.join)(path9, "docs")),
4405
+ getCustomDoc: getCustomDoc((0, import_node_path26.join)(path9, "docs")),
4197
4406
  /**
4198
4407
  * Returns all custom docs from EventCatalog
4199
4408
  * @param options - Optional options to get custom docs from a specific path
4200
4409
  * @returns CustomDoc[]|Undefined
4201
4410
  */
4202
- getCustomDocs: getCustomDocs((0, import_node_path25.join)(path9, "docs")),
4411
+ getCustomDocs: getCustomDocs((0, import_node_path26.join)(path9, "docs")),
4203
4412
  /**
4204
4413
  * Writes a custom doc to EventCatalog
4205
4414
  * @param customDoc - The custom doc to write
4206
4415
  * @param options - Optional options to write the custom doc
4207
4416
  *
4208
4417
  */
4209
- writeCustomDoc: writeCustomDoc((0, import_node_path25.join)(path9, "docs")),
4418
+ writeCustomDoc: writeCustomDoc((0, import_node_path26.join)(path9, "docs")),
4210
4419
  /**
4211
4420
  * Removes a custom doc from EventCatalog
4212
4421
  * @param path - The path to the custom doc to remove
4213
4422
  *
4214
4423
  */
4215
- rmCustomDoc: rmCustomDoc((0, import_node_path25.join)(path9, "docs")),
4424
+ rmCustomDoc: rmCustomDoc((0, import_node_path26.join)(path9, "docs")),
4216
4425
  /**
4217
4426
  * Dumps the catalog to a JSON file.
4218
4427
  * @param directory - The directory to dump the catalog to
4219
4428
  * @returns A JSON file with the catalog
4220
4429
  */
4221
- dumpCatalog: dumpCatalog((0, import_node_path25.join)(path9)),
4430
+ dumpCatalog: dumpCatalog((0, import_node_path26.join)(path9)),
4222
4431
  /**
4223
4432
  * Returns the event catalog configuration file.
4224
4433
  * The event catalog configuration file is the file that contains the configuration for the event catalog.
@@ -4226,7 +4435,7 @@ var src_default = (path9) => {
4226
4435
  * @param directory - The directory of the catalog.
4227
4436
  * @returns A JSON object with the configuration for the event catalog.
4228
4437
  */
4229
- getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path25.join)(path9)),
4438
+ getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path26.join)(path9)),
4230
4439
  /**
4231
4440
  * ================================
4232
4441
  * Changelogs
@@ -4240,7 +4449,7 @@ var src_default = (path9) => {
4240
4449
  * @param options - Optional options (version, format)
4241
4450
  *
4242
4451
  */
4243
- writeChangelog: writeChangelog((0, import_node_path25.join)(path9)),
4452
+ writeChangelog: writeChangelog((0, import_node_path26.join)(path9)),
4244
4453
  /**
4245
4454
  * Appends a changelog entry to an existing changelog for a resource.
4246
4455
  * If no changelog exists, one is created.
@@ -4250,7 +4459,7 @@ var src_default = (path9) => {
4250
4459
  * @param options - Optional options (version, format)
4251
4460
  *
4252
4461
  */
4253
- appendChangelog: appendChangelog((0, import_node_path25.join)(path9)),
4462
+ appendChangelog: appendChangelog((0, import_node_path26.join)(path9)),
4254
4463
  /**
4255
4464
  * Returns the changelog for a resource in EventCatalog
4256
4465
  *
@@ -4258,7 +4467,7 @@ var src_default = (path9) => {
4258
4467
  * @param options - Optional options (version)
4259
4468
  * @returns Changelog|Undefined
4260
4469
  */
4261
- getChangelog: getChangelog((0, import_node_path25.join)(path9)),
4470
+ getChangelog: getChangelog((0, import_node_path26.join)(path9)),
4262
4471
  /**
4263
4472
  * Removes the changelog for a resource in EventCatalog
4264
4473
  *
@@ -4266,7 +4475,7 @@ var src_default = (path9) => {
4266
4475
  * @param options - Optional options (version)
4267
4476
  *
4268
4477
  */
4269
- rmChangelog: rmChangelog((0, import_node_path25.join)(path9)),
4478
+ rmChangelog: rmChangelog((0, import_node_path26.join)(path9)),
4270
4479
  /**
4271
4480
  * ================================
4272
4481
  * Resources Utils
@@ -4295,26 +4504,26 @@ var src_default = (path9) => {
4295
4504
  * @param path - The path to the message to retrieve
4296
4505
  * @returns Message|Undefined
4297
4506
  */
4298
- getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path25.join)(path9)),
4507
+ getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path26.join)(path9)),
4299
4508
  /**
4300
4509
  * Returns the producers and consumers (services and agents) for a given message
4301
4510
  * @param id - The id of the message to get the producers and consumers for
4302
4511
  * @param version - Optional version of the message
4303
4512
  * @returns { producers: (Service|Agent)[], consumers: (Service|Agent)[] }
4304
4513
  */
4305
- getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path25.join)(path9)),
4514
+ getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path26.join)(path9)),
4306
4515
  /**
4307
4516
  * Returns the consumers of a given schema path
4308
4517
  * @param path - The path to the schema to get the consumers for
4309
4518
  * @returns (Service|Agent)[]
4310
4519
  */
4311
- getConsumersOfSchema: getConsumersOfSchema((0, import_node_path25.join)(path9)),
4520
+ getConsumersOfSchema: getConsumersOfSchema((0, import_node_path26.join)(path9)),
4312
4521
  /**
4313
4522
  * Returns the producers of a given schema path
4314
4523
  * @param path - The path to the schema to get the producers for
4315
4524
  * @returns (Service|Agent)[]
4316
4525
  */
4317
- getProducersOfSchema: getProducersOfSchema((0, import_node_path25.join)(path9)),
4526
+ getProducersOfSchema: getProducersOfSchema((0, import_node_path26.join)(path9)),
4318
4527
  /**
4319
4528
  * Returns the schema for a given message (event, command or query) by its id and version.
4320
4529
  * If no version is given, the latest version is used.
@@ -4322,14 +4531,14 @@ var src_default = (path9) => {
4322
4531
  * @param version - Optional version of the message
4323
4532
  * @returns { schema: string, fileName: string } | undefined
4324
4533
  */
4325
- getSchemaForMessage: getSchemaForMessage((0, import_node_path25.join)(path9)),
4534
+ getSchemaForMessage: getSchemaForMessage((0, import_node_path26.join)(path9)),
4326
4535
  /**
4327
4536
  * Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
4328
4537
  * @param id - The id of the resource to get the owners for
4329
4538
  * @param version - Optional version of the resource
4330
4539
  * @returns { owners: User[] }
4331
4540
  */
4332
- getOwnersForResource: getOwnersForResource((0, import_node_path25.join)(path9)),
4541
+ getOwnersForResource: getOwnersForResource((0, import_node_path26.join)(path9)),
4333
4542
  /**
4334
4543
  * ================================
4335
4544
  * Entities
@@ -4341,13 +4550,13 @@ var src_default = (path9) => {
4341
4550
  * @param version - Optional id of the version to get (supports semver)
4342
4551
  * @returns Entity|Undefined
4343
4552
  */
4344
- getEntity: getEntity((0, import_node_path25.join)(path9)),
4553
+ getEntity: getEntity((0, import_node_path26.join)(path9)),
4345
4554
  /**
4346
4555
  * Returns all entities from EventCatalog
4347
4556
  * @param latestOnly - optional boolean, set to true to get only latest versions
4348
4557
  * @returns Entity[]|Undefined
4349
4558
  */
4350
- getEntities: getEntities((0, import_node_path25.join)(path9)),
4559
+ getEntities: getEntities((0, import_node_path26.join)(path9)),
4351
4560
  /**
4352
4561
  * Adds an entity to EventCatalog
4353
4562
  *
@@ -4355,33 +4564,42 @@ var src_default = (path9) => {
4355
4564
  * @param options - Optional options to write the entity
4356
4565
  *
4357
4566
  */
4358
- writeEntity: writeEntity((0, import_node_path25.join)(path9, "entities")),
4567
+ writeEntity: writeEntity((0, import_node_path26.join)(path9, "entities")),
4568
+ /**
4569
+ * Adds an entity to a system in EventCatalog
4570
+ *
4571
+ * @param entity - The entity to write to the system
4572
+ * @param system - The system and its id to write the entity to
4573
+ * @param options - Optional options to write the entity
4574
+ *
4575
+ */
4576
+ writeEntityToSystem: writeEntityToSystem((0, import_node_path26.join)(path9)),
4359
4577
  /**
4360
4578
  * Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
4361
4579
  *
4362
4580
  * @param path - The path to your entity, e.g. `/User`
4363
4581
  *
4364
4582
  */
4365
- rmEntity: rmEntity((0, import_node_path25.join)(path9, "entities")),
4583
+ rmEntity: rmEntity((0, import_node_path26.join)(path9, "entities")),
4366
4584
  /**
4367
4585
  * Remove an entity by an entity id
4368
4586
  *
4369
4587
  * @param id - The id of the entity you want to remove
4370
4588
  *
4371
4589
  */
4372
- rmEntityById: rmEntityById((0, import_node_path25.join)(path9)),
4590
+ rmEntityById: rmEntityById((0, import_node_path26.join)(path9)),
4373
4591
  /**
4374
4592
  * Moves a given entity id to the version directory
4375
4593
  * @param id - The id of the entity to version
4376
4594
  */
4377
- versionEntity: versionEntity((0, import_node_path25.join)(path9)),
4595
+ versionEntity: versionEntity((0, import_node_path26.join)(path9)),
4378
4596
  /**
4379
4597
  * Check to see if an entity version exists
4380
4598
  * @param id - The id of the entity
4381
4599
  * @param version - The version of the entity (supports semver)
4382
4600
  * @returns
4383
4601
  */
4384
- entityHasVersion: entityHasVersion((0, import_node_path25.join)(path9)),
4602
+ entityHasVersion: entityHasVersion((0, import_node_path26.join)(path9)),
4385
4603
  /**
4386
4604
  * ================================
4387
4605
  * Flows
@@ -4394,7 +4612,7 @@ var src_default = (path9) => {
4394
4612
  * @param version - Optional version of the flow
4395
4613
  * @returns Flow
4396
4614
  */
4397
- getFlow: getFlow((0, import_node_path25.join)(path9)),
4615
+ getFlow: getFlow((0, import_node_path26.join)(path9)),
4398
4616
  /**
4399
4617
  * Returns all flows from EventCatalog
4400
4618
  *
@@ -4402,7 +4620,7 @@ var src_default = (path9) => {
4402
4620
  * @param latestOnly - optional boolean, set to true to get only latest versions
4403
4621
  * @returns Flow[]|Undefined
4404
4622
  */
4405
- getFlows: getFlows((0, import_node_path25.join)(path9)),
4623
+ getFlows: getFlows((0, import_node_path26.join)(path9)),
4406
4624
  /**
4407
4625
  * Adds a flow to EventCatalog
4408
4626
  *
@@ -4410,14 +4628,14 @@ var src_default = (path9) => {
4410
4628
  * @param options - Optional options to write the flow
4411
4629
  *
4412
4630
  */
4413
- writeFlow: writeFlow((0, import_node_path25.join)(path9, "flows")),
4631
+ writeFlow: writeFlow((0, import_node_path26.join)(path9, "flows")),
4414
4632
  /**
4415
4633
  * Adds a versioned flow to EventCatalog
4416
4634
  *
4417
4635
  * @param flow - The flow to write
4418
4636
  *
4419
4637
  */
4420
- writeVersionedFlow: writeVersionedFlow((0, import_node_path25.join)(path9, "flows")),
4638
+ writeVersionedFlow: writeVersionedFlow((0, import_node_path26.join)(path9, "flows")),
4421
4639
  /**
4422
4640
  * Adds a flow to a domain in EventCatalog
4423
4641
  *
@@ -4426,7 +4644,7 @@ var src_default = (path9) => {
4426
4644
  * @param options - Optional options to write the flow
4427
4645
  *
4428
4646
  */
4429
- writeFlowToDomain: writeFlowToDomain((0, import_node_path25.join)(path9, "domains")),
4647
+ writeFlowToDomain: writeFlowToDomain((0, import_node_path26.join)(path9, "domains")),
4430
4648
  /**
4431
4649
  * Adds a flow to a service in EventCatalog
4432
4650
  *
@@ -4435,7 +4653,16 @@ var src_default = (path9) => {
4435
4653
  * @param options - Optional options to write the flow
4436
4654
  *
4437
4655
  */
4438
- writeFlowToService: writeFlowToService((0, import_node_path25.join)(path9, "services")),
4656
+ writeFlowToService: writeFlowToService((0, import_node_path26.join)(path9, "services")),
4657
+ /**
4658
+ * Adds a flow to a system in EventCatalog
4659
+ *
4660
+ * @param flow - The flow to write to the system
4661
+ * @param system - The system and its id to write the flow to
4662
+ * @param options - Optional options to write the flow
4663
+ *
4664
+ */
4665
+ writeFlowToSystem: writeFlowToSystem((0, import_node_path26.join)(path9)),
4439
4666
  /**
4440
4667
  * Adds a flow to an agent in EventCatalog
4441
4668
  *
@@ -4444,33 +4671,33 @@ var src_default = (path9) => {
4444
4671
  * @param options - Optional options to write the flow
4445
4672
  *
4446
4673
  */
4447
- writeFlowToAgent: writeFlowToAgent((0, import_node_path25.join)(path9, "agents")),
4674
+ writeFlowToAgent: writeFlowToAgent((0, import_node_path26.join)(path9, "agents")),
4448
4675
  /**
4449
4676
  * Remove a flow from EventCatalog (modeled on the standard POSIX rm utility)
4450
4677
  *
4451
4678
  * @param path - The path to your flow, e.g. `/PaymentFlow`
4452
4679
  *
4453
4680
  */
4454
- rmFlow: rmFlow((0, import_node_path25.join)(path9, "flows")),
4681
+ rmFlow: rmFlow((0, import_node_path26.join)(path9, "flows")),
4455
4682
  /**
4456
4683
  * Remove a flow by a flow id
4457
4684
  *
4458
4685
  * @param id - The id of the flow you want to remove
4459
4686
  *
4460
4687
  */
4461
- rmFlowById: rmFlowById((0, import_node_path25.join)(path9)),
4688
+ rmFlowById: rmFlowById((0, import_node_path26.join)(path9)),
4462
4689
  /**
4463
4690
  * Moves a given flow id to the version directory
4464
4691
  * @param id - The id of the flow to version
4465
4692
  */
4466
- versionFlow: versionFlow((0, import_node_path25.join)(path9)),
4693
+ versionFlow: versionFlow((0, import_node_path26.join)(path9)),
4467
4694
  /**
4468
4695
  * Check to see if a flow version exists
4469
4696
  * @param id - The id of the flow
4470
4697
  * @param version - The version of the flow (supports semver)
4471
4698
  * @returns
4472
4699
  */
4473
- flowHasVersion: flowHasVersion((0, import_node_path25.join)(path9)),
4700
+ flowHasVersion: flowHasVersion((0, import_node_path26.join)(path9)),
4474
4701
  /**
4475
4702
  * Adds a file to the given flow
4476
4703
  * @param id - The id of the flow to add the file to
@@ -4478,7 +4705,7 @@ var src_default = (path9) => {
4478
4705
  * @param version - Optional version of the flow to add the file to
4479
4706
  * @returns
4480
4707
  */
4481
- addFileToFlow: addFileToFlow((0, import_node_path25.join)(path9)),
4708
+ addFileToFlow: addFileToFlow((0, import_node_path26.join)(path9)),
4482
4709
  /**
4483
4710
  * ================================
4484
4711
  * Data Stores
@@ -4490,42 +4717,42 @@ var src_default = (path9) => {
4490
4717
  * @param options - Optional options to write the data store
4491
4718
  *
4492
4719
  */
4493
- writeDataStore: writeDataStore((0, import_node_path25.join)(path9, "containers")),
4720
+ writeDataStore: writeDataStore((0, import_node_path26.join)(path9, "containers")),
4494
4721
  /**
4495
4722
  * Returns a data store from EventCatalog
4496
4723
  * @param id - The id of the data store to retrieve
4497
4724
  * @param version - Optional id of the version to get (supports semver)
4498
4725
  * @returns Container|Undefined
4499
4726
  */
4500
- getDataStore: getDataStore((0, import_node_path25.join)(path9)),
4727
+ getDataStore: getDataStore((0, import_node_path26.join)(path9)),
4501
4728
  /**
4502
4729
  * Returns all data stores from EventCatalog
4503
4730
  * @param latestOnly - optional boolean, set to true to get only latest versions
4504
4731
  * @returns Container[]|Undefined
4505
4732
  */
4506
- getDataStores: getDataStores((0, import_node_path25.join)(path9)),
4733
+ getDataStores: getDataStores((0, import_node_path26.join)(path9)),
4507
4734
  /**
4508
4735
  * Version a data store by its id
4509
4736
  * @param id - The id of the data store to version
4510
4737
  */
4511
- versionDataStore: versionDataStore((0, import_node_path25.join)(path9, "containers")),
4738
+ versionDataStore: versionDataStore((0, import_node_path26.join)(path9, "containers")),
4512
4739
  /**
4513
4740
  * Remove a data store by its path
4514
4741
  * @param path - The path to the data store to remove
4515
4742
  */
4516
- rmDataStore: rmDataStore((0, import_node_path25.join)(path9, "containers")),
4743
+ rmDataStore: rmDataStore((0, import_node_path26.join)(path9, "containers")),
4517
4744
  /**
4518
4745
  * Remove a data store by its id
4519
4746
  * @param id - The id of the data store to remove
4520
4747
  */
4521
- rmDataStoreById: rmDataStoreById((0, import_node_path25.join)(path9)),
4748
+ rmDataStoreById: rmDataStoreById((0, import_node_path26.join)(path9)),
4522
4749
  /**
4523
4750
  * Check to see if a data store version exists
4524
4751
  * @param id - The id of the data store
4525
4752
  * @param version - The version of the data store (supports semver)
4526
4753
  * @returns
4527
4754
  */
4528
- dataStoreHasVersion: dataStoreHasVersion((0, import_node_path25.join)(path9)),
4755
+ dataStoreHasVersion: dataStoreHasVersion((0, import_node_path26.join)(path9)),
4529
4756
  /**
4530
4757
  * Adds a file to a data store by its id
4531
4758
  * @param id - The id of the data store to add the file to
@@ -4533,14 +4760,21 @@ var src_default = (path9) => {
4533
4760
  * @param version - Optional version of the data store to add the file to
4534
4761
  * @returns
4535
4762
  */
4536
- addFileToDataStore: addFileToDataStore((0, import_node_path25.join)(path9)),
4763
+ addFileToDataStore: addFileToDataStore((0, import_node_path26.join)(path9)),
4537
4764
  /**
4538
4765
  * Writes a data store to a service by its id
4539
4766
  * @param dataStore - The data store to write
4540
4767
  * @param service - The service to write the data store to
4541
4768
  * @returns
4542
4769
  */
4543
- writeDataStoreToService: writeDataStoreToService((0, import_node_path25.join)(path9)),
4770
+ writeDataStoreToService: writeDataStoreToService((0, import_node_path26.join)(path9)),
4771
+ /**
4772
+ * Writes a data store to a system by its id
4773
+ * @param dataStore - The data store to write
4774
+ * @param system - The system to write the data store to
4775
+ * @returns
4776
+ */
4777
+ writeDataStoreToSystem: writeDataStoreToSystem((0, import_node_path26.join)(path9)),
4544
4778
  /**
4545
4779
  * ================================
4546
4780
  * Data Products
@@ -4552,7 +4786,7 @@ var src_default = (path9) => {
4552
4786
  * @param options - Optional options to write the data product
4553
4787
  *
4554
4788
  */
4555
- writeDataProduct: writeDataProduct((0, import_node_path25.join)(path9, "data-products")),
4789
+ writeDataProduct: writeDataProduct((0, import_node_path26.join)(path9, "data-products")),
4556
4790
  /**
4557
4791
  * Writes a data product to a domain in EventCatalog
4558
4792
  * @param dataProduct - The data product to write
@@ -4560,43 +4794,43 @@ var src_default = (path9) => {
4560
4794
  * @param options - Optional options to write the data product
4561
4795
  *
4562
4796
  */
4563
- writeDataProductToDomain: writeDataProductToDomain((0, import_node_path25.join)(path9, "domains")),
4797
+ writeDataProductToDomain: writeDataProductToDomain((0, import_node_path26.join)(path9, "domains")),
4564
4798
  /**
4565
4799
  * Returns a data product from EventCatalog
4566
4800
  * @param id - The id of the data product to retrieve
4567
4801
  * @param version - Optional id of the version to get (supports semver)
4568
4802
  * @returns DataProduct|Undefined
4569
4803
  */
4570
- getDataProduct: getDataProduct((0, import_node_path25.join)(path9)),
4804
+ getDataProduct: getDataProduct((0, import_node_path26.join)(path9)),
4571
4805
  /**
4572
4806
  * Returns all data products from EventCatalog
4573
4807
  * @param latestOnly - optional boolean, set to true to get only latest versions
4574
4808
  * @returns DataProduct[]|Undefined
4575
4809
  */
4576
- getDataProducts: getDataProducts((0, import_node_path25.join)(path9)),
4810
+ getDataProducts: getDataProducts((0, import_node_path26.join)(path9)),
4577
4811
  /**
4578
4812
  * Version a data product by its id
4579
4813
  * @param id - The id of the data product to version
4580
4814
  */
4581
- versionDataProduct: versionDataProduct((0, import_node_path25.join)(path9)),
4815
+ versionDataProduct: versionDataProduct((0, import_node_path26.join)(path9)),
4582
4816
  /**
4583
4817
  * Remove a data product by its path
4584
4818
  * @param path - The path to the data product to remove
4585
4819
  */
4586
- rmDataProduct: rmDataProduct((0, import_node_path25.join)(path9, "data-products")),
4820
+ rmDataProduct: rmDataProduct((0, import_node_path26.join)(path9, "data-products")),
4587
4821
  /**
4588
4822
  * Remove a data product by its id
4589
4823
  * @param id - The id of the data product to remove
4590
4824
  * @param version - Optional version of the data product to remove
4591
4825
  */
4592
- rmDataProductById: rmDataProductById((0, import_node_path25.join)(path9)),
4826
+ rmDataProductById: rmDataProductById((0, import_node_path26.join)(path9)),
4593
4827
  /**
4594
4828
  * Check to see if a data product version exists
4595
4829
  * @param id - The id of the data product
4596
4830
  * @param version - The version of the data product (supports semver)
4597
4831
  * @returns
4598
4832
  */
4599
- dataProductHasVersion: dataProductHasVersion((0, import_node_path25.join)(path9)),
4833
+ dataProductHasVersion: dataProductHasVersion((0, import_node_path26.join)(path9)),
4600
4834
  /**
4601
4835
  * Adds a file to a data product by its id
4602
4836
  * @param id - The id of the data product to add the file to
@@ -4604,7 +4838,7 @@ var src_default = (path9) => {
4604
4838
  * @param version - Optional version of the data product to add the file to
4605
4839
  * @returns
4606
4840
  */
4607
- addFileToDataProduct: addFileToDataProduct((0, import_node_path25.join)(path9)),
4841
+ addFileToDataProduct: addFileToDataProduct((0, import_node_path26.join)(path9)),
4608
4842
  /**
4609
4843
  * Adds a data product to a domain
4610
4844
  * @param id - The id of the domain
@@ -4612,7 +4846,7 @@ var src_default = (path9) => {
4612
4846
  * @param version - (Optional) The version of the domain to add the data product to
4613
4847
  * @returns
4614
4848
  */
4615
- addDataProductToDomain: addDataProductToDomain((0, import_node_path25.join)(path9, "domains")),
4849
+ addDataProductToDomain: addDataProductToDomain((0, import_node_path26.join)(path9, "domains")),
4616
4850
  /**
4617
4851
  * ================================
4618
4852
  * Diagrams
@@ -4624,13 +4858,13 @@ var src_default = (path9) => {
4624
4858
  * @param version - Optional id of the version to get (supports semver)
4625
4859
  * @returns Diagram|Undefined
4626
4860
  */
4627
- getDiagram: getDiagram((0, import_node_path25.join)(path9)),
4861
+ getDiagram: getDiagram((0, import_node_path26.join)(path9)),
4628
4862
  /**
4629
4863
  * Returns all diagrams from EventCatalog
4630
4864
  * @param latestOnly - optional boolean, set to true to get only latest versions
4631
4865
  * @returns Diagram[]|Undefined
4632
4866
  */
4633
- getDiagrams: getDiagrams((0, import_node_path25.join)(path9)),
4867
+ getDiagrams: getDiagrams((0, import_node_path26.join)(path9)),
4634
4868
  /**
4635
4869
  * Adds a diagram to EventCatalog
4636
4870
  *
@@ -4638,33 +4872,33 @@ var src_default = (path9) => {
4638
4872
  * @param options - Optional options to write the diagram
4639
4873
  *
4640
4874
  */
4641
- writeDiagram: writeDiagram((0, import_node_path25.join)(path9, "diagrams")),
4875
+ writeDiagram: writeDiagram((0, import_node_path26.join)(path9, "diagrams")),
4642
4876
  /**
4643
4877
  * Remove a diagram from EventCatalog (modeled on the standard POSIX rm utility)
4644
4878
  *
4645
4879
  * @param path - The path to your diagram, e.g. `/ArchitectureDiagram`
4646
4880
  *
4647
4881
  */
4648
- rmDiagram: rmDiagram((0, import_node_path25.join)(path9, "diagrams")),
4882
+ rmDiagram: rmDiagram((0, import_node_path26.join)(path9, "diagrams")),
4649
4883
  /**
4650
4884
  * Remove a diagram by a diagram id
4651
4885
  *
4652
4886
  * @param id - The id of the diagram you want to remove
4653
4887
  *
4654
4888
  */
4655
- rmDiagramById: rmDiagramById((0, import_node_path25.join)(path9)),
4889
+ rmDiagramById: rmDiagramById((0, import_node_path26.join)(path9)),
4656
4890
  /**
4657
4891
  * Moves a given diagram id to the version directory
4658
4892
  * @param id - The id of the diagram to version
4659
4893
  */
4660
- versionDiagram: versionDiagram((0, import_node_path25.join)(path9)),
4894
+ versionDiagram: versionDiagram((0, import_node_path26.join)(path9)),
4661
4895
  /**
4662
4896
  * Check to see if a diagram version exists
4663
4897
  * @param id - The id of the diagram
4664
4898
  * @param version - The version of the diagram (supports semver)
4665
4899
  * @returns
4666
4900
  */
4667
- diagramHasVersion: diagramHasVersion((0, import_node_path25.join)(path9)),
4901
+ diagramHasVersion: diagramHasVersion((0, import_node_path26.join)(path9)),
4668
4902
  /**
4669
4903
  * Adds a file to the given diagram
4670
4904
  * @param id - The id of the diagram to add the file to
@@ -4672,7 +4906,7 @@ var src_default = (path9) => {
4672
4906
  * @param version - Optional version of the diagram to add the file to
4673
4907
  * @returns
4674
4908
  */
4675
- addFileToDiagram: addFileToDiagram((0, import_node_path25.join)(path9)),
4909
+ addFileToDiagram: addFileToDiagram((0, import_node_path26.join)(path9)),
4676
4910
  /**
4677
4911
  * ================================
4678
4912
  * DSL
@@ -4691,21 +4925,21 @@ var src_default = (path9) => {
4691
4925
  * const dsl = await sdk.toDSL(services, { type: 'service', hydrate: true });
4692
4926
  * ```
4693
4927
  */
4694
- createSnapshot: createSnapshot((0, import_node_path25.join)(path9)),
4695
- diffSnapshots: diffSnapshots((0, import_node_path25.join)(path9)),
4696
- listSnapshots: listSnapshots((0, import_node_path25.join)(path9)),
4697
- toDSL: toDSL((0, import_node_path25.join)(path9), {
4698
- getEvent: getEvent((0, import_node_path25.join)(path9)),
4699
- getCommand: getCommand((0, import_node_path25.join)(path9)),
4700
- getQuery: getQuery((0, import_node_path25.join)(path9)),
4701
- getService: getService((0, import_node_path25.join)(path9)),
4702
- getServices: getServices((0, import_node_path25.join)(path9)),
4703
- getDomain: getDomain((0, import_node_path25.join)(path9, "domains")),
4704
- getChannel: getChannel((0, import_node_path25.join)(path9)),
4705
- getChannels: getChannels((0, import_node_path25.join)(path9)),
4706
- getContainer: getDataStore((0, import_node_path25.join)(path9)),
4707
- getTeam: getTeam((0, import_node_path25.join)(path9, "teams")),
4708
- getUser: getUser((0, import_node_path25.join)(path9, "users"))
4928
+ createSnapshot: createSnapshot((0, import_node_path26.join)(path9)),
4929
+ diffSnapshots: diffSnapshots((0, import_node_path26.join)(path9)),
4930
+ listSnapshots: listSnapshots((0, import_node_path26.join)(path9)),
4931
+ toDSL: toDSL((0, import_node_path26.join)(path9), {
4932
+ getEvent: getEvent((0, import_node_path26.join)(path9)),
4933
+ getCommand: getCommand((0, import_node_path26.join)(path9)),
4934
+ getQuery: getQuery((0, import_node_path26.join)(path9)),
4935
+ getService: getService((0, import_node_path26.join)(path9)),
4936
+ getServices: getServices((0, import_node_path26.join)(path9)),
4937
+ getDomain: getDomain((0, import_node_path26.join)(path9, "domains")),
4938
+ getChannel: getChannel((0, import_node_path26.join)(path9)),
4939
+ getChannels: getChannels((0, import_node_path26.join)(path9)),
4940
+ getContainer: getDataStore((0, import_node_path26.join)(path9)),
4941
+ getTeam: getTeam((0, import_node_path26.join)(path9, "teams")),
4942
+ getUser: getUser((0, import_node_path26.join)(path9, "users"))
4709
4943
  })
4710
4944
  };
4711
4945
  };