connectbase-client 3.38.0 → 3.39.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
@@ -12,30 +12,6 @@ declare class ApiError extends Error {
12
12
  declare class AuthError extends Error {
13
13
  constructor(message: string);
14
14
  }
15
- /**
16
- * `cb.auth.signInAsGuestMember()` 호출 시 이미 활성화된 비-게스트 세션이 감지되면 발생.
17
- *
18
- * 같은 origin + 같은 publicKey 에서 OAuth/Email 로그인이 살아있는 상태로
19
- * 우발적으로 게스트 로그인이 호출되면 메인 토큰 슬롯이 silent 로 덮어써지는
20
- * 회귀(platform-issue 019e6c5d)를 차단하기 위한 가드.
21
- *
22
- * 명시적으로 활성 세션을 게스트로 교체하려면 `{ allowOverrideExistingSession: true }` 를
23
- * 옵션으로 넘기거나, 먼저 `cb.auth.signOut()` 으로 정리할 것.
24
- *
25
- * ```ts
26
- * try {
27
- * await cb.auth.signInAsGuestMember()
28
- * } catch (e) {
29
- * if (e instanceof GuestSessionConflictError) {
30
- * // 이미 로그인된 사용자가 있다는 뜻 — 게스트로 강제 전환할지 사용자에게 물어볼 것
31
- * }
32
- * }
33
- * ```
34
- */
35
- declare class GuestSessionConflictError extends Error {
36
- code: string;
37
- constructor();
38
- }
39
15
  /**
40
16
  * GameError 는 game-server 가 surface 한 `error` 메시지 (createRoom/joinRoom/sendAction
41
17
  * 응답 또는 broadcastScriptError) 를 client 측에서 일관된 형태로 다루기 위한 예외 클래스.
@@ -759,12 +735,6 @@ declare class AnalyticsAPI {
759
735
  private log;
760
736
  }
761
737
 
762
- /** 앱 멤버 게스트 가입 응답 */
763
- interface GuestMemberSignInResponse {
764
- member_id: string;
765
- access_token: string;
766
- refresh_token: string;
767
- }
768
738
  /** 앱 멤버 회원가입 요청 */
769
739
  interface MemberSignUpRequest {
770
740
  login_id: string;
@@ -801,9 +771,8 @@ interface MemberInfoResponse {
801
771
  /** 멤버 역할 — RLS 규칙에서 `auth.role` 로 참조 (예: "admin", "moderator") */
802
772
  role?: string;
803
773
  /**
804
- * 현재 세션이 게스트(자동 생성된 익명 멤버)인지 여부.
805
- * `cb.auth.signInAsGuestMember()` 만들어진 멤버 또는 identity 전혀 없는
806
- * 멤버는 true. 게스트 둔갑(silent overwrite) 감지/복구용 결정적 신호다.
774
+ * 현재 세션이 게스트(identity 전혀 없는 멤버 또는 레거시 GUEST identity)인지 여부.
775
+ * 신규 게스트 로그인은 제거됐으나, 기존 게스트 멤버 식별을 위해 유지된다.
807
776
  */
808
777
  is_guest?: boolean;
809
778
  /**
@@ -828,30 +797,12 @@ interface UpdateCustomDataResponse {
828
797
  interface AuthSettingsResponse {
829
798
  /** 아이디/비밀번호 로그인 허용 여부 */
830
799
  allow_id_password_login: boolean;
831
- /** 게스트 로그인 허용 여부 */
832
- allow_guest_login: boolean;
833
800
  /** 활성화된 OAuth 프로바이더 목록 (GOOGLE, KAKAO, NAVER, APPLE, GITHUB, DISCORD) */
834
801
  enabled_oauth_providers: string[];
835
802
  }
836
803
 
837
- /**
838
- * `signInAsGuestMember()` 의 동작을 제어하는 옵션.
839
- *
840
- * `allowOverrideExistingSession` 가 false(또는 미지정) 이고 활성 비-게스트 세션이
841
- * 감지되면 `GuestSessionConflictError` 가 발생한다. true 로 명시해야만 silent
842
- * overwrite 가 허용된다 (platform-issue 019e6c5d 가드).
843
- */
844
- interface SignInAsGuestMemberOptions {
845
- /**
846
- * 이미 활성화된 비-게스트(OAuth/email/username) 세션이 있어도 게스트 토큰으로
847
- * 덮어쓸지 여부. 기본값 false — 호출이 거부된다.
848
- */
849
- allowOverrideExistingSession?: boolean;
850
- }
851
804
  declare class AuthAPI {
852
805
  private http;
853
- private guestMemberLoginPromise;
854
- private cachedGuestMemberTokenKey;
855
806
  private analytics;
856
807
  constructor(http: HttpClient);
857
808
  /**
@@ -867,9 +818,7 @@ declare class AuthAPI {
867
818
  * @example
868
819
  * ```typescript
869
820
  * const settings = await client.auth.getAuthSettings()
870
- * if (settings.allow_guest_login) {
871
- * await client.auth.signInAsGuestMember()
872
- * } else if (settings.allow_id_password_login) {
821
+ * if (settings.allow_id_password_login) {
873
822
  * // 로그인 폼 표시
874
823
  * } else if (settings.enabled_oauth_providers.includes('GOOGLE')) {
875
824
  * // 구글 소셜 로그인 버튼 표시
@@ -906,44 +855,6 @@ declare class AuthAPI {
906
855
  * ```
907
856
  */
908
857
  signInMember(data: MemberSignInRequest): Promise<MemberSignInResponse>;
909
- /**
910
- * 앱 멤버 게스트 가입
911
- * API Key로 인증된 앱에 게스트 멤버로 가입합니다.
912
- * 실시간 채팅 등에서 JWT 토큰 기반 인증이 필요할 때 사용합니다.
913
- * 로컬 스토리지에 저장된 토큰이 있으면 기존 계정으로 재로그인을 시도합니다.
914
- * 동시 호출 시 중복 요청 방지 (race condition 방지)
915
- *
916
- * **활성 세션 가드 (3.22.0+)**
917
- * OAuth/email/username 로 이미 로그인된 세션이 살아있는 채 이 메서드가 호출되면
918
- * 메인 토큰 슬롯이 silent 로 게스트 토큰으로 덮어써져 사용자가 둔갑되는 회귀가
919
- * 있었다 (platform-issue 019e6c5d). 이를 막기 위해 활성 비-게스트 세션이 감지되면
920
- * 기본적으로 `GuestSessionConflictError` 를 던진다. 명시적으로 교체하려면
921
- * `{ allowOverrideExistingSession: true }` 를 전달하거나 먼저 `signOut()` 을 호출할 것.
922
- *
923
- * @example
924
- * ```typescript
925
- * const guest = await client.auth.signInAsGuestMember()
926
- * await client.realtime.connect({ accessToken: guest.access_token })
927
- *
928
- * // 활성 세션을 명시적으로 교체 (예: "게스트로 계속" 버튼)
929
- * await client.auth.signInAsGuestMember({ allowOverrideExistingSession: true })
930
- * ```
931
- */
932
- signInAsGuestMember(opts?: SignInAsGuestMemberOptions): Promise<GuestMemberSignInResponse>;
933
- /**
934
- * 현재 in-memory access token 이 "게스트 토큰이 아닌 다른 세션" 으로 판단되는지 확인.
935
- *
936
- * 판별 규칙:
937
- * - access token 자체가 없으면 false (어떤 세션도 없음)
938
- * - access token 이 만료됐으면 false (재로그인이 필요한 dead 상태)
939
- * - persistence='none' 인 경우: 토큰은 메모리에만 존재. 우리는 그 토큰이
940
- * 게스트인지 회원인지 분별할 메타가 메모리에 없다 → 보수적으로 true 처리.
941
- * (회원이 가지고 있던 세션을 게스트가 덮어쓰는 게 더 큰 사고이므로
942
- * false-positive < silent overwrite.)
943
- * - persistence='localStorage'|'sessionStorage' 인 경우: 저장된 게스트 토큰과
944
- * 현재 access token 이 일치하면 게스트 세션(false), 다르면 비-게스트(true).
945
- */
946
- private hasActiveNonGuestSession;
947
858
  /**
948
859
  * 현재 로그인한 멤버 정보 조회
949
860
  * custom_data를 포함한 멤버 정보를 반환합니다.
@@ -1015,15 +926,6 @@ declare class AuthAPI {
1015
926
  * 로그아웃
1016
927
  */
1017
928
  signOut(): Promise<void>;
1018
- /**
1019
- * 저장된 게스트 멤버 토큰 삭제
1020
- */
1021
- clearGuestMemberTokens(): void;
1022
- private executeGuestMemberLogin;
1023
- private isTokenExpired;
1024
- private getGuestMemberTokenKey;
1025
- private getStoredGuestMemberTokens;
1026
- private storeGuestMemberTokens;
1027
929
  }
1028
930
 
1029
931
  /**
@@ -9105,4 +9007,4 @@ declare class ConnectBase {
9105
9007
  updateConfig(config: Partial<ConnectBaseConfig>): void;
9106
9008
  }
9107
9009
 
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 };
9010
+ 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 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
@@ -12,30 +12,6 @@ declare class ApiError extends Error {
12
12
  declare class AuthError extends Error {
13
13
  constructor(message: string);
14
14
  }
15
- /**
16
- * `cb.auth.signInAsGuestMember()` 호출 시 이미 활성화된 비-게스트 세션이 감지되면 발생.
17
- *
18
- * 같은 origin + 같은 publicKey 에서 OAuth/Email 로그인이 살아있는 상태로
19
- * 우발적으로 게스트 로그인이 호출되면 메인 토큰 슬롯이 silent 로 덮어써지는
20
- * 회귀(platform-issue 019e6c5d)를 차단하기 위한 가드.
21
- *
22
- * 명시적으로 활성 세션을 게스트로 교체하려면 `{ allowOverrideExistingSession: true }` 를
23
- * 옵션으로 넘기거나, 먼저 `cb.auth.signOut()` 으로 정리할 것.
24
- *
25
- * ```ts
26
- * try {
27
- * await cb.auth.signInAsGuestMember()
28
- * } catch (e) {
29
- * if (e instanceof GuestSessionConflictError) {
30
- * // 이미 로그인된 사용자가 있다는 뜻 — 게스트로 강제 전환할지 사용자에게 물어볼 것
31
- * }
32
- * }
33
- * ```
34
- */
35
- declare class GuestSessionConflictError extends Error {
36
- code: string;
37
- constructor();
38
- }
39
15
  /**
40
16
  * GameError 는 game-server 가 surface 한 `error` 메시지 (createRoom/joinRoom/sendAction
41
17
  * 응답 또는 broadcastScriptError) 를 client 측에서 일관된 형태로 다루기 위한 예외 클래스.
@@ -759,12 +735,6 @@ declare class AnalyticsAPI {
759
735
  private log;
760
736
  }
761
737
 
762
- /** 앱 멤버 게스트 가입 응답 */
763
- interface GuestMemberSignInResponse {
764
- member_id: string;
765
- access_token: string;
766
- refresh_token: string;
767
- }
768
738
  /** 앱 멤버 회원가입 요청 */
769
739
  interface MemberSignUpRequest {
770
740
  login_id: string;
@@ -801,9 +771,8 @@ interface MemberInfoResponse {
801
771
  /** 멤버 역할 — RLS 규칙에서 `auth.role` 로 참조 (예: "admin", "moderator") */
802
772
  role?: string;
803
773
  /**
804
- * 현재 세션이 게스트(자동 생성된 익명 멤버)인지 여부.
805
- * `cb.auth.signInAsGuestMember()` 만들어진 멤버 또는 identity 전혀 없는
806
- * 멤버는 true. 게스트 둔갑(silent overwrite) 감지/복구용 결정적 신호다.
774
+ * 현재 세션이 게스트(identity 전혀 없는 멤버 또는 레거시 GUEST identity)인지 여부.
775
+ * 신규 게스트 로그인은 제거됐으나, 기존 게스트 멤버 식별을 위해 유지된다.
807
776
  */
808
777
  is_guest?: boolean;
809
778
  /**
@@ -828,30 +797,12 @@ interface UpdateCustomDataResponse {
828
797
  interface AuthSettingsResponse {
829
798
  /** 아이디/비밀번호 로그인 허용 여부 */
830
799
  allow_id_password_login: boolean;
831
- /** 게스트 로그인 허용 여부 */
832
- allow_guest_login: boolean;
833
800
  /** 활성화된 OAuth 프로바이더 목록 (GOOGLE, KAKAO, NAVER, APPLE, GITHUB, DISCORD) */
834
801
  enabled_oauth_providers: string[];
835
802
  }
836
803
 
837
- /**
838
- * `signInAsGuestMember()` 의 동작을 제어하는 옵션.
839
- *
840
- * `allowOverrideExistingSession` 가 false(또는 미지정) 이고 활성 비-게스트 세션이
841
- * 감지되면 `GuestSessionConflictError` 가 발생한다. true 로 명시해야만 silent
842
- * overwrite 가 허용된다 (platform-issue 019e6c5d 가드).
843
- */
844
- interface SignInAsGuestMemberOptions {
845
- /**
846
- * 이미 활성화된 비-게스트(OAuth/email/username) 세션이 있어도 게스트 토큰으로
847
- * 덮어쓸지 여부. 기본값 false — 호출이 거부된다.
848
- */
849
- allowOverrideExistingSession?: boolean;
850
- }
851
804
  declare class AuthAPI {
852
805
  private http;
853
- private guestMemberLoginPromise;
854
- private cachedGuestMemberTokenKey;
855
806
  private analytics;
856
807
  constructor(http: HttpClient);
857
808
  /**
@@ -867,9 +818,7 @@ declare class AuthAPI {
867
818
  * @example
868
819
  * ```typescript
869
820
  * const settings = await client.auth.getAuthSettings()
870
- * if (settings.allow_guest_login) {
871
- * await client.auth.signInAsGuestMember()
872
- * } else if (settings.allow_id_password_login) {
821
+ * if (settings.allow_id_password_login) {
873
822
  * // 로그인 폼 표시
874
823
  * } else if (settings.enabled_oauth_providers.includes('GOOGLE')) {
875
824
  * // 구글 소셜 로그인 버튼 표시
@@ -906,44 +855,6 @@ declare class AuthAPI {
906
855
  * ```
907
856
  */
908
857
  signInMember(data: MemberSignInRequest): Promise<MemberSignInResponse>;
909
- /**
910
- * 앱 멤버 게스트 가입
911
- * API Key로 인증된 앱에 게스트 멤버로 가입합니다.
912
- * 실시간 채팅 등에서 JWT 토큰 기반 인증이 필요할 때 사용합니다.
913
- * 로컬 스토리지에 저장된 토큰이 있으면 기존 계정으로 재로그인을 시도합니다.
914
- * 동시 호출 시 중복 요청 방지 (race condition 방지)
915
- *
916
- * **활성 세션 가드 (3.22.0+)**
917
- * OAuth/email/username 로 이미 로그인된 세션이 살아있는 채 이 메서드가 호출되면
918
- * 메인 토큰 슬롯이 silent 로 게스트 토큰으로 덮어써져 사용자가 둔갑되는 회귀가
919
- * 있었다 (platform-issue 019e6c5d). 이를 막기 위해 활성 비-게스트 세션이 감지되면
920
- * 기본적으로 `GuestSessionConflictError` 를 던진다. 명시적으로 교체하려면
921
- * `{ allowOverrideExistingSession: true }` 를 전달하거나 먼저 `signOut()` 을 호출할 것.
922
- *
923
- * @example
924
- * ```typescript
925
- * const guest = await client.auth.signInAsGuestMember()
926
- * await client.realtime.connect({ accessToken: guest.access_token })
927
- *
928
- * // 활성 세션을 명시적으로 교체 (예: "게스트로 계속" 버튼)
929
- * await client.auth.signInAsGuestMember({ allowOverrideExistingSession: true })
930
- * ```
931
- */
932
- signInAsGuestMember(opts?: SignInAsGuestMemberOptions): Promise<GuestMemberSignInResponse>;
933
- /**
934
- * 현재 in-memory access token 이 "게스트 토큰이 아닌 다른 세션" 으로 판단되는지 확인.
935
- *
936
- * 판별 규칙:
937
- * - access token 자체가 없으면 false (어떤 세션도 없음)
938
- * - access token 이 만료됐으면 false (재로그인이 필요한 dead 상태)
939
- * - persistence='none' 인 경우: 토큰은 메모리에만 존재. 우리는 그 토큰이
940
- * 게스트인지 회원인지 분별할 메타가 메모리에 없다 → 보수적으로 true 처리.
941
- * (회원이 가지고 있던 세션을 게스트가 덮어쓰는 게 더 큰 사고이므로
942
- * false-positive < silent overwrite.)
943
- * - persistence='localStorage'|'sessionStorage' 인 경우: 저장된 게스트 토큰과
944
- * 현재 access token 이 일치하면 게스트 세션(false), 다르면 비-게스트(true).
945
- */
946
- private hasActiveNonGuestSession;
947
858
  /**
948
859
  * 현재 로그인한 멤버 정보 조회
949
860
  * custom_data를 포함한 멤버 정보를 반환합니다.
@@ -1015,15 +926,6 @@ declare class AuthAPI {
1015
926
  * 로그아웃
1016
927
  */
1017
928
  signOut(): Promise<void>;
1018
- /**
1019
- * 저장된 게스트 멤버 토큰 삭제
1020
- */
1021
- clearGuestMemberTokens(): void;
1022
- private executeGuestMemberLogin;
1023
- private isTokenExpired;
1024
- private getGuestMemberTokenKey;
1025
- private getStoredGuestMemberTokens;
1026
- private storeGuestMemberTokens;
1027
929
  }
1028
930
 
1029
931
  /**
@@ -9105,4 +9007,4 @@ declare class ConnectBase {
9105
9007
  updateConfig(config: Partial<ConnectBaseConfig>): void;
9106
9008
  }
9107
9009
 
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 };
9010
+ 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 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
@@ -32,7 +32,6 @@ __export(index_exports, {
32
32
  GameError: () => GameError,
33
33
  GameRoom: () => GameRoom,
34
34
  GameRoomTransport: () => GameRoomTransport,
35
- GuestSessionConflictError: () => GuestSessionConflictError,
36
35
  NativeAPI: () => NativeAPI,
37
36
  SessionManager: () => SessionManager,
38
37
  VideoProcessingError: () => VideoProcessingError,
@@ -60,15 +59,6 @@ var AuthError = class extends Error {
60
59
  this.name = "AuthError";
61
60
  }
62
61
  };
63
- var GuestSessionConflictError = class extends Error {
64
- constructor() {
65
- super(
66
- "signInAsGuestMember refused: an active non-guest session is present in this client. Pass { allowOverrideExistingSession: true } to explicitly replace it, or call signOut() first."
67
- );
68
- this.code = "GUEST_SESSION_CONFLICT";
69
- this.name = "GuestSessionConflictError";
70
- }
71
- };
72
62
  var GameError = class extends Error {
73
63
  constructor(init) {
74
64
  super(init.message || init.code || "GameError");
@@ -822,21 +812,9 @@ function assertShape(value, shape, endpoint) {
822
812
  }
823
813
 
824
814
  // src/api/auth.ts
825
- var GUEST_MEMBER_TOKEN_KEY_PREFIX = "cb_guest_";
826
- function credentialToStorageKeyHash(credential) {
827
- let hash = 0;
828
- for (let i = 0; i < credential.length; i++) {
829
- const char = credential.charCodeAt(i);
830
- hash = (hash << 5) - hash + char;
831
- hash = hash & hash;
832
- }
833
- return Math.abs(hash).toString(36);
834
- }
835
815
  var AuthAPI = class {
836
816
  constructor(http) {
837
817
  this.http = http;
838
- this.guestMemberLoginPromise = null;
839
- this.cachedGuestMemberTokenKey = null;
840
818
  this.analytics = null;
841
819
  }
842
820
  /**
@@ -870,9 +848,7 @@ var AuthAPI = class {
870
848
  * @example
871
849
  * ```typescript
872
850
  * const settings = await client.auth.getAuthSettings()
873
- * if (settings.allow_guest_login) {
874
- * await client.auth.signInAsGuestMember()
875
- * } else if (settings.allow_id_password_login) {
851
+ * if (settings.allow_id_password_login) {
876
852
  * // 로그인 폼 표시
877
853
  * } else if (settings.enabled_oauth_providers.includes('GOOGLE')) {
878
854
  * // 구글 소셜 로그인 버튼 표시
@@ -950,66 +926,6 @@ var AuthAPI = class {
950
926
  this.notifyVisitorTracker(response.member_id);
951
927
  return response;
952
928
  }
953
- /**
954
- * 앱 멤버 게스트 가입
955
- * API Key로 인증된 앱에 게스트 멤버로 가입합니다.
956
- * 실시간 채팅 등에서 JWT 토큰 기반 인증이 필요할 때 사용합니다.
957
- * 로컬 스토리지에 저장된 토큰이 있으면 기존 계정으로 재로그인을 시도합니다.
958
- * 동시 호출 시 중복 요청 방지 (race condition 방지)
959
- *
960
- * **활성 세션 가드 (3.22.0+)**
961
- * OAuth/email/username 로 이미 로그인된 세션이 살아있는 채 이 메서드가 호출되면
962
- * 메인 토큰 슬롯이 silent 로 게스트 토큰으로 덮어써져 사용자가 둔갑되는 회귀가
963
- * 있었다 (platform-issue 019e6c5d). 이를 막기 위해 활성 비-게스트 세션이 감지되면
964
- * 기본적으로 `GuestSessionConflictError` 를 던진다. 명시적으로 교체하려면
965
- * `{ allowOverrideExistingSession: true }` 를 전달하거나 먼저 `signOut()` 을 호출할 것.
966
- *
967
- * @example
968
- * ```typescript
969
- * const guest = await client.auth.signInAsGuestMember()
970
- * await client.realtime.connect({ accessToken: guest.access_token })
971
- *
972
- * // 활성 세션을 명시적으로 교체 (예: "게스트로 계속" 버튼)
973
- * await client.auth.signInAsGuestMember({ allowOverrideExistingSession: true })
974
- * ```
975
- */
976
- async signInAsGuestMember(opts) {
977
- if (this.guestMemberLoginPromise) {
978
- return this.guestMemberLoginPromise;
979
- }
980
- if (!opts?.allowOverrideExistingSession && this.hasActiveNonGuestSession()) {
981
- throw new GuestSessionConflictError();
982
- }
983
- this.guestMemberLoginPromise = this.executeGuestMemberLogin();
984
- try {
985
- return await this.guestMemberLoginPromise;
986
- } finally {
987
- this.guestMemberLoginPromise = null;
988
- }
989
- }
990
- /**
991
- * 현재 in-memory access token 이 "게스트 토큰이 아닌 다른 세션" 으로 판단되는지 확인.
992
- *
993
- * 판별 규칙:
994
- * - access token 자체가 없으면 false (어떤 세션도 없음)
995
- * - access token 이 만료됐으면 false (재로그인이 필요한 dead 상태)
996
- * - persistence='none' 인 경우: 토큰은 메모리에만 존재. 우리는 그 토큰이
997
- * 게스트인지 회원인지 분별할 메타가 메모리에 없다 → 보수적으로 true 처리.
998
- * (회원이 가지고 있던 세션을 게스트가 덮어쓰는 게 더 큰 사고이므로
999
- * false-positive < silent overwrite.)
1000
- * - persistence='localStorage'|'sessionStorage' 인 경우: 저장된 게스트 토큰과
1001
- * 현재 access token 이 일치하면 게스트 세션(false), 다르면 비-게스트(true).
1002
- */
1003
- hasActiveNonGuestSession() {
1004
- const access = this.http.getAccessToken();
1005
- if (!access) return false;
1006
- if (this.isTokenExpired(access)) return false;
1007
- const stored = this.getStoredGuestMemberTokens();
1008
- if (!stored) {
1009
- return true;
1010
- }
1011
- return stored.accessToken !== access;
1012
- }
1013
929
  /**
1014
930
  * 현재 로그인한 멤버 정보 조회
1015
931
  * custom_data를 포함한 멤버 정보를 반환합니다.
@@ -1106,124 +1022,6 @@ var AuthAPI = class {
1106
1022
  this.notifyVisitorTracker(null);
1107
1023
  }
1108
1024
  }
1109
- /**
1110
- * 저장된 게스트 멤버 토큰 삭제
1111
- */
1112
- clearGuestMemberTokens() {
1113
- const storage = this.http.getPersistenceStorage();
1114
- if (!storage) return;
1115
- storage.removeItem(this.getGuestMemberTokenKey());
1116
- }
1117
- // ===== Private Methods =====
1118
- async executeGuestMemberLogin() {
1119
- const storedData = this.getStoredGuestMemberTokens();
1120
- if (storedData) {
1121
- if (!this.isTokenExpired(storedData.accessToken)) {
1122
- try {
1123
- this.http.setTokens(storedData.accessToken, storedData.refreshToken);
1124
- const memberInfo = await this.http.get(
1125
- "/v1/public/app-members/me"
1126
- );
1127
- if (memberInfo.is_active) {
1128
- this.notifyVisitorTracker(memberInfo.member_id);
1129
- return {
1130
- member_id: memberInfo.member_id,
1131
- access_token: storedData.accessToken,
1132
- refresh_token: storedData.refreshToken
1133
- };
1134
- }
1135
- this.clearGuestMemberTokens();
1136
- } catch {
1137
- this.http.clearTokens();
1138
- }
1139
- }
1140
- if (storedData.refreshToken && !this.isTokenExpired(storedData.refreshToken)) {
1141
- try {
1142
- const refreshed = await this.http.post(
1143
- "/v1/auth/re-issue",
1144
- {},
1145
- { headers: { "Authorization": `Bearer ${storedData.refreshToken}` }, skipAuth: true }
1146
- );
1147
- assertShape(
1148
- refreshed,
1149
- {
1150
- access_token: { type: "string" },
1151
- refresh_token: { type: "string" }
1152
- },
1153
- "auth.signInAsGuestMember.reissue"
1154
- );
1155
- this.http.setTokens(refreshed.access_token, refreshed.refresh_token);
1156
- this.storeGuestMemberTokens(refreshed.access_token, refreshed.refresh_token, storedData.memberId);
1157
- this.notifyVisitorTracker(storedData.memberId);
1158
- return {
1159
- member_id: storedData.memberId,
1160
- access_token: refreshed.access_token,
1161
- refresh_token: refreshed.refresh_token
1162
- };
1163
- } catch {
1164
- this.clearGuestMemberTokens();
1165
- }
1166
- } else {
1167
- this.clearGuestMemberTokens();
1168
- }
1169
- }
1170
- const response = await this.http.post(
1171
- "/v1/public/app-members",
1172
- {},
1173
- { skipAuth: true }
1174
- );
1175
- assertShape(
1176
- response,
1177
- {
1178
- access_token: { type: "string" },
1179
- refresh_token: { type: "string" },
1180
- member_id: { type: "string-or-number" }
1181
- },
1182
- "auth.signInAsGuestMember.new"
1183
- );
1184
- this.http.setTokens(response.access_token, response.refresh_token);
1185
- this.storeGuestMemberTokens(response.access_token, response.refresh_token, response.member_id);
1186
- this.notifyVisitorTracker(response.member_id);
1187
- return response;
1188
- }
1189
- isTokenExpired(token) {
1190
- try {
1191
- const payload = JSON.parse(atob(token.split(".")[1]));
1192
- const currentTime = Date.now() / 1e3;
1193
- return payload.exp < currentTime;
1194
- } catch {
1195
- return true;
1196
- }
1197
- }
1198
- getGuestMemberTokenKey() {
1199
- if (this.cachedGuestMemberTokenKey) {
1200
- return this.cachedGuestMemberTokenKey;
1201
- }
1202
- const credential = this.http.getCredential();
1203
- if (!credential) {
1204
- this.cachedGuestMemberTokenKey = `${GUEST_MEMBER_TOKEN_KEY_PREFIX}default`;
1205
- } else {
1206
- const keyHash = credentialToStorageKeyHash(credential);
1207
- this.cachedGuestMemberTokenKey = `${GUEST_MEMBER_TOKEN_KEY_PREFIX}${keyHash}`;
1208
- }
1209
- return this.cachedGuestMemberTokenKey;
1210
- }
1211
- getStoredGuestMemberTokens() {
1212
- const storage = this.http.getPersistenceStorage();
1213
- if (!storage) return null;
1214
- const stored = storage.getItem(this.getGuestMemberTokenKey());
1215
- if (!stored) return null;
1216
- try {
1217
- return JSON.parse(stored);
1218
- } catch {
1219
- return null;
1220
- }
1221
- }
1222
- storeGuestMemberTokens(accessToken, refreshToken, memberId) {
1223
- const storage = this.http.getPersistenceStorage();
1224
- if (!storage) return;
1225
- storage.setItem(this.getGuestMemberTokenKey(), JSON.stringify({ accessToken, refreshToken, memberId }));
1226
- }
1227
1025
  };
1228
1026
 
1229
1027
  // src/api/database.ts
@@ -11387,7 +11185,6 @@ var index_default = ConnectBase;
11387
11185
  GameError,
11388
11186
  GameRoom,
11389
11187
  GameRoomTransport,
11390
- GuestSessionConflictError,
11391
11188
  NativeAPI,
11392
11189
  SessionManager,
11393
11190
  VideoProcessingError,