matrix-nodejs-homeserver 0.2.0 → 0.3.1
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/README.md +29 -7
- package/dist/api/account.js +385 -351
- package/dist/api/admin.js +76 -60
- package/dist/api/appservice.js +37 -25
- package/dist/api/backup.js +73 -62
- package/dist/api/federation.js +172 -138
- package/dist/api/filters.js +4 -3
- package/dist/api/legacy.js +91 -78
- package/dist/api/media.js +70 -54
- package/dist/api/misc.js +46 -37
- package/dist/api/preview.js +4 -3
- package/dist/api/profile.js +108 -97
- package/dist/api/push.js +114 -99
- package/dist/api/relationships.js +64 -58
- package/dist/api/rooms.js +703 -580
- package/dist/api/rtc.d.ts +0 -1
- package/dist/api/rtc.js +48 -34
- package/dist/api/search.js +133 -127
- package/dist/api/slidingsync.js +41 -31
- package/dist/api/spaces.js +82 -77
- package/dist/api/sync.js +59 -50
- package/dist/api/threadsubs.js +72 -61
- package/dist/api/threepid.js +99 -66
- package/dist/api/uia.js +17 -16
- package/dist/api/user.js +221 -178
- package/dist/core/admin.d.ts +0 -1
- package/dist/core/admin.js +6 -5
- package/dist/core/adminroom.js +9 -8
- package/dist/core/appservices.d.ts +2 -1
- package/dist/core/appservices.js +5 -4
- package/dist/core/audit.d.ts +0 -1
- package/dist/core/authrules.js +26 -25
- package/dist/core/delayed.js +2 -1
- package/dist/core/events.js +11 -10
- package/dist/core/invitefilter.js +2 -1
- package/dist/core/keys.js +2 -1
- package/dist/core/m.d.ts +209 -0
- package/dist/core/m.js +182 -0
- package/dist/core/partialstate.js +2 -1
- package/dist/core/policy.js +4 -3
- package/dist/core/push.d.ts +0 -1
- package/dist/core/push.js +12 -11
- package/dist/core/pushrules.js +36 -35
- package/dist/core/rooms.js +76 -74
- package/dist/core/stateres.js +7 -6
- package/dist/federation/client.js +2 -1
- package/dist/federation/index.d.ts +1 -1
- package/dist/federation/index.js +30 -29
- package/dist/homeserver.d.ts +2 -1
- package/dist/homeserver.js +1 -0
- package/dist/http/handler.js +2 -23
- package/dist/http/input.js +2 -2
- package/dist/http/procedure.js +25 -0
- package/dist/http/router.d.ts +9 -26
- package/dist/http/router.js +10 -30
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/vendor/zod/LICENSE +21 -0
- package/dist/vendor/zod/v4/classic/errors.js +54 -0
- package/dist/vendor/zod/v4/classic/parse.js +17 -0
- package/dist/vendor/zod/v4/classic/schemas.js +865 -0
- package/dist/vendor/zod/v4/core/api.js +512 -0
- package/dist/vendor/zod/v4/core/checks.js +300 -0
- package/dist/vendor/zod/v4/core/core.js +109 -0
- package/dist/vendor/zod/v4/core/doc.js +35 -0
- package/dist/vendor/zod/v4/core/errors.js +118 -0
- package/dist/vendor/zod/v4/core/json-schema-processors.js +428 -0
- package/dist/vendor/zod/v4/core/memoizer.js +255 -0
- package/dist/vendor/zod/v4/core/parse.js +206 -0
- package/dist/vendor/zod/v4/core/regexes.js +73 -0
- package/dist/vendor/zod/v4/core/registries.js +48 -0
- package/dist/vendor/zod/v4/core/schemas.js +1378 -0
- package/dist/vendor/zod/v4/core/to-json-schema.js +448 -0
- package/dist/vendor/zod/v4/core/util.js +537 -0
- package/dist/vendor/zod/v4/core/versions.js +8 -0
- package/dist/vendor/zod/v4/locales/en.js +110 -0
- package/package.json +3 -5
- package/dist/core/pushrules.d.ts +0 -1
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
import { issue, normalizeParams, slugify } from "./util.js";
|
|
2
|
+
import { $ZodCheck, $ZodCheckEndsWith, $ZodCheckGreaterThan, $ZodCheckIncludes, $ZodCheckLengthEquals, $ZodCheckLessThan, $ZodCheckLowerCase, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckMultipleOf, $ZodCheckOverwrite, $ZodCheckRegex, $ZodCheckStartsWith, $ZodCheckUpperCase } from "./checks.js";
|
|
3
|
+
//#region node_modules/zod/v4/core/api.js
|
|
4
|
+
function snapshotChecks(def) {
|
|
5
|
+
if (def.checks) def.checks = [...def.checks];
|
|
6
|
+
return def;
|
|
7
|
+
}
|
|
8
|
+
// @__NO_SIDE_EFFECTS__
|
|
9
|
+
function _string(Class, params) {
|
|
10
|
+
return new Class(snapshotChecks({
|
|
11
|
+
type: "string",
|
|
12
|
+
...normalizeParams(params)
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
// @__NO_SIDE_EFFECTS__
|
|
16
|
+
function _email(Class, params) {
|
|
17
|
+
return new Class({
|
|
18
|
+
type: "string",
|
|
19
|
+
format: "email",
|
|
20
|
+
check: "string_format",
|
|
21
|
+
abort: false,
|
|
22
|
+
...normalizeParams(params)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
// @__NO_SIDE_EFFECTS__
|
|
26
|
+
function _guid(Class, params) {
|
|
27
|
+
return new Class({
|
|
28
|
+
type: "string",
|
|
29
|
+
format: "guid",
|
|
30
|
+
check: "string_format",
|
|
31
|
+
abort: false,
|
|
32
|
+
...normalizeParams(params)
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
// @__NO_SIDE_EFFECTS__
|
|
36
|
+
function _uuid(Class, params) {
|
|
37
|
+
return new Class({
|
|
38
|
+
type: "string",
|
|
39
|
+
format: "uuid",
|
|
40
|
+
check: "string_format",
|
|
41
|
+
abort: false,
|
|
42
|
+
...normalizeParams(params)
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
// @__NO_SIDE_EFFECTS__
|
|
46
|
+
function _uuidv4(Class, params) {
|
|
47
|
+
return new Class({
|
|
48
|
+
type: "string",
|
|
49
|
+
format: "uuid",
|
|
50
|
+
check: "string_format",
|
|
51
|
+
abort: false,
|
|
52
|
+
version: "v4",
|
|
53
|
+
...normalizeParams(params)
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
// @__NO_SIDE_EFFECTS__
|
|
57
|
+
function _uuidv6(Class, params) {
|
|
58
|
+
return new Class({
|
|
59
|
+
type: "string",
|
|
60
|
+
format: "uuid",
|
|
61
|
+
check: "string_format",
|
|
62
|
+
abort: false,
|
|
63
|
+
version: "v6",
|
|
64
|
+
...normalizeParams(params)
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// @__NO_SIDE_EFFECTS__
|
|
68
|
+
function _uuidv7(Class, params) {
|
|
69
|
+
return new Class({
|
|
70
|
+
type: "string",
|
|
71
|
+
format: "uuid",
|
|
72
|
+
check: "string_format",
|
|
73
|
+
abort: false,
|
|
74
|
+
version: "v7",
|
|
75
|
+
...normalizeParams(params)
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
// @__NO_SIDE_EFFECTS__
|
|
79
|
+
function _url(Class, params) {
|
|
80
|
+
return new Class({
|
|
81
|
+
type: "string",
|
|
82
|
+
format: "url",
|
|
83
|
+
check: "string_format",
|
|
84
|
+
abort: false,
|
|
85
|
+
...normalizeParams(params)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
// @__NO_SIDE_EFFECTS__
|
|
89
|
+
function _emoji(Class, params) {
|
|
90
|
+
return new Class({
|
|
91
|
+
type: "string",
|
|
92
|
+
format: "emoji",
|
|
93
|
+
check: "string_format",
|
|
94
|
+
abort: false,
|
|
95
|
+
...normalizeParams(params)
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
// @__NO_SIDE_EFFECTS__
|
|
99
|
+
function _nanoid(Class, params) {
|
|
100
|
+
return new Class({
|
|
101
|
+
type: "string",
|
|
102
|
+
format: "nanoid",
|
|
103
|
+
check: "string_format",
|
|
104
|
+
abort: false,
|
|
105
|
+
...normalizeParams(params)
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
110
|
+
* (timestamps embedded in the id). Use {@link _cuid2} instead.
|
|
111
|
+
* See https://github.com/paralleldrive/cuid.
|
|
112
|
+
*/
|
|
113
|
+
// @__NO_SIDE_EFFECTS__
|
|
114
|
+
function _cuid(Class, params) {
|
|
115
|
+
return new Class({
|
|
116
|
+
type: "string",
|
|
117
|
+
format: "cuid",
|
|
118
|
+
check: "string_format",
|
|
119
|
+
abort: false,
|
|
120
|
+
...normalizeParams(params)
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
// @__NO_SIDE_EFFECTS__
|
|
124
|
+
function _cuid2(Class, params) {
|
|
125
|
+
return new Class({
|
|
126
|
+
type: "string",
|
|
127
|
+
format: "cuid2",
|
|
128
|
+
check: "string_format",
|
|
129
|
+
abort: false,
|
|
130
|
+
...normalizeParams(params)
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
// @__NO_SIDE_EFFECTS__
|
|
134
|
+
function _ulid(Class, params) {
|
|
135
|
+
return new Class({
|
|
136
|
+
type: "string",
|
|
137
|
+
format: "ulid",
|
|
138
|
+
check: "string_format",
|
|
139
|
+
abort: false,
|
|
140
|
+
...normalizeParams(params)
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
// @__NO_SIDE_EFFECTS__
|
|
144
|
+
function _xid(Class, params) {
|
|
145
|
+
return new Class({
|
|
146
|
+
type: "string",
|
|
147
|
+
format: "xid",
|
|
148
|
+
check: "string_format",
|
|
149
|
+
abort: false,
|
|
150
|
+
...normalizeParams(params)
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
// @__NO_SIDE_EFFECTS__
|
|
154
|
+
function _ksuid(Class, params) {
|
|
155
|
+
return new Class({
|
|
156
|
+
type: "string",
|
|
157
|
+
format: "ksuid",
|
|
158
|
+
check: "string_format",
|
|
159
|
+
abort: false,
|
|
160
|
+
...normalizeParams(params)
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
// @__NO_SIDE_EFFECTS__
|
|
164
|
+
function _ipv4(Class, params) {
|
|
165
|
+
return new Class({
|
|
166
|
+
type: "string",
|
|
167
|
+
format: "ipv4",
|
|
168
|
+
check: "string_format",
|
|
169
|
+
abort: false,
|
|
170
|
+
...normalizeParams(params)
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
// @__NO_SIDE_EFFECTS__
|
|
174
|
+
function _ipv6(Class, params) {
|
|
175
|
+
return new Class({
|
|
176
|
+
type: "string",
|
|
177
|
+
format: "ipv6",
|
|
178
|
+
check: "string_format",
|
|
179
|
+
abort: false,
|
|
180
|
+
...normalizeParams(params)
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
// @__NO_SIDE_EFFECTS__
|
|
184
|
+
function _cidrv4(Class, params) {
|
|
185
|
+
return new Class({
|
|
186
|
+
type: "string",
|
|
187
|
+
format: "cidrv4",
|
|
188
|
+
check: "string_format",
|
|
189
|
+
abort: false,
|
|
190
|
+
...normalizeParams(params)
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
// @__NO_SIDE_EFFECTS__
|
|
194
|
+
function _cidrv6(Class, params) {
|
|
195
|
+
return new Class({
|
|
196
|
+
type: "string",
|
|
197
|
+
format: "cidrv6",
|
|
198
|
+
check: "string_format",
|
|
199
|
+
abort: false,
|
|
200
|
+
...normalizeParams(params)
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
// @__NO_SIDE_EFFECTS__
|
|
204
|
+
function _base64(Class, params) {
|
|
205
|
+
return new Class({
|
|
206
|
+
type: "string",
|
|
207
|
+
format: "base64",
|
|
208
|
+
check: "string_format",
|
|
209
|
+
abort: false,
|
|
210
|
+
...normalizeParams(params)
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
// @__NO_SIDE_EFFECTS__
|
|
214
|
+
function _base64url(Class, params) {
|
|
215
|
+
return new Class({
|
|
216
|
+
type: "string",
|
|
217
|
+
format: "base64url",
|
|
218
|
+
check: "string_format",
|
|
219
|
+
abort: false,
|
|
220
|
+
...normalizeParams(params)
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
// @__NO_SIDE_EFFECTS__
|
|
224
|
+
function _e164(Class, params) {
|
|
225
|
+
return new Class({
|
|
226
|
+
type: "string",
|
|
227
|
+
format: "e164",
|
|
228
|
+
check: "string_format",
|
|
229
|
+
abort: false,
|
|
230
|
+
...normalizeParams(params)
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
// @__NO_SIDE_EFFECTS__
|
|
234
|
+
function _jwt(Class, params) {
|
|
235
|
+
return new Class({
|
|
236
|
+
type: "string",
|
|
237
|
+
format: "jwt",
|
|
238
|
+
check: "string_format",
|
|
239
|
+
abort: false,
|
|
240
|
+
...normalizeParams(params)
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
// @__NO_SIDE_EFFECTS__
|
|
244
|
+
function _isoDateTime(Class, params) {
|
|
245
|
+
return new Class({
|
|
246
|
+
type: "string",
|
|
247
|
+
format: "datetime",
|
|
248
|
+
check: "string_format",
|
|
249
|
+
offset: false,
|
|
250
|
+
local: false,
|
|
251
|
+
precision: null,
|
|
252
|
+
...normalizeParams(params)
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
// @__NO_SIDE_EFFECTS__
|
|
256
|
+
function _isoDate(Class, params) {
|
|
257
|
+
return new Class({
|
|
258
|
+
type: "string",
|
|
259
|
+
format: "date",
|
|
260
|
+
check: "string_format",
|
|
261
|
+
...normalizeParams(params)
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
// @__NO_SIDE_EFFECTS__
|
|
265
|
+
function _isoTime(Class, params) {
|
|
266
|
+
return new Class({
|
|
267
|
+
type: "string",
|
|
268
|
+
format: "time",
|
|
269
|
+
check: "string_format",
|
|
270
|
+
precision: null,
|
|
271
|
+
...normalizeParams(params)
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
// @__NO_SIDE_EFFECTS__
|
|
275
|
+
function _isoDuration(Class, params) {
|
|
276
|
+
return new Class({
|
|
277
|
+
type: "string",
|
|
278
|
+
format: "duration",
|
|
279
|
+
check: "string_format",
|
|
280
|
+
...normalizeParams(params)
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
// @__NO_SIDE_EFFECTS__
|
|
284
|
+
function _number(Class, params) {
|
|
285
|
+
return new Class(snapshotChecks({
|
|
286
|
+
type: "number",
|
|
287
|
+
checks: [],
|
|
288
|
+
...normalizeParams(params)
|
|
289
|
+
}));
|
|
290
|
+
}
|
|
291
|
+
// @__NO_SIDE_EFFECTS__
|
|
292
|
+
function _int(Class, params) {
|
|
293
|
+
return new Class({
|
|
294
|
+
type: "number",
|
|
295
|
+
check: "number_format",
|
|
296
|
+
abort: false,
|
|
297
|
+
format: "safeint",
|
|
298
|
+
...normalizeParams(params)
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
// @__NO_SIDE_EFFECTS__
|
|
302
|
+
function _boolean(Class, params) {
|
|
303
|
+
return new Class({
|
|
304
|
+
type: "boolean",
|
|
305
|
+
...normalizeParams(params)
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
// @__NO_SIDE_EFFECTS__
|
|
309
|
+
function _unknown(Class) {
|
|
310
|
+
return new Class({ type: "unknown" });
|
|
311
|
+
}
|
|
312
|
+
// @__NO_SIDE_EFFECTS__
|
|
313
|
+
function _never(Class, params) {
|
|
314
|
+
return new Class({
|
|
315
|
+
type: "never",
|
|
316
|
+
...normalizeParams(params)
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
// @__NO_SIDE_EFFECTS__
|
|
320
|
+
function _lt(value, params) {
|
|
321
|
+
return new $ZodCheckLessThan({
|
|
322
|
+
check: "less_than",
|
|
323
|
+
...normalizeParams(params),
|
|
324
|
+
value,
|
|
325
|
+
inclusive: false
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
// @__NO_SIDE_EFFECTS__
|
|
329
|
+
function _lte(value, params) {
|
|
330
|
+
return new $ZodCheckLessThan({
|
|
331
|
+
check: "less_than",
|
|
332
|
+
...normalizeParams(params),
|
|
333
|
+
value,
|
|
334
|
+
inclusive: true
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
// @__NO_SIDE_EFFECTS__
|
|
338
|
+
function _gt(value, params) {
|
|
339
|
+
return new $ZodCheckGreaterThan({
|
|
340
|
+
check: "greater_than",
|
|
341
|
+
...normalizeParams(params),
|
|
342
|
+
value,
|
|
343
|
+
inclusive: false
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
// @__NO_SIDE_EFFECTS__
|
|
347
|
+
function _gte(value, params) {
|
|
348
|
+
return new $ZodCheckGreaterThan({
|
|
349
|
+
check: "greater_than",
|
|
350
|
+
...normalizeParams(params),
|
|
351
|
+
value,
|
|
352
|
+
inclusive: true
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
// @__NO_SIDE_EFFECTS__
|
|
356
|
+
function _multipleOf(value, params) {
|
|
357
|
+
return new $ZodCheckMultipleOf({
|
|
358
|
+
check: "multiple_of",
|
|
359
|
+
...normalizeParams(params),
|
|
360
|
+
value
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
// @__NO_SIDE_EFFECTS__
|
|
364
|
+
function _maxLength(maximum, params) {
|
|
365
|
+
return new $ZodCheckMaxLength({
|
|
366
|
+
check: "max_length",
|
|
367
|
+
...normalizeParams(params),
|
|
368
|
+
maximum
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
// @__NO_SIDE_EFFECTS__
|
|
372
|
+
function _minLength(minimum, params) {
|
|
373
|
+
return new $ZodCheckMinLength({
|
|
374
|
+
check: "min_length",
|
|
375
|
+
...normalizeParams(params),
|
|
376
|
+
minimum
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
// @__NO_SIDE_EFFECTS__
|
|
380
|
+
function _length(length, params) {
|
|
381
|
+
return new $ZodCheckLengthEquals({
|
|
382
|
+
check: "length_equals",
|
|
383
|
+
...normalizeParams(params),
|
|
384
|
+
length
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
// @__NO_SIDE_EFFECTS__
|
|
388
|
+
function _regex(pattern, params) {
|
|
389
|
+
return new $ZodCheckRegex({
|
|
390
|
+
check: "string_format",
|
|
391
|
+
format: "regex",
|
|
392
|
+
...normalizeParams(params),
|
|
393
|
+
pattern
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
// @__NO_SIDE_EFFECTS__
|
|
397
|
+
function _lowercase(params) {
|
|
398
|
+
return new $ZodCheckLowerCase({
|
|
399
|
+
check: "string_format",
|
|
400
|
+
format: "lowercase",
|
|
401
|
+
...normalizeParams(params)
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
// @__NO_SIDE_EFFECTS__
|
|
405
|
+
function _uppercase(params) {
|
|
406
|
+
return new $ZodCheckUpperCase({
|
|
407
|
+
check: "string_format",
|
|
408
|
+
format: "uppercase",
|
|
409
|
+
...normalizeParams(params)
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
// @__NO_SIDE_EFFECTS__
|
|
413
|
+
function _includes(includes, params) {
|
|
414
|
+
return new $ZodCheckIncludes({
|
|
415
|
+
check: "string_format",
|
|
416
|
+
format: "includes",
|
|
417
|
+
...normalizeParams(params),
|
|
418
|
+
includes
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
// @__NO_SIDE_EFFECTS__
|
|
422
|
+
function _startsWith(prefix, params) {
|
|
423
|
+
return new $ZodCheckStartsWith({
|
|
424
|
+
check: "string_format",
|
|
425
|
+
format: "starts_with",
|
|
426
|
+
...normalizeParams(params),
|
|
427
|
+
prefix
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
// @__NO_SIDE_EFFECTS__
|
|
431
|
+
function _endsWith(suffix, params) {
|
|
432
|
+
return new $ZodCheckEndsWith({
|
|
433
|
+
check: "string_format",
|
|
434
|
+
format: "ends_with",
|
|
435
|
+
...normalizeParams(params),
|
|
436
|
+
suffix
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
// @__NO_SIDE_EFFECTS__
|
|
440
|
+
function _overwrite(tx) {
|
|
441
|
+
return new $ZodCheckOverwrite({
|
|
442
|
+
check: "overwrite",
|
|
443
|
+
tx
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
// @__NO_SIDE_EFFECTS__
|
|
447
|
+
function _normalize(form) {
|
|
448
|
+
return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
|
|
449
|
+
}
|
|
450
|
+
// @__NO_SIDE_EFFECTS__
|
|
451
|
+
function _trim() {
|
|
452
|
+
return /* @__PURE__ */ _overwrite((input) => input.trim());
|
|
453
|
+
}
|
|
454
|
+
// @__NO_SIDE_EFFECTS__
|
|
455
|
+
function _toLowerCase() {
|
|
456
|
+
return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
|
|
457
|
+
}
|
|
458
|
+
// @__NO_SIDE_EFFECTS__
|
|
459
|
+
function _toUpperCase() {
|
|
460
|
+
return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
|
|
461
|
+
}
|
|
462
|
+
// @__NO_SIDE_EFFECTS__
|
|
463
|
+
function _slugify() {
|
|
464
|
+
return /* @__PURE__ */ _overwrite((input) => slugify(input));
|
|
465
|
+
}
|
|
466
|
+
// @__NO_SIDE_EFFECTS__
|
|
467
|
+
function _array(Class, element, params) {
|
|
468
|
+
return new Class({
|
|
469
|
+
type: "array",
|
|
470
|
+
element,
|
|
471
|
+
...normalizeParams(params)
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
// @__NO_SIDE_EFFECTS__
|
|
475
|
+
function _refine(Class, fn, _params) {
|
|
476
|
+
return new Class({
|
|
477
|
+
type: "custom",
|
|
478
|
+
check: "custom",
|
|
479
|
+
fn,
|
|
480
|
+
...normalizeParams(_params)
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
// @__NO_SIDE_EFFECTS__
|
|
484
|
+
function _superRefine(fn, params) {
|
|
485
|
+
const ch = /* @__PURE__ */ _check((payload) => {
|
|
486
|
+
payload.addIssue = (issue$1) => {
|
|
487
|
+
if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, ch._zod.def));
|
|
488
|
+
else {
|
|
489
|
+
const _issue = issue$1;
|
|
490
|
+
if (_issue.fatal) _issue.continue = false;
|
|
491
|
+
_issue.code ?? (_issue.code = "custom");
|
|
492
|
+
if (!("input" in _issue)) _issue.input = payload.value;
|
|
493
|
+
_issue.inst ?? (_issue.inst = ch);
|
|
494
|
+
_issue.continue ?? (_issue.continue = !ch._zod.def.abort);
|
|
495
|
+
payload.issues.push(issue(_issue));
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
return fn(payload.value, payload);
|
|
499
|
+
}, params);
|
|
500
|
+
return ch;
|
|
501
|
+
}
|
|
502
|
+
// @__NO_SIDE_EFFECTS__
|
|
503
|
+
function _check(fn, params) {
|
|
504
|
+
const ch = new $ZodCheck({
|
|
505
|
+
check: "custom",
|
|
506
|
+
...normalizeParams(params)
|
|
507
|
+
});
|
|
508
|
+
ch._zod.check = fn;
|
|
509
|
+
return ch;
|
|
510
|
+
}
|
|
511
|
+
//#endregion
|
|
512
|
+
export { _array, _base64, _base64url, _boolean, _check, _cidrv4, _cidrv6, _cuid, _cuid2, _e164, _email, _emoji, _endsWith, _gt, _gte, _gte as _min, _guid, _includes, _int, _ipv4, _ipv6, _isoDate, _isoDateTime, _isoDuration, _isoTime, _jwt, _ksuid, _length, _lowercase, _lt, _lte, _lte as _max, _maxLength, _minLength, _multipleOf, _nanoid, _never, _normalize, _number, _overwrite, _refine, _regex, _slugify, _startsWith, _string, _superRefine, _toLowerCase, _toUpperCase, _trim, _ulid, _unknown, _uppercase, _url, _uuid, _uuidv4, _uuidv6, _uuidv7, _xid };
|