1
0
Fork 0
mirror of synced 2024-06-02 02:44:47 +12:00

Removed some limits and updated SDKs

This commit is contained in:
eldadfux 2019-07-03 22:50:04 +03:00
parent 34c9bf9f3b
commit 66072f84b5
9 changed files with 59 additions and 61 deletions

View file

@ -130,7 +130,7 @@ $utopia->post('/v1/database')
->label('sdk.namespace', 'database')
->label('sdk.method', 'createCollection')
->label('sdk.description', 'Create a new Collection.')
->label('abuse-limit', 200)
->label('abuse-limit', 2000)
->param('name', '', function () {return new Text(256);}, 'Collection name.')
->param('read', [], function () {return new ArrayList(new Text(64));}, 'An array of read permissions. [Learn more about permissions and roles](/docs/permissions).', true)
->param('write', [], function () {return new ArrayList(new Text(64));}, 'An array of write permissions. [Learn more about permissions and roles](/docs/permissions).', true)
@ -372,7 +372,7 @@ $utopia->post('/v1/database/:collectionId')
->label('sdk.namespace', 'database')
->label('sdk.method', 'createDocument')
->label('sdk.description', 'Create a new Document.')
->label('abuse-limit', 200)
->label('abuse-limit', 2000)
->param('collectionId', null, function () {return new UID();}, 'Collection unique ID.')
->param('data', [], function () {return new \Utopia\Validator\Mock();}, 'Document data as JSON string.')
->param('read', [], function () {return new ArrayList(new Text(64));}, 'An array of read permissions. [Learn more about permissions and roles](/docs/permissions).', true)
@ -479,7 +479,7 @@ $utopia->patch('/v1/database/:collectionId/:documentId')
->label('scope', 'documents.write')
->label('sdk.namespace', 'database')
->label('sdk.method', 'updateDocument')
->label('abuse-limit', 200)
->label('abuse-limit', 2000)
->param('collectionId', null, function () {return new UID();}, 'Collection unique ID')
->param('documentId', null, function () {return new UID();}, 'Document unique ID')
->param('data', [], function () {return new \Utopia\Validator\Mock();}, 'Document data as JSON string')
@ -555,7 +555,7 @@ $utopia->delete('/v1/database/:collectionId/:documentId')
->label('sdk.namespace', 'database')
->label('sdk.method', 'deleteDocument')
->label('sdk.description', 'Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.')
->label('abuse-limit', 200)
->label('abuse-limit', 2000)
->param('collectionId', null, function () {return new UID();}, 'Collection unique ID')
->param('documentId', null, function () {return new UID();}, 'Document unique ID')
->action(

View file

@ -119,7 +119,7 @@ $utopia->get('/v1/projects/:projectId/usage')
throw new Exception('Project not found', 404);
}
$client = new InfluxDB\Client('influxdb', '8086');
/*$client = new InfluxDB\Client('influxdb', '8086');
$start = DateTime::createFromFormat('U', strtotime('first day of this month'));
$start = $start->format(DateTime::RFC3339);
$end = DateTime::createFromFormat('U', strtotime('last day of this month'));
@ -151,7 +151,7 @@ $utopia->get('/v1/projects/:projectId/usage')
'date' => strtotime($point['time']),
];
}
*/
// Users
$projectDB->getCollection([
@ -195,22 +195,20 @@ $utopia->get('/v1/projects/:projectId/usage')
$response->json([
'requests' => [
'data' => $requests,
'total' => array_sum(array_map(function($item) {
return $item['value'];
}, $requests)),
//'data' => $requests,
//'total' => array_sum(array_map(function($item) {return $item['value'];}, $requests)),
],
'network' => [
'data' => $network,
'total' => array_sum(array_map(function($item) {
return $item['value'];
}, $network)),
//'data' => $network,
//'total' => array_sum(array_map(function($item) {return $item['value'];}, $network)),
],
'collections' => [
'data' => $collections,
'total' => $collectionsTotal,
],
'documents' => [
'data' => $documents,
'total' => array_sum(array_map(function($item) {
return $item['total'];
}, $documents)),
'total' => array_sum(array_map(function($item) {return $item['total'];}, $documents)),
],
'users' => [
'data' => [],

View file

@ -7,7 +7,7 @@ class Client {
this.endpoint = 'https://appwrite.test/v1';
this.headers = {
'content-type': '',
'x-sdk-version': 'appwrite:nodejs:v1.0.15',
'x-sdk-version': 'appwrite:nodejs:v1.0.16',
};
this.selfSigned = false;
}
@ -109,9 +109,9 @@ class Client {
let options = {
method: method.toUpperCase(),
uri: this.endpoint + path,
qs: (method.toUpperCase === 'GET') ? params : {},
qs: (method.toUpperCase() === 'GET') ? params : {},
headers: headers,
body: (method.toUpperCase === 'GET') ? '' : params,
body: (method.toUpperCase() === 'GET') ? '' : params,
json: (headers['content-type'].toLowerCase().startsWith('application/json')),
};

View file

@ -2,7 +2,7 @@
"name": "node-appwrite",
"homepage": "https://appwrite.io/support",
"description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)",
"version": "v1.0.15",
"version": "v1.0.16",
"license": "BSD-3-Clause",
"main": "index.js",
"repository": {

View file

@ -54,7 +54,7 @@ $cli
'gitUserName' => 'appwrite',
],
'node' => [
'version' => 'v1.0.15',
'version' => 'v1.0.16',
'result' => __DIR__ . '/../sdks/node/',
'gitURL' => 'https://github.com/appwrite/sdk-for-node.git',
'gitRepo' => 'git@github.com:appwrite/sdk-for-node.git',

74
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "3c90b0bc44a105e53789f468c0060682",
"content-hash": "4da6c815200ff864152d70447fc4b83e",
"packages": [
{
"name": "appwrite/php-clamav",
@ -57,12 +57,12 @@
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator.git",
"reference": "83655bde18a4186b3212d4eb8ce291521243cef4"
"reference": "40a69ef4a10b8d80c98d30622778a89ab809f866"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/83655bde18a4186b3212d4eb8ce291521243cef4",
"reference": "83655bde18a4186b3212d4eb8ce291521243cef4",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/40a69ef4a10b8d80c98d30622778a89ab809f866",
"reference": "40a69ef4a10b8d80c98d30622778a89ab809f866",
"shasum": ""
},
"require": {
@ -94,7 +94,7 @@
}
],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"time": "2019-06-08 13:19:14"
"time": "2019-06-22 18:53:17"
},
{
"name": "bacon/bacon-qr-code",
@ -690,19 +690,19 @@
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "926eaa3ff73cde2becf652b785831bcb7618568a"
"reference": "e6d006f1ced100d81755966f09625d71ce6a7dca"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/926eaa3ff73cde2becf652b785831bcb7618568a",
"reference": "926eaa3ff73cde2becf652b785831bcb7618568a",
"url": "https://api.github.com/repos/guzzle/promises/zipball/e6d006f1ced100d81755966f09625d71ce6a7dca",
"reference": "e6d006f1ced100d81755966f09625d71ce6a7dca",
"shasum": ""
},
"require": {
"php": ">=5.5.0"
"php": ">=5.6"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36"
"phpunit/phpunit": "^5.7.27 || ^7.5"
},
"type": "library",
"extra": {
@ -733,7 +733,7 @@
"keywords": [
"promise"
],
"time": "2018-10-30 00:20:04"
"time": "2019-06-11 17:44:31"
},
{
"name": "guzzlehttp/psr7",
@ -741,12 +741,12 @@
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "5ce1cec1a26c5d2ccd259157f58a32b7facd545a"
"reference": "e113254d23b24c548f0b4d8f671828c4eeb876d2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/5ce1cec1a26c5d2ccd259157f58a32b7facd545a",
"reference": "5ce1cec1a26c5d2ccd259157f58a32b7facd545a",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/e113254d23b24c548f0b4d8f671828c4eeb876d2",
"reference": "e113254d23b24c548f0b4d8f671828c4eeb876d2",
"shasum": ""
},
"require": {
@ -767,7 +767,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
"dev-master": "1.6-dev"
}
},
"autoload": {
@ -804,7 +804,7 @@
"uri",
"url"
],
"time": "2019-06-06 09:22:35"
"time": "2019-06-17 23:10:01"
},
{
"name": "influxdb/influxdb-php",
@ -1502,12 +1502,12 @@
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "d18cba7d84855055dcbd4b72334da281c4e418cb"
"reference": "fb5a1f43e653ba4af08333e8ba3f6330b1017d34"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/d18cba7d84855055dcbd4b72334da281c4e418cb",
"reference": "d18cba7d84855055dcbd4b72334da281c4e418cb",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/fb5a1f43e653ba4af08333e8ba3f6330b1017d34",
"reference": "fb5a1f43e653ba4af08333e8ba3f6330b1017d34",
"shasum": ""
},
"require": {
@ -1561,7 +1561,7 @@
"keywords": [
"templating"
],
"time": "2019-06-06 08:28:59"
"time": "2019-06-20 11:56:08"
},
{
"name": "utopia-php/abuse",
@ -2208,12 +2208,12 @@
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "7e272180527c34a97680de85eb5aba0847a664e0"
"reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/7e272180527c34a97680de85eb5aba0847a664e0",
"reference": "7e272180527c34a97680de85eb5aba0847a664e0",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76",
"reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76",
"shasum": ""
},
"require": {
@ -2263,7 +2263,7 @@
"spy",
"stub"
],
"time": "2018-12-18T15:40:51+00:00"
"time": "2019-06-13T12:50:23+00:00"
},
{
"name": "phpunit/php-code-coverage",
@ -2425,12 +2425,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "1038454804406b0b5f5f520358e78c1c2f71501e"
"reference": "29995fbf33aabda1b53b65ada13737d42ccaf53a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e",
"reference": "1038454804406b0b5f5f520358e78c1c2f71501e",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/29995fbf33aabda1b53b65ada13737d42ccaf53a",
"reference": "29995fbf33aabda1b53b65ada13737d42ccaf53a",
"shasum": ""
},
"require": {
@ -2466,7 +2466,7 @@
"keywords": [
"timer"
],
"time": "2019-06-07T04:22:29+00:00"
"time": "2019-06-10T14:27:16+00:00"
},
{
"name": "phpunit/php-token-stream",
@ -2523,12 +2523,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "56a5c2f7d205328a655d685ebd2490ad1606446b"
"reference": "1477fe424dc8ba0b252b1262f91f40139e0f889b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/56a5c2f7d205328a655d685ebd2490ad1606446b",
"reference": "56a5c2f7d205328a655d685ebd2490ad1606446b",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1477fe424dc8ba0b252b1262f91f40139e0f889b",
"reference": "1477fe424dc8ba0b252b1262f91f40139e0f889b",
"shasum": ""
},
"require": {
@ -2599,7 +2599,7 @@
"testing",
"xunit"
],
"time": "2019-06-07T04:29:50+00:00"
"time": "2019-06-20T14:04:28+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
@ -3169,16 +3169,16 @@
},
{
"name": "theseer/tokenizer",
"version": "1.1.2",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/theseer/tokenizer.git",
"reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8"
"reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/theseer/tokenizer/zipball/1c42705be2b6c1de5904f8afacef5895cab44bf8",
"reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8",
"url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9",
"reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9",
"shasum": ""
},
"require": {
@ -3205,7 +3205,7 @@
}
],
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"time": "2019-04-04T09:56:43+00:00"
"time": "2019-06-13T22:48:21+00:00"
},
{
"name": "webmozart/assert",

View file

@ -14,7 +14,6 @@
console.teams.create(formData['name'] || '')
.then(function (data) {
let team = JSON.parse(data)['$uid'];
formData = JSON.parse(JSON.stringify(formData).replace(new RegExp('{{teamId}}', 'g'), team)); //convert to JSON string

View file

@ -1585,6 +1585,7 @@ class Database
$document = new Document((isset($this->mocks[$id]) && $mock) ? $this->mocks[$id] : $this->adapter->getDocument($id));
$validator = new Authorization($document, 'read');
if(!$validator->isValid($document->getPermissions())) { // Check if user has read access to this document
return new Document([]);
}

View file

@ -38,7 +38,7 @@ class Key extends Validator
return false;
}
if(mb_strlen($value) > 32) {
if(mb_strlen($value) > 40) {
return false;
}