connectbase-client 3.24.0 → 3.25.1
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 +27 -0
- package/dist/cli.js +59 -18
- package/dist/connect-base.umd.js +4 -4
- package/dist/index.d.mts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +102 -1
- package/dist/index.mjs +100 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3743,6 +3743,21 @@ interface OAuthCallbackResponse {
|
|
|
3743
3743
|
email?: string;
|
|
3744
3744
|
}
|
|
3745
3745
|
|
|
3746
|
+
/**
|
|
3747
|
+
* 3rd-party 인앱 브라우저(카카오톡, 라인, 인스타그램, 페이스북 등) 감지
|
|
3748
|
+
* 구글은 이런 환경에서 OAuth를 차단(disallowed_useragent)하므로 별도 처리 필요
|
|
3749
|
+
*/
|
|
3750
|
+
declare function detectInAppBrowser(): {
|
|
3751
|
+
type: 'kakaotalk' | 'line' | 'instagram' | 'facebook' | 'naverapp' | 'wechat' | 'other';
|
|
3752
|
+
ua: string;
|
|
3753
|
+
} | null;
|
|
3754
|
+
/**
|
|
3755
|
+
* 3rd-party 인앱 브라우저에서 현재 URL을 외부(시스템) 브라우저로 강제로 여는 방법 제공
|
|
3756
|
+
* - 카카오톡: kakaotalk://web/openExternal?url=...
|
|
3757
|
+
* - 라인: line://nv/openURL?url=...
|
|
3758
|
+
* - 그 외: 사용자에게 안내 메시지 표시 권장
|
|
3759
|
+
*/
|
|
3760
|
+
declare function escapeToExternalBrowser(currentUrl?: string): boolean;
|
|
3746
3761
|
/**
|
|
3747
3762
|
* OAuth API
|
|
3748
3763
|
* 소셜 로그인 (Google, Naver, GitHub, Discord)
|
|
@@ -8659,4 +8674,4 @@ declare class ConnectBase {
|
|
|
8659
8674
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
8660
8675
|
}
|
|
8661
8676
|
|
|
8662
|
-
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, isWebTransportSupported, toCreateRoomWire };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -3743,6 +3743,21 @@ interface OAuthCallbackResponse {
|
|
|
3743
3743
|
email?: string;
|
|
3744
3744
|
}
|
|
3745
3745
|
|
|
3746
|
+
/**
|
|
3747
|
+
* 3rd-party 인앱 브라우저(카카오톡, 라인, 인스타그램, 페이스북 등) 감지
|
|
3748
|
+
* 구글은 이런 환경에서 OAuth를 차단(disallowed_useragent)하므로 별도 처리 필요
|
|
3749
|
+
*/
|
|
3750
|
+
declare function detectInAppBrowser(): {
|
|
3751
|
+
type: 'kakaotalk' | 'line' | 'instagram' | 'facebook' | 'naverapp' | 'wechat' | 'other';
|
|
3752
|
+
ua: string;
|
|
3753
|
+
} | null;
|
|
3754
|
+
/**
|
|
3755
|
+
* 3rd-party 인앱 브라우저에서 현재 URL을 외부(시스템) 브라우저로 강제로 여는 방법 제공
|
|
3756
|
+
* - 카카오톡: kakaotalk://web/openExternal?url=...
|
|
3757
|
+
* - 라인: line://nv/openURL?url=...
|
|
3758
|
+
* - 그 외: 사용자에게 안내 메시지 표시 권장
|
|
3759
|
+
*/
|
|
3760
|
+
declare function escapeToExternalBrowser(currentUrl?: string): boolean;
|
|
3746
3761
|
/**
|
|
3747
3762
|
* OAuth API
|
|
3748
3763
|
* 소셜 로그인 (Google, Naver, GitHub, Discord)
|
|
@@ -8659,4 +8674,4 @@ declare class ConnectBase {
|
|
|
8659
8674
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
8660
8675
|
}
|
|
8661
8676
|
|
|
8662
|
-
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, isWebTransportSupported, toCreateRoomWire };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,8 @@ __export(index_exports, {
|
|
|
36
36
|
SessionManager: () => SessionManager,
|
|
37
37
|
VideoProcessingError: () => VideoProcessingError,
|
|
38
38
|
default: () => index_default,
|
|
39
|
+
detectInAppBrowser: () => detectInAppBrowser,
|
|
40
|
+
escapeToExternalBrowser: () => escapeToExternalBrowser,
|
|
39
41
|
isWebTransportSupported: () => isWebTransportSupported,
|
|
40
42
|
toCreateRoomWire: () => toCreateRoomWire
|
|
41
43
|
});
|
|
@@ -4714,6 +4716,42 @@ var ErrorTrackerAPI = class {
|
|
|
4714
4716
|
};
|
|
4715
4717
|
|
|
4716
4718
|
// src/api/oauth.ts
|
|
4719
|
+
function getNativeOAuthBridge() {
|
|
4720
|
+
if (typeof window === "undefined") return null;
|
|
4721
|
+
const bridge = window.NativeBridge?.oauth;
|
|
4722
|
+
if (!bridge || typeof bridge.signIn !== "function" || typeof bridge.getCallbackScheme !== "function") {
|
|
4723
|
+
return null;
|
|
4724
|
+
}
|
|
4725
|
+
return bridge;
|
|
4726
|
+
}
|
|
4727
|
+
function detectInAppBrowser() {
|
|
4728
|
+
if (typeof navigator === "undefined") return null;
|
|
4729
|
+
const ua = navigator.userAgent || "";
|
|
4730
|
+
if (/KAKAOTALK/i.test(ua)) return { type: "kakaotalk", ua };
|
|
4731
|
+
if (/Line\//i.test(ua)) return { type: "line", ua };
|
|
4732
|
+
if (/Instagram/i.test(ua)) return { type: "instagram", ua };
|
|
4733
|
+
if (/FBAN|FBAV|FB_IAB/i.test(ua)) return { type: "facebook", ua };
|
|
4734
|
+
if (/NAVER\(inapp/i.test(ua)) return { type: "naverapp", ua };
|
|
4735
|
+
if (/MicroMessenger/i.test(ua)) return { type: "wechat", ua };
|
|
4736
|
+
return null;
|
|
4737
|
+
}
|
|
4738
|
+
function escapeToExternalBrowser(currentUrl) {
|
|
4739
|
+
if (typeof window === "undefined") return false;
|
|
4740
|
+
const detected = detectInAppBrowser();
|
|
4741
|
+
if (!detected) return false;
|
|
4742
|
+
const target = currentUrl ?? window.location.href;
|
|
4743
|
+
const encoded = encodeURIComponent(target);
|
|
4744
|
+
switch (detected.type) {
|
|
4745
|
+
case "kakaotalk":
|
|
4746
|
+
window.location.href = `kakaotalk://web/openExternal?url=${encoded}`;
|
|
4747
|
+
return true;
|
|
4748
|
+
case "line":
|
|
4749
|
+
window.location.href = `line://nv/openURL?url=${encoded}`;
|
|
4750
|
+
return true;
|
|
4751
|
+
default:
|
|
4752
|
+
return false;
|
|
4753
|
+
}
|
|
4754
|
+
}
|
|
4717
4755
|
var OAuthAPI = class {
|
|
4718
4756
|
constructor(http) {
|
|
4719
4757
|
this.http = http;
|
|
@@ -4772,6 +4810,32 @@ var OAuthAPI = class {
|
|
|
4772
4810
|
return this.startCentralOAuth(provider, callbackUrl, state, "signup");
|
|
4773
4811
|
}
|
|
4774
4812
|
async startCentralOAuth(provider, callbackUrl, state, intent) {
|
|
4813
|
+
const bridge = getNativeOAuthBridge();
|
|
4814
|
+
if (bridge) {
|
|
4815
|
+
const callbackScheme = bridge.getCallbackScheme();
|
|
4816
|
+
const bridgeParams = new URLSearchParams({ app_callback: callbackScheme, intent });
|
|
4817
|
+
if (state) bridgeParams.append("state", state);
|
|
4818
|
+
const bridgeResp = await this.http.get(
|
|
4819
|
+
`/v1/public/oauth/${provider}/authorize/central?${bridgeParams.toString()}`
|
|
4820
|
+
);
|
|
4821
|
+
const { url: resultUrl } = await bridge.signIn(bridgeResp.authorization_url, callbackScheme);
|
|
4822
|
+
const parsed = new URL(resultUrl);
|
|
4823
|
+
const target = new URL(callbackUrl, window.location.href);
|
|
4824
|
+
parsed.searchParams.forEach((value, key) => {
|
|
4825
|
+
target.searchParams.set(key, value);
|
|
4826
|
+
});
|
|
4827
|
+
window.location.href = target.toString();
|
|
4828
|
+
return;
|
|
4829
|
+
}
|
|
4830
|
+
const inApp = detectInAppBrowser();
|
|
4831
|
+
if (inApp && (provider === "google" || provider === "apple")) {
|
|
4832
|
+
if (escapeToExternalBrowser()) {
|
|
4833
|
+
return;
|
|
4834
|
+
}
|
|
4835
|
+
throw new Error(
|
|
4836
|
+
`\uD604\uC7AC ${inApp.type === "kakaotalk" ? "\uCE74\uCE74\uC624\uD1A1" : inApp.type === "line" ? "\uB77C\uC778" : "\uC778\uC571"} \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C\uB294 Google/Apple \uB85C\uADF8\uC778\uC774 \uC81C\uD55C\uB429\uB2C8\uB2E4. \uC6B0\uCE21 \uC0C1\uB2E8 \uBA54\uB274\uC5D0\uC11C "\uB2E4\uB978 \uBE0C\uB77C\uC6B0\uC800\uB85C \uC5F4\uAE30"\uB97C \uC120\uD0DD\uD574\uC8FC\uC138\uC694.`
|
|
4837
|
+
);
|
|
4838
|
+
}
|
|
4775
4839
|
const params = new URLSearchParams({ app_callback: callbackUrl, intent });
|
|
4776
4840
|
if (state) {
|
|
4777
4841
|
params.append("state", state);
|
|
@@ -4806,8 +4870,43 @@ var OAuthAPI = class {
|
|
|
4806
4870
|
* ```
|
|
4807
4871
|
*/
|
|
4808
4872
|
async signInWithPopup(provider, callbackUrl, options = {}) {
|
|
4873
|
+
const intent = options.intent ?? "signin";
|
|
4874
|
+
const bridge = getNativeOAuthBridge();
|
|
4875
|
+
if (bridge) {
|
|
4876
|
+
const callbackScheme = bridge.getCallbackScheme();
|
|
4877
|
+
const bridgeParams = new URLSearchParams({ app_callback: callbackScheme, intent });
|
|
4878
|
+
const bridgeResp = await this.http.get(
|
|
4879
|
+
`/v1/public/oauth/${provider}/authorize/central?${bridgeParams.toString()}`
|
|
4880
|
+
);
|
|
4881
|
+
const { url: resultUrl } = await bridge.signIn(bridgeResp.authorization_url, callbackScheme);
|
|
4882
|
+
const parsed = new URL(resultUrl);
|
|
4883
|
+
const err = parsed.searchParams.get("error");
|
|
4884
|
+
if (err) throw new Error(err);
|
|
4885
|
+
const accessToken = parsed.searchParams.get("access_token") || "";
|
|
4886
|
+
const refreshToken = parsed.searchParams.get("refresh_token") || "";
|
|
4887
|
+
const memberId = parsed.searchParams.get("member_id") || "";
|
|
4888
|
+
if (!accessToken || !refreshToken || !memberId) {
|
|
4889
|
+
throw new Error("OAuth \uC751\uB2F5\uC5D0 \uD1A0\uD070\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
4890
|
+
}
|
|
4891
|
+
this.http.setTokens(accessToken, refreshToken);
|
|
4892
|
+
return {
|
|
4893
|
+
access_token: accessToken,
|
|
4894
|
+
refresh_token: refreshToken,
|
|
4895
|
+
member_id: memberId,
|
|
4896
|
+
is_new_member: parsed.searchParams.get("is_new_member") === "true"
|
|
4897
|
+
};
|
|
4898
|
+
}
|
|
4899
|
+
const inApp = detectInAppBrowser();
|
|
4900
|
+
if (inApp && (provider === "google" || provider === "apple")) {
|
|
4901
|
+
if (!escapeToExternalBrowser()) {
|
|
4902
|
+
throw new Error(
|
|
4903
|
+
`\uD604\uC7AC ${inApp.type === "kakaotalk" ? "\uCE74\uCE74\uC624\uD1A1" : inApp.type === "line" ? "\uB77C\uC778" : "\uC778\uC571"} \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C\uB294 Google/Apple \uB85C\uADF8\uC778\uC774 \uC81C\uD55C\uB429\uB2C8\uB2E4. \uC678\uBD80 \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C \uC5F4\uC5B4\uC8FC\uC138\uC694.`
|
|
4904
|
+
);
|
|
4905
|
+
}
|
|
4906
|
+
throw new Error("\uC678\uBD80 \uBE0C\uB77C\uC6B0\uC800\uB85C \uC774\uB3D9\uD588\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694.");
|
|
4907
|
+
}
|
|
4809
4908
|
const params = new URLSearchParams();
|
|
4810
|
-
params.set("intent",
|
|
4909
|
+
params.set("intent", intent);
|
|
4811
4910
|
if (callbackUrl) {
|
|
4812
4911
|
params.set("app_callback", callbackUrl);
|
|
4813
4912
|
}
|
|
@@ -10728,6 +10827,8 @@ var index_default = ConnectBase;
|
|
|
10728
10827
|
NativeAPI,
|
|
10729
10828
|
SessionManager,
|
|
10730
10829
|
VideoProcessingError,
|
|
10830
|
+
detectInAppBrowser,
|
|
10831
|
+
escapeToExternalBrowser,
|
|
10731
10832
|
isWebTransportSupported,
|
|
10732
10833
|
toCreateRoomWire
|
|
10733
10834
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -4671,6 +4671,42 @@ var ErrorTrackerAPI = class {
|
|
|
4671
4671
|
};
|
|
4672
4672
|
|
|
4673
4673
|
// src/api/oauth.ts
|
|
4674
|
+
function getNativeOAuthBridge() {
|
|
4675
|
+
if (typeof window === "undefined") return null;
|
|
4676
|
+
const bridge = window.NativeBridge?.oauth;
|
|
4677
|
+
if (!bridge || typeof bridge.signIn !== "function" || typeof bridge.getCallbackScheme !== "function") {
|
|
4678
|
+
return null;
|
|
4679
|
+
}
|
|
4680
|
+
return bridge;
|
|
4681
|
+
}
|
|
4682
|
+
function detectInAppBrowser() {
|
|
4683
|
+
if (typeof navigator === "undefined") return null;
|
|
4684
|
+
const ua = navigator.userAgent || "";
|
|
4685
|
+
if (/KAKAOTALK/i.test(ua)) return { type: "kakaotalk", ua };
|
|
4686
|
+
if (/Line\//i.test(ua)) return { type: "line", ua };
|
|
4687
|
+
if (/Instagram/i.test(ua)) return { type: "instagram", ua };
|
|
4688
|
+
if (/FBAN|FBAV|FB_IAB/i.test(ua)) return { type: "facebook", ua };
|
|
4689
|
+
if (/NAVER\(inapp/i.test(ua)) return { type: "naverapp", ua };
|
|
4690
|
+
if (/MicroMessenger/i.test(ua)) return { type: "wechat", ua };
|
|
4691
|
+
return null;
|
|
4692
|
+
}
|
|
4693
|
+
function escapeToExternalBrowser(currentUrl) {
|
|
4694
|
+
if (typeof window === "undefined") return false;
|
|
4695
|
+
const detected = detectInAppBrowser();
|
|
4696
|
+
if (!detected) return false;
|
|
4697
|
+
const target = currentUrl ?? window.location.href;
|
|
4698
|
+
const encoded = encodeURIComponent(target);
|
|
4699
|
+
switch (detected.type) {
|
|
4700
|
+
case "kakaotalk":
|
|
4701
|
+
window.location.href = `kakaotalk://web/openExternal?url=${encoded}`;
|
|
4702
|
+
return true;
|
|
4703
|
+
case "line":
|
|
4704
|
+
window.location.href = `line://nv/openURL?url=${encoded}`;
|
|
4705
|
+
return true;
|
|
4706
|
+
default:
|
|
4707
|
+
return false;
|
|
4708
|
+
}
|
|
4709
|
+
}
|
|
4674
4710
|
var OAuthAPI = class {
|
|
4675
4711
|
constructor(http) {
|
|
4676
4712
|
this.http = http;
|
|
@@ -4729,6 +4765,32 @@ var OAuthAPI = class {
|
|
|
4729
4765
|
return this.startCentralOAuth(provider, callbackUrl, state, "signup");
|
|
4730
4766
|
}
|
|
4731
4767
|
async startCentralOAuth(provider, callbackUrl, state, intent) {
|
|
4768
|
+
const bridge = getNativeOAuthBridge();
|
|
4769
|
+
if (bridge) {
|
|
4770
|
+
const callbackScheme = bridge.getCallbackScheme();
|
|
4771
|
+
const bridgeParams = new URLSearchParams({ app_callback: callbackScheme, intent });
|
|
4772
|
+
if (state) bridgeParams.append("state", state);
|
|
4773
|
+
const bridgeResp = await this.http.get(
|
|
4774
|
+
`/v1/public/oauth/${provider}/authorize/central?${bridgeParams.toString()}`
|
|
4775
|
+
);
|
|
4776
|
+
const { url: resultUrl } = await bridge.signIn(bridgeResp.authorization_url, callbackScheme);
|
|
4777
|
+
const parsed = new URL(resultUrl);
|
|
4778
|
+
const target = new URL(callbackUrl, window.location.href);
|
|
4779
|
+
parsed.searchParams.forEach((value, key) => {
|
|
4780
|
+
target.searchParams.set(key, value);
|
|
4781
|
+
});
|
|
4782
|
+
window.location.href = target.toString();
|
|
4783
|
+
return;
|
|
4784
|
+
}
|
|
4785
|
+
const inApp = detectInAppBrowser();
|
|
4786
|
+
if (inApp && (provider === "google" || provider === "apple")) {
|
|
4787
|
+
if (escapeToExternalBrowser()) {
|
|
4788
|
+
return;
|
|
4789
|
+
}
|
|
4790
|
+
throw new Error(
|
|
4791
|
+
`\uD604\uC7AC ${inApp.type === "kakaotalk" ? "\uCE74\uCE74\uC624\uD1A1" : inApp.type === "line" ? "\uB77C\uC778" : "\uC778\uC571"} \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C\uB294 Google/Apple \uB85C\uADF8\uC778\uC774 \uC81C\uD55C\uB429\uB2C8\uB2E4. \uC6B0\uCE21 \uC0C1\uB2E8 \uBA54\uB274\uC5D0\uC11C "\uB2E4\uB978 \uBE0C\uB77C\uC6B0\uC800\uB85C \uC5F4\uAE30"\uB97C \uC120\uD0DD\uD574\uC8FC\uC138\uC694.`
|
|
4792
|
+
);
|
|
4793
|
+
}
|
|
4732
4794
|
const params = new URLSearchParams({ app_callback: callbackUrl, intent });
|
|
4733
4795
|
if (state) {
|
|
4734
4796
|
params.append("state", state);
|
|
@@ -4763,8 +4825,43 @@ var OAuthAPI = class {
|
|
|
4763
4825
|
* ```
|
|
4764
4826
|
*/
|
|
4765
4827
|
async signInWithPopup(provider, callbackUrl, options = {}) {
|
|
4828
|
+
const intent = options.intent ?? "signin";
|
|
4829
|
+
const bridge = getNativeOAuthBridge();
|
|
4830
|
+
if (bridge) {
|
|
4831
|
+
const callbackScheme = bridge.getCallbackScheme();
|
|
4832
|
+
const bridgeParams = new URLSearchParams({ app_callback: callbackScheme, intent });
|
|
4833
|
+
const bridgeResp = await this.http.get(
|
|
4834
|
+
`/v1/public/oauth/${provider}/authorize/central?${bridgeParams.toString()}`
|
|
4835
|
+
);
|
|
4836
|
+
const { url: resultUrl } = await bridge.signIn(bridgeResp.authorization_url, callbackScheme);
|
|
4837
|
+
const parsed = new URL(resultUrl);
|
|
4838
|
+
const err = parsed.searchParams.get("error");
|
|
4839
|
+
if (err) throw new Error(err);
|
|
4840
|
+
const accessToken = parsed.searchParams.get("access_token") || "";
|
|
4841
|
+
const refreshToken = parsed.searchParams.get("refresh_token") || "";
|
|
4842
|
+
const memberId = parsed.searchParams.get("member_id") || "";
|
|
4843
|
+
if (!accessToken || !refreshToken || !memberId) {
|
|
4844
|
+
throw new Error("OAuth \uC751\uB2F5\uC5D0 \uD1A0\uD070\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
4845
|
+
}
|
|
4846
|
+
this.http.setTokens(accessToken, refreshToken);
|
|
4847
|
+
return {
|
|
4848
|
+
access_token: accessToken,
|
|
4849
|
+
refresh_token: refreshToken,
|
|
4850
|
+
member_id: memberId,
|
|
4851
|
+
is_new_member: parsed.searchParams.get("is_new_member") === "true"
|
|
4852
|
+
};
|
|
4853
|
+
}
|
|
4854
|
+
const inApp = detectInAppBrowser();
|
|
4855
|
+
if (inApp && (provider === "google" || provider === "apple")) {
|
|
4856
|
+
if (!escapeToExternalBrowser()) {
|
|
4857
|
+
throw new Error(
|
|
4858
|
+
`\uD604\uC7AC ${inApp.type === "kakaotalk" ? "\uCE74\uCE74\uC624\uD1A1" : inApp.type === "line" ? "\uB77C\uC778" : "\uC778\uC571"} \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C\uB294 Google/Apple \uB85C\uADF8\uC778\uC774 \uC81C\uD55C\uB429\uB2C8\uB2E4. \uC678\uBD80 \uBE0C\uB77C\uC6B0\uC800\uC5D0\uC11C \uC5F4\uC5B4\uC8FC\uC138\uC694.`
|
|
4859
|
+
);
|
|
4860
|
+
}
|
|
4861
|
+
throw new Error("\uC678\uBD80 \uBE0C\uB77C\uC6B0\uC800\uB85C \uC774\uB3D9\uD588\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694.");
|
|
4862
|
+
}
|
|
4766
4863
|
const params = new URLSearchParams();
|
|
4767
|
-
params.set("intent",
|
|
4864
|
+
params.set("intent", intent);
|
|
4768
4865
|
if (callbackUrl) {
|
|
4769
4866
|
params.set("app_callback", callbackUrl);
|
|
4770
4867
|
}
|
|
@@ -10685,6 +10782,8 @@ export {
|
|
|
10685
10782
|
SessionManager,
|
|
10686
10783
|
VideoProcessingError,
|
|
10687
10784
|
index_default as default,
|
|
10785
|
+
detectInAppBrowser,
|
|
10786
|
+
escapeToExternalBrowser,
|
|
10688
10787
|
isWebTransportSupported,
|
|
10689
10788
|
toCreateRoomWire
|
|
10690
10789
|
};
|