mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-20 01:12:15 +00:00
fix(opencode): remove redundant push pair QR endpoint
This commit is contained in:
parent
a8d5b14d1a
commit
381afd6e10
1 changed files with 0 additions and 35 deletions
|
|
@ -56,11 +56,6 @@ async function pushPairQRCode(payload: z.infer<typeof PushPairPayload>) {
|
|||
return QRCode.toDataURL(pushPairLink(payload), pushPairQROptions)
|
||||
}
|
||||
|
||||
async function pushPairQRCodePNG(payload: z.infer<typeof PushPairPayload>) {
|
||||
const data = await pushPairQRCode(payload)
|
||||
return Buffer.from(data.replace(/^data:image\/png;base64,/, ""), "base64")
|
||||
}
|
||||
|
||||
const ConsoleOrgOption = z.object({
|
||||
accountID: z.string(),
|
||||
accountEmail: z.string(),
|
||||
|
|
@ -454,36 +449,6 @@ export const ExperimentalRoutes = lazy(() =>
|
|||
})
|
||||
},
|
||||
)
|
||||
.get(
|
||||
"/push/pair/qr",
|
||||
describeRoute({
|
||||
summary: "Get push relay pairing QR image",
|
||||
description: "Render the active push relay pairing QR code as a PNG image.",
|
||||
operationId: "experimental.push.pair.qr",
|
||||
responses: {
|
||||
200: {
|
||||
description: "Push relay pairing QR image",
|
||||
content: {
|
||||
"image/png": {
|
||||
schema: { type: "string", format: "binary" } as any,
|
||||
},
|
||||
},
|
||||
},
|
||||
404: {
|
||||
description: "Push relay pairing is not enabled",
|
||||
},
|
||||
},
|
||||
}),
|
||||
async (c) => {
|
||||
const pair = PushRelay.pair()
|
||||
if (!pair) {
|
||||
return c.text("Push pairing is not enabled", 404)
|
||||
}
|
||||
|
||||
c.header("Content-Type", "image/png")
|
||||
return c.body(await pushPairQRCodePNG(pair))
|
||||
},
|
||||
)
|
||||
.get(
|
||||
"/push",
|
||||
describeRoute({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue