Cloud

AV. Cloud

Source:
Contains functions for calling and declaring

Some functions are only available from Cloud Code.

Members

(static) requestCaptcha

Source:
Request a captcha.

Methods

(static) getServerDate() → {Promise.<Date>}

Source:
Since:
  • 0.5.9
Make a call to request server date time.
Returns:
A promise that will be resolved with the result of the function.
Type
Promise.<Date>

(static) requestCaptcha(optionsopt) → {Promise.<AV.Captcha>}

Source:
Request a captcha
Parameters:
Name Type Attributes Description
options <optional>
Properties
Name Type Attributes Default Description
width Number <optional>
width(px) of the captcha, ranged 60-200
height Number <optional>
height(px) of the captcha, ranged 30-100
size Number <optional>
4 length of the captcha, ranged 3-6. MasterKey required.
ttl Number <optional>
60 time to live(s), ranged 10-180. MasterKey required.
Returns:
Type
Promise.<AV.Captcha>

(static) requestSmsCode(data, optionsopt) → {Promise}

Source:
Makes a call to request an sms code for operation verification.
Parameters:
Name Type Attributes Description
data String | Object The mobile phone number string or a JSON object that contains mobilePhoneNumber,template,sign,op,ttl,name etc.
Properties
Name Type Attributes Description
mobilePhoneNumber String
template String <optional>
sms template name
sign String <optional>
sms signature name
smsType String <optional>
sending code by `sms` (default) or `voice` call
options SMSAuthOptions <optional>
Returns:
A promise that will be resolved if the request succeed
Type
Promise

(static) rpc(name, dataopt, optionsopt) → {Promise}

Source:
Makes a call to a cloud function, you can send {AV.Object} as param or a field of param; the response from server will also be parsed as an {AV.Object}, array of {AV.Object}, or object includes {AV.Object}
Parameters:
Name Type Attributes Description
name String The function name.
data Object <optional>
The parameters to send to the cloud function.
options AuthOptions <optional>
Returns:
A promise that will be resolved with the result of the function.
Type
Promise

(static) run(name, dataopt, optionsopt) → {Promise}

Source:
Makes a call to a cloud function.
Parameters:
Name Type Attributes Description
name String The function name.
data Object <optional>
The parameters to send to the cloud function.
options AuthOptions <optional>
Returns:
A promise that will be resolved with the result of the function.
Type
Promise

(static) useMasterKey()

Source:
Switches the LeanCloud SDK to using the Master key. The Master key grants priveleged access to the data in LeanCloud and can be used to bypass ACLs and other restrictions that are applied to the client SDKs.

Available in Cloud Code and Node.js only.

(static) verifyCaptcha(code, captchaToken) → {Promise.<String>}

Source:
Verify captcha code. This is the low-level API for captcha. Checkout AV.Captcha for high abstract APIs.
Parameters:
Name Type Description
code String the code from user input
captchaToken String captchaToken returned by AV.Cloud.requestCaptcha
Returns:
validateToken if the code is valid
Type
Promise.<String>

(static) verifySmsCode(code, phone) → {Promise}

Source:
Makes a call to verify sms code that sent by AV.Cloud.requestSmsCode
Parameters:
Name Type Description
code String The sms code sent by AV.Cloud.requestSmsCode
phone phone The mobile phoner number.
Returns:
A promise that will be resolved with the result of the function.
Type
Promise