Skip to content

Commit e637953

Browse files
committed
regen
1 parent c045956 commit e637953

37 files changed

+1197
-895
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## 13.4.2
4+
5+
* Fix adding `Optional[]` to optional parameters
6+
* Fix passing of `None` to nullable parameters
7+
38
## 13.4.1
49

510
* Add transaction support for Databases and TablesDB

appwrite/client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ def __init__(self):
1515
self._endpoint = 'https://cloud.appwrite.io/v1'
1616
self._global_headers = {
1717
'content-type': '',
18-
'user-agent' : f'AppwritePythonSDK/13.4.1 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
18+
'user-agent' : f'AppwritePythonSDK/13.4.2 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
1919
'x-sdk-name': 'Python',
2020
'x-sdk-platform': 'server',
2121
'x-sdk-language': 'python',
22-
'x-sdk-version': '13.4.1',
22+
'x-sdk-version': '13.4.2',
2323
'X-Appwrite-Response-Format' : '1.8.0',
2424
}
2525

@@ -79,8 +79,6 @@ def call(self, method, path='', headers=None, params=None, response_type='json')
7979
if params is None:
8080
params = {}
8181

82-
params = {k: v for k, v in params.items() if v is not None} # Remove None values from params dictionary
83-
8482
data = {}
8583
files = {}
8684
stringify = False

appwrite/enums/execution_status.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ class ExecutionStatus(Enum):
55
PROCESSING = "processing"
66
COMPLETED = "completed"
77
FAILED = "failed"
8+
SCHEDULED = "scheduled"

appwrite/enums/framework.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class Framework(Enum):
99
VUE = "vue"
1010
SVELTEKIT = "sveltekit"
1111
ASTRO = "astro"
12+
TANSTACK_START = "tanstack-start"
1213
REMIX = "remix"
1314
LYNX = "lynx"
1415
FLUTTER = "flutter"

appwrite/services/account.py

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from ..service import Service
2-
from typing import List, Dict, Any
2+
from typing import List, Dict, Any, Optional
33
from ..exception import AppwriteException
4+
from appwrite.utils.deprecated import deprecated
45
from ..enums.authenticator_type import AuthenticatorType;
56
from ..enums.authentication_factor import AuthenticationFactor;
67
from ..enums.o_auth_provider import OAuthProvider;
@@ -31,7 +32,7 @@ def get(self) -> Dict[str, Any]:
3132
return self.client.call('get', api_path, {
3233
}, api_params)
3334

34-
def create(self, user_id: str, email: str, password: str, name: str = None) -> Dict[str, Any]:
35+
def create(self, user_id: str, email: str, password: str, name: Optional[str] = None) -> Dict[str, Any]:
3536
"""
3637
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).
3738
@@ -43,7 +44,7 @@ def create(self, user_id: str, email: str, password: str, name: str = None) -> D
4344
User email.
4445
password : str
4546
New user password. Must be between 8 and 256 chars.
46-
name : str
47+
name : Optional[str]
4748
User name. Max length: 128 chars.
4849
4950
Returns
@@ -118,13 +119,13 @@ def update_email(self, email: str, password: str) -> Dict[str, Any]:
118119
'content-type': 'application/json',
119120
}, api_params)
120121

121-
def list_identities(self, queries: List[str] = None) -> Dict[str, Any]:
122+
def list_identities(self, queries: Optional[List[str]] = None) -> Dict[str, Any]:
122123
"""
123124
Get the list of identities for the currently logged in user.
124125
125126
Parameters
126127
----------
127-
queries : List[str]
128+
queries : Optional[List[str]]
128129
Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry
129130
130131
Returns
@@ -200,13 +201,13 @@ def create_jwt(self) -> Dict[str, Any]:
200201
'content-type': 'application/json',
201202
}, api_params)
202203

