founder-schema 0.5.0 → 0.7.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 +67 -0
- 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 +44 -0
- package/dist/core/common.d.ts.map +1 -1
- package/dist/core/common.js +76 -0
- package/dist/core/common.js.map +1 -1
- package/dist/core/errors.d.ts +29 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +52 -1
- package/dist/core/errors.js.map +1 -1
- package/dist/core/limits.d.ts +53 -0
- package/dist/core/limits.d.ts.map +1 -1
- package/dist/core/limits.js +57 -0
- package/dist/core/limits.js.map +1 -1
- package/dist/core/responses.d.ts +43 -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 +14 -0
- package/dist/core/validation.d.ts.map +1 -1
- package/dist/core/validation.js +14 -0
- package/dist/core/validation.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 +165 -0
- package/dist/domains/contributions/contributions.d.ts.map +1 -0
- package/dist/domains/contributions/contributions.js +103 -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 +231 -7
- package/dist/domains/feed/feed.d.ts.map +1 -1
- package/dist/domains/feed/feed.js +86 -18
- package/dist/domains/feed/feed.js.map +1 -1
- package/dist/domains/media/media.d.ts +30 -5
- package/dist/domains/media/media.d.ts.map +1 -1
- package/dist/domains/media/media.js +32 -6
- package/dist/domains/media/media.js.map +1 -1
- 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 +148 -0
- package/dist/domains/notifications/notifications.js.map +1 -0
- package/dist/domains/onboarding/onboarding.d.ts +10 -13
- package/dist/domains/onboarding/onboarding.d.ts.map +1 -1
- package/dist/domains/onboarding/onboarding.js +6 -5
- package/dist/domains/onboarding/onboarding.js.map +1 -1
- package/dist/domains/products/products.d.ts +1464 -0
- package/dist/domains/products/products.d.ts.map +1 -0
- package/dist/domains/products/products.js +474 -0
- package/dist/domains/products/products.js.map +1 -0
- package/dist/domains/profile/founder-profile.d.ts +43 -0
- package/dist/domains/profile/founder-profile.d.ts.map +1 -1
- package/dist/domains/profile/founder-profile.js +48 -0
- 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 +2 -0
- package/dist/domains/uploads/uploads.d.ts.map +1 -1
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
* DELIBERATELY NOT PORTED, so nobody "restores" them:
|
|
15
15
|
* - the five civic verticals (lost_found, suggestions_complaints,
|
|
16
16
|
* donate_item, crowdfunding, event). `contentKind` here is post | poll
|
|
17
|
-
* only; comment threads and bookmarks key off it,
|
|
18
|
-
* reports off
|
|
17
|
+
* only; comment threads and bookmarks key off it, reactions off the same
|
|
18
|
+
* union plus `comment`, and reports off that plus a product and a review
|
|
19
|
+
* (`reportTargetKindSchema`, 0.6.0).
|
|
19
20
|
* - official communities, designations, identity verification badges.
|
|
20
21
|
* - social score, and the whole area-proximity ranking vocabulary
|
|
21
22
|
* (local / district / state / national / global).
|
|
@@ -102,6 +103,20 @@ export declare const engagementTargetKindSchema: z.ZodEnum<{
|
|
|
102
103
|
comment: "comment";
|
|
103
104
|
}>;
|
|
104
105
|
export type EngagementTargetKind = z.infer<typeof engagementTargetKindSchema>;
|
|
106
|
+
/**
|
|
107
|
+
* What a member can REPORT (0.6.0): everything a reaction can reach, plus a
|
|
108
|
+
* product page and a review. Each has its own report route; the answer and the
|
|
109
|
+
* moderation queue use this one list.
|
|
110
|
+
*/
|
|
111
|
+
export declare const REPORT_TARGET_KIND_VALUES: readonly ["post", "poll", "comment", "product", "review"];
|
|
112
|
+
export declare const reportTargetKindSchema: z.ZodEnum<{
|
|
113
|
+
product: "product";
|
|
114
|
+
post: "post";
|
|
115
|
+
poll: "poll";
|
|
116
|
+
comment: "comment";
|
|
117
|
+
review: "review";
|
|
118
|
+
}>;
|
|
119
|
+
export type ReportTargetKind = z.infer<typeof reportTargetKindSchema>;
|
|
105
120
|
/**
|
|
106
121
|
* Reactions. Jansathi's `support` is dropped: it exists for reacting to a
|
|
107
122
|
* civic complaint or a lost-and-found notice, which this feed does not carry.
|
|
@@ -151,7 +166,8 @@ export declare const reactionCountsSchema: z.ZodRecord<z.ZodEnum<{
|
|
|
151
166
|
}> & z.core.$partial, z.ZodNumber>;
|
|
152
167
|
export type ReactionCounts = z.infer<typeof reactionCountsSchema>;
|
|
153
168
|
/**
|
|
154
|
-
* The author as a card renders them.
|
|
169
|
+
* The author as a card renders them: the shared `memberBylineSchema` (0.6.0),
|
|
170
|
+
* which products, reviews and notifications name members with too.
|
|
155
171
|
*
|
|
156
172
|
* Every field here is LIVE, joined against the profile at read time rather
|
|
157
173
|
* than frozen onto the post at write time. So a renamed handle, a new avatar
|
|
@@ -401,6 +417,18 @@ export declare const feedPostSchema: z.ZodObject<{
|
|
|
401
417
|
social_enterprise: "social_enterprise";
|
|
402
418
|
education_access: "education_access";
|
|
403
419
|
}>>;
|
|
420
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
421
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
422
|
+
slug: z.ZodString;
|
|
423
|
+
name: z.ZodString;
|
|
424
|
+
logoUrl: z.ZodOptional<z.ZodURL>;
|
|
425
|
+
}, z.core.$strip>>;
|
|
426
|
+
ask: z.ZodOptional<z.ZodEnum<{
|
|
427
|
+
feedback: "feedback";
|
|
428
|
+
testers: "testers";
|
|
429
|
+
launch: "launch";
|
|
430
|
+
ideas: "ideas";
|
|
431
|
+
}>>;
|
|
404
432
|
commentCount: z.ZodNumber;
|
|
405
433
|
reactionCounts: z.ZodRecord<z.ZodEnum<{
|
|
406
434
|
like: "like";
|
|
@@ -536,6 +564,18 @@ export declare const feedPollSchema: z.ZodObject<{
|
|
|
536
564
|
social_enterprise: "social_enterprise";
|
|
537
565
|
education_access: "education_access";
|
|
538
566
|
}>>;
|
|
567
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
568
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
569
|
+
slug: z.ZodString;
|
|
570
|
+
name: z.ZodString;
|
|
571
|
+
logoUrl: z.ZodOptional<z.ZodURL>;
|
|
572
|
+
}, z.core.$strip>>;
|
|
573
|
+
ask: z.ZodOptional<z.ZodEnum<{
|
|
574
|
+
feedback: "feedback";
|
|
575
|
+
testers: "testers";
|
|
576
|
+
launch: "launch";
|
|
577
|
+
ideas: "ideas";
|
|
578
|
+
}>>;
|
|
539
579
|
commentCount: z.ZodNumber;
|
|
540
580
|
reactionCounts: z.ZodRecord<z.ZodEnum<{
|
|
541
581
|
like: "like";
|
|
@@ -677,6 +717,18 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
677
717
|
social_enterprise: "social_enterprise";
|
|
678
718
|
education_access: "education_access";
|
|
679
719
|
}>>;
|
|
720
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
721
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
722
|
+
slug: z.ZodString;
|
|
723
|
+
name: z.ZodString;
|
|
724
|
+
logoUrl: z.ZodOptional<z.ZodURL>;
|
|
725
|
+
}, z.core.$strip>>;
|
|
726
|
+
ask: z.ZodOptional<z.ZodEnum<{
|
|
727
|
+
feedback: "feedback";
|
|
728
|
+
testers: "testers";
|
|
729
|
+
launch: "launch";
|
|
730
|
+
ideas: "ideas";
|
|
731
|
+
}>>;
|
|
680
732
|
commentCount: z.ZodNumber;
|
|
681
733
|
reactionCounts: z.ZodRecord<z.ZodEnum<{
|
|
682
734
|
like: "like";
|
|
@@ -791,6 +843,18 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
791
843
|
social_enterprise: "social_enterprise";
|
|
792
844
|
education_access: "education_access";
|
|
793
845
|
}>>;
|
|
846
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
847
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
848
|
+
slug: z.ZodString;
|
|
849
|
+
name: z.ZodString;
|
|
850
|
+
logoUrl: z.ZodOptional<z.ZodURL>;
|
|
851
|
+
}, z.core.$strip>>;
|
|
852
|
+
ask: z.ZodOptional<z.ZodEnum<{
|
|
853
|
+
feedback: "feedback";
|
|
854
|
+
testers: "testers";
|
|
855
|
+
launch: "launch";
|
|
856
|
+
ideas: "ideas";
|
|
857
|
+
}>>;
|
|
794
858
|
commentCount: z.ZodNumber;
|
|
795
859
|
reactionCounts: z.ZodRecord<z.ZodEnum<{
|
|
796
860
|
like: "like";
|
|
@@ -844,9 +908,13 @@ export declare const feedCommentSchema: z.ZodObject<{
|
|
|
844
908
|
insightful: "insightful";
|
|
845
909
|
curious: "curious";
|
|
846
910
|
}> & z.core.$partial, z.ZodNumber>;
|
|
911
|
+
helpfulAt: z.ZodNullable<z.ZodISODateTime>;
|
|
847
912
|
createdAt: z.ZodISODateTime;
|
|
848
913
|
editedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
849
914
|
viewer: z.ZodOptional<z.ZodObject<{
|
|
915
|
+
canEdit: z.ZodBoolean;
|
|
916
|
+
canDelete: z.ZodBoolean;
|
|
917
|
+
canReport: z.ZodBoolean;
|
|
850
918
|
reaction: z.ZodNullable<z.ZodEnum<{
|
|
851
919
|
like: "like";
|
|
852
920
|
celebrate: "celebrate";
|
|
@@ -854,9 +922,7 @@ export declare const feedCommentSchema: z.ZodObject<{
|
|
|
854
922
|
curious: "curious";
|
|
855
923
|
}>>;
|
|
856
924
|
isAuthor: z.ZodBoolean;
|
|
857
|
-
|
|
858
|
-
canDelete: z.ZodBoolean;
|
|
859
|
-
canReport: z.ZodBoolean;
|
|
925
|
+
canMarkHelpful: z.ZodBoolean;
|
|
860
926
|
}, z.core.$strip>>;
|
|
861
927
|
}, z.core.$strip>;
|
|
862
928
|
export type FeedComment = z.infer<typeof feedCommentSchema>;
|
|
@@ -1059,6 +1125,18 @@ export declare const feedPageSchema: z.ZodObject<{
|
|
|
1059
1125
|
social_enterprise: "social_enterprise";
|
|
1060
1126
|
education_access: "education_access";
|
|
1061
1127
|
}>>;
|
|
1128
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
1129
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1130
|
+
slug: z.ZodString;
|
|
1131
|
+
name: z.ZodString;
|
|
1132
|
+
logoUrl: z.ZodOptional<z.ZodURL>;
|
|
1133
|
+
}, z.core.$strip>>;
|
|
1134
|
+
ask: z.ZodOptional<z.ZodEnum<{
|
|
1135
|
+
feedback: "feedback";
|
|
1136
|
+
testers: "testers";
|
|
1137
|
+
launch: "launch";
|
|
1138
|
+
ideas: "ideas";
|
|
1139
|
+
}>>;
|
|
1062
1140
|
commentCount: z.ZodNumber;
|
|
1063
1141
|
reactionCounts: z.ZodRecord<z.ZodEnum<{
|
|
1064
1142
|
like: "like";
|
|
@@ -1173,6 +1251,18 @@ export declare const feedPageSchema: z.ZodObject<{
|
|
|
1173
1251
|
social_enterprise: "social_enterprise";
|
|
1174
1252
|
education_access: "education_access";
|
|
1175
1253
|
}>>;
|
|
1254
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
1255
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1256
|
+
slug: z.ZodString;
|
|
1257
|
+
name: z.ZodString;
|
|
1258
|
+
logoUrl: z.ZodOptional<z.ZodURL>;
|
|
1259
|
+
}, z.core.$strip>>;
|
|
1260
|
+
ask: z.ZodOptional<z.ZodEnum<{
|
|
1261
|
+
feedback: "feedback";
|
|
1262
|
+
testers: "testers";
|
|
1263
|
+
launch: "launch";
|
|
1264
|
+
ideas: "ideas";
|
|
1265
|
+
}>>;
|
|
1176
1266
|
commentCount: z.ZodNumber;
|
|
1177
1267
|
reactionCounts: z.ZodRecord<z.ZodEnum<{
|
|
1178
1268
|
like: "like";
|
|
@@ -1225,9 +1315,13 @@ export declare const commentPageSchema: z.ZodObject<{
|
|
|
1225
1315
|
insightful: "insightful";
|
|
1226
1316
|
curious: "curious";
|
|
1227
1317
|
}> & z.core.$partial, z.ZodNumber>;
|
|
1318
|
+
helpfulAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1228
1319
|
createdAt: z.ZodISODateTime;
|
|
1229
1320
|
editedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1230
1321
|
viewer: z.ZodOptional<z.ZodObject<{
|
|
1322
|
+
canEdit: z.ZodBoolean;
|
|
1323
|
+
canDelete: z.ZodBoolean;
|
|
1324
|
+
canReport: z.ZodBoolean;
|
|
1231
1325
|
reaction: z.ZodNullable<z.ZodEnum<{
|
|
1232
1326
|
like: "like";
|
|
1233
1327
|
celebrate: "celebrate";
|
|
@@ -1235,14 +1329,105 @@ export declare const commentPageSchema: z.ZodObject<{
|
|
|
1235
1329
|
curious: "curious";
|
|
1236
1330
|
}>>;
|
|
1237
1331
|
isAuthor: z.ZodBoolean;
|
|
1332
|
+
canMarkHelpful: z.ZodBoolean;
|
|
1333
|
+
}, z.core.$strip>>;
|
|
1334
|
+
}, z.core.$strip>>;
|
|
1335
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
1336
|
+
}, z.core.$strip>;
|
|
1337
|
+
export type CommentPage = z.infer<typeof commentPageSchema>;
|
|
1338
|
+
/**
|
|
1339
|
+
* A comment on a product's Feedback tab (`GET /products/:id/feedback`): the
|
|
1340
|
+
* comment as a thread shows it, plus whether its writer is already a
|
|
1341
|
+
* confirmed tester, so the team's "Confirm as tester" knows without paging
|
|
1342
|
+
* through `/testers`.
|
|
1343
|
+
*/
|
|
1344
|
+
export declare const productFeedbackItemSchema: z.ZodObject<{
|
|
1345
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1346
|
+
contentKind: z.ZodEnum<{
|
|
1347
|
+
post: "post";
|
|
1348
|
+
poll: "poll";
|
|
1349
|
+
}>;
|
|
1350
|
+
contentId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1351
|
+
parentCommentId: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1352
|
+
author: z.ZodObject<{
|
|
1353
|
+
userId: z.ZodString;
|
|
1354
|
+
username: z.ZodString;
|
|
1355
|
+
displayName: z.ZodString;
|
|
1356
|
+
avatarUrl: z.ZodOptional<z.ZodURL>;
|
|
1357
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
1358
|
+
}, z.core.$strip>;
|
|
1359
|
+
text: z.ZodString;
|
|
1360
|
+
replyCount: z.ZodNumber;
|
|
1361
|
+
reactionCounts: z.ZodRecord<z.ZodEnum<{
|
|
1362
|
+
like: "like";
|
|
1363
|
+
celebrate: "celebrate";
|
|
1364
|
+
insightful: "insightful";
|
|
1365
|
+
curious: "curious";
|
|
1366
|
+
}> & z.core.$partial, z.ZodNumber>;
|
|
1367
|
+
helpfulAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1368
|
+
createdAt: z.ZodISODateTime;
|
|
1369
|
+
editedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1370
|
+
viewer: z.ZodOptional<z.ZodObject<{
|
|
1371
|
+
canEdit: z.ZodBoolean;
|
|
1372
|
+
canDelete: z.ZodBoolean;
|
|
1373
|
+
canReport: z.ZodBoolean;
|
|
1374
|
+
reaction: z.ZodNullable<z.ZodEnum<{
|
|
1375
|
+
like: "like";
|
|
1376
|
+
celebrate: "celebrate";
|
|
1377
|
+
insightful: "insightful";
|
|
1378
|
+
curious: "curious";
|
|
1379
|
+
}>>;
|
|
1380
|
+
isAuthor: z.ZodBoolean;
|
|
1381
|
+
canMarkHelpful: z.ZodBoolean;
|
|
1382
|
+
}, z.core.$strip>>;
|
|
1383
|
+
authorIsTester: z.ZodBoolean;
|
|
1384
|
+
}, z.core.$strip>;
|
|
1385
|
+
export type ProductFeedbackItem = z.infer<typeof productFeedbackItemSchema>;
|
|
1386
|
+
export declare const productFeedbackPageSchema: z.ZodObject<{
|
|
1387
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1388
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1389
|
+
contentKind: z.ZodEnum<{
|
|
1390
|
+
post: "post";
|
|
1391
|
+
poll: "poll";
|
|
1392
|
+
}>;
|
|
1393
|
+
contentId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1394
|
+
parentCommentId: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1395
|
+
author: z.ZodObject<{
|
|
1396
|
+
userId: z.ZodString;
|
|
1397
|
+
username: z.ZodString;
|
|
1398
|
+
displayName: z.ZodString;
|
|
1399
|
+
avatarUrl: z.ZodOptional<z.ZodURL>;
|
|
1400
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
1401
|
+
}, z.core.$strip>;
|
|
1402
|
+
text: z.ZodString;
|
|
1403
|
+
replyCount: z.ZodNumber;
|
|
1404
|
+
reactionCounts: z.ZodRecord<z.ZodEnum<{
|
|
1405
|
+
like: "like";
|
|
1406
|
+
celebrate: "celebrate";
|
|
1407
|
+
insightful: "insightful";
|
|
1408
|
+
curious: "curious";
|
|
1409
|
+
}> & z.core.$partial, z.ZodNumber>;
|
|
1410
|
+
helpfulAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1411
|
+
createdAt: z.ZodISODateTime;
|
|
1412
|
+
editedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1413
|
+
viewer: z.ZodOptional<z.ZodObject<{
|
|
1238
1414
|
canEdit: z.ZodBoolean;
|
|
1239
1415
|
canDelete: z.ZodBoolean;
|
|
1240
1416
|
canReport: z.ZodBoolean;
|
|
1417
|
+
reaction: z.ZodNullable<z.ZodEnum<{
|
|
1418
|
+
like: "like";
|
|
1419
|
+
celebrate: "celebrate";
|
|
1420
|
+
insightful: "insightful";
|
|
1421
|
+
curious: "curious";
|
|
1422
|
+
}>>;
|
|
1423
|
+
isAuthor: z.ZodBoolean;
|
|
1424
|
+
canMarkHelpful: z.ZodBoolean;
|
|
1241
1425
|
}, z.core.$strip>>;
|
|
1426
|
+
authorIsTester: z.ZodBoolean;
|
|
1242
1427
|
}, z.core.$strip>>;
|
|
1243
1428
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
1244
1429
|
}, z.core.$strip>;
|
|
1245
|
-
export type
|
|
1430
|
+
export type ProductFeedbackPage = z.infer<typeof productFeedbackPageSchema>;
|
|
1246
1431
|
/**
|
|
1247
1432
|
* ⚠️ Every write body below is its own object with NO defaults, and none of
|
|
1248
1433
|
* them is built with `.pick().partial()`. `.partial()` does not switch off
|
|
@@ -1277,6 +1462,13 @@ export type AttachedMedia = z.infer<typeof attachedMediaSchema>;
|
|
|
1277
1462
|
* refused here rather than reaching the feed as a blank card.
|
|
1278
1463
|
*/
|
|
1279
1464
|
export declare const createPostBodySchema: z.ZodObject<{
|
|
1465
|
+
productId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1466
|
+
ask: z.ZodOptional<z.ZodEnum<{
|
|
1467
|
+
feedback: "feedback";
|
|
1468
|
+
testers: "testers";
|
|
1469
|
+
launch: "launch";
|
|
1470
|
+
ideas: "ideas";
|
|
1471
|
+
}>>;
|
|
1280
1472
|
text: z.ZodOptional<z.ZodString>;
|
|
1281
1473
|
media: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1282
1474
|
mediaId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
@@ -1363,6 +1555,13 @@ export declare const updatePostBodySchema: z.ZodObject<{
|
|
|
1363
1555
|
}, z.core.$strip>;
|
|
1364
1556
|
export type UpdatePostBody = z.infer<typeof updatePostBodySchema>;
|
|
1365
1557
|
export declare const createPollBodySchema: z.ZodObject<{
|
|
1558
|
+
productId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1559
|
+
ask: z.ZodOptional<z.ZodEnum<{
|
|
1560
|
+
feedback: "feedback";
|
|
1561
|
+
testers: "testers";
|
|
1562
|
+
launch: "launch";
|
|
1563
|
+
ideas: "ideas";
|
|
1564
|
+
}>>;
|
|
1366
1565
|
question: z.ZodString;
|
|
1367
1566
|
options: z.ZodArray<z.ZodObject<{
|
|
1368
1567
|
label: z.ZodString;
|
|
@@ -1553,14 +1752,27 @@ export type CreateReportBody = z.infer<typeof createReportBodySchema>;
|
|
|
1553
1752
|
*/
|
|
1554
1753
|
export declare const createReportResponseSchema: z.ZodObject<{
|
|
1555
1754
|
contentKind: z.ZodEnum<{
|
|
1755
|
+
product: "product";
|
|
1556
1756
|
post: "post";
|
|
1557
1757
|
poll: "poll";
|
|
1558
1758
|
comment: "comment";
|
|
1759
|
+
review: "review";
|
|
1559
1760
|
}>;
|
|
1560
1761
|
contentId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1561
1762
|
alreadyReported: z.ZodBoolean;
|
|
1562
1763
|
}, z.core.$strip>;
|
|
1563
1764
|
export type CreateReportResponse = z.infer<typeof createReportResponseSchema>;
|
|
1765
|
+
/**
|
|
1766
|
+
* `PUT|DELETE /api/v1/feed/comments/:commentId/helpful`: the product's team
|
|
1767
|
+
* marks (or unmarks) a comment as feedback that helped. Answers the state it
|
|
1768
|
+
* settled on. `FEEDBACK_NOT_MARKABLE` when the comment is not feedback on a
|
|
1769
|
+
* product the caller is on the team of.
|
|
1770
|
+
*/
|
|
1771
|
+
export declare const commentHelpfulResponseSchema: z.ZodObject<{
|
|
1772
|
+
commentId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1773
|
+
helpfulAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1774
|
+
}, z.core.$strip>;
|
|
1775
|
+
export type CommentHelpfulResponse = z.infer<typeof commentHelpfulResponseSchema>;
|
|
1564
1776
|
/** The bookmark endpoint is a toggle and returns the state it settled on. */
|
|
1565
1777
|
export declare const toggleBookmarkResponseSchema: z.ZodObject<{
|
|
1566
1778
|
contentKind: z.ZodEnum<{
|
|
@@ -1666,6 +1878,18 @@ export declare const castVoteResponseSchema: z.ZodObject<{
|
|
|
1666
1878
|
social_enterprise: "social_enterprise";
|
|
1667
1879
|
education_access: "education_access";
|
|
1668
1880
|
}>>;
|
|
1881
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
1882
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1883
|
+
slug: z.ZodString;
|
|
1884
|
+
name: z.ZodString;
|
|
1885
|
+
logoUrl: z.ZodOptional<z.ZodURL>;
|
|
1886
|
+
}, z.core.$strip>>;
|
|
1887
|
+
ask: z.ZodOptional<z.ZodEnum<{
|
|
1888
|
+
feedback: "feedback";
|
|
1889
|
+
testers: "testers";
|
|
1890
|
+
launch: "launch";
|
|
1891
|
+
ideas: "ideas";
|
|
1892
|
+
}>>;
|
|
1669
1893
|
commentCount: z.ZodNumber;
|
|
1670
1894
|
reactionCounts: z.ZodRecord<z.ZodEnum<{
|
|
1671
1895
|
like: "like";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feed.d.ts","sourceRoot":"","sources":["../../../src/domains/feed/feed.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"feed.d.ts","sourceRoot":"","sources":["../../../src/domains/feed/feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,iEAAiE;AACjE,eAAO,MAAM,oBAAoB,QAAgB,CAAC;AAClD,eAAe;AACf,eAAO,MAAM,oBAAoB,QAA2B,CAAC;AAE7D;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,QAAiB,CAAC;AAI7C;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,2BAA4B,CAAC;AAC7D,eAAO,MAAM,iBAAiB;;;EAA8B,CAAC;AAC7D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,sCAA+C,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;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;iBAKrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;;;iBAGvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,6EAA6E;AAC7E,eAAO,MAAM,4BAA4B;;;;;;;iBAIvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;mEACmE;AACnE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
* DELIBERATELY NOT PORTED, so nobody "restores" them:
|
|
15
15
|
* - the five civic verticals (lost_found, suggestions_complaints,
|
|
16
16
|
* donate_item, crowdfunding, event). `contentKind` here is post | poll
|
|
17
|
-
* only; comment threads and bookmarks key off it,
|
|
18
|
-
* reports off
|
|
17
|
+
* only; comment threads and bookmarks key off it, reactions off the same
|
|
18
|
+
* union plus `comment`, and reports off that plus a product and a review
|
|
19
|
+
* (`reportTargetKindSchema`, 0.6.0).
|
|
19
20
|
* - official communities, designations, identity verification badges.
|
|
20
21
|
* - social score, and the whole area-proximity ranking vocabulary
|
|
21
22
|
* (local / district / state / national / global).
|
|
@@ -29,12 +30,14 @@
|
|
|
29
30
|
* @module founder-schema/domains/feed
|
|
30
31
|
*/
|
|
31
32
|
import { z } from 'zod';
|
|
32
|
-
import { emptyStringToUndefined, objectIdSchema, paginationQuerySchema, safeUrlSchema,
|
|
33
|
+
import { emptyStringToUndefined, objectIdSchema, paginationQuerySchema, safeUrlSchema, } from '../../core/common.js';
|
|
33
34
|
import { LINK_PREVIEW_DESCRIPTION_MAX, LINK_PREVIEW_TITLE_MAX, MEDIA_ALT_MAX, REPORT_NOTE_MAX, } from '../../core/limits.js';
|
|
34
35
|
import { paginatedSchema } from '../../core/responses.js';
|
|
35
36
|
import { VALIDATION_MESSAGE } from '../../core/validation.js';
|
|
36
37
|
import { mediaImageSchema } from '../media/media.js';
|
|
37
38
|
import { topicSchema } from '../onboarding/onboarding.js';
|
|
39
|
+
import { productAskSchema, productChipSchema } from '../products/products.js';
|
|
40
|
+
import { memberBylineSchema } from '../profile/founder-profile.js';
|
|
38
41
|
// ─── Limits ──────────────────────────────────────────────────────────────────
|
|
39
42
|
/**
|
|
40
43
|
* Exported because the composer must count down to the SAME number the server
|
|
@@ -101,6 +104,17 @@ export const contentKindSchema = z.enum(CONTENT_KIND_VALUES);
|
|
|
101
104
|
*/
|
|
102
105
|
export const ENGAGEMENT_TARGET_KIND_VALUES = [...CONTENT_KIND_VALUES, 'comment'];
|
|
103
106
|
export const engagementTargetKindSchema = z.enum(ENGAGEMENT_TARGET_KIND_VALUES);
|
|
107
|
+
/**
|
|
108
|
+
* What a member can REPORT (0.6.0): everything a reaction can reach, plus a
|
|
109
|
+
* product page and a review. Each has its own report route; the answer and the
|
|
110
|
+
* moderation queue use this one list.
|
|
111
|
+
*/
|
|
112
|
+
export const REPORT_TARGET_KIND_VALUES = [
|
|
113
|
+
...ENGAGEMENT_TARGET_KIND_VALUES,
|
|
114
|
+
'product',
|
|
115
|
+
'review',
|
|
116
|
+
];
|
|
117
|
+
export const reportTargetKindSchema = z.enum(REPORT_TARGET_KIND_VALUES);
|
|
104
118
|
/**
|
|
105
119
|
* Reactions. Jansathi's `support` is dropped: it exists for reacting to a
|
|
106
120
|
* civic complaint or a lost-and-found notice, which this feed does not carry.
|
|
@@ -135,7 +149,8 @@ export const feedSortSchema = z.enum(FEED_SORT_VALUES);
|
|
|
135
149
|
export const reactionCountsSchema = z.partialRecord(reactionTypeSchema, z.number().int().nonnegative());
|
|
136
150
|
// ─── Author byline ───────────────────────────────────────────────────────────
|
|
137
151
|
/**
|
|
138
|
-
* The author as a card renders them.
|
|
152
|
+
* The author as a card renders them: the shared `memberBylineSchema` (0.6.0),
|
|
153
|
+
* which products, reviews and notifications name members with too.
|
|
139
154
|
*
|
|
140
155
|
* Every field here is LIVE, joined against the profile at read time rather
|
|
141
156
|
* than frozen onto the post at write time. So a renamed handle, a new avatar
|
|
@@ -146,17 +161,7 @@ export const reactionCountsSchema = z.partialRecord(reactionTypeSchema, z.number
|
|
|
146
161
|
* posting"). Not ported: location is optional here, so a byline that depends
|
|
147
162
|
* on one would be blank for anyone who never set it.
|
|
148
163
|
*/
|
|
149
|
-
export const feedAuthorSchema =
|
|
150
|
-
userId: z.string(),
|
|
151
|
-
username: usernameSchema,
|
|
152
|
-
displayName: z.string(),
|
|
153
|
-
/** Server-generated or from the login provider, never member-typed, so a
|
|
154
|
-
* plain URL check. Same reasoning as `avatarUrl` on the profile. */
|
|
155
|
-
avatarUrl: z.url().optional(),
|
|
156
|
-
/** The author's one-line headline, live-joined. Gives a founders' byline
|
|
157
|
-
* the context a civic byline got from an area label. */
|
|
158
|
-
headline: z.string().optional(),
|
|
159
|
-
});
|
|
164
|
+
export const feedAuthorSchema = memberBylineSchema;
|
|
160
165
|
// ─── Media ───────────────────────────────────────────────────────────────────
|
|
161
166
|
/**
|
|
162
167
|
* A post's image: a processed `mediaImageSchema` (every stored size, ready for
|
|
@@ -287,6 +292,15 @@ export const feedPostSchema = z.object({
|
|
|
287
292
|
* untagged post is only ever found chronologically.
|
|
288
293
|
*/
|
|
289
294
|
topics: z.array(topicSchema).max(MAX_TOPICS),
|
|
295
|
+
/**
|
|
296
|
+
* The product this post is about, live-joined (0.6.0). Absent when it names
|
|
297
|
+
* none, and when the product has since been deleted or hidden by staff: the
|
|
298
|
+
* post stays, the chip goes. Every comment on a post with a product is that
|
|
299
|
+
* product's feedback.
|
|
300
|
+
*/
|
|
301
|
+
product: productChipSchema.optional(),
|
|
302
|
+
/** What the post asks of the community about its product. Only with `product`. */
|
|
303
|
+
ask: productAskSchema.optional(),
|
|
290
304
|
commentCount: z.number().int().nonnegative(),
|
|
291
305
|
reactionCounts: reactionCountsSchema,
|
|
292
306
|
createdAt: z.iso.datetime(),
|
|
@@ -338,6 +352,9 @@ export const feedPollSchema = z.object({
|
|
|
338
352
|
isClosed: z.boolean(),
|
|
339
353
|
/** As on a post. A poll is feed content and is matched the same way. */
|
|
340
354
|
topics: z.array(topicSchema).max(MAX_TOPICS),
|
|
355
|
+
/** As on a post: "which onboarding flow should we ship?", about a product. */
|
|
356
|
+
product: productChipSchema.optional(),
|
|
357
|
+
ask: productAskSchema.optional(),
|
|
341
358
|
commentCount: z.number().int().nonnegative(),
|
|
342
359
|
reactionCounts: reactionCountsSchema,
|
|
343
360
|
createdAt: z.iso.datetime(),
|
|
@@ -377,10 +394,23 @@ export const feedCommentSchema = z.object({
|
|
|
377
394
|
/** Meaningful only on a top-level comment; always 0 on a reply. */
|
|
378
395
|
replyCount: z.number().int().nonnegative(),
|
|
379
396
|
reactionCounts: reactionCountsSchema,
|
|
397
|
+
/**
|
|
398
|
+
* When the product's team marked this comment as feedback that helped
|
|
399
|
+
* (0.6.0), or null. Only a comment on a post tagged with a product, written
|
|
400
|
+
* by someone outside that product's team, can carry it; it earns its writer
|
|
401
|
+
* contribution points.
|
|
402
|
+
*/
|
|
403
|
+
helpfulAt: z.iso.datetime().nullable(),
|
|
380
404
|
createdAt: z.iso.datetime(),
|
|
381
405
|
editedAt: z.iso.datetime().nullable(),
|
|
382
406
|
/** No `bookmarked`: the post is the right thing to save, not a comment. */
|
|
383
|
-
viewer: viewerStateSchema
|
|
407
|
+
viewer: viewerStateSchema
|
|
408
|
+
.omit({ bookmarked: true })
|
|
409
|
+
.extend({
|
|
410
|
+
/** On the team of the post's product, and the comment is from outside it. */
|
|
411
|
+
canMarkHelpful: z.boolean(),
|
|
412
|
+
})
|
|
413
|
+
.optional(),
|
|
384
414
|
});
|
|
385
415
|
// ─── Queries ─────────────────────────────────────────────────────────────────
|
|
386
416
|
/**
|
|
@@ -441,6 +471,16 @@ export const authorParamsSchema = z.object({ userId: objectIdSchema });
|
|
|
441
471
|
export const feedPageSchema = paginatedSchema(feedItemSchema);
|
|
442
472
|
/** A page of a thread: top-level comments, or one comment's replies. */
|
|
443
473
|
export const commentPageSchema = paginatedSchema(feedCommentSchema);
|
|
474
|
+
/**
|
|
475
|
+
* A comment on a product's Feedback tab (`GET /products/:id/feedback`): the
|
|
476
|
+
* comment as a thread shows it, plus whether its writer is already a
|
|
477
|
+
* confirmed tester, so the team's "Confirm as tester" knows without paging
|
|
478
|
+
* through `/testers`.
|
|
479
|
+
*/
|
|
480
|
+
export const productFeedbackItemSchema = feedCommentSchema.extend({
|
|
481
|
+
authorIsTester: z.boolean(),
|
|
482
|
+
});
|
|
483
|
+
export const productFeedbackPageSchema = paginatedSchema(productFeedbackItemSchema);
|
|
444
484
|
// ─── Write bodies ────────────────────────────────────────────────────────────
|
|
445
485
|
/**
|
|
446
486
|
* ⚠️ Every write body below is its own object with NO defaults, and none of
|
|
@@ -471,6 +511,19 @@ export const attachedMediaSchema = z.object({
|
|
|
471
511
|
/** Author-supplied alt text, the one media field a member does write. */
|
|
472
512
|
alt: z.string().trim().max(MEDIA_ALT_MAX).optional(),
|
|
473
513
|
});
|
|
514
|
+
/**
|
|
515
|
+
* Which of the author's products a post or poll is about, and what it asks.
|
|
516
|
+
* Set when it is written and NEVER EDITABLE afterwards: moving a post to
|
|
517
|
+
* another product after people replied would move their feedback with it.
|
|
518
|
+
* The server accepts only a product the author is on the team of
|
|
519
|
+
* (`PRODUCT_NOT_YOURS`) and that is not archived (`PRODUCT_ARCHIVED`).
|
|
520
|
+
*/
|
|
521
|
+
const aboutAProduct = {
|
|
522
|
+
productId: objectIdSchema.optional(),
|
|
523
|
+
/** Only with `productId` (`askWithoutProduct`). */
|
|
524
|
+
ask: productAskSchema.optional(),
|
|
525
|
+
};
|
|
526
|
+
const askNeedsProduct = (b) => b.ask === undefined || b.productId !== undefined;
|
|
474
527
|
/**
|
|
475
528
|
* A post must carry something. Text alone, media alone, or both; empty is
|
|
476
529
|
* refused here rather than reaching the feed as a blank card.
|
|
@@ -482,6 +535,7 @@ export const createPostBodySchema = z
|
|
|
482
535
|
media: z.array(attachedMediaSchema).max(POST_MAX_MEDIA).optional(),
|
|
483
536
|
/** Absent means untagged, which means interest matching cannot find it. */
|
|
484
537
|
topics: z.array(topicSchema).max(MAX_TOPICS).optional(),
|
|
538
|
+
...aboutAProduct,
|
|
485
539
|
})
|
|
486
540
|
.refine((b) => Boolean(b.text?.length) || Boolean(b.media?.length), {
|
|
487
541
|
error: VALIDATION_MESSAGE.postEmpty,
|
|
@@ -490,7 +544,8 @@ export const createPostBodySchema = z
|
|
|
490
544
|
.refine((b) => new Set(b.media?.map((m) => m.mediaId)).size === (b.media?.length ?? 0), {
|
|
491
545
|
error: VALIDATION_MESSAGE.mediaDuplicate,
|
|
492
546
|
path: ['media'],
|
|
493
|
-
})
|
|
547
|
+
})
|
|
548
|
+
.refine(askNeedsProduct, { error: VALIDATION_MESSAGE.askWithoutProduct, path: ['ask'] });
|
|
494
549
|
/** Only the text is editable. Changing media after the fact makes every
|
|
495
550
|
* earlier reply look like a reply to something else. */
|
|
496
551
|
export const updatePostBodySchema = z.object({
|
|
@@ -511,7 +566,9 @@ export const createPollBodySchema = z
|
|
|
511
566
|
durationMs: z.number().int().min(POLL_MIN_DURATION_MS).max(POLL_MAX_DURATION_MS),
|
|
512
567
|
allowsMultipleChoices: z.boolean(),
|
|
513
568
|
topics: z.array(topicSchema).max(MAX_TOPICS).optional(),
|
|
569
|
+
...aboutAProduct,
|
|
514
570
|
})
|
|
571
|
+
.refine(askNeedsProduct, { error: VALIDATION_MESSAGE.askWithoutProduct, path: ['ask'] })
|
|
515
572
|
.refine((b) => {
|
|
516
573
|
const seen = new Set();
|
|
517
574
|
for (const o of b.options) {
|
|
@@ -608,10 +665,21 @@ export const createReportBodySchema = z.object({
|
|
|
608
665
|
* score anyone could farm.
|
|
609
666
|
*/
|
|
610
667
|
export const createReportResponseSchema = z.object({
|
|
611
|
-
|
|
668
|
+
/** A post, poll or comment; since 0.6.0 also a product or a review. */
|
|
669
|
+
contentKind: reportTargetKindSchema,
|
|
612
670
|
contentId: objectIdSchema,
|
|
613
671
|
alreadyReported: z.boolean(),
|
|
614
672
|
});
|
|
673
|
+
/**
|
|
674
|
+
* `PUT|DELETE /api/v1/feed/comments/:commentId/helpful`: the product's team
|
|
675
|
+
* marks (or unmarks) a comment as feedback that helped. Answers the state it
|
|
676
|
+
* settled on. `FEEDBACK_NOT_MARKABLE` when the comment is not feedback on a
|
|
677
|
+
* product the caller is on the team of.
|
|
678
|
+
*/
|
|
679
|
+
export const commentHelpfulResponseSchema = z.object({
|
|
680
|
+
commentId: objectIdSchema,
|
|
681
|
+
helpfulAt: z.iso.datetime().nullable(),
|
|
682
|
+
});
|
|
615
683
|
/** The bookmark endpoint is a toggle and returns the state it settled on. */
|
|
616
684
|
export const toggleBookmarkResponseSchema = z.object({
|
|
617
685
|
contentKind: contentKindSchema,
|