connectbase-client 3.33.0 → 3.35.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,41 @@
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
+ ## [3.35.0] - 2026-06-17
7
+
8
+ ### Fixed — doc-audit 발견 SDK/서버 계약 버그 (퍼블리시 전엔 미동작이던 기능 정상화)
9
+
10
+ 3-way 문서 정합성 감사 중 발견된 SDK↔서버 계약 불일치를 코드 기준으로 정렬.
11
+
12
+ - **video 업로드 전면 정상화** — SDK↔서버 계약 불일치로 업로드가 동작하지 않던 것을 수정.
13
+ - **Breaking (타입)**: `InitUploadResponse` 가 `{ session_id, video_id, ... }` → **`{ upload_id, chunk_size, total_chunks, expires_at }`** (서버 실제 응답).
14
+ - 청크 업로드는 `PUT .../uploads/:uploadId/chunk?chunk_index=N`, 완료 응답 `{ video_id, status }` → `get(video_id)` 로 전체 Video 조회.
15
+ - `getThumbnails()` 를 서버 단일 thumbnail 엔드포인트(`/thumbnail`)에 정합.
16
+ - **WebRTC 응답 타입 정합** — `getStats()`/`getRooms()` 타입이 서버 wire shape 와 달랐음.
17
+ - **Breaking (타입)**: `AppStatsResponse` = `{ room_count, total_peers, total_broadcasters, total_viewers, channel_stats }`; rooms 는 `{ rooms: RoomSummary[] }` (`RoomStats` 제거, `ChannelStats`/`RoomSummary` 추가).
18
+ - **`subscription.cancel()`** — `immediate` 옵션이 서버에 전달되지 않던 것을 `cancel_at_end` 로 매핑. 인자 없이 호출 시 기본 = 현재 결제 주기 종료 시 해지.
19
+ - **`game.getRoom()`** — 서버 `{ room: ... }` 래핑을 언랩하지 않아 `undefined` 를 반환하던 것 수정.
20
+ - **HTTP `PUT`** — `FormData` 본문일 때 `Content-Type` 을 제거하지 않아 storage video 프록시 청크 업로드가 깨지던 것 수정.
21
+ - analytics JSDoc 예제의 존재하지 않는 `track()` → `trackEvent()` 정정.
22
+
23
+ > 모두 pre-launch(사용자 0) 단계 수정으로 실사용 호환성 파괴는 없습니다. video/WebRTC 타입 Breaking 은 직전까지 해당 기능이 end-to-end 로 동작한 적이 없습니다.
24
+
25
+ ## [3.34.0] - 2026-06-15
26
+
27
+ ### Changed — `geoQuery` 계약 표준화 (이전엔 백엔드와 형식이 달라 동작하지 않던 기능)
28
+
29
+ `geoQuery` 의 요청 형식이 백엔드 표준 계약과 달라 실제로는 동작하지 않았다(좌표·연산자
30
+ 키 불일치). 단일 표준 계약으로 정렬하여 정상 동작하도록 수정.
31
+
32
+ - **Breaking (타입)**: `GeoPoint` 가 `{ latitude, longitude }` → **`{ lat, lng }`** 로 변경.
33
+ 서버는 `{ latitude, longitude }` 와 `[lng, lat]` 도 계속 허용하지만 SDK 타입 표준은 `{ lat, lng }`.
34
+ - **Breaking (타입)**: `GeoQuery` 의 `within` → **`box`** 로 변경 (`{ box: { bottom_left, top_right } }`).
35
+ `near` / `polygon` 은 그대로.
36
+ - 반경 검색은 거리(미터) 가까운 순 정렬, 결과는 `{ results: [{ id, data, distance }], total_count }`.
37
+ - 영역이 지나치게 넓어 후보가 과도하면 결과를 임의로 자르지 않고 명시적 에러를 반환한다.
38
+
39
+ > 직전까지 `geoQuery` 는 end-to-end 로 동작한 적이 없어 실사용 호환성 파괴는 없습니다.
40
+
6
41
  ## [3.33.0] - 2026-06-15
7
42
 
8
43
  ### Added — Realtime WS 자동 SSE fallback (WS 가 차단된 네트워크에서도 AI 스트리밍 동작)
package/README.md CHANGED
@@ -644,17 +644,25 @@ const suggestions = await cb.database.autocomplete('table-id', 'sma', 'name', {
644
644
  #### Geo Queries
645
645
 
646
646
  ```typescript
647
- // Find locations within 5km radius
647
+ // Find locations within 5km radius (query: one of near / box / polygon)
648
648
  const nearby = await cb.database.geoQuery('table-id', 'location', {
649
649
  near: {
650
- center: { latitude: 37.5665, longitude: 126.9780 },
651
- max_distance: 5000
650
+ center: { lat: 37.5665, lng: 126.9780 },
651
+ max_distance: 5000 // meters
652
652
  }
653
653
  }, { limit: 20 })
654
654
 
655
655
  nearby.results.forEach(place => {
656
656
  console.log(place.data.name, `${place.distance}m away`)
657
657
  })
658
+
659
+ // Within a rectangle
660
+ await cb.database.geoQuery('table-id', 'location', {
661
+ box: {
662
+ bottom_left: { lat: 37.54, lng: 126.96 },
663
+ top_right: { lat: 37.58, lng: 127.00 }
664
+ }
665
+ })
658
666
  ```
659
667
 
660
668
  #### Batch & Transactions
@@ -1274,17 +1282,20 @@ cb.webrtc.disconnect()
1274
1282
  ### Payments & Subscriptions
1275
1283
 
1276
1284
  ```typescript
1277
- // Create a subscription
1285
+ // Create a subscription (정기 결제)
1278
1286
  const subscription = await cb.subscription.create({
1279
- planId: 'premium-monthly',
1280
- billingKeyId: 'billing-key-1'
1287
+ billing_key_id: 'billing-key-1',
1288
+ plan_name: 'premium-monthly',
1289
+ amount: 9900,
1290
+ billing_cycle: 'monthly'
1281
1291
  })
1282
1292
 
1283
- // Check subscription status
1284
- const status = await cb.subscription.getStatus()
1293
+ // Check subscription status (단건 조회)
1294
+ const detail = await cb.subscription.get(subscription.id)
1295
+ console.log(detail.status)
1285
1296
 
1286
- // Cancel subscription
1287
- await cb.subscription.cancel()
1297
+ // Cancel subscription (기본: 현재 결제 주기 종료 시 해지)
1298
+ await cb.subscription.cancel(subscription.id)
1288
1299
  ```
1289
1300
 
1290
1301
  ### Support (End-user Issue Reporting)