@eventcatalog/sdk 1.1.4 → 1.2.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/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 import_node_path7 = require("path");
36
+ var import_node_path8 = require("path");
37
37
 
38
38
  // src/events.ts
39
39
  var import_promises3 = __toESM(require("fs/promises"));
@@ -389,6 +389,51 @@ var addServiceToDomain = (directory) => async (id, service, version) => {
389
389
  await writeDomain(directory)(domain);
390
390
  };
391
391
 
392
+ // src/channels.ts
393
+ var import_promises8 = __toESM(require("fs/promises"));
394
+ var import_node_path7 = require("path");
395
+ var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
396
+ var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
397
+ var rmChannel = (directory) => async (path) => {
398
+ await import_promises8.default.rm((0, import_node_path7.join)(directory, path), { recursive: true });
399
+ };
400
+ var rmChannelById = (directory) => async (id, version) => rmResourceById(directory, id, version, { type: "channel" });
401
+ var versionChannel = (directory) => async (id) => versionResource(directory, id);
402
+ var channelHasVersion = (directory) => async (id, version) => {
403
+ const file = await findFileById(directory, id, version);
404
+ return !!file;
405
+ };
406
+ var addMessageToChannel = (directory, collection) => async (id, _message, version) => {
407
+ let channel = await getChannel(directory)(id, version);
408
+ const functions = {
409
+ events: {
410
+ getMessage: getEvent,
411
+ rmMessageById: rmEventById,
412
+ writeMessage: writeEvent
413
+ },
414
+ commands: {
415
+ getMessage: getCommand,
416
+ rmMessageById: rmCommandById,
417
+ writeMessage: writeCommand
418
+ },
419
+ queries: {
420
+ getMessage: getQuery,
421
+ rmMessageById: rmQueryById,
422
+ writeMessage: writeQuery
423
+ }
424
+ };
425
+ const { getMessage, rmMessageById, writeMessage } = functions[collection];
426
+ const message = await getMessage(directory)(_message.id, _message.version);
427
+ if (!message) throw new Error(`Message ${_message.id} with version ${_message.version} not found`);
428
+ if (message.channels === void 0) {
429
+ message.channels = [];
430
+ }
431
+ const channelInfo = { id, version: channel.version, ..._message.parameters && { parameters: _message.parameters } };
432
+ message.channels.push(channelInfo);
433
+ await rmMessageById(directory)(_message.id, _message.version);
434
+ await writeMessage(directory)(message);
435
+ };
436
+
392
437
  // src/index.ts
