squarecloud-api 3.8.1__tar.gz → 4.0.0__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 (41) hide show
  1. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0}/PKG-INFO +4 -8
  2. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0}/pyproject.toml +43 -41
  3. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/__init__.py +3 -1
  4. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/app.py +9 -45
  5. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/client.py +326 -51
  6. squarecloud_api-4.0.0/src/squarecloud/data/__init__.py +44 -0
  7. squarecloud_api-4.0.0/src/squarecloud/data/app.py +41 -0
  8. squarecloud_api-4.0.0/src/squarecloud/data/base.py +15 -0
  9. squarecloud_api-4.0.0/src/squarecloud/data/base_database.py +8 -0
  10. squarecloud_api-4.0.0/src/squarecloud/data/certificate.py +58 -0
  11. squarecloud_api-4.0.0/src/squarecloud/data/database.py +10 -0
  12. squarecloud_api-4.0.0/src/squarecloud/data/database_info.py +17 -0
  13. squarecloud_api-4.0.0/src/squarecloud/data/deploy_data.py +11 -0
  14. squarecloud_api-4.0.0/src/squarecloud/data/dns_record.py +8 -0
  15. squarecloud_api-4.0.0/src/squarecloud/data/domain_analytics.py +62 -0
  16. squarecloud_api-4.0.0/src/squarecloud/data/file_info.py +30 -0
  17. squarecloud_api-4.0.0/src/squarecloud/data/language.py +6 -0
  18. squarecloud_api-4.0.0/src/squarecloud/data/logs.py +15 -0
  19. squarecloud_api-4.0.0/src/squarecloud/data/plan.py +23 -0
  20. squarecloud_api-4.0.0/src/squarecloud/data/snapshot.py +34 -0
  21. squarecloud_api-4.0.0/src/squarecloud/data/snapshot_info.py +16 -0
  22. squarecloud_api-4.0.0/src/squarecloud/data/status.py +46 -0
  23. squarecloud_api-4.0.0/src/squarecloud/data/upload.py +37 -0
  24. squarecloud_api-4.0.0/src/squarecloud/data/user.py +26 -0
  25. squarecloud_api-4.0.0/src/squarecloud/data/workspace.py +53 -0
  26. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/http/endpoints.py +227 -1
  27. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/http/http_client.py +301 -3
  28. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/listeners/__init__.py +0 -31
  29. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/listeners/capture_listener.py +0 -45
  30. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/listeners/request_listener.py +0 -40
  31. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/utils.py +3 -3
  32. squarecloud_api-3.8.1/squarecloud/_internal/constants.py +0 -3
  33. squarecloud_api-3.8.1/squarecloud/_internal/decorators.py +0 -16
  34. squarecloud_api-3.8.1/squarecloud/data.py +0 -351
  35. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0}/LICENSE +0 -0
  36. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0}/README.md +0 -0
  37. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/errors.py +0 -0
  38. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/file.py +0 -0
  39. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/http/__init__.py +0 -0
  40. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/logger.py +0 -0
  41. {squarecloud_api-3.8.1 → squarecloud_api-4.0.0/src}/squarecloud/py.typed +0 -0
@@ -1,22 +1,18 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: squarecloud-api
3
- Version: 3.8.1
3
+ Version: 4.0.0
4
4
  Summary: SquareCloud API wrapper
5
5
  License: MIT
6
6
  License-File: LICENSE
7
7
  Author: Robert Nogueira
8
8
  Author-email: robertlucasnogueira@gmail.com
9
- Requires-Python: >=3.13,<4.0
9
+ Requires-Python: >=3.13,<3.15
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Programming Language :: Python :: 3.13
13
13
  Classifier: Programming Language :: Python :: 3.14
