Skip to content

Commit 098e076

Browse files
committed
Initial commit
1 parent 81f69d7 commit 098e076

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

appwrite/services/auth.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class Auth(Service):
55

66
def login(self, email, password, success='', failure=''):
7-
"""Login User"""
7+
"""Login"""
88

99
params = {}
1010
path = '/auth/login'
@@ -17,6 +17,19 @@ def login(self, email, password, success='', failure=''):
1717
'content-type': 'application/json',
1818
}, params)
1919

20+
def oauth(self, provider, success, failure):
21+
"""Login with OAuth"""
22+
23+
params = {}
24+
path = '/auth/login/oauth/{provider}'
25+
path.replace('{provider}', provider)
26+
params['success'] = success
27+
params['failure'] = failure
28+
29+
return self.client.call('get', path, {
30+
'content-type': 'application/json',
31+
}, params)
32+
2033
def logout(self):
2134
"""Logout Current Session"""
2235

@@ -38,19 +51,6 @@ def logout_by_session(self, id):
3851
'content-type': 'application/json',
3952
}, params)
4053

41-
def oauth(self, provider, success, failure):
42-
"""OAuth Login"""
43-
44-
params = {}
45-
path = '/auth/oauth/{provider}'
46-
path.replace('{provider}', provider)
47-
params['success'] = success
48-
params['failure'] = failure
49-
50-
return self.client.call('get', path, {
51-
'content-type': 'application/json',
52-
}, params)
53-
5454
def recovery(self, email, reset):
5555
"""Password Recovery"""
5656

@@ -78,7 +78,7 @@ def recovery_reset(self, user_id, token, password_a, password_b):
7878
}, params)
7979

8080
def register(self, email, password, confirm, success='', failure='', name=''):
81-
"""Register User"""
81+
"""Register"""
8282

8383
params = {}
8484
path = '/auth/register'
@@ -94,7 +94,7 @@ def register(self, email, password, confirm, success='', failure='', name=''):
9494
}, params)
9595

9696
def confirm(self, user_id, token):
97-
"""Confirm User"""
97+
"""Confirmation"""
9898

9999
params = {}
100100
path = '/auth/register/confirm'

appwrite/services/database.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ def get_collection(self, collection_id):
4242
'content-type': 'application/json',
4343
}, params)
4444

45-
def update_collection(self, collection_id, name, read, write, rulesstring(4) ""[]""
46-
=[]):
45+
def update_collection(self, collection_id, name, read, write, rules=[]):
4746
"""Update Collection"""
4847

4948
params = {}
@@ -69,8 +68,7 @@ def delete_collection(self, collection_id):
6968
'content-type': 'application/json',
7069
}, params)
7170

72-
def list_documents(self, collection_id, filtersstring(4) ""[]""
73-
=[], offset=0, limit=50, order_field='$uid', order_type='ASC', order_cast='string', search='', first=0, last=0):
71+
def list_documents(self, collection_id, filters=[], offset=0, limit=50, order_field='$uid', order_type='ASC', order_cast='string', search='', first=0, last=0):
7472
"""List Documents"""
7573

7674
params = {}

appwrite/services/teams.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ def list_teams(self, search='', limit=25, offset=0, order_type='ASC'):
1717
'content-type': 'application/json',
1818
}, params)
1919

20-
def create_team(self, name, rolesstring(13) ""[\"owner\"]""
21-
=[]):
20+
def create_team(self, name, roles=[]):
2221
"""Create Team"""
2322

2423
params = {}

0 commit comments

Comments
 (0)