Removed PWA P´push notification

This commit is contained in:
maziggy
2025-12-11 11:37:13 +01:00
parent 2f1ac92598
commit ea6d84031a
14 changed files with 400 additions and 1406 deletions
+1 -60
View File
@@ -764,7 +764,7 @@ export interface Filament {
}
// Notification Provider types
export type ProviderType = 'callmebot' | 'ntfy' | 'pushover' | 'telegram' | 'email' | 'discord' | 'webhook' | 'webpush';
export type ProviderType = 'callmebot' | 'ntfy' | 'pushover' | 'telegram' | 'email' | 'discord' | 'webhook';
export interface NotificationProvider {
id: number;
@@ -1907,29 +1907,6 @@ export const api = {
// AMS History
getAMSHistory: (printerId: number, amsId: number, hours = 24) =>
request<AMSHistoryResponse>(`/ams-history/${printerId}/${amsId}?hours=${hours}`),
// Push Subscriptions (Browser Push Notifications)
getVapidPublicKey: () => request<VapidPublicKeyResponse>('/push/vapid-public-key'),
getPushSubscriptions: () => request<PushSubscription[]>('/push/subscriptions'),
subscribePush: (data: PushSubscriptionCreate) =>
request<PushSubscription>('/push/subscribe', {
method: 'POST',
body: JSON.stringify(data),
}),
updatePushSubscription: (id: number, data: PushSubscriptionUpdate) =>
request<PushSubscription>(`/push/subscriptions/${id}`, {
method: 'PATCH',
body: JSON.stringify(data),
}),
deletePushSubscription: (id: number) =>
request<{ message: string }>(`/push/subscriptions/${id}`, { method: 'DELETE' }),
unsubscribePush: (endpoint: string) =>
request<{ message: string }>('/push/unsubscribe', {
method: 'POST',
body: JSON.stringify(endpoint),
}),
testPushNotification: () =>
request<PushTestResponse>('/push/test', { method: 'POST' }),
};
// AMS History types
@@ -1951,39 +1928,3 @@ export interface AMSHistoryResponse {
max_temperature: number | null;
avg_temperature: number | null;
}
// Push Subscription types
export interface PushSubscription {
id: number;
endpoint: string;
name: string | null;
user_agent: string | null;
enabled: boolean;
last_success: string | null;
last_error: string | null;
last_error_at: string | null;
created_at: string;
}
export interface PushSubscriptionCreate {
endpoint: string;
p256dh_key: string;
auth_key: string;
name?: string;
user_agent?: string;
}
export interface PushSubscriptionUpdate {
name?: string;
enabled?: boolean;
}
export interface VapidPublicKeyResponse {
public_key: string;
}
export interface PushTestResponse {
success: boolean;
message: string;
errors?: string[];
}