appwrite-utils
Version:
`appwrite-utils` is a comprehensive TypeScript library designed to streamline the development process for Appwrite projects. Version 1.0.0 aligns with the YAML-first architecture of `appwrite-utils-cli`, providing enhanced integration capabilities and rob
26 lines (25 loc) • 1.25 kB
JavaScript
import { z } from "zod";
import { stringAttributeSchema, } from "../schemas/stringAttribute.js";
import { integerAttributeSchema, } from "../schemas/integerAttribute.js";
import { doubleAttributeSchema, floatAttributeSchema, } from "../schemas/doubleAttribute.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,
doubleAttributeSchema, // Preferred double type
floatAttributeSchema, // Backwards compatibility for float type
booleanAttributeSchema,
datetimeAttributeSchema,
emailAttributeSchema,
ipAttributeSchema,
urlAttributeSchema,
enumAttributeSchema,
relationshipAttributeSchema,
]);
export const attributesSchema = z.array(attributeSchema);