@meith/notifications 0.34.0 → 0.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/service.ts +4 -0
- package/src/types.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meith/notifications",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@meith/core": "0.
|
|
23
|
-
"@meith/i18n": "0.
|
|
24
|
-
"@meith/mail": "0.
|
|
22
|
+
"@meith/core": "0.35.1",
|
|
23
|
+
"@meith/i18n": "0.35.1",
|
|
24
|
+
"@meith/mail": "0.35.1"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/src/service.ts
CHANGED
|
@@ -251,6 +251,10 @@ export class NotificationService {
|
|
|
251
251
|
return this.repository.removePushSubscription(userId, endpoint)
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
async unsubscribeAllFromPush(userId: number): Promise<number> {
|
|
255
|
+
return this.repository.removeAllPushSubscriptions(userId)
|
|
256
|
+
}
|
|
257
|
+
|
|
254
258
|
private async wanted(userId: number, kind: string): Promise<{ email: boolean; push: boolean }> {
|
|
255
259
|
const spec = this.kinds.get(kind)
|
|
256
260
|
if (spec === undefined) return { email: false, push: false }
|
package/src/types.ts
CHANGED
|
@@ -120,6 +120,8 @@ export interface NotificationRepository {
|
|
|
120
120
|
|
|
121
121
|
removePushSubscription(userId: number, endpoint: string): Promise<boolean>
|
|
122
122
|
|
|
123
|
+
removeAllPushSubscriptions(userId: number): Promise<number>
|
|
124
|
+
|
|
123
125
|
pushSubscriptionsFor(userId: number): Promise<readonly PushSubscriptionRecord[]>
|
|
124
126
|
|
|
125
127
|
countPushSubscriptions(userId: number): Promise<number>
|