connectbase-client 3.2.0 → 3.3.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.mts CHANGED
@@ -5093,6 +5093,76 @@ declare class VideoAPI {
5093
5093
  };
5094
5094
  }
5095
5095
 
5096
+ /**
5097
+ * 게임 서버 기능 opt-in 토글 API.
5098
+ *
5099
+ * v3.1 (2026-04-30+) 부터 도입. 7개 게임 기능 (matchqueue / leaderboard / entity /
5100
+ * scripts / voice / replay / spectator) 은 모두 앱 단위로 명시적 opt-in 해야 사용 가능.
5101
+ *
5102
+ * 정책:
5103
+ * - 신규 앱: 모든 토글 false (App 생성 시 row 자동 삽입)
5104
+ * - 기존 앱: row 가 없으면 레거시 호환으로 모두 ON 으로 응답 (서비스 단절 방지)
5105
+ * - PATCH 후 game-server 캐시는 NATS publish 로 즉시 무효화 (또는 30s TTL)
5106
+ *
5107
+ * @example
5108
+ * ```ts
5109
+ * const cfg = await cb.game.config.get(appId)
5110
+ * if (!cfg.matchqueue_enabled) {
5111
+ * await cb.game.config.set(appId, { matchqueue_enabled: true })
5112
+ * }
5113
+ * ```
5114
+ *
5115
+ * @see docs/game-server/OPT_IN.md
5116
+ */
5117
+
5118
+ /** 7개 토글 + 메타. */
5119
+ interface GameConfig {
5120
+ matchqueue_enabled: boolean;
5121
+ leaderboard_enabled: boolean;
5122
+ entity_enabled: boolean;
5123
+ scripts_enabled: boolean;
5124
+ voice_enabled: boolean;
5125
+ replay_enabled: boolean;
5126
+ spectator_enabled: boolean;
5127
+ }
5128
+ /** PATCH body — 변경할 필드만 명시 (partial update). */
5129
+ type GameConfigPatch = Partial<GameConfig>;
5130
+ /**
5131
+ * 게임 기능 토글 클라이언트.
5132
+ *
5133
+ * 직접 인스턴스화하지 않고 `cb.game.config` 로 접근.
5134
+ */
5135
+ declare class GameConfigAPI {
5136
+ private http;
5137
+ private appId?;
5138
+ constructor(http: HttpClient, appId?: string);
5139
+ /**
5140
+ * 현재 토글 상태 조회.
5141
+ *
5142
+ * @param appId 앱 ID (생성자에서 주입한 기본값 사용 가능)
5143
+ */
5144
+ get(appId?: string): Promise<GameConfig>;
5145
+ /**
5146
+ * 토글 변경. 보낸 필드만 갱신, 나머지는 보존. PATCH 직후 game-server 캐시 즉시 drop
5147
+ * (NATS publish) — TTL 기다릴 필요 없음.
5148
+ *
5149
+ * @example
5150
+ * await cb.game.config.set(appId, { matchqueue_enabled: true, leaderboard_enabled: true })
5151
+ */
5152
+ set(appId: string | GameConfigPatch, patch?: GameConfigPatch): Promise<GameConfig>;
5153
+ /**
5154
+ * 단일 기능 활성화 — set() 의 편의 wrapper.
5155
+ *
5156
+ * @example await cb.game.config.enable(appId, "matchqueue")
5157
+ */
5158
+ enable(appId: string, feature: keyof GameConfig): Promise<GameConfig>;
5159
+ /**
5160
+ * 단일 기능 비활성화.
5161
+ */
5162
+ disable(appId: string, feature: keyof GameConfig): Promise<GameConfig>;
5163
+ private resolveAppId;
5164
+ }
5165
+
5096
5166
  /**
5097
5167
  * Game Server Types
5098
5168
  */
