export type GetApiPhoneIntelligenceV1Args = {phone: string}; export type GetApiPhoneIntelligenceV1Options = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get detailed intelligence about a phone number including carrier, line type, location, risk score, and breach data. * * GET /phone-intelligence/v1 */ export const getApiPhoneIntelligenceV1 = async (args: GetApiPhoneIntelligenceV1Args, options?: GetApiPhoneIntelligenceV1Options) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.phone != null) query.append("phone", String(args.phone)) const url = `${baseUrl.replace(/\/+$/, '')}/phone-intelligence/v1${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 };