/
web-push-subscription.ts
45 lines (43 loc) 路 1.71 KB
/
web-push-subscription.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
export type WebPushSubscriptionPolicy =
| "all"
| "followed"
| "follower"
| "none";
/**
* Represents a subscription to the push streaming server.
* @see https://docs.joinmastodon.org/entities/WebPushSubscription/
*/
export interface WebPushSubscription {
/** The id of the push subscription in the database. */
id: string;
/** Where push alerts will be sent to. */
endpoint: string;
/** The streaming server's VAPID key. */
serverKey: string;
/** Which alerts should be delivered to the `endpoint`. */
alerts: WebPushSubscriptionAlerts;
/* Which type of notification should be included */
policy: WebPushSubscriptionPolicy;
}
export interface WebPushSubscriptionAlerts {
/** Receive a push notification when someone has followed you? Boolean. */
follow: boolean;
/** Receive a push notification when a status you created has been favourited by someone else? Boolean. */
favourite: boolean;
/** Receive a push notification when someone else has mentioned you in a status? Boolean. */
reblog: boolean;
/** Receive a push notification when a status you created has been boosted by someone else? Boolean. */
mention: boolean;
/** Receive a push notification when a poll you voted in or created has ended? Boolean. */
poll: boolean;
/** Receive new subscribed account notifications? Defaults to false. */
status: boolean;
/** Receive status edited notifications? Defaults to false. */
update: boolean;
admin: {
/** Receive new user signup notifications? Defaults to false. Must have a role with the appropriate permissions. */
signUp: boolean;
/** Receive new report notifications? Defaults to false. Must have a role with the appropriate permissions. */
report: boolean;
};
}