Function: versionEvent()
versionEvent(
directory): (id) =>Promise<void>
Defined in: events.ts:230
Version an event by it's id.
Takes the latest event and moves it to a versioned directory. All files with this event are also versioned (e.g /events/InventoryAdjusted/schema.json)
Parameters
| Parameter | Type |
|---|---|
directory | string |
Returns
Function
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<void>
Example
import utils from '@eventcatalog/utils';
const { versionEvent } = utils('/path/to/eventcatalog');
// moves the latest InventoryAdjusted event to a versioned directory
// the version within that event is used as the version number.
await versionEvent('InventoryAdjusted');