intentic
Create your workspace
The workspace

History

Saved states of the whole workspace, and putting one back

On this page(4 sections)

The points the sandbox saves as work happens, what changed between one and the next, one file's two sides, and restoring from one.

GET/history/snapshotsPoints you can go back to

The saved states of the whole workspace, taken automatically as work happens. This is the timeline behind undoing a change that was never committed.

What you send

Nothing. Call it as it is.

What comes back

FieldType
snapshotsEvery point you can go back…object[]
idThe saved point's id, which is…string
atWhen it was taken, in millisecondsnumber
triggerWhat caused it"turn" | "interval" | "pre-restore" | "restore" … (5)
labelWhat to call itstring
Try itanswered in this tab
curl
curl "$SANDBOX/history/snapshots" \
  -H "x-intentic-control: $INTENTIC_TOKEN"
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.history.list();
GET/history/diffWhat changed since a saved point

The files that differ between one saved point and the one before it, taking in everything that happened in between.

What you send

FieldTypeWhere
idrequiredWhich saved pointstringquery

What comes back

FieldType
changesEverything that differs between this saved…object[]
scopeWhich part of the workspace the…string
pathThe path, relative to that scopestring
statusWhat happened to it"added" | "modified" | "deleted" | "type-changed"
Try itanswered in this tab
curl
curl "$SANDBOX/history/diff?id=a1b2c3d4" \
  -H "x-intentic-control: $INTENTIC_TOKEN"
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.history.diff({
  "id": "a1b2c3d4"
});
GET/history/file-diffOne file's before and after across a saved point

Both sides of a single file at one point in the timeline.

What you send

FieldTypeWhere
idrequiredWhich saved pointstringquery
scoperequiredWhich part of the workspace the…stringquery
pathrequiredThe file, relative to that scopestringquery

What comes back

FieldType
beforeThe whole file as it wasstring
afterThe whole file as it is…string
binaryThe file is not text, so…boolean
truncatedThe file was too large to…boolean
Try itanswered in this tab
curl
curl "$SANDBOX/history/file-diff?id=a1b2c3d4&scope=read&path=src%2Fapp.ts" \
  -H "x-intentic-control: $INTENTIC_TOKEN"
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.history.fileDiff({
  "id": "a1b2c3d4",
  "scope": "read",
  "path": "src/app.ts"
});
POST/history/restorePut the workspace back

Returns every file to how it stood at a saved point. This restores the files; moving a branch is a different thing and lives with the git calls.

What you send

FieldTypeWhere
idrequiredWhich saved pointstringbody

What comes back

FieldType
okAlways truetrue
Try itanswered in this tab
curl
curl -X POST "$SANDBOX/history/restore" \
  -H "x-intentic-control: $INTENTIC_TOKEN" \
  -H "content-type: application/json" \
  -d '{"id":"a1b2c3d4"}'
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.history.restore({
  "id": "a1b2c3d4"
});
More in The workspace

Type to search every page, in the docs and the API reference.