synology_apm_repo.sdk.format.repo_transaction module

repo_transaction.<N> — magic rPTs, the parse_json_payload_header shell repo_info.py also uses, except bytes [20,36) (the repo uuid there) are always zero, followed by a small JSON payload (FORMAT-SPEC.md: Multi-generation selection).

class synology_apm_repo.sdk.format.repo_transaction.RepoTransaction(transaction_id, session_id, compact_id, raw)

Bases: object

Parsed repo_transaction.<N> payload. session_id/ compact_id are carried through for completeness/diagnostics (dump-style tooling); generation selection only ever needs transaction_id.

transaction_id: int
session_id: int | None
compact_id: int | None
raw: dict[str, object]
synology_apm_repo.sdk.format.repo_transaction.parse_repo_transaction(data)

Parse a repo_transaction.<N> file’s full bytes (header + JSON payload).

Raises:
  • DataCorruptError – A magic, header-CRC, or payload-CRC mismatch, a payload that is not a JSON object, or one whose transaction_id is neither an integer nor a decimal string short enough to convert.

  • FormatError – data is shorter than the 64-byte header, or the payload is truncated relative to the length the header declares.