feat: implement JMAP push notification handling and subscription management

This commit is contained in:
Linus Rath
2026-04-20 08:26:09 +02:00
parent bc3b923945
commit 15006086d2
8 changed files with 415 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
export function isValidSubscriptionId(id: unknown): id is string {
return typeof id === 'string' && /^[A-Za-z0-9_-]{8,128}$/.test(id);
}
export function isValidExpoPushToken(token: unknown): token is string {
if (typeof token !== 'string') return false;
// Expo managed tokens, or raw FCM/APNs tokens for bare workflows.
return (
/^ExponentPushToken\[[A-Za-z0-9_-]+\]$/.test(token) ||
/^[A-Za-z0-9:_-]{40,250}$/.test(token)
);
}