@eventcatalog/sdk 2.7.6 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/channels.js +18 -9
- package/dist/channels.js.map +1 -1
- package/dist/channels.mjs +11 -2
- package/dist/channels.mjs.map +1 -1
- package/dist/commands.js +14 -5
- package/dist/commands.js.map +1 -1
- package/dist/commands.mjs +11 -2
- package/dist/commands.mjs.map +1 -1
- package/dist/containers.d.mts +179 -0
- package/dist/containers.d.ts +179 -0
- package/dist/containers.js +374 -0
- package/dist/containers.js.map +1 -0
- package/dist/containers.mjs +331 -0
- package/dist/containers.mjs.map +1 -0
- package/dist/custom-docs.js +6 -5
- package/dist/custom-docs.js.map +1 -1
- package/dist/custom-docs.mjs +1 -0
- package/dist/custom-docs.mjs.map +1 -1
- package/dist/domains.js +17 -8
- package/dist/domains.js.map +1 -1
- package/dist/domains.mjs +11 -2
- package/dist/domains.mjs.map +1 -1
- package/dist/entities.js +13 -4
- package/dist/entities.js.map +1 -1
- package/dist/entities.mjs +11 -2
- package/dist/entities.mjs.map +1 -1
- package/dist/eventcatalog.js +255 -152
- package/dist/eventcatalog.js.map +1 -1
- package/dist/eventcatalog.mjs +209 -106
- package/dist/eventcatalog.mjs.map +1 -1
- package/dist/events.js +14 -5
- package/dist/events.js.map +1 -1
- package/dist/events.mjs +11 -2
- package/dist/events.mjs.map +1 -1
- package/dist/index.d.mts +97 -30
- package/dist/index.d.ts +97 -30
- package/dist/index.js +255 -152
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +203 -100
- package/dist/index.mjs.map +1 -1
- package/dist/messages.js +4 -3
- package/dist/messages.js.map +1 -1
- package/dist/messages.mjs +1 -0
- package/dist/messages.mjs.map +1 -1
- package/dist/queries.js +14 -5
- package/dist/queries.js.map +1 -1
- package/dist/queries.mjs +11 -2
- package/dist/queries.mjs.map +1 -1
- package/dist/services.js +20 -11
- package/dist/services.js.map +1 -1
- package/dist/services.mjs +11 -2
- package/dist/services.mjs.map +1 -1
- package/dist/teams.js +9 -8
- package/dist/teams.js.map +1 -1
- package/dist/teams.mjs +1 -0
- package/dist/teams.mjs.map +1 -1
- package/dist/types.d.d.mts +24 -1
- package/dist/types.d.d.ts +24 -1
- package/dist/types.d.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33,11 +33,11 @@ __export(index_exports, {
|
|
|
33
33
|
default: () => index_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(index_exports);
|
|
36
|
-
var
|
|
36
|
+
var import_node_path17 = require("path");
|
|
37
37
|
|
|
38
38
|
// src/events.ts
|
|
39
39
|
var import_promises2 = __toESM(require("fs/promises"));
|
|
40
|
-
var
|
|
40
|
+
var import_node_path3 = require("path");
|
|
41
41
|
|
|
42
42
|
// src/internal/utils.ts
|
|
43
43
|
var import_glob = require("glob");
|
|
@@ -154,6 +154,7 @@ var import_promises = __toESM(require("fs/promises"));
|
|
|
154
154
|
var import_node_fs2 = __toESM(require("fs"));
|
|
155
155
|
var import_semver2 = require("semver");
|
|
156
156
|
var import_proper_lockfile = require("proper-lockfile");
|
|
157
|
+
var import_node_path2 = require("path");
|
|
157
158
|
var versionResource = async (catalogDir, id) => {
|
|
158
159
|
const files = await getFiles(`${catalogDir}/**/index.{md,mdx}`);
|
|
159
160
|
const matchedFiles = await searchFilesForId(files, id);
|
|
@@ -161,16 +162,24 @@ var versionResource = async (catalogDir, id) => {
|
|
|
161
162
|
throw new Error(`No resource found with id: ${id}`);
|
|
162
163
|
}
|
|
163
164
|
const file = matchedFiles[0];
|
|
164
|
-
const sourceDirectory = (0, import_path.dirname)(file);
|
|
165
|
+
const sourceDirectory = (0, import_path.dirname)(file).replace(/\/versioned?\/[^/]+\//, "/");
|
|
165
166
|
const { data: { version = "0.0.1" } = {} } = import_gray_matter2.default.read(file);
|
|
166
167
|
const targetDirectory = getVersionedDirectory(sourceDirectory, version);
|
|
167
168
|
import_node_fs2.default.mkdirSync(targetDirectory, { recursive: true });
|
|
169
|
+
const ignoreListToCopy = ["events", "commands", "queries", "versioned"];
|
|
168
170
|
await copyDir(catalogDir, sourceDirectory, targetDirectory, (src) => {
|
|
169
|
-
|
|
171
|
+
const folderName = (0, import_node_path2.basename)(src);
|
|
172
|
+
if (ignoreListToCopy.includes(folderName)) {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
170
176
|
});
|
|
171
177
|
await import_promises.default.readdir(sourceDirectory).then(async (resourceFiles) => {
|
|
172
178
|
await Promise.all(
|
|
173
179
|
resourceFiles.map(async (file2) => {
|
|
180
|
+
if (ignoreListToCopy.includes(file2)) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
174
183
|
if (file2 !== "versioned") {
|
|
175
184
|
import_node_fs2.default.rmSync((0, import_path.join)(sourceDirectory, file2), { recursive: true });
|
|
176
185
|
}
|
|
@@ -366,11 +375,11 @@ var writeEventToService = (directory) => async (event, service, options = { path
|
|
|
366
375
|
throw new Error("Service not found");
|
|
367
376
|
}
|
|
368
377
|
let pathForEvent = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/events` : `${resourcePath.directory}/events`;
|
|
369
|
-
pathForEvent = (0,
|
|
378
|
+
pathForEvent = (0, import_node_path3.join)(pathForEvent, event.id);
|
|
370
379
|
await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
|
|
371
380
|
};
|
|
372
381
|
var rmEvent = (directory) => async (path5) => {
|
|
373
|
-
await import_promises2.default.rm((0,
|
|
382
|
+
await import_promises2.default.rm((0, import_node_path3.join)(directory, path5), { recursive: true });
|
|
374
383
|
};
|
|
375
384
|
var rmEventById = (directory) => async (id, version, persistFiles) => {
|
|
376
385
|
await rmResourceById(directory, id, version, { type: "event", persistFiles });
|
|
@@ -387,7 +396,7 @@ var eventHasVersion = (directory) => async (id, version) => {
|
|
|
387
396
|
|
|
388
397
|
// src/commands.ts
|
|
389
398
|
var import_promises3 = __toESM(require("fs/promises"));
|
|
390
|
-
var
|
|
399
|
+
var import_node_path4 = require("path");
|
|
391
400
|
var getCommand = (directory) => async (id, version, options) => getResource(directory, id, version, { type: "command", ...options });
|
|
392
401
|
var getCommands = (directory) => async (options) => getResources(directory, { type: "commands", ...options });
|
|
393
402
|
var writeCommand = (directory) => async (command, options = {
|
|
@@ -402,11 +411,11 @@ var writeCommandToService = (directory) => async (command, service, options = {
|
|
|
402
411
|
throw new Error("Service not found");
|
|
403
412
|
}
|
|
404
413
|
let pathForCommand = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/commands` : `${resourcePath.directory}/commands`;
|
|
405
|
-
pathForCommand = (0,
|
|
414
|
+
pathForCommand = (0, import_node_path4.join)(pathForCommand, command.id);
|
|
406
415
|
await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
|
|
407
416
|
};
|
|
408
417
|
var rmCommand = (directory) => async (path5) => {
|
|
409
|
-
await import_promises3.default.rm((0,
|
|
418
|
+
await import_promises3.default.rm((0, import_node_path4.join)(directory, path5), { recursive: true });
|
|
410
419
|
};
|
|
411
420
|
var rmCommandById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "command", persistFiles });
|
|
412
421
|
var versionCommand = (directory) => async (id) => versionResource(directory, id);
|
|
@@ -421,7 +430,7 @@ var commandHasVersion = (directory) => async (id, version) => {
|
|
|
421
430
|
|
|
422
431
|
// src/queries.ts
|
|
423
432
|
var import_promises4 = __toESM(require("fs/promises"));
|
|
424
|
-
var
|
|
433
|
+
var import_node_path5 = require("path");
|
|
425
434
|
var getQuery = (directory) => async (id, version, options) => getResource(directory, id, version, { type: "query", ...options });
|
|
426
435
|
var writeQuery = (directory) => async (query, options = {
|
|
427
436
|
path: "",
|
|
@@ -436,11 +445,11 @@ var writeQueryToService = (directory) => async (query, service, options = { path
|
|
|
436
445
|
throw new Error("Service not found");
|
|
437
446
|
}
|
|
438
447
|
let pathForQuery = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/queries` : `${resourcePath.directory}/queries`;
|
|
439
|
-
pathForQuery = (0,
|
|
448
|
+
pathForQuery = (0, import_node_path5.join)(pathForQuery, query.id);
|
|
440
449
|
await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
|
|
441
450
|
};
|
|
442
451
|
var rmQuery = (directory) => async (path5) => {
|
|
443
|
-
await import_promises4.default.rm((0,
|
|
452
|
+
await import_promises4.default.rm((0, import_node_path5.join)(directory, path5), { recursive: true });
|
|
444
453
|
};
|
|
445
454
|
var rmQueryById = (directory) => async (id, version, persistFiles) => {
|
|
446
455
|
await rmResourceById(directory, id, version, { type: "query", persistFiles });
|
|
@@ -457,7 +466,7 @@ var queryHasVersion = (directory) => async (id, version) => {
|
|
|
457
466
|
|
|
458
467
|
// src/services.ts
|
|
459
468
|
var import_promises5 = __toESM(require("fs/promises"));
|
|
460
|
-
var
|
|
469
|
+
var import_node_path6 = require("path");
|
|
461
470
|
var getService = (directory) => async (id, version) => getResource(directory, id, version, { type: "service" });
|
|
462
471
|
var getServiceByPath = (directory) => async (path5) => {
|
|
463
472
|
const service = await getResource(directory, void 0, void 0, { type: "service" }, path5);
|
|
@@ -489,12 +498,12 @@ var writeVersionedService = (directory) => async (service) => {
|
|
|
489
498
|
};
|
|
490
499
|
var writeServiceToDomain = (directory) => async (service, domain, options = { path: "", format: "mdx", override: false }) => {
|
|
491
500
|
let pathForService = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/services` : `/${domain.id}/services`;
|
|
492
|
-
pathForService = (0,
|
|
501
|
+
pathForService = (0, import_node_path6.join)(pathForService, service.id);
|
|
493
502
|
await writeResource(directory, { ...service }, { ...options, path: pathForService, type: "service" });
|
|
494
503
|
};
|
|
495
504
|
var versionService = (directory) => async (id) => versionResource(directory, id);
|
|
496
505
|
var rmService = (directory) => async (path5) => {
|
|
497
|
-
await import_promises5.default.rm((0,
|
|
506
|
+
await import_promises5.default.rm((0, import_node_path6.join)(directory, path5), { recursive: true });
|
|
498
507
|
};
|
|
499
508
|
var rmServiceById = (directory) => async (id, version, persistFiles) => {
|
|
500
509
|
await rmResourceById(directory, id, version, { type: "service", persistFiles });
|
|
@@ -521,7 +530,7 @@ var getSpecificationFilesForService = (directory) => async (id, version) => {
|
|
|
521
530
|
throw new Error(`Specification file name for ${fileName} is undefined`);
|
|
522
531
|
}
|
|
523
532
|
const rawFile = await getFileFromResource(directory, id, { fileName }, version);
|
|
524
|
-
return { key, content: rawFile, fileName, path: (0,
|
|
533
|
+
return { key, content: rawFile, fileName, path: (0, import_node_path6.join)((0, import_node_path6.dirname)(filePathToService), fileName) };
|
|
525
534
|
});
|
|
526
535
|
specs = await Promise.all(getSpecs);
|
|
527
536
|
}
|
|
@@ -530,7 +539,7 @@ var getSpecificationFilesForService = (directory) => async (id, version) => {
|
|
|
530
539
|
var addMessageToService = (directory) => async (id, direction, event, version) => {
|
|
531
540
|
let service = await getService(directory)(id, version);
|
|
532
541
|
const servicePath = await getResourcePath(directory, id, version);
|
|
533
|
-
const extension = (0,
|
|
542
|
+
const extension = (0, import_node_path6.extname)(servicePath?.fullPath || "");
|
|
534
543
|
if (direction === "sends") {
|
|
535
544
|
if (service.sends === void 0) {
|
|
536
545
|
service.sends = [];
|
|
@@ -559,7 +568,7 @@ var addMessageToService = (directory) => async (id, direction, event, version) =
|
|
|
559
568
|
throw new Error(`Cannot find service ${id} in the catalog`);
|
|
560
569
|
}
|
|
561
570
|
const path5 = existingResource.split(/[\\/]+services/)[0];
|
|
562
|
-
const pathToResource = (0,
|
|
571
|
+
const pathToResource = (0, import_node_path6.join)(path5, "services");
|
|
563
572
|
await rmServiceById(directory)(id, version);
|
|
564
573
|
await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
|
|
565
574
|
};
|
|
@@ -569,7 +578,7 @@ var serviceHasVersion = (directory) => async (id, version) => {
|
|
|
569
578
|
};
|
|
570
579
|
var isService = (directory) => async (path5) => {
|
|
571
580
|
const service = await getServiceByPath(directory)(path5);
|
|
572
|
-
const relativePath = (0,
|
|
581
|
+
const relativePath = (0, import_node_path6.relative)(directory, path5);
|
|
573
582
|
const segments = relativePath.split(/[/\\]+/);
|
|
574
583
|
return !!service && segments.includes("services");
|
|
575
584
|
};
|
|
@@ -577,7 +586,7 @@ var toService = (directory) => async (file) => toResource(directory, file);
|
|
|
577
586
|
var addEntityToService = (directory) => async (id, entity, version) => {
|
|
578
587
|
let service = await getService(directory)(id, version);
|
|
579
588
|
const servicePath = await getResourcePath(directory, id, version);
|
|
580
|
-
const extension = (0,
|
|
589
|
+
const extension = (0, import_node_path6.extname)(servicePath?.fullPath || "");
|
|
581
590
|
if (service.entities === void 0) {
|
|
582
591
|
service.entities = [];
|
|
583
592
|
}
|
|
@@ -592,14 +601,14 @@ var addEntityToService = (directory) => async (id, entity, version) => {
|
|
|
592
601
|
throw new Error(`Cannot find service ${id} in the catalog`);
|
|
593
602
|
}
|
|
594
603
|
const path5 = existingResource.split(/[\\/]+services/)[0];
|
|
595
|
-
const pathToResource = (0,
|
|
604
|
+
const pathToResource = (0, import_node_path6.join)(path5, "services");
|
|
596
605
|
await rmServiceById(directory)(id, version);
|
|
597
606
|
await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
|
|
598
607
|
};
|
|
599
608
|
|
|
600
609
|
// src/domains.ts
|
|
601
610
|
var import_promises6 = __toESM(require("fs/promises"));
|
|
602
|
-
var
|
|
611
|
+
var import_node_path7 = __toESM(require("path"));
|
|
603
612
|
var import_node_fs3 = __toESM(require("fs"));
|
|
604
613
|
var import_gray_matter3 = __toESM(require("gray-matter"));
|
|
605
614
|
var getDomain = (directory) => async (id, version) => getResource(directory, id, version, { type: "domain" });
|
|
@@ -625,7 +634,7 @@ var writeDomain = (directory) => async (domain, options = {
|
|
|
625
634
|
};
|
|
626
635
|
var versionDomain = (directory) => async (id) => versionResource(directory, id);
|
|
627
636
|
var rmDomain = (directory) => async (path5) => {
|
|
628
|
-
await import_promises6.default.rm((0,
|
|
637
|
+
await import_promises6.default.rm((0, import_node_path7.join)(directory, path5), { recursive: true });
|
|
629
638
|
};
|
|
630
639
|
var rmDomainById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "domain", persistFiles });
|
|
631
640
|
var addFileToDomain = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
|
|
@@ -637,7 +646,7 @@ var addUbiquitousLanguageToDomain = (directory) => async (id, ubiquitousLanguage
|
|
|
637
646
|
};
|
|
638
647
|
var getUbiquitousLanguageFromDomain = (directory) => async (id, version) => {
|
|
639
648
|
const pathToDomain = await findFileById(directory, id, version) || "";
|
|
640
|
-
const pathToUbiquitousLanguage =
|
|
649
|
+
const pathToUbiquitousLanguage = import_node_path7.default.join(import_node_path7.default.dirname(pathToDomain), "ubiquitous-language.mdx");
|
|
641
650
|
const fileExists = import_node_fs3.default.existsSync(pathToUbiquitousLanguage);
|
|
642
651
|
if (!fileExists) {
|
|
643
652
|
return void 0;
|
|
@@ -652,7 +661,7 @@ var domainHasVersion = (directory) => async (id, version) => {
|
|
|
652
661
|
var addServiceToDomain = (directory) => async (id, service, version) => {
|
|
653
662
|
let domain = await getDomain(directory)(id, version);
|
|
654
663
|
const domainPath = await getResourcePath(directory, id, version);
|
|
655
|
-
const extension =
|
|
664
|
+
const extension = import_node_path7.default.extname(domainPath?.fullPath || "");
|
|
656
665
|
if (domain.services === void 0) {
|
|
657
666
|
domain.services = [];
|
|
658
667
|
}
|
|
@@ -667,7 +676,7 @@ var addServiceToDomain = (directory) => async (id, service, version) => {
|
|
|
667
676
|
var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
|
|
668
677
|
let domain = await getDomain(directory)(id, version);
|
|
669
678
|
const domainPath = await getResourcePath(directory, id, version);
|
|
670
|
-
const extension =
|
|
679
|
+
const extension = import_node_path7.default.extname(domainPath?.fullPath || "");
|
|
671
680
|
if (domain.domains === void 0) {
|
|
672
681
|
domain.domains = [];
|
|
673
682
|
}
|
|
@@ -682,7 +691,7 @@ var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
|
|
|
682
691
|
var addEntityToDomain = (directory) => async (id, entity, version) => {
|
|
683
692
|
let domain = await getDomain(directory)(id, version);
|
|
684
693
|
const domainPath = await getResourcePath(directory, id, version);
|
|
685
|
-
const extension =
|
|
694
|
+
const extension = import_node_path7.default.extname(domainPath?.fullPath || "");
|
|
686
695
|
if (domain.entities === void 0) {
|
|
687
696
|
domain.entities = [];
|
|
688
697
|
}
|
|
@@ -697,12 +706,12 @@ var addEntityToDomain = (directory) => async (id, entity, version) => {
|
|
|
697
706
|
|
|
698
707
|
// src/channels.ts
|
|
699
708
|
var import_promises7 = __toESM(require("fs/promises"));
|
|
700
|
-
var
|
|
709
|
+
var import_node_path8 = require("path");
|
|
701
710
|
var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
|
|
702
711
|
var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
|
|
703
712
|
var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
|
|
704
713
|
var rmChannel = (directory) => async (path5) => {
|
|
705
|
-
await import_promises7.default.rm((0,
|
|
714
|
+
await import_promises7.default.rm((0, import_node_path8.join)(directory, path5), { recursive: true });
|
|
706
715
|
};
|
|
707
716
|
var rmChannelById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "channel", persistFiles });
|
|
708
717
|
var versionChannel = (directory) => async (id) => versionResource(directory, id);
|
|
@@ -732,7 +741,7 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
732
741
|
const { getMessage, rmMessageById, writeMessage } = functions[collection];
|
|
733
742
|
const message = await getMessage(directory)(_message.id, _message.version);
|
|
734
743
|
const messagePath = await getResourcePath(directory, _message.id, _message.version);
|
|
735
|
-
const extension = (0,
|
|
744
|
+
const extension = (0, import_node_path8.extname)(messagePath?.fullPath || "");
|
|
736
745
|
if (!message) throw new Error(`Message ${_message.id} with version ${_message.version} not found`);
|
|
737
746
|
if (message.channels === void 0) {
|
|
738
747
|
message.channels = [];
|
|
@@ -744,17 +753,17 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
744
753
|
throw new Error(`Cannot find message ${id} in the catalog`);
|
|
745
754
|
}
|
|
746
755
|
const path5 = existingResource.split(`/[\\/]+${collection}`)[0];
|
|
747
|
-
const pathToResource = (0,
|
|
756
|
+
const pathToResource = (0, import_node_path8.join)(path5, collection);
|
|
748
757
|
await rmMessageById(directory)(_message.id, _message.version, true);
|
|
749
758
|
await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
|
|
750
759
|
};
|
|
751
760
|
|
|
752
761
|
// src/messages.ts
|
|
753
|
-
var
|
|
762
|
+
var import_node_path9 = require("path");
|
|
754
763
|
var import_gray_matter4 = __toESM(require("gray-matter"));
|
|
755
764
|
var import_semver3 = require("semver");
|
|
756
765
|
var getMessageBySchemaPath = (directory) => async (path5, options) => {
|
|
757
|
-
const pathToMessage = (0,
|
|
766
|
+
const pathToMessage = (0, import_node_path9.dirname)(path5);
|
|
758
767
|
try {
|
|
759
768
|
const files = await getFiles(`${directory}/${pathToMessage}/index.{md,mdx}`);
|
|
760
769
|
if (!files || files.length === 0) {
|
|
@@ -846,13 +855,13 @@ var getProducersOfSchema = (directory) => async (path5) => {
|
|
|
846
855
|
};
|
|
847
856
|
|
|
848
857
|
// src/custom-docs.ts
|
|
849
|
-
var
|
|
858
|
+
var import_node_path10 = __toESM(require("path"));
|
|
850
859
|
var import_node_fs4 = __toESM(require("fs"));
|
|
851
860
|
var import_promises8 = __toESM(require("fs/promises"));
|
|
852
861
|
var import_gray_matter5 = __toESM(require("gray-matter"));
|
|
853
862
|
var import_slugify = __toESM(require("slugify"));
|
|
854
863
|
var getCustomDoc = (directory) => async (filePath) => {
|
|
855
|
-
const fullPath =
|
|
864
|
+
const fullPath = import_node_path10.default.join(directory, filePath);
|
|
856
865
|
const fullPathWithExtension = fullPath.endsWith(".mdx") ? fullPath : `${fullPath}.mdx`;
|
|
857
866
|
const fileExists = import_node_fs4.default.existsSync(fullPathWithExtension);
|
|
858
867
|
if (!fileExists) {
|
|
@@ -871,26 +880,26 @@ var writeCustomDoc = (directory) => async (customDoc, options = { path: "" }) =>
|
|
|
871
880
|
const { fileName, ...rest } = customDoc;
|
|
872
881
|
const name = fileName || (0, import_slugify.default)(customDoc.title, { lower: true });
|
|
873
882
|
const withExtension = name.endsWith(".mdx") ? name : `${name}.mdx`;
|
|
874
|
-
const fullPath =
|
|
875
|
-
import_node_fs4.default.mkdirSync(
|
|
883
|
+
const fullPath = import_node_path10.default.join(directory, options.path || "", withExtension);
|
|
884
|
+
import_node_fs4.default.mkdirSync(import_node_path10.default.dirname(fullPath), { recursive: true });
|
|
876
885
|
const document = import_gray_matter5.default.stringify(customDoc.markdown.trim(), rest);
|
|
877
886
|
import_node_fs4.default.writeFileSync(fullPath, document);
|
|
878
887
|
};
|
|
879
888
|
var rmCustomDoc = (directory) => async (filePath) => {
|
|
880
889
|
const withExtension = filePath.endsWith(".mdx") ? filePath : `${filePath}.mdx`;
|
|
881
|
-
await import_promises8.default.rm((0,
|
|
890
|
+
await import_promises8.default.rm((0, import_node_path10.join)(directory, withExtension), { recursive: true });
|
|
882
891
|
};
|
|
883
892
|
|
|
884
893
|
// src/teams.ts
|
|
885
894
|
var import_promises9 = __toESM(require("fs/promises"));
|
|
886
895
|
var import_node_fs6 = __toESM(require("fs"));
|
|
887
|
-
var
|
|
896
|
+
var import_node_path12 = require("path");
|
|
888
897
|
var import_gray_matter7 = __toESM(require("gray-matter"));
|
|
889
|
-
var
|
|
898
|
+
var import_node_path13 = __toESM(require("path"));
|
|
890
899
|
|
|
891
900
|
// src/users.ts
|
|
892
901
|
var import_node_fs5 = __toESM(require("fs"));
|
|
893
|
-
var
|
|
902
|
+
var import_node_path11 = require("path");
|
|
894
903
|
var import_gray_matter6 = __toESM(require("gray-matter"));
|
|
895
904
|
var getUser = (catalogDir) => async (id) => {
|
|
896
905
|
const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);
|
|
@@ -928,11 +937,11 @@ var writeUser = (catalogDir) => async (user, options = {}) => {
|
|
|
928
937
|
}
|
|
929
938
|
const { markdown, ...frontmatter } = resource;
|
|
930
939
|
const document = import_gray_matter6.default.stringify(markdown, frontmatter);
|
|
931
|
-
import_node_fs5.default.mkdirSync((0,
|
|
932
|
-
import_node_fs5.default.writeFileSync((0,
|
|
940
|
+
import_node_fs5.default.mkdirSync((0, import_node_path11.join)(catalogDir, ""), { recursive: true });
|
|
941
|
+
import_node_fs5.default.writeFileSync((0, import_node_path11.join)(catalogDir, "", `${resource.id}.mdx`), document);
|
|
933
942
|
};
|
|
934
943
|
var rmUserById = (catalogDir) => async (id) => {
|
|
935
|
-
import_node_fs5.default.rmSync((0,
|
|
944
|
+
import_node_fs5.default.rmSync((0, import_node_path11.join)(catalogDir, `${id}.mdx`), { recursive: true });
|
|
936
945
|
};
|
|
937
946
|
|
|
938
947
|
// src/teams.ts
|
|
@@ -970,11 +979,11 @@ var writeTeam = (catalogDir) => async (team, options = {}) => {
|
|
|
970
979
|
}
|
|
971
980
|
const { markdown, ...frontmatter } = resource;
|
|
972
981
|
const document = import_gray_matter7.default.stringify(markdown, frontmatter);
|
|
973
|
-
import_node_fs6.default.mkdirSync((0,
|
|
974
|
-
import_node_fs6.default.writeFileSync((0,
|
|
982
|
+
import_node_fs6.default.mkdirSync((0, import_node_path12.join)(catalogDir, ""), { recursive: true });
|
|
983
|
+
import_node_fs6.default.writeFileSync((0, import_node_path12.join)(catalogDir, "", `${resource.id}.mdx`), document);
|
|
975
984
|
};
|
|
976
985
|
var rmTeamById = (catalogDir) => async (id) => {
|
|
977
|
-
await import_promises9.default.rm((0,
|
|
986
|
+
await import_promises9.default.rm((0, import_node_path12.join)(catalogDir, `${id}.mdx`), { recursive: true });
|
|
978
987
|
};
|
|
979
988
|
var getOwnersForResource = (catalogDir) => async (id, version) => {
|
|
980
989
|
const resource = await getResource(catalogDir, id, version);
|
|
@@ -982,11 +991,11 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
|
|
|
982
991
|
if (!resource) return [];
|
|
983
992
|
if (!resource.owners) return [];
|
|
984
993
|
for (const owner of resource.owners) {
|
|
985
|
-
const team = await getTeam(
|
|
994
|
+
const team = await getTeam(import_node_path13.default.join(catalogDir, "teams"))(owner);
|
|
986
995
|
if (team) {
|
|
987
996
|
owners.push(team);
|
|
988
997
|
} else {
|
|
989
|
-
const user = await getUser(
|
|
998
|
+
const user = await getUser(import_node_path13.default.join(catalogDir, "users"))(owner);
|
|
990
999
|
if (user) {
|
|
991
1000
|
owners.push(user);
|
|
992
1001
|
}
|
|
@@ -997,11 +1006,11 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
|
|
|
997
1006
|
|
|
998
1007
|
// src/eventcatalog.ts
|
|
999
1008
|
var import_fs = __toESM(require("fs"));
|
|
1000
|
-
var
|
|
1009
|
+
var import_node_path14 = __toESM(require("path"));
|
|
1001
1010
|
var DUMP_VERSION = "0.0.1";
|
|
1002
1011
|
var getEventCatalogVersion = async (catalogDir) => {
|
|
1003
1012
|
try {
|
|
1004
|
-
const packageJson = import_fs.default.readFileSync((0,
|
|
1013
|
+
const packageJson = import_fs.default.readFileSync((0, import_node_path14.join)(catalogDir, "package.json"), "utf8");
|
|
1005
1014
|
const packageJsonObject = JSON.parse(packageJson);
|
|
1006
1015
|
return packageJsonObject["dependencies"]["@eventcatalog/core"];
|
|
1007
1016
|
} catch (error) {
|
|
@@ -1014,7 +1023,7 @@ var hydrateResource = async (catalogDir, resources = [], { attachSchema = false
|
|
|
1014
1023
|
const resourcePath = await getResourcePath(catalogDir, resource.id, resource.version);
|
|
1015
1024
|
let schema = "";
|
|
1016
1025
|
if (resource.schemaPath && resourcePath?.fullPath) {
|
|
1017
|
-
const pathToSchema =
|
|
1026
|
+
const pathToSchema = import_node_path14.default.join(import_node_path14.default.dirname(resourcePath?.fullPath), resource.schemaPath);
|
|
1018
1027
|
if (import_fs.default.existsSync(pathToSchema)) {
|
|
1019
1028
|
schema = import_fs.default.readFileSync(pathToSchema, "utf8");
|
|
1020
1029
|
}
|
|
@@ -1035,7 +1044,7 @@ var filterCollection = (collection, options) => {
|
|
|
1035
1044
|
};
|
|
1036
1045
|
var getEventCatalogConfigurationFile = (directory) => async () => {
|
|
1037
1046
|
try {
|
|
1038
|
-
const path5 = (0,
|
|
1047
|
+
const path5 = (0, import_node_path14.join)(directory, "eventcatalog.config.js");
|
|
1039
1048
|
const configModule = await import(path5);
|
|
1040
1049
|
return configModule.default;
|
|
1041
1050
|
} catch (error) {
|
|
@@ -1094,7 +1103,7 @@ var dumpCatalog = (directory) => async (options) => {
|
|
|
1094
1103
|
|
|
1095
1104
|
// src/entities.ts
|
|
1096
1105
|
var import_promises10 = __toESM(require("fs/promises"));
|
|
1097
|
-
var
|
|
1106
|
+
var import_node_path15 = require("path");
|
|
1098
1107
|
var getEntity = (directory) => async (id, version) => getResource(directory, id, version, { type: "entity" });
|
|
1099
1108
|
var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
|
|
1100
1109
|
var writeEntity = (directory) => async (entity, options = {
|
|
@@ -1103,7 +1112,7 @@ var writeEntity = (directory) => async (entity, options = {
|
|
|
1103
1112
|
format: "mdx"
|
|
1104
1113
|
}) => writeResource(directory, { ...entity }, { ...options, type: "entity" });
|
|
1105
1114
|
var rmEntity = (directory) => async (path5) => {
|
|
1106
|
-
await import_promises10.default.rm((0,
|
|
1115
|
+
await import_promises10.default.rm((0, import_node_path15.join)(directory, path5), { recursive: true });
|
|
1107
1116
|
};
|
|
1108
1117
|
var rmEntityById = (directory) => async (id, version, persistFiles) => {
|
|
1109
1118
|
await rmResourceById(directory, id, version, { type: "entity", persistFiles });
|
|
@@ -1114,6 +1123,38 @@ var entityHasVersion = (directory) => async (id, version) => {
|
|
|
1114
1123
|
return !!file;
|
|
1115
1124
|
};
|
|
1116
1125
|
|
|
1126
|
+
// src/containers.ts
|
|
1127
|
+
var import_promises11 = __toESM(require("fs/promises"));
|
|
1128
|
+
var import_node_path16 = require("path");
|
|
1129
|
+
var getContainer = (directory) => async (id, version) => getResource(directory, id, version, { type: "container" });
|
|
1130
|
+
var getContainers = (directory) => async (options) => getResources(directory, { type: "containers", latestOnly: options?.latestOnly });
|
|
1131
|
+
var writeContainer = (directory) => async (data, options = {
|
|
1132
|
+
path: "",
|
|
1133
|
+
override: false,
|
|
1134
|
+
format: "mdx"
|
|
1135
|
+
}) => writeResource(directory, { ...data }, { ...options, type: "container" });
|
|
1136
|
+
var versionContainer = (directory) => async (id) => versionResource(directory, id);
|
|
1137
|
+
var rmContainer = (directory) => async (path5) => {
|
|
1138
|
+
await import_promises11.default.rm((0, import_node_path16.join)(directory, path5), { recursive: true });
|
|
1139
|
+
};
|
|
1140
|
+
var rmContainerById = (directory) => async (id, version, persistFiles) => {
|
|
1141
|
+
await rmResourceById(directory, id, version, { type: "container", persistFiles });
|
|
1142
|
+
};
|
|
1143
|
+
var containerHasVersion = (directory) => async (id, version) => {
|
|
1144
|
+
const file = await findFileById(directory, id, version);
|
|
1145
|
+
return !!file;
|
|
1146
|
+
};
|
|
1147
|
+
var addFileToContainer = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
|
|
1148
|
+
var writeContainerToService = (directory) => async (container, service, options = { path: "", format: "mdx", override: false }) => {
|
|
1149
|
+
const resourcePath = await getResourcePath(directory, service.id, service.version);
|
|
1150
|
+
if (!resourcePath) {
|
|
1151
|
+
throw new Error("Service not found");
|
|
1152
|
+
}
|
|
1153
|
+
let pathForContainer = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/containers` : `${resourcePath.directory}/containers`;
|
|
1154
|
+
pathForContainer = (0, import_node_path16.join)(pathForContainer, container.id);
|
|
1155
|
+
await writeResource(directory, { ...container }, { ...options, path: pathForContainer, type: "container" });
|
|
1156
|
+
};
|
|
1157
|
+
|
|
1117
1158
|
// src/index.ts
|
|
1118
1159
|
var index_default = (path5) => {
|
|
1119
1160
|
return {
|
|
@@ -1123,13 +1164,13 @@ var index_default = (path5) => {
|
|
|
1123
1164
|
* @param version - Optional id of the version to get (supports semver)
|
|
1124
1165
|
* @returns Event|Undefined
|
|
1125
1166
|
*/
|
|
1126
|
-
getEvent: getEvent((0,
|
|
1167
|
+
getEvent: getEvent((0, import_node_path17.join)(path5)),
|
|
1127
1168
|
/**
|
|
1128
1169
|
* Returns all events from EventCatalog
|
|
1129
1170
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1130
1171
|
* @returns Event[]|Undefined
|
|
1131
1172
|
*/
|
|
1132
|
-
getEvents: getEvents((0,
|
|
1173
|
+
getEvents: getEvents((0, import_node_path17.join)(path5)),
|
|
1133
1174
|
/**
|
|
1134
1175
|
* Adds an event to EventCatalog
|
|
1135
1176
|
*
|
|
@@ -1137,7 +1178,7 @@ var index_default = (path5) => {
|
|
|
1137
1178
|
* @param options - Optional options to write the event
|
|
1138
1179
|
*
|
|
1139
1180
|
*/
|
|
1140
|
-
writeEvent: writeEvent((0,
|
|
1181
|
+
writeEvent: writeEvent((0, import_node_path17.join)(path5, "events")),
|
|
1141
1182
|
/**
|
|
1142
1183
|
* Adds an event to a service in EventCatalog
|
|
1143
1184
|
*
|
|
@@ -1146,26 +1187,26 @@ var index_default = (path5) => {
|
|
|
1146
1187
|
* @param options - Optional options to write the event
|
|
1147
1188
|
*
|
|
1148
1189
|
*/
|
|
1149
|
-
writeEventToService: writeEventToService((0,
|
|
1190
|
+
writeEventToService: writeEventToService((0, import_node_path17.join)(path5)),
|
|
1150
1191
|
/**
|
|
1151
1192
|
* Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1152
1193
|
*
|
|
1153
1194
|
* @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
|
|
1154
1195
|
*
|
|
1155
1196
|
*/
|
|
1156
|
-
rmEvent: rmEvent((0,
|
|
1197
|
+
rmEvent: rmEvent((0, import_node_path17.join)(path5, "events")),
|
|
1157
1198
|
/**
|
|
1158
1199
|
* Remove an event by an Event id
|
|
1159
1200
|
*
|
|
1160
1201
|
* @param id - The id of the event you want to remove
|
|
1161
1202
|
*
|
|
1162
1203
|
*/
|
|
1163
|
-
rmEventById: rmEventById((0,
|
|
1204
|
+
rmEventById: rmEventById((0, import_node_path17.join)(path5)),
|
|
1164
1205
|
/**
|
|
1165
1206
|
* Moves a given event id to the version directory
|
|
1166
1207
|
* @param directory
|
|
1167
1208
|
*/
|
|
1168
|
-
versionEvent: versionEvent((0,
|
|
1209
|
+
versionEvent: versionEvent((0, import_node_path17.join)(path5)),
|
|
1169
1210
|
/**
|
|
1170
1211
|
* Adds a file to the given event
|
|
1171
1212
|
* @param id - The id of the event to add the file to
|
|
@@ -1173,7 +1214,7 @@ var index_default = (path5) => {
|
|
|
1173
1214
|
* @param version - Optional version of the event to add the file to
|
|
1174
1215
|
* @returns
|
|
1175
1216
|
*/
|
|
1176
|
-
addFileToEvent: addFileToEvent((0,
|
|
1217
|
+
addFileToEvent: addFileToEvent((0, import_node_path17.join)(path5)),
|
|
1177
1218
|
/**
|
|
1178
1219
|
* Adds a schema to the given event
|
|
1179
1220
|
* @param id - The id of the event to add the schema to
|
|
@@ -1181,14 +1222,14 @@ var index_default = (path5) => {
|
|
|
1181
1222
|
* @param version - Optional version of the event to add the schema to
|
|
1182
1223
|
* @returns
|
|
1183
1224
|
*/
|
|
1184
|
-
addSchemaToEvent: addSchemaToEvent((0,
|
|
1225
|
+
addSchemaToEvent: addSchemaToEvent((0, import_node_path17.join)(path5)),
|
|
1185
1226
|
/**
|
|
1186
1227
|
* Check to see if an event version exists
|
|
1187
1228
|
* @param id - The id of the event
|
|
1188
1229
|
* @param version - The version of the event (supports semver)
|
|
1189
1230
|
* @returns
|
|
1190
1231
|
*/
|
|
1191
|
-
eventHasVersion: eventHasVersion((0,
|
|
1232
|
+
eventHasVersion: eventHasVersion((0, import_node_path17.join)(path5)),
|
|
1192
1233
|
/**
|
|
1193
1234
|
* ================================
|
|
1194
1235
|
* Commands
|
|
@@ -1200,13 +1241,13 @@ var index_default = (path5) => {
|
|
|
1200
1241
|
* @param version - Optional id of the version to get (supports semver)
|
|
1201
1242
|
* @returns Command|Undefined
|
|
1202
1243
|
*/
|
|
1203
|
-
getCommand: getCommand((0,
|
|
1244
|
+
getCommand: getCommand((0, import_node_path17.join)(path5)),
|
|
1204
1245
|
/**
|
|
1205
1246
|
* Returns all commands from EventCatalog
|
|
1206
1247
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1207
1248
|
* @returns Command[]|Undefined
|
|
1208
1249
|
*/
|
|
1209
|
-
getCommands: getCommands((0,
|
|
1250
|
+
getCommands: getCommands((0, import_node_path17.join)(path5)),
|
|
1210
1251
|
/**
|
|
1211
1252
|
* Adds an command to EventCatalog
|
|
1212
1253
|
*
|
|
@@ -1214,7 +1255,7 @@ var index_default = (path5) => {
|
|
|
1214
1255
|
* @param options - Optional options to write the command
|
|
1215
1256
|
*
|
|
1216
1257
|
*/
|
|
1217
|
-
writeCommand: writeCommand((0,
|
|
1258
|
+
writeCommand: writeCommand((0, import_node_path17.join)(path5, "commands")),
|
|
1218
1259
|
/**
|
|
1219
1260
|
* Adds a command to a service in EventCatalog
|
|
1220
1261
|
*
|
|
@@ -1223,26 +1264,26 @@ var index_default = (path5) => {
|
|
|
1223
1264
|
* @param options - Optional options to write the command
|
|
1224
1265
|
*
|
|
1225
1266
|
*/
|
|
1226
|
-
writeCommandToService: writeCommandToService((0,
|
|
1267
|
+
writeCommandToService: writeCommandToService((0, import_node_path17.join)(path5)),
|
|
1227
1268
|
/**
|
|
1228
1269
|
* Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1229
1270
|
*
|
|
1230
1271
|
* @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
|
|
1231
1272
|
*
|
|
1232
1273
|
*/
|
|
1233
|
-
rmCommand: rmCommand((0,
|
|
1274
|
+
rmCommand: rmCommand((0, import_node_path17.join)(path5, "commands")),
|
|
1234
1275
|
/**
|
|
1235
1276
|
* Remove an command by an Event id
|
|
1236
1277
|
*
|
|
1237
1278
|
* @param id - The id of the command you want to remove
|
|
1238
1279
|
*
|
|
1239
1280
|
*/
|
|
1240
|
-
rmCommandById: rmCommandById((0,
|
|
1281
|
+
rmCommandById: rmCommandById((0, import_node_path17.join)(path5)),
|
|
1241
1282
|
/**
|
|
1242
1283
|
* Moves a given command id to the version directory
|
|
1243
1284
|
* @param directory
|
|
1244
1285
|
*/
|
|
1245
|
-
versionCommand: versionCommand((0,
|
|
1286
|
+
versionCommand: versionCommand((0, import_node_path17.join)(path5)),
|
|
1246
1287
|
/**
|
|
1247
1288
|
* Adds a file to the given command
|
|
1248
1289
|
* @param id - The id of the command to add the file to
|
|
@@ -1250,7 +1291,7 @@ var index_default = (path5) => {
|
|
|
1250
1291
|
* @param version - Optional version of the command to add the file to
|
|
1251
1292
|
* @returns
|
|
1252
1293
|
*/
|
|
1253
|
-
addFileToCommand: addFileToCommand((0,
|
|
1294
|
+
addFileToCommand: addFileToCommand((0, import_node_path17.join)(path5)),
|
|
1254
1295
|
/**
|
|
1255
1296
|
* Adds a schema to the given command
|
|
1256
1297
|
* @param id - The id of the command to add the schema to
|
|
@@ -1258,14 +1299,14 @@ var index_default = (path5) => {
|
|
|
1258
1299
|
* @param version - Optional version of the command to add the schema to
|
|
1259
1300
|
* @returns
|
|
1260
1301
|
*/
|
|
1261
|
-
addSchemaToCommand: addSchemaToCommand((0,
|
|
1302
|
+
addSchemaToCommand: addSchemaToCommand((0, import_node_path17.join)(path5)),
|
|
1262
1303
|
/**
|
|
1263
1304
|
* Check to see if a command version exists
|
|
1264
1305
|
* @param id - The id of the command
|
|
1265
1306
|
* @param version - The version of the command (supports semver)
|
|
1266
1307
|
* @returns
|
|
1267
1308
|
*/
|
|
1268
|
-
commandHasVersion: commandHasVersion((0,
|
|
1309
|
+
commandHasVersion: commandHasVersion((0, import_node_path17.join)(path5)),
|
|
1269
1310
|
/**
|
|
1270
1311
|
* ================================
|
|
1271
1312
|
* Queries
|
|
@@ -1277,13 +1318,13 @@ var index_default = (path5) => {
|
|
|
1277
1318
|
* @param version - Optional id of the version to get (supports semver)
|
|
1278
1319
|
* @returns Query|Undefined
|
|
1279
1320
|
*/
|
|
1280
|
-
getQuery: getQuery((0,
|
|
1321
|
+
getQuery: getQuery((0, import_node_path17.join)(path5)),
|
|
1281
1322
|
/**
|
|
1282
1323
|
* Returns all queries from EventCatalog
|
|
1283
1324
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1284
1325
|
* @returns Query[]|Undefined
|
|
1285
1326
|
*/
|
|
1286
|
-
getQueries: getQueries((0,
|
|
1327
|
+
getQueries: getQueries((0, import_node_path17.join)(path5)),
|
|
1287
1328
|
/**
|
|
1288
1329
|
* Adds a query to EventCatalog
|
|
1289
1330
|
*
|
|
@@ -1291,7 +1332,7 @@ var index_default = (path5) => {
|
|
|
1291
1332
|
* @param options - Optional options to write the event
|
|
1292
1333
|
*
|
|
1293
1334
|
*/
|
|
1294
|
-
writeQuery: writeQuery((0,
|
|
1335
|
+
writeQuery: writeQuery((0, import_node_path17.join)(path5, "queries")),
|
|
1295
1336
|
/**
|
|
1296
1337
|
* Adds a query to a service in EventCatalog
|
|
1297
1338
|
*
|
|
@@ -1300,26 +1341,26 @@ var index_default = (path5) => {
|
|
|
1300
1341
|
* @param options - Optional options to write the query
|
|
1301
1342
|
*
|
|
1302
1343
|
*/
|
|
1303
|
-
writeQueryToService: writeQueryToService((0,
|
|
1344
|
+
writeQueryToService: writeQueryToService((0, import_node_path17.join)(path5)),
|
|
1304
1345
|
/**
|
|
1305
1346
|
* Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1306
1347
|
*
|
|
1307
1348
|
* @param path - The path to your query, e.g. `/Orders/GetOrder`
|
|
1308
1349
|
*
|
|
1309
1350
|
*/
|
|
1310
|
-
rmQuery: rmQuery((0,
|
|
1351
|
+
rmQuery: rmQuery((0, import_node_path17.join)(path5, "queries")),
|
|
1311
1352
|
/**
|
|
1312
1353
|
* Remove a query by a Query id
|
|
1313
1354
|
*
|
|
1314
1355
|
* @param id - The id of the query you want to remove
|
|
1315
1356
|
*
|
|
1316
1357
|
*/
|
|
1317
|
-
rmQueryById: rmQueryById((0,
|
|
1358
|
+
rmQueryById: rmQueryById((0, import_node_path17.join)(path5)),
|
|
1318
1359
|
/**
|
|
1319
1360
|
* Moves a given query id to the version directory
|
|
1320
1361
|
* @param directory
|
|
1321
1362
|
*/
|
|
1322
|
-
versionQuery: versionQuery((0,
|
|
1363
|
+
versionQuery: versionQuery((0, import_node_path17.join)(path5)),
|
|
1323
1364
|
/**
|
|
1324
1365
|
* Adds a file to the given query
|
|
1325
1366
|
* @param id - The id of the query to add the file to
|
|
@@ -1327,7 +1368,7 @@ var index_default = (path5) => {
|
|
|
1327
1368
|
* @param version - Optional version of the query to add the file to
|
|
1328
1369
|
* @returns
|
|
1329
1370
|
*/
|
|
1330
|
-
addFileToQuery: addFileToQuery((0,
|
|
1371
|
+
addFileToQuery: addFileToQuery((0, import_node_path17.join)(path5)),
|
|
1331
1372
|
/**
|
|
1332
1373
|
* Adds a schema to the given query
|
|
1333
1374
|
* @param id - The id of the query to add the schema to
|
|
@@ -1335,14 +1376,14 @@ var index_default = (path5) => {
|
|
|
1335
1376
|
* @param version - Optional version of the query to add the schema to
|
|
1336
1377
|
* @returns
|
|
1337
1378
|
*/
|
|
1338
|
-
addSchemaToQuery: addSchemaToQuery((0,
|
|
1379
|
+
addSchemaToQuery: addSchemaToQuery((0, import_node_path17.join)(path5)),
|
|
1339
1380
|
/**
|
|
1340
1381
|
* Check to see if an query version exists
|
|
1341
1382
|
* @param id - The id of the query
|
|
1342
1383
|
* @param version - The version of the query (supports semver)
|
|
1343
1384
|
* @returns
|
|
1344
1385
|
*/
|
|
1345
|
-
queryHasVersion: queryHasVersion((0,
|
|
1386
|
+
queryHasVersion: queryHasVersion((0, import_node_path17.join)(path5)),
|
|
1346
1387
|
/**
|
|
1347
1388
|
* ================================
|
|
1348
1389
|
* Channels
|
|
@@ -1354,13 +1395,13 @@ var index_default = (path5) => {
|
|
|
1354
1395
|
* @param version - Optional id of the version to get (supports semver)
|
|
1355
1396
|
* @returns Channel|Undefined
|
|
1356
1397
|
*/
|
|
1357
|
-
getChannel: getChannel((0,
|
|
1398
|
+
getChannel: getChannel((0, import_node_path17.join)(path5)),
|
|
1358
1399
|
/**
|
|
1359
1400
|
* Returns all channels from EventCatalog
|
|
1360
1401
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1361
1402
|
* @returns Channel[]|Undefined
|
|
1362
1403
|
*/
|
|
1363
|
-
getChannels: getChannels((0,
|
|
1404
|
+
getChannels: getChannels((0, import_node_path17.join)(path5)),
|
|
1364
1405
|
/**
|
|
1365
1406
|
* Adds an channel to EventCatalog
|
|
1366
1407
|
*
|
|
@@ -1368,33 +1409,33 @@ var index_default = (path5) => {
|
|
|
1368
1409
|
* @param options - Optional options to write the channel
|
|
1369
1410
|
*
|
|
1370
1411
|
*/
|
|
1371
|
-
writeChannel: writeChannel((0,
|
|
1412
|
+
writeChannel: writeChannel((0, import_node_path17.join)(path5, "channels")),
|
|
1372
1413
|
/**
|
|
1373
1414
|
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1374
1415
|
*
|
|
1375
1416
|
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
1376
1417
|
*
|
|
1377
1418
|
*/
|
|
1378
|
-
rmChannel: rmChannel((0,
|
|
1419
|
+
rmChannel: rmChannel((0, import_node_path17.join)(path5, "channels")),
|
|
1379
1420
|
/**
|
|
1380
1421
|
* Remove an channel by an Event id
|
|
1381
1422
|
*
|
|
1382
1423
|
* @param id - The id of the channel you want to remove
|
|
1383
1424
|
*
|
|
1384
1425
|
*/
|
|
1385
|
-
rmChannelById: rmChannelById((0,
|
|
1426
|
+
rmChannelById: rmChannelById((0, import_node_path17.join)(path5)),
|
|
1386
1427
|
/**
|
|
1387
1428
|
* Moves a given channel id to the version directory
|
|
1388
1429
|
* @param directory
|
|
1389
1430
|
*/
|
|
1390
|
-
versionChannel: versionChannel((0,
|
|
1431
|
+
versionChannel: versionChannel((0, import_node_path17.join)(path5)),
|
|
1391
1432
|
/**
|
|
1392
1433
|
* Check to see if a channel version exists
|
|
1393
1434
|
* @param id - The id of the channel
|
|
1394
1435
|
* @param version - The version of the channel (supports semver)
|
|
1395
1436
|
* @returns
|
|
1396
1437
|
*/
|
|
1397
|
-
channelHasVersion: channelHasVersion((0,
|
|
1438
|
+
channelHasVersion: channelHasVersion((0, import_node_path17.join)(path5)),
|
|
1398
1439
|
/**
|
|
1399
1440
|
* Add a channel to an event
|
|
1400
1441
|
*
|
|
@@ -1411,7 +1452,7 @@ var index_default = (path5) => {
|
|
|
1411
1452
|
*
|
|
1412
1453
|
* ```
|
|
1413
1454
|
*/
|
|
1414
|
-
addEventToChannel: addMessageToChannel((0,
|
|
1455
|
+
addEventToChannel: addMessageToChannel((0, import_node_path17.join)(path5), "events"),
|
|
1415
1456
|
/**
|
|
1416
1457
|
* Add a channel to an command
|
|
1417
1458
|
*
|
|
@@ -1428,7 +1469,7 @@ var index_default = (path5) => {
|
|
|
1428
1469
|
*
|
|
1429
1470
|
* ```
|
|
1430
1471
|
*/
|
|
1431
|
-
addCommandToChannel: addMessageToChannel((0,
|
|
1472
|
+
addCommandToChannel: addMessageToChannel((0, import_node_path17.join)(path5), "commands"),
|
|
1432
1473
|
/**
|
|
1433
1474
|
* Add a channel to an query
|
|
1434
1475
|
*
|
|
@@ -1445,7 +1486,7 @@ var index_default = (path5) => {
|
|
|
1445
1486
|
*
|
|
1446
1487
|
* ```
|
|
1447
1488
|
*/
|
|
1448
|
-
addQueryToChannel: addMessageToChannel((0,
|
|
1489
|
+
addQueryToChannel: addMessageToChannel((0, import_node_path17.join)(path5), "queries"),
|
|
1449
1490
|
/**
|
|
1450
1491
|
* ================================
|
|
1451
1492
|
* SERVICES
|
|
@@ -1458,14 +1499,14 @@ var index_default = (path5) => {
|
|
|
1458
1499
|
* @param options - Optional options to write the event
|
|
1459
1500
|
*
|
|
1460
1501
|
*/
|
|
1461
|
-
writeService: writeService((0,
|
|
1502
|
+
writeService: writeService((0, import_node_path17.join)(path5, "services")),
|
|
1462
1503
|
/**
|
|
1463
1504
|
* Adds a versioned service to EventCatalog
|
|
1464
1505
|
*
|
|
1465
1506
|
* @param service - The service to write
|
|
1466
1507
|
*
|
|
1467
1508
|
*/
|
|
1468
|
-
writeVersionedService: writeVersionedService((0,
|
|
1509
|
+
writeVersionedService: writeVersionedService((0, import_node_path17.join)(path5, "services")),
|
|
1469
1510
|
/**
|
|
1470
1511
|
* Adds a service to a domain in EventCatalog
|
|
1471
1512
|
*
|
|
@@ -1474,45 +1515,45 @@ var index_default = (path5) => {
|
|
|
1474
1515
|
* @param options - Optional options to write the event
|
|
1475
1516
|
*
|
|
1476
1517
|
*/
|
|
1477
|
-
writeServiceToDomain: writeServiceToDomain((0,
|
|
1518
|
+
writeServiceToDomain: writeServiceToDomain((0, import_node_path17.join)(path5, "domains")),
|
|
1478
1519
|
/**
|
|
1479
1520
|
* Returns a service from EventCatalog
|
|
1480
1521
|
* @param id - The id of the service to retrieve
|
|
1481
1522
|
* @param version - Optional id of the version to get (supports semver)
|
|
1482
1523
|
* @returns Service|Undefined
|
|
1483
1524
|
*/
|
|
1484
|
-
getService: getService((0,
|
|
1525
|
+
getService: getService((0, import_node_path17.join)(path5)),
|
|
1485
1526
|
/**
|
|
1486
1527
|
* Returns a service from EventCatalog by it's path.
|
|
1487
1528
|
* @param path - The path to the service to retrieve
|
|
1488
1529
|
* @returns Service|Undefined
|
|
1489
1530
|
*/
|
|
1490
|
-
getServiceByPath: getServiceByPath((0,
|
|
1531
|
+
getServiceByPath: getServiceByPath((0, import_node_path17.join)(path5)),
|
|
1491
1532
|
/**
|
|
1492
1533
|
* Returns all services from EventCatalog
|
|
1493
1534
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1494
1535
|
* @returns Service[]|Undefined
|
|
1495
1536
|
*/
|
|
1496
|
-
getServices: getServices((0,
|
|
1537
|
+
getServices: getServices((0, import_node_path17.join)(path5)),
|
|
1497
1538
|
/**
|
|
1498
1539
|
* Moves a given service id to the version directory
|
|
1499
1540
|
* @param directory
|
|
1500
1541
|
*/
|
|
1501
|
-
versionService: versionService((0,
|
|
1542
|
+
versionService: versionService((0, import_node_path17.join)(path5)),
|
|
1502
1543
|
/**
|
|
1503
1544
|
* Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
|
|
1504
1545
|
*
|
|
1505
1546
|
* @param path - The path to your service, e.g. `/InventoryService`
|
|
1506
1547
|
*
|
|
1507
1548
|
*/
|
|
1508
|
-
rmService: rmService((0,
|
|
1549
|
+
rmService: rmService((0, import_node_path17.join)(path5, "services")),
|
|
1509
1550
|
/**
|
|
1510
1551
|
* Remove an service by an service id
|
|
1511
1552
|
*
|
|
1512
1553
|
* @param id - The id of the service you want to remove
|
|
1513
1554
|
*
|
|
1514
1555
|
*/
|
|
1515
|
-
rmServiceById: rmServiceById((0,
|
|
1556
|
+
rmServiceById: rmServiceById((0, import_node_path17.join)(path5)),
|
|
1516
1557
|
/**
|
|
1517
1558
|
* Adds a file to the given service
|
|
1518
1559
|
* @param id - The id of the service to add the file to
|
|
@@ -1520,21 +1561,21 @@ var index_default = (path5) => {
|
|
|
1520
1561
|
* @param version - Optional version of the service to add the file to
|
|
1521
1562
|
* @returns
|
|
1522
1563
|
*/
|
|
1523
|
-
addFileToService: addFileToService((0,
|
|
1564
|
+
addFileToService: addFileToService((0, import_node_path17.join)(path5)),
|
|
1524
1565
|
/**
|
|
1525
1566
|
* Returns the specifications for a given service
|
|
1526
1567
|
* @param id - The id of the service to retrieve the specifications for
|
|
1527
1568
|
* @param version - Optional version of the service
|
|
1528
1569
|
* @returns
|
|
1529
1570
|
*/
|
|
1530
|
-
getSpecificationFilesForService: getSpecificationFilesForService((0,
|
|
1571
|
+
getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path17.join)(path5)),
|
|
1531
1572
|
/**
|
|
1532
1573
|
* Check to see if a service version exists
|
|
1533
1574
|
* @param id - The id of the service
|
|
1534
1575
|
* @param version - The version of the service (supports semver)
|
|
1535
1576
|
* @returns
|
|
1536
1577
|
*/
|
|
1537
|
-
serviceHasVersion: serviceHasVersion((0,
|
|
1578
|
+
serviceHasVersion: serviceHasVersion((0, import_node_path17.join)(path5)),
|
|
1538
1579
|
/**
|
|
1539
1580
|
* Add an event to a service by it's id.
|
|
1540
1581
|
*
|
|
@@ -1554,7 +1595,7 @@ var index_default = (path5) => {
|
|
|
1554
1595
|
*
|
|
1555
1596
|
* ```
|
|
1556
1597
|
*/
|
|
1557
|
-
addEventToService: addMessageToService((0,
|
|
1598
|
+
addEventToService: addMessageToService((0, import_node_path17.join)(path5)),
|
|
1558
1599
|
/**
|
|
1559
1600
|
* Add a command to a service by it's id.
|
|
1560
1601
|
*
|
|
@@ -1574,7 +1615,7 @@ var index_default = (path5) => {
|
|
|
1574
1615
|
*
|
|
1575
1616
|
* ```
|
|
1576
1617
|
*/
|
|
1577
|
-
addCommandToService: addMessageToService((0,
|
|
1618
|
+
addCommandToService: addMessageToService((0, import_node_path17.join)(path5)),
|
|
1578
1619
|
/**
|
|
1579
1620
|
* Add a query to a service by it's id.
|
|
1580
1621
|
*
|
|
@@ -1594,7 +1635,7 @@ var index_default = (path5) => {
|
|
|
1594
1635
|
*
|
|
1595
1636
|
* ```
|
|
1596
1637
|
*/
|
|
1597
|
-
addQueryToService: addMessageToService((0,
|
|
1638
|
+
addQueryToService: addMessageToService((0, import_node_path17.join)(path5)),
|
|
1598
1639
|
/**
|
|
1599
1640
|
* Add an entity to a service by its id.
|
|
1600
1641
|
*
|
|
@@ -1612,7 +1653,7 @@ var index_default = (path5) => {
|
|
|
1612
1653
|
*
|
|
1613
1654
|
* ```
|
|
1614
1655
|
*/
|
|
1615
|
-
addEntityToService: addEntityToService((0,
|
|
1656
|
+
addEntityToService: addEntityToService((0, import_node_path17.join)(path5)),
|
|
1616
1657
|
/**
|
|
1617
1658
|
* Check to see if a service exists by it's path.
|
|
1618
1659
|
*
|
|
@@ -1629,13 +1670,13 @@ var index_default = (path5) => {
|
|
|
1629
1670
|
* @param path - The path to the service to check
|
|
1630
1671
|
* @returns boolean
|
|
1631
1672
|
*/
|
|
1632
|
-
isService: isService((0,
|
|
1673
|
+
isService: isService((0, import_node_path17.join)(path5)),
|
|
1633
1674
|
/**
|
|
1634
1675
|
* Converts a file to a service.
|
|
1635
1676
|
* @param file - The file to convert to a service.
|
|
1636
1677
|
* @returns The service.
|
|
1637
1678
|
*/
|
|
1638
|
-
toService: toService((0,
|
|
1679
|
+
toService: toService((0, import_node_path17.join)(path5)),
|
|
1639
1680
|
/**
|
|
1640
1681
|
* ================================
|
|
1641
1682
|
* Domains
|
|
@@ -1648,39 +1689,39 @@ var index_default = (path5) => {
|
|
|
1648
1689
|
* @param options - Optional options to write the event
|
|
1649
1690
|
*
|
|
1650
1691
|
*/
|
|
1651
|
-
writeDomain: writeDomain((0,
|
|
1692
|
+
writeDomain: writeDomain((0, import_node_path17.join)(path5, "domains")),
|
|
1652
1693
|
/**
|
|
1653
1694
|
* Returns a domain from EventCatalog
|
|
1654
1695
|
* @param id - The id of the domain to retrieve
|
|
1655
1696
|
* @param version - Optional id of the version to get (supports semver)
|
|
1656
1697
|
* @returns Domain|Undefined
|
|
1657
1698
|
*/
|
|
1658
|
-
getDomain: getDomain((0,
|
|
1699
|
+
getDomain: getDomain((0, import_node_path17.join)(path5, "domains")),
|
|
1659
1700
|
/**
|
|
1660
1701
|
* Returns all domains from EventCatalog
|
|
1661
1702
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1662
1703
|
* @returns Domain[]|Undefined
|
|
1663
1704
|
*/
|
|
1664
|
-
getDomains: getDomains((0,
|
|
1705
|
+
getDomains: getDomains((0, import_node_path17.join)(path5)),
|
|
1665
1706
|
/**
|
|
1666
1707
|
* Moves a given domain id to the version directory
|
|
1667
1708
|
* @param directory
|
|
1668
1709
|
*/
|
|
1669
|
-
versionDomain: versionDomain((0,
|
|
1710
|
+
versionDomain: versionDomain((0, import_node_path17.join)(path5, "domains")),
|
|
1670
1711
|
/**
|
|
1671
1712
|
* Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
|
|
1672
1713
|
*
|
|
1673
1714
|
* @param path - The path to your domain, e.g. `/Payment`
|
|
1674
1715
|
*
|
|
1675
1716
|
*/
|
|
1676
|
-
rmDomain: rmDomain((0,
|
|
1717
|
+
rmDomain: rmDomain((0, import_node_path17.join)(path5, "domains")),
|
|
1677
1718
|
/**
|
|
1678
1719
|
* Remove an service by an domain id
|
|
1679
1720
|
*
|
|
1680
1721
|
* @param id - The id of the domain you want to remove
|
|
1681
1722
|
*
|
|
1682
1723
|
*/
|
|
1683
|
-
rmDomainById: rmDomainById((0,
|
|
1724
|
+
rmDomainById: rmDomainById((0, import_node_path17.join)(path5, "domains")),
|
|
1684
1725
|
/**
|
|
1685
1726
|
* Adds a file to the given domain
|
|
1686
1727
|
* @param id - The id of the domain to add the file to
|
|
@@ -1688,28 +1729,28 @@ var index_default = (path5) => {
|
|
|
1688
1729
|
* @param version - Optional version of the domain to add the file to
|
|
1689
1730
|
* @returns
|
|
1690
1731
|
*/
|
|
1691
|
-
addFileToDomain: addFileToDomain((0,
|
|
1732
|
+
addFileToDomain: addFileToDomain((0, import_node_path17.join)(path5, "domains")),
|
|
1692
1733
|
/**
|
|
1693
1734
|
* Adds an ubiquitous language dictionary to a domain
|
|
1694
1735
|
* @param id - The id of the domain to add the ubiquitous language to
|
|
1695
1736
|
* @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
|
|
1696
1737
|
* @param version - Optional version of the domain to add the ubiquitous language to
|
|
1697
1738
|
*/
|
|
1698
|
-
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0,
|
|
1739
|
+
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path17.join)(path5, "domains")),
|
|
1699
1740
|
/**
|
|
1700
1741
|
* Get the ubiquitous language dictionary from a domain
|
|
1701
1742
|
* @param id - The id of the domain to get the ubiquitous language from
|
|
1702
1743
|
* @param version - Optional version of the domain to get the ubiquitous language from
|
|
1703
1744
|
* @returns
|
|
1704
1745
|
*/
|
|
1705
|
-
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0,
|
|
1746
|
+
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path17.join)(path5, "domains")),
|
|
1706
1747
|
/**
|
|
1707
1748
|
* Check to see if a domain version exists
|
|
1708
1749
|
* @param id - The id of the domain
|
|
1709
1750
|
* @param version - The version of the domain (supports semver)
|
|
1710
1751
|
* @returns
|
|
1711
1752
|
*/
|
|
1712
|
-
domainHasVersion: domainHasVersion((0,
|
|
1753
|
+
domainHasVersion: domainHasVersion((0, import_node_path17.join)(path5)),
|
|
1713
1754
|
/**
|
|
1714
1755
|
* Adds a given service to a domain
|
|
1715
1756
|
* @param id - The id of the domain
|
|
@@ -1717,7 +1758,7 @@ var index_default = (path5) => {
|
|
|
1717
1758
|
* @param version - (Optional) The version of the domain to add the service to
|
|
1718
1759
|
* @returns
|
|
1719
1760
|
*/
|
|
1720
|
-
addServiceToDomain: addServiceToDomain((0,
|
|
1761
|
+
addServiceToDomain: addServiceToDomain((0, import_node_path17.join)(path5, "domains")),
|
|
1721
1762
|
/**
|
|
1722
1763
|
* Adds a given subdomain to a domain
|
|
1723
1764
|
* @param id - The id of the domain
|
|
@@ -1725,7 +1766,7 @@ var index_default = (path5) => {
|
|
|
1725
1766
|
* @param version - (Optional) The version of the domain to add the subdomain to
|
|
1726
1767
|
* @returns
|
|
1727
1768
|
*/
|
|
1728
|
-
addSubDomainToDomain: addSubDomainToDomain((0,
|
|
1769
|
+
addSubDomainToDomain: addSubDomainToDomain((0, import_node_path17.join)(path5, "domains")),
|
|
1729
1770
|
/**
|
|
1730
1771
|
* Adds an entity to a domain
|
|
1731
1772
|
* @param id - The id of the domain
|
|
@@ -1733,7 +1774,7 @@ var index_default = (path5) => {
|
|
|
1733
1774
|
* @param version - (Optional) The version of the domain to add the entity to
|
|
1734
1775
|
* @returns
|
|
1735
1776
|
*/
|
|
1736
|
-
addEntityToDomain: addEntityToDomain((0,
|
|
1777
|
+
addEntityToDomain: addEntityToDomain((0, import_node_path17.join)(path5, "domains")),
|
|
1737
1778
|
/**
|
|
1738
1779
|
* ================================
|
|
1739
1780
|
* Teams
|
|
@@ -1746,25 +1787,25 @@ var index_default = (path5) => {
|
|
|
1746
1787
|
* @param options - Optional options to write the team
|
|
1747
1788
|
*
|
|
1748
1789
|
*/
|
|
1749
|
-
writeTeam: writeTeam((0,
|
|
1790
|
+
writeTeam: writeTeam((0, import_node_path17.join)(path5, "teams")),
|
|
1750
1791
|
/**
|
|
1751
1792
|
* Returns a team from EventCatalog
|
|
1752
1793
|
* @param id - The id of the team to retrieve
|
|
1753
1794
|
* @returns Team|Undefined
|
|
1754
1795
|
*/
|
|
1755
|
-
getTeam: getTeam((0,
|
|
1796
|
+
getTeam: getTeam((0, import_node_path17.join)(path5, "teams")),
|
|
1756
1797
|
/**
|
|
1757
1798
|
* Returns all teams from EventCatalog
|
|
1758
1799
|
* @returns Team[]|Undefined
|
|
1759
1800
|
*/
|
|
1760
|
-
getTeams: getTeams((0,
|
|
1801
|
+
getTeams: getTeams((0, import_node_path17.join)(path5, "teams")),
|
|
1761
1802
|
/**
|
|
1762
1803
|
* Remove a team by the team id
|
|
1763
1804
|
*
|
|
1764
1805
|
* @param id - The id of the team you want to remove
|
|
1765
1806
|
*
|
|
1766
1807
|
*/
|
|
1767
|
-
rmTeamById: rmTeamById((0,
|
|
1808
|
+
rmTeamById: rmTeamById((0, import_node_path17.join)(path5, "teams")),
|
|
1768
1809
|
/**
|
|
1769
1810
|
* ================================
|
|
1770
1811
|
* Users
|
|
@@ -1777,25 +1818,25 @@ var index_default = (path5) => {
|
|
|
1777
1818
|
* @param options - Optional options to write the user
|
|
1778
1819
|
*
|
|
1779
1820
|
*/
|
|
1780
|
-
writeUser: writeUser((0,
|
|
1821
|
+
writeUser: writeUser((0, import_node_path17.join)(path5, "users")),
|
|
1781
1822
|
/**
|
|
1782
1823
|
* Returns a user from EventCatalog
|
|
1783
1824
|
* @param id - The id of the user to retrieve
|
|
1784
1825
|
* @returns User|Undefined
|
|
1785
1826
|
*/
|
|
1786
|
-
getUser: getUser((0,
|
|
1827
|
+
getUser: getUser((0, import_node_path17.join)(path5, "users")),
|
|
1787
1828
|
/**
|
|
1788
1829
|
* Returns all user from EventCatalog
|
|
1789
1830
|
* @returns User[]|Undefined
|
|
1790
1831
|
*/
|
|
1791
|
-
getUsers: getUsers((0,
|
|
1832
|
+
getUsers: getUsers((0, import_node_path17.join)(path5)),
|
|
1792
1833
|
/**
|
|
1793
1834
|
* Remove a user by the user id
|
|
1794
1835
|
*
|
|
1795
1836
|
* @param id - The id of the user you want to remove
|
|
1796
1837
|
*
|
|
1797
1838
|
*/
|
|
1798
|
-
rmUserById: rmUserById((0,
|
|
1839
|
+
rmUserById: rmUserById((0, import_node_path17.join)(path5, "users")),
|
|
1799
1840
|
/**
|
|
1800
1841
|
* ================================
|
|
1801
1842
|
* Custom Docs
|
|
@@ -1806,32 +1847,32 @@ var index_default = (path5) => {
|
|
|
1806
1847
|
* @param path - The path to the custom doc to retrieve
|
|
1807
1848
|
* @returns CustomDoc|Undefined
|
|
1808
1849
|
*/
|
|
1809
|
-
getCustomDoc: getCustomDoc((0,
|
|
1850
|
+
getCustomDoc: getCustomDoc((0, import_node_path17.join)(path5, "docs")),
|
|
1810
1851
|
/**
|
|
1811
1852
|
* Returns all custom docs from EventCatalog
|
|
1812
1853
|
* @param options - Optional options to get custom docs from a specific path
|
|
1813
1854
|
* @returns CustomDoc[]|Undefined
|
|
1814
1855
|
*/
|
|
1815
|
-
getCustomDocs: getCustomDocs((0,
|
|
1856
|
+
getCustomDocs: getCustomDocs((0, import_node_path17.join)(path5, "docs")),
|
|
1816
1857
|
/**
|
|
1817
1858
|
* Writes a custom doc to EventCatalog
|
|
1818
1859
|
* @param customDoc - The custom doc to write
|
|
1819
1860
|
* @param options - Optional options to write the custom doc
|
|
1820
1861
|
*
|
|
1821
1862
|
*/
|
|
1822
|
-
writeCustomDoc: writeCustomDoc((0,
|
|
1863
|
+
writeCustomDoc: writeCustomDoc((0, import_node_path17.join)(path5, "docs")),
|
|
1823
1864
|
/**
|
|
1824
1865
|
* Removes a custom doc from EventCatalog
|
|
1825
1866
|
* @param path - The path to the custom doc to remove
|
|
1826
1867
|
*
|
|
1827
1868
|
*/
|
|
1828
|
-
rmCustomDoc: rmCustomDoc((0,
|
|
1869
|
+
rmCustomDoc: rmCustomDoc((0, import_node_path17.join)(path5, "docs")),
|
|
1829
1870
|
/**
|
|
1830
1871
|
* Dumps the catalog to a JSON file.
|
|
1831
1872
|
* @param directory - The directory to dump the catalog to
|
|
1832
1873
|
* @returns A JSON file with the catalog
|
|
1833
1874
|
*/
|
|
1834
|
-
dumpCatalog: dumpCatalog((0,
|
|
1875
|
+
dumpCatalog: dumpCatalog((0, import_node_path17.join)(path5)),
|
|
1835
1876
|
/**
|
|
1836
1877
|
* Returns the event catalog configuration file.
|
|
1837
1878
|
* The event catalog configuration file is the file that contains the configuration for the event catalog.
|
|
@@ -1839,7 +1880,7 @@ var index_default = (path5) => {
|
|
|
1839
1880
|
* @param directory - The directory of the catalog.
|
|
1840
1881
|
* @returns A JSON object with the configuration for the event catalog.
|
|
1841
1882
|
*/
|
|
1842
|
-
getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0,
|
|
1883
|
+
getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path17.join)(path5)),
|
|
1843
1884
|
/**
|
|
1844
1885
|
* ================================
|
|
1845
1886
|
* Resources Utils
|
|
@@ -1860,33 +1901,33 @@ var index_default = (path5) => {
|
|
|
1860
1901
|
* @param path - The path to the message to retrieve
|
|
1861
1902
|
* @returns Message|Undefined
|
|
1862
1903
|
*/
|
|
1863
|
-
getMessageBySchemaPath: getMessageBySchemaPath((0,
|
|
1904
|
+
getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path17.join)(path5)),
|
|
1864
1905
|
/**
|
|
1865
1906
|
* Returns the producers and consumers (services) for a given message
|
|
1866
1907
|
* @param id - The id of the message to get the producers and consumers for
|
|
1867
1908
|
* @param version - Optional version of the message
|
|
1868
1909
|
* @returns { producers: Service[], consumers: Service[] }
|
|
1869
1910
|
*/
|
|
1870
|
-
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0,
|
|
1911
|
+
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path17.join)(path5)),
|
|
1871
1912
|
/**
|
|
1872
1913
|
* Returns the consumers of a given schema path
|
|
1873
1914
|
* @param path - The path to the schema to get the consumers for
|
|
1874
1915
|
* @returns Service[]
|
|
1875
1916
|
*/
|
|
1876
|
-
getConsumersOfSchema: getConsumersOfSchema((0,
|
|
1917
|
+
getConsumersOfSchema: getConsumersOfSchema((0, import_node_path17.join)(path5)),
|
|
1877
1918
|
/**
|
|
1878
1919
|
* Returns the producers of a given schema path
|
|
1879
1920
|
* @param path - The path to the schema to get the producers for
|
|
1880
1921
|
* @returns Service[]
|
|
1881
1922
|
*/
|
|
1882
|
-
getProducersOfSchema: getProducersOfSchema((0,
|
|
1923
|
+
getProducersOfSchema: getProducersOfSchema((0, import_node_path17.join)(path5)),
|
|
1883
1924
|
/**
|
|
1884
1925
|
* Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
|
|
1885
1926
|
* @param id - The id of the resource to get the owners for
|
|
1886
1927
|
* @param version - Optional version of the resource
|
|
1887
1928
|
* @returns { owners: User[] }
|
|
1888
1929
|
*/
|
|
1889
|
-
getOwnersForResource: getOwnersForResource((0,
|
|
1930
|
+
getOwnersForResource: getOwnersForResource((0, import_node_path17.join)(path5)),
|
|
1890
1931
|
/**
|
|
1891
1932
|
* ================================
|
|
1892
1933
|
* Entities
|
|
@@ -1898,13 +1939,13 @@ var index_default = (path5) => {
|
|
|
1898
1939
|
* @param version - Optional id of the version to get (supports semver)
|
|
1899
1940
|
* @returns Entity|Undefined
|
|
1900
1941
|
*/
|
|
1901
|
-
getEntity: getEntity((0,
|
|
1942
|
+
getEntity: getEntity((0, import_node_path17.join)(path5)),
|
|
1902
1943
|
/**
|
|
1903
1944
|
* Returns all entities from EventCatalog
|
|
1904
1945
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1905
1946
|
* @returns Entity[]|Undefined
|
|
1906
1947
|
*/
|
|
1907
|
-
getEntities: getEntities((0,
|
|
1948
|
+
getEntities: getEntities((0, import_node_path17.join)(path5)),
|
|
1908
1949
|
/**
|
|
1909
1950
|
* Adds an entity to EventCatalog
|
|
1910
1951
|
*
|
|
@@ -1912,33 +1953,95 @@ var index_default = (path5) => {
|
|
|
1912
1953
|
* @param options - Optional options to write the entity
|
|
1913
1954
|
*
|
|
1914
1955
|
*/
|
|
1915
|
-
writeEntity: writeEntity((0,
|
|
1956
|
+
writeEntity: writeEntity((0, import_node_path17.join)(path5, "entities")),
|
|
1916
1957
|
/**
|
|
1917
1958
|
* Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
|
|
1918
1959
|
*
|
|
1919
1960
|
* @param path - The path to your entity, e.g. `/User`
|
|
1920
1961
|
*
|
|
1921
1962
|
*/
|
|
1922
|
-
rmEntity: rmEntity((0,
|
|
1963
|
+
rmEntity: rmEntity((0, import_node_path17.join)(path5, "entities")),
|
|
1923
1964
|
/**
|
|
1924
1965
|
* Remove an entity by an entity id
|
|
1925
1966
|
*
|
|
1926
1967
|
* @param id - The id of the entity you want to remove
|
|
1927
1968
|
*
|
|
1928
1969
|
*/
|
|
1929
|
-
rmEntityById: rmEntityById((0,
|
|
1970
|
+
rmEntityById: rmEntityById((0, import_node_path17.join)(path5)),
|
|
1930
1971
|
/**
|
|
1931
1972
|
* Moves a given entity id to the version directory
|
|
1932
1973
|
* @param id - The id of the entity to version
|
|
1933
1974
|
*/
|
|
1934
|
-
versionEntity: versionEntity((0,
|
|
1975
|
+
versionEntity: versionEntity((0, import_node_path17.join)(path5)),
|
|
1935
1976
|
/**
|
|
1936
1977
|
* Check to see if an entity version exists
|
|
1937
1978
|
* @param id - The id of the entity
|
|
1938
1979
|
* @param version - The version of the entity (supports semver)
|
|
1939
1980
|
* @returns
|
|
1940
1981
|
*/
|
|
1941
|
-
entityHasVersion: entityHasVersion((0,
|
|
1982
|
+
entityHasVersion: entityHasVersion((0, import_node_path17.join)(path5)),
|
|
1983
|
+
/**
|
|
1984
|
+
* ================================
|
|
1985
|
+
* Data Stores
|
|
1986
|
+
* ================================
|
|
1987
|
+
*/
|
|
1988
|
+
/**
|
|
1989
|
+
* Adds a data store to EventCatalog
|
|
1990
|
+
* @param dataStore - The data store to write
|
|
1991
|
+
* @param options - Optional options to write the data store
|
|
1992
|
+
*
|
|
1993
|
+
*/
|
|
1994
|
+
writeDataStore: writeContainer((0, import_node_path17.join)(path5, "containers")),
|
|
1995
|
+
/**
|
|
1996
|
+
* Returns a container from EventCatalog
|
|
1997
|
+
* @param id - The id of the container to retrieve
|
|
1998
|
+
* @param version - Optional id of the version to get (supports semver)
|
|
1999
|
+
* @returns Container|Undefined
|
|
2000
|
+
*/
|
|
2001
|
+
getDataStore: getContainer((0, import_node_path17.join)(path5)),
|
|
2002
|
+
/**
|
|
2003
|
+
* Returns all data stores from EventCatalog
|
|
2004
|
+
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
2005
|
+
* @returns Container[]|Undefined
|
|
2006
|
+
*/
|
|
2007
|
+
getDataStores: getContainers((0, import_node_path17.join)(path5)),
|
|
2008
|
+
/**
|
|
2009
|
+
* Version a data store by its id
|
|
2010
|
+
* @param id - The id of the data store to version
|
|
2011
|
+
*/
|
|
2012
|
+
versionDataStore: versionContainer((0, import_node_path17.join)(path5, "containers")),
|
|
2013
|
+
/**
|
|
2014
|
+
* Remove a data store by its path
|
|
2015
|
+
* @param path - The path to the data store to remove
|
|
2016
|
+
*/
|
|
2017
|
+
rmDataStore: rmContainer((0, import_node_path17.join)(path5, "containers")),
|
|
2018
|
+
/**
|
|
2019
|
+
* Remove a data store by its id
|
|
2020
|
+
* @param id - The id of the data store to remove
|
|
2021
|
+
*/
|
|
2022
|
+
rmDataStoreById: rmContainerById((0, import_node_path17.join)(path5)),
|
|
2023
|
+
/**
|
|
2024
|
+
* Check to see if a data store version exists
|
|
2025
|
+
* @param id - The id of the data store
|
|
2026
|
+
* @param version - The version of the data store (supports semver)
|
|
2027
|
+
* @returns
|
|
2028
|
+
*/
|
|
2029
|
+
dataStoreHasVersion: containerHasVersion((0, import_node_path17.join)(path5)),
|
|
2030
|
+
/**
|
|
2031
|
+
* Adds a file to a data store by its id
|
|
2032
|
+
* @param id - The id of the data store to add the file to
|
|
2033
|
+
* @param file - File contents to add including the content and the file name
|
|
2034
|
+
* @param version - Optional version of the data store to add the file to
|
|
2035
|
+
* @returns
|
|
2036
|
+
*/
|
|
2037
|
+
addFileToDataStore: addFileToContainer((0, import_node_path17.join)(path5)),
|
|
2038
|
+
/**
|
|
2039
|
+
* Writes a data store to a service by its id
|
|
2040
|
+
* @param dataStore - The data store to write
|
|
2041
|
+
* @param service - The service to write the data store to
|
|
2042
|
+
* @returns
|
|
2043
|
+
*/
|
|
2044
|
+
writeDataStoreToService: writeContainerToService((0, import_node_path17.join)(path5))
|
|
1942
2045
|
};
|
|
1943
2046
|
};
|
|
1944
2047
|
//# sourceMappingURL=index.js.map
|