You can optionally overide the path of the domain.
@example
import utils from'@eventcatalog/utils'; const{ writeDomain }=utils('/path/to/eventcatalog'); // Write a domain // Domain would be written to domains/Payment awaitwriteDomain({ id:'Payment', name:'Payment domain', version:'0.0.1', summary:'Domain for all things to do with payments', markdown:'# Hello world', }); // Write a domain to the catalog but override the path // Domain would be written to domains/Inventory/Payment awaitwriteDomain({ id:'Payment', name:'Inventory Adjusted', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', },{ path:"/Inventory/Payment"}); // Write a domain to the catalog and override the existing content (if there is any) awaitwriteDomain({ id:'Payment', name:'Inventory Adjusted', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', },{ override:true}); // Write a domain to the catalog and version the previous version // only works if the new version is greater than the previous version awaitwriteDomain({ id:'Payment', name:'Inventory Adjusted', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', },{ versionExistingContent:true});
Write a domain to EventCatalog.
You can optionally overide the path of the domain.