Skip to main content

Function: writeServiceToDomain()

writeServiceToDomain(directory): (service, domain, options) => Promise<void>

Defined in: services.ts:212

Write a service to a domain in EventCatalog.

Parameters

ParameterType
directorystring

Returns

Function

Parameters

ParameterType
serviceService
domain{ direction: string; id: string; version: string; }
domain.direction?string
domain.idstring
domain.version?string
options{ format: "md" | "mdx"; override: boolean; path: string; }
options.format?"md" | "mdx"
options.override?boolean
options.path?string

Returns

Promise<void>

Example

import utils from '@eventcatalog/utils';

const { writeServiceToDomain } = utils('/path/to/eventcatalog');

// Write a service to a domain
// Service would be written to domains/Shopping/services/InventoryService
await writeServiceToDomain({
id: 'InventoryService',
name: 'Inventory Service',
version: '0.0.1',
summary: 'Service that handles the inventory',
markdown: '# Hello world',
}, { id: 'Shopping' });