|
| 1 | +import { z } from 'zod'; |
| 2 | +import { colorSchema } from './colorSchema'; |
| 3 | +import { hexColorSchema } from './hexColorSchema'; |
| 4 | + |
| 5 | +export const prefsSchema = z.object({ |
| 6 | + permissionLevel: z.enum(['private']), |
| 7 | + hideVotes: z.boolean(), |
| 8 | + voting: z.enum(['disabled']), |
| 9 | + comments: z.enum(['members']), |
| 10 | + invitations: z.enum(['members']), |
| 11 | + selfJoin: z.boolean(), |
| 12 | + cardCovers: z.boolean(), |
| 13 | + showCompleteStatus: z.boolean(), |
| 14 | + cardCounts: z.boolean(), |
| 15 | + isTemplate: z.boolean(), |
| 16 | + cardAging: z.enum(['regular']), |
| 17 | + calendarFeedEnabled: z.boolean(), |
| 18 | + hiddenPluginBoardButtons: z.array(z.unknown()), |
| 19 | + switcherViews: z.array(z.object({ |
| 20 | + viewType: z.enum(['Board', 'Table', 'Calendar', 'Dashboard', 'Timeline', 'Map']), |
| 21 | + enabled: z.boolean(), |
| 22 | + }).strict()), |
| 23 | + background: colorSchema, |
| 24 | + backgroundColor: hexColorSchema, |
| 25 | + backgroundDarkColor: hexColorSchema.nullable(), |
| 26 | + backgroundImage: z.unknown().nullable(), |
| 27 | + backgroundDarkImage: z.unknown().nullable(), |
| 28 | + backgroundImageScaled: z.unknown().nullable(), |
| 29 | + backgroundTile: z.boolean(), |
| 30 | + backgroundBrightness: z.enum(['dark']), |
| 31 | + sharedSourceUrl: z.string().url().nullable(), |
| 32 | + backgroundBottomColor: hexColorSchema, |
| 33 | + backgroundTopColor: hexColorSchema, |
| 34 | + canBePublic: z.boolean(), |
| 35 | + canBeEnterprise: z.boolean(), |
| 36 | + canBeOrg: z.boolean(), |
| 37 | + canBePrivate: z.boolean(), |
| 38 | + canInvite: z.boolean(), |
| 39 | +}).strict(); |
| 40 | + |
| 41 | +export type Prefs = z.infer<typeof prefsSchema>; |
0 commit comments