14
- Provides-Extra: pydantic
15
- Requires-Dist: aiohttp (>=3.13.2,<4.0.0)
16
- Requires-Dist: pydantic (>=2.12.5,<3.0.0) ; extra == "pydantic"
17
- Requires-Dist: typing-extensions (>=4.15.0,<5.0.0)
18
- Project-URL: Documentation, https://docs.squarecloud.app/sdks/py
19
- Project-URL: Repository, https://github.com/squarecloudofc/wrapper-api-py
14
+ Requires-Dist: aiohttp (>=3.13.2,<3.14.0)
15
+ Requires-Dist: typing-extensions (>=4.15.0,<4.16.0)
20
16
  Description-Content-Type: text/markdown
21
17
 
22
18
  [Square Cloud]: https://squarecloud.app
@@ -1,46 +1,48 @@
1
- [tool.poetry]
2
- name = 'squarecloud-api'
3
- version = '3.8.1'
4
- description = 'SquareCloud API wrapper'
5
- authors = ['Robert Nogueira <robertlucasnogueira@gmail.com>']
1
+ [project]
2
+ name = "squarecloud-api"
3
+ version = "4.0.0"
4
+ description = "SquareCloud API wrapper"
5
+ authors = [
6
+ {name = "Robert Nogueira",email = "robertlucasnogueira@gmail.com"}
7
+ ]
6
8
  repository = 'https://github.com/squarecloudofc/wrapper-api-py'
7
- documentation = 'https://docs.squarecloud.app/sdks/py'
8
- license = 'MIT License'
9
- readme = 'README.md'
10
- packages = [{ include = "squarecloud" }]
11
-
12
-
13
- [tool.poetry.dependencies]
14
- python = '^3.13'
15
- typing-extensions = "^4.15.0"
16
- aiohttp = "^3.13.2"
17
- pydantic = "^2.12.5"
18
-
19
- [tool.poetry.extras]
20
- pydantic = ["pydantic"]
21
-
22
- [tool.poetry.group.dev.dependencies]
23
- isort = "^7.0.0"
24
- pre-commit = "^4.5.0"
25
- pytest = "^9.0.2"
26
- pytest-asyncio = "^1.3.0"
27
- pytest-cov = "^6.0.0"
28
- pytest-rerunfailures = "^16.1"
29
- ruff = "^0.14.9"
30
- taskipy = "^1.14.1"
31
- bandit = {extras = ["toml"], version = "^1.9.2"}
32
- cz-conventional-gitmoji = "^0.7.0"
33
- memory-profiler = "^0.61.0"
34
- requests = "^2.32.5"
35
- python-dotenv = "^1.2.1"
36
- safety = "^3.7.0"
37
- vulture = "^2.14"
38
- mypy-extensions = "^1.1.0"
39
- commitizen = "^4.10.1"
9
+ documentation = 'https://docs.squarecloud.app/en/sdks/py/client'
10
+ license = {text = "MIT License"}
11
+ readme = "README.md"
12
+ requires-python = ">=3.13,<3.15"
13
+
14
+ dependencies = [
15
+ "aiohttp~=3.13.2",
16
+ "typing-extensions~=4.15.0",
17
+ ]
18
+
19
+ [tool.poetry]
20
+ packages = [{ from= "src", include = "squarecloud" }]
40
21
 
41
22
  [build-system]
42
- requires = ['poetry-core']
43
- build-backend = 'poetry.core.masonry.api'
23
+ requires = ["poetry-core>=2.0.0,<3.0.0"]
24
+ build-backend = "poetry.core.masonry.api"
25
+
26
+ [dependency-groups]
27
+ dev = [
28
+ "bandit[toml]~=1.9.2",
29
+ "commitizen~=4.10.1",
30
+ "cz-conventional-gitmoji~=0.7.0",
31
+ "isort~=7.0.0",
32
+ "memory-profiler~=0.61.0",
33
+ "mypy-extensions~=1.1.0",
34
+ "pre-commit~=4.5.0",
35
+ "pytest~=9.0.2",
36
+ "pytest-asyncio~=1.3.0",
37
+ "pytest-cov~=7.1.0",
38
+ "pytest-rerunfailures~=16.1",
39
+ "python-dotenv~=1.2.1",
40
+ "requests~=2.32.5",
41
+ "ruff~=0.14.9",
42
+ "safety~=3.7.0",
43
+ "taskipy~=1.14.1",
44
+ "vulture~=2.14",
45
+ ]
44
46
 
