Skip to content

Commit c6e5ca6

Browse files
authored
Merge pull request #397 from Spencer17x/sms-typing
fix: 添加sms typing
2 parents b01cf4c + 55ec974 commit c6e5ca6

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
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

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 {
@@ -918,3 +920,75 @@ export declare namespace rs {
918920
uploadToken(mac?: auth.digest.Mac): string;
919921
}
920922
}
923+
924+
export declare namespace sms {
925+
namespace message {
926+
/**
927+
* 发送短信 (POST Message)
928+
* @link https://developer.qiniu.com/sms/5897/sms-api-send-message#1
929+
* @param reqBody
930+
* @param mac
931+
* @param callback
932+
*/
933+
function sendMessage(
934+
reqBody: {
935+
"template_id": string,
936+
"mobiles": string[],
937+
"parameters"?: Record<string, string>
938+
},
939+
mac: auth.digest.Mac,
940+
callback: Callback<{ job_id: string }>
941+
): void;
942+
943+
/**
944+
* 发送单条短信 (POST Single Message)
945+
* @link https://developer.qiniu.com/sms/5897/sms-api-send-message#2
946+
* @param reqBody
947+
* @param mac
948+
* @param callback
949+
*/
950+
function sendSingleMessage(
951+
reqBody: {
952+
"template_id": string,
953+
"mobile": string,
954+
"parameters"?: Record<string, string>
955+
},
956+
mac: auth.digest.Mac,
957+
callback: Callback<{ message_id: string }>
958+
): void;
959+
960+
/**
961+
* 发送国际/港澳台短信 (POST Oversea Message)
962+
* @link https://developer.qiniu.com/sms/5897/sms-api-send-message#3
963+
* @param reqBody
964+
* @param mac
965+
* @param callback
966+
*/
967+
function sendOverseaMessage(
968+
reqBody: {
969+
"template_id": string,
970+
"mobile": string,
971+
"parameters"?: Record<string, string>
972+
},
973+
mac: auth.digest.Mac,
974+
callback: Callback<{ message_id: string }>
975+
): void;
976+
977+
/**
978+
* 发送全文本短信(不需要传模版 ID) (POST Fulltext Message)
979+
* @link https://developer.qiniu.com/sms/5897/sms-api-send-message#4
980+
* @param reqBody
981+
* @param mac
982+
* @param callback
983+
*/
984+
function sendFulltextMessage(
985+
reqBody: {
986+
"mobiles": string[],
987+
"content": string,
988+
"template_type": string
989+
},
990+
mac: auth.digest.Mac,
991+
callback: Callback<{ job_id: string }>
992+
): void;
993+
}
994+
}

0 commit comments

Comments
 (0)