Skip to content

BaselineTransferModel

Defined in: packages/core/src/models/baseline-transfer.ts:28

Export/import of baselines between StoryShelf instances (or for backup).

new BaselineTransferModel(db, storage, tables?): BaselineTransferModel

Defined in: packages/core/src/models/baseline-transfer.ts:34

DatabaseAdapter

StorageAdapter

BaselineTables

BaselineTransferModel

export(projectId, options?): Promise<AsyncIterable<Buffer<ArrayBufferLike>, any, any>>

Defined in: packages/core/src/models/baseline-transfer.ts:46

Stream the project’s baselines (optionally one branch) as a zip archive.

string

BaselineExportOptions = {}

Promise<AsyncIterable<Buffer<ArrayBufferLike>, any, any>>

Before streaming, when over the archive entry limit.


import(projectId, archive): Promise<BaselineImportResult>

Defined in: packages/core/src/models/baseline-transfer.ts:63

Upsert every baseline in archive into the project. The whole archive is validated before anything is written; images are then stored (idempotent, safe to retry) and all rows are applied in one transaction when the driver supports it, so a failure leaves the rows untouched. Imports into the same project run one at a time. Imported rows keep their original timestamps; snapshotId is cleared because snapshots are not portable.

string

Buffer

Promise<BaselineImportResult>

On a malformed, unsafe, or inconsistent archive.