@@ -21,6 +21,7 @@ import {
2121import { UserNotification } from '../entity/notifications/UserNotification' ;
2222import type { ConnectionManager } from '../entity/posts' ;
2323import { Comment } from '../entity/Comment' ;
24+ import type { UserNotificationFlags } from '../entity/user/User' ;
2425
2526export enum NotificationType {
2627 CommunityPicksFailed = 'community_picks_failed' ,
@@ -96,6 +97,137 @@ export const notificationPreferenceMap: Partial<
9697 [ NotificationType . UserTopReaderBadge ] : NotificationPreferenceType . User ,
9798} ;
9899
100+ export const DEFAULT_NOTIFICATION_SETTINGS : UserNotificationFlags = {
101+ [ NotificationType . ArticleNewComment ] : {
102+ email : NotificationPreferenceStatus . Subscribed ,
103+ inApp : NotificationPreferenceStatus . Subscribed ,
104+ } ,
105+ [ NotificationType . CommentReply ] : {
106+ email : NotificationPreferenceStatus . Subscribed ,
107+ inApp : NotificationPreferenceStatus . Subscribed ,
108+ } ,
109+ [ NotificationType . ArticleUpvoteMilestone ] : {
110+ email : NotificationPreferenceStatus . Subscribed ,
111+ inApp : NotificationPreferenceStatus . Subscribed ,
112+ } ,
113+ [ NotificationType . CommentUpvoteMilestone ] : {
114+ email : NotificationPreferenceStatus . Subscribed ,
115+ inApp : NotificationPreferenceStatus . Subscribed ,
116+ } ,
117+ [ NotificationType . PostMention ] : {
118+ email : NotificationPreferenceStatus . Subscribed ,
119+ inApp : NotificationPreferenceStatus . Subscribed ,
120+ } ,
121+ [ NotificationType . CommentMention ] : {
122+ email : NotificationPreferenceStatus . Subscribed ,
123+ inApp : NotificationPreferenceStatus . Subscribed ,
124+ } ,
125+ [ NotificationType . SquadNewComment ] : {
126+ email : NotificationPreferenceStatus . Subscribed ,
127+ inApp : NotificationPreferenceStatus . Subscribed ,
128+ } ,
129+ [ NotificationType . UserReceivedAward ] : {
130+ email : NotificationPreferenceStatus . Subscribed ,
131+ inApp : NotificationPreferenceStatus . Subscribed ,
132+ } ,
133+ [ NotificationType . ArticleReportApproved ] : {
134+ email : NotificationPreferenceStatus . Subscribed ,
135+ inApp : NotificationPreferenceStatus . Subscribed ,
136+ } ,
137+ [ NotificationType . StreakResetRestore ] : {
138+ email : NotificationPreferenceStatus . Subscribed ,
139+ inApp : NotificationPreferenceStatus . Subscribed ,
140+ } ,
141+ [ 'streak_reminder' ] : {
142+ email : NotificationPreferenceStatus . Subscribed ,
143+ inApp : NotificationPreferenceStatus . Subscribed ,
144+ } ,
145+ [ NotificationType . UserTopReaderBadge ] : {
146+ email : NotificationPreferenceStatus . Subscribed ,
147+ inApp : NotificationPreferenceStatus . Subscribed ,
148+ } ,
149+ [ NotificationType . DevCardUnlocked ] : {
150+ email : NotificationPreferenceStatus . Subscribed ,
151+ inApp : NotificationPreferenceStatus . Subscribed ,
152+ } ,
153+ [ NotificationType . SourcePostAdded ] : {
154+ email : NotificationPreferenceStatus . Subscribed ,
155+ inApp : NotificationPreferenceStatus . Subscribed ,
156+ } ,
157+ [ NotificationType . SquadPostAdded ] : {
158+ email : NotificationPreferenceStatus . Subscribed ,
159+ inApp : NotificationPreferenceStatus . Subscribed ,
160+ } ,
161+ [ NotificationType . UserPostAdded ] : {
162+ email : NotificationPreferenceStatus . Subscribed ,
163+ inApp : NotificationPreferenceStatus . Subscribed ,
164+ } ,
165+ [ NotificationType . CollectionUpdated ] : {
166+ email : NotificationPreferenceStatus . Subscribed ,
167+ inApp : NotificationPreferenceStatus . Subscribed ,
168+ } ,
169+ [ NotificationType . PostBookmarkReminder ] : {
170+ email : NotificationPreferenceStatus . Subscribed ,
171+ inApp : NotificationPreferenceStatus . Subscribed ,
172+ } ,
173+ [ NotificationType . PromotedToAdmin ] : {
174+ email : NotificationPreferenceStatus . Subscribed ,
175+ inApp : NotificationPreferenceStatus . Subscribed ,
176+ } ,
177+ [ NotificationType . PromotedToModerator ] : {
178+ email : NotificationPreferenceStatus . Subscribed ,
179+ inApp : NotificationPreferenceStatus . Subscribed ,
180+ } ,
181+ [ NotificationType . SourceApproved ] : {
182+ email : NotificationPreferenceStatus . Subscribed ,
183+ inApp : NotificationPreferenceStatus . Subscribed ,
184+ } ,
185+ [ NotificationType . SourceRejected ] : {
186+ email : NotificationPreferenceStatus . Subscribed ,
187+ inApp : NotificationPreferenceStatus . Subscribed ,
188+ } ,
189+ [ NotificationType . SourcePostSubmitted ] : {
190+ email : NotificationPreferenceStatus . Subscribed ,
191+ inApp : NotificationPreferenceStatus . Subscribed ,
192+ } ,
193+ [ NotificationType . SourcePostApproved ] : {
194+ email : NotificationPreferenceStatus . Subscribed ,
195+ inApp : NotificationPreferenceStatus . Subscribed ,
196+ } ,
197+ [ NotificationType . SourcePostRejected ] : {
198+ email : NotificationPreferenceStatus . Subscribed ,
199+ inApp : NotificationPreferenceStatus . Subscribed ,
200+ } ,
201+ [ NotificationType . BriefingReady ] : {
202+ email : NotificationPreferenceStatus . Subscribed ,
203+ inApp : NotificationPreferenceStatus . Subscribed ,
204+ } ,
205+ [ NotificationType . ArticlePicked ] : {
206+ email : NotificationPreferenceStatus . Subscribed ,
207+ inApp : NotificationPreferenceStatus . Subscribed ,
208+ } ,
209+ [ NotificationType . ArticleAnalytics ] : {
210+ email : NotificationPreferenceStatus . Subscribed ,
211+ inApp : NotificationPreferenceStatus . Subscribed ,
212+ } ,
213+ [ NotificationType . SquadMemberJoined ] : {
214+ email : NotificationPreferenceStatus . Subscribed ,
215+ inApp : NotificationPreferenceStatus . Subscribed ,
216+ } ,
217+ [ NotificationType . SquadReply ] : {
218+ email : NotificationPreferenceStatus . Subscribed ,
219+ inApp : NotificationPreferenceStatus . Subscribed ,
220+ } ,
221+ [ NotificationType . SquadBlocked ] : {
222+ email : NotificationPreferenceStatus . Subscribed ,
223+ inApp : NotificationPreferenceStatus . Subscribed ,
224+ } ,
225+ [ NotificationType . DemotedToMember ] : {
226+ email : NotificationPreferenceStatus . Subscribed ,
227+ inApp : NotificationPreferenceStatus . Subscribed ,
228+ } ,
229+ } ;
230+
99231export const commentReplyNotificationTypes = [
100232 NotificationType . CommentReply ,
101233 NotificationType . SquadReply ,
0 commit comments