@teamlearners/clawops 0.26.0 → 0.28.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/dist/index.d.cts CHANGED
@@ -56,12 +56,30 @@ declare class APIClient {
56
56
  extraQuery?: Record<string, unknown>;
57
57
  timeout?: number;
58
58
  }): Promise<T>;
59
+ _patch<T>(path: string, options: {
60
+ body?: Record<string, unknown> | null;
61
+ castTo: z.ZodType<T>;
62
+ extraHeaders?: Record<string, string>;
63
+ extraQuery?: Record<string, unknown>;
64
+ timeout?: number;
65
+ }): Promise<T>;
59
66
  _getRaw(path: string, options?: {
60
67
  query?: Record<string, unknown> | null;
61
68
  extraHeaders?: Record<string, string>;
62
69
  extraQuery?: Record<string, unknown>;
63
70
  timeout?: number;
64
71
  }): Promise<Response>;
72
+ /**
73
+ * 본문을 돌려주는 DELETE. 기존 `_delete` 는 void 라 응답을 버리는데, soft delete 처럼
74
+ * 삭제 결과 리소스를 그대로 반환하는 endpoint 가 있어서 따로 둔다.
75
+ */
76
+ _deleteWithResponse<T>(path: string, options: {
77
+ body?: Record<string, unknown> | null;
78
+ castTo: z.ZodType<T>;
79
+ extraHeaders?: Record<string, string>;
80
+ extraQuery?: Record<string, unknown>;
81
+ timeout?: number;
82
+ }): Promise<T>;
65
83
  _delete(path: string, options?: {
66
84
  extraHeaders?: Record<string, string>;
67
85
  timeout?: number;
@@ -212,7 +230,7 @@ type AssignmentLink = z.infer<typeof AssignmentLinkSchema>;
212
230
  type AssignmentLinkCreateResponse = z.infer<typeof AssignmentLinkCreateResponseSchema>;
213
231
  type AssignmentLinkStatus = AssignmentLink['status'];
214
232
 
215
- type RequestOptions = {
233
+ type RequestOptions$1 = {
216
234
  extraHeaders?: Record<string, string>;
217
235
  extraQuery?: Record<string, unknown>;
218
236
  timeout?: number;
@@ -228,19 +246,142 @@ declare class AssignmentLinks extends APIResource {
228
246
  webhookUrl?: string;
229
247
  webhookMethod?: 'POST' | 'GET';
230
248
  note?: string;
231
- }, options?: RequestOptions): Promise<AssignmentLinkCreateResponse>;
249
+ }, options?: RequestOptions$1): Promise<AssignmentLinkCreateResponse>;
232
250
  list(params?: {
233
251
  status?: AssignmentLinkStatus;
234
252
  page?: number;
235
253
  pageSize?: number;
236
- }, options?: RequestOptions): Promise<Page<AssignmentLink>>;
237
- retrieve(linkId: string, options?: RequestOptions): Promise<AssignmentLink>;
254
+ }, options?: RequestOptions$1): Promise<Page<AssignmentLink>>;
255
+ retrieve(linkId: string, options?: RequestOptions$1): Promise<AssignmentLink>;
238
256
  revoke(linkId: string, options?: {
239
257
  extraHeaders?: Record<string, string>;
240
258
  timeout?: number;
241
259
  }): Promise<void>;
242
260
  }
243
261
 
