Spaces:
Paused
Paused
| 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>; | |