@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.js CHANGED
@@ -34,7 +34,7 @@ __export(src_exports, {
34
34
  default: () => src_default
35
35
  });
36
36
  module.exports = __toCommonJS(src_exports);
37
- var import_node_path23 = require("path");
37
+ var import_node_path24 = require("path");
38
38
 
39
39
  // src/dsl/utils.ts
40
40
  var import_glob = require("glob");
@@ -1179,6 +1179,15 @@ var writeEventToService = (directory) => async (event, service, options = { path
1179
1179
  pathForEvent = (0, import_node_path4.join)(pathForEvent, event.id);
1180
1180
  await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
1181
1181
  };
1182
+ var writeEventToAgent = (directory) => async (event, agent, options = { path: "", format: "mdx", override: false }) => {
1183
+ const resourcePath = await getResourcePath(directory, agent.id, agent.version);
1184
+ if (!resourcePath) {
1185
+ throw new Error("Agent not found");
1186
+ }
1187
+ let pathForEvent = agent.version && agent.version !== "latest" ? `${resourcePath.directory}/versioned/${agent.version}/events` : `${resourcePath.directory}/events`;
1188
+ pathForEvent = (0, import_node_path4.join)(pathForEvent, event.id);
1189
+ await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
1190
+ };
1182
1191
  var rmEvent = (directory) => async (path8) => {
1183
1192
  await import_promises2.default.rm((0, import_node_path4.join)(directory, path8), { recursive: true });
1184
1193
  invalidateFileCache();
@@ -1219,6 +1228,15 @@ var writeCommandToService = (directory) => async (command, service, options = {
1219
1228
  pathForCommand = (0, import_node_path5.join)(pathForCommand, command.id);
1220
1229
  await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
1221
1230
  };
1231
+ var writeCommandToAgent = (directory) => async (command, agent, options = { path: "", format: "mdx", override: false }) => {
1232
+ const resourcePath = await getResourcePath(directory, agent.id, agent.version);
1233
+ if (!resourcePath) {
1234
+ throw new Error("Agent not found");
1235
+ }
1236
+ let pathForCommand = agent.version && agent.version !== "latest" ? `${resourcePath.directory}/versioned/${agent.version}/commands` : `${resourcePath.directory}/commands`;
1237
+ pathForCommand = (0, import_node_path5.join)(pathForCommand, command.id);
1238
+ await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
1239
+ };
1222
1240
  var rmCommand = (directory) => async (path8) => {
1223
1241
  await import_promises3.default.rm((0, import_node_path5.join)(directory, path8), { recursive: true });
1224
1242
  invalidateFileCache();
@@ -1257,6 +1275,15 @@ var writeQueryToService = (directory) => async (query, service, options = { path
1257
1275
  pathForQuery = (0, import_node_path6.join)(pathForQuery, query.id);
1258
1276
  await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
1259
1277
  };
1278
+ var writeQueryToAgent = (directory) => async (query, agent, options = { path: "", format: "mdx", override: false }) => {
1279
+ const resourcePath = await getResourcePath(directory, agent.id, agent.version);
1280
+ if (!resourcePath) {
1281
+ throw new Error("Agent not found");
1282
+ }
1283
+ let pathForQuery = agent.version && agent.version !== "latest" ? `${resourcePath.directory}/versioned/${agent.version}/queries` : `${resourcePath.directory}/queries`;
1284
+ pathForQuery = (0, import_node_path6.join)(pathForQuery, query.id);
1285
+ await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
1286
+ };
1260
1287
  var rmQuery = (directory) => async (path8) => {
1261
1288
  await import_promises4.default.rm((0, import_node_path6.join)(directory, path8), { recursive: true });
1262
1289
  invalidateFileCache();
@@ -1467,9 +1494,146 @@ var addDataStoreToService = (directory) => async (id, operation, dataStore, vers
1467
1494
  await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
1468
1495
  };
1469
1496
 
1470
- // src/domains.ts
1497
+ // src/agents.ts
1471
1498
  var import_promises6 = __toESM(require("fs/promises"));
1472
- var import_node_path8 = __toESM(require("path"));
1499
+ var import_node_path8 = require("path");
1500
+ var rewriteAgent = async (directory, id, agent, version) => {
1501
+ const agentPath = await getResourcePath(directory, id, version);
1502
+ if (!agentPath) {
1503
+ throw new Error(`Cannot find agent ${id} in the catalog`);
1504
+ }
1505
+ const extension = (0, import_node_path8.extname)(agentPath.fullPath);
1506
+ await rmAgentById(directory)(id, version, true);
1507
+ await writeAgent(directory)(agent, { path: agentPath.directory, format: extension === ".md" ? "md" : "mdx" });
1508
+ };
1509
+ var getAgent = (directory) => async (id, version) => getResource(directory, id, version, { type: "agent" });
1510
+ var getAgentByPath = (directory) => async (path8) => {
1511
+ const agent = await getResource(directory, void 0, void 0, { type: "agent" }, path8);
1512
+ return agent;
1513
+ };
1514
+ var getAgents = (directory) => async (options) => getResources(directory, {
1515
+ type: "agents",
1516
+ ignore: [
1517
+ "**/events/**",
1518
+ "**/commands/**",
1519
+ "**/queries/**",
1520
+ "**/entities/**",
1521
+ "**/channels/**",
1522
+ "**/containers/**",
1523
+ "**/data-products/**",
1524
+ "**/data-stores/**",
1525
+ "**/flows/**"
1526
+ ],
1527
+ ...options
1528
+ });
1529
+ var writeAgent = (directory) => async (agent, options = {
1530
+ path: "",
1531
+ override: false,
1532
+ format: "mdx"
1533
+ }) => {
1534
+ const resource = { ...agent };
1535
+ if (Array.isArray(agent.sends)) {
1536
+ resource.sends = uniqueVersions(agent.sends);
1537
+ }
1538
+ if (Array.isArray(agent.receives)) {
1539
+ resource.receives = uniqueVersions(agent.receives);
1540
+ }
1541
+ return await writeResource(directory, resource, { ...options, type: "agent" });
1542
+ };
1543
+ var writeVersionedAgent = (directory) => async (agent) => {
1544
+ const path8 = getVersionedDirectory(agent.id, agent.version);
1545
+ return await writeAgent(directory)({ ...agent }, { path: path8 });
1546
+ };
1547
+ var writeAgentToDomain = (directory) => async (agent, domain, options = { path: "", format: "mdx", override: false }) => {
1548
+ let pathForAgent = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/agents` : `/${domain.id}/agents`;
1549
+ pathForAgent = (0, import_node_path8.join)(pathForAgent, agent.id);
1550
+ await writeResource(directory, { ...agent }, { ...options, path: pathForAgent, type: "agent" });
1551
+ };
1552
+ var versionAgent = (directory) => async (id) => versionResource(directory, id);
1553
+ var rmAgent = (directory) => async (path8) => {
1554
+ await import_promises6.default.rm((0, import_node_path8.join)(directory, path8), { recursive: true });
1555
+ invalidateFileCache();
1556
+ };
1557
+ var rmAgentById = (directory) => async (id, version, persistFiles) => {
1558
+ await rmResourceById(directory, id, version, { type: "agent", persistFiles });
1559
+ };
1560
+ var addFileToAgent = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
1561
+ var addMessageToAgent = (directory) => async (id, direction, message, version) => {
1562
+ const agent = await getAgent(directory)(id, version);
1563
+ if (direction === "sends") {
1564
+ if (agent.sends === void 0) {
1565
+ agent.sends = [];
1566
+ }
1567
+ for (let i = 0; i < agent.sends.length; i++) {
1568
+ if (agent.sends[i].id === message.id && agent.sends[i].version === message.version) {
1569
+ return;
1570
+ }
1571
+ }
1572
+ agent.sends.push(buildMessagePointer(message));
1573
+ } else if (direction === "receives") {
1574
+ if (agent.receives === void 0) {
1575
+ agent.receives = [];
1576
+ }
1577
+ for (let i = 0; i < agent.receives.length; i++) {
1578
+ if (agent.receives[i].id === message.id && agent.receives[i].version === message.version) {
1579
+ return;
1580
+ }
1581
+ }
1582
+ agent.receives.push(buildMessagePointer(message));
1583
+ } else {
1584
+ throw new Error(`Direction ${direction} is invalid, only 'receives' and 'sends' are supported`);
1585
+ }
1586
+ await rewriteAgent(directory, id, agent, version);
1587
+ };
1588
+ var addDataStoreToAgent = (directory) => async (id, direction, dataStore, version) => {
1589
+ const agent = await getAgent(directory)(id, version);
1590
+ if (direction === "writesTo") {
1591
+ if (agent.writesTo === void 0) {
1592
+ agent.writesTo = [];
1593
+ }
1594
+ if (agent.writesTo.some((store) => store.id === dataStore.id && store.version === dataStore.version)) {
1595
+ return;
1596
+ }
1597
+ agent.writesTo.push(dataStore);
1598
+ } else if (direction === "readsFrom") {
1599
+ if (agent.readsFrom === void 0) {
1600
+ agent.readsFrom = [];
1601
+ }
1602
+ if (agent.readsFrom.some((store) => store.id === dataStore.id && store.version === dataStore.version)) {
1603
+ return;
1604
+ }
1605
+ agent.readsFrom.push(dataStore);
1606
+ } else {
1607
+ throw new Error(`Direction ${direction} is invalid, only 'writesTo' and 'readsFrom' are supported`);
1608
+ }
1609
+ await rewriteAgent(directory, id, agent, version);
1610
+ };
1611
+ var addFlowToAgent = (directory) => async (id, flow, version) => {
1612
+ const agent = await getAgent(directory)(id, version);
1613
+ if (agent.flows === void 0) {
1614
+ agent.flows = [];
1615
+ }
1616
+ if (agent.flows.some((f) => f.id === flow.id && f.version === flow.version)) {
1617
+ return;
1618
+ }
1619
+ agent.flows.push(flow);
1620
+ await rewriteAgent(directory, id, agent, version);
1621
+ };
1622
+ var agentHasVersion = (directory) => async (id, version) => {
1623
+ const file = await findFileById(directory, id, version);
1624
+ return !!file;
1625
+ };
1626
+ var isAgent = (directory) => async (path8) => {
1627
+ const agent = await getAgentByPath(directory)(path8);
1628
+ const relativePath = (0, import_node_path8.relative)(directory, path8);
1629
+ const segments = relativePath.split(/[/\\]+/);
1630
+ return !!agent && segments.includes("agents");
1631
+ };
1632
+ var toAgent = (directory) => async (file) => toResource(directory, file);
1633
+
1634
+ // src/domains.ts
1635
+ var import_promises7 = __toESM(require("fs/promises"));
1636
+ var import_node_path9 = __toESM(require("path"));
1473
1637
  var import_node_fs3 = __toESM(require("fs"));
1474
1638
  var import_gray_matter3 = __toESM(require("gray-matter"));
1475
1639
  var resolveDomainWriteDirectory = async (directory, id, version) => {
@@ -1486,7 +1650,15 @@ var resolveDomainWriteDirectory = async (directory, id, version) => {
1486
1650
  var getDomain = (directory) => async (id, version) => getResource(directory, id, version, { type: "domain" });
1487
1651
  var getDomains = (directory) => async (options) => getResources(directory, {
1488
1652
  type: "domains",
1489
- ignore: ["**/services/**", "**/events/**", "**/commands/**", "**/queries/**", "**/flows/**", "**/entities/**"],
1653
+ ignore: [
1654
+ "**/services/**",
1655
+ "**/agents/**",
1656
+ "**/events/**",
1657
+ "**/commands/**",
1658
+ "**/queries/**",
1659
+ "**/flows/**",
1660
+ "**/entities/**"
1661
+ ],
1490
1662
  ...options
1491
1663
  });
1492
1664
  var writeDomain = (directory) => async (domain, options = {
@@ -1499,6 +1671,9 @@ var writeDomain = (directory) => async (domain, options = {
1499
1671
  if (Array.isArray(domain.services)) {
1500
1672
  resource.services = uniqueVersions(domain.services);
1501
1673
  }
1674
+ if (Array.isArray(domain.agents)) {
1675
+ resource.agents = uniqueVersions(domain.agents);
1676
+ }
1502
1677
  if (Array.isArray(domain.domains)) {
1503
1678
  resource.domains = uniqueVersions(domain.domains);
1504
1679
  }
@@ -1515,7 +1690,7 @@ var writeDomain = (directory) => async (domain, options = {
1515
1690
  };
1516
1691
  var versionDomain = (directory) => async (id) => versionResource(directory, id);
1517
1692
  var rmDomain = (directory) => async (path8) => {
1518
- await import_promises6.default.rm((0, import_node_path8.join)(directory, path8), { recursive: true });
1693
+ await import_promises7.default.rm((0, import_node_path9.join)(directory, path8), { recursive: true });
1519
1694
  invalidateFileCache();
1520
1695
  };
1521
1696
  var rmDomainById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "domain", persistFiles });
@@ -1528,7 +1703,7 @@ var addUbiquitousLanguageToDomain = (directory) => async (id, ubiquitousLanguage
1528
1703
  };
1529
1704
  var getUbiquitousLanguageFromDomain = (directory) => async (id, version) => {
1530
1705
  const pathToDomain = await findFileById(directory, id, version) || "";
1531
- const pathToUbiquitousLanguage = import_node_path8.default.join(import_node_path8.default.dirname(pathToDomain), "ubiquitous-language.mdx");
1706
+ const pathToUbiquitousLanguage = import_node_path9.default.join(import_node_path9.default.dirname(pathToDomain), "ubiquitous-language.mdx");
1532
1707
  const fileExists = import_node_fs3.default.existsSync(pathToUbiquitousLanguage);
1533
1708
  if (!fileExists) {
1534
1709
  return void 0;
@@ -1543,7 +1718,7 @@ var domainHasVersion = (directory) => async (id, version) => {
1543
1718
  var addServiceToDomain = (directory) => async (id, service, version) => {
1544
1719
  let domain = await getDomain(directory)(id, version);
1545
1720
  const domainPath = await getResourcePath(directory, id, version);
1546
- const extension = import_node_path8.default.extname(domainPath?.fullPath || "");
1721
+ const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1547
1722
  if (domain.services === void 0) {
1548
1723
  domain.services = [];
1549
1724
  }
@@ -1556,10 +1731,26 @@ var addServiceToDomain = (directory) => async (id, service, version) => {
1556
1731
  await rmDomainById(directory)(id, version, true);
1557
1732
  await writeDomain(writeDir)(domain, { format: extension === ".md" ? "md" : "mdx" });
1558
1733
  };
1734
+ var addAgentToDomain = (directory) => async (id, agent, version) => {
1735
+ let domain = await getDomain(directory)(id, version);
1736
+ const domainPath = await getResourcePath(directory, id, version);
1737
+ const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1738
+ if (domain.agents === void 0) {
1739
+ domain.agents = [];
1740
+ }
1741
+ const agentExistsInList = domain.agents.some((a) => a.id === agent.id && a.version === agent.version);
1742
+ if (agentExistsInList) {
1743
+ return;
1744
+ }
1745
+ domain.agents.push(agent);
1746
+ const writeDir = await resolveDomainWriteDirectory(directory, id, version);
1747
+ await rmDomainById(directory)(id, version, true);
1748
+ await writeDomain(writeDir)(domain, { format: extension === ".md" ? "md" : "mdx" });
1749
+ };
1559
1750
  var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
1560
1751
  let domain = await getDomain(directory)(id, version);
1561
1752
  const domainPath = await getResourcePath(directory, id, version);
1562
- const extension = import_node_path8.default.extname(domainPath?.fullPath || "");
1753
+ const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1563
1754
  if (domain.domains === void 0) {
1564
1755
  domain.domains = [];
1565
1756
  }
@@ -1575,7 +1766,7 @@ var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
1575
1766
  var addEntityToDomain = (directory) => async (id, entity, version) => {
1576
1767
  let domain = await getDomain(directory)(id, version);
1577
1768
  const domainPath = await getResourcePath(directory, id, version);
1578
- const extension = import_node_path8.default.extname(domainPath?.fullPath || "");
1769
+ const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1579
1770
  if (domain.entities === void 0) {
1580
1771
  domain.entities = [];
1581
1772
  }
@@ -1591,7 +1782,7 @@ var addEntityToDomain = (directory) => async (id, entity, version) => {
1591
1782
  var addDataProductToDomain = (directory) => async (id, dataProduct, version) => {
1592
1783
  let domain = await getDomain(directory)(id, version);
1593
1784
  const domainPath = await getResourcePath(directory, id, version);
1594
- const extension = import_node_path8.default.extname(domainPath?.fullPath || "");
1785
+ const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1595
1786
  if (domain.dataProducts === void 0) {
1596
1787
  domain.dataProducts = [];
1597
1788
  }
@@ -1609,7 +1800,7 @@ var addDataProductToDomain = (directory) => async (id, dataProduct, version) =>
1609
1800
  var addMessageToDomain = (directory) => async (id, direction, message, version) => {
1610
1801
  let domain = await getDomain(directory)(id, version);
1611
1802
  const domainPath = await getResourcePath(directory, id, version);
1612
- const extension = import_node_path8.default.extname(domainPath?.fullPath || "");
1803
+ const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1613
1804
  if (direction === "sends") {
1614
1805
  if (domain.sends === void 0) {
1615
1806
  domain.sends = [];
@@ -1639,13 +1830,13 @@ var addMessageToDomain = (directory) => async (id, direction, message, version)
1639
1830
  };
1640
1831
 
1641
1832
  // src/channels.ts
1642
- var import_promises7 = __toESM(require("fs/promises"));
1643
- var import_node_path9 = require("path");
1833
+ var import_promises8 = __toESM(require("fs/promises"));
1834
+ var import_node_path10 = require("path");
1644
1835
  var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
1645
1836
  var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
1646
1837
  var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
1647
1838
  var rmChannel = (directory) => async (path8) => {
1648
- await import_promises7.default.rm((0, import_node_path9.join)(directory, path8), { recursive: true });
1839
+ await import_promises8.default.rm((0, import_node_path10.join)(directory, path8), { recursive: true });
1649
1840
  invalidateFileCache();
1650
1841
  };
1651
1842
  var rmChannelById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "channel", persistFiles });
@@ -1676,7 +1867,7 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
1676
1867
  const { getMessage: getMessage2, rmMessageById, writeMessage } = functions[collection];
1677
1868
  const message = await getMessage2(directory)(_message.id, _message.version);
1678
1869
  const messagePath = await getResourcePath(directory, _message.id, _message.version);
1679
- const extension = (0, import_node_path9.extname)(messagePath?.fullPath || "");
1870
+ const extension = (0, import_node_path10.extname)(messagePath?.fullPath || "");
1680
1871
  if (!message) throw new Error(`Message ${_message.id} with version ${_message.version} not found`);
1681
1872
  if (message.channels === void 0) {
1682
1873
  message.channels = [];
@@ -1688,18 +1879,18 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
1688
1879
  throw new Error(`Cannot find message ${id} in the catalog`);
1689
1880
  }
1690
1881
  const path8 = existingResource.split(`/[\\/]+${collection}`)[0];
1691
- const pathToResource = (0, import_node_path9.join)(path8, collection);
1882
+ const pathToResource = (0, import_node_path10.join)(path8, collection);
1692
1883
  await rmMessageById(directory)(_message.id, _message.version, true);
1693
1884
  await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
1694
1885
  };
1695
1886
 
1696
1887
  // src/messages.ts
1697
- var import_node_path10 = require("path");
1888
+ var import_node_path11 = require("path");
1698
1889
  var import_node_fs4 = __toESM(require("fs"));
1699
1890
  var import_gray_matter4 = __toESM(require("gray-matter"));
1700
1891
  var import_semver5 = require("semver");
1701
1892
  var getMessageBySchemaPath = (directory) => async (path8, options) => {
1702
- const pathToMessage = (0, import_node_path10.dirname)(path8);
1893
+ const pathToMessage = (0, import_node_path11.dirname)(path8);
1703
1894
  try {
1704
1895
  const files = await getFiles(`${directory}/${pathToMessage}/index.{md,mdx}`);
1705
1896
  if (!files || files.length === 0) {
@@ -1725,7 +1916,10 @@ var getMessageBySchemaPath = (directory) => async (path8, options) => {
1725
1916
  }
1726
1917
  };
1727
1918
  var getProducersAndConsumersForMessage = (directory) => async (id, version, options) => {
1728
- const services = await getServices(directory)({ latestOnly: options?.latestOnly ?? true });
1919
+ const [services = [], agents = []] = await Promise.all([
1920
+ getServices(directory)({ latestOnly: options?.latestOnly ?? true }),
1921
+ getAgents(directory)({ latestOnly: options?.latestOnly ?? true })
1922
+ ]);
1729
1923
  const message = await getResource(directory, id, version, { type: "message" });
1730
1924
  const isMessageLatestVersion = await isLatestVersion(directory, id, version);
1731
1925
  if (!message) {
@@ -1733,11 +1927,11 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
1733
1927
  }
1734
1928
  const producers = [];
1735
1929
  const consumers = [];
1736
- for (const service of services) {
1737
- const servicePublishesMessage = service.sends?.some((_message) => {
1930
+ for (const participant of [...services, ...agents]) {
1931
+ const participantPublishesMessage = participant.sends?.some((_message) => {
1738
1932
  if (_message.version) {
1739
- const isServiceUsingSemverRange = (0, import_semver5.validRange)(_message.version);
1740
- if (isServiceUsingSemverRange) {
1933
+ const isParticipantUsingSemverRange = (0, import_semver5.validRange)(_message.version);
1934
+ if (isParticipantUsingSemverRange) {
1741
1935
  return _message.id === message.id && (0, import_semver5.satisfies)(message.version, _message.version);
1742
1936
  } else {
1743
1937
  return _message.id === message.id && message.version === _message.version;
@@ -1748,10 +1942,10 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
1748
1942
  }
1749
1943
  return false;
1750
1944
  });
1751
- const serviceSubscribesToMessage = service.receives?.some((_message) => {
1945
+ const participantSubscribesToMessage = participant.receives?.some((_message) => {
1752
1946
  if (_message.version) {
1753
- const isServiceUsingSemverRange = (0, import_semver5.validRange)(_message.version);
1754
- if (isServiceUsingSemverRange) {
1947
+ const isParticipantUsingSemverRange = (0, import_semver5.validRange)(_message.version);
1948
+ if (isParticipantUsingSemverRange) {
1755
1949
  return _message.id === message.id && (0, import_semver5.satisfies)(message.version, _message.version);
1756
1950
  } else {
1757
1951
  return _message.id === message.id && message.version === _message.version;
@@ -1762,11 +1956,11 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
1762
1956
  }
1763
1957
  return false;
1764
1958
  });
1765
- if (servicePublishesMessage) {
1766
- producers.push(service);
1959
+ if (participantPublishesMessage) {
1960
+ producers.push(participant);
1767
1961
  }
1768
- if (serviceSubscribesToMessage) {
1769
- consumers.push(service);
1962
+ if (participantSubscribesToMessage) {
1963
+ consumers.push(participant);
1770
1964
  }
1771
1965
  }
1772
1966
  return { producers, consumers };
@@ -1794,8 +1988,8 @@ var getSchemaForMessage = (directory) => async (id, version) => {
1794
1988
  if (!file || !import_node_fs4.default.existsSync(file)) return void 0;
1795
1989
  const { data } = import_gray_matter4.default.read(file);
1796
1990
  if (!data.schemaPath) return void 0;
1797
- const resourceDirectory = (0, import_node_path10.dirname)(file);
1798
- const pathToSchema = (0, import_node_path10.join)(resourceDirectory, data.schemaPath);
1991
+ const resourceDirectory = (0, import_node_path11.dirname)(file);
1992
+ const pathToSchema = (0, import_node_path11.join)(resourceDirectory, data.schemaPath);
1799
1993
  if (!import_node_fs4.default.existsSync(pathToSchema)) return void 0;
1800
1994
  const schema = import_node_fs4.default.readFileSync(pathToSchema, "utf8");
1801
1995
  return {
@@ -1805,13 +1999,13 @@ var getSchemaForMessage = (directory) => async (id, version) => {
1805
1999
  };
1806
2000
 
1807
2001
  // src/custom-docs.ts
1808
- var import_node_path11 = __toESM(require("path"));
2002
+ var import_node_path12 = __toESM(require("path"));
1809
2003
  var import_node_fs5 = __toESM(require("fs"));
1810
- var import_promises8 = __toESM(require("fs/promises"));
2004
+ var import_promises9 = __toESM(require("fs/promises"));
1811
2005
  var import_gray_matter5 = __toESM(require("gray-matter"));
1812
2006
  var import_slugify = __toESM(require("slugify"));
1813
2007
  var getCustomDoc = (directory) => async (filePath) => {
1814
- const fullPath = import_node_path11.default.join(directory, filePath);
2008
+ const fullPath = import_node_path12.default.join(directory, filePath);
1815
2009
  const fullPathWithExtension = fullPath.endsWith(".mdx") ? fullPath : `${fullPath}.mdx`;
1816
2010
  const fileExists = import_node_fs5.default.existsSync(fullPathWithExtension);
1817
2011
  if (!fileExists) {
@@ -1830,28 +2024,28 @@ var writeCustomDoc = (directory) => async (customDoc, options = { path: "" }) =>
1830
2024
  const { fileName, ...rest } = customDoc;
1831
2025
  const name = fileName || (0, import_slugify.default)(customDoc.title, { lower: true });
1832
2026
  const withExtension = name.endsWith(".mdx") ? name : `${name}.mdx`;
1833
- const fullPath = import_node_path11.default.join(directory, options.path || "", withExtension);
1834
- import_node_fs5.default.mkdirSync(import_node_path11.default.dirname(fullPath), { recursive: true });
2027
+ const fullPath = import_node_path12.default.join(directory, options.path || "", withExtension);
2028
+ import_node_fs5.default.mkdirSync(import_node_path12.default.dirname(fullPath), { recursive: true });
1835
2029
  const document = import_gray_matter5.default.stringify(customDoc.markdown.trim(), rest);
1836
2030
  import_node_fs5.default.writeFileSync(fullPath, document);
1837
2031
  invalidateFileCache();
1838
2032
  };
1839
2033
  var rmCustomDoc = (directory) => async (filePath) => {
1840
2034
  const withExtension = filePath.endsWith(".mdx") ? filePath : `${filePath}.mdx`;
1841
- await import_promises8.default.rm((0, import_node_path11.join)(directory, withExtension), { recursive: true });
2035
+ await import_promises9.default.rm((0, import_node_path12.join)(directory, withExtension), { recursive: true });
1842
2036
  invalidateFileCache();
1843
2037
  };
1844
2038
 
1845
2039
  // src/teams.ts
1846
- var import_promises9 = __toESM(require("fs/promises"));
2040
+ var import_promises10 = __toESM(require("fs/promises"));
1847
2041
  var import_node_fs7 = __toESM(require("fs"));
1848
- var import_node_path13 = require("path");
2042
+ var import_node_path14 = require("path");
1849
2043
  var import_gray_matter7 = __toESM(require("gray-matter"));
1850
- var import_node_path14 = __toESM(require("path"));
2044
+ var import_node_path15 = __toESM(require("path"));
1851
2045
 
1852
2046
  // src/users.ts
1853
2047
  var import_node_fs6 = __toESM(require("fs"));
1854
- var import_node_path12 = require("path");
2048
+ var import_node_path13 = require("path");
1855
2049
  var import_gray_matter6 = __toESM(require("gray-matter"));
1856
2050
  var getUser = (catalogDir) => async (id) => {
1857
2051
  const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);
@@ -1889,12 +2083,12 @@ var writeUser = (catalogDir) => async (user, options = {}) => {
1889
2083
  }
1890
2084
  const { markdown, ...frontmatter } = resource;
1891
2085
  const document = import_gray_matter6.default.stringify(markdown, frontmatter);
1892
- import_node_fs6.default.mkdirSync((0, import_node_path12.join)(catalogDir, ""), { recursive: true });
1893
- import_node_fs6.default.writeFileSync((0, import_node_path12.join)(catalogDir, "", `${resource.id}.mdx`), document);
2086
+ import_node_fs6.default.mkdirSync((0, import_node_path13.join)(catalogDir, ""), { recursive: true });
2087
+ import_node_fs6.default.writeFileSync((0, import_node_path13.join)(catalogDir, "", `${resource.id}.mdx`), document);
1894
2088
  invalidateFileCache();
1895
2089
  };
1896
2090
  var rmUserById = (catalogDir) => async (id) => {
1897
- import_node_fs6.default.rmSync((0, import_node_path12.join)(catalogDir, `${id}.mdx`), { recursive: true });
2091
+ import_node_fs6.default.rmSync((0, import_node_path13.join)(catalogDir, `${id}.mdx`), { recursive: true });
1898
2092
  invalidateFileCache();
1899
2093
  };
1900
2094
 
@@ -1933,12 +2127,12 @@ var writeTeam = (catalogDir) => async (team, options = {}) => {
1933
2127
  }
1934
2128
  const { markdown, ...frontmatter } = resource;
1935
2129
  const document = import_gray_matter7.default.stringify(markdown, frontmatter);
1936
- import_node_fs7.default.mkdirSync((0, import_node_path13.join)(catalogDir, ""), { recursive: true });
1937
- import_node_fs7.default.writeFileSync((0, import_node_path13.join)(catalogDir, "", `${resource.id}.mdx`), document);
2130
+ import_node_fs7.default.mkdirSync((0, import_node_path14.join)(catalogDir, ""), { recursive: true });
2131
+ import_node_fs7.default.writeFileSync((0, import_node_path14.join)(catalogDir, "", `${resource.id}.mdx`), document);
1938
2132
  invalidateFileCache();
1939
2133
  };
1940
2134
  var rmTeamById = (catalogDir) => async (id) => {
1941
- await import_promises9.default.rm((0, import_node_path13.join)(catalogDir, `${id}.mdx`), { recursive: true });
2135
+ await import_promises10.default.rm((0, import_node_path14.join)(catalogDir, `${id}.mdx`), { recursive: true });
1942
2136
  invalidateFileCache();
1943
2137
  };
1944
2138
  var getOwnersForResource = (catalogDir) => async (id, version) => {
@@ -1947,11 +2141,11 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
1947
2141
  if (!resource) return [];
1948
2142
  if (!resource.owners) return [];
1949
2143
  for (const owner of resource.owners) {
1950
- const team = await getTeam(import_node_path14.default.join(catalogDir, "teams"))(owner);
2144
+ const team = await getTeam(import_node_path15.default.join(catalogDir, "teams"))(owner);
1951
2145
  if (team) {
1952
2146
  owners.push(team);
1953
2147
  } else {
1954
- const user = await getUser(import_node_path14.default.join(catalogDir, "users"))(owner);
2148
+ const user = await getUser(import_node_path15.default.join(catalogDir, "users"))(owner);
1955
2149
  if (user) {
1956
2150
  owners.push(user);
1957
2151
  }
@@ -1962,11 +2156,11 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
1962
2156
 
1963
2157
  // src/eventcatalog.ts
1964
2158
  var import_fs = __toESM(require("fs"));
1965
- var import_node_path15 = __toESM(require("path"));
2159
+ var import_node_path16 = __toESM(require("path"));
1966
2160
  var DUMP_VERSION = "0.0.1";
1967
2161
  var getEventCatalogVersion = async (catalogDir) => {
1968
2162
  try {
1969
- const packageJson = import_fs.default.readFileSync((0, import_node_path15.join)(catalogDir, "package.json"), "utf8");
2163
+ const packageJson = import_fs.default.readFileSync((0, import_node_path16.join)(catalogDir, "package.json"), "utf8");
1970
2164
  const packageJsonObject = JSON.parse(packageJson);
1971
2165
  return packageJsonObject["dependencies"]["@eventcatalog/core"];
1972
2166
  } catch (error) {
@@ -1979,7 +2173,7 @@ var hydrateResource = async (catalogDir, resources = [], { attachSchema = false
1979
2173
  const resourcePath = await getResourcePath(catalogDir, resource.id, resource.version);
1980
2174
  let schema = "";
1981
2175
  if (resource.schemaPath && resourcePath?.fullPath) {
1982
- const pathToSchema = import_node_path15.default.join(import_node_path15.default.dirname(resourcePath?.fullPath), resource.schemaPath);
2176
+ const pathToSchema = import_node_path16.default.join(import_node_path16.default.dirname(resourcePath?.fullPath), resource.schemaPath);
1983
2177
  if (import_fs.default.existsSync(pathToSchema)) {
1984
2178
  schema = import_fs.default.readFileSync(pathToSchema, "utf8");
1985
2179
  }
@@ -2000,7 +2194,7 @@ var filterCollection = (collection, options) => {
2000
2194
  };
2001
2195
  var getEventCatalogConfigurationFile = (directory) => async () => {
2002
2196
  try {
2003
- const path8 = (0, import_node_path15.join)(directory, "eventcatalog.config.js");
2197
+ const path8 = (0, import_node_path16.join)(directory, "eventcatalog.config.js");
2004
2198
  const configModule = await import(path8);
2005
2199
  return configModule.default;
2006
2200
  } catch (error) {
@@ -2012,6 +2206,7 @@ var dumpCatalog = (directory) => async (options) => {
2012
2206
  const {
2013
2207
  getDomains: getDomains2,
2014
2208
  getServices: getServices2,
2209
+ getAgents: getAgents2,
2015
2210
  getEvents: getEvents2,
2016
2211
  getQueries: getQueries2,
2017
2212
  getCommands: getCommands2,
@@ -2025,6 +2220,7 @@ var dumpCatalog = (directory) => async (options) => {
2025
2220
  const { includeMarkdown = true } = options || {};
2026
2221
  const domains = await getDomains2();
2027
2222
  const services = await getServices2();
2223
+ const agents = await getAgents2();
2028
2224
  const events = await getEvents2();
2029
2225
  const commands = await getCommands2();
2030
2226
  const queries = await getQueries2();
@@ -2037,6 +2233,7 @@ var dumpCatalog = (directory) => async (options) => {
2037
2233
  const [
2038
2234
  hydratedDomains,
2039
2235
  hydratedServices,
2236
+ hydratedAgents,
2040
2237
  hydratedEvents,
2041
2238
  hydratedQueries,
2042
2239
  hydratedCommands,
@@ -2049,6 +2246,7 @@ var dumpCatalog = (directory) => async (options) => {
2049
2246
  ] = await Promise.all([
2050
2247
  hydrateResource(directory, domains),
2051
2248
  hydrateResource(directory, services),
2249
+ hydrateResource(directory, agents),
2052
2250
  hydrateResource(directory, events),
2053
2251
  hydrateResource(directory, queries),
2054
2252
  hydrateResource(directory, commands),
@@ -2066,6 +2264,7 @@ var dumpCatalog = (directory) => async (options) => {
2066
2264
  resources: {
2067
2265
  domains: filterCollection(hydratedDomains, { includeMarkdown }),
2068
2266
  services: filterCollection(hydratedServices, { includeMarkdown }),
2267
+ agents: filterCollection(hydratedAgents, { includeMarkdown }),
2069
2268
  messages: {
2070
2269
  events: filterCollection(hydratedEvents, { includeMarkdown }),
2071
2270
  queries: filterCollection(hydratedQueries, { includeMarkdown }),
@@ -2083,7 +2282,7 @@ var dumpCatalog = (directory) => async (options) => {
2083
2282
 
2084
2283
  // src/snapshots.ts
2085
2284
  var import_node_fs8 = __toESM(require("fs"));
2086
- var import_node_path16 = __toESM(require("path"));
2285
+ var import_node_path17 = __toESM(require("path"));
2087
2286
  var import_node_crypto = require("crypto");
2088
2287
  var import_node_child_process = require("child_process");
2089
2288
  var import_semver6 = require("semver");
@@ -2113,6 +2312,7 @@ var flattenResources = (snapshot) => {
2113
2312
  };
2114
2313
  addResources(snapshot.resources.domains, "domain");
2115
2314
  addResources(snapshot.resources.services, "service");
2315
+ addResources(snapshot.resources.agents || [], "agent");
2116
2316
  addResources(snapshot.resources.messages.events, "event");
2117
2317
  addResources(snapshot.resources.messages.commands, "command");
2118
2318
  addResources(snapshot.resources.messages.queries, "query");
@@ -2224,7 +2424,7 @@ var getRelationshipKey = (serviceId, resourceId, resourceVersion, direction) =>
2224
2424
  };
2225
2425
  var extractRelationships = (snapshot) => {
2226
2426
  const relationships = /* @__PURE__ */ new Map();
2227
- for (const service of snapshot.resources.services) {
2427
+ for (const service of [...snapshot.resources.services, ...snapshot.resources.agents || []]) {
2228
2428
  for (const direction of ["sends", "receives"]) {
2229
2429
  const pointers = service[direction] || [];
2230
2430
  for (const pointer of pointers) {
@@ -2262,7 +2462,7 @@ var computeRelationshipDiff = (snapshotA, snapshotB) => {
2262
2462
  var SNAPSHOT_VERSION = "1.0.0";
2263
2463
  var getEventCatalogVersion2 = (catalogDir) => {
2264
2464
  try {
2265
- const packageJson = import_node_fs8.default.readFileSync(import_node_path16.default.join(catalogDir, "package.json"), "utf8");
2465
+ const packageJson = import_node_fs8.default.readFileSync(import_node_path17.default.join(catalogDir, "package.json"), "utf8");
2266
2466
  const packageJsonObject = JSON.parse(packageJson);
2267
2467
  return packageJsonObject["dependencies"]?.["@eventcatalog/core"] ?? "unknown";
2268
2468
  } catch {
@@ -2318,9 +2518,10 @@ var createSnapshot = (directory) => {
2318
2518
  return async (options) => {
2319
2519
  const { label, outputDir, git } = options || {};
2320
2520
  const sdk = src_default(directory);
2321
- const [domains, services, events, commands, queries, channels] = await Promise.all([
2521
+ const [domains, services, agents, events, commands, queries, channels] = await Promise.all([
2322
2522
  sdk.getDomains(),
2323
2523
  sdk.getServices(),
2524
+ sdk.getAgents(),
2324
2525
  sdk.getEvents(),
2325
2526
  sdk.getCommands(),
2326
2527
  sdk.getQueries(),
@@ -2333,6 +2534,7 @@ var createSnapshot = (directory) => {
2333
2534
  ]);
2334
2535
  const snapshotDomains = stripToCore(domains);
2335
2536
  const snapshotServices = stripToCore(services);
2537
+ const snapshotAgents = stripToCore(agents);
2336
2538
  const snapshotEvents = stripToCore(events);
2337
2539
  const snapshotCommands = stripToCore(commands);
2338
2540
  const snapshotQueries = stripToCore(queries);
@@ -2348,6 +2550,7 @@ var createSnapshot = (directory) => {
2348
2550
  resources: {
2349
2551
  domains: snapshotDomains,
2350
2552
  services: snapshotServices,
2553
+ agents: snapshotAgents,
2351
2554
  messages: {
2352
2555
  events: snapshotEvents,
2353
2556
  commands: snapshotCommands,
@@ -2356,10 +2559,10 @@ var createSnapshot = (directory) => {
2356
2559
  channels: snapshotChannels
2357
2560
  }
2358
2561
  };
2359
- const snapshotsDir = outputDir || import_node_path16.default.join(directory, ".snapshots");
2562
+ const snapshotsDir = outputDir || import_node_path17.default.join(directory, ".snapshots");
2360
2563
  import_node_fs8.default.mkdirSync(snapshotsDir, { recursive: true });
2361
2564
  const fileName = `${snapshotLabel}.snapshot.json`;
2362
- const filePath = import_node_path16.default.join(snapshotsDir, fileName);
2565
+ const filePath = import_node_path17.default.join(snapshotsDir, fileName);
2363
2566
  import_node_fs8.default.writeFileSync(filePath, JSON.stringify(snapshot));
2364
2567
  return { filePath, snapshot };
2365
2568
  };
@@ -2390,13 +2593,13 @@ var diffSnapshots = (directory) => async (snapshotAPath, snapshotBPath) => {
2390
2593
  };
2391
2594
  };
2392
2595
  var listSnapshots = (directory) => async () => {
2393
- const snapshotsDir = import_node_path16.default.join(directory, ".snapshots");
2596
+ const snapshotsDir = import_node_path17.default.join(directory, ".snapshots");
2394
2597
  if (!import_node_fs8.default.existsSync(snapshotsDir)) return [];
2395
2598
  const files = import_node_fs8.default.readdirSync(snapshotsDir).filter((f) => f.endsWith(".snapshot.json"));
2396
2599
  const snapshots = [];
2397
2600
  for (const file of files) {
2398
2601
  try {
2399
- const filePath = import_node_path16.default.join(snapshotsDir, file);
2602
+ const filePath = import_node_path17.default.join(snapshotsDir, file);
2400
2603
  const content = JSON.parse(import_node_fs8.default.readFileSync(filePath, "utf-8"));
2401
2604
  snapshots.push({
2402
2605
  label: content.label,
@@ -2411,9 +2614,9 @@ var listSnapshots = (directory) => async () => {
2411
2614
  };
2412
2615
 
2413
2616
  // src/changelogs.ts
2414
- var import_node_path17 = __toESM(require("path"));
2617
+ var import_node_path18 = __toESM(require("path"));
2415
2618
  var import_node_fs9 = __toESM(require("fs"));
2416
- var import_promises10 = __toESM(require("fs/promises"));
2619
+ var import_promises11 = __toESM(require("fs/promises"));
2417
2620
  var import_gray_matter8 = __toESM(require("gray-matter"));
2418
2621
  var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
2419
2622
  const { version, format = "mdx" } = options;
@@ -2421,8 +2624,8 @@ var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
2421
2624
  if (!resourceFile) {
2422
2625
  throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
2423
2626
  }
2424
- const resourceDir = (0, import_node_path17.dirname)(resourceFile);
2425
- const changelogPath = import_node_path17.default.join(resourceDir, `changelog.${format}`);
2627
+ const resourceDir = (0, import_node_path18.dirname)(resourceFile);
2628
+ const changelogPath = import_node_path18.default.join(resourceDir, `changelog.${format}`);
2426
2629
  const { markdown, ...frontmatter } = changelog;
2427
2630
  const fm = { ...frontmatter };
2428
2631
  if (fm.createdAt instanceof Date) {
@@ -2442,9 +2645,9 @@ var appendChangelog = (catalogDir) => async (id, changelog, options = {}) => {
2442
2645
  if (!resourceFile) {
2443
2646
  throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
2444
2647
  }
2445
- const resourceDir = (0, import_node_path17.dirname)(resourceFile);
2446
- const mdxPath = import_node_path17.default.join(resourceDir, "changelog.mdx");
2447
- const mdPath = import_node_path17.default.join(resourceDir, "changelog.md");
2648
+ const resourceDir = (0, import_node_path18.dirname)(resourceFile);
2649
+ const mdxPath = import_node_path18.default.join(resourceDir, "changelog.mdx");
2650
+ const mdPath = import_node_path18.default.join(resourceDir, "changelog.md");
2448
2651
  const existingPath = import_node_fs9.default.existsSync(mdxPath) ? mdxPath : import_node_fs9.default.existsSync(mdPath) ? mdPath : void 0;
2449
2652
  if (!existingPath) {
2450
2653
  return writeChangelog(catalogDir)(id, changelog, options);
@@ -2472,9 +2675,9 @@ var getChangelog = (catalogDir) => async (id, options = {}) => {
2472
2675
  const { version } = options;
2473
2676
  const resourceFile = await findFileById(catalogDir, id, version);
2474
2677
  if (!resourceFile) return void 0;
2475
- const resourceDir = (0, import_node_path17.dirname)(resourceFile);
2476
- const mdxPath = import_node_path17.default.join(resourceDir, "changelog.mdx");
2477
- const mdPath = import_node_path17.default.join(resourceDir, "changelog.md");
2678
+ const resourceDir = (0, import_node_path18.dirname)(resourceFile);
2679
+ const mdxPath = import_node_path18.default.join(resourceDir, "changelog.mdx");
2680
+ const mdPath = import_node_path18.default.join(resourceDir, "changelog.md");
2478
2681
  const changelogPath = import_node_fs9.default.existsSync(mdxPath) ? mdxPath : import_node_fs9.default.existsSync(mdPath) ? mdPath : void 0;
2479
2682
  if (!changelogPath) return void 0;
2480
2683
  const { data, content } = import_gray_matter8.default.read(changelogPath);
@@ -2486,21 +2689,21 @@ var rmChangelog = (catalogDir) => async (id, options = {}) => {
2486
2689
  if (!resourceFile) {
2487
2690
  throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
2488
2691
  }
2489
- const resourceDir = (0, import_node_path17.dirname)(resourceFile);
2490
- const mdxPath = import_node_path17.default.join(resourceDir, "changelog.mdx");
2491
- const mdPath = import_node_path17.default.join(resourceDir, "changelog.md");
2692
+ const resourceDir = (0, import_node_path18.dirname)(resourceFile);
2693
+ const mdxPath = import_node_path18.default.join(resourceDir, "changelog.mdx");
2694
+ const mdPath = import_node_path18.default.join(resourceDir, "changelog.md");
2492
2695
  if (import_node_fs9.default.existsSync(mdxPath)) {
2493
- await import_promises10.default.rm(mdxPath);
2696
+ await import_promises11.default.rm(mdxPath);
2494
2697
  }
2495
2698
  if (import_node_fs9.default.existsSync(mdPath)) {
2496
- await import_promises10.default.rm(mdPath);
2699
+ await import_promises11.default.rm(mdPath);
2497
2700
  }
2498
2701
  invalidateFileCache();
2499
2702
  };
2500
2703
 
2501
2704
  // src/entities.ts
2502
- var import_promises11 = __toESM(require("fs/promises"));
2503
- var import_node_path18 = require("path");
2705
+ var import_promises12 = __toESM(require("fs/promises"));
2706
+ var import_node_path19 = require("path");
2504
2707
  var getEntity = (directory) => async (id, version) => getResource(directory, id, version, { type: "entity" });
2505
2708
  var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
2506
2709
  var writeEntity = (directory) => async (entity, options = {
@@ -2509,7 +2712,7 @@ var writeEntity = (directory) => async (entity, options = {
2509
2712
  format: "mdx"
2510
2713
  }) => writeResource(directory, { ...entity }, { ...options, type: "entity" });
2511
2714
  var rmEntity = (directory) => async (path8) => {
2512
- await import_promises11.default.rm((0, import_node_path18.join)(directory, path8), { recursive: true });
2715
+ await import_promises12.default.rm((0, import_node_path19.join)(directory, path8), { recursive: true });
2513
2716
  invalidateFileCache();
2514
2717
  };
2515
2718
  var rmEntityById = (directory) => async (id, version, persistFiles) => {
@@ -2522,13 +2725,14 @@ var entityHasVersion = (directory) => async (id, version) => {
2522
2725
  };
2523
2726
 
2524
2727
  // src/flows.ts
2525
- var import_promises12 = __toESM(require("fs/promises"));
2526
- var import_node_path19 = require("path");
2728
+ var import_promises13 = __toESM(require("fs/promises"));
2729
+ var import_node_path20 = require("path");
2527
2730
 
2528
2731
  // src/flow-builder.ts
2529
2732
  var cloneStep = (step) => ({
2530
2733
  ...step,
2531
2734
  ...step.message ? { message: { ...step.message } } : {},
2735
+ ...step.agent ? { agent: { ...step.agent } } : {},
2532
2736
  ...step.service ? { service: { ...step.service } } : {},
2533
2737
  ...step.flow ? { flow: { ...step.flow } } : {},
2534
2738
  ...step.container ? { container: { ...step.container } } : {},
@@ -2677,6 +2881,40 @@ var FlowBuilder = class _FlowBuilder {
2677
2881
  step.nextSteps
2678
2882
  );
2679
2883
  }
2884
+ /**
2885
+ * Add an agent step.
2886
+ *
2887
+ * @param step - The agent step payload.
2888
+ *
2889
+ * @example
2890
+ * ```ts
2891
+ * FlowBuilder.create({
2892
+ * id: 'OrderFlow',
2893
+ * name: 'Order Flow',
2894
+ * version: '1.0.0',
2895
+ * markdown: '',
2896
+ * })
2897
+ * .addAgentStep({
2898
+ * id: 'FraudReviewAgent',
2899
+ * agent: { id: 'FraudReviewAgent', version: '1.0.0' },
2900
+ * });
2901
+ * ```
2902
+ */
2903
+ addAgentStep(step) {
2904
+ const agent = step.agent || {
2905
+ id: String(step.id),
2906
+ ...step.version ? { version: step.version } : {}
2907
+ };
2908
+ return this.addStepWithNext(
2909
+ {
2910
+ id: step.id,
2911
+ title: step.title || String(step.id),
2912
+ ...step.summary ? { summary: step.summary } : {},
2913
+ agent: { ...agent, ...step.version && !agent.version ? { version: step.version } : {} }
2914
+ },
2915
+ step.nextSteps
2916
+ );
2917
+ }
2680
2918
  /**
2681
2919
  * Add a data store step.
2682
2920
  *
@@ -2970,16 +3208,21 @@ var writeVersionedFlow = (directory) => async (flow) => {
2970
3208
  };
2971
3209
  var writeFlowToDomain = (directory) => async (flow, domain, options = { path: "", format: "mdx", override: false }) => {
2972
3210
  let pathForFlow = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/flows` : `/${domain.id}/flows`;
2973
- pathForFlow = (0, import_node_path19.join)(pathForFlow, flow.id);
3211
+ pathForFlow = (0, import_node_path20.join)(pathForFlow, flow.id);
2974
3212
  await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
2975
3213
  };
2976
3214
  var writeFlowToService = (directory) => async (flow, service, options = { path: "", format: "mdx", override: false }) => {
2977
3215
  let pathForFlow = service.version && service.version !== "latest" ? `/${service.id}/versioned/${service.version}/flows` : `/${service.id}/flows`;
2978
- pathForFlow = (0, import_node_path19.join)(pathForFlow, flow.id);
3216
+ pathForFlow = (0, import_node_path20.join)(pathForFlow, flow.id);
3217
+ await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
3218
+ };
3219
+ var writeFlowToAgent = (directory) => async (flow, agent, options = { path: "", format: "mdx", override: false }) => {
3220
+ let pathForFlow = agent.version && agent.version !== "latest" ? `/${agent.id}/versioned/${agent.version}/flows` : `/${agent.id}/flows`;
3221
+ pathForFlow = (0, import_node_path20.join)(pathForFlow, flow.id);
2979
3222
  await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
2980
3223
  };
2981
3224
  var rmFlow = (directory) => async (path8) => {
2982
- await import_promises12.default.rm((0, import_node_path19.join)(directory, path8), { recursive: true });
3225
+ await import_promises13.default.rm((0, import_node_path20.join)(directory, path8), { recursive: true });
2983
3226
  invalidateFileCache();
2984
3227
  };
2985
3228
  var rmFlowById = (directory) => async (id, version, persistFiles) => {
@@ -2993,8 +3236,8 @@ var flowHasVersion = (directory) => async (id, version) => {
2993
3236
  var addFileToFlow = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version, { type: "flow" });
2994
3237
 
2995
3238
  // src/containers.ts
2996
- var import_promises13 = __toESM(require("fs/promises"));
2997
- var import_node_path20 = require("path");
3239
+ var import_promises14 = __toESM(require("fs/promises"));
3240
+ var import_node_path21 = require("path");
2998
3241
  var getContainer = (directory) => async (id, version) => getResource(directory, id, version, { type: "container" });
2999
3242
  var getContainers = (directory) => async (options) => getResources(directory, { type: "containers", latestOnly: options?.latestOnly });
3000
3243
  var writeContainer = (directory) => async (data, options = {
@@ -3004,7 +3247,7 @@ var writeContainer = (directory) => async (data, options = {
3004
3247
  }) => writeResource(directory, { ...data }, { ...options, type: "container" });
3005
3248
  var versionContainer = (directory) => async (id) => versionResource(directory, id);
3006
3249
  var rmContainer = (directory) => async (path8) => {
3007
- await import_promises13.default.rm((0, import_node_path20.join)(directory, path8), { recursive: true });
3250
+ await import_promises14.default.rm((0, import_node_path21.join)(directory, path8), { recursive: true });
3008
3251
  invalidateFileCache();
3009
3252
  };
3010
3253
  var rmContainerById = (directory) => async (id, version, persistFiles) => {
@@ -3021,7 +3264,7 @@ var writeContainerToService = (directory) => async (container, service, options
3021
3264
  throw new Error("Service not found");
3022
3265
  }
3023
3266
  let pathForContainer = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/containers` : `${resourcePath.directory}/containers`;
3024
- pathForContainer = (0, import_node_path20.join)(pathForContainer, container.id);
3267
+ pathForContainer = (0, import_node_path21.join)(pathForContainer, container.id);
3025
3268
  await writeResource(directory, { ...container }, { ...options, path: pathForContainer, type: "container" });
3026
3269
  };
3027
3270
 
@@ -3037,8 +3280,8 @@ var addFileToDataStore = addFileToContainer;
3037
3280
  var writeDataStoreToService = writeContainerToService;
3038
3281
 
3039
3282
  // src/data-products.ts
3040
- var import_promises14 = __toESM(require("fs/promises"));
3041
- var import_node_path21 = require("path");
3283
+ var import_promises15 = __toESM(require("fs/promises"));
3284
+ var import_node_path22 = require("path");
3042
3285
  var getDataProduct = (directory) => async (id, version) => getResource(directory, id, version, { type: "data-product" });
3043
3286
  var getDataProducts = (directory) => async (options) => getResources(directory, { type: "data-products", latestOnly: options?.latestOnly });
3044
3287
  var writeDataProduct = (directory) => async (dataProduct, options = {
@@ -3048,11 +3291,11 @@ var writeDataProduct = (directory) => async (dataProduct, options = {
3048
3291
  }) => writeResource(directory, { ...dataProduct }, { ...options, type: "data-product" });
3049
3292
  var writeDataProductToDomain = (directory) => async (dataProduct, domain, options = { path: "", format: "mdx", override: false }) => {
3050
3293
  let pathForDataProduct = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/data-products` : `/${domain.id}/data-products`;
3051
- pathForDataProduct = (0, import_node_path21.join)(pathForDataProduct, dataProduct.id);
3294
+ pathForDataProduct = (0, import_node_path22.join)(pathForDataProduct, dataProduct.id);
3052
3295
  await writeResource(directory, { ...dataProduct }, { ...options, path: pathForDataProduct, type: "data-product" });
3053
3296
  };
3054
3297
  var rmDataProduct = (directory) => async (path8) => {
3055
- await import_promises14.default.rm((0, import_node_path21.join)(directory, path8), { recursive: true });
3298
+ await import_promises15.default.rm((0, import_node_path22.join)(directory, path8), { recursive: true });
3056
3299
  invalidateFileCache();
3057
3300
  };
3058
3301
  var rmDataProductById = (directory) => async (id, version, persistFiles) => {
@@ -3066,8 +3309,8 @@ var dataProductHasVersion = (directory) => async (id, version) => {
3066
3309
  var addFileToDataProduct = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
3067
3310
 
3068
3311
  // src/diagrams.ts
3069
- var import_promises15 = __toESM(require("fs/promises"));
3070
- var import_node_path22 = require("path");
3312
+ var import_promises16 = __toESM(require("fs/promises"));
3313
+ var import_node_path23 = require("path");
3071
3314
  var getDiagram = (directory) => async (id, version) => getResource(directory, id, version, { type: "diagram" });
3072
3315
  var getDiagrams = (directory) => async (options) => getResources(directory, { type: "diagrams", latestOnly: options?.latestOnly });
3073
3316
  var writeDiagram = (directory) => async (diagram, options = {
@@ -3076,7 +3319,7 @@ var writeDiagram = (directory) => async (diagram, options = {
3076
3319
  format: "mdx"
3077
3320
  }) => writeResource(directory, { ...diagram }, { ...options, type: "diagram" });
3078
3321
  var rmDiagram = (directory) => async (path8) => {
3079
- await import_promises15.default.rm((0, import_node_path22.join)(directory, path8), { recursive: true });
3322
+ await import_promises16.default.rm((0, import_node_path23.join)(directory, path8), { recursive: true });
3080
3323
  invalidateFileCache();
3081
3324
  };
3082
3325
  var rmDiagramById = (directory) => async (id, version, persistFiles) => {
@@ -3098,13 +3341,13 @@ var src_default = (path8) => {
3098
3341
  * @param version - Optional id of the version to get (supports semver)
3099
3342
  * @returns Event|Undefined
3100
3343
  */
3101
- getEvent: getEvent((0, import_node_path23.join)(path8)),
3344
+ getEvent: getEvent((0, import_node_path24.join)(path8)),
3102
3345
  /**
3103
3346
  * Returns all events from EventCatalog
3104
3347
  * @param latestOnly - optional boolean, set to true to get only latest versions
3105
3348
  * @returns Event[]|Undefined
3106
3349
  */
3107
- getEvents: getEvents((0, import_node_path23.join)(path8)),
3350
+ getEvents: getEvents((0, import_node_path24.join)(path8)),
3108
3351
  /**
3109
3352
  * Adds an event to EventCatalog
3110
3353
  *
@@ -3112,7 +3355,7 @@ var src_default = (path8) => {
3112
3355
  * @param options - Optional options to write the event
3113
3356
  *
3114
3357
  */
3115
- writeEvent: writeEvent((0, import_node_path23.join)(path8, "events")),
3358
+ writeEvent: writeEvent((0, import_node_path24.join)(path8, "events")),
3116
3359
  /**
3117
3360
  * Adds an event to a service in EventCatalog
3118
3361
  *
@@ -3121,26 +3364,35 @@ var src_default = (path8) => {
3121
3364
  * @param options - Optional options to write the event
3122
3365
  *
3123
3366
  */
3124
- writeEventToService: writeEventToService((0, import_node_path23.join)(path8)),
3367
+ writeEventToService: writeEventToService((0, import_node_path24.join)(path8)),
3368
+ /**
3369
+ * Adds an event to an agent in EventCatalog
3370
+ *
3371
+ * @param event - The event to write to the agent
3372
+ * @param agent - The agent and its id to write the event to
3373
+ * @param options - Optional options to write the event
3374
+ *
3375
+ */
3376
+ writeEventToAgent: writeEventToAgent((0, import_node_path24.join)(path8)),
3125
3377
  /**
3126
3378
  * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
3127
3379
  *
3128
3380
  * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
3129
3381
  *
3130
3382
  */
3131
- rmEvent: rmEvent((0, import_node_path23.join)(path8, "events")),
3383
+ rmEvent: rmEvent((0, import_node_path24.join)(path8, "events")),
3132
3384
  /**
3133
3385
  * Remove an event by an Event id
3134
3386
  *
3135
3387
  * @param id - The id of the event you want to remove
3136
3388
  *
3137
3389
  */
3138
- rmEventById: rmEventById((0, import_node_path23.join)(path8)),
3390
+ rmEventById: rmEventById((0, import_node_path24.join)(path8)),
3139
3391
  /**
3140
3392
  * Moves a given event id to the version directory
3141
3393
  * @param directory
3142
3394
  */
3143
- versionEvent: versionEvent((0, import_node_path23.join)(path8)),
3395
+ versionEvent: versionEvent((0, import_node_path24.join)(path8)),
3144
3396
  /**
3145
3397
  * Adds a file to the given event
3146
3398
  * @param id - The id of the event to add the file to
@@ -3148,7 +3400,7 @@ var src_default = (path8) => {
3148
3400
  * @param version - Optional version of the event to add the file to
3149
3401
  * @returns
3150
3402
  */
3151
- addFileToEvent: addFileToEvent((0, import_node_path23.join)(path8)),
3403
+ addFileToEvent: addFileToEvent((0, import_node_path24.join)(path8)),
3152
3404
  /**
3153
3405
  * Adds a schema to the given event
3154
3406
  * @param id - The id of the event to add the schema to
@@ -3156,17 +3408,17 @@ var src_default = (path8) => {
3156
3408
  * @param version - Optional version of the event to add the schema to
3157
3409
  * @returns
3158
3410
  */
3159
- addSchemaToEvent: addSchemaToEvent((0, import_node_path23.join)(path8)),
3411
+ addSchemaToEvent: addSchemaToEvent((0, import_node_path24.join)(path8)),
3160
3412
  /**
3161
3413
  * Check to see if an event version exists
3162
3414
  * @param id - The id of the event
3163
3415
  * @param version - The version of the event (supports semver)
3164
3416
  * @returns
3165
3417
  */
3166
- eventHasVersion: eventHasVersion((0, import_node_path23.join)(path8)),
3167
- addExampleToEvent: addExampleToEvent((0, import_node_path23.join)(path8)),
3168
- getExamplesFromEvent: getExamplesFromEvent((0, import_node_path23.join)(path8)),
3169
- removeExampleFromEvent: removeExampleFromEvent((0, import_node_path23.join)(path8)),
3418
+ eventHasVersion: eventHasVersion((0, import_node_path24.join)(path8)),
3419
+ addExampleToEvent: addExampleToEvent((0, import_node_path24.join)(path8)),
3420
+ getExamplesFromEvent: getExamplesFromEvent((0, import_node_path24.join)(path8)),
3421
+ removeExampleFromEvent: removeExampleFromEvent((0, import_node_path24.join)(path8)),
3170
3422
  /**
3171
3423
  * ================================
3172
3424
  * Commands
@@ -3178,13 +3430,13 @@ var src_default = (path8) => {
3178
3430
  * @param version - Optional id of the version to get (supports semver)
3179
3431
  * @returns Command|Undefined
3180
3432
  */
3181
- getCommand: getCommand((0, import_node_path23.join)(path8)),
3433
+ getCommand: getCommand((0, import_node_path24.join)(path8)),
3182
3434
  /**
3183
3435
  * Returns all commands from EventCatalog
3184
3436
  * @param latestOnly - optional boolean, set to true to get only latest versions
3185
3437
  * @returns Command[]|Undefined
3186
3438
  */
3187
- getCommands: getCommands((0, import_node_path23.join)(path8)),
3439
+ getCommands: getCommands((0, import_node_path24.join)(path8)),
3188
3440
  /**
3189
3441
  * Adds an command to EventCatalog
3190
3442
  *
@@ -3192,7 +3444,7 @@ var src_default = (path8) => {
3192
3444
  * @param options - Optional options to write the command
3193
3445
  *
3194
3446
  */
3195
- writeCommand: writeCommand((0, import_node_path23.join)(path8, "commands")),
3447
+ writeCommand: writeCommand((0, import_node_path24.join)(path8, "commands")),
3196
3448
  /**
3197
3449
  * Adds a command to a service in EventCatalog
3198
3450
  *
@@ -3201,26 +3453,35 @@ var src_default = (path8) => {
3201
3453
  * @param options - Optional options to write the command
3202
3454
  *
3203
3455
  */
3204
- writeCommandToService: writeCommandToService((0, import_node_path23.join)(path8)),
3456
+ writeCommandToService: writeCommandToService((0, import_node_path24.join)(path8)),
3457
+ /**
3458
+ * Adds a command to an agent in EventCatalog
3459
+ *
3460
+ * @param command - The command to write to the agent
3461
+ * @param agent - The agent and its id to write the command to
3462
+ * @param options - Optional options to write the command
3463
+ *
3464
+ */
3465
+ writeCommandToAgent: writeCommandToAgent((0, import_node_path24.join)(path8)),
3205
3466
  /**
3206
3467
  * Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
3207
3468
  *
3208
3469
  * @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
3209
3470
  *
3210
3471
  */
3211
- rmCommand: rmCommand((0, import_node_path23.join)(path8, "commands")),
3472
+ rmCommand: rmCommand((0, import_node_path24.join)(path8, "commands")),
3212
3473
  /**
3213
3474
  * Remove an command by an Event id
3214
3475
  *
3215
3476
  * @param id - The id of the command you want to remove
3216
3477
  *
3217
3478
  */
3218
- rmCommandById: rmCommandById((0, import_node_path23.join)(path8)),
3479
+ rmCommandById: rmCommandById((0, import_node_path24.join)(path8)),
3219
3480
  /**
3220
3481
  * Moves a given command id to the version directory
3221
3482
  * @param directory
3222
3483
  */
3223
- versionCommand: versionCommand((0, import_node_path23.join)(path8)),
3484
+ versionCommand: versionCommand((0, import_node_path24.join)(path8)),
3224
3485
  /**
3225
3486
  * Adds a file to the given command
3226
3487
  * @param id - The id of the command to add the file to
@@ -3228,7 +3489,7 @@ var src_default = (path8) => {
3228
3489
  * @param version - Optional version of the command to add the file to
3229
3490
  * @returns
3230
3491
  */
3231
- addFileToCommand: addFileToCommand((0, import_node_path23.join)(path8)),
3492
+ addFileToCommand: addFileToCommand((0, import_node_path24.join)(path8)),
3232
3493
  /**
3233
3494
  * Adds a schema to the given command
3234
3495
  * @param id - The id of the command to add the schema to
@@ -3236,17 +3497,17 @@ var src_default = (path8) => {
3236
3497
  * @param version - Optional version of the command to add the schema to
3237
3498
  * @returns
3238
3499
  */
3239
- addSchemaToCommand: addSchemaToCommand((0, import_node_path23.join)(path8)),
3500
+ addSchemaToCommand: addSchemaToCommand((0, import_node_path24.join)(path8)),
3240
3501
  /**
3241
3502
  * Check to see if a command version exists
3242
3503
  * @param id - The id of the command
3243
3504
  * @param version - The version of the command (supports semver)
3244
3505
  * @returns
3245
3506
  */
3246
- commandHasVersion: commandHasVersion((0, import_node_path23.join)(path8)),
3247
- addExampleToCommand: addExampleToCommand((0, import_node_path23.join)(path8)),
3248
- getExamplesFromCommand: getExamplesFromCommand((0, import_node_path23.join)(path8)),
3249
- removeExampleFromCommand: removeExampleFromCommand((0, import_node_path23.join)(path8)),
3507
+ commandHasVersion: commandHasVersion((0, import_node_path24.join)(path8)),
3508
+ addExampleToCommand: addExampleToCommand((0, import_node_path24.join)(path8)),
3509
+ getExamplesFromCommand: getExamplesFromCommand((0, import_node_path24.join)(path8)),
3510
+ removeExampleFromCommand: removeExampleFromCommand((0, import_node_path24.join)(path8)),
3250
3511
  /**
3251
3512
  * ================================
3252
3513
  * Queries
@@ -3258,13 +3519,13 @@ var src_default = (path8) => {
3258
3519
  * @param version - Optional id of the version to get (supports semver)
3259
3520
  * @returns Query|Undefined
3260
3521
  */
3261
- getQuery: getQuery((0, import_node_path23.join)(path8)),
3522
+ getQuery: getQuery((0, import_node_path24.join)(path8)),
3262
3523
  /**
3263
3524
  * Returns all queries from EventCatalog
3264
3525
  * @param latestOnly - optional boolean, set to true to get only latest versions
3265
3526
  * @returns Query[]|Undefined
3266
3527
  */
3267
- getQueries: getQueries((0, import_node_path23.join)(path8)),
3528
+ getQueries: getQueries((0, import_node_path24.join)(path8)),
3268
3529
  /**
3269
3530
  * Adds a query to EventCatalog
3270
3531
  *
@@ -3272,7 +3533,7 @@ var src_default = (path8) => {
3272
3533
  * @param options - Optional options to write the event
3273
3534
  *
3274
3535
  */
3275
- writeQuery: writeQuery((0, import_node_path23.join)(path8, "queries")),
3536
+ writeQuery: writeQuery((0, import_node_path24.join)(path8, "queries")),
3276
3537
  /**
3277
3538
  * Adds a query to a service in EventCatalog
3278
3539
  *
@@ -3281,26 +3542,35 @@ var src_default = (path8) => {
3281
3542
  * @param options - Optional options to write the query
3282
3543
  *
3283
3544
  */
3284
- writeQueryToService: writeQueryToService((0, import_node_path23.join)(path8)),
3545
+ writeQueryToService: writeQueryToService((0, import_node_path24.join)(path8)),
3546
+ /**
3547
+ * Adds a query to an agent in EventCatalog
3548
+ *
3549
+ * @param query - The query to write to the agent
3550
+ * @param agent - The agent and its id to write the query to
3551
+ * @param options - Optional options to write the query
3552
+ *
3553
+ */
3554
+ writeQueryToAgent: writeQueryToAgent((0, import_node_path24.join)(path8)),
3285
3555
  /**
3286
3556
  * Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
3287
3557
  *
3288
3558
  * @param path - The path to your query, e.g. `/Orders/GetOrder`
3289
3559
  *
3290
3560
  */
3291
- rmQuery: rmQuery((0, import_node_path23.join)(path8, "queries")),
3561
+ rmQuery: rmQuery((0, import_node_path24.join)(path8, "queries")),
3292
3562
  /**
3293
3563
  * Remove a query by a Query id
3294
3564
  *
3295
3565
  * @param id - The id of the query you want to remove
3296
3566
  *
3297
3567
  */
3298
- rmQueryById: rmQueryById((0, import_node_path23.join)(path8)),
3568
+ rmQueryById: rmQueryById((0, import_node_path24.join)(path8)),
3299
3569
  /**
3300
3570
  * Moves a given query id to the version directory
3301
3571
  * @param directory
3302
3572
  */
3303
- versionQuery: versionQuery((0, import_node_path23.join)(path8)),
3573
+ versionQuery: versionQuery((0, import_node_path24.join)(path8)),
3304
3574
  /**
3305
3575
  * Adds a file to the given query
3306
3576
  * @param id - The id of the query to add the file to
@@ -3308,7 +3578,7 @@ var src_default = (path8) => {
3308
3578
  * @param version - Optional version of the query to add the file to
3309
3579
  * @returns
3310
3580
  */
3311
- addFileToQuery: addFileToQuery((0, import_node_path23.join)(path8)),
3581
+ addFileToQuery: addFileToQuery((0, import_node_path24.join)(path8)),
3312
3582
  /**
3313
3583
  * Adds a schema to the given query
3314
3584
  * @param id - The id of the query to add the schema to
@@ -3316,17 +3586,17 @@ var src_default = (path8) => {
3316
3586
  * @param version - Optional version of the query to add the schema to
3317
3587
  * @returns
3318
3588
  */
3319
- addSchemaToQuery: addSchemaToQuery((0, import_node_path23.join)(path8)),
3589
+ addSchemaToQuery: addSchemaToQuery((0, import_node_path24.join)(path8)),
3320
3590
  /**
3321
3591
  * Check to see if an query version exists
3322
3592
  * @param id - The id of the query
3323
3593
  * @param version - The version of the query (supports semver)
3324
3594
  * @returns
3325
3595
  */
3326
- queryHasVersion: queryHasVersion((0, import_node_path23.join)(path8)),
3327
- addExampleToQuery: addExampleToQuery((0, import_node_path23.join)(path8)),
3328
- getExamplesFromQuery: getExamplesFromQuery((0, import_node_path23.join)(path8)),
3329
- removeExampleFromQuery: removeExampleFromQuery((0, import_node_path23.join)(path8)),
3596
+ queryHasVersion: queryHasVersion((0, import_node_path24.join)(path8)),
3597
+ addExampleToQuery: addExampleToQuery((0, import_node_path24.join)(path8)),
3598
+ getExamplesFromQuery: getExamplesFromQuery((0, import_node_path24.join)(path8)),
3599
+ removeExampleFromQuery: removeExampleFromQuery((0, import_node_path24.join)(path8)),
3330
3600
  /**
3331
3601
  * ================================
3332
3602
  * Channels
@@ -3338,13 +3608,13 @@ var src_default = (path8) => {
3338
3608
  * @param version - Optional id of the version to get (supports semver)
3339
3609
  * @returns Channel|Undefined
3340
3610
  */
3341
- getChannel: getChannel((0, import_node_path23.join)(path8)),
3611
+ getChannel: getChannel((0, import_node_path24.join)(path8)),
3342
3612
  /**
3343
3613
  * Returns all channels from EventCatalog
3344
3614
  * @param latestOnly - optional boolean, set to true to get only latest versions
3345
3615
  * @returns Channel[]|Undefined
3346
3616
  */
3347
- getChannels: getChannels((0, import_node_path23.join)(path8)),
3617
+ getChannels: getChannels((0, import_node_path24.join)(path8)),
3348
3618
  /**
3349
3619
  * Adds an channel to EventCatalog
3350
3620
  *
@@ -3352,33 +3622,33 @@ var src_default = (path8) => {
3352
3622
  * @param options - Optional options to write the channel
3353
3623
  *
3354
3624
  */
3355
- writeChannel: writeChannel((0, import_node_path23.join)(path8, "channels")),
3625
+ writeChannel: writeChannel((0, import_node_path24.join)(path8, "channels")),
3356
3626
  /**
3357
3627
  * Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
3358
3628
  *
3359
3629
  * @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
3360
3630
  *
3361
3631
  */
3362
- rmChannel: rmChannel((0, import_node_path23.join)(path8, "channels")),
3632
+ rmChannel: rmChannel((0, import_node_path24.join)(path8, "channels")),
3363
3633
  /**
3364
3634
  * Remove an channel by an Event id
3365
3635
  *
3366
3636
  * @param id - The id of the channel you want to remove
3367
3637
  *
3368
3638
  */
3369
- rmChannelById: rmChannelById((0, import_node_path23.join)(path8)),
3639
+ rmChannelById: rmChannelById((0, import_node_path24.join)(path8)),
3370
3640
  /**
3371
3641
  * Moves a given channel id to the version directory
3372
3642
  * @param directory
3373
3643
  */
3374
- versionChannel: versionChannel((0, import_node_path23.join)(path8)),
3644
+ versionChannel: versionChannel((0, import_node_path24.join)(path8)),
3375
3645
  /**
3376
3646
  * Check to see if a channel version exists
3377
3647
  * @param id - The id of the channel
3378
3648
  * @param version - The version of the channel (supports semver)
3379
3649
  * @returns
3380
3650
  */
3381
- channelHasVersion: channelHasVersion((0, import_node_path23.join)(path8)),
3651
+ channelHasVersion: channelHasVersion((0, import_node_path24.join)(path8)),
3382
3652
  /**
3383
3653
  * Add a channel to an event
3384
3654
  *
@@ -3395,7 +3665,7 @@ var src_default = (path8) => {
3395
3665
  *
3396
3666
  * ```
3397
3667
  */
3398
- addEventToChannel: addMessageToChannel((0, import_node_path23.join)(path8), "events"),
3668
+ addEventToChannel: addMessageToChannel((0, import_node_path24.join)(path8), "events"),
3399
3669
  /**
3400
3670
  * Add a channel to an command
3401
3671
  *
@@ -3412,7 +3682,7 @@ var src_default = (path8) => {
3412
3682
  *
3413
3683
  * ```
3414
3684
  */
3415
- addCommandToChannel: addMessageToChannel((0, import_node_path23.join)(path8), "commands"),
3685
+ addCommandToChannel: addMessageToChannel((0, import_node_path24.join)(path8), "commands"),
3416
3686
  /**
3417
3687
  * Add a channel to an query
3418
3688
  *
@@ -3429,7 +3699,7 @@ var src_default = (path8) => {
3429
3699
  *
3430
3700
  * ```
3431
3701
  */
3432
- addQueryToChannel: addMessageToChannel((0, import_node_path23.join)(path8), "queries"),
3702
+ addQueryToChannel: addMessageToChannel((0, import_node_path24.join)(path8), "queries"),
3433
3703
  /**
3434
3704
  * ================================
3435
3705
  * SERVICES
@@ -3442,14 +3712,14 @@ var src_default = (path8) => {
3442
3712
  * @param options - Optional options to write the event
3443
3713
  *
3444
3714
  */
3445
- writeService: writeService((0, import_node_path23.join)(path8, "services")),
3715
+ writeService: writeService((0, import_node_path24.join)(path8, "services")),
3446
3716
  /**
3447
3717
  * Adds a versioned service to EventCatalog
3448
3718
  *
3449
3719
  * @param service - The service to write
3450
3720
  *
3451
3721
  */
3452
- writeVersionedService: writeVersionedService((0, import_node_path23.join)(path8, "services")),
3722
+ writeVersionedService: writeVersionedService((0, import_node_path24.join)(path8, "services")),
3453
3723
  /**
3454
3724
  * Adds a service to a domain in EventCatalog
3455
3725
  *
@@ -3458,45 +3728,45 @@ var src_default = (path8) => {
3458
3728
  * @param options - Optional options to write the event
3459
3729
  *
3460
3730
  */
3461
- writeServiceToDomain: writeServiceToDomain((0, import_node_path23.join)(path8, "domains")),
3731
+ writeServiceToDomain: writeServiceToDomain((0, import_node_path24.join)(path8, "domains")),
3462
3732
  /**
3463
3733
  * Returns a service from EventCatalog
3464
3734
  * @param id - The id of the service to retrieve
3465
3735
  * @param version - Optional id of the version to get (supports semver)
3466
3736
  * @returns Service|Undefined
3467
3737
  */
3468
- getService: getService((0, import_node_path23.join)(path8)),
3738
+ getService: getService((0, import_node_path24.join)(path8)),
3469
3739
  /**
3470
3740
  * Returns a service from EventCatalog by it's path.
3471
3741
  * @param path - The path to the service to retrieve
3472
3742
  * @returns Service|Undefined
3473
3743
  */
3474
- getServiceByPath: getServiceByPath((0, import_node_path23.join)(path8)),
3744
+ getServiceByPath: getServiceByPath((0, import_node_path24.join)(path8)),
3475
3745
  /**
3476
3746
  * Returns all services from EventCatalog
3477
3747
  * @param latestOnly - optional boolean, set to true to get only latest versions
3478
3748
  * @returns Service[]|Undefined
3479
3749
  */
3480
- getServices: getServices((0, import_node_path23.join)(path8)),
3750
+ getServices: getServices((0, import_node_path24.join)(path8)),
3481
3751
  /**
3482
3752
  * Moves a given service id to the version directory
3483
3753
  * @param directory
3484
3754
  */
3485
- versionService: versionService((0, import_node_path23.join)(path8)),
3755
+ versionService: versionService((0, import_node_path24.join)(path8)),
3486
3756
  /**
3487
3757
  * Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
3488
3758
  *
3489
3759
  * @param path - The path to your service, e.g. `/InventoryService`
3490
3760
  *
3491
3761
  */
3492
- rmService: rmService((0, import_node_path23.join)(path8, "services")),
3762
+ rmService: rmService((0, import_node_path24.join)(path8, "services")),
3493
3763
  /**
3494
3764
  * Remove an service by an service id
3495
3765
  *
3496
3766
  * @param id - The id of the service you want to remove
3497
3767
  *
3498
3768
  */
3499
- rmServiceById: rmServiceById((0, import_node_path23.join)(path8)),
3769
+ rmServiceById: rmServiceById((0, import_node_path24.join)(path8)),
3500
3770
  /**
3501
3771
  * Adds a file to the given service
3502
3772
  * @param id - The id of the service to add the file to
@@ -3504,21 +3774,21 @@ var src_default = (path8) => {
3504
3774
  * @param version - Optional version of the service to add the file to
3505
3775
  * @returns
3506
3776
  */
3507
- addFileToService: addFileToService((0, import_node_path23.join)(path8)),
3777
+ addFileToService: addFileToService((0, import_node_path24.join)(path8)),
3508
3778
  /**
3509
3779
  * Returns the specifications for a given service
3510
3780
  * @param id - The id of the service to retrieve the specifications for
3511
3781
  * @param version - Optional version of the service
3512
3782
  * @returns
3513
3783
  */
3514
- getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path23.join)(path8)),
3784
+ getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path24.join)(path8)),
3515
3785
  /**
3516
3786
  * Check to see if a service version exists
3517
3787
  * @param id - The id of the service
3518
3788
  * @param version - The version of the service (supports semver)
3519
3789
  * @returns
3520
3790
  */
3521
- serviceHasVersion: serviceHasVersion((0, import_node_path23.join)(path8)),
3791
+ serviceHasVersion: serviceHasVersion((0, import_node_path24.join)(path8)),
3522
3792
  /**
3523
3793
  * Add an event to a service by it's id.
3524
3794
  *
@@ -3538,7 +3808,7 @@ var src_default = (path8) => {
3538
3808
  *
3539
3809
  * ```
3540
3810
  */
3541
- addEventToService: addMessageToService((0, import_node_path23.join)(path8)),
3811
+ addEventToService: addMessageToService((0, import_node_path24.join)(path8)),
3542
3812
  /**
3543
3813
  * Add a data store to a service by it's id.
3544
3814
  *
@@ -3555,7 +3825,7 @@ var src_default = (path8) => {
3555
3825
  *
3556
3826
  * ```
3557
3827
  */
3558
- addDataStoreToService: addDataStoreToService((0, import_node_path23.join)(path8)),
3828
+ addDataStoreToService: addDataStoreToService((0, import_node_path24.join)(path8)),
3559
3829
  /**
3560
3830
  * Add a command to a service by it's id.
3561
3831
  *
@@ -3575,7 +3845,7 @@ var src_default = (path8) => {
3575
3845
  *
3576
3846
  * ```
3577
3847
  */
3578
- addCommandToService: addMessageToService((0, import_node_path23.join)(path8)),
3848
+ addCommandToService: addMessageToService((0, import_node_path24.join)(path8)),
3579
3849
  /**
3580
3850
  * Add a query to a service by it's id.
3581
3851
  *
@@ -3595,7 +3865,7 @@ var src_default = (path8) => {
3595
3865
  *
3596
3866
  * ```
3597
3867
  */
3598
- addQueryToService: addMessageToService((0, import_node_path23.join)(path8)),
3868
+ addQueryToService: addMessageToService((0, import_node_path24.join)(path8)),
3599
3869
  /**
3600
3870
  * Add an entity to a service by its id.
3601
3871
  *
@@ -3613,7 +3883,7 @@ var src_default = (path8) => {
3613
3883
  *
3614
3884
  * ```
3615
3885
  */
3616
- addEntityToService: addEntityToService((0, import_node_path23.join)(path8)),
3886
+ addEntityToService: addEntityToService((0, import_node_path24.join)(path8)),
3617
3887
  /**
3618
3888
  * Check to see if a service exists by it's path.
3619
3889
  *
@@ -3630,13 +3900,36 @@ var src_default = (path8) => {
3630
3900
  * @param path - The path to the service to check
3631
3901
  * @returns boolean
3632
3902
  */
3633
- isService: isService((0, import_node_path23.join)(path8)),
3903
+ isService: isService((0, import_node_path24.join)(path8)),
3634
3904
  /**
3635
3905
  * Converts a file to a service.
3636
3906
  * @param file - The file to convert to a service.
3637
3907
  * @returns The service.
3638
3908
  */
3639
- toService: toService((0, import_node_path23.join)(path8)),
3909
+ toService: toService((0, import_node_path24.join)(path8)),
3910
+ /**
3911
+ * ================================
3912
+ * Agents
3913
+ * ================================
3914
+ */
3915
+ writeAgent: writeAgent((0, import_node_path24.join)(path8, "agents")),
3916
+ writeVersionedAgent: writeVersionedAgent((0, import_node_path24.join)(path8, "agents")),
3917
+ writeAgentToDomain: writeAgentToDomain((0, import_node_path24.join)(path8, "domains")),
3918
+ getAgent: getAgent((0, import_node_path24.join)(path8)),
3919
+ getAgentByPath: getAgentByPath((0, import_node_path24.join)(path8)),
3920
+ getAgents: getAgents((0, import_node_path24.join)(path8)),
3921
+ versionAgent: versionAgent((0, import_node_path24.join)(path8)),
3922
+ rmAgent: rmAgent((0, import_node_path24.join)(path8, "agents")),
3923
+ rmAgentById: rmAgentById((0, import_node_path24.join)(path8)),
3924
+ addFileToAgent: addFileToAgent((0, import_node_path24.join)(path8)),
3925
+ addEventToAgent: addMessageToAgent((0, import_node_path24.join)(path8)),
3926
+ addCommandToAgent: addMessageToAgent((0, import_node_path24.join)(path8)),
3927
+ addQueryToAgent: addMessageToAgent((0, import_node_path24.join)(path8)),
3928
+ addDataStoreToAgent: addDataStoreToAgent((0, import_node_path24.join)(path8)),
3929
+ addFlowToAgent: addFlowToAgent((0, import_node_path24.join)(path8)),
3930
+ agentHasVersion: agentHasVersion((0, import_node_path24.join)(path8)),
3931
+ isAgent: isAgent((0, import_node_path24.join)(path8)),
3932
+ toAgent: toAgent((0, import_node_path24.join)(path8)),
3640
3933
  /**
3641
3934
  * ================================
3642
3935
  * Domains
@@ -3649,39 +3942,39 @@ var src_default = (path8) => {
3649
3942
  * @param options - Optional options to write the event
3650
3943
  *
3651
3944
  */
3652
- writeDomain: writeDomain((0, import_node_path23.join)(path8, "domains")),
3945
+ writeDomain: writeDomain((0, import_node_path24.join)(path8, "domains")),
3653
3946
  /**
3654
3947
  * Returns a domain from EventCatalog
3655
3948
  * @param id - The id of the domain to retrieve
3656
3949
  * @param version - Optional id of the version to get (supports semver)
3657
3950
  * @returns Domain|Undefined
3658
3951
  */
3659
- getDomain: getDomain((0, import_node_path23.join)(path8, "domains")),
3952
+ getDomain: getDomain((0, import_node_path24.join)(path8, "domains")),
3660
3953
  /**
3661
3954
  * Returns all domains from EventCatalog
3662
3955
  * @param latestOnly - optional boolean, set to true to get only latest versions
3663
3956
  * @returns Domain[]|Undefined
3664
3957
  */
3665
- getDomains: getDomains((0, import_node_path23.join)(path8)),
3958
+ getDomains: getDomains((0, import_node_path24.join)(path8)),
3666
3959
  /**
3667
3960
  * Moves a given domain id to the version directory
3668
3961
  * @param directory
3669
3962
  */
3670
- versionDomain: versionDomain((0, import_node_path23.join)(path8, "domains")),
3963
+ versionDomain: versionDomain((0, import_node_path24.join)(path8, "domains")),
3671
3964
  /**
3672
3965
  * Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
3673
3966
  *
3674
3967
  * @param path - The path to your domain, e.g. `/Payment`
3675
3968
  *
3676
3969
  */
3677
- rmDomain: rmDomain((0, import_node_path23.join)(path8, "domains")),
3970
+ rmDomain: rmDomain((0, import_node_path24.join)(path8, "domains")),
3678
3971
  /**
3679
3972
  * Remove an service by an domain id
3680
3973
  *
3681
3974
  * @param id - The id of the domain you want to remove
3682
3975
  *
3683
3976
  */
3684
- rmDomainById: rmDomainById((0, import_node_path23.join)(path8, "domains")),
3977
+ rmDomainById: rmDomainById((0, import_node_path24.join)(path8, "domains")),
3685
3978
  /**
3686
3979
  * Adds a file to the given domain
3687
3980
  * @param id - The id of the domain to add the file to
@@ -3689,28 +3982,28 @@ var src_default = (path8) => {
3689
3982
  * @param version - Optional version of the domain to add the file to
3690
3983
  * @returns
3691
3984
  */
3692
- addFileToDomain: addFileToDomain((0, import_node_path23.join)(path8, "domains")),
3985
+ addFileToDomain: addFileToDomain((0, import_node_path24.join)(path8, "domains")),
3693
3986
  /**
3694
3987
  * Adds an ubiquitous language dictionary to a domain
3695
3988
  * @param id - The id of the domain to add the ubiquitous language to
3696
3989
  * @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
3697
3990
  * @param version - Optional version of the domain to add the ubiquitous language to
3698
3991
  */
3699
- addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path23.join)(path8, "domains")),
3992
+ addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path24.join)(path8, "domains")),
3700
3993
  /**
3701
3994
  * Get the ubiquitous language dictionary from a domain
3702
3995
  * @param id - The id of the domain to get the ubiquitous language from
3703
3996
  * @param version - Optional version of the domain to get the ubiquitous language from
3704
3997
  * @returns
3705
3998
  */
3706
- getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path23.join)(path8, "domains")),
3999
+ getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path24.join)(path8, "domains")),
3707
4000
  /**
3708
4001
  * Check to see if a domain version exists
3709
4002
  * @param id - The id of the domain
3710
4003
  * @param version - The version of the domain (supports semver)
3711
4004
  * @returns
3712
4005
  */
3713
- domainHasVersion: domainHasVersion((0, import_node_path23.join)(path8)),
4006
+ domainHasVersion: domainHasVersion((0, import_node_path24.join)(path8)),
3714
4007
  /**
3715
4008
  * Adds a given service to a domain
3716
4009
  * @param id - The id of the domain
@@ -3718,7 +4011,15 @@ var src_default = (path8) => {
3718
4011
  * @param version - (Optional) The version of the domain to add the service to
3719
4012
  * @returns
3720
4013
  */
3721
- addServiceToDomain: addServiceToDomain((0, import_node_path23.join)(path8, "domains")),
4014
+ addServiceToDomain: addServiceToDomain((0, import_node_path24.join)(path8, "domains")),
4015
+ /**
4016
+ * Adds a given agent to a domain
4017
+ * @param id - The id of the domain
4018
+ * @param agent - The id and version of the agent to add
4019
+ * @param version - (Optional) The version of the domain to add the agent to
4020
+ * @returns
4021
+ */
4022
+ addAgentToDomain: addAgentToDomain((0, import_node_path24.join)(path8, "domains")),
3722
4023
  /**
3723
4024
  * Adds a given subdomain to a domain
3724
4025
  * @param id - The id of the domain
@@ -3726,7 +4027,7 @@ var src_default = (path8) => {
3726
4027
  * @param version - (Optional) The version of the domain to add the subdomain to
3727
4028
  * @returns
3728
4029
  */
3729
- addSubDomainToDomain: addSubDomainToDomain((0, import_node_path23.join)(path8, "domains")),
4030
+ addSubDomainToDomain: addSubDomainToDomain((0, import_node_path24.join)(path8, "domains")),
3730
4031
  /**
3731
4032
  * Adds an entity to a domain
3732
4033
  * @param id - The id of the domain
@@ -3734,7 +4035,7 @@ var src_default = (path8) => {
3734
4035
  * @param version - (Optional) The version of the domain to add the entity to
3735
4036
  * @returns
3736
4037
  */
3737
- addEntityToDomain: addEntityToDomain((0, import_node_path23.join)(path8, "domains")),
4038
+ addEntityToDomain: addEntityToDomain((0, import_node_path24.join)(path8, "domains")),
3738
4039
  /**
3739
4040
  * Add an event to a domain by its id.
3740
4041
  *
@@ -3752,7 +4053,7 @@ var src_default = (path8) => {
3752
4053
  *
3753
4054
  * ```
3754
4055
  */
3755
- addEventToDomain: addMessageToDomain((0, import_node_path23.join)(path8, "domains")),
4056
+ addEventToDomain: addMessageToDomain((0, import_node_path24.join)(path8, "domains")),
3756
4057
  /**
3757
4058
  * Add a command to a domain by its id.
3758
4059
  *
@@ -3770,7 +4071,7 @@ var src_default = (path8) => {
3770
4071
  *
3771
4072
  * ```
3772
4073
  */
3773
- addCommandToDomain: addMessageToDomain((0, import_node_path23.join)(path8, "domains")),
4074
+ addCommandToDomain: addMessageToDomain((0, import_node_path24.join)(path8, "domains")),
3774
4075
  /**
3775
4076
  * Add a query to a domain by its id.
3776
4077
  *
@@ -3788,7 +4089,7 @@ var src_default = (path8) => {
3788
4089
  *
3789
4090
  * ```
3790
4091
  */
3791
- addQueryToDomain: addMessageToDomain((0, import_node_path23.join)(path8, "domains")),
4092
+ addQueryToDomain: addMessageToDomain((0, import_node_path24.join)(path8, "domains")),
3792
4093
  /**
3793
4094
  * ================================
3794
4095
  * Teams
@@ -3801,25 +4102,25 @@ var src_default = (path8) => {
3801
4102
  * @param options - Optional options to write the team
3802
4103
  *
3803
4104
  */
3804
- writeTeam: writeTeam((0, import_node_path23.join)(path8, "teams")),
4105
+ writeTeam: writeTeam((0, import_node_path24.join)(path8, "teams")),
3805
4106
  /**
3806
4107
  * Returns a team from EventCatalog
3807
4108
  * @param id - The id of the team to retrieve
3808
4109
  * @returns Team|Undefined
3809
4110
  */
3810
- getTeam: getTeam((0, import_node_path23.join)(path8, "teams")),
4111
+ getTeam: getTeam((0, import_node_path24.join)(path8, "teams")),
3811
4112
  /**
3812
4113
  * Returns all teams from EventCatalog
3813
4114
  * @returns Team[]|Undefined
3814
4115
  */
3815
- getTeams: getTeams((0, import_node_path23.join)(path8, "teams")),
4116
+ getTeams: getTeams((0, import_node_path24.join)(path8, "teams")),
3816
4117
  /**
3817
4118
  * Remove a team by the team id
3818
4119
  *
3819
4120
  * @param id - The id of the team you want to remove
3820
4121
  *
3821
4122
  */
3822
- rmTeamById: rmTeamById((0, import_node_path23.join)(path8, "teams")),
4123
+ rmTeamById: rmTeamById((0, import_node_path24.join)(path8, "teams")),
3823
4124
  /**
3824
4125
  * ================================
3825
4126
  * Users
@@ -3832,25 +4133,25 @@ var src_default = (path8) => {
3832
4133
  * @param options - Optional options to write the user
3833
4134
  *
3834
4135
  */
3835
- writeUser: writeUser((0, import_node_path23.join)(path8, "users")),
4136
+ writeUser: writeUser((0, import_node_path24.join)(path8, "users")),
3836
4137
  /**
3837
4138
  * Returns a user from EventCatalog
3838
4139
  * @param id - The id of the user to retrieve
3839
4140
  * @returns User|Undefined
3840
4141
  */
3841
- getUser: getUser((0, import_node_path23.join)(path8, "users")),
4142
+ getUser: getUser((0, import_node_path24.join)(path8, "users")),
3842
4143
  /**
3843
4144
  * Returns all user from EventCatalog
3844
4145
  * @returns User[]|Undefined
3845
4146
  */
3846
- getUsers: getUsers((0, import_node_path23.join)(path8)),
4147
+ getUsers: getUsers((0, import_node_path24.join)(path8)),
3847
4148
  /**
3848
4149
  * Remove a user by the user id
3849
4150
  *
3850
4151
  * @param id - The id of the user you want to remove
3851
4152
  *
3852
4153
  */
3853
- rmUserById: rmUserById((0, import_node_path23.join)(path8, "users")),
4154
+ rmUserById: rmUserById((0, import_node_path24.join)(path8, "users")),
3854
4155
  /**
3855
4156
  * ================================
3856
4157
  * Custom Docs
@@ -3861,32 +4162,32 @@ var src_default = (path8) => {
3861
4162
  * @param path - The path to the custom doc to retrieve
3862
4163
  * @returns CustomDoc|Undefined
3863
4164
  */
3864
- getCustomDoc: getCustomDoc((0, import_node_path23.join)(path8, "docs")),
4165
+ getCustomDoc: getCustomDoc((0, import_node_path24.join)(path8, "docs")),
3865
4166
  /**
3866
4167
  * Returns all custom docs from EventCatalog
3867
4168
  * @param options - Optional options to get custom docs from a specific path
3868
4169
  * @returns CustomDoc[]|Undefined
3869
4170
  */
3870
- getCustomDocs: getCustomDocs((0, import_node_path23.join)(path8, "docs")),
4171
+ getCustomDocs: getCustomDocs((0, import_node_path24.join)(path8, "docs")),
3871
4172
  /**
3872
4173
  * Writes a custom doc to EventCatalog
3873
4174
  * @param customDoc - The custom doc to write
3874
4175
  * @param options - Optional options to write the custom doc
3875
4176
  *
3876
4177
  */
3877
- writeCustomDoc: writeCustomDoc((0, import_node_path23.join)(path8, "docs")),
4178
+ writeCustomDoc: writeCustomDoc((0, import_node_path24.join)(path8, "docs")),
3878
4179
  /**
3879
4180
  * Removes a custom doc from EventCatalog
3880
4181
  * @param path - The path to the custom doc to remove
3881
4182
  *
3882
4183
  */
3883
- rmCustomDoc: rmCustomDoc((0, import_node_path23.join)(path8, "docs")),
4184
+ rmCustomDoc: rmCustomDoc((0, import_node_path24.join)(path8, "docs")),
3884
4185
  /**
3885
4186
  * Dumps the catalog to a JSON file.
3886
4187
  * @param directory - The directory to dump the catalog to
3887
4188
  * @returns A JSON file with the catalog
3888
4189
  */
3889
- dumpCatalog: dumpCatalog((0, import_node_path23.join)(path8)),
4190
+ dumpCatalog: dumpCatalog((0, import_node_path24.join)(path8)),
3890
4191
  /**
3891
4192
  * Returns the event catalog configuration file.
3892
4193
  * The event catalog configuration file is the file that contains the configuration for the event catalog.
@@ -3894,7 +4195,7 @@ var src_default = (path8) => {
3894
4195
  * @param directory - The directory of the catalog.
3895
4196
  * @returns A JSON object with the configuration for the event catalog.
3896
4197
  */
3897
- getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path23.join)(path8)),
4198
+ getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path24.join)(path8)),
3898
4199
  /**
3899
4200
  * ================================
3900
4201
  * Changelogs
@@ -3908,7 +4209,7 @@ var src_default = (path8) => {
3908
4209
  * @param options - Optional options (version, format)
3909
4210
  *
3910
4211
  */
