Merge branch '0.6' of github.com:appwrite/appwrite into functions
This commit is contained in:
commit
bce90d68b0
12 changed files with 7 additions and 122 deletions
|
@ -14,6 +14,7 @@
|
|||
* New OAuth logos
|
||||
* Minor fixes to the dark mode theme
|
||||
* Added JSON view for a project user
|
||||
* Removed setKey and setMode methods from all client SDKs
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
|
|
|
@ -53,25 +53,12 @@ class Client {
|
|||
return this;
|
||||
}
|
||||
|
||||
/// Your secret API key
|
||||
Client setKey(value) {
|
||||
config['key'] = value;
|
||||
addHeader('X-Appwrite-Key', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
Client setLocale(value) {
|
||||
config['locale'] = value;
|
||||
addHeader('X-Appwrite-Locale', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
Client setMode(value) {
|
||||
config['mode'] = value;
|
||||
addHeader('X-Appwrite-Mode', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
Client setSelfSigned({bool status = true}) {
|
||||
selfSigned = status;
|
||||
return this;
|
||||
|
|
|
@ -45,10 +45,6 @@ func (clt *Client) SetLocale(value string) {
|
|||
clt.headers["X-Appwrite-Locale"] = value
|
||||
}
|
||||
|
||||
func (clt *Client) SetMode(value string) {
|
||||
clt.headers["X-Appwrite-Mode"] = value
|
||||
}
|
||||
|
||||
// Call an API using Client
|
||||
func (clt *Client) Call(method string, path string, headers map[string]interface{}, params map[string]interface{}) (map[string]interface{}, error) {
|
||||
if clt.client == nil {
|
||||
|
|
|
@ -78,12 +78,6 @@ public class Client {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Client setMode(String value) {
|
||||
config.put("mode", value);
|
||||
addHeader("X-Appwrite-Mode", value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Client setSelfSigned(boolean status) {
|
||||
selfSigned = status;
|
||||
return this;
|
||||
|
|
|
@ -55,19 +55,6 @@ class Client {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Mode
|
||||
*
|
||||
* @param string value
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
setMode(value) {
|
||||
this.addHeader('X-Appwrite-Mode', value);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/***
|
||||
* @param bool status
|
||||
* @return this
|
||||
|
|
|
@ -93,20 +93,6 @@ class Client
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Mode
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return Client
|
||||
*/
|
||||
public function setMode($value)
|
||||
{
|
||||
$this->addHeader('X-Appwrite-Mode', $value);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* @param bool $status
|
||||
|
|
|
@ -38,10 +38,6 @@ class Client:
|
|||
self._global_headers['x-appwrite-locale'] = value.lower()
|
||||
return self
|
||||
|
||||
def set_mode(self, value):
|
||||
self._global_headers['x-appwrite-mode'] = value.lower()
|
||||
return self
|
||||
|
||||
def call(self, method, path='', headers=None, params=None):
|
||||
if headers is None:
|
||||
headers = {}
|
||||
|
|
|
@ -43,12 +43,6 @@ module Appwrite
|
|||
return self
|
||||
end
|
||||
|
||||
def set_mode(value)
|
||||
add_header('x-appwrite-mode', value)
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
def set_endpoint(endpoint)
|
||||
@endpoint = endpoint
|
||||
|
||||
|
|
|
@ -7,9 +7,7 @@
|
|||
let config = {
|
||||
endpoint: 'https://appwrite.io/v1',
|
||||
project: '',
|
||||
key: '',
|
||||
locale: '',
|
||||
mode: '',
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -40,24 +38,6 @@
|
|||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set Key
|
||||
*
|
||||
* Your secret API key
|
||||
*
|
||||
* @param value string
|
||||
*
|
||||
* @return this
|
||||
*/
|
||||
let setKey = function (value)
|
||||
{
|
||||
http.addGlobalHeader('X-Appwrite-Key', value);
|
||||
|
||||
config.key = value;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set Locale
|
||||
*
|
||||
|
@ -74,22 +54,6 @@
|
|||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set Mode
|
||||
*
|
||||
* @param value string
|
||||
*
|
||||
* @return this
|
||||
*/
|
||||
let setMode = function (value)
|
||||
{
|
||||
http.addGlobalHeader('X-Appwrite-Mode', value);
|
||||
|
||||
config.mode = value;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
let http = function(document) {
|
||||
let globalParams = [],
|
||||
globalHeaders = [];
|
||||
|
@ -2142,9 +2106,7 @@
|
|||
return {
|
||||
setEndpoint: setEndpoint,
|
||||
setProject: setProject,
|
||||
setKey: setKey,
|
||||
setLocale: setLocale,
|
||||
setMode: setMode,
|
||||
account: account,
|
||||
avatars: avatars,
|
||||
database: database,
|
||||
|
|
4
app/sdks/web-javascript/src/sdk.min.js
vendored
4
app/sdks/web-javascript/src/sdk.min.js
vendored
|
@ -1,4 +1,4 @@
|
|||
(function(window){'use strict';window.Appwrite=function(){let config={endpoint:'https://appwrite.io/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(Array.isArray(params[p])){for(let index=0;index<params[p].length;index++){let param=params[p][index];str.push(encodeURIComponent(p+'[]')+"="+encodeURIComponent(param))}}else{str.push(encodeURIComponent(p)+"="+encodeURIComponent(params[p]))}}
|
||||
(function(window){'use strict';window.Appwrite=function(){let config={endpoint:'https://appwrite.io/v1',project:'',locale:'',};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 setLocale=function(value){http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=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(Array.isArray(params[p])){for(let index=0;index<params[p].length;index++){let param=params[p][index];str.push(encodeURIComponent(p+'[]')+"="+encodeURIComponent(param))}}else{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:1.0.29');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')}
|
||||
|
@ -165,4 +165,4 @@ if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
|||
if(secret===undefined){throw new Error('Missing required parameter: "secret"')}
|
||||
let path='/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(userId){payload.userId=userId}
|
||||
if(secret){payload.secret=secret}
|
||||
return http.patch(path,{'content-type':'application/json',},payload)}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,avatars:avatars,database:database,locale:locale,storage:storage,teams:teams}};if(typeof module!=="undefined"){module.exports=window.Appwrite}})((typeof window!=="undefined")?window:{})
|
||||
return http.patch(path,{'content-type':'application/json',},payload)}};return{setEndpoint:setEndpoint,setProject:setProject,setLocale:setLocale,account:account,avatars:avatars,database:database,locale:locale,storage:storage,teams:teams}};if(typeof module!=="undefined"){module.exports=window.Appwrite}})((typeof window!=="undefined")?window:{})
|
18
app/sdks/web-javascript/types/index.d.ts
vendored
18
app/sdks/web-javascript/types/index.d.ts
vendored
|
@ -27,16 +27,6 @@ declare class Appwrite {
|
|||
* @return this
|
||||
*/
|
||||
setProject(project: string): this;
|
||||
/**
|
||||
* Set Key
|
||||
*
|
||||
* Your secret API key
|
||||
*
|
||||
* @param value string
|
||||
*
|
||||
* @return this
|
||||
*/
|
||||
setKey(key: string): this;
|
||||
/**
|
||||
* Set Locale
|
||||
*
|
||||
|
@ -45,14 +35,6 @@ declare class Appwrite {
|
|||
* @return this
|
||||
*/
|
||||
setLocale(locale: string): this;
|
||||
/**
|
||||
* Set Mode
|
||||
*
|
||||
* @param value string
|
||||
*
|
||||
* @return this
|
||||
*/
|
||||
setMode(mode: string): this;
|
||||
|
||||
account:Appwrite.Account;
|
||||
avatars:Appwrite.Avatars;
|
||||
|
|
|
@ -105,8 +105,8 @@ $events = [
|
|||
<label data-ls-attrs="for=security-{{task.$id}}" class="margin-bottom-small">
|
||||
<div class="margin-bottom-small text-bold">SSL / TLS (Certificate verification)</div>
|
||||
|
||||
<input name="security" type="radio" required data-ls-attrs="id=secure-yes-{{webhook.$id}}" data-ls-bind="{{webhook.security}}" value="1" /> <span>Enabled</span>
|
||||
<input name="security" type="radio" required data-ls-attrs="id=secure-no-{{webhook.$id}}" data-ls-bind="{{webhook.security}}" value="0" /> <span>Disabled</span>
|
||||
<input name="security" type="radio" required data-ls-attrs="id=secure-yes-{{webhook.$id}}" data-ls-bind="{{webhook.security}}" value="1" /> <span>Enabled</span>
|
||||
<input name="security" type="radio" required data-ls-attrs="id=secure-no-{{webhook.$id}}" data-ls-bind="{{webhook.security}}" value="0" /> <span>Disabled</span>
|
||||
</label>
|
||||
|
||||
<p class="margin-bottom text-size-small text-fade"><span class="text-red">Warning</span>: Untrusted or self-signed certificates may not be secure.
|
||||
|
@ -219,8 +219,8 @@ $events = [
|
|||
<label data-ls-attrs="for=security-{{task.$id}}" class="margin-bottom-small">
|
||||
<div class="margin-bottom-small text-bold">SSL / TLS (Certificate verification)</div>
|
||||
|
||||
<input name="security" type="radio" required data-ls-attrs="id=secure-yes" checked="checked" value="1" /> <span>Enabled</span>
|
||||
<input name="security" type="radio" required data-ls-attrs="id=secure-no" value="0" /> <span>Disabled</span>
|
||||
<input name="security" type="radio" required data-ls-attrs="id=secure-yes" checked="checked" value="1" /> <span>Enabled</span>
|
||||
<input name="security" type="radio" required data-ls-attrs="id=secure-no" value="0" /> <span>Disabled</span>
|
||||
</label>
|
||||
|
||||
<p class="margin-bottom text-size-small text-fade"><span class="text-red">Warning</span>: Untrusted or self-signed certificates may not be secure.
|
||||
|
|
Loading…
Reference in a new issue