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
| Field | Type |
|---|---|
snapshotsEvery point you can go back… | object[] |
idThe saved point's id, which is… | string |
atWhen it was taken, in milliseconds | number |
triggerWhat caused it | "turn" | "interval" | "pre-restore" | "restore" … (5) |
labelWhat to call it | string |
answered in this tab
curl "$SANDBOX/history/snapshots" \
-H "x-intentic-control: $INTENTIC_TOKEN"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
| Field | Type | Where |
|---|---|---|
idrequiredWhich saved point | string | query |
What comes back
| Field | Type |
|---|---|
changesEverything that differs between this saved… | object[] |
scopeWhich part of the workspace the… | string |
pathThe path, relative to that scope | string |
statusWhat happened to it | "added" | "modified" | "deleted" | "type-changed" |
answered in this tab
curl "$SANDBOX/history/diff?id=a1b2c3d4" \
-H "x-intentic-control: $INTENTIC_TOKEN"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
| Field | Type | Where |
|---|---|---|
idrequiredWhich saved point | string | query |
scoperequiredWhich part of the workspace the… | string | query |
pathrequiredThe file, relative to that scope | string | query |
What comes back
| Field | Type |
|---|---|
beforeThe whole file as it was | string |
afterThe whole file as it is… | string |
binaryThe file is not text, so… | boolean |
truncatedThe file was too large to… | boolean |
answered in this tab
curl "$SANDBOX/history/file-diff?id=a1b2c3d4&scope=read&path=src%2Fapp.ts" \
-H "x-intentic-control: $INTENTIC_TOKEN"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
| Field | Type | Where |
|---|---|---|
idrequiredWhich saved point | string | body |
What comes back
| Field | Type |
|---|---|
okAlways true | true |
answered in this tab
curl -X POST "$SANDBOX/history/restore" \
-H "x-intentic-control: $INTENTIC_TOKEN" \
-H "content-type: application/json" \
-d '{"id":"a1b2c3d4"}'import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.history.restore({
"id": "a1b2c3d4"
});More in The workspace