uEdition-Editor 2.0.0b8__tar.gz → 2.0.0b10__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.

Potentially problematic release.


This version of uEdition-Editor might be problematic. Click here for more details.

Files changed (35) hide show
  1. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/PKG-INFO +1 -1
  2. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/__about__.py +1 -1
  3. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/api/__init__.py +2 -0
  4. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/api/files.py +30 -0
  5. uedition_editor-2.0.0b8/uedition_editor/frontend/dist/assets/CodeMirrorEditor-DOG_wssG.js → uedition_editor-2.0.0b10/uedition_editor/frontend/dist/assets/CodeMirrorEditor-DaVvZ_iF.js +17 -17
  6. uedition_editor-2.0.0b10/uedition_editor/frontend/dist/assets/FolderEditor-BRCtr0pK.js +1 -0
  7. uedition_editor-2.0.0b10/uedition_editor/frontend/dist/assets/ImageEditor-Bi68IyPx.js +1 -0
  8. uedition_editor-2.0.0b10/uedition_editor/frontend/dist/assets/TeiEditor-Cl1q8UQU.js +192 -0
  9. uedition_editor-2.0.0b8/uedition_editor/frontend/dist/assets/index-HmBQiVS_.css → uedition_editor-2.0.0b10/uedition_editor/frontend/dist/assets/index-BKSE80GP.css +1 -1
  10. uedition_editor-2.0.0b10/uedition_editor/frontend/dist/assets/index-BcAJnzER.js +18 -0
  11. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/frontend/dist/index.html +2 -2
  12. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/settings.py +1 -0
  13. uedition_editor-2.0.0b8/uedition_editor/frontend/dist/assets/FolderEditor-zj3irnZV.js +0 -1
  14. uedition_editor-2.0.0b8/uedition_editor/frontend/dist/assets/ImageEditor-BQLjZvFT.js +0 -1
  15. uedition_editor-2.0.0b8/uedition_editor/frontend/dist/assets/TeiEditor-yaJoIiMq.js +0 -192
  16. uedition_editor-2.0.0b8/uedition_editor/frontend/dist/assets/index-DAdhbT7C.js +0 -18
  17. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/.gitignore +0 -0
  18. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/.pre-commit-config.yaml +0 -0
  19. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/Containerfile +0 -0
  20. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/LICENSE.txt +0 -0
  21. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/README.md +0 -0
  22. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/pyproject.toml +0 -0
  23. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/__init__.py +0 -0
  24. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/__main__.py +0 -0
  25. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/api/auth.py +0 -0
  26. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/api/branches.py +0 -0
  27. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/api/configs.py +0 -0
  28. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/api/tests.py +0 -0
  29. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/api/util.py +0 -0
  30. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/cli/__init__.py +0 -0
  31. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/cron.py +0 -0
  32. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/frontend/dist/assets/CodeMirrorEditor-ddcHt3UE.css +0 -0
  33. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/frontend/dist/assets/index-Vcq4gwWv.js +0 -0
  34. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/frontend/dist/ueditor.svg +0 -0
  35. {uedition_editor-2.0.0b8 → uedition_editor-2.0.0b10}/uedition_editor/state.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uEdition-Editor
3
- Version: 2.0.0b8
3
+ Version: 2.0.0b10
4
4
  Project-URL: Documentation, https://github.com/uEdition/uEditor#readme
5
5
  Project-URL: Issues, https://github.com/uEdition/uEditor/issues
6
6
  Project-URL: Source, https://github.com/uEdition/uEditor
@@ -3,4 +3,4 @@
3
3
  # SPDX-License-Identifier: MIT
4
4
  """About this package."""
5
5
 
6
- __version__ = "2.0.0b8"
6
+ __version__ = "2.0.0b10"
@@ -34,6 +34,7 @@ class APIStatusGit(BaseModel):
34
34
 
35
35
  enabled: bool
36
36
  default_branch: str | None = None
37
+ protect_default_branch: bool | None = None
37
38
 
38
39
 
39
40
  class APIStatus(BaseModel):
@@ -61,6 +62,7 @@ def api() -> dict:
61
62
  Repository(init_settings.base_path, flags=RepositoryOpenFlag.NO_SEARCH)
62
63
  api_status["git"]["enabled"] = True
63
64
  api_status["git"]["default_branch"] = init_settings.git.default_branch
65
+ api_status["git"]["protect_default_branch"] = init_settings.git.protect_default_branch
64
66
  except GitError:
65
67
  pass
66
68
  return api_status
@@ -384,6 +384,16 @@ async def create_file(
384
384
  ) -> None:
385
385
  """Create a new file in the repo."""
386
386
  try:
387
+ if init_settings.git.protect_default_branch and init_settings.git.default_branch == branch_id:
388
+ raise HTTPException(
389
+ 422,
390
+ detail=[
391
+ {
392
+ "loc": ["path", "path"],
393
+ "msg": "this branch is protected",
394
+ }
395
+ ],
396
+ )
387
397
  async with BranchContextManager(branch_id) as repo:
388
398
  if new_type in ("file", "folder"):
389
399
  full_path = os.path.abspath(os.path.join(init_settings.base_path, *path.split("/")))
@@ -724,6 +734,16 @@ async def update_file(
724
734
  ) -> None:
725
735
  """Update the file in the repo."""
726
736
  try:
737
+ if init_settings.git.protect_default_branch and init_settings.git.default_branch == branch_id:
738
+ raise HTTPException(
739
+ 422,
740
+ detail=[
741
+ {
742
+ "loc": ["path", "path"],
743
+ "msg": "this branch is protected",
744
+ }
745
+ ],
746
+ )
727
747
  async with BranchContextManager(branch_id) as repo:
728
748
  ueditor_settings = get_ueditor_settings()
729
749
  full_path = os.path.abspath(os.path.join(init_settings.base_path, *path.split("/")))
@@ -783,6 +803,16 @@ async def delete_file(
783
803
  ) -> None:
784
804
  """Delete a file in the repo."""
785
805
  try:
806
+ if init_settings.git.protect_default_branch and init_settings.git.default_branch == branch_id:
807
+ raise HTTPException(
808
+ 422,
809
+ detail=[
810
+ {
811
+ "loc": ["path", "path"],
812
+ "msg": "this branch is protected",
813
+ }
814
+ ],
815
+ )
786
816
  async with BranchContextManager(branch_id) as repo:
787
817
  full_path = os.path.abspath(os.path.join(init_settings.base_path, *path.split("/")))
788
818
  if full_path.startswith(os.path.abspath(init_settings.base_path)):