Snapshot
Datalayer Core / Snapshot
Class: Snapshot
Defined in: src/models/RuntimeSnapshotDTO.ts:132
Snapshot domain model that wraps API responses with convenient methods. Provides runtime snapshot management with data refresh and lifecycle operations.
Example
const snapshot = await runtime.createSnapshot('my-checkpoint');
const runtime = await snapshot.restore();
Constructors
Constructor
new Snapshot(
data,sdk):RuntimeSnapshotDTO
Defined in: src/models/RuntimeSnapshotDTO.ts:143
Create a Runtime Snapshot instance.
Parameters
data
RuntimeSnapshotData
Snapshot data from API
sdk
SDK instance
Returns
RuntimeSnapshotDTO
Properties
_data
protected_data:RuntimeSnapshotData
Defined in: src/models/RuntimeSnapshotDTO.ts:133
Accessors
description
Get Signature
get description():
string
Defined in: src/models/RuntimeSnapshotDTO.ts:181
Description of the snapshot.
Returns
string
environment
Get Signature
get environment():
string
Defined in: src/models/RuntimeSnapshotDTO.ts:187
Name of the environment used by the runtime.
Returns
string
name
Get Signature
get name():
string
Defined in: src/models/RuntimeSnapshotDTO.ts:175
Name of the snapshot.
Returns
string
uid
Get Signature
get uid():
string
Defined in: src/models/RuntimeSnapshotDTO.ts:169
Unique identifier for the snapshot.
Returns
string
updatedAt
Get Signature
get updatedAt():
Date
Defined in: src/models/RuntimeSnapshotDTO.ts:193
When the snapshot was last updated.
Returns
Date
Methods
delete()
delete():
Promise<void>
Defined in: src/models/RuntimeSnapshotDTO.ts:206
Delete this snapshot permanently. After deletion, subsequent calls to dynamic methods will throw errors.
Returns
Promise<void>
rawData()
rawData():
RuntimeSnapshotData
Defined in: src/models/RuntimeSnapshotDTO.ts:262
Get the raw snapshot data exactly as received from the API. This preserves the original snake_case naming from the API response.
Returns
RuntimeSnapshotData
Raw snapshot data from API
restore()
restore(
minutesLimit):Promise<Runtime>
Defined in: src/models/RuntimeSnapshotDTO.ts:220
Create a runtime from this snapshot (restore functionality).
Parameters
minutesLimit
number
Returns
Promise<Runtime>
Created Runtime instance
toJSON()
toJSON():
RuntimeSnapshotJSON
Defined in: src/models/RuntimeSnapshotDTO.ts:243
Get snapshot data in camelCase format. Returns only the core fields that consumers need. This provides a stable interface regardless of API changes. Note: Returns current cached state - call getStatus() first if you need fresh data.
Returns
RuntimeSnapshotJSON
Core snapshot data with camelCase properties
toString()
toString():
string
Defined in: src/models/RuntimeSnapshotDTO.ts:268
String representation of the snapshot.
Returns
string