connectbase-client 3.36.0 → 3.38.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
@@ -4932,6 +4932,24 @@ interface SendToMembersPayload {
4932
4932
  /** ISO8601 형식 예약 발송 시각. 미지정 시 즉시 발송. */
4933
4933
  scheduledAt?: string;
4934
4934
  }
4935
+ /**
4936
+ * `cb.push.sendToTopic` 페이로드. 백엔드 `dto.SendPushToTopicRequest` 에 매핑되며,
4937
+ * topic_name 은 메서드 인자로 받아 SDK 가 채운다. (members 발송과 달리 대상은 토픽 구독자 전체)
4938
+ */
4939
+ interface SendToTopicPayload {
4940
+ title: string;
4941
+ body: string;
4942
+ imageUrl?: string;
4943
+ data?: Record<string, unknown>;
4944
+ /** 'ios' | 'android' | 'web' 중 선택. 빈 배열/미지정 시 전체 플랫폼 발송. */
4945
+ platforms?: Array<'ios' | 'android' | 'web'>;
4946
+ /** TTL(초). 기본 86400 (24h). */
4947
+ ttlSeconds?: number;
4948
+ priority?: 'normal' | 'high';
4949
+ clickAction?: string;
4950
+ /** ISO8601 형식 예약 발송 시각. 미지정 시 즉시 발송. */
4951
+ scheduledAt?: string;
4952
+ }
4935
4953
  /**
4936
4954
  * 발송 결과. 백엔드 `dto.SendResultResponse` 와 1:1 매핑.
4937
4955
  */
