import{t as e}from"./got-BBDj7u1e.mjs";import{t}from"./rss-parser-CtkSf1Et.mjs";import{t as n}from"./utils-B-gmyV13.mjs";const r={path:`/:configId/official/:path{.+}`,categories:[`bbs`],example:`/discourse/0/official/latest`,parameters:{configId:`Environment variable configuration id, see above`,path:"Discourse RSS path between `domain` and `.rss`. All supported Rss path can be found in [https://meta.discourse.org/t/finding-discourse-rss-feeds/264134](https://meta.discourse.org/t/finding-discourse-rss-feeds/264134). For example: the path of [https://meta.discourse.org/top/all.rss](https://meta.discourse.org/top/all.rss) is `top/all`."},features:{requireConfig:[{name:`DISCOURSE_CONFIG_*`,description:`Configure the Discourse environment variables referring to [https://docs.rsshub.app/deploy/config#discourse](https://docs.rsshub.app/deploy/config#discourse).`}],requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`Official RSS`,maintainers:[`Raikyou`,`dzx-dzx`],handler:i};async function i(r){let{link:i,key:a}=n(r),o=`${i}/${r.req.param(`path`)}.rss`,s=await t.parseString((await e(o,{headers:{"User-Api-Key":a}})).data);return s.items=s.items.map(e=>({description:e.content,author:e.creator,...e})),{item:s.items,...s}}export{r as route};