JavaScript: Version history
Read the project configuration at any point in time, preview and apply a restore, manage timelines and snapshots with @sovaria/sdk.
Every change to policies, tables, functions, settings, buckets and keys is recorded on the project's timeline. These methods read it and take the project back. Background: Version history: see, undo and restore changes.
const at = '2026-10-15T09:00:00Z'
const plan = await sovaria.chrono.restorePlan(at)
console.log(plan.actions, plan.preview?.violations)
await sovaria.chrono.restore(at)sovaria.chrono
sovaria.chrono.state
The project's configuration (policies, schema, functions, settings, buckets, keys) at a commit or ISO time.
sovaria.chrono.state(
query?: { at?: string; prefix?: string; timeline?: string } = {},
): Promise<JsonObject>Parameters
query{ at?: string; prefix?: string; timeline?: string }optionaldefault{}at(commit id or ISO time; default now),prefix(policies/,schema/,functions/,settings/,storage/,keys/),timeline(defaultmain).
- Returns
Promise<JsonObject>- HTTP
GET /api/v1/chrono/state
sovaria.chrono.restorePlan
What going back to at changes, file by file, with who would gain or lose access.
sovaria.chrono.restorePlan(at: string, timeline?: string = 'main'): Promise<JsonObject>Writes nothing.
Parameters
atstringrequired- Commit id or ISO time.
timelinestringoptionaldefault'main'- Timeline name.
- Returns
Promise<JsonObject>— Each item that would change back, which are automatic and which manual, and who would gain or lose access. Writes nothing.- HTTP
POST /api/v1/chrono/restore-plan
sovaria.chrono.restore
Go back to at: applies the plan's automated changes with the caller's own permissions.
sovaria.chrono.restore(at: string, timeline?: string = 'main'): Promise<JsonObject>Parameters
atstringrequired- Commit id or ISO time.
timelinestringoptionaldefault'main'- Timeline name.
- Returns
Promise<JsonObject>- HTTP
POST /api/v1/chrono/restore
- Runs with the caller's permissions; the restore itself becomes a new commit.
sovaria.chrono.commit
Commit.
sovaria.chrono.commit(payload: JsonObject): Promise<JsonObject>Parameters
payloadJsonObjectrequired
- Returns
Promise<JsonObject>- HTTP
POST /api/v1/chrono/commit
sovaria.chrono.timelineSpawn
Timeline spawn.
sovaria.chrono.timelineSpawn(payload: JsonObject): Promise<JsonObject>Parameters
payloadJsonObjectrequired
- Returns
Promise<JsonObject>- HTTP
POST /api/v1/chrono/timelines/spawn
sovaria.chrono.timelineList
Timeline list.
sovaria.chrono.timelineList(): Promise<JsonObject>- Returns
Promise<JsonObject>- HTTP
GET /api/v1/chrono/timelines
sovaria.chrono.timelineDelete
Timeline delete.
sovaria.chrono.timelineDelete(name: string): Promise<JsonObject>Parameters
namestringrequired
- Returns
Promise<JsonObject>- HTTP
DELETE /api/v1/chrono/timelines/{…}
sovaria.chrono.timelineJump
Timeline jump.
sovaria.chrono.timelineJump(name: string, targetHex: string): Promise<JsonObject>Parameters
namestringrequiredtargetHexstringrequired
- Returns
Promise<JsonObject>- HTTP
POST /api/v1/chrono/timelines/{…}/jump
sovaria.chrono.timelineHistory
Timeline history.
sovaria.chrono.timelineHistory(
name: string,
limit?: number = 50,
offset?: number = 0,
): Promise<JsonObject>Parameters
namestringrequiredlimitnumberoptionaldefault50offsetnumberoptionaldefault0
- Returns
Promise<JsonObject>- HTTP
GET /api/v1/chrono/timelines/{…}/history
sovaria.chrono.topology
Topology.
sovaria.chrono.topology(timeline?: string = 'main', limit?: number = 50): Promise<JsonObject>Parameters
timelinestringoptionaldefault'main'limitnumberoptionaldefault50
- Returns
Promise<JsonObject>- HTTP
GET /api/v1/chrono/timelines/topology
sovaria.chrono.converge
Converge.
sovaria.chrono.converge(payload: JsonObject): Promise<JsonObject>Parameters
payloadJsonObjectrequired
- Returns
Promise<JsonObject>- HTTP
POST /api/v1/chrono/timelines/converge
sovaria.chrono.variance
Variance.
sovaria.chrono.variance(payload: JsonObject): Promise<JsonObject>Parameters
payloadJsonObjectrequired
- Returns
Promise<JsonObject>- HTTP
POST /api/v1/chrono/variance
sovaria.chrono.snapshotCreate
Snapshot create.
sovaria.chrono.snapshotCreate(payload: JsonObject): Promise<JsonObject>Parameters
payloadJsonObjectrequired
- Returns
Promise<JsonObject>- HTTP
POST /api/v1/chrono/snapshots/create
sovaria.chrono.snapshotList
Snapshot list.
sovaria.chrono.snapshotList(): Promise<JsonObject>- Returns
Promise<JsonObject>- HTTP
GET /api/v1/chrono/snapshots
sovaria.chrono.snapshotRestore
Snapshot restore.
sovaria.chrono.snapshotRestore(snapshotId: number): Promise<JsonObject>Parameters
snapshotIdnumberrequired
- Returns
Promise<JsonObject>- HTTP
POST /api/v1/chrono/snapshots/{…}/restore