From f9763f835e2bcd2195f5d7b14a7ec49856fac573 Mon Sep 17 00:00:00 2001 From: eldadfux Date: Sun, 21 Jul 2019 16:48:10 +0300 Subject: [PATCH] Updated SDKs --- app/sdks/js/package.json | 2 +- app/sdks/js/src/sdk.js | 4 ++-- app/sdks/js/src/sdk.min.js | 4 ++-- app/tasks/sdks.php | 2 +- composer.lock | 46 +++++++++++++++++++++----------------- 5 files changed, 31 insertions(+), 27 deletions(-) diff --git a/app/sdks/js/package.json b/app/sdks/js/package.json index e7ddf3100c..1607fc7df3 100644 --- a/app/sdks/js/package.json +++ b/app/sdks/js/package.json @@ -2,7 +2,7 @@ "name": "appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)", - "version": "v1.0.5", + "version": "v1.0.6", "license": "BSD-3-Clause", "main": "src/sdk.js", "repository": { diff --git a/app/sdks/js/src/sdk.js b/app/sdks/js/src/sdk.js index 174a135a5f..f446a5d19b 100644 --- a/app/sdks/js/src/sdk.js +++ b/app/sdks/js/src/sdk.js @@ -132,7 +132,7 @@ globalParams.push({key: key, value: value}); }; - addGlobalHeader('x-sdk-version', 'appwrite:javascript:v1.0.5'); + addGlobalHeader('x-sdk-version', 'appwrite:javascript:v1.0.6'); addGlobalHeader('content-type', ''); /** @@ -251,7 +251,7 @@ return call('POST', path, headers, params, progress); }, 'put': function(path, headers = {}, params = {}, progress = null) { - return call('PUT', headers, params, progress); + return call('PUT', path, headers, params, progress); }, 'patch': function(path, headers = {}, params = {}, progress = null) { return call('PATCH', path, headers, params, progress); diff --git a/app/sdks/js/src/sdk.min.js b/app/sdks/js/src/sdk.min.js index 9f3594ad65..fa2aa8691c 100644 --- a/app/sdks/js/src/sdk.min.js +++ b/app/sdks/js/src/sdk.min.js @@ -1,5 +1,5 @@ (function(window){window.Appwrite=function(){let config={endpoint:'https://appwrite.test/v1',project:'',key:'',locale:'',mode:'',};let setEndpoint=function(endpoint){config.endpoint=endpoint;return this};let setProject=function(value){http.addGlobalHeader('X-Appwrite-Project',value);config.project=value;return this};let setKey=function(value){http.addGlobalHeader('X-Appwrite-Key',value);config.key=value;return this};let setLocale=function(value){http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this};let setMode=function(value){http.addGlobalHeader('X-Appwrite-Mode',value);config.mode=value;return this};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g;let match,str=[];a.href=url;param=encodeURIComponent(param);while(match=regex.exec(a.search))if(param!==match[1])str.push(match[1]+(match[2]?"="+match[2]:""));str.push(param+(value?"="+encodeURIComponent(value):""));a.search=str.join("&");return a.href};let buildQuery=function(params){let str=[];for(let p in params){if(params.hasOwnProperty(p)){str.push(encodeURIComponent(p)+"="+encodeURIComponent(params[p]))}} -return str.join("&")};let addGlobalHeader=function(key,value){globalHeaders[key]={key:key.toLowerCase(),value:value.toLowerCase()}};let addGlobalParam=function(key,value){globalParams.push({key:key,value:value})};addGlobalHeader('x-sdk-version','appwrite:javascript:v1.0.5');addGlobalHeader('content-type','');let call=function(method,path,headers={},params={},progress=null){let i;path=config.endpoint+path;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name')} +return str.join("&")};let addGlobalHeader=function(key,value){globalHeaders[key]={key:key.toLowerCase(),value:value.toLowerCase()}};let addGlobalParam=function(key,value){globalParams.push({key:key,value:value})};addGlobalHeader('x-sdk-version','appwrite:javascript:v1.0.6');addGlobalHeader('content-type','');let call=function(method,path,headers={},params={},progress=null){let i;path=config.endpoint+path;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name')} if(typeof path!=='string'){throw new Error('var path must be of type string')} if(typeof headers!=='object'){throw new Error('var headers must be of type object')} for(i=0;i=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type');contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case 'application/json':data=JSON.parse(data);break} resolve(data)}else{reject(new Error(request.statusText))}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,!1)} -request.onerror=function(){reject(new Error("Network Error"))};request.send(params)})};return{'get':function(path,headers={},params={}){return call('GET',path+((params.length>0)?'?'+buildQuery(params):''),headers,{})},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress)},'put':function(path,headers={},params={},progress=null){return call('PUT',headers,params,progress)},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress)},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress)},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let iframe=function(method,url,params){let form=document.createElement('form');form.setAttribute('method',method);form.setAttribute('action',config.endpoint+url);for(let key in params){if(params.hasOwnProperty(key)){let hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden");hiddenField.setAttribute("name",key);hiddenField.setAttribute("value",params[key]);form.appendChild(hiddenField)}} +request.onerror=function(){reject(new Error("Network Error"))};request.send(params)})};return{'get':function(path,headers={},params={}){return call('GET',path+((params.length>0)?'?'+buildQuery(params):''),headers,{})},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress)},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress)},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress)},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress)},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let iframe=function(method,url,params){let form=document.createElement('form');form.setAttribute('method',method);form.setAttribute('action',config.endpoint+url);for(let key in params){if(params.hasOwnProperty(key)){let hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden");hiddenField.setAttribute("name",key);hiddenField.setAttribute("value",params[key]);form.appendChild(hiddenField)}} document.body.appendChild(form);return form.submit()};let account={get:function(){let path='/account';return http.get(path,{'content-type':'application/json'},{})},delete:function(){let path='/account';return http.delete(path,{'content-type':'application/json'},{})},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"')} if(password===undefined){throw new Error('Missing required parameter: "password"')} let path='/account/email';return http.patch(path,{'content-type':'application/json'},{'email':email,'password':password})},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"')} diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php index 8e72196d4e..1a85bd6714 100644 --- a/app/tasks/sdks.php +++ b/app/tasks/sdks.php @@ -46,7 +46,7 @@ $cli 'gitUserName' => 'appwrite', ], 'js' => [ - 'version' => 'v1.0.5', + 'version' => 'v1.0.6', 'result' => __DIR__ . '/../sdks/js/', 'gitURL' => 'https://github.com/appwrite/sdk-for-js.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-js.git', diff --git a/composer.lock b/composer.lock index fbd82b254d..43d52f8ce7 100644 --- a/composer.lock +++ b/composer.lock @@ -57,12 +57,12 @@ "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "9bf19207138736f36bf690601b0ae84a9e3ae9e0" + "reference": "defeb4f92cc9bd84279594f3ce0e8da10d5bd4ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/9bf19207138736f36bf690601b0ae84a9e3ae9e0", - "reference": "9bf19207138736f36bf690601b0ae84a9e3ae9e0", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/defeb4f92cc9bd84279594f3ce0e8da10d5bd4ff", + "reference": "defeb4f92cc9bd84279594f3ce0e8da10d5bd4ff", "shasum": "" }, "require": { @@ -94,7 +94,7 @@ } ], "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", - "time": "2019-07-05 08:05:29" + "time": "2019-07-21 13:45:44" }, { "name": "bacon/bacon-qr-code", @@ -1502,12 +1502,12 @@ "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "e74d477c54a0d3f17764a6f17ea1536170227773" + "reference": "5bfe590de545c791e4c3c98a908f65cc6c79b404" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/e74d477c54a0d3f17764a6f17ea1536170227773", - "reference": "e74d477c54a0d3f17764a6f17ea1536170227773", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/5bfe590de545c791e4c3c98a908f65cc6c79b404", + "reference": "5bfe590de545c791e4c3c98a908f65cc6c79b404", "shasum": "" }, "require": { @@ -1561,7 +1561,7 @@ "keywords": [ "templating" ], - "time": "2019-07-03 18:24:58" + "time": "2019-07-12 06:13:06" }, { "name": "utopia-php/abuse", @@ -1954,19 +1954,23 @@ "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + "reference": "8c8bd1bb1a22f311b1b4886662b989d0d02aab77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/8c8bd1bb1a22f311b1b4886662b989d0d02aab77", + "reference": "8c8bd1bb1a22f311b1b4886662b989d0d02aab77", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", + "ext-xmlwriter": "*", "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" + "php": "^7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.2" }, "type": "library", "extra": { @@ -2001,7 +2005,7 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2018-07-08T19:23:20+00:00" + "time": "2019-07-09T12:18:04+00:00" }, { "name": "phar-io/version", @@ -2474,12 +2478,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "98831941cc60e07e7e94d4ff000440015f60da67" + "reference": "c4a66b97f040e3e20b3aa2a243230a1c3a9f7c8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/98831941cc60e07e7e94d4ff000440015f60da67", - "reference": "98831941cc60e07e7e94d4ff000440015f60da67", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/c4a66b97f040e3e20b3aa2a243230a1c3a9f7c8c", + "reference": "c4a66b97f040e3e20b3aa2a243230a1c3a9f7c8c", "shasum": "" }, "require": { @@ -2515,7 +2519,7 @@ "keywords": [ "tokenizer" ], - "time": "2019-07-02T07:43:15+00:00" + "time": "2019-07-08T05:24:54+00:00" }, { "name": "phpunit/phpunit", @@ -2523,12 +2527,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "08d5f6c49381a45ff22bd0509f3c4f4b004349aa" + "reference": "2834789aeb9ac182ad69bfdf9ae91856a59945ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/08d5f6c49381a45ff22bd0509f3c4f4b004349aa", - "reference": "08d5f6c49381a45ff22bd0509f3c4f4b004349aa", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2834789aeb9ac182ad69bfdf9ae91856a59945ff", + "reference": "2834789aeb9ac182ad69bfdf9ae91856a59945ff", "shasum": "" }, "require": { @@ -2599,7 +2603,7 @@ "testing", "xunit" ], - "time": "2019-07-03T16:38:29+00:00" + "time": "2019-07-15T06:24:08+00:00" }, { "name": "sebastian/code-unit-reverse-lookup",