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