3911
- writeChangelog: writeChangelog((0, import_node_path23.join)(path8)),
4212
+ writeChangelog: writeChangelog((0, import_node_path24.join)(path8)),
3912
4213
  /**
3913
4214
  * Appends a changelog entry to an existing changelog for a resource.
3914
4215
  * If no changelog exists, one is created.
@@ -3918,7 +4219,7 @@ var src_default = (path8) => {
3918
4219
  * @param options - Optional options (version, format)
3919
4220
  *
3920
4221
  */
3921
- appendChangelog: appendChangelog((0, import_node_path23.join)(path8)),
4222
+ appendChangelog: appendChangelog((0, import_node_path24.join)(path8)),
3922
4223
  /**
3923
4224
  * Returns the changelog for a resource in EventCatalog
3924
4225
  *
@@ -3926,7 +4227,7 @@ var src_default = (path8) => {
3926
4227
  * @param options - Optional options (version)
3927
4228
  * @returns Changelog|Undefined
3928
4229
  */
3929
- getChangelog: getChangelog((0, import_node_path23.join)(path8)),
4230
+ getChangelog: getChangelog((0, import_node_path24.join)(path8)),
3930
4231
  /**
3931
4232
  * Removes the changelog for a resource in EventCatalog
3932
4233
  *
@@ -3934,7 +4235,7 @@ var src_default = (path8) => {
3934
4235
  * @param options - Optional options (version)
3935
4236
  *
3936
4237
  */
