Skip to content

Commit 7979edd

Browse files
authored
Merge pull request #113 from appwrite/dev
Add inc/dec
2 parents 503de4b + 228f76b commit 7979edd

25 files changed

+544
-12
lines changed

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
1-
# Change Log
1+
# Change Log
2+
3+
## 11.1.0
4+
5+
* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service
6+
* Add `dart38` and `flutter332` support to runtime models
7+
* Add `gif` support to `ImageFormat` enum
8+
* Add `upsertDocument` support to `Databases` service
9+
10+
## 11.0.0
11+
12+
* Add `<REGION>` to doc examples due to the new multi region endpoints
13+
* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc.
14+
* Add doc examples, class and methods for new `Sites` service
15+
* Add doc examples, class and methods for new `Tokens` service
16+
* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType`
17+
* Update enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329
18+
* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage
19+
* Add `queries` and `search` params to `listMemberships` method
20+
* Remove `search` param from `listExecutions` method
21+
22+
## 10.0.0
23+
24+
* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests
25+
26+
## 9.0.3
27+
28+
* Update sdk to use Numpy-style docstrings

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Appwrite Python SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square)
4-
![Version](https://img.shields.io/badge/api%20version-1.7.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

appwrite/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ def __init__(self):
1414
self._endpoint = 'https://cloud.appwrite.io/v1'
1515
self._global_headers = {
1616
'content-type': '',
17-
'user-agent' : f'AppwritePythonSDK/11.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
17+
'user-agent' : f'AppwritePythonSDK/11.1.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
1818
'x-sdk-name': 'Python',
1919
'x-sdk-platform': 'server',
2020
'x-sdk-language': 'python',
21-
'x-sdk-version': '11.0.0',
21+
'x-sdk-version': '11.1.0',
2222
'X-Appwrite-Response-Format' : '1.7.0',
2323
}
2424

appwrite/enums/build_runtime.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class BuildRuntime(Enum):
3838
DART_3_1 = "dart-3.1"
3939
DART_3_3 = "dart-3.3"
4040
DART_3_5 = "dart-3.5"
41+
DART_3_8 = "dart-3.8"
4142
DOTNET_6_0 = "dotnet-6.0"
4243
DOTNET_7_0 = "dotnet-7.0"
4344
DOTNET_8_0 = "dotnet-8.0"
@@ -64,3 +65,4 @@ class BuildRuntime(Enum):
6465
FLUTTER_3_24 = "flutter-3.24"
6566
FLUTTER_3_27 = "flutter-3.27"
6667
FLUTTER_3_29 = "flutter-3.29"
68+
FLUTTER_3_32 = "flutter-3.32"

appwrite/enums/image_format.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ class ImageFormat(Enum):
77
WEBP = "webp"
88
HEIC = "heic"
99
AVIF = "avif"
10+
GIF = "gif"

appwrite/enums/runtime.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class Runtime(Enum):
3838
DART_3_1 = "dart-3.1"
3939
DART_3_3 = "dart-3.3"
4040
DART_3_5 = "dart-3.5"
41+
DART_3_8 = "dart-3.8"
4142
DOTNET_6_0 = "dotnet-6.0"
4243
DOTNET_7_0 = "dotnet-7.0"
4344
DOTNET_8_0 = "dotnet-8.0"
@@ -64,3 +65,4 @@ class Runtime(Enum):
6465
FLUTTER_3_24 = "flutter-3.24"
6566
FLUTTER_3_27 = "flutter-3.27"
6667
FLUTTER_3_29 = "flutter-3.29"
68+
FLUTTER_3_32 = "flutter-3.32"

appwrite/services/account.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def create(self, user_id: str, email: str, password: str, name: str = None) -> D
3535
"""
3636
Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession).
3737
38+
3839
Parameters
3940
----------
4041
user_id : str
@@ -84,6 +85,7 @@ def update_email(self, email: str, password: str) -> Dict[str, Any]:
8485
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
8586
8687
88+
8789
Parameters
8890
----------
8991
email : str
@@ -122,6 +124,7 @@ def list_identities(self, queries: List[str] = None) -> Dict[str, Any]:
122124
"""
123125
Get the list of identities for the currently logged in user.
124126
127+
125128
Parameters
126129
----------
127130
queries : List[str]
@@ -150,6 +153,7 @@ def delete_identity(self, identity_id: str) -> Dict[str, Any]:
150153
"""
151154
Delete an identity by its unique ID.
152155
156+
153157
Parameters
154158
----------
155159
identity_id : str
@@ -204,6 +208,7 @@ def list_logs(self, queries: List[str] = None) -> Dict[str, Any]:
204208
"""
205209
Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.
206210
211+
207212
Parameters
208213
----------
209214
queries : List[str]
@@ -232,6 +237,7 @@ def update_mfa(self, mfa: bool) -> Dict[str, Any]:
232237
"""
233238
Enable or disable MFA on an account.
234239
240+
235241
Parameters
236242
----------
237243
mfa : bool
@@ -264,6 +270,7 @@ def create_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]:
264270
"""
265271
Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.
266272
273+
267274
Parameters
268275
----------
269276
type : AuthenticatorType
@@ -296,6 +303,7 @@ def update_mfa_authenticator(self, type: AuthenticatorType, otp: str) -> Dict[st
296303
"""
297304
Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.
298305
306+
299307
Parameters
300308
----------
301309
type : AuthenticatorType
@@ -334,6 +342,7 @@ def delete_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]:
334342
"""
335343
Delete an authenticator for a user by ID.
336344
345+
337346
Parameters
338347
----------
339348
type : AuthenticatorType
@@ -366,6 +375,7 @@ def create_mfa_challenge(self, factor: AuthenticationFactor) -> Dict[str, Any]:
366375
"""
367376
Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
368377
378+
369379
Parameters
370380
----------
371381
factor : AuthenticationFactor
@@ -398,6 +408,7 @@ def update_mfa_challenge(self, challenge_id: str, otp: str) -> Dict[str, Any]:
398408
"""
399409
Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
400410
411+
401412
Parameters
402413
----------
403414
challenge_id : str
@@ -522,6 +533,7 @@ def update_name(self, name: str) -> Dict[str, Any]:
522533
"""
523534
Update currently logged in user account name.
524535
536+
525537
Parameters
526538
----------
527539
name : str
@@ -554,6 +566,7 @@ def update_password(self, password: str, old_password: str = None) -> Dict[str,
554566
"""
555567
Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.
556568
569+
557570
Parameters
558571
----------
559572
password : str
@@ -589,6 +602,7 @@ def update_phone(self, phone: str, password: str) -> Dict[str, Any]:
589602
"""
590603
Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.
591604
605+
592606
Parameters
593607
----------
594608
phone : str
@@ -648,6 +662,7 @@ def update_prefs(self, prefs: dict) -> Dict[str, Any]:
648662
"""
649663
Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
650664
665+
651666
Parameters
652667
----------
653668
prefs : dict
@@ -680,6 +695,7 @@ def create_recovery(self, email: str, url: str) -> Dict[str, Any]:
680695
"""
681696
Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.
682697
698+
683699
Parameters
684700
----------
685701
email : str
@@ -720,6 +736,7 @@ def update_recovery(self, user_id: str, secret: str, password: str) -> Dict[str,
720736
721737
Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
722738
739+
723740
Parameters
724741
----------
725742
user_id : str
@@ -831,6 +848,7 @@ def create_email_password_session(self, email: str, password: str) -> Dict[str,
831848
832849
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
833850
851+
834852
Parameters
835853
----------
836854
email : str
@@ -869,6 +887,7 @@ def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]:
869887
"""
870888
Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
871889
890+
872891
Parameters
873892
----------
874893
user_id : str
@@ -907,6 +926,7 @@ def update_phone_session(self, user_id: str, secret: str) -> Dict[str, Any]:
907926
"""
908927
Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
909928
929+
910930
Parameters
911931
----------
912932
user_id : str
@@ -945,6 +965,7 @@ def create_session(self, user_id: str, secret: str) -> Dict[str, Any]:
945965
"""
946966
Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
947967
968+
948969
Parameters
949970
----------
950971
user_id : str
@@ -983,6 +1004,7 @@ def get_session(self, session_id: str) -> Dict[str, Any]:
9831004
"""
9841005
Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.
9851006
1007+
9861008
Parameters
9871009
----------
9881010
session_id : str
@@ -1014,6 +1036,7 @@ def update_session(self, session_id: str) -> Dict[str, Any]:
10141036
"""
10151037
Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.
10161038
1039+
10171040
Parameters
10181041
----------
10191042
session_id : str
@@ -1046,6 +1069,7 @@ def delete_session(self, session_id: str) -> Dict[str, Any]:
10461069
"""
10471070
Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead.
10481071
1072+
10491073
Parameters
10501074
----------
10511075
session_id : str
@@ -1102,6 +1126,7 @@ def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> D
11021126
11031127
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
11041128
1129+
11051130
Parameters
11061131
----------
11071132
user_id : str
@@ -1146,6 +1171,7 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra
11461171
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
11471172
11481173
1174+
11491175
Parameters
11501176
----------
11511177
user_id : str
@@ -1194,6 +1220,7 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai
11941220
11951221
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
11961222
1223+
11971224
Parameters
11981225
----------
11991226
provider : OAuthProvider
@@ -1236,6 +1263,7 @@ def create_phone_token(self, user_id: str, phone: str) -> Dict[str, Any]:
12361263
12371264
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
12381265
1266+
12391267
Parameters
12401268
----------
12411269
user_id : str
@@ -1277,6 +1305,7 @@ def create_verification(self, url: str) -> Dict[str, Any]:
12771305
Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
12781306
12791307
1308+
12801309
Parameters
12811310
----------
12821311
url : str
@@ -1309,6 +1338,7 @@ def update_verification(self, user_id: str, secret: str) -> Dict[str, Any]:
13091338
"""
13101339
Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.
13111340
1341+
13121342
Parameters
13131343
----------
13141344
user_id : str
@@ -1369,6 +1399,7 @@ def update_phone_verification(self, user_id: str, secret: str) -> Dict[str, Any]
13691399
"""
13701400
Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.
13711401
1402+
13721403
Parameters
13731404
----------
13741405
user_id : str

appwrite/services/avatars.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def get_browser(self, code: Browser, width: float = None, height: float = None,
1616
1717
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
1818
19+
1920
Parameters
2021
----------
2122
code : Browser
@@ -59,6 +60,7 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float =
5960
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
6061
6162
63+
6264
Parameters
6365
----------
6466
code : CreditCard
@@ -101,6 +103,7 @@ def get_favicon(self, url: str) -> bytes:
101103
102104
This endpoint does not follow HTTP redirects.
103105
106+
104107
Parameters
105108
----------
106109
url : str
@@ -135,6 +138,7 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit
135138
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
136139
137140
141+
138142
Parameters
139143
----------
140144
code : Flag
@@ -179,6 +183,7 @@ def get_image(self, url: str, width: float = None, height: float = None) -> byte
179183
180184
This endpoint does not follow HTTP redirects.
181185
186+
182187
Parameters
183188
----------
184189
url : str
@@ -221,6 +226,7 @@ def get_initials(self, name: str = None, width: float = None, height: float = No
221226
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
222227
223228
229+
224230
Parameters
225231
----------
226232
name : str
@@ -259,6 +265,7 @@ def get_qr(self, text: str, size: float = None, margin: float = None, download:
259265
Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
260266
261267
268+
262269
Parameters
263270
----------
264271
text : str

0 commit comments

Comments
 (0)