@eventcatalog/sdk 2.11.0 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -1
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/{eventcatalog.js → cli/index.js} +588 -378
- package/dist/cli/index.js.map +1 -0
- package/dist/{eventcatalog.mjs → cli/index.mjs} +666 -436
- package/dist/cli/index.mjs.map +1 -0
- package/dist/cli-docs.d.mts +43 -0
- package/dist/cli-docs.d.ts +43 -0
- package/dist/cli-docs.js +1614 -0
- package/dist/cli-docs.js.map +1 -0
- package/dist/cli-docs.mjs +1586 -0
- package/dist/cli-docs.mjs.map +1 -0
- package/dist/index.d.mts +443 -25
- package/dist/index.d.ts +443 -25
- package/dist/index.js +204 -121
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +204 -121
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -4
- package/dist/channels.d.mts +0 -214
- package/dist/channels.d.ts +0 -214
- package/dist/channels.js +0 -432
- package/dist/channels.js.map +0 -1
- package/dist/channels.mjs +0 -384
- package/dist/channels.mjs.map +0 -1
- package/dist/commands.d.mts +0 -274
- package/dist/commands.d.ts +0 -274
- package/dist/commands.js +0 -394
- package/dist/commands.js.map +0 -1
- package/dist/commands.mjs +0 -350
- package/dist/commands.mjs.map +0 -1
- package/dist/containers.d.mts +0 -179
- package/dist/containers.d.ts +0 -179
- package/dist/containers.js +0 -388
- package/dist/containers.js.map +0 -1
- package/dist/containers.mjs +0 -345
- package/dist/containers.mjs.map +0 -1
- package/dist/custom-docs.d.mts +0 -89
- package/dist/custom-docs.d.ts +0 -89
- package/dist/custom-docs.js +0 -164
- package/dist/custom-docs.js.map +0 -1
- package/dist/custom-docs.mjs +0 -122
- package/dist/custom-docs.mjs.map +0 -1
- package/dist/data-products.d.mts +0 -225
- package/dist/data-products.d.ts +0 -225
- package/dist/data-products.js +0 -375
- package/dist/data-products.js.map +0 -1
- package/dist/data-products.mjs +0 -332
- package/dist/data-products.mjs.map +0 -1
- package/dist/data-stores.d.mts +0 -179
- package/dist/data-stores.d.ts +0 -179
- package/dist/data-stores.js +0 -401
- package/dist/data-stores.js.map +0 -1
- package/dist/data-stores.mjs +0 -356
- package/dist/data-stores.mjs.map +0 -1
- package/dist/domains.d.mts +0 -347
- package/dist/domains.d.ts +0 -347
- package/dist/domains.js +0 -547
- package/dist/domains.js.map +0 -1
- package/dist/domains.mjs +0 -498
- package/dist/domains.mjs.map +0 -1
- package/dist/entities.d.mts +0 -174
- package/dist/entities.d.ts +0 -174
- package/dist/entities.js +0 -348
- package/dist/entities.js.map +0 -1
- package/dist/entities.mjs +0 -307
- package/dist/entities.mjs.map +0 -1
- package/dist/eventcatalog.d.mts +0 -21
- package/dist/eventcatalog.d.ts +0 -21
- package/dist/eventcatalog.js.map +0 -1
- package/dist/eventcatalog.mjs.map +0 -1
- package/dist/events.d.mts +0 -276
- package/dist/events.d.ts +0 -276
- package/dist/events.js +0 -393
- package/dist/events.js.map +0 -1
- package/dist/events.mjs +0 -349
- package/dist/events.mjs.map +0 -1
- package/dist/messages.d.mts +0 -65
- package/dist/messages.d.ts +0 -65
- package/dist/messages.js +0 -312
- package/dist/messages.js.map +0 -1
- package/dist/messages.mjs +0 -269
- package/dist/messages.mjs.map +0 -1
- package/dist/queries.d.mts +0 -276
- package/dist/queries.d.ts +0 -276
- package/dist/queries.js +0 -394
- package/dist/queries.js.map +0 -1
- package/dist/queries.mjs +0 -350
- package/dist/queries.mjs.map +0 -1
- package/dist/services.d.mts +0 -384
- package/dist/services.d.ts +0 -384
- package/dist/services.js +0 -577
- package/dist/services.js.map +0 -1
- package/dist/services.mjs +0 -526
- package/dist/services.mjs.map +0 -1
- package/dist/teams.d.mts +0 -90
- package/dist/teams.d.ts +0 -90
- package/dist/teams.js +0 -246
- package/dist/teams.js.map +0 -1
- package/dist/teams.mjs +0 -202
- package/dist/teams.mjs.map +0 -1
- package/dist/types.d.d.mts +0 -331
- package/dist/types.d.d.ts +0 -331
- package/dist/types.d.js +0 -19
- package/dist/types.d.js.map +0 -1
- package/dist/types.d.mjs +0 -1
- package/dist/types.d.mjs.map +0 -1
- package/dist/users.d.mts +0 -83
- package/dist/users.d.ts +0 -83
- package/dist/users.js +0 -127
- package/dist/users.js.map +0 -1
- package/dist/users.mjs +0 -88
- package/dist/users.mjs.map +0 -1
|
@@ -1,9 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// node_modules/.pnpm/tsup@8.2.4_postcss@8.4.45_typescript@5.5.4/node_modules/tsup/assets/esm_shims.js
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import path from "path";
|
|
6
|
+
var getFilename = () => fileURLToPath(import.meta.url);
|
|
7
|
+
var getDirname = () => path.dirname(getFilename());
|
|
8
|
+
var __dirname = /* @__PURE__ */ getDirname();
|
|
9
|
+
|
|
10
|
+
// src/cli/index.ts
|
|
11
|
+
import { program } from "commander";
|
|
12
|
+
import { readFileSync } from "node:fs";
|
|
13
|
+
import { resolve as resolve2 } from "node:path";
|
|
14
|
+
|
|
15
|
+
// src/cli/executor.ts
|
|
16
|
+
import { existsSync } from "node:fs";
|
|
17
|
+
|
|
18
|
+
// src/cli/parser.ts
|
|
19
|
+
function parseArguments(rawArgs) {
|
|
20
|
+
return rawArgs.map((arg, index) => {
|
|
21
|
+
if (arg.startsWith("{") && arg.endsWith("}") || arg.startsWith("[") && arg.endsWith("]")) {
|
|
22
|
+
try {
|
|
23
|
+
return JSON.parse(arg);
|
|
24
|
+
} catch (error) {
|
|
25
|
+
if (arg.includes(":") || arg.includes(",")) {
|
|
26
|
+
throw new Error(`Invalid JSON in argument ${index + 1}: ${error instanceof Error ? error.message : String(error)}`);
|
|
27
|
+
}
|
|
28
|
+
return arg;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (arg === "true") return true;
|
|
32
|
+
if (arg === "false") return false;
|
|
33
|
+
if (/^-?\d+(\.\d+)?$/.test(arg)) {
|
|
34
|
+
return Number(arg);
|
|
35
|
+
}
|
|
36
|
+
return arg;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
4
39
|
|
|
5
40
|
// src/index.ts
|
|
6
|
-
import { join as
|
|
41
|
+
import { join as join18 } from "node:path";
|
|
7
42
|
|
|
8
43
|
// src/events.ts
|
|
9
44
|
import fs2 from "node:fs/promises";
|
|
@@ -16,30 +51,30 @@ import { copy } from "fs-extra";
|
|
|
16
51
|
import { join, dirname, normalize, resolve, relative } from "node:path";
|
|
17
52
|
import matter from "gray-matter";
|
|
18
53
|
import { satisfies, validRange } from "semver";
|
|
19
|
-
var versionExists = async (catalogDir, id,
|
|
54
|
+
var versionExists = async (catalogDir, id, version2) => {
|
|
20
55
|
const files = await getFiles(`${catalogDir}/**/index.{md,mdx}`);
|
|
21
|
-
const matchedFiles = await searchFilesForId(files, id,
|
|
56
|
+
const matchedFiles = await searchFilesForId(files, id, version2) || [];
|
|
22
57
|
return matchedFiles.length > 0;
|
|
23
58
|
};
|
|
24
|
-
var findFileById = async (catalogDir, id,
|
|
59
|
+
var findFileById = async (catalogDir, id, version2) => {
|
|
25
60
|
const files = await getFiles(`${catalogDir}/**/index.{md,mdx}`);
|
|
26
61
|
const matchedFiles = await searchFilesForId(files, id) || [];
|
|
27
|
-
const latestVersion = matchedFiles.find((
|
|
28
|
-
if (!
|
|
62
|
+
const latestVersion = matchedFiles.find((path7) => !path7.includes("versioned"));
|
|
63
|
+
if (!version2) {
|
|
29
64
|
return latestVersion;
|
|
30
65
|
}
|
|
31
|
-
const parsedFiles = matchedFiles.map((
|
|
32
|
-
const { data } = matter.read(
|
|
33
|
-
return { ...data, path:
|
|
66
|
+
const parsedFiles = matchedFiles.map((path7) => {
|
|
67
|
+
const { data } = matter.read(path7);
|
|
68
|
+
return { ...data, path: path7 };
|
|
34
69
|
});
|
|
35
|
-
if (
|
|
70
|
+
if (version2 === "latest") {
|
|
36
71
|
return latestVersion;
|
|
37
72
|
}
|
|
38
|
-
const exactMatch = parsedFiles.find((c) => c.version ===
|
|
73
|
+
const exactMatch = parsedFiles.find((c) => c.version === version2);
|
|
39
74
|
if (exactMatch) {
|
|
40
75
|
return exactMatch.path;
|
|
41
76
|
}
|
|
42
|
-
const semverRange = validRange(
|
|
77
|
+
const semverRange = validRange(version2);
|
|
43
78
|
if (semverRange) {
|
|
44
79
|
const match = parsedFiles.filter((c) => {
|
|
45
80
|
try {
|
|
@@ -78,19 +113,19 @@ var getFiles = async (pattern, ignore = "") => {
|
|
|
78
113
|
);
|
|
79
114
|
}
|
|
80
115
|
};
|
|
81
|
-
var readMdxFile = async (
|
|
82
|
-
const { data } = matter.read(
|
|
116
|
+
var readMdxFile = async (path7) => {
|
|
117
|
+
const { data } = matter.read(path7);
|
|
83
118
|
const { markdown, ...frontmatter } = data;
|
|
84
119
|
return { ...frontmatter, markdown };
|
|
85
120
|
};
|
|
86
|
-
var searchFilesForId = async (files, id,
|
|
121
|
+
var searchFilesForId = async (files, id, version2) => {
|
|
87
122
|
const escapedId = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
88
123
|
const idRegex = new RegExp(`^id:\\s*(['"]|>-)?\\s*${escapedId}['"]?\\s*$`, "m");
|
|
89
|
-
const versionRegex = new RegExp(`^version:\\s*['"]?${
|
|
124
|
+
const versionRegex = new RegExp(`^version:\\s*['"]?${version2}['"]?\\s*$`, "m");
|
|
90
125
|
const matches = files.map((file) => {
|
|
91
126
|
const content = fsSync.readFileSync(file, "utf-8");
|
|
92
127
|
const hasIdMatch = content.match(idRegex);
|
|
93
|
-
if (
|
|
128
|
+
if (version2 && !content.match(versionRegex)) {
|
|
94
129
|
return void 0;
|
|
95
130
|
}
|
|
96
131
|
if (hasIdMatch) {
|
|
@@ -132,7 +167,7 @@ import fsSync2 from "node:fs";
|
|
|
132
167
|
import { satisfies as satisfies2 } from "semver";
|
|
133
168
|
import { lock, unlock } from "proper-lockfile";
|
|
134
169
|
import { basename as basename2 } from "node:path";
|
|
135
|
-
import
|
|
170
|
+
import path2 from "node:path";
|
|
136
171
|
var versionResource = async (catalogDir, id) => {
|
|
137
172
|
const files = await getFiles(`${catalogDir}/**/index.{md,mdx}`);
|
|
138
173
|
const matchedFiles = await searchFilesForId(files, id);
|
|
@@ -140,9 +175,9 @@ var versionResource = async (catalogDir, id) => {
|
|
|
140
175
|
throw new Error(`No resource found with id: ${id}`);
|
|
141
176
|
}
|
|
142
177
|
const file = matchedFiles[0];
|
|
143
|
-
const sourceDirectory = dirname2(file).replace(/[/\\]versioned[/\\][^/\\]+[/\\]/,
|
|
144
|
-
const { data: { version = "0.0.1" } = {} } = matter2.read(file);
|
|
145
|
-
const targetDirectory = getVersionedDirectory(sourceDirectory,
|
|
178
|
+
const sourceDirectory = dirname2(file).replace(/[/\\]versioned[/\\][^/\\]+[/\\]/, path2.sep);
|
|
179
|
+
const { data: { version: version2 = "0.0.1" } = {} } = matter2.read(file);
|
|
180
|
+
const targetDirectory = getVersionedDirectory(sourceDirectory, version2);
|
|
146
181
|
fsSync2.mkdirSync(targetDirectory, { recursive: true });
|
|
147
182
|
const ignoreListToCopy = ["events", "commands", "queries", "versioned"];
|
|
148
183
|
await copyDir(catalogDir, sourceDirectory, targetDirectory, (src) => {
|
|
@@ -172,8 +207,8 @@ var writeResource = async (catalogDir, resource, options = {
|
|
|
172
207
|
versionExistingContent: false,
|
|
173
208
|
format: "mdx"
|
|
174
209
|
}) => {
|
|
175
|
-
const
|
|
176
|
-
const fullPath = join2(catalogDir,
|
|
210
|
+
const path7 = options.path || `/${resource.id}`;
|
|
211
|
+
const fullPath = join2(catalogDir, path7);
|
|
177
212
|
const format = options.format || "mdx";
|
|
178
213
|
fsSync2.mkdirSync(fullPath, { recursive: true });
|
|
179
214
|
const lockPath = join2(fullPath, `index.${format}`);
|
|
@@ -208,9 +243,9 @@ var writeResource = async (catalogDir, resource, options = {
|
|
|
208
243
|
});
|
|
209
244
|
}
|
|
210
245
|
};
|
|
211
|
-
var getResource = async (catalogDir, id,
|
|
246
|
+
var getResource = async (catalogDir, id, version2, options, filePath) => {
|
|
212
247
|
const attachSchema = options?.attachSchema || false;
|
|
213
|
-
const file = filePath || (id ? await findFileById(catalogDir, id,
|
|
248
|
+
const file = filePath || (id ? await findFileById(catalogDir, id, version2) : void 0);
|
|
214
249
|
if (!file || !fsSync2.existsSync(file)) return;
|
|
215
250
|
const { data, content } = matter2.read(file);
|
|
216
251
|
if (attachSchema && data?.schemaPath) {
|
|
@@ -230,8 +265,8 @@ var getResource = async (catalogDir, id, version, options, filePath) => {
|
|
|
230
265
|
markdown: content.trim()
|
|
231
266
|
};
|
|
232
267
|
};
|
|
233
|
-
var getResourcePath = async (catalogDir, id,
|
|
234
|
-
const file = await findFileById(catalogDir, id,
|
|
268
|
+
var getResourcePath = async (catalogDir, id, version2) => {
|
|
269
|
+
const file = await findFileById(catalogDir, id, version2);
|
|
235
270
|
if (!file) return;
|
|
236
271
|
return {
|
|
237
272
|
fullPath: file,
|
|
@@ -239,10 +274,10 @@ var getResourcePath = async (catalogDir, id, version) => {
|
|
|
239
274
|
directory: dirname2(file.replace(catalogDir, ""))
|
|
240
275
|
};
|
|
241
276
|
};
|
|
242
|
-
var getResourceFolderName = async (catalogDir, id,
|
|
243
|
-
const paths = await getResourcePath(catalogDir, id,
|
|
277
|
+
var getResourceFolderName = async (catalogDir, id, version2) => {
|
|
278
|
+
const paths = await getResourcePath(catalogDir, id, version2);
|
|
244
279
|
if (!paths) return;
|
|
245
|
-
return paths?.directory.split(
|
|
280
|
+
return paths?.directory.split(path2.sep).filter(Boolean).pop();
|
|
246
281
|
};
|
|
247
282
|
var toResource = async (catalogDir, rawContents) => {
|
|
248
283
|
const { data, content } = matter2(rawContents);
|
|
@@ -282,9 +317,9 @@ var getResources = async (catalogDir, {
|
|
|
282
317
|
};
|
|
283
318
|
});
|
|
284
319
|
};
|
|
285
|
-
var rmResourceById = async (catalogDir, id,
|
|
320
|
+
var rmResourceById = async (catalogDir, id, version2, options) => {
|
|
286
321
|
const files = await getFiles(`${catalogDir}/**/index.{md,mdx}`);
|
|
287
|
-
const matchedFiles = await searchFilesForId(files, id,
|
|
322
|
+
const matchedFiles = await searchFilesForId(files, id, version2);
|
|
288
323
|
if (matchedFiles.length === 0) {
|
|
289
324
|
throw new Error(`No ${options?.type || "resource"} found with id: ${id}`);
|
|
290
325
|
}
|
|
@@ -305,26 +340,26 @@ var rmResourceById = async (catalogDir, id, version, options) => {
|
|
|
305
340
|
);
|
|
306
341
|
}
|
|
307
342
|
};
|
|
308
|
-
var waitForFileRemoval = async (
|
|
343
|
+
var waitForFileRemoval = async (path7, maxRetries = 50, delay = 10) => {
|
|
309
344
|
for (let i = 0; i < maxRetries; i++) {
|
|
310
345
|
try {
|
|
311
|
-
await fs.access(
|
|
312
|
-
await new Promise((
|
|
346
|
+
await fs.access(path7);
|
|
347
|
+
await new Promise((resolve3) => setTimeout(resolve3, delay));
|
|
313
348
|
} catch (error) {
|
|
314
349
|
return;
|
|
315
350
|
}
|
|
316
351
|
}
|
|
317
|
-
throw new Error(`File/directory ${
|
|
352
|
+
throw new Error(`File/directory ${path7} was not removed after ${maxRetries} attempts`);
|
|
318
353
|
};
|
|
319
|
-
var addFileToResource = async (catalogDir, id, file,
|
|
354
|
+
var addFileToResource = async (catalogDir, id, file, version2, options) => {
|
|
320
355
|
let pathToResource;
|
|
321
356
|
if (options?.path) {
|
|
322
357
|
pathToResource = join2(catalogDir, options.path, "index.mdx");
|
|
323
358
|
} else {
|
|
324
|
-
pathToResource = await findFileById(catalogDir, id,
|
|
359
|
+
pathToResource = await findFileById(catalogDir, id, version2);
|
|
325
360
|
}
|
|
326
361
|
if (!pathToResource) throw new Error("Cannot find directory to write file to");
|
|
327
|
-
fsSync2.mkdirSync(
|
|
362
|
+
fsSync2.mkdirSync(path2.dirname(pathToResource), { recursive: true });
|
|
328
363
|
let fileContent = file.content.trim();
|
|
329
364
|
try {
|
|
330
365
|
const json = JSON.parse(fileContent);
|
|
@@ -333,25 +368,25 @@ var addFileToResource = async (catalogDir, id, file, version, options) => {
|
|
|
333
368
|
}
|
|
334
369
|
fsSync2.writeFileSync(join2(dirname2(pathToResource), file.fileName), fileContent);
|
|
335
370
|
};
|
|
336
|
-
var getFileFromResource = async (catalogDir, id, file,
|
|
337
|
-
const pathToResource = await findFileById(catalogDir, id,
|
|
371
|
+
var getFileFromResource = async (catalogDir, id, file, version2) => {
|
|
372
|
+
const pathToResource = await findFileById(catalogDir, id, version2);
|
|
338
373
|
if (!pathToResource) throw new Error("Cannot find directory of resource");
|
|
339
374
|
const exists = await fs.access(join2(dirname2(pathToResource), file.fileName)).then(() => true).catch(() => false);
|
|
340
|
-
if (!exists) throw new Error(`File ${file.fileName} does not exist in resource ${id} v(${
|
|
375
|
+
if (!exists) throw new Error(`File ${file.fileName} does not exist in resource ${id} v(${version2})`);
|
|
341
376
|
return fsSync2.readFileSync(join2(dirname2(pathToResource), file.fileName), "utf-8");
|
|
342
377
|
};
|
|
343
|
-
var getVersionedDirectory = (sourceDirectory,
|
|
344
|
-
return join2(sourceDirectory, "versioned",
|
|
378
|
+
var getVersionedDirectory = (sourceDirectory, version2) => {
|
|
379
|
+
return join2(sourceDirectory, "versioned", version2);
|
|
345
380
|
};
|
|
346
|
-
var isLatestVersion = async (catalogDir, id,
|
|
347
|
-
const resource = await getResource(catalogDir, id,
|
|
381
|
+
var isLatestVersion = async (catalogDir, id, version2) => {
|
|
382
|
+
const resource = await getResource(catalogDir, id, version2);
|
|
348
383
|
if (!resource) return false;
|
|
349
|
-
const pathToResource = await getResourcePath(catalogDir, id,
|
|
384
|
+
const pathToResource = await getResourcePath(catalogDir, id, version2);
|
|
350
385
|
return !pathToResource?.relativePath.replace(/\\/g, "/").includes("/versioned/");
|
|
351
386
|
};
|
|
352
387
|
|
|
353
388
|
// src/events.ts
|
|
354
|
-
var getEvent = (directory) => async (id,
|
|
389
|
+
var getEvent = (directory) => async (id, version2, options) => getResource(directory, id, version2, { type: "event", ...options });
|
|
355
390
|
var getEvents = (directory) => async (options) => getResources(directory, { type: "events", ...options });
|
|
356
391
|
var writeEvent = (directory) => async (event, options = {
|
|
357
392
|
path: "",
|
|
@@ -367,26 +402,26 @@ var writeEventToService = (directory) => async (event, service, options = { path
|
|
|
367
402
|
pathForEvent = join3(pathForEvent, event.id);
|
|
368
403
|
await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
|
|
369
404
|
};
|
|
370
|
-
var rmEvent = (directory) => async (
|
|
371
|
-
await fs2.rm(join3(directory,
|
|
405
|
+
var rmEvent = (directory) => async (path7) => {
|
|
406
|
+
await fs2.rm(join3(directory, path7), { recursive: true });
|
|
372
407
|
};
|
|
373
|
-
var rmEventById = (directory) => async (id,
|
|
374
|
-
await rmResourceById(directory, id,
|
|
408
|
+
var rmEventById = (directory) => async (id, version2, persistFiles) => {
|
|
409
|
+
await rmResourceById(directory, id, version2, { type: "event", persistFiles });
|
|
375
410
|
};
|
|
376
411
|
var versionEvent = (directory) => async (id) => versionResource(directory, id);
|
|
377
|
-
var addFileToEvent = (directory) => async (id, file,
|
|
378
|
-
var addSchemaToEvent = (directory) => async (id, schema,
|
|
379
|
-
await addFileToEvent(directory)(id, { content: schema.schema, fileName: schema.fileName },
|
|
412
|
+
var addFileToEvent = (directory) => async (id, file, version2, options) => addFileToResource(directory, id, file, version2, options);
|
|
413
|
+
var addSchemaToEvent = (directory) => async (id, schema, version2, options) => {
|
|
414
|
+
await addFileToEvent(directory)(id, { content: schema.schema, fileName: schema.fileName }, version2, options);
|
|
380
415
|
};
|
|
381
|
-
var eventHasVersion = (directory) => async (id,
|
|
382
|
-
const file = await findFileById(directory, id,
|
|
416
|
+
var eventHasVersion = (directory) => async (id, version2) => {
|
|
417
|
+
const file = await findFileById(directory, id, version2);
|
|
383
418
|
return !!file;
|
|
384
419
|
};
|
|
385
420
|
|
|
386
421
|
// src/commands.ts
|
|
387
422
|
import fs3 from "node:fs/promises";
|
|
388
423
|
import { join as join4 } from "node:path";
|
|
389
|
-
var getCommand = (directory) => async (id,
|
|
424
|
+
var getCommand = (directory) => async (id, version2, options) => getResource(directory, id, version2, { type: "command", ...options });
|
|
390
425
|
var getCommands = (directory) => async (options) => getResources(directory, { type: "commands", ...options });
|
|
391
426
|
var writeCommand = (directory) => async (command, options = {
|
|
392
427
|
path: "",
|
|
@@ -403,24 +438,24 @@ var writeCommandToService = (directory) => async (command, service, options = {
|
|
|
403
438
|
pathForCommand = join4(pathForCommand, command.id);
|
|
404
439
|
await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
|
|
405
440
|
};
|
|
406
|
-
var rmCommand = (directory) => async (
|
|
407
|
-
await fs3.rm(join4(directory,
|
|
441
|
+
var rmCommand = (directory) => async (path7) => {
|
|
442
|
+
await fs3.rm(join4(directory, path7), { recursive: true });
|
|
408
443
|
};
|
|
409
|
-
var rmCommandById = (directory) => async (id,
|
|
444
|
+
var rmCommandById = (directory) => async (id, version2, persistFiles) => rmResourceById(directory, id, version2, { type: "command", persistFiles });
|
|
410
445
|
var versionCommand = (directory) => async (id) => versionResource(directory, id);
|
|
411
|
-
var addFileToCommand = (directory) => async (id, file,
|
|
412
|
-
var addSchemaToCommand = (directory) => async (id, schema,
|
|
413
|
-
await addFileToCommand(directory)(id, { content: schema.schema, fileName: schema.fileName },
|
|
446
|
+
var addFileToCommand = (directory) => async (id, file, version2, options) => addFileToResource(directory, id, file, version2, options);
|
|
447
|
+
var addSchemaToCommand = (directory) => async (id, schema, version2, options) => {
|
|
448
|
+
await addFileToCommand(directory)(id, { content: schema.schema, fileName: schema.fileName }, version2, options);
|
|
414
449
|
};
|
|
415
|
-
var commandHasVersion = (directory) => async (id,
|
|
416
|
-
const file = await findFileById(directory, id,
|
|
450
|
+
var commandHasVersion = (directory) => async (id, version2) => {
|
|
451
|
+
const file = await findFileById(directory, id, version2);
|
|
417
452
|
return !!file;
|
|
418
453
|
};
|
|
419
454
|
|
|
420
455
|
// src/queries.ts
|
|
421
456
|
import fs4 from "node:fs/promises";
|
|
422
457
|
import { join as join5 } from "node:path";
|
|
423
|
-
var getQuery = (directory) => async (id,
|
|
458
|
+
var getQuery = (directory) => async (id, version2, options) => getResource(directory, id, version2, { type: "query", ...options });
|
|
424
459
|
var writeQuery = (directory) => async (query, options = {
|
|
425
460
|
path: "",
|
|
426
461
|
override: false,
|
|
@@ -437,28 +472,28 @@ var writeQueryToService = (directory) => async (query, service, options = { path
|
|
|
437
472
|
pathForQuery = join5(pathForQuery, query.id);
|
|
438
473
|
await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
|
|
439
474
|
};
|
|
440
|
-
var rmQuery = (directory) => async (
|
|
441
|
-
await fs4.rm(join5(directory,
|
|
475
|
+
var rmQuery = (directory) => async (path7) => {
|
|
476
|
+
await fs4.rm(join5(directory, path7), { recursive: true });
|
|
442
477
|
};
|
|
443
|
-
var rmQueryById = (directory) => async (id,
|
|
444
|
-
await rmResourceById(directory, id,
|
|
478
|
+
var rmQueryById = (directory) => async (id, version2, persistFiles) => {
|
|
479
|
+
await rmResourceById(directory, id, version2, { type: "query", persistFiles });
|
|
445
480
|
};
|
|
446
481
|
var versionQuery = (directory) => async (id) => versionResource(directory, id);
|
|
447
|
-
var addFileToQuery = (directory) => async (id, file,
|
|
448
|
-
var addSchemaToQuery = (directory) => async (id, schema,
|
|
449
|
-
await addFileToQuery(directory)(id, { content: schema.schema, fileName: schema.fileName },
|
|
482
|
+
var addFileToQuery = (directory) => async (id, file, version2, options) => addFileToResource(directory, id, file, version2, options);
|
|
483
|
+
var addSchemaToQuery = (directory) => async (id, schema, version2, options) => {
|
|
484
|
+
await addFileToQuery(directory)(id, { content: schema.schema, fileName: schema.fileName }, version2, options);
|
|
450
485
|
};
|
|
451
|
-
var queryHasVersion = (directory) => async (id,
|
|
452
|
-
const file = await findFileById(directory, id,
|
|
486
|
+
var queryHasVersion = (directory) => async (id, version2) => {
|
|
487
|
+
const file = await findFileById(directory, id, version2);
|
|
453
488
|
return !!file;
|
|
454
489
|
};
|
|
455
490
|
|
|
456
491
|
// src/services.ts
|
|
457
492
|
import fs5 from "node:fs/promises";
|
|
458
493
|
import { join as join6, dirname as dirname4, extname, relative as relative2 } from "node:path";
|
|
459
|
-
var getService = (directory) => async (id,
|
|
460
|
-
var getServiceByPath = (directory) => async (
|
|
461
|
-
const service = await getResource(directory, void 0, void 0, { type: "service" },
|
|
494
|
+
var getService = (directory) => async (id, version2) => getResource(directory, id, version2, { type: "service" });
|
|
495
|
+
var getServiceByPath = (directory) => async (path7) => {
|
|
496
|
+
const service = await getResource(directory, void 0, void 0, { type: "service" }, path7);
|
|
462
497
|
return service;
|
|
463
498
|
};
|
|
464
499
|
var getServices = (directory) => async (options) => getResources(directory, {
|
|
@@ -482,8 +517,8 @@ var writeService = (directory) => async (service, options = {
|
|
|
482
517
|
};
|
|
483
518
|
var writeVersionedService = (directory) => async (service) => {
|
|
484
519
|
const resource = { ...service };
|
|
485
|
-
const
|
|
486
|
-
return await writeService(directory)(resource, { path:
|
|
520
|
+
const path7 = getVersionedDirectory(service.id, service.version);
|
|
521
|
+
return await writeService(directory)(resource, { path: path7 });
|
|
487
522
|
};
|
|
488
523
|
var writeServiceToDomain = (directory) => async (service, domain, options = { path: "", format: "mdx", override: false }) => {
|
|
489
524
|
let pathForService = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/services` : `/${domain.id}/services`;
|
|
@@ -491,16 +526,16 @@ var writeServiceToDomain = (directory) => async (service, domain, options = { pa
|
|
|
491
526
|
await writeResource(directory, { ...service }, { ...options, path: pathForService, type: "service" });
|
|
492
527
|
};
|
|
493
528
|
var versionService = (directory) => async (id) => versionResource(directory, id);
|
|
494
|
-
var rmService = (directory) => async (
|
|
495
|
-
await fs5.rm(join6(directory,
|
|
529
|
+
var rmService = (directory) => async (path7) => {
|
|
530
|
+
await fs5.rm(join6(directory, path7), { recursive: true });
|
|
496
531
|
};
|
|
497
|
-
var rmServiceById = (directory) => async (id,
|
|
498
|
-
await rmResourceById(directory, id,
|
|
532
|
+
var rmServiceById = (directory) => async (id, version2, persistFiles) => {
|
|
533
|
+
await rmResourceById(directory, id, version2, { type: "service", persistFiles });
|
|
499
534
|
};
|
|
500
|
-
var addFileToService = (directory) => async (id, file,
|
|
501
|
-
var getSpecificationFilesForService = (directory) => async (id,
|
|
502
|
-
let service = await getService(directory)(id,
|
|
503
|
-
const filePathToService = await findFileById(directory, id,
|
|
535
|
+
var addFileToService = (directory) => async (id, file, version2) => addFileToResource(directory, id, file, version2);
|
|
536
|
+
var getSpecificationFilesForService = (directory) => async (id, version2) => {
|
|
537
|
+
let service = await getService(directory)(id, version2);
|
|
538
|
+
const filePathToService = await findFileById(directory, id, version2);
|
|
504
539
|
if (!filePathToService) throw new Error("Cannot find directory of service");
|
|
505
540
|
let specs = [];
|
|
506
541
|
if (service.specifications) {
|
|
@@ -518,16 +553,16 @@ var getSpecificationFilesForService = (directory) => async (id, version) => {
|
|
|
518
553
|
if (!fileName) {
|
|
519
554
|
throw new Error(`Specification file name for ${fileName} is undefined`);
|
|
520
555
|
}
|
|
521
|
-
const rawFile = await getFileFromResource(directory, id, { fileName },
|
|
556
|
+
const rawFile = await getFileFromResource(directory, id, { fileName }, version2);
|
|
522
557
|
return { key, content: rawFile, fileName, path: join6(dirname4(filePathToService), fileName) };
|
|
523
558
|
});
|
|
524
559
|
specs = await Promise.all(getSpecs);
|
|
525
560
|
}
|
|
526
561
|
return specs;
|
|
527
562
|
};
|
|
528
|
-
var addMessageToService = (directory) => async (id, direction, event,
|
|
529
|
-
let service = await getService(directory)(id,
|
|
530
|
-
const servicePath = await getResourcePath(directory, id,
|
|
563
|
+
var addMessageToService = (directory) => async (id, direction, event, version2) => {
|
|
564
|
+
let service = await getService(directory)(id, version2);
|
|
565
|
+
const servicePath = await getResourcePath(directory, id, version2);
|
|
531
566
|
const extension = extname(servicePath?.fullPath || "");
|
|
532
567
|
if (direction === "sends") {
|
|
533
568
|
if (service.sends === void 0) {
|
|
@@ -552,29 +587,29 @@ var addMessageToService = (directory) => async (id, direction, event, version) =
|
|
|
552
587
|
} else {
|
|
553
588
|
throw new Error(`Direction ${direction} is invalid, only 'receives' and 'sends' are supported`);
|
|
554
589
|
}
|
|
555
|
-
const existingResource = await findFileById(directory, id,
|
|
590
|
+
const existingResource = await findFileById(directory, id, version2);
|
|
556
591
|
if (!existingResource) {
|
|
557
592
|
throw new Error(`Cannot find service ${id} in the catalog`);
|
|
558
593
|
}
|
|
559
|
-
const
|
|
560
|
-
const pathToResource = join6(
|
|
561
|
-
await rmServiceById(directory)(id,
|
|
594
|
+
const path7 = existingResource.split(/[\\/]+services/)[0];
|
|
595
|
+
const pathToResource = join6(path7, "services");
|
|
596
|
+
await rmServiceById(directory)(id, version2);
|
|
562
597
|
await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
|
|
563
598
|
};
|
|
564
|
-
var serviceHasVersion = (directory) => async (id,
|
|
565
|
-
const file = await findFileById(directory, id,
|
|
599
|
+
var serviceHasVersion = (directory) => async (id, version2) => {
|
|
600
|
+
const file = await findFileById(directory, id, version2);
|
|
566
601
|
return !!file;
|
|
567
602
|
};
|
|
568
|
-
var isService = (directory) => async (
|
|
569
|
-
const service = await getServiceByPath(directory)(
|
|
570
|
-
const relativePath = relative2(directory,
|
|
603
|
+
var isService = (directory) => async (path7) => {
|
|
604
|
+
const service = await getServiceByPath(directory)(path7);
|
|
605
|
+
const relativePath = relative2(directory, path7);
|
|
571
606
|
const segments = relativePath.split(/[/\\]+/);
|
|
572
607
|
return !!service && segments.includes("services");
|
|
573
608
|
};
|
|
574
609
|
var toService = (directory) => async (file) => toResource(directory, file);
|
|
575
|
-
var addEntityToService = (directory) => async (id, entity,
|
|
576
|
-
let service = await getService(directory)(id,
|
|
577
|
-
const servicePath = await getResourcePath(directory, id,
|
|
610
|
+
var addEntityToService = (directory) => async (id, entity, version2) => {
|
|
611
|
+
let service = await getService(directory)(id, version2);
|
|
612
|
+
const servicePath = await getResourcePath(directory, id, version2);
|
|
578
613
|
const extension = extname(servicePath?.fullPath || "");
|
|
579
614
|
if (service.entities === void 0) {
|
|
580
615
|
service.entities = [];
|
|
@@ -585,18 +620,18 @@ var addEntityToService = (directory) => async (id, entity, version) => {
|
|
|
585
620
|
}
|
|
586
621
|
}
|
|
587
622
|
service.entities.push({ id: entity.id, version: entity.version });
|
|
588
|
-
const existingResource = await findFileById(directory, id,
|
|
623
|
+
const existingResource = await findFileById(directory, id, version2);
|
|
589
624
|
if (!existingResource) {
|
|
590
625
|
throw new Error(`Cannot find service ${id} in the catalog`);
|
|
591
626
|
}
|
|
592
|
-
const
|
|
593
|
-
const pathToResource = join6(
|
|
594
|
-
await rmServiceById(directory)(id,
|
|
627
|
+
const path7 = existingResource.split(/[\\/]+services/)[0];
|
|
628
|
+
const pathToResource = join6(path7, "services");
|
|
629
|
+
await rmServiceById(directory)(id, version2);
|
|
595
630
|
await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
|
|
596
631
|
};
|
|
597
|
-
var addDataStoreToService = (directory) => async (id, operation, dataStore,
|
|
598
|
-
let service = await getService(directory)(id,
|
|
599
|
-
const servicePath = await getResourcePath(directory, id,
|
|
632
|
+
var addDataStoreToService = (directory) => async (id, operation, dataStore, version2) => {
|
|
633
|
+
let service = await getService(directory)(id, version2);
|
|
634
|
+
const servicePath = await getResourcePath(directory, id, version2);
|
|
600
635
|
const extension = extname(servicePath?.fullPath || "");
|
|
601
636
|
if (operation === "writesTo") {
|
|
602
637
|
if (service.writesTo === void 0) {
|
|
@@ -621,22 +656,22 @@ var addDataStoreToService = (directory) => async (id, operation, dataStore, vers
|
|
|
621
656
|
} else {
|
|
622
657
|
throw new Error(`Operation ${operation} is invalid, only 'writesTo' and 'readsFrom' are supported`);
|
|
623
658
|
}
|
|
624
|
-
const existingResource = await findFileById(directory, id,
|
|
659
|
+
const existingResource = await findFileById(directory, id, version2);
|
|
625
660
|
if (!existingResource) {
|
|
626
661
|
throw new Error(`Cannot find service ${id} in the catalog`);
|
|
627
662
|
}
|
|
628
|
-
const
|
|
629
|
-
const pathToResource = join6(
|
|
630
|
-
await rmServiceById(directory)(id,
|
|
663
|
+
const path7 = existingResource.split(/[\\/]+services/)[0];
|
|
664
|
+
const pathToResource = join6(path7, "services");
|
|
665
|
+
await rmServiceById(directory)(id, version2);
|
|
631
666
|
await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
|
|
632
667
|
};
|
|
633
668
|
|
|
634
669
|
// src/domains.ts
|
|
635
670
|
import fs6 from "node:fs/promises";
|
|
636
|
-
import
|
|
671
|
+
import path3, { join as join7 } from "node:path";
|
|
637
672
|
import fsSync3 from "node:fs";
|
|
638
673
|
import matter3 from "gray-matter";
|
|
639
|
-
var getDomain = (directory) => async (id,
|
|
674
|
+
var getDomain = (directory) => async (id, version2) => getResource(directory, id, version2, { type: "domain" });
|
|
640
675
|
var getDomains = (directory) => async (options) => getResources(directory, {
|
|
641
676
|
type: "domains",
|
|
642
677
|
ignore: ["**/services/**", "**/events/**", "**/commands/**", "**/queries/**", "**/flows/**", "**/entities/**"],
|
|
@@ -667,20 +702,20 @@ var writeDomain = (directory) => async (domain, options = {
|
|
|
667
702
|
return await writeResource(directory, resource, { ...options, type: "domain" });
|
|
668
703
|
};
|
|
669
704
|
var versionDomain = (directory) => async (id) => versionResource(directory, id);
|
|
670
|
-
var rmDomain = (directory) => async (
|
|
671
|
-
await fs6.rm(join7(directory,
|
|
705
|
+
var rmDomain = (directory) => async (path7) => {
|
|
706
|
+
await fs6.rm(join7(directory, path7), { recursive: true });
|
|
672
707
|
};
|
|
673
|
-
var rmDomainById = (directory) => async (id,
|
|
674
|
-
var addFileToDomain = (directory) => async (id, file,
|
|
675
|
-
var addUbiquitousLanguageToDomain = (directory) => async (id, ubiquitousLanguageDictionary,
|
|
708
|
+
var rmDomainById = (directory) => async (id, version2, persistFiles) => rmResourceById(directory, id, version2, { type: "domain", persistFiles });
|
|
709
|
+
var addFileToDomain = (directory) => async (id, file, version2) => addFileToResource(directory, id, file, version2);
|
|
710
|
+
var addUbiquitousLanguageToDomain = (directory) => async (id, ubiquitousLanguageDictionary, version2) => {
|
|
676
711
|
const content = matter3.stringify("", {
|
|
677
712
|
...ubiquitousLanguageDictionary
|
|
678
713
|
});
|
|
679
|
-
await addFileToResource(directory, id, { content, fileName: "ubiquitous-language.mdx" },
|
|
714
|
+
await addFileToResource(directory, id, { content, fileName: "ubiquitous-language.mdx" }, version2);
|
|
680
715
|
};
|
|
681
|
-
var getUbiquitousLanguageFromDomain = (directory) => async (id,
|
|
682
|
-
const pathToDomain = await findFileById(directory, id,
|
|
683
|
-
const pathToUbiquitousLanguage =
|
|
716
|
+
var getUbiquitousLanguageFromDomain = (directory) => async (id, version2) => {
|
|
717
|
+
const pathToDomain = await findFileById(directory, id, version2) || "";
|
|
718
|
+
const pathToUbiquitousLanguage = path3.join(path3.dirname(pathToDomain), "ubiquitous-language.mdx");
|
|
684
719
|
const fileExists = fsSync3.existsSync(pathToUbiquitousLanguage);
|
|
685
720
|
if (!fileExists) {
|
|
686
721
|
return void 0;
|
|
@@ -688,14 +723,14 @@ var getUbiquitousLanguageFromDomain = (directory) => async (id, version) => {
|
|
|
688
723
|
const content = await readMdxFile(pathToUbiquitousLanguage);
|
|
689
724
|
return content;
|
|
690
725
|
};
|
|
691
|
-
var domainHasVersion = (directory) => async (id,
|
|
692
|
-
const file = await findFileById(directory, id,
|
|
726
|
+
var domainHasVersion = (directory) => async (id, version2) => {
|
|
727
|
+
const file = await findFileById(directory, id, version2);
|
|
693
728
|
return !!file;
|
|
694
729
|
};
|
|
695
|
-
var addServiceToDomain = (directory) => async (id, service,
|
|
696
|
-
let domain = await getDomain(directory)(id,
|
|
697
|
-
const domainPath = await getResourcePath(directory, id,
|
|
698
|
-
const extension =
|
|
730
|
+
var addServiceToDomain = (directory) => async (id, service, version2) => {
|
|
731
|
+
let domain = await getDomain(directory)(id, version2);
|
|
732
|
+
const domainPath = await getResourcePath(directory, id, version2);
|
|
733
|
+
const extension = path3.extname(domainPath?.fullPath || "");
|
|
699
734
|
if (domain.services === void 0) {
|
|
700
735
|
domain.services = [];
|
|
701
736
|
}
|
|
@@ -704,13 +739,13 @@ var addServiceToDomain = (directory) => async (id, service, version) => {
|
|
|
704
739
|
return;
|
|
705
740
|
}
|
|
706
741
|
domain.services.push(service);
|
|
707
|
-
await rmDomainById(directory)(id,
|
|
742
|
+
await rmDomainById(directory)(id, version2, true);
|
|
708
743
|
await writeDomain(directory)(domain, { format: extension === ".md" ? "md" : "mdx" });
|
|
709
744
|
};
|
|
710
|
-
var addSubDomainToDomain = (directory) => async (id, subDomain,
|
|
711
|
-
let domain = await getDomain(directory)(id,
|
|
712
|
-
const domainPath = await getResourcePath(directory, id,
|
|
713
|
-
const extension =
|
|
745
|
+
var addSubDomainToDomain = (directory) => async (id, subDomain, version2) => {
|
|
746
|
+
let domain = await getDomain(directory)(id, version2);
|
|
747
|
+
const domainPath = await getResourcePath(directory, id, version2);
|
|
748
|
+
const extension = path3.extname(domainPath?.fullPath || "");
|
|
714
749
|
if (domain.domains === void 0) {
|
|
715
750
|
domain.domains = [];
|
|
716
751
|
}
|
|
@@ -719,13 +754,13 @@ var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
|
|
|
719
754
|
return;
|
|
720
755
|
}
|
|
721
756
|
domain.domains.push(subDomain);
|
|
722
|
-
await rmDomainById(directory)(id,
|
|
757
|
+
await rmDomainById(directory)(id, version2, true);
|
|
723
758
|
await writeDomain(directory)(domain, { format: extension === ".md" ? "md" : "mdx" });
|
|
724
759
|
};
|
|
725
|
-
var addEntityToDomain = (directory) => async (id, entity,
|
|
726
|
-
let domain = await getDomain(directory)(id,
|
|
727
|
-
const domainPath = await getResourcePath(directory, id,
|
|
728
|
-
const extension =
|
|
760
|
+
var addEntityToDomain = (directory) => async (id, entity, version2) => {
|
|
761
|
+
let domain = await getDomain(directory)(id, version2);
|
|
762
|
+
const domainPath = await getResourcePath(directory, id, version2);
|
|
763
|
+
const extension = path3.extname(domainPath?.fullPath || "");
|
|
729
764
|
if (domain.entities === void 0) {
|
|
730
765
|
domain.entities = [];
|
|
731
766
|
}
|
|
@@ -734,13 +769,13 @@ var addEntityToDomain = (directory) => async (id, entity, version) => {
|
|
|
734
769
|
return;
|
|
735
770
|
}
|
|
736
771
|
domain.entities.push(entity);
|
|
737
|
-
await rmDomainById(directory)(id,
|
|
772
|
+
await rmDomainById(directory)(id, version2, true);
|
|
738
773
|
await writeDomain(directory)(domain, { format: extension === ".md" ? "md" : "mdx" });
|
|
739
774
|
};
|
|
740
|
-
var addDataProductToDomain = (directory) => async (id, dataProduct,
|
|
741
|
-
let domain = await getDomain(directory)(id,
|
|
742
|
-
const domainPath = await getResourcePath(directory, id,
|
|
743
|
-
const extension =
|
|
775
|
+
var addDataProductToDomain = (directory) => async (id, dataProduct, version2) => {
|
|
776
|
+
let domain = await getDomain(directory)(id, version2);
|
|
777
|
+
const domainPath = await getResourcePath(directory, id, version2);
|
|
778
|
+
const extension = path3.extname(domainPath?.fullPath || "");
|
|
744
779
|
if (domain.dataProducts === void 0) {
|
|
745
780
|
domain.dataProducts = [];
|
|
746
781
|
}
|
|
@@ -751,13 +786,13 @@ var addDataProductToDomain = (directory) => async (id, dataProduct, version) =>
|
|
|
751
786
|
return;
|
|
752
787
|
}
|
|
753
788
|
domain.dataProducts.push(dataProduct);
|
|
754
|
-
await rmDomainById(directory)(id,
|
|
789
|
+
await rmDomainById(directory)(id, version2, true);
|
|
755
790
|
await writeDomain(directory)(domain, { format: extension === ".md" ? "md" : "mdx" });
|
|
756
791
|
};
|
|
757
|
-
var addMessageToDomain = (directory) => async (id, direction, message,
|
|
758
|
-
let domain = await getDomain(directory)(id,
|
|
759
|
-
const domainPath = await getResourcePath(directory, id,
|
|
760
|
-
const extension =
|
|
792
|
+
var addMessageToDomain = (directory) => async (id, direction, message, version2) => {
|
|
793
|
+
let domain = await getDomain(directory)(id, version2);
|
|
794
|
+
const domainPath = await getResourcePath(directory, id, version2);
|
|
795
|
+
const extension = path3.extname(domainPath?.fullPath || "");
|
|
761
796
|
if (direction === "sends") {
|
|
762
797
|
if (domain.sends === void 0) {
|
|
763
798
|
domain.sends = [];
|
|
@@ -781,34 +816,34 @@ var addMessageToDomain = (directory) => async (id, direction, message, version)
|
|
|
781
816
|
} else {
|
|
782
817
|
throw new Error(`Direction ${direction} is invalid, only 'receives' and 'sends' are supported`);
|
|
783
818
|
}
|
|
784
|
-
const existingResource = await findFileById(directory, id,
|
|
819
|
+
const existingResource = await findFileById(directory, id, version2);
|
|
785
820
|
if (!existingResource) {
|
|
786
821
|
throw new Error(`Cannot find domain ${id} in the catalog`);
|
|
787
822
|
}
|
|
788
823
|
const normalizedPath = existingResource.replace(/\\/g, "/");
|
|
789
824
|
const lastDomainsIndex = normalizedPath.lastIndexOf("/domains/");
|
|
790
825
|
const pathToResource = existingResource.substring(0, lastDomainsIndex + "/domains".length);
|
|
791
|
-
await rmDomainById(directory)(id,
|
|
826
|
+
await rmDomainById(directory)(id, version2, true);
|
|
792
827
|
await writeDomain(pathToResource)(domain, { format: extension === ".md" ? "md" : "mdx" });
|
|
793
828
|
};
|
|
794
829
|
|
|
795
830
|
// src/channels.ts
|
|
796
831
|
import fs7 from "node:fs/promises";
|
|
797
832
|
import { join as join8, extname as extname2 } from "node:path";
|
|
798
|
-
var getChannel = (directory) => async (id,
|
|
833
|
+
var getChannel = (directory) => async (id, version2) => getResource(directory, id, version2, { type: "channel" });
|
|
799
834
|
var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
|
|
800
835
|
var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
|
|
801
|
-
var rmChannel = (directory) => async (
|
|
802
|
-
await fs7.rm(join8(directory,
|
|
836
|
+
var rmChannel = (directory) => async (path7) => {
|
|
837
|
+
await fs7.rm(join8(directory, path7), { recursive: true });
|
|
803
838
|
};
|
|
804
|
-
var rmChannelById = (directory) => async (id,
|
|
839
|
+
var rmChannelById = (directory) => async (id, version2, persistFiles) => rmResourceById(directory, id, version2, { type: "channel", persistFiles });
|
|
805
840
|
var versionChannel = (directory) => async (id) => versionResource(directory, id);
|
|
806
|
-
var channelHasVersion = (directory) => async (id,
|
|
807
|
-
const file = await findFileById(directory, id,
|
|
841
|
+
var channelHasVersion = (directory) => async (id, version2) => {
|
|
842
|
+
const file = await findFileById(directory, id, version2);
|
|
808
843
|
return !!file;
|
|
809
844
|
};
|
|
810
|
-
var addMessageToChannel = (directory, collection) => async (id, _message,
|
|
811
|
-
let channel = await getChannel(directory)(id,
|
|
845
|
+
var addMessageToChannel = (directory, collection) => async (id, _message, version2) => {
|
|
846
|
+
let channel = await getChannel(directory)(id, version2);
|
|
812
847
|
const functions = {
|
|
813
848
|
events: {
|
|
814
849
|
getMessage: getEvent,
|
|
@@ -840,8 +875,8 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
840
875
|
if (!existingResource) {
|
|
841
876
|
throw new Error(`Cannot find message ${id} in the catalog`);
|
|
842
877
|
}
|
|
843
|
-
const
|
|
844
|
-
const pathToResource = join8(
|
|
878
|
+
const path7 = existingResource.split(`/[\\/]+${collection}`)[0];
|
|
879
|
+
const pathToResource = join8(path7, collection);
|
|
845
880
|
await rmMessageById(directory)(_message.id, _message.version, true);
|
|
846
881
|
await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
|
|
847
882
|
};
|
|
@@ -850,8 +885,8 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
850
885
|
import { dirname as dirname5 } from "node:path";
|
|
851
886
|
import matter4 from "gray-matter";
|
|
852
887
|
import { satisfies as satisfies3, validRange as validRange2 } from "semver";
|
|
853
|
-
var getMessageBySchemaPath = (directory) => async (
|
|
854
|
-
const pathToMessage = dirname5(
|
|
888
|
+
var getMessageBySchemaPath = (directory) => async (path7, options) => {
|
|
889
|
+
const pathToMessage = dirname5(path7);
|
|
855
890
|
try {
|
|
856
891
|
const files = await getFiles(`${directory}/${pathToMessage}/index.{md,mdx}`);
|
|
857
892
|
if (!files || files.length === 0) {
|
|
@@ -859,13 +894,13 @@ var getMessageBySchemaPath = (directory) => async (path6, options) => {
|
|
|
859
894
|
}
|
|
860
895
|
const messageFile = files[0];
|
|
861
896
|
const { data } = matter4.read(messageFile);
|
|
862
|
-
const { id, version } = data;
|
|
863
|
-
if (!id || !
|
|
897
|
+
const { id, version: version2 } = data;
|
|
898
|
+
if (!id || !version2) {
|
|
864
899
|
throw new Error(`Message definition file at ${messageFile} is missing 'id' or 'version' in its frontmatter.`);
|
|
865
900
|
}
|
|
866
|
-
const message = await getResource(directory, id,
|
|
901
|
+
const message = await getResource(directory, id, version2, { type: "message", ...options });
|
|
867
902
|
if (!message) {
|
|
868
|
-
throw new Error(`Message resource with id '${id}' and version '${
|
|
903
|
+
throw new Error(`Message resource with id '${id}' and version '${version2}' not found, as referenced in ${messageFile}.`);
|
|
869
904
|
}
|
|
870
905
|
return message;
|
|
871
906
|
} catch (error) {
|
|
@@ -876,12 +911,12 @@ var getMessageBySchemaPath = (directory) => async (path6, options) => {
|
|
|
876
911
|
throw new Error(`Failed to retrieve message from ${pathToMessage} due to an unknown error.`);
|
|
877
912
|
}
|
|
878
913
|
};
|
|
879
|
-
var getProducersAndConsumersForMessage = (directory) => async (id,
|
|
914
|
+
var getProducersAndConsumersForMessage = (directory) => async (id, version2, options) => {
|
|
880
915
|
const services = await getServices(directory)({ latestOnly: options?.latestOnly ?? true });
|
|
881
|
-
const message = await getResource(directory, id,
|
|
882
|
-
const isMessageLatestVersion = await isLatestVersion(directory, id,
|
|
916
|
+
const message = await getResource(directory, id, version2, { type: "message" });
|
|
917
|
+
const isMessageLatestVersion = await isLatestVersion(directory, id, version2);
|
|
883
918
|
if (!message) {
|
|
884
|
-
throw new Error(`Message resource with id '${id}' and version '${
|
|
919
|
+
throw new Error(`Message resource with id '${id}' and version '${version2}' not found.`);
|
|
885
920
|
}
|
|
886
921
|
const producers = [];
|
|
887
922
|
const consumers = [];
|
|
@@ -923,18 +958,18 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
|
|
|
923
958
|
}
|
|
924
959
|
return { producers, consumers };
|
|
925
960
|
};
|
|
926
|
-
var getConsumersOfSchema = (directory) => async (
|
|
961
|
+
var getConsumersOfSchema = (directory) => async (path7) => {
|
|
927
962
|
try {
|
|
928
|
-
const message = await getMessageBySchemaPath(directory)(
|
|
963
|
+
const message = await getMessageBySchemaPath(directory)(path7);
|
|
929
964
|
const { consumers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
|
|
930
965
|
return consumers;
|
|
931
966
|
} catch (error) {
|
|
932
967
|
return [];
|
|
933
968
|
}
|
|
934
969
|
};
|
|
935
|
-
var getProducersOfSchema = (directory) => async (
|
|
970
|
+
var getProducersOfSchema = (directory) => async (path7) => {
|
|
936
971
|
try {
|
|
937
|
-
const message = await getMessageBySchemaPath(directory)(
|
|
972
|
+
const message = await getMessageBySchemaPath(directory)(path7);
|
|
938
973
|
const { producers } = await getProducersAndConsumersForMessage(directory)(message.id, message.version);
|
|
939
974
|
return producers;
|
|
940
975
|
} catch (error) {
|
|
@@ -943,13 +978,13 @@ var getProducersOfSchema = (directory) => async (path6) => {
|
|
|
943
978
|
};
|
|
944
979
|
|
|
945
980
|
// src/custom-docs.ts
|
|
946
|
-
import
|
|
981
|
+
import path4, { join as join10 } from "node:path";
|
|
947
982
|
import fsSync4 from "node:fs";
|
|
948
983
|
import fs8 from "node:fs/promises";
|
|
949
984
|
import matter5 from "gray-matter";
|
|
950
985
|
import slugify from "slugify";
|
|
951
986
|
var getCustomDoc = (directory) => async (filePath) => {
|
|
952
|
-
const fullPath =
|
|
987
|
+
const fullPath = path4.join(directory, filePath);
|
|
953
988
|
const fullPathWithExtension = fullPath.endsWith(".mdx") ? fullPath : `${fullPath}.mdx`;
|
|
954
989
|
const fileExists = fsSync4.existsSync(fullPathWithExtension);
|
|
955
990
|
if (!fileExists) {
|
|
@@ -968,8 +1003,8 @@ var writeCustomDoc = (directory) => async (customDoc, options = { path: "" }) =>
|
|
|
968
1003
|
const { fileName, ...rest } = customDoc;
|
|
969
1004
|
const name = fileName || slugify(customDoc.title, { lower: true });
|
|
970
1005
|
const withExtension = name.endsWith(".mdx") ? name : `${name}.mdx`;
|
|
971
|
-
const fullPath =
|
|
972
|
-
fsSync4.mkdirSync(
|
|
1006
|
+
const fullPath = path4.join(directory, options.path || "", withExtension);
|
|
1007
|
+
fsSync4.mkdirSync(path4.dirname(fullPath), { recursive: true });
|
|
973
1008
|
const document = matter5.stringify(customDoc.markdown.trim(), rest);
|
|
974
1009
|
fsSync4.writeFileSync(fullPath, document);
|
|
975
1010
|
};
|
|
@@ -983,7 +1018,7 @@ import fs9 from "node:fs/promises";
|
|
|
983
1018
|
import fsSync6 from "node:fs";
|
|
984
1019
|
import { join as join12 } from "node:path";
|
|
985
1020
|
import matter7 from "gray-matter";
|
|
986
|
-
import
|
|
1021
|
+
import path5 from "node:path";
|
|
987
1022
|
|
|
988
1023
|
// src/users.ts
|
|
989
1024
|
import fsSync5 from "node:fs";
|
|
@@ -1073,17 +1108,17 @@ var writeTeam = (catalogDir) => async (team, options = {}) => {
|
|
|
1073
1108
|
var rmTeamById = (catalogDir) => async (id) => {
|
|
1074
1109
|
await fs9.rm(join12(catalogDir, `${id}.mdx`), { recursive: true });
|
|
1075
1110
|
};
|
|
1076
|
-
var getOwnersForResource = (catalogDir) => async (id,
|
|
1077
|
-
const resource = await getResource(catalogDir, id,
|
|
1111
|
+
var getOwnersForResource = (catalogDir) => async (id, version2) => {
|
|
1112
|
+
const resource = await getResource(catalogDir, id, version2);
|
|
1078
1113
|
let owners = [];
|
|
1079
1114
|
if (!resource) return [];
|
|
1080
1115
|
if (!resource.owners) return [];
|
|
1081
1116
|
for (const owner of resource.owners) {
|
|
1082
|
-
const team = await getTeam(
|
|
1117
|
+
const team = await getTeam(path5.join(catalogDir, "teams"))(owner);
|
|
1083
1118
|
if (team) {
|
|
1084
1119
|
owners.push(team);
|
|
1085
1120
|
} else {
|
|
1086
|
-
const user = await getUser(
|
|
1121
|
+
const user = await getUser(path5.join(catalogDir, "users"))(owner);
|
|
1087
1122
|
if (user) {
|
|
1088
1123
|
owners.push(user);
|
|
1089
1124
|
}
|
|
@@ -1092,32 +1127,129 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
|
|
|
1092
1127
|
return owners;
|
|
1093
1128
|
};
|
|
1094
1129
|
|
|
1130
|
+
// src/eventcatalog.ts
|
|
1131
|
+
import fs10 from "fs";
|
|
1132
|
+
import path6, { join as join13 } from "node:path";
|
|
1133
|
+
var DUMP_VERSION = "0.0.1";
|
|
1134
|
+
var getEventCatalogVersion = async (catalogDir) => {
|
|
1135
|
+
try {
|
|
1136
|
+
const packageJson = fs10.readFileSync(join13(catalogDir, "package.json"), "utf8");
|
|
1137
|
+
const packageJsonObject = JSON.parse(packageJson);
|
|
1138
|
+
return packageJsonObject["dependencies"]["@eventcatalog/core"];
|
|
1139
|
+
} catch (error) {
|
|
1140
|
+
return "unknown";
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
var hydrateResource = async (catalogDir, resources = [], { attachSchema = false } = {}) => {
|
|
1144
|
+
return await Promise.all(
|
|
1145
|
+
resources.map(async (resource) => {
|
|
1146
|
+
const resourcePath = await getResourcePath(catalogDir, resource.id, resource.version);
|
|
1147
|
+
let schema = "";
|
|
1148
|
+
if (resource.schemaPath && resourcePath?.fullPath) {
|
|
1149
|
+
const pathToSchema = path6.join(path6.dirname(resourcePath?.fullPath), resource.schemaPath);
|
|
1150
|
+
if (fs10.existsSync(pathToSchema)) {
|
|
1151
|
+
schema = fs10.readFileSync(pathToSchema, "utf8");
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
const eventcatalog = schema ? { directory: resourcePath?.directory, schema } : { directory: resourcePath?.directory };
|
|
1155
|
+
return {
|
|
1156
|
+
...resource,
|
|
1157
|
+
_eventcatalog: eventcatalog
|
|
1158
|
+
};
|
|
1159
|
+
})
|
|
1160
|
+
);
|
|
1161
|
+
};
|
|
1162
|
+
var filterCollection = (collection, options) => {
|
|
1163
|
+
return collection.map((item) => ({
|
|
1164
|
+
...item,
|
|
1165
|
+
markdown: options?.includeMarkdown ? item.markdown : void 0
|
|
1166
|
+
}));
|
|
1167
|
+
};
|
|
1168
|
+
var getEventCatalogConfigurationFile = (directory) => async () => {
|
|
1169
|
+
try {
|
|
1170
|
+
const path7 = join13(directory, "eventcatalog.config.js");
|
|
1171
|
+
const configModule = await import(path7);
|
|
1172
|
+
return configModule.default;
|
|
1173
|
+
} catch (error) {
|
|
1174
|
+
console.error("Error getting event catalog configuration file", error);
|
|
1175
|
+
return null;
|
|
1176
|
+
}
|
|
1177
|
+
};
|
|
1178
|
+
var dumpCatalog = (directory) => async (options) => {
|
|
1179
|
+
const { getDomains: getDomains2, getServices: getServices2, getEvents: getEvents2, getQueries: getQueries2, getCommands: getCommands2, getChannels: getChannels2, getTeams: getTeams2, getUsers: getUsers3 } = src_default(directory);
|
|
1180
|
+
const { includeMarkdown = true } = options || {};
|
|
1181
|
+
const domains = await getDomains2();
|
|
1182
|
+
const services = await getServices2();
|
|
1183
|
+
const events = await getEvents2();
|
|
1184
|
+
const commands = await getCommands2();
|
|
1185
|
+
const queries = await getQueries2();
|
|
1186
|
+
const teams = await getTeams2();
|
|
1187
|
+
const users = await getUsers3();
|
|
1188
|
+
const channels = await getChannels2();
|
|
1189
|
+
const [
|
|
1190
|
+
hydratedDomains,
|
|
1191
|
+
hydratedServices,
|
|
1192
|
+
hydratedEvents,
|
|
1193
|
+
hydratedQueries,
|
|
1194
|
+
hydratedCommands,
|
|
1195
|
+
hydratedTeams,
|
|
1196
|
+
hydratedUsers,
|
|
1197
|
+
hydratedChannels
|
|
1198
|
+
] = await Promise.all([
|
|
1199
|
+
hydrateResource(directory, domains),
|
|
1200
|
+
hydrateResource(directory, services),
|
|
1201
|
+
hydrateResource(directory, events),
|
|
1202
|
+
hydrateResource(directory, queries),
|
|
1203
|
+
hydrateResource(directory, commands),
|
|
1204
|
+
hydrateResource(directory, teams),
|
|
1205
|
+
hydrateResource(directory, users),
|
|
1206
|
+
hydrateResource(directory, channels)
|
|
1207
|
+
]);
|
|
1208
|
+
return {
|
|
1209
|
+
version: DUMP_VERSION,
|
|
1210
|
+
catalogVersion: await getEventCatalogVersion(directory),
|
|
1211
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1212
|
+
resources: {
|
|
1213
|
+
domains: filterCollection(hydratedDomains, { includeMarkdown }),
|
|
1214
|
+
services: filterCollection(hydratedServices, { includeMarkdown }),
|
|
1215
|
+
messages: {
|
|
1216
|
+
events: filterCollection(hydratedEvents, { includeMarkdown }),
|
|
1217
|
+
queries: filterCollection(hydratedQueries, { includeMarkdown }),
|
|
1218
|
+
commands: filterCollection(hydratedCommands, { includeMarkdown })
|
|
1219
|
+
},
|
|
1220
|
+
teams: filterCollection(hydratedTeams, { includeMarkdown }),
|
|
1221
|
+
users: filterCollection(hydratedUsers, { includeMarkdown }),
|
|
1222
|
+
channels: filterCollection(hydratedChannels, { includeMarkdown })
|
|
1223
|
+
}
|
|
1224
|
+
};
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1095
1227
|
// src/entities.ts
|
|
1096
|
-
import
|
|
1097
|
-
import { join as
|
|
1098
|
-
var getEntity = (directory) => async (id,
|
|
1228
|
+
import fs11 from "node:fs/promises";
|
|
1229
|
+
import { join as join14 } from "node:path";
|
|
1230
|
+
var getEntity = (directory) => async (id, version2) => getResource(directory, id, version2, { type: "entity" });
|
|
1099
1231
|
var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
|
|
1100
1232
|
var writeEntity = (directory) => async (entity, options = {
|
|
1101
1233
|
path: "",
|
|
1102
1234
|
override: false,
|
|
1103
1235
|
format: "mdx"
|
|
1104
1236
|
}) => writeResource(directory, { ...entity }, { ...options, type: "entity" });
|
|
1105
|
-
var rmEntity = (directory) => async (
|
|
1106
|
-
await
|
|
1237
|
+
var rmEntity = (directory) => async (path7) => {
|
|
1238
|
+
await fs11.rm(join14(directory, path7), { recursive: true });
|
|
1107
1239
|
};
|
|
1108
|
-
var rmEntityById = (directory) => async (id,
|
|
1109
|
-
await rmResourceById(directory, id,
|
|
1240
|
+
var rmEntityById = (directory) => async (id, version2, persistFiles) => {
|
|
1241
|
+
await rmResourceById(directory, id, version2, { type: "entity", persistFiles });
|
|
1110
1242
|
};
|
|
1111
1243
|
var versionEntity = (directory) => async (id) => versionResource(directory, id);
|
|
1112
|
-
var entityHasVersion = (directory) => async (id,
|
|
1113
|
-
const file = await findFileById(directory, id,
|
|
1244
|
+
var entityHasVersion = (directory) => async (id, version2) => {
|
|
1245
|
+
const file = await findFileById(directory, id, version2);
|
|
1114
1246
|
return !!file;
|
|
1115
1247
|
};
|
|
1116
1248
|
|
|
1117
1249
|
// src/containers.ts
|
|
1118
|
-
import
|
|
1119
|
-
import { join as
|
|
1120
|
-
var getContainer = (directory) => async (id,
|
|
1250
|
+
import fs12 from "node:fs/promises";
|
|
1251
|
+
import { join as join15 } from "node:path";
|
|
1252
|
+
var getContainer = (directory) => async (id, version2) => getResource(directory, id, version2, { type: "container" });
|
|
1121
1253
|
var getContainers = (directory) => async (options) => getResources(directory, { type: "containers", latestOnly: options?.latestOnly });
|
|
1122
1254
|
var writeContainer = (directory) => async (data, options = {
|
|
1123
1255
|
path: "",
|
|
@@ -1125,24 +1257,24 @@ var writeContainer = (directory) => async (data, options = {
|
|
|
1125
1257
|
format: "mdx"
|
|
1126
1258
|
}) => writeResource(directory, { ...data }, { ...options, type: "container" });
|
|
1127
1259
|
var versionContainer = (directory) => async (id) => versionResource(directory, id);
|
|
1128
|
-
var rmContainer = (directory) => async (
|
|
1129
|
-
await
|
|
1260
|
+
var rmContainer = (directory) => async (path7) => {
|
|
1261
|
+
await fs12.rm(join15(directory, path7), { recursive: true });
|
|
1130
1262
|
};
|
|
1131
|
-
var rmContainerById = (directory) => async (id,
|
|
1132
|
-
await rmResourceById(directory, id,
|
|
1263
|
+
var rmContainerById = (directory) => async (id, version2, persistFiles) => {
|
|
1264
|
+
await rmResourceById(directory, id, version2, { type: "container", persistFiles });
|
|
1133
1265
|
};
|
|
1134
|
-
var containerHasVersion = (directory) => async (id,
|
|
1135
|
-
const file = await findFileById(directory, id,
|
|
1266
|
+
var containerHasVersion = (directory) => async (id, version2) => {
|
|
1267
|
+
const file = await findFileById(directory, id, version2);
|
|
1136
1268
|
return !!file;
|
|
1137
1269
|
};
|
|
1138
|
-
var addFileToContainer = (directory) => async (id, file,
|
|
1270
|
+
var addFileToContainer = (directory) => async (id, file, version2) => addFileToResource(directory, id, file, version2);
|
|
1139
1271
|
var writeContainerToService = (directory) => async (container, service, options = { path: "", format: "mdx", override: false }) => {
|
|
1140
1272
|
const resourcePath = await getResourcePath(directory, service.id, service.version);
|
|
1141
1273
|
if (!resourcePath) {
|
|
1142
1274
|
throw new Error("Service not found");
|
|
1143
1275
|
}
|
|
1144
1276
|
let pathForContainer = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/containers` : `${resourcePath.directory}/containers`;
|
|
1145
|
-
pathForContainer =
|
|
1277
|
+
pathForContainer = join15(pathForContainer, container.id);
|
|
1146
1278
|
await writeResource(directory, { ...container }, { ...options, path: pathForContainer, type: "container" });
|
|
1147
1279
|
};
|
|
1148
1280
|
|
|
@@ -1158,9 +1290,9 @@ var addFileToDataStore = addFileToContainer;
|
|
|
1158
1290
|
var writeDataStoreToService = writeContainerToService;
|
|
1159
1291
|
|
|
1160
1292
|
// src/data-products.ts
|
|
1161
|
-
import
|
|
1162
|
-
import { join as
|
|
1163
|
-
var getDataProduct = (directory) => async (id,
|
|
1293
|
+
import fs13 from "node:fs/promises";
|
|
1294
|
+
import { join as join16 } from "node:path";
|
|
1295
|
+
var getDataProduct = (directory) => async (id, version2) => getResource(directory, id, version2, { type: "data-product" });
|
|
1164
1296
|
var getDataProducts = (directory) => async (options) => getResources(directory, { type: "data-products", latestOnly: options?.latestOnly });
|
|
1165
1297
|
var writeDataProduct = (directory) => async (dataProduct, options = {
|
|
1166
1298
|
path: "",
|
|
@@ -1169,24 +1301,47 @@ var writeDataProduct = (directory) => async (dataProduct, options = {
|
|
|
1169
1301
|
}) => writeResource(directory, { ...dataProduct }, { ...options, type: "data-product" });
|
|
1170
1302
|
var writeDataProductToDomain = (directory) => async (dataProduct, domain, options = { path: "", format: "mdx", override: false }) => {
|
|
1171
1303
|
let pathForDataProduct = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/data-products` : `/${domain.id}/data-products`;
|
|
1172
|
-
pathForDataProduct =
|
|
1304
|
+
pathForDataProduct = join16(pathForDataProduct, dataProduct.id);
|
|
1173
1305
|
await writeResource(directory, { ...dataProduct }, { ...options, path: pathForDataProduct, type: "data-product" });
|
|
1174
1306
|
};
|
|
1175
|
-
var rmDataProduct = (directory) => async (
|
|
1176
|
-
await
|
|
1307
|
+
var rmDataProduct = (directory) => async (path7) => {
|
|
1308
|
+
await fs13.rm(join16(directory, path7), { recursive: true });
|
|
1177
1309
|
};
|
|
1178
|
-
var rmDataProductById = (directory) => async (id,
|
|
1179
|
-
await rmResourceById(directory, id,
|
|
1310
|
+
var rmDataProductById = (directory) => async (id, version2, persistFiles) => {
|
|
1311
|
+
await rmResourceById(directory, id, version2, { type: "data-product", persistFiles });
|
|
1180
1312
|
};
|
|
1181
1313
|
var versionDataProduct = (directory) => async (id) => versionResource(directory, id);
|
|
1182
|
-
var dataProductHasVersion = (directory) => async (id,
|
|
1183
|
-
const file = await findFileById(directory, id,
|
|
1314
|
+
var dataProductHasVersion = (directory) => async (id, version2) => {
|
|
1315
|
+
const file = await findFileById(directory, id, version2);
|
|
1184
1316
|
return !!file;
|
|
1185
1317
|
};
|
|
1186
|
-
var addFileToDataProduct = (directory) => async (id, file,
|
|
1318
|
+
var addFileToDataProduct = (directory) => async (id, file, version2) => addFileToResource(directory, id, file, version2);
|
|
1319
|
+
|
|
1320
|
+
// src/diagrams.ts
|
|
1321
|
+
import fs14 from "node:fs/promises";
|
|
1322
|
+
import { join as join17 } from "node:path";
|
|
1323
|
+
var getDiagram = (directory) => async (id, version2) => getResource(directory, id, version2, { type: "diagram" });
|
|
1324
|
+
var getDiagrams = (directory) => async (options) => getResources(directory, { type: "diagrams", latestOnly: options?.latestOnly });
|
|
1325
|
+
var writeDiagram = (directory) => async (diagram, options = {
|
|
1326
|
+
path: "",
|
|
1327
|
+
override: false,
|
|
1328
|
+
format: "mdx"
|
|
1329
|
+
}) => writeResource(directory, { ...diagram }, { ...options, type: "diagram" });
|
|
1330
|
+
var rmDiagram = (directory) => async (path7) => {
|
|
1331
|
+
await fs14.rm(join17(directory, path7), { recursive: true });
|
|
1332
|
+
};
|
|
1333
|
+
var rmDiagramById = (directory) => async (id, version2, persistFiles) => {
|
|
1334
|
+
await rmResourceById(directory, id, version2, { type: "diagram", persistFiles });
|
|
1335
|
+
};
|
|
1336
|
+
var versionDiagram = (directory) => async (id) => versionResource(directory, id);
|
|
1337
|
+
var diagramHasVersion = (directory) => async (id, version2) => {
|
|
1338
|
+
const file = await findFileById(directory, id, version2);
|
|
1339
|
+
return !!file;
|
|
1340
|
+
};
|
|
1341
|
+
var addFileToDiagram = (directory) => async (id, file, version2) => addFileToResource(directory, id, file, version2, { type: "diagram" });
|
|
1187
1342
|
|
|
1188
1343
|
// src/index.ts
|
|
1189
|
-
var src_default = (
|
|
1344
|
+
var src_default = (path7) => {
|
|
1190
1345
|
return {
|
|
1191
1346
|
/**
|
|
1192
1347
|
* Returns an events from EventCatalog
|
|
@@ -1194,13 +1349,13 @@ var src_default = (path6) => {
|
|
|
1194
1349
|
* @param version - Optional id of the version to get (supports semver)
|
|
1195
1350
|
* @returns Event|Undefined
|
|
1196
1351
|
*/
|
|
1197
|
-
getEvent: getEvent(
|
|
1352
|
+
getEvent: getEvent(join18(path7)),
|
|
1198
1353
|
/**
|
|
1199
1354
|
* Returns all events from EventCatalog
|
|
1200
1355
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1201
1356
|
* @returns Event[]|Undefined
|
|
1202
1357
|
*/
|
|
1203
|
-
getEvents: getEvents(
|
|
1358
|
+
getEvents: getEvents(join18(path7)),
|
|
1204
1359
|
/**
|
|
1205
1360
|
* Adds an event to EventCatalog
|
|
1206
1361
|
*
|
|
@@ -1208,7 +1363,7 @@ var src_default = (path6) => {
|
|
|
1208
1363
|
* @param options - Optional options to write the event
|
|
1209
1364
|
*
|
|
1210
1365
|
*/
|
|
1211
|
-
writeEvent: writeEvent(
|
|
1366
|
+
writeEvent: writeEvent(join18(path7, "events")),
|
|
1212
1367
|
/**
|
|
1213
1368
|
* Adds an event to a service in EventCatalog
|
|
1214
1369
|
*
|
|
@@ -1217,26 +1372,26 @@ var src_default = (path6) => {
|
|
|
1217
1372
|
* @param options - Optional options to write the event
|
|
1218
1373
|
*
|
|
1219
1374
|
*/
|
|
1220
|
-
writeEventToService: writeEventToService(
|
|
1375
|
+
writeEventToService: writeEventToService(join18(path7)),
|
|
1221
1376
|
/**
|
|
1222
1377
|
* Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1223
1378
|
*
|
|
1224
1379
|
* @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
|
|
1225
1380
|
*
|
|
1226
1381
|
*/
|
|
1227
|
-
rmEvent: rmEvent(
|
|
1382
|
+
rmEvent: rmEvent(join18(path7, "events")),
|
|
1228
1383
|
/**
|
|
1229
1384
|
* Remove an event by an Event id
|
|
1230
1385
|
*
|
|
1231
1386
|
* @param id - The id of the event you want to remove
|
|
1232
1387
|
*
|
|
1233
1388
|
*/
|
|
1234
|
-
rmEventById: rmEventById(
|
|
1389
|
+
rmEventById: rmEventById(join18(path7)),
|
|
1235
1390
|
/**
|
|
1236
1391
|
* Moves a given event id to the version directory
|
|
1237
1392
|
* @param directory
|
|
1238
1393
|
*/
|
|
1239
|
-
versionEvent: versionEvent(
|
|
1394
|
+
versionEvent: versionEvent(join18(path7)),
|
|
1240
1395
|
/**
|
|
1241
1396
|
* Adds a file to the given event
|
|
1242
1397
|
* @param id - The id of the event to add the file to
|
|
@@ -1244,7 +1399,7 @@ var src_default = (path6) => {
|
|
|
1244
1399
|
* @param version - Optional version of the event to add the file to
|
|
1245
1400
|
* @returns
|
|
1246
1401
|
*/
|
|
1247
|
-
addFileToEvent: addFileToEvent(
|
|
1402
|
+
addFileToEvent: addFileToEvent(join18(path7)),
|
|
1248
1403
|
/**
|
|
1249
1404
|
* Adds a schema to the given event
|
|
1250
1405
|
* @param id - The id of the event to add the schema to
|
|
@@ -1252,14 +1407,14 @@ var src_default = (path6) => {
|
|
|
1252
1407
|
* @param version - Optional version of the event to add the schema to
|
|
1253
1408
|
* @returns
|
|
1254
1409
|
*/
|
|
1255
|
-
addSchemaToEvent: addSchemaToEvent(
|
|
1410
|
+
addSchemaToEvent: addSchemaToEvent(join18(path7)),
|
|
1256
1411
|
/**
|
|
1257
1412
|
* Check to see if an event version exists
|
|
1258
1413
|
* @param id - The id of the event
|
|
1259
1414
|
* @param version - The version of the event (supports semver)
|
|
1260
1415
|
* @returns
|
|
1261
1416
|
*/
|
|
1262
|
-
eventHasVersion: eventHasVersion(
|
|
1417
|
+
eventHasVersion: eventHasVersion(join18(path7)),
|
|
1263
1418
|
/**
|
|
1264
1419
|
* ================================
|
|
1265
1420
|
* Commands
|
|
@@ -1271,13 +1426,13 @@ var src_default = (path6) => {
|
|
|
1271
1426
|
* @param version - Optional id of the version to get (supports semver)
|
|
1272
1427
|
* @returns Command|Undefined
|
|
1273
1428
|
*/
|
|
1274
|
-
getCommand: getCommand(
|
|
1429
|
+
getCommand: getCommand(join18(path7)),
|
|
1275
1430
|
/**
|
|
1276
1431
|
* Returns all commands from EventCatalog
|
|
1277
1432
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1278
1433
|
* @returns Command[]|Undefined
|
|
1279
1434
|
*/
|
|
1280
|
-
getCommands: getCommands(
|
|
1435
|
+
getCommands: getCommands(join18(path7)),
|
|
1281
1436
|
/**
|
|
1282
1437
|
* Adds an command to EventCatalog
|
|
1283
1438
|
*
|
|
@@ -1285,7 +1440,7 @@ var src_default = (path6) => {
|
|
|
1285
1440
|
* @param options - Optional options to write the command
|
|
1286
1441
|
*
|
|
1287
1442
|
*/
|
|
1288
|
-
writeCommand: writeCommand(
|
|
1443
|
+
writeCommand: writeCommand(join18(path7, "commands")),
|
|
1289
1444
|
/**
|
|
1290
1445
|
* Adds a command to a service in EventCatalog
|
|
1291
1446
|
*
|
|
@@ -1294,26 +1449,26 @@ var src_default = (path6) => {
|
|
|
1294
1449
|
* @param options - Optional options to write the command
|
|
1295
1450
|
*
|
|
1296
1451
|
*/
|
|
1297
|
-
writeCommandToService: writeCommandToService(
|
|
1452
|
+
writeCommandToService: writeCommandToService(join18(path7)),
|
|
1298
1453
|
/**
|
|
1299
1454
|
* Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1300
1455
|
*
|
|
1301
1456
|
* @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
|
|
1302
1457
|
*
|
|
1303
1458
|
*/
|
|
1304
|
-
rmCommand: rmCommand(
|
|
1459
|
+
rmCommand: rmCommand(join18(path7, "commands")),
|
|
1305
1460
|
/**
|
|
1306
1461
|
* Remove an command by an Event id
|
|
1307
1462
|
*
|
|
1308
1463
|
* @param id - The id of the command you want to remove
|
|
1309
1464
|
*
|
|
1310
1465
|
*/
|
|
1311
|
-
rmCommandById: rmCommandById(
|
|
1466
|
+
rmCommandById: rmCommandById(join18(path7)),
|
|
1312
1467
|
/**
|
|
1313
1468
|
* Moves a given command id to the version directory
|
|
1314
1469
|
* @param directory
|
|
1315
1470
|
*/
|
|
1316
|
-
versionCommand: versionCommand(
|
|
1471
|
+
versionCommand: versionCommand(join18(path7)),
|
|
1317
1472
|
/**
|
|
1318
1473
|
* Adds a file to the given command
|
|
1319
1474
|
* @param id - The id of the command to add the file to
|
|
@@ -1321,7 +1476,7 @@ var src_default = (path6) => {
|
|
|
1321
1476
|
* @param version - Optional version of the command to add the file to
|
|
1322
1477
|
* @returns
|
|
1323
1478
|
*/
|
|
1324
|
-
addFileToCommand: addFileToCommand(
|
|
1479
|
+
addFileToCommand: addFileToCommand(join18(path7)),
|
|
1325
1480
|
/**
|
|
1326
1481
|
* Adds a schema to the given command
|
|
1327
1482
|
* @param id - The id of the command to add the schema to
|
|
@@ -1329,14 +1484,14 @@ var src_default = (path6) => {
|
|
|
1329
1484
|
* @param version - Optional version of the command to add the schema to
|
|
1330
1485
|
* @returns
|
|
1331
1486
|
*/
|
|
1332
|
-
addSchemaToCommand: addSchemaToCommand(
|
|
1487
|
+
addSchemaToCommand: addSchemaToCommand(join18(path7)),
|
|
1333
1488
|
/**
|
|
1334
1489
|
* Check to see if a command version exists
|
|
1335
1490
|
* @param id - The id of the command
|
|
1336
1491
|
* @param version - The version of the command (supports semver)
|
|
1337
1492
|
* @returns
|
|
1338
1493
|
*/
|
|
1339
|
-
commandHasVersion: commandHasVersion(
|
|
1494
|
+
commandHasVersion: commandHasVersion(join18(path7)),
|
|
1340
1495
|
/**
|
|
1341
1496
|
* ================================
|
|
1342
1497
|
* Queries
|
|
@@ -1348,13 +1503,13 @@ var src_default = (path6) => {
|
|
|
1348
1503
|
* @param version - Optional id of the version to get (supports semver)
|
|
1349
1504
|
* @returns Query|Undefined
|
|
1350
1505
|
*/
|
|
1351
|
-
getQuery: getQuery(
|
|
1506
|
+
getQuery: getQuery(join18(path7)),
|
|
1352
1507
|
/**
|
|
1353
1508
|
* Returns all queries from EventCatalog
|
|
1354
1509
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1355
1510
|
* @returns Query[]|Undefined
|
|
1356
1511
|
*/
|
|
1357
|
-
getQueries: getQueries(
|
|
1512
|
+
getQueries: getQueries(join18(path7)),
|
|
1358
1513
|
/**
|
|
1359
1514
|
* Adds a query to EventCatalog
|
|
1360
1515
|
*
|
|
@@ -1362,7 +1517,7 @@ var src_default = (path6) => {
|
|
|
1362
1517
|
* @param options - Optional options to write the event
|
|
1363
1518
|
*
|
|
1364
1519
|
*/
|
|
1365
|
-
writeQuery: writeQuery(
|
|
1520
|
+
writeQuery: writeQuery(join18(path7, "queries")),
|
|
1366
1521
|
/**
|
|
1367
1522
|
* Adds a query to a service in EventCatalog
|
|
1368
1523
|
*
|
|
@@ -1371,26 +1526,26 @@ var src_default = (path6) => {
|
|
|
1371
1526
|
* @param options - Optional options to write the query
|
|
1372
1527
|
*
|
|
1373
1528
|
*/
|
|
1374
|
-
writeQueryToService: writeQueryToService(
|
|
1529
|
+
writeQueryToService: writeQueryToService(join18(path7)),
|
|
1375
1530
|
/**
|
|
1376
1531
|
* Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1377
1532
|
*
|
|
1378
1533
|
* @param path - The path to your query, e.g. `/Orders/GetOrder`
|
|
1379
1534
|
*
|
|
1380
1535
|
*/
|
|
1381
|
-
rmQuery: rmQuery(
|
|
1536
|
+
rmQuery: rmQuery(join18(path7, "queries")),
|
|
1382
1537
|
/**
|
|
1383
1538
|
* Remove a query by a Query id
|
|
1384
1539
|
*
|
|
1385
1540
|
* @param id - The id of the query you want to remove
|
|
1386
1541
|
*
|
|
1387
1542
|
*/
|
|
1388
|
-
rmQueryById: rmQueryById(
|
|
1543
|
+
rmQueryById: rmQueryById(join18(path7)),
|
|
1389
1544
|
/**
|
|
1390
1545
|
* Moves a given query id to the version directory
|
|
1391
1546
|
* @param directory
|
|
1392
1547
|
*/
|
|
1393
|
-
versionQuery: versionQuery(
|
|
1548
|
+
versionQuery: versionQuery(join18(path7)),
|
|
1394
1549
|
/**
|
|
1395
1550
|
* Adds a file to the given query
|
|
1396
1551
|
* @param id - The id of the query to add the file to
|
|
@@ -1398,7 +1553,7 @@ var src_default = (path6) => {
|
|
|
1398
1553
|
* @param version - Optional version of the query to add the file to
|
|
1399
1554
|
* @returns
|
|
1400
1555
|
*/
|
|
1401
|
-
addFileToQuery: addFileToQuery(
|
|
1556
|
+
addFileToQuery: addFileToQuery(join18(path7)),
|
|
1402
1557
|
/**
|
|
1403
1558
|
* Adds a schema to the given query
|
|
1404
1559
|
* @param id - The id of the query to add the schema to
|
|
@@ -1406,14 +1561,14 @@ var src_default = (path6) => {
|
|
|
1406
1561
|
* @param version - Optional version of the query to add the schema to
|
|
1407
1562
|
* @returns
|
|
1408
1563
|
*/
|
|
1409
|
-
addSchemaToQuery: addSchemaToQuery(
|
|
1564
|
+
addSchemaToQuery: addSchemaToQuery(join18(path7)),
|
|
1410
1565
|
/**
|
|
1411
1566
|
* Check to see if an query version exists
|
|
1412
1567
|
* @param id - The id of the query
|
|
1413
1568
|
* @param version - The version of the query (supports semver)
|
|
1414
1569
|
* @returns
|
|
1415
1570
|
*/
|
|
1416
|
-
queryHasVersion: queryHasVersion(
|
|
1571
|
+
queryHasVersion: queryHasVersion(join18(path7)),
|
|
1417
1572
|
/**
|
|
1418
1573
|
* ================================
|
|
1419
1574
|
* Channels
|
|
@@ -1425,13 +1580,13 @@ var src_default = (path6) => {
|
|
|
1425
1580
|
* @param version - Optional id of the version to get (supports semver)
|
|
1426
1581
|
* @returns Channel|Undefined
|
|
1427
1582
|
*/
|
|
1428
|
-
getChannel: getChannel(
|
|
1583
|
+
getChannel: getChannel(join18(path7)),
|
|
1429
1584
|
/**
|
|
1430
1585
|
* Returns all channels from EventCatalog
|
|
1431
1586
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1432
1587
|
* @returns Channel[]|Undefined
|
|
1433
1588
|
*/
|
|
1434
|
-
getChannels: getChannels(
|
|
1589
|
+
getChannels: getChannels(join18(path7)),
|
|
1435
1590
|
/**
|
|
1436
1591
|
* Adds an channel to EventCatalog
|
|
1437
1592
|
*
|
|
@@ -1439,33 +1594,33 @@ var src_default = (path6) => {
|
|
|
1439
1594
|
* @param options - Optional options to write the channel
|
|
1440
1595
|
*
|
|
1441
1596
|
*/
|
|
1442
|
-
writeChannel: writeChannel(
|
|
1597
|
+
writeChannel: writeChannel(join18(path7, "channels")),
|
|
1443
1598
|
/**
|
|
1444
1599
|
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1445
1600
|
*
|
|
1446
1601
|
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
1447
1602
|
*
|
|
1448
1603
|
*/
|
|
1449
|
-
rmChannel: rmChannel(
|
|
1604
|
+
rmChannel: rmChannel(join18(path7, "channels")),
|
|
1450
1605
|
/**
|
|
1451
1606
|
* Remove an channel by an Event id
|
|
1452
1607
|
*
|
|
1453
1608
|
* @param id - The id of the channel you want to remove
|
|
1454
1609
|
*
|
|
1455
1610
|
*/
|
|
1456
|
-
rmChannelById: rmChannelById(
|
|
1611
|
+
rmChannelById: rmChannelById(join18(path7)),
|
|
1457
1612
|
/**
|
|
1458
1613
|
* Moves a given channel id to the version directory
|
|
1459
1614
|
* @param directory
|
|
1460
1615
|
*/
|
|
1461
|
-
versionChannel: versionChannel(
|
|
1616
|
+
versionChannel: versionChannel(join18(path7)),
|
|
1462
1617
|
/**
|
|
1463
1618
|
* Check to see if a channel version exists
|
|
1464
1619
|
* @param id - The id of the channel
|
|
1465
1620
|
* @param version - The version of the channel (supports semver)
|
|
1466
1621
|
* @returns
|
|
1467
1622
|
*/
|
|
1468
|
-
channelHasVersion: channelHasVersion(
|
|
1623
|
+
channelHasVersion: channelHasVersion(join18(path7)),
|
|
1469
1624
|
/**
|
|
1470
1625
|
* Add a channel to an event
|
|
1471
1626
|
*
|
|
@@ -1482,7 +1637,7 @@ var src_default = (path6) => {
|
|
|
1482
1637
|
*
|
|
1483
1638
|
* ```
|
|
1484
1639
|
*/
|
|
1485
|
-
addEventToChannel: addMessageToChannel(
|
|
1640
|
+
addEventToChannel: addMessageToChannel(join18(path7), "events"),
|
|
1486
1641
|
/**
|
|
1487
1642
|
* Add a channel to an command
|
|
1488
1643
|
*
|
|
@@ -1499,7 +1654,7 @@ var src_default = (path6) => {
|
|
|
1499
1654
|
*
|
|
1500
1655
|
* ```
|
|
1501
1656
|
*/
|
|
1502
|
-
addCommandToChannel: addMessageToChannel(
|
|
1657
|
+
addCommandToChannel: addMessageToChannel(join18(path7), "commands"),
|
|
1503
1658
|
/**
|
|
1504
1659
|
* Add a channel to an query
|
|
1505
1660
|
*
|
|
@@ -1516,7 +1671,7 @@ var src_default = (path6) => {
|
|
|
1516
1671
|
*
|
|
1517
1672
|
* ```
|
|
1518
1673
|
*/
|
|
1519
|
-
addQueryToChannel: addMessageToChannel(
|
|
1674
|
+
addQueryToChannel: addMessageToChannel(join18(path7), "queries"),
|
|
1520
1675
|
/**
|
|
1521
1676
|
* ================================
|
|
1522
1677
|
* SERVICES
|
|
@@ -1529,14 +1684,14 @@ var src_default = (path6) => {
|
|
|
1529
1684
|
* @param options - Optional options to write the event
|
|
1530
1685
|
*
|
|
1531
1686
|
*/
|
|
1532
|
-
writeService: writeService(
|
|
1687
|
+
writeService: writeService(join18(path7, "services")),
|
|
1533
1688
|
/**
|
|
1534
1689
|
* Adds a versioned service to EventCatalog
|
|
1535
1690
|
*
|
|
1536
1691
|
* @param service - The service to write
|
|
1537
1692
|
*
|
|
1538
1693
|
*/
|
|
1539
|
-
writeVersionedService: writeVersionedService(
|
|
1694
|
+
writeVersionedService: writeVersionedService(join18(path7, "services")),
|
|
1540
1695
|
/**
|
|
1541
1696
|
* Adds a service to a domain in EventCatalog
|
|
1542
1697
|
*
|
|
@@ -1545,45 +1700,45 @@ var src_default = (path6) => {
|
|
|
1545
1700
|
* @param options - Optional options to write the event
|
|
1546
1701
|
*
|
|
1547
1702
|
*/
|
|
1548
|
-
writeServiceToDomain: writeServiceToDomain(
|
|
1703
|
+
writeServiceToDomain: writeServiceToDomain(join18(path7, "domains")),
|
|
1549
1704
|
/**
|
|
1550
1705
|
* Returns a service from EventCatalog
|
|
1551
1706
|
* @param id - The id of the service to retrieve
|
|
1552
1707
|
* @param version - Optional id of the version to get (supports semver)
|
|
1553
1708
|
* @returns Service|Undefined
|
|
1554
1709
|
*/
|
|
1555
|
-
getService: getService(
|
|
1710
|
+
getService: getService(join18(path7)),
|
|
1556
1711
|
/**
|
|
1557
1712
|
* Returns a service from EventCatalog by it's path.
|
|
1558
1713
|
* @param path - The path to the service to retrieve
|
|
1559
1714
|
* @returns Service|Undefined
|
|
1560
1715
|
*/
|
|
1561
|
-
getServiceByPath: getServiceByPath(
|
|
1716
|
+
getServiceByPath: getServiceByPath(join18(path7)),
|
|
1562
1717
|
/**
|
|
1563
1718
|
* Returns all services from EventCatalog
|
|
1564
1719
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1565
1720
|
* @returns Service[]|Undefined
|
|
1566
1721
|
*/
|
|
1567
|
-
getServices: getServices(
|
|
1722
|
+
getServices: getServices(join18(path7)),
|
|
1568
1723
|
/**
|
|
1569
1724
|
* Moves a given service id to the version directory
|
|
1570
1725
|
* @param directory
|
|
1571
1726
|
*/
|
|
1572
|
-
versionService: versionService(
|
|
1727
|
+
versionService: versionService(join18(path7)),
|
|
1573
1728
|
/**
|
|
1574
1729
|
* Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
|
|
1575
1730
|
*
|
|
1576
1731
|
* @param path - The path to your service, e.g. `/InventoryService`
|
|
1577
1732
|
*
|
|
1578
1733
|
*/
|
|
1579
|
-
rmService: rmService(
|
|
1734
|
+
rmService: rmService(join18(path7, "services")),
|
|
1580
1735
|
/**
|
|
1581
1736
|
* Remove an service by an service id
|
|
1582
1737
|
*
|
|
1583
1738
|
* @param id - The id of the service you want to remove
|
|
1584
1739
|
*
|
|
1585
1740
|
*/
|
|
1586
|
-
rmServiceById: rmServiceById(
|
|
1741
|
+
rmServiceById: rmServiceById(join18(path7)),
|
|
1587
1742
|
/**
|
|
1588
1743
|
* Adds a file to the given service
|
|
1589
1744
|
* @param id - The id of the service to add the file to
|
|
@@ -1591,21 +1746,21 @@ var src_default = (path6) => {
|
|
|
1591
1746
|
* @param version - Optional version of the service to add the file to
|
|
1592
1747
|
* @returns
|
|
1593
1748
|
*/
|
|
1594
|
-
addFileToService: addFileToService(
|
|
1749
|
+
addFileToService: addFileToService(join18(path7)),
|
|
1595
1750
|
/**
|
|
1596
1751
|
* Returns the specifications for a given service
|
|
1597
1752
|
* @param id - The id of the service to retrieve the specifications for
|
|
1598
1753
|
* @param version - Optional version of the service
|
|
1599
1754
|
* @returns
|
|
1600
1755
|
*/
|
|
1601
|
-
getSpecificationFilesForService: getSpecificationFilesForService(
|
|
1756
|
+
getSpecificationFilesForService: getSpecificationFilesForService(join18(path7)),
|
|
1602
1757
|
/**
|
|
1603
1758
|
* Check to see if a service version exists
|
|
1604
1759
|
* @param id - The id of the service
|
|
1605
1760
|
* @param version - The version of the service (supports semver)
|
|
1606
1761
|
* @returns
|
|
1607
1762
|
*/
|
|
1608
|
-
serviceHasVersion: serviceHasVersion(
|
|
1763
|
+
serviceHasVersion: serviceHasVersion(join18(path7)),
|
|
1609
1764
|
/**
|
|
1610
1765
|
* Add an event to a service by it's id.
|
|
1611
1766
|
*
|
|
@@ -1625,7 +1780,7 @@ var src_default = (path6) => {
|
|
|
1625
1780
|
*
|
|
1626
1781
|
* ```
|
|
1627
1782
|
*/
|
|
1628
|
-
addEventToService: addMessageToService(
|
|
1783
|
+
addEventToService: addMessageToService(join18(path7)),
|
|
1629
1784
|
/**
|
|
1630
1785
|
* Add a data store to a service by it's id.
|
|
1631
1786
|
*
|
|
@@ -1642,7 +1797,7 @@ var src_default = (path6) => {
|
|
|
1642
1797
|
*
|
|
1643
1798
|
* ```
|
|
1644
1799
|
*/
|
|
1645
|
-
addDataStoreToService: addDataStoreToService(
|
|
1800
|
+
addDataStoreToService: addDataStoreToService(join18(path7)),
|
|
1646
1801
|
/**
|
|
1647
1802
|
* Add a command to a service by it's id.
|
|
1648
1803
|
*
|
|
@@ -1662,7 +1817,7 @@ var src_default = (path6) => {
|
|
|
1662
1817
|
*
|
|
1663
1818
|
* ```
|
|
1664
1819
|
*/
|
|
1665
|
-
addCommandToService: addMessageToService(
|
|
1820
|
+
addCommandToService: addMessageToService(join18(path7)),
|
|
1666
1821
|
/**
|
|
1667
1822
|
* Add a query to a service by it's id.
|
|
1668
1823
|
*
|
|
@@ -1682,7 +1837,7 @@ var src_default = (path6) => {
|
|
|
1682
1837
|
*
|
|
1683
1838
|
* ```
|
|
1684
1839
|
*/
|
|
1685
|
-
addQueryToService: addMessageToService(
|
|
1840
|
+
addQueryToService: addMessageToService(join18(path7)),
|
|
1686
1841
|
/**
|
|
1687
1842
|
* Add an entity to a service by its id.
|
|
1688
1843
|
*
|
|
@@ -1700,7 +1855,7 @@ var src_default = (path6) => {
|
|
|
1700
1855
|
*
|
|
1701
1856
|
* ```
|
|
1702
1857
|
*/
|
|
1703
|
-
addEntityToService: addEntityToService(
|
|
1858
|
+
addEntityToService: addEntityToService(join18(path7)),
|
|
1704
1859
|
/**
|
|
1705
1860
|
* Check to see if a service exists by it's path.
|
|
1706
1861
|
*
|
|
@@ -1717,13 +1872,13 @@ var src_default = (path6) => {
|
|
|
1717
1872
|
* @param path - The path to the service to check
|
|
1718
1873
|
* @returns boolean
|
|
1719
1874
|
*/
|
|
1720
|
-
isService: isService(
|
|
1875
|
+
isService: isService(join18(path7)),
|
|
1721
1876
|
/**
|
|
1722
1877
|
* Converts a file to a service.
|
|
1723
1878
|
* @param file - The file to convert to a service.
|
|
1724
1879
|
* @returns The service.
|
|
1725
1880
|
*/
|
|
1726
|
-
toService: toService(
|
|
1881
|
+
toService: toService(join18(path7)),
|
|
1727
1882
|
/**
|
|
1728
1883
|
* ================================
|
|
1729
1884
|
* Domains
|
|
@@ -1736,39 +1891,39 @@ var src_default = (path6) => {
|
|
|
1736
1891
|
* @param options - Optional options to write the event
|
|
1737
1892
|
*
|
|
1738
1893
|
*/
|
|
1739
|
-
writeDomain: writeDomain(
|
|
1894
|
+
writeDomain: writeDomain(join18(path7, "domains")),
|
|
1740
1895
|
/**
|
|
1741
1896
|
* Returns a domain from EventCatalog
|
|
1742
1897
|
* @param id - The id of the domain to retrieve
|
|
1743
1898
|
* @param version - Optional id of the version to get (supports semver)
|
|
1744
1899
|
* @returns Domain|Undefined
|
|
1745
1900
|
*/
|
|
1746
|
-
getDomain: getDomain(
|
|
1901
|
+
getDomain: getDomain(join18(path7, "domains")),
|
|
1747
1902
|
/**
|
|
1748
1903
|
* Returns all domains from EventCatalog
|
|
1749
1904
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1750
1905
|
* @returns Domain[]|Undefined
|
|
1751
1906
|
*/
|
|
1752
|
-
getDomains: getDomains(
|
|
1907
|
+
getDomains: getDomains(join18(path7)),
|
|
1753
1908
|
/**
|
|
1754
1909
|
* Moves a given domain id to the version directory
|
|
1755
1910
|
* @param directory
|
|
1756
1911
|
*/
|
|
1757
|
-
versionDomain: versionDomain(
|
|
1912
|
+
versionDomain: versionDomain(join18(path7, "domains")),
|
|
1758
1913
|
/**
|
|
1759
1914
|
* Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
|
|
1760
1915
|
*
|
|
1761
1916
|
* @param path - The path to your domain, e.g. `/Payment`
|
|
1762
1917
|
*
|
|
1763
1918
|
*/
|
|
1764
|
-
rmDomain: rmDomain(
|
|
1919
|
+
rmDomain: rmDomain(join18(path7, "domains")),
|
|
1765
1920
|
/**
|
|
1766
1921
|
* Remove an service by an domain id
|
|
1767
1922
|
*
|
|
1768
1923
|
* @param id - The id of the domain you want to remove
|
|
1769
1924
|
*
|
|
1770
1925
|
*/
|
|
1771
|
-
rmDomainById: rmDomainById(
|
|
1926
|
+
rmDomainById: rmDomainById(join18(path7, "domains")),
|
|
1772
1927
|
/**
|
|
1773
1928
|
* Adds a file to the given domain
|
|
1774
1929
|
* @param id - The id of the domain to add the file to
|
|
@@ -1776,28 +1931,28 @@ var src_default = (path6) => {
|
|
|
1776
1931
|
* @param version - Optional version of the domain to add the file to
|
|
1777
1932
|
* @returns
|
|
1778
1933
|
*/
|
|
1779
|
-
addFileToDomain: addFileToDomain(
|
|
1934
|
+
addFileToDomain: addFileToDomain(join18(path7, "domains")),
|
|
1780
1935
|
/**
|
|
1781
1936
|
* Adds an ubiquitous language dictionary to a domain
|
|
1782
1937
|
* @param id - The id of the domain to add the ubiquitous language to
|
|
1783
1938
|
* @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
|
|
1784
1939
|
* @param version - Optional version of the domain to add the ubiquitous language to
|
|
1785
1940
|
*/
|
|
1786
|
-
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(
|
|
1941
|
+
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(join18(path7, "domains")),
|
|
1787
1942
|
/**
|
|
1788
1943
|
* Get the ubiquitous language dictionary from a domain
|
|
1789
1944
|
* @param id - The id of the domain to get the ubiquitous language from
|
|
1790
1945
|
* @param version - Optional version of the domain to get the ubiquitous language from
|
|
1791
1946
|
* @returns
|
|
1792
1947
|
*/
|
|
1793
|
-
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(
|
|
1948
|
+
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(join18(path7, "domains")),
|
|
1794
1949
|
/**
|
|
1795
1950
|
* Check to see if a domain version exists
|
|
1796
1951
|
* @param id - The id of the domain
|
|
1797
1952
|
* @param version - The version of the domain (supports semver)
|
|
1798
1953
|
* @returns
|
|
1799
1954
|
*/
|
|
1800
|
-
domainHasVersion: domainHasVersion(
|
|
1955
|
+
domainHasVersion: domainHasVersion(join18(path7)),
|
|
1801
1956
|
/**
|
|
1802
1957
|
* Adds a given service to a domain
|
|
1803
1958
|
* @param id - The id of the domain
|
|
@@ -1805,7 +1960,7 @@ var src_default = (path6) => {
|
|
|
1805
1960
|
* @param version - (Optional) The version of the domain to add the service to
|
|
1806
1961
|
* @returns
|
|
1807
1962
|
*/
|
|
1808
|
-
addServiceToDomain: addServiceToDomain(
|
|
1963
|
+
addServiceToDomain: addServiceToDomain(join18(path7, "domains")),
|
|
1809
1964
|
/**
|
|
1810
1965
|
* Adds a given subdomain to a domain
|
|
1811
1966
|
* @param id - The id of the domain
|
|
@@ -1813,7 +1968,7 @@ var src_default = (path6) => {
|
|
|
1813
1968
|
* @param version - (Optional) The version of the domain to add the subdomain to
|
|
1814
1969
|
* @returns
|
|
1815
1970
|
*/
|
|
1816
|
-
addSubDomainToDomain: addSubDomainToDomain(
|
|
1971
|
+
addSubDomainToDomain: addSubDomainToDomain(join18(path7, "domains")),
|
|
1817
1972
|
/**
|
|
1818
1973
|
* Adds an entity to a domain
|
|
1819
1974
|
* @param id - The id of the domain
|
|
@@ -1821,7 +1976,7 @@ var src_default = (path6) => {
|
|
|
1821
1976
|
* @param version - (Optional) The version of the domain to add the entity to
|
|
1822
1977
|
* @returns
|
|
1823
1978
|
*/
|
|
1824
|
-
addEntityToDomain: addEntityToDomain(
|
|
1979
|
+
addEntityToDomain: addEntityToDomain(join18(path7, "domains")),
|
|
1825
1980
|
/**
|
|
1826
1981
|
* Add an event to a domain by its id.
|
|
1827
1982
|
*
|
|
@@ -1839,7 +1994,7 @@ var src_default = (path6) => {
|
|
|
1839
1994
|
*
|
|
1840
1995
|
* ```
|
|
1841
1996
|
*/
|
|
1842
|
-
addEventToDomain: addMessageToDomain(
|
|
1997
|
+
addEventToDomain: addMessageToDomain(join18(path7, "domains")),
|
|
1843
1998
|
/**
|
|
1844
1999
|
* Add a command to a domain by its id.
|
|
1845
2000
|
*
|
|
@@ -1857,7 +2012,7 @@ var src_default = (path6) => {
|
|
|
1857
2012
|
*
|
|
1858
2013
|
* ```
|
|
1859
2014
|
*/
|
|
1860
|
-
addCommandToDomain: addMessageToDomain(
|
|
2015
|
+
addCommandToDomain: addMessageToDomain(join18(path7, "domains")),
|
|
1861
2016
|
/**
|
|
1862
2017
|
* Add a query to a domain by its id.
|
|
1863
2018
|
*
|
|
@@ -1875,7 +2030,7 @@ var src_default = (path6) => {
|
|
|
1875
2030
|
*
|
|
1876
2031
|
* ```
|
|
1877
2032
|
*/
|
|
1878
|
-
addQueryToDomain: addMessageToDomain(
|
|
2033
|
+
addQueryToDomain: addMessageToDomain(join18(path7, "domains")),
|
|
1879
2034
|
/**
|
|
1880
2035
|
* ================================
|
|
1881
2036
|
* Teams
|
|
@@ -1888,25 +2043,25 @@ var src_default = (path6) => {
|
|
|
1888
2043
|
* @param options - Optional options to write the team
|
|
1889
2044
|
*
|
|
1890
2045
|
*/
|
|
1891
|
-
writeTeam: writeTeam(
|
|
2046
|
+
writeTeam: writeTeam(join18(path7, "teams")),
|
|
1892
2047
|
/**
|
|
1893
2048
|
* Returns a team from EventCatalog
|
|
1894
2049
|
* @param id - The id of the team to retrieve
|
|
1895
2050
|
* @returns Team|Undefined
|
|
1896
2051
|
*/
|
|
1897
|
-
getTeam: getTeam(
|
|
2052
|
+
getTeam: getTeam(join18(path7, "teams")),
|
|
1898
2053
|
/**
|
|
1899
2054
|
* Returns all teams from EventCatalog
|
|
1900
2055
|
* @returns Team[]|Undefined
|
|
1901
2056
|
*/
|
|
1902
|
-
getTeams: getTeams(
|
|
2057
|
+
getTeams: getTeams(join18(path7, "teams")),
|
|
1903
2058
|
/**
|
|
1904
2059
|
* Remove a team by the team id
|
|
1905
2060
|
*
|
|
1906
2061
|
* @param id - The id of the team you want to remove
|
|
1907
2062
|
*
|
|
1908
2063
|
*/
|
|
1909
|
-
rmTeamById: rmTeamById(
|
|
2064
|
+
rmTeamById: rmTeamById(join18(path7, "teams")),
|
|
1910
2065
|
/**
|
|
1911
2066
|
* ================================
|
|
1912
2067
|
* Users
|
|
@@ -1919,25 +2074,25 @@ var src_default = (path6) => {
|
|
|
1919
2074
|
* @param options - Optional options to write the user
|
|
1920
2075
|
*
|
|
1921
2076
|
*/
|
|
1922
|
-
writeUser: writeUser(
|
|
2077
|
+
writeUser: writeUser(join18(path7, "users")),
|
|
1923
2078
|
/**
|
|
1924
2079
|
* Returns a user from EventCatalog
|
|
1925
2080
|
* @param id - The id of the user to retrieve
|
|
1926
2081
|
* @returns User|Undefined
|
|
1927
2082
|
*/
|
|
1928
|
-
getUser: getUser(
|
|
2083
|
+
getUser: getUser(join18(path7, "users")),
|
|
1929
2084
|
/**
|
|
1930
2085
|
* Returns all user from EventCatalog
|
|
1931
2086
|
* @returns User[]|Undefined
|
|
1932
2087
|
*/
|
|
1933
|
-
getUsers: getUsers(
|
|
2088
|
+
getUsers: getUsers(join18(path7)),
|
|
1934
2089
|
/**
|
|
1935
2090
|
* Remove a user by the user id
|
|
1936
2091
|
*
|
|
1937
2092
|
* @param id - The id of the user you want to remove
|
|
1938
2093
|
*
|
|
1939
2094
|
*/
|
|
1940
|
-
rmUserById: rmUserById(
|
|
2095
|
+
rmUserById: rmUserById(join18(path7, "users")),
|
|
1941
2096
|
/**
|
|
1942
2097
|
* ================================
|
|
1943
2098
|
* Custom Docs
|
|
@@ -1948,32 +2103,32 @@ var src_default = (path6) => {
|
|
|
1948
2103
|
* @param path - The path to the custom doc to retrieve
|
|
1949
2104
|
* @returns CustomDoc|Undefined
|
|
1950
2105
|
*/
|
|
1951
|
-
getCustomDoc: getCustomDoc(
|
|
2106
|
+
getCustomDoc: getCustomDoc(join18(path7, "docs")),
|
|
1952
2107
|
/**
|
|
1953
2108
|
* Returns all custom docs from EventCatalog
|
|
1954
2109
|
* @param options - Optional options to get custom docs from a specific path
|
|
1955
2110
|
* @returns CustomDoc[]|Undefined
|
|
1956
2111
|
*/
|
|
1957
|
-
getCustomDocs: getCustomDocs(
|
|
2112
|
+
getCustomDocs: getCustomDocs(join18(path7, "docs")),
|
|
1958
2113
|
/**
|
|
1959
2114
|
* Writes a custom doc to EventCatalog
|
|
1960
2115
|
* @param customDoc - The custom doc to write
|
|
1961
2116
|
* @param options - Optional options to write the custom doc
|
|
1962
2117
|
*
|
|
1963
2118
|
*/
|
|
1964
|
-
writeCustomDoc: writeCustomDoc(
|
|
2119
|
+
writeCustomDoc: writeCustomDoc(join18(path7, "docs")),
|
|
1965
2120
|
/**
|
|
1966
2121
|
* Removes a custom doc from EventCatalog
|
|
1967
2122
|
* @param path - The path to the custom doc to remove
|
|
1968
2123
|
*
|
|
1969
2124
|
*/
|
|
1970
|
-
rmCustomDoc: rmCustomDoc(
|
|
2125
|
+
rmCustomDoc: rmCustomDoc(join18(path7, "docs")),
|
|
1971
2126
|
/**
|
|
1972
2127
|
* Dumps the catalog to a JSON file.
|
|
1973
2128
|
* @param directory - The directory to dump the catalog to
|
|
1974
2129
|
* @returns A JSON file with the catalog
|
|
1975
2130
|
*/
|
|
1976
|
-
dumpCatalog: dumpCatalog(
|
|
2131
|
+
dumpCatalog: dumpCatalog(join18(path7)),
|
|
1977
2132
|
/**
|
|
1978
2133
|
* Returns the event catalog configuration file.
|
|
1979
2134
|
* The event catalog configuration file is the file that contains the configuration for the event catalog.
|
|
@@ -1981,7 +2136,7 @@ var src_default = (path6) => {
|
|
|
1981
2136
|
* @param directory - The directory of the catalog.
|
|
1982
2137
|
* @returns A JSON object with the configuration for the event catalog.
|
|
1983
2138
|
*/
|
|
1984
|
-
getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(
|
|
2139
|
+
getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(join18(path7)),
|
|
1985
2140
|
/**
|
|
1986
2141
|
* ================================
|
|
1987
2142
|
* Resources Utils
|
|
@@ -2006,33 +2161,33 @@ var src_default = (path6) => {
|
|
|
2006
2161
|
* @param path - The path to the message to retrieve
|
|
2007
2162
|
* @returns Message|Undefined
|
|
2008
2163
|
*/
|
|
2009
|
-
getMessageBySchemaPath: getMessageBySchemaPath(
|
|
2164
|
+
getMessageBySchemaPath: getMessageBySchemaPath(join18(path7)),
|
|
2010
2165
|
/**
|
|
2011
2166
|
* Returns the producers and consumers (services) for a given message
|
|
2012
2167
|
* @param id - The id of the message to get the producers and consumers for
|
|
2013
2168
|
* @param version - Optional version of the message
|
|
2014
2169
|
* @returns { producers: Service[], consumers: Service[] }
|
|
2015
2170
|
*/
|
|
2016
|
-
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(
|
|
2171
|
+
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join18(path7)),
|
|
2017
2172
|
/**
|
|
2018
2173
|
* Returns the consumers of a given schema path
|
|
2019
2174
|
* @param path - The path to the schema to get the consumers for
|
|
2020
2175
|
* @returns Service[]
|
|
2021
2176
|
*/
|
|
2022
|
-
getConsumersOfSchema: getConsumersOfSchema(
|
|
2177
|
+
getConsumersOfSchema: getConsumersOfSchema(join18(path7)),
|
|
2023
2178
|
/**
|
|
2024
2179
|
* Returns the producers of a given schema path
|
|
2025
2180
|
* @param path - The path to the schema to get the producers for
|
|
2026
2181
|
* @returns Service[]
|
|
2027
2182
|
*/
|
|
2028
|
-
getProducersOfSchema: getProducersOfSchema(
|
|
2183
|
+
getProducersOfSchema: getProducersOfSchema(join18(path7)),
|
|
2029
2184
|
/**
|
|
2030
2185
|
* Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
|
|
2031
2186
|
* @param id - The id of the resource to get the owners for
|
|
2032
2187
|
* @param version - Optional version of the resource
|
|
2033
2188
|
* @returns { owners: User[] }
|
|
2034
2189
|
*/
|
|
2035
|
-
getOwnersForResource: getOwnersForResource(
|
|
2190
|
+
getOwnersForResource: getOwnersForResource(join18(path7)),
|
|
2036
2191
|
/**
|
|
2037
2192
|
* ================================
|
|
2038
2193
|
* Entities
|
|
@@ -2044,13 +2199,13 @@ var src_default = (path6) => {
|
|
|
2044
2199
|
* @param version - Optional id of the version to get (supports semver)
|
|
2045
2200
|
* @returns Entity|Undefined
|
|
2046
2201
|
*/
|
|
2047
|
-
getEntity: getEntity(
|
|
2202
|
+
getEntity: getEntity(join18(path7)),
|
|
2048
2203
|
/**
|
|
2049
2204
|
* Returns all entities from EventCatalog
|
|
2050
2205
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2051
2206
|
* @returns Entity[]|Undefined
|
|
2052
2207
|
*/
|
|
2053
|
-
getEntities: getEntities(
|
|
2208
|
+
getEntities: getEntities(join18(path7)),
|
|
2054
2209
|
/**
|
|
2055
2210
|
* Adds an entity to EventCatalog
|
|
2056
2211
|
*
|
|
@@ -2058,33 +2213,33 @@ var src_default = (path6) => {
|
|
|
2058
2213
|
* @param options - Optional options to write the entity
|
|
2059
2214
|
*
|
|
2060
2215
|
*/
|
|
2061
|
-
writeEntity: writeEntity(
|
|
2216
|
+
writeEntity: writeEntity(join18(path7, "entities")),
|
|
2062
2217
|
/**
|
|
2063
2218
|
* Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
|
|
2064
2219
|
*
|
|
2065
2220
|
* @param path - The path to your entity, e.g. `/User`
|
|
2066
2221
|
*
|
|
2067
2222
|
*/
|
|
2068
|
-
rmEntity: rmEntity(
|
|
2223
|
+
rmEntity: rmEntity(join18(path7, "entities")),
|
|
2069
2224
|
/**
|
|
2070
2225
|
* Remove an entity by an entity id
|
|
2071
2226
|
*
|
|
2072
2227
|
* @param id - The id of the entity you want to remove
|
|
2073
2228
|
*
|
|
2074
2229
|
*/
|
|
2075
|
-
rmEntityById: rmEntityById(
|
|
2230
|
+
rmEntityById: rmEntityById(join18(path7)),
|
|
2076
2231
|
/**
|
|
2077
2232
|
* Moves a given entity id to the version directory
|
|
2078
2233
|
* @param id - The id of the entity to version
|
|
2079
2234
|
*/
|
|
2080
|
-
versionEntity: versionEntity(
|
|
2235
|
+
versionEntity: versionEntity(join18(path7)),
|
|
2081
2236
|
/**
|
|
2082
2237
|
* Check to see if an entity version exists
|
|
2083
2238
|
* @param id - The id of the entity
|
|
2084
2239
|
* @param version - The version of the entity (supports semver)
|
|
2085
2240
|
* @returns
|
|
2086
2241
|
*/
|
|
2087
|
-
entityHasVersion: entityHasVersion(
|
|
2242
|
+
entityHasVersion: entityHasVersion(join18(path7)),
|
|
2088
2243
|
/**
|
|
2089
2244
|
* ================================
|
|
2090
2245
|
* Data Stores
|
|
@@ -2096,42 +2251,42 @@ var src_default = (path6) => {
|
|
|
2096
2251
|
* @param options - Optional options to write the data store
|
|
2097
2252
|
*
|
|
2098
2253
|
*/
|
|
2099
|
-
writeDataStore: writeDataStore(
|
|
2254
|
+
writeDataStore: writeDataStore(join18(path7, "containers")),
|
|
2100
2255
|
/**
|
|
2101
2256
|
* Returns a data store from EventCatalog
|
|
2102
2257
|
* @param id - The id of the data store to retrieve
|
|
2103
2258
|
* @param version - Optional id of the version to get (supports semver)
|
|
2104
2259
|
* @returns Container|Undefined
|
|
2105
2260
|
*/
|
|
2106
|
-
getDataStore: getDataStore(
|
|
2261
|
+
getDataStore: getDataStore(join18(path7)),
|
|
2107
2262
|
/**
|
|
2108
2263
|
* Returns all data stores from EventCatalog
|
|
2109
2264
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2110
2265
|
* @returns Container[]|Undefined
|
|
2111
2266
|
*/
|
|
2112
|
-
getDataStores: getDataStores(
|
|
2267
|
+
getDataStores: getDataStores(join18(path7)),
|
|
2113
2268
|
/**
|
|
2114
2269
|
* Version a data store by its id
|
|
2115
2270
|
* @param id - The id of the data store to version
|
|
2116
2271
|
*/
|
|
2117
|
-
versionDataStore: versionDataStore(
|
|
2272
|
+
versionDataStore: versionDataStore(join18(path7, "containers")),
|
|
2118
2273
|
/**
|
|
2119
2274
|
* Remove a data store by its path
|
|
2120
2275
|
* @param path - The path to the data store to remove
|
|
2121
2276
|
*/
|
|
2122
|
-
rmDataStore: rmDataStore(
|
|
2277
|
+
rmDataStore: rmDataStore(join18(path7, "containers")),
|
|
2123
2278
|
/**
|
|
2124
2279
|
* Remove a data store by its id
|
|
2125
2280
|
* @param id - The id of the data store to remove
|
|
2126
2281
|
*/
|
|
2127
|
-
rmDataStoreById: rmDataStoreById(
|
|
2282
|
+
rmDataStoreById: rmDataStoreById(join18(path7)),
|
|
2128
2283
|
/**
|
|
2129
2284
|
* Check to see if a data store version exists
|
|
2130
2285
|
* @param id - The id of the data store
|
|
2131
2286
|
* @param version - The version of the data store (supports semver)
|
|
2132
2287
|
* @returns
|
|
2133
2288
|
*/
|
|
2134
|
-
dataStoreHasVersion: dataStoreHasVersion(
|
|
2289
|
+
dataStoreHasVersion: dataStoreHasVersion(join18(path7)),
|
|
2135
2290
|
/**
|
|
2136
2291
|
* Adds a file to a data store by its id
|
|
2137
2292
|
* @param id - The id of the data store to add the file to
|
|
@@ -2139,14 +2294,14 @@ var src_default = (path6) => {
|
|
|
2139
2294
|
* @param version - Optional version of the data store to add the file to
|
|
2140
2295
|
* @returns
|
|
2141
2296
|
*/
|
|
2142
|
-
addFileToDataStore: addFileToDataStore(
|
|
2297
|
+
addFileToDataStore: addFileToDataStore(join18(path7)),
|
|
2143
2298
|
/**
|
|
2144
2299
|
* Writes a data store to a service by its id
|
|
2145
2300
|
* @param dataStore - The data store to write
|
|
2146
2301
|
* @param service - The service to write the data store to
|
|
2147
2302
|
* @returns
|
|
2148
2303
|
*/
|
|
2149
|
-
writeDataStoreToService: writeDataStoreToService(
|
|
2304
|
+
writeDataStoreToService: writeDataStoreToService(join18(path7)),
|
|
2150
2305
|
/**
|
|
2151
2306
|
* ================================
|
|
2152
2307
|
* Data Products
|
|
@@ -2158,7 +2313,7 @@ var src_default = (path6) => {
|
|
|
2158
2313
|
* @param options - Optional options to write the data product
|
|
2159
2314
|
*
|
|
2160
2315
|
*/
|
|
2161
|
-
writeDataProduct: writeDataProduct(
|
|
2316
|
+
writeDataProduct: writeDataProduct(join18(path7, "data-products")),
|
|
2162
2317
|
/**
|
|
2163
2318
|
* Writes a data product to a domain in EventCatalog
|
|
2164
2319
|
* @param dataProduct - The data product to write
|
|
@@ -2166,43 +2321,43 @@ var src_default = (path6) => {
|
|
|
2166
2321
|
* @param options - Optional options to write the data product
|
|
2167
2322
|
*
|
|
2168
2323
|
*/
|
|
2169
|
-
writeDataProductToDomain: writeDataProductToDomain(
|
|
2324
|
+
writeDataProductToDomain: writeDataProductToDomain(join18(path7, "domains")),
|
|
2170
2325
|
/**
|
|
2171
2326
|
* Returns a data product from EventCatalog
|
|
2172
2327
|
* @param id - The id of the data product to retrieve
|
|
2173
2328
|
* @param version - Optional id of the version to get (supports semver)
|
|
2174
2329
|
* @returns DataProduct|Undefined
|
|
2175
2330
|
*/
|
|
2176
|
-
getDataProduct: getDataProduct(
|
|
2331
|
+
getDataProduct: getDataProduct(join18(path7)),
|
|
2177
2332
|
/**
|
|
2178
2333
|
* Returns all data products from EventCatalog
|
|
2179
2334
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2180
2335
|
* @returns DataProduct[]|Undefined
|
|
2181
2336
|
*/
|
|
2182
|
-
getDataProducts: getDataProducts(
|
|
2337
|
+
getDataProducts: getDataProducts(join18(path7)),
|
|
2183
2338
|
/**
|
|
2184
2339
|
* Version a data product by its id
|
|
2185
2340
|
* @param id - The id of the data product to version
|
|
2186
2341
|
*/
|
|
2187
|
-
versionDataProduct: versionDataProduct(
|
|
2342
|
+
versionDataProduct: versionDataProduct(join18(path7)),
|
|
2188
2343
|
/**
|
|
2189
2344
|
* Remove a data product by its path
|
|
2190
2345
|
* @param path - The path to the data product to remove
|
|
2191
2346
|
*/
|
|
2192
|
-
rmDataProduct: rmDataProduct(
|
|
2347
|
+
rmDataProduct: rmDataProduct(join18(path7, "data-products")),
|
|
2193
2348
|
/**
|
|
2194
2349
|
* Remove a data product by its id
|
|
2195
2350
|
* @param id - The id of the data product to remove
|
|
2196
2351
|
* @param version - Optional version of the data product to remove
|
|
2197
2352
|
*/
|
|
2198
|
-
rmDataProductById: rmDataProductById(
|
|
2353
|
+
rmDataProductById: rmDataProductById(join18(path7)),
|
|
2199
2354
|
/**
|
|
2200
2355
|
* Check to see if a data product version exists
|
|
2201
2356
|
* @param id - The id of the data product
|
|
2202
2357
|
* @param version - The version of the data product (supports semver)
|
|
2203
2358
|
* @returns
|
|
2204
2359
|
*/
|
|
2205
|
-
dataProductHasVersion: dataProductHasVersion(
|
|
2360
|
+
dataProductHasVersion: dataProductHasVersion(join18(path7)),
|
|
2206
2361
|
/**
|
|
2207
2362
|
* Adds a file to a data product by its id
|
|
2208
2363
|
* @param id - The id of the data product to add the file to
|
|
@@ -2210,7 +2365,7 @@ var src_default = (path6) => {
|
|
|
2210
2365
|
* @param version - Optional version of the data product to add the file to
|
|
2211
2366
|
* @returns
|
|
2212
2367
|
*/
|
|
2213
|
-
addFileToDataProduct: addFileToDataProduct(
|
|
2368
|
+
addFileToDataProduct: addFileToDataProduct(join18(path7)),
|
|
2214
2369
|
/**
|
|
2215
2370
|
* Adds a data product to a domain
|
|
2216
2371
|
* @param id - The id of the domain
|
|
@@ -2218,106 +2373,181 @@ var src_default = (path6) => {
|
|
|
2218
2373
|
* @param version - (Optional) The version of the domain to add the data product to
|
|
2219
2374
|
* @returns
|
|
2220
2375
|
*/
|
|
2221
|
-
addDataProductToDomain: addDataProductToDomain(
|
|
2376
|
+
addDataProductToDomain: addDataProductToDomain(join18(path7, "domains")),
|
|
2377
|
+
/**
|
|
2378
|
+
* ================================
|
|
2379
|
+
* Diagrams
|
|
2380
|
+
* ================================
|
|
2381
|
+
*/
|
|
2382
|
+
/**
|
|
2383
|
+
* Returns a diagram from EventCatalog
|
|
2384
|
+
* @param id - The id of the diagram to retrieve
|
|
2385
|
+
* @param version - Optional id of the version to get (supports semver)
|
|
2386
|
+
* @returns Diagram|Undefined
|
|
2387
|
+
*/
|
|
2388
|
+
getDiagram: getDiagram(join18(path7)),
|
|
2389
|
+
/**
|
|
2390
|
+
* Returns all diagrams from EventCatalog
|
|
2391
|
+
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2392
|
+
* @returns Diagram[]|Undefined
|
|
2393
|
+
*/
|
|
2394
|
+
getDiagrams: getDiagrams(join18(path7)),
|
|
2395
|
+
/**
|
|
2396
|
+
* Adds a diagram to EventCatalog
|
|
2397
|
+
*
|
|
2398
|
+
* @param diagram - The diagram to write
|
|
2399
|
+
* @param options - Optional options to write the diagram
|
|
2400
|
+
*
|
|
2401
|
+
*/
|
|
2402
|
+
writeDiagram: writeDiagram(join18(path7, "diagrams")),
|
|
2403
|
+
/**
|
|
2404
|
+
* Remove a diagram from EventCatalog (modeled on the standard POSIX rm utility)
|
|
2405
|
+
*
|
|
2406
|
+
* @param path - The path to your diagram, e.g. `/ArchitectureDiagram`
|
|
2407
|
+
*
|
|
2408
|
+
*/
|
|
2409
|
+
rmDiagram: rmDiagram(join18(path7, "diagrams")),
|
|
2410
|
+
/**
|
|
2411
|
+
* Remove a diagram by a diagram id
|
|
2412
|
+
*
|
|
2413
|
+
* @param id - The id of the diagram you want to remove
|
|
2414
|
+
*
|
|
2415
|
+
*/
|
|
2416
|
+
rmDiagramById: rmDiagramById(join18(path7)),
|
|
2417
|
+
/**
|
|
2418
|
+
* Moves a given diagram id to the version directory
|
|
2419
|
+
* @param id - The id of the diagram to version
|
|
2420
|
+
*/
|
|
2421
|
+
versionDiagram: versionDiagram(join18(path7)),
|
|
2422
|
+
/**
|
|
2423
|
+
* Check to see if a diagram version exists
|
|
2424
|
+
* @param id - The id of the diagram
|
|
2425
|
+
* @param version - The version of the diagram (supports semver)
|
|
2426
|
+
* @returns
|
|
2427
|
+
*/
|
|
2428
|
+
diagramHasVersion: diagramHasVersion(join18(path7)),
|
|
2429
|
+
/**
|
|
2430
|
+
* Adds a file to the given diagram
|
|
2431
|
+
* @param id - The id of the diagram to add the file to
|
|
2432
|
+
* @param file - File contents to add including the content and the file name
|
|
2433
|
+
* @param version - Optional version of the diagram to add the file to
|
|
2434
|
+
* @returns
|
|
2435
|
+
*/
|
|
2436
|
+
addFileToDiagram: addFileToDiagram(join18(path7))
|
|
2222
2437
|
};
|
|
2223
2438
|
};
|
|
2224
2439
|
|
|
2225
|
-
// src/
|
|
2226
|
-
|
|
2227
|
-
|
|
2440
|
+
// src/cli/executor.ts
|
|
2441
|
+
async function executeFunction(catalogDir, functionName, rawArgs) {
|
|
2442
|
+
if (!existsSync(catalogDir)) {
|
|
2443
|
+
throw new Error(`Catalog directory not found: ${catalogDir}`);
|
|
2444
|
+
}
|
|
2445
|
+
const sdk = src_default(catalogDir);
|
|
2446
|
+
if (!(functionName in sdk)) {
|
|
2447
|
+
throw new Error(`Function '${functionName}' not found. Use 'eventcatalog list' to see available functions.`);
|
|
2448
|
+
}
|
|
2449
|
+
const fn = sdk[functionName];
|
|
2450
|
+
if (typeof fn !== "function") {
|
|
2451
|
+
throw new Error(`'${functionName}' is not a callable function.`);
|
|
2452
|
+
}
|
|
2453
|
+
const parsedArgs = parseArguments(rawArgs);
|
|
2228
2454
|
try {
|
|
2229
|
-
|
|
2230
|
-
const packageJsonObject = JSON.parse(packageJson);
|
|
2231
|
-
return packageJsonObject["dependencies"]["@eventcatalog/core"];
|
|
2455
|
+
return await fn(...parsedArgs);
|
|
2232
2456
|
} catch (error) {
|
|
2233
|
-
|
|
2457
|
+
throw new Error(`Error executing '${functionName}': ${error instanceof Error ? error.message : String(error)}`);
|
|
2234
2458
|
}
|
|
2235
|
-
}
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
// src/cli/list.ts
|
|
2462
|
+
function listFunctions(catalogDir = ".") {
|
|
2463
|
+
const sdk = src_default(catalogDir);
|
|
2464
|
+
const functionNames = Object.keys(sdk).filter((key) => typeof sdk[key] === "function");
|
|
2465
|
+
const categories = {
|
|
2466
|
+
Events: [],
|
|
2467
|
+
Commands: [],
|
|
2468
|
+
Queries: [],
|
|
2469
|
+
Channels: [],
|
|
2470
|
+
Services: [],
|
|
2471
|
+
Domains: [],
|
|
2472
|
+
Entities: [],
|
|
2473
|
+
DataStores: [],
|
|
2474
|
+
DataProducts: [],
|
|
2475
|
+
Teams: [],
|
|
2476
|
+
Users: [],
|
|
2477
|
+
"Custom Docs": [],
|
|
2478
|
+
Messages: [],
|
|
2479
|
+
Utilities: []
|
|
2480
|
+
};
|
|
2481
|
+
functionNames.forEach((name) => {
|
|
2482
|
+
if (name.includes("Event")) categories["Events"].push(name);
|
|
2483
|
+
else if (name.includes("Command")) categories["Commands"].push(name);
|
|
2484
|
+
else if (name.includes("Query")) categories["Queries"].push(name);
|
|
2485
|
+
else if (name.includes("Channel")) categories["Channels"].push(name);
|
|
2486
|
+
else if (name.includes("Service")) categories["Services"].push(name);
|
|
2487
|
+
else if (name.includes("Domain")) categories["Domains"].push(name);
|
|
2488
|
+
else if (name.includes("Entity")) categories["Entities"].push(name);
|
|
2489
|
+
else if (name.includes("DataStore")) categories["DataStores"].push(name);
|
|
2490
|
+
else if (name.includes("DataProduct")) categories["DataProducts"].push(name);
|
|
2491
|
+
else if (name.includes("Team")) categories["Teams"].push(name);
|
|
2492
|
+
else if (name.includes("User")) categories["Users"].push(name);
|
|
2493
|
+
else if (name.includes("CustomDoc")) categories["Custom Docs"].push(name);
|
|
2494
|
+
else if (name.includes("Message") || name.includes("Producers") || name.includes("Consumers"))
|
|
2495
|
+
categories["Messages"].push(name);
|
|
2496
|
+
else categories["Utilities"].push(name);
|
|
2497
|
+
});
|
|
2498
|
+
Object.keys(categories).forEach((key) => {
|
|
2499
|
+
if (categories[key].length === 0) {
|
|
2500
|
+
delete categories[key];
|
|
2501
|
+
}
|
|
2502
|
+
});
|
|
2503
|
+
return categories;
|
|
2504
|
+
}
|
|
2505
|
+
function formatListOutput(functions) {
|
|
2506
|
+
let output = "Available EventCatalog SDK Functions:\n\n";
|
|
2507
|
+
Object.entries(functions).forEach(([category, names]) => {
|
|
2508
|
+
output += `${category}:
|
|
2509
|
+
`;
|
|
2510
|
+
names.sort().forEach((name) => {
|
|
2511
|
+
output += ` - ${name}
|
|
2512
|
+
`;
|
|
2513
|
+
});
|
|
2514
|
+
output += "\n";
|
|
2515
|
+
});
|
|
2516
|
+
return output;
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
// src/cli/index.ts
|
|
2520
|
+
var version = "1.0.0";
|
|
2521
|
+
try {
|
|
2522
|
+
const packageJsonPath = resolve2(__dirname, "../../package.json");
|
|
2523
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
2524
|
+
version = packageJson.version;
|
|
2525
|
+
} catch {
|
|
2526
|
+
}
|
|
2527
|
+
program.name("eventcatalog").description("EventCatalog SDK Command-Line Interface").version(version).option("-d, --dir <path>", "Path to the EventCatalog directory (default: current directory)", ".");
|
|
2528
|
+
program.command("list").description("List all available SDK functions").action(() => {
|
|
2262
2529
|
try {
|
|
2263
|
-
const
|
|
2264
|
-
const
|
|
2265
|
-
|
|
2530
|
+
const functions = listFunctions(".");
|
|
2531
|
+
const output = formatListOutput(functions);
|
|
2532
|
+
console.log(output);
|
|
2266
2533
|
} catch (error) {
|
|
2267
|
-
console.error("Error
|
|
2268
|
-
|
|
2534
|
+
console.error("Error listing functions:", error instanceof Error ? error.message : String(error));
|
|
2535
|
+
process.exit(1);
|
|
2269
2536
|
}
|
|
2270
|
-
};
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
hydratedCommands,
|
|
2288
|
-
hydratedTeams,
|
|
2289
|
-
hydratedUsers,
|
|
2290
|
-
hydratedChannels
|
|
2291
|
-
] = await Promise.all([
|
|
2292
|
-
hydrateResource(directory, domains),
|
|
2293
|
-
hydrateResource(directory, services),
|
|
2294
|
-
hydrateResource(directory, events),
|
|
2295
|
-
hydrateResource(directory, queries),
|
|
2296
|
-
hydrateResource(directory, commands),
|
|
2297
|
-
hydrateResource(directory, teams),
|
|
2298
|
-
hydrateResource(directory, users),
|
|
2299
|
-
hydrateResource(directory, channels)
|
|
2300
|
-
]);
|
|
2301
|
-
return {
|
|
2302
|
-
version: DUMP_VERSION,
|
|
2303
|
-
catalogVersion: await getEventCatalogVersion(directory),
|
|
2304
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2305
|
-
resources: {
|
|
2306
|
-
domains: filterCollection(hydratedDomains, { includeMarkdown }),
|
|
2307
|
-
services: filterCollection(hydratedServices, { includeMarkdown }),
|
|
2308
|
-
messages: {
|
|
2309
|
-
events: filterCollection(hydratedEvents, { includeMarkdown }),
|
|
2310
|
-
queries: filterCollection(hydratedQueries, { includeMarkdown }),
|
|
2311
|
-
commands: filterCollection(hydratedCommands, { includeMarkdown })
|
|
2312
|
-
},
|
|
2313
|
-
teams: filterCollection(hydratedTeams, { includeMarkdown }),
|
|
2314
|
-
users: filterCollection(hydratedUsers, { includeMarkdown }),
|
|
2315
|
-
channels: filterCollection(hydratedChannels, { includeMarkdown })
|
|
2316
|
-
}
|
|
2317
|
-
};
|
|
2318
|
-
};
|
|
2319
|
-
export {
|
|
2320
|
-
dumpCatalog,
|
|
2321
|
-
getEventCatalogConfigurationFile
|
|
2322
|
-
};
|
|
2323
|
-
//# sourceMappingURL=eventcatalog.mjs.map
|
|
2537
|
+
});
|
|
2538
|
+
program.arguments("<function> [args...]").action(async (functionName, args) => {
|
|
2539
|
+
try {
|
|
2540
|
+
const options = program.opts();
|
|
2541
|
+
const dir = options.dir || ".";
|
|
2542
|
+
const result = await executeFunction(dir, functionName, args);
|
|
2543
|
+
console.log(JSON.stringify(result, null, 0));
|
|
2544
|
+
} catch (error) {
|
|
2545
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
2546
|
+
process.exit(1);
|
|
2547
|
+
}
|
|
2548
|
+
});
|
|
2549
|
+
program.parse(process.argv);
|
|
2550
|
+
if (process.argv.length < 3) {
|
|
2551
|
+
program.outputHelp();
|
|
2552
|
+
}
|
|
2553
|
+
//# sourceMappingURL=index.mjs.map
|