#!/usr/bin/env python3 # Libervia: an XMPP client # Copyright (C) 2009-2026 Jérôme Poisson (goffi@goffi.org) # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . from pydantic import BaseModel, Field class ProfileMeta(BaseModel): """Exported data of a profile.""" jid: str | None = Field(default=None, description="JabberID of the profile") types: list[str] = Field( default_factory=list, description="data types exported for this profile" ) class Manifest(BaseModel): """Manifest of a backup archive (manifest.json).""" format: str = Field(description="backup format name") format_version: int = Field(description="backup format version") app: str = Field(description="application that made the backup") app_version: str = Field(description="version of the application") alembic: str | None = Field( default=None, description="database schema revision (None if unknown)" ) date: str = Field(description="backup date (UTC, ISO 8601)") profiles: dict[str, ProfileMeta] = Field( default_factory=dict, description="exported profiles, by name" ) files: dict[str, dict[str, str]] = Field( default_factory=dict, description="checksums of the archive entries, by entry name", )