mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Updated SDKs
This commit is contained in:
@@ -4,7 +4,7 @@ from ..service import Service
|
||||
class Auth(Service):
|
||||
|
||||
def login(self, email, password, success='', failure=''):
|
||||
"""Login User"""
|
||||
"""Login"""
|
||||
|
||||
params = {}
|
||||
path = '/auth/login'
|
||||
@@ -17,6 +17,19 @@ class Auth(Service):
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def oauth(self, provider, success, failure):
|
||||
"""Login with OAuth"""
|
||||
|
||||
params = {}
|
||||
path = '/auth/login/oauth/{provider}'
|
||||
path.replace('{provider}', provider)
|
||||
params['success'] = success
|
||||
params['failure'] = failure
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def logout(self):
|
||||
"""Logout Current Session"""
|
||||
|
||||
@@ -38,19 +51,6 @@ class Auth(Service):
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def oauth(self, provider, success, failure):
|
||||
"""OAuth Login"""
|
||||
|
||||
params = {}
|
||||
path = '/auth/oauth/{provider}'
|
||||
path.replace('{provider}', provider)
|
||||
params['success'] = success
|
||||
params['failure'] = failure
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def recovery(self, email, reset):
|
||||
"""Password Recovery"""
|
||||
|
||||
@@ -78,7 +78,7 @@ class Auth(Service):
|
||||
}, params)
|
||||
|
||||
def register(self, email, password, confirm, success='', failure='', name=''):
|
||||
"""Register User"""
|
||||
"""Register"""
|
||||
|
||||
params = {}
|
||||
path = '/auth/register'
|
||||
@@ -94,7 +94,7 @@ class Auth(Service):
|
||||
}, params)
|
||||
|
||||
def confirm(self, user_id, token):
|
||||
"""Confirm User"""
|
||||
"""Confirmation"""
|
||||
|
||||
params = {}
|
||||
path = '/auth/register/confirm'
|
||||
|
||||
@@ -42,8 +42,7 @@ class Database(Service):
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def update_collection(self, collection_id, name, read, write, rulesstring(4) ""[]""
|
||||
=[]):
|
||||
def update_collection(self, collection_id, name, read, write, rules=[]):
|
||||
"""Update Collection"""
|
||||
|
||||
params = {}
|
||||
@@ -69,8 +68,7 @@ class Database(Service):
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def list_documents(self, collection_id, filtersstring(4) ""[]""
|
||||
=[], offset=0, limit=50, order_field='$uid', order_type='ASC', order_cast='string', search='', first=0, last=0):
|
||||
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):
|
||||
"""List Documents"""
|
||||
|
||||
params = {}
|
||||
|
||||
@@ -17,8 +17,7 @@ class Teams(Service):
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def create_team(self, name, rolesstring(13) ""[\"owner\"]""
|
||||
=[]):
|
||||
def create_team(self, name, roles=[]):
|
||||
"""Create Team"""
|
||||
|
||||
params = {}
|
||||
|
||||
Reference in New Issue
Block a user