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/dist/index.d.mts CHANGED
@@ -633,7 +633,7 @@ declare class AnalyticsAPI {
633
633
  * @example
634
634
  * ```ts
635
635
  * // 결제 완료 직후 이탈에 대비해 즉시 flush
636
- * await cb.analytics.track('purchase_completed', { order_id: '123' })
636
+ * await cb.analytics.trackEvent('purchase_completed', { order_id: '123' })
637
637
  * await cb.analytics.flush()
638
638
  * window.location.href = '/thank-you'
639
639
  * ```
@@ -1510,27 +1510,35 @@ interface SearchResponse {
1510
1510
  total_count: number;
1511
1511
  query: string;
1512
1512
  }
1513
+ /**
1514
+ * 지리 좌표. 서버는 `{ lat, lng }`, `{ latitude, longitude }`, `[lng, lat]` 세 형식을 모두 받지만
1515
+ * SDK 는 `{ lat, lng }` 를 표준으로 사용한다.
1516
+ */
1513
1517
  interface GeoPoint {
1514
- latitude: number;
1515
- longitude: number;
1518
+ lat: number;
1519
+ lng: number;
1516
1520
  }
1517
1521
  interface GeoNear {
1518
1522
  center: GeoPoint;
1523
+ /** 최대 거리 (미터) */
1519
1524
  max_distance: number;
1525
+ /** 최소 거리 (미터, 도넛 검색) */
1520
1526
  min_distance?: number;
1521
1527
  }
1522
- interface GeoWithin {
1523
- box: {
1524
- bottom_left: GeoPoint;
1525
- top_right: GeoPoint;
1526
- };
1528
+ interface GeoBoundingBox {
1529
+ bottom_left: GeoPoint;
1530
+ top_right: GeoPoint;
1527
1531
  }
1528
1532
  interface GeoPolygon {
1533
+ /** 폴리곤 꼭지점 (최소 3개) */
1529
1534
  points: GeoPoint[];
1530
1535
  }
1536
+ /**
1537
+ * near / box / polygon 중 정확히 하나를 지정한다.
1538
+ */
1531
1539
  interface GeoQuery {
1532
1540
  near?: GeoNear;
1533
- within?: GeoWithin;
1541
+ box?: GeoBoundingBox;
1534
1542
  polygon?: GeoPolygon;
1535
1543
  }
1536
1544
  interface GeoResult {
@@ -3560,22 +3568,41 @@ interface ICEServer {
3560
3568
  interface ICEServersResponse {
3561
3569
  ice_servers: ICEServer[];
3562
3570
  }
3563
- /** 룸 통계 */
3564
- interface RoomStats {
3565
- room_id: string;
3571
+ /**
3572
+ * 채널별 통계 (룸 ID 의 `channel:room` 컨벤션 기준 집계).
3573
+ * server `GetStats` 의 `channel_stats` 맵 값과 일치.
3574
+ */
3575
+ interface ChannelStats {
3576
+ rooms: number;
3577
+ peers: number;
3578
+ broadcasters: number;
3579
+ viewers: number;
3580
+ }
3581
+ /**
3582
+ * 룸 요약 정보 — server `GetAllRooms` (`GET /v1/apps/:appID/rooms`) 의 `rooms[]` 항목.
3583
+ * server `RoomInfo` struct 의 JSON 와이어 형태와 정확히 일치한다.
3584
+ */
3585
+ interface RoomSummary {
3586
+ id: string;
3587
+ app_id: string;
3566
3588
  peer_count: number;
3567
3589
  broadcaster_count: number;
3568
- created_at: string;
3590
+ viewer_count: number;
3569
3591
  }
3570
- /** 앱 통계 응답 */
3592
+ /**
3593
+ * 앱 통계 응답 — server `GetStats` (`GET /v1/apps/:appID/stats`) 의 와이어 형태.
3594
+ * `channel_stats` 는 채널명 → ChannelStats 맵.
3595
+ */
3571
3596
  interface AppStatsResponse {
3572
- total_rooms: number;
3597
+ room_count: number;
3573
3598
  total_peers: number;
3574
- rooms: RoomStats[];
3599
+ total_broadcasters: number;
3600
+ total_viewers: number;
3601
+ channel_stats: Record<string, ChannelStats>;
3575
3602
  }
3576
- /** 룸 목록 응답 */
3603
+ /** 룸 목록 응답 — server `GetAllRooms` 가 `{ rooms: RoomSummary[] }` 로 반환. */
3577
3604
  interface RoomsResponse {
3578
- rooms: RoomStats[];
3605
+ rooms: RoomSummary[];
3579
3606
  }
3580
3607
  /** API 유효성 검증 응답 */
3581
3608
  interface ValidateResponse {
@@ -4765,7 +4792,7 @@ declare class SubscriptionAPI {
4765
4792
  * })
4766
4793
  * ```
4767
4794
  */
4768
- cancel(subscriptionId: string, data: CancelSubscriptionRequest): Promise<SubscriptionResponse>;
4795
+ cancel(subscriptionId: string, data?: CancelSubscriptionRequest): Promise<SubscriptionResponse>;
4769
4796
  /**
4770
4797
  * 구독 결제 이력 조회
4771
4798
  *
@@ -5136,10 +5163,14 @@ interface StreamURLResponse {
5136
5163
  quality?: string;
5137
5164
  }
5138
5165
  interface InitUploadResponse {
5139
- session_id: string;
5140
- video_id: string;
5166
+ upload_id: string;
5141
5167
  chunk_size: number;
5142
5168
  total_chunks: number;
5169
+ expires_at: string;
5170
+ }
5171
+ interface VideoCompleteUploadResponse {
5172
+ video_id: string;
5173
+ status: VideoStatus;
5143
5174
  }
5144
5175
  interface TranscodeStatus {
5145
5176
  video_id: string;
@@ -5438,7 +5469,10 @@ declare class VideoAPI {
5438
5469
  */
5439
5470
  getStreamUrl(videoId: string, quality?: string): Promise<StreamURLResponse>;
5440
5471
  /**
5441
- * Get available thumbnails for a video
5472
+ * Get available thumbnails for a video.
5473
+ *
5474
+ * 서버는 대표 썸네일 1개(`thumbnail_url`) + 선택적 추가 썸네일 목록(`thumbnail_urls`)을
5475
+ * 반환한다. 둘을 합쳐 중복 없는 URL 배열로 정규화해 돌려준다.
5442
5476
  */
5443
5477
  getThumbnails(videoId: string): Promise<string[]>;
5444
5478
  /**
@@ -8942,4 +8976,4 @@ declare class ConnectBase {
8942
8976
  updateConfig(config: Partial<ConnectBaseConfig>): void;
8943
8977
  }
8944
8978
 
8945
- export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, 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 BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, 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 CreateRoomResult, 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, GameError, type GameErrorCode, 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, GuestSessionConflictError, 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 RoomStaleMessage, 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 StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, 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 TransactionResult, type TransactionWrite, type TransactionWriteResult, 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 UpdateDocumentRequest, 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, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
8979
+ export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, 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 BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, 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 ChannelStats, 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 CreateRoomResult, 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, GameError, type GameErrorCode, 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 GeoBoundingBox, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, GuestSessionConflictError, 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 RoomStaleMessage, type RoomSummary, 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 StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, 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 TransactionResult, type TransactionWrite, type TransactionWriteResult, 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 UpdateDocumentRequest, 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 VideoCompleteUploadResponse, 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, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
package/dist/index.d.ts CHANGED
@@ -633,7 +633,7 @@ declare class AnalyticsAPI {
633
633
  * @example
634
634
  * ```ts
635
635
  * // 결제 완료 직후 이탈에 대비해 즉시 flush
636
- * await cb.analytics.track('purchase_completed', { order_id: '123' })
636
+ * await cb.analytics.trackEvent('purchase_completed', { order_id: '123' })
637
637
  * await cb.analytics.flush()
638
638
  * window.location.href = '/thank-you'
639
639
  * ```
@@ -1510,27 +1510,35 @@ interface SearchResponse {
1510
1510
  total_count: number;
1511
1511
  query: string;
1512
1512
  }
1513
+ /**
1514
+ * 지리 좌표. 서버는 `{ lat, lng }`, `{ latitude, longitude }`, `[lng, lat]` 세 형식을 모두 받지만
1515
+ * SDK 는 `{ lat, lng }` 를 표준으로 사용한다.
1516
+ */
1513
1517
  interface GeoPoint {
1514
- latitude: number;
1515
- longitude: number;
1518
+ lat: number;
1519
+ lng: number;
1516
1520
  }
1517
1521
  interface GeoNear {
1518
1522
  center: GeoPoint;
1523
+ /** 최대 거리 (미터) */
1519
1524
  max_distance: number;
1525
+ /** 최소 거리 (미터, 도넛 검색) */
1520
1526
  min_distance?: number;
1521
1527
  }
1522
- interface GeoWithin {
1523
- box: {
1524
- bottom_left: GeoPoint;
1525
- top_right: GeoPoint;
1526
- };
1528
+ interface GeoBoundingBox {
1529
+ bottom_left: GeoPoint;
1530
+ top_right: GeoPoint;
1527
1531
  }
1528
1532
  interface GeoPolygon {
1533
+ /** 폴리곤 꼭지점 (최소 3개) */
1529
1534
  points: GeoPoint[];
1530
1535
  }
1536
+ /**
1537
+ * near / box / polygon 중 정확히 하나를 지정한다.
1538
+ */
1531
1539
  interface GeoQuery {
1532
1540
  near?: GeoNear;
1533
- within?: GeoWithin;
1541
+ box?: GeoBoundingBox;
1534
1542
  polygon?: GeoPolygon;
1535
1543
  }
1536
1544
  interface GeoResult {
@@ -3560,22 +3568,41 @@ interface ICEServer {
3560
3568
  interface ICEServersResponse {
3561
3569
  ice_servers: ICEServer[];
3562
3570
  }
3563
- /** 룸 통계 */
3564
- interface RoomStats {
3565
- room_id: string;
3571
+ /**
3572
+ * 채널별 통계 (룸 ID 의 `channel:room` 컨벤션 기준 집계).
3573
+ * server `GetStats` 의 `channel_stats` 맵 값과 일치.
3574
+ */
3575
+ interface ChannelStats {
3576
+ rooms: number;
3577
+ peers: number;
3578
+ broadcasters: number;
3579
+ viewers: number;
3580
+ }
3581
+ /**
3582
+ * 룸 요약 정보 — server `GetAllRooms` (`GET /v1/apps/:appID/rooms`) 의 `rooms[]` 항목.
3583
+ * server `RoomInfo` struct 의 JSON 와이어 형태와 정확히 일치한다.
3584
+ */
3585
+ interface RoomSummary {
3586
+ id: string;
3587
+ app_id: string;
3566
3588
  peer_count: number;
3567
3589
  broadcaster_count: number;
3568
- created_at: string;
3590
+ viewer_count: number;
3569
3591
  }
3570
- /** 앱 통계 응답 */
3592
+ /**
3593
+ * 앱 통계 응답 — server `GetStats` (`GET /v1/apps/:appID/stats`) 의 와이어 형태.
3594
+ * `channel_stats` 는 채널명 → ChannelStats 맵.
3595
+ */
3571
3596
  interface AppStatsResponse {
3572
- total_rooms: number;
3597
+ room_count: number;
3573
3598
  total_peers: number;
3574
- rooms: RoomStats[];
3599
+ total_broadcasters: number;
3600
+ total_viewers: number;
3601
+ channel_stats: Record<string, ChannelStats>;
3575
3602
  }
3576
- /** 룸 목록 응답 */
3603
+ /** 룸 목록 응답 — server `GetAllRooms` 가 `{ rooms: RoomSummary[] }` 로 반환. */
3577
3604
  interface RoomsResponse {
3578
- rooms: RoomStats[];
3605
+ rooms: RoomSummary[];
3579
3606
  }
3580
3607
  /** API 유효성 검증 응답 */
3581
3608
  interface ValidateResponse {
@@ -4765,7 +4792,7 @@ declare class SubscriptionAPI {
4765
4792
  * })
4766
4793
  * ```
4767
4794
  */
4768
- cancel(subscriptionId: string, data: CancelSubscriptionRequest): Promise<SubscriptionResponse>;
4795
+ cancel(subscriptionId: string, data?: CancelSubscriptionRequest): Promise<SubscriptionResponse>;
4769
4796
  /**
4770
4797
  * 구독 결제 이력 조회
4771
4798
  *
@@ -5136,10 +5163,14 @@ interface StreamURLResponse {
5136
5163
  quality?: string;
5137
5164
  }
5138
5165
  interface InitUploadResponse {
5139
- session_id: string;
5140
- video_id: string;
5166
+ upload_id: string;
5141
5167
  chunk_size: number;
5142
5168
  total_chunks: number;
5169
+ expires_at: string;
5170
+ }
5171
+ interface VideoCompleteUploadResponse {
5172
+ video_id: string;
5173
+ status: VideoStatus;
5143
5174
  }
5144
5175
  interface TranscodeStatus {
5145
5176
  video_id: string;
@@ -5438,7 +5469,10 @@ declare class VideoAPI {
5438
5469
  */
5439
5470
  getStreamUrl(videoId: string, quality?: string): Promise<StreamURLResponse>;
5440
5471
  /**
5441
- * Get available thumbnails for a video
5472
+ * Get available thumbnails for a video.
5473
+ *
5474
+ * 서버는 대표 썸네일 1개(`thumbnail_url`) + 선택적 추가 썸네일 목록(`thumbnail_urls`)을
5475
+ * 반환한다. 둘을 합쳐 중복 없는 URL 배열로 정규화해 돌려준다.
5442
5476
  */
5443
5477
  getThumbnails(videoId: string): Promise<string[]>;
5444
5478
  /**
@@ -8942,4 +8976,4 @@ declare class ConnectBase {
8942
8976
  updateConfig(config: Partial<ConnectBaseConfig>): void;
8943
8977
  }
8944
8978
 
8945
- export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, 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 BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, 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 CreateRoomResult, 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, GameError, type GameErrorCode, 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, GuestSessionConflictError, 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 RoomStaleMessage, 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 StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, 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 TransactionResult, type TransactionWrite, type TransactionWriteResult, 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 UpdateDocumentRequest, 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, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
8979
+ export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, 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 BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, 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 ChannelStats, 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 CreateRoomResult, 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, GameError, type GameErrorCode, 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 GeoBoundingBox, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, GuestSessionConflictError, 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 RoomStaleMessage, type RoomSummary, 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 StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, 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 TransactionResult, type TransactionWrite, type TransactionWriteResult, 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 UpdateDocumentRequest, 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 VideoCompleteUploadResponse, 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, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
package/dist/index.js CHANGED
@@ -712,12 +712,15 @@ var HttpClient = class {
712
712
  }
713
713
  async put(url, data, config) {
714
714
  const headers = await this.prepareHeaders(config);
715
+ if (data instanceof FormData) {
716
+ headers.delete("Content-Type");
717
+ }
715
718
  return this.doFetch(
716
719
  url,
717
720
  {
718
721
  method: "PUT",
719
722
  headers,
720
- body: JSON.stringify(data)
723
+ body: data instanceof FormData ? data : JSON.stringify(data)
721
724
  },
722
725
  config
723
726
  );
@@ -5855,9 +5858,13 @@ var SubscriptionAPI = class {
5855
5858
  * })
5856
5859
  * ```
5857
5860
  */
5858
- async cancel(subscriptionId, data) {
5861
+ async cancel(subscriptionId, data = {}) {
5859
5862
  const prefix = this.getPublicPrefix();
5860
- return this.http.post(`${prefix}/subscriptions/${subscriptionId}/cancel`, data);
5863
+ const body = {
5864
+ reason: data.reason,
5865
+ cancel_at_end: !data.immediate
5866
+ };
5867
+ return this.http.post(`${prefix}/subscriptions/${subscriptionId}/cancel`, body);
5861
5868
  }
5862
5869
  // =====================
5863
5870
  // Subscription Payment APIs
@@ -6257,12 +6264,8 @@ var VideoAPI = class {
6257
6264
  `/v1/public/storages/videos/${storageId}/uploads/init`,
6258
6265
  {
6259
6266
  filename: file.name,
6260
- size: file.size,
6261
- mime_type: file.type,
6262
- title: options.title,
6263
- description: options.description,
6264
- visibility: options.visibility || "private",
6265
- tags: options.tags
6267
+ file_size: file.size,
6268
+ mime_type: file.type
6266
6269
  }
6267
6270
  );
6268
6271
  const chunkSize = session.chunk_size || DEFAULT_CHUNK_SIZE;
@@ -6276,9 +6279,8 @@ var VideoAPI = class {
6276
6279
  const chunk = file.slice(start, end);
6277
6280
  const formData = new FormData();
6278
6281
  formData.append("chunk", chunk);
6279
- formData.append("chunk_index", String(i));
6280
- await this.http.post(
6281
- `/v1/public/storages/videos/${storageId}/uploads/${session.session_id}/chunk`,
6282
+ await this.http.put(
6283
+ `/v1/public/storages/videos/${storageId}/uploads/${session.upload_id}/chunk?chunk_index=${i}`,
6282
6284
  formData
6283
6285
  );
6284
6286
  uploadedChunks++;
@@ -6300,10 +6302,15 @@ var VideoAPI = class {
6300
6302
  }
6301
6303
  }
6302
6304
  const result = await this.http.post(
6303
- `/v1/public/storages/videos/${storageId}/uploads/${session.session_id}/complete`,
6304
- {}
6305
+ `/v1/public/storages/videos/${storageId}/uploads/${session.upload_id}/complete`,
6306
+ {
6307
+ title: options.title,
6308
+ description: options.description,
6309
+ visibility: options.visibility || "private",
6310
+ tags: options.tags
6311
+ }
6305
6312
  );
6306
- return result.video;
6313
+ return this.storage.getVideo(storageId, result.video_id);
6307
6314
  },
6308
6315
  /**
6309
6316
  * List videos in a specific storage
@@ -6420,15 +6427,10 @@ var VideoAPI = class {
6420
6427
  */
6421
6428
  async upload(file, options) {
6422
6429
  const prefix = this.getPublicPrefix();
6423
- const session = await this.videoFetch("POST", `${prefix}/uploads`, {
6430
+ const session = await this.videoFetch("POST", `${prefix}/uploads/init`, {
6424
6431
  filename: file.name,
6425
- size: file.size,
6426
- mime_type: file.type,
6427
- title: options.title,
6428
- description: options.description,
6429
- visibility: options.visibility || "private",
6430
- tags: options.tags,
6431
- channel_id: options.channel_id
6432
+ file_size: file.size,
6433
+ mime_type: file.type
6432
6434
  });
6433
6435
  const chunkSize = session.chunk_size || DEFAULT_CHUNK_SIZE;
6434
6436
  const totalChunks = Math.ceil(file.size / chunkSize);
@@ -6442,10 +6444,9 @@ var VideoAPI = class {
6442
6444
  const chunk = file.slice(start, end);
6443
6445
  const formData = new FormData();
6444
6446
  formData.append("chunk", chunk);
6445
- formData.append("chunk_index", String(i));
6446
6447
  await this.videoFetch(
6447
- "POST",
6448
- `${prefix}/uploads/${session.session_id}/chunks`,
6448
+ "PUT",
6449
+ `${prefix}/uploads/${session.upload_id}/chunk?chunk_index=${i}`,
6449
6450
  formData
6450
6451
  );
6451
6452
  uploadedChunks++;
@@ -6468,10 +6469,15 @@ var VideoAPI = class {
6468
6469
  }
6469
6470
  const result = await this.videoFetch(
6470
6471
  "POST",
6471
- `${prefix}/uploads/${session.session_id}/complete`,
6472
- {}
6472
+ `${prefix}/uploads/${session.upload_id}/complete`,
6473
+ {
6474
+ title: options.title,
6475
+ description: options.description,
6476
+ visibility: options.visibility || "private",
6477
+ tags: options.tags
6478
+ }
6473
6479
  );
6474
- return result.video;
6480
+ return this.get(result.video_id);
6475
6481
  }
6476
6482
  /**
6477
6483
  * Wait for video processing to complete
@@ -6583,15 +6589,23 @@ var VideoAPI = class {
6583
6589
  return this.videoFetch("GET", `${prefix}/videos/${videoId}/stream-url${params}`);
6584
6590
  }
6585
6591
  /**
6586
- * Get available thumbnails for a video
6592
+ * Get available thumbnails for a video.
6593
+ *
6594
+ * 서버는 대표 썸네일 1개(`thumbnail_url`) + 선택적 추가 썸네일 목록(`thumbnail_urls`)을
6595
+ * 반환한다. 둘을 합쳐 중복 없는 URL 배열로 정규화해 돌려준다.
6587
6596
  */
6588
6597
  async getThumbnails(videoId) {
6589
6598
  const prefix = this.getPublicPrefix();
6590
6599
  const response = await this.videoFetch(
6591
6600
  "GET",
6592
- `${prefix}/videos/${videoId}/thumbnails`
6601
+ `${prefix}/videos/${videoId}/thumbnail`
6593
6602
  );
6594
- return response.thumbnails;
6603
+ const urls = /* @__PURE__ */ new Set();
6604
+ if (response.thumbnail_url) urls.add(response.thumbnail_url);
6605
+ for (const u of response.thumbnail_urls ?? []) {
6606
+ if (u) urls.add(u);
6607
+ }
6608
+ return [...urls];
6595
6609
  }
6596
6610
  /**
6597
6611
  * Get transcode status
@@ -7591,7 +7605,8 @@ var GameAPI = class {
7591
7605
  "GAME_GET_ROOM_FAILED"
7592
7606
  );
7593
7607
  }
7594
- return response.json();
7608
+ const data = await response.json();
7609
+ return data.room;
7595
7610
  }
7596
7611
  /**
7597
7612
  * 룸 생성 (HTTP, gRPC 대안)
@@ -9773,7 +9788,7 @@ var AnalyticsAPI = class {
9773
9788
  * @example
9774
9789
  * ```ts
9775
9790
  * // 결제 완료 직후 이탈에 대비해 즉시 flush
9776
- * await cb.analytics.track('purchase_completed', { order_id: '123' })
9791
+ * await cb.analytics.trackEvent('purchase_completed', { order_id: '123' })
9777
9792
  * await cb.analytics.flush()
9778
9793
  * window.location.href = '/thank-you'
9779
9794
  * ```