@eventcatalog/sdk 2.16.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +104 -4
- package/dist/index.d.ts +104 -4
- package/dist/index.js +536 -222
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +524 -210
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ __export(src_exports, {
|
|
|
33
33
|
default: () => src_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(src_exports);
|
|
36
|
-
var
|
|
36
|
+
var import_node_path22 = require("path");
|
|
37
37
|
|
|
38
38
|
// src/dsl/utils.ts
|
|
39
39
|
var import_glob = require("glob");
|
|
@@ -828,8 +828,8 @@ var getFiles = async (pattern, ignore = "") => {
|
|
|
828
828
|
);
|
|
829
829
|
}
|
|
830
830
|
};
|
|
831
|
-
var readMdxFile = async (
|
|
832
|
-
const { data } = import_gray_matter.default.read(
|
|
831
|
+
var readMdxFile = async (path8) => {
|
|
832
|
+
const { data } = import_gray_matter.default.read(path8);
|
|
833
833
|
const { markdown, ...frontmatter } = data;
|
|
834
834
|
return { ...frontmatter, markdown };
|
|
835
835
|
};
|
|
@@ -923,8 +923,8 @@ var writeResource = async (catalogDir, resource, options = {
|
|
|
923
923
|
versionExistingContent: false,
|
|
924
924
|
format: "mdx"
|
|
925
925
|
}) => {
|
|
926
|
-
const
|
|
927
|
-
const fullPath = (0, import_path.join)(catalogDir,
|
|
926
|
+
const path8 = options.path || `/${resource.id}`;
|
|
927
|
+
const fullPath = (0, import_path.join)(catalogDir, path8);
|
|
928
928
|
const format = options.format || "mdx";
|
|
929
929
|
import_node_fs2.default.mkdirSync(fullPath, { recursive: true });
|
|
930
930
|
const lockPath = (0, import_path.join)(fullPath, `index.${format}`);
|
|
@@ -1058,16 +1058,16 @@ var rmResourceById = async (catalogDir, id, version, options) => {
|
|
|
1058
1058
|
}
|
|
1059
1059
|
invalidateFileCache();
|
|
1060
1060
|
};
|
|
1061
|
-
var waitForFileRemoval = async (
|
|
1061
|
+
var waitForFileRemoval = async (path8, maxRetries = 50, delay = 10) => {
|
|
1062
1062
|
for (let i = 0; i < maxRetries; i++) {
|
|
1063
1063
|
try {
|
|
1064
|
-
await import_promises.default.access(
|
|
1064
|
+
await import_promises.default.access(path8);
|
|
1065
1065
|
await new Promise((resolve2) => setTimeout(resolve2, delay));
|
|
1066
1066
|
} catch (error) {
|
|
1067
1067
|
return;
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
|
-
throw new Error(`File/directory ${
|
|
1070
|
+
throw new Error(`File/directory ${path8} was not removed after ${maxRetries} attempts`);
|
|
1071
1071
|
};
|
|
1072
1072
|
var addFileToResource = async (catalogDir, id, file, version, options) => {
|
|
1073
1073
|
let pathToResource;
|
|
@@ -1120,8 +1120,8 @@ var writeEventToService = (directory) => async (event, service, options = { path
|
|
|
1120
1120
|
pathForEvent = (0, import_node_path4.join)(pathForEvent, event.id);
|
|
1121
1121
|
await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
|
|
1122
1122
|
};
|
|
1123
|
-
var rmEvent = (directory) => async (
|
|
1124
|
-
await import_promises2.default.rm((0, import_node_path4.join)(directory,
|
|
1123
|
+
var rmEvent = (directory) => async (path8) => {
|
|
1124
|
+
await import_promises2.default.rm((0, import_node_path4.join)(directory, path8), { recursive: true });
|
|
1125
1125
|
invalidateFileCache();
|
|
1126
1126
|
};
|
|
1127
1127
|
var rmEventById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -1157,8 +1157,8 @@ var writeCommandToService = (directory) => async (command, service, options = {
|
|
|
1157
1157
|
pathForCommand = (0, import_node_path5.join)(pathForCommand, command.id);
|
|
1158
1158
|
await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
|
|
1159
1159
|
};
|
|
1160
|
-
var rmCommand = (directory) => async (
|
|
1161
|
-
await import_promises3.default.rm((0, import_node_path5.join)(directory,
|
|
1160
|
+
var rmCommand = (directory) => async (path8) => {
|
|
1161
|
+
await import_promises3.default.rm((0, import_node_path5.join)(directory, path8), { recursive: true });
|
|
1162
1162
|
invalidateFileCache();
|
|
1163
1163
|
};
|
|
1164
1164
|
var rmCommandById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "command", persistFiles });
|
|
@@ -1192,8 +1192,8 @@ var writeQueryToService = (directory) => async (query, service, options = { path
|
|
|
1192
1192
|
pathForQuery = (0, import_node_path6.join)(pathForQuery, query.id);
|
|
1193
1193
|
await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
|
|
1194
1194
|
};
|
|
1195
|
-
var rmQuery = (directory) => async (
|
|
1196
|
-
await import_promises4.default.rm((0, import_node_path6.join)(directory,
|
|
1195
|
+
var rmQuery = (directory) => async (path8) => {
|
|
1196
|
+
await import_promises4.default.rm((0, import_node_path6.join)(directory, path8), { recursive: true });
|
|
1197
1197
|
invalidateFileCache();
|
|
1198
1198
|
};
|
|
1199
1199
|
var rmQueryById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -1213,8 +1213,8 @@ var queryHasVersion = (directory) => async (id, version) => {
|
|
|
1213
1213
|
var import_promises5 = __toESM(require("fs/promises"));
|
|
1214
1214
|
var import_node_path7 = require("path");
|
|
1215
1215
|
var getService = (directory) => async (id, version) => getResource(directory, id, version, { type: "service" });
|
|
1216
|
-
var getServiceByPath = (directory) => async (
|
|
1217
|
-
const service = await getResource(directory, void 0, void 0, { type: "service" },
|
|
1216
|
+
var getServiceByPath = (directory) => async (path8) => {
|
|
1217
|
+
const service = await getResource(directory, void 0, void 0, { type: "service" }, path8);
|
|
1218
1218
|
return service;
|
|
1219
1219
|
};
|
|
1220
1220
|
var getServices = (directory) => async (options) => getResources(directory, {
|
|
@@ -1249,8 +1249,8 @@ var writeService = (directory) => async (service, options = {
|
|
|
1249
1249
|
};
|
|
1250
1250
|
var writeVersionedService = (directory) => async (service) => {
|
|
1251
1251
|
const resource = { ...service };
|
|
1252
|
-
const
|
|
1253
|
-
return await writeService(directory)(resource, { path:
|
|
1252
|
+
const path8 = getVersionedDirectory(service.id, service.version);
|
|
1253
|
+
return await writeService(directory)(resource, { path: path8 });
|
|
1254
1254
|
};
|
|
1255
1255
|
var writeServiceToDomain = (directory) => async (service, domain, options = { path: "", format: "mdx", override: false }) => {
|
|
1256
1256
|
let pathForService = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/services` : `/${domain.id}/services`;
|
|
@@ -1258,8 +1258,8 @@ var writeServiceToDomain = (directory) => async (service, domain, options = { pa
|
|
|
1258
1258
|
await writeResource(directory, { ...service }, { ...options, path: pathForService, type: "service" });
|
|
1259
1259
|
};
|
|
1260
1260
|
var versionService = (directory) => async (id) => versionResource(directory, id);
|
|
1261
|
-
var rmService = (directory) => async (
|
|
1262
|
-
await import_promises5.default.rm((0, import_node_path7.join)(directory,
|
|
1261
|
+
var rmService = (directory) => async (path8) => {
|
|
1262
|
+
await import_promises5.default.rm((0, import_node_path7.join)(directory, path8), { recursive: true });
|
|
1263
1263
|
invalidateFileCache();
|
|
1264
1264
|
};
|
|
1265
1265
|
var rmServiceById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -1324,8 +1324,8 @@ var addMessageToService = (directory) => async (id, direction, event, version) =
|
|
|
1324
1324
|
if (!existingResource) {
|
|
1325
1325
|
throw new Error(`Cannot find service ${id} in the catalog`);
|
|
1326
1326
|
}
|
|
1327
|
-
const
|
|
1328
|
-
const pathToResource = (0, import_node_path7.join)(
|
|
1327
|
+
const path8 = existingResource.split(/[\\/]+services/)[0];
|
|
1328
|
+
const pathToResource = (0, import_node_path7.join)(path8, "services");
|
|
1329
1329
|
await rmServiceById(directory)(id, version);
|
|
1330
1330
|
await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
|
|
1331
1331
|
};
|
|
@@ -1333,9 +1333,9 @@ var serviceHasVersion = (directory) => async (id, version) => {
|
|
|
1333
1333
|
const file = await findFileById(directory, id, version);
|
|
1334
1334
|
return !!file;
|
|
1335
1335
|
};
|
|
1336
|
-
var isService = (directory) => async (
|
|
1337
|
-
const service = await getServiceByPath(directory)(
|
|
1338
|
-
const relativePath = (0, import_node_path7.relative)(directory,
|
|
1336
|
+
var isService = (directory) => async (path8) => {
|
|
1337
|
+
const service = await getServiceByPath(directory)(path8);
|
|
1338
|
+
const relativePath = (0, import_node_path7.relative)(directory, path8);
|
|
1339
1339
|
const segments = relativePath.split(/[/\\]+/);
|
|
1340
1340
|
return !!service && segments.includes("services");
|
|
1341
1341
|
};
|
|
@@ -1357,8 +1357,8 @@ var addEntityToService = (directory) => async (id, entity, version) => {
|
|
|
1357
1357
|
if (!existingResource) {
|
|
1358
1358
|
throw new Error(`Cannot find service ${id} in the catalog`);
|
|
1359
1359
|
}
|
|
1360
|
-
const
|
|
1361
|
-
const pathToResource = (0, import_node_path7.join)(
|
|
1360
|
+
const path8 = existingResource.split(/[\\/]+services/)[0];
|
|
1361
|
+
const pathToResource = (0, import_node_path7.join)(path8, "services");
|
|
1362
1362
|
await rmServiceById(directory)(id, version);
|
|
1363
1363
|
await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
|
|
1364
1364
|
};
|
|
@@ -1393,8 +1393,8 @@ var addDataStoreToService = (directory) => async (id, operation, dataStore, vers
|
|
|
1393
1393
|
if (!existingResource) {
|
|
1394
1394
|
throw new Error(`Cannot find service ${id} in the catalog`);
|
|
1395
1395
|
}
|
|
1396
|
-
const
|
|
1397
|
-
const pathToResource = (0, import_node_path7.join)(
|
|
1396
|
+
const path8 = existingResource.split(/[\\/]+services/)[0];
|
|
1397
|
+
const pathToResource = (0, import_node_path7.join)(path8, "services");
|
|
1398
1398
|
await rmServiceById(directory)(id, version);
|
|
1399
1399
|
await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
|
|
1400
1400
|
};
|
|
@@ -1435,8 +1435,8 @@ var writeDomain = (directory) => async (domain, options = {
|
|
|
1435
1435
|
return await writeResource(directory, resource, { ...options, type: "domain" });
|
|
1436
1436
|
};
|
|
1437
1437
|
var versionDomain = (directory) => async (id) => versionResource(directory, id);
|
|
1438
|
-
var rmDomain = (directory) => async (
|
|
1439
|
-
await import_promises6.default.rm((0, import_node_path8.join)(directory,
|
|
1438
|
+
var rmDomain = (directory) => async (path8) => {
|
|
1439
|
+
await import_promises6.default.rm((0, import_node_path8.join)(directory, path8), { recursive: true });
|
|
1440
1440
|
invalidateFileCache();
|
|
1441
1441
|
};
|
|
1442
1442
|
var rmDomainById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "domain", persistFiles });
|
|
@@ -1567,8 +1567,8 @@ var import_node_path9 = require("path");
|
|
|
1567
1567
|
var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
|
|
1568
1568
|
var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
|
|
1569
1569
|
var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
|
|
1570
|
-
var rmChannel = (directory) => async (
|
|
1571
|
-
await import_promises7.default.rm((0, import_node_path9.join)(directory,
|
|
1570
|
+
var rmChannel = (directory) => async (path8) => {
|
|
1571
|
+
await import_promises7.default.rm((0, import_node_path9.join)(directory, path8), { recursive: true });
|
|
1572
1572
|
invalidateFileCache();
|
|
1573
1573
|
};
|
|
1574
1574
|
var rmChannelById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "channel", persistFiles });
|
|
@@ -1610,8 +1610,8 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
1610
1610
|
if (!existingResource) {
|
|
1611
1611
|
throw new Error(`Cannot find message ${id} in the catalog`);
|
|
1612
1612
|
}
|
|
1613
|
-
const
|
|
1614
|
-
const pathToResource = (0, import_node_path9.join)(
|
|
1613
|
+
const path8 = existingResource.split(`/[\\/]+${collection}`)[0];
|
|
1614
|
+
const pathToResource = (0, import_node_path9.join)(path8, collection);
|
|
1615
1615
|
await rmMessageById(directory)(_message.id, _message.version, true);
|
|
1616
1616
|
await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
|
|
1617
1617
|
};
|
|
@@ -1620,8 +1620,8 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
1620
1620
|
var import_node_path10 = require("path");
|
|
1621
1621
|
var import_gray_matter4 = __toESM(require("gray-matter"));
|
|
1622
1622
|
var import_semver5 = require("semver");
|
|
1623
|
-
var getMessageBySchemaPath = (directory) => async (
|
|
1624
|
-
const pathToMessage = (0, import_node_path10.dirname)(
|
|
1623
|
+
var getMessageBySchemaPath = (directory) => async (path8, options) => {
|
|
1624
|
+
const pathToMessage = (0, import_node_path10.dirname)(path8);
|
|
1625
1625
|
try {
|
|
1626
1626
|
const files = await getFiles(`${directory}/${pathToMessage}/index.{md,mdx}`);
|
|
1627
1627
|
if (!files || files.length === 0) {
|
|
@@ -1693,18 +1693,18 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
|
|
|
1693
1693
|
}
|
|
1694
1694
|
return { producers, consumers };
|
|
1695
1695
|
};
|
|
1696
|
-
var getConsumersOfSchema = (directory) => async (
|
|
1696
|
+
var getConsumersOfSchema = (directory) => async (path8) => {
|
|
1697
1697
|
try {
|
|
1698
|
-
const message = await getMessageBySchemaPath(directory)(
|
|
1698
|
+
const message = await getMessageBySchemaPath(directory)(path8);
|
|
1699
1699
|
const { consumers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
|
|
1700
1700
|
return consumers;
|
|
1701
1701
|
} catch (error) {
|
|
1702
1702
|
return [];
|
|
1703
1703
|
}
|
|
1704
1704
|
};
|
|
1705
|
-
var getProducersOfSchema = (directory) => async (
|
|
1705
|
+
var getProducersOfSchema = (directory) => async (path8) => {
|
|
1706
1706
|
try {
|
|
1707
|
-
const message = await getMessageBySchemaPath(directory)(
|
|
1707
|
+
const message = await getMessageBySchemaPath(directory)(path8);
|
|
1708
1708
|
const { producers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
|
|
1709
1709
|
return producers;
|
|
1710
1710
|
} catch (error) {
|
|
@@ -1908,8 +1908,8 @@ var filterCollection = (collection, options) => {
|
|
|
1908
1908
|
};
|
|
1909
1909
|
var getEventCatalogConfigurationFile = (directory) => async () => {
|
|
1910
1910
|
try {
|
|
1911
|
-
const
|
|
1912
|
-
const configModule = await import(
|
|
1911
|
+
const path8 = (0, import_node_path15.join)(directory, "eventcatalog.config.js");
|
|
1912
|
+
const configModule = await import(path8);
|
|
1913
1913
|
return configModule.default;
|
|
1914
1914
|
} catch (error) {
|
|
1915
1915
|
console.error("Error getting event catalog configuration file", error);
|
|
@@ -1965,9 +1965,320 @@ var dumpCatalog = (directory) => async (options) => {
|
|
|
1965
1965
|
};
|
|
1966
1966
|
};
|
|
1967
1967
|
|
|
1968
|
-
// src/
|
|
1969
|
-
var import_node_path16 = __toESM(require("path"));
|
|
1968
|
+
// src/snapshots.ts
|
|
1970
1969
|
var import_node_fs7 = __toESM(require("fs"));
|
|
1970
|
+
var import_node_path16 = __toESM(require("path"));
|
|
1971
|
+
var import_node_child_process = require("child_process");
|
|
1972
|
+
var import_semver6 = require("semver");
|
|
1973
|
+
|
|
1974
|
+
// src/snapshot-diff.ts
|
|
1975
|
+
var stableStringify = (value) => {
|
|
1976
|
+
if (value === null || value === void 0 || typeof value !== "object") {
|
|
1977
|
+
return JSON.stringify(value);
|
|
1978
|
+
}
|
|
1979
|
+
if (Array.isArray(value)) {
|
|
1980
|
+
return "[" + value.map(stableStringify).join(",") + "]";
|
|
1981
|
+
}
|
|
1982
|
+
const sorted = Object.keys(value).sort().map((key) => JSON.stringify(key) + ":" + stableStringify(value[key]));
|
|
1983
|
+
return "{" + sorted.join(",") + "}";
|
|
1984
|
+
};
|
|
1985
|
+
var flattenResources = (snapshot) => {
|
|
1986
|
+
const resources = [];
|
|
1987
|
+
const addResources = (items, type) => {
|
|
1988
|
+
for (const item of items) {
|
|
1989
|
+
resources.push({
|
|
1990
|
+
resourceId: item.id,
|
|
1991
|
+
version: item.version,
|
|
1992
|
+
type,
|
|
1993
|
+
data: item
|
|
1994
|
+
});
|
|
1995
|
+
}
|
|
1996
|
+
};
|
|
1997
|
+
addResources(snapshot.resources.domains, "domain");
|
|
1998
|
+
addResources(snapshot.resources.services, "service");
|
|
1999
|
+
addResources(snapshot.resources.messages.events, "event");
|
|
2000
|
+
addResources(snapshot.resources.messages.commands, "command");
|
|
2001
|
+
addResources(snapshot.resources.messages.queries, "query");
|
|
2002
|
+
addResources(snapshot.resources.channels, "channel");
|
|
2003
|
+
return resources;
|
|
2004
|
+
};
|
|
2005
|
+
var EXCLUDED_FIELDS = /* @__PURE__ */ new Set(["markdown", "_eventcatalog"]);
|
|
2006
|
+
var getComparableFields = (data) => {
|
|
2007
|
+
const result = {};
|
|
2008
|
+
for (const [key, value] of Object.entries(data)) {
|
|
2009
|
+
if (!EXCLUDED_FIELDS.has(key)) {
|
|
2010
|
+
result[key] = value;
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
return result;
|
|
2014
|
+
};
|
|
2015
|
+
var findChangedFields = (dataA, dataB) => {
|
|
2016
|
+
const fieldsA = getComparableFields(dataA);
|
|
2017
|
+
const fieldsB = getComparableFields(dataB);
|
|
2018
|
+
const allKeys = /* @__PURE__ */ new Set([...Object.keys(fieldsA), ...Object.keys(fieldsB)]);
|
|
2019
|
+
const changed = [];
|
|
2020
|
+
for (const key of allKeys) {
|
|
2021
|
+
if (stableStringify(fieldsA[key] ?? null) !== stableStringify(fieldsB[key] ?? null)) {
|
|
2022
|
+
changed.push(key);
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
return changed;
|
|
2026
|
+
};
|
|
2027
|
+
var resourceKey = (r) => `${r.resourceId}@${r.version}`;
|
|
2028
|
+
var idTypeKey = (r) => `${r.resourceId}:${r.type}`;
|
|
2029
|
+
var computeResourceDiff = (snapshotA, snapshotB) => {
|
|
2030
|
+
const resourcesA = flattenResources(snapshotA);
|
|
2031
|
+
const resourcesB = flattenResources(snapshotB);
|
|
2032
|
+
const mapA = /* @__PURE__ */ new Map();
|
|
2033
|
+
const byIdA = /* @__PURE__ */ new Map();
|
|
2034
|
+
for (const r of resourcesA) {
|
|
2035
|
+
mapA.set(resourceKey(r), r);
|
|
2036
|
+
byIdA.set(idTypeKey(r), r);
|
|
2037
|
+
}
|
|
2038
|
+
const mapB = /* @__PURE__ */ new Map();
|
|
2039
|
+
const byIdB = /* @__PURE__ */ new Map();
|
|
2040
|
+
for (const r of resourcesB) {
|
|
2041
|
+
mapB.set(resourceKey(r), r);
|
|
2042
|
+
byIdB.set(idTypeKey(r), r);
|
|
2043
|
+
}
|
|
2044
|
+
const changes = [];
|
|
2045
|
+
const handledIds = /* @__PURE__ */ new Set();
|
|
2046
|
+
for (const resource of resourcesB) {
|
|
2047
|
+
const key = resourceKey(resource);
|
|
2048
|
+
if (!mapA.has(key)) {
|
|
2049
|
+
const idKey = idTypeKey(resource);
|
|
2050
|
+
const oldResource = byIdA.get(idKey);
|
|
2051
|
+
if (oldResource && oldResource.version !== resource.version && !handledIds.has(idKey)) {
|
|
2052
|
+
const changedFields = findChangedFields(oldResource.data, resource.data);
|
|
2053
|
+
changes.push({
|
|
2054
|
+
resourceId: resource.resourceId,
|
|
2055
|
+
version: resource.version,
|
|
2056
|
+
type: resource.type,
|
|
2057
|
+
changeType: "versioned",
|
|
2058
|
+
previousVersion: oldResource.version,
|
|
2059
|
+
newVersion: resource.version,
|
|
2060
|
+
changedFields: changedFields.length > 0 ? changedFields : void 0
|
|
2061
|
+
});
|
|
2062
|
+
handledIds.add(idKey);
|
|
2063
|
+
} else if (!handledIds.has(idKey)) {
|
|
2064
|
+
changes.push({
|
|
2065
|
+
resourceId: resource.resourceId,
|
|
2066
|
+
version: resource.version,
|
|
2067
|
+
type: resource.type,
|
|
2068
|
+
changeType: "added"
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
for (const resource of resourcesA) {
|
|
2074
|
+
const key = resourceKey(resource);
|
|
2075
|
+
if (!mapB.has(key)) {
|
|
2076
|
+
const idKey = idTypeKey(resource);
|
|
2077
|
+
if (!handledIds.has(idKey)) {
|
|
2078
|
+
changes.push({
|
|
2079
|
+
resourceId: resource.resourceId,
|
|
2080
|
+
version: resource.version,
|
|
2081
|
+
type: resource.type,
|
|
2082
|
+
changeType: "removed"
|
|
2083
|
+
});
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
for (const resourceB of resourcesB) {
|
|
2088
|
+
const key = resourceKey(resourceB);
|
|
2089
|
+
const resourceA = mapA.get(key);
|
|
2090
|
+
if (resourceA) {
|
|
2091
|
+
const changedFields = findChangedFields(resourceA.data, resourceB.data);
|
|
2092
|
+
if (changedFields.length > 0) {
|
|
2093
|
+
changes.push({
|
|
2094
|
+
resourceId: resourceB.resourceId,
|
|
2095
|
+
version: resourceB.version,
|
|
2096
|
+
type: resourceB.type,
|
|
2097
|
+
changeType: "modified",
|
|
2098
|
+
changedFields
|
|
2099
|
+
});
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
return changes;
|
|
2104
|
+
};
|
|
2105
|
+
var getRelationshipKey = (serviceId, resourceId, resourceVersion, direction) => {
|
|
2106
|
+
return `${serviceId}:${direction}:${resourceId}@${resourceVersion || "latest"}`;
|
|
2107
|
+
};
|
|
2108
|
+
var extractRelationships = (snapshot) => {
|
|
2109
|
+
const relationships = /* @__PURE__ */ new Map();
|
|
2110
|
+
for (const service of snapshot.resources.services) {
|
|
2111
|
+
for (const direction of ["sends", "receives"]) {
|
|
2112
|
+
const pointers = service[direction] || [];
|
|
2113
|
+
for (const pointer of pointers) {
|
|
2114
|
+
const key = getRelationshipKey(service.id, pointer.id, pointer.version, direction);
|
|
2115
|
+
relationships.set(key, {
|
|
2116
|
+
serviceId: service.id,
|
|
2117
|
+
serviceVersion: service.version,
|
|
2118
|
+
resourceId: pointer.id,
|
|
2119
|
+
resourceVersion: pointer.version,
|
|
2120
|
+
direction
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
return relationships;
|
|
2126
|
+
};
|
|
2127
|
+
var computeRelationshipDiff = (snapshotA, snapshotB) => {
|
|
2128
|
+
const relsA = extractRelationships(snapshotA);
|
|
2129
|
+
const relsB = extractRelationships(snapshotB);
|
|
2130
|
+
const changes = [];
|
|
2131
|
+
for (const [key, rel] of relsB) {
|
|
2132
|
+
if (!relsA.has(key)) {
|
|
2133
|
+
changes.push({ ...rel, changeType: "added" });
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
for (const [key, rel] of relsA) {
|
|
2137
|
+
if (!relsB.has(key)) {
|
|
2138
|
+
changes.push({ ...rel, changeType: "removed" });
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
return changes;
|
|
2142
|
+
};
|
|
2143
|
+
|
|
2144
|
+
// src/snapshots.ts
|
|
2145
|
+
var SNAPSHOT_VERSION = "1.0.0";
|
|
2146
|
+
var getEventCatalogVersion2 = (catalogDir) => {
|
|
2147
|
+
try {
|
|
2148
|
+
const packageJson = import_node_fs7.default.readFileSync(import_node_path16.default.join(catalogDir, "package.json"), "utf8");
|
|
2149
|
+
const packageJsonObject = JSON.parse(packageJson);
|
|
2150
|
+
return packageJsonObject["dependencies"]?.["@eventcatalog/core"] ?? "unknown";
|
|
2151
|
+
} catch {
|
|
2152
|
+
return "unknown";
|
|
2153
|
+
}
|
|
2154
|
+
};
|
|
2155
|
+
var pickCoreFields = (resource) => {
|
|
2156
|
+
const picked = { id: resource.id, version: resource.version, name: resource.name };
|
|
2157
|
+
if (resource.sends) picked.sends = resource.sends;
|
|
2158
|
+
if (resource.receives) picked.receives = resource.receives;
|
|
2159
|
+
if (resource.deprecated) picked.deprecated = resource.deprecated;
|
|
2160
|
+
if (resource.owners) picked.owners = resource.owners;
|
|
2161
|
+
return picked;
|
|
2162
|
+
};
|
|
2163
|
+
var deduplicateByLatestVersion = (resources) => {
|
|
2164
|
+
const seen = /* @__PURE__ */ new Map();
|
|
2165
|
+
for (const r of resources) {
|
|
2166
|
+
const existing = seen.get(r.id);
|
|
2167
|
+
if (!existing || (0, import_semver6.compare)(r.version, existing.version) > 0) {
|
|
2168
|
+
seen.set(r.id, r);
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
return Array.from(seen.values());
|
|
2172
|
+
};
|
|
2173
|
+
var stripToCore = (resources) => {
|
|
2174
|
+
if (!resources || resources.length === 0) return [];
|
|
2175
|
+
return deduplicateByLatestVersion(resources).map(pickCoreFields);
|
|
2176
|
+
};
|
|
2177
|
+
var detectGitInfo = (catalogDir) => {
|
|
2178
|
+
try {
|
|
2179
|
+
const opts = { cwd: catalogDir, encoding: "utf8", stdio: "pipe" };
|
|
2180
|
+
const branch = (0, import_node_child_process.execSync)("git rev-parse --abbrev-ref HEAD", opts).trim();
|
|
2181
|
+
const commit = (0, import_node_child_process.execSync)("git rev-parse --short HEAD", opts).trim();
|
|
2182
|
+
const status = (0, import_node_child_process.execSync)("git status --porcelain", opts).trim();
|
|
2183
|
+
return { branch, commit, dirty: status.length > 0 };
|
|
2184
|
+
} catch {
|
|
2185
|
+
return void 0;
|
|
2186
|
+
}
|
|
2187
|
+
};
|
|
2188
|
+
var createSnapshot = (directory) => {
|
|
2189
|
+
return async (options) => {
|
|
2190
|
+
const { label, outputDir, git } = options || {};
|
|
2191
|
+
const sdk = src_default(directory);
|
|
2192
|
+
const [domains, services, events, commands, queries, channels] = await Promise.all([
|
|
2193
|
+
sdk.getDomains(),
|
|
2194
|
+
sdk.getServices(),
|
|
2195
|
+
sdk.getEvents(),
|
|
2196
|
+
sdk.getCommands(),
|
|
2197
|
+
sdk.getQueries(),
|
|
2198
|
+
sdk.getChannels()
|
|
2199
|
+
]);
|
|
2200
|
+
const snapshotDomains = stripToCore(domains);
|
|
2201
|
+
const snapshotServices = stripToCore(services);
|
|
2202
|
+
const snapshotEvents = stripToCore(events);
|
|
2203
|
+
const snapshotCommands = stripToCore(commands);
|
|
2204
|
+
const snapshotQueries = stripToCore(queries);
|
|
2205
|
+
const snapshotChannels = stripToCore(channels);
|
|
2206
|
+
const snapshotLabel = label || (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
2207
|
+
const gitInfo = git || detectGitInfo(directory);
|
|
2208
|
+
const snapshot = {
|
|
2209
|
+
snapshotVersion: SNAPSHOT_VERSION,
|
|
2210
|
+
catalogVersion: getEventCatalogVersion2(directory),
|
|
2211
|
+
label: snapshotLabel,
|
|
2212
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2213
|
+
...gitInfo ? { git: gitInfo } : {},
|
|
2214
|
+
resources: {
|
|
2215
|
+
domains: snapshotDomains,
|
|
2216
|
+
services: snapshotServices,
|
|
2217
|
+
messages: {
|
|
2218
|
+
events: snapshotEvents,
|
|
2219
|
+
commands: snapshotCommands,
|
|
2220
|
+
queries: snapshotQueries
|
|
2221
|
+
},
|
|
2222
|
+
channels: snapshotChannels
|
|
2223
|
+
}
|
|
2224
|
+
};
|
|
2225
|
+
const snapshotsDir = outputDir || import_node_path16.default.join(directory, ".snapshots");
|
|
2226
|
+
import_node_fs7.default.mkdirSync(snapshotsDir, { recursive: true });
|
|
2227
|
+
const fileName = `${snapshotLabel}.snapshot.json`;
|
|
2228
|
+
const filePath = import_node_path16.default.join(snapshotsDir, fileName);
|
|
2229
|
+
import_node_fs7.default.writeFileSync(filePath, JSON.stringify(snapshot));
|
|
2230
|
+
return { filePath, snapshot };
|
|
2231
|
+
};
|
|
2232
|
+
};
|
|
2233
|
+
var diffSnapshots = (directory) => async (snapshotAPath, snapshotBPath) => {
|
|
2234
|
+
const snapshotA = JSON.parse(import_node_fs7.default.readFileSync(snapshotAPath, "utf-8"));
|
|
2235
|
+
const snapshotB = JSON.parse(import_node_fs7.default.readFileSync(snapshotBPath, "utf-8"));
|
|
2236
|
+
const resourceChanges = computeResourceDiff(snapshotA, snapshotB);
|
|
2237
|
+
const relationshipChanges = computeRelationshipDiff(snapshotA, snapshotB);
|
|
2238
|
+
const resourceCounts = { added: 0, removed: 0, modified: 0, versioned: 0 };
|
|
2239
|
+
for (const r of resourceChanges) resourceCounts[r.changeType]++;
|
|
2240
|
+
const relCounts = { added: 0, removed: 0 };
|
|
2241
|
+
for (const r of relationshipChanges) relCounts[r.changeType]++;
|
|
2242
|
+
return {
|
|
2243
|
+
snapshotA: { label: snapshotA.label, createdAt: snapshotA.createdAt },
|
|
2244
|
+
snapshotB: { label: snapshotB.label, createdAt: snapshotB.createdAt },
|
|
2245
|
+
summary: {
|
|
2246
|
+
totalChanges: resourceChanges.length + relationshipChanges.length,
|
|
2247
|
+
resourcesAdded: resourceCounts.added,
|
|
2248
|
+
resourcesRemoved: resourceCounts.removed,
|
|
2249
|
+
resourcesModified: resourceCounts.modified,
|
|
2250
|
+
resourcesVersioned: resourceCounts.versioned,
|
|
2251
|
+
relationshipsAdded: relCounts.added,
|
|
2252
|
+
relationshipsRemoved: relCounts.removed
|
|
2253
|
+
},
|
|
2254
|
+
resources: resourceChanges,
|
|
2255
|
+
relationships: relationshipChanges
|
|
2256
|
+
};
|
|
2257
|
+
};
|
|
2258
|
+
var listSnapshots = (directory) => async () => {
|
|
2259
|
+
const snapshotsDir = import_node_path16.default.join(directory, ".snapshots");
|
|
2260
|
+
if (!import_node_fs7.default.existsSync(snapshotsDir)) return [];
|
|
2261
|
+
const files = import_node_fs7.default.readdirSync(snapshotsDir).filter((f) => f.endsWith(".snapshot.json"));
|
|
2262
|
+
const snapshots = [];
|
|
2263
|
+
for (const file of files) {
|
|
2264
|
+
try {
|
|
2265
|
+
const filePath = import_node_path16.default.join(snapshotsDir, file);
|
|
2266
|
+
const content = JSON.parse(import_node_fs7.default.readFileSync(filePath, "utf-8"));
|
|
2267
|
+
snapshots.push({
|
|
2268
|
+
label: content.label,
|
|
2269
|
+
createdAt: content.createdAt,
|
|
2270
|
+
filePath,
|
|
2271
|
+
...content.git ? { git: content.git } : {}
|
|
2272
|
+
});
|
|
2273
|
+
} catch {
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
return snapshots.sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
2277
|
+
};
|
|
2278
|
+
|
|
2279
|
+
// src/changelogs.ts
|
|
2280
|
+
var import_node_path17 = __toESM(require("path"));
|
|
2281
|
+
var import_node_fs8 = __toESM(require("fs"));
|
|
1971
2282
|
var import_promises10 = __toESM(require("fs/promises"));
|
|
1972
2283
|
var import_gray_matter8 = __toESM(require("gray-matter"));
|
|
1973
2284
|
var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
|
|
@@ -1976,8 +2287,8 @@ var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
|
|
|
1976
2287
|
if (!resourceFile) {
|
|
1977
2288
|
throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
|
|
1978
2289
|
}
|
|
1979
|
-
const resourceDir = (0,
|
|
1980
|
-
const changelogPath =
|
|
2290
|
+
const resourceDir = (0, import_node_path17.dirname)(resourceFile);
|
|
2291
|
+
const changelogPath = import_node_path17.default.join(resourceDir, `changelog.${format}`);
|
|
1981
2292
|
const { markdown, ...frontmatter } = changelog;
|
|
1982
2293
|
const fm = { ...frontmatter };
|
|
1983
2294
|
if (fm.createdAt instanceof Date) {
|
|
@@ -1986,9 +2297,9 @@ var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
|
|
|
1986
2297
|
if (!fm.badges || fm.badges.length === 0) {
|
|
1987
2298
|
delete fm.badges;
|
|
1988
2299
|
}
|
|
1989
|
-
|
|
2300
|
+
import_node_fs8.default.mkdirSync(resourceDir, { recursive: true });
|
|
1990
2301
|
const document = import_gray_matter8.default.stringify(markdown.trim(), fm);
|
|
1991
|
-
|
|
2302
|
+
import_node_fs8.default.writeFileSync(changelogPath, document);
|
|
1992
2303
|
invalidateFileCache();
|
|
1993
2304
|
};
|
|
1994
2305
|
var appendChangelog = (catalogDir) => async (id, changelog, options = {}) => {
|
|
@@ -1997,10 +2308,10 @@ var appendChangelog = (catalogDir) => async (id, changelog, options = {}) => {
|
|
|
1997
2308
|
if (!resourceFile) {
|
|
1998
2309
|
throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
|
|
1999
2310
|
}
|
|
2000
|
-
const resourceDir = (0,
|
|
2001
|
-
const mdxPath =
|
|
2002
|
-
const mdPath =
|
|
2003
|
-
const existingPath =
|
|
2311
|
+
const resourceDir = (0, import_node_path17.dirname)(resourceFile);
|
|
2312
|
+
const mdxPath = import_node_path17.default.join(resourceDir, "changelog.mdx");
|
|
2313
|
+
const mdPath = import_node_path17.default.join(resourceDir, "changelog.md");
|
|
2314
|
+
const existingPath = import_node_fs8.default.existsSync(mdxPath) ? mdxPath : import_node_fs8.default.existsSync(mdPath) ? mdPath : void 0;
|
|
2004
2315
|
if (!existingPath) {
|
|
2005
2316
|
return writeChangelog(catalogDir)(id, changelog, options);
|
|
2006
2317
|
}
|
|
@@ -2020,17 +2331,17 @@ ${existingContent}`;
|
|
|
2020
2331
|
delete fm.badges;
|
|
2021
2332
|
}
|
|
2022
2333
|
const document = import_gray_matter8.default.stringify(combined, fm);
|
|
2023
|
-
|
|
2334
|
+
import_node_fs8.default.writeFileSync(existingPath, document);
|
|
2024
2335
|
invalidateFileCache();
|
|
2025
2336
|
};
|
|
2026
2337
|
var getChangelog = (catalogDir) => async (id, options = {}) => {
|
|
2027
2338
|
const { version } = options;
|
|
2028
2339
|
const resourceFile = await findFileById(catalogDir, id, version);
|
|
2029
2340
|
if (!resourceFile) return void 0;
|
|
2030
|
-
const resourceDir = (0,
|
|
2031
|
-
const mdxPath =
|
|
2032
|
-
const mdPath =
|
|
2033
|
-
const changelogPath =
|
|
2341
|
+
const resourceDir = (0, import_node_path17.dirname)(resourceFile);
|
|
2342
|
+
const mdxPath = import_node_path17.default.join(resourceDir, "changelog.mdx");
|
|
2343
|
+
const mdPath = import_node_path17.default.join(resourceDir, "changelog.md");
|
|
2344
|
+
const changelogPath = import_node_fs8.default.existsSync(mdxPath) ? mdxPath : import_node_fs8.default.existsSync(mdPath) ? mdPath : void 0;
|
|
2034
2345
|
if (!changelogPath) return void 0;
|
|
2035
2346
|
const { data, content } = import_gray_matter8.default.read(changelogPath);
|
|
2036
2347
|
return { ...data, markdown: content.trim() };
|
|
@@ -2041,13 +2352,13 @@ var rmChangelog = (catalogDir) => async (id, options = {}) => {
|
|
|
2041
2352
|
if (!resourceFile) {
|
|
2042
2353
|
throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
|
|
2043
2354
|
}
|
|
2044
|
-
const resourceDir = (0,
|
|
2045
|
-
const mdxPath =
|
|
2046
|
-
const mdPath =
|
|
2047
|
-
if (
|
|
2355
|
+
const resourceDir = (0, import_node_path17.dirname)(resourceFile);
|
|
2356
|
+
const mdxPath = import_node_path17.default.join(resourceDir, "changelog.mdx");
|
|
2357
|
+
const mdPath = import_node_path17.default.join(resourceDir, "changelog.md");
|
|
2358
|
+
if (import_node_fs8.default.existsSync(mdxPath)) {
|
|
2048
2359
|
await import_promises10.default.rm(mdxPath);
|
|
2049
2360
|
}
|
|
2050
|
-
if (
|
|
2361
|
+
if (import_node_fs8.default.existsSync(mdPath)) {
|
|
2051
2362
|
await import_promises10.default.rm(mdPath);
|
|
2052
2363
|
}
|
|
2053
2364
|
invalidateFileCache();
|
|
@@ -2055,7 +2366,7 @@ var rmChangelog = (catalogDir) => async (id, options = {}) => {
|
|
|
2055
2366
|
|
|
2056
2367
|
// src/entities.ts
|
|
2057
2368
|
var import_promises11 = __toESM(require("fs/promises"));
|
|
2058
|
-
var
|
|
2369
|
+
var import_node_path18 = require("path");
|
|
2059
2370
|
var getEntity = (directory) => async (id, version) => getResource(directory, id, version, { type: "entity" });
|
|
2060
2371
|
var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
|
|
2061
2372
|
var writeEntity = (directory) => async (entity, options = {
|
|
@@ -2063,8 +2374,8 @@ var writeEntity = (directory) => async (entity, options = {
|
|
|
2063
2374
|
override: false,
|
|
2064
2375
|
format: "mdx"
|
|
2065
2376
|
}) => writeResource(directory, { ...entity }, { ...options, type: "entity" });
|
|
2066
|
-
var rmEntity = (directory) => async (
|
|
2067
|
-
await import_promises11.default.rm((0,
|
|
2377
|
+
var rmEntity = (directory) => async (path8) => {
|
|
2378
|
+
await import_promises11.default.rm((0, import_node_path18.join)(directory, path8), { recursive: true });
|
|
2068
2379
|
invalidateFileCache();
|
|
2069
2380
|
};
|
|
2070
2381
|
var rmEntityById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -2078,7 +2389,7 @@ var entityHasVersion = (directory) => async (id, version) => {
|
|
|
2078
2389
|
|
|
2079
2390
|
// src/containers.ts
|
|
2080
2391
|
var import_promises12 = __toESM(require("fs/promises"));
|
|
2081
|
-
var
|
|
2392
|
+
var import_node_path19 = require("path");
|
|
2082
2393
|
var getContainer = (directory) => async (id, version) => getResource(directory, id, version, { type: "container" });
|
|
2083
2394
|
var getContainers = (directory) => async (options) => getResources(directory, { type: "containers", latestOnly: options?.latestOnly });
|
|
2084
2395
|
var writeContainer = (directory) => async (data, options = {
|
|
@@ -2087,8 +2398,8 @@ var writeContainer = (directory) => async (data, options = {
|
|
|
2087
2398
|
format: "mdx"
|
|
2088
2399
|
}) => writeResource(directory, { ...data }, { ...options, type: "container" });
|
|
2089
2400
|
var versionContainer = (directory) => async (id) => versionResource(directory, id);
|
|
2090
|
-
var rmContainer = (directory) => async (
|
|
2091
|
-
await import_promises12.default.rm((0,
|
|
2401
|
+
var rmContainer = (directory) => async (path8) => {
|
|
2402
|
+
await import_promises12.default.rm((0, import_node_path19.join)(directory, path8), { recursive: true });
|
|
2092
2403
|
invalidateFileCache();
|
|
2093
2404
|
};
|
|
2094
2405
|
var rmContainerById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -2105,7 +2416,7 @@ var writeContainerToService = (directory) => async (container, service, options
|
|
|
2105
2416
|
throw new Error("Service not found");
|
|
2106
2417
|
}
|
|
2107
2418
|
let pathForContainer = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/containers` : `${resourcePath.directory}/containers`;
|
|
2108
|
-
pathForContainer = (0,
|
|
2419
|
+
pathForContainer = (0, import_node_path19.join)(pathForContainer, container.id);
|
|
2109
2420
|
await writeResource(directory, { ...container }, { ...options, path: pathForContainer, type: "container" });
|
|
2110
2421
|
};
|
|
2111
2422
|
|
|
@@ -2122,7 +2433,7 @@ var writeDataStoreToService = writeContainerToService;
|
|
|
2122
2433
|
|
|
2123
2434
|
// src/data-products.ts
|
|
2124
2435
|
var import_promises13 = __toESM(require("fs/promises"));
|
|
2125
|
-
var
|
|
2436
|
+
var import_node_path20 = require("path");
|
|
2126
2437
|
var getDataProduct = (directory) => async (id, version) => getResource(directory, id, version, { type: "data-product" });
|
|
2127
2438
|
var getDataProducts = (directory) => async (options) => getResources(directory, { type: "data-products", latestOnly: options?.latestOnly });
|
|
2128
2439
|
var writeDataProduct = (directory) => async (dataProduct, options = {
|
|
@@ -2132,11 +2443,11 @@ var writeDataProduct = (directory) => async (dataProduct, options = {
|
|
|
2132
2443
|
}) => writeResource(directory, { ...dataProduct }, { ...options, type: "data-product" });
|
|
2133
2444
|
var writeDataProductToDomain = (directory) => async (dataProduct, domain, options = { path: "", format: "mdx", override: false }) => {
|
|
2134
2445
|
let pathForDataProduct = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/data-products` : `/${domain.id}/data-products`;
|
|
2135
|
-
pathForDataProduct = (0,
|
|
2446
|
+
pathForDataProduct = (0, import_node_path20.join)(pathForDataProduct, dataProduct.id);
|
|
2136
2447
|
await writeResource(directory, { ...dataProduct }, { ...options, path: pathForDataProduct, type: "data-product" });
|
|
2137
2448
|
};
|
|
2138
|
-
var rmDataProduct = (directory) => async (
|
|
2139
|
-
await import_promises13.default.rm((0,
|
|
2449
|
+
var rmDataProduct = (directory) => async (path8) => {
|
|
2450
|
+
await import_promises13.default.rm((0, import_node_path20.join)(directory, path8), { recursive: true });
|
|
2140
2451
|
invalidateFileCache();
|
|
2141
2452
|
};
|
|
2142
2453
|
var rmDataProductById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -2151,7 +2462,7 @@ var addFileToDataProduct = (directory) => async (id, file, version) => addFileTo
|
|
|
2151
2462
|
|
|
2152
2463
|
// src/diagrams.ts
|
|
2153
2464
|
var import_promises14 = __toESM(require("fs/promises"));
|
|
2154
|
-
var
|
|
2465
|
+
var import_node_path21 = require("path");
|
|
2155
2466
|
var getDiagram = (directory) => async (id, version) => getResource(directory, id, version, { type: "diagram" });
|
|
2156
2467
|
var getDiagrams = (directory) => async (options) => getResources(directory, { type: "diagrams", latestOnly: options?.latestOnly });
|
|
2157
2468
|
var writeDiagram = (directory) => async (diagram, options = {
|
|
@@ -2159,8 +2470,8 @@ var writeDiagram = (directory) => async (diagram, options = {
|
|
|
2159
2470
|
override: false,
|
|
2160
2471
|
format: "mdx"
|
|
2161
2472
|
}) => writeResource(directory, { ...diagram }, { ...options, type: "diagram" });
|
|
2162
|
-
var rmDiagram = (directory) => async (
|
|
2163
|
-
await import_promises14.default.rm((0,
|
|
2473
|
+
var rmDiagram = (directory) => async (path8) => {
|
|
2474
|
+
await import_promises14.default.rm((0, import_node_path21.join)(directory, path8), { recursive: true });
|
|
2164
2475
|
invalidateFileCache();
|
|
2165
2476
|
};
|
|
2166
2477
|
var rmDiagramById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -2174,7 +2485,7 @@ var diagramHasVersion = (directory) => async (id, version) => {
|
|
|
2174
2485
|
var addFileToDiagram = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version, { type: "diagram" });
|
|
2175
2486
|
|
|
2176
2487
|
// src/index.ts
|
|
2177
|
-
var src_default = (
|
|
2488
|
+
var src_default = (path8) => {
|
|
2178
2489
|
return {
|
|
2179
2490
|
/**
|
|
2180
2491
|
* Returns an events from EventCatalog
|
|
@@ -2182,13 +2493,13 @@ var src_default = (path7) => {
|
|
|
2182
2493
|
* @param version - Optional id of the version to get (supports semver)
|
|
2183
2494
|
* @returns Event|Undefined
|
|
2184
2495
|
*/
|
|
2185
|
-
getEvent: getEvent((0,
|
|
2496
|
+
getEvent: getEvent((0, import_node_path22.join)(path8)),
|
|
2186
2497
|
/**
|
|
2187
2498
|
* Returns all events from EventCatalog
|
|
2188
2499
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2189
2500
|
* @returns Event[]|Undefined
|
|
2190
2501
|
*/
|
|
2191
|
-
getEvents: getEvents((0,
|
|
2502
|
+
getEvents: getEvents((0, import_node_path22.join)(path8)),
|
|
2192
2503
|
/**
|
|
2193
2504
|
* Adds an event to EventCatalog
|
|
2194
2505
|
*
|
|
@@ -2196,7 +2507,7 @@ var src_default = (path7) => {
|
|
|
2196
2507
|
* @param options - Optional options to write the event
|
|
2197
2508
|
*
|
|
2198
2509
|
*/
|
|
2199
|
-
writeEvent: writeEvent((0,
|
|
2510
|
+
writeEvent: writeEvent((0, import_node_path22.join)(path8, "events")),
|
|
2200
2511
|
/**
|
|
2201
2512
|
* Adds an event to a service in EventCatalog
|
|
2202
2513
|
*
|
|
@@ -2205,26 +2516,26 @@ var src_default = (path7) => {
|
|
|
2205
2516
|
* @param options - Optional options to write the event
|
|
2206
2517
|
*
|
|
2207
2518
|
*/
|
|
2208
|
-
writeEventToService: writeEventToService((0,
|
|
2519
|
+
writeEventToService: writeEventToService((0, import_node_path22.join)(path8)),
|
|
2209
2520
|
/**
|
|
2210
2521
|
* Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
|
|
2211
2522
|
*
|
|
2212
2523
|
* @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
|
|
2213
2524
|
*
|
|
2214
2525
|
*/
|
|
2215
|
-
rmEvent: rmEvent((0,
|
|
2526
|
+
rmEvent: rmEvent((0, import_node_path22.join)(path8, "events")),
|
|
2216
2527
|
/**
|
|
2217
2528
|
* Remove an event by an Event id
|
|
2218
2529
|
*
|
|
2219
2530
|
* @param id - The id of the event you want to remove
|
|
2220
2531
|
*
|
|
2221
2532
|
*/
|
|
2222
|
-
rmEventById: rmEventById((0,
|
|
2533
|
+
rmEventById: rmEventById((0, import_node_path22.join)(path8)),
|
|
2223
2534
|
/**
|
|
2224
2535
|
* Moves a given event id to the version directory
|
|
2225
2536
|
* @param directory
|
|
2226
2537
|
*/
|
|
2227
|
-
versionEvent: versionEvent((0,
|
|
2538
|
+
versionEvent: versionEvent((0, import_node_path22.join)(path8)),
|
|
2228
2539
|
/**
|
|
2229
2540
|
* Adds a file to the given event
|
|
2230
2541
|
* @param id - The id of the event to add the file to
|
|
@@ -2232,7 +2543,7 @@ var src_default = (path7) => {
|
|
|
2232
2543
|
* @param version - Optional version of the event to add the file to
|
|
2233
2544
|
* @returns
|
|
2234
2545
|
*/
|
|
2235
|
-
addFileToEvent: addFileToEvent((0,
|
|
2546
|
+
addFileToEvent: addFileToEvent((0, import_node_path22.join)(path8)),
|
|
2236
2547
|
/**
|
|
2237
2548
|
* Adds a schema to the given event
|
|
2238
2549
|
* @param id - The id of the event to add the schema to
|
|
@@ -2240,14 +2551,14 @@ var src_default = (path7) => {
|
|
|
2240
2551
|
* @param version - Optional version of the event to add the schema to
|
|
2241
2552
|
* @returns
|
|
2242
2553
|
*/
|
|
2243
|
-
addSchemaToEvent: addSchemaToEvent((0,
|
|
2554
|
+
addSchemaToEvent: addSchemaToEvent((0, import_node_path22.join)(path8)),
|
|
2244
2555
|
/**
|
|
2245
2556
|
* Check to see if an event version exists
|
|
2246
2557
|
* @param id - The id of the event
|
|
2247
2558
|
* @param version - The version of the event (supports semver)
|
|
2248
2559
|
* @returns
|
|
2249
2560
|
*/
|
|
2250
|
-
eventHasVersion: eventHasVersion((0,
|
|
2561
|
+
eventHasVersion: eventHasVersion((0, import_node_path22.join)(path8)),
|
|
2251
2562
|
/**
|
|
2252
2563
|
* ================================
|
|
2253
2564
|
* Commands
|
|
@@ -2259,13 +2570,13 @@ var src_default = (path7) => {
|
|
|
2259
2570
|
* @param version - Optional id of the version to get (supports semver)
|
|
2260
2571
|
* @returns Command|Undefined
|
|
2261
2572
|
*/
|
|
2262
|
-
getCommand: getCommand((0,
|
|
2573
|
+
getCommand: getCommand((0, import_node_path22.join)(path8)),
|
|
2263
2574
|
/**
|
|
2264
2575
|
* Returns all commands from EventCatalog
|
|
2265
2576
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2266
2577
|
* @returns Command[]|Undefined
|
|
2267
2578
|
*/
|
|
2268
|
-
getCommands: getCommands((0,
|
|
2579
|
+
getCommands: getCommands((0, import_node_path22.join)(path8)),
|
|
2269
2580
|
/**
|
|
2270
2581
|
* Adds an command to EventCatalog
|
|
2271
2582
|
*
|
|
@@ -2273,7 +2584,7 @@ var src_default = (path7) => {
|
|
|
2273
2584
|
* @param options - Optional options to write the command
|
|
2274
2585
|
*
|
|
2275
2586
|
*/
|
|
2276
|
-
writeCommand: writeCommand((0,
|
|
2587
|
+
writeCommand: writeCommand((0, import_node_path22.join)(path8, "commands")),
|
|
2277
2588
|
/**
|
|
2278
2589
|
* Adds a command to a service in EventCatalog
|
|
2279
2590
|
*
|
|
@@ -2282,26 +2593,26 @@ var src_default = (path7) => {
|
|
|
2282
2593
|
* @param options - Optional options to write the command
|
|
2283
2594
|
*
|
|
2284
2595
|
*/
|
|
2285
|
-
writeCommandToService: writeCommandToService((0,
|
|
2596
|
+
writeCommandToService: writeCommandToService((0, import_node_path22.join)(path8)),
|
|
2286
2597
|
/**
|
|
2287
2598
|
* Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
|
|
2288
2599
|
*
|
|
2289
2600
|
* @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
|
|
2290
2601
|
*
|
|
2291
2602
|
*/
|
|
2292
|
-
rmCommand: rmCommand((0,
|
|
2603
|
+
rmCommand: rmCommand((0, import_node_path22.join)(path8, "commands")),
|
|
2293
2604
|
/**
|
|
2294
2605
|
* Remove an command by an Event id
|
|
2295
2606
|
*
|
|
2296
2607
|
* @param id - The id of the command you want to remove
|
|
2297
2608
|
*
|
|
2298
2609
|
*/
|
|
2299
|
-
rmCommandById: rmCommandById((0,
|
|
2610
|
+
rmCommandById: rmCommandById((0, import_node_path22.join)(path8)),
|
|
2300
2611
|
/**
|
|
2301
2612
|
* Moves a given command id to the version directory
|
|
2302
2613
|
* @param directory
|
|
2303
2614
|
*/
|
|
2304
|
-
versionCommand: versionCommand((0,
|
|
2615
|
+
versionCommand: versionCommand((0, import_node_path22.join)(path8)),
|
|
2305
2616
|
/**
|
|
2306
2617
|
* Adds a file to the given command
|
|
2307
2618
|
* @param id - The id of the command to add the file to
|
|
@@ -2309,7 +2620,7 @@ var src_default = (path7) => {
|
|
|
2309
2620
|
* @param version - Optional version of the command to add the file to
|
|
2310
2621
|
* @returns
|
|
2311
2622
|
*/
|
|
2312
|
-
addFileToCommand: addFileToCommand((0,
|
|
2623
|
+
addFileToCommand: addFileToCommand((0, import_node_path22.join)(path8)),
|
|
2313
2624
|
/**
|
|
2314
2625
|
* Adds a schema to the given command
|
|
2315
2626
|
* @param id - The id of the command to add the schema to
|
|
@@ -2317,14 +2628,14 @@ var src_default = (path7) => {
|
|
|
2317
2628
|
* @param version - Optional version of the command to add the schema to
|
|
2318
2629
|
* @returns
|
|
2319
2630
|
*/
|
|
2320
|
-
addSchemaToCommand: addSchemaToCommand((0,
|
|
2631
|
+
addSchemaToCommand: addSchemaToCommand((0, import_node_path22.join)(path8)),
|
|
2321
2632
|
/**
|
|
2322
2633
|
* Check to see if a command version exists
|
|
2323
2634
|
* @param id - The id of the command
|
|
2324
2635
|
* @param version - The version of the command (supports semver)
|
|
2325
2636
|
* @returns
|
|
2326
2637
|
*/
|
|
2327
|
-
commandHasVersion: commandHasVersion((0,
|
|
2638
|
+
commandHasVersion: commandHasVersion((0, import_node_path22.join)(path8)),
|
|
2328
2639
|
/**
|
|
2329
2640
|
* ================================
|
|
2330
2641
|
* Queries
|
|
@@ -2336,13 +2647,13 @@ var src_default = (path7) => {
|
|
|
2336
2647
|
* @param version - Optional id of the version to get (supports semver)
|
|
2337
2648
|
* @returns Query|Undefined
|
|
2338
2649
|
*/
|
|
2339
|
-
getQuery: getQuery((0,
|
|
2650
|
+
getQuery: getQuery((0, import_node_path22.join)(path8)),
|
|
2340
2651
|
/**
|
|
2341
2652
|
* Returns all queries from EventCatalog
|
|
2342
2653
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2343
2654
|
* @returns Query[]|Undefined
|
|
2344
2655
|
*/
|
|
2345
|
-
getQueries: getQueries((0,
|
|
2656
|
+
getQueries: getQueries((0, import_node_path22.join)(path8)),
|
|
2346
2657
|
/**
|
|
2347
2658
|
* Adds a query to EventCatalog
|
|
2348
2659
|
*
|
|
@@ -2350,7 +2661,7 @@ var src_default = (path7) => {
|
|
|
2350
2661
|
* @param options - Optional options to write the event
|
|
2351
2662
|
*
|
|
2352
2663
|
*/
|
|
2353
|
-
writeQuery: writeQuery((0,
|
|
2664
|
+
writeQuery: writeQuery((0, import_node_path22.join)(path8, "queries")),
|
|
2354
2665
|
/**
|
|
2355
2666
|
* Adds a query to a service in EventCatalog
|
|
2356
2667
|
*
|
|
@@ -2359,26 +2670,26 @@ var src_default = (path7) => {
|
|
|
2359
2670
|
* @param options - Optional options to write the query
|
|
2360
2671
|
*
|
|
2361
2672
|
*/
|
|
2362
|
-
writeQueryToService: writeQueryToService((0,
|
|
2673
|
+
writeQueryToService: writeQueryToService((0, import_node_path22.join)(path8)),
|
|
2363
2674
|
/**
|
|
2364
2675
|
* Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
|
|
2365
2676
|
*
|
|
2366
2677
|
* @param path - The path to your query, e.g. `/Orders/GetOrder`
|
|
2367
2678
|
*
|
|
2368
2679
|
*/
|
|
2369
|
-
rmQuery: rmQuery((0,
|
|
2680
|
+
rmQuery: rmQuery((0, import_node_path22.join)(path8, "queries")),
|
|
2370
2681
|
/**
|
|
2371
2682
|
* Remove a query by a Query id
|
|
2372
2683
|
*
|
|
2373
2684
|
* @param id - The id of the query you want to remove
|
|
2374
2685
|
*
|
|
2375
2686
|
*/
|
|
2376
|
-
rmQueryById: rmQueryById((0,
|
|
2687
|
+
rmQueryById: rmQueryById((0, import_node_path22.join)(path8)),
|
|
2377
2688
|
/**
|
|
2378
2689
|
* Moves a given query id to the version directory
|
|
2379
2690
|
* @param directory
|
|
2380
2691
|
*/
|
|
2381
|
-
versionQuery: versionQuery((0,
|
|
2692
|
+
versionQuery: versionQuery((0, import_node_path22.join)(path8)),
|
|
2382
2693
|
/**
|
|
2383
2694
|
* Adds a file to the given query
|
|
2384
2695
|
* @param id - The id of the query to add the file to
|
|
@@ -2386,7 +2697,7 @@ var src_default = (path7) => {
|
|
|
2386
2697
|
* @param version - Optional version of the query to add the file to
|
|
2387
2698
|
* @returns
|
|
2388
2699
|
*/
|
|
2389
|
-
addFileToQuery: addFileToQuery((0,
|
|
2700
|
+
addFileToQuery: addFileToQuery((0, import_node_path22.join)(path8)),
|
|
2390
2701
|
/**
|
|
2391
2702
|
* Adds a schema to the given query
|
|
2392
2703
|
* @param id - The id of the query to add the schema to
|
|
@@ -2394,14 +2705,14 @@ var src_default = (path7) => {
|
|
|
2394
2705
|
* @param version - Optional version of the query to add the schema to
|
|
2395
2706
|
* @returns
|
|
2396
2707
|
*/
|
|
2397
|
-
addSchemaToQuery: addSchemaToQuery((0,
|
|
2708
|
+
addSchemaToQuery: addSchemaToQuery((0, import_node_path22.join)(path8)),
|
|
2398
2709
|
/**
|
|
2399
2710
|
* Check to see if an query version exists
|
|
2400
2711
|
* @param id - The id of the query
|
|
2401
2712
|
* @param version - The version of the query (supports semver)
|
|
2402
2713
|
* @returns
|
|
2403
2714
|
*/
|
|
2404
|
-
queryHasVersion: queryHasVersion((0,
|
|
2715
|
+
queryHasVersion: queryHasVersion((0, import_node_path22.join)(path8)),
|
|
2405
2716
|
/**
|
|
2406
2717
|
* ================================
|
|
2407
2718
|
* Channels
|
|
@@ -2413,13 +2724,13 @@ var src_default = (path7) => {
|
|
|
2413
2724
|
* @param version - Optional id of the version to get (supports semver)
|
|
2414
2725
|
* @returns Channel|Undefined
|
|
2415
2726
|
*/
|
|
2416
|
-
getChannel: getChannel((0,
|
|
2727
|
+
getChannel: getChannel((0, import_node_path22.join)(path8)),
|
|
2417
2728
|
/**
|
|
2418
2729
|
* Returns all channels from EventCatalog
|
|
2419
2730
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2420
2731
|
* @returns Channel[]|Undefined
|
|
2421
2732
|
*/
|
|
2422
|
-
getChannels: getChannels((0,
|
|
2733
|
+
getChannels: getChannels((0, import_node_path22.join)(path8)),
|
|
2423
2734
|
/**
|
|
2424
2735
|
* Adds an channel to EventCatalog
|
|
2425
2736
|
*
|
|
@@ -2427,33 +2738,33 @@ var src_default = (path7) => {
|
|
|
2427
2738
|
* @param options - Optional options to write the channel
|
|
2428
2739
|
*
|
|
2429
2740
|
*/
|
|
2430
|
-
writeChannel: writeChannel((0,
|
|
2741
|
+
writeChannel: writeChannel((0, import_node_path22.join)(path8, "channels")),
|
|
2431
2742
|
/**
|
|
2432
2743
|
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
2433
2744
|
*
|
|
2434
2745
|
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
2435
2746
|
*
|
|
2436
2747
|
*/
|
|
2437
|
-
rmChannel: rmChannel((0,
|
|
2748
|
+
rmChannel: rmChannel((0, import_node_path22.join)(path8, "channels")),
|
|
2438
2749
|
/**
|
|
2439
2750
|
* Remove an channel by an Event id
|
|
2440
2751
|
*
|
|
2441
2752
|
* @param id - The id of the channel you want to remove
|
|
2442
2753
|
*
|
|
2443
2754
|
*/
|
|
2444
|
-
rmChannelById: rmChannelById((0,
|
|
2755
|
+
rmChannelById: rmChannelById((0, import_node_path22.join)(path8)),
|
|
2445
2756
|
/**
|
|
2446
2757
|
* Moves a given channel id to the version directory
|
|
2447
2758
|
* @param directory
|
|
2448
2759
|
*/
|
|
2449
|
-
versionChannel: versionChannel((0,
|
|
2760
|
+
versionChannel: versionChannel((0, import_node_path22.join)(path8)),
|
|
2450
2761
|
/**
|
|
2451
2762
|
* Check to see if a channel version exists
|
|
2452
2763
|
* @param id - The id of the channel
|
|
2453
2764
|
* @param version - The version of the channel (supports semver)
|
|
2454
2765
|
* @returns
|
|
2455
2766
|
*/
|
|
2456
|
-
channelHasVersion: channelHasVersion((0,
|
|
2767
|
+
channelHasVersion: channelHasVersion((0, import_node_path22.join)(path8)),
|
|
2457
2768
|
/**
|
|
2458
2769
|
* Add a channel to an event
|
|
2459
2770
|
*
|
|
@@ -2470,7 +2781,7 @@ var src_default = (path7) => {
|
|
|
2470
2781
|
*
|
|
2471
2782
|
* ```
|
|
2472
2783
|
*/
|
|
2473
|
-
addEventToChannel: addMessageToChannel((0,
|
|
2784
|
+
addEventToChannel: addMessageToChannel((0, import_node_path22.join)(path8), "events"),
|
|
2474
2785
|
/**
|
|
2475
2786
|
* Add a channel to an command
|
|
2476
2787
|
*
|
|
@@ -2487,7 +2798,7 @@ var src_default = (path7) => {
|
|
|
2487
2798
|
*
|
|
2488
2799
|
* ```
|
|
2489
2800
|
*/
|
|
2490
|
-
addCommandToChannel: addMessageToChannel((0,
|
|
2801
|
+
addCommandToChannel: addMessageToChannel((0, import_node_path22.join)(path8), "commands"),
|
|
2491
2802
|
/**
|
|
2492
2803
|
* Add a channel to an query
|
|
2493
2804
|
*
|
|
@@ -2504,7 +2815,7 @@ var src_default = (path7) => {
|
|
|
2504
2815
|
*
|
|
2505
2816
|
* ```
|
|
2506
2817
|
*/
|
|
2507
|
-
addQueryToChannel: addMessageToChannel((0,
|
|
2818
|
+
addQueryToChannel: addMessageToChannel((0, import_node_path22.join)(path8), "queries"),
|
|
2508
2819
|
/**
|
|
2509
2820
|
* ================================
|
|
2510
2821
|
* SERVICES
|
|
@@ -2517,14 +2828,14 @@ var src_default = (path7) => {
|
|
|
2517
2828
|
* @param options - Optional options to write the event
|
|
2518
2829
|
*
|
|
2519
2830
|
*/
|
|
2520
|
-
writeService: writeService((0,
|
|
2831
|
+
writeService: writeService((0, import_node_path22.join)(path8, "services")),
|
|
2521
2832
|
/**
|
|
2522
2833
|
* Adds a versioned service to EventCatalog
|
|
2523
2834
|
*
|
|
2524
2835
|
* @param service - The service to write
|
|
2525
2836
|
*
|
|
2526
2837
|
*/
|
|
2527
|
-
writeVersionedService: writeVersionedService((0,
|
|
2838
|
+
writeVersionedService: writeVersionedService((0, import_node_path22.join)(path8, "services")),
|
|
2528
2839
|
/**
|
|
2529
2840
|
* Adds a service to a domain in EventCatalog
|
|
2530
2841
|
*
|
|
@@ -2533,45 +2844,45 @@ var src_default = (path7) => {
|
|
|
2533
2844
|
* @param options - Optional options to write the event
|
|
2534
2845
|
*
|
|
2535
2846
|
*/
|
|
2536
|
-
writeServiceToDomain: writeServiceToDomain((0,
|
|
2847
|
+
writeServiceToDomain: writeServiceToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2537
2848
|
/**
|
|
2538
2849
|
* Returns a service from EventCatalog
|
|
2539
2850
|
* @param id - The id of the service to retrieve
|
|
2540
2851
|
* @param version - Optional id of the version to get (supports semver)
|
|
2541
2852
|
* @returns Service|Undefined
|
|
2542
2853
|
*/
|
|
2543
|
-
getService: getService((0,
|
|
2854
|
+
getService: getService((0, import_node_path22.join)(path8)),
|
|
2544
2855
|
/**
|
|
2545
2856
|
* Returns a service from EventCatalog by it's path.
|
|
2546
2857
|
* @param path - The path to the service to retrieve
|
|
2547
2858
|
* @returns Service|Undefined
|
|
2548
2859
|
*/
|
|
2549
|
-
getServiceByPath: getServiceByPath((0,
|
|
2860
|
+
getServiceByPath: getServiceByPath((0, import_node_path22.join)(path8)),
|
|
2550
2861
|
/**
|
|
2551
2862
|
* Returns all services from EventCatalog
|
|
2552
2863
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2553
2864
|
* @returns Service[]|Undefined
|
|
2554
2865
|
*/
|
|
2555
|
-
getServices: getServices((0,
|
|
2866
|
+
getServices: getServices((0, import_node_path22.join)(path8)),
|
|
2556
2867
|
/**
|
|
2557
2868
|
* Moves a given service id to the version directory
|
|
2558
2869
|
* @param directory
|
|
2559
2870
|
*/
|
|
2560
|
-
versionService: versionService((0,
|
|
2871
|
+
versionService: versionService((0, import_node_path22.join)(path8)),
|
|
2561
2872
|
/**
|
|
2562
2873
|
* Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
|
|
2563
2874
|
*
|
|
2564
2875
|
* @param path - The path to your service, e.g. `/InventoryService`
|
|
2565
2876
|
*
|
|
2566
2877
|
*/
|
|
2567
|
-
rmService: rmService((0,
|
|
2878
|
+
rmService: rmService((0, import_node_path22.join)(path8, "services")),
|
|
2568
2879
|
/**
|
|
2569
2880
|
* Remove an service by an service id
|
|
2570
2881
|
*
|
|
2571
2882
|
* @param id - The id of the service you want to remove
|
|
2572
2883
|
*
|
|
2573
2884
|
*/
|
|
2574
|
-
rmServiceById: rmServiceById((0,
|
|
2885
|
+
rmServiceById: rmServiceById((0, import_node_path22.join)(path8)),
|
|
2575
2886
|
/**
|
|
2576
2887
|
* Adds a file to the given service
|
|
2577
2888
|
* @param id - The id of the service to add the file to
|
|
@@ -2579,21 +2890,21 @@ var src_default = (path7) => {
|
|
|
2579
2890
|
* @param version - Optional version of the service to add the file to
|
|
2580
2891
|
* @returns
|
|
2581
2892
|
*/
|
|
2582
|
-
addFileToService: addFileToService((0,
|
|
2893
|
+
addFileToService: addFileToService((0, import_node_path22.join)(path8)),
|
|
2583
2894
|
/**
|
|
2584
2895
|
* Returns the specifications for a given service
|
|
2585
2896
|
* @param id - The id of the service to retrieve the specifications for
|
|
2586
2897
|
* @param version - Optional version of the service
|
|
2587
2898
|
* @returns
|
|
2588
2899
|
*/
|
|
2589
|
-
getSpecificationFilesForService: getSpecificationFilesForService((0,
|
|
2900
|
+
getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path22.join)(path8)),
|
|
2590
2901
|
/**
|
|
2591
2902
|
* Check to see if a service version exists
|
|
2592
2903
|
* @param id - The id of the service
|
|
2593
2904
|
* @param version - The version of the service (supports semver)
|
|
2594
2905
|
* @returns
|
|
2595
2906
|
*/
|
|
2596
|
-
serviceHasVersion: serviceHasVersion((0,
|
|
2907
|
+
serviceHasVersion: serviceHasVersion((0, import_node_path22.join)(path8)),
|
|
2597
2908
|
/**
|
|
2598
2909
|
* Add an event to a service by it's id.
|
|
2599
2910
|
*
|
|
@@ -2613,7 +2924,7 @@ var src_default = (path7) => {
|
|
|
2613
2924
|
*
|
|
2614
2925
|
* ```
|
|
2615
2926
|
*/
|
|
2616
|
-
addEventToService: addMessageToService((0,
|
|
2927
|
+
addEventToService: addMessageToService((0, import_node_path22.join)(path8)),
|
|
2617
2928
|
/**
|
|
2618
2929
|
* Add a data store to a service by it's id.
|
|
2619
2930
|
*
|
|
@@ -2630,7 +2941,7 @@ var src_default = (path7) => {
|
|
|
2630
2941
|
*
|
|
2631
2942
|
* ```
|
|
2632
2943
|
*/
|
|
2633
|
-
addDataStoreToService: addDataStoreToService((0,
|
|
2944
|
+
addDataStoreToService: addDataStoreToService((0, import_node_path22.join)(path8)),
|
|
2634
2945
|
/**
|
|
2635
2946
|
* Add a command to a service by it's id.
|
|
2636
2947
|
*
|
|
@@ -2650,7 +2961,7 @@ var src_default = (path7) => {
|
|
|
2650
2961
|
*
|
|
2651
2962
|
* ```
|
|
2652
2963
|
*/
|
|
2653
|
-
addCommandToService: addMessageToService((0,
|
|
2964
|
+
addCommandToService: addMessageToService((0, import_node_path22.join)(path8)),
|
|
2654
2965
|
/**
|
|
2655
2966
|
* Add a query to a service by it's id.
|
|
2656
2967
|
*
|
|
@@ -2670,7 +2981,7 @@ var src_default = (path7) => {
|
|
|
2670
2981
|
*
|
|
2671
2982
|
* ```
|
|
2672
2983
|
*/
|
|
2673
|
-
addQueryToService: addMessageToService((0,
|
|
2984
|
+
addQueryToService: addMessageToService((0, import_node_path22.join)(path8)),
|
|
2674
2985
|
/**
|
|
2675
2986
|
* Add an entity to a service by its id.
|
|
2676
2987
|
*
|
|
@@ -2688,7 +2999,7 @@ var src_default = (path7) => {
|
|
|
2688
2999
|
*
|
|
2689
3000
|
* ```
|
|
2690
3001
|
*/
|
|
2691
|
-
addEntityToService: addEntityToService((0,
|
|
3002
|
+
addEntityToService: addEntityToService((0, import_node_path22.join)(path8)),
|
|
2692
3003
|
/**
|
|
2693
3004
|
* Check to see if a service exists by it's path.
|
|
2694
3005
|
*
|
|
@@ -2705,13 +3016,13 @@ var src_default = (path7) => {
|
|
|
2705
3016
|
* @param path - The path to the service to check
|
|
2706
3017
|
* @returns boolean
|
|
2707
3018
|
*/
|
|
2708
|
-
isService: isService((0,
|
|
3019
|
+
isService: isService((0, import_node_path22.join)(path8)),
|
|
2709
3020
|
/**
|
|
2710
3021
|
* Converts a file to a service.
|
|
2711
3022
|
* @param file - The file to convert to a service.
|
|
2712
3023
|
* @returns The service.
|
|
2713
3024
|
*/
|
|
2714
|
-
toService: toService((0,
|
|
3025
|
+
toService: toService((0, import_node_path22.join)(path8)),
|
|
2715
3026
|
/**
|
|
2716
3027
|
* ================================
|
|
2717
3028
|
* Domains
|
|
@@ -2724,39 +3035,39 @@ var src_default = (path7) => {
|
|
|
2724
3035
|
* @param options - Optional options to write the event
|
|
2725
3036
|
*
|
|
2726
3037
|
*/
|
|
2727
|
-
writeDomain: writeDomain((0,
|
|
3038
|
+
writeDomain: writeDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2728
3039
|
/**
|
|
2729
3040
|
* Returns a domain from EventCatalog
|
|
2730
3041
|
* @param id - The id of the domain to retrieve
|
|
2731
3042
|
* @param version - Optional id of the version to get (supports semver)
|
|
2732
3043
|
* @returns Domain|Undefined
|
|
2733
3044
|
*/
|
|
2734
|
-
getDomain: getDomain((0,
|
|
3045
|
+
getDomain: getDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2735
3046
|
/**
|
|
2736
3047
|
* Returns all domains from EventCatalog
|
|
2737
3048
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2738
3049
|
* @returns Domain[]|Undefined
|
|
2739
3050
|
*/
|
|
2740
|
-
getDomains: getDomains((0,
|
|
3051
|
+
getDomains: getDomains((0, import_node_path22.join)(path8)),
|
|
2741
3052
|
/**
|
|
2742
3053
|
* Moves a given domain id to the version directory
|
|
2743
3054
|
* @param directory
|
|
2744
3055
|
*/
|
|
2745
|
-
versionDomain: versionDomain((0,
|
|
3056
|
+
versionDomain: versionDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2746
3057
|
/**
|
|
2747
3058
|
* Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
|
|
2748
3059
|
*
|
|
2749
3060
|
* @param path - The path to your domain, e.g. `/Payment`
|
|
2750
3061
|
*
|
|
2751
3062
|
*/
|
|
2752
|
-
rmDomain: rmDomain((0,
|
|
3063
|
+
rmDomain: rmDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2753
3064
|
/**
|
|
2754
3065
|
* Remove an service by an domain id
|
|
2755
3066
|
*
|
|
2756
3067
|
* @param id - The id of the domain you want to remove
|
|
2757
3068
|
*
|
|
2758
3069
|
*/
|
|
2759
|
-
rmDomainById: rmDomainById((0,
|
|
3070
|
+
rmDomainById: rmDomainById((0, import_node_path22.join)(path8, "domains")),
|
|
2760
3071
|
/**
|
|
2761
3072
|
* Adds a file to the given domain
|
|
2762
3073
|
* @param id - The id of the domain to add the file to
|
|
@@ -2764,28 +3075,28 @@ var src_default = (path7) => {
|
|
|
2764
3075
|
* @param version - Optional version of the domain to add the file to
|
|
2765
3076
|
* @returns
|
|
2766
3077
|
*/
|
|
2767
|
-
addFileToDomain: addFileToDomain((0,
|
|
3078
|
+
addFileToDomain: addFileToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2768
3079
|
/**
|
|
2769
3080
|
* Adds an ubiquitous language dictionary to a domain
|
|
2770
3081
|
* @param id - The id of the domain to add the ubiquitous language to
|
|
2771
3082
|
* @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
|
|
2772
3083
|
* @param version - Optional version of the domain to add the ubiquitous language to
|
|
2773
3084
|
*/
|
|
2774
|
-
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0,
|
|
3085
|
+
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2775
3086
|
/**
|
|
2776
3087
|
* Get the ubiquitous language dictionary from a domain
|
|
2777
3088
|
* @param id - The id of the domain to get the ubiquitous language from
|
|
2778
3089
|
* @param version - Optional version of the domain to get the ubiquitous language from
|
|
2779
3090
|
* @returns
|
|
2780
3091
|
*/
|
|
2781
|
-
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0,
|
|
3092
|
+
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2782
3093
|
/**
|
|
2783
3094
|
* Check to see if a domain version exists
|
|
2784
3095
|
* @param id - The id of the domain
|
|
2785
3096
|
* @param version - The version of the domain (supports semver)
|
|
2786
3097
|
* @returns
|
|
2787
3098
|
*/
|
|
2788
|
-
domainHasVersion: domainHasVersion((0,
|
|
3099
|
+
domainHasVersion: domainHasVersion((0, import_node_path22.join)(path8)),
|
|
2789
3100
|
/**
|
|
2790
3101
|
* Adds a given service to a domain
|
|
2791
3102
|
* @param id - The id of the domain
|
|
@@ -2793,7 +3104,7 @@ var src_default = (path7) => {
|
|
|
2793
3104
|
* @param version - (Optional) The version of the domain to add the service to
|
|
2794
3105
|
* @returns
|
|
2795
3106
|
*/
|
|
2796
|
-
addServiceToDomain: addServiceToDomain((0,
|
|
3107
|
+
addServiceToDomain: addServiceToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2797
3108
|
/**
|
|
2798
3109
|
* Adds a given subdomain to a domain
|
|
2799
3110
|
* @param id - The id of the domain
|
|
@@ -2801,7 +3112,7 @@ var src_default = (path7) => {
|
|
|
2801
3112
|
* @param version - (Optional) The version of the domain to add the subdomain to
|
|
2802
3113
|
* @returns
|
|
2803
3114
|
*/
|
|
2804
|
-
addSubDomainToDomain: addSubDomainToDomain((0,
|
|
3115
|
+
addSubDomainToDomain: addSubDomainToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2805
3116
|
/**
|
|
2806
3117
|
* Adds an entity to a domain
|
|
2807
3118
|
* @param id - The id of the domain
|
|
@@ -2809,7 +3120,7 @@ var src_default = (path7) => {
|
|
|
2809
3120
|
* @param version - (Optional) The version of the domain to add the entity to
|
|
2810
3121
|
* @returns
|
|
2811
3122
|
*/
|
|
2812
|
-
addEntityToDomain: addEntityToDomain((0,
|
|
3123
|
+
addEntityToDomain: addEntityToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2813
3124
|
/**
|
|
2814
3125
|
* Add an event to a domain by its id.
|
|
2815
3126
|
*
|
|
@@ -2827,7 +3138,7 @@ var src_default = (path7) => {
|
|
|
2827
3138
|
*
|
|
2828
3139
|
* ```
|
|
2829
3140
|
*/
|
|
2830
|
-
addEventToDomain: addMessageToDomain((0,
|
|
3141
|
+
addEventToDomain: addMessageToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2831
3142
|
/**
|
|
2832
3143
|
* Add a command to a domain by its id.
|
|
2833
3144
|
*
|
|
@@ -2845,7 +3156,7 @@ var src_default = (path7) => {
|
|
|
2845
3156
|
*
|
|
2846
3157
|
* ```
|
|
2847
3158
|
*/
|
|
2848
|
-
addCommandToDomain: addMessageToDomain((0,
|
|
3159
|
+
addCommandToDomain: addMessageToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2849
3160
|
/**
|
|
2850
3161
|
* Add a query to a domain by its id.
|
|
2851
3162
|
*
|
|
@@ -2863,7 +3174,7 @@ var src_default = (path7) => {
|
|
|
2863
3174
|
*
|
|
2864
3175
|
* ```
|
|
2865
3176
|
*/
|
|
2866
|
-
addQueryToDomain: addMessageToDomain((0,
|
|
3177
|
+
addQueryToDomain: addMessageToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2867
3178
|
/**
|
|
2868
3179
|
* ================================
|
|
2869
3180
|
* Teams
|
|
@@ -2876,25 +3187,25 @@ var src_default = (path7) => {
|
|
|
2876
3187
|
* @param options - Optional options to write the team
|
|
2877
3188
|
*
|
|
2878
3189
|
*/
|
|
2879
|
-
writeTeam: writeTeam((0,
|
|
3190
|
+
writeTeam: writeTeam((0, import_node_path22.join)(path8, "teams")),
|
|
2880
3191
|
/**
|
|
2881
3192
|
* Returns a team from EventCatalog
|
|
2882
3193
|
* @param id - The id of the team to retrieve
|
|
2883
3194
|
* @returns Team|Undefined
|
|
2884
3195
|
*/
|
|
2885
|
-
getTeam: getTeam((0,
|
|
3196
|
+
getTeam: getTeam((0, import_node_path22.join)(path8, "teams")),
|
|
2886
3197
|
/**
|
|
2887
3198
|
* Returns all teams from EventCatalog
|
|
2888
3199
|
* @returns Team[]|Undefined
|
|
2889
3200
|
*/
|
|
2890
|
-
getTeams: getTeams((0,
|
|
3201
|
+
getTeams: getTeams((0, import_node_path22.join)(path8, "teams")),
|
|
2891
3202
|
/**
|
|
2892
3203
|
* Remove a team by the team id
|
|
2893
3204
|
*
|
|
2894
3205
|
* @param id - The id of the team you want to remove
|
|
2895
3206
|
*
|
|
2896
3207
|
*/
|
|
2897
|
-
rmTeamById: rmTeamById((0,
|
|
3208
|
+
rmTeamById: rmTeamById((0, import_node_path22.join)(path8, "teams")),
|
|
2898
3209
|
/**
|
|
2899
3210
|
* ================================
|
|
2900
3211
|
* Users
|
|
@@ -2907,25 +3218,25 @@ var src_default = (path7) => {
|
|
|
2907
3218
|
* @param options - Optional options to write the user
|
|
2908
3219
|
*
|
|
2909
3220
|
*/
|
|
2910
|
-
writeUser: writeUser((0,
|
|
3221
|
+
writeUser: writeUser((0, import_node_path22.join)(path8, "users")),
|
|
2911
3222
|
/**
|
|
2912
3223
|
* Returns a user from EventCatalog
|
|
2913
3224
|
* @param id - The id of the user to retrieve
|
|
2914
3225
|
* @returns User|Undefined
|
|
2915
3226
|
*/
|
|
2916
|
-
getUser: getUser((0,
|
|
3227
|
+
getUser: getUser((0, import_node_path22.join)(path8, "users")),
|
|
2917
3228
|
/**
|
|
2918
3229
|
* Returns all user from EventCatalog
|
|
2919
3230
|
* @returns User[]|Undefined
|
|
2920
3231
|
*/
|
|
2921
|
-
getUsers: getUsers((0,
|
|
3232
|
+
getUsers: getUsers((0, import_node_path22.join)(path8)),
|
|
2922
3233
|
/**
|
|
2923
3234
|
* Remove a user by the user id
|
|
2924
3235
|
*
|
|
2925
3236
|
* @param id - The id of the user you want to remove
|
|
2926
3237
|
*
|
|
2927
3238
|
*/
|
|
2928
|
-
rmUserById: rmUserById((0,
|
|
3239
|
+
rmUserById: rmUserById((0, import_node_path22.join)(path8, "users")),
|
|
2929
3240
|
/**
|
|
2930
3241
|
* ================================
|
|
2931
3242
|
* Custom Docs
|
|
@@ -2936,32 +3247,32 @@ var src_default = (path7) => {
|
|
|
2936
3247
|
* @param path - The path to the custom doc to retrieve
|
|
2937
3248
|
* @returns CustomDoc|Undefined
|
|
2938
3249
|
*/
|
|
2939
|
-
getCustomDoc: getCustomDoc((0,
|
|
3250
|
+
getCustomDoc: getCustomDoc((0, import_node_path22.join)(path8, "docs")),
|
|
2940
3251
|
/**
|
|
2941
3252
|
* Returns all custom docs from EventCatalog
|
|
2942
3253
|
* @param options - Optional options to get custom docs from a specific path
|
|
2943
3254
|
* @returns CustomDoc[]|Undefined
|
|
2944
3255
|
*/
|
|
2945
|
-
getCustomDocs: getCustomDocs((0,
|
|
3256
|
+
getCustomDocs: getCustomDocs((0, import_node_path22.join)(path8, "docs")),
|
|
2946
3257
|
/**
|
|
2947
3258
|
* Writes a custom doc to EventCatalog
|
|
2948
3259
|
* @param customDoc - The custom doc to write
|
|
2949
3260
|
* @param options - Optional options to write the custom doc
|
|
2950
3261
|
*
|
|
2951
3262
|
*/
|
|
2952
|
-
writeCustomDoc: writeCustomDoc((0,
|
|
3263
|
+
writeCustomDoc: writeCustomDoc((0, import_node_path22.join)(path8, "docs")),
|
|
2953
3264
|
/**
|
|
2954
3265
|
* Removes a custom doc from EventCatalog
|
|
2955
3266
|
* @param path - The path to the custom doc to remove
|
|
2956
3267
|
*
|
|
2957
3268
|
*/
|
|
2958
|
-
rmCustomDoc: rmCustomDoc((0,
|
|
3269
|
+
rmCustomDoc: rmCustomDoc((0, import_node_path22.join)(path8, "docs")),
|
|
2959
3270
|
/**
|
|
2960
3271
|
* Dumps the catalog to a JSON file.
|
|
2961
3272
|
* @param directory - The directory to dump the catalog to
|
|
2962
3273
|
* @returns A JSON file with the catalog
|
|
2963
3274
|
*/
|
|
2964
|
-
dumpCatalog: dumpCatalog((0,
|
|
3275
|
+
dumpCatalog: dumpCatalog((0, import_node_path22.join)(path8)),
|
|
2965
3276
|
/**
|
|
2966
3277
|
* Returns the event catalog configuration file.
|
|
2967
3278
|
* The event catalog configuration file is the file that contains the configuration for the event catalog.
|
|
@@ -2969,7 +3280,7 @@ var src_default = (path7) => {
|
|
|
2969
3280
|
* @param directory - The directory of the catalog.
|
|
2970
3281
|
* @returns A JSON object with the configuration for the event catalog.
|
|
2971
3282
|
*/
|
|
2972
|
-
getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0,
|
|
3283
|
+
getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path22.join)(path8)),
|
|
2973
3284
|
/**
|
|
2974
3285
|
* ================================
|
|
2975
3286
|
* Changelogs
|
|
@@ -2983,7 +3294,7 @@ var src_default = (path7) => {
|
|
|
2983
3294
|
* @param options - Optional options (version, format)
|
|
2984
3295
|
*
|
|
2985
3296
|
*/
|
|
2986
|
-
writeChangelog: writeChangelog((0,
|
|
3297
|
+
writeChangelog: writeChangelog((0, import_node_path22.join)(path8)),
|
|
2987
3298
|
/**
|
|
2988
3299
|
* Appends a changelog entry to an existing changelog for a resource.
|
|
2989
3300
|
* If no changelog exists, one is created.
|
|
@@ -2993,7 +3304,7 @@ var src_default = (path7) => {
|
|
|
2993
3304
|
* @param options - Optional options (version, format)
|
|
2994
3305
|
*
|
|
2995
3306
|
*/
|
|
2996
|
-
appendChangelog: appendChangelog((0,
|
|
3307
|
+
appendChangelog: appendChangelog((0, import_node_path22.join)(path8)),
|
|
2997
3308
|
/**
|
|
2998
3309
|
* Returns the changelog for a resource in EventCatalog
|
|
2999
3310
|
*
|
|
@@ -3001,7 +3312,7 @@ var src_default = (path7) => {
|
|
|
3001
3312
|
* @param options - Optional options (version)
|
|
3002
3313
|
* @returns Changelog|Undefined
|
|
3003
3314
|
*/
|
|
3004
|
-
getChangelog: getChangelog((0,
|
|
3315
|
+
getChangelog: getChangelog((0, import_node_path22.join)(path8)),
|
|
3005
3316
|
/**
|
|
3006
3317
|
* Removes the changelog for a resource in EventCatalog
|
|
3007
3318
|
*
|
|
@@ -3009,7 +3320,7 @@ var src_default = (path7) => {
|
|
|
3009
3320
|
* @param options - Optional options (version)
|
|
3010
3321
|
*
|
|
3011
3322
|
*/
|
|
3012
|
-
rmChangelog: rmChangelog((0,
|
|
3323
|
+
rmChangelog: rmChangelog((0, import_node_path22.join)(path8)),
|
|
3013
3324
|
/**
|
|
3014
3325
|
* ================================
|
|
3015
3326
|
* Resources Utils
|
|
@@ -3034,33 +3345,33 @@ var src_default = (path7) => {
|
|
|
3034
3345
|
* @param path - The path to the message to retrieve
|
|
3035
3346
|
* @returns Message|Undefined
|
|
3036
3347
|
*/
|
|
3037
|
-
getMessageBySchemaPath: getMessageBySchemaPath((0,
|
|
3348
|
+
getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path22.join)(path8)),
|
|
3038
3349
|
/**
|
|
3039
3350
|
* Returns the producers and consumers (services) for a given message
|
|
3040
3351
|
* @param id - The id of the message to get the producers and consumers for
|
|
3041
3352
|
* @param version - Optional version of the message
|
|
3042
3353
|
* @returns { producers: Service[], consumers: Service[] }
|
|
3043
3354
|
*/
|
|
3044
|
-
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0,
|
|
3355
|
+
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path22.join)(path8)),
|
|
3045
3356
|
/**
|
|
3046
3357
|
* Returns the consumers of a given schema path
|
|
3047
3358
|
* @param path - The path to the schema to get the consumers for
|
|
3048
3359
|
* @returns Service[]
|
|
3049
3360
|
*/
|
|
3050
|
-
getConsumersOfSchema: getConsumersOfSchema((0,
|
|
3361
|
+
getConsumersOfSchema: getConsumersOfSchema((0, import_node_path22.join)(path8)),
|
|
3051
3362
|
/**
|
|
3052
3363
|
* Returns the producers of a given schema path
|
|
3053
3364
|
* @param path - The path to the schema to get the producers for
|
|
3054
3365
|
* @returns Service[]
|
|
3055
3366
|
*/
|
|
3056
|
-
getProducersOfSchema: getProducersOfSchema((0,
|
|
3367
|
+
getProducersOfSchema: getProducersOfSchema((0, import_node_path22.join)(path8)),
|
|
3057
3368
|
/**
|
|
3058
3369
|
* Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
|
|
3059
3370
|
* @param id - The id of the resource to get the owners for
|
|
3060
3371
|
* @param version - Optional version of the resource
|
|
3061
3372
|
* @returns { owners: User[] }
|
|
3062
3373
|
*/
|
|
3063
|
-
getOwnersForResource: getOwnersForResource((0,
|
|
3374
|
+
getOwnersForResource: getOwnersForResource((0, import_node_path22.join)(path8)),
|
|
3064
3375
|
/**
|
|
3065
3376
|
* ================================
|
|
3066
3377
|
* Entities
|
|
@@ -3072,13 +3383,13 @@ var src_default = (path7) => {
|
|
|
3072
3383
|
* @param version - Optional id of the version to get (supports semver)
|
|
3073
3384
|
* @returns Entity|Undefined
|
|
3074
3385
|
*/
|
|
3075
|
-
getEntity: getEntity((0,
|
|
3386
|
+
getEntity: getEntity((0, import_node_path22.join)(path8)),
|
|
3076
3387
|
/**
|
|
3077
3388
|
* Returns all entities from EventCatalog
|
|
3078
3389
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
3079
3390
|
* @returns Entity[]|Undefined
|
|
3080
3391
|
*/
|
|
3081
|
-
getEntities: getEntities((0,
|
|
3392
|
+
getEntities: getEntities((0, import_node_path22.join)(path8)),
|
|
3082
3393
|
/**
|
|
3083
3394
|
* Adds an entity to EventCatalog
|
|
3084
3395
|
*
|
|
@@ -3086,33 +3397,33 @@ var src_default = (path7) => {
|
|
|
3086
3397
|
* @param options - Optional options to write the entity
|
|
3087
3398
|
*
|
|
3088
3399
|
*/
|
|
3089
|
-
writeEntity: writeEntity((0,
|
|
3400
|
+
writeEntity: writeEntity((0, import_node_path22.join)(path8, "entities")),
|
|
3090
3401
|
/**
|
|
3091
3402
|
* Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
|
|
3092
3403
|
*
|
|
3093
3404
|
* @param path - The path to your entity, e.g. `/User`
|
|
3094
3405
|
*
|
|
3095
3406
|
*/
|
|
3096
|
-
rmEntity: rmEntity((0,
|
|
3407
|
+
rmEntity: rmEntity((0, import_node_path22.join)(path8, "entities")),
|
|
3097
3408
|
/**
|
|
3098
3409
|
* Remove an entity by an entity id
|
|
3099
3410
|
*
|
|
3100
3411
|
* @param id - The id of the entity you want to remove
|
|
3101
3412
|
*
|
|
3102
3413
|
*/
|
|
3103
|
-
rmEntityById: rmEntityById((0,
|
|
3414
|
+
rmEntityById: rmEntityById((0, import_node_path22.join)(path8)),
|
|
3104
3415
|
/**
|
|
3105
3416
|
* Moves a given entity id to the version directory
|
|
3106
3417
|
* @param id - The id of the entity to version
|
|
3107
3418
|
*/
|
|
3108
|
-
versionEntity: versionEntity((0,
|
|
3419
|
+
versionEntity: versionEntity((0, import_node_path22.join)(path8)),
|
|
3109
3420
|
/**
|
|
3110
3421
|
* Check to see if an entity version exists
|
|
3111
3422
|
* @param id - The id of the entity
|
|
3112
3423
|
* @param version - The version of the entity (supports semver)
|
|
3113
3424
|
* @returns
|
|
3114
3425
|
*/
|
|
3115
|
-
entityHasVersion: entityHasVersion((0,
|
|
3426
|
+
entityHasVersion: entityHasVersion((0, import_node_path22.join)(path8)),
|
|
3116
3427
|
/**
|
|
3117
3428
|
* ================================
|
|
3118
3429
|
* Data Stores
|
|
@@ -3124,42 +3435,42 @@ var src_default = (path7) => {
|
|
|
3124
3435
|
* @param options - Optional options to write the data store
|
|
3125
3436
|
*
|
|
3126
3437
|
*/
|
|
3127
|
-
writeDataStore: writeDataStore((0,
|
|
3438
|
+
writeDataStore: writeDataStore((0, import_node_path22.join)(path8, "containers")),
|
|
3128
3439
|
/**
|
|
3129
3440
|
* Returns a data store from EventCatalog
|
|
3130
3441
|
* @param id - The id of the data store to retrieve
|
|
3131
3442
|
* @param version - Optional id of the version to get (supports semver)
|
|
3132
3443
|
* @returns Container|Undefined
|
|
3133
3444
|
*/
|
|
3134
|
-
getDataStore: getDataStore((0,
|
|
3445
|
+
getDataStore: getDataStore((0, import_node_path22.join)(path8)),
|
|
3135
3446
|
/**
|
|
3136
3447
|
* Returns all data stores from EventCatalog
|
|
3137
3448
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
3138
3449
|
* @returns Container[]|Undefined
|
|
3139
3450
|
*/
|
|
3140
|
-
getDataStores: getDataStores((0,
|
|
3451
|
+
getDataStores: getDataStores((0, import_node_path22.join)(path8)),
|
|
3141
3452
|
/**
|
|
3142
3453
|
* Version a data store by its id
|
|
3143
3454
|
* @param id - The id of the data store to version
|
|
3144
3455
|
*/
|
|
3145
|
-
versionDataStore: versionDataStore((0,
|
|
3456
|
+
versionDataStore: versionDataStore((0, import_node_path22.join)(path8, "containers")),
|
|
3146
3457
|
/**
|
|
3147
3458
|
* Remove a data store by its path
|
|
3148
3459
|
* @param path - The path to the data store to remove
|
|
3149
3460
|
*/
|
|
3150
|
-
rmDataStore: rmDataStore((0,
|
|
3461
|
+
rmDataStore: rmDataStore((0, import_node_path22.join)(path8, "containers")),
|
|
3151
3462
|
/**
|
|
3152
3463
|
* Remove a data store by its id
|
|
3153
3464
|
* @param id - The id of the data store to remove
|
|
3154
3465
|
*/
|
|
3155
|
-
rmDataStoreById: rmDataStoreById((0,
|
|
3466
|
+
rmDataStoreById: rmDataStoreById((0, import_node_path22.join)(path8)),
|
|
3156
3467
|
/**
|
|
3157
3468
|
* Check to see if a data store version exists
|
|
3158
3469
|
* @param id - The id of the data store
|
|
3159
3470
|
* @param version - The version of the data store (supports semver)
|
|
3160
3471
|
* @returns
|
|
3161
3472
|
*/
|
|
3162
|
-
dataStoreHasVersion: dataStoreHasVersion((0,
|
|
3473
|
+
dataStoreHasVersion: dataStoreHasVersion((0, import_node_path22.join)(path8)),
|
|
3163
3474
|
/**
|
|
3164
3475
|
* Adds a file to a data store by its id
|
|
3165
3476
|
* @param id - The id of the data store to add the file to
|
|
@@ -3167,14 +3478,14 @@ var src_default = (path7) => {
|
|
|
3167
3478
|
* @param version - Optional version of the data store to add the file to
|
|
3168
3479
|
* @returns
|
|
3169
3480
|
*/
|
|
3170
|
-
addFileToDataStore: addFileToDataStore((0,
|
|
3481
|
+
addFileToDataStore: addFileToDataStore((0, import_node_path22.join)(path8)),
|
|
3171
3482
|
/**
|
|
3172
3483
|
* Writes a data store to a service by its id
|
|
3173
3484
|
* @param dataStore - The data store to write
|
|
3174
3485
|
* @param service - The service to write the data store to
|
|
3175
3486
|
* @returns
|
|
3176
3487
|
*/
|
|
3177
|
-
writeDataStoreToService: writeDataStoreToService((0,
|
|
3488
|
+
writeDataStoreToService: writeDataStoreToService((0, import_node_path22.join)(path8)),
|
|
3178
3489
|
/**
|
|
3179
3490
|
* ================================
|
|
3180
3491
|
* Data Products
|
|
@@ -3186,7 +3497,7 @@ var src_default = (path7) => {
|
|
|
3186
3497
|
* @param options - Optional options to write the data product
|
|
3187
3498
|
*
|
|
3188
3499
|
*/
|
|
3189
|
-
writeDataProduct: writeDataProduct((0,
|
|
3500
|
+
writeDataProduct: writeDataProduct((0, import_node_path22.join)(path8, "data-products")),
|
|
3190
3501
|
/**
|
|
3191
3502
|
* Writes a data product to a domain in EventCatalog
|
|
3192
3503
|
* @param dataProduct - The data product to write
|
|
@@ -3194,43 +3505,43 @@ var src_default = (path7) => {
|
|
|
3194
3505
|
* @param options - Optional options to write the data product
|
|
3195
3506
|
*
|
|
3196
3507
|
*/
|
|
3197
|
-
writeDataProductToDomain: writeDataProductToDomain((0,
|
|
3508
|
+
writeDataProductToDomain: writeDataProductToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
3198
3509
|
/**
|
|
3199
3510
|
* Returns a data product from EventCatalog
|
|
3200
3511
|
* @param id - The id of the data product to retrieve
|
|
3201
3512
|
* @param version - Optional id of the version to get (supports semver)
|
|
3202
3513
|
* @returns DataProduct|Undefined
|
|
3203
3514
|
*/
|
|
3204
|
-
getDataProduct: getDataProduct((0,
|
|
3515
|
+
getDataProduct: getDataProduct((0, import_node_path22.join)(path8)),
|
|
3205
3516
|
/**
|
|
3206
3517
|
* Returns all data products from EventCatalog
|
|
3207
3518
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
3208
3519
|
* @returns DataProduct[]|Undefined
|
|
3209
3520
|
*/
|
|
3210
|
-
getDataProducts: getDataProducts((0,
|
|
3521
|
+
getDataProducts: getDataProducts((0, import_node_path22.join)(path8)),
|
|
3211
3522
|
/**
|
|
3212
3523
|
* Version a data product by its id
|
|
3213
3524
|
* @param id - The id of the data product to version
|
|
3214
3525
|
*/
|
|
3215
|
-
versionDataProduct: versionDataProduct((0,
|
|
3526
|
+
versionDataProduct: versionDataProduct((0, import_node_path22.join)(path8)),
|
|
3216
3527
|
/**
|
|
3217
3528
|
* Remove a data product by its path
|
|
3218
3529
|
* @param path - The path to the data product to remove
|
|
3219
3530
|
*/
|
|
3220
|
-
rmDataProduct: rmDataProduct((0,
|
|
3531
|
+
rmDataProduct: rmDataProduct((0, import_node_path22.join)(path8, "data-products")),
|
|
3221
3532
|
/**
|
|
3222
3533
|
* Remove a data product by its id
|
|
3223
3534
|
* @param id - The id of the data product to remove
|
|
3224
3535
|
* @param version - Optional version of the data product to remove
|
|
3225
3536
|
*/
|
|
3226
|
-
rmDataProductById: rmDataProductById((0,
|
|
3537
|
+
rmDataProductById: rmDataProductById((0, import_node_path22.join)(path8)),
|
|
3227
3538
|
/**
|
|
3228
3539
|
* Check to see if a data product version exists
|
|
3229
3540
|
* @param id - The id of the data product
|
|
3230
3541
|
* @param version - The version of the data product (supports semver)
|
|
3231
3542
|
* @returns
|
|
3232
3543
|
*/
|
|
3233
|
-
dataProductHasVersion: dataProductHasVersion((0,
|
|
3544
|
+
dataProductHasVersion: dataProductHasVersion((0, import_node_path22.join)(path8)),
|
|
3234
3545
|
/**
|
|
3235
3546
|
* Adds a file to a data product by its id
|
|
3236
3547
|
* @param id - The id of the data product to add the file to
|
|
@@ -3238,7 +3549,7 @@ var src_default = (path7) => {
|
|
|
3238
3549
|
* @param version - Optional version of the data product to add the file to
|
|
3239
3550
|
* @returns
|
|
3240
3551
|
*/
|
|
3241
|
-
addFileToDataProduct: addFileToDataProduct((0,
|
|
3552
|
+
addFileToDataProduct: addFileToDataProduct((0, import_node_path22.join)(path8)),
|
|
3242
3553
|
/**
|
|
3243
3554
|
* Adds a data product to a domain
|
|
3244
3555
|
* @param id - The id of the domain
|
|
@@ -3246,7 +3557,7 @@ var src_default = (path7) => {
|
|
|
3246
3557
|
* @param version - (Optional) The version of the domain to add the data product to
|
|
3247
3558
|
* @returns
|
|
3248
3559
|
*/
|
|
3249
|
-
addDataProductToDomain: addDataProductToDomain((0,
|
|
3560
|
+
addDataProductToDomain: addDataProductToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
3250
3561
|
/**
|
|
3251
3562
|
* ================================
|
|
3252
3563
|
* Diagrams
|
|
@@ -3258,13 +3569,13 @@ var src_default = (path7) => {
|
|
|
3258
3569
|
* @param version - Optional id of the version to get (supports semver)
|
|
3259
3570
|
* @returns Diagram|Undefined
|
|
3260
3571
|
*/
|
|
3261
|
-
getDiagram: getDiagram((0,
|
|
3572
|
+
getDiagram: getDiagram((0, import_node_path22.join)(path8)),
|
|
3262
3573
|
/**
|
|
3263
3574
|
* Returns all diagrams from EventCatalog
|
|
3264
3575
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
3265
3576
|
* @returns Diagram[]|Undefined
|
|
3266
3577
|
*/
|
|
3267
|
-
getDiagrams: getDiagrams((0,
|
|
3578
|
+
getDiagrams: getDiagrams((0, import_node_path22.join)(path8)),
|
|
3268
3579
|
/**
|
|
3269
3580
|
* Adds a diagram to EventCatalog
|
|
3270
3581
|
*
|
|
@@ -3272,33 +3583,33 @@ var src_default = (path7) => {
|
|
|
3272
3583
|
* @param options - Optional options to write the diagram
|
|
3273
3584
|
*
|
|
3274
3585
|
*/
|
|
3275
|
-
writeDiagram: writeDiagram((0,
|
|
3586
|
+
writeDiagram: writeDiagram((0, import_node_path22.join)(path8, "diagrams")),
|
|
3276
3587
|
/**
|
|
3277
3588
|
* Remove a diagram from EventCatalog (modeled on the standard POSIX rm utility)
|
|
3278
3589
|
*
|
|
3279
3590
|
* @param path - The path to your diagram, e.g. `/ArchitectureDiagram`
|
|
3280
3591
|
*
|
|
3281
3592
|
*/
|
|
3282
|
-
rmDiagram: rmDiagram((0,
|
|
3593
|
+
rmDiagram: rmDiagram((0, import_node_path22.join)(path8, "diagrams")),
|
|
3283
3594
|
/**
|
|
3284
3595
|
* Remove a diagram by a diagram id
|
|
3285
3596
|
*
|
|
3286
3597
|
* @param id - The id of the diagram you want to remove
|
|
3287
3598
|
*
|
|
3288
3599
|
*/
|
|
3289
|
-
rmDiagramById: rmDiagramById((0,
|
|
3600
|
+
rmDiagramById: rmDiagramById((0, import_node_path22.join)(path8)),
|
|
3290
3601
|
/**
|
|
3291
3602
|
* Moves a given diagram id to the version directory
|
|
3292
3603
|
* @param id - The id of the diagram to version
|
|
3293
3604
|
*/
|
|
3294
|
-
versionDiagram: versionDiagram((0,
|
|
3605
|
+
versionDiagram: versionDiagram((0, import_node_path22.join)(path8)),
|
|
3295
3606
|
/**
|
|
3296
3607
|
* Check to see if a diagram version exists
|
|
3297
3608
|
* @param id - The id of the diagram
|
|
3298
3609
|
* @param version - The version of the diagram (supports semver)
|
|
3299
3610
|
* @returns
|
|
3300
3611
|
*/
|
|
3301
|
-
diagramHasVersion: diagramHasVersion((0,
|
|
3612
|
+
diagramHasVersion: diagramHasVersion((0, import_node_path22.join)(path8)),
|
|
3302
3613
|
/**
|
|
3303
3614
|
* Adds a file to the given diagram
|
|
3304
3615
|
* @param id - The id of the diagram to add the file to
|
|
@@ -3306,7 +3617,7 @@ var src_default = (path7) => {
|
|
|
3306
3617
|
* @param version - Optional version of the diagram to add the file to
|
|
3307
3618
|
* @returns
|
|
3308
3619
|
*/
|
|
3309
|
-
addFileToDiagram: addFileToDiagram((0,
|
|
3620
|
+
addFileToDiagram: addFileToDiagram((0, import_node_path22.join)(path8)),
|
|
3310
3621
|
/**
|
|
3311
3622
|
* ================================
|
|
3312
3623
|
* DSL
|
|
@@ -3325,18 +3636,21 @@ var src_default = (path7) => {
|
|
|
3325
3636
|
* const dsl = await sdk.toDSL(services, { type: 'service', hydrate: true });
|
|
3326
3637
|
* ```
|
|
3327
3638
|
*/
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3639
|
+
createSnapshot: createSnapshot((0, import_node_path22.join)(path8)),
|
|
3640
|
+
diffSnapshots: diffSnapshots((0, import_node_path22.join)(path8)),
|
|
3641
|
+
listSnapshots: listSnapshots((0, import_node_path22.join)(path8)),
|
|
3642
|
+
toDSL: toDSL((0, import_node_path22.join)(path8), {
|
|
3643
|
+
getEvent: getEvent((0, import_node_path22.join)(path8)),
|
|
3644
|
+
getCommand: getCommand((0, import_node_path22.join)(path8)),
|
|
3645
|
+
getQuery: getQuery((0, import_node_path22.join)(path8)),
|
|
3646
|
+
getService: getService((0, import_node_path22.join)(path8)),
|
|
3647
|
+
getServices: getServices((0, import_node_path22.join)(path8)),
|
|
3648
|
+
getDomain: getDomain((0, import_node_path22.join)(path8, "domains")),
|
|
3649
|
+
getChannel: getChannel((0, import_node_path22.join)(path8)),
|
|
3650
|
+
getChannels: getChannels((0, import_node_path22.join)(path8)),
|
|
3651
|
+
getContainer: getDataStore((0, import_node_path22.join)(path8)),
|
|
3652
|
+
getTeam: getTeam((0, import_node_path22.join)(path8, "teams")),
|
|
3653
|
+
getUser: getUser((0, import_node_path22.join)(path8, "users"))
|
|
3340
3654
|
})
|
|
3341
3655
|
};
|
|
3342
3656
|
};
|