3937
- rmChangelog: rmChangelog((0, import_node_path23.join)(path8)),
4238
+ rmChangelog: rmChangelog((0, import_node_path24.join)(path8)),
3938
4239
  /**
3939
4240
  * ================================
3940
4241
  * Resources Utils
@@ -3959,26 +4260,26 @@ var src_default = (path8) => {
3959
4260
  * @param path - The path to the message to retrieve
3960
4261
  * @returns Message|Undefined
3961
4262
  */
3962
- getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path23.join)(path8)),
4263
+ getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path24.join)(path8)),
3963
4264
  /**
3964
- * Returns the producers and consumers (services) for a given message
4265
+ * Returns the producers and consumers (services and agents) for a given message
3965
4266
  * @param id - The id of the message to get the producers and consumers for
3966
4267
  * @param version - Optional version of the message
3967
- * @returns { producers: Service[], consumers: Service[] }
4268
+ * @returns { producers: (Service|Agent)[], consumers: (Service|Agent)[] }
3968
4269
  */
3969
- getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path23.join)(path8)),
4270
+ getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path24.join)(path8)),
3970
4271
  /**
3971
4272
  * Returns the consumers of a given schema path
3972
4273
  * @param path - The path to the schema to get the consumers for
3973
- * @returns Service[]
4274
+ * @returns (Service|Agent)[]
3974
4275
  */
