stapel-docs 0.2.2__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. {stapel_docs-0.2.2/stapel_docs.egg-info → stapel_docs-0.2.3}/PKG-INFO +2 -2
  2. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/README.md +1 -1
  3. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/docs/capabilities.json +1 -1
  4. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/docs/llms.txt +1 -1
  5. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/pyproject.toml +1 -1
  6. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/services.py +38 -32
  7. {stapel_docs-0.2.2 → stapel_docs-0.2.3/stapel_docs.egg-info}/PKG-INFO +2 -2
  8. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/CONFIG.MD +0 -0
  9. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/LICENSE +0 -0
  10. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/__init__.py +0 -0
  11. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/_capabilities.py +0 -0
  12. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/_codegen.py +0 -0
  13. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/_codegen_settings.py +0 -0
  14. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/actions.py +0 -0
  15. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/admin.py +0 -0
  16. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/apps.py +0 -0
  17. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/assets/DEJAVU-FONTS-LICENSE.txt +0 -0
  18. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/assets/DejaVuSans-Bold.ttf +0 -0
  19. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/assets/DejaVuSans.ttf +0 -0
  20. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/authz.py +0 -0
  21. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/checks.py +0 -0
  22. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/codegen_urls.py +0 -0
  23. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/conf.py +0 -0
  24. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/conftest.py +0 -0
  25. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/doc_types.py +0 -0
  26. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/docs/errors.json +0 -0
  27. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/docs/flows.json +0 -0
  28. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/dto.py +0 -0
  29. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/errors.py +0 -0
  30. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/events.py +0 -0
  31. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/exporters.py +0 -0
  32. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/functions.py +0 -0
  33. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/gdpr.py +0 -0
  34. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/management/__init__.py +0 -0
  35. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/management/commands/__init__.py +0 -0
  36. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/management/commands/docs_purge_expired.py +0 -0
  37. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/migrations/0001_initial.py +0 -0
  38. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/migrations/0002_uploadsession_checksum_uploadsession_expires_at.py +0 -0
  39. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/migrations/__init__.py +0 -0
  40. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/models.py +0 -0
  41. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/presenters.py +0 -0
  42. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/py.typed +0 -0
  43. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/schemas/emits/document.created.json +0 -0
  44. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/schemas/emits/document.deleted.json +0 -0
  45. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/schemas/emits/document.storage_changed.json +0 -0
  46. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/schemas/emits/document.updated.json +0 -0
  47. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/schemas/functions/docs.create_document.json +0 -0
  48. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/serializers.py +0 -0
  49. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/setup.cfg +0 -0
  50. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/stapel_docs.egg-info/SOURCES.txt +0 -0
  51. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/stapel_docs.egg-info/dependency_links.txt +0 -0
  52. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/stapel_docs.egg-info/requires.txt +0 -0
  53. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/stapel_docs.egg-info/top_level.txt +0 -0
  54. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/storage.py +0 -0
  55. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tasks.py +0 -0
  56. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_checks.py +0 -0
  57. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_comm.py +0 -0
  58. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_content.py +0 -0
  59. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_contract.py +0 -0
  60. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_documents.py +0 -0
  61. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_error_i18n.py +0 -0
  62. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_export.py +0 -0
  63. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_folders.py +0 -0
  64. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_gdpr.py +0 -0
  65. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_ingest.py +0 -0
  66. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_limits.py +0 -0
  67. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_public_api.py +0 -0
  68. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_revisions.py +0 -0
  69. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_storage_seam.py +0 -0
  70. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_storage_tx.py +0 -0
  71. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_tasks.py +0 -0
  72. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_trash.py +0 -0
  73. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_updates.py +0 -0
  74. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/tests/test_uploads.py +0 -0
  75. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/translations/.state.json +0 -0
  76. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/translations/errors.es.json +0 -0
  77. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/translations/errors.ru.json +0 -0
  78. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/urls.py +0 -0
  79. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/urls_v1.py +0 -0
  80. {stapel_docs-0.2.2 → stapel_docs-0.2.3}/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stapel-docs
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Documents: storage, revisions and per-type editors for the Stapel framework
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/usestapel/stapel-docs
@@ -58,7 +58,7 @@ pip install stapel-docs
58
58
 
59
59
  | Fact | Value |
60
60
  |---|---|
61
- | Version | `0.2.2` |
61
+ | Version | `0.2.3` |
62
62
  | Python | `>=3.11` (3.11, 3.12, 3.13) |
63
63
  | HTTP operations | 27 |
64
64
  | Config axes | 1 |
@@ -24,7 +24,7 @@ pip install stapel-docs
24
24
 
25
25
  | Fact | Value |
26
26
  |---|---|
27
- | Version | `0.2.2` |
27
+ | Version | `0.2.3` |
28
28
  | Python | `>=3.11` (3.11, 3.12, 3.13) |
