@koreaaitel/sdk 0.0.0-stage → 0.62.1

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.
Files changed (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +943 -2
  3. package/dist/agent/index.cjs +5512 -0
  4. package/dist/agent/index.cjs.map +1 -0
  5. package/dist/agent/index.d.cts +1574 -0
  6. package/dist/agent/index.d.ts +1574 -0
  7. package/dist/agent/index.js +5402 -0
  8. package/dist/agent/index.js.map +1 -0
  9. package/dist/agent/livekit/index.cjs +675 -0
  10. package/dist/agent/livekit/index.cjs.map +1 -0
  11. package/dist/agent/livekit/index.d.cts +165 -0
  12. package/dist/agent/livekit/index.d.ts +165 -0
  13. package/dist/agent/livekit/index.js +669 -0
  14. package/dist/agent/livekit/index.js.map +1 -0
  15. package/dist/chunk-35XJNMFU.js +10 -0
  16. package/dist/chunk-35XJNMFU.js.map +1 -0
  17. package/dist/chunk-3QH5DUA2.js +6 -0
  18. package/dist/chunk-3QH5DUA2.js.map +1 -0
  19. package/dist/chunk-5ZH3XGLJ.cjs +1134 -0
  20. package/dist/chunk-5ZH3XGLJ.cjs.map +1 -0
  21. package/dist/chunk-B3QB5WPI.cjs +202 -0
  22. package/dist/chunk-B3QB5WPI.cjs.map +1 -0
  23. package/dist/chunk-DO6A7FLM.js +1103 -0
  24. package/dist/chunk-DO6A7FLM.js.map +1 -0
  25. package/dist/chunk-LLPMUDNE.cjs +16 -0
  26. package/dist/chunk-LLPMUDNE.cjs.map +1 -0
  27. package/dist/chunk-LPQFS6AS.cjs +8 -0
  28. package/dist/chunk-LPQFS6AS.cjs.map +1 -0
  29. package/dist/chunk-T4ZQXFTN.js +181 -0
  30. package/dist/chunk-T4ZQXFTN.js.map +1 -0
  31. package/dist/client-CrTIZPmY.d.cts +3074 -0
  32. package/dist/client-DJApW4Uf.d.ts +3074 -0
  33. package/dist/error-D1uHhe6r.d.cts +205 -0
  34. package/dist/error-D1uHhe6r.d.ts +205 -0
  35. package/dist/index.cjs +1741 -0
  36. package/dist/index.cjs.map +1 -0
  37. package/dist/index.d.cts +22 -0
  38. package/dist/index.d.ts +22 -0
  39. package/dist/index.js +1638 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/media-profile-DZCqLJKa.d.cts +492 -0
  42. package/dist/media-profile-DZCqLJKa.d.ts +492 -0
  43. package/dist/solapi/index.cjs +684 -0
  44. package/dist/solapi/index.cjs.map +1 -0
  45. package/dist/solapi/index.d.cts +282 -0
  46. package/dist/solapi/index.d.ts +282 -0
  47. package/dist/solapi/index.js +673 -0
  48. package/dist/solapi/index.js.map +1 -0
  49. package/package.json +121 -4
@@ -0,0 +1,205 @@
1
+ /**
2
+ * 서버가 에러 응답의 `code` 로 싣는 값.
3
+ *
4
+ * 문구가 아니라 **이 값으로 분기한다** — 한글 메시지는 바뀔 수 있다.
5
+ *
6
+ * ⚠️ 문자 도메인은 snake_case, 카카오 채널 도메인은 SCREAMING_CASE 다. 서버가 실제로
7
+ * 그렇게 보내므로 SDK 가 임의로 정규화하지 않는다. 열린 유니온이라 목록에 없는 코드도
8
+ * 그대로 실린다(자동완성만 돕는다).
9
+ */
10
+ 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'
11
+ /** 광고성이라 20:50~08:00(KST)에는 접수되지 않는다. 하루 11시간 동안 나오므로 재시도 스케줄링이 이 분기에 달린다. */
12
+ | 'kakao_brand_night_blocked'
13
+ /** 브랜드는 대체발송이 없다 — `fallback` 을 실으면 이 코드다. */
14
+ | 'kakao_fallback_not_allowed'
15
+ /** 자유형 몸통에서 본문을 뽑지 못했다. 벤더는 최상위 `text` 가 비면 접수 뒤 실패시킨다. */
16
+ | 'kakao_brand_body_empty'
17
+ /**
18
+ * 자유형 `imageId` 가 이 계정의 이미지가 아니다.
19
+ *
20
+ * ⚠️ 벤더 fileId 를 직접 실어도 이 코드다 — 공개 API 는 `kakao.brandImages.upload()` 가
21
+ * 준 우리 id 만 받는다(그게 남의 이미지를 막는 유일한 관문이다).
22
+ */
23
+ | 'kakao_brand_image_not_found'
24
+ /** 이미 등록된 발신번호 — 이미 발송에 쓸 수 있는 상태라 성공으로 다뤄도 된다. */
25
+ | 'sender_number_already_registered' | 'sender_number_limit_reached' | 'sender_number_limit_unknown' | 'sender_number_holder_unresolved' | 'sender_number_not_account_number' | 'sender_number_not_registrable' | 'sender_number_not_found' | 'sender_number_not_deletable_via_api' | 'api_key_sender_numbers_restricted' | 'KAKAO_TOKEN_INVALID' | 'KAKAO_CHANNEL_ALREADY_LINKED' | 'KAKAO_CHANNEL_REJECTED' | 'KAKAO_RATE_LIMITED' | 'KAKAO_PROVIDER_UNAVAILABLE' | 'VALIDATION' | 'NOT_FOUND' | (string & {});
26
+ declare class ClawOpsError extends Error {
27
+ constructor(message: string);
28
+ }
29
+ declare class APIError extends ClawOpsError {
30
+ readonly request: {
31
+ method: string;
32
+ url: string;
33
+ };
34
+ constructor(message: string, request: {
35
+ method: string;
36
+ url: string;
37
+ });
38
+ }
39
+ declare class APIStatusError extends APIError {
40
+ readonly status: number;
41
+ readonly body: unknown;
42
+ readonly headers: Headers | undefined;
43
+ /**
44
+ * 서버가 함께 보낸 기계 판독용 코드(`{ error, code }`). 없으면 undefined 다.
45
+ *
46
+ * 같은 상태 코드가 서로 다른 사유를 담는다 — 422 만 해도 수신거부(`recipient_blocked`)와
47
+ * 할당량 초과(`quota_exceeded`)가 갈리고, 한글 문구로 구분하면 문구가 바뀔 때 깨진다.
48
+ */
49
+ readonly code: ClawOpsErrorCode | undefined;
50
+ constructor(message: string, response: {
51
+ status: number;
52
+ headers?: Headers;
53
+ }, body: unknown, request: {
54
+ method: string;
55
+ url: string;
56
+ });
57
+ }
58
+ declare class BadRequestError extends APIStatusError {
59
+ readonly status: 400;
60
+ constructor(message: string, response: {
61
+ status: number;
62
+ headers?: Headers;
63
+ }, body: unknown, request: {
64
+ method: string;
65
+ url: string;
66
+ });
67
+ }
68
+ declare class AuthenticationError extends APIStatusError {
69
+ readonly status: 401;
70
+ constructor(message: string, response: {
71
+ status: number;
72
+ headers?: Headers;
73
+ }, body: unknown, request: {
74
+ method: string;
75
+ url: string;
76
+ });
77
+ }
78
+ declare class PermissionDeniedError extends APIStatusError {
79
+ readonly status: 403;
80
+ constructor(message: string, response: {
81
+ status: number;
82
+ headers?: Headers;
83
+ }, body: unknown, request: {
84
+ method: string;
85
+ url: string;
86
+ });
87
+ }
88
+ declare class NotFoundError extends APIStatusError {
89
+ readonly status: 404;
90
+ constructor(message: string, response: {
91
+ status: number;
92
+ headers?: Headers;
93
+ }, body: unknown, request: {
94
+ method: string;
95
+ url: string;
96
+ });
97
+ }
98
+ declare class ConflictError extends APIStatusError {
99
+ readonly status: 409;
100
+ constructor(message: string, response: {
101
+ status: number;
102
+ headers?: Headers;
103
+ }, body: unknown, request: {
104
+ method: string;
105
+ url: string;
106
+ });
107
+ }
108
+ declare class UnprocessableEntityError extends APIStatusError {
109
+ readonly status: 422;
110
+ constructor(message: string, response: {
111
+ status: number;
112
+ headers?: Headers;
113
+ }, body: unknown, request: {
114
+ method: string;
115
+ url: string;
116
+ });
117
+ }
118
+ /**
119
+ * HTTP 429 Too Many Requests.
120
+ *
121
+ * 동시 통화 한도 초과 등 일시적 제한. SDK는 자동 재시도(최대 2회, 지수 backoff)를 수행한다.
122
+ * 즉각 피드백이 필요하면 client 생성 시 maxRetries: 0으로 재시도를 비활성화하라.
123
+ */
124
+ declare class RateLimitError extends APIStatusError {
125
+ readonly status: 429;
126
+ constructor(message: string, response: {
127
+ status: number;
128
+ headers?: Headers;
129
+ }, body: unknown, request: {
130
+ method: string;
131
+ url: string;
132
+ });
133
+ }
134
+ declare class InternalServerError extends APIStatusError {
135
+ readonly status: 500;
136
+ constructor(message: string, response: {
137
+ status: number;
138
+ headers?: Headers;
139
+ }, body: unknown, request: {
140
+ method: string;
141
+ url: string;
142
+ });
143
+ }
144
+ declare class ServiceUnavailableError extends APIStatusError {
145
+ readonly status: 503;
146
+ constructor(message: string, response: {
147
+ status: number;
148
+ headers?: Headers;
149
+ }, body: unknown, request: {
150
+ method: string;
151
+ url: string;
152
+ });
153
+ }
154
+ declare class APIConnectionError extends APIError {
155
+ constructor(request: {
156
+ method: string;
157
+ url: string;
158
+ }, message?: string);
159
+ }
160
+ declare class APITimeoutError extends APIConnectionError {
161
+ constructor(request: {
162
+ method: string;
163
+ url: string;
164
+ });
165
+ }
166
+ declare class APIResponseValidationError extends APIError {
167
+ readonly status: number;
168
+ constructor(response: {
169
+ status: number;
170
+ }, request: {
171
+ method: string;
172
+ url: string;
173
+ });
174
+ }
175
+ /**
176
+ * 솔라피 호환 레이어가 호출을 거절할 때 쓴다.
177
+ * 조용히 다르게 동작하느니 여기서 멈추는 편이 낫다고 판단한 경우들이다.
178
+ */
179
+ declare class SolapiBridgeError extends ClawOpsError {
180
+ constructor(message: string);
181
+ }
182
+ declare class AgentError extends ClawOpsError {
183
+ constructor(message: string);
184
+ }
185
+ declare class AgentConnectionError extends AgentError {
186
+ constructor(message?: string);
187
+ }
188
+ /**
189
+ * The server refused the control connection (HTTP 400·401·403) — retrying gives the same answer.
190
+ *
191
+ * Thrown when the API key is missing, revoked, expired or belongs to another account, or the
192
+ * number is not this account's. The SDK stops reconnecting. `code` is the server's reason
193
+ * (`X-ClawOps-Error-Code`): `api_key_missing` · `api_key_invalid` · `number_missing` ·
194
+ * `number_not_owned`, or `null` from a server that does not send one.
195
+ */
196
+ declare class AgentAuthRejectedError extends AgentConnectionError {
197
+ readonly status: number;
198
+ readonly code: string | null;
199
+ constructor(message: string, options: {
200
+ status: number;
201
+ code: string | null;
202
+ });
203
+ }
204
+
205
+ export { APIConnectionError as A, BadRequestError as B, ClawOpsError as C, InternalServerError as I, NotFoundError as N, PermissionDeniedError as P, RateLimitError as R, ServiceUnavailableError as S, UnprocessableEntityError as U, APIError as a, APIResponseValidationError as b, APIStatusError as c, APITimeoutError as d, AgentAuthRejectedError as e, AgentConnectionError as f, AgentError as g, AuthenticationError as h, type ClawOpsErrorCode as i, ConflictError as j, SolapiBridgeError as k };
@@ -0,0 +1,205 @@
1
+ /**
2
+ * 서버가 에러 응답의 `code` 로 싣는 값.
3
+ *
4
+ * 문구가 아니라 **이 값으로 분기한다** — 한글 메시지는 바뀔 수 있다.
5
+ *
6
+ * ⚠️ 문자 도메인은 snake_case, 카카오 채널 도메인은 SCREAMING_CASE 다. 서버가 실제로
7
+ * 그렇게 보내므로 SDK 가 임의로 정규화하지 않는다. 열린 유니온이라 목록에 없는 코드도
8
+ * 그대로 실린다(자동완성만 돕는다).
9
+ */
10
+ 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'
11
+ /** 광고성이라 20:50~08:00(KST)에는 접수되지 않는다. 하루 11시간 동안 나오므로 재시도 스케줄링이 이 분기에 달린다. */
12
+ | 'kakao_brand_night_blocked'
13
+ /** 브랜드는 대체발송이 없다 — `fallback` 을 실으면 이 코드다. */
14
+ | 'kakao_fallback_not_allowed'
15
+ /** 자유형 몸통에서 본문을 뽑지 못했다. 벤더는 최상위 `text` 가 비면 접수 뒤 실패시킨다. */
16
+ | 'kakao_brand_body_empty'
17
+ /**
18
+ * 자유형 `imageId` 가 이 계정의 이미지가 아니다.
19
+ *
20
+ * ⚠️ 벤더 fileId 를 직접 실어도 이 코드다 — 공개 API 는 `kakao.brandImages.upload()` 가
21
+ * 준 우리 id 만 받는다(그게 남의 이미지를 막는 유일한 관문이다).
22
+ */
23
+ | 'kakao_brand_image_not_found'
24
+ /** 이미 등록된 발신번호 — 이미 발송에 쓸 수 있는 상태라 성공으로 다뤄도 된다. */
25
+ | 'sender_number_already_registered' | 'sender_number_limit_reached' | 'sender_number_limit_unknown' | 'sender_number_holder_unresolved' | 'sender_number_not_account_number' | 'sender_number_not_registrable' | 'sender_number_not_found' | 'sender_number_not_deletable_via_api' | 'api_key_sender_numbers_restricted' | 'KAKAO_TOKEN_INVALID' | 'KAKAO_CHANNEL_ALREADY_LINKED' | 'KAKAO_CHANNEL_REJECTED' | 'KAKAO_RATE_LIMITED' | 'KAKAO_PROVIDER_UNAVAILABLE' | 'VALIDATION' | 'NOT_FOUND' | (string & {});
26
+ declare class ClawOpsError extends Error {
27
+ constructor(message: string);
28
+ }
29
+ declare class APIError extends ClawOpsError {
30
+ readonly request: {
31
+ method: string;
32
+ url: string;
33
+ };
34
+ constructor(message: string, request: {
35
+ method: string;
36
+ url: string;
37
+ });
38
+ }
39
+ declare class APIStatusError extends APIError {
40
+ readonly status: number;
41
+ readonly body: unknown;
42
+ readonly headers: Headers | undefined;
43
+ /**
44
+ * 서버가 함께 보낸 기계 판독용 코드(`{ error, code }`). 없으면 undefined 다.
45
+ *
46
+ * 같은 상태 코드가 서로 다른 사유를 담는다 — 422 만 해도 수신거부(`recipient_blocked`)와
47
+ * 할당량 초과(`quota_exceeded`)가 갈리고, 한글 문구로 구분하면 문구가 바뀔 때 깨진다.
48
+ */
49
+ readonly code: ClawOpsErrorCode | undefined;
50
+ constructor(message: string, response: {
51
+ status: number;
52
+ headers?: Headers;
53
+ }, body: unknown, request: {
54
+ method: string;
55
+ url: string;
56
+ });
57
+ }
58
+ declare class BadRequestError extends APIStatusError {
59
+ readonly status: 400;
60
+ constructor(message: string, response: {
61
+ status: number;
62
+ headers?: Headers;
63
+ }, body: unknown, request: {
64
+ method: string;
65
+ url: string;
66
+ });
67
+ }
68
+ declare class AuthenticationError extends APIStatusError {
69
+ readonly status: 401;
70
+ constructor(message: string, response: {
71
+ status: number;
72
+ headers?: Headers;
73
+ }, body: unknown, request: {
74
+ method: string;
75
+ url: string;
76
+ });
77
+ }
78
+ declare class PermissionDeniedError extends APIStatusError {
79
+ readonly status: 403;
80
+ constructor(message: string, response: {
81
+ status: number;
82
+ headers?: Headers;
83
+ }, body: unknown, request: {
84
+ method: string;
85
+ url: string;
86
+ });
87
+ }
88
+ declare class NotFoundError extends APIStatusError {
89
+ readonly status: 404;
90
+ constructor(message: string, response: {
91
+ status: number;
92
+ headers?: Headers;
93
+ }, body: unknown, request: {
94
+ method: string;
95
+ url: string;
96
+ });
97
+ }
98
+ declare class ConflictError extends APIStatusError {
99
+ readonly status: 409;
100
+ constructor(message: string, response: {
101
+ status: number;
102
+ headers?: Headers;
103
+ }, body: unknown, request: {
104
+ method: string;
105
+ url: string;
106
+ });
107
+ }
108
+ declare class UnprocessableEntityError extends APIStatusError {
109
+ readonly status: 422;
110
+ constructor(message: string, response: {
111
+ status: number;
112
+ headers?: Headers;
113
+ }, body: unknown, request: {
114
+ method: string;
115
+ url: string;
116
+ });
117
+ }
118
+ /**
119
+ * HTTP 429 Too Many Requests.
120
+ *
121
+ * 동시 통화 한도 초과 등 일시적 제한. SDK는 자동 재시도(최대 2회, 지수 backoff)를 수행한다.
122
+ * 즉각 피드백이 필요하면 client 생성 시 maxRetries: 0으로 재시도를 비활성화하라.
123
+ */
124
+ declare class RateLimitError extends APIStatusError {
125
+ readonly status: 429;
126
+ constructor(message: string, response: {
127
+ status: number;
128
+ headers?: Headers;
129
+ }, body: unknown, request: {
130
+ method: string;
131
+ url: string;
132
+ });
133
+ }
134
+ declare class InternalServerError extends APIStatusError {
135
+ readonly status: 500;
136
+ constructor(message: string, response: {
137
+ status: number;
138
+ headers?: Headers;
139
+ }, body: unknown, request: {
140
+ method: string;
141
+ url: string;
142
+ });
143
+ }
144
+ declare class ServiceUnavailableError extends APIStatusError {
145
+ readonly status: 503;
146
+ constructor(message: string, response: {
147
+ status: number;
148
+ headers?: Headers;
149
+ }, body: unknown, request: {
150
+ method: string;
151
+ url: string;
152
+ });
153
+ }
154
+ declare class APIConnectionError extends APIError {
155
+ constructor(request: {
156
+ method: string;
157
+ url: string;
158
+ }, message?: string);
159
+ }
160
+ declare class APITimeoutError extends APIConnectionError {
161
+ constructor(request: {
162
+ method: string;
163
+ url: string;
164
+ });
165
+ }
166
+ declare class APIResponseValidationError extends APIError {
167
+ readonly status: number;
168
+ constructor(response: {
169
+ status: number;
170
+ }, request: {
171
+ method: string;
172
+ url: string;
173
+ });
174
+ }
175
+ /**
176
+ * 솔라피 호환 레이어가 호출을 거절할 때 쓴다.
177
+ * 조용히 다르게 동작하느니 여기서 멈추는 편이 낫다고 판단한 경우들이다.
178
+ */
179
+ declare class SolapiBridgeError extends ClawOpsError {
180
+ constructor(message: string);
181
+ }
182
+ declare class AgentError extends ClawOpsError {
183
+ constructor(message: string);
184
+ }
185
+ declare class AgentConnectionError extends AgentError {
186
+ constructor(message?: string);
187
+ }
188
+ /**
189
+ * The server refused the control connection (HTTP 400·401·403) — retrying gives the same answer.
190
+ *
191
+ * Thrown when the API key is missing, revoked, expired or belongs to another account, or the
192
+ * number is not this account's. The SDK stops reconnecting. `code` is the server's reason
193
+ * (`X-ClawOps-Error-Code`): `api_key_missing` · `api_key_invalid` · `number_missing` ·
194
+ * `number_not_owned`, or `null` from a server that does not send one.
195
+ */
196
+ declare class AgentAuthRejectedError extends AgentConnectionError {
197
+ readonly status: number;
198
+ readonly code: string | null;
199
+ constructor(message: string, options: {
200
+ status: number;
201
+ code: string | null;
202
+ });
203
+ }
204
+
205
+ export { APIConnectionError as A, BadRequestError as B, ClawOpsError as C, InternalServerError as I, NotFoundError as N, PermissionDeniedError as P, RateLimitError as R, ServiceUnavailableError as S, UnprocessableEntityError as U, APIError as a, APIResponseValidationError as b, APIStatusError as c, APITimeoutError as d, AgentAuthRejectedError as e, AgentConnectionError as f, AgentError as g, AuthenticationError as h, type ClawOpsErrorCode as i, ConflictError as j, SolapiBridgeError as k };