export type CreateApiTokenTokenReactionsPathwaysArgs = {token: string, resource?: ('TOTAL' | 'UNIPROT' | 'ENSEMBL' | 'CHEBI' | 'IUPHAR' | 'MIRBASE' | 'NCBI_PROTEIN' | 'EMBL' | 'COMPOUND' | 'PUBCHEM_COMPOUND') | undefined, pValue?: number | undefined, includeDisease?: boolean | undefined, min?: number | undefined, max?: number | undefined, importableOnly?: boolean | undefined, body: BodyInit}; export type CreateApiTokenTokenReactionsPathwaysOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Returns the reaction ids of the pathway ids sent by post that are present in the original result * * POST /token/{token}/reactions/pathways */ export const createApiTokenTokenReactionsPathways = async (args: CreateApiTokenTokenReactionsPathwaysArgs, options: CreateApiTokenTokenReactionsPathwaysOptions) => { 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)) if (args.pValue != null) query.append("pValue", String(args.pValue)) if (args.includeDisease != null) query.append("includeDisease", String(args.includeDisease)) if (args.min != null) query.append("min", String(args.min)) if (args.max != null) query.append("max", String(args.max)) if (args.importableOnly != null) query.append("importableOnly", String(args.importableOnly)) const url = `${baseUrl.replace(/\/+$/, '')}/token/${encodeURIComponent(String(args.token))}/reactions/pathways${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 };