Optionally specify a version to add the event to a specific version of the service.
@example
import utils from'@eventcatalog/utils'; // Adds an event to the service or command to the service const{ addEventToService, addCommandToService }=utils('/path/to/eventcatalog'); // Adds a new event (InventoryUpdatedEvent) that the InventoryService will send awaitaddEventToService('InventoryService','sends',{ event:'InventoryUpdatedEvent', version:'2.0.0'}); *// Adds a new event (OrderComplete) that the InventoryService will receive awaitaddEventToService('InventoryService','receives',{ event:'OrderComplete', version:'1.0.0'}); // Adds a new command (UpdateInventoryCommand) that the InventoryService will send awaitaddCommandToService('InventoryService','sends',{ command:'UpdateInventoryCommand', version:'2.0.0'}); // Adds a new command (VerifyInventory) that the InventoryService will receive awaitaddCommandToService('InventoryService','receives',{ command:'VerifyInventory', version:'1.0.0'});
Add an event/command to a service by it's id.
Optionally specify a version to add the event to a specific version of the service.