3975
- getConsumersOfSchema: getConsumersOfSchema((0, import_node_path23.join)(path8)),
4276
+ getConsumersOfSchema: getConsumersOfSchema((0, import_node_path24.join)(path8)),
3976
4277
  /**
3977
4278
  * Returns the producers of a given schema path
3978
4279
  * @param path - The path to the schema to get the producers for
3979
- * @returns Service[]
4280
+ * @returns (Service|Agent)[]
3980
4281
  */
3981
- getProducersOfSchema: getProducersOfSchema((0, import_node_path23.join)(path8)),
4282
+ getProducersOfSchema: getProducersOfSchema((0, import_node_path24.join)(path8)),
3982
4283
  /**
3983
4284
  * Returns the schema for a given message (event, command or query) by its id and version.
3984
4285
  * If no version is given, the latest version is used.
@@ -3986,14 +4287,14 @@ var src_default = (path8) => {
3986
4287
  * @param version - Optional version of the message
3987
4288
  * @returns { schema: string, fileName: string } | undefined
3988
4289
  */
3989
- getSchemaForMessage: getSchemaForMessage((0, import_node_path23.join)(path8)),
4290
+ getSchemaForMessage: getSchemaForMessage((0, import_node_path24.join)(path8)),
3990
4291
  /**
3991
4292
  * Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
3992
4293
  * @param id - The id of the resource to get the owners for
3993
4294
  * @param version - Optional version of the resource
3994
4295
  * @returns { owners: User[] }
3995
4296
  */
