founder-schema 0.8.0 → 0.9.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 +39 -0
- package/dist/access/capabilities.d.ts +34 -0
- package/dist/access/capabilities.d.ts.map +1 -0
- package/dist/access/capabilities.js +35 -0
- package/dist/access/capabilities.js.map +1 -0
- package/dist/access/permissions.d.ts +20 -1
- package/dist/access/permissions.d.ts.map +1 -1
- package/dist/access/permissions.js +4 -0
- package/dist/access/permissions.js.map +1 -1
- package/dist/core/errors.d.ts +33 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +57 -0
- package/dist/core/errors.js.map +1 -1
- package/dist/core/limits.d.ts +12 -0
- package/dist/core/limits.d.ts.map +1 -1
- package/dist/core/limits.js +13 -0
- package/dist/core/limits.js.map +1 -1
- package/dist/core/responses.d.ts +47 -0
- package/dist/core/responses.d.ts.map +1 -1
- package/dist/core/responses.js +7 -0
- package/dist/core/responses.js.map +1 -1
- package/dist/core/validation.d.ts +6 -0
- package/dist/core/validation.d.ts.map +1 -1
- package/dist/core/validation.js +6 -0
- package/dist/core/validation.js.map +1 -1
- package/dist/domains/audit/audit.d.ts +47 -3
- package/dist/domains/audit/audit.d.ts.map +1 -1
- package/dist/domains/audit/audit.js +40 -4
- package/dist/domains/audit/audit.js.map +1 -1
- package/dist/domains/communities/communities.d.ts +1537 -0
- package/dist/domains/communities/communities.d.ts.map +1 -0
- package/dist/domains/communities/communities.js +464 -0
- package/dist/domains/communities/communities.js.map +1 -0
- package/dist/domains/feed/feed.d.ts +479 -0
- package/dist/domains/feed/feed.d.ts.map +1 -1
- package/dist/domains/feed/feed.js +45 -1
- package/dist/domains/feed/feed.js.map +1 -1
- package/dist/domains/media/media.d.ts +7 -1
- package/dist/domains/media/media.d.ts.map +1 -1
- package/dist/domains/media/media.js +5 -0
- package/dist/domains/media/media.js.map +1 -1
- package/dist/domains/members/members.d.ts +6 -0
- package/dist/domains/members/members.d.ts.map +1 -1
- package/dist/domains/members/members.js +5 -0
- package/dist/domains/members/members.js.map +1 -1
- package/dist/domains/moderation/moderation.d.ts +4 -4
- package/dist/domains/notifications/notifications.d.ts +82 -2
- package/dist/domains/notifications/notifications.d.ts.map +1 -1
- package/dist/domains/notifications/notifications.js +45 -0
- package/dist/domains/notifications/notifications.js.map +1 -1
- package/dist/domains/team/team.d.ts +22 -0
- package/dist/domains/team/team.d.ts.map +1 -1
- package/dist/domains/team/team.js +22 -0
- package/dist/domains/team/team.js.map +1 -1
- package/dist/domains/uploads/uploads.d.ts +1 -0
- package/dist/domains/uploads/uploads.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"members.js","sourceRoot":"","sources":["../../../src/domains/members/members.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,iFAAiF;AACjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAU,CAAC;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAG/D,sCAAsC;AACtC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,C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&cursor\n * GET /api/v1/members/:memberId one member, as staff see them\n * POST /api/v1/members/:memberId/suspension { reason } suspend\n * DELETE /api/v1/members/:memberId/suspension lift it\n *\n * Every staff role has a Members tab: a moderator looks up who wrote\n * something, a support agent finds the person who wrote in, a manager decides\n * on a suspension. What each sees is the server's call, per field: a\n * moderator gets no email (`email: null`), because finding a member's\n * address is support's job, not moderation's.\n *\n * A SUSPENDED member cannot use the product at all, on any device, from the\n * next request on (every call answers `ACCOUNT_SUSPENDED`); their posts stay\n * up unless moderated separately, and a staff role they were acting in is\n * switched off. Lifting it restores everything else.\n *\n * SEARCH (`q`) finds people by the start of their name or handle among listed\n * founders, or by their exact email among everyone (only for a role that may\n * see emails: a moderator's email search finds nothing). It returns up to\n * `limit` matches in one page (type more to narrow), not a pageable list. Who may suspend whom is the access policy's: never\n * yourself, never a superadmin, and a manager never a fellow manager.\n *\n * Each detail carries a `viewer` block of what the asking staff member may do\n * to THIS member, worked out by the server, so the screen shows only the\n * buttons that will work.\n *\n * @module founder-schema/domains/members\n */\n\nimport { z } from 'zod';\nimport { capabilitySchema } from '../../access/capabilities.js';\nimport { platformRoleSchema } from '../../access/roles.js';\nimport {\n emptyStringToUndefined,\n objectIdSchema,\n optionalTrimmedString,\n paginationQuerySchema,\n usernameSchema,\n} from '../../core/common.js';\nimport {\n MEMBER_SEARCH_MAX,\n SUSPENSION_REASON_MAX,\n SUSPENSION_REASON_MIN,\n} from '../../core/limits.js';\nimport { paginatedSchema } from '../../core/responses.js';\n\n/** What staff can see an account's state as. A deleted account is not listed. */\nexport const MEMBER_STATUS_VALUES = ['active', 'suspended'] as const;\nexport const memberStatusSchema = z.enum(MEMBER_STATUS_VALUES);\nexport type MemberStatus = z.infer<typeof memberStatusSchema>;\n\n/** `:memberId` in the paths above. */\nexport const memberParamsSchema = z.object({ memberId: objectIdSchema });\nexport type MemberParams = z.infer<typeof memberParamsSchema>;\n\n/**\n * The directory's query. `q` is a name or handle prefix, or a whole email\n * address (anything with an `@` is matched as an email, exactly). An emptied\n * box is \"no search\", not an error.\n */\nexport const memberDirectoryQuerySchema = paginationQuerySchema.extend({\n q: optionalTrimmedString(MEMBER_SEARCH_MAX),\n status: z.preprocess(emptyStringToUndefined, memberStatusSchema.optional()),\n /** Only people holding this staff role. */\n role: z.preprocess(emptyStringToUndefined, platformRoleSchema.optional()),\n});\nexport type MemberDirectoryQuery = z.infer<typeof memberDirectoryQuerySchema>;\nexport type MemberDirectoryQueryInput = z.input<typeof memberDirectoryQuerySchema>;\n\n/** One row of the directory. */\nexport const memberSummarySchema = z.object({\n id: objectIdSchema,\n displayName: z.string(),\n /** Null when they have no founder profile (never finished onboarding). */\n username: usernameSchema.nullable(),\n avatarUrl: z.url().nullable(),\n /** Null when the asking role may not see it. */\n email: z.string().nullable(),\n status: memberStatusSchema,\n /** Staff roles held, highest first. Empty for an ordinary member. */\n roles: z.array(platformRoleSchema),\n joinedAt: z.iso.datetime(),\n lastActiveAt: z.iso.datetime().nullable(),\n});\nexport type MemberSummary = z.infer<typeof memberSummarySchema>;\n\nexport const memberDirectoryPageSchema = paginatedSchema(memberSummarySchema);\nexport type MemberDirectoryPage = z.infer<typeof memberDirectoryPageSchema>;\n\n/** A suspension in force. */\nexport const suspensionSchema = z.object({\n since: z.iso.datetime(),\n reason: z.string(),\n /** Who suspended them, by name at the time. */\n by: z.object({ id: objectIdSchema, displayName: z.string() }).nullable(),\n});\nexport type Suspension = z.infer<typeof suspensionSchema>;\n\n/** One member, as staff see them. */\nexport const memberDetailSchema = memberSummarySchema.extend({\n headline: z.string().nullable(),\n /** Their city, as declared on their profile. */\n city: z.string().nullable(),\n counts: z.object({\n posts: z.number().int().min(0),\n polls: z.number().int().min(0),\n comments: z.number().int().min(0),\n /** Reports filed about their posts, polls and comments that are still up. */\n reportsAgainst: z.number().int().min(0),\n /** Tickets they have raised. */\n tickets: z.number().int().min(0),\n }),\n suspension: suspensionSchema.nullable(),\n /** What the asking staff member may do to this member. */\n viewer: z.object({\n canSuspend: z.boolean(),\n /** Roles the asker may grant or revoke on this member (never their own). */\n grantableRoles: z.array(platformRoleSchema),\n /** May clear this member's forgotten MPIN (superadmin, someone else). */\n canResetMpin: z.boolean(),\n /** Capabilities the asker may grant or revoke on this member (never their own) (0.9.0). */\n grantableCapabilities: z.array(capabilitySchema),\n }),\n /** The capabilities they hold (0.9.0), e.g. `create_communities`. */\n capabilities: z.array(capabilitySchema),\n /** Whether they have set an MPIN. Only meaningful for staff. */\n mpinSet: z.boolean(),\n});\nexport type MemberDetail = z.infer<typeof memberDetailSchema>;\n\n/** `POST /members/:memberId/suspension`. The reason is on record in the audit log. */\nexport const suspendMemberBodySchema = z.object({\n reason: z.string().trim().min(SUSPENSION_REASON_MIN).max(SUSPENSION_REASON_MAX),\n});\nexport type SuspendMemberBody = z.infer<typeof suspendMemberBodySchema>;\n"]}
|
|
@@ -53,8 +53,8 @@ export type ModerationContextKind = z.infer<typeof moderationContextKindSchema>;
|
|
|
53
53
|
/** Where a post, poll, comment, product or review stands. */
|
|
54
54
|
export declare const MODERATION_STATE_VALUES: readonly ["visible", "hidden", "removed"];
|
|
55
55
|
export declare const moderationStateSchema: z.ZodEnum<{
|
|
56
|
-
visible: "visible";
|
|
57
56
|
hidden: "hidden";
|
|
57
|
+
visible: "visible";
|
|
58
58
|
removed: "removed";
|
|
59
59
|
}>;
|
|
60
60
|
export type ModerationState = z.infer<typeof moderationStateSchema>;
|
|
@@ -109,8 +109,8 @@ export declare const moderationItemSchema: z.ZodObject<{
|
|
|
109
109
|
}, z.core.$strip>;
|
|
110
110
|
createdAt: z.ZodISODateTime;
|
|
111
111
|
state: z.ZodEnum<{
|
|
112
|
-
visible: "visible";
|
|
113
112
|
hidden: "hidden";
|
|
113
|
+
visible: "visible";
|
|
114
114
|
removed: "removed";
|
|
115
115
|
}>;
|
|
116
116
|
reports: z.ZodObject<{
|
|
@@ -167,8 +167,8 @@ export declare const moderationPageSchema: z.ZodObject<{
|
|
|
167
167
|
}, z.core.$strip>;
|
|
168
168
|
createdAt: z.ZodISODateTime;
|
|
169
169
|
state: z.ZodEnum<{
|
|
170
|
-
visible: "visible";
|
|
171
170
|
hidden: "hidden";
|
|
171
|
+
visible: "visible";
|
|
172
172
|
removed: "removed";
|
|
173
173
|
}>;
|
|
174
174
|
reports: z.ZodObject<{
|
|
@@ -203,8 +203,8 @@ export declare const moderationContentQuerySchema: z.ZodObject<{
|
|
|
203
203
|
limit: z.ZodPreprocess<z.ZodDefault<z.ZodCoercedNumber<unknown>>, unknown>;
|
|
204
204
|
cursor: z.ZodOptional<z.ZodString>;
|
|
205
205
|
state: z.ZodPreprocess<z.ZodDefault<z.ZodEnum<{
|
|
206
|
-
visible: "visible";
|
|
207
206
|
hidden: "hidden";
|
|
207
|
+
visible: "visible";
|
|
208
208
|
removed: "removed";
|
|
209
209
|
}>>, unknown>;
|
|
210
210
|
}, z.core.$strip>;
|
|
@@ -43,12 +43,17 @@ import { z } from 'zod';
|
|
|
43
43
|
* post_reaction someone reacted to your post or poll (0.8.0)
|
|
44
44
|
* comment_reaction someone reacted to your comment (0.8.0)
|
|
45
45
|
* repost someone reposted your post or poll (0.8.0)
|
|
46
|
+
* community_join_request someone asked to join a community you moderate (0.9.0)
|
|
47
|
+
* community_request_approved your request to join was approved (always delivered)
|
|
48
|
+
* community_invite a community invited you (always delivered)
|
|
49
|
+
* community_announcement a community you are in pinned an announcement for everyone
|
|
50
|
+
* community_suggestion_decided your community suggestion was approved or declined (always delivered)
|
|
46
51
|
*
|
|
47
52
|
* The three 0.8.0 kinds merge per target like the others. A reaction counts
|
|
48
53
|
* once: changing it to another type is not a new event, and taking it back
|
|
49
54
|
* does not take the event back.
|
|
50
55
|
*/
|
|
51
|
-
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", "post_reaction", "comment_reaction", "repost"];
|
|
56
|
+
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", "post_reaction", "comment_reaction", "repost", "community_join_request", "community_request_approved", "community_invite", "community_announcement", "community_suggestion_decided"];
|
|
52
57
|
export declare const notificationKindSchema: z.ZodEnum<{
|
|
53
58
|
feedback_helpful: "feedback_helpful";
|
|
54
59
|
tester_confirmed: "tester_confirmed";
|
|
@@ -61,11 +66,17 @@ export declare const notificationKindSchema: z.ZodEnum<{
|
|
|
61
66
|
post_reaction: "post_reaction";
|
|
62
67
|
comment_reaction: "comment_reaction";
|
|
63
68
|
repost: "repost";
|
|
69
|
+
community_join_request: "community_join_request";
|
|
70
|
+
community_request_approved: "community_request_approved";
|
|
71
|
+
community_invite: "community_invite";
|
|
72
|
+
community_announcement: "community_announcement";
|
|
73
|
+
community_suggestion_decided: "community_suggestion_decided";
|
|
64
74
|
}>;
|
|
65
75
|
export type NotificationKind = z.infer<typeof notificationKindSchema>;
|
|
66
76
|
/** The switches a member has, each covering one or more kinds. */
|
|
67
|
-
export declare const NOTIFICATION_PREFERENCE_VALUES: readonly ["comments", "replies", "productActivity", "recognition", "reactions", "reposts"];
|
|
77
|
+
export declare const NOTIFICATION_PREFERENCE_VALUES: readonly ["comments", "replies", "productActivity", "recognition", "reactions", "reposts", "communities"];
|
|
68
78
|
export declare const notificationPreferenceSchema: z.ZodEnum<{
|
|
79
|
+
communities: "communities";
|
|
69
80
|
comments: "comments";
|
|
70
81
|
replies: "replies";
|
|
71
82
|
productActivity: "productActivity";
|
|
@@ -90,6 +101,11 @@ export declare const NOTIFICATION_PREFERENCE_OF: {
|
|
|
90
101
|
readonly post_reaction: "reactions";
|
|
91
102
|
readonly comment_reaction: "reactions";
|
|
92
103
|
readonly repost: "reposts";
|
|
104
|
+
readonly community_join_request: "communities";
|
|
105
|
+
readonly community_request_approved: null;
|
|
106
|
+
readonly community_invite: null;
|
|
107
|
+
readonly community_announcement: "communities";
|
|
108
|
+
readonly community_suggestion_decided: null;
|
|
93
109
|
};
|
|
94
110
|
/**
|
|
95
111
|
* One row of the bell. Which of the optional targets are present depends on
|
|
@@ -106,6 +122,16 @@ export declare const NOTIFICATION_PREFERENCE_OF: {
|
|
|
106
122
|
* post_reaction content, reaction
|
|
107
123
|
* comment_reaction content, commentId, reaction, excerpt (your comment)
|
|
108
124
|
* repost content (yours, the one reposted), repostId (the latest repost, to read their words)
|
|
125
|
+
* community_join_request community
|
|
126
|
+
* community_request_approved community
|
|
127
|
+
* community_invite community
|
|
128
|
+
* community_announcement community, content (the pinned post or poll)
|
|
129
|
+
* community_suggestion_decided suggestion, community (once approved)
|
|
130
|
+
*
|
|
131
|
+
* Any row about something inside a community also carries `community`
|
|
132
|
+
* (0.9.0), whatever its kind. When the recipient leaves the community, is
|
|
133
|
+
* removed or is banned, its rows about that community lose their content,
|
|
134
|
+
* comment, excerpt and repost: what they could read there, they no longer can.
|
|
109
135
|
*
|
|
110
136
|
* A target that no longer exists (a deleted post, product or review) is
|
|
111
137
|
* absent rather than pointing at a 404; the row still says what happened.
|
|
@@ -124,6 +150,11 @@ export declare const notificationSchema: z.ZodObject<{
|
|
|
124
150
|
post_reaction: "post_reaction";
|
|
125
151
|
comment_reaction: "comment_reaction";
|
|
126
152
|
repost: "repost";
|
|
153
|
+
community_join_request: "community_join_request";
|
|
154
|
+
community_request_approved: "community_request_approved";
|
|
155
|
+
community_invite: "community_invite";
|
|
156
|
+
community_announcement: "community_announcement";
|
|
157
|
+
community_suggestion_decided: "community_suggestion_decided";
|
|
127
158
|
}>;
|
|
128
159
|
actor: z.ZodNullable<z.ZodObject<{
|
|
129
160
|
userId: z.ZodString;
|
|
@@ -149,6 +180,27 @@ export declare const notificationSchema: z.ZodObject<{
|
|
|
149
180
|
}, z.core.$strip>>;
|
|
150
181
|
reviewId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
151
182
|
repostId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
183
|
+
community: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
185
|
+
slug: z.ZodString;
|
|
186
|
+
name: z.ZodString;
|
|
187
|
+
iconUrl: z.ZodOptional<z.ZodURL>;
|
|
188
|
+
visibility: z.ZodEnum<{
|
|
189
|
+
public: "public";
|
|
190
|
+
private: "private";
|
|
191
|
+
hidden: "hidden";
|
|
192
|
+
}>;
|
|
193
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
194
|
+
}, z.core.$strip>>;
|
|
195
|
+
suggestion: z.ZodOptional<z.ZodObject<{
|
|
196
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
197
|
+
name: z.ZodString;
|
|
198
|
+
status: z.ZodEnum<{
|
|
199
|
+
approved: "approved";
|
|
200
|
+
declined: "declined";
|
|
201
|
+
}>;
|
|
202
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
203
|
+
}, z.core.$strip>>;
|
|
152
204
|
role: z.ZodOptional<z.ZodEnum<{
|
|
153
205
|
team: "team";
|
|
154
206
|
cofounder: "cofounder";
|
|
@@ -183,6 +235,11 @@ export declare const notificationPageSchema: z.ZodObject<{
|
|
|
183
235
|
post_reaction: "post_reaction";
|
|
184
236
|
comment_reaction: "comment_reaction";
|
|
185
237
|
repost: "repost";
|
|
238
|
+
community_join_request: "community_join_request";
|
|
239
|
+
community_request_approved: "community_request_approved";
|
|
240
|
+
community_invite: "community_invite";
|
|
241
|
+
community_announcement: "community_announcement";
|
|
242
|
+
community_suggestion_decided: "community_suggestion_decided";
|
|
186
243
|
}>;
|
|
187
244
|
actor: z.ZodNullable<z.ZodObject<{
|
|
188
245
|
userId: z.ZodString;
|
|
@@ -208,6 +265,27 @@ export declare const notificationPageSchema: z.ZodObject<{
|
|
|
208
265
|
}, z.core.$strip>>;
|
|
209
266
|
reviewId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
210
267
|
repostId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
268
|
+
community: z.ZodOptional<z.ZodObject<{
|
|
269
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
270
|
+
slug: z.ZodString;
|
|
271
|
+
name: z.ZodString;
|
|
272
|
+
iconUrl: z.ZodOptional<z.ZodURL>;
|
|
273
|
+
visibility: z.ZodEnum<{
|
|
274
|
+
public: "public";
|
|
275
|
+
private: "private";
|
|
276
|
+
hidden: "hidden";
|
|
277
|
+
}>;
|
|
278
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
279
|
+
}, z.core.$strip>>;
|
|
280
|
+
suggestion: z.ZodOptional<z.ZodObject<{
|
|
281
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
282
|
+
name: z.ZodString;
|
|
283
|
+
status: z.ZodEnum<{
|
|
284
|
+
approved: "approved";
|
|
285
|
+
declined: "declined";
|
|
286
|
+
}>;
|
|
287
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
288
|
+
}, z.core.$strip>>;
|
|
211
289
|
role: z.ZodOptional<z.ZodEnum<{
|
|
212
290
|
team: "team";
|
|
213
291
|
cofounder: "cofounder";
|
|
@@ -246,6 +324,7 @@ export declare const notificationPreferencesSchema: z.ZodObject<{
|
|
|
246
324
|
recognition: z.ZodBoolean;
|
|
247
325
|
reactions: z.ZodBoolean;
|
|
248
326
|
reposts: z.ZodBoolean;
|
|
327
|
+
communities: z.ZodBoolean;
|
|
249
328
|
}, z.core.$strip>;
|
|
250
329
|
export type NotificationPreferences = z.infer<typeof notificationPreferencesSchema>;
|
|
251
330
|
/** Only the switches that changed; no defaults (a patch states what was sent). */
|
|
@@ -256,6 +335,7 @@ export declare const updateNotificationPreferencesBodySchema: z.ZodObject<{
|
|
|
256
335
|
recognition: z.ZodOptional<z.ZodBoolean>;
|
|
257
336
|
reactions: z.ZodOptional<z.ZodBoolean>;
|
|
258
337
|
reposts: z.ZodOptional<z.ZodBoolean>;
|
|
338
|
+
communities: z.ZodOptional<z.ZodBoolean>;
|
|
259
339
|
}, z.core.$strip>;
|
|
260
340
|
export type UpdateNotificationPreferencesBody = z.infer<typeof updateNotificationPreferencesBodySchema>;
|
|
261
341
|
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/domains/notifications/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/domains/notifications/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,wBAAwB,8VAiB3B,CAAC;AACX,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;EAAmC,CAAC;AACvE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,kEAAkE;AAClE,eAAO,MAAM,8BAA8B,2GAQjC,CAAC;AACX,eAAO,MAAM,4BAA4B;;;;;;;;EAAyC,CAAC;AACnF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;CAiBqC,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmD7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAsC,CAAC;AAC1E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,iBAAiB;AACjB,eAAO,MAAM,6BAA6B;;iBAExC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,wBAAwB;;iBAA+C,CAAC;AACrF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,+CAA+C;AAC/C,eAAO,MAAM,6BAA6B;;;;;;;;iBAWxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,kFAAkF;AAClF,eAAO,MAAM,uCAAuC;;;;;;;;iBAQlD,CAAC;AACH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,uCAAuC,CAC/C,CAAC"}
|
|
@@ -32,6 +32,7 @@ import { z } from 'zod';
|
|
|
32
32
|
import { objectIdSchema } from '../../core/common.js';
|
|
33
33
|
import { NOTIFICATION_EXCERPT_MAX } from '../../core/limits.js';
|
|
34
34
|
import { paginatedSchema } from '../../core/responses.js';
|
|
35
|
+
import { communityChipSchema } from '../communities/communities.js';
|
|
35
36
|
import { contentKindSchema, reactionTypeSchema } from '../feed/feed.js';
|
|
36
37
|
import { productChipSchema, productInvitableRoleSchema } from '../products/products.js';
|
|
37
38
|
import { memberBylineSchema } from '../profile/founder-profile.js';
|
|
@@ -49,6 +50,11 @@ import { memberBylineSchema } from '../profile/founder-profile.js';
|
|
|
49
50
|
* post_reaction someone reacted to your post or poll (0.8.0)
|
|
50
51
|
* comment_reaction someone reacted to your comment (0.8.0)
|
|
51
52
|
* repost someone reposted your post or poll (0.8.0)
|
|
53
|
+
* community_join_request someone asked to join a community you moderate (0.9.0)
|
|
54
|
+
* community_request_approved your request to join was approved (always delivered)
|
|
55
|
+
* community_invite a community invited you (always delivered)
|
|
56
|
+
* community_announcement a community you are in pinned an announcement for everyone
|
|
57
|
+
* community_suggestion_decided your community suggestion was approved or declined (always delivered)
|
|
52
58
|
*
|
|
53
59
|
* The three 0.8.0 kinds merge per target like the others. A reaction counts
|
|
54
60
|
* once: changing it to another type is not a new event, and taking it back
|
|
@@ -66,6 +72,11 @@ export const NOTIFICATION_KIND_VALUES = [
|
|
|
66
72
|
'post_reaction',
|
|
67
73
|
'comment_reaction',
|
|
68
74
|
'repost',
|
|
75
|
+
'community_join_request',
|
|
76
|
+
'community_request_approved',
|
|
77
|
+
'community_invite',
|
|
78
|
+
'community_announcement',
|
|
79
|
+
'community_suggestion_decided',
|
|
69
80
|
];
|
|
70
81
|
export const notificationKindSchema = z.enum(NOTIFICATION_KIND_VALUES);
|
|
71
82
|
/** The switches a member has, each covering one or more kinds. */
|
|
@@ -76,6 +87,7 @@ export const NOTIFICATION_PREFERENCE_VALUES = [
|
|
|
76
87
|
'recognition',
|
|
77
88
|
'reactions',
|
|
78
89
|
'reposts',
|
|
90
|
+
'communities',
|
|
79
91
|
];
|
|
80
92
|
export const notificationPreferenceSchema = z.enum(NOTIFICATION_PREFERENCE_VALUES);
|
|
81
93
|
/**
|
|
@@ -94,6 +106,11 @@ export const NOTIFICATION_PREFERENCE_OF = {
|
|
|
94
106
|
post_reaction: 'reactions',
|
|
95
107
|
comment_reaction: 'reactions',
|
|
96
108
|
repost: 'reposts',
|
|
109
|
+
community_join_request: 'communities',
|
|
110
|
+
community_request_approved: null,
|
|
111
|
+
community_invite: null,
|
|
112
|
+
community_announcement: 'communities',
|
|
113
|
+
community_suggestion_decided: null,
|
|
97
114
|
};
|
|
98
115
|
/**
|
|
99
116
|
* One row of the bell. Which of the optional targets are present depends on
|
|
@@ -110,6 +127,16 @@ export const NOTIFICATION_PREFERENCE_OF = {
|
|
|
110
127
|
* post_reaction content, reaction
|
|
111
128
|
* comment_reaction content, commentId, reaction, excerpt (your comment)
|
|
112
129
|
* repost content (yours, the one reposted), repostId (the latest repost, to read their words)
|
|
130
|
+
* community_join_request community
|
|
131
|
+
* community_request_approved community
|
|
132
|
+
* community_invite community
|
|
133
|
+
* community_announcement community, content (the pinned post or poll)
|
|
134
|
+
* community_suggestion_decided suggestion, community (once approved)
|
|
135
|
+
*
|
|
136
|
+
* Any row about something inside a community also carries `community`
|
|
137
|
+
* (0.9.0), whatever its kind. When the recipient leaves the community, is
|
|
138
|
+
* removed or is banned, its rows about that community lose their content,
|
|
139
|
+
* comment, excerpt and repost: what they could read there, they no longer can.
|
|
113
140
|
*
|
|
114
141
|
* A target that no longer exists (a deleted post, product or review) is
|
|
115
142
|
* absent rather than pointing at a 404; the row still says what happened.
|
|
@@ -134,6 +161,21 @@ export const notificationSchema = z.object({
|
|
|
134
161
|
* reposter's words above your post. Gone once that repost is.
|
|
135
162
|
*/
|
|
136
163
|
repostId: objectIdSchema.optional(),
|
|
164
|
+
/**
|
|
165
|
+
* The community the row is about, or that its content is in (0.9.0). Absent
|
|
166
|
+
* once that community is deleted, or the recipient may no longer see it.
|
|
167
|
+
*/
|
|
168
|
+
community: communityChipSchema.optional(),
|
|
169
|
+
/** For `community_suggestion_decided` (0.9.0): which suggestion, and how it went. */
|
|
170
|
+
suggestion: z
|
|
171
|
+
.object({
|
|
172
|
+
id: objectIdSchema,
|
|
173
|
+
name: z.string(),
|
|
174
|
+
status: z.enum(['approved', 'declined']),
|
|
175
|
+
/** Why it was declined. */
|
|
176
|
+
reason: z.string().optional(),
|
|
177
|
+
})
|
|
178
|
+
.optional(),
|
|
137
179
|
/** For `product_invite`: the role offered. */
|
|
138
180
|
role: productInvitableRoleSchema.optional(),
|
|
139
181
|
/** For the reaction kinds: the latest reaction, as it is now (0.8.0). */
|
|
@@ -167,6 +209,8 @@ export const notificationPreferencesSchema = z.object({
|
|
|
167
209
|
reactions: z.boolean(),
|
|
168
210
|
/** Reposts of your posts and polls (0.8.0). */
|
|
169
211
|
reposts: z.boolean(),
|
|
212
|
+
/** Announcements in your communities, and join requests to communities you moderate (0.9.0). */
|
|
213
|
+
communities: z.boolean(),
|
|
170
214
|
});
|
|
171
215
|
/** Only the switches that changed; no defaults (a patch states what was sent). */
|
|
172
216
|
export const updateNotificationPreferencesBodySchema = z.object({
|
|
@@ -176,5 +220,6 @@ export const updateNotificationPreferencesBodySchema = z.object({
|
|
|
176
220
|
recognition: z.boolean().optional(),
|
|
177
221
|
reactions: z.boolean().optional(),
|
|
178
222
|
reposts: z.boolean().optional(),
|
|
223
|
+
communities: z.boolean().optional(),
|
|
179
224
|
});
|
|
180
225
|
//# sourceMappingURL=notifications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../src/domains/notifications/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,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AE;IACrB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE;IACxB,2DAA2D;IAC3D,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,+CAA+C;IAC/C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,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;IACnC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAChC,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 * (\"2 new comments, latest from Asha\"), it never adds one. `count` is how\n * many events it holds and `actor` the latest. A member repeating the same\n * act (reacting, taking it back, reacting again) does not ring it again.\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, reactionTypeSchema } 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 * post_reaction someone reacted to your post or poll (0.8.0)\n * comment_reaction someone reacted to your comment (0.8.0)\n * repost someone reposted your post or poll (0.8.0)\n *\n * The three 0.8.0 kinds merge per target like the others. A reaction counts\n * once: changing it to another type is not a new event, and taking it back\n * does not take the event back.\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 'post_reaction',\n 'comment_reaction',\n 'repost',\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 'reactions',\n 'reposts',\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 post_reaction: 'reactions',\n comment_reaction: 'reactions',\n repost: 'reposts',\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 * post_reaction content, reaction\n * comment_reaction content, commentId, reaction, excerpt (your comment)\n * repost content (yours, the one reposted), repostId (the latest repost, to read their words)\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 /**\n * How many EVENTS this row merges, at least 1: three comments by one person\n * are 3. Word it as events (\"3 new comments, latest from Asha\"), never as\n * people (\"Asha and 2 others\"), which this count does not know.\n */\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 /**\n * For `repost` (0.8.0): the latest repost itself, so the row opens the\n * reposter's words above your post. Gone once that repost is.\n */\n repostId: objectIdSchema.optional(),\n /** For `product_invite`: the role offered. */\n role: productInvitableRoleSchema.optional(),\n /** For the reaction kinds: the latest reaction, as it is now (0.8.0). */\n reaction: reactionTypeSchema.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 /** Reactions to your posts, polls and comments (0.8.0). */\n reactions: z.boolean(),\n /** Reposts of your posts and polls (0.8.0). */\n reposts: 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 reactions: z.boolean().optional(),\n reposts: z.boolean().optional(),\n});\nexport type UpdateNotificationPreferencesBody = z.infer<\n typeof updateNotificationPreferencesBodySchema\n>;\n"]}
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../src/domains/notifications/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,iBAAiB;IACjB,kBAAkB;IAClB,gBAAgB;IAChB,yBAAyB;IACzB,gBAAgB;IAChB,cAAc;IACd,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;IACf,kBAAkB;IAClB,QAAQ;IACR,wBAAwB;IACxB,4BAA4B;IAC5B,kBAAkB;IAClB,wBAAwB;IACxB,8BAA8B;CACtB,CAAC;AACX,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;AAGvE,kEAAkE;AAClE,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,UAAU;IACV,SAAS;IACT,iBAAiB;IACjB,aAAa;IACb,WAAW;IACX,SAAS;IACT,aAAa;CACL,CAAC;AACX,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;AAGnF;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0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AAE;IAC5B,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE;IACxB,2DAA2D;IAC3D,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,+CAA+C;IAC/C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,gGAAgG;IAChG,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;IACnC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,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 * (\"2 new comments, latest from Asha\"), it never adds one. `count` is how\n * many events it holds and `actor` the latest. A member repeating the same\n * act (reacting, taking it back, reacting again) does not ring it again.\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 { communityChipSchema } from '../communities/communities.js';\nimport { contentKindSchema, reactionTypeSchema } 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 * post_reaction someone reacted to your post or poll (0.8.0)\n * comment_reaction someone reacted to your comment (0.8.0)\n * repost someone reposted your post or poll (0.8.0)\n * community_join_request someone asked to join a community you moderate (0.9.0)\n * community_request_approved your request to join was approved (always delivered)\n * community_invite a community invited you (always delivered)\n * community_announcement a community you are in pinned an announcement for everyone\n * community_suggestion_decided your community suggestion was approved or declined (always delivered)\n *\n * The three 0.8.0 kinds merge per target like the others. A reaction counts\n * once: changing it to another type is not a new event, and taking it back\n * does not take the event back.\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 'post_reaction',\n 'comment_reaction',\n 'repost',\n 'community_join_request',\n 'community_request_approved',\n 'community_invite',\n 'community_announcement',\n 'community_suggestion_decided',\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 'reactions',\n 'reposts',\n 'communities',\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 post_reaction: 'reactions',\n comment_reaction: 'reactions',\n repost: 'reposts',\n community_join_request: 'communities',\n community_request_approved: null,\n community_invite: null,\n community_announcement: 'communities',\n community_suggestion_decided: null,\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 * post_reaction content, reaction\n * comment_reaction content, commentId, reaction, excerpt (your comment)\n * repost content (yours, the one reposted), repostId (the latest repost, to read their words)\n * community_join_request community\n * community_request_approved community\n * community_invite community\n * community_announcement community, content (the pinned post or poll)\n * community_suggestion_decided suggestion, community (once approved)\n *\n * Any row about something inside a community also carries `community`\n * (0.9.0), whatever its kind. When the recipient leaves the community, is\n * removed or is banned, its rows about that community lose their content,\n * comment, excerpt and repost: what they could read there, they no longer can.\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 /**\n * How many EVENTS this row merges, at least 1: three comments by one person\n * are 3. Word it as events (\"3 new comments, latest from Asha\"), never as\n * people (\"Asha and 2 others\"), which this count does not know.\n */\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 /**\n * For `repost` (0.8.0): the latest repost itself, so the row opens the\n * reposter's words above your post. Gone once that repost is.\n */\n repostId: objectIdSchema.optional(),\n /**\n * The community the row is about, or that its content is in (0.9.0). Absent\n * once that community is deleted, or the recipient may no longer see it.\n */\n community: communityChipSchema.optional(),\n /** For `community_suggestion_decided` (0.9.0): which suggestion, and how it went. */\n suggestion: z\n .object({\n id: objectIdSchema,\n name: z.string(),\n status: z.enum(['approved', 'declined']),\n /** Why it was declined. */\n reason: z.string().optional(),\n })\n .optional(),\n /** For `product_invite`: the role offered. */\n role: productInvitableRoleSchema.optional(),\n /** For the reaction kinds: the latest reaction, as it is now (0.8.0). */\n reaction: reactionTypeSchema.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 /** Reactions to your posts, polls and comments (0.8.0). */\n reactions: z.boolean(),\n /** Reposts of your posts and polls (0.8.0). */\n reposts: z.boolean(),\n /** Announcements in your communities, and join requests to communities you moderate (0.9.0). */\n communities: 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 reactions: z.boolean().optional(),\n reposts: z.boolean().optional(),\n communities: z.boolean().optional(),\n});\nexport type UpdateNotificationPreferencesBody = z.infer<\n typeof updateNotificationPreferencesBodySchema\n>;\n"]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* GET /api/v1/team the people holding a platform role
|
|
5
5
|
* PUT /api/v1/team/:memberId/roles set someone's platform roles
|
|
6
|
+
* PUT /api/v1/team/:memberId/capabilities set someone's capabilities (0.9.0)
|
|
6
7
|
* DELETE /api/v1/team/:memberId/mpin clear a forgotten MPIN (superadmin;
|
|
7
8
|
* answers `IdResponse`)
|
|
8
9
|
*
|
|
@@ -76,4 +77,25 @@ export declare const setMemberRolesResponseSchema: z.ZodObject<{
|
|
|
76
77
|
}>>;
|
|
77
78
|
}, z.core.$strip>;
|
|
78
79
|
export type SetMemberRolesResponse = z.infer<typeof setMemberRolesResponseSchema>;
|
|
80
|
+
/**
|
|
81
|
+
* `PUT /team/:memberId/capabilities` (0.9.0): the capabilities the person
|
|
82
|
+
* should hold, as a whole set. Every one that changes must be one the actor's
|
|
83
|
+
* active role may grant (`CAPABILITY_GRANTED_BY`, else
|
|
84
|
+
* `CAPABILITY_NOT_GRANTABLE`); never one's own (`CANNOT_CHANGE_OWN_CAPABILITIES`).
|
|
85
|
+
* Sending what they already hold changes nothing and writes no audit entry.
|
|
86
|
+
*/
|
|
87
|
+
export declare const setMemberCapabilitiesBodySchema: z.ZodObject<{
|
|
88
|
+
capabilities: z.ZodArray<z.ZodEnum<{
|
|
89
|
+
create_communities: "create_communities";
|
|
90
|
+
}>>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export type SetMemberCapabilitiesBody = z.infer<typeof setMemberCapabilitiesBodySchema>;
|
|
93
|
+
/** What it answers: the capabilities the person now holds. */
|
|
94
|
+
export declare const setMemberCapabilitiesResponseSchema: z.ZodObject<{
|
|
95
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
96
|
+
capabilities: z.ZodArray<z.ZodEnum<{
|
|
97
|
+
create_communities: "create_communities";
|
|
98
|
+
}>>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export type SetMemberCapabilitiesResponse = z.infer<typeof setMemberCapabilitiesResponseSchema>;
|
|
79
101
|
//# sourceMappingURL=team.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../../../src/domains/team/team.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../../../src/domains/team/team.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,sCAAsC;AACtC,eAAO,MAAM,sBAAsB;;iBAAyC,CAAC;AAC7E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;iBAS3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;iBAAoC,CAAC;AAChE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;iBAOnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,+FAA+F;AAC/F,eAAO,MAAM,4BAA4B;;;;;;;;iBAGvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B;;;;iBAO1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,8DAA8D;AAC9D,eAAO,MAAM,mCAAmC;;;;;iBAG9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* GET /api/v1/team the people holding a platform role
|
|
5
5
|
* PUT /api/v1/team/:memberId/roles set someone's platform roles
|
|
6
|
+
* PUT /api/v1/team/:memberId/capabilities set someone's capabilities (0.9.0)
|
|
6
7
|
* DELETE /api/v1/team/:memberId/mpin clear a forgotten MPIN (superadmin;
|
|
7
8
|
* answers `IdResponse`)
|
|
8
9
|
*
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
* @module founder-schema/domains/team
|
|
16
17
|
*/
|
|
17
18
|
import { z } from 'zod';
|
|
19
|
+
import { CAPABILITY_VALUES, capabilitySchema } from '../../access/capabilities.js';
|
|
18
20
|
import { PLATFORM_ROLE_VALUES, platformRoleSchema } from '../../access/roles.js';
|
|
19
21
|
import { objectIdSchema } from '../../core/common.js';
|
|
20
22
|
import { paginatedSchema } from '../../core/responses.js';
|
|
@@ -51,4 +53,24 @@ export const setMemberRolesResponseSchema = z.object({
|
|
|
51
53
|
id: objectIdSchema,
|
|
52
54
|
roles: z.array(platformRoleSchema),
|
|
53
55
|
});
|
|
56
|
+
/**
|
|
57
|
+
* `PUT /team/:memberId/capabilities` (0.9.0): the capabilities the person
|
|
58
|
+
* should hold, as a whole set. Every one that changes must be one the actor's
|
|
59
|
+
* active role may grant (`CAPABILITY_GRANTED_BY`, else
|
|
60
|
+
* `CAPABILITY_NOT_GRANTABLE`); never one's own (`CANNOT_CHANGE_OWN_CAPABILITIES`).
|
|
61
|
+
* Sending what they already hold changes nothing and writes no audit entry.
|
|
62
|
+
*/
|
|
63
|
+
export const setMemberCapabilitiesBodySchema = z.object({
|
|
64
|
+
capabilities: z
|
|
65
|
+
.array(capabilitySchema)
|
|
66
|
+
.max(CAPABILITY_VALUES.length)
|
|
67
|
+
.refine((list) => new Set(list).size === list.length, {
|
|
68
|
+
error: VALIDATION_MESSAGE.capabilitiesDuplicate,
|
|
69
|
+
}),
|
|
70
|
+
});
|
|
71
|
+
/** What it answers: the capabilities the person now holds. */
|
|
72
|
+
export const setMemberCapabilitiesResponseSchema = z.object({
|
|
73
|
+
id: objectIdSchema,
|
|
74
|
+
capabilities: z.array(capabilitySchema),
|
|
75
|
+
});
|
|
54
76
|
//# sourceMappingURL=team.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team.js","sourceRoot":"","sources":["../../../src/domains/team/team.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kB,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;SACjD,GAAG,CAAC,oBAAoB,CAAC,MAAM,CAAC;SAChC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,EAAE;QACvD,KAAK,EAAE,kBAAkB,CAAC,cAAc;KACzC,CAAC;CACL,CAAC,CAAC;AAGH,+FAA+F;AAC/F,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,EAAE,EAAE,cAAc;IAClB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC;CACnC,CAAC,CAAC;AAGH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,YAAY,EAAE,CAAC;SACZ,KAAK,CAAC,gBAAgB,CAAC;SACvB,GAAG,CAAC,iBAAiB,CAAC,MAAM,CAAC;SAC7B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE;QACpD,KAAK,EAAE,kBAAkB,CAAC,qBAAqB;KAChD,CAAC;CACL,CAAC,CAAC;AAGH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1D,EAAE,EAAE,cAAc;IAClB,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;CACxC,CAAC,CAAC","sourcesContent":["/**\n * founder-schema: the staff team\n *\n * GET /api/v1/team the people holding a platform role\n * PUT /api/v1/team/:memberId/roles set someone's platform roles\n * PUT /api/v1/team/:memberId/capabilities set someone's capabilities (0.9.0)\n * DELETE /api/v1/team/:memberId/mpin clear a forgotten MPIN (superadmin;\n * answers `IdResponse`)\n *\n * Setting roles sends the person's WHOLE set, so the request says what they\n * should end up with rather than a list of changes to replay. Every role that\n * changes must be one the actor's active role may grant (`ROLE_GRANTED_BY`);\n * nobody changes their own; superadmin is never in a request. Each change is\n * written to the audit log.\n *\n * @module founder-schema/domains/team\n */\n\nimport { z } from 'zod';\nimport { CAPABILITY_VALUES, capabilitySchema } from '../../access/capabilities.js';\nimport { PLATFORM_ROLE_VALUES, platformRoleSchema } from '../../access/roles.js';\nimport { objectIdSchema } from '../../core/common.js';\nimport { paginatedSchema } from '../../core/responses.js';\nimport { VALIDATION_MESSAGE } from '../../core/validation.js';\n\n/** `:memberId` in the paths above. */\nexport const teamMemberParamsSchema = z.object({ memberId: objectIdSchema });\nexport type TeamMemberParams = z.infer<typeof teamMemberParamsSchema>;\n\n/** One person on the team, as the Team screens list them. */\nexport const teamMemberSchema = z.object({\n id: objectIdSchema,\n displayName: z.string(),\n /** Server-set or from the login provider, like every avatar on the wire: a plain URL check. */\n avatarUrl: z.url().nullable(),\n email: z.string().nullable(),\n /** Their platform roles, highest first. Never empty in this list. */\n roles: z.array(platformRoleSchema).min(1),\n mpinSet: z.boolean(),\n});\nexport type TeamMember = z.infer<typeof teamMemberSchema>;\n\nexport const teamPageSchema = paginatedSchema(teamMemberSchema);\nexport type TeamPage = z.infer<typeof teamPageSchema>;\n\n/**\n * `PUT /team/:memberId/roles`: the platform roles the person should hold.\n * Empty takes every staff role away. No duplicates; no superadmin (a server\n * script grants it, never the product).\n */\nexport const setMemberRolesBodySchema = z.object({\n roles: z\n .array(platformRoleSchema.exclude(['superadmin']))\n .max(PLATFORM_ROLE_VALUES.length)\n .refine((roles) => new Set(roles).size === roles.length, {\n error: VALIDATION_MESSAGE.rolesDuplicate,\n }),\n});\nexport type SetMemberRolesBody = z.infer<typeof setMemberRolesBodySchema>;\n\n/** What `PUT /team/:memberId/roles` answers: the roles the person now holds, highest first. */\nexport const setMemberRolesResponseSchema = z.object({\n id: objectIdSchema,\n roles: z.array(platformRoleSchema),\n});\nexport type SetMemberRolesResponse = z.infer<typeof setMemberRolesResponseSchema>;\n\n/**\n * `PUT /team/:memberId/capabilities` (0.9.0): the capabilities the person\n * should hold, as a whole set. Every one that changes must be one the actor's\n * active role may grant (`CAPABILITY_GRANTED_BY`, else\n * `CAPABILITY_NOT_GRANTABLE`); never one's own (`CANNOT_CHANGE_OWN_CAPABILITIES`).\n * Sending what they already hold changes nothing and writes no audit entry.\n */\nexport const setMemberCapabilitiesBodySchema = z.object({\n capabilities: z\n .array(capabilitySchema)\n .max(CAPABILITY_VALUES.length)\n .refine((list) => new Set(list).size === list.length, {\n error: VALIDATION_MESSAGE.capabilitiesDuplicate,\n }),\n});\nexport type SetMemberCapabilitiesBody = z.infer<typeof setMemberCapabilitiesBodySchema>;\n\n/** What it answers: the capabilities the person now holds. */\nexport const setMemberCapabilitiesResponseSchema = z.object({\n id: objectIdSchema,\n capabilities: z.array(capabilitySchema),\n});\nexport type SetMemberCapabilitiesResponse = z.infer<typeof setMemberCapabilitiesResponseSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["../../../src/domains/uploads/uploads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,gDAAiD,CAAC;AACpF,eAAO,MAAM,wBAAwB;;;;;;EAAgC,CAAC;AACtE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,oBAAoB;;;;;;CAMiC,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,mGAAmG;AACnG,eAAO,MAAM,kBAAkB,QAE9B,CAAC;AAEF,8CAA8C;AAC9C,eAAO,MAAM,eAAe,aAMuD,CAAC;AACpF,8CAA8C;AAC9C,MAAM,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