@@ -5106,6 +5124,33 @@ declare class PushAPI {
5106
5124
  * ```
5107
5125
  */
5108
5126
  sendToMembers(appId: string, memberIds: string[], payload: SendToMembersPayload): Promise<SendPushResult>;
5127
+ /**
5128
+ * 토픽 구독자 전체에게 푸시 알림을 발송한다 (서버 사이드 전용).
5129
+ *
5130
+ * 백엔드 라우트 `POST /v1/apps/:appID/push/send-to-topic` 는 콘솔 JWT, User Secret Key(`cb_sk_`),
5131
+ * 또는 service_role 토큰(`ctx.cbAdmin`)을 받는다. `sendToMembers` 와 동일하게 브라우저 SDK 의
5132
+ * Public Key(`cb_pk_`) **단독** 인스턴스에서는 호출이 차단되며, 위임 Bearer 토큰을 가진
5133
+ * 인스턴스(`ctx.cbAdmin`/`ctx.cb`)는 cb_pk_ 가 앱 식별용으로만 실리므로 허용된다.
5134
+ *
5135
+ * 정기 알림(일일 리마인더 등)을 ConnectBase Function 스케줄러에서 `ctx.cbAdmin` 으로 발송하는
5136
+ * 것이 대표 유스케이스다 — 시크릿 키를 콘솔에서 별도로 발급해 함수 secret 에 넣을 필요가 없다.
5137
+ *
5138
+ * @param appId 발송 대상 앱 ID.
5139
+ * @param topicName 발송 대상 토픽 이름 (예: 'daily-0900').
5140
+ * @param payload 푸시 내용/옵션.
5141
+ *
5142
+ * @example
5143
+ * ```ts
5144
+ * // ConnectBase Function (service_role=true) — 시크릿 키 없이 ctx.cbAdmin 으로 토픽 발송
5145
+ * const result = await ctx.cbAdmin.push.sendToTopic(ctx.appId, 'daily-0900', {
5146
+ * title: '오늘의 학습 리마인더',
5147
+ * body: '잊지 말고 학습을 이어가세요!',
5148
+ * data: { route: '/today' },
5149
+ * })
5150
+ * console.log(result.message_id, result.sent_count)
5151
+ * ```
5152
+ */
5153
+ sendToTopic(appId: string, topicName: string, payload: SendToTopicPayload): Promise<SendPushResult>;
5109
5154
  /**
5110
5155
  * 브라우저 고유 ID 생성 (localStorage에 저장)
5111
5156
  */
@@ -5421,6 +5466,35 @@ interface SuperChat {
5421
5466
  };
5422
5467
  created_at: string;
5423
5468
  }
5469
+ type SuperChatType = 'super_chat' | 'super_thanks' | 'super_sticker' | 'tip';
5470
+ /** sendSuperChat 옵션 — videoId 또는 liveId 중 하나로 대상을 지정한다. */
5471
+ interface SendSuperChatOptions {
5472
+ /** 대상 영상 ID (videoId 또는 liveId 중 하나 필수) */
5473
+ videoId?: string;
5474
+ /** 대상 라이브 ID */
5475
+ liveId?: string;
5476
+ /** 슈퍼챗 종류 (기본 'super_thanks') */
5477
+ type?: SuperChatType;
5478
+ message?: string;
5479
+ /** ISO 통화 코드 (기본 'USD') */
5480
+ currency?: string;
5481
+ stickerId?: string;
5482
+ }
5483
+ /**
5484
+ * 슈퍼챗 전송 응답. `client_secret` 으로 결제(Stripe PaymentIntent)를 확정해야
5485
+ * 슈퍼챗이 노출된다.
5486
+ */
5487
+ interface SendSuperChatResponse {
5488
+ super_chat_id: string;
5489
+ client_secret: string;
5490
+ amount: number;
5491
+ currency: string;
5492
+ platform_fee: number;
5493
+ creator_amount: number;
5494
+ display_duration: number;
5495
+ color: string;
5496
+ highlighted: boolean;
5497
+ }
5424
5498
 
5425
5499
  declare class VideoProcessingError extends Error {
5426
5500
  video?: Video;
@@ -5540,15 +5614,18 @@ declare class VideoAPI {
5540
5614
  */
5541
5615
  unsubscribeChannel(channelId: string): Promise<void>;
5542
5616
  /**
5543
- * Create a playlist
5617
+ * Create a playlist for a channel.
5618
+ * 백엔드는 `POST /v1/public/playlists` 에 body 로 `channel_id` 를 받는다 (AppMember 인증).
5544
5619
  */
5545
5620
  createPlaylist(channelId: string, data: CreatePlaylistRequest): Promise<Playlist>;
5546
5621
  /**
5547
- * Get playlists for a channel
5622
+ * Get a channel's public playlists.
5623
+ * 백엔드는 `GET /v1/public/playlists/public?channel_id=` 로 공개 플레이리스트를 반환한다.
5548
5624
  */
5549
5625
  getPlaylists(channelId: string): Promise<Playlist[]>;
5550
5626
  /**
5551
- * Get playlist items
5627
+ * Get playlist items.
5628
+ * 백엔드는 별도 items 라우트가 없고 `GET /v1/public/playlists/:id` 응답에 items 를 포함한다.
5552
5629
  */
5553
5630
  getPlaylistItems(playlistId: string): Promise<PlaylistItem[]>;
5554
5631
  /**
@@ -5635,9 +5712,17 @@ declare class VideoAPI {
5635
5712
  */
5636
5713
  cancelMembership(_channelId: string, membershipId: string): Promise<void>;
5637
5714
  /**
5638
- * Send a super chat
5715
+ * Send a super chat to a channel.
5716
+ *
5717
+ * 백엔드는 `POST /v1/public/super-chats` 에 `channel_id`/`type`/`amount` 를 요구하고,
5718
+ * `video_id` 또는 `live_id` 중 하나로 대상을 지정한다 (AppMember 인증 필수).
5719
+ * 응답의 `client_secret` 으로 결제(Stripe)를 확정해야 슈퍼챗이 노출된다.
5720
+ *
5721
+ * @param channelId 슈퍼챗을 받을 채널 ID
5722
+ * @param amount 금액(최소 단위 정수)
5723
+ * @param options videoId 또는 liveId 중 하나로 대상 지정 + 종류/메시지/통화
5639
5724
  */
5640
- sendSuperChat(videoId: string, amount: number, message?: string, currency?: string): Promise<SuperChat>;
5725
+ sendSuperChat(channelId: string, amount: number, options?: SendSuperChatOptions): Promise<SendSuperChatResponse>;
5641
5726
  /**
5642
5727
  * Get super chats for a video
5643
5728
  */
@@ -9020,4 +9105,4 @@ declare class ConnectBase {
9020
9105
  updateConfig(config: Partial<ConnectBaseConfig>): void;
9021
9106
  }
9022
9107
 
9023
- 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 };
9108
+ 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 SendSuperChatOptions, type SendSuperChatResponse, 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 SuperChatType, 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
@@ -4932,6 +4932,24 @@ interface SendToMembersPayload {
4932
4932
  /** ISO8601 형식 예약 발송 시각. 미지정 시 즉시 발송. */
4933
4933
  scheduledAt?: string;
4934
4934
  }
4935
+ /**
4936
+ * `cb.push.sendToTopic` 페이로드. 백엔드 `dto.SendPushToTopicRequest` 에 매핑되며,
4937
+ * topic_name 은 메서드 인자로 받아 SDK 가 채운다. (members 발송과 달리 대상은 토픽 구독자 전체)
4938
+ */
4939
+ interface SendToTopicPayload {
4940
+ title: string;
4941
+ body: string;
4942
+ imageUrl?: string;
4943
+ data?: Record<string, unknown>;
4944
+ /** 'ios' | 'android' | 'web' 중 선택. 빈 배열/미지정 시 전체 플랫폼 발송. */
4945
+ platforms?: Array<'ios' | 'android' | 'web'>;
4946
+ /** TTL(초). 기본 86400 (24h). */
4947
+ ttlSeconds?: number;
4948
+ priority?: 'normal' | 'high';
4949
+ clickAction?: string;
4950
+ /** ISO8601 형식 예약 발송 시각. 미지정 시 즉시 발송. */
4951
+ scheduledAt?: string;
4952
+ }
4935
4953
  /**
4936
4954
  * 발송 결과. 백엔드 `dto.SendResultResponse` 와 1:1 매핑.
4937
4955
  */
@@ -5106,6 +5124,33 @@ declare class PushAPI {
5106
5124
  * ```
5107
5125
  */
5108
5126
  sendToMembers(appId: string, memberIds: string[], payload: SendToMembersPayload): Promise<SendPushResult>;
5127
+ /**
5128
+ * 토픽 구독자 전체에게 푸시 알림을 발송한다 (서버 사이드 전용).
5129
+ *
5130
+ * 백엔드 라우트 `POST /v1/apps/:appID/push/send-to-topic` 는 콘솔 JWT, User Secret Key(`cb_sk_`),
5131
+ * 또는 service_role 토큰(`ctx.cbAdmin`)을 받는다. `sendToMembers` 와 동일하게 브라우저 SDK 의
5132
+ * Public Key(`cb_pk_`) **단독** 인스턴스에서는 호출이 차단되며, 위임 Bearer 토큰을 가진
5133
+ * 인스턴스(`ctx.cbAdmin`/`ctx.cb`)는 cb_pk_ 가 앱 식별용으로만 실리므로 허용된다.
5134
+ *
5135
+ * 정기 알림(일일 리마인더 등)을 ConnectBase Function 스케줄러에서 `ctx.cbAdmin` 으로 발송하는
5136
+ * 것이 대표 유스케이스다 — 시크릿 키를 콘솔에서 별도로 발급해 함수 secret 에 넣을 필요가 없다.
5137
+ *
5138
+ * @param appId 발송 대상 앱 ID.
5139
+ * @param topicName 발송 대상 토픽 이름 (예: 'daily-0900').
5140
+ * @param payload 푸시 내용/옵션.
5141
+ *
5142
+ * @example
5143
+ * ```ts
5144
+ * // ConnectBase Function (service_role=true) — 시크릿 키 없이 ctx.cbAdmin 으로 토픽 발송
5145
+ * const result = await ctx.cbAdmin.push.sendToTopic(ctx.appId, 'daily-0900', {
5146
+ * title: '오늘의 학습 리마인더',
5147
+ * body: '잊지 말고 학습을 이어가세요!',
5148
+ * data: { route: '/today' },
5149
+ * })
5150
+ * console.log(result.message_id, result.sent_count)
5151
+ * ```
5152
+ */
5153
+ sendToTopic(appId: string, topicName: string, payload: SendToTopicPayload): Promise<SendPushResult>;
5109
5154
  /**
5110
5155
  * 브라우저 고유 ID 생성 (localStorage에 저장)
5111
5156
  */
@@ -5421,6 +5466,35 @@ interface SuperChat {
5421
5466
  };
5422
5467
  created_at: string;
5423
5468
  }