45
47
  [tool.pytest.ini_options]
46
48
  asyncio_mode = 'auto'
@@ -143,4 +145,4 @@ B704 = "markupsafe_markup_xss" # Potential XSS via MarkupSafe
143
145
  name = "cz_gitmoji"
144
146
 
145
147
  [tool.ruff.lint.per-file-ignores]
146
- '__init__.py' = ['F401']
148
+ '__init__.py' = ['F401']
@@ -17,6 +17,7 @@ from .data import (
17
17
  StatusData,
18
18
  UploadData,
19
19
  UserData,
20
+ Workspace,
20
21
  )
21
22
  from .file import File
22
23
  from .http.endpoints import Endpoint
@@ -41,8 +42,9 @@ __all__ = [
41
42
  'StatusData',
42
43
  'UploadData',
43
44
  'UserData',
45
+ 'Workspace',
44
46
  'errors',
45
47
  'utils',
46
48
  ]
47
49
 
48
- __version__ = '3.8.1'
50
+ __version__ = '4.0.0'
@@ -9,7 +9,6 @@ from typing_extensions import deprecated
9
9
 
10
10
  from squarecloud import errors
11
11
 
12
- from ._internal.decorators import validate
13
12
  from .data import (
14
13
  AppData,
15
14
  DeployData,
@@ -41,7 +40,6 @@ class AppCache:
41
40
  __slots__ = (
42
41
  '_status',
43
42
  '_logs',
44
- '_backup',
45
43
  '_app_data',
46
44
  '_snapshot'
47
45
  )
@@ -57,7 +55,6 @@ class AppCache:
57
55
  """
58
56
  self._status: StatusData | None = None
59
57
  self._logs: LogsData | None = None
60
- self._backup: Snapshot | None = None
61
58
  self._snapshot: Snapshot | None = None
62
59
  self._app_data: AppData | None = None
63
60
 
@@ -83,18 +80,6 @@ class AppCache:
83
80
  """
84
81
  return self._logs
85
82
 
86
- @property
87
- @deprecated("this property will be removed in future versions, use the 'snapshot' property instead")
88
- def backup(self) -> Snapshot:
89
- """
90
- The backup method is a property that returns the cached Backup of
91
- the application.
92
-
93
- :return: The value of the _backup attribute
94
- :rtype: Backup
95
- """
96
- return self._backup
97
-
98
83
  @property
99
84
  def snapshot(self) -> Snapshot:
100
85
  """
@@ -119,7 +104,7 @@ class AppCache:
119
104
 
120
105
  def clear(self) -> None:
121
106
  """
122
- The clear method is used to clear the status, logs, backup and data
107
+ The clear method is used to clear the status, logs, snapshot and data
123
108
  variables.
124
109
 
125
110
  :param self: Refer to the class instance
@@ -127,7 +112,6 @@ class AppCache:
127
112
  """
128
113
  self._status = None
129
114
  self._logs = None
130
- self._backup = None
131
115
  self._app_data = None
132
116
  self._snapshot = None
133
117
 
@@ -136,7 +120,7 @@ class AppCache:
136
120
  The update method is used to update the data of a given instance.
137
121
  It takes in an arbitrary number of arguments, and updates the
138
122
  corresponding data if it is one of the following types:
139
- StatusData, LogsData, Backup or AppData.
123
+ StatusData, LogsData, Snapshot or AppData.
140
124
  If any other type is provided as an argument to this function,
141
125
  a SquareException will be raised.
142
126
 
@@ -149,7 +133,6 @@ class AppCache:
149
133
  elif isinstance(arg, LogsData):
150
134
  self._logs = arg
151
135
  elif isinstance(arg, Snapshot):
152
- self._backup = arg
153
136
  self._snapshot = arg
154
137
  elif isinstance(arg, AppData):
155
138
  self._app_data = arg
@@ -491,20 +474,6 @@ class Application(CaptureListenerManager):
491
474
  status: StatusData = await self.client.app_status(self.id)
492
475
  return status
493
476
 
494
- @_update_cache
495
- @_notify_listener(Endpoint.snapshot())
496
- @deprecated("this method will be removed in future versions, use the 'snapshot' method instead")
497
- async def backup(self, *_args, **_kwargs) -> Snapshot:
498
- """
499
- The backup function is used to create a backup of the application.
500
-
501
- :param self: Refer to the class instance
502
- :return: A Backup object
503
- :rtype: Backup
504
- """
505
- backup: Snapshot = await self.client.snapshot(self.id)
506
- return backup
507
-
508
477
  @_update_cache
509
478
  @_notify_listener(Endpoint.snapshot())
510
479
  async def snapshot(self, *_args, **_kwargs) -> Snapshot:
@@ -570,7 +539,7 @@ class Application(CaptureListenerManager):
570
539
  )
571
540
  return response
572
541
 
573
- @validate
542
+
574
543
  async def commit(self, file: File) -> Response:
575
544
  """
576
545
  The commit function is used to commit the application.
@@ -586,7 +555,7 @@ class Application(CaptureListenerManager):
586
555
  )
