From 79c0368b58d56bdb2c8b802f305f023d41c2237e Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Sat, 17 Oct 2020 20:49:09 +0300
Subject: [PATCH 001/230] First commit
---
app/controllers/api/account.php | 30 +++++
composer.json | 3 +-
composer.lock | 215 ++++++++++++++++++++------------
3 files changed, 166 insertions(+), 82 deletions(-)
diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php
index f80c09c6b9..9eaa82d5aa 100644
--- a/app/controllers/api/account.php
+++ b/app/controllers/api/account.php
@@ -1,5 +1,6 @@
desc('Create Account JWT')
+ ->groups(['api', 'account'])
+ ->label('scope', 'account')
+ ->label('sdk.platform', [APP_PLATFORM_CLIENT])
+ ->label('sdk.namespace', 'account')
+ ->label('sdk.method', 'createJWT')
+ ->label('sdk.description', '/docs/references/account/create-jwt.md')
+ ->label('abuse-limit', 10)
+ ->label('abuse-key', 'url:{url},userId:{param-userId}')
+ ->action(function ($request, $response, $projectDB) {
+ /** @var Appwrite\Swoole\Request $request */
+ /** @var Appwrite\Utopia\Response $response */
+ /** @var Appwrite\Database\Database $projectDB */
+
+ // Instantiate with key, algo, maxAge and leeway.
+ $jwt = new JWT('secret', 'HS256', 3600, 10);
+
+ $response->setStatusCode(Response::STATUS_CODE_CREATED);
+
+ // $response->dynamic(new Document(['jwt' => $jwt]), Response::MODEL_SESSION);
+ $response->json(['jwt' => $jwt->encode([
+ 'uid' => 1,
+ 'aud' => 'http://site.com',
+ 'scopes' => ['user'],
+ 'iss' => 'http://api.mysite.com',
+ ])]);
+ }, ['request', 'response', 'projectDB', 'webhooks', 'audits']);
+
App::get('/v1/account')
->desc('Get Account')
->groups(['api', 'account'])
diff --git a/composer.json b/composer.json
index f0ce2624cb..822258dcb3 100644
--- a/composer.json
+++ b/composer.json
@@ -50,7 +50,8 @@
"domnikl/statsd": "3.0.*",
"influxdb/influxdb-php": "1.15.*",
"bacon/bacon-qr-code": "2.0.2",
- "phpmailer/phpmailer": "6.1.7"
+ "phpmailer/phpmailer": "6.1.7",
+ "adhocore/jwt": "1.1.0"
},
"require-dev": {
"swoole/ide-helper": "4.5.4",
diff --git a/composer.lock b/composer.lock
index 297b144e81..31c4df00c6 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,61 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "07a5b2d2e742e8651d58889c3253c3b5",
+ "content-hash": "20586cad26950d57c6fe42295d145904",
"packages": [
+ {
+ "name": "adhocore/jwt",
+ "version": "1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/adhocore/php-jwt.git",
+ "reference": "424a1d66b729a316dd074e6382167765b810cd3d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/adhocore/php-jwt/zipball/424a1d66b729a316dd074e6382167765b810cd3d",
+ "reference": "424a1d66b729a316dd074e6382167765b810cd3d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^6.5 || ^7.5"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Ahc\\Jwt\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jitendra Adhikari",
+ "email": "jiten.adhikary@gmail.com"
+ }
+ ],
+ "description": "Ultra lightweight JSON web token (JWT) library for PHP5.5+.",
+ "keywords": [
+ "auth",
+ "json-web-token",
+ "jwt",
+ "jwt-auth",
+ "jwt-php",
+ "token"
+ ],
+ "funding": [
+ {
+ "url": "https://paypal.me/ji10",
+ "type": "custom"
+ }
+ ],
+ "time": "2020-10-09T00:34:35+00:00"
+ },
{
"name": "appwrite/php-clamav",
"version": "v1.0.1",
@@ -2300,12 +2353,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "ece0c3ceee73810bd95226401bbfaea9e0f64de7"
+ "reference": "e33667ac376b7f4dbe97ab556f8e7c8daee383d3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ece0c3ceee73810bd95226401bbfaea9e0f64de7",
- "reference": "ece0c3ceee73810bd95226401bbfaea9e0f64de7",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e33667ac376b7f4dbe97ab556f8e7c8daee383d3",
+ "reference": "e33667ac376b7f4dbe97ab556f8e7c8daee383d3",
"shasum": ""
},
"require": {
@@ -2365,7 +2418,7 @@
"type": "github"
}
],
- "time": "2020-10-09T14:34:55+00:00"
+ "time": "2020-10-15T05:14:52+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -2373,12 +2426,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8"
+ "reference": "8a1b0bfa74eba894f241e23261febb84c7ffbd8d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8",
- "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/8a1b0bfa74eba894f241e23261febb84c7ffbd8d",
+ "reference": "8a1b0bfa74eba894f241e23261febb84c7ffbd8d",
"shasum": ""
},
"require": {
@@ -2421,7 +2474,7 @@
"type": "github"
}
],
- "time": "2020-09-28T05:57:25+00:00"
+ "time": "2020-10-15T05:05:12+00:00"
},
{
"name": "phpunit/php-invoker",
@@ -2429,12 +2482,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-invoker.git",
- "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67"
+ "reference": "dcc4b2e39d6cb5ba5435a0177ebe947c0c0d05ff"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
- "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/dcc4b2e39d6cb5ba5435a0177ebe947c0c0d05ff",
+ "reference": "dcc4b2e39d6cb5ba5435a0177ebe947c0c0d05ff",
"shasum": ""
},
"require": {
@@ -2480,7 +2533,7 @@
"type": "github"
}
],
- "time": "2020-09-28T05:58:55+00:00"
+ "time": "2020-10-15T05:05:21+00:00"
},
{
"name": "phpunit/php-text-template",
@@ -2488,12 +2541,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "18c887016e60e52477e54534956d7b47bc52cd84"
+ "reference": "0b11f04dcd54d149c3904cda577ea8ef8735e377"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/18c887016e60e52477e54534956d7b47bc52cd84",
- "reference": "18c887016e60e52477e54534956d7b47bc52cd84",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0b11f04dcd54d149c3904cda577ea8ef8735e377",
+ "reference": "0b11f04dcd54d149c3904cda577ea8ef8735e377",
"shasum": ""
},
"require": {
@@ -2535,7 +2588,7 @@
"type": "github"
}
],
- "time": "2020-09-28T06:03:05+00:00"
+ "time": "2020-10-15T05:06:00+00:00"
},
{
"name": "phpunit/php-timer",
@@ -2543,12 +2596,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "c9ff14f493699e2f6adee9fd06a0245b276643b7"
+ "reference": "7fe57355ba7462b1cd940d93aa003660b4e6db20"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/c9ff14f493699e2f6adee9fd06a0245b276643b7",
- "reference": "c9ff14f493699e2f6adee9fd06a0245b276643b7",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/7fe57355ba7462b1cd940d93aa003660b4e6db20",
+ "reference": "7fe57355ba7462b1cd940d93aa003660b4e6db20",
"shasum": ""
},
"require": {
@@ -2590,7 +2643,7 @@
"type": "github"
}
],
- "time": "2020-09-28T06:00:25+00:00"
+ "time": "2020-10-15T05:05:31+00:00"
},
{
"name": "phpunit/phpunit",
@@ -2598,12 +2651,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "8b79c2a70ae855e582cef1ca63a849fe07bdb01d"
+ "reference": "b5c7b8a5d87f4e8947cdaee629a4a9a93e71faf4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8b79c2a70ae855e582cef1ca63a849fe07bdb01d",
- "reference": "8b79c2a70ae855e582cef1ca63a849fe07bdb01d",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b5c7b8a5d87f4e8947cdaee629a4a9a93e71faf4",
+ "reference": "b5c7b8a5d87f4e8947cdaee629a4a9a93e71faf4",
"shasum": ""
},
"require": {
@@ -2689,7 +2742,7 @@
"type": "github"
}
],
- "time": "2020-10-11T07:43:20+00:00"
+ "time": "2020-10-16T07:52:13+00:00"
},
{
"name": "sebastian/cli-parser",
@@ -2697,12 +2750,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/cli-parser.git",
- "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2"
+ "reference": "bb13fcea306b784ef38fc1cda21c1395c233f4bc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2",
- "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2",
+ "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/bb13fcea306b784ef38fc1cda21c1395c233f4bc",
+ "reference": "bb13fcea306b784ef38fc1cda21c1395c233f4bc",
"shasum": ""
},
"require": {
@@ -2741,7 +2794,7 @@
"type": "github"
}
],
- "time": "2020-09-28T06:08:49+00:00"
+ "time": "2020-10-15T05:19:54+00:00"
},
{
"name": "sebastian/code-unit",
@@ -2749,12 +2802,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit.git",
- "reference": "59236be62b1bb9919e6d7f60b0b832dc05cef9ab"
+ "reference": "46a6ff3fabc0449fa17ca3ec485c44ab792f65c1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/59236be62b1bb9919e6d7f60b0b832dc05cef9ab",
- "reference": "59236be62b1bb9919e6d7f60b0b832dc05cef9ab",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/46a6ff3fabc0449fa17ca3ec485c44ab792f65c1",
+ "reference": "46a6ff3fabc0449fa17ca3ec485c44ab792f65c1",
"shasum": ""
},
"require": {
@@ -2793,7 +2846,7 @@
"type": "github"
}
],
- "time": "2020-10-02T14:47:54+00:00"
+ "time": "2020-10-15T05:03:44+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
@@ -2801,12 +2854,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
- "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5"
+ "reference": "a801a24d7681090e8334c631b99181df063ea457"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
- "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/a801a24d7681090e8334c631b99181df063ea457",
+ "reference": "a801a24d7681090e8334c631b99181df063ea457",
"shasum": ""
},
"require": {
@@ -2844,7 +2897,7 @@
"type": "github"
}
],
- "time": "2020-09-28T05:30:19+00:00"
+ "time": "2020-10-15T05:03:53+00:00"
},
{
"name": "sebastian/comparator",
@@ -2852,12 +2905,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "7a8ff306445707539c1a6397372a982a1ec55120"
+ "reference": "d43148f588efca5b5dd0c3d98da467f5aafdac6b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/7a8ff306445707539c1a6397372a982a1ec55120",
- "reference": "7a8ff306445707539c1a6397372a982a1ec55120",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/d43148f588efca5b5dd0c3d98da467f5aafdac6b",
+ "reference": "d43148f588efca5b5dd0c3d98da467f5aafdac6b",
"shasum": ""
},
"require": {
@@ -2914,7 +2967,7 @@
"type": "github"
}
],
- "time": "2020-09-30T06:47:25+00:00"
+ "time": "2020-10-15T05:04:03+00:00"
},
{
"name": "sebastian/complexity",
@@ -2922,12 +2975,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/complexity.git",
- "reference": "ba8cc2da0c0bfbc813d03b56406734030c7f1eff"
+ "reference": "6d4cf3e8224f1e8527ab434b4ba902978af523db"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ba8cc2da0c0bfbc813d03b56406734030c7f1eff",
- "reference": "ba8cc2da0c0bfbc813d03b56406734030c7f1eff",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/6d4cf3e8224f1e8527ab434b4ba902978af523db",
+ "reference": "6d4cf3e8224f1e8527ab434b4ba902978af523db",
"shasum": ""
},
"require": {
@@ -2967,7 +3020,7 @@
"type": "github"
}
],
- "time": "2020-09-28T06:05:03+00:00"
+ "time": "2020-10-15T05:06:11+00:00"
},
{
"name": "sebastian/diff",
@@ -2975,12 +3028,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "e3ec6059b3fe483d42fbaf1fe6eefa201f7b4a6d"
+ "reference": "c25d82b5b776a3ba4e3b232a8688e969477444e0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/e3ec6059b3fe483d42fbaf1fe6eefa201f7b4a6d",
- "reference": "e3ec6059b3fe483d42fbaf1fe6eefa201f7b4a6d",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c25d82b5b776a3ba4e3b232a8688e969477444e0",
+ "reference": "c25d82b5b776a3ba4e3b232a8688e969477444e0",
"shasum": ""
},
"require": {
@@ -3029,7 +3082,7 @@
"type": "github"
}
],
- "time": "2020-10-13T11:48:30+00:00"
+ "time": "2020-10-15T05:04:12+00:00"
},
{
"name": "sebastian/environment",
@@ -3037,12 +3090,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "388b6ced16caa751030f6a69e588299fa09200ac"
+ "reference": "40fcf803a36737ce1d2c46c489fb5d1ec2db45d4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac",
- "reference": "388b6ced16caa751030f6a69e588299fa09200ac",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/40fcf803a36737ce1d2c46c489fb5d1ec2db45d4",
+ "reference": "40fcf803a36737ce1d2c46c489fb5d1ec2db45d4",
"shasum": ""
},
"require": {
@@ -3088,7 +3141,7 @@
"type": "github"
}
],
- "time": "2020-09-28T05:52:38+00:00"
+ "time": "2020-10-15T05:04:22+00:00"
},
{
"name": "sebastian/exporter",
@@ -3096,12 +3149,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65"
+ "reference": "dbdc89af25883b35be6ddd4b88a8bc5d22bb819d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65",
- "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/dbdc89af25883b35be6ddd4b88a8bc5d22bb819d",
+ "reference": "dbdc89af25883b35be6ddd4b88a8bc5d22bb819d",
"shasum": ""
},
"require": {
@@ -3161,7 +3214,7 @@
"type": "github"
}
],
- "time": "2020-09-28T05:24:23+00:00"
+ "time": "2020-10-15T05:04:32+00:00"
},
{
"name": "sebastian/global-state",
@@ -3169,12 +3222,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "ea779cb749a478b22a2564ac41cd7bda79c78dc7"
+ "reference": "3a606041b47fb201c1d62ae03078d0e8a62569a6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/ea779cb749a478b22a2564ac41cd7bda79c78dc7",
- "reference": "ea779cb749a478b22a2564ac41cd7bda79c78dc7",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3a606041b47fb201c1d62ae03078d0e8a62569a6",
+ "reference": "3a606041b47fb201c1d62ae03078d0e8a62569a6",
"shasum": ""
},
"require": {
@@ -3221,7 +3274,7 @@
"type": "github"
}
],
- "time": "2020-09-28T05:54:06+00:00"
+ "time": "2020-10-15T05:04:42+00:00"
},
{
"name": "sebastian/lines-of-code",
@@ -3229,12 +3282,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/lines-of-code.git",
- "reference": "6514b8f21906b8b46f520d1fbd17a4523fa59a54"
+ "reference": "5835b6f4707e022ae53a2a67420a3388b318715a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/6514b8f21906b8b46f520d1fbd17a4523fa59a54",
- "reference": "6514b8f21906b8b46f520d1fbd17a4523fa59a54",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/5835b6f4707e022ae53a2a67420a3388b318715a",
+ "reference": "5835b6f4707e022ae53a2a67420a3388b318715a",
"shasum": ""
},
"require": {
@@ -3274,7 +3327,7 @@
"type": "github"
}
],
- "time": "2020-09-28T06:07:27+00:00"
+ "time": "2020-10-15T05:06:21+00:00"
},
{
"name": "sebastian/object-enumerator",
@@ -3282,12 +3335,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
- "reference": "f6f5957013d84725427d361507e13513702888a4"
+ "reference": "192362c78b33b0231e1e8841678be93ce6f31830"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f6f5957013d84725427d361507e13513702888a4",
- "reference": "f6f5957013d84725427d361507e13513702888a4",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/192362c78b33b0231e1e8841678be93ce6f31830",
+ "reference": "192362c78b33b0231e1e8841678be93ce6f31830",
"shasum": ""
},
"require": {
@@ -3327,7 +3380,7 @@
"type": "github"
}
],
- "time": "2020-09-28T05:55:06+00:00"
+ "time": "2020-10-15T05:04:51+00:00"
},
{
"name": "sebastian/object-reflector",
@@ -3335,12 +3388,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-reflector.git",
- "reference": "d9d0ab3b12acb1768bc1e0a89b23c90d2043cbe5"
+ "reference": "da3d1ade6fef132f2486d297c35cf61e45930a0b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/d9d0ab3b12acb1768bc1e0a89b23c90d2043cbe5",
- "reference": "d9d0ab3b12acb1768bc1e0a89b23c90d2043cbe5",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/da3d1ade6fef132f2486d297c35cf61e45930a0b",
+ "reference": "da3d1ade6fef132f2486d297c35cf61e45930a0b",
"shasum": ""
},
"require": {
@@ -3378,7 +3431,7 @@
"type": "github"
}
],
- "time": "2020-09-28T05:56:16+00:00"
+ "time": "2020-10-15T05:05:01+00:00"
},
{
"name": "sebastian/recursion-context",
@@ -3386,12 +3439,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "7e70f3d32a3058d4ad5226c1371f2dd4677dc073"
+ "reference": "3767a68ada0fc1d50b22db067cd2256b1b722faa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/7e70f3d32a3058d4ad5226c1371f2dd4677dc073",
- "reference": "7e70f3d32a3058d4ad5226c1371f2dd4677dc073",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3767a68ada0fc1d50b22db067cd2256b1b722faa",
+ "reference": "3767a68ada0fc1d50b22db067cd2256b1b722faa",
"shasum": ""
},
"require": {
@@ -3437,7 +3490,7 @@
"type": "github"
}
],
- "time": "2020-09-28T05:27:00+00:00"
+ "time": "2020-10-15T05:05:41+00:00"
},
{
"name": "sebastian/resource-operations",
@@ -3496,12 +3549,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
- "reference": "fa592377f3923946cb90bf1f6a71ba2e5f229909"
+ "reference": "5eb6a85e349cab8a411886cb52c070393d71bc7e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fa592377f3923946cb90bf1f6a71ba2e5f229909",
- "reference": "fa592377f3923946cb90bf1f6a71ba2e5f229909",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/5eb6a85e349cab8a411886cb52c070393d71bc7e",
+ "reference": "5eb6a85e349cab8a411886cb52c070393d71bc7e",
"shasum": ""
},
"require": {
@@ -3540,7 +3593,7 @@
"type": "github"
}
],
- "time": "2020-10-06T08:41:03+00:00"
+ "time": "2020-10-15T05:05:50+00:00"
},
{
"name": "sebastian/version",
From 898d89f3221899e3439074c527f32beb89935f2f Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Tue, 22 Dec 2020 20:54:30 +0530
Subject: [PATCH 002/230] feat: starter code for Response Filters
---
src/Appwrite/Utopia/Response.php | 40 ++++++++++++++++++++
src/Appwrite/Utopia/Response/Filter.php | 16 ++++++++
src/Appwrite/Utopia/Response/Filters/V06.php | 14 +++++++
3 files changed, 70 insertions(+)
create mode 100644 src/Appwrite/Utopia/Response/Filter.php
create mode 100644 src/Appwrite/Utopia/Response/Filters/V06.php
diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php
index a854416c3f..70e8e46d91 100644
--- a/src/Appwrite/Utopia/Response.php
+++ b/src/Appwrite/Utopia/Response.php
@@ -6,6 +6,8 @@ use Exception;
use Utopia\Swoole\Response as SwooleResponse;
use Swoole\Http\Response as SwooleHTTPResponse;
use Appwrite\Database\Document;
+use Appwrite\Utopia\Response\Filter;
+use Appwrite\Utopia\Response\Filter\V06;
use Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response\Model\None;
use Appwrite\Utopia\Response\Model\Any;
@@ -112,6 +114,11 @@ class Response extends SwooleResponse
const MODEL_DOMAIN = 'domain';
const MODEL_DOMAIN_LIST = 'domainList';
+ /**
+ * @var Filter
+ */
+ private static $filter = null;
+
/**
* @var array
*/
@@ -329,4 +336,37 @@ class Response extends SwooleResponse
{
return $this->payload;
}
+
+
+ /**
+ * Function to set a response filter
+ *
+ * @param $filter the response filter to set
+ *
+ * @return void
+ */
+ public static function setFilter(Filter $filter)
+ {
+ self::$filter = $filter;
+ }
+
+ /**
+ * Return the currently set filter
+ *
+ * @return Filter
+ */
+ public static function getFilter(): Filter
+ {
+ return self::$filter;
+ }
+
+ /**
+ * Check if a filter has been set
+ *
+ * @return bool
+ */
+ public static function isFilter(): bool
+ {
+ return self::$filter != null;
+ }
}
diff --git a/src/Appwrite/Utopia/Response/Filter.php b/src/Appwrite/Utopia/Response/Filter.php
new file mode 100644
index 0000000000..9391624d6e
--- /dev/null
+++ b/src/Appwrite/Utopia/Response/Filter.php
@@ -0,0 +1,16 @@
+
Date: Sat, 26 Dec 2020 16:46:43 +0530
Subject: [PATCH 003/230] feat: added function to parse user object
---
src/Appwrite/Utopia/Response/Filter.php | 3 +-
src/Appwrite/Utopia/Response/Filters/V06.php | 51 ++++++++++++++++++--
src/Appwrite/Utopia/Response/Model/User.php | 2 +-
3 files changed, 51 insertions(+), 5 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filter.php b/src/Appwrite/Utopia/Response/Filter.php
index 9391624d6e..6974c4ba89 100644
--- a/src/Appwrite/Utopia/Response/Filter.php
+++ b/src/Appwrite/Utopia/Response/Filter.php
@@ -8,9 +8,10 @@ abstract class Filter {
* Parse the content to another format.
*
* @param array $content
+ * @param string $model
*
* @return array
*/
- abstract function parse(array $content): array;
+ abstract function parse(array $content, string $model): array;
}
\ No newline at end of file
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 389cbb3d26..5d66ad2055 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -2,13 +2,58 @@
namespace Appwrite\Utopia\Response\Filter;
+use Appwrite\Database\Validator\Authorization;
+use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Filter;
+use Exception;
+use Utopia\Config\Config;
class V06 extends Filter {
-
// Convert 0.7 Data format to 0.6 format
- public function parse(array $content): array {
- return array();
+ public function parse(array $content, string $model): array {
+
+ $parsedResponse = array();
+
+ switch($model) {
+ case Response::MODEL_PROJECT :
+ $parsedResponse = $this->parseProject($content);
+ break;
+
+ case Response::MODEL_USER :
+ $parsedResponse = $this->parseUser($content);
+ break;
+
+ default:
+ throw new Exception('Recevied invlaid model : '.$model);
+ }
+
+ return $parsedResponse;
+ }
+
+ private function parseProject(array $content)
+ {
+
+ }
+
+ private function parseUser(array $content){
+ $parsedContent = [];
+
+ $parsedContent['$id'] = $content['$id'];
+ $parsedContent['registration'] = $content['registration'];
+ $parsedContent['name'] = $content['name'];
+ $parsedContent['email'] = $content['email'];
+
+ foreach (Config::getParam('providers') as $key => $provider) {
+ if (!$provider['enabled']) {
+ continue;
+ }
+ $parsedContent['oauth2'.ucfirst($key)] = '';
+ $parsedContent['oauth2'.ucfirst($key).'AccessToken'] = '';
+ }
+
+ $parsedContent['roles'] = Authorization::getRoles();
+
+ return $parsedContent;
}
}
\ No newline at end of file
diff --git a/src/Appwrite/Utopia/Response/Model/User.php b/src/Appwrite/Utopia/Response/Model/User.php
index 79c34db5ef..e11d49ed8f 100644
--- a/src/Appwrite/Utopia/Response/Model/User.php
+++ b/src/Appwrite/Utopia/Response/Model/User.php
@@ -27,7 +27,7 @@ class User extends Model
])
->addRule('status', [
'type' => self::TYPE_INTEGER,
- 'description' => 'User status. 0 for Unavtivated, 1 for active and 2 is blocked.',
+ 'description' => 'User status. 0 for Unactivated, 1 for active and 2 is blocked.',
'example' => 0,
])
->addRule('email', [
From d78e9566124a5bad9c9da82b4f9ef74a2f8cadac Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sat, 26 Dec 2020 16:47:33 +0530
Subject: [PATCH 004/230] feat: added function to parse user object
---
src/Appwrite/Utopia/Response/Filters/V06.php | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 5d66ad2055..7e2f0f579e 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -39,15 +39,16 @@ class V06 extends Filter {
private function parseUser(array $content){
$parsedContent = [];
- $parsedContent['$id'] = $content['$id'];
- $parsedContent['registration'] = $content['registration'];
- $parsedContent['name'] = $content['name'];
- $parsedContent['email'] = $content['email'];
+ $parsedContent['$id'] = $content['$id'] ?? '';
+ $parsedContent['registration'] = $content['registration'] ?? '';
+ $parsedContent['name'] = $content['name'] ?? '';
+ $parsedContent['email'] = $content['email'] ?? '';
foreach (Config::getParam('providers') as $key => $provider) {
if (!$provider['enabled']) {
continue;
}
+
$parsedContent['oauth2'.ucfirst($key)] = '';
$parsedContent['oauth2'.ucfirst($key).'AccessToken'] = '';
}
From a8c07c3381b89b17e91ccaf9b71d5a6010816f88 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sat, 26 Dec 2020 16:48:00 +0530
Subject: [PATCH 005/230] feat: added function to parse user object
---
src/Appwrite/Utopia/Response/Filters/V06.php | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 7e2f0f579e..5166c9e6c5 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -38,7 +38,6 @@ class V06 extends Filter {
private function parseUser(array $content){
$parsedContent = [];
-
$parsedContent['$id'] = $content['$id'] ?? '';
$parsedContent['registration'] = $content['registration'] ?? '';
$parsedContent['name'] = $content['name'] ?? '';
@@ -48,13 +47,12 @@ class V06 extends Filter {
if (!$provider['enabled']) {
continue;
}
-
+
$parsedContent['oauth2'.ucfirst($key)] = '';
$parsedContent['oauth2'.ucfirst($key).'AccessToken'] = '';
}
$parsedContent['roles'] = Authorization::getRoles();
-
return $parsedContent;
}
}
\ No newline at end of file
From 09f42797e32e3fb7dcc1ced469284a2a62df7545 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sat, 26 Dec 2020 16:48:16 +0530
Subject: [PATCH 006/230] feat: added parse method for user object
---
src/Appwrite/Utopia/Response/Filters/V06.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 5166c9e6c5..e4a9d0adf5 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -52,7 +52,7 @@ class V06 extends Filter {
$parsedContent['oauth2'.ucfirst($key).'AccessToken'] = '';
}
- $parsedContent['roles'] = Authorization::getRoles();
+ $parsedContent['roles'] = Authorization::getRoles() ?? [];
return $parsedContent;
}
}
\ No newline at end of file
From 89f35d733fa6bfa526ab07c8b16e78f9be33196a Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sat, 26 Dec 2020 16:56:13 +0530
Subject: [PATCH 007/230] feat: parse session object
---
src/Appwrite/Utopia/Response/Filters/V06.php | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index e4a9d0adf5..4a6e3783fd 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -2,6 +2,7 @@
namespace Appwrite\Utopia\Response\Filter;
+use Appwrite\Auth\Auth;
use Appwrite\Database\Validator\Authorization;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Filter;
@@ -24,6 +25,10 @@ class V06 extends Filter {
$parsedResponse = $this->parseUser($content);
break;
+ case Response::MODEL_SESSION :
+ $parsedResponse = $this->parseSession($content);
+ break;
+
default:
throw new Exception('Recevied invlaid model : '.$model);
}
@@ -36,6 +41,15 @@ class V06 extends Filter {
}
+ private function parseSession(array $content)
+ {
+ $parsedContent = [];
+ $parsedContent['$id'] = $content['$id'];
+ $parsedContent['type'] = Auth::TOKEN_TYPE_LOGIN;
+ $parsedContent['expire'] = $content['exprire'];
+ return $parsedContent;
+ }
+
private function parseUser(array $content){
$parsedContent = [];
$parsedContent['$id'] = $content['$id'] ?? '';
From 3a7dda5e102f390aef4753660f70ae35e071e1c1 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sat, 26 Dec 2020 17:47:43 +0530
Subject: [PATCH 008/230] feat: parse session object
---
src/Appwrite/Utopia/Response/Filters/V06.php | 55 ++++++++++++++------
1 file changed, 38 insertions(+), 17 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 4a6e3783fd..019b523d9b 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -28,6 +28,10 @@ class V06 extends Filter {
case Response::MODEL_SESSION :
$parsedResponse = $this->parseSession($content);
break;
+
+ case Response::MODEL_ANY :
+ $parsedResponse = $content;
+ break;
default:
throw new Exception('Recevied invlaid model : '.$model);
@@ -43,30 +47,47 @@ class V06 extends Filter {
private function parseSession(array $content)
{
- $parsedContent = [];
- $parsedContent['$id'] = $content['$id'];
- $parsedContent['type'] = Auth::TOKEN_TYPE_LOGIN;
- $parsedContent['expire'] = $content['exprire'];
- return $parsedContent;
+ // Handle list of sessions
+ if (isset($content['sum'])) {
+ $sessions = $content['sessions'];
+
+ $parsedResponse = [];
+ foreach($sessions as $session) {
+
+ // WIP
+ // $parsedResponse['$id'] = $token->getId();
+ // $parsedResponse['OS'] = $dd->getOs();
+ // $parsedResponse['client'] = $dd->getClient();
+ // $parsedResponse['device'] = $dd->getDevice();
+ // $parsedResponse['brand'] = $dd->getBrand();
+ // $parsedResponse['model'] = $dd->getModel();
+ // $parsedResponse['ip'] = $token->getAttribute('ip', '');
+ // $parsedResponse['geo'] = [];
+ // $parsedResponse['current'] = ($current == $token->getId()) ? true : false;
+ // $parsedResponse[$index]['geo']['isoCode'] = '--';
+ // $parsedResponse[$index]['geo']['country'] = Locale::getText('locale.country.unknown');
+
+ $parsedResponse[] = $session;
+ }
+ return $parsedResponse;
+ } else {
+ // Handle single session
+ $content['type'] = Auth::TOKEN_TYPE_LOGIN;
+ return $content;
+ }
}
- private function parseUser(array $content){
- $parsedContent = [];
- $parsedContent['$id'] = $content['$id'] ?? '';
- $parsedContent['registration'] = $content['registration'] ?? '';
- $parsedContent['name'] = $content['name'] ?? '';
- $parsedContent['email'] = $content['email'] ?? '';
-
+ private function parseUser(array $content)
+ {
foreach (Config::getParam('providers') as $key => $provider) {
if (!$provider['enabled']) {
continue;
}
-
- $parsedContent['oauth2'.ucfirst($key)] = '';
- $parsedContent['oauth2'.ucfirst($key).'AccessToken'] = '';
+ $content['oauth2'.ucfirst($key)] = '';
+ $content['oauth2'.ucfirst($key).'AccessToken'] = '';
}
- $parsedContent['roles'] = Authorization::getRoles() ?? [];
- return $parsedContent;
+ $content['roles'] = Authorization::getRoles() ?? [];
+ return $content;
}
}
\ No newline at end of file
From bed4dcddef8d3df8c4979a8d0947ee54c426f657 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sun, 27 Dec 2020 22:01:18 +0530
Subject: [PATCH 009/230] feat: parse session object
---
src/Appwrite/Utopia/Response/Filters/V06.php | 32 ++++++++++----------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 019b523d9b..212e83c3f8 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -8,6 +8,7 @@ use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Filter;
use Exception;
use Utopia\Config\Config;
+use Utopia\Locale\Locale as Locale;
class V06 extends Filter {
@@ -50,24 +51,23 @@ class V06 extends Filter {
// Handle list of sessions
if (isset($content['sum'])) {
$sessions = $content['sessions'];
-
$parsedResponse = [];
+ $index = 0;
foreach($sessions as $session) {
-
- // WIP
- // $parsedResponse['$id'] = $token->getId();
- // $parsedResponse['OS'] = $dd->getOs();
- // $parsedResponse['client'] = $dd->getClient();
- // $parsedResponse['device'] = $dd->getDevice();
- // $parsedResponse['brand'] = $dd->getBrand();
- // $parsedResponse['model'] = $dd->getModel();
- // $parsedResponse['ip'] = $token->getAttribute('ip', '');
- // $parsedResponse['geo'] = [];
- // $parsedResponse['current'] = ($current == $token->getId()) ? true : false;
- // $parsedResponse[$index]['geo']['isoCode'] = '--';
- // $parsedResponse[$index]['geo']['country'] = Locale::getText('locale.country.unknown');
-
- $parsedResponse[] = $session;
+ $parsedResponse[$index++] = [
+ '$id' => $session['$id'],
+ 'OS' => $session['osName'].' '.$session['osVersion'],
+ 'client' => $session['clientName'].' '.$session['clientVersion'],
+ 'device' => $session['deviceName'],
+ 'brand' => $session['deviceBrand'],
+ 'model' => $session['deviceModel'],
+ 'ip' => $session['ip'],
+ 'current' => $session['current'],
+ 'geo' => [
+ 'isoCode' => empty($session['countryCode']) ? '---' : $session['countryCode'] ,
+ 'country' => empty($session['countryName'] ) ? Locale::getText('locale.country.unknown') : $session['countryName']
+ ],
+ ];
}
return $parsedResponse;
} else {
From 9690ce879404ecf60a3eeb2b098a7da64f3ef522 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sun, 27 Dec 2020 23:47:26 +0530
Subject: [PATCH 010/230] feat: parse log list
---
src/Appwrite/Utopia/Response/Filters/V06.php | 85 +++++++++++++-------
1 file changed, 58 insertions(+), 27 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 212e83c3f8..638e49948d 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -29,6 +29,14 @@ class V06 extends Filter {
case Response::MODEL_SESSION :
$parsedResponse = $this->parseSession($content);
break;
+
+ case Response::MODEL_SESSION_LIST :
+ $parsedResponse = $this->parseSessionList($content);
+ break;
+
+ case Response::MODEL_LOG_LIST :
+ $parsedResponse = $this->parseLogList($content);
+ break;
case Response::MODEL_ANY :
$parsedResponse = $content;
@@ -46,35 +54,58 @@ class V06 extends Filter {
}
- private function parseSession(array $content)
+ private function parseLogList(array $content)
{
- // Handle list of sessions
- if (isset($content['sum'])) {
- $sessions = $content['sessions'];
- $parsedResponse = [];
- $index = 0;
- foreach($sessions as $session) {
- $parsedResponse[$index++] = [
- '$id' => $session['$id'],
- 'OS' => $session['osName'].' '.$session['osVersion'],
- 'client' => $session['clientName'].' '.$session['clientVersion'],
- 'device' => $session['deviceName'],
- 'brand' => $session['deviceBrand'],
- 'model' => $session['deviceModel'],
- 'ip' => $session['ip'],
- 'current' => $session['current'],
- 'geo' => [
- 'isoCode' => empty($session['countryCode']) ? '---' : $session['countryCode'] ,
- 'country' => empty($session['countryName'] ) ? Locale::getText('locale.country.unknown') : $session['countryName']
- ],
- ];
- }
- return $parsedResponse;
- } else {
- // Handle single session
- $content['type'] = Auth::TOKEN_TYPE_LOGIN;
- return $content;
+ $logs = $content['logs'];
+ $parsedResponse = [];
+ $index = 0;
+ foreach($logs as $log) {
+ $parsedResponse[$index++] = [
+ 'event' => $log['event'],
+ 'ip' => $log['ip'],
+ 'time' => strtotime($log['time']),
+ 'OS' => $log['osName'].' '.$log['osVersion'],
+ 'client' => $log['clientName'].' '.$log['clientVersion'],
+ 'device' => $log['deviceName'],
+ 'brand' => $log['deviceBrand'],
+ 'model' => $log['deviceModel'],
+ 'geo' => [
+ 'isoCode' => empty($log['countryCode']) ? '---' : $log['countryCode'] ,
+ 'country' => empty($log['countryName'] ) ? Locale::getText('locale.country.unknown') : $log['countryName']
+ ]
+ ];
}
+ return $parsedResponse;
+ }
+
+ private function parseSessionList(array $content)
+ {
+ $sessions = $content['sessions'];
+ $parsedResponse = [];
+ $index = 0;
+ foreach($sessions as $session) {
+ $parsedResponse[$index++] = [
+ '$id' => $session['$id'],
+ 'OS' => $session['osName'].' '.$session['osVersion'],
+ 'client' => $session['clientName'].' '.$session['clientVersion'],
+ 'device' => $session['deviceName'],
+ 'brand' => $session['deviceBrand'],
+ 'model' => $session['deviceModel'],
+ 'ip' => $session['ip'],
+ 'current' => $session['current'],
+ 'geo' => [
+ 'isoCode' => empty($session['countryCode']) ? '---' : $session['countryCode'] ,
+ 'country' => empty($session['countryName'] ) ? Locale::getText('locale.country.unknown') : $session['countryName']
+ ],
+ ];
+ }
+ return $parsedResponse;
+ }
+
+ private function parseSession(array $content)
+ {
+ $content['type'] = Auth::TOKEN_TYPE_LOGIN;
+ return $content;
}
private function parseUser(array $content)
From fde5183594b46214e71a832545234878d2c6784b Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sun, 27 Dec 2020 23:52:05 +0530
Subject: [PATCH 011/230] feat: parse token
---
src/Appwrite/Utopia/Response/Filters/V06.php | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 638e49948d..c1b138abe1 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -38,6 +38,9 @@ class V06 extends Filter {
$parsedResponse = $this->parseLogList($content);
break;
+ case Response::MODEL_TOKEN:
+ $parsedResponse = $this->parseToken($content);
+ break;
case Response::MODEL_ANY :
$parsedResponse = $content;
break;
@@ -54,6 +57,12 @@ class V06 extends Filter {
}
+ private function parseToken(array $content)
+ {
+ $content['type'] = Auth::TOKEN_TYPE_RECOVERY;
+ return $content;
+ }
+
private function parseLogList(array $content)
{
$logs = $content['logs'];
From 9177d659a1ff631a1d0f5106eac0c9f3f4f37a4b Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Mon, 28 Dec 2020 00:32:15 +0530
Subject: [PATCH 012/230] feat: parse locale
---
src/Appwrite/Utopia/Response/Filters/V06.php | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index c1b138abe1..f83007d9d0 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -41,12 +41,18 @@ class V06 extends Filter {
case Response::MODEL_TOKEN:
$parsedResponse = $this->parseToken($content);
break;
+
+ case Response::MODEL_LOCALE:
+ $parsedResponse = $this->parseLocale($content);
+ break;
+
+
case Response::MODEL_ANY :
$parsedResponse = $content;
break;
default:
- throw new Exception('Recevied invlaid model : '.$model);
+ throw new Exception('Recevied invalid model : '.$model);
}
return $parsedResponse;
@@ -57,6 +63,18 @@ class V06 extends Filter {
}
+ private function parseLocale(array $content)
+ {
+ $content['ip'] = empty($content['ip']) ? '' : $content['ip'];
+ $content['countryCode'] = empty($content['countryCode']) ? '--' : $content['countryCode'];
+ $content['country'] = empty($content['country']) ? Locale::getText('locale.country.unknown') : $content['country'];
+ $content['continent'] = empty($content['continent']) ? Locale::getText('locale.country.unknown') : $content['continent'];
+ $content['continentCode'] = empty($content['continentCode']) ? '--' : $content['continentCode'];
+ $content['eu'] = empty($content['eu']) ? false : $content['eu'];
+ $content['currency'] = empty($content['currency']) ? null : $content['currency'];
+ return $content;
+ }
+
private function parseToken(array $content)
{
$content['type'] = Auth::TOKEN_TYPE_RECOVERY;
From b57a2de8ee28327baf47807b029822a3b866543a Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Mon, 28 Dec 2020 12:34:33 +0530
Subject: [PATCH 013/230] feat: parse country list
---
src/Appwrite/Utopia/Response/Filters/V06.php | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index f83007d9d0..c1641089f5 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -46,6 +46,9 @@ class V06 extends Filter {
$parsedResponse = $this->parseLocale($content);
break;
+ case Response::MODEL_COUNTRY_LIST:
+ $parsedResponse = $this->parseCountryList($content);
+ break;
case Response::MODEL_ANY :
$parsedResponse = $content;
@@ -63,6 +66,17 @@ class V06 extends Filter {
}
+ private function parseCountryList(array $content)
+ {
+ $countries = $content['country'];
+ $parsedResponse = [];
+ foreach($countries as $country) {
+ $parsedResponse['code'] = $country['name'];
+ }
+
+ return $parsedResponse;
+ }
+
private function parseLocale(array $content)
{
$content['ip'] = empty($content['ip']) ? '' : $content['ip'];
From d0296db6e5133bc62656090cc1ee495cf1e7305f Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Mon, 28 Dec 2020 12:41:30 +0530
Subject: [PATCH 014/230] feat: parse phone list
---
src/Appwrite/Utopia/Response/Filters/V06.php | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index c1641089f5..8339c8d4a6 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -50,6 +50,10 @@ class V06 extends Filter {
$parsedResponse = $this->parseCountryList($content);
break;
+ case Response::MODEL_PHONE_LIST:
+ $parsedResponse = $this->parsePhoneList($content);
+ break;
+
case Response::MODEL_ANY :
$parsedResponse = $content;
break;
@@ -66,14 +70,25 @@ class V06 extends Filter {
}
+ private function parsePhoneList(array $content)
+ {
+ $phones = $content['phones'];
+ $parsedResponse = [];
+ foreach($phones as $phone) {
+ $parsedResponse['countryCode'] = $phone['code'];
+ }
+
+ return $parsedResponse;
+ }
+
private function parseCountryList(array $content)
{
- $countries = $content['country'];
+ $countries = $content['countries'];
$parsedResponse = [];
foreach($countries as $country) {
$parsedResponse['code'] = $country['name'];
}
-
+
return $parsedResponse;
}
From d5c7445c8868d6aa10702930775c6f218dd2b0f0 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Mon, 28 Dec 2020 13:42:15 +0530
Subject: [PATCH 015/230] feat: parse continentlist
---
src/Appwrite/Utopia/Response/Filters/V06.php | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 8339c8d4a6..7abfc9dc54 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -54,6 +54,10 @@ class V06 extends Filter {
$parsedResponse = $this->parsePhoneList($content);
break;
+ case Response::MODEL_CONTINENT_LIST:
+ $parsedResponse = $this->parseContinentList($content);
+ break;
+
case Response::MODEL_ANY :
$parsedResponse = $content;
break;
@@ -70,6 +74,17 @@ class V06 extends Filter {
}
+ private function parseContinentList(array $content)
+ {
+ $continents = $content['continents'];
+ $parsedResponse = [];
+ foreach($continents as $continent) {
+ $parsedResponse['code'] = $continent['name'];
+ }
+
+ return $parsedResponse;
+ }
+
private function parsePhoneList(array $content)
{
$phones = $content['phones'];
From 811fbd96bbc4d6bf44dea87d5b8f3be9c41aaf23 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Mon, 28 Dec 2020 13:51:58 +0530
Subject: [PATCH 016/230] feat: parse currency list
---
src/Appwrite/Utopia/Response/Filters/V06.php | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 7abfc9dc54..1c11393008 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -58,6 +58,10 @@ class V06 extends Filter {
$parsedResponse = $this->parseContinentList($content);
break;
+ case Response::MODEL_CURRENCY_LIST:
+ $parsedResponse = $this->parseCurrencyList($content);
+ break;
+
case Response::MODEL_ANY :
$parsedResponse = $content;
break;
@@ -74,6 +78,12 @@ class V06 extends Filter {
}
+ private function parseCurrencyList(array $content)
+ {
+ $content['locations'] = [];
+ return $content;
+ }
+
private function parseContinentList(array $content)
{
$continents = $content['continents'];
From af774acf92d03b771fa84f116c93a486faa6d41e Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Mon, 28 Dec 2020 15:03:38 +0530
Subject: [PATCH 017/230] feat: parse users list
---
src/Appwrite/Utopia/Response/Filters/V06.php | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 1c11393008..e2c89c9e8a 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -26,6 +26,10 @@ class V06 extends Filter {
$parsedResponse = $this->parseUser($content);
break;
+ case Response::MODEL_USER_LIST:
+ $parsedResponse = $this->parseUserList($content);
+ break;
+
case Response::MODEL_SESSION :
$parsedResponse = $this->parseSession($content);
break;
@@ -189,6 +193,16 @@ class V06 extends Filter {
return $content;
}
+ private function parseUserList(array $content)
+ {
+ $users = $content['users'];
+ $parsedResponse = [];
+ foreach($users as $user) {
+ $parsedResponse[] = $this->parseUser($user);
+ }
+ return $parsedResponse;
+ }
+
private function parseUser(array $content)
{
foreach (Config::getParam('providers') as $key => $provider) {
From f6c140d84a126e425697548d50acbce1638862ce Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Mon, 28 Dec 2020 15:12:54 +0530
Subject: [PATCH 018/230] feat: add status field to users response
---
src/Appwrite/Utopia/Response/Filters/V06.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index e2c89c9e8a..77e0bd2582 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -212,7 +212,7 @@ class V06 extends Filter {
$content['oauth2'.ucfirst($key)] = '';
$content['oauth2'.ucfirst($key).'AccessToken'] = '';
}
-
+ $content['status'] = empty($content['status']) ? 0 : $content['status'];
$content['roles'] = Authorization::getRoles() ?? [];
return $content;
}
From ef0f886ce6b1f05c2f8a17b1a335bdac6f49d640 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Mon, 28 Dec 2020 15:21:45 +0530
Subject: [PATCH 019/230] feat: added todos for some /users endpoints
---
app/controllers/api/users.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php
index 3b1b8bcef5..dd49e52f88 100644
--- a/app/controllers/api/users.php
+++ b/app/controllers/api/users.php
@@ -425,6 +425,7 @@ App::delete('/v1/users/:userId/sessions/:sessionId')
}
}
+ // TODO : Response filter implementation
$response->noContent();
}, ['response', 'projectDB', 'events']);
@@ -465,6 +466,7 @@ App::delete('/v1/users/:userId/sessions')
->setParam('payload', $response->output($user, Response::MODEL_USER))
;
+ // TODO : Response filter implementation
$response->noContent();
}, ['response', 'projectDB', 'events']);
@@ -521,5 +523,6 @@ App::delete('/v1/users/:userId')
->setParam('payload', $response->output($user, Response::MODEL_USER))
;
+ // TODO : Response filter implementation
$response->noContent();
}, ['response', 'projectDB', 'events', 'deletes']);
From 018a1e8bf54c619068b1f4845a22f144166711ca Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Mon, 28 Dec 2020 16:34:08 +0530
Subject: [PATCH 020/230] feat: parse membership
---
src/Appwrite/Utopia/Response/Filters/V06.php | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 77e0bd2582..1396fb6c2a 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -18,9 +18,6 @@ class V06 extends Filter {
$parsedResponse = array();
switch($model) {
- case Response::MODEL_PROJECT :
- $parsedResponse = $this->parseProject($content);
- break;
case Response::MODEL_USER :
$parsedResponse = $this->parseUser($content);
@@ -29,6 +26,18 @@ class V06 extends Filter {
case Response::MODEL_USER_LIST:
$parsedResponse = $this->parseUserList($content);
break;
+
+ case Response::MODEL_TEAM:
+ $parsedResponse = $content;
+ break;
+
+ case Response::MODEL_TEAM_LIST:
+ $parsedResponse = $content['teams'];
+ break;
+
+ case Response::MODEL_MEMBERSHIP:
+ $parsedResponse = $content;
+ break;
case Response::MODEL_SESSION :
$parsedResponse = $this->parseSession($content);
@@ -77,11 +86,6 @@ class V06 extends Filter {
return $parsedResponse;
}
- private function parseProject(array $content)
- {
-
- }
-
private function parseCurrencyList(array $content)
{
$content['locations'] = [];
From 8c4f3f7f9d092a2c4c78560c18b266ed2b843d72 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 28 Dec 2020 18:41:03 +0200
Subject: [PATCH 021/230] New JWT model
---
src/Appwrite/Utopia/Response/Model/JWT.php | 45 ++++++++++++++++++++++
1 file changed, 45 insertions(+)
create mode 100644 src/Appwrite/Utopia/Response/Model/JWT.php
diff --git a/src/Appwrite/Utopia/Response/Model/JWT.php b/src/Appwrite/Utopia/Response/Model/JWT.php
new file mode 100644
index 0000000000..490506ff94
--- /dev/null
+++ b/src/Appwrite/Utopia/Response/Model/JWT.php
@@ -0,0 +1,45 @@
+addRule('$id', [
+ 'type' => self::TYPE_STRING,
+ 'description' => 'User ID.',
+ 'example' => '5e5ea5c16897e',
+ ])
+ ->addRule('name', [
+ 'type' => self::TYPE_STRING,
+ 'description' => 'User name.',
+ 'example' => 'John Doe',
+ ])
+ ;
+ }
+
+ /**
+ * Get Name
+ *
+ * @return string
+ */
+ public function getName():string
+ {
+ return 'JWT';
+ }
+
+ /**
+ * Get Collection
+ *
+ * @return string
+ */
+ public function getType():string
+ {
+ return Response::MODEL_JWT;
+ }
+}
\ No newline at end of file
From 98a7f6a1050bdb37473722b478e2300d5fd0b28a Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 28 Dec 2020 18:41:32 +0200
Subject: [PATCH 022/230] Added JWT library
---
composer.json | 3 +-
composer.lock | 88 +++++++++++++++++++++++++++++++--------------------
2 files changed, 55 insertions(+), 36 deletions(-)
diff --git a/composer.json b/composer.json
index afefca980b..fa5b69af0a 100644
--- a/composer.json
+++ b/composer.json
@@ -52,7 +52,8 @@
"domnikl/statsd": "3.0.2",
"influxdb/influxdb-php": "1.15.1",
"phpmailer/phpmailer": "6.1.7",
- "chillerlan/php-qrcode": "4.2.0"
+ "chillerlan/php-qrcode": "4.2.0",
+ "adhocore/jwt": "1.1.0"
},
"require-dev": {
"swoole/ide-helper": "4.5.5",
diff --git a/composer.lock b/composer.lock
index 73123ca30d..671c357e53 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "aa1bf812ee6a45af12cdfbbfb7229471",
+ "content-hash": "518aa516713cbed3cad684907d50aea1",
"packages": [
{
"name": "adhocore/jwt",
@@ -51,6 +51,10 @@
"jwt-php",
"token"
],
+ "support": {
+ "issues": "https://github.com/adhocore/php-jwt/issues",
+ "source": "https://github.com/adhocore/php-jwt/tree/1.1.0"
+ },
"funding": [
{
"url": "https://paypal.me/ji10",
@@ -1953,12 +1957,12 @@
"source": {
"type": "git",
"url": "https://github.com/composer/package-versions-deprecated.git",
- "reference": "64291c788b9a18272346decf566931e33a317399"
+ "reference": "f921205948ab93bb19f86327c793a81edb62f236"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/64291c788b9a18272346decf566931e33a317399",
- "reference": "64291c788b9a18272346decf566931e33a317399",
+ "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/f921205948ab93bb19f86327c793a81edb62f236",
+ "reference": "f921205948ab93bb19f86327c793a81edb62f236",
"shasum": ""
},
"require": {
@@ -2019,7 +2023,7 @@
"type": "tidelift"
}
],
- "time": "2020-11-12T09:39:33+00:00"
+ "time": "2020-12-27T20:11:05+00:00"
},
{
"name": "composer/semver",
@@ -2376,16 +2380,16 @@
},
{
"name": "matthiasmullie/minify",
- "version": "1.3.64",
+ "version": "1.3.65",
"source": {
"type": "git",
"url": "https://github.com/matthiasmullie/minify.git",
- "reference": "38f9d58c739687e269f46c6dff4647de9e2eb855"
+ "reference": "227f19062451c55a797e0cc667ef983834e6580c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/38f9d58c739687e269f46c6dff4647de9e2eb855",
- "reference": "38f9d58c739687e269f46c6dff4647de9e2eb855",
+ "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/227f19062451c55a797e0cc667ef983834e6580c",
+ "reference": "227f19062451c55a797e0cc667ef983834e6580c",
"shasum": ""
},
"require": {
@@ -2434,9 +2438,23 @@
],
"support": {
"issues": "https://github.com/matthiasmullie/minify/issues",
- "source": "https://github.com/matthiasmullie/minify/tree/1.3.64"
+ "source": "https://github.com/matthiasmullie/minify/tree/1.3.65"
},
- "time": "2020-12-23T13:37:53+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/[user1",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/matthiasmullie] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g.",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/user2",
+ "type": "github"
+ }
+ ],
+ "time": "2020-12-27T21:43:29+00:00"
},
{
"name": "matthiasmullie/path-converter",
@@ -4552,12 +4570,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "15c96194f32e1b1aa30d1b302c71c5f83fd4dea9"
+ "reference": "c249efc71000d42c86d9a7558b55f409f06d93da"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/15c96194f32e1b1aa30d1b302c71c5f83fd4dea9",
- "reference": "15c96194f32e1b1aa30d1b302c71c5f83fd4dea9",
+ "url": "https://api.github.com/repos/symfony/console/zipball/c249efc71000d42c86d9a7558b55f409f06d93da",
+ "reference": "c249efc71000d42c86d9a7558b55f409f06d93da",
"shasum": ""
},
"require": {
@@ -4642,7 +4660,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-18T08:03:24+00:00"
+ "time": "2020-12-27T13:21:48+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -4650,12 +4668,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "fade6deebd931cfd7a544f68479405a6a08979a3"
+ "reference": "7130f348df2f842044038aaae9d6653dc9d67649"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fade6deebd931cfd7a544f68479405a6a08979a3",
- "reference": "fade6deebd931cfd7a544f68479405a6a08979a3",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7130f348df2f842044038aaae9d6653dc9d67649",
+ "reference": "7130f348df2f842044038aaae9d6653dc9d67649",
"shasum": ""
},
"require": {
@@ -4722,7 +4740,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2020-12-27T09:28:48+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
@@ -4730,12 +4748,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
- "reference": "be092746c3ab9f9c62608c82e0f04687f8a879f9"
+ "reference": "e314d4992832c3a0a68ca731fadd959917320fda"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/be092746c3ab9f9c62608c82e0f04687f8a879f9",
- "reference": "be092746c3ab9f9c62608c82e0f04687f8a879f9",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/e314d4992832c3a0a68ca731fadd959917320fda",
+ "reference": "e314d4992832c3a0a68ca731fadd959917320fda",
"shasum": ""
},
"require": {
@@ -4804,7 +4822,7 @@
"type": "tidelift"
}
],
- "time": "2020-11-13T15:40:22+00:00"
+ "time": "2020-12-27T09:28:48+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
@@ -4812,12 +4830,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
- "reference": "69609f9f06790591b4b13a45ee117e7bab6395aa"
+ "reference": "3a79a2226897adae0cab81688fbc5144e2fc53f6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/69609f9f06790591b4b13a45ee117e7bab6395aa",
- "reference": "69609f9f06790591b4b13a45ee117e7bab6395aa",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3a79a2226897adae0cab81688fbc5144e2fc53f6",
+ "reference": "3a79a2226897adae0cab81688fbc5144e2fc53f6",
"shasum": ""
},
"require": {
@@ -4889,7 +4907,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2020-12-27T22:11:44+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -4897,12 +4915,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "401c9d9d3400c53a8f1a39425f0543406c137a43"
+ "reference": "de14691dc88bbbc5535de7f0e32080977dc1d23f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/401c9d9d3400c53a8f1a39425f0543406c137a43",
- "reference": "401c9d9d3400c53a8f1a39425f0543406c137a43",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/de14691dc88bbbc5535de7f0e32080977dc1d23f",
+ "reference": "de14691dc88bbbc5535de7f0e32080977dc1d23f",
"shasum": ""
},
"require": {
@@ -4970,7 +4988,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2020-12-27T09:28:48+00:00"
},
{
"name": "symfony/polyfill-php73",
@@ -5058,12 +5076,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "3a11f3dfb34ad50f978cb2b8cf936933b87739aa"
+ "reference": "54cc82c30ba7ed02bc64f5d010488c159b5f1706"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/3a11f3dfb34ad50f978cb2b8cf936933b87739aa",
- "reference": "3a11f3dfb34ad50f978cb2b8cf936933b87739aa",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/54cc82c30ba7ed02bc64f5d010488c159b5f1706",
+ "reference": "54cc82c30ba7ed02bc64f5d010488c159b5f1706",
"shasum": ""
},
"require": {
@@ -5134,7 +5152,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2020-12-27T09:28:48+00:00"
},
{
"name": "symfony/service-contracts",
From 3caea2a62ca81284c90ef9b920d97dfde431e8f3 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 28 Dec 2020 18:41:38 +0200
Subject: [PATCH 023/230] New JWT model
---
src/Appwrite/Utopia/Response.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php
index a854416c3f..0db6990c88 100644
--- a/src/Appwrite/Utopia/Response.php
+++ b/src/Appwrite/Utopia/Response.php
@@ -20,6 +20,7 @@ use Appwrite\Utopia\Response\Model\ErrorDev;
use Appwrite\Utopia\Response\Model\Execution;
use Appwrite\Utopia\Response\Model\File;
use Appwrite\Utopia\Response\Model\Func;
+use Appwrite\Utopia\Response\Model\JWT;
use Appwrite\Utopia\Response\Model\Key;
use Appwrite\Utopia\Response\Model\Language;
use Appwrite\Utopia\Response\Model\User;
@@ -64,7 +65,8 @@ class Response extends SwooleResponse
const MODEL_USER_LIST = 'userList';
const MODEL_SESSION = 'session';
const MODEL_SESSION_LIST = 'sessionList';
- const MODEL_TOKEN = 'token'; // - Missing
+ const MODEL_TOKEN = 'token';
+ const MODEL_JWT = 'jwt';
// Storage
const MODEL_FILE = 'file';
@@ -161,6 +163,7 @@ class Response extends SwooleResponse
->setModel(new User())
->setModel(new Session())
->setModel(new Token())
+ ->setModel(new JWT())
->setModel(new Locale())
->setModel(new File())
->setModel(new Team())
From f1887d2d9b42cadfd5b73f7ef2e866e9deb9d295 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Mon, 28 Dec 2020 22:12:13 +0530
Subject: [PATCH 024/230] feat: parse membership list
---
src/Appwrite/Utopia/Response/Filters/V06.php | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 1396fb6c2a..79f1ef92fc 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -38,6 +38,10 @@ class V06 extends Filter {
case Response::MODEL_MEMBERSHIP:
$parsedResponse = $content;
break;
+
+ case Response::MODEL_MEMBERSHIP_LIST:
+ $parsedResponse = $content['memberships'];
+ break;
case Response::MODEL_SESSION :
$parsedResponse = $this->parseSession($content);
From f6d30fa1fb793b91ebfc1b40a33d619a884b5b4c Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 28 Dec 2020 19:03:27 +0200
Subject: [PATCH 025/230] Added a new JWT endpoint
---
app/controllers/api/account.php | 44 ++++++++++++++++++++++-----------
1 file changed, 29 insertions(+), 15 deletions(-)
diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php
index 93ba7b397b..2b36908ed9 100644
--- a/app/controllers/api/account.php
+++ b/app/controllers/api/account.php
@@ -648,24 +648,38 @@ App::get('/v1/account/jwt')
->label('sdk.description', '/docs/references/account/create-jwt.md')
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},userId:{param-userId}')
- ->action(function ($request, $response, $projectDB) {
- /** @var Appwrite\Swoole\Request $request */
+ ->inject('response')
+ ->inject('user')
+ ->action(function ($response, $user) {
/** @var Appwrite\Utopia\Response $response */
- /** @var Appwrite\Database\Database $projectDB */
-
- // Instantiate with key, algo, maxAge and leeway.
- $jwt = new JWT('secret', 'HS256', 3600, 10);
+ /** @var Appwrite\Database\Document $user */
+
+ $tokens = $user->getAttribute('tokens', []);
+ $session = new Document();
- $response->setStatusCode(Response::STATUS_CODE_CREATED);
+ foreach ($tokens as $token) { /** @var Appwrite\Database\Document $token */
+ if ($token->getAttribute('secret') == Auth::hash(Auth::$secret)) { // If current session delete the cookies too
+ $session = $token;
+ }
+ }
+
+ if($session->isEmpty()) {
+ throw new Exception('No valid session found', 401);
+ }
- // $response->dynamic(new Document(['jwt' => $jwt]), Response::MODEL_SESSION);
- $response->json(['jwt' => $jwt->encode([
- 'uid' => 1,
- 'aud' => 'http://site.com',
- 'scopes' => ['user'],
- 'iss' => 'http://api.mysite.com',
- ])]);
- }, ['request', 'response', 'projectDB', 'webhooks', 'audits']);
+ $jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 3600, 10); // Instantiate with key, algo, maxAge and leeway.
+
+ $response
+ ->setStatusCode(Response::STATUS_CODE_CREATED)
+ ->dynamic(new Document(['jwt' => $jwt->encode([
+ // 'uid' => 1,
+ // 'aud' => 'http://site.com',
+ // 'scopes' => ['user'],
+ // 'iss' => 'http://api.mysite.com',
+ 'userId' => $user->getId(),
+ 'sessionId' => $session->getId(),
+ ])]), Response::MODEL_JWT);
+ });
App::get('/v1/account')
->desc('Get Account')
From 40d735881c8f134fa22a7fa675dc635e1dbda9b1 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 28 Dec 2020 19:03:47 +0200
Subject: [PATCH 026/230] JWT auth - work in progress
---
app/controllers/general.php | 48 +++++++++++++++++++++----------------
1 file changed, 28 insertions(+), 20 deletions(-)
diff --git a/app/controllers/general.php b/app/controllers/general.php
index ce1d6cfbe2..31e39712f7 100644
--- a/app/controllers/general.php
+++ b/app/controllers/general.php
@@ -2,6 +2,7 @@
require_once __DIR__.'/../init.php';
+use Ahc\Jwt\JWT;
use Utopia\App;
use Utopia\Swoole\Request;
use Appwrite\Utopia\Response;
@@ -34,7 +35,6 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
/** @var Appwrite\Event\Event $usage */
/** @var Appwrite\Event\Event $deletes */
/** @var Appwrite\Event\Event $functions */
-
/** @var bool $mode */
/** @var array $clients */
@@ -111,7 +111,6 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
$response
->addHeader('Server', 'Appwrite')
->addHeader('X-XSS-Protection', '1; mode=block; report=/v1/xss?url='.\urlencode($request->getURI()))
- //->addHeader('X-Frame-Options', ($refDomain == 'http://localhost') ? 'SAMEORIGIN' : 'ALLOW-FROM ' . $refDomain)
->addHeader('X-Content-Type-Options', 'nosniff')
->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE')
->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-SDK-Version, Cache-Control, Expires, Pragma')
@@ -162,29 +161,38 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
$roles = Config::getParam('roles', []);
$scope = $route->getLabel('scope', 'none'); // Allowed scope for chosen route
$scopes = $roles[$role]['scopes']; // Allowed scopes for user role
+ $authKey = $request->getHeader('x-appwrite-key', '');
+ $authJWT = $request->getHeader('x-appwrite-jwt', '');
- // Check if given key match project API keys
- $key = $project->search('secret', $request->getHeader('x-appwrite-key', ''), $project->getAttribute('keys', []));
-
- /*
- * Try app auth when we have project key and no user
- * Mock user to app and grant API key scopes in addition to default app scopes
- */
- if (null !== $key && $user->isEmpty()) {
- $user = new Document([
- '$id' => '',
- 'status' => Auth::USER_STATUS_ACTIVATED,
- 'email' => 'app.'.$project->getId().'@service.'.$request->getHostname(),
- 'password' => '',
- 'name' => $project->getAttribute('name', 'Untitled'),
- ]);
+ if (!empty($authKey)) { // API Key authentication
+ // Check if given key match project API keys
+ $key = $project->search('secret', $authKey, $project->getAttribute('keys', []));
+
+ /*
+ * Try app auth when we have project key and no user
+ * Mock user to app and grant API key scopes in addition to default app scopes
+ */
+ if (null !== $key && $user->isEmpty()) {
+ $user = new Document([
+ '$id' => '',
+ 'status' => Auth::USER_STATUS_ACTIVATED,
+ 'email' => 'app.'.$project->getId().'@service.'.$request->getHostname(),
+ 'password' => '',
+ 'name' => $project->getAttribute('name', 'Untitled'),
+ ]);
- $role = Auth::USER_ROLE_APP;
- $scopes = \array_merge($roles[$role]['scopes'], $key->getAttribute('scopes', []));
+ $role = Auth::USER_ROLE_APP;
+ $scopes = \array_merge($roles[$role]['scopes'], $key->getAttribute('scopes', []));
- Authorization::setDefaultStatus(false); // Cancel security segmentation for API keys.
+ Authorization::setDefaultStatus(false); // Cancel security segmentation for API keys.
+ }
}
+ if (!empty($authJWT)) { // JWT authentication
+ $jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 3600, 10); // Instantiate with key, algo, maxAge and leeway.
+ $payload = $jwt->decode($authJWT);
+ }
+
if ($user->getId()) {
Authorization::setRole('user:'.$user->getId());
}
From 54f40c8ce2d0fd1764e3a55c917fda53b211811f Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Tue, 29 Dec 2020 01:01:26 +0530
Subject: [PATCH 027/230] feat: parse file
---
src/Appwrite/Utopia/Response/Filters/V06.php | 22 ++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 79f1ef92fc..9d8d00a94b 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -3,7 +3,9 @@
namespace Appwrite\Utopia\Response\Filter;
use Appwrite\Auth\Auth;
+use Appwrite\Database\Database;
use Appwrite\Database\Validator\Authorization;
+use Appwrite\OpenSSL\OpenSSL;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Filter;
use Exception;
@@ -19,6 +21,10 @@ class V06 extends Filter {
switch($model) {
+ case Response::MODEL_FILE :
+ $parsedResponse = $this->parseFile($content);
+ break;
+
case Response::MODEL_USER :
$parsedResponse = $this->parseUser($content);
break;
@@ -90,6 +96,22 @@ class V06 extends Filter {
return $parsedResponse;
}
+ private function parseFile(array $content)
+ {
+ $content['$collection'] = Database::SYSTEM_COLLECTION_FILES;
+ $content['algorithm'] = 'gzip';
+ $content['comment'] = '';
+ $content['fileOpenSSLCipher'] = OpenSSL::CIPHER_AES_128_GCM;
+ $content['fileOpenSSLIV'] = '';
+ $content['fileOpenSSLTag'] = '';
+ $content['fileOpenSSLVersion'] = '';
+ $content['folderId'] = '';
+ $content['path'] = '';
+ $content['sizeActual'] = $content['sizeOriginal'];
+ $content['token'] = '';
+ return $content;
+ }
+
private function parseCurrencyList(array $content)
{
$content['locations'] = [];
From 450c3e6f88fc9acc2786900b2ab42e61dbd76cbb Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Tue, 29 Dec 2020 01:09:22 +0530
Subject: [PATCH 028/230] feat: parse file list
---
src/Appwrite/Utopia/Response/Filters/V06.php | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 9d8d00a94b..4627157fcc 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -25,6 +25,10 @@ class V06 extends Filter {
$parsedResponse = $this->parseFile($content);
break;
+ case Response::MODEL_FILE_LIST :
+ $parsedResponse = $content;
+ break;
+
case Response::MODEL_USER :
$parsedResponse = $this->parseUser($content);
break;
From 002361c3b8db617247fef15cbf960649733f3154 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 28 Dec 2020 22:18:07 +0200
Subject: [PATCH 029/230] Updated model structure
---
src/Appwrite/Utopia/Response/Model/JWT.php | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Model/JWT.php b/src/Appwrite/Utopia/Response/Model/JWT.php
index 490506ff94..67aa0f4d36 100644
--- a/src/Appwrite/Utopia/Response/Model/JWT.php
+++ b/src/Appwrite/Utopia/Response/Model/JWT.php
@@ -10,15 +10,10 @@ class JWT extends Model
public function __construct()
{
$this
- ->addRule('$id', [
+ ->addRule('jwt', [
'type' => self::TYPE_STRING,
- 'description' => 'User ID.',
- 'example' => '5e5ea5c16897e',
- ])
- ->addRule('name', [
- 'type' => self::TYPE_STRING,
- 'description' => 'User name.',
- 'example' => 'John Doe',
+ 'description' => 'JWT encoded string.',
+ 'example' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',
])
;
}
From 5e4619b6e0bdcf58f5db4ae83b1377c009afc6fa Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 28 Dec 2020 22:31:42 +0200
Subject: [PATCH 030/230] Updated auth check
---
app/controllers/general.php | 10 ++--------
app/init.php | 25 +++++++++++++++++++++++++
2 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/app/controllers/general.php b/app/controllers/general.php
index 31e39712f7..5f9301aec1 100644
--- a/app/controllers/general.php
+++ b/app/controllers/general.php
@@ -2,7 +2,6 @@
require_once __DIR__.'/../init.php';
-use Ahc\Jwt\JWT;
use Utopia\App;
use Utopia\Swoole\Request;
use Appwrite\Utopia\Response;
@@ -161,9 +160,9 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
$roles = Config::getParam('roles', []);
$scope = $route->getLabel('scope', 'none'); // Allowed scope for chosen route
$scopes = $roles[$role]['scopes']; // Allowed scopes for user role
+
$authKey = $request->getHeader('x-appwrite-key', '');
- $authJWT = $request->getHeader('x-appwrite-jwt', '');
-
+
if (!empty($authKey)) { // API Key authentication
// Check if given key match project API keys
$key = $project->search('secret', $authKey, $project->getAttribute('keys', []));
@@ -188,11 +187,6 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
}
}
- if (!empty($authJWT)) { // JWT authentication
- $jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 3600, 10); // Instantiate with key, algo, maxAge and leeway.
- $payload = $jwt->decode($authJWT);
- }
-
if ($user->getId()) {
Authorization::setRole('user:'.$user->getId());
}
diff --git a/app/init.php b/app/init.php
index 34ef3a5823..ad50ce17b5 100644
--- a/app/init.php
+++ b/app/init.php
@@ -11,6 +11,8 @@ if (\file_exists(__DIR__.'/../vendor/autoload.php')) {
require_once __DIR__.'/../vendor/autoload.php';
}
+use Ahc\Jwt\JWT;
+use Ahc\Jwt\JWTException;
use Appwrite\Auth\Auth;
use Appwrite\Database\Database;
use Appwrite\Database\Adapter\MySQL as MySQLAdapter;
@@ -400,6 +402,29 @@ App::setResource('user', function($mode, $project, $console, $request, $response
}
}
+ $authJWT = $request->getHeader('x-appwrite-jwt', '');
+
+ if (!empty($authJWT)) { // JWT authentication
+ $jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 3600, 10); // Instantiate with key, algo, maxAge and leeway.
+
+ try {
+ $payload = $jwt->decode($authJWT);
+ } catch (JWTException $error) {
+ throw new Exception('Failed to verify JWT. '.$error->getMessage(), 401);
+ }
+
+ $jwtUserId = $payload['userId'] ?? '';
+ $jwtSessionId = $payload['sessionId'] ?? '';
+
+ if($jwtUserId && $jwtSessionId) {
+ $user = $projectDB->getDocument($jwtUserId);
+ }
+
+ if (empty($user->search('$id', $jwtSessionId, $user->getAttribute('tokens')))) { // Match JWT to active token
+ $user = new Document(['$id' => '', '$collection' => Database::SYSTEM_COLLECTION_USERS]);
+ }
+ }
+
return $user;
}, ['mode', 'project', 'console', 'request', 'response', 'projectDB', 'consoleDB']);
From e4e0c23968cc3c98c89c27723407afcd15e02d85 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 28 Dec 2020 22:31:55 +0200
Subject: [PATCH 031/230] Added tests
---
app/controllers/api/account.php | 2 +-
.../Account/AccountCustomClientTest.php | 98 +++++++++++++++++++
2 files changed, 99 insertions(+), 1 deletion(-)
diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php
index 2b36908ed9..35d41530e1 100644
--- a/app/controllers/api/account.php
+++ b/app/controllers/api/account.php
@@ -638,7 +638,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
;
});
-App::get('/v1/account/jwt')
+App::post('/v1/account/jwt')
->desc('Create Account JWT')
->groups(['api', 'account'])
->label('scope', 'account')
diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php
index 0e17d8fcc9..a111655307 100644
--- a/tests/e2e/Services/Account/AccountCustomClientTest.php
+++ b/tests/e2e/Services/Account/AccountCustomClientTest.php
@@ -128,4 +128,102 @@ class AccountCustomClientTest extends Scope
return [];
}
+
+ public function testCreateJWT():array
+ {
+ $email = uniqid().'user@localhost.test';
+ $password = 'password';
+ $name = 'User Name (JWT)';
+
+ /**
+ * Test for SUCCESS
+ */
+ $response = $this->client->call(Client::METHOD_POST, '/account', array_merge([
+ 'origin' => 'http://localhost',
+ 'content-type' => 'application/json',
+ 'x-appwrite-project' => $this->getProject()['$id'],
+ ]), [
+ 'email' => $email,
+ 'password' => $password,
+ 'name' => $name,
+ ]);
+
+ $id = $response['body']['$id'];
+
+ $this->assertEquals($response['headers']['status-code'], 201);
+
+ $response = $this->client->call(Client::METHOD_POST, '/account/sessions', array_merge([
+ 'origin' => 'http://localhost',
+ 'content-type' => 'application/json',
+ 'x-appwrite-project' => $this->getProject()['$id'],
+ ]), [
+ 'email' => $email,
+ 'password' => $password,
+ ]);
+
+ $this->assertEquals($response['headers']['status-code'], 201);
+
+ $sessionId = $response['body']['$id'];
+ $session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_'.$this->getProject()['$id']];
+
+ $response = $this->client->call(Client::METHOD_GET, '/account', array_merge([
+ 'origin' => 'http://localhost',
+ 'content-type' => 'application/json',
+ 'x-appwrite-project' => $this->getProject()['$id'],
+ 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session,
+ ]));
+
+ $this->assertEquals($response['headers']['status-code'], 200);
+
+ $response = $this->client->call(Client::METHOD_POST, '/account/jwt', array_merge([
+ 'origin' => 'http://localhost',
+ 'content-type' => 'application/json',
+ 'x-appwrite-project' => $this->getProject()['$id'],
+ 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session,
+ ]));
+
+ $this->assertEquals($response['headers']['status-code'], 201);
+ $this->assertNotEmpty($response['body']['jwt']);
+ $this->assertIsString($response['body']['jwt']);
+
+ $jwt = $response['body']['jwt'];
+
+ $response = $this->client->call(Client::METHOD_GET, '/account', array_merge([
+ 'origin' => 'http://localhost',
+ 'content-type' => 'application/json',
+ 'x-appwrite-project' => $this->getProject()['$id'],
+ 'x-appwrite-jwt' => 'wrong-token',
+ ]));
+
+ $this->assertEquals($response['headers']['status-code'], 401);
+
+ $response = $this->client->call(Client::METHOD_GET, '/account', array_merge([
+ 'origin' => 'http://localhost',
+ 'content-type' => 'application/json',
+ 'x-appwrite-project' => $this->getProject()['$id'],
+ 'x-appwrite-jwt' => $jwt,
+ ]));
+
+ $this->assertEquals($response['headers']['status-code'], 200);
+
+ $response = $this->client->call(Client::METHOD_DELETE, '/account/sessions/'.$sessionId, array_merge([
+ 'origin' => 'http://localhost',
+ 'content-type' => 'application/json',
+ 'x-appwrite-project' => $this->getProject()['$id'],
+ 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session,
+ ]));
+
+ $this->assertEquals($response['headers']['status-code'], 204);
+
+ $response = $this->client->call(Client::METHOD_GET, '/account', array_merge([
+ 'origin' => 'http://localhost',
+ 'content-type' => 'application/json',
+ 'x-appwrite-project' => $this->getProject()['$id'],
+ 'x-appwrite-jwt' => $jwt,
+ ]));
+
+ $this->assertEquals($response['headers']['status-code'], 401);
+
+ return [];
+ }
}
\ No newline at end of file
From bb52478bc3d2411c20306ef025694a1b65c914d2 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 28 Dec 2020 23:23:09 +0200
Subject: [PATCH 032/230] Changed JWT expiry to max 15 minutes
---
app/controllers/api/account.php | 2 +-
app/init.php | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php
index 35d41530e1..559024ba33 100644
--- a/app/controllers/api/account.php
+++ b/app/controllers/api/account.php
@@ -667,7 +667,7 @@ App::post('/v1/account/jwt')
throw new Exception('No valid session found', 401);
}
- $jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 3600, 10); // Instantiate with key, algo, maxAge and leeway.
+ $jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 900, 10); // Instantiate with key, algo, maxAge and leeway.
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
diff --git a/app/init.php b/app/init.php
index ad50ce17b5..795e6c6664 100644
--- a/app/init.php
+++ b/app/init.php
@@ -405,8 +405,8 @@ App::setResource('user', function($mode, $project, $console, $request, $response
$authJWT = $request->getHeader('x-appwrite-jwt', '');
if (!empty($authJWT)) { // JWT authentication
- $jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 3600, 10); // Instantiate with key, algo, maxAge and leeway.
-
+ $jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 900, 10); // Instantiate with key, algo, maxAge and leeway.
+
try {
$payload = $jwt->decode($authJWT);
} catch (JWTException $error) {
From 94c23cd0532776fd2b09d3e4cf201f29c4204539 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 28 Dec 2020 23:23:18 +0200
Subject: [PATCH 033/230] Added docs
---
docs/references/account/create-jwt.md | 1 +
1 file changed, 1 insertion(+)
create mode 100644 docs/references/account/create-jwt.md
diff --git a/docs/references/account/create-jwt.md b/docs/references/account/create-jwt.md
new file mode 100644
index 0000000000..c606222eb5
--- /dev/null
+++ b/docs/references/account/create-jwt.md
@@ -0,0 +1 @@
+Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout.
\ No newline at end of file
From 328d3bcfd474452b2f2a42d7d3e6785be7bb2f1c Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Tue, 29 Dec 2020 12:45:44 +0200
Subject: [PATCH 034/230] Comments review
---
app/controllers/general.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/general.php b/app/controllers/general.php
index 5f9301aec1..10681d33bb 100644
--- a/app/controllers/general.php
+++ b/app/controllers/general.php
@@ -171,7 +171,7 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
* Try app auth when we have project key and no user
* Mock user to app and grant API key scopes in addition to default app scopes
*/
- if (null !== $key && $user->isEmpty()) {
+ if ($key && $user->isEmpty()) {
$user = new Document([
'$id' => '',
'status' => Auth::USER_STATUS_ACTIVATED,
From 9c01fb1ff60ddbeab887f0178b7693a8ad8622d9 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Tue, 29 Dec 2020 22:21:51 +0530
Subject: [PATCH 035/230] feat: parse collection
---
src/Appwrite/Utopia/Response/Filters/V06.php | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 4627157fcc..4f90e33174 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -21,6 +21,10 @@ class V06 extends Filter {
switch($model) {
+ case Response::MODEL_COLLECTION:
+ $parsedResponse = $this->parseCollection($content);
+ break;
+
case Response::MODEL_FILE :
$parsedResponse = $this->parseFile($content);
break;
@@ -100,6 +104,13 @@ class V06 extends Filter {
return $parsedResponse;
}
+ private function parseCollection(array $content)
+ {
+ $content['$collection'] = Database::SYSTEM_COLLECTION_COLLECTIONS;
+ $content['structure'] = true;
+ return $content;
+ }
+
private function parseFile(array $content)
{
$content['$collection'] = Database::SYSTEM_COLLECTION_FILES;
From fa748b62306ece06279c7b62a50807eba0eb158a Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Tue, 29 Dec 2020 22:28:54 +0530
Subject: [PATCH 036/230] feat: parse collection list
---
src/Appwrite/Utopia/Response/Filters/V06.php | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 4f90e33174..40cede4f73 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -25,6 +25,10 @@ class V06 extends Filter {
$parsedResponse = $this->parseCollection($content);
break;
+ case Response::MODEL_COLLECTION_LIST:
+ $parsedResponse = $this->parseCollectionList($content);
+ break;
+
case Response::MODEL_FILE :
$parsedResponse = $this->parseFile($content);
break;
@@ -104,6 +108,14 @@ class V06 extends Filter {
return $parsedResponse;
}
+ private function parseCollectionList(array $content)
+ {
+ foreach($content['collections'] as $key => $collection){
+ $content['collections'][$key] = $this->parseCollection($collection);
+ }
+ return $content;
+ }
+
private function parseCollection(array $content)
{
$content['$collection'] = Database::SYSTEM_COLLECTION_COLLECTIONS;
From d67bcec7b9b876a7d2d3ec2ee0f3743b9d94b712 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Tue, 29 Dec 2020 23:55:34 +0530
Subject: [PATCH 037/230] feat: parse document list
---
src/Appwrite/Utopia/Response/Filters/V06.php | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 40cede4f73..17c6d19932 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -21,6 +21,10 @@ class V06 extends Filter {
switch($model) {
+ case Response::MODEL_DOCUMENT_LIST:
+ $parsedResponse = $content;
+ break;
+
case Response::MODEL_COLLECTION:
$parsedResponse = $this->parseCollection($content);
break;
From 2ffb34fab14e26d99b7ddf2e1c6e379b702965e6 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Wed, 30 Dec 2020 00:12:03 +0530
Subject: [PATCH 038/230] feat: added check for env variable on startup
---
.env | 1 +
Dockerfile | 3 ++-
app/http.php | 7 +++++++
docker-compose.yml | 1 +
4 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/.env b/.env
index 9764cfe894..e3c45cbbb5 100644
--- a/.env
+++ b/.env
@@ -27,3 +27,4 @@ _APP_SMTP_PASSWORD=
_APP_STORAGE_LIMIT=10000000
_APP_FUNCTIONS_TIMEOUT=900
_APP_FUNCTIONS_CONTAINERS=10
+_APP_SYSTEM_RESPONSE_FORMAT=0.6
diff --git a/Dockerfile b/Dockerfile
index d41dbc50fd..0eba6f5624 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -93,7 +93,8 @@ ENV _APP_SERVER=swoole \
_APP_FUNCTIONS_TIMEOUT=900 \
_APP_FUNCTIONS_CONTAINERS=10 \
_APP_SETUP=self-hosted \
- _APP_VERSION=$VERSION
+ _APP_VERSION=$VERSION \
+ _APP_SYSTEM_RESPONSE_FORMAT=0.6
#ENV _APP_SMTP_SECURE ''
#ENV _APP_SMTP_USERNAME ''
#ENV _APP_SMTP_PASSWORD ''
diff --git a/app/http.php b/app/http.php
index afb9411ec5..2f7859f110 100644
--- a/app/http.php
+++ b/app/http.php
@@ -23,6 +23,7 @@ error_reporting(E_ALL);
$http = new Server("0.0.0.0", 80);
$payloadSize = max(4000000 /* 4mb */, App::getEnv('_APP_STORAGE_LIMIT', 10000000 /* 10mb */));
+$responseFormat = App::getEnv('_APP_SYSTEM_RESPONSE_FORMAT', null);
$http
->set([
@@ -48,6 +49,12 @@ $http->on('AfterReload', function($serv, $workerId) {
});
$http->on('start', function (Server $http) use ($payloadSize) {
+
+ if(empty($responseFormat)) {
+ Console::error('Missing value for environment variable _APP_SYSTEM_RESPONSE_FORMAT. Exiting ...');
+ exit(1);
+ }
+
Console::success('Server started succefully (max payload is '.number_format($payloadSize).' bytes)');
Console::info("Master pid {$http->master_pid}, manager pid {$http->manager_pid}");
diff --git a/docker-compose.yml b/docker-compose.yml
index a6bf759f56..f0f54f9939 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -102,6 +102,7 @@ services:
- _APP_STORAGE_LIMIT
- _APP_FUNCTIONS_TIMEOUT
- _APP_FUNCTIONS_CONTAINERS
+ - _APP_SYSTEM_RESPONSE_FORMAT
appwrite-worker-usage:
entrypoint: worker-usage
From 51600bc1d916bd37465d8f3419aa6430da18e24e Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Wed, 30 Dec 2020 00:37:33 +0530
Subject: [PATCH 039/230] feat: added check for header on api init
---
app/controllers/general.php | 23 +++++++++++++++++++++++
app/http.php | 2 +-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/app/controllers/general.php b/app/controllers/general.php
index 972cbf4110..85b8adce70 100644
--- a/app/controllers/general.php
+++ b/app/controllers/general.php
@@ -16,12 +16,23 @@ use Appwrite\Database\Validator\Authorization;
use Appwrite\Network\Validator\Origin;
use Appwrite\Storage\Device\Local;
use Appwrite\Storage\Storage;
+use Appwrite\Utopia\Response\Filter;
+use Appwrite\Utopia\Response\Filter\V06;
use Utopia\CLI\Console;
Config::setParam('domainVerification', false);
Config::setParam('cookieDomain', 'localhost');
Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE);
+function mapResponseFormatToClass(string $responseFormat): Filter {
+ switch($responseFormat) {
+ case preg_match($responseFormat, "/0\.[0-6]\.\d/"):
+ return new V06();
+ default:
+ return null;
+ }
+}
+
App::init(function ($utopia, $request, $response, $console, $project, $user, $locale, $events, $audits, $usage, $deletes, $clients) {
/** @var Utopia\Swoole\Request $request */
/** @var Appwrite\Utopia\Response $response */
@@ -92,6 +103,18 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
Storage::setDevice('files', new Local(APP_STORAGE_UPLOADS.'/app-'.$project->getId()));
Storage::setDevice('functions', new Local(APP_STORAGE_FUNCTIONS.'/app-'.$project->getId()));
+ /*
+ * Response format
+ */
+ $responseFormatEnvVar = App::getEnv('_APP_SYSTEM_RESPONSE_FORMAT', '');
+ $responseFormatHeader = $request->getHeader('x-appwrite-response-format', '');
+ $responseFormat = empty($responseFormatHeader) ? $responseFormatEnvVar : $responseFormatHeader;
+ if (empty($responseFormat) || ($filter = mapResponseFormatToClass($responseFormat)) == null) {
+ throw new Exception('No filter available for response format : '.$responseFormat, 404);
+ } else {
+ Response::setFilter($filter);
+ }
+
/*
* Security Headers
*
diff --git a/app/http.php b/app/http.php
index 2f7859f110..a28af328fe 100644
--- a/app/http.php
+++ b/app/http.php
@@ -23,7 +23,7 @@ error_reporting(E_ALL);
$http = new Server("0.0.0.0", 80);
$payloadSize = max(4000000 /* 4mb */, App::getEnv('_APP_STORAGE_LIMIT', 10000000 /* 10mb */));
-$responseFormat = App::getEnv('_APP_SYSTEM_RESPONSE_FORMAT', null);
+$responseFormat = App::getEnv('_APP_SYSTEM_RESPONSE_FORMAT', '');
$http
->set([
From cebd016282c9f1db3f5bda38fa6cf8c563e98680 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Wed, 30 Dec 2020 00:38:48 +0530
Subject: [PATCH 040/230] feat: modified the regex
---
app/controllers/general.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/general.php b/app/controllers/general.php
index 85b8adce70..8c0404ce5f 100644
--- a/app/controllers/general.php
+++ b/app/controllers/general.php
@@ -26,7 +26,7 @@ Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE);
function mapResponseFormatToClass(string $responseFormat): Filter {
switch($responseFormat) {
- case preg_match($responseFormat, "/0\.[0-6]\.\d/"):
+ case preg_match($responseFormat, "/0\.[0-6]\.\d?/"):
return new V06();
default:
return null;
From c508657a50fcd9d3f9300e614ea6b9594e0249b5 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Wed, 30 Dec 2020 00:42:32 +0530
Subject: [PATCH 041/230] feat: apply parse method if filter is present
---
src/Appwrite/Utopia/Response.php | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php
index 70e8e46d91..16fedaf8e1 100644
--- a/src/Appwrite/Utopia/Response.php
+++ b/src/Appwrite/Utopia/Response.php
@@ -293,6 +293,10 @@ class Response extends SwooleResponse
}
$item = $this->output($item, $rule['type']);
+ // If filter is set, parse the item
+ if(self::isFilter()){
+ $item = self::getFilter()->parse($item, $rule['type']);
+ }
}
}
}
From a37a28fdc9ca6e6e9bccf04971c1bff2c81c1a71 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Wed, 30 Dec 2020 16:24:11 +0530
Subject: [PATCH 042/230] feat: added unit test for setFilter
---
src/Appwrite/Utopia/Response/Filters/V06.php | 4 +--
tests/unit/Utopia/ResponseTest.php | 34 ++++++++++++++++++++
2 files changed, 36 insertions(+), 2 deletions(-)
create mode 100644 tests/unit/Utopia/ResponseTest.php
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 17c6d19932..4e15862108 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -16,8 +16,8 @@ class V06 extends Filter {
// Convert 0.7 Data format to 0.6 format
public function parse(array $content, string $model): array {
-
- $parsedResponse = array();
+
+ $parsedResponse = [];
switch($model) {
diff --git a/tests/unit/Utopia/ResponseTest.php b/tests/unit/Utopia/ResponseTest.php
new file mode 100644
index 0000000000..20df14058a
--- /dev/null
+++ b/tests/unit/Utopia/ResponseTest.php
@@ -0,0 +1,34 @@
+object = new Response(new SwooleResponse());
+ }
+
+ public function testSetFilter()
+ {
+ $this->assertEquals($this->object->isFilter(), false);
+ $this->assertEquals($this->object->getFilter(), null);
+
+ $filter = new V06();
+ $this->object->setFilter($filter);
+
+ $this->assertEquals($this->object->isFilter(), true);
+ $this->assertEquals($this->object->getFilter(), $filter);
+ }
+}
\ No newline at end of file
From 61700395866cdcb13f60842480c20066dd192698 Mon Sep 17 00:00:00 2001
From: "Eldad A. Fux"
Date: Wed, 30 Dec 2020 17:53:46 +0200
Subject: [PATCH 043/230] Update README.md
---
README.md | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 7fa85dc181..4f6e598c76 100644
--- a/README.md
+++ b/README.md
@@ -114,17 +114,17 @@ For the complete API documentation, visit [https://appwrite.io/docs](https://app
Below is a list of currently supported platforms and languages. If you wish to help us add support to your platform of choice, you can go over to our [SDK Generator](https://github.com/appwrite/sdk-generator) project and view our [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md).
#### Client
-* ✅ [Web](https://github.com/appwrite/sdk-for-js) (Maintained by the Appwrite Team)
-* ✅ [Flutter](https://github.com/appwrite/sdk-for-flutter) (Maintained by the Appwrite Team)
+* ✅ [Web](https://github.com/appwrite/sdk-for-js) (Maintained by the Appwrite Team)
+* ✅ [Flutter](https://github.com/appwrite/sdk-for-flutter) (Maintained by the Appwrite Team)
#### Server
-* ✅ [NodeJS](https://github.com/appwrite/sdk-for-node) (Maintained by the Appwrite Team)
-* ✅ [PHP](https://github.com/appwrite/sdk-for-php) (Maintained by the Appwrite Team)
-* ✅ [Deno](https://github.com/appwrite/sdk-for-deno) - **Beta** (Maintained by the Appwrite Team)
-* ✅ [Ruby](https://github.com/appwrite/sdk-for-ruby) - **Beta** (Maintained by the Appwrite Team)
-* ✅ [Python](https://github.com/appwrite/sdk-for-python) - **Beta** (Maintained by the Appwrite Team)
-* ✅ [Go](https://github.com/appwrite/sdk-for-go) **Work in progress** (Maintained by the Appwrite Team)
-* ✅ [Dart](https://github.com/appwrite/sdk-for-dart) **Work in progress** (Maintained by the Appwrite Team)
+* ✅ [NodeJS](https://github.com/appwrite/sdk-for-node) (Maintained by the Appwrite Team)
+* ✅ [PHP](https://github.com/appwrite/sdk-for-php) (Maintained by the Appwrite Team)
+* ✅ [Deno](https://github.com/appwrite/sdk-for-deno) - **Beta** (Maintained by the Appwrite Team)
+* ✅ [Ruby](https://github.com/appwrite/sdk-for-ruby) - **Beta** (Maintained by the Appwrite Team)
+* ✅ [Python](https://github.com/appwrite/sdk-for-python) - **Beta** (Maintained by the Appwrite Team)
+* ✅ [Go](https://github.com/appwrite/sdk-for-go) **Work in progress** (Maintained by the Appwrite Team)
+* ✅ [Dart](https://github.com/appwrite/sdk-for-dart) **Work in progress** (Maintained by the Appwrite Team)
Looking for more SDKs? - Help us by contributing a pull request to our [SDK Generator](https://github.com/appwrite/sdk-generator)!
From 7d4262f623926409c2f862de8e17a6d46f433168 Mon Sep 17 00:00:00 2001
From: "Eldad A. Fux"
Date: Wed, 30 Dec 2020 17:55:05 +0200
Subject: [PATCH 044/230] Update README.md
---
README.md | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 4f6e598c76..d8d35f97d0 100644
--- a/README.md
+++ b/README.md
@@ -114,17 +114,17 @@ For the complete API documentation, visit [https://appwrite.io/docs](https://app
Below is a list of currently supported platforms and languages. If you wish to help us add support to your platform of choice, you can go over to our [SDK Generator](https://github.com/appwrite/sdk-generator) project and view our [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md).
#### Client
-* ✅ [Web](https://github.com/appwrite/sdk-for-js) (Maintained by the Appwrite Team)
-* ✅ [Flutter](https://github.com/appwrite/sdk-for-flutter) (Maintained by the Appwrite Team)
+* ✅ [Web](https://github.com/appwrite/sdk-for-js) (Maintained by the Appwrite Team)
+* ✅ [Flutter](https://github.com/appwrite/sdk-for-flutter) (Maintained by the Appwrite Team)
#### Server
-* ✅ [NodeJS](https://github.com/appwrite/sdk-for-node) (Maintained by the Appwrite Team)
-* ✅ [PHP](https://github.com/appwrite/sdk-for-php) (Maintained by the Appwrite Team)
-* ✅ [Deno](https://github.com/appwrite/sdk-for-deno) - **Beta** (Maintained by the Appwrite Team)
-* ✅ [Ruby](https://github.com/appwrite/sdk-for-ruby) - **Beta** (Maintained by the Appwrite Team)
-* ✅ [Python](https://github.com/appwrite/sdk-for-python) - **Beta** (Maintained by the Appwrite Team)
-* ✅ [Go](https://github.com/appwrite/sdk-for-go) **Work in progress** (Maintained by the Appwrite Team)
-* ✅ [Dart](https://github.com/appwrite/sdk-for-dart) **Work in progress** (Maintained by the Appwrite Team)
+* ✅ [NodeJS](https://github.com/appwrite/sdk-for-node) (Maintained by the Appwrite Team)
+* ✅ [PHP](https://github.com/appwrite/sdk-for-php) (Maintained by the Appwrite Team)
+* ✅ [Deno](https://github.com/appwrite/sdk-for-deno) - **Beta** (Maintained by the Appwrite Team)
+* ✅ [Ruby](https://github.com/appwrite/sdk-for-ruby) - **Beta** (Maintained by the Appwrite Team)
+* ✅ [Python](https://github.com/appwrite/sdk-for-python) - **Beta** (Maintained by the Appwrite Team)
+* ✅ [Go](https://github.com/appwrite/sdk-for-go) **Work in progress** (Maintained by the Appwrite Team)
+* ✅ [Dart](https://github.com/appwrite/sdk-for-dart) **Work in progress** (Maintained by the Appwrite Team)
Looking for more SDKs? - Help us by contributing a pull request to our [SDK Generator](https://github.com/appwrite/sdk-generator)!
From 28f003e5bed03d420fe04a3925737e1badfd9c77 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Thu, 31 Dec 2020 01:07:30 +0530
Subject: [PATCH 045/230] feat: unit tests for response filters
---
tests/unit/Utopia/Filters/V06Test.php | 237 ++++++++++++++++++++++++++
1 file changed, 237 insertions(+)
create mode 100644 tests/unit/Utopia/Filters/V06Test.php
diff --git a/tests/unit/Utopia/Filters/V06Test.php b/tests/unit/Utopia/Filters/V06Test.php
new file mode 100644
index 0000000000..a5d2bfaa85
--- /dev/null
+++ b/tests/unit/Utopia/Filters/V06Test.php
@@ -0,0 +1,237 @@
+filter = new V06();
+ }
+
+ public function testParseUser()
+ {
+ $content = [
+ '$id' => '5e5ea5c16897e',
+ 'name' => 'John Doe',
+ 'registration' => 1592981250,
+ 'status' => 0,
+ 'email' => 'john@appwrite.io',
+ 'emailVerification' => false,
+ 'prefs' => [
+ 'theme' => 'pink',
+ 'timezone' => 'UTC'
+ ]
+ ];
+
+ $model = Response::MODEL_USER;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['$id'], '5e5ea5c16897e');
+ $this->assertEquals($parsedResponse['name'], 'John Doe');
+ $this->assertEquals($parsedResponse['registration'], 1592981250);
+ $this->assertEquals($parsedResponse['status'], 0);
+ $this->assertEquals($parsedResponse['email'], 'john@appwrite.io');
+ $this->assertEquals($parsedResponse['emailVerification'], false);
+ $this->assertEquals($parsedResponse['prefs'], ['theme' => 'pink', 'timezone' => 'UTC']);
+ $this->assertEquals($parsedResponse['status'], 0);
+ $this->assertEquals($parsedResponse['roles'], Authorization::getRoles() ?? []);
+ }
+
+ public function testParseUserList()
+ {
+ $content = [
+ 'sum' => 1,
+ 'users' => [
+ 0 => [
+ '$id' => '5e5ea5c16897e',
+ 'name' => 'John Doe',
+ 'registration' => 1592981250,
+ 'status' => 0,
+ 'email' => 'john@appwrite.io',
+ 'emailVerification' => false,
+ 'prefs' => [
+ 'theme' => 'pink',
+ 'timezone' => 'UTC'
+ ]
+ ]
+ ]
+ ];
+
+ $model = Response::MODEL_USER_LIST;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['sum'], 1);
+ $this->assertEquals($parsedResponse['users'][0]['$id'], '5e5ea5c16897e');
+ $this->assertEquals($parsedResponse['users'][0]['name'], 'John Doe');
+ $this->assertEquals($parsedResponse['users'][0]['registration'], 1592981250);
+ $this->assertEquals($parsedResponse['users'][0]['status'], 0);
+ $this->assertEquals($parsedResponse['users'][0]['email'], 'john@appwrite.io');
+ $this->assertEquals($parsedResponse['users'][0]['emailVerification'], false);
+ $this->assertEquals($parsedResponse['users'][0]['prefs'], ['theme' => 'pink', 'timezone' => 'UTC']);
+ $this->assertEquals($parsedResponse['users'][0]['status'], 0);
+ $this->assertEquals($parsedResponse['users'][0]['roles'], Authorization::getRoles() ?? []);
+ }
+
+ public function testParseSession()
+ {
+ $content = [
+ '$id' => '5e5ea5c16897e',
+ 'userId' => '5e5bb8c16897e',
+ 'expire' => 1592981250,
+ 'ip' => '127.0.0.1',
+ 'osCode' => 'Mac',
+ 'osName' => 'Mac',
+ 'osVersion' => 'Mac',
+ 'clientType' => 'browser',
+ 'clientCode' => 'CM',
+ 'clientName' => 'Chrome Mobile iOS',
+ 'clientVersion' => '84.0',
+ 'clientEngine' => 'WebKit',
+ 'clientEngineVersion' => '605.1.15',
+ 'deviceName' => 'smartphone',
+ 'deviceBrand' => 'Google',
+ 'deviceModel' => 'Nexus 5',
+ 'countryCode' => 'US',
+ 'countryName' => 'United States',
+ 'current' => true
+ ];
+
+ $model = Response::MODEL_SESSION;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['$id'], '5e5ea5c16897e');
+ $this->assertEquals($parsedResponse['userId'], '5e5bb8c16897e');
+ $this->assertEquals($parsedResponse['expire'], 1592981250);
+ $this->assertEquals($parsedResponse['ip'], '127.0.0.1');
+ $this->assertEquals($parsedResponse['osCode'], 'Mac');
+ $this->assertEquals($parsedResponse['osName'], 'Mac');
+ $this->assertEquals($parsedResponse['osVersion'], 'Mac');
+ $this->assertEquals($parsedResponse['clientType'], 'browser');
+ $this->assertEquals($parsedResponse['clientCode'], 'CM');
+ $this->assertEquals($parsedResponse['clientName'], 'Chrome Mobile iOS');
+ $this->assertEquals($parsedResponse['clientVersion'], '84.0');
+ $this->assertEquals($parsedResponse['clientEngine'], 'WebKit');
+ $this->assertEquals($parsedResponse['clientEngineVersion'], '605.1.15');
+ $this->assertEquals($parsedResponse['deviceName'], 'smartphone');
+ $this->assertEquals($parsedResponse['deviceBrand'], 'Google');
+ $this->assertEquals($parsedResponse['deviceModel'], 'Nexus 5');
+ $this->assertEquals($parsedResponse['countryCode'], 'US');
+ $this->assertEquals($parsedResponse['countryName'], 'United States');
+ $this->assertEquals($parsedResponse['current'], true);
+ $this->assertEquals($parsedResponse['type'], Auth::TOKEN_TYPE_LOGIN);
+ }
+
+ public function testParseSessionList()
+ {
+ $content = [
+ 'sum' => 1,
+ 'sessions' => [
+ 0 => [
+ '$id' => '5e5ea5c16897e',
+ 'userId' => '5e5bb8c16897e',
+ 'expire' => 1592981250,
+ 'ip' => '127.0.0.1',
+ 'osCode' => 'Mac',
+ 'osName' => 'Mac',
+ 'osVersion' => 'Mac',
+ 'clientType' => 'browser',
+ 'clientCode' => 'CM',
+ 'clientName' => 'Chrome Mobile iOS',
+ 'clientVersion' => '84.0',
+ 'clientEngine' => 'WebKit',
+ 'clientEngineVersion' => '605.1.15',
+ 'deviceName' => 'smartphone',
+ 'deviceBrand' => 'Google',
+ 'deviceModel' => 'Nexus 5',
+ 'countryCode' => 'US',
+ 'countryName' => 'United States',
+ 'current' => true
+ ]
+ ]
+ ];
+
+ $model = Response::MODEL_SESSION_LIST;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['sum'], 1);
+ $this->assertEquals($parsedResponse['sessions'][0]['$id'], '5e5ea5c16897e');
+ $this->assertEquals($parsedResponse['sessions'][0]['OS'], 'Mac Mac');
+ $this->assertEquals($parsedResponse['sessions'][0]['client'], 'Chrome Mobile iOS 84.0');
+ $this->assertEquals($parsedResponse['sessions'][0]['device'], 'smartphone');
+ $this->assertEquals($parsedResponse['sessions'][0]['brand'], 'Google');
+ $this->assertEquals($parsedResponse['sessions'][0]['model'], 'Nexus 5');
+ $this->assertEquals($parsedResponse['sessions'][0]['ip'], '127.0.0.1');
+ $this->assertEquals($parsedResponse['sessions'][0]['current'], true);
+ $this->assertEquals($parsedResponse['sessions'][0]['geo']['isoCode'], 'US');
+ $this->assertEquals($parsedResponse['sessions'][0]['geo']['country'], 'United States');
+ }
+
+ public function testParseLogList()
+ {
+ $content = [
+ 'sum' => 1,
+ 'logs' => [
+ 0 => [
+ 'event' => 'account.sessions.create',
+ 'ip' => '127.0.0.1',
+ 'time' => 1592981250,
+ 'osCode' => 'Mac',
+ 'osName' => 'Mac',
+ 'osVersion' => 'Mac',
+ 'clientType' => 'browser',
+ 'clientCode' => 'CM',
+ 'clientName' => 'Chrome Mobile iOS',
+ 'clientVersion' => '84.0',
+ 'clientEngine' => 'WebKit',
+ 'clientEngineVersion' => '605.1.15',
+ 'deviceName' => 'smartphone',
+ 'deviceBrand' => 'Google',
+ 'deviceModel' => 'Nexus 5',
+ 'countryCode' => 'US',
+ 'countryName' => 'United States'
+ ]
+ ]
+ ];
+
+ $model = Response::MODEL_LOG_LIST;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['sum'], 1);
+ $this->assertEquals($parsedResponse['logs'][0]['event'], 'account.sessions.create');
+ $this->assertEquals($parsedResponse['logs'][0]['ip'], '127.0.0.1');
+ $this->assertEquals($parsedResponse['logs'][0]['time'], 1592981250);
+ $this->assertEquals($parsedResponse['logs'][0]['OS'], 'Mac Mac');
+ $this->assertEquals($parsedResponse['logs'][0]['client'], 'Chrome Mobile iOS 84.0');
+ $this->assertEquals($parsedResponse['logs'][0]['device'], 'smartphone');
+ $this->assertEquals($parsedResponse['logs'][0]['brand'], 'Google');
+ $this->assertEquals($parsedResponse['logs'][0]['model'], 'Nexus 5');
+ $this->assertEquals($parsedResponse['logs'][0]['geo']['isoCode'], 'US');
+ $this->assertEquals($parsedResponse['logs'][0]['geo']['country'], 'United States');
+ }
+
+ public function testParseToken()
+ {
+ $content = [
+ '$id' => 'bb8ea5c16897e',
+ 'userId' => '5e5ea5c168bb8',
+ 'secret' => '',
+ 'expire' => 1592981250
+ ];
+
+ $model = Response::MODEL_TOKEN;
+ $parsedResponse = $this->filter->parse($content, $model);
+ }
+}
\ No newline at end of file
From 8cc10c683abb85bbf24da5635734a25471763fa9 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Thu, 31 Dec 2020 12:42:23 +0530
Subject: [PATCH 046/230] feat: unit tests for response filters
---
src/Appwrite/Utopia/Response/Filters/V06.php | 2 +-
tests/unit/Utopia/Filters/V06Test.php | 49 ++++++++++++++++++++
2 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 4e15862108..401bfd1a64 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -176,7 +176,7 @@ class V06 extends Filter {
$countries = $content['countries'];
$parsedResponse = [];
foreach($countries as $country) {
- $parsedResponse['code'] = $country['name'];
+ $parsedResponse[$country['code']] = $country['name'];
}
return $parsedResponse;
diff --git a/tests/unit/Utopia/Filters/V06Test.php b/tests/unit/Utopia/Filters/V06Test.php
index a5d2bfaa85..0c5935793c 100644
--- a/tests/unit/Utopia/Filters/V06Test.php
+++ b/tests/unit/Utopia/Filters/V06Test.php
@@ -233,5 +233,54 @@ class V06Test extends TestCase
$model = Response::MODEL_TOKEN;
$parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['$id'], 'bb8ea5c16897e');
+ $this->assertEquals($parsedResponse['userId'], '5e5ea5c168bb8');
+ $this->assertEquals($parsedResponse['expire'], 1592981250);
+ $this->assertEquals($parsedResponse['secret'], '');
+ $this->assertEquals($parsedResponse['type'], Auth::TOKEN_TYPE_RECOVERY);
+ }
+
+ public function testParseLocale()
+ {
+ $content = [
+ 'ip' => '127.0.0.1',
+ 'countryCode' => 'US',
+ 'country' => 'United States',
+ 'continentCode' => 'NA',
+ 'continent' => 'North America',
+ 'eu' => false,
+ 'currency' => 'USD'
+ ];
+
+ $model = Response::MODEL_LOCALE;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['ip'], '127.0.0.1');
+ $this->assertEquals($parsedResponse['contryCode'], 'US');
+ $this->assertEquals($parsedResponse['country'], 'United States');
+ $this->assertEquals($parsedResponse['continentCode'], 'NA');
+ $this->assertEquals($parsedResponse['continent'], 'North America');
+ $this->assertEquals($parsedResponse['eu'], false);
+ $this->assertEquals($parsedResponse['currency'], 'USD');
+ }
+
+ public function testParseCountryList()
+ {
+ $content = [
+ 'sum' => 1,
+ 'countries' => [
+ 0 => [
+ 'name' => 'United States',
+ 'code' => 'US'
+ ]
+ ]
+ ];
+
+ $model = Response::MODEL_COUNTRY_LIST;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['sum'], 1);
+ $this->assertEquals($parsedResponse['countries']['US'], 'United States');
}
}
\ No newline at end of file
From 4fc40a387af65ebcb389a20ef9b9de5242ff2df0 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Thu, 31 Dec 2020 13:25:25 +0530
Subject: [PATCH 047/230] feat: unit tests for response filters
---
src/Appwrite/Utopia/Response/Filters/V06.php | 20 ++-
tests/unit/Utopia/Filters/V06Test.php | 136 +++++++++++++++++++
2 files changed, 149 insertions(+), 7 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 401bfd1a64..bed31b48bc 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -146,7 +146,15 @@ class V06 extends Filter {
private function parseCurrencyList(array $content)
{
$content['locations'] = [];
- return $content;
+
+ $currencies = $content['currencies'];
+ $parsedResponse = [];
+ foreach($currencies as $currency) {
+ $currency['locations'] = [];
+ $parsedResponse[] = $currency;
+ }
+
+ return $parsedResponse;
}
private function parseContinentList(array $content)
@@ -154,7 +162,7 @@ class V06 extends Filter {
$continents = $content['continents'];
$parsedResponse = [];
foreach($continents as $continent) {
- $parsedResponse['code'] = $continent['name'];
+ $parsedResponse[$continent['code']] = $continent['name'];
}
return $parsedResponse;
@@ -165,7 +173,7 @@ class V06 extends Filter {
$phones = $content['phones'];
$parsedResponse = [];
foreach($phones as $phone) {
- $parsedResponse['countryCode'] = $phone['code'];
+ $parsedResponse[$phone['countryCode']] = $phone['code'];
}
return $parsedResponse;
@@ -204,9 +212,8 @@ class V06 extends Filter {
{
$logs = $content['logs'];
$parsedResponse = [];
- $index = 0;
foreach($logs as $log) {
- $parsedResponse[$index++] = [
+ $parsedResponse[] = [
'event' => $log['event'],
'ip' => $log['ip'],
'time' => strtotime($log['time']),
@@ -228,9 +235,8 @@ class V06 extends Filter {
{
$sessions = $content['sessions'];
$parsedResponse = [];
- $index = 0;
foreach($sessions as $session) {
- $parsedResponse[$index++] = [
+ $parsedResponse[] = [
'$id' => $session['$id'],
'OS' => $session['osName'].' '.$session['osVersion'],
'client' => $session['clientName'].' '.$session['clientVersion'],
diff --git a/tests/unit/Utopia/Filters/V06Test.php b/tests/unit/Utopia/Filters/V06Test.php
index 0c5935793c..3c98fc192b 100644
--- a/tests/unit/Utopia/Filters/V06Test.php
+++ b/tests/unit/Utopia/Filters/V06Test.php
@@ -3,7 +3,9 @@
namespace Appwrite\Tests;
use Appwrite\Auth\Auth;
+use Appwrite\Database\Database;
use Appwrite\Database\Validator\Authorization;
+use Appwrite\OpenSSL\OpenSSL;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Filter\V06;
use PHPUnit\Framework\TestCase;
@@ -283,4 +285,138 @@ class V06Test extends TestCase
$this->assertEquals($parsedResponse['sum'], 1);
$this->assertEquals($parsedResponse['countries']['US'], 'United States');
}
+
+ public function testParsePhoneList()
+ {
+ $content = [
+ 'sum' => 1,
+ 'phones' => [
+ 0 => [
+ 'code' => '+1',
+ 'countryCode' => 'US',
+ 'countryName' => 'United States'
+ ]
+ ]
+ ];
+
+ $model = Response::MODEL_PHONE_LIST;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['sum'], 1);
+ $this->assertEquals($parsedResponse['phones']['US'], '+1');
+ }
+
+ public function testParseContinentList()
+ {
+ $content = [
+ 'sum' => 1,
+ 'continents' => [
+ 0 => [
+ 'name' => 'Europe',
+ 'code' => 'EU',
+ ]
+ ]
+ ];
+
+ $model = Response::MODEL_CONTINENT_LIST;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['sum'], 1);
+ $this->assertEquals($parsedResponse['continents']['EU'], 'Europe');
+ }
+
+ public function testParseCurrencyList()
+ {
+ $content = [
+ 'sum' => 1,
+ 'currencies' => [
+ 0 => [
+ 'symbol' => '$',
+ 'name' => 'US dollar',
+ 'symbolNative' => '$',
+ 'decimalDigits' => 2,
+ 'rounding' => 0,
+ 'code' => 'USD',
+ 'namePlural' => 'US Dollars'
+ ]
+ ]
+ ];
+
+ $model = Response::MODEL_CURRENCY_LIST;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['sum'], 1);
+ $this->assertEquals($parsedResponse['currencies'][0]['symbol'], '$');
+ $this->assertEquals($parsedResponse['currencies'][0]['name'], 'US dollar');
+ $this->assertEquals($parsedResponse['currencies'][0]['symbolNative'], '$');
+ $this->assertEquals($parsedResponse['currencies'][0]['decimalDigits'], 2);
+ $this->assertEquals($parsedResponse['currencies'][0]['rounding'], 0);
+ $this->assertEquals($parsedResponse['currencies'][0]['code'], 'USD');
+ $this->assertEquals($parsedResponse['currencies'][0]['namePlural'], 'US Dollars');
+ $this->assertEquals($parsedResponse['currencies'][0]['locations'], []);
+ }
+
+ public function testParseFile()
+ {
+ $content = [
+ '$id' => '5e5ea5c16897e',
+ '$permissions' => ['read' => ['*'], 'write' => ['*']],
+ 'name' => 'Pink.png',
+ 'dateCreated' => 1592981250,
+ 'signature' => '5d529fd02b544198ae075bd57c1762bb',
+ 'mimeType' => 'image/png',
+ 'sizeOriginal' => 17890
+ ];
+
+ $model = Response::MODEL_FILE;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['$id'], '5e5ea5c16897e');
+ $this->assertEquals($parsedResponse['$permissions'], ['read' => ['*'], 'write' => ['*']]);
+ $this->assertEquals($parsedResponse['name'], 'Pink.png');
+ $this->assertEquals($parsedResponse['dateCreated'], 1592981250);
+ $this->assertEquals($parsedResponse['signature'], '5d529fd02b544198ae075bd57c1762bb');
+ $this->assertEquals($parsedResponse['mimeType'], 'image/png');
+ $this->assertEquals($parsedResponse['sizeOriginal'], 17890);
+ $this->assertEquals($parsedResponse['$collection'], Database::SYSTEM_COLLECTION_FILES);
+ $this->assertEquals($parsedResponse['algorithm'], 'gzip');
+ $this->assertEquals($parsedResponse['comment'], '');
+ $this->assertEquals($parsedResponse['fileOpenSSLCipher'], OpenSSL::CIPHER_AES_128_GCM);
+ $this->assertEquals($parsedResponse['fileOpenSSLIV'], '');
+ $this->assertEquals($parsedResponse['fileOpenSSLTag'], '');
+ $this->assertEquals($parsedResponse['fileOpenSSLVersion'], '');
+ $this->assertEquals($parsedResponse['folderId'], '');
+ $this->assertEquals($parsedResponse['path'], '');
+ $this->assertEquals($parsedResponse['sizeActual'], $content['sizeOriginal']);
+ $this->assertEquals($parsedResponse['token'], '');
+ }
+
+ public function testParseCollection()
+ {
+ $content = [
+ '$id' => '5e5ea5c16897e',
+ '$permissions' => ['read' => ['*'], 'write' => ['*']],
+ 'name' => 'Movies',
+ 'dateCreated' => 1592981250,
+ 'dateUpdated' => '5d529fd02b544198ae075bd57c1762bb',
+ 'rules' => []
+ ];
+
+ $model = Response::MODEL_COLLECTION;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['$id'], '5e5ea5c16897e');
+ $this->assertEquals($parsedResponse['$permissions'], ['read' => ['*'], 'write' => ['*']]);
+ $this->assertEquals($parsedResponse['name'], 'Movies');
+ $this->assertEquals($parsedResponse['dateCreated'], 1592981250);
+ $this->assertEquals($parsedResponse['dateUpdated'], '5d529fd02b544198ae075bd57c1762bb');
+ $this->assertEquals($parsedResponse['rules'], []);
+ $this->assertEquals($parsedResponse['$collection'], Database::SYSTEM_COLLECTION_COLLECTIONS);
+ $this->assertEquals($parsedResponse['structure'], true);
+ }
+
+ public function testParseCollectionList()
+ {
+
+ }
}
\ No newline at end of file
From 734e0c3a818c84be4fa5295af929949ca3c658eb Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Thu, 31 Dec 2020 13:42:01 +0530
Subject: [PATCH 048/230] feat: unit tests for response filters
---
tests/unit/Utopia/Filters/V06Test.php | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/tests/unit/Utopia/Filters/V06Test.php b/tests/unit/Utopia/Filters/V06Test.php
index 3c98fc192b..2db87c8eb7 100644
--- a/tests/unit/Utopia/Filters/V06Test.php
+++ b/tests/unit/Utopia/Filters/V06Test.php
@@ -418,5 +418,31 @@ class V06Test extends TestCase
public function testParseCollectionList()
{
+ $content = [
+ 'sum' => 1,
+ 'collections' => [
+ 0 => [
+ '$id' => '5e5ea5c16897e',
+ '$permissions' => ['read' => ['*'], 'write' => ['*']],
+ 'name' => 'Movies',
+ 'dateCreated' => 1592981250,
+ 'dateUpdated' => '5d529fd02b544198ae075bd57c1762bb',
+ 'rules' => []
+ ]
+ ]
+ ];
+
+ $model = Response::MODEL_COLLECTION_LIST;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['sum'], 1);
+ $this->assertEquals($parsedResponse['collections'][0]['$id'], '5e5ea5c16897e');
+ $this->assertEquals($parsedResponse['collections'][0]['$permissions'], ['read' => ['*'], 'write' => ['*']]);
+ $this->assertEquals($parsedResponse['collections'][0]['name'], 'Movies');
+ $this->assertEquals($parsedResponse['collections'][0]['dateCreated'], 1592981250);
+ $this->assertEquals($parsedResponse['collections'][0]['dateUpdated'], '5d529fd02b544198ae075bd57c1762bb');
+ $this->assertEquals($parsedResponse['collections'][0]['rules'], []);
+ $this->assertEquals($parsedResponse['collections'][0]['$collection'], Database::SYSTEM_COLLECTION_COLLECTIONS);
+ $this->assertEquals($parsedResponse['collections'][0]['structure'], true);
}
}
\ No newline at end of file
From 7cf84828083c4919fb08138f2a90f68f1b67968b Mon Sep 17 00:00:00 2001
From: "Eldad A. Fux"
Date: Thu, 31 Dec 2020 11:37:39 +0200
Subject: [PATCH 049/230] Update README.md
---
README.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index d8d35f97d0..1398b9513e 100644
--- a/README.md
+++ b/README.md
@@ -8,11 +8,11 @@
-[](https://appwrite.io/discord)
-[](https://hub.docker.com/r/appwrite/appwrite)
-[](https://travis-ci.com/appwrite/appwrite)
-[](https://twitter.com/appwrite_io)
-[](https://stackshare.io/appwrite)
+[](https://appwrite.io/discord)
+[](https://hub.docker.com/r/appwrite/appwrite)
+[](https://travis-ci.com/appwrite/appwrite)
+[](https://twitter.com/appwrite_io)
+[](https://stackshare.io/appwrite)
Appwrite is an end-to-end backend server for Web, Mobile, Native, or Backend apps packaged as a set of Docker microservices. Appwrite abstracts the complexity and repetitiveness required to build a modern backend API from scratch and allows you to build secure apps faster.
From d191a71593661fcfdf4cfb11dbb11f415a6f147a Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Fri, 1 Jan 2021 01:26:39 +0530
Subject: [PATCH 050/230] feat: review comments
---
app/controllers/general.php | 24 ++++++++----------------
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/app/controllers/general.php b/app/controllers/general.php
index 62ca0be580..316fb85e0c 100644
--- a/app/controllers/general.php
+++ b/app/controllers/general.php
@@ -24,15 +24,6 @@ Config::setParam('domainVerification', false);
Config::setParam('cookieDomain', 'localhost');
Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE);
-function mapResponseFormatToClass(string $responseFormat): Filter {
- switch($responseFormat) {
- case preg_match($responseFormat, "/0\.[0-6]\.\d?/"):
- return new V06();
- default:
- return null;
- }
-}
-
App::init(function ($utopia, $request, $response, $console, $project, $user, $locale, $events, $audits, $usage, $deletes, $clients) {
/** @var Utopia\Swoole\Request $request */
/** @var Appwrite\Utopia\Response $response */
@@ -108,14 +99,15 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
/*
* Response format
*/
- $responseFormatEnvVar = App::getEnv('_APP_SYSTEM_RESPONSE_FORMAT', '');
- $responseFormatHeader = $request->getHeader('x-appwrite-response-format', '');
- $responseFormat = empty($responseFormatHeader) ? $responseFormatEnvVar : $responseFormatHeader;
- if (empty($responseFormat) || ($filter = mapResponseFormatToClass($responseFormat)) == null) {
- throw new Exception('No filter available for response format : '.$responseFormat, 404);
- } else {
- Response::setFilter($filter);
+ $responseFormat = $request->getHeader('x-appwrite-response-format', App::getEnv('_APP_SYSTEM_RESPONSE_FORMAT', ''));
+ switch($responseFormat) {
+ case version_compare ($responseFormat , '0.6.2', '=<') :
+ Response::setFilter(new V06());
+ break;
+ default:
+ throw new Exception('No filter available for response format : '.$responseFormat, 404);
}
+
/*
* Security Headers
From f2e98d3e8a2ab314f34e36a774cd11ee54d740c7 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Fri, 1 Jan 2021 09:57:13 +0200
Subject: [PATCH 051/230] Reduce travis wait time
---
.travis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index ea3d9573ba..3e729a988a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -32,7 +32,7 @@ before_install:
install:
- docker --version
- docker-compose up -d
-- sleep 90
+- sleep 10
script:
- docker ps
From 9a1a88d9165582c151a2fbde5820c8dc930b1e74 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Fri, 1 Jan 2021 10:34:34 +0200
Subject: [PATCH 052/230] Added debug for waiting function
---
tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
index f44f121a01..f5ca6b2e60 100644
--- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
+++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
@@ -598,7 +598,7 @@ class FunctionsCustomServerTest extends Scope
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()));
- if($executions['body']['executions'][0]['status'] === 'failed') {
+ if($executions['body']['executions'][0]['status'] !== 'completed') {
var_dump($executions['body']['executions'][0]);
}
From 0e10137101c1a297a450b62e14001151f49ddb37 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Fri, 1 Jan 2021 10:34:44 +0200
Subject: [PATCH 053/230] Reduce mail wait time
---
tests/e2e/Scopes/Scope.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php
index fae34a87fb..9de1f19417 100644
--- a/tests/e2e/Scopes/Scope.php
+++ b/tests/e2e/Scopes/Scope.php
@@ -33,7 +33,7 @@ abstract class Scope extends TestCase
protected function getLastEmail():array
{
- sleep(10);
+ sleep(5);
$emails = json_decode(file_get_contents('http://maildev/email'), true);
From 40c7910dd8fbd7cec3ad108d8e666a2899ad2a78 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Fri, 1 Jan 2021 10:52:08 +0200
Subject: [PATCH 054/230] Debug failed functions
---
tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
index f5ca6b2e60..2fe2e7d58d 100644
--- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
+++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
@@ -599,6 +599,7 @@ class FunctionsCustomServerTest extends Scope
], $this->getHeaders()));
if($executions['body']['executions'][0]['status'] !== 'completed') {
+ var_dump($env);
var_dump($executions['body']['executions'][0]);
}
From c83efa9db808ebb89c9648856b88349e34d1515e Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Fri, 1 Jan 2021 10:57:38 +0200
Subject: [PATCH 055/230] Updated timeout test
---
.../Functions/FunctionsCustomServerTest.php | 2 +-
tests/resources/functions/timeout.tar.gz | Bin 168 -> 166 bytes
tests/resources/functions/timeout/index.php | 2 +-
3 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
index 2fe2e7d58d..a319f6ae27 100644
--- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
+++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
@@ -683,7 +683,7 @@ class FunctionsCustomServerTest extends Scope
$executionId = $execution['body']['$id'] ?? '';
$this->assertEquals(201, $execution['headers']['status-code']);
- sleep(15);
+ sleep(7);
$executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', array_merge([
'content-type' => 'application/json',
diff --git a/tests/resources/functions/timeout.tar.gz b/tests/resources/functions/timeout.tar.gz
index 16a2bec08bd936e2d6e0f9a864f409252763dcf5..d1c7c03b9e59c8043f7455f94d39f15e7266f935 100644
GIT binary patch
literal 166
zcmb2|=3oE;Cg!&nPjekI5NLh4=C?@XE4AENx1A2A3-V}m@aD40-`{e&X}Yh-$Ny%+
zX-twuA-Y}Jn;zVW*_=A}{H>ORIoI#`{1u4OUZTB!mcaGIJKux4_Psuq{ypw&{ghSy
z)1CLMEb%#dZwAx1Yj)@M$39uV)!6d?Ghz7;&wu8ZTmD=nb6z!TagP
ziE0xR<0EID+^Mso&vf_t$C0lttO&k%;Yl6GR^zbc@n>fQ+viwi`(EF6cysmoXZEYs
zd^?_NGd**Y8g2#U!{}C^my}zT%@LKI7=6^Q-uUe_ci~LnQW+H4JUstUNb_|Tj
P-_3B%bUrtO1_J{C`sPY2
diff --git a/tests/resources/functions/timeout/index.php b/tests/resources/functions/timeout/index.php
index 83cb8e1b56..8dfa09e88b 100644
--- a/tests/resources/functions/timeout/index.php
+++ b/tests/resources/functions/timeout/index.php
@@ -1,3 +1,3 @@
Date: Fri, 1 Jan 2021 11:01:18 +0200
Subject: [PATCH 056/230] Removed unrequired sleeps
---
tests/e2e/Services/Account/AccountBase.php | 3 ---
1 file changed, 3 deletions(-)
diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php
index 7bd96682d4..16c8926a7a 100644
--- a/tests/e2e/Services/Account/AccountBase.php
+++ b/tests/e2e/Services/Account/AccountBase.php
@@ -49,8 +49,6 @@ trait AccountBase
$this->assertEquals($response['headers']['status-code'], 409);
- sleep(5);
-
return [
'id' => $id,
'email' => $email,
@@ -64,7 +62,6 @@ trait AccountBase
*/
public function testCreateAccountSession($data):array
{
- sleep(10);
$email = $data['email'] ?? '';
$password = $data['password'] ?? '';
From 8017cfbd53d8750f3064369179b2e45e705ee83d Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Fri, 1 Jan 2021 11:04:30 +0200
Subject: [PATCH 057/230] removed docker cache comments
---
.travis.yml | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 3e729a988a..1eb92182f8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,16 +19,6 @@ before_install:
- echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json
- sudo service docker start
-# cache:
-# directories:
-# - docker_images
-
-# before_install:
-# - docker load -i docker_images/images.tar || true
-
-# before_cache:
-# - docker save -o docker_images/images.tar appwrite_appwrite
-
install:
- docker --version
- docker-compose up -d
From 0947490cddcd73e32721796a825ebedc5494597c Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Fri, 1 Jan 2021 11:56:53 +0200
Subject: [PATCH 058/230] Updated functions waiting times
---
tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
index a319f6ae27..5a8c1c89bc 100644
--- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
+++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
@@ -455,6 +455,8 @@ class FunctionsCustomServerTest extends Scope
public function testENVS():array
{
+ sleep(20);
+
/**
* Test for SUCCESS
*/
@@ -591,7 +593,7 @@ class FunctionsCustomServerTest extends Scope
$executionId = $execution['body']['$id'] ?? '';
$this->assertEquals(201, $execution['headers']['status-code']);
- sleep(15);
+ sleep(5);
$executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', array_merge([
'content-type' => 'application/json',
From 5ec8bcff4c578e8ab2c84bee2f09dbbe2b54cb60 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Fri, 1 Jan 2021 12:03:18 +0200
Subject: [PATCH 059/230] Fixed audit logs test
---
tests/e2e/Services/Account/AccountBase.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php
index 16c8926a7a..5476e04552 100644
--- a/tests/e2e/Services/Account/AccountBase.php
+++ b/tests/e2e/Services/Account/AccountBase.php
@@ -288,7 +288,7 @@ trait AccountBase
$this->assertNotEmpty($response['body']['logs']);
$this->assertCount(2, $response['body']['logs']);
- $this->assertEquals('account.sessions.create', $response['body']['logs'][0]['event']);
+ $this->assertContains($response['body']['logs'][0]['event'], ['account.create', 'account.sessions.create']);
$this->assertEquals($response['body']['logs'][0]['ip'], filter_var($response['body']['logs'][0]['ip'], FILTER_VALIDATE_IP));
$this->assertIsNumeric($response['body']['logs'][0]['time']);
@@ -298,7 +298,7 @@ trait AccountBase
$this->assertEquals('browser', $response['body']['logs'][0]['clientType']);
$this->assertEquals('Chrome', $response['body']['logs'][0]['clientName']);
- $this->assertEquals('CH', $response['body']['logs'][0]['clientCode']); // FIXME (v1) key name should be camelcase
+ $this->assertEquals('CH', $response['body']['logs'][0]['clientCode']);
$this->assertEquals('70.0', $response['body']['logs'][0]['clientVersion']);
$this->assertEquals('Blink', $response['body']['logs'][0]['clientEngine']);
@@ -310,7 +310,7 @@ trait AccountBase
$this->assertEquals('--', $response['body']['logs'][0]['countryCode']);
$this->assertEquals('Unknown', $response['body']['logs'][0]['countryName']);
- $this->assertEquals('account.create', $response['body']['logs'][1]['event']);
+ $this->assertContains($response['body']['logs'][1]['event'], ['account.create', 'account.sessions.create']);
$this->assertEquals($response['body']['logs'][1]['ip'], filter_var($response['body']['logs'][1]['ip'], FILTER_VALIDATE_IP));
$this->assertIsNumeric($response['body']['logs'][1]['time']);
@@ -320,7 +320,7 @@ trait AccountBase
$this->assertEquals('browser', $response['body']['logs'][1]['clientType']);
$this->assertEquals('Chrome', $response['body']['logs'][1]['clientName']);
- $this->assertEquals('CH', $response['body']['logs'][1]['clientCode']); // FIXME (v1) key name should be camelcase
+ $this->assertEquals('CH', $response['body']['logs'][1]['clientCode']);
$this->assertEquals('70.0', $response['body']['logs'][1]['clientVersion']);
$this->assertEquals('Blink', $response['body']['logs'][1]['clientEngine']);
From bc3ffd9df80e9e5f54b45d97d0747197be623b34 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Fri, 1 Jan 2021 16:09:04 +0200
Subject: [PATCH 060/230] Updated sleep time
---
tests/e2e/Scopes/Scope.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php
index 9de1f19417..fae34a87fb 100644
--- a/tests/e2e/Scopes/Scope.php
+++ b/tests/e2e/Scopes/Scope.php
@@ -33,7 +33,7 @@ abstract class Scope extends TestCase
protected function getLastEmail():array
{
- sleep(5);
+ sleep(10);
$emails = json_decode(file_get_contents('http://maildev/email'), true);
From 48534943669d06f4c3aceee59d5c4abd5d3a7281 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Fri, 1 Jan 2021 16:36:34 +0200
Subject: [PATCH 061/230] Debug docker status
---
.../Functions/FunctionsCustomServerTest.php | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
index 5a8c1c89bc..1e61a40a97 100644
--- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
+++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
@@ -455,8 +455,25 @@ class FunctionsCustomServerTest extends Scope
public function testENVS():array
{
+
+ $stdout = '';
+ $stderr = '';
+
+ $exitCode = Console::execute('docker ps --all'
+ , '', $stdout, $stderr, 30);
+
+ var_dump($stdout);
+
sleep(20);
+ $stdout = '';
+ $stderr = '';
+
+ $exitCode = Console::execute('docker ps --all'
+ , '', $stdout, $stderr, 30);
+
+ var_dump($stdout);
+
/**
* Test for SUCCESS
*/
From 3d61ea3a04e360c9fce0cb0c55b2262351164b3d Mon Sep 17 00:00:00 2001
From: kodumbeats
Date: Thu, 31 Dec 2020 16:30:14 -0500
Subject: [PATCH 062/230] add component to toggle visibility of secrets
---
gulpfile.js | 1 +
public/dist/scripts/app-all.js | 2 +-
public/dist/scripts/app.js | 2 +-
public/scripts/views/forms/show-secret.js | 32 +++++++++++++++++++++++
4 files changed, 35 insertions(+), 2 deletions(-)
create mode 100644 public/scripts/views/forms/show-secret.js
diff --git a/gulpfile.js b/gulpfile.js
index 04196ccf11..7e8ae0d02c 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -56,6 +56,7 @@ const configApp = {
'public/scripts/views/forms/remove.js',
'public/scripts/views/forms/run.js',
'public/scripts/views/forms/select-all.js',
+ 'public/scripts/views/forms/show-secret.js',
'public/scripts/views/forms/switch.js',
'public/scripts/views/forms/tags.js',
'public/scripts/views/forms/text-count.js',
diff --git a/public/dist/scripts/app-all.js b/public/dist/scripts/app-all.js
index 2bca538f4b..c11800c03a 100644
--- a/public/dist/scripts/app-all.js
+++ b/public/dist/scripts/app-all.js
@@ -2331,7 +2331,7 @@ score+=(variationCount-1)*10;return parseInt(score);};var callback=function(){va
if(rtl.isRTL(content)){paragraph.style.direction='rtl';paragraph.style.textAlign='right';}
else{paragraph.style.direction='ltr';paragraph.style.textAlign='left';}
last=paragraph;}};var santize=function(e){clean(e);alignText(e);};element.addEventListener("change",function(){editor.content.innerHTML=markdown.render(element.value);alignText();});editor.content.setAttribute("placeholder",element.placeholder);editor.content.innerHTML=markdown.render(element.value);editor.content.tabIndex=0;alignText();editor.content.onkeydown=function preventTab(event){if(event.which===9){event.preventDefault();if(document.activeElement){var focussable=Array.prototype.filter.call(document.querySelectorAll('a:not([disabled]), button:not([disabled]), select:not([disabled]), input[type=text]:not([disabled]), input[type=checkbox]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'),function(element){return(element.offsetWidth>0||element.offsetHeight>0||element===document.activeElement);});var index=focussable.indexOf(document.activeElement);if(index>-1){if(event.shiftKey){var prevElement=focussable[index-1]||focussable[focussable.length-1];prevElement.focus();}else{var nextElement=focussable[index+1]||focussable[0];nextElement.focus();}}}}};div.addEventListener("paste",santize);div.addEventListener("drop",santize);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-remove",controller:function(element){Array.prototype.slice.call(element.querySelectorAll("[data-remove]")).map(function(obj){obj.addEventListener("click",function(){element.parentNode.removeChild(element);});});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-run",repeat:false,controller:function(element,expression,container){let action=expression.parse(element.dataset["formsRun"]||'');element.addEventListener('click',function(){return container.path(action)();});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-select-all",controller:function(element){let select=document.createElement("button");let unselect=document.createElement("button");select.textContent='Select All';unselect.textContent='Unselect All';select.classList.add('link');select.classList.add('margin-top-tiny');select.classList.add('margin-start-small');select.classList.add('text-size-small');select.classList.add('pull-end');unselect.classList.add('link');unselect.classList.add('margin-top-tiny');unselect.classList.add('margin-start-small');unselect.classList.add('text-size-small');unselect.classList.add('pull-end');select.type='button';unselect.type='button';element.parentNode.insertBefore(select,element);element.parentNode.insertBefore(unselect,element);select.addEventListener('click',function(){let checkboxes=document.querySelectorAll("input[type='checkbox']");for(var i=0;i0){array.push(add.value);add.value="";element.value=JSON.stringify(array);check();if(event.key!=="Tab"){event.preventDefault();}}
if((event.key==="Backspace"||event.key==="Delete")&&add.value===""){array.splice(-1,1);element.value=JSON.stringify(array);check();}
return false;};let check=function(){try{array=JSON.parse(element.value)||[];}catch(error){array=[];}
diff --git a/public/dist/scripts/app.js b/public/dist/scripts/app.js
index 63fed54b1b..756463ccd0 100644
--- a/public/dist/scripts/app.js
+++ b/public/dist/scripts/app.js
@@ -376,7 +376,7 @@ score+=(variationCount-1)*10;return parseInt(score);};var callback=function(){va
if(rtl.isRTL(content)){paragraph.style.direction='rtl';paragraph.style.textAlign='right';}
else{paragraph.style.direction='ltr';paragraph.style.textAlign='left';}
last=paragraph;}};var santize=function(e){clean(e);alignText(e);};element.addEventListener("change",function(){editor.content.innerHTML=markdown.render(element.value);alignText();});editor.content.setAttribute("placeholder",element.placeholder);editor.content.innerHTML=markdown.render(element.value);editor.content.tabIndex=0;alignText();editor.content.onkeydown=function preventTab(event){if(event.which===9){event.preventDefault();if(document.activeElement){var focussable=Array.prototype.filter.call(document.querySelectorAll('a:not([disabled]), button:not([disabled]), select:not([disabled]), input[type=text]:not([disabled]), input[type=checkbox]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'),function(element){return(element.offsetWidth>0||element.offsetHeight>0||element===document.activeElement);});var index=focussable.indexOf(document.activeElement);if(index>-1){if(event.shiftKey){var prevElement=focussable[index-1]||focussable[focussable.length-1];prevElement.focus();}else{var nextElement=focussable[index+1]||focussable[0];nextElement.focus();}}}}};div.addEventListener("paste",santize);div.addEventListener("drop",santize);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-remove",controller:function(element){Array.prototype.slice.call(element.querySelectorAll("[data-remove]")).map(function(obj){obj.addEventListener("click",function(){element.parentNode.removeChild(element);});});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-run",repeat:false,controller:function(element,expression,container){let action=expression.parse(element.dataset["formsRun"]||'');element.addEventListener('click',function(){return container.path(action)();});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-select-all",controller:function(element){let select=document.createElement("button");let unselect=document.createElement("button");select.textContent='Select All';unselect.textContent='Unselect All';select.classList.add('link');select.classList.add('margin-top-tiny');select.classList.add('margin-start-small');select.classList.add('text-size-small');select.classList.add('pull-end');unselect.classList.add('link');unselect.classList.add('margin-top-tiny');unselect.classList.add('margin-start-small');unselect.classList.add('text-size-small');unselect.classList.add('pull-end');select.type='button';unselect.type='button';element.parentNode.insertBefore(select,element);element.parentNode.insertBefore(unselect,element);select.addEventListener('click',function(){let checkboxes=document.querySelectorAll("input[type='checkbox']");for(var i=0;i0){array.push(add.value);add.value="";element.value=JSON.stringify(array);check();if(event.key!=="Tab"){event.preventDefault();}}
if((event.key==="Backspace"||event.key==="Delete")&&add.value===""){array.splice(-1,1);element.value=JSON.stringify(array);check();}
return false;};let check=function(){try{array=JSON.parse(element.value)||[];}catch(error){array=[];}
diff --git a/public/scripts/views/forms/show-secret.js b/public/scripts/views/forms/show-secret.js
new file mode 100644
index 0000000000..6a870979ce
--- /dev/null
+++ b/public/scripts/views/forms/show-secret.js
@@ -0,0 +1,32 @@
+(function(window) {
+ "use strict";
+
+ window.ls.container.get("view").add({
+ selector: "data-forms-show-secret",
+ controller: function(element, document) {
+ let button = document.createElement("a");
+ button.type = "button";
+ button.className = "icon-eye";
+ button.innerHTML = "show/hide";
+ button.style.cursor = "pointer";
+ button.style.fontSize = "10px";
+
+ element.insertAdjacentElement("beforebegin", button);
+
+ const toggle = function(event) {
+ switch (element.type) { //TODO@kodumbeats: add closed-eye icon to public/styles/icons.less and toggle onClick
+ case "password":
+ element.type = "text";
+ break;
+ case "text":
+ element.type = "password";
+ break;
+ default:
+ console.warn("data-forms-show-secret: element.type NOT text NOR password")
+ };
+ };
+
+ button.addEventListener("click", toggle);
+ }
+ });
+ })(window);
From 5573613bacd7433ae857b1cbb06c4bc8f74c49a6 Mon Sep 17 00:00:00 2001
From: kodumbeats
Date: Thu, 31 Dec 2020 16:30:53 -0500
Subject: [PATCH 063/230] hide oAuth keys by default
---
app/views/console/users/index.phtml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/console/users/index.phtml b/app/views/console/users/index.phtml
index 4874083288..90b8f54007 100644
--- a/app/views/console/users/index.phtml
+++ b/app/views/console/users/index.phtml
@@ -339,7 +339,7 @@ $providers = $this->getParam('providers', []);
-
+
From 5d920963a4e912cabe8c8c377e53f06728981d37 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Fri, 1 Jan 2021 17:01:09 +0200
Subject: [PATCH 064/230] Debug tests
---
docker-compose.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/docker-compose.yml b/docker-compose.yml
index 701d1e240c..d3d021fd7e 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -55,6 +55,7 @@ services:
- traefik.http.routers.appwrite-secure.rule=PathPrefix(`/`)
- traefik.http.routers.appwrite-secure.tls=true
volumes:
+ - /var/run/docker.sock:/var/run/docker.sock
- appwrite-uploads:/storage/uploads:rw
- appwrite-cache:/storage/cache:rw
- appwrite-config:/storage/config:rw
From 5d45eebf221047207fb66f6baa4ef921ab69bb4d Mon Sep 17 00:00:00 2001
From: kodumbeats
Date: Fri, 1 Jan 2021 12:54:59 -0500
Subject: [PATCH 065/230] allow toggle for secret placed above/below input
---
public/dist/scripts/app-all.js | 3 +-
public/dist/scripts/app.js | 3 +-
public/scripts/views/forms/show-secret.js | 64 +++++++++++++----------
3 files changed, 39 insertions(+), 31 deletions(-)
diff --git a/public/dist/scripts/app-all.js b/public/dist/scripts/app-all.js
index c11800c03a..7f9841bb91 100644
--- a/public/dist/scripts/app-all.js
+++ b/public/dist/scripts/app-all.js
@@ -2331,7 +2331,8 @@ score+=(variationCount-1)*10;return parseInt(score);};var callback=function(){va
if(rtl.isRTL(content)){paragraph.style.direction='rtl';paragraph.style.textAlign='right';}
else{paragraph.style.direction='ltr';paragraph.style.textAlign='left';}
last=paragraph;}};var santize=function(e){clean(e);alignText(e);};element.addEventListener("change",function(){editor.content.innerHTML=markdown.render(element.value);alignText();});editor.content.setAttribute("placeholder",element.placeholder);editor.content.innerHTML=markdown.render(element.value);editor.content.tabIndex=0;alignText();editor.content.onkeydown=function preventTab(event){if(event.which===9){event.preventDefault();if(document.activeElement){var focussable=Array.prototype.filter.call(document.querySelectorAll('a:not([disabled]), button:not([disabled]), select:not([disabled]), input[type=text]:not([disabled]), input[type=checkbox]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'),function(element){return(element.offsetWidth>0||element.offsetHeight>0||element===document.activeElement);});var index=focussable.indexOf(document.activeElement);if(index>-1){if(event.shiftKey){var prevElement=focussable[index-1]||focussable[focussable.length-1];prevElement.focus();}else{var nextElement=focussable[index+1]||focussable[0];nextElement.focus();}}}}};div.addEventListener("paste",santize);div.addEventListener("drop",santize);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-remove",controller:function(element){Array.prototype.slice.call(element.querySelectorAll("[data-remove]")).map(function(obj){obj.addEventListener("click",function(){element.parentNode.removeChild(element);});});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-run",repeat:false,controller:function(element,expression,container){let action=expression.parse(element.dataset["formsRun"]||'');element.addEventListener('click',function(){return container.path(action)();});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-select-all",controller:function(element){let select=document.createElement("button");let unselect=document.createElement("button");select.textContent='Select All';unselect.textContent='Unselect All';select.classList.add('link');select.classList.add('margin-top-tiny');select.classList.add('margin-start-small');select.classList.add('text-size-small');select.classList.add('pull-end');unselect.classList.add('link');unselect.classList.add('margin-top-tiny');unselect.classList.add('margin-start-small');unselect.classList.add('text-size-small');unselect.classList.add('pull-end');select.type='button';unselect.type='button';element.parentNode.insertBefore(select,element);element.parentNode.insertBefore(unselect,element);select.addEventListener('click',function(){let checkboxes=document.querySelectorAll("input[type='checkbox']");for(var i=0;i0){array.push(add.value);add.value="";element.value=JSON.stringify(array);check();if(event.key!=="Tab"){event.preventDefault();}}
if((event.key==="Backspace"||event.key==="Delete")&&add.value===""){array.splice(-1,1);element.value=JSON.stringify(array);check();}
return false;};let check=function(){try{array=JSON.parse(element.value)||[];}catch(error){array=[];}
diff --git a/public/dist/scripts/app.js b/public/dist/scripts/app.js
index 756463ccd0..aaf4d119b9 100644
--- a/public/dist/scripts/app.js
+++ b/public/dist/scripts/app.js
@@ -376,7 +376,8 @@ score+=(variationCount-1)*10;return parseInt(score);};var callback=function(){va
if(rtl.isRTL(content)){paragraph.style.direction='rtl';paragraph.style.textAlign='right';}
else{paragraph.style.direction='ltr';paragraph.style.textAlign='left';}
last=paragraph;}};var santize=function(e){clean(e);alignText(e);};element.addEventListener("change",function(){editor.content.innerHTML=markdown.render(element.value);alignText();});editor.content.setAttribute("placeholder",element.placeholder);editor.content.innerHTML=markdown.render(element.value);editor.content.tabIndex=0;alignText();editor.content.onkeydown=function preventTab(event){if(event.which===9){event.preventDefault();if(document.activeElement){var focussable=Array.prototype.filter.call(document.querySelectorAll('a:not([disabled]), button:not([disabled]), select:not([disabled]), input[type=text]:not([disabled]), input[type=checkbox]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'),function(element){return(element.offsetWidth>0||element.offsetHeight>0||element===document.activeElement);});var index=focussable.indexOf(document.activeElement);if(index>-1){if(event.shiftKey){var prevElement=focussable[index-1]||focussable[focussable.length-1];prevElement.focus();}else{var nextElement=focussable[index+1]||focussable[0];nextElement.focus();}}}}};div.addEventListener("paste",santize);div.addEventListener("drop",santize);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-remove",controller:function(element){Array.prototype.slice.call(element.querySelectorAll("[data-remove]")).map(function(obj){obj.addEventListener("click",function(){element.parentNode.removeChild(element);});});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-run",repeat:false,controller:function(element,expression,container){let action=expression.parse(element.dataset["formsRun"]||'');element.addEventListener('click',function(){return container.path(action)();});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-select-all",controller:function(element){let select=document.createElement("button");let unselect=document.createElement("button");select.textContent='Select All';unselect.textContent='Unselect All';select.classList.add('link');select.classList.add('margin-top-tiny');select.classList.add('margin-start-small');select.classList.add('text-size-small');select.classList.add('pull-end');unselect.classList.add('link');unselect.classList.add('margin-top-tiny');unselect.classList.add('margin-start-small');unselect.classList.add('text-size-small');unselect.classList.add('pull-end');select.type='button';unselect.type='button';element.parentNode.insertBefore(select,element);element.parentNode.insertBefore(unselect,element);select.addEventListener('click',function(){let checkboxes=document.querySelectorAll("input[type='checkbox']");for(var i=0;i0){array.push(add.value);add.value="";element.value=JSON.stringify(array);check();if(event.key!=="Tab"){event.preventDefault();}}
if((event.key==="Backspace"||event.key==="Delete")&&add.value===""){array.splice(-1,1);element.value=JSON.stringify(array);check();}
return false;};let check=function(){try{array=JSON.parse(element.value)||[];}catch(error){array=[];}
diff --git a/public/scripts/views/forms/show-secret.js b/public/scripts/views/forms/show-secret.js
index 6a870979ce..41c0952830 100644
--- a/public/scripts/views/forms/show-secret.js
+++ b/public/scripts/views/forms/show-secret.js
@@ -1,32 +1,38 @@
-(function(window) {
- "use strict";
+(function (window) {
+ "use strict";
- window.ls.container.get("view").add({
- selector: "data-forms-show-secret",
- controller: function(element, document) {
- let button = document.createElement("a");
- button.type = "button";
- button.className = "icon-eye";
- button.innerHTML = "show/hide";
- button.style.cursor = "pointer";
- button.style.fontSize = "10px";
-
+ window.ls.container.get("view").add({
+ selector: "data-forms-show-secret",
+ controller: function (element, document) {
+ let button = document.createElement("a");
+ button.type = "button";
+ button.className = "icon-eye";
+ button.innerHTML = "show/hide";
+ button.style.cursor = "pointer";
+ button.style.fontSize = "10px";
+
+ if (element.attributes.getNamedItem("data-forms-show-secret-above")) {
element.insertAdjacentElement("beforebegin", button);
-
- const toggle = function(event) {
- switch (element.type) { //TODO@kodumbeats: add closed-eye icon to public/styles/icons.less and toggle onClick
- case "password":
- element.type = "text";
- break;
- case "text":
- element.type = "password";
- break;
- default:
- console.warn("data-forms-show-secret: element.type NOT text NOR password")
- };
- };
-
- button.addEventListener("click", toggle);
+ } else {
+ element.parentNode.insertBefore(button, element.nextSibling);
}
- });
- })(window);
+
+ const toggle = function (event) {
+ switch (element.type) {
+ case "password":
+ element.type = "text";
+ break;
+ case "text":
+ element.type = "password";
+ break;
+ default:
+ console.warn(
+ "data-forms-show-secret: element.type NOT text NOR password"
+ );
+ }
+ };
+
+ button.addEventListener("click", toggle);
+ },
+ });
+})(window);
From 27706aa8c827d9f046c9233b53dbf69f798ee226 Mon Sep 17 00:00:00 2001
From: kodumbeats
Date: Fri, 1 Jan 2021 12:55:49 -0500
Subject: [PATCH 066/230] add toggle to reveal http auth password
---
app/views/console/tasks/index.phtml | 4 ++--
app/views/console/webhooks/index.phtml | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/views/console/tasks/index.phtml b/app/views/console/tasks/index.phtml
index b03e0200f9..3d27971d45 100644
--- a/app/views/console/tasks/index.phtml
+++ b/app/views/console/tasks/index.phtml
@@ -189,7 +189,7 @@
-
+
@@ -335,7 +335,7 @@
-
+
diff --git a/app/views/console/webhooks/index.phtml b/app/views/console/webhooks/index.phtml
index 47c7d30f01..6625bf7a45 100644
--- a/app/views/console/webhooks/index.phtml
+++ b/app/views/console/webhooks/index.phtml
@@ -104,7 +104,7 @@ $events = array_keys($this->getParam('events', []));
-
+
@@ -220,7 +220,7 @@ $events = array_keys($this->getParam('events', []));
-
+
From 04f4f934aa1777a43c6526b892f9c208271ea975 Mon Sep 17 00:00:00 2001
From: kodumbeats
Date: Fri, 1 Jan 2021 12:55:57 -0500
Subject: [PATCH 067/230] move toggle above input
---
app/views/console/users/index.phtml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/console/users/index.phtml b/app/views/console/users/index.phtml
index 90b8f54007..9d97b05037 100644
--- a/app/views/console/users/index.phtml
+++ b/app/views/console/users/index.phtml
@@ -339,7 +339,7 @@ $providers = $this->getParam('providers', []);
-
+
From 94adabe828f9e9f3e06fa4830f01ec9e61f8f791 Mon Sep 17 00:00:00 2001
From: kodumbeats
Date: Fri, 1 Jan 2021 13:02:54 -0500
Subject: [PATCH 068/230] toggle visibility of secrets
---
CHANGES.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGES.md b/CHANGES.md
index 6185144417..cf584ab2a1 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -51,6 +51,7 @@
- Upgraded Influxdb Docker image to version 1.8 (alpine)
- Added option to disable mail sending by setting empty SMTP host
- Upgraded installation script ([#490](https://github.com/appwrite/appwrite/issues/490))
+- Added toggle to hide/show secret keys and passwords inside the dashboard (@kodumbeats, [#535](https://github.com/appwrite/appwrite/issues/535))
## Breaking Changes (Read before upgrading!)
- **Deprecated** `first` and `last` query params for documents list route in the database API
From 3d412640c60610a550d4f059f8af245e6ab6abab Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Fri, 1 Jan 2021 21:35:10 +0200
Subject: [PATCH 069/230] Updated logs
---
.../e2e/Services/Functions/FunctionsCustomServerTest.php | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
index 1e61a40a97..8c88ccdec5 100644
--- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
+++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
@@ -459,18 +459,16 @@ class FunctionsCustomServerTest extends Scope
$stdout = '';
$stderr = '';
- $exitCode = Console::execute('docker ps --all'
- , '', $stdout, $stderr, 30);
+ $exitCode = Console::execute('docker-compose logs appwrite-worker-functions', '', $stdout, $stderr, 30);
var_dump($stdout);
-
+
sleep(20);
$stdout = '';
$stderr = '';
- $exitCode = Console::execute('docker ps --all'
- , '', $stdout, $stderr, 30);
+ $exitCode = Console::execute('docker-compose logs appwrite-worker-functions', '', $stdout, $stderr, 30);
var_dump($stdout);
From 29b7d0c23d7b9be5673a14e08ad3a40457886244 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Sat, 2 Jan 2021 00:34:31 +0200
Subject: [PATCH 070/230] Updated logs
---
tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
index 8c88ccdec5..a9961b4455 100644
--- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
+++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
@@ -459,18 +459,20 @@ class FunctionsCustomServerTest extends Scope
$stdout = '';
$stderr = '';
- $exitCode = Console::execute('docker-compose logs appwrite-worker-functions', '', $stdout, $stderr, 30);
+ $exitCode = Console::execute('docker logs appwrite-worker-functions', '', $stdout, $stderr, 30);
var_dump($stdout);
+ var_dump($stderr);
sleep(20);
$stdout = '';
$stderr = '';
- $exitCode = Console::execute('docker-compose logs appwrite-worker-functions', '', $stdout, $stderr, 30);
+ $exitCode = Console::execute('docker logs appwrite-worker-functions', '', $stdout, $stderr, 30);
var_dump($stdout);
+ var_dump($stderr);
/**
* Test for SUCCESS
From 81d4c12688cecc05afe9ec2bf433252864e407c9 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Sat, 2 Jan 2021 01:11:58 +0200
Subject: [PATCH 071/230] Updated logs
---
tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
index a9961b4455..5dff06c9cc 100644
--- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
+++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
@@ -461,16 +461,18 @@ class FunctionsCustomServerTest extends Scope
$exitCode = Console::execute('docker logs appwrite-worker-functions', '', $stdout, $stderr, 30);
+ var_dump('-------------------------');
var_dump($stdout);
var_dump($stderr);
- sleep(20);
+ sleep(60);
$stdout = '';
$stderr = '';
$exitCode = Console::execute('docker logs appwrite-worker-functions', '', $stdout, $stderr, 30);
+ var_dump('-------------------------');
var_dump($stdout);
var_dump($stderr);
From 73e08974e48b5b8d276300cba2d0340f861240a0 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Sat, 2 Jan 2021 01:48:10 +0200
Subject: [PATCH 072/230] Build function locally on dev mode
---
app/config/environments.php | 8 ++++++++
app/workers/functions.php | 7 ++++++-
docker-compose.yml | 1 +
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/app/config/environments.php b/app/config/environments.php
index 11773eed4f..9119bee335 100644
--- a/app/config/environments.php
+++ b/app/config/environments.php
@@ -6,6 +6,7 @@ return [
'version' => '14.5',
'base' => 'node:14.5-alpine',
'image' => 'appwrite/env-node-14.5:1.0.0',
+ 'build' => '/usr/src/code/docker/environments/node-14.5',
'logo' => 'node.png',
],
'php-7.4' => [
@@ -13,6 +14,7 @@ return [
'version' => '7.4',
'base' => 'php:7.4-cli-alpine',
'image' => 'appwrite/env-php-7.4:1.0.0',
+ 'build' => '/usr/src/code/docker/environments/php-7.4',
'logo' => 'php.png',
],
'php-8.0' => [
@@ -20,6 +22,7 @@ return [
'version' => '8.0',
'base' => 'php:8.0-cli-alpine',
'image' => 'appwrite/env-php-8.0:1.0.0',
+ 'build' => '/usr/src/code/docker/environments/php-8.0',
'logo' => 'php.png',
],
'ruby-2.7' => [
@@ -27,6 +30,7 @@ return [
'version' => '2.7',
'base' => 'ruby:2.7-alpine',
'image' => 'appwrite/env-ruby-2.7:1.0.2',
+ 'build' => '/usr/src/code/docker/environments/ruby-2.7',
'logo' => 'ruby.png',
],
'python-3.8' => [
@@ -34,6 +38,7 @@ return [
'version' => '3.8',
'base' => 'python:3.8-alpine',
'image' => 'appwrite/env-python-3.8:1.0.0',
+ 'build' => '/usr/src/code/docker/environments/python-3.8',
'logo' => 'python.png',
],
'deno-1.2' => [
@@ -41,6 +46,7 @@ return [
'version' => '1.2',
'base' => 'hayd/deno:alpine-1.2.0',
'image' => 'appwrite/env-deno-1.2:1.0.0',
+ 'build' => '/usr/src/code/docker/environments/deno-1.2',
'logo' => 'deno.png',
],
'deno-1.5' => [
@@ -48,6 +54,7 @@ return [
'version' => '1.5',
'base' => 'hayd/deno:alpine-1.5.0',
'image' => 'appwrite/env-deno-1.5:1.0.0',
+ 'build' => '/usr/src/code/docker/environments/deno-1.5',
'logo' => 'deno.png',
],
// 'dart-2.8' => [
@@ -55,6 +62,7 @@ return [
// 'version' => '2.8',
// 'base' => 'google/dart:2.8',
// 'image' => 'appwrite/env-dart:2.8',
+ // 'build' => '/usr/src/code/docker/environments/dart-2.8',
// 'logo' => 'dart.png',
// ],
];
\ No newline at end of file
diff --git a/app/workers/functions.php b/app/workers/functions.php
index 510aed0922..37bf303d80 100644
--- a/app/workers/functions.php
+++ b/app/workers/functions.php
@@ -39,7 +39,12 @@ Co\run(function() use ($environments) { // Warmup: make sure images are ready t
Console::info('Warming up '.$environment['name'].' environment...');
- Console::execute('docker pull '.$environment['image'], '', $stdout, $stderr);
+ if(App::isDevelopment()) {
+ Console::execute('docker build '.$environment['build'].' -t '.$environment['image'], '', $stdout, $stderr);
+ }
+ else {
+ Console::execute('docker pull '.$environment['image'], '', $stdout, $stderr);
+ }
if(!empty($stdout)) {
Console::log($stdout);
diff --git a/docker-compose.yml b/docker-compose.yml
index d3d021fd7e..f80768dd7c 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -269,6 +269,7 @@ services:
- appwrite-functions:/storage/functions:rw
- /tmp:/tmp:rw
- ./app:/usr/src/code/app
+ - ./docker:/usr/src/code/docker
- ./src:/usr/src/code/src
depends_on:
- redis
From c9cd5b848a7f2de04af43b445c0dd5714d63ac7d Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Sat, 2 Jan 2021 02:10:13 +0200
Subject: [PATCH 073/230] Updated sleep
---
.../Functions/FunctionsCustomServerTest.php | 23 +------------------
1 file changed, 1 insertion(+), 22 deletions(-)
diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
index 5dff06c9cc..247b42cf63 100644
--- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
+++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
@@ -455,27 +455,6 @@ class FunctionsCustomServerTest extends Scope
public function testENVS():array
{
-
- $stdout = '';
- $stderr = '';
-
- $exitCode = Console::execute('docker logs appwrite-worker-functions', '', $stdout, $stderr, 30);
-
- var_dump('-------------------------');
- var_dump($stdout);
- var_dump($stderr);
-
- sleep(60);
-
- $stdout = '';
- $stderr = '';
-
- $exitCode = Console::execute('docker logs appwrite-worker-functions', '', $stdout, $stderr, 30);
-
- var_dump('-------------------------');
- var_dump($stdout);
- var_dump($stderr);
-
/**
* Test for SUCCESS
*/
@@ -612,7 +591,7 @@ class FunctionsCustomServerTest extends Scope
$executionId = $execution['body']['$id'] ?? '';
$this->assertEquals(201, $execution['headers']['status-code']);
- sleep(5);
+ sleep(20);
$executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', array_merge([
'content-type' => 'application/json',
From 01b0fcf99ce45543c11fcf7624e1b75b08cff63a Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Sat, 2 Jan 2021 08:49:20 +0200
Subject: [PATCH 074/230] updated timeout
---
tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
index 247b42cf63..d794cbdd64 100644
--- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
+++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php
@@ -683,7 +683,7 @@ class FunctionsCustomServerTest extends Scope
$executionId = $execution['body']['$id'] ?? '';
$this->assertEquals(201, $execution['headers']['status-code']);
- sleep(7);
+ sleep(15);
$executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', array_merge([
'content-type' => 'application/json',
From ad34b275dd7418ebabcaaf7887ef216d5d03cc7f Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sat, 2 Jan 2021 21:05:21 +0530
Subject: [PATCH 075/230] feat: review comments
---
app/controllers/general.php | 15 ++++++++-------
app/http.php | 5 -----
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/app/controllers/general.php b/app/controllers/general.php
index 316fb85e0c..c56b312357 100644
--- a/app/controllers/general.php
+++ b/app/controllers/general.php
@@ -100,14 +100,15 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
* Response format
*/
$responseFormat = $request->getHeader('x-appwrite-response-format', App::getEnv('_APP_SYSTEM_RESPONSE_FORMAT', ''));
- switch($responseFormat) {
- case version_compare ($responseFormat , '0.6.2', '=<') :
- Response::setFilter(new V06());
- break;
- default:
- throw new Exception('No filter available for response format : '.$responseFormat, 404);
+ if (!empty($responseFormat)) {
+ switch($responseFormat) {
+ case version_compare ($responseFormat , '0.6.2', '=<') :
+ Response::setFilter(new V06());
+ break;
+ default:
+ throw new Exception('No filter available for response format : '.$responseFormat, 400);
+ }
}
-
/*
* Security Headers
diff --git a/app/http.php b/app/http.php
index c409230418..9e27f21375 100644
--- a/app/http.php
+++ b/app/http.php
@@ -50,11 +50,6 @@ $http->on('AfterReload', function($serv, $workerId) {
$http->on('start', function (Server $http) use ($payloadSize) {
- if(empty($responseFormat)) {
- Console::error('Missing value for environment variable _APP_SYSTEM_RESPONSE_FORMAT. Exiting ...');
- exit(1);
- }
-
Console::success('Server started succefully (max payload is '.number_format($payloadSize).' bytes)');
Console::info("Master pid {$http->master_pid}, manager pid {$http->manager_pid}");
From d8561d030a3442e5d427fa7aa1b22d2da355928d Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sat, 2 Jan 2021 21:10:00 +0530
Subject: [PATCH 076/230] feat: added env varible
---
.env | 2 +-
Dockerfile | 2 +-
app/config/variables.php | 6 ++++++
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/.env b/.env
index 5484ea858b..ef84b538c0 100644
--- a/.env
+++ b/.env
@@ -31,4 +31,4 @@ _APP_FUNCTIONS_CPUS=1
_APP_FUNCTIONS_MEMORY=128
_APP_FUNCTIONS_MEMORY_SWAP=128
_APP_MAINTENANCE_INTERVAL=86400
-_APP_SYSTEM_RESPONSE_FORMAT=0.6
\ No newline at end of file
+_APP_SYSTEM_RESPONSE_FORMAT=0.7
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index cc72b5b776..7adeb42a18 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -97,7 +97,7 @@ ENV _APP_SERVER=swoole \
_APP_FUNCTIONS_MEMORY_SWAP=128 \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION \
- _APP_SYSTEM_RESPONSE_FORMAT=0.6 \
+ _APP_SYSTEM_RESPONSE_FORMAT=0.7 \
# 1 Day = 86400 s
_APP_MAINTENANCE_INTERVAL=86400
#ENV _APP_SMTP_SECURE ''
diff --git a/app/config/variables.php b/app/config/variables.php
index 0893dfd252..a0d4ba96c5 100644
--- a/app/config/variables.php
+++ b/app/config/variables.php
@@ -175,4 +175,10 @@ return [
'required' => false,
'question' => '',
],
+ [
+ 'name' => '_APP_SYSTEM_RESPONSE_FORMAT',
+ 'default' => '0.7',
+ 'required' => false,
+ 'question' => '',
+ ],
];
\ No newline at end of file
From 92339fe66898e8c7908292d913093c556621f5bf Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sat, 2 Jan 2021 21:45:14 +0530
Subject: [PATCH 077/230] fix: fix failing tests
---
src/Appwrite/Utopia/Response.php | 2 +-
tests/unit/Utopia/Filters/V06Test.php | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php
index 16fedaf8e1..9d1773a226 100644
--- a/src/Appwrite/Utopia/Response.php
+++ b/src/Appwrite/Utopia/Response.php
@@ -359,7 +359,7 @@ class Response extends SwooleResponse
*
* @return Filter
*/
- public static function getFilter(): Filter
+ public static function getFilter(): ?Filter
{
return self::$filter;
}
diff --git a/tests/unit/Utopia/Filters/V06Test.php b/tests/unit/Utopia/Filters/V06Test.php
index 2db87c8eb7..42b1bba3f2 100644
--- a/tests/unit/Utopia/Filters/V06Test.php
+++ b/tests/unit/Utopia/Filters/V06Test.php
@@ -9,6 +9,7 @@ use Appwrite\OpenSSL\OpenSSL;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Filter\V06;
use PHPUnit\Framework\TestCase;
+use Utopia\Config\Config;
class V06Test extends TestCase
{
From e499db64eab3a279505ee8114bce63ff5a67a912 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sat, 2 Jan 2021 21:58:09 +0530
Subject: [PATCH 078/230] fix: fix failing tests
---
.env | 2 +-
Dockerfile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.env b/.env
index ef84b538c0..5484ea858b 100644
--- a/.env
+++ b/.env
@@ -31,4 +31,4 @@ _APP_FUNCTIONS_CPUS=1
_APP_FUNCTIONS_MEMORY=128
_APP_FUNCTIONS_MEMORY_SWAP=128
_APP_MAINTENANCE_INTERVAL=86400
-_APP_SYSTEM_RESPONSE_FORMAT=0.7
\ No newline at end of file
+_APP_SYSTEM_RESPONSE_FORMAT=0.6
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 7adeb42a18..cc72b5b776 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -97,7 +97,7 @@ ENV _APP_SERVER=swoole \
_APP_FUNCTIONS_MEMORY_SWAP=128 \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION \
- _APP_SYSTEM_RESPONSE_FORMAT=0.7 \
+ _APP_SYSTEM_RESPONSE_FORMAT=0.6 \
# 1 Day = 86400 s
_APP_MAINTENANCE_INTERVAL=86400
#ENV _APP_SMTP_SECURE ''
From 83477651e60baa36a9c61efbd8a163cbc9086fcb Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sat, 2 Jan 2021 22:23:31 +0530
Subject: [PATCH 079/230] fix: fix failing tests
---
.env | 2 +-
Dockerfile | 2 +-
app/controllers/general.php | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.env b/.env
index 5484ea858b..bf61b2fd6d 100644
--- a/.env
+++ b/.env
@@ -31,4 +31,4 @@ _APP_FUNCTIONS_CPUS=1
_APP_FUNCTIONS_MEMORY=128
_APP_FUNCTIONS_MEMORY_SWAP=128
_APP_MAINTENANCE_INTERVAL=86400
-_APP_SYSTEM_RESPONSE_FORMAT=0.6
\ No newline at end of file
+_APP_SYSTEM_RESPONSE_FORMAT=0.6.2
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index cc72b5b776..f591751706 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -97,7 +97,7 @@ ENV _APP_SERVER=swoole \
_APP_FUNCTIONS_MEMORY_SWAP=128 \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION \
- _APP_SYSTEM_RESPONSE_FORMAT=0.6 \
+ _APP_SYSTEM_RESPONSE_FORMAT=0.6.2 \
# 1 Day = 86400 s
_APP_MAINTENANCE_INTERVAL=86400
#ENV _APP_SMTP_SECURE ''
diff --git a/app/controllers/general.php b/app/controllers/general.php
index c56b312357..ba0a64eb1e 100644
--- a/app/controllers/general.php
+++ b/app/controllers/general.php
@@ -102,7 +102,7 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
$responseFormat = $request->getHeader('x-appwrite-response-format', App::getEnv('_APP_SYSTEM_RESPONSE_FORMAT', ''));
if (!empty($responseFormat)) {
switch($responseFormat) {
- case version_compare ($responseFormat , '0.6.2', '=<') :
+ case version_compare ($responseFormat , '0.6.2', '<=') :
Response::setFilter(new V06());
break;
default:
From 7ed759ba0ee6035362c474aae15aecd04a867377 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Sat, 2 Jan 2021 21:45:59 +0200
Subject: [PATCH 080/230] First commit
---
.env | 3 +++
Dockerfile | 2 ++
app/config/variables.php | 18 ++++++++++++++++++
app/controllers/api/health.php | 3 ++-
app/controllers/api/storage.php | 3 ++-
app/tasks/doctor.php | 3 ++-
docker-compose.yml | 3 +++
7 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/.env b/.env
index f881ca35d3..1277c28eff 100644
--- a/.env
+++ b/.env
@@ -15,6 +15,9 @@ _APP_DB_PORT=3306
_APP_DB_SCHEMA=appwrite
_APP_DB_USER=user
_APP_DB_PASS=password
+_APP_STORAGE_ANTIVIRUS=enabled
+_APP_STORAGE_ANTIVIRUS_HOST=clamav
+_APP_STORAGE_ANTIVIRUS_PORT=3310
_APP_INFLUXDB_HOST=influxdb
_APP_INFLUXDB_PORT=8086
_APP_STATSD_HOST=telegraf
diff --git a/Dockerfile b/Dockerfile
index fc7a03f936..9c48f9a4fc 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -77,6 +77,8 @@ ENV _APP_SERVER=swoole \
_APP_OPENSSL_KEY_V1=your-secret-key \
_APP_STORAGE_LIMIT=10000000 \
_APP_STORAGE_ANTIVIRUS=enabled \
+ _APP_STORAGE_ANTIVIRUS_HOST=clamav \
+ _APP_STORAGE_ANTIVIRUS_PORT=3310 \
_APP_REDIS_HOST=redis \
_APP_REDIS_PORT=6379 \
_APP_DB_HOST=mariadb \
diff --git a/app/config/variables.php b/app/config/variables.php
index f752e90201..fb32000762 100644
--- a/app/config/variables.php
+++ b/app/config/variables.php
@@ -139,6 +139,24 @@ return [
'required' => false,
'question' => '',
],
+ [
+ 'name' => '_APP_STORAGE_ANTIVIRUS',
+ 'default' => 'enabled',
+ 'required' => false,
+ 'question' => '',
+ ],
+ [
+ 'name' => '_APP_STORAGE_ANTIVIRUS_HOST',
+ 'default' => 'clamav',
+ 'required' => false,
+ 'question' => '',
+ ],
+ [
+ 'name' => '_APP_STORAGE_ANTIVIRUS_PORT',
+ 'default' => '3310',
+ 'required' => false,
+ 'question' => '',
+ ],
[
'name' => '_APP_FUNCTIONS_TIMEOUT',
'default' => '900',
diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php
index c1c9de4755..370b2d0a17 100644
--- a/app/controllers/api/health.php
+++ b/app/controllers/api/health.php
@@ -256,7 +256,8 @@ App::get('/v1/health/anti-virus')
throw new Exception('Anitvirus is disabled');
}
- $antiVirus = new Network('clamav', 3310);
+ $antiVirus = new Network(App::getEnv('_APP_STORAGE_ANTIVIRUS_HOST', 'clamav'),
+ (int) App::getEnv('_APP_STORAGE_ANTIVIRUS_PORT', 3310));
$response->json([
'status' => (@$antiVirus->ping()) ? 'online' : 'offline',
diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php
index b7628e320b..b70fe9f950 100644
--- a/app/controllers/api/storage.php
+++ b/app/controllers/api/storage.php
@@ -96,7 +96,8 @@ App::post('/v1/storage/files')
$mimeType = $device->getFileMimeType($path); // Get mime-type before compression and encryption
if (App::getEnv('_APP_STORAGE_ANTIVIRUS') === 'enabled') { // Check if scans are enabled
- $antiVirus = new Network('clamav', 3310);
+ $antiVirus = new Network(App::getEnv('_APP_STORAGE_ANTIVIRUS_HOST', 'clamav'),
+ (int) App::getEnv('_APP_STORAGE_ANTIVIRUS_PORT', 3310));
if (!$antiVirus->fileScan($path)) {
$device->delete($path);
diff --git a/app/tasks/doctor.php b/app/tasks/doctor.php
index 70a7546b2a..e3985c8e75 100644
--- a/app/tasks/doctor.php
+++ b/app/tasks/doctor.php
@@ -113,7 +113,8 @@ $cli
if(App::getEnv('_APP_STORAGE_ANTIVIRUS') === 'enabled') { // Check if scans are enabled
try {
- $antiVirus = new Network('clamav', 3310);
+ $antiVirus = new Network(App::getEnv('_APP_STORAGE_ANTIVIRUS_HOST', 'clamav'),
+ (int) App::getEnv('_APP_STORAGE_ANTIVIRUS_PORT', 3310));
if((@$antiVirus->ping())) {
Console::success('AntiVirus...........connected 👍');
diff --git a/docker-compose.yml b/docker-compose.yml
index 701d1e240c..b4fb435275 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -91,6 +91,9 @@ services:
- _APP_DB_SCHEMA
- _APP_DB_USER
- _APP_DB_PASS
+ - _APP_STORAGE_ANTIVIRUS
+ - _APP_STORAGE_ANTIVIRUS_HOST
+ - _APP_STORAGE_ANTIVIRUS_PORT
- _APP_SMTP_HOST
- _APP_SMTP_PORT
- _APP_SMTP_SECURE
From 0812a6b82d9e6ec20fac2678cde9a4dafebfd3a6 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Sat, 2 Jan 2021 21:47:23 +0200
Subject: [PATCH 081/230] Updated changelog
---
CHANGES.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGES.md b/CHANGES.md
index 6185144417..bb1fbf9c09 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -51,6 +51,7 @@
- Upgraded Influxdb Docker image to version 1.8 (alpine)
- Added option to disable mail sending by setting empty SMTP host
- Upgraded installation script ([#490](https://github.com/appwrite/appwrite/issues/490))
+- Added new environment variables for ClamAV hostname and port ([#780](https://github.com/appwrite/appwrite/pull/780))
## Breaking Changes (Read before upgrading!)
- **Deprecated** `first` and `last` query params for documents list route in the database API
From 9b1b5d3a7ee305887a9557ebf1b84143bac6758d Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sun, 3 Jan 2021 23:37:19 +0530
Subject: [PATCH 082/230] feat: review comments
---
app/controllers/general.php | 2 ++
app/http.php | 1 -
src/Appwrite/Utopia/Response.php | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/controllers/general.php b/app/controllers/general.php
index ba0a64eb1e..ed45f528dd 100644
--- a/app/controllers/general.php
+++ b/app/controllers/general.php
@@ -108,6 +108,8 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
default:
throw new Exception('No filter available for response format : '.$responseFormat, 400);
}
+ } else {
+ Response::setFilter(null);
}
/*
diff --git a/app/http.php b/app/http.php
index 9e27f21375..b3d7dcaac7 100644
--- a/app/http.php
+++ b/app/http.php
@@ -23,7 +23,6 @@ error_reporting(E_ALL);
$http = new Server("0.0.0.0", 80);
$payloadSize = max(4000000 /* 4mb */, App::getEnv('_APP_STORAGE_LIMIT', 10000000 /* 10mb */));
-$responseFormat = App::getEnv('_APP_SYSTEM_RESPONSE_FORMAT', '');
$http
->set([
diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php
index 9d1773a226..1fa4962bc7 100644
--- a/src/Appwrite/Utopia/Response.php
+++ b/src/Appwrite/Utopia/Response.php
@@ -349,7 +349,7 @@ class Response extends SwooleResponse
*
* @return void
*/
- public static function setFilter(Filter $filter)
+ public static function setFilter(?Filter $filter)
{
self::$filter = $filter;
}
From 50bca50d10e24674379b61b3f60d33c83d376594 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sun, 3 Jan 2021 23:42:11 +0530
Subject: [PATCH 083/230] feat: review comments
---
.env | 2 +-
Dockerfile | 1 -
app/config/variables.php | 2 +-
src/Appwrite/Utopia/Response.php | 14 +++++++++-----
4 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/.env b/.env
index bf61b2fd6d..c3a0d93d8c 100644
--- a/.env
+++ b/.env
@@ -31,4 +31,4 @@ _APP_FUNCTIONS_CPUS=1
_APP_FUNCTIONS_MEMORY=128
_APP_FUNCTIONS_MEMORY_SWAP=128
_APP_MAINTENANCE_INTERVAL=86400
-_APP_SYSTEM_RESPONSE_FORMAT=0.6.2
\ No newline at end of file
+_APP_SYSTEM_RESPONSE_FORMAT=
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index f591751706..fb578a6f1a 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -97,7 +97,6 @@ ENV _APP_SERVER=swoole \
_APP_FUNCTIONS_MEMORY_SWAP=128 \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION \
- _APP_SYSTEM_RESPONSE_FORMAT=0.6.2 \
# 1 Day = 86400 s
_APP_MAINTENANCE_INTERVAL=86400
#ENV _APP_SMTP_SECURE ''
diff --git a/app/config/variables.php b/app/config/variables.php
index a0d4ba96c5..82670c23a0 100644
--- a/app/config/variables.php
+++ b/app/config/variables.php
@@ -177,7 +177,7 @@ return [
],
[
'name' => '_APP_SYSTEM_RESPONSE_FORMAT',
- 'default' => '0.7',
+ 'default' => '',
'required' => false,
'question' => '',
],
diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php
index 1fa4962bc7..ce22df225e 100644
--- a/src/Appwrite/Utopia/Response.php
+++ b/src/Appwrite/Utopia/Response.php
@@ -250,7 +250,15 @@ class Response extends SwooleResponse
*/
public function dynamic(Document $document, string $model): void
{
- $this->json($this->output($document, $model));
+ $output = $this->output($document, $model);
+
+ // If filter is set, parse the item
+ if(self::isFilter()){
+ $item = self::getFilter()->parse($output, $model);
+ }
+
+ $this->json($output);
+
}
/**
@@ -293,10 +301,6 @@ class Response extends SwooleResponse
}
$item = $this->output($item, $rule['type']);
- // If filter is set, parse the item
- if(self::isFilter()){
- $item = self::getFilter()->parse($item, $rule['type']);
- }
}
}
}
From 287bef7a6ce490ddfb8800d922cb659506c880df Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 4 Jan 2021 00:33:23 +0200
Subject: [PATCH 084/230] Init new SDK
---
README.md | 1 +
app/config/environments.php | 4 +-
app/config/platforms.php | 29 ++--
composer.json | 2 +-
composer.lock | 275 +++++++++++++++++++-----------------
5 files changed, 164 insertions(+), 147 deletions(-)
diff --git a/README.md b/README.md
index ea3ee938b9..f5dea89bf7 100644
--- a/README.md
+++ b/README.md
@@ -124,6 +124,7 @@ Below is a list of currently supported platforms and languages. If you wish to h
* ✅ [Deno](https://github.com/appwrite/sdk-for-deno) - **Beta** (Maintained by the Appwrite Team)
* ✅ [Ruby](https://github.com/appwrite/sdk-for-ruby) - **Beta** (Maintained by the Appwrite Team)
* ✅ [Python](https://github.com/appwrite/sdk-for-python) - **Beta** (Maintained by the Appwrite Team)
+* ✅ [C#](https://github.com/appwrite/sdk-for-csharp) - **Expiremental** (Maintained by the Appwrite Team)
* ✅ [Go](https://github.com/appwrite/sdk-for-go) **Work in progress** (Maintained by the Appwrite Team)
* ✅ [Dart](https://github.com/appwrite/sdk-for-dart) **Work in progress** (Maintained by the Appwrite Team)
diff --git a/app/config/environments.php b/app/config/environments.php
index 9119bee335..228e7e4608 100644
--- a/app/config/environments.php
+++ b/app/config/environments.php
@@ -1,5 +1,7 @@
[
'name' => 'Node.js',
diff --git a/app/config/platforms.php b/app/config/platforms.php
index c9a3f25b59..8b751e436d 100644
--- a/app/config/platforms.php
+++ b/app/config/platforms.php
@@ -20,7 +20,6 @@ return [
'package' => 'https://www.npmjs.com/package/appwrite',
'enabled' => true,
'beta' => false,
- 'dev' => false,
'family' => APP_PLATFORM_CLIENT,
'prism' => 'javascript',
'source' => \realpath(__DIR__ . '/../sdks/client-web'),
@@ -36,7 +35,6 @@ return [
'package' => 'https://pub.dev/packages/appwrite',
'enabled' => true,
'beta' => true,
- 'dev' => false,
'family' => APP_PLATFORM_CLIENT,
'prism' => 'dart',
'source' => \realpath(__DIR__ . '/../sdks/client-flutter'),
@@ -51,7 +49,6 @@ return [
'package' => '',
'enabled' => false,
'beta' => false,
- 'dev' => false,
'family' => APP_PLATFORM_CLIENT,
'prism' => 'swift',
'source' => false,
@@ -66,7 +63,6 @@ return [
'package' => '',
'enabled' => false,
'beta' => false,
- 'dev' => false,
'family' => APP_PLATFORM_CLIENT,
'prism' => '',
'source' => false,
@@ -81,7 +77,6 @@ return [
'package' => '',
'enabled' => false,
'beta' => false,
- 'dev' => false,
'family' => APP_PLATFORM_CLIENT,
'prism' => 'kotlin',
'source' => false,
@@ -120,7 +115,6 @@ return [
'package' => '',
'enabled' => true,
'beta' => false,
- 'dev' => false,
'family' => APP_PLATFORM_CONSOLE,
'prism' => 'console',
'source' => \realpath(__DIR__ . '/../sdks/console-web'),
@@ -146,7 +140,6 @@ return [
'package' => 'https://www.npmjs.com/package/node-appwrite',
'enabled' => true,
'beta' => false,
- 'dev' => false,
'family' => APP_PLATFORM_SERVER,
'prism' => 'javascript',
'source' => \realpath(__DIR__ . '/../sdks/server-nodejs'),
@@ -162,7 +155,6 @@ return [
'package' => 'https://deno.land/x/appwrite',
'enabled' => true,
'beta' => true,
- 'dev' => false,
'family' => APP_PLATFORM_SERVER,
'prism' => 'typescript',
'source' => \realpath(__DIR__ . '/../sdks/server-deno'),
@@ -178,7 +170,6 @@ return [
'package' => 'https://packagist.org/packages/appwrite/appwrite',
'enabled' => true,
'beta' => false,
- 'dev' => false,
'family' => APP_PLATFORM_SERVER,
'prism' => 'php',
'source' => \realpath(__DIR__ . '/../sdks/server-php'),
@@ -194,7 +185,6 @@ return [
'package' => 'https://pypi.org/project/appwrite/',
'enabled' => true,
'beta' => true,
- 'dev' => false,
'family' => APP_PLATFORM_SERVER,
'prism' => 'python',
'source' => \realpath(__DIR__ . '/../sdks/server-python'),
@@ -210,7 +200,6 @@ return [
'package' => 'https://rubygems.org/gems/appwrite',
'enabled' => true,
'beta' => true,
- 'dev' => false,
'family' => APP_PLATFORM_SERVER,
'prism' => 'ruby',
'source' => \realpath(__DIR__ . '/../sdks/server-ruby'),
@@ -226,7 +215,6 @@ return [
'package' => '',
'enabled' => false,
'beta' => true,
- 'dev' => false,
'family' => APP_PLATFORM_SERVER,
'prism' => 'go',
'source' => \realpath(__DIR__ . '/../sdks/server-go'),
@@ -242,7 +230,6 @@ return [
'package' => '',
'enabled' => false,
'beta' => true,
- 'dev' => false,
'family' => APP_PLATFORM_SERVER,
'prism' => 'java',
'source' => \realpath(__DIR__ . '/../sdks/server-java'),
@@ -250,6 +237,21 @@ return [
'gitRepoName' => 'sdk-for-java',
'gitUserName' => 'appwrite',
],
+ [
+ 'key' => 'csharp',
+ 'name' => 'CSharp',
+ 'version' => '0.0.1',
+ 'url' => 'https://github.com/appwrite/sdk-for-csharp',
+ 'package' => '',
+ 'enabled' => true,
+ 'beta' => true,
+ 'family' => APP_PLATFORM_SERVER,
+ 'prism' => 'csharp',
+ 'source' => \realpath(__DIR__ . '/../sdks/server-csharp'),
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-csharp.git',
+ 'gitRepoName' => 'sdk-for-csharp',
+ 'gitUserName' => 'appwrite',
+ ],
[
'key' => 'dart',
'name' => 'Dart',
@@ -258,7 +260,6 @@ return [
'package' => '',
'enabled' => false,
'beta' => true,
- 'dev' => false,
'family' => APP_PLATFORM_SERVER,
'prism' => 'java',
'source' => \realpath(__DIR__ . '/../sdks/server-dart'),
diff --git a/composer.json b/composer.json
index bf9f354acc..97d2263952 100644
--- a/composer.json
+++ b/composer.json
@@ -56,7 +56,7 @@
},
"require-dev": {
"swoole/ide-helper": "4.5.5",
- "appwrite/sdk-generator": "0.2.3",
+ "appwrite/sdk-generator": "0.3.0",
"phpunit/phpunit": "9.4.2",
"vimeo/psalm": "4.1.1"
},
diff --git a/composer.lock b/composer.lock
index 500c67d954..606dd5fd67 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "aa1bf812ee6a45af12cdfbbfb7229471",
+ "content-hash": "57a43a1cab8459494f031551fe83ffb5",
"packages": [
{
"name": "appwrite/php-clamav",
@@ -1158,9 +1158,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/abuse/issues",
- "source": "https://github.com/utopia-php/abuse/tree/0.2.2"
+ "source": "https://github.com/utopia-php/abuse/tree/0.3.1"
},
- "time": "2020-10-23T06:51:42+00:00"
+ "time": "2020-12-21T17:28:03+00:00"
},
{
"name": "utopia-php/audit",
@@ -1210,9 +1210,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/audit/issues",
- "source": "https://github.com/utopia-php/audit/tree/0.3.2"
+ "source": "https://github.com/utopia-php/audit/tree/0.5.1"
},
- "time": "2020-10-23T08:09:44+00:00"
+ "time": "2020-12-21T17:28:53+00:00"
},
{
"name": "utopia-php/cache",
@@ -1315,9 +1315,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/cli/issues",
- "source": "https://github.com/utopia-php/cli/tree/0.7.3"
+ "source": "https://github.com/utopia-php/cli/tree/0.8"
},
- "time": "2020-11-02T07:50:18+00:00"
+ "time": "2020-12-14T06:31:42+00:00"
},
{
"name": "utopia-php/config",
@@ -1858,11 +1858,11 @@
},
{
"name": "appwrite/sdk-generator",
- "version": "0.2.3",
+ "version": "0.3.0",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator",
- "reference": "6b564fef01fd681023c1d465783931bade04468d"
+ "reference": "f0a6ecf92869012dd546ec503c69177dce0f9d90"
},
"require": {
"ext-curl": "*",
@@ -1875,7 +1875,6 @@
"require-dev": {
"phpunit/phpunit": "^7.0"
},
- "default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
@@ -1893,7 +1892,7 @@
}
],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
- "time": "2020-12-23T21:58:58+00:00"
+ "time": "2021-01-03T21:23:24+00:00"
},
{
"name": "composer/package-versions-deprecated",
@@ -1901,12 +1900,12 @@
"source": {
"type": "git",
"url": "https://github.com/composer/package-versions-deprecated.git",
- "reference": "64291c788b9a18272346decf566931e33a317399"
+ "reference": "f921205948ab93bb19f86327c793a81edb62f236"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/64291c788b9a18272346decf566931e33a317399",
- "reference": "64291c788b9a18272346decf566931e33a317399",
+ "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/f921205948ab93bb19f86327c793a81edb62f236",
+ "reference": "f921205948ab93bb19f86327c793a81edb62f236",
"shasum": ""
},
"require": {
@@ -1967,7 +1966,7 @@
"type": "tidelift"
}
],
- "time": "2020-11-12T09:39:33+00:00"
+ "time": "2020-12-27T20:11:05+00:00"
},
{
"name": "composer/semver",
@@ -2324,16 +2323,16 @@
},
{
"name": "matthiasmullie/minify",
- "version": "1.3.64",
+ "version": "1.3.65",
"source": {
"type": "git",
"url": "https://github.com/matthiasmullie/minify.git",
- "reference": "38f9d58c739687e269f46c6dff4647de9e2eb855"
+ "reference": "227f19062451c55a797e0cc667ef983834e6580c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/38f9d58c739687e269f46c6dff4647de9e2eb855",
- "reference": "38f9d58c739687e269f46c6dff4647de9e2eb855",
+ "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/227f19062451c55a797e0cc667ef983834e6580c",
+ "reference": "227f19062451c55a797e0cc667ef983834e6580c",
"shasum": ""
},
"require": {
@@ -2382,9 +2381,23 @@
],
"support": {
"issues": "https://github.com/matthiasmullie/minify/issues",
- "source": "https://github.com/matthiasmullie/minify/tree/1.3.64"
+ "source": "https://github.com/matthiasmullie/minify/tree/1.3.65"
},
- "time": "2020-12-23T13:37:53+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/[user1",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/matthiasmullie] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g.",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/user2",
+ "type": "github"
+ }
+ ],
+ "time": "2020-12-27T21:43:29+00:00"
},
{
"name": "matthiasmullie/path-converter",
@@ -3004,12 +3017,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "ad44fae76b874e7d49afb6923a66591e0a94bef6"
+ "reference": "cbe315f4d3b653ac0310862697866ffddabc502f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ad44fae76b874e7d49afb6923a66591e0a94bef6",
- "reference": "ad44fae76b874e7d49afb6923a66591e0a94bef6",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/cbe315f4d3b653ac0310862697866ffddabc502f",
+ "reference": "cbe315f4d3b653ac0310862697866ffddabc502f",
"shasum": ""
},
"require": {
@@ -3065,7 +3078,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/master"
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2"
},
"funding": [
{
@@ -3073,7 +3086,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:26:22+00:00"
+ "time": "2021-01-02T06:24:37+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -3081,12 +3094,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "544be757d192233486ad9119dcb297ebbf5f2dd4"
+ "reference": "cdb8225b328ef5e9647049954299211804000ce0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/544be757d192233486ad9119dcb297ebbf5f2dd4",
- "reference": "544be757d192233486ad9119dcb297ebbf5f2dd4",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cdb8225b328ef5e9647049954299211804000ce0",
+ "reference": "cdb8225b328ef5e9647049954299211804000ce0",
"shasum": ""
},
"require": {
@@ -3134,7 +3147,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:43+00:00"
+ "time": "2021-01-02T06:22:20+00:00"
},
{
"name": "phpunit/php-invoker",
@@ -3142,12 +3155,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-invoker.git",
- "reference": "05210af8d0ab68c811ae61a4bc42b066d62b88a0"
+ "reference": "6fdda2828180f7d86cf66d822e6ad4bc124baf5d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/05210af8d0ab68c811ae61a4bc42b066d62b88a0",
- "reference": "05210af8d0ab68c811ae61a4bc42b066d62b88a0",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/6fdda2828180f7d86cf66d822e6ad4bc124baf5d",
+ "reference": "6fdda2828180f7d86cf66d822e6ad4bc124baf5d",
"shasum": ""
},
"require": {
@@ -3198,7 +3211,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:51+00:00"
+ "time": "2021-01-02T06:22:25+00:00"
},
{
"name": "phpunit/php-text-template",
@@ -3206,12 +3219,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "c1abda6e0590f8e7138eb48ade2f0b21a5c4257b"
+ "reference": "081fc9efc54b1b858b3497c142d82a0c36bc6755"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/c1abda6e0590f8e7138eb48ade2f0b21a5c4257b",
- "reference": "c1abda6e0590f8e7138eb48ade2f0b21a5c4257b",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/081fc9efc54b1b858b3497c142d82a0c36bc6755",
+ "reference": "081fc9efc54b1b858b3497c142d82a0c36bc6755",
"shasum": ""
},
"require": {
@@ -3258,7 +3271,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:28:23+00:00"
+ "time": "2021-01-02T06:22:47+00:00"
},
{
"name": "phpunit/php-timer",
@@ -3266,12 +3279,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "59e401088c91efeb76150f0a301aa79e3ac95fd1"
+ "reference": "2194371fec37b03cfda3f8ab08aee33787350228"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/59e401088c91efeb76150f0a301aa79e3ac95fd1",
- "reference": "59e401088c91efeb76150f0a301aa79e3ac95fd1",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2194371fec37b03cfda3f8ab08aee33787350228",
+ "reference": "2194371fec37b03cfda3f8ab08aee33787350228",
"shasum": ""
},
"require": {
@@ -3318,7 +3331,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:59+00:00"
+ "time": "2021-01-02T06:22:31+00:00"
},
{
"name": "phpunit/phpunit",
@@ -3483,12 +3496,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/cli-parser.git",
- "reference": "7605547e80bf845bc2c1b2cc3f8ac0f5574caa63"
+ "reference": "1012bd8df812778b8386c5e76cacd85b45cf329e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/7605547e80bf845bc2c1b2cc3f8ac0f5574caa63",
- "reference": "7605547e80bf845bc2c1b2cc3f8ac0f5574caa63",
+ "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/1012bd8df812778b8386c5e76cacd85b45cf329e",
+ "reference": "1012bd8df812778b8386c5e76cacd85b45cf329e",
"shasum": ""
},
"require": {
@@ -3532,7 +3545,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:28:52+00:00"
+ "time": "2021-01-02T06:23:03+00:00"
},
{
"name": "sebastian/code-unit",
@@ -3596,12 +3609,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
- "reference": "f861b90785c30dc0743554f0e615d8f950dc8e9d"
+ "reference": "f0a408b6519db241e624a62576dc5871d4ac8c14"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/f861b90785c30dc0743554f0e615d8f950dc8e9d",
- "reference": "f861b90785c30dc0743554f0e615d8f950dc8e9d",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/f0a408b6519db241e624a62576dc5871d4ac8c14",
+ "reference": "f0a408b6519db241e624a62576dc5871d4ac8c14",
"shasum": ""
},
"require": {
@@ -3644,7 +3657,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:26:38+00:00"
+ "time": "2021-01-02T06:21:36+00:00"
},
{
"name": "sebastian/comparator",
@@ -3652,12 +3665,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "1cfe9edf7ec9e4c18e54bb259110a053d09a899f"
+ "reference": "fe4c68c639d9e580ec31bfc88b32641dc80a08d0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1cfe9edf7ec9e4c18e54bb259110a053d09a899f",
- "reference": "1cfe9edf7ec9e4c18e54bb259110a053d09a899f",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fe4c68c639d9e580ec31bfc88b32641dc80a08d0",
+ "reference": "fe4c68c639d9e580ec31bfc88b32641dc80a08d0",
"shasum": ""
},
"require": {
@@ -3719,7 +3732,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:38:43+00:00"
+ "time": "2021-01-02T06:21:42+00:00"
},
{
"name": "sebastian/complexity",
@@ -3727,12 +3740,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/complexity.git",
- "reference": "23030bf3d3722767fdc5f8f2d2d99b03f4e58122"
+ "reference": "c182133e92fc7a8b0a923b5d20f3a9fdfa534818"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/23030bf3d3722767fdc5f8f2d2d99b03f4e58122",
- "reference": "23030bf3d3722767fdc5f8f2d2d99b03f4e58122",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/c182133e92fc7a8b0a923b5d20f3a9fdfa534818",
+ "reference": "c182133e92fc7a8b0a923b5d20f3a9fdfa534818",
"shasum": ""
},
"require": {
@@ -3777,7 +3790,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:28:32+00:00"
+ "time": "2021-01-02T06:22:53+00:00"
},
{
"name": "sebastian/diff",
@@ -3785,12 +3798,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "02178c586d5fbd59d348798d7122237a2907f8a4"
+ "reference": "33f7bf3c1741b2a10e16d5c41c369c402b933e4c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/02178c586d5fbd59d348798d7122237a2907f8a4",
- "reference": "02178c586d5fbd59d348798d7122237a2907f8a4",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/33f7bf3c1741b2a10e16d5c41c369c402b933e4c",
+ "reference": "33f7bf3c1741b2a10e16d5c41c369c402b933e4c",
"shasum": ""
},
"require": {
@@ -3844,7 +3857,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:26:54+00:00"
+ "time": "2021-01-02T06:21:47+00:00"
},
{
"name": "sebastian/environment",
@@ -3852,12 +3865,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "7bb5a20ec06e366cb75b0e126169649c62b397b1"
+ "reference": "b885263b3601b7570ef386a468d6a827c95c8994"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/7bb5a20ec06e366cb75b0e126169649c62b397b1",
- "reference": "7bb5a20ec06e366cb75b0e126169649c62b397b1",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/b885263b3601b7570ef386a468d6a827c95c8994",
+ "reference": "b885263b3601b7570ef386a468d6a827c95c8994",
"shasum": ""
},
"require": {
@@ -3908,7 +3921,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:03+00:00"
+ "time": "2021-01-02T06:21:52+00:00"
},
{
"name": "sebastian/exporter",
@@ -3916,12 +3929,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "91975a2dbcf4a89184d9e4143c06b88d89644b58"
+ "reference": "f670c4f17dffab83b44048f6fe6747a7c6097179"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/91975a2dbcf4a89184d9e4143c06b88d89644b58",
- "reference": "91975a2dbcf4a89184d9e4143c06b88d89644b58",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f670c4f17dffab83b44048f6fe6747a7c6097179",
+ "reference": "f670c4f17dffab83b44048f6fe6747a7c6097179",
"shasum": ""
},
"require": {
@@ -3986,7 +3999,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:11+00:00"
+ "time": "2021-01-02T06:21:58+00:00"
},
{
"name": "sebastian/global-state",
@@ -3994,12 +4007,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "0471b24bddeb05ffd0a5edc6837796f339068c25"
+ "reference": "a74d82a0654a7f685f80016cc3570d7a387f9da0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0471b24bddeb05ffd0a5edc6837796f339068c25",
- "reference": "0471b24bddeb05ffd0a5edc6837796f339068c25",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a74d82a0654a7f685f80016cc3570d7a387f9da0",
+ "reference": "a74d82a0654a7f685f80016cc3570d7a387f9da0",
"shasum": ""
},
"require": {
@@ -4051,7 +4064,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:19+00:00"
+ "time": "2021-01-02T06:22:03+00:00"
},
{
"name": "sebastian/lines-of-code",
@@ -4059,12 +4072,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/lines-of-code.git",
- "reference": "219c932af1aeee0b4eccbc53af2181ff50e14b24"
+ "reference": "db62e01f14ea9485d5a52dfb5706061fd0f50425"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/219c932af1aeee0b4eccbc53af2181ff50e14b24",
- "reference": "219c932af1aeee0b4eccbc53af2181ff50e14b24",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/db62e01f14ea9485d5a52dfb5706061fd0f50425",
+ "reference": "db62e01f14ea9485d5a52dfb5706061fd0f50425",
"shasum": ""
},
"require": {
@@ -4109,7 +4122,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:28:42+00:00"
+ "time": "2021-01-02T06:22:58+00:00"
},
{
"name": "sebastian/object-enumerator",
@@ -4117,12 +4130,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
- "reference": "da36684b10f17db8718e314fa8d84b2e0ed7132e"
+ "reference": "fccb61351e8a3a10ffacfad9544bb2905905b69c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/da36684b10f17db8718e314fa8d84b2e0ed7132e",
- "reference": "da36684b10f17db8718e314fa8d84b2e0ed7132e",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/fccb61351e8a3a10ffacfad9544bb2905905b69c",
+ "reference": "fccb61351e8a3a10ffacfad9544bb2905905b69c",
"shasum": ""
},
"require": {
@@ -4167,7 +4180,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:27+00:00"
+ "time": "2021-01-02T06:22:09+00:00"
},
{
"name": "sebastian/object-reflector",
@@ -4175,12 +4188,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-reflector.git",
- "reference": "6717d193da503616e69462cf98e2af3f4443335d"
+ "reference": "c0ad4ce74e040797d5f8abfc23ab79fd79b064c3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6717d193da503616e69462cf98e2af3f4443335d",
- "reference": "6717d193da503616e69462cf98e2af3f4443335d",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/c0ad4ce74e040797d5f8abfc23ab79fd79b064c3",
+ "reference": "c0ad4ce74e040797d5f8abfc23ab79fd79b064c3",
"shasum": ""
},
"require": {
@@ -4223,7 +4236,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:35+00:00"
+ "time": "2021-01-02T06:22:14+00:00"
},
{
"name": "sebastian/recursion-context",
@@ -4231,12 +4244,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "cee249a3e471aa870067fa6155991230c7507924"
+ "reference": "c5616ce32278e62c77066f72b1fe413a8c958cee"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cee249a3e471aa870067fa6155991230c7507924",
- "reference": "cee249a3e471aa870067fa6155991230c7507924",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/c5616ce32278e62c77066f72b1fe413a8c958cee",
+ "reference": "c5616ce32278e62c77066f72b1fe413a8c958cee",
"shasum": ""
},
"require": {
@@ -4287,7 +4300,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:28:07+00:00"
+ "time": "2021-01-02T06:22:36+00:00"
},
{
"name": "sebastian/resource-operations",
@@ -4351,12 +4364,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
- "reference": "67bfce3beb94968d175fdf117b80fc9a6b60bdd0"
+ "reference": "655e3b59cc2e508306dba9c3df08b774055548e7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/67bfce3beb94968d175fdf117b80fc9a6b60bdd0",
- "reference": "67bfce3beb94968d175fdf117b80fc9a6b60bdd0",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/655e3b59cc2e508306dba9c3df08b774055548e7",
+ "reference": "655e3b59cc2e508306dba9c3df08b774055548e7",
"shasum": ""
},
"require": {
@@ -4400,7 +4413,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:28:15+00:00"
+ "time": "2021-01-02T06:22:42+00:00"
},
{
"name": "sebastian/version",
@@ -4500,12 +4513,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "15c96194f32e1b1aa30d1b302c71c5f83fd4dea9"
+ "reference": "5a8ebe413fbd4091d5b3c5b70e298141681c59c7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/15c96194f32e1b1aa30d1b302c71c5f83fd4dea9",
- "reference": "15c96194f32e1b1aa30d1b302c71c5f83fd4dea9",
+ "url": "https://api.github.com/repos/symfony/console/zipball/5a8ebe413fbd4091d5b3c5b70e298141681c59c7",
+ "reference": "5a8ebe413fbd4091d5b3c5b70e298141681c59c7",
"shasum": ""
},
"require": {
@@ -4590,7 +4603,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-18T08:03:24+00:00"
+ "time": "2021-01-01T09:27:20+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -4598,12 +4611,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "fade6deebd931cfd7a544f68479405a6a08979a3"
+ "reference": "7130f348df2f842044038aaae9d6653dc9d67649"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fade6deebd931cfd7a544f68479405a6a08979a3",
- "reference": "fade6deebd931cfd7a544f68479405a6a08979a3",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7130f348df2f842044038aaae9d6653dc9d67649",
+ "reference": "7130f348df2f842044038aaae9d6653dc9d67649",
"shasum": ""
},
"require": {
@@ -4670,7 +4683,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2020-12-27T09:28:48+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
@@ -4678,12 +4691,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
- "reference": "be092746c3ab9f9c62608c82e0f04687f8a879f9"
+ "reference": "e314d4992832c3a0a68ca731fadd959917320fda"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/be092746c3ab9f9c62608c82e0f04687f8a879f9",
- "reference": "be092746c3ab9f9c62608c82e0f04687f8a879f9",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/e314d4992832c3a0a68ca731fadd959917320fda",
+ "reference": "e314d4992832c3a0a68ca731fadd959917320fda",
"shasum": ""
},
"require": {
@@ -4752,7 +4765,7 @@
"type": "tidelift"
}
],
- "time": "2020-11-13T15:40:22+00:00"
+ "time": "2020-12-27T09:28:48+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
@@ -4760,12 +4773,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
- "reference": "69609f9f06790591b4b13a45ee117e7bab6395aa"
+ "reference": "3a79a2226897adae0cab81688fbc5144e2fc53f6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/69609f9f06790591b4b13a45ee117e7bab6395aa",
- "reference": "69609f9f06790591b4b13a45ee117e7bab6395aa",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3a79a2226897adae0cab81688fbc5144e2fc53f6",
+ "reference": "3a79a2226897adae0cab81688fbc5144e2fc53f6",
"shasum": ""
},
"require": {
@@ -4837,7 +4850,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2020-12-27T22:11:44+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -4845,12 +4858,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "401c9d9d3400c53a8f1a39425f0543406c137a43"
+ "reference": "de14691dc88bbbc5535de7f0e32080977dc1d23f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/401c9d9d3400c53a8f1a39425f0543406c137a43",
- "reference": "401c9d9d3400c53a8f1a39425f0543406c137a43",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/de14691dc88bbbc5535de7f0e32080977dc1d23f",
+ "reference": "de14691dc88bbbc5535de7f0e32080977dc1d23f",
"shasum": ""
},
"require": {
@@ -4918,7 +4931,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2020-12-27T09:28:48+00:00"
},
{
"name": "symfony/polyfill-php73",
@@ -5006,12 +5019,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "3a11f3dfb34ad50f978cb2b8cf936933b87739aa"
+ "reference": "54cc82c30ba7ed02bc64f5d010488c159b5f1706"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/3a11f3dfb34ad50f978cb2b8cf936933b87739aa",
- "reference": "3a11f3dfb34ad50f978cb2b8cf936933b87739aa",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/54cc82c30ba7ed02bc64f5d010488c159b5f1706",
+ "reference": "54cc82c30ba7ed02bc64f5d010488c159b5f1706",
"shasum": ""
},
"require": {
@@ -5082,7 +5095,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2020-12-27T09:28:48+00:00"
},
{
"name": "symfony/service-contracts",
@@ -5090,12 +5103,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
- "reference": "5c448a39281b671be2cc8d208e6df75ac2d4b366"
+ "reference": "e0d43e6e2f909287d2e4e867ca5c131a661f08ef"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/service-contracts/zipball/5c448a39281b671be2cc8d208e6df75ac2d4b366",
- "reference": "5c448a39281b671be2cc8d208e6df75ac2d4b366",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e0d43e6e2f909287d2e4e867ca5c131a661f08ef",
+ "reference": "e0d43e6e2f909287d2e4e867ca5c131a661f08ef",
"shasum": ""
},
"require": {
@@ -5163,7 +5176,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-23T15:38:30+00:00"
+ "time": "2021-01-01T09:26:45+00:00"
},
{
"name": "symfony/string",
@@ -5171,12 +5184,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed"
+ "reference": "99f25957efe05db14a1aa6cff643eca0f83a952c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed",
- "reference": "5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed",
+ "url": "https://api.github.com/repos/symfony/string/zipball/99f25957efe05db14a1aa6cff643eca0f83a952c",
+ "reference": "99f25957efe05db14a1aa6cff643eca0f83a952c",
"shasum": ""
},
"require": {
@@ -5231,7 +5244,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v5.2.1"
+ "source": "https://github.com/symfony/string/tree/5.x"
},
"funding": [
{
@@ -5247,7 +5260,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-05T07:33:16+00:00"
+ "time": "2021-01-01T09:26:45+00:00"
},
{
"name": "theseer/tokenizer",
@@ -5305,12 +5318,12 @@
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
- "reference": "c5379903e5640e5f29024e71aa0817f7bd56102b"
+ "reference": "846ebbd7c8e780913fa5731d9c6139522111b56f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/twigphp/Twig/zipball/c5379903e5640e5f29024e71aa0817f7bd56102b",
- "reference": "c5379903e5640e5f29024e71aa0817f7bd56102b",
+ "url": "https://api.github.com/repos/twigphp/Twig/zipball/846ebbd7c8e780913fa5731d9c6139522111b56f",
+ "reference": "846ebbd7c8e780913fa5731d9c6139522111b56f",
"shasum": ""
},
"require": {
@@ -5376,7 +5389,7 @@
"type": "tidelift"
}
],
- "time": "2020-11-27T13:05:37+00:00"
+ "time": "2021-01-01T14:57:43+00:00"
},
{
"name": "vimeo/psalm",
From 968c03fd010e89a2b4f0254119d0bf488fb702ee Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 4 Jan 2021 11:23:36 +0200
Subject: [PATCH 085/230] Changed name from CSharp to .NET
---
README.md | 2 +-
app/config/platforms.php | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index f5dea89bf7..7967b1b2ef 100644
--- a/README.md
+++ b/README.md
@@ -124,7 +124,7 @@ Below is a list of currently supported platforms and languages. If you wish to h
* ✅ [Deno](https://github.com/appwrite/sdk-for-deno) - **Beta** (Maintained by the Appwrite Team)
* ✅ [Ruby](https://github.com/appwrite/sdk-for-ruby) - **Beta** (Maintained by the Appwrite Team)
* ✅ [Python](https://github.com/appwrite/sdk-for-python) - **Beta** (Maintained by the Appwrite Team)
-* ✅ [C#](https://github.com/appwrite/sdk-for-csharp) - **Expiremental** (Maintained by the Appwrite Team)
+* ✅ [.NET](https://github.com/appwrite/sdk-for-dotnet) - **Expiremental** (Maintained by the Appwrite Team)
* ✅ [Go](https://github.com/appwrite/sdk-for-go) **Work in progress** (Maintained by the Appwrite Team)
* ✅ [Dart](https://github.com/appwrite/sdk-for-dart) **Work in progress** (Maintained by the Appwrite Team)
diff --git a/app/config/platforms.php b/app/config/platforms.php
index 8b751e436d..13773b67eb 100644
--- a/app/config/platforms.php
+++ b/app/config/platforms.php
@@ -238,18 +238,18 @@ return [
'gitUserName' => 'appwrite',
],
[
- 'key' => 'csharp',
- 'name' => 'CSharp',
+ 'key' => 'dotnet',
+ 'name' => '.NET',
'version' => '0.0.1',
- 'url' => 'https://github.com/appwrite/sdk-for-csharp',
+ 'url' => 'https://github.com/appwrite/sdk-for-dotnet',
'package' => '',
'enabled' => true,
'beta' => true,
'family' => APP_PLATFORM_SERVER,
'prism' => 'csharp',
- 'source' => \realpath(__DIR__ . '/../sdks/server-csharp'),
- 'gitUrl' => 'git@github.com:appwrite/sdk-for-csharp.git',
- 'gitRepoName' => 'sdk-for-csharp',
+ 'source' => \realpath(__DIR__ . '/../sdks/server-dotnet'),
+ 'gitUrl' => 'git@github.com:appwrite/sdk-for-dotnet.git',
+ 'gitRepoName' => 'sdk-for-dotnet',
'gitUserName' => 'appwrite',
],
[
From 9428ad930862ff2d906e1bdad83b23b340083a8c Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 4 Jan 2021 17:20:41 +0200
Subject: [PATCH 086/230] Added dotNet SDK
---
app/tasks/sdks.php | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php
index 857b4de7b5..9b0798b179 100644
--- a/app/tasks/sdks.php
+++ b/app/tasks/sdks.php
@@ -11,6 +11,7 @@ use Appwrite\SDK\Language\Python;
use Appwrite\SDK\Language\Ruby;
use Appwrite\SDK\Language\Dart;
use Appwrite\SDK\Language\Deno;
+use Appwrite\SDK\Language\DotNet;
use Appwrite\SDK\Language\Flutter;
use Appwrite\SDK\Language\Go;
use Appwrite\SDK\Language\Java;
@@ -132,6 +133,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
case 'swift':
$config = new Swift();
break;
+ case 'dotnet':
+ $config = new DotNet();
+ break;
default:
throw new Exception('Language "'.$language['key'].'" not supported');
break;
From 4a937659202aa60d739476fe09f70b97dbc8b4c3 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 4 Jan 2021 17:20:56 +0200
Subject: [PATCH 087/230] Updated docs
---
.../server-dotnet/examples/avatars/get-browser.md | 13 +++++++++++++
.../examples/avatars/get-credit-card.md | 13 +++++++++++++
.../server-dotnet/examples/avatars/get-favicon.md | 13 +++++++++++++
.../server-dotnet/examples/avatars/get-flag.md | 13 +++++++++++++
.../server-dotnet/examples/avatars/get-image.md | 13 +++++++++++++
.../server-dotnet/examples/avatars/get-initials.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/avatars/get-q-r.md | 13 +++++++++++++
.../examples/database/create-collection.md | 13 +++++++++++++
.../examples/database/create-document.md | 13 +++++++++++++
.../examples/database/delete-collection.md | 13 +++++++++++++
.../examples/database/delete-document.md | 13 +++++++++++++
.../examples/database/get-collection.md | 13 +++++++++++++
.../server-dotnet/examples/database/get-document.md | 13 +++++++++++++
.../examples/database/list-collections.md | 13 +++++++++++++
.../examples/database/list-documents.md | 13 +++++++++++++
.../examples/database/update-collection.md | 13 +++++++++++++
.../examples/database/update-document.md | 13 +++++++++++++
.../server-dotnet/examples/health/get-anti-virus.md | 13 +++++++++++++
.../server-dotnet/examples/health/get-cache.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/health/get-d-b.md | 13 +++++++++++++
.../examples/health/get-queue-certificates.md | 13 +++++++++++++
.../examples/health/get-queue-functions.md | 13 +++++++++++++
.../server-dotnet/examples/health/get-queue-logs.md | 13 +++++++++++++
.../examples/health/get-queue-tasks.md | 13 +++++++++++++
.../examples/health/get-queue-usage.md | 13 +++++++++++++
.../examples/health/get-queue-webhooks.md | 13 +++++++++++++
.../examples/health/get-storage-local.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/health/get-time.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/health/get.md | 13 +++++++++++++
.../server-dotnet/examples/locale/get-continents.md | 13 +++++++++++++
.../examples/locale/get-countries-e-u.md | 13 +++++++++++++
.../examples/locale/get-countries-phones.md | 13 +++++++++++++
.../server-dotnet/examples/locale/get-countries.md | 13 +++++++++++++
.../server-dotnet/examples/locale/get-currencies.md | 13 +++++++++++++
.../server-dotnet/examples/locale/get-languages.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/locale/get.md | 13 +++++++++++++
.../server-dotnet/examples/storage/create-file.md | 13 +++++++++++++
.../server-dotnet/examples/storage/delete-file.md | 13 +++++++++++++
.../examples/storage/get-file-download.md | 13 +++++++++++++
.../examples/storage/get-file-preview.md | 13 +++++++++++++
.../server-dotnet/examples/storage/get-file-view.md | 13 +++++++++++++
.../server-dotnet/examples/storage/get-file.md | 13 +++++++++++++
.../server-dotnet/examples/storage/list-files.md | 13 +++++++++++++
.../server-dotnet/examples/storage/update-file.md | 13 +++++++++++++
.../examples/teams/create-membership.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/teams/create.md | 13 +++++++++++++
.../examples/teams/delete-membership.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/teams/delete.md | 13 +++++++++++++
.../server-dotnet/examples/teams/get-memberships.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/teams/get.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/teams/list.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/teams/update.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/users/create.md | 13 +++++++++++++
.../server-dotnet/examples/users/delete-session.md | 13 +++++++++++++
.../server-dotnet/examples/users/delete-sessions.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/users/get-logs.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/users/get-prefs.md | 13 +++++++++++++
.../server-dotnet/examples/users/get-sessions.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/users/get.md | 13 +++++++++++++
.../0.6.2/server-dotnet/examples/users/list.md | 13 +++++++++++++
.../server-dotnet/examples/users/update-prefs.md | 13 +++++++++++++
.../server-dotnet/examples/users/update-status.md | 13 +++++++++++++
62 files changed, 806 insertions(+)
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/avatars/get-browser.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/avatars/get-credit-card.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/avatars/get-favicon.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/avatars/get-flag.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/avatars/get-image.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/avatars/get-initials.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/avatars/get-q-r.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/database/create-collection.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/database/create-document.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/database/delete-collection.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/database/delete-document.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/database/get-collection.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/database/get-document.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/database/list-collections.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/database/list-documents.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/database/update-collection.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/database/update-document.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/health/get-anti-virus.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/health/get-cache.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/health/get-d-b.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/health/get-queue-certificates.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/health/get-queue-functions.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/health/get-queue-logs.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/health/get-queue-tasks.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/health/get-queue-usage.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/health/get-queue-webhooks.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/health/get-storage-local.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/health/get-time.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/health/get.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/locale/get-continents.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-e-u.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-phones.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/locale/get-countries.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/locale/get-currencies.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/locale/get-languages.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/locale/get.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/storage/create-file.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/storage/delete-file.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/storage/get-file-download.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/storage/get-file-preview.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/storage/get-file-view.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/storage/get-file.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/storage/list-files.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/storage/update-file.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/teams/create-membership.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/teams/create.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/teams/delete-membership.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/teams/delete.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/teams/get-memberships.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/teams/get.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/teams/list.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/teams/update.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/users/create.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/users/delete-session.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/users/delete-sessions.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/users/get-logs.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/users/get-prefs.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/users/get-sessions.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/users/get.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/users/list.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/users/update-prefs.md
create mode 100644 docs/examples/0.6.2/server-dotnet/examples/users/update-status.md
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-browser.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-browser.md
new file mode 100644
index 0000000000..6d6a5b7f18
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-browser.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Avatars avatars = new Avatars(client);
+
+result = avatars.getBrowser("aa");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-credit-card.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-credit-card.md
new file mode 100644
index 0000000000..8a89c04618
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-credit-card.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Avatars avatars = new Avatars(client);
+
+result = avatars.getCreditCard("amex");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-favicon.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-favicon.md
new file mode 100644
index 0000000000..d51b02a7c3
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-favicon.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Avatars avatars = new Avatars(client);
+
+result = avatars.getFavicon("https://example.com");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-flag.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-flag.md
new file mode 100644
index 0000000000..88a06d16ff
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-flag.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Avatars avatars = new Avatars(client);
+
+result = avatars.getFlag("af");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-image.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-image.md
new file mode 100644
index 0000000000..06d021dcf7
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-image.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Avatars avatars = new Avatars(client);
+
+result = avatars.getImage("https://example.com");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-initials.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-initials.md
new file mode 100644
index 0000000000..09e91e0120
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-initials.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Avatars avatars = new Avatars(client);
+
+result = avatars.getInitials();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-q-r.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-q-r.md
new file mode 100644
index 0000000000..5f410cd4ae
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-q-r.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Avatars avatars = new Avatars(client);
+
+result = avatars.getQR("[TEXT]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/create-collection.md b/docs/examples/0.6.2/server-dotnet/examples/database/create-collection.md
new file mode 100644
index 0000000000..92a26b5559
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/create-collection.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Database database = new Database(client);
+
+result = database.createCollection("[NAME]", {}, {}, {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/create-document.md b/docs/examples/0.6.2/server-dotnet/examples/database/create-document.md
new file mode 100644
index 0000000000..70d00bac14
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/create-document.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Database database = new Database(client);
+
+result = database.createDocument("[COLLECTION_ID]", {}, {}, {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/delete-collection.md b/docs/examples/0.6.2/server-dotnet/examples/database/delete-collection.md
new file mode 100644
index 0000000000..7a611e4778
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/delete-collection.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Database database = new Database(client);
+
+result = database.deleteCollection("[COLLECTION_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/delete-document.md b/docs/examples/0.6.2/server-dotnet/examples/database/delete-document.md
new file mode 100644
index 0000000000..7af78fc558
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/delete-document.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Database database = new Database(client);
+
+result = database.deleteDocument("[COLLECTION_ID]", "[DOCUMENT_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/get-collection.md b/docs/examples/0.6.2/server-dotnet/examples/database/get-collection.md
new file mode 100644
index 0000000000..f2bc02fc97
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/get-collection.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Database database = new Database(client);
+
+result = database.getCollection("[COLLECTION_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/get-document.md b/docs/examples/0.6.2/server-dotnet/examples/database/get-document.md
new file mode 100644
index 0000000000..376057e59b
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/get-document.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Database database = new Database(client);
+
+result = database.getDocument("[COLLECTION_ID]", "[DOCUMENT_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/list-collections.md b/docs/examples/0.6.2/server-dotnet/examples/database/list-collections.md
new file mode 100644
index 0000000000..b9af7abf1c
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/list-collections.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Database database = new Database(client);
+
+result = database.listCollections();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/list-documents.md b/docs/examples/0.6.2/server-dotnet/examples/database/list-documents.md
new file mode 100644
index 0000000000..355bc43476
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/list-documents.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Database database = new Database(client);
+
+result = database.listDocuments("[COLLECTION_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/update-collection.md b/docs/examples/0.6.2/server-dotnet/examples/database/update-collection.md
new file mode 100644
index 0000000000..33ae0d7d91
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/update-collection.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Database database = new Database(client);
+
+result = database.updateCollection("[COLLECTION_ID]", "[NAME]", {}, {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/update-document.md b/docs/examples/0.6.2/server-dotnet/examples/database/update-document.md
new file mode 100644
index 0000000000..719d9f5e2e
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/update-document.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Database database = new Database(client);
+
+result = database.updateDocument("[COLLECTION_ID]", "[DOCUMENT_ID]", {}, {}, {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-anti-virus.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-anti-virus.md
new file mode 100644
index 0000000000..3a2b920271
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-anti-virus.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Health health = new Health(client);
+
+result = health.getAntiVirus();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-cache.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-cache.md
new file mode 100644
index 0000000000..cba191b265
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-cache.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Health health = new Health(client);
+
+result = health.getCache();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-d-b.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-d-b.md
new file mode 100644
index 0000000000..27a46ffe7c
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-d-b.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Health health = new Health(client);
+
+result = health.getDB();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-certificates.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-certificates.md
new file mode 100644
index 0000000000..895147525a
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-certificates.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Health health = new Health(client);
+
+result = health.getQueueCertificates();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-functions.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-functions.md
new file mode 100644
index 0000000000..1e6130ddbd
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-functions.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Health health = new Health(client);
+
+result = health.getQueueFunctions();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-logs.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-logs.md
new file mode 100644
index 0000000000..bf9dec6e7c
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-logs.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Health health = new Health(client);
+
+result = health.getQueueLogs();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-tasks.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-tasks.md
new file mode 100644
index 0000000000..0ca3a4b3f0
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-tasks.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Health health = new Health(client);
+
+result = health.getQueueTasks();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-usage.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-usage.md
new file mode 100644
index 0000000000..74cedc0bca
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-usage.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Health health = new Health(client);
+
+result = health.getQueueUsage();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-webhooks.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-webhooks.md
new file mode 100644
index 0000000000..eb7f9071c1
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-webhooks.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Health health = new Health(client);
+
+result = health.getQueueWebhooks();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-storage-local.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-storage-local.md
new file mode 100644
index 0000000000..0cfc305b63
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-storage-local.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Health health = new Health(client);
+
+result = health.getStorageLocal();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-time.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-time.md
new file mode 100644
index 0000000000..4887d4b20b
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-time.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Health health = new Health(client);
+
+result = health.getTime();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get.md b/docs/examples/0.6.2/server-dotnet/examples/health/get.md
new file mode 100644
index 0000000000..1b7428a216
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Health health = new Health(client);
+
+result = health.get();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get-continents.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get-continents.md
new file mode 100644
index 0000000000..0f85130aa3
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get-continents.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Locale locale = new Locale(client);
+
+result = locale.getContinents();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-e-u.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-e-u.md
new file mode 100644
index 0000000000..8567e3ea4e
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-e-u.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Locale locale = new Locale(client);
+
+result = locale.getCountriesEU();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-phones.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-phones.md
new file mode 100644
index 0000000000..a2c5e1a8ab
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-phones.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Locale locale = new Locale(client);
+
+result = locale.getCountriesPhones();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries.md
new file mode 100644
index 0000000000..724c019133
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Locale locale = new Locale(client);
+
+result = locale.getCountries();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get-currencies.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get-currencies.md
new file mode 100644
index 0000000000..44f4ba5924
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get-currencies.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Locale locale = new Locale(client);
+
+result = locale.getCurrencies();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get-languages.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get-languages.md
new file mode 100644
index 0000000000..8020c37230
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get-languages.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Locale locale = new Locale(client);
+
+result = locale.getLanguages();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get.md
new file mode 100644
index 0000000000..ce9d4207b6
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Locale locale = new Locale(client);
+
+result = locale.get();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/create-file.md b/docs/examples/0.6.2/server-dotnet/examples/storage/create-file.md
new file mode 100644
index 0000000000..f0ac77f9d8
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/create-file.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Storage storage = new Storage(client);
+
+result = storage.createFile(new File("./path-to-files/image.jpg"), {}, {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/delete-file.md b/docs/examples/0.6.2/server-dotnet/examples/storage/delete-file.md
new file mode 100644
index 0000000000..d478052b7c
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/delete-file.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Storage storage = new Storage(client);
+
+result = storage.deleteFile("[FILE_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-download.md b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-download.md
new file mode 100644
index 0000000000..fc209435fe
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-download.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Storage storage = new Storage(client);
+
+result = storage.getFileDownload("[FILE_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-preview.md b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-preview.md
new file mode 100644
index 0000000000..ba50cb911a
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-preview.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Storage storage = new Storage(client);
+
+result = storage.getFilePreview("[FILE_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-view.md b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-view.md
new file mode 100644
index 0000000000..87226f1603
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-view.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Storage storage = new Storage(client);
+
+result = storage.getFileView("[FILE_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/get-file.md b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file.md
new file mode 100644
index 0000000000..50553b6b0e
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Storage storage = new Storage(client);
+
+result = storage.getFile("[FILE_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/list-files.md b/docs/examples/0.6.2/server-dotnet/examples/storage/list-files.md
new file mode 100644
index 0000000000..ba9bb077b8
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/list-files.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Storage storage = new Storage(client);
+
+result = storage.listFiles();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/update-file.md b/docs/examples/0.6.2/server-dotnet/examples/storage/update-file.md
new file mode 100644
index 0000000000..1aa65653c2
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/update-file.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Storage storage = new Storage(client);
+
+result = storage.updateFile("[FILE_ID]", {}, {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/create-membership.md b/docs/examples/0.6.2/server-dotnet/examples/teams/create-membership.md
new file mode 100644
index 0000000000..66832b80f1
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/create-membership.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Teams teams = new Teams(client);
+
+result = teams.createMembership("[TEAM_ID]", "email@example.com", {}, "https://example.com");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/create.md b/docs/examples/0.6.2/server-dotnet/examples/teams/create.md
new file mode 100644
index 0000000000..ff5ee26138
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/create.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Teams teams = new Teams(client);
+
+result = teams.create("[NAME]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/delete-membership.md b/docs/examples/0.6.2/server-dotnet/examples/teams/delete-membership.md
new file mode 100644
index 0000000000..7c1900621c
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/delete-membership.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Teams teams = new Teams(client);
+
+result = teams.deleteMembership("[TEAM_ID]", "[INVITE_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/delete.md b/docs/examples/0.6.2/server-dotnet/examples/teams/delete.md
new file mode 100644
index 0000000000..ae0fda06ad
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/delete.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Teams teams = new Teams(client);
+
+result = teams.delete("[TEAM_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/get-memberships.md b/docs/examples/0.6.2/server-dotnet/examples/teams/get-memberships.md
new file mode 100644
index 0000000000..1aac54c69d
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/get-memberships.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Teams teams = new Teams(client);
+
+result = teams.getMemberships("[TEAM_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/get.md b/docs/examples/0.6.2/server-dotnet/examples/teams/get.md
new file mode 100644
index 0000000000..eb0bc28f73
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/get.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Teams teams = new Teams(client);
+
+result = teams.get("[TEAM_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/list.md b/docs/examples/0.6.2/server-dotnet/examples/teams/list.md
new file mode 100644
index 0000000000..bc60aa8a35
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/list.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Teams teams = new Teams(client);
+
+result = teams.list();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/update.md b/docs/examples/0.6.2/server-dotnet/examples/teams/update.md
new file mode 100644
index 0000000000..3815283343
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/update.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Teams teams = new Teams(client);
+
+result = teams.update("[TEAM_ID]", "[NAME]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/create.md b/docs/examples/0.6.2/server-dotnet/examples/users/create.md
new file mode 100644
index 0000000000..536e995d0b
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/create.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Users users = new Users(client);
+
+result = users.create("email@example.com", "password");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/delete-session.md b/docs/examples/0.6.2/server-dotnet/examples/users/delete-session.md
new file mode 100644
index 0000000000..eb455cb140
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/delete-session.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Users users = new Users(client);
+
+result = users.deleteSession("[USER_ID]", "[SESSION_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/delete-sessions.md b/docs/examples/0.6.2/server-dotnet/examples/users/delete-sessions.md
new file mode 100644
index 0000000000..5793fe5bc8
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/delete-sessions.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Users users = new Users(client);
+
+result = users.deleteSessions("[USER_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/get-logs.md b/docs/examples/0.6.2/server-dotnet/examples/users/get-logs.md
new file mode 100644
index 0000000000..0c68cad6c2
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/get-logs.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Users users = new Users(client);
+
+result = users.getLogs("[USER_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/get-prefs.md b/docs/examples/0.6.2/server-dotnet/examples/users/get-prefs.md
new file mode 100644
index 0000000000..b9165807bc
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/get-prefs.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Users users = new Users(client);
+
+result = users.getPrefs("[USER_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/get-sessions.md b/docs/examples/0.6.2/server-dotnet/examples/users/get-sessions.md
new file mode 100644
index 0000000000..b1fff05940
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/get-sessions.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Users users = new Users(client);
+
+result = users.getSessions("[USER_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/get.md b/docs/examples/0.6.2/server-dotnet/examples/users/get.md
new file mode 100644
index 0000000000..fb5d4ceec5
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/get.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Users users = new Users(client);
+
+result = users.get("[USER_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/list.md b/docs/examples/0.6.2/server-dotnet/examples/users/list.md
new file mode 100644
index 0000000000..bbe25485a2
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/list.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Users users = new Users(client);
+
+result = users.list();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/update-prefs.md b/docs/examples/0.6.2/server-dotnet/examples/users/update-prefs.md
new file mode 100644
index 0000000000..accdcd757f
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/update-prefs.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Users users = new Users(client);
+
+result = users.updatePrefs("[USER_ID]", {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/update-status.md b/docs/examples/0.6.2/server-dotnet/examples/users/update-status.md
new file mode 100644
index 0000000000..51822dd10e
--- /dev/null
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/update-status.md
@@ -0,0 +1,13 @@
+use Appwrite;
+
+Client client = new Client();
+
+client
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
+ .SetProject("5df5acd0d48c2") # Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+;
+
+Users users = new Users(client);
+
+result = users.updateStatus("[USER_ID]", "1");
From 90c5913957b66300f2c85cca027cff0af8a42e7b Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 4 Jan 2021 19:45:35 +0200
Subject: [PATCH 088/230] Updated dependencies
---
app/tasks/sdks.php | 4 +++-
composer.json | 2 +-
composer.lock | 13 ++++++++-----
3 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php
index 9b0798b179..e0a6fbd051 100644
--- a/app/tasks/sdks.php
+++ b/app/tasks/sdks.php
@@ -61,6 +61,7 @@ $cli
$spec = file_get_contents(__DIR__.'/../config/specs/'.$version.'.'.$language['family'].'.json');
+ $cover = 'https://appwrite.io/images/github.png';
$result = \realpath(__DIR__.'/..').'/sdks/'.$key.'-'.$language['key'];
$resultExamples = \realpath(__DIR__.'/../..').'/docs/examples/'.$version.'/'.$key.'-'.$language['key'];
$target = \realpath(__DIR__.'/..').'/sdks/git/'.$language['key'].'/';
@@ -134,6 +135,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
$config = new Swift();
break;
case 'dotnet':
+ $cover = '';
$config = new DotNet();
break;
default:
@@ -158,7 +160,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
->setGitRepo($language['gitUrl'])
->setGitRepoName($language['gitRepoName'])
->setGitUserName($language['gitUserName'])
- ->setLogo('https://appwrite.io/images/github.png')
+ ->setLogo($cover)
->setURL('https://appwrite.io')
->setShareText('Appwrite is a backend as a service for building web or mobile apps')
->setShareURL('http://appwrite.io')
diff --git a/composer.json b/composer.json
index 97d2263952..998e6b0d0d 100644
--- a/composer.json
+++ b/composer.json
@@ -56,7 +56,7 @@
},
"require-dev": {
"swoole/ide-helper": "4.5.5",
- "appwrite/sdk-generator": "0.3.0",
+ "appwrite/sdk-generator": "dev-master",
"phpunit/phpunit": "9.4.2",
"vimeo/psalm": "4.1.1"
},
diff --git a/composer.lock b/composer.lock
index 606dd5fd67..3b8cc855d4 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "57a43a1cab8459494f031551fe83ffb5",
+ "content-hash": "30a8a58c868d3546fc22511b46431564",
"packages": [
{
"name": "appwrite/php-clamav",
@@ -1858,11 +1858,11 @@
},
{
"name": "appwrite/sdk-generator",
- "version": "0.3.0",
+ "version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator",
- "reference": "f0a6ecf92869012dd546ec503c69177dce0f9d90"
+ "reference": "7d762df83f2539ca89605e40541afbdb20941542"
},
"require": {
"ext-curl": "*",
@@ -1875,6 +1875,7 @@
"require-dev": {
"phpunit/phpunit": "^7.0"
},
+ "default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
@@ -1892,7 +1893,7 @@
}
],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
- "time": "2021-01-03T21:23:24+00:00"
+ "time": "2021-01-04T16:19:42+00:00"
},
{
"name": "composer/package-versions-deprecated",
@@ -5603,7 +5604,9 @@
],
"aliases": [],
"minimum-stability": "dev",
- "stability-flags": [],
+ "stability-flags": {
+ "appwrite/sdk-generator": 20
+ },
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
From eb0ed4f2184e5dcac9c0e4f2714719395ebb49a8 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 4 Jan 2021 19:49:51 +0200
Subject: [PATCH 089/230] Updated test commands
---
CONTRIBUTING.md | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0f9f433926..73e03d1e79 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -243,12 +243,29 @@ bash ./docker/environments/build.sh
## Tests
-To run tests manually, use the Appwrite Docker CLI from your terminal:
+To run all tests manually, use the Appwrite Docker CLI from your terminal:
```bash
docker-compose exec appwrite test
```
+To run unit tests use:
+
+```bash
+docker-compose exec appwrite test /usr/src/code/tests/unit
+```
+
+To run end-2-end tests use:
+
+```bash
+docker-compose exec appwrite test /usr/src/code/tests/e2e
+```
+
+To run end-2-end tests for a spcific service use:
+
+```bash
+docker-compose exec appwrite test /usr/src/code/tests/e2e/Services/[ServiceName]
+```
## Benchmarking
You can use WRK Docker image to benchmark the server performance. Benchmarking is extremely useful when you want to compare how the server behaves before and after a change has been applied. Replace [APPWRITE_HOSTNAME_OR_IP] with your Appwrite server hostname or IP. Note that localhost is not accessible from inside the WRK container.
From df18492d7f57632d60e97cdee7431cc424d247d7 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Mon, 4 Jan 2021 19:56:08 +0200
Subject: [PATCH 090/230] Updated Nuget URL
---
app/config/platforms.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/config/platforms.php b/app/config/platforms.php
index 13773b67eb..ffc51b89ed 100644
--- a/app/config/platforms.php
+++ b/app/config/platforms.php
@@ -242,7 +242,7 @@ return [
'name' => '.NET',
'version' => '0.0.1',
'url' => 'https://github.com/appwrite/sdk-for-dotnet',
- 'package' => '',
+ 'package' => 'https://www.nuget.org/packages/Appwrite',
'enabled' => true,
'beta' => true,
'family' => APP_PLATFORM_SERVER,
From 98309e776e36af6806ab39f5ac130850e19b04ef Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Tue, 5 Jan 2021 00:00:20 +0530
Subject: [PATCH 091/230] feat: fixed failing tests
---
src/Appwrite/Utopia/Response/Filters/V06.php | 30 +++++++++++---------
tests/unit/Utopia/Filters/V06Test.php | 6 +++-
2 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index bed31b48bc..9f7124f043 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -146,15 +146,14 @@ class V06 extends Filter {
private function parseCurrencyList(array $content)
{
$content['locations'] = [];
-
$currencies = $content['currencies'];
$parsedResponse = [];
foreach($currencies as $currency) {
$currency['locations'] = [];
$parsedResponse[] = $currency;
}
-
- return $parsedResponse;
+ $content['currencies'] = $parsedResponse;
+ return $content;
}
private function parseContinentList(array $content)
@@ -164,8 +163,8 @@ class V06 extends Filter {
foreach($continents as $continent) {
$parsedResponse[$continent['code']] = $continent['name'];
}
-
- return $parsedResponse;
+ $content['continents'] = $parsedResponse;
+ return $content;
}
private function parsePhoneList(array $content)
@@ -175,8 +174,8 @@ class V06 extends Filter {
foreach($phones as $phone) {
$parsedResponse[$phone['countryCode']] = $phone['code'];
}
-
- return $parsedResponse;
+ $content['phones'] = $parsedResponse;
+ return $content;
}
private function parseCountryList(array $content)
@@ -186,8 +185,8 @@ class V06 extends Filter {
foreach($countries as $country) {
$parsedResponse[$country['code']] = $country['name'];
}
-
- return $parsedResponse;
+ $content['countries'] = $parsedResponse;
+ return $content;
}
private function parseLocale(array $content)
@@ -216,7 +215,7 @@ class V06 extends Filter {
$parsedResponse[] = [
'event' => $log['event'],
'ip' => $log['ip'],
- 'time' => strtotime($log['time']),
+ 'time' => $log['time'],
'OS' => $log['osName'].' '.$log['osVersion'],
'client' => $log['clientName'].' '.$log['clientVersion'],
'device' => $log['deviceName'],
@@ -228,7 +227,8 @@ class V06 extends Filter {
]
];
}
- return $parsedResponse;
+ $content['logs'] = $parsedResponse;
+ return $content;
}
private function parseSessionList(array $content)
@@ -251,7 +251,8 @@ class V06 extends Filter {
],
];
}
- return $parsedResponse;
+ $content['sessions'] = $parsedResponse;
+ return $content;
}
private function parseSession(array $content)
@@ -267,12 +268,13 @@ class V06 extends Filter {
foreach($users as $user) {
$parsedResponse[] = $this->parseUser($user);
}
- return $parsedResponse;
+ $content['users'] = $parsedResponse;
+ return $content;
}
private function parseUser(array $content)
{
- foreach (Config::getParam('providers') as $key => $provider) {
+ foreach (Config::getParam('providers', []) as $key => $provider) {
if (!$provider['enabled']) {
continue;
}
diff --git a/tests/unit/Utopia/Filters/V06Test.php b/tests/unit/Utopia/Filters/V06Test.php
index 42b1bba3f2..71f8b4ca79 100644
--- a/tests/unit/Utopia/Filters/V06Test.php
+++ b/tests/unit/Utopia/Filters/V06Test.php
@@ -39,6 +39,8 @@ class V06Test extends TestCase
]
];
+ Config::load('providers', __DIR__.'/../../../../app/config/providers.php');
+
$model = Response::MODEL_USER;
$parsedResponse = $this->filter->parse($content, $model);
@@ -73,6 +75,8 @@ class V06Test extends TestCase
]
];
+ Config::load('providers', __DIR__.'/../../../../app/config/providers.php');
+
$model = Response::MODEL_USER_LIST;
$parsedResponse = $this->filter->parse($content, $model);
@@ -260,7 +264,7 @@ class V06Test extends TestCase
$parsedResponse = $this->filter->parse($content, $model);
$this->assertEquals($parsedResponse['ip'], '127.0.0.1');
- $this->assertEquals($parsedResponse['contryCode'], 'US');
+ $this->assertEquals($parsedResponse['countryCode'], 'US');
$this->assertEquals($parsedResponse['country'], 'United States');
$this->assertEquals($parsedResponse['continentCode'], 'NA');
$this->assertEquals($parsedResponse['continent'], 'North America');
From b516eec69d17025c9cf8e8b9b2b4ef8736e50a18 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Tue, 5 Jan 2021 00:34:21 +0200
Subject: [PATCH 092/230] Updated SDK generator version
---
composer.json | 2 +-
composer.lock | 9 +++------
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/composer.json b/composer.json
index 998e6b0d0d..a74996f91a 100644
--- a/composer.json
+++ b/composer.json
@@ -56,7 +56,7 @@
},
"require-dev": {
"swoole/ide-helper": "4.5.5",
- "appwrite/sdk-generator": "dev-master",
+ "appwrite/sdk-generator": "0.3.2",
"phpunit/phpunit": "9.4.2",
"vimeo/psalm": "4.1.1"
},
diff --git a/composer.lock b/composer.lock
index 3b8cc855d4..42591c7182 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "30a8a58c868d3546fc22511b46431564",
+ "content-hash": "229bcebe0c03153ab739cd324fb4eb43",
"packages": [
{
"name": "appwrite/php-clamav",
@@ -1858,7 +1858,7 @@
},
{
"name": "appwrite/sdk-generator",
- "version": "dev-master",
+ "version": "0.3.2",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator",
@@ -1875,7 +1875,6 @@
"require-dev": {
"phpunit/phpunit": "^7.0"
},
- "default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
@@ -5604,9 +5603,7 @@
],
"aliases": [],
"minimum-stability": "dev",
- "stability-flags": {
- "appwrite/sdk-generator": 20
- },
+ "stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
From b3e1c74803f881997d22ab1513ba0aac737ba952 Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Tue, 5 Jan 2021 17:33:54 +0530
Subject: [PATCH 093/230] feat: changed session structure
---
src/Appwrite/Utopia/Response/Filters/V06.php | 23 +++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 9f7124f043..2e569406e9 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -12,6 +12,8 @@ use Exception;
use Utopia\Config\Config;
use Utopia\Locale\Locale as Locale;
+use function PHPSTORM_META\map;
+
class V06 extends Filter {
// Convert 0.7 Data format to 0.6 format
@@ -238,17 +240,28 @@ class V06 extends Filter {
foreach($sessions as $session) {
$parsedResponse[] = [
'$id' => $session['$id'],
- 'OS' => $session['osName'].' '.$session['osVersion'],
- 'client' => $session['clientName'].' '.$session['clientVersion'],
- 'device' => $session['deviceName'],
'brand' => $session['deviceBrand'],
- 'model' => $session['deviceModel'],
- 'ip' => $session['ip'],
'current' => $session['current'],
+ 'device' => $session['deviceName'],
+ 'ip' => $session['ip'],
+ 'model' => $session['deviceModel'],
'geo' => [
'isoCode' => empty($session['countryCode']) ? '---' : $session['countryCode'] ,
'country' => empty($session['countryName'] ) ? Locale::getText('locale.country.unknown') : $session['countryName']
],
+ 'OS' => [
+ 'name' => $session['osName'],
+ 'platform' => $session[''],
+ 'short_name' => $session['osCode'],
+ 'version' => $session['osVersion']
+ ],
+ 'client' => [
+ 'engine' => $session['clientEngine'],
+ 'name' => $session['clientName'],
+ 'short_name' => $session['clientCode'],
+ 'type' => $session['clientType'],
+ 'version' => $session['clientVersion']
+ ]
];
}
$content['sessions'] = $parsedResponse;
From 2b9a9efca54791fc63ab7b0aa554b4c4cdc7247b Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Tue, 5 Jan 2021 17:43:14 +0530
Subject: [PATCH 094/230] feat: fixed tests for new sessions response
---
src/Appwrite/Utopia/Response/Filters/V06.php | 2 +-
tests/unit/Utopia/Filters/V06Test.php | 20 +++++++++++++++-----
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 2e569406e9..7b89cbc52a 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -251,7 +251,7 @@ class V06 extends Filter {
],
'OS' => [
'name' => $session['osName'],
- 'platform' => $session[''],
+ 'platform' => '',
'short_name' => $session['osCode'],
'version' => $session['osVersion']
],
diff --git a/tests/unit/Utopia/Filters/V06Test.php b/tests/unit/Utopia/Filters/V06Test.php
index 71f8b4ca79..6a0906a85f 100644
--- a/tests/unit/Utopia/Filters/V06Test.php
+++ b/tests/unit/Utopia/Filters/V06Test.php
@@ -175,13 +175,23 @@ class V06Test extends TestCase
$this->assertEquals($parsedResponse['sum'], 1);
$this->assertEquals($parsedResponse['sessions'][0]['$id'], '5e5ea5c16897e');
- $this->assertEquals($parsedResponse['sessions'][0]['OS'], 'Mac Mac');
- $this->assertEquals($parsedResponse['sessions'][0]['client'], 'Chrome Mobile iOS 84.0');
- $this->assertEquals($parsedResponse['sessions'][0]['device'], 'smartphone');
$this->assertEquals($parsedResponse['sessions'][0]['brand'], 'Google');
- $this->assertEquals($parsedResponse['sessions'][0]['model'], 'Nexus 5');
- $this->assertEquals($parsedResponse['sessions'][0]['ip'], '127.0.0.1');
$this->assertEquals($parsedResponse['sessions'][0]['current'], true);
+ $this->assertEquals($parsedResponse['sessions'][0]['device'], 'smartphone');
+ $this->assertEquals($parsedResponse['sessions'][0]['ip'], '127.0.0.1');
+ $this->assertEquals($parsedResponse['sessions'][0]['model'], 'Nexus 5');
+
+ $this->assertEquals($parsedResponse['sessions'][0]['OS']['name'], 'Mac');
+ $this->assertEquals($parsedResponse['sessions'][0]['OS']['platform'], '');
+ $this->assertEquals($parsedResponse['sessions'][0]['OS']['short_name'], 'Mac');
+ $this->assertEquals($parsedResponse['sessions'][0]['OS']['version'], '');
+
+ $this->assertEquals($parsedResponse['sessions'][0]['client']['engine'], 'WebKit');
+ $this->assertEquals($parsedResponse['sessions'][0]['client']['name'], 'Chrome Mobile iOS');
+ $this->assertEquals($parsedResponse['sessions'][0]['client']['short_name'], 'CM');
+ $this->assertEquals($parsedResponse['sessions'][0]['client']['type'], 'browser');
+ $this->assertEquals($parsedResponse['sessions'][0]['client']['version'], '84.0');
+
$this->assertEquals($parsedResponse['sessions'][0]['geo']['isoCode'], 'US');
$this->assertEquals($parsedResponse['sessions'][0]['geo']['country'], 'United States');
}
From a58107b49cf18f03bc4874fc8645b7c286ad486f Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Tue, 5 Jan 2021 17:51:17 +0530
Subject: [PATCH 095/230] feat: changed log list response format and added
tests
---
src/Appwrite/Utopia/Response/Filters/V06.php | 21 ++++++++++++----
tests/unit/Utopia/Filters/V06Test.php | 26 ++++++++++++++------
2 files changed, 34 insertions(+), 13 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 7b89cbc52a..f386edc6ad 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -215,17 +215,28 @@ class V06 extends Filter {
$parsedResponse = [];
foreach($logs as $log) {
$parsedResponse[] = [
+ 'brand' => $log['deviceBrand'],
+ 'device' => $log['deviceName'],
'event' => $log['event'],
'ip' => $log['ip'],
- 'time' => $log['time'],
- 'OS' => $log['osName'].' '.$log['osVersion'],
- 'client' => $log['clientName'].' '.$log['clientVersion'],
- 'device' => $log['deviceName'],
- 'brand' => $log['deviceBrand'],
'model' => $log['deviceModel'],
+ 'time' => $log['time'],
'geo' => [
'isoCode' => empty($log['countryCode']) ? '---' : $log['countryCode'] ,
'country' => empty($log['countryName'] ) ? Locale::getText('locale.country.unknown') : $log['countryName']
+ ],
+ 'OS' => [
+ 'name' => $log['osName'],
+ 'platform' => '',
+ 'short_name' => $log['osCode'],
+ 'version' => $log['osVersion']
+ ],
+ 'client' => [
+ 'engine' => $log['clientEngine'],
+ 'name' => $log['clientName'],
+ 'short_name' => $log['clientCode'],
+ 'type' => $log['clientType'],
+ 'version' => $log['clientVersion']
]
];
}
diff --git a/tests/unit/Utopia/Filters/V06Test.php b/tests/unit/Utopia/Filters/V06Test.php
index 6a0906a85f..97804acd32 100644
--- a/tests/unit/Utopia/Filters/V06Test.php
+++ b/tests/unit/Utopia/Filters/V06Test.php
@@ -184,7 +184,7 @@ class V06Test extends TestCase
$this->assertEquals($parsedResponse['sessions'][0]['OS']['name'], 'Mac');
$this->assertEquals($parsedResponse['sessions'][0]['OS']['platform'], '');
$this->assertEquals($parsedResponse['sessions'][0]['OS']['short_name'], 'Mac');
- $this->assertEquals($parsedResponse['sessions'][0]['OS']['version'], '');
+ $this->assertEquals($parsedResponse['sessions'][0]['OS']['version'], 'Mac');
$this->assertEquals($parsedResponse['sessions'][0]['client']['engine'], 'WebKit');
$this->assertEquals($parsedResponse['sessions'][0]['client']['name'], 'Chrome Mobile iOS');
@@ -227,16 +227,26 @@ class V06Test extends TestCase
$parsedResponse = $this->filter->parse($content, $model);
$this->assertEquals($parsedResponse['sum'], 1);
+ $this->assertEquals($parsedResponse['logs'][0]['brand'], 'Google');
+ $this->assertEquals($parsedResponse['logs'][0]['device'], 'smartphone');
$this->assertEquals($parsedResponse['logs'][0]['event'], 'account.sessions.create');
$this->assertEquals($parsedResponse['logs'][0]['ip'], '127.0.0.1');
- $this->assertEquals($parsedResponse['logs'][0]['time'], 1592981250);
- $this->assertEquals($parsedResponse['logs'][0]['OS'], 'Mac Mac');
- $this->assertEquals($parsedResponse['logs'][0]['client'], 'Chrome Mobile iOS 84.0');
- $this->assertEquals($parsedResponse['logs'][0]['device'], 'smartphone');
- $this->assertEquals($parsedResponse['logs'][0]['brand'], 'Google');
$this->assertEquals($parsedResponse['logs'][0]['model'], 'Nexus 5');
- $this->assertEquals($parsedResponse['logs'][0]['geo']['isoCode'], 'US');
- $this->assertEquals($parsedResponse['logs'][0]['geo']['country'], 'United States');
+ $this->assertEquals($parsedResponse['logs'][0]['time'], 1592981250);
+
+ $this->assertEquals($parsedResponse['sessions'][0]['OS']['name'], 'Mac');
+ $this->assertEquals($parsedResponse['sessions'][0]['OS']['platform'], '');
+ $this->assertEquals($parsedResponse['sessions'][0]['OS']['short_name'], 'Mac');
+ $this->assertEquals($parsedResponse['sessions'][0]['OS']['version'], 'Mac');
+
+ $this->assertEquals($parsedResponse['sessions'][0]['client']['engine'], 'WebKit');
+ $this->assertEquals($parsedResponse['sessions'][0]['client']['name'], 'Chrome Mobile iOS');
+ $this->assertEquals($parsedResponse['sessions'][0]['client']['short_name'], 'CM');
+ $this->assertEquals($parsedResponse['sessions'][0]['client']['type'], 'browser');
+ $this->assertEquals($parsedResponse['sessions'][0]['client']['version'], '84.0');
+
+ $this->assertEquals($parsedResponse['sessions'][0]['geo']['isoCode'], 'US');
+ $this->assertEquals($parsedResponse['sessions'][0]['geo']['country'], 'United States');
}
public function testParseToken()
From 7b1bad0a622a3045de7938f7b31128f4a53fdf39 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Tue, 5 Jan 2021 14:22:20 +0200
Subject: [PATCH 096/230] Reordered some code
---
app/controllers/general.php | 111 +--------------------------------
app/controllers/shared/api.php | 106 ++++++++++++++++++++++++++++++-
app/controllers/shared/web.php | 1 +
3 files changed, 108 insertions(+), 110 deletions(-)
diff --git a/app/controllers/general.php b/app/controllers/general.php
index d77b3d5607..f577f7459e 100644
--- a/app/controllers/general.php
+++ b/app/controllers/general.php
@@ -14,27 +14,19 @@ use Appwrite\Database\Database;
use Appwrite\Database\Document;
use Appwrite\Database\Validator\Authorization;
use Appwrite\Network\Validator\Origin;
-use Appwrite\Storage\Device\Local;
-use Appwrite\Storage\Storage;
use Utopia\CLI\Console;
Config::setParam('domainVerification', false);
Config::setParam('cookieDomain', 'localhost');
Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE);
-App::init(function ($utopia, $request, $response, $console, $project, $user, $locale, $events, $audits, $usage, $deletes, $clients) {
+App::init(function ($utopia, $request, $response, $console, $project, $user, $locale, $clients) {
/** @var Utopia\Swoole\Request $request */
/** @var Appwrite\Utopia\Response $response */
/** @var Appwrite\Database\Document $console */
/** @var Appwrite\Database\Document $project */
/** @var Appwrite\Database\Document $user */
/** @var Utopia\Locale\Locale $locale */
- /** @var Appwrite\Event\Event $events */
- /** @var Appwrite\Event\Event $audits */
- /** @var Appwrite\Event\Event $usage */
- /** @var Appwrite\Event\Event $deletes */
- /** @var Appwrite\Event\Event $functions */
-
/** @var bool $mode */
/** @var array $clients */
@@ -91,9 +83,6 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
: '.'.$request->getHostname()
);
- Storage::setDevice('files', new Local(APP_STORAGE_UPLOADS.'/app-'.$project->getId()));
- Storage::setDevice('functions', new Local(APP_STORAGE_FUNCTIONS.'/app-'.$project->getId()));
-
/*
* Security Headers
*
@@ -110,8 +99,6 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
$response
->addHeader('Server', 'Appwrite')
- ->addHeader('X-XSS-Protection', '1; mode=block; report=/v1/xss?url='.\urlencode($request->getURI()))
- //->addHeader('X-Frame-Options', ($refDomain == 'http://localhost') ? 'SAMEORIGIN' : 'ALLOW-FROM ' . $refDomain)
->addHeader('X-Content-Type-Options', 'nosniff')
->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE')
->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-SDK-Version, Cache-Control, Expires, Pragma')
@@ -123,7 +110,7 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
/*
* Validate Client Domain - Check to avoid CSRF attack
* Adding Appwrite API domains to allow XDOMAIN communication
- * Skip this check for non-web platforms which are not requiredto send an origin header
+ * Skip this check for non-web platforms which are not required to send an origin header
*/
$origin = $request->getOrigin($request->getReferer(''));
$originValidator = new Origin(\array_merge($project->getAttribute('platforms', []), $console->getAttribute('platforms', [])));
@@ -219,99 +206,7 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
throw new Exception('Password reset is required', 412);
}
- /*
- * Background Jobs
- */
-
- $events
- ->setParam('projectId', $project->getId())
- ->setParam('userId', $user->getId())
- ->setParam('event', $route->getLabel('event', ''))
- ->setParam('payload', [])
- ->setParam('functionId', null)
- ->setParam('executionId', null)
- ->setParam('trigger', 'event')
- ;
-
- $audits
- ->setParam('projectId', $project->getId())
- ->setParam('userId', $user->getId())
- ->setParam('event', '')
- ->setParam('resource', '')
- ->setParam('userAgent', $request->getUserAgent(''))
- ->setParam('ip', $request->getIP())
- ->setParam('data', [])
- ;
-
- $usage
- ->setParam('projectId', $project->getId())
- ->setParam('httpRequest', 1)
- ->setParam('httpUrl', $request->getHostname().$request->getURI())
- ->setParam('httpMethod', $request->getMethod())
- ->setParam('networkRequestSize', 0)
- ->setParam('networkResponseSize', 0)
- ->setParam('storage', 0)
- ;
-
- $deletes
- ->setParam('projectId', $project->getId())
- ;
-
-}, ['utopia', 'request', 'response', 'console', 'project', 'user', 'locale', 'events', 'audits', 'usage', 'deletes', 'clients']);
-
-App::shutdown(function ($utopia, $request, $response, $project, $events, $audits, $usage, $deletes, $mode) {
- /** @var Utopia\App $utopia */
- /** @var Utopia\Swoole\Request $request */
- /** @var Appwrite\Utopia\Response $response */
- /** @var Appwrite\Database\Document $project */
- /** @var Appwrite\Event\Event $events */
- /** @var Appwrite\Event\Event $audits */
- /** @var Appwrite\Event\Event $usage */
- /** @var Appwrite\Event\Event $deletes */
- /** @var Appwrite\Event\Event $functions */
- /** @var bool $mode */
-
- if (!empty($events->getParam('event'))) {
- if(empty($events->getParam('payload'))) {
- $events->setParam('payload', $response->getPayload());
- }
-
- $webhooks = clone $events;
- $functions = clone $events;
-
- $webhooks
- ->setQueue('v1-webhooks')
- ->setClass('WebhooksV1')
- ->trigger();
-
- $functions
- ->setQueue('v1-functions')
- ->setClass('FunctionsV1')
- ->trigger();
- }
-
- if (!empty($audits->getParam('event'))) {
- $audits->trigger();
- }
-
- if (!empty($deletes->getParam('type')) && !empty($deletes->getParam('document'))) {
- $deletes->trigger();
- }
-
- $route = $utopia->match($request);
-
- if ($project->getId()
- && $mode !== APP_MODE_ADMIN //TODO: add check to make sure user is admin
- && !empty($route->getLabel('sdk.namespace', null))) { // Don't calculate console usage on admin mode
-
- $usage
- ->setParam('networkRequestSize', $request->getSize() + $usage->getParam('storage'))
- ->setParam('networkResponseSize', $response->getSize())
- ->trigger()
- ;
- }
-
-}, ['utopia', 'request', 'response', 'project', 'events', 'audits', 'usage', 'deletes', 'mode']);
+}, ['utopia', 'request', 'response', 'console', 'project', 'user', 'locale', 'clients']);
App::options(function ($request, $response) {
/** @var Utopia\Swoole\Request $request */
diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php
index d64c46a2cd..0dcd3bc414 100644
--- a/app/controllers/shared/api.php
+++ b/app/controllers/shared/api.php
@@ -4,14 +4,24 @@ use Utopia\App;
use Utopia\Exception;
use Utopia\Abuse\Abuse;
use Utopia\Abuse\Adapters\TimeLimit;
+use Appwrite\Storage\Device\Local;
+use Appwrite\Storage\Storage;
-App::init(function ($utopia, $request, $response, $project, $user, $register) {
+App::init(function ($utopia, $request, $response, $project, $user, $register, $events, $audits, $usage, $deletes) {
/** @var Utopia\App $utopia */
/** @var Utopia\Swoole\Request $request */
/** @var Appwrite\Utopia\Response $response */
/** @var Appwrite\Database\Document $project */
/** @var Appwrite\Database\Document $user */
/** @var Utopia\Registry\Registry $register */
+ /** @var Appwrite\Event\Event $events */
+ /** @var Appwrite\Event\Event $audits */
+ /** @var Appwrite\Event\Event $usage */
+ /** @var Appwrite\Event\Event $deletes */
+ /** @var Appwrite\Event\Event $functions */
+
+ Storage::setDevice('files', new Local(APP_STORAGE_UPLOADS.'/app-'.$project->getId()));
+ Storage::setDevice('functions', new Local(APP_STORAGE_FUNCTIONS.'/app-'.$project->getId()));
$route = $utopia->match($request);
@@ -52,4 +62,96 @@ App::init(function ($utopia, $request, $response, $project, $user, $register) {
if ($abuse->check() && App::getEnv('_APP_OPTIONS_ABUSE', 'enabled') !== 'disabled') {
throw new Exception('Too many requests', 429);
}
-}, ['utopia', 'request', 'response', 'project', 'user', 'register'], 'api');
\ No newline at end of file
+
+ /*
+ * Background Jobs
+ */
+ $events
+ ->setParam('projectId', $project->getId())
+ ->setParam('userId', $user->getId())
+ ->setParam('event', $route->getLabel('event', ''))
+ ->setParam('payload', [])
+ ->setParam('functionId', null)
+ ->setParam('executionId', null)
+ ->setParam('trigger', 'event')
+ ;
+
+ $audits
+ ->setParam('projectId', $project->getId())
+ ->setParam('userId', $user->getId())
+ ->setParam('event', '')
+ ->setParam('resource', '')
+ ->setParam('userAgent', $request->getUserAgent(''))
+ ->setParam('ip', $request->getIP())
+ ->setParam('data', [])
+ ;
+
+ $usage
+ ->setParam('projectId', $project->getId())
+ ->setParam('httpRequest', 1)
+ ->setParam('httpUrl', $request->getHostname().$request->getURI())
+ ->setParam('httpMethod', $request->getMethod())
+ ->setParam('networkRequestSize', 0)
+ ->setParam('networkResponseSize', 0)
+ ->setParam('storage', 0)
+ ;
+
+ $deletes
+ ->setParam('projectId', $project->getId())
+ ;
+
+}, ['utopia', 'request', 'response', 'project', 'user', 'register', 'events', 'audits', 'usage', 'deletes'], 'api');
+
+App::shutdown(function ($utopia, $request, $response, $project, $events, $audits, $usage, $deletes, $mode) {
+ /** @var Utopia\App $utopia */
+ /** @var Utopia\Swoole\Request $request */
+ /** @var Appwrite\Utopia\Response $response */
+ /** @var Appwrite\Database\Document $project */
+ /** @var Appwrite\Event\Event $events */
+ /** @var Appwrite\Event\Event $audits */
+ /** @var Appwrite\Event\Event $usage */
+ /** @var Appwrite\Event\Event $deletes */
+ /** @var Appwrite\Event\Event $functions */
+ /** @var bool $mode */
+
+ if (!empty($events->getParam('event'))) {
+ if(empty($events->getParam('payload'))) {
+ $events->setParam('payload', $response->getPayload());
+ }
+
+ $webhooks = clone $events;
+ $functions = clone $events;
+
+ $webhooks
+ ->setQueue('v1-webhooks')
+ ->setClass('WebhooksV1')
+ ->trigger();
+
+ $functions
+ ->setQueue('v1-functions')
+ ->setClass('FunctionsV1')
+ ->trigger();
+ }
+
+ if (!empty($audits->getParam('event'))) {
+ $audits->trigger();
+ }
+
+ if (!empty($deletes->getParam('type')) && !empty($deletes->getParam('document'))) {
+ $deletes->trigger();
+ }
+
+ $route = $utopia->match($request);
+
+ if ($project->getId()
+ && $mode !== APP_MODE_ADMIN //TODO: add check to make sure user is admin
+ && !empty($route->getLabel('sdk.namespace', null))) { // Don't calculate console usage on admin mode
+
+ $usage
+ ->setParam('networkRequestSize', $request->getSize() + $usage->getParam('storage'))
+ ->setParam('networkResponseSize', $response->getSize())
+ ->trigger()
+ ;
+ }
+
+}, ['utopia', 'request', 'response', 'project', 'events', 'audits', 'usage', 'deletes', 'mode'], 'api');
diff --git a/app/controllers/shared/web.php b/app/controllers/shared/web.php
index 42d2a18c55..43eaf74d09 100644
--- a/app/controllers/shared/web.php
+++ b/app/controllers/shared/web.php
@@ -37,6 +37,7 @@ App::init(function ($utopia, $request, $response, $layout) {
->addHeader('Cache-Control', 'public, max-age='.$time)
->addHeader('Expires', \date('D, d M Y H:i:s', \time() + $time).' GMT') // 45 days cache
->addHeader('X-Frame-Options', 'SAMEORIGIN') // Avoid console and homepage from showing in iframes
+ ->addHeader('X-XSS-Protection', '1; mode=block; report=/v1/xss?url='.\urlencode($request->getURI()))
->addHeader('X-UA-Compatible', 'IE=Edge') // Deny IE browsers from going into quirks mode
;
From 075d46ba627ec657f2dbd5f894bbbe83559ff3ab Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Tue, 5 Jan 2021 18:27:18 +0530
Subject: [PATCH 097/230] feat: changed team and team list response format and
added tests
---
src/Appwrite/Utopia/Response/Filters/V06.php | 22 ++++++++-
tests/unit/Utopia/Filters/V06Test.php | 47 ++++++++++++++++++++
2 files changed, 67 insertions(+), 2 deletions(-)
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index f386edc6ad..4bbeccb83e 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -52,11 +52,11 @@ class V06 extends Filter {
break;
case Response::MODEL_TEAM:
- $parsedResponse = $content;
+ $parsedResponse = $this->parseTeam($content);
break;
case Response::MODEL_TEAM_LIST:
- $parsedResponse = $content['teams'];
+ $parsedResponse = $this->parseTeamList($content);
break;
case Response::MODEL_MEMBERSHIP:
@@ -209,6 +209,24 @@ class V06 extends Filter {
return $content;
}
+ private function parseTeam(array $content)
+ {
+ $content['$collection'] = Database::SYSTEM_COLLECTION_TEAMS;
+ $content['$permissions'] = [];
+ return $content;
+ }
+
+ private function parseTeamList(array $content)
+ {
+ $teams = $content['teams'];
+ $parsedResponse = [];
+ foreach($teams as $team) {
+ $parsedResponse[] = $this->parseTeam($team);
+ }
+ $content['teams'] = $parsedResponse;
+ return $content;
+ }
+
private function parseLogList(array $content)
{
$logs = $content['logs'];
diff --git a/tests/unit/Utopia/Filters/V06Test.php b/tests/unit/Utopia/Filters/V06Test.php
index 97804acd32..5f680fc547 100644
--- a/tests/unit/Utopia/Filters/V06Test.php
+++ b/tests/unit/Utopia/Filters/V06Test.php
@@ -249,6 +249,53 @@ class V06Test extends TestCase
$this->assertEquals($parsedResponse['sessions'][0]['geo']['country'], 'United States');
}
+ public function testParseTeam()
+ {
+ $content = [
+ '$id' => '5ff45ef261829',
+ 'name' => 'test',
+ 'dateCreated' => 1592981250,
+ 'sum' => 7
+ ];
+
+ $model = Response::MODEL_TEAM;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['$id'], '5ff45ef261829');
+ $this->assertEquals($parsedResponse['name'], 'test');
+ $this->assertEquals($parsedResponse['dateCreated'], 1592981250);
+ $this->assertEquals($parsedResponse['sum'], 7);
+ $this->assertEquals($parsedResponse['$collection'], 'teams');
+ $this->assertEquals($parsedResponse['$permissions'], []);
+ }
+
+ public function testParseTeamList()
+ {
+ $content = [
+ 'sum' => 1,
+ 'teams' => [
+ 0 => [
+ '$id' => '5ff45ef261829',
+ 'name' => 'test',
+ 'dateCreated' => 1592981250,
+ 'sum' => 7
+ ]
+ ]
+ ];
+
+ $model = Response::MODEL_TEAM_LIST;
+ $parsedResponse = $this->filter->parse($content, $model);
+
+ $this->assertEquals($parsedResponse['sum'], 1);
+ $this->assertEquals($parsedResponse['teams'][0]['$id'], '5ff45ef261829');
+ $this->assertEquals($parsedResponse['teams'][0]['name'], 'test');
+ $this->assertEquals($parsedResponse['teams'][0]['dateCreated'], 1592981250);
+ $this->assertEquals($parsedResponse['teams'][0]['sum'], 7);
+ $this->assertEquals($parsedResponse['teams'][0]['$collection'], 'teams');
+ $this->assertEquals($parsedResponse['teams'][0]['$permissions'], []);
+
+ }
+
public function testParseToken()
{
$content = [
From 3d9060bdab47248b9bf97083a319ac1d051aa14a Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Tue, 5 Jan 2021 14:58:16 +0200
Subject: [PATCH 098/230] Changed constants
---
app/config/roles.php | 21 +++++++--------------
src/Appwrite/Auth/Auth.php | 1 +
2 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/app/config/roles.php b/app/config/roles.php
index 8dfaf78eb4..506b2403c6 100644
--- a/app/config/roles.php
+++ b/app/config/roles.php
@@ -1,13 +1,6 @@
[
+ Auth::USER_ROLE_GUEST => [
'label' => 'Guest',
'scopes' => [
'public',
@@ -71,23 +64,23 @@ return [
'execution.write',
],
],
- ROLE_MEMBER => [
+ Auth::USER_ROLE_MEMBER => [
'label' => 'Member',
'scopes' => \array_merge($logged, []),
],
- ROLE_ADMIN => [
+ Auth::USER_ROLE_ADMIN => [
'label' => 'Admin',
'scopes' => \array_merge($admins, []),
],
- ROLE_DEVELOPER => [
+ Auth::USER_ROLE_DEVELOPER => [
'label' => 'Developer',
'scopes' => \array_merge($admins, []),
],
- ROLE_OWNER => [
+ Auth::USER_ROLE_OWNER => [
'label' => 'Owner',
'scopes' => \array_merge($logged, $admins, []),
],
- ROLE_APP => [
+ Auth::USER_ROLE_APP => [
'label' => 'Application',
'scopes' => ['health.read'],
],
diff --git a/src/Appwrite/Auth/Auth.php b/src/Appwrite/Auth/Auth.php
index 88eb11299d..e43ab78bff 100644
--- a/src/Appwrite/Auth/Auth.php
+++ b/src/Appwrite/Auth/Auth.php
@@ -23,6 +23,7 @@ class Auth
const USER_ROLE_OWNER = 4;
const USER_ROLE_APP = 5;
const USER_ROLE_SYSTEM = 6;
+ const USER_ROLE_ALL = '*';
/**
* Token Types.
From bf2c70f033ad30db09120a3e11ed7b4b1ff73467 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Tue, 5 Jan 2021 15:22:17 +0200
Subject: [PATCH 099/230] added new sub-categories
---
CHANGES.md | 63 +++++++++++++++++++++++++++++++-----------------------
1 file changed, 36 insertions(+), 27 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index da80a61cc9..53c49c5bee 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -3,36 +3,24 @@
## Features
- Improved Webhooks and New System Events - [Learn more]()
-- New QR code generator library (@PedroCisnerosSantana - [#475](https://github.com/appwrite/appwrite/issues/475))
+
+
+### New APIs
- Added response to /locale/languages API with a list of languages (@TorstenDittmann ,[#351](https://github.com/appwrite/appwrite/issues/351))
-- Added API response payload structure info and examples to the docs site ([#381](https://github.com/appwrite/appwrite/issues/381))
-- Added Google Fonts to Appwrite for offline availability
- Added a new route in the Avatars API to get user initials avatar ([#386](https://github.com/appwrite/appwrite/issues/386))
-- Added option to delete team from the console ([#380](https://github.com/appwrite/appwrite/issues/380))
-- Added option to view team members from the console ([#378](https://github.com/appwrite/appwrite/issues/378))
-- Add option to assign new team members to a team from the console and the API ([#379](https://github.com/appwrite/appwrite/issues/379))
+- Added API response payload structure info and examples to the docs site ([#381](https://github.com/appwrite/appwrite/issues/381))
- Added support for Brotli compression (@PedroCisnerosSantana, @Rohitub222, [#310](https://github.com/appwrite/appwrite/issues/310))
-- Added Select All Checkbox for on Console API key Scopes Screen ([#477](https://github.com/appwrite/appwrite/issues/477))
-- Added pagination and search for team memberships route ([#387](https://github.com/appwrite/appwrite/issues/387))
-- UI performance & accessibility improvements ([#406](https://github.com/appwrite/appwrite/pull/406))
-- Added option to delete user from the console (@PineappleIOnic - #538)
-- Created lazy deletion of data worker ([#521](https://github.com/appwrite/appwrite/issues/521))
-- All emails are now sent asynchronously for improved performance (@TorstenDittmann ,[#402](https://github.com/appwrite/appwrite/pull/402))
-- Updated grid for OAuth2 providers list in the console ([#413](https://github.com/appwrite/appwrite/issues/413))
-- Upgraded Redis Resque queue library to version 1.3.6 ([#319](https://github.com/appwrite/appwrite/issues/319))
+- New deletion worker ([#521](https://github.com/appwrite/appwrite/issues/521))
+- New maintenance worker - cleaning up system logs and other optimizations ([#766](https://github.com/appwrite/appwrite/pull/766))
+- New email worker - all emails are now sent asynchronously for improved performance (@TorstenDittmann ,[#402](https://github.com/appwrite/appwrite/pull/402))
- Moved all Appwrite container logs to STDOUT & STDERR ([#389](https://github.com/appwrite/appwrite/issues/389))
-- New UI micro-interactions and CSS fixes (@AnatoleLucet)
- New Doctor CLI to debug the Appwrite server ([#415](https://github.com/appwrite/appwrite/issues/415))
- Added container names to docker-compose.yml (@drandell)
-- Upgraded ClamAV container image to version 1.0.11 ([#412](https://github.com/appwrite/appwrite/issues/412))
- Optimised function execution by using fully-qualified function calls
- Added support for boolean 'true' and 'false' in query strings alongside 1 and 0
-- Added pagination for projects list on the console home page.
- Updated storage calculation to match IEC standards
- Now using Alpine as base Docker image
-- Upgraded device detctor to version 3.12.6
-- Upgraded MariaDB to version 10.5.5
-- Switch standard ports to 95xx prefix ([#780](https://github.com/appwrite/appwrite/pull/780))
+- Switch standard dev ports to 95xx prefix ([#780](https://github.com/appwrite/appwrite/pull/780))
- User & Team name max length is now 128 chars and not 100 for better API consistency
- Collection name max length is now 128 chars and not 256 for better API consistency
- Project name max length is now 128 chars and not 100 for better API consistency
@@ -40,20 +28,43 @@
- API Key name max length is now 128 chars and not 256 for better API consistency
- Task name max length is now 128 chars and not 256 for better API consistency
- Platform name max length is now 128 chars and not 256 for better API consistency
-- Webhooks payloads are now exactly the same as any of the API response objects
+- Webhooks payloads are now exactly the same as any of the API response objects, documentation added
- Added new locale: Marathi -mr (@spielers)
- New and consistent response format for all API object + new response examples in the docs
- Removed user roles attribute from user object (can be fetched from /v1/teams/memberships) **
- Removed type attribute from session object response (used only internally)
- ** - might be changed before merging to master
-- Upgraded Traefik image to version 2.3
-- Upgraded Redis Docker image to version 6.0 (alpine)
-- Upgraded Influxdb Docker image to version 1.8 (alpine)
-- Added option to disable mail sending by setting empty SMTP host
+ - Added fallback option to 0.6 format for backward compatibility with any changes (@christyjacob4 [#772](https://github.com/appwrite/appwrite/pull/772))
+- Added option to disable mail sending by setting an empty SMTP host value ([#730](https://github.com/appwrite/appwrite/issues/730))
- Upgraded installation script ([#490](https://github.com/appwrite/appwrite/issues/490))
- Added new environment variables for ClamAV hostname and port ([#780](https://github.com/appwrite/appwrite/pull/780))
+- New OAuth adapter for Box.com (@armino-dev - [#420](https://github.com/appwrite/appwrite/issues/410))
+- New OAuth adapter for PayPal sandbox (@armino-dev - [#420](https://github.com/appwrite/appwrite/issues/410))
+
+### User Interface
+- Updated grid for OAuth2 providers list in the console ([#413](https://github.com/appwrite/appwrite/issues/413))
+- Added Google Fonts to Appwrite for offline availability
+- Added option to delete user from the console (@PineappleIOnic - [#538](https://github.com/appwrite/appwrite/issues/538))
+- Added option to delete team from the console ([#380](https://github.com/appwrite/appwrite/issues/380))
+- Added option to view team members from the console ([#378](https://github.com/appwrite/appwrite/issues/378))
+- Add option to assign new team members to a team from the console and the API ([#379](https://github.com/appwrite/appwrite/issues/379))
+- Added Select All Checkbox for on Console API key Scopes Screen ([#477](https://github.com/appwrite/appwrite/issues/477))
+- Added pagination and search for team memberships route ([#387](https://github.com/appwrite/appwrite/issues/387))
+- Added pagination for projects list on the console home page.
+- UI performance & accessibility improvements ([#406](https://github.com/appwrite/appwrite/pull/406))
+- New UI micro-interactions and CSS fixes (@AnatoleLucet)
- Added toggle to hide/show secret keys and passwords inside the dashboard (@kodumbeats, [#535](https://github.com/appwrite/appwrite/issues/535))
+### Upgrades
+- Upgraded QR codes generator library (@PedroCisnerosSantana - [#475](https://github.com/appwrite/appwrite/issues/475))
+- Upgraded Traefik image to version 2.3
+- Upgraded MariaDB to version 10.5.5
+- Upgraded Redis Docker image to version 6.0 (alpine)
+- Upgraded Influxdb Docker image to version 1.8 (alpine)
+- Upgraded Redis Resque queue library to version 1.3.6 ([#319](https://github.com/appwrite/appwrite/issues/319))
+- Upgraded ClamAV container image to version 1.0.11 ([#412](https://github.com/appwrite/appwrite/issues/412))
+- Upgraded device detctor to version 3.12.6
+
## Breaking Changes (Read before upgrading!)
- **Deprecated** `first` and `last` query params for documents list route in the database API
- **Deprecated** Deprectaed Pubjabi Translations ('pn')
@@ -91,8 +102,6 @@
- Fixed Bug when trying to overwrite OAuth cookie in the Flutter SDK
- Fixed OAuth redirect when using the self-hosted instance default success URL ([#454](https://github.com/appwrite/appwrite/issues/454))
- Fixed bug denying authentication with Github OAuth provider
-- New OAuth adapter for Box.com
-- New OAuth adapter for PayPal sandbox
- Fixed a bug making read permission overwrite write permission in some cases
## Breaking Changes
From 855858c42064ab19805dc84e73e3730f50152f45 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Tue, 5 Jan 2021 15:25:01 +0200
Subject: [PATCH 100/230] Removed duplicates
---
CHANGES.md | 5 -----
1 file changed, 5 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index 53c49c5bee..fb6ce00924 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -103,11 +103,6 @@
- Fixed OAuth redirect when using the self-hosted instance default success URL ([#454](https://github.com/appwrite/appwrite/issues/454))
- Fixed bug denying authentication with Github OAuth provider
- Fixed a bug making read permission overwrite write permission in some cases
-
-## Breaking Changes
-- **Deprecated** `first` and `last` query params for documents list route in the database API
-- **Deprecated** Deprecated Punjabi Translations ('pn')
-
## Security
- Access to Health API now requires authentication with an API Key with access to `health.read` scope allowed
From a951b9a0f9301a017e0dbad64ff0d7d937d50c05 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Tue, 5 Jan 2021 15:26:31 +0200
Subject: [PATCH 101/230] Removed subtitle
---
CHANGES.md | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index fb6ce00924..d9ec45dd6c 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -2,10 +2,7 @@
## Features
-- Improved Webhooks and New System Events - [Learn more]()
-
-
-### New APIs
+- Improved Webhooks and added new system events - [Learn more]()
- Added response to /locale/languages API with a list of languages (@TorstenDittmann ,[#351](https://github.com/appwrite/appwrite/issues/351))
- Added a new route in the Avatars API to get user initials avatar ([#386](https://github.com/appwrite/appwrite/issues/386))
- Added API response payload structure info and examples to the docs site ([#381](https://github.com/appwrite/appwrite/issues/381))
From 5db9c9b6253f3ae4c9601a391543f2a85668090d Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Tue, 5 Jan 2021 19:16:06 +0530
Subject: [PATCH 102/230] feat: review comments
---
app/controllers/general.php | 2 +-
src/Appwrite/Utopia/Response/Filters/V06.php | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/app/controllers/general.php b/app/controllers/general.php
index ed45f528dd..55f196e266 100644
--- a/app/controllers/general.php
+++ b/app/controllers/general.php
@@ -100,7 +100,7 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
* Response format
*/
$responseFormat = $request->getHeader('x-appwrite-response-format', App::getEnv('_APP_SYSTEM_RESPONSE_FORMAT', ''));
- if (!empty($responseFormat)) {
+ if ($responseFormat) {
switch($responseFormat) {
case version_compare ($responseFormat , '0.6.2', '<=') :
Response::setFilter(new V06());
diff --git a/src/Appwrite/Utopia/Response/Filters/V06.php b/src/Appwrite/Utopia/Response/Filters/V06.php
index 4bbeccb83e..d6bd85ac8f 100644
--- a/src/Appwrite/Utopia/Response/Filters/V06.php
+++ b/src/Appwrite/Utopia/Response/Filters/V06.php
@@ -193,13 +193,13 @@ class V06 extends Filter {
private function parseLocale(array $content)
{
- $content['ip'] = empty($content['ip']) ? '' : $content['ip'];
- $content['countryCode'] = empty($content['countryCode']) ? '--' : $content['countryCode'];
- $content['country'] = empty($content['country']) ? Locale::getText('locale.country.unknown') : $content['country'];
- $content['continent'] = empty($content['continent']) ? Locale::getText('locale.country.unknown') : $content['continent'];
- $content['continentCode'] = empty($content['continentCode']) ? '--' : $content['continentCode'];
- $content['eu'] = empty($content['eu']) ? false : $content['eu'];
- $content['currency'] = empty($content['currency']) ? null : $content['currency'];
+ $content['ip'] = empty($content['ip']) ?? '';
+ $content['countryCode'] = empty($content['countryCode']) ?? '--';
+ $content['country'] = empty($content['country']) ?? Locale::getText('locale.country.unknown');
+ $content['continent'] = empty($content['continent']) ?? Locale::getText('locale.country.unknown');
+ $content['continentCode'] = empty($content['continentCode']) ?? '--';
+ $content['eu'] = empty($content['eu']) ?? false;
+ $content['currency'] = empty($content['currency']) ?? null;
return $content;
}
From 4a05e963901b7d9c468ea207e4a95e8d0afabc4e Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Tue, 5 Jan 2021 23:33:36 +0200
Subject: [PATCH 103/230] Updated dependencies
---
composer.json | 2 +-
composer.lock | 24 ++++++++++++------------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/composer.json b/composer.json
index a74996f91a..f0dc6c104c 100644
--- a/composer.json
+++ b/composer.json
@@ -56,7 +56,7 @@
},
"require-dev": {
"swoole/ide-helper": "4.5.5",
- "appwrite/sdk-generator": "0.3.2",
+ "appwrite/sdk-generator": "0.3.3",
"phpunit/phpunit": "9.4.2",
"vimeo/psalm": "4.1.1"
},
diff --git a/composer.lock b/composer.lock
index 42591c7182..23bbf8edea 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "229bcebe0c03153ab739cd324fb4eb43",
+ "content-hash": "2dee8b75780ba88fd7da28d08d691998",
"packages": [
{
"name": "appwrite/php-clamav",
@@ -1858,11 +1858,11 @@
},
{
"name": "appwrite/sdk-generator",
- "version": "0.3.2",
+ "version": "0.3.3",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator",
- "reference": "7d762df83f2539ca89605e40541afbdb20941542"
+ "reference": "7530820a1ee824874d89749c51b0e49d15595abc"
},
"require": {
"ext-curl": "*",
@@ -1892,7 +1892,7 @@
}
],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
- "time": "2021-01-04T16:19:42+00:00"
+ "time": "2021-01-05T17:58:17+00:00"
},
{
"name": "composer/package-versions-deprecated",
@@ -4513,12 +4513,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "5a8ebe413fbd4091d5b3c5b70e298141681c59c7"
+ "reference": "af2bafc13cb92e182bf634285346925e09888d23"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/5a8ebe413fbd4091d5b3c5b70e298141681c59c7",
- "reference": "5a8ebe413fbd4091d5b3c5b70e298141681c59c7",
+ "url": "https://api.github.com/repos/symfony/console/zipball/af2bafc13cb92e182bf634285346925e09888d23",
+ "reference": "af2bafc13cb92e182bf634285346925e09888d23",
"shasum": ""
},
"require": {
@@ -4603,7 +4603,7 @@
"type": "tidelift"
}
],
- "time": "2021-01-01T09:27:20+00:00"
+ "time": "2021-01-05T19:51:30+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -5318,12 +5318,12 @@
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
- "reference": "846ebbd7c8e780913fa5731d9c6139522111b56f"
+ "reference": "a0e2cc25723f3cdb6bbaf617664c4e228f1e9886"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/twigphp/Twig/zipball/846ebbd7c8e780913fa5731d9c6139522111b56f",
- "reference": "846ebbd7c8e780913fa5731d9c6139522111b56f",
+ "url": "https://api.github.com/repos/twigphp/Twig/zipball/a0e2cc25723f3cdb6bbaf617664c4e228f1e9886",
+ "reference": "a0e2cc25723f3cdb6bbaf617664c4e228f1e9886",
"shasum": ""
},
"require": {
@@ -5389,7 +5389,7 @@
"type": "tidelift"
}
],
- "time": "2021-01-01T14:57:43+00:00"
+ "time": "2021-01-05T15:39:16+00:00"
},
{
"name": "vimeo/psalm",
From bb0725261d0edb6fc5e28e2eedbe4acfef32aea2 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Tue, 5 Jan 2021 23:34:49 +0200
Subject: [PATCH 104/230] Updated code examples
---
.../0.6.2/server-dotnet/examples/avatars/get-browser.md | 8 ++++----
.../server-dotnet/examples/avatars/get-credit-card.md | 8 ++++----
.../0.6.2/server-dotnet/examples/avatars/get-favicon.md | 8 ++++----
.../0.6.2/server-dotnet/examples/avatars/get-flag.md | 8 ++++----
.../0.6.2/server-dotnet/examples/avatars/get-image.md | 8 ++++----
.../0.6.2/server-dotnet/examples/avatars/get-initials.md | 8 ++++----
.../0.6.2/server-dotnet/examples/avatars/get-q-r.md | 8 ++++----
.../server-dotnet/examples/database/create-collection.md | 8 ++++----
.../server-dotnet/examples/database/create-document.md | 8 ++++----
.../server-dotnet/examples/database/delete-collection.md | 8 ++++----
.../server-dotnet/examples/database/delete-document.md | 8 ++++----
.../server-dotnet/examples/database/get-collection.md | 8 ++++----
.../0.6.2/server-dotnet/examples/database/get-document.md | 8 ++++----
.../server-dotnet/examples/database/list-collections.md | 8 ++++----
.../server-dotnet/examples/database/list-documents.md | 8 ++++----
.../server-dotnet/examples/database/update-collection.md | 8 ++++----
.../server-dotnet/examples/database/update-document.md | 8 ++++----
.../0.6.2/server-dotnet/examples/health/get-anti-virus.md | 8 ++++----
.../0.6.2/server-dotnet/examples/health/get-cache.md | 8 ++++----
.../0.6.2/server-dotnet/examples/health/get-d-b.md | 8 ++++----
.../examples/health/get-queue-certificates.md | 8 ++++----
.../server-dotnet/examples/health/get-queue-functions.md | 8 ++++----
.../0.6.2/server-dotnet/examples/health/get-queue-logs.md | 8 ++++----
.../server-dotnet/examples/health/get-queue-tasks.md | 8 ++++----
.../server-dotnet/examples/health/get-queue-usage.md | 8 ++++----
.../server-dotnet/examples/health/get-queue-webhooks.md | 8 ++++----
.../server-dotnet/examples/health/get-storage-local.md | 8 ++++----
.../0.6.2/server-dotnet/examples/health/get-time.md | 8 ++++----
docs/examples/0.6.2/server-dotnet/examples/health/get.md | 8 ++++----
.../0.6.2/server-dotnet/examples/locale/get-continents.md | 8 ++++----
.../server-dotnet/examples/locale/get-countries-e-u.md | 8 ++++----
.../server-dotnet/examples/locale/get-countries-phones.md | 8 ++++----
.../0.6.2/server-dotnet/examples/locale/get-countries.md | 8 ++++----
.../0.6.2/server-dotnet/examples/locale/get-currencies.md | 8 ++++----
.../0.6.2/server-dotnet/examples/locale/get-languages.md | 8 ++++----
docs/examples/0.6.2/server-dotnet/examples/locale/get.md | 8 ++++----
.../0.6.2/server-dotnet/examples/storage/create-file.md | 8 ++++----
.../0.6.2/server-dotnet/examples/storage/delete-file.md | 8 ++++----
.../server-dotnet/examples/storage/get-file-download.md | 8 ++++----
.../server-dotnet/examples/storage/get-file-preview.md | 8 ++++----
.../0.6.2/server-dotnet/examples/storage/get-file-view.md | 8 ++++----
.../0.6.2/server-dotnet/examples/storage/get-file.md | 8 ++++----
.../0.6.2/server-dotnet/examples/storage/list-files.md | 8 ++++----
.../0.6.2/server-dotnet/examples/storage/update-file.md | 8 ++++----
.../server-dotnet/examples/teams/create-membership.md | 8 ++++----
.../examples/0.6.2/server-dotnet/examples/teams/create.md | 8 ++++----
.../server-dotnet/examples/teams/delete-membership.md | 8 ++++----
.../examples/0.6.2/server-dotnet/examples/teams/delete.md | 8 ++++----
.../0.6.2/server-dotnet/examples/teams/get-memberships.md | 8 ++++----
docs/examples/0.6.2/server-dotnet/examples/teams/get.md | 8 ++++----
docs/examples/0.6.2/server-dotnet/examples/teams/list.md | 8 ++++----
.../examples/0.6.2/server-dotnet/examples/teams/update.md | 8 ++++----
.../examples/0.6.2/server-dotnet/examples/users/create.md | 8 ++++----
.../0.6.2/server-dotnet/examples/users/delete-session.md | 8 ++++----
.../0.6.2/server-dotnet/examples/users/delete-sessions.md | 8 ++++----
.../0.6.2/server-dotnet/examples/users/get-logs.md | 8 ++++----
.../0.6.2/server-dotnet/examples/users/get-prefs.md | 8 ++++----
.../0.6.2/server-dotnet/examples/users/get-sessions.md | 8 ++++----
docs/examples/0.6.2/server-dotnet/examples/users/get.md | 8 ++++----
docs/examples/0.6.2/server-dotnet/examples/users/list.md | 8 ++++----
.../0.6.2/server-dotnet/examples/users/update-prefs.md | 8 ++++----
.../0.6.2/server-dotnet/examples/users/update-status.md | 8 ++++----
62 files changed, 248 insertions(+), 248 deletions(-)
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-browser.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-browser.md
index 6d6a5b7f18..d4c2d0312d 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-browser.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-browser.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Avatars avatars = new Avatars(client);
-result = avatars.getBrowser("aa");
+string result = await avatars.GetBrowser("aa");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-credit-card.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-credit-card.md
index 8a89c04618..d0ab8d7205 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-credit-card.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-credit-card.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Avatars avatars = new Avatars(client);
-result = avatars.getCreditCard("amex");
+string result = await avatars.GetCreditCard("amex");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-favicon.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-favicon.md
index d51b02a7c3..85155dbfd4 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-favicon.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-favicon.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Avatars avatars = new Avatars(client);
-result = avatars.getFavicon("https://example.com");
+string result = await avatars.GetFavicon("https://example.com");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-flag.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-flag.md
index 88a06d16ff..031b52af14 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-flag.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-flag.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Avatars avatars = new Avatars(client);
-result = avatars.getFlag("af");
+string result = await avatars.GetFlag("af");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-image.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-image.md
index 06d021dcf7..d8e6c98558 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-image.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-image.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Avatars avatars = new Avatars(client);
-result = avatars.getImage("https://example.com");
+string result = await avatars.GetImage("https://example.com");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-initials.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-initials.md
index 09e91e0120..177216034b 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-initials.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-initials.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Avatars avatars = new Avatars(client);
-result = avatars.getInitials();
+string result = await avatars.GetInitials();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-q-r.md b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-q-r.md
index 5f410cd4ae..e057ed6877 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/avatars/get-q-r.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/avatars/get-q-r.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Avatars avatars = new Avatars(client);
-result = avatars.getQR("[TEXT]");
+string result = await avatars.GetQR("[TEXT]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/create-collection.md b/docs/examples/0.6.2/server-dotnet/examples/database/create-collection.md
index 92a26b5559..a8c2c3f7e0 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/database/create-collection.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/create-collection.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Database database = new Database(client);
-result = database.createCollection("[NAME]", {}, {}, {});
+HttpResponseMessage result = await database.CreateCollection("[NAME]", {}, {}, {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/create-document.md b/docs/examples/0.6.2/server-dotnet/examples/database/create-document.md
index 70d00bac14..1a875067a1 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/database/create-document.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/create-document.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Database database = new Database(client);
-result = database.createDocument("[COLLECTION_ID]", {}, {}, {});
+HttpResponseMessage result = await database.CreateDocument("[COLLECTION_ID]", {}, {}, {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/delete-collection.md b/docs/examples/0.6.2/server-dotnet/examples/database/delete-collection.md
index 7a611e4778..4648a3e194 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/database/delete-collection.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/delete-collection.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Database database = new Database(client);
-result = database.deleteCollection("[COLLECTION_ID]");
+HttpResponseMessage result = await database.DeleteCollection("[COLLECTION_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/delete-document.md b/docs/examples/0.6.2/server-dotnet/examples/database/delete-document.md
index 7af78fc558..80f413b468 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/database/delete-document.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/delete-document.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Database database = new Database(client);
-result = database.deleteDocument("[COLLECTION_ID]", "[DOCUMENT_ID]");
+HttpResponseMessage result = await database.DeleteDocument("[COLLECTION_ID]", "[DOCUMENT_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/get-collection.md b/docs/examples/0.6.2/server-dotnet/examples/database/get-collection.md
index f2bc02fc97..88f046ba2e 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/database/get-collection.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/get-collection.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Database database = new Database(client);
-result = database.getCollection("[COLLECTION_ID]");
+HttpResponseMessage result = await database.GetCollection("[COLLECTION_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/get-document.md b/docs/examples/0.6.2/server-dotnet/examples/database/get-document.md
index 376057e59b..1d425bac59 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/database/get-document.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/get-document.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Database database = new Database(client);
-result = database.getDocument("[COLLECTION_ID]", "[DOCUMENT_ID]");
+HttpResponseMessage result = await database.GetDocument("[COLLECTION_ID]", "[DOCUMENT_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/list-collections.md b/docs/examples/0.6.2/server-dotnet/examples/database/list-collections.md
index b9af7abf1c..593438d255 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/database/list-collections.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/list-collections.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Database database = new Database(client);
-result = database.listCollections();
+HttpResponseMessage result = await database.ListCollections();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/list-documents.md b/docs/examples/0.6.2/server-dotnet/examples/database/list-documents.md
index 355bc43476..36e31468f9 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/database/list-documents.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/list-documents.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Database database = new Database(client);
-result = database.listDocuments("[COLLECTION_ID]");
+HttpResponseMessage result = await database.ListDocuments("[COLLECTION_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/update-collection.md b/docs/examples/0.6.2/server-dotnet/examples/database/update-collection.md
index 33ae0d7d91..42c67650d1 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/database/update-collection.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/update-collection.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Database database = new Database(client);
-result = database.updateCollection("[COLLECTION_ID]", "[NAME]", {}, {});
+HttpResponseMessage result = await database.UpdateCollection("[COLLECTION_ID]", "[NAME]", {}, {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/update-document.md b/docs/examples/0.6.2/server-dotnet/examples/database/update-document.md
index 719d9f5e2e..5f4c173b7a 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/database/update-document.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/update-document.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Database database = new Database(client);
-result = database.updateDocument("[COLLECTION_ID]", "[DOCUMENT_ID]", {}, {}, {});
+HttpResponseMessage result = await database.UpdateDocument("[COLLECTION_ID]", "[DOCUMENT_ID]", {}, {}, {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-anti-virus.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-anti-virus.md
index 3a2b920271..a287ec4617 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/health/get-anti-virus.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-anti-virus.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Health health = new Health(client);
-result = health.getAntiVirus();
+HttpResponseMessage result = await health.GetAntiVirus();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-cache.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-cache.md
index cba191b265..66c72f77b6 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/health/get-cache.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-cache.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Health health = new Health(client);
-result = health.getCache();
+HttpResponseMessage result = await health.GetCache();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-d-b.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-d-b.md
index 27a46ffe7c..94e3556b4e 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/health/get-d-b.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-d-b.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Health health = new Health(client);
-result = health.getDB();
+HttpResponseMessage result = await health.GetDB();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-certificates.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-certificates.md
index 895147525a..f0dbb9086b 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-certificates.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-certificates.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Health health = new Health(client);
-result = health.getQueueCertificates();
+HttpResponseMessage result = await health.GetQueueCertificates();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-functions.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-functions.md
index 1e6130ddbd..c0a0b14628 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-functions.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-functions.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Health health = new Health(client);
-result = health.getQueueFunctions();
+HttpResponseMessage result = await health.GetQueueFunctions();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-logs.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-logs.md
index bf9dec6e7c..11ea9dbff1 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-logs.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-logs.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Health health = new Health(client);
-result = health.getQueueLogs();
+HttpResponseMessage result = await health.GetQueueLogs();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-tasks.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-tasks.md
index 0ca3a4b3f0..291e5ea8bd 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-tasks.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-tasks.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Health health = new Health(client);
-result = health.getQueueTasks();
+HttpResponseMessage result = await health.GetQueueTasks();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-usage.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-usage.md
index 74cedc0bca..ecd4f69180 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-usage.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-usage.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Health health = new Health(client);
-result = health.getQueueUsage();
+HttpResponseMessage result = await health.GetQueueUsage();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-webhooks.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-webhooks.md
index eb7f9071c1..b16a368469 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-webhooks.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-queue-webhooks.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Health health = new Health(client);
-result = health.getQueueWebhooks();
+HttpResponseMessage result = await health.GetQueueWebhooks();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-storage-local.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-storage-local.md
index 0cfc305b63..793d9c8667 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/health/get-storage-local.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-storage-local.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Health health = new Health(client);
-result = health.getStorageLocal();
+HttpResponseMessage result = await health.GetStorageLocal();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get-time.md b/docs/examples/0.6.2/server-dotnet/examples/health/get-time.md
index 4887d4b20b..00431f7b2f 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/health/get-time.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get-time.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Health health = new Health(client);
-result = health.getTime();
+HttpResponseMessage result = await health.GetTime();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/health/get.md b/docs/examples/0.6.2/server-dotnet/examples/health/get.md
index 1b7428a216..f487428928 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/health/get.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/health/get.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Health health = new Health(client);
-result = health.get();
+HttpResponseMessage result = await health.Get();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get-continents.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get-continents.md
index 0f85130aa3..ad5590032c 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/locale/get-continents.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get-continents.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Locale locale = new Locale(client);
-result = locale.getContinents();
+HttpResponseMessage result = await locale.GetContinents();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-e-u.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-e-u.md
index 8567e3ea4e..6bd92406cf 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-e-u.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-e-u.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Locale locale = new Locale(client);
-result = locale.getCountriesEU();
+HttpResponseMessage result = await locale.GetCountriesEU();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-phones.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-phones.md
index a2c5e1a8ab..2952035a5a 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-phones.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries-phones.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Locale locale = new Locale(client);
-result = locale.getCountriesPhones();
+HttpResponseMessage result = await locale.GetCountriesPhones();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries.md
index 724c019133..fa65eede63 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get-countries.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Locale locale = new Locale(client);
-result = locale.getCountries();
+HttpResponseMessage result = await locale.GetCountries();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get-currencies.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get-currencies.md
index 44f4ba5924..bfe091796c 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/locale/get-currencies.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get-currencies.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Locale locale = new Locale(client);
-result = locale.getCurrencies();
+HttpResponseMessage result = await locale.GetCurrencies();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get-languages.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get-languages.md
index 8020c37230..5bb2571246 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/locale/get-languages.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get-languages.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Locale locale = new Locale(client);
-result = locale.getLanguages();
+HttpResponseMessage result = await locale.GetLanguages();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/locale/get.md b/docs/examples/0.6.2/server-dotnet/examples/locale/get.md
index ce9d4207b6..ba59d83b7b 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/locale/get.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/locale/get.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Locale locale = new Locale(client);
-result = locale.get();
+HttpResponseMessage result = await locale.Get();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/create-file.md b/docs/examples/0.6.2/server-dotnet/examples/storage/create-file.md
index f0ac77f9d8..5427fceb1e 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/storage/create-file.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/create-file.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Storage storage = new Storage(client);
-result = storage.createFile(new File("./path-to-files/image.jpg"), {}, {});
+HttpResponseMessage result = await storage.CreateFile(new File("./path-to-files/image.jpg"), {}, {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/delete-file.md b/docs/examples/0.6.2/server-dotnet/examples/storage/delete-file.md
index d478052b7c..c78d0fbeb2 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/storage/delete-file.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/delete-file.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Storage storage = new Storage(client);
-result = storage.deleteFile("[FILE_ID]");
+HttpResponseMessage result = await storage.DeleteFile("[FILE_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-download.md b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-download.md
index fc209435fe..4f0f940130 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-download.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-download.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Storage storage = new Storage(client);
-result = storage.getFileDownload("[FILE_ID]");
+string result = await storage.GetFileDownload("[FILE_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-preview.md b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-preview.md
index ba50cb911a..1c7df59c31 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-preview.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-preview.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Storage storage = new Storage(client);
-result = storage.getFilePreview("[FILE_ID]");
+string result = await storage.GetFilePreview("[FILE_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-view.md b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-view.md
index 87226f1603..61843791d2 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-view.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file-view.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Storage storage = new Storage(client);
-result = storage.getFileView("[FILE_ID]");
+string result = await storage.GetFileView("[FILE_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/get-file.md b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file.md
index 50553b6b0e..a23d658b10 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/storage/get-file.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/get-file.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Storage storage = new Storage(client);
-result = storage.getFile("[FILE_ID]");
+HttpResponseMessage result = await storage.GetFile("[FILE_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/list-files.md b/docs/examples/0.6.2/server-dotnet/examples/storage/list-files.md
index ba9bb077b8..df57620627 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/storage/list-files.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/list-files.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Storage storage = new Storage(client);
-result = storage.listFiles();
+HttpResponseMessage result = await storage.ListFiles();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/storage/update-file.md b/docs/examples/0.6.2/server-dotnet/examples/storage/update-file.md
index 1aa65653c2..8effc42980 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/storage/update-file.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/storage/update-file.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Storage storage = new Storage(client);
-result = storage.updateFile("[FILE_ID]", {}, {});
+HttpResponseMessage result = await storage.UpdateFile("[FILE_ID]", {}, {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/create-membership.md b/docs/examples/0.6.2/server-dotnet/examples/teams/create-membership.md
index 66832b80f1..d149cb4738 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/teams/create-membership.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/create-membership.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Teams teams = new Teams(client);
-result = teams.createMembership("[TEAM_ID]", "email@example.com", {}, "https://example.com");
+HttpResponseMessage result = await teams.CreateMembership("[TEAM_ID]", "email@example.com", {}, "https://example.com");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/create.md b/docs/examples/0.6.2/server-dotnet/examples/teams/create.md
index ff5ee26138..a78e517308 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/teams/create.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/create.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Teams teams = new Teams(client);
-result = teams.create("[NAME]");
+HttpResponseMessage result = await teams.Create("[NAME]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/delete-membership.md b/docs/examples/0.6.2/server-dotnet/examples/teams/delete-membership.md
index 7c1900621c..d551dbf3aa 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/teams/delete-membership.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/delete-membership.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Teams teams = new Teams(client);
-result = teams.deleteMembership("[TEAM_ID]", "[INVITE_ID]");
+HttpResponseMessage result = await teams.DeleteMembership("[TEAM_ID]", "[INVITE_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/delete.md b/docs/examples/0.6.2/server-dotnet/examples/teams/delete.md
index ae0fda06ad..a08d23519c 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/teams/delete.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/delete.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Teams teams = new Teams(client);
-result = teams.delete("[TEAM_ID]");
+HttpResponseMessage result = await teams.Delete("[TEAM_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/get-memberships.md b/docs/examples/0.6.2/server-dotnet/examples/teams/get-memberships.md
index 1aac54c69d..1d76616f5e 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/teams/get-memberships.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/get-memberships.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Teams teams = new Teams(client);
-result = teams.getMemberships("[TEAM_ID]");
+HttpResponseMessage result = await teams.GetMemberships("[TEAM_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/get.md b/docs/examples/0.6.2/server-dotnet/examples/teams/get.md
index eb0bc28f73..796f600bd9 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/teams/get.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/get.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Teams teams = new Teams(client);
-result = teams.get("[TEAM_ID]");
+HttpResponseMessage result = await teams.Get("[TEAM_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/list.md b/docs/examples/0.6.2/server-dotnet/examples/teams/list.md
index bc60aa8a35..648003524d 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/teams/list.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/list.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Teams teams = new Teams(client);
-result = teams.list();
+HttpResponseMessage result = await teams.List();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/teams/update.md b/docs/examples/0.6.2/server-dotnet/examples/teams/update.md
index 3815283343..54ed78db72 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/teams/update.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/teams/update.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Teams teams = new Teams(client);
-result = teams.update("[TEAM_ID]", "[NAME]");
+HttpResponseMessage result = await teams.Update("[TEAM_ID]", "[NAME]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/create.md b/docs/examples/0.6.2/server-dotnet/examples/users/create.md
index 536e995d0b..1f7fab70a7 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/users/create.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/create.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Users users = new Users(client);
-result = users.create("email@example.com", "password");
+HttpResponseMessage result = await users.Create("email@example.com", "password");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/delete-session.md b/docs/examples/0.6.2/server-dotnet/examples/users/delete-session.md
index eb455cb140..fd322868ab 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/users/delete-session.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/delete-session.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Users users = new Users(client);
-result = users.deleteSession("[USER_ID]", "[SESSION_ID]");
+HttpResponseMessage result = await users.DeleteSession("[USER_ID]", "[SESSION_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/delete-sessions.md b/docs/examples/0.6.2/server-dotnet/examples/users/delete-sessions.md
index 5793fe5bc8..d2ed98e479 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/users/delete-sessions.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/delete-sessions.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Users users = new Users(client);
-result = users.deleteSessions("[USER_ID]");
+HttpResponseMessage result = await users.DeleteSessions("[USER_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/get-logs.md b/docs/examples/0.6.2/server-dotnet/examples/users/get-logs.md
index 0c68cad6c2..bf9db43c23 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/users/get-logs.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/get-logs.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Users users = new Users(client);
-result = users.getLogs("[USER_ID]");
+HttpResponseMessage result = await users.GetLogs("[USER_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/get-prefs.md b/docs/examples/0.6.2/server-dotnet/examples/users/get-prefs.md
index b9165807bc..b92ed4c20a 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/users/get-prefs.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/get-prefs.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Users users = new Users(client);
-result = users.getPrefs("[USER_ID]");
+HttpResponseMessage result = await users.GetPrefs("[USER_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/get-sessions.md b/docs/examples/0.6.2/server-dotnet/examples/users/get-sessions.md
index b1fff05940..2431460668 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/users/get-sessions.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/get-sessions.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Users users = new Users(client);
-result = users.getSessions("[USER_ID]");
+HttpResponseMessage result = await users.GetSessions("[USER_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/get.md b/docs/examples/0.6.2/server-dotnet/examples/users/get.md
index fb5d4ceec5..93c31c599c 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/users/get.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/get.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Users users = new Users(client);
-result = users.get("[USER_ID]");
+HttpResponseMessage result = await users.Get("[USER_ID]");
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/list.md b/docs/examples/0.6.2/server-dotnet/examples/users/list.md
index bbe25485a2..f85440c498 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/users/list.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/list.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Users users = new Users(client);
-result = users.list();
+HttpResponseMessage result = await users.List();
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/update-prefs.md b/docs/examples/0.6.2/server-dotnet/examples/users/update-prefs.md
index accdcd757f..06ffa4245a 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/users/update-prefs.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/update-prefs.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Users users = new Users(client);
-result = users.updatePrefs("[USER_ID]", {});
+HttpResponseMessage result = await users.UpdatePrefs("[USER_ID]", {});
diff --git a/docs/examples/0.6.2/server-dotnet/examples/users/update-status.md b/docs/examples/0.6.2/server-dotnet/examples/users/update-status.md
index 51822dd10e..a2b00ff16c 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/users/update-status.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/users/update-status.md
@@ -3,11 +3,11 @@ use Appwrite;
Client client = new Client();
client
- .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") # Your API Endpoint
- .SetProject("5df5acd0d48c2") # Your project ID
- .SetKey("919c2d18fb5d4...a2ae413da83346ad2") # Your secret API key
+ .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .SetProject("5df5acd0d48c2") // Your project ID
+ .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;
Users users = new Users(client);
-result = users.updateStatus("[USER_ID]", "1");
+HttpResponseMessage result = await users.UpdateStatus("[USER_ID]", "1");
From dfe12b2be067dc462c7f1b3b786f232422d90417 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Wed, 6 Jan 2021 14:49:11 +0200
Subject: [PATCH 105/230] Fixed object default value
---
src/Appwrite/Specification/Format/OpenAPI3.php | 3 ++-
src/Appwrite/Specification/Format/Swagger2.php | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php
index 18da610f8c..90f054d0af 100644
--- a/src/Appwrite/Specification/Format/OpenAPI3.php
+++ b/src/Appwrite/Specification/Format/OpenAPI3.php
@@ -4,6 +4,7 @@ namespace Appwrite\Specification\Format;
use Appwrite\Specification\Format;
use Appwrite\Template\Template;
+use stdClass;
class OpenAPI3 extends Format
{
@@ -212,7 +213,7 @@ class OpenAPI3 extends Format
case 'Utopia\Validator\JSON':
case 'Utopia\Validator\Mock':
case 'Utopia\Validator\Assoc':
- $node['schema']['type'] = 'object';
+ $param['default'] = (empty($param['default'])) ? new stdClass() : $param['default'];
$node['schema']['type'] = 'object';
$node['schema']['x-example'] = '{}';
//$node['schema']['format'] = 'json';
diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php
index d187cbc8d9..56becd2365 100644
--- a/src/Appwrite/Specification/Format/Swagger2.php
+++ b/src/Appwrite/Specification/Format/Swagger2.php
@@ -4,6 +4,7 @@ namespace Appwrite\Specification\Format;
use Appwrite\Specification\Format;
use Appwrite\Template\Template;
+use stdClass;
class Swagger2 extends Format
{
@@ -205,7 +206,7 @@ class Swagger2 extends Format
case 'Utopia\Validator\Mock':
case 'Utopia\Validator\Assoc':
$node['type'] = 'object';
- $node['type'] = 'object';
+ $param['default'] = (empty($param['default'])) ? new stdClass() : $param['default'];
$node['x-example'] = '{}';
//$node['format'] = 'json';
break;
From 5819f8a224af4a7ff72ce7085e533f496e677578 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Wed, 6 Jan 2021 15:01:47 +0200
Subject: [PATCH 106/230] Updated dependencies
---
composer.json | 2 +-
composer.lock | 283 ++++++++++++++++++++++++++------------------------
2 files changed, 149 insertions(+), 136 deletions(-)
diff --git a/composer.json b/composer.json
index bf9f354acc..db97272fdb 100644
--- a/composer.json
+++ b/composer.json
@@ -56,7 +56,7 @@
},
"require-dev": {
"swoole/ide-helper": "4.5.5",
- "appwrite/sdk-generator": "0.2.3",
+ "appwrite/sdk-generator": "0.4.0",
"phpunit/phpunit": "9.4.2",
"vimeo/psalm": "4.1.1"
},
diff --git a/composer.lock b/composer.lock
index 500c67d954..4323941e91 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "aa1bf812ee6a45af12cdfbbfb7229471",
+ "content-hash": "2c7c15c2c968547dc6749efc79b39458",
"packages": [
{
"name": "appwrite/php-clamav",
@@ -1158,9 +1158,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/abuse/issues",
- "source": "https://github.com/utopia-php/abuse/tree/0.2.2"
+ "source": "https://github.com/utopia-php/abuse/tree/0.3.1"
},
- "time": "2020-10-23T06:51:42+00:00"
+ "time": "2020-12-21T17:28:03+00:00"
},
{
"name": "utopia-php/audit",
@@ -1210,9 +1210,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/audit/issues",
- "source": "https://github.com/utopia-php/audit/tree/0.3.2"
+ "source": "https://github.com/utopia-php/audit/tree/0.5.1"
},
- "time": "2020-10-23T08:09:44+00:00"
+ "time": "2020-12-21T17:28:53+00:00"
},
{
"name": "utopia-php/cache",
@@ -1315,9 +1315,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/cli/issues",
- "source": "https://github.com/utopia-php/cli/tree/0.7.3"
+ "source": "https://github.com/utopia-php/cli/tree/0.8"
},
- "time": "2020-11-02T07:50:18+00:00"
+ "time": "2020-12-14T06:31:42+00:00"
},
{
"name": "utopia-php/config",
@@ -1858,11 +1858,11 @@
},
{
"name": "appwrite/sdk-generator",
- "version": "0.2.3",
+ "version": "0.4.0",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator",
- "reference": "6b564fef01fd681023c1d465783931bade04468d"
+ "reference": "91e155304d55831e66f880d5714ea81534819d44"
},
"require": {
"ext-curl": "*",
@@ -1875,7 +1875,6 @@
"require-dev": {
"phpunit/phpunit": "^7.0"
},
- "default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
@@ -1893,7 +1892,7 @@
}
],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
- "time": "2020-12-23T21:58:58+00:00"
+ "time": "2021-01-06T12:37:52+00:00"
},
{
"name": "composer/package-versions-deprecated",
@@ -1901,12 +1900,12 @@
"source": {
"type": "git",
"url": "https://github.com/composer/package-versions-deprecated.git",
- "reference": "64291c788b9a18272346decf566931e33a317399"
+ "reference": "f921205948ab93bb19f86327c793a81edb62f236"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/64291c788b9a18272346decf566931e33a317399",
- "reference": "64291c788b9a18272346decf566931e33a317399",
+ "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/f921205948ab93bb19f86327c793a81edb62f236",
+ "reference": "f921205948ab93bb19f86327c793a81edb62f236",
"shasum": ""
},
"require": {
@@ -1967,7 +1966,7 @@
"type": "tidelift"
}
],
- "time": "2020-11-12T09:39:33+00:00"
+ "time": "2020-12-27T20:11:05+00:00"
},
{
"name": "composer/semver",
@@ -2324,16 +2323,16 @@
},
{
"name": "matthiasmullie/minify",
- "version": "1.3.64",
+ "version": "1.3.65",
"source": {
"type": "git",
"url": "https://github.com/matthiasmullie/minify.git",
- "reference": "38f9d58c739687e269f46c6dff4647de9e2eb855"
+ "reference": "227f19062451c55a797e0cc667ef983834e6580c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/38f9d58c739687e269f46c6dff4647de9e2eb855",
- "reference": "38f9d58c739687e269f46c6dff4647de9e2eb855",
+ "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/227f19062451c55a797e0cc667ef983834e6580c",
+ "reference": "227f19062451c55a797e0cc667ef983834e6580c",
"shasum": ""
},
"require": {
@@ -2382,9 +2381,23 @@
],
"support": {
"issues": "https://github.com/matthiasmullie/minify/issues",
- "source": "https://github.com/matthiasmullie/minify/tree/1.3.64"
+ "source": "https://github.com/matthiasmullie/minify/tree/1.3.65"
},
- "time": "2020-12-23T13:37:53+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/[user1",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/matthiasmullie] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g.",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/user2",
+ "type": "github"
+ }
+ ],
+ "time": "2020-12-27T21:43:29+00:00"
},
{
"name": "matthiasmullie/path-converter",
@@ -3004,12 +3017,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "ad44fae76b874e7d49afb6923a66591e0a94bef6"
+ "reference": "cbe315f4d3b653ac0310862697866ffddabc502f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ad44fae76b874e7d49afb6923a66591e0a94bef6",
- "reference": "ad44fae76b874e7d49afb6923a66591e0a94bef6",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/cbe315f4d3b653ac0310862697866ffddabc502f",
+ "reference": "cbe315f4d3b653ac0310862697866ffddabc502f",
"shasum": ""
},
"require": {
@@ -3065,7 +3078,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/master"
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2"
},
"funding": [
{
@@ -3073,7 +3086,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:26:22+00:00"
+ "time": "2021-01-02T06:24:37+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -3081,12 +3094,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "544be757d192233486ad9119dcb297ebbf5f2dd4"
+ "reference": "cdb8225b328ef5e9647049954299211804000ce0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/544be757d192233486ad9119dcb297ebbf5f2dd4",
- "reference": "544be757d192233486ad9119dcb297ebbf5f2dd4",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cdb8225b328ef5e9647049954299211804000ce0",
+ "reference": "cdb8225b328ef5e9647049954299211804000ce0",
"shasum": ""
},
"require": {
@@ -3134,7 +3147,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:43+00:00"
+ "time": "2021-01-02T06:22:20+00:00"
},
{
"name": "phpunit/php-invoker",
@@ -3142,12 +3155,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-invoker.git",
- "reference": "05210af8d0ab68c811ae61a4bc42b066d62b88a0"
+ "reference": "6fdda2828180f7d86cf66d822e6ad4bc124baf5d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/05210af8d0ab68c811ae61a4bc42b066d62b88a0",
- "reference": "05210af8d0ab68c811ae61a4bc42b066d62b88a0",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/6fdda2828180f7d86cf66d822e6ad4bc124baf5d",
+ "reference": "6fdda2828180f7d86cf66d822e6ad4bc124baf5d",
"shasum": ""
},
"require": {
@@ -3198,7 +3211,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:51+00:00"
+ "time": "2021-01-02T06:22:25+00:00"
},
{
"name": "phpunit/php-text-template",
@@ -3206,12 +3219,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "c1abda6e0590f8e7138eb48ade2f0b21a5c4257b"
+ "reference": "081fc9efc54b1b858b3497c142d82a0c36bc6755"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/c1abda6e0590f8e7138eb48ade2f0b21a5c4257b",
- "reference": "c1abda6e0590f8e7138eb48ade2f0b21a5c4257b",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/081fc9efc54b1b858b3497c142d82a0c36bc6755",
+ "reference": "081fc9efc54b1b858b3497c142d82a0c36bc6755",
"shasum": ""
},
"require": {
@@ -3258,7 +3271,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:28:23+00:00"
+ "time": "2021-01-02T06:22:47+00:00"
},
{
"name": "phpunit/php-timer",
@@ -3266,12 +3279,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "59e401088c91efeb76150f0a301aa79e3ac95fd1"
+ "reference": "2194371fec37b03cfda3f8ab08aee33787350228"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/59e401088c91efeb76150f0a301aa79e3ac95fd1",
- "reference": "59e401088c91efeb76150f0a301aa79e3ac95fd1",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2194371fec37b03cfda3f8ab08aee33787350228",
+ "reference": "2194371fec37b03cfda3f8ab08aee33787350228",
"shasum": ""
},
"require": {
@@ -3318,7 +3331,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:59+00:00"
+ "time": "2021-01-02T06:22:31+00:00"
},
{
"name": "phpunit/phpunit",
@@ -3483,12 +3496,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/cli-parser.git",
- "reference": "7605547e80bf845bc2c1b2cc3f8ac0f5574caa63"
+ "reference": "1012bd8df812778b8386c5e76cacd85b45cf329e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/7605547e80bf845bc2c1b2cc3f8ac0f5574caa63",
- "reference": "7605547e80bf845bc2c1b2cc3f8ac0f5574caa63",
+ "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/1012bd8df812778b8386c5e76cacd85b45cf329e",
+ "reference": "1012bd8df812778b8386c5e76cacd85b45cf329e",
"shasum": ""
},
"require": {
@@ -3532,7 +3545,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:28:52+00:00"
+ "time": "2021-01-02T06:23:03+00:00"
},
{
"name": "sebastian/code-unit",
@@ -3596,12 +3609,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
- "reference": "f861b90785c30dc0743554f0e615d8f950dc8e9d"
+ "reference": "f0a408b6519db241e624a62576dc5871d4ac8c14"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/f861b90785c30dc0743554f0e615d8f950dc8e9d",
- "reference": "f861b90785c30dc0743554f0e615d8f950dc8e9d",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/f0a408b6519db241e624a62576dc5871d4ac8c14",
+ "reference": "f0a408b6519db241e624a62576dc5871d4ac8c14",
"shasum": ""
},
"require": {
@@ -3644,7 +3657,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:26:38+00:00"
+ "time": "2021-01-02T06:21:36+00:00"
},
{
"name": "sebastian/comparator",
@@ -3652,12 +3665,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "1cfe9edf7ec9e4c18e54bb259110a053d09a899f"
+ "reference": "fe4c68c639d9e580ec31bfc88b32641dc80a08d0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1cfe9edf7ec9e4c18e54bb259110a053d09a899f",
- "reference": "1cfe9edf7ec9e4c18e54bb259110a053d09a899f",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fe4c68c639d9e580ec31bfc88b32641dc80a08d0",
+ "reference": "fe4c68c639d9e580ec31bfc88b32641dc80a08d0",
"shasum": ""
},
"require": {
@@ -3719,7 +3732,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:38:43+00:00"
+ "time": "2021-01-02T06:21:42+00:00"
},
{
"name": "sebastian/complexity",
@@ -3727,12 +3740,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/complexity.git",
- "reference": "23030bf3d3722767fdc5f8f2d2d99b03f4e58122"
+ "reference": "c182133e92fc7a8b0a923b5d20f3a9fdfa534818"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/23030bf3d3722767fdc5f8f2d2d99b03f4e58122",
- "reference": "23030bf3d3722767fdc5f8f2d2d99b03f4e58122",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/c182133e92fc7a8b0a923b5d20f3a9fdfa534818",
+ "reference": "c182133e92fc7a8b0a923b5d20f3a9fdfa534818",
"shasum": ""
},
"require": {
@@ -3777,7 +3790,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:28:32+00:00"
+ "time": "2021-01-02T06:22:53+00:00"
},
{
"name": "sebastian/diff",
@@ -3785,12 +3798,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "02178c586d5fbd59d348798d7122237a2907f8a4"
+ "reference": "33f7bf3c1741b2a10e16d5c41c369c402b933e4c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/02178c586d5fbd59d348798d7122237a2907f8a4",
- "reference": "02178c586d5fbd59d348798d7122237a2907f8a4",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/33f7bf3c1741b2a10e16d5c41c369c402b933e4c",
+ "reference": "33f7bf3c1741b2a10e16d5c41c369c402b933e4c",
"shasum": ""
},
"require": {
@@ -3844,7 +3857,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:26:54+00:00"
+ "time": "2021-01-02T06:21:47+00:00"
},
{
"name": "sebastian/environment",
@@ -3852,12 +3865,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "7bb5a20ec06e366cb75b0e126169649c62b397b1"
+ "reference": "b885263b3601b7570ef386a468d6a827c95c8994"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/7bb5a20ec06e366cb75b0e126169649c62b397b1",
- "reference": "7bb5a20ec06e366cb75b0e126169649c62b397b1",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/b885263b3601b7570ef386a468d6a827c95c8994",
+ "reference": "b885263b3601b7570ef386a468d6a827c95c8994",
"shasum": ""
},
"require": {
@@ -3908,7 +3921,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:03+00:00"
+ "time": "2021-01-02T06:21:52+00:00"
},
{
"name": "sebastian/exporter",
@@ -3916,12 +3929,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "91975a2dbcf4a89184d9e4143c06b88d89644b58"
+ "reference": "f670c4f17dffab83b44048f6fe6747a7c6097179"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/91975a2dbcf4a89184d9e4143c06b88d89644b58",
- "reference": "91975a2dbcf4a89184d9e4143c06b88d89644b58",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f670c4f17dffab83b44048f6fe6747a7c6097179",
+ "reference": "f670c4f17dffab83b44048f6fe6747a7c6097179",
"shasum": ""
},
"require": {
@@ -3986,7 +3999,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:11+00:00"
+ "time": "2021-01-02T06:21:58+00:00"
},
{
"name": "sebastian/global-state",
@@ -3994,12 +4007,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "0471b24bddeb05ffd0a5edc6837796f339068c25"
+ "reference": "a74d82a0654a7f685f80016cc3570d7a387f9da0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0471b24bddeb05ffd0a5edc6837796f339068c25",
- "reference": "0471b24bddeb05ffd0a5edc6837796f339068c25",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a74d82a0654a7f685f80016cc3570d7a387f9da0",
+ "reference": "a74d82a0654a7f685f80016cc3570d7a387f9da0",
"shasum": ""
},
"require": {
@@ -4051,7 +4064,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:19+00:00"
+ "time": "2021-01-02T06:22:03+00:00"
},
{
"name": "sebastian/lines-of-code",
@@ -4059,12 +4072,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/lines-of-code.git",
- "reference": "219c932af1aeee0b4eccbc53af2181ff50e14b24"
+ "reference": "db62e01f14ea9485d5a52dfb5706061fd0f50425"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/219c932af1aeee0b4eccbc53af2181ff50e14b24",
- "reference": "219c932af1aeee0b4eccbc53af2181ff50e14b24",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/db62e01f14ea9485d5a52dfb5706061fd0f50425",
+ "reference": "db62e01f14ea9485d5a52dfb5706061fd0f50425",
"shasum": ""
},
"require": {
@@ -4109,7 +4122,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:28:42+00:00"
+ "time": "2021-01-02T06:22:58+00:00"
},
{
"name": "sebastian/object-enumerator",
@@ -4117,12 +4130,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
- "reference": "da36684b10f17db8718e314fa8d84b2e0ed7132e"
+ "reference": "fccb61351e8a3a10ffacfad9544bb2905905b69c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/da36684b10f17db8718e314fa8d84b2e0ed7132e",
- "reference": "da36684b10f17db8718e314fa8d84b2e0ed7132e",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/fccb61351e8a3a10ffacfad9544bb2905905b69c",
+ "reference": "fccb61351e8a3a10ffacfad9544bb2905905b69c",
"shasum": ""
},
"require": {
@@ -4167,7 +4180,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:27+00:00"
+ "time": "2021-01-02T06:22:09+00:00"
},
{
"name": "sebastian/object-reflector",
@@ -4175,12 +4188,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-reflector.git",
- "reference": "6717d193da503616e69462cf98e2af3f4443335d"
+ "reference": "c0ad4ce74e040797d5f8abfc23ab79fd79b064c3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6717d193da503616e69462cf98e2af3f4443335d",
- "reference": "6717d193da503616e69462cf98e2af3f4443335d",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/c0ad4ce74e040797d5f8abfc23ab79fd79b064c3",
+ "reference": "c0ad4ce74e040797d5f8abfc23ab79fd79b064c3",
"shasum": ""
},
"require": {
@@ -4223,7 +4236,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:27:35+00:00"
+ "time": "2021-01-02T06:22:14+00:00"
},
{
"name": "sebastian/recursion-context",
@@ -4231,12 +4244,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "cee249a3e471aa870067fa6155991230c7507924"
+ "reference": "c5616ce32278e62c77066f72b1fe413a8c958cee"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cee249a3e471aa870067fa6155991230c7507924",
- "reference": "cee249a3e471aa870067fa6155991230c7507924",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/c5616ce32278e62c77066f72b1fe413a8c958cee",
+ "reference": "c5616ce32278e62c77066f72b1fe413a8c958cee",
"shasum": ""
},
"require": {
@@ -4287,7 +4300,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:28:07+00:00"
+ "time": "2021-01-02T06:22:36+00:00"
},
{
"name": "sebastian/resource-operations",
@@ -4351,12 +4364,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
- "reference": "67bfce3beb94968d175fdf117b80fc9a6b60bdd0"
+ "reference": "655e3b59cc2e508306dba9c3df08b774055548e7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/67bfce3beb94968d175fdf117b80fc9a6b60bdd0",
- "reference": "67bfce3beb94968d175fdf117b80fc9a6b60bdd0",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/655e3b59cc2e508306dba9c3df08b774055548e7",
+ "reference": "655e3b59cc2e508306dba9c3df08b774055548e7",
"shasum": ""
},
"require": {
@@ -4400,7 +4413,7 @@
"type": "github"
}
],
- "time": "2020-12-24T12:28:15+00:00"
+ "time": "2021-01-02T06:22:42+00:00"
},
{
"name": "sebastian/version",
@@ -4500,12 +4513,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "15c96194f32e1b1aa30d1b302c71c5f83fd4dea9"
+ "reference": "da4c3663721420520b024e5aede66b813019e744"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/15c96194f32e1b1aa30d1b302c71c5f83fd4dea9",
- "reference": "15c96194f32e1b1aa30d1b302c71c5f83fd4dea9",
+ "url": "https://api.github.com/repos/symfony/console/zipball/da4c3663721420520b024e5aede66b813019e744",
+ "reference": "da4c3663721420520b024e5aede66b813019e744",
"shasum": ""
},
"require": {
@@ -4590,7 +4603,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-18T08:03:24+00:00"
+ "time": "2021-01-05T20:16:44+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -4598,12 +4611,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "fade6deebd931cfd7a544f68479405a6a08979a3"
+ "reference": "7c0a3c5420fd802637c4260e595d6c674b23d578"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fade6deebd931cfd7a544f68479405a6a08979a3",
- "reference": "fade6deebd931cfd7a544f68479405a6a08979a3",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7c0a3c5420fd802637c4260e595d6c674b23d578",
+ "reference": "7c0a3c5420fd802637c4260e595d6c674b23d578",
"shasum": ""
},
"require": {
@@ -4670,7 +4683,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2021-01-06T10:19:43+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
@@ -4678,12 +4691,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
- "reference": "be092746c3ab9f9c62608c82e0f04687f8a879f9"
+ "reference": "32b651134d58efe1786c95352d846913a42d8331"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/be092746c3ab9f9c62608c82e0f04687f8a879f9",
- "reference": "be092746c3ab9f9c62608c82e0f04687f8a879f9",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32b651134d58efe1786c95352d846913a42d8331",
+ "reference": "32b651134d58efe1786c95352d846913a42d8331",
"shasum": ""
},
"require": {
@@ -4752,7 +4765,7 @@
"type": "tidelift"
}
],
- "time": "2020-11-13T15:40:22+00:00"
+ "time": "2021-01-06T10:19:43+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
@@ -4760,12 +4773,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
- "reference": "69609f9f06790591b4b13a45ee117e7bab6395aa"
+ "reference": "8592bf62da8352927fc3857484e84baacddec301"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/69609f9f06790591b4b13a45ee117e7bab6395aa",
- "reference": "69609f9f06790591b4b13a45ee117e7bab6395aa",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8592bf62da8352927fc3857484e84baacddec301",
+ "reference": "8592bf62da8352927fc3857484e84baacddec301",
"shasum": ""
},
"require": {
@@ -4837,7 +4850,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2021-01-06T10:19:43+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -4845,12 +4858,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "401c9d9d3400c53a8f1a39425f0543406c137a43"
+ "reference": "ec0101071dcbc6bdd5046da11df686f8515fa815"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/401c9d9d3400c53a8f1a39425f0543406c137a43",
- "reference": "401c9d9d3400c53a8f1a39425f0543406c137a43",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/ec0101071dcbc6bdd5046da11df686f8515fa815",
+ "reference": "ec0101071dcbc6bdd5046da11df686f8515fa815",
"shasum": ""
},
"require": {
@@ -4918,7 +4931,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2021-01-06T10:19:43+00:00"
},
{
"name": "symfony/polyfill-php73",
@@ -4926,12 +4939,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "8c0d39c1526009b97f43beea4cc685bbc353a70b"
+ "reference": "6d0e293e2b13580b866090a135900aea4adcb308"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/8c0d39c1526009b97f43beea4cc685bbc353a70b",
- "reference": "8c0d39c1526009b97f43beea4cc685bbc353a70b",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/6d0e293e2b13580b866090a135900aea4adcb308",
+ "reference": "6d0e293e2b13580b866090a135900aea4adcb308",
"shasum": ""
},
"require": {
@@ -4998,7 +5011,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2021-01-06T10:19:43+00:00"
},
{
"name": "symfony/polyfill-php80",
@@ -5006,12 +5019,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "3a11f3dfb34ad50f978cb2b8cf936933b87739aa"
+ "reference": "69e5da91ad9c080f6ac1e010ddffefe71b14bd6e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/3a11f3dfb34ad50f978cb2b8cf936933b87739aa",
- "reference": "3a11f3dfb34ad50f978cb2b8cf936933b87739aa",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/69e5da91ad9c080f6ac1e010ddffefe71b14bd6e",
+ "reference": "69e5da91ad9c080f6ac1e010ddffefe71b14bd6e",
"shasum": ""
},
"require": {
@@ -5082,7 +5095,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2021-01-06T10:19:43+00:00"
},
{
"name": "symfony/service-contracts",
@@ -5090,12 +5103,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
- "reference": "5c448a39281b671be2cc8d208e6df75ac2d4b366"
+ "reference": "e0d43e6e2f909287d2e4e867ca5c131a661f08ef"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/service-contracts/zipball/5c448a39281b671be2cc8d208e6df75ac2d4b366",
- "reference": "5c448a39281b671be2cc8d208e6df75ac2d4b366",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e0d43e6e2f909287d2e4e867ca5c131a661f08ef",
+ "reference": "e0d43e6e2f909287d2e4e867ca5c131a661f08ef",
"shasum": ""
},
"require": {
@@ -5163,7 +5176,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-23T15:38:30+00:00"
+ "time": "2021-01-01T09:26:45+00:00"
},
{
"name": "symfony/string",
@@ -5171,12 +5184,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed"
+ "reference": "99f25957efe05db14a1aa6cff643eca0f83a952c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed",
- "reference": "5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed",
+ "url": "https://api.github.com/repos/symfony/string/zipball/99f25957efe05db14a1aa6cff643eca0f83a952c",
+ "reference": "99f25957efe05db14a1aa6cff643eca0f83a952c",
"shasum": ""
},
"require": {
@@ -5231,7 +5244,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v5.2.1"
+ "source": "https://github.com/symfony/string/tree/5.x"
},
"funding": [
{
@@ -5247,7 +5260,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-05T07:33:16+00:00"
+ "time": "2021-01-01T09:26:45+00:00"
},
{
"name": "theseer/tokenizer",
@@ -5305,12 +5318,12 @@
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
- "reference": "c5379903e5640e5f29024e71aa0817f7bd56102b"
+ "reference": "a0e2cc25723f3cdb6bbaf617664c4e228f1e9886"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/twigphp/Twig/zipball/c5379903e5640e5f29024e71aa0817f7bd56102b",
- "reference": "c5379903e5640e5f29024e71aa0817f7bd56102b",
+ "url": "https://api.github.com/repos/twigphp/Twig/zipball/a0e2cc25723f3cdb6bbaf617664c4e228f1e9886",
+ "reference": "a0e2cc25723f3cdb6bbaf617664c4e228f1e9886",
"shasum": ""
},
"require": {
@@ -5376,7 +5389,7 @@
"type": "tidelift"
}
],
- "time": "2020-11-27T13:05:37+00:00"
+ "time": "2021-01-05T15:39:16+00:00"
},
{
"name": "vimeo/psalm",
From 60503d0d0b5cb765221c290b07ef46b94b6a9753 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Wed, 6 Jan 2021 15:02:00 +0200
Subject: [PATCH 107/230] Added new platform
---
app/config/platforms.php | 5 ++---
app/tasks/sdks.php | 1 +
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/config/platforms.php b/app/config/platforms.php
index c9a3f25b59..1bfceb31e0 100644
--- a/app/config/platforms.php
+++ b/app/config/platforms.php
@@ -256,11 +256,10 @@ return [
'version' => '0.0.1',
'url' => 'https://github.com/appwrite/sdk-for-dart',
'package' => '',
- 'enabled' => false,
+ 'enabled' => true,
'beta' => true,
- 'dev' => false,
'family' => APP_PLATFORM_SERVER,
- 'prism' => 'java',
+ 'prism' => 'dart',
'source' => \realpath(__DIR__ . '/../sdks/server-dart'),
'gitUrl' => 'git@github.com:appwrite/sdk-for-dart.git',
'gitRepoName' => 'sdk-for-dart',
diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php
index 857b4de7b5..c742acc227 100644
--- a/app/tasks/sdks.php
+++ b/app/tasks/sdks.php
@@ -122,6 +122,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
break;
case 'dart':
$config = new Dart();
+ $config->setPackageName('dart_appwrite');
break;
case 'go':
$config = new Go();
From e27e4087c4a60681ee0377449a86b988059e9dc5 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Wed, 6 Jan 2021 15:45:47 +0200
Subject: [PATCH 108/230] Added dart code examples
---
app/config/platforms.php | 2 +-
composer.json | 2 +-
composer.lock | 8 +++---
.../examples/avatars/get-browser.md | 18 +++++++++++++
.../examples/avatars/get-credit-card.md | 18 +++++++++++++
.../examples/avatars/get-favicon.md | 18 +++++++++++++
.../server-dart/examples/avatars/get-flag.md | 18 +++++++++++++
.../server-dart/examples/avatars/get-image.md | 18 +++++++++++++
.../examples/avatars/get-initials.md | 17 ++++++++++++
.../server-dart/examples/avatars/get-q-r.md | 18 +++++++++++++
.../examples/database/create-collection.md | 26 ++++++++++++++++++
.../examples/database/create-document.md | 26 ++++++++++++++++++
.../examples/database/delete-collection.md | 23 ++++++++++++++++
.../examples/database/delete-document.md | 24 +++++++++++++++++
.../examples/database/get-collection.md | 23 ++++++++++++++++
.../examples/database/get-document.md | 24 +++++++++++++++++
.../examples/database/list-collections.md | 22 +++++++++++++++
.../examples/database/list-documents.md | 23 ++++++++++++++++
.../examples/database/update-collection.md | 26 ++++++++++++++++++
.../examples/database/update-document.md | 27 +++++++++++++++++++
.../examples/health/get-anti-virus.md | 21 +++++++++++++++
.../server-dart/examples/health/get-cache.md | 21 +++++++++++++++
.../server-dart/examples/health/get-d-b.md | 21 +++++++++++++++
.../examples/health/get-queue-certificates.md | 21 +++++++++++++++
.../examples/health/get-queue-functions.md | 21 +++++++++++++++
.../examples/health/get-queue-logs.md | 21 +++++++++++++++
.../examples/health/get-queue-tasks.md | 21 +++++++++++++++
.../examples/health/get-queue-usage.md | 21 +++++++++++++++
.../examples/health/get-queue-webhooks.md | 21 +++++++++++++++
.../examples/health/get-storage-local.md | 21 +++++++++++++++
.../server-dart/examples/health/get-time.md | 21 +++++++++++++++
.../0.6.2/server-dart/examples/health/get.md | 21 +++++++++++++++
.../examples/locale/get-continents.md | 21 +++++++++++++++
.../examples/locale/get-countries-e-u.md | 21 +++++++++++++++
.../examples/locale/get-countries-phones.md | 21 +++++++++++++++
.../examples/locale/get-countries.md | 21 +++++++++++++++
.../examples/locale/get-currencies.md | 21 +++++++++++++++
.../examples/locale/get-languages.md | 21 +++++++++++++++
.../0.6.2/server-dart/examples/locale/get.md | 21 +++++++++++++++
.../examples/storage/create-file.md | 26 ++++++++++++++++++
.../examples/storage/delete-file.md | 23 ++++++++++++++++
.../examples/storage/get-file-download.md | 18 +++++++++++++
.../examples/storage/get-file-preview.md | 18 +++++++++++++
.../examples/storage/get-file-view.md | 18 +++++++++++++
.../server-dart/examples/storage/get-file.md | 23 ++++++++++++++++
.../examples/storage/list-files.md | 22 +++++++++++++++
.../examples/storage/update-file.md | 25 +++++++++++++++++
.../examples/teams/create-membership.md | 26 ++++++++++++++++++
.../server-dart/examples/teams/create.md | 23 ++++++++++++++++
.../examples/teams/delete-membership.md | 24 +++++++++++++++++
.../server-dart/examples/teams/delete.md | 23 ++++++++++++++++
.../examples/teams/get-memberships.md | 23 ++++++++++++++++
.../0.6.2/server-dart/examples/teams/get.md | 23 ++++++++++++++++
.../0.6.2/server-dart/examples/teams/list.md | 22 +++++++++++++++
.../server-dart/examples/teams/update.md | 24 +++++++++++++++++
.../server-dart/examples/users/create.md | 24 +++++++++++++++++
.../examples/users/delete-session.md | 24 +++++++++++++++++
.../examples/users/delete-sessions.md | 23 ++++++++++++++++
.../server-dart/examples/users/get-logs.md | 23 ++++++++++++++++
.../server-dart/examples/users/get-prefs.md | 23 ++++++++++++++++
.../examples/users/get-sessions.md | 23 ++++++++++++++++
.../0.6.2/server-dart/examples/users/get.md | 23 ++++++++++++++++
.../0.6.2/server-dart/examples/users/list.md | 22 +++++++++++++++
.../examples/users/update-prefs.md | 24 +++++++++++++++++
.../examples/users/update-status.md | 24 +++++++++++++++++
docs/sdks/dart/CHANGELOG.md | 3 +++
docs/sdks/dart/EXAMPLES.md | 17 +++++++-----
67 files changed, 1381 insertions(+), 13 deletions(-)
create mode 100644 docs/examples/0.6.2/server-dart/examples/avatars/get-browser.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/avatars/get-credit-card.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/avatars/get-favicon.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/avatars/get-flag.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/avatars/get-image.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/avatars/get-initials.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/avatars/get-q-r.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/database/create-collection.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/database/create-document.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/database/delete-collection.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/database/delete-document.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/database/get-collection.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/database/get-document.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/database/list-collections.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/database/list-documents.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/database/update-collection.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/database/update-document.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/health/get-anti-virus.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/health/get-cache.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/health/get-d-b.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/health/get-queue-certificates.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/health/get-queue-functions.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/health/get-queue-logs.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/health/get-queue-tasks.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/health/get-queue-usage.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/health/get-queue-webhooks.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/health/get-storage-local.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/health/get-time.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/health/get.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/locale/get-continents.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/locale/get-countries-e-u.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/locale/get-countries-phones.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/locale/get-countries.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/locale/get-currencies.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/locale/get-languages.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/locale/get.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/storage/create-file.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/storage/delete-file.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/storage/get-file-download.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/storage/get-file-preview.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/storage/get-file-view.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/storage/get-file.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/storage/list-files.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/storage/update-file.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/teams/create-membership.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/teams/create.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/teams/delete-membership.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/teams/delete.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/teams/get-memberships.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/teams/get.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/teams/list.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/teams/update.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/users/create.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/users/delete-session.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/users/delete-sessions.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/users/get-logs.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/users/get-prefs.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/users/get-sessions.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/users/get.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/users/list.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/users/update-prefs.md
create mode 100644 docs/examples/0.6.2/server-dart/examples/users/update-status.md
diff --git a/app/config/platforms.php b/app/config/platforms.php
index 1bfceb31e0..cfea0d6dcc 100644
--- a/app/config/platforms.php
+++ b/app/config/platforms.php
@@ -253,7 +253,7 @@ return [
[
'key' => 'dart',
'name' => 'Dart',
- 'version' => '0.0.1',
+ 'version' => '0.1.0',
'url' => 'https://github.com/appwrite/sdk-for-dart',
'package' => '',
'enabled' => true,
diff --git a/composer.json b/composer.json
index db97272fdb..2312ef077c 100644
--- a/composer.json
+++ b/composer.json
@@ -56,7 +56,7 @@
},
"require-dev": {
"swoole/ide-helper": "4.5.5",
- "appwrite/sdk-generator": "0.4.0",
+ "appwrite/sdk-generator": "0.4.1",
"phpunit/phpunit": "9.4.2",
"vimeo/psalm": "4.1.1"
},
diff --git a/composer.lock b/composer.lock
index 4323941e91..0b612def8f 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "2c7c15c2c968547dc6749efc79b39458",
+ "content-hash": "db906327240b2eff5909e2d987003883",
"packages": [
{
"name": "appwrite/php-clamav",
@@ -1858,11 +1858,11 @@
},
{
"name": "appwrite/sdk-generator",
- "version": "0.4.0",
+ "version": "0.4.1",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator",
- "reference": "91e155304d55831e66f880d5714ea81534819d44"
+ "reference": "bc6b2870d774779d0a2d027d12f4de576ac0b955"
},
"require": {
"ext-curl": "*",
@@ -1892,7 +1892,7 @@
}
],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
- "time": "2021-01-06T12:37:52+00:00"
+ "time": "2021-01-06T13:40:31+00:00"
},
{
"name": "composer/package-versions-deprecated",
diff --git a/docs/examples/0.6.2/server-dart/examples/avatars/get-browser.md b/docs/examples/0.6.2/server-dart/examples/avatars/get-browser.md
new file mode 100644
index 0000000000..87d2062fc4
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/avatars/get-browser.md
@@ -0,0 +1,18 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Avatars avatars = Avatars(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ String result = avatars.getBrowser(
+ code: 'aa',
+ );
+
+ print(result); // Resource URL string
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/avatars/get-credit-card.md b/docs/examples/0.6.2/server-dart/examples/avatars/get-credit-card.md
new file mode 100644
index 0000000000..8fe5f1d5d8
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/avatars/get-credit-card.md
@@ -0,0 +1,18 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Avatars avatars = Avatars(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ String result = avatars.getCreditCard(
+ code: 'amex',
+ );
+
+ print(result); // Resource URL string
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/avatars/get-favicon.md b/docs/examples/0.6.2/server-dart/examples/avatars/get-favicon.md
new file mode 100644
index 0000000000..6a249dc70f
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/avatars/get-favicon.md
@@ -0,0 +1,18 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Avatars avatars = Avatars(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ String result = avatars.getFavicon(
+ url: 'https://example.com',
+ );
+
+ print(result); // Resource URL string
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/avatars/get-flag.md b/docs/examples/0.6.2/server-dart/examples/avatars/get-flag.md
new file mode 100644
index 0000000000..f997b668da
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/avatars/get-flag.md
@@ -0,0 +1,18 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Avatars avatars = Avatars(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ String result = avatars.getFlag(
+ code: 'af',
+ );
+
+ print(result); // Resource URL string
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/avatars/get-image.md b/docs/examples/0.6.2/server-dart/examples/avatars/get-image.md
new file mode 100644
index 0000000000..9f31d8f159
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/avatars/get-image.md
@@ -0,0 +1,18 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Avatars avatars = Avatars(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ String result = avatars.getImage(
+ url: 'https://example.com',
+ );
+
+ print(result); // Resource URL string
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/avatars/get-initials.md b/docs/examples/0.6.2/server-dart/examples/avatars/get-initials.md
new file mode 100644
index 0000000000..73788d2170
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/avatars/get-initials.md
@@ -0,0 +1,17 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Avatars avatars = Avatars(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ String result = avatars.getInitials(
+ );
+
+ print(result); // Resource URL string
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/avatars/get-q-r.md b/docs/examples/0.6.2/server-dart/examples/avatars/get-q-r.md
new file mode 100644
index 0000000000..eb8b46c743
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/avatars/get-q-r.md
@@ -0,0 +1,18 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Avatars avatars = Avatars(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ String result = avatars.getQR(
+ text: '[TEXT]',
+ );
+
+ print(result); // Resource URL string
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/database/create-collection.md b/docs/examples/0.6.2/server-dart/examples/database/create-collection.md
new file mode 100644
index 0000000000..c060effb3d
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/database/create-collection.md
@@ -0,0 +1,26 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Database database = Database(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = database.createCollection(
+ name: '[NAME]',
+ read: [],
+ write: [],
+ rules: [],
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/database/create-document.md b/docs/examples/0.6.2/server-dart/examples/database/create-document.md
new file mode 100644
index 0000000000..4899aa4a92
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/database/create-document.md
@@ -0,0 +1,26 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Database database = Database(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = database.createDocument(
+ collectionId: '[COLLECTION_ID]',
+ data: {},
+ read: [],
+ write: [],
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/database/delete-collection.md b/docs/examples/0.6.2/server-dart/examples/database/delete-collection.md
new file mode 100644
index 0000000000..6543cc1491
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/database/delete-collection.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Database database = Database(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = database.deleteCollection(
+ collectionId: '[COLLECTION_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/database/delete-document.md b/docs/examples/0.6.2/server-dart/examples/database/delete-document.md
new file mode 100644
index 0000000000..89204f6d81
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/database/delete-document.md
@@ -0,0 +1,24 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Database database = Database(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = database.deleteDocument(
+ collectionId: '[COLLECTION_ID]',
+ documentId: '[DOCUMENT_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/database/get-collection.md b/docs/examples/0.6.2/server-dart/examples/database/get-collection.md
new file mode 100644
index 0000000000..6b0cb526ca
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/database/get-collection.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Database database = Database(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = database.getCollection(
+ collectionId: '[COLLECTION_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/database/get-document.md b/docs/examples/0.6.2/server-dart/examples/database/get-document.md
new file mode 100644
index 0000000000..efe007aadf
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/database/get-document.md
@@ -0,0 +1,24 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Database database = Database(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = database.getDocument(
+ collectionId: '[COLLECTION_ID]',
+ documentId: '[DOCUMENT_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/database/list-collections.md b/docs/examples/0.6.2/server-dart/examples/database/list-collections.md
new file mode 100644
index 0000000000..aecd08a54a
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/database/list-collections.md
@@ -0,0 +1,22 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Database database = Database(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = database.listCollections(
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/database/list-documents.md b/docs/examples/0.6.2/server-dart/examples/database/list-documents.md
new file mode 100644
index 0000000000..9323fd34be
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/database/list-documents.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Database database = Database(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = database.listDocuments(
+ collectionId: '[COLLECTION_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/database/update-collection.md b/docs/examples/0.6.2/server-dart/examples/database/update-collection.md
new file mode 100644
index 0000000000..8d77990f1a
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/database/update-collection.md
@@ -0,0 +1,26 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Database database = Database(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = database.updateCollection(
+ collectionId: '[COLLECTION_ID]',
+ name: '[NAME]',
+ read: [],
+ write: [],
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/database/update-document.md b/docs/examples/0.6.2/server-dart/examples/database/update-document.md
new file mode 100644
index 0000000000..767233b5a8
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/database/update-document.md
@@ -0,0 +1,27 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Database database = Database(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = database.updateDocument(
+ collectionId: '[COLLECTION_ID]',
+ documentId: '[DOCUMENT_ID]',
+ data: {},
+ read: [],
+ write: [],
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/health/get-anti-virus.md b/docs/examples/0.6.2/server-dart/examples/health/get-anti-virus.md
new file mode 100644
index 0000000000..dd5bbdc1cb
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/health/get-anti-virus.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Health health = Health(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = health.getAntiVirus();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/health/get-cache.md b/docs/examples/0.6.2/server-dart/examples/health/get-cache.md
new file mode 100644
index 0000000000..322939d74e
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/health/get-cache.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Health health = Health(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = health.getCache();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/health/get-d-b.md b/docs/examples/0.6.2/server-dart/examples/health/get-d-b.md
new file mode 100644
index 0000000000..e3447550eb
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/health/get-d-b.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Health health = Health(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = health.getDB();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/health/get-queue-certificates.md b/docs/examples/0.6.2/server-dart/examples/health/get-queue-certificates.md
new file mode 100644
index 0000000000..7c605154a6
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/health/get-queue-certificates.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Health health = Health(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = health.getQueueCertificates();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/health/get-queue-functions.md b/docs/examples/0.6.2/server-dart/examples/health/get-queue-functions.md
new file mode 100644
index 0000000000..c06cda9185
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/health/get-queue-functions.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Health health = Health(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = health.getQueueFunctions();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/health/get-queue-logs.md b/docs/examples/0.6.2/server-dart/examples/health/get-queue-logs.md
new file mode 100644
index 0000000000..807a04fb11
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/health/get-queue-logs.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Health health = Health(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = health.getQueueLogs();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/health/get-queue-tasks.md b/docs/examples/0.6.2/server-dart/examples/health/get-queue-tasks.md
new file mode 100644
index 0000000000..a33ae976a0
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/health/get-queue-tasks.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Health health = Health(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = health.getQueueTasks();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/health/get-queue-usage.md b/docs/examples/0.6.2/server-dart/examples/health/get-queue-usage.md
new file mode 100644
index 0000000000..b504a8efc5
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/health/get-queue-usage.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Health health = Health(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = health.getQueueUsage();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/health/get-queue-webhooks.md b/docs/examples/0.6.2/server-dart/examples/health/get-queue-webhooks.md
new file mode 100644
index 0000000000..7c159ac8cd
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/health/get-queue-webhooks.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Health health = Health(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = health.getQueueWebhooks();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/health/get-storage-local.md b/docs/examples/0.6.2/server-dart/examples/health/get-storage-local.md
new file mode 100644
index 0000000000..7f172bf86c
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/health/get-storage-local.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Health health = Health(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = health.getStorageLocal();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/health/get-time.md b/docs/examples/0.6.2/server-dart/examples/health/get-time.md
new file mode 100644
index 0000000000..65861d3cc3
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/health/get-time.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Health health = Health(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = health.getTime();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/health/get.md b/docs/examples/0.6.2/server-dart/examples/health/get.md
new file mode 100644
index 0000000000..0c9d39218e
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/health/get.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Health health = Health(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = health.get();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/locale/get-continents.md b/docs/examples/0.6.2/server-dart/examples/locale/get-continents.md
new file mode 100644
index 0000000000..2daced78b6
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/locale/get-continents.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Locale locale = Locale(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = locale.getContinents();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/locale/get-countries-e-u.md b/docs/examples/0.6.2/server-dart/examples/locale/get-countries-e-u.md
new file mode 100644
index 0000000000..7b04a49487
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/locale/get-countries-e-u.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Locale locale = Locale(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = locale.getCountriesEU();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/locale/get-countries-phones.md b/docs/examples/0.6.2/server-dart/examples/locale/get-countries-phones.md
new file mode 100644
index 0000000000..57138a6b75
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/locale/get-countries-phones.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Locale locale = Locale(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = locale.getCountriesPhones();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/locale/get-countries.md b/docs/examples/0.6.2/server-dart/examples/locale/get-countries.md
new file mode 100644
index 0000000000..2bf758adca
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/locale/get-countries.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Locale locale = Locale(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = locale.getCountries();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/locale/get-currencies.md b/docs/examples/0.6.2/server-dart/examples/locale/get-currencies.md
new file mode 100644
index 0000000000..c8a415de4c
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/locale/get-currencies.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Locale locale = Locale(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = locale.getCurrencies();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/locale/get-languages.md b/docs/examples/0.6.2/server-dart/examples/locale/get-languages.md
new file mode 100644
index 0000000000..b9ae6655a3
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/locale/get-languages.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Locale locale = Locale(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = locale.getLanguages();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/locale/get.md b/docs/examples/0.6.2/server-dart/examples/locale/get.md
new file mode 100644
index 0000000000..d290063060
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/locale/get.md
@@ -0,0 +1,21 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Locale locale = Locale(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = locale.get();
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/storage/create-file.md b/docs/examples/0.6.2/server-dart/examples/storage/create-file.md
new file mode 100644
index 0000000000..b098d92ea9
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/storage/create-file.md
@@ -0,0 +1,26 @@
+import 'dart:io';
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Storage storage = Storage(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = storage.createFile(
+ file: await MultipartFile.fromFile('./path-to-files/image.jpg', 'image.jpg'),
+ read: [],
+ write: [],
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/storage/delete-file.md b/docs/examples/0.6.2/server-dart/examples/storage/delete-file.md
new file mode 100644
index 0000000000..ae76fe6f87
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/storage/delete-file.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Storage storage = Storage(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = storage.deleteFile(
+ fileId: '[FILE_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/storage/get-file-download.md b/docs/examples/0.6.2/server-dart/examples/storage/get-file-download.md
new file mode 100644
index 0000000000..2eceaab1f5
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/storage/get-file-download.md
@@ -0,0 +1,18 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Storage storage = Storage(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ String result = storage.getFileDownload(
+ fileId: '[FILE_ID]',
+ );
+
+ print(result); // Resource URL string
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/storage/get-file-preview.md b/docs/examples/0.6.2/server-dart/examples/storage/get-file-preview.md
new file mode 100644
index 0000000000..2b564d81b7
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/storage/get-file-preview.md
@@ -0,0 +1,18 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Storage storage = Storage(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ String result = storage.getFilePreview(
+ fileId: '[FILE_ID]',
+ );
+
+ print(result); // Resource URL string
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/storage/get-file-view.md b/docs/examples/0.6.2/server-dart/examples/storage/get-file-view.md
new file mode 100644
index 0000000000..030fb40f38
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/storage/get-file-view.md
@@ -0,0 +1,18 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Storage storage = Storage(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ String result = storage.getFileView(
+ fileId: '[FILE_ID]',
+ );
+
+ print(result); // Resource URL string
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/storage/get-file.md b/docs/examples/0.6.2/server-dart/examples/storage/get-file.md
new file mode 100644
index 0000000000..d4a10369a5
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/storage/get-file.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Storage storage = Storage(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = storage.getFile(
+ fileId: '[FILE_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/storage/list-files.md b/docs/examples/0.6.2/server-dart/examples/storage/list-files.md
new file mode 100644
index 0000000000..0225695466
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/storage/list-files.md
@@ -0,0 +1,22 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Storage storage = Storage(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = storage.listFiles(
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/storage/update-file.md b/docs/examples/0.6.2/server-dart/examples/storage/update-file.md
new file mode 100644
index 0000000000..bc77e7a1d1
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/storage/update-file.md
@@ -0,0 +1,25 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Storage storage = Storage(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = storage.updateFile(
+ fileId: '[FILE_ID]',
+ read: [],
+ write: [],
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/teams/create-membership.md b/docs/examples/0.6.2/server-dart/examples/teams/create-membership.md
new file mode 100644
index 0000000000..e3923bd207
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/teams/create-membership.md
@@ -0,0 +1,26 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Teams teams = Teams(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = teams.createMembership(
+ teamId: '[TEAM_ID]',
+ email: 'email@example.com',
+ roles: [],
+ url: 'https://example.com',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/teams/create.md b/docs/examples/0.6.2/server-dart/examples/teams/create.md
new file mode 100644
index 0000000000..339663d9d1
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/teams/create.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Teams teams = Teams(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = teams.create(
+ name: '[NAME]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/teams/delete-membership.md b/docs/examples/0.6.2/server-dart/examples/teams/delete-membership.md
new file mode 100644
index 0000000000..23688dcc04
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/teams/delete-membership.md
@@ -0,0 +1,24 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Teams teams = Teams(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = teams.deleteMembership(
+ teamId: '[TEAM_ID]',
+ inviteId: '[INVITE_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/teams/delete.md b/docs/examples/0.6.2/server-dart/examples/teams/delete.md
new file mode 100644
index 0000000000..a006e8f347
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/teams/delete.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Teams teams = Teams(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = teams.delete(
+ teamId: '[TEAM_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/teams/get-memberships.md b/docs/examples/0.6.2/server-dart/examples/teams/get-memberships.md
new file mode 100644
index 0000000000..3a12dc5c2b
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/teams/get-memberships.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Teams teams = Teams(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = teams.getMemberships(
+ teamId: '[TEAM_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/teams/get.md b/docs/examples/0.6.2/server-dart/examples/teams/get.md
new file mode 100644
index 0000000000..a1bfe8e72c
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/teams/get.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Teams teams = Teams(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = teams.get(
+ teamId: '[TEAM_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/teams/list.md b/docs/examples/0.6.2/server-dart/examples/teams/list.md
new file mode 100644
index 0000000000..d55e58e36e
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/teams/list.md
@@ -0,0 +1,22 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Teams teams = Teams(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = teams.list(
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/teams/update.md b/docs/examples/0.6.2/server-dart/examples/teams/update.md
new file mode 100644
index 0000000000..22af165502
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/teams/update.md
@@ -0,0 +1,24 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Teams teams = Teams(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = teams.update(
+ teamId: '[TEAM_ID]',
+ name: '[NAME]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/users/create.md b/docs/examples/0.6.2/server-dart/examples/users/create.md
new file mode 100644
index 0000000000..18bbbf2d13
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/users/create.md
@@ -0,0 +1,24 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Users users = Users(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = users.create(
+ email: 'email@example.com',
+ password: 'password',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/users/delete-session.md b/docs/examples/0.6.2/server-dart/examples/users/delete-session.md
new file mode 100644
index 0000000000..eaa98c17b7
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/users/delete-session.md
@@ -0,0 +1,24 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Users users = Users(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = users.deleteSession(
+ userId: '[USER_ID]',
+ sessionId: '[SESSION_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/users/delete-sessions.md b/docs/examples/0.6.2/server-dart/examples/users/delete-sessions.md
new file mode 100644
index 0000000000..8c889aad2b
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/users/delete-sessions.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Users users = Users(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = users.deleteSessions(
+ userId: '[USER_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/users/get-logs.md b/docs/examples/0.6.2/server-dart/examples/users/get-logs.md
new file mode 100644
index 0000000000..63eb6b5bcf
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/users/get-logs.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Users users = Users(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = users.getLogs(
+ userId: '[USER_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/users/get-prefs.md b/docs/examples/0.6.2/server-dart/examples/users/get-prefs.md
new file mode 100644
index 0000000000..e5909422a3
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/users/get-prefs.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Users users = Users(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = users.getPrefs(
+ userId: '[USER_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/users/get-sessions.md b/docs/examples/0.6.2/server-dart/examples/users/get-sessions.md
new file mode 100644
index 0000000000..ebe44c3eb9
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/users/get-sessions.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Users users = Users(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = users.getSessions(
+ userId: '[USER_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/users/get.md b/docs/examples/0.6.2/server-dart/examples/users/get.md
new file mode 100644
index 0000000000..be582d52c5
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/users/get.md
@@ -0,0 +1,23 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Users users = Users(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = users.get(
+ userId: '[USER_ID]',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/users/list.md b/docs/examples/0.6.2/server-dart/examples/users/list.md
new file mode 100644
index 0000000000..e0ecf7adf3
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/users/list.md
@@ -0,0 +1,22 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Users users = Users(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = users.list(
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/users/update-prefs.md b/docs/examples/0.6.2/server-dart/examples/users/update-prefs.md
new file mode 100644
index 0000000000..d148e52f0b
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/users/update-prefs.md
@@ -0,0 +1,24 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Users users = Users(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = users.updatePrefs(
+ userId: '[USER_ID]',
+ prefs: {},
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/examples/0.6.2/server-dart/examples/users/update-status.md b/docs/examples/0.6.2/server-dart/examples/users/update-status.md
new file mode 100644
index 0000000000..7e14043635
--- /dev/null
+++ b/docs/examples/0.6.2/server-dart/examples/users/update-status.md
@@ -0,0 +1,24 @@
+import 'package:dart_appwrite/dart_appwrite.dart';
+
+void main() { // Init SDK
+ Client client = Client();
+ Users users = Users(client);
+
+ client
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+ ;
+
+ Future result = users.updateStatus(
+ userId: '[USER_ID]',
+ status: '1',
+ );
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
\ No newline at end of file
diff --git a/docs/sdks/dart/CHANGELOG.md b/docs/sdks/dart/CHANGELOG.md
index e69de29bb2..e8d0ca1f73 100644
--- a/docs/sdks/dart/CHANGELOG.md
+++ b/docs/sdks/dart/CHANGELOG.md
@@ -0,0 +1,3 @@
+## 0.1.0
+
+- First release
\ No newline at end of file
diff --git a/docs/sdks/dart/EXAMPLES.md b/docs/sdks/dart/EXAMPLES.md
index f6768a5f85..26930c3352 100644
--- a/docs/sdks/dart/EXAMPLES.md
+++ b/docs/sdks/dart/EXAMPLES.md
@@ -13,23 +13,26 @@ Init your Appwrite client:
```
-Create a new user and session:
+Create a new user:
```dart
-Account account = Account(client);
+Users users = Users(client);
-Response user = await account.create(email: 'me@appwrite.io', password: 'password', name: 'My Name');
+Response result = await users.create(
+ email: 'email@example.com',
+ password: 'password',
+);
-Response session = await account.createSession(email: 'me@appwrite.io', password: 'password');
-
```
Fetch user profile:
```dart
-Account account = Account(client);
+Users users = Users(client);
-Response profile = await account.get();
+Response profile = await users.get(
+ userId: '[USER_ID]',
+);
```
Upload File:
From 8e8869e3f837884441d90e23c4fb9065992f050a Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Wed, 6 Jan 2021 16:33:41 +0200
Subject: [PATCH 109/230] Updated readme
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index ea3ee938b9..debcb4dd43 100644
--- a/README.md
+++ b/README.md
@@ -124,8 +124,8 @@ Below is a list of currently supported platforms and languages. If you wish to h
* ✅ [Deno](https://github.com/appwrite/sdk-for-deno) - **Beta** (Maintained by the Appwrite Team)
* ✅ [Ruby](https://github.com/appwrite/sdk-for-ruby) - **Beta** (Maintained by the Appwrite Team)
* ✅ [Python](https://github.com/appwrite/sdk-for-python) - **Beta** (Maintained by the Appwrite Team)
+* ✅ [Dart](https://github.com/appwrite/sdk-for-dart) **Experimental** (Maintained by the Appwrite Team)
* ✅ [Go](https://github.com/appwrite/sdk-for-go) **Work in progress** (Maintained by the Appwrite Team)
-* ✅ [Dart](https://github.com/appwrite/sdk-for-dart) **Work in progress** (Maintained by the Appwrite Team)
Looking for more SDKs? - Help us by contributing a pull request to our [SDK Generator](https://github.com/appwrite/sdk-generator)!
From 5e1ff7396e288d2e8e831497cebf53a057a264e2 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Thu, 7 Jan 2021 00:02:05 +0200
Subject: [PATCH 110/230] Fixed typo
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 7967b1b2ef..b10fecd5cf 100644
--- a/README.md
+++ b/README.md
@@ -124,7 +124,7 @@ Below is a list of currently supported platforms and languages. If you wish to h
* ✅ [Deno](https://github.com/appwrite/sdk-for-deno) - **Beta** (Maintained by the Appwrite Team)
* ✅ [Ruby](https://github.com/appwrite/sdk-for-ruby) - **Beta** (Maintained by the Appwrite Team)
* ✅ [Python](https://github.com/appwrite/sdk-for-python) - **Beta** (Maintained by the Appwrite Team)
-* ✅ [.NET](https://github.com/appwrite/sdk-for-dotnet) - **Expiremental** (Maintained by the Appwrite Team)
+* ✅ [.NET](https://github.com/appwrite/sdk-for-dotnet) - **Experimental** (Maintained by the Appwrite Team)
* ✅ [Go](https://github.com/appwrite/sdk-for-go) **Work in progress** (Maintained by the Appwrite Team)
* ✅ [Dart](https://github.com/appwrite/sdk-for-dart) **Work in progress** (Maintained by the Appwrite Team)
From b23d2bf6e4d2663d9d02ec32b5b743995324bff3 Mon Sep 17 00:00:00 2001
From: Eldad Fux
Date: Thu, 7 Jan 2021 16:11:41 +0200
Subject: [PATCH 111/230] Updated examples
---
composer.json | 2 +-
composer.lock | 98 ++++++++++---------
.../examples/database/create-collection.md | 2 +-
.../examples/database/create-document.md | 2 +-
.../examples/database/update-collection.md | 2 +-
.../examples/database/update-document.md | 2 +-
.../examples/storage/create-file.md | 2 +-
.../examples/storage/update-file.md | 2 +-
.../examples/teams/create-membership.md | 2 +-
.../examples/users/update-prefs.md | 2 +-
10 files changed, 60 insertions(+), 56 deletions(-)
diff --git a/composer.json b/composer.json
index f0dc6c104c..ee1e90a876 100644
--- a/composer.json
+++ b/composer.json
@@ -56,7 +56,7 @@
},
"require-dev": {
"swoole/ide-helper": "4.5.5",
- "appwrite/sdk-generator": "0.3.3",
+ "appwrite/sdk-generator": "0.4.2",
"phpunit/phpunit": "9.4.2",
"vimeo/psalm": "4.1.1"
},
diff --git a/composer.lock b/composer.lock
index 23bbf8edea..9b68ad5f56 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "2dee8b75780ba88fd7da28d08d691998",
+ "content-hash": "0df79d7789fec84aa4500edad823f1f6",
"packages": [
{
"name": "appwrite/php-clamav",
@@ -131,16 +131,16 @@
},
{
"name": "chillerlan/php-settings-container",
- "version": "2.1.0",
+ "version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/chillerlan/php-settings-container.git",
- "reference": "90ab24a3dc09569bfa0f3dbc3d44bab3aaa2a6c5"
+ "reference": "98ccc1b31b31a53bcb563465c4961879b2b93096"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/90ab24a3dc09569bfa0f3dbc3d44bab3aaa2a6c5",
- "reference": "90ab24a3dc09569bfa0f3dbc3d44bab3aaa2a6c5",
+ "url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/98ccc1b31b31a53bcb563465c4961879b2b93096",
+ "reference": "98ccc1b31b31a53bcb563465c4961879b2b93096",
"shasum": ""
},
"require": {
@@ -148,8 +148,8 @@
"php": "^7.4 || ^8.0"
},
"require-dev": {
- "phan/phan": "^3.2.2",
- "phpunit/phpunit": "9.4"
+ "phan/phan": "^4.0",
+ "phpunit/phpunit": "^9.5"
},
"type": "library",
"autoload": {
@@ -181,12 +181,16 @@
"source": "https://github.com/chillerlan/php-settings-container"
},
"funding": [
+ {
+ "url": "https://www.paypal.com/donate?hosted_button_id=WLYUNAT9ZTJZ4",
+ "type": "custom"
+ },
{
"url": "https://ko-fi.com/codemasher",
"type": "ko_fi"
}
],
- "time": "2020-10-07T13:18:35+00:00"
+ "time": "2021-01-06T15:57:03+00:00"
},
{
"name": "colinmollenhour/credis",
@@ -1858,11 +1862,11 @@
},
{
"name": "appwrite/sdk-generator",
- "version": "0.3.3",
+ "version": "0.4.2",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator",
- "reference": "7530820a1ee824874d89749c51b0e49d15595abc"
+ "reference": "5482f4cdb65ab90ffea752ba9a625187cd7c7784"
},
"require": {
"ext-curl": "*",
@@ -1892,7 +1896,7 @@
}
],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
- "time": "2021-01-05T17:58:17+00:00"
+ "time": "2021-01-07T14:03:54+00:00"
},
{
"name": "composer/package-versions-deprecated",
@@ -2323,16 +2327,16 @@
},
{
"name": "matthiasmullie/minify",
- "version": "1.3.65",
+ "version": "1.3.66",
"source": {
"type": "git",
"url": "https://github.com/matthiasmullie/minify.git",
- "reference": "227f19062451c55a797e0cc667ef983834e6580c"
+ "reference": "45fd3b0f1dfa2c965857c6d4a470bea52adc31a6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/227f19062451c55a797e0cc667ef983834e6580c",
- "reference": "227f19062451c55a797e0cc667ef983834e6580c",
+ "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/45fd3b0f1dfa2c965857c6d4a470bea52adc31a6",
+ "reference": "45fd3b0f1dfa2c965857c6d4a470bea52adc31a6",
"shasum": ""
},
"require": {
@@ -2342,8 +2346,8 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2.0",
- "matthiasmullie/scrapbook": "~1.0",
- "phpunit/phpunit": "~4.8"
+ "matthiasmullie/scrapbook": "dev-master",
+ "phpunit/phpunit": ">=4.8"
},
"suggest": {
"psr/cache-implementation": "Cache implementation to use with Minify::cache"
@@ -2381,7 +2385,7 @@
],
"support": {
"issues": "https://github.com/matthiasmullie/minify/issues",
- "source": "https://github.com/matthiasmullie/minify/tree/1.3.65"
+ "source": "https://github.com/matthiasmullie/minify/tree/1.3.66"
},
"funding": [
{
@@ -2397,7 +2401,7 @@
"type": "github"
}
],
- "time": "2020-12-27T21:43:29+00:00"
+ "time": "2021-01-06T15:18:10+00:00"
},
{
"name": "matthiasmullie/path-converter",
@@ -4513,12 +4517,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "af2bafc13cb92e182bf634285346925e09888d23"
+ "reference": "da4c3663721420520b024e5aede66b813019e744"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/af2bafc13cb92e182bf634285346925e09888d23",
- "reference": "af2bafc13cb92e182bf634285346925e09888d23",
+ "url": "https://api.github.com/repos/symfony/console/zipball/da4c3663721420520b024e5aede66b813019e744",
+ "reference": "da4c3663721420520b024e5aede66b813019e744",
"shasum": ""
},
"require": {
@@ -4603,7 +4607,7 @@
"type": "tidelift"
}
],
- "time": "2021-01-05T19:51:30+00:00"
+ "time": "2021-01-05T20:16:44+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -4611,12 +4615,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "7130f348df2f842044038aaae9d6653dc9d67649"
+ "reference": "7c0a3c5420fd802637c4260e595d6c674b23d578"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7130f348df2f842044038aaae9d6653dc9d67649",
- "reference": "7130f348df2f842044038aaae9d6653dc9d67649",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7c0a3c5420fd802637c4260e595d6c674b23d578",
+ "reference": "7c0a3c5420fd802637c4260e595d6c674b23d578",
"shasum": ""
},
"require": {
@@ -4683,7 +4687,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-27T09:28:48+00:00"
+ "time": "2021-01-06T10:19:43+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
@@ -4691,12 +4695,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
- "reference": "e314d4992832c3a0a68ca731fadd959917320fda"
+ "reference": "32b651134d58efe1786c95352d846913a42d8331"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/e314d4992832c3a0a68ca731fadd959917320fda",
- "reference": "e314d4992832c3a0a68ca731fadd959917320fda",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32b651134d58efe1786c95352d846913a42d8331",
+ "reference": "32b651134d58efe1786c95352d846913a42d8331",
"shasum": ""
},
"require": {
@@ -4765,7 +4769,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-27T09:28:48+00:00"
+ "time": "2021-01-06T10:19:43+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
@@ -4773,12 +4777,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
- "reference": "3a79a2226897adae0cab81688fbc5144e2fc53f6"
+ "reference": "8592bf62da8352927fc3857484e84baacddec301"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3a79a2226897adae0cab81688fbc5144e2fc53f6",
- "reference": "3a79a2226897adae0cab81688fbc5144e2fc53f6",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8592bf62da8352927fc3857484e84baacddec301",
+ "reference": "8592bf62da8352927fc3857484e84baacddec301",
"shasum": ""
},
"require": {
@@ -4850,7 +4854,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-27T22:11:44+00:00"
+ "time": "2021-01-06T10:19:43+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -4858,12 +4862,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "de14691dc88bbbc5535de7f0e32080977dc1d23f"
+ "reference": "ec0101071dcbc6bdd5046da11df686f8515fa815"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/de14691dc88bbbc5535de7f0e32080977dc1d23f",
- "reference": "de14691dc88bbbc5535de7f0e32080977dc1d23f",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/ec0101071dcbc6bdd5046da11df686f8515fa815",
+ "reference": "ec0101071dcbc6bdd5046da11df686f8515fa815",
"shasum": ""
},
"require": {
@@ -4931,7 +4935,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-27T09:28:48+00:00"
+ "time": "2021-01-06T10:19:43+00:00"
},
{
"name": "symfony/polyfill-php73",
@@ -4939,12 +4943,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "8c0d39c1526009b97f43beea4cc685bbc353a70b"
+ "reference": "6d0e293e2b13580b866090a135900aea4adcb308"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/8c0d39c1526009b97f43beea4cc685bbc353a70b",
- "reference": "8c0d39c1526009b97f43beea4cc685bbc353a70b",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/6d0e293e2b13580b866090a135900aea4adcb308",
+ "reference": "6d0e293e2b13580b866090a135900aea4adcb308",
"shasum": ""
},
"require": {
@@ -5011,7 +5015,7 @@
"type": "tidelift"
}
],
- "time": "2020-10-26T13:35:45+00:00"
+ "time": "2021-01-06T10:19:43+00:00"
},
{
"name": "symfony/polyfill-php80",
@@ -5019,12 +5023,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "54cc82c30ba7ed02bc64f5d010488c159b5f1706"
+ "reference": "69e5da91ad9c080f6ac1e010ddffefe71b14bd6e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/54cc82c30ba7ed02bc64f5d010488c159b5f1706",
- "reference": "54cc82c30ba7ed02bc64f5d010488c159b5f1706",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/69e5da91ad9c080f6ac1e010ddffefe71b14bd6e",
+ "reference": "69e5da91ad9c080f6ac1e010ddffefe71b14bd6e",
"shasum": ""
},
"require": {
@@ -5095,7 +5099,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-27T09:28:48+00:00"
+ "time": "2021-01-06T10:19:43+00:00"
},
{
"name": "symfony/service-contracts",
diff --git a/docs/examples/0.6.2/server-dotnet/examples/database/create-collection.md b/docs/examples/0.6.2/server-dotnet/examples/database/create-collection.md
index a8c2c3f7e0..7e519655b2 100644
--- a/docs/examples/0.6.2/server-dotnet/examples/database/create-collection.md
+++ b/docs/examples/0.6.2/server-dotnet/examples/database/create-collection.md
@@ -10,4 +10,4 @@ client
Database database = new Database(client);
-HttpResponseMessage result = await database.CreateCollection("[NAME]", {}, {}, {});
+HttpResponseMessage result = await database.CreateCollection("[NAME]", [List