@eventcatalog/sdk 2.2.0 → 2.2.2
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 +1 -1
- package/dist/channels.js.map +1 -1
- package/dist/channels.mjs.map +1 -1
- package/dist/commands.d.mts +1 -1
- package/dist/commands.d.ts +1 -1
- package/dist/commands.js.map +1 -1
- package/dist/commands.mjs.map +1 -1
- package/dist/eventcatalog.d.mts +34 -0
- package/dist/eventcatalog.d.ts +34 -0
- package/dist/eventcatalog.js +1445 -0
- package/dist/eventcatalog.js.map +1 -0
- package/dist/eventcatalog.mjs +1410 -0
- package/dist/eventcatalog.mjs.map +1 -0
- package/dist/index.d.mts +31 -4
- package/dist/index.d.ts +31 -4
- package/dist/index.js +211 -122
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +213 -124
- package/dist/index.mjs.map +1 -1
- package/dist/queries.d.mts +1 -1
- package/dist/queries.d.ts +1 -1
- package/dist/queries.js.map +1 -1
- package/dist/queries.mjs.map +1 -1
- package/dist/teams.js +4 -4
- package/dist/teams.js.map +1 -1
- package/dist/teams.mjs +4 -4
- package/dist/teams.mjs.map +1 -1
- package/dist/users.js +4 -4
- package/dist/users.js.map +1 -1
- package/dist/users.mjs +4 -4
- package/dist/users.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ __export(index_exports, {
|
|
|
33
33
|
default: () => index_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(index_exports);
|
|
36
|
-
var
|
|
36
|
+
var import_node_path12 = require("path");
|
|
37
37
|
|
|
38
38
|
// src/events.ts
|
|
39
39
|
var import_promises2 = __toESM(require("fs/promises"));
|
|
@@ -54,13 +54,13 @@ var versionExists = async (catalogDir, id, version) => {
|
|
|
54
54
|
var findFileById = async (catalogDir, id, version) => {
|
|
55
55
|
const files = await getFiles(`${catalogDir}/**/index.{md,mdx}`);
|
|
56
56
|
const matchedFiles = await searchFilesForId(files, id) || [];
|
|
57
|
-
const latestVersion = matchedFiles.find((
|
|
57
|
+
const latestVersion = matchedFiles.find((path4) => !path4.includes("versioned"));
|
|
58
58
|
if (!version) {
|
|
59
59
|
return latestVersion;
|
|
60
60
|
}
|
|
61
|
-
const parsedFiles = matchedFiles.map((
|
|
62
|
-
const { data } = import_gray_matter.default.read(
|
|
63
|
-
return { ...data, path:
|
|
61
|
+
const parsedFiles = matchedFiles.map((path4) => {
|
|
62
|
+
const { data } = import_gray_matter.default.read(path4);
|
|
63
|
+
return { ...data, path: path4 };
|
|
64
64
|
});
|
|
65
65
|
const semverRange = (0, import_semver.validRange)(version);
|
|
66
66
|
if (semverRange && (0, import_semver.valid)(version)) {
|
|
@@ -84,8 +84,8 @@ var getFiles = async (pattern, ignore = "") => {
|
|
|
84
84
|
throw new Error(`Error finding files: ${error}`);
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
var readMdxFile = async (
|
|
88
|
-
const { data } = import_gray_matter.default.read(
|
|
87
|
+
var readMdxFile = async (path4) => {
|
|
88
|
+
const { data } = import_gray_matter.default.read(path4);
|
|
89
89
|
const { markdown, ...frontmatter } = data;
|
|
90
90
|
return { ...frontmatter, markdown };
|
|
91
91
|
};
|
|
@@ -166,8 +166,8 @@ var writeResource = async (catalogDir, resource, options = {
|
|
|
166
166
|
override: false,
|
|
167
167
|
versionExistingContent: false
|
|
168
168
|
}) => {
|
|
169
|
-
const
|
|
170
|
-
const fullPath = (0, import_path.join)(catalogDir,
|
|
169
|
+
const path4 = options.path || `/${resource.id}`;
|
|
170
|
+
const fullPath = (0, import_path.join)(catalogDir, path4);
|
|
171
171
|
import_node_fs2.default.mkdirSync(fullPath, { recursive: true });
|
|
172
172
|
const lockPath = (0, import_path.join)(fullPath, "index.mdx");
|
|
173
173
|
if (!import_node_fs2.default.existsSync(lockPath)) {
|
|
@@ -287,8 +287,8 @@ var writeEventToService = (directory) => async (event, service, options = { path
|
|
|
287
287
|
pathForEvent = (0, import_node_path2.join)(pathForEvent, event.id);
|
|
288
288
|
await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
|
|
289
289
|
};
|
|
290
|
-
var rmEvent = (directory) => async (
|
|
291
|
-
await import_promises2.default.rm((0, import_node_path2.join)(directory,
|
|
290
|
+
var rmEvent = (directory) => async (path4) => {
|
|
291
|
+
await import_promises2.default.rm((0, import_node_path2.join)(directory, path4), { recursive: true });
|
|
292
292
|
};
|
|
293
293
|
var rmEventById = (directory) => async (id, version, persistFiles) => {
|
|
294
294
|
await rmResourceById(directory, id, version, { type: "event", persistFiles });
|
|
@@ -318,8 +318,8 @@ var writeCommandToService = (directory) => async (command, service, options = {
|
|
|
318
318
|
pathForCommand = (0, import_node_path3.join)(pathForCommand, command.id);
|
|
319
319
|
await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
|
|
320
320
|
};
|
|
321
|
-
var rmCommand = (directory) => async (
|
|
322
|
-
await import_promises3.default.rm((0, import_node_path3.join)(directory,
|
|
321
|
+
var rmCommand = (directory) => async (path4) => {
|
|
322
|
+
await import_promises3.default.rm((0, import_node_path3.join)(directory, path4), { recursive: true });
|
|
323
323
|
};
|
|
324
324
|
var rmCommandById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "command", persistFiles });
|
|
325
325
|
var versionCommand = (directory) => async (id) => versionResource(directory, id);
|
|
@@ -347,8 +347,8 @@ var writeQueryToService = (directory) => async (query, service, options = { path
|
|
|
347
347
|
pathForQuery = (0, import_node_path4.join)(pathForQuery, query.id);
|
|
348
348
|
await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
|
|
349
349
|
};
|
|
350
|
-
var rmQuery = (directory) => async (
|
|
351
|
-
await import_promises4.default.rm((0, import_node_path4.join)(directory,
|
|
350
|
+
var rmQuery = (directory) => async (path4) => {
|
|
351
|
+
await import_promises4.default.rm((0, import_node_path4.join)(directory, path4), { recursive: true });
|
|
352
352
|
};
|
|
353
353
|
var rmQueryById = (directory) => async (id, version, persistFiles) => {
|
|
354
354
|
await rmResourceById(directory, id, version, { type: "query", persistFiles });
|
|
@@ -384,8 +384,8 @@ var writeService = (directory) => async (service, options = { path: "" }) => {
|
|
|
384
384
|
};
|
|
385
385
|
var writeVersionedService = (directory) => async (service) => {
|
|
386
386
|
const resource = { ...service };
|
|
387
|
-
const
|
|
388
|
-
return await writeService(directory)(resource, { path:
|
|
387
|
+
const path4 = getVersionedDirectory(service.id, service.version);
|
|
388
|
+
return await writeService(directory)(resource, { path: path4 });
|
|
389
389
|
};
|
|
390
390
|
var writeServiceToDomain = (directory) => async (service, domain, options = { path: "" }) => {
|
|
391
391
|
let pathForService = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/services` : `/${domain.id}/services`;
|
|
@@ -393,8 +393,8 @@ var writeServiceToDomain = (directory) => async (service, domain, options = { pa
|
|
|
393
393
|
await writeResource(directory, { ...service }, { ...options, path: pathForService, type: "service" });
|
|
394
394
|
};
|
|
395
395
|
var versionService = (directory) => async (id) => versionResource(directory, id);
|
|
396
|
-
var rmService = (directory) => async (
|
|
397
|
-
await import_promises5.default.rm((0, import_node_path5.join)(directory,
|
|
396
|
+
var rmService = (directory) => async (path4) => {
|
|
397
|
+
await import_promises5.default.rm((0, import_node_path5.join)(directory, path4), { recursive: true });
|
|
398
398
|
};
|
|
399
399
|
var rmServiceById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "service", persistFiles });
|
|
400
400
|
var addFileToService = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
|
|
@@ -447,8 +447,8 @@ var addMessageToService = (directory) => async (id, direction, event, version) =
|
|
|
447
447
|
if (!existingResource) {
|
|
448
448
|
throw new Error(`Cannot find service ${id} in the catalog`);
|
|
449
449
|
}
|
|
450
|
-
const
|
|
451
|
-
const pathToResource = (0, import_node_path5.join)(
|
|
450
|
+
const path4 = existingResource.split("/services")[0];
|
|
451
|
+
const pathToResource = (0, import_node_path5.join)(path4, "services");
|
|
452
452
|
await rmServiceById(directory)(id, version);
|
|
453
453
|
await writeService(pathToResource)(service);
|
|
454
454
|
};
|
|
@@ -476,8 +476,8 @@ var writeDomain = (directory) => async (domain, options = { path: "" }) => {
|
|
|
476
476
|
return await writeResource(directory, resource, { ...options, type: "domain" });
|
|
477
477
|
};
|
|
478
478
|
var versionDomain = (directory) => async (id) => versionResource(directory, id);
|
|
479
|
-
var rmDomain = (directory) => async (
|
|
480
|
-
await import_promises6.default.rm((0, import_node_path6.join)(directory,
|
|
479
|
+
var rmDomain = (directory) => async (path4) => {
|
|
480
|
+
await import_promises6.default.rm((0, import_node_path6.join)(directory, path4), { recursive: true });
|
|
481
481
|
};
|
|
482
482
|
var rmDomainById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "domain", persistFiles });
|
|
483
483
|
var addFileToDomain = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
|
|
@@ -521,8 +521,8 @@ var import_node_path7 = require("path");
|
|
|
521
521
|
var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
|
|
522
522
|
var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
|
|
523
523
|
var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
|
|
524
|
-
var rmChannel = (directory) => async (
|
|
525
|
-
await import_promises7.default.rm((0, import_node_path7.join)(directory,
|
|
524
|
+
var rmChannel = (directory) => async (path4) => {
|
|
525
|
+
await import_promises7.default.rm((0, import_node_path7.join)(directory, path4), { recursive: true });
|
|
526
526
|
};
|
|
527
527
|
var rmChannelById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "channel", persistFiles });
|
|
528
528
|
var versionChannel = (directory) => async (id) => versionResource(directory, id);
|
|
@@ -561,20 +561,103 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
561
561
|
if (!existingResource) {
|
|
562
562
|
throw new Error(`Cannot find message ${id} in the catalog`);
|
|
563
563
|
}
|
|
564
|
-
const
|
|
565
|
-
const pathToResource = (0, import_node_path7.join)(
|
|
564
|
+
const path4 = existingResource.split(`/${collection}`)[0];
|
|
565
|
+
const pathToResource = (0, import_node_path7.join)(path4, collection);
|
|
566
566
|
await rmMessageById(directory)(_message.id, _message.version, true);
|
|
567
567
|
await writeMessage(pathToResource)(message);
|
|
568
568
|
};
|
|
569
569
|
|
|
570
|
-
// src/
|
|
570
|
+
// src/eventcatalog.ts
|
|
571
|
+
var import_fs = __toESM(require("fs"));
|
|
571
572
|
var import_node_path8 = __toESM(require("path"));
|
|
573
|
+
var DUMP_VERSION = "0.0.1";
|
|
574
|
+
var getEventCatalogVersion = async (catalogDir) => {
|
|
575
|
+
const packageJson = import_fs.default.readFileSync((0, import_node_path8.join)(catalogDir, "package.json"), "utf8");
|
|
576
|
+
const packageJsonObject = JSON.parse(packageJson);
|
|
577
|
+
return packageJsonObject["dependencies"]["@eventcatalog/core"];
|
|
578
|
+
};
|
|
579
|
+
var hydrateResource = async (catalogDir, resources, { attachSchema = false } = {}) => {
|
|
580
|
+
return await Promise.all(
|
|
581
|
+
resources.map(async (resource) => {
|
|
582
|
+
const resourcePath = await getResourcePath(catalogDir, resource.id, resource.version);
|
|
583
|
+
let schema = "";
|
|
584
|
+
if (resource.schemaPath && resourcePath?.fullPath) {
|
|
585
|
+
const pathToSchema = import_node_path8.default.join(import_node_path8.default.dirname(resourcePath?.fullPath), resource.schemaPath);
|
|
586
|
+
if (import_fs.default.existsSync(pathToSchema)) {
|
|
587
|
+
schema = import_fs.default.readFileSync(pathToSchema, "utf8");
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
const eventcatalog = schema ? { directory: resourcePath?.directory, schema } : { directory: resourcePath?.directory };
|
|
591
|
+
return {
|
|
592
|
+
...resource,
|
|
593
|
+
_eventcatalog: eventcatalog
|
|
594
|
+
};
|
|
595
|
+
})
|
|
596
|
+
);
|
|
597
|
+
};
|
|
598
|
+
var filterCollection = (collection, options) => {
|
|
599
|
+
return collection.map((item) => ({
|
|
600
|
+
...item,
|
|
601
|
+
markdown: options?.includeMarkdown ? item.markdown : void 0
|
|
602
|
+
}));
|
|
603
|
+
};
|
|
604
|
+
var dumpCatalog = (directory) => async (options) => {
|
|
605
|
+
const { getDomains: getDomains2, getServices: getServices2, getEvents: getEvents2, getQueries: getQueries2, getCommands: getCommands2, getChannels: getChannels2, getTeams: getTeams2, getUsers: getUsers2 } = index_default(directory);
|
|
606
|
+
const { includeMarkdown = true } = options || {};
|
|
607
|
+
const domains = await getDomains2();
|
|
608
|
+
const services = await getServices2();
|
|
609
|
+
const events = await getEvents2();
|
|
610
|
+
const commands = await getCommands2();
|
|
611
|
+
const queries = await getQueries2();
|
|
612
|
+
const teams = await getTeams2();
|
|
613
|
+
const users = await getUsers2();
|
|
614
|
+
const channels = await getChannels2();
|
|
615
|
+
const [
|
|
616
|
+
hydratedDomains,
|
|
617
|
+
hydratedServices,
|
|
618
|
+
hydratedEvents,
|
|
619
|
+
hydratedQueries,
|
|
620
|
+
hydratedCommands,
|
|
621
|
+
hydratedTeams,
|
|
622
|
+
hydratedUsers,
|
|
623
|
+
hydratedChannels
|
|
624
|
+
] = await Promise.all([
|
|
625
|
+
hydrateResource(directory, domains),
|
|
626
|
+
hydrateResource(directory, services),
|
|
627
|
+
hydrateResource(directory, events),
|
|
628
|
+
hydrateResource(directory, queries),
|
|
629
|
+
hydrateResource(directory, commands),
|
|
630
|
+
hydrateResource(directory, teams),
|
|
631
|
+
hydrateResource(directory, users),
|
|
632
|
+
hydrateResource(directory, channels)
|
|
633
|
+
]);
|
|
634
|
+
return {
|
|
635
|
+
version: DUMP_VERSION,
|
|
636
|
+
catalogVersion: await getEventCatalogVersion(directory),
|
|
637
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
638
|
+
resources: {
|
|
639
|
+
domains: filterCollection(hydratedDomains, { includeMarkdown }),
|
|
640
|
+
services: filterCollection(hydratedServices, { includeMarkdown }),
|
|
641
|
+
messages: {
|
|
642
|
+
events: filterCollection(hydratedEvents, { includeMarkdown }),
|
|
643
|
+
queries: filterCollection(hydratedQueries, { includeMarkdown }),
|
|
644
|
+
commands: filterCollection(hydratedCommands, { includeMarkdown })
|
|
645
|
+
},
|
|
646
|
+
teams: filterCollection(hydratedTeams, { includeMarkdown }),
|
|
647
|
+
users: filterCollection(hydratedUsers, { includeMarkdown }),
|
|
648
|
+
channels: filterCollection(hydratedChannels, { includeMarkdown })
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
};
|
|
652
|
+
|
|
653
|
+
// src/custom-docs.ts
|
|
654
|
+
var import_node_path9 = __toESM(require("path"));
|
|
572
655
|
var import_node_fs4 = __toESM(require("fs"));
|
|
573
656
|
var import_promises8 = __toESM(require("fs/promises"));
|
|
574
657
|
var import_gray_matter4 = __toESM(require("gray-matter"));
|
|
575
658
|
var import_slugify = __toESM(require("slugify"));
|
|
576
659
|
var getCustomDoc = (directory) => async (filePath) => {
|
|
577
|
-
const fullPath =
|
|
660
|
+
const fullPath = import_node_path9.default.join(directory, filePath);
|
|
578
661
|
const fullPathWithExtension = fullPath.endsWith(".mdx") ? fullPath : `${fullPath}.mdx`;
|
|
579
662
|
const fileExists = import_node_fs4.default.existsSync(fullPathWithExtension);
|
|
580
663
|
if (!fileExists) {
|
|
@@ -593,23 +676,23 @@ var writeCustomDoc = (directory) => async (customDoc, options = { path: "" }) =>
|
|
|
593
676
|
const { fileName, ...rest } = customDoc;
|
|
594
677
|
const name = fileName || (0, import_slugify.default)(customDoc.title, { lower: true });
|
|
595
678
|
const withExtension = name.endsWith(".mdx") ? name : `${name}.mdx`;
|
|
596
|
-
const fullPath =
|
|
597
|
-
import_node_fs4.default.mkdirSync(
|
|
679
|
+
const fullPath = import_node_path9.default.join(directory, options.path || "", withExtension);
|
|
680
|
+
import_node_fs4.default.mkdirSync(import_node_path9.default.dirname(fullPath), { recursive: true });
|
|
598
681
|
const document = import_gray_matter4.default.stringify(customDoc.markdown.trim(), rest);
|
|
599
682
|
import_node_fs4.default.writeFileSync(fullPath, document);
|
|
600
683
|
};
|
|
601
684
|
var rmCustomDoc = (directory) => async (filePath) => {
|
|
602
685
|
const withExtension = filePath.endsWith(".mdx") ? filePath : `${filePath}.mdx`;
|
|
603
|
-
await import_promises8.default.rm((0,
|
|
686
|
+
await import_promises8.default.rm((0, import_node_path9.join)(directory, withExtension), { recursive: true });
|
|
604
687
|
};
|
|
605
688
|
|
|
606
689
|
// src/teams.ts
|
|
607
690
|
var import_promises9 = __toESM(require("fs/promises"));
|
|
608
691
|
var import_node_fs5 = __toESM(require("fs"));
|
|
609
|
-
var
|
|
692
|
+
var import_node_path10 = require("path");
|
|
610
693
|
var import_gray_matter5 = __toESM(require("gray-matter"));
|
|
611
694
|
var getTeam = (catalogDir) => async (id) => {
|
|
612
|
-
const files = await getFiles(`${catalogDir}/${id}.md`);
|
|
695
|
+
const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);
|
|
613
696
|
if (files.length == 0) return void 0;
|
|
614
697
|
const file = files[0];
|
|
615
698
|
const { data, content } = import_gray_matter5.default.read(file);
|
|
@@ -621,7 +704,7 @@ var getTeam = (catalogDir) => async (id) => {
|
|
|
621
704
|
};
|
|
622
705
|
};
|
|
623
706
|
var getTeams = (catalogDir) => async (options) => {
|
|
624
|
-
const files = await getFiles(`${catalogDir}/teams/*.md`);
|
|
707
|
+
const files = await getFiles(`${catalogDir}/teams/*.{md,mdx}`);
|
|
625
708
|
if (files.length === 0) return [];
|
|
626
709
|
return files.map((file) => {
|
|
627
710
|
const { data, content } = import_gray_matter5.default.read(file);
|
|
@@ -642,19 +725,19 @@ var writeTeam = (catalogDir) => async (team, options = {}) => {
|
|
|
642
725
|
}
|
|
643
726
|
const { markdown, ...frontmatter } = resource;
|
|
644
727
|
const document = import_gray_matter5.default.stringify(markdown, frontmatter);
|
|
645
|
-
import_node_fs5.default.mkdirSync((0,
|
|
646
|
-
import_node_fs5.default.writeFileSync((0,
|
|
728
|
+
import_node_fs5.default.mkdirSync((0, import_node_path10.join)(catalogDir, ""), { recursive: true });
|
|
729
|
+
import_node_fs5.default.writeFileSync((0, import_node_path10.join)(catalogDir, "", `${resource.id}.mdx`), document);
|
|
647
730
|
};
|
|
648
731
|
var rmTeamById = (catalogDir) => async (id) => {
|
|
649
|
-
await import_promises9.default.rm((0,
|
|
732
|
+
await import_promises9.default.rm((0, import_node_path10.join)(catalogDir, `${id}.mdx`), { recursive: true });
|
|
650
733
|
};
|
|
651
734
|
|
|
652
735
|
// src/users.ts
|
|
653
736
|
var import_node_fs6 = __toESM(require("fs"));
|
|
654
|
-
var
|
|
737
|
+
var import_node_path11 = require("path");
|
|
655
738
|
var import_gray_matter6 = __toESM(require("gray-matter"));
|
|
656
739
|
var getUser = (catalogDir) => async (id) => {
|
|
657
|
-
const files = await getFiles(`${catalogDir}/${id}.md`);
|
|
740
|
+
const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);
|
|
658
741
|
if (files.length == 0) return void 0;
|
|
659
742
|
const file = files[0];
|
|
660
743
|
const { data, content } = import_gray_matter6.default.read(file);
|
|
@@ -667,7 +750,7 @@ var getUser = (catalogDir) => async (id) => {
|
|
|
667
750
|
};
|
|
668
751
|
};
|
|
669
752
|
var getUsers = (catalogDir) => async (options) => {
|
|
670
|
-
const files = await getFiles(`${catalogDir}/users/*.md`);
|
|
753
|
+
const files = await getFiles(`${catalogDir}/users/*.{md,mdx}`);
|
|
671
754
|
if (files.length === 0) return [];
|
|
672
755
|
return files.map((file) => {
|
|
673
756
|
const { data, content } = import_gray_matter6.default.read(file);
|
|
@@ -689,15 +772,15 @@ var writeUser = (catalogDir) => async (user, options = {}) => {
|
|
|
689
772
|
}
|
|
690
773
|
const { markdown, ...frontmatter } = resource;
|
|
691
774
|
const document = import_gray_matter6.default.stringify(markdown, frontmatter);
|
|
692
|
-
import_node_fs6.default.mkdirSync((0,
|
|
693
|
-
import_node_fs6.default.writeFileSync((0,
|
|
775
|
+
import_node_fs6.default.mkdirSync((0, import_node_path11.join)(catalogDir, ""), { recursive: true });
|
|
776
|
+
import_node_fs6.default.writeFileSync((0, import_node_path11.join)(catalogDir, "", `${resource.id}.mdx`), document);
|
|
694
777
|
};
|
|
695
778
|
var rmUserById = (catalogDir) => async (id) => {
|
|
696
|
-
import_node_fs6.default.rmSync((0,
|
|
779
|
+
import_node_fs6.default.rmSync((0, import_node_path11.join)(catalogDir, `${id}.mdx`), { recursive: true });
|
|
697
780
|
};
|
|
698
781
|
|
|
699
782
|
// src/index.ts
|
|
700
|
-
var index_default = (
|
|
783
|
+
var index_default = (path4) => {
|
|
701
784
|
return {
|
|
702
785
|
/**
|
|
703
786
|
* Returns an events from EventCatalog
|
|
@@ -705,13 +788,13 @@ var index_default = (path3) => {
|
|
|
705
788
|
* @param version - Optional id of the version to get (supports semver)
|
|
706
789
|
* @returns Event|Undefined
|
|
707
790
|
*/
|
|
708
|
-
getEvent: getEvent((0,
|
|
791
|
+
getEvent: getEvent((0, import_node_path12.join)(path4)),
|
|
709
792
|
/**
|
|
710
793
|
* Returns all events from EventCatalog
|
|
711
794
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
712
795
|
* @returns Event[]|Undefined
|
|
713
796
|
*/
|
|
714
|
-
getEvents: getEvents((0,
|
|
797
|
+
getEvents: getEvents((0, import_node_path12.join)(path4)),
|
|
715
798
|
/**
|
|
716
799
|
* Adds an event to EventCatalog
|
|
717
800
|
*
|
|
@@ -719,7 +802,7 @@ var index_default = (path3) => {
|
|
|
719
802
|
* @param options - Optional options to write the event
|
|
720
803
|
*
|
|
721
804
|
*/
|
|
722
|
-
writeEvent: writeEvent((0,
|
|
805
|
+
writeEvent: writeEvent((0, import_node_path12.join)(path4, "events")),
|
|
723
806
|
/**
|
|
724
807
|
* Adds an event to a service in EventCatalog
|
|
725
808
|
*
|
|
@@ -728,26 +811,26 @@ var index_default = (path3) => {
|
|
|
728
811
|
* @param options - Optional options to write the event
|
|
729
812
|
*
|
|
730
813
|
*/
|
|
731
|
-
writeEventToService: writeEventToService((0,
|
|
814
|
+
writeEventToService: writeEventToService((0, import_node_path12.join)(path4)),
|
|
732
815
|
/**
|
|
733
816
|
* Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
|
|
734
817
|
*
|
|
735
818
|
* @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
|
|
736
819
|
*
|
|
737
820
|
*/
|
|
738
|
-
rmEvent: rmEvent((0,
|
|
821
|
+
rmEvent: rmEvent((0, import_node_path12.join)(path4, "events")),
|
|
739
822
|
/**
|
|
740
823
|
* Remove an event by an Event id
|
|
741
824
|
*
|
|
742
825
|
* @param id - The id of the event you want to remove
|
|
743
826
|
*
|
|
744
827
|
*/
|
|
745
|
-
rmEventById: rmEventById((0,
|
|
828
|
+
rmEventById: rmEventById((0, import_node_path12.join)(path4)),
|
|
746
829
|
/**
|
|
747
830
|
* Moves a given event id to the version directory
|
|
748
831
|
* @param directory
|
|
749
832
|
*/
|
|
750
|
-
versionEvent: versionEvent((0,
|
|
833
|
+
versionEvent: versionEvent((0, import_node_path12.join)(path4)),
|
|
751
834
|
/**
|
|
752
835
|
* Adds a file to the given event
|
|
753
836
|
* @param id - The id of the event to add the file to
|
|
@@ -755,7 +838,7 @@ var index_default = (path3) => {
|
|
|
755
838
|
* @param version - Optional version of the event to add the file to
|
|
756
839
|
* @returns
|
|
757
840
|
*/
|
|
758
|
-
addFileToEvent: addFileToEvent((0,
|
|
841
|
+
addFileToEvent: addFileToEvent((0, import_node_path12.join)(path4)),
|
|
759
842
|
/**
|
|
760
843
|
* Adds a schema to the given event
|
|
761
844
|
* @param id - The id of the event to add the schema to
|
|
@@ -763,14 +846,14 @@ var index_default = (path3) => {
|
|
|
763
846
|
* @param version - Optional version of the event to add the schema to
|
|
764
847
|
* @returns
|
|
765
848
|
*/
|
|
766
|
-
addSchemaToEvent: addSchemaToEvent((0,
|
|
849
|
+
addSchemaToEvent: addSchemaToEvent((0, import_node_path12.join)(path4)),
|
|
767
850
|
/**
|
|
768
851
|
* Check to see if an event version exists
|
|
769
852
|
* @param id - The id of the event
|
|
770
853
|
* @param version - The version of the event (supports semver)
|
|
771
854
|
* @returns
|
|
772
855
|
*/
|
|
773
|
-
eventHasVersion: eventHasVersion((0,
|
|
856
|
+
eventHasVersion: eventHasVersion((0, import_node_path12.join)(path4)),
|
|
774
857
|
/**
|
|
775
858
|
* ================================
|
|
776
859
|
* Commands
|
|
@@ -782,13 +865,13 @@ var index_default = (path3) => {
|
|
|
782
865
|
* @param version - Optional id of the version to get (supports semver)
|
|
783
866
|
* @returns Command|Undefined
|
|
784
867
|
*/
|
|
785
|
-
getCommand: getCommand((0,
|
|
868
|
+
getCommand: getCommand((0, import_node_path12.join)(path4)),
|
|
786
869
|
/**
|
|
787
870
|
* Returns all commands from EventCatalog
|
|
788
871
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
789
872
|
* @returns Command[]|Undefined
|
|
790
873
|
*/
|
|
791
|
-
getCommands: getCommands((0,
|
|
874
|
+
getCommands: getCommands((0, import_node_path12.join)(path4)),
|
|
792
875
|
/**
|
|
793
876
|
* Adds an command to EventCatalog
|
|
794
877
|
*
|
|
@@ -796,7 +879,7 @@ var index_default = (path3) => {
|
|
|
796
879
|
* @param options - Optional options to write the command
|
|
797
880
|
*
|
|
798
881
|
*/
|
|
799
|
-
writeCommand: writeCommand((0,
|
|
882
|
+
writeCommand: writeCommand((0, import_node_path12.join)(path4, "commands")),
|
|
800
883
|
/**
|
|
801
884
|
* Adds a command to a service in EventCatalog
|
|
802
885
|
*
|
|
@@ -805,26 +888,26 @@ var index_default = (path3) => {
|
|
|
805
888
|
* @param options - Optional options to write the command
|
|
806
889
|
*
|
|
807
890
|
*/
|
|
808
|
-
writeCommandToService: writeCommandToService((0,
|
|
891
|
+
writeCommandToService: writeCommandToService((0, import_node_path12.join)(path4)),
|
|
809
892
|
/**
|
|
810
893
|
* Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
|
|
811
894
|
*
|
|
812
895
|
* @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
|
|
813
896
|
*
|
|
814
897
|
*/
|
|
815
|
-
rmCommand: rmCommand((0,
|
|
898
|
+
rmCommand: rmCommand((0, import_node_path12.join)(path4, "commands")),
|
|
816
899
|
/**
|
|
817
900
|
* Remove an command by an Event id
|
|
818
901
|
*
|
|
819
902
|
* @param id - The id of the command you want to remove
|
|
820
903
|
*
|
|
821
904
|
*/
|
|
822
|
-
rmCommandById: rmCommandById((0,
|
|
905
|
+
rmCommandById: rmCommandById((0, import_node_path12.join)(path4)),
|
|
823
906
|
/**
|
|
824
907
|
* Moves a given command id to the version directory
|
|
825
908
|
* @param directory
|
|
826
909
|
*/
|
|
827
|
-
versionCommand: versionCommand((0,
|
|
910
|
+
versionCommand: versionCommand((0, import_node_path12.join)(path4)),
|
|
828
911
|
/**
|
|
829
912
|
* Adds a file to the given command
|
|
830
913
|
* @param id - The id of the command to add the file to
|
|
@@ -832,7 +915,7 @@ var index_default = (path3) => {
|
|
|
832
915
|
* @param version - Optional version of the command to add the file to
|
|
833
916
|
* @returns
|
|
834
917
|
*/
|
|
835
|
-
addFileToCommand: addFileToCommand((0,
|
|
918
|
+
addFileToCommand: addFileToCommand((0, import_node_path12.join)(path4)),
|
|
836
919
|
/**
|
|
837
920
|
* Adds a schema to the given command
|
|
838
921
|
* @param id - The id of the command to add the schema to
|
|
@@ -840,14 +923,14 @@ var index_default = (path3) => {
|
|
|
840
923
|
* @param version - Optional version of the command to add the schema to
|
|
841
924
|
* @returns
|
|
842
925
|
*/
|
|
843
|
-
addSchemaToCommand: addSchemaToCommand((0,
|
|
926
|
+
addSchemaToCommand: addSchemaToCommand((0, import_node_path12.join)(path4)),
|
|
844
927
|
/**
|
|
845
928
|
* Check to see if a command version exists
|
|
846
929
|
* @param id - The id of the command
|
|
847
930
|
* @param version - The version of the command (supports semver)
|
|
848
931
|
* @returns
|
|
849
932
|
*/
|
|
850
|
-
commandHasVersion: commandHasVersion((0,
|
|
933
|
+
commandHasVersion: commandHasVersion((0, import_node_path12.join)(path4)),
|
|
851
934
|
/**
|
|
852
935
|
* ================================
|
|
853
936
|
* Queries
|
|
@@ -859,13 +942,13 @@ var index_default = (path3) => {
|
|
|
859
942
|
* @param version - Optional id of the version to get (supports semver)
|
|
860
943
|
* @returns Query|Undefined
|
|
861
944
|
*/
|
|
862
|
-
getQuery: getQuery((0,
|
|
945
|
+
getQuery: getQuery((0, import_node_path12.join)(path4)),
|
|
863
946
|
/**
|
|
864
947
|
* Returns all queries from EventCatalog
|
|
865
948
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
866
949
|
* @returns Query[]|Undefined
|
|
867
950
|
*/
|
|
868
|
-
getQueries: getQueries((0,
|
|
951
|
+
getQueries: getQueries((0, import_node_path12.join)(path4)),
|
|
869
952
|
/**
|
|
870
953
|
* Adds a query to EventCatalog
|
|
871
954
|
*
|
|
@@ -873,7 +956,7 @@ var index_default = (path3) => {
|
|
|
873
956
|
* @param options - Optional options to write the event
|
|
874
957
|
*
|
|
875
958
|
*/
|
|
876
|
-
writeQuery: writeQuery((0,
|
|
959
|
+
writeQuery: writeQuery((0, import_node_path12.join)(path4, "queries")),
|
|
877
960
|
/**
|
|
878
961
|
* Adds a query to a service in EventCatalog
|
|
879
962
|
*
|
|
@@ -882,26 +965,26 @@ var index_default = (path3) => {
|
|
|
882
965
|
* @param options - Optional options to write the query
|
|
883
966
|
*
|
|
884
967
|
*/
|
|
885
|
-
writeQueryToService: writeQueryToService((0,
|
|
968
|
+
writeQueryToService: writeQueryToService((0, import_node_path12.join)(path4)),
|
|
886
969
|
/**
|
|
887
970
|
* Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
|
|
888
971
|
*
|
|
889
972
|
* @param path - The path to your query, e.g. `/Orders/GetOrder`
|
|
890
973
|
*
|
|
891
974
|
*/
|
|
892
|
-
rmQuery: rmQuery((0,
|
|
975
|
+
rmQuery: rmQuery((0, import_node_path12.join)(path4, "queries")),
|
|
893
976
|
/**
|
|
894
977
|
* Remove a query by a Query id
|
|
895
978
|
*
|
|
896
979
|
* @param id - The id of the query you want to remove
|
|
897
980
|
*
|
|
898
981
|
*/
|
|
899
|
-
rmQueryById: rmQueryById((0,
|
|
982
|
+
rmQueryById: rmQueryById((0, import_node_path12.join)(path4)),
|
|
900
983
|
/**
|
|
901
984
|
* Moves a given query id to the version directory
|
|
902
985
|
* @param directory
|
|
903
986
|
*/
|
|
904
|
-
versionQuery: versionQuery((0,
|
|
987
|
+
versionQuery: versionQuery((0, import_node_path12.join)(path4)),
|
|
905
988
|
/**
|
|
906
989
|
* Adds a file to the given query
|
|
907
990
|
* @param id - The id of the query to add the file to
|
|
@@ -909,7 +992,7 @@ var index_default = (path3) => {
|
|
|
909
992
|
* @param version - Optional version of the query to add the file to
|
|
910
993
|
* @returns
|
|
911
994
|
*/
|
|
912
|
-
addFileToQuery: addFileToQuery((0,
|
|
995
|
+
addFileToQuery: addFileToQuery((0, import_node_path12.join)(path4)),
|
|
913
996
|
/**
|
|
914
997
|
* Adds a schema to the given query
|
|
915
998
|
* @param id - The id of the query to add the schema to
|
|
@@ -917,14 +1000,14 @@ var index_default = (path3) => {
|
|
|
917
1000
|
* @param version - Optional version of the query to add the schema to
|
|
918
1001
|
* @returns
|
|
919
1002
|
*/
|
|
920
|
-
addSchemaToQuery: addSchemaToQuery((0,
|
|
1003
|
+
addSchemaToQuery: addSchemaToQuery((0, import_node_path12.join)(path4)),
|
|
921
1004
|
/**
|
|
922
1005
|
* Check to see if an query version exists
|
|
923
1006
|
* @param id - The id of the query
|
|
924
1007
|
* @param version - The version of the query (supports semver)
|
|
925
1008
|
* @returns
|
|
926
1009
|
*/
|
|
927
|
-
queryHasVersion: queryHasVersion((0,
|
|
1010
|
+
queryHasVersion: queryHasVersion((0, import_node_path12.join)(path4)),
|
|
928
1011
|
/**
|
|
929
1012
|
* ================================
|
|
930
1013
|
* Channels
|
|
@@ -936,13 +1019,13 @@ var index_default = (path3) => {
|
|
|
936
1019
|
* @param version - Optional id of the version to get (supports semver)
|
|
937
1020
|
* @returns Channel|Undefined
|
|
938
1021
|
*/
|
|
939
|
-
getChannel: getChannel((0,
|
|
1022
|
+
getChannel: getChannel((0, import_node_path12.join)(path4)),
|
|
940
1023
|
/**
|
|
941
1024
|
* Returns all channels from EventCatalog
|
|
942
1025
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
943
1026
|
* @returns Channel[]|Undefined
|
|
944
1027
|
*/
|
|
945
|
-
getChannels: getChannels((0,
|
|
1028
|
+
getChannels: getChannels((0, import_node_path12.join)(path4)),
|
|
946
1029
|
/**
|
|
947
1030
|
* Adds an channel to EventCatalog
|
|
948
1031
|
*
|
|
@@ -950,33 +1033,33 @@ var index_default = (path3) => {
|
|
|
950
1033
|
* @param options - Optional options to write the channel
|
|
951
1034
|
*
|
|
952
1035
|
*/
|
|
953
|
-
writeChannel: writeChannel((0,
|
|
1036
|
+
writeChannel: writeChannel((0, import_node_path12.join)(path4, "channels")),
|
|
954
1037
|
/**
|
|
955
1038
|
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
956
1039
|
*
|
|
957
1040
|
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
958
1041
|
*
|
|
959
1042
|
*/
|
|
960
|
-
rmChannel: rmChannel((0,
|
|
1043
|
+
rmChannel: rmChannel((0, import_node_path12.join)(path4, "channels")),
|
|
961
1044
|
/**
|
|
962
1045
|
* Remove an channel by an Event id
|
|
963
1046
|
*
|
|
964
1047
|
* @param id - The id of the channel you want to remove
|
|
965
1048
|
*
|
|
966
1049
|
*/
|
|
967
|
-
rmChannelById: rmChannelById((0,
|
|
1050
|
+
rmChannelById: rmChannelById((0, import_node_path12.join)(path4)),
|
|
968
1051
|
/**
|
|
969
1052
|
* Moves a given channel id to the version directory
|
|
970
1053
|
* @param directory
|
|
971
1054
|
*/
|
|
972
|
-
versionChannel: versionChannel((0,
|
|
1055
|
+
versionChannel: versionChannel((0, import_node_path12.join)(path4)),
|
|
973
1056
|
/**
|
|
974
1057
|
* Check to see if a channel version exists
|
|
975
1058
|
* @param id - The id of the channel
|
|
976
1059
|
* @param version - The version of the channel (supports semver)
|
|
977
1060
|
* @returns
|
|
978
1061
|
*/
|
|
979
|
-
channelHasVersion: channelHasVersion((0,
|
|
1062
|
+
channelHasVersion: channelHasVersion((0, import_node_path12.join)(path4)),
|
|
980
1063
|
/**
|
|
981
1064
|
* Add a channel to an event
|
|
982
1065
|
*
|
|
@@ -993,7 +1076,7 @@ var index_default = (path3) => {
|
|
|
993
1076
|
*
|
|
994
1077
|
* ```
|
|
995
1078
|
*/
|
|
996
|
-
addEventToChannel: addMessageToChannel((0,
|
|
1079
|
+
addEventToChannel: addMessageToChannel((0, import_node_path12.join)(path4), "events"),
|
|
997
1080
|
/**
|
|
998
1081
|
* Add a channel to an command
|
|
999
1082
|
*
|
|
@@ -1010,7 +1093,7 @@ var index_default = (path3) => {
|
|
|
1010
1093
|
*
|
|
1011
1094
|
* ```
|
|
1012
1095
|
*/
|
|
1013
|
-
addCommandToChannel: addMessageToChannel((0,
|
|
1096
|
+
addCommandToChannel: addMessageToChannel((0, import_node_path12.join)(path4), "commands"),
|
|
1014
1097
|
/**
|
|
1015
1098
|
* Add a channel to an query
|
|
1016
1099
|
*
|
|
@@ -1027,7 +1110,7 @@ var index_default = (path3) => {
|
|
|
1027
1110
|
*
|
|
1028
1111
|
* ```
|
|
1029
1112
|
*/
|
|
1030
|
-
addQueryToChannel: addMessageToChannel((0,
|
|
1113
|
+
addQueryToChannel: addMessageToChannel((0, import_node_path12.join)(path4), "queries"),
|
|
1031
1114
|
/**
|
|
1032
1115
|
* ================================
|
|
1033
1116
|
* SERVICES
|
|
@@ -1040,14 +1123,14 @@ var index_default = (path3) => {
|
|
|
1040
1123
|
* @param options - Optional options to write the event
|
|
1041
1124
|
*
|
|
1042
1125
|
*/
|
|
1043
|
-
writeService: writeService((0,
|
|
1126
|
+
writeService: writeService((0, import_node_path12.join)(path4, "services")),
|
|
1044
1127
|
/**
|
|
1045
1128
|
* Adds a versioned service to EventCatalog
|
|
1046
1129
|
*
|
|
1047
1130
|
* @param service - The service to write
|
|
1048
1131
|
*
|
|
1049
1132
|
*/
|
|
1050
|
-
writeVersionedService: writeVersionedService((0,
|
|
1133
|
+
writeVersionedService: writeVersionedService((0, import_node_path12.join)(path4, "services")),
|
|
1051
1134
|
/**
|
|
1052
1135
|
* Adds a service to a domain in EventCatalog
|
|
1053
1136
|
*
|
|
@@ -1056,39 +1139,39 @@ var index_default = (path3) => {
|
|
|
1056
1139
|
* @param options - Optional options to write the event
|
|
1057
1140
|
*
|
|
1058
1141
|
*/
|
|
1059
|
-
writeServiceToDomain: writeServiceToDomain((0,
|
|
1142
|
+
writeServiceToDomain: writeServiceToDomain((0, import_node_path12.join)(path4, "domains")),
|
|
1060
1143
|
/**
|
|
1061
1144
|
* Returns a service from EventCatalog
|
|
1062
1145
|
* @param id - The id of the service to retrieve
|
|
1063
1146
|
* @param version - Optional id of the version to get (supports semver)
|
|
1064
1147
|
* @returns Service|Undefined
|
|
1065
1148
|
*/
|
|
1066
|
-
getService: getService((0,
|
|
1149
|
+
getService: getService((0, import_node_path12.join)(path4)),
|
|
1067
1150
|
/**
|
|
1068
1151
|
* Returns all services from EventCatalog
|
|
1069
1152
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1070
1153
|
* @returns Service[]|Undefined
|
|
1071
1154
|
*/
|
|
1072
|
-
getServices: getServices((0,
|
|
1155
|
+
getServices: getServices((0, import_node_path12.join)(path4)),
|
|
1073
1156
|
/**
|
|
1074
1157
|
* Moves a given service id to the version directory
|
|
1075
1158
|
* @param directory
|
|
1076
1159
|
*/
|
|
1077
|
-
versionService: versionService((0,
|
|
1160
|
+
versionService: versionService((0, import_node_path12.join)(path4)),
|
|
1078
1161
|
/**
|
|
1079
1162
|
* Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
|
|
1080
1163
|
*
|
|
1081
1164
|
* @param path - The path to your service, e.g. `/InventoryService`
|
|
1082
1165
|
*
|
|
1083
1166
|
*/
|
|
1084
|
-
rmService: rmService((0,
|
|
1167
|
+
rmService: rmService((0, import_node_path12.join)(path4, "services")),
|
|
1085
1168
|
/**
|
|
1086
1169
|
* Remove an service by an service id
|
|
1087
1170
|
*
|
|
1088
1171
|
* @param id - The id of the service you want to remove
|
|
1089
1172
|
*
|
|
1090
1173
|
*/
|
|
1091
|
-
rmServiceById: rmServiceById((0,
|
|
1174
|
+
rmServiceById: rmServiceById((0, import_node_path12.join)(path4)),
|
|
1092
1175
|
/**
|
|
1093
1176
|
* Adds a file to the given service
|
|
1094
1177
|
* @param id - The id of the service to add the file to
|
|
@@ -1096,21 +1179,21 @@ var index_default = (path3) => {
|
|
|
1096
1179
|
* @param version - Optional version of the service to add the file to
|
|
1097
1180
|
* @returns
|
|
1098
1181
|
*/
|
|
1099
|
-
addFileToService: addFileToService((0,
|
|
1182
|
+
addFileToService: addFileToService((0, import_node_path12.join)(path4)),
|
|
1100
1183
|
/**
|
|
1101
1184
|
* Returns the specifications for a given service
|
|
1102
1185
|
* @param id - The id of the service to retrieve the specifications for
|
|
1103
1186
|
* @param version - Optional version of the service
|
|
1104
1187
|
* @returns
|
|
1105
1188
|
*/
|
|
1106
|
-
getSpecificationFilesForService: getSpecificationFilesForService((0,
|
|
1189
|
+
getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path12.join)(path4)),
|
|
1107
1190
|
/**
|
|
1108
1191
|
* Check to see if a service version exists
|
|
1109
1192
|
* @param id - The id of the service
|
|
1110
1193
|
* @param version - The version of the service (supports semver)
|
|
1111
1194
|
* @returns
|
|
1112
1195
|
*/
|
|
1113
|
-
serviceHasVersion: serviceHasVersion((0,
|
|
1196
|
+
serviceHasVersion: serviceHasVersion((0, import_node_path12.join)(path4)),
|
|
1114
1197
|
/**
|
|
1115
1198
|
* Add an event to a service by it's id.
|
|
1116
1199
|
*
|
|
@@ -1130,7 +1213,7 @@ var index_default = (path3) => {
|
|
|
1130
1213
|
*
|
|
1131
1214
|
* ```
|
|
1132
1215
|
*/
|
|
1133
|
-
addEventToService: addMessageToService((0,
|
|
1216
|
+
addEventToService: addMessageToService((0, import_node_path12.join)(path4)),
|
|
1134
1217
|
/**
|
|
1135
1218
|
* Add a command to a service by it's id.
|
|
1136
1219
|
*
|
|
@@ -1150,7 +1233,7 @@ var index_default = (path3) => {
|
|
|
1150
1233
|
*
|
|
1151
1234
|
* ```
|
|
1152
1235
|
*/
|
|
1153
|
-
addCommandToService: addMessageToService((0,
|
|
1236
|
+
addCommandToService: addMessageToService((0, import_node_path12.join)(path4)),
|
|
1154
1237
|
/**
|
|
1155
1238
|
* Add a query to a service by it's id.
|
|
1156
1239
|
*
|
|
@@ -1170,7 +1253,7 @@ var index_default = (path3) => {
|
|
|
1170
1253
|
*
|
|
1171
1254
|
* ```
|
|
1172
1255
|
*/
|
|
1173
|
-
addQueryToService: addMessageToService((0,
|
|
1256
|
+
addQueryToService: addMessageToService((0, import_node_path12.join)(path4)),
|
|
1174
1257
|
/**
|
|
1175
1258
|
* ================================
|
|
1176
1259
|
* Domains
|
|
@@ -1183,39 +1266,39 @@ var index_default = (path3) => {
|
|
|
1183
1266
|
* @param options - Optional options to write the event
|
|
1184
1267
|
*
|
|
1185
1268
|
*/
|
|
1186
|
-
writeDomain: writeDomain((0,
|
|
1269
|
+
writeDomain: writeDomain((0, import_node_path12.join)(path4, "domains")),
|
|
1187
1270
|
/**
|
|
1188
1271
|
* Returns a domain from EventCatalog
|
|
1189
1272
|
* @param id - The id of the domain to retrieve
|
|
1190
1273
|
* @param version - Optional id of the version to get (supports semver)
|
|
1191
1274
|
* @returns Domain|Undefined
|
|
1192
1275
|
*/
|
|
1193
|
-
getDomain: getDomain((0,
|
|
1276
|
+
getDomain: getDomain((0, import_node_path12.join)(path4, "domains")),
|
|
1194
1277
|
/**
|
|
1195
1278
|
* Returns all domains from EventCatalog
|
|
1196
1279
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1197
1280
|
* @returns Domain[]|Undefined
|
|
1198
1281
|
*/
|
|
1199
|
-
getDomains: getDomains((0,
|
|
1282
|
+
getDomains: getDomains((0, import_node_path12.join)(path4)),
|
|
1200
1283
|
/**
|
|
1201
1284
|
* Moves a given domain id to the version directory
|
|
1202
1285
|
* @param directory
|
|
1203
1286
|
*/
|
|
1204
|
-
versionDomain: versionDomain((0,
|
|
1287
|
+
versionDomain: versionDomain((0, import_node_path12.join)(path4, "domains")),
|
|
1205
1288
|
/**
|
|
1206
1289
|
* Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
|
|
1207
1290
|
*
|
|
1208
1291
|
* @param path - The path to your domain, e.g. `/Payment`
|
|
1209
1292
|
*
|
|
1210
1293
|
*/
|
|
1211
|
-
rmDomain: rmDomain((0,
|
|
1294
|
+
rmDomain: rmDomain((0, import_node_path12.join)(path4, "domains")),
|
|
1212
1295
|
/**
|
|
1213
1296
|
* Remove an service by an domain id
|
|
1214
1297
|
*
|
|
1215
1298
|
* @param id - The id of the domain you want to remove
|
|
1216
1299
|
*
|
|
1217
1300
|
*/
|
|
1218
|
-
rmDomainById: rmDomainById((0,
|
|
1301
|
+
rmDomainById: rmDomainById((0, import_node_path12.join)(path4, "domains")),
|
|
1219
1302
|
/**
|
|
1220
1303
|
* Adds a file to the given domain
|
|
1221
1304
|
* @param id - The id of the domain to add the file to
|
|
@@ -1223,28 +1306,28 @@ var index_default = (path3) => {
|
|
|
1223
1306
|
* @param version - Optional version of the domain to add the file to
|
|
1224
1307
|
* @returns
|
|
1225
1308
|
*/
|
|
1226
|
-
addFileToDomain: addFileToDomain((0,
|
|
1309
|
+
addFileToDomain: addFileToDomain((0, import_node_path12.join)(path4, "domains")),
|
|
1227
1310
|
/**
|
|
1228
1311
|
* Adds an ubiquitous language dictionary to a domain
|
|
1229
1312
|
* @param id - The id of the domain to add the ubiquitous language to
|
|
1230
1313
|
* @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
|
|
1231
1314
|
* @param version - Optional version of the domain to add the ubiquitous language to
|
|
1232
1315
|
*/
|
|
1233
|
-
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0,
|
|
1316
|
+
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path12.join)(path4, "domains")),
|
|
1234
1317
|
/**
|
|
1235
1318
|
* Get the ubiquitous language dictionary from a domain
|
|
1236
1319
|
* @param id - The id of the domain to get the ubiquitous language from
|
|
1237
1320
|
* @param version - Optional version of the domain to get the ubiquitous language from
|
|
1238
1321
|
* @returns
|
|
1239
1322
|
*/
|
|
1240
|
-
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0,
|
|
1323
|
+
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path12.join)(path4, "domains")),
|
|
1241
1324
|
/**
|
|
1242
1325
|
* Check to see if a domain version exists
|
|
1243
1326
|
* @param id - The id of the domain
|
|
1244
1327
|
* @param version - The version of the domain (supports semver)
|
|
1245
1328
|
* @returns
|
|
1246
1329
|
*/
|
|
1247
|
-
domainHasVersion: domainHasVersion((0,
|
|
1330
|
+
domainHasVersion: domainHasVersion((0, import_node_path12.join)(path4)),
|
|
1248
1331
|
/**
|
|
1249
1332
|
* Adds a given service to a domain
|
|
1250
1333
|
* @param id - The id of the domain
|
|
@@ -1252,7 +1335,7 @@ var index_default = (path3) => {
|
|
|
1252
1335
|
* @param version - (Optional) The version of the domain to add the service to
|
|
1253
1336
|
* @returns
|
|
1254
1337
|
*/
|
|
1255
|
-
addServiceToDomain: addServiceToDomain((0,
|
|
1338
|
+
addServiceToDomain: addServiceToDomain((0, import_node_path12.join)(path4, "domains")),
|
|
1256
1339
|
/**
|
|
1257
1340
|
* ================================
|
|
1258
1341
|
* Teams
|
|
@@ -1265,25 +1348,25 @@ var index_default = (path3) => {
|
|
|
1265
1348
|
* @param options - Optional options to write the team
|
|
1266
1349
|
*
|
|
1267
1350
|
*/
|
|
1268
|
-
writeTeam: writeTeam((0,
|
|
1351
|
+
writeTeam: writeTeam((0, import_node_path12.join)(path4, "teams")),
|
|
1269
1352
|
/**
|
|
1270
1353
|
* Returns a team from EventCatalog
|
|
1271
1354
|
* @param id - The id of the team to retrieve
|
|
1272
1355
|
* @returns Team|Undefined
|
|
1273
1356
|
*/
|
|
1274
|
-
getTeam: getTeam((0,
|
|
1357
|
+
getTeam: getTeam((0, import_node_path12.join)(path4, "teams")),
|
|
1275
1358
|
/**
|
|
1276
1359
|
* Returns all teams from EventCatalog
|
|
1277
1360
|
* @returns Team[]|Undefined
|
|
1278
1361
|
*/
|
|
1279
|
-
getTeams: getTeams((0,
|
|
1362
|
+
getTeams: getTeams((0, import_node_path12.join)(path4)),
|
|
1280
1363
|
/**
|
|
1281
1364
|
* Remove a team by the team id
|
|
1282
1365
|
*
|
|
1283
1366
|
* @param id - The id of the team you want to remove
|
|
1284
1367
|
*
|
|
1285
1368
|
*/
|
|
1286
|
-
rmTeamById: rmTeamById((0,
|
|
1369
|
+
rmTeamById: rmTeamById((0, import_node_path12.join)(path4, "teams")),
|
|
1287
1370
|
/**
|
|
1288
1371
|
* ================================
|
|
1289
1372
|
* Users
|
|
@@ -1296,25 +1379,25 @@ var index_default = (path3) => {
|
|
|
1296
1379
|
* @param options - Optional options to write the user
|
|
1297
1380
|
*
|
|
1298
1381
|
*/
|
|
1299
|
-
writeUser: writeUser((0,
|
|
1382
|
+
writeUser: writeUser((0, import_node_path12.join)(path4, "users")),
|
|
1300
1383
|
/**
|
|
1301
1384
|
* Returns a user from EventCatalog
|
|
1302
1385
|
* @param id - The id of the user to retrieve
|
|
1303
1386
|
* @returns User|Undefined
|
|
1304
1387
|
*/
|
|
1305
|
-
getUser: getUser((0,
|
|
1388
|
+
getUser: getUser((0, import_node_path12.join)(path4, "users")),
|
|
1306
1389
|
/**
|
|
1307
1390
|
* Returns all user from EventCatalog
|
|
1308
1391
|
* @returns User[]|Undefined
|
|
1309
1392
|
*/
|
|
1310
|
-
getUsers: getUsers((0,
|
|
1393
|
+
getUsers: getUsers((0, import_node_path12.join)(path4)),
|
|
1311
1394
|
/**
|
|
1312
1395
|
* Remove a user by the user id
|
|
1313
1396
|
*
|
|
1314
1397
|
* @param id - The id of the user you want to remove
|
|
1315
1398
|
*
|
|
1316
1399
|
*/
|
|
1317
|
-
rmUserById: rmUserById((0,
|
|
1400
|
+
rmUserById: rmUserById((0, import_node_path12.join)(path4, "users")),
|
|
1318
1401
|
/**
|
|
1319
1402
|
* ================================
|
|
1320
1403
|
* Custom Docs
|
|
@@ -1325,26 +1408,32 @@ var index_default = (path3) => {
|
|
|
1325
1408
|
* @param path - The path to the custom doc to retrieve
|
|
1326
1409
|
* @returns CustomDoc|Undefined
|
|
1327
1410
|
*/
|
|
1328
|
-
getCustomDoc: getCustomDoc((0,
|
|
1411
|
+
getCustomDoc: getCustomDoc((0, import_node_path12.join)(path4, "docs")),
|
|
1329
1412
|
/**
|
|
1330
1413
|
* Returns all custom docs from EventCatalog
|
|
1331
1414
|
* @param options - Optional options to get custom docs from a specific path
|
|
1332
1415
|
* @returns CustomDoc[]|Undefined
|
|
1333
1416
|
*/
|
|
1334
|
-
getCustomDocs: getCustomDocs((0,
|
|
1417
|
+
getCustomDocs: getCustomDocs((0, import_node_path12.join)(path4, "docs")),
|
|
1335
1418
|
/**
|
|
1336
1419
|
* Writes a custom doc to EventCatalog
|
|
1337
1420
|
* @param customDoc - The custom doc to write
|
|
1338
1421
|
* @param options - Optional options to write the custom doc
|
|
1339
1422
|
*
|
|
1340
1423
|
*/
|
|
1341
|
-
writeCustomDoc: writeCustomDoc((0,
|
|
1424
|
+
writeCustomDoc: writeCustomDoc((0, import_node_path12.join)(path4, "docs")),
|
|
1342
1425
|
/**
|
|
1343
1426
|
* Removes a custom doc from EventCatalog
|
|
1344
1427
|
* @param path - The path to the custom doc to remove
|
|
1345
1428
|
*
|
|
1346
1429
|
*/
|
|
1347
|
-
rmCustomDoc: rmCustomDoc((0,
|
|
1430
|
+
rmCustomDoc: rmCustomDoc((0, import_node_path12.join)(path4, "docs")),
|
|
1431
|
+
/**
|
|
1432
|
+
* Dumps the catalog to a JSON file.
|
|
1433
|
+
* @param directory - The directory to dump the catalog to
|
|
1434
|
+
* @returns A JSON file with the catalog
|
|
1435
|
+
*/
|
|
1436
|
+
dumpCatalog: dumpCatalog((0, import_node_path12.join)(path4))
|
|
1348
1437
|
};
|
|
1349
1438
|
};
|
|
1350
1439
|
//# sourceMappingURL=index.js.map
|