393
438
  var src_default = (path) => {
394
439
  return {
@@ -398,7 +443,7 @@ var src_default = (path) => {
398
443
  * @param version - Optional id of the version to get (supports semver)
399
444
  * @returns Event|Undefined
400
445
  */
401
- getEvent: getEvent((0, import_node_path7.join)(path)),
446
+ getEvent: getEvent((0, import_node_path8.join)(path)),
402
447
  /**
403
448
  * Adds an event to EventCatalog
404
449
  *
@@ -406,7 +451,7 @@ var src_default = (path) => {
406
451
  * @param options - Optional options to write the event
407
452
  *
408
453
  */
409
- writeEvent: writeEvent((0, import_node_path7.join)(path, "events")),
454
+ writeEvent: writeEvent((0, import_node_path8.join)(path, "events")),
410
455
  /**
411
456
  * Adds an event to a service in EventCatalog
412
457
  *
@@ -415,26 +460,26 @@ var src_default = (path) => {
415
460
  * @param options - Optional options to write the event
416
461
  *
417
462
  */
418
- writeEventToService: writeEventToService((0, import_node_path7.join)(path, "services")),
463
+ writeEventToService: writeEventToService((0, import_node_path8.join)(path, "services")),
419
464
  /**
420
465
  * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
421
466
  *
422
467
  * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
423
468
  *
424
469
  */
425
- rmEvent: rmEvent((0, import_node_path7.join)(path, "events")),
470
+ rmEvent: rmEvent((0, import_node_path8.join)(path, "events")),
426
471
  /**
427
472
  * Remove an event by an Event id
428
473
  *
429
474
  * @param id - The id of the event you want to remove
430
475
  *
431
476
  */
432
- rmEventById: rmEventById((0, import_node_path7.join)(path)),
477
+ rmEventById: rmEventById((0, import_node_path8.join)(path)),
433
478
  /**
434
479
  * Moves a given event id to the version directory
435
480
  * @param directory
436
481
  */
437
- versionEvent: versionEvent((0, import_node_path7.join)(path)),
482
+ versionEvent: versionEvent((0, import_node_path8.join)(path)),
438
483
  /**
439
484
  * Adds a file to the given event
440
485
  * @param id - The id of the event to add the file to
@@ -442,7 +487,7 @@ var src_default = (path) => {
442
487
  * @param version - Optional version of the event to add the file to
443
488
  * @returns
444
489
  */
445
- addFileToEvent: addFileToEvent((0, import_node_path7.join)(path)),
490
+ addFileToEvent: addFileToEvent((0, import_node_path8.join)(path)),
446
491
  /**
447
492
  * Adds a schema to the given event
448
493
  * @param id - The id of the event to add the schema to
@@ -450,14 +495,14 @@ var src_default = (path) => {
450
495
  * @param version - Optional version of the event to add the schema to
451
496
  * @returns
452
497
  */
453
- addSchemaToEvent: addSchemaToEvent((0, import_node_path7.join)(path)),
498
+ addSchemaToEvent: addSchemaToEvent((0, import_node_path8.join)(path)),
454
499
  /**
455
500
  * Check to see if an event version exists
456
501
  * @param id - The id of the event
457
502
  * @param version - The version of the event (supports semver)
458
503
  * @returns
459
504
  */
460
- eventHasVersion: eventHasVersion((0, import_node_path7.join)(path)),
505
+ eventHasVersion: eventHasVersion((0, import_node_path8.join)(path)),
461
506
  /**
462
507
  * ================================
463
508
  * Commands
@@ -469,7 +514,7 @@ var src_default = (path) => {
469
514
  * @param version - Optional id of the version to get (supports semver)
470
515
  * @returns Command|Undefined
471
516
  */
472
- getCommand: getCommand((0, import_node_path7.join)(path)),
517
+ getCommand: getCommand((0, import_node_path8.join)(path)),
473
518
  /**
474
519
  * Adds an command to EventCatalog
475
520
  *
@@ -477,7 +522,7 @@ var src_default = (path) => {
477
522
  * @param options - Optional options to write the command
478
523
  *
479
524
  */
480
- writeCommand: writeCommand((0, import_node_path7.join)(path, "commands")),
525
+ writeCommand: writeCommand((0, import_node_path8.join)(path, "commands")),
481
526
  /**
482
527
  * Adds a command to a service in EventCatalog
483
528
  *
@@ -486,26 +531,26 @@ var src_default = (path) => {
486
531
  * @param options - Optional options to write the command
487
532
  *
488
533
  */
489
- writeCommandToService: writeCommandToService((0, import_node_path7.join)(path, "services")),
534
+ writeCommandToService: writeCommandToService((0, import_node_path8.join)(path, "services")),
490
535
  /**
491
536
  * Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
492
537
  *
493
538
  * @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
494
539
  *
495
540
  */
496
- rmCommand: rmCommand((0, import_node_path7.join)(path, "commands")),
541
+ rmCommand: rmCommand((0, import_node_path8.join)(path, "commands")),
497
542
  /**
498
543
  * Remove an command by an Event id
499
544
  *
500
545
  * @param id - The id of the command you want to remove
501
546
  *
502
547
  */
503
- rmCommandById: rmCommandById((0, import_node_path7.join)(path)),
548
+ rmCommandById: rmCommandById((0, import_node_path8.join)(path)),
504
549
  /**
505
550
  * Moves a given command id to the version directory
506
551
  * @param directory
507
552
  */
508
- versionCommand: versionCommand((0, import_node_path7.join)(path)),
553
+ versionCommand: versionCommand((0, import_node_path8.join)(path)),
509
554
  /**
510
555
  * Adds a file to the given command
511
556
  * @param id - The id of the command to add the file to
@@ -513,7 +558,7 @@ var src_default = (path) => {
513
558
  * @param version - Optional version of the command to add the file to
514
559
  * @returns
515
560
  */
516
- addFileToCommand: addFileToCommand((0, import_node_path7.join)(path)),
561
+ addFileToCommand: addFileToCommand((0, import_node_path8.join)(path)),
517
562
  /**
518
563
  * Adds a schema to the given command
519
564
  * @param id - The id of the command to add the schema to
@@ -521,14 +566,14 @@ var src_default = (path) => {
521
566
  * @param version - Optional version of the command to add the schema to
522
567
  * @returns
523
568
  */
524
- addSchemaToCommand: addSchemaToCommand((0, import_node_path7.join)(path)),
569
+ addSchemaToCommand: addSchemaToCommand((0, import_node_path8.join)(path)),
525
570
  /**
526
571
  * Check to see if a command version exists
527
572
  * @param id - The id of the command
528
573
  * @param version - The version of the command (supports semver)
529
574
  * @returns
530
575
  */
531
- commandHasVersion: commandHasVersion((0, import_node_path7.join)(path)),
576
+ commandHasVersion: commandHasVersion((0, import_node_path8.join)(path)),
532
577
  /**
533
578
  * ================================
534
579
  * Queries
@@ -540,7 +585,7 @@ var src_default = (path) => {
540
585
  * @param version - Optional id of the version to get (supports semver)
541
586
  * @returns Query|Undefined
542
587
  */
543
- getQuery: getQuery((0, import_node_path7.join)(path)),
588
+ getQuery: getQuery((0, import_node_path8.join)(path)),
544
589
  /**
545
590
  * Adds a query to EventCatalog
546
591
  *
@@ -548,7 +593,7 @@ var src_default = (path) => {
548
593
  * @param options - Optional options to write the event
549
594
  *
550
595
  */
551
- writeQuery: writeQuery((0, import_node_path7.join)(path, "queries")),
596
+ writeQuery: writeQuery((0, import_node_path8.join)(path, "queries")),
552
597
  /**
553
598
  * Adds a query to a service in EventCatalog
554
599
  *
@@ -557,26 +602,26 @@ var src_default = (path) => {
557
602
  * @param options - Optional options to write the query
558
603
  *
559
604
  */
560
- writeQueryToService: writeQueryToService((0, import_node_path7.join)(path, "services")),
605
+ writeQueryToService: writeQueryToService((0, import_node_path8.join)(path, "services")),
561
606
  /**
562
607
  * Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
563
608
  *
564
609
  * @param path - The path to your query, e.g. `/Orders/GetOrder`
565
610
  *
566
611
  */
567
- rmQuery: rmQuery((0, import_node_path7.join)(path, "queries")),
612
+ rmQuery: rmQuery((0, import_node_path8.join)(path, "queries")),
568
613
  /**
569
614
  * Remove a query by a Query id
570
615
  *
571
616
  * @param id - The id of the query you want to remove
572
617
  *
573
618
  */
574
- rmQueryById: rmQueryById((0, import_node_path7.join)(path)),
619
+ rmQueryById: rmQueryById((0, import_node_path8.join)(path)),
575
620
  /**
576
621
  * Moves a given query id to the version directory
577
622
  * @param directory
578
623
  */
579
- versionQuery: versionQuery((0, import_node_path7.join)(path)),
624
+ versionQuery: versionQuery((0, import_node_path8.join)(path)),
580
625
  /**
581
626
  * Adds a file to the given query
582
627
  * @param id - The id of the query to add the file to
@@ -584,7 +629,7 @@ var src_default = (path) => {
584
629
  * @param version - Optional version of the query to add the file to
585
630
  * @returns
586
631
  */
587
- addFileToQuery: addFileToQuery((0, import_node_path7.join)(path)),
632
+ addFileToQuery: addFileToQuery((0, import_node_path8.join)(path)),
588
633
  /**
589
634
  * Adds a schema to the given query
590
635
  * @param id - The id of the query to add the schema to
@@ -592,14 +637,111 @@ var src_default = (path) => {
592
637
  * @param version - Optional version of the query to add the schema to
593
638
  * @returns
594
639
  */
595
- addSchemaToQuery: addSchemaToQuery((0, import_node_path7.join)(path)),
640
+ addSchemaToQuery: addSchemaToQuery((0, import_node_path8.join)(path)),
596
641
  /**
597
642
  * Check to see if an query version exists
598
643
  * @param id - The id of the query
599
644
  * @param version - The version of the query (supports semver)
600
645
  * @returns
601
646
  */
602
- queryHasVersion: queryHasVersion((0, import_node_path7.join)(path)),
647
+ queryHasVersion: queryHasVersion((0, import_node_path8.join)(path)),
648
+ /**
649
+ * ================================
650
+ * Channels
651
+ * ================================
652
+ */
653
+ /**
654
+ * Returns a channel from EventCatalog
655
+ * @param id - The id of the channel to retrieve
656
+ * @param version - Optional id of the version to get (supports semver)
657
+ * @returns Channel|Undefined
658
+ */
659
+ getChannel: getChannel((0, import_node_path8.join)(path)),
660
+ /**
661
+ * Adds an channel to EventCatalog
662
+ *
663
+ * @param command - The channel to write
664
+ * @param options - Optional options to write the channel
665
+ *
666
+ */
667
+ writeChannel: writeChannel((0, import_node_path8.join)(path, "channels")),
668
+ /**
669
+ * Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
670
+ *
671
+ * @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
672
+ *
673
+ */
674
+ rmChannel: rmChannel((0, import_node_path8.join)(path, "channels")),
675
+ /**
676
+ * Remove an channel by an Event id
677
+ *
678
+ * @param id - The id of the channel you want to remove
679
+ *
680
+ */
681
+ rmChannelById: rmChannelById((0, import_node_path8.join)(path)),
682
+ /**
683
+ * Moves a given channel id to the version directory
684
+ * @param directory
685
+ */
686
+ versionChannel: versionChannel((0, import_node_path8.join)(path)),
687
+ /**
688
+ * Check to see if a channel version exists
689
+ * @param id - The id of the channel
690
+ * @param version - The version of the channel (supports semver)
691
+ * @returns
692
+ */
693
+ channelHasVersion: channelHasVersion((0, import_node_path8.join)(path)),
694
+ /**
695
+ * Add a channel to an event
696
+ *
697
+ * Optionally specify a version to add the channel to a specific version of the event.
698
+ *
699
+ * @example
700
+ * ```ts
701
+ * import utils from '@eventcatalog/utils';
702
+ *
703
+ * const { addEventToChannel } = utils('/path/to/eventcatalog');
704
+ *
705
+ * // adds a new event (InventoryUpdatedEvent) to the inventory.{env}.events channel
706
+ * await addEventToChannel('inventory.{env}.events channel', { id: 'InventoryUpdatedEvent', version: '2.0.0', parameters: { env: 'dev' } });
707
+ *
708
+ * ```
709
+ */
710
+ addEventToChannel: addMessageToChannel((0, import_node_path8.join)(path), "events"),
711
+ /**
712
+ * Add a channel to an command
713
+ *
714
+ * Optionally specify a version to add the channel to a specific version of the command.
715
+ *
716
+ * @example
717
+ * ```ts
718
+ * import utils from '@eventcatalog/utils';
719
+ *
720
+ * const { addCommandToChannel } = utils('/path/to/eventcatalog');
721
+ *
722
+ * // adds a new command (UpdateInventory) to the inventory.{env}.events channel
723
+ * await addCommandToChannel('inventory.{env}.events channel', { id: 'UpdateInventory', version: '2.0.0', parameters: { env: 'dev' } });
724
+ *
725
+ * ```
726
+ */
727
+ addCommandToChannel: addMessageToChannel((0, import_node_path8.join)(path), "commands"),
728
+ /**
729
+ * Add a channel to an query
730
+ *
731
+ * Optionally specify a version to add the channel to a specific version of the query.
732
+ *
733
+ * @example
734
+ * ```ts
735
+ * import utils from '@eventcatalog/utils';
736
+ *
737
+ * const { addQueryToChannel } = utils('/path/to/eventcatalog');
738
+ *
739
+ * // adds a new query (GetInventory) to the inventory.{env}.events channel
740
+ * await addQueryToChannel('inventory.{env}.events channel', { id: 'GetInventory', version: '2.0.0', parameters: { env: 'dev' } });
741
+ *
742
+ * ```
743
+ */
744
+ addQueryToChannel: addMessageToChannel((0, import_node_path8.join)(path), "queries"),
603
745
  /**
604
746
  * ================================
605
747
  * SERVICES
@@ -612,14 +754,14 @@ var src_default = (path) => {
612
754
  * @param options - Optional options to write the event
613
755
  *
614
756
  */
615
- writeService: writeService((0, import_node_path7.join)(path, "services")),
757
+ writeService: writeService((0, import_node_path8.join)(path, "services")),
616
758
  /**
617
759
  * Adds a versioned service to EventCatalog
618
760
  *
619
761
  * @param service - The service to write
620
762
  *
621
763
  */
622
- writeVersionedService: writeVersionedService((0, import_node_path7.join)(path, "services")),
764
+ writeVersionedService: writeVersionedService((0, import_node_path8.join)(path, "services")),
623
765
  /**
624
766
  * Adds a service to a domain in EventCatalog
625
767
  *
@@ -628,33 +770,33 @@ var src_default = (path) => {
628
770
  * @param options - Optional options to write the event
629
771
  *
630
772
  */
631
- writeServiceToDomain: writeServiceToDomain((0, import_node_path7.join)(path, "domains")),
773
+ writeServiceToDomain: writeServiceToDomain((0, import_node_path8.join)(path, "domains")),
632
774
  /**
633
775
  * Returns a service from EventCatalog
634
776
  * @param id - The id of the service to retrieve
635
777
  * @param version - Optional id of the version to get (supports semver)
636
778
  * @returns Service|Undefined
637
779
  */
638
- getService: getService((0, import_node_path7.join)(path)),
780
+ getService: getService((0, import_node_path8.join)(path)),
639
781
  /**
640
782
  * Moves a given service id to the version directory
641
783
  * @param directory
642
784
  */
643
- versionService: versionService((0, import_node_path7.join)(path)),
785
+ versionService: versionService((0, import_node_path8.join)(path)),
644
786
  /**
645
787
  * Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
646
788
  *
647
789
  * @param path - The path to your service, e.g. `/InventoryService`
648
790
  *
649
791
  */
650
- rmService: rmService((0, import_node_path7.join)(path, "services")),
792
+ rmService: rmService((0, import_node_path8.join)(path, "services")),
651
793
  /**
652
794
  * Remove an service by an service id
653
795
  *
654
796
  * @param id - The id of the service you want to remove
655
797
  *
656
798
  */
657
- rmServiceById: rmServiceById((0, import_node_path7.join)(path)),
799
+ rmServiceById: rmServiceById((0, import_node_path8.join)(path)),
658
800
  /**
659
801
  * Adds a file to the given service
660
802
  * @param id - The id of the service to add the file to
@@ -662,21 +804,81 @@ var src_default = (path) => {
662
804
  * @param version - Optional version of the service to add the file to
663
805
  * @returns
664
806
  */
665
- addFileToService: addFileToService((0, import_node_path7.join)(path)),
807
+ addFileToService: addFileToService((0, import_node_path8.join)(path)),
666
808
  /**
667
809
  * Returns the specifications for a given service
668
810
  * @param id - The id of the service to retrieve the specifications for
669
811
  * @param version - Optional version of the service
670
812
  * @returns
671
813
  */
672
- getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path7.join)(path)),
814
+ getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path8.join)(path)),
673
815
  /**
674
816
  * Check to see if a service version exists
675
817
  * @param id - The id of the service
676
818
  * @param version - The version of the service (supports semver)
677
819
  * @returns
678
820
  */
679
- serviceHasVersion: serviceHasVersion((0, import_node_path7.join)(path)),
821
+ serviceHasVersion: serviceHasVersion((0, import_node_path8.join)(path)),
822
+ /**
823
+ * Add an event to a service by it's id.
824
+ *
825
+ * Optionally specify a version to add the event to a specific version of the service.
826
+ *
827
+ * @example
828
+ * ```ts
829
+ * import utils from '@eventcatalog/utils';
830
+ *
831
+ * const { addEventToService } = utils('/path/to/eventcatalog');
832
+ *
833
+ * // adds a new event (InventoryUpdatedEvent) that the InventoryService will send
834
+ * await addEventToService('InventoryService', 'sends', { event: 'InventoryUpdatedEvent', version: '2.0.0' });
835
+ *
836
+ * // adds a new event (OrderComplete) that the InventoryService will receive
837
+ * await addEventToService('InventoryService', 'receives', { event: 'OrderComplete', version: '2.0.0' });
838
+ *
839
+ * ```
840
+ */
841
+ addEventToService: addMessageToService((0, import_node_path8.join)(path)),
842
+ /**
843
+ * Add a command to a service by it's id.
844
+ *
845
+ * Optionally specify a version to add the event to a specific version of the service.
846
+ *
847
+ * @example
848
+ * ```ts
849
+ * import utils from '@eventcatalog/utils';
850
+ *
851
+ * const { addCommandToService } = utils('/path/to/eventcatalog');
852
+ *
853
+ * // adds a new command (UpdateInventoryCommand) that the InventoryService will send
854
+ * await addCommandToService('InventoryService', 'sends', { command: 'UpdateInventoryCommand', version: '2.0.0' });
855
+ *
856
+ * // adds a new command (VerifyInventory) that the InventoryService will receive
857
+ * await addCommandToService('InventoryService', 'receives', { command: 'VerifyInventory', version: '2.0.0' });
858
+ *
859
+ * ```
860
+ */
861
+ addCommandToService: addMessageToService((0, import_node_path8.join)(path)),
862
+ /**
863
+ * Add a query to a service by it's id.
864
+ *
865
+ * Optionally specify a version to add the event to a specific version of the service.
866
+ *
867
+ * @example
868
+ * ```ts
869
+ * import utils from '@eventcatalog/utils';
870
+ *
871
+ * const { addQueryToService } = utils('/path/to/eventcatalog');
872
+ *
873
+ * // adds a new query (UpdateInventory) that the InventoryService will send
874
+ * await addQueryToService('InventoryService', 'sends', { command: 'UpdateInventory', version: '2.0.0' });
875
+ *
876
+ * // adds a new command (VerifyInventory) that the InventoryService will receive
877
+ * await addQueryToService('InventoryService', 'receives', { command: 'VerifyInventory', version: '2.0.0' });
878
+ *
879
+ * ```
880
+ */
881
+ addQueryToService: addMessageToService((0, import_node_path8.join)(path)),
680
882
  /**
681
883
  * ================================
682
884
  * Domains
@@ -689,33 +891,33 @@ var src_default = (path) => {
689
891
  * @param options - Optional options to write the event
690
892
  *
691
893
  */
692
- writeDomain: writeDomain((0, import_node_path7.join)(path, "domains")),
894
+ writeDomain: writeDomain((0, import_node_path8.join)(path, "domains")),
693
895
  /**
694
896
  * Returns a domain from EventCatalog
695
897
  * @param id - The id of the domain to retrieve
696
898
  * @param version - Optional id of the version to get (supports semver)
697
899
  * @returns Domain|Undefined
698
900
  */
699
- getDomain: getDomain((0, import_node_path7.join)(path, "domains")),
901
+ getDomain: getDomain((0, import_node_path8.join)(path, "domains")),
700
902
  /**
701
903
  * Moves a given domain id to the version directory
702
904
  * @param directory
703
905
  */
704
- versionDomain: versionDomain((0, import_node_path7.join)(path, "domains")),
906
+ versionDomain: versionDomain((0, import_node_path8.join)(path, "domains")),
705
907
  /**
706
908
  * Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
707
909
  *
708
910
  * @param path - The path to your domain, e.g. `/Payment`
709
911
  *
710
912
  */
711
- rmDomain: rmDomain((0, import_node_path7.join)(path, "domains")),
913
+ rmDomain: rmDomain((0, import_node_path8.join)(path, "domains")),
712
914
  /**
713
915
  * Remove an service by an domain id
714
916
  *
715
917
  * @param id - The id of the domain you want to remove
716
918
  *
717
919
  */
