@abraca/dabra 1.3.3 → 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.
@@ -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 });
@@ -10897,8 +10925,9 @@ var E2EAbracadabraProvider = class E2EAbracadabraProvider extends AbracadabraPro
10897
10925
  function attachUpdatedAtObserver(treeMap, childDocId, childDoc, offlineStore) {
10898
10926
  function handler(update, origin) {
10899
10927
  if (offlineStore !== null && origin === offlineStore) return;
10900
- const entry = treeMap.get(childDocId);
10901
- if (!entry) return;
10928
+ const raw = treeMap.get(childDocId);
10929
+ if (!raw) return;
10930
+ const entry = raw instanceof yjs.Map ? raw.toJSON() : raw;
10902
10931
  treeMap.set(childDocId, {
10903
10932
  ...entry,
10904
10933
  updatedAt: Date.now()