5469
+ type SuperChatType = 'super_chat' | 'super_thanks' | 'super_sticker' | 'tip';
5470
+ /** sendSuperChat 옵션 — videoId 또는 liveId 중 하나로 대상을 지정한다. */
5471
+ interface SendSuperChatOptions {
5472
+ /** 대상 영상 ID (videoId 또는 liveId 중 하나 필수) */
5473
+ videoId?: string;
5474
+ /** 대상 라이브 ID */
5475
+ liveId?: string;
5476
+ /** 슈퍼챗 종류 (기본 'super_thanks') */
5477
+ type?: SuperChatType;
5478
+ message?: string;
5479
+ /** ISO 통화 코드 (기본 'USD') */
5480
+ currency?: string;
5481
+ stickerId?: string;
5482
+ }
5483
+ /**
5484
+ * 슈퍼챗 전송 응답. `client_secret` 으로 결제(Stripe PaymentIntent)를 확정해야
5485
+ * 슈퍼챗이 노출된다.
5486
+ */
5487
+ interface SendSuperChatResponse {
5488
+ super_chat_id: string;
5489
+ client_secret: string;
5490
+ amount: number;
5491
+ currency: string;
5492
+ platform_fee: number;
5493
+ creator_amount: number;
5494
+ display_duration: number;
5495
+ color: string;
5496
+ highlighted: boolean;
5497
+ }
5424
5498
 
