UNPKG

umzug-hyper-storage

Version:

A zero-dependency Storage Adapter for Umzug that uses a Hyper Data Service to track migrations

31 lines (30 loc) 1.01 kB
import type { MigrationParams, UmzugStorage } from 'umzug'; import type { HyperStorageArgs } from './types'; export declare class FromHyperError extends Error { constructor({ msg }: { msg?: string; }, _default?: string); } export declare class HyperStorage implements UmzugStorage { private readonly hyper; private readonly docId; private readonly docType; private readonly docTypeField; private readonly createdField; private readonly updatedField; constructor(args: HyperStorageArgs); /** * Logs migration to be considered as executed. */ logMigration({ name }: MigrationParams<unknown>): Promise<void>; /** * Unlogs migration (makes it to be considered as pending). */ unlogMigration({ name }: MigrationParams<unknown>): Promise<void>; /** * Gets list of executed migrations. */ executed(): Promise<string[]>; private _findOrCreateMigrationDoc; private _updateMigrationDoc; }