Something went wrong. Try again.
Schedule posts and reposts to Bluesky (and other PDSes) with Cloudflare workers. skyscheduler.work
scheduling social-media cloudflare bsky service cloudflare-workers bsky-tool bluesky
Something went wrong. Try again.
884 B · 29 lines
TypeScript
at main
1234567891011121314151617181920212223242526272829import * as z from "zod/v4";import { atProtoPostURI, atProtoRecordURI } from "./regexCases";
const BaseRecordSchema = z.object({ cid: z.string().trim() .min(1, "record too small") .nonoptional("content id data must be provided"),});
export const AnyRecordSchema = z.object({ ...BaseRecordSchema.shape, uri: z.string().trim() .min(1, "record too small") .regex(atProtoRecordURI, "record is invalid") .nonoptional("record uri must be provided"),});
export const PostRecordSchema = z.object({ ...BaseRecordSchema.shape, uri: z.string().trim() .min(1, "record too small") .regex(atProtoPostURI, "post record is invalid") .nonoptional("record uri must be provided"),});
export const StrongRecordSchema = z.object({ ...AnyRecordSchema.shape, $type: z.literal("com.atproto.repo.strongRef").nonoptional("missing strong record typing")});