feat: add schema_version to JSONL outputs and remove dead code

- Add schema_version (archivebox.VERSION) to all to_jsonl() outputs:
  - Snapshot.to_jsonl()
  - ArchiveResult.to_jsonl()
  - Binary.to_jsonl()
  - Process.to_jsonl()

- Update CLI commands to use model methods directly:
  - archivebox_snapshot.py: snapshot.to_jsonl()
  - archivebox_extract.py: result.to_jsonl()

- Remove dead wrapper functions from misc/jsonl.py:
  - snapshot_to_jsonl()
  - archiveresult_to_jsonl()
  - binary_to_jsonl()
  - process_to_jsonl()
  - machine_to_jsonl()

- Update tests to use model methods directly
This commit is contained in:
Claude
2025-12-30 19:24:53 +00:00
parent a5206e7648
commit bc273c5a7f
6 changed files with 66 additions and 95 deletions

View File

@@ -246,8 +246,10 @@ class Binary(ModelWithHealthStats):
"""
Convert Binary model instance to a JSONL record.
"""
from archivebox.config import VERSION
return {
'type': 'Binary',
'schema_version': VERSION,
'id': str(self.id),
'machine_id': str(self.machine_id),
'name': self.name,
@@ -626,8 +628,10 @@ class Process(ModelWithHealthStats):
"""
Convert Process model instance to a JSONL record.
"""
from archivebox.config import VERSION
record = {
'type': 'Process',
'schema_version': VERSION,
'id': str(self.id),
'machine_id': str(self.machine_id),
'cmd': self.cmd,