@windrun-huaiin/backend-core 13.0.0 → 14.1.0
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.
- package/dist/_virtual/index.js +7 -3
- package/dist/_virtual/index.mjs +5 -3
- package/dist/_virtual/index2.js +2 -6
- package/dist/_virtual/index2.mjs +2 -6
- package/dist/index.js +3 -1
- package/dist/index.mjs +2 -2
- package/dist/lib/index.js +3 -1
- package/dist/lib/index.mjs +2 -2
- package/dist/lib/stripe-config.d.ts +1 -1
- package/dist/lib/stripe-config.d.ts.map +1 -1
- package/dist/lib/stripe-config.js +25 -16
- package/dist/lib/stripe-config.mjs +25 -16
- package/dist/lib/upstash/qstash.d.ts.map +1 -1
- package/dist/lib/upstash/qstash.js +66 -62
- package/dist/lib/upstash/qstash.mjs +67 -63
- package/dist/lib/upstash/redis-counter.d.ts.map +1 -1
- package/dist/lib/upstash/redis-counter.js +9 -24
- package/dist/lib/upstash/redis-counter.mjs +10 -25
- package/dist/lib/upstash/redis-favorite.d.ts.map +1 -1
- package/dist/lib/upstash/redis-favorite.js +22 -36
- package/dist/lib/upstash/redis-favorite.mjs +23 -37
- package/dist/lib/upstash/redis-like.d.ts.map +1 -1
- package/dist/lib/upstash/redis-like.js +22 -36
- package/dist/lib/upstash/redis-like.mjs +23 -37
- package/dist/lib/upstash/redis-lock.d.ts.map +1 -1
- package/dist/lib/upstash/redis-lock.js +22 -38
- package/dist/lib/upstash/redis-lock.mjs +23 -39
- package/dist/lib/upstash/redis-structures.d.ts.map +1 -1
- package/dist/lib/upstash/redis-structures.js +77 -113
- package/dist/lib/upstash/redis-structures.mjs +78 -114
- package/dist/lib/upstash-config.d.ts +9 -1
- package/dist/lib/upstash-config.d.ts.map +1 -1
- package/dist/lib/upstash-config.js +221 -27
- package/dist/lib/upstash-config.mjs +220 -28
- package/dist/node_modules/.pnpm/{@upstash_qstash@2.8.4/node_modules/@upstash/qstash/chunk-RQPZUJXG.js → @upstash_qstash@2.10.1/node_modules/@upstash/qstash/chunk-35B33QW3.js} +897 -468
- package/dist/node_modules/.pnpm/{@upstash_qstash@2.8.4/node_modules/@upstash/qstash/chunk-RQPZUJXG.mjs → @upstash_qstash@2.10.1/node_modules/@upstash/qstash/chunk-35B33QW3.mjs} +895 -468
- package/dist/node_modules/.pnpm/{@upstash_redis@1.36.1/node_modules/@upstash/redis/chunk-LLI2WIYN.js → @upstash_redis@1.37.0/node_modules/@upstash/redis/chunk-IH7W44G6.js} +657 -40
- package/dist/node_modules/.pnpm/{@upstash_redis@1.36.1/node_modules/@upstash/redis/chunk-LLI2WIYN.mjs → @upstash_redis@1.37.0/node_modules/@upstash/redis/chunk-IH7W44G6.mjs} +657 -41
- package/dist/node_modules/.pnpm/{@upstash_redis@1.36.1 → @upstash_redis@1.37.0}/node_modules/@upstash/redis/nodejs.js +6 -5
- package/dist/node_modules/.pnpm/{@upstash_redis@1.36.1 → @upstash_redis@1.37.0}/node_modules/@upstash/redis/nodejs.mjs +2 -2
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/index.js +1 -1
- package/dist/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/index.mjs +1 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/flattened/verify.js +6 -6
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jwt/verify.js +1 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/key/import.js +2 -2
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/epoch.js +3 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_disjoint.js +3 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_jwk.js +1 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_object.js +3 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/jwt_claims_set.js +7 -5
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/secs.js +3 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_algorithms.js +3 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_crit.js +3 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/check_key_length.js +3 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/dsa_digest.js +3 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_named_curve.js +4 -2
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_sign_verify_key.js +3 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/hmac_digest.js +3 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_like.js +1 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_object.js +3 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/jwk_to_key.js +3 -1
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/node_key.js +6 -4
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/sign.js +6 -4
- package/dist/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/verify.js +7 -5
- package/dist/services/stripe/webhook-handler.js +4 -2
- package/dist/services/stripe/webhook-handler.mjs +3 -1
- package/package.json +5 -5
- package/src/lib/stripe-config.ts +27 -15
- package/src/lib/upstash/qstash.ts +64 -62
- package/src/lib/upstash/redis-counter.ts +10 -26
- package/src/lib/upstash/redis-favorite.ts +23 -42
- package/src/lib/upstash/redis-like.ts +23 -42
- package/src/lib/upstash/redis-lock.ts +23 -49
- package/src/lib/upstash/redis-structures.ts +82 -131
- package/src/lib/upstash-config.ts +231 -24
- package/src/services/stripe/webhook-handler.ts +3 -1
- package/dist/_virtual/index3.js +0 -5
- package/dist/_virtual/index3.mjs +0 -3
- package/dist/node_modules/.pnpm/@upstash_lock@0.2.1_typescript@5.9.3/node_modules/@upstash/lock/dist/index.js +0 -191
- package/dist/node_modules/.pnpm/@upstash_lock@0.2.1_typescript@5.9.3/node_modules/@upstash/lock/dist/index.mjs +0 -189
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/errors.js +0 -54
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/errors.mjs +0 -51
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/iso.js +0 -44
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/iso.mjs +0 -35
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/parse.js +0 -31
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/parse.mjs +0 -18
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/schemas.js +0 -587
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/schemas.mjs +0 -527
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/api.js +0 -447
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/api.mjs +0 -399
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/checks.js +0 -245
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/checks.mjs +0 -232
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/core.js +0 -68
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/core.mjs +0 -62
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/doc.js +0 -39
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/doc.mjs +0 -37
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/errors.js +0 -80
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/errors.mjs +0 -75
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/parse.js +0 -101
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/parse.mjs +0 -86
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/regexes.js +0 -102
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/regexes.mjs +0 -76
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/registries.js +0 -56
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/registries.mjs +0 -52
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/schemas.js +0 -1205
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/schemas.mjs +0 -1157
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/util.js +0 -407
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/util.mjs +0 -374
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/versions.js +0 -9
- package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/versions.mjs +0 -7
|
@@ -1,447 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var checks = require('./checks.js');
|
|
4
|
-
var util = require('./util.js');
|
|
5
|
-
|
|
6
|
-
function _string(Class, params) {
|
|
7
|
-
return new Class({
|
|
8
|
-
type: "string",
|
|
9
|
-
...util.normalizeParams(params),
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
function _email(Class, params) {
|
|
13
|
-
return new Class({
|
|
14
|
-
type: "string",
|
|
15
|
-
format: "email",
|
|
16
|
-
check: "string_format",
|
|
17
|
-
abort: false,
|
|
18
|
-
...util.normalizeParams(params),
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
function _guid(Class, params) {
|
|
22
|
-
return new Class({
|
|
23
|
-
type: "string",
|
|
24
|
-
format: "guid",
|
|
25
|
-
check: "string_format",
|
|
26
|
-
abort: false,
|
|
27
|
-
...util.normalizeParams(params),
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function _uuid(Class, params) {
|
|
31
|
-
return new Class({
|
|
32
|
-
type: "string",
|
|
33
|
-
format: "uuid",
|
|
34
|
-
check: "string_format",
|
|
35
|
-
abort: false,
|
|
36
|
-
...util.normalizeParams(params),
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
function _uuidv4(Class, params) {
|
|
40
|
-
return new Class({
|
|
41
|
-
type: "string",
|
|
42
|
-
format: "uuid",
|
|
43
|
-
check: "string_format",
|
|
44
|
-
abort: false,
|
|
45
|
-
version: "v4",
|
|
46
|
-
...util.normalizeParams(params),
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function _uuidv6(Class, params) {
|
|
50
|
-
return new Class({
|
|
51
|
-
type: "string",
|
|
52
|
-
format: "uuid",
|
|
53
|
-
check: "string_format",
|
|
54
|
-
abort: false,
|
|
55
|
-
version: "v6",
|
|
56
|
-
...util.normalizeParams(params),
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function _uuidv7(Class, params) {
|
|
60
|
-
return new Class({
|
|
61
|
-
type: "string",
|
|
62
|
-
format: "uuid",
|
|
63
|
-
check: "string_format",
|
|
64
|
-
abort: false,
|
|
65
|
-
version: "v7",
|
|
66
|
-
...util.normalizeParams(params),
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
function _url(Class, params) {
|
|
70
|
-
return new Class({
|
|
71
|
-
type: "string",
|
|
72
|
-
format: "url",
|
|
73
|
-
check: "string_format",
|
|
74
|
-
abort: false,
|
|
75
|
-
...util.normalizeParams(params),
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
function _emoji(Class, params) {
|
|
79
|
-
return new Class({
|
|
80
|
-
type: "string",
|
|
81
|
-
format: "emoji",
|
|
82
|
-
check: "string_format",
|
|
83
|
-
abort: false,
|
|
84
|
-
...util.normalizeParams(params),
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
function _nanoid(Class, params) {
|
|
88
|
-
return new Class({
|
|
89
|
-
type: "string",
|
|
90
|
-
format: "nanoid",
|
|
91
|
-
check: "string_format",
|
|
92
|
-
abort: false,
|
|
93
|
-
...util.normalizeParams(params),
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
function _cuid(Class, params) {
|
|
97
|
-
return new Class({
|
|
98
|
-
type: "string",
|
|
99
|
-
format: "cuid",
|
|
100
|
-
check: "string_format",
|
|
101
|
-
abort: false,
|
|
102
|
-
...util.normalizeParams(params),
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
function _cuid2(Class, params) {
|
|
106
|
-
return new Class({
|
|
107
|
-
type: "string",
|
|
108
|
-
format: "cuid2",
|
|
109
|
-
check: "string_format",
|
|
110
|
-
abort: false,
|
|
111
|
-
...util.normalizeParams(params),
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
function _ulid(Class, params) {
|
|
115
|
-
return new Class({
|
|
116
|
-
type: "string",
|
|
117
|
-
format: "ulid",
|
|
118
|
-
check: "string_format",
|
|
119
|
-
abort: false,
|
|
120
|
-
...util.normalizeParams(params),
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
function _xid(Class, params) {
|
|
124
|
-
return new Class({
|
|
125
|
-
type: "string",
|
|
126
|
-
format: "xid",
|
|
127
|
-
check: "string_format",
|
|
128
|
-
abort: false,
|
|
129
|
-
...util.normalizeParams(params),
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
function _ksuid(Class, params) {
|
|
133
|
-
return new Class({
|
|
134
|
-
type: "string",
|
|
135
|
-
format: "ksuid",
|
|
136
|
-
check: "string_format",
|
|
137
|
-
abort: false,
|
|
138
|
-
...util.normalizeParams(params),
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
function _ipv4(Class, params) {
|
|
142
|
-
return new Class({
|
|
143
|
-
type: "string",
|
|
144
|
-
format: "ipv4",
|
|
145
|
-
check: "string_format",
|
|
146
|
-
abort: false,
|
|
147
|
-
...util.normalizeParams(params),
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
function _ipv6(Class, params) {
|
|
151
|
-
return new Class({
|
|
152
|
-
type: "string",
|
|
153
|
-
format: "ipv6",
|
|
154
|
-
check: "string_format",
|
|
155
|
-
abort: false,
|
|
156
|
-
...util.normalizeParams(params),
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
function _cidrv4(Class, params) {
|
|
160
|
-
return new Class({
|
|
161
|
-
type: "string",
|
|
162
|
-
format: "cidrv4",
|
|
163
|
-
check: "string_format",
|
|
164
|
-
abort: false,
|
|
165
|
-
...util.normalizeParams(params),
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
function _cidrv6(Class, params) {
|
|
169
|
-
return new Class({
|
|
170
|
-
type: "string",
|
|
171
|
-
format: "cidrv6",
|
|
172
|
-
check: "string_format",
|
|
173
|
-
abort: false,
|
|
174
|
-
...util.normalizeParams(params),
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
function _base64(Class, params) {
|
|
178
|
-
return new Class({
|
|
179
|
-
type: "string",
|
|
180
|
-
format: "base64",
|
|
181
|
-
check: "string_format",
|
|
182
|
-
abort: false,
|
|
183
|
-
...util.normalizeParams(params),
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
function _base64url(Class, params) {
|
|
187
|
-
return new Class({
|
|
188
|
-
type: "string",
|
|
189
|
-
format: "base64url",
|
|
190
|
-
check: "string_format",
|
|
191
|
-
abort: false,
|
|
192
|
-
...util.normalizeParams(params),
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
function _e164(Class, params) {
|
|
196
|
-
return new Class({
|
|
197
|
-
type: "string",
|
|
198
|
-
format: "e164",
|
|
199
|
-
check: "string_format",
|
|
200
|
-
abort: false,
|
|
201
|
-
...util.normalizeParams(params),
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
function _jwt(Class, params) {
|
|
205
|
-
return new Class({
|
|
206
|
-
type: "string",
|
|
207
|
-
format: "jwt",
|
|
208
|
-
check: "string_format",
|
|
209
|
-
abort: false,
|
|
210
|
-
...util.normalizeParams(params),
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
function _isoDateTime(Class, params) {
|
|
214
|
-
return new Class({
|
|
215
|
-
type: "string",
|
|
216
|
-
format: "datetime",
|
|
217
|
-
check: "string_format",
|
|
218
|
-
offset: false,
|
|
219
|
-
local: false,
|
|
220
|
-
precision: null,
|
|
221
|
-
...util.normalizeParams(params),
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
function _isoDate(Class, params) {
|
|
225
|
-
return new Class({
|
|
226
|
-
type: "string",
|
|
227
|
-
format: "date",
|
|
228
|
-
check: "string_format",
|
|
229
|
-
...util.normalizeParams(params),
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
function _isoTime(Class, params) {
|
|
233
|
-
return new Class({
|
|
234
|
-
type: "string",
|
|
235
|
-
format: "time",
|
|
236
|
-
check: "string_format",
|
|
237
|
-
precision: null,
|
|
238
|
-
...util.normalizeParams(params),
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
function _isoDuration(Class, params) {
|
|
242
|
-
return new Class({
|
|
243
|
-
type: "string",
|
|
244
|
-
format: "duration",
|
|
245
|
-
check: "string_format",
|
|
246
|
-
...util.normalizeParams(params),
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
function _unknown(Class) {
|
|
250
|
-
return new Class({
|
|
251
|
-
type: "unknown",
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
function _never(Class, params) {
|
|
255
|
-
return new Class({
|
|
256
|
-
type: "never",
|
|
257
|
-
...util.normalizeParams(params),
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
function _maxLength(maximum, params) {
|
|
261
|
-
const ch = new checks.$ZodCheckMaxLength({
|
|
262
|
-
check: "max_length",
|
|
263
|
-
...util.normalizeParams(params),
|
|
264
|
-
maximum,
|
|
265
|
-
});
|
|
266
|
-
return ch;
|
|
267
|
-
}
|
|
268
|
-
function _minLength(minimum, params) {
|
|
269
|
-
return new checks.$ZodCheckMinLength({
|
|
270
|
-
check: "min_length",
|
|
271
|
-
...util.normalizeParams(params),
|
|
272
|
-
minimum,
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
function _length(length, params) {
|
|
276
|
-
return new checks.$ZodCheckLengthEquals({
|
|
277
|
-
check: "length_equals",
|
|
278
|
-
...util.normalizeParams(params),
|
|
279
|
-
length,
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
function _regex(pattern, params) {
|
|
283
|
-
return new checks.$ZodCheckRegex({
|
|
284
|
-
check: "string_format",
|
|
285
|
-
format: "regex",
|
|
286
|
-
...util.normalizeParams(params),
|
|
287
|
-
pattern,
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
function _lowercase(params) {
|
|
291
|
-
return new checks.$ZodCheckLowerCase({
|
|
292
|
-
check: "string_format",
|
|
293
|
-
format: "lowercase",
|
|
294
|
-
...util.normalizeParams(params),
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
function _uppercase(params) {
|
|
298
|
-
return new checks.$ZodCheckUpperCase({
|
|
299
|
-
check: "string_format",
|
|
300
|
-
format: "uppercase",
|
|
301
|
-
...util.normalizeParams(params),
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
function _includes(includes, params) {
|
|
305
|
-
return new checks.$ZodCheckIncludes({
|
|
306
|
-
check: "string_format",
|
|
307
|
-
format: "includes",
|
|
308
|
-
...util.normalizeParams(params),
|
|
309
|
-
includes,
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
function _startsWith(prefix, params) {
|
|
313
|
-
return new checks.$ZodCheckStartsWith({
|
|
314
|
-
check: "string_format",
|
|
315
|
-
format: "starts_with",
|
|
316
|
-
...util.normalizeParams(params),
|
|
317
|
-
prefix,
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
function _endsWith(suffix, params) {
|
|
321
|
-
return new checks.$ZodCheckEndsWith({
|
|
322
|
-
check: "string_format",
|
|
323
|
-
format: "ends_with",
|
|
324
|
-
...util.normalizeParams(params),
|
|
325
|
-
suffix,
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
function _overwrite(tx) {
|
|
329
|
-
return new checks.$ZodCheckOverwrite({
|
|
330
|
-
check: "overwrite",
|
|
331
|
-
tx,
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
// normalize
|
|
335
|
-
function _normalize(form) {
|
|
336
|
-
return _overwrite((input) => input.normalize(form));
|
|
337
|
-
}
|
|
338
|
-
// trim
|
|
339
|
-
function _trim() {
|
|
340
|
-
return _overwrite((input) => input.trim());
|
|
341
|
-
}
|
|
342
|
-
// toLowerCase
|
|
343
|
-
function _toLowerCase() {
|
|
344
|
-
return _overwrite((input) => input.toLowerCase());
|
|
345
|
-
}
|
|
346
|
-
// toUpperCase
|
|
347
|
-
function _toUpperCase() {
|
|
348
|
-
return _overwrite((input) => input.toUpperCase());
|
|
349
|
-
}
|
|
350
|
-
function _array(Class, element, params) {
|
|
351
|
-
return new Class({
|
|
352
|
-
type: "array",
|
|
353
|
-
element,
|
|
354
|
-
// get element() {
|
|
355
|
-
// return element;
|
|
356
|
-
// },
|
|
357
|
-
...util.normalizeParams(params),
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
// same as _custom but defaults to abort:false
|
|
361
|
-
function _refine(Class, fn, _params) {
|
|
362
|
-
const schema = new Class({
|
|
363
|
-
type: "custom",
|
|
364
|
-
check: "custom",
|
|
365
|
-
fn: fn,
|
|
366
|
-
...util.normalizeParams(_params),
|
|
367
|
-
});
|
|
368
|
-
return schema;
|
|
369
|
-
}
|
|
370
|
-
function _superRefine(fn) {
|
|
371
|
-
const ch = _check((payload) => {
|
|
372
|
-
payload.addIssue = (issue) => {
|
|
373
|
-
if (typeof issue === "string") {
|
|
374
|
-
payload.issues.push(util.issue(issue, payload.value, ch._zod.def));
|
|
375
|
-
}
|
|
376
|
-
else {
|
|
377
|
-
// for Zod 3 backwards compatibility
|
|
378
|
-
const _issue = issue;
|
|
379
|
-
if (_issue.fatal)
|
|
380
|
-
_issue.continue = false;
|
|
381
|
-
_issue.code ?? (_issue.code = "custom");
|
|
382
|
-
_issue.input ?? (_issue.input = payload.value);
|
|
383
|
-
_issue.inst ?? (_issue.inst = ch);
|
|
384
|
-
_issue.continue ?? (_issue.continue = !ch._zod.def.abort); // abort is always undefined, so this is always true...
|
|
385
|
-
payload.issues.push(util.issue(_issue));
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
return fn(payload.value, payload);
|
|
389
|
-
});
|
|
390
|
-
return ch;
|
|
391
|
-
}
|
|
392
|
-
function _check(fn, params) {
|
|
393
|
-
const ch = new checks.$ZodCheck({
|
|
394
|
-
check: "custom",
|
|
395
|
-
...util.normalizeParams(params),
|
|
396
|
-
});
|
|
397
|
-
ch._zod.check = fn;
|
|
398
|
-
return ch;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
exports._array = _array;
|
|
402
|
-
exports._base64 = _base64;
|
|
403
|
-
exports._base64url = _base64url;
|
|
404
|
-
exports._check = _check;
|
|
405
|
-
exports._cidrv4 = _cidrv4;
|
|
406
|
-
exports._cidrv6 = _cidrv6;
|
|
407
|
-
exports._cuid = _cuid;
|
|
408
|
-
exports._cuid2 = _cuid2;
|
|
409
|
-
exports._e164 = _e164;
|
|
410
|
-
exports._email = _email;
|
|
411
|
-
exports._emoji = _emoji;
|
|
412
|
-
exports._endsWith = _endsWith;
|
|
413
|
-
exports._guid = _guid;
|
|
414
|
-
exports._includes = _includes;
|
|
415
|
-
exports._ipv4 = _ipv4;
|
|
416
|
-
exports._ipv6 = _ipv6;
|
|
417
|
-
exports._isoDate = _isoDate;
|
|
418
|
-
exports._isoDateTime = _isoDateTime;
|
|
419
|
-
exports._isoDuration = _isoDuration;
|
|
420
|
-
exports._isoTime = _isoTime;
|
|
421
|
-
exports._jwt = _jwt;
|
|
422
|
-
exports._ksuid = _ksuid;
|
|
423
|
-
exports._length = _length;
|
|
424
|
-
exports._lowercase = _lowercase;
|
|
425
|
-
exports._maxLength = _maxLength;
|
|
426
|
-
exports._minLength = _minLength;
|
|
427
|
-
exports._nanoid = _nanoid;
|
|
428
|
-
exports._never = _never;
|
|
429
|
-
exports._normalize = _normalize;
|
|
430
|
-
exports._overwrite = _overwrite;
|
|
431
|
-
exports._refine = _refine;
|
|
432
|
-
exports._regex = _regex;
|
|
433
|
-
exports._startsWith = _startsWith;
|
|
434
|
-
exports._string = _string;
|
|
435
|
-
exports._superRefine = _superRefine;
|
|
436
|
-
exports._toLowerCase = _toLowerCase;
|
|
437
|
-
exports._toUpperCase = _toUpperCase;
|
|
438
|
-
exports._trim = _trim;
|
|
439
|
-
exports._ulid = _ulid;
|
|
440
|
-
exports._unknown = _unknown;
|
|
441
|
-
exports._uppercase = _uppercase;
|
|
442
|
-
exports._url = _url;
|
|
443
|
-
exports._uuid = _uuid;
|
|
444
|
-
exports._uuidv4 = _uuidv4;
|
|
445
|
-
exports._uuidv6 = _uuidv6;
|
|
446
|
-
exports._uuidv7 = _uuidv7;
|
|
447
|
-
exports._xid = _xid;
|