export type CreateApiAccountJwtVerifyArgs = {body: {token: string}}; export type CreateApiAccountJwtVerifyOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Takes a token and indicates if it is valid. This view provides no information about a token's fitness for a particular use. * * POST /account/jwt/verify/ */ export const createApiAccountJwtVerify = async (args: CreateApiAccountJwtVerifyArgs, options?: CreateApiAccountJwtVerifyOptions) => { const {baseUrl = "https://api.ganje.net/v1.1", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/account/jwt/verify/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };