1
0
Fork 0
mirror of synced 2024-06-10 06:44:45 +12:00

Updated flutter-dev channel

This commit is contained in:
Eldad Fux 2020-09-03 13:40:38 +03:00
parent 7b3adbe2b0
commit b3930ff37a
10 changed files with 212 additions and 91 deletions

View file

@ -45,7 +45,7 @@ return [
[
'key' => 'flutter-dev',
'name' => 'Flutter (Dev Channel)',
'version' => '0.2.3',
'version' => '0.3.0',
'url' => 'https://github.com/appwrite/sdk-for-flutter-dev',
'enabled' => true,
'beta' => true,

View file

@ -1,3 +1,8 @@
## 0.3.0
- Updated package dependencies (@lohanidamodar)
- Added Flutter for Web compatibility (@lohanidamodar)
## 0.2.3
- Fixed OAuth2 cookie bug, where a new session cookie couldn't overwrite an old cookie

View file

@ -20,7 +20,7 @@ Add this to your package's `pubspec.yaml` file:
```yml
dependencies:
appwrite: ^0.2.3
appwrite: ^0.3.0
```
You can install packages from the command line:

View file

@ -1,6 +1,7 @@
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
import 'package:dio/adapter.dart';
import 'package:dio_cookie_manager/dio_cookie_manager.dart';
import 'package:cookie_jar/cookie_jar.dart';
@ -20,17 +21,21 @@ class Client {
PersistCookieJar cookieJar;
Client({this.endPoint = 'https://appwrite.io/v1', this.selfSigned = false, Dio http}) : this.http = http ?? Dio() {
type = (Platform.isIOS) ? 'ios' : type;
type = (Platform.isMacOS) ? 'macos' : type;
type = (Platform.isAndroid) ? 'android' : type;
type = (Platform.isLinux) ? 'linux' : type;
type = (Platform.isWindows) ? 'windows' : type;
type = (Platform.isFuchsia) ? 'fuchsia' : type;
// Platform is not supported in web so if web, set type to web automatically and skip Platform check
if(kIsWeb) {
type = 'web';
}else{
type = (Platform.isIOS) ? 'ios' : type;
type = (Platform.isMacOS) ? 'macos' : type;
type = (Platform.isAndroid) ? 'android' : type;
type = (Platform.isLinux) ? 'linux' : type;
type = (Platform.isWindows) ? 'windows' : type;
type = (Platform.isFuchsia) ? 'fuchsia' : type;
}
this.headers = {
'content-type': 'application/json',
'x-sdk-version': 'appwrite:dart:0.2.3',
'x-sdk-version': 'appwrite:flutter:0.3.0',
};
this.config = {};
@ -78,17 +83,20 @@ class Client {
Future init() async {
if(!initialized) {
final Directory cookieDir = await _getCookiePath();
cookieJar = new PersistCookieJar(dir:cookieDir.path);
// if web skip cookie implementation and origin header as those are automatically handled by browsers
if(!kIsWeb) {
final Directory cookieDir = await _getCookiePath();
cookieJar = new PersistCookieJar(dir:cookieDir.path);
this.http.interceptors.add(CookieManager(cookieJar));
PackageInfo packageInfo = await PackageInfo.fromPlatform();
addHeader('Origin', 'appwrite-' + type + '://' + packageInfo.packageName);
}else{
// if web set httpClientAdapter as BrowserHttpClientAdapter with withCredentials true to make cookies work
this.http.options.extra['withCredentials'] = true;
}
this.http.options.baseUrl = this.endPoint;
this.http.options.validateStatus = (status) => status < 400;
this.http.interceptors.add(CookieManager(cookieJar));
PackageInfo packageInfo = await PackageInfo.fromPlatform();
addHeader('Origin', 'appwrite-' + type + '://' + packageInfo.packageName);
}
}
@ -114,6 +122,10 @@ class Client {
}
if (method == HttpMethod.get) {
params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
params[key] = params[key].toString();
}});
return http.get(path, queryParameters: params, options: options);
} else {
return http.request(path, data: params, options: options);

View file

@ -27,6 +27,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
params[key] = params[key].toString();
}});
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@ -55,6 +59,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
params[key] = params[key].toString();
}});
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@ -79,6 +87,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
params[key] = params[key].toString();
}});
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@ -106,6 +118,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
params[key] = params[key].toString();
}});
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@ -134,6 +150,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
params[key] = params[key].toString();
}});
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@ -161,6 +181,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
params[key] = params[key].toString();
}});
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,

View file

@ -124,6 +124,10 @@ class Storage extends Service {
'project': client.config['project'],
};
params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
params[key] = params[key].toString();
}});
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@ -154,6 +158,10 @@ class Storage extends Service {
'project': client.config['project'],
};
params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
params[key] = params[key].toString();
}});
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@ -178,6 +186,10 @@ class Storage extends Service {
'project': client.config['project'],
};
params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
params[key] = params[key].toString();
}});
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,

View file

@ -1,5 +1,5 @@
name: appwrite
version: 0.2.3
name: appwrite-dev
version: 0.3.0
description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API
homepage: https://appwrite.io
repository: https://github.com/appwrite/sdk-for-flutter-dev
@ -8,31 +8,16 @@ documentation: https://appwrite.io/support
environment:
sdk: '>=2.6.0 <3.0.0'
dependencies:
meta: ^1.1.8
path_provider: ^1.6.5
package_info: ^0.4.0+16
dio: ^3.0.0
cookie_jar: ^1.0.0
meta: ^1.2.2
path_provider: ^1.6.14
package_info: ^0.4.3
dio: ^3.0.10
cookie_jar: ^1.0.1
dio_cookie_manager: ^1.0.0
flutter_web_auth: ^0.2.4
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
sdk: flutter

173
composer.lock generated
View file

