x402-proxy 0.10.7 → 0.10.9

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/README.md +7 -1
  3. package/dist/Credential-COZQnr1-.js +2055 -0
  4. package/dist/Mcp-CrCEqLqO.js +10 -0
  5. package/dist/Sse-ChldYgU7.js +9742 -0
  6. package/dist/Sse-kCB38G56.js +16482 -0
  7. package/dist/accounts-DsuvWwph.js +232 -0
  8. package/dist/accounts-DzvAlQRn.js +5 -0
  9. package/dist/accounts-IG-Cmrwy.js +229 -0
  10. package/dist/api-CUzmQvTQ.js +2802 -0
  11. package/dist/auth-DTzQmnZ_.js +1196 -0
  12. package/dist/bin/cli.js +585 -242
  13. package/dist/ccip-Bx-zoUCJ.js +240 -0
  14. package/dist/ccip-C2k1DD1T.js +153 -0
  15. package/dist/ccip-C6CQOJYv.js +152 -0
  16. package/dist/ccip-RZzsZ5Mv.js +156 -0
  17. package/dist/chain-CafcHffR.js +1997 -0
  18. package/dist/chain-DwfP5RGZ.js +1968 -0
  19. package/dist/chunk-DBEY4PJZ.js +16 -0
  20. package/dist/chunk-DjEMn6fM.js +36 -0
  21. package/dist/client-Blw2V7LF.js +657 -0
  22. package/dist/client-C37gWJOZ.js +102 -0
  23. package/dist/client-CEc4NYAA.js +6388 -0
  24. package/dist/client-CVDTUY0l.js +5152 -0
  25. package/dist/config-BUQsit4s.js +3 -0
  26. package/dist/config-DR1Fs_wL.js +6600 -0
  27. package/dist/{config-D9wIR3xc.js → config-rvKA3SYT.js} +10 -5
  28. package/dist/decodeFunctionData-DuFcwhC_.js +4510 -0
  29. package/dist/decodeFunctionData-JPOUdvil.js +4394 -0
  30. package/dist/derive-DNUl8LU9.js +9109 -0
  31. package/dist/dist-C2YO6HSQ.js +6581 -0
  32. package/dist/dist-DM5_F3r5.js +4 -0
  33. package/dist/dist-DxJCYyL5.js +1388 -0
  34. package/dist/hashTypedData-BHmP9dBd.js +859 -0
  35. package/dist/hashTypedData-CtEdfx4y.js +846 -0
  36. package/dist/helpers-CuUSw-tH.js +7125 -0
  37. package/dist/hmac-59IlS_by.js +648 -0
  38. package/dist/http-BAtucMbS.js +2060 -0
  39. package/dist/index.d.ts +1903 -9
  40. package/dist/index.js +18006 -50
  41. package/dist/index.node-CxkL0OFh.js +3592 -0
  42. package/dist/index.node-DvmeuZBj.js +3 -0
  43. package/dist/isAddressEqual-BLrd1Hg1.js +9 -0
  44. package/dist/isAddressEqual-DsAqfQOD.js +10 -0
  45. package/dist/localBatchGatewayRequest-C-RPJyDO.js +6260 -0
  46. package/dist/localBatchGatewayRequest-DOdQ9bR7.js +93 -0
  47. package/dist/localBatchGatewayRequest-DQkbZaSy.js +6261 -0
  48. package/dist/parseUnits-CApwcKSD.js +49 -0
  49. package/dist/parseUnits-cMO2udMe.js +48 -0
  50. package/dist/schemas-BxMFYNbH.js +1270 -0
  51. package/dist/secp256k1-BZpiyffY.js +2525 -0
  52. package/dist/secp256k1-BjenrLl5.js +1877 -0
  53. package/dist/secp256k1-CLPUX17u.js +3 -0
  54. package/dist/sendRawTransactionSync-DvSkhZtW.js +3612 -0
  55. package/dist/server-CSq0IuUq.js +565 -0
  56. package/dist/setup-BY4J49Lv.js +1110 -0
  57. package/dist/setup-wMOAgrsN.js +3 -0
  58. package/dist/sha256-FAs0qeni.js +17 -0
  59. package/dist/sha3-CYkWM8Xa.js +195 -0
  60. package/dist/sha3-DbMJRJ3C.js +194 -0
  61. package/dist/sse-B4LLqBQm.js +408 -0
  62. package/dist/status-Bu23RjW6.js +3 -0
  63. package/dist/{status-DihAcUSC.js → status-X21VnGUO.js} +16 -15
  64. package/dist/stdio-BADqxZdZ.js +85 -0
  65. package/dist/streamableHttp-BHkJypcI.js +358 -0
  66. package/dist/tempo-3nttrxgQ.js +17 -0
  67. package/dist/tempo-DER0P-ul.js +18 -0
  68. package/dist/types-BEKUz-Mf.js +1240 -0
  69. package/dist/types-DatK5vR5.js +3 -0
  70. package/dist/utils-BYjkXZDF.js +444 -0
  71. package/dist/utils-SeGHMW9O.js +445 -0
  72. package/dist/wallet-DKVlrR1S.js +3 -0
  73. package/dist/wallet-DSyht15_.js +17759 -0
  74. package/package.json +18 -71
  75. package/dist/config-B_upkJeK.js +0 -66
  76. package/dist/config-Be35NM5s.js +0 -3
  77. package/dist/config-J1m-CWXT.js +0 -27
  78. package/dist/derive-CL6e8K0Z.js +0 -81
  79. package/dist/openclaw/plugin.d.ts +0 -15
  80. package/dist/openclaw/plugin.js +0 -2067
  81. package/dist/openclaw.plugin.json +0 -93
  82. package/dist/setup-CNyMLnM-.js +0 -197
  83. package/dist/setup-DTIxPe58.js +0 -3
  84. package/dist/status-DZlJ4pS7.js +0 -3
  85. package/dist/wallet-B0S-rma9.js +0 -544
  86. package/dist/wallet-DBrVZJqe.js +0 -3
  87. package/openclaw.plugin.json +0 -93
  88. package/skills/SKILL.md +0 -183
  89. package/skills/references/library.md +0 -85
  90. package/skills/references/openclaw-plugin.md +0 -145
