From 386499e6c8b6a5c16a0736280bea1b8fb4244c5b Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 7 Dec 2019 22:32:15 +0200 Subject: [PATCH] Updated SDKs --- app/sdks/dart/README.md | 2 +- app/sdks/dart/lib/client.dart | 2 +- app/sdks/dart/lib/services/account.dart | 6 +- app/sdks/dart/lib/services/database.dart | 4 +- app/sdks/dart/lib/services/storage.dart | 8 +- app/sdks/dart/lib/services/teams.dart | 2 +- app/sdks/dart/pubspec.yaml | 2 +- app/sdks/go/account.go | 6 +- app/sdks/go/database.go | 4 +- app/sdks/go/storage.go | 8 +- app/sdks/go/teams.go | 2 +- app/sdks/js/README.md | 4 +- app/sdks/js/package.json | 2 +- app/sdks/js/src/sdk.js | 32 ++++---- app/sdks/js/src/sdk.min.js | 8 +- app/sdks/node/README.md | 2 +- app/sdks/node/lib/client.js | 2 +- app/sdks/node/lib/services/account.js | 6 +- app/sdks/node/lib/services/avatars.js | 2 +- app/sdks/node/lib/services/database.js | 4 +- app/sdks/node/lib/services/storage.js | 14 ++-- app/sdks/node/lib/services/teams.js | 2 +- app/sdks/node/package.json | 2 +- app/sdks/php/README.md | 2 +- app/sdks/php/docs/account.md | 2 +- app/sdks/php/docs/avatars.md | 2 +- app/sdks/php/docs/database.md | 4 +- app/sdks/php/docs/storage.md | 4 +- app/sdks/php/docs/teams.md | 2 +- app/sdks/php/src/Appwrite/Client.php | 2 +- .../php/src/Appwrite/Services/Account.php | 6 +- .../php/src/Appwrite/Services/Avatars.php | 2 +- .../php/src/Appwrite/Services/Database.php | 4 +- .../php/src/Appwrite/Services/Storage.php | 10 +-- app/sdks/php/src/Appwrite/Services/Teams.php | 2 +- app/sdks/python/appwrite/client.py | 2 +- app/sdks/python/appwrite/services/auth.py | 4 +- app/sdks/python/appwrite/services/avatars.py | 8 +- app/sdks/python/appwrite/services/database.py | 22 +++--- app/sdks/python/appwrite/services/projects.py | 74 +++++++++---------- app/sdks/python/appwrite/services/storage.py | 22 +++--- app/sdks/python/appwrite/services/teams.py | 22 +++--- app/sdks/python/appwrite/services/users.py | 16 ++-- app/sdks/python/setup.py | 4 +- app/sdks/ruby/appwrite.gemspec | 2 +- app/sdks/ruby/lib/appwrite/client.rb | 2 +- .../ruby/lib/appwrite/services/storage.rb | 10 +-- app/tasks/sdks.php | 2 +- 48 files changed, 174 insertions(+), 184 deletions(-) diff --git a/app/sdks/dart/README.md b/app/sdks/dart/README.md index d1eba8f20f..e9f9f44141 100644 --- a/app/sdks/dart/README.md +++ b/app/sdks/dart/README.md @@ -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: diff --git a/app/sdks/dart/lib/client.dart b/app/sdks/dart/lib/client.dart index af4a0e97bd..05a5370651 100644 --- a/app/sdks/dart/lib/client.dart +++ b/app/sdks/dart/lib/client.dart @@ -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; diff --git a/app/sdks/dart/lib/services/account.dart b/app/sdks/dart/lib/services/account.dart index dbf87ca267..4d191232d2 100644 --- a/app/sdks/dart/lib/services/account.dart +++ b/app/sdks/dart/lib/services/account.dart @@ -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 delete() async { String path = '/account'; diff --git a/app/sdks/dart/lib/services/database.dart b/app/sdks/dart/lib/services/database.dart index 5ecb54ad06..1c9a2a743a 100644 --- a/app/sdks/dart/lib/services/database.dart +++ b/app/sdks/dart/lib/services/database.dart @@ -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 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 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); diff --git a/app/sdks/dart/lib/services/storage.dart b/app/sdks/dart/lib/services/storage.dart index 7367986a05..c46dba5af6 100644 --- a/app/sdks/dart/lib/services/storage.dart +++ b/app/sdks/dart/lib/services/storage.dart @@ -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 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 createFile({files, read, write, folderId = null}) async { + Future createFile({files, read, write}) async { String path = '/storage/files'; Map 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 updateFile({fileId, read, write, folderId = null}) async { + Future updateFile({fileId, read, write}) async { String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId); Map params = { 'read': read, 'write': write, - 'folderId': folderId, }; return await this.client.call('put', path: path, params: params); diff --git a/app/sdks/dart/lib/services/teams.dart b/app/sdks/dart/lib/services/teams.dart index 4c126143cd..ab91cc70d2 100644 --- a/app/sdks/dart/lib/services/teams.dart +++ b/app/sdks/dart/lib/services/teams.dart @@ -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 listTeams({search = null, limit = 25, offset = null, orderType = 'ASC'}) async { String path = '/teams'; diff --git a/app/sdks/dart/pubspec.yaml b/app/sdks/dart/pubspec.yaml index fc0f0a376d..95225dfda5 100644 --- a/app/sdks/dart/pubspec.yaml +++ b/app/sdks/dart/pubspec.yaml @@ -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 homepage: https://github.com/appwrite/sdk-for-dart diff --git a/app/sdks/go/account.go b/app/sdks/go/account.go index ed8cfe83ed..debadc42f5 100644 --- a/app/sdks/go/account.go +++ b/app/sdks/go/account.go @@ -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" diff --git a/app/sdks/go/database.go b/app/sdks/go/database.go index 99648bf0da..b1e58e746b 100644 --- a/app/sdks/go/database.go +++ b/app/sdks/go/database.go @@ -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") diff --git a/app/sdks/go/storage.go b/app/sdks/go/storage.go index b942230b32..c0023cf9af 100644 --- a/app/sdks/go/storage.go +++ b/app/sdks/go/storage.go @@ -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) diff --git a/app/sdks/go/teams.go b/app/sdks/go/teams.go index 295956720c..7a4263f593 100644 --- a/app/sdks/go/teams.go +++ b/app/sdks/go/teams.go @@ -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" diff --git a/app/sdks/js/README.md b/app/sdks/js/README.md index 974341a38e..04753ba5eb 100644 --- a/app/sdks/js/README.md +++ b/app/sdks/js/README.md @@ -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 tag, but before you use any Appwrite services: ```html - + ``` ## Getting Started diff --git a/app/sdks/js/package.json b/app/sdks/js/package.json index 499bfdd69c..0c3d5e7b03 100644 --- a/app/sdks/js/package.json +++ b/app/sdks/js/package.json @@ -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": { diff --git a/app/sdks/js/src/sdk.js b/app/sdks/js/src/sdk.js index f4628ff2a1..b64f08c92b 100644 --- a/app/sdks/js/src/sdk.js +++ b/app/sdks/js/src/sdk.js @@ -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 diff --git a/app/sdks/js/src/sdk.min.js b/app/sdks/js/src/sdk.min.js index adba920a20..f921d5801a 100644 --- a/app/sdks/js/src/sdk.min.js +++ b/app/sdks/js/src/sdk.min.js @@ -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 '', - 'x-sdk-version' => 'appwrite:php:1.0.15', + 'x-sdk-version' => 'appwrite:php:1.0.16', ]; /** diff --git a/app/sdks/php/src/Appwrite/Services/Account.php b/app/sdks/php/src/Appwrite/Services/Account.php index a6256e2ab4..d56ea4c941 100644 --- a/app/sdks/php/src/Appwrite/Services/Account.php +++ b/app/sdks/php/src/Appwrite/Services/Account.php @@ -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 diff --git a/app/sdks/php/src/Appwrite/Services/Avatars.php b/app/sdks/php/src/Appwrite/Services/Avatars.php index 9eeccb56e1..90f39f8535 100644 --- a/app/sdks/php/src/Appwrite/Services/Avatars.php +++ b/app/sdks/php/src/Appwrite/Services/Avatars.php @@ -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. diff --git a/app/sdks/php/src/Appwrite/Services/Database.php b/app/sdks/php/src/Appwrite/Services/Database.php index f27c153e69..3621a5c4b2 100644 --- a/app/sdks/php/src/Appwrite/Services/Database.php +++ b/app/sdks/php/src/Appwrite/Services/Database.php @@ -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 diff --git a/app/sdks/php/src/Appwrite/Services/Storage.php b/app/sdks/php/src/Appwrite/Services/Storage.php index f2104150c6..37b0117d60 100644 --- a/app/sdks/php/src/Appwrite/Services/Storage.php +++ b/app/sdks/php/src/Appwrite/Services/Storage.php @@ -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', diff --git a/app/sdks/php/src/Appwrite/Services/Teams.php b/app/sdks/php/src/Appwrite/Services/Teams.php index 4addaa03d1..4109aef893 100644 --- a/app/sdks/php/src/Appwrite/Services/Teams.php +++ b/app/sdks/php/src/Appwrite/Services/Teams.php @@ -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 diff --git a/app/sdks/python/appwrite/client.py b/app/sdks/python/appwrite/client.py index 66ee922b56..f1f0caebc8 100644 --- a/app/sdks/python/appwrite/client.py +++ b/app/sdks/python/appwrite/client.py @@ -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): diff --git a/app/sdks/python/appwrite/services/auth.py b/app/sdks/python/appwrite/services/auth.py index 1a970252d8..ff0a894428 100644 --- a/app/sdks/python/appwrite/services/auth.py +++ b/app/sdks/python/appwrite/services/auth.py @@ -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', diff --git a/app/sdks/python/appwrite/services/avatars.py b/app/sdks/python/appwrite/services/avatars.py index cd998c6639..4a2a4024a6 100644 --- a/app/sdks/python/appwrite/services/avatars.py +++ b/app/sdks/python/appwrite/services/avatars.py @@ -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' diff --git a/app/sdks/python/appwrite/services/database.py b/app/sdks/python/appwrite/services/database.py index 7a85d07d55..486f5c3299 100644 --- a/app/sdks/python/appwrite/services/database.py +++ b/app/sdks/python/appwrite/services/database.py @@ -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', diff --git a/app/sdks/python/appwrite/services/projects.py b/app/sdks/python/appwrite/services/projects.py index 838b14e37b..3dea4fbd9b 100644 --- a/app/sdks/python/appwrite/services/projects.py +++ b/app/sdks/python/appwrite/services/projects.py @@ -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', diff --git a/app/sdks/python/appwrite/services/storage.py b/app/sdks/python/appwrite/services/storage.py index 1ac3601374..7b8fa23581 100644 --- a/app/sdks/python/appwrite/services/storage.py +++ b/app/sdks/python/appwrite/services/storage.py @@ -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', diff --git a/app/sdks/python/appwrite/services/teams.py b/app/sdks/python/appwrite/services/teams.py index d30a6e71da..c69424d8ba 100644 --- a/app/sdks/python/appwrite/services/teams.py +++ b/app/sdks/python/appwrite/services/teams.py @@ -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 diff --git a/app/sdks/python/appwrite/services/users.py b/app/sdks/python/appwrite/services/users.py index 79e08e567f..e97a961901 100644 --- a/app/sdks/python/appwrite/services/users.py +++ b/app/sdks/python/appwrite/services/users.py @@ -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, { diff --git a/app/sdks/python/setup.py b/app/sdks/python/setup.py index fb60994565..de10a85330 100644 --- a/app/sdks/python/setup.py +++ b/app/sdks/python/setup.py @@ -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', diff --git a/app/sdks/ruby/appwrite.gemspec b/app/sdks/ruby/appwrite.gemspec index c28a7a8e96..37149a6972 100644 --- a/app/sdks/ruby/appwrite.gemspec +++ b/app/sdks/ruby/appwrite.gemspec @@ -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' diff --git a/app/sdks/ruby/lib/appwrite/client.rb b/app/sdks/ruby/lib/appwrite/client.rb index 23fad2cff4..43dd47a235 100644 --- a/app/sdks/ruby/lib/appwrite/client.rb +++ b/app/sdks/ruby/lib/appwrite/client.rb @@ -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 diff --git a/app/sdks/ruby/lib/appwrite/services/storage.rb b/app/sdks/ruby/lib/appwrite/services/storage.rb index 3401611c8d..6e854b1f6d 100644 --- a/app/sdks/ruby/lib/appwrite/services/storage.rb +++ b/app/sdks/ruby/lib/appwrite/services/storage.rb @@ -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, { diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php index 2705664b2a..a981672bfa 100644 --- a/app/tasks/sdks.php +++ b/app/tasks/sdks.php @@ -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';