UNPKG

camstreamerlib

Version:

Helper library for CamStreamer ACAP applications.

18 lines (17 loc) 640 B
import z from 'zod'; import { streamCommonSchema } from './streamCommonTypes'; const timelinePostSchema = z.object({ postLocation: z.literal('timeline'), streamPrivacy: z.union([z.literal('public'), z.literal('friends'), z.literal('only_me')]), }); const pagePostSchema = z.object({ postLocation: z.literal('page'), page: z.string(), }); export const facebookSchema = streamCommonSchema.extend({ platform: z.literal('facebook'), description: z.string().optional(), deleteAfterEnd: z.boolean(), countdown: z.boolean(), post: z.discriminatedUnion('postLocation', [timelinePostSchema, pagePostSchema]), });