@eventcatalog/sdk 2.15.1 → 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 +164 -49
- package/dist/index.d.ts +164 -49
- package/dist/index.js +644 -202
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +637 -195
- 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,408 @@ var dumpCatalog = (directory) => async (options) => {
|
|
|
1965
1965
|
};
|
|
1966
1966
|
};
|
|
1967
1967
|
|
|
1968
|
-
// src/
|
|
1968
|
+
// src/snapshots.ts
|
|
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"));
|
|
1969
2282
|
var import_promises10 = __toESM(require("fs/promises"));
|
|
1970
|
-
var
|
|
2283
|
+
var import_gray_matter8 = __toESM(require("gray-matter"));
|
|
2284
|
+
var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
|
|
2285
|
+
const { version, format = "mdx" } = options;
|
|
2286
|
+
const resourceFile = await findFileById(catalogDir, id, version);
|
|
2287
|
+
if (!resourceFile) {
|
|
2288
|
+
throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
|
|
2289
|
+
}
|
|
2290
|
+
const resourceDir = (0, import_node_path17.dirname)(resourceFile);
|
|
2291
|
+
const changelogPath = import_node_path17.default.join(resourceDir, `changelog.${format}`);
|
|
2292
|
+
const { markdown, ...frontmatter } = changelog;
|
|
2293
|
+
const fm = { ...frontmatter };
|
|
2294
|
+
if (fm.createdAt instanceof Date) {
|
|
2295
|
+
fm.createdAt = fm.createdAt;
|
|
2296
|
+
}
|
|
2297
|
+
if (!fm.badges || fm.badges.length === 0) {
|
|
2298
|
+
delete fm.badges;
|
|
2299
|
+
}
|
|
2300
|
+
import_node_fs8.default.mkdirSync(resourceDir, { recursive: true });
|
|
2301
|
+
const document = import_gray_matter8.default.stringify(markdown.trim(), fm);
|
|
2302
|
+
import_node_fs8.default.writeFileSync(changelogPath, document);
|
|
2303
|
+
invalidateFileCache();
|
|
2304
|
+
};
|
|
2305
|
+
var appendChangelog = (catalogDir) => async (id, changelog, options = {}) => {
|
|
2306
|
+
const { version, format = "mdx" } = options;
|
|
2307
|
+
const resourceFile = await findFileById(catalogDir, id, version);
|
|
2308
|
+
if (!resourceFile) {
|
|
2309
|
+
throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
|
|
2310
|
+
}
|
|
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;
|
|
2315
|
+
if (!existingPath) {
|
|
2316
|
+
return writeChangelog(catalogDir)(id, changelog, options);
|
|
2317
|
+
}
|
|
2318
|
+
const existing = import_gray_matter8.default.read(existingPath);
|
|
2319
|
+
const existingContent = existing.content.trim();
|
|
2320
|
+
const newEntry = changelog.markdown.trim();
|
|
2321
|
+
const combined = `${newEntry}
|
|
2322
|
+
|
|
2323
|
+
---
|
|
2324
|
+
|
|
2325
|
+
${existingContent}`;
|
|
2326
|
+
const fm = { ...existing.data };
|
|
2327
|
+
fm.createdAt = changelog.createdAt;
|
|
2328
|
+
if (changelog.badges && changelog.badges.length > 0) {
|
|
2329
|
+
fm.badges = changelog.badges;
|
|
2330
|
+
} else {
|
|
2331
|
+
delete fm.badges;
|
|
2332
|
+
}
|
|
2333
|
+
const document = import_gray_matter8.default.stringify(combined, fm);
|
|
2334
|
+
import_node_fs8.default.writeFileSync(existingPath, document);
|
|
2335
|
+
invalidateFileCache();
|
|
2336
|
+
};
|
|
2337
|
+
var getChangelog = (catalogDir) => async (id, options = {}) => {
|
|
2338
|
+
const { version } = options;
|
|
2339
|
+
const resourceFile = await findFileById(catalogDir, id, version);
|
|
2340
|
+
if (!resourceFile) return void 0;
|
|
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;
|
|
2345
|
+
if (!changelogPath) return void 0;
|
|
2346
|
+
const { data, content } = import_gray_matter8.default.read(changelogPath);
|
|
2347
|
+
return { ...data, markdown: content.trim() };
|
|
2348
|
+
};
|
|
2349
|
+
var rmChangelog = (catalogDir) => async (id, options = {}) => {
|
|
2350
|
+
const { version } = options;
|
|
2351
|
+
const resourceFile = await findFileById(catalogDir, id, version);
|
|
2352
|
+
if (!resourceFile) {
|
|
2353
|
+
throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
|
|
2354
|
+
}
|
|
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)) {
|
|
2359
|
+
await import_promises10.default.rm(mdxPath);
|
|
2360
|
+
}
|
|
2361
|
+
if (import_node_fs8.default.existsSync(mdPath)) {
|
|
2362
|
+
await import_promises10.default.rm(mdPath);
|
|
2363
|
+
}
|
|
2364
|
+
invalidateFileCache();
|
|
2365
|
+
};
|
|
2366
|
+
|
|
2367
|
+
// src/entities.ts
|
|
2368
|
+
var import_promises11 = __toESM(require("fs/promises"));
|
|
2369
|
+
var import_node_path18 = require("path");
|
|
1971
2370
|
var getEntity = (directory) => async (id, version) => getResource(directory, id, version, { type: "entity" });
|
|
1972
2371
|
var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
|
|
1973
2372
|
var writeEntity = (directory) => async (entity, options = {
|
|
@@ -1975,8 +2374,8 @@ var writeEntity = (directory) => async (entity, options = {
|
|
|
1975
2374
|
override: false,
|
|
1976
2375
|
format: "mdx"
|
|
1977
2376
|
}) => writeResource(directory, { ...entity }, { ...options, type: "entity" });
|
|
1978
|
-
var rmEntity = (directory) => async (
|
|
1979
|
-
await
|
|
2377
|
+
var rmEntity = (directory) => async (path8) => {
|
|
2378
|
+
await import_promises11.default.rm((0, import_node_path18.join)(directory, path8), { recursive: true });
|
|
1980
2379
|
invalidateFileCache();
|
|
1981
2380
|
};
|
|
1982
2381
|
var rmEntityById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -1989,8 +2388,8 @@ var entityHasVersion = (directory) => async (id, version) => {
|
|
|
1989
2388
|
};
|
|
1990
2389
|
|
|
1991
2390
|
// src/containers.ts
|
|
1992
|
-
var
|
|
1993
|
-
var
|
|
2391
|
+
var import_promises12 = __toESM(require("fs/promises"));
|
|
2392
|
+
var import_node_path19 = require("path");
|
|
1994
2393
|
var getContainer = (directory) => async (id, version) => getResource(directory, id, version, { type: "container" });
|
|
1995
2394
|
var getContainers = (directory) => async (options) => getResources(directory, { type: "containers", latestOnly: options?.latestOnly });
|
|
1996
2395
|
var writeContainer = (directory) => async (data, options = {
|
|
@@ -1999,8 +2398,8 @@ var writeContainer = (directory) => async (data, options = {
|
|
|
1999
2398
|
format: "mdx"
|
|
2000
2399
|
}) => writeResource(directory, { ...data }, { ...options, type: "container" });
|
|
2001
2400
|
var versionContainer = (directory) => async (id) => versionResource(directory, id);
|
|
2002
|
-
var rmContainer = (directory) => async (
|
|
2003
|
-
await
|
|
2401
|
+
var rmContainer = (directory) => async (path8) => {
|
|
2402
|
+
await import_promises12.default.rm((0, import_node_path19.join)(directory, path8), { recursive: true });
|
|
2004
2403
|
invalidateFileCache();
|
|
2005
2404
|
};
|
|
2006
2405
|
var rmContainerById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -2017,7 +2416,7 @@ var writeContainerToService = (directory) => async (container, service, options
|
|
|
2017
2416
|
throw new Error("Service not found");
|
|
2018
2417
|
}
|
|
2019
2418
|
let pathForContainer = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/containers` : `${resourcePath.directory}/containers`;
|
|
2020
|
-
pathForContainer = (0,
|
|
2419
|
+
pathForContainer = (0, import_node_path19.join)(pathForContainer, container.id);
|
|
2021
2420
|
await writeResource(directory, { ...container }, { ...options, path: pathForContainer, type: "container" });
|
|
2022
2421
|
};
|
|
2023
2422
|
|
|
@@ -2033,8 +2432,8 @@ var addFileToDataStore = addFileToContainer;
|
|
|
2033
2432
|
var writeDataStoreToService = writeContainerToService;
|
|
2034
2433
|
|
|
2035
2434
|
// src/data-products.ts
|
|
2036
|
-
var
|
|
2037
|
-
var
|
|
2435
|
+
var import_promises13 = __toESM(require("fs/promises"));
|
|
2436
|
+
var import_node_path20 = require("path");
|
|
2038
2437
|
var getDataProduct = (directory) => async (id, version) => getResource(directory, id, version, { type: "data-product" });
|
|
2039
2438
|
var getDataProducts = (directory) => async (options) => getResources(directory, { type: "data-products", latestOnly: options?.latestOnly });
|
|
2040
2439
|
var writeDataProduct = (directory) => async (dataProduct, options = {
|
|
@@ -2044,11 +2443,11 @@ var writeDataProduct = (directory) => async (dataProduct, options = {
|
|
|
2044
2443
|
}) => writeResource(directory, { ...dataProduct }, { ...options, type: "data-product" });
|
|
2045
2444
|
var writeDataProductToDomain = (directory) => async (dataProduct, domain, options = { path: "", format: "mdx", override: false }) => {
|
|
2046
2445
|
let pathForDataProduct = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/data-products` : `/${domain.id}/data-products`;
|
|
2047
|
-
pathForDataProduct = (0,
|
|
2446
|
+
pathForDataProduct = (0, import_node_path20.join)(pathForDataProduct, dataProduct.id);
|
|
2048
2447
|
await writeResource(directory, { ...dataProduct }, { ...options, path: pathForDataProduct, type: "data-product" });
|
|
2049
2448
|
};
|
|
2050
|
-
var rmDataProduct = (directory) => async (
|
|
2051
|
-
await
|
|
2449
|
+
var rmDataProduct = (directory) => async (path8) => {
|
|
2450
|
+
await import_promises13.default.rm((0, import_node_path20.join)(directory, path8), { recursive: true });
|
|
2052
2451
|
invalidateFileCache();
|
|
2053
2452
|
};
|
|
2054
2453
|
var rmDataProductById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -2062,8 +2461,8 @@ var dataProductHasVersion = (directory) => async (id, version) => {
|
|
|
2062
2461
|
var addFileToDataProduct = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
|
|
2063
2462
|
|
|
2064
2463
|
// src/diagrams.ts
|
|
2065
|
-
var
|
|
2066
|
-
var
|
|
2464
|
+
var import_promises14 = __toESM(require("fs/promises"));
|
|
2465
|
+
var import_node_path21 = require("path");
|
|
2067
2466
|
var getDiagram = (directory) => async (id, version) => getResource(directory, id, version, { type: "diagram" });
|
|
2068
2467
|
var getDiagrams = (directory) => async (options) => getResources(directory, { type: "diagrams", latestOnly: options?.latestOnly });
|
|
2069
2468
|
var writeDiagram = (directory) => async (diagram, options = {
|
|
@@ -2071,8 +2470,8 @@ var writeDiagram = (directory) => async (diagram, options = {
|
|
|
2071
2470
|
override: false,
|
|
2072
2471
|
format: "mdx"
|
|
2073
2472
|
}) => writeResource(directory, { ...diagram }, { ...options, type: "diagram" });
|
|
2074
|
-
var rmDiagram = (directory) => async (
|
|
2075
|
-
await
|
|
2473
|
+
var rmDiagram = (directory) => async (path8) => {
|
|
2474
|
+
await import_promises14.default.rm((0, import_node_path21.join)(directory, path8), { recursive: true });
|
|
2076
2475
|
invalidateFileCache();
|
|
2077
2476
|
};
|
|
2078
2477
|
var rmDiagramById = (directory) => async (id, version, persistFiles) => {
|
|
@@ -2086,7 +2485,7 @@ var diagramHasVersion = (directory) => async (id, version) => {
|
|
|
2086
2485
|
var addFileToDiagram = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version, { type: "diagram" });
|
|
2087
2486
|
|
|
2088
2487
|
// src/index.ts
|
|
2089
|
-
var src_default = (
|
|
2488
|
+
var src_default = (path8) => {
|
|
2090
2489
|
return {
|
|
2091
2490
|
/**
|
|
2092
2491
|
* Returns an events from EventCatalog
|
|
@@ -2094,13 +2493,13 @@ var src_default = (path6) => {
|
|
|
2094
2493
|
* @param version - Optional id of the version to get (supports semver)
|
|
2095
2494
|
* @returns Event|Undefined
|
|
2096
2495
|
*/
|
|
2097
|
-
getEvent: getEvent((0,
|
|
2496
|
+
getEvent: getEvent((0, import_node_path22.join)(path8)),
|
|
2098
2497
|
/**
|
|
2099
2498
|
* Returns all events from EventCatalog
|
|
2100
2499
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2101
2500
|
* @returns Event[]|Undefined
|
|
2102
2501
|
*/
|
|
2103
|
-
getEvents: getEvents((0,
|
|
2502
|
+
getEvents: getEvents((0, import_node_path22.join)(path8)),
|
|
2104
2503
|
/**
|
|
2105
2504
|
* Adds an event to EventCatalog
|
|
2106
2505
|
*
|
|
@@ -2108,7 +2507,7 @@ var src_default = (path6) => {
|
|
|
2108
2507
|
* @param options - Optional options to write the event
|
|
2109
2508
|
*
|
|
2110
2509
|
*/
|
|
2111
|
-
writeEvent: writeEvent((0,
|
|
2510
|
+
writeEvent: writeEvent((0, import_node_path22.join)(path8, "events")),
|
|
2112
2511
|
/**
|
|
2113
2512
|
* Adds an event to a service in EventCatalog
|
|
2114
2513
|
*
|
|
@@ -2117,26 +2516,26 @@ var src_default = (path6) => {
|
|
|
2117
2516
|
* @param options - Optional options to write the event
|
|
2118
2517
|
*
|
|
2119
2518
|
*/
|
|
2120
|
-
writeEventToService: writeEventToService((0,
|
|
2519
|
+
writeEventToService: writeEventToService((0, import_node_path22.join)(path8)),
|
|
2121
2520
|
/**
|
|
2122
2521
|
* Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
|
|
2123
2522
|
*
|
|
2124
2523
|
* @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
|
|
2125
2524
|
*
|
|
2126
2525
|
*/
|
|
2127
|
-
rmEvent: rmEvent((0,
|
|
2526
|
+
rmEvent: rmEvent((0, import_node_path22.join)(path8, "events")),
|
|
2128
2527
|
/**
|
|
2129
2528
|
* Remove an event by an Event id
|
|
2130
2529
|
*
|
|
2131
2530
|
* @param id - The id of the event you want to remove
|
|
2132
2531
|
*
|
|
2133
2532
|
*/
|
|
2134
|
-
rmEventById: rmEventById((0,
|
|
2533
|
+
rmEventById: rmEventById((0, import_node_path22.join)(path8)),
|
|
2135
2534
|
/**
|
|
2136
2535
|
* Moves a given event id to the version directory
|
|
2137
2536
|
* @param directory
|
|
2138
2537
|
*/
|
|
2139
|
-
versionEvent: versionEvent((0,
|
|
2538
|
+
versionEvent: versionEvent((0, import_node_path22.join)(path8)),
|
|
2140
2539
|
/**
|
|
2141
2540
|
* Adds a file to the given event
|
|
2142
2541
|
* @param id - The id of the event to add the file to
|
|
@@ -2144,7 +2543,7 @@ var src_default = (path6) => {
|
|
|
2144
2543
|
* @param version - Optional version of the event to add the file to
|
|
2145
2544
|
* @returns
|
|
2146
2545
|
*/
|
|
2147
|
-
addFileToEvent: addFileToEvent((0,
|
|
2546
|
+
addFileToEvent: addFileToEvent((0, import_node_path22.join)(path8)),
|
|
2148
2547
|
/**
|
|
2149
2548
|
* Adds a schema to the given event
|
|
2150
2549
|
* @param id - The id of the event to add the schema to
|
|
@@ -2152,14 +2551,14 @@ var src_default = (path6) => {
|
|
|
2152
2551
|
* @param version - Optional version of the event to add the schema to
|
|
2153
2552
|
* @returns
|
|
2154
2553
|
*/
|
|
2155
|
-
addSchemaToEvent: addSchemaToEvent((0,
|
|
2554
|
+
addSchemaToEvent: addSchemaToEvent((0, import_node_path22.join)(path8)),
|
|
2156
2555
|
/**
|
|
2157
2556
|
* Check to see if an event version exists
|
|
2158
2557
|
* @param id - The id of the event
|
|
2159
2558
|
* @param version - The version of the event (supports semver)
|
|
2160
2559
|
* @returns
|
|
2161
2560
|
*/
|
|
2162
|
-
eventHasVersion: eventHasVersion((0,
|
|
2561
|
+
eventHasVersion: eventHasVersion((0, import_node_path22.join)(path8)),
|
|
2163
2562
|
/**
|
|
2164
2563
|
* ================================
|
|
2165
2564
|
* Commands
|
|
@@ -2171,13 +2570,13 @@ var src_default = (path6) => {
|
|
|
2171
2570
|
* @param version - Optional id of the version to get (supports semver)
|
|
2172
2571
|
* @returns Command|Undefined
|
|
2173
2572
|
*/
|
|
2174
|
-
getCommand: getCommand((0,
|
|
2573
|
+
getCommand: getCommand((0, import_node_path22.join)(path8)),
|
|
2175
2574
|
/**
|
|
2176
2575
|
* Returns all commands from EventCatalog
|
|
2177
2576
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2178
2577
|
* @returns Command[]|Undefined
|
|
2179
2578
|
*/
|
|
2180
|
-
getCommands: getCommands((0,
|
|
2579
|
+
getCommands: getCommands((0, import_node_path22.join)(path8)),
|
|
2181
2580
|
/**
|
|
2182
2581
|
* Adds an command to EventCatalog
|
|
2183
2582
|
*
|
|
@@ -2185,7 +2584,7 @@ var src_default = (path6) => {
|
|
|
2185
2584
|
* @param options - Optional options to write the command
|
|
2186
2585
|
*
|
|
2187
2586
|
*/
|
|
2188
|
-
writeCommand: writeCommand((0,
|
|
2587
|
+
writeCommand: writeCommand((0, import_node_path22.join)(path8, "commands")),
|
|
2189
2588
|
/**
|
|
2190
2589
|
* Adds a command to a service in EventCatalog
|
|
2191
2590
|
*
|
|
@@ -2194,26 +2593,26 @@ var src_default = (path6) => {
|
|
|
2194
2593
|
* @param options - Optional options to write the command
|
|
2195
2594
|
*
|
|
2196
2595
|
*/
|
|
2197
|
-
writeCommandToService: writeCommandToService((0,
|
|
2596
|
+
writeCommandToService: writeCommandToService((0, import_node_path22.join)(path8)),
|
|
2198
2597
|
/**
|
|
2199
2598
|
* Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
|
|
2200
2599
|
*
|
|
2201
2600
|
* @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
|
|
2202
2601
|
*
|
|
2203
2602
|
*/
|
|
2204
|
-
rmCommand: rmCommand((0,
|
|
2603
|
+
rmCommand: rmCommand((0, import_node_path22.join)(path8, "commands")),
|
|
2205
2604
|
/**
|
|
2206
2605
|
* Remove an command by an Event id
|
|
2207
2606
|
*
|
|
2208
2607
|
* @param id - The id of the command you want to remove
|
|
2209
2608
|
*
|
|
2210
2609
|
*/
|
|
2211
|
-
rmCommandById: rmCommandById((0,
|
|
2610
|
+
rmCommandById: rmCommandById((0, import_node_path22.join)(path8)),
|
|
2212
2611
|
/**
|
|
2213
2612
|
* Moves a given command id to the version directory
|
|
2214
2613
|
* @param directory
|
|
2215
2614
|
*/
|
|
2216
|
-
versionCommand: versionCommand((0,
|
|
2615
|
+
versionCommand: versionCommand((0, import_node_path22.join)(path8)),
|
|
2217
2616
|
/**
|
|
2218
2617
|
* Adds a file to the given command
|
|
2219
2618
|
* @param id - The id of the command to add the file to
|
|
@@ -2221,7 +2620,7 @@ var src_default = (path6) => {
|
|
|
2221
2620
|
* @param version - Optional version of the command to add the file to
|
|
2222
2621
|
* @returns
|
|
2223
2622
|
*/
|
|
2224
|
-
addFileToCommand: addFileToCommand((0,
|
|
2623
|
+
addFileToCommand: addFileToCommand((0, import_node_path22.join)(path8)),
|
|
2225
2624
|
/**
|
|
2226
2625
|
* Adds a schema to the given command
|
|
2227
2626
|
* @param id - The id of the command to add the schema to
|
|
@@ -2229,14 +2628,14 @@ var src_default = (path6) => {
|
|
|
2229
2628
|
* @param version - Optional version of the command to add the schema to
|
|
2230
2629
|
* @returns
|
|
2231
2630
|
*/
|
|
2232
|
-
addSchemaToCommand: addSchemaToCommand((0,
|
|
2631
|
+
addSchemaToCommand: addSchemaToCommand((0, import_node_path22.join)(path8)),
|
|
2233
2632
|
/**
|
|
2234
2633
|
* Check to see if a command version exists
|
|
2235
2634
|
* @param id - The id of the command
|
|
2236
2635
|
* @param version - The version of the command (supports semver)
|
|
2237
2636
|
* @returns
|
|
2238
2637
|
*/
|
|
2239
|
-
commandHasVersion: commandHasVersion((0,
|
|
2638
|
+
commandHasVersion: commandHasVersion((0, import_node_path22.join)(path8)),
|
|
2240
2639
|
/**
|
|
2241
2640
|
* ================================
|
|
2242
2641
|
* Queries
|
|
@@ -2248,13 +2647,13 @@ var src_default = (path6) => {
|
|
|
2248
2647
|
* @param version - Optional id of the version to get (supports semver)
|
|
2249
2648
|
* @returns Query|Undefined
|
|
2250
2649
|
*/
|
|
2251
|
-
getQuery: getQuery((0,
|
|
2650
|
+
getQuery: getQuery((0, import_node_path22.join)(path8)),
|
|
2252
2651
|
/**
|
|
2253
2652
|
* Returns all queries from EventCatalog
|
|
2254
2653
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2255
2654
|
* @returns Query[]|Undefined
|
|
2256
2655
|
*/
|
|
2257
|
-
getQueries: getQueries((0,
|
|
2656
|
+
getQueries: getQueries((0, import_node_path22.join)(path8)),
|
|
2258
2657
|
/**
|
|
2259
2658
|
* Adds a query to EventCatalog
|
|
2260
2659
|
*
|
|
@@ -2262,7 +2661,7 @@ var src_default = (path6) => {
|
|
|
2262
2661
|
* @param options - Optional options to write the event
|
|
2263
2662
|
*
|
|
2264
2663
|
*/
|
|
2265
|
-
writeQuery: writeQuery((0,
|
|
2664
|
+
writeQuery: writeQuery((0, import_node_path22.join)(path8, "queries")),
|
|
2266
2665
|
/**
|
|
2267
2666
|
* Adds a query to a service in EventCatalog
|
|
2268
2667
|
*
|
|
@@ -2271,26 +2670,26 @@ var src_default = (path6) => {
|
|
|
2271
2670
|
* @param options - Optional options to write the query
|
|
2272
2671
|
*
|
|
2273
2672
|
*/
|
|
2274
|
-
writeQueryToService: writeQueryToService((0,
|
|
2673
|
+
writeQueryToService: writeQueryToService((0, import_node_path22.join)(path8)),
|
|
2275
2674
|
/**
|
|
2276
2675
|
* Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
|
|
2277
2676
|
*
|
|
2278
2677
|
* @param path - The path to your query, e.g. `/Orders/GetOrder`
|
|
2279
2678
|
*
|
|
2280
2679
|
*/
|
|
2281
|
-
rmQuery: rmQuery((0,
|
|
2680
|
+
rmQuery: rmQuery((0, import_node_path22.join)(path8, "queries")),
|
|
2282
2681
|
/**
|
|
2283
2682
|
* Remove a query by a Query id
|
|
2284
2683
|
*
|
|
2285
2684
|
* @param id - The id of the query you want to remove
|
|
2286
2685
|
*
|
|
2287
2686
|
*/
|
|
2288
|
-
rmQueryById: rmQueryById((0,
|
|
2687
|
+
rmQueryById: rmQueryById((0, import_node_path22.join)(path8)),
|
|
2289
2688
|
/**
|
|
2290
2689
|
* Moves a given query id to the version directory
|
|
2291
2690
|
* @param directory
|
|
2292
2691
|
*/
|
|
2293
|
-
versionQuery: versionQuery((0,
|
|
2692
|
+
versionQuery: versionQuery((0, import_node_path22.join)(path8)),
|
|
2294
2693
|
/**
|
|
2295
2694
|
* Adds a file to the given query
|
|
2296
2695
|
* @param id - The id of the query to add the file to
|
|
@@ -2298,7 +2697,7 @@ var src_default = (path6) => {
|
|
|
2298
2697
|
* @param version - Optional version of the query to add the file to
|
|
2299
2698
|
* @returns
|
|
2300
2699
|
*/
|
|
2301
|
-
addFileToQuery: addFileToQuery((0,
|
|
2700
|
+
addFileToQuery: addFileToQuery((0, import_node_path22.join)(path8)),
|
|
2302
2701
|
/**
|
|
2303
2702
|
* Adds a schema to the given query
|
|
2304
2703
|
* @param id - The id of the query to add the schema to
|
|
@@ -2306,14 +2705,14 @@ var src_default = (path6) => {
|
|
|
2306
2705
|
* @param version - Optional version of the query to add the schema to
|
|
2307
2706
|
* @returns
|
|
2308
2707
|
*/
|
|
2309
|
-
addSchemaToQuery: addSchemaToQuery((0,
|
|
2708
|
+
addSchemaToQuery: addSchemaToQuery((0, import_node_path22.join)(path8)),
|
|
2310
2709
|
/**
|
|
2311
2710
|
* Check to see if an query version exists
|
|
2312
2711
|
* @param id - The id of the query
|
|
2313
2712
|
* @param version - The version of the query (supports semver)
|
|
2314
2713
|
* @returns
|
|
2315
2714
|
*/
|
|
2316
|
-
queryHasVersion: queryHasVersion((0,
|
|
2715
|
+
queryHasVersion: queryHasVersion((0, import_node_path22.join)(path8)),
|
|
2317
2716
|
/**
|
|
2318
2717
|
* ================================
|
|
2319
2718
|
* Channels
|
|
@@ -2325,13 +2724,13 @@ var src_default = (path6) => {
|
|
|
2325
2724
|
* @param version - Optional id of the version to get (supports semver)
|
|
2326
2725
|
* @returns Channel|Undefined
|
|
2327
2726
|
*/
|
|
2328
|
-
getChannel: getChannel((0,
|
|
2727
|
+
getChannel: getChannel((0, import_node_path22.join)(path8)),
|
|
2329
2728
|
/**
|
|
2330
2729
|
* Returns all channels from EventCatalog
|
|
2331
2730
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2332
2731
|
* @returns Channel[]|Undefined
|
|
2333
2732
|
*/
|
|
2334
|
-
getChannels: getChannels((0,
|
|
2733
|
+
getChannels: getChannels((0, import_node_path22.join)(path8)),
|
|
2335
2734
|
/**
|
|
2336
2735
|
* Adds an channel to EventCatalog
|
|
2337
2736
|
*
|
|
@@ -2339,33 +2738,33 @@ var src_default = (path6) => {
|
|
|
2339
2738
|
* @param options - Optional options to write the channel
|
|
2340
2739
|
*
|
|
2341
2740
|
*/
|
|
2342
|
-
writeChannel: writeChannel((0,
|
|
2741
|
+
writeChannel: writeChannel((0, import_node_path22.join)(path8, "channels")),
|
|
2343
2742
|
/**
|
|
2344
2743
|
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
2345
2744
|
*
|
|
2346
2745
|
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
2347
2746
|
*
|
|
2348
2747
|
*/
|
|
2349
|
-
rmChannel: rmChannel((0,
|
|
2748
|
+
rmChannel: rmChannel((0, import_node_path22.join)(path8, "channels")),
|
|
2350
2749
|
/**
|
|
2351
2750
|
* Remove an channel by an Event id
|
|
2352
2751
|
*
|
|
2353
2752
|
* @param id - The id of the channel you want to remove
|
|
2354
2753
|
*
|
|
2355
2754
|
*/
|
|
2356
|
-
rmChannelById: rmChannelById((0,
|
|
2755
|
+
rmChannelById: rmChannelById((0, import_node_path22.join)(path8)),
|
|
2357
2756
|
/**
|
|
2358
2757
|
* Moves a given channel id to the version directory
|
|
2359
2758
|
* @param directory
|
|
2360
2759
|
*/
|
|
2361
|
-
versionChannel: versionChannel((0,
|
|
2760
|
+
versionChannel: versionChannel((0, import_node_path22.join)(path8)),
|
|
2362
2761
|
/**
|
|
2363
2762
|
* Check to see if a channel version exists
|
|
2364
2763
|
* @param id - The id of the channel
|
|
2365
2764
|
* @param version - The version of the channel (supports semver)
|
|
2366
2765
|
* @returns
|
|
2367
2766
|
*/
|
|
2368
|
-
channelHasVersion: channelHasVersion((0,
|
|
2767
|
+
channelHasVersion: channelHasVersion((0, import_node_path22.join)(path8)),
|
|
2369
2768
|
/**
|
|
2370
2769
|
* Add a channel to an event
|
|
2371
2770
|
*
|
|
@@ -2382,7 +2781,7 @@ var src_default = (path6) => {
|
|
|
2382
2781
|
*
|
|
2383
2782
|
* ```
|
|
2384
2783
|
*/
|
|
2385
|
-
addEventToChannel: addMessageToChannel((0,
|
|
2784
|
+
addEventToChannel: addMessageToChannel((0, import_node_path22.join)(path8), "events"),
|
|
2386
2785
|
/**
|
|
2387
2786
|
* Add a channel to an command
|
|
2388
2787
|
*
|
|
@@ -2399,7 +2798,7 @@ var src_default = (path6) => {
|
|
|
2399
2798
|
*
|
|
2400
2799
|
* ```
|
|
2401
2800
|
*/
|
|
2402
|
-
addCommandToChannel: addMessageToChannel((0,
|
|
2801
|
+
addCommandToChannel: addMessageToChannel((0, import_node_path22.join)(path8), "commands"),
|
|
2403
2802
|
/**
|
|
2404
2803
|
* Add a channel to an query
|
|
2405
2804
|
*
|
|
@@ -2416,7 +2815,7 @@ var src_default = (path6) => {
|
|
|
2416
2815
|
*
|
|
2417
2816
|
* ```
|
|
2418
2817
|
*/
|
|
2419
|
-
addQueryToChannel: addMessageToChannel((0,
|
|
2818
|
+
addQueryToChannel: addMessageToChannel((0, import_node_path22.join)(path8), "queries"),
|
|
2420
2819
|
/**
|
|
2421
2820
|
* ================================
|
|
2422
2821
|
* SERVICES
|
|
@@ -2429,14 +2828,14 @@ var src_default = (path6) => {
|
|
|
2429
2828
|
* @param options - Optional options to write the event
|
|
2430
2829
|
*
|
|
2431
2830
|
*/
|
|
2432
|
-
writeService: writeService((0,
|
|
2831
|
+
writeService: writeService((0, import_node_path22.join)(path8, "services")),
|
|
2433
2832
|
/**
|
|
2434
2833
|
* Adds a versioned service to EventCatalog
|
|
2435
2834
|
*
|
|
2436
2835
|
* @param service - The service to write
|
|
2437
2836
|
*
|
|
2438
2837
|
*/
|
|
2439
|
-
writeVersionedService: writeVersionedService((0,
|
|
2838
|
+
writeVersionedService: writeVersionedService((0, import_node_path22.join)(path8, "services")),
|
|
2440
2839
|
/**
|
|
2441
2840
|
* Adds a service to a domain in EventCatalog
|
|
2442
2841
|
*
|
|
@@ -2445,45 +2844,45 @@ var src_default = (path6) => {
|
|
|
2445
2844
|
* @param options - Optional options to write the event
|
|
2446
2845
|
*
|
|
2447
2846
|
*/
|
|
2448
|
-
writeServiceToDomain: writeServiceToDomain((0,
|
|
2847
|
+
writeServiceToDomain: writeServiceToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2449
2848
|
/**
|
|
2450
2849
|
* Returns a service from EventCatalog
|
|
2451
2850
|
* @param id - The id of the service to retrieve
|
|
2452
2851
|
* @param version - Optional id of the version to get (supports semver)
|
|
2453
2852
|
* @returns Service|Undefined
|
|
2454
2853
|
*/
|
|
2455
|
-
getService: getService((0,
|
|
2854
|
+
getService: getService((0, import_node_path22.join)(path8)),
|
|
2456
2855
|
/**
|
|
2457
2856
|
* Returns a service from EventCatalog by it's path.
|
|
2458
2857
|
* @param path - The path to the service to retrieve
|
|
2459
2858
|
* @returns Service|Undefined
|
|
2460
2859
|
*/
|
|
2461
|
-
getServiceByPath: getServiceByPath((0,
|
|
2860
|
+
getServiceByPath: getServiceByPath((0, import_node_path22.join)(path8)),
|
|
2462
2861
|
/**
|
|
2463
2862
|
* Returns all services from EventCatalog
|
|
2464
2863
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2465
2864
|
* @returns Service[]|Undefined
|
|
2466
2865
|
*/
|
|
2467
|
-
getServices: getServices((0,
|
|
2866
|
+
getServices: getServices((0, import_node_path22.join)(path8)),
|
|
2468
2867
|
/**
|
|
2469
2868
|
* Moves a given service id to the version directory
|
|
2470
2869
|
* @param directory
|
|
2471
2870
|
*/
|
|
2472
|
-
versionService: versionService((0,
|
|
2871
|
+
versionService: versionService((0, import_node_path22.join)(path8)),
|
|
2473
2872
|
/**
|
|
2474
2873
|
* Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
|
|
2475
2874
|
*
|
|
2476
2875
|
* @param path - The path to your service, e.g. `/InventoryService`
|
|
2477
2876
|
*
|
|
2478
2877
|
*/
|
|
2479
|
-
rmService: rmService((0,
|
|
2878
|
+
rmService: rmService((0, import_node_path22.join)(path8, "services")),
|
|
2480
2879
|
/**
|
|
2481
2880
|
* Remove an service by an service id
|
|
2482
2881
|
*
|
|
2483
2882
|
* @param id - The id of the service you want to remove
|
|
2484
2883
|
*
|
|
2485
2884
|
*/
|
|
2486
|
-
rmServiceById: rmServiceById((0,
|
|
2885
|
+
rmServiceById: rmServiceById((0, import_node_path22.join)(path8)),
|
|
2487
2886
|
/**
|
|
2488
2887
|
* Adds a file to the given service
|
|
2489
2888
|
* @param id - The id of the service to add the file to
|
|
@@ -2491,21 +2890,21 @@ var src_default = (path6) => {
|
|
|
2491
2890
|
* @param version - Optional version of the service to add the file to
|
|
2492
2891
|
* @returns
|
|
2493
2892
|
*/
|
|
2494
|
-
addFileToService: addFileToService((0,
|
|
2893
|
+
addFileToService: addFileToService((0, import_node_path22.join)(path8)),
|
|
2495
2894
|
/**
|
|
2496
2895
|
* Returns the specifications for a given service
|
|
2497
2896
|
* @param id - The id of the service to retrieve the specifications for
|
|
2498
2897
|
* @param version - Optional version of the service
|
|
2499
2898
|
* @returns
|
|
2500
2899
|
*/
|
|
2501
|
-
getSpecificationFilesForService: getSpecificationFilesForService((0,
|
|
2900
|
+
getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path22.join)(path8)),
|
|
2502
2901
|
/**
|
|
2503
2902
|
* Check to see if a service version exists
|
|
2504
2903
|
* @param id - The id of the service
|
|
2505
2904
|
* @param version - The version of the service (supports semver)
|
|
2506
2905
|
* @returns
|
|
2507
2906
|
*/
|
|
2508
|
-
serviceHasVersion: serviceHasVersion((0,
|
|
2907
|
+
serviceHasVersion: serviceHasVersion((0, import_node_path22.join)(path8)),
|
|
2509
2908
|
/**
|
|
2510
2909
|
* Add an event to a service by it's id.
|
|
2511
2910
|
*
|
|
@@ -2525,7 +2924,7 @@ var src_default = (path6) => {
|
|
|
2525
2924
|
*
|
|
2526
2925
|
* ```
|
|
2527
2926
|
*/
|
|
2528
|
-
addEventToService: addMessageToService((0,
|
|
2927
|
+
addEventToService: addMessageToService((0, import_node_path22.join)(path8)),
|
|
2529
2928
|
/**
|
|
2530
2929
|
* Add a data store to a service by it's id.
|
|
2531
2930
|
*
|
|
@@ -2542,7 +2941,7 @@ var src_default = (path6) => {
|
|
|
2542
2941
|
*
|
|
2543
2942
|
* ```
|
|
2544
2943
|
*/
|
|
2545
|
-
addDataStoreToService: addDataStoreToService((0,
|
|
2944
|
+
addDataStoreToService: addDataStoreToService((0, import_node_path22.join)(path8)),
|
|
2546
2945
|
/**
|
|
2547
2946
|
* Add a command to a service by it's id.
|
|
2548
2947
|
*
|
|
@@ -2562,7 +2961,7 @@ var src_default = (path6) => {
|
|
|
2562
2961
|
*
|
|
2563
2962
|
* ```
|
|
2564
2963
|
*/
|
|
2565
|
-
addCommandToService: addMessageToService((0,
|
|
2964
|
+
addCommandToService: addMessageToService((0, import_node_path22.join)(path8)),
|
|
2566
2965
|
/**
|
|
2567
2966
|
* Add a query to a service by it's id.
|
|
2568
2967
|
*
|
|
@@ -2582,7 +2981,7 @@ var src_default = (path6) => {
|
|
|
2582
2981
|
*
|
|
2583
2982
|
* ```
|
|
2584
2983
|
*/
|
|
2585
|
-
addQueryToService: addMessageToService((0,
|
|
2984
|
+
addQueryToService: addMessageToService((0, import_node_path22.join)(path8)),
|
|
2586
2985
|
/**
|
|
2587
2986
|
* Add an entity to a service by its id.
|
|
2588
2987
|
*
|
|
@@ -2600,7 +2999,7 @@ var src_default = (path6) => {
|
|
|
2600
2999
|
*
|
|
2601
3000
|
* ```
|
|
2602
3001
|
*/
|
|
2603
|
-
addEntityToService: addEntityToService((0,
|
|
3002
|
+
addEntityToService: addEntityToService((0, import_node_path22.join)(path8)),
|
|
2604
3003
|
/**
|
|
2605
3004
|
* Check to see if a service exists by it's path.
|
|
2606
3005
|
*
|
|
@@ -2617,13 +3016,13 @@ var src_default = (path6) => {
|
|
|
2617
3016
|
* @param path - The path to the service to check
|
|
2618
3017
|
* @returns boolean
|
|
2619
3018
|
*/
|
|
2620
|
-
isService: isService((0,
|
|
3019
|
+
isService: isService((0, import_node_path22.join)(path8)),
|
|
2621
3020
|
/**
|
|
2622
3021
|
* Converts a file to a service.
|
|
2623
3022
|
* @param file - The file to convert to a service.
|
|
2624
3023
|
* @returns The service.
|
|
2625
3024
|
*/
|
|
2626
|
-
toService: toService((0,
|
|
3025
|
+
toService: toService((0, import_node_path22.join)(path8)),
|
|
2627
3026
|
/**
|
|
2628
3027
|
* ================================
|
|
2629
3028
|
* Domains
|
|
@@ -2636,39 +3035,39 @@ var src_default = (path6) => {
|
|
|
2636
3035
|
* @param options - Optional options to write the event
|
|
2637
3036
|
*
|
|
2638
3037
|
*/
|
|
2639
|
-
writeDomain: writeDomain((0,
|
|
3038
|
+
writeDomain: writeDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2640
3039
|
/**
|
|
2641
3040
|
* Returns a domain from EventCatalog
|
|
2642
3041
|
* @param id - The id of the domain to retrieve
|
|
2643
3042
|
* @param version - Optional id of the version to get (supports semver)
|
|
2644
3043
|
* @returns Domain|Undefined
|
|
2645
3044
|
*/
|
|
2646
|
-
getDomain: getDomain((0,
|
|
3045
|
+
getDomain: getDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2647
3046
|
/**
|
|
2648
3047
|
* Returns all domains from EventCatalog
|
|
2649
3048
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2650
3049
|
* @returns Domain[]|Undefined
|
|
2651
3050
|
*/
|
|
2652
|
-
getDomains: getDomains((0,
|
|
3051
|
+
getDomains: getDomains((0, import_node_path22.join)(path8)),
|
|
2653
3052
|
/**
|
|
2654
3053
|
* Moves a given domain id to the version directory
|
|
2655
3054
|
* @param directory
|
|
2656
3055
|
*/
|
|
2657
|
-
versionDomain: versionDomain((0,
|
|
3056
|
+
versionDomain: versionDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2658
3057
|
/**
|
|
2659
3058
|
* Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
|
|
2660
3059
|
*
|
|
2661
3060
|
* @param path - The path to your domain, e.g. `/Payment`
|
|
2662
3061
|
*
|
|
2663
3062
|
*/
|
|
2664
|
-
rmDomain: rmDomain((0,
|
|
3063
|
+
rmDomain: rmDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2665
3064
|
/**
|
|
2666
3065
|
* Remove an service by an domain id
|
|
2667
3066
|
*
|
|
2668
3067
|
* @param id - The id of the domain you want to remove
|
|
2669
3068
|
*
|
|
2670
3069
|
*/
|
|
2671
|
-
rmDomainById: rmDomainById((0,
|
|
3070
|
+
rmDomainById: rmDomainById((0, import_node_path22.join)(path8, "domains")),
|
|
2672
3071
|
/**
|
|
2673
3072
|
* Adds a file to the given domain
|
|
2674
3073
|
* @param id - The id of the domain to add the file to
|
|
@@ -2676,28 +3075,28 @@ var src_default = (path6) => {
|
|
|
2676
3075
|
* @param version - Optional version of the domain to add the file to
|
|
2677
3076
|
* @returns
|
|
2678
3077
|
*/
|
|
2679
|
-
addFileToDomain: addFileToDomain((0,
|
|
3078
|
+
addFileToDomain: addFileToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2680
3079
|
/**
|
|
2681
3080
|
* Adds an ubiquitous language dictionary to a domain
|
|
2682
3081
|
* @param id - The id of the domain to add the ubiquitous language to
|
|
2683
3082
|
* @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
|
|
2684
3083
|
* @param version - Optional version of the domain to add the ubiquitous language to
|
|
2685
3084
|
*/
|
|
2686
|
-
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0,
|
|
3085
|
+
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2687
3086
|
/**
|
|
2688
3087
|
* Get the ubiquitous language dictionary from a domain
|
|
2689
3088
|
* @param id - The id of the domain to get the ubiquitous language from
|
|
2690
3089
|
* @param version - Optional version of the domain to get the ubiquitous language from
|
|
2691
3090
|
* @returns
|
|
2692
3091
|
*/
|
|
2693
|
-
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0,
|
|
3092
|
+
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2694
3093
|
/**
|
|
2695
3094
|
* Check to see if a domain version exists
|
|
2696
3095
|
* @param id - The id of the domain
|
|
2697
3096
|
* @param version - The version of the domain (supports semver)
|
|
2698
3097
|
* @returns
|
|
2699
3098
|
*/
|
|
2700
|
-
domainHasVersion: domainHasVersion((0,
|
|
3099
|
+
domainHasVersion: domainHasVersion((0, import_node_path22.join)(path8)),
|
|
2701
3100
|
/**
|
|
2702
3101
|
* Adds a given service to a domain
|
|
2703
3102
|
* @param id - The id of the domain
|
|
@@ -2705,7 +3104,7 @@ var src_default = (path6) => {
|
|
|
2705
3104
|
* @param version - (Optional) The version of the domain to add the service to
|
|
2706
3105
|
* @returns
|
|
2707
3106
|
*/
|
|
2708
|
-
addServiceToDomain: addServiceToDomain((0,
|
|
3107
|
+
addServiceToDomain: addServiceToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2709
3108
|
/**
|
|
2710
3109
|
* Adds a given subdomain to a domain
|
|
2711
3110
|
* @param id - The id of the domain
|
|
@@ -2713,7 +3112,7 @@ var src_default = (path6) => {
|
|
|
2713
3112
|
* @param version - (Optional) The version of the domain to add the subdomain to
|
|
2714
3113
|
* @returns
|
|
2715
3114
|
*/
|
|
2716
|
-
addSubDomainToDomain: addSubDomainToDomain((0,
|
|
3115
|
+
addSubDomainToDomain: addSubDomainToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2717
3116
|
/**
|
|
2718
3117
|
* Adds an entity to a domain
|
|
2719
3118
|
* @param id - The id of the domain
|
|
@@ -2721,7 +3120,7 @@ var src_default = (path6) => {
|
|
|
2721
3120
|
* @param version - (Optional) The version of the domain to add the entity to
|
|
2722
3121
|
* @returns
|
|
2723
3122
|
*/
|
|
2724
|
-
addEntityToDomain: addEntityToDomain((0,
|
|
3123
|
+
addEntityToDomain: addEntityToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2725
3124
|
/**
|
|
2726
3125
|
* Add an event to a domain by its id.
|
|
2727
3126
|
*
|
|
@@ -2739,7 +3138,7 @@ var src_default = (path6) => {
|
|
|
2739
3138
|
*
|
|
2740
3139
|
* ```
|
|
2741
3140
|
*/
|
|
2742
|
-
addEventToDomain: addMessageToDomain((0,
|
|
3141
|
+
addEventToDomain: addMessageToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2743
3142
|
/**
|
|
2744
3143
|
* Add a command to a domain by its id.
|
|
2745
3144
|
*
|
|
@@ -2757,7 +3156,7 @@ var src_default = (path6) => {
|
|
|
2757
3156
|
*
|
|
2758
3157
|
* ```
|
|
2759
3158
|
*/
|
|
2760
|
-
addCommandToDomain: addMessageToDomain((0,
|
|
3159
|
+
addCommandToDomain: addMessageToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2761
3160
|
/**
|
|
2762
3161
|
* Add a query to a domain by its id.
|
|
2763
3162
|
*
|
|
@@ -2775,7 +3174,7 @@ var src_default = (path6) => {
|
|
|
2775
3174
|
*
|
|
2776
3175
|
* ```
|
|
2777
3176
|
*/
|
|
2778
|
-
addQueryToDomain: addMessageToDomain((0,
|
|
3177
|
+
addQueryToDomain: addMessageToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
2779
3178
|
/**
|
|
2780
3179
|
* ================================
|
|
2781
3180
|
* Teams
|
|
@@ -2788,25 +3187,25 @@ var src_default = (path6) => {
|
|
|
2788
3187
|
* @param options - Optional options to write the team
|
|
2789
3188
|
*
|
|
2790
3189
|
*/
|
|
2791
|
-
writeTeam: writeTeam((0,
|
|
3190
|
+
writeTeam: writeTeam((0, import_node_path22.join)(path8, "teams")),
|
|
2792
3191
|
/**
|
|
2793
3192
|
* Returns a team from EventCatalog
|
|
2794
3193
|
* @param id - The id of the team to retrieve
|
|
2795
3194
|
* @returns Team|Undefined
|
|
2796
3195
|
*/
|
|
2797
|
-
getTeam: getTeam((0,
|
|
3196
|
+
getTeam: getTeam((0, import_node_path22.join)(path8, "teams")),
|
|
2798
3197
|
/**
|
|
2799
3198
|
* Returns all teams from EventCatalog
|
|
2800
3199
|
* @returns Team[]|Undefined
|
|
2801
3200
|
*/
|
|
2802
|
-
getTeams: getTeams((0,
|
|
3201
|
+
getTeams: getTeams((0, import_node_path22.join)(path8, "teams")),
|
|
2803
3202
|
/**
|
|
2804
3203
|
* Remove a team by the team id
|
|
2805
3204
|
*
|
|
2806
3205
|
* @param id - The id of the team you want to remove
|
|
2807
3206
|
*
|
|
2808
3207
|
*/
|
|
2809
|
-
rmTeamById: rmTeamById((0,
|
|
3208
|
+
rmTeamById: rmTeamById((0, import_node_path22.join)(path8, "teams")),
|
|
2810
3209
|
/**
|
|
2811
3210
|
* ================================
|
|
2812
3211
|
* Users
|
|
@@ -2819,25 +3218,25 @@ var src_default = (path6) => {
|
|
|
2819
3218
|
* @param options - Optional options to write the user
|
|
2820
3219
|
*
|
|
2821
3220
|
*/
|
|
2822
|
-
writeUser: writeUser((0,
|
|
3221
|
+
writeUser: writeUser((0, import_node_path22.join)(path8, "users")),
|
|
2823
3222
|
/**
|
|
2824
3223
|
* Returns a user from EventCatalog
|
|
2825
3224
|
* @param id - The id of the user to retrieve
|
|
2826
3225
|
* @returns User|Undefined
|
|
2827
3226
|
*/
|
|
2828
|
-
getUser: getUser((0,
|
|
3227
|
+
getUser: getUser((0, import_node_path22.join)(path8, "users")),
|
|
2829
3228
|
/**
|
|
2830
3229
|
* Returns all user from EventCatalog
|
|
2831
3230
|
* @returns User[]|Undefined
|
|
2832
3231
|
*/
|
|
2833
|
-
getUsers: getUsers((0,
|
|
3232
|
+
getUsers: getUsers((0, import_node_path22.join)(path8)),
|
|
2834
3233
|
/**
|
|
2835
3234
|
* Remove a user by the user id
|
|
2836
3235
|
*
|
|
2837
3236
|
* @param id - The id of the user you want to remove
|
|
2838
3237
|
*
|
|
2839
3238
|
*/
|
|
2840
|
-
rmUserById: rmUserById((0,
|
|
3239
|
+
rmUserById: rmUserById((0, import_node_path22.join)(path8, "users")),
|
|
2841
3240
|
/**
|
|
2842
3241
|
* ================================
|
|
2843
3242
|
* Custom Docs
|
|
@@ -2848,32 +3247,32 @@ var src_default = (path6) => {
|
|
|
2848
3247
|
* @param path - The path to the custom doc to retrieve
|
|
2849
3248
|
* @returns CustomDoc|Undefined
|
|
2850
3249
|
*/
|
|
2851
|
-
getCustomDoc: getCustomDoc((0,
|
|
3250
|
+
getCustomDoc: getCustomDoc((0, import_node_path22.join)(path8, "docs")),
|
|
2852
3251
|
/**
|
|
2853
3252
|
* Returns all custom docs from EventCatalog
|
|
2854
3253
|
* @param options - Optional options to get custom docs from a specific path
|
|
2855
3254
|
* @returns CustomDoc[]|Undefined
|
|
2856
3255
|
*/
|
|
2857
|
-
getCustomDocs: getCustomDocs((0,
|
|
3256
|
+
getCustomDocs: getCustomDocs((0, import_node_path22.join)(path8, "docs")),
|
|
2858
3257
|
/**
|
|
2859
3258
|
* Writes a custom doc to EventCatalog
|
|
2860
3259
|
* @param customDoc - The custom doc to write
|
|
2861
3260
|
* @param options - Optional options to write the custom doc
|
|
2862
3261
|
*
|
|
2863
3262
|
*/
|
|
2864
|
-
writeCustomDoc: writeCustomDoc((0,
|
|
3263
|
+
writeCustomDoc: writeCustomDoc((0, import_node_path22.join)(path8, "docs")),
|
|
2865
3264
|
/**
|
|
2866
3265
|
* Removes a custom doc from EventCatalog
|
|
2867
3266
|
* @param path - The path to the custom doc to remove
|
|
2868
3267
|
*
|
|
2869
3268
|
*/
|
|
2870
|
-
rmCustomDoc: rmCustomDoc((0,
|
|
3269
|
+
rmCustomDoc: rmCustomDoc((0, import_node_path22.join)(path8, "docs")),
|
|
2871
3270
|
/**
|
|
2872
3271
|
* Dumps the catalog to a JSON file.
|
|
2873
3272
|
* @param directory - The directory to dump the catalog to
|
|
2874
3273
|
* @returns A JSON file with the catalog
|
|
2875
3274
|
*/
|
|
2876
|
-
dumpCatalog: dumpCatalog((0,
|
|
3275
|
+
dumpCatalog: dumpCatalog((0, import_node_path22.join)(path8)),
|
|
2877
3276
|
/**
|
|
2878
3277
|
* Returns the event catalog configuration file.
|
|
2879
3278
|
* The event catalog configuration file is the file that contains the configuration for the event catalog.
|
|
@@ -2881,7 +3280,47 @@ var src_default = (path6) => {
|
|
|
2881
3280
|
* @param directory - The directory of the catalog.
|
|
2882
3281
|
* @returns A JSON object with the configuration for the event catalog.
|
|
2883
3282
|
*/
|
|
2884
|
-
getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0,
|
|
3283
|
+
getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path22.join)(path8)),
|
|
3284
|
+
/**
|
|
3285
|
+
* ================================
|
|
3286
|
+
* Changelogs
|
|
3287
|
+
* ================================
|
|
3288
|
+
*/
|
|
3289
|
+
/**
|
|
3290
|
+
* Writes a changelog entry to a resource in EventCatalog
|
|
3291
|
+
*
|
|
3292
|
+
* @param id - The id of the resource to write the changelog to
|
|
3293
|
+
* @param changelog - The changelog entry to write
|
|
3294
|
+
* @param options - Optional options (version, format)
|
|
3295
|
+
*
|
|
3296
|
+
*/
|
|
3297
|
+
writeChangelog: writeChangelog((0, import_node_path22.join)(path8)),
|
|
3298
|
+
/**
|
|
3299
|
+
* Appends a changelog entry to an existing changelog for a resource.
|
|
3300
|
+
* If no changelog exists, one is created.
|
|
3301
|
+
*
|
|
3302
|
+
* @param id - The id of the resource to append the changelog to
|
|
3303
|
+
* @param changelog - The changelog entry to append
|
|
3304
|
+
* @param options - Optional options (version, format)
|
|
3305
|
+
*
|
|
3306
|
+
*/
|
|
3307
|
+
appendChangelog: appendChangelog((0, import_node_path22.join)(path8)),
|
|
3308
|
+
/**
|
|
3309
|
+
* Returns the changelog for a resource in EventCatalog
|
|
3310
|
+
*
|
|
3311
|
+
* @param id - The id of the resource to get the changelog for
|
|
3312
|
+
* @param options - Optional options (version)
|
|
3313
|
+
* @returns Changelog|Undefined
|
|
3314
|
+
*/
|
|
3315
|
+
getChangelog: getChangelog((0, import_node_path22.join)(path8)),
|
|
3316
|
+
/**
|
|
3317
|
+
* Removes the changelog for a resource in EventCatalog
|
|
3318
|
+
*
|
|
3319
|
+
* @param id - The id of the resource to remove the changelog from
|
|
3320
|
+
* @param options - Optional options (version)
|
|
3321
|
+
*
|
|
3322
|
+
*/
|
|
3323
|
+
rmChangelog: rmChangelog((0, import_node_path22.join)(path8)),
|
|
2885
3324
|
/**
|
|
2886
3325
|
* ================================
|
|
2887
3326
|
* Resources Utils
|
|
@@ -2906,33 +3345,33 @@ var src_default = (path6) => {
|
|
|
2906
3345
|
* @param path - The path to the message to retrieve
|
|
2907
3346
|
* @returns Message|Undefined
|
|
2908
3347
|
*/
|
|
2909
|
-
getMessageBySchemaPath: getMessageBySchemaPath((0,
|
|
3348
|
+
getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path22.join)(path8)),
|
|
2910
3349
|
/**
|
|
2911
3350
|
* Returns the producers and consumers (services) for a given message
|
|
2912
3351
|
* @param id - The id of the message to get the producers and consumers for
|
|
2913
3352
|
* @param version - Optional version of the message
|
|
2914
3353
|
* @returns { producers: Service[], consumers: Service[] }
|
|
2915
3354
|
*/
|
|
2916
|
-
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0,
|
|
3355
|
+
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path22.join)(path8)),
|
|
2917
3356
|
/**
|
|
2918
3357
|
* Returns the consumers of a given schema path
|
|
2919
3358
|
* @param path - The path to the schema to get the consumers for
|
|
2920
3359
|
* @returns Service[]
|
|
2921
3360
|
*/
|
|
2922
|
-
getConsumersOfSchema: getConsumersOfSchema((0,
|
|
3361
|
+
getConsumersOfSchema: getConsumersOfSchema((0, import_node_path22.join)(path8)),
|
|
2923
3362
|
/**
|
|
2924
3363
|
* Returns the producers of a given schema path
|
|
2925
3364
|
* @param path - The path to the schema to get the producers for
|
|
2926
3365
|
* @returns Service[]
|
|
2927
3366
|
*/
|
|
2928
|
-
getProducersOfSchema: getProducersOfSchema((0,
|
|
3367
|
+
getProducersOfSchema: getProducersOfSchema((0, import_node_path22.join)(path8)),
|
|
2929
3368
|
/**
|
|
2930
3369
|
* Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
|
|
2931
3370
|
* @param id - The id of the resource to get the owners for
|
|
2932
3371
|
* @param version - Optional version of the resource
|
|
2933
3372
|
* @returns { owners: User[] }
|
|
2934
3373
|
*/
|
|
2935
|
-
getOwnersForResource: getOwnersForResource((0,
|
|
3374
|
+
getOwnersForResource: getOwnersForResource((0, import_node_path22.join)(path8)),
|
|
2936
3375
|
/**
|
|
2937
3376
|
* ================================
|
|
2938
3377
|
* Entities
|
|
@@ -2944,13 +3383,13 @@ var src_default = (path6) => {
|
|
|
2944
3383
|
* @param version - Optional id of the version to get (supports semver)
|
|
2945
3384
|
* @returns Entity|Undefined
|
|
2946
3385
|
*/
|
|
2947
|
-
getEntity: getEntity((0,
|
|
3386
|
+
getEntity: getEntity((0, import_node_path22.join)(path8)),
|
|
2948
3387
|
/**
|
|
2949
3388
|
* Returns all entities from EventCatalog
|
|
2950
3389
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2951
3390
|
* @returns Entity[]|Undefined
|
|
2952
3391
|
*/
|
|
2953
|
-
getEntities: getEntities((0,
|
|
3392
|
+
getEntities: getEntities((0, import_node_path22.join)(path8)),
|
|
2954
3393
|
/**
|
|
2955
3394
|
* Adds an entity to EventCatalog
|
|
2956
3395
|
*
|
|
@@ -2958,33 +3397,33 @@ var src_default = (path6) => {
|
|
|
2958
3397
|
* @param options - Optional options to write the entity
|
|
2959
3398
|
*
|
|
2960
3399
|
*/
|
|
2961
|
-
writeEntity: writeEntity((0,
|
|
3400
|
+
writeEntity: writeEntity((0, import_node_path22.join)(path8, "entities")),
|
|
2962
3401
|
/**
|
|
2963
3402
|
* Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
|
|
2964
3403
|
*
|
|
2965
3404
|
* @param path - The path to your entity, e.g. `/User`
|
|
2966
3405
|
*
|
|
2967
3406
|
*/
|
|
2968
|
-
rmEntity: rmEntity((0,
|
|
3407
|
+
rmEntity: rmEntity((0, import_node_path22.join)(path8, "entities")),
|
|
2969
3408
|
/**
|
|
2970
3409
|
* Remove an entity by an entity id
|
|
2971
3410
|
*
|
|
2972
3411
|
* @param id - The id of the entity you want to remove
|
|
2973
3412
|
*
|
|
2974
3413
|
*/
|
|
2975
|
-
rmEntityById: rmEntityById((0,
|
|
3414
|
+
rmEntityById: rmEntityById((0, import_node_path22.join)(path8)),
|
|
2976
3415
|
/**
|
|
2977
3416
|
* Moves a given entity id to the version directory
|
|
2978
3417
|
* @param id - The id of the entity to version
|
|
2979
3418
|
*/
|
|
2980
|
-
versionEntity: versionEntity((0,
|
|
3419
|
+
versionEntity: versionEntity((0, import_node_path22.join)(path8)),
|
|
2981
3420
|
/**
|
|
2982
3421
|
* Check to see if an entity version exists
|
|
2983
3422
|
* @param id - The id of the entity
|
|
2984
3423
|
* @param version - The version of the entity (supports semver)
|
|
2985
3424
|
* @returns
|
|
2986
3425
|
*/
|
|
2987
|
-
entityHasVersion: entityHasVersion((0,
|
|
3426
|
+
entityHasVersion: entityHasVersion((0, import_node_path22.join)(path8)),
|
|
2988
3427
|
/**
|
|
2989
3428
|
* ================================
|
|
2990
3429
|
* Data Stores
|
|
@@ -2996,42 +3435,42 @@ var src_default = (path6) => {
|
|
|
2996
3435
|
* @param options - Optional options to write the data store
|
|
2997
3436
|
*
|
|
2998
3437
|
*/
|
|
2999
|
-
writeDataStore: writeDataStore((0,
|
|
3438
|
+
writeDataStore: writeDataStore((0, import_node_path22.join)(path8, "containers")),
|
|
3000
3439
|
/**
|
|
3001
3440
|
* Returns a data store from EventCatalog
|
|
3002
3441
|
* @param id - The id of the data store to retrieve
|
|
3003
3442
|
* @param version - Optional id of the version to get (supports semver)
|
|
3004
3443
|
* @returns Container|Undefined
|
|
3005
3444
|
*/
|
|
3006
|
-
getDataStore: getDataStore((0,
|
|
3445
|
+
getDataStore: getDataStore((0, import_node_path22.join)(path8)),
|
|
3007
3446
|
/**
|
|
3008
3447
|
* Returns all data stores from EventCatalog
|
|
3009
3448
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
3010
3449
|
* @returns Container[]|Undefined
|
|
3011
3450
|
*/
|
|
3012
|
-
getDataStores: getDataStores((0,
|
|
3451
|
+
getDataStores: getDataStores((0, import_node_path22.join)(path8)),
|
|
3013
3452
|
/**
|
|
3014
3453
|
* Version a data store by its id
|
|
3015
3454
|
* @param id - The id of the data store to version
|
|
3016
3455
|
*/
|
|
3017
|
-
versionDataStore: versionDataStore((0,
|
|
3456
|
+
versionDataStore: versionDataStore((0, import_node_path22.join)(path8, "containers")),
|
|
3018
3457
|
/**
|
|
3019
3458
|
* Remove a data store by its path
|
|
3020
3459
|
* @param path - The path to the data store to remove
|
|
3021
3460
|
*/
|
|
3022
|
-
rmDataStore: rmDataStore((0,
|
|
3461
|
+
rmDataStore: rmDataStore((0, import_node_path22.join)(path8, "containers")),
|
|
3023
3462
|
/**
|
|
3024
3463
|
* Remove a data store by its id
|
|
3025
3464
|
* @param id - The id of the data store to remove
|
|
3026
3465
|
*/
|
|
3027
|
-
rmDataStoreById: rmDataStoreById((0,
|
|
3466
|
+
rmDataStoreById: rmDataStoreById((0, import_node_path22.join)(path8)),
|
|
3028
3467
|
/**
|
|
3029
3468
|
* Check to see if a data store version exists
|
|
3030
3469
|
* @param id - The id of the data store
|
|
3031
3470
|
* @param version - The version of the data store (supports semver)
|
|
3032
3471
|
* @returns
|
|
3033
3472
|
*/
|
|
3034
|
-
dataStoreHasVersion: dataStoreHasVersion((0,
|
|
3473
|
+
dataStoreHasVersion: dataStoreHasVersion((0, import_node_path22.join)(path8)),
|
|
3035
3474
|
/**
|
|
3036
3475
|
* Adds a file to a data store by its id
|
|
3037
3476
|
* @param id - The id of the data store to add the file to
|
|
@@ -3039,14 +3478,14 @@ var src_default = (path6) => {
|
|
|
3039
3478
|
* @param version - Optional version of the data store to add the file to
|
|
3040
3479
|
* @returns
|
|
3041
3480
|
*/
|
|
3042
|
-
addFileToDataStore: addFileToDataStore((0,
|
|
3481
|
+
addFileToDataStore: addFileToDataStore((0, import_node_path22.join)(path8)),
|
|
3043
3482
|
/**
|
|
3044
3483
|
* Writes a data store to a service by its id
|
|
3045
3484
|
* @param dataStore - The data store to write
|
|
3046
3485
|
* @param service - The service to write the data store to
|
|
3047
3486
|
* @returns
|
|
3048
3487
|
*/
|
|
3049
|
-
writeDataStoreToService: writeDataStoreToService((0,
|
|
3488
|
+
writeDataStoreToService: writeDataStoreToService((0, import_node_path22.join)(path8)),
|
|
3050
3489
|
/**
|
|
3051
3490
|
* ================================
|
|
3052
3491
|
* Data Products
|
|
@@ -3058,7 +3497,7 @@ var src_default = (path6) => {
|
|
|
3058
3497
|
* @param options - Optional options to write the data product
|
|
3059
3498
|
*
|
|
3060
3499
|
*/
|
|
3061
|
-
writeDataProduct: writeDataProduct((0,
|
|
3500
|
+
writeDataProduct: writeDataProduct((0, import_node_path22.join)(path8, "data-products")),
|
|
3062
3501
|
/**
|
|
3063
3502
|
* Writes a data product to a domain in EventCatalog
|
|
3064
3503
|
* @param dataProduct - The data product to write
|
|
@@ -3066,43 +3505,43 @@ var src_default = (path6) => {
|
|
|
3066
3505
|
* @param options - Optional options to write the data product
|
|
3067
3506
|
*
|
|
3068
3507
|
*/
|
|
3069
|
-
writeDataProductToDomain: writeDataProductToDomain((0,
|
|
3508
|
+
writeDataProductToDomain: writeDataProductToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
3070
3509
|
/**
|
|
3071
3510
|
* Returns a data product from EventCatalog
|
|
3072
3511
|
* @param id - The id of the data product to retrieve
|
|
3073
3512
|
* @param version - Optional id of the version to get (supports semver)
|
|
3074
3513
|
* @returns DataProduct|Undefined
|
|
3075
3514
|
*/
|
|
3076
|
-
getDataProduct: getDataProduct((0,
|
|
3515
|
+
getDataProduct: getDataProduct((0, import_node_path22.join)(path8)),
|
|
3077
3516
|
/**
|
|
3078
3517
|
* Returns all data products from EventCatalog
|
|
3079
3518
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
3080
3519
|
* @returns DataProduct[]|Undefined
|
|
3081
3520
|
*/
|
|
3082
|
-
getDataProducts: getDataProducts((0,
|
|
3521
|
+
getDataProducts: getDataProducts((0, import_node_path22.join)(path8)),
|
|
3083
3522
|
/**
|
|
3084
3523
|
* Version a data product by its id
|
|
3085
3524
|
* @param id - The id of the data product to version
|
|
3086
3525
|
*/
|
|
3087
|
-
versionDataProduct: versionDataProduct((0,
|
|
3526
|
+
versionDataProduct: versionDataProduct((0, import_node_path22.join)(path8)),
|
|
3088
3527
|
/**
|
|
3089
3528
|
* Remove a data product by its path
|
|
3090
3529
|
* @param path - The path to the data product to remove
|
|
3091
3530
|
*/
|
|
3092
|
-
rmDataProduct: rmDataProduct((0,
|
|
3531
|
+
rmDataProduct: rmDataProduct((0, import_node_path22.join)(path8, "data-products")),
|
|
3093
3532
|
/**
|
|
3094
3533
|
* Remove a data product by its id
|
|
3095
3534
|
* @param id - The id of the data product to remove
|
|
3096
3535
|
* @param version - Optional version of the data product to remove
|
|
3097
3536
|
*/
|
|
3098
|
-
rmDataProductById: rmDataProductById((0,
|
|
3537
|
+
rmDataProductById: rmDataProductById((0, import_node_path22.join)(path8)),
|
|
3099
3538
|
/**
|
|
3100
3539
|
* Check to see if a data product version exists
|
|
3101
3540
|
* @param id - The id of the data product
|
|
3102
3541
|
* @param version - The version of the data product (supports semver)
|
|
3103
3542
|
* @returns
|
|
3104
3543
|
*/
|
|
3105
|
-
dataProductHasVersion: dataProductHasVersion((0,
|
|
3544
|
+
dataProductHasVersion: dataProductHasVersion((0, import_node_path22.join)(path8)),
|
|
3106
3545
|
/**
|
|
3107
3546
|
* Adds a file to a data product by its id
|
|
3108
3547
|
* @param id - The id of the data product to add the file to
|
|
@@ -3110,7 +3549,7 @@ var src_default = (path6) => {
|
|
|
3110
3549
|
* @param version - Optional version of the data product to add the file to
|
|
3111
3550
|
* @returns
|
|
3112
3551
|
*/
|
|
3113
|
-
addFileToDataProduct: addFileToDataProduct((0,
|
|
3552
|
+
addFileToDataProduct: addFileToDataProduct((0, import_node_path22.join)(path8)),
|
|
3114
3553
|
/**
|
|
3115
3554
|
* Adds a data product to a domain
|
|
3116
3555
|
* @param id - The id of the domain
|
|
@@ -3118,7 +3557,7 @@ var src_default = (path6) => {
|
|
|
3118
3557
|
* @param version - (Optional) The version of the domain to add the data product to
|
|
3119
3558
|
* @returns
|
|
3120
3559
|
*/
|
|
3121
|
-
addDataProductToDomain: addDataProductToDomain((0,
|
|
3560
|
+
addDataProductToDomain: addDataProductToDomain((0, import_node_path22.join)(path8, "domains")),
|
|
3122
3561
|
/**
|
|
3123
3562
|
* ================================
|
|
3124
3563
|
* Diagrams
|
|
@@ -3130,13 +3569,13 @@ var src_default = (path6) => {
|
|
|
3130
3569
|
* @param version - Optional id of the version to get (supports semver)
|
|
3131
3570
|
* @returns Diagram|Undefined
|
|
3132
3571
|
*/
|
|
3133
|
-
getDiagram: getDiagram((0,
|
|
3572
|
+
getDiagram: getDiagram((0, import_node_path22.join)(path8)),
|
|
3134
3573
|
/**
|
|
3135
3574
|
* Returns all diagrams from EventCatalog
|
|
3136
3575
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
3137
3576
|
* @returns Diagram[]|Undefined
|
|
3138
3577
|
*/
|
|
3139
|
-
getDiagrams: getDiagrams((0,
|
|
3578
|
+
getDiagrams: getDiagrams((0, import_node_path22.join)(path8)),
|
|
3140
3579
|
/**
|
|
3141
3580
|
* Adds a diagram to EventCatalog
|
|
3142
3581
|
*
|
|
@@ -3144,33 +3583,33 @@ var src_default = (path6) => {
|
|
|
3144
3583
|
* @param options - Optional options to write the diagram
|
|
3145
3584
|
*
|
|
3146
3585
|
*/
|
|
3147
|
-
writeDiagram: writeDiagram((0,
|
|
3586
|
+
writeDiagram: writeDiagram((0, import_node_path22.join)(path8, "diagrams")),
|
|
3148
3587
|
/**
|
|
3149
3588
|
* Remove a diagram from EventCatalog (modeled on the standard POSIX rm utility)
|
|
3150
3589
|
*
|
|
3151
3590
|
* @param path - The path to your diagram, e.g. `/ArchitectureDiagram`
|
|
3152
3591
|
*
|
|
3153
3592
|
*/
|
|
3154
|
-
rmDiagram: rmDiagram((0,
|
|
3593
|
+
rmDiagram: rmDiagram((0, import_node_path22.join)(path8, "diagrams")),
|
|
3155
3594
|
/**
|
|
3156
3595
|
* Remove a diagram by a diagram id
|
|
3157
3596
|
*
|
|
3158
3597
|
* @param id - The id of the diagram you want to remove
|
|
3159
3598
|
*
|
|
3160
3599
|
*/
|
|
3161
|
-
rmDiagramById: rmDiagramById((0,
|
|
3600
|
+
rmDiagramById: rmDiagramById((0, import_node_path22.join)(path8)),
|
|
3162
3601
|
/**
|
|
3163
3602
|
* Moves a given diagram id to the version directory
|
|
3164
3603
|
* @param id - The id of the diagram to version
|
|
3165
3604
|
*/
|
|
3166
|
-
versionDiagram: versionDiagram((0,
|
|
3605
|
+
versionDiagram: versionDiagram((0, import_node_path22.join)(path8)),
|
|
3167
3606
|
/**
|
|
3168
3607
|
* Check to see if a diagram version exists
|
|
3169
3608
|
* @param id - The id of the diagram
|
|
3170
3609
|
* @param version - The version of the diagram (supports semver)
|
|
3171
3610
|
* @returns
|
|
3172
3611
|
*/
|
|
3173
|
-
diagramHasVersion: diagramHasVersion((0,
|
|
3612
|
+
diagramHasVersion: diagramHasVersion((0, import_node_path22.join)(path8)),
|
|
3174
3613
|
/**
|
|
3175
3614
|
* Adds a file to the given diagram
|
|
3176
3615
|
* @param id - The id of the diagram to add the file to
|
|
@@ -3178,7 +3617,7 @@ var src_default = (path6) => {
|
|
|
3178
3617
|
* @param version - Optional version of the diagram to add the file to
|
|
3179
3618
|
* @returns
|
|
3180
3619
|
*/
|
|
3181
|
-
addFileToDiagram: addFileToDiagram((0,
|
|
3620
|
+
addFileToDiagram: addFileToDiagram((0, import_node_path22.join)(path8)),
|
|
3182
3621
|
/**
|
|
3183
3622
|
* ================================
|
|
3184
3623
|
* DSL
|
|
@@ -3197,18 +3636,21 @@ var src_default = (path6) => {
|
|
|
3197
3636
|
* const dsl = await sdk.toDSL(services, { type: 'service', hydrate: true });
|
|
3198
3637
|
* ```
|
|
3199
3638
|
*/
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
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"))
|
|
3212
3654
|
})
|
|
3213
3655
|
};
|
|
3214
3656
|
};
|