Schedule posts to Bluesky with Cloudflare workers. skyscheduler.work
cf tool bsky-tool cloudflare bluesky schedule bsky service social-media cloudflare-workers

more silliness

make more things optional.

We're pretty much reaching the peak...

+10 -7
+2 -2
src/types.d.ts
··· 12 12 type SignupConfigSettings = { 13 13 use_captcha: boolean; 14 14 invite_only: boolean; 15 - invite_thread: string; 15 + invite_thread?: string; 16 16 } 17 17 18 18 type RedirectConfigSettings = { ··· 22 22 23 23 type R2ConfigSettings = { 24 24 auto_prune: boolean; 25 - prune_days: number; 25 + prune_days?: number; 26 26 } 27 27 28 28 type QueueConfigSettings = {
+3
src/utils/db/file.ts
··· 40 40 console.error("could not get all abandoned media, db was null"); 41 41 return []; 42 42 } 43 + if (c.env.R2_SETTINGS.prune_days === undefined) { 44 + return []; 45 + } 43 46 const numDaysAgo = daysAgo(c.env.R2_SETTINGS.prune_days); 44 47 45 48 const results = await db.select().from(mediaFiles)
+5 -5
src/utils/inviteKeys.ts
··· 2 2 import humanId from "human-id"; 3 3 import has from "just-has"; 4 4 5 - export const isUsingInviteKeys = (c: Context) => { 5 + export const isUsingInviteKeys = (c: Context): boolean => { 6 6 return has(c.env, "INVITE_POOL") && c.env.SIGNUP_SETTINGS.invite_only; 7 7 } 8 8 9 - export const getInviteThread = (c: Context) => { 10 - return c.env.SIGNUP_SETTINGS.invite_thread; 9 + export const getInviteThread = (c: Context): string => { 10 + return c.env.SIGNUP_SETTINGS.invite_thread || ""; 11 11 } 12 12 13 - export const doesInviteKeyHaveValues = async (c: Context, inviteKey: string|undefined) => { 13 + export const doesInviteKeyHaveValues = async (c: Context, inviteKey: string|undefined): Promise<boolean> => { 14 14 if (isUsingInviteKeys(c)) { 15 15 if (inviteKey === undefined) 16 16 return false; ··· 71 71 } 72 72 } 73 73 74 - export const makeInviteKey = (c: Context) => { 74 + export const makeInviteKey = (c: Context): string|null => { 75 75 if (!isUsingInviteKeys(c)) { 76 76 return null; 77 77 }