export type GetApiApiGraphchainShortestpathArgs = {v1Chain: string, v1SdoId: string, v2Chain: string, v2SdoId: string, direction: string, minDepth: number, maxDepth: number, whileStmt?: string | undefined, optimizedShortestPath?: boolean | undefined}; export type GetApiApiGraphchainShortestpathOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Allowed user roles:


Finds the shortest path (0..1) or shortest paths (0..*) between SDO IDs (v1 chain/id * * GET /api/graphchain/shortestpath */ export const getApiApiGraphchainShortestpath = async (args: GetApiApiGraphchainShortestpathArgs, options?: GetApiApiGraphchainShortestpathOptions) => { const {baseUrl = "https://api.burstiq.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.v1Chain != null) query.append("v1Chain", String(args.v1Chain)) if (args.v1SdoId != null) query.append("v1SdoId", String(args.v1SdoId)) if (args.v2Chain != null) query.append("v2Chain", String(args.v2Chain)) if (args.v2SdoId != null) query.append("v2SdoId", String(args.v2SdoId)) if (args.direction != null) query.append("direction", String(args.direction)) if (args.minDepth != null) query.append("minDepth", String(args.minDepth)) if (args.maxDepth != null) query.append("maxDepth", String(args.maxDepth)) if (args.whileStmt != null) query.append("whileStmt", String(args.whileStmt)) if (args.optimizedShortestPath != null) query.append("optimizedShortestPath", String(args.optimizedShortestPath)) const url = `${baseUrl.replace(/\/+$/, '')}/api/graphchain/shortestpath${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };