BaselineTransferModel
Defined in: packages/core/src/models/baseline-transfer.ts:28
Export/import of baselines between StoryShelf instances (or for backup).
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BaselineTransferModel(
db,storage,tables?):BaselineTransferModel
Defined in: packages/core/src/models/baseline-transfer.ts:34
Parameters
Section titled “Parameters”storage
Section titled “storage”tables?
Section titled “tables?”BaselineTables
Returns
Section titled “Returns”BaselineTransferModel
Methods
Section titled “Methods”export()
Section titled “export()”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.
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<AsyncIterable<Buffer<ArrayBufferLike>, any, any>>
Throws
Section titled “Throws”Before streaming, when over the archive entry limit.
import()
Section titled “import()”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.
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
archive
Section titled “archive”Buffer
Returns
Section titled “Returns”Promise<BaselineImportResult>
Throws
Section titled “Throws”On a malformed, unsafe, or inconsistent archive.