Skip to content

Commit 62ceb5b

Browse files
committed
Updated docs.
1 parent fba3739 commit 62ceb5b

File tree

2 files changed

+80
-3
lines changed

2 files changed

+80
-3
lines changed

lib/av.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@
13751375

13761376
/**
13771377
* Call this method to set production environment variable.
1378-
* @param {Boolean} production, true is production environment,and
1378+
* @param {Boolean} production True is production environment,and
13791379
* it's true by default.
13801380
*/
13811381
AV.setProduction = function(production){
@@ -4167,7 +4167,7 @@
41674167

41684168
/**
41694169
* Creates a file object with exists objectId.
4170-
* @param {String} The objectId string
4170+
* @param {String} objectId The objectId string
41714171
* @return {AV.File} the file object
41724172
*/
41734173
AV.File.createWithoutData = function(objectId){
@@ -9016,6 +9016,7 @@
90169016
/**
90179017
* Makes a call to verify sms code that sent by AV.Cloud.requestSmsCode
90189018
* @param {String} code The sms code sent by AV.Cloud.requestSmsCode
9019+
* @param {phone} phone The mobile phoner number(optional).
90199020
* @param {Object} options A Backbone-style options object
90209021
* @return {AV.Promise} A promise that will be resolved with the result
90219022
* of the function.

lib/av_merged.js

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,21 @@
13591359
AV._initialize(applicationId, applicationKey,masterKey);
13601360
};
13611361

1362+
/**
1363+
* Call this method to set production environment variable.
1364+
* @param {Boolean} production True is production environment,and
1365+
* it's true by default.
1366+
*/
1367+
AV.setProduction = function(production){
1368+
if(!AV._isNullOrUndefined(production)) {
1369+
//make sure it's a number
1370+
production = production ? 1 : 0;
1371+
}
1372+
//default is 1
1373+
AV.applicationProduction = AV._isNullOrUndefined(production) ? 1: production;
1374+
}
1375+
1376+
13621377
/**
13631378
* Call this method first to set up authentication tokens for AV.
13641379
* This method is for AV's own private use.
@@ -4126,8 +4141,40 @@
41264141
return file;
41274142
};
41284143

4144+
/**
4145+
* Creates a file object with exists objectId.
4146+
* @param {String} objectId The objectId string
4147+
* @return {AV.File} the file object
4148+
*/
4149+
AV.File.createWithoutData = function(objectId){
4150+
var file = new AV.File();
4151+
file.id = objectId;
4152+
return file;
4153+
};
4154+
4155+
41294156
AV.File.prototype = {
41304157

4158+
/**
4159+
* Returns the ACL for this file.
4160+
* @returns {AV.ACL} An instance of AV.ACL.
4161+
*/
4162+
getACL: function() {
4163+
return this._acl;
4164+
},
4165+
4166+
/**
4167+
* Sets the ACL to be used for this file.
4168+
* @param {AV.ACL} acl An instance of AV.ACL.
4169+
*/
4170+
setACL: function(acl) {
4171+
if(!(acl instanceof AV.ACL)) {
4172+
return new AV.Error(AV.Error.OTHER_CAUSE,
4173+
"ACL must be a AV.ACL.");
4174+
}
4175+
this._acl = acl;
4176+
},
4177+
41314178
/**
41324179
* Gets the name of the file. Before save is called, this is the filename
41334180
* given by the user. After save is called, that name gets prefixed with a
@@ -7342,6 +7389,34 @@
73427389
return query;
73437390
};
73447391

7392+
/**
7393+
* Constructs a AV.Query that is the AND of the passed in queries. For
7394+
* example:
7395+
* <pre>var compoundQuery = AV.Query.and(query1, query2, query3);</pre>
7396+
*
7397+
* will create a compoundQuery that is an 'and' of the query1, query2, and
7398+
* query3.
7399+
* @param {...AV.Query} var_args The list of queries to AND.
7400+
* @return {AV.Query} The query that is the AND of the passed in queries.
7401+
*/
7402+
AV.Query.and = function() {
7403+
var queries = _.toArray(arguments);
7404+
var className = null;
7405+
AV._arrayEach(queries, function(q) {
7406+
if (_.isNull(className)) {
7407+
className = q.className;
7408+
}
7409+
7410+
if (className !== q.className) {
7411+
throw "All queries must be for the same class";
7412+
}
7413+
});
7414+
var query = new AV.Query(className);
7415+
query._andQuery(queries);
7416+
return query;
7417+
};
7418+
7419+
73457420
/**
73467421
* Retrieves a list of AVObjects that satisfy the CQL.
73477422
* CQL syntax please see <a href='https://cn.avoscloud.com/docs/cql_guide.html'>CQL Guide.</a>
@@ -8923,11 +8998,12 @@
89238998
/**
89248999
* Makes a call to verify sms code that sent by AV.Cloud.requestSmsCode
89259000
* @param {String} code The sms code sent by AV.Cloud.requestSmsCode
9001+
* @param {phone} phone The mobile phoner number(optional).
89269002
* @param {Object} options A Backbone-style options object
89279003
* @return {AV.Promise} A promise that will be resolved with the result
89289004
* of the function.
89299005
*/
8930-
verifySmsCode: function(code, options){
9006+
verifySmsCode: function(code, phone, options){
89319007
if(!code)
89329008
throw "Missing sms code.";
89339009
var request = AV._request("verifySmsCode", code, null, 'POST',

0 commit comments

Comments
 (0)