Skip to content

Commit 21f17cf

Browse files
committed
Appwite 1.5 support
1 parent e09bcc7 commit 21f17cf

33 files changed

+346
-130
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1212

13-
![Appwrite](https://appwrite.io/images/github.png)
13+
![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)
1414

1515
## Installation
1616

appwrite/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ def __init__(self):
1313
self._endpoint = 'https://cloud.appwrite.io/v1'
1414
self._global_headers = {
1515
'content-type': '',
16-
'user-agent' : 'AppwritePythonSDK/5.0.0-rc.6 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})',
16+
'user-agent' : 'AppwritePythonSDK/5.0.0 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})',
1717
'x-sdk-name': 'Python',
1818
'x-sdk-platform': 'server',
1919
'x-sdk-language': 'python',
20-
'x-sdk-version': '5.0.0-rc.6',
20+
'x-sdk-version': '5.0.0',
2121
'X-Appwrite-Response-Format' : '1.5.0',
2222
}
2323

appwrite/encoders/value_class_encoder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import json
2-
from ..enums.authentication_factor import AuthenticationFactor
32
from ..enums.authenticator_type import AuthenticatorType
3+
from ..enums.authentication_factor import AuthenticationFactor
44
from ..enums.o_auth_provider import OAuthProvider
55
from ..enums.browser import Browser
66
from ..enums.credit_card import CreditCard
@@ -20,10 +20,10 @@
2020

2121
class ValueClassEncoder(json.JSONEncoder):
2222
def default(self, o):
23-
if isinstance(o, AuthenticationFactor):
23+
if isinstance(o, AuthenticatorType):
2424
return o.value
2525

26-
if isinstance(o, AuthenticatorType):
26+
if isinstance(o, AuthenticationFactor):
2727
return o.value
2828

2929
if isinstance(o, OAuthProvider):
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from enum import Enum
22

33
class AuthenticationFactor(Enum):
4-
TOTP = "totp"
5-
PHONE = "phone"
64
EMAIL = "email"
5+
PHONE = "phone"
6+
TOTP = "totp"
7+
RECOVERYCODE = "recoverycode"

appwrite/enums/flag.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Flag(Enum):
3434
SWITZERLAND = "ch"
3535
CHILE = "cl"
3636
CHINA = "cn"
37-
CôTE_D'IVOIRE = "ci"
37+
COTE_DIVOIRE = "ci"
3838
CAMEROON = "cm"
3939
DEMOCRATIC_REPUBLIC_OF_THE_CONGO = "cd"
4040
REPUBLIC_OF_THE_CONGO = "cg"
@@ -67,7 +67,7 @@ class Flag(Enum):
6767
GHANA = "gh"
6868
GUINEA = "gn"
6969
GAMBIA = "gm"
70-
GUINEABISSAU = "gw"
70+
GUINEA_BISSAU = "gw"
7171
EQUATORIAL_GUINEA = "gq"
7272
GREECE = "gr"
7373
GRENADA = "gd"
@@ -96,7 +96,7 @@ class Flag(Enum):
9696
SAINT_KITTS_AND_NEVIS = "kn"
9797
SOUTH_KOREA = "kr"
9898
KUWAIT = "kw"
99-
LAO_PEOPLE'S_DEMOCRATIC_REPUBLIC = "la"
99+
LAO_PEOPLES_DEMOCRATIC_REPUBLIC = "la"
100100
LEBANON = "lb"
101101
LIBERIA = "lr"
102102
LIBYA = "ly"
@@ -173,7 +173,7 @@ class Flag(Enum):
173173
THAILAND = "th"
174174
TAJIKISTAN = "tj"
175175
TURKMENISTAN = "tm"
176-
TIMORLESTE = "tl"
176+
TIMOR_LESTE = "tl"
177177
TONGA = "to"
178178
TRINIDAD_AND_TOBAGO = "tt"
179179
TUNISIA = "tn"

appwrite/enums/image_gravity.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
class ImageGravity(Enum):
44
CENTER = "center"
5-
TOPLEFT = "top-left"
5+
TOP_LEFT = "top-left"
66
TOP = "top"
7-
TOPRIGHT = "top-right"
7+
TOP_RIGHT = "top-right"
88
LEFT = "left"
99
RIGHT = "right"
10-
BOTTOMLEFT = "bottom-left"
10+
BOTTOM_LEFT = "bottom-left"
1111
BOTTOM = "bottom"
12-
BOTTOMRIGHT = "bottom-right"
12+
BOTTOM_RIGHT = "bottom-right"

appwrite/enums/name.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
from enum import Enum
22

33
class Name(Enum):
4-
V1DATABASE = "v1-database"
5-
V1DELETES = "v1-deletes"
6-
V1AUDITS = "v1-audits"
7-
V1MAILS = "v1-mails"
8-
V1FUNCTIONS = "v1-functions"
9-
V1USAGE = "v1-usage"
4+
V1_DATABASE = "v1-database"
5+
V1_DELETES = "v1-deletes"
6+
V1_AUDITS = "v1-audits"
7+
V1_MAILS = "v1-mails"
8+
V1_FUNCTIONS = "v1-functions"
9+
V1_USAGE = "v1-usage"
10+
V1_USAGE_DUMP = "v1-usage-dump"
1011
WEBHOOKSV1 = "webhooksv1"
11-
V1CERTIFICATES = "v1-certificates"
12-
V1BUILDS = "v1-builds"
13-
V1MESSAGING = "v1-messaging"
14-
V1MIGRATIONS = "v1-migrations"
12+
V1_CERTIFICATES = "v1-certificates"
13+
V1_BUILDS = "v1-builds"
14+
V1_MESSAGING = "v1-messaging"
15+
V1_MIGRATIONS = "v1-migrations"
1516
HAMSTERV1 = "hamsterv1"

appwrite/enums/password_hash.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ class PasswordHash(Enum):
55
SHA224 = "sha224"
66
SHA256 = "sha256"
77
SHA384 = "sha384"
8-
SHA512/224 = "sha512/224"
9-
SHA512/256 = "sha512/256"
8+
SHA512_224 = "sha512/224"
9+
SHA512_256 = "sha512/256"
1010
SHA512 = "sha512"
11-
SHA3224 = "sha3-224"
12-
SHA3256 = "sha3-256"
13-
SHA3384 = "sha3-384"
14-
SHA3512 = "sha3-512"
11+
SHA3_224 = "sha3-224"
12+
SHA3_256 = "sha3-256"
13+
SHA3_384 = "sha3-384"
14+
SHA3_512 = "sha3-512"

appwrite/enums/runtime.py

Lines changed: 44 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,47 @@
11
from enum import Enum
22

33
class Runtime(Enum):
4-
NODE145 = "node-14.5"
5-
NODE160 = "node-16.0"
6-
NODE180 = "node-18.0"
7-
NODE190 = "node-19.0"
8-
NODE200 = "node-20.0"
9-
PHP80 = "php-8.0"
10-
PHP81 = "php-8.1"
11-
PHP82 = "php-8.2"
12-
RUBY30 = "ruby-3.0"
13-
RUBY31 = "ruby-3.1"
14-
RUBY32 = "ruby-3.2"
15-
PYTHON38 = "python-3.8"
16-
PYTHON39 = "python-3.9"
17-
PYTHON310 = "python-3.10"
18-
PYTHON311 = "python-3.11"
19-
PYTHON312 = "python-3.12"
20-
DART215 = "dart-2.15"
21-
DART216 = "dart-2.16"
22-
DART217 = "dart-2.17"
23-
DART218 = "dart-2.18"
24-
DART30 = "dart-3.0"
25-
DART31 = "dart-3.1"
26-
DOTNET31 = "dotnet-3.1"
27-
DOTNET60 = "dotnet-6.0"
28-
DOTNET70 = "dotnet-7.0"
29-
JAVA80 = "java-8.0"
30-
JAVA110 = "java-11.0"
31-
JAVA170 = "java-17.0"
32-
JAVA180 = "java-18.0"
33-
SWIFT55 = "swift-5.5"
34-
SWIFT58 = "swift-5.8"
35-
KOTLIN16 = "kotlin-1.6"
36-
KOTLIN18 = "kotlin-1.8"
37-
CPP17 = "cpp-17"
38-
CPP20 = "cpp-20"
39-
BUN10 = "bun-1.0"
4+
NODE_14_5 = "node-14.5"
5+
NODE_16_0 = "node-16.0"
6+
NODE_18_0 = "node-18.0"
7+
NODE_19_0 = "node-19.0"
8+
NODE_20_0 = "node-20.0"
9+
NODE_21_0 = "node-21.0"
10+
PHP_8_0 = "php-8.0"
11+
PHP_8_1 = "php-8.1"
12+
PHP_8_2 = "php-8.2"
13+
PHP_8_3 = "php-8.3"
14+
RUBY_3_0 = "ruby-3.0"
15+
RUBY_3_1 = "ruby-3.1"
16+
RUBY_3_2 = "ruby-3.2"
17+
RUBY_3_3 = "ruby-3.3"
18+
PYTHON_3_8 = "python-3.8"
19+
PYTHON_3_9 = "python-3.9"
20+
PYTHON_3_10 = "python-3.10"
21+
PYTHON_3_11 = "python-3.11"
22+
PYTHON_3_12 = "python-3.12"
23+
DENO_1_40 = "deno-1.40"
24+
DART_2_15 = "dart-2.15"
25+
DART_2_16 = "dart-2.16"
26+
DART_2_17 = "dart-2.17"
27+
DART_2_18 = "dart-2.18"
28+
DART_3_0 = "dart-3.0"
29+
DART_3_1 = "dart-3.1"
30+
DART_3_3 = "dart-3.3"
31+
DOTNET_3_1 = "dotnet-3.1"
32+
DOTNET_6_0 = "dotnet-6.0"
33+
DOTNET_7_0 = "dotnet-7.0"
34+
JAVA_8_0 = "java-8.0"
35+
JAVA_11_0 = "java-11.0"
36+
JAVA_17_0 = "java-17.0"
37+
JAVA_18_0 = "java-18.0"
38+
JAVA_21_0 = "java-21.0"
39+
SWIFT_5_5 = "swift-5.5"
40+
SWIFT_5_8 = "swift-5.8"
41+
SWIFT_5_9 = "swift-5.9"
42+
KOTLIN_1_6 = "kotlin-1.6"
43+
KOTLIN_1_8 = "kotlin-1.8"
44+
KOTLIN_1_9 = "kotlin-1.9"
45+
CPP_17 = "cpp-17"
46+
CPP_20 = "cpp-20"
47+
BUN_1_0 = "bun-1.0"

0 commit comments

Comments
 (0)