Updated SDKs
This commit is contained in:
parent
a30a977ed0
commit
386499e6c8
|
@ -17,7 +17,7 @@ Add this to your package's pubspec.yaml file:
|
|||
|
||||
```yml
|
||||
dependencies:
|
||||
appwrite: ^0.0.5
|
||||
appwrite: ^0.0.6
|
||||
```
|
||||
|
||||
You can install packages from the command line:
|
||||
|
|
|
@ -12,7 +12,7 @@ class Client {
|
|||
this.endPoint = 'https://appwrite.io/v1';
|
||||
this.headers = {
|
||||
'content-type': 'application/json',
|
||||
'x-sdk-version': 'appwrite:dart:0.0.5',
|
||||
'x-sdk-version': 'appwrite:dart:0.0.6',
|
||||
};
|
||||
this.selfSigned = false;
|
||||
|
||||
|
|
|
@ -15,7 +15,11 @@ class Account extends Service {
|
|||
|
||||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Delete currently logged in user account.
|
||||
/// Delete a currently logged in user account. Behind the scene, the user
|
||||
/// record is not deleted but permanently blocked from any access. This is done
|
||||
/// to avoid deleted accounts being overtaken by new users with the same email
|
||||
/// address. Any user-related resources like documents or storage files should
|
||||
/// be deleted separately.
|
||||
Future<Response> delete() async {
|
||||
String path = '/account';
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ class Database extends Service {
|
|||
/// Get a list of all the user collections. You can use the query params to
|
||||
/// filter your results. On admin mode, this endpoint will return a list of all
|
||||
/// of the project collections. [Learn more about different API
|
||||
/// modes](/docs/modes).
|
||||
/// modes](/docs/admin).
|
||||
Future<Response> listCollections({search = null, limit = 25, offset = null, orderType = 'ASC'}) async {
|
||||
String path = '/database';
|
||||
|
||||
|
@ -71,7 +71,7 @@ class Database extends Service {
|
|||
/// Get a list of all the user documents. You can use the query params to
|
||||
/// filter your results. On admin mode, this endpoint will return a list of all
|
||||
/// of the project documents. [Learn more about different API
|
||||
/// modes](/docs/modes).
|
||||
/// modes](/docs/admin).
|
||||
Future<Response> listDocuments({collectionId, filters = const [], offset = null, limit = 50, orderField = '\$uid', orderType = 'ASC', orderCast = 'string', search = null, first = null, last = null}) async {
|
||||
String path = '/database/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ class Storage extends Service {
|
|||
|
||||
/// Get a list of all the user files. You can use the query params to filter
|
||||
/// your results. On admin mode, this endpoint will return a list of all of the
|
||||
/// project files. [Learn more about different API modes](/docs/modes).
|
||||
/// project files. [Learn more about different API modes](/docs/admin).
|
||||
Future<Response> listFiles({search = null, limit = 25, offset = null, orderType = 'ASC'}) async {
|
||||
String path = '/storage/files';
|
||||
|
||||
|
@ -24,14 +24,13 @@ class Storage extends Service {
|
|||
/// Create a new file. The user who creates the file will automatically be
|
||||
/// assigned to read and write access unless he has passed custom values for
|
||||
/// read and write arguments.
|
||||
Future<Response> createFile({files, read, write, folderId = null}) async {
|
||||
Future<Response> createFile({files, read, write}) async {
|
||||
String path = '/storage/files';
|
||||
|
||||
Map<String, dynamic> params = {
|
||||
'files': files,
|
||||
'read': read,
|
||||
'write': write,
|
||||
'folderId': folderId,
|
||||
};
|
||||
|
||||
return await this.client.call('post', path: path, params: params);
|
||||
|
@ -48,13 +47,12 @@ class Storage extends Service {
|
|||
}
|
||||
/// Update file by its unique ID. Only users with write permissions have access
|
||||
/// to update this resource.
|
||||
Future<Response> updateFile({fileId, read, write, folderId = null}) async {
|
||||
Future<Response> updateFile({fileId, read, write}) async {
|
||||
String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId);
|
||||
|
||||
Map<String, dynamic> params = {
|
||||
'read': read,
|
||||
'write': write,
|
||||
'folderId': folderId,
|
||||
};
|
||||
|
||||
return await this.client.call('put', path: path, params: params);
|
||||
|
|
|
@ -8,7 +8,7 @@ class Teams extends Service {
|
|||
|
||||
/// Get a list of all the current user teams. You can use the query params to
|
||||
/// filter your results. On admin mode, this endpoint will return a list of all
|
||||
/// of the project teams. [Learn more about different API modes](/docs/modes).
|
||||
/// of the project teams. [Learn more about different API modes](/docs/admin).
|
||||
Future<Response> listTeams({search = null, limit = 25, offset = null, orderType = 'ASC'}) async {
|
||||
String path = '/teams';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: appwrite
|
||||
version: 0.0.5
|
||||
version: 0.0.6
|
||||
description: Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
|
||||
author: Appwrite Team <team@appwrite.io>
|
||||
homepage: https://github.com/appwrite/sdk-for-dart
|
||||
|
|
|
@ -18,7 +18,11 @@ func (srv *Account) Get() (map[string]interface{}, error) {
|
|||
return srv.client.Call("GET", path, nil, params)
|
||||
}
|
||||
|
||||
// Delete delete currently logged in user account.
|
||||
// Delete delete a currently logged in user account. Behind the scene, the
|
||||
// user record is not deleted but permanently blocked from any access. This is
|
||||
// done to avoid deleted accounts being overtaken by new users with the same
|
||||
// email address. Any user-related resources like documents or storage files
|
||||
// should be deleted separately.
|
||||
func (srv *Account) Delete() (map[string]interface{}, error) {
|
||||
path := "/account"
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ type Database struct {
|
|||
// ListCollections get a list of all the user collections. You can use the
|
||||
// query params to filter your results. On admin mode, this endpoint will
|
||||
// return a list of all of the project collections. [Learn more about
|
||||
// different API modes](/docs/modes).
|
||||
// different API modes](/docs/admin).
|
||||
func (srv *Database) ListCollections(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) {
|
||||
path := "/database"
|
||||
|
||||
|
@ -82,7 +82,7 @@ func (srv *Database) DeleteCollection(CollectionId string) (map[string]interface
|
|||
// ListDocuments get a list of all the user documents. You can use the query
|
||||
// params to filter your results. On admin mode, this endpoint will return a
|
||||
// list of all of the project documents. [Learn more about different API
|
||||
// modes](/docs/modes).
|
||||
// modes](/docs/admin).
|
||||
func (srv *Database) ListDocuments(CollectionId string, Filters []interface{}, Offset int, Limit int, OrderField string, OrderType string, OrderCast string, Search string, First int, Last int) (map[string]interface{}, error) {
|
||||
r := strings.NewReplacer("{collectionId}", CollectionId)
|
||||
path := r.Replace("/database/{collectionId}/documents")
|
||||
|
|
|
@ -11,7 +11,7 @@ type Storage struct {
|
|||
|
||||
// ListFiles get a list of all the user files. You can use the query params to
|
||||
// filter your results. On admin mode, this endpoint will return a list of all
|
||||
// of the project files. [Learn more about different API modes](/docs/modes).
|
||||
// of the project files. [Learn more about different API modes](/docs/admin).
|
||||
func (srv *Storage) ListFiles(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) {
|
||||
path := "/storage/files"
|
||||
|
||||
|
@ -28,14 +28,13 @@ func (srv *Storage) ListFiles(Search string, Limit int, Offset int, OrderType st
|
|||
// CreateFile create a new file. The user who creates the file will
|
||||
// automatically be assigned to read and write access unless he has passed
|
||||
// custom values for read and write arguments.
|
||||
func (srv *Storage) CreateFile(Files string, Read []interface{}, Write []interface{}, FolderId string) (map[string]interface{}, error) {
|
||||
func (srv *Storage) CreateFile(Files string, Read []interface{}, Write []interface{}) (map[string]interface{}, error) {
|
||||
path := "/storage/files"
|
||||
|
||||
params := map[string]interface{}{
|
||||
"files": Files,
|
||||
"read": Read,
|
||||
"write": Write,
|
||||
"folderId": FolderId,
|
||||
}
|
||||
|
||||
return srv.client.Call("POST", path, nil, params)
|
||||
|
@ -55,14 +54,13 @@ func (srv *Storage) GetFile(FileId string) (map[string]interface{}, error) {
|
|||
|
||||
// UpdateFile update file by its unique ID. Only users with write permissions
|
||||
// have access to update this resource.
|
||||
func (srv *Storage) UpdateFile(FileId string, Read []interface{}, Write []interface{}, FolderId string) (map[string]interface{}, error) {
|
||||
func (srv *Storage) UpdateFile(FileId string, Read []interface{}, Write []interface{}) (map[string]interface{}, error) {
|
||||
r := strings.NewReplacer("{fileId}", FileId)
|
||||
path := r.Replace("/storage/files/{fileId}")
|
||||
|
||||
params := map[string]interface{}{
|
||||
"read": Read,
|
||||
"write": Write,
|
||||
"folderId": FolderId,
|
||||
}
|
||||
|
||||
return srv.client.Call("PUT", path, nil, params)
|
||||
|
|
|
@ -12,7 +12,7 @@ type Teams struct {
|
|||
// ListTeams get a list of all the current user teams. You can use the query
|
||||
// params to filter your results. On admin mode, this endpoint will return a
|
||||
// list of all of the project teams. [Learn more about different API
|
||||
// modes](/docs/modes).
|
||||
// modes](/docs/admin).
|
||||
func (srv *Teams) ListTeams(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) {
|
||||
path := "/teams"
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
![License](https://img.shields.io/github/license/appwrite/sdk-for-js.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.3.0-blue.svg?v=1)
|
||||
|
||||
**This SDK is compatible with Appwrite server version 0.3.0. For older versions, please check previous releases.**
|
||||
**This SDK is compatible with Appwrite server version 0.4.0. For older versions, please check previous releases.**
|
||||
|
||||
Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
|
||||
|
||||
|
@ -30,7 +30,7 @@ import * as Appwrite from "appwrite";
|
|||
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
|
||||
|
||||
```html
|
||||
<script src="https://cdn.jsdelivr.net/npm/appwrite@1.0.27"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/appwrite@1.0.28"></script>
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "appwrite",
|
||||
"homepage": "https://appwrite.io/support",
|
||||
"description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)",
|
||||
"version": "1.0.27",
|
||||
"version": "1.0.28",
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "src/sdk.js",
|
||||
"repository": {
|
||||
|
|
|
@ -139,7 +139,7 @@
|
|||
globalParams.push({key: key, value: value});
|
||||
};
|
||||
|
||||
addGlobalHeader('x-sdk-version', 'appwrite:javascript:1.0.27');
|
||||
addGlobalHeader('x-sdk-version', 'appwrite:javascript:1.0.28');
|
||||
addGlobalHeader('content-type', '');
|
||||
|
||||
/**
|
||||
|
@ -321,7 +321,11 @@
|
|||
/**
|
||||
* Delete Account
|
||||
*
|
||||
* Delete currently logged in user account.
|
||||
* Delete a currently logged in user account. Behind the scene, the user
|
||||
* record is not deleted but permanently blocked from any access. This is done
|
||||
* to avoid deleted accounts being overtaken by new users with the same email
|
||||
* address. Any user-related resources like documents or storage files should
|
||||
* be deleted separately.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
|
@ -1142,7 +1146,7 @@
|
|||
},
|
||||
|
||||
/**
|
||||
* Text to QR Generator
|
||||
* Get QR Code
|
||||
*
|
||||
* Converts a given plain text to a QR code image. You can use the query
|
||||
* parameters to change the size and style of the resulting image.
|
||||
|
@ -1194,7 +1198,7 @@
|
|||
* Get a list of all the user collections. You can use the query params to
|
||||
* filter your results. On admin mode, this endpoint will return a list of all
|
||||
* of the project collections. [Learn more about different API
|
||||
* modes](/docs/modes).
|
||||
* modes](/docs/admin).
|
||||
*
|
||||
* @param {string} search
|
||||
* @param {number} limit
|
||||
|
@ -1397,7 +1401,7 @@
|
|||
* Get a list of all the user documents. You can use the query params to
|
||||
* filter your results. On admin mode, this endpoint will return a list of all
|
||||
* of the project documents. [Learn more about different API
|
||||
* modes](/docs/modes).
|
||||
* modes](/docs/admin).
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @param {array} filters
|
||||
|
@ -2913,7 +2917,7 @@
|
|||
*
|
||||
* Get a list of all the user files. You can use the query params to filter
|
||||
* your results. On admin mode, this endpoint will return a list of all of the
|
||||
* project files. [Learn more about different API modes](/docs/modes).
|
||||
* project files. [Learn more about different API modes](/docs/admin).
|
||||
*
|
||||
* @param {string} search
|
||||
* @param {number} limit
|
||||
|
@ -2959,11 +2963,10 @@
|
|||
* @param {File} files
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {string} folderId
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
createFile: function(files, read, write, folderId = '') {
|
||||
createFile: function(files, read, write) {
|
||||
if(files === undefined) {
|
||||
throw new Error('Missing required parameter: "files"');
|
||||
}
|
||||
|
@ -2992,10 +2995,6 @@
|
|||
payload['write'] = write;
|
||||
}
|
||||
|
||||
if(folderId) {
|
||||
payload['folderId'] = folderId;
|
||||
}
|
||||
|
||||
return http
|
||||
.post(path, {
|
||||
'content-type': 'multipart/form-data',
|
||||
|
@ -3036,11 +3035,10 @@
|
|||
* @param {string} fileId
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {string} folderId
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
updateFile: function(fileId, read, write, folderId = '') {
|
||||
updateFile: function(fileId, read, write) {
|
||||
if(fileId === undefined) {
|
||||
throw new Error('Missing required parameter: "fileId"');
|
||||
}
|
||||
|
@ -3065,10 +3063,6 @@
|
|||
payload['write'] = write;
|
||||
}
|
||||
|
||||
if(folderId) {
|
||||
payload['folderId'] = folderId;
|
||||
}
|
||||
|
||||
return http
|
||||
.put(path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -3216,7 +3210,7 @@
|
|||
*
|
||||
* Get a list of all the current user teams. You can use the query params to
|
||||
* filter your results. On admin mode, this endpoint will return a list of all
|
||||
* of the project teams. [Learn more about different API modes](/docs/modes).
|
||||
* of the project teams. [Learn more about different API modes](/docs/admin).
|
||||
*
|
||||
* @param {string} search
|
||||
* @param {number} limit
|
||||
|
|
8
app/sdks/js/src/sdk.min.js
vendored
8
app/sdks/js/src/sdk.min.js
vendored
|
@ -1,5 +1,5 @@
|
|||
(function(window){'use strict';window.Appwrite=function(){let config={endpoint:'https://appwrite.io/v1',project:'',key:'',locale:'',mode:'',};let setEndpoint=function(endpoint){config.endpoint=endpoint;return this};let setProject=function(value){http.addGlobalHeader('X-Appwrite-Project',value);config.project=value;return this};let setKey=function(value){http.addGlobalHeader('X-Appwrite-Key',value);config.key=value;return this};let setLocale=function(value){http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this};let setMode=function(value){http.addGlobalHeader('X-Appwrite-Mode',value);config.mode=value;return this};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g;let match,str=[];a.href=url;param=encodeURIComponent(param);while(match=regex.exec(a.search))if(param!==match[1])str.push(match[1]+(match[2]?"="+match[2]:""));str.push(param+(value?"="+encodeURIComponent(value):""));a.search=str.join("&");return a.href};let buildQuery=function(params){let str=[];for(let p in params){if(Array.isArray(params[p])){for(let index=0;index<params[p].length;index++){let param=params[p][index];str.push(encodeURIComponent(p+'[]')+"="+encodeURIComponent(param))}}else{str.push(encodeURIComponent(p)+"="+encodeURIComponent(params[p]))}}
|
||||
return str.join("&")};let addGlobalHeader=function(key,value){globalHeaders[key]={key:key.toLowerCase(),value:value.toLowerCase()}};let addGlobalParam=function(key,value){globalParams.push({key:key,value:value})};addGlobalHeader('x-sdk-version','appwrite:javascript:1.0.27');addGlobalHeader('content-type','');let call=function(method,path,headers={},params={},progress=null){let i;path=config.endpoint+path;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name')}
|
||||
return str.join("&")};let addGlobalHeader=function(key,value){globalHeaders[key]={key:key.toLowerCase(),value:value.toLowerCase()}};let addGlobalParam=function(key,value){globalParams.push({key:key,value:value})};addGlobalHeader('x-sdk-version','appwrite:javascript:1.0.28');addGlobalHeader('content-type','');let call=function(method,path,headers={},params={},progress=null){let i;path=config.endpoint+path;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name')}
|
||||
if(typeof path!=='string'){throw new Error('var path must be of type string')}
|
||||
if(typeof headers!=='object'){throw new Error('var headers must be of type object')}
|
||||
for(i=0;i<globalParams.length;i++){path=addParam(path,globalParams[i].key,globalParams[i].value)}
|
||||
|
@ -278,20 +278,18 @@ let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{proje
|
|||
if(limit){payload.limit=limit}
|
||||
if(offset){payload.offset=offset}
|
||||
if(orderType){payload.orderType=orderType}
|
||||
return http.get(path,{'content-type':'application/json',},payload)},createFile:function(files,read,write,folderId=''){if(files===undefined){throw new Error('Missing required parameter: "files"')}
|
||||
return http.get(path,{'content-type':'application/json',},payload)},createFile:function(files,read,write){if(files===undefined){throw new Error('Missing required parameter: "files"')}
|
||||
if(read===undefined){throw new Error('Missing required parameter: "read"')}
|
||||
if(write===undefined){throw new Error('Missing required parameter: "write"')}
|
||||
let path='/storage/files';let payload={};if(files){payload.files=files}
|
||||
if(read){payload.read=read}
|
||||
if(write){payload.write=write}
|
||||
if(folderId){payload.folderId=folderId}
|
||||
return http.post(path,{'content-type':'multipart/form-data',},payload)},getFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateFile:function(fileId,read,write,folderId=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateFile:function(fileId,read,write){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
if(read===undefined){throw new Error('Missing required parameter: "read"')}
|
||||
if(write===undefined){throw new Error('Missing required parameter: "write"')}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(read){payload.read=read}
|
||||
if(write){payload.write=write}
|
||||
if(folderId){payload.folderId=folderId}
|
||||
return http.put(path,{'content-type':'application/json',},payload)},deleteFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getFileDownload:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
let path='/storage/files/{fileId}/download'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},getFilePreview:function(fileId,width=0,height=0,quality=100,background='',output=''){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"')}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.3.0-blue.svg?v=1)
|
||||
|
||||
**This SDK is compatible with Appwrite server version 0.3.0. For older versions, please check previous releases.**
|
||||
**This SDK is compatible with Appwrite server version 0.4.0. For older versions, please check previous releases.**
|
||||
|
||||
Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ class Client {
|
|||
this.endpoint = 'https://appwrite.io/v1';
|
||||
this.headers = {
|
||||
'content-type': '',
|
||||
'x-sdk-version': 'appwrite:nodejs:1.0.30',
|
||||
'x-sdk-version': 'appwrite:nodejs:1.0.31',
|
||||
};
|
||||
this.selfSigned = false;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,11 @@ class Account extends Service {
|
|||
/**
|
||||
* Delete Account
|
||||
*
|
||||
* Delete currently logged in user account.
|
||||
* Delete a currently logged in user account. Behind the scene, the user
|
||||
* record is not deleted but permanently blocked from any access. This is done
|
||||
* to avoid deleted accounts being overtaken by new users with the same email
|
||||
* address. Any user-related resources like documents or storage files should
|
||||
* be deleted separately.
|
||||
*
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
|
|
|
@ -134,7 +134,7 @@ class Avatars extends Service {
|
|||
}
|
||||
|
||||
/**
|
||||
* Text to QR Generator
|
||||
* Get QR Code
|
||||
*
|
||||
* Converts a given plain text to a QR code image. You can use the query
|
||||
* parameters to change the size and style of the resulting image.
|
||||
|
|
|
@ -8,7 +8,7 @@ class Database extends Service {
|
|||
* Get a list of all the user collections. You can use the query params to
|
||||
* filter your results. On admin mode, this endpoint will return a list of all
|
||||
* of the project collections. [Learn more about different API
|
||||
* modes](/docs/modes).
|
||||
* modes](/docs/admin).
|
||||
*
|
||||
* @param string search
|
||||
* @param number limit
|
||||
|
@ -130,7 +130,7 @@ class Database extends Service {
|
|||
* Get a list of all the user documents. You can use the query params to
|
||||
* filter your results. On admin mode, this endpoint will return a list of all
|
||||
* of the project documents. [Learn more about different API
|
||||
* modes](/docs/modes).
|
||||
* modes](/docs/admin).
|
||||
*
|
||||
* @param string collectionId
|
||||
* @param array filters
|
||||
|
|
|
@ -7,7 +7,7 @@ class Storage extends Service {
|
|||
*
|
||||
* Get a list of all the user files. You can use the query params to filter
|
||||
* your results. On admin mode, this endpoint will return a list of all of the
|
||||
* project files. [Learn more about different API modes](/docs/modes).
|
||||
* project files. [Learn more about different API modes](/docs/admin).
|
||||
*
|
||||
* @param string search
|
||||
* @param number limit
|
||||
|
@ -40,11 +40,10 @@ class Storage extends Service {
|
|||
* @param File files
|
||||
* @param array read
|
||||
* @param array write
|
||||
* @param string folderId
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
*/
|
||||
async createFile(files, read, write, folderId = '') {
|
||||
async createFile(files, read, write) {
|
||||
let path = '/storage/files';
|
||||
|
||||
return await this.client.call('post', path, {
|
||||
|
@ -53,8 +52,7 @@ class Storage extends Service {
|
|||
{
|
||||
'files': files,
|
||||
'read': read,
|
||||
'write': write,
|
||||
'folderId': folderId
|
||||
'write': write
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -87,11 +85,10 @@ class Storage extends Service {
|
|||
* @param string fileId
|
||||
* @param array read
|
||||
* @param array write
|
||||
* @param string folderId
|
||||
* @throws Exception
|
||||
* @return {}
|
||||
*/
|
||||
async updateFile(fileId, read, write, folderId = '') {
|
||||
async updateFile(fileId, read, write) {
|
||||
let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId);
|
||||
|
||||
return await this.client.call('put', path, {
|
||||
|
@ -99,8 +96,7 @@ class Storage extends Service {
|
|||
},
|
||||
{
|
||||
'read': read,
|
||||
'write': write,
|
||||
'folderId': folderId
|
||||
'write': write
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ class Teams extends Service {
|
|||
*
|
||||
* Get a list of all the current user teams. You can use the query params to
|
||||
* filter your results. On admin mode, this endpoint will return a list of all
|
||||
* of the project teams. [Learn more about different API modes](/docs/modes).
|
||||
* of the project teams. [Learn more about different API modes](/docs/admin).
|
||||
*
|
||||
* @param string search
|
||||
* @param number limit
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "node-appwrite",
|
||||
"homepage": "https://appwrite.io/support",
|
||||
"description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)",
|
||||
"version": "1.0.30",
|
||||
"version": "1.0.31",
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.3.0-blue.svg?v=1)
|
||||
|
||||
**This SDK is compatible with Appwrite server version 0.3.0. For older versions, please check previous releases.**
|
||||
**This SDK is compatible with Appwrite server version 0.4.0. For older versions, please check previous releases.**
|
||||
|
||||
Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ GET https://appwrite.io/v1/account
|
|||
DELETE https://appwrite.io/v1/account
|
||||
```
|
||||
|
||||
** Delete currently logged in user account. **
|
||||
** Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately. **
|
||||
|
||||
## Update Account Email
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ GET https://appwrite.io/v1/avatars/image
|
|||
| width | integer | Resize preview image width, Pass an integer between 0 to 4000 | 400 |
|
||||
| height | integer | Resize preview image height, Pass an integer between 0 to 4000 | 400 |
|
||||
|
||||
## Text to QR Generator
|
||||
## Get QR Code
|
||||
|
||||
```http request
|
||||
GET https://appwrite.io/v1/avatars/qr
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
GET https://appwrite.io/v1/database
|
||||
```
|
||||
|
||||
** Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](/docs/modes). **
|
||||
** Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](/docs/admin). **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -86,7 +86,7 @@ DELETE https://appwrite.io/v1/database/{collectionId}
|
|||
GET https://appwrite.io/v1/database/{collectionId}/documents
|
||||
```
|
||||
|
||||
** Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/modes). **
|
||||
** Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/admin). **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
GET https://appwrite.io/v1/storage/files
|
||||
```
|
||||
|
||||
** Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](/docs/modes). **
|
||||
** Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](/docs/admin). **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -32,7 +32,6 @@ POST https://appwrite.io/v1/storage/files
|
|||
| files | file | Binary Files. | |
|
||||
| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
|
||||
| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
|
||||
| folderId | string | Folder to associate files with. | |
|
||||
|
||||
## Get File
|
||||
|
||||
|
@ -63,7 +62,6 @@ PUT https://appwrite.io/v1/storage/files/{fileId}
|
|||
| fileId | string | **Required** File unique ID. | |
|
||||
| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
|
||||
| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
|
||||
| folderId | string | Folder to associate files with. | |
|
||||
|
||||
## Delete File
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
GET https://appwrite.io/v1/teams
|
||||
```
|
||||
|
||||
** Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](/docs/modes). **
|
||||
** Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](/docs/admin). **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ class Client
|
|||
*/
|
||||
protected $headers = [
|
||||
'content-type' => '',
|
||||
'x-sdk-version' => 'appwrite:php:1.0.15',
|
||||
'x-sdk-version' => 'appwrite:php:1.0.16',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,7 +30,11 @@ class Account extends Service
|
|||
/**
|
||||
* Delete Account
|
||||
*
|
||||
* Delete currently logged in user account.
|
||||
* Delete a currently logged in user account. Behind the scene, the user
|
||||
* record is not deleted but permanently blocked from any access. This is done
|
||||
* to avoid deleted accounts being overtaken by new users with the same email
|
||||
* address. Any user-related resources like documents or storage files should
|
||||
* be deleted separately.
|
||||
*
|
||||
* @throws Exception
|
||||
* @return array
|
||||
|
|
|
@ -145,7 +145,7 @@ class Avatars extends Service
|
|||
}
|
||||
|
||||
/**
|
||||
* Text to QR Generator
|
||||
* Get QR Code
|
||||
*
|
||||
* Converts a given plain text to a QR code image. You can use the query
|
||||
* parameters to change the size and style of the resulting image.
|
||||
|
|
|
@ -14,7 +14,7 @@ class Database extends Service
|
|||
* Get a list of all the user collections. You can use the query params to
|
||||
* filter your results. On admin mode, this endpoint will return a list of all
|
||||
* of the project collections. [Learn more about different API
|
||||
* modes](/docs/modes).
|
||||
* modes](/docs/admin).
|
||||
*
|
||||
* @param string $search
|
||||
* @param int $limit
|
||||
|
@ -141,7 +141,7 @@ class Database extends Service
|
|||
* Get a list of all the user documents. You can use the query params to
|
||||
* filter your results. On admin mode, this endpoint will return a list of all
|
||||
* of the project documents. [Learn more about different API
|
||||
* modes](/docs/modes).
|
||||
* modes](/docs/admin).
|
||||
*
|
||||
* @param string $collectionId
|
||||
* @param array $filters
|
||||
|
|
|
@ -13,7 +13,7 @@ class Storage extends Service
|
|||
*
|
||||
* Get a list of all the user files. You can use the query params to filter
|
||||
* your results. On admin mode, this endpoint will return a list of all of the
|
||||
* project files. [Learn more about different API modes](/docs/modes).
|
||||
* project files. [Learn more about different API modes](/docs/admin).
|
||||
*
|
||||
* @param string $search
|
||||
* @param int $limit
|
||||
|
@ -47,11 +47,10 @@ class Storage extends Service
|
|||
* @param \CurlFile $files
|
||||
* @param array $read
|
||||
* @param array $write
|
||||
* @param string $folderId
|
||||
* @throws Exception
|
||||
* @return array
|
||||
*/
|
||||
public function createFile(\CurlFile $files, array $read, array $write, string $folderId = ''):array
|
||||
public function createFile(\CurlFile $files, array $read, array $write):array
|
||||
{
|
||||
$path = str_replace([], [], '/storage/files');
|
||||
$params = [];
|
||||
|
@ -59,7 +58,6 @@ class Storage extends Service
|
|||
$params['files'] = $files;
|
||||
$params['read'] = $read;
|
||||
$params['write'] = $write;
|
||||
$params['folderId'] = $folderId;
|
||||
|
||||
return $this->client->call(Client::METHOD_POST, $path, [
|
||||
'content-type' => 'multipart/form-data',
|
||||
|
@ -96,18 +94,16 @@ class Storage extends Service
|
|||
* @param string $fileId
|
||||
* @param array $read
|
||||
* @param array $write
|
||||
* @param string $folderId
|
||||
* @throws Exception
|
||||
* @return array
|
||||
*/
|
||||
public function updateFile(string $fileId, array $read, array $write, string $folderId = ''):array
|
||||
public function updateFile(string $fileId, array $read, array $write):array
|
||||
{
|
||||
$path = str_replace(['{fileId}'], [$fileId], '/storage/files/{fileId}');
|
||||
$params = [];
|
||||
|
||||
$params['read'] = $read;
|
||||
$params['write'] = $write;
|
||||
$params['folderId'] = $folderId;
|
||||
|
||||
return $this->client->call(Client::METHOD_PUT, $path, [
|
||||
'content-type' => 'application/json',
|
||||
|
|
|
@ -13,7 +13,7 @@ class Teams extends Service
|
|||
*
|
||||
* Get a list of all the current user teams. You can use the query params to
|
||||
* filter your results. On admin mode, this endpoint will return a list of all
|
||||
* of the project teams. [Learn more about different API modes](/docs/modes).
|
||||
* of the project teams. [Learn more about different API modes](/docs/admin).
|
||||
*
|
||||
* @param string $search
|
||||
* @param int $limit
|
||||
|
|
|
@ -7,7 +7,7 @@ class Client:
|
|||
self._endpoint = 'https://appwrite.io/v1'
|
||||
self._global_headers = {
|
||||
'content-type': '',
|
||||
'x-sdk-version': 'appwrite:python:0.0.1',
|
||||
'x-sdk-version': 'appwrite:python:0.0.2',
|
||||
}
|
||||
|
||||
def set_self_signed(self, status=True):
|
||||
|
|
|
@ -25,7 +25,7 @@ class Auth(Service):
|
|||
|
||||
params = {}
|
||||
path = '/auth/login/oauth/{provider}'
|
||||
path.replace('{provider}', provider)
|
||||
path = path.replace('{provider}', provider)
|
||||
params['success'] = success
|
||||
params['failure'] = failure
|
||||
|
||||
|
@ -48,7 +48,7 @@ class Auth(Service):
|
|||
|
||||
params = {}
|
||||
path = '/auth/logout/{id}'
|
||||
path.replace('{id}', id)
|
||||
path = path.replace('{id}', id)
|
||||
|
||||
return self.client.call('delete', path, {
|
||||
'content-type': 'application/json',
|
||||
|
|
|
@ -11,7 +11,7 @@ class Avatars(Service):
|
|||
|
||||
params = {}
|
||||
path = '/avatars/browsers/{code}'
|
||||
path.replace('{code}', code)
|
||||
path = path.replace('{code}', code)
|
||||
params['width'] = width
|
||||
params['height'] = height
|
||||
params['quality'] = quality
|
||||
|
@ -25,7 +25,7 @@ class Avatars(Service):
|
|||
|
||||
params = {}
|
||||
path = '/avatars/credit-cards/{code}'
|
||||
path.replace('{code}', code)
|
||||
path = path.replace('{code}', code)
|
||||
params['width'] = width
|
||||
params['height'] = height
|
||||
params['quality'] = quality
|
||||
|
@ -50,7 +50,7 @@ class Avatars(Service):
|
|||
|
||||
params = {}
|
||||
path = '/avatars/flags/{code}'
|
||||
path.replace('{code}', code)
|
||||
path = path.replace('{code}', code)
|
||||
params['width'] = width
|
||||
params['height'] = height
|
||||
params['quality'] = quality
|
||||
|
@ -73,7 +73,7 @@ class Avatars(Service):
|
|||
}, params)
|
||||
|
||||
def get_q_r(self, text, size=400, margin=1, download=0):
|
||||
"""Text to QR Generator"""
|
||||
"""Get QR Code"""
|
||||
|
||||
params = {}
|
||||
path = '/avatars/qr'
|
||||
|
|
|
@ -39,7 +39,7 @@ class Database(Service):
|
|||
|
||||
params = {}
|
||||
path = '/database/{collectionId}'
|
||||
path.replace('{collectionId}', collection_id)
|
||||
path = path.replace('{collectionId}', collection_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -50,7 +50,7 @@ class Database(Service):
|
|||
|
||||
params = {}
|
||||
path = '/database/{collectionId}'
|
||||
path.replace('{collectionId}', collection_id)
|
||||
path = path.replace('{collectionId}', collection_id)
|
||||
params['name'] = name
|
||||
params['read'] = read
|
||||
params['write'] = write
|
||||
|
@ -65,7 +65,7 @@ class Database(Service):
|
|||
|
||||
params = {}
|
||||
path = '/database/{collectionId}'
|
||||
path.replace('{collectionId}', collection_id)
|
||||
path = path.replace('{collectionId}', collection_id)
|
||||
|
||||
return self.client.call('delete', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -76,7 +76,7 @@ class Database(Service):
|
|||
|
||||
params = {}
|
||||
path = '/database/{collectionId}/documents'
|
||||
path.replace('{collectionId}', collection_id)
|
||||
path = path.replace('{collectionId}', collection_id)
|
||||
params['filters'] = filters
|
||||
params['offset'] = offset
|
||||
params['limit'] = limit
|
||||
|
@ -96,7 +96,7 @@ class Database(Service):
|
|||
|
||||
params = {}
|
||||
path = '/database/{collectionId}/documents'
|
||||
path.replace('{collectionId}', collection_id)
|
||||
path = path.replace('{collectionId}', collection_id)
|
||||
params['data'] = data
|
||||
params['read'] = read
|
||||
params['write'] = write
|
||||
|
@ -113,8 +113,8 @@ class Database(Service):
|
|||
|
||||
params = {}
|
||||
path = '/database/{collectionId}/documents/{documentId}'
|
||||
path.replace('{collectionId}', collection_id)
|
||||
path.replace('{documentId}', document_id)
|
||||
path = path.replace('{collectionId}', collection_id)
|
||||
path = path.replace('{documentId}', document_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -125,8 +125,8 @@ class Database(Service):
|
|||
|
||||
params = {}
|
||||
path = '/database/{collectionId}/documents/{documentId}'
|
||||
path.replace('{collectionId}', collection_id)
|
||||
path.replace('{documentId}', document_id)
|
||||
path = path.replace('{collectionId}', collection_id)
|
||||
path = path.replace('{documentId}', document_id)
|
||||
params['data'] = data
|
||||
params['read'] = read
|
||||
params['write'] = write
|
||||
|
@ -140,8 +140,8 @@ class Database(Service):
|
|||
|
||||
params = {}
|
||||
path = '/database/{collectionId}/documents/{documentId}'
|
||||
path.replace('{collectionId}', collection_id)
|
||||
path.replace('{documentId}', document_id)
|
||||
path = path.replace('{collectionId}', collection_id)
|
||||
path = path.replace('{documentId}', document_id)
|
||||
|
||||
return self.client.call('delete', path, {
|
||||
'content-type': 'application/json',
|
||||
|
|
|
@ -42,7 +42,7 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -53,7 +53,7 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
params['name'] = name
|
||||
params['description'] = description
|
||||
params['logo'] = logo
|
||||
|
@ -74,7 +74,7 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
|
||||
return self.client.call('delete', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -85,7 +85,7 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/keys'
|
||||
path.replace('{projectId}', project_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -96,7 +96,7 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/keys'
|
||||
path.replace('{projectId}', project_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
params['name'] = name
|
||||
params['scopes'] = scopes
|
||||
|
||||
|
@ -109,8 +109,8 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/keys/{keyId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path.replace('{keyId}', key_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
path = path.replace('{keyId}', key_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -121,8 +121,8 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/keys/{keyId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path.replace('{keyId}', key_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
path = path.replace('{keyId}', key_id)
|
||||
params['name'] = name
|
||||
params['scopes'] = scopes
|
||||
|
||||
|
@ -135,8 +135,8 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/keys/{keyId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path.replace('{keyId}', key_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
path = path.replace('{keyId}', key_id)
|
||||
|
||||
return self.client.call('delete', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -147,7 +147,7 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/oauth'
|
||||
path.replace('{projectId}', project_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
params['provider'] = provider
|
||||
params['appId'] = app_id
|
||||
params['secret'] = secret
|
||||
|
@ -161,7 +161,7 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/platforms'
|
||||
path.replace('{projectId}', project_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -172,7 +172,7 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/platforms'
|
||||
path.replace('{projectId}', project_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
params['type'] = type
|
||||
params['name'] = name
|
||||
params['key'] = key
|
||||
|
@ -188,8 +188,8 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/platforms/{platformId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path.replace('{platformId}', platform_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
path = path.replace('{platformId}', platform_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -200,8 +200,8 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/platforms/{platformId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path.replace('{platformId}', platform_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
path = path.replace('{platformId}', platform_id)
|
||||
params['name'] = name
|
||||
params['key'] = key
|
||||
params['store'] = store
|
||||
|
@ -216,8 +216,8 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/platforms/{platformId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path.replace('{platformId}', platform_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
path = path.replace('{platformId}', platform_id)
|
||||
|
||||
return self.client.call('delete', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -228,7 +228,7 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/tasks'
|
||||
path.replace('{projectId}', project_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -239,7 +239,7 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/tasks'
|
||||
path.replace('{projectId}', project_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
params['name'] = name
|
||||
params['status'] = status
|
||||
params['schedule'] = schedule
|
||||
|
@ -259,8 +259,8 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/tasks/{taskId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path.replace('{taskId}', task_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
path = path.replace('{taskId}', task_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -271,8 +271,8 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/tasks/{taskId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path.replace('{taskId}', task_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
path = path.replace('{taskId}', task_id)
|
||||
params['name'] = name
|
||||
params['status'] = status
|
||||
params['schedule'] = schedule
|
||||
|
@ -292,8 +292,8 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/tasks/{taskId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path.replace('{taskId}', task_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
path = path.replace('{taskId}', task_id)
|
||||
|
||||
return self.client.call('delete', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -304,7 +304,7 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/usage'
|
||||
path.replace('{projectId}', project_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -315,7 +315,7 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/webhooks'
|
||||
path.replace('{projectId}', project_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -326,7 +326,7 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/webhooks'
|
||||
path.replace('{projectId}', project_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
params['name'] = name
|
||||
params['events'] = events
|
||||
params['url'] = url
|
||||
|
@ -343,8 +343,8 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/webhooks/{webhookId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path.replace('{webhookId}', webhook_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
path = path.replace('{webhookId}', webhook_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -355,8 +355,8 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/webhooks/{webhookId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path.replace('{webhookId}', webhook_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
path = path.replace('{webhookId}', webhook_id)
|
||||
params['name'] = name
|
||||
params['events'] = events
|
||||
params['url'] = url
|
||||
|
@ -373,8 +373,8 @@ class Projects(Service):
|
|||
|
||||
params = {}
|
||||
path = '/projects/{projectId}/webhooks/{webhookId}'
|
||||
path.replace('{projectId}', project_id)
|
||||
path.replace('{webhookId}', webhook_id)
|
||||
path = path.replace('{projectId}', project_id)
|
||||
path = path.replace('{webhookId}', webhook_id)
|
||||
|
||||
return self.client.call('delete', path, {
|
||||
'content-type': 'application/json',
|
||||
|
|
|
@ -20,7 +20,7 @@ class Storage(Service):
|
|||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def create_file(self, files, read, write, folder_id=''):
|
||||
def create_file(self, files, read, write):
|
||||
"""Create File"""
|
||||
|
||||
params = {}
|
||||
|
@ -28,7 +28,6 @@ class Storage(Service):
|
|||
params['files'] = files
|
||||
params['read'] = read
|
||||
params['write'] = write
|
||||
params['folderId'] = folder_id
|
||||
|
||||
return self.client.call('post', path, {
|
||||
'content-type': 'multipart/form-data',
|
||||
|
@ -39,21 +38,20 @@ class Storage(Service):
|
|||
|
||||
params = {}
|
||||
path = '/storage/files/{fileId}'
|
||||
path.replace('{fileId}', file_id)
|
||||
path = path.replace('{fileId}', file_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def update_file(self, file_id, read, write, folder_id=''):
|
||||
def update_file(self, file_id, read, write):
|
||||
"""Update File"""
|
||||
|
||||
params = {}
|
||||
path = '/storage/files/{fileId}'
|
||||
path.replace('{fileId}', file_id)
|
||||
path = path.replace('{fileId}', file_id)
|
||||
params['read'] = read
|
||||
params['write'] = write
|
||||
params['folderId'] = folder_id
|
||||
|
||||
return self.client.call('put', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -64,7 +62,7 @@ class Storage(Service):
|
|||
|
||||
params = {}
|
||||
path = '/storage/files/{fileId}'
|
||||
path.replace('{fileId}', file_id)
|
||||
path = path.replace('{fileId}', file_id)
|
||||
|
||||
return self.client.call('delete', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -75,7 +73,7 @@ class Storage(Service):
|
|||
|
||||
params = {}
|
||||
path = '/storage/files/{fileId}/download'
|
||||
path.replace('{fileId}', file_id)
|
||||
path = path.replace('{fileId}', file_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -86,7 +84,7 @@ class Storage(Service):
|
|||
|
||||
params = {}
|
||||
path = '/storage/files/{fileId}/preview'
|
||||
path.replace('{fileId}', file_id)
|
||||
path = path.replace('{fileId}', file_id)
|
||||
params['width'] = width
|
||||
params['height'] = height
|
||||
params['quality'] = quality
|
||||
|
@ -97,13 +95,13 @@ class Storage(Service):
|
|||
'content-type': 'application/json',
|
||||
}, params)
|
||||
|
||||
def get_file_view(self, file_id, as=''):
|
||||
def get_file_view(self, file_id, xas=''):
|
||||
"""Get File for View"""
|
||||
|
||||
params = {}
|
||||
path = '/storage/files/{fileId}/view'
|
||||
path.replace('{fileId}', file_id)
|
||||
params['as'] = as
|
||||
path = path.replace('{fileId}', file_id)
|
||||
params['as'] = xas
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
|
|
@ -37,7 +37,7 @@ class Teams(Service):
|
|||
|
||||
params = {}
|
||||
path = '/teams/{teamId}'
|
||||
path.replace('{teamId}', team_id)
|
||||
path = path.replace('{teamId}', team_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -48,7 +48,7 @@ class Teams(Service):
|
|||
|
||||
params = {}
|
||||
path = '/teams/{teamId}'
|
||||
path.replace('{teamId}', team_id)
|
||||
path = path.replace('{teamId}', team_id)
|
||||
params['name'] = name
|
||||
|
||||
return self.client.call('put', path, {
|
||||
|
@ -60,7 +60,7 @@ class Teams(Service):
|
|||
|
||||
params = {}
|
||||
path = '/teams/{teamId}'
|
||||
path.replace('{teamId}', team_id)
|
||||
path = path.replace('{teamId}', team_id)
|
||||
|
||||
return self.client.call('delete', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -71,7 +71,7 @@ class Teams(Service):
|
|||
|
||||
params = {}
|
||||
path = '/teams/{teamId}/members'
|
||||
path.replace('{teamId}', team_id)
|
||||
path = path.replace('{teamId}', team_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -82,7 +82,7 @@ class Teams(Service):
|
|||
|
||||
params = {}
|
||||
path = '/teams/{teamId}/memberships'
|
||||
path.replace('{teamId}', team_id)
|
||||
path = path.replace('{teamId}', team_id)
|
||||
params['email'] = email
|
||||
params['name'] = name
|
||||
params['roles'] = roles
|
||||
|
@ -97,8 +97,8 @@ class Teams(Service):
|
|||
|
||||
params = {}
|
||||
path = '/teams/{teamId}/memberships/{inviteId}'
|
||||
path.replace('{teamId}', team_id)
|
||||
path.replace('{inviteId}', invite_id)
|
||||
path = path.replace('{teamId}', team_id)
|
||||
path = path.replace('{inviteId}', invite_id)
|
||||
|
||||
return self.client.call('delete', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -109,8 +109,8 @@ class Teams(Service):
|
|||
|
||||
params = {}
|
||||
path = '/teams/{teamId}/memberships/{inviteId}/resend'
|
||||
path.replace('{teamId}', team_id)
|
||||
path.replace('{inviteId}', invite_id)
|
||||
path = path.replace('{teamId}', team_id)
|
||||
path = path.replace('{inviteId}', invite_id)
|
||||
params['redirect'] = redirect
|
||||
|
||||
return self.client.call('post', path, {
|
||||
|
@ -122,8 +122,8 @@ class Teams(Service):
|
|||
|
||||
params = {}
|
||||
path = '/teams/{teamId}/memberships/{inviteId}/status'
|
||||
path.replace('{teamId}', team_id)
|
||||
path.replace('{inviteId}', invite_id)
|
||||
path = path.replace('{teamId}', team_id)
|
||||
path = path.replace('{inviteId}', invite_id)
|
||||
params['userId'] = user_id
|
||||
params['secret'] = secret
|
||||
params['success'] = success
|
||||
|
|
|
@ -38,7 +38,7 @@ class Users(Service):
|
|||
|
||||
params = {}
|
||||
path = '/users/{userId}'
|
||||
path.replace('{userId}', user_id)
|
||||
path = path.replace('{userId}', user_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -49,7 +49,7 @@ class Users(Service):
|
|||
|
||||
params = {}
|
||||
path = '/users/{userId}/logs'
|
||||
path.replace('{userId}', user_id)
|
||||
path = path.replace('{userId}', user_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -60,7 +60,7 @@ class Users(Service):
|
|||
|
||||
params = {}
|
||||
path = '/users/{userId}/prefs'
|
||||
path.replace('{userId}', user_id)
|
||||
path = path.replace('{userId}', user_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -71,7 +71,7 @@ class Users(Service):
|
|||
|
||||
params = {}
|
||||
path = '/users/{userId}/prefs'
|
||||
path.replace('{userId}', user_id)
|
||||
path = path.replace('{userId}', user_id)
|
||||
params['prefs'] = prefs
|
||||
|
||||
return self.client.call('patch', path, {
|
||||
|
@ -83,7 +83,7 @@ class Users(Service):
|
|||
|
||||
params = {}
|
||||
path = '/users/{userId}/sessions'
|
||||
path.replace('{userId}', user_id)
|
||||
path = path.replace('{userId}', user_id)
|
||||
|
||||
return self.client.call('get', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -94,7 +94,7 @@ class Users(Service):
|
|||
|
||||
params = {}
|
||||
path = '/users/{userId}/sessions'
|
||||
path.replace('{userId}', user_id)
|
||||
path = path.replace('{userId}', user_id)
|
||||
|
||||
return self.client.call('delete', path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -105,7 +105,7 @@ class Users(Service):
|
|||
|
||||
params = {}
|
||||
path = '/users/{userId}/sessions/:session'
|
||||
path.replace('{userId}', user_id)
|
||||
path = path.replace('{userId}', user_id)
|
||||
params['sessionId'] = session_id
|
||||
|
||||
return self.client.call('delete', path, {
|
||||
|
@ -117,7 +117,7 @@ class Users(Service):
|
|||
|
||||
params = {}
|
||||
path = '/users/{userId}/status'
|
||||
path.replace('{userId}', user_id)
|
||||
path = path.replace('{userId}', user_id)
|
||||
params['status'] = status
|
||||
|
||||
return self.client.call('patch', path, {
|
||||
|
|
|
@ -3,7 +3,7 @@ import setuptools
|
|||
setuptools.setup(
|
||||
name = 'appwrite',
|
||||
packages = ['appwrite', 'appwrite/services'],
|
||||
version = '0.0.1',
|
||||
version = '0.0.2',
|
||||
license='BSD-3-Clause',
|
||||
description = 'Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)',
|
||||
author = 'Appwrite Team',
|
||||
|
@ -11,7 +11,7 @@ setuptools.setup(
|
|||
maintainer = 'Appwrite Team',
|
||||
maintainer_email = 'team@appwrite.io',
|
||||
url = 'https://appwrite.io/support',
|
||||
download_url='https://github.com/appwrite/sdk-for-python/archive/0.0.1.tar.gz',
|
||||
download_url='https://github.com/appwrite/sdk-for-python/archive/0.0.2.tar.gz',
|
||||
# keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'],
|
||||
install_requires=[
|
||||
'requests',
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Gem::Specification.new do |s|
|
||||
|
||||
s.name = 'appwrite'
|
||||
s.version = '1.0.7'
|
||||
s.version = '1.0.8'
|
||||
s.summary = "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)"
|
||||
s.author = 'Appwrite Team'
|
||||
s.homepage = 'https://appwrite.io/support'
|
||||
|
|
|
@ -20,7 +20,7 @@ module Appwrite
|
|||
@headers = {
|
||||
'content-type' => '',
|
||||
'user-agent' => RUBY_PLATFORM + ':ruby-' + RUBY_VERSION,
|
||||
'x-sdk-version' => 'appwrite:ruby:1.0.7'
|
||||
'x-sdk-version' => 'appwrite:ruby:1.0.8'
|
||||
}
|
||||
@endpoint = 'https://appwrite.io/v1';
|
||||
end
|
||||
|
|
|
@ -16,14 +16,13 @@ module Appwrite
|
|||
}, params);
|
||||
end
|
||||
|
||||
def create_file(files:, read:, write:, folder_id: '')
|
||||
def create_file(files:, read:, write:)
|
||||
path = '/storage/files'
|
||||
|
||||
params = {
|
||||
'files': files,
|
||||
'read': read,
|
||||
'write': write,
|
||||
'folderId': folder_id
|
||||
'write': write
|
||||
}
|
||||
|
||||
return @client.call('post', path, {
|
||||
|
@ -43,14 +42,13 @@ module Appwrite
|
|||
}, params);
|
||||
end
|
||||
|
||||
def update_file(file_id:, read:, write:, folder_id: '')
|
||||
def update_file(file_id:, read:, write:)
|
||||
path = '/storage/files/{fileId}'
|
||||
.gsub('{file_id}', file_id)
|
||||
|
||||
params = {
|
||||
'read': read,
|
||||
'write': write,
|
||||
'folderId': folder_id
|
||||
'write': write
|
||||
}
|
||||
|
||||
return @client.call('put', path, {
|
||||
|
|
|
@ -123,7 +123,7 @@ $cli
|
|||
Console::info('Fetching API Spec for '.$name.' ('.$client['platform'].')');
|
||||
|
||||
$spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1&platform='.$client['platform']);
|
||||
$spec = getSSLPage('https://appwrite.test/v1/open-api-2.json?extensions=1&platform='.$client['platform']);
|
||||
$spec = getSSLPage('https://localhost/v1/open-api-2.json?extensions=1&platform='.$client['platform']);
|
||||
|
||||
$license = 'BSD-3-Clause';
|
||||
|
||||
|
|
Loading…
Reference in a new issue