@teamlearners/clawops 0.38.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -0
- package/dist/agent/index.cjs +77 -77
- package/dist/agent/index.js +4 -4
- package/dist/agent/livekit/index.cjs +9 -9
- package/dist/agent/livekit/index.js +2 -2
- package/dist/{chunk-EO25KTL4.js → chunk-AYSW63CJ.js} +3 -3
- package/dist/{chunk-EO25KTL4.js.map → chunk-AYSW63CJ.js.map} +1 -1
- package/dist/chunk-IEFCBBKV.cjs +8 -0
- package/dist/{chunk-NXCYAYFT.cjs.map → chunk-IEFCBBKV.cjs.map} +1 -1
- package/dist/{chunk-IYSPOOKH.cjs → chunk-MXEZQRIL.cjs} +2 -2
- package/dist/chunk-MXEZQRIL.cjs.map +1 -0
- package/dist/{chunk-ASQU6NA2.cjs → chunk-PO5ACGWL.cjs} +4 -4
- package/dist/{chunk-ASQU6NA2.cjs.map → chunk-PO5ACGWL.cjs.map} +1 -1
- package/dist/chunk-R6UEIVYE.js +6 -0
- package/dist/{chunk-J7UIB4EA.js.map → chunk-R6UEIVYE.js.map} +1 -1
- package/dist/{chunk-VYGIWHRU.js → chunk-SXXOAPMG.js} +2 -2
- package/dist/chunk-SXXOAPMG.js.map +1 -0
- package/dist/{client-ZOgpzAPe.d.cts → client-DOMZ2phc.d.cts} +301 -13
- package/dist/{client-ZOgpzAPe.d.ts → client-DOMZ2phc.d.ts} +301 -13
- package/dist/index.cjs +184 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +155 -14
- package/dist/index.js.map +1 -1
- package/dist/solapi/index.cjs +7 -7
- package/dist/solapi/index.d.cts +2 -2
- package/dist/solapi/index.d.ts +2 -2
- package/dist/solapi/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-IYSPOOKH.cjs.map +0 -1
- package/dist/chunk-J7UIB4EA.js +0 -6
- package/dist/chunk-NXCYAYFT.cjs +0 -8
- package/dist/chunk-VYGIWHRU.js.map +0 -1
|
@@ -18,14 +18,16 @@ declare class APIClient {
|
|
|
18
18
|
constructor(options: APIClientOptions);
|
|
19
19
|
private _buildHeaders;
|
|
20
20
|
protected _send(method: string, path: string, options?: {
|
|
21
|
-
|
|
21
|
+
/** `FormData` 면 그대로 보낸다(multipart) — 직렬화도 Content-Type 도 건드리지 않는다. */
|
|
22
|
+
body?: Record<string, unknown> | FormData | null;
|
|
22
23
|
query?: Record<string, unknown> | null;
|
|
23
24
|
extraHeaders?: Record<string, string>;
|
|
24
25
|
extraQuery?: Record<string, unknown>;
|
|
25
26
|
timeout?: number;
|
|
26
27
|
}): Promise<Response>;
|
|
27
28
|
protected _request<T>(method: string, path: string, options?: {
|
|
28
|
-
|
|
29
|
+
/** `FormData` 면 그대로 보낸다(multipart) — 직렬화도 Content-Type 도 건드리지 않는다. */
|
|
30
|
+
body?: Record<string, unknown> | FormData | null;
|
|
29
31
|
query?: Record<string, unknown> | null;
|
|
30
32
|
castTo?: z.ZodType<T>;
|
|
31
33
|
extraHeaders?: Record<string, string>;
|
|
@@ -43,7 +45,8 @@ declare class APIClient {
|
|
|
43
45
|
timeout?: number;
|
|
44
46
|
}): Promise<T>;
|
|
45
47
|
_post<T>(path: string, options: {
|
|
46
|
-
|
|
48
|
+
/** `FormData` 면 그대로 보낸다(multipart) — 직렬화도 Content-Type 도 건드리지 않는다. */
|
|
49
|
+
body?: Record<string, unknown> | FormData | null;
|
|
47
50
|
castTo: z.ZodType<T>;
|
|
48
51
|
extraHeaders?: Record<string, string>;
|
|
49
52
|
extraQuery?: Record<string, unknown>;
|
|
@@ -1042,6 +1045,116 @@ declare const KakaoTemplateSchema: z.ZodObject<{
|
|
|
1042
1045
|
updatedAt: z.ZodString;
|
|
1043
1046
|
}, z.ZodTypeAny, "passthrough">>;
|
|
1044
1047
|
type KakaoTemplate = z.infer<typeof KakaoTemplateSchema>;
|
|
1048
|
+
/**
|
|
1049
|
+
* 브랜드 메시지 말풍선 유형. **이 값이 단가를 정한다** — 텍스트형이 가장 싸고
|
|
1050
|
+
* 와이드리스트·캐러셀·커머스가 가장 비싸다.
|
|
1051
|
+
*
|
|
1052
|
+
* `MessageType` 과 같은 이유로 열어 둔 유니온이다.
|
|
1053
|
+
*/
|
|
1054
|
+
type BrandBubbleType = 'TEXT' | 'IMAGE' | 'WIDE' | 'WIDE_ITEM_LIST' | 'CAROUSEL_FEED' | 'COMMERCE' | 'CAROUSEL_COMMERCE' | (string & {});
|
|
1055
|
+
/**
|
|
1056
|
+
* 브랜드 메시지 템플릿.
|
|
1057
|
+
*
|
|
1058
|
+
* ⭐ **알림톡과 달리 검수가 없다** — `status`·`dormant`·`sendable` 이 없는 이유이고,
|
|
1059
|
+
* 목록에 있으면 곧 발송할 수 있다.
|
|
1060
|
+
*/
|
|
1061
|
+
declare const KakaoBrandTemplateSchema: z.ZodObject<{
|
|
1062
|
+
/** ClawOps 템플릿 리소스 ID. 발송의 `brand.templateId` 에 이 값을 쓴다. */
|
|
1063
|
+
id: z.ZodString;
|
|
1064
|
+
/** ClawOps 채널 리소스 ID. 발송의 `brand.channelId` 와 같은 값이다. */
|
|
1065
|
+
channelId: z.ZodString;
|
|
1066
|
+
name: z.ZodString;
|
|
1067
|
+
chatBubbleType: z.ZodType<BrandBubbleType>;
|
|
1068
|
+
/**
|
|
1069
|
+
* 말풍선 본문.
|
|
1070
|
+
*
|
|
1071
|
+
* ⚠️ **유형에 따라 `null` 이다.** 본문이 담기는 자리가 유형마다 달라 `TEXT`·`IMAGE`·
|
|
1072
|
+
* `WIDE` 에만 채워진다 — 나머지는 헤더·카드·상품명이 그 자리를 대신한다.
|
|
1073
|
+
*/
|
|
1074
|
+
content: z.ZodNullable<z.ZodString>;
|
|
1075
|
+
/** 와이드리스트형의 머리말. 다른 유형에서는 `null`. */
|
|
1076
|
+
header: z.ZodNullable<z.ZodString>;
|
|
1077
|
+
/** 발송 시 `brand.variables` 에 모두 채워야 하는 변수 이름. */
|
|
1078
|
+
variables: z.ZodArray<z.ZodString, "many">;
|
|
1079
|
+
createdAt: z.ZodString;
|
|
1080
|
+
updatedAt: z.ZodString;
|
|
1081
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1082
|
+
/** ClawOps 템플릿 리소스 ID. 발송의 `brand.templateId` 에 이 값을 쓴다. */
|
|
1083
|
+
id: z.ZodString;
|
|
1084
|
+
/** ClawOps 채널 리소스 ID. 발송의 `brand.channelId` 와 같은 값이다. */
|
|
1085
|
+
channelId: z.ZodString;
|
|
1086
|
+
name: z.ZodString;
|
|
1087
|
+
chatBubbleType: z.ZodType<BrandBubbleType>;
|
|
1088
|
+
/**
|
|
1089
|
+
* 말풍선 본문.
|
|
1090
|
+
*
|
|
1091
|
+
* ⚠️ **유형에 따라 `null` 이다.** 본문이 담기는 자리가 유형마다 달라 `TEXT`·`IMAGE`·
|
|
1092
|
+
* `WIDE` 에만 채워진다 — 나머지는 헤더·카드·상품명이 그 자리를 대신한다.
|
|
1093
|
+
*/
|
|
1094
|
+
content: z.ZodNullable<z.ZodString>;
|
|
1095
|
+
/** 와이드리스트형의 머리말. 다른 유형에서는 `null`. */
|
|
1096
|
+
header: z.ZodNullable<z.ZodString>;
|
|
1097
|
+
/** 발송 시 `brand.variables` 에 모두 채워야 하는 변수 이름. */
|
|
1098
|
+
variables: z.ZodArray<z.ZodString, "many">;
|
|
1099
|
+
createdAt: z.ZodString;
|
|
1100
|
+
updatedAt: z.ZodString;
|
|
1101
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1102
|
+
/** ClawOps 템플릿 리소스 ID. 발송의 `brand.templateId` 에 이 값을 쓴다. */
|
|
1103
|
+
id: z.ZodString;
|
|
1104
|
+
/** ClawOps 채널 리소스 ID. 발송의 `brand.channelId` 와 같은 값이다. */
|
|
1105
|
+
channelId: z.ZodString;
|
|
1106
|
+
name: z.ZodString;
|
|
1107
|
+
chatBubbleType: z.ZodType<BrandBubbleType>;
|
|
1108
|
+
/**
|
|
1109
|
+
* 말풍선 본문.
|
|
1110
|
+
*
|
|
1111
|
+
* ⚠️ **유형에 따라 `null` 이다.** 본문이 담기는 자리가 유형마다 달라 `TEXT`·`IMAGE`·
|
|
1112
|
+
* `WIDE` 에만 채워진다 — 나머지는 헤더·카드·상품명이 그 자리를 대신한다.
|
|
1113
|
+
*/
|
|
1114
|
+
content: z.ZodNullable<z.ZodString>;
|
|
1115
|
+
/** 와이드리스트형의 머리말. 다른 유형에서는 `null`. */
|
|
1116
|
+
header: z.ZodNullable<z.ZodString>;
|
|
1117
|
+
/** 발송 시 `brand.variables` 에 모두 채워야 하는 변수 이름. */
|
|
1118
|
+
variables: z.ZodArray<z.ZodString, "many">;
|
|
1119
|
+
createdAt: z.ZodString;
|
|
1120
|
+
updatedAt: z.ZodString;
|
|
1121
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
1122
|
+
type KakaoBrandTemplate = z.infer<typeof KakaoBrandTemplateSchema>;
|
|
1123
|
+
/**
|
|
1124
|
+
* 자유형 말풍선에 실을 이미지.
|
|
1125
|
+
*
|
|
1126
|
+
* ⭐ `id` 는 **ClawOps 리소스 ID** 다 — 벤더 파일 식별자가 아니다. 발송의
|
|
1127
|
+
* `brand.free.imageId` 에 이 값을 넣으면 서버가 벤더 값으로 바꿔 보낸다.
|
|
1128
|
+
*/
|
|
1129
|
+
declare const KakaoBrandImageSchema: z.ZodObject<{
|
|
1130
|
+
id: z.ZodString;
|
|
1131
|
+
/** 업로드할 때 지정한 말풍선 유형. 규격이 유형마다 달라 다른 유형엔 재사용할 수 없다. */
|
|
1132
|
+
bubbleType: z.ZodType<BrandBubbleType>;
|
|
1133
|
+
/** `'main'` | `'sub'`. 서브는 와이드리스트형에만 있다(메인 2:1, 서브 1:1). */
|
|
1134
|
+
slot: z.ZodString;
|
|
1135
|
+
/** 업로드한 원본 파일 이름. */
|
|
1136
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1137
|
+
createdAt: z.ZodString;
|
|
1138
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1139
|
+
id: z.ZodString;
|
|
1140
|
+
/** 업로드할 때 지정한 말풍선 유형. 규격이 유형마다 달라 다른 유형엔 재사용할 수 없다. */
|
|
1141
|
+
bubbleType: z.ZodType<BrandBubbleType>;
|
|
1142
|
+
/** `'main'` | `'sub'`. 서브는 와이드리스트형에만 있다(메인 2:1, 서브 1:1). */
|
|
1143
|
+
slot: z.ZodString;
|
|
1144
|
+
/** 업로드한 원본 파일 이름. */
|
|
1145
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1146
|
+
createdAt: z.ZodString;
|
|
1147
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1148
|
+
id: z.ZodString;
|
|
1149
|
+
/** 업로드할 때 지정한 말풍선 유형. 규격이 유형마다 달라 다른 유형엔 재사용할 수 없다. */
|
|
1150
|
+
bubbleType: z.ZodType<BrandBubbleType>;
|
|
1151
|
+
/** `'main'` | `'sub'`. 서브는 와이드리스트형에만 있다(메인 2:1, 서브 1:1). */
|
|
1152
|
+
slot: z.ZodString;
|
|
1153
|
+
/** 업로드한 원본 파일 이름. */
|
|
1154
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1155
|
+
createdAt: z.ZodString;
|
|
1156
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
1157
|
+
type KakaoBrandImage = z.infer<typeof KakaoBrandImageSchema>;
|
|
1045
1158
|
/** 채널 업종 카테고리. **열린 집합이므로 코드에 하드코딩하지 말 것** — 이 응답이 정본이다. */
|
|
1046
1159
|
declare const KakaoChannelCategorySchema: z.ZodObject<{
|
|
1047
1160
|
/** 채널 연결의 `categoryCode` 에 그대로 보내는 값. */
|
|
@@ -1213,6 +1326,13 @@ interface KakaoTemplateListParams {
|
|
|
1213
1326
|
page?: number;
|
|
1214
1327
|
pageSize?: number;
|
|
1215
1328
|
}
|
|
1329
|
+
/** 브랜드 메시지 템플릿 목록. 알림톡과 같은 축(채널 필수)이다. */
|
|
1330
|
+
interface KakaoBrandTemplateListParams {
|
|
1331
|
+
/** ClawOps 채널 리소스 ID. **필수다** — 없으면 `400` 이다. */
|
|
1332
|
+
channelId: string;
|
|
1333
|
+
page?: number;
|
|
1334
|
+
pageSize?: number;
|
|
1335
|
+
}
|
|
1216
1336
|
|
|
1217
1337
|
type RequestOptions$1 = {
|
|
1218
1338
|
extraHeaders?: Record<string, string>;
|
|
@@ -1288,14 +1408,82 @@ declare class KakaoTemplates extends APIResource {
|
|
|
1288
1408
|
*/
|
|
1289
1409
|
list(params: KakaoTemplateListParams, options?: RequestOptions$1): Promise<Page<KakaoTemplate>>;
|
|
1290
1410
|
}
|
|
1411
|
+
declare class KakaoBrandTemplates extends APIResource {
|
|
1412
|
+
/**
|
|
1413
|
+
* 한 채널의 브랜드 메시지 템플릿 목록.
|
|
1414
|
+
*
|
|
1415
|
+
* 응답의 `data[].id` 를 발송의 `brand.templateId` 로, `data[].channelId` 를
|
|
1416
|
+
* `brand.channelId` 로 쓴다. `variables` 의 모든 항목을 `brand.variables` 에 채워야 한다.
|
|
1417
|
+
*
|
|
1418
|
+
* ⭐ **알림톡과 달리 검수가 없어** `sendable` 같은 칸이 없다 — 목록에 있으면 곧 보낼 수 있다.
|
|
1419
|
+
*/
|
|
1420
|
+
list(params: KakaoBrandTemplateListParams, options?: RequestOptions$1): Promise<Page<KakaoBrandTemplate>>;
|
|
1421
|
+
}
|
|
1291
1422
|
/**
|
|
1292
|
-
*
|
|
1423
|
+
* 자유형 말풍선에 실을 이미지.
|
|
1424
|
+
*
|
|
1425
|
+
* ⭐ **업로드 한 번, 발송 여러 번.** 캠페인 하나에 수천 건이 같은 그림을 쓰므로 받은 `id` 를
|
|
1426
|
+
* 재사용한다 — 발송마다 다시 올릴 필요가 없다.
|
|
1293
1427
|
*
|
|
1294
|
-
*
|
|
1428
|
+
* ⚠️ **규격이 말풍선 유형마다 다르다.** 업로드할 때 준 `bubbleType` 과 다른 유형에 쓰면
|
|
1429
|
+
* 카카오가 발송 단계에서 거절한다 — 그 유형으로 다시 올려야 한다.
|
|
1430
|
+
*/
|
|
1431
|
+
declare class KakaoBrandImages extends APIResource {
|
|
1432
|
+
private get _path();
|
|
1433
|
+
/**
|
|
1434
|
+
* 이미지를 올리고 발송에 쓸 `id` 를 받는다.
|
|
1435
|
+
*
|
|
1436
|
+
* ```ts
|
|
1437
|
+
* const image = await client.kakao.brandImages.upload({
|
|
1438
|
+
* file: readFileSync('banner.png'),
|
|
1439
|
+
* filename: 'banner.png',
|
|
1440
|
+
* bubbleType: 'WIDE',
|
|
1441
|
+
* });
|
|
1442
|
+
* await client.messages.create({
|
|
1443
|
+
* to: '01012345678',
|
|
1444
|
+
* from: '07012345678',
|
|
1445
|
+
* brand: {
|
|
1446
|
+
* channelId,
|
|
1447
|
+
* free: { chatBubbleType: 'WIDE', content: '신메뉴가 나왔어요.', imageId: image.id },
|
|
1448
|
+
* },
|
|
1449
|
+
* });
|
|
1450
|
+
* ```
|
|
1451
|
+
*
|
|
1452
|
+
* ⚠️ `TEXT` 는 이미지 자리가 없어 `400` 이다. 자동완성에 뜨지만 쓸 수 없다.
|
|
1453
|
+
*
|
|
1454
|
+
* ⚠️ **상한은 5MB 다.** 넘으면 `400`, 10MB 를 넘으면 업로드 검증기가 먼저 끊어 `413` 이고
|
|
1455
|
+
* **`code` 가 없다** — 즉 "너무 크다" 가 두 모양으로 온다.
|
|
1456
|
+
*
|
|
1457
|
+
* @param params.filename 원본 파일 이름. 목록에서 사람이 알아볼 유일한 단서다.
|
|
1458
|
+
* @param params.slot 와이드리스트형에서 작은 항목에 쓸 이미지면 `'sub'`. 기본은 `'main'`.
|
|
1459
|
+
*/
|
|
1460
|
+
upload(params: {
|
|
1461
|
+
file: Blob | Uint8Array;
|
|
1462
|
+
filename: string;
|
|
1463
|
+
bubbleType: BrandBubbleType;
|
|
1464
|
+
slot?: string;
|
|
1465
|
+
}, options?: RequestOptions$1): Promise<{
|
|
1466
|
+
id: string;
|
|
1467
|
+
}>;
|
|
1468
|
+
/** 올려 둔 이미지 목록. **`id` 를 잃었을 때 되찾는 경로다.** */
|
|
1469
|
+
list(params?: {
|
|
1470
|
+
page?: number;
|
|
1471
|
+
pageSize?: number;
|
|
1472
|
+
}, options?: RequestOptions$1): Promise<Page<KakaoBrandImage>>;
|
|
1473
|
+
}
|
|
1474
|
+
/**
|
|
1475
|
+
* 카카오 알림톡·브랜드 메시지 관련 리소스.
|
|
1476
|
+
*
|
|
1477
|
+
* 발송 자체는 `client.messages.create({ kakao: … })` 또는 `({ brand: … })` 다 —
|
|
1478
|
+
* 여기서 얻은 채널·템플릿 ID 를 그대로 쓴다.
|
|
1295
1479
|
*/
|
|
1296
1480
|
declare class Kakao extends APIResource {
|
|
1297
1481
|
get channels(): KakaoChannels;
|
|
1298
1482
|
get templates(): KakaoTemplates;
|
|
1483
|
+
/** 브랜드 메시지 템플릿. 알림톡 템플릿(`templates`)과 **다른 표**다. */
|
|
1484
|
+
get brandTemplates(): KakaoBrandTemplates;
|
|
1485
|
+
/** 자유형 말풍선에 실을 이미지. 템플릿형은 이미지가 템플릿에 들어 있어 필요 없다. */
|
|
1486
|
+
get brandImages(): KakaoBrandImages;
|
|
1299
1487
|
/**
|
|
1300
1488
|
* 채널 연결 시 지정할 업종 카테고리 목록.
|
|
1301
1489
|
*
|
|
@@ -1426,6 +1614,7 @@ interface TextMessageCreateParams extends MessageCreateBaseParams {
|
|
|
1426
1614
|
/** MMS 첨부 (최대 3개). jpg·jpeg·png·bmp, 장당 300KB 이하. */
|
|
1427
1615
|
mediaUrl?: string[];
|
|
1428
1616
|
kakao?: never;
|
|
1617
|
+
brand?: never;
|
|
1429
1618
|
fallback?: never;
|
|
1430
1619
|
}
|
|
1431
1620
|
/** 알림톡 템플릿 지정. 구조(본문·버튼·아이템·강조)는 검수된 템플릿이 정하고, 요청은 값만 채운다. */
|
|
@@ -1443,6 +1632,8 @@ interface KakaoSendParams {
|
|
|
1443
1632
|
* 채워야 할 이름은 `kakao.templates.list()` 응답의 `variables` 가 알려준다.
|
|
1444
1633
|
*/
|
|
1445
1634
|
variables?: Record<string, string>;
|
|
1635
|
+
/** 알림톡엔 자유형이 없다 — 브랜드와 한 조립 함수를 쓰기 위한 스탬프이기도 하다. */
|
|
1636
|
+
free?: never;
|
|
1446
1637
|
}
|
|
1447
1638
|
/** 알림톡이 발송 실패했을 때 대신 나갈 문자. */
|
|
1448
1639
|
interface KakaoFallbackParams {
|
|
@@ -1464,6 +1655,7 @@ interface KakaoFallbackParams {
|
|
|
1464
1655
|
*/
|
|
1465
1656
|
interface KakaoMessageCreateParams extends MessageCreateBaseParams {
|
|
1466
1657
|
kakao: KakaoSendParams;
|
|
1658
|
+
brand?: never;
|
|
1467
1659
|
fallback?: KakaoFallbackParams;
|
|
1468
1660
|
/** `kakao` 를 실으면 알림톡이다. 명시할 필요가 없고, 명시한다면 `'ata'` 뿐이다. */
|
|
1469
1661
|
type?: 'ata';
|
|
@@ -1471,12 +1663,87 @@ interface KakaoMessageCreateParams extends MessageCreateBaseParams {
|
|
|
1471
1663
|
subject?: never;
|
|
1472
1664
|
mediaUrl?: never;
|
|
1473
1665
|
}
|
|
1666
|
+
interface BrandSendBaseParams {
|
|
1667
|
+
/** `kakao.channels.list()` 의 `data[].id` (ClawOps 리소스 ID). */
|
|
1668
|
+
channelId: string;
|
|
1669
|
+
}
|
|
1670
|
+
/** 템플릿형 — 구조(본문·버튼·이미지)는 등록한 템플릿이 정하고 요청은 값만 채운다. */
|
|
1671
|
+
interface BrandTemplateSendParams extends BrandSendBaseParams {
|
|
1672
|
+
/**
|
|
1673
|
+
* `kakao.brandTemplates.list()` 의 `data[].id` (ClawOps 리소스 ID).
|
|
1674
|
+
*/
|
|
1675
|
+
templateId: string;
|
|
1676
|
+
/**
|
|
1677
|
+
* 템플릿 변수. 키는 `고객명` 과 `#{고객명}` 을 모두 받는다.
|
|
1678
|
+
*
|
|
1679
|
+
* 채워야 할 이름은 `kakao.brandTemplates.list()` 응답의 `variables` 가 알려준다.
|
|
1680
|
+
*/
|
|
1681
|
+
variables?: Record<string, string>;
|
|
1682
|
+
free?: never;
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* 자유형 — 말풍선을 요청이 직접 들고 간다. 템플릿을 등록하지 않아도 된다.
|
|
1686
|
+
*
|
|
1687
|
+
* 종료된 친구톡을 대신하는 방식이다.
|
|
1688
|
+
*
|
|
1689
|
+
* ⛔ **변수를 쓸 수 없다.** 치환해 줄 템플릿이 없어 `#{…}` 가 그대로 톡에 렌더되므로
|
|
1690
|
+
* 서버가 `400` 으로 막는다. 값을 채우려면 템플릿형을 쓴다.
|
|
1691
|
+
*/
|
|
1692
|
+
interface BrandFreeSendParams extends BrandSendBaseParams {
|
|
1693
|
+
/**
|
|
1694
|
+
* 말풍선 몸통. **불투명 오브젝트다 — SDK 는 안을 검사하지 않는다.**
|
|
1695
|
+
*
|
|
1696
|
+
* ⛔ 칸마다 타이핑하지 않는 것이 의도다. 말풍선 규격표는 서버에 한 벌만 있고, SDK 가
|
|
1697
|
+
* 사본을 들면 카카오가 칸을 늘린 날 **SDK 가 조용히 깎는다.** 잘못된 몸통은
|
|
1698
|
+
* `400 VALIDATION`(도메인) 또는 `400`+`errors`(스펙)로 돌아온다.
|
|
1699
|
+
*
|
|
1700
|
+
* `chatBubbleType` 이 규격을 정한다. 이미지가 필요한 유형은
|
|
1701
|
+
* `kakao.brandImages.upload()` 로 먼저 올리고 받은 `id` 를 `imageId` 에 넣는다.
|
|
1702
|
+
*
|
|
1703
|
+
* ⚠️ `interface` 로 선언한 값은 `Record<string, unknown>` 에 대입되지 않는다(암묵 인덱스
|
|
1704
|
+
* 시그니처가 없다). `free: { ...myBubble }` 로 펼치거나 `type` 으로 선언할 것.
|
|
1705
|
+
*/
|
|
1706
|
+
free: Record<string, unknown>;
|
|
1707
|
+
templateId?: never;
|
|
1708
|
+
variables?: never;
|
|
1709
|
+
}
|
|
1710
|
+
/**
|
|
1711
|
+
* 브랜드 메시지 발송 지정. **템플릿형(`templateId`)과 자유형(`free`)은 정확히 하나만**
|
|
1712
|
+
* 성립한다 — 둘 다 실으면 어느 쪽으로 나갈지 정해 줄 수 없고, 둘 다 없으면 보낼 말풍선이
|
|
1713
|
+
* 없다. 서버도 `400 invalid_input` 이다.
|
|
1714
|
+
*
|
|
1715
|
+
* ⛔ **평평한 optional 로 합치지 말 것.** `templateId?`·`free?` 로 두면 `{ channelId }`
|
|
1716
|
+
* 하나만 준 오타가 컴파일을 통과해 **운영 트래픽의 런타임 400** 이 된다.
|
|
1717
|
+
*/
|
|
1718
|
+
type BrandSendParams = BrandTemplateSendParams | BrandFreeSendParams;
|
|
1719
|
+
/**
|
|
1720
|
+
* 카카오 브랜드 메시지 발송 파라미터.
|
|
1721
|
+
*
|
|
1722
|
+
* 채널을 **추가한 친구**에게 나가는 광고성 메시지다. 알림톡과 갈리는 점 둘:
|
|
1723
|
+
*
|
|
1724
|
+
* - **야간에 못 보낸다.** 20:50~08:00(KST)은 `422 kakao_brand_night_blocked` 다.
|
|
1725
|
+
* - **대체발송이 없다.** `fallback` 을 실으면 `400 kakao_fallback_not_allowed` 라서
|
|
1726
|
+
* 타입에서도 막는다.
|
|
1727
|
+
*
|
|
1728
|
+
* `(광고)` 표기와 수신거부 안내는 카카오가 붙이므로 본문에 넣지 않는다.
|
|
1729
|
+
*/
|
|
1730
|
+
interface BrandMessageCreateParams extends MessageCreateBaseParams {
|
|
1731
|
+
brand: BrandSendParams;
|
|
1732
|
+
/** `brand` 를 실으면 브랜드 메시지다. 명시할 필요가 없고, 명시한다면 `'bms'` 뿐이다. */
|
|
1733
|
+
type?: 'bms';
|
|
1734
|
+
body?: never;
|
|
1735
|
+
subject?: never;
|
|
1736
|
+
mediaUrl?: never;
|
|
1737
|
+
kakao?: never;
|
|
1738
|
+
fallback?: never;
|
|
1739
|
+
}
|
|
1474
1740
|
/**
|
|
1475
|
-
* 발송 파라미터.
|
|
1741
|
+
* 발송 파라미터. 문자·알림톡·브랜드 메시지는 **서로 배타적**이다 — 서버 규칙이 그렇고,
|
|
1742
|
+
* 섞으면 컴파일 에러다.
|
|
1476
1743
|
*/
|
|
1477
|
-
type MessageCreateParams = TextMessageCreateParams | KakaoMessageCreateParams;
|
|
1744
|
+
type MessageCreateParams = TextMessageCreateParams | KakaoMessageCreateParams | BrandMessageCreateParams;
|
|
1478
1745
|
interface MessageListParams {
|
|
1479
|
-
type?: TextMessageType | 'ata';
|
|
1746
|
+
type?: TextMessageType | 'ata' | 'bms';
|
|
1480
1747
|
status?: 'queued' | 'sent' | 'failed' | 'received';
|
|
1481
1748
|
/** 발신 또는 수신 번호. 하이픈 유무를 모두 매칭한다. */
|
|
1482
1749
|
number?: string;
|
|
@@ -1486,10 +1753,10 @@ interface MessageListParams {
|
|
|
1486
1753
|
|
|
1487
1754
|
declare class Messages extends APIResource {
|
|
1488
1755
|
/**
|
|
1489
|
-
* 문자(SMS/LMS/MMS) 또는 카카오
|
|
1756
|
+
* 문자(SMS/LMS/MMS) 또는 카카오 알림톡·브랜드 메시지를 발송합니다.
|
|
1490
1757
|
*
|
|
1491
|
-
*
|
|
1492
|
-
* 실을 수 없습니다(본문은
|
|
1758
|
+
* 셋은 배타적입니다 — `kakao` 를 실으면 알림톡, `brand` 를 실으면 브랜드 메시지이고,
|
|
1759
|
+
* 이때 `body`·`subject`·`mediaUrl` 은 실을 수 없습니다(본문은 템플릿이 정합니다).
|
|
1493
1760
|
*
|
|
1494
1761
|
* ```ts
|
|
1495
1762
|
* // 문자
|
|
@@ -1502,6 +1769,14 @@ declare class Messages extends APIResource {
|
|
|
1502
1769
|
* kakao: { channelId, templateId, variables: { 고객명: '홍길동' } },
|
|
1503
1770
|
* fallback: { body: '주문이 접수되었습니다.' },
|
|
1504
1771
|
* });
|
|
1772
|
+
*
|
|
1773
|
+
* // 브랜드 메시지 — 채널을 추가한 친구에게 나가는 광고성 메시지
|
|
1774
|
+
* // ⚠️ 야간 제한과 대체발송 없음 — 제약은 `BrandMessageCreateParams` 참고.
|
|
1775
|
+
* await client.messages.create({
|
|
1776
|
+
* to: '010…',
|
|
1777
|
+
* from: '070…',
|
|
1778
|
+
* brand: { channelId, templateId, variables: { 고객명: '홍길동' } },
|
|
1779
|
+
* });
|
|
1505
1780
|
* ```
|
|
1506
1781
|
*/
|
|
1507
1782
|
create(params: MessageCreateParams, options?: {
|
|
@@ -1912,7 +2187,20 @@ declare class AccountContext {
|
|
|
1912
2187
|
* 그렇게 보내므로 SDK 가 임의로 정규화하지 않는다. 열린 유니온이라 목록에 없는 코드도
|
|
1913
2188
|
* 그대로 실린다(자동완성만 돕는다).
|
|
1914
2189
|
*/
|
|
1915
|
-
type ClawOpsErrorCode = 'invalid_phone' | 'invalid_type' | 'invalid_input' | 'from_not_registered' | 'body_too_long' | 'sms_no_subject' | 'sms_no_media' | 'lms_no_media' | 'too_many_media' | 'invalid_media_ext' | 'media_download_failed' | 'type_not_supported' | 'messaging_blocked' | 'recipient_blocked' | 'quota_exceeded' | 'override_quota_exceeded' | 'no_active_subscription' | 'kakao_required' | 'kakao_type_conflict' | 'kakao_body_not_allowed' | 'kakao_subject_not_allowed' | 'kakao_media_not_allowed' | 'kakao_channel_not_found' | 'kakao_template_not_found' | 'kakao_template_not_approved' | 'kakao_template_dormant' | 'kakao_variable_missing' | 'kakao_variable_unknown' | 'kakao_send_failed' | 'kakao_unavailable' | 'invalid_fallback_type' | '
|
|
2190
|
+
type ClawOpsErrorCode = 'invalid_phone' | 'invalid_type' | 'invalid_input' | 'from_not_registered' | 'body_too_long' | 'sms_no_subject' | 'sms_no_media' | 'lms_no_media' | 'too_many_media' | 'invalid_media_ext' | 'media_download_failed' | 'type_not_supported' | 'messaging_blocked' | 'recipient_blocked' | 'quota_exceeded' | 'override_quota_exceeded' | 'no_active_subscription' | 'kakao_required' | 'kakao_type_conflict' | 'kakao_body_not_allowed' | 'kakao_subject_not_allowed' | 'kakao_media_not_allowed' | 'kakao_channel_not_found' | 'kakao_template_not_found' | 'kakao_template_not_approved' | 'kakao_template_dormant' | 'kakao_variable_missing' | 'kakao_variable_unknown' | 'kakao_send_failed' | 'kakao_unavailable' | 'invalid_fallback_type' | 'kakao_brand_required' | 'kakao_brand_template_not_found'
|
|
2191
|
+
/** 광고성이라 20:50~08:00(KST)에는 접수되지 않는다. 하루 11시간 동안 나오므로 재시도 스케줄링이 이 분기에 달린다. */
|
|
2192
|
+
| 'kakao_brand_night_blocked'
|
|
2193
|
+
/** 브랜드는 대체발송이 없다 — `fallback` 을 실으면 이 코드다. */
|
|
2194
|
+
| 'kakao_fallback_not_allowed'
|
|
2195
|
+
/** 자유형 몸통에서 본문을 뽑지 못했다. 벤더는 최상위 `text` 가 비면 접수 뒤 실패시킨다. */
|
|
2196
|
+
| 'kakao_brand_body_empty'
|
|
2197
|
+
/**
|
|
2198
|
+
* 자유형 `imageId` 가 이 계정의 이미지가 아니다.
|
|
2199
|
+
*
|
|
2200
|
+
* ⚠️ 벤더 fileId 를 직접 실어도 이 코드다 — 공개 API 는 `kakao.brandImages.upload()` 가
|
|
2201
|
+
* 준 우리 id 만 받는다(그게 남의 이미지를 막는 유일한 관문이다).
|
|
2202
|
+
*/
|
|
2203
|
+
| 'kakao_brand_image_not_found' | 'KAKAO_TOKEN_INVALID' | 'KAKAO_CHANNEL_ALREADY_LINKED' | 'KAKAO_CHANNEL_REJECTED' | 'KAKAO_RATE_LIMITED' | 'KAKAO_PROVIDER_UNAVAILABLE' | 'VALIDATION' | 'NOT_FOUND' | (string & {});
|
|
1916
2204
|
declare class ClawOpsError extends Error {
|
|
1917
2205
|
constructor(message: string);
|
|
1918
2206
|
}
|
|
@@ -2116,4 +2404,4 @@ declare class ClawOps extends APIClient {
|
|
|
2116
2404
|
accounts(accountId: string): AccountContext;
|
|
2117
2405
|
}
|
|
2118
2406
|
|
|
2119
|
-
export { type
|
|
2407
|
+
export { type KakaoFallbackParams as $, APIClient as A, BadRequestError as B, type Call as C, type CallControlResponse as D, type CallCreateParams as E, type CallListParams as F, type CallUpdateParams as G, Calls as H, ClawOps as I, ClawOpsError as J, type ClawOpsErrorCode as K, type ClawOpsOptions as L, ConflictError as M, InternalServerError as N, Kakao as O, type KakaoBrandImage as P, KakaoBrandImages as Q, type KakaoBrandTemplate as R, type KakaoBrandTemplateListParams as S, KakaoBrandTemplates as T, type KakaoChannel as U, type KakaoChannelCategory as V, type KakaoChannelCategoryList as W, type KakaoChannelConnectParams as X, type KakaoChannelListParams as Y, type KakaoChannelStatus as Z, KakaoChannels as _, type APIClientOptions as a, type KakaoMessageCreateParams as a0, type KakaoSendParams as a1, type KakaoTemplate as a2, type KakaoTemplateListParams as a3, KakaoTemplates as a4, type KakaoTokenRequest as a5, type KakaoTokenRequestParams as a6, type Message as a7, type MessageCreateParams as a8, type MessageListParams as a9, Messages as aa, NotFoundError as ab, type NumberCreateParams as ac, type NumberListItem as ad, type NumberUpdateParams as ae, type NumberUpdateResponse as af, Numbers as ag, Page as ah, PermissionDeniedError as ai, type PhoneNumber as aj, RateLimitError as ak, type RecordingDownload as al, Recordings as am, type RoutingType as an, ServiceUnavailableError as ao, type SipCredential as ap, SipCredentials as aq, type SipEndpoint as ar, SipEndpoints as as, SolapiBridgeError as at, type TextMessageCreateParams as au, UnprocessableEntityError as av, type WebhookLog as aw, WebhookLogs as ax, WebhookVerificationError as ay, Webhooks as az, APIConnectionError as b, APIError as c, APIResponseValidationError as d, APIStatusError as e, APITimeoutError as f, AccountContext as g, AgentConnectionError as h, AgentError as i, type AssignmentLink as j, type AssignmentLinkAssignment as k, type AssignmentLinkCreateResponse as l, type AssignmentLinkStatus as m, AssignmentLinks as n, AuthenticationError as o, type BlockedChannel as p, type BlockedRecipient as q, type BlockedRecipientSource as r, type BlockedRecipientStatus as s, BlockedRecipients as t, type BrandBubbleType as u, type BrandFreeSendParams as v, type BrandMessageCreateParams as w, type BrandSendParams as x, type BrandTemplateSendParams as y, type CallContextParam as z };
|