connectbase-client 6.7.0 → 6.8.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 +30 -0
- package/README.md +12 -2
- package/dist/cli.js +1 -1
- package/dist/connect-base.umd.js +2 -2
- package/dist/index.d.mts +52 -6
- package/dist/index.d.ts +52 -6
- package/dist/index.js +58 -18
- package/dist/index.mjs +58 -18
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
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.8.0] - 2026-10-23
|
|
7
|
+
|
|
8
|
+
### Added — 서버 코드에서 토픽 만들기: `cb.push.createTopic(appId, name, options?)`
|
|
9
|
+
|
|
10
|
+
방마다 쓰는 토픽(`cc_<room>` 같은)을 서버 코드가 만들어 두고, 기기는 그 뒤에 `subscribeTopic` 으로 구독합니다. 같은
|
|
11
|
+
이름의 토픽이 이미 있으면 오류 없이 그 토픽을 돌려줍니다(설정은 바꾸지 않습니다) — 트리거가 다시 실행돼도 안전합니다.
|
|
12
|
+
공개 키(cb_pk_) 단독 인스턴스로는 호출할 수 없고, 함수의 `ctx.cbAdmin` 은 management_scopes 에 `push:write` 가 있어야
|
|
13
|
+
합니다(platform-issue 01a167dd). 함수는 배포할 때 이 SDK 의 최신 판을 설치하므로, 쓰려면 함수를 다시 배포하세요.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
// concerts 트리거 함수
|
|
17
|
+
await ctx.cbAdmin.push.createTopic(appId, `cc_${row.room}`, { displayName: row.title })
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Fixed — 웹 푸시 기기의 토픽 구독과 등록 해제
|
|
21
|
+
|
|
22
|
+
`registerWebPush` 로 등록한 브라우저 기기를 `subscribeTopic` / `unsubscribeTopic` 으로 구독시키지 못했고,
|
|
23
|
+
`unregisterWebPush` 도 실패했습니다. 웹 푸시 기기의 `device_token` 은 endpoint URL(`https://…/send/…`, 슬래시 포함)인데
|
|
24
|
+
SDK 가 그 값을 요청 경로에 넣어 서버 라우트가 맞지 않았습니다(인코딩해도 서버 라우팅 전에 풀립니다). 이제 기기 토큰은
|
|
25
|
+
요청 본문으로 보냅니다(`POST /v1/public/push/topics/subscribe`, `/topics/unsubscribe`, `/devices/unregister`) — 네이티브
|
|
26
|
+
(FCM, APNs) 기기도 같은 방법으로 동작하며, 호출 방법은 그대로입니다(platform-issue 01a167dd).
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
const device = await cb.push.registerWebPush(subscription)
|
|
30
|
+
await cb.push.subscribeTopic(device.device_token, 'announcements') // 토픽은 콘솔에서 미리 만든다
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
이 판은 위 엔드포인트가 있는 서버(2026-10-23 배포)가 필요합니다. 예전 판(경로에 토큰)도 네이티브 기기에서는 계속
|
|
34
|
+
동작합니다.
|
|
35
|
+
|
|
6
36
|
## [6.7.0] - 2026-10-22
|
|
7
37
|
|
|
8
38
|
### Added — 서버가 검증한 보낸 사람: `message.fromMember`
|
package/README.md
CHANGED
|
@@ -1108,7 +1108,7 @@ try {
|
|
|
1108
1108
|
```
|
|
1109
1109
|
|
|
1110
1110
|
방송인 여부는 구독할 때 정해집니다. 멤버 역할이나 카테고리 설정을 바꾸면 다시 구독(또는 재연결)할 때 반영되고,
|
|
1111
|
-
카테고리 설정은
|
|
1111
|
+
카테고리 설정은 저장하면 몇 초 안에 서버 전체에 퍼집니다. room 채널(v6.7.0)은 room 인가 함수가 `publisher: true` 로
|
|
1112
1112
|
room 마다 방송인을 정할 수도 있습니다(위 "Rooms").
|
|
1113
1113
|
|
|
1114
1114
|
#### Presence / Typing
|
|
@@ -1431,7 +1431,17 @@ const subscription = await registration.pushManager.subscribe({
|
|
|
1431
1431
|
userVisibleOnly: true,
|
|
1432
1432
|
applicationServerKey: vapidKey.public_key
|
|
1433
1433
|
})
|
|
1434
|
-
await cb.push.registerWebPush(subscription)
|
|
1434
|
+
const webDevice = await cb.push.registerWebPush(subscription)
|
|
1435
|
+
// Browser devices subscribe the same way (v6.8.0+: device_token is the endpoint URL)
|
|
1436
|
+
await cb.push.subscribeTopic(webDevice.device_token, 'news')
|
|
1437
|
+
```
|
|
1438
|
+
|
|
1439
|
+
Topics must exist before devices subscribe; subscribing to an unknown topic fails with 404. Create them in the console,
|
|
1440
|
+
or from server code (v6.8.0+, not available to public-key-only instances):
|
|
1441
|
+
|
|
1442
|
+
```typescript
|
|
1443
|
+
// e.g. in a database trigger function: one topic per room, safe to call again (returns the existing topic)
|
|
1444
|
+
await ctx.cbAdmin.push.createTopic(ctx.appId, `cc_${room}`, { displayName: title })
|
|
1435
1445
|
```
|
|
1436
1446
|
|
|
1437
1447
|
### WebRTC
|
package/dist/cli.js
CHANGED
|
@@ -156,7 +156,7 @@ function handleTunnelError(msg, appId, localPort) {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
// src/cli.ts
|
|
159
|
-
var VERSION = "6.
|
|
159
|
+
var VERSION = "6.8.0" ? "6.8.0" : getPackageVersion();
|
|
160
160
|
var DEFAULT_BASE_URL = "https://api.connectbase.world";
|
|
161
161
|
var colors = {
|
|
162
162
|
reset: "\x1B[0m",
|