connectbase-client 3.25.1 → 3.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/dist/connect-base.umd.js +4 -4
- package/dist/index.d.mts +105 -3
- package/dist/index.d.ts +105 -3
- package/dist/index.js +50 -2
- package/dist/index.mjs +49 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -12,6 +12,30 @@ 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
|
+
}
|
|
15
39
|
/**
|
|
16
40
|
* GameError 는 game-server 가 surface 한 `error` 메시지 (createRoom/joinRoom/sendAction
|
|
17
41
|
* 응답 또는 broadcastScriptError) 를 client 측에서 일관된 형태로 다루기 위한 예외 클래스.
|
|
@@ -762,6 +786,20 @@ interface MemberInfoResponse {
|
|
|
762
786
|
email?: string;
|
|
763
787
|
/** 멤버 역할 — RLS 규칙에서 `auth.role` 로 참조 (예: "admin", "moderator") */
|
|
764
788
|
role?: string;
|
|
789
|
+
/**
|
|
790
|
+
* 현재 세션이 게스트(자동 생성된 익명 멤버)인지 여부.
|
|
791
|
+
* `cb.auth.signInAsGuestMember()` 로 만들어진 멤버 또는 identity 가 전혀 없는
|
|
792
|
+
* 멤버는 true. 게스트 둔갑(silent overwrite) 감지/복구용 결정적 신호다.
|
|
793
|
+
*/
|
|
794
|
+
is_guest?: boolean;
|
|
795
|
+
/**
|
|
796
|
+
* 현재 세션의 인증 방식 식별자.
|
|
797
|
+
* "guest" | "email" | "username" | "oauth_google" | "oauth_kakao" |
|
|
798
|
+
* "oauth_naver" | "oauth_apple" | "oauth_github" | "oauth_discord"
|
|
799
|
+
* OAuth 외 미래 provider 가 추가되면 동일한 `oauth_<provider>` 컨벤션을 따른다.
|
|
800
|
+
* identity 가 전혀 없는 경우 빈 문자열.
|
|
801
|
+
*/
|
|
802
|
+
auth_provider?: string;
|
|
765
803
|
}
|
|
766
804
|
/** 앱 멤버 custom_data 수정 요청 */
|
|
767
805
|
interface UpdateCustomDataRequest {
|
|
@@ -782,6 +820,20 @@ interface AuthSettingsResponse {
|
|
|
782
820
|
enabled_oauth_providers: string[];
|
|
783
821
|
}
|
|
784
822
|
|
|
823
|
+
/**
|
|
824
|
+
* `signInAsGuestMember()` 의 동작을 제어하는 옵션.
|
|
825
|
+
*
|
|
826
|
+
* `allowOverrideExistingSession` 가 false(또는 미지정) 이고 활성 비-게스트 세션이
|
|
827
|
+
* 감지되면 `GuestSessionConflictError` 가 발생한다. true 로 명시해야만 silent
|
|
828
|
+
* overwrite 가 허용된다 (platform-issue 019e6c5d 가드).
|
|
829
|
+
*/
|
|
830
|
+
interface SignInAsGuestMemberOptions {
|
|
831
|
+
/**
|
|
832
|
+
* 이미 활성화된 비-게스트(OAuth/email/username) 세션이 있어도 게스트 토큰으로
|
|
833
|
+
* 덮어쓸지 여부. 기본값 false — 호출이 거부된다.
|
|
834
|
+
*/
|
|
835
|
+
allowOverrideExistingSession?: boolean;
|
|
836
|
+
}
|
|
785
837
|
declare class AuthAPI {
|
|
786
838
|
private http;
|
|
787
839
|
private guestMemberLoginPromise;
|
|
@@ -847,13 +899,37 @@ declare class AuthAPI {
|
|
|
847
899
|
* 로컬 스토리지에 저장된 토큰이 있으면 기존 계정으로 재로그인을 시도합니다.
|
|
848
900
|
* 동시 호출 시 중복 요청 방지 (race condition 방지)
|
|
849
901
|
*
|
|
902
|
+
* **활성 세션 가드 (3.22.0+)**
|
|
903
|
+
* OAuth/email/username 로 이미 로그인된 세션이 살아있는 채 이 메서드가 호출되면
|
|
904
|
+
* 메인 토큰 슬롯이 silent 로 게스트 토큰으로 덮어써져 사용자가 둔갑되는 회귀가
|
|
905
|
+
* 있었다 (platform-issue 019e6c5d). 이를 막기 위해 활성 비-게스트 세션이 감지되면
|
|
906
|
+
* 기본적으로 `GuestSessionConflictError` 를 던진다. 명시적으로 교체하려면
|
|
907
|
+
* `{ allowOverrideExistingSession: true }` 를 전달하거나 먼저 `signOut()` 을 호출할 것.
|
|
908
|
+
*
|
|
850
909
|
* @example
|
|
851
910
|
* ```typescript
|
|
852
911
|
* const guest = await client.auth.signInAsGuestMember()
|
|
853
912
|
* await client.realtime.connect({ accessToken: guest.access_token })
|
|
913
|
+
*
|
|
914
|
+
* // 활성 세션을 명시적으로 교체 (예: "게스트로 계속" 버튼)
|
|
915
|
+
* await client.auth.signInAsGuestMember({ allowOverrideExistingSession: true })
|
|
854
916
|
* ```
|
|
855
917
|
*/
|
|
856
|
-
signInAsGuestMember(): Promise<GuestMemberSignInResponse>;
|
|
918
|
+
signInAsGuestMember(opts?: SignInAsGuestMemberOptions): Promise<GuestMemberSignInResponse>;
|
|
919
|
+
/**
|
|
920
|
+
* 현재 in-memory access token 이 "게스트 토큰이 아닌 다른 세션" 으로 판단되는지 확인.
|
|
921
|
+
*
|
|
922
|
+
* 판별 규칙:
|
|
923
|
+
* - access token 자체가 없으면 false (어떤 세션도 없음)
|
|
924
|
+
* - access token 이 만료됐으면 false (재로그인이 필요한 dead 상태)
|
|
925
|
+
* - persistence='none' 인 경우: 토큰은 메모리에만 존재. 우리는 그 토큰이
|
|
926
|
+
* 게스트인지 회원인지 분별할 메타가 메모리에 없다 → 보수적으로 true 처리.
|
|
927
|
+
* (회원이 가지고 있던 세션을 게스트가 덮어쓰는 게 더 큰 사고이므로
|
|
928
|
+
* false-positive < silent overwrite.)
|
|
929
|
+
* - persistence='localStorage'|'sessionStorage' 인 경우: 저장된 게스트 토큰과
|
|
930
|
+
* 현재 access token 이 일치하면 게스트 세션(false), 다르면 비-게스트(true).
|
|
931
|
+
*/
|
|
932
|
+
private hasActiveNonGuestSession;
|
|
857
933
|
/**
|
|
858
934
|
* 현재 로그인한 멤버 정보 조회
|
|
859
935
|
* custom_data를 포함한 멤버 정보를 반환합니다.
|
|
@@ -7519,11 +7595,37 @@ interface AIStreamChunk {
|
|
|
7519
7595
|
* })
|
|
7520
7596
|
* ```
|
|
7521
7597
|
*/
|
|
7598
|
+
/**
|
|
7599
|
+
* # 🔒 보안 — LLM API key 는 절대 클라이언트에 hardcode 금지
|
|
7600
|
+
*
|
|
7601
|
+
* 본 SDK 의 `chat` / `chatStream` 은 **ConnectBase 서버 프록시 경유** — provider (OpenAI/Claude/
|
|
7602
|
+
* Gemini/Ollama/vLLM/...) API key 는 `AppAIConfig` 에 암호화 저장된 상태로 ConnectBase 가 server-side
|
|
7603
|
+
* 에서만 복호화하여 사용합니다. 클라이언트는 user public key (또는 secret key) 만 알면 됩니다.
|
|
7604
|
+
*
|
|
7605
|
+
* **❌ 안티 패턴 — 즉시 다른 운영자에게 cross_app_issue 로 알려지고 차단됨**:
|
|
7606
|
+
* ```ts
|
|
7607
|
+
* // 브라우저 정적 자산에 raw provider URL + key — 절대 금지
|
|
7608
|
+
* fetch("https://api.openai.com/v1/chat/completions", {
|
|
7609
|
+
* headers: { Authorization: "Bearer sk-..." }
|
|
7610
|
+
* })
|
|
7611
|
+
* // 또는
|
|
7612
|
+
* fetch("https://tunnel.connectbase.world/<id>/v1/chat/completions", {
|
|
7613
|
+
* headers: { Authorization: "Bearer <vLLM key>" }
|
|
7614
|
+
* })
|
|
7615
|
+
* ```
|
|
7616
|
+
* DevTools → Network 한 번이면 누구나 key 추출 → 추론 비용 폭주 / GPU 자원 고갈.
|
|
7617
|
+
*
|
|
7618
|
+
* **✅ 베스트프랙티스 — 본 SDK 호출만 사용**:
|
|
7619
|
+
* ```ts
|
|
7620
|
+
* await cb.ai.chatStream({ messages: [...], provider: "openai_compatible" }, callbacks)
|
|
7621
|
+
* ```
|
|
7622
|
+
*/
|
|
7522
7623
|
declare class AIAPI {
|
|
7523
7624
|
private http;
|
|
7524
7625
|
constructor(http: HttpClient);
|
|
7525
7626
|
/**
|
|
7526
|
-
* AI 채팅 (동기)
|
|
7627
|
+
* AI 채팅 (동기). ConnectBase 서버 프록시 경유 — provider API key 는 server-side `AppAIConfig`
|
|
7628
|
+
* 에서만 사용되어 클라이언트에 노출되지 않습니다. raw provider URL 직접 호출 금지 (안티 패턴).
|
|
7527
7629
|
*/
|
|
7528
7630
|
chat(request: AIChatRequest): Promise<AIChatResponse>;
|
|
7529
7631
|
/**
|
|
@@ -8674,4 +8776,4 @@ declare class ConnectBase {
|
|
|
8674
8776
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
8675
8777
|
}
|
|
8676
8778
|
|
|
8677
|
-
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStaleMessage, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
|
|
8779
|
+
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, GuestSessionConflictError, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStaleMessage, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,30 @@ 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
|
+
}
|
|
15
39
|
/**
|
|
16
40
|
* GameError 는 game-server 가 surface 한 `error` 메시지 (createRoom/joinRoom/sendAction
|
|
17
41
|
* 응답 또는 broadcastScriptError) 를 client 측에서 일관된 형태로 다루기 위한 예외 클래스.
|
|
@@ -762,6 +786,20 @@ interface MemberInfoResponse {
|
|
|
762
786
|
email?: string;
|
|
763
787
|
/** 멤버 역할 — RLS 규칙에서 `auth.role` 로 참조 (예: "admin", "moderator") */
|
|
764
788
|
role?: string;
|
|
789
|
+
/**
|
|
790
|
+
* 현재 세션이 게스트(자동 생성된 익명 멤버)인지 여부.
|
|
791
|
+
* `cb.auth.signInAsGuestMember()` 로 만들어진 멤버 또는 identity 가 전혀 없는
|
|
792
|
+
* 멤버는 true. 게스트 둔갑(silent overwrite) 감지/복구용 결정적 신호다.
|
|
793
|
+
*/
|
|
794
|
+
is_guest?: boolean;
|
|
795
|
+
/**
|
|
796
|
+
* 현재 세션의 인증 방식 식별자.
|
|
797
|
+
* "guest" | "email" | "username" | "oauth_google" | "oauth_kakao" |
|
|
798
|
+
* "oauth_naver" | "oauth_apple" | "oauth_github" | "oauth_discord"
|
|
799
|
+
* OAuth 외 미래 provider 가 추가되면 동일한 `oauth_<provider>` 컨벤션을 따른다.
|
|
800
|
+
* identity 가 전혀 없는 경우 빈 문자열.
|
|
801
|
+
*/
|
|
802
|
+
auth_provider?: string;
|
|
765
803
|
}
|
|
766
804
|
/** 앱 멤버 custom_data 수정 요청 */
|
|
767
805
|
interface UpdateCustomDataRequest {
|
|
@@ -782,6 +820,20 @@ interface AuthSettingsResponse {
|
|
|
782
820
|
enabled_oauth_providers: string[];
|
|
783
821
|
}
|
|
784
822
|
|
|
823
|
+
/**
|
|
824
|
+
* `signInAsGuestMember()` 의 동작을 제어하는 옵션.
|
|
825
|
+
*
|
|
826
|
+
* `allowOverrideExistingSession` 가 false(또는 미지정) 이고 활성 비-게스트 세션이
|
|
827
|
+
* 감지되면 `GuestSessionConflictError` 가 발생한다. true 로 명시해야만 silent
|
|
828
|
+
* overwrite 가 허용된다 (platform-issue 019e6c5d 가드).
|
|
829
|
+
*/
|
|
830
|
+
interface SignInAsGuestMemberOptions {
|
|
831
|
+
/**
|
|
832
|
+
* 이미 활성화된 비-게스트(OAuth/email/username) 세션이 있어도 게스트 토큰으로
|
|
833
|
+
* 덮어쓸지 여부. 기본값 false — 호출이 거부된다.
|
|
834
|
+
*/
|
|
835
|
+
allowOverrideExistingSession?: boolean;
|
|
836
|
+
}
|
|
785
837
|
declare class AuthAPI {
|
|
786
838
|
private http;
|
|
787
839
|
private guestMemberLoginPromise;
|
|
@@ -847,13 +899,37 @@ declare class AuthAPI {
|
|
|
847
899
|
* 로컬 스토리지에 저장된 토큰이 있으면 기존 계정으로 재로그인을 시도합니다.
|
|
848
900
|
* 동시 호출 시 중복 요청 방지 (race condition 방지)
|
|
849
901
|
*
|
|
902
|
+
* **활성 세션 가드 (3.22.0+)**
|
|
903
|
+
* OAuth/email/username 로 이미 로그인된 세션이 살아있는 채 이 메서드가 호출되면
|
|
904
|
+
* 메인 토큰 슬롯이 silent 로 게스트 토큰으로 덮어써져 사용자가 둔갑되는 회귀가
|
|
905
|
+
* 있었다 (platform-issue 019e6c5d). 이를 막기 위해 활성 비-게스트 세션이 감지되면
|
|
906
|
+
* 기본적으로 `GuestSessionConflictError` 를 던진다. 명시적으로 교체하려면
|
|
907
|
+
* `{ allowOverrideExistingSession: true }` 를 전달하거나 먼저 `signOut()` 을 호출할 것.
|
|
908
|
+
*
|
|
850
909
|
* @example
|
|
851
910
|
* ```typescript
|
|
852
911
|
* const guest = await client.auth.signInAsGuestMember()
|
|
853
912
|
* await client.realtime.connect({ accessToken: guest.access_token })
|
|
913
|
+
*
|
|
914
|
+
* // 활성 세션을 명시적으로 교체 (예: "게스트로 계속" 버튼)
|
|
915
|
+
* await client.auth.signInAsGuestMember({ allowOverrideExistingSession: true })
|
|
854
916
|
* ```
|
|
855
917
|
*/
|
|
856
|
-
signInAsGuestMember(): Promise<GuestMemberSignInResponse>;
|
|
918
|
+
signInAsGuestMember(opts?: SignInAsGuestMemberOptions): Promise<GuestMemberSignInResponse>;
|
|
919
|
+
/**
|
|
920
|
+
* 현재 in-memory access token 이 "게스트 토큰이 아닌 다른 세션" 으로 판단되는지 확인.
|
|
921
|
+
*
|
|
922
|
+
* 판별 규칙:
|
|
923
|
+
* - access token 자체가 없으면 false (어떤 세션도 없음)
|
|
924
|
+
* - access token 이 만료됐으면 false (재로그인이 필요한 dead 상태)
|
|
925
|
+
* - persistence='none' 인 경우: 토큰은 메모리에만 존재. 우리는 그 토큰이
|
|
926
|
+
* 게스트인지 회원인지 분별할 메타가 메모리에 없다 → 보수적으로 true 처리.
|
|
927
|
+
* (회원이 가지고 있던 세션을 게스트가 덮어쓰는 게 더 큰 사고이므로
|
|
928
|
+
* false-positive < silent overwrite.)
|
|
929
|
+
* - persistence='localStorage'|'sessionStorage' 인 경우: 저장된 게스트 토큰과
|
|
930
|
+
* 현재 access token 이 일치하면 게스트 세션(false), 다르면 비-게스트(true).
|
|
931
|
+
*/
|
|
932
|
+
private hasActiveNonGuestSession;
|
|
857
933
|
/**
|
|
858
934
|
* 현재 로그인한 멤버 정보 조회
|
|
859
935
|
* custom_data를 포함한 멤버 정보를 반환합니다.
|
|
@@ -7519,11 +7595,37 @@ interface AIStreamChunk {
|
|
|
7519
7595
|
* })
|
|
7520
7596
|
* ```
|
|
7521
7597
|
*/
|
|
7598
|
+
/**
|
|
7599
|
+
* # 🔒 보안 — LLM API key 는 절대 클라이언트에 hardcode 금지
|
|
7600
|
+
*
|
|
7601
|
+
* 본 SDK 의 `chat` / `chatStream` 은 **ConnectBase 서버 프록시 경유** — provider (OpenAI/Claude/
|
|
7602
|
+
* Gemini/Ollama/vLLM/...) API key 는 `AppAIConfig` 에 암호화 저장된 상태로 ConnectBase 가 server-side
|
|
7603
|
+
* 에서만 복호화하여 사용합니다. 클라이언트는 user public key (또는 secret key) 만 알면 됩니다.
|
|
7604
|
+
*
|
|
7605
|
+
* **❌ 안티 패턴 — 즉시 다른 운영자에게 cross_app_issue 로 알려지고 차단됨**:
|
|
7606
|
+
* ```ts
|
|
7607
|
+
* // 브라우저 정적 자산에 raw provider URL + key — 절대 금지
|
|
7608
|
+
* fetch("https://api.openai.com/v1/chat/completions", {
|
|
7609
|
+
* headers: { Authorization: "Bearer sk-..." }
|
|
7610
|
+
* })
|
|
7611
|
+
* // 또는
|
|
7612
|
+
* fetch("https://tunnel.connectbase.world/<id>/v1/chat/completions", {
|
|
7613
|
+
* headers: { Authorization: "Bearer <vLLM key>" }
|
|
7614
|
+
* })
|
|
7615
|
+
* ```
|
|
7616
|
+
* DevTools → Network 한 번이면 누구나 key 추출 → 추론 비용 폭주 / GPU 자원 고갈.
|
|
7617
|
+
*
|
|
7618
|
+
* **✅ 베스트프랙티스 — 본 SDK 호출만 사용**:
|
|
7619
|
+
* ```ts
|
|
7620
|
+
* await cb.ai.chatStream({ messages: [...], provider: "openai_compatible" }, callbacks)
|
|
7621
|
+
* ```
|
|
7622
|
+
*/
|
|
7522
7623
|
declare class AIAPI {
|
|
7523
7624
|
private http;
|
|
7524
7625
|
constructor(http: HttpClient);
|
|
7525
7626
|
/**
|
|
7526
|
-
* AI 채팅 (동기)
|
|
7627
|
+
* AI 채팅 (동기). ConnectBase 서버 프록시 경유 — provider API key 는 server-side `AppAIConfig`
|
|
7628
|
+
* 에서만 사용되어 클라이언트에 노출되지 않습니다. raw provider URL 직접 호출 금지 (안티 패턴).
|
|
7527
7629
|
*/
|
|
7528
7630
|
chat(request: AIChatRequest): Promise<AIChatResponse>;
|
|
7529
7631
|
/**
|
|
@@ -8674,4 +8776,4 @@ declare class ConnectBase {
|
|
|
8674
8776
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
8675
8777
|
}
|
|
8676
8778
|
|
|
8677
|
-
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStaleMessage, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
|
|
8779
|
+
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, GuestSessionConflictError, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStaleMessage, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ __export(index_exports, {
|
|
|
32
32
|
GameError: () => GameError,
|
|
33
33
|
GameRoom: () => GameRoom,
|
|
34
34
|
GameRoomTransport: () => GameRoomTransport,
|
|
35
|
+
GuestSessionConflictError: () => GuestSessionConflictError,
|
|
35
36
|
NativeAPI: () => NativeAPI,
|
|
36
37
|
SessionManager: () => SessionManager,
|
|
37
38
|
VideoProcessingError: () => VideoProcessingError,
|
|
@@ -59,6 +60,15 @@ var AuthError = class extends Error {
|
|
|
59
60
|
this.name = "AuthError";
|
|
60
61
|
}
|
|
61
62
|
};
|
|
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
|
+
};
|
|
62
72
|
var GameError = class extends Error {
|
|
63
73
|
constructor(init) {
|
|
64
74
|
super(init.message || init.code || "GameError");
|
|
@@ -912,16 +922,29 @@ var AuthAPI = class {
|
|
|
912
922
|
* 로컬 스토리지에 저장된 토큰이 있으면 기존 계정으로 재로그인을 시도합니다.
|
|
913
923
|
* 동시 호출 시 중복 요청 방지 (race condition 방지)
|
|
914
924
|
*
|
|
925
|
+
* **활성 세션 가드 (3.22.0+)**
|
|
926
|
+
* OAuth/email/username 로 이미 로그인된 세션이 살아있는 채 이 메서드가 호출되면
|
|
927
|
+
* 메인 토큰 슬롯이 silent 로 게스트 토큰으로 덮어써져 사용자가 둔갑되는 회귀가
|
|
928
|
+
* 있었다 (platform-issue 019e6c5d). 이를 막기 위해 활성 비-게스트 세션이 감지되면
|
|
929
|
+
* 기본적으로 `GuestSessionConflictError` 를 던진다. 명시적으로 교체하려면
|
|
930
|
+
* `{ allowOverrideExistingSession: true }` 를 전달하거나 먼저 `signOut()` 을 호출할 것.
|
|
931
|
+
*
|
|
915
932
|
* @example
|
|
916
933
|
* ```typescript
|
|
917
934
|
* const guest = await client.auth.signInAsGuestMember()
|
|
918
935
|
* await client.realtime.connect({ accessToken: guest.access_token })
|
|
936
|
+
*
|
|
937
|
+
* // 활성 세션을 명시적으로 교체 (예: "게스트로 계속" 버튼)
|
|
938
|
+
* await client.auth.signInAsGuestMember({ allowOverrideExistingSession: true })
|
|
919
939
|
* ```
|
|
920
940
|
*/
|
|
921
|
-
async signInAsGuestMember() {
|
|
941
|
+
async signInAsGuestMember(opts) {
|
|
922
942
|
if (this.guestMemberLoginPromise) {
|
|
923
943
|
return this.guestMemberLoginPromise;
|
|
924
944
|
}
|
|
945
|
+
if (!opts?.allowOverrideExistingSession && this.hasActiveNonGuestSession()) {
|
|
946
|
+
throw new GuestSessionConflictError();
|
|
947
|
+
}
|
|
925
948
|
this.guestMemberLoginPromise = this.executeGuestMemberLogin();
|
|
926
949
|
try {
|
|
927
950
|
return await this.guestMemberLoginPromise;
|
|
@@ -929,6 +952,29 @@ var AuthAPI = class {
|
|
|
929
952
|
this.guestMemberLoginPromise = null;
|
|
930
953
|
}
|
|
931
954
|
}
|
|
955
|
+
/**
|
|
956
|
+
* 현재 in-memory access token 이 "게스트 토큰이 아닌 다른 세션" 으로 판단되는지 확인.
|
|
957
|
+
*
|
|
958
|
+
* 판별 규칙:
|
|
959
|
+
* - access token 자체가 없으면 false (어떤 세션도 없음)
|
|
960
|
+
* - access token 이 만료됐으면 false (재로그인이 필요한 dead 상태)
|
|
961
|
+
* - persistence='none' 인 경우: 토큰은 메모리에만 존재. 우리는 그 토큰이
|
|
962
|
+
* 게스트인지 회원인지 분별할 메타가 메모리에 없다 → 보수적으로 true 처리.
|
|
963
|
+
* (회원이 가지고 있던 세션을 게스트가 덮어쓰는 게 더 큰 사고이므로
|
|
964
|
+
* false-positive < silent overwrite.)
|
|
965
|
+
* - persistence='localStorage'|'sessionStorage' 인 경우: 저장된 게스트 토큰과
|
|
966
|
+
* 현재 access token 이 일치하면 게스트 세션(false), 다르면 비-게스트(true).
|
|
967
|
+
*/
|
|
968
|
+
hasActiveNonGuestSession() {
|
|
969
|
+
const access = this.http.getAccessToken();
|
|
970
|
+
if (!access) return false;
|
|
971
|
+
if (this.isTokenExpired(access)) return false;
|
|
972
|
+
const stored = this.getStoredGuestMemberTokens();
|
|
973
|
+
if (!stored) {
|
|
974
|
+
return true;
|
|
975
|
+
}
|
|
976
|
+
return stored.accessToken !== access;
|
|
977
|
+
}
|
|
932
978
|
/**
|
|
933
979
|
* 현재 로그인한 멤버 정보 조회
|
|
934
980
|
* custom_data를 포함한 멤버 정보를 반환합니다.
|
|
@@ -8487,7 +8533,8 @@ var AIAPI = class {
|
|
|
8487
8533
|
this.http = http;
|
|
8488
8534
|
}
|
|
8489
8535
|
/**
|
|
8490
|
-
* AI 채팅 (동기)
|
|
8536
|
+
* AI 채팅 (동기). ConnectBase 서버 프록시 경유 — provider API key 는 server-side `AppAIConfig`
|
|
8537
|
+
* 에서만 사용되어 클라이언트에 노출되지 않습니다. raw provider URL 직접 호출 금지 (안티 패턴).
|
|
8491
8538
|
*/
|
|
8492
8539
|
async chat(request) {
|
|
8493
8540
|
return this.http.post("/v1/public/ai/chat", request);
|
|
@@ -10824,6 +10871,7 @@ var index_default = ConnectBase;
|
|
|
10824
10871
|
GameError,
|
|
10825
10872
|
GameRoom,
|
|
10826
10873
|
GameRoomTransport,
|
|
10874
|
+
GuestSessionConflictError,
|
|
10827
10875
|
NativeAPI,
|
|
10828
10876
|
SessionManager,
|
|
10829
10877
|
VideoProcessingError,
|
package/dist/index.mjs
CHANGED
|
@@ -14,6 +14,15 @@ var AuthError = class extends Error {
|
|
|
14
14
|
this.name = "AuthError";
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
+
var GuestSessionConflictError = class extends Error {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(
|
|
20
|
+
"signInAsGuestMember refused: an active non-guest session is present in this client. Pass { allowOverrideExistingSession: true } to explicitly replace it, or call signOut() first."
|
|
21
|
+
);
|
|
22
|
+
this.code = "GUEST_SESSION_CONFLICT";
|
|
23
|
+
this.name = "GuestSessionConflictError";
|
|
24
|
+
}
|
|
25
|
+
};
|
|
17
26
|
var GameError = class extends Error {
|
|
18
27
|
constructor(init) {
|
|
19
28
|
super(init.message || init.code || "GameError");
|
|
@@ -867,16 +876,29 @@ var AuthAPI = class {
|
|
|
867
876
|
* 로컬 스토리지에 저장된 토큰이 있으면 기존 계정으로 재로그인을 시도합니다.
|
|
868
877
|
* 동시 호출 시 중복 요청 방지 (race condition 방지)
|
|
869
878
|
*
|
|
879
|
+
* **활성 세션 가드 (3.22.0+)**
|
|
880
|
+
* OAuth/email/username 로 이미 로그인된 세션이 살아있는 채 이 메서드가 호출되면
|
|
881
|
+
* 메인 토큰 슬롯이 silent 로 게스트 토큰으로 덮어써져 사용자가 둔갑되는 회귀가
|
|
882
|
+
* 있었다 (platform-issue 019e6c5d). 이를 막기 위해 활성 비-게스트 세션이 감지되면
|
|
883
|
+
* 기본적으로 `GuestSessionConflictError` 를 던진다. 명시적으로 교체하려면
|
|
884
|
+
* `{ allowOverrideExistingSession: true }` 를 전달하거나 먼저 `signOut()` 을 호출할 것.
|
|
885
|
+
*
|
|
870
886
|
* @example
|
|
871
887
|
* ```typescript
|
|
872
888
|
* const guest = await client.auth.signInAsGuestMember()
|
|
873
889
|
* await client.realtime.connect({ accessToken: guest.access_token })
|
|
890
|
+
*
|
|
891
|
+
* // 활성 세션을 명시적으로 교체 (예: "게스트로 계속" 버튼)
|
|
892
|
+
* await client.auth.signInAsGuestMember({ allowOverrideExistingSession: true })
|
|
874
893
|
* ```
|
|
875
894
|
*/
|
|
876
|
-
async signInAsGuestMember() {
|
|
895
|
+
async signInAsGuestMember(opts) {
|
|
877
896
|
if (this.guestMemberLoginPromise) {
|
|
878
897
|
return this.guestMemberLoginPromise;
|
|
879
898
|
}
|
|
899
|
+
if (!opts?.allowOverrideExistingSession && this.hasActiveNonGuestSession()) {
|
|
900
|
+
throw new GuestSessionConflictError();
|
|
901
|
+
}
|
|
880
902
|
this.guestMemberLoginPromise = this.executeGuestMemberLogin();
|
|
881
903
|
try {
|
|
882
904
|
return await this.guestMemberLoginPromise;
|
|
@@ -884,6 +906,29 @@ var AuthAPI = class {
|
|
|
884
906
|
this.guestMemberLoginPromise = null;
|
|
885
907
|
}
|
|
886
908
|
}
|
|
909
|
+
/**
|
|
910
|
+
* 현재 in-memory access token 이 "게스트 토큰이 아닌 다른 세션" 으로 판단되는지 확인.
|
|
911
|
+
*
|
|
912
|
+
* 판별 규칙:
|
|
913
|
+
* - access token 자체가 없으면 false (어떤 세션도 없음)
|
|
914
|
+
* - access token 이 만료됐으면 false (재로그인이 필요한 dead 상태)
|
|
915
|
+
* - persistence='none' 인 경우: 토큰은 메모리에만 존재. 우리는 그 토큰이
|
|
916
|
+
* 게스트인지 회원인지 분별할 메타가 메모리에 없다 → 보수적으로 true 처리.
|
|
917
|
+
* (회원이 가지고 있던 세션을 게스트가 덮어쓰는 게 더 큰 사고이므로
|
|
918
|
+
* false-positive < silent overwrite.)
|
|
919
|
+
* - persistence='localStorage'|'sessionStorage' 인 경우: 저장된 게스트 토큰과
|
|
920
|
+
* 현재 access token 이 일치하면 게스트 세션(false), 다르면 비-게스트(true).
|
|
921
|
+
*/
|
|
922
|
+
hasActiveNonGuestSession() {
|
|
923
|
+
const access = this.http.getAccessToken();
|
|
924
|
+
if (!access) return false;
|
|
925
|
+
if (this.isTokenExpired(access)) return false;
|
|
926
|
+
const stored = this.getStoredGuestMemberTokens();
|
|
927
|
+
if (!stored) {
|
|
928
|
+
return true;
|
|
929
|
+
}
|
|
930
|
+
return stored.accessToken !== access;
|
|
931
|
+
}
|
|
887
932
|
/**
|
|
888
933
|
* 현재 로그인한 멤버 정보 조회
|
|
889
934
|
* custom_data를 포함한 멤버 정보를 반환합니다.
|
|
@@ -8442,7 +8487,8 @@ var AIAPI = class {
|
|
|
8442
8487
|
this.http = http;
|
|
8443
8488
|
}
|
|
8444
8489
|
/**
|
|
8445
|
-
* AI 채팅 (동기)
|
|
8490
|
+
* AI 채팅 (동기). ConnectBase 서버 프록시 경유 — provider API key 는 server-side `AppAIConfig`
|
|
8491
|
+
* 에서만 사용되어 클라이언트에 노출되지 않습니다. raw provider URL 직접 호출 금지 (안티 패턴).
|
|
8446
8492
|
*/
|
|
8447
8493
|
async chat(request) {
|
|
8448
8494
|
return this.http.post("/v1/public/ai/chat", request);
|
|
@@ -10778,6 +10824,7 @@ export {
|
|
|
10778
10824
|
GameError,
|
|
10779
10825
|
GameRoom,
|
|
10780
10826
|
GameRoomTransport,
|
|
10827
|
+
GuestSessionConflictError,
|
|
10781
10828
|
NativeAPI,
|
|
10782
10829
|
SessionManager,
|
|
10783
10830
|
VideoProcessingError,
|