Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download server/_core/systemRouter.ts from emresar/aimusic-attribution: direct link, hf CLI and curl.
- Browser
- Download file 709 Bytes
-
https://huggingface.co/spaces/emresar/aimusic-attribution/resolve/main/server/_core/systemRouter.ts
- Command line
-
hf download hf://spaces/emresar/aimusic-attribution/server/_core/systemRouter.ts
-
curl -L -o systemRouter.ts https://huggingface.co/spaces/emresar/aimusic-attribution/resolve/main/server/_core/systemRouter.ts
709 Bytes
| import { z } from "zod"; | |
| import { notifyOwner } from "./notification"; | |
| import { adminProcedure, publicProcedure, router } from "./trpc"; | |
| export const systemRouter = router({ | |
| health: publicProcedure | |
| .input( | |
| z.object({ | |
| timestamp: z.number().min(0, "timestamp cannot be negative"), | |
| }) | |
| ) | |
| .query(() => ({ | |
| ok: true, | |
| })), | |
| notifyOwner: adminProcedure | |
| .input( | |
| z.object({ | |
| title: z.string().min(1, "title is required"), | |
| content: z.string().min(1, "content is required"), | |
| }) | |
| ) | |
| .mutation(async ({ input }) => { | |
| const delivered = await notifyOwner(input); | |
| return { | |
| success: delivered, | |
| } as const; | |
| }), | |
| }); | |