-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathnotificationFlagsSchema.ts
More file actions
58 lines (56 loc) · 3.52 KB
/
notificationFlagsSchema.ts
File metadata and controls
58 lines (56 loc) · 3.52 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
import z from 'zod';
import { NotificationType } from '../../notifications/common';
import { UserPersonalizedDigestType } from '../../entity/user/UserPersonalizedDigest';
const notificationPreferenceSchema = z.object({
email: z.enum(['muted', 'subscribed']),
inApp: z.enum(['muted', 'subscribed']),
});
export const notificationFlagsSchema = z.strictObject({
[NotificationType.ArticleNewComment]: notificationPreferenceSchema,
[NotificationType.CommentReply]: notificationPreferenceSchema,
[NotificationType.ArticleUpvoteMilestone]: notificationPreferenceSchema,
[NotificationType.CommentUpvoteMilestone]: notificationPreferenceSchema,
[NotificationType.PostMention]: notificationPreferenceSchema,
[NotificationType.CommentMention]: notificationPreferenceSchema,
[NotificationType.ArticleReportApproved]: notificationPreferenceSchema,
[NotificationType.UserFollow]: notificationPreferenceSchema,
[NotificationType.StreakResetRestore]: notificationPreferenceSchema,
[UserPersonalizedDigestType.StreakReminder]: notificationPreferenceSchema,
[NotificationType.UserTopReaderBadge]: notificationPreferenceSchema,
[NotificationType.DevCardUnlocked]: notificationPreferenceSchema,
[NotificationType.SourcePostAdded]: notificationPreferenceSchema,
[NotificationType.SquadPostAdded]: notificationPreferenceSchema,
[NotificationType.UserPostAdded]: notificationPreferenceSchema,
[NotificationType.CollectionUpdated]: notificationPreferenceSchema,
[NotificationType.PostBookmarkReminder]: notificationPreferenceSchema,
[NotificationType.PromotedToAdmin]: notificationPreferenceSchema,
[NotificationType.PromotedToModerator]: notificationPreferenceSchema,
[NotificationType.DemotedToMember]: notificationPreferenceSchema,
[NotificationType.SourceApproved]: notificationPreferenceSchema,
[NotificationType.SourceRejected]: notificationPreferenceSchema,
[NotificationType.SourcePostApproved]: notificationPreferenceSchema,
[NotificationType.SourcePostRejected]: notificationPreferenceSchema,
[NotificationType.SourcePostSubmitted]: notificationPreferenceSchema,
[NotificationType.ArticlePicked]: notificationPreferenceSchema,
[NotificationType.UserReceivedAward]: notificationPreferenceSchema,
[NotificationType.BriefingReady]: notificationPreferenceSchema,
[NotificationType.SquadNewComment]: notificationPreferenceSchema,
[NotificationType.ArticleAnalytics]: notificationPreferenceSchema,
[NotificationType.SquadMemberJoined]: notificationPreferenceSchema,
[NotificationType.SquadReply]: notificationPreferenceSchema,
[NotificationType.SquadBlocked]: notificationPreferenceSchema,
[NotificationType.SquadFeatured]: notificationPreferenceSchema,
[NotificationType.Marketing]: notificationPreferenceSchema,
[NotificationType.NewUserWelcome]: notificationPreferenceSchema,
[NotificationType.Announcements]: notificationPreferenceSchema,
[NotificationType.InAppPurchases]: notificationPreferenceSchema,
[NotificationType.NewOpportunityMatch]: notificationPreferenceSchema,
[NotificationType.PostAnalytics]: notificationPreferenceSchema,
[NotificationType.PollResult]: notificationPreferenceSchema,
[NotificationType.PollResultAuthor]: notificationPreferenceSchema,
[NotificationType.RecruiterNewCandidate]: notificationPreferenceSchema,
[NotificationType.RecruiterOpportunityLive]: notificationPreferenceSchema,
[NotificationType.RecruiterExternalPayment]: notificationPreferenceSchema,
[NotificationType.AchievementUnlocked]: notificationPreferenceSchema,
[NotificationType.DigestReady]: notificationPreferenceSchema,
});