3996
- getOwnersForResource: getOwnersForResource((0, import_node_path23.join)(path8)),
4297
+ getOwnersForResource: getOwnersForResource((0, import_node_path24.join)(path8)),
3997
4298
  /**
3998
4299
  * ================================
3999
4300
  * Entities
@@ -4005,13 +4306,13 @@ var src_default = (path8) => {
4005
4306
  * @param version - Optional id of the version to get (supports semver)
4006
4307
  * @returns Entity|Undefined
4007
4308
  */
4008
- getEntity: getEntity((0, import_node_path23.join)(path8)),
4309
+ getEntity: getEntity((0, import_node_path24.join)(path8)),
4009
4310
  /**
4010
4311
  * Returns all entities from EventCatalog
4011
4312
  * @param latestOnly - optional boolean, set to true to get only latest versions
4012
4313
  * @returns Entity[]|Undefined
4013
4314
  */
4014
- getEntities: getEntities((0, import_node_path23.join)(path8)),
4315
+ getEntities: getEntities((0, import_node_path24.join)(path8)),
4015
4316
  /**
4016
4317
  * Adds an entity to EventCatalog
4017
4318
  *
@@ -4019,33 +4320,33 @@ var src_default = (path8) => {
4019
4320
  * @param options - Optional options to write the entity
4020
4321
  *
4021
4322
  */
