|
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 { |
@@ -918,3 +920,75 @@ export declare namespace rs { |
918 | 920 | uploadToken(mac?: auth.digest.Mac): string; |
919 | 921 | } |
920 | 922 | } |
| 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