Skip to content

Commit 288fa3f

Browse files
committed
Initial commit
1 parent 86e404e commit 288fa3f

File tree

9 files changed

+93
-0
lines changed

9 files changed

+93
-0
lines changed

appwrite/services/account.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def get(self):
1010
path = '/account'
1111

1212
return self.client.call('get', path, {
13+
'content-type': 'application/json',
1314
}, params)
1415

1516
def delete(self):
@@ -19,6 +20,7 @@ def delete(self):
1920
path = '/account'
2021

2122
return self.client.call('delete', path, {
23+
'content-type': 'application/json',
2224
}, params)
2325

2426
def update_email(self, email, password):
@@ -30,6 +32,7 @@ def update_email(self, email, password):
3032
params['password'] = password
3133

3234
return self.client.call('patch', path, {
35+
'content-type': 'application/json',
3336
}, params)
3437

3538
def update_name(self, name):
@@ -40,6 +43,7 @@ def update_name(self, name):
4043
params['name'] = name
4144

4245
return self.client.call('patch', path, {
46+
'content-type': 'application/json',
4347
}, params)
4448

4549
def update_password(self, password, old_password):
@@ -51,6 +55,7 @@ def update_password(self, password, old_password):
5155
params['old-password'] = old_password
5256

5357
return self.client.call('patch', path, {
58+
'content-type': 'application/json',
5459
}, params)
5560

5661
def get_prefs(self):
@@ -60,6 +65,7 @@ def get_prefs(self):
6065
path = '/account/prefs'
6166

6267
return self.client.call('get', path, {
68+
'content-type': 'application/json',
6369
}, params)
6470

6571
def update_prefs(self, prefs):
@@ -70,6 +76,7 @@ def update_prefs(self, prefs):
7076
params['prefs'] = prefs
7177

7278
return self.client.call('patch', path, {
79+
'content-type': 'application/json',
7380
}, params)
7481

7582
def get_security(self):
@@ -79,6 +86,7 @@ def get_security(self):
7986
path = '/account/security'
8087

8188
return self.client.call('get', path, {
89+
'content-type': 'application/json',
8290
}, params)
8391

8492
def get_sessions(self):
@@ -88,4 +96,5 @@ def get_sessions(self):
8896
path = '/account/sessions'
8997

9098
return self.client.call('get', path, {
99+
'content-type': 'application/json',
91100
}, params)

appwrite/services/auth.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def login(self, email, password, success='', failure=''):
1414
params['failure'] = failure
1515

1616
return self.client.call('post', path, {
17+
'content-type': 'application/json',
1718
}, params)
1819

1920
def logout(self):
@@ -23,6 +24,7 @@ def logout(self):
2324
path = '/auth/logout'
2425

2526
return self.client.call('delete', path, {
27+
'content-type': 'application/json',
2628
}, params)
2729

2830
def logout_by_session(self, id):
@@ -33,6 +35,7 @@ def logout_by_session(self, id):
3335
path.replace('{id}', id)
3436

3537
return self.client.call('delete', path, {
38+
'content-type': 'application/json',
3639
}, params)
3740

3841
def oauth(self, provider, success, failure):
@@ -45,6 +48,7 @@ def oauth(self, provider, success, failure):
4548
params['failure'] = failure
4649

4750
return self.client.call('get', path, {
51+
'content-type': 'application/json',
4852
}, params)
4953

5054
def recovery(self, email, reset):
@@ -56,6 +60,7 @@ def recovery(self, email, reset):
5660
params['reset'] = reset
5761

5862
return self.client.call('post', path, {
63+
'content-type': 'application/json',
5964
}, params)
6065

6166
def recovery_reset(self, user_id, token, password_a, password_b):
@@ -69,6 +74,7 @@ def recovery_reset(self, user_id, token, password_a, password_b):
6974
params['password-b'] = password_b
7075

7176
return self.client.call('put', path, {
77+
'content-type': 'application/json',
7278
}, params)
7379

7480
def register(self, email, password, confirm, success='', failure='', name=''):
@@ -84,6 +90,7 @@ def register(self, email, password, confirm, success='', failure='', name=''):
8490
params['name'] = name
8591

8692
return self.client.call('post', path, {
93+
'content-type': 'application/json',
8794
}, params)
8895

8996
def confirm(self, user_id, token):
@@ -95,6 +102,7 @@ def confirm(self, user_id, token):
95102
params['token'] = token
96103

97104
return self.client.call('post', path, {
105+
'content-type': 'application/json',
98106
}, params)
99107

100108
def confirm_resend(self, confirm):
@@ -105,4 +113,5 @@ def confirm_resend(self, confirm):
105113
params['confirm'] = confirm
106114

107115
return self.client.call('post', path, {
116+
'content-type': 'application/json',
108117
}, params)

appwrite/services/avatars.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def get_browser(self, code, width=100, height=100, quality=100):
1414
params['quality'] = quality
1515

1616
return self.client.call('get', path, {
17+
'content-type': 'application/json',
1718
}, params)
1819

1920
def get_credit_card(self, code, width=100, height=100, quality=100):
@@ -27,6 +28,7 @@ def get_credit_card(self, code, width=100, height=100, quality=100):
2728
params['quality'] = quality
2829

2930
return self.client.call('get', path, {
31+
'content-type': 'application/json',
3032
}, params)
3133