203-
def list_logs(self, queries: List[str] = None) -> Dict[str, Any]:
204+
def list_logs(self, queries: Optional[List[str]] = None) -> Dict[str, Any]:
204205
"""
205206
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.
206207
207208
Parameters
208209
----------
209-
queries : List[str]
210+
queries : Optional[List[str]]
210211
Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
211212
212213
Returns
@@ -550,15 +551,15 @@ def update_name(self, name: str) -> Dict[str, Any]:
550551
'content-type': 'application/json',
551552
}, api_params)
552553

553-
def update_password(self, password: str, old_password: str = None) -> Dict[str, Any]:
554+
def update_password(self, password: str, old_password: Optional[str] = None) -> Dict[str, Any]:
554555
"""
555556
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.
556557
557558
Parameters
558559
----------
559560
password : str
560561
New user password. Must be at least 8 chars.
561-
old_password : str
562+
old_password : Optional[str]
562563
Current user password. Must be at least 8 chars.
563564
564565
Returns
@@ -865,6 +866,7 @@ def create_email_password_session(self, email: str, password: str) -> Dict[str,
865866
'content-type': 'application/json',
866867
}, api_params)
867868

869+
@deprecated("This API has been deprecated since 1.6.0. Please use `account.create_session` instead.")
868870
def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]:
869871
"""
870872
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.
@@ -905,6 +907,7 @@ def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]:
905907
'content-type': 'application/json',
906908
}, api_params)
907909

910+
@deprecated("This API has been deprecated since 1.6.0. Please use `account.create_session` instead.")
908911
def update_phone_session(self, user_id: str, secret: str) -> Dict[str, Any]:
909912
"""
910913
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.
@@ -1100,7 +1103,7 @@ def update_status(self) -> Dict[str, Any]:
11001103
'content-type': 'application/json',
11011104
}, api_params)
11021105

1103-
def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> Dict[str, Any]:
1106+
def create_email_token(self, user_id: str, email: str, phrase: Optional[bool] = None) -> Dict[str, Any]:
11041107
"""
11051108
Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
11061109
@@ -1113,7 +1116,7 @@ def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> D
11131116
User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
11141117
email : str
11151118
User email.
1116-
phrase : bool
1119+
phrase : Optional[bool]
11171120
Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
11181121
11191122
Returns
@@ -1144,7 +1147,7 @@ def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> D
11441147
'content-type': 'application/json',
11451148
}, api_params)
11461149

1147-
def create_magic_url_token(self, user_id: str, email: str, url: str = None, phrase: bool = None) -> Dict[str, Any]:
1150+
def create_magic_url_token(self, user_id: str, email: str, url: Optional[str] = None, phrase: Optional[bool] = None) -> Dict[str, Any]:
11481151
"""
11491152
Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.
11501153
@@ -1157,9 +1160,9 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra
11571160
Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
11581161
email : str
11591162
User email.
1160-
url : str
1163+
url : Optional[str]
11611164
URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1162-
phrase : bool
1165+
phrase : Optional[bool]
11631166
Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
11641167
11651168
Returns
@@ -1191,7 +1194,7 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra
11911194
'content-type': 'application/json',
11921195
}, api_params)
11931196

1194-
def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, failure: str = None, scopes: List[str] = None) -> str:
1197+
def create_o_auth2_token(self, provider: OAuthProvider, success: Optional[str] = None, failure: Optional[str] = None, scopes: Optional[List[str]] = None) -> str:
11951198
"""
11961199
Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.
11971200
@@ -1203,11 +1206,11 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai
12031206
----------
12041207
provider : OAuthProvider
12051208
OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
1206-
success : str
1209+
success : Optional[str]
12071210
URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1208-
failure : str
1211+
failure : Optional[str]
12091212
URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1210-
scopes : List[str]
1213+
scopes : Optional[List[str]]
12111214
A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
12121215
12131216
Returns
@@ -1310,6 +1313,7 @@ def create_email_verification(self, url: str) -> Dict[str, Any]:
13101313
'content-type': 'application/json',
13111314
}, api_params)
13121315

1316+
@deprecated("This API has been deprecated since 1.8.0. Please use `account.create_email_verification` instead.")
13131317
def create_verification(self, url: str) -> Dict[str, Any]:
13141318
"""
13151319
Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.
@@ -1385,6 +1389,7 @@ def update_email_verification(self, user_id: str, secret: str) -> Dict[str, Any]
13851389
'content-type': 'application/json',
13861390
}, api_params)
13871391

1392+
@deprecated("This API has been deprecated since 1.8.0. Please use `account.update_email_verification` instead.")
13881393
def update_verification(self, user_id: str, secret: str) -> Dict[str, Any]:
13891394
"""
13901395
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.

0 commit comments

Comments
 (0)