@@ -5684,6 +5754,11 @@ declare class GameAPI {
5684
5754
  private http;
5685
5755
  private gameServerUrl;
5686
5756
  private appId?;
5757
+ /**
5758
+ * 게임 기능 opt-in 토글 (v3.1+). `cb.game.config.get/set` 으로 호출.
5759
+ * 자세한 내용은 [GameConfigAPI] 참고.
5760
+ */
5761
+ readonly config: GameConfigAPI;
5687
5762
  constructor(http: HttpClient, gameServerUrl?: string, appId?: string);
5688
5763
  /**
5689
5764
  * 게임 룸 클라이언트 생성
@@ -6772,18 +6847,30 @@ declare class EndpointAPI {
6772
6847
  */
6773
6848
  call(label: string, init: EndpointCallInit): Promise<Response>;
6774
6849
  /**
6775
- * 라벨 + path 의 최종 호출 URL 을 조립해서 반환. fetch / WebSocket / new Image()
6776
- * 같이 SDK `call()` 아닌 직접 호출이 필요할 때 사용.
6850
+ * 라벨 + path 의 최종 호출 URL `${baseUrl}/v1/proxy/${label}${path}` 조립해서
6851
+ * 반환. URL 다른 시스템 (Service Worker, 백엔드 워커, 로깅) 넘기거나
6852
+ * 디버깅 용도일 때 사용.
6777
6853
  *
6778
- * 주의: WebSocket 같이 `X-Public-Key` 헤더를 보내는 경로면, 모델 서버가
6779
- * 자체 토큰으로 별도 인증을 해야 합니다 (ConnectBase 인증 게이트가 아닌
6780
- * dumb pipe path 만으로 인증하지 않음).
6854
+ * ⚠️ **`<img src>` / 네이티브 `WebSocket` / `<script src>` / `EventSource` 처럼
6855
+ * 커스텀 헤더를 보내는 브라우저 API 직접 넘기면 401 입니다.** ConnectBase
6856
+ * 프록시는 모든 요청에 `X-Public-Key` 헤더를 요구하고, 쿼리 파라미터 폴백은
6857
+ * 제공하지 않습니다. 그런 경우엔 `call()` 로 받아서 Blob URL 로 변환하세요.
6781
6858
  *
6782
- * @example
6859
+ * @example URL 을 워커로 넘겨 호출 (✅)
6783
6860
  * ```typescript
6784
- * // 결과 이미지를 <img> 로 바로 그리기
6785
- * img.src = `${cb.endpoint.url("comfyui-main", `/view?filename=${name}`)}` +
6786
- * `&__pk=${publicKey}` // 모델 서버가 직접 검증하는 토큰
6861
+ * sw.postMessage({
6862
+ * url: cb.endpoint.url("comfyui-main", "/prompt"),
6863
+ * key: publicKey, // 워커가 X-Public-Key 헤더로 부착
6864
+ * })
6865
+ * ```
6866
+ *
6867
+ * @example 이미지 렌더링은 call() + Blob URL 패턴으로 (✅)
6868
+ * ```typescript
6869
+ * const res = await cb.endpoint.call("comfyui-main", {
6870
+ * path: `/view?filename=${encodeURIComponent(name)}`,
6871
+ * })
6872
+ * img.src = URL.createObjectURL(await res.blob())
6873
+ * // 나중에 URL.revokeObjectURL(img.src)
6787
6874
  * ```
6788
6875
  */
6789
6876
  url(label: string, path: string): string;
@@ -7358,4 +7445,4 @@ declare class ConnectBase {
7358
7445
  updateConfig(config: Partial<ConnectBaseConfig>): void;
7359
7446
  }
7360
7447
 
7361
- export { AIAPI, type AIChatRequest, type AIChatResponse, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchSetPageMetaRequest, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConnectionState, type GameConnectionStatus, type GameDelta, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamMessage, type StreamOptions, type StreamSession, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionWrite, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported };
7448
+ export { AIAPI, type AIChatRequest, type AIChatResponse, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchSetPageMetaRequest, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamMessage, type StreamOptions, type StreamSession, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionWrite, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported };
package/dist/index.d.ts CHANGED
@@ -5093,6 +5093,76 @@ declare class VideoAPI {
5093
5093
  };
5094
5094
  }
5095
5095
 
