From 8384572353fc8543b1e1f46467fa98317e3504cc Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 24 Oct 2026 07:11:29 +0200 Subject: add the import kind of remake --- src/remake/api.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/remake/api.rs') diff --git a/src/remake/api.rs b/src/remake/api.rs index 988bb34..51cbe07 100644 --- a/src/remake/api.rs +++ b/src/remake/api.rs @@ -24,9 +24,15 @@ //! `?force=true` accepts `settleSecs` below the dormancy threshold and `switchDelaySecs` //! below one keepalive interval: for tests and debugging, not for real swarms. //! -//! `kind` is `compact` (no spec) or `replace`, whose spec is +//! `kind` is `compact` (no spec), `replace`, whose spec is //! `{ "document": {…store root…}, "rules": [{"from": "a", "to": "b"}, {"from": "c", "drop": true}] }` -//! (see `kind::Replace`). Reports leave the replacement document out (`contentBytes`). +//! (see `kind::Replace`), or `import`, whose spec is +//! `{ "document": "", "rules": […] }` (see +//! `kind::Import`; `GET /admin/document` exports one). Reports leave the document out +//! (`contentBytes`). Requests may be up to 64 MiB. +//! +//! Restoring a backup, keeping writes made since at their paths: +//! `base64 -w0 backup.automerge | jq -Rs '{kind: "import", spec: {document: ., rules: [{from: "", to: ""}]}}' | curl --data-binary @- -H 'Content-Type: application/json' …/admin/remakes` use std::time::Duration; -- cgit v1.3.1