@meith/notifications 0.21.2 → 0.23.0
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 +1 -11
- package/src/types.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meith/notifications",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
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/
|
|
23
|
-
"@meith/
|
|
24
|
-
"@meith/
|
|
22
|
+
"@meith/core": "0.23.0",
|
|
23
|
+
"@meith/i18n": "0.23.0",
|
|
24
|
+
"@meith/mail": "0.23.0"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/src/service.ts
CHANGED
|
@@ -31,10 +31,6 @@ export interface NotificationPreferenceView {
|
|
|
31
31
|
readonly isDefault: boolean
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
* Where a plugin gets to see a notification. `before` may rewrite it or return
|
|
36
|
-
* null to drop it; `created` is told what was stored and cannot change it.
|
|
37
|
-
*/
|
|
38
34
|
export interface NotificationAudit {
|
|
39
35
|
readonly before: (input: {
|
|
40
36
|
readonly userId: number
|
|
@@ -58,10 +54,6 @@ export const NO_NOTIFICATION_AUDIT: NotificationAudit = {
|
|
|
58
54
|
created: async () => {},
|
|
59
55
|
}
|
|
60
56
|
|
|
61
|
-
/**
|
|
62
|
-
* A notification suppressed by a plugin. It reports the same shape a coalesced
|
|
63
|
-
* one does, so nothing downstream has to learn a third outcome.
|
|
64
|
-
*/
|
|
65
57
|
const DROPPED: RaiseResult = {
|
|
66
58
|
notificationId: 0,
|
|
67
59
|
coalesced: true,
|
|
@@ -157,9 +149,7 @@ export class NotificationService {
|
|
|
157
149
|
try {
|
|
158
150
|
await this.raise({ ...input, userId })
|
|
159
151
|
raised += 1
|
|
160
|
-
} catch {
|
|
161
|
-
/* ignore */
|
|
162
|
-
}
|
|
152
|
+
} catch {}
|
|
163
153
|
}
|
|
164
154
|
return { raised }
|
|
165
155
|
}
|
package/src/types.ts
CHANGED
|
@@ -96,7 +96,6 @@ export interface NotificationRepository {
|
|
|
96
96
|
|
|
97
97
|
unreadCount(userId: number): Promise<number>
|
|
98
98
|
|
|
99
|
-
/** Every notification this member has, read or not. */
|
|
100
99
|
countFor(userId: number): Promise<number>
|
|
101
100
|
|
|
102
101
|
markRead(userId: number, notificationId: number): Promise<boolean>
|