connectbase-client 3.2.1 → 3.3.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.
- package/CHANGELOG.md +48 -0
- package/README.md +37 -0
- package/dist/connect-base.umd.js +3 -3
- package/dist/index.d.mts +76 -1
- package/dist/index.d.ts +76 -1
- package/dist/index.js +60 -0
- package/dist/index.mjs +59 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,54 @@
|
|
|
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.3.1] - 2026-04-30
|
|
7
|
+
|
|
8
|
+
### Fixed — Docs
|
|
9
|
+
|
|
10
|
+
3.3.0 publish 직후 SDK 감사에서 `README.md` 의 `### Game Server` 섹션에 신규 API
|
|
11
|
+
`cb.game.config` 가 누락된 것을 발견. npm 페이지의 사용자 1차 문서 정합성을 위해
|
|
12
|
+
patch release 로 보강.
|
|
13
|
+
|
|
14
|
+
- README 의 `## API Reference > ### Game Server` 아래에 `#### cb.game.config — Feature
|
|
15
|
+
Opt-in (v3.1+, SDK 3.3.0+)` 섹션 추가 — get/set/enable/disable 4개 메서드 시그니처,
|
|
16
|
+
partial PATCH 의미, HTTP 응답 코드 표 (403 / 429 / 402), OPT_IN.md cross-link.
|
|
17
|
+
- 코드 동작 변화 없음. README/CHANGELOG 만 수정.
|
|
18
|
+
|
|
19
|
+
## [3.3.0] - 2026-04-30
|
|
20
|
+
|
|
21
|
+
### Added — `cb.game.config` (게임 기능 opt-in 토글)
|
|
22
|
+
|
|
23
|
+
게임 서버 v3.1 의 7개 기능 (matchqueue / leaderboard / entity / scripts / voice / replay /
|
|
24
|
+
spectator) 이 모두 앱 단위 명시적 opt-in 정책으로 전환됨에 따라, 콘솔 / 외부 도구가
|
|
25
|
+
토글 상태를 조회/변경할 수 있는 SDK 헬퍼 신규 추가.
|
|
26
|
+
|
|
27
|
+
- **`cb.game.config.get(appId?)`** — 현재 7개 토글 상태 + `legacy_defaults` 플래그.
|
|
28
|
+
row 가 없는 기존 앱은 모든 기능 ON 상태로 응답 (서비스 단절 방지). `legacy_defaults=true`
|
|
29
|
+
를 받으면 backfill 권장.
|
|
30
|
+
- **`cb.game.config.set(appId, patch)`** / **`cb.game.config.set(patch)`** — partial
|
|
31
|
+
update. 보낸 필드만 갱신, 나머지는 보존. PATCH 직후 game-server 캐시는 NATS
|
|
32
|
+
publish 로 즉시 무효화 (또는 30s TTL).
|
|
33
|
+
- **`cb.game.config.enable(appId, feature)`** / **`disable(appId, feature)`** —
|
|
34
|
+
단일 토글 편의 wrapper.
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
const cfg = await cb.game.config.get(appId)
|
|
38
|
+
if (!cfg.matchqueue_enabled) {
|
|
39
|
+
await cb.game.config.set(appId, { matchqueue_enabled: true, leaderboard_enabled: true })
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
신규 앱은 모든 기능 OFF 가 기본값. 사용 안 하는 앱은 noisy-neighbor / 의도치 않은
|
|
44
|
+
quota 소비에서 격리됨.
|
|
45
|
+
|
|
46
|
+
자세한 정책: [docs/game-server/OPT_IN.md](https://github.com/connectbase-world/connectbase/blob/release/docs/game-server/OPT_IN.md)
|
|
47
|
+
|
|
48
|
+
### Behavior — 비활성 기능 호출 시 응답 변화
|
|
49
|
+
|
|
50
|
+
본 버전부터, 비활성 feature 의 HTTP 호출은 **HTTP 403 + `{error: "feature_disabled", feature, hint}`**
|
|
51
|
+
를 반환. 기존 SDK 호출 코드는 catch 에서 status 403 + error 코드를 분기해 사용자에게
|
|
52
|
+
"콘솔에서 켜주세요" 메시지를 표시하는 게 권장됩니다.
|
|
53
|
+
|
|
6
54
|
## [3.2.1] - 2026-04-29
|
|
7
55
|
|
|
8
56
|
### Fixed — Docs
|
package/README.md
CHANGED
|
@@ -229,6 +229,43 @@ curl -X PUT "https://api.connectbase.world/v1/apps/{appID}/storages/webs/{storag
|
|
|
229
229
|
|
|
230
230
|
### Game Server
|
|
231
231
|
|
|
232
|
+
#### `cb.game.config` — Feature Opt-in (v3.1+, SDK 3.3.0+)
|
|
233
|
+
|
|
234
|
+
The game server's 7 features (`matchqueue` / `leaderboard` / `entity` / `scripts` /
|
|
235
|
+
`voice` / `replay` / `spectator`) are **explicit opt-in per app** as of v3.1
|
|
236
|
+
(2026-04-30). Disabled features return HTTP **403 `feature_disabled`**.
|
|
237
|
+
New apps default to all-OFF; existing apps without a config row fall back to
|
|
238
|
+
all-ON for compatibility.
|
|
239
|
+
|
|
240
|
+
```typescript
|
|
241
|
+
// Inspect current toggles
|
|
242
|
+
const cfg = await cb.game.config.get(appId)
|
|
243
|
+
// → { matchqueue_enabled, leaderboard_enabled, entity_enabled, scripts_enabled,
|
|
244
|
+
// voice_enabled, replay_enabled, spectator_enabled }
|
|
245
|
+
|
|
246
|
+
// Partial update — only the keys you send are applied; others are preserved.
|
|
247
|
+
await cb.game.config.set(appId, {
|
|
248
|
+
matchqueue_enabled: true,
|
|
249
|
+
leaderboard_enabled: true,
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
// Single-toggle convenience wrappers
|
|
253
|
+
await cb.game.config.enable(appId, 'matchqueue_enabled')
|
|
254
|
+
await cb.game.config.disable(appId, 'voice_enabled')
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
The PATCH publishes a NATS invalidation so game-server caches drop the entry
|
|
258
|
+
immediately (30s TTL is the safety net).
|
|
259
|
+
|
|
260
|
+
| HTTP code | Body `error` | Meaning | Client action |
|
|
261
|
+
|-----------|--------------|---------|---------------|
|
|
262
|
+
| **403** | `feature_disabled` | Feature is not enabled for this app | Toggle via console or `cb.game.config.set(...)` |
|
|
263
|
+
| **429** | `cap_exceeded` | Per-app cardinality cap reached | Remove old rows or ask the operator to raise the cap env |
|
|
264
|
+
| **402** | `quota_exceeded` | Plan limit reached on a write route | Upgrade plan |
|
|
265
|
+
|
|
266
|
+
See [docs/game-server/OPT_IN.md](https://github.com/connectbase-world/connectbase/blob/release/docs/game-server/OPT_IN.md)
|
|
267
|
+
for the full policy.
|
|
268
|
+
|
|
232
269
|
#### GameRoom
|
|
233
270
|
|
|
234
271
|
The main class for real-time game communication.
|