export type GetApiVerifyPublicKeyKidOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Verify public key * * GET /verify/public_key/{kid} */ export const getApiVerifyPublicKeyKid = async (options?: GetApiVerifyPublicKeyKidOptions) => { const {baseUrl = "https://go.urbanairship.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/x-pem-file") const url = `${baseUrl.replace(/\/+$/, '')}/verify/public_key/${encodeURIComponent(String(args.kid))}${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() };