@@ -0,0 +1,1270 @@
1
+ #!/usr/bin/env node
2
+ import { $ as _uppercase, $t as $ZodStringFormat, A as _lowercase, An as getEnumValues, At as $ZodISODate, B as _number, Bn as safeExtend, Bt as $ZodNonOptional, C as _isoDate, Ct as $ZodEmail, D as _jwt, Dn as clone, Dt as $ZodGUID, E as _isoTime, En as formatError, Et as $ZodExactOptional, F as _multipleOf, Fn as normalizeParams, Ft as $ZodJWT, G as _startsWith, H as _refine, Hn as $ZodEncodeError, Ht as $ZodNullable, I as _nanoid, In as omit, It as $ZodKSUID, J as _toLowerCase, Jt as $ZodPipe, K as _string, Kt as $ZodObjectJIT, L as _never, Ln as partial, Lt as $ZodLiteral, M as _lte, Mn as jsonStringifyReplacer, Mt as $ZodISODuration, N as _maxLength, Nn as merge, Nt as $ZodISOTime, O as _ksuid, On as defineLazy, Ot as $ZodIPv4, P as _minLength, Pn as mergeDefs, Pt as $ZodIntersection, Q as _unknown, Qt as $ZodString, R as _normalize, Rn as pick, Rt as $ZodNanoID, S as _ipv6, St as $ZodE164, T as _isoDuration, Tn as flattenError, Tt as $ZodEnum, U as _regex, Un as $constructor, Ut as $ZodNumber, V as _overwrite, Vn as shallowClone, Vt as $ZodNull, W as _slugify, Wt as $ZodNumberFormat, X as _trim, Xt as $ZodReadonly, Y as _toUpperCase, Yt as $ZodPrefault, Z as _ulid, Zt as $ZodRecord, _ as _gte, _n as _safeEncodeAsync, _t as $ZodCUID2, a as _boolean, an as $ZodUnion, at as _xid, b as _int, bt as $ZodDefault, cn as _decode, ct as globalRegistry, d as _custom, dn as _encodeAsync, dt as $ZodBase64, en as $ZodTransform, et as _url, f as _e164, fn as _parse, ft as $ZodBase64URL, g as _gt, gn as _safeEncode, gt as $ZodCUID, h as _endsWith, hn as _safeDecodeAsync, ht as $ZodCIDRv6, i as _base64url, in as $ZodUUID, it as _uuidv7, j as _lt, jn as issue, jt as $ZodISODateTime, k as _length, kn as extend, kt as $ZodIPv6, l as _cuid, ln as _decodeAsync, lt as $ZodAny, m as _emoji, mn as _safeDecode, mt as $ZodCIDRv4, n as _array, nn as $ZodULID, nt as _uuidv4, o as _cidrv4, on as $ZodUnknown, p as _email, pn as _parseAsync, pt as $ZodBoolean, q as _superRefine, qt as $ZodOptional, r as _base64, rn as $ZodURL, rt as _uuidv6, s as _cidrv6, sn as $ZodXID, t as _any, tn as $ZodType, tt as _uuid, u as _cuid2, un as _encode, ut as $ZodArray, v as _guid, vn as _safeParse, vt as $ZodCatch, w as _isoDateTime, wn as $ZodError, wt as $ZodEmoji, x as _ipv4, xt as $ZodDiscriminatedUnion, y as _includes, yn as _safeParseAsync, yt as $ZodCustom, z as _null$1, zn as required, zt as $ZodNever } from "./api-CUzmQvTQ.js";
3
+ //#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js
4
+ function initializeContext(params) {
5
+ let target = params?.target ?? "draft-2020-12";
6
+ if (target === "draft-4") target = "draft-04";
7
+ if (target === "draft-7") target = "draft-07";
8
+ return {
9
+ processors: params.processors ?? {},
10
+ metadataRegistry: params?.metadata ?? globalRegistry,
11
+ target,
12
+ unrepresentable: params?.unrepresentable ?? "throw",
13
+ override: params?.override ?? (() => {}),
14
+ io: params?.io ?? "output",
15
+ counter: 0,
16
+ seen: /* @__PURE__ */ new Map(),
17
+ cycles: params?.cycles ?? "ref",
18
+ reused: params?.reused ?? "inline",
19
+ external: params?.external ?? void 0
20
+ };
21
+ }
22
+ function process(schema, ctx, _params = {
23
+ path: [],
24
+ schemaPath: []
25
+ }) {
26
+ var _a;
27
+ const def = schema._zod.def;
28
+ const seen = ctx.seen.get(schema);
29
+ if (seen) {
30
+ seen.count++;
31
+ if (_params.schemaPath.includes(schema)) seen.cycle = _params.path;
32
+ return seen.schema;
33
+ }
34
+ const result = {
35
+ schema: {},
36
+ count: 1,
37
+ cycle: void 0,
38
+ path: _params.path
39
+ };
40
+ ctx.seen.set(schema, result);
41
+ const overrideSchema = schema._zod.toJSONSchema?.();
42
+ if (overrideSchema) result.schema = overrideSchema;
43
+ else {
44
+ const params = {
45
+ ..._params,
46
+ schemaPath: [..._params.schemaPath, schema],
47
+ path: _params.path
48
+ };
49
+ if (schema._zod.processJSONSchema) schema._zod.processJSONSchema(ctx, result.schema, params);
50
+ else {
51
+ const _json = result.schema;
52
+ const processor = ctx.processors[def.type];
53
+ if (!processor) throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
54
+ processor(schema, ctx, _json, params);
55
+ }
56
+ const parent = schema._zod.parent;
57
+ if (parent) {
58
+ if (!result.ref) result.ref = parent;
59
+ process(parent, ctx, params);
60
+ ctx.seen.get(parent).isParent = true;
61
+ }
62
+ }
63
+ const meta = ctx.metadataRegistry.get(schema);
64
+ if (meta) Object.assign(result.schema, meta);
65
+ if (ctx.io === "input" && isTransforming(schema)) {
66
+ delete result.schema.examples;
67
+ delete result.schema.default;
68
+ }
69
+ if (ctx.io === "input" && result.schema._prefault) (_a = result.schema).default ?? (_a.default = result.schema._prefault);
70
+ delete result.schema._prefault;
71
+ return ctx.seen.get(schema).schema;
72
+ }
73
+ function extractDefs(ctx, schema) {
74
+ const root = ctx.seen.get(schema);
75
+ if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
76
+ const idToSchema = /* @__PURE__ */ new Map();
77
+ for (const entry of ctx.seen.entries()) {
78
+ const id = ctx.metadataRegistry.get(entry[0])?.id;
79
+ if (id) {
80
+ const existing = idToSchema.get(id);
81
+ if (existing && existing !== entry[0]) throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
82
+ idToSchema.set(id, entry[0]);
83
+ }
84
+ }
85
+ const makeURI = (entry) => {
86
+ const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
87
+ if (ctx.external) {
88
+ const externalId = ctx.external.registry.get(entry[0])?.id;
89
+ const uriGenerator = ctx.external.uri ?? ((id) => id);
90
+ if (externalId) return { ref: uriGenerator(externalId) };
91
+ const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
92
+ entry[1].defId = id;
93
+ return {
94
+ defId: id,
95
+ ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
96
+ };
97
+ }
98
+ if (entry[1] === root) return { ref: "#" };
99
+ const defUriPrefix = `#/${defsSegment}/`;
100
+ const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
101
+ return {
102
+ defId,
103
+ ref: defUriPrefix + defId
104
+ };
105
+ };
106
+ const extractToDef = (entry) => {
107
+ if (entry[1].schema.$ref) return;
108
+ const seen = entry[1];
109
+ const { ref, defId } = makeURI(entry);
110
+ seen.def = { ...seen.schema };
111
+ if (defId) seen.defId = defId;
112
+ const schema = seen.schema;
113
+ for (const key in schema) delete schema[key];
114
+ schema.$ref = ref;
115
+ };
116
+ if (ctx.cycles === "throw") for (const entry of ctx.seen.entries()) {
117
+ const seen = entry[1];
118
+ if (seen.cycle) throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
119
+
120
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
121
+ }
122
+ for (const entry of ctx.seen.entries()) {
123
+ const seen = entry[1];
124
+ if (schema === entry[0]) {
125
+ extractToDef(entry);
126
+ continue;
127
+ }
128
+ if (ctx.external) {
129
+ const ext = ctx.external.registry.get(entry[0])?.id;
130
+ if (schema !== entry[0] && ext) {
131
+ extractToDef(entry);
132
+ continue;
133
+ }
134
+ }
135
+ if (ctx.metadataRegistry.get(entry[0])?.id) {
136
+ extractToDef(entry);
137
+ continue;
138
+ }
139
+ if (seen.cycle) {
140
+ extractToDef(entry);
141
+ continue;
142
+ }
143
+ if (seen.count > 1) {
144
+ if (ctx.reused === "ref") {
145
+ extractToDef(entry);
146
+ continue;
147
+ }
148
+ }
149
+ }
150
+ }
151
+ function finalize(ctx, schema) {
152
+ const root = ctx.seen.get(schema);
153
+ if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
154
+ const flattenRef = (zodSchema) => {
155
+ const seen = ctx.seen.get(zodSchema);
156
+ if (seen.ref === null) return;
157
+ const schema = seen.def ?? seen.schema;
158
+ const _cached = { ...schema };
159
+ const ref = seen.ref;
160
+ seen.ref = null;
161
+ if (ref) {
162
+ flattenRef(ref);
163
+ const refSeen = ctx.seen.get(ref);
164
+ const refSchema = refSeen.schema;
165
+ if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
166
+ schema.allOf = schema.allOf ?? [];
167
+ schema.allOf.push(refSchema);
168
+ } else Object.assign(schema, refSchema);
169
+ Object.assign(schema, _cached);
170
+ if (zodSchema._zod.parent === ref) for (const key in schema) {
171
+ if (key === "$ref" || key === "allOf") continue;
172
+ if (!(key in _cached)) delete schema[key];
173
+ }
174
+ if (refSchema.$ref && refSeen.def) for (const key in schema) {
175
+ if (key === "$ref" || key === "allOf") continue;
176
+ if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) delete schema[key];
177
+ }
178
+ }
179
+ const parent = zodSchema._zod.parent;
180
+ if (parent && parent !== ref) {
181
+ flattenRef(parent);
182
+ const parentSeen = ctx.seen.get(parent);
183
+ if (parentSeen?.schema.$ref) {
184
+ schema.$ref = parentSeen.schema.$ref;
185
+ if (parentSeen.def) for (const key in schema) {
186
+ if (key === "$ref" || key === "allOf") continue;
187
+ if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) delete schema[key];
188
+ }
189
+ }
190
+ }
191
+ ctx.override({
192
+ zodSchema,
193
+ jsonSchema: schema,
194
+ path: seen.path ?? []
195
+ });
196
+ };
197
+ for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]);
198
+ const result = {};
199
+ if (ctx.target === "draft-2020-12") result.$schema = "https://json-schema.org/draft/2020-12/schema";
200
+ else if (ctx.target === "draft-07") result.$schema = "http://json-schema.org/draft-07/schema#";
201
+ else if (ctx.target === "draft-04") result.$schema = "http://json-schema.org/draft-04/schema#";
202
+ else if (ctx.target === "openapi-3.0") {}
203
+ if (ctx.external?.uri) {
204
+ const id = ctx.external.registry.get(schema)?.id;
205
+ if (!id) throw new Error("Schema is missing an `id` property");
206
+ result.$id = ctx.external.uri(id);
207
+ }
208
+ Object.assign(result, root.def ?? root.schema);
209
+ const defs = ctx.external?.defs ?? {};
210
+ for (const entry of ctx.seen.entries()) {
211
+ const seen = entry[1];
212
+ if (seen.def && seen.defId) defs[seen.defId] = seen.def;
213
+ }
214
+ if (ctx.external) {} else if (Object.keys(defs).length > 0) if (ctx.target === "draft-2020-12") result.$defs = defs;
215
+ else result.definitions = defs;
216
+ try {
217
+ const finalized = JSON.parse(JSON.stringify(result));
218
+ Object.defineProperty(finalized, "~standard", {
219
+ value: {
220
+ ...schema["~standard"],
221
+ jsonSchema: {
222
+ input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
223
+ output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
224
+ }
225
+ },
226
+ enumerable: false,
227
+ writable: false
228
+ });
229
+ return finalized;
230
+ } catch (_err) {
231
+ throw new Error("Error converting schema to JSON.");
232
+ }
233
+ }
234
+ function isTransforming(_schema, _ctx) {
235
+ const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
236
+ if (ctx.seen.has(_schema)) return false;
237
+ ctx.seen.add(_schema);
238
+ const def = _schema._zod.def;
239
+ if (def.type === "transform") return true;
240
+ if (def.type === "array") return isTransforming(def.element, ctx);
241
+ if (def.type === "set") return isTransforming(def.valueType, ctx);
242
+ if (def.type === "lazy") return isTransforming(def.getter(), ctx);
243
+ if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") return isTransforming(def.innerType, ctx);
244
+ if (def.type === "intersection") return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
245
+ if (def.type === "record" || def.type === "map") return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
246
+ if (def.type === "pipe") return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
247
+ if (def.type === "object") {
248
+ for (const key in def.shape) if (isTransforming(def.shape[key], ctx)) return true;
249
+ return false;
250
+ }
251
+ if (def.type === "union") {
252
+ for (const option of def.options) if (isTransforming(option, ctx)) return true;
253
+ return false;
254
+ }
255
+ if (def.type === "tuple") {
256
+ for (const item of def.items) if (isTransforming(item, ctx)) return true;
257
+ if (def.rest && isTransforming(def.rest, ctx)) return true;
258
+ return false;
259
+ }
260
+ return false;
261
+ }
262
+ /**
263
+ * Creates a toJSONSchema method for a schema instance.
264
+ * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.
265
+ */
266
+ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
267
+ const ctx = initializeContext({
268
+ ...params,
269
+ processors
270
+ });
271
+ process(schema, ctx);
272
+ extractDefs(ctx, schema);
273
+ return finalize(ctx, schema);
274
+ };
275
+ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
276
+ const { libraryOptions, target } = params ?? {};
277
+ const ctx = initializeContext({
278
+ ...libraryOptions ?? {},
279
+ target,
280
+ io,
281
+ processors
282
+ });
283
+ process(schema, ctx);
284
+ extractDefs(ctx, schema);
285
+ return finalize(ctx, schema);
286
+ };
287
+ //#endregion
288
+ //#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js
289
+ const formatMap = {
290
+ guid: "uuid",
291
+ url: "uri",
292
+ datetime: "date-time",
293
+ json_string: "json-string",
294
+ regex: ""
295
+ };
296
+ const stringProcessor = (schema, ctx, _json, _params) => {
297
+ const json = _json;
298
+ json.type = "string";
299
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
300
+ if (typeof minimum === "number") json.minLength = minimum;
301
+ if (typeof maximum === "number") json.maxLength = maximum;
302
+ if (format) {
303
+ json.format = formatMap[format] ?? format;
304
+ if (json.format === "") delete json.format;
305
+ if (format === "time") delete json.format;
306
+ }
307
+ if (contentEncoding) json.contentEncoding = contentEncoding;
308
+ if (patterns && patterns.size > 0) {
309
+ const regexes = [...patterns];
310
+ if (regexes.length === 1) json.pattern = regexes[0].source;
311
+ else if (regexes.length > 1) json.allOf = [...regexes.map((regex) => ({
312
+ ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
313
+ pattern: regex.source
314
+ }))];
315
+ }
316
+ };
317
+ const numberProcessor = (schema, ctx, _json, _params) => {
318
+ const json = _json;
319
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
320
+ if (typeof format === "string" && format.includes("int")) json.type = "integer";
321
+ else json.type = "number";
322
+ if (typeof exclusiveMinimum === "number") if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
323
+ json.minimum = exclusiveMinimum;
324
+ json.exclusiveMinimum = true;
325
+ } else json.exclusiveMinimum = exclusiveMinimum;
326
+ if (typeof minimum === "number") {
327
+ json.minimum = minimum;
328
+ if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") if (exclusiveMinimum >= minimum) delete json.minimum;
329
+ else delete json.exclusiveMinimum;
330
+ }
331
+ if (typeof exclusiveMaximum === "number") if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
332
+ json.maximum = exclusiveMaximum;
333
+ json.exclusiveMaximum = true;
334
+ } else json.exclusiveMaximum = exclusiveMaximum;
335
+ if (typeof maximum === "number") {
336
+ json.maximum = maximum;
337
+ if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") if (exclusiveMaximum <= maximum) delete json.maximum;
338
+ else delete json.exclusiveMaximum;
339
+ }
340
+ if (typeof multipleOf === "number") json.multipleOf = multipleOf;
341
+ };
342
+ const booleanProcessor = (_schema, _ctx, json, _params) => {
343
+ json.type = "boolean";
344
+ };
345
+ const nullProcessor = (_schema, ctx, json, _params) => {
346
+ if (ctx.target === "openapi-3.0") {
347
+ json.type = "string";
348
+ json.nullable = true;
349
+ json.enum = [null];
350
+ } else json.type = "null";
351
+ };
352
+ const neverProcessor = (_schema, _ctx, json, _params) => {
353
+ json.not = {};
354
+ };
355
+ const anyProcessor = (_schema, _ctx, _json, _params) => {};
356
+ const unknownProcessor = (_schema, _ctx, _json, _params) => {};
357
+ const enumProcessor = (schema, _ctx, json, _params) => {
358
+ const def = schema._zod.def;
359
+ const values = getEnumValues(def.entries);
360
+ if (values.every((v) => typeof v === "number")) json.type = "number";
361
+ if (values.every((v) => typeof v === "string")) json.type = "string";
362
+ json.enum = values;
363
+ };
364
+ const literalProcessor = (schema, ctx, json, _params) => {
365
+ const def = schema._zod.def;
366
+ const vals = [];
367
+ for (const val of def.values) if (val === void 0) {
368
+ if (ctx.unrepresentable === "throw") throw new Error("Literal `undefined` cannot be represented in JSON Schema");
369
+ } else if (typeof val === "bigint") if (ctx.unrepresentable === "throw") throw new Error("BigInt literals cannot be represented in JSON Schema");
370
+ else vals.push(Number(val));
371
+ else vals.push(val);
372
+ if (vals.length === 0) {} else if (vals.length === 1) {
373
+ const val = vals[0];
374
+ json.type = val === null ? "null" : typeof val;
375
+ if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") json.enum = [val];
376
+ else json.const = val;
377
+ } else {
378
+ if (vals.every((v) => typeof v === "number")) json.type = "number";
379
+ if (vals.every((v) => typeof v === "string")) json.type = "string";
380
+ if (vals.every((v) => typeof v === "boolean")) json.type = "boolean";
381
+ if (vals.every((v) => v === null)) json.type = "null";
382
+ json.enum = vals;
383
+ }
384
+ };
385
+ const customProcessor = (_schema, ctx, _json, _params) => {
386
+ if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
387
+ };
388
+ const transformProcessor = (_schema, ctx, _json, _params) => {
389
+ if (ctx.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema");
390
+ };
391
+ const arrayProcessor = (schema, ctx, _json, params) => {
392
+ const json = _json;
393
+ const def = schema._zod.def;
394
+ const { minimum, maximum } = schema._zod.bag;
395
+ if (typeof minimum === "number") json.minItems = minimum;
396
+ if (typeof maximum === "number") json.maxItems = maximum;
397
+ json.type = "array";
398
+ json.items = process(def.element, ctx, {
399
+ ...params,
400
+ path: [...params.path, "items"]
401
+ });
402
+ };
403
+ const objectProcessor = (schema, ctx, _json, params) => {
404
+ const json = _json;
405
+ const def = schema._zod.def;
406
+ json.type = "object";
407
+ json.properties = {};
408
+ const shape = def.shape;
409
+ for (const key in shape) json.properties[key] = process(shape[key], ctx, {
410
+ ...params,
411
+ path: [
412
+ ...params.path,
413
+ "properties",
414
+ key
415
+ ]
416
+ });
417
+ const allKeys = new Set(Object.keys(shape));
418
+ const requiredKeys = new Set([...allKeys].filter((key) => {
419
+ const v = def.shape[key]._zod;
420
+ if (ctx.io === "input") return v.optin === void 0;
421
+ else return v.optout === void 0;
422
+ }));
423
+ if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
424
+ if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
425
+ else if (!def.catchall) {
426
+ if (ctx.io === "output") json.additionalProperties = false;
427
+ } else if (def.catchall) json.additionalProperties = process(def.catchall, ctx, {
428
+ ...params,
429
+ path: [...params.path, "additionalProperties"]
430
+ });
431
+ };
432
+ const unionProcessor = (schema, ctx, json, params) => {
433
+ const def = schema._zod.def;
434
+ const isExclusive = def.inclusive === false;
435
+ const options = def.options.map((x, i) => process(x, ctx, {
436
+ ...params,
437
+ path: [
438
+ ...params.path,
439
+ isExclusive ? "oneOf" : "anyOf",
440
+ i
441
+ ]
442
+ }));
443
+ if (isExclusive) json.oneOf = options;
444
+ else json.anyOf = options;
445
+ };
446
+ const intersectionProcessor = (schema, ctx, json, params) => {
447
+ const def = schema._zod.def;
448
+ const a = process(def.left, ctx, {
449
+ ...params,
450
+ path: [
451
+ ...params.path,
452
+ "allOf",
453
+ 0
454
+ ]
455
+ });
456
+ const b = process(def.right, ctx, {
457
+ ...params,
458
+ path: [
459
+ ...params.path,
460
+ "allOf",
461
+ 1
462
+ ]
463
+ });
464
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
465
+ json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
466
+ };
467
+ const recordProcessor = (schema, ctx, _json, params) => {
468
+ const json = _json;
469
+ const def = schema._zod.def;
470
+ json.type = "object";
471
+ const keyType = def.keyType;
472
+ const patterns = keyType._zod.bag?.patterns;
473
+ if (def.mode === "loose" && patterns && patterns.size > 0) {
474
+ const valueSchema = process(def.valueType, ctx, {
475
+ ...params,
476
+ path: [
477
+ ...params.path,
478
+ "patternProperties",
479
+ "*"
480
+ ]
481
+ });
482
+ json.patternProperties = {};
483
+ for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
484
+ } else {
485
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process(def.keyType, ctx, {
486
+ ...params,
487
+ path: [...params.path, "propertyNames"]
488
+ });
489
+ json.additionalProperties = process(def.valueType, ctx, {
490
+ ...params,
491
+ path: [...params.path, "additionalProperties"]
492
+ });
493
+ }
494
+ const keyValues = keyType._zod.values;
495
+ if (keyValues) {
496
+ const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
497
+ if (validKeyValues.length > 0) json.required = validKeyValues;
498
+ }
499
+ };
500
+ const nullableProcessor = (schema, ctx, json, params) => {
501
+ const def = schema._zod.def;
502
+ const inner = process(def.innerType, ctx, params);
503
+ const seen = ctx.seen.get(schema);
504
+ if (ctx.target === "openapi-3.0") {
505
+ seen.ref = def.innerType;
506
+ json.nullable = true;
507
+ } else json.anyOf = [inner, { type: "null" }];
508
+ };
509
+ const nonoptionalProcessor = (schema, ctx, _json, params) => {
510
+ const def = schema._zod.def;
511
+ process(def.innerType, ctx, params);
512
+ const seen = ctx.seen.get(schema);
513
+ seen.ref = def.innerType;
514
+ };
515
+ const defaultProcessor = (schema, ctx, json, params) => {
516
+ const def = schema._zod.def;
517
+ process(def.innerType, ctx, params);
518
+ const seen = ctx.seen.get(schema);
519
+ seen.ref = def.innerType;
520
+ json.default = JSON.parse(JSON.stringify(def.defaultValue));
521
+ };
522
+ const prefaultProcessor = (schema, ctx, json, params) => {
523
+ const def = schema._zod.def;
524
+ process(def.innerType, ctx, params);
525
+ const seen = ctx.seen.get(schema);
526
+ seen.ref = def.innerType;
527
+ if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
528
+ };
529
+ const catchProcessor = (schema, ctx, json, params) => {
530
+ const def = schema._zod.def;
531
+ process(def.innerType, ctx, params);
532
+ const seen = ctx.seen.get(schema);
533
+ seen.ref = def.innerType;
534
+ let catchValue;
535
+ try {
536
+ catchValue = def.catchValue(void 0);
537
+ } catch {
538
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
539
+ }
540
+ json.default = catchValue;
541
+ };
542
+ const pipeProcessor = (schema, ctx, _json, params) => {
543
+ const def = schema._zod.def;
544
+ const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
545
+ process(innerType, ctx, params);
546
+ const seen = ctx.seen.get(schema);
547
+ seen.ref = innerType;
548
+ };
549
+ const readonlyProcessor = (schema, ctx, json, params) => {
550
+ const def = schema._zod.def;
551
+ process(def.innerType, ctx, params);
552
+ const seen = ctx.seen.get(schema);
553
+ seen.ref = def.innerType;
554
+ json.readOnly = true;
555
+ };
556
+ const optionalProcessor = (schema, ctx, _json, params) => {
557
+ const def = schema._zod.def;
558
+ process(def.innerType, ctx, params);
559
+ const seen = ctx.seen.get(schema);
560
+ seen.ref = def.innerType;
561
+ };
562
+ //#endregion
563
+ //#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js
564
+ const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
565
+ $ZodISODateTime.init(inst, def);
566
+ ZodStringFormat.init(inst, def);
567
+ });
568
+ function datetime(params) {
569
+ return _isoDateTime(ZodISODateTime, params);
570
+ }
571
+ const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
572
+ $ZodISODate.init(inst, def);
573
+ ZodStringFormat.init(inst, def);
574
+ });
575
+ function date(params) {
576
+ return _isoDate(ZodISODate, params);
577
+ }
578
+ const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
579
+ $ZodISOTime.init(inst, def);
580
+ ZodStringFormat.init(inst, def);
581
+ });
582
+ function time(params) {
583
+ return _isoTime(ZodISOTime, params);
584
+ }
585
+ const ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
586
+ $ZodISODuration.init(inst, def);
587
+ ZodStringFormat.init(inst, def);
588
+ });
589
+ function duration(params) {
590
+ return _isoDuration(ZodISODuration, params);
591
+ }
592
+ //#endregion
593
+ //#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js
594
+ const initializer = (inst, issues) => {
595
+ $ZodError.init(inst, issues);
596
+ inst.name = "ZodError";
597
+ Object.defineProperties(inst, {
598
+ format: { value: (mapper) => formatError(inst, mapper) },
599
+ flatten: { value: (mapper) => flattenError(inst, mapper) },
600
+ addIssue: { value: (issue) => {
601
+ inst.issues.push(issue);
602
+ inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
603
+ } },
604
+ addIssues: { value: (issues) => {
605
+ inst.issues.push(...issues);
606
+ inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
607
+ } },
608
+ isEmpty: { get() {
609
+ return inst.issues.length === 0;
610
+ } }
611
+ });
612
+ };
613
+ $constructor("ZodError", initializer);
614
+ const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
615
+ //#endregion
616
+ //#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.js
617
+ const parse = /* @__PURE__ */ _parse(ZodRealError);
618
+ const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
619
+ const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
620
+ const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
621
+ const encode = /* @__PURE__ */ _encode(ZodRealError);
622
+ const decode = /* @__PURE__ */ _decode(ZodRealError);
623
+ const encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
624
+ const decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError);
625
+ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
626
+ const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
627
+ const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
628
+ const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
629
+ //#endregion
630
+ //#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
631
+ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
632
+ $ZodType.init(inst, def);
633
+ Object.assign(inst["~standard"], { jsonSchema: {
634
+ input: createStandardJSONSchemaMethod(inst, "input"),
635
+ output: createStandardJSONSchemaMethod(inst, "output")
636
+ } });
637
+ inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
638
+ inst.def = def;
639
+ inst.type = def.type;
640
+ Object.defineProperty(inst, "_def", { value: def });
641
+ inst.check = (...checks) => {
642
+ return inst.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
643
+ check: ch,
644
+ def: { check: "custom" },
645
+ onattach: []
646
+ } } : ch)] }), { parent: true });
647
+ };
648
+ inst.with = inst.check;
649
+ inst.clone = (def, params) => clone(inst, def, params);
650
+ inst.brand = () => inst;
651
+ inst.register = ((reg, meta) => {
652
+ reg.add(inst, meta);
653
+ return inst;
654
+ });
655
+ inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
656
+ inst.safeParse = (data, params) => safeParse(inst, data, params);
657
+ inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
658
+ inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
659
+ inst.spa = inst.safeParseAsync;
660
+ inst.encode = (data, params) => encode(inst, data, params);
661
+ inst.decode = (data, params) => decode(inst, data, params);
662
+ inst.encodeAsync = async (data, params) => encodeAsync(inst, data, params);
663
+ inst.decodeAsync = async (data, params) => decodeAsync(inst, data, params);
664
+ inst.safeEncode = (data, params) => safeEncode(inst, data, params);
665
+ inst.safeDecode = (data, params) => safeDecode(inst, data, params);
666
+ inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params);
667
+ inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
668
+ inst.refine = (check, params) => inst.check(refine(check, params));
669
+ inst.superRefine = (refinement) => inst.check(superRefine(refinement));
670
+ inst.overwrite = (fn) => inst.check(_overwrite(fn));
671
+ inst.optional = () => optional(inst);
672
+ inst.exactOptional = () => exactOptional(inst);
673
+ inst.nullable = () => nullable(inst);
674
+ inst.nullish = () => optional(nullable(inst));
675
+ inst.nonoptional = (params) => nonoptional(inst, params);
676
+ inst.array = () => array(inst);
677
+ inst.or = (arg) => union([inst, arg]);
678
+ inst.and = (arg) => intersection(inst, arg);
679
+ inst.transform = (tx) => pipe(inst, transform(tx));
680
+ inst.default = (def) => _default(inst, def);
681
+ inst.prefault = (def) => prefault(inst, def);
682
+ inst.catch = (params) => _catch(inst, params);
683
+ inst.pipe = (target) => pipe(inst, target);
684
+ inst.readonly = () => readonly(inst);
685
+ inst.describe = (description) => {
686
+ const cl = inst.clone();
687
+ globalRegistry.add(cl, { description });
688
+ return cl;
689
+ };
690
+ Object.defineProperty(inst, "description", {
691
+ get() {
692
+ return globalRegistry.get(inst)?.description;
693
+ },
694
+ configurable: true
695
+ });
696
+ inst.meta = (...args) => {
697
+ if (args.length === 0) return globalRegistry.get(inst);
698
+ const cl = inst.clone();
699
+ globalRegistry.add(cl, args[0]);
700
+ return cl;
701
+ };
702
+ inst.isOptional = () => inst.safeParse(void 0).success;
703
+ inst.isNullable = () => inst.safeParse(null).success;
704
+ inst.apply = (fn) => fn(inst);
705
+ return inst;
706
+ });
707
+ /** @internal */
708
+ const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
709
+ $ZodString.init(inst, def);
710
+ ZodType.init(inst, def);
711
+ inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
712
+ const bag = inst._zod.bag;
713
+ inst.format = bag.format ?? null;
714
+ inst.minLength = bag.minimum ?? null;
715
+ inst.maxLength = bag.maximum ?? null;
716
+ inst.regex = (...args) => inst.check(_regex(...args));
717
+ inst.includes = (...args) => inst.check(_includes(...args));
718
+ inst.startsWith = (...args) => inst.check(_startsWith(...args));
719
+ inst.endsWith = (...args) => inst.check(_endsWith(...args));
720
+ inst.min = (...args) => inst.check(_minLength(...args));
721
+ inst.max = (...args) => inst.check(_maxLength(...args));
722
+ inst.length = (...args) => inst.check(_length(...args));
723
+ inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
724
+ inst.lowercase = (params) => inst.check(_lowercase(params));
725
+ inst.uppercase = (params) => inst.check(_uppercase(params));
726
+ inst.trim = () => inst.check(_trim());
727
+ inst.normalize = (...args) => inst.check(_normalize(...args));
728
+ inst.toLowerCase = () => inst.check(_toLowerCase());
729
+ inst.toUpperCase = () => inst.check(_toUpperCase());
730
+ inst.slugify = () => inst.check(_slugify());
731
+ });
732
+ const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
733
+ $ZodString.init(inst, def);
734
+ _ZodString.init(inst, def);
735
+ inst.email = (params) => inst.check(_email(ZodEmail, params));
736
+ inst.url = (params) => inst.check(_url(ZodURL, params));
737
+ inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
738
+ inst.emoji = (params) => inst.check(_emoji(ZodEmoji, params));
739
+ inst.guid = (params) => inst.check(_guid(ZodGUID, params));
740
+ inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
741
+ inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
742
+ inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
743
+ inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
744
+ inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
745
+ inst.guid = (params) => inst.check(_guid(ZodGUID, params));
746
+ inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
747
+ inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
748
+ inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
749
+ inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
750
+ inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
751
+ inst.xid = (params) => inst.check(_xid(ZodXID, params));
752
+ inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
753
+ inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
754
+ inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
755
+ inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
756
+ inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
757
+ inst.e164 = (params) => inst.check(_e164(ZodE164, params));
758
+ inst.datetime = (params) => inst.check(datetime(params));
759
+ inst.date = (params) => inst.check(date(params));
760
+ inst.time = (params) => inst.check(time(params));
761
+ inst.duration = (params) => inst.check(duration(params));
762
+ });
763
+ function string(params) {
764
+ return _string(ZodString, params);
765
+ }
766
+ const ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
767
+ $ZodStringFormat.init(inst, def);
768
+ _ZodString.init(inst, def);
769
+ });
770
+ const ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
771
+ $ZodEmail.init(inst, def);
772
+ ZodStringFormat.init(inst, def);
773
+ });
774
+ const ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
775
+ $ZodGUID.init(inst, def);
776
+ ZodStringFormat.init(inst, def);
777
+ });
778
+ const ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
779
+ $ZodUUID.init(inst, def);
780
+ ZodStringFormat.init(inst, def);
781
+ });
782
+ const ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
783
+ $ZodURL.init(inst, def);
784
+ ZodStringFormat.init(inst, def);
785
+ });
786
+ function url(params) {
787
+ return _url(ZodURL, params);
788
+ }
789
+ const ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
790
+ $ZodEmoji.init(inst, def);
791
+ ZodStringFormat.init(inst, def);
792
+ });
793
+ const ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
794
+ $ZodNanoID.init(inst, def);
795
+ ZodStringFormat.init(inst, def);
796
+ });
797
+ const ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
798
+ $ZodCUID.init(inst, def);
799
+ ZodStringFormat.init(inst, def);
800
+ });
801
+ const ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
802
+ $ZodCUID2.init(inst, def);
803
+ ZodStringFormat.init(inst, def);
804
+ });
805
+ const ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
806
+ $ZodULID.init(inst, def);
807
+ ZodStringFormat.init(inst, def);
808
+ });
809
+ const ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
810
+ $ZodXID.init(inst, def);
811
+ ZodStringFormat.init(inst, def);
812
+ });
813
+ const ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
814
+ $ZodKSUID.init(inst, def);
815
+ ZodStringFormat.init(inst, def);
816
+ });
817
+ const ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
818
+ $ZodIPv4.init(inst, def);
819
+ ZodStringFormat.init(inst, def);
820
+ });
821
+ const ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
822
+ $ZodIPv6.init(inst, def);
823
+ ZodStringFormat.init(inst, def);
824
+ });
825
+ const ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
826
+ $ZodCIDRv4.init(inst, def);
827
+ ZodStringFormat.init(inst, def);
828
+ });
829
+ const ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
830
+ $ZodCIDRv6.init(inst, def);
831
+ ZodStringFormat.init(inst, def);
832
+ });
833
+ const ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
834
+ $ZodBase64.init(inst, def);
835
+ ZodStringFormat.init(inst, def);
836
+ });
837
+ const ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
838
+ $ZodBase64URL.init(inst, def);
839
+ ZodStringFormat.init(inst, def);
840
+ });
841
+ const ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
842
+ $ZodE164.init(inst, def);
843
+ ZodStringFormat.init(inst, def);
844
+ });
845
+ const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
846
+ $ZodJWT.init(inst, def);
847
+ ZodStringFormat.init(inst, def);
848
+ });
849
+ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
850
+ $ZodNumber.init(inst, def);
851
+ ZodType.init(inst, def);
852
+ inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
853
+ inst.gt = (value, params) => inst.check(_gt(value, params));
854
+ inst.gte = (value, params) => inst.check(_gte(value, params));
855
+ inst.min = (value, params) => inst.check(_gte(value, params));
856
+ inst.lt = (value, params) => inst.check(_lt(value, params));
857
+ inst.lte = (value, params) => inst.check(_lte(value, params));
858
+ inst.max = (value, params) => inst.check(_lte(value, params));
859
+ inst.int = (params) => inst.check(int(params));
860
+ inst.safe = (params) => inst.check(int(params));
861
+ inst.positive = (params) => inst.check(_gt(0, params));
862
+ inst.nonnegative = (params) => inst.check(_gte(0, params));
863
+ inst.negative = (params) => inst.check(_lt(0, params));
864
+ inst.nonpositive = (params) => inst.check(_lte(0, params));
865
+ inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
866
+ inst.step = (value, params) => inst.check(_multipleOf(value, params));
867
+ inst.finite = () => inst;
868
+ const bag = inst._zod.bag;
869
+ inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
870
+ inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
871
+ inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
872
+ inst.isFinite = true;
873
+ inst.format = bag.format ?? null;
874
+ });
875
+ function number(params) {
876
+ return _number(ZodNumber, params);
877
+ }
878
+ const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
879
+ $ZodNumberFormat.init(inst, def);
880
+ ZodNumber.init(inst, def);
881
+ });
882
+ function int(params) {
883
+ return _int(ZodNumberFormat, params);
884
+ }
885
+ const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
886
+ $ZodBoolean.init(inst, def);
887
+ ZodType.init(inst, def);
888
+ inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
889
+ });
890
+ function boolean(params) {
891
+ return _boolean(ZodBoolean, params);
892
+ }
893
+ const ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
894
+ $ZodNull.init(inst, def);
895
+ ZodType.init(inst, def);
896
+ inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
897
+ });
898
+ function _null(params) {
899
+ return _null$1(ZodNull, params);
900
+ }
901
+ const ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
902
+ $ZodAny.init(inst, def);
903
+ ZodType.init(inst, def);
904
+ inst._zod.processJSONSchema = (ctx, json, params) => anyProcessor(inst, ctx, json, params);
905
+ });
906
+ function any() {
907
+ return _any(ZodAny);
908
+ }
909
+ const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
910
+ $ZodUnknown.init(inst, def);
911
+ ZodType.init(inst, def);
912
+ inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
913
+ });
914
+ function unknown() {
915
+ return _unknown(ZodUnknown);
916
+ }
917
+ const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
918
+ $ZodNever.init(inst, def);
919
+ ZodType.init(inst, def);
920
+ inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
921
+ });
922
+ function never(params) {
923
+ return _never(ZodNever, params);
924
+ }
925
+ const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
926
+ $ZodArray.init(inst, def);
927
+ ZodType.init(inst, def);
928
+ inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
929
+ inst.element = def.element;
930
+ inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
931
+ inst.nonempty = (params) => inst.check(_minLength(1, params));
932
+ inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
933
+ inst.length = (len, params) => inst.check(_length(len, params));
934
+ inst.unwrap = () => inst.element;
935
+ });
936
+ function array(element, params) {
937
+ return _array(ZodArray, element, params);
938
+ }
939
+ const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
940
+ $ZodObjectJIT.init(inst, def);
941
+ ZodType.init(inst, def);
942
+ inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
943
+ defineLazy(inst, "shape", () => {
944
+ return def.shape;
945
+ });
946
+ inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
947
+ inst.catchall = (catchall) => inst.clone({
948
+ ...inst._zod.def,
949
+ catchall
950
+ });
951
+ inst.passthrough = () => inst.clone({
952
+ ...inst._zod.def,
953
+ catchall: unknown()
954
+ });
955
+ inst.loose = () => inst.clone({
956
+ ...inst._zod.def,
957
+ catchall: unknown()
958
+ });
959
+ inst.strict = () => inst.clone({
960
+ ...inst._zod.def,
961
+ catchall: never()
962
+ });
963
+ inst.strip = () => inst.clone({
964
+ ...inst._zod.def,
965
+ catchall: void 0
966
+ });
967
+ inst.extend = (incoming) => {
968
+ return extend(inst, incoming);
969
+ };
970
+ inst.safeExtend = (incoming) => {
971
+ return safeExtend(inst, incoming);
972
+ };
973
+ inst.merge = (other) => merge(inst, other);
974
+ inst.pick = (mask) => pick(inst, mask);
975
+ inst.omit = (mask) => omit(inst, mask);
976
+ inst.partial = (...args) => partial(ZodOptional, inst, args[0]);
977
+ inst.required = (...args) => required(ZodNonOptional, inst, args[0]);
978
+ });
979
+ function object(shape, params) {
980
+ return new ZodObject({
981
+ type: "object",
982
+ shape: shape ?? {},
983
+ ...normalizeParams(params)
984
+ });
985
+ }
986
+ function looseObject(shape, params) {
987
+ return new ZodObject({
988
+ type: "object",
989
+ shape,
990
+ catchall: unknown(),
991
+ ...normalizeParams(params)
992
+ });
993
+ }
994
+ const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
995
+ $ZodUnion.init(inst, def);
996
+ ZodType.init(inst, def);
997
+ inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
998
+ inst.options = def.options;
999
+ });
1000
+ function union(options, params) {
1001
+ return new ZodUnion({
1002
+ type: "union",
1003
+ options,
1004
+ ...normalizeParams(params)
1005
+ });
1006
+ }
1007
+ const ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => {
1008
+ ZodUnion.init(inst, def);
1009
+ $ZodDiscriminatedUnion.init(inst, def);
1010
+ });
1011
+ function discriminatedUnion(discriminator, options, params) {
1012
+ return new ZodDiscriminatedUnion({
1013
+ type: "union",
1014
+ options,
1015
+ discriminator,
1016
+ ...normalizeParams(params)
1017
+ });
1018
+ }
1019
+ const ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
1020
+ $ZodIntersection.init(inst, def);
1021
+ ZodType.init(inst, def);
1022
+ inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
1023
+ });
1024
+ function intersection(left, right) {
1025
+ return new ZodIntersection({
1026
+ type: "intersection",
1027
+ left,
1028
+ right
1029
+ });
1030
+ }
1031
+ const ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
1032
+ $ZodRecord.init(inst, def);
1033
+ ZodType.init(inst, def);
1034
+ inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
1035
+ inst.keyType = def.keyType;
1036
+ inst.valueType = def.valueType;
1037
+ });
1038
+ function record(keyType, valueType, params) {
1039
+ return new ZodRecord({
1040
+ type: "record",
1041
+ keyType,
1042
+ valueType,
1043
+ ...normalizeParams(params)
1044
+ });
1045
+ }
1046
+ const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
1047
+ $ZodEnum.init(inst, def);
1048
+ ZodType.init(inst, def);
1049
+ inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
1050
+ inst.enum = def.entries;
1051
+ inst.options = Object.values(def.entries);
1052
+ const keys = new Set(Object.keys(def.entries));
1053
+ inst.extract = (values, params) => {
1054
+ const newEntries = {};
1055
+ for (const value of values) if (keys.has(value)) newEntries[value] = def.entries[value];
1056
+ else throw new Error(`Key ${value} not found in enum`);
1057
+ return new ZodEnum({
1058
+ ...def,
1059
+ checks: [],
1060
+ ...normalizeParams(params),
1061
+ entries: newEntries
1062
+ });
1063
+ };
1064
+ inst.exclude = (values, params) => {
1065
+ const newEntries = { ...def.entries };
1066
+ for (const value of values) if (keys.has(value)) delete newEntries[value];
1067
+ else throw new Error(`Key ${value} not found in enum`);
1068
+ return new ZodEnum({
1069
+ ...def,
1070
+ checks: [],
1071
+ ...normalizeParams(params),
1072
+ entries: newEntries
1073
+ });
1074
+ };
1075
+ });
1076
+ function _enum(values, params) {
1077
+ return new ZodEnum({
1078
+ type: "enum",
1079
+ entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values,
1080
+ ...normalizeParams(params)
1081
+ });
1082
+ }
1083
+ const ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
1084
+ $ZodLiteral.init(inst, def);
1085
+ ZodType.init(inst, def);
1086
+ inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
1087
+ inst.values = new Set(def.values);
1088
+ Object.defineProperty(inst, "value", { get() {
1089
+ if (def.values.length > 1) throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
1090
+ return def.values[0];
1091
+ } });
1092
+ });
1093
+ function literal(value, params) {
1094
+ return new ZodLiteral({
1095
+ type: "literal",
1096
+ values: Array.isArray(value) ? value : [value],
1097
+ ...normalizeParams(params)
1098
+ });
1099
+ }
1100
+ const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
1101
+ $ZodTransform.init(inst, def);
1102
+ ZodType.init(inst, def);
1103
+ inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
1104
+ inst._zod.parse = (payload, _ctx) => {
1105
+ if (_ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
1106
+ payload.addIssue = (issue$1) => {
1107
+ if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, def));
1108
+ else {
1109
+ const _issue = issue$1;
1110
+ if (_issue.fatal) _issue.continue = false;
1111
+ _issue.code ?? (_issue.code = "custom");
1112
+ _issue.input ?? (_issue.input = payload.value);
1113
+ _issue.inst ?? (_issue.inst = inst);
1114
+ payload.issues.push(issue(_issue));
1115
+ }
1116
+ };
1117
+ const output = def.transform(payload.value, payload);
1118
+ if (output instanceof Promise) return output.then((output) => {
1119
+ payload.value = output;
1120
+ return payload;
1121
+ });
1122
+ payload.value = output;
1123
+ return payload;
1124
+ };
1125
+ });
1126
+ function transform(fn) {
1127
+ return new ZodTransform({
1128
+ type: "transform",
1129
+ transform: fn
1130
+ });
1131
+ }
1132
+ const ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
1133
+ $ZodOptional.init(inst, def);
1134
+ ZodType.init(inst, def);
1135
+ inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
1136
+ inst.unwrap = () => inst._zod.def.innerType;
1137
+ });
1138
+ function optional(innerType) {
1139
+ return new ZodOptional({
1140
+ type: "optional",
1141
+ innerType
1142
+ });
1143
+ }
1144
+ const ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
1145
+ $ZodExactOptional.init(inst, def);
1146
+ ZodType.init(inst, def);
1147
+ inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
1148
+ inst.unwrap = () => inst._zod.def.innerType;
1149
+ });
1150
+ function exactOptional(innerType) {
1151
+ return new ZodExactOptional({
1152
+ type: "optional",
1153
+ innerType
1154
+ });
1155
+ }
1156
+ const ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
1157
+ $ZodNullable.init(inst, def);
1158
+ ZodType.init(inst, def);
1159
+ inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
1160
+ inst.unwrap = () => inst._zod.def.innerType;
1161
+ });
1162
+ function nullable(innerType) {
1163
+ return new ZodNullable({
1164
+ type: "nullable",
1165
+ innerType
1166
+ });
1167
+ }
1168
+ const ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
1169
+ $ZodDefault.init(inst, def);
1170
+ ZodType.init(inst, def);
1171
+ inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
1172
+ inst.unwrap = () => inst._zod.def.innerType;
1173
+ inst.removeDefault = inst.unwrap;
1174
+ });
1175
+ function _default(innerType, defaultValue) {
1176
+ return new ZodDefault({
1177
+ type: "default",
1178
+ innerType,
1179
+ get defaultValue() {
1180
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
1181
+ }
1182
+ });
1183
+ }
1184
+ const ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
1185
+ $ZodPrefault.init(inst, def);
1186
+ ZodType.init(inst, def);
1187
+ inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
1188
+ inst.unwrap = () => inst._zod.def.innerType;
1189
+ });
1190
+ function prefault(innerType, defaultValue) {
1191
+ return new ZodPrefault({
1192
+ type: "prefault",
1193
+ innerType,
1194
+ get defaultValue() {
1195
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
1196
+ }
1197
+ });
1198
+ }
1199
+ const ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
1200
+ $ZodNonOptional.init(inst, def);
1201
+ ZodType.init(inst, def);
1202
+ inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
1203
+ inst.unwrap = () => inst._zod.def.innerType;
1204
+ });
1205
+ function nonoptional(innerType, params) {
1206
+ return new ZodNonOptional({
1207
+ type: "nonoptional",
1208
+ innerType,
1209
+ ...normalizeParams(params)
1210
+ });
1211
+ }
1212
+ const ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
1213
+ $ZodCatch.init(inst, def);
1214
+ ZodType.init(inst, def);
1215
+ inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
1216
+ inst.unwrap = () => inst._zod.def.innerType;
1217
+ inst.removeCatch = inst.unwrap;
1218
+ });
1219
+ function _catch(innerType, catchValue) {
1220
+ return new ZodCatch({
1221
+ type: "catch",
1222
+ innerType,
1223
+ catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
1224
+ });
1225
+ }
1226
+ const ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
1227
+ $ZodPipe.init(inst, def);
1228
+ ZodType.init(inst, def);
1229
+ inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
1230
+ inst.in = def.in;
1231
+ inst.out = def.out;
1232
+ });
1233
+ function pipe(in_, out) {
1234
+ return new ZodPipe({
1235
+ type: "pipe",
1236
+ in: in_,
1237
+ out
1238
+ });
1239
+ }
1240
+ const ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
1241
+ $ZodReadonly.init(inst, def);
1242
+ ZodType.init(inst, def);
1243
+ inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
1244
+ inst.unwrap = () => inst._zod.def.innerType;
1245
+ });
1246
+ function readonly(innerType) {
1247
+ return new ZodReadonly({
1248
+ type: "readonly",
1249
+ innerType
1250
+ });
1251
+ }
1252
+ const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
1253
+ $ZodCustom.init(inst, def);
1254
+ ZodType.init(inst, def);
1255
+ inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
1256
+ });
1257
+ function custom(fn, _params) {
1258
+ return _custom(ZodCustom, fn ?? (() => true), _params);
1259
+ }
1260
+ function refine(fn, _params = {}) {
1261
+ return _refine(ZodCustom, fn, _params);
1262
+ }
1263
+ function superRefine(fn) {
1264
+ return _superRefine(fn);
1265
+ }
1266
+ function preprocess(fn, schema) {
1267
+ return pipe(transform(fn), schema);
1268
+ }
1269
+ //#endregion
1270
+ export { string as _, array as a, url as b, discriminatedUnion as c, looseObject as d, number as f, record as g, preprocess as h, any as i, intersection as l, optional as m, _enum as n, boolean as o, object as p, _null as r, custom as s, ZodNumber as t, literal as u, union as v, datetime as x, unknown as y };