export type CreateApiTokenTokenFoundAllArgs = {token: string, resource?: ('TOTAL' | 'UNIPROT' | 'ENSEMBL' | 'CHEBI' | 'IUPHAR' | 'MIRBASE' | 'NCBI_PROTEIN' | 'EMBL' | 'COMPOUND' | 'PUBCHEM_COMPOUND') | undefined, body: BodyInit}; export type CreateApiTokenTokenFoundAllOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Returns a summary of the contained identifiers and interactors for each requested pathway and a given token * * POST /token/{token}/found/all */ export const createApiTokenTokenFoundAll = async (args: CreateApiTokenTokenFoundAllArgs, options: CreateApiTokenTokenFoundAllOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "text/plain") if (args.resource != null) query.append("resource", String(args.resource)) const url = `${baseUrl.replace(/\/+$/, '')}/token/${encodeURIComponent(String(args.token))}/found/all${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };