diff --git a/CHANGES.md b/CHANGES.md index 0b94a6f3f7..8095477187 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,6 +25,8 @@ - Fixed a UI bug preventing float values in numeric fields - Fixed scroll positioning when moving rules order up & down - Fixed missing validation for database documents key length (32 chars) +- Grammer fix for pt-br email templates (@rubensdemelo) +- Fixed update form labels and tooltips for Flutter Android apps ## Security diff --git a/app/app.php b/app/app.php index dcab392a73..31dc0d4afd 100644 --- a/app/app.php +++ b/app/app.php @@ -187,7 +187,7 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $ throw new Exception('Project not found', 404); } - throw new Exception($user->getAttribute('email', 'Guest').' (role: '.strtolower($roles[$role]['label']).') missing scope ('.$scope.')', 401); + throw new Exception($user->getAttribute('email', 'User').' (role: '.strtolower($roles[$role]['label']).') missing scope ('.$scope.')', 401); } if (Auth::USER_STATUS_BLOCKED == $user->getAttribute('status')) { // Account has not been activated diff --git a/app/sdks/client-web/docs/examples/avatars/get-initials.md b/app/sdks/client-web/docs/examples/avatars/get-initials.md new file mode 100644 index 0000000000..a54310a6a2 --- /dev/null +++ b/app/sdks/client-web/docs/examples/avatars/get-initials.md @@ -0,0 +1,10 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let result = sdk.avatars.getInitials(); + +console.log(result); // Resource URL diff --git a/app/sdks/client-web/docs/examples/locale/get-languages.md b/app/sdks/client-web/docs/examples/locale/get-languages.md new file mode 100644 index 0000000000..04e3063ee7 --- /dev/null +++ b/app/sdks/client-web/docs/examples/locale/get-languages.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.locale.getLanguages(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/client-web/src/sdk.js b/app/sdks/client-web/src/sdk.js index a423ae9cf9..f0819912ff 100644 --- a/app/sdks/client-web/src/sdk.js +++ b/app/sdks/client-web/src/sdk.js @@ -190,28 +190,27 @@ } request.onload = function () { + let data = request.response; + let contentType = this.getResponseHeader('content-type') || ''; + contentType = contentType.substring(0, contentType.indexOf(';')); + + switch (contentType) { + case 'application/json': + data = JSON.parse(data); + break; + } + + let cookieFallback = this.getResponseHeader('X-Fallback-Cookies') || ''; + + if(window.localStorage && cookieFallback) { + window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.'); + window.localStorage.setItem('cookieFallback', cookieFallback); + } + if (4 === request.readyState && 399 >= request.status) { - let data = request.response; - let contentType = this.getResponseHeader('content-type') || ''; - contentType = contentType.substring(0, contentType.indexOf(';')); - - switch (contentType) { - case 'application/json': - data = JSON.parse(data); - break; - } - - let cookieFallback = this.getResponseHeader('X-Fallback-Cookies') || ''; - - if(window.localStorage && cookieFallback) { - window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.'); - window.localStorage.setItem('cookieFallback', cookieFallback); - } - resolve(data); - } else { - reject(new Error(request.statusText)); + reject(data); } }; @@ -1045,6 +1044,60 @@ return config.endpoint + path + ((query) ? '?' + query : ''); }, + /** + * Get User Initials + * + * Use this endpoint to show your user initials avatar icon on your website or + * app. By default, this route will try to print your logged-in user name or + * email initials. You can also overwrite the user name if you pass the 'name' + * parameter. If no name is given and no user is logged, an empty avatar will + * be returned. + * + * You can use the color and background params to change the avatar colors. By + * default, a random theme will be selected. The random theme will persist for + * the user's initials when reloading the same theme will always return for + * the same initials. + * + * @param {string} name + * @param {number} width + * @param {number} height + * @param {string} color + * @param {string} background + * @throws {Error} + * @return {string} + */ + getInitials: function(name = '', width = 500, height = 500, color = '', background = '') { + let path = '/avatars/initials'; + + let payload = {}; + + if(name) { + payload['name'] = name; + } + + if(width) { + payload['width'] = width; + } + + if(height) { + payload['height'] = height; + } + + if(color) { + payload['color'] = color; + } + + if(background) { + payload['background'] = background; + } + + payload['project'] = config.project; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); + }, + /** * Get QR Code * @@ -1460,9 +1513,9 @@ /** * List Currencies * - * List of all currencies, including currency symol, name, plural, and decimal - * digits for all major and minor currencies. You can use the locale header to - * get the data in a supported language. + * List of all currencies, including currency symbol, name, plural, and + * decimal digits for all major and minor currencies. You can use the locale + * header to get the data in a supported language. * * @throws {Error} * @return {Promise} @@ -1472,6 +1525,26 @@ let payload = {}; + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * List Languages + * + * List of all languages classified by ISO 639-1 including 2-letter code, name + * in English, and name in the respective language. + * + * @throws {Error} + * @return {Promise} + */ + getLanguages: function() { + let path = '/locale/languages'; + + let payload = {}; + return http .get(path, { 'content-type': 'application/json', diff --git a/app/sdks/client-web/src/sdk.min.js b/app/sdks/client-web/src/sdk.min.js index bef842f31a..e8e6eb368e 100644 --- a/app/sdks/client-web/src/sdk.min.js +++ b/app/sdks/client-web/src/sdk.min.js @@ -9,9 +9,9 @@ if(method==='GET'){for(let param in params){if(param.hasOwnProperty(key)){path=a switch(headers['content-type']){case 'application/json':params=JSON.stringify(params);break;case 'multipart/form-data':let formData=new FormData();Object.keys(params).forEach(function(key){let param=params[key];formData.append(key+(Array.isArray(param)?'[]':''),param)});params=formData;break} return new Promise(function(resolve,reject){let request=new XMLHttpRequest(),key;request.withCredentials=!0;request.open(method,path,!0);for(key in headers){if(headers.hasOwnProperty(key)){if(key==='content-type'&&headers[key]==='multipart/form-data'){continue} request.setRequestHeader(key,headers[key])}} -request.onload=function(){if(4===request.readyState&&399>=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type')||'';contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case 'application/json':data=JSON.parse(data);break} +request.onload=function(){let data=request.response;let contentType=this.getResponseHeader('content-type')||'';contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case 'application/json':data=JSON.parse(data);break} let cookieFallback=this.getResponseHeader('X-Fallback-Cookies')||'';if(window.localStorage&&cookieFallback){window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');window.localStorage.setItem('cookieFallback',cookieFallback)} -resolve(data)}else{reject(new Error(request.statusText))}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,!1)} +if(4===request.readyState&&399>=request.status){resolve(data)}else{reject(data)}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,!1)} request.onerror=function(){reject(new Error("Network Error"))};request.send(params)})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{})},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress)},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress)},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress)},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress)},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload)},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')} if(password===undefined){throw new Error('Missing required parameter: "password"')} let path='/account';let payload={};if(email){payload.email=email} @@ -73,6 +73,11 @@ payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+e let path='/avatars/image';let payload={};if(url){payload.url=url} if(width){payload.width=width} if(height){payload.height=height} +payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getInitials:function(name='',width=500,height=500,color='',background=''){let path='/avatars/initials';let payload={};if(name){payload.name=name} +if(width){payload.width=width} +if(height){payload.height=height} +if(color){payload.color=color} +if(background){payload.background=background} payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"')} let path='/avatars/qr';let payload={};if(text){payload.text=text} if(size){payload.size=size} @@ -110,7 +115,7 @@ if(read){payload.read=read} if(write){payload.write=write} return http.patch(path,{'content-type':'application/json',},payload)},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} if(documentId===undefined){throw new Error('Missing required parameter: "documentId"')} -let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';let payload={};if(search){payload.search=search} +let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getLanguages:function(){let path='/locale/languages';let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';let payload={};if(search){payload.search=search} if(limit){payload.limit=limit} if(offset){payload.offset=offset} if(orderType){payload.orderType=orderType} diff --git a/app/sdks/client-web/types/index.d.ts b/app/sdks/client-web/types/index.d.ts index 2715af9f8d..11a52625f7 100644 --- a/app/sdks/client-web/types/index.d.ts +++ b/app/sdks/client-web/types/index.d.ts @@ -386,6 +386,30 @@ declare namespace Appwrite { */ getImage(url: string, width: number, height: number): string; + /** + * Get User Initials + * + * Use this endpoint to show your user initials avatar icon on your website or + * app. By default, this route will try to print your logged-in user name or + * email initials. You can also overwrite the user name if you pass the 'name' + * parameter. If no name is given and no user is logged, an empty avatar will + * be returned. + * + * You can use the color and background params to change the avatar colors. By + * default, a random theme will be selected. The random theme will persist for + * the user's initials when reloading the same theme will always return for + * the same initials. + * + * @param {string} name + * @param {number} width + * @param {number} height + * @param {string} color + * @param {string} background + * @throws {Error} + * @return {string} + */ + getInitials(name: string, width: number, height: number, color: string, background: string): string; + /** * Get QR Code * @@ -555,15 +579,26 @@ declare namespace Appwrite { /** * List Currencies * - * List of all currencies, including currency symol, name, plural, and decimal - * digits for all major and minor currencies. You can use the locale header to - * get the data in a supported language. + * List of all currencies, including currency symbol, name, plural, and + * decimal digits for all major and minor currencies. You can use the locale + * header to get the data in a supported language. * * @throws {Error} * @return {Promise} */ getCurrencies(): Promise; + /** + * List Languages + * + * List of all languages classified by ISO 639-1 including 2-letter code, name + * in English, and name in the respective language. + * + * @throws {Error} + * @return {Promise} + */ + getLanguages(): Promise; + } export interface Storage { diff --git a/app/sdks/console-web/docs/examples/avatars/get-initials.md b/app/sdks/console-web/docs/examples/avatars/get-initials.md new file mode 100644 index 0000000000..41f8388e1a --- /dev/null +++ b/app/sdks/console-web/docs/examples/avatars/get-initials.md @@ -0,0 +1,11 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let result = sdk.avatars.getInitials(); + +console.log(result); // Resource URL diff --git a/app/sdks/console-web/docs/examples/locale/get-languages.md b/app/sdks/console-web/docs/examples/locale/get-languages.md new file mode 100644 index 0000000000..2d1f713eeb --- /dev/null +++ b/app/sdks/console-web/docs/examples/locale/get-languages.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.locale.getLanguages(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/src/sdk.js b/app/sdks/console-web/src/sdk.js index 08f0501f23..13ff86337f 100644 --- a/app/sdks/console-web/src/sdk.js +++ b/app/sdks/console-web/src/sdk.js @@ -226,28 +226,27 @@ } request.onload = function () { + let data = request.response; + let contentType = this.getResponseHeader('content-type') || ''; + contentType = contentType.substring(0, contentType.indexOf(';')); + + switch (contentType) { + case 'application/json': + data = JSON.parse(data); + break; + } + + let cookieFallback = this.getResponseHeader('X-Fallback-Cookies') || ''; + + if(window.localStorage && cookieFallback) { + window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.'); + window.localStorage.setItem('cookieFallback', cookieFallback); + } + if (4 === request.readyState && 399 >= request.status) { - let data = request.response; - let contentType = this.getResponseHeader('content-type') || ''; - contentType = contentType.substring(0, contentType.indexOf(';')); - - switch (contentType) { - case 'application/json': - data = JSON.parse(data); - break; - } - - let cookieFallback = this.getResponseHeader('X-Fallback-Cookies') || ''; - - if(window.localStorage && cookieFallback) { - window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.'); - window.localStorage.setItem('cookieFallback', cookieFallback); - } - resolve(data); - } else { - reject(new Error(request.statusText)); + reject(data); } }; @@ -1093,6 +1092,62 @@ return config.endpoint + path + ((query) ? '?' + query : ''); }, + /** + * Get User Initials + * + * Use this endpoint to show your user initials avatar icon on your website or + * app. By default, this route will try to print your logged-in user name or + * email initials. You can also overwrite the user name if you pass the 'name' + * parameter. If no name is given and no user is logged, an empty avatar will + * be returned. + * + * You can use the color and background params to change the avatar colors. By + * default, a random theme will be selected. The random theme will persist for + * the user's initials when reloading the same theme will always return for + * the same initials. + * + * @param {string} name + * @param {number} width + * @param {number} height + * @param {string} color + * @param {string} background + * @throws {Error} + * @return {string} + */ + getInitials: function(name = '', width = 500, height = 500, color = '', background = '') { + let path = '/avatars/initials'; + + let payload = {}; + + if(name) { + payload['name'] = name; + } + + if(width) { + payload['width'] = width; + } + + if(height) { + payload['height'] = height; + } + + if(color) { + payload['color'] = color; + } + + if(background) { + payload['background'] = background; + } + + payload['project'] = config.project; + + payload['key'] = config.key; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); + }, + /** * Get QR Code * @@ -1979,9 +2034,9 @@ /** * List Currencies * - * List of all currencies, including currency symol, name, plural, and decimal - * digits for all major and minor currencies. You can use the locale header to - * get the data in a supported language. + * List of all currencies, including currency symbol, name, plural, and + * decimal digits for all major and minor currencies. You can use the locale + * header to get the data in a supported language. * * @throws {Error} * @return {Promise} @@ -1991,6 +2046,26 @@ let payload = {}; + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * List Languages + * + * List of all languages classified by ISO 639-1 including 2-letter code, name + * in English, and name in the respective language. + * + * @throws {Error} + * @return {Promise} + */ + getLanguages: function() { + let path = '/locale/languages'; + + let payload = {}; + return http .get(path, { 'content-type': 'application/json', diff --git a/app/sdks/console-web/src/sdk.min.js b/app/sdks/console-web/src/sdk.min.js index f0951f5030..651bbffeb0 100644 --- a/app/sdks/console-web/src/sdk.min.js +++ b/app/sdks/console-web/src/sdk.min.js @@ -9,9 +9,9 @@ if(method==='GET'){for(let param in params){if(param.hasOwnProperty(key)){path=a switch(headers['content-type']){case 'application/json':params=JSON.stringify(params);break;case 'multipart/form-data':let formData=new FormData();Object.keys(params).forEach(function(key){let param=params[key];formData.append(key+(Array.isArray(param)?'[]':''),param)});params=formData;break} return new Promise(function(resolve,reject){let request=new XMLHttpRequest(),key;request.withCredentials=!0;request.open(method,path,!0);for(key in headers){if(headers.hasOwnProperty(key)){if(key==='content-type'&&headers[key]==='multipart/form-data'){continue} request.setRequestHeader(key,headers[key])}} -request.onload=function(){if(4===request.readyState&&399>=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type')||'';contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case 'application/json':data=JSON.parse(data);break} +request.onload=function(){let data=request.response;let contentType=this.getResponseHeader('content-type')||'';contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case 'application/json':data=JSON.parse(data);break} let cookieFallback=this.getResponseHeader('X-Fallback-Cookies')||'';if(window.localStorage&&cookieFallback){window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');window.localStorage.setItem('cookieFallback',cookieFallback)} -resolve(data)}else{reject(new Error(request.statusText))}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,!1)} +if(4===request.readyState&&399>=request.status){resolve(data)}else{reject(data)}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,!1)} request.onerror=function(){reject(new Error("Network Error"))};request.send(params)})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{})},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress)},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress)},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress)},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress)},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload)},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')} if(password===undefined){throw new Error('Missing required parameter: "password"')} let path='/account';let payload={};if(email){payload.email=email} @@ -73,6 +73,11 @@ payload.project=config.project;payload.key=config.key;let query=Object.keys(payl let path='/avatars/image';let payload={};if(url){payload.url=url} if(width){payload.width=width} if(height){payload.height=height} +payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getInitials:function(name='',width=500,height=500,color='',background=''){let path='/avatars/initials';let payload={};if(name){payload.name=name} +if(width){payload.width=width} +if(height){payload.height=height} +if(color){payload.color=color} +if(background){payload.background=background} payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"')} let path='/avatars/qr';let payload={};if(text){payload.text=text} if(size){payload.size=size} @@ -133,7 +138,7 @@ if(write){payload.write=write} return http.patch(path,{'content-type':'application/json',},payload)},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} if(documentId===undefined){throw new Error('Missing required parameter: "documentId"')} let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getCollectionLogs:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} -let path='/database/collections/{collectionId}/logs'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let health={get:function(){let path='/health';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getAntiVirus:function(){let path='/health/anti-virus';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCache:function(){let path='/health/cache';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getDB:function(){let path='/health/db';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getQueueCertificates:function(){let path='/health/queue/certificates';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getQueueFunctions:function(){let path='/health/queue/functions';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getQueueLogs:function(){let path='/health/queue/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getQueueTasks:function(){let path='/health/queue/tasks';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getQueueUsage:function(){let path='/health/queue/usage';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getQueueWebhooks:function(){let path='/health/queue/webhooks';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getStorageLocal:function(){let path='/health/storage/local';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getTime:function(){let path='/health/time';let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let projects={list:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload)},create:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"')} +let path='/database/collections/{collectionId}/logs'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let health={get:function(){let path='/health';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getAntiVirus:function(){let path='/health/anti-virus';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCache:function(){let path='/health/cache';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getDB:function(){let path='/health/db';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getQueueCertificates:function(){let path='/health/queue/certificates';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getQueueFunctions:function(){let path='/health/queue/functions';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getQueueLogs:function(){let path='/health/queue/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getQueueTasks:function(){let path='/health/queue/tasks';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getQueueUsage:function(){let path='/health/queue/usage';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getQueueWebhooks:function(){let path='/health/queue/webhooks';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getStorageLocal:function(){let path='/health/storage/local';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getTime:function(){let path='/health/time';let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload)},getLanguages:function(){let path='/locale/languages';let payload={};return http.get(path,{'content-type':'application/json',},payload)}};let projects={list:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload)},create:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"')} if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} let path='/projects';let payload={};if(name){payload.name=name} if(teamId){payload.teamId=teamId} diff --git a/app/sdks/console-web/types/index.d.ts b/app/sdks/console-web/types/index.d.ts index 65da150013..6b73a63bcf 100644 --- a/app/sdks/console-web/types/index.d.ts +++ b/app/sdks/console-web/types/index.d.ts @@ -407,6 +407,30 @@ declare namespace Appwrite { */ getImage(url: string, width: number, height: number): string; + /** + * Get User Initials + * + * Use this endpoint to show your user initials avatar icon on your website or + * app. By default, this route will try to print your logged-in user name or + * email initials. You can also overwrite the user name if you pass the 'name' + * parameter. If no name is given and no user is logged, an empty avatar will + * be returned. + * + * You can use the color and background params to change the avatar colors. By + * default, a random theme will be selected. The random theme will persist for + * the user's initials when reloading the same theme will always return for + * the same initials. + * + * @param {string} name + * @param {number} width + * @param {number} height + * @param {string} color + * @param {string} background + * @throws {Error} + * @return {string} + */ + getInitials(name: string, width: number, height: number, color: string, background: string): string; + /** * Get QR Code * @@ -792,15 +816,26 @@ declare namespace Appwrite { /** * List Currencies * - * List of all currencies, including currency symol, name, plural, and decimal - * digits for all major and minor currencies. You can use the locale header to - * get the data in a supported language. + * List of all currencies, including currency symbol, name, plural, and + * decimal digits for all major and minor currencies. You can use the locale + * header to get the data in a supported language. * * @throws {Error} * @return {Promise} */ getCurrencies(): Promise; + /** + * List Languages + * + * List of all languages classified by ISO 639-1 including 2-letter code, name + * in English, and name in the respective language. + * + * @throws {Error} + * @return {Promise} + */ + getLanguages(): Promise; + } export interface Projects { diff --git a/app/views/console/home/index.phtml b/app/views/console/home/index.phtml index 6658960caf..2141eb8ee8 100644 --- a/app/views/console/home/index.phtml +++ b/app/views/console/home/index.phtml @@ -341,7 +341,7 @@ $graph = $this->getParam('graph', false); - + @@ -371,7 +371,7 @@ $graph = $this->getParam('graph', false); - + @@ -387,7 +387,7 @@ $graph = $this->getParam('graph', false);