4022
- writeEntity: writeEntity((0, import_node_path23.join)(path8, "entities")),
4323
+ writeEntity: writeEntity((0, import_node_path24.join)(path8, "entities")),
4023
4324
  /**
4024
4325
  * Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
4025
4326
  *
4026
4327
  * @param path - The path to your entity, e.g. `/User`
4027
4328
  *
4028
4329
  */
4029
- rmEntity: rmEntity((0, import_node_path23.join)(path8, "entities")),
4330
+ rmEntity: rmEntity((0, import_node_path24.join)(path8, "entities")),
4030
4331
  /**
4031
4332
  * Remove an entity by an entity id
4032
4333
  *
4033
4334
  * @param id - The id of the entity you want to remove
4034
4335
  *
4035
4336
  */
4036
- rmEntityById: rmEntityById((0, import_node_path23.join)(path8)),
4337
+ rmEntityById: rmEntityById((0, import_node_path24.join)(path8)),
4037
4338
  /**
4038
4339
  * Moves a given entity id to the version directory
4039
4340
  * @param id - The id of the entity to version
4040
4341
  */
4041
- versionEntity: versionEntity((0, import_node_path23.join)(path8)),
4342
+ versionEntity: versionEntity((0, import_node_path24.join)(path8)),
4042
4343
  /**
4043
4344
  * Check to see if an entity version exists
4044
4345
  * @param id - The id of the entity
4045
4346
  * @param version - The version of the entity (supports semver)
4046
4347
  * @returns
4047
4348
  */
