Skip to main content

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

ParameterType
directorystring

Returns

Function

Parameters

ParameterType
idstring

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');