5 Commits

Author SHA1 Message Date
Matt Isenhower
66602492a6 Merge remote-tracking branch 'origin/main' into cloudflare-workers 2026-11-15 14:44:33 -08:00
Matt Isenhower
0e4b5af455 Check the Buffer channel once a day instead of every run
Every Buffer API request counts against the quota, queries included. The
Free plan allows 2,000 requests per 30 days across both channels, and the
per-run channel check made up about 26 of the roughly 67 requests a day.

A successful check is now kept in a ValueCache for 24 hours, keyed by
channel ID, so each channel is checked about once a day. Failed checks are
not cached, and a channel locked within the day still fails at createPost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 14:34:25 -08:00
Matt Isenhower
8a02e2bfdc Make the shared backend code run in Cloudflare Workers
Replace the remaining Node-only dependencies so the updaters and social
posters bundle and run in workerd, while the Node runner keeps working:

- Replace nxapi with app/splatnet/coral.mjs (fetch + WebCrypto), aligned
  with nxapi 1.6.1-next.257: znca compatibility 3.5.0, the current client
  version, and the slimmer Login parameter. Use one znca-api client per
  Nintendo account, since its token binds to the first account it serves.
  Cache the remote config in private storage instead of restarting daily.
  Sessions cached by the nxapi package trigger a fresh login.
- Convert images through #image-converter: sharp in Node, the Images
  binding in Workers. Read Bluesky aspect ratios from the PNG header.
- Replace twitter-api-v2 with OAuth 1.0a signed fetch; TwitterClient now
  only updates the seasonal X profile (posts go through Buffer).
- Load avatars through #avatars (bundled as Data modules in Workers) and
  keep the local Chrome driver out of Worker bundles via
  #local-screenshot-driver.
- prefixedConsole forwards to the global console; shared code reports to
  Sentry through @sentry/core.

Verified live: full credential refresh for all four regions in Node, and
the complete Coral → bullet token → GraphQL chain for EU inside workerd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 16:51:54 -08:00
Matt Isenhower
341601d075 Simplify social account configuration and shared time messages 2026-10-17 13:17:59 -07:00
Matt Isenhower
8f315aaf92 Add credential-enabled Buffer driver for X posting 2026-10-17 10:57:46 -07:00