@eventcatalog/sdk 1.3.2 → 1.4.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 +5 -4
- package/dist/channels.js.map +1 -1
- package/dist/channels.mjs +5 -4
- package/dist/channels.mjs.map +1 -1
- package/dist/commands.js +5 -4
- package/dist/commands.js.map +1 -1
- package/dist/commands.mjs +5 -4
- package/dist/commands.mjs.map +1 -1
- package/dist/domains.js +10 -5
- package/dist/domains.js.map +1 -1
- package/dist/domains.mjs +10 -5
- package/dist/domains.mjs.map +1 -1
- package/dist/events.js +5 -4
- package/dist/events.js.map +1 -1
- package/dist/events.mjs +5 -4
- package/dist/events.mjs.map +1 -1
- package/dist/index.d.mts +68 -6
- package/dist/index.d.ts +68 -6
- package/dist/index.js +233 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +233 -70
- package/dist/index.mjs.map +1 -1
- package/dist/queries.js +5 -4
- package/dist/queries.js.map +1 -1
- package/dist/queries.mjs +5 -4
- package/dist/queries.mjs.map +1 -1
- package/dist/services.js +10 -5
- package/dist/services.js.map +1 -1
- package/dist/services.mjs +10 -5
- package/dist/services.mjs.map +1 -1
- package/dist/teams.d.mts +83 -0
- package/dist/teams.d.ts +83 -0
- package/dist/teams.js +108 -0
- package/dist/teams.js.map +1 -0
- package/dist/teams.mjs +68 -0
- package/dist/teams.mjs.map +1 -0
- package/dist/types.d.d.mts +2 -0
- package/dist/types.d.d.ts +2 -0
- package/dist/types.d.js.map +1 -1
- package/dist/users.d.mts +83 -0
- package/dist/users.d.ts +83 -0
- package/dist/users.js +110 -0
- package/dist/users.js.map +1 -0
- package/dist/users.mjs +70 -0
- package/dist/users.mjs.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ __export(src_exports, {
|
|
|
33
33
|
default: () => src_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(src_exports);
|
|
36
|
-
var
|
|
36
|
+
var import_node_path10 = require("path");
|
|
37
37
|
|
|
38
38
|
// src/events.ts
|
|
39
39
|
var import_promises3 = __toESM(require("fs/promises"));
|
|
@@ -77,7 +77,8 @@ var findFileById = async (catalogDir, id, version) => {
|
|
|
77
77
|
};
|
|
78
78
|
var getFiles = async (pattern, ignore = "") => {
|
|
79
79
|
try {
|
|
80
|
-
const
|
|
80
|
+
const ignoreList = Array.isArray(ignore) ? ignore : [ignore];
|
|
81
|
+
const files = await (0, import_glob.glob)(pattern, { ignore: ["node_modules/**", ...ignoreList] });
|
|
81
82
|
return files;
|
|
82
83
|
} catch (error) {
|
|
83
84
|
throw new Error(`Error finding files: ${error}`);
|
|
@@ -189,9 +190,9 @@ var getResource = async (catalogDir, id, version, options) => {
|
|
|
189
190
|
markdown: content.trim()
|
|
190
191
|
};
|
|
191
192
|
};
|
|
192
|
-
var getResources = async (catalogDir, { type, latestOnly = false }) => {
|
|
193
|
-
const
|
|
194
|
-
const files = await getFiles(`${catalogDir}/**/${type}/**/index.md`, ignore);
|
|
193
|
+
var getResources = async (catalogDir, { type, latestOnly = false, ignore = [] }) => {
|
|
194
|
+
const ignoreList = latestOnly ? `**/versioned/**` : "";
|
|
195
|
+
const files = await getFiles(`${catalogDir}/**/${type}/**/index.md`, [ignoreList, ...ignore]);
|
|
195
196
|
if (files.length === 0) return;
|
|
196
197
|
return files.map((file) => {
|
|
197
198
|
const { data, content } = import_gray_matter2.default.read(file);
|
|
@@ -306,7 +307,11 @@ var queryHasVersion = (directory) => async (id, version) => {
|
|
|
306
307
|
var import_promises6 = __toESM(require("fs/promises"));
|
|
307
308
|
var import_node_path5 = require("path");
|
|
308
309
|
var getService = (directory) => async (id, version) => getResource(directory, id, version, { type: "service" });
|
|
309
|
-
var getServices = (directory) => async (options) => getResources(directory, {
|
|
310
|
+
var getServices = (directory) => async (options) => getResources(directory, {
|
|
311
|
+
type: "services",
|
|
312
|
+
ignore: ["**/events/**", "**/commands/**", "**/queries/**"],
|
|
313
|
+
...options
|
|
314
|
+
});
|
|
310
315
|
var writeService = (directory) => async (service, options = { path: "" }) => {
|
|
311
316
|
const resource = { ...service };
|
|
312
317
|
if (Array.isArray(service.sends)) {
|
|
@@ -396,7 +401,11 @@ var serviceHasVersion = (directory) => async (id, version) => {
|
|
|
396
401
|
var import_promises7 = __toESM(require("fs/promises"));
|
|
397
402
|
var import_node_path6 = require("path");
|
|
398
403
|
var getDomain = (directory) => async (id, version) => getResource(directory, id, version, { type: "domain" });
|
|
399
|
-
var getDomains = (directory) => async (options) => getResources(directory, {
|
|
404
|
+
var getDomains = (directory) => async (options) => getResources(directory, {
|
|
405
|
+
type: "domains",
|
|
406
|
+
ignore: ["**/services/**", "**/events/**", "**/commands/**", "**/queries/**"],
|
|
407
|
+
...options
|
|
408
|
+
});
|
|
400
409
|
var writeDomain = (directory) => async (domain, options = { path: "" }) => {
|
|
401
410
|
const resource = { ...domain };
|
|
402
411
|
if (Array.isArray(domain.services)) {
|
|
@@ -480,6 +489,98 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
480
489
|
await writeMessage(pathToResource)(message);
|
|
481
490
|
};
|
|
482
491
|
|
|
492
|
+
// src/teams.ts
|
|
493
|
+
var import_promises9 = __toESM(require("fs/promises"));
|
|
494
|
+
var import_node_path8 = require("path");
|
|
495
|
+
var import_gray_matter3 = __toESM(require("gray-matter"));
|
|
496
|
+
var getTeam = (catalogDir) => async (id) => {
|
|
497
|
+
const files = await getFiles(`${catalogDir}/${id}.md`);
|
|
498
|
+
if (files.length == 0) return void 0;
|
|
499
|
+
const file = files[0];
|
|
500
|
+
const { data, content } = import_gray_matter3.default.read(file);
|
|
501
|
+
return {
|
|
502
|
+
...data,
|
|
503
|
+
id: data.id,
|
|
504
|
+
name: data.name,
|
|
505
|
+
markdown: content.trim()
|
|
506
|
+
};
|
|
507
|
+
};
|
|
508
|
+
var getTeams = (catalogDir) => async (options) => {
|
|
509
|
+
const files = await getFiles(`${catalogDir}/teams/*.md`);
|
|
510
|
+
if (files.length === 0) return [];
|
|
511
|
+
return files.map((file) => {
|
|
512
|
+
const { data, content } = import_gray_matter3.default.read(file);
|
|
513
|
+
return {
|
|
514
|
+
...data,
|
|
515
|
+
id: data.id,
|
|
516
|
+
name: data.name,
|
|
517
|
+
markdown: content.trim()
|
|
518
|
+
};
|
|
519
|
+
});
|
|
520
|
+
};
|
|
521
|
+
var writeTeam = (catalogDir) => async (team, options = {}) => {
|
|
522
|
+
const resource = { ...team };
|
|
523
|
+
const currentTeam = await getTeam(catalogDir)(resource.id);
|
|
524
|
+
const exists = currentTeam !== void 0;
|
|
525
|
+
if (exists && !options.override) {
|
|
526
|
+
throw new Error(`Failed to write ${resource.id} (team) as it already exists`);
|
|
527
|
+
}
|
|
528
|
+
const { markdown, ...frontmatter } = resource;
|
|
529
|
+
const document = import_gray_matter3.default.stringify(markdown, frontmatter);
|
|
530
|
+
await import_promises9.default.mkdir((0, import_node_path8.join)(catalogDir, ""), { recursive: true });
|
|
531
|
+
await import_promises9.default.writeFile((0, import_node_path8.join)(catalogDir, "", `${resource.id}.md`), document);
|
|
532
|
+
};
|
|
533
|
+
var rmTeamById = (catalogDir) => async (id) => {
|
|
534
|
+
await import_promises9.default.rm((0, import_node_path8.join)(catalogDir, `${id}.md`), { recursive: true });
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
// src/users.ts
|
|
538
|
+
var import_promises10 = __toESM(require("fs/promises"));
|
|
539
|
+
var import_node_path9 = require("path");
|
|
540
|
+
var import_gray_matter4 = __toESM(require("gray-matter"));
|
|
541
|
+
var getUser = (catalogDir) => async (id) => {
|
|
542
|
+
const files = await getFiles(`${catalogDir}/${id}.md`);
|
|
543
|
+
if (files.length == 0) return void 0;
|
|
544
|
+
const file = files[0];
|
|
545
|
+
const { data, content } = import_gray_matter4.default.read(file);
|
|
546
|
+
return {
|
|
547
|
+
...data,
|
|
548
|
+
id: data.id,
|
|
549
|
+
name: data.name,
|
|
550
|
+
avatarUrl: data.avatarUrl,
|
|
551
|
+
markdown: content.trim()
|
|
552
|
+
};
|
|
553
|
+
};
|
|
554
|
+
var getUsers = (catalogDir) => async (options) => {
|
|
555
|
+
const files = await getFiles(`${catalogDir}/users/*.md`);
|
|
556
|
+
if (files.length === 0) return [];
|
|
557
|
+
return files.map((file) => {
|
|
558
|
+
const { data, content } = import_gray_matter4.default.read(file);
|
|
559
|
+
return {
|
|
560
|
+
...data,
|
|
561
|
+
id: data.id,
|
|
562
|
+
name: data.name,
|
|
563
|
+
avatarUrl: data.avatarUrl,
|
|
564
|
+
markdown: content.trim()
|
|
565
|
+
};
|
|
566
|
+
});
|
|
567
|
+
};
|
|
568
|
+
var writeUser = (catalogDir) => async (user, options = {}) => {
|
|
569
|
+
const resource = { ...user };
|
|
570
|
+
const currentUser = await getUser(catalogDir)(resource.id);
|
|
571
|
+
const exists = currentUser !== void 0;
|
|
572
|
+
if (exists && !options.override) {
|
|
573
|
+
throw new Error(`Failed to write ${resource.id} (user) as it already exists`);
|
|
574
|
+
}
|
|
575
|
+
const { markdown, ...frontmatter } = resource;
|
|
576
|
+
const document = import_gray_matter4.default.stringify(markdown, frontmatter);
|
|
577
|
+
await import_promises10.default.mkdir((0, import_node_path9.join)(catalogDir, ""), { recursive: true });
|
|
578
|
+
await import_promises10.default.writeFile((0, import_node_path9.join)(catalogDir, "", `${resource.id}.md`), document);
|
|
579
|
+
};
|
|
580
|
+
var rmUserById = (catalogDir) => async (id) => {
|
|
581
|
+
await import_promises10.default.rm((0, import_node_path9.join)(catalogDir, `${id}.md`), { recursive: true });
|
|
582
|
+
};
|
|
583
|
+
|
|
483
584
|
// src/index.ts
|
|
484
585
|
var src_default = (path) => {
|
|
485
586
|
return {
|
|
@@ -489,13 +590,13 @@ var src_default = (path) => {
|
|
|
489
590
|
* @param version - Optional id of the version to get (supports semver)
|
|
490
591
|
* @returns Event|Undefined
|
|
491
592
|
*/
|
|
492
|
-
getEvent: getEvent((0,
|
|
593
|
+
getEvent: getEvent((0, import_node_path10.join)(path)),
|
|
493
594
|
/**
|
|
494
595
|
* Returns all events from EventCatalog
|
|
495
596
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
496
597
|
* @returns Event[]|Undefined
|
|
497
598
|
*/
|
|
498
|
-
getEvents: getEvents((0,
|
|
599
|
+
getEvents: getEvents((0, import_node_path10.join)(path)),
|
|
499
600
|
/**
|
|
500
601
|
* Adds an event to EventCatalog
|
|
501
602
|
*
|
|
@@ -503,7 +604,7 @@ var src_default = (path) => {
|
|
|
503
604
|
* @param options - Optional options to write the event
|
|
504
605
|
*
|
|
505
606
|
*/
|
|
506
|
-
writeEvent: writeEvent((0,
|
|
607
|
+
writeEvent: writeEvent((0, import_node_path10.join)(path, "events")),
|
|
507
608
|
/**
|
|
508
609
|
* Adds an event to a service in EventCatalog
|
|
509
610
|
*
|
|
@@ -512,26 +613,26 @@ var src_default = (path) => {
|
|
|
512
613
|
* @param options - Optional options to write the event
|
|
513
614
|
*
|
|
514
615
|
*/
|
|
515
|
-
writeEventToService: writeEventToService((0,
|
|
616
|
+
writeEventToService: writeEventToService((0, import_node_path10.join)(path, "services")),
|
|
516
617
|
/**
|
|
517
618
|
* Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
|
|
518
619
|
*
|
|
519
620
|
* @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
|
|
520
621
|
*
|
|
521
622
|
*/
|
|
522
|
-
rmEvent: rmEvent((0,
|
|
623
|
+
rmEvent: rmEvent((0, import_node_path10.join)(path, "events")),
|
|
523
624
|
/**
|
|
524
625
|
* Remove an event by an Event id
|
|
525
626
|
*
|
|
526
627
|
* @param id - The id of the event you want to remove
|
|
527
628
|
*
|
|
528
629
|
*/
|
|
529
|
-
rmEventById: rmEventById((0,
|
|
630
|
+
rmEventById: rmEventById((0, import_node_path10.join)(path)),
|
|
530
631
|
/**
|
|
531
632
|
* Moves a given event id to the version directory
|
|
532
633
|
* @param directory
|
|
533
634
|
*/
|
|
534
|
-
versionEvent: versionEvent((0,
|
|
635
|
+
versionEvent: versionEvent((0, import_node_path10.join)(path)),
|
|
535
636
|
/**
|
|
536
637
|
* Adds a file to the given event
|
|
537
638
|
* @param id - The id of the event to add the file to
|
|
@@ -539,7 +640,7 @@ var src_default = (path) => {
|
|
|
539
640
|
* @param version - Optional version of the event to add the file to
|
|
540
641
|
* @returns
|
|
541
642
|
*/
|
|
542
|
-
addFileToEvent: addFileToEvent((0,
|
|
643
|
+
addFileToEvent: addFileToEvent((0, import_node_path10.join)(path)),
|
|
543
644
|
/**
|
|
544
645
|
* Adds a schema to the given event
|
|
545
646
|
* @param id - The id of the event to add the schema to
|
|
@@ -547,14 +648,14 @@ var src_default = (path) => {
|
|
|
547
648
|
* @param version - Optional version of the event to add the schema to
|
|
548
649
|
* @returns
|
|
549
650
|
*/
|
|
550
|
-
addSchemaToEvent: addSchemaToEvent((0,
|
|
651
|
+
addSchemaToEvent: addSchemaToEvent((0, import_node_path10.join)(path)),
|
|
551
652
|
/**
|
|
552
653
|
* Check to see if an event version exists
|
|
553
654
|
* @param id - The id of the event
|
|
554
655
|
* @param version - The version of the event (supports semver)
|
|
555
656
|
* @returns
|
|
556
657
|
*/
|
|
557
|
-
eventHasVersion: eventHasVersion((0,
|
|
658
|
+
eventHasVersion: eventHasVersion((0, import_node_path10.join)(path)),
|
|
558
659
|
/**
|
|
559
660
|
* ================================
|
|
560
661
|
* Commands
|
|
@@ -566,13 +667,13 @@ var src_default = (path) => {
|
|
|
566
667
|
* @param version - Optional id of the version to get (supports semver)
|
|
567
668
|
* @returns Command|Undefined
|
|
568
669
|
*/
|
|
569
|
-
getCommand: getCommand((0,
|
|
670
|
+
getCommand: getCommand((0, import_node_path10.join)(path)),
|
|
570
671
|
/**
|
|
571
672
|
* Returns all commands from EventCatalog
|
|
572
673
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
573
674
|
* @returns Command[]|Undefined
|
|
574
675
|
*/
|
|
575
|
-
getCommands: getCommands((0,
|
|
676
|
+
getCommands: getCommands((0, import_node_path10.join)(path)),
|
|
576
677
|
/**
|
|
577
678
|
* Adds an command to EventCatalog
|
|
578
679
|
*
|
|
@@ -580,7 +681,7 @@ var src_default = (path) => {
|
|
|
580
681
|
* @param options - Optional options to write the command
|
|
581
682
|
*
|
|
582
683
|
*/
|
|
583
|
-
writeCommand: writeCommand((0,
|
|
684
|
+
writeCommand: writeCommand((0, import_node_path10.join)(path, "commands")),
|
|
584
685
|
/**
|
|
585
686
|
* Adds a command to a service in EventCatalog
|
|
586
687
|
*
|
|
@@ -589,26 +690,26 @@ var src_default = (path) => {
|
|
|
589
690
|
* @param options - Optional options to write the command
|
|
590
691
|
*
|
|
591
692
|
*/
|
|
592
|
-
writeCommandToService: writeCommandToService((0,
|
|
693
|
+
writeCommandToService: writeCommandToService((0, import_node_path10.join)(path, "services")),
|
|
593
694
|
/**
|
|
594
695
|
* Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
|
|
595
696
|
*
|
|
596
697
|
* @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
|
|
597
698
|
*
|
|
598
699
|
*/
|
|
599
|
-
rmCommand: rmCommand((0,
|
|
700
|
+
rmCommand: rmCommand((0, import_node_path10.join)(path, "commands")),
|
|
600
701
|
/**
|
|
601
702
|
* Remove an command by an Event id
|
|
602
703
|
*
|
|
603
704
|
* @param id - The id of the command you want to remove
|
|
604
705
|
*
|
|
605
706
|
*/
|
|
606
|
-
rmCommandById: rmCommandById((0,
|
|
707
|
+
rmCommandById: rmCommandById((0, import_node_path10.join)(path)),
|
|
607
708
|
/**
|
|
608
709
|
* Moves a given command id to the version directory
|
|
609
710
|
* @param directory
|
|
610
711
|
*/
|
|
611
|
-
versionCommand: versionCommand((0,
|
|
712
|
+
versionCommand: versionCommand((0, import_node_path10.join)(path)),
|
|
612
713
|
/**
|
|
613
714
|
* Adds a file to the given command
|
|
614
715
|
* @param id - The id of the command to add the file to
|
|
@@ -616,7 +717,7 @@ var src_default = (path) => {
|
|
|
616
717
|
* @param version - Optional version of the command to add the file to
|
|
617
718
|
* @returns
|
|
618
719
|
*/
|
|
619
|
-
addFileToCommand: addFileToCommand((0,
|
|
720
|
+
addFileToCommand: addFileToCommand((0, import_node_path10.join)(path)),
|
|
620
721
|
/**
|
|
621
722
|
* Adds a schema to the given command
|
|
622
723
|
* @param id - The id of the command to add the schema to
|
|
@@ -624,14 +725,14 @@ var src_default = (path) => {
|
|
|
624
725
|
* @param version - Optional version of the command to add the schema to
|
|
625
726
|
* @returns
|
|
626
727
|
*/
|
|
627
|
-
addSchemaToCommand: addSchemaToCommand((0,
|
|
728
|
+
addSchemaToCommand: addSchemaToCommand((0, import_node_path10.join)(path)),
|
|
628
729
|
/**
|
|
629
730
|
* Check to see if a command version exists
|
|
630
731
|
* @param id - The id of the command
|
|
631
732
|
* @param version - The version of the command (supports semver)
|
|
632
733
|
* @returns
|
|
633
734
|
*/
|
|
634
|
-
commandHasVersion: commandHasVersion((0,
|
|
735
|
+
commandHasVersion: commandHasVersion((0, import_node_path10.join)(path)),
|
|
635
736
|
/**
|
|
636
737
|
* ================================
|
|
637
738
|
* Queries
|
|
@@ -643,13 +744,13 @@ var src_default = (path) => {
|
|
|
643
744
|
* @param version - Optional id of the version to get (supports semver)
|
|
644
745
|
* @returns Query|Undefined
|
|
645
746
|
*/
|
|
646
|
-
getQuery: getQuery((0,
|
|
747
|
+
getQuery: getQuery((0, import_node_path10.join)(path)),
|
|
647
748
|
/**
|
|
648
749
|
* Returns all queries from EventCatalog
|
|
649
750
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
650
751
|
* @returns Query[]|Undefined
|
|
651
752
|
*/
|
|
652
|
-
getQueries: getQueries((0,
|
|
753
|
+
getQueries: getQueries((0, import_node_path10.join)(path)),
|
|
653
754
|
/**
|
|
654
755
|
* Adds a query to EventCatalog
|
|
655
756
|
*
|
|
@@ -657,7 +758,7 @@ var src_default = (path) => {
|
|
|
657
758
|
* @param options - Optional options to write the event
|
|
658
759
|
*
|
|
659
760
|
*/
|
|
660
|
-
writeQuery: writeQuery((0,
|
|
761
|
+
writeQuery: writeQuery((0, import_node_path10.join)(path, "queries")),
|
|
661
762
|
/**
|
|
662
763
|
* Adds a query to a service in EventCatalog
|
|
663
764
|
*
|
|
@@ -666,26 +767,26 @@ var src_default = (path) => {
|
|
|
666
767
|
* @param options - Optional options to write the query
|
|
667
768
|
*
|
|
668
769
|
*/
|
|
669
|
-
writeQueryToService: writeQueryToService((0,
|
|
770
|
+
writeQueryToService: writeQueryToService((0, import_node_path10.join)(path, "services")),
|
|
670
771
|
/**
|
|
671
772
|
* Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
|
|
672
773
|
*
|
|
673
774
|
* @param path - The path to your query, e.g. `/Orders/GetOrder`
|
|
674
775
|
*
|
|
675
776
|
*/
|
|
676
|
-
rmQuery: rmQuery((0,
|
|
777
|
+
rmQuery: rmQuery((0, import_node_path10.join)(path, "queries")),
|
|
677
778
|
/**
|
|
678
779
|
* Remove a query by a Query id
|
|
679
780
|
*
|
|
680
781
|
* @param id - The id of the query you want to remove
|
|
681
782
|
*
|
|
682
783
|
*/
|
|
683
|
-
rmQueryById: rmQueryById((0,
|
|
784
|
+
rmQueryById: rmQueryById((0, import_node_path10.join)(path)),
|
|
684
785
|
/**
|
|
685
786
|
* Moves a given query id to the version directory
|
|
686
787
|
* @param directory
|
|
687
788
|
*/
|
|
688
|
-
versionQuery: versionQuery((0,
|
|
789
|
+
versionQuery: versionQuery((0, import_node_path10.join)(path)),
|
|
689
790
|
/**
|
|
690
791
|
* Adds a file to the given query
|
|
691
792
|
* @param id - The id of the query to add the file to
|
|
@@ -693,7 +794,7 @@ var src_default = (path) => {
|
|
|
693
794
|
* @param version - Optional version of the query to add the file to
|
|
694
795
|
* @returns
|
|
695
796
|
*/
|
|
696
|
-
addFileToQuery: addFileToQuery((0,
|
|
797
|
+
addFileToQuery: addFileToQuery((0, import_node_path10.join)(path)),
|
|
697
798
|
/**
|
|
698
799
|
* Adds a schema to the given query
|
|
699
800
|
* @param id - The id of the query to add the schema to
|
|
@@ -701,14 +802,14 @@ var src_default = (path) => {
|
|
|
701
802
|
* @param version - Optional version of the query to add the schema to
|
|
702
803
|
* @returns
|
|
703
804
|
*/
|
|
704
|
-
addSchemaToQuery: addSchemaToQuery((0,
|
|
805
|
+
addSchemaToQuery: addSchemaToQuery((0, import_node_path10.join)(path)),
|
|
705
806
|
/**
|
|
706
807
|
* Check to see if an query version exists
|
|
707
808
|
* @param id - The id of the query
|
|
708
809
|
* @param version - The version of the query (supports semver)
|
|
709
810
|
* @returns
|
|
710
811
|
*/
|
|
711
|
-
queryHasVersion: queryHasVersion((0,
|
|
812
|
+
queryHasVersion: queryHasVersion((0, import_node_path10.join)(path)),
|
|
712
813
|
/**
|
|
713
814
|
* ================================
|
|
714
815
|
* Channels
|
|
@@ -720,13 +821,13 @@ var src_default = (path) => {
|
|
|
720
821
|
* @param version - Optional id of the version to get (supports semver)
|
|
721
822
|
* @returns Channel|Undefined
|
|
722
823
|
*/
|
|
723
|
-
getChannel: getChannel((0,
|
|
824
|
+
getChannel: getChannel((0, import_node_path10.join)(path)),
|
|
724
825
|
/**
|
|
725
826
|
* Returns all channels from EventCatalog
|
|
726
827
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
727
828
|
* @returns Channel[]|Undefined
|
|
728
829
|
*/
|
|
729
|
-
getChannels: getChannels((0,
|
|
830
|
+
getChannels: getChannels((0, import_node_path10.join)(path)),
|
|
730
831
|
/**
|
|
731
832
|
* Adds an channel to EventCatalog
|
|
732
833
|
*
|
|
@@ -734,33 +835,33 @@ var src_default = (path) => {
|
|
|
734
835
|
* @param options - Optional options to write the channel
|
|
735
836
|
*
|
|
736
837
|
*/
|
|
737
|
-
writeChannel: writeChannel((0,
|
|
838
|
+
writeChannel: writeChannel((0, import_node_path10.join)(path, "channels")),
|
|
738
839
|
/**
|
|
739
840
|
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
740
841
|
*
|
|
741
842
|
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
742
843
|
*
|
|
743
844
|
*/
|
|
744
|
-
rmChannel: rmChannel((0,
|
|
845
|
+
rmChannel: rmChannel((0, import_node_path10.join)(path, "channels")),
|
|
745
846
|
/**
|
|
746
847
|
* Remove an channel by an Event id
|
|
747
848
|
*
|
|
748
849
|
* @param id - The id of the channel you want to remove
|
|
749
850
|
*
|
|
750
851
|
*/
|
|
751
|
-
rmChannelById: rmChannelById((0,
|
|
852
|
+
rmChannelById: rmChannelById((0, import_node_path10.join)(path)),
|
|
752
853
|
/**
|
|
753
854
|
* Moves a given channel id to the version directory
|
|
754
855
|
* @param directory
|
|
755
856
|
*/
|
|
756
|
-
versionChannel: versionChannel((0,
|
|
857
|
+
versionChannel: versionChannel((0, import_node_path10.join)(path)),
|
|
757
858
|
/**
|
|
758
859
|
* Check to see if a channel version exists
|
|
759
860
|
* @param id - The id of the channel
|
|
760
861
|
* @param version - The version of the channel (supports semver)
|
|
761
862
|
* @returns
|
|
762
863
|
*/
|
|
763
|
-
channelHasVersion: channelHasVersion((0,
|
|
864
|
+
channelHasVersion: channelHasVersion((0, import_node_path10.join)(path)),
|
|
764
865
|
/**
|
|
765
866
|
* Add a channel to an event
|
|
766
867
|
*
|
|
@@ -777,7 +878,7 @@ var src_default = (path) => {
|
|
|
777
878
|
*
|
|
778
879
|
* ```
|
|
779
880
|
*/
|
|
780
|
-
addEventToChannel: addMessageToChannel((0,
|
|
881
|
+
addEventToChannel: addMessageToChannel((0, import_node_path10.join)(path), "events"),
|
|
781
882
|
/**
|
|
782
883
|
* Add a channel to an command
|
|
783
884
|
*
|
|
@@ -794,7 +895,7 @@ var src_default = (path) => {
|
|
|
794
895
|
*
|
|
795
896
|
* ```
|
|
796
897
|
*/
|
|
797
|
-
addCommandToChannel: addMessageToChannel((0,
|
|
898
|
+
addCommandToChannel: addMessageToChannel((0, import_node_path10.join)(path), "commands"),
|
|
798
899
|
/**
|
|
799
900
|
* Add a channel to an query
|
|
800
901
|
*
|
|
@@ -811,7 +912,7 @@ var src_default = (path) => {
|
|
|
811
912
|
*
|
|
812
913
|
* ```
|
|
813
914
|
*/
|
|
814
|
-
addQueryToChannel: addMessageToChannel((0,
|
|
915
|
+
addQueryToChannel: addMessageToChannel((0, import_node_path10.join)(path), "queries"),
|
|
815
916
|
/**
|
|
816
917
|
* ================================
|
|
817
918
|
* SERVICES
|
|
@@ -824,14 +925,14 @@ var src_default = (path) => {
|
|
|
824
925
|
* @param options - Optional options to write the event
|
|
825
926
|
*
|
|
826
927
|
*/
|
|
827
|
-
writeService: writeService((0,
|
|
928
|
+
writeService: writeService((0, import_node_path10.join)(path, "services")),
|
|
828
929
|
/**
|
|
829
930
|
* Adds a versioned service to EventCatalog
|
|
830
931
|
*
|
|
831
932
|
* @param service - The service to write
|
|
832
933
|
*
|
|
833
934
|
*/
|
|
834
|
-
writeVersionedService: writeVersionedService((0,
|
|
935
|
+
writeVersionedService: writeVersionedService((0, import_node_path10.join)(path, "services")),
|
|
835
936
|
/**
|
|
836
937
|
* Adds a service to a domain in EventCatalog
|
|
837
938
|
*
|
|
@@ -840,39 +941,39 @@ var src_default = (path) => {
|
|
|
840
941
|
* @param options - Optional options to write the event
|
|
841
942
|
*
|
|
842
943
|
*/
|
|
843
|
-
writeServiceToDomain: writeServiceToDomain((0,
|
|
944
|
+
writeServiceToDomain: writeServiceToDomain((0, import_node_path10.join)(path, "domains")),
|
|
844
945
|
/**
|
|
845
946
|
* Returns a service from EventCatalog
|
|
846
947
|
* @param id - The id of the service to retrieve
|
|
847
948
|
* @param version - Optional id of the version to get (supports semver)
|
|
848
949
|
* @returns Service|Undefined
|
|
849
950
|
*/
|
|
850
|
-
getService: getService((0,
|
|
951
|
+
getService: getService((0, import_node_path10.join)(path)),
|
|
851
952
|
/**
|
|
852
953
|
* Returns all services from EventCatalog
|
|
853
954
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
854
955
|
* @returns Service[]|Undefined
|
|
855
956
|
*/
|
|
856
|
-
getServices: getServices((0,
|
|
957
|
+
getServices: getServices((0, import_node_path10.join)(path)),
|
|
857
958
|
/**
|
|
858
959
|
* Moves a given service id to the version directory
|
|
859
960
|
* @param directory
|
|
860
961
|
*/
|
|
861
|
-
versionService: versionService((0,
|
|
962
|
+
versionService: versionService((0, import_node_path10.join)(path)),
|
|
862
963
|
/**
|
|
863
964
|
* Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
|
|
864
965
|
*
|
|
865
966
|
* @param path - The path to your service, e.g. `/InventoryService`
|
|
866
967
|
*
|
|
867
968
|
*/
|
|
868
|
-
rmService: rmService((0,
|
|
969
|
+
rmService: rmService((0, import_node_path10.join)(path, "services")),
|
|
869
970
|
/**
|
|
870
971
|
* Remove an service by an service id
|
|
871
972
|
*
|
|
872
973
|
* @param id - The id of the service you want to remove
|
|
873
974
|
*
|
|
874
975
|
*/
|
|
875
|
-
rmServiceById: rmServiceById((0,
|
|
976
|
+
rmServiceById: rmServiceById((0, import_node_path10.join)(path)),
|
|
876
977
|
/**
|
|
877
978
|
* Adds a file to the given service
|
|
878
979
|
* @param id - The id of the service to add the file to
|
|
@@ -880,21 +981,21 @@ var src_default = (path) => {
|
|
|
880
981
|
* @param version - Optional version of the service to add the file to
|
|
881
982
|
* @returns
|
|
882
983
|
*/
|
|
883
|
-
addFileToService: addFileToService((0,
|
|
984
|
+
addFileToService: addFileToService((0, import_node_path10.join)(path)),
|
|
884
985
|
/**
|
|
885
986
|
* Returns the specifications for a given service
|
|
886
987
|
* @param id - The id of the service to retrieve the specifications for
|
|
887
988
|
* @param version - Optional version of the service
|
|
888
989
|
* @returns
|
|
889
990
|
*/
|
|
890
|
-
getSpecificationFilesForService: getSpecificationFilesForService((0,
|
|
991
|
+
getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path10.join)(path)),
|
|
891
992
|
/**
|
|
892
993
|
* Check to see if a service version exists
|
|
893
994
|
* @param id - The id of the service
|
|
894
995
|
* @param version - The version of the service (supports semver)
|
|
895
996
|
* @returns
|
|
896
997
|
*/
|
|
897
|
-
serviceHasVersion: serviceHasVersion((0,
|
|
998
|
+
serviceHasVersion: serviceHasVersion((0, import_node_path10.join)(path)),
|
|
898
999
|
/**
|
|
899
1000
|
* Add an event to a service by it's id.
|
|
900
1001
|
*
|
|
@@ -914,7 +1015,7 @@ var src_default = (path) => {
|
|
|
914
1015
|
*
|
|
915
1016
|
* ```
|
|
916
1017
|
*/
|
|
917
|
-
addEventToService: addMessageToService((0,
|
|
1018
|
+
addEventToService: addMessageToService((0, import_node_path10.join)(path)),
|
|
918
1019
|
/**
|
|
919
1020
|
* Add a command to a service by it's id.
|
|
920
1021
|
*
|
|
@@ -934,7 +1035,7 @@ var src_default = (path) => {
|
|
|
934
1035
|
*
|
|
935
1036
|
* ```
|
|
936
1037
|
*/
|
|
937
|
-
addCommandToService: addMessageToService((0,
|
|
1038
|
+
addCommandToService: addMessageToService((0, import_node_path10.join)(path)),
|
|
938
1039
|
/**
|
|
939
1040
|
* Add a query to a service by it's id.
|
|
940
1041
|
*
|
|
@@ -954,7 +1055,7 @@ var src_default = (path) => {
|
|
|
954
1055
|
*
|
|
955
1056
|
* ```
|
|
956
1057
|
*/
|
|
957
|
-
addQueryToService: addMessageToService((0,
|
|
1058
|
+
addQueryToService: addMessageToService((0, import_node_path10.join)(path)),
|
|
958
1059
|
/**
|
|
959
1060
|
* ================================
|
|
960
1061
|
* Domains
|
|
@@ -967,39 +1068,39 @@ var src_default = (path) => {
|
|
|
967
1068
|
* @param options - Optional options to write the event
|
|
968
1069
|
*
|
|
969
1070
|
*/
|
|
970
|
-
writeDomain: writeDomain((0,
|
|
1071
|
+
writeDomain: writeDomain((0, import_node_path10.join)(path, "domains")),
|
|
971
1072
|
/**
|
|
972
1073
|
* Returns a domain from EventCatalog
|
|
973
1074
|
* @param id - The id of the domain to retrieve
|
|
974
1075
|
* @param version - Optional id of the version to get (supports semver)
|
|
975
1076
|
* @returns Domain|Undefined
|
|
976
1077
|
*/
|
|
977
|
-
getDomain: getDomain((0,
|
|
1078
|
+
getDomain: getDomain((0, import_node_path10.join)(path, "domains")),
|
|
978
1079
|
/**
|
|
979
1080
|
* Returns all domains from EventCatalog
|
|
980
1081
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
981
1082
|
* @returns Domain[]|Undefined
|
|
982
1083
|
*/
|
|
983
|
-
getDomains: getDomains((0,
|
|
1084
|
+
getDomains: getDomains((0, import_node_path10.join)(path)),
|
|
984
1085
|
/**
|
|
985
1086
|
* Moves a given domain id to the version directory
|
|
986
1087
|
* @param directory
|
|
987
1088
|
*/
|
|
988
|
-
versionDomain: versionDomain((0,
|
|
1089
|
+
versionDomain: versionDomain((0, import_node_path10.join)(path, "domains")),
|
|
989
1090
|
/**
|
|
990
1091
|
* Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
|
|
991
1092
|
*
|
|
992
1093
|
* @param path - The path to your domain, e.g. `/Payment`
|
|
993
1094
|
*
|
|
994
1095
|
*/
|
|
995
|
-
rmDomain: rmDomain((0,
|
|
1096
|
+
rmDomain: rmDomain((0, import_node_path10.join)(path, "domains")),
|
|
996
1097
|
/**
|
|
997
1098
|
* Remove an service by an domain id
|
|
998
1099
|
*
|
|
999
1100
|
* @param id - The id of the domain you want to remove
|
|
1000
1101
|
*
|
|
1001
1102
|
*/
|
|
1002
|
-
rmDomainById: rmDomainById((0,
|
|
1103
|
+
rmDomainById: rmDomainById((0, import_node_path10.join)(path, "domains")),
|
|
1003
1104
|
/**
|
|
1004
1105
|
* Adds a file to the given domain
|
|
1005
1106
|
* @param id - The id of the domain to add the file to
|
|
@@ -1007,14 +1108,14 @@ var src_default = (path) => {
|
|
|
1007
1108
|
* @param version - Optional version of the domain to add the file to
|
|
1008
1109
|
* @returns
|
|
1009
1110
|
*/
|
|
1010
|
-
addFileToDomain: addFileToDomain((0,
|
|
1111
|
+
addFileToDomain: addFileToDomain((0, import_node_path10.join)(path, "domains")),
|
|
1011
1112
|
/**
|
|
1012
1113
|
* Check to see if a domain version exists
|
|
1013
1114
|
* @param id - The id of the domain
|
|
1014
1115
|
* @param version - The version of the domain (supports semver)
|
|
1015
1116
|
* @returns
|
|
1016
1117
|
*/
|
|
1017
|
-
domainHasVersion: domainHasVersion((0,
|
|
1118
|
+
domainHasVersion: domainHasVersion((0, import_node_path10.join)(path)),
|
|
1018
1119
|
/**
|
|
1019
1120
|
* Adds a given service to a domain
|
|
1020
1121
|
* @param id - The id of the domain
|
|
@@ -1022,7 +1123,69 @@ var src_default = (path) => {
|
|
|
1022
1123
|
* @param version - (Optional) The version of the domain to add the service to
|
|
1023
1124
|
* @returns
|
|
1024
1125
|
*/
|
|
1025
|
-
addServiceToDomain: addServiceToDomain((0,
|
|
1126
|
+
addServiceToDomain: addServiceToDomain((0, import_node_path10.join)(path, "domains")),
|
|
1127
|
+
/**
|
|
1128
|
+
* ================================
|
|
1129
|
+
* Teams
|
|
1130
|
+
* ================================
|
|
1131
|
+
*/
|
|
1132
|
+
/**
|
|
1133
|
+
* Adds a team to EventCatalog
|
|
1134
|
+
*
|
|
1135
|
+
* @param team - The team to write
|
|
1136
|
+
* @param options - Optional options to write the team
|
|
1137
|
+
*
|
|
1138
|
+
*/
|
|
1139
|
+
writeTeam: writeTeam((0, import_node_path10.join)(path, "teams")),
|
|
1140
|
+
/**
|
|
1141
|
+
* Returns a team from EventCatalog
|
|
1142
|
+
* @param id - The id of the team to retrieve
|
|
1143
|
+
* @returns Team|Undefined
|
|
1144
|
+
*/
|
|
1145
|
+
getTeam: getTeam((0, import_node_path10.join)(path, "teams")),
|
|
1146
|
+
/**
|
|
1147
|
+
* Returns all teams from EventCatalog
|
|
1148
|
+
* @returns Team[]|Undefined
|
|
1149
|
+
*/
|
|
1150
|
+
getTeams: getTeams((0, import_node_path10.join)(path)),
|
|
1151
|
+
/**
|
|
1152
|
+
* Remove a team by the team id
|
|
1153
|
+
*
|
|
1154
|
+
* @param id - The id of the team you want to remove
|
|
1155
|
+
*
|
|
1156
|
+
*/
|
|
1157
|
+
rmTeamById: rmTeamById((0, import_node_path10.join)(path, "teams")),
|
|
1158
|
+
/**
|
|
1159
|
+
* ================================
|
|
1160
|
+
* Users
|
|
1161
|
+
* ================================
|
|
1162
|
+
*/
|
|
1163
|
+
/**
|
|
1164
|
+
* Adds a user to EventCatalog
|
|
1165
|
+
*
|
|
1166
|
+
* @param user - The user to write
|
|
1167
|
+
* @param options - Optional options to write the user
|
|
1168
|
+
*
|
|
1169
|
+
*/
|
|
1170
|
+
writeUser: writeUser((0, import_node_path10.join)(path, "users")),
|
|
1171
|
+
/**
|
|
1172
|
+
* Returns a user from EventCatalog
|
|
1173
|
+
* @param id - The id of the user to retrieve
|
|
1174
|
+
* @returns User|Undefined
|
|
1175
|
+
*/
|
|
1176
|
+
getUser: getUser((0, import_node_path10.join)(path, "users")),
|
|
1177
|
+
/**
|
|
1178
|
+
* Returns all user from EventCatalog
|
|
1179
|
+
* @returns User[]|Undefined
|
|
1180
|
+
*/
|
|
1181
|
+
getUsers: getUsers((0, import_node_path10.join)(path)),
|
|
1182
|
+
/**
|
|
1183
|
+
* Remove a user by the user id
|
|
1184
|
+
*
|
|
1185
|
+
* @param id - The id of the user you want to remove
|
|
1186
|
+
*
|
|
1187
|
+
*/
|
|
1188
|
+
rmUserById: rmUserById((0, import_node_path10.join)(path, "users"))
|
|
1026
1189
|
};
|
|
1027
1190
|
};
|
|
1028
1191
|
//# sourceMappingURL=index.js.map
|