/** * HTTP client for the Philanthropy News Digest "RFPs" RSS feed. * * Kept deliberately thin — a plain `fetch` returning the raw XML body. * Parsing/normalization lives in `normalize.ts` so it can be unit tested * against fixture strings without a network call. */ /** Default PND RFP feed URL; overridable via `PND_RFP_FEED_URL` at the call site. */ export const PND_RFP_FEED_URL = 'https://philanthropynewsdigest.org/feeds/rfps.rss'; /** * Fetches the raw RSS XML body from the PND RFP feed. * * Throws on any non-2xx response so the caller's step-level retry policy * (see `ingest-pnd-rss.ts`) can kick in. */ export async function fetchPndRfpFeed(feedUrl: string): Promise { const response = await fetch(feedUrl); if (!response.ok) { throw new Error( `fetchPndRfpFeed: ${feedUrl} responded with ${response.status} ${response.statusText}`, ); } return response.text(); }