5425
5499
  declare class VideoProcessingError extends Error {
5426
5500
  video?: Video;
@@ -5540,15 +5614,18 @@ declare class VideoAPI {
5540
5614
  */
5541
5615
  unsubscribeChannel(channelId: string): Promise<void>;
5542
5616
  /**
5543
- * Create a playlist
5617
+ * Create a playlist for a channel.
5618
+ * 백엔드는 `POST /v1/public/playlists` 에 body 로 `channel_id` 를 받는다 (AppMember 인증).
5544
5619
  */
5545
5620
  createPlaylist(channelId: string, data: CreatePlaylistRequest): Promise<Playlist>;
5546
5621
  /**
5547
- * Get playlists for a channel
5622
+ * Get a channel's public playlists.
5623
+ * 백엔드는 `GET /v1/public/playlists/public?channel_id=` 로 공개 플레이리스트를 반환한다.
5548
5624
  */
5549
5625
  getPlaylists(channelId: string): Promise<Playlist[]>;
5550
5626
  /**
5551
- * Get playlist items
5627
+ * Get playlist items.
5628
+ * 백엔드는 별도 items 라우트가 없고 `GET /v1/public/playlists/:id` 응답에 items 를 포함한다.
5552
5629
  */
5553
5630
  getPlaylistItems(playlistId: string): Promise<PlaylistItem[]>;
5554
5631
  /**
@@ -5635,9 +5712,17 @@ declare class VideoAPI {
5635
5712
  */
5636
5713
  cancelMembership(_channelId: string, membershipId: string): Promise<void>;
5637
5714
  /**
5638
- * Send a super chat
5715
+ * Send a super chat to a channel.
5716
+ *
5717
+ * 백엔드는 `POST /v1/public/super-chats` 에 `channel_id`/`type`/`amount` 를 요구하고,
5718
+ * `video_id` 또는 `live_id` 중 하나로 대상을 지정한다 (AppMember 인증 필수).
5719
+ * 응답의 `client_secret` 으로 결제(Stripe)를 확정해야 슈퍼챗이 노출된다.
5720
+ *
5721
+ * @param channelId 슈퍼챗을 받을 채널 ID
5722
+ * @param amount 금액(최소 단위 정수)
5723
+ * @param options videoId 또는 liveId 중 하나로 대상 지정 + 종류/메시지/통화
5639
5724
  */
5640
- sendSuperChat(videoId: string, amount: number, message?: string, currency?: string): Promise<SuperChat>;
5725
+ sendSuperChat(channelId: string, amount: number, options?: SendSuperChatOptions): Promise<SendSuperChatResponse>;
5641
5726
  /**
5642
5727
  * Get super chats for a video
5643
5728
  */
@@ -9020,4 +9105,4 @@ declare class ConnectBase {
9020
9105
  updateConfig(config: Partial<ConnectBaseConfig>): void;
9021
9106
  }
9022
9107
 
9023
- 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 };
9108
+ 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 SendSuperChatOptions, type SendSuperChatResponse, 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 SuperChatType, 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
@@ -6201,6 +6201,55 @@ var PushAPI = class {
6201
6201
  };
6202
6202
  return this.http.post(`/v1/apps/${appId}/push/send`, body);
6203
6203
  }
