This commit is contained in:
Dax Raad 2025-11-18 11:46:27 -05:00 committed by Adam
parent df756b9f89
commit 29098d7d74
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75

View file

@ -0,0 +1,19 @@
import { fn } from "@opencode-ai/util/fn"
import z from "zod"
import { Storage } from "./storage"
export namespace Share {
export const Info = z.object({
id: z.string(),
secret: z.string(),
})
export type Info = z.infer<typeof Info>
export const create = fn(Info.pick({ id: true }), async (body) => {
const info: Info = {
id: body.id,
secret: crypto.randomUUID(),
}
await Storage.write(["share", info.id], info)
})
}