29
29
  | HTTP operations | 27 |
30
30
  | Config axes | 1 |
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "module": "stapel-docs",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "provides": "Google-Drive-style workspace documents: a folder tree, one-entity-per-type documents over an open type registry, content-addressed snapshot storage with an update journal and revision history, optimistic-lock editing (v1), trash with irreversible purge, a swappable object-storage seam, comm ingest (docs.create_document) and registry-driven export (PDF built in).",
5
5
  "axes": [
6
6
  {
@@ -1,4 +1,4 @@
1
- # stapel-docs 0.2.2
1
+ # stapel-docs 0.2.3
2
2
 
3
3
  Google-Drive-style workspace documents: a folder tree, one-entity-per-type documents over an open type registry, content-addressed snapshot storage with an update journal and revision history, optimistic-lock editing (v1), trash with irreversible purge, a swappable object-storage seam, comm ingest (docs.create_document) and registry-driven export (PDF built in).
4
4
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "stapel-docs"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "Documents: storage, revisions and per-type editors for the Stapel framework"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -622,43 +622,49 @@ def _save_snapshot(
622
622
  already_stored = storage_tx.put(key, body, content_type=content_mime(document))
623
623
  added = 0 if already_stored else len(body)
624
624
 
625
- document.head_seq = new_seq
626
- document.snapshot_seq = new_seq
627
- document.snapshot_key = key
628
- document.size_bytes = len(body)
629
- document.save(
630
- update_fields=["head_seq", "snapshot_seq", "snapshot_key", "size_bytes", "updated_at"]
631
- )
632
-
633
625
  revision = None
634
- if force_revision or _auto_revision_due(document):
635
- revision = Revision.objects.create(
636
- document=document,
637
- seq=new_seq,
638
- kind=Revision.KIND_AUTO,
639
- storage_key=key,
640
- created_by=user,
641
- size_bytes=len(body),
626
+ # Mutation + outbox rows share this atomic block (outbox canon — see
627
+ # module docstring). The callers already hold a wider
628
+ # transaction.atomic(); nesting here is a safe savepoint (per
629
+ # stapel_core.comm.mutate_and_emit's documented nesting guarantee) and
630
+ # makes this helper self-sufficient for emit-check's lexical scan.
631
+ with transaction.atomic():
632
+ document.head_seq = new_seq
633
+ document.snapshot_seq = new_seq
634
+ document.snapshot_key = key
635
+ document.size_bytes = len(body)
636
+ document.save(
637
+ update_fields=["head_seq", "snapshot_seq", "snapshot_key", "size_bytes", "updated_at"]
642
638
  )
643
639
 
644
- # Orphan cleanup: the previous snapshot dies iff no Revision points at
645
- # it (content-addressed keys make identical bodies dedup for free).
646
- freed = 0
647
- if (
648
- prev_key
649
- and prev_key != key
650
- and not Revision.objects.filter(document=document, storage_key=prev_key).exists()
651
- ):
652
- storage_tx.delete(prev_key)
653
- freed = prev_size
640
+ if force_revision or _auto_revision_due(document):
641
+ revision = Revision.objects.create(
642
+ document=document,
643
+ seq=new_seq,
644
+ kind=Revision.KIND_AUTO,
645
+ storage_key=key,
646
+ created_by=user,
647
+ size_bytes=len(body),
648
+ )
649
+
650
+ # Orphan cleanup: the previous snapshot dies iff no Revision points at
651
+ # it (content-addressed keys make identical bodies dedup for free).
652
+ freed = 0
653
+ if (
654
+ prev_key
655
+ and prev_key != key
656
+ and not Revision.objects.filter(document=document, storage_key=prev_key).exists()
657
+ ):
658
+ storage_tx.delete(prev_key)
659
+ freed = prev_size
654
660
 
655
- _compact_journal(document)
661
+ _compact_journal(document)
656
662
 
657
- if emit_updated:
658
- events.emit_document_updated(document)
659
- delta = added - freed
660
- if delta:
661
- events.emit_storage_changed(document.workspace_id, delta)
663
+ if emit_updated:
664
+ events.emit_document_updated(document)
665
+ delta = added - freed
666
+ if delta:
667
+ events.emit_storage_changed(document.workspace_id, delta)
662
668
  return revision
663
669
 
664
670
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stapel-docs
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Documents: storage, revisions and per-type editors for the Stapel framework
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/usestapel/stapel-docs
@@ -58,7 +58,7 @@ pip install stapel-docs
58
58
 
59
59
  | Fact | Value |
60
60
  |---|---|
61
- | Version | `0.2.2` |
61
+ | Version | `0.2.3` |
62
62
  | Python | `>=3.11` (3.11, 3.12, 3.13) |
63
63
  | HTTP operations | 27 |
64
64
  | Config axes | 1 |
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes