Skip to content

Commit 0932f2e

Browse files
authored
Merge branch 'master' into features/add-x-qiniu-date
2 parents 3b2eee9 + df49490 commit 0932f2e

File tree

4 files changed

+79
-1
lines changed

4 files changed

+79
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ package-lock.json
2323

2424
coverage/
2525
.nyc_output/
26+
.idea
27+
yarn.lock

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## CHANGE LOG
22

3+
## 7.6.1
4+
- 添加sms typing
35

46
## 7.6.0
57
- 对象存储,新增 setObjectLifeCycle 设置对象生命周期 API

index.d.ts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* @date 2017-06-27
44
* @author xialeistudio<[email protected]>
55
*/
6+
import { Callback } from 'urllib';
7+
68
export declare type callback = (e?: Error, respBody?: any, respInfo?: any) => void;
79

810
export declare namespace auth {
@@ -967,3 +969,75 @@ export declare namespace rs {
967969
uploadToken(mac?: auth.digest.Mac): string;
968970
}
969971
}
972+
973+
export declare namespace sms {
974+
namespace message {
975+
/**
976+
* 发送短信 (POST Message)
977+
* @link https://developer.qiniu.com/sms/5897/sms-api-send-message#1
978+
* @param reqBody
979+
* @param mac
980+
* @param callback
981+
*/
982+
function sendMessage(
983+
reqBody: {
984+
"template_id": string,
985+
"mobiles": string[],
986+
"parameters"?: Record<string, string>
987+
},
988+
mac: auth.digest.Mac,
989+
callback: Callback<{ job_id: string }>
990+
): void;
991+
992+
/**
993+
* 发送单条短信 (POST Single Message)
994+
* @link https://developer.qiniu.com/sms/5897/sms-api-send-message#2
995+
* @param reqBody
996+
* @param mac
997+
* @param callback
998+
*/
999+
function sendSingleMessage(
1000+
reqBody: {
1001+
"template_id": string,
1002+
"mobile": string,
1003+
"parameters"?: Record<string, string>
1004+
},
1005+
mac: auth.digest.Mac,
1006+
callback: Callback<{ message_id: string }>
1007+
): void;
1008+
1009+
/**
1010+
* 发送国际/港澳台短信 (POST Oversea Message)
1011+
* @link https://developer.qiniu.com/sms/5897/sms-api-send-message#3
1012+
* @param reqBody
1013+
* @param mac
1014+
* @param callback
1015+
*/
1016+
function sendOverseaMessage(
1017+
reqBody: {
1018+
"template_id": string,
1019+
"mobile": string,
1020+
"parameters"?: Record<string, string>
1021+
},
1022+
mac: auth.digest.Mac,
1023+
callback: Callback<{ message_id: string }>
1024+
): void;
1025+
1026+
/**
1027+
* 发送全文本短信(不需要传模版 ID) (POST Fulltext Message)
1028+
* @link https://developer.qiniu.com/sms/5897/sms-api-send-message#4
1029+
* @param reqBody
1030+
* @param mac
1031+
* @param callback
1032+
*/
1033+
function sendFulltextMessage(
1034+
reqBody: {
1035+
"mobiles": string[],
1036+
"content": string,
1037+
"template_type": string
1038+
},
1039+
mac: auth.digest.Mac,
1040+
callback: Callback<{ job_id: string }>
1041+
): void;
1042+
}
1043+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "qiniu",
3-
"version": "7.6.0",
3+
"version": "7.6.1",
44
"description": "Node wrapper for Qiniu Resource (Cloud) Storage API",
55
"main": "index.js",
66
"directories": {

0 commit comments

Comments
 (0)