export type CreateApiCardsActivationTokenActivateWithTokenArgs = {activationToken: string}; export type CreateApiCardsActivationTokenActivateWithTokenOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Activate card by activation token * * POST /cards/{activationToken}/activate_with_token */ export const createApiCardsActivationTokenActivateWithToken = async (args: CreateApiCardsActivationTokenActivateWithTokenArgs, options?: CreateApiCardsActivationTokenActivateWithTokenOptions) => { const {baseUrl = "https://api.kisi.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/cards/${encodeURIComponent(String(args.activationToken))}/activate_with_token${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };