feat: add credential routes and mcp manifest

This commit is contained in:
bipproduction
2025-10-08 14:17:06 +08:00
parent 94a8d78fe3
commit 2366710ccd
15 changed files with 801 additions and 18 deletions

View File

@@ -0,0 +1,46 @@
import Elysia, { t } from "elysia";
import { prisma } from "../lib/prisma";
const CredentialRoute = new Elysia({
prefix: "/credential"
})
.post("/create", async (ctx) => {
const { name, value } = ctx.body
const create = await prisma.credential.create({
data: {
name,
value
}
})
return {
message: "success",
create
}
}, {
body: t.Object({
name: t.String(),
value: t.String(),
})
})
.get("/list", async (ctx) => {
const list = await prisma.credential.findMany()
return {
message: "success",
list
}
})
.delete("/rm", async (ctx) => {
const { id } = ctx.body
const rm = await prisma.credential.delete({
where: {
id: id
}
})
}, {
body: t.Object({
id: t.String()
})
})
export default CredentialRoute