export-files: name the format by its specification's address #30

Merged
jcoffey-dev merged 1 commits from export-files/format-uri into main 2026-10-30 07:46:46 +00:00
3 changed files with 11 additions and 2 deletions

No files matched your search

+4
View File
@@ -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
<https://coffeylabs.org/specs/account-export/>, 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.
+6 -1
View File
@@ -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<Summary, Error> {
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(),
+1 -1
View File
@@ -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();