UNPKG

appwrite-utils

Version:

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

25 lines (24 loc) 1.14 kB
import { z } from "zod"; import { stringAttributeSchema, } from "../schemas/stringAttribute.js"; import { integerAttributeSchema, } from "../schemas/integerAttribute.js"; import { floatAttributeSchema, } from "../schemas/floatAttribute.js"; import { booleanAttributeSchema, } from "../schemas/booleanAttribute.js"; import { datetimeAttributeSchema, } from "../schemas/datetimeAttribute.js"; import { emailAttributeSchema, } from "../schemas/emailAttribute.js"; import { ipAttributeSchema } from "../schemas/ipAttribute.js"; import { urlAttributeSchema, } from "../schemas/urlAttribute.js"; import { enumAttributeSchema, } from "../schemas/enumAttribute.js"; import { relationshipAttributeSchema, } from "../schemas/relationshipAttribute.js"; export const attributeSchema = z.discriminatedUnion("type", [ stringAttributeSchema, integerAttributeSchema, floatAttributeSchema, booleanAttributeSchema, datetimeAttributeSchema, emailAttributeSchema, ipAttributeSchema, urlAttributeSchema, enumAttributeSchema, relationshipAttributeSchema, ]); export const attributesSchema = z.array(attributeSchema);