founder-schema 0.4.0 → 0.6.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/README.md +64 -1
- package/dist/access/permissions.d.ts +24 -2
- package/dist/access/permissions.d.ts.map +1 -1
- package/dist/access/permissions.js +9 -0
- package/dist/access/permissions.js.map +1 -1
- package/dist/core/common.d.ts +37 -0
- package/dist/core/common.d.ts.map +1 -1
- package/dist/core/common.js +49 -0
- package/dist/core/common.js.map +1 -1
- package/dist/core/errors.d.ts +41 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +75 -4
- package/dist/core/errors.js.map +1 -1
- package/dist/core/limits.d.ts +76 -4
- package/dist/core/limits.d.ts.map +1 -1
- package/dist/core/limits.js +80 -4
- package/dist/core/limits.js.map +1 -1
- package/dist/core/responses.d.ts +55 -0
- package/dist/core/responses.d.ts.map +1 -1
- package/dist/core/responses.js +3 -1
- package/dist/core/responses.js.map +1 -1
- package/dist/core/validation.d.ts +16 -0
- package/dist/core/validation.d.ts.map +1 -1
- package/dist/core/validation.js +16 -0
- package/dist/core/validation.js.map +1 -1
- package/dist/domains/account/account.d.ts +2 -0
- package/dist/domains/account/account.d.ts.map +1 -1
- package/dist/domains/account/account.js +2 -0
- package/dist/domains/account/account.js.map +1 -1
- package/dist/domains/audit/audit.d.ts +4 -0
- package/dist/domains/audit/audit.d.ts.map +1 -1
- package/dist/domains/audit/audit.js +6 -3
- package/dist/domains/audit/audit.js.map +1 -1
- package/dist/domains/contributions/contributions.d.ts +158 -0
- package/dist/domains/contributions/contributions.d.ts.map +1 -0
- package/dist/domains/contributions/contributions.js +93 -0
- package/dist/domains/contributions/contributions.js.map +1 -0
- package/dist/domains/discover/discover.d.ts +5 -0
- package/dist/domains/discover/discover.d.ts.map +1 -1
- package/dist/domains/discover/discover.js +3 -13
- package/dist/domains/discover/discover.js.map +1 -1
- package/dist/domains/feed/feed.d.ts +293 -32
- package/dist/domains/feed/feed.d.ts.map +1 -1
- package/dist/domains/feed/feed.js +109 -38
- package/dist/domains/feed/feed.js.map +1 -1
- package/dist/domains/media/media.d.ts +159 -0
- package/dist/domains/media/media.d.ts.map +1 -0
- package/dist/domains/media/media.js +136 -0
- package/dist/domains/media/media.js.map +1 -0
- package/dist/domains/members/members.d.ts +5 -5
- package/dist/domains/moderation/moderation.d.ts +53 -3
- package/dist/domains/moderation/moderation.d.ts.map +1 -1
- package/dist/domains/moderation/moderation.js +47 -8
- package/dist/domains/moderation/moderation.js.map +1 -1
- package/dist/domains/notifications/notifications.d.ts +212 -0
- package/dist/domains/notifications/notifications.d.ts.map +1 -0
- package/dist/domains/notifications/notifications.js +144 -0
- package/dist/domains/notifications/notifications.js.map +1 -0
- package/dist/domains/onboarding/onboarding.d.ts +21 -24
- package/dist/domains/onboarding/onboarding.d.ts.map +1 -1
- package/dist/domains/onboarding/onboarding.js +21 -20
- package/dist/domains/onboarding/onboarding.js.map +1 -1
- package/dist/domains/products/products.d.ts +1449 -0
- package/dist/domains/products/products.d.ts.map +1 -0
- package/dist/domains/products/products.js +453 -0
- package/dist/domains/products/products.js.map +1 -0
- package/dist/domains/profile/founder-profile.d.ts +66 -0
- package/dist/domains/profile/founder-profile.d.ts.map +1 -1
- package/dist/domains/profile/founder-profile.js +70 -1
- package/dist/domains/profile/founder-profile.js.map +1 -1
- package/dist/domains/reviews/reviews.d.ts +184 -0
- package/dist/domains/reviews/reviews.d.ts.map +1 -0
- package/dist/domains/reviews/reviews.js +99 -0
- package/dist/domains/reviews/reviews.js.map +1 -0
- package/dist/domains/uploads/uploads.d.ts +54 -64
- package/dist/domains/uploads/uploads.d.ts.map +1 -1
- package/dist/domains/uploads/uploads.js +43 -60
- package/dist/domains/uploads/uploads.js.map +1 -1
- package/dist/index.d.ts +11 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* founder-schema — Notifications: the bell
|
|
3
|
+
*
|
|
4
|
+
* The design the user approved on 2026-10-05 ("Founder Circle Schema Review"):
|
|
5
|
+
*
|
|
6
|
+
* - ONE ROW PER RECIPIENT, written when the event happens.
|
|
7
|
+
* - REPEATS MERGE: a second comment on your post updates the same row
|
|
8
|
+
* ("Asha and 2 others commented"), it never adds one. `count` is how many
|
|
9
|
+
* events it holds and `actor` the latest.
|
|
10
|
+
* - THE ACTOR IS LOOKED UP WHEN READ, never copied in: a renamed member shows
|
|
11
|
+
* their new name, and a deleted one shows as null ("A former member").
|
|
12
|
+
* - PREFERENCES ARE CHECKED before writing (Jansathi stores them and never
|
|
13
|
+
* reads them). A team invitation is always delivered: it needs an answer.
|
|
14
|
+
* - KEPT `NOTIFICATION_RETENTION_DAYS`, then deleted.
|
|
15
|
+
* - Nobody is notified of their own action.
|
|
16
|
+
*
|
|
17
|
+
* In-app only. Push stays chat's (async-service) until a channel is designed:
|
|
18
|
+
* a client polls the unread count (on focus, and every minute while visible).
|
|
19
|
+
*
|
|
20
|
+
* Routes (all signed in):
|
|
21
|
+
* GET /api/v1/notifications paginationQuerySchema -> notificationPageSchema
|
|
22
|
+
* GET /api/v1/notifications/unread-count -> notificationUnreadCountSchema
|
|
23
|
+
* POST /api/v1/notifications/read mark every one read -> notificationUnreadCountSchema
|
|
24
|
+
* PUT /api/v1/notifications/:notificationId/read -> notificationSchema
|
|
25
|
+
* GET /api/v1/notifications/preferences -> notificationPreferencesSchema
|
|
26
|
+
* PUT /api/v1/notifications/preferences updateNotificationPreferencesBodySchema -> notificationPreferencesSchema
|
|
27
|
+
*
|
|
28
|
+
* @module founder-schema/domains/notifications
|
|
29
|
+
*/
|
|
30
|
+
import { z } from 'zod';
|
|
31
|
+
/**
|
|
32
|
+
* What happened. ⚠ Stored per row: append only.
|
|
33
|
+
*
|
|
34
|
+
* comment_on_post someone commented on your post or poll
|
|
35
|
+
* reply_to_comment someone replied to your comment
|
|
36
|
+
* product_invite a team invited you (always delivered)
|
|
37
|
+
* product_invite_accepted someone accepted your team's invitation
|
|
38
|
+
* product_review someone reviewed a product you are on the team of
|
|
39
|
+
* review_reply a product's team answered your review
|
|
40
|
+
* feedback_helpful a team marked your feedback as having helped
|
|
41
|
+
* tester_confirmed a team confirmed you tested their product
|
|
42
|
+
*/
|
|
43
|
+
export declare const NOTIFICATION_KIND_VALUES: readonly ["comment_on_post", "reply_to_comment", "product_invite", "product_invite_accepted", "product_review", "review_reply", "feedback_helpful", "tester_confirmed"];
|
|
44
|
+
export declare const notificationKindSchema: z.ZodEnum<{
|
|
45
|
+
feedback_helpful: "feedback_helpful";
|
|
46
|
+
tester_confirmed: "tester_confirmed";
|
|
47
|
+
comment_on_post: "comment_on_post";
|
|
48
|
+
reply_to_comment: "reply_to_comment";
|
|
49
|
+
product_invite: "product_invite";
|
|
50
|
+
product_invite_accepted: "product_invite_accepted";
|
|
51
|
+
product_review: "product_review";
|
|
52
|
+
review_reply: "review_reply";
|
|
53
|
+
}>;
|
|
54
|
+
export type NotificationKind = z.infer<typeof notificationKindSchema>;
|
|
55
|
+
/** The switches a member has, each covering one or more kinds. */
|
|
56
|
+
export declare const NOTIFICATION_PREFERENCE_VALUES: readonly ["comments", "replies", "productActivity", "recognition"];
|
|
57
|
+
export declare const notificationPreferenceSchema: z.ZodEnum<{
|
|
58
|
+
comments: "comments";
|
|
59
|
+
replies: "replies";
|
|
60
|
+
productActivity: "productActivity";
|
|
61
|
+
recognition: "recognition";
|
|
62
|
+
}>;
|
|
63
|
+
export type NotificationPreference = z.infer<typeof notificationPreferenceSchema>;
|
|
64
|
+
/**
|
|
65
|
+
* Which switch silences which kind. Null: always delivered. Exhaustive by
|
|
66
|
+
* type, so a kind added without a decision here does not compile.
|
|
67
|
+
*/
|
|
68
|
+
export declare const NOTIFICATION_PREFERENCE_OF: {
|
|
69
|
+
readonly comment_on_post: "comments";
|
|
70
|
+
readonly reply_to_comment: "replies";
|
|
71
|
+
readonly product_invite: null;
|
|
72
|
+
readonly product_invite_accepted: "productActivity";
|
|
73
|
+
readonly product_review: "productActivity";
|
|
74
|
+
readonly review_reply: "productActivity";
|
|
75
|
+
readonly feedback_helpful: "recognition";
|
|
76
|
+
readonly tester_confirmed: "recognition";
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* One row of the bell. Which of the optional targets are present depends on
|
|
80
|
+
* `kind`:
|
|
81
|
+
*
|
|
82
|
+
* comment_on_post content, commentId
|
|
83
|
+
* reply_to_comment content, commentId (the reply)
|
|
84
|
+
* product_invite product, role
|
|
85
|
+
* product_invite_accepted product
|
|
86
|
+
* product_review product, reviewId
|
|
87
|
+
* review_reply product, reviewId
|
|
88
|
+
* feedback_helpful product, content, commentId
|
|
89
|
+
* tester_confirmed product
|
|
90
|
+
*
|
|
91
|
+
* A target that no longer exists (a deleted post, product or review) is
|
|
92
|
+
* absent rather than pointing at a 404; the row still says what happened.
|
|
93
|
+
*/
|
|
94
|
+
export declare const notificationSchema: z.ZodObject<{
|
|
95
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
96
|
+
kind: z.ZodEnum<{
|
|
97
|
+
feedback_helpful: "feedback_helpful";
|
|
98
|
+
tester_confirmed: "tester_confirmed";
|
|
99
|
+
comment_on_post: "comment_on_post";
|
|
100
|
+
reply_to_comment: "reply_to_comment";
|
|
101
|
+
product_invite: "product_invite";
|
|
102
|
+
product_invite_accepted: "product_invite_accepted";
|
|
103
|
+
product_review: "product_review";
|
|
104
|
+
review_reply: "review_reply";
|
|
105
|
+
}>;
|
|
106
|
+
actor: z.ZodNullable<z.ZodObject<{
|
|
107
|
+
userId: z.ZodString;
|
|
108
|
+
username: z.ZodString;
|
|
109
|
+
displayName: z.ZodString;
|
|
110
|
+
avatarUrl: z.ZodOptional<z.ZodURL>;
|
|
111
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
count: z.ZodNumber;
|
|
114
|
+
content: z.ZodOptional<z.ZodObject<{
|
|
115
|
+
kind: z.ZodEnum<{
|
|
116
|
+
post: "post";
|
|
117
|
+
poll: "poll";
|
|
118
|
+
}>;
|
|
119
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
120
|
+
}, z.core.$strip>>;
|
|
121
|
+
commentId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
122
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
123
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
124
|
+
slug: z.ZodString;
|
|
125
|
+
name: z.ZodString;
|
|
126
|
+
logoUrl: z.ZodOptional<z.ZodURL>;
|
|
127
|
+
}, z.core.$strip>>;
|
|
128
|
+
reviewId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
129
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
130
|
+
team: "team";
|
|
131
|
+
cofounder: "cofounder";
|
|
132
|
+
}>>;
|
|
133
|
+
excerpt: z.ZodOptional<z.ZodString>;
|
|
134
|
+
readAt: z.ZodNullable<z.ZodISODateTime>;
|
|
135
|
+
lastAt: z.ZodISODateTime;
|
|
136
|
+
createdAt: z.ZodISODateTime;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
export type Notification = z.infer<typeof notificationSchema>;
|
|
139
|
+
export declare const notificationPageSchema: z.ZodObject<{
|
|
140
|
+
items: z.ZodArray<z.ZodObject<{
|
|
141
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
142
|
+
kind: z.ZodEnum<{
|
|
143
|
+
feedback_helpful: "feedback_helpful";
|
|
144
|
+
tester_confirmed: "tester_confirmed";
|
|
145
|
+
comment_on_post: "comment_on_post";
|
|
146
|
+
reply_to_comment: "reply_to_comment";
|
|
147
|
+
product_invite: "product_invite";
|
|
148
|
+
product_invite_accepted: "product_invite_accepted";
|
|
149
|
+
product_review: "product_review";
|
|
150
|
+
review_reply: "review_reply";
|
|
151
|
+
}>;
|
|
152
|
+
actor: z.ZodNullable<z.ZodObject<{
|
|
153
|
+
userId: z.ZodString;
|
|
154
|
+
username: z.ZodString;
|
|
155
|
+
displayName: z.ZodString;
|
|
156
|
+
avatarUrl: z.ZodOptional<z.ZodURL>;
|
|
157
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, z.core.$strip>>;
|
|
159
|
+
count: z.ZodNumber;
|
|
160
|
+
content: z.ZodOptional<z.ZodObject<{
|
|
161
|
+
kind: z.ZodEnum<{
|
|
162
|
+
post: "post";
|
|
163
|
+
poll: "poll";
|
|
164
|
+
}>;
|
|
165
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
166
|
+
}, z.core.$strip>>;
|
|
167
|
+
commentId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
168
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
169
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
170
|
+
slug: z.ZodString;
|
|
171
|
+
name: z.ZodString;
|
|
172
|
+
logoUrl: z.ZodOptional<z.ZodURL>;
|
|
173
|
+
}, z.core.$strip>>;
|
|
174
|
+
reviewId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
175
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
176
|
+
team: "team";
|
|
177
|
+
cofounder: "cofounder";
|
|
178
|
+
}>>;
|
|
179
|
+
excerpt: z.ZodOptional<z.ZodString>;
|
|
180
|
+
readAt: z.ZodNullable<z.ZodISODateTime>;
|
|
181
|
+
lastAt: z.ZodISODateTime;
|
|
182
|
+
createdAt: z.ZodISODateTime;
|
|
183
|
+
}, z.core.$strip>>;
|
|
184
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
export type NotificationPage = z.infer<typeof notificationPageSchema>;
|
|
187
|
+
/** The badge. */
|
|
188
|
+
export declare const notificationUnreadCountSchema: z.ZodObject<{
|
|
189
|
+
unread: z.ZodNumber;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
export type NotificationUnreadCount = z.infer<typeof notificationUnreadCountSchema>;
|
|
192
|
+
export declare const notificationParamsSchema: z.ZodObject<{
|
|
193
|
+
notificationId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
export type NotificationParams = z.infer<typeof notificationParamsSchema>;
|
|
196
|
+
/** Every switch, as stored (on by default). */
|
|
197
|
+
export declare const notificationPreferencesSchema: z.ZodObject<{
|
|
198
|
+
comments: z.ZodBoolean;
|
|
199
|
+
replies: z.ZodBoolean;
|
|
200
|
+
productActivity: z.ZodBoolean;
|
|
201
|
+
recognition: z.ZodBoolean;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
export type NotificationPreferences = z.infer<typeof notificationPreferencesSchema>;
|
|
204
|
+
/** Only the switches that changed; no defaults (a patch states what was sent). */
|
|
205
|
+
export declare const updateNotificationPreferencesBodySchema: z.ZodObject<{
|
|
206
|
+
comments: z.ZodOptional<z.ZodBoolean>;
|
|
207
|
+
replies: z.ZodOptional<z.ZodBoolean>;
|
|
208
|
+
productActivity: z.ZodOptional<z.ZodBoolean>;
|
|
209
|
+
recognition: z.ZodOptional<z.ZodBoolean>;
|
|
210
|
+
}, z.core.$strip>;
|
|
211
|
+
export type UpdateNotificationPreferencesBody = z.infer<typeof updateNotificationPreferencesBodySchema>;
|
|
212
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/domains/notifications/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;;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AkF;AAClF,eAAO,MAAM,uCAAuC;;;;;iBAKlD,CAAC;AACH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,uCAAuC,CAC/C,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* founder-schema — Notifications: the bell
|
|
3
|
+
*
|
|
4
|
+
* The design the user approved on 2026-10-05 ("Founder Circle Schema Review"):
|
|
5
|
+
*
|
|
6
|
+
* - ONE ROW PER RECIPIENT, written when the event happens.
|
|
7
|
+
* - REPEATS MERGE: a second comment on your post updates the same row
|
|
8
|
+
* ("Asha and 2 others commented"), it never adds one. `count` is how many
|
|
9
|
+
* events it holds and `actor` the latest.
|
|
10
|
+
* - THE ACTOR IS LOOKED UP WHEN READ, never copied in: a renamed member shows
|
|
11
|
+
* their new name, and a deleted one shows as null ("A former member").
|
|
12
|
+
* - PREFERENCES ARE CHECKED before writing (Jansathi stores them and never
|
|
13
|
+
* reads them). A team invitation is always delivered: it needs an answer.
|
|
14
|
+
* - KEPT `NOTIFICATION_RETENTION_DAYS`, then deleted.
|
|
15
|
+
* - Nobody is notified of their own action.
|
|
16
|
+
*
|
|
17
|
+
* In-app only. Push stays chat's (async-service) until a channel is designed:
|
|
18
|
+
* a client polls the unread count (on focus, and every minute while visible).
|
|
19
|
+
*
|
|
20
|
+
* Routes (all signed in):
|
|
21
|
+
* GET /api/v1/notifications paginationQuerySchema -> notificationPageSchema
|
|
22
|
+
* GET /api/v1/notifications/unread-count -> notificationUnreadCountSchema
|
|
23
|
+
* POST /api/v1/notifications/read mark every one read -> notificationUnreadCountSchema
|
|
24
|
+
* PUT /api/v1/notifications/:notificationId/read -> notificationSchema
|
|
25
|
+
* GET /api/v1/notifications/preferences -> notificationPreferencesSchema
|
|
26
|
+
* PUT /api/v1/notifications/preferences updateNotificationPreferencesBodySchema -> notificationPreferencesSchema
|
|
27
|
+
*
|
|
28
|
+
* @module founder-schema/domains/notifications
|
|
29
|
+
*/
|
|
30
|
+
import { z } from 'zod';
|
|
31
|
+
import { objectIdSchema } from '../../core/common.js';
|
|
32
|
+
import { NOTIFICATION_EXCERPT_MAX } from '../../core/limits.js';
|
|
33
|
+
import { paginatedSchema } from '../../core/responses.js';
|
|
34
|
+
import { contentKindSchema } from '../feed/feed.js';
|
|
35
|
+
import { productChipSchema, productInvitableRoleSchema } from '../products/products.js';
|
|
36
|
+
import { memberBylineSchema } from '../profile/founder-profile.js';
|
|
37
|
+
/**
|
|
38
|
+
* What happened. ⚠ Stored per row: append only.
|
|
39
|
+
*
|
|
40
|
+
* comment_on_post someone commented on your post or poll
|
|
41
|
+
* reply_to_comment someone replied to your comment
|
|
42
|
+
* product_invite a team invited you (always delivered)
|
|
43
|
+
* product_invite_accepted someone accepted your team's invitation
|
|
44
|
+
* product_review someone reviewed a product you are on the team of
|
|
45
|
+
* review_reply a product's team answered your review
|
|
46
|
+
* feedback_helpful a team marked your feedback as having helped
|
|
47
|
+
* tester_confirmed a team confirmed you tested their product
|
|
48
|
+
*/
|
|
49
|
+
export const NOTIFICATION_KIND_VALUES = [
|
|
50
|
+
'comment_on_post',
|
|
51
|
+
'reply_to_comment',
|
|
52
|
+
'product_invite',
|
|
53
|
+
'product_invite_accepted',
|
|
54
|
+
'product_review',
|
|
55
|
+
'review_reply',
|
|
56
|
+
'feedback_helpful',
|
|
57
|
+
'tester_confirmed',
|
|
58
|
+
];
|
|
59
|
+
export const notificationKindSchema = z.enum(NOTIFICATION_KIND_VALUES);
|
|
60
|
+
/** The switches a member has, each covering one or more kinds. */
|
|
61
|
+
export const NOTIFICATION_PREFERENCE_VALUES = [
|
|
62
|
+
'comments',
|
|
63
|
+
'replies',
|
|
64
|
+
'productActivity',
|
|
65
|
+
'recognition',
|
|
66
|
+
];
|
|
67
|
+
export const notificationPreferenceSchema = z.enum(NOTIFICATION_PREFERENCE_VALUES);
|
|
68
|
+
/**
|
|
69
|
+
* Which switch silences which kind. Null: always delivered. Exhaustive by
|
|
70
|
+
* type, so a kind added without a decision here does not compile.
|
|
71
|
+
*/
|
|
72
|
+
export const NOTIFICATION_PREFERENCE_OF = {
|
|
73
|
+
comment_on_post: 'comments',
|
|
74
|
+
reply_to_comment: 'replies',
|
|
75
|
+
product_invite: null,
|
|
76
|
+
product_invite_accepted: 'productActivity',
|
|
77
|
+
product_review: 'productActivity',
|
|
78
|
+
review_reply: 'productActivity',
|
|
79
|
+
feedback_helpful: 'recognition',
|
|
80
|
+
tester_confirmed: 'recognition',
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* One row of the bell. Which of the optional targets are present depends on
|
|
84
|
+
* `kind`:
|
|
85
|
+
*
|
|
86
|
+
* comment_on_post content, commentId
|
|
87
|
+
* reply_to_comment content, commentId (the reply)
|
|
88
|
+
* product_invite product, role
|
|
89
|
+
* product_invite_accepted product
|
|
90
|
+
* product_review product, reviewId
|
|
91
|
+
* review_reply product, reviewId
|
|
92
|
+
* feedback_helpful product, content, commentId
|
|
93
|
+
* tester_confirmed product
|
|
94
|
+
*
|
|
95
|
+
* A target that no longer exists (a deleted post, product or review) is
|
|
96
|
+
* absent rather than pointing at a 404; the row still says what happened.
|
|
97
|
+
*/
|
|
98
|
+
export const notificationSchema = z.object({
|
|
99
|
+
id: objectIdSchema,
|
|
100
|
+
kind: notificationKindSchema,
|
|
101
|
+
/** The latest person to do it, live; null for a deleted account. */
|
|
102
|
+
actor: memberBylineSchema.nullable(),
|
|
103
|
+
/** How many events this row merges ("and N others" is count - 1). At least 1. */
|
|
104
|
+
count: z.number().int().positive(),
|
|
105
|
+
content: z.object({ kind: contentKindSchema, id: objectIdSchema }).optional(),
|
|
106
|
+
commentId: objectIdSchema.optional(),
|
|
107
|
+
product: productChipSchema.optional(),
|
|
108
|
+
reviewId: objectIdSchema.optional(),
|
|
109
|
+
/** For `product_invite`: the role offered. */
|
|
110
|
+
role: productInvitableRoleSchema.optional(),
|
|
111
|
+
/**
|
|
112
|
+
* The first words of what was written, for the comment and review kinds
|
|
113
|
+
* (the latest one, on a merged row), cut to `NOTIFICATION_EXCERPT_MAX`. Gone
|
|
114
|
+
* when that comment or review is deleted or hidden, and when its writer's
|
|
115
|
+
* account is.
|
|
116
|
+
*/
|
|
117
|
+
excerpt: z.string().max(NOTIFICATION_EXCERPT_MAX).optional(),
|
|
118
|
+
/** Null until opened (or until "mark all read"). A merged repeat makes it unread again. */
|
|
119
|
+
readAt: z.iso.datetime().nullable(),
|
|
120
|
+
/** When it last happened: the list's order. */
|
|
121
|
+
lastAt: z.iso.datetime(),
|
|
122
|
+
createdAt: z.iso.datetime(),
|
|
123
|
+
});
|
|
124
|
+
export const notificationPageSchema = paginatedSchema(notificationSchema);
|
|
125
|
+
/** The badge. */
|
|
126
|
+
export const notificationUnreadCountSchema = z.object({
|
|
127
|
+
unread: z.number().int().nonnegative(),
|
|
128
|
+
});
|
|
129
|
+
export const notificationParamsSchema = z.object({ notificationId: objectIdSchema });
|
|
130
|
+
/** Every switch, as stored (on by default). */
|
|
131
|
+
export const notificationPreferencesSchema = z.object({
|
|
132
|
+
comments: z.boolean(),
|
|
133
|
+
replies: z.boolean(),
|
|
134
|
+
productActivity: z.boolean(),
|
|
135
|
+
recognition: z.boolean(),
|
|
136
|
+
});
|
|
137
|
+
/** Only the switches that changed; no defaults (a patch states what was sent). */
|
|
138
|
+
export const updateNotificationPreferencesBodySchema = z.object({
|
|
139
|
+
comments: z.boolean().optional(),
|
|
140
|
+
replies: z.boolean().optional(),
|
|
141
|
+
productActivity: z.boolean().optional(),
|
|
142
|
+
recognition: z.boolean().optional(),
|
|
143
|
+
});
|
|
144
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../src/domains/notifications/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACx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IACpD,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE;CACzB,CAAC,CAAC;AAGH,kFAAkF;AAClF,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9D,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC","sourcesContent":["/**\n * founder-schema — Notifications: the bell\n *\n * The design the user approved on 2026-10-05 (\"Founder Circle Schema Review\"):\n *\n * - ONE ROW PER RECIPIENT, written when the event happens.\n * - REPEATS MERGE: a second comment on your post updates the same row\n * (\"Asha and 2 others commented\"), it never adds one. `count` is how many\n * events it holds and `actor` the latest.\n * - THE ACTOR IS LOOKED UP WHEN READ, never copied in: a renamed member shows\n * their new name, and a deleted one shows as null (\"A former member\").\n * - PREFERENCES ARE CHECKED before writing (Jansathi stores them and never\n * reads them). A team invitation is always delivered: it needs an answer.\n * - KEPT `NOTIFICATION_RETENTION_DAYS`, then deleted.\n * - Nobody is notified of their own action.\n *\n * In-app only. Push stays chat's (async-service) until a channel is designed:\n * a client polls the unread count (on focus, and every minute while visible).\n *\n * Routes (all signed in):\n * GET /api/v1/notifications paginationQuerySchema -> notificationPageSchema\n * GET /api/v1/notifications/unread-count -> notificationUnreadCountSchema\n * POST /api/v1/notifications/read mark every one read -> notificationUnreadCountSchema\n * PUT /api/v1/notifications/:notificationId/read -> notificationSchema\n * GET /api/v1/notifications/preferences -> notificationPreferencesSchema\n * PUT /api/v1/notifications/preferences updateNotificationPreferencesBodySchema -> notificationPreferencesSchema\n *\n * @module founder-schema/domains/notifications\n */\n\nimport { z } from 'zod';\nimport { objectIdSchema } from '../../core/common.js';\nimport { NOTIFICATION_EXCERPT_MAX } from '../../core/limits.js';\nimport { paginatedSchema } from '../../core/responses.js';\nimport { contentKindSchema } from '../feed/feed.js';\nimport { productChipSchema, productInvitableRoleSchema } from '../products/products.js';\nimport { memberBylineSchema } from '../profile/founder-profile.js';\n\n/**\n * What happened. ⚠ Stored per row: append only.\n *\n * comment_on_post someone commented on your post or poll\n * reply_to_comment someone replied to your comment\n * product_invite a team invited you (always delivered)\n * product_invite_accepted someone accepted your team's invitation\n * product_review someone reviewed a product you are on the team of\n * review_reply a product's team answered your review\n * feedback_helpful a team marked your feedback as having helped\n * tester_confirmed a team confirmed you tested their product\n */\nexport const NOTIFICATION_KIND_VALUES = [\n 'comment_on_post',\n 'reply_to_comment',\n 'product_invite',\n 'product_invite_accepted',\n 'product_review',\n 'review_reply',\n 'feedback_helpful',\n 'tester_confirmed',\n] as const;\nexport const notificationKindSchema = z.enum(NOTIFICATION_KIND_VALUES);\nexport type NotificationKind = z.infer<typeof notificationKindSchema>;\n\n/** The switches a member has, each covering one or more kinds. */\nexport const NOTIFICATION_PREFERENCE_VALUES = [\n 'comments',\n 'replies',\n 'productActivity',\n 'recognition',\n] as const;\nexport const notificationPreferenceSchema = z.enum(NOTIFICATION_PREFERENCE_VALUES);\nexport type NotificationPreference = z.infer<typeof notificationPreferenceSchema>;\n\n/**\n * Which switch silences which kind. Null: always delivered. Exhaustive by\n * type, so a kind added without a decision here does not compile.\n */\nexport const NOTIFICATION_PREFERENCE_OF = {\n comment_on_post: 'comments',\n reply_to_comment: 'replies',\n product_invite: null,\n product_invite_accepted: 'productActivity',\n product_review: 'productActivity',\n review_reply: 'productActivity',\n feedback_helpful: 'recognition',\n tester_confirmed: 'recognition',\n} as const satisfies Record<NotificationKind, NotificationPreference | null>;\n\n/**\n * One row of the bell. Which of the optional targets are present depends on\n * `kind`:\n *\n * comment_on_post content, commentId\n * reply_to_comment content, commentId (the reply)\n * product_invite product, role\n * product_invite_accepted product\n * product_review product, reviewId\n * review_reply product, reviewId\n * feedback_helpful product, content, commentId\n * tester_confirmed product\n *\n * A target that no longer exists (a deleted post, product or review) is\n * absent rather than pointing at a 404; the row still says what happened.\n */\nexport const notificationSchema = z.object({\n id: objectIdSchema,\n kind: notificationKindSchema,\n /** The latest person to do it, live; null for a deleted account. */\n actor: memberBylineSchema.nullable(),\n /** How many events this row merges (\"and N others\" is count - 1). At least 1. */\n count: z.number().int().positive(),\n content: z.object({ kind: contentKindSchema, id: objectIdSchema }).optional(),\n commentId: objectIdSchema.optional(),\n product: productChipSchema.optional(),\n reviewId: objectIdSchema.optional(),\n /** For `product_invite`: the role offered. */\n role: productInvitableRoleSchema.optional(),\n /**\n * The first words of what was written, for the comment and review kinds\n * (the latest one, on a merged row), cut to `NOTIFICATION_EXCERPT_MAX`. Gone\n * when that comment or review is deleted or hidden, and when its writer's\n * account is.\n */\n excerpt: z.string().max(NOTIFICATION_EXCERPT_MAX).optional(),\n /** Null until opened (or until \"mark all read\"). A merged repeat makes it unread again. */\n readAt: z.iso.datetime().nullable(),\n /** When it last happened: the list's order. */\n lastAt: z.iso.datetime(),\n createdAt: z.iso.datetime(),\n});\nexport type Notification = z.infer<typeof notificationSchema>;\n\nexport const notificationPageSchema = paginatedSchema(notificationSchema);\nexport type NotificationPage = z.infer<typeof notificationPageSchema>;\n\n/** The badge. */\nexport const notificationUnreadCountSchema = z.object({\n unread: z.number().int().nonnegative(),\n});\nexport type NotificationUnreadCount = z.infer<typeof notificationUnreadCountSchema>;\n\nexport const notificationParamsSchema = z.object({ notificationId: objectIdSchema });\nexport type NotificationParams = z.infer<typeof notificationParamsSchema>;\n\n/** Every switch, as stored (on by default). */\nexport const notificationPreferencesSchema = z.object({\n comments: z.boolean(),\n replies: z.boolean(),\n productActivity: z.boolean(),\n recognition: z.boolean(),\n});\nexport type NotificationPreferences = z.infer<typeof notificationPreferencesSchema>;\n\n/** Only the switches that changed; no defaults (a patch states what was sent). */\nexport const updateNotificationPreferencesBodySchema = z.object({\n comments: z.boolean().optional(),\n replies: z.boolean().optional(),\n productActivity: z.boolean().optional(),\n recognition: z.boolean().optional(),\n});\nexport type UpdateNotificationPreferencesBody = z.infer<\n typeof updateNotificationPreferencesBodySchema\n>;\n"]}
|
|
@@ -16,10 +16,12 @@
|
|
|
16
16
|
* for the end. Letting those two drift is how a wizard says a step is optional
|
|
17
17
|
* and then answers 422 at Finish.
|
|
18
18
|
*
|
|
19
|
-
* NO COPY IN HERE. Step titles
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* NO COPY IN HERE. Step titles and help lines are translation KEYS
|
|
20
|
+
* (`titleKey`, `helpKey`), Jansathi's rule for every config string: an English
|
|
21
|
+
* sentence in a shared package is a sentence every other language has to match
|
|
22
|
+
* by wording. A topic category is named by its `key`, which the client words
|
|
23
|
+
* (0.6.0 dropped its `labelKey`: the web, English-only since 2026-10-06, read
|
|
24
|
+
* nothing from it).
|
|
23
25
|
*
|
|
24
26
|
* @module founder-schema/domains/onboarding
|
|
25
27
|
*/
|
|
@@ -182,16 +184,11 @@ export type Topic = z.infer<typeof topicSchema>;
|
|
|
182
184
|
export declare const TOPIC_CATEGORY_KEYS: readonly ["career", "tech", "business", "growth", "creative", "impact"];
|
|
183
185
|
export type TopicCategoryKey = (typeof TOPIC_CATEGORY_KEYS)[number];
|
|
184
186
|
/**
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* interests JSON is keyed by CATEGORY NAME instead, so all five of its label
|
|
188
|
-
* lookups miss and every chip renders its raw English in every locale, with a
|
|
189
|
-
* fully translated Hindi file sitting unreachable.
|
|
187
|
+
* One group of the picker: its `key` (the client words it) and its topics.
|
|
188
|
+
* Breaking in 0.6.0: no `labelKey`.
|
|
190
189
|
*/
|
|
191
190
|
export interface TopicCategory {
|
|
192
191
|
key: TopicCategoryKey;
|
|
193
|
-
/** A translation key. The English lives in the client's message files, not here. */
|
|
194
|
-
labelKey: `topics.category.${TopicCategoryKey}`;
|
|
195
192
|
values: readonly Topic[];
|
|
196
193
|
}
|
|
197
194
|
export declare const TOPIC_CATEGORIES: readonly TopicCategory[];
|
|
@@ -274,7 +271,7 @@ export declare const onboardingFormSchema: z.ZodObject<{
|
|
|
274
271
|
dateOfBirth: z.ZodString;
|
|
275
272
|
headline: z.ZodString;
|
|
276
273
|
about: z.ZodString;
|
|
277
|
-
|
|
274
|
+
avatarMediaId: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
278
275
|
skills: z.ZodArray<z.ZodEnum<{
|
|
279
276
|
engineering: "engineering";
|
|
280
277
|
product: "product";
|
|
@@ -442,8 +439,8 @@ export declare const EMPTY_ONBOARDING_VENTURE: OnboardingForm['venture'];
|
|
|
442
439
|
* Every field is checked against its own vocabulary and cut to its own limit;
|
|
443
440
|
* one that does not fit becomes "not answered" (`''`, `null`, `[]`) and the
|
|
444
441
|
* rest of the draft survives. Never coerced into a different answer: a value
|
|
445
|
-
* outside a vocabulary is dropped, not mapped to the nearest one. A photo
|
|
446
|
-
* is never restored (see `
|
|
442
|
+
* outside a vocabulary is dropped, not mapped to the nearest one. A photo
|
|
443
|
+
* is never restored (see `avatarMediaId`), and agreement only counts for the
|
|
447
444
|
* CURRENT guidelines.
|
|
448
445
|
*
|
|
449
446
|
* It fills in no answer the member did not give: a blank country stays blank.
|
|
@@ -478,7 +475,7 @@ export declare const completeOnboardingBodySchema: z.ZodObject<{
|
|
|
478
475
|
dateOfBirth: z.ZodString;
|
|
479
476
|
headline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
480
477
|
about: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
481
|
-
|
|
478
|
+
avatarMediaId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
482
479
|
phone: z.ZodString;
|
|
483
480
|
links: z.ZodOptional<z.ZodObject<{
|
|
484
481
|
linkedin: z.ZodOptional<z.ZodURL>;
|
|
@@ -593,6 +590,7 @@ export declare const completeOnboardingBodySchema: z.ZodObject<{
|
|
|
593
590
|
community: "community";
|
|
594
591
|
}>>>;
|
|
595
592
|
venture: z.ZodOptional<z.ZodObject<{
|
|
593
|
+
tagline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
596
594
|
name: z.ZodString;
|
|
597
595
|
industry: z.ZodEnum<{
|
|
598
596
|
agritech: "agritech";
|
|
@@ -627,7 +625,6 @@ export declare const completeOnboardingBodySchema: z.ZodObject<{
|
|
|
627
625
|
profitable: "profitable";
|
|
628
626
|
exited: "exited";
|
|
629
627
|
}>;
|
|
630
|
-
tagline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
631
628
|
website: z.ZodOptional<z.ZodURL>;
|
|
632
629
|
teamSize: z.ZodOptional<z.ZodNumber>;
|
|
633
630
|
}, z.core.$strip>>;
|
|
@@ -684,7 +681,7 @@ export declare const ONBOARDING_STEP_SCHEMAS: {
|
|
|
684
681
|
prefer_not_to_say: "prefer_not_to_say";
|
|
685
682
|
}>;
|
|
686
683
|
dateOfBirth: z.ZodString;
|
|
687
|
-
|
|
684
|
+
avatarMediaId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
688
685
|
}, z.core.$strip>;
|
|
689
686
|
readonly contact: z.ZodObject<{
|
|
690
687
|
links: z.ZodOptional<z.ZodObject<{
|
|
@@ -792,6 +789,7 @@ export declare const ONBOARDING_STEP_SCHEMAS: {
|
|
|
792
789
|
}, z.core.$strip>;
|
|
793
790
|
readonly business: z.ZodObject<{
|
|
794
791
|
venture: z.ZodOptional<z.ZodObject<{
|
|
792
|
+
tagline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
795
793
|
name: z.ZodString;
|
|
796
794
|
industry: z.ZodEnum<{
|
|
797
795
|
agritech: "agritech";
|
|
@@ -826,7 +824,6 @@ export declare const ONBOARDING_STEP_SCHEMAS: {
|
|
|
826
824
|
profitable: "profitable";
|
|
827
825
|
exited: "exited";
|
|
828
826
|
}>;
|
|
829
|
-
tagline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
830
827
|
website: z.ZodOptional<z.ZodURL>;
|
|
831
828
|
teamSize: z.ZodOptional<z.ZodNumber>;
|
|
832
829
|
}, z.core.$strip>>;
|
|
@@ -898,12 +895,12 @@ export declare const onboardingDraftKeySchema: z.ZodEnum<{
|
|
|
898
895
|
interests: "interests";
|
|
899
896
|
gender: "gender";
|
|
900
897
|
dateOfBirth: "dateOfBirth";
|
|
901
|
-
|
|
898
|
+
avatarMediaId: "avatarMediaId";
|
|
902
899
|
phone: "phone";
|
|
903
900
|
businessType: "businessType";
|
|
904
901
|
guidelinesVersion: "guidelinesVersion";
|
|
905
902
|
}>;
|
|
906
|
-
export declare const ONBOARDING_DRAFT_KEYS: ("location" | "about" | "displayName" | "headline" | "venture" | "skills" | "goals" | "links" | "interests" | "gender" | "dateOfBirth" | "
|
|
903
|
+
export declare const ONBOARDING_DRAFT_KEYS: ("location" | "about" | "displayName" | "headline" | "venture" | "skills" | "goals" | "links" | "interests" | "gender" | "dateOfBirth" | "avatarMediaId" | "phone" | "businessType" | "guidelinesVersion")[];
|
|
907
904
|
export type OnboardingDraftKey = z.infer<typeof onboardingDraftKeySchema>;
|
|
908
905
|
/**
|
|
909
906
|
* Where the member got to, kept in its own collection, separate from the
|
|
@@ -932,7 +929,7 @@ export declare const onboardingDraftSchema: z.ZodRecord<z.ZodEnum<{
|
|
|
932
929
|
interests: "interests";
|
|
933
930
|
gender: "gender";
|
|
934
931
|
dateOfBirth: "dateOfBirth";
|
|
935
|
-
|
|
932
|
+
avatarMediaId: "avatarMediaId";
|
|
936
933
|
phone: "phone";
|
|
937
934
|
businessType: "businessType";
|
|
938
935
|
guidelinesVersion: "guidelinesVersion";
|
|
@@ -952,7 +949,7 @@ export declare const onboardingProgressSchema: z.ZodObject<{
|
|
|
952
949
|
interests: "interests";
|
|
953
950
|
gender: "gender";
|
|
954
951
|
dateOfBirth: "dateOfBirth";
|
|
955
|
-
|
|
952
|
+
avatarMediaId: "avatarMediaId";
|
|
956
953
|
phone: "phone";
|
|
957
954
|
businessType: "businessType";
|
|
958
955
|
guidelinesVersion: "guidelinesVersion";
|
|
@@ -978,7 +975,7 @@ export declare const onboardingProgressUpdateSchema: z.ZodObject<{
|
|
|
978
975
|
interests: "interests";
|
|
979
976
|
gender: "gender";
|
|
980
977
|
dateOfBirth: "dateOfBirth";
|
|
981
|
-
|
|
978
|
+
avatarMediaId: "avatarMediaId";
|
|
982
979
|
phone: "phone";
|
|
983
980
|
businessType: "businessType";
|
|
984
981
|
guidelinesVersion: "guidelinesVersion";
|
|
@@ -1008,7 +1005,7 @@ export declare const onboardingStatusSchema: z.ZodObject<{
|
|
|
1008
1005
|
interests: "interests";
|
|
1009
1006
|
gender: "gender";
|
|
1010
1007
|
dateOfBirth: "dateOfBirth";
|
|
1011
|
-
|
|
1008
|
+
avatarMediaId: "avatarMediaId";
|
|
1012
1009
|
phone: "phone";
|
|
1013
1010
|
businessType: "businessType";
|
|
1014
1011
|
guidelinesVersion: "guidelinesVersion";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../../src/domains/onboarding/onboarding.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../../src/domains/onboarding/onboarding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmCxB;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,qEAAqE;AACrE,eAAO,MAAM,aAAa,MAA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