export type GetApiV1TransfersTransferIdUrlsVerifyArgs = {'Auth-Token': string, 'App-ID': string, transfer_id: string, user_id: string, signature: string}; export type GetApiV1TransfersTransferIdUrlsVerifyOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Verifies the signature of a url * * GET /v1/transfers/{transfer_id}/urls/verify/ */ export const getApiV1TransfersTransferIdUrlsVerify = async (args: GetApiV1TransfersTransferIdUrlsVerifyArgs, options: GetApiV1TransfersTransferIdUrlsVerifyOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Auth-Token'] != null) headers.set("Auth-Token", String(args['Auth-Token'])) if (args['App-ID'] != null) headers.set("App-ID", String(args['App-ID'])) if (args.user_id != null) query.append("user_id", String(args.user_id)) if (args.signature != null) query.append("signature", String(args.signature)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/transfers/${encodeURIComponent(String(args.transfer_id))}/urls/verify/${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 undefined };