{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://truleaf.org/fields/data-formats/1.0.0/manifest.schema.json","title":"Truleaf Fields export manifest","description":"manifest.json of a full-workspace bundle: every file with rows, uncompressed bytes and sha256 of the uncompressed content, the parts, exclusions and attribution. Empty files are listed with rows 0 (path null, or the path with part null).","type":"object","additionalProperties":false,"required":["format","formatVersion","registerUrl","generatedAt","asOf","exportId","orgId","scope","requestedBy","custodial","software","crs","csvDialect","locale","personalData","files","parts","exclusions","attribution"],"properties":{"format":{"const":"truleaf-fields-export"},"formatVersion":{"type":"string","pattern":"^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$","description":"Register version the bundle follows (register.current at build time)."},"registerUrl":{"type":"string","format":"uri","description":"<FIELDS_EXPORT_REGISTER_BASE_URL>/<formatVersion>."},"generatedAt":{"type":"string","format":"date-time"},"asOf":{"type":"string","format":"date-time","description":"Data as of: when the export started."},"exportId":{"type":"string","format":"uuid"},"orgId":{"type":"string","format":"uuid"},"scope":{"type":"object","additionalProperties":false,"required":["kind","includeMedia"],"properties":{"kind":{"const":"org"},"includeMedia":{"type":"boolean"}}},"requestedBy":{"type":"object","additionalProperties":false,"required":["userId","role","via"],"properties":{"userId":{"type":"string","pattern":"^[0-9a-f]{24}$","description":"User id as a 24-character string."},"role":{"type":["string","null"],"enum":["owner","admin","editor","contributor","viewer",null],"description":"The requester's role in the exported workspace; null when the requester holds no role there (custodian admin)."},"via":{"type":"string","enum":["member","link","custodian"],"description":"How the export was requested (self is the personal export only)."}}},"custodial":{"type":"boolean"},"software":{"type":"object","additionalProperties":false,"required":["name","version"],"properties":{"name":{"type":"string","minLength":1},"version":{"type":"string","minLength":1}}},"crs":{"const":"EPSG:4326 (RFC 7946)"},"csvDialect":{"type":"string","enum":["canonical","excel_es"],"description":"The CSV dialect of the bundle."},"locale":{"type":"string","enum":["en-US","es-ES","fr-FR","nl-NL","pt-BR","pt-PT","uk-UA"]},"personalData":{"type":"boolean"},"files":{"type":"array","items":{"$ref":"#/$defs/file"}},"parts":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/part"}},"exclusions":{"type":"array","items":{"$ref":"#/$defs/exclusion"}},"attribution":{"type":"array","items":{"type":"string","minLength":1}},"siex":{"type":"object","additionalProperties":false,"required":["anexoVVersion","mapping"],"description":"Present when the bundle carries records/cuaderno_es.xlsx (add-on es).","properties":{"anexoVVersion":{"type":"string","pattern":"^[0-9]+\\.[0-9]+$"},"mapping":{"const":"schemas/siex-mapping.json"}}}},"$defs":{"file":{"type":"object","additionalProperties":false,"required":["path","schema","rows","bytes","sha256","part"],"properties":{"path":{"type":["string","null"],"minLength":1,"pattern":"^(?!/)(?!.*(^|/)\\.\\.(/|$))[^\\\\]+$","description":"Path inside the bundle, relative (no leading /, no .. segment, no backslash); null for an empty file that was not written."},"schema":{"type":["string","null"],"pattern":"^schemas/[a-z0-9]+(-[a-z0-9]+)*\\.schema\\.json$","description":"null for files without a JSON Schema (README.md, records/cuaderno_es.xlsx, media originals)."},"rows":{"type":"integer","minimum":0},"bytes":{"type":"integer","minimum":0,"description":"Uncompressed size."},"sha256":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$","description":"Of the uncompressed content; null for an empty file."},"part":{"type":["integer","null"],"minimum":1}},"allOf":[{"description":"An entry without a part was not written: no hash, no bytes and no rows.","if":{"required":["part"],"properties":{"part":{"type":"null"}}},"then":{"properties":{"sha256":{"type":"null"},"bytes":{"const":0},"rows":{"const":0}}}},{"description":"An entry without a hash was not written: no part (a written file, even header-only, is always hashed).","if":{"required":["sha256"],"properties":{"sha256":{"type":"null"}}},"then":{"properties":{"part":{"type":"null"}}}},{"description":"An entry without a path (an empty file) has no rows and no part.","if":{"required":["path"],"properties":{"path":{"type":"null"}}},"then":{"properties":{"part":{"type":"null"},"rows":{"const":0}}}}]},"part":{"type":"object","additionalProperties":false,"required":["n","name","content"],"properties":{"n":{"type":"integer","minimum":1},"name":{"type":"string","pattern":"^[^/\\\\]+\\.zip$"},"content":{"type":"string","enum":["all","data","media"],"description":"all = guide + manifest + schemas (part 1, or the single zip)."}}},"exclusion":{"type":"object","additionalProperties":false,"required":["code","reason","doc"],"properties":{"code":{"type":"string","enum":["satellite_chips","satellite_renders","raw_weather_payloads","provider_trade_secrets","other_workspaces_data","integration_credentials","third_party_catalogues","notification_delivery_logs","parcel_status_history","kwau_portfolio_threads","kwau_author_identity"],"description":"What was left out of the bundle."},"reason":{"type":"string","pattern":"^[a-z][a-z0-9_]*$"},"doc":{"type":"string","format":"uri"}}}}}