Function: addFileToService()
addFileToService(
directory): (id,file,version?) =>Promise<void>
Defined in: services.ts:308
Add a file to a service by it's id.
Optionally specify a version to add a file to a specific version of the service.
Parameters
| Parameter | Type |
|---|---|
directory | string |
Returns
Function
Parameters
| Parameter | Type |
|---|---|
id | string |
file | { content: string; fileName: string; } |
file.content | string |
file.fileName? | string |
version? | string |
Returns
Promise<void>
Example
import utils from '@eventcatalog/utils';
const { addFileToService } = utils('/path/to/eventcatalog');
// adds a file to the latest InventoryService event
await addFileToService('InventoryService', { content: 'Hello world', fileName: 'hello.txt' });
// adds a file to a specific version of the InventoryService event
await addFileToService('InventoryService', { content: 'Hello world', fileName: 'hello.txt' }, '0.0.1');