A Cloudflare Worker which works in conjunction with https://github.com/indexxing/bsky-alt-text
1import { DateTime, Str } from "chanfana"; 2import type { Context } from "hono"; 3import { z } from "zod"; 4import type { GoogleGenAI } from "@google/genai"; 5 6export type AppContext = Context<{ Bindings: Env; Variables: Variables }>; 7 8export interface Env { 9 // Environmental Variables 10 MAX_ALT_TEXT_LENGTH: number; 11 ABSOLUTE_MAX_LENGTH: number; 12 MAX_DIRECT_BLOB_SIZE: number; 13 14 // Secrets 15 AUTH_TOKEN: string; 16 GEMINI_API_KEY: string; 17} 18 19export type Variables = { 20 gemini: GoogleGenAI; 21}; 22 23export const Task = z.object({ 24 name: Str({ example: "lorem" }), 25 slug: Str(), 26 description: Str({ required: false }), 27 completed: z.boolean().default(false), 28 due_date: DateTime(), 29});