718
- rmDomainById: rmDomainById((0, import_node_path7.join)(path, "domains")),
920
+ rmDomainById: rmDomainById((0, import_node_path8.join)(path, "domains")),
719
921
  /**
720
922
  * Adds a file to the given domain
721
923
  * @param id - The id of the domain to add the file to
@@ -723,54 +925,14 @@ var src_default = (path) => {
723
925
  * @param version - Optional version of the domain to add the file to
724
926
  * @returns
725
927
  */
726
- addFileToDomain: addFileToDomain((0, import_node_path7.join)(path, "domains")),
727
- /**
728
- * Add an event to a service by it's id.
729
- *
730
- * Optionally specify a version to add the event to a specific version of the service.
731
- *
732
- * @example
733
- * ```ts
734
- * import utils from '@eventcatalog/utils';
735
- *
736
- * const { addEventToService } = utils('/path/to/eventcatalog');
737
- *
738
- * // adds a new event (InventoryUpdatedEvent) that the InventoryService will send
739
- * await addEventToService('InventoryService', 'sends', { event: 'InventoryUpdatedEvent', version: '2.0.0' });
740
- *
741
- * // adds a new event (OrderComplete) that the InventoryService will receive
742
- * await addEventToService('InventoryService', 'receives', { event: 'OrderComplete', version: '2.0.0' });
743
- *
744
- * ```
745
- */
746
- addEventToService: addMessageToService((0, import_node_path7.join)(path)),
747
- /**
748
- * Add a command to a service by it's id.
749
- *
750
- * Optionally specify a version to add the event to a specific version of the service.
751
- *
752
- * @example
753
- * ```ts
754
- * import utils from '@eventcatalog/utils';
755
- *
756
- * const { addCommandToService } = utils('/path/to/eventcatalog');
757
- *
758
- * // adds a new command (UpdateInventoryCommand) that the InventoryService will send
759
- * await addCommandToService('InventoryService', 'sends', { command: 'UpdateInventoryCommand', version: '2.0.0' });
760
- *
761
- * // adds a new command (VerifyInventory) that the InventoryService will receive
762
- * await addCommandToService('InventoryService', 'receives', { command: 'VerifyInventory', version: '2.0.0' });
763
- *
764
- * ```
765
- */
766
- addCommandToService: addMessageToService((0, import_node_path7.join)(path)),
928
+ addFileToDomain: addFileToDomain((0, import_node_path8.join)(path, "domains")),
767
929
  /**
768
930
  * Check to see if a domain version exists
769
931
  * @param id - The id of the domain
770
932
  * @param version - The version of the domain (supports semver)
771
933
  * @returns
772
934
  */
773
- domainHasVersion: domainHasVersion((0, import_node_path7.join)(path)),
935
+ domainHasVersion: domainHasVersion((0, import_node_path8.join)(path)),
774
936
  /**
775
937
  * Adds a given service to a domain
776
938
  * @param id - The id of the domain
@@ -778,7 +940,7 @@ var src_default = (path) => {
778
940
  * @param version - (Optional) The version of the domain to add the service to
779
941
  * @returns
780
942
  */
781
- addServiceToDomain: addServiceToDomain((0, import_node_path7.join)(path, "domains"))
943
+ addServiceToDomain: addServiceToDomain((0, import_node_path8.join)(path, "domains"))
782
944
  };
783
945
  };
784
946
  //# sourceMappingURL=index.js.map