@eventcatalog/sdk 2.21.2 → 2.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/index.ts
2
- import { join as join19 } from "path";
2
+ import { join as join20 } from "path";
3
3
 
4
4
  // src/dsl/utils.ts
5
5
  import { globSync } from "glob";
@@ -1144,6 +1144,15 @@ var writeEventToService = (directory) => async (event, service, options = { path
1144
1144
  pathForEvent = join3(pathForEvent, event.id);
1145
1145
  await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
1146
1146
  };
1147
+ var writeEventToAgent = (directory) => async (event, agent, options = { path: "", format: "mdx", override: false }) => {
1148
+ const resourcePath = await getResourcePath(directory, agent.id, agent.version);
1149
+ if (!resourcePath) {
1150
+ throw new Error("Agent not found");
1151
+ }
1152
+ let pathForEvent = agent.version && agent.version !== "latest" ? `${resourcePath.directory}/versioned/${agent.version}/events` : `${resourcePath.directory}/events`;
1153
+ pathForEvent = join3(pathForEvent, event.id);
1154
+ await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
1155
+ };
1147
1156
  var rmEvent = (directory) => async (path8) => {
1148
1157
  await fs2.rm(join3(directory, path8), { recursive: true });
1149
1158
  invalidateFileCache();
@@ -1184,6 +1193,15 @@ var writeCommandToService = (directory) => async (command, service, options = {
1184
1193
  pathForCommand = join4(pathForCommand, command.id);
1185
1194
  await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
1186
1195
  };
1196
+ var writeCommandToAgent = (directory) => async (command, agent, options = { path: "", format: "mdx", override: false }) => {
1197
+ const resourcePath = await getResourcePath(directory, agent.id, agent.version);
1198
+ if (!resourcePath) {
1199
+ throw new Error("Agent not found");
1200
+ }
1201
+ let pathForCommand = agent.version && agent.version !== "latest" ? `${resourcePath.directory}/versioned/${agent.version}/commands` : `${resourcePath.directory}/commands`;
1202
+ pathForCommand = join4(pathForCommand, command.id);
1203
+ await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
1204
+ };
1187
1205
  var rmCommand = (directory) => async (path8) => {
1188
1206
  await fs3.rm(join4(directory, path8), { recursive: true });
1189
1207
  invalidateFileCache();
@@ -1222,6 +1240,15 @@ var writeQueryToService = (directory) => async (query, service, options = { path
1222
1240
  pathForQuery = join5(pathForQuery, query.id);
1223
1241
  await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
1224
1242
  };
1243
+ var writeQueryToAgent = (directory) => async (query, agent, options = { path: "", format: "mdx", override: false }) => {
1244
+ const resourcePath = await getResourcePath(directory, agent.id, agent.version);
1245
+ if (!resourcePath) {
1246
+ throw new Error("Agent not found");
1247
+ }
1248
+ let pathForQuery = agent.version && agent.version !== "latest" ? `${resourcePath.directory}/versioned/${agent.version}/queries` : `${resourcePath.directory}/queries`;
1249
+ pathForQuery = join5(pathForQuery, query.id);
1250
+ await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
1251
+ };
1225
1252
  var rmQuery = (directory) => async (path8) => {
1226
1253
  await fs4.rm(join5(directory, path8), { recursive: true });
1227
1254
  invalidateFileCache();
@@ -1432,9 +1459,146 @@ var addDataStoreToService = (directory) => async (id, operation, dataStore, vers
1432
1459
  await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
1433
1460
  };
1434
1461
 
1435
- // src/domains.ts
1462
+ // src/agents.ts
1436
1463
  import fs6 from "fs/promises";
1437
- import path2, { join as join7 } from "path";
1464
+ import { extname as extname2, join as join7, relative as relative3 } from "path";
1465
+ var rewriteAgent = async (directory, id, agent, version) => {
1466
+ const agentPath = await getResourcePath(directory, id, version);
1467
+ if (!agentPath) {
1468
+ throw new Error(`Cannot find agent ${id} in the catalog`);
1469
+ }
1470
+ const extension = extname2(agentPath.fullPath);
1471
+ await rmAgentById(directory)(id, version, true);
1472
+ await writeAgent(directory)(agent, { path: agentPath.directory, format: extension === ".md" ? "md" : "mdx" });
1473
+ };
1474
+ var getAgent = (directory) => async (id, version) => getResource(directory, id, version, { type: "agent" });
1475
+ var getAgentByPath = (directory) => async (path8) => {
1476
+ const agent = await getResource(directory, void 0, void 0, { type: "agent" }, path8);
1477
+ return agent;
1478
+ };
1479
+ var getAgents = (directory) => async (options) => getResources(directory, {
1480
+ type: "agents",
1481
+ ignore: [
1482
+ "**/events/**",
1483
+ "**/commands/**",
1484
+ "**/queries/**",
1485
+ "**/entities/**",
1486
+ "**/channels/**",
1487
+ "**/containers/**",
1488
+ "**/data-products/**",
1489
+ "**/data-stores/**",
1490
+ "**/flows/**"
1491
+ ],
1492
+ ...options
1493
+ });
1494
+ var writeAgent = (directory) => async (agent, options = {
1495
+ path: "",
1496
+ override: false,
1497
+ format: "mdx"
1498
+ }) => {
1499
+ const resource = { ...agent };
1500
+ if (Array.isArray(agent.sends)) {
1501
+ resource.sends = uniqueVersions(agent.sends);
1502
+ }
1503
+ if (Array.isArray(agent.receives)) {
1504
+ resource.receives = uniqueVersions(agent.receives);
1505
+ }
1506
+ return await writeResource(directory, resource, { ...options, type: "agent" });
1507
+ };
1508
+ var writeVersionedAgent = (directory) => async (agent) => {
1509
+ const path8 = getVersionedDirectory(agent.id, agent.version);
1510
+ return await writeAgent(directory)({ ...agent }, { path: path8 });
1511
+ };
1512
+ var writeAgentToDomain = (directory) => async (agent, domain, options = { path: "", format: "mdx", override: false }) => {
1513
+ let pathForAgent = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/agents` : `/${domain.id}/agents`;
1514
+ pathForAgent = join7(pathForAgent, agent.id);
1515
+ await writeResource(directory, { ...agent }, { ...options, path: pathForAgent, type: "agent" });
1516
+ };
1517
+ var versionAgent = (directory) => async (id) => versionResource(directory, id);
1518
+ var rmAgent = (directory) => async (path8) => {
1519
+ await fs6.rm(join7(directory, path8), { recursive: true });
1520
+ invalidateFileCache();
1521
+ };
1522
+ var rmAgentById = (directory) => async (id, version, persistFiles) => {
1523
+ await rmResourceById(directory, id, version, { type: "agent", persistFiles });
1524
+ };
1525
+ var addFileToAgent = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
1526
+ var addMessageToAgent = (directory) => async (id, direction, message, version) => {
1527
+ const agent = await getAgent(directory)(id, version);
1528
+ if (direction === "sends") {
1529
+ if (agent.sends === void 0) {
1530
+ agent.sends = [];
1531
+ }
1532
+ for (let i = 0; i < agent.sends.length; i++) {
1533
+ if (agent.sends[i].id === message.id && agent.sends[i].version === message.version) {
1534
+ return;
1535
+ }
1536
+ }
1537
+ agent.sends.push(buildMessagePointer(message));
1538
+ } else if (direction === "receives") {
1539
+ if (agent.receives === void 0) {
1540
+ agent.receives = [];
1541
+ }
1542
+ for (let i = 0; i < agent.receives.length; i++) {
1543
+ if (agent.receives[i].id === message.id && agent.receives[i].version === message.version) {
1544
+ return;
1545
+ }
1546
+ }
1547
+ agent.receives.push(buildMessagePointer(message));
1548
+ } else {
1549
+ throw new Error(`Direction ${direction} is invalid, only 'receives' and 'sends' are supported`);
1550
+ }
1551
+ await rewriteAgent(directory, id, agent, version);
1552
+ };
1553
+ var addDataStoreToAgent = (directory) => async (id, direction, dataStore, version) => {
1554
+ const agent = await getAgent(directory)(id, version);
1555
+ if (direction === "writesTo") {
1556
+ if (agent.writesTo === void 0) {
1557
+ agent.writesTo = [];
1558
+ }
1559
+ if (agent.writesTo.some((store) => store.id === dataStore.id && store.version === dataStore.version)) {
1560
+ return;
1561
+ }
1562
+ agent.writesTo.push(dataStore);
1563
+ } else if (direction === "readsFrom") {
1564
+ if (agent.readsFrom === void 0) {
1565
+ agent.readsFrom = [];
1566
+ }
1567
+ if (agent.readsFrom.some((store) => store.id === dataStore.id && store.version === dataStore.version)) {
1568
+ return;
1569
+ }
1570
+ agent.readsFrom.push(dataStore);
1571
+ } else {
1572
+ throw new Error(`Direction ${direction} is invalid, only 'writesTo' and 'readsFrom' are supported`);
1573
+ }
1574
+ await rewriteAgent(directory, id, agent, version);
1575
+ };
1576
+ var addFlowToAgent = (directory) => async (id, flow, version) => {
1577
+ const agent = await getAgent(directory)(id, version);
1578
+ if (agent.flows === void 0) {
1579
+ agent.flows = [];
1580
+ }
1581
+ if (agent.flows.some((f) => f.id === flow.id && f.version === flow.version)) {
1582
+ return;
1583
+ }
1584
+ agent.flows.push(flow);
1585
+ await rewriteAgent(directory, id, agent, version);
1586
+ };
1587
+ var agentHasVersion = (directory) => async (id, version) => {
1588
+ const file = await findFileById(directory, id, version);
1589
+ return !!file;
1590
+ };
1591
+ var isAgent = (directory) => async (path8) => {
1592
+ const agent = await getAgentByPath(directory)(path8);
1593
+ const relativePath = relative3(directory, path8);
1594
+ const segments = relativePath.split(/[/\\]+/);
1595
+ return !!agent && segments.includes("agents");
1596
+ };
1597
+ var toAgent = (directory) => async (file) => toResource(directory, file);
1598
+
1599
+ // src/domains.ts
1600
+ import fs7 from "fs/promises";
1601
+ import path2, { join as join8 } from "path";
1438
1602
  import fsSync3 from "fs";
1439
1603
  import matter3 from "gray-matter";
1440
1604
  var resolveDomainWriteDirectory = async (directory, id, version) => {
@@ -1451,7 +1615,15 @@ var resolveDomainWriteDirectory = async (directory, id, version) => {
1451
1615
  var getDomain = (directory) => async (id, version) => getResource(directory, id, version, { type: "domain" });
1452
1616
  var getDomains = (directory) => async (options) => getResources(directory, {
1453
1617
  type: "domains",
1454
- ignore: ["**/services/**", "**/events/**", "**/commands/**", "**/queries/**", "**/flows/**", "**/entities/**"],
1618
+ ignore: [
1619
+ "**/services/**",
1620
+ "**/agents/**",
1621
+ "**/events/**",
1622
+ "**/commands/**",
1623
+ "**/queries/**",
1624
+ "**/flows/**",
1625
+ "**/entities/**"
1626
+ ],
1455
1627
  ...options
1456
1628
  });
1457
1629
  var writeDomain = (directory) => async (domain, options = {
@@ -1464,6 +1636,9 @@ var writeDomain = (directory) => async (domain, options = {
1464
1636
  if (Array.isArray(domain.services)) {
1465
1637
  resource.services = uniqueVersions(domain.services);
1466
1638
  }
1639
+ if (Array.isArray(domain.agents)) {
1640
+ resource.agents = uniqueVersions(domain.agents);
1641
+ }
1467
1642
  if (Array.isArray(domain.domains)) {
1468
1643
  resource.domains = uniqueVersions(domain.domains);
1469
1644
  }
@@ -1480,7 +1655,7 @@ var writeDomain = (directory) => async (domain, options = {
1480
1655
  };
1481
1656
  var versionDomain = (directory) => async (id) => versionResource(directory, id);
1482
1657
  var rmDomain = (directory) => async (path8) => {
1483
- await fs6.rm(join7(directory, path8), { recursive: true });
1658
+ await fs7.rm(join8(directory, path8), { recursive: true });
1484
1659
  invalidateFileCache();
1485
1660
  };
1486
1661
  var rmDomainById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "domain", persistFiles });
@@ -1521,6 +1696,22 @@ var addServiceToDomain = (directory) => async (id, service, version) => {
1521
1696
  await rmDomainById(directory)(id, version, true);
1522
1697
  await writeDomain(writeDir)(domain, { format: extension === ".md" ? "md" : "mdx" });
1523
1698
  };
1699
+ var addAgentToDomain = (directory) => async (id, agent, version) => {
1700
+ let domain = await getDomain(directory)(id, version);
1701
+ const domainPath = await getResourcePath(directory, id, version);
1702
+ const extension = path2.extname(domainPath?.fullPath || "");
1703
+ if (domain.agents === void 0) {
1704
+ domain.agents = [];
1705
+ }
1706
+ const agentExistsInList = domain.agents.some((a) => a.id === agent.id && a.version === agent.version);
1707
+ if (agentExistsInList) {
1708
+ return;
1709
+ }
1710
+ domain.agents.push(agent);
1711
+ const writeDir = await resolveDomainWriteDirectory(directory, id, version);
1712
+ await rmDomainById(directory)(id, version, true);
1713
+ await writeDomain(writeDir)(domain, { format: extension === ".md" ? "md" : "mdx" });
1714
+ };
1524
1715
  var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
1525
1716
  let domain = await getDomain(directory)(id, version);
1526
1717
  const domainPath = await getResourcePath(directory, id, version);
@@ -1604,13 +1795,13 @@ var addMessageToDomain = (directory) => async (id, direction, message, version)
1604
1795
  };
1605
1796
 
1606
1797
  // src/channels.ts
1607
- import fs7 from "fs/promises";
1608
- import { join as join8, extname as extname2 } from "path";
1798
+ import fs8 from "fs/promises";
1799
+ import { join as join9, extname as extname3 } from "path";
1609
1800
  var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
1610
1801
  var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
1611
1802
  var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
1612
1803
  var rmChannel = (directory) => async (path8) => {
1613
- await fs7.rm(join8(directory, path8), { recursive: true });
1804
+ await fs8.rm(join9(directory, path8), { recursive: true });
1614
1805
  invalidateFileCache();
1615
1806
  };
1616
1807
  var rmChannelById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "channel", persistFiles });
@@ -1641,7 +1832,7 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
1641
1832
  const { getMessage: getMessage2, rmMessageById, writeMessage } = functions[collection];
1642
1833
  const message = await getMessage2(directory)(_message.id, _message.version);
1643
1834
  const messagePath = await getResourcePath(directory, _message.id, _message.version);
1644
- const extension = extname2(messagePath?.fullPath || "");
1835
+ const extension = extname3(messagePath?.fullPath || "");
1645
1836
  if (!message) throw new Error(`Message ${_message.id} with version ${_message.version} not found`);
1646
1837
  if (message.channels === void 0) {
1647
1838
  message.channels = [];
@@ -1653,13 +1844,13 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
1653
1844
  throw new Error(`Cannot find message ${id} in the catalog`);
1654
1845
  }
1655
1846
  const path8 = existingResource.split(`/[\\/]+${collection}`)[0];
1656
- const pathToResource = join8(path8, collection);
1847
+ const pathToResource = join9(path8, collection);
1657
1848
  await rmMessageById(directory)(_message.id, _message.version, true);
1658
1849
  await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
1659
1850
  };
1660
1851
 
1661
1852
  // src/messages.ts
1662
- import { dirname as dirname5, join as join9 } from "path";
1853
+ import { dirname as dirname5, join as join10 } from "path";
1663
1854
  import fsSync4 from "fs";
1664
1855
  import matter4 from "gray-matter";
1665
1856
  import { satisfies as satisfies4, validRange as validRange3 } from "semver";
@@ -1690,7 +1881,10 @@ var getMessageBySchemaPath = (directory) => async (path8, options) => {
1690
1881
  }
1691
1882
  };
1692
1883
  var getProducersAndConsumersForMessage = (directory) => async (id, version, options) => {
1693
- const services = await getServices(directory)({ latestOnly: options?.latestOnly ?? true });
1884
+ const [services = [], agents = []] = await Promise.all([
1885
+ getServices(directory)({ latestOnly: options?.latestOnly ?? true }),
1886
+ getAgents(directory)({ latestOnly: options?.latestOnly ?? true })
1887
+ ]);
1694
1888
  const message = await getResource(directory, id, version, { type: "message" });
1695
1889
  const isMessageLatestVersion = await isLatestVersion(directory, id, version);
1696
1890
  if (!message) {
@@ -1698,11 +1892,11 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
1698
1892
  }
1699
1893
  const producers = [];
1700
1894
  const consumers = [];
1701
- for (const service of services) {
1702
- const servicePublishesMessage = service.sends?.some((_message) => {
1895
+ for (const participant of [...services, ...agents]) {
1896
+ const participantPublishesMessage = participant.sends?.some((_message) => {
1703
1897
  if (_message.version) {
1704
- const isServiceUsingSemverRange = validRange3(_message.version);
1705
- if (isServiceUsingSemverRange) {
1898
+ const isParticipantUsingSemverRange = validRange3(_message.version);
1899
+ if (isParticipantUsingSemverRange) {
1706
1900
  return _message.id === message.id && satisfies4(message.version, _message.version);
1707
1901
  } else {
1708
1902
  return _message.id === message.id && message.version === _message.version;
@@ -1713,10 +1907,10 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
1713
1907
  }
1714
1908
  return false;
1715
1909
  });
1716
- const serviceSubscribesToMessage = service.receives?.some((_message) => {
1910
+ const participantSubscribesToMessage = participant.receives?.some((_message) => {
1717
1911
  if (_message.version) {
1718
- const isServiceUsingSemverRange = validRange3(_message.version);
1719
- if (isServiceUsingSemverRange) {
1912
+ const isParticipantUsingSemverRange = validRange3(_message.version);
1913
+ if (isParticipantUsingSemverRange) {
1720
1914
  return _message.id === message.id && satisfies4(message.version, _message.version);
1721
1915
  } else {
1722
1916
  return _message.id === message.id && message.version === _message.version;
@@ -1727,11 +1921,11 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
1727
1921
  }
1728
1922
  return false;
1729
1923
  });
1730
- if (servicePublishesMessage) {
1731
- producers.push(service);
1924
+ if (participantPublishesMessage) {
1925
+ producers.push(participant);
1732
1926
  }
1733
- if (serviceSubscribesToMessage) {
1734
- consumers.push(service);
1927
+ if (participantSubscribesToMessage) {
1928
+ consumers.push(participant);
1735
1929
  }
1736
1930
  }
1737
1931
  return { producers, consumers };
@@ -1760,7 +1954,7 @@ var getSchemaForMessage = (directory) => async (id, version) => {
1760
1954
  const { data } = matter4.read(file);
1761
1955
  if (!data.schemaPath) return void 0;
1762
1956
  const resourceDirectory = dirname5(file);
1763
- const pathToSchema = join9(resourceDirectory, data.schemaPath);
1957
+ const pathToSchema = join10(resourceDirectory, data.schemaPath);
1764
1958
  if (!fsSync4.existsSync(pathToSchema)) return void 0;
1765
1959
  const schema = fsSync4.readFileSync(pathToSchema, "utf8");
1766
1960
  return {
@@ -1770,9 +1964,9 @@ var getSchemaForMessage = (directory) => async (id, version) => {
1770
1964
  };
1771
1965
 
1772
1966
  // src/custom-docs.ts
1773
- import path3, { join as join10 } from "path";
1967
+ import path3, { join as join11 } from "path";
1774
1968
  import fsSync5 from "fs";
1775
- import fs8 from "fs/promises";
1969
+ import fs9 from "fs/promises";
1776
1970
  import matter5 from "gray-matter";
1777
1971
  import slugify from "slugify";
1778
1972
  var getCustomDoc = (directory) => async (filePath) => {
@@ -1803,20 +1997,20 @@ var writeCustomDoc = (directory) => async (customDoc, options = { path: "" }) =>
1803
1997
  };
1804
1998
  var rmCustomDoc = (directory) => async (filePath) => {
1805
1999
  const withExtension = filePath.endsWith(".mdx") ? filePath : `${filePath}.mdx`;
1806
- await fs8.rm(join10(directory, withExtension), { recursive: true });
2000
+ await fs9.rm(join11(directory, withExtension), { recursive: true });
1807
2001
  invalidateFileCache();
1808
2002
  };
1809
2003
 
1810
2004
  // src/teams.ts
1811
- import fs9 from "fs/promises";
2005
+ import fs10 from "fs/promises";
1812
2006
  import fsSync7 from "fs";
1813
- import { join as join12 } from "path";
2007
+ import { join as join13 } from "path";
1814
2008
  import matter7 from "gray-matter";
1815
2009
  import path4 from "path";
1816
2010
 
1817
2011
  // src/users.ts
1818
2012
  import fsSync6 from "fs";
1819
- import { join as join11 } from "path";
2013
+ import { join as join12 } from "path";
1820
2014
  import matter6 from "gray-matter";
1821
2015
  var getUser = (catalogDir) => async (id) => {
1822
2016
  const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);
@@ -1854,12 +2048,12 @@ var writeUser = (catalogDir) => async (user, options = {}) => {
1854
2048
  }
1855
2049
  const { markdown, ...frontmatter } = resource;
1856
2050
  const document = matter6.stringify(markdown, frontmatter);
1857
- fsSync6.mkdirSync(join11(catalogDir, ""), { recursive: true });
1858
- fsSync6.writeFileSync(join11(catalogDir, "", `${resource.id}.mdx`), document);
2051
+ fsSync6.mkdirSync(join12(catalogDir, ""), { recursive: true });
2052
+ fsSync6.writeFileSync(join12(catalogDir, "", `${resource.id}.mdx`), document);
1859
2053
  invalidateFileCache();
1860
2054
  };
1861
2055
  var rmUserById = (catalogDir) => async (id) => {
1862
- fsSync6.rmSync(join11(catalogDir, `${id}.mdx`), { recursive: true });
2056
+ fsSync6.rmSync(join12(catalogDir, `${id}.mdx`), { recursive: true });
1863
2057
  invalidateFileCache();
1864
2058
  };
1865
2059
 
@@ -1898,12 +2092,12 @@ var writeTeam = (catalogDir) => async (team, options = {}) => {
1898
2092
  }
1899
2093
  const { markdown, ...frontmatter } = resource;
1900
2094
  const document = matter7.stringify(markdown, frontmatter);
1901
- fsSync7.mkdirSync(join12(catalogDir, ""), { recursive: true });
1902
- fsSync7.writeFileSync(join12(catalogDir, "", `${resource.id}.mdx`), document);
2095
+ fsSync7.mkdirSync(join13(catalogDir, ""), { recursive: true });
2096
+ fsSync7.writeFileSync(join13(catalogDir, "", `${resource.id}.mdx`), document);
1903
2097
  invalidateFileCache();
1904
2098
  };
1905
2099
  var rmTeamById = (catalogDir) => async (id) => {
1906
- await fs9.rm(join12(catalogDir, `${id}.mdx`), { recursive: true });
2100
+ await fs10.rm(join13(catalogDir, `${id}.mdx`), { recursive: true });
1907
2101
  invalidateFileCache();
1908
2102
  };
1909
2103
  var getOwnersForResource = (catalogDir) => async (id, version) => {
@@ -1926,12 +2120,12 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
1926
2120
  };
1927
2121
 
1928
2122
  // src/eventcatalog.ts
1929
- import fs10 from "fs";
1930
- import path5, { join as join13 } from "path";
2123
+ import fs11 from "fs";
2124
+ import path5, { join as join14 } from "path";
1931
2125
  var DUMP_VERSION = "0.0.1";
1932
2126
  var getEventCatalogVersion = async (catalogDir) => {
1933
2127
  try {
1934
- const packageJson = fs10.readFileSync(join13(catalogDir, "package.json"), "utf8");
2128
+ const packageJson = fs11.readFileSync(join14(catalogDir, "package.json"), "utf8");
1935
2129
  const packageJsonObject = JSON.parse(packageJson);
1936
2130
  return packageJsonObject["dependencies"]["@eventcatalog/core"];
1937
2131
  } catch (error) {
@@ -1945,8 +2139,8 @@ var hydrateResource = async (catalogDir, resources = [], { attachSchema = false
1945
2139
  let schema = "";
1946
2140
  if (resource.schemaPath && resourcePath?.fullPath) {
1947
2141
  const pathToSchema = path5.join(path5.dirname(resourcePath?.fullPath), resource.schemaPath);
1948
- if (fs10.existsSync(pathToSchema)) {
1949
- schema = fs10.readFileSync(pathToSchema, "utf8");
2142
+ if (fs11.existsSync(pathToSchema)) {
2143
+ schema = fs11.readFileSync(pathToSchema, "utf8");
1950
2144
  }
1951
2145
  }
1952
2146
  const eventcatalog = schema ? { directory: resourcePath?.directory, schema } : { directory: resourcePath?.directory };
@@ -1965,7 +2159,7 @@ var filterCollection = (collection, options) => {
1965
2159
  };
1966
2160
  var getEventCatalogConfigurationFile = (directory) => async () => {
1967
2161
  try {
1968
- const path8 = join13(directory, "eventcatalog.config.js");
2162
+ const path8 = join14(directory, "eventcatalog.config.js");
1969
2163
  const configModule = await import(path8);
1970
2164
  return configModule.default;
1971
2165
  } catch (error) {
@@ -1977,6 +2171,7 @@ var dumpCatalog = (directory) => async (options) => {
1977
2171
  const {
1978
2172
  getDomains: getDomains2,
1979
2173
  getServices: getServices2,
2174
+ getAgents: getAgents2,
1980
2175
  getEvents: getEvents2,
1981
2176
  getQueries: getQueries2,
1982
2177
  getCommands: getCommands2,
@@ -1990,6 +2185,7 @@ var dumpCatalog = (directory) => async (options) => {
1990
2185
  const { includeMarkdown = true } = options || {};
1991
2186
  const domains = await getDomains2();
1992
2187
  const services = await getServices2();
2188
+ const agents = await getAgents2();
1993
2189
  const events = await getEvents2();
1994
2190
  const commands = await getCommands2();
1995
2191
  const queries = await getQueries2();
@@ -2002,6 +2198,7 @@ var dumpCatalog = (directory) => async (options) => {
2002
2198
  const [
2003
2199
  hydratedDomains,
2004
2200
  hydratedServices,
2201
+ hydratedAgents,
2005
2202
  hydratedEvents,
2006
2203
  hydratedQueries,
2007
2204
  hydratedCommands,
@@ -2014,6 +2211,7 @@ var dumpCatalog = (directory) => async (options) => {
2014
2211
  ] = await Promise.all([
2015
2212
  hydrateResource(directory, domains),
2016
2213
  hydrateResource(directory, services),
2214
+ hydrateResource(directory, agents),
2017
2215
  hydrateResource(directory, events),
2018
2216
  hydrateResource(directory, queries),
2019
2217
  hydrateResource(directory, commands),
@@ -2031,6 +2229,7 @@ var dumpCatalog = (directory) => async (options) => {
2031
2229
  resources: {
2032
2230
  domains: filterCollection(hydratedDomains, { includeMarkdown }),
2033
2231
  services: filterCollection(hydratedServices, { includeMarkdown }),
2232
+ agents: filterCollection(hydratedAgents, { includeMarkdown }),
2034
2233
  messages: {
2035
2234
  events: filterCollection(hydratedEvents, { includeMarkdown }),
2036
2235
  queries: filterCollection(hydratedQueries, { includeMarkdown }),
@@ -2047,7 +2246,7 @@ var dumpCatalog = (directory) => async (options) => {
2047
2246
  };
2048
2247
 
2049
2248
  // src/snapshots.ts
2050
- import fs11 from "fs";
2249
+ import fs12 from "fs";
2051
2250
  import path6 from "path";
2052
2251
  import { createHash } from "crypto";
2053
2252
  import { execSync } from "child_process";
@@ -2078,6 +2277,7 @@ var flattenResources = (snapshot) => {
2078
2277
  };
2079
2278
  addResources(snapshot.resources.domains, "domain");
2080
2279
  addResources(snapshot.resources.services, "service");
2280
+ addResources(snapshot.resources.agents || [], "agent");
2081
2281
  addResources(snapshot.resources.messages.events, "event");
2082
2282
  addResources(snapshot.resources.messages.commands, "command");
2083
2283
  addResources(snapshot.resources.messages.queries, "query");
@@ -2189,7 +2389,7 @@ var getRelationshipKey = (serviceId, resourceId, resourceVersion, direction) =>
2189
2389
  };
2190
2390
  var extractRelationships = (snapshot) => {
2191
2391
  const relationships = /* @__PURE__ */ new Map();
2192
- for (const service of snapshot.resources.services) {
2392
+ for (const service of [...snapshot.resources.services, ...snapshot.resources.agents || []]) {
2193
2393
  for (const direction of ["sends", "receives"]) {
2194
2394
  const pointers = service[direction] || [];
2195
2395
  for (const pointer of pointers) {
@@ -2227,7 +2427,7 @@ var computeRelationshipDiff = (snapshotA, snapshotB) => {
2227
2427
  var SNAPSHOT_VERSION = "1.0.0";
2228
2428
  var getEventCatalogVersion2 = (catalogDir) => {
2229
2429
  try {
2230
- const packageJson = fs11.readFileSync(path6.join(catalogDir, "package.json"), "utf8");
2430
+ const packageJson = fs12.readFileSync(path6.join(catalogDir, "package.json"), "utf8");
2231
2431
  const packageJsonObject = JSON.parse(packageJson);
2232
2432
  return packageJsonObject["dependencies"]?.["@eventcatalog/core"] ?? "unknown";
2233
2433
  } catch {
@@ -2283,9 +2483,10 @@ var createSnapshot = (directory) => {
2283
2483
  return async (options) => {
2284
2484
  const { label, outputDir, git } = options || {};
2285
2485
  const sdk = src_default(directory);
2286
- const [domains, services, events, commands, queries, channels] = await Promise.all([
2486
+ const [domains, services, agents, events, commands, queries, channels] = await Promise.all([
2287
2487
  sdk.getDomains(),
2288
2488
  sdk.getServices(),
2489
+ sdk.getAgents(),
2289
2490
  sdk.getEvents(),
2290
2491
  sdk.getCommands(),
2291
2492
  sdk.getQueries(),
@@ -2298,6 +2499,7 @@ var createSnapshot = (directory) => {
2298
2499
  ]);
2299
2500
  const snapshotDomains = stripToCore(domains);
2300
2501
  const snapshotServices = stripToCore(services);
2502
+ const snapshotAgents = stripToCore(agents);
2301
2503
  const snapshotEvents = stripToCore(events);
2302
2504
  const snapshotCommands = stripToCore(commands);
2303
2505
  const snapshotQueries = stripToCore(queries);
@@ -2313,6 +2515,7 @@ var createSnapshot = (directory) => {
2313
2515
  resources: {
2314
2516
  domains: snapshotDomains,
2315
2517
  services: snapshotServices,
2518
+ agents: snapshotAgents,
2316
2519
  messages: {
2317
2520
  events: snapshotEvents,
2318
2521
  commands: snapshotCommands,
@@ -2322,16 +2525,16 @@ var createSnapshot = (directory) => {
2322
2525
  }
2323
2526
  };
2324
2527
  const snapshotsDir = outputDir || path6.join(directory, ".snapshots");
2325
- fs11.mkdirSync(snapshotsDir, { recursive: true });
2528
+ fs12.mkdirSync(snapshotsDir, { recursive: true });
2326
2529
  const fileName = `${snapshotLabel}.snapshot.json`;
2327
2530
  const filePath = path6.join(snapshotsDir, fileName);
2328
- fs11.writeFileSync(filePath, JSON.stringify(snapshot));
2531
+ fs12.writeFileSync(filePath, JSON.stringify(snapshot));
2329
2532
  return { filePath, snapshot };
2330
2533
  };
2331
2534
  };
2332
2535
  var diffSnapshots = (directory) => async (snapshotAPath, snapshotBPath) => {
2333
- const snapshotA = JSON.parse(fs11.readFileSync(snapshotAPath, "utf-8"));
2334
- const snapshotB = JSON.parse(fs11.readFileSync(snapshotBPath, "utf-8"));
2536
+ const snapshotA = JSON.parse(fs12.readFileSync(snapshotAPath, "utf-8"));
2537
+ const snapshotB = JSON.parse(fs12.readFileSync(snapshotBPath, "utf-8"));
2335
2538
  const resourceChanges = computeResourceDiff(snapshotA, snapshotB);
2336
2539
  const relationshipChanges = computeRelationshipDiff(snapshotA, snapshotB);
2337
2540
  const resourceCounts = { added: 0, removed: 0, modified: 0, versioned: 0 };
@@ -2356,13 +2559,13 @@ var diffSnapshots = (directory) => async (snapshotAPath, snapshotBPath) => {
2356
2559
  };
2357
2560
  var listSnapshots = (directory) => async () => {
2358
2561
  const snapshotsDir = path6.join(directory, ".snapshots");
2359
- if (!fs11.existsSync(snapshotsDir)) return [];
2360
- const files = fs11.readdirSync(snapshotsDir).filter((f) => f.endsWith(".snapshot.json"));
2562
+ if (!fs12.existsSync(snapshotsDir)) return [];
2563
+ const files = fs12.readdirSync(snapshotsDir).filter((f) => f.endsWith(".snapshot.json"));
2361
2564
  const snapshots = [];
2362
2565
  for (const file of files) {
2363
2566
  try {
2364
2567
  const filePath = path6.join(snapshotsDir, file);
2365
- const content = JSON.parse(fs11.readFileSync(filePath, "utf-8"));
2568
+ const content = JSON.parse(fs12.readFileSync(filePath, "utf-8"));
2366
2569
  snapshots.push({
2367
2570
  label: content.label,
2368
2571
  createdAt: content.createdAt,
@@ -2378,7 +2581,7 @@ var listSnapshots = (directory) => async () => {
2378
2581
  // src/changelogs.ts
2379
2582
  import path7, { dirname as dirname6 } from "path";
2380
2583
  import fsSync8 from "fs";
2381
- import fs12 from "fs/promises";
2584
+ import fs13 from "fs/promises";
2382
2585
  import matter8 from "gray-matter";
2383
2586
  var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
2384
2587
  const { version, format = "mdx" } = options;
@@ -2455,17 +2658,17 @@ var rmChangelog = (catalogDir) => async (id, options = {}) => {
2455
2658
  const mdxPath = path7.join(resourceDir, "changelog.mdx");
2456
2659
  const mdPath = path7.join(resourceDir, "changelog.md");
2457
2660
  if (fsSync8.existsSync(mdxPath)) {
2458
- await fs12.rm(mdxPath);
2661
+ await fs13.rm(mdxPath);
2459
2662
  }
2460
2663
  if (fsSync8.existsSync(mdPath)) {
2461
- await fs12.rm(mdPath);
2664
+ await fs13.rm(mdPath);
2462
2665
  }
2463
2666
  invalidateFileCache();
2464
2667
  };
2465
2668
 
2466
2669
  // src/entities.ts
2467
- import fs13 from "fs/promises";
2468
- import { join as join14 } from "path";
2670
+ import fs14 from "fs/promises";
2671
+ import { join as join15 } from "path";
2469
2672
  var getEntity = (directory) => async (id, version) => getResource(directory, id, version, { type: "entity" });
2470
2673
  var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
2471
2674
  var writeEntity = (directory) => async (entity, options = {
@@ -2474,7 +2677,7 @@ var writeEntity = (directory) => async (entity, options = {
2474
2677
  format: "mdx"
2475
2678
  }) => writeResource(directory, { ...entity }, { ...options, type: "entity" });
2476
2679
  var rmEntity = (directory) => async (path8) => {
2477
- await fs13.rm(join14(directory, path8), { recursive: true });
2680
+ await fs14.rm(join15(directory, path8), { recursive: true });
2478
2681
  invalidateFileCache();
2479
2682
  };
2480
2683
  var rmEntityById = (directory) => async (id, version, persistFiles) => {
@@ -2487,13 +2690,14 @@ var entityHasVersion = (directory) => async (id, version) => {
2487
2690
  };
2488
2691
 
2489
2692
  // src/flows.ts
2490
- import fs14 from "fs/promises";
2491
- import { join as join15 } from "path";
2693
+ import fs15 from "fs/promises";
2694
+ import { join as join16 } from "path";
2492
2695
 
2493
2696
  // src/flow-builder.ts
2494
2697
  var cloneStep = (step) => ({
2495
2698
  ...step,
2496
2699
  ...step.message ? { message: { ...step.message } } : {},
2700
+ ...step.agent ? { agent: { ...step.agent } } : {},
2497
2701
  ...step.service ? { service: { ...step.service } } : {},
2498
2702
  ...step.flow ? { flow: { ...step.flow } } : {},
2499
2703
  ...step.container ? { container: { ...step.container } } : {},
@@ -2642,6 +2846,40 @@ var FlowBuilder = class _FlowBuilder {
2642
2846
  step.nextSteps
2643
2847
  );
2644
2848
  }
2849
+ /**
2850
+ * Add an agent step.
2851
+ *
2852
+ * @param step - The agent step payload.
2853
+ *
2854
+ * @example
2855
+ * ```ts
2856
+ * FlowBuilder.create({
2857
+ * id: 'OrderFlow',
2858
+ * name: 'Order Flow',
2859
+ * version: '1.0.0',
2860
+ * markdown: '',
2861
+ * })
2862
+ * .addAgentStep({
2863
+ * id: 'FraudReviewAgent',
2864
+ * agent: { id: 'FraudReviewAgent', version: '1.0.0' },
2865
+ * });
2866
+ * ```
2867
+ */
2868
+ addAgentStep(step) {
2869
+ const agent = step.agent || {
2870
+ id: String(step.id),
2871
+ ...step.version ? { version: step.version } : {}
2872
+ };
2873
+ return this.addStepWithNext(
2874
+ {
2875
+ id: step.id,
2876
+ title: step.title || String(step.id),
2877
+ ...step.summary ? { summary: step.summary } : {},
2878
+ agent: { ...agent, ...step.version && !agent.version ? { version: step.version } : {} }
2879
+ },
2880
+ step.nextSteps
2881
+ );
2882
+ }
2645
2883
  /**
2646
2884
  * Add a data store step.
2647
2885
  *
@@ -2935,16 +3173,21 @@ var writeVersionedFlow = (directory) => async (flow) => {
2935
3173
  };
2936
3174
  var writeFlowToDomain = (directory) => async (flow, domain, options = { path: "", format: "mdx", override: false }) => {
2937
3175
  let pathForFlow = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/flows` : `/${domain.id}/flows`;
2938
- pathForFlow = join15(pathForFlow, flow.id);
3176
+ pathForFlow = join16(pathForFlow, flow.id);
2939
3177
  await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
2940
3178
  };
2941
3179
  var writeFlowToService = (directory) => async (flow, service, options = { path: "", format: "mdx", override: false }) => {
2942
3180
  let pathForFlow = service.version && service.version !== "latest" ? `/${service.id}/versioned/${service.version}/flows` : `/${service.id}/flows`;
2943
- pathForFlow = join15(pathForFlow, flow.id);
3181
+ pathForFlow = join16(pathForFlow, flow.id);
3182
+ await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
3183
+ };
3184
+ var writeFlowToAgent = (directory) => async (flow, agent, options = { path: "", format: "mdx", override: false }) => {
3185
+ let pathForFlow = agent.version && agent.version !== "latest" ? `/${agent.id}/versioned/${agent.version}/flows` : `/${agent.id}/flows`;
3186
+ pathForFlow = join16(pathForFlow, flow.id);
2944
3187
  await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
2945
3188
  };
2946
3189
  var rmFlow = (directory) => async (path8) => {
2947
- await fs14.rm(join15(directory, path8), { recursive: true });
3190
+ await fs15.rm(join16(directory, path8), { recursive: true });
2948
3191
  invalidateFileCache();
2949
3192
  };
2950
3193
  var rmFlowById = (directory) => async (id, version, persistFiles) => {
@@ -2958,8 +3201,8 @@ var flowHasVersion = (directory) => async (id, version) => {
2958
3201
  var addFileToFlow = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version, { type: "flow" });
2959
3202
 
2960
3203
  // src/containers.ts
2961
- import fs15 from "fs/promises";
2962
- import { join as join16 } from "path";
3204
+ import fs16 from "fs/promises";
3205
+ import { join as join17 } from "path";
2963
3206
  var getContainer = (directory) => async (id, version) => getResource(directory, id, version, { type: "container" });
2964
3207
  var getContainers = (directory) => async (options) => getResources(directory, { type: "containers", latestOnly: options?.latestOnly });
2965
3208
  var writeContainer = (directory) => async (data, options = {
@@ -2969,7 +3212,7 @@ var writeContainer = (directory) => async (data, options = {
2969
3212
  }) => writeResource(directory, { ...data }, { ...options, type: "container" });
2970
3213
  var versionContainer = (directory) => async (id) => versionResource(directory, id);
2971
3214
  var rmContainer = (directory) => async (path8) => {
2972
- await fs15.rm(join16(directory, path8), { recursive: true });
3215
+ await fs16.rm(join17(directory, path8), { recursive: true });
2973
3216
  invalidateFileCache();
2974
3217
  };
2975
3218
  var rmContainerById = (directory) => async (id, version, persistFiles) => {
@@ -2986,7 +3229,7 @@ var writeContainerToService = (directory) => async (container, service, options
2986
3229
  throw new Error("Service not found");
2987
3230
  }
2988
3231
  let pathForContainer = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/containers` : `${resourcePath.directory}/containers`;
2989
- pathForContainer = join16(pathForContainer, container.id);
3232
+ pathForContainer = join17(pathForContainer, container.id);
2990
3233
  await writeResource(directory, { ...container }, { ...options, path: pathForContainer, type: "container" });
2991
3234
  };
2992
3235
 
@@ -3002,8 +3245,8 @@ var addFileToDataStore = addFileToContainer;
3002
3245
  var writeDataStoreToService = writeContainerToService;
3003
3246
 
3004
3247
  // src/data-products.ts
3005
- import fs16 from "fs/promises";
3006
- import { join as join17 } from "path";
3248
+ import fs17 from "fs/promises";
3249
+ import { join as join18 } from "path";
3007
3250
  var getDataProduct = (directory) => async (id, version) => getResource(directory, id, version, { type: "data-product" });
3008
3251
  var getDataProducts = (directory) => async (options) => getResources(directory, { type: "data-products", latestOnly: options?.latestOnly });
3009
3252
  var writeDataProduct = (directory) => async (dataProduct, options = {
@@ -3013,11 +3256,11 @@ var writeDataProduct = (directory) => async (dataProduct, options = {
3013
3256
  }) => writeResource(directory, { ...dataProduct }, { ...options, type: "data-product" });
3014
3257
  var writeDataProductToDomain = (directory) => async (dataProduct, domain, options = { path: "", format: "mdx", override: false }) => {
3015
3258
  let pathForDataProduct = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/data-products` : `/${domain.id}/data-products`;
3016
- pathForDataProduct = join17(pathForDataProduct, dataProduct.id);
3259
+ pathForDataProduct = join18(pathForDataProduct, dataProduct.id);
3017
3260
  await writeResource(directory, { ...dataProduct }, { ...options, path: pathForDataProduct, type: "data-product" });
3018
3261
  };
3019
3262
  var rmDataProduct = (directory) => async (path8) => {
3020
- await fs16.rm(join17(directory, path8), { recursive: true });
3263
+ await fs17.rm(join18(directory, path8), { recursive: true });
3021
3264
  invalidateFileCache();
3022
3265
  };
3023
3266
  var rmDataProductById = (directory) => async (id, version, persistFiles) => {
@@ -3031,8 +3274,8 @@ var dataProductHasVersion = (directory) => async (id, version) => {
3031
3274
  var addFileToDataProduct = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
3032
3275
 
3033
3276
  // src/diagrams.ts
3034
- import fs17 from "fs/promises";
3035
- import { join as join18 } from "path";
3277
+ import fs18 from "fs/promises";
3278
+ import { join as join19 } from "path";
3036
3279
  var getDiagram = (directory) => async (id, version) => getResource(directory, id, version, { type: "diagram" });
3037
3280
  var getDiagrams = (directory) => async (options) => getResources(directory, { type: "diagrams", latestOnly: options?.latestOnly });
3038
3281
  var writeDiagram = (directory) => async (diagram, options = {
@@ -3041,7 +3284,7 @@ var writeDiagram = (directory) => async (diagram, options = {
3041
3284
  format: "mdx"
3042
3285
  }) => writeResource(directory, { ...diagram }, { ...options, type: "diagram" });
3043
3286
  var rmDiagram = (directory) => async (path8) => {
3044
- await fs17.rm(join18(directory, path8), { recursive: true });
3287
+ await fs18.rm(join19(directory, path8), { recursive: true });
3045
3288
  invalidateFileCache();
3046
3289
  };
3047
3290
  var rmDiagramById = (directory) => async (id, version, persistFiles) => {
@@ -3063,13 +3306,13 @@ var src_default = (path8) => {
3063
3306
  * @param version - Optional id of the version to get (supports semver)
3064
3307
  * @returns Event|Undefined
3065
3308
  */
3066
- getEvent: getEvent(join19(path8)),
3309
+ getEvent: getEvent(join20(path8)),
3067
3310
  /**
3068
3311
  * Returns all events from EventCatalog
3069
3312
  * @param latestOnly - optional boolean, set to true to get only latest versions
3070
3313
  * @returns Event[]|Undefined
3071
3314
  */
3072
- getEvents: getEvents(join19(path8)),
3315
+ getEvents: getEvents(join20(path8)),
3073
3316
  /**
3074
3317
  * Adds an event to EventCatalog
3075
3318
  *
@@ -3077,7 +3320,7 @@ var src_default = (path8) => {
3077
3320
  * @param options - Optional options to write the event
3078
3321
  *
3079
3322
  */
3080
- writeEvent: writeEvent(join19(path8, "events")),
3323
+ writeEvent: writeEvent(join20(path8, "events")),
3081
3324
  /**
3082
3325
  * Adds an event to a service in EventCatalog
3083
3326
  *
@@ -3086,26 +3329,35 @@ var src_default = (path8) => {
3086
3329
  * @param options - Optional options to write the event
3087
3330
  *
3088
3331
  */
3089
- writeEventToService: writeEventToService(join19(path8)),
3332
+ writeEventToService: writeEventToService(join20(path8)),
3333
+ /**
3334
+ * Adds an event to an agent in EventCatalog
3335
+ *
3336
+ * @param event - The event to write to the agent
3337
+ * @param agent - The agent and its id to write the event to
3338
+ * @param options - Optional options to write the event
3339
+ *
3340
+ */
3341
+ writeEventToAgent: writeEventToAgent(join20(path8)),
3090
3342
  /**
3091
3343
  * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
3092
3344
  *
3093
3345
  * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
3094
3346
  *
3095
3347
  */
3096
- rmEvent: rmEvent(join19(path8, "events")),
3348
+ rmEvent: rmEvent(join20(path8, "events")),
3097
3349
  /**
3098
3350
  * Remove an event by an Event id
3099
3351
  *
3100
3352
  * @param id - The id of the event you want to remove
3101
3353
  *
3102
3354
  */
3103
- rmEventById: rmEventById(join19(path8)),
3355
+ rmEventById: rmEventById(join20(path8)),
3104
3356
  /**
3105
3357
  * Moves a given event id to the version directory
3106
3358
  * @param directory
3107
3359
  */
3108
- versionEvent: versionEvent(join19(path8)),
3360
+ versionEvent: versionEvent(join20(path8)),
3109
3361
  /**
3110
3362
  * Adds a file to the given event
3111
3363
  * @param id - The id of the event to add the file to
@@ -3113,7 +3365,7 @@ var src_default = (path8) => {
3113
3365
  * @param version - Optional version of the event to add the file to
3114
3366
  * @returns
3115
3367
  */
3116
- addFileToEvent: addFileToEvent(join19(path8)),
3368
+ addFileToEvent: addFileToEvent(join20(path8)),
3117
3369
  /**
3118
3370
  * Adds a schema to the given event
3119
3371
  * @param id - The id of the event to add the schema to
@@ -3121,17 +3373,17 @@ var src_default = (path8) => {
3121
3373
  * @param version - Optional version of the event to add the schema to
3122
3374
  * @returns
3123
3375
  */
3124
- addSchemaToEvent: addSchemaToEvent(join19(path8)),
3376
+ addSchemaToEvent: addSchemaToEvent(join20(path8)),
3125
3377
  /**
3126
3378
  * Check to see if an event version exists
3127
3379
  * @param id - The id of the event
3128
3380
  * @param version - The version of the event (supports semver)
3129
3381
  * @returns
3130
3382
  */
3131
- eventHasVersion: eventHasVersion(join19(path8)),
3132
- addExampleToEvent: addExampleToEvent(join19(path8)),
3133
- getExamplesFromEvent: getExamplesFromEvent(join19(path8)),
3134
- removeExampleFromEvent: removeExampleFromEvent(join19(path8)),
3383
+ eventHasVersion: eventHasVersion(join20(path8)),
3384
+ addExampleToEvent: addExampleToEvent(join20(path8)),
3385
+ getExamplesFromEvent: getExamplesFromEvent(join20(path8)),
3386
+ removeExampleFromEvent: removeExampleFromEvent(join20(path8)),
3135
3387
  /**
3136
3388
  * ================================
3137
3389
  * Commands
@@ -3143,13 +3395,13 @@ var src_default = (path8) => {
3143
3395
  * @param version - Optional id of the version to get (supports semver)
3144
3396
  * @returns Command|Undefined
3145
3397
  */
3146
- getCommand: getCommand(join19(path8)),
3398
+ getCommand: getCommand(join20(path8)),
3147
3399
  /**
3148
3400
  * Returns all commands from EventCatalog
3149
3401
  * @param latestOnly - optional boolean, set to true to get only latest versions
3150
3402
  * @returns Command[]|Undefined
3151
3403
  */
3152
- getCommands: getCommands(join19(path8)),
3404
+ getCommands: getCommands(join20(path8)),
3153
3405
  /**
3154
3406
  * Adds an command to EventCatalog
3155
3407
  *
@@ -3157,7 +3409,7 @@ var src_default = (path8) => {
3157
3409
  * @param options - Optional options to write the command
3158
3410
  *
3159
3411
  */
3160
- writeCommand: writeCommand(join19(path8, "commands")),
3412
+ writeCommand: writeCommand(join20(path8, "commands")),
3161
3413
  /**
3162
3414
  * Adds a command to a service in EventCatalog
3163
3415
  *
@@ -3166,26 +3418,35 @@ var src_default = (path8) => {
3166
3418
  * @param options - Optional options to write the command
3167
3419
  *
3168
3420
  */
3169
- writeCommandToService: writeCommandToService(join19(path8)),
3421
+ writeCommandToService: writeCommandToService(join20(path8)),
3422
+ /**
3423
+ * Adds a command to an agent in EventCatalog
3424
+ *
3425
+ * @param command - The command to write to the agent
3426
+ * @param agent - The agent and its id to write the command to
3427
+ * @param options - Optional options to write the command
3428
+ *
3429
+ */
3430
+ writeCommandToAgent: writeCommandToAgent(join20(path8)),
3170
3431
  /**
3171
3432
  * Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
3172
3433
  *
3173
3434
  * @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
3174
3435
  *
3175
3436
  */
3176
- rmCommand: rmCommand(join19(path8, "commands")),
3437
+ rmCommand: rmCommand(join20(path8, "commands")),
3177
3438
  /**
3178
3439
  * Remove an command by an Event id
3179
3440
  *
3180
3441
  * @param id - The id of the command you want to remove
3181
3442
  *
3182
3443
  */
3183
- rmCommandById: rmCommandById(join19(path8)),
3444
+ rmCommandById: rmCommandById(join20(path8)),
3184
3445
  /**
3185
3446
  * Moves a given command id to the version directory
3186
3447
  * @param directory
3187
3448
  */
3188
- versionCommand: versionCommand(join19(path8)),
3449
+ versionCommand: versionCommand(join20(path8)),
3189
3450
  /**
3190
3451
  * Adds a file to the given command
3191
3452
  * @param id - The id of the command to add the file to
@@ -3193,7 +3454,7 @@ var src_default = (path8) => {
3193
3454
  * @param version - Optional version of the command to add the file to
3194
3455
  * @returns
3195
3456
  */
3196
- addFileToCommand: addFileToCommand(join19(path8)),
3457
+ addFileToCommand: addFileToCommand(join20(path8)),
3197
3458
  /**
3198
3459
  * Adds a schema to the given command
3199
3460
  * @param id - The id of the command to add the schema to
@@ -3201,17 +3462,17 @@ var src_default = (path8) => {
3201
3462
  * @param version - Optional version of the command to add the schema to
3202
3463
  * @returns
3203
3464
  */
3204
- addSchemaToCommand: addSchemaToCommand(join19(path8)),
3465
+ addSchemaToCommand: addSchemaToCommand(join20(path8)),
3205
3466
  /**
3206
3467
  * Check to see if a command version exists
3207
3468
  * @param id - The id of the command
3208
3469
  * @param version - The version of the command (supports semver)
3209
3470
  * @returns
3210
3471
  */
3211
- commandHasVersion: commandHasVersion(join19(path8)),
3212
- addExampleToCommand: addExampleToCommand(join19(path8)),
3213
- getExamplesFromCommand: getExamplesFromCommand(join19(path8)),
3214
- removeExampleFromCommand: removeExampleFromCommand(join19(path8)),
3472
+ commandHasVersion: commandHasVersion(join20(path8)),
3473
+ addExampleToCommand: addExampleToCommand(join20(path8)),
3474
+ getExamplesFromCommand: getExamplesFromCommand(join20(path8)),
3475
+ removeExampleFromCommand: removeExampleFromCommand(join20(path8)),
3215
3476
  /**
3216
3477
  * ================================
3217
3478
  * Queries
@@ -3223,13 +3484,13 @@ var src_default = (path8) => {
3223
3484
  * @param version - Optional id of the version to get (supports semver)
3224
3485
  * @returns Query|Undefined
3225
3486
  */
3226
- getQuery: getQuery(join19(path8)),
3487
+ getQuery: getQuery(join20(path8)),
3227
3488
  /**
3228
3489
  * Returns all queries from EventCatalog
3229
3490
  * @param latestOnly - optional boolean, set to true to get only latest versions
3230
3491
  * @returns Query[]|Undefined
3231
3492
  */
3232
- getQueries: getQueries(join19(path8)),
3493
+ getQueries: getQueries(join20(path8)),
3233
3494
  /**
3234
3495
  * Adds a query to EventCatalog
3235
3496
  *
@@ -3237,7 +3498,7 @@ var src_default = (path8) => {
3237
3498
  * @param options - Optional options to write the event
3238
3499
  *
3239
3500
  */
3240
- writeQuery: writeQuery(join19(path8, "queries")),
3501
+ writeQuery: writeQuery(join20(path8, "queries")),
3241
3502
  /**
3242
3503
  * Adds a query to a service in EventCatalog
3243
3504
  *
@@ -3246,26 +3507,35 @@ var src_default = (path8) => {
3246
3507
  * @param options - Optional options to write the query
3247
3508
  *
3248
3509
  */
3249
- writeQueryToService: writeQueryToService(join19(path8)),
3510
+ writeQueryToService: writeQueryToService(join20(path8)),
3511
+ /**
3512
+ * Adds a query to an agent in EventCatalog
3513
+ *
3514
+ * @param query - The query to write to the agent
3515
+ * @param agent - The agent and its id to write the query to
3516
+ * @param options - Optional options to write the query
3517
+ *
3518
+ */
3519
+ writeQueryToAgent: writeQueryToAgent(join20(path8)),
3250
3520
  /**
3251
3521
  * Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
3252
3522
  *
3253
3523
  * @param path - The path to your query, e.g. `/Orders/GetOrder`
3254
3524
  *
3255
3525
  */
3256
- rmQuery: rmQuery(join19(path8, "queries")),
3526
+ rmQuery: rmQuery(join20(path8, "queries")),
3257
3527
  /**
3258
3528
  * Remove a query by a Query id
3259
3529
  *
3260
3530
  * @param id - The id of the query you want to remove
3261
3531
  *
3262
3532
  */
3263
- rmQueryById: rmQueryById(join19(path8)),
3533
+ rmQueryById: rmQueryById(join20(path8)),
3264
3534
  /**
3265
3535
  * Moves a given query id to the version directory
3266
3536
  * @param directory
3267
3537
  */
3268
- versionQuery: versionQuery(join19(path8)),
3538
+ versionQuery: versionQuery(join20(path8)),
3269
3539
  /**
3270
3540
  * Adds a file to the given query
3271
3541
  * @param id - The id of the query to add the file to
@@ -3273,7 +3543,7 @@ var src_default = (path8) => {
3273
3543
  * @param version - Optional version of the query to add the file to
3274
3544
  * @returns
3275
3545
  */
3276
- addFileToQuery: addFileToQuery(join19(path8)),
3546
+ addFileToQuery: addFileToQuery(join20(path8)),
3277
3547
  /**
3278
3548
  * Adds a schema to the given query
3279
3549
  * @param id - The id of the query to add the schema to
@@ -3281,17 +3551,17 @@ var src_default = (path8) => {
3281
3551
  * @param version - Optional version of the query to add the schema to
3282
3552
  * @returns
3283
3553
  */
3284
- addSchemaToQuery: addSchemaToQuery(join19(path8)),
3554
+ addSchemaToQuery: addSchemaToQuery(join20(path8)),
3285
3555
  /**
3286
3556
  * Check to see if an query version exists
3287
3557
  * @param id - The id of the query
3288
3558
  * @param version - The version of the query (supports semver)
3289
3559
  * @returns
3290
3560
  */
3291
- queryHasVersion: queryHasVersion(join19(path8)),
3292
- addExampleToQuery: addExampleToQuery(join19(path8)),
3293
- getExamplesFromQuery: getExamplesFromQuery(join19(path8)),
3294
- removeExampleFromQuery: removeExampleFromQuery(join19(path8)),
3561
+ queryHasVersion: queryHasVersion(join20(path8)),
3562
+ addExampleToQuery: addExampleToQuery(join20(path8)),
3563
+ getExamplesFromQuery: getExamplesFromQuery(join20(path8)),
3564
+ removeExampleFromQuery: removeExampleFromQuery(join20(path8)),
3295
3565
  /**
3296
3566
  * ================================
3297
3567
  * Channels
@@ -3303,13 +3573,13 @@ var src_default = (path8) => {
3303
3573
  * @param version - Optional id of the version to get (supports semver)
3304
3574
  * @returns Channel|Undefined
3305
3575
  */
3306
- getChannel: getChannel(join19(path8)),
3576
+ getChannel: getChannel(join20(path8)),
3307
3577
  /**
3308
3578
  * Returns all channels from EventCatalog
3309
3579
  * @param latestOnly - optional boolean, set to true to get only latest versions
3310
3580
  * @returns Channel[]|Undefined
3311
3581
  */
3312
- getChannels: getChannels(join19(path8)),
3582
+ getChannels: getChannels(join20(path8)),
3313
3583
  /**
3314
3584
  * Adds an channel to EventCatalog
3315
3585
  *
@@ -3317,33 +3587,33 @@ var src_default = (path8) => {
3317
3587
  * @param options - Optional options to write the channel
3318
3588
  *
3319
3589
  */
3320
- writeChannel: writeChannel(join19(path8, "channels")),
3590
+ writeChannel: writeChannel(join20(path8, "channels")),
3321
3591
  /**
3322
3592
  * Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
3323
3593
  *
3324
3594
  * @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
3325
3595
  *
3326
3596
  */
3327
- rmChannel: rmChannel(join19(path8, "channels")),
3597
+ rmChannel: rmChannel(join20(path8, "channels")),
3328
3598
  /**
3329
3599
  * Remove an channel by an Event id
3330
3600
  *
3331
3601
  * @param id - The id of the channel you want to remove
3332
3602
  *
3333
3603
  */
3334
- rmChannelById: rmChannelById(join19(path8)),
3604
+ rmChannelById: rmChannelById(join20(path8)),
3335
3605
  /**
3336
3606
  * Moves a given channel id to the version directory
3337
3607
  * @param directory
3338
3608
  */
3339
- versionChannel: versionChannel(join19(path8)),
3609
+ versionChannel: versionChannel(join20(path8)),
3340
3610
  /**
3341
3611
  * Check to see if a channel version exists
3342
3612
  * @param id - The id of the channel
3343
3613
  * @param version - The version of the channel (supports semver)
3344
3614
  * @returns
3345
3615
  */
3346
- channelHasVersion: channelHasVersion(join19(path8)),
3616
+ channelHasVersion: channelHasVersion(join20(path8)),
3347
3617
  /**
3348
3618
  * Add a channel to an event
3349
3619
  *
@@ -3360,7 +3630,7 @@ var src_default = (path8) => {
3360
3630
  *
3361
3631
  * ```
3362
3632
  */
3363
- addEventToChannel: addMessageToChannel(join19(path8), "events"),
3633
+ addEventToChannel: addMessageToChannel(join20(path8), "events"),
3364
3634
  /**
3365
3635
  * Add a channel to an command
3366
3636
  *
@@ -3377,7 +3647,7 @@ var src_default = (path8) => {
3377
3647
  *
3378
3648
  * ```
3379
3649
  */
3380
- addCommandToChannel: addMessageToChannel(join19(path8), "commands"),
3650
+ addCommandToChannel: addMessageToChannel(join20(path8), "commands"),
3381
3651
  /**
3382
3652
  * Add a channel to an query
3383
3653
  *
@@ -3394,7 +3664,7 @@ var src_default = (path8) => {
3394
3664
  *
3395
3665
  * ```
3396
3666
  */
3397
- addQueryToChannel: addMessageToChannel(join19(path8), "queries"),
3667
+ addQueryToChannel: addMessageToChannel(join20(path8), "queries"),
3398
3668
  /**
3399
3669
  * ================================
3400
3670
  * SERVICES
@@ -3407,14 +3677,14 @@ var src_default = (path8) => {
3407
3677
  * @param options - Optional options to write the event
3408
3678
  *
3409
3679
  */
3410
- writeService: writeService(join19(path8, "services")),
3680
+ writeService: writeService(join20(path8, "services")),
3411
3681
  /**
3412
3682
  * Adds a versioned service to EventCatalog
3413
3683
  *
3414
3684
  * @param service - The service to write
3415
3685
  *
3416
3686
  */
3417
- writeVersionedService: writeVersionedService(join19(path8, "services")),
3687
+ writeVersionedService: writeVersionedService(join20(path8, "services")),
3418
3688
  /**
3419
3689
  * Adds a service to a domain in EventCatalog
3420
3690
  *
@@ -3423,45 +3693,45 @@ var src_default = (path8) => {
3423
3693
  * @param options - Optional options to write the event
3424
3694
  *
3425
3695
  */
3426
- writeServiceToDomain: writeServiceToDomain(join19(path8, "domains")),
3696
+ writeServiceToDomain: writeServiceToDomain(join20(path8, "domains")),
3427
3697
  /**
3428
3698
  * Returns a service from EventCatalog
3429
3699
  * @param id - The id of the service to retrieve
3430
3700
  * @param version - Optional id of the version to get (supports semver)
3431
3701
  * @returns Service|Undefined
3432
3702
  */
3433
- getService: getService(join19(path8)),
3703
+ getService: getService(join20(path8)),
3434
3704
  /**
3435
3705
  * Returns a service from EventCatalog by it's path.
3436
3706
  * @param path - The path to the service to retrieve
3437
3707
  * @returns Service|Undefined
3438
3708
  */
3439
- getServiceByPath: getServiceByPath(join19(path8)),
3709
+ getServiceByPath: getServiceByPath(join20(path8)),
3440
3710
  /**
3441
3711
  * Returns all services from EventCatalog
3442
3712
  * @param latestOnly - optional boolean, set to true to get only latest versions
3443
3713
  * @returns Service[]|Undefined
3444
3714
  */
3445
- getServices: getServices(join19(path8)),
3715
+ getServices: getServices(join20(path8)),
3446
3716
  /**
3447
3717
  * Moves a given service id to the version directory
3448
3718
  * @param directory
3449
3719
  */
3450
- versionService: versionService(join19(path8)),
3720
+ versionService: versionService(join20(path8)),
3451
3721
  /**
3452
3722
  * Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
3453
3723
  *
3454
3724
  * @param path - The path to your service, e.g. `/InventoryService`
3455
3725
  *
3456
3726
  */
3457
- rmService: rmService(join19(path8, "services")),
3727
+ rmService: rmService(join20(path8, "services")),
3458
3728
  /**
3459
3729
  * Remove an service by an service id
3460
3730
  *
3461
3731
  * @param id - The id of the service you want to remove
3462
3732
  *
3463
3733
  */
3464
- rmServiceById: rmServiceById(join19(path8)),
3734
+ rmServiceById: rmServiceById(join20(path8)),
3465
3735
  /**
3466
3736
  * Adds a file to the given service
3467
3737
  * @param id - The id of the service to add the file to
@@ -3469,21 +3739,21 @@ var src_default = (path8) => {
3469
3739
  * @param version - Optional version of the service to add the file to
3470
3740
  * @returns
3471
3741
  */
3472
- addFileToService: addFileToService(join19(path8)),
3742
+ addFileToService: addFileToService(join20(path8)),
3473
3743
  /**
3474
3744
  * Returns the specifications for a given service
3475
3745
  * @param id - The id of the service to retrieve the specifications for
3476
3746
  * @param version - Optional version of the service
3477
3747
  * @returns
3478
3748
  */
3479
- getSpecificationFilesForService: getSpecificationFilesForService(join19(path8)),
3749
+ getSpecificationFilesForService: getSpecificationFilesForService(join20(path8)),
3480
3750
  /**
3481
3751
  * Check to see if a service version exists
3482
3752
  * @param id - The id of the service
3483
3753
  * @param version - The version of the service (supports semver)
3484
3754
  * @returns
3485
3755
  */
3486
- serviceHasVersion: serviceHasVersion(join19(path8)),
3756
+ serviceHasVersion: serviceHasVersion(join20(path8)),
3487
3757
  /**
3488
3758
  * Add an event to a service by it's id.
3489
3759
  *
@@ -3503,7 +3773,7 @@ var src_default = (path8) => {
3503
3773
  *
3504
3774
  * ```
3505
3775
  */
3506
- addEventToService: addMessageToService(join19(path8)),
3776
+ addEventToService: addMessageToService(join20(path8)),
3507
3777
  /**
3508
3778
  * Add a data store to a service by it's id.
3509
3779
  *
@@ -3520,7 +3790,7 @@ var src_default = (path8) => {
3520
3790
  *
3521
3791
  * ```
3522
3792
  */
3523
- addDataStoreToService: addDataStoreToService(join19(path8)),
3793
+ addDataStoreToService: addDataStoreToService(join20(path8)),
3524
3794
  /**
3525
3795
  * Add a command to a service by it's id.
3526
3796
  *
@@ -3540,7 +3810,7 @@ var src_default = (path8) => {
3540
3810
  *
3541
3811
  * ```
3542
3812
  */
3543
- addCommandToService: addMessageToService(join19(path8)),
3813
+ addCommandToService: addMessageToService(join20(path8)),
3544
3814
  /**
3545
3815
  * Add a query to a service by it's id.
3546
3816
  *
@@ -3560,7 +3830,7 @@ var src_default = (path8) => {
3560
3830
  *
3561
3831
  * ```
3562
3832
  */
3563
- addQueryToService: addMessageToService(join19(path8)),
3833
+ addQueryToService: addMessageToService(join20(path8)),
3564
3834
  /**
3565
3835
  * Add an entity to a service by its id.
3566
3836
  *
@@ -3578,7 +3848,7 @@ var src_default = (path8) => {
3578
3848
  *
3579
3849
  * ```
3580
3850
  */
3581
- addEntityToService: addEntityToService(join19(path8)),
3851
+ addEntityToService: addEntityToService(join20(path8)),
3582
3852
  /**
3583
3853
  * Check to see if a service exists by it's path.
3584
3854
  *
@@ -3595,13 +3865,36 @@ var src_default = (path8) => {
3595
3865
  * @param path - The path to the service to check
3596
3866
  * @returns boolean
3597
3867
  */
3598
- isService: isService(join19(path8)),
3868
+ isService: isService(join20(path8)),
3599
3869
  /**
3600
3870
  * Converts a file to a service.
3601
3871
  * @param file - The file to convert to a service.
3602
3872
  * @returns The service.
3603
3873
  */
3604
- toService: toService(join19(path8)),
3874
+ toService: toService(join20(path8)),
3875
+ /**
3876
+ * ================================
3877
+ * Agents
3878
+ * ================================
3879
+ */
3880
+ writeAgent: writeAgent(join20(path8, "agents")),
3881
+ writeVersionedAgent: writeVersionedAgent(join20(path8, "agents")),
3882
+ writeAgentToDomain: writeAgentToDomain(join20(path8, "domains")),
3883
+ getAgent: getAgent(join20(path8)),
3884
+ getAgentByPath: getAgentByPath(join20(path8)),
3885
+ getAgents: getAgents(join20(path8)),
3886
+ versionAgent: versionAgent(join20(path8)),
3887
+ rmAgent: rmAgent(join20(path8, "agents")),
3888
+ rmAgentById: rmAgentById(join20(path8)),
3889
+ addFileToAgent: addFileToAgent(join20(path8)),
3890
+ addEventToAgent: addMessageToAgent(join20(path8)),
3891
+ addCommandToAgent: addMessageToAgent(join20(path8)),
3892
+ addQueryToAgent: addMessageToAgent(join20(path8)),
3893
+ addDataStoreToAgent: addDataStoreToAgent(join20(path8)),
3894
+ addFlowToAgent: addFlowToAgent(join20(path8)),
3895
+ agentHasVersion: agentHasVersion(join20(path8)),
3896
+ isAgent: isAgent(join20(path8)),
3897
+ toAgent: toAgent(join20(path8)),
3605
3898
  /**
3606
3899
  * ================================
3607
3900
  * Domains
@@ -3614,39 +3907,39 @@ var src_default = (path8) => {
3614
3907
  * @param options - Optional options to write the event
3615
3908
  *
3616
3909
  */
3617
- writeDomain: writeDomain(join19(path8, "domains")),
3910
+ writeDomain: writeDomain(join20(path8, "domains")),
3618
3911
  /**
3619
3912
  * Returns a domain from EventCatalog
3620
3913
  * @param id - The id of the domain to retrieve
3621
3914
  * @param version - Optional id of the version to get (supports semver)
3622
3915
  * @returns Domain|Undefined
3623
3916
  */
3624
- getDomain: getDomain(join19(path8, "domains")),
3917
+ getDomain: getDomain(join20(path8, "domains")),
3625
3918
  /**
3626
3919
  * Returns all domains from EventCatalog
3627
3920
  * @param latestOnly - optional boolean, set to true to get only latest versions
3628
3921
  * @returns Domain[]|Undefined
3629
3922
  */
3630
- getDomains: getDomains(join19(path8)),
3923
+ getDomains: getDomains(join20(path8)),
3631
3924
  /**
3632
3925
  * Moves a given domain id to the version directory
3633
3926
  * @param directory
3634
3927
  */
3635
- versionDomain: versionDomain(join19(path8, "domains")),
3928
+ versionDomain: versionDomain(join20(path8, "domains")),
3636
3929
  /**
3637
3930
  * Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
3638
3931
  *
3639
3932
  * @param path - The path to your domain, e.g. `/Payment`
3640
3933
  *
3641
3934
  */
3642
- rmDomain: rmDomain(join19(path8, "domains")),
3935
+ rmDomain: rmDomain(join20(path8, "domains")),
3643
3936
  /**
3644
3937
  * Remove an service by an domain id
3645
3938
  *
3646
3939
  * @param id - The id of the domain you want to remove
3647
3940
  *
3648
3941
  */
3649
- rmDomainById: rmDomainById(join19(path8, "domains")),
3942
+ rmDomainById: rmDomainById(join20(path8, "domains")),
3650
3943
  /**
3651
3944
  * Adds a file to the given domain
3652
3945
  * @param id - The id of the domain to add the file to
@@ -3654,28 +3947,28 @@ var src_default = (path8) => {
3654
3947
  * @param version - Optional version of the domain to add the file to
3655
3948
  * @returns
3656
3949
  */
3657
- addFileToDomain: addFileToDomain(join19(path8, "domains")),
3950
+ addFileToDomain: addFileToDomain(join20(path8, "domains")),
3658
3951
  /**
3659
3952
  * Adds an ubiquitous language dictionary to a domain
3660
3953
  * @param id - The id of the domain to add the ubiquitous language to
3661
3954
  * @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
3662
3955
  * @param version - Optional version of the domain to add the ubiquitous language to
3663
3956
  */
3664
- addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(join19(path8, "domains")),
3957
+ addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(join20(path8, "domains")),
3665
3958
  /**
3666
3959
  * Get the ubiquitous language dictionary from a domain
3667
3960
  * @param id - The id of the domain to get the ubiquitous language from
3668
3961
  * @param version - Optional version of the domain to get the ubiquitous language from
3669
3962
  * @returns
3670
3963
  */
3671
- getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(join19(path8, "domains")),
3964
+ getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(join20(path8, "domains")),
3672
3965
  /**
3673
3966
  * Check to see if a domain version exists
3674
3967
  * @param id - The id of the domain
3675
3968
  * @param version - The version of the domain (supports semver)
3676
3969
  * @returns
3677
3970
  */
3678
- domainHasVersion: domainHasVersion(join19(path8)),
3971
+ domainHasVersion: domainHasVersion(join20(path8)),
3679
3972
  /**
3680
3973
  * Adds a given service to a domain
3681
3974
  * @param id - The id of the domain
@@ -3683,7 +3976,15 @@ var src_default = (path8) => {
3683
3976
  * @param version - (Optional) The version of the domain to add the service to
3684
3977
  * @returns
3685
3978
  */
3686
- addServiceToDomain: addServiceToDomain(join19(path8, "domains")),
3979
+ addServiceToDomain: addServiceToDomain(join20(path8, "domains")),
3980
+ /**
3981
+ * Adds a given agent to a domain
3982
+ * @param id - The id of the domain
3983
+ * @param agent - The id and version of the agent to add
3984
+ * @param version - (Optional) The version of the domain to add the agent to
3985
+ * @returns
3986
+ */
3987
+ addAgentToDomain: addAgentToDomain(join20(path8, "domains")),
3687
3988
  /**
3688
3989
  * Adds a given subdomain to a domain
3689
3990
  * @param id - The id of the domain
@@ -3691,7 +3992,7 @@ var src_default = (path8) => {
3691
3992
  * @param version - (Optional) The version of the domain to add the subdomain to
3692
3993
  * @returns
3693
3994
  */
3694
- addSubDomainToDomain: addSubDomainToDomain(join19(path8, "domains")),
3995
+ addSubDomainToDomain: addSubDomainToDomain(join20(path8, "domains")),
3695
3996
  /**
3696
3997
  * Adds an entity to a domain
3697
3998
  * @param id - The id of the domain
@@ -3699,7 +4000,7 @@ var src_default = (path8) => {
3699
4000
  * @param version - (Optional) The version of the domain to add the entity to
3700
4001
  * @returns
3701
4002
  */
3702
- addEntityToDomain: addEntityToDomain(join19(path8, "domains")),
4003
+ addEntityToDomain: addEntityToDomain(join20(path8, "domains")),
3703
4004
  /**
3704
4005
  * Add an event to a domain by its id.
3705
4006
  *
@@ -3717,7 +4018,7 @@ var src_default = (path8) => {
3717
4018
  *
3718
4019
  * ```
3719
4020
  */
3720
- addEventToDomain: addMessageToDomain(join19(path8, "domains")),
4021
+ addEventToDomain: addMessageToDomain(join20(path8, "domains")),
3721
4022
  /**
3722
4023
  * Add a command to a domain by its id.
3723
4024
  *
@@ -3735,7 +4036,7 @@ var src_default = (path8) => {
3735
4036
  *
3736
4037
  * ```
3737
4038
  */
3738
- addCommandToDomain: addMessageToDomain(join19(path8, "domains")),
4039
+ addCommandToDomain: addMessageToDomain(join20(path8, "domains")),
3739
4040
  /**
3740
4041
  * Add a query to a domain by its id.
3741
4042
  *
@@ -3753,7 +4054,7 @@ var src_default = (path8) => {
3753
4054
  *
3754
4055
  * ```
3755
4056
  */
3756
- addQueryToDomain: addMessageToDomain(join19(path8, "domains")),
4057
+ addQueryToDomain: addMessageToDomain(join20(path8, "domains")),
3757
4058
  /**
3758
4059
  * ================================
3759
4060
  * Teams
@@ -3766,25 +4067,25 @@ var src_default = (path8) => {
3766
4067
  * @param options - Optional options to write the team
3767
4068
  *
3768
4069
  */
3769
- writeTeam: writeTeam(join19(path8, "teams")),
4070
+ writeTeam: writeTeam(join20(path8, "teams")),
3770
4071
  /**
3771
4072
  * Returns a team from EventCatalog
3772
4073
  * @param id - The id of the team to retrieve
3773
4074
  * @returns Team|Undefined
3774
4075
  */
3775
- getTeam: getTeam(join19(path8, "teams")),
4076
+ getTeam: getTeam(join20(path8, "teams")),
3776
4077
  /**
3777
4078
  * Returns all teams from EventCatalog
3778
4079
  * @returns Team[]|Undefined
3779
4080
  */
3780
- getTeams: getTeams(join19(path8, "teams")),
4081
+ getTeams: getTeams(join20(path8, "teams")),
3781
4082
  /**
3782
4083
  * Remove a team by the team id
3783
4084
  *
3784
4085
  * @param id - The id of the team you want to remove
3785
4086
  *
3786
4087
  */
3787
- rmTeamById: rmTeamById(join19(path8, "teams")),
4088
+ rmTeamById: rmTeamById(join20(path8, "teams")),
3788
4089
  /**
3789
4090
  * ================================
3790
4091
  * Users
@@ -3797,25 +4098,25 @@ var src_default = (path8) => {
3797
4098
  * @param options - Optional options to write the user
3798
4099
  *
3799
4100
  */
3800
- writeUser: writeUser(join19(path8, "users")),
4101
+ writeUser: writeUser(join20(path8, "users")),
3801
4102
  /**
3802
4103
  * Returns a user from EventCatalog
3803
4104
  * @param id - The id of the user to retrieve
3804
4105
  * @returns User|Undefined
3805
4106
  */
3806
- getUser: getUser(join19(path8, "users")),
4107
+ getUser: getUser(join20(path8, "users")),
3807
4108
  /**
3808
4109
  * Returns all user from EventCatalog
3809
4110
  * @returns User[]|Undefined
3810
4111
  */
3811
- getUsers: getUsers(join19(path8)),
4112
+ getUsers: getUsers(join20(path8)),
3812
4113
  /**
3813
4114
  * Remove a user by the user id
3814
4115
  *
3815
4116
  * @param id - The id of the user you want to remove
3816
4117
  *
3817
4118
  */
3818
- rmUserById: rmUserById(join19(path8, "users")),
4119
+ rmUserById: rmUserById(join20(path8, "users")),
3819
4120
  /**
3820
4121
  * ================================
3821
4122
  * Custom Docs
@@ -3826,32 +4127,32 @@ var src_default = (path8) => {
3826
4127
  * @param path - The path to the custom doc to retrieve
3827
4128
  * @returns CustomDoc|Undefined
3828
4129
  */
3829
- getCustomDoc: getCustomDoc(join19(path8, "docs")),
4130
+ getCustomDoc: getCustomDoc(join20(path8, "docs")),
3830
4131
  /**
3831
4132
  * Returns all custom docs from EventCatalog
3832
4133
  * @param options - Optional options to get custom docs from a specific path
3833
4134
  * @returns CustomDoc[]|Undefined
3834
4135
  */
3835
- getCustomDocs: getCustomDocs(join19(path8, "docs")),
4136
+ getCustomDocs: getCustomDocs(join20(path8, "docs")),
3836
4137
  /**
3837
4138
  * Writes a custom doc to EventCatalog
3838
4139
  * @param customDoc - The custom doc to write
3839
4140
  * @param options - Optional options to write the custom doc
3840
4141
  *
3841
4142
  */
3842
- writeCustomDoc: writeCustomDoc(join19(path8, "docs")),
4143
+ writeCustomDoc: writeCustomDoc(join20(path8, "docs")),
3843
4144
  /**
3844
4145
  * Removes a custom doc from EventCatalog
3845
4146
  * @param path - The path to the custom doc to remove
3846
4147
  *
3847
4148
  */
3848
- rmCustomDoc: rmCustomDoc(join19(path8, "docs")),
4149
+ rmCustomDoc: rmCustomDoc(join20(path8, "docs")),
3849
4150
  /**
3850
4151
  * Dumps the catalog to a JSON file.
3851
4152
  * @param directory - The directory to dump the catalog to
3852
4153
  * @returns A JSON file with the catalog
3853
4154
  */
3854
- dumpCatalog: dumpCatalog(join19(path8)),
4155
+ dumpCatalog: dumpCatalog(join20(path8)),
3855
4156
  /**
3856
4157
  * Returns the event catalog configuration file.
3857
4158
  * The event catalog configuration file is the file that contains the configuration for the event catalog.
@@ -3859,7 +4160,7 @@ var src_default = (path8) => {
3859
4160
  * @param directory - The directory of the catalog.
3860
4161
  * @returns A JSON object with the configuration for the event catalog.
3861
4162
  */
3862
- getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(join19(path8)),
4163
+ getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(join20(path8)),
3863
4164
  /**
3864
4165
  * ================================
3865
4166
  * Changelogs
@@ -3873,7 +4174,7 @@ var src_default = (path8) => {
3873
4174
  * @param options - Optional options (version, format)
3874
4175
  *
3875
4176
  */
3876
- writeChangelog: writeChangelog(join19(path8)),
4177
+ writeChangelog: writeChangelog(join20(path8)),
3877
4178
  /**
3878
4179
  * Appends a changelog entry to an existing changelog for a resource.
3879
4180
  * If no changelog exists, one is created.
@@ -3883,7 +4184,7 @@ var src_default = (path8) => {
3883
4184
  * @param options - Optional options (version, format)
3884
4185
  *
3885
4186
  */
3886
- appendChangelog: appendChangelog(join19(path8)),
4187
+ appendChangelog: appendChangelog(join20(path8)),
3887
4188
  /**
3888
4189
  * Returns the changelog for a resource in EventCatalog
3889
4190
  *
@@ -3891,7 +4192,7 @@ var src_default = (path8) => {
3891
4192
  * @param options - Optional options (version)
3892
4193
  * @returns Changelog|Undefined
3893
4194
  */
3894
- getChangelog: getChangelog(join19(path8)),
4195
+ getChangelog: getChangelog(join20(path8)),
3895
4196
  /**
3896
4197
  * Removes the changelog for a resource in EventCatalog
3897
4198
  *
@@ -3899,7 +4200,7 @@ var src_default = (path8) => {
3899
4200
  * @param options - Optional options (version)
3900
4201
  *
3901
4202
  */
3902
- rmChangelog: rmChangelog(join19(path8)),
4203
+ rmChangelog: rmChangelog(join20(path8)),
3903
4204
  /**
3904
4205
  * ================================
3905
4206
  * Resources Utils
@@ -3924,26 +4225,26 @@ var src_default = (path8) => {
3924
4225
  * @param path - The path to the message to retrieve
3925
4226
  * @returns Message|Undefined
3926
4227
  */
3927
- getMessageBySchemaPath: getMessageBySchemaPath(join19(path8)),
4228
+ getMessageBySchemaPath: getMessageBySchemaPath(join20(path8)),
3928
4229
  /**
3929
- * Returns the producers and consumers (services) for a given message
4230
+ * Returns the producers and consumers (services and agents) for a given message
3930
4231
  * @param id - The id of the message to get the producers and consumers for
3931
4232
  * @param version - Optional version of the message
3932
- * @returns { producers: Service[], consumers: Service[] }
4233
+ * @returns { producers: (Service|Agent)[], consumers: (Service|Agent)[] }
3933
4234
  */
3934
- getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join19(path8)),
4235
+ getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join20(path8)),
3935
4236
  /**
3936
4237
  * Returns the consumers of a given schema path
3937
4238
  * @param path - The path to the schema to get the consumers for
3938
- * @returns Service[]
4239
+ * @returns (Service|Agent)[]
3939
4240
  */
3940
- getConsumersOfSchema: getConsumersOfSchema(join19(path8)),
4241
+ getConsumersOfSchema: getConsumersOfSchema(join20(path8)),
3941
4242
  /**
3942
4243
  * Returns the producers of a given schema path
3943
4244
  * @param path - The path to the schema to get the producers for
3944
- * @returns Service[]
4245
+ * @returns (Service|Agent)[]
3945
4246
  */
3946
- getProducersOfSchema: getProducersOfSchema(join19(path8)),
4247
+ getProducersOfSchema: getProducersOfSchema(join20(path8)),
3947
4248
  /**
3948
4249
  * Returns the schema for a given message (event, command or query) by its id and version.
3949
4250
  * If no version is given, the latest version is used.
@@ -3951,14 +4252,14 @@ var src_default = (path8) => {
3951
4252
  * @param version - Optional version of the message
3952
4253
  * @returns { schema: string, fileName: string } | undefined
3953
4254
  */
3954
- getSchemaForMessage: getSchemaForMessage(join19(path8)),
4255
+ getSchemaForMessage: getSchemaForMessage(join20(path8)),
3955
4256
  /**
3956
4257
  * Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
3957
4258
  * @param id - The id of the resource to get the owners for
3958
4259
  * @param version - Optional version of the resource
3959
4260
  * @returns { owners: User[] }
3960
4261
  */
3961
- getOwnersForResource: getOwnersForResource(join19(path8)),
4262
+ getOwnersForResource: getOwnersForResource(join20(path8)),
3962
4263
  /**
3963
4264
  * ================================
3964
4265
  * Entities
@@ -3970,13 +4271,13 @@ var src_default = (path8) => {
3970
4271
  * @param version - Optional id of the version to get (supports semver)
3971
4272
  * @returns Entity|Undefined
3972
4273
  */
3973
- getEntity: getEntity(join19(path8)),
4274
+ getEntity: getEntity(join20(path8)),
3974
4275
  /**
3975
4276
  * Returns all entities from EventCatalog
3976
4277
  * @param latestOnly - optional boolean, set to true to get only latest versions
3977
4278
  * @returns Entity[]|Undefined
3978
4279
  */
3979
- getEntities: getEntities(join19(path8)),
4280
+ getEntities: getEntities(join20(path8)),
3980
4281
  /**
3981
4282
  * Adds an entity to EventCatalog
3982
4283
  *
@@ -3984,33 +4285,33 @@ var src_default = (path8) => {
3984
4285
  * @param options - Optional options to write the entity
3985
4286
  *
3986
4287
  */
3987
- writeEntity: writeEntity(join19(path8, "entities")),
4288
+ writeEntity: writeEntity(join20(path8, "entities")),
3988
4289
  /**
3989
4290
  * Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
3990
4291
  *
3991
4292
  * @param path - The path to your entity, e.g. `/User`
3992
4293
  *
3993
4294
  */
3994
- rmEntity: rmEntity(join19(path8, "entities")),
4295
+ rmEntity: rmEntity(join20(path8, "entities")),
3995
4296
  /**
3996
4297
  * Remove an entity by an entity id
3997
4298
  *
3998
4299
  * @param id - The id of the entity you want to remove
3999
4300
  *
4000
4301
  */
4001
- rmEntityById: rmEntityById(join19(path8)),
4302
+ rmEntityById: rmEntityById(join20(path8)),
4002
4303
  /**
4003
4304
  * Moves a given entity id to the version directory
4004
4305
  * @param id - The id of the entity to version
4005
4306
  */
4006
- versionEntity: versionEntity(join19(path8)),
4307
+ versionEntity: versionEntity(join20(path8)),
4007
4308
  /**
4008
4309
  * Check to see if an entity version exists
4009
4310
  * @param id - The id of the entity
4010
4311
  * @param version - The version of the entity (supports semver)
4011
4312
  * @returns
4012
4313
  */
4013
- entityHasVersion: entityHasVersion(join19(path8)),
4314
+ entityHasVersion: entityHasVersion(join20(path8)),
4014
4315
  /**
4015
4316
  * ================================
4016
4317
  * Flows
@@ -4023,7 +4324,7 @@ var src_default = (path8) => {
4023
4324
  * @param version - Optional version of the flow
4024
4325
  * @returns Flow
4025
4326
  */
4026
- getFlow: getFlow(join19(path8)),
4327
+ getFlow: getFlow(join20(path8)),
4027
4328
  /**
4028
4329
  * Returns all flows from EventCatalog
4029
4330
  *
@@ -4031,7 +4332,7 @@ var src_default = (path8) => {
4031
4332
  * @param latestOnly - optional boolean, set to true to get only latest versions
4032
4333
  * @returns Flow[]|Undefined
4033
4334
  */
4034
- getFlows: getFlows(join19(path8)),
4335
+ getFlows: getFlows(join20(path8)),
4035
4336
  /**
4036
4337
  * Adds a flow to EventCatalog
4037
4338
  *
@@ -4039,14 +4340,14 @@ var src_default = (path8) => {
4039
4340
  * @param options - Optional options to write the flow
4040
4341
  *
4041
4342
  */
4042
- writeFlow: writeFlow(join19(path8, "flows")),
4343
+ writeFlow: writeFlow(join20(path8, "flows")),
4043
4344
  /**
4044
4345
  * Adds a versioned flow to EventCatalog
4045
4346
  *
4046
4347
  * @param flow - The flow to write
4047
4348
  *
4048
4349
  */
4049
- writeVersionedFlow: writeVersionedFlow(join19(path8, "flows")),
4350
+ writeVersionedFlow: writeVersionedFlow(join20(path8, "flows")),
4050
4351
  /**
4051
4352
  * Adds a flow to a domain in EventCatalog
4052
4353
  *
@@ -4055,7 +4356,7 @@ var src_default = (path8) => {
4055
4356
  * @param options - Optional options to write the flow
4056
4357
  *
4057
4358
  */
4058
- writeFlowToDomain: writeFlowToDomain(join19(path8, "domains")),
4359
+ writeFlowToDomain: writeFlowToDomain(join20(path8, "domains")),
4059
4360
  /**
4060
4361
  * Adds a flow to a service in EventCatalog
4061
4362
  *
@@ -4064,33 +4365,42 @@ var src_default = (path8) => {
4064
4365
  * @param options - Optional options to write the flow
4065
4366
  *
4066
4367
  */
4067
- writeFlowToService: writeFlowToService(join19(path8, "services")),
4368
+ writeFlowToService: writeFlowToService(join20(path8, "services")),
4369
+ /**
4370
+ * Adds a flow to an agent in EventCatalog
4371
+ *
4372
+ * @param flow - The flow to write to the agent
4373
+ * @param agent - The agent and its id to write the flow to
4374
+ * @param options - Optional options to write the flow
4375
+ *
4376
+ */
4377
+ writeFlowToAgent: writeFlowToAgent(join20(path8, "agents")),
4068
4378
  /**
4069
4379
  * Remove a flow from EventCatalog (modeled on the standard POSIX rm utility)
4070
4380
  *
4071
4381
  * @param path - The path to your flow, e.g. `/PaymentFlow`
4072
4382
  *
4073
4383
  */
4074
- rmFlow: rmFlow(join19(path8, "flows")),
4384
+ rmFlow: rmFlow(join20(path8, "flows")),
4075
4385
  /**
4076
4386
  * Remove a flow by a flow id
4077
4387
  *
4078
4388
  * @param id - The id of the flow you want to remove
4079
4389
  *
4080
4390
  */
4081
- rmFlowById: rmFlowById(join19(path8)),
4391
+ rmFlowById: rmFlowById(join20(path8)),
4082
4392
  /**
4083
4393
  * Moves a given flow id to the version directory
4084
4394
  * @param id - The id of the flow to version
4085
4395
  */
4086
- versionFlow: versionFlow(join19(path8)),
4396
+ versionFlow: versionFlow(join20(path8)),
4087
4397
  /**
4088
4398
  * Check to see if a flow version exists
4089
4399
  * @param id - The id of the flow
4090
4400
  * @param version - The version of the flow (supports semver)
4091
4401
  * @returns
4092
4402
  */
4093
- flowHasVersion: flowHasVersion(join19(path8)),
4403
+ flowHasVersion: flowHasVersion(join20(path8)),
4094
4404
  /**
4095
4405
  * Adds a file to the given flow
4096
4406
  * @param id - The id of the flow to add the file to
@@ -4098,7 +4408,7 @@ var src_default = (path8) => {
4098
4408
  * @param version - Optional version of the flow to add the file to
4099
4409
  * @returns
4100
4410
  */
4101
- addFileToFlow: addFileToFlow(join19(path8)),
4411
+ addFileToFlow: addFileToFlow(join20(path8)),
4102
4412
  /**
4103
4413
  * ================================
4104
4414
  * Data Stores
@@ -4110,42 +4420,42 @@ var src_default = (path8) => {
4110
4420
  * @param options - Optional options to write the data store
4111
4421
  *
4112
4422
  */
4113
- writeDataStore: writeDataStore(join19(path8, "containers")),
4423
+ writeDataStore: writeDataStore(join20(path8, "containers")),
4114
4424
  /**
4115
4425
  * Returns a data store from EventCatalog
4116
4426
  * @param id - The id of the data store to retrieve
4117
4427
  * @param version - Optional id of the version to get (supports semver)
4118
4428
  * @returns Container|Undefined
4119
4429
  */
4120
- getDataStore: getDataStore(join19(path8)),
4430
+ getDataStore: getDataStore(join20(path8)),
4121
4431
  /**
4122
4432
  * Returns all data stores from EventCatalog
4123
4433
  * @param latestOnly - optional boolean, set to true to get only latest versions
4124
4434
  * @returns Container[]|Undefined
4125
4435
  */
4126
- getDataStores: getDataStores(join19(path8)),
4436
+ getDataStores: getDataStores(join20(path8)),
4127
4437
  /**
4128
4438
  * Version a data store by its id
4129
4439
  * @param id - The id of the data store to version
4130
4440
  */
4131
- versionDataStore: versionDataStore(join19(path8, "containers")),
4441
+ versionDataStore: versionDataStore(join20(path8, "containers")),
4132
4442
  /**
4133
4443
  * Remove a data store by its path
4134
4444
  * @param path - The path to the data store to remove
4135
4445
  */
4136
- rmDataStore: rmDataStore(join19(path8, "containers")),
4446
+ rmDataStore: rmDataStore(join20(path8, "containers")),
4137
4447
  /**
4138
4448
  * Remove a data store by its id
4139
4449
  * @param id - The id of the data store to remove
4140
4450
  */
4141
- rmDataStoreById: rmDataStoreById(join19(path8)),
4451
+ rmDataStoreById: rmDataStoreById(join20(path8)),
4142
4452
  /**
4143
4453
  * Check to see if a data store version exists
4144
4454
  * @param id - The id of the data store
4145
4455
  * @param version - The version of the data store (supports semver)
4146
4456
  * @returns
4147
4457
  */
4148
- dataStoreHasVersion: dataStoreHasVersion(join19(path8)),
4458
+ dataStoreHasVersion: dataStoreHasVersion(join20(path8)),
4149
4459
  /**
4150
4460
  * Adds a file to a data store by its id
4151
4461
  * @param id - The id of the data store to add the file to
@@ -4153,14 +4463,14 @@ var src_default = (path8) => {
4153
4463
  * @param version - Optional version of the data store to add the file to
4154
4464
  * @returns
4155
4465
  */
4156
- addFileToDataStore: addFileToDataStore(join19(path8)),
4466
+ addFileToDataStore: addFileToDataStore(join20(path8)),
4157
4467
  /**
4158
4468
  * Writes a data store to a service by its id
4159
4469
  * @param dataStore - The data store to write
4160
4470
  * @param service - The service to write the data store to
4161
4471
  * @returns
4162
4472
  */
4163
- writeDataStoreToService: writeDataStoreToService(join19(path8)),
4473
+ writeDataStoreToService: writeDataStoreToService(join20(path8)),
4164
4474
  /**
4165
4475
  * ================================
4166
4476
  * Data Products
@@ -4172,7 +4482,7 @@ var src_default = (path8) => {
4172
4482
  * @param options - Optional options to write the data product
4173
4483
  *
4174
4484
  */
4175
- writeDataProduct: writeDataProduct(join19(path8, "data-products")),
4485
+ writeDataProduct: writeDataProduct(join20(path8, "data-products")),
4176
4486
  /**
4177
4487
  * Writes a data product to a domain in EventCatalog
4178
4488
  * @param dataProduct - The data product to write
@@ -4180,43 +4490,43 @@ var src_default = (path8) => {
4180
4490
  * @param options - Optional options to write the data product
4181
4491
  *
4182
4492
  */
4183
- writeDataProductToDomain: writeDataProductToDomain(join19(path8, "domains")),
4493
+ writeDataProductToDomain: writeDataProductToDomain(join20(path8, "domains")),
4184
4494
  /**
4185
4495
  * Returns a data product from EventCatalog
4186
4496
  * @param id - The id of the data product to retrieve
4187
4497
  * @param version - Optional id of the version to get (supports semver)
4188
4498
  * @returns DataProduct|Undefined
4189
4499
  */
4190
- getDataProduct: getDataProduct(join19(path8)),
4500
+ getDataProduct: getDataProduct(join20(path8)),
4191
4501
  /**
4192
4502
  * Returns all data products from EventCatalog
4193
4503
  * @param latestOnly - optional boolean, set to true to get only latest versions
4194
4504
  * @returns DataProduct[]|Undefined
4195
4505
  */
4196
- getDataProducts: getDataProducts(join19(path8)),
4506
+ getDataProducts: getDataProducts(join20(path8)),
4197
4507
  /**
4198
4508
  * Version a data product by its id
4199
4509
  * @param id - The id of the data product to version
4200
4510
  */
4201
- versionDataProduct: versionDataProduct(join19(path8)),
4511
+ versionDataProduct: versionDataProduct(join20(path8)),
4202
4512
  /**
4203
4513
  * Remove a data product by its path
4204
4514
  * @param path - The path to the data product to remove
4205
4515
  */
4206
- rmDataProduct: rmDataProduct(join19(path8, "data-products")),
4516
+ rmDataProduct: rmDataProduct(join20(path8, "data-products")),
4207
4517
  /**
4208
4518
  * Remove a data product by its id
4209
4519
  * @param id - The id of the data product to remove
4210
4520
  * @param version - Optional version of the data product to remove
4211
4521
  */
4212
- rmDataProductById: rmDataProductById(join19(path8)),
4522
+ rmDataProductById: rmDataProductById(join20(path8)),
4213
4523
  /**
4214
4524
  * Check to see if a data product version exists
4215
4525
  * @param id - The id of the data product
4216
4526
  * @param version - The version of the data product (supports semver)
4217
4527
  * @returns
4218
4528
  */
4219
- dataProductHasVersion: dataProductHasVersion(join19(path8)),
4529
+ dataProductHasVersion: dataProductHasVersion(join20(path8)),
4220
4530
  /**
4221
4531
  * Adds a file to a data product by its id
4222
4532
  * @param id - The id of the data product to add the file to
@@ -4224,7 +4534,7 @@ var src_default = (path8) => {
4224
4534
  * @param version - Optional version of the data product to add the file to
4225
4535
  * @returns
4226
4536
  */
4227
- addFileToDataProduct: addFileToDataProduct(join19(path8)),
4537
+ addFileToDataProduct: addFileToDataProduct(join20(path8)),
4228
4538
  /**
4229
4539
  * Adds a data product to a domain
4230
4540
  * @param id - The id of the domain
@@ -4232,7 +4542,7 @@ var src_default = (path8) => {
4232
4542
  * @param version - (Optional) The version of the domain to add the data product to
4233
4543
  * @returns
4234
4544
  */
4235
- addDataProductToDomain: addDataProductToDomain(join19(path8, "domains")),
4545
+ addDataProductToDomain: addDataProductToDomain(join20(path8, "domains")),
4236
4546
  /**
4237
4547
  * ================================
4238
4548
  * Diagrams
@@ -4244,13 +4554,13 @@ var src_default = (path8) => {
4244
4554
  * @param version - Optional id of the version to get (supports semver)
4245
4555
  * @returns Diagram|Undefined
4246
4556
  */
4247
- getDiagram: getDiagram(join19(path8)),
4557
+ getDiagram: getDiagram(join20(path8)),
4248
4558
  /**
4249
4559
  * Returns all diagrams from EventCatalog
4250
4560
  * @param latestOnly - optional boolean, set to true to get only latest versions
4251
4561
  * @returns Diagram[]|Undefined
4252
4562
  */
4253
- getDiagrams: getDiagrams(join19(path8)),
4563
+ getDiagrams: getDiagrams(join20(path8)),
4254
4564
  /**
4255
4565
  * Adds a diagram to EventCatalog
4256
4566
  *
@@ -4258,33 +4568,33 @@ var src_default = (path8) => {
4258
4568
  * @param options - Optional options to write the diagram
4259
4569
  *
4260
4570
  */
4261
- writeDiagram: writeDiagram(join19(path8, "diagrams")),
4571
+ writeDiagram: writeDiagram(join20(path8, "diagrams")),
4262
4572
  /**
4263
4573
  * Remove a diagram from EventCatalog (modeled on the standard POSIX rm utility)
4264
4574
  *
4265
4575
  * @param path - The path to your diagram, e.g. `/ArchitectureDiagram`
4266
4576
  *
4267
4577
  */
4268
- rmDiagram: rmDiagram(join19(path8, "diagrams")),
4578
+ rmDiagram: rmDiagram(join20(path8, "diagrams")),
4269
4579
  /**
4270
4580
  * Remove a diagram by a diagram id
4271
4581
  *
4272
4582
  * @param id - The id of the diagram you want to remove
4273
4583
  *
4274
4584
  */
4275
- rmDiagramById: rmDiagramById(join19(path8)),
4585
+ rmDiagramById: rmDiagramById(join20(path8)),
4276
4586
  /**
4277
4587
  * Moves a given diagram id to the version directory
4278
4588
  * @param id - The id of the diagram to version
4279
4589
  */
4280
- versionDiagram: versionDiagram(join19(path8)),
4590
+ versionDiagram: versionDiagram(join20(path8)),
4281
4591
  /**
4282
4592
  * Check to see if a diagram version exists
4283
4593
  * @param id - The id of the diagram
4284
4594
  * @param version - The version of the diagram (supports semver)
4285
4595
  * @returns
4286
4596
  */
4287
- diagramHasVersion: diagramHasVersion(join19(path8)),
4597
+ diagramHasVersion: diagramHasVersion(join20(path8)),
4288
4598
  /**
4289
4599
  * Adds a file to the given diagram
4290
4600
  * @param id - The id of the diagram to add the file to
@@ -4292,7 +4602,7 @@ var src_default = (path8) => {
4292
4602
  * @param version - Optional version of the diagram to add the file to
4293
4603
  * @returns
4294
4604
  */
4295
- addFileToDiagram: addFileToDiagram(join19(path8)),
4605
+ addFileToDiagram: addFileToDiagram(join20(path8)),
4296
4606
  /**
4297
4607
  * ================================
4298
4608
  * DSL
@@ -4311,21 +4621,21 @@ var src_default = (path8) => {
4311
4621
  * const dsl = await sdk.toDSL(services, { type: 'service', hydrate: true });
4312
4622
  * ```
4313
4623
  */
4314
- createSnapshot: createSnapshot(join19(path8)),
4315
- diffSnapshots: diffSnapshots(join19(path8)),
4316
- listSnapshots: listSnapshots(join19(path8)),
4317
- toDSL: toDSL(join19(path8), {
4318
- getEvent: getEvent(join19(path8)),
4319
- getCommand: getCommand(join19(path8)),
4320
- getQuery: getQuery(join19(path8)),
4321
- getService: getService(join19(path8)),
4322
- getServices: getServices(join19(path8)),
4323
- getDomain: getDomain(join19(path8, "domains")),
4324
- getChannel: getChannel(join19(path8)),
4325
- getChannels: getChannels(join19(path8)),
4326
- getContainer: getDataStore(join19(path8)),
4327
- getTeam: getTeam(join19(path8, "teams")),
4328
- getUser: getUser(join19(path8, "users"))
4624
+ createSnapshot: createSnapshot(join20(path8)),
4625
+ diffSnapshots: diffSnapshots(join20(path8)),
4626
+ listSnapshots: listSnapshots(join20(path8)),
4627
+ toDSL: toDSL(join20(path8), {
4628
+ getEvent: getEvent(join20(path8)),
4629
+ getCommand: getCommand(join20(path8)),
4630
+ getQuery: getQuery(join20(path8)),
4631
+ getService: getService(join20(path8)),
4632
+ getServices: getServices(join20(path8)),
4633
+ getDomain: getDomain(join20(path8, "domains")),
4634
+ getChannel: getChannel(join20(path8)),
4635
+ getChannels: getChannels(join20(path8)),
4636
+ getContainer: getDataStore(join20(path8)),
4637
+ getTeam: getTeam(join20(path8, "teams")),
4638
+ getUser: getUser(join20(path8, "users"))
4329
4639
  })
4330
4640
  };
4331
4641
  };