Add account browsing simulation
This commit is contained in:
1 parent
e2d7dc4b82
commit
27012399ec
31 files changed
+1476
-28
No files matched your search
@@ -18,6 +18,45 @@ export const GrowthQuietHoursSchema = z.strictObject({
|
||||
endHour: z.number().int().min(0).max(23),
|
||||
});
|
||||
|
||||
export const BrowsingSettingsUpdateRequestSchema = z.strictObject({
|
||||
enabled: z.boolean().optional(),
|
||||
dailyTargetMin: z.number().int().min(1).max(12).optional(),
|
||||
dailyTargetMax: z.number().int().min(1).max(12).optional(),
|
||||
postWeight: z.number().min(0).max(100).optional(),
|
||||
commentWeight: z.number().min(0).max(100).optional(),
|
||||
quietHours: GrowthQuietHoursSchema.optional(),
|
||||
minimumGapMs: z.number().int().min(45 * 60_000).max(DAY_MS).optional(),
|
||||
jitterMs: z.number().int().min(0).max(6 * 60 * 60_000).optional(),
|
||||
allowNsfw: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export const BrowsingSettingsSchema = z.strictObject({
|
||||
enabled: z.boolean(), dailyTargetMin: z.number().int(), dailyTargetMax: z.number().int(),
|
||||
postWeight: z.number(), commentWeight: z.number(), quietHours: GrowthQuietHoursSchema,
|
||||
minimumGapMs: z.number().int(), jitterMs: z.number().int(), allowNsfw: z.boolean(),
|
||||
nextDueAt: z.number().nullable(), updatedAt: z.number(),
|
||||
});
|
||||
|
||||
export const BrowsingStatsSchema = z.strictObject({
|
||||
selected: z.number().int(), posts: z.number().int(), comments: z.number().int(),
|
||||
rejected: z.number().int(), skipped: z.number().int(),
|
||||
});
|
||||
|
||||
export const BrowsingDecisionSchema = z.strictObject({
|
||||
thingFullname: z.string(), thingKind: z.enum(['post', 'comment']), postId: z.string(),
|
||||
subreddit: z.string(), author: z.string(), permalink: z.string(),
|
||||
decision: z.enum(['simulated-upvote', 'skipped', 'rejected']), reason: z.string(), decidedAt: z.number(),
|
||||
});
|
||||
|
||||
export const BrowsingSummarySchema = z.strictObject({
|
||||
settings: BrowsingSettingsSchema, todayTarget: z.number().int(), stats: BrowsingStatsSchema,
|
||||
noVotesSubmitted: z.literal(true),
|
||||
});
|
||||
|
||||
export const BrowsingDetailSchema = BrowsingSummarySchema.extend({
|
||||
recentDecisions: z.array(BrowsingDecisionSchema),
|
||||
});
|
||||
|
||||
export const GrowthSettingsUpdateRequestSchema = z.strictObject({
|
||||
enabled: z.boolean().optional(),
|
||||
minDelayMs: z.number().int().min(0).max(DAY_MS).optional(),
|
||||
@@ -107,11 +146,13 @@ export const GrowthAccountSummarySchema = z.strictObject({
|
||||
stats: GrowthStatsSchema,
|
||||
subredditCount: z.number().int(),
|
||||
activeSubredditCount: z.number().int(),
|
||||
browsing: BrowsingSummarySchema,
|
||||
});
|
||||
|
||||
export const GrowthAccountDetailSchema = GrowthAccountSummarySchema.extend({
|
||||
subreddits: z.array(GrowthSubredditSchema),
|
||||
recentComments: z.array(GrowthCommentSchema),
|
||||
browsing: BrowsingDetailSchema,
|
||||
});
|
||||
|
||||
export const GrowthOverviewResponseSchema = z.strictObject({
|
||||
|
||||
Reference in new issue
Block a user