1
0
Fork 0
mirror of synced 2024-10-01 17:58:02 +13:00

Updated SDKs

This commit is contained in:
eldadfux 2019-09-21 12:36:44 +03:00
parent b3d0df54aa
commit 8943ba9642
18 changed files with 124 additions and 134 deletions

View file

@ -15,11 +15,11 @@ class Auth extends Service {
/// the only valid redirect URL's are the once from domains you have set when /// the only valid redirect URL's are the once from domains you have set when
/// added your platforms in the console interface. /// added your platforms in the console interface.
/// ///
/// When not using the success or failure redirect arguments this endpoint will /// When accessing this route using Javascript from the browser, success and
/// result with a 200 status code and the user account object on success and /// failure parameter URLs are required. Appwrite server will respond with a
/// with 401 status error on failure. This behavior was applied to help the web /// 301 redirect status code and will set the user session cookie. This
/// clients deal with browsers who don't allow to set 3rd party HTTP cookies /// behavior is enforced because modern browsers are limiting 3rd party cookies
/// needed for saving the account session token. /// in XHR of fetch request to protect user privacy.
Future<Response> login({email, password, success, failure}) async { Future<Response> login({email, password, success, failure}) async {
String path = '/auth/login'; String path = '/auth/login';
@ -80,12 +80,12 @@ class Auth extends Service {
/// values attached to the URL query string. Use the query string params to /// values attached to the URL query string. Use the query string params to
/// submit a request to the /auth/password/reset endpoint to complete the /// submit a request to the /auth/password/reset endpoint to complete the
/// process. /// process.
Future<Response> recovery({email, redirect}) async { Future<Response> recovery({email, confirmation}) async {
String path = '/auth/recovery'; String path = '/auth/recovery';
Map<String, dynamic> params = { Map<String, dynamic> params = {
'email': email, 'email': email,
'redirect': redirect, 'confirmation': confirmation,
}; };
return await this.client.call('post', path: path, params: params); return await this.client.call('post', path: path, params: params);
@ -117,7 +117,7 @@ class Auth extends Service {
/// ///
/// If registration completes successfully user will be sent with a /// If registration completes successfully user will be sent with a
/// confirmation email in order to confirm he is the owner of the account email /// confirmation email in order to confirm he is the owner of the account email
/// address. Use the redirect parameter to redirect the user from the /// address. Use the confirmation parameter to redirect the user from the
/// confirmation email back to your app. When the user is redirected, use the /// confirmation email back to your app. When the user is redirected, use the
/// /auth/confirm endpoint to complete the account confirmation. /// /auth/confirm endpoint to complete the account confirmation.
/// ///
@ -126,18 +126,18 @@ class Auth extends Service {
/// the only valid redirect URL&#039;s are the once from domains you have set when /// the only valid redirect URL&#039;s are the once from domains you have set when
/// added your platforms in the console interface. /// added your platforms in the console interface.
/// ///
/// When not using the success or failure redirect arguments this endpoint will /// When accessing this route using Javascript from the browser, success and
/// result with a 200 status code and the user account object on success and /// failure parameter URLs are required. Appwrite server will respond with a
/// with 401 status error on failure. This behavior was applied to help the web /// 301 redirect status code and will set the user session cookie. This
/// clients deal with browsers who don&#039;t allow to set 3rd party HTTP cookies /// behavior is enforced because modern browsers are limiting 3rd party cookies
/// needed for saving the account session token. /// in XHR of fetch request to protect user privacy.
Future<Response> register({email, password, redirect, success, failure, name = null}) async { Future<Response> register({email, password, confirmation, success = null, failure = null, name = null}) async {
String path = '/auth/register'; String path = '/auth/register';
Map<String, dynamic> params = { Map<String, dynamic> params = {
'email': email, 'email': email,
'password': password, 'password': password,
'redirect': redirect, 'confirmation': confirmation,
'success': success, 'success': success,
'failure': failure, 'failure': failure,
'name': name, 'name': name,
@ -167,11 +167,11 @@ class Auth extends Service {
/// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) /// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
/// the only valid redirect URL&#039;s are the once from domains you have set when /// the only valid redirect URL&#039;s are the once from domains you have set when
/// added your platforms in the console interface. /// added your platforms in the console interface.
Future<Response> confirmResend({redirect}) async { Future<Response> confirmResend({confirmation}) async {
String path = '/auth/register/confirm/resend'; String path = '/auth/register/confirm/resend';
Map<String, dynamic> params = { Map<String, dynamic> params = {
'redirect': redirect, 'confirmation': confirmation,
}; };
return await this.client.call('post', path: path, params: params); return await this.client.call('post', path: path, params: params);

View file

@ -4,7 +4,7 @@ sdk
setProject('') setProject('')
; ;
let promise = sdk.auth.register('email@example.com', 'password', 'https://example.com', 'https://example.com', 'https://example.com'); let promise = sdk.auth.register('email@example.com', 'password', 'https://example.com');
promise.then(function (response) { promise.then(function (response) {
console.log(response); console.log(response);

View file

@ -4,7 +4,7 @@ sdk
setProject('') setProject('')
; ;
let promise = sdk.projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com'); let promise = sdk.projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com');
promise.then(function (response) { promise.then(function (response) {
console.log(response); console.log(response);

View file

@ -4,7 +4,7 @@ sdk
setProject('') setProject('')
; ;
let promise = sdk.projects.updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com'); let promise = sdk.projects.updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com');
promise.then(function (response) { promise.then(function (response) {
console.log(response); console.log(response);

View file

@ -500,11 +500,11 @@
* the only valid redirect URL's are the once from domains you have set when * the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface. * added your platforms in the console interface.
* *
* When not using the success or failure redirect arguments this endpoint will * When accessing this route using Javascript from the browser, success and
* result with a 200 status code and the user account object on success and * failure parameter URLs are required. Appwrite server will respond with a
* with 401 status error on failure. This behavior was applied to help the web * 301 redirect status code and will set the user session cookie. This
* clients deal with browsers who don't allow to set 3rd party HTTP cookies * behavior is enforced because modern browsers are limiting 3rd party cookies
* needed for saving the account session token. * in XHR of fetch request to protect user privacy.
* *
* @param {string} email * @param {string} email
* @param {string} password * @param {string} password
@ -648,16 +648,16 @@
* process. * process.
* *
* @param {string} email * @param {string} email
* @param {string} redirect * @param {string} confirmation
* @throws {Error} * @throws {Error}
* @return {Promise} */ * @return {Promise} */
recovery: function(email, redirect) { recovery: function(email, confirmation) {
if(email === undefined) { if(email === undefined) {
throw new Error('Missing required parameter: "email"'); throw new Error('Missing required parameter: "email"');
} }
if(redirect === undefined) { if(confirmation === undefined) {
throw new Error('Missing required parameter: "redirect"'); throw new Error('Missing required parameter: "confirmation"');
} }
let path = '/auth/recovery'; let path = '/auth/recovery';
@ -666,7 +666,7 @@
.post(path, {'content-type': 'application/json'}, .post(path, {'content-type': 'application/json'},
{ {
'email': email, 'email': email,
'redirect': redirect 'confirmation': confirmation
}); });
}, },
@ -727,7 +727,7 @@
* *
* If registration completes successfully user will be sent with a * If registration completes successfully user will be sent with a
* confirmation email in order to confirm he is the owner of the account email * confirmation email in order to confirm he is the owner of the account email
* address. Use the redirect parameter to redirect the user from the * address. Use the confirmation parameter to redirect the user from the
* confirmation email back to your app. When the user is redirected, use the * confirmation email back to your app. When the user is redirected, use the
* /auth/confirm endpoint to complete the account confirmation. * /auth/confirm endpoint to complete the account confirmation.
* *
@ -736,21 +736,21 @@
* the only valid redirect URL's are the once from domains you have set when * the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface. * added your platforms in the console interface.
* *
* When not using the success or failure redirect arguments this endpoint will * When accessing this route using Javascript from the browser, success and
* result with a 200 status code and the user account object on success and * failure parameter URLs are required. Appwrite server will respond with a
* with 401 status error on failure. This behavior was applied to help the web * 301 redirect status code and will set the user session cookie. This
* clients deal with browsers who don't allow to set 3rd party HTTP cookies * behavior is enforced because modern browsers are limiting 3rd party cookies
* needed for saving the account session token. * in XHR of fetch request to protect user privacy.
* *
* @param {string} email * @param {string} email
* @param {string} password * @param {string} password
* @param {string} redirect * @param {string} confirmation
* @param {string} success * @param {string} success
* @param {string} failure * @param {string} failure
* @param {string} name * @param {string} name
* @throws {Error} * @throws {Error}
* @return {null} */ * @return {null} */
register: function(email, password, redirect, success, failure, name = '') { register: function(email, password, confirmation, success = '', failure = '', name = '') {
if(email === undefined) { if(email === undefined) {
throw new Error('Missing required parameter: "email"'); throw new Error('Missing required parameter: "email"');
} }
@ -759,16 +759,8 @@
throw new Error('Missing required parameter: "password"'); throw new Error('Missing required parameter: "password"');
} }
if(redirect === undefined) { if(confirmation === undefined) {
throw new Error('Missing required parameter: "redirect"'); throw new Error('Missing required parameter: "confirmation"');
}
if(success === undefined) {
throw new Error('Missing required parameter: "success"');
}
if(failure === undefined) {
throw new Error('Missing required parameter: "failure"');
} }
let path = '/auth/register'; let path = '/auth/register';
@ -776,7 +768,7 @@
return iframe('post', path, {project: config.project, return iframe('post', path, {project: config.project,
'email': email, 'email': email,
'password': password, 'password': password,
'redirect': redirect, 'confirmation': confirmation,
'success': success, 'success': success,
'failure': failure, 'failure': failure,
'name': name 'name': name
@ -826,12 +818,12 @@
* the only valid redirect URL's are the once from domains you have set when * the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface. * added your platforms in the console interface.
* *
* @param {string} redirect * @param {string} confirmation
* @throws {Error} * @throws {Error}
* @return {Promise} */ * @return {Promise} */
confirmResend: function(redirect) { confirmResend: function(confirmation) {
if(redirect === undefined) { if(confirmation === undefined) {
throw new Error('Missing required parameter: "redirect"'); throw new Error('Missing required parameter: "confirmation"');
} }
let path = '/auth/register/confirm/resend'; let path = '/auth/register/confirm/resend';
@ -839,7 +831,7 @@
return http return http
.post(path, {'content-type': 'application/json'}, .post(path, {'content-type': 'application/json'},
{ {
'redirect': redirect 'confirmation': confirmation
}); });
} }
}; };

View file

@ -26,21 +26,19 @@ let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);return http.dele
if(provider===undefined){throw new Error('Missing required parameter: "provider"')} if(provider===undefined){throw new Error('Missing required parameter: "provider"')}
if(code===undefined){throw new Error('Missing required parameter: "code"')} if(code===undefined){throw new Error('Missing required parameter: "code"')}
let path='/auth/oauth/callback/{provider}/{projectId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'code':code,'state':state})},oauth:function(provider,success='',failure=''){if(provider===undefined){throw new Error('Missing required parameter: "provider"')} let path='/auth/oauth/callback/{provider}/{projectId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'code':code,'state':state})},oauth:function(provider,success='',failure=''){if(provider===undefined){throw new Error('Missing required parameter: "provider"')}
let path='/auth/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'success':success,'failure':failure})},recovery:function(email,redirect){if(email===undefined){throw new Error('Missing required parameter: "email"')} let path='/auth/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);return http.get(path,{'content-type':'application/json'},{'success':success,'failure':failure})},recovery:function(email,confirmation){if(email===undefined){throw new Error('Missing required parameter: "email"')}
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')} if(confirmation===undefined){throw new Error('Missing required parameter: "confirmation"')}
let path='/auth/recovery';return http.post(path,{'content-type':'application/json'},{'email':email,'redirect':redirect})},recoveryReset:function(userId,token,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} let path='/auth/recovery';return http.post(path,{'content-type':'application/json'},{'email':email,'confirmation':confirmation})},recoveryReset:function(userId,token,passwordA,passwordB){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
if(token===undefined){throw new Error('Missing required parameter: "token"')} if(token===undefined){throw new Error('Missing required parameter: "token"')}
if(passwordA===undefined){throw new Error('Missing required parameter: "passwordA"')} if(passwordA===undefined){throw new Error('Missing required parameter: "passwordA"')}
if(passwordB===undefined){throw new Error('Missing required parameter: "passwordB"')} if(passwordB===undefined){throw new Error('Missing required parameter: "passwordB"')}
let path='/auth/recovery/reset';return http.put(path,{'content-type':'application/json'},{'userId':userId,'token':token,'password-a':passwordA,'password-b':passwordB})},register:function(email,password,redirect,success,failure,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')} let path='/auth/recovery/reset';return http.put(path,{'content-type':'application/json'},{'userId':userId,'token':token,'password-a':passwordA,'password-b':passwordB})},register:function(email,password,confirmation,success='',failure='',name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')}
if(password===undefined){throw new Error('Missing required parameter: "password"')} if(password===undefined){throw new Error('Missing required parameter: "password"')}
if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')} if(confirmation===undefined){throw new Error('Missing required parameter: "confirmation"')}
if(success===undefined){throw new Error('Missing required parameter: "success"')} let path='/auth/register';return iframe('post',path,{project:config.project,'email':email,'password':password,'confirmation':confirmation,'success':success,'failure':failure,'name':name})},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
if(failure===undefined){throw new Error('Missing required parameter: "failure"')}
let path='/auth/register';return iframe('post',path,{project:config.project,'email':email,'password':password,'redirect':redirect,'success':success,'failure':failure,'name':name})},confirm:function(userId,token){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
if(token===undefined){throw new Error('Missing required parameter: "token"')} if(token===undefined){throw new Error('Missing required parameter: "token"')}
let path='/auth/register/confirm';return http.post(path,{'content-type':'application/json'},{'userId':userId,'token':token})},confirmResend:function(redirect){if(redirect===undefined){throw new Error('Missing required parameter: "redirect"')} let path='/auth/register/confirm';return http.post(path,{'content-type':'application/json'},{'userId':userId,'token':token})},confirmResend:function(confirmation){if(confirmation===undefined){throw new Error('Missing required parameter: "confirmation"')}
let path='/auth/register/confirm/resend';return http.post(path,{'content-type':'application/json'},{'redirect':redirect})}};let avatars={getBrowser:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} let path='/auth/register/confirm/resend';return http.post(path,{'content-type':'application/json'},{'confirmation':confirmation})}};let avatars={getBrowser:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
let path='/avatars/browsers/{code}'.replace(new RegExp('{code}','g'),code);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality})},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} let path='/avatars/browsers/{code}'.replace(new RegExp('{code}','g'),code);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality})},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}
let path='/avatars/credit-cards/{code}'.replace(new RegExp('{code}','g'),code);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality})},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')} let path='/avatars/credit-cards/{code}'.replace(new RegExp('{code}','g'),code);return http.get(path,{'content-type':'application/json'},{'width':width,'height':height,'quality':quality})},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')}
let path='/avatars/favicon';return http.get(path,{'content-type':'application/json'},{'url':url})},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} let path='/avatars/favicon';return http.get(path,{'content-type':'application/json'},{'url':url})},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')}

View file

@ -10,7 +10,7 @@ client
setKey('') setKey('')
; ;
let promise = auth.register('email@example.com', 'password', 'https://example.com', 'https://example.com', 'https://example.com'); let promise = auth.register('email@example.com', 'password', 'https://example.com');
promise.then(function (response) { promise.then(function (response) {
console.log(response); console.log(response);

View file

@ -10,7 +10,7 @@ client
setKey('') setKey('')
; ;
let promise = projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com'); let promise = projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com');
promise.then(function (response) { promise.then(function (response) {
console.log(response); console.log(response);

View file

@ -10,7 +10,7 @@ client
setKey('') setKey('')
; ;
let promise = projects.createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 0); let promise = projects.createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 1);
promise.then(function (response) { promise.then(function (response) {
console.log(response); console.log(response);

View file

@ -14,11 +14,11 @@ class Auth extends Service {
* the only valid redirect URL's are the once from domains you have set when * the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface. * added your platforms in the console interface.
* *
* When not using the success or failure redirect arguments this endpoint will * When accessing this route using Javascript from the browser, success and
* result with a 200 status code and the user account object on success and * failure parameter URLs are required. Appwrite server will respond with a
* with 401 status error on failure. This behavior was applied to help the web * 301 redirect status code and will set the user session cookie. This
* clients deal with browsers who don't allow to set 3rd party HTTP cookies * behavior is enforced because modern browsers are limiting 3rd party cookies
* needed for saving the account session token. * in XHR of fetch request to protect user privacy.
* *
* @param string email * @param string email
* @param string password * @param string password
@ -126,17 +126,17 @@ class Auth extends Service {
* process. * process.
* *
* @param string email * @param string email
* @param string redirect * @param string confirmation
* @throws Exception * @throws Exception
* @return {} * @return {}
*/ */
async recovery(email, redirect) { async recovery(email, confirmation) {
let path = '/auth/recovery'; let path = '/auth/recovery';
return await this.client.call('post', path, {'content-type': 'application/json'}, return await this.client.call('post', path, {'content-type': 'application/json'},
{ {
'email': email, 'email': email,
'redirect': redirect 'confirmation': confirmation
}); });
} }
@ -181,7 +181,7 @@ class Auth extends Service {
* *
* If registration completes successfully user will be sent with a * If registration completes successfully user will be sent with a
* confirmation email in order to confirm he is the owner of the account email * confirmation email in order to confirm he is the owner of the account email
* address. Use the redirect parameter to redirect the user from the * address. Use the confirmation parameter to redirect the user from the
* confirmation email back to your app. When the user is redirected, use the * confirmation email back to your app. When the user is redirected, use the
* /auth/confirm endpoint to complete the account confirmation. * /auth/confirm endpoint to complete the account confirmation.
* *
@ -190,29 +190,29 @@ class Auth extends Service {
* the only valid redirect URL's are the once from domains you have set when * the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface. * added your platforms in the console interface.
* *
* When not using the success or failure redirect arguments this endpoint will * When accessing this route using Javascript from the browser, success and
* result with a 200 status code and the user account object on success and * failure parameter URLs are required. Appwrite server will respond with a
* with 401 status error on failure. This behavior was applied to help the web * 301 redirect status code and will set the user session cookie. This
* clients deal with browsers who don't allow to set 3rd party HTTP cookies * behavior is enforced because modern browsers are limiting 3rd party cookies
* needed for saving the account session token. * in XHR of fetch request to protect user privacy.
* *
* @param string email * @param string email
* @param string password * @param string password
* @param string redirect * @param string confirmation
* @param string success * @param string success
* @param string failure * @param string failure
* @param string name * @param string name
* @throws Exception * @throws Exception
* @return {} * @return {}
*/ */
async register(email, password, redirect, success, failure, name = '') { async register(email, password, confirmation, success = '', failure = '', name = '') {
let path = '/auth/register'; let path = '/auth/register';
return await this.client.call('post', path, {'content-type': 'application/json'}, return await this.client.call('post', path, {'content-type': 'application/json'},
{ {
'email': email, 'email': email,
'password': password, 'password': password,
'redirect': redirect, 'confirmation': confirmation,
'success': success, 'success': success,
'failure': failure, 'failure': failure,
'name': name 'name': name
@ -254,16 +254,16 @@ class Auth extends Service {
* the only valid redirect URL's are the once from domains you have set when * the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface. * added your platforms in the console interface.
* *
* @param string redirect * @param string confirmation
* @throws Exception * @throws Exception
* @return {} * @return {}
*/ */
async confirmResend(redirect) { async confirmResend(confirmation) {
let path = '/auth/register/confirm/resend'; let path = '/auth/register/confirm/resend';
return await this.client.call('post', path, {'content-type': 'application/json'}, return await this.client.call('post', path, {'content-type': 'application/json'},
{ {
'redirect': redirect 'confirmation': confirmation
}); });
} }
} }

View file

@ -10,7 +10,7 @@ POST https://appwrite.test/v1/auth/login
Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL&#039;s are the once from domains you have set when added your platforms in the console interface. Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL&#039;s are the once from domains you have set when added your platforms in the console interface.
When not using the success or failure redirect arguments this endpoint will result with a 200 status code and the user account object on success and with 401 status error on failure. This behavior was applied to help the web clients deal with browsers who don&#039;t allow to set 3rd party HTTP cookies needed for saving the account session token. ** When accessing this route using Javascript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch request to protect user privacy. **
### Parameters ### Parameters
@ -85,7 +85,7 @@ POST https://appwrite.test/v1/auth/recovery
| Field Name | Type | Description | Default | | Field Name | Type | Description | Default |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| email | string | User account email address. | | | email | string | User account email address. | |
| redirect | string | Reset page in your app to redirect user after reset token has been sent to user email. | | | confirmation | string | Reset page URL in your app to redirect user after reset token has been sent to user email. | |
## Password Reset ## Password Reset
@ -114,11 +114,11 @@ POST https://appwrite.test/v1/auth/register
** Use this endpoint to allow a new user to register an account in your project. Use the success and failure URL&#039;s to redirect users back to your application after signup completes. ** Use this endpoint to allow a new user to register an account in your project. Use the success and failure URL&#039;s to redirect users back to your application after signup completes.
If registration completes successfully user will be sent with a confirmation email in order to confirm he is the owner of the account email address. Use the redirect parameter to redirect the user from the confirmation email back to your app. When the user is redirected, use the /auth/confirm endpoint to complete the account confirmation. If registration completes successfully user will be sent with a confirmation email in order to confirm he is the owner of the account email address. Use the confirmation parameter to redirect the user from the confirmation email back to your app. When the user is redirected, use the /auth/confirm endpoint to complete the account confirmation.
Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL&#039;s are the once from domains you have set when added your platforms in the console interface. Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL&#039;s are the once from domains you have set when added your platforms in the console interface.
When not using the success or failure redirect arguments this endpoint will result with a 200 status code and the user account object on success and with 401 status error on failure. This behavior was applied to help the web clients deal with browsers who don&#039;t allow to set 3rd party HTTP cookies needed for saving the account session token. ** When accessing this route using Javascript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch request to protect user privacy. **
### Parameters ### Parameters
@ -126,7 +126,7 @@ When not using the success or failure redirect arguments this endpoint will resu
| --- | --- | --- | --- | | --- | --- | --- | --- |
| email | string | Account email | | | email | string | Account email | |
| password | string | User password | | | password | string | User password | |
| redirect | string | Confirmation page to redirect user after confirm token has been sent to user email | | | confirmation | string | Confirmation URL to redirect user after confirm token has been sent to user email | |
| success | string | Redirect when registration succeed | | | success | string | Redirect when registration succeed | |
| failure | string | Redirect when registration failed | | | failure | string | Redirect when registration failed | |
| name | string | User name | | | name | string | User name | |
@ -160,5 +160,5 @@ Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWA
| Field Name | Type | Description | Default | | Field Name | Type | Description | Default |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| redirect | string | Confirmation page to redirect user to your app after confirm token has been sent to user email. | | | confirmation | string | Confirmation page to redirect user to your app after confirm token has been sent to user email. | |

View file

@ -12,4 +12,4 @@ $client
$auth = new Auth($client); $auth = new Auth($client);
$result = $auth->register('email@example.com', 'password', 'https://example.com', 'https://example.com', 'https://example.com'); $result = $auth->register('email@example.com', 'password', 'https://example.com');

View file

@ -12,4 +12,4 @@ $client
$projects = new Projects($client); $projects = new Projects($client);
$result = $projects->createTask('[PROJECT_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com'); $result = $projects->createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com');

View file

@ -12,4 +12,4 @@ $client
$projects = new Projects($client); $projects = new Projects($client);
$result = $projects->updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com'); $result = $projects->updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com');

View file

@ -20,11 +20,11 @@ class Auth extends Service
* the only valid redirect URL's are the once from domains you have set when * the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface. * added your platforms in the console interface.
* *
* When not using the success or failure redirect arguments this endpoint will * When accessing this route using Javascript from the browser, success and
* result with a 200 status code and the user account object on success and * failure parameter URLs are required. Appwrite server will respond with a
* with 401 status error on failure. This behavior was applied to help the web * 301 redirect status code and will set the user session cookie. This
* clients deal with browsers who don't allow to set 3rd party HTTP cookies * behavior is enforced because modern browsers are limiting 3rd party cookies
* needed for saving the account session token. * in XHR of fetch request to protect user privacy.
* *
* @param string $email * @param string $email
* @param string $password * @param string $password
@ -142,17 +142,17 @@ class Auth extends Service
* process. * process.
* *
* @param string $email * @param string $email
* @param string $redirect * @param string $confirmation
* @throws Exception * @throws Exception
* @return array * @return array
*/ */
public function recovery($email, $redirect) public function recovery($email, $confirmation)
{ {
$path = str_replace([], [], '/auth/recovery'); $path = str_replace([], [], '/auth/recovery');
$params = []; $params = [];
$params['email'] = $email; $params['email'] = $email;
$params['redirect'] = $redirect; $params['confirmation'] = $confirmation;
return $this->client->call(Client::METHOD_POST, $path, [ return $this->client->call(Client::METHOD_POST, $path, [
], $params); ], $params);
@ -201,7 +201,7 @@ class Auth extends Service
* *
* If registration completes successfully user will be sent with a * If registration completes successfully user will be sent with a
* confirmation email in order to confirm he is the owner of the account email * confirmation email in order to confirm he is the owner of the account email
* address. Use the redirect parameter to redirect the user from the * address. Use the confirmation parameter to redirect the user from the
* confirmation email back to your app. When the user is redirected, use the * confirmation email back to your app. When the user is redirected, use the
* /auth/confirm endpoint to complete the account confirmation. * /auth/confirm endpoint to complete the account confirmation.
* *
@ -210,29 +210,29 @@ class Auth extends Service
* the only valid redirect URL's are the once from domains you have set when * the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface. * added your platforms in the console interface.
* *
* When not using the success or failure redirect arguments this endpoint will * When accessing this route using Javascript from the browser, success and
* result with a 200 status code and the user account object on success and * failure parameter URLs are required. Appwrite server will respond with a
* with 401 status error on failure. This behavior was applied to help the web * 301 redirect status code and will set the user session cookie. This
* clients deal with browsers who don't allow to set 3rd party HTTP cookies * behavior is enforced because modern browsers are limiting 3rd party cookies
* needed for saving the account session token. * in XHR of fetch request to protect user privacy.
* *
* @param string $email * @param string $email
* @param string $password * @param string $password
* @param string $redirect * @param string $confirmation
* @param string $success * @param string $success
* @param string $failure * @param string $failure
* @param string $name * @param string $name
* @throws Exception * @throws Exception
* @return array * @return array
*/ */
public function register($email, $password, $redirect, $success, $failure, $name = '') public function register($email, $password, $confirmation, $success = '', $failure = '', $name = '')
{ {
$path = str_replace([], [], '/auth/register'); $path = str_replace([], [], '/auth/register');
$params = []; $params = [];
$params['email'] = $email; $params['email'] = $email;
$params['password'] = $password; $params['password'] = $password;
$params['redirect'] = $redirect; $params['confirmation'] = $confirmation;
$params['success'] = $success; $params['success'] = $success;
$params['failure'] = $failure; $params['failure'] = $failure;
$params['name'] = $name; $params['name'] = $name;
@ -278,16 +278,16 @@ class Auth extends Service
* the only valid redirect URL's are the once from domains you have set when * the only valid redirect URL's are the once from domains you have set when
* added your platforms in the console interface. * added your platforms in the console interface.
* *
* @param string $redirect * @param string $confirmation
* @throws Exception * @throws Exception
* @return array * @return array
*/ */
public function confirmResend($redirect) public function confirmResend($confirmation)
{ {
$path = str_replace([], [], '/auth/register/confirm/resend'); $path = str_replace([], [], '/auth/register/confirm/resend');
$params = []; $params = [];
$params['redirect'] = $redirect; $params['confirmation'] = $confirmation;
return $this->client->call(Client::METHOD_POST, $path, [ return $this->client->call(Client::METHOD_POST, $path, [
], $params); ], $params);

View file

@ -60,13 +60,13 @@ class Auth(Service):
return self.client.call('get', path, { return self.client.call('get', path, {
}, params) }, params)
def recovery(self, email, redirect): def recovery(self, email, confirmation):
"""Password Recovery""" """Password Recovery"""
params = {} params = {}
path = '/auth/recovery' path = '/auth/recovery'
params['email'] = email params['email'] = email
params['redirect'] = redirect params['confirmation'] = confirmation
return self.client.call('post', path, { return self.client.call('post', path, {
}, params) }, params)
@ -84,14 +84,14 @@ class Auth(Service):
return self.client.call('put', path, { return self.client.call('put', path, {
}, params) }, params)
def register(self, email, password, redirect, success, failure, name=''): def register(self, email, password, confirmation, success='', failure='', name=''):
"""Register User""" """Register User"""
params = {} params = {}
path = '/auth/register' path = '/auth/register'
params['email'] = email params['email'] = email
params['password'] = password params['password'] = password
params['redirect'] = redirect params['confirmation'] = confirmation
params['success'] = success params['success'] = success
params['failure'] = failure params['failure'] = failure
params['name'] = name params['name'] = name
@ -110,12 +110,12 @@ class Auth(Service):
return self.client.call('post', path, { return self.client.call('post', path, {
}, params) }, params)
def confirm_resend(self, redirect): def confirm_resend(self, confirmation):
"""Resend Confirmation""" """Resend Confirmation"""
params = {} params = {}
path = '/auth/register/confirm/resend' path = '/auth/register/confirm/resend'
params['redirect'] = redirect params['confirmation'] = confirmation
return self.client.call('post', path, { return self.client.call('post', path, {
}, params) }, params)

View file

@ -63,12 +63,12 @@ module Appwrite
}, params); }, params);
end end
def recovery(email:, redirect:) def recovery(email:, confirmation:)
path = '/auth/recovery' path = '/auth/recovery'
params = { params = {
'email': email, 'email': email,
'redirect': redirect 'confirmation': confirmation
} }
return @client.call('post', path, { return @client.call('post', path, {
@ -89,13 +89,13 @@ module Appwrite
}, params); }, params);
end end
def register(email:, password:, redirect:, success:, failure:, name: '') def register(email:, password:, confirmation:, success: '', failure: '', name: '')
path = '/auth/register' path = '/auth/register'
params = { params = {
'email': email, 'email': email,
'password': password, 'password': password,
'redirect': redirect, 'confirmation': confirmation,
'success': success, 'success': success,
'failure': failure, 'failure': failure,
'name': name 'name': name
@ -117,11 +117,11 @@ module Appwrite
}, params); }, params);
end end
def confirm_resend(redirect:) def confirm_resend(confirmation:)
path = '/auth/register/confirm/resend' path = '/auth/register/confirm/resend'
params = { params = {
'redirect': redirect 'confirmation': confirmation
} }
return @client.call('post', path, { return @client.call('post', path, {

View file

@ -36,7 +36,7 @@ $cli
$clients = [ $clients = [
'php' => [ 'php' => [
'version' => 'v1.0.7', 'version' => '1.0.8',
'result' => __DIR__.'/../sdks/php/', 'result' => __DIR__.'/../sdks/php/',
'gitURL' => 'https://github.com/appwrite/sdk-for-php.git', 'gitURL' => 'https://github.com/appwrite/sdk-for-php.git',
'gitRepo' => 'git@github.com:appwrite/sdk-for-php.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-php.git',
@ -46,7 +46,7 @@ $cli
'platform' => 'server', 'platform' => 'server',
], ],
'js' => [ 'js' => [
'version' => 'v1.0.20', 'version' => '1.0.21',
'result' => __DIR__.'/../sdks/js/', 'result' => __DIR__.'/../sdks/js/',
'gitURL' => 'https://github.com/appwrite/sdk-for-js.git', 'gitURL' => 'https://github.com/appwrite/sdk-for-js.git',
'gitRepo' => 'git@github.com:appwrite/sdk-for-js.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-js.git',
@ -56,7 +56,7 @@ $cli
'platform' => 'client', 'platform' => 'client',
], ],
'node' => [ 'node' => [
'version' => 'v1.0.24', 'version' => '1.0.25',
'result' => __DIR__.'/../sdks/node/', 'result' => __DIR__.'/../sdks/node/',
'gitURL' => 'https://github.com/appwrite/sdk-for-node.git', 'gitURL' => 'https://github.com/appwrite/sdk-for-node.git',
'gitRepo' => 'git@github.com:appwrite/sdk-for-node.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-node.git',
@ -66,7 +66,7 @@ $cli
'platform' => 'server', 'platform' => 'server',
], ],
'python' => [ 'python' => [
'version' => 'v1.0.0', 'version' => '1.0.0',
'result' => __DIR__.'/../sdks/python/', 'result' => __DIR__.'/../sdks/python/',
'gitURL' => 'https://github.com/appwrite/sdk-for-python.git', 'gitURL' => 'https://github.com/appwrite/sdk-for-python.git',
'gitRepo' => 'git@github.com:appwrite/sdk-for-python.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-python.git',
@ -76,7 +76,7 @@ $cli
'platform' => 'server', 'platform' => 'server',
], ],
'ruby' => [ 'ruby' => [
'version' => 'v1.0.0', 'version' => '1.0.1',
'result' => __DIR__.'/../sdks/ruby/', 'result' => __DIR__.'/../sdks/ruby/',
'gitURL' => 'https://github.com/appwrite/sdk-for-ruby.git', 'gitURL' => 'https://github.com/appwrite/sdk-for-ruby.git',
'gitRepo' => 'git@github.com:appwrite/sdk-for-ruby.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-ruby.git',
@ -86,7 +86,7 @@ $cli
'platform' => 'server', 'platform' => 'server',
], ],
'dart' => [ 'dart' => [
'version' => '0.0.1', 'version' => '0.0.2',
'result' => __DIR__.'/../sdks/dart/', 'result' => __DIR__.'/../sdks/dart/',
'gitURL' => 'https://github.com/appwrite/sdk-for-dart', 'gitURL' => 'https://github.com/appwrite/sdk-for-dart',
'gitRepo' => 'git@github.com:appwrite/sdk-for-dart.git', 'gitRepo' => 'git@github.com:appwrite/sdk-for-dart.git',