Merge branch 'master' into feat-password-hash-algos

This commit is contained in:
Matej Bačo
2022-07-25 12:37:07 +00:00
908 changed files with 12166 additions and 5800 deletions
+106 -57
View File
File diff suppressed because one or more lines are too long
+95 -47
View File
@@ -5,7 +5,7 @@ function rejected(value){try{step(generator["throw"](value));}catch(e){reject(e)
function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected);}
step((generator=generator.apply(thisArg,_arguments||[])).next());});}
class AppwriteException extends Error{constructor(message,code=0,type='',response=''){super(message);this.name='AppwriteException';this.message=message;this.code=code;this.type=type;this.response=response;}}
class Appwrite{constructor(){this.config={endpoint:'https://HOSTNAME/v1',endpointRealtime:'',project:'',key:'',jwt:'',locale:'',mode:'',};this.headers={'x-sdk-version':'appwrite:web:5.0.0','X-Appwrite-Response-Format':'0.14.0',};this.realtime={socket:undefined,timeout:undefined,url:'',channels:new Set(),subscriptions:new Map(),subscriptionsCounter:0,reconnect:true,reconnectAttempts:0,lastMessage:undefined,connect:()=>{clearTimeout(this.realtime.timeout);this.realtime.timeout=window===null||window===void 0?void 0:window.setTimeout(()=>{this.realtime.createSocket();},50);},getTimeout:()=>{switch(true){case this.realtime.reconnectAttempts<5:return 1000;case this.realtime.reconnectAttempts<15:return 5000;case this.realtime.reconnectAttempts<100:return 10000;default:return 60000;}},createSocket:()=>{var _a,_b;if(this.realtime.channels.size<1)
class Appwrite{constructor(){this.config={endpoint:'https://HOSTNAME/v1',endpointRealtime:'',project:'',key:'',jwt:'',locale:'',mode:'',};this.headers={'x-sdk-version':'appwrite:web:5.0.0','X-Appwrite-Response-Format':'0.15.0',};this.realtime={socket:undefined,timeout:undefined,url:'',channels:new Set(),subscriptions:new Map(),subscriptionsCounter:0,reconnect:true,reconnectAttempts:0,lastMessage:undefined,connect:()=>{clearTimeout(this.realtime.timeout);this.realtime.timeout=window===null||window===void 0?void 0:window.setTimeout(()=>{this.realtime.createSocket();},50);},getTimeout:()=>{switch(true){case this.realtime.reconnectAttempts<5:return 1000;case this.realtime.reconnectAttempts<15:return 5000;case this.realtime.reconnectAttempts<100:return 10000;default:return 60000;}},createSocket:()=>{var _a,_b;if(this.realtime.channels.size<1)
return;const channels=new URLSearchParams();channels.set('project',this.config.project);this.realtime.channels.forEach(channel=>{channels.append('channels[]',channel);});const url=this.config.endpointRealtime+'/realtime?'+channels.toString();if(url!==this.realtime.url||!this.realtime.socket||((_a=this.realtime.socket)===null||_a===void 0?void 0:_a.readyState)>WebSocket.OPEN){if(this.realtime.socket&&((_b=this.realtime.socket)===null||_b===void 0?void 0:_b.readyState)<WebSocket.CLOSING){this.realtime.reconnect=false;this.realtime.socket.close();}
this.realtime.url=url;this.realtime.socket=new WebSocket(url);this.realtime.socket.addEventListener('message',this.realtime.onMessage);this.realtime.socket.addEventListener('open',_event=>{this.realtime.reconnectAttempts=0;});this.realtime.socket.addEventListener('close',event=>{var _a,_b,_c;if(!this.realtime.reconnect||(((_b=(_a=this.realtime)===null||_a===void 0?void 0:_a.lastMessage)===null||_b===void 0?void 0:_b.type)==='error'&&((_c=this.realtime)===null||_c===void 0?void 0:_c.lastMessage.data).code===1008)){this.realtime.reconnect=true;return;}
const timeout=this.realtime.getTimeout();console.error(`Realtime got disconnected. Reconnect will be attempted in ${timeout / 1000} seconds.`,event.reason);setTimeout(()=>{this.realtime.reconnectAttempts++;this.realtime.createSocket();},timeout);});}},onMessage:(event)=>{var _a,_b;try{const message=JSON.parse(event.data);this.realtime.lastMessage=message;switch(message.type){case'connected':const cookie=JSON.parse((_a=window.localStorage.getItem('cookieFallback'))!==null&&_a!==void 0?_a:'{}');const session=cookie===null||cookie===void 0?void 0:cookie[`a_session_${this.config.project}`];const messageData=message.data;if(session&&!messageData.user){(_b=this.realtime.socket)===null||_b===void 0?void 0:_b.send(JSON.stringify({type:'authentication',data:{session}}));}
@@ -123,149 +123,197 @@ if(typeof size!=='undefined'){payload['size']=size;}
if(typeof margin!=='undefined'){payload['margin']=margin;}
if(typeof download!=='undefined'){payload['download']=download;}
const uri=new URL(this.config.endpoint+path);payload['project']=this.config.project;for(const[key,value]of Object.entries(this.flatten(payload))){uri.searchParams.append(key,value);}
return uri;}};this.database={listCollections:(search,limit,offset,cursor,cursorDirection,orderType)=>__awaiter(this,void 0,void 0,function*(){let path='/database/collections';let payload={};if(typeof search!=='undefined'){payload['search']=search;}
return uri;}};this.databases={list:(search,limit,offset,cursor,cursorDirection,orderType)=>__awaiter(this,void 0,void 0,function*(){let path='/databases';let payload={};if(typeof search!=='undefined'){payload['search']=search;}
if(typeof limit!=='undefined'){payload['limit']=limit;}
if(typeof offset!=='undefined'){payload['offset']=offset;}
if(typeof cursor!=='undefined'){payload['cursor']=cursor;}
if(typeof cursorDirection!=='undefined'){payload['cursorDirection']=cursorDirection;}
if(typeof orderType!=='undefined'){payload['orderType']=orderType;}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createCollection:(collectionId,name,permission,read,write)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),create:(databaseId,name)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof name==='undefined'){throw new AppwriteException('Missing required parameter: "name"');}
let path='/databases';let payload={};if(typeof databaseId!=='undefined'){payload['databaseId']=databaseId;}
if(typeof name!=='undefined'){payload['name']=name;}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getUsage:(range)=>__awaiter(this,void 0,void 0,function*(){let path='/databases/usage';let payload={};if(typeof range!=='undefined'){payload['range']=range;}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),get:(databaseId)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
let path='/databases/{databaseId}'.replace('{databaseId}',databaseId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),update:(databaseId,name)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof name==='undefined'){throw new AppwriteException('Missing required parameter: "name"');}
let path='/databases/{databaseId}'.replace('{databaseId}',databaseId);let payload={};if(typeof name!=='undefined'){payload['name']=name;}
const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),delete:(databaseId)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
let path='/databases/{databaseId}'.replace('{databaseId}',databaseId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listCollections:(databaseId,search,limit,offset,cursor,cursorDirection,orderType)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
let path='/databases/{databaseId}/collections'.replace('{databaseId}',databaseId);let payload={};if(typeof search!=='undefined'){payload['search']=search;}
if(typeof limit!=='undefined'){payload['limit']=limit;}
if(typeof offset!=='undefined'){payload['offset']=offset;}
if(typeof cursor!=='undefined'){payload['cursor']=cursor;}
if(typeof cursorDirection!=='undefined'){payload['cursorDirection']=cursorDirection;}
if(typeof orderType!=='undefined'){payload['orderType']=orderType;}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createCollection:(databaseId,collectionId,name,permission,read,write)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof name==='undefined'){throw new AppwriteException('Missing required parameter: "name"');}
if(typeof permission==='undefined'){throw new AppwriteException('Missing required parameter: "permission"');}
if(typeof read==='undefined'){throw new AppwriteException('Missing required parameter: "read"');}
if(typeof write==='undefined'){throw new AppwriteException('Missing required parameter: "write"');}
let path='/database/collections';let payload={};if(typeof collectionId!=='undefined'){payload['collectionId']=collectionId;}
let path='/databases/{databaseId}/collections'.replace('{databaseId}',databaseId);let payload={};if(typeof collectionId!=='undefined'){payload['collectionId']=collectionId;}
if(typeof name!=='undefined'){payload['name']=name;}
if(typeof permission!=='undefined'){payload['permission']=permission;}
if(typeof read!=='undefined'){payload['read']=read;}
if(typeof write!=='undefined'){payload['write']=write;}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getCollection:(collectionId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/database/collections/{collectionId}'.replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateCollection:(collectionId,name,permission,read,write,enabled)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getCollection:(databaseId,collectionId)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateCollection:(databaseId,collectionId,name,permission,read,write,enabled)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof name==='undefined'){throw new AppwriteException('Missing required parameter: "name"');}
if(typeof permission==='undefined'){throw new AppwriteException('Missing required parameter: "permission"');}
let path='/database/collections/{collectionId}'.replace('{collectionId}',collectionId);let payload={};if(typeof name!=='undefined'){payload['name']=name;}
let path='/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof name!=='undefined'){payload['name']=name;}
if(typeof permission!=='undefined'){payload['permission']=permission;}
if(typeof read!=='undefined'){payload['read']=read;}
if(typeof write!=='undefined'){payload['write']=write;}
if(typeof enabled!=='undefined'){payload['enabled']=enabled;}
const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deleteCollection:(collectionId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/database/collections/{collectionId}'.replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listAttributes:(collectionId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/database/collections/{collectionId}/attributes'.replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createBooleanAttribute:(collectionId,key,required,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deleteCollection:(databaseId,collectionId)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listAttributes:(databaseId,collectionId)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/databases/{databaseId}/collections/{collectionId}/attributes'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createBooleanAttribute:(databaseId,collectionId,key,required,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof key==='undefined'){throw new AppwriteException('Missing required parameter: "key"');}
if(typeof required==='undefined'){throw new AppwriteException('Missing required parameter: "required"');}
let path='/database/collections/{collectionId}/attributes/boolean'.replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
let path='/databases/{databaseId}/collections/{collectionId}/attributes/boolean'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
if(typeof required!=='undefined'){payload['required']=required;}
if(typeof xdefault!=='undefined'){payload['default']=xdefault;}
if(typeof array!=='undefined'){payload['array']=array;}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createEmailAttribute:(collectionId,key,required,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createEmailAttribute:(databaseId,collectionId,key,required,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof key==='undefined'){throw new AppwriteException('Missing required parameter: "key"');}
if(typeof required==='undefined'){throw new AppwriteException('Missing required parameter: "required"');}
let path='/database/collections/{collectionId}/attributes/email'.replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
let path='/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
if(typeof required!=='undefined'){payload['required']=required;}
if(typeof xdefault!=='undefined'){payload['default']=xdefault;}
if(typeof array!=='undefined'){payload['array']=array;}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createEnumAttribute:(collectionId,key,elements,required,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createEnumAttribute:(databaseId,collectionId,key,elements,required,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof key==='undefined'){throw new AppwriteException('Missing required parameter: "key"');}
if(typeof elements==='undefined'){throw new AppwriteException('Missing required parameter: "elements"');}
if(typeof required==='undefined'){throw new AppwriteException('Missing required parameter: "required"');}
let path='/database/collections/{collectionId}/attributes/enum'.replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
let path='/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
if(typeof elements!=='undefined'){payload['elements']=elements;}
if(typeof required!=='undefined'){payload['required']=required;}
if(typeof xdefault!=='undefined'){payload['default']=xdefault;}
if(typeof array!=='undefined'){payload['array']=array;}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createFloatAttribute:(collectionId,key,required,min,max,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createFloatAttribute:(databaseId,collectionId,key,required,min,max,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof key==='undefined'){throw new AppwriteException('Missing required parameter: "key"');}
if(typeof required==='undefined'){throw new AppwriteException('Missing required parameter: "required"');}
let path='/database/collections/{collectionId}/attributes/float'.replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
let path='/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
if(typeof required!=='undefined'){payload['required']=required;}
if(typeof min!=='undefined'){payload['min']=min;}
if(typeof max!=='undefined'){payload['max']=max;}
if(typeof xdefault!=='undefined'){payload['default']=xdefault;}
if(typeof array!=='undefined'){payload['array']=array;}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createIntegerAttribute:(collectionId,key,required,min,max,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createIntegerAttribute:(databaseId,collectionId,key,required,min,max,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof key==='undefined'){throw new AppwriteException('Missing required parameter: "key"');}
if(typeof required==='undefined'){throw new AppwriteException('Missing required parameter: "required"');}
let path='/database/collections/{collectionId}/attributes/integer'.replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
let path='/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
if(typeof required!=='undefined'){payload['required']=required;}
if(typeof min!=='undefined'){payload['min']=min;}
if(typeof max!=='undefined'){payload['max']=max;}
if(typeof xdefault!=='undefined'){payload['default']=xdefault;}
if(typeof array!=='undefined'){payload['array']=array;}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createIpAttribute:(collectionId,key,required,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createIpAttribute:(databaseId,collectionId,key,required,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof key==='undefined'){throw new AppwriteException('Missing required parameter: "key"');}
if(typeof required==='undefined'){throw new AppwriteException('Missing required parameter: "required"');}
let path='/database/collections/{collectionId}/attributes/ip'.replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
let path='/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
if(typeof required!=='undefined'){payload['required']=required;}
if(typeof xdefault!=='undefined'){payload['default']=xdefault;}
if(typeof array!=='undefined'){payload['array']=array;}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createStringAttribute:(collectionId,key,size,required,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createStringAttribute:(databaseId,collectionId,key,size,required,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof key==='undefined'){throw new AppwriteException('Missing required parameter: "key"');}
if(typeof size==='undefined'){throw new AppwriteException('Missing required parameter: "size"');}
if(typeof required==='undefined'){throw new AppwriteException('Missing required parameter: "required"');}
let path='/database/collections/{collectionId}/attributes/string'.replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
let path='/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
if(typeof size!=='undefined'){payload['size']=size;}
if(typeof required!=='undefined'){payload['required']=required;}
if(typeof xdefault!=='undefined'){payload['default']=xdefault;}
if(typeof array!=='undefined'){payload['array']=array;}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createUrlAttribute:(collectionId,key,required,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createUrlAttribute:(databaseId,collectionId,key,required,xdefault,array)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof key==='undefined'){throw new AppwriteException('Missing required parameter: "key"');}
if(typeof required==='undefined'){throw new AppwriteException('Missing required parameter: "required"');}
let path='/database/collections/{collectionId}/attributes/url'.replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
let path='/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
if(typeof required!=='undefined'){payload['required']=required;}
if(typeof xdefault!=='undefined'){payload['default']=xdefault;}
if(typeof array!=='undefined'){payload['array']=array;}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getAttribute:(collectionId,key)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getAttribute:(databaseId,collectionId,key)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof key==='undefined'){throw new AppwriteException('Missing required parameter: "key"');}
let path='/database/collections/{collectionId}/attributes/{key}'.replace('{collectionId}',collectionId).replace('{key}',key);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),deleteAttribute:(collectionId,key)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId).replace('{key}',key);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),deleteAttribute:(databaseId,collectionId,key)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof key==='undefined'){throw new AppwriteException('Missing required parameter: "key"');}
let path='/database/collections/{collectionId}/attributes/{key}'.replace('{collectionId}',collectionId).replace('{key}',key);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listDocuments:(collectionId,queries,limit,offset,cursor,cursorDirection,orderAttributes,orderTypes)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/database/collections/{collectionId}/documents'.replace('{collectionId}',collectionId);let payload={};if(typeof queries!=='undefined'){payload['queries']=queries;}
let path='/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId).replace('{key}',key);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listDocuments:(databaseId,collectionId,queries,limit,offset,cursor,cursorDirection,orderAttributes,orderTypes)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof queries!=='undefined'){payload['queries']=queries;}
if(typeof limit!=='undefined'){payload['limit']=limit;}
if(typeof offset!=='undefined'){payload['offset']=offset;}
if(typeof cursor!=='undefined'){payload['cursor']=cursor;}
if(typeof cursorDirection!=='undefined'){payload['cursorDirection']=cursorDirection;}
if(typeof orderAttributes!=='undefined'){payload['orderAttributes']=orderAttributes;}
if(typeof orderTypes!=='undefined'){payload['orderTypes']=orderTypes;}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createDocument:(collectionId,documentId,data,read,write)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createDocument:(databaseId,collectionId,documentId,data,read,write)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof documentId==='undefined'){throw new AppwriteException('Missing required parameter: "documentId"');}
if(typeof data==='undefined'){throw new AppwriteException('Missing required parameter: "data"');}
let path='/database/collections/{collectionId}/documents'.replace('{collectionId}',collectionId);let payload={};if(typeof documentId!=='undefined'){payload['documentId']=documentId;}
let path='/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof documentId!=='undefined'){payload['documentId']=documentId;}
if(typeof data!=='undefined'){payload['data']=data;}
if(typeof read!=='undefined'){payload['read']=read;}
if(typeof write!=='undefined'){payload['write']=write;}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getDocument:(collectionId,documentId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getDocument:(databaseId,collectionId,documentId)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof documentId==='undefined'){throw new AppwriteException('Missing required parameter: "documentId"');}
let path='/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateDocument:(collectionId,documentId,data,read,write)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateDocument:(databaseId,collectionId,documentId,data,read,write)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof documentId==='undefined'){throw new AppwriteException('Missing required parameter: "documentId"');}
if(typeof data==='undefined'){throw new AppwriteException('Missing required parameter: "data"');}
let path='/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};if(typeof data!=='undefined'){payload['data']=data;}
let path='/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};if(typeof data!=='undefined'){payload['data']=data;}
if(typeof read!=='undefined'){payload['read']=read;}
if(typeof write!=='undefined'){payload['write']=write;}
const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),deleteDocument:(collectionId,documentId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),deleteDocument:(databaseId,collectionId,documentId)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof documentId==='undefined'){throw new AppwriteException('Missing required parameter: "documentId"');}
let path='/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listDocumentLogs:(collectionId,documentId,limit,offset)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listDocumentLogs:(databaseId,collectionId,documentId,limit,offset)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof documentId==='undefined'){throw new AppwriteException('Missing required parameter: "documentId"');}
let path='/database/collections/{collectionId}/documents/{documentId}/logs'.replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};if(typeof limit!=='undefined'){payload['limit']=limit;}
let path='/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};if(typeof limit!=='undefined'){payload['limit']=limit;}
if(typeof offset!=='undefined'){payload['offset']=offset;}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),listIndexes:(collectionId)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/database/collections/{collectionId}/indexes'.replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createIndex:(collectionId,key,type,attributes,orders)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),listIndexes:(databaseId,collectionId)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createIndex:(databaseId,collectionId,key,type,attributes,orders)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof key==='undefined'){throw new AppwriteException('Missing required parameter: "key"');}
if(typeof type==='undefined'){throw new AppwriteException('Missing required parameter: "type"');}
if(typeof attributes==='undefined'){throw new AppwriteException('Missing required parameter: "attributes"');}
let path='/database/collections/{collectionId}/indexes'.replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
let path='/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof key!=='undefined'){payload['key']=key;}
if(typeof type!=='undefined'){payload['type']=type;}
if(typeof attributes!=='undefined'){payload['attributes']=attributes;}
if(typeof orders!=='undefined'){payload['orders']=orders;}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getIndex:(collectionId,key)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getIndex:(databaseId,collectionId,key)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof key==='undefined'){throw new AppwriteException('Missing required parameter: "key"');}
let path='/database/collections/{collectionId}/indexes/{key}'.replace('{collectionId}',collectionId).replace('{key}',key);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),deleteIndex:(collectionId,key)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId).replace('{key}',key);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),deleteIndex:(databaseId,collectionId,key)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
if(typeof key==='undefined'){throw new AppwriteException('Missing required parameter: "key"');}
let path='/database/collections/{collectionId}/indexes/{key}'.replace('{collectionId}',collectionId).replace('{key}',key);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listCollectionLogs:(collectionId,limit,offset)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/database/collections/{collectionId}/logs'.replace('{collectionId}',collectionId);let payload={};if(typeof limit!=='undefined'){payload['limit']=limit;}
let path='/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId).replace('{key}',key);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listCollectionLogs:(databaseId,collectionId,limit,offset)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/databases/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof limit!=='undefined'){payload['limit']=limit;}
if(typeof offset!=='undefined'){payload['offset']=offset;}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getUsage:(range)=>__awaiter(this,void 0,void 0,function*(){let path='/database/usage';let payload={};if(typeof range!=='undefined'){payload['range']=range;}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getCollectionUsage:(collectionId,range)=>__awaiter(this,void 0,void 0,function*(){if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/database/{collectionId}/usage'.replace('{collectionId}',collectionId);let payload={};if(typeof range!=='undefined'){payload['range']=range;}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getCollectionUsage:(databaseId,collectionId,range)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
if(typeof collectionId==='undefined'){throw new AppwriteException('Missing required parameter: "collectionId"');}
let path='/databases/{databaseId}/collections/{collectionId}/usage'.replace('{databaseId}',databaseId).replace('{collectionId}',collectionId);let payload={};if(typeof range!=='undefined'){payload['range']=range;}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),listLogs:(databaseId,limit,offset)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
let path='/databases/{databaseId}/logs'.replace('{databaseId}',databaseId);let payload={};if(typeof limit!=='undefined'){payload['limit']=limit;}
if(typeof offset!=='undefined'){payload['offset']=offset;}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getDatabaseUsage:(databaseId,range)=>__awaiter(this,void 0,void 0,function*(){if(typeof databaseId==='undefined'){throw new AppwriteException('Missing required parameter: "databaseId"');}
let path='/databases/{databaseId}/usage'.replace('{databaseId}',databaseId);let payload={};if(typeof range!=='undefined'){payload['range']=range;}
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);})};this.functions={list:(search,limit,offset,cursor,cursorDirection,orderType)=>__awaiter(this,void 0,void 0,function*(){let path='/functions';let payload={};if(typeof search!=='undefined'){payload['search']=search;}
if(typeof limit!=='undefined'){payload['limit']=limit;}
if(typeof offset!=='undefined'){payload['offset']=offset;}
+11 -10
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+27
View File
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="65.2 173.5 180 180" style="enable-background:new 65.2 173.5 180 180;" xml:space="preserve">
<style type="text/css">
.st0{fill:#0080FF;}
</style>
<g id="XMLID_229_">
<g id="XMLID_690_">
<g id="XMLID_691_">
<g>
<g id="XMLID_44_">
<g id="XMLID_48_">
<path id="XMLID_49_" class="st0" d="M155.2,351.7v-34.2c36.2,0,64.3-35.9,50.4-74c-5.1-14.1-16.4-25.4-30.5-30.5
c-38.1-13.8-74,14.2-74,50.4l0,0H67c0-57.7,55.8-102.7,116.3-83.8c26.4,8.3,47.5,29.3,55.7,55.7
C257.9,295.9,213,351.7,155.2,351.7z"/>
</g>
<polygon id="XMLID_47_" class="st0" points="155.3,317.6 121.3,317.6 121.3,283.6 121.3,283.6 155.3,283.6 155.3,283.6
"/>
<polygon id="XMLID_46_" class="st0" points="121.3,343.8 95.1,343.8 95.1,343.8 95.1,317.6 121.3,317.6 "/>
<path id="XMLID_45_" class="st0" d="M95.1,317.6H73.2l0,0v-21.9l0,0h21.9l0,0V317.6z"/>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,9 @@
<svg viewBox="0 0 189 208" width="90" height="100" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M112.287 10.3584C117.9 20.2129 114.487 32.7666 104.664 38.3978L43.5862 73.41C41.9693 74.3369 40.972 76.0577 40.972 77.9209V132.899C40.972 134.763 41.9693 136.483 43.5862 137.41L91.9123 165.113C93.515 166.032 95.485 166.032 97.0877 165.113L145.414 137.41C147.031 136.483 148.028 134.763 148.028 132.899V98.7091L104.567 123.309C94.7131 128.886 82.2179 125.394 76.6581 115.509C71.0983 105.624 74.5793 93.0891 84.4331 87.5117L146.62 52.3128C165.563 41.591 189 55.321 189 77.1398V137.066C189 151.102 181.503 164.062 169.355 171.026L113.844 202.847C101.858 209.718 87.1424 209.718 75.1558 202.847L19.6453 171.026C7.49714 164.062 0 151.102 0 137.066V73.7544C0 59.7184 7.49714 46.7585 19.6453 39.7947L84.3361 2.71125C94.1595 -2.91993 106.673 0.503802 112.287 10.3584Z" fill="url(#paint0_linear)"/>
<defs>
<linearGradient id="paint0_linear" x1="142.253" y1="31.4537" x2="44.8052" y2="184.17" gradientUnits="userSpaceOnUse">
<stop stop-color="#FFB45B"/>
<stop offset="1" stop-color="#FF8A00"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

+379 -84
View File
@@ -1330,14 +1330,10 @@
return uri;
}
};
this.database = {
this.databases = {
/**
* List Collections
* List Databases
*
* Get a list of all the user collections. You can use the query params to
* filter your results. On admin mode, this endpoint will return a list of all
* of the project's collections. [Learn more about different API
* modes](/docs/admin).
*
* @param {string} search
* @param {number} limit
@@ -1348,8 +1344,167 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
listCollections: (search, limit, offset, cursor, cursorDirection, orderType) => __awaiter(this, void 0, void 0, function* () {
let path = '/database/collections';
list: (search, limit, offset, cursor, cursorDirection, orderType) => __awaiter(this, void 0, void 0, function* () {
let path = '/databases';
let payload = {};
if (typeof search !== 'undefined') {
payload['search'] = search;
}
if (typeof limit !== 'undefined') {
payload['limit'] = limit;
}
if (typeof offset !== 'undefined') {
payload['offset'] = offset;
}
if (typeof cursor !== 'undefined') {
payload['cursor'] = cursor;
}
if (typeof cursorDirection !== 'undefined') {
payload['cursorDirection'] = cursorDirection;
}
if (typeof orderType !== 'undefined') {
payload['orderType'] = orderType;
}
const uri = new URL(this.config.endpoint + path);
return yield this.call('get', uri, {
'content-type': 'application/json',
}, payload);
}),
/**
* Create Database
*
*
* @param {string} databaseId
* @param {string} name
* @throws {AppwriteException}
* @returns {Promise}
*/
create: (databaseId, name) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof name === 'undefined') {
throw new AppwriteException('Missing required parameter: "name"');
}
let path = '/databases';
let payload = {};
if (typeof databaseId !== 'undefined') {
payload['databaseId'] = databaseId;
}
if (typeof name !== 'undefined') {
payload['name'] = name;
}
const uri = new URL(this.config.endpoint + path);
return yield this.call('post', uri, {
'content-type': 'application/json',
}, payload);
}),
/**
* Get usage stats for the database
*
*
* @param {string} range
* @throws {AppwriteException}
* @returns {Promise}
*/
getUsage: (range) => __awaiter(this, void 0, void 0, function* () {
let path = '/databases/usage';
let payload = {};
if (typeof range !== 'undefined') {
payload['range'] = range;
}
const uri = new URL(this.config.endpoint + path);
return yield this.call('get', uri, {
'content-type': 'application/json',
}, payload);
}),
/**
* Get Database
*
*
* @param {string} databaseId
* @throws {AppwriteException}
* @returns {Promise}
*/
get: (databaseId) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
let path = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
let payload = {};
const uri = new URL(this.config.endpoint + path);
return yield this.call('get', uri, {
'content-type': 'application/json',
}, payload);
}),
/**
* Update Database
*
*
* @param {string} databaseId
* @param {string} name
* @throws {AppwriteException}
* @returns {Promise}
*/
update: (databaseId, name) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof name === 'undefined') {
throw new AppwriteException('Missing required parameter: "name"');
}
let path = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
let payload = {};
if (typeof name !== 'undefined') {
payload['name'] = name;
}
const uri = new URL(this.config.endpoint + path);
return yield this.call('put', uri, {
'content-type': 'application/json',
}, payload);
}),
/**
* Delete Database
*
*
* @param {string} databaseId
* @throws {AppwriteException}
* @returns {Promise}
*/
delete: (databaseId) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
let path = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
let payload = {};
const uri = new URL(this.config.endpoint + path);
return yield this.call('delete', uri, {
'content-type': 'application/json',
}, payload);
}),
/**
* List Collections
*
* Get a list of all the user collections. You can use the query params to
* filter your results. On admin mode, this endpoint will return a list of all
* of the project's collections. [Learn more about different API
* modes](/docs/admin).
*
* @param {string} databaseId
* @param {string} search
* @param {number} limit
* @param {number} offset
* @param {string} cursor
* @param {string} cursorDirection
* @param {string} orderType
* @throws {AppwriteException}
* @returns {Promise}
*/
listCollections: (databaseId, search, limit, offset, cursor, cursorDirection, orderType) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
let path = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
let payload = {};
if (typeof search !== 'undefined') {
payload['search'] = search;
@@ -1379,6 +1534,7 @@
*
* Create a new Collection.
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} name
* @param {string} permission
@@ -1387,7 +1543,10 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
createCollection: (collectionId, name, permission, read, write) => __awaiter(this, void 0, void 0, function* () {
createCollection: (databaseId, collectionId, name, permission, read, write) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
@@ -1403,7 +1562,7 @@
if (typeof write === 'undefined') {
throw new AppwriteException('Missing required parameter: "write"');
}
let path = '/database/collections';
let path = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
let payload = {};
if (typeof collectionId !== 'undefined') {
payload['collectionId'] = collectionId;
@@ -1431,15 +1590,19 @@
* Get a collection by its unique ID. This endpoint response returns a JSON
* object with the collection metadata.
*
* @param {string} databaseId
* @param {string} collectionId
* @throws {AppwriteException}
* @returns {Promise}
*/
getCollection: (collectionId) => __awaiter(this, void 0, void 0, function* () {
getCollection: (databaseId, collectionId) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
let path = '/database/collections/{collectionId}'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
const uri = new URL(this.config.endpoint + path);
return yield this.call('get', uri, {
@@ -1451,6 +1614,7 @@
*
* Update a collection by its unique ID.
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} name
* @param {string} permission
@@ -1460,7 +1624,10 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
updateCollection: (collectionId, name, permission, read, write, enabled) => __awaiter(this, void 0, void 0, function* () {
updateCollection: (databaseId, collectionId, name, permission, read, write, enabled) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
@@ -1470,7 +1637,7 @@
if (typeof permission === 'undefined') {
throw new AppwriteException('Missing required parameter: "permission"');
}
let path = '/database/collections/{collectionId}'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof name !== 'undefined') {
payload['name'] = name;
@@ -1498,15 +1665,19 @@
* Delete a collection by its unique ID. Only users with write permissions
* have access to delete this resource.
*
* @param {string} databaseId
* @param {string} collectionId
* @throws {AppwriteException}
* @returns {Promise}
*/
deleteCollection: (collectionId) => __awaiter(this, void 0, void 0, function* () {
deleteCollection: (databaseId, collectionId) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
let path = '/database/collections/{collectionId}'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
const uri = new URL(this.config.endpoint + path);
return yield this.call('delete', uri, {
@@ -1517,15 +1688,19 @@
* List Attributes
*
*
* @param {string} databaseId
* @param {string} collectionId
* @throws {AppwriteException}
* @returns {Promise}
*/
listAttributes: (collectionId) => __awaiter(this, void 0, void 0, function* () {
listAttributes: (databaseId, collectionId) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
let path = '/database/collections/{collectionId}/attributes'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/attributes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
const uri = new URL(this.config.endpoint + path);
return yield this.call('get', uri, {
@@ -1538,6 +1713,7 @@
* Create a boolean attribute.
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} key
* @param {boolean} required
@@ -1546,7 +1722,10 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
createBooleanAttribute: (collectionId, key, required, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
createBooleanAttribute: (databaseId, collectionId, key, required, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
@@ -1556,7 +1735,7 @@
if (typeof required === 'undefined') {
throw new AppwriteException('Missing required parameter: "required"');
}
let path = '/database/collections/{collectionId}/attributes/boolean'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof key !== 'undefined') {
payload['key'] = key;
@@ -1581,6 +1760,7 @@
* Create an email attribute.
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} key
* @param {boolean} required
@@ -1589,7 +1769,10 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
createEmailAttribute: (collectionId, key, required, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
createEmailAttribute: (databaseId, collectionId, key, required, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
@@ -1599,7 +1782,7 @@
if (typeof required === 'undefined') {
throw new AppwriteException('Missing required parameter: "required"');
}
let path = '/database/collections/{collectionId}/attributes/email'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof key !== 'undefined') {
payload['key'] = key;
@@ -1622,6 +1805,7 @@
* Create Enum Attribute
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} key
* @param {string[]} elements
@@ -1631,7 +1815,10 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
createEnumAttribute: (collectionId, key, elements, required, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
createEnumAttribute: (databaseId, collectionId, key, elements, required, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
@@ -1644,7 +1831,7 @@
if (typeof required === 'undefined') {
throw new AppwriteException('Missing required parameter: "required"');
}
let path = '/database/collections/{collectionId}/attributes/enum'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof key !== 'undefined') {
payload['key'] = key;
@@ -1673,6 +1860,7 @@
* provided.
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} key
* @param {boolean} required
@@ -1683,7 +1871,10 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
createFloatAttribute: (collectionId, key, required, min, max, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
createFloatAttribute: (databaseId, collectionId, key, required, min, max, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
@@ -1693,7 +1884,7 @@
if (typeof required === 'undefined') {
throw new AppwriteException('Missing required parameter: "required"');
}
let path = '/database/collections/{collectionId}/attributes/float'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof key !== 'undefined') {
payload['key'] = key;
@@ -1725,6 +1916,7 @@
* provided.
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} key
* @param {boolean} required
@@ -1735,7 +1927,10 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
createIntegerAttribute: (collectionId, key, required, min, max, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
createIntegerAttribute: (databaseId, collectionId, key, required, min, max, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
@@ -1745,7 +1940,7 @@
if (typeof required === 'undefined') {
throw new AppwriteException('Missing required parameter: "required"');
}
let path = '/database/collections/{collectionId}/attributes/integer'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof key !== 'undefined') {
payload['key'] = key;
@@ -1776,6 +1971,7 @@
* Create IP address attribute.
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} key
* @param {boolean} required
@@ -1784,7 +1980,10 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
createIpAttribute: (collectionId, key, required, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
createIpAttribute: (databaseId, collectionId, key, required, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
@@ -1794,7 +1993,7 @@
if (typeof required === 'undefined') {
throw new AppwriteException('Missing required parameter: "required"');
}
let path = '/database/collections/{collectionId}/attributes/ip'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof key !== 'undefined') {
payload['key'] = key;
@@ -1819,6 +2018,7 @@
* Create a string attribute.
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} key
* @param {number} size
@@ -1828,7 +2028,10 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
createStringAttribute: (collectionId, key, size, required, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
createStringAttribute: (databaseId, collectionId, key, size, required, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
@@ -1841,7 +2044,7 @@
if (typeof required === 'undefined') {
throw new AppwriteException('Missing required parameter: "required"');
}
let path = '/database/collections/{collectionId}/attributes/string'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof key !== 'undefined') {
payload['key'] = key;
@@ -1869,6 +2072,7 @@
* Create a URL attribute.
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} key
* @param {boolean} required
@@ -1877,7 +2081,10 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
createUrlAttribute: (collectionId, key, required, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
createUrlAttribute: (databaseId, collectionId, key, required, xdefault, array) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
@@ -1887,7 +2094,7 @@
if (typeof required === 'undefined') {
throw new AppwriteException('Missing required parameter: "required"');
}
let path = '/database/collections/{collectionId}/attributes/url'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof key !== 'undefined') {
payload['key'] = key;
@@ -1910,19 +2117,23 @@
* Get Attribute
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} key
* @throws {AppwriteException}
* @returns {Promise}
*/
getAttribute: (collectionId, key) => __awaiter(this, void 0, void 0, function* () {
getAttribute: (databaseId, collectionId, key) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
if (typeof key === 'undefined') {
throw new AppwriteException('Missing required parameter: "key"');
}
let path = '/database/collections/{collectionId}/attributes/{key}'.replace('{collectionId}', collectionId).replace('{key}', key);
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
let payload = {};
const uri = new URL(this.config.endpoint + path);
return yield this.call('get', uri, {
@@ -1933,19 +2144,23 @@
* Delete Attribute
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} key
* @throws {AppwriteException}
* @returns {Promise}
*/
deleteAttribute: (collectionId, key) => __awaiter(this, void 0, void 0, function* () {
deleteAttribute: (databaseId, collectionId, key) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
if (typeof key === 'undefined') {
throw new AppwriteException('Missing required parameter: "key"');
}
let path = '/database/collections/{collectionId}/attributes/{key}'.replace('{collectionId}', collectionId).replace('{key}', key);
let path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
let payload = {};
const uri = new URL(this.config.endpoint + path);
return yield this.call('delete', uri, {
@@ -1960,6 +2175,7 @@
* of the project's documents. [Learn more about different API
* modes](/docs/admin).
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string[]} queries
* @param {number} limit
@@ -1971,11 +2187,14 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
listDocuments: (collectionId, queries, limit, offset, cursor, cursorDirection, orderAttributes, orderTypes) => __awaiter(this, void 0, void 0, function* () {
listDocuments: (databaseId, collectionId, queries, limit, offset, cursor, cursorDirection, orderAttributes, orderTypes) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
let path = '/database/collections/{collectionId}/documents'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof queries !== 'undefined') {
payload['queries'] = queries;
@@ -2011,6 +2230,7 @@
* integration](/docs/server/database#databaseCreateCollection) API or
* directly from your database console.
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} documentId
* @param {object} data
@@ -2019,7 +2239,10 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
createDocument: (collectionId, documentId, data, read, write) => __awaiter(this, void 0, void 0, function* () {
createDocument: (databaseId, collectionId, documentId, data, read, write) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
@@ -2029,7 +2252,7 @@
if (typeof data === 'undefined') {
throw new AppwriteException('Missing required parameter: "data"');
}
let path = '/database/collections/{collectionId}/documents'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof documentId !== 'undefined') {
payload['documentId'] = documentId;
@@ -2054,19 +2277,23 @@
* Get a document by its unique ID. This endpoint response returns a JSON
* object with the document data.
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} documentId
* @throws {AppwriteException}
* @returns {Promise}
*/
getDocument: (collectionId, documentId) => __awaiter(this, void 0, void 0, function* () {
getDocument: (databaseId, collectionId, documentId) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
if (typeof documentId === 'undefined') {
throw new AppwriteException('Missing required parameter: "documentId"');
}
let path = '/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}', collectionId).replace('{documentId}', documentId);
let path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
let payload = {};
const uri = new URL(this.config.endpoint + path);
return yield this.call('get', uri, {
@@ -2079,6 +2306,7 @@
* Update a document by its unique ID. Using the patch method you can pass
* only specific fields that will get updated.
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} documentId
* @param {object} data
@@ -2087,7 +2315,10 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
updateDocument: (collectionId, documentId, data, read, write) => __awaiter(this, void 0, void 0, function* () {
updateDocument: (databaseId, collectionId, documentId, data, read, write) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
@@ -2097,7 +2328,7 @@
if (typeof data === 'undefined') {
throw new AppwriteException('Missing required parameter: "data"');
}
let path = '/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}', collectionId).replace('{documentId}', documentId);
let path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
let payload = {};
if (typeof data !== 'undefined') {
payload['data'] = data;
@@ -2118,19 +2349,23 @@
*
* Delete a document by its unique ID.
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} documentId
* @throws {AppwriteException}
* @returns {Promise}
*/
deleteDocument: (collectionId, documentId) => __awaiter(this, void 0, void 0, function* () {
deleteDocument: (databaseId, collectionId, documentId) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
if (typeof documentId === 'undefined') {
throw new AppwriteException('Missing required parameter: "documentId"');
}
let path = '/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}', collectionId).replace('{documentId}', documentId);
let path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
let payload = {};
const uri = new URL(this.config.endpoint + path);
return yield this.call('delete', uri, {
@@ -2142,6 +2377,7 @@
*
* Get the document activity logs list by its unique ID.
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} documentId
* @param {number} limit
@@ -2149,14 +2385,17 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
listDocumentLogs: (collectionId, documentId, limit, offset) => __awaiter(this, void 0, void 0, function* () {
listDocumentLogs: (databaseId, collectionId, documentId, limit, offset) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
if (typeof documentId === 'undefined') {
throw new AppwriteException('Missing required parameter: "documentId"');
}
let path = '/database/collections/{collectionId}/documents/{documentId}/logs'.replace('{collectionId}', collectionId).replace('{documentId}', documentId);
let path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
let payload = {};
if (typeof limit !== 'undefined') {
payload['limit'] = limit;
@@ -2173,15 +2412,19 @@
* List Indexes
*
*
* @param {string} databaseId
* @param {string} collectionId
* @throws {AppwriteException}
* @returns {Promise}
*/
listIndexes: (collectionId) => __awaiter(this, void 0, void 0, function* () {
listIndexes: (databaseId, collectionId) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
let path = '/database/collections/{collectionId}/indexes'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
const uri = new URL(this.config.endpoint + path);
return yield this.call('get', uri, {
@@ -2192,6 +2435,7 @@
* Create Index
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} key
* @param {string} type
@@ -2200,7 +2444,10 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
createIndex: (collectionId, key, type, attributes, orders) => __awaiter(this, void 0, void 0, function* () {
createIndex: (databaseId, collectionId, key, type, attributes, orders) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
@@ -2213,7 +2460,7 @@
if (typeof attributes === 'undefined') {
throw new AppwriteException('Missing required parameter: "attributes"');
}
let path = '/database/collections/{collectionId}/indexes'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof key !== 'undefined') {
payload['key'] = key;
@@ -2236,19 +2483,23 @@
* Get Index
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} key
* @throws {AppwriteException}
* @returns {Promise}
*/
getIndex: (collectionId, key) => __awaiter(this, void 0, void 0, function* () {
getIndex: (databaseId, collectionId, key) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
if (typeof key === 'undefined') {
throw new AppwriteException('Missing required parameter: "key"');
}
let path = '/database/collections/{collectionId}/indexes/{key}'.replace('{collectionId}', collectionId).replace('{key}', key);
let path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
let payload = {};
const uri = new URL(this.config.endpoint + path);
return yield this.call('get', uri, {
@@ -2259,19 +2510,23 @@
* Delete Index
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} key
* @throws {AppwriteException}
* @returns {Promise}
*/
deleteIndex: (collectionId, key) => __awaiter(this, void 0, void 0, function* () {
deleteIndex: (databaseId, collectionId, key) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
if (typeof key === 'undefined') {
throw new AppwriteException('Missing required parameter: "key"');
}
let path = '/database/collections/{collectionId}/indexes/{key}'.replace('{collectionId}', collectionId).replace('{key}', key);
let path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
let payload = {};
const uri = new URL(this.config.endpoint + path);
return yield this.call('delete', uri, {
@@ -2283,17 +2538,76 @@
*
* Get the collection activity logs list by its unique ID.
*
* @param {string} databaseId
* @param {string} collectionId
* @param {number} limit
* @param {number} offset
* @throws {AppwriteException}
* @returns {Promise}
*/
listCollectionLogs: (collectionId, limit, offset) => __awaiter(this, void 0, void 0, function* () {
listCollectionLogs: (databaseId, collectionId, limit, offset) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
let path = '/database/collections/{collectionId}/logs'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof limit !== 'undefined') {
payload['limit'] = limit;
}
if (typeof offset !== 'undefined') {
payload['offset'] = offset;
}
const uri = new URL(this.config.endpoint + path);
return yield this.call('get', uri, {
'content-type': 'application/json',
}, payload);
}),
/**
* Get usage stats for a collection
*
*
* @param {string} databaseId
* @param {string} collectionId
* @param {string} range
* @throws {AppwriteException}
* @returns {Promise}
*/
getCollectionUsage: (databaseId, collectionId, range) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
let path = '/databases/{databaseId}/collections/{collectionId}/usage'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
let payload = {};
if (typeof range !== 'undefined') {
payload['range'] = range;
}
const uri = new URL(this.config.endpoint + path);
return yield this.call('get', uri, {
'content-type': 'application/json',
}, payload);
}),
/**
* List Collection Logs
*
* Get the collection activity logs list by its unique ID.
*
* @param {string} databaseId
* @param {number} limit
* @param {number} offset
* @throws {AppwriteException}
* @returns {Promise}
*/
listLogs: (databaseId, limit, offset) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
let path = '/databases/{databaseId}/logs'.replace('{databaseId}', databaseId);
let payload = {};
if (typeof limit !== 'undefined') {
payload['limit'] = limit;
@@ -2310,35 +2624,16 @@
* Get usage stats for the database
*
*
* @param {string} databaseId
* @param {string} range
* @throws {AppwriteException}
* @returns {Promise}
*/
getUsage: (range) => __awaiter(this, void 0, void 0, function* () {
let path = '/database/usage';
let payload = {};
if (typeof range !== 'undefined') {
payload['range'] = range;
getDatabaseUsage: (databaseId, range) => __awaiter(this, void 0, void 0, function* () {
if (typeof databaseId === 'undefined') {
throw new AppwriteException('Missing required parameter: "databaseId"');
}
const uri = new URL(this.config.endpoint + path);
return yield this.call('get', uri, {
'content-type': 'application/json',
}, payload);
}),
/**
* Get usage stats for a collection
*
*
* @param {string} collectionId
* @param {string} range
* @throws {AppwriteException}
* @returns {Promise}
*/
getCollectionUsage: (collectionId, range) => __awaiter(this, void 0, void 0, function* () {
if (typeof collectionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "collectionId"');
}
let path = '/database/{collectionId}/usage'.replace('{collectionId}', collectionId);
let path = '/databases/{databaseId}/usage'.replace('{databaseId}', databaseId);
let payload = {};
if (typeof range !== 'undefined') {
payload['range'] = range;
+27 -8
View File
@@ -6,12 +6,16 @@
action: null,
type: null,
subType: null,
subSubType: null,
resource: null,
resourceName: '',
subResource: null,
subResourceName: '',
subSubResource: null,
subSubResourceName: '',
hasResource: false,
hasSubResource: false,
hasSubSubResource: false,
attribute: null,
hasAttribute: false,
attributes: [],
@@ -19,11 +23,11 @@
this.events = new Set(events);
},
reset() {
this.hasResource = this.hasSubResource = this.hasAttribute = false;
this.hasResource = this.hasSubResource = this.hasSubSubResource = this.hasAttribute = false;
this.type = this.subType = this.subResource = this.resource = this.attribute = this.selected = this.action = null;
},
setEvent() {
this.hasResource = this.hasSubResource = this.hasAttribute = this.action = false;
this.hasResource = this.hasSubResource = this.hasSubSubResource = this.hasAttribute = this.action = false;
if (!this.selected) {
this.reset();
@@ -44,9 +48,17 @@
break;
case 'collections':
this.hasResource = this.hasSubResource = true;
this.type = 'databases';
this.subType = type;
this.resourceName = 'Database ID';
this.subResourceName = 'Collection ID';
break;
case 'databases':
this.hasResource = true;
this.type = type;
this.resourceName = 'Collection ID';
this.resourceName = 'Database ID';
break;
case 'teams':
@@ -92,11 +104,13 @@
break;
case 'documents':
this.hasResource = this.hasSubResource = true;
this.type = 'collections';
this.subType = type;
this.resourceName = 'Collection ID';
this.subResourceName = 'Document ID';
this.hasResource = this.hasSubResource = this.hasSubSubResource = true;
this.type = 'databases';
this.subType = 'collections';
this.subSubType = type;
this.resourceName = 'Database ID';
this.subResourceName = 'Collection ID';
this.subSubResourceName = 'Document ID';
break;
case 'attributes':
@@ -154,6 +168,7 @@
default:
this.hasResource = true;
this.hasSubResource = true;
this.hasSubSubResource = true;
break;
}
@@ -178,6 +193,10 @@
event += `.${this.subType}.${this.subResource ? this.subResource : '*'}`;
}
if (this.hasSubSubResource) {
event += `.${this.subSubType}.${this.subSubResource ? this.subSubResource : '*'}`;
}
if (this.action) {
event += `.${this.action}`;
}
+5 -5
View File
@@ -29,13 +29,13 @@ window.ls.filter
return !Number.isNaN($value) ? $value.toLocaleString() : "";
})
.add("date", function ($value, date) {
return date.format("Y-m-d", $value);
return $value ? date.format("Y-m-d", $value) : "";
})
.add("dateTime", function ($value, date) {
return date.format("Y-m-d H:i", $value);
return $value ? date.format("Y-m-d H:i", $value) : "";
})
.add("dateText", function ($value, date) {
return date.format("d M Y", $value);
return $value ? date.format("d M Y", $value) : "";
})
.add("timeSince", function ($value) {
$value = $value * 1000;
@@ -212,10 +212,10 @@ window.ls.filter
let document = container.get('project-document');
if (collection && document && !document.$id) {
return 'database.createDocument';
return 'databases.createDocument';
}
return 'database.updateDocument';
return 'databases.updateDocument';
})
.add("documentSuccess", function (container) {
let document = container.get('project-document');
+4 -4
View File
@@ -66,14 +66,14 @@ window.addEventListener("load", async () => {
return;
}
if (response.events.includes('collections.*.attributes.*')) {
document.dispatchEvent(new CustomEvent('database.createAttribute'));
if (response.events.includes('databases.*.collections.*.attributes.*')) {
document.dispatchEvent(new CustomEvent('databases.createAttribute'));
return;
}
if (response.events.includes('collections.*.indexes.*')) {
document.dispatchEvent(new CustomEvent('database.createIndex'));
if (response.events.includes('databases.*.collections.*.indexes.*')) {
document.dispatchEvent(new CustomEvent('databases.createIndex'));
return;
}
+21 -7
View File
@@ -117,40 +117,54 @@ window.ls.router
scope: "console",
project: true
})
.add("/console/database", {
template: "/console/database?version=" + APP_ENV.CACHEBUSTER,
.add("/console/databases", {
template: "/console/databases?version=" + APP_ENV.CACHEBUSTER,
scope: "console",
project: true
})
.add("/console/database/usage", {
.add("/console/databases/database", {
template: function(window) {
return window.location.pathname + window.location.search + '&version=' + APP_ENV.CACHEBUSTER;
},
scope: "console",
project: true
})
.add("/console/database/collection", {
.add("/console/databases/database/:tab", {
template: function(window) {
return window.location.pathname + window.location.search + '&version=' + APP_ENV.CACHEBUSTER;
},
scope: "console",
project: true
})
.add("/console/database/collection/:tab", {
.add("/console/databases/usage", {
template: function(window) {
return window.location.pathname + window.location.search + '&version=' + APP_ENV.CACHEBUSTER;
},
scope: "console",
project: true
})
.add("/console/database/document", {
.add("/console/databases/collection", {
template: function(window) {
return window.location.pathname + window.location.search + '&version=' + APP_ENV.CACHEBUSTER;
},
scope: "console",
project: true
})
.add("/console/database/document/:tab", {
.add("/console/databases/collection/:tab", {
template: function(window) {
return window.location.pathname + window.location.search + '&version=' + APP_ENV.CACHEBUSTER;
},
scope: "console",
project: true
})
.add("/console/databases/document", {
template: function(window) {
return window.location.pathname + window.location.search + '&version=' + APP_ENV.CACHEBUSTER;
},
scope: "console",
project: true
})
.add("/console/databases/document/:tab", {
template: function(window) {
return window.location.pathname + window.location.search + '&version=' + APP_ENV.CACHEBUSTER;
},
+5 -1
View File
@@ -25,7 +25,11 @@
"Auth0": {
"clientSecret": "oauth2Auth0ClientSecret",
"auth0Domain": "oauth2Auth0Domain"
}
},
"Gitlab": {
"endpoint": "oauth2GitlabEndpoint",
"clientSecret": "oauth2GitlabClientSecret",
},
}
let provider = element.getAttribute("data-forms-oauth-custom");
if (!provider || !providers.hasOwnProperty(provider)) { console.error("Provider for custom form not set or unknown") }
+6 -6
View File
@@ -41,14 +41,14 @@
i {
cursor: pointer;
position: absolute;
font-size: 14px;
line-height: 20px;
top: 9px;
.func-start(9px);
font-size: 12px;
line-height: 24px;
top: 8px;
.func-start(8px);
color: var(--config-color-background-dark);
background: var(--config-color-normal);
width: 22px;
height: 22px;
width: 24px;
height: 24px;
border-radius: 50%;
}