|
3 | 3 | * @date 2017-06-27 |
4 | 4 | * @author xialeistudio<[email protected]> |
5 | 5 | */ |
| 6 | +import { Callback } from 'urllib'; |
| 7 | + |
6 | 8 | export declare type callback = (e?: Error, respBody?: any, respInfo?: any) => void; |
7 | 9 |
|
8 | 10 | export declare namespace auth { |
@@ -967,3 +969,75 @@ export declare namespace rs { |
967 | 969 | uploadToken(mac?: auth.digest.Mac): string; |
968 | 970 | } |
969 | 971 | } |
| 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 | +} |
0 commit comments