feat(server): deliver push without a Firebase project

Every notification depended on Firebase Cloud Messaging, so a missing
Firebase project, which is the current state, meant no notification could be
delivered on any platform. Web Push and token-based Apple Push are now first
class transports alongside FCM, chosen per registered device, and a scheduled
Cloudflare Worker drain retries an outbox so a provider outage delays rather
than drops a message.
This commit is contained in:
Yun Chan 2026-09-16 23:24:44 +09:00
parent 5aa268970a
commit bb0e54dcee
13 changed files with 1412 additions and 41 deletions

View file

@ -3,6 +3,7 @@ import {
isServiceRoleAuthorization,
isServiceRoleApiKey,
parsePushRequest,
providerIsSupported,
PushContractError,
readFcmConfig,
sendFcmMessage,
@ -32,6 +33,12 @@ const fcmConfig = {
tokenUri: 'https://oauth2.googleapis.com/token',
}
Deno.test('push providers fcm, webpush, and apns are supported', () => {
assert(providerIsSupported('fcm'), 'fcm must be supported')
assert(providerIsSupported('webpush'), 'webpush must be supported')
assert(providerIsSupported('apns'), 'apns must be supported')
})
Deno.test('push input accepts only event_type and resource_id', () => {
const parsed = parsePushRequest({
event_type: 'transcription.completed',