Reference a specific version of a record.
const versionLink = {
entity: "alice.baq.run",
recordId: "23f2e13ee0424209a471a6bc3b7819f9",
versionHash: "55f91f26ce2d4ca9836fff702a4ac38c84274f12fa6a40528f039e3b78b9bd47",
};
new(entity, recordId, versionHash)
: VersionLink
entity
Entity
originalEntity
Entity optional
recordId
RecordId
versionHash
VersionHash
Linking to a specific version is useful when we want the linked data to be immutable. Here we create a Bookmark record with a link to a specific version of a blog post record.
import {VersionLink} from "@baqhub/sdk";
import {BookmarkRecord} from "./baq/bookmarkRecord.js";
const blogVersionLink = VersionLink.new(
"baq.news.io",
"46edb6353d83434caa7d297668ec057e",
"8fa743e7285f46cfbd4532b39cfdc8bcde4acbe054f04cc98e2bf16517255459"
);
const bookmarkRecord = BookmarkRecord.new("taylor.baq.run", {
target: blogVersionLink,
});