UNPKG

appwrite-utils

Version:

`appwrite-utils` is a comprehensive TypeScript library designed to streamline the development process for Appwrite projects. This library provides a suite of utilities and helper functions that facilitate data manipulation, schema management, YAML configu

37 lines (32 loc) 771 B
import { z } from "zod"; export const AuthUserSchema = z .object({ $id: z .string(), $createdAt: z .string(), $updatedAt: z .string(), name: z.string().nullish(), email: z .string() .nullish(), phone: z .string() .nullish(), prefs: z.record(z.string(), z.string()).optional().default({}), labels: z .array(z.string()) .optional() .default([]), password: z.string().optional(), }); export type AuthUser = z.infer<typeof AuthUserSchema>; export const AuthUserCreateSchema = AuthUserSchema.omit({ $id: true, }) .extend({ userId: z.string().optional(), password: z.string().optional(), }); export type AuthUserCreate = z.infer<typeof AuthUserCreateSchema>;