@eventcatalog/sdk 2.24.2 → 2.25.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/index.ts
2
- import { join as join20 } from "path";
2
+ import { join as join22 } from "path";
3
3
 
4
4
  // src/dsl/utils.ts
5
5
  import { globSync } from "glob";
@@ -1317,6 +1317,14 @@ var writeServiceToDomain = (directory) => async (service, domain, options = { pa
1317
1317
  pathForService = join6(pathForService, service.id);
1318
1318
  await writeResource(directory, { ...service }, { ...options, path: pathForService, type: "service" });
1319
1319
  };
1320
+ var writeServiceToSystem = (directory) => async (service, system, options = { path: "", format: "mdx", override: false }) => {
1321
+ const resourcePath = await getResourcePath(directory, system.id, system.version);
1322
+ if (!resourcePath) {
1323
+ throw new Error("System not found");
1324
+ }
1325
+ const pathForService = join6(resourcePath.directory, "services", service.id);
1326
+ await writeResource(directory, { ...service }, { ...options, path: pathForService, type: "service" });
1327
+ };
1320
1328
  var versionService = (directory) => async (id) => versionResource(directory, id);
1321
1329
  var rmService = (directory) => async (path9) => {
1322
1330
  await fs5.rm(join6(directory, path9), { recursive: true });
@@ -1459,15 +1467,129 @@ var addDataStoreToService = (directory) => async (id, operation, dataStore, vers
1459
1467
  await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
1460
1468
  };
1461
1469
 
1462
- // src/agents.ts
1470
+ // src/systems.ts
1463
1471
  import fs6 from "fs/promises";
1464
1472
  import { extname as extname2, join as join7, relative as relative3 } from "path";
1473
+ var SYSTEM_RESOURCE_IGNORES = [
1474
+ "**/systems/**/agents/**",
1475
+ "**/systems/**/services/**",
1476
+ "**/systems/**/events/**",
1477
+ "**/systems/**/commands/**",
1478
+ "**/systems/**/queries/**",
1479
+ "**/systems/**/flows/**",
1480
+ "**/systems/**/channels/**",
1481
+ "**/systems/**/entities/**",
1482
+ "**/systems/**/containers/**",
1483
+ "**/systems/**/diagrams/**",
1484
+ "**/systems/**/data-products/**",
1485
+ "**/systems/**/adrs/**",
1486
+ "**/systems/**/docs/**"
1487
+ ];
1488
+ var normalizeResourcePointers = (system) => {
1489
+ const resource = { ...system };
1490
+ if (Array.isArray(system.services)) {
1491
+ resource.services = uniqueVersions(system.services);
1492
+ }
1493
+ if (Array.isArray(system.flows)) {
1494
+ resource.flows = uniqueVersions(system.flows);
1495
+ }
1496
+ if (Array.isArray(system.entities)) {
1497
+ resource.entities = uniqueVersions(system.entities);
1498
+ }
1499
+ if (Array.isArray(system.containers)) {
1500
+ resource.containers = uniqueVersions(system.containers);
1501
+ }
1502
+ return resource;
1503
+ };
1504
+ var persistSystemAtExistingPath = async (directory, system, version) => {
1505
+ const systemPath = await getResourcePath(directory, system.id, version);
1506
+ const extension = extname2(systemPath?.fullPath || "");
1507
+ if (!systemPath) {
1508
+ throw new Error(`Cannot find system ${system.id} in the catalog`);
1509
+ }
1510
+ await rmSystemById(directory)(system.id, version, true);
1511
+ await writeSystem(directory)(system, {
1512
+ path: systemPath.directory,
1513
+ format: extension === ".md" ? "md" : "mdx"
1514
+ });
1515
+ };
1516
+ var getSystem = (directory) => async (id, version) => getResource(directory, id, version, { type: "system" });
1517
+ var getSystemByPath = (directory) => async (path9) => {
1518
+ const system = await getResource(directory, void 0, void 0, { type: "system" }, path9);
1519
+ return system;
1520
+ };
1521
+ var getSystems = (directory) => async (options) => getResources(directory, {
1522
+ type: "systems",
1523
+ ignore: SYSTEM_RESOURCE_IGNORES,
1524
+ latestOnly: options?.latestOnly
1525
+ });
1526
+ var writeSystem = (directory) => async (system, options = {
1527
+ path: "",
1528
+ override: false,
1529
+ format: "mdx"
1530
+ }) => {
1531
+ const resource = normalizeResourcePointers(system);
1532
+ return await writeResource(directory, resource, { ...options, type: "system" });
1533
+ };
1534
+ var writeSystemToDomain = (directory) => async (system, domain, options = { path: "", format: "mdx", override: false }) => {
1535
+ const resourcePath = await getResourcePath(directory, domain.id, domain.version);
1536
+ if (!resourcePath) {
1537
+ throw new Error("Domain not found");
1538
+ }
1539
+ const pathForSystem = join7(resourcePath.directory, "systems", system.id);
1540
+ await writeSystem(directory)({ ...system }, { ...options, path: pathForSystem });
1541
+ };
1542
+ var versionSystem = (directory) => async (id) => versionResource(directory, id);
1543
+ var rmSystem = (directory) => async (path9) => {
1544
+ await fs6.rm(join7(directory, path9), { recursive: true });
1545
+ invalidateFileCache();
1546
+ };
1547
+ var rmSystemById = (directory) => async (id, version, persistFiles) => {
1548
+ await rmResourceById(directory, id, version, { type: "system", persistFiles });
1549
+ };
1550
+ var addFileToSystem = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
1551
+ var systemHasVersion = (directory) => async (id, version) => {
1552
+ const file = await findFileById(directory, id, version);
1553
+ return !!file;
1554
+ };
1555
+ var isSystem = (directory) => async (path9) => {
1556
+ const system = await getSystemByPath(directory)(path9);
1557
+ const relativePath = relative3(directory, path9);
1558
+ const segments = relativePath.split(/[/\\]+/);
1559
+ return !!system && segments.includes("systems");
1560
+ };
1561
+ var toSystem = (directory) => async (file) => toResource(directory, file);
1562
+ var addResourceToSystem = (directory, resourceField) => async (id, resource, version) => {
1563
+ const system = await getSystem(directory)(id, version);
1564
+ if (!system) {
1565
+ throw new Error(`Cannot find system ${id} in the catalog`);
1566
+ }
1567
+ if (system[resourceField] === void 0) {
1568
+ system[resourceField] = [];
1569
+ }
1570
+ const resourceExistsInList = system[resourceField]?.some(
1571
+ (item) => item.id === resource.id && item.version === resource.version
1572
+ );
1573
+ if (resourceExistsInList) {
1574
+ return;
1575
+ }
1576
+ system[resourceField]?.push(resource);
1577
+ await persistSystemAtExistingPath(directory, system, version);
1578
+ };
1579
+ var addServiceToSystem = (directory) => addResourceToSystem(directory, "services");
1580
+ var addFlowToSystem = (directory) => addResourceToSystem(directory, "flows");
1581
+ var addEntityToSystem = (directory) => addResourceToSystem(directory, "entities");
1582
+ var addContainerToSystem = (directory) => addResourceToSystem(directory, "containers");
1583
+
1584
+ // src/agents.ts
1585
+ import fs7 from "fs/promises";
1586
+ import { extname as extname3, join as join8, relative as relative4 } from "path";
1465
1587
  var rewriteAgent = async (directory, id, agent, version) => {
1466
1588
  const agentPath = await getResourcePath(directory, id, version);
1467
1589
  if (!agentPath) {
1468
1590
  throw new Error(`Cannot find agent ${id} in the catalog`);
1469
1591
  }
1470
- const extension = extname2(agentPath.fullPath);
1592
+ const extension = extname3(agentPath.fullPath);
1471
1593
  await rmAgentById(directory)(id, version, true);
1472
1594
  await writeAgent(directory)(agent, { path: agentPath.directory, format: extension === ".md" ? "md" : "mdx" });
1473
1595
  };
@@ -1511,12 +1633,12 @@ var writeVersionedAgent = (directory) => async (agent) => {
1511
1633
  };
1512
1634
  var writeAgentToDomain = (directory) => async (agent, domain, options = { path: "", format: "mdx", override: false }) => {
1513
1635
  let pathForAgent = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/agents` : `/${domain.id}/agents`;
1514
- pathForAgent = join7(pathForAgent, agent.id);
1636
+ pathForAgent = join8(pathForAgent, agent.id);
1515
1637
  await writeResource(directory, { ...agent }, { ...options, path: pathForAgent, type: "agent" });
1516
1638
  };
1517
1639
  var versionAgent = (directory) => async (id) => versionResource(directory, id);
1518
1640
  var rmAgent = (directory) => async (path9) => {
1519
- await fs6.rm(join7(directory, path9), { recursive: true });
1641
+ await fs7.rm(join8(directory, path9), { recursive: true });
1520
1642
  invalidateFileCache();
1521
1643
  };
1522
1644
  var rmAgentById = (directory) => async (id, version, persistFiles) => {
@@ -1590,15 +1712,15 @@ var agentHasVersion = (directory) => async (id, version) => {
1590
1712
  };
1591
1713
  var isAgent = (directory) => async (path9) => {
1592
1714
  const agent = await getAgentByPath(directory)(path9);
1593
- const relativePath = relative3(directory, path9);
1715
+ const relativePath = relative4(directory, path9);
1594
1716
  const segments = relativePath.split(/[/\\]+/);
1595
1717
  return !!agent && segments.includes("agents");
1596
1718
  };
1597
1719
  var toAgent = (directory) => async (file) => toResource(directory, file);
1598
1720
 
1599
1721
  // src/domains.ts
1600
- import fs7 from "fs/promises";
1601
- import path2, { join as join8 } from "path";
1722
+ import fs8 from "fs/promises";
1723
+ import path2, { join as join9 } from "path";
1602
1724
  import fsSync3 from "fs";
1603
1725
  import matter3 from "gray-matter";
1604
1726
  var resolveDomainWriteDirectory = async (directory, id, version) => {
@@ -1642,6 +1764,9 @@ var writeDomain = (directory) => async (domain, options = {
1642
1764
  if (Array.isArray(domain.domains)) {
1643
1765
  resource.domains = uniqueVersions(domain.domains);
1644
1766
  }
1767
+ if (Array.isArray(domain.systems)) {
1768
+ resource.systems = uniqueVersions(domain.systems);
1769
+ }
1645
1770
  if (Array.isArray(domain.sends)) {
1646
1771
  resource.sends = uniqueVersions(domain.sends);
1647
1772
  }
@@ -1655,7 +1780,7 @@ var writeDomain = (directory) => async (domain, options = {
1655
1780
  };
1656
1781
  var versionDomain = (directory) => async (id) => versionResource(directory, id);
1657
1782
  var rmDomain = (directory) => async (path9) => {
1658
- await fs7.rm(join8(directory, path9), { recursive: true });
1783
+ await fs8.rm(join9(directory, path9), { recursive: true });
1659
1784
  invalidateFileCache();
1660
1785
  };
1661
1786
  var rmDomainById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "domain", persistFiles });
@@ -1728,6 +1853,22 @@ var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
1728
1853
  await rmDomainById(directory)(id, version, true);
1729
1854
  await writeDomain(writeDir)(domain, { format: extension === ".md" ? "md" : "mdx" });
1730
1855
  };
1856
+ var addSystemToDomain = (directory) => async (id, system, version) => {
1857
+ let domain = await getDomain(directory)(id, version);
1858
+ const domainPath = await getResourcePath(directory, id, version);
1859
+ const extension = path2.extname(domainPath?.fullPath || "");
1860
+ if (domain.systems === void 0) {
1861
+ domain.systems = [];
1862
+ }
1863
+ const systemExistsInList = domain.systems.some((s) => s.id === system.id && s.version === system.version);
1864
+ if (systemExistsInList) {
1865
+ return;
1866
+ }
1867
+ domain.systems.push(system);
1868
+ const writeDir = await resolveDomainWriteDirectory(directory, id, version);
1869
+ await rmDomainById(directory)(id, version, true);
1870
+ await writeDomain(writeDir)(domain, { format: extension === ".md" ? "md" : "mdx" });
1871
+ };
1731
1872
  var addEntityToDomain = (directory) => async (id, entity, version) => {
1732
1873
  let domain = await getDomain(directory)(id, version);
1733
1874
  const domainPath = await getResourcePath(directory, id, version);
@@ -1795,13 +1936,13 @@ var addMessageToDomain = (directory) => async (id, direction, message, version)
1795
1936
  };
1796
1937
 
1797
1938
  // src/channels.ts
1798
- import fs8 from "fs/promises";
1799
- import { join as join9, extname as extname3 } from "path";
1939
+ import fs9 from "fs/promises";
1940
+ import { join as join10, extname as extname4 } from "path";
1800
1941
  var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
1801
1942
  var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
1802
1943
  var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
1803
1944
  var rmChannel = (directory) => async (path9) => {
1804
- await fs8.rm(join9(directory, path9), { recursive: true });
1945
+ await fs9.rm(join10(directory, path9), { recursive: true });
1805
1946
  invalidateFileCache();
1806
1947
  };
1807
1948
  var rmChannelById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "channel", persistFiles });
@@ -1832,7 +1973,7 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
1832
1973
  const { getMessage: getMessage2, rmMessageById, writeMessage } = functions[collection];
1833
1974
  const message = await getMessage2(directory)(_message.id, _message.version);
1834
1975
  const messagePath = await getResourcePath(directory, _message.id, _message.version);
1835
- const extension = extname3(messagePath?.fullPath || "");
1976
+ const extension = extname4(messagePath?.fullPath || "");
1836
1977
  if (!message) throw new Error(`Message ${_message.id} with version ${_message.version} not found`);
1837
1978
  if (message.channels === void 0) {
1838
1979
  message.channels = [];
@@ -1844,13 +1985,13 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
1844
1985
  throw new Error(`Cannot find message ${id} in the catalog`);
1845
1986
  }
1846
1987
  const path9 = existingResource.split(new RegExp(`[\\\\/]+${collection}`))[0];
1847
- const pathToResource = join9(path9, collection);
1988
+ const pathToResource = join10(path9, collection);
1848
1989
  await rmMessageById(directory)(_message.id, _message.version, true);
1849
1990
  await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
1850
1991
  };
1851
1992
 
1852
1993
  // src/messages.ts
1853
- import { dirname as dirname5, join as join10 } from "path";
1994
+ import { dirname as dirname5, join as join11 } from "path";
1854
1995
  import fsSync4 from "fs";
1855
1996
  import matter4 from "gray-matter";
1856
1997
  import { satisfies as satisfies4, validRange as validRange3 } from "semver";
@@ -1954,7 +2095,7 @@ var getSchemaForMessage = (directory) => async (id, version) => {
1954
2095
  const { data } = matter4.read(file);
1955
2096
  if (!data.schemaPath) return void 0;
1956
2097
  const resourceDirectory = dirname5(file);
1957
- const pathToSchema = join10(resourceDirectory, data.schemaPath);
2098
+ const pathToSchema = join11(resourceDirectory, data.schemaPath);
1958
2099
  if (!fsSync4.existsSync(pathToSchema)) return void 0;
1959
2100
  const schema = fsSync4.readFileSync(pathToSchema, "utf8");
1960
2101
  return {
@@ -1964,9 +2105,9 @@ var getSchemaForMessage = (directory) => async (id, version) => {
1964
2105
  };
1965
2106
 
1966
2107
  // src/custom-docs.ts
1967
- import path3, { join as join11 } from "path";
2108
+ import path3, { join as join12 } from "path";
1968
2109
  import fsSync5 from "fs";
1969
- import fs9 from "fs/promises";
2110
+ import fs10 from "fs/promises";
1970
2111
  import matter5 from "gray-matter";
1971
2112
  import slugify from "slugify";
1972
2113
  var getCustomDoc = (directory) => async (filePath) => {
@@ -1997,24 +2138,24 @@ var writeCustomDoc = (directory) => async (customDoc, options = { path: "" }) =>
1997
2138
  };
1998
2139
  var rmCustomDoc = (directory) => async (filePath) => {
1999
2140
  const withExtension = filePath.endsWith(".mdx") ? filePath : `${filePath}.mdx`;
2000
- await fs9.rm(join11(directory, withExtension), { recursive: true });
2141
+ await fs10.rm(join12(directory, withExtension), { recursive: true });
2001
2142
  invalidateFileCache();
2002
2143
  };
2003
2144
 
2004
2145
  // src/teams.ts
2005
- import fs11 from "fs/promises";
2146
+ import fs12 from "fs/promises";
2006
2147
  import fsSync7 from "fs";
2007
- import { join as join13 } from "path";
2148
+ import { join as join14 } from "path";
2008
2149
  import matter7 from "gray-matter";
2009
2150
  import path5 from "path";
2010
2151
 
2011
2152
  // src/users.ts
2012
2153
  import fsSync6 from "fs";
2013
- import { join as join12 } from "path";
2154
+ import { join as join13 } from "path";
2014
2155
  import matter6 from "gray-matter";
2015
2156
 
2016
2157
  // src/internal/directory-store.ts
2017
- import fs10 from "fs";
2158
+ import fs11 from "fs";
2018
2159
  import path4 from "path";
2019
2160
  var DIRECTORY_STORE_PATH = path4.join(".eventcatalog", "store", "directory.json");
2020
2161
  var getCatalogRoot = (catalogDir, collection) => {
@@ -2025,9 +2166,9 @@ var getDirectoryStorePath = (catalogDir, collection) => {
2025
2166
  };
2026
2167
  var readDirectoryStoreResources = (catalogDir, collection) => {
2027
2168
  const storePath = getDirectoryStorePath(catalogDir, collection);
2028
- if (!fs10.existsSync(storePath)) return [];
2169
+ if (!fs11.existsSync(storePath)) return [];
2029
2170
  try {
2030
- const store = JSON.parse(fs10.readFileSync(storePath, "utf8"));
2171
+ const store = JSON.parse(fs11.readFileSync(storePath, "utf8"));
2031
2172
  const resources = store.resources?.[collection];
2032
2173
  return Array.isArray(resources) ? resources : [];
2033
2174
  } catch {
@@ -2079,12 +2220,12 @@ var writeUser = (catalogDir) => async (user, options = {}) => {
2079
2220
  }
2080
2221
  const { markdown, ...frontmatter } = resource;
2081
2222
  const document = matter6.stringify(markdown, frontmatter);
2082
- fsSync6.mkdirSync(join12(catalogDir, ""), { recursive: true });
2083
- fsSync6.writeFileSync(join12(catalogDir, "", `${resource.id}.mdx`), document);
2223
+ fsSync6.mkdirSync(join13(catalogDir, ""), { recursive: true });
2224
+ fsSync6.writeFileSync(join13(catalogDir, "", `${resource.id}.mdx`), document);
2084
2225
  invalidateFileCache();
2085
2226
  };
2086
2227
  var rmUserById = (catalogDir) => async (id) => {
2087
- fsSync6.rmSync(join12(catalogDir, `${id}.mdx`), { recursive: true });
2228
+ fsSync6.rmSync(join13(catalogDir, `${id}.mdx`), { recursive: true });
2088
2229
  invalidateFileCache();
2089
2230
  };
2090
2231
 
@@ -2123,12 +2264,12 @@ var writeTeam = (catalogDir) => async (team, options = {}) => {
2123
2264
  }
2124
2265
  const { markdown, ...frontmatter } = resource;
2125
2266
  const document = matter7.stringify(markdown, frontmatter);
2126
- fsSync7.mkdirSync(join13(catalogDir, ""), { recursive: true });
2127
- fsSync7.writeFileSync(join13(catalogDir, "", `${resource.id}.mdx`), document);
2267
+ fsSync7.mkdirSync(join14(catalogDir, ""), { recursive: true });
2268
+ fsSync7.writeFileSync(join14(catalogDir, "", `${resource.id}.mdx`), document);
2128
2269
  invalidateFileCache();
2129
2270
  };
2130
2271
  var rmTeamById = (catalogDir) => async (id) => {
2131
- await fs11.rm(join13(catalogDir, `${id}.mdx`), { recursive: true });
2272
+ await fs12.rm(join14(catalogDir, `${id}.mdx`), { recursive: true });
2132
2273
  invalidateFileCache();
2133
2274
  };
2134
2275
  var getOwnersForResource = (catalogDir) => async (id, version) => {
@@ -2151,12 +2292,12 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
2151
2292
  };
2152
2293
 
2153
2294
  // src/eventcatalog.ts
2154
- import fs12 from "fs";
2155
- import path6, { join as join14 } from "path";
2295
+ import fs13 from "fs";
2296
+ import path6, { join as join15 } from "path";
2156
2297
  var DUMP_VERSION = "0.0.1";
2157
2298
  var getEventCatalogVersion = async (catalogDir) => {
2158
2299
  try {
2159
- const packageJson = fs12.readFileSync(join14(catalogDir, "package.json"), "utf8");
2300
+ const packageJson = fs13.readFileSync(join15(catalogDir, "package.json"), "utf8");
2160
2301
  const packageJsonObject = JSON.parse(packageJson);
2161
2302
  return packageJsonObject["dependencies"]["@eventcatalog/core"];
2162
2303
  } catch (error) {
@@ -2170,8 +2311,8 @@ var hydrateResource = async (catalogDir, resources = [], { attachSchema = false
2170
2311
  let schema = "";
2171
2312
  if (resource.schemaPath && resourcePath?.fullPath) {
2172
2313
  const pathToSchema = path6.join(path6.dirname(resourcePath?.fullPath), resource.schemaPath);
2173
- if (fs12.existsSync(pathToSchema)) {
2174
- schema = fs12.readFileSync(pathToSchema, "utf8");
2314
+ if (fs13.existsSync(pathToSchema)) {
2315
+ schema = fs13.readFileSync(pathToSchema, "utf8");
2175
2316
  }
2176
2317
  }
2177
2318
  const eventcatalog = schema ? { directory: resourcePath?.directory, schema } : { directory: resourcePath?.directory };
@@ -2190,7 +2331,7 @@ var filterCollection = (collection, options) => {
2190
2331
  };
2191
2332
  var getEventCatalogConfigurationFile = (directory) => async () => {
2192
2333
  try {
2193
- const path9 = join14(directory, "eventcatalog.config.js");
2334
+ const path9 = join15(directory, "eventcatalog.config.js");
2194
2335
  const configModule = await import(path9);
2195
2336
  return configModule.default;
2196
2337
  } catch (error) {
@@ -2201,6 +2342,7 @@ var getEventCatalogConfigurationFile = (directory) => async () => {
2201
2342
  var dumpCatalog = (directory) => async (options) => {
2202
2343
  const {
2203
2344
  getDomains: getDomains2,
2345
+ getSystems: getSystems2,
2204
2346
  getServices: getServices2,
2205
2347
  getAgents: getAgents2,
2206
2348
  getEvents: getEvents2,
@@ -2211,10 +2353,12 @@ var dumpCatalog = (directory) => async (options) => {
2211
2353
  getUsers: getUsers3,
2212
2354
  getEntities: getEntities2,
2213
2355
  getDataStores: getDataStores2,
2214
- getFlows: getFlows2
2356
+ getFlows: getFlows2,
2357
+ getAdrs: getAdrs2
2215
2358
  } = src_default(directory);
2216
2359
  const { includeMarkdown = true } = options || {};
2217
2360
  const domains = await getDomains2();
2361
+ const systems = await getSystems2();
2218
2362
  const services = await getServices2();
2219
2363
  const agents = await getAgents2();
2220
2364
  const events = await getEvents2();
@@ -2226,8 +2370,10 @@ var dumpCatalog = (directory) => async (options) => {
2226
2370
  const entities = await getEntities2();
2227
2371
  const containers = await getDataStores2();
2228
2372
  const flows = await getFlows2();
2373
+ const adrs = await getAdrs2();
2229
2374
  const [
2230
2375
  hydratedDomains,
2376
+ hydratedSystems,
2231
2377
  hydratedServices,
2232
2378
  hydratedAgents,
2233
2379
  hydratedEvents,
@@ -2238,9 +2384,11 @@ var dumpCatalog = (directory) => async (options) => {
2238
2384
  hydratedChannels,
2239
2385
  hydratedEntities,
2240
2386
  hydratedContainers,
2241
- hydratedFlows
2387
+ hydratedFlows,
2388
+ hydratedAdrs
2242
2389
  ] = await Promise.all([
2243
2390
  hydrateResource(directory, domains),
2391
+ hydrateResource(directory, systems),
2244
2392
  hydrateResource(directory, services),
2245
2393
  hydrateResource(directory, agents),
2246
2394
  hydrateResource(directory, events),
@@ -2251,7 +2399,8 @@ var dumpCatalog = (directory) => async (options) => {
2251
2399
  hydrateResource(directory, channels),
2252
2400
  hydrateResource(directory, entities),
2253
2401
  hydrateResource(directory, containers),
2254
- hydrateResource(directory, flows)
2402
+ hydrateResource(directory, flows),
2403
+ hydrateResource(directory, adrs)
2255
2404
  ]);
2256
2405
  return {
2257
2406
  version: DUMP_VERSION,
@@ -2259,6 +2408,7 @@ var dumpCatalog = (directory) => async (options) => {
2259
2408
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
2260
2409
  resources: {
2261
2410
  domains: filterCollection(hydratedDomains, { includeMarkdown }),
2411
+ systems: filterCollection(hydratedSystems, { includeMarkdown }),
2262
2412
  services: filterCollection(hydratedServices, { includeMarkdown }),
2263
2413
  agents: filterCollection(hydratedAgents, { includeMarkdown }),
2264
2414
  messages: {
@@ -2271,13 +2421,14 @@ var dumpCatalog = (directory) => async (options) => {
2271
2421
  channels: filterCollection(hydratedChannels, { includeMarkdown }),
2272
2422
  entities: filterCollection(hydratedEntities, { includeMarkdown }),
2273
2423
  containers: filterCollection(hydratedContainers, { includeMarkdown }),
2274
- flows: filterCollection(hydratedFlows, { includeMarkdown })
2424
+ flows: filterCollection(hydratedFlows, { includeMarkdown }),
2425
+ adrs: filterCollection(hydratedAdrs, { includeMarkdown })
2275
2426
  }
2276
2427
  };
2277
2428
  };
2278
2429
 
2279
2430
  // src/snapshots.ts
2280
- import fs13 from "fs";
2431
+ import fs14 from "fs";
2281
2432
  import path7 from "path";
2282
2433
  import { createHash } from "crypto";
2283
2434
  import { execSync } from "child_process";
@@ -2458,7 +2609,7 @@ var computeRelationshipDiff = (snapshotA, snapshotB) => {
2458
2609
  var SNAPSHOT_VERSION = "1.0.0";
2459
2610
  var getEventCatalogVersion2 = (catalogDir) => {
2460
2611
  try {
2461
- const packageJson = fs13.readFileSync(path7.join(catalogDir, "package.json"), "utf8");
2612
+ const packageJson = fs14.readFileSync(path7.join(catalogDir, "package.json"), "utf8");
2462
2613
  const packageJsonObject = JSON.parse(packageJson);
2463
2614
  return packageJsonObject["dependencies"]?.["@eventcatalog/core"] ?? "unknown";
2464
2615
  } catch {
@@ -2556,16 +2707,16 @@ var createSnapshot = (directory) => {
2556
2707
  }
2557
2708
  };
2558
2709
  const snapshotsDir = outputDir || path7.join(directory, ".snapshots");
2559
- fs13.mkdirSync(snapshotsDir, { recursive: true });
2710
+ fs14.mkdirSync(snapshotsDir, { recursive: true });
2560
2711
  const fileName = `${snapshotLabel}.snapshot.json`;
2561
2712
  const filePath = path7.join(snapshotsDir, fileName);
2562
- fs13.writeFileSync(filePath, JSON.stringify(snapshot));
2713
+ fs14.writeFileSync(filePath, JSON.stringify(snapshot));
2563
2714
  return { filePath, snapshot };
2564
2715
  };
2565
2716
  };
2566
2717
  var diffSnapshots = (directory) => async (snapshotAPath, snapshotBPath) => {
2567
- const snapshotA = JSON.parse(fs13.readFileSync(snapshotAPath, "utf-8"));
2568
- const snapshotB = JSON.parse(fs13.readFileSync(snapshotBPath, "utf-8"));
2718
+ const snapshotA = JSON.parse(fs14.readFileSync(snapshotAPath, "utf-8"));
2719
+ const snapshotB = JSON.parse(fs14.readFileSync(snapshotBPath, "utf-8"));
2569
2720
  const resourceChanges = computeResourceDiff(snapshotA, snapshotB);
2570
2721
  const relationshipChanges = computeRelationshipDiff(snapshotA, snapshotB);
2571
2722
  const resourceCounts = { added: 0, removed: 0, modified: 0, versioned: 0 };
@@ -2590,13 +2741,13 @@ var diffSnapshots = (directory) => async (snapshotAPath, snapshotBPath) => {
2590
2741
  };
2591
2742
  var listSnapshots = (directory) => async () => {
2592
2743
  const snapshotsDir = path7.join(directory, ".snapshots");
2593
- if (!fs13.existsSync(snapshotsDir)) return [];
2594
- const files = fs13.readdirSync(snapshotsDir).filter((f) => f.endsWith(".snapshot.json"));
2744
+ if (!fs14.existsSync(snapshotsDir)) return [];
2745
+ const files = fs14.readdirSync(snapshotsDir).filter((f) => f.endsWith(".snapshot.json"));
2595
2746
  const snapshots = [];
2596
2747
  for (const file of files) {
2597
2748
  try {
2598
2749
  const filePath = path7.join(snapshotsDir, file);
2599
- const content = JSON.parse(fs13.readFileSync(filePath, "utf-8"));
2750
+ const content = JSON.parse(fs14.readFileSync(filePath, "utf-8"));
2600
2751
  snapshots.push({
2601
2752
  label: content.label,
2602
2753
  createdAt: content.createdAt,
@@ -2612,7 +2763,7 @@ var listSnapshots = (directory) => async () => {
2612
2763
  // src/changelogs.ts
2613
2764
  import path8, { dirname as dirname6 } from "path";
2614
2765
  import fsSync8 from "fs";
2615
- import fs14 from "fs/promises";
2766
+ import fs15 from "fs/promises";
2616
2767
  import matter8 from "gray-matter";
2617
2768
  var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
2618
2769
  const { version, format = "mdx" } = options;
@@ -2689,17 +2840,17 @@ var rmChangelog = (catalogDir) => async (id, options = {}) => {
2689
2840
  const mdxPath = path8.join(resourceDir, "changelog.mdx");
2690
2841
  const mdPath = path8.join(resourceDir, "changelog.md");
2691
2842
  if (fsSync8.existsSync(mdxPath)) {
2692
- await fs14.rm(mdxPath);
2843
+ await fs15.rm(mdxPath);
2693
2844
  }
2694
2845
  if (fsSync8.existsSync(mdPath)) {
2695
- await fs14.rm(mdPath);
2846
+ await fs15.rm(mdPath);
2696
2847
  }
2697
2848
  invalidateFileCache();
2698
2849
  };
2699
2850
 
2700
2851
  // src/entities.ts
2701
- import fs15 from "fs/promises";
2702
- import { join as join15 } from "path";
2852
+ import fs16 from "fs/promises";
2853
+ import { join as join16 } from "path";
2703
2854
  var getEntity = (directory) => async (id, version) => getResource(directory, id, version, { type: "entity" });
2704
2855
  var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
2705
2856
  var writeEntity = (directory) => async (entity, options = {
@@ -2707,8 +2858,16 @@ var writeEntity = (directory) => async (entity, options = {
2707
2858
  override: false,
2708
2859
  format: "mdx"
2709
2860
  }) => writeResource(directory, { ...entity }, { ...options, type: "entity" });
2861
+ var writeEntityToSystem = (directory) => async (entity, system, options = { path: "", format: "mdx", override: false }) => {
2862
+ const resourcePath = await getResourcePath(directory, system.id, system.version);
2863
+ if (!resourcePath) {
2864
+ throw new Error("System not found");
2865
+ }
2866
+ const pathForEntity = join16(resourcePath.directory, "entities", entity.id);
2867
+ await writeResource(directory, { ...entity }, { ...options, path: pathForEntity, type: "entity" });
2868
+ };
2710
2869
  var rmEntity = (directory) => async (path9) => {
2711
- await fs15.rm(join15(directory, path9), { recursive: true });
2870
+ await fs16.rm(join16(directory, path9), { recursive: true });
2712
2871
  invalidateFileCache();
2713
2872
  };
2714
2873
  var rmEntityById = (directory) => async (id, version, persistFiles) => {
@@ -2721,8 +2880,8 @@ var entityHasVersion = (directory) => async (id, version) => {
2721
2880
  };
2722
2881
 
2723
2882
  // src/flows.ts
2724
- import fs16 from "fs/promises";
2725
- import { join as join16 } from "path";
2883
+ import fs17 from "fs/promises";
2884
+ import { join as join17 } from "path";
2726
2885
 
2727
2886
  // src/flow-builder.ts
2728
2887
  var cloneStep = (step) => ({
@@ -3204,21 +3363,29 @@ var writeVersionedFlow = (directory) => async (flow) => {
3204
3363
  };
3205
3364
  var writeFlowToDomain = (directory) => async (flow, domain, options = { path: "", format: "mdx", override: false }) => {
3206
3365
  let pathForFlow = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/flows` : `/${domain.id}/flows`;
3207
- pathForFlow = join16(pathForFlow, flow.id);
3366
+ pathForFlow = join17(pathForFlow, flow.id);
3208
3367
  await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
3209
3368
  };
3210
3369
  var writeFlowToService = (directory) => async (flow, service, options = { path: "", format: "mdx", override: false }) => {
3211
3370
  let pathForFlow = service.version && service.version !== "latest" ? `/${service.id}/versioned/${service.version}/flows` : `/${service.id}/flows`;
3212
- pathForFlow = join16(pathForFlow, flow.id);
3371
+ pathForFlow = join17(pathForFlow, flow.id);
3372
+ await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
3373
+ };
3374
+ var writeFlowToSystem = (directory) => async (flow, system, options = { path: "", format: "mdx", override: false }) => {
3375
+ const resourcePath = await getResourcePath(directory, system.id, system.version);
3376
+ if (!resourcePath) {
3377
+ throw new Error("System not found");
3378
+ }
3379
+ const pathForFlow = join17(resourcePath.directory, "flows", flow.id);
3213
3380
  await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
3214
3381
  };
3215
3382
  var writeFlowToAgent = (directory) => async (flow, agent, options = { path: "", format: "mdx", override: false }) => {
3216
3383
  let pathForFlow = agent.version && agent.version !== "latest" ? `/${agent.id}/versioned/${agent.version}/flows` : `/${agent.id}/flows`;
3217
- pathForFlow = join16(pathForFlow, flow.id);
3384
+ pathForFlow = join17(pathForFlow, flow.id);
3218
3385
  await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
3219
3386
  };
3220
3387
  var rmFlow = (directory) => async (path9) => {
3221
- await fs16.rm(join16(directory, path9), { recursive: true });
3388
+ await fs17.rm(join17(directory, path9), { recursive: true });
3222
3389
  invalidateFileCache();
3223
3390
  };
3224
3391
  var rmFlowById = (directory) => async (id, version, persistFiles) => {
@@ -3232,8 +3399,8 @@ var flowHasVersion = (directory) => async (id, version) => {
3232
3399
  var addFileToFlow = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version, { type: "flow" });
3233
3400
 
3234
3401
  // src/containers.ts
3235
- import fs17 from "fs/promises";
3236
- import { join as join17 } from "path";
3402
+ import fs18 from "fs/promises";
3403
+ import { join as join18 } from "path";
3237
3404
  var getContainer = (directory) => async (id, version) => getResource(directory, id, version, { type: "container" });
3238
3405
  var getContainers = (directory) => async (options) => getResources(directory, { type: "containers", latestOnly: options?.latestOnly });
3239
3406
  var writeContainer = (directory) => async (data, options = {
@@ -3243,7 +3410,7 @@ var writeContainer = (directory) => async (data, options = {
3243
3410
  }) => writeResource(directory, { ...data }, { ...options, type: "container" });
3244
3411
  var versionContainer = (directory) => async (id) => versionResource(directory, id);
3245
3412
  var rmContainer = (directory) => async (path9) => {
3246
- await fs17.rm(join17(directory, path9), { recursive: true });
3413
+ await fs18.rm(join18(directory, path9), { recursive: true });
3247
3414
  invalidateFileCache();
3248
3415
  };
3249
3416
  var rmContainerById = (directory) => async (id, version, persistFiles) => {
@@ -3260,7 +3427,15 @@ var writeContainerToService = (directory) => async (container, service, options
3260
3427
  throw new Error("Service not found");
3261
3428
  }
3262
3429
  let pathForContainer = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/containers` : `${resourcePath.directory}/containers`;
3263
- pathForContainer = join17(pathForContainer, container.id);
3430
+ pathForContainer = join18(pathForContainer, container.id);
3431
+ await writeResource(directory, { ...container }, { ...options, path: pathForContainer, type: "container" });
3432
+ };
3433
+ var writeContainerToSystem = (directory) => async (container, system, options = { path: "", format: "mdx", override: false }) => {
3434
+ const resourcePath = await getResourcePath(directory, system.id, system.version);
3435
+ if (!resourcePath) {
3436
+ throw new Error("System not found");
3437
+ }
3438
+ const pathForContainer = join18(resourcePath.directory, "containers", container.id);
3264
3439
  await writeResource(directory, { ...container }, { ...options, path: pathForContainer, type: "container" });
3265
3440
  };
3266
3441
 
@@ -3274,10 +3449,11 @@ var rmDataStoreById = rmContainerById;
3274
3449
  var dataStoreHasVersion = containerHasVersion;
3275
3450
  var addFileToDataStore = addFileToContainer;
3276
3451
  var writeDataStoreToService = writeContainerToService;
3452
+ var writeDataStoreToSystem = writeContainerToSystem;
3277
3453
 
3278
3454
  // src/data-products.ts
3279
- import fs18 from "fs/promises";
3280
- import { join as join18 } from "path";
3455
+ import fs19 from "fs/promises";
3456
+ import { join as join19 } from "path";
3281
3457
  var getDataProduct = (directory) => async (id, version) => getResource(directory, id, version, { type: "data-product" });
3282
3458
  var getDataProducts = (directory) => async (options) => getResources(directory, { type: "data-products", latestOnly: options?.latestOnly });
3283
3459
  var writeDataProduct = (directory) => async (dataProduct, options = {
@@ -3287,11 +3463,11 @@ var writeDataProduct = (directory) => async (dataProduct, options = {
3287
3463
  }) => writeResource(directory, { ...dataProduct }, { ...options, type: "data-product" });
3288
3464
  var writeDataProductToDomain = (directory) => async (dataProduct, domain, options = { path: "", format: "mdx", override: false }) => {
3289
3465
  let pathForDataProduct = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/data-products` : `/${domain.id}/data-products`;
3290
- pathForDataProduct = join18(pathForDataProduct, dataProduct.id);
3466
+ pathForDataProduct = join19(pathForDataProduct, dataProduct.id);
3291
3467
  await writeResource(directory, { ...dataProduct }, { ...options, path: pathForDataProduct, type: "data-product" });
3292
3468
  };
3293
3469
  var rmDataProduct = (directory) => async (path9) => {
3294
- await fs18.rm(join18(directory, path9), { recursive: true });
3470
+ await fs19.rm(join19(directory, path9), { recursive: true });
3295
3471
  invalidateFileCache();
3296
3472
  };
3297
3473
  var rmDataProductById = (directory) => async (id, version, persistFiles) => {
@@ -3305,8 +3481,8 @@ var dataProductHasVersion = (directory) => async (id, version) => {
3305
3481
  var addFileToDataProduct = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
3306
3482
 
3307
3483
  // src/diagrams.ts
3308
- import fs19 from "fs/promises";
3309
- import { join as join19 } from "path";
3484
+ import fs20 from "fs/promises";
3485
+ import { join as join20 } from "path";
3310
3486
  var getDiagram = (directory) => async (id, version) => getResource(directory, id, version, { type: "diagram" });
3311
3487
  var getDiagrams = (directory) => async (options) => getResources(directory, { type: "diagrams", latestOnly: options?.latestOnly });
3312
3488
  var writeDiagram = (directory) => async (diagram, options = {
@@ -3315,7 +3491,7 @@ var writeDiagram = (directory) => async (diagram, options = {
3315
3491
  format: "mdx"
3316
3492
  }) => writeResource(directory, { ...diagram }, { ...options, type: "diagram" });
3317
3493
  var rmDiagram = (directory) => async (path9) => {
3318
- await fs19.rm(join19(directory, path9), { recursive: true });
3494
+ await fs20.rm(join20(directory, path9), { recursive: true });
3319
3495
  invalidateFileCache();
3320
3496
  };
3321
3497
  var rmDiagramById = (directory) => async (id, version, persistFiles) => {
@@ -3328,6 +3504,30 @@ var diagramHasVersion = (directory) => async (id, version) => {
3328
3504
  };
3329
3505
  var addFileToDiagram = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version, { type: "diagram" });
3330
3506
 
3507
+ // src/adrs.ts
3508
+ import fs21 from "fs/promises";
3509
+ import { join as join21 } from "path";
3510
+ var getAdr = (directory) => async (id, version) => getResource(directory, id, version, { type: "adr" });
3511
+ var getAdrs = (directory) => async (options) => getResources(directory, { type: "adrs", latestOnly: options?.latestOnly });
3512
+ var writeAdr = (directory) => async (adr, options = {
3513
+ path: "",
3514
+ override: false,
3515
+ format: "mdx"
3516
+ }) => writeResource(directory, { ...adr }, { ...options, type: "adr" });
3517
+ var rmAdr = (directory) => async (path9) => {
3518
+ await fs21.rm(join21(directory, path9), { recursive: true });
3519
+ invalidateFileCache();
3520
+ };
3521
+ var rmAdrById = (directory) => async (id, version, persistFiles) => {
3522
+ await rmResourceById(directory, id, version, { type: "adr", persistFiles });
3523
+ };
3524
+ var versionAdr = (directory) => async (id) => versionResource(directory, id);
3525
+ var adrHasVersion = (directory) => async (id, version) => {
3526
+ const file = await findFileById(directory, id, version);
3527
+ return !!file;
3528
+ };
3529
+ var addFileToAdr = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version, { type: "adr" });
3530
+
3331
3531
  // src/index.ts
3332
3532
  var src_default = (path9) => {
3333
3533
  return {
@@ -3337,13 +3537,13 @@ var src_default = (path9) => {
3337
3537
  * @param version - Optional id of the version to get (supports semver)
3338
3538
  * @returns Event|Undefined
3339
3539
  */
3340
- getEvent: getEvent(join20(path9)),
3540
+ getEvent: getEvent(join22(path9)),
3341
3541
  /**
3342
3542
  * Returns all events from EventCatalog
3343
3543
  * @param latestOnly - optional boolean, set to true to get only latest versions
3344
3544
  * @returns Event[]|Undefined
3345
3545
  */
3346
- getEvents: getEvents(join20(path9)),
3546
+ getEvents: getEvents(join22(path9)),
3347
3547
  /**
3348
3548
  * Adds an event to EventCatalog
3349
3549
  *
@@ -3351,7 +3551,7 @@ var src_default = (path9) => {
3351
3551
  * @param options - Optional options to write the event
3352
3552
  *
3353
3553
  */
3354
- writeEvent: writeEvent(join20(path9, "events")),
3554
+ writeEvent: writeEvent(join22(path9, "events")),
3355
3555
  /**
3356
3556
  * Adds an event to a service in EventCatalog
3357
3557
  *
@@ -3360,7 +3560,7 @@ var src_default = (path9) => {
3360
3560
  * @param options - Optional options to write the event
3361
3561
  *
3362
3562
  */
3363
- writeEventToService: writeEventToService(join20(path9)),
3563
+ writeEventToService: writeEventToService(join22(path9)),
3364
3564
  /**
3365
3565
  * Adds an event to an agent in EventCatalog
3366
3566
  *
@@ -3369,26 +3569,26 @@ var src_default = (path9) => {
3369
3569
  * @param options - Optional options to write the event
3370
3570
  *
3371
3571
  */
3372
- writeEventToAgent: writeEventToAgent(join20(path9)),
3572
+ writeEventToAgent: writeEventToAgent(join22(path9)),
3373
3573
  /**
3374
3574
  * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
3375
3575
  *
3376
3576
  * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
3377
3577
  *
3378
3578
  */
3379
- rmEvent: rmEvent(join20(path9, "events")),
3579
+ rmEvent: rmEvent(join22(path9, "events")),
3380
3580
  /**
3381
3581
  * Remove an event by an Event id
3382
3582
  *
3383
3583
  * @param id - The id of the event you want to remove
3384
3584
  *
3385
3585
  */
3386
- rmEventById: rmEventById(join20(path9)),
3586
+ rmEventById: rmEventById(join22(path9)),
3387
3587
  /**
3388
3588
  * Moves a given event id to the version directory
3389
3589
  * @param directory
3390
3590
  */
3391
- versionEvent: versionEvent(join20(path9)),
3591
+ versionEvent: versionEvent(join22(path9)),
3392
3592
  /**
3393
3593
  * Adds a file to the given event
3394
3594
  * @param id - The id of the event to add the file to
@@ -3396,7 +3596,7 @@ var src_default = (path9) => {
3396
3596
  * @param version - Optional version of the event to add the file to
3397
3597
  * @returns
3398
3598
  */
3399
- addFileToEvent: addFileToEvent(join20(path9)),
3599
+ addFileToEvent: addFileToEvent(join22(path9)),
3400
3600
  /**
3401
3601
  * Adds a schema to the given event
3402
3602
  * @param id - The id of the event to add the schema to
@@ -3404,17 +3604,17 @@ var src_default = (path9) => {
3404
3604
  * @param version - Optional version of the event to add the schema to
3405
3605
  * @returns
3406
3606
  */
3407
- addSchemaToEvent: addSchemaToEvent(join20(path9)),
3607
+ addSchemaToEvent: addSchemaToEvent(join22(path9)),
3408
3608
  /**
3409
3609
  * Check to see if an event version exists
3410
3610
  * @param id - The id of the event
3411
3611
  * @param version - The version of the event (supports semver)
3412
3612
  * @returns
3413
3613
  */
3414
- eventHasVersion: eventHasVersion(join20(path9)),
3415
- addExampleToEvent: addExampleToEvent(join20(path9)),
3416
- getExamplesFromEvent: getExamplesFromEvent(join20(path9)),
3417
- removeExampleFromEvent: removeExampleFromEvent(join20(path9)),
3614
+ eventHasVersion: eventHasVersion(join22(path9)),
3615
+ addExampleToEvent: addExampleToEvent(join22(path9)),
3616
+ getExamplesFromEvent: getExamplesFromEvent(join22(path9)),
3617
+ removeExampleFromEvent: removeExampleFromEvent(join22(path9)),
3418
3618
  /**
3419
3619
  * ================================
3420
3620
  * Commands
@@ -3426,13 +3626,13 @@ var src_default = (path9) => {
3426
3626
  * @param version - Optional id of the version to get (supports semver)
3427
3627
  * @returns Command|Undefined
3428
3628
  */
3429
- getCommand: getCommand(join20(path9)),
3629
+ getCommand: getCommand(join22(path9)),
3430
3630
  /**
3431
3631
  * Returns all commands from EventCatalog
3432
3632
  * @param latestOnly - optional boolean, set to true to get only latest versions
3433
3633
  * @returns Command[]|Undefined
3434
3634
  */
3435
- getCommands: getCommands(join20(path9)),
3635
+ getCommands: getCommands(join22(path9)),
3436
3636
  /**
3437
3637
  * Adds an command to EventCatalog
3438
3638
  *
@@ -3440,7 +3640,7 @@ var src_default = (path9) => {
3440
3640
  * @param options - Optional options to write the command
3441
3641
  *
3442
3642
  */
3443
- writeCommand: writeCommand(join20(path9, "commands")),
3643
+ writeCommand: writeCommand(join22(path9, "commands")),
3444
3644
  /**
3445
3645
  * Adds a command to a service in EventCatalog
3446
3646
  *
@@ -3449,7 +3649,7 @@ var src_default = (path9) => {
3449
3649
  * @param options - Optional options to write the command
3450
3650
  *
3451
3651
  */
3452
- writeCommandToService: writeCommandToService(join20(path9)),
3652
+ writeCommandToService: writeCommandToService(join22(path9)),
3453
3653
  /**
3454
3654
  * Adds a command to an agent in EventCatalog
3455
3655
  *
@@ -3458,26 +3658,26 @@ var src_default = (path9) => {
3458
3658
  * @param options - Optional options to write the command
3459
3659
  *
3460
3660
  */
3461
- writeCommandToAgent: writeCommandToAgent(join20(path9)),
3661
+ writeCommandToAgent: writeCommandToAgent(join22(path9)),
3462
3662
  /**
3463
3663
  * Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
3464
3664
  *
3465
3665
  * @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
3466
3666
  *
3467
3667
  */
3468
- rmCommand: rmCommand(join20(path9, "commands")),
3668
+ rmCommand: rmCommand(join22(path9, "commands")),
3469
3669
  /**
3470
3670
  * Remove an command by an Event id
3471
3671
  *
3472
3672
  * @param id - The id of the command you want to remove
3473
3673
  *
3474
3674
  */
3475
- rmCommandById: rmCommandById(join20(path9)),
3675
+ rmCommandById: rmCommandById(join22(path9)),
3476
3676
  /**
3477
3677
  * Moves a given command id to the version directory
3478
3678
  * @param directory
3479
3679
  */
3480
- versionCommand: versionCommand(join20(path9)),
3680
+ versionCommand: versionCommand(join22(path9)),
3481
3681
  /**
3482
3682
  * Adds a file to the given command
3483
3683
  * @param id - The id of the command to add the file to
@@ -3485,7 +3685,7 @@ var src_default = (path9) => {
3485
3685
  * @param version - Optional version of the command to add the file to
3486
3686
  * @returns
3487
3687
  */
3488
- addFileToCommand: addFileToCommand(join20(path9)),
3688
+ addFileToCommand: addFileToCommand(join22(path9)),
3489
3689
  /**
3490
3690
  * Adds a schema to the given command
3491
3691
  * @param id - The id of the command to add the schema to
@@ -3493,17 +3693,17 @@ var src_default = (path9) => {
3493
3693
  * @param version - Optional version of the command to add the schema to
3494
3694
  * @returns
3495
3695
  */
3496
- addSchemaToCommand: addSchemaToCommand(join20(path9)),
3696
+ addSchemaToCommand: addSchemaToCommand(join22(path9)),
3497
3697
  /**
3498
3698
  * Check to see if a command version exists
3499
3699
  * @param id - The id of the command
3500
3700
  * @param version - The version of the command (supports semver)
3501
3701
  * @returns
3502
3702
  */
3503
- commandHasVersion: commandHasVersion(join20(path9)),
3504
- addExampleToCommand: addExampleToCommand(join20(path9)),
3505
- getExamplesFromCommand: getExamplesFromCommand(join20(path9)),
3506
- removeExampleFromCommand: removeExampleFromCommand(join20(path9)),
3703
+ commandHasVersion: commandHasVersion(join22(path9)),
3704
+ addExampleToCommand: addExampleToCommand(join22(path9)),
3705
+ getExamplesFromCommand: getExamplesFromCommand(join22(path9)),
3706
+ removeExampleFromCommand: removeExampleFromCommand(join22(path9)),
3507
3707
  /**
3508
3708
  * ================================
3509
3709
  * Queries
@@ -3515,13 +3715,13 @@ var src_default = (path9) => {
3515
3715
  * @param version - Optional id of the version to get (supports semver)
3516
3716
  * @returns Query|Undefined
3517
3717
  */
3518
- getQuery: getQuery(join20(path9)),
3718
+ getQuery: getQuery(join22(path9)),
3519
3719
  /**
3520
3720
  * Returns all queries from EventCatalog
3521
3721
  * @param latestOnly - optional boolean, set to true to get only latest versions
3522
3722
  * @returns Query[]|Undefined
3523
3723
  */
3524
- getQueries: getQueries(join20(path9)),
3724
+ getQueries: getQueries(join22(path9)),
3525
3725
  /**
3526
3726
  * Adds a query to EventCatalog
3527
3727
  *
@@ -3529,7 +3729,7 @@ var src_default = (path9) => {
3529
3729
  * @param options - Optional options to write the event
3530
3730
  *
3531
3731
  */
3532
- writeQuery: writeQuery(join20(path9, "queries")),
3732
+ writeQuery: writeQuery(join22(path9, "queries")),
3533
3733
  /**
3534
3734
  * Adds a query to a service in EventCatalog
3535
3735
  *
@@ -3538,7 +3738,7 @@ var src_default = (path9) => {
3538
3738
  * @param options - Optional options to write the query
3539
3739
  *
3540
3740
  */
3541
- writeQueryToService: writeQueryToService(join20(path9)),
3741
+ writeQueryToService: writeQueryToService(join22(path9)),
3542
3742
  /**
3543
3743
  * Adds a query to an agent in EventCatalog
3544
3744
  *
@@ -3547,26 +3747,26 @@ var src_default = (path9) => {
3547
3747
  * @param options - Optional options to write the query
3548
3748
  *
3549
3749
  */
3550
- writeQueryToAgent: writeQueryToAgent(join20(path9)),
3750
+ writeQueryToAgent: writeQueryToAgent(join22(path9)),
3551
3751
  /**
3552
3752
  * Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
3553
3753
  *
3554
3754
  * @param path - The path to your query, e.g. `/Orders/GetOrder`
3555
3755
  *
3556
3756
  */
3557
- rmQuery: rmQuery(join20(path9, "queries")),
3757
+ rmQuery: rmQuery(join22(path9, "queries")),
3558
3758
  /**
3559
3759
  * Remove a query by a Query id
3560
3760
  *
3561
3761
  * @param id - The id of the query you want to remove
3562
3762
  *
3563
3763
  */
3564
- rmQueryById: rmQueryById(join20(path9)),
3764
+ rmQueryById: rmQueryById(join22(path9)),
3565
3765
  /**
3566
3766
  * Moves a given query id to the version directory
3567
3767
  * @param directory
3568
3768
  */
3569
- versionQuery: versionQuery(join20(path9)),
3769
+ versionQuery: versionQuery(join22(path9)),
3570
3770
  /**
3571
3771
  * Adds a file to the given query
3572
3772
  * @param id - The id of the query to add the file to
@@ -3574,7 +3774,7 @@ var src_default = (path9) => {
3574
3774
  * @param version - Optional version of the query to add the file to
3575
3775
  * @returns
3576
3776
  */
3577
- addFileToQuery: addFileToQuery(join20(path9)),
3777
+ addFileToQuery: addFileToQuery(join22(path9)),
3578
3778
  /**
3579
3779
  * Adds a schema to the given query
3580
3780
  * @param id - The id of the query to add the schema to
@@ -3582,17 +3782,17 @@ var src_default = (path9) => {
3582
3782
  * @param version - Optional version of the query to add the schema to
3583
3783
  * @returns
3584
3784
  */
3585
- addSchemaToQuery: addSchemaToQuery(join20(path9)),
3785
+ addSchemaToQuery: addSchemaToQuery(join22(path9)),
3586
3786
  /**
3587
3787
  * Check to see if an query version exists
3588
3788
  * @param id - The id of the query
3589
3789
  * @param version - The version of the query (supports semver)
3590
3790
  * @returns
3591
3791
  */
3592
- queryHasVersion: queryHasVersion(join20(path9)),
3593
- addExampleToQuery: addExampleToQuery(join20(path9)),
3594
- getExamplesFromQuery: getExamplesFromQuery(join20(path9)),
3595
- removeExampleFromQuery: removeExampleFromQuery(join20(path9)),
3792
+ queryHasVersion: queryHasVersion(join22(path9)),
3793
+ addExampleToQuery: addExampleToQuery(join22(path9)),
3794
+ getExamplesFromQuery: getExamplesFromQuery(join22(path9)),
3795
+ removeExampleFromQuery: removeExampleFromQuery(join22(path9)),
3596
3796
  /**
3597
3797
  * ================================
3598
3798
  * Channels
@@ -3604,13 +3804,13 @@ var src_default = (path9) => {
3604
3804
  * @param version - Optional id of the version to get (supports semver)
3605
3805
  * @returns Channel|Undefined
3606
3806
  */
3607
- getChannel: getChannel(join20(path9)),
3807
+ getChannel: getChannel(join22(path9)),
3608
3808
  /**
3609
3809
  * Returns all channels from EventCatalog
3610
3810
  * @param latestOnly - optional boolean, set to true to get only latest versions
3611
3811
  * @returns Channel[]|Undefined
3612
3812
  */
3613
- getChannels: getChannels(join20(path9)),
3813
+ getChannels: getChannels(join22(path9)),
3614
3814
  /**
3615
3815
  * Adds an channel to EventCatalog
3616
3816
  *
@@ -3618,33 +3818,33 @@ var src_default = (path9) => {
3618
3818
  * @param options - Optional options to write the channel
3619
3819
  *
3620
3820
  */
3621
- writeChannel: writeChannel(join20(path9, "channels")),
3821
+ writeChannel: writeChannel(join22(path9, "channels")),
3622
3822
  /**
3623
3823
  * Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
3624
3824
  *
3625
3825
  * @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
3626
3826
  *
3627
3827
  */
3628
- rmChannel: rmChannel(join20(path9, "channels")),
3828
+ rmChannel: rmChannel(join22(path9, "channels")),
3629
3829
  /**
3630
3830
  * Remove an channel by an Event id
3631
3831
  *
3632
3832
  * @param id - The id of the channel you want to remove
3633
3833
  *
3634
3834
  */
3635
- rmChannelById: rmChannelById(join20(path9)),
3835
+ rmChannelById: rmChannelById(join22(path9)),
3636
3836
  /**
3637
3837
  * Moves a given channel id to the version directory
3638
3838
  * @param directory
3639
3839
  */
3640
- versionChannel: versionChannel(join20(path9)),
3840
+ versionChannel: versionChannel(join22(path9)),
3641
3841
  /**
3642
3842
  * Check to see if a channel version exists
3643
3843
  * @param id - The id of the channel
3644
3844
  * @param version - The version of the channel (supports semver)
3645
3845
  * @returns
3646
3846
  */
3647
- channelHasVersion: channelHasVersion(join20(path9)),
3847
+ channelHasVersion: channelHasVersion(join22(path9)),
3648
3848
  /**
3649
3849
  * Add a channel to an event
3650
3850
  *
@@ -3661,7 +3861,7 @@ var src_default = (path9) => {
3661
3861
  *
3662
3862
  * ```
3663
3863
  */
3664
- addEventToChannel: addMessageToChannel(join20(path9), "events"),
3864
+ addEventToChannel: addMessageToChannel(join22(path9), "events"),
3665
3865
  /**
3666
3866
  * Add a channel to an command
3667
3867
  *
@@ -3678,7 +3878,7 @@ var src_default = (path9) => {
3678
3878
  *
3679
3879
  * ```
3680
3880
  */
3681
- addCommandToChannel: addMessageToChannel(join20(path9), "commands"),
3881
+ addCommandToChannel: addMessageToChannel(join22(path9), "commands"),
3682
3882
  /**
3683
3883
  * Add a channel to an query
3684
3884
  *
@@ -3695,7 +3895,7 @@ var src_default = (path9) => {
3695
3895
  *
3696
3896
  * ```
3697
3897
  */
3698
- addQueryToChannel: addMessageToChannel(join20(path9), "queries"),
3898
+ addQueryToChannel: addMessageToChannel(join22(path9), "queries"),
3699
3899
  /**
3700
3900
  * ================================
3701
3901
  * SERVICES
@@ -3708,14 +3908,14 @@ var src_default = (path9) => {
3708
3908
  * @param options - Optional options to write the event
3709
3909
  *
3710
3910
  */
3711
- writeService: writeService(join20(path9, "services")),
3911
+ writeService: writeService(join22(path9, "services")),
3712
3912
  /**
3713
3913
  * Adds a versioned service to EventCatalog
3714
3914
  *
3715
3915
  * @param service - The service to write
3716
3916
  *
3717
3917
  */
3718
- writeVersionedService: writeVersionedService(join20(path9, "services")),
3918
+ writeVersionedService: writeVersionedService(join22(path9, "services")),
3719
3919
  /**
3720
3920
  * Adds a service to a domain in EventCatalog
3721
3921
  *
@@ -3724,45 +3924,54 @@ var src_default = (path9) => {
3724
3924
  * @param options - Optional options to write the event
3725
3925
  *
3726
3926
  */
3727
- writeServiceToDomain: writeServiceToDomain(join20(path9, "domains")),
3927
+ writeServiceToDomain: writeServiceToDomain(join22(path9, "domains")),
3928
+ /**
3929
+ * Adds a service to a system in EventCatalog
3930
+ *
3931
+ * @param service - The service to write
3932
+ * @param system - The system to add the service to
3933
+ * @param options - Optional options to write the service
3934
+ *
3935
+ */
3936
+ writeServiceToSystem: writeServiceToSystem(join22(path9)),
3728
3937
  /**
3729
3938
  * Returns a service from EventCatalog
3730
3939
  * @param id - The id of the service to retrieve
3731
3940
  * @param version - Optional id of the version to get (supports semver)
3732
3941
  * @returns Service|Undefined
3733
3942
  */
3734
- getService: getService(join20(path9)),
3943
+ getService: getService(join22(path9)),
3735
3944
  /**
3736
3945
  * Returns a service from EventCatalog by it's path.
3737
3946
  * @param path - The path to the service to retrieve
3738
3947
  * @returns Service|Undefined
3739
3948
  */
3740
- getServiceByPath: getServiceByPath(join20(path9)),
3949
+ getServiceByPath: getServiceByPath(join22(path9)),
3741
3950
  /**
3742
3951
  * Returns all services from EventCatalog
3743
3952
  * @param latestOnly - optional boolean, set to true to get only latest versions
3744
3953
  * @returns Service[]|Undefined
3745
3954
  */
3746
- getServices: getServices(join20(path9)),
3955
+ getServices: getServices(join22(path9)),
3747
3956
  /**
3748
3957
  * Moves a given service id to the version directory
3749
3958
  * @param directory
3750
3959
  */
3751
- versionService: versionService(join20(path9)),
3960
+ versionService: versionService(join22(path9)),
3752
3961
  /**
3753
3962
  * Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
3754
3963
  *
3755
3964
  * @param path - The path to your service, e.g. `/InventoryService`
3756
3965
  *
3757
3966
  */
3758
- rmService: rmService(join20(path9, "services")),
3967
+ rmService: rmService(join22(path9, "services")),
3759
3968
  /**
3760
3969
  * Remove an service by an service id
3761
3970
  *
3762
3971
  * @param id - The id of the service you want to remove
3763
3972
  *
3764
3973
  */
3765
- rmServiceById: rmServiceById(join20(path9)),
3974
+ rmServiceById: rmServiceById(join22(path9)),
3766
3975
  /**
3767
3976
  * Adds a file to the given service
3768
3977
  * @param id - The id of the service to add the file to
@@ -3770,21 +3979,21 @@ var src_default = (path9) => {
3770
3979
  * @param version - Optional version of the service to add the file to
3771
3980
  * @returns
3772
3981
  */
3773
- addFileToService: addFileToService(join20(path9)),
3982
+ addFileToService: addFileToService(join22(path9)),
3774
3983
  /**
3775
3984
  * Returns the specifications for a given service
3776
3985
  * @param id - The id of the service to retrieve the specifications for
3777
3986
  * @param version - Optional version of the service
3778
3987
  * @returns
3779
3988
  */
3780
- getSpecificationFilesForService: getSpecificationFilesForService(join20(path9)),
3989
+ getSpecificationFilesForService: getSpecificationFilesForService(join22(path9)),
3781
3990
  /**
3782
3991
  * Check to see if a service version exists
3783
3992
  * @param id - The id of the service
3784
3993
  * @param version - The version of the service (supports semver)
3785
3994
  * @returns
3786
3995
  */
3787
- serviceHasVersion: serviceHasVersion(join20(path9)),
3996
+ serviceHasVersion: serviceHasVersion(join22(path9)),
3788
3997
  /**
3789
3998
  * Add an event to a service by it's id.
3790
3999
  *
@@ -3804,7 +4013,7 @@ var src_default = (path9) => {
3804
4013
  *
3805
4014
  * ```
3806
4015
  */
3807
- addEventToService: addMessageToService(join20(path9)),
4016
+ addEventToService: addMessageToService(join22(path9)),
3808
4017
  /**
3809
4018
  * Add a data store to a service by it's id.
3810
4019
  *
@@ -3821,7 +4030,7 @@ var src_default = (path9) => {
3821
4030
  *
3822
4031
  * ```
3823
4032
  */
3824
- addDataStoreToService: addDataStoreToService(join20(path9)),
4033
+ addDataStoreToService: addDataStoreToService(join22(path9)),
3825
4034
  /**
3826
4035
  * Add a command to a service by it's id.
3827
4036
  *
@@ -3841,7 +4050,7 @@ var src_default = (path9) => {
3841
4050
  *
3842
4051
  * ```
3843
4052
  */
3844
- addCommandToService: addMessageToService(join20(path9)),
4053
+ addCommandToService: addMessageToService(join22(path9)),
3845
4054
  /**
3846
4055
  * Add a query to a service by it's id.
3847
4056
  *
@@ -3861,7 +4070,7 @@ var src_default = (path9) => {
3861
4070
  *
3862
4071
  * ```
3863
4072
  */
3864
- addQueryToService: addMessageToService(join20(path9)),
4073
+ addQueryToService: addMessageToService(join22(path9)),
3865
4074
  /**
3866
4075
  * Add an entity to a service by its id.
3867
4076
  *
@@ -3879,7 +4088,7 @@ var src_default = (path9) => {
3879
4088
  *
3880
4089
  * ```
3881
4090
  */
3882
- addEntityToService: addEntityToService(join20(path9)),
4091
+ addEntityToService: addEntityToService(join22(path9)),
3883
4092
  /**
3884
4093
  * Check to see if a service exists by it's path.
3885
4094
  *
@@ -3896,36 +4105,57 @@ var src_default = (path9) => {
3896
4105
  * @param path - The path to the service to check
3897
4106
  * @returns boolean
3898
4107
  */
3899
- isService: isService(join20(path9)),
4108
+ isService: isService(join22(path9)),
3900
4109
  /**
3901
4110
  * Converts a file to a service.
3902
4111
  * @param file - The file to convert to a service.
3903
4112
  * @returns The service.
3904
4113
  */
3905
- toService: toService(join20(path9)),
4114
+ toService: toService(join22(path9)),
4115
+ /**
4116
+ * ================================
4117
+ * Systems
4118
+ * ================================
4119
+ */
4120
+ writeSystem: writeSystem(join22(path9, "systems")),
4121
+ writeSystemToDomain: writeSystemToDomain(join22(path9)),
4122
+ getSystem: getSystem(join22(path9)),
4123
+ getSystemByPath: getSystemByPath(join22(path9)),
4124
+ getSystems: getSystems(join22(path9)),
4125
+ versionSystem: versionSystem(join22(path9)),
4126
+ rmSystem: rmSystem(join22(path9, "systems")),
4127
+ rmSystemById: rmSystemById(join22(path9)),
4128
+ addFileToSystem: addFileToSystem(join22(path9)),
4129
+ addServiceToSystem: addServiceToSystem(join22(path9)),
4130
+ addFlowToSystem: addFlowToSystem(join22(path9)),
4131
+ addEntityToSystem: addEntityToSystem(join22(path9)),
4132
+ addContainerToSystem: addContainerToSystem(join22(path9)),
4133
+ systemHasVersion: systemHasVersion(join22(path9)),
4134
+ isSystem: isSystem(join22(path9)),
4135
+ toSystem: toSystem(join22(path9)),
3906
4136
  /**
3907
4137
  * ================================
3908
4138
  * Agents
3909
4139
  * ================================
3910
4140
  */
3911
- writeAgent: writeAgent(join20(path9, "agents")),
3912
- writeVersionedAgent: writeVersionedAgent(join20(path9, "agents")),
3913
- writeAgentToDomain: writeAgentToDomain(join20(path9, "domains")),
3914
- getAgent: getAgent(join20(path9)),
3915
- getAgentByPath: getAgentByPath(join20(path9)),
3916
- getAgents: getAgents(join20(path9)),
3917
- versionAgent: versionAgent(join20(path9)),
3918
- rmAgent: rmAgent(join20(path9, "agents")),
3919
- rmAgentById: rmAgentById(join20(path9)),
3920
- addFileToAgent: addFileToAgent(join20(path9)),
3921
- addEventToAgent: addMessageToAgent(join20(path9)),
3922
- addCommandToAgent: addMessageToAgent(join20(path9)),
3923
- addQueryToAgent: addMessageToAgent(join20(path9)),
3924
- addDataStoreToAgent: addDataStoreToAgent(join20(path9)),
3925
- addFlowToAgent: addFlowToAgent(join20(path9)),
3926
- agentHasVersion: agentHasVersion(join20(path9)),
3927
- isAgent: isAgent(join20(path9)),
3928
- toAgent: toAgent(join20(path9)),
4141
+ writeAgent: writeAgent(join22(path9, "agents")),
4142
+ writeVersionedAgent: writeVersionedAgent(join22(path9, "agents")),
4143
+ writeAgentToDomain: writeAgentToDomain(join22(path9, "domains")),
4144
+ getAgent: getAgent(join22(path9)),
4145
+ getAgentByPath: getAgentByPath(join22(path9)),
4146
+ getAgents: getAgents(join22(path9)),
4147
+ versionAgent: versionAgent(join22(path9)),
4148
+ rmAgent: rmAgent(join22(path9, "agents")),
4149
+ rmAgentById: rmAgentById(join22(path9)),
4150
+ addFileToAgent: addFileToAgent(join22(path9)),
4151
+ addEventToAgent: addMessageToAgent(join22(path9)),
4152
+ addCommandToAgent: addMessageToAgent(join22(path9)),
4153
+ addQueryToAgent: addMessageToAgent(join22(path9)),
4154
+ addDataStoreToAgent: addDataStoreToAgent(join22(path9)),
4155
+ addFlowToAgent: addFlowToAgent(join22(path9)),
4156
+ agentHasVersion: agentHasVersion(join22(path9)),
4157
+ isAgent: isAgent(join22(path9)),
4158
+ toAgent: toAgent(join22(path9)),
3929
4159
  /**
3930
4160
  * ================================
3931
4161
  * Domains
@@ -3938,39 +4168,39 @@ var src_default = (path9) => {
3938
4168
  * @param options - Optional options to write the event
3939
4169
  *
3940
4170
  */
3941
- writeDomain: writeDomain(join20(path9, "domains")),
4171
+ writeDomain: writeDomain(join22(path9, "domains")),
3942
4172
  /**
3943
4173
  * Returns a domain from EventCatalog
3944
4174
  * @param id - The id of the domain to retrieve
3945
4175
  * @param version - Optional id of the version to get (supports semver)
3946
4176
  * @returns Domain|Undefined
3947
4177
  */
3948
- getDomain: getDomain(join20(path9, "domains")),
4178
+ getDomain: getDomain(join22(path9, "domains")),
3949
4179
  /**
3950
4180
  * Returns all domains from EventCatalog
3951
4181
  * @param latestOnly - optional boolean, set to true to get only latest versions
3952
4182
  * @returns Domain[]|Undefined
3953
4183
  */
3954
- getDomains: getDomains(join20(path9)),
4184
+ getDomains: getDomains(join22(path9)),
3955
4185
  /**
3956
4186
  * Moves a given domain id to the version directory
3957
4187
  * @param directory
3958
4188
  */
3959
- versionDomain: versionDomain(join20(path9, "domains")),
4189
+ versionDomain: versionDomain(join22(path9, "domains")),
3960
4190
  /**
3961
4191
  * Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
3962
4192
  *
3963
4193
  * @param path - The path to your domain, e.g. `/Payment`
3964
4194
  *
3965
4195
  */
3966
- rmDomain: rmDomain(join20(path9, "domains")),
4196
+ rmDomain: rmDomain(join22(path9, "domains")),
3967
4197
  /**
3968
4198
  * Remove an service by an domain id
3969
4199
  *
3970
4200
  * @param id - The id of the domain you want to remove
3971
4201
  *
3972
4202
  */
3973
- rmDomainById: rmDomainById(join20(path9, "domains")),
4203
+ rmDomainById: rmDomainById(join22(path9, "domains")),
3974
4204
  /**
3975
4205
  * Adds a file to the given domain
3976
4206
  * @param id - The id of the domain to add the file to
@@ -3978,28 +4208,28 @@ var src_default = (path9) => {
3978
4208
  * @param version - Optional version of the domain to add the file to
3979
4209
  * @returns
3980
4210
  */
3981
- addFileToDomain: addFileToDomain(join20(path9, "domains")),
4211
+ addFileToDomain: addFileToDomain(join22(path9, "domains")),
3982
4212
  /**
3983
4213
  * Adds an ubiquitous language dictionary to a domain
3984
4214
  * @param id - The id of the domain to add the ubiquitous language to
3985
4215
  * @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
3986
4216
  * @param version - Optional version of the domain to add the ubiquitous language to
3987
4217
  */
3988
- addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(join20(path9, "domains")),
4218
+ addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(join22(path9, "domains")),
3989
4219
  /**
3990
4220
  * Get the ubiquitous language dictionary from a domain
3991
4221
  * @param id - The id of the domain to get the ubiquitous language from
3992
4222
  * @param version - Optional version of the domain to get the ubiquitous language from
3993
4223
  * @returns
3994
4224
  */
3995
- getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(join20(path9, "domains")),
4225
+ getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(join22(path9, "domains")),
3996
4226
  /**
3997
4227
  * Check to see if a domain version exists
3998
4228
  * @param id - The id of the domain
3999
4229
  * @param version - The version of the domain (supports semver)
4000
4230
  * @returns
4001
4231
  */
4002
- domainHasVersion: domainHasVersion(join20(path9)),
4232
+ domainHasVersion: domainHasVersion(join22(path9)),
4003
4233
  /**
4004
4234
  * Adds a given service to a domain
4005
4235
  * @param id - The id of the domain
@@ -4007,7 +4237,7 @@ var src_default = (path9) => {
4007
4237
  * @param version - (Optional) The version of the domain to add the service to
4008
4238
  * @returns
4009
4239
  */
4010
- addServiceToDomain: addServiceToDomain(join20(path9, "domains")),
4240
+ addServiceToDomain: addServiceToDomain(join22(path9, "domains")),
4011
4241
  /**
4012
4242
  * Adds a given agent to a domain
4013
4243
  * @param id - The id of the domain
@@ -4015,7 +4245,7 @@ var src_default = (path9) => {
4015
4245
  * @param version - (Optional) The version of the domain to add the agent to
4016
4246
  * @returns
4017
4247
  */
4018
- addAgentToDomain: addAgentToDomain(join20(path9, "domains")),
4248
+ addAgentToDomain: addAgentToDomain(join22(path9, "domains")),
4019
4249
  /**
4020
4250
  * Adds a given subdomain to a domain
4021
4251
  * @param id - The id of the domain
@@ -4023,7 +4253,15 @@ var src_default = (path9) => {
4023
4253
  * @param version - (Optional) The version of the domain to add the subdomain to
4024
4254
  * @returns
4025
4255
  */
4026
- addSubDomainToDomain: addSubDomainToDomain(join20(path9, "domains")),
4256
+ addSubDomainToDomain: addSubDomainToDomain(join22(path9, "domains")),
4257
+ /**
4258
+ * Adds a given system to a domain
4259
+ * @param id - The id of the domain
4260
+ * @param system - The id and version of the system to add
4261
+ * @param version - (Optional) The version of the domain to add the system to
4262
+ * @returns
4263
+ */
4264
+ addSystemToDomain: addSystemToDomain(join22(path9, "domains")),
4027
4265
  /**
4028
4266
  * Adds an entity to a domain
4029
4267
  * @param id - The id of the domain
@@ -4031,7 +4269,7 @@ var src_default = (path9) => {
4031
4269
  * @param version - (Optional) The version of the domain to add the entity to
4032
4270
  * @returns
4033
4271
  */
4034
- addEntityToDomain: addEntityToDomain(join20(path9, "domains")),
4272
+ addEntityToDomain: addEntityToDomain(join22(path9, "domains")),
4035
4273
  /**
4036
4274
  * Add an event to a domain by its id.
4037
4275
  *
@@ -4049,7 +4287,7 @@ var src_default = (path9) => {
4049
4287
  *
4050
4288
  * ```
4051
4289
  */
4052
- addEventToDomain: addMessageToDomain(join20(path9, "domains")),
4290
+ addEventToDomain: addMessageToDomain(join22(path9, "domains")),
4053
4291
  /**
4054
4292
  * Add a command to a domain by its id.
4055
4293
  *
@@ -4067,7 +4305,7 @@ var src_default = (path9) => {
4067
4305
  *
4068
4306
  * ```
4069
4307
  */
4070
- addCommandToDomain: addMessageToDomain(join20(path9, "domains")),
4308
+ addCommandToDomain: addMessageToDomain(join22(path9, "domains")),
4071
4309
  /**
4072
4310
  * Add a query to a domain by its id.
4073
4311
  *
@@ -4085,7 +4323,7 @@ var src_default = (path9) => {
4085
4323
  *
4086
4324
  * ```
4087
4325
  */
4088
- addQueryToDomain: addMessageToDomain(join20(path9, "domains")),
4326
+ addQueryToDomain: addMessageToDomain(join22(path9, "domains")),
4089
4327
  /**
4090
4328
  * ================================
4091
4329
  * Teams
@@ -4098,25 +4336,25 @@ var src_default = (path9) => {
4098
4336
  * @param options - Optional options to write the team
4099
4337
  *
4100
4338
  */
4101
- writeTeam: writeTeam(join20(path9, "teams")),
4339
+ writeTeam: writeTeam(join22(path9, "teams")),
4102
4340
  /**
4103
4341
  * Returns a team from EventCatalog
4104
4342
  * @param id - The id of the team to retrieve
4105
4343
  * @returns Team|Undefined
4106
4344
  */
4107
- getTeam: getTeam(join20(path9, "teams")),
4345
+ getTeam: getTeam(join22(path9, "teams")),
4108
4346
  /**
4109
4347
  * Returns all teams from EventCatalog
4110
4348
  * @returns Team[]|Undefined
4111
4349
  */
4112
- getTeams: getTeams(join20(path9, "teams")),
4350
+ getTeams: getTeams(join22(path9, "teams")),
4113
4351
  /**
4114
4352
  * Remove a team by the team id
4115
4353
  *
4116
4354
  * @param id - The id of the team you want to remove
4117
4355
  *
4118
4356
  */
4119
- rmTeamById: rmTeamById(join20(path9, "teams")),
4357
+ rmTeamById: rmTeamById(join22(path9, "teams")),
4120
4358
  /**
4121
4359
  * ================================
4122
4360
  * Users
@@ -4129,25 +4367,25 @@ var src_default = (path9) => {
4129
4367
  * @param options - Optional options to write the user
4130
4368
  *
4131
4369
  */
4132
- writeUser: writeUser(join20(path9, "users")),
4370
+ writeUser: writeUser(join22(path9, "users")),
4133
4371
  /**
4134
4372
  * Returns a user from EventCatalog
4135
4373
  * @param id - The id of the user to retrieve
4136
4374
  * @returns User|Undefined
4137
4375
  */
4138
- getUser: getUser(join20(path9, "users")),
4376
+ getUser: getUser(join22(path9, "users")),
4139
4377
  /**
4140
4378
  * Returns all user from EventCatalog
4141
4379
  * @returns User[]|Undefined
4142
4380
  */
4143
- getUsers: getUsers(join20(path9)),
4381
+ getUsers: getUsers(join22(path9)),
4144
4382
  /**
4145
4383
  * Remove a user by the user id
4146
4384
  *
4147
4385
  * @param id - The id of the user you want to remove
4148
4386
  *
4149
4387
  */
4150
- rmUserById: rmUserById(join20(path9, "users")),
4388
+ rmUserById: rmUserById(join22(path9, "users")),
4151
4389
  /**
4152
4390
  * ================================
4153
4391
  * Custom Docs
@@ -4158,32 +4396,32 @@ var src_default = (path9) => {
4158
4396
  * @param path - The path to the custom doc to retrieve
4159
4397
  * @returns CustomDoc|Undefined
4160
4398
  */
4161
- getCustomDoc: getCustomDoc(join20(path9, "docs")),
4399
+ getCustomDoc: getCustomDoc(join22(path9, "docs")),
4162
4400
  /**
4163
4401
  * Returns all custom docs from EventCatalog
4164
4402
  * @param options - Optional options to get custom docs from a specific path
4165
4403
  * @returns CustomDoc[]|Undefined
4166
4404
  */
4167
- getCustomDocs: getCustomDocs(join20(path9, "docs")),
4405
+ getCustomDocs: getCustomDocs(join22(path9, "docs")),
4168
4406
  /**
4169
4407
  * Writes a custom doc to EventCatalog
4170
4408
  * @param customDoc - The custom doc to write
4171
4409
  * @param options - Optional options to write the custom doc
4172
4410
  *
4173
4411
  */
4174
- writeCustomDoc: writeCustomDoc(join20(path9, "docs")),
4412
+ writeCustomDoc: writeCustomDoc(join22(path9, "docs")),
4175
4413
  /**
4176
4414
  * Removes a custom doc from EventCatalog
4177
4415
  * @param path - The path to the custom doc to remove
4178
4416
  *
4179
4417
  */
4180
- rmCustomDoc: rmCustomDoc(join20(path9, "docs")),
4418
+ rmCustomDoc: rmCustomDoc(join22(path9, "docs")),
4181
4419
  /**
4182
4420
  * Dumps the catalog to a JSON file.
4183
4421
  * @param directory - The directory to dump the catalog to
4184
4422
  * @returns A JSON file with the catalog
4185
4423
  */
4186
- dumpCatalog: dumpCatalog(join20(path9)),
4424
+ dumpCatalog: dumpCatalog(join22(path9)),
4187
4425
  /**
4188
4426
  * Returns the event catalog configuration file.
4189
4427
  * The event catalog configuration file is the file that contains the configuration for the event catalog.
@@ -4191,7 +4429,7 @@ var src_default = (path9) => {
4191
4429
  * @param directory - The directory of the catalog.
4192
4430
  * @returns A JSON object with the configuration for the event catalog.
4193
4431
  */
4194
- getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(join20(path9)),
4432
+ getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(join22(path9)),
4195
4433
  /**
4196
4434
  * ================================
4197
4435
  * Changelogs
@@ -4205,7 +4443,7 @@ var src_default = (path9) => {
4205
4443
  * @param options - Optional options (version, format)
4206
4444
  *
4207
4445
  */
4208
- writeChangelog: writeChangelog(join20(path9)),
4446
+ writeChangelog: writeChangelog(join22(path9)),
4209
4447
  /**
4210
4448
  * Appends a changelog entry to an existing changelog for a resource.
4211
4449
  * If no changelog exists, one is created.
@@ -4215,7 +4453,7 @@ var src_default = (path9) => {
4215
4453
  * @param options - Optional options (version, format)
4216
4454
  *
4217
4455
  */
4218
- appendChangelog: appendChangelog(join20(path9)),
4456
+ appendChangelog: appendChangelog(join22(path9)),
4219
4457
  /**
4220
4458
  * Returns the changelog for a resource in EventCatalog
4221
4459
  *
@@ -4223,7 +4461,7 @@ var src_default = (path9) => {
4223
4461
  * @param options - Optional options (version)
4224
4462
  * @returns Changelog|Undefined
4225
4463
  */
4226
- getChangelog: getChangelog(join20(path9)),
4464
+ getChangelog: getChangelog(join22(path9)),
4227
4465
  /**
4228
4466
  * Removes the changelog for a resource in EventCatalog
4229
4467
  *
@@ -4231,7 +4469,7 @@ var src_default = (path9) => {
4231
4469
  * @param options - Optional options (version)
4232
4470
  *
4233
4471
  */
4234
- rmChangelog: rmChangelog(join20(path9)),
4472
+ rmChangelog: rmChangelog(join22(path9)),
4235
4473
  /**
4236
4474
  * ================================
4237
4475
  * Resources Utils
@@ -4260,26 +4498,26 @@ var src_default = (path9) => {
4260
4498
  * @param path - The path to the message to retrieve
4261
4499
  * @returns Message|Undefined
4262
4500
  */
4263
- getMessageBySchemaPath: getMessageBySchemaPath(join20(path9)),
4501
+ getMessageBySchemaPath: getMessageBySchemaPath(join22(path9)),
4264
4502
  /**
4265
4503
  * Returns the producers and consumers (services and agents) for a given message
4266
4504
  * @param id - The id of the message to get the producers and consumers for
4267
4505
  * @param version - Optional version of the message
4268
4506
  * @returns { producers: (Service|Agent)[], consumers: (Service|Agent)[] }
4269
4507
  */
4270
- getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join20(path9)),
4508
+ getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join22(path9)),
4271
4509
  /**
4272
4510
  * Returns the consumers of a given schema path
4273
4511
  * @param path - The path to the schema to get the consumers for
4274
4512
  * @returns (Service|Agent)[]
4275
4513
  */
4276
- getConsumersOfSchema: getConsumersOfSchema(join20(path9)),
4514
+ getConsumersOfSchema: getConsumersOfSchema(join22(path9)),
4277
4515
  /**
4278
4516
  * Returns the producers of a given schema path
4279
4517
  * @param path - The path to the schema to get the producers for
4280
4518
  * @returns (Service|Agent)[]
4281
4519
  */
4282
- getProducersOfSchema: getProducersOfSchema(join20(path9)),
4520
+ getProducersOfSchema: getProducersOfSchema(join22(path9)),
4283
4521
  /**
4284
4522
  * Returns the schema for a given message (event, command or query) by its id and version.
4285
4523
  * If no version is given, the latest version is used.
@@ -4287,14 +4525,14 @@ var src_default = (path9) => {
4287
4525
  * @param version - Optional version of the message
4288
4526
  * @returns { schema: string, fileName: string } | undefined
4289
4527
  */
4290
- getSchemaForMessage: getSchemaForMessage(join20(path9)),
4528
+ getSchemaForMessage: getSchemaForMessage(join22(path9)),
4291
4529
  /**
4292
4530
  * Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
4293
4531
  * @param id - The id of the resource to get the owners for
4294
4532
  * @param version - Optional version of the resource
4295
4533
  * @returns { owners: User[] }
4296
4534
  */
4297
- getOwnersForResource: getOwnersForResource(join20(path9)),
4535
+ getOwnersForResource: getOwnersForResource(join22(path9)),
4298
4536
  /**
4299
4537
  * ================================
4300
4538
  * Entities
@@ -4306,13 +4544,13 @@ var src_default = (path9) => {
4306
4544
  * @param version - Optional id of the version to get (supports semver)
4307
4545
  * @returns Entity|Undefined
4308
4546
  */
4309
- getEntity: getEntity(join20(path9)),
4547
+ getEntity: getEntity(join22(path9)),
4310
4548
  /**
4311
4549
  * Returns all entities from EventCatalog
4312
4550
  * @param latestOnly - optional boolean, set to true to get only latest versions
4313
4551
  * @returns Entity[]|Undefined
4314
4552
  */
4315
- getEntities: getEntities(join20(path9)),
4553
+ getEntities: getEntities(join22(path9)),
4316
4554
  /**
4317
4555
  * Adds an entity to EventCatalog
4318
4556
  *
@@ -4320,33 +4558,42 @@ var src_default = (path9) => {
4320
4558
  * @param options - Optional options to write the entity
4321
4559
  *
4322
4560
  */
4323
- writeEntity: writeEntity(join20(path9, "entities")),
4561
+ writeEntity: writeEntity(join22(path9, "entities")),
4562
+ /**
4563
+ * Adds an entity to a system in EventCatalog
4564
+ *
4565
+ * @param entity - The entity to write to the system
4566
+ * @param system - The system and its id to write the entity to
4567
+ * @param options - Optional options to write the entity
4568
+ *
4569
+ */
4570
+ writeEntityToSystem: writeEntityToSystem(join22(path9)),
4324
4571
  /**
4325
4572
  * Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
4326
4573
  *
4327
4574
  * @param path - The path to your entity, e.g. `/User`
4328
4575
  *
4329
4576
  */
4330
- rmEntity: rmEntity(join20(path9, "entities")),
4577
+ rmEntity: rmEntity(join22(path9, "entities")),
4331
4578
  /**
4332
4579
  * Remove an entity by an entity id
4333
4580
  *
4334
4581
  * @param id - The id of the entity you want to remove
4335
4582
  *
4336
4583
  */
4337
- rmEntityById: rmEntityById(join20(path9)),
4584
+ rmEntityById: rmEntityById(join22(path9)),
4338
4585
  /**
4339
4586
  * Moves a given entity id to the version directory
4340
4587
  * @param id - The id of the entity to version
4341
4588
  */
4342
- versionEntity: versionEntity(join20(path9)),
4589
+ versionEntity: versionEntity(join22(path9)),
4343
4590
  /**
4344
4591
  * Check to see if an entity version exists
4345
4592
  * @param id - The id of the entity
4346
4593
  * @param version - The version of the entity (supports semver)
4347
4594
  * @returns
4348
4595
  */
4349
- entityHasVersion: entityHasVersion(join20(path9)),
4596
+ entityHasVersion: entityHasVersion(join22(path9)),
4350
4597
  /**
4351
4598
  * ================================
4352
4599
  * Flows
@@ -4359,7 +4606,7 @@ var src_default = (path9) => {
4359
4606
  * @param version - Optional version of the flow
4360
4607
  * @returns Flow
4361
4608
  */
4362
- getFlow: getFlow(join20(path9)),
4609
+ getFlow: getFlow(join22(path9)),
4363
4610
  /**
4364
4611
  * Returns all flows from EventCatalog
4365
4612
  *
@@ -4367,7 +4614,7 @@ var src_default = (path9) => {
4367
4614
  * @param latestOnly - optional boolean, set to true to get only latest versions
4368
4615
  * @returns Flow[]|Undefined
4369
4616
  */
4370
- getFlows: getFlows(join20(path9)),
4617
+ getFlows: getFlows(join22(path9)),
4371
4618
  /**
4372
4619
  * Adds a flow to EventCatalog
4373
4620
  *
@@ -4375,14 +4622,14 @@ var src_default = (path9) => {
4375
4622
  * @param options - Optional options to write the flow
4376
4623
  *
4377
4624
  */
4378
- writeFlow: writeFlow(join20(path9, "flows")),
4625
+ writeFlow: writeFlow(join22(path9, "flows")),
4379
4626
  /**
4380
4627
  * Adds a versioned flow to EventCatalog
4381
4628
  *
4382
4629
  * @param flow - The flow to write
4383
4630
  *
4384
4631
  */
4385
- writeVersionedFlow: writeVersionedFlow(join20(path9, "flows")),
4632
+ writeVersionedFlow: writeVersionedFlow(join22(path9, "flows")),
4386
4633
  /**
4387
4634
  * Adds a flow to a domain in EventCatalog
4388
4635
  *
@@ -4391,7 +4638,7 @@ var src_default = (path9) => {
4391
4638
  * @param options - Optional options to write the flow
4392
4639
  *
4393
4640
  */
4394
- writeFlowToDomain: writeFlowToDomain(join20(path9, "domains")),
4641
+ writeFlowToDomain: writeFlowToDomain(join22(path9, "domains")),
4395
4642
  /**
4396
4643
  * Adds a flow to a service in EventCatalog
4397
4644
  *
@@ -4400,7 +4647,16 @@ var src_default = (path9) => {
4400
4647
  * @param options - Optional options to write the flow
4401
4648
  *
4402
4649
  */
4403
- writeFlowToService: writeFlowToService(join20(path9, "services")),
4650
+ writeFlowToService: writeFlowToService(join22(path9, "services")),
4651
+ /**
4652
+ * Adds a flow to a system in EventCatalog
4653
+ *
4654
+ * @param flow - The flow to write to the system
4655
+ * @param system - The system and its id to write the flow to
4656
+ * @param options - Optional options to write the flow
4657
+ *
4658
+ */
4659
+ writeFlowToSystem: writeFlowToSystem(join22(path9)),
4404
4660
  /**
4405
4661
  * Adds a flow to an agent in EventCatalog
4406
4662
  *
@@ -4409,33 +4665,33 @@ var src_default = (path9) => {
4409
4665
  * @param options - Optional options to write the flow
4410
4666
  *
4411
4667
  */
4412
- writeFlowToAgent: writeFlowToAgent(join20(path9, "agents")),
4668
+ writeFlowToAgent: writeFlowToAgent(join22(path9, "agents")),
4413
4669
  /**
4414
4670
  * Remove a flow from EventCatalog (modeled on the standard POSIX rm utility)
4415
4671
  *
4416
4672
  * @param path - The path to your flow, e.g. `/PaymentFlow`
4417
4673
  *
4418
4674
  */
4419
- rmFlow: rmFlow(join20(path9, "flows")),
4675
+ rmFlow: rmFlow(join22(path9, "flows")),
4420
4676
  /**
4421
4677
  * Remove a flow by a flow id
4422
4678
  *
4423
4679
  * @param id - The id of the flow you want to remove
4424
4680
  *
4425
4681
  */
4426
- rmFlowById: rmFlowById(join20(path9)),
4682
+ rmFlowById: rmFlowById(join22(path9)),
4427
4683
  /**
4428
4684
  * Moves a given flow id to the version directory
4429
4685
  * @param id - The id of the flow to version
4430
4686
  */
4431
- versionFlow: versionFlow(join20(path9)),
4687
+ versionFlow: versionFlow(join22(path9)),
4432
4688
  /**
4433
4689
  * Check to see if a flow version exists
4434
4690
  * @param id - The id of the flow
4435
4691
  * @param version - The version of the flow (supports semver)
4436
4692
  * @returns
4437
4693
  */
4438
- flowHasVersion: flowHasVersion(join20(path9)),
4694
+ flowHasVersion: flowHasVersion(join22(path9)),
4439
4695
  /**
4440
4696
  * Adds a file to the given flow
4441
4697
  * @param id - The id of the flow to add the file to
@@ -4443,7 +4699,7 @@ var src_default = (path9) => {
4443
4699
  * @param version - Optional version of the flow to add the file to
4444
4700
  * @returns
4445
4701
  */
4446
- addFileToFlow: addFileToFlow(join20(path9)),
4702
+ addFileToFlow: addFileToFlow(join22(path9)),
4447
4703
  /**
4448
4704
  * ================================
4449
4705
  * Data Stores
@@ -4455,42 +4711,42 @@ var src_default = (path9) => {
4455
4711
  * @param options - Optional options to write the data store
4456
4712
  *
4457
4713
  */
4458
- writeDataStore: writeDataStore(join20(path9, "containers")),
4714
+ writeDataStore: writeDataStore(join22(path9, "containers")),
4459
4715
  /**
4460
4716
  * Returns a data store from EventCatalog
4461
4717
  * @param id - The id of the data store to retrieve
4462
4718
  * @param version - Optional id of the version to get (supports semver)
4463
4719
  * @returns Container|Undefined
4464
4720
  */
4465
- getDataStore: getDataStore(join20(path9)),
4721
+ getDataStore: getDataStore(join22(path9)),
4466
4722
  /**
4467
4723
  * Returns all data stores from EventCatalog
4468
4724
  * @param latestOnly - optional boolean, set to true to get only latest versions
4469
4725
  * @returns Container[]|Undefined
4470
4726
  */
4471
- getDataStores: getDataStores(join20(path9)),
4727
+ getDataStores: getDataStores(join22(path9)),
4472
4728
  /**
4473
4729
  * Version a data store by its id
4474
4730
  * @param id - The id of the data store to version
4475
4731
  */
4476
- versionDataStore: versionDataStore(join20(path9, "containers")),
4732
+ versionDataStore: versionDataStore(join22(path9, "containers")),
4477
4733
  /**
4478
4734
  * Remove a data store by its path
4479
4735
  * @param path - The path to the data store to remove
4480
4736
  */
4481
- rmDataStore: rmDataStore(join20(path9, "containers")),
4737
+ rmDataStore: rmDataStore(join22(path9, "containers")),
4482
4738
  /**
4483
4739
  * Remove a data store by its id
4484
4740
  * @param id - The id of the data store to remove
4485
4741
  */
4486
- rmDataStoreById: rmDataStoreById(join20(path9)),
4742
+ rmDataStoreById: rmDataStoreById(join22(path9)),
4487
4743
  /**
4488
4744
  * Check to see if a data store version exists
4489
4745
  * @param id - The id of the data store
4490
4746
  * @param version - The version of the data store (supports semver)
4491
4747
  * @returns
4492
4748
  */
4493
- dataStoreHasVersion: dataStoreHasVersion(join20(path9)),
4749
+ dataStoreHasVersion: dataStoreHasVersion(join22(path9)),
4494
4750
  /**
4495
4751
  * Adds a file to a data store by its id
4496
4752
  * @param id - The id of the data store to add the file to
@@ -4498,14 +4754,21 @@ var src_default = (path9) => {
4498
4754
  * @param version - Optional version of the data store to add the file to
4499
4755
  * @returns
4500
4756
  */
4501
- addFileToDataStore: addFileToDataStore(join20(path9)),
4757
+ addFileToDataStore: addFileToDataStore(join22(path9)),
4502
4758
  /**
4503
4759
  * Writes a data store to a service by its id
4504
4760
  * @param dataStore - The data store to write
4505
4761
  * @param service - The service to write the data store to
4506
4762
  * @returns
4507
4763
  */
4508
- writeDataStoreToService: writeDataStoreToService(join20(path9)),
4764
+ writeDataStoreToService: writeDataStoreToService(join22(path9)),
4765
+ /**
4766
+ * Writes a data store to a system by its id
4767
+ * @param dataStore - The data store to write
4768
+ * @param system - The system to write the data store to
4769
+ * @returns
4770
+ */
4771
+ writeDataStoreToSystem: writeDataStoreToSystem(join22(path9)),
4509
4772
  /**
4510
4773
  * ================================
4511
4774
  * Data Products
@@ -4517,7 +4780,7 @@ var src_default = (path9) => {
4517
4780
  * @param options - Optional options to write the data product
4518
4781
  *
4519
4782
  */
4520
- writeDataProduct: writeDataProduct(join20(path9, "data-products")),
4783
+ writeDataProduct: writeDataProduct(join22(path9, "data-products")),
4521
4784
  /**
4522
4785
  * Writes a data product to a domain in EventCatalog
4523
4786
  * @param dataProduct - The data product to write
@@ -4525,43 +4788,43 @@ var src_default = (path9) => {
4525
4788
  * @param options - Optional options to write the data product
4526
4789
  *
4527
4790
  */
4528
- writeDataProductToDomain: writeDataProductToDomain(join20(path9, "domains")),
4791
+ writeDataProductToDomain: writeDataProductToDomain(join22(path9, "domains")),
4529
4792
  /**
4530
4793
  * Returns a data product from EventCatalog
4531
4794
  * @param id - The id of the data product to retrieve
4532
4795
  * @param version - Optional id of the version to get (supports semver)
4533
4796
  * @returns DataProduct|Undefined
4534
4797
  */
4535
- getDataProduct: getDataProduct(join20(path9)),
4798
+ getDataProduct: getDataProduct(join22(path9)),
4536
4799
  /**
4537
4800
  * Returns all data products from EventCatalog
4538
4801
  * @param latestOnly - optional boolean, set to true to get only latest versions
4539
4802
  * @returns DataProduct[]|Undefined
4540
4803
  */
4541
- getDataProducts: getDataProducts(join20(path9)),
4804
+ getDataProducts: getDataProducts(join22(path9)),
4542
4805
  /**
4543
4806
  * Version a data product by its id
4544
4807
  * @param id - The id of the data product to version
4545
4808
  */
4546
- versionDataProduct: versionDataProduct(join20(path9)),
4809
+ versionDataProduct: versionDataProduct(join22(path9)),
4547
4810
  /**
4548
4811
  * Remove a data product by its path
4549
4812
  * @param path - The path to the data product to remove
4550
4813
  */
4551
- rmDataProduct: rmDataProduct(join20(path9, "data-products")),
4814
+ rmDataProduct: rmDataProduct(join22(path9, "data-products")),
4552
4815
  /**
4553
4816
  * Remove a data product by its id
4554
4817
  * @param id - The id of the data product to remove
4555
4818
  * @param version - Optional version of the data product to remove
4556
4819
  */
4557
- rmDataProductById: rmDataProductById(join20(path9)),
4820
+ rmDataProductById: rmDataProductById(join22(path9)),
4558
4821
  /**
4559
4822
  * Check to see if a data product version exists
4560
4823
  * @param id - The id of the data product
4561
4824
  * @param version - The version of the data product (supports semver)
4562
4825
  * @returns
4563
4826
  */
4564
- dataProductHasVersion: dataProductHasVersion(join20(path9)),
4827
+ dataProductHasVersion: dataProductHasVersion(join22(path9)),
4565
4828
  /**
4566
4829
  * Adds a file to a data product by its id
4567
4830
  * @param id - The id of the data product to add the file to
@@ -4569,7 +4832,7 @@ var src_default = (path9) => {
4569
4832
  * @param version - Optional version of the data product to add the file to
4570
4833
  * @returns
4571
4834
  */
4572
- addFileToDataProduct: addFileToDataProduct(join20(path9)),
4835
+ addFileToDataProduct: addFileToDataProduct(join22(path9)),
4573
4836
  /**
4574
4837
  * Adds a data product to a domain
4575
4838
  * @param id - The id of the domain
@@ -4577,7 +4840,7 @@ var src_default = (path9) => {
4577
4840
  * @param version - (Optional) The version of the domain to add the data product to
4578
4841
  * @returns
4579
4842
  */
4580
- addDataProductToDomain: addDataProductToDomain(join20(path9, "domains")),
4843
+ addDataProductToDomain: addDataProductToDomain(join22(path9, "domains")),
4581
4844
  /**
4582
4845
  * ================================
4583
4846
  * Diagrams
@@ -4589,13 +4852,13 @@ var src_default = (path9) => {
4589
4852
  * @param version - Optional id of the version to get (supports semver)
4590
4853
  * @returns Diagram|Undefined
4591
4854
  */
4592
- getDiagram: getDiagram(join20(path9)),
4855
+ getDiagram: getDiagram(join22(path9)),
4593
4856
  /**
4594
4857
  * Returns all diagrams from EventCatalog
4595
4858
  * @param latestOnly - optional boolean, set to true to get only latest versions
4596
4859
  * @returns Diagram[]|Undefined
4597
4860
  */
4598
- getDiagrams: getDiagrams(join20(path9)),
4861
+ getDiagrams: getDiagrams(join22(path9)),
4599
4862
  /**
4600
4863
  * Adds a diagram to EventCatalog
4601
4864
  *
@@ -4603,33 +4866,33 @@ var src_default = (path9) => {
4603
4866
  * @param options - Optional options to write the diagram
4604
4867
  *
4605
4868
  */
4606
- writeDiagram: writeDiagram(join20(path9, "diagrams")),
4869
+ writeDiagram: writeDiagram(join22(path9, "diagrams")),
4607
4870
  /**
4608
4871
  * Remove a diagram from EventCatalog (modeled on the standard POSIX rm utility)
4609
4872
  *
4610
4873
  * @param path - The path to your diagram, e.g. `/ArchitectureDiagram`
4611
4874
  *
4612
4875
  */
4613
- rmDiagram: rmDiagram(join20(path9, "diagrams")),
4876
+ rmDiagram: rmDiagram(join22(path9, "diagrams")),
4614
4877
  /**
4615
4878
  * Remove a diagram by a diagram id
4616
4879
  *
4617
4880
  * @param id - The id of the diagram you want to remove
4618
4881
  *
4619
4882
  */
4620
- rmDiagramById: rmDiagramById(join20(path9)),
4883
+ rmDiagramById: rmDiagramById(join22(path9)),
4621
4884
  /**
4622
4885
  * Moves a given diagram id to the version directory
4623
4886
  * @param id - The id of the diagram to version
4624
4887
  */
4625
- versionDiagram: versionDiagram(join20(path9)),
4888
+ versionDiagram: versionDiagram(join22(path9)),
4626
4889
  /**
4627
4890
  * Check to see if a diagram version exists
4628
4891
  * @param id - The id of the diagram
4629
4892
  * @param version - The version of the diagram (supports semver)
4630
4893
  * @returns
4631
4894
  */
4632
- diagramHasVersion: diagramHasVersion(join20(path9)),
4895
+ diagramHasVersion: diagramHasVersion(join22(path9)),
4633
4896
  /**
4634
4897
  * Adds a file to the given diagram
4635
4898
  * @param id - The id of the diagram to add the file to
@@ -4637,7 +4900,20 @@ var src_default = (path9) => {
4637
4900
  * @param version - Optional version of the diagram to add the file to
4638
4901
  * @returns
4639
4902
  */
4640
- addFileToDiagram: addFileToDiagram(join20(path9)),
4903
+ addFileToDiagram: addFileToDiagram(join22(path9)),
4904
+ /**
4905
+ * ================================
4906
+ * ADRs
4907
+ * ================================
4908
+ */
4909
+ getAdr: getAdr(join22(path9)),
4910
+ getAdrs: getAdrs(join22(path9)),
4911
+ writeAdr: writeAdr(join22(path9, "adrs")),
4912
+ rmAdr: rmAdr(join22(path9, "adrs")),
4913
+ rmAdrById: rmAdrById(join22(path9)),
4914
+ versionAdr: versionAdr(join22(path9)),
4915
+ adrHasVersion: adrHasVersion(join22(path9)),
4916
+ addFileToAdr: addFileToAdr(join22(path9)),
4641
4917
  /**
4642
4918
  * ================================
4643
4919
  * DSL
@@ -4656,21 +4932,21 @@ var src_default = (path9) => {
4656
4932
  * const dsl = await sdk.toDSL(services, { type: 'service', hydrate: true });
4657
4933
  * ```
4658
4934
  */
4659
- createSnapshot: createSnapshot(join20(path9)),
4660
- diffSnapshots: diffSnapshots(join20(path9)),
4661
- listSnapshots: listSnapshots(join20(path9)),
4662
- toDSL: toDSL(join20(path9), {
4663
- getEvent: getEvent(join20(path9)),
4664
- getCommand: getCommand(join20(path9)),
4665
- getQuery: getQuery(join20(path9)),
4666
- getService: getService(join20(path9)),
4667
- getServices: getServices(join20(path9)),
4668
- getDomain: getDomain(join20(path9, "domains")),
4669
- getChannel: getChannel(join20(path9)),
4670
- getChannels: getChannels(join20(path9)),
4671
- getContainer: getDataStore(join20(path9)),
4672
- getTeam: getTeam(join20(path9, "teams")),
4673
- getUser: getUser(join20(path9, "users"))
4935
+ createSnapshot: createSnapshot(join22(path9)),
4936
+ diffSnapshots: diffSnapshots(join22(path9)),
4937
+ listSnapshots: listSnapshots(join22(path9)),
4938
+ toDSL: toDSL(join22(path9), {
4939
+ getEvent: getEvent(join22(path9)),
4940
+ getCommand: getCommand(join22(path9)),
4941
+ getQuery: getQuery(join22(path9)),
4942
+ getService: getService(join22(path9)),
4943
+ getServices: getServices(join22(path9)),
4944
+ getDomain: getDomain(join22(path9, "domains")),
4945
+ getChannel: getChannel(join22(path9)),
4946
+ getChannels: getChannels(join22(path9)),
4947
+ getContainer: getDataStore(join22(path9)),
4948
+ getTeam: getTeam(join22(path9, "teams")),
4949
+ getUser: getUser(join22(path9, "users"))
4674
4950
  })
4675
4951
  };
4676
4952
  };