You can optionally override the path of the channel.
@example
import utils from'@eventcatalog/utils'; const{ writeChannel }=utils('/path/to/eventcatalog'); // Write a channel to the catalog // channel would be written to channels/inventory.{env}.events awaitwriteChannel({ id:'inventory.{env}.events', name:'Inventory channel', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', address: inventory.{env}.events, protocols:['http'], }); // Write a channel to the catalog but override the path // channel would be written to channels/Inventory/InventoryChannel awaitwriteChannel({ id:'InventoryChannel', name:'Update Inventory', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', address: inventory.{env}.events, protocols:['http'], },{ path:"/channels/Inventory/InventoryChannel"}); // Write a channel to the catalog and override the existing content (if there is any) awaitwriteChannel({ id:'InventoryChannel', name:'Update Inventory', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', address: inventory.{env}.events, protocols:['http'], },{ override:true}); // Write a channel to the catalog and version the previous version // only works if the new version is greater than the previous version awaitwriteChannel({ id:'InventoryChannel', name:'Update Inventory', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', address: inventory.{env}.events, protocols:['http'], },{ versionExistingContent:true});
Write a channel to EventCatalog.
You can optionally override the path of the channel.