3234
def get_favicon(self, url):
@@ -37,6 +39,7 @@ def get_favicon(self, url):
3739
params['url'] = url
3840

3941
return self.client.call('get', path, {
42+
'content-type': 'application/json',
4043
}, params)
4144

4245
def get_flag(self, code, width=100, height=100, quality=100):
@@ -50,6 +53,7 @@ def get_flag(self, code, width=100, height=100, quality=100):
5053
params['quality'] = quality
5154

5255
return self.client.call('get', path, {
56+
'content-type': 'application/json',
5357
}, params)
5458

5559
def get_image(self, url, width=400, height=400):
@@ -62,6 +66,7 @@ def get_image(self, url, width=400, height=400):
6266
params['height'] = height
6367

6468
return self.client.call('get', path, {
69+
'content-type': 'application/json',
6570
}, params)
6671

6772
def get_q_r(self, text, size=400, margin=1, download=0):
@@ -75,4 +80,5 @@ def get_q_r(self, text, size=400, margin=1, download=0):
7580
params['download'] = download
7681

7782
return self.client.call('get', path, {
83+
'content-type': 'application/json',
7884
}, params)

appwrite/services/database.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def list_collections(self, search='', limit=25, offset=0, order_type='ASC'):
1414
params['orderType'] = order_type
1515

1616
return self.client.call('get', path, {
17+
'content-type': 'application/json',
1718
}, params)
1819

1920
def create_collection(self, name, read, write, rules):
@@ -27,6 +28,7 @@ def create_collection(self, name, read, write, rules):
2728
params['rules'] = rules
2829

2930
return self.client.call('post', path, {
31+
'content-type': 'application/json',
3032
}, params)
3133

3234
def get_collection(self, collection_id):
@@ -37,6 +39,7 @@ def get_collection(self, collection_id):
3739
path.replace('{collectionId}', collection_id)
3840

3941
return self.client.call('get', path, {
42+
'content-type': 'application/json',
4043
}, params)
4144

4245
def update_collection(self, collection_id, name, readstring(4) ""[]""
@@ -54,6 +57,7 @@ def update_collection(self, collection_id, name, readstring(4) ""[]""
5457
params['rules'] = rules
5558

5659
return self.client.call('put', path, {
60+
'content-type': 'application/json',
5761
}, params)
5862

5963
def delete_collection(self, collection_id):
@@ -64,6 +68,7 @@ def delete_collection(self, collection_id):
6468
path.replace('{collectionId}', collection_id)
6569

6670
return self.client.call('delete', path, {
71+
'content-type': 'application/json',
6772
}, params)
6873

6974
def list_documents(self, collection_id, filtersstring(4) ""[]""
@@ -84,6 +89,7 @@ def list_documents(self, collection_id, filtersstring(4) ""[]""
8489
params['last'] = last
8590

8691
return self.client.call('get', path, {
92+
'content-type': 'application/json',
8793
}, params)
8894

8995
def create_document(self, collection_id, data, readstring(4) ""[]""
@@ -102,6 +108,7 @@ def create_document(self, collection_id, data, readstring(4) ""[]""
102108
params['parentPropertyType'] = parent_property_type
103109

104110
return self.client.call('post', path, {
111+
'content-type': 'application/json',
105112
}, params)
106113

107114
def get_document(self, collection_id, document_id):
@@ -113,6 +120,7 @@ def get_document(self, collection_id, document_id):
113120
path.replace('{documentId}', document_id)
114121

115122
return self.client.call('get', path, {
123+
'content-type': 'application/json',
116124
}, params)
117125

118126
def update_document(self, collection_id, document_id, data, readstring(4) ""[]""
@@ -129,6 +137,7 @@ def update_document(self, collection_id, document_id, data, readstring(4) ""[]""
129137
params['write'] = write
130138

131139
return self.client.call('patch', path, {
140+
'content-type': 'application/json',
132141
}, params)
133142

134143
def delete_document(self, collection_id, document_id):
@@ -140,4 +149,5 @@ def delete_document(self, collection_id, document_id):
140149
path.replace('{documentId}', document_id)
141150

142151
return self.client.call('delete', path, {
152+
'content-type': 'application/json',
143153
}, params)

appwrite/services/locale.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def get_locale(self):
1010
path = '/locale'
1111

1212
return self.client.call('get', path, {
13+
'content-type': 'application/json',
1314
}, params)
1415

1516
def get_countries(self):
@@ -19,6 +20,7 @@ def get_countries(self):
1920
path = '/locale/countries'
2021

2122
return self.client.call('get', path, {
23+
'content-type': 'application/json',
2224
}, params)
2325

2426
def get_countries_e_u(self):
@@ -28,6 +30,7 @@ def get_countries_e_u(self):
2830
path = '/locale/countries/eu'
2931

3032
return self.client.call('get', path, {
33+
'content-type': 'application/json',
3134
}, params)
3235

3336
def get_countries_phones(self):
@@ -37,6 +40,7 @@ def get_countries_phones(self):
3740
path = '/locale/countries/phones'
3841

3942
return self.client.call('get', path, {
43+
'content-type': 'application/json',
4044
}, params)
4145

4246
def get_currencies(self):
@@ -46,4 +50,5 @@ def get_currencies(self):
4650
path = '/locale/currencies'
4751

4852
return self.client.call('get', path, {
53+
'content-type': 'application/json',
4954
}, params)

0 commit comments

Comments
 (0)