Skip to content

Commit 24cc0de

Browse files
weakishleeyeh
andauthored
docs: refine requestSmsCode api doc & ts definition (#612)
and other minor changes (typos, zh -> en) Co-authored-by: Lee Yeh <[email protected]>
1 parent 5e550e5 commit 24cc0de

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/cloudfunction.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@ module.exports = function(AV) {
7777
},
7878

7979
/**
80-
* Makes a call to request a sms code for operation verification.
80+
* Makes a call to request an sms code for operation verification.
8181
* @param {String|Object} data The mobile phone number string or a JSON
8282
* object that contains mobilePhoneNumber,template,sign,op,ttl,name etc.
8383
* @param {String} data.mobilePhoneNumber
8484
* @param {String} [data.template] sms template name
8585
* @param {String} [data.sign] sms signature name
86+
* @param {String} [data.smsType] sending code by `sms` (default) or `voice` call
8687
* @param {SMSAuthOptions} [options]
8788
* @return {Promise} A promise that will be resolved if the request succeed
8889
*/

src/file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module.exports = function(AV) {
7171
* @param data {Array} The data for the file, as either:
7272
* 1. an Array of byte value Numbers, or
7373
* 2. an Object like { base64: "..." } with a base64-encoded String.
74-
* 3. a Blob(File) selected with a file upload control.
74+
* 3. a Blob(File) { blob: {uri: "..."} } selected with a file upload control.
7575
* 4. a Buffer in Node.js runtime.
7676
* 5. a Stream in Node.js runtime.
7777
*

src/user.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ module.exports = function(AV) {
932932
},
933933

934934
/**
935-
* 检查该用户的登录状态是否有效,请注意该方法会校验 sessionToken 的有效性,是个异步方法。
935+
* Detects if current sessionToken is valid.
936936
*
937937
* @since 2.0.0
938938
* @return Promise.<Boolean>
@@ -1104,7 +1104,7 @@ module.exports = function(AV) {
11041104
},
11051105

11061106
/**
1107-
* Sign up or logs in a user with a mobilePhoneNumber and smsCode.
1107+
* Signs up or logs in a user with a mobilePhoneNumber and smsCode.
11081108
* On success, this saves the session to disk, so you can retrieve the currently
11091109
* logged in user using <code>current</code>.
11101110
*
@@ -1169,7 +1169,7 @@ module.exports = function(AV) {
11691169
},
11701170

11711171
/**
1172-
* Sign up or logs in a user with a third party auth data(AccessToken).
1172+
* Signs up or logs in a user with a third party auth data(AccessToken).
11731173
* On success, this saves the session to disk, so you can retrieve the currently
11741174
* logged in user using <code>current</code>.
11751175
*
@@ -1206,7 +1206,7 @@ module.exports = function(AV) {
12061206
},
12071207

12081208
/**
1209-
* Sign up or logs in a user with a third party authData and unionId.
1209+
* Signs up or logs in a user with a third party authData and unionId.
12101210
* @since 3.7.0
12111211
* @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
12121212
* @param {string} platform Available platform for sign up.

storage.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ export namespace Cloud {
12201220
function requestSmsCode(
12211221
data:
12221222
| string
1223-
| { mobilePhoneNumber: string; template?: string; sign?: string },
1223+
| { mobilePhoneNumber: string; template?: string; sign?: string; smsType?: 'sms' | 'voice' },
12241224
options?: SMSAuthOptions
12251225
): Promise<void>;
12261226
function verifySmsCode(code: string, phone: string): Promise<void>;

0 commit comments

Comments
 (0)