connectbase-client 6.12.0 → 6.13.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/CHANGELOG.md CHANGED
@@ -3,6 +3,50 @@
3
3
  본 SDK 의 모든 주요 변경사항을 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/) 형식으로 기록합니다.
4
4
  버전은 [Semantic Versioning](https://semver.org/lang/ko/) 을 따릅니다.
5
5
 
6
+ ## [6.13.0] - 2026-11-11
7
+
8
+ ### Security — WebRTC 역할과 룸 인가를 서버가 정한 대로 따른다
9
+
10
+ - `cb.webrtc.connect({ allowedMemberIds })`(REST `joinRoom` 의 `allowed_member_ids`)를 더한다. 이 연결이 룸을 새로 열면
11
+ 목록의 회원과 자신만 들어오는 비공개 룸이 된다(로그인 회원만, 최대 50명). 목록 밖 회원과 익명은 들어오지도, 룸 목록과
12
+ 참가자 조회로 보지도 못한다. 이미 공개 룸으로 열린 같은 ID 에 목록을 들고 오면 들어가지 않고 오류로 끝난다.
13
+ `cb.webrtc.isPrivateRoom()` 으로 확인한다. `switchRoom()` 은 이 목록을 이어받지 않는다.
14
+ - `cb.webrtc.isBroadcaster()` 를 더한다. `joined` 의 `is_broadcaster`(서버가 정한 역할)를 돌려준다. 요청(`isBroadcaster: true`)과
15
+ 다를 수 있다 — 익명 연결, 채널 방송자 역할(`publisher_roles`)이 없는 회원은 시청자다.
16
+ - `cb.webrtc.onWarning(({ code, message }) => ...)` 를 더한다. 서버가 요청을 바꾼 이유(`broadcaster_requires_auth`,
17
+ `broadcaster_role_required`, `quota_check_degraded`)가 온다. 예전에는 버려졌다.
18
+ - join 메시지에 `user_id` 를 싣지 않는다. 서버는 2026-11-08 부터 읽지 않았다(참가자 신원은 인증 정보에서 온다).
19
+ `connect({ userId })` 는 SDK 안에서만 쓰는 값으로 남는다.
20
+
21
+ ### Fixed — WebRTC 오류 문구, 서버에 없는 필드
22
+
23
+ - 할당량, 동시접속 초과처럼 `{ error, message }` 객체로 오는 시그널링 `error` 가 `Unknown error` 로 바뀌던 것을 고쳐
24
+ `message` 를 그대로 전한다.
25
+ - `PeerInfo.joined_at` 을 뺀다. 서버가 보낸 적이 없는 필드였다(늘 `undefined`).
26
+ - `RoomSummary.private`, `JoinRoomResponse.private`, `JoinRoomRequest.allowed_member_ids` 타입을 서버 응답에 맞춰 더한다.
27
+
28
+ ### Security — 구독 금액도 서버의 가격표가 정한다
29
+
30
+ - `cb.subscription.create({ product_id })` 형태를 더한다. 콘솔 가격표의 **정기 상품**(주기가 있는 상품)으로 구독하면
31
+ 금액, 통화, 주기, 플랜명, 무료 체험, MoR PG 가격 ref 를 서버가 상품에서 정하고, 첫 청구는 기본으로 즉시다.
32
+ `changePlan(id, { product_id })`, `previewChangePlan`, `chargeWithBillingKey({ product_id, quantity })`,
33
+ `update(id, { product_id })`(서버 호출만)도 같다.
34
+ - 금액을 직접 보내는 기존 형태는 그대로 동작한다. 다만 서버는 결제 설정의 금액 출처가 `client`(레거시)인 앱이거나 서버 호출
35
+ (시크릿 키, service_role 함수)일 때만 받는다. 가격표 전용(`catalog`) 앱의 브라우저 호출에서는:
36
+ - 금액 지정 403 `client_amount_not_allowed`, `start_now: false` 와 `billing_day` 403 `client_schedule_not_allowed`
37
+ - `update()` 로 금액, 플랜명, 상품 변경 403 `client_plan_change_not_allowed`
38
+ - `changePlan()` 에 `provider_price_ref` 직접 지정 403, 지금 정산하지 않는 `proration_mode` 와 `on_payment_failure:
39
+ 'apply_change'` 403 `proration_mode_not_allowed`
40
+ - 요청 타입을 유니온으로 나눴다(`CreateSubscriptionWithProduct | CreateSubscriptionWithAmount`,
41
+ `ChangePlanWithProduct | ChangePlanWithPriceRef`, `ChargeWithBillingKeyProduct | ChargeWithBillingKeyAmount`). 두 형태를
42
+ 섞으면 컴파일 에러다(서버도 400 `product_with_amount_fields`).
43
+ - `SubscriptionResponse.product_id` 를 더한다. 권한은 `metadata` 가 아니라 이 값으로 지급한다. 서버가 금액을 직접 바꾸거나
44
+ PG 가 가격표에 없는 가격으로 바꾸면 비워진다. `chargeWithBillingKey()` 응답에 `currency`, `product_id`, `quantity` 가 온다.
45
+ - 새 오류 코드: `product_not_recurring`, `product_is_recurring`(정기 상품을 `payment.prepare` 에 넘김),
46
+ `product_price_ref_missing`(MoR 구독에 쓸 PG 가격 ref 가 상품에 없음), `subscription_amount_update_unsupported`
47
+ (PG 가 청구 금액을 정하는 구독의 금액만 변경), `order_id_conflict`(같은 `order_id` 를 다른 금액이나 상품으로 재시도),
48
+ `subscription_amount_mismatch`(첫 청구 승인 금액 불일치).
49
+
6
50
  ## [6.12.0] - 2026-11-11
7
51
 
8
52
  ### Changed — 세션이 없다는 것을 이미 알면 `getMe()` 가 서버에 묻지 않는다
package/README.md CHANGED
@@ -1486,7 +1486,14 @@ cb.webrtc.onRemoteStream((peerId, remoteStream) => {
1486
1486
  videoElement.srcObject = remoteStream
1487
1487
  })
1488
1488
 
1489
- // 룸 전환 (생략한 옵션은 현재 세션 값을 이어받습니다)
1489
+ // 역할은 서버가 정한다 — 익명 연결이나 채널 방송자 역할(publisher_roles)이 없는 회원은 시청자
1490
+ cb.webrtc.onWarning(({ code, message }) => console.warn(code, message))
1491
+ console.log(cb.webrtc.isBroadcaster())
1492
+
1493
+ // 비공개 룸 (로그인 회원) — 목록의 회원만 들어오고 볼 수 있다. 참가자 모두 같은 목록을 보낸다
1494
+ await cb.webrtc.connect({ roomId: `call:${callId}`, allowedMemberIds: [aliceId, bobId], localStream: stream })
1495
+
1496
+ // 룸 전환 (생략한 옵션은 현재 세션 값을 이어받습니다. allowedMemberIds 는 이어받지 않습니다)
1490
1497
  await cb.webrtc.switchRoom('live:room-2')
1491
1498
 
1492
1499
  // 연결 해제
package/dist/cli.js CHANGED
@@ -170,7 +170,7 @@ function handleTunnelError(msg, appId, localPort) {
170
170
  }
171
171
 
172
172
  // src/cli.ts
173
- var VERSION = "6.12.0" ? "6.12.0" : getPackageVersion();
173
+ var VERSION = "6.13.0" ? "6.13.0" : getPackageVersion();
174
174
  var DEFAULT_BASE_URL = "https://api.connectbase.world";
175
175
  var colors = {
176
176
  reset: "\x1B[0m",