262
+ declare const BlockedRecipientSchema: z.ZodObject<{
263
+ id: z.ZodString;
264
+ /** 국내 표기로 정규화된 번호 (예 '01012345678'). */
265
+ number: z.ZodString;
266
+ channel: z.ZodEnum<["call", "message"]>;
267
+ /** 지금 차단 중인지. 해제분도 이력으로 조회되므로 이 값으로 구분한다. */
268
+ active: z.ZodBoolean;
269
+ source: z.ZodString;
270
+ sourceRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
271
+ note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
272
+ createdBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
273
+ createdAt: z.ZodString;
274
+ updatedAt: z.ZodString;
275
+ unblockedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
276
+ unblockedSource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
277
+ unblockedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
278
+ unblockedNote: z.ZodOptional<z.ZodNullable<z.ZodString>>;
279
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
280
+ id: z.ZodString;
281
+ /** 국내 표기로 정규화된 번호 (예 '01012345678'). */
282
+ number: z.ZodString;
283
+ channel: z.ZodEnum<["call", "message"]>;
284
+ /** 지금 차단 중인지. 해제분도 이력으로 조회되므로 이 값으로 구분한다. */
285
+ active: z.ZodBoolean;
286
+ source: z.ZodString;
287
+ sourceRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
288
+ note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
289
+ createdBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
290
+ createdAt: z.ZodString;
291
+ updatedAt: z.ZodString;
292
+ unblockedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
293
+ unblockedSource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
294
+ unblockedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
295
+ unblockedNote: z.ZodOptional<z.ZodNullable<z.ZodString>>;
296
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
297
+ id: z.ZodString;
298
+ /** 국내 표기로 정규화된 번호 (예 '01012345678'). */
299
+ number: z.ZodString;
300
+ channel: z.ZodEnum<["call", "message"]>;
301
+ /** 지금 차단 중인지. 해제분도 이력으로 조회되므로 이 값으로 구분한다. */
302
+ active: z.ZodBoolean;
303
+ source: z.ZodString;
304
+ sourceRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
305
+ note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
306
+ createdBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
307
+ createdAt: z.ZodString;
308
+ updatedAt: z.ZodString;
309
+ unblockedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
310
+ unblockedSource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
311
+ unblockedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
312
+ unblockedNote: z.ZodOptional<z.ZodNullable<z.ZodString>>;
313
+ }, z.ZodTypeAny, "passthrough">>;
314
+ type BlockedRecipient = z.infer<typeof BlockedRecipientSchema>;
315
+ type BlockedChannel = BlockedRecipient['channel'];
316
+ type BlockedRecipientStatus = 'active' | 'released' | 'all';
317
+ type BlockedRecipientSource = 'api' | 'console' | 'import';
318
+
319
+ type RequestOptions = {
320
+ extraHeaders?: Record<string, string>;
321
+ extraQuery?: Record<string, unknown>;
322
+ timeout?: number;
323
+ };
324
+ /**
325
+ * 수신거부(DNC) 명단 리소스.
326
+ *
327
+ * 등록된 번호는 이 계정의 **발신**(전화·문자)에서 제외됩니다. 착신은 막지 않습니다 —
328
+ * 그 번호에서 걸려오는 전화는 그대로 받습니다.
329
+ *
330
+ * 전화와 문자는 각각 따로 차단합니다. 같은 번호라도 채널마다 별개 항목이므로,
331
+ * 둘 다 막으려면 `channel` 을 바꿔 두 번 등록합니다.
332
+ */
333
+ declare class BlockedRecipients extends APIResource {
334
+ /**
335
+ * 번호를 수신거부 명단에 등록합니다.
336
+ *
337
+ * 하이픈·`+82` 표기 모두 허용되며 국내 표기로 정규화되어 저장됩니다.
338
+ *
339
+ * **멱등입니다** — 이미 차단 중인 (번호, 채널)을 다시 등록해도 에러가 아니라 기존 항목을
340
+ * 돌려줍니다. 같은 사람이 수신거부를 두 번 요청하는 것은 정상 상황이기 때문입니다.
341
+ */
342
+ create(params: {
343
+ number: string;
344
+ channel: BlockedChannel;
345
+ source?: BlockedRecipientSource;
346
+ sourceRef?: string;
347
+ note?: string;
348
+ }, options?: RequestOptions): Promise<BlockedRecipient>;
349
+ /**
350
+ * 수신거부 목록을 조회합니다. 기본은 **현재 차단 중인 항목만** 이며,
351
+ * 해제 이력까지 보려면 `status` 를 `'released'` 또는 `'all'` 로 지정합니다.
352
+ */
353
+ list(params?: {
354
+ channel?: BlockedChannel;
355
+ number?: string;
356
+ status?: BlockedRecipientStatus;
357
+ page?: number;
358
+ pageSize?: number;
359
+ }, options?: RequestOptions): Promise<Page<BlockedRecipient>>;
360
+ /** 항목 상세를 조회합니다. 해제된 항목도 이력으로 남아 조회됩니다(`active: false`). */
361
+ retrieve(blockId: string, options?: RequestOptions): Promise<BlockedRecipient>;
362
+ /**
363
+ * 메모를 수정합니다.
364
+ *
365
+ * 번호와 채널은 바꿀 수 없습니다 — 바꾸면 "누가 무엇을 언제 거부했는가"라는 증빙이
366
+ * 뒤틀립니다. 잘못 등록했다면 해제한 뒤 올바른 번호로 새로 등록하세요.
367
+ */
368
+ update(blockId: string, params?: {
369
+ note?: string | null;
370
+ }, options?: RequestOptions): Promise<BlockedRecipient>;
371
+ /**
372
+ * 수신거부를 해제해 다시 발신할 수 있게 합니다.
373
+ *
374
+ * **항목은 삭제되지 않습니다.** `active` 가 false 가 되고 `unblockedAt` 이 기록될 뿐,
375
+ * 행은 이력으로 남습니다 — 언제 거부했고 언제 풀렸는지가 곧 증빙이기 때문입니다.
376
+ * 해제분은 `list({ status: 'released' })` 로 볼 수 있습니다.
377
+ *
378
+ * 이미 해제된 항목에 다시 호출해도 성공하며, 최초 해제 시각은 덮어쓰지 않습니다.
379
+ */
380
+ release(blockId: string, params?: {
381
+ note?: string;
382
+ }, options?: RequestOptions): Promise<BlockedRecipient>;
383
+ }
384
+
244
385
  declare const CallSchema: z.ZodObject<{
245
386
  callId: z.ZodString;
246
387
  /**
@@ -257,6 +398,33 @@ declare const CallSchema: z.ZodObject<{
257
398
  recordingUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
258
399
  /** AMD(machineDetection) 결과 — AMD 켠 발신 통화에만 값 존재. */
259
400
  answeredBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["human", "machine", "unknown"]>>>;
401
+ /**
402
+ * 통화 종료 사유. status 가 왜 그렇게 끝났는지를 구분한다 — 특히 failed 는 결번·망 오류·
403
+ * 시스템 오류를 모두 포함하는 대분류라, 발신 리스트를 정제하려면 status 가 아니라 이 값을 본다.
404
+ *
405
+ * 재시도해도 소용없음: invalid_number(결번) / number_changed / incompatible_destination.
406
+ * 재시도 가치 있음: no_answer / user_busy / temporary_failure / switching_congestion /
407
+ * no_circuit_available / network_out_of_order / destination_out_of_order /
408
+ * recovery_on_timer_expire / resource_unavailable.
409
+ * 그 외: normal_clearing(정상 종료) / caller_canceled / call_rejected / protocol_error /
410
+ * unspecified / app_error·call_stuck(ClawOps 측 오류 — 재시도 권장) / unknown.
411
+ *
412
+ * enum 으로 좁히지 않는다 — 통신망이 새 cause 를 보내면 서버가 값을 넓히는데, 그때마다
413
+ * SDK 릴리즈를 기다려야 파싱되는 구조는 안 된다.
414
+ */
415
+ hangupCause: z.ZodOptional<z.ZodNullable<z.ZodString>>;
416
+ /** 통신망 Q.850 cause code. 1·5·28=결번, 16=정상해제, 17=통화중, 19=무응답, 38=망장애. */
417
+ hangupCauseQ850: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
418
+ /**
419
+ * 종료를 유발한 SIP 응답코드(404=없는 번호, 486=통화중, 500=망 오류 등).
420
+ * 국내 통신망은 실제 사유를 500 으로 감싸 보내기도 하므로 hangupCause 가 더 정확하다.
421
+ */
422
+ sipResponseCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
423
+ /**
424
+ * 종료 책임 주체. carrier(통신망) / callee(수신자) / caller(발신자) /
425
+ * app·system(ClawOps 측 오류 — 수신자 번호를 정제 대상에 넣지 말고 재시도할 것).
426
+ */
427
+ hangupSource: z.ZodOptional<z.ZodNullable<z.ZodEnum<["carrier", "callee", "caller", "app", "system"]>>>;
260
428
  accountId: z.ZodString;
261
429
  dateCreated: z.ZodString;
262
430
  dateUpdated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -276,6 +444,33 @@ declare const CallSchema: z.ZodObject<{
276
444
  recordingUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
277
445
  /** AMD(machineDetection) 결과 — AMD 켠 발신 통화에만 값 존재. */
278
446
  answeredBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["human", "machine", "unknown"]>>>;
447
+ /**
448
+ * 통화 종료 사유. status 가 왜 그렇게 끝났는지를 구분한다 — 특히 failed 는 결번·망 오류·
449
+ * 시스템 오류를 모두 포함하는 대분류라, 발신 리스트를 정제하려면 status 가 아니라 이 값을 본다.
450
+ *
451
+ * 재시도해도 소용없음: invalid_number(결번) / number_changed / incompatible_destination.
452
+ * 재시도 가치 있음: no_answer / user_busy / temporary_failure / switching_congestion /
453
+ * no_circuit_available / network_out_of_order / destination_out_of_order /
454
+ * recovery_on_timer_expire / resource_unavailable.
455
+ * 그 외: normal_clearing(정상 종료) / caller_canceled / call_rejected / protocol_error /
456
+ * unspecified / app_error·call_stuck(ClawOps 측 오류 — 재시도 권장) / unknown.
457
+ *
458
+ * enum 으로 좁히지 않는다 — 통신망이 새 cause 를 보내면 서버가 값을 넓히는데, 그때마다
459
+ * SDK 릴리즈를 기다려야 파싱되는 구조는 안 된다.
460
+ */
461
+ hangupCause: z.ZodOptional<z.ZodNullable<z.ZodString>>;
462
+ /** 통신망 Q.850 cause code. 1·5·28=결번, 16=정상해제, 17=통화중, 19=무응답, 38=망장애. */
463
+ hangupCauseQ850: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
464
+ /**
465
+ * 종료를 유발한 SIP 응답코드(404=없는 번호, 486=통화중, 500=망 오류 등).
466
+ * 국내 통신망은 실제 사유를 500 으로 감싸 보내기도 하므로 hangupCause 가 더 정확하다.
467
+ */
468
+ sipResponseCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
469
+ /**
470
+ * 종료 책임 주체. carrier(통신망) / callee(수신자) / caller(발신자) /
471
+ * app·system(ClawOps 측 오류 — 수신자 번호를 정제 대상에 넣지 말고 재시도할 것).
472
+ */
473
+ hangupSource: z.ZodOptional<z.ZodNullable<z.ZodEnum<["carrier", "callee", "caller", "app", "system"]>>>;
279
474
  accountId: z.ZodString;
280
475
  dateCreated: z.ZodString;
281
476
  dateUpdated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -295,6 +490,33 @@ declare const CallSchema: z.ZodObject<{
295
490
  recordingUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
296
491
  /** AMD(machineDetection) 결과 — AMD 켠 발신 통화에만 값 존재. */
297
492
  answeredBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["human", "machine", "unknown"]>>>;
493
+ /**
494
+ * 통화 종료 사유. status 가 왜 그렇게 끝났는지를 구분한다 — 특히 failed 는 결번·망 오류·
495
+ * 시스템 오류를 모두 포함하는 대분류라, 발신 리스트를 정제하려면 status 가 아니라 이 값을 본다.
496
+ *
497
+ * 재시도해도 소용없음: invalid_number(결번) / number_changed / incompatible_destination.
498
+ * 재시도 가치 있음: no_answer / user_busy / temporary_failure / switching_congestion /
499
+ * no_circuit_available / network_out_of_order / destination_out_of_order /
500
+ * recovery_on_timer_expire / resource_unavailable.
501
+ * 그 외: normal_clearing(정상 종료) / caller_canceled / call_rejected / protocol_error /
502
+ * unspecified / app_error·call_stuck(ClawOps 측 오류 — 재시도 권장) / unknown.
503
+ *
504
+ * enum 으로 좁히지 않는다 — 통신망이 새 cause 를 보내면 서버가 값을 넓히는데, 그때마다
505
+ * SDK 릴리즈를 기다려야 파싱되는 구조는 안 된다.
506
+ */
507
+ hangupCause: z.ZodOptional<z.ZodNullable<z.ZodString>>;
508
+ /** 통신망 Q.850 cause code. 1·5·28=결번, 16=정상해제, 17=통화중, 19=무응답, 38=망장애. */
509
+ hangupCauseQ850: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
510
+ /**
511
+ * 종료를 유발한 SIP 응답코드(404=없는 번호, 486=통화중, 500=망 오류 등).
512
+ * 국내 통신망은 실제 사유를 500 으로 감싸 보내기도 하므로 hangupCause 가 더 정확하다.
513
+ */
514
+ sipResponseCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
515
+ /**
516
+ * 종료 책임 주체. carrier(통신망) / callee(수신자) / caller(발신자) /
517
+ * app·system(ClawOps 측 오류 — 수신자 번호를 정제 대상에 넣지 말고 재시도할 것).
518
+ */
519
+ hangupSource: z.ZodOptional<z.ZodNullable<z.ZodEnum<["carrier", "callee", "caller", "app", "system"]>>>;
298
520
  accountId: z.ZodString;
299
521
  dateCreated: z.ZodString;
300
522
  dateUpdated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -908,6 +1130,7 @@ declare class AccountContext {
908
1130
  get recordings(): Recordings;
909
1131
  get webhookLogs(): WebhookLogs;
910
1132
  get assignmentLinks(): AssignmentLinks;
1133
+ get blockedRecipients(): BlockedRecipients;
911
1134
  }
912
1135
 
913
1136
  declare class ClawOpsError extends Error {
@@ -1092,6 +1315,7 @@ declare class ClawOps extends APIClient {
1092
1315
  get recordings(): Recordings;
1093
1316
  get webhookLogs(): WebhookLogs;
1094
1317
  get assignmentLinks(): AssignmentLinks;
1318
+ get blockedRecipients(): BlockedRecipients;
1095
1319
  get webhooks(): Webhooks;
1096
1320
  accounts(accountId: string): AccountContext;
1097
1321
  }
@@ -1113,4 +1337,4 @@ declare const PaginationMetaSchema: z.ZodObject<{
1113
1337
  }, z.ZodTypeAny, "passthrough">>;
1114
1338
  type PaginationMeta = z.infer<typeof PaginationMetaSchema>;
1115
1339
 
1116
- export { APIClient, type APIClientOptions, APIConnectionError, APIError, APIResponseValidationError, APIStatusError, APITimeoutError, AccountContext, AgentConnectionError, AgentError, type AssignmentLink, type AssignmentLinkAssignment, type AssignmentLinkCreateResponse, type AssignmentLinkStatus, AssignmentLinks, AuthenticationError, BadRequestError, type Call, type CallControlResponse, type CallCreateParams, type CallListParams, type CallUpdateParams, Calls, ClawOps, ClawOpsError, type ClawOpsOptions, ConflictError, InternalServerError, type Message, type MessageCreateParams, type MessageListParams, Messages, NotFoundError, type NumberCreateParams, type NumberListItem, type NumberUpdateParams, type NumberUpdateResponse, Numbers, Page, type PaginationMeta, PermissionDeniedError, type PhoneNumber, RateLimitError, type RecordingDownload, Recordings, ServiceUnavailableError, type SipCredential, SipCredentials, type SipEndpoint, SipEndpoints, UnprocessableEntityError, VERSION, type WebhookLog, WebhookLogs, WebhookVerificationError, Webhooks, ClawOps as default };
1340
+ export { APIClient, type APIClientOptions, APIConnectionError, APIError, APIResponseValidationError, APIStatusError, APITimeoutError, AccountContext, AgentConnectionError, AgentError, type AssignmentLink, type AssignmentLinkAssignment, type AssignmentLinkCreateResponse, type AssignmentLinkStatus, AssignmentLinks, AuthenticationError, BadRequestError, type BlockedChannel, type BlockedRecipient, type BlockedRecipientSource, type BlockedRecipientStatus, BlockedRecipients, type Call, type CallControlResponse, type CallCreateParams, type CallListParams, type CallUpdateParams, Calls, ClawOps, ClawOpsError, type ClawOpsOptions, ConflictError, InternalServerError, type Message, type MessageCreateParams, type MessageListParams, Messages, NotFoundError, type NumberCreateParams, type NumberListItem, type NumberUpdateParams, type NumberUpdateResponse, Numbers, Page, type PaginationMeta, PermissionDeniedError, type PhoneNumber, RateLimitError, type RecordingDownload, Recordings, ServiceUnavailableError, type SipCredential, SipCredentials, type SipEndpoint, SipEndpoints, UnprocessableEntityError, VERSION, type WebhookLog, WebhookLogs, WebhookVerificationError, Webhooks, ClawOps as default };
package/dist/index.d.ts CHANGED
@@ -56,12 +56,30 @@ declare class APIClient {
56
56
  extraQuery?: Record<string, unknown>;
57
57
  timeout?: number;
58
58
  }): Promise<T>;
59
+ _patch<T>(path: string, options: {
60
+ body?: Record<string, unknown> | null;
61
+ castTo: z.ZodType<T>;
62
+ extraHeaders?: Record<string, string>;
63
+ extraQuery?: Record<string, unknown>;
64
+ timeout?: number;
65
+ }): Promise<T>;
59
66
  _getRaw(path: string, options?: {
60
67
  query?: Record<string, unknown> | null;
61
68
  extraHeaders?: Record<string, string>;
62
69
  extraQuery?: Record<string, unknown>;
63
70
  timeout?: number;
64
71
  }): Promise<Response>;
72
+ /**
73
+ * 본문을 돌려주는 DELETE. 기존 `_delete` 는 void 라 응답을 버리는데, soft delete 처럼
74
+ * 삭제 결과 리소스를 그대로 반환하는 endpoint 가 있어서 따로 둔다.
75
+ */
76
+ _deleteWithResponse<T>(path: string, options: {
77
+ body?: Record<string, unknown> | null;
78
+ castTo: z.ZodType<T>;
79
+ extraHeaders?: Record<string, string>;
80
+ extraQuery?: Record<string, unknown>;
81
+ timeout?: number;
82
+ }): Promise<T>;
65
83
  _delete(path: string, options?: {
66
84
  extraHeaders?: Record<string, string>;
67
85
  timeout?: number;
@@ -212,7 +230,7 @@ type AssignmentLink = z.infer<typeof AssignmentLinkSchema>;
212
230
  type AssignmentLinkCreateResponse = z.infer<typeof AssignmentLinkCreateResponseSchema>;
213
231
  type AssignmentLinkStatus = AssignmentLink['status'];
214
232
 
215
- type RequestOptions = {
233
+ type RequestOptions$1 = {
216
234
  extraHeaders?: Record<string, string>;
217
235
  extraQuery?: Record<string, unknown>;
218
236
  timeout?: number;
@@ -228,19 +246,142 @@ declare class AssignmentLinks extends APIResource {
228
246
  webhookUrl?: string;
229
247
  webhookMethod?: 'POST' | 'GET';
230
248
  note?: string;
231
- }, options?: RequestOptions): Promise<AssignmentLinkCreateResponse>;
249
+ }, options?: RequestOptions$1): Promise<AssignmentLinkCreateResponse>;
232
250
  list(params?: {
233
251
  status?: AssignmentLinkStatus;
234
252
  page?: number;
235
253
  pageSize?: number;
236
- }, options?: RequestOptions): Promise<Page<AssignmentLink>>;
237
- retrieve(linkId: string, options?: RequestOptions): Promise<AssignmentLink>;
254
+ }, options?: RequestOptions$1): Promise<Page<AssignmentLink>>;
255
+ retrieve(linkId: string, options?: RequestOptions$1): Promise<AssignmentLink>;
238
256
  revoke(linkId: string, options?: {
239
257
  extraHeaders?: Record<string, string>;
240
258
  timeout?: number;
241
259
  }): Promise<void>;
242
260
  }
243
261
 
262
+ declare const BlockedRecipientSchema: z.ZodObject<{
263
+ id: z.ZodString;
264
+ /** 국내 표기로 정규화된 번호 (예 '01012345678'). */
265
+ number: z.ZodString;
266
+ channel: z.ZodEnum<["call", "message"]>;
267
+ /** 지금 차단 중인지. 해제분도 이력으로 조회되므로 이 값으로 구분한다. */
268
+ active: z.ZodBoolean;
269
+ source: z.ZodString;
270
+ sourceRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
271
+ note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
272
+ createdBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
273
+ createdAt: z.ZodString;
274
+ updatedAt: z.ZodString;
275
+ unblockedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
276
+ unblockedSource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
277
+ unblockedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
278
+ unblockedNote: z.ZodOptional<z.ZodNullable<z.ZodString>>;
279
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
280
+ id: z.ZodString;
281
+ /** 국내 표기로 정규화된 번호 (예 '01012345678'). */
282
+ number: z.ZodString;
283
+ channel: z.ZodEnum<["call", "message"]>;
284
+ /** 지금 차단 중인지. 해제분도 이력으로 조회되므로 이 값으로 구분한다. */
285
+ active: z.ZodBoolean;
286
+ source: z.ZodString;
287
+ sourceRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
288
+ note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
289
+ createdBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
290
+ createdAt: z.ZodString;
291
+ updatedAt: z.ZodString;
292
+ unblockedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
293
+ unblockedSource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
294
+ unblockedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
295
+ unblockedNote: z.ZodOptional<z.ZodNullable<z.ZodString>>;
296
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
297
+ id: z.ZodString;
298
+ /** 국내 표기로 정규화된 번호 (예 '01012345678'). */
299
+ number: z.ZodString;
300
+ channel: z.ZodEnum<["call", "message"]>;
301
+ /** 지금 차단 중인지. 해제분도 이력으로 조회되므로 이 값으로 구분한다. */
302
+ active: z.ZodBoolean;
303
+ source: z.ZodString;
304
+ sourceRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
305
+ note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
306
+ createdBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
307
+ createdAt: z.ZodString;
308
+ updatedAt: z.ZodString;
309
+ unblockedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
310
+ unblockedSource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
311
+ unblockedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
312
+ unblockedNote: z.ZodOptional<z.ZodNullable<z.ZodString>>;
313
+ }, z.ZodTypeAny, "passthrough">>;
314
+ type BlockedRecipient = z.infer<typeof BlockedRecipientSchema>;
315
+ type BlockedChannel = BlockedRecipient['channel'];
316
+ type BlockedRecipientStatus = 'active' | 'released' | 'all';
317
+ type BlockedRecipientSource = 'api' | 'console' | 'import';
318
+
319
+ type RequestOptions = {
320
+ extraHeaders?: Record<string, string>;
321
+ extraQuery?: Record<string, unknown>;
322
+ timeout?: number;
323
+ };
324
+ /**
325
+ * 수신거부(DNC) 명단 리소스.
326
+ *
327
+ * 등록된 번호는 이 계정의 **발신**(전화·문자)에서 제외됩니다. 착신은 막지 않습니다 —
328
+ * 그 번호에서 걸려오는 전화는 그대로 받습니다.
329
+ *
330
+ * 전화와 문자는 각각 따로 차단합니다. 같은 번호라도 채널마다 별개 항목이므로,
331
+ * 둘 다 막으려면 `channel` 을 바꿔 두 번 등록합니다.
332
+ */
333
+ declare class BlockedRecipients extends APIResource {
334
+ /**
335
+ * 번호를 수신거부 명단에 등록합니다.
336
+ *
337
+ * 하이픈·`+82` 표기 모두 허용되며 국내 표기로 정규화되어 저장됩니다.
338
+ *
339
+ * **멱등입니다** — 이미 차단 중인 (번호, 채널)을 다시 등록해도 에러가 아니라 기존 항목을
340
+ * 돌려줍니다. 같은 사람이 수신거부를 두 번 요청하는 것은 정상 상황이기 때문입니다.
341
+ */
342
+ create(params: {
343
+ number: string;
344
+ channel: BlockedChannel;
345
+ source?: BlockedRecipientSource;
346
+ sourceRef?: string;
347
+ note?: string;
348
+ }, options?: RequestOptions): Promise<BlockedRecipient>;
349
+ /**
350
+ * 수신거부 목록을 조회합니다. 기본은 **현재 차단 중인 항목만** 이며,
351
+ * 해제 이력까지 보려면 `status` 를 `'released'` 또는 `'all'` 로 지정합니다.
352
+ */
353
+ list(params?: {
354
+ channel?: BlockedChannel;
355
+ number?: string;
356
+ status?: BlockedRecipientStatus;
357
+ page?: number;
358
+ pageSize?: number;
359
+ }, options?: RequestOptions): Promise<Page<BlockedRecipient>>;
360
+ /** 항목 상세를 조회합니다. 해제된 항목도 이력으로 남아 조회됩니다(`active: false`). */
361
+ retrieve(blockId: string, options?: RequestOptions): Promise<BlockedRecipient>;
362
+ /**
363
+ * 메모를 수정합니다.
364
+ *
365
+ * 번호와 채널은 바꿀 수 없습니다 — 바꾸면 "누가 무엇을 언제 거부했는가"라는 증빙이
366
+ * 뒤틀립니다. 잘못 등록했다면 해제한 뒤 올바른 번호로 새로 등록하세요.
367
+ */
368
+ update(blockId: string, params?: {
369
+ note?: string | null;
370
+ }, options?: RequestOptions): Promise<BlockedRecipient>;
371
+ /**
372
+ * 수신거부를 해제해 다시 발신할 수 있게 합니다.
373
+ *
374
+ * **항목은 삭제되지 않습니다.** `active` 가 false 가 되고 `unblockedAt` 이 기록될 뿐,
375
+ * 행은 이력으로 남습니다 — 언제 거부했고 언제 풀렸는지가 곧 증빙이기 때문입니다.
376
+ * 해제분은 `list({ status: 'released' })` 로 볼 수 있습니다.
377
+ *
378
+ * 이미 해제된 항목에 다시 호출해도 성공하며, 최초 해제 시각은 덮어쓰지 않습니다.
379
+ */
380
+ release(blockId: string, params?: {
381
+ note?: string;
382
+ }, options?: RequestOptions): Promise<BlockedRecipient>;
383
+ }
384
+
244
385
  declare const CallSchema: z.ZodObject<{
245
386
  callId: z.ZodString;
246
387
  /**
@@ -257,6 +398,33 @@ declare const CallSchema: z.ZodObject<{
257
398
  recordingUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
258
399
  /** AMD(machineDetection) 결과 — AMD 켠 발신 통화에만 값 존재. */
259
400
  answeredBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["human", "machine", "unknown"]>>>;
401
+ /**
402
+ * 통화 종료 사유. status 가 왜 그렇게 끝났는지를 구분한다 — 특히 failed 는 결번·망 오류·
403
+ * 시스템 오류를 모두 포함하는 대분류라, 발신 리스트를 정제하려면 status 가 아니라 이 값을 본다.
404
+ *
405
+ * 재시도해도 소용없음: invalid_number(결번) / number_changed / incompatible_destination.
406
+ * 재시도 가치 있음: no_answer / user_busy / temporary_failure / switching_congestion /
407
+ * no_circuit_available / network_out_of_order / destination_out_of_order /
408
+ * recovery_on_timer_expire / resource_unavailable.
409
+ * 그 외: normal_clearing(정상 종료) / caller_canceled / call_rejected / protocol_error /
410
+ * unspecified / app_error·call_stuck(ClawOps 측 오류 — 재시도 권장) / unknown.
411
+ *
412
+ * enum 으로 좁히지 않는다 — 통신망이 새 cause 를 보내면 서버가 값을 넓히는데, 그때마다
413
+ * SDK 릴리즈를 기다려야 파싱되는 구조는 안 된다.
414
+ */
415
+ hangupCause: z.ZodOptional<z.ZodNullable<z.ZodString>>;
416
+ /** 통신망 Q.850 cause code. 1·5·28=결번, 16=정상해제, 17=통화중, 19=무응답, 38=망장애. */
417
+ hangupCauseQ850: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
418
+ /**
419
+ * 종료를 유발한 SIP 응답코드(404=없는 번호, 486=통화중, 500=망 오류 등).
420
+ * 국내 통신망은 실제 사유를 500 으로 감싸 보내기도 하므로 hangupCause 가 더 정확하다.
421
+ */
422
+ sipResponseCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
423
+ /**
424
+ * 종료 책임 주체. carrier(통신망) / callee(수신자) / caller(발신자) /
425
+ * app·system(ClawOps 측 오류 — 수신자 번호를 정제 대상에 넣지 말고 재시도할 것).
426
+ */
427
+ hangupSource: z.ZodOptional<z.ZodNullable<z.ZodEnum<["carrier", "callee", "caller", "app", "system"]>>>;
260
428
  accountId: z.ZodString;
261
429
  dateCreated: z.ZodString;
262
430
  dateUpdated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -276,6 +444,33 @@ declare const CallSchema: z.ZodObject<{
276
444
  recordingUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
277
445
  /** AMD(machineDetection) 결과 — AMD 켠 발신 통화에만 값 존재. */
278
446
  answeredBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["human", "machine", "unknown"]>>>;
447
+ /**
448
+ * 통화 종료 사유. status 가 왜 그렇게 끝났는지를 구분한다 — 특히 failed 는 결번·망 오류·
449
+ * 시스템 오류를 모두 포함하는 대분류라, 발신 리스트를 정제하려면 status 가 아니라 이 값을 본다.
450
+ *
451
+ * 재시도해도 소용없음: invalid_number(결번) / number_changed / incompatible_destination.
452
+ * 재시도 가치 있음: no_answer / user_busy / temporary_failure / switching_congestion /
453
+ * no_circuit_available / network_out_of_order / destination_out_of_order /
454
+ * recovery_on_timer_expire / resource_unavailable.
455
+ * 그 외: normal_clearing(정상 종료) / caller_canceled / call_rejected / protocol_error /
456
+ * unspecified / app_error·call_stuck(ClawOps 측 오류 — 재시도 권장) / unknown.
457
+ *
458
+ * enum 으로 좁히지 않는다 — 통신망이 새 cause 를 보내면 서버가 값을 넓히는데, 그때마다
459
+ * SDK 릴리즈를 기다려야 파싱되는 구조는 안 된다.
460
+ */
461
+ hangupCause: z.ZodOptional<z.ZodNullable<z.ZodString>>;
462
+ /** 통신망 Q.850 cause code. 1·5·28=결번, 16=정상해제, 17=통화중, 19=무응답, 38=망장애. */
463
+ hangupCauseQ850: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
464
+ /**
465
+ * 종료를 유발한 SIP 응답코드(404=없는 번호, 486=통화중, 500=망 오류 등).
466
+ * 국내 통신망은 실제 사유를 500 으로 감싸 보내기도 하므로 hangupCause 가 더 정확하다.
467
+ */
468
+ sipResponseCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
469
+ /**
470
+ * 종료 책임 주체. carrier(통신망) / callee(수신자) / caller(발신자) /
471
+ * app·system(ClawOps 측 오류 — 수신자 번호를 정제 대상에 넣지 말고 재시도할 것).
472
+ */
473
+ hangupSource: z.ZodOptional<z.ZodNullable<z.ZodEnum<["carrier", "callee", "caller", "app", "system"]>>>;
279
474
  accountId: z.ZodString;
280
475
  dateCreated: z.ZodString;
281
476
  dateUpdated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -295,6 +490,33 @@ declare const CallSchema: z.ZodObject<{
295
490
  recordingUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
296
491
  /** AMD(machineDetection) 결과 — AMD 켠 발신 통화에만 값 존재. */
297
492
  answeredBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<["human", "machine", "unknown"]>>>;
493
+ /**
494
+ * 통화 종료 사유. status 가 왜 그렇게 끝났는지를 구분한다 — 특히 failed 는 결번·망 오류·
495
+ * 시스템 오류를 모두 포함하는 대분류라, 발신 리스트를 정제하려면 status 가 아니라 이 값을 본다.
496
+ *
497
+ * 재시도해도 소용없음: invalid_number(결번) / number_changed / incompatible_destination.
498
+ * 재시도 가치 있음: no_answer / user_busy / temporary_failure / switching_congestion /
499
+ * no_circuit_available / network_out_of_order / destination_out_of_order /
500
+ * recovery_on_timer_expire / resource_unavailable.
501
+ * 그 외: normal_clearing(정상 종료) / caller_canceled / call_rejected / protocol_error /
502
+ * unspecified / app_error·call_stuck(ClawOps 측 오류 — 재시도 권장) / unknown.
503
+ *
504
+ * enum 으로 좁히지 않는다 — 통신망이 새 cause 를 보내면 서버가 값을 넓히는데, 그때마다
505
+ * SDK 릴리즈를 기다려야 파싱되는 구조는 안 된다.
506
+ */
507
+ hangupCause: z.ZodOptional<z.ZodNullable<z.ZodString>>;
508
+ /** 통신망 Q.850 cause code. 1·5·28=결번, 16=정상해제, 17=통화중, 19=무응답, 38=망장애. */
509
+ hangupCauseQ850: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
510
+ /**
511
+ * 종료를 유발한 SIP 응답코드(404=없는 번호, 486=통화중, 500=망 오류 등).
512
+ * 국내 통신망은 실제 사유를 500 으로 감싸 보내기도 하므로 hangupCause 가 더 정확하다.
513
+ */
514
+ sipResponseCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
515
+ /**
516
+ * 종료 책임 주체. carrier(통신망) / callee(수신자) / caller(발신자) /
517
+ * app·system(ClawOps 측 오류 — 수신자 번호를 정제 대상에 넣지 말고 재시도할 것).
518
+ */
519
+ hangupSource: z.ZodOptional<z.ZodNullable<z.ZodEnum<["carrier", "callee", "caller", "app", "system"]>>>;
298
520
  accountId: z.ZodString;
299
521
  dateCreated: z.ZodString;
300
522
  dateUpdated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -908,6 +1130,7 @@ declare class AccountContext {
908
1130
  get recordings(): Recordings;
909
1131
  get webhookLogs(): WebhookLogs;
910
1132
  get assignmentLinks(): AssignmentLinks;
1133
+ get blockedRecipients(): BlockedRecipients;
911
1134
  }
912
1135
 
913
1136
  declare class ClawOpsError extends Error {
@@ -1092,6 +1315,7 @@ declare class ClawOps extends APIClient {
1092
1315
  get recordings(): Recordings;
1093
1316
  get webhookLogs(): WebhookLogs;
1094
1317
  get assignmentLinks(): AssignmentLinks;
1318
+ get blockedRecipients(): BlockedRecipients;
1095
1319
  get webhooks(): Webhooks;
1096
1320
  accounts(accountId: string): AccountContext;
1097
1321
  }
@@ -1113,4 +1337,4 @@ declare const PaginationMetaSchema: z.ZodObject<{
1113
1337
  }, z.ZodTypeAny, "passthrough">>;
1114
1338
  type PaginationMeta = z.infer<typeof PaginationMetaSchema>;
1115
1339
 
1116
- export { APIClient, type APIClientOptions, APIConnectionError, APIError, APIResponseValidationError, APIStatusError, APITimeoutError, AccountContext, AgentConnectionError, AgentError, type AssignmentLink, type AssignmentLinkAssignment, type AssignmentLinkCreateResponse, type AssignmentLinkStatus, AssignmentLinks, AuthenticationError, BadRequestError, type Call, type CallControlResponse, type CallCreateParams, type CallListParams, type CallUpdateParams, Calls, ClawOps, ClawOpsError, type ClawOpsOptions, ConflictError, InternalServerError, type Message, type MessageCreateParams, type MessageListParams, Messages, NotFoundError, type NumberCreateParams, type NumberListItem, type NumberUpdateParams, type NumberUpdateResponse, Numbers, Page, type PaginationMeta, PermissionDeniedError, type PhoneNumber, RateLimitError, type RecordingDownload, Recordings, ServiceUnavailableError, type SipCredential, SipCredentials, type SipEndpoint, SipEndpoints, UnprocessableEntityError, VERSION, type WebhookLog, WebhookLogs, WebhookVerificationError, Webhooks, ClawOps as default };
1340
+ export { APIClient, type APIClientOptions, APIConnectionError, APIError, APIResponseValidationError, APIStatusError, APITimeoutError, AccountContext, AgentConnectionError, AgentError, type AssignmentLink, type AssignmentLinkAssignment, type AssignmentLinkCreateResponse, type AssignmentLinkStatus, AssignmentLinks, AuthenticationError, BadRequestError, type BlockedChannel, type BlockedRecipient, type BlockedRecipientSource, type BlockedRecipientStatus, BlockedRecipients, type Call, type CallControlResponse, type CallCreateParams, type CallListParams, type CallUpdateParams, Calls, ClawOps, ClawOpsError, type ClawOpsOptions, ConflictError, InternalServerError, type Message, type MessageCreateParams, type MessageListParams, Messages, NotFoundError, type NumberCreateParams, type NumberListItem, type NumberUpdateParams, type NumberUpdateResponse, Numbers, Page, type PaginationMeta, PermissionDeniedError, type PhoneNumber, RateLimitError, type RecordingDownload, Recordings, ServiceUnavailableError, type SipCredential, SipCredentials, type SipEndpoint, SipEndpoints, UnprocessableEntityError, VERSION, type WebhookLog, WebhookLogs, WebhookVerificationError, Webhooks, ClawOps as default };