The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
import {
linksDisplayPropertyIds,
linksSortOptions,
linksViewModes,
} from "@/lib/links/links-display";
import * as z from "zod/v4";
export const linksDisplaySchema = z.object({
viewMode: z.enum(linksViewModes),
sortBy: z.enum(
linksSortOptions.map(({ slug }) => slug) as [string, ...string[]],
),
showArchived: z.boolean(),
displayProperties: z.array(z.enum(linksDisplayPropertyIds)),
});
export const workspacePreferencesValueSchemas = {
linksDisplay: linksDisplaySchema.nullish(),
} as const;
export const workspacePreferencesSchema = z.object(
workspacePreferencesValueSchemas,
);
export type WorkspacePreferencesKey =
keyof typeof workspacePreferencesValueSchemas;
export type WorkspacePreferencesValue<K extends WorkspacePreferencesKey> =
z.infer<(typeof workspacePreferencesValueSchemas)[K]>;