2025-02-26 23:58:49 +01:00
|
|
|
import {type Handler} from "@netlify/functions";
|
|
|
|
import { type KitsudevInfo } from "#Infos/Coding/KitsuDev.js";
|
|
|
|
|
|
|
|
const handler: Handler = async () => {
|
2025-03-02 14:37:13 +01:00
|
|
|
const kitsudev = await (await fetch("https://kitsunes.dev/api/v1/users/Taevas/activities/feeds?limit=1")).json() as [{
|
2025-02-26 23:58:49 +01:00
|
|
|
repo: {
|
|
|
|
full_name: string
|
|
|
|
html_url: string
|
|
|
|
}
|
|
|
|
created: string
|
2025-03-02 14:37:13 +01:00
|
|
|
}];
|
2025-02-26 23:58:49 +01:00
|
|
|
|
|
|
|
const info: KitsudevInfo = {
|
|
|
|
name: kitsudev[0].repo.full_name,
|
|
|
|
url: kitsudev[0].repo.html_url,
|
|
|
|
date: kitsudev[0].created
|
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
statusCode: 200,
|
|
|
|
body: JSON.stringify(info),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export {handler};
|