4048
- entityHasVersion: entityHasVersion((0, import_node_path23.join)(path8)),
4349
+ entityHasVersion: entityHasVersion((0, import_node_path24.join)(path8)),
4049
4350
  /**
4050
4351
  * ================================
4051
4352
  * Flows
@@ -4058,7 +4359,7 @@ var src_default = (path8) => {
4058
4359
  * @param version - Optional version of the flow
4059
4360
  * @returns Flow
4060
4361
  */
4061
- getFlow: getFlow((0, import_node_path23.join)(path8)),
4362
+ getFlow: getFlow((0, import_node_path24.join)(path8)),
4062
4363
  /**
4063
4364
  * Returns all flows from EventCatalog
4064
4365
  *
@@ -4066,7 +4367,7 @@ var src_default = (path8) => {
4066
4367
  * @param latestOnly - optional boolean, set to true to get only latest versions
4067
4368
  * @returns Flow[]|Undefined
4068
4369
  */
4069
- getFlows: getFlows((0, import_node_path23.join)(path8)),
4370
+ getFlows: getFlows((0, import_node_path24.join)(path8)),
4070
4371
  /**
4071
4372
  * Adds a flow to EventCatalog
4072
4373
  *
@@ -4074,14 +4375,14 @@ var src_default = (path8) => {
4074
4375
  * @param options - Optional options to write the flow
4075
4376
  *
4076
4377
  */
4077
- writeFlow: writeFlow((0, import_node_path23.join)(path8, "flows")),
4378
+ writeFlow: writeFlow((0, import_node_path24.join)(path8, "flows")),
4078
4379
  /**
4079
4380
  * Adds a versioned flow to EventCatalog
4080
4381
  *
4081
4382
  * @param flow - The flow to write
4082
4383
  *
4083
4384
  */
4084
- writeVersionedFlow: writeVersionedFlow((0, import_node_path23.join)(path8, "flows")),
4385
+ writeVersionedFlow: writeVersionedFlow((0, import_node_path24.join)(path8, "flows")),
4085
4386
  /**
4086
4387
  * Adds a flow to a domain in EventCatalog
4087
4388
  *
@@ -4090,7 +4391,7 @@ var src_default = (path8) => {
4090
4391
  * @param options - Optional options to write the flow
4091
4392
  *
4092
4393
  */
4093
- writeFlowToDomain: writeFlowToDomain((0, import_node_path23.join)(path8, "domains")),
4394
+ writeFlowToDomain: writeFlowToDomain((0, import_node_path24.join)(path8, "domains")),
4094
4395
  /**
4095
4396
  * Adds a flow to a service in EventCatalog
4096
4397
  *
@@ -4099,33 +4400,42 @@ var src_default = (path8) => {
4099
4400
  * @param options - Optional options to write the flow
4100
4401
  *
4101
4402
  */
4102
- writeFlowToService: writeFlowToService((0, import_node_path23.join)(path8, "services")),
4403
+ writeFlowToService: writeFlowToService((0, import_node_path24.join)(path8, "services")),
4404
+ /**
4405
+ * Adds a flow to an agent in EventCatalog
4406
+ *
4407
+ * @param flow - The flow to write to the agent
4408
+ * @param agent - The agent and its id to write the flow to
4409
+ * @param options - Optional options to write the flow
4410
+ *
4411
+ */
4412
+ writeFlowToAgent: writeFlowToAgent((0, import_node_path24.join)(path8, "agents")),
4103
4413
  /**
4104
4414
  * Remove a flow from EventCatalog (modeled on the standard POSIX rm utility)
4105
4415
  *
4106
4416
  * @param path - The path to your flow, e.g. `/PaymentFlow`
4107
4417
  *
4108
4418
  */
4109
- rmFlow: rmFlow((0, import_node_path23.join)(path8, "flows")),
4419
+ rmFlow: rmFlow((0, import_node_path24.join)(path8, "flows")),
4110
4420
  /**
4111
4421
  * Remove a flow by a flow id
4112
4422
  *
4113
4423
  * @param id - The id of the flow you want to remove
4114
4424
  *
4115
4425
  */
