@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.
@@ -3520,6 +3520,34 @@ var AbracadabraClient = class {
3520
3520
  async adminStorageRepair() {
3521
3521
  return this.request("POST", "/admin/storage/repair");
3522
3522
  }
3523
+ /** List snapshot metadata for a document. */
3524
+ async listSnapshots(docId, opts) {
3525
+ const params = new URLSearchParams();
3526
+ if (opts?.limit != null) params.set("limit", String(opts.limit));
3527
+ if (opts?.offset != null) params.set("offset", String(opts.offset));
3528
+ const qs = params.toString();
3529
+ return (await this.request("GET", `/docs/${encodeURIComponent(docId)}/snapshots${qs ? `?${qs}` : ""}`)).snapshots;
3530
+ }
3531
+ /** Fetch a single snapshot including its base64-encoded data blob. */
3532
+ async getSnapshot(docId, version) {
3533
+ return this.request("GET", `/docs/${encodeURIComponent(docId)}/snapshots/${version}`);
3534
+ }
3535
+ /** Create a manual snapshot of the current document state. */
3536
+ async createSnapshot(docId, opts) {
3537
+ return this.request("POST", `/docs/${encodeURIComponent(docId)}/snapshots`, { body: opts ?? {} });
3538
+ }
3539
+ /** Delete a specific snapshot version. Requires manage permission. */
3540
+ async deleteSnapshot(docId, version) {
3541
+ await this.request("DELETE", `/docs/${encodeURIComponent(docId)}/snapshots/${version}`);
3542
+ }
3543
+ /** Restore a snapshot by merging it forward into the current document state. */
3544
+ async restoreSnapshot(docId, version) {
3545
+ return this.request("POST", `/docs/${encodeURIComponent(docId)}/snapshots/${version}/restore`, { body: {} });
3546
+ }
3547
+ /** Fork a snapshot into a new document. */
3548
+ async forkSnapshot(docId, version) {
3549
+ return this.request("POST", `/docs/${encodeURIComponent(docId)}/snapshots/${version}/fork`, { body: {} });
3550
+ }
3523
3551
  /** Health check — no auth required. */
3524
3552
  async health() {
3525
3553
  return this.request("GET", "/health", { auth: false });