diff --git a/docs/usage.md b/docs/usage.md index f61f063..bb91df1 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -371,6 +371,10 @@ file, color and time zone, which Sieve script is active, the identities, and the links. It is written last: a tree without one was interrupted, and the way to finish it is to run again into an empty directory. +The layout and the manifest are specified at +, so other tools can read and +write them too. + `--objects` takes the same types as `export`; naming a folder or a message type writes all of mail, and the same for contacts and calendars. With `--dry-run` it counts what it would write and creates nothing. diff --git a/src/export_files/mod.rs b/src/export_files/mod.rs index c40e3f5..33cca6c 100644 --- a/src/export_files/mod.rs +++ b/src/export_files/mod.rs @@ -33,6 +33,11 @@ pub mod paths; use paths::{Names, safe_component}; +/// The layout's name in `manifest.json`: the address of its specification, +/// so it names no tool and can't clash with another format. 27.1.0-rc.2 +/// wrote `inbuxa-migrate-files` instead. +pub const FORMAT: &str = "https://coffeylabs.org/specs/account-export/"; + /// The layout this release writes; raised when `manifest.json` or the tree /// changes in a way a reader has to know about. pub const FORMAT_VERSION: u32 = 1; @@ -67,7 +72,7 @@ pub fn run(config: ExportFilesConfig) -> Result { let mut summary = Summary::default(); let mut manifest = json!({ - "format": "inbuxa-migrate-files", + "format": FORMAT, "formatVersion": FORMAT_VERSION, "createdBy": format!("inbuxa-migrate {}", crate::version::shown()), "created": OffsetDateTime::now_utc().format(&Rfc3339).unwrap_or_default(), diff --git a/tests/export_files.rs b/tests/export_files.rs index 70e377f..e6f2055 100644 --- a/tests/export_files.rs +++ b/tests/export_files.rs @@ -230,7 +230,7 @@ fn writes_open_formats_and_a_manifest() { assert!(!f.root.join("escape").exists()); let m = manifest(&f.out); - assert_eq!(m["format"], "inbuxa-migrate-files"); + assert_eq!(m["format"], "https://coffeylabs.org/specs/account-export/"); assert_eq!(m["formatVersion"], 1); assert_eq!(m["sources"][0]["kind"], "jmap"); let folders = m["mail"]["folders"].as_array().unwrap();