import{t as e}from"./config-BYRrjYC5.mjs";import{t}from"./got-BBDj7u1e.mjs";import{t as n}from"./eventapi-Ch-cOYMU.mjs";const r={path:`/user_event/:username/:types?`,categories:[`programming`],example:`/github/user_event/mslxl`,view:5,parameters:{username:`Username`,types:{description:`Event types to include, comma separated`,default:`all`,options:[{label:`All events`,value:`all`},{label:`Create events`,value:`create`},{label:`Delete events`,value:`delete`},{label:`Fork events`,value:`fork`},{label:`Issue create events`,value:`issue`},{label:`Issue comment events`,value:`issuecomm`},{label:`Member events`,value:`member`},{label:`Pull request events`,value:`pr`},{label:`Pull request review comment events`,value:`prcomm`},{label:`Pull request review events`,value:`prrev`},{label:`Public events`,value:`public`},{label:`Push events`,value:`push`},{label:`Release events`,value:`release`},{label:`Watch events (stars)`,value:`star`},{label:`Wiki item create or update events`,value:`wiki`},{label:`Commit comment events`,value:`cmcomm`},{label:`Discussion events`,value:`discussion`}]}},features:{requireConfig:[{name:`GITHUB_ACCESS_TOKEN`,optional:!0,description:`GitHub access token to access private repository events`}],requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`github.com/:username`],target:`/user_event/:username`}],name:`User Event`,maintainers:[`mslxl`],handler:i};async function i(r){let i=r.req.param(`username`),a=r.req.param(`types`)||`all`,o=e.github&&e.github.access_token,s={};o&&(s.Authorization=`token ${e.github.access_token}`);let c=n(a,(await t({method:`get`,url:`https://api.github.com/users/${i}/events`+(o?``:`/public`),headers:s,searchParams:{per_page:100}})).data);return{title:`${i} GitHub User Feed - ${a===`all`?`All Events`:`Events: ${a}`}`,link:`https://github.com/${i}`,description:`GitHub events received by ${i}${a===`all`?``:` (filtered: ${a})`}${o?` - includes private events`:` - public events only`}`,item:c}}export{r as route};