node-sens
Version:
Simple & Easy Notification Service client in NAVER CLOUD PLATFORM
61 lines (60 loc) • 1.49 kB
TypeScript
export declare type NCPClientOptions = {
phoneNumber: string;
serviceId: string;
secretKey: string;
accessKey: string;
};
export declare type sendSMSType = {
to: string;
content: string;
countryCode?: string;
};
export declare type sendSMSReturnType = {
success: boolean;
msg: string;
status: number;
};
export declare type prepareSignatureReturnType = {
timestamp: string;
signature: string;
};
export declare class NCPClient {
private phoneNumber;
private serviceId;
private secretKey;
private accessKey;
private url;
private method;
/**
*
* Constructs an instance of NCPClient.
*
* @param phoneNumber 발신 전화번호
*
* @param serviceId 프로젝트의 서비스 id
*
* @param secretKey 프로젝트 계정의 secretKey
*
* @param accessKey 프로젝트 계정의 accessKey
*/
constructor(options: NCPClientOptions);
/**
*
* SMS를 보내는 함수
*
* @param to 수신 전화번호
* @param content 전달할 내용
* @param countryCode 국가 코드 (default 82)
*
* @returns Promise with success(boolean), msg(string), status(number)
*
*/
sendSMS({ to, content, countryCode }: sendSMSType): Promise<sendSMSReturnType>;
/**
*
* API 시그니처를 생성하는 함수
*
* @returns timestamp(string), signature(string)
*/
private prepareSignature;
}