5096
+ /**
5097
+ * 게임 서버 기능 opt-in 토글 API.
5098
+ *
5099
+ * v3.1 (2026-04-30+) 부터 도입. 7개 게임 기능 (matchqueue / leaderboard / entity /
5100
+ * scripts / voice / replay / spectator) 은 모두 앱 단위로 명시적 opt-in 해야 사용 가능.
5101
+ *
5102
+ * 정책:
5103
+ * - 신규 앱: 모든 토글 false (App 생성 시 row 자동 삽입)
5104
+ * - 기존 앱: row 가 없으면 레거시 호환으로 모두 ON 으로 응답 (서비스 단절 방지)
5105
+ * - PATCH 후 game-server 캐시는 NATS publish 로 즉시 무효화 (또는 30s TTL)
5106
+ *
5107
+ * @example
5108
+ * ```ts
5109
+ * const cfg = await cb.game.config.get(appId)
5110
+ * if (!cfg.matchqueue_enabled) {
5111
+ * await cb.game.config.set(appId, { matchqueue_enabled: true })
5112
+ * }
5113
+ * ```
5114
+ *
5115
+ * @see docs/game-server/OPT_IN.md
5116
+ */
5117
+
5118
+ /** 7개 토글 + 메타. */
5119
+ interface GameConfig {
5120
+ matchqueue_enabled: boolean;
5121
+ leaderboard_enabled: boolean;
5122
+ entity_enabled: boolean;
5123
+ scripts_enabled: boolean;
5124
+ voice_enabled: boolean;
5125
+ replay_enabled: boolean;
5126
+ spectator_enabled: boolean;
5127
+ }
5128
+ /** PATCH body — 변경할 필드만 명시 (partial update). */
5129
+ type GameConfigPatch = Partial<GameConfig>;
5130
+ /**
5131
+ * 게임 기능 토글 클라이언트.
5132
+ *
5133
+ * 직접 인스턴스화하지 않고 `cb.game.config` 로 접근.
5134
+ */
5135
+ declare class GameConfigAPI {
5136
+ private http;
5137
+ private appId?;
5138
+ constructor(http: HttpClient, appId?: string);
5139
+ /**
5140
+ * 현재 토글 상태 조회.
5141
+ *
5142
+ * @param appId 앱 ID (생성자에서 주입한 기본값 사용 가능)
5143
+ */
5144
+ get(appId?: string): Promise<GameConfig>;
5145
+ /**
5146
+ * 토글 변경. 보낸 필드만 갱신, 나머지는 보존. PATCH 직후 game-server 캐시 즉시 drop
5147
+ * (NATS publish) — TTL 기다릴 필요 없음.
5148
+ *
5149
+ * @example
5150
+ * await cb.game.config.set(appId, { matchqueue_enabled: true, leaderboard_enabled: true })
5151
+ */
5152
+ set(appId: string | GameConfigPatch, patch?: GameConfigPatch): Promise<GameConfig>;
5153
+ /**
5154
+ * 단일 기능 활성화 — set() 의 편의 wrapper.
5155
+ *
5156
+ * @example await cb.game.config.enable(appId, "matchqueue")
5157
+ */
5158
+ enable(appId: string, feature: keyof GameConfig): Promise<GameConfig>;
5159
+ /**
5160
+ * 단일 기능 비활성화.
5161
+ */
5162
+ disable(appId: string, feature: keyof GameConfig): Promise<GameConfig>;
5163
+ private resolveAppId;
5164
+ }
5165
+
5096
5166
  /**
5097
5167
  * Game Server Types
5098
5168
  */
