appwrite-utils
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -0,1 +1,4 @@ | ||
import { z } from "zod"; | ||
import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi"; | ||
extendZodWithOpenApi(z); | ||
export { areCollectionNamesSame } from "./functions/collections.js"; | ||
@@ -2,0 +5,0 @@ export { converterFunctions, } from "./functions/converters.js"; |
@@ -60,20 +60,20 @@ import { z } from "zod"; | ||
size: number; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
encrypted?: boolean | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
}, { | ||
key: string; | ||
type?: "string" | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
size?: number | undefined; | ||
xdefault?: string | null | undefined; | ||
encrypted?: boolean | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -92,7 +92,7 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -103,7 +103,7 @@ max?: number | undefined; | ||
type?: "integer" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -124,7 +124,7 @@ max?: number | undefined; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -135,7 +135,7 @@ max?: number | undefined; | ||
type?: "float" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -154,15 +154,15 @@ max?: number | undefined; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: boolean | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "boolean" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: boolean | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -179,15 +179,15 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "datetime" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -204,15 +204,15 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "email" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -229,15 +229,15 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
type: "ip"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -254,15 +254,15 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "url" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -281,15 +281,15 @@ key: z.ZodString; | ||
elements: string[]; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "enum" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
elements?: string[] | undefined; | ||
@@ -328,6 +328,6 @@ }>, z.ZodObject<{ | ||
side: "parent" | "child"; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
importMapping?: { | ||
@@ -345,6 +345,6 @@ originalIdField: string; | ||
type?: "relationship" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
onDelete?: "setNull" | "cascade" | "restrict" | undefined; | ||
@@ -567,17 +567,17 @@ importMapping?: { | ||
size: number; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
encrypted?: boolean | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
} | { | ||
type: "integer"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -588,7 +588,7 @@ max?: number | undefined; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -599,39 +599,39 @@ max?: number | undefined; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: boolean | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
type: "datetime"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
type: "email"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
type: "ip"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
type: "url"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
@@ -641,7 +641,7 @@ type: "enum"; | ||
elements: string[]; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
@@ -656,6 +656,6 @@ type: "relationship"; | ||
side: "parent" | "child"; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
importMapping?: { | ||
@@ -723,18 +723,18 @@ originalIdField: string; | ||
type?: "string" | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
size?: number | undefined; | ||
xdefault?: string | null | undefined; | ||
encrypted?: boolean | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
} | { | ||
key: string; | ||
type?: "integer" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -745,7 +745,7 @@ max?: number | undefined; | ||
type?: "float" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -756,47 +756,47 @@ max?: number | undefined; | ||
type?: "boolean" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: boolean | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
key: string; | ||
type?: "datetime" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
key: string; | ||
type?: "email" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
type: "ip"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
key: string; | ||
type?: "url" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
key: string; | ||
type?: "enum" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
elements?: string[] | undefined; | ||
@@ -811,6 +811,6 @@ } | { | ||
type?: "relationship" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
onDelete?: "setNull" | "cascade" | "restrict" | undefined; | ||
@@ -897,17 +897,17 @@ importMapping?: { | ||
size: number; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
encrypted?: boolean | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
} | { | ||
type: "integer"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -918,7 +918,7 @@ max?: number | undefined; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -929,39 +929,39 @@ max?: number | undefined; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: boolean | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
type: "datetime"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
type: "email"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
type: "ip"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
type: "url"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
@@ -971,7 +971,7 @@ type: "enum"; | ||
elements: string[]; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
@@ -986,6 +986,6 @@ type: "relationship"; | ||
side: "parent" | "child"; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
importMapping?: { | ||
@@ -1072,18 +1072,18 @@ originalIdField: string; | ||
type?: "string" | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
size?: number | undefined; | ||
xdefault?: string | null | undefined; | ||
encrypted?: boolean | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
} | { | ||
key: string; | ||
type?: "integer" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -1094,7 +1094,7 @@ max?: number | undefined; | ||
type?: "float" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -1105,47 +1105,47 @@ max?: number | undefined; | ||
type?: "boolean" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: boolean | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
key: string; | ||
type?: "datetime" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
key: string; | ||
type?: "email" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
type: "ip"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
key: string; | ||
type?: "url" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
} | { | ||
key: string; | ||
type?: "enum" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
elements?: string[] | undefined; | ||
@@ -1160,6 +1160,6 @@ } | { | ||
type?: "relationship" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
onDelete?: "setNull" | "cascade" | "restrict" | undefined; | ||
@@ -1166,0 +1166,0 @@ importMapping?: { |
@@ -17,20 +17,20 @@ import { z } from "zod"; | ||
size: number; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
encrypted?: boolean | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
}, { | ||
key: string; | ||
type?: "string" | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
size?: number | undefined; | ||
xdefault?: string | null | undefined; | ||
encrypted?: boolean | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -49,7 +49,7 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -60,7 +60,7 @@ max?: number | undefined; | ||
type?: "integer" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -81,7 +81,7 @@ max?: number | undefined; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -92,7 +92,7 @@ max?: number | undefined; | ||
type?: "float" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -111,15 +111,15 @@ max?: number | undefined; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: boolean | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "boolean" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: boolean | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -136,15 +136,15 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "datetime" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -161,15 +161,15 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "email" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -186,15 +186,15 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
type: "ip"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -211,15 +211,15 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "url" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -238,15 +238,15 @@ key: z.ZodString; | ||
elements: string[]; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "enum" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
elements?: string[] | undefined; | ||
@@ -285,6 +285,6 @@ }>, z.ZodObject<{ | ||
side: "parent" | "child"; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
importMapping?: { | ||
@@ -302,6 +302,6 @@ originalIdField: string; | ||
type?: "relationship" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
onDelete?: "setNull" | "cascade" | "restrict" | undefined; | ||
@@ -329,20 +329,20 @@ importMapping?: { | ||
size: number; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
encrypted?: boolean | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
}, { | ||
key: string; | ||
type?: "string" | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
size?: number | undefined; | ||
xdefault?: string | null | undefined; | ||
encrypted?: boolean | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -361,7 +361,7 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -372,7 +372,7 @@ max?: number | undefined; | ||
type?: "integer" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -393,7 +393,7 @@ max?: number | undefined; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -404,7 +404,7 @@ max?: number | undefined; | ||
type?: "float" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -423,15 +423,15 @@ max?: number | undefined; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: boolean | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "boolean" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: boolean | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -448,15 +448,15 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "datetime" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -473,15 +473,15 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "email" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -498,15 +498,15 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
type: "ip"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -523,15 +523,15 @@ key: z.ZodString; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "url" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>, z.ZodObject<{ | ||
@@ -550,15 +550,15 @@ key: z.ZodString; | ||
elements: string[]; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "enum" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
elements?: string[] | undefined; | ||
@@ -597,6 +597,6 @@ }>, z.ZodObject<{ | ||
side: "parent" | "child"; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
importMapping?: { | ||
@@ -614,6 +614,6 @@ originalIdField: string; | ||
type?: "relationship" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
onDelete?: "setNull" | "cascade" | "restrict" | undefined; | ||
@@ -620,0 +620,0 @@ importMapping?: { |
@@ -11,2 +11,3 @@ import { z } from "zod"; | ||
labels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>; | ||
password: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
@@ -16,2 +17,3 @@ $id: string; | ||
labels: string[]; | ||
password?: string | undefined; | ||
name?: string | null | undefined; | ||
@@ -24,2 +26,3 @@ email?: string | null | undefined; | ||
$id: string; | ||
password?: string | undefined; | ||
name?: string | null | undefined; | ||
@@ -43,2 +46,3 @@ email?: string | null | undefined; | ||
labels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>; | ||
password: z.ZodOptional<z.ZodString>; | ||
}, "$id">, { | ||
@@ -50,2 +54,3 @@ userId: z.ZodOptional<z.ZodString>; | ||
labels: string[]; | ||
password?: string | undefined; | ||
name?: string | null | undefined; | ||
@@ -57,4 +62,4 @@ email?: string | null | undefined; | ||
userId?: string | undefined; | ||
}, { | ||
password?: string | undefined; | ||
}, { | ||
name?: string | null | undefined; | ||
@@ -68,4 +73,3 @@ email?: string | null | undefined; | ||
userId?: string | undefined; | ||
password?: string | undefined; | ||
}>; | ||
export type AuthUserCreate = z.infer<typeof AuthUserCreateSchema>; |
import { z } from "zod"; | ||
export const AuthUserSchema = z.object({ | ||
$id: z.string(), | ||
$createdAt: z.string().optional(), | ||
$updatedAt: z.string().optional(), | ||
name: z.string().nullish(), | ||
email: z.string().nullish(), | ||
phone: z.string().nullish(), | ||
prefs: z.record(z.string()).optional().default({}), | ||
labels: z.array(z.string()).optional().default([]), | ||
}); | ||
export const AuthUserSchema = z | ||
.object({ | ||
$id: z | ||
.string() | ||
.openapi({ description: "The unique identifier for the user" }), | ||
$createdAt: z | ||
.string() | ||
.optional() | ||
.openapi({ description: "Creation timestamp" }), | ||
$updatedAt: z | ||
.string() | ||
.optional() | ||
.openapi({ description: "Update timestamp" }), | ||
name: z.string().nullish().openapi({ description: "The user's name" }), | ||
email: z | ||
.string() | ||
.nullish() | ||
.openapi({ description: "The user's email address" }), | ||
phone: z | ||
.string() | ||
.nullish() | ||
.openapi({ description: "The user's phone number" }), | ||
prefs: z | ||
.record(z.string()) | ||
.optional() | ||
.default({}) | ||
.openapi({ | ||
description: "User preferences, key-value pairs up to 16KB in size", | ||
}), | ||
labels: z | ||
.array(z.string()) | ||
.optional() | ||
.default([]) | ||
.openapi({ description: "User labels" }), | ||
password: z.string().optional().openapi({ | ||
description: "Optional password, also used for the user to update their own account", | ||
}), | ||
}) | ||
.openapi("AuthUser"); | ||
export const AuthUserCreateSchema = AuthUserSchema.omit({ | ||
$id: true, | ||
}).extend({ | ||
userId: z.string().optional(), | ||
password: z.string().optional(), | ||
}); | ||
}) | ||
.extend({ | ||
userId: z.string().optional().openapi({ | ||
description: "Optional user ID, auto generated if not provided", | ||
}), | ||
password: z.string().optional().openapi({ | ||
description: "Optional password", | ||
}), | ||
}) | ||
.openapi("AuthUserCreate"); |
@@ -13,16 +13,16 @@ import { z } from "zod"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: boolean | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "boolean" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: boolean | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>; | ||
export type BooleanAttribute = z.infer<typeof booleanAttributeSchema>; |
@@ -13,16 +13,16 @@ import { z } from "zod"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "datetime" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>; | ||
export type DatetimeAttribute = z.infer<typeof datetimeAttributeSchema>; |
@@ -13,16 +13,16 @@ import { z } from "zod"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "email" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>; | ||
export type EmailAttribute = z.infer<typeof emailAttributeSchema>; |
@@ -15,17 +15,17 @@ import { z } from "zod"; | ||
elements: string[]; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "enum" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
elements?: string[] | undefined; | ||
}>; | ||
export type EnumAttribute = z.infer<typeof enumAttributeSchema>; |
@@ -15,7 +15,7 @@ import { z } from "zod"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -26,7 +26,7 @@ max?: number | undefined; | ||
type?: "float" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -33,0 +33,0 @@ max?: number | undefined; |
@@ -15,7 +15,7 @@ import { z } from "zod"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -26,7 +26,7 @@ max?: number | undefined; | ||
type?: "integer" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: number | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
min?: number | undefined; | ||
@@ -33,0 +33,0 @@ max?: number | undefined; |
@@ -13,16 +13,16 @@ import { z } from "zod"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
type: "ip"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>; | ||
export type IpAttribute = z.infer<typeof ipAttributeSchema>; |
@@ -34,6 +34,6 @@ import { z } from "zod"; | ||
side: "parent" | "child"; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
importMapping?: { | ||
@@ -51,6 +51,6 @@ originalIdField: string; | ||
type?: "relationship" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
onDelete?: "setNull" | "cascade" | "restrict" | undefined; | ||
@@ -57,0 +57,0 @@ importMapping?: { |
@@ -17,21 +17,21 @@ import { z } from "zod"; | ||
size: number; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
encrypted?: boolean | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
}, { | ||
key: string; | ||
type?: "string" | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
size?: number | undefined; | ||
xdefault?: string | null | undefined; | ||
encrypted?: boolean | undefined; | ||
format?: string | null | undefined; | ||
description?: string | Record<string, string> | undefined; | ||
}>; | ||
export type StringAttribute = z.infer<typeof stringAttributeSchema>; |
@@ -13,16 +13,16 @@ import { z } from "zod"; | ||
key: string; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}, { | ||
key: string; | ||
type?: "url" | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
required?: boolean | undefined; | ||
array?: boolean | undefined; | ||
error?: string | undefined; | ||
required?: boolean | undefined; | ||
xdefault?: string | null | undefined; | ||
description?: string | Record<string, string> | null | undefined; | ||
}>; | ||
export type UrlAttribute = z.infer<typeof urlAttributeSchema>; |
{ | ||
"name": "appwrite-utils", | ||
"module": "dist/index.js", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"main": "dist/index.js", | ||
@@ -30,2 +30,3 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@asteasolutions/zod-to-openapi": "^7.0.0", | ||
"@types/luxon": "^3.4.2", | ||
@@ -32,0 +33,0 @@ "appwrite": "^14.0.1", |
@@ -75,2 +75,3 @@ # appwrite-utils | ||
- 0.2.3: Added OpenAPI descriptions to AuthUserSchema, which also allows one to use the openapi package itself (`@asteasolutions/zod-to-openapi`) with the AuthUserSchema | ||
- 0.2.2: Lots of updates, moved schemas and stuff here, fixed package, added export of AuthUser which got removed accidentally | ||
@@ -77,0 +78,0 @@ - 0.1.21: Changed `ID.unique()` to `ulid()` for random ID generation, refactored `schema.ts` into multiple files |
@@ -0,0 +0,0 @@ import { type AppwriteConfig } from "../schemas/appwriteConfig.js"; |
@@ -0,0 +0,0 @@ export const areCollectionNamesSame = (a: string, b: string) => { |
@@ -0,0 +0,0 @@ import { DateTime } from "luxon"; |
@@ -0,0 +0,0 @@ import type { Models } from "appwrite"; |
@@ -0,0 +0,0 @@ import { ID, IndexType, Permission } from "node-appwrite"; |
@@ -0,0 +0,0 @@ import _ from "lodash"; |
@@ -0,1 +1,6 @@ | ||
import { z } from "zod"; | ||
import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi"; | ||
extendZodWithOpenApi(z); | ||
export { areCollectionNamesSame } from "./functions/collections.js"; | ||
@@ -2,0 +7,0 @@ export { |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
import { z } from "zod"; | ||
export const AuthUserSchema = z.object({ | ||
$id: z.string(), | ||
$createdAt: z.string().optional(), | ||
$updatedAt: z.string().optional(), | ||
name: z.string().nullish(), | ||
email: z.string().nullish(), | ||
phone: z.string().nullish(), | ||
prefs: z.record(z.string()).optional().default({}), | ||
labels: z.array(z.string()).optional().default([]), | ||
}); | ||
export const AuthUserSchema = z | ||
.object({ | ||
$id: z | ||
.string() | ||
.openapi({ description: "The unique identifier for the user" }), | ||
$createdAt: z | ||
.string() | ||
.optional() | ||
.openapi({ description: "Creation timestamp" }), | ||
$updatedAt: z | ||
.string() | ||
.optional() | ||
.openapi({ description: "Update timestamp" }), | ||
name: z.string().nullish().openapi({ description: "The user's name" }), | ||
email: z | ||
.string() | ||
.nullish() | ||
.openapi({ description: "The user's email address" }), | ||
phone: z | ||
.string() | ||
.nullish() | ||
.openapi({ description: "The user's phone number" }), | ||
prefs: z | ||
.record(z.string()) | ||
.optional() | ||
.default({}) | ||
.openapi({ | ||
description: "User preferences, key-value pairs up to 16KB in size", | ||
}), | ||
labels: z | ||
.array(z.string()) | ||
.optional() | ||
.default([]) | ||
.openapi({ description: "User labels" }), | ||
password: z.string().optional().openapi({ | ||
description: | ||
"Optional password, also used for the user to update their own account", | ||
}), | ||
}) | ||
.openapi("AuthUser"); | ||
@@ -18,7 +48,13 @@ export type AuthUser = z.infer<typeof AuthUserSchema>; | ||
$id: true, | ||
}).extend({ | ||
userId: z.string().optional(), | ||
password: z.string().optional(), | ||
}); | ||
}) | ||
.extend({ | ||
userId: z.string().optional().openapi({ | ||
description: "Optional user ID, auto generated if not provided", | ||
}), | ||
password: z.string().optional().openapi({ | ||
description: "Optional password", | ||
}), | ||
}) | ||
.openapi("AuthUserCreate"); | ||
export type AuthUserCreate = z.infer<typeof AuthUserCreateSchema>; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ import { z } from "zod"; |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is too big to display
329640
8649
82
7
+ Added@asteasolutions/zod-to-openapi@7.2.0(transitive)
+ Addedopenapi3-ts@4.4.0(transitive)
+ Addedyaml@2.6.1(transitive)