|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
(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]))}}
|
|
|
|
|
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.0');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:1.0.28');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)}
|
|
|
|
@ -50,9 +50,7 @@ if(failure===undefined){throw new Error('Missing required parameter: "failure"')
|
|
|
|
|
let path='/account/sessions/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload.success=success}
|
|
|
|
|
if(failure){payload.failure=failure}
|
|
|
|
|
return http.get(path,{'content-type':'application/json',},payload)},deleteSession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"')}
|
|
|
|
|
let path='/account/sessions/{id}'.replace(new RegExp('{id}','g'),id);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},createVerification:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')}
|
|
|
|
|
let path='/account/verification';let payload={};if(url){payload.url=url}
|
|
|
|
|
return http.post(path,{'content-type':'application/json',},payload)},updateVerification:function(userId,secret,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
|
|
|
|
let path='/account/sessions/{id}'.replace(new RegExp('{id}','g'),id);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},updateVerification:function(userId,secret,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
|
|
|
|
if(secret===undefined){throw new Error('Missing required parameter: "secret"')}
|
|
|
|
|
if(passwordB===undefined){throw new Error('Missing required parameter: "passwordB"')}
|
|
|
|
|
let path='/account/verification';let payload={};if(userId){payload.userId=userId}
|
|
|
|
@ -135,144 +133,7 @@ if(read){payload.read=read}
|
|
|
|
|
if(write){payload.write=write}
|
|
|
|
|
return http.patch(path,{'content-type':'application/json',},payload)},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')}
|
|
|
|
|
if(documentId===undefined){throw new Error('Missing required parameter: "documentId"')}
|
|
|
|
|
let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let projects={list:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload)},create:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
|
|
|
|
if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
|
|
|
|
let path='/projects';let payload={};if(name){payload.name=name}
|
|
|
|
|
if(teamId){payload.teamId=teamId}
|
|
|
|
|
if(description){payload.description=description}
|
|
|
|
|
if(logo){payload.logo=logo}
|
|
|
|
|
if(url){payload.url=url}
|
|
|
|
|
if(legalName){payload.legalName=legalName}
|
|
|
|
|
if(legalCountry){payload.legalCountry=legalCountry}
|
|
|
|
|
if(legalState){payload.legalState=legalState}
|
|
|
|
|
if(legalCity){payload.legalCity=legalCity}
|
|
|
|
|
if(legalAddress){payload.legalAddress=legalAddress}
|
|
|
|
|
if(legalTaxId){payload.legalTaxId=legalTaxId}
|
|
|
|
|
return http.post(path,{'content-type':'application/json',},payload)},get:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},update:function(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
|
|
|
|
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name}
|
|
|
|
|
if(description){payload.description=description}
|
|
|
|
|
if(logo){payload.logo=logo}
|
|
|
|
|
if(url){payload.url=url}
|
|
|
|
|
if(legalName){payload.legalName=legalName}
|
|
|
|
|
if(legalCountry){payload.legalCountry=legalCountry}
|
|
|
|
|
if(legalState){payload.legalState=legalState}
|
|
|
|
|
if(legalCity){payload.legalCity=legalCity}
|
|
|
|
|
if(legalAddress){payload.legalAddress=legalAddress}
|
|
|
|
|
if(legalTaxId){payload.legalTaxId=legalTaxId}
|
|
|
|
|
return http.patch(path,{'content-type':'application/json',},payload)},delete:function(projectId,password){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(password===undefined){throw new Error('Missing required parameter: "password"')}
|
|
|
|
|
let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(password){payload.password=password}
|
|
|
|
|
return http.delete(path,{'content-type':'application/json',},payload)},listKeys:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createKey:function(projectId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
|
|
|
|
if(scopes===undefined){throw new Error('Missing required parameter: "scopes"')}
|
|
|
|
|
let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name}
|
|
|
|
|
if(scopes){payload.scopes=scopes}
|
|
|
|
|
return http.post(path,{'content-type':'application/json',},payload)},getKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(keyId===undefined){throw new Error('Missing required parameter: "keyId"')}
|
|
|
|
|
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateKey:function(projectId,keyId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(keyId===undefined){throw new Error('Missing required parameter: "keyId"')}
|
|
|
|
|
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
|
|
|
|
if(scopes===undefined){throw new Error('Missing required parameter: "scopes"')}
|
|
|
|
|
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};if(name){payload.name=name}
|
|
|
|
|
if(scopes){payload.scopes=scopes}
|
|
|
|
|
return http.put(path,{'content-type':'application/json',},payload)},deleteKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(keyId===undefined){throw new Error('Missing required parameter: "keyId"')}
|
|
|
|
|
let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},updateOAuth:function(projectId,provider,appId='',secret=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(provider===undefined){throw new Error('Missing required parameter: "provider"')}
|
|
|
|
|
let path='/projects/{projectId}/oauth'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(provider){payload.provider=provider}
|
|
|
|
|
if(appId){payload.appId=appId}
|
|
|
|
|
if(secret){payload.secret=secret}
|
|
|
|
|
return http.patch(path,{'content-type':'application/json',},payload)},listPlatforms:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createPlatform:function(projectId,type,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(type===undefined){throw new Error('Missing required parameter: "type"')}
|
|
|
|
|
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
|
|
|
|
let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(type){payload.type=type}
|
|
|
|
|
if(name){payload.name=name}
|
|
|
|
|
if(key){payload.key=key}
|
|
|
|
|
if(store){payload.store=store}
|
|
|
|
|
if(url){payload.url=url}
|
|
|
|
|
return http.post(path,{'content-type':'application/json',},payload)},getPlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(platformId===undefined){throw new Error('Missing required parameter: "platformId"')}
|
|
|
|
|
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updatePlatform:function(projectId,platformId,name,key='',store='',url=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(platformId===undefined){throw new Error('Missing required parameter: "platformId"')}
|
|
|
|
|
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
|
|
|
|
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};if(name){payload.name=name}
|
|
|
|
|
if(key){payload.key=key}
|
|
|
|
|
if(store){payload.store=store}
|
|
|
|
|
if(url){payload.url=url}
|
|
|
|
|
return http.put(path,{'content-type':'application/json',},payload)},deletePlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(platformId===undefined){throw new Error('Missing required parameter: "platformId"')}
|
|
|
|
|
let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},listTasks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createTask:function(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
|
|
|
|
if(status===undefined){throw new Error('Missing required parameter: "status"')}
|
|
|
|
|
if(schedule===undefined){throw new Error('Missing required parameter: "schedule"')}
|
|
|
|
|
if(security===undefined){throw new Error('Missing required parameter: "security"')}
|
|
|
|
|
if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"')}
|
|
|
|
|
if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"')}
|
|
|
|
|
let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name}
|
|
|
|
|
if(status){payload.status=status}
|
|
|
|
|
if(schedule){payload.schedule=schedule}
|
|
|
|
|
if(security){payload.security=security}
|
|
|
|
|
if(httpMethod){payload.httpMethod=httpMethod}
|
|
|
|
|
if(httpUrl){payload.httpUrl=httpUrl}
|
|
|
|
|
if(httpHeaders){payload.httpHeaders=httpHeaders}
|
|
|
|
|
if(httpUser){payload.httpUser=httpUser}
|
|
|
|
|
if(httpPass){payload.httpPass=httpPass}
|
|
|
|
|
return http.post(path,{'content-type':'application/json',},payload)},getTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"')}
|
|
|
|
|
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateTask:function(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"')}
|
|
|
|
|
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
|
|
|
|
if(status===undefined){throw new Error('Missing required parameter: "status"')}
|
|
|
|
|
if(schedule===undefined){throw new Error('Missing required parameter: "schedule"')}
|
|
|
|
|
if(security===undefined){throw new Error('Missing required parameter: "security"')}
|
|
|
|
|
if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"')}
|
|
|
|
|
if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"')}
|
|
|
|
|
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};if(name){payload.name=name}
|
|
|
|
|
if(status){payload.status=status}
|
|
|
|
|
if(schedule){payload.schedule=schedule}
|
|
|
|
|
if(security){payload.security=security}
|
|
|
|
|
if(httpMethod){payload.httpMethod=httpMethod}
|
|
|
|
|
if(httpUrl){payload.httpUrl=httpUrl}
|
|
|
|
|
if(httpHeaders){payload.httpHeaders=httpHeaders}
|
|
|
|
|
if(httpUser){payload.httpUser=httpUser}
|
|
|
|
|
if(httpPass){payload.httpPass=httpPass}
|
|
|
|
|
return http.put(path,{'content-type':'application/json',},payload)},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"')}
|
|
|
|
|
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getUsage:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
|
|
|
|
if(events===undefined){throw new Error('Missing required parameter: "events"')}
|
|
|
|
|
if(url===undefined){throw new Error('Missing required parameter: "url"')}
|
|
|
|
|
if(security===undefined){throw new Error('Missing required parameter: "security"')}
|
|
|
|
|
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload.name=name}
|
|
|
|
|
if(events){payload.events=events}
|
|
|
|
|
if(url){payload.url=url}
|
|
|
|
|
if(security){payload.security=security}
|
|
|
|
|
if(httpUser){payload.httpUser=httpUser}
|
|
|
|
|
if(httpPass){payload.httpPass=httpPass}
|
|
|
|
|
return http.post(path,{'content-type':'application/json',},payload)},getWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"')}
|
|
|
|
|
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateWebhook:function(projectId,webhookId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"')}
|
|
|
|
|
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
|
|
|
|
if(events===undefined){throw new Error('Missing required parameter: "events"')}
|
|
|
|
|
if(url===undefined){throw new Error('Missing required parameter: "url"')}
|
|
|
|
|
if(security===undefined){throw new Error('Missing required parameter: "security"')}
|
|
|
|
|
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};if(name){payload.name=name}
|
|
|
|
|
if(events){payload.events=events}
|
|
|
|
|
if(url){payload.url=url}
|
|
|
|
|
if(security){payload.security=security}
|
|
|
|
|
if(httpUser){payload.httpUser=httpUser}
|
|
|
|
|
if(httpPass){payload.httpPass=httpPass}
|
|
|
|
|
return http.put(path,{'content-type':'application/json',},payload)},deleteWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"')}
|
|
|
|
|
if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"')}
|
|
|
|
|
let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';let payload={};if(search){payload.search=search}
|
|
|
|
|
let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';let payload={};if(search){payload.search=search}
|
|
|
|
|
if(limit){payload.limit=limit}
|
|
|
|
|
if(offset){payload.offset=offset}
|
|
|
|
|
if(orderType){payload.orderType=orderType}
|
|
|
|
@ -327,27 +188,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)}};let users={list:function(search='',limit=25,offset=0,orderType='ASC'){let path='/users';let payload={};if(search){payload.search=search}
|
|
|
|
|
if(limit){payload.limit=limit}
|
|
|
|
|
if(offset){payload.offset=offset}
|
|
|
|
|
if(orderType){payload.orderType=orderType}
|
|
|
|
|
return http.get(path,{'content-type':'application/json',},payload)},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
|
|
|
|
if(password===undefined){throw new Error('Missing required parameter: "password"')}
|
|
|
|
|
let path='/users';let payload={};if(email){payload.email=email}
|
|
|
|
|
if(password){payload.password=password}
|
|
|
|
|
if(name){payload.name=name}
|
|
|
|
|
return http.post(path,{'content-type':'application/json',},payload)},get:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
|
|
|
|
let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},getLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
|
|
|
|
let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},getPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
|
|
|
|
let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updatePrefs:function(userId,prefs){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
|
|
|
|
if(prefs===undefined){throw new Error('Missing required parameter: "prefs"')}
|
|
|
|
|
let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};if(prefs){payload.prefs=prefs}
|
|
|
|
|
return http.patch(path,{'content-type':'application/json',},payload)},getSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
|
|
|
|
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},deleteSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
|
|
|
|
let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},deleteSession:function(userId,sessionId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
|
|
|
|
if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"')}
|
|
|
|
|
let path='/users/{userId}/sessions/:session'.replace(new RegExp('{userId}','g'),userId);let payload={};if(sessionId){payload.sessionId=sessionId}
|
|
|
|
|
return http.delete(path,{'content-type':'application/json',},payload)},updateStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
|
|
|
|
if(status===undefined){throw new Error('Missing required parameter: "status"')}
|
|
|
|
|
let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);let payload={};if(status){payload.status=status}
|
|
|
|
|
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,projects:projects,storage:storage,teams:teams,users:users}};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,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:{})
|