Skip to main content

versionEntity

Callable

  • versionEntity(directory: string): (id: string) => Promise<void>

  • Version an entity by its id.

    Takes the latest entity and moves it to a versioned directory. All files with this entity are also versioned (e.g /entities/User/schema.json)

    @example
    import utils from '@eventcatalog/utils';

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

    // moves the latest User entity to a versioned directory
    // the version within that entity is used as the version number.
    await versionEntity('User');