@eventcatalog/sdk 2.26.3 → 2.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +502 -26
- package/dist/index.d.ts +502 -26
- package/dist/index.js +1224 -346
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1213 -340
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
package/dist/index.mjs
CHANGED
|
@@ -109,11 +109,11 @@ ${body}
|
|
|
109
109
|
// src/dsl/service.ts
|
|
110
110
|
import { valid as semverValid } from "semver";
|
|
111
111
|
async function serviceToDSL(resource, options, getMessageFn) {
|
|
112
|
-
const { catalogDir, hydrate = false, _seen = /* @__PURE__ */ new Set() } = options;
|
|
112
|
+
const { catalogDir, hydrate: hydrate2 = false, _seen = /* @__PURE__ */ new Set() } = options;
|
|
113
113
|
const msgIndex = options._msgIndex || buildMessageTypeIndex(catalogDir);
|
|
114
114
|
const parts = [];
|
|
115
115
|
const resolvedVersions = /* @__PURE__ */ new Map();
|
|
116
|
-
if (
|
|
116
|
+
if (hydrate2 && getMessageFn) {
|
|
117
117
|
const allMessages = [...resource.sends || [], ...resource.receives || []];
|
|
118
118
|
for (const msg of allMessages) {
|
|
119
119
|
const key = `${msg.id}@${msg.version || "latest"}`;
|
|
@@ -266,10 +266,10 @@ async function hydrateChannelsFromMessages(messages, resolvers, seen, parts) {
|
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
async function buildDomainBody(resource, options, resolvers, keyword) {
|
|
269
|
-
const { catalogDir, hydrate = false, _seen = /* @__PURE__ */ new Set() } = options;
|
|
269
|
+
const { catalogDir, hydrate: hydrate2 = false, _seen = /* @__PURE__ */ new Set() } = options;
|
|
270
270
|
const msgIndex = options._msgIndex || buildMessageTypeIndex(catalogDir);
|
|
271
271
|
const topLevelParts = [];
|
|
272
|
-
if (
|
|
272
|
+
if (hydrate2 && resolvers) {
|
|
273
273
|
if (resource.services && resource.services.length > 0 && resolvers.getService) {
|
|
274
274
|
for (const svcRef of resource.services) {
|
|
275
275
|
const svcKey = `service:${svcRef.id}@${svcRef.version || "latest"}`;
|
|
@@ -320,7 +320,7 @@ async function buildDomainBody(resource, options, resolvers, keyword) {
|
|
|
320
320
|
if (recvStr) lines.push(recvStr);
|
|
321
321
|
}
|
|
322
322
|
if (resource.domains && resource.domains.length > 0) {
|
|
323
|
-
if (
|
|
323
|
+
if (hydrate2 && resolvers?.getDomain) {
|
|
324
324
|
for (const subRef of resource.domains) {
|
|
325
325
|
const subKey = `domain:${subRef.id}@${subRef.version || "latest"}`;
|
|
326
326
|
if (_seen.has(subKey)) continue;
|
|
@@ -330,7 +330,7 @@ async function buildDomainBody(resource, options, resolvers, keyword) {
|
|
|
330
330
|
await hydrateOwners(subDomain.owners, resolvers, _seen, topLevelParts);
|
|
331
331
|
const sub = await buildDomainBody(
|
|
332
332
|
subDomain,
|
|
333
|
-
{ catalogDir, hydrate, _seen, _msgIndex: msgIndex },
|
|
333
|
+
{ catalogDir, hydrate: hydrate2, _seen, _msgIndex: msgIndex },
|
|
334
334
|
resolvers,
|
|
335
335
|
"subdomain"
|
|
336
336
|
);
|
|
@@ -354,9 +354,9 @@ ${body}
|
|
|
354
354
|
return { topLevelParts, block };
|
|
355
355
|
}
|
|
356
356
|
async function domainToDSL(resource, options, resolvers) {
|
|
357
|
-
const { catalogDir, hydrate = false, _seen = /* @__PURE__ */ new Set() } = options;
|
|
357
|
+
const { catalogDir, hydrate: hydrate2 = false, _seen = /* @__PURE__ */ new Set() } = options;
|
|
358
358
|
const msgIndex = options._msgIndex || buildMessageTypeIndex(catalogDir);
|
|
359
|
-
const result = await buildDomainBody(resource, { catalogDir, hydrate, _seen, _msgIndex: msgIndex }, resolvers, "domain");
|
|
359
|
+
const result = await buildDomainBody(resource, { catalogDir, hydrate: hydrate2, _seen, _msgIndex: msgIndex }, resolvers, "domain");
|
|
360
360
|
const parts = [...result.topLevelParts, result.block];
|
|
361
361
|
return parts.join("\n\n");
|
|
362
362
|
}
|
|
@@ -768,7 +768,7 @@ var findFileById = async (catalogDir, id, version) => {
|
|
|
768
768
|
}
|
|
769
769
|
return void 0;
|
|
770
770
|
};
|
|
771
|
-
var getFiles = async (pattern,
|
|
771
|
+
var getFiles = async (pattern, ignore2 = "") => {
|
|
772
772
|
try {
|
|
773
773
|
const normalizedInputPattern = normalize(pattern);
|
|
774
774
|
const absoluteBaseDir = resolve(
|
|
@@ -776,7 +776,7 @@ var getFiles = async (pattern, ignore = "") => {
|
|
|
776
776
|
);
|
|
777
777
|
let relativePattern = relative(absoluteBaseDir, normalizedInputPattern);
|
|
778
778
|
relativePattern = relativePattern.replace(/\\/g, "/");
|
|
779
|
-
const ignoreList = Array.isArray(
|
|
779
|
+
const ignoreList = Array.isArray(ignore2) ? ignore2 : [ignore2];
|
|
780
780
|
const files = globSync2(relativePattern, {
|
|
781
781
|
cwd: absoluteBaseDir,
|
|
782
782
|
ignore: ["node_modules/**", ...ignoreList],
|
|
@@ -794,8 +794,8 @@ var getFiles = async (pattern, ignore = "") => {
|
|
|
794
794
|
);
|
|
795
795
|
}
|
|
796
796
|
};
|
|
797
|
-
var readMdxFile = async (
|
|
798
|
-
const { data } = matter.read(
|
|
797
|
+
var readMdxFile = async (path11) => {
|
|
798
|
+
const { data } = matter.read(path11);
|
|
799
799
|
const { markdown, ...frontmatter } = data;
|
|
800
800
|
return { ...frontmatter, markdown };
|
|
801
801
|
};
|
|
@@ -901,8 +901,8 @@ var writeResource = async (catalogDir, resource, options = {
|
|
|
901
901
|
versionExistingContent: false,
|
|
902
902
|
format: "mdx"
|
|
903
903
|
}) => {
|
|
904
|
-
const
|
|
905
|
-
const fullPath = join2(catalogDir,
|
|
904
|
+
const path11 = options.path || `/${resource.id}`;
|
|
905
|
+
const fullPath = join2(catalogDir, path11);
|
|
906
906
|
const format = options.format || "mdx";
|
|
907
907
|
fsSync2.mkdirSync(fullPath, { recursive: true });
|
|
908
908
|
const lockPath = join2(fullPath, `index.${format}`);
|
|
@@ -984,13 +984,13 @@ var toResource = async (catalogDir, rawContents) => {
|
|
|
984
984
|
var getResources = async (catalogDir, {
|
|
985
985
|
type,
|
|
986
986
|
latestOnly = false,
|
|
987
|
-
ignore = [],
|
|
987
|
+
ignore: ignore2 = [],
|
|
988
988
|
pattern = "",
|
|
989
989
|
attachSchema = false
|
|
990
990
|
}) => {
|
|
991
991
|
const ignoreList = latestOnly ? `**/versioned/**` : "";
|
|
992
992
|
const filePattern = pattern || `${catalogDir}/**/${type}/**/index.{md,mdx}`;
|
|
993
|
-
const files = await getFiles(filePattern, [ignoreList, ...
|
|
993
|
+
const files = await getFiles(filePattern, [ignoreList, ...ignore2]);
|
|
994
994
|
if (files.length === 0) return;
|
|
995
995
|
return files.map((file) => {
|
|
996
996
|
const { data, content } = cachedMatterRead(file);
|
|
@@ -1036,16 +1036,16 @@ var rmResourceById = async (catalogDir, id, version, options) => {
|
|
|
1036
1036
|
}
|
|
1037
1037
|
invalidateFileCache();
|
|
1038
1038
|
};
|
|
1039
|
-
var waitForFileRemoval = async (
|
|
1039
|
+
var waitForFileRemoval = async (path11, maxRetries = 50, delay = 10) => {
|
|
1040
1040
|
for (let i = 0; i < maxRetries; i++) {
|
|
1041
1041
|
try {
|
|
1042
|
-
await fs.access(
|
|
1043
|
-
await new Promise((
|
|
1042
|
+
await fs.access(path11);
|
|
1043
|
+
await new Promise((resolve3) => setTimeout(resolve3, delay));
|
|
1044
1044
|
} catch (error) {
|
|
1045
1045
|
return;
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
|
-
throw new Error(`File/directory ${
|
|
1048
|
+
throw new Error(`File/directory ${path11} was not removed after ${maxRetries} attempts`);
|
|
1049
1049
|
};
|
|
1050
1050
|
var addFileToResource = async (catalogDir, id, file, version, options) => {
|
|
1051
1051
|
let pathToResource;
|
|
@@ -1156,8 +1156,8 @@ var writeEventToAgent = (directory) => async (event, agent, options = { path: ""
|
|
|
1156
1156
|
pathForEvent = join3(pathForEvent, event.id);
|
|
1157
1157
|
await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
|
|
1158
1158
|
};
|
|
1159
|
-
var rmEvent = (directory) => async (
|
|
1160
|
-
await fs2.rm(join3(directory,
|
|
1159
|
+
var rmEvent = (directory) => async (path11) => {
|
|
1160
|
+
await fs2.rm(join3(directory, path11), { recursive: true });
|
|
1161
1161
|
invalidateFileCache();
|
|
1162
1162
|
};
|
|
1163
1163
|
var rmEventById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -1205,8 +1205,8 @@ var writeCommandToAgent = (directory) => async (command, agent, options = { path
|
|
|
1205
1205
|
pathForCommand = join4(pathForCommand, command.id);
|
|
1206
1206
|
await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
|
|
1207
1207
|
};
|
|
1208
|
-
var rmCommand = (directory) => async (
|
|
1209
|
-
await fs3.rm(join4(directory,
|
|
1208
|
+
var rmCommand = (directory) => async (path11) => {
|
|
1209
|
+
await fs3.rm(join4(directory, path11), { recursive: true });
|
|
1210
1210
|
invalidateFileCache();
|
|
1211
1211
|
};
|
|
1212
1212
|
var rmCommandById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "command", persistFiles });
|
|
@@ -1252,8 +1252,8 @@ var writeQueryToAgent = (directory) => async (query, agent, options = { path: ""
|
|
|
1252
1252
|
pathForQuery = join5(pathForQuery, query.id);
|
|
1253
1253
|
await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
|
|
1254
1254
|
};
|
|
1255
|
-
var rmQuery = (directory) => async (
|
|
1256
|
-
await fs4.rm(join5(directory,
|
|
1255
|
+
var rmQuery = (directory) => async (path11) => {
|
|
1256
|
+
await fs4.rm(join5(directory, path11), { recursive: true });
|
|
1257
1257
|
invalidateFileCache();
|
|
1258
1258
|
};
|
|
1259
1259
|
var rmQueryById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -1276,8 +1276,8 @@ var removeExampleFromQuery = (directory) => async (id, fileName, version) => rem
|
|
|
1276
1276
|
import fs5 from "fs/promises";
|
|
1277
1277
|
import { join as join6, dirname as dirname4, extname, relative as relative2 } from "path";
|
|
1278
1278
|
var getService = (directory) => async (id, version) => getResource(directory, id, version, { type: "service" });
|
|
1279
|
-
var getServiceByPath = (directory) => async (
|
|
1280
|
-
const service = await getResource(directory, void 0, void 0, { type: "service" },
|
|
1279
|
+
var getServiceByPath = (directory) => async (path11) => {
|
|
1280
|
+
const service = await getResource(directory, void 0, void 0, { type: "service" }, path11);
|
|
1281
1281
|
return service;
|
|
1282
1282
|
};
|
|
1283
1283
|
var getServices = (directory) => async (options) => getResources(directory, {
|
|
@@ -1312,8 +1312,8 @@ var writeService = (directory) => async (service, options = {
|
|
|
1312
1312
|
};
|
|
1313
1313
|
var writeVersionedService = (directory) => async (service) => {
|
|
1314
1314
|
const resource = { ...service };
|
|
1315
|
-
const
|
|
1316
|
-
return await writeService(directory)(resource, { path:
|
|
1315
|
+
const path11 = getVersionedDirectory(service.id, service.version);
|
|
1316
|
+
return await writeService(directory)(resource, { path: path11 });
|
|
1317
1317
|
};
|
|
1318
1318
|
var writeServiceToDomain = (directory) => async (service, domain, options = { path: "", format: "mdx", override: false }) => {
|
|
1319
1319
|
let pathForService = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/services` : `/${domain.id}/services`;
|
|
@@ -1329,8 +1329,8 @@ var writeServiceToSystem = (directory) => async (service, system, options = { pa
|
|
|
1329
1329
|
await writeResource(directory, { ...service }, { ...options, path: pathForService, type: "service" });
|
|
1330
1330
|
};
|
|
1331
1331
|
var versionService = (directory) => async (id) => versionResource(directory, id);
|
|
1332
|
-
var rmService = (directory) => async (
|
|
1333
|
-
await fs5.rm(join6(directory,
|
|
1332
|
+
var rmService = (directory) => async (path11) => {
|
|
1333
|
+
await fs5.rm(join6(directory, path11), { recursive: true });
|
|
1334
1334
|
invalidateFileCache();
|
|
1335
1335
|
};
|
|
1336
1336
|
var rmServiceById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -1395,8 +1395,8 @@ var addMessageToService = (directory) => async (id, direction, event, version) =
|
|
|
1395
1395
|
if (!existingResource) {
|
|
1396
1396
|
throw new Error(`Cannot find service ${id} in the catalog`);
|
|
1397
1397
|
}
|
|
1398
|
-
const
|
|
1399
|
-
const pathToResource = join6(
|
|
1398
|
+
const path11 = existingResource.split(/[\\/]+services/)[0];
|
|
1399
|
+
const pathToResource = join6(path11, "services");
|
|
1400
1400
|
await rmServiceById(directory)(id, version, true);
|
|
1401
1401
|
await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
|
|
1402
1402
|
};
|
|
@@ -1404,9 +1404,9 @@ var serviceHasVersion = (directory) => async (id, version) => {
|
|
|
1404
1404
|
const file = await findFileById(directory, id, version);
|
|
1405
1405
|
return !!file;
|
|
1406
1406
|
};
|
|
1407
|
-
var isService = (directory) => async (
|
|
1408
|
-
const service = await getServiceByPath(directory)(
|
|
1409
|
-
const relativePath = relative2(directory,
|
|
1407
|
+
var isService = (directory) => async (path11) => {
|
|
1408
|
+
const service = await getServiceByPath(directory)(path11);
|
|
1409
|
+
const relativePath = relative2(directory, path11);
|
|
1410
1410
|
const segments = relativePath.split(/[/\\]+/);
|
|
1411
1411
|
return !!service && segments.includes("services");
|
|
1412
1412
|
};
|
|
@@ -1428,8 +1428,8 @@ var addEntityToService = (directory) => async (id, entity, version) => {
|
|
|
1428
1428
|
if (!existingResource) {
|
|
1429
1429
|
throw new Error(`Cannot find service ${id} in the catalog`);
|
|
1430
1430
|
}
|
|
1431
|
-
const
|
|
1432
|
-
const pathToResource = join6(
|
|
1431
|
+
const path11 = existingResource.split(/[\\/]+services/)[0];
|
|
1432
|
+
const pathToResource = join6(path11, "services");
|
|
1433
1433
|
await rmServiceById(directory)(id, version, true);
|
|
1434
1434
|
await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
|
|
1435
1435
|
};
|
|
@@ -1464,8 +1464,8 @@ var addDataStoreToService = (directory) => async (id, operation, dataStore, vers
|
|
|
1464
1464
|
if (!existingResource) {
|
|
1465
1465
|
throw new Error(`Cannot find service ${id} in the catalog`);
|
|
1466
1466
|
}
|
|
1467
|
-
const
|
|
1468
|
-
const pathToResource = join6(
|
|
1467
|
+
const path11 = existingResource.split(/[\\/]+services/)[0];
|
|
1468
|
+
const pathToResource = join6(path11, "services");
|
|
1469
1469
|
await rmServiceById(directory)(id, version, true);
|
|
1470
1470
|
await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
|
|
1471
1471
|
};
|
|
@@ -1517,8 +1517,8 @@ var persistSystemAtExistingPath = async (directory, system, version) => {
|
|
|
1517
1517
|
});
|
|
1518
1518
|
};
|
|
1519
1519
|
var getSystem = (directory) => async (id, version) => getResource(directory, id, version, { type: "system" });
|
|
1520
|
-
var getSystemByPath = (directory) => async (
|
|
1521
|
-
const system = await getResource(directory, void 0, void 0, { type: "system" },
|
|
1520
|
+
var getSystemByPath = (directory) => async (path11) => {
|
|
1521
|
+
const system = await getResource(directory, void 0, void 0, { type: "system" }, path11);
|
|
1522
1522
|
return system;
|
|
1523
1523
|
};
|
|
1524
1524
|
var getSystems = (directory) => async (options) => getResources(directory, {
|
|
@@ -1543,8 +1543,8 @@ var writeSystemToDomain = (directory) => async (system, domain, options = { path
|
|
|
1543
1543
|
await writeSystem(directory)({ ...system }, { ...options, path: pathForSystem });
|
|
1544
1544
|
};
|
|
1545
1545
|
var versionSystem = (directory) => async (id) => versionResource(directory, id);
|
|
1546
|
-
var rmSystem = (directory) => async (
|
|
1547
|
-
await fs6.rm(join7(directory,
|
|
1546
|
+
var rmSystem = (directory) => async (path11) => {
|
|
1547
|
+
await fs6.rm(join7(directory, path11), { recursive: true });
|
|
1548
1548
|
invalidateFileCache();
|
|
1549
1549
|
};
|
|
1550
1550
|
var rmSystemById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -1555,9 +1555,9 @@ var systemHasVersion = (directory) => async (id, version) => {
|
|
|
1555
1555
|
const file = await findFileById(directory, id, version);
|
|
1556
1556
|
return !!file;
|
|
1557
1557
|
};
|
|
1558
|
-
var isSystem = (directory) => async (
|
|
1559
|
-
const system = await getSystemByPath(directory)(
|
|
1560
|
-
const relativePath = relative3(directory,
|
|
1558
|
+
var isSystem = (directory) => async (path11) => {
|
|
1559
|
+
const system = await getSystemByPath(directory)(path11);
|
|
1560
|
+
const relativePath = relative3(directory, path11);
|
|
1561
1561
|
const segments = relativePath.split(/[/\\]+/);
|
|
1562
1562
|
return !!system && segments.includes("systems");
|
|
1563
1563
|
};
|
|
@@ -1597,8 +1597,8 @@ var rewriteAgent = async (directory, id, agent, version) => {
|
|
|
1597
1597
|
await writeAgent(directory)(agent, { path: agentPath.directory, format: extension === ".md" ? "md" : "mdx" });
|
|
1598
1598
|
};
|
|
1599
1599
|
var getAgent = (directory) => async (id, version) => getResource(directory, id, version, { type: "agent" });
|
|
1600
|
-
var getAgentByPath = (directory) => async (
|
|
1601
|
-
const agent = await getResource(directory, void 0, void 0, { type: "agent" },
|
|
1600
|
+
var getAgentByPath = (directory) => async (path11) => {
|
|
1601
|
+
const agent = await getResource(directory, void 0, void 0, { type: "agent" }, path11);
|
|
1602
1602
|
return agent;
|
|
1603
1603
|
};
|
|
1604
1604
|
var getAgents = (directory) => async (options) => getResources(directory, {
|
|
@@ -1631,8 +1631,8 @@ var writeAgent = (directory) => async (agent, options = {
|
|
|
1631
1631
|
return await writeResource(directory, resource, { ...options, type: "agent" });
|
|
1632
1632
|
};
|
|
1633
1633
|
var writeVersionedAgent = (directory) => async (agent) => {
|
|
1634
|
-
const
|
|
1635
|
-
return await writeAgent(directory)({ ...agent }, { path:
|
|
1634
|
+
const path11 = getVersionedDirectory(agent.id, agent.version);
|
|
1635
|
+
return await writeAgent(directory)({ ...agent }, { path: path11 });
|
|
1636
1636
|
};
|
|
1637
1637
|
var writeAgentToDomain = (directory) => async (agent, domain, options = { path: "", format: "mdx", override: false }) => {
|
|
1638
1638
|
let pathForAgent = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/agents` : `/${domain.id}/agents`;
|
|
@@ -1640,8 +1640,8 @@ var writeAgentToDomain = (directory) => async (agent, domain, options = { path:
|
|
|
1640
1640
|
await writeResource(directory, { ...agent }, { ...options, path: pathForAgent, type: "agent" });
|
|
1641
1641
|
};
|
|
1642
1642
|
var versionAgent = (directory) => async (id) => versionResource(directory, id);
|
|
1643
|
-
var rmAgent = (directory) => async (
|
|
1644
|
-
await fs7.rm(join8(directory,
|
|
1643
|
+
var rmAgent = (directory) => async (path11) => {
|
|
1644
|
+
await fs7.rm(join8(directory, path11), { recursive: true });
|
|
1645
1645
|
invalidateFileCache();
|
|
1646
1646
|
};
|
|
1647
1647
|
var rmAgentById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -1713,9 +1713,9 @@ var agentHasVersion = (directory) => async (id, version) => {
|
|
|
1713
1713
|
const file = await findFileById(directory, id, version);
|
|
1714
1714
|
return !!file;
|
|
1715
1715
|
};
|
|
1716
|
-
var isAgent = (directory) => async (
|
|
1717
|
-
const agent = await getAgentByPath(directory)(
|
|
1718
|
-
const relativePath = relative4(directory,
|
|
1716
|
+
var isAgent = (directory) => async (path11) => {
|
|
1717
|
+
const agent = await getAgentByPath(directory)(path11);
|
|
1718
|
+
const relativePath = relative4(directory, path11);
|
|
1719
1719
|
const segments = relativePath.split(/[/\\]+/);
|
|
1720
1720
|
return !!agent && segments.includes("agents");
|
|
1721
1721
|
};
|
|
@@ -1747,7 +1747,13 @@ var getDomains = (directory) => async (options) => getResources(directory, {
|
|
|
1747
1747
|
"**/commands/**",
|
|
1748
1748
|
"**/queries/**",
|
|
1749
1749
|
"**/flows/**",
|
|
1750
|
-
"**/entities/**"
|
|
1750
|
+
"**/entities/**",
|
|
1751
|
+
"**/systems/**",
|
|
1752
|
+
"**/containers/**",
|
|
1753
|
+
"**/data-products/**",
|
|
1754
|
+
"**/adrs/**",
|
|
1755
|
+
"**/diagrams/**",
|
|
1756
|
+
"**/channels/**"
|
|
1751
1757
|
],
|
|
1752
1758
|
...options
|
|
1753
1759
|
});
|
|
@@ -1782,8 +1788,8 @@ var writeDomain = (directory) => async (domain, options = {
|
|
|
1782
1788
|
return await writeResource(directory, resource, { ...options, type: "domain" });
|
|
1783
1789
|
};
|
|
1784
1790
|
var versionDomain = (directory) => async (id) => versionResource(directory, id);
|
|
1785
|
-
var rmDomain = (directory) => async (
|
|
1786
|
-
await fs8.rm(join9(directory,
|
|
1791
|
+
var rmDomain = (directory) => async (path11) => {
|
|
1792
|
+
await fs8.rm(join9(directory, path11), { recursive: true });
|
|
1787
1793
|
invalidateFileCache();
|
|
1788
1794
|
};
|
|
1789
1795
|
var rmDomainById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "domain", persistFiles });
|
|
@@ -1944,8 +1950,8 @@ import { join as join10, extname as extname4 } from "path";
|
|
|
1944
1950
|
var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
|
|
1945
1951
|
var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
|
|
1946
1952
|
var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
|
|
1947
|
-
var rmChannel = (directory) => async (
|
|
1948
|
-
await fs9.rm(join10(directory,
|
|
1953
|
+
var rmChannel = (directory) => async (path11) => {
|
|
1954
|
+
await fs9.rm(join10(directory, path11), { recursive: true });
|
|
1949
1955
|
invalidateFileCache();
|
|
1950
1956
|
};
|
|
1951
1957
|
var rmChannelById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "channel", persistFiles });
|
|
@@ -1987,8 +1993,8 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
1987
1993
|
if (!existingResource) {
|
|
1988
1994
|
throw new Error(`Cannot find message ${id} in the catalog`);
|
|
1989
1995
|
}
|
|
1990
|
-
const
|
|
1991
|
-
const pathToResource = join10(
|
|
1996
|
+
const path11 = existingResource.split(new RegExp(`[\\\\/]+${collection}`))[0];
|
|
1997
|
+
const pathToResource = join10(path11, collection);
|
|
1992
1998
|
await rmMessageById(directory)(_message.id, _message.version, true);
|
|
1993
1999
|
await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
|
|
1994
2000
|
};
|
|
@@ -1998,8 +2004,8 @@ import { dirname as dirname5, join as join11 } from "path";
|
|
|
1998
2004
|
import fsSync4 from "fs";
|
|
1999
2005
|
import matter4 from "gray-matter";
|
|
2000
2006
|
import { satisfies as satisfies4, validRange as validRange3 } from "semver";
|
|
2001
|
-
var getMessageBySchemaPath = (directory) => async (
|
|
2002
|
-
const pathToMessage = dirname5(
|
|
2007
|
+
var getMessageBySchemaPath = (directory) => async (path11, options) => {
|
|
2008
|
+
const pathToMessage = dirname5(path11);
|
|
2003
2009
|
try {
|
|
2004
2010
|
const files = await getFiles(`${directory}/${pathToMessage}/index.{md,mdx}`);
|
|
2005
2011
|
if (!files || files.length === 0) {
|
|
@@ -2075,18 +2081,18 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
|
|
|
2075
2081
|
}
|
|
2076
2082
|
return { producers, consumers };
|
|
2077
2083
|
};
|
|
2078
|
-
var getConsumersOfSchema = (directory) => async (
|
|
2084
|
+
var getConsumersOfSchema = (directory) => async (path11) => {
|
|
2079
2085
|
try {
|
|
2080
|
-
const message = await getMessageBySchemaPath(directory)(
|
|
2086
|
+
const message = await getMessageBySchemaPath(directory)(path11);
|
|
2081
2087
|
const { consumers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
|
|
2082
2088
|
return consumers;
|
|
2083
2089
|
} catch (error) {
|
|
2084
2090
|
return [];
|
|
2085
2091
|
}
|
|
2086
2092
|
};
|
|
2087
|
-
var getProducersOfSchema = (directory) => async (
|
|
2093
|
+
var getProducersOfSchema = (directory) => async (path11) => {
|
|
2088
2094
|
try {
|
|
2089
|
-
const message = await getMessageBySchemaPath(directory)(
|
|
2095
|
+
const message = await getMessageBySchemaPath(directory)(path11);
|
|
2090
2096
|
const { producers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
|
|
2091
2097
|
return producers;
|
|
2092
2098
|
} catch (error) {
|
|
@@ -2335,8 +2341,8 @@ var filterCollection = (collection, options) => {
|
|
|
2335
2341
|
};
|
|
2336
2342
|
var getEventCatalogConfigurationFile = (directory) => async () => {
|
|
2337
2343
|
try {
|
|
2338
|
-
const
|
|
2339
|
-
const configModule = await import(
|
|
2344
|
+
const path11 = join15(directory, "eventcatalog.config.js");
|
|
2345
|
+
const configModule = await import(path11);
|
|
2340
2346
|
return configModule.default;
|
|
2341
2347
|
} catch (error) {
|
|
2342
2348
|
console.error("Error getting event catalog configuration file", error);
|
|
@@ -2444,8 +2450,8 @@ var writeAdr = (directory) => async (adr, options = {
|
|
|
2444
2450
|
override: false,
|
|
2445
2451
|
format: "mdx"
|
|
2446
2452
|
}) => writeResource(directory, { ...adr }, { ...options, type: "adr" });
|
|
2447
|
-
var rmAdr = (directory) => async (
|
|
2448
|
-
await fs14.rm(join16(directory,
|
|
2453
|
+
var rmAdr = (directory) => async (path11) => {
|
|
2454
|
+
await fs14.rm(join16(directory, path11), { recursive: true });
|
|
2449
2455
|
invalidateFileCache();
|
|
2450
2456
|
};
|
|
2451
2457
|
var rmAdrById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -2473,8 +2479,8 @@ var writeDataProductToDomain = (directory) => async (dataProduct, domain, option
|
|
|
2473
2479
|
pathForDataProduct = join17(pathForDataProduct, dataProduct.id);
|
|
2474
2480
|
await writeResource(directory, { ...dataProduct }, { ...options, path: pathForDataProduct, type: "data-product" });
|
|
2475
2481
|
};
|
|
2476
|
-
var rmDataProduct = (directory) => async (
|
|
2477
|
-
await fs15.rm(join17(directory,
|
|
2482
|
+
var rmDataProduct = (directory) => async (path11) => {
|
|
2483
|
+
await fs15.rm(join17(directory, path11), { recursive: true });
|
|
2478
2484
|
invalidateFileCache();
|
|
2479
2485
|
};
|
|
2480
2486
|
var rmDataProductById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -2498,8 +2504,8 @@ var writeContainer = (directory) => async (data, options = {
|
|
|
2498
2504
|
format: "mdx"
|
|
2499
2505
|
}) => writeResource(directory, { ...data }, { ...options, type: "container" });
|
|
2500
2506
|
var versionContainer = (directory) => async (id) => versionResource(directory, id);
|
|
2501
|
-
var rmContainer = (directory) => async (
|
|
2502
|
-
await fs16.rm(join18(directory,
|
|
2507
|
+
var rmContainer = (directory) => async (path11) => {
|
|
2508
|
+
await fs16.rm(join18(directory, path11), { recursive: true });
|
|
2503
2509
|
invalidateFileCache();
|
|
2504
2510
|
};
|
|
2505
2511
|
var rmContainerById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -2558,8 +2564,8 @@ var writeEntityToSystem = (directory) => async (entity, system, options = { path
|
|
|
2558
2564
|
const pathForEntity = join19(resourcePath.directory, "entities", entity.id);
|
|
2559
2565
|
await writeResource(directory, { ...entity }, { ...options, path: pathForEntity, type: "entity" });
|
|
2560
2566
|
};
|
|
2561
|
-
var rmEntity = (directory) => async (
|
|
2562
|
-
await fs17.rm(join19(directory,
|
|
2567
|
+
var rmEntity = (directory) => async (path11) => {
|
|
2568
|
+
await fs17.rm(join19(directory, path11), { recursive: true });
|
|
2563
2569
|
invalidateFileCache();
|
|
2564
2570
|
};
|
|
2565
2571
|
var rmEntityById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -3050,8 +3056,8 @@ var writeFlow = (directory) => async (flow, options = {
|
|
|
3050
3056
|
format: "mdx"
|
|
3051
3057
|
}) => writeResource(directory, { ...flow }, { ...options, type: "flow" });
|
|
3052
3058
|
var writeVersionedFlow = (directory) => async (flow) => {
|
|
3053
|
-
const
|
|
3054
|
-
return await writeFlow(directory)({ ...flow }, { path:
|
|
3059
|
+
const path11 = getVersionedDirectory(flow.id, flow.version);
|
|
3060
|
+
return await writeFlow(directory)({ ...flow }, { path: path11 });
|
|
3055
3061
|
};
|
|
3056
3062
|
var writeFlowToDomain = (directory) => async (flow, domain, options = { path: "", format: "mdx", override: false }) => {
|
|
3057
3063
|
let pathForFlow = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/flows` : `/${domain.id}/flows`;
|
|
@@ -3076,8 +3082,8 @@ var writeFlowToAgent = (directory) => async (flow, agent, options = { path: "",
|
|
|
3076
3082
|
pathForFlow = join20(pathForFlow, flow.id);
|
|
3077
3083
|
await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
|
|
3078
3084
|
};
|
|
3079
|
-
var rmFlow = (directory) => async (
|
|
3080
|
-
await fs18.rm(join20(directory,
|
|
3085
|
+
var rmFlow = (directory) => async (path11) => {
|
|
3086
|
+
await fs18.rm(join20(directory, path11), { recursive: true });
|
|
3081
3087
|
invalidateFileCache();
|
|
3082
3088
|
};
|
|
3083
3089
|
var rmFlowById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -3153,8 +3159,8 @@ var indexResources = (resources) => {
|
|
|
3153
3159
|
}
|
|
3154
3160
|
return { byId, byVersion };
|
|
3155
3161
|
};
|
|
3156
|
-
var pathIncludes = (
|
|
3157
|
-
let current =
|
|
3162
|
+
var pathIncludes = (path11, key) => {
|
|
3163
|
+
let current = path11;
|
|
3158
3164
|
while (current) {
|
|
3159
3165
|
if (current.key === key) return true;
|
|
3160
3166
|
current = current.parent;
|
|
@@ -3755,10 +3761,329 @@ var listSnapshots = (directory) => async () => {
|
|
|
3755
3761
|
return snapshots.sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
3756
3762
|
};
|
|
3757
3763
|
|
|
3764
|
+
// src/build-index.ts
|
|
3765
|
+
import { createHash as createHash2 } from "crypto";
|
|
3766
|
+
import fs21 from "fs/promises";
|
|
3767
|
+
import path8 from "path";
|
|
3768
|
+
import ignore from "ignore";
|
|
3769
|
+
import { rcompare, valid as valid2 } from "semver";
|
|
3770
|
+
|
|
3771
|
+
// src/diagrams.ts
|
|
3772
|
+
import fs20 from "fs/promises";
|
|
3773
|
+
import { join as join21 } from "path";
|
|
3774
|
+
var getDiagram = (directory) => async (id, version) => getResource(directory, id, version, { type: "diagram" });
|
|
3775
|
+
var getDiagrams = (directory) => async (options) => getResources(directory, { type: "diagrams", latestOnly: options?.latestOnly });
|
|
3776
|
+
var writeDiagram = (directory) => async (diagram, options = {
|
|
3777
|
+
path: "",
|
|
3778
|
+
override: false,
|
|
3779
|
+
format: "mdx"
|
|
3780
|
+
}) => writeResource(directory, { ...diagram }, { ...options, type: "diagram" });
|
|
3781
|
+
var rmDiagram = (directory) => async (path11) => {
|
|
3782
|
+
await fs20.rm(join21(directory, path11), { recursive: true });
|
|
3783
|
+
invalidateFileCache();
|
|
3784
|
+
};
|
|
3785
|
+
var rmDiagramById = (directory) => async (id, version, persistFiles) => {
|
|
3786
|
+
await rmResourceById(directory, id, version, { type: "diagram", persistFiles });
|
|
3787
|
+
};
|
|
3788
|
+
var versionDiagram = (directory) => async (id) => versionResource(directory, id);
|
|
3789
|
+
var diagramHasVersion = (directory) => async (id, version) => {
|
|
3790
|
+
const file = await findFileById(directory, id, version);
|
|
3791
|
+
return !!file;
|
|
3792
|
+
};
|
|
3793
|
+
var addFileToDiagram = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version, { type: "diagram" });
|
|
3794
|
+
|
|
3795
|
+
// src/build-index.ts
|
|
3796
|
+
var normalizeSpecifications = async (resource, resourcePath, hashContent) => {
|
|
3797
|
+
if (resource.specifications === void 0) return void 0;
|
|
3798
|
+
const specifications = Array.isArray(resource.specifications) ? resource.specifications : [
|
|
3799
|
+
{ type: "asyncapi", path: resource.specifications.asyncapiPath },
|
|
3800
|
+
{ type: "openapi", path: resource.specifications.openapiPath },
|
|
3801
|
+
{ type: "graphql", path: resource.specifications.graphqlPath }
|
|
3802
|
+
].flatMap(({ type, path: path11 }) => path11 ? [{ type, path: path11 }] : []);
|
|
3803
|
+
return Promise.all(
|
|
3804
|
+
specifications.map(async (specification) => ({
|
|
3805
|
+
...specification,
|
|
3806
|
+
...hashContent ? {
|
|
3807
|
+
hash: `sha256:${createHash2("sha256").update(await fs21.readFile(path8.join(path8.dirname(resourcePath), specification.path))).digest("hex")}`
|
|
3808
|
+
} : {}
|
|
3809
|
+
}))
|
|
3810
|
+
);
|
|
3811
|
+
};
|
|
3812
|
+
var getFlowReferences = (steps) => steps.flatMap((step) => [
|
|
3813
|
+
...step.service ? [{ kind: "service", ...step.service }] : [],
|
|
3814
|
+
...step.message ? [{ kind: "message", ...step.message }] : [],
|
|
3815
|
+
...step.agent ? [{ kind: "agent", ...step.agent }] : [],
|
|
3816
|
+
...step.container ? [{ kind: "container", ...step.container }] : [],
|
|
3817
|
+
...step.dataProduct ? [{ kind: "data-product", ...step.dataProduct }] : [],
|
|
3818
|
+
...step.flow ? [{ kind: "flow", ...step.flow }] : []
|
|
3819
|
+
]);
|
|
3820
|
+
var compareText = (left, right) => left < right ? -1 : left > right ? 1 : 0;
|
|
3821
|
+
var compareVersions = (left, right) => {
|
|
3822
|
+
if (left === right) return 0;
|
|
3823
|
+
if (left === void 0) return 1;
|
|
3824
|
+
if (right === void 0) return -1;
|
|
3825
|
+
if (valid2(left) && valid2(right)) return rcompare(left, right);
|
|
3826
|
+
return compareText(right, left);
|
|
3827
|
+
};
|
|
3828
|
+
var compareIndexResources = (left, right) => compareText(left.type, right.type) || compareText(left.id, right.id) || compareVersions(left.version, right.version);
|
|
3829
|
+
var toCatalogPath = (directory, filePath) => path8.relative(directory, filePath).split(path8.sep).join("/");
|
|
3830
|
+
var loadIgnoreRules = async (directory) => {
|
|
3831
|
+
try {
|
|
3832
|
+
return ignore().add(await fs21.readFile(path8.join(directory, ".eventcatalogignore"), "utf8"));
|
|
3833
|
+
} catch (error) {
|
|
3834
|
+
if (error.code === "ENOENT") return void 0;
|
|
3835
|
+
throw error;
|
|
3836
|
+
}
|
|
3837
|
+
};
|
|
3838
|
+
var normalizeAssets = async (directory, hashContent, ignoreRules) => {
|
|
3839
|
+
const collectFiles = async (currentDirectory) => {
|
|
3840
|
+
let entries;
|
|
3841
|
+
try {
|
|
3842
|
+
entries = await fs21.readdir(currentDirectory, { withFileTypes: true });
|
|
3843
|
+
} catch (error) {
|
|
3844
|
+
if (error.code === "ENOENT") return [];
|
|
3845
|
+
throw error;
|
|
3846
|
+
}
|
|
3847
|
+
const files = await Promise.all(
|
|
3848
|
+
entries.sort((left, right) => compareText(left.name, right.name)).map(async (entry) => {
|
|
3849
|
+
const entryPath = path8.join(currentDirectory, entry.name);
|
|
3850
|
+
const catalogPath = toCatalogPath(directory, entryPath);
|
|
3851
|
+
if (entry.isDirectory()) return ignoreRules?.ignores(`${catalogPath}/`) ? [] : collectFiles(entryPath);
|
|
3852
|
+
return entry.isFile() && !ignoreRules?.ignores(catalogPath) ? [entryPath] : [];
|
|
3853
|
+
})
|
|
3854
|
+
);
|
|
3855
|
+
return files.flat();
|
|
3856
|
+
};
|
|
3857
|
+
const assetPaths = (await Promise.all(["components", "public"].map((assetDirectory) => collectFiles(path8.join(directory, assetDirectory))))).flat().sort(compareText);
|
|
3858
|
+
const assets = await Promise.all(
|
|
3859
|
+
assetPaths.map(async (assetPath) => ({
|
|
3860
|
+
path: toCatalogPath(directory, assetPath),
|
|
3861
|
+
...hashContent ? {
|
|
3862
|
+
hash: `sha256:${createHash2("sha256").update(await fs21.readFile(assetPath)).digest("hex")}`
|
|
3863
|
+
} : {}
|
|
3864
|
+
}))
|
|
3865
|
+
);
|
|
3866
|
+
return assets.length === 0 ? void 0 : assets;
|
|
3867
|
+
};
|
|
3868
|
+
var normalizeSchemas = async (resource, resourcePath, hashContent) => {
|
|
3869
|
+
const schemas = resource.schemas ?? (resource.schemaPath ? [{ path: resource.schemaPath, default: true }] : void 0);
|
|
3870
|
+
if (schemas === void 0) return void 0;
|
|
3871
|
+
return Promise.all(
|
|
3872
|
+
schemas.map(async ({ file, ...schema }) => {
|
|
3873
|
+
const schemaPath = file ?? schema.path;
|
|
3874
|
+
return {
|
|
3875
|
+
...schema,
|
|
3876
|
+
...schemaPath === void 0 ? {} : { path: schemaPath },
|
|
3877
|
+
...hashContent && schemaPath ? {
|
|
3878
|
+
hash: `sha256:${createHash2("sha256").update(await fs21.readFile(path8.join(path8.dirname(resourcePath), schemaPath))).digest("hex")}`
|
|
3879
|
+
} : {}
|
|
3880
|
+
};
|
|
3881
|
+
})
|
|
3882
|
+
);
|
|
3883
|
+
};
|
|
3884
|
+
var IGNORED_SIDECAR_FILES = /* @__PURE__ */ new Set([".DS_Store", ".gitignore", ".gitkeep", ".npmignore", "Thumbs.db", "desktop.ini"]);
|
|
3885
|
+
var IGNORED_SIDECAR_DIRECTORIES = /* @__PURE__ */ new Set([".git", ".hg", ".svn", "node_modules"]);
|
|
3886
|
+
var normalizeSidecars = async (directory, resourcePath, resourceDirectories, representedPaths, hashContent, ignoreRules) => {
|
|
3887
|
+
if (!/^index\.mdx?$/i.test(path8.basename(resourcePath))) return void 0;
|
|
3888
|
+
const collectFiles = async (currentDirectory) => {
|
|
3889
|
+
let entries;
|
|
3890
|
+
try {
|
|
3891
|
+
entries = await fs21.readdir(currentDirectory, { withFileTypes: true });
|
|
3892
|
+
} catch (error) {
|
|
3893
|
+
if (error.code === "ENOENT") return [];
|
|
3894
|
+
throw error;
|
|
3895
|
+
}
|
|
3896
|
+
const files = await Promise.all(
|
|
3897
|
+
entries.sort((left, right) => compareText(left.name, right.name)).map(async (entry) => {
|
|
3898
|
+
const entryPath = path8.join(currentDirectory, entry.name);
|
|
3899
|
+
const resolvedEntryPath = path8.resolve(entryPath);
|
|
3900
|
+
const catalogPath = toCatalogPath(directory, entryPath);
|
|
3901
|
+
if (entry.isDirectory()) {
|
|
3902
|
+
if (IGNORED_SIDECAR_DIRECTORIES.has(entry.name) || resourceDirectories.has(resolvedEntryPath)) return [];
|
|
3903
|
+
if (ignoreRules?.ignores(`${catalogPath}/`)) return [];
|
|
3904
|
+
return collectFiles(entryPath);
|
|
3905
|
+
}
|
|
3906
|
+
if (!entry.isFile()) return [];
|
|
3907
|
+
if (IGNORED_SIDECAR_FILES.has(entry.name) || representedPaths.has(resolvedEntryPath)) return [];
|
|
3908
|
+
if (entry.name.endsWith("~") || /^\..*\.sw[op]$/.test(entry.name)) return [];
|
|
3909
|
+
if (ignoreRules?.ignores(catalogPath)) return [];
|
|
3910
|
+
return [entryPath];
|
|
3911
|
+
})
|
|
3912
|
+
);
|
|
3913
|
+
return files.flat();
|
|
3914
|
+
};
|
|
3915
|
+
const sidecarPaths = (await collectFiles(path8.dirname(resourcePath))).sort(compareText);
|
|
3916
|
+
const sidecars = await Promise.all(
|
|
3917
|
+
sidecarPaths.map(async (sidecarPath) => ({
|
|
3918
|
+
path: toCatalogPath(directory, sidecarPath),
|
|
3919
|
+
...hashContent ? {
|
|
3920
|
+
hash: `sha256:${createHash2("sha256").update(await fs21.readFile(sidecarPath)).digest("hex")}`
|
|
3921
|
+
} : {}
|
|
3922
|
+
}))
|
|
3923
|
+
);
|
|
3924
|
+
return sidecars.length === 0 ? void 0 : sidecars;
|
|
3925
|
+
};
|
|
3926
|
+
var toIndexResource = async (directory, type, resource, hashContent, sourcePath, resourceDirectories, ignoreRules) => {
|
|
3927
|
+
const { id, version, name } = resource;
|
|
3928
|
+
const schemas = await normalizeSchemas(resource, sourcePath, hashContent);
|
|
3929
|
+
const specifications = await normalizeSpecifications(resource, sourcePath, hashContent);
|
|
3930
|
+
const representedPaths = new Set(
|
|
3931
|
+
[
|
|
3932
|
+
sourcePath,
|
|
3933
|
+
...(schemas ?? []).flatMap((schema) => schema.path ? [path8.join(path8.dirname(sourcePath), schema.path)] : []),
|
|
3934
|
+
...(specifications ?? []).map((specification) => path8.join(path8.dirname(sourcePath), specification.path))
|
|
3935
|
+
].map((representedPath) => path8.resolve(representedPath))
|
|
3936
|
+
);
|
|
3937
|
+
const sidecars = await normalizeSidecars(
|
|
3938
|
+
directory,
|
|
3939
|
+
sourcePath,
|
|
3940
|
+
resourceDirectories,
|
|
3941
|
+
representedPaths,
|
|
3942
|
+
hashContent,
|
|
3943
|
+
ignoreRules
|
|
3944
|
+
);
|
|
3945
|
+
return {
|
|
3946
|
+
type,
|
|
3947
|
+
id,
|
|
3948
|
+
...version === void 0 ? {} : { version },
|
|
3949
|
+
name,
|
|
3950
|
+
contentPath: toCatalogPath(directory, sourcePath),
|
|
3951
|
+
...hashContent ? {
|
|
3952
|
+
contentHash: `sha256:${createHash2("sha256").update(await fs21.readFile(sourcePath)).digest("hex")}`
|
|
3953
|
+
} : {},
|
|
3954
|
+
...resource.draft === void 0 ? {} : { draft: resource.draft },
|
|
3955
|
+
...resource.deprecated === void 0 ? {} : { deprecated: resource.deprecated },
|
|
3956
|
+
...resource.owners === void 0 ? {} : { owners: resource.owners },
|
|
3957
|
+
...resource.diagrams === void 0 ? {} : { diagrams: resource.diagrams },
|
|
3958
|
+
...schemas === void 0 ? {} : { schemas },
|
|
3959
|
+
...specifications === void 0 ? {} : { specifications },
|
|
3960
|
+
...sidecars === void 0 ? {} : { sidecars },
|
|
3961
|
+
...resource.container_type === void 0 ? {} : { container_type: resource.container_type },
|
|
3962
|
+
...resource.steps === void 0 ? {} : { references: getFlowReferences(resource.steps) },
|
|
3963
|
+
...resource.sends === void 0 ? {} : { sends: resource.sends },
|
|
3964
|
+
...resource.receives === void 0 ? {} : { receives: resource.receives },
|
|
3965
|
+
...resource.channels === void 0 ? {} : { channels: resource.channels },
|
|
3966
|
+
...resource.address === void 0 ? {} : { address: resource.address },
|
|
3967
|
+
...resource.protocols === void 0 ? {} : { protocols: resource.protocols },
|
|
3968
|
+
...resource.deliveryGuarantee === void 0 ? {} : { deliveryGuarantee: resource.deliveryGuarantee },
|
|
3969
|
+
...resource.routes === void 0 ? {} : { routes: resource.routes },
|
|
3970
|
+
...resource.parameters === void 0 ? {} : { parameters: resource.parameters },
|
|
3971
|
+
...resource.services === void 0 ? {} : { services: resource.services },
|
|
3972
|
+
...resource.agents === void 0 ? {} : { agents: resource.agents },
|
|
3973
|
+
...resource.domains === void 0 ? {} : { domains: resource.domains },
|
|
3974
|
+
...resource.systems === void 0 ? {} : { systems: resource.systems },
|
|
3975
|
+
...resource.entities === void 0 ? {} : { entities: resource.entities },
|
|
3976
|
+
...resource.dataProducts === void 0 ? {} : { dataProducts: resource.dataProducts },
|
|
3977
|
+
...resource.flows === void 0 ? {} : { flows: resource.flows },
|
|
3978
|
+
...resource.writesTo === void 0 ? {} : { writesTo: resource.writesTo },
|
|
3979
|
+
...resource.readsFrom === void 0 ? {} : { readsFrom: resource.readsFrom },
|
|
3980
|
+
...resource.containers === void 0 ? {} : { containers: resource.containers },
|
|
3981
|
+
...resource.relationships === void 0 ? {} : { relationships: resource.relationships },
|
|
3982
|
+
...resource.actors === void 0 ? {} : { actors: resource.actors },
|
|
3983
|
+
...resource.inputs === void 0 ? {} : { inputs: resource.inputs },
|
|
3984
|
+
...resource.outputs === void 0 ? {} : { outputs: resource.outputs },
|
|
3985
|
+
...resource.status === void 0 ? {} : { status: resource.status },
|
|
3986
|
+
...resource.appliesTo === void 0 ? {} : { appliesTo: resource.appliesTo },
|
|
3987
|
+
...resource.supersedes === void 0 ? {} : { supersedes: resource.supersedes },
|
|
3988
|
+
...resource.supersededBy === void 0 ? {} : { supersededBy: resource.supersededBy },
|
|
3989
|
+
...resource.amends === void 0 ? {} : { amends: resource.amends },
|
|
3990
|
+
...resource.amendedBy === void 0 ? {} : { amendedBy: resource.amendedBy },
|
|
3991
|
+
...resource.related === void 0 ? {} : { related: resource.related },
|
|
3992
|
+
...resource.members === void 0 ? {} : { members: resource.members }
|
|
3993
|
+
};
|
|
3994
|
+
};
|
|
3995
|
+
var buildIndex = (directory) => async ({ source, commit, hashContent = true }) => {
|
|
3996
|
+
const [
|
|
3997
|
+
domains,
|
|
3998
|
+
channels,
|
|
3999
|
+
events,
|
|
4000
|
+
commands,
|
|
4001
|
+
queries,
|
|
4002
|
+
services,
|
|
4003
|
+
systems,
|
|
4004
|
+
dataProducts,
|
|
4005
|
+
dataStores,
|
|
4006
|
+
entities,
|
|
4007
|
+
flows,
|
|
4008
|
+
adrs,
|
|
4009
|
+
agents,
|
|
4010
|
+
teams,
|
|
4011
|
+
users,
|
|
4012
|
+
diagrams
|
|
4013
|
+
] = await Promise.all([
|
|
4014
|
+
getDomains(directory)(),
|
|
4015
|
+
getChannels(directory)(),
|
|
4016
|
+
getEvents(directory)(),
|
|
4017
|
+
getCommands(directory)(),
|
|
4018
|
+
getQueries(directory)(),
|
|
4019
|
+
getServices(directory)(),
|
|
4020
|
+
getSystems(directory)(),
|
|
4021
|
+
getDataProducts(directory)(),
|
|
4022
|
+
getDataStores(directory)(),
|
|
4023
|
+
getEntities(directory)(),
|
|
4024
|
+
getFlows(directory)(),
|
|
4025
|
+
getAdrs(directory)(),
|
|
4026
|
+
getAgents(directory)(),
|
|
4027
|
+
getTeams(path8.join(directory, "teams"))(),
|
|
4028
|
+
getUsers(directory)(),
|
|
4029
|
+
getDiagrams(directory)()
|
|
4030
|
+
]);
|
|
4031
|
+
const indexableResources = [
|
|
4032
|
+
...(domains ?? []).map((resource) => ({ type: "domain", resource })),
|
|
4033
|
+
...(channels ?? []).map((resource) => ({ type: "channel", resource })),
|
|
4034
|
+
...(events ?? []).map((resource) => ({ type: "event", resource })),
|
|
4035
|
+
...(commands ?? []).map((resource) => ({ type: "command", resource })),
|
|
4036
|
+
...(queries ?? []).map((resource) => ({ type: "query", resource })),
|
|
4037
|
+
...(services ?? []).map((resource) => ({ type: "service", resource })),
|
|
4038
|
+
...(systems ?? []).map((resource) => ({ type: "system", resource })),
|
|
4039
|
+
...(dataProducts ?? []).map((resource) => ({ type: "data-product", resource })),
|
|
4040
|
+
...(dataStores ?? []).map((resource) => ({ type: "container", resource })),
|
|
4041
|
+
...(entities ?? []).map((resource) => ({ type: "entity", resource })),
|
|
4042
|
+
...(flows ?? []).map((resource) => ({ type: "flow", resource })),
|
|
4043
|
+
...(adrs ?? []).map((resource) => ({ type: "adr", resource })),
|
|
4044
|
+
...(agents ?? []).map((resource) => ({ type: "agent", resource })),
|
|
4045
|
+
...(teams ?? []).map((resource) => ({
|
|
4046
|
+
type: "team",
|
|
4047
|
+
resource,
|
|
4048
|
+
sourcePath: path8.join(directory, "teams", `${resource.id}.mdx`)
|
|
4049
|
+
})),
|
|
4050
|
+
...(users ?? []).map((resource) => ({
|
|
4051
|
+
type: "user",
|
|
4052
|
+
resource,
|
|
4053
|
+
sourcePath: path8.join(directory, "users", `${resource.id}.mdx`)
|
|
4054
|
+
})),
|
|
4055
|
+
...(diagrams ?? []).map((resource) => ({ type: "diagram", resource }))
|
|
4056
|
+
];
|
|
4057
|
+
const locatedResources = await Promise.all(
|
|
4058
|
+
indexableResources.map(async (entry) => {
|
|
4059
|
+
const sourcePath = entry.sourcePath ?? (await getResourcePath(directory, entry.resource.id, entry.resource.version))?.fullPath;
|
|
4060
|
+
if (!sourcePath) throw new Error(`Cannot find ${entry.type} ${entry.resource.id} (${entry.resource.version})`);
|
|
4061
|
+
return { ...entry, sourcePath };
|
|
4062
|
+
})
|
|
4063
|
+
);
|
|
4064
|
+
const resourceDirectories = new Set(
|
|
4065
|
+
locatedResources.filter(({ sourcePath }) => /^index\.mdx?$/i.test(path8.basename(sourcePath))).map(({ sourcePath }) => path8.resolve(path8.dirname(sourcePath)))
|
|
4066
|
+
);
|
|
4067
|
+
const ignoreRules = await loadIgnoreRules(directory);
|
|
4068
|
+
const resources = await Promise.all(
|
|
4069
|
+
locatedResources.map(
|
|
4070
|
+
({ type, resource, sourcePath }) => toIndexResource(directory, type, resource, hashContent, sourcePath, resourceDirectories, ignoreRules)
|
|
4071
|
+
)
|
|
4072
|
+
);
|
|
4073
|
+
const assets = await normalizeAssets(directory, hashContent, ignoreRules);
|
|
4074
|
+
return {
|
|
4075
|
+
indexVersion: 1,
|
|
4076
|
+
source,
|
|
4077
|
+
commit,
|
|
4078
|
+
resources: resources.sort(compareIndexResources),
|
|
4079
|
+
...assets === void 0 ? {} : { assets }
|
|
4080
|
+
};
|
|
4081
|
+
};
|
|
4082
|
+
|
|
3758
4083
|
// src/changelogs.ts
|
|
3759
|
-
import
|
|
4084
|
+
import path9, { dirname as dirname7 } from "path";
|
|
3760
4085
|
import fsSync8 from "fs";
|
|
3761
|
-
import
|
|
4086
|
+
import fs22 from "fs/promises";
|
|
3762
4087
|
import matter8 from "gray-matter";
|
|
3763
4088
|
var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
|
|
3764
4089
|
const { version, format = "mdx" } = options;
|
|
@@ -3767,7 +4092,7 @@ var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
|
|
|
3767
4092
|
throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
|
|
3768
4093
|
}
|
|
3769
4094
|
const resourceDir = dirname7(resourceFile);
|
|
3770
|
-
const changelogPath =
|
|
4095
|
+
const changelogPath = path9.join(resourceDir, `changelog.${format}`);
|
|
3771
4096
|
const { markdown, ...frontmatter } = changelog;
|
|
3772
4097
|
const fm = { ...frontmatter };
|
|
3773
4098
|
if (fm.createdAt instanceof Date) {
|
|
@@ -3788,8 +4113,8 @@ var appendChangelog = (catalogDir) => async (id, changelog, options = {}) => {
|
|
|
3788
4113
|
throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
|
|
3789
4114
|
}
|
|
3790
4115
|
const resourceDir = dirname7(resourceFile);
|
|
3791
|
-
const mdxPath =
|
|
3792
|
-
const mdPath =
|
|
4116
|
+
const mdxPath = path9.join(resourceDir, "changelog.mdx");
|
|
4117
|
+
const mdPath = path9.join(resourceDir, "changelog.md");
|
|
3793
4118
|
const existingPath = fsSync8.existsSync(mdxPath) ? mdxPath : fsSync8.existsSync(mdPath) ? mdPath : void 0;
|
|
3794
4119
|
if (!existingPath) {
|
|
3795
4120
|
return writeChangelog(catalogDir)(id, changelog, options);
|
|
@@ -3818,8 +4143,8 @@ var getChangelog = (catalogDir) => async (id, options = {}) => {
|
|
|
3818
4143
|
const resourceFile = await findFileById(catalogDir, id, version);
|
|
3819
4144
|
if (!resourceFile) return void 0;
|
|
3820
4145
|
const resourceDir = dirname7(resourceFile);
|
|
3821
|
-
const mdxPath =
|
|
3822
|
-
const mdPath =
|
|
4146
|
+
const mdxPath = path9.join(resourceDir, "changelog.mdx");
|
|
4147
|
+
const mdPath = path9.join(resourceDir, "changelog.md");
|
|
3823
4148
|
const changelogPath = fsSync8.existsSync(mdxPath) ? mdxPath : fsSync8.existsSync(mdPath) ? mdPath : void 0;
|
|
3824
4149
|
if (!changelogPath) return void 0;
|
|
3825
4150
|
const { data, content } = matter8.read(changelogPath);
|
|
@@ -3832,43 +4157,585 @@ var rmChangelog = (catalogDir) => async (id, options = {}) => {
|
|
|
3832
4157
|
throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
|
|
3833
4158
|
}
|
|
3834
4159
|
const resourceDir = dirname7(resourceFile);
|
|
3835
|
-
const mdxPath =
|
|
3836
|
-
const mdPath =
|
|
4160
|
+
const mdxPath = path9.join(resourceDir, "changelog.mdx");
|
|
4161
|
+
const mdPath = path9.join(resourceDir, "changelog.md");
|
|
3837
4162
|
if (fsSync8.existsSync(mdxPath)) {
|
|
3838
|
-
await
|
|
4163
|
+
await fs22.rm(mdxPath);
|
|
3839
4164
|
}
|
|
3840
4165
|
if (fsSync8.existsSync(mdPath)) {
|
|
3841
|
-
await
|
|
4166
|
+
await fs22.rm(mdPath);
|
|
3842
4167
|
}
|
|
3843
4168
|
invalidateFileCache();
|
|
3844
4169
|
};
|
|
3845
4170
|
|
|
3846
|
-
// src/
|
|
3847
|
-
import
|
|
3848
|
-
|
|
3849
|
-
var
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
4171
|
+
// src/resolve.ts
|
|
4172
|
+
import { gt, satisfies as satisfies5, valid as valid3, validRange as validRange5 } from "semver";
|
|
4173
|
+
var compareText2 = (left, right) => left < right ? -1 : left > right ? 1 : 0;
|
|
4174
|
+
var isHigherVersion = (candidate, current) => {
|
|
4175
|
+
if (candidate === current || candidate === void 0) return false;
|
|
4176
|
+
if (current === void 0) return true;
|
|
4177
|
+
if (valid3(candidate) && valid3(current)) return gt(candidate, current);
|
|
4178
|
+
return compareText2(candidate, current) > 0;
|
|
4179
|
+
};
|
|
4180
|
+
var selectTarget = (candidates, pointerVersion) => {
|
|
4181
|
+
if (!candidates?.length) return void 0;
|
|
4182
|
+
if (pointerVersion === void 0 || pointerVersion === "latest") {
|
|
4183
|
+
return candidates.reduce((latest, candidate) => isHigherVersion(candidate.version, latest.version) ? candidate : latest);
|
|
4184
|
+
}
|
|
4185
|
+
const exactMatch = candidates.find((candidate) => candidate.version === pointerVersion);
|
|
4186
|
+
if (exactMatch) return exactMatch;
|
|
4187
|
+
const range = validRange5(pointerVersion);
|
|
4188
|
+
if (!range) return void 0;
|
|
4189
|
+
return candidates.reduce((latest, candidate) => {
|
|
4190
|
+
if (candidate.version === void 0 || !valid3(candidate.version) || !satisfies5(candidate.version, range)) return latest;
|
|
4191
|
+
if (latest === void 0 || isHigherVersion(candidate.version, latest.version)) return candidate;
|
|
4192
|
+
return latest;
|
|
4193
|
+
}, void 0);
|
|
4194
|
+
};
|
|
4195
|
+
var getPointerFields = (entity) => [
|
|
4196
|
+
{ direction: "sends", pointers: entity.sends },
|
|
4197
|
+
{ direction: "receives", pointers: entity.receives },
|
|
4198
|
+
{ direction: "writesTo", pointers: entity.writesTo },
|
|
4199
|
+
{ direction: "readsFrom", pointers: entity.readsFrom },
|
|
4200
|
+
{ direction: "contains", via: "services", pointers: entity.services },
|
|
4201
|
+
{ direction: "contains", via: "agents", pointers: entity.agents },
|
|
4202
|
+
{ direction: "contains", via: "domains", pointers: entity.domains },
|
|
4203
|
+
{ direction: "contains", via: "dataProducts", pointers: entity.dataProducts },
|
|
4204
|
+
{ direction: "contains", via: "systems", pointers: entity.systems },
|
|
4205
|
+
{ direction: "contains", via: "entities", pointers: entity.entities },
|
|
4206
|
+
{ direction: "contains", via: "containers", pointers: entity.containers },
|
|
4207
|
+
{ direction: "contains", via: "flows", pointers: entity.flows },
|
|
4208
|
+
{ direction: "relatesTo", via: "relationships", pointers: entity.relationships },
|
|
4209
|
+
{ direction: "receives", via: "inputs", pointers: entity.inputs },
|
|
4210
|
+
{ direction: "sends", via: "outputs", pointers: entity.outputs },
|
|
4211
|
+
{ direction: "references", via: "steps", pointers: entity.references },
|
|
4212
|
+
{ direction: "appliesTo", pointers: entity.appliesTo },
|
|
4213
|
+
{ direction: "relatesTo", via: "related", pointers: entity.related },
|
|
4214
|
+
{ direction: "relatesTo", via: "supersedes", pointers: entity.supersedes },
|
|
4215
|
+
{ direction: "relatesTo", via: "supersededBy", pointers: entity.supersededBy },
|
|
4216
|
+
{ direction: "relatesTo", via: "amends", pointers: entity.amends },
|
|
4217
|
+
{ direction: "relatesTo", via: "amendedBy", pointers: entity.amendedBy },
|
|
4218
|
+
{ direction: "relatesTo", via: "diagrams", pointers: entity.diagrams },
|
|
4219
|
+
{ direction: "references", via: "channels", pointers: entity.channels },
|
|
4220
|
+
{ direction: "references", via: "routes", pointers: entity.routes },
|
|
4221
|
+
{ direction: "sends", via: "sends.to", pointers: entity.sends?.flatMap((pointer) => pointer.to ?? []) },
|
|
4222
|
+
{ direction: "receives", via: "receives.from", pointers: entity.receives?.flatMap((pointer) => pointer.from ?? []) },
|
|
4223
|
+
{ direction: "sends", via: "receives.triggers", pointers: entity.receives?.flatMap((pointer) => pointer.triggers ?? []) }
|
|
4224
|
+
];
|
|
4225
|
+
var resolve2 = (indexes) => {
|
|
4226
|
+
const assetCandidatesByPath = /* @__PURE__ */ new Map();
|
|
4227
|
+
for (const { source, commit, assets: assets2 = [] } of indexes) {
|
|
4228
|
+
for (const asset of assets2) {
|
|
4229
|
+
const candidates = assetCandidatesByPath.get(asset.path) ?? [];
|
|
4230
|
+
candidates.push({ ...asset, resolvedFrom: { source, commit } });
|
|
4231
|
+
assetCandidatesByPath.set(asset.path, candidates);
|
|
4232
|
+
}
|
|
4233
|
+
}
|
|
4234
|
+
const assets = [];
|
|
4235
|
+
const warnings = [];
|
|
4236
|
+
for (const [assetPath, candidates] of assetCandidatesByPath) {
|
|
4237
|
+
candidates.sort(
|
|
4238
|
+
(left, right) => compareText2(left.resolvedFrom.source, right.resolvedFrom.source) || compareText2(left.resolvedFrom.commit, right.resolvedFrom.commit)
|
|
4239
|
+
);
|
|
4240
|
+
const [winner] = candidates;
|
|
4241
|
+
const sources = [...new Set(candidates.map((candidate) => candidate.resolvedFrom.source))].sort(compareText2);
|
|
4242
|
+
const hashes = new Set(candidates.map((candidate) => candidate.hash));
|
|
4243
|
+
const hashesCanBeCompared = candidates.every((candidate) => candidate.hash !== void 0);
|
|
4244
|
+
const hasCollision = candidates.length > 1 && (!hashesCanBeCompared || hashes.size > 1);
|
|
4245
|
+
assets.push({
|
|
4246
|
+
...winner,
|
|
4247
|
+
...!hasCollision && candidates.length > 1 ? { contributors: sources.filter((source) => source !== winner.resolvedFrom.source) } : {}
|
|
4248
|
+
});
|
|
4249
|
+
if (hasCollision) {
|
|
4250
|
+
warnings.push({
|
|
4251
|
+
kind: "asset-collision",
|
|
4252
|
+
path: assetPath,
|
|
4253
|
+
sources,
|
|
4254
|
+
winner: winner.resolvedFrom.source
|
|
4255
|
+
});
|
|
4256
|
+
}
|
|
4257
|
+
}
|
|
4258
|
+
assets.sort((left, right) => compareText2(left.path, right.path));
|
|
4259
|
+
warnings.sort((left, right) => compareText2(left.path, right.path));
|
|
4260
|
+
const entities = indexes.flatMap(
|
|
4261
|
+
({ source, commit, resources }) => resources.map((resource) => ({
|
|
4262
|
+
...resource,
|
|
4263
|
+
resolvedFrom: { source, commit }
|
|
4264
|
+
}))
|
|
4265
|
+
).sort(
|
|
4266
|
+
(left, right) => compareText2(left.id, right.id) || compareText2(left.version ?? "", right.version ?? "") || compareText2(left.type, right.type) || compareText2(left.resolvedFrom.source, right.resolvedFrom.source)
|
|
4267
|
+
);
|
|
4268
|
+
const entitiesById = /* @__PURE__ */ new Map();
|
|
4269
|
+
for (const entity of entities) {
|
|
4270
|
+
const matches = entitiesById.get(entity.id) ?? [];
|
|
4271
|
+
matches.push(entity);
|
|
4272
|
+
entitiesById.set(entity.id, matches);
|
|
4273
|
+
}
|
|
4274
|
+
const conflictsByKindAndId = /* @__PURE__ */ new Map();
|
|
4275
|
+
const addConflict = (kind, id, sources, detail) => {
|
|
4276
|
+
const key = `${kind}:${id}`;
|
|
4277
|
+
const conflict = conflictsByKindAndId.get(key);
|
|
4278
|
+
if (conflict) {
|
|
4279
|
+
conflict.sources = [.../* @__PURE__ */ new Set([...conflict.sources, ...sources])].sort(compareText2);
|
|
4280
|
+
if (conflict.detail === void 0) conflict.detail = detail;
|
|
4281
|
+
return;
|
|
4282
|
+
}
|
|
4283
|
+
conflictsByKindAndId.set(key, {
|
|
4284
|
+
kind,
|
|
4285
|
+
id,
|
|
4286
|
+
sources: [...new Set(sources)].sort(compareText2),
|
|
4287
|
+
...detail === void 0 ? {} : { detail }
|
|
4288
|
+
});
|
|
4289
|
+
};
|
|
4290
|
+
for (const [id, matches] of entitiesById) {
|
|
4291
|
+
const sources = [...new Set(matches.map((entity) => entity.resolvedFrom.source))];
|
|
4292
|
+
const types = new Set(matches.map((entity) => entity.type));
|
|
4293
|
+
if (types.size > 1) {
|
|
4294
|
+
addConflict("type-collision", id, sources);
|
|
4295
|
+
} else if (sources.length > 1) {
|
|
4296
|
+
addConflict("duplicate-source", id, sources);
|
|
4297
|
+
}
|
|
4298
|
+
}
|
|
4299
|
+
const externalsByPointer = /* @__PURE__ */ new Map();
|
|
4300
|
+
const edges = [];
|
|
4301
|
+
for (const entity of entities) {
|
|
4302
|
+
for (const field of getPointerFields(entity)) {
|
|
4303
|
+
for (const pointer of field.pointers ?? []) {
|
|
4304
|
+
const candidates = entitiesById.get(pointer.id);
|
|
4305
|
+
const target = selectTarget(candidates, pointer.version);
|
|
4306
|
+
if (!target) {
|
|
4307
|
+
if (candidates) {
|
|
4308
|
+
edges.push({
|
|
4309
|
+
from: entity.id,
|
|
4310
|
+
fromVersion: entity.version ?? null,
|
|
4311
|
+
fromResolvedFrom: entity.resolvedFrom,
|
|
4312
|
+
to: pointer.id,
|
|
4313
|
+
direction: field.direction,
|
|
4314
|
+
...field.via === void 0 ? {} : { via: field.via },
|
|
4315
|
+
...pointer.label === void 0 ? {} : { label: pointer.label },
|
|
4316
|
+
pointer: pointer.version ?? null,
|
|
4317
|
+
resolved: null,
|
|
4318
|
+
status: "unresolved"
|
|
4319
|
+
});
|
|
4320
|
+
continue;
|
|
4321
|
+
}
|
|
4322
|
+
const key = `${pointer.id}@${pointer.version ?? ""}`;
|
|
4323
|
+
const external = externalsByPointer.get(key) ?? {
|
|
4324
|
+
id: pointer.id,
|
|
4325
|
+
...pointer.version === void 0 ? {} : { version: pointer.version },
|
|
4326
|
+
referencedBy: []
|
|
4327
|
+
};
|
|
4328
|
+
if (!external.referencedBy.includes(entity.id)) external.referencedBy.push(entity.id);
|
|
4329
|
+
externalsByPointer.set(key, external);
|
|
4330
|
+
edges.push({
|
|
4331
|
+
from: entity.id,
|
|
4332
|
+
fromVersion: entity.version ?? null,
|
|
4333
|
+
fromResolvedFrom: entity.resolvedFrom,
|
|
4334
|
+
to: pointer.id,
|
|
4335
|
+
direction: field.direction,
|
|
4336
|
+
...field.via === void 0 ? {} : { via: field.via },
|
|
4337
|
+
...pointer.label === void 0 ? {} : { label: pointer.label },
|
|
4338
|
+
pointer: pointer.version ?? null,
|
|
4339
|
+
resolved: null,
|
|
4340
|
+
status: "external"
|
|
4341
|
+
});
|
|
4342
|
+
continue;
|
|
4343
|
+
}
|
|
4344
|
+
if (pointer.type !== void 0 && pointer.type !== target.type) {
|
|
4345
|
+
addConflict(
|
|
4346
|
+
"pointer-type-mismatch",
|
|
4347
|
+
pointer.id,
|
|
4348
|
+
[entity.resolvedFrom.source, target.resolvedFrom.source],
|
|
4349
|
+
`Expected ${pointer.type} but found ${target.type}`
|
|
4350
|
+
);
|
|
4351
|
+
}
|
|
4352
|
+
edges.push({
|
|
4353
|
+
from: entity.id,
|
|
4354
|
+
fromVersion: entity.version ?? null,
|
|
4355
|
+
fromResolvedFrom: entity.resolvedFrom,
|
|
4356
|
+
to: target.id,
|
|
4357
|
+
direction: field.direction,
|
|
4358
|
+
...field.via === void 0 ? {} : { via: field.via },
|
|
4359
|
+
...pointer.label === void 0 ? {} : { label: pointer.label },
|
|
4360
|
+
pointer: pointer.version ?? null,
|
|
4361
|
+
resolved: target.version ?? null,
|
|
4362
|
+
resolvedFrom: target.resolvedFrom,
|
|
4363
|
+
status: "resolved"
|
|
4364
|
+
});
|
|
4365
|
+
}
|
|
4366
|
+
}
|
|
4367
|
+
}
|
|
4368
|
+
return {
|
|
4369
|
+
entities,
|
|
4370
|
+
assets,
|
|
4371
|
+
edges,
|
|
4372
|
+
conflicts: [...conflictsByKindAndId.values()].sort(
|
|
4373
|
+
(left, right) => compareText2(left.id, right.id) || compareText2(left.kind, right.kind)
|
|
4374
|
+
),
|
|
4375
|
+
warnings,
|
|
4376
|
+
externals: [...externalsByPointer.values()]
|
|
4377
|
+
};
|
|
3859
4378
|
};
|
|
3860
|
-
|
|
3861
|
-
|
|
4379
|
+
|
|
4380
|
+
// src/hydrate.ts
|
|
4381
|
+
import { createHash as createHash3, randomUUID } from "crypto";
|
|
4382
|
+
import fs23 from "fs/promises";
|
|
4383
|
+
import path10 from "path";
|
|
4384
|
+
var getSourceDirectory = (source) => {
|
|
4385
|
+
const slug = source.replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "source";
|
|
4386
|
+
const digest = createHash3("sha256").update(source).digest("hex").slice(0, 12);
|
|
4387
|
+
return `${slug}--${digest}`;
|
|
4388
|
+
};
|
|
4389
|
+
var getContentHash = (content) => `sha256:${createHash3("sha256").update(content).digest("hex")}`;
|
|
4390
|
+
var getArtifactOutputPath = (artifact, outDir) => {
|
|
4391
|
+
const allowedDirectory = path10.resolve(artifact.shared ? outDir : path10.join(outDir, getSourceDirectory(artifact.source)));
|
|
4392
|
+
const portableTarget = artifact.target.replaceAll("\\", "/");
|
|
4393
|
+
const normalizedTarget = path10.posix.normalize(portableTarget);
|
|
4394
|
+
const hasUnsafePathSyntax = artifact.target.length === 0 || artifact.target.includes("\0") || artifact.target.includes("\\") || path10.posix.isAbsolute(portableTarget) || /^[a-zA-Z]:\//.test(portableTarget) || normalizedTarget === ".." || normalizedTarget.startsWith("../");
|
|
4395
|
+
const outputPath = path10.resolve(allowedDirectory, artifact.target);
|
|
4396
|
+
const relativeOutputPath = path10.relative(allowedDirectory, outputPath);
|
|
4397
|
+
const escapesAllowedDirectory = relativeOutputPath === "" || relativeOutputPath === ".." || relativeOutputPath.startsWith(`..${path10.sep}`) || path10.isAbsolute(relativeOutputPath);
|
|
4398
|
+
if (hasUnsafePathSyntax || escapesAllowedDirectory) {
|
|
4399
|
+
throw new Error(`Artifact path "${artifact.target}" escapes its allowed output directory`);
|
|
4400
|
+
}
|
|
4401
|
+
return outputPath;
|
|
4402
|
+
};
|
|
4403
|
+
var replaceDirectory = async (stagingDirectory, outDir) => {
|
|
4404
|
+
const backupDirectory = `${outDir}.backup-${randomUUID()}`;
|
|
4405
|
+
let hasBackup = false;
|
|
4406
|
+
try {
|
|
4407
|
+
await fs23.rename(outDir, backupDirectory);
|
|
4408
|
+
hasBackup = true;
|
|
4409
|
+
} catch (error) {
|
|
4410
|
+
if (error.code !== "ENOENT") throw error;
|
|
4411
|
+
}
|
|
4412
|
+
try {
|
|
4413
|
+
await fs23.rename(stagingDirectory, outDir);
|
|
4414
|
+
} catch (error) {
|
|
4415
|
+
if (hasBackup) await fs23.rename(backupDirectory, outDir);
|
|
4416
|
+
throw error;
|
|
4417
|
+
}
|
|
4418
|
+
if (hasBackup) await fs23.rm(backupDirectory, { recursive: true, force: true });
|
|
3862
4419
|
};
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
4420
|
+
async function hydrate(graph, options) {
|
|
4421
|
+
const result = {
|
|
4422
|
+
fetched: 0,
|
|
4423
|
+
written: 0,
|
|
4424
|
+
referenced: 0
|
|
4425
|
+
};
|
|
4426
|
+
const artifacts = [];
|
|
4427
|
+
for (const entity of graph.entities) {
|
|
4428
|
+
const { source, commit } = entity.resolvedFrom;
|
|
4429
|
+
if (source === options.localSource) continue;
|
|
4430
|
+
if (options.modes?.[source] === "reference") {
|
|
4431
|
+
result.referenced++;
|
|
4432
|
+
continue;
|
|
4433
|
+
}
|
|
4434
|
+
if (!entity.contentPath) continue;
|
|
4435
|
+
artifacts.push({
|
|
4436
|
+
source,
|
|
4437
|
+
commit,
|
|
4438
|
+
path: entity.contentPath,
|
|
4439
|
+
hash: entity.contentHash,
|
|
4440
|
+
target: entity.contentPath
|
|
4441
|
+
});
|
|
4442
|
+
const entityDirectory = path10.posix.dirname(entity.contentPath);
|
|
4443
|
+
for (const schema of entity.schemas ?? []) {
|
|
4444
|
+
if (!schema.path) continue;
|
|
4445
|
+
const artifactPath = path10.posix.join(entityDirectory, schema.path);
|
|
4446
|
+
artifacts.push({ source, commit, path: artifactPath, hash: schema.hash, target: artifactPath });
|
|
4447
|
+
}
|
|
4448
|
+
for (const specification of entity.specifications ?? []) {
|
|
4449
|
+
const artifactPath = path10.posix.join(entityDirectory, specification.path);
|
|
4450
|
+
artifacts.push({ source, commit, path: artifactPath, hash: specification.hash, target: artifactPath });
|
|
4451
|
+
}
|
|
4452
|
+
for (const sidecar of entity.sidecars ?? []) {
|
|
4453
|
+
artifacts.push({ source, commit, path: sidecar.path, hash: sidecar.hash, target: sidecar.path });
|
|
4454
|
+
}
|
|
4455
|
+
}
|
|
4456
|
+
for (const asset of graph.assets) {
|
|
4457
|
+
const { source, commit } = asset.resolvedFrom;
|
|
4458
|
+
if (source === options.localSource || options.modes?.[source] === "reference") continue;
|
|
4459
|
+
artifacts.push({
|
|
4460
|
+
source,
|
|
4461
|
+
commit,
|
|
4462
|
+
path: asset.path,
|
|
4463
|
+
hash: asset.hash,
|
|
4464
|
+
target: asset.path,
|
|
4465
|
+
shared: true
|
|
4466
|
+
});
|
|
4467
|
+
}
|
|
4468
|
+
for (const artifact of artifacts) getArtifactOutputPath(artifact, options.outDir);
|
|
4469
|
+
if (artifacts.length === 0) {
|
|
4470
|
+
await fs23.rm(options.outDir, { recursive: true, force: true });
|
|
4471
|
+
return result;
|
|
4472
|
+
}
|
|
4473
|
+
const resolvedOutDir = path10.resolve(options.outDir);
|
|
4474
|
+
const outDirParent = path10.dirname(resolvedOutDir);
|
|
4475
|
+
await fs23.mkdir(outDirParent, { recursive: true });
|
|
4476
|
+
const stagingDirectory = await fs23.mkdtemp(path10.join(outDirParent, `.${path10.basename(resolvedOutDir)}.staging-`));
|
|
4477
|
+
try {
|
|
4478
|
+
for (const artifact of artifacts) {
|
|
4479
|
+
let content = artifact.hash ? await options.cache?.get(artifact.hash) : void 0;
|
|
4480
|
+
if (content !== void 0 && artifact.hash && getContentHash(content) !== artifact.hash) {
|
|
4481
|
+
content = void 0;
|
|
4482
|
+
}
|
|
4483
|
+
if (content === void 0) {
|
|
4484
|
+
content = await options.fetch({
|
|
4485
|
+
source: artifact.source,
|
|
4486
|
+
commit: artifact.commit,
|
|
4487
|
+
path: artifact.path
|
|
4488
|
+
});
|
|
4489
|
+
result.fetched++;
|
|
4490
|
+
if (artifact.hash) {
|
|
4491
|
+
const actualHash = getContentHash(content);
|
|
4492
|
+
if (actualHash !== artifact.hash) {
|
|
4493
|
+
throw new Error(
|
|
4494
|
+
`Content hash mismatch for "${artifact.source}/${artifact.path}": expected "${artifact.hash}", received "${actualHash}"`
|
|
4495
|
+
);
|
|
4496
|
+
}
|
|
4497
|
+
await options.cache?.set(artifact.hash, content);
|
|
4498
|
+
}
|
|
4499
|
+
}
|
|
4500
|
+
const outputPath = getArtifactOutputPath(artifact, stagingDirectory);
|
|
4501
|
+
await fs23.mkdir(path10.dirname(outputPath), { recursive: true });
|
|
4502
|
+
await fs23.writeFile(outputPath, content);
|
|
4503
|
+
result.written++;
|
|
4504
|
+
}
|
|
4505
|
+
await replaceDirectory(stagingDirectory, resolvedOutDir);
|
|
4506
|
+
} catch (error) {
|
|
4507
|
+
await fs23.rm(stagingDirectory, { recursive: true, force: true });
|
|
4508
|
+
throw error;
|
|
4509
|
+
}
|
|
4510
|
+
return result;
|
|
4511
|
+
}
|
|
4512
|
+
|
|
4513
|
+
// src/parse-index.ts
|
|
4514
|
+
import { z } from "zod";
|
|
4515
|
+
var InvalidIndexError = class extends Error {
|
|
4516
|
+
constructor(issues) {
|
|
4517
|
+
super(
|
|
4518
|
+
[
|
|
4519
|
+
"Invalid federation index",
|
|
4520
|
+
...issues.map(({ path: path11, message }) => `${path11.length ? path11.join(".") : "<root>"}: ${message}`)
|
|
4521
|
+
].join("\n")
|
|
4522
|
+
);
|
|
4523
|
+
this.name = "InvalidIndexError";
|
|
4524
|
+
this.issues = issues;
|
|
4525
|
+
}
|
|
4526
|
+
};
|
|
4527
|
+
var nonEmptyString = z.string().min(1);
|
|
4528
|
+
var contentHash = z.string().regex(/^sha256:[a-f0-9]{64}$/, "Expected a full sha256 digest");
|
|
4529
|
+
var ResourcePointerSchema = z.object({
|
|
4530
|
+
id: nonEmptyString,
|
|
4531
|
+
version: nonEmptyString.optional(),
|
|
4532
|
+
type: nonEmptyString.optional()
|
|
4533
|
+
}).strict();
|
|
4534
|
+
var ChannelPointerSchema = ResourcePointerSchema.extend({
|
|
4535
|
+
label: z.string().optional(),
|
|
4536
|
+
direction: z.enum(["inbound", "outbound"]).optional(),
|
|
4537
|
+
parameters: z.record(z.string(), z.string()).optional()
|
|
4538
|
+
});
|
|
4539
|
+
var ChannelParametersSchema = z.record(
|
|
4540
|
+
z.string(),
|
|
4541
|
+
z.object({
|
|
4542
|
+
enum: z.array(z.string()).optional(),
|
|
4543
|
+
default: z.string().optional(),
|
|
4544
|
+
examples: z.array(z.string()).optional()
|
|
4545
|
+
}).strict()
|
|
4546
|
+
);
|
|
4547
|
+
var TriggerPointerSchema = z.object({
|
|
4548
|
+
id: nonEmptyString,
|
|
4549
|
+
version: nonEmptyString.optional(),
|
|
4550
|
+
condition: z.string().optional()
|
|
4551
|
+
}).strict();
|
|
4552
|
+
var SendsPointerSchema = z.object({
|
|
4553
|
+
id: nonEmptyString,
|
|
4554
|
+
version: nonEmptyString.optional(),
|
|
4555
|
+
fields: z.array(z.string()).optional(),
|
|
4556
|
+
to: z.array(ChannelPointerSchema).optional(),
|
|
4557
|
+
group: z.string().optional()
|
|
4558
|
+
}).strict();
|
|
4559
|
+
var ReceivesPointerSchema = z.object({
|
|
4560
|
+
id: nonEmptyString,
|
|
4561
|
+
version: nonEmptyString.optional(),
|
|
4562
|
+
fields: z.array(z.string()).optional(),
|
|
4563
|
+
from: z.array(ChannelPointerSchema).optional(),
|
|
4564
|
+
group: z.string().optional(),
|
|
4565
|
+
triggers: z.array(TriggerPointerSchema).optional()
|
|
4566
|
+
}).strict();
|
|
4567
|
+
var SystemRelationshipPointerSchema = z.object({
|
|
4568
|
+
id: nonEmptyString,
|
|
4569
|
+
version: nonEmptyString.optional(),
|
|
4570
|
+
label: z.string().optional()
|
|
4571
|
+
}).strict();
|
|
4572
|
+
var SystemActorRelationshipSchema = z.object({
|
|
4573
|
+
id: nonEmptyString,
|
|
4574
|
+
name: z.string().optional(),
|
|
4575
|
+
label: z.string().optional(),
|
|
4576
|
+
direction: z.enum(["inbound", "outbound"]).optional()
|
|
4577
|
+
}).strict();
|
|
4578
|
+
var IndexSchemaPointerSchema = z.object({
|
|
4579
|
+
id: z.string().optional(),
|
|
4580
|
+
ref: z.string().optional(),
|
|
4581
|
+
path: z.string().optional(),
|
|
4582
|
+
name: z.string().optional(),
|
|
4583
|
+
format: z.string().optional(),
|
|
4584
|
+
environments: z.array(z.string()).optional(),
|
|
4585
|
+
default: z.boolean().optional(),
|
|
4586
|
+
hash: contentHash.optional()
|
|
4587
|
+
}).strict();
|
|
4588
|
+
var IndexSpecificationSchema = z.object({
|
|
4589
|
+
type: z.enum(["openapi", "asyncapi", "graphql"]),
|
|
4590
|
+
path: nonEmptyString,
|
|
4591
|
+
name: z.string().optional(),
|
|
4592
|
+
hash: contentHash.optional()
|
|
4593
|
+
}).strict();
|
|
4594
|
+
var IndexSidecarSchema = z.object({
|
|
4595
|
+
path: nonEmptyString,
|
|
4596
|
+
hash: contentHash.optional()
|
|
4597
|
+
}).strict();
|
|
4598
|
+
var IndexAssetSchema = z.object({
|
|
4599
|
+
path: nonEmptyString,
|
|
4600
|
+
hash: contentHash.optional()
|
|
4601
|
+
}).strict();
|
|
4602
|
+
var IndexReferenceSchema = ResourcePointerSchema.extend({
|
|
4603
|
+
kind: z.enum(["agent", "container", "data-product", "flow", "message", "service"])
|
|
4604
|
+
});
|
|
4605
|
+
var AdrPointerSchema = z.object({
|
|
4606
|
+
id: nonEmptyString,
|
|
4607
|
+
version: nonEmptyString.optional()
|
|
4608
|
+
}).strict();
|
|
4609
|
+
var AdrResourcePointerSchema = AdrPointerSchema.extend({
|
|
4610
|
+
type: z.enum([
|
|
4611
|
+
"agent",
|
|
4612
|
+
"service",
|
|
4613
|
+
"event",
|
|
4614
|
+
"command",
|
|
4615
|
+
"query",
|
|
4616
|
+
"flow",
|
|
4617
|
+
"channel",
|
|
4618
|
+
"domain",
|
|
4619
|
+
"system",
|
|
4620
|
+
"user",
|
|
4621
|
+
"team",
|
|
4622
|
+
"container",
|
|
4623
|
+
"entity",
|
|
4624
|
+
"diagram",
|
|
4625
|
+
"data-product"
|
|
4626
|
+
])
|
|
4627
|
+
});
|
|
4628
|
+
var DataProductOutputPointerSchema = z.object({
|
|
4629
|
+
id: nonEmptyString,
|
|
4630
|
+
version: nonEmptyString.optional(),
|
|
4631
|
+
contract: z.object({
|
|
4632
|
+
path: nonEmptyString,
|
|
4633
|
+
name: nonEmptyString,
|
|
4634
|
+
type: z.string().optional()
|
|
4635
|
+
}).strict().optional()
|
|
4636
|
+
}).strict();
|
|
4637
|
+
var UserMemberSchema = z.object({
|
|
4638
|
+
id: nonEmptyString,
|
|
4639
|
+
name: nonEmptyString,
|
|
4640
|
+
avatarUrl: z.string().optional(),
|
|
4641
|
+
role: z.string().optional(),
|
|
4642
|
+
hidden: z.boolean().optional(),
|
|
4643
|
+
source: z.object({
|
|
4644
|
+
provider: nonEmptyString,
|
|
4645
|
+
id: z.string().optional(),
|
|
4646
|
+
url: z.string().optional()
|
|
4647
|
+
}).strict().optional(),
|
|
4648
|
+
readOnly: z.boolean().optional(),
|
|
4649
|
+
email: z.string().optional(),
|
|
4650
|
+
slackDirectMessageUrl: z.string().optional(),
|
|
4651
|
+
markdown: z.string()
|
|
4652
|
+
}).passthrough();
|
|
4653
|
+
var IndexResourceSchema = z.object({
|
|
4654
|
+
type: z.enum([
|
|
4655
|
+
"adr",
|
|
4656
|
+
"agent",
|
|
4657
|
+
"channel",
|
|
4658
|
+
"command",
|
|
4659
|
+
"container",
|
|
4660
|
+
"data-product",
|
|
4661
|
+
"diagram",
|
|
4662
|
+
"domain",
|
|
4663
|
+
"entity",
|
|
4664
|
+
"event",
|
|
4665
|
+
"flow",
|
|
4666
|
+
"query",
|
|
4667
|
+
"service",
|
|
4668
|
+
"system",
|
|
4669
|
+
"team",
|
|
4670
|
+
"user"
|
|
4671
|
+
]),
|
|
4672
|
+
id: nonEmptyString,
|
|
4673
|
+
version: nonEmptyString.optional(),
|
|
4674
|
+
name: nonEmptyString,
|
|
4675
|
+
contentPath: nonEmptyString,
|
|
4676
|
+
contentHash: contentHash.optional(),
|
|
4677
|
+
draft: z.union([z.boolean(), z.object({ title: z.string().optional(), message: z.string().optional() }).strict()]).optional(),
|
|
4678
|
+
deprecated: z.union([z.boolean(), z.object({ date: z.string().optional(), message: z.string().optional() }).strict()]).optional(),
|
|
4679
|
+
owners: z.array(z.string()).optional(),
|
|
4680
|
+
diagrams: z.array(ResourcePointerSchema).optional(),
|
|
4681
|
+
schemas: z.array(IndexSchemaPointerSchema).optional(),
|
|
4682
|
+
specifications: z.array(IndexSpecificationSchema).optional(),
|
|
4683
|
+
sidecars: z.array(IndexSidecarSchema).optional(),
|
|
4684
|
+
container_type: z.enum(["database", "cache", "objectStore", "searchIndex", "dataWarehouse", "dataLake", "externalSaaS", "other"]).optional(),
|
|
4685
|
+
references: z.array(IndexReferenceSchema).optional(),
|
|
4686
|
+
sends: z.array(SendsPointerSchema).optional(),
|
|
4687
|
+
receives: z.array(ReceivesPointerSchema).optional(),
|
|
4688
|
+
channels: z.array(ChannelPointerSchema).optional(),
|
|
4689
|
+
address: z.string().optional(),
|
|
4690
|
+
protocols: z.array(z.string()).optional(),
|
|
4691
|
+
deliveryGuarantee: z.enum(["at-most-once", "at-least-once", "exactly-once"]).optional(),
|
|
4692
|
+
routes: z.array(ChannelPointerSchema).optional(),
|
|
4693
|
+
parameters: ChannelParametersSchema.optional(),
|
|
4694
|
+
services: z.array(ResourcePointerSchema).optional(),
|
|
4695
|
+
agents: z.array(ResourcePointerSchema).optional(),
|
|
4696
|
+
domains: z.array(ResourcePointerSchema).optional(),
|
|
4697
|
+
systems: z.array(ResourcePointerSchema).optional(),
|
|
4698
|
+
entities: z.array(ResourcePointerSchema).optional(),
|
|
4699
|
+
dataProducts: z.array(ResourcePointerSchema).optional(),
|
|
4700
|
+
flows: z.array(ResourcePointerSchema).optional(),
|
|
4701
|
+
writesTo: z.array(ResourcePointerSchema).optional(),
|
|
4702
|
+
readsFrom: z.array(ResourcePointerSchema).optional(),
|
|
4703
|
+
containers: z.array(ResourcePointerSchema).optional(),
|
|
4704
|
+
relationships: z.array(SystemRelationshipPointerSchema).optional(),
|
|
4705
|
+
actors: z.array(SystemActorRelationshipSchema).optional(),
|
|
4706
|
+
inputs: z.array(ResourcePointerSchema).optional(),
|
|
4707
|
+
outputs: z.array(DataProductOutputPointerSchema).optional(),
|
|
4708
|
+
status: z.enum(["proposed", "accepted", "rejected", "deprecated", "superseded"]).optional(),
|
|
4709
|
+
appliesTo: z.array(AdrResourcePointerSchema).optional(),
|
|
4710
|
+
supersedes: z.array(AdrPointerSchema).optional(),
|
|
4711
|
+
supersededBy: z.array(AdrPointerSchema).optional(),
|
|
4712
|
+
amends: z.array(AdrPointerSchema).optional(),
|
|
4713
|
+
amendedBy: z.array(AdrPointerSchema).optional(),
|
|
4714
|
+
related: z.array(AdrPointerSchema).optional(),
|
|
4715
|
+
members: z.union([z.array(z.string()), z.array(UserMemberSchema)]).optional()
|
|
4716
|
+
}).strict();
|
|
4717
|
+
var FederationIndexSchema = z.object({
|
|
4718
|
+
indexVersion: z.literal(1),
|
|
4719
|
+
source: nonEmptyString,
|
|
4720
|
+
commit: nonEmptyString,
|
|
4721
|
+
resources: z.array(IndexResourceSchema),
|
|
4722
|
+
assets: z.array(IndexAssetSchema).optional()
|
|
4723
|
+
}).strict();
|
|
4724
|
+
var parseIndex = (input) => {
|
|
4725
|
+
const result = FederationIndexSchema.safeParse(input);
|
|
4726
|
+
if (!result.success) {
|
|
4727
|
+
throw new InvalidIndexError(
|
|
4728
|
+
result.error.issues.map((issue) => ({
|
|
4729
|
+
path: issue.path.map((segment) => typeof segment === "symbol" ? segment.toString() : segment),
|
|
4730
|
+
message: issue.message
|
|
4731
|
+
}))
|
|
4732
|
+
);
|
|
4733
|
+
}
|
|
4734
|
+
return result.data;
|
|
3867
4735
|
};
|
|
3868
|
-
var addFileToDiagram = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version, { type: "diagram" });
|
|
3869
4736
|
|
|
3870
4737
|
// src/index.ts
|
|
3871
|
-
var src_default = (
|
|
4738
|
+
var src_default = (path11) => {
|
|
3872
4739
|
return {
|
|
3873
4740
|
/**
|
|
3874
4741
|
* Returns an events from EventCatalog
|
|
@@ -3876,13 +4743,13 @@ var src_default = (path9) => {
|
|
|
3876
4743
|
* @param version - Optional id of the version to get (supports semver)
|
|
3877
4744
|
* @returns Event|Undefined
|
|
3878
4745
|
*/
|
|
3879
|
-
getEvent: getEvent(join22(
|
|
4746
|
+
getEvent: getEvent(join22(path11)),
|
|
3880
4747
|
/**
|
|
3881
4748
|
* Returns all events from EventCatalog
|
|
3882
4749
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
3883
4750
|
* @returns Event[]|Undefined
|
|
3884
4751
|
*/
|
|
3885
|
-
getEvents: getEvents(join22(
|
|
4752
|
+
getEvents: getEvents(join22(path11)),
|
|
3886
4753
|
/**
|
|
3887
4754
|
* Adds an event to EventCatalog
|
|
3888
4755
|
*
|
|
@@ -3890,7 +4757,7 @@ var src_default = (path9) => {
|
|
|
3890
4757
|
* @param options - Optional options to write the event
|
|
3891
4758
|
*
|
|
3892
4759
|
*/
|
|
3893
|
-
writeEvent: writeEvent(join22(
|
|
4760
|
+
writeEvent: writeEvent(join22(path11, "events")),
|
|
3894
4761
|
/**
|
|
3895
4762
|
* Adds an event to a service in EventCatalog
|
|
3896
4763
|
*
|
|
@@ -3899,7 +4766,7 @@ var src_default = (path9) => {
|
|
|
3899
4766
|
* @param options - Optional options to write the event
|
|
3900
4767
|
*
|
|
3901
4768
|
*/
|
|
3902
|
-
writeEventToService: writeEventToService(join22(
|
|
4769
|
+
writeEventToService: writeEventToService(join22(path11)),
|
|
3903
4770
|
/**
|
|
3904
4771
|
* Adds an event to an agent in EventCatalog
|
|
3905
4772
|
*
|
|
@@ -3908,26 +4775,26 @@ var src_default = (path9) => {
|
|
|
3908
4775
|
* @param options - Optional options to write the event
|
|
3909
4776
|
*
|
|
3910
4777
|
*/
|
|
3911
|
-
writeEventToAgent: writeEventToAgent(join22(
|
|
4778
|
+
writeEventToAgent: writeEventToAgent(join22(path11)),
|
|
3912
4779
|
/**
|
|
3913
4780
|
* Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
|
|
3914
4781
|
*
|
|
3915
4782
|
* @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
|
|
3916
4783
|
*
|
|
3917
4784
|
*/
|
|
3918
|
-
rmEvent: rmEvent(join22(
|
|
4785
|
+
rmEvent: rmEvent(join22(path11, "events")),
|
|
3919
4786
|
/**
|
|
3920
4787
|
* Remove an event by an Event id
|
|
3921
4788
|
*
|
|
3922
4789
|
* @param id - The id of the event you want to remove
|
|
3923
4790
|
*
|
|
3924
4791
|
*/
|
|
3925
|
-
rmEventById: rmEventById(join22(
|
|
4792
|
+
rmEventById: rmEventById(join22(path11)),
|
|
3926
4793
|
/**
|
|
3927
4794
|
* Moves a given event id to the version directory
|
|
3928
4795
|
* @param directory
|
|
3929
4796
|
*/
|
|
3930
|
-
versionEvent: versionEvent(join22(
|
|
4797
|
+
versionEvent: versionEvent(join22(path11)),
|
|
3931
4798
|
/**
|
|
3932
4799
|
* Adds a file to the given event
|
|
3933
4800
|
* @param id - The id of the event to add the file to
|
|
@@ -3935,7 +4802,7 @@ var src_default = (path9) => {
|
|
|
3935
4802
|
* @param version - Optional version of the event to add the file to
|
|
3936
4803
|
* @returns
|
|
3937
4804
|
*/
|
|
3938
|
-
addFileToEvent: addFileToEvent(join22(
|
|
4805
|
+
addFileToEvent: addFileToEvent(join22(path11)),
|
|
3939
4806
|
/**
|
|
3940
4807
|
* Adds a schema to the given event
|
|
3941
4808
|
* @param id - The id of the event to add the schema to
|
|
@@ -3943,17 +4810,17 @@ var src_default = (path9) => {
|
|
|
3943
4810
|
* @param version - Optional version of the event to add the schema to
|
|
3944
4811
|
* @returns
|
|
3945
4812
|
*/
|
|
3946
|
-
addSchemaToEvent: addSchemaToEvent(join22(
|
|
4813
|
+
addSchemaToEvent: addSchemaToEvent(join22(path11)),
|
|
3947
4814
|
/**
|
|
3948
4815
|
* Check to see if an event version exists
|
|
3949
4816
|
* @param id - The id of the event
|
|
3950
4817
|
* @param version - The version of the event (supports semver)
|
|
3951
4818
|
* @returns
|
|
3952
4819
|
*/
|
|
3953
|
-
eventHasVersion: eventHasVersion(join22(
|
|
3954
|
-
addExampleToEvent: addExampleToEvent(join22(
|
|
3955
|
-
getExamplesFromEvent: getExamplesFromEvent(join22(
|
|
3956
|
-
removeExampleFromEvent: removeExampleFromEvent(join22(
|
|
4820
|
+
eventHasVersion: eventHasVersion(join22(path11)),
|
|
4821
|
+
addExampleToEvent: addExampleToEvent(join22(path11)),
|
|
4822
|
+
getExamplesFromEvent: getExamplesFromEvent(join22(path11)),
|
|
4823
|
+
removeExampleFromEvent: removeExampleFromEvent(join22(path11)),
|
|
3957
4824
|
/**
|
|
3958
4825
|
* ================================
|
|
3959
4826
|
* Commands
|
|
@@ -3965,13 +4832,13 @@ var src_default = (path9) => {
|
|
|
3965
4832
|
* @param version - Optional id of the version to get (supports semver)
|
|
3966
4833
|
* @returns Command|Undefined
|
|
3967
4834
|
*/
|
|
3968
|
-
getCommand: getCommand(join22(
|
|
4835
|
+
getCommand: getCommand(join22(path11)),
|
|
3969
4836
|
/**
|
|
3970
4837
|
* Returns all commands from EventCatalog
|
|
3971
4838
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
3972
4839
|
* @returns Command[]|Undefined
|
|
3973
4840
|
*/
|
|
3974
|
-
getCommands: getCommands(join22(
|
|
4841
|
+
getCommands: getCommands(join22(path11)),
|
|
3975
4842
|
/**
|
|
3976
4843
|
* Adds an command to EventCatalog
|
|
3977
4844
|
*
|
|
@@ -3979,7 +4846,7 @@ var src_default = (path9) => {
|
|
|
3979
4846
|
* @param options - Optional options to write the command
|
|
3980
4847
|
*
|
|
3981
4848
|
*/
|
|
3982
|
-
writeCommand: writeCommand(join22(
|
|
4849
|
+
writeCommand: writeCommand(join22(path11, "commands")),
|
|
3983
4850
|
/**
|
|
3984
4851
|
* Adds a command to a service in EventCatalog
|
|
3985
4852
|
*
|
|
@@ -3988,7 +4855,7 @@ var src_default = (path9) => {
|
|
|
3988
4855
|
* @param options - Optional options to write the command
|
|
3989
4856
|
*
|
|
3990
4857
|
*/
|
|
3991
|
-
writeCommandToService: writeCommandToService(join22(
|
|
4858
|
+
writeCommandToService: writeCommandToService(join22(path11)),
|
|
3992
4859
|
/**
|
|
3993
4860
|
* Adds a command to an agent in EventCatalog
|
|
3994
4861
|
*
|
|
@@ -3997,26 +4864,26 @@ var src_default = (path9) => {
|
|
|
3997
4864
|
* @param options - Optional options to write the command
|
|
3998
4865
|
*
|
|
3999
4866
|
*/
|
|
4000
|
-
writeCommandToAgent: writeCommandToAgent(join22(
|
|
4867
|
+
writeCommandToAgent: writeCommandToAgent(join22(path11)),
|
|
4001
4868
|
/**
|
|
4002
4869
|
* Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
|
|
4003
4870
|
*
|
|
4004
4871
|
* @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
|
|
4005
4872
|
*
|
|
4006
4873
|
*/
|
|
4007
|
-
rmCommand: rmCommand(join22(
|
|
4874
|
+
rmCommand: rmCommand(join22(path11, "commands")),
|
|
4008
4875
|
/**
|
|
4009
4876
|
* Remove an command by an Event id
|
|
4010
4877
|
*
|
|
4011
4878
|
* @param id - The id of the command you want to remove
|
|
4012
4879
|
*
|
|
4013
4880
|
*/
|
|
4014
|
-
rmCommandById: rmCommandById(join22(
|
|
4881
|
+
rmCommandById: rmCommandById(join22(path11)),
|
|
4015
4882
|
/**
|
|
4016
4883
|
* Moves a given command id to the version directory
|
|
4017
4884
|
* @param directory
|
|
4018
4885
|
*/
|
|
4019
|
-
versionCommand: versionCommand(join22(
|
|
4886
|
+
versionCommand: versionCommand(join22(path11)),
|
|
4020
4887
|
/**
|
|
4021
4888
|
* Adds a file to the given command
|
|
4022
4889
|
* @param id - The id of the command to add the file to
|
|
@@ -4024,7 +4891,7 @@ var src_default = (path9) => {
|
|
|
4024
4891
|
* @param version - Optional version of the command to add the file to
|
|
4025
4892
|
* @returns
|
|
4026
4893
|
*/
|
|
4027
|
-
addFileToCommand: addFileToCommand(join22(
|
|
4894
|
+
addFileToCommand: addFileToCommand(join22(path11)),
|
|
4028
4895
|
/**
|
|
4029
4896
|
* Adds a schema to the given command
|
|
4030
4897
|
* @param id - The id of the command to add the schema to
|
|
@@ -4032,17 +4899,17 @@ var src_default = (path9) => {
|
|
|
4032
4899
|
* @param version - Optional version of the command to add the schema to
|
|
4033
4900
|
* @returns
|
|
4034
4901
|
*/
|
|
4035
|
-
addSchemaToCommand: addSchemaToCommand(join22(
|
|
4902
|
+
addSchemaToCommand: addSchemaToCommand(join22(path11)),
|
|
4036
4903
|
/**
|
|
4037
4904
|
* Check to see if a command version exists
|
|
4038
4905
|
* @param id - The id of the command
|
|
4039
4906
|
* @param version - The version of the command (supports semver)
|
|
4040
4907
|
* @returns
|
|
4041
4908
|
*/
|
|
4042
|
-
commandHasVersion: commandHasVersion(join22(
|
|
4043
|
-
addExampleToCommand: addExampleToCommand(join22(
|
|
4044
|
-
getExamplesFromCommand: getExamplesFromCommand(join22(
|
|
4045
|
-
removeExampleFromCommand: removeExampleFromCommand(join22(
|
|
4909
|
+
commandHasVersion: commandHasVersion(join22(path11)),
|
|
4910
|
+
addExampleToCommand: addExampleToCommand(join22(path11)),
|
|
4911
|
+
getExamplesFromCommand: getExamplesFromCommand(join22(path11)),
|
|
4912
|
+
removeExampleFromCommand: removeExampleFromCommand(join22(path11)),
|
|
4046
4913
|
/**
|
|
4047
4914
|
* ================================
|
|
4048
4915
|
* Queries
|
|
@@ -4054,13 +4921,13 @@ var src_default = (path9) => {
|
|
|
4054
4921
|
* @param version - Optional id of the version to get (supports semver)
|
|
4055
4922
|
* @returns Query|Undefined
|
|
4056
4923
|
*/
|
|
4057
|
-
getQuery: getQuery(join22(
|
|
4924
|
+
getQuery: getQuery(join22(path11)),
|
|
4058
4925
|
/**
|
|
4059
4926
|
* Returns all queries from EventCatalog
|
|
4060
4927
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
4061
4928
|
* @returns Query[]|Undefined
|
|
4062
4929
|
*/
|
|
4063
|
-
getQueries: getQueries(join22(
|
|
4930
|
+
getQueries: getQueries(join22(path11)),
|
|
4064
4931
|
/**
|
|
4065
4932
|
* Adds a query to EventCatalog
|
|
4066
4933
|
*
|
|
@@ -4068,7 +4935,7 @@ var src_default = (path9) => {
|
|
|
4068
4935
|
* @param options - Optional options to write the event
|
|
4069
4936
|
*
|
|
4070
4937
|
*/
|
|
4071
|
-
writeQuery: writeQuery(join22(
|
|
4938
|
+
writeQuery: writeQuery(join22(path11, "queries")),
|
|
4072
4939
|
/**
|
|
4073
4940
|
* Adds a query to a service in EventCatalog
|
|
4074
4941
|
*
|
|
@@ -4077,7 +4944,7 @@ var src_default = (path9) => {
|
|
|
4077
4944
|
* @param options - Optional options to write the query
|
|
4078
4945
|
*
|
|
4079
4946
|
*/
|
|
4080
|
-
writeQueryToService: writeQueryToService(join22(
|
|
4947
|
+
writeQueryToService: writeQueryToService(join22(path11)),
|
|
4081
4948
|
/**
|
|
4082
4949
|
* Adds a query to an agent in EventCatalog
|
|
4083
4950
|
*
|
|
@@ -4086,26 +4953,26 @@ var src_default = (path9) => {
|
|
|
4086
4953
|
* @param options - Optional options to write the query
|
|
4087
4954
|
*
|
|
4088
4955
|
*/
|
|
4089
|
-
writeQueryToAgent: writeQueryToAgent(join22(
|
|
4956
|
+
writeQueryToAgent: writeQueryToAgent(join22(path11)),
|
|
4090
4957
|
/**
|
|
4091
4958
|
* Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
|
|
4092
4959
|
*
|
|
4093
4960
|
* @param path - The path to your query, e.g. `/Orders/GetOrder`
|
|
4094
4961
|
*
|
|
4095
4962
|
*/
|
|
4096
|
-
rmQuery: rmQuery(join22(
|
|
4963
|
+
rmQuery: rmQuery(join22(path11, "queries")),
|
|
4097
4964
|
/**
|
|
4098
4965
|
* Remove a query by a Query id
|
|
4099
4966
|
*
|
|
4100
4967
|
* @param id - The id of the query you want to remove
|
|
4101
4968
|
*
|
|
4102
4969
|
*/
|
|
4103
|
-
rmQueryById: rmQueryById(join22(
|
|
4970
|
+
rmQueryById: rmQueryById(join22(path11)),
|
|
4104
4971
|
/**
|
|
4105
4972
|
* Moves a given query id to the version directory
|
|
4106
4973
|
* @param directory
|
|
4107
4974
|
*/
|
|
4108
|
-
versionQuery: versionQuery(join22(
|
|
4975
|
+
versionQuery: versionQuery(join22(path11)),
|
|
4109
4976
|
/**
|
|
4110
4977
|
* Adds a file to the given query
|
|
4111
4978
|
* @param id - The id of the query to add the file to
|
|
@@ -4113,7 +4980,7 @@ var src_default = (path9) => {
|
|
|
4113
4980
|
* @param version - Optional version of the query to add the file to
|
|
4114
4981
|
* @returns
|
|
4115
4982
|
*/
|
|
4116
|
-
addFileToQuery: addFileToQuery(join22(
|
|
4983
|
+
addFileToQuery: addFileToQuery(join22(path11)),
|
|
4117
4984
|
/**
|
|
4118
4985
|
* Adds a schema to the given query
|
|
4119
4986
|
* @param id - The id of the query to add the schema to
|
|
@@ -4121,17 +4988,17 @@ var src_default = (path9) => {
|
|
|
4121
4988
|
* @param version - Optional version of the query to add the schema to
|
|
4122
4989
|
* @returns
|
|
4123
4990
|
*/
|
|
4124
|
-
addSchemaToQuery: addSchemaToQuery(join22(
|
|
4991
|
+
addSchemaToQuery: addSchemaToQuery(join22(path11)),
|
|
4125
4992
|
/**
|
|
4126
4993
|
* Check to see if an query version exists
|
|
4127
4994
|
* @param id - The id of the query
|
|
4128
4995
|
* @param version - The version of the query (supports semver)
|
|
4129
4996
|
* @returns
|
|
4130
4997
|
*/
|
|
4131
|
-
queryHasVersion: queryHasVersion(join22(
|
|
4132
|
-
addExampleToQuery: addExampleToQuery(join22(
|
|
4133
|
-
getExamplesFromQuery: getExamplesFromQuery(join22(
|
|
4134
|
-
removeExampleFromQuery: removeExampleFromQuery(join22(
|
|
4998
|
+
queryHasVersion: queryHasVersion(join22(path11)),
|
|
4999
|
+
addExampleToQuery: addExampleToQuery(join22(path11)),
|
|
5000
|
+
getExamplesFromQuery: getExamplesFromQuery(join22(path11)),
|
|
5001
|
+
removeExampleFromQuery: removeExampleFromQuery(join22(path11)),
|
|
4135
5002
|
/**
|
|
4136
5003
|
* ================================
|
|
4137
5004
|
* Channels
|
|
@@ -4143,13 +5010,13 @@ var src_default = (path9) => {
|
|
|
4143
5010
|
* @param version - Optional id of the version to get (supports semver)
|
|
4144
5011
|
* @returns Channel|Undefined
|
|
4145
5012
|
*/
|
|
4146
|
-
getChannel: getChannel(join22(
|
|
5013
|
+
getChannel: getChannel(join22(path11)),
|
|
4147
5014
|
/**
|
|
4148
5015
|
* Returns all channels from EventCatalog
|
|
4149
5016
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
4150
5017
|
* @returns Channel[]|Undefined
|
|
4151
5018
|
*/
|
|
4152
|
-
getChannels: getChannels(join22(
|
|
5019
|
+
getChannels: getChannels(join22(path11)),
|
|
4153
5020
|
/**
|
|
4154
5021
|
* Adds an channel to EventCatalog
|
|
4155
5022
|
*
|
|
@@ -4157,33 +5024,33 @@ var src_default = (path9) => {
|
|
|
4157
5024
|
* @param options - Optional options to write the channel
|
|
4158
5025
|
*
|
|
4159
5026
|
*/
|
|
4160
|
-
writeChannel: writeChannel(join22(
|
|
5027
|
+
writeChannel: writeChannel(join22(path11, "channels")),
|
|
4161
5028
|
/**
|
|
4162
5029
|
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
4163
5030
|
*
|
|
4164
5031
|
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
4165
5032
|
*
|
|
4166
5033
|
*/
|
|
4167
|
-
rmChannel: rmChannel(join22(
|
|
5034
|
+
rmChannel: rmChannel(join22(path11, "channels")),
|
|
4168
5035
|
/**
|
|
4169
5036
|
* Remove an channel by an Event id
|
|
4170
5037
|
*
|
|
4171
5038
|
* @param id - The id of the channel you want to remove
|
|
4172
5039
|
*
|
|
4173
5040
|
*/
|
|
4174
|
-
rmChannelById: rmChannelById(join22(
|
|
5041
|
+
rmChannelById: rmChannelById(join22(path11)),
|
|
4175
5042
|
/**
|
|
4176
5043
|
* Moves a given channel id to the version directory
|
|
4177
5044
|
* @param directory
|
|
4178
5045
|
*/
|
|
4179
|
-
versionChannel: versionChannel(join22(
|
|
5046
|
+
versionChannel: versionChannel(join22(path11)),
|
|
4180
5047
|
/**
|
|
4181
5048
|
* Check to see if a channel version exists
|
|
4182
5049
|
* @param id - The id of the channel
|
|
4183
5050
|
* @param version - The version of the channel (supports semver)
|
|
4184
5051
|
* @returns
|
|
4185
5052
|
*/
|
|
4186
|
-
channelHasVersion: channelHasVersion(join22(
|
|
5053
|
+
channelHasVersion: channelHasVersion(join22(path11)),
|
|
4187
5054
|
/**
|
|
4188
5055
|
* Add a channel to an event
|
|
4189
5056
|
*
|
|
@@ -4200,7 +5067,7 @@ var src_default = (path9) => {
|
|
|
4200
5067
|
*
|
|
4201
5068
|
* ```
|
|
4202
5069
|
*/
|
|
4203
|
-
addEventToChannel: addMessageToChannel(join22(
|
|
5070
|
+
addEventToChannel: addMessageToChannel(join22(path11), "events"),
|
|
4204
5071
|
/**
|
|
4205
5072
|
* Add a channel to an command
|
|
4206
5073
|
*
|
|
@@ -4217,7 +5084,7 @@ var src_default = (path9) => {
|
|
|
4217
5084
|
*
|
|
4218
5085
|
* ```
|
|
4219
5086
|
*/
|
|
4220
|
-
addCommandToChannel: addMessageToChannel(join22(
|
|
5087
|
+
addCommandToChannel: addMessageToChannel(join22(path11), "commands"),
|
|
4221
5088
|
/**
|
|
4222
5089
|
* Add a channel to an query
|
|
4223
5090
|
*
|
|
@@ -4234,7 +5101,7 @@ var src_default = (path9) => {
|
|
|
4234
5101
|
*
|
|
4235
5102
|
* ```
|
|
4236
5103
|
*/
|
|
4237
|
-
addQueryToChannel: addMessageToChannel(join22(
|
|
5104
|
+
addQueryToChannel: addMessageToChannel(join22(path11), "queries"),
|
|
4238
5105
|
/**
|
|
4239
5106
|
* ================================
|
|
4240
5107
|
* SERVICES
|
|
@@ -4247,14 +5114,14 @@ var src_default = (path9) => {
|
|
|
4247
5114
|
* @param options - Optional options to write the event
|
|
4248
5115
|
*
|
|
4249
5116
|
*/
|
|
4250
|
-
writeService: writeService(join22(
|
|
5117
|
+
writeService: writeService(join22(path11, "services")),
|
|
4251
5118
|
/**
|
|
4252
5119
|
* Adds a versioned service to EventCatalog
|
|
4253
5120
|
*
|
|
4254
5121
|
* @param service - The service to write
|
|
4255
5122
|
*
|
|
4256
5123
|
*/
|
|
4257
|
-
writeVersionedService: writeVersionedService(join22(
|
|
5124
|
+
writeVersionedService: writeVersionedService(join22(path11, "services")),
|
|
4258
5125
|
/**
|
|
4259
5126
|
* Adds a service to a domain in EventCatalog
|
|
4260
5127
|
*
|
|
@@ -4263,7 +5130,7 @@ var src_default = (path9) => {
|
|
|
4263
5130
|
* @param options - Optional options to write the event
|
|
4264
5131
|
*
|
|
4265
5132
|
*/
|
|
4266
|
-
writeServiceToDomain: writeServiceToDomain(join22(
|
|
5133
|
+
writeServiceToDomain: writeServiceToDomain(join22(path11, "domains")),
|
|
4267
5134
|
/**
|
|
4268
5135
|
* Adds a service to a system in EventCatalog
|
|
4269
5136
|
*
|
|
@@ -4272,45 +5139,45 @@ var src_default = (path9) => {
|
|
|
4272
5139
|
* @param options - Optional options to write the service
|
|
4273
5140
|
*
|
|
4274
5141
|
*/
|
|
4275
|
-
writeServiceToSystem: writeServiceToSystem(join22(
|
|
5142
|
+
writeServiceToSystem: writeServiceToSystem(join22(path11)),
|
|
4276
5143
|
/**
|
|
4277
5144
|
* Returns a service from EventCatalog
|
|
4278
5145
|
* @param id - The id of the service to retrieve
|
|
4279
5146
|
* @param version - Optional id of the version to get (supports semver)
|
|
4280
5147
|
* @returns Service|Undefined
|
|
4281
5148
|
*/
|
|
4282
|
-
getService: getService(join22(
|
|
5149
|
+
getService: getService(join22(path11)),
|
|
4283
5150
|
/**
|
|
4284
5151
|
* Returns a service from EventCatalog by it's path.
|
|
4285
5152
|
* @param path - The path to the service to retrieve
|
|
4286
5153
|
* @returns Service|Undefined
|
|
4287
5154
|
*/
|
|
4288
|
-
getServiceByPath: getServiceByPath(join22(
|
|
5155
|
+
getServiceByPath: getServiceByPath(join22(path11)),
|
|
4289
5156
|
/**
|
|
4290
5157
|
* Returns all services from EventCatalog
|
|
4291
5158
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
4292
5159
|
* @returns Service[]|Undefined
|
|
4293
5160
|
*/
|
|
4294
|
-
getServices: getServices(join22(
|
|
5161
|
+
getServices: getServices(join22(path11)),
|
|
4295
5162
|
/**
|
|
4296
5163
|
* Moves a given service id to the version directory
|
|
4297
5164
|
* @param directory
|
|
4298
5165
|
*/
|
|
4299
|
-
versionService: versionService(join22(
|
|
5166
|
+
versionService: versionService(join22(path11)),
|
|
4300
5167
|
/**
|
|
4301
5168
|
* Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
|
|
4302
5169
|
*
|
|
4303
5170
|
* @param path - The path to your service, e.g. `/InventoryService`
|
|
4304
5171
|
*
|
|
4305
5172
|
*/
|
|
4306
|
-
rmService: rmService(join22(
|
|
5173
|
+
rmService: rmService(join22(path11, "services")),
|
|
4307
5174
|
/**
|
|
4308
5175
|
* Remove an service by an service id
|
|
4309
5176
|
*
|
|
4310
5177
|
* @param id - The id of the service you want to remove
|
|
4311
5178
|
*
|
|
4312
5179
|
*/
|
|
4313
|
-
rmServiceById: rmServiceById(join22(
|
|
5180
|
+
rmServiceById: rmServiceById(join22(path11)),
|
|
4314
5181
|
/**
|
|
4315
5182
|
* Adds a file to the given service
|
|
4316
5183
|
* @param id - The id of the service to add the file to
|
|
@@ -4318,21 +5185,21 @@ var src_default = (path9) => {
|
|
|
4318
5185
|
* @param version - Optional version of the service to add the file to
|
|
4319
5186
|
* @returns
|
|
4320
5187
|
*/
|
|
4321
|
-
addFileToService: addFileToService(join22(
|
|
5188
|
+
addFileToService: addFileToService(join22(path11)),
|
|
4322
5189
|
/**
|
|
4323
5190
|
* Returns the specifications for a given service
|
|
4324
5191
|
* @param id - The id of the service to retrieve the specifications for
|
|
4325
5192
|
* @param version - Optional version of the service
|
|
4326
5193
|
* @returns
|
|
4327
5194
|
*/
|
|
4328
|
-
getSpecificationFilesForService: getSpecificationFilesForService(join22(
|
|
5195
|
+
getSpecificationFilesForService: getSpecificationFilesForService(join22(path11)),
|
|
4329
5196
|
/**
|
|
4330
5197
|
* Check to see if a service version exists
|
|
4331
5198
|
* @param id - The id of the service
|
|
4332
5199
|
* @param version - The version of the service (supports semver)
|
|
4333
5200
|
* @returns
|
|
4334
5201
|
*/
|
|
4335
|
-
serviceHasVersion: serviceHasVersion(join22(
|
|
5202
|
+
serviceHasVersion: serviceHasVersion(join22(path11)),
|
|
4336
5203
|
/**
|
|
4337
5204
|
* Add an event to a service by it's id.
|
|
4338
5205
|
*
|
|
@@ -4352,7 +5219,7 @@ var src_default = (path9) => {
|
|
|
4352
5219
|
*
|
|
4353
5220
|
* ```
|
|
4354
5221
|
*/
|
|
4355
|
-
addEventToService: addMessageToService(join22(
|
|
5222
|
+
addEventToService: addMessageToService(join22(path11)),
|
|
4356
5223
|
/**
|
|
4357
5224
|
* Add a data store to a service by it's id.
|
|
4358
5225
|
*
|
|
@@ -4369,7 +5236,7 @@ var src_default = (path9) => {
|
|
|
4369
5236
|
*
|
|
4370
5237
|
* ```
|
|
4371
5238
|
*/
|
|
4372
|
-
addDataStoreToService: addDataStoreToService(join22(
|
|
5239
|
+
addDataStoreToService: addDataStoreToService(join22(path11)),
|
|
4373
5240
|
/**
|
|
4374
5241
|
* Add a command to a service by it's id.
|
|
4375
5242
|
*
|
|
@@ -4389,7 +5256,7 @@ var src_default = (path9) => {
|
|
|
4389
5256
|
*
|
|
4390
5257
|
* ```
|
|
4391
5258
|
*/
|
|
4392
|
-
addCommandToService: addMessageToService(join22(
|
|
5259
|
+
addCommandToService: addMessageToService(join22(path11)),
|
|
4393
5260
|
/**
|
|
4394
5261
|
* Add a query to a service by it's id.
|
|
4395
5262
|
*
|
|
@@ -4409,7 +5276,7 @@ var src_default = (path9) => {
|
|
|
4409
5276
|
*
|
|
4410
5277
|
* ```
|
|
4411
5278
|
*/
|
|
4412
|
-
addQueryToService: addMessageToService(join22(
|
|
5279
|
+
addQueryToService: addMessageToService(join22(path11)),
|
|
4413
5280
|
/**
|
|
4414
5281
|
* Add an entity to a service by its id.
|
|
4415
5282
|
*
|
|
@@ -4427,7 +5294,7 @@ var src_default = (path9) => {
|
|
|
4427
5294
|
*
|
|
4428
5295
|
* ```
|
|
4429
5296
|
*/
|
|
4430
|
-
addEntityToService: addEntityToService(join22(
|
|
5297
|
+
addEntityToService: addEntityToService(join22(path11)),
|
|
4431
5298
|
/**
|
|
4432
5299
|
* Check to see if a service exists by it's path.
|
|
4433
5300
|
*
|
|
@@ -4444,57 +5311,57 @@ var src_default = (path9) => {
|
|
|
4444
5311
|
* @param path - The path to the service to check
|
|
4445
5312
|
* @returns boolean
|
|
4446
5313
|
*/
|
|
4447
|
-
isService: isService(join22(
|
|
5314
|
+
isService: isService(join22(path11)),
|
|
4448
5315
|
/**
|
|
4449
5316
|
* Converts a file to a service.
|
|
4450
5317
|
* @param file - The file to convert to a service.
|
|
4451
5318
|
* @returns The service.
|
|
4452
5319
|
*/
|
|
4453
|
-
toService: toService(join22(
|
|
5320
|
+
toService: toService(join22(path11)),
|
|
4454
5321
|
/**
|
|
4455
5322
|
* ================================
|
|
4456
5323
|
* Systems
|
|
4457
5324
|
* ================================
|
|
4458
5325
|
*/
|
|
4459
|
-
writeSystem: writeSystem(join22(
|
|
4460
|
-
writeSystemToDomain: writeSystemToDomain(join22(
|
|
4461
|
-
getSystem: getSystem(join22(
|
|
4462
|
-
getSystemByPath: getSystemByPath(join22(
|
|
4463
|
-
getSystems: getSystems(join22(
|
|
4464
|
-
versionSystem: versionSystem(join22(
|
|
4465
|
-
rmSystem: rmSystem(join22(
|
|
4466
|
-
rmSystemById: rmSystemById(join22(
|
|
4467
|
-
addFileToSystem: addFileToSystem(join22(
|
|
4468
|
-
addServiceToSystem: addServiceToSystem(join22(
|
|
4469
|
-
addFlowToSystem: addFlowToSystem(join22(
|
|
4470
|
-
addEntityToSystem: addEntityToSystem(join22(
|
|
4471
|
-
addContainerToSystem: addContainerToSystem(join22(
|
|
4472
|
-
systemHasVersion: systemHasVersion(join22(
|
|
4473
|
-
isSystem: isSystem(join22(
|
|
4474
|
-
toSystem: toSystem(join22(
|
|
5326
|
+
writeSystem: writeSystem(join22(path11, "systems")),
|
|
5327
|
+
writeSystemToDomain: writeSystemToDomain(join22(path11)),
|
|
5328
|
+
getSystem: getSystem(join22(path11)),
|
|
5329
|
+
getSystemByPath: getSystemByPath(join22(path11)),
|
|
5330
|
+
getSystems: getSystems(join22(path11)),
|
|
5331
|
+
versionSystem: versionSystem(join22(path11)),
|
|
5332
|
+
rmSystem: rmSystem(join22(path11, "systems")),
|
|
5333
|
+
rmSystemById: rmSystemById(join22(path11)),
|
|
5334
|
+
addFileToSystem: addFileToSystem(join22(path11)),
|
|
5335
|
+
addServiceToSystem: addServiceToSystem(join22(path11)),
|
|
5336
|
+
addFlowToSystem: addFlowToSystem(join22(path11)),
|
|
5337
|
+
addEntityToSystem: addEntityToSystem(join22(path11)),
|
|
5338
|
+
addContainerToSystem: addContainerToSystem(join22(path11)),
|
|
5339
|
+
systemHasVersion: systemHasVersion(join22(path11)),
|
|
5340
|
+
isSystem: isSystem(join22(path11)),
|
|
5341
|
+
toSystem: toSystem(join22(path11)),
|
|
4475
5342
|
/**
|
|
4476
5343
|
* ================================
|
|
4477
5344
|
* Agents
|
|
4478
5345
|
* ================================
|
|
4479
5346
|
*/
|
|
4480
|
-
writeAgent: writeAgent(join22(
|
|
4481
|
-
writeVersionedAgent: writeVersionedAgent(join22(
|
|
4482
|
-
writeAgentToDomain: writeAgentToDomain(join22(
|
|
4483
|
-
getAgent: getAgent(join22(
|
|
4484
|
-
getAgentByPath: getAgentByPath(join22(
|
|
4485
|
-
getAgents: getAgents(join22(
|
|
4486
|
-
versionAgent: versionAgent(join22(
|
|
4487
|
-
rmAgent: rmAgent(join22(
|
|
4488
|
-
rmAgentById: rmAgentById(join22(
|
|
4489
|
-
addFileToAgent: addFileToAgent(join22(
|
|
4490
|
-
addEventToAgent: addMessageToAgent(join22(
|
|
4491
|
-
addCommandToAgent: addMessageToAgent(join22(
|
|
4492
|
-
addQueryToAgent: addMessageToAgent(join22(
|
|
4493
|
-
addDataStoreToAgent: addDataStoreToAgent(join22(
|
|
4494
|
-
addFlowToAgent: addFlowToAgent(join22(
|
|
4495
|
-
agentHasVersion: agentHasVersion(join22(
|
|
4496
|
-
isAgent: isAgent(join22(
|
|
4497
|
-
toAgent: toAgent(join22(
|
|
5347
|
+
writeAgent: writeAgent(join22(path11, "agents")),
|
|
5348
|
+
writeVersionedAgent: writeVersionedAgent(join22(path11, "agents")),
|
|
5349
|
+
writeAgentToDomain: writeAgentToDomain(join22(path11, "domains")),
|
|
5350
|
+
getAgent: getAgent(join22(path11)),
|
|
5351
|
+
getAgentByPath: getAgentByPath(join22(path11)),
|
|
5352
|
+
getAgents: getAgents(join22(path11)),
|
|
5353
|
+
versionAgent: versionAgent(join22(path11)),
|
|
5354
|
+
rmAgent: rmAgent(join22(path11, "agents")),
|
|
5355
|
+
rmAgentById: rmAgentById(join22(path11)),
|
|
5356
|
+
addFileToAgent: addFileToAgent(join22(path11)),
|
|
5357
|
+
addEventToAgent: addMessageToAgent(join22(path11)),
|
|
5358
|
+
addCommandToAgent: addMessageToAgent(join22(path11)),
|
|
5359
|
+
addQueryToAgent: addMessageToAgent(join22(path11)),
|
|
5360
|
+
addDataStoreToAgent: addDataStoreToAgent(join22(path11)),
|
|
5361
|
+
addFlowToAgent: addFlowToAgent(join22(path11)),
|
|
5362
|
+
agentHasVersion: agentHasVersion(join22(path11)),
|
|
5363
|
+
isAgent: isAgent(join22(path11)),
|
|
5364
|
+
toAgent: toAgent(join22(path11)),
|
|
4498
5365
|
/**
|
|
4499
5366
|
* ================================
|
|
4500
5367
|
* Domains
|
|
@@ -4507,39 +5374,39 @@ var src_default = (path9) => {
|
|
|
4507
5374
|
* @param options - Optional options to write the event
|
|
4508
5375
|
*
|
|
4509
5376
|
*/
|
|
4510
|
-
writeDomain: writeDomain(join22(
|
|
5377
|
+
writeDomain: writeDomain(join22(path11, "domains")),
|
|
4511
5378
|
/**
|
|
4512
5379
|
* Returns a domain from EventCatalog
|
|
4513
5380
|
* @param id - The id of the domain to retrieve
|
|
4514
5381
|
* @param version - Optional id of the version to get (supports semver)
|
|
4515
5382
|
* @returns Domain|Undefined
|
|
4516
5383
|
*/
|
|
4517
|
-
getDomain: getDomain(join22(
|
|
5384
|
+
getDomain: getDomain(join22(path11, "domains")),
|
|
4518
5385
|
/**
|
|
4519
5386
|
* Returns all domains from EventCatalog
|
|
4520
5387
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
4521
5388
|
* @returns Domain[]|Undefined
|
|
4522
5389
|
*/
|
|
4523
|
-
getDomains: getDomains(join22(
|
|
5390
|
+
getDomains: getDomains(join22(path11)),
|
|
4524
5391
|
/**
|
|
4525
5392
|
* Moves a given domain id to the version directory
|
|
4526
5393
|
* @param directory
|
|
4527
5394
|
*/
|
|
4528
|
-
versionDomain: versionDomain(join22(
|
|
5395
|
+
versionDomain: versionDomain(join22(path11, "domains")),
|
|
4529
5396
|
/**
|
|
4530
5397
|
* Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
|
|
4531
5398
|
*
|
|
4532
5399
|
* @param path - The path to your domain, e.g. `/Payment`
|
|
4533
5400
|
*
|
|
4534
5401
|
*/
|
|
4535
|
-
rmDomain: rmDomain(join22(
|
|
5402
|
+
rmDomain: rmDomain(join22(path11, "domains")),
|
|
4536
5403
|
/**
|
|
4537
5404
|
* Remove an service by an domain id
|
|
4538
5405
|
*
|
|
4539
5406
|
* @param id - The id of the domain you want to remove
|
|
4540
5407
|
*
|
|
4541
5408
|
*/
|
|
4542
|
-
rmDomainById: rmDomainById(join22(
|
|
5409
|
+
rmDomainById: rmDomainById(join22(path11, "domains")),
|
|
4543
5410
|
/**
|
|
4544
5411
|
* Adds a file to the given domain
|
|
4545
5412
|
* @param id - The id of the domain to add the file to
|
|
@@ -4547,28 +5414,28 @@ var src_default = (path9) => {
|
|
|
4547
5414
|
* @param version - Optional version of the domain to add the file to
|
|
4548
5415
|
* @returns
|
|
4549
5416
|
*/
|
|
4550
|
-
addFileToDomain: addFileToDomain(join22(
|
|
5417
|
+
addFileToDomain: addFileToDomain(join22(path11, "domains")),
|
|
4551
5418
|
/**
|
|
4552
5419
|
* Adds an ubiquitous language dictionary to a domain
|
|
4553
5420
|
* @param id - The id of the domain to add the ubiquitous language to
|
|
4554
5421
|
* @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
|
|
4555
5422
|
* @param version - Optional version of the domain to add the ubiquitous language to
|
|
4556
5423
|
*/
|
|
4557
|
-
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(join22(
|
|
5424
|
+
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(join22(path11, "domains")),
|
|
4558
5425
|
/**
|
|
4559
5426
|
* Get the ubiquitous language dictionary from a domain
|
|
4560
5427
|
* @param id - The id of the domain to get the ubiquitous language from
|
|
4561
5428
|
* @param version - Optional version of the domain to get the ubiquitous language from
|
|
4562
5429
|
* @returns
|
|
4563
5430
|
*/
|
|
4564
|
-
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(join22(
|
|
5431
|
+
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(join22(path11, "domains")),
|
|
4565
5432
|
/**
|
|
4566
5433
|
* Check to see if a domain version exists
|
|
4567
5434
|
* @param id - The id of the domain
|
|
4568
5435
|
* @param version - The version of the domain (supports semver)
|
|
4569
5436
|
* @returns
|
|
4570
5437
|
*/
|
|
4571
|
-
domainHasVersion: domainHasVersion(join22(
|
|
5438
|
+
domainHasVersion: domainHasVersion(join22(path11)),
|
|
4572
5439
|
/**
|
|
4573
5440
|
* Adds a given service to a domain
|
|
4574
5441
|
* @param id - The id of the domain
|
|
@@ -4576,7 +5443,7 @@ var src_default = (path9) => {
|
|
|
4576
5443
|
* @param version - (Optional) The version of the domain to add the service to
|
|
4577
5444
|
* @returns
|
|
4578
5445
|
*/
|
|
4579
|
-
addServiceToDomain: addServiceToDomain(join22(
|
|
5446
|
+
addServiceToDomain: addServiceToDomain(join22(path11, "domains")),
|
|
4580
5447
|
/**
|
|
4581
5448
|
* Adds a given agent to a domain
|
|
4582
5449
|
* @param id - The id of the domain
|
|
@@ -4584,7 +5451,7 @@ var src_default = (path9) => {
|
|
|
4584
5451
|
* @param version - (Optional) The version of the domain to add the agent to
|
|
4585
5452
|
* @returns
|
|
4586
5453
|
*/
|
|
4587
|
-
addAgentToDomain: addAgentToDomain(join22(
|
|
5454
|
+
addAgentToDomain: addAgentToDomain(join22(path11, "domains")),
|
|
4588
5455
|
/**
|
|
4589
5456
|
* Adds a given subdomain to a domain
|
|
4590
5457
|
* @param id - The id of the domain
|
|
@@ -4592,7 +5459,7 @@ var src_default = (path9) => {
|
|
|
4592
5459
|
* @param version - (Optional) The version of the domain to add the subdomain to
|
|
4593
5460
|
* @returns
|
|
4594
5461
|
*/
|
|
4595
|
-
addSubDomainToDomain: addSubDomainToDomain(join22(
|
|
5462
|
+
addSubDomainToDomain: addSubDomainToDomain(join22(path11, "domains")),
|
|
4596
5463
|
/**
|
|
4597
5464
|
* Adds a given system to a domain
|
|
4598
5465
|
* @param id - The id of the domain
|
|
@@ -4600,7 +5467,7 @@ var src_default = (path9) => {
|
|
|
4600
5467
|
* @param version - (Optional) The version of the domain to add the system to
|
|
4601
5468
|
* @returns
|
|
4602
5469
|
*/
|
|
4603
|
-
addSystemToDomain: addSystemToDomain(join22(
|
|
5470
|
+
addSystemToDomain: addSystemToDomain(join22(path11, "domains")),
|
|
4604
5471
|
/**
|
|
4605
5472
|
* Adds an entity to a domain
|
|
4606
5473
|
* @param id - The id of the domain
|
|
@@ -4608,7 +5475,7 @@ var src_default = (path9) => {
|
|
|
4608
5475
|
* @param version - (Optional) The version of the domain to add the entity to
|
|
4609
5476
|
* @returns
|
|
4610
5477
|
*/
|
|
4611
|
-
addEntityToDomain: addEntityToDomain(join22(
|
|
5478
|
+
addEntityToDomain: addEntityToDomain(join22(path11, "domains")),
|
|
4612
5479
|
/**
|
|
4613
5480
|
* Add an event to a domain by its id.
|
|
4614
5481
|
*
|
|
@@ -4626,7 +5493,7 @@ var src_default = (path9) => {
|
|
|
4626
5493
|
*
|
|
4627
5494
|
* ```
|
|
4628
5495
|
*/
|
|
4629
|
-
addEventToDomain: addMessageToDomain(join22(
|
|
5496
|
+
addEventToDomain: addMessageToDomain(join22(path11, "domains")),
|
|
4630
5497
|
/**
|
|
4631
5498
|
* Add a command to a domain by its id.
|
|
4632
5499
|
*
|
|
@@ -4644,7 +5511,7 @@ var src_default = (path9) => {
|
|
|
4644
5511
|
*
|
|
4645
5512
|
* ```
|
|
4646
5513
|
*/
|
|
4647
|
-
addCommandToDomain: addMessageToDomain(join22(
|
|
5514
|
+
addCommandToDomain: addMessageToDomain(join22(path11, "domains")),
|
|
4648
5515
|
/**
|
|
4649
5516
|
* Add a query to a domain by its id.
|
|
4650
5517
|
*
|
|
@@ -4662,7 +5529,7 @@ var src_default = (path9) => {
|
|
|
4662
5529
|
*
|
|
4663
5530
|
* ```
|
|
4664
5531
|
*/
|
|
4665
|
-
addQueryToDomain: addMessageToDomain(join22(
|
|
5532
|
+
addQueryToDomain: addMessageToDomain(join22(path11, "domains")),
|
|
4666
5533
|
/**
|
|
4667
5534
|
* ================================
|
|
4668
5535
|
* Teams
|
|
@@ -4675,25 +5542,25 @@ var src_default = (path9) => {
|
|
|
4675
5542
|
* @param options - Optional options to write the team
|
|
4676
5543
|
*
|
|
4677
5544
|
*/
|
|
4678
|
-
writeTeam: writeTeam(join22(
|
|
5545
|
+
writeTeam: writeTeam(join22(path11, "teams")),
|
|
4679
5546
|
/**
|
|
4680
5547
|
* Returns a team from EventCatalog
|
|
4681
5548
|
* @param id - The id of the team to retrieve
|
|
4682
5549
|
* @returns Team|Undefined
|
|
4683
5550
|
*/
|
|
4684
|
-
getTeam: getTeam(join22(
|
|
5551
|
+
getTeam: getTeam(join22(path11, "teams")),
|
|
4685
5552
|
/**
|
|
4686
5553
|
* Returns all teams from EventCatalog
|
|
4687
5554
|
* @returns Team[]|Undefined
|
|
4688
5555
|
*/
|
|
4689
|
-
getTeams: getTeams(join22(
|
|
5556
|
+
getTeams: getTeams(join22(path11, "teams")),
|
|
4690
5557
|
/**
|
|
4691
5558
|
* Remove a team by the team id
|
|
4692
5559
|
*
|
|
4693
5560
|
* @param id - The id of the team you want to remove
|
|
4694
5561
|
*
|
|
4695
5562
|
*/
|
|
4696
|
-
rmTeamById: rmTeamById(join22(
|
|
5563
|
+
rmTeamById: rmTeamById(join22(path11, "teams")),
|
|
4697
5564
|
/**
|
|
4698
5565
|
* ================================
|
|
4699
5566
|
* Users
|
|
@@ -4706,25 +5573,25 @@ var src_default = (path9) => {
|
|
|
4706
5573
|
* @param options - Optional options to write the user
|
|
4707
5574
|
*
|
|
4708
5575
|
*/
|
|
4709
|
-
writeUser: writeUser(join22(
|
|
5576
|
+
writeUser: writeUser(join22(path11, "users")),
|
|
4710
5577
|
/**
|
|
4711
5578
|
* Returns a user from EventCatalog
|
|
4712
5579
|
* @param id - The id of the user to retrieve
|
|
4713
5580
|
* @returns User|Undefined
|
|
4714
5581
|
*/
|
|
4715
|
-
getUser: getUser(join22(
|
|
5582
|
+
getUser: getUser(join22(path11, "users")),
|
|
4716
5583
|
/**
|
|
4717
5584
|
* Returns all user from EventCatalog
|
|
4718
5585
|
* @returns User[]|Undefined
|
|
4719
5586
|
*/
|
|
4720
|
-
getUsers: getUsers(join22(
|
|
5587
|
+
getUsers: getUsers(join22(path11)),
|
|
4721
5588
|
/**
|
|
4722
5589
|
* Remove a user by the user id
|
|
4723
5590
|
*
|
|
4724
5591
|
* @param id - The id of the user you want to remove
|
|
4725
5592
|
*
|
|
4726
5593
|
*/
|
|
4727
|
-
rmUserById: rmUserById(join22(
|
|
5594
|
+
rmUserById: rmUserById(join22(path11, "users")),
|
|
4728
5595
|
/**
|
|
4729
5596
|
* ================================
|
|
4730
5597
|
* Custom Docs
|
|
@@ -4735,39 +5602,39 @@ var src_default = (path9) => {
|
|
|
4735
5602
|
* @param path - The path to the custom doc to retrieve
|
|
4736
5603
|
* @returns CustomDoc|Undefined
|
|
4737
5604
|
*/
|
|
4738
|
-
getCustomDoc: getCustomDoc(join22(
|
|
5605
|
+
getCustomDoc: getCustomDoc(join22(path11, "docs")),
|
|
4739
5606
|
/**
|
|
4740
5607
|
* Returns all custom docs from EventCatalog
|
|
4741
5608
|
* @param options - Optional options to get custom docs from a specific path
|
|
4742
5609
|
* @returns CustomDoc[]|Undefined
|
|
4743
5610
|
*/
|
|
4744
|
-
getCustomDocs: getCustomDocs(join22(
|
|
5611
|
+
getCustomDocs: getCustomDocs(join22(path11, "docs")),
|
|
4745
5612
|
/**
|
|
4746
5613
|
* Writes a custom doc to EventCatalog
|
|
4747
5614
|
* @param customDoc - The custom doc to write
|
|
4748
5615
|
* @param options - Optional options to write the custom doc
|
|
4749
5616
|
*
|
|
4750
5617
|
*/
|
|
4751
|
-
writeCustomDoc: writeCustomDoc(join22(
|
|
5618
|
+
writeCustomDoc: writeCustomDoc(join22(path11, "docs")),
|
|
4752
5619
|
/**
|
|
4753
5620
|
* Removes a custom doc from EventCatalog
|
|
4754
5621
|
* @param path - The path to the custom doc to remove
|
|
4755
5622
|
*
|
|
4756
5623
|
*/
|
|
4757
|
-
rmCustomDoc: rmCustomDoc(join22(
|
|
5624
|
+
rmCustomDoc: rmCustomDoc(join22(path11, "docs")),
|
|
4758
5625
|
/**
|
|
4759
5626
|
* Dumps the catalog to a JSON file.
|
|
4760
5627
|
* @param directory - The directory to dump the catalog to
|
|
4761
5628
|
* @returns A JSON file with the catalog
|
|
4762
5629
|
*/
|
|
4763
|
-
dumpCatalog: dumpCatalog(join22(
|
|
5630
|
+
dumpCatalog: dumpCatalog(join22(path11)),
|
|
4764
5631
|
/**
|
|
4765
5632
|
* Returns the resources reachable from a catalog resource.
|
|
4766
5633
|
* @param root - Resource to use as the root of the graph
|
|
4767
5634
|
* @param options - Traversal depth and whether to return a flat resource list
|
|
4768
5635
|
* @returns The resolved graph, or undefined when the root does not exist
|
|
4769
5636
|
*/
|
|
4770
|
-
getGraph: getGraph(join22(
|
|
5637
|
+
getGraph: getGraph(join22(path11)),
|
|
4771
5638
|
/**
|
|
4772
5639
|
* Returns the event catalog configuration file.
|
|
4773
5640
|
* The event catalog configuration file is the file that contains the configuration for the event catalog.
|
|
@@ -4775,7 +5642,7 @@ var src_default = (path9) => {
|
|
|
4775
5642
|
* @param directory - The directory of the catalog.
|
|
4776
5643
|
* @returns A JSON object with the configuration for the event catalog.
|
|
4777
5644
|
*/
|
|
4778
|
-
getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(join22(
|
|
5645
|
+
getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(join22(path11)),
|
|
4779
5646
|
/**
|
|
4780
5647
|
* ================================
|
|
4781
5648
|
* Changelogs
|
|
@@ -4789,7 +5656,7 @@ var src_default = (path9) => {
|
|
|
4789
5656
|
* @param options - Optional options (version, format)
|
|
4790
5657
|
*
|
|
4791
5658
|
*/
|
|
4792
|
-
writeChangelog: writeChangelog(join22(
|
|
5659
|
+
writeChangelog: writeChangelog(join22(path11)),
|
|
4793
5660
|
/**
|
|
4794
5661
|
* Appends a changelog entry to an existing changelog for a resource.
|
|
4795
5662
|
* If no changelog exists, one is created.
|
|
@@ -4799,7 +5666,7 @@ var src_default = (path9) => {
|
|
|
4799
5666
|
* @param options - Optional options (version, format)
|
|
4800
5667
|
*
|
|
4801
5668
|
*/
|
|
4802
|
-
appendChangelog: appendChangelog(join22(
|
|
5669
|
+
appendChangelog: appendChangelog(join22(path11)),
|
|
4803
5670
|
/**
|
|
4804
5671
|
* Returns the changelog for a resource in EventCatalog
|
|
4805
5672
|
*
|
|
@@ -4807,7 +5674,7 @@ var src_default = (path9) => {
|
|
|
4807
5674
|
* @param options - Optional options (version)
|
|
4808
5675
|
* @returns Changelog|Undefined
|
|
4809
5676
|
*/
|
|
4810
|
-
getChangelog: getChangelog(join22(
|
|
5677
|
+
getChangelog: getChangelog(join22(path11)),
|
|
4811
5678
|
/**
|
|
4812
5679
|
* Removes the changelog for a resource in EventCatalog
|
|
4813
5680
|
*
|
|
@@ -4815,7 +5682,7 @@ var src_default = (path9) => {
|
|
|
4815
5682
|
* @param options - Optional options (version)
|
|
4816
5683
|
*
|
|
4817
5684
|
*/
|
|
4818
|
-
rmChangelog: rmChangelog(join22(
|
|
5685
|
+
rmChangelog: rmChangelog(join22(path11)),
|
|
4819
5686
|
/**
|
|
4820
5687
|
* ================================
|
|
4821
5688
|
* Resources Utils
|
|
@@ -4844,26 +5711,26 @@ var src_default = (path9) => {
|
|
|
4844
5711
|
* @param path - The path to the message to retrieve
|
|
4845
5712
|
* @returns Message|Undefined
|
|
4846
5713
|
*/
|
|
4847
|
-
getMessageBySchemaPath: getMessageBySchemaPath(join22(
|
|
5714
|
+
getMessageBySchemaPath: getMessageBySchemaPath(join22(path11)),
|
|
4848
5715
|
/**
|
|
4849
5716
|
* Returns the producers and consumers (services and agents) for a given message
|
|
4850
5717
|
* @param id - The id of the message to get the producers and consumers for
|
|
4851
5718
|
* @param version - Optional version of the message
|
|
4852
5719
|
* @returns { producers: (Service|Agent)[], consumers: (Service|Agent)[] }
|
|
4853
5720
|
*/
|
|
4854
|
-
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join22(
|
|
5721
|
+
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join22(path11)),
|
|
4855
5722
|
/**
|
|
4856
5723
|
* Returns the consumers of a given schema path
|
|
4857
5724
|
* @param path - The path to the schema to get the consumers for
|
|
4858
5725
|
* @returns (Service|Agent)[]
|
|
4859
5726
|
*/
|
|
4860
|
-
getConsumersOfSchema: getConsumersOfSchema(join22(
|
|
5727
|
+
getConsumersOfSchema: getConsumersOfSchema(join22(path11)),
|
|
4861
5728
|
/**
|
|
4862
5729
|
* Returns the producers of a given schema path
|
|
4863
5730
|
* @param path - The path to the schema to get the producers for
|
|
4864
5731
|
* @returns (Service|Agent)[]
|
|
4865
5732
|
*/
|
|
4866
|
-
getProducersOfSchema: getProducersOfSchema(join22(
|
|
5733
|
+
getProducersOfSchema: getProducersOfSchema(join22(path11)),
|
|
4867
5734
|
/**
|
|
4868
5735
|
* Returns the schema for a given message (event, command or query) by its id and version.
|
|
4869
5736
|
* If no version is given, the latest version is used.
|
|
@@ -4871,14 +5738,14 @@ var src_default = (path9) => {
|
|
|
4871
5738
|
* @param version - Optional version of the message
|
|
4872
5739
|
* @returns { schema: string, fileName: string } | undefined
|
|
4873
5740
|
*/
|
|
4874
|
-
getSchemaForMessage: getSchemaForMessage(join22(
|
|
5741
|
+
getSchemaForMessage: getSchemaForMessage(join22(path11)),
|
|
4875
5742
|
/**
|
|
4876
5743
|
* Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
|
|
4877
5744
|
* @param id - The id of the resource to get the owners for
|
|
4878
5745
|
* @param version - Optional version of the resource
|
|
4879
5746
|
* @returns { owners: User[] }
|
|
4880
5747
|
*/
|
|
4881
|
-
getOwnersForResource: getOwnersForResource(join22(
|
|
5748
|
+
getOwnersForResource: getOwnersForResource(join22(path11)),
|
|
4882
5749
|
/**
|
|
4883
5750
|
* ================================
|
|
4884
5751
|
* Entities
|
|
@@ -4890,13 +5757,13 @@ var src_default = (path9) => {
|
|
|
4890
5757
|
* @param version - Optional id of the version to get (supports semver)
|
|
4891
5758
|
* @returns Entity|Undefined
|
|
4892
5759
|
*/
|
|
4893
|
-
getEntity: getEntity(join22(
|
|
5760
|
+
getEntity: getEntity(join22(path11)),
|
|
4894
5761
|
/**
|
|
4895
5762
|
* Returns all entities from EventCatalog
|
|
4896
5763
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
4897
5764
|
* @returns Entity[]|Undefined
|
|
4898
5765
|
*/
|
|
4899
|
-
getEntities: getEntities(join22(
|
|
5766
|
+
getEntities: getEntities(join22(path11)),
|
|
4900
5767
|
/**
|
|
4901
5768
|
* Adds an entity to EventCatalog
|
|
4902
5769
|
*
|
|
@@ -4904,7 +5771,7 @@ var src_default = (path9) => {
|
|
|
4904
5771
|
* @param options - Optional options to write the entity
|
|
4905
5772
|
*
|
|
4906
5773
|
*/
|
|
4907
|
-
writeEntity: writeEntity(join22(
|
|
5774
|
+
writeEntity: writeEntity(join22(path11, "entities")),
|
|
4908
5775
|
/**
|
|
4909
5776
|
* Adds an entity to a system in EventCatalog
|
|
4910
5777
|
*
|
|
@@ -4913,33 +5780,33 @@ var src_default = (path9) => {
|
|
|
4913
5780
|
* @param options - Optional options to write the entity
|
|
4914
5781
|
*
|
|
4915
5782
|
*/
|
|
4916
|
-
writeEntityToSystem: writeEntityToSystem(join22(
|
|
5783
|
+
writeEntityToSystem: writeEntityToSystem(join22(path11)),
|
|
4917
5784
|
/**
|
|
4918
5785
|
* Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
|
|
4919
5786
|
*
|
|
4920
5787
|
* @param path - The path to your entity, e.g. `/User`
|
|
4921
5788
|
*
|
|
4922
5789
|
*/
|
|
4923
|
-
rmEntity: rmEntity(join22(
|
|
5790
|
+
rmEntity: rmEntity(join22(path11, "entities")),
|
|
4924
5791
|
/**
|
|
4925
5792
|
* Remove an entity by an entity id
|
|
4926
5793
|
*
|
|
4927
5794
|
* @param id - The id of the entity you want to remove
|
|
4928
5795
|
*
|
|
4929
5796
|
*/
|
|
4930
|
-
rmEntityById: rmEntityById(join22(
|
|
5797
|
+
rmEntityById: rmEntityById(join22(path11)),
|
|
4931
5798
|
/**
|
|
4932
5799
|
* Moves a given entity id to the version directory
|
|
4933
5800
|
* @param id - The id of the entity to version
|
|
4934
5801
|
*/
|
|
4935
|
-
versionEntity: versionEntity(join22(
|
|
5802
|
+
versionEntity: versionEntity(join22(path11)),
|
|
4936
5803
|
/**
|
|
4937
5804
|
* Check to see if an entity version exists
|
|
4938
5805
|
* @param id - The id of the entity
|
|
4939
5806
|
* @param version - The version of the entity (supports semver)
|
|
4940
5807
|
* @returns
|
|
4941
5808
|
*/
|
|
4942
|
-
entityHasVersion: entityHasVersion(join22(
|
|
5809
|
+
entityHasVersion: entityHasVersion(join22(path11)),
|
|
4943
5810
|
/**
|
|
4944
5811
|
* ================================
|
|
4945
5812
|
* Flows
|
|
@@ -4952,7 +5819,7 @@ var src_default = (path9) => {
|
|
|
4952
5819
|
* @param version - Optional version of the flow
|
|
4953
5820
|
* @returns Flow
|
|
4954
5821
|
*/
|
|
4955
|
-
getFlow: getFlow(join22(
|
|
5822
|
+
getFlow: getFlow(join22(path11)),
|
|
4956
5823
|
/**
|
|
4957
5824
|
* Returns all flows from EventCatalog
|
|
4958
5825
|
*
|
|
@@ -4960,7 +5827,7 @@ var src_default = (path9) => {
|
|
|
4960
5827
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
4961
5828
|
* @returns Flow[]|Undefined
|
|
4962
5829
|
*/
|
|
4963
|
-
getFlows: getFlows(join22(
|
|
5830
|
+
getFlows: getFlows(join22(path11)),
|
|
4964
5831
|
/**
|
|
4965
5832
|
* Adds a flow to EventCatalog
|
|
4966
5833
|
*
|
|
@@ -4968,14 +5835,14 @@ var src_default = (path9) => {
|
|
|
4968
5835
|
* @param options - Optional options to write the flow
|
|
4969
5836
|
*
|
|
4970
5837
|
*/
|
|
4971
|
-
writeFlow: writeFlow(join22(
|
|
5838
|
+
writeFlow: writeFlow(join22(path11, "flows")),
|
|
4972
5839
|
/**
|
|
4973
5840
|
* Adds a versioned flow to EventCatalog
|
|
4974
5841
|
*
|
|
4975
5842
|
* @param flow - The flow to write
|
|
4976
5843
|
*
|
|
4977
5844
|
*/
|
|
4978
|
-
writeVersionedFlow: writeVersionedFlow(join22(
|
|
5845
|
+
writeVersionedFlow: writeVersionedFlow(join22(path11, "flows")),
|
|
4979
5846
|
/**
|
|
4980
5847
|
* Adds a flow to a domain in EventCatalog
|
|
4981
5848
|
*
|
|
@@ -4984,7 +5851,7 @@ var src_default = (path9) => {
|
|
|
4984
5851
|
* @param options - Optional options to write the flow
|
|
4985
5852
|
*
|
|
4986
5853
|
*/
|
|
4987
|
-
writeFlowToDomain: writeFlowToDomain(join22(
|
|
5854
|
+
writeFlowToDomain: writeFlowToDomain(join22(path11, "domains")),
|
|
4988
5855
|
/**
|
|
4989
5856
|
* Adds a flow to a service in EventCatalog
|
|
4990
5857
|
*
|
|
@@ -4993,7 +5860,7 @@ var src_default = (path9) => {
|
|
|
4993
5860
|
* @param options - Optional options to write the flow
|
|
4994
5861
|
*
|
|
4995
5862
|
*/
|
|
4996
|
-
writeFlowToService: writeFlowToService(join22(
|
|
5863
|
+
writeFlowToService: writeFlowToService(join22(path11, "services")),
|
|
4997
5864
|
/**
|
|
4998
5865
|
* Adds a flow to a system in EventCatalog
|
|
4999
5866
|
*
|
|
@@ -5002,7 +5869,7 @@ var src_default = (path9) => {
|
|
|
5002
5869
|
* @param options - Optional options to write the flow
|
|
5003
5870
|
*
|
|
5004
5871
|
*/
|
|
5005
|
-
writeFlowToSystem: writeFlowToSystem(join22(
|
|
5872
|
+
writeFlowToSystem: writeFlowToSystem(join22(path11)),
|
|
5006
5873
|
/**
|
|
5007
5874
|
* Adds a flow to an agent in EventCatalog
|
|
5008
5875
|
*
|
|
@@ -5011,33 +5878,33 @@ var src_default = (path9) => {
|
|
|
5011
5878
|
* @param options - Optional options to write the flow
|
|
5012
5879
|
*
|
|
5013
5880
|
*/
|
|
5014
|
-
writeFlowToAgent: writeFlowToAgent(join22(
|
|
5881
|
+
writeFlowToAgent: writeFlowToAgent(join22(path11, "agents")),
|
|
5015
5882
|
/**
|
|
5016
5883
|
* Remove a flow from EventCatalog (modeled on the standard POSIX rm utility)
|
|
5017
5884
|
*
|
|
5018
5885
|
* @param path - The path to your flow, e.g. `/PaymentFlow`
|
|
5019
5886
|
*
|
|
5020
5887
|
*/
|
|
5021
|
-
rmFlow: rmFlow(join22(
|
|
5888
|
+
rmFlow: rmFlow(join22(path11, "flows")),
|
|
5022
5889
|
/**
|
|
5023
5890
|
* Remove a flow by a flow id
|
|
5024
5891
|
*
|
|
5025
5892
|
* @param id - The id of the flow you want to remove
|
|
5026
5893
|
*
|
|
5027
5894
|
*/
|
|
5028
|
-
rmFlowById: rmFlowById(join22(
|
|
5895
|
+
rmFlowById: rmFlowById(join22(path11)),
|
|
5029
5896
|
/**
|
|
5030
5897
|
* Moves a given flow id to the version directory
|
|
5031
5898
|
* @param id - The id of the flow to version
|
|
5032
5899
|
*/
|
|
5033
|
-
versionFlow: versionFlow(join22(
|
|
5900
|
+
versionFlow: versionFlow(join22(path11)),
|
|
5034
5901
|
/**
|
|
5035
5902
|
* Check to see if a flow version exists
|
|
5036
5903
|
* @param id - The id of the flow
|
|
5037
5904
|
* @param version - The version of the flow (supports semver)
|
|
5038
5905
|
* @returns
|
|
5039
5906
|
*/
|
|
5040
|
-
flowHasVersion: flowHasVersion(join22(
|
|
5907
|
+
flowHasVersion: flowHasVersion(join22(path11)),
|
|
5041
5908
|
/**
|
|
5042
5909
|
* Adds a file to the given flow
|
|
5043
5910
|
* @param id - The id of the flow to add the file to
|
|
@@ -5045,7 +5912,7 @@ var src_default = (path9) => {
|
|
|
5045
5912
|
* @param version - Optional version of the flow to add the file to
|
|
5046
5913
|
* @returns
|
|
5047
5914
|
*/
|
|
5048
|
-
addFileToFlow: addFileToFlow(join22(
|
|
5915
|
+
addFileToFlow: addFileToFlow(join22(path11)),
|
|
5049
5916
|
/**
|
|
5050
5917
|
* ================================
|
|
5051
5918
|
* Data Stores
|
|
@@ -5057,42 +5924,42 @@ var src_default = (path9) => {
|
|
|
5057
5924
|
* @param options - Optional options to write the data store
|
|
5058
5925
|
*
|
|
5059
5926
|
*/
|
|
5060
|
-
writeDataStore: writeDataStore(join22(
|
|
5927
|
+
writeDataStore: writeDataStore(join22(path11, "containers")),
|
|
5061
5928
|
/**
|
|
5062
5929
|
* Returns a data store from EventCatalog
|
|
5063
5930
|
* @param id - The id of the data store to retrieve
|
|
5064
5931
|
* @param version - Optional id of the version to get (supports semver)
|
|
5065
5932
|
* @returns Container|Undefined
|
|
5066
5933
|
*/
|
|
5067
|
-
getDataStore: getDataStore(join22(
|
|
5934
|
+
getDataStore: getDataStore(join22(path11)),
|
|
5068
5935
|
/**
|
|
5069
5936
|
* Returns all data stores from EventCatalog
|
|
5070
5937
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
5071
5938
|
* @returns Container[]|Undefined
|
|
5072
5939
|
*/
|
|
5073
|
-
getDataStores: getDataStores(join22(
|
|
5940
|
+
getDataStores: getDataStores(join22(path11)),
|
|
5074
5941
|
/**
|
|
5075
5942
|
* Version a data store by its id
|
|
5076
5943
|
* @param id - The id of the data store to version
|
|
5077
5944
|
*/
|
|
5078
|
-
versionDataStore: versionDataStore(join22(
|
|
5945
|
+
versionDataStore: versionDataStore(join22(path11, "containers")),
|
|
5079
5946
|
/**
|
|
5080
5947
|
* Remove a data store by its path
|
|
5081
5948
|
* @param path - The path to the data store to remove
|
|
5082
5949
|
*/
|
|
5083
|
-
rmDataStore: rmDataStore(join22(
|
|
5950
|
+
rmDataStore: rmDataStore(join22(path11, "containers")),
|
|
5084
5951
|
/**
|
|
5085
5952
|
* Remove a data store by its id
|
|
5086
5953
|
* @param id - The id of the data store to remove
|
|
5087
5954
|
*/
|
|
5088
|
-
rmDataStoreById: rmDataStoreById(join22(
|
|
5955
|
+
rmDataStoreById: rmDataStoreById(join22(path11)),
|
|
5089
5956
|
/**
|
|
5090
5957
|
* Check to see if a data store version exists
|
|
5091
5958
|
* @param id - The id of the data store
|
|
5092
5959
|
* @param version - The version of the data store (supports semver)
|
|
5093
5960
|
* @returns
|
|
5094
5961
|
*/
|
|
5095
|
-
dataStoreHasVersion: dataStoreHasVersion(join22(
|
|
5962
|
+
dataStoreHasVersion: dataStoreHasVersion(join22(path11)),
|
|
5096
5963
|
/**
|
|
5097
5964
|
* Adds a file to a data store by its id
|
|
5098
5965
|
* @param id - The id of the data store to add the file to
|
|
@@ -5100,21 +5967,21 @@ var src_default = (path9) => {
|
|
|
5100
5967
|
* @param version - Optional version of the data store to add the file to
|
|
5101
5968
|
* @returns
|
|
5102
5969
|
*/
|
|
5103
|
-
addFileToDataStore: addFileToDataStore(join22(
|
|
5970
|
+
addFileToDataStore: addFileToDataStore(join22(path11)),
|
|
5104
5971
|
/**
|
|
5105
5972
|
* Writes a data store to a service by its id
|
|
5106
5973
|
* @param dataStore - The data store to write
|
|
5107
5974
|
* @param service - The service to write the data store to
|
|
5108
5975
|
* @returns
|
|
5109
5976
|
*/
|
|
5110
|
-
writeDataStoreToService: writeDataStoreToService(join22(
|
|
5977
|
+
writeDataStoreToService: writeDataStoreToService(join22(path11)),
|
|
5111
5978
|
/**
|
|
5112
5979
|
* Writes a data store to a system by its id
|
|
5113
5980
|
* @param dataStore - The data store to write
|
|
5114
5981
|
* @param system - The system to write the data store to
|
|
5115
5982
|
* @returns
|
|
5116
5983
|
*/
|
|
5117
|
-
writeDataStoreToSystem: writeDataStoreToSystem(join22(
|
|
5984
|
+
writeDataStoreToSystem: writeDataStoreToSystem(join22(path11)),
|
|
5118
5985
|
/**
|
|
5119
5986
|
* ================================
|
|
5120
5987
|
* Data Products
|
|
@@ -5126,7 +5993,7 @@ var src_default = (path9) => {
|
|
|
5126
5993
|
* @param options - Optional options to write the data product
|
|
5127
5994
|
*
|
|
5128
5995
|
*/
|
|
5129
|
-
writeDataProduct: writeDataProduct(join22(
|
|
5996
|
+
writeDataProduct: writeDataProduct(join22(path11, "data-products")),
|
|
5130
5997
|
/**
|
|
5131
5998
|
* Writes a data product to a domain in EventCatalog
|
|
5132
5999
|
* @param dataProduct - The data product to write
|
|
@@ -5134,43 +6001,43 @@ var src_default = (path9) => {
|
|
|
5134
6001
|
* @param options - Optional options to write the data product
|
|
5135
6002
|
*
|
|
5136
6003
|
*/
|
|
5137
|
-
writeDataProductToDomain: writeDataProductToDomain(join22(
|
|
6004
|
+
writeDataProductToDomain: writeDataProductToDomain(join22(path11, "domains")),
|
|
5138
6005
|
/**
|
|
5139
6006
|
* Returns a data product from EventCatalog
|
|
5140
6007
|
* @param id - The id of the data product to retrieve
|
|
5141
6008
|
* @param version - Optional id of the version to get (supports semver)
|
|
5142
6009
|
* @returns DataProduct|Undefined
|
|
5143
6010
|
*/
|
|
5144
|
-
getDataProduct: getDataProduct(join22(
|
|
6011
|
+
getDataProduct: getDataProduct(join22(path11)),
|
|
5145
6012
|
/**
|
|
5146
6013
|
* Returns all data products from EventCatalog
|
|
5147
6014
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
5148
6015
|
* @returns DataProduct[]|Undefined
|
|
5149
6016
|
*/
|
|
5150
|
-
getDataProducts: getDataProducts(join22(
|
|
6017
|
+
getDataProducts: getDataProducts(join22(path11)),
|
|
5151
6018
|
/**
|
|
5152
6019
|
* Version a data product by its id
|
|
5153
6020
|
* @param id - The id of the data product to version
|
|
5154
6021
|
*/
|
|
5155
|
-
versionDataProduct: versionDataProduct(join22(
|
|
6022
|
+
versionDataProduct: versionDataProduct(join22(path11)),
|
|
5156
6023
|
/**
|
|
5157
6024
|
* Remove a data product by its path
|
|
5158
6025
|
* @param path - The path to the data product to remove
|
|
5159
6026
|
*/
|
|
5160
|
-
rmDataProduct: rmDataProduct(join22(
|
|
6027
|
+
rmDataProduct: rmDataProduct(join22(path11, "data-products")),
|
|
5161
6028
|
/**
|
|
5162
6029
|
* Remove a data product by its id
|
|
5163
6030
|
* @param id - The id of the data product to remove
|
|
5164
6031
|
* @param version - Optional version of the data product to remove
|
|
5165
6032
|
*/
|
|
5166
|
-
rmDataProductById: rmDataProductById(join22(
|
|
6033
|
+
rmDataProductById: rmDataProductById(join22(path11)),
|
|
5167
6034
|
/**
|
|
5168
6035
|
* Check to see if a data product version exists
|
|
5169
6036
|
* @param id - The id of the data product
|
|
5170
6037
|
* @param version - The version of the data product (supports semver)
|
|
5171
6038
|
* @returns
|
|
5172
6039
|
*/
|
|
5173
|
-
dataProductHasVersion: dataProductHasVersion(join22(
|
|
6040
|
+
dataProductHasVersion: dataProductHasVersion(join22(path11)),
|
|
5174
6041
|
/**
|
|
5175
6042
|
* Adds a file to a data product by its id
|
|
5176
6043
|
* @param id - The id of the data product to add the file to
|
|
@@ -5178,7 +6045,7 @@ var src_default = (path9) => {
|
|
|
5178
6045
|
* @param version - Optional version of the data product to add the file to
|
|
5179
6046
|
* @returns
|
|
5180
6047
|
*/
|
|
5181
|
-
addFileToDataProduct: addFileToDataProduct(join22(
|
|
6048
|
+
addFileToDataProduct: addFileToDataProduct(join22(path11)),
|
|
5182
6049
|
/**
|
|
5183
6050
|
* Adds a data product to a domain
|
|
5184
6051
|
* @param id - The id of the domain
|
|
@@ -5186,7 +6053,7 @@ var src_default = (path9) => {
|
|
|
5186
6053
|
* @param version - (Optional) The version of the domain to add the data product to
|
|
5187
6054
|
* @returns
|
|
5188
6055
|
*/
|
|
5189
|
-
addDataProductToDomain: addDataProductToDomain(join22(
|
|
6056
|
+
addDataProductToDomain: addDataProductToDomain(join22(path11, "domains")),
|
|
5190
6057
|
/**
|
|
5191
6058
|
* ================================
|
|
5192
6059
|
* Diagrams
|
|
@@ -5198,13 +6065,13 @@ var src_default = (path9) => {
|
|
|
5198
6065
|
* @param version - Optional id of the version to get (supports semver)
|
|
5199
6066
|
* @returns Diagram|Undefined
|
|
5200
6067
|
*/
|
|
5201
|
-
getDiagram: getDiagram(join22(
|
|
6068
|
+
getDiagram: getDiagram(join22(path11)),
|
|
5202
6069
|
/**
|
|
5203
6070
|
* Returns all diagrams from EventCatalog
|
|
5204
6071
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
5205
6072
|
* @returns Diagram[]|Undefined
|
|
5206
6073
|
*/
|
|
5207
|
-
getDiagrams: getDiagrams(join22(
|
|
6074
|
+
getDiagrams: getDiagrams(join22(path11)),
|
|
5208
6075
|
/**
|
|
5209
6076
|
* Adds a diagram to EventCatalog
|
|
5210
6077
|
*
|
|
@@ -5212,33 +6079,33 @@ var src_default = (path9) => {
|
|
|
5212
6079
|
* @param options - Optional options to write the diagram
|
|
5213
6080
|
*
|
|
5214
6081
|
*/
|
|
5215
|
-
writeDiagram: writeDiagram(join22(
|
|
6082
|
+
writeDiagram: writeDiagram(join22(path11, "diagrams")),
|
|
5216
6083
|
/**
|
|
5217
6084
|
* Remove a diagram from EventCatalog (modeled on the standard POSIX rm utility)
|
|
5218
6085
|
*
|
|
5219
6086
|
* @param path - The path to your diagram, e.g. `/ArchitectureDiagram`
|
|
5220
6087
|
*
|
|
5221
6088
|
*/
|
|
5222
|
-
rmDiagram: rmDiagram(join22(
|
|
6089
|
+
rmDiagram: rmDiagram(join22(path11, "diagrams")),
|
|
5223
6090
|
/**
|
|
5224
6091
|
* Remove a diagram by a diagram id
|
|
5225
6092
|
*
|
|
5226
6093
|
* @param id - The id of the diagram you want to remove
|
|
5227
6094
|
*
|
|
5228
6095
|
*/
|
|
5229
|
-
rmDiagramById: rmDiagramById(join22(
|
|
6096
|
+
rmDiagramById: rmDiagramById(join22(path11)),
|
|
5230
6097
|
/**
|
|
5231
6098
|
* Moves a given diagram id to the version directory
|
|
5232
6099
|
* @param id - The id of the diagram to version
|
|
5233
6100
|
*/
|
|
5234
|
-
versionDiagram: versionDiagram(join22(
|
|
6101
|
+
versionDiagram: versionDiagram(join22(path11)),
|
|
5235
6102
|
/**
|
|
5236
6103
|
* Check to see if a diagram version exists
|
|
5237
6104
|
* @param id - The id of the diagram
|
|
5238
6105
|
* @param version - The version of the diagram (supports semver)
|
|
5239
6106
|
* @returns
|
|
5240
6107
|
*/
|
|
5241
|
-
diagramHasVersion: diagramHasVersion(join22(
|
|
6108
|
+
diagramHasVersion: diagramHasVersion(join22(path11)),
|
|
5242
6109
|
/**
|
|
5243
6110
|
* Adds a file to the given diagram
|
|
5244
6111
|
* @param id - The id of the diagram to add the file to
|
|
@@ -5246,20 +6113,20 @@ var src_default = (path9) => {
|
|
|
5246
6113
|
* @param version - Optional version of the diagram to add the file to
|
|
5247
6114
|
* @returns
|
|
5248
6115
|
*/
|
|
5249
|
-
addFileToDiagram: addFileToDiagram(join22(
|
|
6116
|
+
addFileToDiagram: addFileToDiagram(join22(path11)),
|
|
5250
6117
|
/**
|
|
5251
6118
|
* ================================
|
|
5252
6119
|
* ADRs
|
|
5253
6120
|
* ================================
|
|
5254
6121
|
*/
|
|
5255
|
-
getAdr: getAdr(join22(
|
|
5256
|
-
getAdrs: getAdrs(join22(
|
|
5257
|
-
writeAdr: writeAdr(join22(
|
|
5258
|
-
rmAdr: rmAdr(join22(
|
|
5259
|
-
rmAdrById: rmAdrById(join22(
|
|
5260
|
-
versionAdr: versionAdr(join22(
|
|
5261
|
-
adrHasVersion: adrHasVersion(join22(
|
|
5262
|
-
addFileToAdr: addFileToAdr(join22(
|
|
6122
|
+
getAdr: getAdr(join22(path11)),
|
|
6123
|
+
getAdrs: getAdrs(join22(path11)),
|
|
6124
|
+
writeAdr: writeAdr(join22(path11, "adrs")),
|
|
6125
|
+
rmAdr: rmAdr(join22(path11, "adrs")),
|
|
6126
|
+
rmAdrById: rmAdrById(join22(path11)),
|
|
6127
|
+
versionAdr: versionAdr(join22(path11)),
|
|
6128
|
+
adrHasVersion: adrHasVersion(join22(path11)),
|
|
6129
|
+
addFileToAdr: addFileToAdr(join22(path11)),
|
|
5263
6130
|
/**
|
|
5264
6131
|
* ================================
|
|
5265
6132
|
* DSL
|
|
@@ -5278,26 +6145,32 @@ var src_default = (path9) => {
|
|
|
5278
6145
|
* const dsl = await sdk.toDSL(services, { type: 'service', hydrate: true });
|
|
5279
6146
|
* ```
|
|
5280
6147
|
*/
|
|
5281
|
-
createSnapshot: createSnapshot(join22(
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
6148
|
+
createSnapshot: createSnapshot(join22(path11)),
|
|
6149
|
+
buildIndex: buildIndex(join22(path11)),
|
|
6150
|
+
diffSnapshots: diffSnapshots(join22(path11)),
|
|
6151
|
+
listSnapshots: listSnapshots(join22(path11)),
|
|
6152
|
+
toDSL: toDSL(join22(path11), {
|
|
6153
|
+
getEvent: getEvent(join22(path11)),
|
|
6154
|
+
getCommand: getCommand(join22(path11)),
|
|
6155
|
+
getQuery: getQuery(join22(path11)),
|
|
6156
|
+
getService: getService(join22(path11)),
|
|
6157
|
+
getServices: getServices(join22(path11)),
|
|
6158
|
+
getDomain: getDomain(join22(path11, "domains")),
|
|
6159
|
+
getChannel: getChannel(join22(path11)),
|
|
6160
|
+
getChannels: getChannels(join22(path11)),
|
|
6161
|
+
getContainer: getDataStore(join22(path11)),
|
|
6162
|
+
getTeam: getTeam(join22(path11, "teams")),
|
|
6163
|
+
getUser: getUser(join22(path11, "users"))
|
|
5296
6164
|
})
|
|
5297
6165
|
};
|
|
5298
6166
|
};
|
|
5299
6167
|
export {
|
|
6168
|
+
FederationIndexSchema,
|
|
5300
6169
|
FlowBuilder,
|
|
5301
|
-
|
|
6170
|
+
InvalidIndexError,
|
|
6171
|
+
src_default as default,
|
|
6172
|
+
hydrate,
|
|
6173
|
+
parseIndex,
|
|
6174
|
+
resolve2 as resolve
|
|
5302
6175
|
};
|
|
5303
6176
|
//# sourceMappingURL=index.mjs.map
|