import { apiPost } from '@/lib/http'
import type { TencentBrowserSessionData } from '@/types/tencent/session'

export interface TencentBrowserRedeemPayload {
  code: string
  maxAttempts?: number
}

export function redeemTencentBrowserSession(
  sessionId: string,
  payload: TencentBrowserRedeemPayload,
) {
  return apiPost<TencentBrowserSessionData>(
    `/api/v1/tencent/browser/session/${sessionId}/redeem`,
    payload,
  )
}
