Skip to content

Commit 48550f0

Browse files
committed
Added api docs.
1 parent bd8b97a commit 48550f0

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

lib/av.js

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7106,12 +7106,41 @@
71067106
return user.logIn(options);
71077107
},
71087108

7109+
/**
7110+
* Logs in a user with a mobile phone number and sms code sent by
7111+
* AV.User.requestLoginSmsCode.On success, this
7112+
* saves the session to disk, so you can retrieve the currently logged in
7113+
* user using <code>current</code>.
7114+
*
7115+
* <p>Calls options.success or options.error on completion.</p>
7116+
*
7117+
* @param {String} mobilePhone The user's mobilePhoneNumber
7118+
* @param {String} smsCode The sms code sent by AV.User.requestLoginSmsCode
7119+
* @param {Object} options A Backbone-style options object.
7120+
* @return {AV.Promise} A promise that is fulfilled with the user when
7121+
* the login completes.
7122+
* @see AV.User#logIn
7123+
*/
71097124
logInWithMobilePhoneSmsCode: function(mobilePhone, smsCode, options){
71107125
var user = AV.Object._create("_User");
71117126
user._finishFetch({ mobilePhoneNumber: mobilePhone, smsCode: smsCode });
71127127
return user.logIn(options);
71137128
},
71147129

7130+
/**
7131+
* Logs in a user with a mobile phone number and password. On success, this
7132+
* saves the session to disk, so you can retrieve the currently logged in
7133+
* user using <code>current</code>.
7134+
*
7135+
* <p>Calls options.success or options.error on completion.</p>
7136+
*
7137+
* @param {String} mobilePhone The user's mobilePhoneNumber
7138+
* @param {String} password The password to log in with.
7139+
* @param {Object} options A Backbone-style options object.
7140+
* @return {AV.Promise} A promise that is fulfilled with the user when
7141+
* the login completes.
7142+
* @see AV.User#logIn
7143+
*/
71157144
logInWithMobilePhone: function(mobilePhone, password, options){
71167145
var user = AV.Object._create("_User");
71177146
user._finishFetch({ mobilePhoneNumber: mobilePhone, password: password });
@@ -7182,26 +7211,67 @@
71827211
return request._thenRunCallbacks(options);
71837212
},
71847213

7214+
/**
7215+
* Requests a verify email to be sent to the specified email address
7216+
* associated with the user account. This email allows the user to securely
7217+
* verify their email address on the AV site.
7218+
*
7219+
* <p>Calls options.success or options.error on completion.</p>
7220+
*
7221+
* @param {String} email The email address associated with the user that
7222+
* doesn't verify their email address.
7223+
* @param {Object} options A Backbone-style options object.
7224+
*/
71857225
requestEmailVerfiyInBackground: function(email, options) {
71867226
var json = { email: email };
71877227
var request = AV._request("requestEmailVerify", null, null, "POST",
71887228
json);
71897229
return request._thenRunCallbacks(options);
71907230
},
71917231

7232+
/**
7233+
* Requests a verify sms code to be sent to the specified mobile phone
7234+
* number associated with the user account. This sms code allows the user to
7235+
* verify their mobile phone number by calling AV.User.verifyMobilePhone
7236+
*
7237+
* <p>Calls options.success or options.error on completion.</p>
7238+
*
7239+
* @param {String} mobilePhone The mobile phone number associated with the
7240+
* user that doesn't verify their mobile phone number.
7241+
* @param {Object} options A Backbone-style options object.
7242+
*/
71927243
requestMobilePhoneVerify: function(mobilePhone, options){
71937244
var json = { mobilePhoneNumber: mobilePhone };
71947245
var request = AV._request("requestMobilePhoneVerify", null, null, "POST",
71957246
json);
71967247
return request._thenRunCallbacks(options);
71977248
},
71987249

7250+
/**
7251+
* Makes a call to verify sms code that sent by AV.User.Cloud.requestSmsCode
7252+
* If verify successfully,the user mobilePhoneVerified attribute will be true.
7253+
* @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
7254+
* @param {Object} options A Backbone-style options object
7255+
* @return {AV.Promise} A promise that will be resolved with the result
7256+
* of the function.
7257+
*/
71997258
verifyMobilePhone: function(code, options){
72007259
var request = AV._request("verifyMobilePhone", null, code, "POST",
72017260
json);
72027261
return request._thenRunCallbacks(options);
72037262
},
72047263

7264+
/**
7265+
* Requests a logIn sms code to be sent to the specified mobile phone
7266+
* number associated with the user account. This sms code allows the user to
7267+
* login by AV.User.logInWithMobilePhoneSmsCode function.
7268+
*
7269+
* <p>Calls options.success or options.error on completion.</p>
7270+
*
7271+
* @param {String} mobilePhone The mobile phone number associated with the
7272+
* user that want to login by AV.User.logInWithMobilePhoneSmsCode
7273+
* @param {Object} options A Backbone-style options object.
7274+
*/
72057275
requestLoginSmsCode: function(mobilePhone, options){
72067276
var json = { mobilePhoneNumber: mobilePhone };
72077277
var request = AV._request("requestLoginSmsCode", null, null, "POST",
@@ -8727,6 +8797,13 @@
87278797
})._thenRunCallbacks(options);
87288798
},
87298799

8800+
/**
8801+
* Makes a call to request a sms code for operation verification.
8802+
* @param {Object} data The mobile phone number string or a JSON object contains mobilePhoneNumber,op,ttl,name etc.
8803+
* @param {Object} options A Backbone-style options object
8804+
* @return {AV.Promise} A promise that will be resolved with the result
8805+
* of the function.
8806+
*/
87308807
requestSmsCode: function(data, options){
87318808
if(typeof data === 'string')
87328809
data = { mobilePhoneNumber: data };
@@ -8737,6 +8814,13 @@
87378814
return request._thenRunCallbacks(options);
87388815
},
87398816

8817+
/**
8818+
* Makes a call to verify sms code that sent by AV.Cloud.requestSmsCode
8819+
* @param {String} code The sms code sent by AV.Cloud.requestSmsCode
8820+
* @param {Object} options A Backbone-style options object
8821+
* @return {AV.Promise} A promise that will be resolved with the result
8822+
* of the function.
8823+
*/
87408824
verifySmsCode: function(code, options){
87418825
if(!code)
87428826
throw "Missing sms code.";

0 commit comments

Comments
 (0)