4116
- rmFlowById: rmFlowById((0, import_node_path23.join)(path8)),
4426
+ rmFlowById: rmFlowById((0, import_node_path24.join)(path8)),
4117
4427
  /**
4118
4428
  * Moves a given flow id to the version directory
4119
4429
  * @param id - The id of the flow to version
4120
4430
  */
4121
- versionFlow: versionFlow((0, import_node_path23.join)(path8)),
4431
+ versionFlow: versionFlow((0, import_node_path24.join)(path8)),
4122
4432
  /**
4123
4433
  * Check to see if a flow version exists
4124
4434
  * @param id - The id of the flow
4125
4435
  * @param version - The version of the flow (supports semver)
4126
4436
  * @returns
4127
4437
  */
4128
- flowHasVersion: flowHasVersion((0, import_node_path23.join)(path8)),
4438
+ flowHasVersion: flowHasVersion((0, import_node_path24.join)(path8)),
4129
4439
  /**
4130
4440
  * Adds a file to the given flow
4131
4441
  * @param id - The id of the flow to add the file to
@@ -4133,7 +4443,7 @@ var src_default = (path8) => {
4133
4443
  * @param version - Optional version of the flow to add the file to
4134
4444
  * @returns
4135
4445
  */
4136
- addFileToFlow: addFileToFlow((0, import_node_path23.join)(path8)),
4446
+ addFileToFlow: addFileToFlow((0, import_node_path24.join)(path8)),
4137
4447
  /**
4138
4448
  * ================================
4139
4449
  * Data Stores
@@ -4145,42 +4455,42 @@ var src_default = (path8) => {
4145
4455
  * @param options - Optional options to write the data store
4146
4456
  *
4147
4457
  */
4148
- writeDataStore: writeDataStore((0, import_node_path23.join)(path8, "containers")),
4458
+ writeDataStore: writeDataStore((0, import_node_path24.join)(path8, "containers")),
4149
4459
  /**
4150
4460
  * Returns a data store from EventCatalog
4151
4461
  * @param id - The id of the data store to retrieve
4152
4462
  * @param version - Optional id of the version to get (supports semver)
4153
4463
  * @returns Container|Undefined
4154
4464
  */
4155
- getDataStore: getDataStore((0, import_node_path23.join)(path8)),
4465
+ getDataStore: getDataStore((0, import_node_path24.join)(path8)),
4156
4466
  /**
4157
4467
  * Returns all data stores from EventCatalog
4158
4468
  * @param latestOnly - optional boolean, set to true to get only latest versions
4159
4469
  * @returns Container[]|Undefined
4160
4470
  */
4161
- getDataStores: getDataStores((0, import_node_path23.join)(path8)),
4471
+ getDataStores: getDataStores((0, import_node_path24.join)(path8)),
4162
4472
  /**
4163
4473
  * Version a data store by its id
4164
4474
  * @param id - The id of the data store to version
4165
4475
  */
4166
- versionDataStore: versionDataStore((0, import_node_path23.join)(path8, "containers")),
4476
+ versionDataStore: versionDataStore((0, import_node_path24.join)(path8, "containers")),
4167
4477
  /**
4168
4478
  * Remove a data store by its path
4169
4479
  * @param path - The path to the data store to remove
4170
4480
  */
4171
- rmDataStore: rmDataStore((0, import_node_path23.join)(path8, "containers")),
4481
+ rmDataStore: rmDataStore((0, import_node_path24.join)(path8, "containers")),
4172
4482
  /**
4173
4483
  * Remove a data store by its id
4174
4484
  * @param id - The id of the data store to remove
4175
4485
  */
4176
- rmDataStoreById: rmDataStoreById((0, import_node_path23.join)(path8)),
4486
+ rmDataStoreById: rmDataStoreById((0, import_node_path24.join)(path8)),
4177
4487
  /**
4178
4488
  * Check to see if a data store version exists
4179
4489
  * @param id - The id of the data store
4180
4490
  * @param version - The version of the data store (supports semver)
4181
4491
  * @returns
4182
4492
  */
4183
- dataStoreHasVersion: dataStoreHasVersion((0, import_node_path23.join)(path8)),
4493
+ dataStoreHasVersion: dataStoreHasVersion((0, import_node_path24.join)(path8)),
4184
4494
  /**
4185
4495
  * Adds a file to a data store by its id
4186
4496
  * @param id - The id of the data store to add the file to
@@ -4188,14 +4498,14 @@ var src_default = (path8) => {
4188
4498
  * @param version - Optional version of the data store to add the file to
4189
4499
  * @returns
4190
4500
  */
4191
- addFileToDataStore: addFileToDataStore((0, import_node_path23.join)(path8)),
4501
+ addFileToDataStore: addFileToDataStore((0, import_node_path24.join)(path8)),
4192
4502
  /**
4193
4503
  * Writes a data store to a service by its id
4194
4504
  * @param dataStore - The data store to write
4195
4505
  * @param service - The service to write the data store to
4196
4506
  * @returns
4197
4507
  */
4198
- writeDataStoreToService: writeDataStoreToService((0, import_node_path23.join)(path8)),
4508
+ writeDataStoreToService: writeDataStoreToService((0, import_node_path24.join)(path8)),
4199
4509
  /**
4200
4510
  * ================================
4201
4511
  * Data Products
@@ -4207,7 +4517,7 @@ var src_default = (path8) => {
4207
4517
  * @param options - Optional options to write the data product
4208
4518
  *
4209
4519
  */
4210
- writeDataProduct: writeDataProduct((0, import_node_path23.join)(path8, "data-products")),
4520
+ writeDataProduct: writeDataProduct((0, import_node_path24.join)(path8, "data-products")),
4211
4521
  /**
4212
4522
  * Writes a data product to a domain in EventCatalog
4213
4523
  * @param dataProduct - The data product to write
@@ -4215,43 +4525,43 @@ var src_default = (path8) => {
4215
4525
  * @param options - Optional options to write the data product
4216
4526
  *
4217
4527
  */
4218
- writeDataProductToDomain: writeDataProductToDomain((0, import_node_path23.join)(path8, "domains")),
4528
+ writeDataProductToDomain: writeDataProductToDomain((0, import_node_path24.join)(path8, "domains")),
4219
4529
  /**
4220
4530
  * Returns a data product from EventCatalog
4221
4531
  * @param id - The id of the data product to retrieve
4222
4532
  * @param version - Optional id of the version to get (supports semver)
4223
4533
  * @returns DataProduct|Undefined
4224
4534
  */
4225
- getDataProduct: getDataProduct((0, import_node_path23.join)(path8)),
4535
+ getDataProduct: getDataProduct((0, import_node_path24.join)(path8)),
4226
4536
  /**
4227
4537
  * Returns all data products from EventCatalog
4228
4538
  * @param latestOnly - optional boolean, set to true to get only latest versions
4229
4539
  * @returns DataProduct[]|Undefined
4230
4540
  */
4231
- getDataProducts: getDataProducts((0, import_node_path23.join)(path8)),
4541
+ getDataProducts: getDataProducts((0, import_node_path24.join)(path8)),
4232
4542
  /**
4233
4543
  * Version a data product by its id
4234
4544
  * @param id - The id of the data product to version
4235
4545
  */
4236
- versionDataProduct: versionDataProduct((0, import_node_path23.join)(path8)),
4546
+ versionDataProduct: versionDataProduct((0, import_node_path24.join)(path8)),
4237
4547
  /**
4238
4548
  * Remove a data product by its path
4239
4549
  * @param path - The path to the data product to remove
4240
4550
  */
4241
- rmDataProduct: rmDataProduct((0, import_node_path23.join)(path8, "data-products")),
4551
+ rmDataProduct: rmDataProduct((0, import_node_path24.join)(path8, "data-products")),
4242
4552
  /**
4243
4553
  * Remove a data product by its id
4244
4554
  * @param id - The id of the data product to remove
4245
4555
  * @param version - Optional version of the data product to remove
4246
4556
  */
4247
- rmDataProductById: rmDataProductById((0, import_node_path23.join)(path8)),
4557
+ rmDataProductById: rmDataProductById((0, import_node_path24.join)(path8)),
4248
4558
  /**
4249
4559
  * Check to see if a data product version exists
4250
4560
  * @param id - The id of the data product
4251
4561
  * @param version - The version of the data product (supports semver)
4252
4562
  * @returns
4253
4563
  */
4254
- dataProductHasVersion: dataProductHasVersion((0, import_node_path23.join)(path8)),
4564
+ dataProductHasVersion: dataProductHasVersion((0, import_node_path24.join)(path8)),
4255
4565
  /**
4256
4566
  * Adds a file to a data product by its id
4257
4567
  * @param id - The id of the data product to add the file to
@@ -4259,7 +4569,7 @@ var src_default = (path8) => {
4259
4569
  * @param version - Optional version of the data product to add the file to
4260
4570
  * @returns
4261
4571
  */
4262
- addFileToDataProduct: addFileToDataProduct((0, import_node_path23.join)(path8)),
4572
+ addFileToDataProduct: addFileToDataProduct((0, import_node_path24.join)(path8)),
4263
4573
  /**
4264
4574
  * Adds a data product to a domain
4265
4575
  * @param id - The id of the domain
@@ -4267,7 +4577,7 @@ var src_default = (path8) => {
4267
4577
  * @param version - (Optional) The version of the domain to add the data product to
4268
4578
  * @returns
4269
4579
  */
4270
- addDataProductToDomain: addDataProductToDomain((0, import_node_path23.join)(path8, "domains")),
4580
+ addDataProductToDomain: addDataProductToDomain((0, import_node_path24.join)(path8, "domains")),
4271
4581
  /**
4272
4582
  * ================================
4273
4583
  * Diagrams
@@ -4279,13 +4589,13 @@ var src_default = (path8) => {
4279
4589
  * @param version - Optional id of the version to get (supports semver)
4280
4590
  * @returns Diagram|Undefined
4281
4591
  */
4282
- getDiagram: getDiagram((0, import_node_path23.join)(path8)),
4592
+ getDiagram: getDiagram((0, import_node_path24.join)(path8)),
4283
4593
  /**
4284
4594
  * Returns all diagrams from EventCatalog
4285
4595
  * @param latestOnly - optional boolean, set to true to get only latest versions
4286
4596
  * @returns Diagram[]|Undefined
4287
4597
  */
4288
- getDiagrams: getDiagrams((0, import_node_path23.join)(path8)),
4598
+ getDiagrams: getDiagrams((0, import_node_path24.join)(path8)),
4289
4599
  /**
4290
4600
  * Adds a diagram to EventCatalog
4291
4601
  *
@@ -4293,33 +4603,33 @@ var src_default = (path8) => {
4293
4603
  * @param options - Optional options to write the diagram
4294
4604
  *
4295
4605
  */
4296
- writeDiagram: writeDiagram((0, import_node_path23.join)(path8, "diagrams")),
4606
+ writeDiagram: writeDiagram((0, import_node_path24.join)(path8, "diagrams")),
4297
4607
  /**
4298
4608
  * Remove a diagram from EventCatalog (modeled on the standard POSIX rm utility)
4299
4609
  *
4300
4610
  * @param path - The path to your diagram, e.g. `/ArchitectureDiagram`
4301
4611
  *
4302
4612
  */
4303
- rmDiagram: rmDiagram((0, import_node_path23.join)(path8, "diagrams")),
4613
+ rmDiagram: rmDiagram((0, import_node_path24.join)(path8, "diagrams")),
4304
4614
  /**
4305
4615
  * Remove a diagram by a diagram id
4306
4616
  *
4307
4617
  * @param id - The id of the diagram you want to remove
4308
4618
  *
4309
4619
  */
4310
- rmDiagramById: rmDiagramById((0, import_node_path23.join)(path8)),
4620
+ rmDiagramById: rmDiagramById((0, import_node_path24.join)(path8)),
4311
4621
  /**
4312
4622
  * Moves a given diagram id to the version directory
4313
4623
  * @param id - The id of the diagram to version
4314
4624
  */
4315
- versionDiagram: versionDiagram((0, import_node_path23.join)(path8)),
4625
+ versionDiagram: versionDiagram((0, import_node_path24.join)(path8)),
4316
4626
  /**
4317
4627
  * Check to see if a diagram version exists
4318
4628
  * @param id - The id of the diagram
4319
4629
  * @param version - The version of the diagram (supports semver)
4320
4630
  * @returns
4321
4631
  */
4322
- diagramHasVersion: diagramHasVersion((0, import_node_path23.join)(path8)),
4632
+ diagramHasVersion: diagramHasVersion((0, import_node_path24.join)(path8)),
4323
4633
  /**
4324
4634
  * Adds a file to the given diagram
4325
4635
  * @param id - The id of the diagram to add the file to
@@ -4327,7 +4637,7 @@ var src_default = (path8) => {
4327
4637
  * @param version - Optional version of the diagram to add the file to
4328
4638
  * @returns
4329
4639
  */
4330
- addFileToDiagram: addFileToDiagram((0, import_node_path23.join)(path8)),
4640
+ addFileToDiagram: addFileToDiagram((0, import_node_path24.join)(path8)),
4331
4641
  /**
4332
4642
  * ================================
4333
4643
  * DSL
@@ -4346,21 +4656,21 @@ var src_default = (path8) => {
4346
4656
  * const dsl = await sdk.toDSL(services, { type: 'service', hydrate: true });
4347
4657
  * ```
4348
4658
  */
4349
- createSnapshot: createSnapshot((0, import_node_path23.join)(path8)),
4350
- diffSnapshots: diffSnapshots((0, import_node_path23.join)(path8)),
4351
- listSnapshots: listSnapshots((0, import_node_path23.join)(path8)),
4352
- toDSL: toDSL((0, import_node_path23.join)(path8), {
4353
- getEvent: getEvent((0, import_node_path23.join)(path8)),
4354
- getCommand: getCommand((0, import_node_path23.join)(path8)),
4355
- getQuery: getQuery((0, import_node_path23.join)(path8)),
4356
- getService: getService((0, import_node_path23.join)(path8)),
4357
- getServices: getServices((0, import_node_path23.join)(path8)),
4358
- getDomain: getDomain((0, import_node_path23.join)(path8, "domains")),
4359
- getChannel: getChannel((0, import_node_path23.join)(path8)),
4360
- getChannels: getChannels((0, import_node_path23.join)(path8)),
4361
- getContainer: getDataStore((0, import_node_path23.join)(path8)),
4362
- getTeam: getTeam((0, import_node_path23.join)(path8, "teams")),
4363
- getUser: getUser((0, import_node_path23.join)(path8, "users"))
4659
+ createSnapshot: createSnapshot((0, import_node_path24.join)(path8)),
4660
+ diffSnapshots: diffSnapshots((0, import_node_path24.join)(path8)),
4661
+ listSnapshots: listSnapshots((0, import_node_path24.join)(path8)),
4662
+ toDSL: toDSL((0, import_node_path24.join)(path8), {
4663
+ getEvent: getEvent((0, import_node_path24.join)(path8)),
4664
+ getCommand: getCommand((0, import_node_path24.join)(path8)),
4665
+ getQuery: getQuery((0, import_node_path24.join)(path8)),
4666
+ getService: getService((0, import_node_path24.join)(path8)),
4667
+ getServices: getServices((0, import_node_path24.join)(path8)),
4668
+ getDomain: getDomain((0, import_node_path24.join)(path8, "domains")),
4669
+ getChannel: getChannel((0, import_node_path24.join)(path8)),
4670
+ getChannels: getChannels((0, import_node_path24.join)(path8)),
4671
+ getContainer: getDataStore((0, import_node_path24.join)(path8)),
4672
+ getTeam: getTeam((0, import_node_path24.join)(path8, "teams")),
4673
+ getUser: getUser((0, import_node_path24.join)(path8, "users"))
4364
4674
  })
4365
4675
  };
4366
4676
  };