@@ -5684,6 +5754,11 @@ declare class GameAPI {
5684
5754
  private http;
5685
5755
  private gameServerUrl;
5686
5756
  private appId?;
5757
+ /**
5758
+ * 게임 기능 opt-in 토글 (v3.1+). `cb.game.config.get/set` 으로 호출.
5759
+ * 자세한 내용은 [GameConfigAPI] 참고.
5760
+ */
5761
+ readonly config: GameConfigAPI;
5687
5762
  constructor(http: HttpClient, gameServerUrl?: string, appId?: string);
5688
5763
  /**
5689
5764
  * 게임 룸 클라이언트 생성
@@ -6772,18 +6847,30 @@ declare class EndpointAPI {
6772
6847
  */
6773
6848
  call(label: string, init: EndpointCallInit): Promise<Response>;
6774
6849
  /**
6775
- * 라벨 + path 의 최종 호출 URL 을 조립해서 반환. fetch / WebSocket / new Image()
6776
- * 같이 SDK `call()` 아닌 직접 호출이 필요할 때 사용.
6850
+ * 라벨 + path 의 최종 호출 URL `${baseUrl}/v1/proxy/${label}${path}` 조립해서
6851
+ * 반환. URL 다른 시스템 (Service Worker, 백엔드 워커, 로깅) 넘기거나
6852
+ * 디버깅 용도일 때 사용.
6777
6853
  *
6778
- * 주의: WebSocket 같이 `X-Public-Key` 헤더를 보내는 경로면, 모델 서버가
6779
- * 자체 토큰으로 별도 인증을 해야 합니다 (ConnectBase 인증 게이트가 아닌
6780
- * dumb pipe path 만으로 인증하지 않음).
6854
+ * ⚠️ **`<img src>` / 네이티브 `WebSocket` / `<script src>` / `EventSource` 처럼
6855
+ * 커스텀 헤더를 보내는 브라우저 API 직접 넘기면 401 입니다.** ConnectBase
6856
+ * 프록시는 모든 요청에 `X-Public-Key` 헤더를 요구하고, 쿼리 파라미터 폴백은
6857
+ * 제공하지 않습니다. 그런 경우엔 `call()` 로 받아서 Blob URL 로 변환하세요.
6781
6858
  *
6782
- * @example
6859
+ * @example URL 을 워커로 넘겨 호출 (✅)
6783
6860
  * ```typescript
6784
- * // 결과 이미지를 <img> 로 바로 그리기
6785
- * img.src = `${cb.endpoint.url("comfyui-main", `/view?filename=${name}`)}` +
6786
- * `&__pk=${publicKey}` // 모델 서버가 직접 검증하는 토큰
6861
+ * sw.postMessage({
6862
+ * url: cb.endpoint.url("comfyui-main", "/prompt"),
6863
+ * key: publicKey, // 워커가 X-Public-Key 헤더로 부착
6864
+ * })
6865
+ * ```
6866
+ *
6867
+ * @example 이미지 렌더링은 call() + Blob URL 패턴으로 (✅)
6868
+ * ```typescript
6869
+ * const res = await cb.endpoint.call("comfyui-main", {
6870
+ * path: `/view?filename=${encodeURIComponent(name)}`,
6871
+ * })
6872
+ * img.src = URL.createObjectURL(await res.blob())
6873
+ * // 나중에 URL.revokeObjectURL(img.src)
6787
6874
  * ```
6788
6875
  */
6789
6876
  url(label: string, path: string): string;
@@ -7358,4 +7445,4 @@ declare class ConnectBase {
7358
7445
  updateConfig(config: Partial<ConnectBaseConfig>): void;
7359
7446
  }
7360
7447
 
7361
- export { AIAPI, type AIChatRequest, type AIChatResponse, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchSetPageMetaRequest, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConnectionState, type GameConnectionStatus, type GameDelta, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamMessage, type StreamOptions, type StreamSession, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionWrite, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported };
7448
+ export { AIAPI, type AIChatRequest, type AIChatResponse, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchSetPageMetaRequest, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamMessage, type StreamOptions, type StreamSession, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionWrite, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported };
package/dist/index.js CHANGED
@@ -27,6 +27,7 @@ __export(index_exports, {
27
27
  ConnectBase: () => ConnectBase,
28
28
  EndpointAPI: () => EndpointAPI,
29
29
  GameAPI: () => GameAPI,
30
+ GameConfigAPI: () => GameConfigAPI,
30
31
  GameRoom: () => GameRoom,
31
32
  GameRoomTransport: () => GameRoomTransport,
32
33
  NativeAPI: () => NativeAPI,
@@ -6063,6 +6064,63 @@ var VideoAPI = class {
6063
6064
  }
6064
6065
  };
6065
6066
 
6067
+ // src/api/game-config.ts
6068
+ var GameConfigAPI = class {
6069
+ constructor(http, appId) {
6070
+ this.http = http;
6071
+ this.appId = appId;
6072
+ }
6073
+ /**
6074
+ * 현재 토글 상태 조회.
6075
+ *
6076
+ * @param appId 앱 ID (생성자에서 주입한 기본값 사용 가능)
6077
+ */
6078
+ async get(appId) {
6079
+ const id = this.resolveAppId(appId);
6080
+ return this.http.get(`/v1/apps/${id}/game/config`);
6081
+ }
6082
+ /**
6083
+ * 토글 변경. 보낸 필드만 갱신, 나머지는 보존. PATCH 직후 game-server 캐시 즉시 drop
6084
+ * (NATS publish) — TTL 기다릴 필요 없음.
6085
+ *
6086
+ * @example
6087
+ * await cb.game.config.set(appId, { matchqueue_enabled: true, leaderboard_enabled: true })
6088
+ */
6089
+ async set(appId, patch) {
6090
+ let id;
6091
+ let body;
6092
+ if (typeof appId === "string") {
6093
+ id = appId;
6094
+ body = patch ?? {};
6095
+ } else {
6096
+ id = this.resolveAppId();
6097
+ body = appId;
6098
+ }
6099
+ return this.http.patch(`/v1/apps/${id}/game/config`, body);
6100
+ }
6101
+ /**
6102
+ * 단일 기능 활성화 — set() 의 편의 wrapper.
6103
+ *
6104
+ * @example await cb.game.config.enable(appId, "matchqueue")
6105
+ */
6106
+ async enable(appId, feature) {
6107
+ return this.set(appId, { [feature]: true });
6108
+ }
6109
+ /**
6110
+ * 단일 기능 비활성화.
6111
+ */
6112
+ async disable(appId, feature) {
6113
+ return this.set(appId, { [feature]: false });
6114
+ }
6115
+ resolveAppId(explicit) {
6116
+ const id = explicit ?? this.appId;
6117
+ if (!id) {
6118
+ throw new Error("appId not provided (pass it explicitly or set in client constructor)");
6119
+ }
6120
+ return id;
6121
+ }
6122
+ };
6123
+
6066
6124
  // src/api/game.ts
6067
6125
  var getDefaultGameServerUrl = () => {
6068
6126
  if (typeof window !== "undefined") {
@@ -6549,6 +6607,7 @@ var GameAPI = class {
6549
6607
  this.http = http;
6550
6608
  this.gameServerUrl = gameServerUrl || getDefaultGameServerUrl().replace(/^ws/, "http");
6551
6609
  this.appId = appId;
6610
+ this.config = new GameConfigAPI(http, appId);
6552
6611
  }
6553
6612
  /**
6554
6613
  * 게임 룸 클라이언트 생성
@@ -7718,18 +7777,30 @@ var EndpointAPI = class {
7718
7777
  });
7719
7778
  }
7720
7779
  /**
7721
- * 라벨 + path 의 최종 호출 URL 을 조립해서 반환. fetch / WebSocket / new Image()
7722
- * 같이 SDK `call()` 아닌 직접 호출이 필요할 때 사용.
7780
+ * 라벨 + path 의 최종 호출 URL `${baseUrl}/v1/proxy/${label}${path}` 조립해서
7781
+ * 반환. URL 다른 시스템 (Service Worker, 백엔드 워커, 로깅) 넘기거나
7782
+ * 디버깅 용도일 때 사용.
7723
7783
  *
7724
- * 주의: WebSocket 같이 `X-Public-Key` 헤더를 보내는 경로면, 모델 서버가
7725
- * 자체 토큰으로 별도 인증을 해야 합니다 (ConnectBase 인증 게이트가 아닌
7726
- * dumb pipe path 만으로 인증하지 않음).
7784
+ * ⚠️ **`<img src>` / 네이티브 `WebSocket` / `<script src>` / `EventSource` 처럼
7785
+ * 커스텀 헤더를 보내는 브라우저 API 직접 넘기면 401 입니다.** ConnectBase
7786
+ * 프록시는 모든 요청에 `X-Public-Key` 헤더를 요구하고, 쿼리 파라미터 폴백은
7787
+ * 제공하지 않습니다. 그런 경우엔 `call()` 로 받아서 Blob URL 로 변환하세요.
7727
7788
  *
7728
- * @example
7789
+ * @example URL 을 워커로 넘겨 호출 (✅)
7790
+ * ```typescript
7791
+ * sw.postMessage({
7792
+ * url: cb.endpoint.url("comfyui-main", "/prompt"),
7793
+ * key: publicKey, // 워커가 X-Public-Key 헤더로 부착
7794
+ * })
7795
+ * ```
7796
+ *
7797
+ * @example 이미지 렌더링은 call() + Blob URL 패턴으로 (✅)
7729
7798
  * ```typescript
7730
- * // 결과 이미지를 <img> 바로 그리기
7731
- * img.src = `${cb.endpoint.url("comfyui-main", `/view?filename=${name}`)}` +
7732
- * `&__pk=${publicKey}` // 모델 서버가 직접 검증하는 토큰
7799
+ * const res = await cb.endpoint.call("comfyui-main", {
7800
+ * path: `/view?filename=${encodeURIComponent(name)}`,
7801
+ * })
7802
+ * img.src = URL.createObjectURL(await res.blob())
7803
+ * // 나중에 URL.revokeObjectURL(img.src)
7733
7804
  * ```
7734
7805
  */
7735
7806
  url(label, path) {
@@ -9411,6 +9482,7 @@ var index_default = ConnectBase;
9411
9482
  ConnectBase,
9412
9483
  EndpointAPI,
9413
9484
  GameAPI,
9485
+ GameConfigAPI,
9414
9486
  GameRoom,
9415
9487
  GameRoomTransport,
9416
9488
  NativeAPI,
package/dist/index.mjs CHANGED
@@ -6024,6 +6024,63 @@ var VideoAPI = class {
6024
6024
  }
6025
6025
  };
6026
6026
 
6027
+ // src/api/game-config.ts
6028
+ var GameConfigAPI = class {
6029
+ constructor(http, appId) {
6030
+ this.http = http;
6031
+ this.appId = appId;
6032
+ }
6033
+ /**
6034
+ * 현재 토글 상태 조회.
6035
+ *
6036
+ * @param appId 앱 ID (생성자에서 주입한 기본값 사용 가능)
6037
+ */
6038
+ async get(appId) {
6039
+ const id = this.resolveAppId(appId);
6040
+ return this.http.get(`/v1/apps/${id}/game/config`);
6041
+ }
6042
+ /**
6043
+ * 토글 변경. 보낸 필드만 갱신, 나머지는 보존. PATCH 직후 game-server 캐시 즉시 drop
6044
+ * (NATS publish) — TTL 기다릴 필요 없음.
6045
+ *
6046
+ * @example
6047
+ * await cb.game.config.set(appId, { matchqueue_enabled: true, leaderboard_enabled: true })
6048
+ */
6049
+ async set(appId, patch) {
6050
+ let id;
6051
+ let body;
6052
+ if (typeof appId === "string") {
6053
+ id = appId;
6054
+ body = patch ?? {};
6055
+ } else {
6056
+ id = this.resolveAppId();
6057
+ body = appId;
6058
+ }
6059
+ return this.http.patch(`/v1/apps/${id}/game/config`, body);
6060
+ }
6061
+ /**
6062
+ * 단일 기능 활성화 — set() 의 편의 wrapper.
6063
+ *
6064
+ * @example await cb.game.config.enable(appId, "matchqueue")
6065
+ */
6066
+ async enable(appId, feature) {
6067
+ return this.set(appId, { [feature]: true });
6068
+ }
6069
+ /**
6070
+ * 단일 기능 비활성화.
6071
+ */
6072
+ async disable(appId, feature) {
6073
+ return this.set(appId, { [feature]: false });
6074
+ }
6075
+ resolveAppId(explicit) {
6076
+ const id = explicit ?? this.appId;
6077
+ if (!id) {
6078
+ throw new Error("appId not provided (pass it explicitly or set in client constructor)");
6079
+ }
6080
+ return id;
6081
+ }
6082
+ };
6083
+
6027
6084
  // src/api/game.ts
6028
6085
  var getDefaultGameServerUrl = () => {
6029
6086
  if (typeof window !== "undefined") {
@@ -6510,6 +6567,7 @@ var GameAPI = class {
6510
6567
  this.http = http;
6511
6568
  this.gameServerUrl = gameServerUrl || getDefaultGameServerUrl().replace(/^ws/, "http");
6512
6569
  this.appId = appId;
6570
+ this.config = new GameConfigAPI(http, appId);
6513
6571
  }
6514
6572
  /**
6515
6573
  * 게임 룸 클라이언트 생성
@@ -7679,18 +7737,30 @@ var EndpointAPI = class {
7679
7737
  });
7680
7738
  }
7681
7739
  /**
7682
- * 라벨 + path 의 최종 호출 URL 을 조립해서 반환. fetch / WebSocket / new Image()
7683
- * 같이 SDK `call()` 아닌 직접 호출이 필요할 때 사용.
7740
+ * 라벨 + path 의 최종 호출 URL `${baseUrl}/v1/proxy/${label}${path}` 조립해서
7741
+ * 반환. URL 다른 시스템 (Service Worker, 백엔드 워커, 로깅) 넘기거나
7742
+ * 디버깅 용도일 때 사용.
7684
7743
  *
7685
- * 주의: WebSocket 같이 `X-Public-Key` 헤더를 보내는 경로면, 모델 서버가
7686
- * 자체 토큰으로 별도 인증을 해야 합니다 (ConnectBase 인증 게이트가 아닌
7687
- * dumb pipe path 만으로 인증하지 않음).
7744
+ * ⚠️ **`<img src>` / 네이티브 `WebSocket` / `<script src>` / `EventSource` 처럼
7745
+ * 커스텀 헤더를 보내는 브라우저 API 직접 넘기면 401 입니다.** ConnectBase
7746
+ * 프록시는 모든 요청에 `X-Public-Key` 헤더를 요구하고, 쿼리 파라미터 폴백은
7747
+ * 제공하지 않습니다. 그런 경우엔 `call()` 로 받아서 Blob URL 로 변환하세요.
7688
7748
  *
7689
- * @example
7749
+ * @example URL 을 워커로 넘겨 호출 (✅)
7750
+ * ```typescript
7751
+ * sw.postMessage({
7752
+ * url: cb.endpoint.url("comfyui-main", "/prompt"),
7753
+ * key: publicKey, // 워커가 X-Public-Key 헤더로 부착
7754
+ * })
7755
+ * ```
7756
+ *
7757
+ * @example 이미지 렌더링은 call() + Blob URL 패턴으로 (✅)
7690
7758
  * ```typescript
7691
- * // 결과 이미지를 <img> 바로 그리기
7692
- * img.src = `${cb.endpoint.url("comfyui-main", `/view?filename=${name}`)}` +
7693
- * `&__pk=${publicKey}` // 모델 서버가 직접 검증하는 토큰
7759
+ * const res = await cb.endpoint.call("comfyui-main", {
7760
+ * path: `/view?filename=${encodeURIComponent(name)}`,
7761
+ * })
7762
+ * img.src = URL.createObjectURL(await res.blob())
7763
+ * // 나중에 URL.revokeObjectURL(img.src)
7694
7764
  * ```
7695
7765
  */
7696
7766
  url(label, path) {
@@ -9371,6 +9441,7 @@ export {
9371
9441
  ConnectBase,
9372
9442
  EndpointAPI,
9373
9443
  GameAPI,
9444
+ GameConfigAPI,
9374
9445
  GameRoom,
9375
9446
  GameRoomTransport,
9376
9447
  NativeAPI,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "connectbase-client",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "Connect Base JavaScript/TypeScript SDK for browser and Node.js",
5
5
  "repository": {
6
6
  "type": "git",