Skip to main content

Function: versionDataProduct()

versionDataProduct(directory): (id) => Promise<void>

Defined in: data-products.ts:220

Version a data product by its id.

Takes the latest data product and moves it to a versioned directory. All files with this data product are also versioned (e.g /data-products/CustomerDataProduct/schema.json)

Parameters​

ParameterType
directorystring

Returns​

Function

Parameters​

ParameterType
idstring

Returns​

Promise<void>

Example​

import utils from '@eventcatalog/utils';

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

// moves the latest CustomerDataProduct data product to a versioned directory
// the version within that data product is used as the version number.
await versionDataProduct('CustomerDataProduct');