| 1 |
// Event types for ntfy messages |
| 2 |
// These correspond to the server event types in server/types.go |
| 3 |
|
| 4 |
export const EVENT_OPEN = "open"; |
| 5 |
export const EVENT_KEEPALIVE = "keepalive"; |
| 6 |
export const EVENT_MESSAGE = "message"; |
| 7 |
export const EVENT_MESSAGE_DELETE = "message_delete"; |
| 8 |
export const EVENT_MESSAGE_CLEAR = "message_clear"; |
| 9 |
export const EVENT_POLL_REQUEST = "poll_request"; |
| 10 |
|
| 11 |
export const SW_WEBPUSH_EVENT_MESSAGE = "message"; |
| 12 |
export const SW_WEBPUSH_EVENT_SUBSCRIPTION_EXPIRING = "subscription_expiring"; |
| 13 |
|
| 14 |
export const SW_PERIODIC_SYNC_EXTEND_TOKEN_TAG = "extend_token"; |
| 15 |
|
| 16 |
// Check if an event is a notification event (message, delete, or read) |
| 17 |
export const isNotificationEvent = (event) => event === EVENT_MESSAGE || event === EVENT_MESSAGE_DELETE || event === EVENT_MESSAGE_CLEAR; |