mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Updated SDKs and UI
This commit is contained in:
@@ -6,7 +6,7 @@ class Storage(Service):
|
||||
def __init__(self, client):
|
||||
super(Storage, self).__init__(client)
|
||||
|
||||
def list(self, search='', limit=25, offset=0, order_type='ASC'):
|
||||
def list_files(self, search='', limit=25, offset=0, order_type='ASC'):
|
||||
"""List Files"""
|
||||
|
||||
params = {}
|
||||
@@ -20,7 +20,7 @@ class Storage(Service):
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def create(self, file, read, write):
|
||||
def create_file(self, file, read, write):
|
||||
"""Create File"""
|
||||
|
||||
params = {}
|
||||
@@ -33,7 +33,7 @@ class Storage(Service):
|
||||
'content-type': 'multipart/form-data',
|
||||
}, params)
|
||||
|
||||
def get(self, file_id):
|
||||
def get_file(self, file_id):
|
||||
"""Get File"""
|
||||
|
||||
params = {}
|
||||
@@ -44,7 +44,7 @@ class Storage(Service):
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def update(self, file_id, read, write):
|
||||
def update_file(self, file_id, read, write):
|
||||
"""Update File"""
|
||||
|
||||
params = {}
|
||||
@@ -57,7 +57,7 @@ class Storage(Service):
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def delete(self, file_id):
|
||||
def delete_file(self, file_id):
|
||||
"""Delete File"""
|
||||
|
||||
params = {}
|
||||
@@ -68,7 +68,7 @@ class Storage(Service):
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def get_download(self, file_id):
|
||||
def get_file_download(self, file_id):
|
||||
"""Get File for Download"""
|
||||
|
||||
params = {}
|
||||
@@ -79,7 +79,7 @@ class Storage(Service):
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def get_preview(self, file_id, width=0, height=0, quality=100, background='', output=''):
|
||||
def get_file_preview(self, file_id, width=0, height=0, quality=100, background='', output=''):
|
||||
"""Get File Preview"""
|
||||
|
||||
params = {}
|
||||
@@ -95,7 +95,7 @@ class Storage(Service):
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def get_view(self, file_id, xas=''):
|
||||
def get_file_view(self, file_id, xas=''):
|
||||
"""Get File for View"""
|
||||
|
||||
params = {}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.storage import Storage
|
||||
|
||||
client = Client()
|
||||
|
||||
(client
|
||||
.set_project('')
|
||||
.set_key('')
|
||||
)
|
||||
|
||||
storage = Storage(client)
|
||||
|
||||
result = storage.create_file(document.getElementById('uploader').files[0], {}, {})
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.storage import Storage
|
||||
|
||||
client = Client()
|
||||
|
||||
(client
|
||||
.set_project('')
|
||||
.set_key('')
|
||||
)
|
||||
|
||||
storage = Storage(client)
|
||||
|
||||
result = storage.delete_file('[FILE_ID]')
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.storage import Storage
|
||||
|
||||
client = Client()
|
||||
|
||||
(client
|
||||
.set_project('')
|
||||
.set_key('')
|
||||
)
|
||||
|
||||
storage = Storage(client)
|
||||
|
||||
result = storage.get_file_download('[FILE_ID]')
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.storage import Storage
|
||||
|
||||
client = Client()
|
||||
|
||||
(client
|
||||
.set_project('')
|
||||
.set_key('')
|
||||
)
|
||||
|
||||
storage = Storage(client)
|
||||
|
||||
result = storage.get_file_preview('[FILE_ID]')
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.storage import Storage
|
||||
|
||||
client = Client()
|
||||
|
||||
(client
|
||||
.set_project('')
|
||||
.set_key('')
|
||||
)
|
||||
|
||||
storage = Storage(client)
|
||||
|
||||
result = storage.get_file_view('[FILE_ID]')
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.storage import Storage
|
||||
|
||||
client = Client()
|
||||
|
||||
(client
|
||||
.set_project('')
|
||||
.set_key('')
|
||||
)
|
||||
|
||||
storage = Storage(client)
|
||||
|
||||
result = storage.get_file('[FILE_ID]')
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.storage import Storage
|
||||
|
||||
client = Client()
|
||||
|
||||
(client
|
||||
.set_project('')
|
||||
.set_key('')
|
||||
)
|
||||
|
||||
storage = Storage(client)
|
||||
|
||||
result = storage.list_files()
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.storage import Storage
|
||||
|
||||
client = Client()
|
||||
|
||||
(client
|
||||
.set_project('')
|
||||
.set_key('')
|
||||
)
|
||||
|
||||
storage = Storage(client)
|
||||
|
||||
result = storage.update_file('[FILE_ID]', {}, {})
|
||||
Reference in New Issue
Block a user