6204
+ /**
6205
+ * 토픽 구독자 전체에게 푸시 알림을 발송한다 (서버 사이드 전용).
6206
+ *
6207
+ * 백엔드 라우트 `POST /v1/apps/:appID/push/send-to-topic` 는 콘솔 JWT, User Secret Key(`cb_sk_`),
6208
+ * 또는 service_role 토큰(`ctx.cbAdmin`)을 받는다. `sendToMembers` 와 동일하게 브라우저 SDK 의
6209
+ * Public Key(`cb_pk_`) **단독** 인스턴스에서는 호출이 차단되며, 위임 Bearer 토큰을 가진
6210
+ * 인스턴스(`ctx.cbAdmin`/`ctx.cb`)는 cb_pk_ 가 앱 식별용으로만 실리므로 허용된다.
6211
+ *
6212
+ * 정기 알림(일일 리마인더 등)을 ConnectBase Function 스케줄러에서 `ctx.cbAdmin` 으로 발송하는
6213
+ * 것이 대표 유스케이스다 — 시크릿 키를 콘솔에서 별도로 발급해 함수 secret 에 넣을 필요가 없다.
6214
+ *
6215
+ * @param appId 발송 대상 앱 ID.
6216
+ * @param topicName 발송 대상 토픽 이름 (예: 'daily-0900').
6217
+ * @param payload 푸시 내용/옵션.
6218
+ *
6219
+ * @example
6220
+ * ```ts
6221
+ * // ConnectBase Function (service_role=true) — 시크릿 키 없이 ctx.cbAdmin 으로 토픽 발송
6222
+ * const result = await ctx.cbAdmin.push.sendToTopic(ctx.appId, 'daily-0900', {
6223
+ * title: '오늘의 학습 리마인더',
6224
+ * body: '잊지 말고 학습을 이어가세요!',
6225
+ * data: { route: '/today' },
6226
+ * })
6227
+ * console.log(result.message_id, result.sent_count)
6228
+ * ```
6229
+ */
6230
+ async sendToTopic(appId, topicName, payload) {
6231
+ if (this.http.hasPublicKey() && !this.http.hasJWT()) {
6232
+ throw new Error(
6233
+ "cb.push.sendToTopic() \uB294 User Secret Key(cb_sk_), \uCF58\uC194 JWT, \uB610\uB294 service_role(ctx.cbAdmin) \uC778\uC99D\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. Public Key(cb_pk_) \uB2E8\uB3C5 SDK \uC778\uC2A4\uD134\uC2A4\uB85C\uB294 \uD638\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 Functions \uD658\uACBD\uC5D0\uC11C \uC0AC\uC6A9\uD558\uC138\uC694."
6234
+ );
6235
+ }
6236
+ if (!topicName) {
6237
+ throw new Error("cb.push.sendToTopic(): topicName \uC774 \uBE44\uC5B4\uC788\uC2B5\uB2C8\uB2E4.");
6238
+ }
6239
+ const body = {
6240
+ topic_name: topicName,
6241
+ title: payload.title,
6242
+ body: payload.body,
6243
+ ...payload.imageUrl !== void 0 ? { image_url: payload.imageUrl } : {},
6244
+ ...payload.data !== void 0 ? { data: payload.data } : {},
6245
+ ...payload.platforms !== void 0 ? { platforms: payload.platforms } : {},
6246
+ ...payload.ttlSeconds !== void 0 ? { ttl: payload.ttlSeconds } : {},
6247
+ ...payload.priority !== void 0 ? { priority: payload.priority } : {},
6248
+ ...payload.clickAction !== void 0 ? { click_action: payload.clickAction } : {},
6249
+ ...payload.scheduledAt !== void 0 ? { scheduled_at: payload.scheduledAt } : {}
6250
+ };
6251
+ return this.http.post(`/v1/apps/${appId}/push/send-to-topic`, body);
6252
+ }
6204
6253
  // ============ Helper Methods ============
