surreal-zod 0.0.0-alpha.10 → 0.0.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,177 @@
1
+ /** biome-ignore-all assist/source/organizeImports: re-exporting */
2
+ export {
3
+ // iso
4
+ iso, ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime,
5
+ // email
6
+ email, ZodEmail,
7
+ // // guid (patched)
8
+ guid as originalGuid, ZodGUID as OriginalZodGUID,
9
+ // // uuid (patched)
10
+ uuid as originalUuid, ZodUUID as OriginalZodUUID,
11
+ // uuidv4 (patched)
12
+ uuidv4 as originalUuidv4,
13
+ // // uuidv6 (patched)
14
+ uuidv6 as originalUuidv6,
15
+ // // uuidv7 (patched)
16
+ uuidv7 as originalUuidv7,
17
+ // url
18
+ url, ZodURL,
19
+ // httpUrl
20
+ httpUrl,
21
+ // emoji
22
+ emoji, ZodEmoji,
23
+ // nanoid
24
+ nanoid, ZodNanoID,
25
+ // cuid
26
+ cuid, ZodCUID,
27
+ // cuid2
28
+ cuid2, ZodCUID2,
29
+ // ulid
30
+ ulid, ZodULID,
31
+ // xid
32
+ xid, ZodXID,
33
+ // ksuid
34
+ ksuid, ZodKSUID,
35
+ // ipv4
36
+ ipv4, ZodIPv4,
37
+ // mac
38
+ mac, ZodMAC,
39
+ // ipv6
40
+ ipv6, ZodIPv6,
41
+ // cidrv4
42
+ cidrv4, ZodCIDRv4,
43
+ // cidrv6
44
+ cidrv6, ZodCIDRv6,
45
+ // base64
46
+ base64, ZodBase64,
47
+ // base64url
48
+ base64url, ZodBase64URL,
49
+ // e164
50
+ e164, ZodE164,
51
+ // jwt
52
+ jwt, ZodJWT,
53
+ // stringFormat
54
+ stringFormat, ZodStringFormat, ZodCustomStringFormat,
55
+ // hostname
56
+ hostname,
57
+ // hex
58
+ hex,
59
+ // hash
60
+ hash,
61
+ // number
62
+ number, ZodNumber, ZodNumberFormat,
63
+ // int
64
+ int,
65
+ // float32
66
+ float32,
67
+ // float64
68
+ float64,
69
+ // int32
70
+ int32,
71
+ // uint32
72
+ uint32,
73
+ // boolean
74
+ boolean, ZodBoolean,
75
+ // bigint
76
+ bigint, ZodBigInt, ZodBigIntFormat,
77
+ // int64
78
+ int64,
79
+ // uint64
80
+ uint64,
81
+ // symbol
82
+ symbol, ZodSymbol,
83
+ // undefined
84
+ undefined, ZodUndefined,
85
+ // any
86
+ any, ZodAny,
87
+ // unknown
88
+ unknown, ZodUnknown,
89
+ // never
90
+ never, ZodNever,
91
+ // void
92
+ void, ZodVoid,
93
+ // null
94
+ null, ZodNull,
95
+ // date (patched)
96
+ date as originalDate, ZodDate as OriginalZodDate,
97
+ // array
98
+ array, ZodArray,
99
+ // keyof
100
+ keyof,
101
+ // object
102
+ object, ZodObject,
103
+ // strictObject
104
+ strictObject,
105
+ // looseObject
106
+ looseObject,
107
+ // union
108
+ union, ZodUnion,
109
+ // discriminatedUnion
110
+ discriminatedUnion, ZodDiscriminatedUnion,
111
+ // intersection
112
+ intersection, ZodIntersection,
113
+ // tuple
114
+ // tuple,
115
+ // ZodTuple,
116
+ // record
117
+ record, ZodRecord,
118
+ // partialRecord
119
+ partialRecord,
120
+ // map
121
+ map, ZodMap,
122
+ // set
123
+ set, ZodSet,
124
+ // enum
125
+ enum, ZodEnum,
126
+ // nativeEnum
127
+ nativeEnum,
128
+ // literal
129
+ literal, ZodLiteral,
130
+ // file
131
+ file, ZodFile,
132
+ // transform
133
+ transform, ZodTransform,
134
+ // optional
135
+ optional, ZodOptional,
136
+ // nullable
137
+ nullable, ZodNullable,
138
+ // nullish
139
+ nullish,
140
+ // default
141
+ _default, ZodDefault,
142
+ // prefault
143
+ prefault, ZodPrefault,
144
+ // nonoptional
145
+ nonoptional, ZodNonOptional,
146
+ // success
147
+ success, ZodSuccess,
148
+ // catch
149
+ catch, ZodCatch,
150
+ // nan
151
+ nan, ZodNaN,
152
+ // pipe
153
+ pipe, ZodPipe,
154
+ // codec
155
+ codec, ZodCodec,
156
+ // readonly
157
+ readonly, ZodReadonly,
158
+ // templateLiteral
159
+ templateLiteral, ZodTemplateLiteral,
160
+ // lazy
161
+ lazy, ZodLazy,
162
+ // promise
163
+ promise, ZodPromise,
164
+ // function
165
+ function, _function, ZodFunction,
166
+ // custom
167
+ custom, ZodCustom,
168
+ //
169
+ // Others
170
+ //
171
+ clone, coerce, check,
172
+ // Error
173
+ ZodError, ZodRealError, formatError, getErrorMap, setErrorMap,
174
+ // Safe
175
+ decode, decodeAsync, safeDecode, safeDecodeAsync, encode, encodeAsync, safeEncode, safeEncodeAsync, parse, parseAsync, safeParse, safeParseAsync, $output, $input, $brand, meta,
176
+ //
177
+ ZodFirstPartyTypeKind, NEVER, ZodType, TimePrecision, config, core, endsWith, startsWith, describe, flattenError, globalRegistry, gt, gte, lt, lte, includes, instanceof, json, length, locales, lowercase, toLowerCase, uppercase, toUpperCase, minLength, maxLength, minSize, maxSize, size, multipleOf, negative, nonnegative, positive, nonpositive, property, normalize, overwrite, preprocess, prettifyError, refine, superRefine, regexes, mime, regex, slugify, stringbool, trim, registry, toJSONSchema, treeifyError, util, z, ZodIssueCode, } from "zod/v4";
@@ -0,0 +1,71 @@
1
+ import type { Surreal, SurrealTransaction } from "surrealdb";
2
+ import * as classic from "zod/v4";
3
+ import * as core from "zod/v4/core";
4
+ import type * as _core_ from "./core";
5
+ import type { ZodSurrealType } from "./schema";
6
+ export interface ParseDbContext<T extends core.$ZodIssueBase = core.$ZodIssue> extends core.ParseContext<T> {
7
+ db?: Surreal | SurrealTransaction;
8
+ }
9
+ export interface ParseDbContextInternal<T extends core.$ZodIssueBase = core.$ZodIssue> extends core.ParseContextInternal<T> {
10
+ db?: Surreal | SurrealTransaction;
11
+ }
12
+ export type ZodSafeParseResult<T> = classic.ZodSafeParseSuccess<T> | classic.ZodSafeParseError<T>;
13
+ export type ParsingEncodingDecodingMethodNames = "parse" | "encode" | "decode" | "parseAsync" | "encodeAsync" | "decodeAsync" | "safeParse" | "safeEncode" | "safeDecode" | "safeParseAsync" | "safeEncodeAsync" | "safeDecodeAsync";
14
+ export interface ParsingEncodingDecodingMethods<T extends _core_.$SomeSurrealType> {
15
+ parse<Ctx extends ParseDbContext>(data: unknown, params?: Ctx): Ctx extends {
16
+ db: any;
17
+ } ? _core_.dboutput<T> : core.output<T>;
18
+ encode<Ctx extends ParseDbContext>(data: Ctx extends {
19
+ db: any;
20
+ } ? _core_.dboutput<T> : core.output<T>, params?: Ctx): Ctx extends {
21
+ db: any;
22
+ } ? _core_.dbinput<T> : core.input<T>;
23
+ decode<Ctx extends ParseDbContext>(data: Ctx extends {
24
+ db: any;
25
+ } ? _core_.dbinput<T> : core.input<T>, params?: Ctx): Ctx extends {
26
+ db: any;
27
+ } ? _core_.dboutput<T> : core.output<T>;
28
+ parseAsync<Ctx extends ParseDbContext>(data: unknown, params?: Ctx): Promise<Ctx extends {
29
+ db: any;
30
+ } ? _core_.dboutput<T> : core.output<T>>;
31
+ encodeAsync<Ctx extends ParseDbContext>(data: Ctx extends {
32
+ db: any;
33
+ } ? _core_.dboutput<T> : core.output<T>, params?: Ctx): Promise<Ctx extends {
34
+ db: any;
35
+ } ? _core_.dbinput<T> : core.input<T>>;
36
+ decodeAsync<Ctx extends ParseDbContext>(data: Ctx extends {
37
+ db: any;
38
+ } ? _core_.dbinput<T> : core.input<T>, params?: Ctx): Promise<Ctx extends {
39
+ db: any;
40
+ } ? _core_.dboutput<T> : core.output<T>>;
41
+ safeParse<Ctx extends ParseDbContext>(data: unknown, params?: Ctx): classic.ZodSafeParseResult<Ctx extends {
42
+ db: any;
43
+ } ? _core_.dboutput<T> : core.output<T>>;
44
+ safeEncode<Ctx extends ParseDbContext>(data: Ctx extends {
45
+ db: any;
46
+ } ? _core_.dboutput<T> : core.output<T>, params?: Ctx): classic.ZodSafeParseResult<Ctx extends {
47
+ db: any;
48
+ } ? _core_.dbinput<T> : core.input<T>>;
49
+ safeDecode<Ctx extends ParseDbContext>(data: Ctx extends {
50
+ db: any;
51
+ } ? _core_.dbinput<T> : core.input<T>, params?: Ctx): classic.ZodSafeParseResult<Ctx extends {
52
+ db: any;
53
+ } ? _core_.dboutput<T> : core.output<T>>;
54
+ safeParseAsync<Ctx extends ParseDbContext>(data: unknown, params?: Ctx): Promise<classic.ZodSafeParseResult<Ctx extends {
55
+ db: any;
56
+ } ? _core_.dboutput<T> : core.output<T>>>;
57
+ spa<Ctx extends ParseDbContext>(data: unknown, params?: Ctx): Promise<classic.ZodSafeParseResult<Ctx extends {
58
+ db: any;
59
+ } ? _core_.dboutput<T> : core.output<T>>>;
60
+ safeEncodeAsync<Ctx extends ParseDbContext>(data: Ctx extends {
61
+ db: any;
62
+ } ? _core_.dboutput<T> : core.output<T>, params?: Ctx): Promise<classic.ZodSafeParseResult<Ctx extends {
63
+ db: any;
64
+ } ? _core_.dbinput<T> : core.input<T>>>;
65
+ safeDecodeAsync<Ctx extends ParseDbContext>(data: Ctx extends {
66
+ db: any;
67
+ } ? _core_.dbinput<T> : core.input<T>, params?: Ctx): Promise<classic.ZodSafeParseResult<Ctx extends {
68
+ db: any;
69
+ } ? _core_.dboutput<T> : core.output<T>>>;
70
+ }
71
+ export declare function assignParsingMethods(inst: ZodSurrealType): void;
@@ -0,0 +1,17 @@
1
+ import * as classic from "zod/v4";
2
+ import * as core from "zod/v4/core";
3
+ export function assignParsingMethods(inst) {
4
+ inst.parse = (data, params) => classic.parse(inst, data, params);
5
+ inst.decode = (data, params) => classic.decode(inst, data, params);
6
+ inst.encode = (data, params) => classic.encode(inst, data, params);
7
+ inst.parseAsync = (data, params) => classic.parseAsync(inst, data, params);
8
+ inst.decodeAsync = (data, params) => classic.decodeAsync(inst, data, params);
9
+ inst.encodeAsync = (data, params) => classic.encodeAsync(inst, data, params);
10
+ inst.safeParse = (data, params) => classic.safeParse(inst, data, params);
11
+ inst.safeDecode = (data, params) => classic.safeDecode(inst, data, params);
12
+ inst.safeEncode = (data, params) => classic.safeEncode(inst, data, params);
13
+ inst.safeParseAsync = (data, params) => classic.safeParseAsync(inst, data, params);
14
+ inst.spa = inst.safeParseAsync;
15
+ inst.safeDecodeAsync = (data, params) => classic.safeDecodeAsync(inst, data, params);
16
+ inst.safeEncodeAsync = (data, params) => classic.safeEncodeAsync(inst, data, params);
17
+ }