Initial commit

This commit is contained in:
Alejandro Martinez
2026-02-12 02:04:10 +01:00
commit f09af719cf
13433 changed files with 2193445 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
import { d as deleteSkill, g as getSkill, u as updateSkill } from '../../../chunks/skills_COWfD5oy.mjs';
export { renderers } from '../../../renderers.mjs';
const GET = async ({ params }) => {
const skill = await getSkill(params.slug);
if (!skill) {
return new Response("Not found", { status: 404 });
}
return new Response(skill.raw, {
headers: { "Content-Type": "text/markdown; charset=utf-8" }
});
};
const PUT = async ({ params, request }) => {
let body;
try {
body = await request.json();
} catch {
return new Response(JSON.stringify({ error: "Invalid JSON" }), {
status: 400,
headers: { "Content-Type": "application/json" }
});
}
if (!body.content) {
return new Response(JSON.stringify({ error: "content is required" }), {
status: 400,
headers: { "Content-Type": "application/json" }
});
}
try {
const skill = await updateSkill(params.slug, body.content);
return new Response(JSON.stringify(skill), {
headers: { "Content-Type": "application/json" }
});
} catch (err) {
const message = err instanceof Error ? err.message : "Unknown error";
if (message.includes("not found")) {
return new Response(JSON.stringify({ error: message }), {
status: 404,
headers: { "Content-Type": "application/json" }
});
}
return new Response(JSON.stringify({ error: message }), {
status: 500,
headers: { "Content-Type": "application/json" }
});
}
};
const DELETE = async ({ params }) => {
try {
await deleteSkill(params.slug);
return new Response(null, { status: 204 });
} catch (err) {
const message = err instanceof Error ? err.message : "Unknown error";
if (message.includes("not found")) {
return new Response(JSON.stringify({ error: message }), {
status: 404,
headers: { "Content-Type": "application/json" }
});
}
return new Response(JSON.stringify({ error: message }), {
status: 500,
headers: { "Content-Type": "application/json" }
});
}
};
const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
DELETE,
GET,
PUT
}, Symbol.toStringTag, { value: 'Module' }));
const page = () => _page;
export { page };