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