diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ddce6e..8a7e67d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 19.1.0 + +* Added `DENO_1_21`, `DENO_1_24`, and `DENO_1_35` runtime options +* Added `sizeactual` field to `File` model for compressed file size +* Updated `BillingLimits` model fields to be optional +* Updated `Project` model `billinglimits` field to be optional +* Updated authentication examples in advisor documentation + ## 19.0.0 * Breaking: Renamed `AuthMethod` enum to `ProjectAuthMethodId` diff --git a/appwrite/client.py b/appwrite/client.py index 5153438..35a3116 100644 --- a/appwrite/client.py +++ b/appwrite/client.py @@ -15,11 +15,11 @@ def __init__(self): self._endpoint = 'https://cloud.appwrite.io/v1' self._global_headers = { 'content-type': '', - 'user-agent' : f'AppwritePythonSDK/19.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', + 'user-agent' : f'AppwritePythonSDK/19.1.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})', 'x-sdk-name': 'Python', 'x-sdk-platform': 'server', 'x-sdk-language': 'python', - 'x-sdk-version': '19.0.0', + 'x-sdk-version': '19.1.0', 'X-Appwrite-Response-Format' : '1.9.5', } diff --git a/appwrite/enums/build_runtime.py b/appwrite/enums/build_runtime.py index 427d6c2..18fa29d 100644 --- a/appwrite/enums/build_runtime.py +++ b/appwrite/enums/build_runtime.py @@ -32,6 +32,9 @@ class BuildRuntime(Enum): PYTHON_ML_3_11 = "python-ml-3.11" PYTHON_ML_3_12 = "python-ml-3.12" PYTHON_ML_3_13 = "python-ml-3.13" + DENO_1_21 = "deno-1.21" + DENO_1_24 = "deno-1.24" + DENO_1_35 = "deno-1.35" DENO_1_40 = "deno-1.40" DENO_1_46 = "deno-1.46" DENO_2_0 = "deno-2.0" diff --git a/appwrite/enums/runtime.py b/appwrite/enums/runtime.py index 2572cb0..7a2ac6f 100644 --- a/appwrite/enums/runtime.py +++ b/appwrite/enums/runtime.py @@ -32,6 +32,9 @@ class Runtime(Enum): PYTHON_ML_3_11 = "python-ml-3.11" PYTHON_ML_3_12 = "python-ml-3.12" PYTHON_ML_3_13 = "python-ml-3.13" + DENO_1_21 = "deno-1.21" + DENO_1_24 = "deno-1.24" + DENO_1_35 = "deno-1.35" DENO_1_40 = "deno-1.40" DENO_1_46 = "deno-1.46" DENO_2_0 = "deno-2.0" diff --git a/appwrite/models/billing_limits.py b/appwrite/models/billing_limits.py index c66878e..c7c5b74 100644 --- a/appwrite/models/billing_limits.py +++ b/appwrite/models/billing_limits.py @@ -9,28 +9,28 @@ class BillingLimits(AppwriteModel): Attributes ---------- - bandwidth : float + bandwidth : Optional[float] Bandwidth limit - storage : float + storage : Optional[float] Storage limit - users : float + users : Optional[float] Users limit - executions : float + executions : Optional[float] Executions limit - gbhours : float + gbhours : Optional[float] GBHours limit - imagetransformations : float + imagetransformations : Optional[float] Image transformations limit - authphone : float + authphone : Optional[float] Auth phone limit - budgetlimit : float + budgetlimit : Optional[float] Budget limit percentage """ - bandwidth: float = Field(..., alias='bandwidth') - storage: float = Field(..., alias='storage') - users: float = Field(..., alias='users') - executions: float = Field(..., alias='executions') - gbhours: float = Field(..., alias='GBHours') - imagetransformations: float = Field(..., alias='imageTransformations') - authphone: float = Field(..., alias='authPhone') - budgetlimit: float = Field(..., alias='budgetLimit') + bandwidth: Optional[float] = Field(default=None, alias='bandwidth') + storage: Optional[float] = Field(default=None, alias='storage') + users: Optional[float] = Field(default=None, alias='users') + executions: Optional[float] = Field(default=None, alias='executions') + gbhours: Optional[float] = Field(default=None, alias='GBHours') + imagetransformations: Optional[float] = Field(default=None, alias='imageTransformations') + authphone: Optional[float] = Field(default=None, alias='authPhone') + budgetlimit: Optional[float] = Field(default=None, alias='budgetLimit') diff --git a/appwrite/models/file.py b/appwrite/models/file.py index 8eb4590..a49ee80 100644 --- a/appwrite/models/file.py +++ b/appwrite/models/file.py @@ -27,6 +27,8 @@ class File(AppwriteModel): File mime type. sizeoriginal : float File original size in bytes. + sizeactual : float + File actual stored size in bytes after compression and/or encryption. chunkstotal : float Total number of chunks available chunksuploaded : float @@ -45,6 +47,7 @@ class File(AppwriteModel): signature: str = Field(..., alias='signature') mimetype: str = Field(..., alias='mimeType') sizeoriginal: float = Field(..., alias='sizeOriginal') + sizeactual: float = Field(..., alias='sizeActual') chunkstotal: float = Field(..., alias='chunksTotal') chunksuploaded: float = Field(..., alias='chunksUploaded') encryption: bool = Field(..., alias='encryption') diff --git a/appwrite/models/project.py b/appwrite/models/project.py index cb40286..d717a07 100644 --- a/appwrite/models/project.py +++ b/appwrite/models/project.py @@ -63,7 +63,7 @@ class Project(AppwriteModel): List of protocols. region : str Project region - billinglimits : BillingLimits + billinglimits : Optional[BillingLimits] Billing limits reached blocks : List[Block] Project blocks information @@ -94,6 +94,6 @@ class Project(AppwriteModel): services: List[ProjectService] = Field(..., alias='services') protocols: List[ProjectProtocol] = Field(..., alias='protocols') region: str = Field(..., alias='region') - billinglimits: BillingLimits = Field(..., alias='billingLimits') + billinglimits: Optional[BillingLimits] = Field(default=None, alias='billingLimits') blocks: List[Block] = Field(..., alias='blocks') consoleaccessedat: str = Field(..., alias='consoleAccessedAt') diff --git a/docs/examples/advisor/get-insight.md b/docs/examples/advisor/get-insight.md index 16607e0..7f4b804 100644 --- a/docs/examples/advisor/get-insight.md +++ b/docs/examples/advisor/get-insight.md @@ -6,7 +6,7 @@ from appwrite.models import Insight client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('') # Your project ID -client.set_session('') # The user session to authenticate with +client.set_key('') # Your secret API key advisor = Advisor(client) diff --git a/docs/examples/advisor/get-report.md b/docs/examples/advisor/get-report.md index 60abf55..2d9836a 100644 --- a/docs/examples/advisor/get-report.md +++ b/docs/examples/advisor/get-report.md @@ -6,7 +6,7 @@ from appwrite.models import Report client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('') # Your project ID -client.set_session('') # The user session to authenticate with +client.set_key('') # Your secret API key advisor = Advisor(client) diff --git a/docs/examples/advisor/list-insights.md b/docs/examples/advisor/list-insights.md index 1e425fe..2813e6e 100644 --- a/docs/examples/advisor/list-insights.md +++ b/docs/examples/advisor/list-insights.md @@ -6,7 +6,7 @@ from appwrite.models import InsightList client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('') # Your project ID -client.set_session('') # The user session to authenticate with +client.set_key('') # Your secret API key advisor = Advisor(client) diff --git a/docs/examples/advisor/list-reports.md b/docs/examples/advisor/list-reports.md index 314464a..146bbf1 100644 --- a/docs/examples/advisor/list-reports.md +++ b/docs/examples/advisor/list-reports.md @@ -6,7 +6,7 @@ from appwrite.models import ReportList client = Client() client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint client.set_project('') # Your project ID -client.set_session('') # The user session to authenticate with +client.set_key('') # Your secret API key advisor = Advisor(client) diff --git a/pyproject.toml b/pyproject.toml index d7611fe..405b3d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "appwrite" -version = "19.0.0" +version = "19.1.0" description = "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API" readme = "README.md" requires-python = ">=3.9" diff --git a/setup.py b/setup.py index 5a19c99..1a878e9 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'appwrite', packages = setuptools.find_packages(), - version = '19.0.0', + version = '19.1.0', license='BSD-3-Clause', description = 'Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API', long_description = long_description, @@ -18,7 +18,7 @@ maintainer = 'Appwrite Team', maintainer_email = 'team@appwrite.io', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/19.0.0.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/19.1.0.tar.gz', install_requires=[ 'requests', 'pydantic>=2,<3', diff --git a/test/services/test_project.py b/test/services/test_project.py index 4c07438..2416271 100644 --- a/test/services/test_project.py +++ b/test/services/test_project.py @@ -40,16 +40,6 @@ def test_get(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -99,16 +89,6 @@ def test_update_auth_method(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -268,16 +248,6 @@ def test_update_labels(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -1384,16 +1354,6 @@ def test_update_deny_aliased_email_policy(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -1433,16 +1393,6 @@ def test_update_deny_disposable_email_policy(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -1482,16 +1432,6 @@ def test_update_deny_free_email_policy(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -1531,16 +1471,6 @@ def test_update_membership_privacy_policy(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -1579,16 +1509,6 @@ def test_update_password_dictionary_policy(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -1628,16 +1548,6 @@ def test_update_password_history_policy(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -1677,16 +1587,6 @@ def test_update_password_personal_data_policy(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -1726,16 +1626,6 @@ def test_update_session_alert_policy(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -1775,16 +1665,6 @@ def test_update_session_duration_policy(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -1824,16 +1704,6 @@ def test_update_session_invalidation_policy(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -1873,16 +1743,6 @@ def test_update_session_limit_policy(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -1922,16 +1782,6 @@ def test_update_user_limit_policy(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -1986,16 +1836,6 @@ def test_update_protocol(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -2036,16 +1876,6 @@ def test_update_service(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } @@ -2086,16 +1916,6 @@ def test_update_smtp(self, m): "services": [], "protocols": [], "region": "fra", - "billingLimits": { - "bandwidth": 5.0, - "storage": 150.0, - "users": 200000.0, - "executions": 750000.0, - "GBHours": 100.0, - "imageTransformations": 100.0, - "authPhone": 10.0, - "budgetLimit": 100.0 - }, "blocks": [], "consoleAccessedAt": "2020-10-15T06:38:00.000+00:00" } diff --git a/test/services/test_storage.py b/test/services/test_storage.py index 320a927..08ca786 100644 --- a/test/services/test_storage.py +++ b/test/services/test_storage.py @@ -149,6 +149,7 @@ def test_create_file(self, m): "signature": "5d529fd02b544198ae075bd57c1762bb", "mimeType": "image\/png", "sizeOriginal": 17890.0, + "sizeActual": 12345.0, "chunksTotal": 17890.0, "chunksUploaded": 17890.0, "encryption": True, @@ -177,6 +178,7 @@ def test_get_file(self, m): "signature": "5d529fd02b544198ae075bd57c1762bb", "mimeType": "image\/png", "sizeOriginal": 17890.0, + "sizeActual": 12345.0, "chunksTotal": 17890.0, "chunksUploaded": 17890.0, "encryption": True, @@ -204,6 +206,7 @@ def test_update_file(self, m): "signature": "5d529fd02b544198ae075bd57c1762bb", "mimeType": "image\/png", "sizeOriginal": 17890.0, + "sizeActual": 12345.0, "chunksTotal": 17890.0, "chunksUploaded": 17890.0, "encryption": True,