@abraca/dabra 1.3.4 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abracadabra-provider.cjs +28 -0
- package/dist/abracadabra-provider.cjs.map +1 -1
- package/dist/abracadabra-provider.esm.js +28 -0
- package/dist/abracadabra-provider.esm.js.map +1 -1
- package/dist/index.d.ts +45 -1
- package/package.json +1 -1
- package/src/AbracadabraClient.ts +55 -0
- package/src/types.ts +31 -0
|
@@ -3550,6 +3550,34 @@ var AbracadabraClient = class {
|
|
|
3550
3550
|
async adminStorageRepair() {
|
|
3551
3551
|
return this.request("POST", "/admin/storage/repair");
|
|
3552
3552
|
}
|
|
3553
|
+
/** List snapshot metadata for a document. */
|
|
3554
|
+
async listSnapshots(docId, opts) {
|
|
3555
|
+
const params = new URLSearchParams();
|
|
3556
|
+
if (opts?.limit != null) params.set("limit", String(opts.limit));
|
|
3557
|
+
if (opts?.offset != null) params.set("offset", String(opts.offset));
|
|
3558
|
+
const qs = params.toString();
|
|
3559
|
+
return (await this.request("GET", `/docs/${encodeURIComponent(docId)}/snapshots${qs ? `?${qs}` : ""}`)).snapshots;
|
|
3560
|
+
}
|
|
3561
|
+
/** Fetch a single snapshot including its base64-encoded data blob. */
|
|
3562
|
+
async getSnapshot(docId, version) {
|
|
3563
|
+
return this.request("GET", `/docs/${encodeURIComponent(docId)}/snapshots/${version}`);
|
|
3564
|
+
}
|
|
3565
|
+
/** Create a manual snapshot of the current document state. */
|
|
3566
|
+
async createSnapshot(docId, opts) {
|
|
3567
|
+
return this.request("POST", `/docs/${encodeURIComponent(docId)}/snapshots`, { body: opts ?? {} });
|
|
3568
|
+
}
|
|
3569
|
+
/** Delete a specific snapshot version. Requires manage permission. */
|
|
3570
|
+
async deleteSnapshot(docId, version) {
|
|
3571
|
+
await this.request("DELETE", `/docs/${encodeURIComponent(docId)}/snapshots/${version}`);
|
|
3572
|
+
}
|
|
3573
|
+
/** Restore a snapshot by merging it forward into the current document state. */
|
|
3574
|
+
async restoreSnapshot(docId, version) {
|
|
3575
|
+
return this.request("POST", `/docs/${encodeURIComponent(docId)}/snapshots/${version}/restore`, { body: {} });
|
|
3576
|
+
}
|
|
3577
|
+
/** Fork a snapshot into a new document. */
|
|
3578
|
+
async forkSnapshot(docId, version) {
|
|
3579
|
+
return this.request("POST", `/docs/${encodeURIComponent(docId)}/snapshots/${version}/fork`, { body: {} });
|
|
3580
|
+
}
|
|
3553
3581
|
/** Health check — no auth required. */
|
|
3554
3582
|
async health() {
|
|
3555
3583
|
return this.request("GET", "/health", { auth: false });
|