587
556
  return response
588
557
 
589
- @validate
558
+
590
559
  async def files_list(self, path: str) -> list[FileInfo]:
591
560
  """
592
561
  The files_list function returns a list of files and folders in the
@@ -604,7 +573,7 @@ class Application(CaptureListenerManager):
604
573
  )
605
574
  return response
606
575
 
607
- @validate
576
+
608
577
  async def read_file(self, path: str) -> BytesIO:
609
578
  """
610
579
  The read_file function reads the contents of a file from an app.
@@ -619,7 +588,7 @@ class Application(CaptureListenerManager):
619
588
  )
620
589
  return response
621
590
 
622
- @validate
591
+
623
592
  async def create_file(self, file: File, path: str) -> Response:
624
593
  """
625
594
  The create_file function creates a file in the specified path.
@@ -638,7 +607,7 @@ class Application(CaptureListenerManager):
638
607
  )
639
608
  return response
640
609
 
641
- @validate
610
+
642
611
  async def delete_file(self, path: str) -> Response:
643
612
  """
644
613
  The delete_file function deletes a file from the app.
@@ -668,7 +637,7 @@ class Application(CaptureListenerManager):
668
637
  )
669
638
  return response
670
639
 
671
- @validate
640
+
672
641
  async def github_integration(self, access_token: str) -> str:
673
642
  """
674
643
  The create_github_integration function returns a webhook to integrate
@@ -713,11 +682,6 @@ class Application(CaptureListenerManager):
713
682
  )
714
683
  return response
715
684
 
716
- @deprecated("this method will be removed in future versions, use the 'all_snapshots' method instead")
717
- async def all_backups(self) -> list[SnapshotInfo]:
718
- backups: list[SnapshotInfo] = await self.client.all_app_snapshots(self.id)
719
- return backups
720
-
721
685
  async def all_snapshots(self) -> list[SnapshotInfo]:
722
686
  """
723
687
  Retrieve all snapshots of the application.
@@ -728,7 +692,7 @@ class Application(CaptureListenerManager):
728
692
  snapshots: list[SnapshotInfo] = await self.client.all_app_snapshots(self.id)
729
693
  return snapshots
730
694
 
731
- @validate
695
+
732
696
  async def move_file(self, origin: str, dest: str) -> Response:
733
697
  """
734
698
  Moves a file from the origin path to the destination path within the application.