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