Skip to content

Commit 37e1c82

Browse files
Add faxOptions
1 parent 7a5b81c commit 37e1c82

4 files changed

Lines changed: 77 additions & 12 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"sdk",
1212
"korean sms"
1313
],
14-
"homepage": "https://solapi.github.io/solapi-nodejs",
14+
"homepage": "https://solapi.com",
1515
"bugs": {
1616
"url": "https://github.com/solapi/solapi-nodejs/issues"
1717
},
@@ -28,7 +28,7 @@
2828
"source": "src/solapi.ts",
2929
"main": "dist/index.js",
3030
"types": "dist/index.d.ts",
31-
"module": "dist/index.mjs",
31+
"module": "dist/index.module.js",
3232
"files": [
3333
"/dist"
3434
],

src/models/message.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {KakaoOption, kakaoOptionRequest} from './kakao/kakaoOption';
22
import {RcsOption, RcsOptionRequest} from './rcs/rcsOption';
3+
import {FileIds} from '../requests/messageRequest';
34

45
/**
56
* @name MessageType 메시지 유형(단문 문자, 장문 문자, 알림톡 등)
@@ -9,11 +10,15 @@ import {RcsOption, RcsOptionRequest} from './rcs/rcsOption';
910
* ATA: 알림톡
1011
* CTA: 친구톡
1112
* CTI: 사진 한장이 포함된 친구톡
13+
* NSA: 네이버 스마트알림(톡톡)
1214
* RCS_SMS: RCS 단문 문자
1315
* RCS_LMS: RCS 장문 문자
1416
* RCS_MMS: RCS 사진 문자
1517
* RCS_TPL: RCS 템플릿
16-
* NSA: 네이버 스마트알림(톡톡)
18+
* RCS_ITPL: RCS 이미지 템플릿
19+
* RCS_LTPL: RCS LMS 템플릿 문자
20+
* FAX: 팩스
21+
* VOICE: 음성문자(TTS)
1722
*/
1823
export type MessageType =
1924
| 'SMS'
@@ -22,11 +27,15 @@ export type MessageType =
2227
| 'ATA'
2328
| 'CTA'
2429
| 'CTI'
30+
| 'NSA'
2531
| 'RCS_SMS'
2632
| 'RCS_LMS'
2733
| 'RCS_MMS'
2834
| 'RCS_TPL'
29-
| 'NSA';
35+
| 'RCS_ITPL'
36+
| 'RCS_LTPL'
37+
| 'FAX'
38+
| 'VOICE';
3039

3140
export type MessageParameter = {
3241
to: string | Array<string>;
@@ -41,6 +50,7 @@ export type MessageParameter = {
4150
country?: string;
4251
customFields?: Record<string, string>;
4352
replacements?: Array<object>;
53+
faxOptions?: FileIds;
4454
};
4555

4656
/**
@@ -135,6 +145,8 @@ export class Message {
135145
*/
136146
customFields?: Record<string, string>;
137147

148+
faxOptions?: FileIds;
149+
138150
constructor(parameter: MessageParameter) {
139151
this.to = parameter.to;
140152
this.from = parameter.from;
@@ -152,6 +164,6 @@ export class Message {
152164
}
153165
this.customFields = parameter.customFields;
154166
this.replacements = parameter.replacements;
167+
this.faxOptions = parameter.faxOptions;
155168
}
156169
}
157-

src/models/rcs/rcsOption.ts

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,82 @@
11
import {RcsButton} from './rcsButton';
2+
3+
/**
4+
* RCS 사진문자 발송 시 필요한 오브젝트
5+
*/
26
export type AdditionalBody = {
7+
/**
8+
* 슬라이드 제목
9+
*/
310
title: string;
11+
/**
12+
* 슬라이드 설명
13+
*/
414
description: string;
15+
/**
16+
* MMS 발송 시 사용되는 이미지의 고유 아이디. 이미지 타입이 MMS일 경우에만 사용 가능합니다.
17+
* @see https://console.solapi.com/storage
18+
* @see https://developers.solapi.com/references/storage
19+
*/
520
imaggeId?: string;
21+
/**
22+
* 슬라이드에 추가되는 버튼 목록, 최대 2개
23+
*/
624
buttons?: Array<RcsButton>;
7-
}
25+
};
826

27+
/**
28+
* RCS 발송을 위한 파라미터 타입
29+
*/
930
export type RcsOptionRequest = {
31+
/**
32+
* RCS 채널의 브랜드 ID
33+
*/
1034
brandId: string;
35+
/**
36+
* RCS 템플릿 ID
37+
*/
1138
templateId?: string;
39+
/**
40+
* 문자 복사 가능 여부
41+
*/
1242
copyAllowed?: boolean;
13-
mmsType?: 'M3' | 'S3' | 'M4' | 'S4' | 'M5' | 'S5' | 'M6' | 'S6'; // (M: 중간 사이즈. S: 작은 사이즈. 숫자: 사진 개수)
14-
commercialType?: boolean;
43+
/**
44+
* RCS 템플릿 대체 문구 입력 오브젝트
45+
* 예) { #{치환문구1} : "치환문구 값" }
46+
*/
1547
variables?: Record<string, string>;
48+
/**
49+
* 사진 문자 타입. 타입: "M3", "S3", "M4", "S4", "M5", "S5", "M6", "S6" (M: 중간 사이즈. S: 작은 사이즈. 숫자: 사진 개수)
50+
*/
51+
mmsType?: 'M3' | 'S3' | 'M4' | 'S4' | 'M5' | 'S5' | 'M6' | 'S6';
52+
/**
53+
* 광고 문자 여부
54+
*/
55+
commercialType?: boolean;
56+
/**
57+
* 대체발송여부. false 로 설정했을 경우 해당건이 발송에 실패하게 됐을 때 문자로(SMS, LMS, MMS)로 대체 발송됩니다. 대체 발송이 될 경우 기존 가격은 환불되고 각 문자 타입에 맞는 금액이 차감됩니다. 기본값: false
58+
*/
1659
disableSms?: boolean;
60+
/**
61+
* RCS 사진 문자 전송 시 필요한 오브젝트
62+
*/
1763
additionalBody?: AdditionalBody;
18-
buttons: Array<RcsButton>;
64+
/**
65+
* RCS 템플릿 버튼 배열
66+
*/
67+
buttons?: Array<RcsButton>;
1968
};
2069

2170
export class RcsOption {
2271
brandId: string;
2372
templateId?: string;
2473
copyAllowed?: boolean;
74+
variables?: Record<string, string>;
2575
mmsType?: 'M3' | 'S3' | 'M4' | 'S4' | 'M5' | 'S5' | 'M6' | 'S6'; // (M: 중간 사이즈. S: 작은 사이즈. 숫자: 사진 개수)
2676
commercialType?: boolean;
27-
variables?: Record<string, string>;
2877
disableSms?: boolean;
2978
additionalBody?: AdditionalBody;
30-
buttons: Array<RcsButton>;
79+
buttons?: Array<RcsButton>;
3180

3281
constructor(parameter: RcsOptionRequest) {
3382
this.brandId = parameter.brandId;

src/requests/messageRequest.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ export type RequestConfig = {
115115
url: string;
116116
};
117117

118-
export type FileType = 'KAKAO' | 'MMS' | 'DOCUMENT' | 'RCS';
118+
export type FileIds = {
119+
fileIds: Array<string>;
120+
};
121+
122+
export type FileType = 'KAKAO' | 'MMS' | 'DOCUMENT' | 'RCS' | 'FAX';
119123

120124
export type FileUploadRequest = {
121125
file: string;

0 commit comments

Comments
 (0)