connectbase-client 3.34.0 → 3.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +10 -7
- package/dist/connect-base.umd.js +4 -4
- package/dist/index.d.mts +41 -15
- package/dist/index.d.ts +41 -15
- package/dist/index.js +49 -34
- package/dist/index.mjs +49 -34
- package/package.json +1 -1
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.
|
|
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
|
* ```
|
|
@@ -3568,22 +3568,41 @@ interface ICEServer {
|
|
|
3568
3568
|
interface ICEServersResponse {
|
|
3569
3569
|
ice_servers: ICEServer[];
|
|
3570
3570
|
}
|
|
3571
|
-
/**
|
|
3572
|
-
|
|
3573
|
-
|
|
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;
|
|
3574
3588
|
peer_count: number;
|
|
3575
3589
|
broadcaster_count: number;
|
|
3576
|
-
|
|
3590
|
+
viewer_count: number;
|
|
3577
3591
|
}
|
|
3578
|
-
/**
|
|
3592
|
+
/**
|
|
3593
|
+
* 앱 통계 응답 — server `GetStats` (`GET /v1/apps/:appID/stats`) 의 와이어 형태.
|
|
3594
|
+
* `channel_stats` 는 채널명 → ChannelStats 맵.
|
|
3595
|
+
*/
|
|
3579
3596
|
interface AppStatsResponse {
|
|
3580
|
-
|
|
3597
|
+
room_count: number;
|
|
3581
3598
|
total_peers: number;
|
|
3582
|
-
|
|
3599
|
+
total_broadcasters: number;
|
|
3600
|
+
total_viewers: number;
|
|
3601
|
+
channel_stats: Record<string, ChannelStats>;
|
|
3583
3602
|
}
|
|
3584
|
-
/** 룸 목록 응답 */
|
|
3603
|
+
/** 룸 목록 응답 — server `GetAllRooms` 가 `{ rooms: RoomSummary[] }` 로 반환. */
|
|
3585
3604
|
interface RoomsResponse {
|
|
3586
|
-
rooms:
|
|
3605
|
+
rooms: RoomSummary[];
|
|
3587
3606
|
}
|
|
3588
3607
|
/** API 유효성 검증 응답 */
|
|
3589
3608
|
interface ValidateResponse {
|
|
@@ -4773,7 +4792,7 @@ declare class SubscriptionAPI {
|
|
|
4773
4792
|
* })
|
|
4774
4793
|
* ```
|
|
4775
4794
|
*/
|
|
4776
|
-
cancel(subscriptionId: string, data
|
|
4795
|
+
cancel(subscriptionId: string, data?: CancelSubscriptionRequest): Promise<SubscriptionResponse>;
|
|
4777
4796
|
/**
|
|
4778
4797
|
* 구독 결제 이력 조회
|
|
4779
4798
|
*
|
|
@@ -5144,10 +5163,14 @@ interface StreamURLResponse {
|
|
|
5144
5163
|
quality?: string;
|
|
5145
5164
|
}
|
|
5146
5165
|
interface InitUploadResponse {
|
|
5147
|
-
|
|
5148
|
-
video_id: string;
|
|
5166
|
+
upload_id: string;
|
|
5149
5167
|
chunk_size: number;
|
|
5150
5168
|
total_chunks: number;
|
|
5169
|
+
expires_at: string;
|
|
5170
|
+
}
|
|
5171
|
+
interface VideoCompleteUploadResponse {
|
|
5172
|
+
video_id: string;
|
|
5173
|
+
status: VideoStatus;
|
|
5151
5174
|
}
|
|
5152
5175
|
interface TranscodeStatus {
|
|
5153
5176
|
video_id: string;
|
|
@@ -5446,7 +5469,10 @@ declare class VideoAPI {
|
|
|
5446
5469
|
*/
|
|
5447
5470
|
getStreamUrl(videoId: string, quality?: string): Promise<StreamURLResponse>;
|
|
5448
5471
|
/**
|
|
5449
|
-
* Get available thumbnails for a video
|
|
5472
|
+
* Get available thumbnails for a video.
|
|
5473
|
+
*
|
|
5474
|
+
* 서버는 대표 썸네일 1개(`thumbnail_url`) + 선택적 추가 썸네일 목록(`thumbnail_urls`)을
|
|
5475
|
+
* 반환한다. 둘을 합쳐 중복 없는 URL 배열로 정규화해 돌려준다.
|
|
5450
5476
|
*/
|
|
5451
5477
|
getThumbnails(videoId: string): Promise<string[]>;
|
|
5452
5478
|
/**
|
|
@@ -8950,4 +8976,4 @@ declare class ConnectBase {
|
|
|
8950
8976
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
8951
8977
|
}
|
|
8952
8978
|
|
|
8953
|
-
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 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
|
|
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.
|
|
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
|
* ```
|
|
@@ -3568,22 +3568,41 @@ interface ICEServer {
|
|
|
3568
3568
|
interface ICEServersResponse {
|
|
3569
3569
|
ice_servers: ICEServer[];
|
|
3570
3570
|
}
|
|
3571
|
-
/**
|
|
3572
|
-
|
|
3573
|
-
|
|
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;
|
|
3574
3588
|
peer_count: number;
|
|
3575
3589
|
broadcaster_count: number;
|
|
3576
|
-
|
|
3590
|
+
viewer_count: number;
|
|
3577
3591
|
}
|
|
3578
|
-
/**
|
|
3592
|
+
/**
|
|
3593
|
+
* 앱 통계 응답 — server `GetStats` (`GET /v1/apps/:appID/stats`) 의 와이어 형태.
|
|
3594
|
+
* `channel_stats` 는 채널명 → ChannelStats 맵.
|
|
3595
|
+
*/
|
|
3579
3596
|
interface AppStatsResponse {
|
|
3580
|
-
|
|
3597
|
+
room_count: number;
|
|
3581
3598
|
total_peers: number;
|
|
3582
|
-
|
|
3599
|
+
total_broadcasters: number;
|
|
3600
|
+
total_viewers: number;
|
|
3601
|
+
channel_stats: Record<string, ChannelStats>;
|
|
3583
3602
|
}
|
|
3584
|
-
/** 룸 목록 응답 */
|
|
3603
|
+
/** 룸 목록 응답 — server `GetAllRooms` 가 `{ rooms: RoomSummary[] }` 로 반환. */
|
|
3585
3604
|
interface RoomsResponse {
|
|
3586
|
-
rooms:
|
|
3605
|
+
rooms: RoomSummary[];
|
|
3587
3606
|
}
|
|
3588
3607
|
/** API 유효성 검증 응답 */
|
|
3589
3608
|
interface ValidateResponse {
|
|
@@ -4773,7 +4792,7 @@ declare class SubscriptionAPI {
|
|
|
4773
4792
|
* })
|
|
4774
4793
|
* ```
|
|
4775
4794
|
*/
|
|
4776
|
-
cancel(subscriptionId: string, data
|
|
4795
|
+
cancel(subscriptionId: string, data?: CancelSubscriptionRequest): Promise<SubscriptionResponse>;
|
|
4777
4796
|
/**
|
|
4778
4797
|
* 구독 결제 이력 조회
|
|
4779
4798
|
*
|
|
@@ -5144,10 +5163,14 @@ interface StreamURLResponse {
|
|
|
5144
5163
|
quality?: string;
|
|
5145
5164
|
}
|
|
5146
5165
|
interface InitUploadResponse {
|
|
5147
|
-
|
|
5148
|
-
video_id: string;
|
|
5166
|
+
upload_id: string;
|
|
5149
5167
|
chunk_size: number;
|
|
5150
5168
|
total_chunks: number;
|
|
5169
|
+
expires_at: string;
|
|
5170
|
+
}
|
|
5171
|
+
interface VideoCompleteUploadResponse {
|
|
5172
|
+
video_id: string;
|
|
5173
|
+
status: VideoStatus;
|
|
5151
5174
|
}
|
|
5152
5175
|
interface TranscodeStatus {
|
|
5153
5176
|
video_id: string;
|
|
@@ -5446,7 +5469,10 @@ declare class VideoAPI {
|
|
|
5446
5469
|
*/
|
|
5447
5470
|
getStreamUrl(videoId: string, quality?: string): Promise<StreamURLResponse>;
|
|
5448
5471
|
/**
|
|
5449
|
-
* Get available thumbnails for a video
|
|
5472
|
+
* Get available thumbnails for a video.
|
|
5473
|
+
*
|
|
5474
|
+
* 서버는 대표 썸네일 1개(`thumbnail_url`) + 선택적 추가 썸네일 목록(`thumbnail_urls`)을
|
|
5475
|
+
* 반환한다. 둘을 합쳐 중복 없는 URL 배열로 정규화해 돌려준다.
|
|
5450
5476
|
*/
|
|
5451
5477
|
getThumbnails(videoId: string): Promise<string[]>;
|
|
5452
5478
|
/**
|
|
@@ -8950,4 +8976,4 @@ declare class ConnectBase {
|
|
|
8950
8976
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
8951
8977
|
}
|
|
8952
8978
|
|
|
8953
|
-
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 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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
6280
|
-
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
"
|
|
6448
|
-
`${prefix}/uploads/${session.
|
|
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.
|
|
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.
|
|
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}/
|
|
6601
|
+
`${prefix}/videos/${videoId}/thumbnail`
|
|
6593
6602
|
);
|
|
6594
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
* ```
|
package/dist/index.mjs
CHANGED
|
@@ -666,12 +666,15 @@ var HttpClient = class {
|
|
|
666
666
|
}
|
|
667
667
|
async put(url, data, config) {
|
|
668
668
|
const headers = await this.prepareHeaders(config);
|
|
669
|
+
if (data instanceof FormData) {
|
|
670
|
+
headers.delete("Content-Type");
|
|
671
|
+
}
|
|
669
672
|
return this.doFetch(
|
|
670
673
|
url,
|
|
671
674
|
{
|
|
672
675
|
method: "PUT",
|
|
673
676
|
headers,
|
|
674
|
-
body: JSON.stringify(data)
|
|
677
|
+
body: data instanceof FormData ? data : JSON.stringify(data)
|
|
675
678
|
},
|
|
676
679
|
config
|
|
677
680
|
);
|
|
@@ -5809,9 +5812,13 @@ var SubscriptionAPI = class {
|
|
|
5809
5812
|
* })
|
|
5810
5813
|
* ```
|
|
5811
5814
|
*/
|
|
5812
|
-
async cancel(subscriptionId, data) {
|
|
5815
|
+
async cancel(subscriptionId, data = {}) {
|
|
5813
5816
|
const prefix = this.getPublicPrefix();
|
|
5814
|
-
|
|
5817
|
+
const body = {
|
|
5818
|
+
reason: data.reason,
|
|
5819
|
+
cancel_at_end: !data.immediate
|
|
5820
|
+
};
|
|
5821
|
+
return this.http.post(`${prefix}/subscriptions/${subscriptionId}/cancel`, body);
|
|
5815
5822
|
}
|
|
5816
5823
|
// =====================
|
|
5817
5824
|
// Subscription Payment APIs
|
|
@@ -6211,12 +6218,8 @@ var VideoAPI = class {
|
|
|
6211
6218
|
`/v1/public/storages/videos/${storageId}/uploads/init`,
|
|
6212
6219
|
{
|
|
6213
6220
|
filename: file.name,
|
|
6214
|
-
|
|
6215
|
-
mime_type: file.type
|
|
6216
|
-
title: options.title,
|
|
6217
|
-
description: options.description,
|
|
6218
|
-
visibility: options.visibility || "private",
|
|
6219
|
-
tags: options.tags
|
|
6221
|
+
file_size: file.size,
|
|
6222
|
+
mime_type: file.type
|
|
6220
6223
|
}
|
|
6221
6224
|
);
|
|
6222
6225
|
const chunkSize = session.chunk_size || DEFAULT_CHUNK_SIZE;
|
|
@@ -6230,9 +6233,8 @@ var VideoAPI = class {
|
|
|
6230
6233
|
const chunk = file.slice(start, end);
|
|
6231
6234
|
const formData = new FormData();
|
|
6232
6235
|
formData.append("chunk", chunk);
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
`/v1/public/storages/videos/${storageId}/uploads/${session.session_id}/chunk`,
|
|
6236
|
+
await this.http.put(
|
|
6237
|
+
`/v1/public/storages/videos/${storageId}/uploads/${session.upload_id}/chunk?chunk_index=${i}`,
|
|
6236
6238
|
formData
|
|
6237
6239
|
);
|
|
6238
6240
|
uploadedChunks++;
|
|
@@ -6254,10 +6256,15 @@ var VideoAPI = class {
|
|
|
6254
6256
|
}
|
|
6255
6257
|
}
|
|
6256
6258
|
const result = await this.http.post(
|
|
6257
|
-
`/v1/public/storages/videos/${storageId}/uploads/${session.
|
|
6258
|
-
{
|
|
6259
|
+
`/v1/public/storages/videos/${storageId}/uploads/${session.upload_id}/complete`,
|
|
6260
|
+
{
|
|
6261
|
+
title: options.title,
|
|
6262
|
+
description: options.description,
|
|
6263
|
+
visibility: options.visibility || "private",
|
|
6264
|
+
tags: options.tags
|
|
6265
|
+
}
|
|
6259
6266
|
);
|
|
6260
|
-
return result.
|
|
6267
|
+
return this.storage.getVideo(storageId, result.video_id);
|
|
6261
6268
|
},
|
|
6262
6269
|
/**
|
|
6263
6270
|
* List videos in a specific storage
|
|
@@ -6374,15 +6381,10 @@ var VideoAPI = class {
|
|
|
6374
6381
|
*/
|
|
6375
6382
|
async upload(file, options) {
|
|
6376
6383
|
const prefix = this.getPublicPrefix();
|
|
6377
|
-
const session = await this.videoFetch("POST", `${prefix}/uploads`, {
|
|
6384
|
+
const session = await this.videoFetch("POST", `${prefix}/uploads/init`, {
|
|
6378
6385
|
filename: file.name,
|
|
6379
|
-
|
|
6380
|
-
mime_type: file.type
|
|
6381
|
-
title: options.title,
|
|
6382
|
-
description: options.description,
|
|
6383
|
-
visibility: options.visibility || "private",
|
|
6384
|
-
tags: options.tags,
|
|
6385
|
-
channel_id: options.channel_id
|
|
6386
|
+
file_size: file.size,
|
|
6387
|
+
mime_type: file.type
|
|
6386
6388
|
});
|
|
6387
6389
|
const chunkSize = session.chunk_size || DEFAULT_CHUNK_SIZE;
|
|
6388
6390
|
const totalChunks = Math.ceil(file.size / chunkSize);
|
|
@@ -6396,10 +6398,9 @@ var VideoAPI = class {
|
|
|
6396
6398
|
const chunk = file.slice(start, end);
|
|
6397
6399
|
const formData = new FormData();
|
|
6398
6400
|
formData.append("chunk", chunk);
|
|
6399
|
-
formData.append("chunk_index", String(i));
|
|
6400
6401
|
await this.videoFetch(
|
|
6401
|
-
"
|
|
6402
|
-
`${prefix}/uploads/${session.
|
|
6402
|
+
"PUT",
|
|
6403
|
+
`${prefix}/uploads/${session.upload_id}/chunk?chunk_index=${i}`,
|
|
6403
6404
|
formData
|
|
6404
6405
|
);
|
|
6405
6406
|
uploadedChunks++;
|
|
@@ -6422,10 +6423,15 @@ var VideoAPI = class {
|
|
|
6422
6423
|
}
|
|
6423
6424
|
const result = await this.videoFetch(
|
|
6424
6425
|
"POST",
|
|
6425
|
-
`${prefix}/uploads/${session.
|
|
6426
|
-
{
|
|
6426
|
+
`${prefix}/uploads/${session.upload_id}/complete`,
|
|
6427
|
+
{
|
|
6428
|
+
title: options.title,
|
|
6429
|
+
description: options.description,
|
|
6430
|
+
visibility: options.visibility || "private",
|
|
6431
|
+
tags: options.tags
|
|
6432
|
+
}
|
|
6427
6433
|
);
|
|
6428
|
-
return result.
|
|
6434
|
+
return this.get(result.video_id);
|
|
6429
6435
|
}
|
|
6430
6436
|
/**
|
|
6431
6437
|
* Wait for video processing to complete
|
|
@@ -6537,15 +6543,23 @@ var VideoAPI = class {
|
|
|
6537
6543
|
return this.videoFetch("GET", `${prefix}/videos/${videoId}/stream-url${params}`);
|
|
6538
6544
|
}
|
|
6539
6545
|
/**
|
|
6540
|
-
* Get available thumbnails for a video
|
|
6546
|
+
* Get available thumbnails for a video.
|
|
6547
|
+
*
|
|
6548
|
+
* 서버는 대표 썸네일 1개(`thumbnail_url`) + 선택적 추가 썸네일 목록(`thumbnail_urls`)을
|
|
6549
|
+
* 반환한다. 둘을 합쳐 중복 없는 URL 배열로 정규화해 돌려준다.
|
|
6541
6550
|
*/
|
|
6542
6551
|
async getThumbnails(videoId) {
|
|
6543
6552
|
const prefix = this.getPublicPrefix();
|
|
6544
6553
|
const response = await this.videoFetch(
|
|
6545
6554
|
"GET",
|
|
6546
|
-
`${prefix}/videos/${videoId}/
|
|
6555
|
+
`${prefix}/videos/${videoId}/thumbnail`
|
|
6547
6556
|
);
|
|
6548
|
-
|
|
6557
|
+
const urls = /* @__PURE__ */ new Set();
|
|
6558
|
+
if (response.thumbnail_url) urls.add(response.thumbnail_url);
|
|
6559
|
+
for (const u of response.thumbnail_urls ?? []) {
|
|
6560
|
+
if (u) urls.add(u);
|
|
6561
|
+
}
|
|
6562
|
+
return [...urls];
|
|
6549
6563
|
}
|
|
6550
6564
|
/**
|
|
6551
6565
|
* Get transcode status
|
|
@@ -7545,7 +7559,8 @@ var GameAPI = class {
|
|
|
7545
7559
|
"GAME_GET_ROOM_FAILED"
|
|
7546
7560
|
);
|
|
7547
7561
|
}
|
|
7548
|
-
|
|
7562
|
+
const data = await response.json();
|
|
7563
|
+
return data.room;
|
|
7549
7564
|
}
|
|
7550
7565
|
/**
|
|
7551
7566
|
* 룸 생성 (HTTP, gRPC 대안)
|
|
@@ -9727,7 +9742,7 @@ var AnalyticsAPI = class {
|
|
|
9727
9742
|
* @example
|
|
9728
9743
|
* ```ts
|
|
9729
9744
|
* // 결제 완료 직후 이탈에 대비해 즉시 flush
|
|
9730
|
-
* await cb.analytics.
|
|
9745
|
+
* await cb.analytics.trackEvent('purchase_completed', { order_id: '123' })
|
|
9731
9746
|
* await cb.analytics.flush()
|
|
9732
9747
|
* window.location.href = '/thank-you'
|
|
9733
9748
|
* ```
|