@eventcatalog/sdk 1.3.1 → 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/channels.js +1 -1
- package/dist/channels.js.map +1 -1
- package/dist/channels.mjs +1 -1
- package/dist/channels.mjs.map +1 -1
- package/dist/commands.js +1 -1
- package/dist/commands.js.map +1 -1
- package/dist/commands.mjs +1 -1
- package/dist/commands.mjs.map +1 -1
- package/dist/domains.js +1 -1
- package/dist/domains.js.map +1 -1
- package/dist/domains.mjs +1 -1
- package/dist/domains.mjs.map +1 -1
- package/dist/events.js +1 -1
- package/dist/events.js.map +1 -1
- package/dist/events.mjs +1 -1
- 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 +219 -65
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +219 -65
- package/dist/index.mjs.map +1 -1
- package/dist/queries.js +1 -1
- package/dist/queries.js.map +1 -1
- package/dist/queries.mjs +1 -1
- package/dist/queries.mjs.map +1 -1
- package/dist/services.js +1 -1
- package/dist/services.js.map +1 -1
- package/dist/services.mjs +1 -1
- 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 +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.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import { join as
|
|
2
|
+
import { join as join11 } from "node:path";
|
|
3
3
|
|
|
4
4
|
// src/events.ts
|
|
5
5
|
import fs3 from "node:fs/promises";
|
|
@@ -132,7 +132,7 @@ var writeResource = async (catalogDir, resource, options = {
|
|
|
132
132
|
throw new Error(`Failed to write ${resource.id} (${options.type}) as the version ${resource.version} already exists`);
|
|
133
133
|
}
|
|
134
134
|
const { markdown, ...frontmatter } = resource;
|
|
135
|
-
if (options.versionExistingContent) {
|
|
135
|
+
if (options.versionExistingContent && !exists) {
|
|
136
136
|
const currentResource = await getResource(catalogDir, resource.id);
|
|
137
137
|
if (currentResource) {
|
|
138
138
|
if (satisfies2(resource.version, `>${currentResource.version}`)) {
|
|
@@ -446,6 +446,98 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
446
446
|
await writeMessage(pathToResource)(message);
|
|
447
447
|
};
|
|
448
448
|
|
|
449
|
+
// src/teams.ts
|
|
450
|
+
import fs9 from "node:fs/promises";
|
|
451
|
+
import { join as join9 } from "node:path";
|
|
452
|
+
import matter3 from "gray-matter";
|
|
453
|
+
var getTeam = (catalogDir) => async (id) => {
|
|
454
|
+
const files = await getFiles(`${catalogDir}/${id}.md`);
|
|
455
|
+
if (files.length == 0) return void 0;
|
|
456
|
+
const file = files[0];
|
|
457
|
+
const { data, content } = matter3.read(file);
|
|
458
|
+
return {
|
|
459
|
+
...data,
|
|
460
|
+
id: data.id,
|
|
461
|
+
name: data.name,
|
|
462
|
+
markdown: content.trim()
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
var getTeams = (catalogDir) => async (options) => {
|
|
466
|
+
const files = await getFiles(`${catalogDir}/teams/*.md`);
|
|
467
|
+
if (files.length === 0) return [];
|
|
468
|
+
return files.map((file) => {
|
|
469
|
+
const { data, content } = matter3.read(file);
|
|
470
|
+
return {
|
|
471
|
+
...data,
|
|
472
|
+
id: data.id,
|
|
473
|
+
name: data.name,
|
|
474
|
+
markdown: content.trim()
|
|
475
|
+
};
|
|
476
|
+
});
|
|
477
|
+
};
|
|
478
|
+
var writeTeam = (catalogDir) => async (team, options = {}) => {
|
|
479
|
+
const resource = { ...team };
|
|
480
|
+
const currentTeam = await getTeam(catalogDir)(resource.id);
|
|
481
|
+
const exists = currentTeam !== void 0;
|
|
482
|
+
if (exists && !options.override) {
|
|
483
|
+
throw new Error(`Failed to write ${resource.id} (team) as it already exists`);
|
|
484
|
+
}
|
|
485
|
+
const { markdown, ...frontmatter } = resource;
|
|
486
|
+
const document = matter3.stringify(markdown, frontmatter);
|
|
487
|
+
await fs9.mkdir(join9(catalogDir, ""), { recursive: true });
|
|
488
|
+
await fs9.writeFile(join9(catalogDir, "", `${resource.id}.md`), document);
|
|
489
|
+
};
|
|
490
|
+
var rmTeamById = (catalogDir) => async (id) => {
|
|
491
|
+
await fs9.rm(join9(catalogDir, `${id}.md`), { recursive: true });
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
// src/users.ts
|
|
495
|
+
import fs10 from "node:fs/promises";
|
|
496
|
+
import { join as join10 } from "node:path";
|
|
497
|
+
import matter4 from "gray-matter";
|
|
498
|
+
var getUser = (catalogDir) => async (id) => {
|
|
499
|
+
const files = await getFiles(`${catalogDir}/${id}.md`);
|
|
500
|
+
if (files.length == 0) return void 0;
|
|
501
|
+
const file = files[0];
|
|
502
|
+
const { data, content } = matter4.read(file);
|
|
503
|
+
return {
|
|
504
|
+
...data,
|
|
505
|
+
id: data.id,
|
|
506
|
+
name: data.name,
|
|
507
|
+
avatarUrl: data.avatarUrl,
|
|
508
|
+
markdown: content.trim()
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
var getUsers = (catalogDir) => async (options) => {
|
|
512
|
+
const files = await getFiles(`${catalogDir}/users/*.md`);
|
|
513
|
+
if (files.length === 0) return [];
|
|
514
|
+
return files.map((file) => {
|
|
515
|
+
const { data, content } = matter4.read(file);
|
|
516
|
+
return {
|
|
517
|
+
...data,
|
|
518
|
+
id: data.id,
|
|
519
|
+
name: data.name,
|
|
520
|
+
avatarUrl: data.avatarUrl,
|
|
521
|
+
markdown: content.trim()
|
|
522
|
+
};
|
|
523
|
+
});
|
|
524
|
+
};
|
|
525
|
+
var writeUser = (catalogDir) => async (user, options = {}) => {
|
|
526
|
+
const resource = { ...user };
|
|
527
|
+
const currentUser = await getUser(catalogDir)(resource.id);
|
|
528
|
+
const exists = currentUser !== void 0;
|
|
529
|
+
if (exists && !options.override) {
|
|
530
|
+
throw new Error(`Failed to write ${resource.id} (user) as it already exists`);
|
|
531
|
+
}
|
|
532
|
+
const { markdown, ...frontmatter } = resource;
|
|
533
|
+
const document = matter4.stringify(markdown, frontmatter);
|
|
534
|
+
await fs10.mkdir(join10(catalogDir, ""), { recursive: true });
|
|
535
|
+
await fs10.writeFile(join10(catalogDir, "", `${resource.id}.md`), document);
|
|
536
|
+
};
|
|
537
|
+
var rmUserById = (catalogDir) => async (id) => {
|
|
538
|
+
await fs10.rm(join10(catalogDir, `${id}.md`), { recursive: true });
|
|
539
|
+
};
|
|
540
|
+
|
|
449
541
|
// src/index.ts
|
|
450
542
|
var src_default = (path) => {
|
|
451
543
|
return {
|
|
@@ -455,13 +547,13 @@ var src_default = (path) => {
|
|
|
455
547
|
* @param version - Optional id of the version to get (supports semver)
|
|
456
548
|
* @returns Event|Undefined
|
|
457
549
|
*/
|
|
458
|
-
getEvent: getEvent(
|
|
550
|
+
getEvent: getEvent(join11(path)),
|
|
459
551
|
/**
|
|
460
552
|
* Returns all events from EventCatalog
|
|
461
553
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
462
554
|
* @returns Event[]|Undefined
|
|
463
555
|
*/
|
|
464
|
-
getEvents: getEvents(
|
|
556
|
+
getEvents: getEvents(join11(path)),
|
|
465
557
|
/**
|
|
466
558
|
* Adds an event to EventCatalog
|
|
467
559
|
*
|
|
@@ -469,7 +561,7 @@ var src_default = (path) => {
|
|
|
469
561
|
* @param options - Optional options to write the event
|
|
470
562
|
*
|
|
471
563
|
*/
|
|
472
|
-
writeEvent: writeEvent(
|
|
564
|
+
writeEvent: writeEvent(join11(path, "events")),
|
|
473
565
|
/**
|
|
474
566
|
* Adds an event to a service in EventCatalog
|
|
475
567
|
*
|
|
@@ -478,26 +570,26 @@ var src_default = (path) => {
|
|
|
478
570
|
* @param options - Optional options to write the event
|
|
479
571
|
*
|
|
480
572
|
*/
|
|
481
|
-
writeEventToService: writeEventToService(
|
|
573
|
+
writeEventToService: writeEventToService(join11(path, "services")),
|
|
482
574
|
/**
|
|
483
575
|
* Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
|
|
484
576
|
*
|
|
485
577
|
* @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
|
|
486
578
|
*
|
|
487
579
|
*/
|
|
488
|
-
rmEvent: rmEvent(
|
|
580
|
+
rmEvent: rmEvent(join11(path, "events")),
|
|
489
581
|
/**
|
|
490
582
|
* Remove an event by an Event id
|
|
491
583
|
*
|
|
492
584
|
* @param id - The id of the event you want to remove
|
|
493
585
|
*
|
|
494
586
|
*/
|
|
495
|
-
rmEventById: rmEventById(
|
|
587
|
+
rmEventById: rmEventById(join11(path)),
|
|
496
588
|
/**
|
|
497
589
|
* Moves a given event id to the version directory
|
|
498
590
|
* @param directory
|
|
499
591
|
*/
|
|
500
|
-
versionEvent: versionEvent(
|
|
592
|
+
versionEvent: versionEvent(join11(path)),
|
|
501
593
|
/**
|
|
502
594
|
* Adds a file to the given event
|
|
503
595
|
* @param id - The id of the event to add the file to
|
|
@@ -505,7 +597,7 @@ var src_default = (path) => {
|
|
|
505
597
|
* @param version - Optional version of the event to add the file to
|
|
506
598
|
* @returns
|
|
507
599
|
*/
|
|
508
|
-
addFileToEvent: addFileToEvent(
|
|
600
|
+
addFileToEvent: addFileToEvent(join11(path)),
|
|
509
601
|
/**
|
|
510
602
|
* Adds a schema to the given event
|
|
511
603
|
* @param id - The id of the event to add the schema to
|
|
@@ -513,14 +605,14 @@ var src_default = (path) => {
|
|
|
513
605
|
* @param version - Optional version of the event to add the schema to
|
|
514
606
|
* @returns
|
|
515
607
|
*/
|
|
516
|
-
addSchemaToEvent: addSchemaToEvent(
|
|
608
|
+
addSchemaToEvent: addSchemaToEvent(join11(path)),
|
|
517
609
|
/**
|
|
518
610
|
* Check to see if an event version exists
|
|
519
611
|
* @param id - The id of the event
|
|
520
612
|
* @param version - The version of the event (supports semver)
|
|
521
613
|
* @returns
|
|
522
614
|
*/
|
|
523
|
-
eventHasVersion: eventHasVersion(
|
|
615
|
+
eventHasVersion: eventHasVersion(join11(path)),
|
|
524
616
|
/**
|
|
525
617
|
* ================================
|
|
526
618
|
* Commands
|
|
@@ -532,13 +624,13 @@ var src_default = (path) => {
|
|
|
532
624
|
* @param version - Optional id of the version to get (supports semver)
|
|
533
625
|
* @returns Command|Undefined
|
|
534
626
|
*/
|
|
535
|
-
getCommand: getCommand(
|
|
627
|
+
getCommand: getCommand(join11(path)),
|
|
536
628
|
/**
|
|
537
629
|
* Returns all commands from EventCatalog
|
|
538
630
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
539
631
|
* @returns Command[]|Undefined
|
|
540
632
|
*/
|
|
541
|
-
getCommands: getCommands(
|
|
633
|
+
getCommands: getCommands(join11(path)),
|
|
542
634
|
/**
|
|
543
635
|
* Adds an command to EventCatalog
|
|
544
636
|
*
|
|
@@ -546,7 +638,7 @@ var src_default = (path) => {
|
|
|
546
638
|
* @param options - Optional options to write the command
|
|
547
639
|
*
|
|
548
640
|
*/
|
|
549
|
-
writeCommand: writeCommand(
|
|
641
|
+
writeCommand: writeCommand(join11(path, "commands")),
|
|
550
642
|
/**
|
|
551
643
|
* Adds a command to a service in EventCatalog
|
|
552
644
|
*
|
|
@@ -555,26 +647,26 @@ var src_default = (path) => {
|
|
|
555
647
|
* @param options - Optional options to write the command
|
|
556
648
|
*
|
|
557
649
|
*/
|
|
558
|
-
writeCommandToService: writeCommandToService(
|
|
650
|
+
writeCommandToService: writeCommandToService(join11(path, "services")),
|
|
559
651
|
/**
|
|
560
652
|
* Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
|
|
561
653
|
*
|
|
562
654
|
* @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
|
|
563
655
|
*
|
|
564
656
|
*/
|
|
565
|
-
rmCommand: rmCommand(
|
|
657
|
+
rmCommand: rmCommand(join11(path, "commands")),
|
|
566
658
|
/**
|
|
567
659
|
* Remove an command by an Event id
|
|
568
660
|
*
|
|
569
661
|
* @param id - The id of the command you want to remove
|
|
570
662
|
*
|
|
571
663
|
*/
|
|
572
|
-
rmCommandById: rmCommandById(
|
|
664
|
+
rmCommandById: rmCommandById(join11(path)),
|
|
573
665
|
/**
|
|
574
666
|
* Moves a given command id to the version directory
|
|
575
667
|
* @param directory
|
|
576
668
|
*/
|
|
577
|
-
versionCommand: versionCommand(
|
|
669
|
+
versionCommand: versionCommand(join11(path)),
|
|
578
670
|
/**
|
|
579
671
|
* Adds a file to the given command
|
|
580
672
|
* @param id - The id of the command to add the file to
|
|
@@ -582,7 +674,7 @@ var src_default = (path) => {
|
|
|
582
674
|
* @param version - Optional version of the command to add the file to
|
|
583
675
|
* @returns
|
|
584
676
|
*/
|
|
585
|
-
addFileToCommand: addFileToCommand(
|
|
677
|
+
addFileToCommand: addFileToCommand(join11(path)),
|
|
586
678
|
/**
|
|
587
679
|
* Adds a schema to the given command
|
|
588
680
|
* @param id - The id of the command to add the schema to
|
|
@@ -590,14 +682,14 @@ var src_default = (path) => {
|
|
|
590
682
|
* @param version - Optional version of the command to add the schema to
|
|
591
683
|
* @returns
|
|
592
684
|
*/
|
|
593
|
-
addSchemaToCommand: addSchemaToCommand(
|
|
685
|
+
addSchemaToCommand: addSchemaToCommand(join11(path)),
|
|
594
686
|
/**
|
|
595
687
|
* Check to see if a command version exists
|
|
596
688
|
* @param id - The id of the command
|
|
597
689
|
* @param version - The version of the command (supports semver)
|
|
598
690
|
* @returns
|
|
599
691
|
*/
|
|
600
|
-
commandHasVersion: commandHasVersion(
|
|
692
|
+
commandHasVersion: commandHasVersion(join11(path)),
|
|
601
693
|
/**
|
|
602
694
|
* ================================
|
|
603
695
|
* Queries
|
|
@@ -609,13 +701,13 @@ var src_default = (path) => {
|
|
|
609
701
|
* @param version - Optional id of the version to get (supports semver)
|
|
610
702
|
* @returns Query|Undefined
|
|
611
703
|
*/
|
|
612
|
-
getQuery: getQuery(
|
|
704
|
+
getQuery: getQuery(join11(path)),
|
|
613
705
|
/**
|
|
614
706
|
* Returns all queries from EventCatalog
|
|
615
707
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
616
708
|
* @returns Query[]|Undefined
|
|
617
709
|
*/
|
|
618
|
-
getQueries: getQueries(
|
|
710
|
+
getQueries: getQueries(join11(path)),
|
|
619
711
|
/**
|
|
620
712
|
* Adds a query to EventCatalog
|
|
621
713
|
*
|
|
@@ -623,7 +715,7 @@ var src_default = (path) => {
|
|
|
623
715
|
* @param options - Optional options to write the event
|
|
624
716
|
*
|
|
625
717
|
*/
|
|
626
|
-
writeQuery: writeQuery(
|
|
718
|
+
writeQuery: writeQuery(join11(path, "queries")),
|
|
627
719
|
/**
|
|
628
720
|
* Adds a query to a service in EventCatalog
|
|
629
721
|
*
|
|
@@ -632,26 +724,26 @@ var src_default = (path) => {
|
|
|
632
724
|
* @param options - Optional options to write the query
|
|
633
725
|
*
|
|
634
726
|
*/
|
|
635
|
-
writeQueryToService: writeQueryToService(
|
|
727
|
+
writeQueryToService: writeQueryToService(join11(path, "services")),
|
|
636
728
|
/**
|
|
637
729
|
* Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
|
|
638
730
|
*
|
|
639
731
|
* @param path - The path to your query, e.g. `/Orders/GetOrder`
|
|
640
732
|
*
|
|
641
733
|
*/
|
|
642
|
-
rmQuery: rmQuery(
|
|
734
|
+
rmQuery: rmQuery(join11(path, "queries")),
|
|
643
735
|
/**
|
|
644
736
|
* Remove a query by a Query id
|
|
645
737
|
*
|
|
646
738
|
* @param id - The id of the query you want to remove
|
|
647
739
|
*
|
|
648
740
|
*/
|
|
649
|
-
rmQueryById: rmQueryById(
|
|
741
|
+
rmQueryById: rmQueryById(join11(path)),
|
|
650
742
|
/**
|
|
651
743
|
* Moves a given query id to the version directory
|
|
652
744
|
* @param directory
|
|
653
745
|
*/
|
|
654
|
-
versionQuery: versionQuery(
|
|
746
|
+
versionQuery: versionQuery(join11(path)),
|
|
655
747
|
/**
|
|
656
748
|
* Adds a file to the given query
|
|
657
749
|
* @param id - The id of the query to add the file to
|
|
@@ -659,7 +751,7 @@ var src_default = (path) => {
|
|
|
659
751
|
* @param version - Optional version of the query to add the file to
|
|
660
752
|
* @returns
|
|
661
753
|
*/
|
|
662
|
-
addFileToQuery: addFileToQuery(
|
|
754
|
+
addFileToQuery: addFileToQuery(join11(path)),
|
|
663
755
|
/**
|
|
664
756
|
* Adds a schema to the given query
|
|
665
757
|
* @param id - The id of the query to add the schema to
|
|
@@ -667,14 +759,14 @@ var src_default = (path) => {
|
|
|
667
759
|
* @param version - Optional version of the query to add the schema to
|
|
668
760
|
* @returns
|
|
669
761
|
*/
|
|
670
|
-
addSchemaToQuery: addSchemaToQuery(
|
|
762
|
+
addSchemaToQuery: addSchemaToQuery(join11(path)),
|
|
671
763
|
/**
|
|
672
764
|
* Check to see if an query version exists
|
|
673
765
|
* @param id - The id of the query
|
|
674
766
|
* @param version - The version of the query (supports semver)
|
|
675
767
|
* @returns
|
|
676
768
|
*/
|
|
677
|
-
queryHasVersion: queryHasVersion(
|
|
769
|
+
queryHasVersion: queryHasVersion(join11(path)),
|
|
678
770
|
/**
|
|
679
771
|
* ================================
|
|
680
772
|
* Channels
|
|
@@ -686,13 +778,13 @@ var src_default = (path) => {
|
|
|
686
778
|
* @param version - Optional id of the version to get (supports semver)
|
|
687
779
|
* @returns Channel|Undefined
|
|
688
780
|
*/
|
|
689
|
-
getChannel: getChannel(
|
|
781
|
+
getChannel: getChannel(join11(path)),
|
|
690
782
|
/**
|
|
691
783
|
* Returns all channels from EventCatalog
|
|
692
784
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
693
785
|
* @returns Channel[]|Undefined
|
|
694
786
|
*/
|
|
695
|
-
getChannels: getChannels(
|
|
787
|
+
getChannels: getChannels(join11(path)),
|
|
696
788
|
/**
|
|
697
789
|
* Adds an channel to EventCatalog
|
|
698
790
|
*
|
|
@@ -700,33 +792,33 @@ var src_default = (path) => {
|
|
|
700
792
|
* @param options - Optional options to write the channel
|
|
701
793
|
*
|
|
702
794
|
*/
|
|
703
|
-
writeChannel: writeChannel(
|
|
795
|
+
writeChannel: writeChannel(join11(path, "channels")),
|
|
704
796
|
/**
|
|
705
797
|
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
706
798
|
*
|
|
707
799
|
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
708
800
|
*
|
|
709
801
|
*/
|
|
710
|
-
rmChannel: rmChannel(
|
|
802
|
+
rmChannel: rmChannel(join11(path, "channels")),
|
|
711
803
|
/**
|
|
712
804
|
* Remove an channel by an Event id
|
|
713
805
|
*
|
|
714
806
|
* @param id - The id of the channel you want to remove
|
|
715
807
|
*
|
|
716
808
|
*/
|
|
717
|
-
rmChannelById: rmChannelById(
|
|
809
|
+
rmChannelById: rmChannelById(join11(path)),
|
|
718
810
|
/**
|
|
719
811
|
* Moves a given channel id to the version directory
|
|
720
812
|
* @param directory
|
|
721
813
|
*/
|
|
722
|
-
versionChannel: versionChannel(
|
|
814
|
+
versionChannel: versionChannel(join11(path)),
|
|
723
815
|
/**
|
|
724
816
|
* Check to see if a channel version exists
|
|
725
817
|
* @param id - The id of the channel
|
|
726
818
|
* @param version - The version of the channel (supports semver)
|
|
727
819
|
* @returns
|
|
728
820
|
*/
|
|
729
|
-
channelHasVersion: channelHasVersion(
|
|
821
|
+
channelHasVersion: channelHasVersion(join11(path)),
|
|
730
822
|
/**
|
|
731
823
|
* Add a channel to an event
|
|
732
824
|
*
|
|
@@ -743,7 +835,7 @@ var src_default = (path) => {
|
|
|
743
835
|
*
|
|
744
836
|
* ```
|
|
745
837
|
*/
|
|
746
|
-
addEventToChannel: addMessageToChannel(
|
|
838
|
+
addEventToChannel: addMessageToChannel(join11(path), "events"),
|
|
747
839
|
/**
|
|
748
840
|
* Add a channel to an command
|
|
749
841
|
*
|
|
@@ -760,7 +852,7 @@ var src_default = (path) => {
|
|
|
760
852
|
*
|
|
761
853
|
* ```
|
|
762
854
|
*/
|
|
763
|
-
addCommandToChannel: addMessageToChannel(
|
|
855
|
+
addCommandToChannel: addMessageToChannel(join11(path), "commands"),
|
|
764
856
|
/**
|
|
765
857
|
* Add a channel to an query
|
|
766
858
|
*
|
|
@@ -777,7 +869,7 @@ var src_default = (path) => {
|
|
|
777
869
|
*
|
|
778
870
|
* ```
|
|
779
871
|
*/
|
|
780
|
-
addQueryToChannel: addMessageToChannel(
|
|
872
|
+
addQueryToChannel: addMessageToChannel(join11(path), "queries"),
|
|
781
873
|
/**
|
|
782
874
|
* ================================
|
|
783
875
|
* SERVICES
|
|
@@ -790,14 +882,14 @@ var src_default = (path) => {
|
|
|
790
882
|
* @param options - Optional options to write the event
|
|
791
883
|
*
|
|
792
884
|
*/
|
|
793
|
-
writeService: writeService(
|
|
885
|
+
writeService: writeService(join11(path, "services")),
|
|
794
886
|
/**
|
|
795
887
|
* Adds a versioned service to EventCatalog
|
|
796
888
|
*
|
|
797
889
|
* @param service - The service to write
|
|
798
890
|
*
|
|
799
891
|
*/
|
|
800
|
-
writeVersionedService: writeVersionedService(
|
|
892
|
+
writeVersionedService: writeVersionedService(join11(path, "services")),
|
|
801
893
|
/**
|
|
802
894
|
* Adds a service to a domain in EventCatalog
|
|
803
895
|
*
|
|
@@ -806,39 +898,39 @@ var src_default = (path) => {
|
|
|
806
898
|
* @param options - Optional options to write the event
|
|
807
899
|
*
|
|
808
900
|
*/
|
|
809
|
-
writeServiceToDomain: writeServiceToDomain(
|
|
901
|
+
writeServiceToDomain: writeServiceToDomain(join11(path, "domains")),
|
|
810
902
|
/**
|
|
811
903
|
* Returns a service from EventCatalog
|
|
812
904
|
* @param id - The id of the service to retrieve
|
|
813
905
|
* @param version - Optional id of the version to get (supports semver)
|
|
814
906
|
* @returns Service|Undefined
|
|
815
907
|
*/
|
|
816
|
-
getService: getService(
|
|
908
|
+
getService: getService(join11(path)),
|
|
817
909
|
/**
|
|
818
910
|
* Returns all services from EventCatalog
|
|
819
911
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
820
912
|
* @returns Service[]|Undefined
|
|
821
913
|
*/
|
|
822
|
-
getServices: getServices(
|
|
914
|
+
getServices: getServices(join11(path)),
|
|
823
915
|
/**
|
|
824
916
|
* Moves a given service id to the version directory
|
|
825
917
|
* @param directory
|
|
826
918
|
*/
|
|
827
|
-
versionService: versionService(
|
|
919
|
+
versionService: versionService(join11(path)),
|
|
828
920
|
/**
|
|
829
921
|
* Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
|
|
830
922
|
*
|
|
831
923
|
* @param path - The path to your service, e.g. `/InventoryService`
|
|
832
924
|
*
|
|
833
925
|
*/
|
|
834
|
-
rmService: rmService(
|
|
926
|
+
rmService: rmService(join11(path, "services")),
|
|
835
927
|
/**
|
|
836
928
|
* Remove an service by an service id
|
|
837
929
|
*
|
|
838
930
|
* @param id - The id of the service you want to remove
|
|
839
931
|
*
|
|
840
932
|
*/
|
|
841
|
-
rmServiceById: rmServiceById(
|
|
933
|
+
rmServiceById: rmServiceById(join11(path)),
|
|
842
934
|
/**
|
|
843
935
|
* Adds a file to the given service
|
|
844
936
|
* @param id - The id of the service to add the file to
|
|
@@ -846,21 +938,21 @@ var src_default = (path) => {
|
|
|
846
938
|
* @param version - Optional version of the service to add the file to
|
|
847
939
|
* @returns
|
|
848
940
|
*/
|
|
849
|
-
addFileToService: addFileToService(
|
|
941
|
+
addFileToService: addFileToService(join11(path)),
|
|
850
942
|
/**
|
|
851
943
|
* Returns the specifications for a given service
|
|
852
944
|
* @param id - The id of the service to retrieve the specifications for
|
|
853
945
|
* @param version - Optional version of the service
|
|
854
946
|
* @returns
|
|
855
947
|
*/
|
|
856
|
-
getSpecificationFilesForService: getSpecificationFilesForService(
|
|
948
|
+
getSpecificationFilesForService: getSpecificationFilesForService(join11(path)),
|
|
857
949
|
/**
|
|
858
950
|
* Check to see if a service version exists
|
|
859
951
|
* @param id - The id of the service
|
|
860
952
|
* @param version - The version of the service (supports semver)
|
|
861
953
|
* @returns
|
|
862
954
|
*/
|
|
863
|
-
serviceHasVersion: serviceHasVersion(
|
|
955
|
+
serviceHasVersion: serviceHasVersion(join11(path)),
|
|
864
956
|
/**
|
|
865
957
|
* Add an event to a service by it's id.
|
|
866
958
|
*
|
|
@@ -880,7 +972,7 @@ var src_default = (path) => {
|
|
|
880
972
|
*
|
|
881
973
|
* ```
|
|
882
974
|
*/
|
|
883
|
-
addEventToService: addMessageToService(
|
|
975
|
+
addEventToService: addMessageToService(join11(path)),
|
|
884
976
|
/**
|
|
885
977
|
* Add a command to a service by it's id.
|
|
886
978
|
*
|
|
@@ -900,7 +992,7 @@ var src_default = (path) => {
|
|
|
900
992
|
*
|
|
901
993
|
* ```
|
|
902
994
|
*/
|
|
903
|
-
addCommandToService: addMessageToService(
|
|
995
|
+
addCommandToService: addMessageToService(join11(path)),
|
|
904
996
|
/**
|
|
905
997
|
* Add a query to a service by it's id.
|
|
906
998
|
*
|
|
@@ -920,7 +1012,7 @@ var src_default = (path) => {
|
|
|
920
1012
|
*
|
|
921
1013
|
* ```
|
|
922
1014
|
*/
|
|
923
|
-
addQueryToService: addMessageToService(
|
|
1015
|
+
addQueryToService: addMessageToService(join11(path)),
|
|
924
1016
|
/**
|
|
925
1017
|
* ================================
|
|
926
1018
|
* Domains
|
|
@@ -933,39 +1025,39 @@ var src_default = (path) => {
|
|
|
933
1025
|
* @param options - Optional options to write the event
|
|
934
1026
|
*
|
|
935
1027
|
*/
|
|
936
|
-
writeDomain: writeDomain(
|
|
1028
|
+
writeDomain: writeDomain(join11(path, "domains")),
|
|
937
1029
|
/**
|
|
938
1030
|
* Returns a domain from EventCatalog
|
|
939
1031
|
* @param id - The id of the domain to retrieve
|
|
940
1032
|
* @param version - Optional id of the version to get (supports semver)
|
|
941
1033
|
* @returns Domain|Undefined
|
|
942
1034
|
*/
|
|
943
|
-
getDomain: getDomain(
|
|
1035
|
+
getDomain: getDomain(join11(path, "domains")),
|
|
944
1036
|
/**
|
|
945
1037
|
* Returns all domains from EventCatalog
|
|
946
1038
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
947
1039
|
* @returns Domain[]|Undefined
|
|
948
1040
|
*/
|
|
949
|
-
getDomains: getDomains(
|
|
1041
|
+
getDomains: getDomains(join11(path)),
|
|
950
1042
|
/**
|
|
951
1043
|
* Moves a given domain id to the version directory
|
|
952
1044
|
* @param directory
|
|
953
1045
|
*/
|
|
954
|
-
versionDomain: versionDomain(
|
|
1046
|
+
versionDomain: versionDomain(join11(path, "domains")),
|
|
955
1047
|
/**
|
|
956
1048
|
* Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
|
|
957
1049
|
*
|
|
958
1050
|
* @param path - The path to your domain, e.g. `/Payment`
|
|
959
1051
|
*
|
|
960
1052
|
*/
|
|
961
|
-
rmDomain: rmDomain(
|
|
1053
|
+
rmDomain: rmDomain(join11(path, "domains")),
|
|
962
1054
|
/**
|
|
963
1055
|
* Remove an service by an domain id
|
|
964
1056
|
*
|
|
965
1057
|
* @param id - The id of the domain you want to remove
|
|
966
1058
|
*
|
|
967
1059
|
*/
|
|
968
|
-
rmDomainById: rmDomainById(
|
|
1060
|
+
rmDomainById: rmDomainById(join11(path, "domains")),
|
|
969
1061
|
/**
|
|
970
1062
|
* Adds a file to the given domain
|
|
971
1063
|
* @param id - The id of the domain to add the file to
|
|
@@ -973,14 +1065,14 @@ var src_default = (path) => {
|
|
|
973
1065
|
* @param version - Optional version of the domain to add the file to
|
|
974
1066
|
* @returns
|
|
975
1067
|
*/
|
|
976
|
-
addFileToDomain: addFileToDomain(
|
|
1068
|
+
addFileToDomain: addFileToDomain(join11(path, "domains")),
|
|
977
1069
|
/**
|
|
978
1070
|
* Check to see if a domain version exists
|
|
979
1071
|
* @param id - The id of the domain
|
|
980
1072
|
* @param version - The version of the domain (supports semver)
|
|
981
1073
|
* @returns
|
|
982
1074
|
*/
|
|
983
|
-
domainHasVersion: domainHasVersion(
|
|
1075
|
+
domainHasVersion: domainHasVersion(join11(path)),
|
|
984
1076
|
/**
|
|
985
1077
|
* Adds a given service to a domain
|
|
986
1078
|
* @param id - The id of the domain
|
|
@@ -988,7 +1080,69 @@ var src_default = (path) => {
|
|
|
988
1080
|
* @param version - (Optional) The version of the domain to add the service to
|
|
989
1081
|
* @returns
|
|
990
1082
|
*/
|
|
991
|
-
addServiceToDomain: addServiceToDomain(
|
|
1083
|
+
addServiceToDomain: addServiceToDomain(join11(path, "domains")),
|
|
1084
|
+
/**
|
|
1085
|
+
* ================================
|
|
1086
|
+
* Teams
|
|
1087
|
+
* ================================
|
|
1088
|
+
*/
|
|
1089
|
+
/**
|
|
1090
|
+
* Adds a team to EventCatalog
|
|
1091
|
+
*
|
|
1092
|
+
* @param team - The team to write
|
|
1093
|
+
* @param options - Optional options to write the team
|
|
1094
|
+
*
|
|
1095
|
+
*/
|
|
1096
|
+
writeTeam: writeTeam(join11(path, "teams")),
|
|
1097
|
+
/**
|
|
1098
|
+
* Returns a team from EventCatalog
|
|
1099
|
+
* @param id - The id of the team to retrieve
|
|
1100
|
+
* @returns Team|Undefined
|
|
1101
|
+
*/
|
|
1102
|
+
getTeam: getTeam(join11(path, "teams")),
|
|
1103
|
+
/**
|
|
1104
|
+
* Returns all teams from EventCatalog
|
|
1105
|
+
* @returns Team[]|Undefined
|
|
1106
|
+
*/
|
|
1107
|
+
getTeams: getTeams(join11(path)),
|
|
1108
|
+
/**
|
|
1109
|
+
* Remove a team by the team id
|
|
1110
|
+
*
|
|
1111
|
+
* @param id - The id of the team you want to remove
|
|
1112
|
+
*
|
|
1113
|
+
*/
|
|
1114
|
+
rmTeamById: rmTeamById(join11(path, "teams")),
|
|
1115
|
+
/**
|
|
1116
|
+
* ================================
|
|
1117
|
+
* Users
|
|
1118
|
+
* ================================
|
|
1119
|
+
*/
|
|
1120
|
+
/**
|
|
1121
|
+
* Adds a user to EventCatalog
|
|
1122
|
+
*
|
|
1123
|
+
* @param user - The user to write
|
|
1124
|
+
* @param options - Optional options to write the user
|
|
1125
|
+
*
|
|
1126
|
+
*/
|
|
1127
|
+
writeUser: writeUser(join11(path, "users")),
|
|
1128
|
+
/**
|
|
1129
|
+
* Returns a user from EventCatalog
|
|
1130
|
+
* @param id - The id of the user to retrieve
|
|
1131
|
+
* @returns User|Undefined
|
|
1132
|
+
*/
|
|
1133
|
+
getUser: getUser(join11(path, "users")),
|
|
1134
|
+
/**
|
|
1135
|
+
* Returns all user from EventCatalog
|
|
1136
|
+
* @returns User[]|Undefined
|
|
1137
|
+
*/
|
|
1138
|
+
getUsers: getUsers(join11(path)),
|
|
1139
|
+
/**
|
|
1140
|
+
* Remove a user by the user id
|
|
1141
|
+
*
|
|
1142
|
+
* @param id - The id of the user you want to remove
|
|
1143
|
+
*
|
|
1144
|
+
*/
|
|
1145
|
+
rmUserById: rmUserById(join11(path, "users"))
|
|
992
1146
|
};
|
|
993
1147
|
};
|
|
994
1148
|
export {
|