Template
1
0

feat: add procedure to relay

This commit is contained in:
2025-08-18 01:05:23 +02:00
parent 81108e0a60
commit d322138502
12 changed files with 346 additions and 48 deletions

22
api/procedures/event.ts Normal file
View File

@@ -0,0 +1,22 @@
import { procedure } from "@spec/relay/mod.ts";
import z from "zod";
const EventSchema = z.object({
id: z.uuid(),
stream: z.uuid(),
type: z.string(),
data: z.any(),
meta: z.any(),
recorded: z.string(),
created: z.string(),
});
export default procedure
.method("event")
.access("public")
.params(EventSchema)
.response(z.uuid())
.handle(async (event) => {
console.log(event);
return crypto.randomUUID();
});