import utils from'@eventcatalog/utils'; // Adds a subdomain to the given domain const{ addSubDomainToDomain }=utils('/path/to/eventcatalog'); // Adds a subdomain (Payment Domain) to the domain (Orders) awaitaddSubDomainToDomain('Orders',{ service:'Payment Domain', version:'2.0.0'}); // Adds a subdomain (Inventory Domain) to the domain (Orders) with a specific version awaitaddSubDomainToDomain('Orders',{ service:'Inventory Domain', version:'2.0.0'},'1.0.0');
Add a subdomain to a domain by it's id. Optionally specify a version to add the subdomain to a specific version of the domain.
You can read the documentation about subdomains in the Subdomains documentation.