From cb7c05063ef350fe2243b903cc84b224b15ea600 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 6 Apr 2020 07:55:38 +0300 Subject: [PATCH] Updated SDKs --- app/config/platforms.php | 2 +- app/sdks/console-javascript/README.md | 4 +- app/sdks/console-javascript/package.json | 4 +- app/sdks/flutter-dart/CHANGELOG.md | 4 ++ app/sdks/flutter-dart/README.md | 7 +++- app/sdks/flutter-dart/lib/appwrite.dart | 7 ++-- app/sdks/flutter-dart/lib/client.dart | 8 ++-- app/sdks/flutter-dart/lib/enums.dart | 20 ++++------ app/sdks/flutter-dart/lib/service.dart | 6 +-- .../flutter-dart/lib/services/account.dart | 39 +++++++++---------- .../flutter-dart/lib/services/avatars.dart | 15 ++++--- .../flutter-dart/lib/services/database.dart | 15 ++++--- .../flutter-dart/lib/services/locale.dart | 13 +++---- .../flutter-dart/lib/services/storage.dart | 23 ++++++----- app/sdks/flutter-dart/lib/services/teams.dart | 23 ++++++----- app/sdks/flutter-dart/pubspec.yaml | 9 +++-- app/sdks/server-go/README.md | 4 +- app/sdks/server-nodejs/README.md | 4 +- app/sdks/server-nodejs/package.json | 4 +- app/sdks/server-php/README.md | 4 +- app/sdks/server-php/composer.json | 4 +- app/sdks/server-python/README.md | 4 +- app/sdks/server-python/setup.py | 4 +- app/sdks/server-ruby/README.md | 4 +- app/sdks/server-ruby/appwrite.gemspec | 4 +- app/sdks/web-javascript/README.md | 4 +- app/sdks/web-javascript/package.json | 4 +- app/tasks/sdks.php | 4 ++ composer.lock | 8 +--- docs/sdks/dart/CHANGELOG.md | 4 ++ 30 files changed, 145 insertions(+), 114 deletions(-) diff --git a/app/config/platforms.php b/app/config/platforms.php index 98ab79633d..eb92e7a774 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -130,7 +130,7 @@ return [ [ 'key' => 'dart', 'name' => 'Dart', - 'version' => '0.0.8', + 'version' => '0.0.10', 'url' => 'https://github.com/appwrite/sdk-for-dart', 'enabled' => true, 'beta' => true, diff --git a/app/sdks/console-javascript/README.md b/app/sdks/console-javascript/README.md index e92e54a111..3911d7c430 100644 --- a/app/sdks/console-javascript/README.md +++ b/app/sdks/console-javascript/README.md @@ -3,7 +3,9 @@ ![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?v=1) ![Version](https://img.shields.io/badge/api%20version-0.5.3-blue.svg?v=1) -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) +Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the JS SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) ![Appwrite](https://appwrite.io/images/github.png) diff --git a/app/sdks/console-javascript/package.json b/app/sdks/console-javascript/package.json index d4be0c0d03..e0dabdd490 100644 --- a/app/sdks/console-javascript/package.json +++ b/app/sdks/console-javascript/package.json @@ -1,7 +1,9 @@ { "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)", + "description": "Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the JS SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)", "version": "1.0.0", "license": "BSD-3-Clause", "main": "src/sdk.js", diff --git a/app/sdks/flutter-dart/CHANGELOG.md b/app/sdks/flutter-dart/CHANGELOG.md index a7a936ee70..351e76cc28 100644 --- a/app/sdks/flutter-dart/CHANGELOG.md +++ b/app/sdks/flutter-dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.9 + +- Updated deafult params + ## 0.0.8 - Fixed compilation error in Client class diff --git a/app/sdks/flutter-dart/README.md b/app/sdks/flutter-dart/README.md index 861d150ba8..63ef0d954d 100644 --- a/app/sdks/flutter-dart/README.md +++ b/app/sdks/flutter-dart/README.md @@ -1,11 +1,14 @@ # Appwrite SDK for Dart +[![pub package](https://img.shields.io/pub/v/appwrite.svg)](https://pub.dartlang.org/packages/appwrite) ![License](https://img.shields.io/github/license/appwrite/sdk-for-dart.svg?v=1) ![Version](https://img.shields.io/badge/api%20version-0.5.3-blue.svg?v=1) **This SDK is compatible with Appwrite server version 0.5.3. 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) +Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the Dart SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) @@ -17,7 +20,7 @@ Add this to your package's `pubspec.yaml` file: ```yml dependencies: - appwrite: ^0.0.8 + appwrite: ^0.0.9 ``` You can install packages from the command line: diff --git a/app/sdks/flutter-dart/lib/appwrite.dart b/app/sdks/flutter-dart/lib/appwrite.dart index e6508e9077..95d0b72cfe 100644 --- a/app/sdks/flutter-dart/lib/appwrite.dart +++ b/app/sdks/flutter-dart/lib/appwrite.dart @@ -1,9 +1,10 @@ +export 'package:dio/dio.dart' show Response; + +export 'client.dart'; +export 'enums.dart'; export 'services/account.dart'; export 'services/avatars.dart'; export 'services/database.dart'; export 'services/locale.dart'; export 'services/storage.dart'; export 'services/teams.dart'; -export 'client.dart'; -export 'enums.dart'; -export 'package:dio/dio.dart' show Response; \ No newline at end of file diff --git a/app/sdks/flutter-dart/lib/client.dart b/app/sdks/flutter-dart/lib/client.dart index 943c51d18e..6d0d22bfc4 100644 --- a/app/sdks/flutter-dart/lib/client.dart +++ b/app/sdks/flutter-dart/lib/client.dart @@ -1,9 +1,9 @@ import 'dart:io'; +import 'package:cookie_jar/cookie_jar.dart'; import 'package:dio/adapter.dart'; import 'package:dio/dio.dart'; import 'package:dio_cookie_manager/dio_cookie_manager.dart'; -import 'package:cookie_jar/cookie_jar.dart'; import 'enums.dart'; @@ -13,10 +13,10 @@ class Client { bool selfSigned; final Dio http; - Client({this.endPoint: 'https://appwrite.io/v1', this.selfSigned: false, Dio http}) : this.http = http ?? Dio() { + Client({this.endPoint = 'https://appwrite.io/v1', this.selfSigned = false, Dio http}) : this.http = http ?? Dio() { this.headers = { 'content-type': 'application/json', - 'x-sdk-version': 'appwrite:dart:0.0.8', + 'x-sdk-version': 'appwrite:dart:0.0.9', }; assert(endPoint.startsWith(RegExp("http://|https://")), "endPoint $endPoint must start with 'http'"); @@ -61,7 +61,7 @@ class Client { } Future call(HttpMethod method, {String path = '', Map headers = const {}, Map params = const {}}) { - if(this.selfSigned) { + if(selfSigned) { // Allow self signed requests (http.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (HttpClient client) { client.badCertificateCallback = (X509Certificate cert, String host, int port) => true; diff --git a/app/sdks/flutter-dart/lib/enums.dart b/app/sdks/flutter-dart/lib/enums.dart index 003073644f..2757f6073e 100644 --- a/app/sdks/flutter-dart/lib/enums.dart +++ b/app/sdks/flutter-dart/lib/enums.dart @@ -1,19 +1,15 @@ -enum HttpMethod { - get, post, put, delete, patch -} +enum HttpMethod { get, post, put, delete, patch } extension HttpMethodString on HttpMethod { - String name(){ - return this.toString().split('.').last.toUpperCase(); - } + String name() { + return this.toString().split('.').last.toUpperCase(); + } } -enum OrderType { - asc, desc -} +enum OrderType { asc, desc } extension OrderTypeString on OrderType { - String name(){ - return this.toString().split('.').last.toUpperCase(); - } + String name() { + return this.toString().split('.').last.toUpperCase(); + } } diff --git a/app/sdks/flutter-dart/lib/service.dart b/app/sdks/flutter-dart/lib/service.dart index 838047604a..1ae319b705 100644 --- a/app/sdks/flutter-dart/lib/service.dart +++ b/app/sdks/flutter-dart/lib/service.dart @@ -1,7 +1,7 @@ import 'client.dart'; class Service { - final Client client; + final Client client; - const Service(this.client); -} \ No newline at end of file + const Service(this.client); +} diff --git a/app/sdks/flutter-dart/lib/services/account.dart b/app/sdks/flutter-dart/lib/services/account.dart index 69b1aab4c7..5b8a8bcba7 100644 --- a/app/sdks/flutter-dart/lib/services/account.dart +++ b/app/sdks/flutter-dart/lib/services/account.dart @@ -7,7 +7,6 @@ import '../enums.dart'; import "../service.dart"; class Account extends Service { - Account(Client client): super(client); /// Get currently logged in user data as JSON object. @@ -17,7 +16,7 @@ class Account extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Use this endpoint to allow a new user to register a new account in your /// project. After the user registration completes successfully, you can use @@ -25,7 +24,7 @@ class Account extends Service { /// verifying the user email address. To allow your new user to login to his /// new account, you need to create a new [account /// session](/docs/account#createSession). - Future create({@required String email, @required String password, String name = null}) { + Future create({@required String email, @required String password, String name = ''}) { final String path = '/account'; final Map params = { @@ -34,7 +33,7 @@ class Account extends Service { 'name': name, }; - return this.client.call(HttpMethod.post, path: path, params: params); + return client.call(HttpMethod.post, path: path, params: params); } /// 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 @@ -47,7 +46,7 @@ class Account extends Service { final Map params = { }; - return this.client.call(HttpMethod.delete, path: path, params: params); + return client.call(HttpMethod.delete, path: path, params: params); } /// Update currently logged in user account email address. After changing user /// address, user confirmation status is being reset and a new confirmation @@ -61,7 +60,7 @@ class Account extends Service { 'password': password, }; - return this.client.call(HttpMethod.patch, path: path, params: params); + return client.call(HttpMethod.patch, path: path, params: params); } /// Get currently logged in user list of latest security activity logs. Each /// log returns user IP address, location and date and time of log. @@ -71,7 +70,7 @@ class Account extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Update currently logged in user account name. Future updateName({@required String name}) { @@ -81,7 +80,7 @@ class Account extends Service { 'name': name, }; - return this.client.call(HttpMethod.patch, path: path, params: params); + return client.call(HttpMethod.patch, path: path, params: params); } /// Update currently logged in user password. For validation, user is required /// to pass the password twice. @@ -93,7 +92,7 @@ class Account extends Service { 'old-password': oldPassword, }; - return this.client.call(HttpMethod.patch, path: path, params: params); + return client.call(HttpMethod.patch, path: path, params: params); } /// Get currently logged in user preferences as a key-value object. Future getPrefs() { @@ -102,7 +101,7 @@ class Account extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Update currently logged in user account preferences. You can pass only the /// specific settings you wish to update. @@ -113,7 +112,7 @@ class Account extends Service { 'prefs': prefs, }; - return this.client.call(HttpMethod.patch, path: path, params: params); + return client.call(HttpMethod.patch, path: path, params: params); } /// Sends the user an email with a temporary secret key for password reset. /// When the user clicks the confirmation link he is redirected back to your @@ -129,7 +128,7 @@ class Account extends Service { 'url': url, }; - return this.client.call(HttpMethod.post, path: path, params: params); + return client.call(HttpMethod.post, path: path, params: params); } /// Use this endpoint to complete the user account password reset. Both the /// **userId** and **secret** arguments will be passed as query parameters to @@ -150,7 +149,7 @@ class Account extends Service { 'password-b': passwordB, }; - return this.client.call(HttpMethod.put, path: path, params: params); + return client.call(HttpMethod.put, path: path, params: params); } /// Get currently logged in user list of active sessions across different /// devices. @@ -160,7 +159,7 @@ class Account extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Allow the user to login into his account by providing a valid email and /// password combination. This route will create a new session for the user. @@ -172,7 +171,7 @@ class Account extends Service { 'password': password, }; - return this.client.call(HttpMethod.post, path: path, params: params); + return client.call(HttpMethod.post, path: path, params: params); } /// Delete all sessions from the user account and remove any sessions cookies /// from the end client. @@ -182,7 +181,7 @@ class Account extends Service { final Map params = { }; - return this.client.call(HttpMethod.delete, path: path, params: params); + return client.call(HttpMethod.delete, path: path, params: params); } /// Allow the user to login to his account using the OAuth2 provider of his /// choice. Each OAuth2 provider should be enabled from the Appwrite console @@ -196,7 +195,7 @@ class Account extends Service { 'failure': failure, }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Use this endpoint to log out the currently logged in user from all his /// account sessions across all his different devices. When using the option id @@ -207,7 +206,7 @@ class Account extends Service { final Map params = { }; - return this.client.call(HttpMethod.delete, path: path, params: params); + return client.call(HttpMethod.delete, path: path, params: params); } /// Use this endpoint to send a verification message to your user email address /// to confirm they are the valid owners of that address. Both the **userId** @@ -229,7 +228,7 @@ class Account extends Service { 'url': url, }; - return this.client.call(HttpMethod.post, path: path, params: params); + return client.call(HttpMethod.post, path: path, params: params); } /// Use this endpoint to complete the user email verification process. Use both /// the **userId** and **secret** parameters that were attached to your app URL @@ -243,6 +242,6 @@ class Account extends Service { 'secret': secret, }; - return this.client.call(HttpMethod.put, path: path, params: params); + return client.call(HttpMethod.put, path: path, params: params); } } \ No newline at end of file diff --git a/app/sdks/flutter-dart/lib/services/avatars.dart b/app/sdks/flutter-dart/lib/services/avatars.dart index 420c19765c..d7e7143e1a 100644 --- a/app/sdks/flutter-dart/lib/services/avatars.dart +++ b/app/sdks/flutter-dart/lib/services/avatars.dart @@ -7,7 +7,6 @@ import '../enums.dart'; import "../service.dart"; class Avatars extends Service { - Avatars(Client client): super(client); /// You can use this endpoint to show different browser icons to your users. @@ -23,7 +22,7 @@ class Avatars extends Service { 'quality': quality, }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Need to display your users with your billing method or their payment /// methods? The credit card endpoint will return you the icon of the credit @@ -38,7 +37,7 @@ class Avatars extends Service { 'quality': quality, }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote /// website URL. @@ -49,7 +48,7 @@ class Avatars extends Service { 'url': url, }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// You can use this endpoint to show different country flags icons to your /// users. The code argument receives the 2 letter country code. Use width, @@ -63,7 +62,7 @@ class Avatars extends Service { 'quality': quality, }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Use this endpoint to fetch a remote image URL and crop it to any image size /// you want. This endpoint is very useful if you need to crop and display @@ -78,11 +77,11 @@ class Avatars extends Service { 'height': height, }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// 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. - Future getQR({@required String text, int size = 400, int margin = 1, int download = null}) { + Future getQR({@required String text, int size = 400, int margin = 1, int download = 0}) { final String path = '/avatars/qr'; final Map params = { @@ -92,6 +91,6 @@ class Avatars extends Service { 'download': download, }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } } \ No newline at end of file diff --git a/app/sdks/flutter-dart/lib/services/database.dart b/app/sdks/flutter-dart/lib/services/database.dart index 5b9741553b..3e3648af2a 100644 --- a/app/sdks/flutter-dart/lib/services/database.dart +++ b/app/sdks/flutter-dart/lib/services/database.dart @@ -7,14 +7,13 @@ import '../enums.dart'; import "../service.dart"; class Database extends Service { - Database(Client client): super(client); /// 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). - Future listDocuments({@required String collectionId, List filters = const [], int offset = null, int limit = 50, String orderField = '\$id', String orderType = 'ASC', String orderCast = 'string', String search = null, int first = null, int last = null}) { + Future listDocuments({@required String collectionId, List filters = const [], int offset = 0, int limit = 50, String orderField = '\$id', String orderType = 'ASC', String orderCast = 'string', String search = '', int first = 0, int last = 0}) { final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId); final Map params = { @@ -29,10 +28,10 @@ class Database extends Service { 'last': last, }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Create a new Document. - Future createDocument({@required String collectionId, @required dynamic data, @required List read, @required List write, String parentDocument = null, String parentProperty = null, String parentPropertyType = 'assign'}) { + Future createDocument({@required String collectionId, @required dynamic data, @required List read, @required List write, String parentDocument = '', String parentProperty = '', String parentPropertyType = 'assign'}) { final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId); final Map params = { @@ -44,7 +43,7 @@ class Database extends Service { 'parentPropertyType': parentPropertyType, }; - return this.client.call(HttpMethod.post, path: path, params: params); + return client.call(HttpMethod.post, path: path, params: params); } /// Get document by its unique ID. This endpoint response returns a JSON object /// with the document data. @@ -54,7 +53,7 @@ class Database extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } Future updateDocument({@required String collectionId, @required String documentId, @required dynamic data, @required List read, @required List write}) { final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId); @@ -65,7 +64,7 @@ class Database extends Service { 'write': write, }; - return this.client.call(HttpMethod.patch, path: path, params: params); + return client.call(HttpMethod.patch, path: path, params: params); } /// Delete document by its unique ID. This endpoint deletes only the parent /// documents, his attributes and relations to other documents. Child documents @@ -76,6 +75,6 @@ class Database extends Service { final Map params = { }; - return this.client.call(HttpMethod.delete, path: path, params: params); + return client.call(HttpMethod.delete, path: path, params: params); } } \ No newline at end of file diff --git a/app/sdks/flutter-dart/lib/services/locale.dart b/app/sdks/flutter-dart/lib/services/locale.dart index 5f08b93c2c..83c1276222 100644 --- a/app/sdks/flutter-dart/lib/services/locale.dart +++ b/app/sdks/flutter-dart/lib/services/locale.dart @@ -7,7 +7,6 @@ import '../enums.dart'; import "../service.dart"; class Locale extends Service { - Locale(Client client): super(client); /// Get the current user location based on IP. Returns an object with user @@ -22,7 +21,7 @@ class Locale extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// List of all continents. You can use the locale header to get the data in a /// supported language. @@ -32,7 +31,7 @@ class Locale extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// List of all countries. You can use the locale header to get the data in a /// supported language. @@ -42,7 +41,7 @@ class Locale extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// List of all countries that are currently members of the EU. You can use the /// locale header to get the data in a supported language. @@ -52,7 +51,7 @@ class Locale extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// List of all countries phone codes. You can use the locale header to get the /// data in a supported language. @@ -62,7 +61,7 @@ class Locale extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// List of all currencies, including currency symol, name, plural, and decimal /// digits for all major and minor currencies. You can use the locale header to @@ -73,6 +72,6 @@ class Locale extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } } \ No newline at end of file diff --git a/app/sdks/flutter-dart/lib/services/storage.dart b/app/sdks/flutter-dart/lib/services/storage.dart index 041bb6576f..4a46941ac3 100644 --- a/app/sdks/flutter-dart/lib/services/storage.dart +++ b/app/sdks/flutter-dart/lib/services/storage.dart @@ -7,13 +7,12 @@ import '../enums.dart'; import "../service.dart"; class Storage extends Service { - Storage(Client client): super(client); /// 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). - Future listFiles({String search = null, int limit = 25, int offset = null, OrderType orderType = OrderType.asc}) { + Future listFiles({String search = '', int limit = 25, int offset = 0, OrderType orderType = OrderType.asc}) { final String path = '/storage/files'; final Map params = { @@ -23,7 +22,7 @@ class Storage extends Service { 'orderType': orderType.name(), }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// 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 @@ -37,7 +36,7 @@ class Storage extends Service { 'write': write, }; - return this.client.call(HttpMethod.post, path: path, params: params); + return client.call(HttpMethod.post, path: path, params: params); } /// Get file by its unique ID. This endpoint response returns a JSON object /// with the file metadata. @@ -47,7 +46,7 @@ class Storage extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Update file by its unique ID. Only users with write permissions have access /// to update this resource. @@ -59,7 +58,7 @@ class Storage extends Service { 'write': write, }; - return this.client.call(HttpMethod.put, path: path, params: params); + return client.call(HttpMethod.put, path: path, params: params); } /// Delete a file by its unique ID. Only users with write permissions have /// access to delete this resource. @@ -69,7 +68,7 @@ class Storage extends Service { final Map params = { }; - return this.client.call(HttpMethod.delete, path: path, params: params); + return client.call(HttpMethod.delete, path: path, params: params); } /// Get file content by its unique ID. The endpoint response return with a /// 'Content-Disposition: attachment' header that tells the browser to start @@ -80,13 +79,13 @@ class Storage extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Get a file preview image. Currently, this method supports preview for image /// files (jpg, png, and gif), other supported formats, like pdf, docs, slides, /// and spreadsheets, will return the file icon image. You can also pass query /// string arguments for cutting and resizing your preview image. - Future getFilePreview({@required String fileId, int width = null, int height = null, int quality = 100, String background = null, String output = null}) { + Future getFilePreview({@required String fileId, int width = 0, int height = 0, int quality = 100, String background = '', String output = ''}) { final String path = '/storage/files/{fileId}/preview'.replaceAll(RegExp('{fileId}'), fileId); final Map params = { @@ -97,17 +96,17 @@ class Storage extends Service { 'output': output, }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Get file content by its unique ID. This endpoint is similar to the download /// method but returns with no 'Content-Disposition: attachment' header. - Future getFileView({@required String fileId, String as = null}) { + Future getFileView({@required String fileId, String as = ''}) { final String path = '/storage/files/{fileId}/view'.replaceAll(RegExp('{fileId}'), fileId); final Map params = { 'as': as, }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } } \ No newline at end of file diff --git a/app/sdks/flutter-dart/lib/services/teams.dart b/app/sdks/flutter-dart/lib/services/teams.dart index 483efd3b33..2539823df0 100644 --- a/app/sdks/flutter-dart/lib/services/teams.dart +++ b/app/sdks/flutter-dart/lib/services/teams.dart @@ -7,13 +7,12 @@ import '../enums.dart'; import "../service.dart"; class Teams extends Service { - Teams(Client client): super(client); /// 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). - Future list({String search = null, int limit = 25, int offset = null, OrderType orderType = OrderType.asc}) { + Future list({String search = '', int limit = 25, int offset = 0, OrderType orderType = OrderType.asc}) { final String path = '/teams'; final Map params = { @@ -23,7 +22,7 @@ class Teams extends Service { 'orderType': orderType.name(), }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Create a new team. The user who creates the team will automatically be /// assigned as the owner of the team. The team owner can invite new members, @@ -37,7 +36,7 @@ class Teams extends Service { 'roles': roles, }; - return this.client.call(HttpMethod.post, path: path, params: params); + return client.call(HttpMethod.post, path: path, params: params); } /// Get team by its unique ID. All team members have read access for this /// resource. @@ -47,7 +46,7 @@ class Teams extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Update team by its unique ID. Only team owners have write access for this /// resource. @@ -58,7 +57,7 @@ class Teams extends Service { 'name': name, }; - return this.client.call(HttpMethod.put, path: path, params: params); + return client.call(HttpMethod.put, path: path, params: params); } /// Delete team by its unique ID. Only team owners have write access for this /// resource. @@ -68,7 +67,7 @@ class Teams extends Service { final Map params = { }; - return this.client.call(HttpMethod.delete, path: path, params: params); + return client.call(HttpMethod.delete, path: path, params: params); } /// Get team members by the team unique ID. All team members have read access /// for this list of resources. @@ -78,7 +77,7 @@ class Teams extends Service { final Map params = { }; - return this.client.call(HttpMethod.get, path: path, params: params); + return client.call(HttpMethod.get, path: path, params: params); } /// Use this endpoint to invite a new member to join your team. An email with a /// link to join the team will be sent to the new member email address if the @@ -93,7 +92,7 @@ class Teams extends Service { /// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) /// the only valid redirect URL's are the once from domains you have set when /// added your platforms in the console interface. - Future createMembership({@required String teamId, @required String email, @required List roles, @required String url, String name = null}) { + Future createMembership({@required String teamId, @required String email, @required List roles, @required String url, String name = ''}) { final String path = '/teams/{teamId}/memberships'.replaceAll(RegExp('{teamId}'), teamId); final Map params = { @@ -103,7 +102,7 @@ class Teams extends Service { 'url': url, }; - return this.client.call(HttpMethod.post, path: path, params: params); + return client.call(HttpMethod.post, path: path, params: params); } /// This endpoint allows a user to leave a team or for a team owner to delete /// the membership of any other team member. You can also use this endpoint to @@ -114,7 +113,7 @@ class Teams extends Service { final Map params = { }; - return this.client.call(HttpMethod.delete, path: path, params: params); + return client.call(HttpMethod.delete, path: path, params: params); } /// Use this endpoint to allow a user to accept an invitation to join a team /// after he is being redirected back to your app from the invitation email he @@ -127,6 +126,6 @@ class Teams extends Service { 'secret': secret, }; - return this.client.call(HttpMethod.patch, path: path, params: params); + return client.call(HttpMethod.patch, path: path, params: params); } } \ No newline at end of file diff --git a/app/sdks/flutter-dart/pubspec.yaml b/app/sdks/flutter-dart/pubspec.yaml index 00139410e4..50bfd82a64 100644 --- a/app/sdks/flutter-dart/pubspec.yaml +++ b/app/sdks/flutter-dart/pubspec.yaml @@ -1,7 +1,10 @@ name: appwrite -version: 0.0.8 -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) -homepage: https://github.com/appwrite/sdk-for-dart +version: 0.0.9 +description: Appwrite is an open-source backend as a service server that allows you to accelerate your app development by leveraging Appwrite ready to use API and tools +homepage: https://appwrite.io +repository: https://github.com/appwrite/sdk-for-dart +issue_tracker: https://github.com/appwrite/sdk-generator/issues +documentation: https://appwrite.io/support environment: sdk: '>=2.6.0 <3.0.0' dependencies: diff --git a/app/sdks/server-go/README.md b/app/sdks/server-go/README.md index 7e5c39a721..6769ae8da2 100644 --- a/app/sdks/server-go/README.md +++ b/app/sdks/server-go/README.md @@ -5,7 +5,9 @@ **This SDK is compatible with Appwrite server version 0.5.3. 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) +Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the Go SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/app/sdks/server-nodejs/README.md b/app/sdks/server-nodejs/README.md index 76ba6d4de2..b51df55ce9 100644 --- a/app/sdks/server-nodejs/README.md +++ b/app/sdks/server-nodejs/README.md @@ -3,7 +3,9 @@ ![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?v=1) ![Version](https://img.shields.io/badge/api%20version-0.5.3-blue.svg?v=1) -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) +Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the Node.js SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/app/sdks/server-nodejs/package.json b/app/sdks/server-nodejs/package.json index a61515bf29..346951a2ac 100644 --- a/app/sdks/server-nodejs/package.json +++ b/app/sdks/server-nodejs/package.json @@ -1,7 +1,9 @@ { "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)", + "description": "Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the Node.js SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)", "version": "1.0.32", "license": "BSD-3-Clause", "main": "index.js", diff --git a/app/sdks/server-php/README.md b/app/sdks/server-php/README.md index 9470cf512d..140173b028 100644 --- a/app/sdks/server-php/README.md +++ b/app/sdks/server-php/README.md @@ -3,7 +3,9 @@ ![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?v=1) ![Version](https://img.shields.io/badge/api%20version-0.5.3-blue.svg?v=1) -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) +Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the PHP SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/app/sdks/server-php/composer.json b/app/sdks/server-php/composer.json index c7e4692c95..fc13cb3bed 100644 --- a/app/sdks/server-php/composer.json +++ b/app/sdks/server-php/composer.json @@ -1,6 +1,8 @@ { "name": "appwrite/appwrite", - "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)", + "description": "Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the PHP SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)", "type": "library", "license": "BSD-3-Clause", "support": { diff --git a/app/sdks/server-python/README.md b/app/sdks/server-python/README.md index 2c065d3466..11e9a9a7cd 100644 --- a/app/sdks/server-python/README.md +++ b/app/sdks/server-python/README.md @@ -5,7 +5,9 @@ **This SDK is compatible with Appwrite server version 0.5.3. 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) +Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/app/sdks/server-python/setup.py b/app/sdks/server-python/setup.py index f7707eaefa..a0e64f1a9a 100644 --- a/app/sdks/server-python/setup.py +++ b/app/sdks/server-python/setup.py @@ -5,7 +5,9 @@ setuptools.setup( packages = ['appwrite', 'appwrite/services'], version = '0.0.4', 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)', + description = 'Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)', author = 'Appwrite Team', author_email = 'team@appwrite.io', maintainer = 'Appwrite Team', diff --git a/app/sdks/server-ruby/README.md b/app/sdks/server-ruby/README.md index 812c86fea9..6b71d0ccee 100644 --- a/app/sdks/server-ruby/README.md +++ b/app/sdks/server-ruby/README.md @@ -5,7 +5,9 @@ **This SDK is compatible with Appwrite server version 0.5.3. 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) +Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the Ruby SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/app/sdks/server-ruby/appwrite.gemspec b/app/sdks/server-ruby/appwrite.gemspec index 308e225449..99fa047a96 100644 --- a/app/sdks/server-ruby/appwrite.gemspec +++ b/app/sdks/server-ruby/appwrite.gemspec @@ -2,7 +2,9 @@ Gem::Specification.new do |s| s.name = 'appwrite' s.version = '1.0.9' - 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.summary = "Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the Ruby SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + 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' s.email = 'team@appwrite.io' diff --git a/app/sdks/web-javascript/README.md b/app/sdks/web-javascript/README.md index 84912efd24..812e31fd29 100644 --- a/app/sdks/web-javascript/README.md +++ b/app/sdks/web-javascript/README.md @@ -3,7 +3,9 @@ ![License](https://img.shields.io/github/license/appwrite/sdk-for-js.svg?v=1) ![Version](https://img.shields.io/badge/api%20version-0.5.3-blue.svg?v=1) -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) +Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the JavaScript SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) ![Appwrite](https://appwrite.io/images/github.png) diff --git a/app/sdks/web-javascript/package.json b/app/sdks/web-javascript/package.json index 8baa2d87c7..c0f3d8d4fa 100644 --- a/app/sdks/web-javascript/package.json +++ b/app/sdks/web-javascript/package.json @@ -1,7 +1,9 @@ { "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)", + "description": "Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the JavaScript SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)", "version": "1.0.29", "license": "BSD-3-Clause", "main": "src/sdk.js", diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php index 63e50cbb76..c767de5a0a 100644 --- a/app/tasks/sdks.php +++ b/app/tasks/sdks.php @@ -135,6 +135,10 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND $sdk = new SDK($config, new Swagger2($spec)); $sdk + ->setDescription("Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the {$language['name']} SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)") + ->setShortDescription('Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API') ->setLicense($license) ->setLicenseContent($licenseContent) ->setVersion($language['version']) diff --git a/composer.lock b/composer.lock index 5d402055a2..322f9ff361 100644 --- a/composer.lock +++ b/composer.lock @@ -1622,11 +1622,7 @@ "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator", -<<<<<<< HEAD - "reference": "ea7291f4419ad52f4565f57f1b61eace0bf3bba4" -======= - "reference": "3b7389388f29c6e0cf53cf2233ee516fb20ad9f7" ->>>>>>> 02c7f4a6119d1e53543293d97bff66ebc9da7ebd + "reference": "f8e7c334e672468ca9d2e616e10f2379ea890ae7" }, "require": { "ext-curl": "*", @@ -1656,7 +1652,7 @@ } ], "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", - "time": "2020-04-05T13:47:11+00:00" + "time": "2020-04-06T04:46:23+00:00" }, { "name": "doctrine/instantiator", diff --git a/docs/sdks/dart/CHANGELOG.md b/docs/sdks/dart/CHANGELOG.md index a7a936ee70..351e76cc28 100644 --- a/docs/sdks/dart/CHANGELOG.md +++ b/docs/sdks/dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.9 + +- Updated deafult params + ## 0.0.8 - Fixed compilation error in Client class