connectbase-client 5.3.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -5587,6 +5587,11 @@ interface PreparePaymentResponse {
5587
5587
  launch_mode?: "overlay" | "redirect";
5588
5588
  }
5589
5589
  interface CreateCheckoutSessionRequest {
5590
+ /**
5591
+ * 사용할 자격증명 모드 오버라이드(선택). `prepare()` 의 `payment_mode` 와 적용 조건이 같다 —
5592
+ * 서버 시크릿 키(`cb_sk_*`) 호출에서만 적용되고, 브라우저 공개 키 호출에서는 무시된다.
5593
+ */
5594
+ payment_mode?: PaymentMode;
5590
5595
  amount: number;
5591
5596
  currency: string;
5592
5597
  product_name: string;
@@ -7754,6 +7759,20 @@ type SubscriptionStatus = "active" | "paused" | "canceled" | "past_due" | "expir
7754
7759
  interface CreateSubscriptionRequest {
7755
7760
  /** 빌링키 ID (toss/stripe 필수, payapp 미사용 — payurl 모델) */
7756
7761
  billing_key_id?: string;
7762
+ /**
7763
+ * 구독 ID 를 직접 지정한다(선택). 미지정이면 서버가 `sub_<uuid>` 로 생성한다.
7764
+ *
7765
+ * 재시도 시 같은 값을 넘기면 최초 청구 orderID 가 결정적으로 만들어져 이중청구를 막는다 —
7766
+ * 네트워크 실패로 create 를 다시 호출해야 할 때 쓴다.
7767
+ */
7768
+ subscription_id?: string;
7769
+ /**
7770
+ * true 면 구독 생성 즉시 1회차를 청구한다(빌링키 모델). false(기본)면 다음 결제일부터 청구.
7771
+ * `trial_days` 가 있으면 즉시 청구하지 않는다(체험 종료 후 첫 청구).
7772
+ *
7773
+ * MoR(paddle/dodo)은 결제창에서 1회차를 받으므로 이 값을 쓰지 않는다.
7774
+ */
7775
+ start_now?: boolean;
7757
7776
  /** 플랜 이름 */
7758
7777
  plan_name: string;
7759
7778
  /** 플랜 설명 */
@@ -7920,6 +7939,34 @@ interface UpdateSubscriptionRequest {
7920
7939
  amount?: number;
7921
7940
  /** 메타데이터 */
7922
7941
  metadata?: Record<string, unknown>;
7942
+ /**
7943
+ * 다음 정기 결제일을 이 시점으로 옮깁니다 (RFC3339 또는 `YYYY-MM-DD` = 00:00 UTC).
7944
+ *
7945
+ * 요금제·금액은 그대로 두고 **청구 시점만** 옮기므로, 구독 중인 고객에게 기간을 얹어 줄 때
7946
+ * (기간권·선물 코드·CS 보상) 씁니다. 상대 일수로 미루려면
7947
+ * {@link SubscriptionAPI.postponeBilling} 이 낫습니다 — 현재 결제일을 PG 에서 읽어 더하므로
7948
+ * 갱신 직전 경쟁 조건을 서버가 처리합니다.
7949
+ *
7950
+ * ⚠️ 이 필드만 **서버 시크릿 키(`cb_sk_*`)가 필요합니다** — 무상 기간 지급이라 브라우저
7951
+ * 퍼블릭 키만으로는 403 입니다(다른 필드는 기존대로 퍼블릭 키로 수정 가능).
7952
+ *
7953
+ * 과거 시각은 400 `next_billing_date_invalid`,
7954
+ * 결제일을 옮길 수 없는 프로바이더(payapp/paypal)는 400 `next_billing_date_unsupported`.
7955
+ */
7956
+ next_billing_date?: string;
7957
+ }
7958
+ /**
7959
+ * 다음 결제일 미루기 요청 — `days` 와 `next_billing_date` 중 **정확히 하나**를 지정합니다.
7960
+ *
7961
+ * 둘 다 주거나 둘 다 비우면 400 `postpone_billing_input_invalid`.
7962
+ */
7963
+ interface PostponeBillingRequest {
7964
+ /** 미룰 일수 (1~3650). 예) 31일 선물권 → 다음 결제일이 31일 뒤로 밀림 */
7965
+ days?: number;
7966
+ /** 절대 날짜 지정 (RFC3339 또는 `YYYY-MM-DD` = 00:00 UTC). `days` 와 동시 지정 불가 */
7967
+ next_billing_date?: string;
7968
+ /** 기록용 사유 (선택, 200자) — 서버 로그에만 남습니다 */
7969
+ reason?: string;
7923
7970
  }
7924
7971
  interface PauseSubscriptionRequest {
7925
7972
  /** 일시정지 사유 */
@@ -8292,9 +8339,78 @@ declare class SubscriptionAPI {
8292
8339
  * plan_name: '엔터프라이즈 플랜',
8293
8340
  * amount: 29900
8294
8341
  * })
8342
+ *
8343
+ * // 다음 결제일을 특정 날짜로 옮기기 (기간권·보상)
8344
+ * await client.subscription.update(subscriptionId, {
8345
+ * next_billing_date: '2026-09-01',
8346
+ * })
8295
8347
  * ```
8348
+ *
8349
+ * @remarks
8350
+ * `next_billing_date` 는 PG 의 청구 스케줄까지 함께 옮깁니다. 그래서 결제일을 옮길 수 없는
8351
+ * 프로바이더는 조용히 무시되지 않고 400 `next_billing_date_unsupported` 로 거절됩니다
8352
+ * (로컬 기록만 미루면 PG 는 원래 날짜에 그대로 출금합니다). 지원표와 상세는
8353
+ * {@link postponeBilling} 참조.
8296
8354
  */
8297
8355
  update(subscriptionId: string, data: UpdateSubscriptionRequest): Promise<SubscriptionResponse>;
8356
+ /**
8357
+ * 다음 결제일 미루기 — 구독 중인 고객에게 **기간을 얹어 줍니다** (서버 전용)
8358
+ *
8359
+ * 요금제·금액은 그대로 두고 다음 정기 결제일만 옮깁니다. 기간권·선물 코드·CS 보상
8360
+ * ("불편을 드려 한 달 무료")처럼 "구독은 유지한 채 N일 공짜" 를 표현하는 표준 경로입니다.
8361
+ *
8362
+ * `days` 를 쓰면 **현재 결제일을 PG 에서 읽어** 더합니다 — 앱마다 "조회 → 더하기 → 쓰기" 를
8363
+ * 다시 구현하지 않아도 되고, 갱신 직전에 호출해도 방금 갱신된 주기 위에 얹힙니다.
8364
+ * 절대 날짜로 못박으려면 `next_billing_date` 를 쓰세요(둘 중 하나만 지정).
8365
+ *
8366
+ * ⚠️ **서버 시크릿 키(`cb_sk_*`)가 필요합니다.** 무상 기간 지급은 머천트 결정이라
8367
+ * 브라우저에 노출되는 퍼블릭 키만으로는 열려 있지 않습니다(그러면 클라이언트가 자기 구독을
8368
+ * 무한히 미룰 수 있습니다). 클라이언트를 `publicKey` + `secretKey` 로 초기화한 서버에서
8369
+ * 호출하세요 — 퍼블릭 키만 있으면 403 입니다.
8370
+ *
8371
+ * @param subscriptionId - 구독 ID
8372
+ * @param data - `days`(상대) 또는 `next_billing_date`(절대)
8373
+ * @returns 갱신된 구독 정보 (`next_billing_at` 이 옮겨진 값)
8374
+ *
8375
+ * @example
8376
+ * ```typescript
8377
+ * // 서버사이드: 선물 코드를 검증한 뒤 지급
8378
+ * const cb = new ConnectBase({
8379
+ * publicKey: process.env.CB_PUBLIC_KEY, // 앱 식별
8380
+ * secretKey: process.env.CB_SECRET_KEY, // 관리자 권한 (cb_sk_*)
8381
+ * })
8382
+ *
8383
+ * // 31일 선물권 등록 → 다음 결제일이 31일 뒤로
8384
+ * const sub = await cb.subscription.postponeBilling(subscriptionId, {
8385
+ * days: 31,
8386
+ * reason: 'gift-code:ABC123',
8387
+ * })
8388
+ * console.log(sub.next_billing_at)
8389
+ *
8390
+ * // 특정 날짜로 못박기
8391
+ * await cb.subscription.postponeBilling(subscriptionId, {
8392
+ * next_billing_date: '2026-09-01T00:00:00Z',
8393
+ * })
8394
+ * ```
8395
+ *
8396
+ * @remarks
8397
+ * **프로바이더 지원 범위** — 청구 스케줄의 주인이 다르기 때문에 갈립니다:
8398
+ * - **Dodo · Paddle (MoR)**: PG 의 결제일 변경 API 로 옮깁니다. Paddle 은 이동 구간에 대해
8399
+ * 청구도 크레딧도 만들지 않습니다(`do_not_bill`) — 미뤄 준 기간이 차액으로 상쇄되지 않습니다.
8400
+ * - **toss · stripe**: ConnectBase 스케줄러가 청구하므로 즉시 반영됩니다.
8401
+ * - **payapp · paypal**: PG 가 청구를 소유하면서 결제일 변경 수단을 주지 않아
8402
+ * 400 `next_billing_date_unsupported` 입니다(로컬만 미루면 원래 날짜에 출금되므로 거절).
8403
+ *
8404
+ * **거절되는 경우** — 조용한 no-op 대신 사유를 돌려줍니다:
8405
+ * - 과거 시각 → 400 `next_billing_date_invalid`
8406
+ * - 퍼블릭 키만으로 호출 → 403 (서버 시크릿 키 필요)
8407
+ * - `days` 와 `next_billing_date` 를 함께/둘 다 생략 → 400 `postpone_billing_input_invalid`
8408
+ * - active/trial 이 아닌 구독 → 409 `subscription_not_active`
8409
+ * - 해지 예약된 구독(`cancel()` 후) → 409 `subscription_scheduled_to_end`
8410
+ * (종료일이 정해져 있어 결제일을 미뤄도 기간이 늘지 않기 때문)
8411
+ * - MoR 최초 결제 전 → 409 `subscription_not_activated`
8412
+ */
8413
+ postponeBilling(subscriptionId: string, data: PostponeBillingRequest): Promise<SubscriptionResponse>;
8298
8414
  /**
8299
8415
  * 구독 일시정지
8300
8416
  *
@@ -10143,4 +10259,4 @@ declare class ConnectBase {
10143
10259
  updateConfig(config: Partial<ConnectBaseConfig>): void;
10144
10260
  }
10145
10261
 
10146
- export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, AIError, type AIErrorCode, 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 AppMemberDetail, type AppMemberIdentityDetail, type AppMemberIdentitySummary, type AppMemberList, type AppMemberListItem, type AppMemberProviderType, AppMembersAPI, 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 ListAppMembersOptions, 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 PaymentMode, 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 PublicKeyPaymentMode, 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, toAIError, toCreateRoomWire };
10262
+ export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, AIError, type AIErrorCode, 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 AppMemberDetail, type AppMemberIdentityDetail, type AppMemberIdentitySummary, type AppMemberList, type AppMemberListItem, type AppMemberProviderType, AppMembersAPI, 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 ListAppMembersOptions, 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 PaymentMode, 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 PostponeBillingRequest, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type ProrationMode, type PublicKeyItem, type PublicKeyPaymentMode, 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, toAIError, toCreateRoomWire };
package/dist/index.d.ts CHANGED
@@ -5587,6 +5587,11 @@ interface PreparePaymentResponse {
5587
5587
  launch_mode?: "overlay" | "redirect";
5588
5588
  }
5589
5589
  interface CreateCheckoutSessionRequest {
5590
+ /**
5591
+ * 사용할 자격증명 모드 오버라이드(선택). `prepare()` 의 `payment_mode` 와 적용 조건이 같다 —
5592
+ * 서버 시크릿 키(`cb_sk_*`) 호출에서만 적용되고, 브라우저 공개 키 호출에서는 무시된다.
5593
+ */
5594
+ payment_mode?: PaymentMode;
5590
5595
  amount: number;
5591
5596
  currency: string;
5592
5597
  product_name: string;
@@ -7754,6 +7759,20 @@ type SubscriptionStatus = "active" | "paused" | "canceled" | "past_due" | "expir
7754
7759
  interface CreateSubscriptionRequest {
7755
7760
  /** 빌링키 ID (toss/stripe 필수, payapp 미사용 — payurl 모델) */
7756
7761
  billing_key_id?: string;
7762
+ /**
7763
+ * 구독 ID 를 직접 지정한다(선택). 미지정이면 서버가 `sub_<uuid>` 로 생성한다.
7764
+ *
7765
+ * 재시도 시 같은 값을 넘기면 최초 청구 orderID 가 결정적으로 만들어져 이중청구를 막는다 —
7766
+ * 네트워크 실패로 create 를 다시 호출해야 할 때 쓴다.
7767
+ */
7768
+ subscription_id?: string;
7769
+ /**
7770
+ * true 면 구독 생성 즉시 1회차를 청구한다(빌링키 모델). false(기본)면 다음 결제일부터 청구.
7771
+ * `trial_days` 가 있으면 즉시 청구하지 않는다(체험 종료 후 첫 청구).
7772
+ *
7773
+ * MoR(paddle/dodo)은 결제창에서 1회차를 받으므로 이 값을 쓰지 않는다.
7774
+ */
7775
+ start_now?: boolean;
7757
7776
  /** 플랜 이름 */
7758
7777
  plan_name: string;
7759
7778
  /** 플랜 설명 */
@@ -7920,6 +7939,34 @@ interface UpdateSubscriptionRequest {
7920
7939
  amount?: number;
7921
7940
  /** 메타데이터 */
7922
7941
  metadata?: Record<string, unknown>;
7942
+ /**
7943
+ * 다음 정기 결제일을 이 시점으로 옮깁니다 (RFC3339 또는 `YYYY-MM-DD` = 00:00 UTC).
7944
+ *
7945
+ * 요금제·금액은 그대로 두고 **청구 시점만** 옮기므로, 구독 중인 고객에게 기간을 얹어 줄 때
7946
+ * (기간권·선물 코드·CS 보상) 씁니다. 상대 일수로 미루려면
7947
+ * {@link SubscriptionAPI.postponeBilling} 이 낫습니다 — 현재 결제일을 PG 에서 읽어 더하므로
7948
+ * 갱신 직전 경쟁 조건을 서버가 처리합니다.
7949
+ *
7950
+ * ⚠️ 이 필드만 **서버 시크릿 키(`cb_sk_*`)가 필요합니다** — 무상 기간 지급이라 브라우저
7951
+ * 퍼블릭 키만으로는 403 입니다(다른 필드는 기존대로 퍼블릭 키로 수정 가능).
7952
+ *
7953
+ * 과거 시각은 400 `next_billing_date_invalid`,
7954
+ * 결제일을 옮길 수 없는 프로바이더(payapp/paypal)는 400 `next_billing_date_unsupported`.
7955
+ */
7956
+ next_billing_date?: string;
7957
+ }
7958
+ /**
7959
+ * 다음 결제일 미루기 요청 — `days` 와 `next_billing_date` 중 **정확히 하나**를 지정합니다.
7960
+ *
7961
+ * 둘 다 주거나 둘 다 비우면 400 `postpone_billing_input_invalid`.
7962
+ */
7963
+ interface PostponeBillingRequest {
7964
+ /** 미룰 일수 (1~3650). 예) 31일 선물권 → 다음 결제일이 31일 뒤로 밀림 */
7965
+ days?: number;
7966
+ /** 절대 날짜 지정 (RFC3339 또는 `YYYY-MM-DD` = 00:00 UTC). `days` 와 동시 지정 불가 */
7967
+ next_billing_date?: string;
7968
+ /** 기록용 사유 (선택, 200자) — 서버 로그에만 남습니다 */
7969
+ reason?: string;
7923
7970
  }
7924
7971
  interface PauseSubscriptionRequest {
7925
7972
  /** 일시정지 사유 */
@@ -8292,9 +8339,78 @@ declare class SubscriptionAPI {
8292
8339
  * plan_name: '엔터프라이즈 플랜',
8293
8340
  * amount: 29900
8294
8341
  * })
8342
+ *
8343
+ * // 다음 결제일을 특정 날짜로 옮기기 (기간권·보상)
8344
+ * await client.subscription.update(subscriptionId, {
8345
+ * next_billing_date: '2026-09-01',
8346
+ * })
8295
8347
  * ```
8348
+ *
8349
+ * @remarks
8350
+ * `next_billing_date` 는 PG 의 청구 스케줄까지 함께 옮깁니다. 그래서 결제일을 옮길 수 없는
8351
+ * 프로바이더는 조용히 무시되지 않고 400 `next_billing_date_unsupported` 로 거절됩니다
8352
+ * (로컬 기록만 미루면 PG 는 원래 날짜에 그대로 출금합니다). 지원표와 상세는
8353
+ * {@link postponeBilling} 참조.
8296
8354
  */
8297
8355
  update(subscriptionId: string, data: UpdateSubscriptionRequest): Promise<SubscriptionResponse>;
8356
+ /**
8357
+ * 다음 결제일 미루기 — 구독 중인 고객에게 **기간을 얹어 줍니다** (서버 전용)
8358
+ *
8359
+ * 요금제·금액은 그대로 두고 다음 정기 결제일만 옮깁니다. 기간권·선물 코드·CS 보상
8360
+ * ("불편을 드려 한 달 무료")처럼 "구독은 유지한 채 N일 공짜" 를 표현하는 표준 경로입니다.
8361
+ *
8362
+ * `days` 를 쓰면 **현재 결제일을 PG 에서 읽어** 더합니다 — 앱마다 "조회 → 더하기 → 쓰기" 를
8363
+ * 다시 구현하지 않아도 되고, 갱신 직전에 호출해도 방금 갱신된 주기 위에 얹힙니다.
8364
+ * 절대 날짜로 못박으려면 `next_billing_date` 를 쓰세요(둘 중 하나만 지정).
8365
+ *
8366
+ * ⚠️ **서버 시크릿 키(`cb_sk_*`)가 필요합니다.** 무상 기간 지급은 머천트 결정이라
8367
+ * 브라우저에 노출되는 퍼블릭 키만으로는 열려 있지 않습니다(그러면 클라이언트가 자기 구독을
8368
+ * 무한히 미룰 수 있습니다). 클라이언트를 `publicKey` + `secretKey` 로 초기화한 서버에서
8369
+ * 호출하세요 — 퍼블릭 키만 있으면 403 입니다.
8370
+ *
8371
+ * @param subscriptionId - 구독 ID
8372
+ * @param data - `days`(상대) 또는 `next_billing_date`(절대)
8373
+ * @returns 갱신된 구독 정보 (`next_billing_at` 이 옮겨진 값)
8374
+ *
8375
+ * @example
8376
+ * ```typescript
8377
+ * // 서버사이드: 선물 코드를 검증한 뒤 지급
8378
+ * const cb = new ConnectBase({
8379
+ * publicKey: process.env.CB_PUBLIC_KEY, // 앱 식별
8380
+ * secretKey: process.env.CB_SECRET_KEY, // 관리자 권한 (cb_sk_*)
8381
+ * })
8382
+ *
8383
+ * // 31일 선물권 등록 → 다음 결제일이 31일 뒤로
8384
+ * const sub = await cb.subscription.postponeBilling(subscriptionId, {
8385
+ * days: 31,
8386
+ * reason: 'gift-code:ABC123',
8387
+ * })
8388
+ * console.log(sub.next_billing_at)
8389
+ *
8390
+ * // 특정 날짜로 못박기
8391
+ * await cb.subscription.postponeBilling(subscriptionId, {
8392
+ * next_billing_date: '2026-09-01T00:00:00Z',
8393
+ * })
8394
+ * ```
8395
+ *
8396
+ * @remarks
8397
+ * **프로바이더 지원 범위** — 청구 스케줄의 주인이 다르기 때문에 갈립니다:
8398
+ * - **Dodo · Paddle (MoR)**: PG 의 결제일 변경 API 로 옮깁니다. Paddle 은 이동 구간에 대해
8399
+ * 청구도 크레딧도 만들지 않습니다(`do_not_bill`) — 미뤄 준 기간이 차액으로 상쇄되지 않습니다.
8400
+ * - **toss · stripe**: ConnectBase 스케줄러가 청구하므로 즉시 반영됩니다.
8401
+ * - **payapp · paypal**: PG 가 청구를 소유하면서 결제일 변경 수단을 주지 않아
8402
+ * 400 `next_billing_date_unsupported` 입니다(로컬만 미루면 원래 날짜에 출금되므로 거절).
8403
+ *
8404
+ * **거절되는 경우** — 조용한 no-op 대신 사유를 돌려줍니다:
8405
+ * - 과거 시각 → 400 `next_billing_date_invalid`
8406
+ * - 퍼블릭 키만으로 호출 → 403 (서버 시크릿 키 필요)
8407
+ * - `days` 와 `next_billing_date` 를 함께/둘 다 생략 → 400 `postpone_billing_input_invalid`
8408
+ * - active/trial 이 아닌 구독 → 409 `subscription_not_active`
8409
+ * - 해지 예약된 구독(`cancel()` 후) → 409 `subscription_scheduled_to_end`
8410
+ * (종료일이 정해져 있어 결제일을 미뤄도 기간이 늘지 않기 때문)
8411
+ * - MoR 최초 결제 전 → 409 `subscription_not_activated`
8412
+ */
8413
+ postponeBilling(subscriptionId: string, data: PostponeBillingRequest): Promise<SubscriptionResponse>;
8298
8414
  /**
8299
8415
  * 구독 일시정지
8300
8416
  *
@@ -10143,4 +10259,4 @@ declare class ConnectBase {
10143
10259
  updateConfig(config: Partial<ConnectBaseConfig>): void;
10144
10260
  }
10145
10261
 
10146
- export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, AIError, type AIErrorCode, 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 AppMemberDetail, type AppMemberIdentityDetail, type AppMemberIdentitySummary, type AppMemberList, type AppMemberListItem, type AppMemberProviderType, AppMembersAPI, 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 ListAppMembersOptions, 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 PaymentMode, 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 PublicKeyPaymentMode, 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, toAIError, toCreateRoomWire };
10262
+ export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, AIError, type AIErrorCode, 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 AppMemberDetail, type AppMemberIdentityDetail, type AppMemberIdentitySummary, type AppMemberList, type AppMemberListItem, type AppMemberProviderType, AppMembersAPI, 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 ListAppMembersOptions, 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 PaymentMode, 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 PostponeBillingRequest, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type ProrationMode, type PublicKeyItem, type PublicKeyPaymentMode, 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, toAIError, toCreateRoomWire };
package/dist/index.js CHANGED
@@ -9137,7 +9137,18 @@ var SubscriptionAPI = class {
9137
9137
  * plan_name: '엔터프라이즈 플랜',
9138
9138
  * amount: 29900
9139
9139
  * })
9140
+ *
9141
+ * // 다음 결제일을 특정 날짜로 옮기기 (기간권·보상)
9142
+ * await client.subscription.update(subscriptionId, {
9143
+ * next_billing_date: '2026-09-01',
9144
+ * })
9140
9145
  * ```
9146
+ *
9147
+ * @remarks
9148
+ * `next_billing_date` 는 PG 의 청구 스케줄까지 함께 옮깁니다. 그래서 결제일을 옮길 수 없는
9149
+ * 프로바이더는 조용히 무시되지 않고 400 `next_billing_date_unsupported` 로 거절됩니다
9150
+ * (로컬 기록만 미루면 PG 는 원래 날짜에 그대로 출금합니다). 지원표와 상세는
9151
+ * {@link postponeBilling} 참조.
9141
9152
  */
9142
9153
  async update(subscriptionId, data) {
9143
9154
  const prefix = this.getPublicPrefix();
@@ -9146,6 +9157,70 @@ var SubscriptionAPI = class {
9146
9157
  data
9147
9158
  );
9148
9159
  }
9160
+ /**
9161
+ * 다음 결제일 미루기 — 구독 중인 고객에게 **기간을 얹어 줍니다** (서버 전용)
9162
+ *
9163
+ * 요금제·금액은 그대로 두고 다음 정기 결제일만 옮깁니다. 기간권·선물 코드·CS 보상
9164
+ * ("불편을 드려 한 달 무료")처럼 "구독은 유지한 채 N일 공짜" 를 표현하는 표준 경로입니다.
9165
+ *
9166
+ * `days` 를 쓰면 **현재 결제일을 PG 에서 읽어** 더합니다 — 앱마다 "조회 → 더하기 → 쓰기" 를
9167
+ * 다시 구현하지 않아도 되고, 갱신 직전에 호출해도 방금 갱신된 주기 위에 얹힙니다.
9168
+ * 절대 날짜로 못박으려면 `next_billing_date` 를 쓰세요(둘 중 하나만 지정).
9169
+ *
9170
+ * ⚠️ **서버 시크릿 키(`cb_sk_*`)가 필요합니다.** 무상 기간 지급은 머천트 결정이라
9171
+ * 브라우저에 노출되는 퍼블릭 키만으로는 열려 있지 않습니다(그러면 클라이언트가 자기 구독을
9172
+ * 무한히 미룰 수 있습니다). 클라이언트를 `publicKey` + `secretKey` 로 초기화한 서버에서
9173
+ * 호출하세요 — 퍼블릭 키만 있으면 403 입니다.
9174
+ *
9175
+ * @param subscriptionId - 구독 ID
9176
+ * @param data - `days`(상대) 또는 `next_billing_date`(절대)
9177
+ * @returns 갱신된 구독 정보 (`next_billing_at` 이 옮겨진 값)
9178
+ *
9179
+ * @example
9180
+ * ```typescript
9181
+ * // 서버사이드: 선물 코드를 검증한 뒤 지급
9182
+ * const cb = new ConnectBase({
9183
+ * publicKey: process.env.CB_PUBLIC_KEY, // 앱 식별
9184
+ * secretKey: process.env.CB_SECRET_KEY, // 관리자 권한 (cb_sk_*)
9185
+ * })
9186
+ *
9187
+ * // 31일 선물권 등록 → 다음 결제일이 31일 뒤로
9188
+ * const sub = await cb.subscription.postponeBilling(subscriptionId, {
9189
+ * days: 31,
9190
+ * reason: 'gift-code:ABC123',
9191
+ * })
9192
+ * console.log(sub.next_billing_at)
9193
+ *
9194
+ * // 특정 날짜로 못박기
9195
+ * await cb.subscription.postponeBilling(subscriptionId, {
9196
+ * next_billing_date: '2026-09-01T00:00:00Z',
9197
+ * })
9198
+ * ```
9199
+ *
9200
+ * @remarks
9201
+ * **프로바이더 지원 범위** — 청구 스케줄의 주인이 다르기 때문에 갈립니다:
9202
+ * - **Dodo · Paddle (MoR)**: PG 의 결제일 변경 API 로 옮깁니다. Paddle 은 이동 구간에 대해
9203
+ * 청구도 크레딧도 만들지 않습니다(`do_not_bill`) — 미뤄 준 기간이 차액으로 상쇄되지 않습니다.
9204
+ * - **toss · stripe**: ConnectBase 스케줄러가 청구하므로 즉시 반영됩니다.
9205
+ * - **payapp · paypal**: PG 가 청구를 소유하면서 결제일 변경 수단을 주지 않아
9206
+ * 400 `next_billing_date_unsupported` 입니다(로컬만 미루면 원래 날짜에 출금되므로 거절).
9207
+ *
9208
+ * **거절되는 경우** — 조용한 no-op 대신 사유를 돌려줍니다:
9209
+ * - 과거 시각 → 400 `next_billing_date_invalid`
9210
+ * - 퍼블릭 키만으로 호출 → 403 (서버 시크릿 키 필요)
9211
+ * - `days` 와 `next_billing_date` 를 함께/둘 다 생략 → 400 `postpone_billing_input_invalid`
9212
+ * - active/trial 이 아닌 구독 → 409 `subscription_not_active`
9213
+ * - 해지 예약된 구독(`cancel()` 후) → 409 `subscription_scheduled_to_end`
9214
+ * (종료일이 정해져 있어 결제일을 미뤄도 기간이 늘지 않기 때문)
9215
+ * - MoR 최초 결제 전 → 409 `subscription_not_activated`
9216
+ */
9217
+ async postponeBilling(subscriptionId, data) {
9218
+ const prefix = this.getPublicPrefix();
9219
+ return this.http.post(
9220
+ `${prefix}/subscriptions/${subscriptionId}/postpone-billing`,
9221
+ data
9222
+ );
9223
+ }
9149
9224
  /**
9150
9225
  * 구독 일시정지
9151
9226
  *
package/dist/index.mjs CHANGED
@@ -9088,7 +9088,18 @@ var SubscriptionAPI = class {
9088
9088
  * plan_name: '엔터프라이즈 플랜',
9089
9089
  * amount: 29900
9090
9090
  * })
9091
+ *
9092
+ * // 다음 결제일을 특정 날짜로 옮기기 (기간권·보상)
9093
+ * await client.subscription.update(subscriptionId, {
9094
+ * next_billing_date: '2026-09-01',
9095
+ * })
9091
9096
  * ```
9097
+ *
9098
+ * @remarks
9099
+ * `next_billing_date` 는 PG 의 청구 스케줄까지 함께 옮깁니다. 그래서 결제일을 옮길 수 없는
9100
+ * 프로바이더는 조용히 무시되지 않고 400 `next_billing_date_unsupported` 로 거절됩니다
9101
+ * (로컬 기록만 미루면 PG 는 원래 날짜에 그대로 출금합니다). 지원표와 상세는
9102
+ * {@link postponeBilling} 참조.
9092
9103
  */
9093
9104
  async update(subscriptionId, data) {
9094
9105
  const prefix = this.getPublicPrefix();
@@ -9097,6 +9108,70 @@ var SubscriptionAPI = class {
9097
9108
  data
9098
9109
  );
9099
9110
  }
9111
+ /**
9112
+ * 다음 결제일 미루기 — 구독 중인 고객에게 **기간을 얹어 줍니다** (서버 전용)
9113
+ *
9114
+ * 요금제·금액은 그대로 두고 다음 정기 결제일만 옮깁니다. 기간권·선물 코드·CS 보상
9115
+ * ("불편을 드려 한 달 무료")처럼 "구독은 유지한 채 N일 공짜" 를 표현하는 표준 경로입니다.
9116
+ *
9117
+ * `days` 를 쓰면 **현재 결제일을 PG 에서 읽어** 더합니다 — 앱마다 "조회 → 더하기 → 쓰기" 를
9118
+ * 다시 구현하지 않아도 되고, 갱신 직전에 호출해도 방금 갱신된 주기 위에 얹힙니다.
9119
+ * 절대 날짜로 못박으려면 `next_billing_date` 를 쓰세요(둘 중 하나만 지정).
9120
+ *
9121
+ * ⚠️ **서버 시크릿 키(`cb_sk_*`)가 필요합니다.** 무상 기간 지급은 머천트 결정이라
9122
+ * 브라우저에 노출되는 퍼블릭 키만으로는 열려 있지 않습니다(그러면 클라이언트가 자기 구독을
9123
+ * 무한히 미룰 수 있습니다). 클라이언트를 `publicKey` + `secretKey` 로 초기화한 서버에서
9124
+ * 호출하세요 — 퍼블릭 키만 있으면 403 입니다.
9125
+ *
9126
+ * @param subscriptionId - 구독 ID
9127
+ * @param data - `days`(상대) 또는 `next_billing_date`(절대)
9128
+ * @returns 갱신된 구독 정보 (`next_billing_at` 이 옮겨진 값)
9129
+ *
9130
+ * @example
9131
+ * ```typescript
9132
+ * // 서버사이드: 선물 코드를 검증한 뒤 지급
9133
+ * const cb = new ConnectBase({
9134
+ * publicKey: process.env.CB_PUBLIC_KEY, // 앱 식별
9135
+ * secretKey: process.env.CB_SECRET_KEY, // 관리자 권한 (cb_sk_*)
9136
+ * })
9137
+ *
9138
+ * // 31일 선물권 등록 → 다음 결제일이 31일 뒤로
9139
+ * const sub = await cb.subscription.postponeBilling(subscriptionId, {
9140
+ * days: 31,
9141
+ * reason: 'gift-code:ABC123',
9142
+ * })
9143
+ * console.log(sub.next_billing_at)
9144
+ *
9145
+ * // 특정 날짜로 못박기
9146
+ * await cb.subscription.postponeBilling(subscriptionId, {
9147
+ * next_billing_date: '2026-09-01T00:00:00Z',
9148
+ * })
9149
+ * ```
9150
+ *
9151
+ * @remarks
9152
+ * **프로바이더 지원 범위** — 청구 스케줄의 주인이 다르기 때문에 갈립니다:
9153
+ * - **Dodo · Paddle (MoR)**: PG 의 결제일 변경 API 로 옮깁니다. Paddle 은 이동 구간에 대해
9154
+ * 청구도 크레딧도 만들지 않습니다(`do_not_bill`) — 미뤄 준 기간이 차액으로 상쇄되지 않습니다.
9155
+ * - **toss · stripe**: ConnectBase 스케줄러가 청구하므로 즉시 반영됩니다.
9156
+ * - **payapp · paypal**: PG 가 청구를 소유하면서 결제일 변경 수단을 주지 않아
9157
+ * 400 `next_billing_date_unsupported` 입니다(로컬만 미루면 원래 날짜에 출금되므로 거절).
9158
+ *
9159
+ * **거절되는 경우** — 조용한 no-op 대신 사유를 돌려줍니다:
9160
+ * - 과거 시각 → 400 `next_billing_date_invalid`
9161
+ * - 퍼블릭 키만으로 호출 → 403 (서버 시크릿 키 필요)
9162
+ * - `days` 와 `next_billing_date` 를 함께/둘 다 생략 → 400 `postpone_billing_input_invalid`
9163
+ * - active/trial 이 아닌 구독 → 409 `subscription_not_active`
9164
+ * - 해지 예약된 구독(`cancel()` 후) → 409 `subscription_scheduled_to_end`
9165
+ * (종료일이 정해져 있어 결제일을 미뤄도 기간이 늘지 않기 때문)
9166
+ * - MoR 최초 결제 전 → 409 `subscription_not_activated`
9167
+ */
9168
+ async postponeBilling(subscriptionId, data) {
9169
+ const prefix = this.getPublicPrefix();
9170
+ return this.http.post(
9171
+ `${prefix}/subscriptions/${subscriptionId}/postpone-billing`,
9172
+ data
9173
+ );
9174
+ }
9100
9175
  /**
9101
9176
  * 구독 일시정지
9102
9177
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "connectbase-client",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "description": "Connect Base JavaScript/TypeScript SDK for browser and Node.js",
5
5
  "repository": {
6
6
  "type": "git",