Add web push notifications for new inbox items

This commit is contained in:
Ian Gulliver
2026-10-14 21:25:01 -07:00
parent 01c60d6618
commit 8e4c40eb5f
40 changed files with 1724 additions and 202 deletions
+163
View File
@@ -20,6 +20,56 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/me/notifications": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
/** @description Sets which inbox items the calling user is sent push notifications for. */
put: operations["updateNotificationPrefs"];
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/me/push-subscriptions": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/** @description Registers a browser's push subscription for the calling user. Registering an endpoint again replaces it. */
post: operations["addPushSubscription"];
delete: operations["removePushSubscription"];
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/push/key": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get: operations["getPushKey"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/projects": {
parameters: {
query?: never;
@@ -450,6 +500,31 @@ export interface components {
display_name: string;
git_name: string;
git_email: string;
notification_prefs: components["schemas"]["NotificationPrefs"];
};
/** @description Which new inbox items send this user a push notification. */
NotificationPrefs: {
/** @description Questions asked with blocking: true. On by default. */
blocking_questions: boolean;
/** @description Non-blocking questions. */
questions: boolean;
/** @description Turn summaries. */
reports: boolean;
/** @description session_error items. */
errors: boolean;
/** @description rate_limited items. */
rate_limits: boolean;
};
PushSubscription: {
endpoint: string;
/** @description The subscription's p256dh key */
p256dh: string;
/** @description The subscription's auth secret */
auth: string;
};
PushKey: {
/** @description Base64url */
public_key: string;
};
UserUpdate: {
git_name: string;
@@ -753,6 +828,94 @@ export interface operations {
400: components["responses"]["Error"];
};
};
updateNotificationPrefs: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": components["schemas"]["NotificationPrefs"];
};
};
responses: {
/** @description The updated user. */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["User"];
};
};
400: components["responses"]["Error"];
};
};
addPushSubscription: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": components["schemas"]["PushSubscription"];
};
};
responses: {
/** @description Registered. */
204: {
headers: {
[name: string]: unknown;
};
content?: never;
};
400: components["responses"]["Error"];
};
};
removePushSubscription: {
parameters: {
query: {
endpoint: string;
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Removed, or was not registered. */
204: {
headers: {
[name: string]: unknown;
};
content?: never;
};
};
};
getPushKey: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description The server's VAPID public key, the applicationServerKey for PushManager.subscribe. */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["PushKey"];
};
};
};
};
listProjects: {
parameters: {
query?: never;