mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Updated SDKs
This commit is contained in:
@@ -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": {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Vendored
+2
-2
@@ -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<globalParams.length;i++){path=addParam(path,globalParams[i].key,globalParams[i].value)}
|
||||
@@ -10,7 +10,7 @@ params=formData;break}
|
||||
return new Promise(function(resolve,reject){let request=new XMLHttpRequest(),key;request.withCredentials=!0;request.open(method,path,!0);for(key in headers){if(headers.hasOwnProperty(key)){request.setRequestHeader(key,headers[key])}}
|
||||
request.onload=function(){if(4===request.readyState&&399>=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"')}
|
||||
|
||||
+1
-1
@@ -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',
|
||||
|
||||
Generated
+25
-21
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user