connectbase-client 3.52.0 → 3.54.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 +40 -0
- package/dist/cli.js +38 -109
- package/dist/connect-base.umd.js +1 -1
- package/dist/index.d.mts +109 -1
- package/dist/index.d.ts +109 -1
- package/dist/index.js +57 -0
- package/dist/index.mjs +57 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -7313,6 +7313,8 @@ interface SubscriptionResponse {
|
|
|
7313
7313
|
paddle_environment?: string;
|
|
7314
7314
|
/** paddle: 호스티드 결제 페이지 URL (fallback) */
|
|
7315
7315
|
paddle_checkout_url?: string;
|
|
7316
|
+
/** paddle: 현재 구독이 물린 recurring price ID (pri_*) */
|
|
7317
|
+
paddle_price_id?: string;
|
|
7316
7318
|
/** 플랜 이름 */
|
|
7317
7319
|
plan_name: string;
|
|
7318
7320
|
/** 플랜 설명 */
|
|
@@ -7380,6 +7382,67 @@ interface CancelSubscriptionRequest {
|
|
|
7380
7382
|
/** 즉시 취소 여부 (false면 현재 기간 종료 후 취소) */
|
|
7381
7383
|
immediate?: boolean;
|
|
7382
7384
|
}
|
|
7385
|
+
/**
|
|
7386
|
+
* 요금제 스왑 시 남은 금액 정산 방식 (Paddle proration_billing_mode).
|
|
7387
|
+
*
|
|
7388
|
+
* - `prorated_immediately`: 신·구 플랜 차액을 지금 일할 청구하고 즉시 전환 (업그레이드 기본).
|
|
7389
|
+
* - `prorated_next_billing_period`: 차액을 계산하되 다음 청구일에 부과 (전환은 즉시). 다운그레이드에 적합.
|
|
7390
|
+
* - `full_immediately`: 새 플랜 전액을 지금 청구.
|
|
7391
|
+
* - `full_next_billing_period`: 새 플랜 전액을 다음 청구일에 부과.
|
|
7392
|
+
* - `do_not_bill`: 전환만 하고 청구하지 않음.
|
|
7393
|
+
*/
|
|
7394
|
+
type ProrationMode = "prorated_immediately" | "prorated_next_billing_period" | "full_immediately" | "full_next_billing_period" | "do_not_bill";
|
|
7395
|
+
/**
|
|
7396
|
+
* 즉시청구(prorated/full_immediately) 실패 시 플랜 변경을 적용할지.
|
|
7397
|
+
*
|
|
7398
|
+
* - `prevent_change`(기본): 청구 실패 시 플랜 변경 미적용 (옛 플랜 유지). 셀프서비스 안전 기본.
|
|
7399
|
+
* - `apply_change`: 청구 실패해도 플랜 변경 적용 (차액은 past_due 로 나중 수금). CS/관리자 흐름용.
|
|
7400
|
+
*/
|
|
7401
|
+
type OnPaymentFailure = "prevent_change" | "apply_change";
|
|
7402
|
+
/**
|
|
7403
|
+
* 요금제 스왑(플랜 변경) 요청 — Paddle(MoR) 구독 전용.
|
|
7404
|
+
*
|
|
7405
|
+
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price 로 갈아타고 남은 금액을 Paddle proration 으로
|
|
7406
|
+
* 정산한다. 예) 혼자→가족 in-place 업그레이드.
|
|
7407
|
+
*/
|
|
7408
|
+
interface ChangePlanRequest {
|
|
7409
|
+
/** 새 recurring price ID (pri_*) — 필수 */
|
|
7410
|
+
paddle_price_id: string;
|
|
7411
|
+
/** 우리 표시용 플랜명 (선택) */
|
|
7412
|
+
plan_name?: string;
|
|
7413
|
+
/** 우리 표시용 플랜 설명 (선택) */
|
|
7414
|
+
plan_description?: string;
|
|
7415
|
+
/** 우리 기록용 정기 금액 (선택 — 미지정 시 Paddle 값으로 자동 수렴) */
|
|
7416
|
+
amount?: number;
|
|
7417
|
+
/** 정산 방식 (기본: prorated_immediately) */
|
|
7418
|
+
proration_mode?: ProrationMode;
|
|
7419
|
+
/** 즉시청구 실패 시 처리 (기본: prevent_change) */
|
|
7420
|
+
on_payment_failure?: OnPaymentFailure;
|
|
7421
|
+
/** 메타데이터 병합 (선택) */
|
|
7422
|
+
metadata?: Record<string, unknown>;
|
|
7423
|
+
}
|
|
7424
|
+
/**
|
|
7425
|
+
* 요금제 스왑 미리보기 응답 — 실제 적용 없이 정산 결과만 계산.
|
|
7426
|
+
*
|
|
7427
|
+
* `immediate_charge_amount` 는 세금·기존 크레딧 잔액까지 반영된 Paddle 계산값(권위)이다.
|
|
7428
|
+
* 확정 화면에 "지금 ₩X 청구, 이후 ₩Y/주기" 로 그대로 노출한다.
|
|
7429
|
+
*/
|
|
7430
|
+
interface ChangePlanPreview {
|
|
7431
|
+
/** 적용된 정산 모드 */
|
|
7432
|
+
proration_mode: ProrationMode;
|
|
7433
|
+
/** 지금 발생: charge(청구) | credit(크레딧) | 없음 */
|
|
7434
|
+
immediate_charge_action?: "charge" | "credit";
|
|
7435
|
+
/** 지금 순액(minor). 청구=양수, 크레딧=음수 */
|
|
7436
|
+
immediate_charge_amount: number;
|
|
7437
|
+
/** 새 플랜의 다음 정기 청구액(minor) */
|
|
7438
|
+
recurring_amount: number;
|
|
7439
|
+
/** 통화 (ISO 4217) */
|
|
7440
|
+
currency: string;
|
|
7441
|
+
/** 다음 청구 예정일 */
|
|
7442
|
+
next_billed_at?: string | null;
|
|
7443
|
+
/** 미리보기가 반영한 새 price ID */
|
|
7444
|
+
new_paddle_price_id?: string;
|
|
7445
|
+
}
|
|
7383
7446
|
interface ListSubscriptionsRequest {
|
|
7384
7447
|
/** 상태 필터 */
|
|
7385
7448
|
status?: SubscriptionStatus;
|
|
@@ -7675,6 +7738,51 @@ declare class SubscriptionAPI {
|
|
|
7675
7738
|
* ```
|
|
7676
7739
|
*/
|
|
7677
7740
|
cancel(subscriptionId: string, data?: CancelSubscriptionRequest): Promise<SubscriptionResponse>;
|
|
7741
|
+
/**
|
|
7742
|
+
* 요금제 스왑 (플랜 변경) — Paddle(MoR) 구독 전용
|
|
7743
|
+
*
|
|
7744
|
+
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price 로 갈아타고 남은 금액을 Paddle proration 으로
|
|
7745
|
+
* 즉시 정산합니다. 예) 혼자→가족 in-place 업그레이드 — 이미 낸 혼자 미사용분을 Paddle 이 자동 크레딧해
|
|
7746
|
+
* 첫 가족 청구에서 차감합니다. 즉시청구 차액의 결제 확정은 웹훅(SoT)으로 수렴합니다.
|
|
7747
|
+
*
|
|
7748
|
+
* `proration_mode` 미지정 시 `prorated_immediately`(업그레이드 기본)가 적용됩니다.
|
|
7749
|
+
* 확정 전 정산액을 보여주려면 {@link previewChangePlan} 을 먼저 호출하세요.
|
|
7750
|
+
*
|
|
7751
|
+
* @param subscriptionId - 구독 ID
|
|
7752
|
+
* @param data - 새 price + 정산 옵션
|
|
7753
|
+
* @returns 갱신된 구독 정보
|
|
7754
|
+
*
|
|
7755
|
+
* @example
|
|
7756
|
+
* ```typescript
|
|
7757
|
+
* await client.subscription.changePlan(subscriptionId, {
|
|
7758
|
+
* paddle_price_id: 'pri_family_monthly',
|
|
7759
|
+
* plan_name: '가족 플랜',
|
|
7760
|
+
* amount: 24900,
|
|
7761
|
+
* proration_mode: 'prorated_immediately',
|
|
7762
|
+
* })
|
|
7763
|
+
* ```
|
|
7764
|
+
*/
|
|
7765
|
+
changePlan(subscriptionId: string, data: ChangePlanRequest): Promise<SubscriptionResponse>;
|
|
7766
|
+
/**
|
|
7767
|
+
* 요금제 스왑 정산 미리보기 — 실제 적용 없이 청구/크레딧 금액만 계산 (Paddle 전용)
|
|
7768
|
+
*
|
|
7769
|
+
* 세금·기존 크레딧 잔액까지 반영된 Paddle 계산값을 반환하므로, 확정 화면에
|
|
7770
|
+
* "지금 ₩X 청구, 이후 ₩Y/주기 (다음 청구일 …)" 를 그대로 노출하면 됩니다.
|
|
7771
|
+
* 직접 차액을 계산하지 마세요 — 이 값이 권위입니다.
|
|
7772
|
+
*
|
|
7773
|
+
* @param subscriptionId - 구독 ID
|
|
7774
|
+
* @param data - 새 price + 정산 옵션 ({@link changePlan} 과 동일 body)
|
|
7775
|
+
* @returns 정산 미리보기 (지금 청구/크레딧 · 새 정기 청구액 · 다음 청구일)
|
|
7776
|
+
*
|
|
7777
|
+
* @example
|
|
7778
|
+
* ```typescript
|
|
7779
|
+
* const preview = await client.subscription.previewChangePlan(subscriptionId, {
|
|
7780
|
+
* paddle_price_id: 'pri_family_monthly',
|
|
7781
|
+
* })
|
|
7782
|
+
* // preview.immediate_charge_amount, preview.recurring_amount, preview.next_billed_at
|
|
7783
|
+
* ```
|
|
7784
|
+
*/
|
|
7785
|
+
previewChangePlan(subscriptionId: string, data: ChangePlanRequest): Promise<ChangePlanPreview>;
|
|
7678
7786
|
/**
|
|
7679
7787
|
* 구독 결제 이력 조회
|
|
7680
7788
|
*
|
|
@@ -9408,4 +9516,4 @@ declare class ConnectBase {
|
|
|
9408
9516
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
9409
9517
|
}
|
|
9410
9518
|
|
|
9411
|
-
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChannelStats, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRolePayload, type CreateRoleResult, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoBoundingBox, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListPaymentsOptions, 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 PaymentListItem, type PaymentListResult, 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 PushStatsResult, 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 RoleDetail, type RoleList, type RoleListItem, type RolePermissionItem, type RoleUserItem, RolesAPI, type RoomInfo, type RoomStaleMessage, type RoomSummary, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type SendSuperChatOptions, type SendSuperChatResponse, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type SpeechRecognizeOptions, type SpeechResult, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StorageUploadProgress, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SuperChatType, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateRolePayload, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoCompleteUploadResponse, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
|
|
9519
|
+
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type ChangePlanPreview, type ChangePlanRequest, type Channel, type ChannelMembership, type ChannelStats, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRolePayload, type CreateRoleResult, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoBoundingBox, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListPaymentsOptions, 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 OnPaymentFailure, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentListItem, type PaymentListResult, 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 ProrationMode, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type PushStatsResult, 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 RoleDetail, type RoleList, type RoleListItem, type RolePermissionItem, type RoleUserItem, RolesAPI, type RoomInfo, type RoomStaleMessage, type RoomSummary, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type SendSuperChatOptions, type SendSuperChatResponse, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type SpeechRecognizeOptions, type SpeechResult, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StorageUploadProgress, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SuperChatType, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateRolePayload, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoCompleteUploadResponse, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
|
package/dist/index.d.ts
CHANGED
|
@@ -7313,6 +7313,8 @@ interface SubscriptionResponse {
|
|
|
7313
7313
|
paddle_environment?: string;
|
|
7314
7314
|
/** paddle: 호스티드 결제 페이지 URL (fallback) */
|
|
7315
7315
|
paddle_checkout_url?: string;
|
|
7316
|
+
/** paddle: 현재 구독이 물린 recurring price ID (pri_*) */
|
|
7317
|
+
paddle_price_id?: string;
|
|
7316
7318
|
/** 플랜 이름 */
|
|
7317
7319
|
plan_name: string;
|
|
7318
7320
|
/** 플랜 설명 */
|
|
@@ -7380,6 +7382,67 @@ interface CancelSubscriptionRequest {
|
|
|
7380
7382
|
/** 즉시 취소 여부 (false면 현재 기간 종료 후 취소) */
|
|
7381
7383
|
immediate?: boolean;
|
|
7382
7384
|
}
|
|
7385
|
+
/**
|
|
7386
|
+
* 요금제 스왑 시 남은 금액 정산 방식 (Paddle proration_billing_mode).
|
|
7387
|
+
*
|
|
7388
|
+
* - `prorated_immediately`: 신·구 플랜 차액을 지금 일할 청구하고 즉시 전환 (업그레이드 기본).
|
|
7389
|
+
* - `prorated_next_billing_period`: 차액을 계산하되 다음 청구일에 부과 (전환은 즉시). 다운그레이드에 적합.
|
|
7390
|
+
* - `full_immediately`: 새 플랜 전액을 지금 청구.
|
|
7391
|
+
* - `full_next_billing_period`: 새 플랜 전액을 다음 청구일에 부과.
|
|
7392
|
+
* - `do_not_bill`: 전환만 하고 청구하지 않음.
|
|
7393
|
+
*/
|
|
7394
|
+
type ProrationMode = "prorated_immediately" | "prorated_next_billing_period" | "full_immediately" | "full_next_billing_period" | "do_not_bill";
|
|
7395
|
+
/**
|
|
7396
|
+
* 즉시청구(prorated/full_immediately) 실패 시 플랜 변경을 적용할지.
|
|
7397
|
+
*
|
|
7398
|
+
* - `prevent_change`(기본): 청구 실패 시 플랜 변경 미적용 (옛 플랜 유지). 셀프서비스 안전 기본.
|
|
7399
|
+
* - `apply_change`: 청구 실패해도 플랜 변경 적용 (차액은 past_due 로 나중 수금). CS/관리자 흐름용.
|
|
7400
|
+
*/
|
|
7401
|
+
type OnPaymentFailure = "prevent_change" | "apply_change";
|
|
7402
|
+
/**
|
|
7403
|
+
* 요금제 스왑(플랜 변경) 요청 — Paddle(MoR) 구독 전용.
|
|
7404
|
+
*
|
|
7405
|
+
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price 로 갈아타고 남은 금액을 Paddle proration 으로
|
|
7406
|
+
* 정산한다. 예) 혼자→가족 in-place 업그레이드.
|
|
7407
|
+
*/
|
|
7408
|
+
interface ChangePlanRequest {
|
|
7409
|
+
/** 새 recurring price ID (pri_*) — 필수 */
|
|
7410
|
+
paddle_price_id: string;
|
|
7411
|
+
/** 우리 표시용 플랜명 (선택) */
|
|
7412
|
+
plan_name?: string;
|
|
7413
|
+
/** 우리 표시용 플랜 설명 (선택) */
|
|
7414
|
+
plan_description?: string;
|
|
7415
|
+
/** 우리 기록용 정기 금액 (선택 — 미지정 시 Paddle 값으로 자동 수렴) */
|
|
7416
|
+
amount?: number;
|
|
7417
|
+
/** 정산 방식 (기본: prorated_immediately) */
|
|
7418
|
+
proration_mode?: ProrationMode;
|
|
7419
|
+
/** 즉시청구 실패 시 처리 (기본: prevent_change) */
|
|
7420
|
+
on_payment_failure?: OnPaymentFailure;
|
|
7421
|
+
/** 메타데이터 병합 (선택) */
|
|
7422
|
+
metadata?: Record<string, unknown>;
|
|
7423
|
+
}
|
|
7424
|
+
/**
|
|
7425
|
+
* 요금제 스왑 미리보기 응답 — 실제 적용 없이 정산 결과만 계산.
|
|
7426
|
+
*
|
|
7427
|
+
* `immediate_charge_amount` 는 세금·기존 크레딧 잔액까지 반영된 Paddle 계산값(권위)이다.
|
|
7428
|
+
* 확정 화면에 "지금 ₩X 청구, 이후 ₩Y/주기" 로 그대로 노출한다.
|
|
7429
|
+
*/
|
|
7430
|
+
interface ChangePlanPreview {
|
|
7431
|
+
/** 적용된 정산 모드 */
|
|
7432
|
+
proration_mode: ProrationMode;
|
|
7433
|
+
/** 지금 발생: charge(청구) | credit(크레딧) | 없음 */
|
|
7434
|
+
immediate_charge_action?: "charge" | "credit";
|
|
7435
|
+
/** 지금 순액(minor). 청구=양수, 크레딧=음수 */
|
|
7436
|
+
immediate_charge_amount: number;
|
|
7437
|
+
/** 새 플랜의 다음 정기 청구액(minor) */
|
|
7438
|
+
recurring_amount: number;
|
|
7439
|
+
/** 통화 (ISO 4217) */
|
|
7440
|
+
currency: string;
|
|
7441
|
+
/** 다음 청구 예정일 */
|
|
7442
|
+
next_billed_at?: string | null;
|
|
7443
|
+
/** 미리보기가 반영한 새 price ID */
|
|
7444
|
+
new_paddle_price_id?: string;
|
|
7445
|
+
}
|
|
7383
7446
|
interface ListSubscriptionsRequest {
|
|
7384
7447
|
/** 상태 필터 */
|
|
7385
7448
|
status?: SubscriptionStatus;
|
|
@@ -7675,6 +7738,51 @@ declare class SubscriptionAPI {
|
|
|
7675
7738
|
* ```
|
|
7676
7739
|
*/
|
|
7677
7740
|
cancel(subscriptionId: string, data?: CancelSubscriptionRequest): Promise<SubscriptionResponse>;
|
|
7741
|
+
/**
|
|
7742
|
+
* 요금제 스왑 (플랜 변경) — Paddle(MoR) 구독 전용
|
|
7743
|
+
*
|
|
7744
|
+
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price 로 갈아타고 남은 금액을 Paddle proration 으로
|
|
7745
|
+
* 즉시 정산합니다. 예) 혼자→가족 in-place 업그레이드 — 이미 낸 혼자 미사용분을 Paddle 이 자동 크레딧해
|
|
7746
|
+
* 첫 가족 청구에서 차감합니다. 즉시청구 차액의 결제 확정은 웹훅(SoT)으로 수렴합니다.
|
|
7747
|
+
*
|
|
7748
|
+
* `proration_mode` 미지정 시 `prorated_immediately`(업그레이드 기본)가 적용됩니다.
|
|
7749
|
+
* 확정 전 정산액을 보여주려면 {@link previewChangePlan} 을 먼저 호출하세요.
|
|
7750
|
+
*
|
|
7751
|
+
* @param subscriptionId - 구독 ID
|
|
7752
|
+
* @param data - 새 price + 정산 옵션
|
|
7753
|
+
* @returns 갱신된 구독 정보
|
|
7754
|
+
*
|
|
7755
|
+
* @example
|
|
7756
|
+
* ```typescript
|
|
7757
|
+
* await client.subscription.changePlan(subscriptionId, {
|
|
7758
|
+
* paddle_price_id: 'pri_family_monthly',
|
|
7759
|
+
* plan_name: '가족 플랜',
|
|
7760
|
+
* amount: 24900,
|
|
7761
|
+
* proration_mode: 'prorated_immediately',
|
|
7762
|
+
* })
|
|
7763
|
+
* ```
|
|
7764
|
+
*/
|
|
7765
|
+
changePlan(subscriptionId: string, data: ChangePlanRequest): Promise<SubscriptionResponse>;
|
|
7766
|
+
/**
|
|
7767
|
+
* 요금제 스왑 정산 미리보기 — 실제 적용 없이 청구/크레딧 금액만 계산 (Paddle 전용)
|
|
7768
|
+
*
|
|
7769
|
+
* 세금·기존 크레딧 잔액까지 반영된 Paddle 계산값을 반환하므로, 확정 화면에
|
|
7770
|
+
* "지금 ₩X 청구, 이후 ₩Y/주기 (다음 청구일 …)" 를 그대로 노출하면 됩니다.
|
|
7771
|
+
* 직접 차액을 계산하지 마세요 — 이 값이 권위입니다.
|
|
7772
|
+
*
|
|
7773
|
+
* @param subscriptionId - 구독 ID
|
|
7774
|
+
* @param data - 새 price + 정산 옵션 ({@link changePlan} 과 동일 body)
|
|
7775
|
+
* @returns 정산 미리보기 (지금 청구/크레딧 · 새 정기 청구액 · 다음 청구일)
|
|
7776
|
+
*
|
|
7777
|
+
* @example
|
|
7778
|
+
* ```typescript
|
|
7779
|
+
* const preview = await client.subscription.previewChangePlan(subscriptionId, {
|
|
7780
|
+
* paddle_price_id: 'pri_family_monthly',
|
|
7781
|
+
* })
|
|
7782
|
+
* // preview.immediate_charge_amount, preview.recurring_amount, preview.next_billed_at
|
|
7783
|
+
* ```
|
|
7784
|
+
*/
|
|
7785
|
+
previewChangePlan(subscriptionId: string, data: ChangePlanRequest): Promise<ChangePlanPreview>;
|
|
7678
7786
|
/**
|
|
7679
7787
|
* 구독 결제 이력 조회
|
|
7680
7788
|
*
|
|
@@ -9408,4 +9516,4 @@ declare class ConnectBase {
|
|
|
9408
9516
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
9409
9517
|
}
|
|
9410
9518
|
|
|
9411
|
-
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChannelStats, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRolePayload, type CreateRoleResult, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoBoundingBox, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListPaymentsOptions, 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 PaymentListItem, type PaymentListResult, 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 PushStatsResult, 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 RoleDetail, type RoleList, type RoleListItem, type RolePermissionItem, type RoleUserItem, RolesAPI, type RoomInfo, type RoomStaleMessage, type RoomSummary, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type SendSuperChatOptions, type SendSuperChatResponse, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type SpeechRecognizeOptions, type SpeechResult, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StorageUploadProgress, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SuperChatType, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateRolePayload, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoCompleteUploadResponse, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
|
|
9519
|
+
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type ChangePlanPreview, type ChangePlanRequest, type Channel, type ChannelMembership, type ChannelStats, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRolePayload, type CreateRoleResult, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoBoundingBox, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListPaymentsOptions, 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 OnPaymentFailure, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentListItem, type PaymentListResult, 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 ProrationMode, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type PushStatsResult, 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 RoleDetail, type RoleList, type RoleListItem, type RolePermissionItem, type RoleUserItem, RolesAPI, type RoomInfo, type RoomStaleMessage, type RoomSummary, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type SendSuperChatOptions, type SendSuperChatResponse, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type SpeechRecognizeOptions, type SpeechResult, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StorageUploadProgress, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SuperChatType, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateRolePayload, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoCompleteUploadResponse, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
|
package/dist/index.js
CHANGED
|
@@ -8856,6 +8856,63 @@ var SubscriptionAPI = class {
|
|
|
8856
8856
|
body
|
|
8857
8857
|
);
|
|
8858
8858
|
}
|
|
8859
|
+
/**
|
|
8860
|
+
* 요금제 스왑 (플랜 변경) — Paddle(MoR) 구독 전용
|
|
8861
|
+
*
|
|
8862
|
+
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price 로 갈아타고 남은 금액을 Paddle proration 으로
|
|
8863
|
+
* 즉시 정산합니다. 예) 혼자→가족 in-place 업그레이드 — 이미 낸 혼자 미사용분을 Paddle 이 자동 크레딧해
|
|
8864
|
+
* 첫 가족 청구에서 차감합니다. 즉시청구 차액의 결제 확정은 웹훅(SoT)으로 수렴합니다.
|
|
8865
|
+
*
|
|
8866
|
+
* `proration_mode` 미지정 시 `prorated_immediately`(업그레이드 기본)가 적용됩니다.
|
|
8867
|
+
* 확정 전 정산액을 보여주려면 {@link previewChangePlan} 을 먼저 호출하세요.
|
|
8868
|
+
*
|
|
8869
|
+
* @param subscriptionId - 구독 ID
|
|
8870
|
+
* @param data - 새 price + 정산 옵션
|
|
8871
|
+
* @returns 갱신된 구독 정보
|
|
8872
|
+
*
|
|
8873
|
+
* @example
|
|
8874
|
+
* ```typescript
|
|
8875
|
+
* await client.subscription.changePlan(subscriptionId, {
|
|
8876
|
+
* paddle_price_id: 'pri_family_monthly',
|
|
8877
|
+
* plan_name: '가족 플랜',
|
|
8878
|
+
* amount: 24900,
|
|
8879
|
+
* proration_mode: 'prorated_immediately',
|
|
8880
|
+
* })
|
|
8881
|
+
* ```
|
|
8882
|
+
*/
|
|
8883
|
+
async changePlan(subscriptionId, data) {
|
|
8884
|
+
const prefix = this.getPublicPrefix();
|
|
8885
|
+
return this.http.post(
|
|
8886
|
+
`${prefix}/subscriptions/${subscriptionId}/change-plan`,
|
|
8887
|
+
data
|
|
8888
|
+
);
|
|
8889
|
+
}
|
|
8890
|
+
/**
|
|
8891
|
+
* 요금제 스왑 정산 미리보기 — 실제 적용 없이 청구/크레딧 금액만 계산 (Paddle 전용)
|
|
8892
|
+
*
|
|
8893
|
+
* 세금·기존 크레딧 잔액까지 반영된 Paddle 계산값을 반환하므로, 확정 화면에
|
|
8894
|
+
* "지금 ₩X 청구, 이후 ₩Y/주기 (다음 청구일 …)" 를 그대로 노출하면 됩니다.
|
|
8895
|
+
* 직접 차액을 계산하지 마세요 — 이 값이 권위입니다.
|
|
8896
|
+
*
|
|
8897
|
+
* @param subscriptionId - 구독 ID
|
|
8898
|
+
* @param data - 새 price + 정산 옵션 ({@link changePlan} 과 동일 body)
|
|
8899
|
+
* @returns 정산 미리보기 (지금 청구/크레딧 · 새 정기 청구액 · 다음 청구일)
|
|
8900
|
+
*
|
|
8901
|
+
* @example
|
|
8902
|
+
* ```typescript
|
|
8903
|
+
* const preview = await client.subscription.previewChangePlan(subscriptionId, {
|
|
8904
|
+
* paddle_price_id: 'pri_family_monthly',
|
|
8905
|
+
* })
|
|
8906
|
+
* // preview.immediate_charge_amount, preview.recurring_amount, preview.next_billed_at
|
|
8907
|
+
* ```
|
|
8908
|
+
*/
|
|
8909
|
+
async previewChangePlan(subscriptionId, data) {
|
|
8910
|
+
const prefix = this.getPublicPrefix();
|
|
8911
|
+
return this.http.post(
|
|
8912
|
+
`${prefix}/subscriptions/${subscriptionId}/change-plan/preview`,
|
|
8913
|
+
data
|
|
8914
|
+
);
|
|
8915
|
+
}
|
|
8859
8916
|
// =====================
|
|
8860
8917
|
// Subscription Payment APIs
|
|
8861
8918
|
// =====================
|
package/dist/index.mjs
CHANGED
|
@@ -8810,6 +8810,63 @@ var SubscriptionAPI = class {
|
|
|
8810
8810
|
body
|
|
8811
8811
|
);
|
|
8812
8812
|
}
|
|
8813
|
+
/**
|
|
8814
|
+
* 요금제 스왑 (플랜 변경) — Paddle(MoR) 구독 전용
|
|
8815
|
+
*
|
|
8816
|
+
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price 로 갈아타고 남은 금액을 Paddle proration 으로
|
|
8817
|
+
* 즉시 정산합니다. 예) 혼자→가족 in-place 업그레이드 — 이미 낸 혼자 미사용분을 Paddle 이 자동 크레딧해
|
|
8818
|
+
* 첫 가족 청구에서 차감합니다. 즉시청구 차액의 결제 확정은 웹훅(SoT)으로 수렴합니다.
|
|
8819
|
+
*
|
|
8820
|
+
* `proration_mode` 미지정 시 `prorated_immediately`(업그레이드 기본)가 적용됩니다.
|
|
8821
|
+
* 확정 전 정산액을 보여주려면 {@link previewChangePlan} 을 먼저 호출하세요.
|
|
8822
|
+
*
|
|
8823
|
+
* @param subscriptionId - 구독 ID
|
|
8824
|
+
* @param data - 새 price + 정산 옵션
|
|
8825
|
+
* @returns 갱신된 구독 정보
|
|
8826
|
+
*
|
|
8827
|
+
* @example
|
|
8828
|
+
* ```typescript
|
|
8829
|
+
* await client.subscription.changePlan(subscriptionId, {
|
|
8830
|
+
* paddle_price_id: 'pri_family_monthly',
|
|
8831
|
+
* plan_name: '가족 플랜',
|
|
8832
|
+
* amount: 24900,
|
|
8833
|
+
* proration_mode: 'prorated_immediately',
|
|
8834
|
+
* })
|
|
8835
|
+
* ```
|
|
8836
|
+
*/
|
|
8837
|
+
async changePlan(subscriptionId, data) {
|
|
8838
|
+
const prefix = this.getPublicPrefix();
|
|
8839
|
+
return this.http.post(
|
|
8840
|
+
`${prefix}/subscriptions/${subscriptionId}/change-plan`,
|
|
8841
|
+
data
|
|
8842
|
+
);
|
|
8843
|
+
}
|
|
8844
|
+
/**
|
|
8845
|
+
* 요금제 스왑 정산 미리보기 — 실제 적용 없이 청구/크레딧 금액만 계산 (Paddle 전용)
|
|
8846
|
+
*
|
|
8847
|
+
* 세금·기존 크레딧 잔액까지 반영된 Paddle 계산값을 반환하므로, 확정 화면에
|
|
8848
|
+
* "지금 ₩X 청구, 이후 ₩Y/주기 (다음 청구일 …)" 를 그대로 노출하면 됩니다.
|
|
8849
|
+
* 직접 차액을 계산하지 마세요 — 이 값이 권위입니다.
|
|
8850
|
+
*
|
|
8851
|
+
* @param subscriptionId - 구독 ID
|
|
8852
|
+
* @param data - 새 price + 정산 옵션 ({@link changePlan} 과 동일 body)
|
|
8853
|
+
* @returns 정산 미리보기 (지금 청구/크레딧 · 새 정기 청구액 · 다음 청구일)
|
|
8854
|
+
*
|
|
8855
|
+
* @example
|
|
8856
|
+
* ```typescript
|
|
8857
|
+
* const preview = await client.subscription.previewChangePlan(subscriptionId, {
|
|
8858
|
+
* paddle_price_id: 'pri_family_monthly',
|
|
8859
|
+
* })
|
|
8860
|
+
* // preview.immediate_charge_amount, preview.recurring_amount, preview.next_billed_at
|
|
8861
|
+
* ```
|
|
8862
|
+
*/
|
|
8863
|
+
async previewChangePlan(subscriptionId, data) {
|
|
8864
|
+
const prefix = this.getPublicPrefix();
|
|
8865
|
+
return this.http.post(
|
|
8866
|
+
`${prefix}/subscriptions/${subscriptionId}/change-plan/preview`,
|
|
8867
|
+
data
|
|
8868
|
+
);
|
|
8869
|
+
}
|
|
8813
8870
|
// =====================
|
|
8814
8871
|
// Subscription Payment APIs
|
|
8815
8872
|
// =====================
|