Skip to main content

Function: dataStoreHasVersion()

dataStoreHasVersion(directory): (id, version?) => Promise<boolean>

Defined in: data-stores.ts:122

Check to see if the catalog has a version for the given data store (e.g. database, cache, etc.).

Parameters

ParameterType
directorystring

Returns

Function

Parameters

ParameterType
idstring
version?string

Returns

Promise<boolean>

Examples

import utils from '@eventcatalog/utils';

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

// returns true if version is found for the given data store and version (supports semver)
await dataStoreHasVersion('orders-db', '0.0.1');
await dataStoreHasVersion('orders-db', 'latest');
await dataStoreHasVersion('orders-db', '0.0.x');

import utils from '@eventcatalog/utils';

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

// returns true if version is found for the given entity and version (supports semver)
await containerHasVersion('orders-db', '0.0.1');
await containerHasVersion('orders-db', 'latest');
await containerHasVersion('orders-db', '0.0.x');