@ -239,12 +239,12 @@
"source": {
"type": "git",
"url": "https://github.com/composer/ca-bundle.git",
"reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd"
"reference": "8a7ecad675253e4654ea05505233285377405215"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/95c63ab2117a72f48f5a55da9740a3273d45b7fd",
"reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd",
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/8a7ecad675253e4654ea05505233285377405215",
"reference": "8a7ecad675253e4654ea05505233285377405215",
"shasum": ""
},
"require": {
@ -287,25 +287,39 @@
"ssl",
"tls"
],
"time": "2020-04-08T08:27:21+00:00"
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
"type": "tidelift"
}
],
"time": "2020-08-23T12:54:47+00:00"
},
{
"name": "dasprid/enum",
"version": "1.0.0",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/DASPRiD/Enum.git",
"reference": "631ef6e638e9494b0310837fa531bedd908fc22b"
"reference": "6ccc0d7141a7f149e3c56cb0ce5f05d9152cfd07"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/631ef6e638e9494b0310837fa531bedd908fc22b",
"reference": "631ef6e638e9494b0310837fa531bedd908fc22b",
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/6ccc0d7141a7f149e3c56cb0ce5f05d9152cfd07",
"reference": "6ccc0d7141a7f149e3c56cb0ce5f05d9152cfd07",
"shasum": ""
},
"require-dev": {
"phpunit/phpunit": "^6.4",
"squizlabs/php_codesniffer": "^3.1"
"phpunit/phpunit": "^7 | ^8 | ^9",
"squizlabs/php_codesniffer": "^3.4"
},
"type": "library",
"autoload": {
@ -321,7 +335,8 @@
{
"name": "Ben Scholzen 'DASPRiD'",
"email": "mail@dasprids.de",
"homepage": "https://dasprids.de/"
"homepage": "https://dasprids.de/",
"role": "Developer"
}
],
"description": "PHP 7.1 enum implementation",
@ -329,7 +344,7 @@
"enum",
"map"
],
"time": "2017-10-25T22:45:27+00:00"
"time": "2020-07-30T16:37:13+00:00"
},
{
"name": "domnikl/statsd",
@ -544,6 +559,28 @@
"rest",
"web service"
],
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://github.com/Nyholm",
"type": "github"
},
{
"url": "https://github.com/alexeyshockov",
"type": "github"
},
{
"url": "https://github.com/gmponos",
"type": "github"
},
{
"url": "https://github.com/sagikazarmark",
"type": "github"
}
],
"time": "2020-07-02T06:52:04+00:00"
},
{
@ -731,29 +768,29 @@
},
{
"name": "maxmind-db/reader",
"version": "v1.6.0",
"version": "v1.7.0",
"source": {
"type": "git",
"url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git",
"reference": "febd4920bf17c1da84cef58e56a8227dfb37fbe4"
"reference": "942553da239f12051275f9c666538b5dd09e2908"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/febd4920bf17c1da84cef58e56a8227dfb37fbe4",
"reference": "febd4920bf17c1da84cef58e56a8227dfb37fbe4",
"url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/942553da239f12051275f9c666538b5dd09e2908",
"reference": "942553da239f12051275f9c666538b5dd09e2908",
"shasum": ""
},
"require": {
"php": ">=5.6"
"php": ">=7.2"
},
"conflict": {
"ext-maxminddb": "<1.6.0,>=2.0.0"
"ext-maxminddb": "<1.7.0,>=2.0.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "2.*",
"php-coveralls/php-coveralls": "^2.1",
"phpunit/phpcov": "^3.0",
"phpunit/phpunit": "5.*",
"phpunit/phpcov": ">=6.0.0",
"phpunit/phpunit": ">=8.0.0,<10.0.0",
"squizlabs/php_codesniffer": "3.*"
},
"suggest": {
@ -787,7 +824,7 @@
"geolocation",
"maxmind"
],
"time": "2019-12-19T22:59:03+00:00"
"time": "2020-08-07T22:10:05+00:00"
},
{
"name": "maxmind/web-service-common",
@ -987,6 +1024,12 @@
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"funding": [
{
"url": "https://github.com/synchro",
"type": "github"
}
],
"time": "2020-05-27T12:24:03+00:00"
},
{
@ -1183,12 +1226,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git",
"reference": "bc6549d068d0160e0f10f7a5a23c7d1406b95ebe"
"reference": "045643b91eaa34c4c37150ac477765c13552af33"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/bc6549d068d0160e0f10f7a5a23c7d1406b95ebe",
"reference": "bc6549d068d0160e0f10f7a5a23c7d1406b95ebe",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/045643b91eaa34c4c37150ac477765c13552af33",
"reference": "045643b91eaa34c4c37150ac477765c13552af33",
"shasum": ""
},
"require": {
@ -1260,7 +1303,7 @@
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
"time": "2020-08-04T21:02:56+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
@ -1923,7 +1966,7 @@
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator",
"reference": "404cf6bb4c75f8ae3b2419e04f6afd215ed706a5"
"reference": "0dea55e58e3ec59dd3557a4144fcbb390691e03a"
},
"require": {
"ext-curl": "*",
@ -1953,7 +1996,7 @@
}
],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"time": "2020-07-26T07:11:06+00:00"
"time": "2020-09-03T10:16:09+00:00"
},
{
"name": "doctrine/instantiator",
@ -2009,6 +2052,20 @@
"constructor",
"instantiate"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
"type": "tidelift"
}
],
"time": "2020-06-15T18:51:04+00:00"
},
{
@ -2126,12 +2183,12 @@
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5"
"reference": "a3409d10079990eeb489c3fead0ac070b5b38895"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5",
"reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a3409d10079990eeb489c3fead0ac070b5b38895",
"reference": "a3409d10079990eeb489c3fead0ac070b5b38895",
"shasum": ""
},
"require": {
@ -2166,7 +2223,13 @@
"object",
"object graph"
],
"time": "2020-06-29T13:22:24+00:00"
"funding": [
{
"url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
"type": "tidelift"
}
],
"time": "2020-08-28T16:31:07+00:00"
},
{
"name": "phar-io/manifest",
@ -2325,12 +2388,12 @@
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "1ac416df3f66c542f2d3688925105b539f064b64"
"reference": "f6075926e937828b180e02964e2d2062af8a9537"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/1ac416df3f66c542f2d3688925105b539f064b64",
"reference": "1ac416df3f66c542f2d3688925105b539f064b64",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f6075926e937828b180e02964e2d2062af8a9537",
"reference": "f6075926e937828b180e02964e2d2062af8a9537",
"shasum": ""
},
"require": {
@ -2369,34 +2432,33 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2020-07-21T08:16:41+00:00"
"time": "2020-09-02T21:38:01+00:00"
},
{
"name": "phpdocumentor/type-resolver",
"version": "dev-master",
"version": "1.x-dev",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "94f3ddc5d77e49daadadd33b798b933e52dde82c"
"reference": "e21c0bd532911ec05ebc258e4086ea61c86e0750"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/94f3ddc5d77e49daadadd33b798b933e52dde82c",
"reference": "94f3ddc5d77e49daadadd33b798b933e52dde82c",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e21c0bd532911ec05ebc258e4086ea61c86e0750",
"reference": "e21c0bd532911ec05ebc258e4086ea61c86e0750",
"shasum": ""
},
"require": {
"php": "^7.2",
"php": "^7.2 || ^8.0",
"phpdocumentor/reflection-common": "^2.0"
},
"require-dev": {
"ext-tokenizer": "^7.2",
"mockery/mockery": "~1"
"ext-tokenizer": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
"dev-1.x": "1.x-dev"
}
},
"autoload": {
@ -2415,7 +2477,7 @@
}
],
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"time": "2020-06-19T19:40:27+00:00"
"time": "2020-09-02T21:29:45+00:00"
},
{
"name": "phpspec/prophecy",
@ -2685,7 +2747,7 @@
},
{
"name": "phpunit/php-token-stream",
"version": "3.1.1",
"version": "3.1.x-dev",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
@ -2730,6 +2792,7 @@
"keywords": [
"tokenizer"
],
"abandoned": true,
"time": "2019-09-17T06:23:10+00:00"
},
{
@ -3587,12 +3650,12 @@
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "e063bab1a67f4ceea759cee20c10ed609d1f6abb"
"reference": "b48bd18dc6f967ad09af9eab521cdf0e68fb6a95"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/e063bab1a67f4ceea759cee20c10ed609d1f6abb",
"reference": "e063bab1a67f4ceea759cee20c10ed609d1f6abb",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/b48bd18dc6f967ad09af9eab521cdf0e68fb6a95",
"reference": "b48bd18dc6f967ad09af9eab521cdf0e68fb6a95",
"shasum": ""
},
"require": {
@ -3607,7 +3670,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.13-dev"
"dev-master": "2.14-dev"
}
},
"autoload": {
@ -3644,7 +3707,17 @@
"keywords": [
"templating"
],
"time": "2020-07-06T13:35:12+00:00"
"funding": [
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/twig/twig",
"type": "tidelift"
}
],
"time": "2020-08-23T15:56:05+00:00"
},
{
"name": "webmozart/assert",

View file

@ -1,3 +1,8 @@
## 0.3.0
- Updated package dependencies (@lohanidamodar)
- Added Flutter for Web compatibility (@lohanidamodar)
## 0.2.3
- Fixed OAuth2 cookie bug, where a new session cookie couldn't overwrite an old cookie

View file

@ -1,3 +1,8 @@
## 0.3.0
- Updated package dependencies (@lohanidamodar)
- Added Flutter for Web compatibility (@lohanidamodar)
## 0.2.3
- Fixed OAuth2 cookie bug, where a new session cookie couldn't overwrite an old cookie