Spaces:
Paused
Paused
Download server/src/validators/postiz.ts from testfirela/paperclip-app: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/spaces/testfirela/paperclip-app/resolve/main/server/src/validators/postiz.ts
- Command line
-
hf download hf://spaces/testfirela/paperclip-app/server/src/validators/postiz.ts
-
curl -L -o postiz.ts https://huggingface.co/spaces/testfirela/paperclip-app/resolve/main/server/src/validators/postiz.ts
1.2 kB
| import { z } from "zod"; | |
| import type { Request } from "express"; | |
| import type { PostizPostInput } from "../services/postiz.js"; | |
| export const PostizSimplePublishRequestSchema = z.object({ | |
| platforms: z.array(z.string()).min(1), | |
| content: z.string().min(1), | |
| media: z.array(z.string()).optional(), | |
| adaptContent: z.boolean().optional(), | |
| splitContent: z.boolean().optional(), | |
| scheduledAt: z.string().optional(), | |
| }); | |
| export type PostizSimplePublishRequest = z.infer<typeof PostizSimplePublishRequestSchema>; | |
| export const PostizFullPublishRequestSchema = z.object({ | |
| type: z.enum(["now", "schedule", "draft"]).optional(), | |
| scheduledAt: z.string().optional(), | |
| posts: z.array( | |
| z.object({ | |
| integrationId: z.string(), | |
| platform: z.string(), | |
| content: z.string(), | |
| media: z.array(z.string()).optional(), | |
| }) | |
| ).min(1), | |
| }); | |
| export type PostizFullPublishRequest = z.infer<typeof PostizFullPublishRequestSchema>; | |
| export const PostizValidateRequestSchema = z.object({ | |
| platforms: z.array(z.string()).min(1), | |
| content: z.string().min(1), | |
| media: z.array(z.string()).optional(), | |
| }); | |
| export type PostizValidateRequest = z.infer<typeof PostizValidateRequestSchema>; | |