6205
6254
  /**
6206
6255
  * 브라우저 고유 ID 생성 (localStorage에 저장)
@@ -6720,31 +6769,37 @@ var VideoAPI = class {
6720
6769
  }
6721
6770
  // ========== Playlist Operations ==========
6722
6771
  /**
6723
- * Create a playlist
6772
+ * Create a playlist for a channel.
6773
+ * 백엔드는 `POST /v1/public/playlists` 에 body 로 `channel_id` 를 받는다 (AppMember 인증).
6724
6774
  */
6725
6775
  async createPlaylist(channelId, data) {
6726
6776
  const prefix = this.getPublicPrefix();
6727
- return this.videoFetch("POST", `${prefix}/channels/${channelId}/playlists`, data);
6777
+ return this.videoFetch("POST", `${prefix}/playlists`, {
6778
+ ...data,
6779
+ channel_id: channelId
6780
+ });
6728
6781
  }
6729
6782
  /**
6730
- * Get playlists for a channel
6783
+ * Get a channel's public playlists.
6784
+ * 백엔드는 `GET /v1/public/playlists/public?channel_id=` 로 공개 플레이리스트를 반환한다.
6731
6785
  */
6732
6786
  async getPlaylists(channelId) {
6733
6787
  const prefix = this.getPublicPrefix();
6734
6788
  const response = await this.videoFetch(
6735
6789
  "GET",
6736
- `${prefix}/channels/${channelId}/playlists`
6790
+ `${prefix}/playlists/public?channel_id=${encodeURIComponent(channelId)}`
6737
6791
  );
6738
6792
  return response.playlists;
6739
6793
  }
6740
6794
  /**
6741
- * Get playlist items
6795
+ * Get playlist items.
6796
+ * 백엔드는 별도 items 라우트가 없고 `GET /v1/public/playlists/:id` 응답에 items 를 포함한다.
6742
6797
  */
6743
6798
  async getPlaylistItems(playlistId) {
6744
6799
  const prefix = this.getPublicPrefix();
6745
6800
  const response = await this.videoFetch(
6746
6801
  "GET",
6747
- `${prefix}/playlists/${playlistId}/items`
6802
+ `${prefix}/playlists/${playlistId}`
6748
6803
  );
6749
6804
  return response.items;
6750
6805
  }
@@ -6909,14 +6964,27 @@ var VideoAPI = class {
6909
6964
  }
6910
6965
  // ========== Super Chat Operations ==========
6911
6966
  /**
6912
- * Send a super chat
6967
+ * Send a super chat to a channel.
6968
+ *
6969
+ * 백엔드는 `POST /v1/public/super-chats` 에 `channel_id`/`type`/`amount` 를 요구하고,
6970
+ * `video_id` 또는 `live_id` 중 하나로 대상을 지정한다 (AppMember 인증 필수).
6971
+ * 응답의 `client_secret` 으로 결제(Stripe)를 확정해야 슈퍼챗이 노출된다.
6972
+ *
6973
+ * @param channelId 슈퍼챗을 받을 채널 ID
6974
+ * @param amount 금액(최소 단위 정수)
6975
+ * @param options videoId 또는 liveId 중 하나로 대상 지정 + 종류/메시지/통화
6913
6976
  */
6914
- async sendSuperChat(videoId, amount, message, currency) {
6977
+ async sendSuperChat(channelId, amount, options) {
6915
6978
  const prefix = this.getPublicPrefix();
6916
- return this.videoFetch("POST", `${prefix}/videos/${videoId}/super-chats`, {
6979
+ return this.videoFetch("POST", `${prefix}/super-chats`, {
6980
+ channel_id: channelId,
6981
+ type: options?.type ?? "super_thanks",
6917
6982
  amount,
6918
- message,
6919
- currency: currency || "USD"
6983
+ video_id: options?.videoId,
6984
+ live_id: options?.liveId,
6985
+ currency: options?.currency ?? "USD",
6986
+ message: options?.message,
6987
+ sticker_id: options?.stickerId
6920
6988
  });
6921
6989
  }
6922
6990
  /**
package/dist/index.mjs CHANGED
@@ -6155,6 +6155,55 @@ var PushAPI = class {
6155
6155
  };
6156
6156
  return this.http.post(`/v1/apps/${appId}/push/send`, body);
6157
6157
  }
6158
+ /**
6159
+ * 토픽 구독자 전체에게 푸시 알림을 발송한다 (서버 사이드 전용).
6160
+ *
6161
+ * 백엔드 라우트 `POST /v1/apps/:appID/push/send-to-topic` 는 콘솔 JWT, User Secret Key(`cb_sk_`),
6162
+ * 또는 service_role 토큰(`ctx.cbAdmin`)을 받는다. `sendToMembers` 와 동일하게 브라우저 SDK 의
6163
+ * Public Key(`cb_pk_`) **단독** 인스턴스에서는 호출이 차단되며, 위임 Bearer 토큰을 가진
6164
+ * 인스턴스(`ctx.cbAdmin`/`ctx.cb`)는 cb_pk_ 가 앱 식별용으로만 실리므로 허용된다.
6165
+ *
6166
+ * 정기 알림(일일 리마인더 등)을 ConnectBase Function 스케줄러에서 `ctx.cbAdmin` 으로 발송하는
6167
+ * 것이 대표 유스케이스다 — 시크릿 키를 콘솔에서 별도로 발급해 함수 secret 에 넣을 필요가 없다.
6168
+ *
6169
+ * @param appId 발송 대상 앱 ID.
6170
+ * @param topicName 발송 대상 토픽 이름 (예: 'daily-0900').
6171
+ * @param payload 푸시 내용/옵션.
6172
+ *
6173
+ * @example
6174
+ * ```ts
6175
+ * // ConnectBase Function (service_role=true) — 시크릿 키 없이 ctx.cbAdmin 으로 토픽 발송
6176
+ * const result = await ctx.cbAdmin.push.sendToTopic(ctx.appId, 'daily-0900', {
6177
+ * title: '오늘의 학습 리마인더',
6178
+ * body: '잊지 말고 학습을 이어가세요!',
6179
+ * data: { route: '/today' },
6180
+ * })
6181
+ * console.log(result.message_id, result.sent_count)
6182
+ * ```
6183
+ */
6184
+ async sendToTopic(appId, topicName, payload) {
6185
+ if (this.http.hasPublicKey() && !this.http.hasJWT()) {
6186
+ throw new Error(
6187
+ "cb.push.sendToTopic() \uB294 User Secret Key(cb_sk_), \uCF58\uC194 JWT, \uB610\uB294 service_role(ctx.cbAdmin) \uC778\uC99D\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. Public Key(cb_pk_) \uB2E8\uB3C5 SDK \uC778\uC2A4\uD134\uC2A4\uB85C\uB294 \uD638\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 Functions \uD658\uACBD\uC5D0\uC11C \uC0AC\uC6A9\uD558\uC138\uC694."
6188
+ );
6189
+ }
6190
+ if (!topicName) {
6191
+ throw new Error("cb.push.sendToTopic(): topicName \uC774 \uBE44\uC5B4\uC788\uC2B5\uB2C8\uB2E4.");
6192
+ }
6193
+ const body = {
6194
+ topic_name: topicName,
6195
+ title: payload.title,
6196
+ body: payload.body,
6197
+ ...payload.imageUrl !== void 0 ? { image_url: payload.imageUrl } : {},
6198
+ ...payload.data !== void 0 ? { data: payload.data } : {},
6199
+ ...payload.platforms !== void 0 ? { platforms: payload.platforms } : {},
6200
+ ...payload.ttlSeconds !== void 0 ? { ttl: payload.ttlSeconds } : {},
6201
+ ...payload.priority !== void 0 ? { priority: payload.priority } : {},
6202
+ ...payload.clickAction !== void 0 ? { click_action: payload.clickAction } : {},
6203
+ ...payload.scheduledAt !== void 0 ? { scheduled_at: payload.scheduledAt } : {}
6204
+ };
6205
+ return this.http.post(`/v1/apps/${appId}/push/send-to-topic`, body);
6206
+ }
6158
6207
  // ============ Helper Methods ============
6159
6208
  /**
6160
6209
  * 브라우저 고유 ID 생성 (localStorage에 저장)
@@ -6674,31 +6723,37 @@ var VideoAPI = class {
6674
6723
  }
6675
6724
  // ========== Playlist Operations ==========
6676
6725
  /**
6677
- * Create a playlist
6726
+ * Create a playlist for a channel.
6727
+ * 백엔드는 `POST /v1/public/playlists` 에 body 로 `channel_id` 를 받는다 (AppMember 인증).
6678
6728
  */
6679
6729
  async createPlaylist(channelId, data) {
6680
6730
  const prefix = this.getPublicPrefix();
6681
- return this.videoFetch("POST", `${prefix}/channels/${channelId}/playlists`, data);
6731
+ return this.videoFetch("POST", `${prefix}/playlists`, {
6732
+ ...data,
6733
+ channel_id: channelId
6734
+ });
6682
6735
  }
6683
6736
  /**
6684
- * Get playlists for a channel
6737
+ * Get a channel's public playlists.
6738
+ * 백엔드는 `GET /v1/public/playlists/public?channel_id=` 로 공개 플레이리스트를 반환한다.
6685
6739
  */
6686
6740
  async getPlaylists(channelId) {
6687
6741
  const prefix = this.getPublicPrefix();
6688
6742
  const response = await this.videoFetch(
6689
6743
  "GET",
6690
- `${prefix}/channels/${channelId}/playlists`
6744
+ `${prefix}/playlists/public?channel_id=${encodeURIComponent(channelId)}`
6691
6745
  );
6692
6746
  return response.playlists;
6693
6747
  }
6694
6748
  /**
6695
- * Get playlist items
6749
+ * Get playlist items.
6750
+ * 백엔드는 별도 items 라우트가 없고 `GET /v1/public/playlists/:id` 응답에 items 를 포함한다.
6696
6751
  */
6697
6752
  async getPlaylistItems(playlistId) {
6698
6753
  const prefix = this.getPublicPrefix();
6699
6754
  const response = await this.videoFetch(
6700
6755
  "GET",
6701
- `${prefix}/playlists/${playlistId}/items`
6756
+ `${prefix}/playlists/${playlistId}`
6702
6757
  );
6703
6758
  return response.items;
6704
6759
  }
@@ -6863,14 +6918,27 @@ var VideoAPI = class {
6863
6918
  }
6864
6919
  // ========== Super Chat Operations ==========
6865
6920
  /**
6866
- * Send a super chat
6921
+ * Send a super chat to a channel.
6922
+ *
6923
+ * 백엔드는 `POST /v1/public/super-chats` 에 `channel_id`/`type`/`amount` 를 요구하고,
6924
+ * `video_id` 또는 `live_id` 중 하나로 대상을 지정한다 (AppMember 인증 필수).
6925
+ * 응답의 `client_secret` 으로 결제(Stripe)를 확정해야 슈퍼챗이 노출된다.
6926
+ *
6927
+ * @param channelId 슈퍼챗을 받을 채널 ID
6928
+ * @param amount 금액(최소 단위 정수)
6929
+ * @param options videoId 또는 liveId 중 하나로 대상 지정 + 종류/메시지/통화
6867
6930
  */
6868
- async sendSuperChat(videoId, amount, message, currency) {
6931
+ async sendSuperChat(channelId, amount, options) {
6869
6932
  const prefix = this.getPublicPrefix();
6870
- return this.videoFetch("POST", `${prefix}/videos/${videoId}/super-chats`, {
6933
+ return this.videoFetch("POST", `${prefix}/super-chats`, {
6934
+ channel_id: channelId,
6935
+ type: options?.type ?? "super_thanks",
6871
6936
  amount,
6872
- message,
6873
- currency: currency || "USD"
6937
+ video_id: options?.videoId,
6938
+ live_id: options?.liveId,
6939
+ currency: options?.currency ?? "USD",
6940
+ message: options?.message,
6941
+ sticker_id: options?.stickerId
6874
6942
  });
6875
6943
  }
6876
6944
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "connectbase-client",
3
- "version": "3.36.0",
3
+ "version": "3.38.0",
4
4
  "description": "Connect Base JavaScript/TypeScript SDK for browser and Node.js",
5
5
  "repository": {
6
6
  "type": "git",