@qredence/fleet 0.5.0 → 0.5.5
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/CHANGELOG.md +21 -0
- package/README.md +8 -1
- package/bin/fleet-prime.mjs +6 -0
- package/dist/web/client/assets/action-swap-roll-DX5o_33Q.js +1 -0
- package/dist/web/client/assets/artifacts-panel-C3yewUBP.js +1 -0
- package/dist/web/client/assets/artifacts-utils-N_kUFbz2.js +1 -0
- package/dist/web/client/assets/bot-Bs7QWJ2q.js +1 -0
- package/dist/web/client/assets/{chat-C64Sv6V-.js → chat-W-yOMyG_.js} +5 -5
- package/dist/web/client/assets/chat-command-palette-D0xDK1j4.js +1 -0
- package/dist/web/client/assets/command-CQzrtjyj.js +2 -0
- package/dist/web/client/assets/ease-vFBiNFNK.js +9 -0
- package/dist/web/client/assets/{fleet-pi-tool-renderer-ZKiX6Ob_.js → fleet-pi-tool-renderer-B0Y7ou0U.js} +28 -30
- package/dist/web/client/assets/generative-text-renderer-SS9c1kNX.js +6 -0
- package/dist/web/client/assets/globals-D_Hy9bT1.css +2 -0
- package/dist/web/client/assets/horizontal-resize-C1TpRLNC.js +1 -0
- package/dist/web/client/assets/index-C9FloFgj.js +12 -0
- package/dist/web/client/assets/{input-Clyn18XG.js → input-CqC82Agz.js} +1 -1
- package/dist/web/client/assets/{input-group-MxDAWX3j.js → input-group-H0TG-mkU.js} +1 -1
- package/dist/web/client/assets/ipython-tool-BrMePqD-.js +3 -0
- package/dist/web/client/assets/markdown-DG7pUdsX.js +2 -0
- package/dist/web/client/assets/{markdown-code-pIaEVDUU.js → markdown-code-BgMzpy7O.js} +1 -1
- package/dist/web/client/assets/notify-Duj26eeZ.js +1 -0
- package/dist/web/client/assets/{openui-renderer-NLUpAS3h.js → openui-renderer-CCfQqUfE.js} +5 -5
- package/dist/web/client/assets/openui-utils-DawGoQNp.js +1 -0
- package/dist/web/client/assets/prime-agent-artifacts-C-g1VPiW.js +5 -0
- package/dist/web/client/assets/{provider-catalog-Gx9qaHBM.js → provider-catalog-BZhZuKSz.js} +1 -1
- package/dist/web/client/assets/provider-label-jKm8v18u.js +1 -0
- package/dist/web/client/assets/range-65lubOFp.js +2 -0
- package/dist/web/client/assets/repl-panel-CCh4ly7J.js +1 -0
- package/dist/web/client/assets/resource-helpers-ULlyU8qK.js +2 -0
- package/dist/web/client/assets/resources-panel-DSU7VGX2.js +1 -0
- package/dist/web/client/assets/routes-DSTyx_J0.js +16 -0
- package/dist/web/client/assets/session-insights-panel-CQdT90Op.js +1 -0
- package/dist/web/client/assets/settings-dialog-CkfpTKfM.js +1 -0
- package/dist/web/client/assets/skeleton-loaders-fStjEeRP.js +1 -0
- package/dist/web/client/assets/square-terminal-BYTN_I86.js +1 -0
- package/dist/web/client/assets/subagent-chat-panel-D-qw4uWb.js +1 -0
- package/dist/web/client/assets/subagent-transcript-C7oRwEEP.js +1 -0
- package/dist/web/client/assets/subagents-panel-aSMWZP9p.js +1 -0
- package/dist/web/client/assets/{switch-ojzdMno9.js → switch-BFEBpUEU.js} +1 -1
- package/dist/web/client/assets/{tool-result-QvhjpNGX.js → tool-result-C2NvnN32.js} +3 -3
- package/dist/web/client/assets/ui-preferences-DUEFuJFj.js +1 -0
- package/dist/web/client/assets/workspace-panel-CjdXlEvd.js +1 -0
- package/dist/web/client/assets/workspace-path-nav-C0AQNZyy.js +1 -0
- package/dist/web/server/{_tanstack-start-manifest_v-uZddQetG-MNZGQOSA.js → _tanstack-start-manifest_v-DZc7dwm7-6ZQLGXB7.js} +23 -16
- package/dist/web/server/{artifacts-panel-knpQvJ-q-WJLZ76QB.js → artifacts-panel-Bt7YUzm4-NCBMXJ25.js} +39 -72
- package/dist/web/server/{chat-command-palette-CPv5GmGJ-22J32S6P.js → chat-command-palette-Co1L3rUY-RQLNME4T.js} +43 -20
- package/dist/web/server/{chunk-5277VI3D.js → chunk-2V6B62OF.js} +213 -275
- package/dist/web/server/{chunk-W7LNJCRJ.js → chunk-3HUI75QM.js} +75 -67
- package/dist/web/server/{chunk-I3FDTJFO.js → chunk-46VQY7SG.js} +6 -87
- package/dist/web/server/{chunk-PRT4QYOB.js → chunk-4UBOIY2S.js} +2 -35
- package/dist/web/server/{chunk-WTYNN6EV.js → chunk-54II5QXQ.js} +23 -1
- package/dist/web/server/chunk-56HSKUBD.js +1805 -0
- package/dist/web/server/{chunk-RPROZ2JC.js → chunk-5RQ6QAZX.js} +133 -133
- package/dist/web/server/{chunk-APN3LVRT.js → chunk-6D524OCJ.js} +201 -204
- package/dist/web/server/chunk-6GMKRR3C.js +161 -0
- package/dist/web/server/chunk-74QOI457.js +45 -0
- package/dist/web/server/{chunk-UBUXV2TW.js → chunk-AECEK3K7.js} +8 -8
- package/dist/web/server/chunk-AQ66E5OW.js +33 -0
- package/dist/web/server/{chunk-JD6EWZCU.js → chunk-AWFOBHH4.js} +50 -50
- package/dist/web/server/{chunk-MK3P3OBZ.js → chunk-BEMDNODD.js} +5 -5
- package/dist/web/server/{chunk-X2TUFLTP.js → chunk-BLVCDQ7E.js} +438 -438
- package/dist/web/server/chunk-FZRBAPUM.js +48 -0
- package/dist/web/server/chunk-G5BCQQ5N.js +34 -0
- package/dist/web/server/chunk-KOIPYBJF.js +3773 -0
- package/dist/web/server/{chunk-XYYNYFFD.js → chunk-LSIHVSUT.js} +2 -2
- package/dist/web/server/{chunk-KVHPE5XH.js → chunk-MDYA4NXK.js} +22 -8
- package/dist/web/server/chunk-NFRJDPB3.js +52 -0
- package/dist/web/server/chunk-P66QQWUM.js +67 -0
- package/dist/web/server/{chunk-4KFMONRT.js → chunk-PDRD2X5G.js} +9 -9
- package/dist/web/server/{chunk-XXNFEXDU.js → chunk-QJBEWT4E.js} +2 -70
- package/dist/web/server/{chunk-AQWTGP35.js → chunk-RX62LUDV.js} +8 -8
- package/dist/web/server/chunk-SR65ARVS.js +192 -0
- package/dist/web/server/{chunk-WK7CQS2N.js → chunk-SZ65K4CO.js} +48 -48
- package/dist/web/server/{chunk-C7EKOPZU.js → chunk-TO3YPLNZ.js} +89 -89
- package/dist/web/server/{chunk-IFV5M33X.js → chunk-UKINNXJY.js} +12 -26
- package/dist/web/server/chunk-VGDP4YDU.js +401 -0
- package/dist/web/server/{fleet-pi-tool-renderer-5vYFNeZS-IHKMLT7W.js → chunk-VRLTWOVJ.js} +46 -393
- package/dist/web/server/{chunk-KDSISV4P.js → chunk-WN77JNYY.js} +2 -50
- package/dist/web/server/{chunk-OADQILSQ.js → chunk-WZNZQNI4.js} +267 -3667
- package/dist/web/server/{chunk-KAWYGHDN.js → chunk-XFVL5ITL.js} +2354 -2314
- package/dist/web/server/{chunk-ZX3XOSYO.js → chunk-XLCTCC4W.js} +3 -3
- package/dist/web/server/{chunk-TTQ75CXC.js → chunk-Y4MHIA7B.js} +97 -40
- package/dist/web/server/fleet-pi-tool-renderer-CE45vM6T-2UQN6RJM.js +37 -0
- package/dist/web/server/{fork-picker-dialog-BZzfxdQd-C6SPHFAW.js → fork-picker-dialog-DCzuGelH-TN2Q5OXI.js} +5 -5
- package/dist/web/server/{markdown-Ct_q4D-z-VFWZRBTY.js → markdown-Boni3lHk-AZGKDNAR.js} +1 -1
- package/dist/web/server/{markdown-code-C_ih1bX1-5CIWT3CH.js → markdown-code-BrWukbg3-D2GN4Y77.js} +2 -2
- package/dist/web/server/{openui-renderer-BT5jL0Yf-XYLLN5U6.js → openui-renderer-c36_GYes-HX46N4M5.js} +14 -13
- package/dist/web/server/repl-panel-D9E8nkQy-L45ZNG2V.js +118 -0
- package/dist/web/server/{resources-panel-DNCVHTIg-PJYMXVGE.js → resources-panel-CwKh4U9f-D3VDEMDW.js} +6 -6
- package/dist/web/server/{router-DDxOMz3K-HRBXILHM.js → router-_ZpegqiQ-QIE44PIB.js} +1811 -1334
- package/dist/web/server/{routes-BX4Tv-6R-FHIZYUWW.js → routes-Ct81-8Tq-LHRMOS7R.js} +3958 -4534
- package/dist/web/server/server.js +3 -3
- package/dist/web/server/{session-insights-panel-gYkkAE8H-W4O74Z7H.js → session-insights-panel-BHZyKDTo-LRMAMA3O.js} +5 -3
- package/dist/web/server/{settings-dialog-BTBFLQ1P-ZENQ4KWK.js → settings-dialog-B4uUS6f--AZ4I4ZOT.js} +179 -193
- package/dist/web/server/{start-CLAD7RcD-56S4BWMM.js → start-BYVnok_H-IA6TWGA3.js} +1 -1
- package/dist/web/server/subagent-chat-panel-C97S3WID-DLOAD5TG.js +63 -0
- package/dist/web/server/subagents-panel-iHpvMIZy-LI6XK66M.js +181 -0
- package/dist/web/server/{chunk-5SZXUN3Y.js → workspace-panel-CHPoiXEo-YB4WS3MK.js} +29 -16
- package/package.json +15 -7
- package/dist/web/client/assets/artifacts-panel-8TyrNBM_.js +0 -1
- package/dist/web/client/assets/chat-command-palette-HpsmKfLO.js +0 -1
- package/dist/web/client/assets/collapsible-WCSnxhr2.js +0 -1
- package/dist/web/client/assets/command-DgfiCKcY.js +0 -2
- package/dist/web/client/assets/globals-BmxtUHFx.css +0 -2
- package/dist/web/client/assets/horizontal-resize-B76jjn5v.js +0 -1
- package/dist/web/client/assets/index-0pBr_bKy.js +0 -12
- package/dist/web/client/assets/markdown-BXWmNJo7.js +0 -2
- package/dist/web/client/assets/prime-agent-artifacts-k9JiTDZM.js +0 -5
- package/dist/web/client/assets/provider-brand-icon-VCebsuTD.js +0 -1
- package/dist/web/client/assets/range-KAaLzImH.js +0 -2
- package/dist/web/client/assets/resources-panel-BWuKeyrb.js +0 -1
- package/dist/web/client/assets/routes-BPRw0UzV.js +0 -20
- package/dist/web/client/assets/session-insights-panel-CPymkzZT.js +0 -1
- package/dist/web/client/assets/settings-dialog-6p8mjg8t.js +0 -1
- package/dist/web/client/assets/shared-DAI9OAw0.js +0 -2
- package/dist/web/client/assets/skeleton-loaders-qxIkJKCA.js +0 -1
- package/dist/web/client/assets/workspace-panel-C67-fqw4.js +0 -1
- package/dist/web/client/assets/workspace-path-nav-BrQHo6es.js +0 -9
- package/dist/web/server/chunk-KJ4UUAEU.js +0 -83
- package/dist/web/server/chunk-NGI44XRR.js +0 -334
- package/dist/web/server/workspace-panel-BNAXF57q-EQCBPEG4.js +0 -28
|
@@ -2,1733 +2,248 @@ import {
|
|
|
2
2
|
__export
|
|
3
3
|
} from "./chunk-MLKGABMK.js";
|
|
4
4
|
|
|
5
|
-
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
if (key === "$ref" || key === "allOf")
|
|
248
|
-
continue;
|
|
249
|
-
if (!(key in _cached)) {
|
|
250
|
-
delete schema2[key];
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
if (refSchema.$ref && refSeen.def) {
|
|
255
|
-
for (const key in schema2) {
|
|
256
|
-
if (key === "$ref" || key === "allOf")
|
|
257
|
-
continue;
|
|
258
|
-
if (key in refSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(refSeen.def[key])) {
|
|
259
|
-
delete schema2[key];
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
const parent = zodSchema._zod.parent;
|
|
265
|
-
if (parent && parent !== ref) {
|
|
266
|
-
flattenRef(parent);
|
|
267
|
-
const parentSeen = ctx.seen.get(parent);
|
|
268
|
-
if (parentSeen?.schema.$ref) {
|
|
269
|
-
schema2.$ref = parentSeen.schema.$ref;
|
|
270
|
-
if (parentSeen.def) {
|
|
271
|
-
for (const key in schema2) {
|
|
272
|
-
if (key === "$ref" || key === "allOf")
|
|
273
|
-
continue;
|
|
274
|
-
if (key in parentSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(parentSeen.def[key])) {
|
|
275
|
-
delete schema2[key];
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
ctx.override({
|
|
282
|
-
zodSchema,
|
|
283
|
-
jsonSchema: schema2,
|
|
284
|
-
path: seen.path ?? []
|
|
285
|
-
});
|
|
286
|
-
};
|
|
287
|
-
for (const entry of [...ctx.seen.entries()].reverse()) {
|
|
288
|
-
flattenRef(entry[0]);
|
|
289
|
-
}
|
|
290
|
-
const result = {};
|
|
291
|
-
if (ctx.target === "draft-2020-12") {
|
|
292
|
-
result.$schema = "https://json-schema.org/draft/2020-12/schema";
|
|
293
|
-
} else if (ctx.target === "draft-07") {
|
|
294
|
-
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
295
|
-
} else if (ctx.target === "draft-04") {
|
|
296
|
-
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
297
|
-
} else if (ctx.target === "openapi-3.0") {
|
|
298
|
-
} else {
|
|
299
|
-
}
|
|
300
|
-
if (ctx.external?.uri) {
|
|
301
|
-
const id = ctx.external.registry.get(schema)?.id;
|
|
302
|
-
if (!id)
|
|
303
|
-
throw new Error("Schema is missing an `id` property");
|
|
304
|
-
result.$id = ctx.external.uri(id);
|
|
305
|
-
}
|
|
306
|
-
Object.assign(result, root.def ?? root.schema);
|
|
307
|
-
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
308
|
-
if (rootMetaId !== void 0 && result.id === rootMetaId)
|
|
309
|
-
delete result.id;
|
|
310
|
-
const defs = ctx.external?.defs ?? {};
|
|
311
|
-
for (const entry of ctx.seen.entries()) {
|
|
312
|
-
const seen = entry[1];
|
|
313
|
-
if (seen.def && seen.defId) {
|
|
314
|
-
if (seen.def.id === seen.defId)
|
|
315
|
-
delete seen.def.id;
|
|
316
|
-
defs[seen.defId] = seen.def;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
if (ctx.external) {
|
|
320
|
-
} else {
|
|
321
|
-
if (Object.keys(defs).length > 0) {
|
|
322
|
-
if (ctx.target === "draft-2020-12") {
|
|
323
|
-
result.$defs = defs;
|
|
324
|
-
} else {
|
|
325
|
-
result.definitions = defs;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
try {
|
|
330
|
-
const finalized = JSON.parse(JSON.stringify(result));
|
|
331
|
-
Object.defineProperty(finalized, "~standard", {
|
|
332
|
-
value: {
|
|
333
|
-
...schema["~standard"],
|
|
334
|
-
jsonSchema: {
|
|
335
|
-
input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
|
|
336
|
-
output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
|
|
337
|
-
}
|
|
338
|
-
},
|
|
339
|
-
enumerable: false,
|
|
340
|
-
writable: false
|
|
341
|
-
});
|
|
342
|
-
return finalized;
|
|
343
|
-
} catch (_err) {
|
|
344
|
-
throw new Error("Error converting schema to JSON.");
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
function isTransforming(_schema, _ctx) {
|
|
348
|
-
const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
|
|
349
|
-
if (ctx.seen.has(_schema))
|
|
350
|
-
return false;
|
|
351
|
-
ctx.seen.add(_schema);
|
|
352
|
-
const def = _schema._zod.def;
|
|
353
|
-
if (def.type === "transform")
|
|
354
|
-
return true;
|
|
355
|
-
if (def.type === "array")
|
|
356
|
-
return isTransforming(def.element, ctx);
|
|
357
|
-
if (def.type === "set")
|
|
358
|
-
return isTransforming(def.valueType, ctx);
|
|
359
|
-
if (def.type === "lazy")
|
|
360
|
-
return isTransforming(def.getter(), ctx);
|
|
361
|
-
if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") {
|
|
362
|
-
return isTransforming(def.innerType, ctx);
|
|
363
|
-
}
|
|
364
|
-
if (def.type === "intersection") {
|
|
365
|
-
return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
|
|
366
|
-
}
|
|
367
|
-
if (def.type === "record" || def.type === "map") {
|
|
368
|
-
return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
|
|
369
|
-
}
|
|
370
|
-
if (def.type === "pipe") {
|
|
371
|
-
if (_schema._zod.traits.has("$ZodCodec"))
|
|
372
|
-
return true;
|
|
373
|
-
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
|
|
374
|
-
}
|
|
375
|
-
if (def.type === "object") {
|
|
376
|
-
for (const key in def.shape) {
|
|
377
|
-
if (isTransforming(def.shape[key], ctx))
|
|
378
|
-
return true;
|
|
379
|
-
}
|
|
380
|
-
return false;
|
|
381
|
-
}
|
|
382
|
-
if (def.type === "union") {
|
|
383
|
-
for (const option of def.options) {
|
|
384
|
-
if (isTransforming(option, ctx))
|
|
385
|
-
return true;
|
|
386
|
-
}
|
|
387
|
-
return false;
|
|
388
|
-
}
|
|
389
|
-
if (def.type === "tuple") {
|
|
390
|
-
for (const item of def.items) {
|
|
391
|
-
if (isTransforming(item, ctx))
|
|
392
|
-
return true;
|
|
393
|
-
}
|
|
394
|
-
if (def.rest && isTransforming(def.rest, ctx))
|
|
395
|
-
return true;
|
|
396
|
-
return false;
|
|
397
|
-
}
|
|
398
|
-
return false;
|
|
399
|
-
}
|
|
400
|
-
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
401
|
-
const ctx = initializeContext({ ...params, processors });
|
|
402
|
-
process(schema, ctx);
|
|
403
|
-
extractDefs(ctx, schema);
|
|
404
|
-
return finalize(ctx, schema);
|
|
405
|
-
};
|
|
406
|
-
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
407
|
-
const { libraryOptions, target } = params ?? {};
|
|
408
|
-
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
409
|
-
process(schema, ctx);
|
|
410
|
-
extractDefs(ctx, schema);
|
|
411
|
-
return finalize(ctx, schema);
|
|
412
|
-
};
|
|
413
|
-
|
|
414
|
-
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
|
|
415
|
-
var util_exports = {};
|
|
416
|
-
__export(util_exports, {
|
|
417
|
-
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
418
|
-
Class: () => Class,
|
|
419
|
-
NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
|
|
420
|
-
aborted: () => aborted,
|
|
421
|
-
allowsEval: () => allowsEval,
|
|
422
|
-
assert: () => assert,
|
|
423
|
-
assertEqual: () => assertEqual,
|
|
424
|
-
assertIs: () => assertIs,
|
|
425
|
-
assertNever: () => assertNever,
|
|
426
|
-
assertNotEqual: () => assertNotEqual,
|
|
427
|
-
assignProp: () => assignProp,
|
|
428
|
-
base64ToUint8Array: () => base64ToUint8Array,
|
|
429
|
-
base64urlToUint8Array: () => base64urlToUint8Array,
|
|
430
|
-
cached: () => cached,
|
|
431
|
-
captureStackTrace: () => captureStackTrace,
|
|
432
|
-
cleanEnum: () => cleanEnum,
|
|
433
|
-
cleanRegex: () => cleanRegex,
|
|
434
|
-
clone: () => clone,
|
|
435
|
-
cloneDef: () => cloneDef,
|
|
436
|
-
createTransparentProxy: () => createTransparentProxy,
|
|
437
|
-
defineLazy: () => defineLazy,
|
|
438
|
-
esc: () => esc,
|
|
439
|
-
escapeRegex: () => escapeRegex,
|
|
440
|
-
explicitlyAborted: () => explicitlyAborted,
|
|
441
|
-
extend: () => extend,
|
|
442
|
-
finalizeIssue: () => finalizeIssue,
|
|
443
|
-
floatSafeRemainder: () => floatSafeRemainder,
|
|
444
|
-
getElementAtPath: () => getElementAtPath,
|
|
445
|
-
getEnumValues: () => getEnumValues,
|
|
446
|
-
getLengthableOrigin: () => getLengthableOrigin,
|
|
447
|
-
getParsedType: () => getParsedType,
|
|
448
|
-
getSizableOrigin: () => getSizableOrigin,
|
|
449
|
-
hexToUint8Array: () => hexToUint8Array,
|
|
450
|
-
isObject: () => isObject,
|
|
451
|
-
isPlainObject: () => isPlainObject,
|
|
452
|
-
issue: () => issue,
|
|
453
|
-
joinValues: () => joinValues,
|
|
454
|
-
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
455
|
-
merge: () => merge,
|
|
456
|
-
mergeDefs: () => mergeDefs,
|
|
457
|
-
normalizeParams: () => normalizeParams,
|
|
458
|
-
nullish: () => nullish,
|
|
459
|
-
numKeys: () => numKeys,
|
|
460
|
-
objectClone: () => objectClone,
|
|
461
|
-
omit: () => omit,
|
|
462
|
-
optionalKeys: () => optionalKeys,
|
|
463
|
-
parsedType: () => parsedType,
|
|
464
|
-
partial: () => partial,
|
|
465
|
-
pick: () => pick,
|
|
466
|
-
prefixIssues: () => prefixIssues,
|
|
467
|
-
primitiveTypes: () => primitiveTypes,
|
|
468
|
-
promiseAllObject: () => promiseAllObject,
|
|
469
|
-
propertyKeyTypes: () => propertyKeyTypes,
|
|
470
|
-
randomString: () => randomString,
|
|
471
|
-
required: () => required,
|
|
472
|
-
safeExtend: () => safeExtend,
|
|
473
|
-
shallowClone: () => shallowClone,
|
|
474
|
-
slugify: () => slugify,
|
|
475
|
-
stringifyPrimitive: () => stringifyPrimitive,
|
|
476
|
-
uint8ArrayToBase64: () => uint8ArrayToBase64,
|
|
477
|
-
uint8ArrayToBase64url: () => uint8ArrayToBase64url,
|
|
478
|
-
uint8ArrayToHex: () => uint8ArrayToHex,
|
|
479
|
-
unwrapMessage: () => unwrapMessage
|
|
480
|
-
});
|
|
481
|
-
|
|
482
|
-
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
|
|
483
|
-
var _a2;
|
|
484
|
-
var NEVER = /* @__PURE__ */ Object.freeze({
|
|
485
|
-
status: "aborted"
|
|
486
|
-
});
|
|
487
|
-
// @__NO_SIDE_EFFECTS__
|
|
488
|
-
function $constructor(name, initializer3, params) {
|
|
489
|
-
function init(inst, def) {
|
|
490
|
-
if (!inst._zod) {
|
|
491
|
-
Object.defineProperty(inst, "_zod", {
|
|
492
|
-
value: {
|
|
493
|
-
def,
|
|
494
|
-
constr: _,
|
|
495
|
-
traits: /* @__PURE__ */ new Set()
|
|
496
|
-
},
|
|
497
|
-
enumerable: false
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
if (inst._zod.traits.has(name)) {
|
|
501
|
-
return;
|
|
502
|
-
}
|
|
503
|
-
inst._zod.traits.add(name);
|
|
504
|
-
initializer3(inst, def);
|
|
505
|
-
const proto = _.prototype;
|
|
506
|
-
const keys = Object.keys(proto);
|
|
507
|
-
for (let i = 0; i < keys.length; i++) {
|
|
508
|
-
const k = keys[i];
|
|
509
|
-
if (!(k in inst)) {
|
|
510
|
-
inst[k] = proto[k].bind(inst);
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
const Parent = params?.Parent ?? Object;
|
|
515
|
-
class Definition extends Parent {
|
|
516
|
-
}
|
|
517
|
-
Object.defineProperty(Definition, "name", { value: name });
|
|
518
|
-
function _(def) {
|
|
519
|
-
var _a3;
|
|
520
|
-
const inst = params?.Parent ? new Definition() : this;
|
|
521
|
-
init(inst, def);
|
|
522
|
-
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
523
|
-
for (const fn of inst._zod.deferred) {
|
|
524
|
-
fn();
|
|
525
|
-
}
|
|
526
|
-
return inst;
|
|
527
|
-
}
|
|
528
|
-
Object.defineProperty(_, "init", { value: init });
|
|
529
|
-
Object.defineProperty(_, Symbol.hasInstance, {
|
|
530
|
-
value: (inst) => {
|
|
531
|
-
if (params?.Parent && inst instanceof params.Parent)
|
|
532
|
-
return true;
|
|
533
|
-
return inst?._zod?.traits?.has(name);
|
|
534
|
-
}
|
|
535
|
-
});
|
|
536
|
-
Object.defineProperty(_, "name", { value: name });
|
|
537
|
-
return _;
|
|
538
|
-
}
|
|
539
|
-
var $brand = /* @__PURE__ */ Symbol("zod_brand");
|
|
540
|
-
var $ZodAsyncError = class extends Error {
|
|
541
|
-
constructor() {
|
|
542
|
-
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
543
|
-
}
|
|
544
|
-
};
|
|
545
|
-
var $ZodEncodeError = class extends Error {
|
|
546
|
-
constructor(name) {
|
|
547
|
-
super(`Encountered unidirectional transform during encode: ${name}`);
|
|
548
|
-
this.name = "ZodEncodeError";
|
|
549
|
-
}
|
|
550
|
-
};
|
|
551
|
-
(_a2 = globalThis).__zod_globalConfig ?? (_a2.__zod_globalConfig = {});
|
|
552
|
-
var globalConfig = globalThis.__zod_globalConfig;
|
|
553
|
-
function config(newConfig) {
|
|
554
|
-
if (newConfig)
|
|
555
|
-
Object.assign(globalConfig, newConfig);
|
|
556
|
-
return globalConfig;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
|
|
560
|
-
function assertEqual(val) {
|
|
561
|
-
return val;
|
|
562
|
-
}
|
|
563
|
-
function assertNotEqual(val) {
|
|
564
|
-
return val;
|
|
565
|
-
}
|
|
566
|
-
function assertIs(_arg) {
|
|
567
|
-
}
|
|
568
|
-
function assertNever(_x) {
|
|
569
|
-
throw new Error("Unexpected value in exhaustive check");
|
|
570
|
-
}
|
|
571
|
-
function assert(_) {
|
|
572
|
-
}
|
|
573
|
-
function getEnumValues(entries) {
|
|
574
|
-
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
575
|
-
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
576
|
-
return values;
|
|
577
|
-
}
|
|
578
|
-
function joinValues(array2, separator = "|") {
|
|
579
|
-
return array2.map((val) => stringifyPrimitive(val)).join(separator);
|
|
580
|
-
}
|
|
581
|
-
function jsonStringifyReplacer(_, value) {
|
|
582
|
-
if (typeof value === "bigint")
|
|
583
|
-
return value.toString();
|
|
584
|
-
return value;
|
|
585
|
-
}
|
|
586
|
-
function cached(getter) {
|
|
587
|
-
const set2 = false;
|
|
588
|
-
return {
|
|
589
|
-
get value() {
|
|
590
|
-
if (!set2) {
|
|
591
|
-
const value = getter();
|
|
592
|
-
Object.defineProperty(this, "value", { value });
|
|
593
|
-
return value;
|
|
594
|
-
}
|
|
595
|
-
throw new Error("cached value already set");
|
|
596
|
-
}
|
|
597
|
-
};
|
|
598
|
-
}
|
|
599
|
-
function nullish(input) {
|
|
600
|
-
return input === null || input === void 0;
|
|
601
|
-
}
|
|
602
|
-
function cleanRegex(source) {
|
|
603
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
604
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
605
|
-
return source.slice(start, end);
|
|
606
|
-
}
|
|
607
|
-
function floatSafeRemainder(val, step) {
|
|
608
|
-
const ratio = val / step;
|
|
609
|
-
const roundedRatio = Math.round(ratio);
|
|
610
|
-
const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
611
|
-
if (Math.abs(ratio - roundedRatio) < tolerance)
|
|
612
|
-
return 0;
|
|
613
|
-
return ratio - roundedRatio;
|
|
614
|
-
}
|
|
615
|
-
var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
|
|
616
|
-
function defineLazy(object2, key, getter) {
|
|
617
|
-
let value = void 0;
|
|
618
|
-
Object.defineProperty(object2, key, {
|
|
619
|
-
get() {
|
|
620
|
-
if (value === EVALUATING) {
|
|
621
|
-
return void 0;
|
|
622
|
-
}
|
|
623
|
-
if (value === void 0) {
|
|
624
|
-
value = EVALUATING;
|
|
625
|
-
value = getter();
|
|
626
|
-
}
|
|
627
|
-
return value;
|
|
628
|
-
},
|
|
629
|
-
set(v) {
|
|
630
|
-
Object.defineProperty(object2, key, {
|
|
631
|
-
value: v
|
|
632
|
-
// configurable: true,
|
|
633
|
-
});
|
|
634
|
-
},
|
|
635
|
-
configurable: true
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
function objectClone(obj) {
|
|
639
|
-
return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
|
|
640
|
-
}
|
|
641
|
-
function assignProp(target, prop, value) {
|
|
642
|
-
Object.defineProperty(target, prop, {
|
|
643
|
-
value,
|
|
644
|
-
writable: true,
|
|
645
|
-
enumerable: true,
|
|
646
|
-
configurable: true
|
|
647
|
-
});
|
|
648
|
-
}
|
|
649
|
-
function mergeDefs(...defs) {
|
|
650
|
-
const mergedDescriptors = {};
|
|
651
|
-
for (const def of defs) {
|
|
652
|
-
const descriptors = Object.getOwnPropertyDescriptors(def);
|
|
653
|
-
Object.assign(mergedDescriptors, descriptors);
|
|
654
|
-
}
|
|
655
|
-
return Object.defineProperties({}, mergedDescriptors);
|
|
656
|
-
}
|
|
657
|
-
function cloneDef(schema) {
|
|
658
|
-
return mergeDefs(schema._zod.def);
|
|
659
|
-
}
|
|
660
|
-
function getElementAtPath(obj, path) {
|
|
661
|
-
if (!path)
|
|
662
|
-
return obj;
|
|
663
|
-
return path.reduce((acc, key) => acc?.[key], obj);
|
|
664
|
-
}
|
|
665
|
-
function promiseAllObject(promisesObj) {
|
|
666
|
-
const keys = Object.keys(promisesObj);
|
|
667
|
-
const promises = keys.map((key) => promisesObj[key]);
|
|
668
|
-
return Promise.all(promises).then((results) => {
|
|
669
|
-
const resolvedObj = {};
|
|
670
|
-
for (let i = 0; i < keys.length; i++) {
|
|
671
|
-
resolvedObj[keys[i]] = results[i];
|
|
672
|
-
}
|
|
673
|
-
return resolvedObj;
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
function randomString(length = 10) {
|
|
677
|
-
const chars = "abcdefghijklmnopqrstuvwxyz";
|
|
678
|
-
let str = "";
|
|
679
|
-
for (let i = 0; i < length; i++) {
|
|
680
|
-
str += chars[Math.floor(Math.random() * chars.length)];
|
|
681
|
-
}
|
|
682
|
-
return str;
|
|
683
|
-
}
|
|
684
|
-
function esc(str) {
|
|
685
|
-
return JSON.stringify(str);
|
|
686
|
-
}
|
|
687
|
-
function slugify(input) {
|
|
688
|
-
return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
689
|
-
}
|
|
690
|
-
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
691
|
-
};
|
|
692
|
-
function isObject(data) {
|
|
693
|
-
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
694
|
-
}
|
|
695
|
-
var allowsEval = /* @__PURE__ */ cached(() => {
|
|
696
|
-
if (globalConfig.jitless) {
|
|
697
|
-
return false;
|
|
698
|
-
}
|
|
699
|
-
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
|
|
700
|
-
return false;
|
|
701
|
-
}
|
|
702
|
-
try {
|
|
703
|
-
const F = Function;
|
|
704
|
-
new F("");
|
|
705
|
-
return true;
|
|
706
|
-
} catch (_) {
|
|
707
|
-
return false;
|
|
708
|
-
}
|
|
709
|
-
});
|
|
710
|
-
function isPlainObject(o) {
|
|
711
|
-
if (isObject(o) === false)
|
|
712
|
-
return false;
|
|
713
|
-
const ctor = o.constructor;
|
|
714
|
-
if (ctor === void 0)
|
|
715
|
-
return true;
|
|
716
|
-
if (typeof ctor !== "function")
|
|
717
|
-
return true;
|
|
718
|
-
const prot = ctor.prototype;
|
|
719
|
-
if (isObject(prot) === false)
|
|
720
|
-
return false;
|
|
721
|
-
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
|
|
722
|
-
return false;
|
|
723
|
-
}
|
|
724
|
-
return true;
|
|
725
|
-
}
|
|
726
|
-
function shallowClone(o) {
|
|
727
|
-
if (isPlainObject(o))
|
|
728
|
-
return { ...o };
|
|
729
|
-
if (Array.isArray(o))
|
|
730
|
-
return [...o];
|
|
731
|
-
if (o instanceof Map)
|
|
732
|
-
return new Map(o);
|
|
733
|
-
if (o instanceof Set)
|
|
734
|
-
return new Set(o);
|
|
735
|
-
return o;
|
|
736
|
-
}
|
|
737
|
-
function numKeys(data) {
|
|
738
|
-
let keyCount = 0;
|
|
739
|
-
for (const key in data) {
|
|
740
|
-
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
741
|
-
keyCount++;
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
return keyCount;
|
|
745
|
-
}
|
|
746
|
-
var getParsedType = (data) => {
|
|
747
|
-
const t = typeof data;
|
|
748
|
-
switch (t) {
|
|
749
|
-
case "undefined":
|
|
750
|
-
return "undefined";
|
|
751
|
-
case "string":
|
|
752
|
-
return "string";
|
|
753
|
-
case "number":
|
|
754
|
-
return Number.isNaN(data) ? "nan" : "number";
|
|
755
|
-
case "boolean":
|
|
756
|
-
return "boolean";
|
|
757
|
-
case "function":
|
|
758
|
-
return "function";
|
|
759
|
-
case "bigint":
|
|
760
|
-
return "bigint";
|
|
761
|
-
case "symbol":
|
|
762
|
-
return "symbol";
|
|
763
|
-
case "object":
|
|
764
|
-
if (Array.isArray(data)) {
|
|
765
|
-
return "array";
|
|
766
|
-
}
|
|
767
|
-
if (data === null) {
|
|
768
|
-
return "null";
|
|
769
|
-
}
|
|
770
|
-
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
|
771
|
-
return "promise";
|
|
772
|
-
}
|
|
773
|
-
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
774
|
-
return "map";
|
|
775
|
-
}
|
|
776
|
-
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
777
|
-
return "set";
|
|
778
|
-
}
|
|
779
|
-
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
780
|
-
return "date";
|
|
781
|
-
}
|
|
782
|
-
if (typeof File !== "undefined" && data instanceof File) {
|
|
783
|
-
return "file";
|
|
784
|
-
}
|
|
785
|
-
return "object";
|
|
786
|
-
default:
|
|
787
|
-
throw new Error(`Unknown data type: ${t}`);
|
|
788
|
-
}
|
|
789
|
-
};
|
|
790
|
-
var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
791
|
-
var primitiveTypes = /* @__PURE__ */ new Set([
|
|
792
|
-
"string",
|
|
793
|
-
"number",
|
|
794
|
-
"bigint",
|
|
795
|
-
"boolean",
|
|
796
|
-
"symbol",
|
|
797
|
-
"undefined"
|
|
798
|
-
]);
|
|
799
|
-
function escapeRegex(str) {
|
|
800
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
801
|
-
}
|
|
802
|
-
function clone(inst, def, params) {
|
|
803
|
-
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
804
|
-
if (!def || params?.parent)
|
|
805
|
-
cl._zod.parent = inst;
|
|
806
|
-
return cl;
|
|
807
|
-
}
|
|
808
|
-
function normalizeParams(_params) {
|
|
809
|
-
const params = _params;
|
|
810
|
-
if (!params)
|
|
811
|
-
return {};
|
|
812
|
-
if (typeof params === "string")
|
|
813
|
-
return { error: () => params };
|
|
814
|
-
if (params?.message !== void 0) {
|
|
815
|
-
if (params?.error !== void 0)
|
|
816
|
-
throw new Error("Cannot specify both `message` and `error` params");
|
|
817
|
-
params.error = params.message;
|
|
818
|
-
}
|
|
819
|
-
delete params.message;
|
|
820
|
-
if (typeof params.error === "string")
|
|
821
|
-
return { ...params, error: () => params.error };
|
|
822
|
-
return params;
|
|
823
|
-
}
|
|
824
|
-
function createTransparentProxy(getter) {
|
|
825
|
-
let target;
|
|
826
|
-
return new Proxy({}, {
|
|
827
|
-
get(_, prop, receiver) {
|
|
828
|
-
target ?? (target = getter());
|
|
829
|
-
return Reflect.get(target, prop, receiver);
|
|
830
|
-
},
|
|
831
|
-
set(_, prop, value, receiver) {
|
|
832
|
-
target ?? (target = getter());
|
|
833
|
-
return Reflect.set(target, prop, value, receiver);
|
|
834
|
-
},
|
|
835
|
-
has(_, prop) {
|
|
836
|
-
target ?? (target = getter());
|
|
837
|
-
return Reflect.has(target, prop);
|
|
838
|
-
},
|
|
839
|
-
deleteProperty(_, prop) {
|
|
840
|
-
target ?? (target = getter());
|
|
841
|
-
return Reflect.deleteProperty(target, prop);
|
|
842
|
-
},
|
|
843
|
-
ownKeys(_) {
|
|
844
|
-
target ?? (target = getter());
|
|
845
|
-
return Reflect.ownKeys(target);
|
|
846
|
-
},
|
|
847
|
-
getOwnPropertyDescriptor(_, prop) {
|
|
848
|
-
target ?? (target = getter());
|
|
849
|
-
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
850
|
-
},
|
|
851
|
-
defineProperty(_, prop, descriptor) {
|
|
852
|
-
target ?? (target = getter());
|
|
853
|
-
return Reflect.defineProperty(target, prop, descriptor);
|
|
854
|
-
}
|
|
855
|
-
});
|
|
856
|
-
}
|
|
857
|
-
function stringifyPrimitive(value) {
|
|
858
|
-
if (typeof value === "bigint")
|
|
859
|
-
return value.toString() + "n";
|
|
860
|
-
if (typeof value === "string")
|
|
861
|
-
return `"${value}"`;
|
|
862
|
-
return `${value}`;
|
|
863
|
-
}
|
|
864
|
-
function optionalKeys(shape) {
|
|
865
|
-
return Object.keys(shape).filter((k) => {
|
|
866
|
-
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
867
|
-
});
|
|
868
|
-
}
|
|
869
|
-
var NUMBER_FORMAT_RANGES = {
|
|
870
|
-
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
871
|
-
int32: [-2147483648, 2147483647],
|
|
872
|
-
uint32: [0, 4294967295],
|
|
873
|
-
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
874
|
-
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
875
|
-
};
|
|
876
|
-
var BIGINT_FORMAT_RANGES = {
|
|
877
|
-
int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
|
|
878
|
-
uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
|
|
879
|
-
};
|
|
880
|
-
function pick(schema, mask) {
|
|
881
|
-
const currDef = schema._zod.def;
|
|
882
|
-
const checks = currDef.checks;
|
|
883
|
-
const hasChecks = checks && checks.length > 0;
|
|
884
|
-
if (hasChecks) {
|
|
885
|
-
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
886
|
-
}
|
|
887
|
-
const def = mergeDefs(schema._zod.def, {
|
|
888
|
-
get shape() {
|
|
889
|
-
const newShape = {};
|
|
890
|
-
for (const key in mask) {
|
|
891
|
-
if (!(key in currDef.shape)) {
|
|
892
|
-
throw new Error(`Unrecognized key: "${key}"`);
|
|
893
|
-
}
|
|
894
|
-
if (!mask[key])
|
|
895
|
-
continue;
|
|
896
|
-
newShape[key] = currDef.shape[key];
|
|
897
|
-
}
|
|
898
|
-
assignProp(this, "shape", newShape);
|
|
899
|
-
return newShape;
|
|
900
|
-
},
|
|
901
|
-
checks: []
|
|
902
|
-
});
|
|
903
|
-
return clone(schema, def);
|
|
904
|
-
}
|
|
905
|
-
function omit(schema, mask) {
|
|
906
|
-
const currDef = schema._zod.def;
|
|
907
|
-
const checks = currDef.checks;
|
|
908
|
-
const hasChecks = checks && checks.length > 0;
|
|
909
|
-
if (hasChecks) {
|
|
910
|
-
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
911
|
-
}
|
|
912
|
-
const def = mergeDefs(schema._zod.def, {
|
|
913
|
-
get shape() {
|
|
914
|
-
const newShape = { ...schema._zod.def.shape };
|
|
915
|
-
for (const key in mask) {
|
|
916
|
-
if (!(key in currDef.shape)) {
|
|
917
|
-
throw new Error(`Unrecognized key: "${key}"`);
|
|
918
|
-
}
|
|
919
|
-
if (!mask[key])
|
|
920
|
-
continue;
|
|
921
|
-
delete newShape[key];
|
|
922
|
-
}
|
|
923
|
-
assignProp(this, "shape", newShape);
|
|
924
|
-
return newShape;
|
|
925
|
-
},
|
|
926
|
-
checks: []
|
|
927
|
-
});
|
|
928
|
-
return clone(schema, def);
|
|
929
|
-
}
|
|
930
|
-
function extend(schema, shape) {
|
|
931
|
-
if (!isPlainObject(shape)) {
|
|
932
|
-
throw new Error("Invalid input to extend: expected a plain object");
|
|
933
|
-
}
|
|
934
|
-
const checks = schema._zod.def.checks;
|
|
935
|
-
const hasChecks = checks && checks.length > 0;
|
|
936
|
-
if (hasChecks) {
|
|
937
|
-
const existingShape = schema._zod.def.shape;
|
|
938
|
-
for (const key in shape) {
|
|
939
|
-
if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
|
|
940
|
-
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
const def = mergeDefs(schema._zod.def, {
|
|
945
|
-
get shape() {
|
|
946
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
947
|
-
assignProp(this, "shape", _shape);
|
|
948
|
-
return _shape;
|
|
949
|
-
}
|
|
950
|
-
});
|
|
951
|
-
return clone(schema, def);
|
|
952
|
-
}
|
|
953
|
-
function safeExtend(schema, shape) {
|
|
954
|
-
if (!isPlainObject(shape)) {
|
|
955
|
-
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
956
|
-
}
|
|
957
|
-
const def = mergeDefs(schema._zod.def, {
|
|
958
|
-
get shape() {
|
|
959
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
960
|
-
assignProp(this, "shape", _shape);
|
|
961
|
-
return _shape;
|
|
962
|
-
}
|
|
963
|
-
});
|
|
964
|
-
return clone(schema, def);
|
|
965
|
-
}
|
|
966
|
-
function merge(a, b) {
|
|
967
|
-
if (a._zod.def.checks?.length) {
|
|
968
|
-
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
969
|
-
}
|
|
970
|
-
const def = mergeDefs(a._zod.def, {
|
|
971
|
-
get shape() {
|
|
972
|
-
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
973
|
-
assignProp(this, "shape", _shape);
|
|
974
|
-
return _shape;
|
|
975
|
-
},
|
|
976
|
-
get catchall() {
|
|
977
|
-
return b._zod.def.catchall;
|
|
978
|
-
},
|
|
979
|
-
checks: b._zod.def.checks ?? []
|
|
980
|
-
});
|
|
981
|
-
return clone(a, def);
|
|
982
|
-
}
|
|
983
|
-
function partial(Class2, schema, mask) {
|
|
984
|
-
const currDef = schema._zod.def;
|
|
985
|
-
const checks = currDef.checks;
|
|
986
|
-
const hasChecks = checks && checks.length > 0;
|
|
987
|
-
if (hasChecks) {
|
|
988
|
-
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
989
|
-
}
|
|
990
|
-
const def = mergeDefs(schema._zod.def, {
|
|
991
|
-
get shape() {
|
|
992
|
-
const oldShape = schema._zod.def.shape;
|
|
993
|
-
const shape = { ...oldShape };
|
|
994
|
-
if (mask) {
|
|
995
|
-
for (const key in mask) {
|
|
996
|
-
if (!(key in oldShape)) {
|
|
997
|
-
throw new Error(`Unrecognized key: "${key}"`);
|
|
998
|
-
}
|
|
999
|
-
if (!mask[key])
|
|
1000
|
-
continue;
|
|
1001
|
-
shape[key] = Class2 ? new Class2({
|
|
1002
|
-
type: "optional",
|
|
1003
|
-
innerType: oldShape[key]
|
|
1004
|
-
}) : oldShape[key];
|
|
1005
|
-
}
|
|
1006
|
-
} else {
|
|
1007
|
-
for (const key in oldShape) {
|
|
1008
|
-
shape[key] = Class2 ? new Class2({
|
|
1009
|
-
type: "optional",
|
|
1010
|
-
innerType: oldShape[key]
|
|
1011
|
-
}) : oldShape[key];
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
assignProp(this, "shape", shape);
|
|
1015
|
-
return shape;
|
|
1016
|
-
},
|
|
1017
|
-
checks: []
|
|
1018
|
-
});
|
|
1019
|
-
return clone(schema, def);
|
|
1020
|
-
}
|
|
1021
|
-
function required(Class2, schema, mask) {
|
|
1022
|
-
const def = mergeDefs(schema._zod.def, {
|
|
1023
|
-
get shape() {
|
|
1024
|
-
const oldShape = schema._zod.def.shape;
|
|
1025
|
-
const shape = { ...oldShape };
|
|
1026
|
-
if (mask) {
|
|
1027
|
-
for (const key in mask) {
|
|
1028
|
-
if (!(key in shape)) {
|
|
1029
|
-
throw new Error(`Unrecognized key: "${key}"`);
|
|
1030
|
-
}
|
|
1031
|
-
if (!mask[key])
|
|
1032
|
-
continue;
|
|
1033
|
-
shape[key] = new Class2({
|
|
1034
|
-
type: "nonoptional",
|
|
1035
|
-
innerType: oldShape[key]
|
|
1036
|
-
});
|
|
1037
|
-
}
|
|
1038
|
-
} else {
|
|
1039
|
-
for (const key in oldShape) {
|
|
1040
|
-
shape[key] = new Class2({
|
|
1041
|
-
type: "nonoptional",
|
|
1042
|
-
innerType: oldShape[key]
|
|
1043
|
-
});
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
assignProp(this, "shape", shape);
|
|
1047
|
-
return shape;
|
|
1048
|
-
}
|
|
1049
|
-
});
|
|
1050
|
-
return clone(schema, def);
|
|
1051
|
-
}
|
|
1052
|
-
function aborted(x, startIndex = 0) {
|
|
1053
|
-
if (x.aborted === true)
|
|
1054
|
-
return true;
|
|
1055
|
-
for (let i = startIndex; i < x.issues.length; i++) {
|
|
1056
|
-
if (x.issues[i]?.continue !== true) {
|
|
1057
|
-
return true;
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
return false;
|
|
1061
|
-
}
|
|
1062
|
-
function explicitlyAborted(x, startIndex = 0) {
|
|
1063
|
-
if (x.aborted === true)
|
|
1064
|
-
return true;
|
|
1065
|
-
for (let i = startIndex; i < x.issues.length; i++) {
|
|
1066
|
-
if (x.issues[i]?.continue === false) {
|
|
1067
|
-
return true;
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
return false;
|
|
1071
|
-
}
|
|
1072
|
-
function prefixIssues(path, issues) {
|
|
1073
|
-
return issues.map((iss) => {
|
|
1074
|
-
var _a3;
|
|
1075
|
-
(_a3 = iss).path ?? (_a3.path = []);
|
|
1076
|
-
iss.path.unshift(path);
|
|
1077
|
-
return iss;
|
|
1078
|
-
});
|
|
1079
|
-
}
|
|
1080
|
-
function unwrapMessage(message) {
|
|
1081
|
-
return typeof message === "string" ? message : message?.message;
|
|
1082
|
-
}
|
|
1083
|
-
function finalizeIssue(iss, ctx, config2) {
|
|
1084
|
-
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
|
|
1085
|
-
const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
|
|
1086
|
-
rest.path ?? (rest.path = []);
|
|
1087
|
-
rest.message = message;
|
|
1088
|
-
if (ctx?.reportInput) {
|
|
1089
|
-
rest.input = _input;
|
|
1090
|
-
}
|
|
1091
|
-
return rest;
|
|
1092
|
-
}
|
|
1093
|
-
function getSizableOrigin(input) {
|
|
1094
|
-
if (input instanceof Set)
|
|
1095
|
-
return "set";
|
|
1096
|
-
if (input instanceof Map)
|
|
1097
|
-
return "map";
|
|
1098
|
-
if (input instanceof File)
|
|
1099
|
-
return "file";
|
|
1100
|
-
return "unknown";
|
|
1101
|
-
}
|
|
1102
|
-
function getLengthableOrigin(input) {
|
|
1103
|
-
if (Array.isArray(input))
|
|
1104
|
-
return "array";
|
|
1105
|
-
if (typeof input === "string")
|
|
1106
|
-
return "string";
|
|
1107
|
-
return "unknown";
|
|
1108
|
-
}
|
|
1109
|
-
function parsedType(data) {
|
|
1110
|
-
const t = typeof data;
|
|
1111
|
-
switch (t) {
|
|
1112
|
-
case "number": {
|
|
1113
|
-
return Number.isNaN(data) ? "nan" : "number";
|
|
1114
|
-
}
|
|
1115
|
-
case "object": {
|
|
1116
|
-
if (data === null) {
|
|
1117
|
-
return "null";
|
|
1118
|
-
}
|
|
1119
|
-
if (Array.isArray(data)) {
|
|
1120
|
-
return "array";
|
|
1121
|
-
}
|
|
1122
|
-
const obj = data;
|
|
1123
|
-
if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) {
|
|
1124
|
-
return obj.constructor.name;
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
return t;
|
|
1129
|
-
}
|
|
1130
|
-
function issue(...args) {
|
|
1131
|
-
const [iss, input, inst] = args;
|
|
1132
|
-
if (typeof iss === "string") {
|
|
1133
|
-
return {
|
|
1134
|
-
message: iss,
|
|
1135
|
-
code: "custom",
|
|
1136
|
-
input,
|
|
1137
|
-
inst
|
|
1138
|
-
};
|
|
1139
|
-
}
|
|
1140
|
-
return { ...iss };
|
|
1141
|
-
}
|
|
1142
|
-
function cleanEnum(obj) {
|
|
1143
|
-
return Object.entries(obj).filter(([k, _]) => {
|
|
1144
|
-
return Number.isNaN(Number.parseInt(k, 10));
|
|
1145
|
-
}).map((el) => el[1]);
|
|
1146
|
-
}
|
|
1147
|
-
function base64ToUint8Array(base643) {
|
|
1148
|
-
const binaryString = atob(base643);
|
|
1149
|
-
const bytes = new Uint8Array(binaryString.length);
|
|
1150
|
-
for (let i = 0; i < binaryString.length; i++) {
|
|
1151
|
-
bytes[i] = binaryString.charCodeAt(i);
|
|
1152
|
-
}
|
|
1153
|
-
return bytes;
|
|
1154
|
-
}
|
|
1155
|
-
function uint8ArrayToBase64(bytes) {
|
|
1156
|
-
let binaryString = "";
|
|
1157
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
1158
|
-
binaryString += String.fromCharCode(bytes[i]);
|
|
1159
|
-
}
|
|
1160
|
-
return btoa(binaryString);
|
|
1161
|
-
}
|
|
1162
|
-
function base64urlToUint8Array(base64url3) {
|
|
1163
|
-
const base643 = base64url3.replace(/-/g, "+").replace(/_/g, "/");
|
|
1164
|
-
const padding = "=".repeat((4 - base643.length % 4) % 4);
|
|
1165
|
-
return base64ToUint8Array(base643 + padding);
|
|
1166
|
-
}
|
|
1167
|
-
function uint8ArrayToBase64url(bytes) {
|
|
1168
|
-
return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
1169
|
-
}
|
|
1170
|
-
function hexToUint8Array(hex3) {
|
|
1171
|
-
const cleanHex = hex3.replace(/^0x/, "");
|
|
1172
|
-
if (cleanHex.length % 2 !== 0) {
|
|
1173
|
-
throw new Error("Invalid hex string length");
|
|
1174
|
-
}
|
|
1175
|
-
const bytes = new Uint8Array(cleanHex.length / 2);
|
|
1176
|
-
for (let i = 0; i < cleanHex.length; i += 2) {
|
|
1177
|
-
bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);
|
|
1178
|
-
}
|
|
1179
|
-
return bytes;
|
|
1180
|
-
}
|
|
1181
|
-
function uint8ArrayToHex(bytes) {
|
|
1182
|
-
return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1183
|
-
}
|
|
1184
|
-
var Class = class {
|
|
1185
|
-
constructor(..._args) {
|
|
1186
|
-
}
|
|
1187
|
-
};
|
|
1188
|
-
|
|
1189
|
-
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
|
|
1190
|
-
var formatMap = {
|
|
1191
|
-
guid: "uuid",
|
|
1192
|
-
url: "uri",
|
|
1193
|
-
datetime: "date-time",
|
|
1194
|
-
json_string: "json-string",
|
|
1195
|
-
regex: ""
|
|
1196
|
-
// do not set
|
|
1197
|
-
};
|
|
1198
|
-
var stringProcessor = (schema, ctx, _json, _params) => {
|
|
1199
|
-
const json2 = _json;
|
|
1200
|
-
json2.type = "string";
|
|
1201
|
-
const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
|
|
1202
|
-
if (typeof minimum === "number")
|
|
1203
|
-
json2.minLength = minimum;
|
|
1204
|
-
if (typeof maximum === "number")
|
|
1205
|
-
json2.maxLength = maximum;
|
|
1206
|
-
if (format) {
|
|
1207
|
-
json2.format = formatMap[format] ?? format;
|
|
1208
|
-
if (json2.format === "")
|
|
1209
|
-
delete json2.format;
|
|
1210
|
-
if (format === "time") {
|
|
1211
|
-
delete json2.format;
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
if (contentEncoding)
|
|
1215
|
-
json2.contentEncoding = contentEncoding;
|
|
1216
|
-
if (patterns && patterns.size > 0) {
|
|
1217
|
-
const regexes = [...patterns];
|
|
1218
|
-
if (regexes.length === 1)
|
|
1219
|
-
json2.pattern = regexes[0].source;
|
|
1220
|
-
else if (regexes.length > 1) {
|
|
1221
|
-
json2.allOf = [
|
|
1222
|
-
...regexes.map((regex) => ({
|
|
1223
|
-
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
1224
|
-
pattern: regex.source
|
|
1225
|
-
}))
|
|
1226
|
-
];
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
};
|
|
1230
|
-
var numberProcessor = (schema, ctx, _json, _params) => {
|
|
1231
|
-
const json2 = _json;
|
|
1232
|
-
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
|
|
1233
|
-
if (typeof format === "string" && format.includes("int"))
|
|
1234
|
-
json2.type = "integer";
|
|
1235
|
-
else
|
|
1236
|
-
json2.type = "number";
|
|
1237
|
-
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
1238
|
-
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
1239
|
-
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
1240
|
-
if (exMin) {
|
|
1241
|
-
if (legacy) {
|
|
1242
|
-
json2.minimum = exclusiveMinimum;
|
|
1243
|
-
json2.exclusiveMinimum = true;
|
|
1244
|
-
} else {
|
|
1245
|
-
json2.exclusiveMinimum = exclusiveMinimum;
|
|
1246
|
-
}
|
|
1247
|
-
} else if (typeof minimum === "number") {
|
|
1248
|
-
json2.minimum = minimum;
|
|
1249
|
-
}
|
|
1250
|
-
if (exMax) {
|
|
1251
|
-
if (legacy) {
|
|
1252
|
-
json2.maximum = exclusiveMaximum;
|
|
1253
|
-
json2.exclusiveMaximum = true;
|
|
1254
|
-
} else {
|
|
1255
|
-
json2.exclusiveMaximum = exclusiveMaximum;
|
|
1256
|
-
}
|
|
1257
|
-
} else if (typeof maximum === "number") {
|
|
1258
|
-
json2.maximum = maximum;
|
|
1259
|
-
}
|
|
1260
|
-
if (typeof multipleOf === "number")
|
|
1261
|
-
json2.multipleOf = multipleOf;
|
|
1262
|
-
};
|
|
1263
|
-
var booleanProcessor = (_schema, _ctx, json2, _params) => {
|
|
1264
|
-
json2.type = "boolean";
|
|
1265
|
-
};
|
|
1266
|
-
var bigintProcessor = (_schema, ctx, _json, _params) => {
|
|
1267
|
-
if (ctx.unrepresentable === "throw") {
|
|
1268
|
-
throw new Error("BigInt cannot be represented in JSON Schema");
|
|
1269
|
-
}
|
|
1270
|
-
};
|
|
1271
|
-
var symbolProcessor = (_schema, ctx, _json, _params) => {
|
|
1272
|
-
if (ctx.unrepresentable === "throw") {
|
|
1273
|
-
throw new Error("Symbols cannot be represented in JSON Schema");
|
|
1274
|
-
}
|
|
1275
|
-
};
|
|
1276
|
-
var nullProcessor = (_schema, ctx, json2, _params) => {
|
|
1277
|
-
if (ctx.target === "openapi-3.0") {
|
|
1278
|
-
json2.type = "string";
|
|
1279
|
-
json2.nullable = true;
|
|
1280
|
-
json2.enum = [null];
|
|
1281
|
-
} else {
|
|
1282
|
-
json2.type = "null";
|
|
1283
|
-
}
|
|
1284
|
-
};
|
|
1285
|
-
var undefinedProcessor = (_schema, ctx, _json, _params) => {
|
|
1286
|
-
if (ctx.unrepresentable === "throw") {
|
|
1287
|
-
throw new Error("Undefined cannot be represented in JSON Schema");
|
|
1288
|
-
}
|
|
1289
|
-
};
|
|
1290
|
-
var voidProcessor = (_schema, ctx, _json, _params) => {
|
|
1291
|
-
if (ctx.unrepresentable === "throw") {
|
|
1292
|
-
throw new Error("Void cannot be represented in JSON Schema");
|
|
1293
|
-
}
|
|
1294
|
-
};
|
|
1295
|
-
var neverProcessor = (_schema, _ctx, json2, _params) => {
|
|
1296
|
-
json2.not = {};
|
|
1297
|
-
};
|
|
1298
|
-
var anyProcessor = (_schema, _ctx, _json, _params) => {
|
|
1299
|
-
};
|
|
1300
|
-
var unknownProcessor = (_schema, _ctx, _json, _params) => {
|
|
1301
|
-
};
|
|
1302
|
-
var dateProcessor = (_schema, ctx, _json, _params) => {
|
|
1303
|
-
if (ctx.unrepresentable === "throw") {
|
|
1304
|
-
throw new Error("Date cannot be represented in JSON Schema");
|
|
1305
|
-
}
|
|
1306
|
-
};
|
|
1307
|
-
var enumProcessor = (schema, _ctx, json2, _params) => {
|
|
1308
|
-
const def = schema._zod.def;
|
|
1309
|
-
const values = getEnumValues(def.entries);
|
|
1310
|
-
if (values.every((v) => typeof v === "number"))
|
|
1311
|
-
json2.type = "number";
|
|
1312
|
-
if (values.every((v) => typeof v === "string"))
|
|
1313
|
-
json2.type = "string";
|
|
1314
|
-
json2.enum = values;
|
|
1315
|
-
};
|
|
1316
|
-
var literalProcessor = (schema, ctx, json2, _params) => {
|
|
1317
|
-
const def = schema._zod.def;
|
|
1318
|
-
const vals = [];
|
|
1319
|
-
for (const val of def.values) {
|
|
1320
|
-
if (val === void 0) {
|
|
1321
|
-
if (ctx.unrepresentable === "throw") {
|
|
1322
|
-
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
1323
|
-
} else {
|
|
1324
|
-
}
|
|
1325
|
-
} else if (typeof val === "bigint") {
|
|
1326
|
-
if (ctx.unrepresentable === "throw") {
|
|
1327
|
-
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
1328
|
-
} else {
|
|
1329
|
-
vals.push(Number(val));
|
|
1330
|
-
}
|
|
1331
|
-
} else {
|
|
1332
|
-
vals.push(val);
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
|
-
if (vals.length === 0) {
|
|
1336
|
-
} else if (vals.length === 1) {
|
|
1337
|
-
const val = vals[0];
|
|
1338
|
-
json2.type = val === null ? "null" : typeof val;
|
|
1339
|
-
if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
|
|
1340
|
-
json2.enum = [val];
|
|
1341
|
-
} else {
|
|
1342
|
-
json2.const = val;
|
|
1343
|
-
}
|
|
1344
|
-
} else {
|
|
1345
|
-
if (vals.every((v) => typeof v === "number"))
|
|
1346
|
-
json2.type = "number";
|
|
1347
|
-
if (vals.every((v) => typeof v === "string"))
|
|
1348
|
-
json2.type = "string";
|
|
1349
|
-
if (vals.every((v) => typeof v === "boolean"))
|
|
1350
|
-
json2.type = "boolean";
|
|
1351
|
-
if (vals.every((v) => v === null))
|
|
1352
|
-
json2.type = "null";
|
|
1353
|
-
json2.enum = vals;
|
|
1354
|
-
}
|
|
1355
|
-
};
|
|
1356
|
-
var nanProcessor = (_schema, ctx, _json, _params) => {
|
|
1357
|
-
if (ctx.unrepresentable === "throw") {
|
|
1358
|
-
throw new Error("NaN cannot be represented in JSON Schema");
|
|
1359
|
-
}
|
|
1360
|
-
};
|
|
1361
|
-
var templateLiteralProcessor = (schema, _ctx, json2, _params) => {
|
|
1362
|
-
const _json = json2;
|
|
1363
|
-
const pattern = schema._zod.pattern;
|
|
1364
|
-
if (!pattern)
|
|
1365
|
-
throw new Error("Pattern not found in template literal");
|
|
1366
|
-
_json.type = "string";
|
|
1367
|
-
_json.pattern = pattern.source;
|
|
1368
|
-
};
|
|
1369
|
-
var fileProcessor = (schema, _ctx, json2, _params) => {
|
|
1370
|
-
const _json = json2;
|
|
1371
|
-
const file2 = {
|
|
1372
|
-
type: "string",
|
|
1373
|
-
format: "binary",
|
|
1374
|
-
contentEncoding: "binary"
|
|
1375
|
-
};
|
|
1376
|
-
const { minimum, maximum, mime } = schema._zod.bag;
|
|
1377
|
-
if (minimum !== void 0)
|
|
1378
|
-
file2.minLength = minimum;
|
|
1379
|
-
if (maximum !== void 0)
|
|
1380
|
-
file2.maxLength = maximum;
|
|
1381
|
-
if (mime) {
|
|
1382
|
-
if (mime.length === 1) {
|
|
1383
|
-
file2.contentMediaType = mime[0];
|
|
1384
|
-
Object.assign(_json, file2);
|
|
1385
|
-
} else {
|
|
1386
|
-
Object.assign(_json, file2);
|
|
1387
|
-
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
1388
|
-
}
|
|
1389
|
-
} else {
|
|
1390
|
-
Object.assign(_json, file2);
|
|
1391
|
-
}
|
|
1392
|
-
};
|
|
1393
|
-
var successProcessor = (_schema, _ctx, json2, _params) => {
|
|
1394
|
-
json2.type = "boolean";
|
|
1395
|
-
};
|
|
1396
|
-
var customProcessor = (_schema, ctx, _json, _params) => {
|
|
1397
|
-
if (ctx.unrepresentable === "throw") {
|
|
1398
|
-
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
1399
|
-
}
|
|
1400
|
-
};
|
|
1401
|
-
var functionProcessor = (_schema, ctx, _json, _params) => {
|
|
1402
|
-
if (ctx.unrepresentable === "throw") {
|
|
1403
|
-
throw new Error("Function types cannot be represented in JSON Schema");
|
|
1404
|
-
}
|
|
1405
|
-
};
|
|
1406
|
-
var transformProcessor = (_schema, ctx, _json, _params) => {
|
|
1407
|
-
if (ctx.unrepresentable === "throw") {
|
|
1408
|
-
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
1409
|
-
}
|
|
1410
|
-
};
|
|
1411
|
-
var mapProcessor = (_schema, ctx, _json, _params) => {
|
|
1412
|
-
if (ctx.unrepresentable === "throw") {
|
|
1413
|
-
throw new Error("Map cannot be represented in JSON Schema");
|
|
1414
|
-
}
|
|
1415
|
-
};
|
|
1416
|
-
var setProcessor = (_schema, ctx, _json, _params) => {
|
|
1417
|
-
if (ctx.unrepresentable === "throw") {
|
|
1418
|
-
throw new Error("Set cannot be represented in JSON Schema");
|
|
1419
|
-
}
|
|
1420
|
-
};
|
|
1421
|
-
var arrayProcessor = (schema, ctx, _json, params) => {
|
|
1422
|
-
const json2 = _json;
|
|
1423
|
-
const def = schema._zod.def;
|
|
1424
|
-
const { minimum, maximum } = schema._zod.bag;
|
|
1425
|
-
if (typeof minimum === "number")
|
|
1426
|
-
json2.minItems = minimum;
|
|
1427
|
-
if (typeof maximum === "number")
|
|
1428
|
-
json2.maxItems = maximum;
|
|
1429
|
-
json2.type = "array";
|
|
1430
|
-
json2.items = process(def.element, ctx, {
|
|
1431
|
-
...params,
|
|
1432
|
-
path: [...params.path, "items"]
|
|
1433
|
-
});
|
|
1434
|
-
};
|
|
1435
|
-
var objectProcessor = (schema, ctx, _json, params) => {
|
|
1436
|
-
const json2 = _json;
|
|
1437
|
-
const def = schema._zod.def;
|
|
1438
|
-
json2.type = "object";
|
|
1439
|
-
json2.properties = {};
|
|
1440
|
-
const shape = def.shape;
|
|
1441
|
-
for (const key in shape) {
|
|
1442
|
-
json2.properties[key] = process(shape[key], ctx, {
|
|
1443
|
-
...params,
|
|
1444
|
-
path: [...params.path, "properties", key]
|
|
1445
|
-
});
|
|
1446
|
-
}
|
|
1447
|
-
const allKeys = new Set(Object.keys(shape));
|
|
1448
|
-
const requiredKeys = new Set([...allKeys].filter((key) => {
|
|
1449
|
-
const v = def.shape[key]._zod;
|
|
1450
|
-
if (ctx.io === "input") {
|
|
1451
|
-
return v.optin === void 0;
|
|
1452
|
-
} else {
|
|
1453
|
-
return v.optout === void 0;
|
|
1454
|
-
}
|
|
1455
|
-
}));
|
|
1456
|
-
if (requiredKeys.size > 0) {
|
|
1457
|
-
json2.required = Array.from(requiredKeys);
|
|
1458
|
-
}
|
|
1459
|
-
if (def.catchall?._zod.def.type === "never") {
|
|
1460
|
-
json2.additionalProperties = false;
|
|
1461
|
-
} else if (!def.catchall) {
|
|
1462
|
-
if (ctx.io === "output")
|
|
1463
|
-
json2.additionalProperties = false;
|
|
1464
|
-
} else if (def.catchall) {
|
|
1465
|
-
json2.additionalProperties = process(def.catchall, ctx, {
|
|
1466
|
-
...params,
|
|
1467
|
-
path: [...params.path, "additionalProperties"]
|
|
1468
|
-
});
|
|
1469
|
-
}
|
|
1470
|
-
};
|
|
1471
|
-
var unionProcessor = (schema, ctx, json2, params) => {
|
|
1472
|
-
const def = schema._zod.def;
|
|
1473
|
-
const isExclusive = def.inclusive === false;
|
|
1474
|
-
const options = def.options.map((x, i) => process(x, ctx, {
|
|
1475
|
-
...params,
|
|
1476
|
-
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
1477
|
-
}));
|
|
1478
|
-
if (isExclusive) {
|
|
1479
|
-
json2.oneOf = options;
|
|
1480
|
-
} else {
|
|
1481
|
-
json2.anyOf = options;
|
|
1482
|
-
}
|
|
1483
|
-
};
|
|
1484
|
-
var intersectionProcessor = (schema, ctx, json2, params) => {
|
|
1485
|
-
const def = schema._zod.def;
|
|
1486
|
-
const a = process(def.left, ctx, {
|
|
1487
|
-
...params,
|
|
1488
|
-
path: [...params.path, "allOf", 0]
|
|
1489
|
-
});
|
|
1490
|
-
const b = process(def.right, ctx, {
|
|
1491
|
-
...params,
|
|
1492
|
-
path: [...params.path, "allOf", 1]
|
|
1493
|
-
});
|
|
1494
|
-
const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
|
|
1495
|
-
const allOf = [
|
|
1496
|
-
...isSimpleIntersection(a) ? a.allOf : [a],
|
|
1497
|
-
...isSimpleIntersection(b) ? b.allOf : [b]
|
|
1498
|
-
];
|
|
1499
|
-
json2.allOf = allOf;
|
|
1500
|
-
};
|
|
1501
|
-
var tupleProcessor = (schema, ctx, _json, params) => {
|
|
1502
|
-
const json2 = _json;
|
|
1503
|
-
const def = schema._zod.def;
|
|
1504
|
-
json2.type = "array";
|
|
1505
|
-
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
1506
|
-
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
1507
|
-
const prefixItems = def.items.map((x, i) => process(x, ctx, {
|
|
1508
|
-
...params,
|
|
1509
|
-
path: [...params.path, prefixPath, i]
|
|
1510
|
-
}));
|
|
1511
|
-
const rest = def.rest ? process(def.rest, ctx, {
|
|
1512
|
-
...params,
|
|
1513
|
-
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
1514
|
-
}) : null;
|
|
1515
|
-
if (ctx.target === "draft-2020-12") {
|
|
1516
|
-
json2.prefixItems = prefixItems;
|
|
1517
|
-
if (rest) {
|
|
1518
|
-
json2.items = rest;
|
|
1519
|
-
}
|
|
1520
|
-
} else if (ctx.target === "openapi-3.0") {
|
|
1521
|
-
json2.items = {
|
|
1522
|
-
anyOf: prefixItems
|
|
1523
|
-
};
|
|
1524
|
-
if (rest) {
|
|
1525
|
-
json2.items.anyOf.push(rest);
|
|
1526
|
-
}
|
|
1527
|
-
json2.minItems = prefixItems.length;
|
|
1528
|
-
if (!rest) {
|
|
1529
|
-
json2.maxItems = prefixItems.length;
|
|
1530
|
-
}
|
|
1531
|
-
} else {
|
|
1532
|
-
json2.items = prefixItems;
|
|
1533
|
-
if (rest) {
|
|
1534
|
-
json2.additionalItems = rest;
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
const { minimum, maximum } = schema._zod.bag;
|
|
1538
|
-
if (typeof minimum === "number")
|
|
1539
|
-
json2.minItems = minimum;
|
|
1540
|
-
if (typeof maximum === "number")
|
|
1541
|
-
json2.maxItems = maximum;
|
|
1542
|
-
};
|
|
1543
|
-
var recordProcessor = (schema, ctx, _json, params) => {
|
|
1544
|
-
const json2 = _json;
|
|
1545
|
-
const def = schema._zod.def;
|
|
1546
|
-
json2.type = "object";
|
|
1547
|
-
const keyType = def.keyType;
|
|
1548
|
-
const keyBag = keyType._zod.bag;
|
|
1549
|
-
const patterns = keyBag?.patterns;
|
|
1550
|
-
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
1551
|
-
const valueSchema = process(def.valueType, ctx, {
|
|
1552
|
-
...params,
|
|
1553
|
-
path: [...params.path, "patternProperties", "*"]
|
|
1554
|
-
});
|
|
1555
|
-
json2.patternProperties = {};
|
|
1556
|
-
for (const pattern of patterns) {
|
|
1557
|
-
json2.patternProperties[pattern.source] = valueSchema;
|
|
1558
|
-
}
|
|
1559
|
-
} else {
|
|
1560
|
-
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
1561
|
-
json2.propertyNames = process(def.keyType, ctx, {
|
|
1562
|
-
...params,
|
|
1563
|
-
path: [...params.path, "propertyNames"]
|
|
1564
|
-
});
|
|
1565
|
-
}
|
|
1566
|
-
json2.additionalProperties = process(def.valueType, ctx, {
|
|
1567
|
-
...params,
|
|
1568
|
-
path: [...params.path, "additionalProperties"]
|
|
1569
|
-
});
|
|
1570
|
-
}
|
|
1571
|
-
const keyValues = keyType._zod.values;
|
|
1572
|
-
if (keyValues) {
|
|
1573
|
-
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
1574
|
-
if (validKeyValues.length > 0) {
|
|
1575
|
-
json2.required = validKeyValues;
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
};
|
|
1579
|
-
var nullableProcessor = (schema, ctx, json2, params) => {
|
|
1580
|
-
const def = schema._zod.def;
|
|
1581
|
-
const inner = process(def.innerType, ctx, params);
|
|
1582
|
-
const seen = ctx.seen.get(schema);
|
|
1583
|
-
if (ctx.target === "openapi-3.0") {
|
|
1584
|
-
seen.ref = def.innerType;
|
|
1585
|
-
json2.nullable = true;
|
|
1586
|
-
} else {
|
|
1587
|
-
json2.anyOf = [inner, { type: "null" }];
|
|
1588
|
-
}
|
|
1589
|
-
};
|
|
1590
|
-
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
1591
|
-
const def = schema._zod.def;
|
|
1592
|
-
process(def.innerType, ctx, params);
|
|
1593
|
-
const seen = ctx.seen.get(schema);
|
|
1594
|
-
seen.ref = def.innerType;
|
|
1595
|
-
};
|
|
1596
|
-
var defaultProcessor = (schema, ctx, json2, params) => {
|
|
1597
|
-
const def = schema._zod.def;
|
|
1598
|
-
process(def.innerType, ctx, params);
|
|
1599
|
-
const seen = ctx.seen.get(schema);
|
|
1600
|
-
seen.ref = def.innerType;
|
|
1601
|
-
json2.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
1602
|
-
};
|
|
1603
|
-
var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
1604
|
-
const def = schema._zod.def;
|
|
1605
|
-
process(def.innerType, ctx, params);
|
|
1606
|
-
const seen = ctx.seen.get(schema);
|
|
1607
|
-
seen.ref = def.innerType;
|
|
1608
|
-
if (ctx.io === "input")
|
|
1609
|
-
json2._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
1610
|
-
};
|
|
1611
|
-
var catchProcessor = (schema, ctx, json2, params) => {
|
|
1612
|
-
const def = schema._zod.def;
|
|
1613
|
-
process(def.innerType, ctx, params);
|
|
1614
|
-
const seen = ctx.seen.get(schema);
|
|
1615
|
-
seen.ref = def.innerType;
|
|
1616
|
-
let catchValue;
|
|
1617
|
-
try {
|
|
1618
|
-
catchValue = def.catchValue(void 0);
|
|
1619
|
-
} catch {
|
|
1620
|
-
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
1621
|
-
}
|
|
1622
|
-
json2.default = catchValue;
|
|
1623
|
-
};
|
|
1624
|
-
var pipeProcessor = (schema, ctx, _json, params) => {
|
|
1625
|
-
const def = schema._zod.def;
|
|
1626
|
-
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
1627
|
-
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
1628
|
-
process(innerType, ctx, params);
|
|
1629
|
-
const seen = ctx.seen.get(schema);
|
|
1630
|
-
seen.ref = innerType;
|
|
1631
|
-
};
|
|
1632
|
-
var readonlyProcessor = (schema, ctx, json2, params) => {
|
|
1633
|
-
const def = schema._zod.def;
|
|
1634
|
-
process(def.innerType, ctx, params);
|
|
1635
|
-
const seen = ctx.seen.get(schema);
|
|
1636
|
-
seen.ref = def.innerType;
|
|
1637
|
-
json2.readOnly = true;
|
|
1638
|
-
};
|
|
1639
|
-
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
1640
|
-
const def = schema._zod.def;
|
|
1641
|
-
process(def.innerType, ctx, params);
|
|
1642
|
-
const seen = ctx.seen.get(schema);
|
|
1643
|
-
seen.ref = def.innerType;
|
|
1644
|
-
};
|
|
1645
|
-
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
1646
|
-
const def = schema._zod.def;
|
|
1647
|
-
process(def.innerType, ctx, params);
|
|
1648
|
-
const seen = ctx.seen.get(schema);
|
|
1649
|
-
seen.ref = def.innerType;
|
|
1650
|
-
};
|
|
1651
|
-
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
1652
|
-
const innerType = schema._zod.innerType;
|
|
1653
|
-
process(innerType, ctx, params);
|
|
1654
|
-
const seen = ctx.seen.get(schema);
|
|
1655
|
-
seen.ref = innerType;
|
|
1656
|
-
};
|
|
1657
|
-
var allProcessors = {
|
|
1658
|
-
string: stringProcessor,
|
|
1659
|
-
number: numberProcessor,
|
|
1660
|
-
boolean: booleanProcessor,
|
|
1661
|
-
bigint: bigintProcessor,
|
|
1662
|
-
symbol: symbolProcessor,
|
|
1663
|
-
null: nullProcessor,
|
|
1664
|
-
undefined: undefinedProcessor,
|
|
1665
|
-
void: voidProcessor,
|
|
1666
|
-
never: neverProcessor,
|
|
1667
|
-
any: anyProcessor,
|
|
1668
|
-
unknown: unknownProcessor,
|
|
1669
|
-
date: dateProcessor,
|
|
1670
|
-
enum: enumProcessor,
|
|
1671
|
-
literal: literalProcessor,
|
|
1672
|
-
nan: nanProcessor,
|
|
1673
|
-
template_literal: templateLiteralProcessor,
|
|
1674
|
-
file: fileProcessor,
|
|
1675
|
-
success: successProcessor,
|
|
1676
|
-
custom: customProcessor,
|
|
1677
|
-
function: functionProcessor,
|
|
1678
|
-
transform: transformProcessor,
|
|
1679
|
-
map: mapProcessor,
|
|
1680
|
-
set: setProcessor,
|
|
1681
|
-
array: arrayProcessor,
|
|
1682
|
-
object: objectProcessor,
|
|
1683
|
-
union: unionProcessor,
|
|
1684
|
-
intersection: intersectionProcessor,
|
|
1685
|
-
tuple: tupleProcessor,
|
|
1686
|
-
record: recordProcessor,
|
|
1687
|
-
nullable: nullableProcessor,
|
|
1688
|
-
nonoptional: nonoptionalProcessor,
|
|
1689
|
-
default: defaultProcessor,
|
|
1690
|
-
prefault: prefaultProcessor,
|
|
1691
|
-
catch: catchProcessor,
|
|
1692
|
-
pipe: pipeProcessor,
|
|
1693
|
-
readonly: readonlyProcessor,
|
|
1694
|
-
promise: promiseProcessor,
|
|
1695
|
-
optional: optionalProcessor,
|
|
1696
|
-
lazy: lazyProcessor
|
|
1697
|
-
};
|
|
1698
|
-
function toJSONSchema(input, params) {
|
|
1699
|
-
if ("_idmap" in input) {
|
|
1700
|
-
const registry3 = input;
|
|
1701
|
-
const ctx2 = initializeContext({ ...params, processors: allProcessors });
|
|
1702
|
-
const defs = {};
|
|
1703
|
-
for (const entry of registry3._idmap.entries()) {
|
|
1704
|
-
const [_, schema] = entry;
|
|
1705
|
-
process(schema, ctx2);
|
|
1706
|
-
}
|
|
1707
|
-
const schemas = {};
|
|
1708
|
-
const external = {
|
|
1709
|
-
registry: registry3,
|
|
1710
|
-
uri: params?.uri,
|
|
1711
|
-
defs
|
|
1712
|
-
};
|
|
1713
|
-
ctx2.external = external;
|
|
1714
|
-
for (const entry of registry3._idmap.entries()) {
|
|
1715
|
-
const [key, schema] = entry;
|
|
1716
|
-
extractDefs(ctx2, schema);
|
|
1717
|
-
schemas[key] = finalize(ctx2, schema);
|
|
1718
|
-
}
|
|
1719
|
-
if (Object.keys(defs).length > 0) {
|
|
1720
|
-
const defsSegment = ctx2.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
1721
|
-
schemas.__shared = {
|
|
1722
|
-
[defsSegment]: defs
|
|
1723
|
-
};
|
|
1724
|
-
}
|
|
1725
|
-
return { schemas };
|
|
1726
|
-
}
|
|
1727
|
-
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
1728
|
-
process(input, ctx);
|
|
1729
|
-
extractDefs(ctx, input);
|
|
1730
|
-
return finalize(ctx, input);
|
|
1731
|
-
}
|
|
5
|
+
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
6
|
+
var external_exports = {};
|
|
7
|
+
__export(external_exports, {
|
|
8
|
+
$brand: () => $brand,
|
|
9
|
+
$input: () => $input,
|
|
10
|
+
$output: () => $output,
|
|
11
|
+
NEVER: () => NEVER,
|
|
12
|
+
TimePrecision: () => TimePrecision,
|
|
13
|
+
ZodAny: () => ZodAny,
|
|
14
|
+
ZodArray: () => ZodArray,
|
|
15
|
+
ZodBase64: () => ZodBase64,
|
|
16
|
+
ZodBase64URL: () => ZodBase64URL,
|
|
17
|
+
ZodBigInt: () => ZodBigInt,
|
|
18
|
+
ZodBigIntFormat: () => ZodBigIntFormat,
|
|
19
|
+
ZodBoolean: () => ZodBoolean,
|
|
20
|
+
ZodCIDRv4: () => ZodCIDRv4,
|
|
21
|
+
ZodCIDRv6: () => ZodCIDRv6,
|
|
22
|
+
ZodCUID: () => ZodCUID,
|
|
23
|
+
ZodCUID2: () => ZodCUID2,
|
|
24
|
+
ZodCatch: () => ZodCatch,
|
|
25
|
+
ZodCodec: () => ZodCodec,
|
|
26
|
+
ZodCustom: () => ZodCustom,
|
|
27
|
+
ZodCustomStringFormat: () => ZodCustomStringFormat,
|
|
28
|
+
ZodDate: () => ZodDate,
|
|
29
|
+
ZodDefault: () => ZodDefault,
|
|
30
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
31
|
+
ZodE164: () => ZodE164,
|
|
32
|
+
ZodEmail: () => ZodEmail,
|
|
33
|
+
ZodEmoji: () => ZodEmoji,
|
|
34
|
+
ZodEnum: () => ZodEnum,
|
|
35
|
+
ZodError: () => ZodError,
|
|
36
|
+
ZodExactOptional: () => ZodExactOptional,
|
|
37
|
+
ZodFile: () => ZodFile,
|
|
38
|
+
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
39
|
+
ZodFunction: () => ZodFunction,
|
|
40
|
+
ZodGUID: () => ZodGUID,
|
|
41
|
+
ZodIPv4: () => ZodIPv4,
|
|
42
|
+
ZodIPv6: () => ZodIPv6,
|
|
43
|
+
ZodISODate: () => ZodISODate,
|
|
44
|
+
ZodISODateTime: () => ZodISODateTime,
|
|
45
|
+
ZodISODuration: () => ZodISODuration,
|
|
46
|
+
ZodISOTime: () => ZodISOTime,
|
|
47
|
+
ZodIntersection: () => ZodIntersection,
|
|
48
|
+
ZodIssueCode: () => ZodIssueCode,
|
|
49
|
+
ZodJWT: () => ZodJWT,
|
|
50
|
+
ZodKSUID: () => ZodKSUID,
|
|
51
|
+
ZodLazy: () => ZodLazy,
|
|
52
|
+
ZodLiteral: () => ZodLiteral,
|
|
53
|
+
ZodMAC: () => ZodMAC,
|
|
54
|
+
ZodMap: () => ZodMap,
|
|
55
|
+
ZodNaN: () => ZodNaN,
|
|
56
|
+
ZodNanoID: () => ZodNanoID,
|
|
57
|
+
ZodNever: () => ZodNever,
|
|
58
|
+
ZodNonOptional: () => ZodNonOptional,
|
|
59
|
+
ZodNull: () => ZodNull,
|
|
60
|
+
ZodNullable: () => ZodNullable,
|
|
61
|
+
ZodNumber: () => ZodNumber,
|
|
62
|
+
ZodNumberFormat: () => ZodNumberFormat,
|
|
63
|
+
ZodObject: () => ZodObject,
|
|
64
|
+
ZodOptional: () => ZodOptional,
|
|
65
|
+
ZodPipe: () => ZodPipe,
|
|
66
|
+
ZodPrefault: () => ZodPrefault,
|
|
67
|
+
ZodPreprocess: () => ZodPreprocess,
|
|
68
|
+
ZodPromise: () => ZodPromise,
|
|
69
|
+
ZodReadonly: () => ZodReadonly,
|
|
70
|
+
ZodRealError: () => ZodRealError,
|
|
71
|
+
ZodRecord: () => ZodRecord,
|
|
72
|
+
ZodSet: () => ZodSet,
|
|
73
|
+
ZodString: () => ZodString,
|
|
74
|
+
ZodStringFormat: () => ZodStringFormat,
|
|
75
|
+
ZodSuccess: () => ZodSuccess,
|
|
76
|
+
ZodSymbol: () => ZodSymbol,
|
|
77
|
+
ZodTemplateLiteral: () => ZodTemplateLiteral,
|
|
78
|
+
ZodTransform: () => ZodTransform,
|
|
79
|
+
ZodTuple: () => ZodTuple,
|
|
80
|
+
ZodType: () => ZodType,
|
|
81
|
+
ZodULID: () => ZodULID,
|
|
82
|
+
ZodURL: () => ZodURL,
|
|
83
|
+
ZodUUID: () => ZodUUID,
|
|
84
|
+
ZodUndefined: () => ZodUndefined,
|
|
85
|
+
ZodUnion: () => ZodUnion,
|
|
86
|
+
ZodUnknown: () => ZodUnknown,
|
|
87
|
+
ZodVoid: () => ZodVoid,
|
|
88
|
+
ZodXID: () => ZodXID,
|
|
89
|
+
ZodXor: () => ZodXor,
|
|
90
|
+
_ZodString: () => _ZodString,
|
|
91
|
+
_default: () => _default2,
|
|
92
|
+
_function: () => _function,
|
|
93
|
+
any: () => any,
|
|
94
|
+
array: () => array,
|
|
95
|
+
base64: () => base642,
|
|
96
|
+
base64url: () => base64url2,
|
|
97
|
+
bigint: () => bigint2,
|
|
98
|
+
boolean: () => boolean2,
|
|
99
|
+
catch: () => _catch2,
|
|
100
|
+
check: () => check,
|
|
101
|
+
cidrv4: () => cidrv42,
|
|
102
|
+
cidrv6: () => cidrv62,
|
|
103
|
+
clone: () => clone,
|
|
104
|
+
codec: () => codec,
|
|
105
|
+
coerce: () => coerce_exports,
|
|
106
|
+
config: () => config,
|
|
107
|
+
core: () => core_exports2,
|
|
108
|
+
cuid: () => cuid3,
|
|
109
|
+
cuid2: () => cuid22,
|
|
110
|
+
custom: () => custom,
|
|
111
|
+
date: () => date3,
|
|
112
|
+
decode: () => decode2,
|
|
113
|
+
decodeAsync: () => decodeAsync2,
|
|
114
|
+
describe: () => describe2,
|
|
115
|
+
discriminatedUnion: () => discriminatedUnion,
|
|
116
|
+
e164: () => e1642,
|
|
117
|
+
email: () => email2,
|
|
118
|
+
emoji: () => emoji2,
|
|
119
|
+
encode: () => encode2,
|
|
120
|
+
encodeAsync: () => encodeAsync2,
|
|
121
|
+
endsWith: () => _endsWith,
|
|
122
|
+
enum: () => _enum2,
|
|
123
|
+
exactOptional: () => exactOptional,
|
|
124
|
+
file: () => file,
|
|
125
|
+
flattenError: () => flattenError,
|
|
126
|
+
float32: () => float32,
|
|
127
|
+
float64: () => float64,
|
|
128
|
+
formatError: () => formatError,
|
|
129
|
+
fromJSONSchema: () => fromJSONSchema,
|
|
130
|
+
function: () => _function,
|
|
131
|
+
getErrorMap: () => getErrorMap,
|
|
132
|
+
globalRegistry: () => globalRegistry,
|
|
133
|
+
gt: () => _gt,
|
|
134
|
+
gte: () => _gte,
|
|
135
|
+
guid: () => guid2,
|
|
136
|
+
hash: () => hash,
|
|
137
|
+
hex: () => hex2,
|
|
138
|
+
hostname: () => hostname2,
|
|
139
|
+
httpUrl: () => httpUrl,
|
|
140
|
+
includes: () => _includes,
|
|
141
|
+
instanceof: () => _instanceof,
|
|
142
|
+
int: () => int,
|
|
143
|
+
int32: () => int32,
|
|
144
|
+
int64: () => int64,
|
|
145
|
+
intersection: () => intersection,
|
|
146
|
+
invertCodec: () => invertCodec,
|
|
147
|
+
ipv4: () => ipv42,
|
|
148
|
+
ipv6: () => ipv62,
|
|
149
|
+
iso: () => iso_exports,
|
|
150
|
+
json: () => json,
|
|
151
|
+
jwt: () => jwt,
|
|
152
|
+
keyof: () => keyof,
|
|
153
|
+
ksuid: () => ksuid2,
|
|
154
|
+
lazy: () => lazy,
|
|
155
|
+
length: () => _length,
|
|
156
|
+
literal: () => literal,
|
|
157
|
+
locales: () => locales_exports,
|
|
158
|
+
looseObject: () => looseObject,
|
|
159
|
+
looseRecord: () => looseRecord,
|
|
160
|
+
lowercase: () => _lowercase,
|
|
161
|
+
lt: () => _lt,
|
|
162
|
+
lte: () => _lte,
|
|
163
|
+
mac: () => mac2,
|
|
164
|
+
map: () => map,
|
|
165
|
+
maxLength: () => _maxLength,
|
|
166
|
+
maxSize: () => _maxSize,
|
|
167
|
+
meta: () => meta2,
|
|
168
|
+
mime: () => _mime,
|
|
169
|
+
minLength: () => _minLength,
|
|
170
|
+
minSize: () => _minSize,
|
|
171
|
+
multipleOf: () => _multipleOf,
|
|
172
|
+
nan: () => nan,
|
|
173
|
+
nanoid: () => nanoid2,
|
|
174
|
+
nativeEnum: () => nativeEnum,
|
|
175
|
+
negative: () => _negative,
|
|
176
|
+
never: () => never,
|
|
177
|
+
nonnegative: () => _nonnegative,
|
|
178
|
+
nonoptional: () => nonoptional,
|
|
179
|
+
nonpositive: () => _nonpositive,
|
|
180
|
+
normalize: () => _normalize,
|
|
181
|
+
null: () => _null3,
|
|
182
|
+
nullable: () => nullable,
|
|
183
|
+
nullish: () => nullish2,
|
|
184
|
+
number: () => number2,
|
|
185
|
+
object: () => object,
|
|
186
|
+
optional: () => optional,
|
|
187
|
+
overwrite: () => _overwrite,
|
|
188
|
+
parse: () => parse2,
|
|
189
|
+
parseAsync: () => parseAsync2,
|
|
190
|
+
partialRecord: () => partialRecord,
|
|
191
|
+
pipe: () => pipe,
|
|
192
|
+
positive: () => _positive,
|
|
193
|
+
prefault: () => prefault,
|
|
194
|
+
preprocess: () => preprocess,
|
|
195
|
+
prettifyError: () => prettifyError,
|
|
196
|
+
promise: () => promise,
|
|
197
|
+
property: () => _property,
|
|
198
|
+
readonly: () => readonly,
|
|
199
|
+
record: () => record,
|
|
200
|
+
refine: () => refine,
|
|
201
|
+
regex: () => _regex,
|
|
202
|
+
regexes: () => regexes_exports,
|
|
203
|
+
registry: () => registry,
|
|
204
|
+
safeDecode: () => safeDecode2,
|
|
205
|
+
safeDecodeAsync: () => safeDecodeAsync2,
|
|
206
|
+
safeEncode: () => safeEncode2,
|
|
207
|
+
safeEncodeAsync: () => safeEncodeAsync2,
|
|
208
|
+
safeParse: () => safeParse2,
|
|
209
|
+
safeParseAsync: () => safeParseAsync2,
|
|
210
|
+
set: () => set,
|
|
211
|
+
setErrorMap: () => setErrorMap,
|
|
212
|
+
size: () => _size,
|
|
213
|
+
slugify: () => _slugify,
|
|
214
|
+
startsWith: () => _startsWith,
|
|
215
|
+
strictObject: () => strictObject,
|
|
216
|
+
string: () => string2,
|
|
217
|
+
stringFormat: () => stringFormat,
|
|
218
|
+
stringbool: () => stringbool,
|
|
219
|
+
success: () => success,
|
|
220
|
+
superRefine: () => superRefine,
|
|
221
|
+
symbol: () => symbol,
|
|
222
|
+
templateLiteral: () => templateLiteral,
|
|
223
|
+
toJSONSchema: () => toJSONSchema,
|
|
224
|
+
toLowerCase: () => _toLowerCase,
|
|
225
|
+
toUpperCase: () => _toUpperCase,
|
|
226
|
+
transform: () => transform,
|
|
227
|
+
treeifyError: () => treeifyError,
|
|
228
|
+
trim: () => _trim,
|
|
229
|
+
tuple: () => tuple,
|
|
230
|
+
uint32: () => uint32,
|
|
231
|
+
uint64: () => uint64,
|
|
232
|
+
ulid: () => ulid2,
|
|
233
|
+
undefined: () => _undefined3,
|
|
234
|
+
union: () => union,
|
|
235
|
+
unknown: () => unknown,
|
|
236
|
+
uppercase: () => _uppercase,
|
|
237
|
+
url: () => url,
|
|
238
|
+
util: () => util_exports,
|
|
239
|
+
uuid: () => uuid2,
|
|
240
|
+
uuidv4: () => uuidv4,
|
|
241
|
+
uuidv6: () => uuidv6,
|
|
242
|
+
uuidv7: () => uuidv7,
|
|
243
|
+
void: () => _void2,
|
|
244
|
+
xid: () => xid2,
|
|
245
|
+
xor: () => xor
|
|
246
|
+
});
|
|
1732
247
|
|
|
1733
248
|
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/index.js
|
|
1734
249
|
var core_exports2 = {};
|
|
@@ -1970,44 +485,817 @@ __export(core_exports2, {
|
|
|
1970
485
|
_xid: () => _xid,
|
|
1971
486
|
_xor: () => _xor,
|
|
1972
487
|
clone: () => clone,
|
|
1973
|
-
config: () => config,
|
|
1974
|
-
createStandardJSONSchemaMethod: () => createStandardJSONSchemaMethod,
|
|
1975
|
-
createToJSONSchemaMethod: () => createToJSONSchemaMethod,
|
|
1976
|
-
decode: () => decode,
|
|
1977
|
-
decodeAsync: () => decodeAsync,
|
|
1978
|
-
describe: () => describe,
|
|
1979
|
-
encode: () => encode,
|
|
1980
|
-
encodeAsync: () => encodeAsync,
|
|
1981
|
-
extractDefs: () => extractDefs,
|
|
1982
|
-
finalize: () => finalize,
|
|
1983
|
-
flattenError: () => flattenError,
|
|
1984
|
-
formatError: () => formatError,
|
|
1985
|
-
globalConfig: () => globalConfig,
|
|
1986
|
-
globalRegistry: () => globalRegistry,
|
|
1987
|
-
initializeContext: () => initializeContext,
|
|
1988
|
-
isValidBase64: () => isValidBase64,
|
|
1989
|
-
isValidBase64URL: () => isValidBase64URL,
|
|
1990
|
-
isValidJWT: () => isValidJWT,
|
|
1991
|
-
locales: () => locales_exports,
|
|
1992
|
-
meta: () => meta,
|
|
1993
|
-
parse: () => parse,
|
|
1994
|
-
parseAsync: () => parseAsync,
|
|
1995
|
-
prettifyError: () => prettifyError,
|
|
1996
|
-
process: () => process,
|
|
1997
|
-
regexes: () => regexes_exports,
|
|
1998
|
-
registry: () => registry,
|
|
1999
|
-
safeDecode: () => safeDecode,
|
|
2000
|
-
safeDecodeAsync: () => safeDecodeAsync,
|
|
2001
|
-
safeEncode: () => safeEncode,
|
|
2002
|
-
safeEncodeAsync: () => safeEncodeAsync,
|
|
2003
|
-
safeParse: () => safeParse,
|
|
2004
|
-
safeParseAsync: () => safeParseAsync,
|
|
2005
|
-
toDotPath: () => toDotPath,
|
|
2006
|
-
toJSONSchema: () => toJSONSchema,
|
|
2007
|
-
treeifyError: () => treeifyError,
|
|
2008
|
-
util: () => util_exports,
|
|
2009
|
-
version: () => version
|
|
488
|
+
config: () => config,
|
|
489
|
+
createStandardJSONSchemaMethod: () => createStandardJSONSchemaMethod,
|
|
490
|
+
createToJSONSchemaMethod: () => createToJSONSchemaMethod,
|
|
491
|
+
decode: () => decode,
|
|
492
|
+
decodeAsync: () => decodeAsync,
|
|
493
|
+
describe: () => describe,
|
|
494
|
+
encode: () => encode,
|
|
495
|
+
encodeAsync: () => encodeAsync,
|
|
496
|
+
extractDefs: () => extractDefs,
|
|
497
|
+
finalize: () => finalize,
|
|
498
|
+
flattenError: () => flattenError,
|
|
499
|
+
formatError: () => formatError,
|
|
500
|
+
globalConfig: () => globalConfig,
|
|
501
|
+
globalRegistry: () => globalRegistry,
|
|
502
|
+
initializeContext: () => initializeContext,
|
|
503
|
+
isValidBase64: () => isValidBase64,
|
|
504
|
+
isValidBase64URL: () => isValidBase64URL,
|
|
505
|
+
isValidJWT: () => isValidJWT,
|
|
506
|
+
locales: () => locales_exports,
|
|
507
|
+
meta: () => meta,
|
|
508
|
+
parse: () => parse,
|
|
509
|
+
parseAsync: () => parseAsync,
|
|
510
|
+
prettifyError: () => prettifyError,
|
|
511
|
+
process: () => process,
|
|
512
|
+
regexes: () => regexes_exports,
|
|
513
|
+
registry: () => registry,
|
|
514
|
+
safeDecode: () => safeDecode,
|
|
515
|
+
safeDecodeAsync: () => safeDecodeAsync,
|
|
516
|
+
safeEncode: () => safeEncode,
|
|
517
|
+
safeEncodeAsync: () => safeEncodeAsync,
|
|
518
|
+
safeParse: () => safeParse,
|
|
519
|
+
safeParseAsync: () => safeParseAsync,
|
|
520
|
+
toDotPath: () => toDotPath,
|
|
521
|
+
toJSONSchema: () => toJSONSchema,
|
|
522
|
+
treeifyError: () => treeifyError,
|
|
523
|
+
util: () => util_exports,
|
|
524
|
+
version: () => version
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
|
|
528
|
+
var _a;
|
|
529
|
+
var NEVER = /* @__PURE__ */ Object.freeze({
|
|
530
|
+
status: "aborted"
|
|
531
|
+
});
|
|
532
|
+
// @__NO_SIDE_EFFECTS__
|
|
533
|
+
function $constructor(name, initializer3, params) {
|
|
534
|
+
function init(inst, def) {
|
|
535
|
+
if (!inst._zod) {
|
|
536
|
+
Object.defineProperty(inst, "_zod", {
|
|
537
|
+
value: {
|
|
538
|
+
def,
|
|
539
|
+
constr: _,
|
|
540
|
+
traits: /* @__PURE__ */ new Set()
|
|
541
|
+
},
|
|
542
|
+
enumerable: false
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
if (inst._zod.traits.has(name)) {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
inst._zod.traits.add(name);
|
|
549
|
+
initializer3(inst, def);
|
|
550
|
+
const proto = _.prototype;
|
|
551
|
+
const keys = Object.keys(proto);
|
|
552
|
+
for (let i = 0; i < keys.length; i++) {
|
|
553
|
+
const k = keys[i];
|
|
554
|
+
if (!(k in inst)) {
|
|
555
|
+
inst[k] = proto[k].bind(inst);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
const Parent = params?.Parent ?? Object;
|
|
560
|
+
class Definition extends Parent {
|
|
561
|
+
}
|
|
562
|
+
Object.defineProperty(Definition, "name", { value: name });
|
|
563
|
+
function _(def) {
|
|
564
|
+
var _a3;
|
|
565
|
+
const inst = params?.Parent ? new Definition() : this;
|
|
566
|
+
init(inst, def);
|
|
567
|
+
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
568
|
+
for (const fn of inst._zod.deferred) {
|
|
569
|
+
fn();
|
|
570
|
+
}
|
|
571
|
+
return inst;
|
|
572
|
+
}
|
|
573
|
+
Object.defineProperty(_, "init", { value: init });
|
|
574
|
+
Object.defineProperty(_, Symbol.hasInstance, {
|
|
575
|
+
value: (inst) => {
|
|
576
|
+
if (params?.Parent && inst instanceof params.Parent)
|
|
577
|
+
return true;
|
|
578
|
+
return inst?._zod?.traits?.has(name);
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
Object.defineProperty(_, "name", { value: name });
|
|
582
|
+
return _;
|
|
583
|
+
}
|
|
584
|
+
var $brand = /* @__PURE__ */ Symbol("zod_brand");
|
|
585
|
+
var $ZodAsyncError = class extends Error {
|
|
586
|
+
constructor() {
|
|
587
|
+
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
var $ZodEncodeError = class extends Error {
|
|
591
|
+
constructor(name) {
|
|
592
|
+
super(`Encountered unidirectional transform during encode: ${name}`);
|
|
593
|
+
this.name = "ZodEncodeError";
|
|
594
|
+
}
|
|
595
|
+
};
|
|
596
|
+
(_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
|
|
597
|
+
var globalConfig = globalThis.__zod_globalConfig;
|
|
598
|
+
function config(newConfig) {
|
|
599
|
+
if (newConfig)
|
|
600
|
+
Object.assign(globalConfig, newConfig);
|
|
601
|
+
return globalConfig;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
|
|
605
|
+
var util_exports = {};
|
|
606
|
+
__export(util_exports, {
|
|
607
|
+
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
608
|
+
Class: () => Class,
|
|
609
|
+
NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
|
|
610
|
+
aborted: () => aborted,
|
|
611
|
+
allowsEval: () => allowsEval,
|
|
612
|
+
assert: () => assert,
|
|
613
|
+
assertEqual: () => assertEqual,
|
|
614
|
+
assertIs: () => assertIs,
|
|
615
|
+
assertNever: () => assertNever,
|
|
616
|
+
assertNotEqual: () => assertNotEqual,
|
|
617
|
+
assignProp: () => assignProp,
|
|
618
|
+
base64ToUint8Array: () => base64ToUint8Array,
|
|
619
|
+
base64urlToUint8Array: () => base64urlToUint8Array,
|
|
620
|
+
cached: () => cached,
|
|
621
|
+
captureStackTrace: () => captureStackTrace,
|
|
622
|
+
cleanEnum: () => cleanEnum,
|
|
623
|
+
cleanRegex: () => cleanRegex,
|
|
624
|
+
clone: () => clone,
|
|
625
|
+
cloneDef: () => cloneDef,
|
|
626
|
+
createTransparentProxy: () => createTransparentProxy,
|
|
627
|
+
defineLazy: () => defineLazy,
|
|
628
|
+
esc: () => esc,
|
|
629
|
+
escapeRegex: () => escapeRegex,
|
|
630
|
+
explicitlyAborted: () => explicitlyAborted,
|
|
631
|
+
extend: () => extend,
|
|
632
|
+
finalizeIssue: () => finalizeIssue,
|
|
633
|
+
floatSafeRemainder: () => floatSafeRemainder,
|
|
634
|
+
getElementAtPath: () => getElementAtPath,
|
|
635
|
+
getEnumValues: () => getEnumValues,
|
|
636
|
+
getLengthableOrigin: () => getLengthableOrigin,
|
|
637
|
+
getParsedType: () => getParsedType,
|
|
638
|
+
getSizableOrigin: () => getSizableOrigin,
|
|
639
|
+
hexToUint8Array: () => hexToUint8Array,
|
|
640
|
+
isObject: () => isObject,
|
|
641
|
+
isPlainObject: () => isPlainObject,
|
|
642
|
+
issue: () => issue,
|
|
643
|
+
joinValues: () => joinValues,
|
|
644
|
+
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
645
|
+
merge: () => merge,
|
|
646
|
+
mergeDefs: () => mergeDefs,
|
|
647
|
+
normalizeParams: () => normalizeParams,
|
|
648
|
+
nullish: () => nullish,
|
|
649
|
+
numKeys: () => numKeys,
|
|
650
|
+
objectClone: () => objectClone,
|
|
651
|
+
omit: () => omit,
|
|
652
|
+
optionalKeys: () => optionalKeys,
|
|
653
|
+
parsedType: () => parsedType,
|
|
654
|
+
partial: () => partial,
|
|
655
|
+
pick: () => pick,
|
|
656
|
+
prefixIssues: () => prefixIssues,
|
|
657
|
+
primitiveTypes: () => primitiveTypes,
|
|
658
|
+
promiseAllObject: () => promiseAllObject,
|
|
659
|
+
propertyKeyTypes: () => propertyKeyTypes,
|
|
660
|
+
randomString: () => randomString,
|
|
661
|
+
required: () => required,
|
|
662
|
+
safeExtend: () => safeExtend,
|
|
663
|
+
shallowClone: () => shallowClone,
|
|
664
|
+
slugify: () => slugify,
|
|
665
|
+
stringifyPrimitive: () => stringifyPrimitive,
|
|
666
|
+
uint8ArrayToBase64: () => uint8ArrayToBase64,
|
|
667
|
+
uint8ArrayToBase64url: () => uint8ArrayToBase64url,
|
|
668
|
+
uint8ArrayToHex: () => uint8ArrayToHex,
|
|
669
|
+
unwrapMessage: () => unwrapMessage
|
|
670
|
+
});
|
|
671
|
+
function assertEqual(val) {
|
|
672
|
+
return val;
|
|
673
|
+
}
|
|
674
|
+
function assertNotEqual(val) {
|
|
675
|
+
return val;
|
|
676
|
+
}
|
|
677
|
+
function assertIs(_arg) {
|
|
678
|
+
}
|
|
679
|
+
function assertNever(_x) {
|
|
680
|
+
throw new Error("Unexpected value in exhaustive check");
|
|
681
|
+
}
|
|
682
|
+
function assert(_) {
|
|
683
|
+
}
|
|
684
|
+
function getEnumValues(entries) {
|
|
685
|
+
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
686
|
+
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
687
|
+
return values;
|
|
688
|
+
}
|
|
689
|
+
function joinValues(array2, separator = "|") {
|
|
690
|
+
return array2.map((val) => stringifyPrimitive(val)).join(separator);
|
|
691
|
+
}
|
|
692
|
+
function jsonStringifyReplacer(_, value) {
|
|
693
|
+
if (typeof value === "bigint")
|
|
694
|
+
return value.toString();
|
|
695
|
+
return value;
|
|
696
|
+
}
|
|
697
|
+
function cached(getter) {
|
|
698
|
+
const set2 = false;
|
|
699
|
+
return {
|
|
700
|
+
get value() {
|
|
701
|
+
if (!set2) {
|
|
702
|
+
const value = getter();
|
|
703
|
+
Object.defineProperty(this, "value", { value });
|
|
704
|
+
return value;
|
|
705
|
+
}
|
|
706
|
+
throw new Error("cached value already set");
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
function nullish(input) {
|
|
711
|
+
return input === null || input === void 0;
|
|
712
|
+
}
|
|
713
|
+
function cleanRegex(source) {
|
|
714
|
+
const start = source.startsWith("^") ? 1 : 0;
|
|
715
|
+
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
716
|
+
return source.slice(start, end);
|
|
717
|
+
}
|
|
718
|
+
function floatSafeRemainder(val, step) {
|
|
719
|
+
const ratio = val / step;
|
|
720
|
+
const roundedRatio = Math.round(ratio);
|
|
721
|
+
const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
722
|
+
if (Math.abs(ratio - roundedRatio) < tolerance)
|
|
723
|
+
return 0;
|
|
724
|
+
return ratio - roundedRatio;
|
|
725
|
+
}
|
|
726
|
+
var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
|
|
727
|
+
function defineLazy(object2, key, getter) {
|
|
728
|
+
let value = void 0;
|
|
729
|
+
Object.defineProperty(object2, key, {
|
|
730
|
+
get() {
|
|
731
|
+
if (value === EVALUATING) {
|
|
732
|
+
return void 0;
|
|
733
|
+
}
|
|
734
|
+
if (value === void 0) {
|
|
735
|
+
value = EVALUATING;
|
|
736
|
+
value = getter();
|
|
737
|
+
}
|
|
738
|
+
return value;
|
|
739
|
+
},
|
|
740
|
+
set(v) {
|
|
741
|
+
Object.defineProperty(object2, key, {
|
|
742
|
+
value: v
|
|
743
|
+
// configurable: true,
|
|
744
|
+
});
|
|
745
|
+
},
|
|
746
|
+
configurable: true
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
function objectClone(obj) {
|
|
750
|
+
return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
|
|
751
|
+
}
|
|
752
|
+
function assignProp(target, prop, value) {
|
|
753
|
+
Object.defineProperty(target, prop, {
|
|
754
|
+
value,
|
|
755
|
+
writable: true,
|
|
756
|
+
enumerable: true,
|
|
757
|
+
configurable: true
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
function mergeDefs(...defs) {
|
|
761
|
+
const mergedDescriptors = {};
|
|
762
|
+
for (const def of defs) {
|
|
763
|
+
const descriptors = Object.getOwnPropertyDescriptors(def);
|
|
764
|
+
Object.assign(mergedDescriptors, descriptors);
|
|
765
|
+
}
|
|
766
|
+
return Object.defineProperties({}, mergedDescriptors);
|
|
767
|
+
}
|
|
768
|
+
function cloneDef(schema) {
|
|
769
|
+
return mergeDefs(schema._zod.def);
|
|
770
|
+
}
|
|
771
|
+
function getElementAtPath(obj, path) {
|
|
772
|
+
if (!path)
|
|
773
|
+
return obj;
|
|
774
|
+
return path.reduce((acc, key) => acc?.[key], obj);
|
|
775
|
+
}
|
|
776
|
+
function promiseAllObject(promisesObj) {
|
|
777
|
+
const keys = Object.keys(promisesObj);
|
|
778
|
+
const promises = keys.map((key) => promisesObj[key]);
|
|
779
|
+
return Promise.all(promises).then((results) => {
|
|
780
|
+
const resolvedObj = {};
|
|
781
|
+
for (let i = 0; i < keys.length; i++) {
|
|
782
|
+
resolvedObj[keys[i]] = results[i];
|
|
783
|
+
}
|
|
784
|
+
return resolvedObj;
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
function randomString(length = 10) {
|
|
788
|
+
const chars = "abcdefghijklmnopqrstuvwxyz";
|
|
789
|
+
let str = "";
|
|
790
|
+
for (let i = 0; i < length; i++) {
|
|
791
|
+
str += chars[Math.floor(Math.random() * chars.length)];
|
|
792
|
+
}
|
|
793
|
+
return str;
|
|
794
|
+
}
|
|
795
|
+
function esc(str) {
|
|
796
|
+
return JSON.stringify(str);
|
|
797
|
+
}
|
|
798
|
+
function slugify(input) {
|
|
799
|
+
return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
800
|
+
}
|
|
801
|
+
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
802
|
+
};
|
|
803
|
+
function isObject(data) {
|
|
804
|
+
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
805
|
+
}
|
|
806
|
+
var allowsEval = /* @__PURE__ */ cached(() => {
|
|
807
|
+
if (globalConfig.jitless) {
|
|
808
|
+
return false;
|
|
809
|
+
}
|
|
810
|
+
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
|
|
811
|
+
return false;
|
|
812
|
+
}
|
|
813
|
+
try {
|
|
814
|
+
const F = Function;
|
|
815
|
+
new F("");
|
|
816
|
+
return true;
|
|
817
|
+
} catch (_) {
|
|
818
|
+
return false;
|
|
819
|
+
}
|
|
2010
820
|
});
|
|
821
|
+
function isPlainObject(o) {
|
|
822
|
+
if (isObject(o) === false)
|
|
823
|
+
return false;
|
|
824
|
+
const ctor = o.constructor;
|
|
825
|
+
if (ctor === void 0)
|
|
826
|
+
return true;
|
|
827
|
+
if (typeof ctor !== "function")
|
|
828
|
+
return true;
|
|
829
|
+
const prot = ctor.prototype;
|
|
830
|
+
if (isObject(prot) === false)
|
|
831
|
+
return false;
|
|
832
|
+
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
|
|
833
|
+
return false;
|
|
834
|
+
}
|
|
835
|
+
return true;
|
|
836
|
+
}
|
|
837
|
+
function shallowClone(o) {
|
|
838
|
+
if (isPlainObject(o))
|
|
839
|
+
return { ...o };
|
|
840
|
+
if (Array.isArray(o))
|
|
841
|
+
return [...o];
|
|
842
|
+
if (o instanceof Map)
|
|
843
|
+
return new Map(o);
|
|
844
|
+
if (o instanceof Set)
|
|
845
|
+
return new Set(o);
|
|
846
|
+
return o;
|
|
847
|
+
}
|
|
848
|
+
function numKeys(data) {
|
|
849
|
+
let keyCount = 0;
|
|
850
|
+
for (const key in data) {
|
|
851
|
+
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
852
|
+
keyCount++;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
return keyCount;
|
|
856
|
+
}
|
|
857
|
+
var getParsedType = (data) => {
|
|
858
|
+
const t = typeof data;
|
|
859
|
+
switch (t) {
|
|
860
|
+
case "undefined":
|
|
861
|
+
return "undefined";
|
|
862
|
+
case "string":
|
|
863
|
+
return "string";
|
|
864
|
+
case "number":
|
|
865
|
+
return Number.isNaN(data) ? "nan" : "number";
|
|
866
|
+
case "boolean":
|
|
867
|
+
return "boolean";
|
|
868
|
+
case "function":
|
|
869
|
+
return "function";
|
|
870
|
+
case "bigint":
|
|
871
|
+
return "bigint";
|
|
872
|
+
case "symbol":
|
|
873
|
+
return "symbol";
|
|
874
|
+
case "object":
|
|
875
|
+
if (Array.isArray(data)) {
|
|
876
|
+
return "array";
|
|
877
|
+
}
|
|
878
|
+
if (data === null) {
|
|
879
|
+
return "null";
|
|
880
|
+
}
|
|
881
|
+
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
|
882
|
+
return "promise";
|
|
883
|
+
}
|
|
884
|
+
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
885
|
+
return "map";
|
|
886
|
+
}
|
|
887
|
+
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
888
|
+
return "set";
|
|
889
|
+
}
|
|
890
|
+
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
891
|
+
return "date";
|
|
892
|
+
}
|
|
893
|
+
if (typeof File !== "undefined" && data instanceof File) {
|
|
894
|
+
return "file";
|
|
895
|
+
}
|
|
896
|
+
return "object";
|
|
897
|
+
default:
|
|
898
|
+
throw new Error(`Unknown data type: ${t}`);
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
902
|
+
var primitiveTypes = /* @__PURE__ */ new Set([
|
|
903
|
+
"string",
|
|
904
|
+
"number",
|
|
905
|
+
"bigint",
|
|
906
|
+
"boolean",
|
|
907
|
+
"symbol",
|
|
908
|
+
"undefined"
|
|
909
|
+
]);
|
|
910
|
+
function escapeRegex(str) {
|
|
911
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
912
|
+
}
|
|
913
|
+
function clone(inst, def, params) {
|
|
914
|
+
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
915
|
+
if (!def || params?.parent)
|
|
916
|
+
cl._zod.parent = inst;
|
|
917
|
+
return cl;
|
|
918
|
+
}
|
|
919
|
+
function normalizeParams(_params) {
|
|
920
|
+
const params = _params;
|
|
921
|
+
if (!params)
|
|
922
|
+
return {};
|
|
923
|
+
if (typeof params === "string")
|
|
924
|
+
return { error: () => params };
|
|
925
|
+
if (params?.message !== void 0) {
|
|
926
|
+
if (params?.error !== void 0)
|
|
927
|
+
throw new Error("Cannot specify both `message` and `error` params");
|
|
928
|
+
params.error = params.message;
|
|
929
|
+
}
|
|
930
|
+
delete params.message;
|
|
931
|
+
if (typeof params.error === "string")
|
|
932
|
+
return { ...params, error: () => params.error };
|
|
933
|
+
return params;
|
|
934
|
+
}
|
|
935
|
+
function createTransparentProxy(getter) {
|
|
936
|
+
let target;
|
|
937
|
+
return new Proxy({}, {
|
|
938
|
+
get(_, prop, receiver) {
|
|
939
|
+
target ?? (target = getter());
|
|
940
|
+
return Reflect.get(target, prop, receiver);
|
|
941
|
+
},
|
|
942
|
+
set(_, prop, value, receiver) {
|
|
943
|
+
target ?? (target = getter());
|
|
944
|
+
return Reflect.set(target, prop, value, receiver);
|
|
945
|
+
},
|
|
946
|
+
has(_, prop) {
|
|
947
|
+
target ?? (target = getter());
|
|
948
|
+
return Reflect.has(target, prop);
|
|
949
|
+
},
|
|
950
|
+
deleteProperty(_, prop) {
|
|
951
|
+
target ?? (target = getter());
|
|
952
|
+
return Reflect.deleteProperty(target, prop);
|
|
953
|
+
},
|
|
954
|
+
ownKeys(_) {
|
|
955
|
+
target ?? (target = getter());
|
|
956
|
+
return Reflect.ownKeys(target);
|
|
957
|
+
},
|
|
958
|
+
getOwnPropertyDescriptor(_, prop) {
|
|
959
|
+
target ?? (target = getter());
|
|
960
|
+
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
961
|
+
},
|
|
962
|
+
defineProperty(_, prop, descriptor) {
|
|
963
|
+
target ?? (target = getter());
|
|
964
|
+
return Reflect.defineProperty(target, prop, descriptor);
|
|
965
|
+
}
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
function stringifyPrimitive(value) {
|
|
969
|
+
if (typeof value === "bigint")
|
|
970
|
+
return value.toString() + "n";
|
|
971
|
+
if (typeof value === "string")
|
|
972
|
+
return `"${value}"`;
|
|
973
|
+
return `${value}`;
|
|
974
|
+
}
|
|
975
|
+
function optionalKeys(shape) {
|
|
976
|
+
return Object.keys(shape).filter((k) => {
|
|
977
|
+
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
978
|
+
});
|
|
979
|
+
}
|
|
980
|
+
var NUMBER_FORMAT_RANGES = {
|
|
981
|
+
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
982
|
+
int32: [-2147483648, 2147483647],
|
|
983
|
+
uint32: [0, 4294967295],
|
|
984
|
+
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
985
|
+
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
986
|
+
};
|
|
987
|
+
var BIGINT_FORMAT_RANGES = {
|
|
988
|
+
int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
|
|
989
|
+
uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
|
|
990
|
+
};
|
|
991
|
+
function pick(schema, mask) {
|
|
992
|
+
const currDef = schema._zod.def;
|
|
993
|
+
const checks = currDef.checks;
|
|
994
|
+
const hasChecks = checks && checks.length > 0;
|
|
995
|
+
if (hasChecks) {
|
|
996
|
+
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
997
|
+
}
|
|
998
|
+
const def = mergeDefs(schema._zod.def, {
|
|
999
|
+
get shape() {
|
|
1000
|
+
const newShape = {};
|
|
1001
|
+
for (const key in mask) {
|
|
1002
|
+
if (!(key in currDef.shape)) {
|
|
1003
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
1004
|
+
}
|
|
1005
|
+
if (!mask[key])
|
|
1006
|
+
continue;
|
|
1007
|
+
newShape[key] = currDef.shape[key];
|
|
1008
|
+
}
|
|
1009
|
+
assignProp(this, "shape", newShape);
|
|
1010
|
+
return newShape;
|
|
1011
|
+
},
|
|
1012
|
+
checks: []
|
|
1013
|
+
});
|
|
1014
|
+
return clone(schema, def);
|
|
1015
|
+
}
|
|
1016
|
+
function omit(schema, mask) {
|
|
1017
|
+
const currDef = schema._zod.def;
|
|
1018
|
+
const checks = currDef.checks;
|
|
1019
|
+
const hasChecks = checks && checks.length > 0;
|
|
1020
|
+
if (hasChecks) {
|
|
1021
|
+
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
1022
|
+
}
|
|
1023
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1024
|
+
get shape() {
|
|
1025
|
+
const newShape = { ...schema._zod.def.shape };
|
|
1026
|
+
for (const key in mask) {
|
|
1027
|
+
if (!(key in currDef.shape)) {
|
|
1028
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
1029
|
+
}
|
|
1030
|
+
if (!mask[key])
|
|
1031
|
+
continue;
|
|
1032
|
+
delete newShape[key];
|
|
1033
|
+
}
|
|
1034
|
+
assignProp(this, "shape", newShape);
|
|
1035
|
+
return newShape;
|
|
1036
|
+
},
|
|
1037
|
+
checks: []
|
|
1038
|
+
});
|
|
1039
|
+
return clone(schema, def);
|
|
1040
|
+
}
|
|
1041
|
+
function extend(schema, shape) {
|
|
1042
|
+
if (!isPlainObject(shape)) {
|
|
1043
|
+
throw new Error("Invalid input to extend: expected a plain object");
|
|
1044
|
+
}
|
|
1045
|
+
const checks = schema._zod.def.checks;
|
|
1046
|
+
const hasChecks = checks && checks.length > 0;
|
|
1047
|
+
if (hasChecks) {
|
|
1048
|
+
const existingShape = schema._zod.def.shape;
|
|
1049
|
+
for (const key in shape) {
|
|
1050
|
+
if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
|
|
1051
|
+
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1056
|
+
get shape() {
|
|
1057
|
+
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
1058
|
+
assignProp(this, "shape", _shape);
|
|
1059
|
+
return _shape;
|
|
1060
|
+
}
|
|
1061
|
+
});
|
|
1062
|
+
return clone(schema, def);
|
|
1063
|
+
}
|
|
1064
|
+
function safeExtend(schema, shape) {
|
|
1065
|
+
if (!isPlainObject(shape)) {
|
|
1066
|
+
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
1067
|
+
}
|
|
1068
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1069
|
+
get shape() {
|
|
1070
|
+
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
1071
|
+
assignProp(this, "shape", _shape);
|
|
1072
|
+
return _shape;
|
|
1073
|
+
}
|
|
1074
|
+
});
|
|
1075
|
+
return clone(schema, def);
|
|
1076
|
+
}
|
|
1077
|
+
function merge(a, b) {
|
|
1078
|
+
if (a._zod.def.checks?.length) {
|
|
1079
|
+
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
1080
|
+
}
|
|
1081
|
+
const def = mergeDefs(a._zod.def, {
|
|
1082
|
+
get shape() {
|
|
1083
|
+
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
1084
|
+
assignProp(this, "shape", _shape);
|
|
1085
|
+
return _shape;
|
|
1086
|
+
},
|
|
1087
|
+
get catchall() {
|
|
1088
|
+
return b._zod.def.catchall;
|
|
1089
|
+
},
|
|
1090
|
+
checks: b._zod.def.checks ?? []
|
|
1091
|
+
});
|
|
1092
|
+
return clone(a, def);
|
|
1093
|
+
}
|
|
1094
|
+
function partial(Class2, schema, mask) {
|
|
1095
|
+
const currDef = schema._zod.def;
|
|
1096
|
+
const checks = currDef.checks;
|
|
1097
|
+
const hasChecks = checks && checks.length > 0;
|
|
1098
|
+
if (hasChecks) {
|
|
1099
|
+
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
1100
|
+
}
|
|
1101
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1102
|
+
get shape() {
|
|
1103
|
+
const oldShape = schema._zod.def.shape;
|
|
1104
|
+
const shape = { ...oldShape };
|
|
1105
|
+
if (mask) {
|
|
1106
|
+
for (const key in mask) {
|
|
1107
|
+
if (!(key in oldShape)) {
|
|
1108
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
1109
|
+
}
|
|
1110
|
+
if (!mask[key])
|
|
1111
|
+
continue;
|
|
1112
|
+
shape[key] = Class2 ? new Class2({
|
|
1113
|
+
type: "optional",
|
|
1114
|
+
innerType: oldShape[key]
|
|
1115
|
+
}) : oldShape[key];
|
|
1116
|
+
}
|
|
1117
|
+
} else {
|
|
1118
|
+
for (const key in oldShape) {
|
|
1119
|
+
shape[key] = Class2 ? new Class2({
|
|
1120
|
+
type: "optional",
|
|
1121
|
+
innerType: oldShape[key]
|
|
1122
|
+
}) : oldShape[key];
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
assignProp(this, "shape", shape);
|
|
1126
|
+
return shape;
|
|
1127
|
+
},
|
|
1128
|
+
checks: []
|
|
1129
|
+
});
|
|
1130
|
+
return clone(schema, def);
|
|
1131
|
+
}
|
|
1132
|
+
function required(Class2, schema, mask) {
|
|
1133
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1134
|
+
get shape() {
|
|
1135
|
+
const oldShape = schema._zod.def.shape;
|
|
1136
|
+
const shape = { ...oldShape };
|
|
1137
|
+
if (mask) {
|
|
1138
|
+
for (const key in mask) {
|
|
1139
|
+
if (!(key in shape)) {
|
|
1140
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
1141
|
+
}
|
|
1142
|
+
if (!mask[key])
|
|
1143
|
+
continue;
|
|
1144
|
+
shape[key] = new Class2({
|
|
1145
|
+
type: "nonoptional",
|
|
1146
|
+
innerType: oldShape[key]
|
|
1147
|
+
});
|
|
1148
|
+
}
|
|
1149
|
+
} else {
|
|
1150
|
+
for (const key in oldShape) {
|
|
1151
|
+
shape[key] = new Class2({
|
|
1152
|
+
type: "nonoptional",
|
|
1153
|
+
innerType: oldShape[key]
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
assignProp(this, "shape", shape);
|
|
1158
|
+
return shape;
|
|
1159
|
+
}
|
|
1160
|
+
});
|
|
1161
|
+
return clone(schema, def);
|
|
1162
|
+
}
|
|
1163
|
+
function aborted(x, startIndex = 0) {
|
|
1164
|
+
if (x.aborted === true)
|
|
1165
|
+
return true;
|
|
1166
|
+
for (let i = startIndex; i < x.issues.length; i++) {
|
|
1167
|
+
if (x.issues[i]?.continue !== true) {
|
|
1168
|
+
return true;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
return false;
|
|
1172
|
+
}
|
|
1173
|
+
function explicitlyAborted(x, startIndex = 0) {
|
|
1174
|
+
if (x.aborted === true)
|
|
1175
|
+
return true;
|
|
1176
|
+
for (let i = startIndex; i < x.issues.length; i++) {
|
|
1177
|
+
if (x.issues[i]?.continue === false) {
|
|
1178
|
+
return true;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
return false;
|
|
1182
|
+
}
|
|
1183
|
+
function prefixIssues(path, issues) {
|
|
1184
|
+
return issues.map((iss) => {
|
|
1185
|
+
var _a3;
|
|
1186
|
+
(_a3 = iss).path ?? (_a3.path = []);
|
|
1187
|
+
iss.path.unshift(path);
|
|
1188
|
+
return iss;
|
|
1189
|
+
});
|
|
1190
|
+
}
|
|
1191
|
+
function unwrapMessage(message) {
|
|
1192
|
+
return typeof message === "string" ? message : message?.message;
|
|
1193
|
+
}
|
|
1194
|
+
function finalizeIssue(iss, ctx, config2) {
|
|
1195
|
+
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
|
|
1196
|
+
const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
|
|
1197
|
+
rest.path ?? (rest.path = []);
|
|
1198
|
+
rest.message = message;
|
|
1199
|
+
if (ctx?.reportInput) {
|
|
1200
|
+
rest.input = _input;
|
|
1201
|
+
}
|
|
1202
|
+
return rest;
|
|
1203
|
+
}
|
|
1204
|
+
function getSizableOrigin(input) {
|
|
1205
|
+
if (input instanceof Set)
|
|
1206
|
+
return "set";
|
|
1207
|
+
if (input instanceof Map)
|
|
1208
|
+
return "map";
|
|
1209
|
+
if (input instanceof File)
|
|
1210
|
+
return "file";
|
|
1211
|
+
return "unknown";
|
|
1212
|
+
}
|
|
1213
|
+
function getLengthableOrigin(input) {
|
|
1214
|
+
if (Array.isArray(input))
|
|
1215
|
+
return "array";
|
|
1216
|
+
if (typeof input === "string")
|
|
1217
|
+
return "string";
|
|
1218
|
+
return "unknown";
|
|
1219
|
+
}
|
|
1220
|
+
function parsedType(data) {
|
|
1221
|
+
const t = typeof data;
|
|
1222
|
+
switch (t) {
|
|
1223
|
+
case "number": {
|
|
1224
|
+
return Number.isNaN(data) ? "nan" : "number";
|
|
1225
|
+
}
|
|
1226
|
+
case "object": {
|
|
1227
|
+
if (data === null) {
|
|
1228
|
+
return "null";
|
|
1229
|
+
}
|
|
1230
|
+
if (Array.isArray(data)) {
|
|
1231
|
+
return "array";
|
|
1232
|
+
}
|
|
1233
|
+
const obj = data;
|
|
1234
|
+
if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) {
|
|
1235
|
+
return obj.constructor.name;
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
return t;
|
|
1240
|
+
}
|
|
1241
|
+
function issue(...args) {
|
|
1242
|
+
const [iss, input, inst] = args;
|
|
1243
|
+
if (typeof iss === "string") {
|
|
1244
|
+
return {
|
|
1245
|
+
message: iss,
|
|
1246
|
+
code: "custom",
|
|
1247
|
+
input,
|
|
1248
|
+
inst
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
return { ...iss };
|
|
1252
|
+
}
|
|
1253
|
+
function cleanEnum(obj) {
|
|
1254
|
+
return Object.entries(obj).filter(([k, _]) => {
|
|
1255
|
+
return Number.isNaN(Number.parseInt(k, 10));
|
|
1256
|
+
}).map((el) => el[1]);
|
|
1257
|
+
}
|
|
1258
|
+
function base64ToUint8Array(base643) {
|
|
1259
|
+
const binaryString = atob(base643);
|
|
1260
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
1261
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
1262
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
1263
|
+
}
|
|
1264
|
+
return bytes;
|
|
1265
|
+
}
|
|
1266
|
+
function uint8ArrayToBase64(bytes) {
|
|
1267
|
+
let binaryString = "";
|
|
1268
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
1269
|
+
binaryString += String.fromCharCode(bytes[i]);
|
|
1270
|
+
}
|
|
1271
|
+
return btoa(binaryString);
|
|
1272
|
+
}
|
|
1273
|
+
function base64urlToUint8Array(base64url3) {
|
|
1274
|
+
const base643 = base64url3.replace(/-/g, "+").replace(/_/g, "/");
|
|
1275
|
+
const padding = "=".repeat((4 - base643.length % 4) % 4);
|
|
1276
|
+
return base64ToUint8Array(base643 + padding);
|
|
1277
|
+
}
|
|
1278
|
+
function uint8ArrayToBase64url(bytes) {
|
|
1279
|
+
return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
1280
|
+
}
|
|
1281
|
+
function hexToUint8Array(hex3) {
|
|
1282
|
+
const cleanHex = hex3.replace(/^0x/, "");
|
|
1283
|
+
if (cleanHex.length % 2 !== 0) {
|
|
1284
|
+
throw new Error("Invalid hex string length");
|
|
1285
|
+
}
|
|
1286
|
+
const bytes = new Uint8Array(cleanHex.length / 2);
|
|
1287
|
+
for (let i = 0; i < cleanHex.length; i += 2) {
|
|
1288
|
+
bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);
|
|
1289
|
+
}
|
|
1290
|
+
return bytes;
|
|
1291
|
+
}
|
|
1292
|
+
function uint8ArrayToHex(bytes) {
|
|
1293
|
+
return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1294
|
+
}
|
|
1295
|
+
var Class = class {
|
|
1296
|
+
constructor(..._args) {
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
2011
1299
|
|
|
2012
1300
|
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
|
|
2013
1301
|
var initializer = (inst, def) => {
|
|
@@ -11026,13 +10314,63 @@ var error50 = () => {
|
|
|
11026
10314
|
default:
|
|
11027
10315
|
return "\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";
|
|
11028
10316
|
}
|
|
11029
|
-
};
|
|
10317
|
+
};
|
|
10318
|
+
};
|
|
10319
|
+
function yo_default() {
|
|
10320
|
+
return {
|
|
10321
|
+
localeError: error50()
|
|
10322
|
+
};
|
|
10323
|
+
}
|
|
10324
|
+
|
|
10325
|
+
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
|
|
10326
|
+
var _a2;
|
|
10327
|
+
var $output = /* @__PURE__ */ Symbol("ZodOutput");
|
|
10328
|
+
var $input = /* @__PURE__ */ Symbol("ZodInput");
|
|
10329
|
+
var $ZodRegistry = class {
|
|
10330
|
+
constructor() {
|
|
10331
|
+
this._map = /* @__PURE__ */ new WeakMap();
|
|
10332
|
+
this._idmap = /* @__PURE__ */ new Map();
|
|
10333
|
+
}
|
|
10334
|
+
add(schema, ..._meta) {
|
|
10335
|
+
const meta3 = _meta[0];
|
|
10336
|
+
this._map.set(schema, meta3);
|
|
10337
|
+
if (meta3 && typeof meta3 === "object" && "id" in meta3) {
|
|
10338
|
+
this._idmap.set(meta3.id, schema);
|
|
10339
|
+
}
|
|
10340
|
+
return this;
|
|
10341
|
+
}
|
|
10342
|
+
clear() {
|
|
10343
|
+
this._map = /* @__PURE__ */ new WeakMap();
|
|
10344
|
+
this._idmap = /* @__PURE__ */ new Map();
|
|
10345
|
+
return this;
|
|
10346
|
+
}
|
|
10347
|
+
remove(schema) {
|
|
10348
|
+
const meta3 = this._map.get(schema);
|
|
10349
|
+
if (meta3 && typeof meta3 === "object" && "id" in meta3) {
|
|
10350
|
+
this._idmap.delete(meta3.id);
|
|
10351
|
+
}
|
|
10352
|
+
this._map.delete(schema);
|
|
10353
|
+
return this;
|
|
10354
|
+
}
|
|
10355
|
+
get(schema) {
|
|
10356
|
+
const p = schema._zod.parent;
|
|
10357
|
+
if (p) {
|
|
10358
|
+
const pm = { ...this.get(p) ?? {} };
|
|
10359
|
+
delete pm.id;
|
|
10360
|
+
const f = { ...pm, ...this._map.get(schema) };
|
|
10361
|
+
return Object.keys(f).length ? f : void 0;
|
|
10362
|
+
}
|
|
10363
|
+
return this._map.get(schema);
|
|
10364
|
+
}
|
|
10365
|
+
has(schema) {
|
|
10366
|
+
return this._map.has(schema);
|
|
10367
|
+
}
|
|
11030
10368
|
};
|
|
11031
|
-
function
|
|
11032
|
-
return
|
|
11033
|
-
localeError: error50()
|
|
11034
|
-
};
|
|
10369
|
+
function registry() {
|
|
10370
|
+
return new $ZodRegistry();
|
|
11035
10371
|
}
|
|
10372
|
+
(_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
|
|
10373
|
+
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
11036
10374
|
|
|
11037
10375
|
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
|
|
11038
10376
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -11749,328 +11087,1231 @@ function _xor(Class2, options, params) {
|
|
|
11749
11087
|
});
|
|
11750
11088
|
}
|
|
11751
11089
|
// @__NO_SIDE_EFFECTS__
|
|
11752
|
-
function _discriminatedUnion(Class2, discriminator, options, params) {
|
|
11753
|
-
return new Class2({
|
|
11754
|
-
type: "union",
|
|
11755
|
-
options,
|
|
11756
|
-
discriminator,
|
|
11090
|
+
function _discriminatedUnion(Class2, discriminator, options, params) {
|
|
11091
|
+
return new Class2({
|
|
11092
|
+
type: "union",
|
|
11093
|
+
options,
|
|
11094
|
+
discriminator,
|
|
11095
|
+
...normalizeParams(params)
|
|
11096
|
+
});
|
|
11097
|
+
}
|
|
11098
|
+
// @__NO_SIDE_EFFECTS__
|
|
11099
|
+
function _intersection(Class2, left, right) {
|
|
11100
|
+
return new Class2({
|
|
11101
|
+
type: "intersection",
|
|
11102
|
+
left,
|
|
11103
|
+
right
|
|
11104
|
+
});
|
|
11105
|
+
}
|
|
11106
|
+
// @__NO_SIDE_EFFECTS__
|
|
11107
|
+
function _tuple(Class2, items, _paramsOrRest, _params) {
|
|
11108
|
+
const hasRest = _paramsOrRest instanceof $ZodType;
|
|
11109
|
+
const params = hasRest ? _params : _paramsOrRest;
|
|
11110
|
+
const rest = hasRest ? _paramsOrRest : null;
|
|
11111
|
+
return new Class2({
|
|
11112
|
+
type: "tuple",
|
|
11113
|
+
items,
|
|
11114
|
+
rest,
|
|
11115
|
+
...normalizeParams(params)
|
|
11116
|
+
});
|
|
11117
|
+
}
|
|
11118
|
+
// @__NO_SIDE_EFFECTS__
|
|
11119
|
+
function _record(Class2, keyType, valueType, params) {
|
|
11120
|
+
return new Class2({
|
|
11121
|
+
type: "record",
|
|
11122
|
+
keyType,
|
|
11123
|
+
valueType,
|
|
11124
|
+
...normalizeParams(params)
|
|
11125
|
+
});
|
|
11126
|
+
}
|
|
11127
|
+
// @__NO_SIDE_EFFECTS__
|
|
11128
|
+
function _map(Class2, keyType, valueType, params) {
|
|
11129
|
+
return new Class2({
|
|
11130
|
+
type: "map",
|
|
11131
|
+
keyType,
|
|
11132
|
+
valueType,
|
|
11133
|
+
...normalizeParams(params)
|
|
11134
|
+
});
|
|
11135
|
+
}
|
|
11136
|
+
// @__NO_SIDE_EFFECTS__
|
|
11137
|
+
function _set(Class2, valueType, params) {
|
|
11138
|
+
return new Class2({
|
|
11139
|
+
type: "set",
|
|
11140
|
+
valueType,
|
|
11141
|
+
...normalizeParams(params)
|
|
11142
|
+
});
|
|
11143
|
+
}
|
|
11144
|
+
// @__NO_SIDE_EFFECTS__
|
|
11145
|
+
function _enum(Class2, values, params) {
|
|
11146
|
+
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
11147
|
+
return new Class2({
|
|
11148
|
+
type: "enum",
|
|
11149
|
+
entries,
|
|
11150
|
+
...normalizeParams(params)
|
|
11151
|
+
});
|
|
11152
|
+
}
|
|
11153
|
+
// @__NO_SIDE_EFFECTS__
|
|
11154
|
+
function _nativeEnum(Class2, entries, params) {
|
|
11155
|
+
return new Class2({
|
|
11156
|
+
type: "enum",
|
|
11157
|
+
entries,
|
|
11158
|
+
...normalizeParams(params)
|
|
11159
|
+
});
|
|
11160
|
+
}
|
|
11161
|
+
// @__NO_SIDE_EFFECTS__
|
|
11162
|
+
function _literal(Class2, value, params) {
|
|
11163
|
+
return new Class2({
|
|
11164
|
+
type: "literal",
|
|
11165
|
+
values: Array.isArray(value) ? value : [value],
|
|
11166
|
+
...normalizeParams(params)
|
|
11167
|
+
});
|
|
11168
|
+
}
|
|
11169
|
+
// @__NO_SIDE_EFFECTS__
|
|
11170
|
+
function _file(Class2, params) {
|
|
11171
|
+
return new Class2({
|
|
11172
|
+
type: "file",
|
|
11173
|
+
...normalizeParams(params)
|
|
11174
|
+
});
|
|
11175
|
+
}
|
|
11176
|
+
// @__NO_SIDE_EFFECTS__
|
|
11177
|
+
function _transform(Class2, fn) {
|
|
11178
|
+
return new Class2({
|
|
11179
|
+
type: "transform",
|
|
11180
|
+
transform: fn
|
|
11181
|
+
});
|
|
11182
|
+
}
|
|
11183
|
+
// @__NO_SIDE_EFFECTS__
|
|
11184
|
+
function _optional(Class2, innerType) {
|
|
11185
|
+
return new Class2({
|
|
11186
|
+
type: "optional",
|
|
11187
|
+
innerType
|
|
11188
|
+
});
|
|
11189
|
+
}
|
|
11190
|
+
// @__NO_SIDE_EFFECTS__
|
|
11191
|
+
function _nullable(Class2, innerType) {
|
|
11192
|
+
return new Class2({
|
|
11193
|
+
type: "nullable",
|
|
11194
|
+
innerType
|
|
11195
|
+
});
|
|
11196
|
+
}
|
|
11197
|
+
// @__NO_SIDE_EFFECTS__
|
|
11198
|
+
function _default(Class2, innerType, defaultValue) {
|
|
11199
|
+
return new Class2({
|
|
11200
|
+
type: "default",
|
|
11201
|
+
innerType,
|
|
11202
|
+
get defaultValue() {
|
|
11203
|
+
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
11204
|
+
}
|
|
11205
|
+
});
|
|
11206
|
+
}
|
|
11207
|
+
// @__NO_SIDE_EFFECTS__
|
|
11208
|
+
function _nonoptional(Class2, innerType, params) {
|
|
11209
|
+
return new Class2({
|
|
11210
|
+
type: "nonoptional",
|
|
11211
|
+
innerType,
|
|
11212
|
+
...normalizeParams(params)
|
|
11213
|
+
});
|
|
11214
|
+
}
|
|
11215
|
+
// @__NO_SIDE_EFFECTS__
|
|
11216
|
+
function _success(Class2, innerType) {
|
|
11217
|
+
return new Class2({
|
|
11218
|
+
type: "success",
|
|
11219
|
+
innerType
|
|
11220
|
+
});
|
|
11221
|
+
}
|
|
11222
|
+
// @__NO_SIDE_EFFECTS__
|
|
11223
|
+
function _catch(Class2, innerType, catchValue) {
|
|
11224
|
+
return new Class2({
|
|
11225
|
+
type: "catch",
|
|
11226
|
+
innerType,
|
|
11227
|
+
catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
|
|
11228
|
+
});
|
|
11229
|
+
}
|
|
11230
|
+
// @__NO_SIDE_EFFECTS__
|
|
11231
|
+
function _pipe(Class2, in_, out) {
|
|
11232
|
+
return new Class2({
|
|
11233
|
+
type: "pipe",
|
|
11234
|
+
in: in_,
|
|
11235
|
+
out
|
|
11236
|
+
});
|
|
11237
|
+
}
|
|
11238
|
+
// @__NO_SIDE_EFFECTS__
|
|
11239
|
+
function _readonly(Class2, innerType) {
|
|
11240
|
+
return new Class2({
|
|
11241
|
+
type: "readonly",
|
|
11242
|
+
innerType
|
|
11243
|
+
});
|
|
11244
|
+
}
|
|
11245
|
+
// @__NO_SIDE_EFFECTS__
|
|
11246
|
+
function _templateLiteral(Class2, parts, params) {
|
|
11247
|
+
return new Class2({
|
|
11248
|
+
type: "template_literal",
|
|
11249
|
+
parts,
|
|
11250
|
+
...normalizeParams(params)
|
|
11251
|
+
});
|
|
11252
|
+
}
|
|
11253
|
+
// @__NO_SIDE_EFFECTS__
|
|
11254
|
+
function _lazy(Class2, getter) {
|
|
11255
|
+
return new Class2({
|
|
11256
|
+
type: "lazy",
|
|
11257
|
+
getter
|
|
11258
|
+
});
|
|
11259
|
+
}
|
|
11260
|
+
// @__NO_SIDE_EFFECTS__
|
|
11261
|
+
function _promise(Class2, innerType) {
|
|
11262
|
+
return new Class2({
|
|
11263
|
+
type: "promise",
|
|
11264
|
+
innerType
|
|
11265
|
+
});
|
|
11266
|
+
}
|
|
11267
|
+
// @__NO_SIDE_EFFECTS__
|
|
11268
|
+
function _custom(Class2, fn, _params) {
|
|
11269
|
+
const norm = normalizeParams(_params);
|
|
11270
|
+
norm.abort ?? (norm.abort = true);
|
|
11271
|
+
const schema = new Class2({
|
|
11272
|
+
type: "custom",
|
|
11273
|
+
check: "custom",
|
|
11274
|
+
fn,
|
|
11275
|
+
...norm
|
|
11276
|
+
});
|
|
11277
|
+
return schema;
|
|
11278
|
+
}
|
|
11279
|
+
// @__NO_SIDE_EFFECTS__
|
|
11280
|
+
function _refine(Class2, fn, _params) {
|
|
11281
|
+
const schema = new Class2({
|
|
11282
|
+
type: "custom",
|
|
11283
|
+
check: "custom",
|
|
11284
|
+
fn,
|
|
11285
|
+
...normalizeParams(_params)
|
|
11286
|
+
});
|
|
11287
|
+
return schema;
|
|
11288
|
+
}
|
|
11289
|
+
// @__NO_SIDE_EFFECTS__
|
|
11290
|
+
function _superRefine(fn, params) {
|
|
11291
|
+
const ch = /* @__PURE__ */ _check((payload) => {
|
|
11292
|
+
payload.addIssue = (issue2) => {
|
|
11293
|
+
if (typeof issue2 === "string") {
|
|
11294
|
+
payload.issues.push(issue(issue2, payload.value, ch._zod.def));
|
|
11295
|
+
} else {
|
|
11296
|
+
const _issue = issue2;
|
|
11297
|
+
if (_issue.fatal)
|
|
11298
|
+
_issue.continue = false;
|
|
11299
|
+
_issue.code ?? (_issue.code = "custom");
|
|
11300
|
+
_issue.input ?? (_issue.input = payload.value);
|
|
11301
|
+
_issue.inst ?? (_issue.inst = ch);
|
|
11302
|
+
_issue.continue ?? (_issue.continue = !ch._zod.def.abort);
|
|
11303
|
+
payload.issues.push(issue(_issue));
|
|
11304
|
+
}
|
|
11305
|
+
};
|
|
11306
|
+
return fn(payload.value, payload);
|
|
11307
|
+
}, params);
|
|
11308
|
+
return ch;
|
|
11309
|
+
}
|
|
11310
|
+
// @__NO_SIDE_EFFECTS__
|
|
11311
|
+
function _check(fn, params) {
|
|
11312
|
+
const ch = new $ZodCheck({
|
|
11313
|
+
check: "custom",
|
|
11757
11314
|
...normalizeParams(params)
|
|
11758
11315
|
});
|
|
11316
|
+
ch._zod.check = fn;
|
|
11317
|
+
return ch;
|
|
11759
11318
|
}
|
|
11760
11319
|
// @__NO_SIDE_EFFECTS__
|
|
11761
|
-
function
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
|
|
11320
|
+
function describe(description) {
|
|
11321
|
+
const ch = new $ZodCheck({ check: "describe" });
|
|
11322
|
+
ch._zod.onattach = [
|
|
11323
|
+
(inst) => {
|
|
11324
|
+
const existing = globalRegistry.get(inst) ?? {};
|
|
11325
|
+
globalRegistry.add(inst, { ...existing, description });
|
|
11326
|
+
}
|
|
11327
|
+
];
|
|
11328
|
+
ch._zod.check = () => {
|
|
11329
|
+
};
|
|
11330
|
+
return ch;
|
|
11767
11331
|
}
|
|
11768
11332
|
// @__NO_SIDE_EFFECTS__
|
|
11769
|
-
function
|
|
11770
|
-
const
|
|
11771
|
-
|
|
11772
|
-
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
|
|
11776
|
-
|
|
11777
|
-
|
|
11778
|
-
}
|
|
11333
|
+
function meta(metadata) {
|
|
11334
|
+
const ch = new $ZodCheck({ check: "meta" });
|
|
11335
|
+
ch._zod.onattach = [
|
|
11336
|
+
(inst) => {
|
|
11337
|
+
const existing = globalRegistry.get(inst) ?? {};
|
|
11338
|
+
globalRegistry.add(inst, { ...existing, ...metadata });
|
|
11339
|
+
}
|
|
11340
|
+
];
|
|
11341
|
+
ch._zod.check = () => {
|
|
11342
|
+
};
|
|
11343
|
+
return ch;
|
|
11779
11344
|
}
|
|
11780
11345
|
// @__NO_SIDE_EFFECTS__
|
|
11781
|
-
function
|
|
11782
|
-
|
|
11783
|
-
|
|
11784
|
-
|
|
11785
|
-
|
|
11786
|
-
|
|
11346
|
+
function _stringbool(Classes, _params) {
|
|
11347
|
+
const params = normalizeParams(_params);
|
|
11348
|
+
let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"];
|
|
11349
|
+
let falsyArray = params.falsy ?? ["false", "0", "no", "off", "n", "disabled"];
|
|
11350
|
+
if (params.case !== "sensitive") {
|
|
11351
|
+
truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
|
|
11352
|
+
falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
|
|
11353
|
+
}
|
|
11354
|
+
const truthySet = new Set(truthyArray);
|
|
11355
|
+
const falsySet = new Set(falsyArray);
|
|
11356
|
+
const _Codec = Classes.Codec ?? $ZodCodec;
|
|
11357
|
+
const _Boolean = Classes.Boolean ?? $ZodBoolean;
|
|
11358
|
+
const _String = Classes.String ?? $ZodString;
|
|
11359
|
+
const stringSchema = new _String({ type: "string", error: params.error });
|
|
11360
|
+
const booleanSchema = new _Boolean({ type: "boolean", error: params.error });
|
|
11361
|
+
const codec2 = new _Codec({
|
|
11362
|
+
type: "pipe",
|
|
11363
|
+
in: stringSchema,
|
|
11364
|
+
out: booleanSchema,
|
|
11365
|
+
transform: ((input, payload) => {
|
|
11366
|
+
let data = input;
|
|
11367
|
+
if (params.case !== "sensitive")
|
|
11368
|
+
data = data.toLowerCase();
|
|
11369
|
+
if (truthySet.has(data)) {
|
|
11370
|
+
return true;
|
|
11371
|
+
} else if (falsySet.has(data)) {
|
|
11372
|
+
return false;
|
|
11373
|
+
} else {
|
|
11374
|
+
payload.issues.push({
|
|
11375
|
+
code: "invalid_value",
|
|
11376
|
+
expected: "stringbool",
|
|
11377
|
+
values: [...truthySet, ...falsySet],
|
|
11378
|
+
input: payload.value,
|
|
11379
|
+
inst: codec2,
|
|
11380
|
+
continue: false
|
|
11381
|
+
});
|
|
11382
|
+
return {};
|
|
11383
|
+
}
|
|
11384
|
+
}),
|
|
11385
|
+
reverseTransform: ((input, _payload) => {
|
|
11386
|
+
if (input === true) {
|
|
11387
|
+
return truthyArray[0] || "true";
|
|
11388
|
+
} else {
|
|
11389
|
+
return falsyArray[0] || "false";
|
|
11390
|
+
}
|
|
11391
|
+
}),
|
|
11392
|
+
error: params.error
|
|
11787
11393
|
});
|
|
11394
|
+
return codec2;
|
|
11788
11395
|
}
|
|
11789
11396
|
// @__NO_SIDE_EFFECTS__
|
|
11790
|
-
function
|
|
11791
|
-
|
|
11792
|
-
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
|
|
11796
|
-
|
|
11397
|
+
function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
|
|
11398
|
+
const params = normalizeParams(_params);
|
|
11399
|
+
const def = {
|
|
11400
|
+
...normalizeParams(_params),
|
|
11401
|
+
check: "string_format",
|
|
11402
|
+
type: "string",
|
|
11403
|
+
format,
|
|
11404
|
+
fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
|
|
11405
|
+
...params
|
|
11406
|
+
};
|
|
11407
|
+
if (fnOrRegex instanceof RegExp) {
|
|
11408
|
+
def.pattern = fnOrRegex;
|
|
11409
|
+
}
|
|
11410
|
+
const inst = new Class2(def);
|
|
11411
|
+
return inst;
|
|
11797
11412
|
}
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
|
|
11801
|
-
|
|
11802
|
-
|
|
11803
|
-
|
|
11804
|
-
|
|
11413
|
+
|
|
11414
|
+
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
|
|
11415
|
+
function initializeContext(params) {
|
|
11416
|
+
let target = params?.target ?? "draft-2020-12";
|
|
11417
|
+
if (target === "draft-4")
|
|
11418
|
+
target = "draft-04";
|
|
11419
|
+
if (target === "draft-7")
|
|
11420
|
+
target = "draft-07";
|
|
11421
|
+
return {
|
|
11422
|
+
processors: params.processors ?? {},
|
|
11423
|
+
metadataRegistry: params?.metadata ?? globalRegistry,
|
|
11424
|
+
target,
|
|
11425
|
+
unrepresentable: params?.unrepresentable ?? "throw",
|
|
11426
|
+
override: params?.override ?? (() => {
|
|
11427
|
+
}),
|
|
11428
|
+
io: params?.io ?? "output",
|
|
11429
|
+
counter: 0,
|
|
11430
|
+
seen: /* @__PURE__ */ new Map(),
|
|
11431
|
+
cycles: params?.cycles ?? "ref",
|
|
11432
|
+
reused: params?.reused ?? "inline",
|
|
11433
|
+
external: params?.external ?? void 0
|
|
11434
|
+
};
|
|
11805
11435
|
}
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
const
|
|
11809
|
-
|
|
11810
|
-
|
|
11811
|
-
|
|
11812
|
-
|
|
11813
|
-
|
|
11436
|
+
function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
11437
|
+
var _a3;
|
|
11438
|
+
const def = schema._zod.def;
|
|
11439
|
+
const seen = ctx.seen.get(schema);
|
|
11440
|
+
if (seen) {
|
|
11441
|
+
seen.count++;
|
|
11442
|
+
const isCycle = _params.schemaPath.includes(schema);
|
|
11443
|
+
if (isCycle) {
|
|
11444
|
+
seen.cycle = _params.path;
|
|
11445
|
+
}
|
|
11446
|
+
return seen.schema;
|
|
11447
|
+
}
|
|
11448
|
+
const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
|
|
11449
|
+
ctx.seen.set(schema, result);
|
|
11450
|
+
const overrideSchema = schema._zod.toJSONSchema?.();
|
|
11451
|
+
if (overrideSchema) {
|
|
11452
|
+
result.schema = overrideSchema;
|
|
11453
|
+
} else {
|
|
11454
|
+
const params = {
|
|
11455
|
+
..._params,
|
|
11456
|
+
schemaPath: [..._params.schemaPath, schema],
|
|
11457
|
+
path: _params.path
|
|
11458
|
+
};
|
|
11459
|
+
if (schema._zod.processJSONSchema) {
|
|
11460
|
+
schema._zod.processJSONSchema(ctx, result.schema, params);
|
|
11461
|
+
} else {
|
|
11462
|
+
const _json = result.schema;
|
|
11463
|
+
const processor = ctx.processors[def.type];
|
|
11464
|
+
if (!processor) {
|
|
11465
|
+
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
|
|
11466
|
+
}
|
|
11467
|
+
processor(schema, ctx, _json, params);
|
|
11468
|
+
}
|
|
11469
|
+
const parent = schema._zod.parent;
|
|
11470
|
+
if (parent) {
|
|
11471
|
+
if (!result.ref)
|
|
11472
|
+
result.ref = parent;
|
|
11473
|
+
process(parent, ctx, params);
|
|
11474
|
+
ctx.seen.get(parent).isParent = true;
|
|
11475
|
+
}
|
|
11476
|
+
}
|
|
11477
|
+
const meta3 = ctx.metadataRegistry.get(schema);
|
|
11478
|
+
if (meta3)
|
|
11479
|
+
Object.assign(result.schema, meta3);
|
|
11480
|
+
if (ctx.io === "input" && isTransforming(schema)) {
|
|
11481
|
+
delete result.schema.examples;
|
|
11482
|
+
delete result.schema.default;
|
|
11483
|
+
}
|
|
11484
|
+
if (ctx.io === "input" && "_prefault" in result.schema)
|
|
11485
|
+
(_a3 = result.schema).default ?? (_a3.default = result.schema._prefault);
|
|
11486
|
+
delete result.schema._prefault;
|
|
11487
|
+
const _result = ctx.seen.get(schema);
|
|
11488
|
+
return _result.schema;
|
|
11814
11489
|
}
|
|
11815
|
-
|
|
11816
|
-
|
|
11817
|
-
|
|
11818
|
-
|
|
11819
|
-
|
|
11820
|
-
|
|
11821
|
-
|
|
11490
|
+
function extractDefs(ctx, schema) {
|
|
11491
|
+
const root = ctx.seen.get(schema);
|
|
11492
|
+
if (!root)
|
|
11493
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
11494
|
+
const idToSchema = /* @__PURE__ */ new Map();
|
|
11495
|
+
for (const entry of ctx.seen.entries()) {
|
|
11496
|
+
const id = ctx.metadataRegistry.get(entry[0])?.id;
|
|
11497
|
+
if (id) {
|
|
11498
|
+
const existing = idToSchema.get(id);
|
|
11499
|
+
if (existing && existing !== entry[0]) {
|
|
11500
|
+
throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
11501
|
+
}
|
|
11502
|
+
idToSchema.set(id, entry[0]);
|
|
11503
|
+
}
|
|
11504
|
+
}
|
|
11505
|
+
const makeURI = (entry) => {
|
|
11506
|
+
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
11507
|
+
if (ctx.external) {
|
|
11508
|
+
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
11509
|
+
const uriGenerator = ctx.external.uri ?? ((id2) => id2);
|
|
11510
|
+
if (externalId) {
|
|
11511
|
+
return { ref: uriGenerator(externalId) };
|
|
11512
|
+
}
|
|
11513
|
+
const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
11514
|
+
entry[1].defId = id;
|
|
11515
|
+
return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
|
|
11516
|
+
}
|
|
11517
|
+
if (entry[1] === root) {
|
|
11518
|
+
return { ref: "#" };
|
|
11519
|
+
}
|
|
11520
|
+
const uriPrefix = `#`;
|
|
11521
|
+
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
|
|
11522
|
+
const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
|
|
11523
|
+
return { defId, ref: defUriPrefix + defId };
|
|
11524
|
+
};
|
|
11525
|
+
const extractToDef = (entry) => {
|
|
11526
|
+
if (entry[1].schema.$ref) {
|
|
11527
|
+
return;
|
|
11528
|
+
}
|
|
11529
|
+
const seen = entry[1];
|
|
11530
|
+
const { ref, defId } = makeURI(entry);
|
|
11531
|
+
seen.def = { ...seen.schema };
|
|
11532
|
+
if (defId)
|
|
11533
|
+
seen.defId = defId;
|
|
11534
|
+
const schema2 = seen.schema;
|
|
11535
|
+
for (const key in schema2) {
|
|
11536
|
+
delete schema2[key];
|
|
11537
|
+
}
|
|
11538
|
+
schema2.$ref = ref;
|
|
11539
|
+
};
|
|
11540
|
+
if (ctx.cycles === "throw") {
|
|
11541
|
+
for (const entry of ctx.seen.entries()) {
|
|
11542
|
+
const seen = entry[1];
|
|
11543
|
+
if (seen.cycle) {
|
|
11544
|
+
throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
|
|
11545
|
+
|
|
11546
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
11547
|
+
}
|
|
11548
|
+
}
|
|
11549
|
+
}
|
|
11550
|
+
for (const entry of ctx.seen.entries()) {
|
|
11551
|
+
const seen = entry[1];
|
|
11552
|
+
if (schema === entry[0]) {
|
|
11553
|
+
extractToDef(entry);
|
|
11554
|
+
continue;
|
|
11555
|
+
}
|
|
11556
|
+
if (ctx.external) {
|
|
11557
|
+
const ext = ctx.external.registry.get(entry[0])?.id;
|
|
11558
|
+
if (schema !== entry[0] && ext) {
|
|
11559
|
+
extractToDef(entry);
|
|
11560
|
+
continue;
|
|
11561
|
+
}
|
|
11562
|
+
}
|
|
11563
|
+
const id = ctx.metadataRegistry.get(entry[0])?.id;
|
|
11564
|
+
if (id) {
|
|
11565
|
+
extractToDef(entry);
|
|
11566
|
+
continue;
|
|
11567
|
+
}
|
|
11568
|
+
if (seen.cycle) {
|
|
11569
|
+
extractToDef(entry);
|
|
11570
|
+
continue;
|
|
11571
|
+
}
|
|
11572
|
+
if (seen.count > 1) {
|
|
11573
|
+
if (ctx.reused === "ref") {
|
|
11574
|
+
extractToDef(entry);
|
|
11575
|
+
continue;
|
|
11576
|
+
}
|
|
11577
|
+
}
|
|
11578
|
+
}
|
|
11822
11579
|
}
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
|
|
11826
|
-
|
|
11827
|
-
|
|
11828
|
-
|
|
11829
|
-
|
|
11580
|
+
function finalize(ctx, schema) {
|
|
11581
|
+
const root = ctx.seen.get(schema);
|
|
11582
|
+
if (!root)
|
|
11583
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
11584
|
+
const flattenRef = (zodSchema) => {
|
|
11585
|
+
const seen = ctx.seen.get(zodSchema);
|
|
11586
|
+
if (seen.ref === null)
|
|
11587
|
+
return;
|
|
11588
|
+
const schema2 = seen.def ?? seen.schema;
|
|
11589
|
+
const _cached = { ...schema2 };
|
|
11590
|
+
const ref = seen.ref;
|
|
11591
|
+
seen.ref = null;
|
|
11592
|
+
if (ref) {
|
|
11593
|
+
flattenRef(ref);
|
|
11594
|
+
const refSeen = ctx.seen.get(ref);
|
|
11595
|
+
const refSchema = refSeen.schema;
|
|
11596
|
+
if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
|
|
11597
|
+
schema2.allOf = schema2.allOf ?? [];
|
|
11598
|
+
schema2.allOf.push(refSchema);
|
|
11599
|
+
} else {
|
|
11600
|
+
Object.assign(schema2, refSchema);
|
|
11601
|
+
}
|
|
11602
|
+
Object.assign(schema2, _cached);
|
|
11603
|
+
const isParentRef = zodSchema._zod.parent === ref;
|
|
11604
|
+
if (isParentRef) {
|
|
11605
|
+
for (const key in schema2) {
|
|
11606
|
+
if (key === "$ref" || key === "allOf")
|
|
11607
|
+
continue;
|
|
11608
|
+
if (!(key in _cached)) {
|
|
11609
|
+
delete schema2[key];
|
|
11610
|
+
}
|
|
11611
|
+
}
|
|
11612
|
+
}
|
|
11613
|
+
if (refSchema.$ref && refSeen.def) {
|
|
11614
|
+
for (const key in schema2) {
|
|
11615
|
+
if (key === "$ref" || key === "allOf")
|
|
11616
|
+
continue;
|
|
11617
|
+
if (key in refSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(refSeen.def[key])) {
|
|
11618
|
+
delete schema2[key];
|
|
11619
|
+
}
|
|
11620
|
+
}
|
|
11621
|
+
}
|
|
11622
|
+
}
|
|
11623
|
+
const parent = zodSchema._zod.parent;
|
|
11624
|
+
if (parent && parent !== ref) {
|
|
11625
|
+
flattenRef(parent);
|
|
11626
|
+
const parentSeen = ctx.seen.get(parent);
|
|
11627
|
+
if (parentSeen?.schema.$ref) {
|
|
11628
|
+
schema2.$ref = parentSeen.schema.$ref;
|
|
11629
|
+
if (parentSeen.def) {
|
|
11630
|
+
for (const key in schema2) {
|
|
11631
|
+
if (key === "$ref" || key === "allOf")
|
|
11632
|
+
continue;
|
|
11633
|
+
if (key in parentSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(parentSeen.def[key])) {
|
|
11634
|
+
delete schema2[key];
|
|
11635
|
+
}
|
|
11636
|
+
}
|
|
11637
|
+
}
|
|
11638
|
+
}
|
|
11639
|
+
}
|
|
11640
|
+
ctx.override({
|
|
11641
|
+
zodSchema,
|
|
11642
|
+
jsonSchema: schema2,
|
|
11643
|
+
path: seen.path ?? []
|
|
11644
|
+
});
|
|
11645
|
+
};
|
|
11646
|
+
for (const entry of [...ctx.seen.entries()].reverse()) {
|
|
11647
|
+
flattenRef(entry[0]);
|
|
11648
|
+
}
|
|
11649
|
+
const result = {};
|
|
11650
|
+
if (ctx.target === "draft-2020-12") {
|
|
11651
|
+
result.$schema = "https://json-schema.org/draft/2020-12/schema";
|
|
11652
|
+
} else if (ctx.target === "draft-07") {
|
|
11653
|
+
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
11654
|
+
} else if (ctx.target === "draft-04") {
|
|
11655
|
+
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
11656
|
+
} else if (ctx.target === "openapi-3.0") {
|
|
11657
|
+
} else {
|
|
11658
|
+
}
|
|
11659
|
+
if (ctx.external?.uri) {
|
|
11660
|
+
const id = ctx.external.registry.get(schema)?.id;
|
|
11661
|
+
if (!id)
|
|
11662
|
+
throw new Error("Schema is missing an `id` property");
|
|
11663
|
+
result.$id = ctx.external.uri(id);
|
|
11664
|
+
}
|
|
11665
|
+
Object.assign(result, root.def ?? root.schema);
|
|
11666
|
+
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
11667
|
+
if (rootMetaId !== void 0 && result.id === rootMetaId)
|
|
11668
|
+
delete result.id;
|
|
11669
|
+
const defs = ctx.external?.defs ?? {};
|
|
11670
|
+
for (const entry of ctx.seen.entries()) {
|
|
11671
|
+
const seen = entry[1];
|
|
11672
|
+
if (seen.def && seen.defId) {
|
|
11673
|
+
if (seen.def.id === seen.defId)
|
|
11674
|
+
delete seen.def.id;
|
|
11675
|
+
defs[seen.defId] = seen.def;
|
|
11676
|
+
}
|
|
11677
|
+
}
|
|
11678
|
+
if (ctx.external) {
|
|
11679
|
+
} else {
|
|
11680
|
+
if (Object.keys(defs).length > 0) {
|
|
11681
|
+
if (ctx.target === "draft-2020-12") {
|
|
11682
|
+
result.$defs = defs;
|
|
11683
|
+
} else {
|
|
11684
|
+
result.definitions = defs;
|
|
11685
|
+
}
|
|
11686
|
+
}
|
|
11687
|
+
}
|
|
11688
|
+
try {
|
|
11689
|
+
const finalized = JSON.parse(JSON.stringify(result));
|
|
11690
|
+
Object.defineProperty(finalized, "~standard", {
|
|
11691
|
+
value: {
|
|
11692
|
+
...schema["~standard"],
|
|
11693
|
+
jsonSchema: {
|
|
11694
|
+
input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
|
|
11695
|
+
output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
|
|
11696
|
+
}
|
|
11697
|
+
},
|
|
11698
|
+
enumerable: false,
|
|
11699
|
+
writable: false
|
|
11700
|
+
});
|
|
11701
|
+
return finalized;
|
|
11702
|
+
} catch (_err) {
|
|
11703
|
+
throw new Error("Error converting schema to JSON.");
|
|
11704
|
+
}
|
|
11830
11705
|
}
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
|
|
11706
|
+
function isTransforming(_schema, _ctx) {
|
|
11707
|
+
const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
|
|
11708
|
+
if (ctx.seen.has(_schema))
|
|
11709
|
+
return false;
|
|
11710
|
+
ctx.seen.add(_schema);
|
|
11711
|
+
const def = _schema._zod.def;
|
|
11712
|
+
if (def.type === "transform")
|
|
11713
|
+
return true;
|
|
11714
|
+
if (def.type === "array")
|
|
11715
|
+
return isTransforming(def.element, ctx);
|
|
11716
|
+
if (def.type === "set")
|
|
11717
|
+
return isTransforming(def.valueType, ctx);
|
|
11718
|
+
if (def.type === "lazy")
|
|
11719
|
+
return isTransforming(def.getter(), ctx);
|
|
11720
|
+
if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") {
|
|
11721
|
+
return isTransforming(def.innerType, ctx);
|
|
11722
|
+
}
|
|
11723
|
+
if (def.type === "intersection") {
|
|
11724
|
+
return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
|
|
11725
|
+
}
|
|
11726
|
+
if (def.type === "record" || def.type === "map") {
|
|
11727
|
+
return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
|
|
11728
|
+
}
|
|
11729
|
+
if (def.type === "pipe") {
|
|
11730
|
+
if (_schema._zod.traits.has("$ZodCodec"))
|
|
11731
|
+
return true;
|
|
11732
|
+
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
|
|
11733
|
+
}
|
|
11734
|
+
if (def.type === "object") {
|
|
11735
|
+
for (const key in def.shape) {
|
|
11736
|
+
if (isTransforming(def.shape[key], ctx))
|
|
11737
|
+
return true;
|
|
11738
|
+
}
|
|
11739
|
+
return false;
|
|
11740
|
+
}
|
|
11741
|
+
if (def.type === "union") {
|
|
11742
|
+
for (const option of def.options) {
|
|
11743
|
+
if (isTransforming(option, ctx))
|
|
11744
|
+
return true;
|
|
11745
|
+
}
|
|
11746
|
+
return false;
|
|
11747
|
+
}
|
|
11748
|
+
if (def.type === "tuple") {
|
|
11749
|
+
for (const item of def.items) {
|
|
11750
|
+
if (isTransforming(item, ctx))
|
|
11751
|
+
return true;
|
|
11752
|
+
}
|
|
11753
|
+
if (def.rest && isTransforming(def.rest, ctx))
|
|
11754
|
+
return true;
|
|
11755
|
+
return false;
|
|
11756
|
+
}
|
|
11757
|
+
return false;
|
|
11837
11758
|
}
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11759
|
+
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
11760
|
+
const ctx = initializeContext({ ...params, processors });
|
|
11761
|
+
process(schema, ctx);
|
|
11762
|
+
extractDefs(ctx, schema);
|
|
11763
|
+
return finalize(ctx, schema);
|
|
11764
|
+
};
|
|
11765
|
+
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
11766
|
+
const { libraryOptions, target } = params ?? {};
|
|
11767
|
+
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
11768
|
+
process(schema, ctx);
|
|
11769
|
+
extractDefs(ctx, schema);
|
|
11770
|
+
return finalize(ctx, schema);
|
|
11771
|
+
};
|
|
11772
|
+
|
|
11773
|
+
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
|
|
11774
|
+
var formatMap = {
|
|
11775
|
+
guid: "uuid",
|
|
11776
|
+
url: "uri",
|
|
11777
|
+
datetime: "date-time",
|
|
11778
|
+
json_string: "json-string",
|
|
11779
|
+
regex: ""
|
|
11780
|
+
// do not set
|
|
11781
|
+
};
|
|
11782
|
+
var stringProcessor = (schema, ctx, _json, _params) => {
|
|
11783
|
+
const json2 = _json;
|
|
11784
|
+
json2.type = "string";
|
|
11785
|
+
const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
|
|
11786
|
+
if (typeof minimum === "number")
|
|
11787
|
+
json2.minLength = minimum;
|
|
11788
|
+
if (typeof maximum === "number")
|
|
11789
|
+
json2.maxLength = maximum;
|
|
11790
|
+
if (format) {
|
|
11791
|
+
json2.format = formatMap[format] ?? format;
|
|
11792
|
+
if (json2.format === "")
|
|
11793
|
+
delete json2.format;
|
|
11794
|
+
if (format === "time") {
|
|
11795
|
+
delete json2.format;
|
|
11796
|
+
}
|
|
11797
|
+
}
|
|
11798
|
+
if (contentEncoding)
|
|
11799
|
+
json2.contentEncoding = contentEncoding;
|
|
11800
|
+
if (patterns && patterns.size > 0) {
|
|
11801
|
+
const regexes = [...patterns];
|
|
11802
|
+
if (regexes.length === 1)
|
|
11803
|
+
json2.pattern = regexes[0].source;
|
|
11804
|
+
else if (regexes.length > 1) {
|
|
11805
|
+
json2.allOf = [
|
|
11806
|
+
...regexes.map((regex) => ({
|
|
11807
|
+
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
11808
|
+
pattern: regex.source
|
|
11809
|
+
}))
|
|
11810
|
+
];
|
|
11811
|
+
}
|
|
11812
|
+
}
|
|
11813
|
+
};
|
|
11814
|
+
var numberProcessor = (schema, ctx, _json, _params) => {
|
|
11815
|
+
const json2 = _json;
|
|
11816
|
+
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
|
|
11817
|
+
if (typeof format === "string" && format.includes("int"))
|
|
11818
|
+
json2.type = "integer";
|
|
11819
|
+
else
|
|
11820
|
+
json2.type = "number";
|
|
11821
|
+
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
11822
|
+
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
11823
|
+
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
11824
|
+
if (exMin) {
|
|
11825
|
+
if (legacy) {
|
|
11826
|
+
json2.minimum = exclusiveMinimum;
|
|
11827
|
+
json2.exclusiveMinimum = true;
|
|
11828
|
+
} else {
|
|
11829
|
+
json2.exclusiveMinimum = exclusiveMinimum;
|
|
11830
|
+
}
|
|
11831
|
+
} else if (typeof minimum === "number") {
|
|
11832
|
+
json2.minimum = minimum;
|
|
11833
|
+
}
|
|
11834
|
+
if (exMax) {
|
|
11835
|
+
if (legacy) {
|
|
11836
|
+
json2.maximum = exclusiveMaximum;
|
|
11837
|
+
json2.exclusiveMaximum = true;
|
|
11838
|
+
} else {
|
|
11839
|
+
json2.exclusiveMaximum = exclusiveMaximum;
|
|
11840
|
+
}
|
|
11841
|
+
} else if (typeof maximum === "number") {
|
|
11842
|
+
json2.maximum = maximum;
|
|
11843
|
+
}
|
|
11844
|
+
if (typeof multipleOf === "number")
|
|
11845
|
+
json2.multipleOf = multipleOf;
|
|
11846
|
+
};
|
|
11847
|
+
var booleanProcessor = (_schema, _ctx, json2, _params) => {
|
|
11848
|
+
json2.type = "boolean";
|
|
11849
|
+
};
|
|
11850
|
+
var bigintProcessor = (_schema, ctx, _json, _params) => {
|
|
11851
|
+
if (ctx.unrepresentable === "throw") {
|
|
11852
|
+
throw new Error("BigInt cannot be represented in JSON Schema");
|
|
11853
|
+
}
|
|
11854
|
+
};
|
|
11855
|
+
var symbolProcessor = (_schema, ctx, _json, _params) => {
|
|
11856
|
+
if (ctx.unrepresentable === "throw") {
|
|
11857
|
+
throw new Error("Symbols cannot be represented in JSON Schema");
|
|
11858
|
+
}
|
|
11859
|
+
};
|
|
11860
|
+
var nullProcessor = (_schema, ctx, json2, _params) => {
|
|
11861
|
+
if (ctx.target === "openapi-3.0") {
|
|
11862
|
+
json2.type = "string";
|
|
11863
|
+
json2.nullable = true;
|
|
11864
|
+
json2.enum = [null];
|
|
11865
|
+
} else {
|
|
11866
|
+
json2.type = "null";
|
|
11867
|
+
}
|
|
11868
|
+
};
|
|
11869
|
+
var undefinedProcessor = (_schema, ctx, _json, _params) => {
|
|
11870
|
+
if (ctx.unrepresentable === "throw") {
|
|
11871
|
+
throw new Error("Undefined cannot be represented in JSON Schema");
|
|
11872
|
+
}
|
|
11873
|
+
};
|
|
11874
|
+
var voidProcessor = (_schema, ctx, _json, _params) => {
|
|
11875
|
+
if (ctx.unrepresentable === "throw") {
|
|
11876
|
+
throw new Error("Void cannot be represented in JSON Schema");
|
|
11877
|
+
}
|
|
11878
|
+
};
|
|
11879
|
+
var neverProcessor = (_schema, _ctx, json2, _params) => {
|
|
11880
|
+
json2.not = {};
|
|
11881
|
+
};
|
|
11882
|
+
var anyProcessor = (_schema, _ctx, _json, _params) => {
|
|
11883
|
+
};
|
|
11884
|
+
var unknownProcessor = (_schema, _ctx, _json, _params) => {
|
|
11885
|
+
};
|
|
11886
|
+
var dateProcessor = (_schema, ctx, _json, _params) => {
|
|
11887
|
+
if (ctx.unrepresentable === "throw") {
|
|
11888
|
+
throw new Error("Date cannot be represented in JSON Schema");
|
|
11889
|
+
}
|
|
11890
|
+
};
|
|
11891
|
+
var enumProcessor = (schema, _ctx, json2, _params) => {
|
|
11892
|
+
const def = schema._zod.def;
|
|
11893
|
+
const values = getEnumValues(def.entries);
|
|
11894
|
+
if (values.every((v) => typeof v === "number"))
|
|
11895
|
+
json2.type = "number";
|
|
11896
|
+
if (values.every((v) => typeof v === "string"))
|
|
11897
|
+
json2.type = "string";
|
|
11898
|
+
json2.enum = values;
|
|
11899
|
+
};
|
|
11900
|
+
var literalProcessor = (schema, ctx, json2, _params) => {
|
|
11901
|
+
const def = schema._zod.def;
|
|
11902
|
+
const vals = [];
|
|
11903
|
+
for (const val of def.values) {
|
|
11904
|
+
if (val === void 0) {
|
|
11905
|
+
if (ctx.unrepresentable === "throw") {
|
|
11906
|
+
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
11907
|
+
} else {
|
|
11908
|
+
}
|
|
11909
|
+
} else if (typeof val === "bigint") {
|
|
11910
|
+
if (ctx.unrepresentable === "throw") {
|
|
11911
|
+
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
11912
|
+
} else {
|
|
11913
|
+
vals.push(Number(val));
|
|
11914
|
+
}
|
|
11915
|
+
} else {
|
|
11916
|
+
vals.push(val);
|
|
11917
|
+
}
|
|
11918
|
+
}
|
|
11919
|
+
if (vals.length === 0) {
|
|
11920
|
+
} else if (vals.length === 1) {
|
|
11921
|
+
const val = vals[0];
|
|
11922
|
+
json2.type = val === null ? "null" : typeof val;
|
|
11923
|
+
if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
|
|
11924
|
+
json2.enum = [val];
|
|
11925
|
+
} else {
|
|
11926
|
+
json2.const = val;
|
|
11927
|
+
}
|
|
11928
|
+
} else {
|
|
11929
|
+
if (vals.every((v) => typeof v === "number"))
|
|
11930
|
+
json2.type = "number";
|
|
11931
|
+
if (vals.every((v) => typeof v === "string"))
|
|
11932
|
+
json2.type = "string";
|
|
11933
|
+
if (vals.every((v) => typeof v === "boolean"))
|
|
11934
|
+
json2.type = "boolean";
|
|
11935
|
+
if (vals.every((v) => v === null))
|
|
11936
|
+
json2.type = "null";
|
|
11937
|
+
json2.enum = vals;
|
|
11938
|
+
}
|
|
11939
|
+
};
|
|
11940
|
+
var nanProcessor = (_schema, ctx, _json, _params) => {
|
|
11941
|
+
if (ctx.unrepresentable === "throw") {
|
|
11942
|
+
throw new Error("NaN cannot be represented in JSON Schema");
|
|
11943
|
+
}
|
|
11944
|
+
};
|
|
11945
|
+
var templateLiteralProcessor = (schema, _ctx, json2, _params) => {
|
|
11946
|
+
const _json = json2;
|
|
11947
|
+
const pattern = schema._zod.pattern;
|
|
11948
|
+
if (!pattern)
|
|
11949
|
+
throw new Error("Pattern not found in template literal");
|
|
11950
|
+
_json.type = "string";
|
|
11951
|
+
_json.pattern = pattern.source;
|
|
11952
|
+
};
|
|
11953
|
+
var fileProcessor = (schema, _ctx, json2, _params) => {
|
|
11954
|
+
const _json = json2;
|
|
11955
|
+
const file2 = {
|
|
11956
|
+
type: "string",
|
|
11957
|
+
format: "binary",
|
|
11958
|
+
contentEncoding: "binary"
|
|
11959
|
+
};
|
|
11960
|
+
const { minimum, maximum, mime } = schema._zod.bag;
|
|
11961
|
+
if (minimum !== void 0)
|
|
11962
|
+
file2.minLength = minimum;
|
|
11963
|
+
if (maximum !== void 0)
|
|
11964
|
+
file2.maxLength = maximum;
|
|
11965
|
+
if (mime) {
|
|
11966
|
+
if (mime.length === 1) {
|
|
11967
|
+
file2.contentMediaType = mime[0];
|
|
11968
|
+
Object.assign(_json, file2);
|
|
11969
|
+
} else {
|
|
11970
|
+
Object.assign(_json, file2);
|
|
11971
|
+
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
11972
|
+
}
|
|
11973
|
+
} else {
|
|
11974
|
+
Object.assign(_json, file2);
|
|
11975
|
+
}
|
|
11976
|
+
};
|
|
11977
|
+
var successProcessor = (_schema, _ctx, json2, _params) => {
|
|
11978
|
+
json2.type = "boolean";
|
|
11979
|
+
};
|
|
11980
|
+
var customProcessor = (_schema, ctx, _json, _params) => {
|
|
11981
|
+
if (ctx.unrepresentable === "throw") {
|
|
11982
|
+
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
11983
|
+
}
|
|
11984
|
+
};
|
|
11985
|
+
var functionProcessor = (_schema, ctx, _json, _params) => {
|
|
11986
|
+
if (ctx.unrepresentable === "throw") {
|
|
11987
|
+
throw new Error("Function types cannot be represented in JSON Schema");
|
|
11988
|
+
}
|
|
11989
|
+
};
|
|
11990
|
+
var transformProcessor = (_schema, ctx, _json, _params) => {
|
|
11991
|
+
if (ctx.unrepresentable === "throw") {
|
|
11992
|
+
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
11993
|
+
}
|
|
11994
|
+
};
|
|
11995
|
+
var mapProcessor = (_schema, ctx, _json, _params) => {
|
|
11996
|
+
if (ctx.unrepresentable === "throw") {
|
|
11997
|
+
throw new Error("Map cannot be represented in JSON Schema");
|
|
11998
|
+
}
|
|
11999
|
+
};
|
|
12000
|
+
var setProcessor = (_schema, ctx, _json, _params) => {
|
|
12001
|
+
if (ctx.unrepresentable === "throw") {
|
|
12002
|
+
throw new Error("Set cannot be represented in JSON Schema");
|
|
12003
|
+
}
|
|
12004
|
+
};
|
|
12005
|
+
var arrayProcessor = (schema, ctx, _json, params) => {
|
|
12006
|
+
const json2 = _json;
|
|
12007
|
+
const def = schema._zod.def;
|
|
12008
|
+
const { minimum, maximum } = schema._zod.bag;
|
|
12009
|
+
if (typeof minimum === "number")
|
|
12010
|
+
json2.minItems = minimum;
|
|
12011
|
+
if (typeof maximum === "number")
|
|
12012
|
+
json2.maxItems = maximum;
|
|
12013
|
+
json2.type = "array";
|
|
12014
|
+
json2.items = process(def.element, ctx, {
|
|
12015
|
+
...params,
|
|
12016
|
+
path: [...params.path, "items"]
|
|
11843
12017
|
});
|
|
11844
|
-
}
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
|
|
12018
|
+
};
|
|
12019
|
+
var objectProcessor = (schema, ctx, _json, params) => {
|
|
12020
|
+
const json2 = _json;
|
|
12021
|
+
const def = schema._zod.def;
|
|
12022
|
+
json2.type = "object";
|
|
12023
|
+
json2.properties = {};
|
|
12024
|
+
const shape = def.shape;
|
|
12025
|
+
for (const key in shape) {
|
|
12026
|
+
json2.properties[key] = process(shape[key], ctx, {
|
|
12027
|
+
...params,
|
|
12028
|
+
path: [...params.path, "properties", key]
|
|
12029
|
+
});
|
|
12030
|
+
}
|
|
12031
|
+
const allKeys = new Set(Object.keys(shape));
|
|
12032
|
+
const requiredKeys = new Set([...allKeys].filter((key) => {
|
|
12033
|
+
const v = def.shape[key]._zod;
|
|
12034
|
+
if (ctx.io === "input") {
|
|
12035
|
+
return v.optin === void 0;
|
|
12036
|
+
} else {
|
|
12037
|
+
return v.optout === void 0;
|
|
12038
|
+
}
|
|
12039
|
+
}));
|
|
12040
|
+
if (requiredKeys.size > 0) {
|
|
12041
|
+
json2.required = Array.from(requiredKeys);
|
|
12042
|
+
}
|
|
12043
|
+
if (def.catchall?._zod.def.type === "never") {
|
|
12044
|
+
json2.additionalProperties = false;
|
|
12045
|
+
} else if (!def.catchall) {
|
|
12046
|
+
if (ctx.io === "output")
|
|
12047
|
+
json2.additionalProperties = false;
|
|
12048
|
+
} else if (def.catchall) {
|
|
12049
|
+
json2.additionalProperties = process(def.catchall, ctx, {
|
|
12050
|
+
...params,
|
|
12051
|
+
path: [...params.path, "additionalProperties"]
|
|
12052
|
+
});
|
|
12053
|
+
}
|
|
12054
|
+
};
|
|
12055
|
+
var unionProcessor = (schema, ctx, json2, params) => {
|
|
12056
|
+
const def = schema._zod.def;
|
|
12057
|
+
const isExclusive = def.inclusive === false;
|
|
12058
|
+
const options = def.options.map((x, i) => process(x, ctx, {
|
|
12059
|
+
...params,
|
|
12060
|
+
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
12061
|
+
}));
|
|
12062
|
+
if (isExclusive) {
|
|
12063
|
+
json2.oneOf = options;
|
|
12064
|
+
} else {
|
|
12065
|
+
json2.anyOf = options;
|
|
12066
|
+
}
|
|
12067
|
+
};
|
|
12068
|
+
var intersectionProcessor = (schema, ctx, json2, params) => {
|
|
12069
|
+
const def = schema._zod.def;
|
|
12070
|
+
const a = process(def.left, ctx, {
|
|
12071
|
+
...params,
|
|
12072
|
+
path: [...params.path, "allOf", 0]
|
|
11850
12073
|
});
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11854
|
-
return new Class2({
|
|
11855
|
-
type: "nullable",
|
|
11856
|
-
innerType
|
|
12074
|
+
const b = process(def.right, ctx, {
|
|
12075
|
+
...params,
|
|
12076
|
+
path: [...params.path, "allOf", 1]
|
|
11857
12077
|
});
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
12078
|
+
const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
|
|
12079
|
+
const allOf = [
|
|
12080
|
+
...isSimpleIntersection(a) ? a.allOf : [a],
|
|
12081
|
+
...isSimpleIntersection(b) ? b.allOf : [b]
|
|
12082
|
+
];
|
|
12083
|
+
json2.allOf = allOf;
|
|
12084
|
+
};
|
|
12085
|
+
var tupleProcessor = (schema, ctx, _json, params) => {
|
|
12086
|
+
const json2 = _json;
|
|
12087
|
+
const def = schema._zod.def;
|
|
12088
|
+
json2.type = "array";
|
|
12089
|
+
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
12090
|
+
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
12091
|
+
const prefixItems = def.items.map((x, i) => process(x, ctx, {
|
|
12092
|
+
...params,
|
|
12093
|
+
path: [...params.path, prefixPath, i]
|
|
12094
|
+
}));
|
|
12095
|
+
const rest = def.rest ? process(def.rest, ctx, {
|
|
12096
|
+
...params,
|
|
12097
|
+
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
12098
|
+
}) : null;
|
|
12099
|
+
if (ctx.target === "draft-2020-12") {
|
|
12100
|
+
json2.prefixItems = prefixItems;
|
|
12101
|
+
if (rest) {
|
|
12102
|
+
json2.items = rest;
|
|
12103
|
+
}
|
|
12104
|
+
} else if (ctx.target === "openapi-3.0") {
|
|
12105
|
+
json2.items = {
|
|
12106
|
+
anyOf: prefixItems
|
|
12107
|
+
};
|
|
12108
|
+
if (rest) {
|
|
12109
|
+
json2.items.anyOf.push(rest);
|
|
12110
|
+
}
|
|
12111
|
+
json2.minItems = prefixItems.length;
|
|
12112
|
+
if (!rest) {
|
|
12113
|
+
json2.maxItems = prefixItems.length;
|
|
12114
|
+
}
|
|
12115
|
+
} else {
|
|
12116
|
+
json2.items = prefixItems;
|
|
12117
|
+
if (rest) {
|
|
12118
|
+
json2.additionalItems = rest;
|
|
12119
|
+
}
|
|
12120
|
+
}
|
|
12121
|
+
const { minimum, maximum } = schema._zod.bag;
|
|
12122
|
+
if (typeof minimum === "number")
|
|
12123
|
+
json2.minItems = minimum;
|
|
12124
|
+
if (typeof maximum === "number")
|
|
12125
|
+
json2.maxItems = maximum;
|
|
12126
|
+
};
|
|
12127
|
+
var recordProcessor = (schema, ctx, _json, params) => {
|
|
12128
|
+
const json2 = _json;
|
|
12129
|
+
const def = schema._zod.def;
|
|
12130
|
+
json2.type = "object";
|
|
12131
|
+
const keyType = def.keyType;
|
|
12132
|
+
const keyBag = keyType._zod.bag;
|
|
12133
|
+
const patterns = keyBag?.patterns;
|
|
12134
|
+
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
12135
|
+
const valueSchema = process(def.valueType, ctx, {
|
|
12136
|
+
...params,
|
|
12137
|
+
path: [...params.path, "patternProperties", "*"]
|
|
12138
|
+
});
|
|
12139
|
+
json2.patternProperties = {};
|
|
12140
|
+
for (const pattern of patterns) {
|
|
12141
|
+
json2.patternProperties[pattern.source] = valueSchema;
|
|
12142
|
+
}
|
|
12143
|
+
} else {
|
|
12144
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
12145
|
+
json2.propertyNames = process(def.keyType, ctx, {
|
|
12146
|
+
...params,
|
|
12147
|
+
path: [...params.path, "propertyNames"]
|
|
12148
|
+
});
|
|
12149
|
+
}
|
|
12150
|
+
json2.additionalProperties = process(def.valueType, ctx, {
|
|
12151
|
+
...params,
|
|
12152
|
+
path: [...params.path, "additionalProperties"]
|
|
12153
|
+
});
|
|
12154
|
+
}
|
|
12155
|
+
const keyValues = keyType._zod.values;
|
|
12156
|
+
if (keyValues) {
|
|
12157
|
+
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
12158
|
+
if (validKeyValues.length > 0) {
|
|
12159
|
+
json2.required = validKeyValues;
|
|
12160
|
+
}
|
|
12161
|
+
}
|
|
12162
|
+
};
|
|
12163
|
+
var nullableProcessor = (schema, ctx, json2, params) => {
|
|
12164
|
+
const def = schema._zod.def;
|
|
12165
|
+
const inner = process(def.innerType, ctx, params);
|
|
12166
|
+
const seen = ctx.seen.get(schema);
|
|
12167
|
+
if (ctx.target === "openapi-3.0") {
|
|
12168
|
+
seen.ref = def.innerType;
|
|
12169
|
+
json2.nullable = true;
|
|
12170
|
+
} else {
|
|
12171
|
+
json2.anyOf = [inner, { type: "null" }];
|
|
12172
|
+
}
|
|
12173
|
+
};
|
|
12174
|
+
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
12175
|
+
const def = schema._zod.def;
|
|
12176
|
+
process(def.innerType, ctx, params);
|
|
12177
|
+
const seen = ctx.seen.get(schema);
|
|
12178
|
+
seen.ref = def.innerType;
|
|
12179
|
+
};
|
|
12180
|
+
var defaultProcessor = (schema, ctx, json2, params) => {
|
|
12181
|
+
const def = schema._zod.def;
|
|
12182
|
+
process(def.innerType, ctx, params);
|
|
12183
|
+
const seen = ctx.seen.get(schema);
|
|
12184
|
+
seen.ref = def.innerType;
|
|
12185
|
+
json2.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
12186
|
+
};
|
|
12187
|
+
var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
12188
|
+
const def = schema._zod.def;
|
|
12189
|
+
process(def.innerType, ctx, params);
|
|
12190
|
+
const seen = ctx.seen.get(schema);
|
|
12191
|
+
seen.ref = def.innerType;
|
|
12192
|
+
if (ctx.io === "input")
|
|
12193
|
+
json2._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
12194
|
+
};
|
|
12195
|
+
var catchProcessor = (schema, ctx, json2, params) => {
|
|
12196
|
+
const def = schema._zod.def;
|
|
12197
|
+
process(def.innerType, ctx, params);
|
|
12198
|
+
const seen = ctx.seen.get(schema);
|
|
12199
|
+
seen.ref = def.innerType;
|
|
12200
|
+
let catchValue;
|
|
12201
|
+
try {
|
|
12202
|
+
catchValue = def.catchValue(void 0);
|
|
12203
|
+
} catch {
|
|
12204
|
+
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
12205
|
+
}
|
|
12206
|
+
json2.default = catchValue;
|
|
12207
|
+
};
|
|
12208
|
+
var pipeProcessor = (schema, ctx, _json, params) => {
|
|
12209
|
+
const def = schema._zod.def;
|
|
12210
|
+
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
12211
|
+
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
12212
|
+
process(innerType, ctx, params);
|
|
12213
|
+
const seen = ctx.seen.get(schema);
|
|
12214
|
+
seen.ref = innerType;
|
|
12215
|
+
};
|
|
12216
|
+
var readonlyProcessor = (schema, ctx, json2, params) => {
|
|
12217
|
+
const def = schema._zod.def;
|
|
12218
|
+
process(def.innerType, ctx, params);
|
|
12219
|
+
const seen = ctx.seen.get(schema);
|
|
12220
|
+
seen.ref = def.innerType;
|
|
12221
|
+
json2.readOnly = true;
|
|
12222
|
+
};
|
|
12223
|
+
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
12224
|
+
const def = schema._zod.def;
|
|
12225
|
+
process(def.innerType, ctx, params);
|
|
12226
|
+
const seen = ctx.seen.get(schema);
|
|
12227
|
+
seen.ref = def.innerType;
|
|
12228
|
+
};
|
|
12229
|
+
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
12230
|
+
const def = schema._zod.def;
|
|
12231
|
+
process(def.innerType, ctx, params);
|
|
12232
|
+
const seen = ctx.seen.get(schema);
|
|
12233
|
+
seen.ref = def.innerType;
|
|
12234
|
+
};
|
|
12235
|
+
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
12236
|
+
const innerType = schema._zod.innerType;
|
|
12237
|
+
process(innerType, ctx, params);
|
|
12238
|
+
const seen = ctx.seen.get(schema);
|
|
12239
|
+
seen.ref = innerType;
|
|
12240
|
+
};
|
|
12241
|
+
var allProcessors = {
|
|
12242
|
+
string: stringProcessor,
|
|
12243
|
+
number: numberProcessor,
|
|
12244
|
+
boolean: booleanProcessor,
|
|
12245
|
+
bigint: bigintProcessor,
|
|
12246
|
+
symbol: symbolProcessor,
|
|
12247
|
+
null: nullProcessor,
|
|
12248
|
+
undefined: undefinedProcessor,
|
|
12249
|
+
void: voidProcessor,
|
|
12250
|
+
never: neverProcessor,
|
|
12251
|
+
any: anyProcessor,
|
|
12252
|
+
unknown: unknownProcessor,
|
|
12253
|
+
date: dateProcessor,
|
|
12254
|
+
enum: enumProcessor,
|
|
12255
|
+
literal: literalProcessor,
|
|
12256
|
+
nan: nanProcessor,
|
|
12257
|
+
template_literal: templateLiteralProcessor,
|
|
12258
|
+
file: fileProcessor,
|
|
12259
|
+
success: successProcessor,
|
|
12260
|
+
custom: customProcessor,
|
|
12261
|
+
function: functionProcessor,
|
|
12262
|
+
transform: transformProcessor,
|
|
12263
|
+
map: mapProcessor,
|
|
12264
|
+
set: setProcessor,
|
|
12265
|
+
array: arrayProcessor,
|
|
12266
|
+
object: objectProcessor,
|
|
12267
|
+
union: unionProcessor,
|
|
12268
|
+
intersection: intersectionProcessor,
|
|
12269
|
+
tuple: tupleProcessor,
|
|
12270
|
+
record: recordProcessor,
|
|
12271
|
+
nullable: nullableProcessor,
|
|
12272
|
+
nonoptional: nonoptionalProcessor,
|
|
12273
|
+
default: defaultProcessor,
|
|
12274
|
+
prefault: prefaultProcessor,
|
|
12275
|
+
catch: catchProcessor,
|
|
12276
|
+
pipe: pipeProcessor,
|
|
12277
|
+
readonly: readonlyProcessor,
|
|
12278
|
+
promise: promiseProcessor,
|
|
12279
|
+
optional: optionalProcessor,
|
|
12280
|
+
lazy: lazyProcessor
|
|
12281
|
+
};
|
|
12282
|
+
function toJSONSchema(input, params) {
|
|
12283
|
+
if ("_idmap" in input) {
|
|
12284
|
+
const registry3 = input;
|
|
12285
|
+
const ctx2 = initializeContext({ ...params, processors: allProcessors });
|
|
12286
|
+
const defs = {};
|
|
12287
|
+
for (const entry of registry3._idmap.entries()) {
|
|
12288
|
+
const [_, schema] = entry;
|
|
12289
|
+
process(schema, ctx2);
|
|
11866
12290
|
}
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
type: "nonoptional",
|
|
11873
|
-
innerType,
|
|
11874
|
-
...normalizeParams(params)
|
|
11875
|
-
});
|
|
11876
|
-
}
|
|
11877
|
-
// @__NO_SIDE_EFFECTS__
|
|
11878
|
-
function _success(Class2, innerType) {
|
|
11879
|
-
return new Class2({
|
|
11880
|
-
type: "success",
|
|
11881
|
-
innerType
|
|
11882
|
-
});
|
|
11883
|
-
}
|
|
11884
|
-
// @__NO_SIDE_EFFECTS__
|
|
11885
|
-
function _catch(Class2, innerType, catchValue) {
|
|
11886
|
-
return new Class2({
|
|
11887
|
-
type: "catch",
|
|
11888
|
-
innerType,
|
|
11889
|
-
catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
|
|
11890
|
-
});
|
|
11891
|
-
}
|
|
11892
|
-
// @__NO_SIDE_EFFECTS__
|
|
11893
|
-
function _pipe(Class2, in_, out) {
|
|
11894
|
-
return new Class2({
|
|
11895
|
-
type: "pipe",
|
|
11896
|
-
in: in_,
|
|
11897
|
-
out
|
|
11898
|
-
});
|
|
11899
|
-
}
|
|
11900
|
-
// @__NO_SIDE_EFFECTS__
|
|
11901
|
-
function _readonly(Class2, innerType) {
|
|
11902
|
-
return new Class2({
|
|
11903
|
-
type: "readonly",
|
|
11904
|
-
innerType
|
|
11905
|
-
});
|
|
11906
|
-
}
|
|
11907
|
-
// @__NO_SIDE_EFFECTS__
|
|
11908
|
-
function _templateLiteral(Class2, parts, params) {
|
|
11909
|
-
return new Class2({
|
|
11910
|
-
type: "template_literal",
|
|
11911
|
-
parts,
|
|
11912
|
-
...normalizeParams(params)
|
|
11913
|
-
});
|
|
11914
|
-
}
|
|
11915
|
-
// @__NO_SIDE_EFFECTS__
|
|
11916
|
-
function _lazy(Class2, getter) {
|
|
11917
|
-
return new Class2({
|
|
11918
|
-
type: "lazy",
|
|
11919
|
-
getter
|
|
11920
|
-
});
|
|
11921
|
-
}
|
|
11922
|
-
// @__NO_SIDE_EFFECTS__
|
|
11923
|
-
function _promise(Class2, innerType) {
|
|
11924
|
-
return new Class2({
|
|
11925
|
-
type: "promise",
|
|
11926
|
-
innerType
|
|
11927
|
-
});
|
|
11928
|
-
}
|
|
11929
|
-
// @__NO_SIDE_EFFECTS__
|
|
11930
|
-
function _custom(Class2, fn, _params) {
|
|
11931
|
-
const norm = normalizeParams(_params);
|
|
11932
|
-
norm.abort ?? (norm.abort = true);
|
|
11933
|
-
const schema = new Class2({
|
|
11934
|
-
type: "custom",
|
|
11935
|
-
check: "custom",
|
|
11936
|
-
fn,
|
|
11937
|
-
...norm
|
|
11938
|
-
});
|
|
11939
|
-
return schema;
|
|
11940
|
-
}
|
|
11941
|
-
// @__NO_SIDE_EFFECTS__
|
|
11942
|
-
function _refine(Class2, fn, _params) {
|
|
11943
|
-
const schema = new Class2({
|
|
11944
|
-
type: "custom",
|
|
11945
|
-
check: "custom",
|
|
11946
|
-
fn,
|
|
11947
|
-
...normalizeParams(_params)
|
|
11948
|
-
});
|
|
11949
|
-
return schema;
|
|
11950
|
-
}
|
|
11951
|
-
// @__NO_SIDE_EFFECTS__
|
|
11952
|
-
function _superRefine(fn, params) {
|
|
11953
|
-
const ch = /* @__PURE__ */ _check((payload) => {
|
|
11954
|
-
payload.addIssue = (issue2) => {
|
|
11955
|
-
if (typeof issue2 === "string") {
|
|
11956
|
-
payload.issues.push(issue(issue2, payload.value, ch._zod.def));
|
|
11957
|
-
} else {
|
|
11958
|
-
const _issue = issue2;
|
|
11959
|
-
if (_issue.fatal)
|
|
11960
|
-
_issue.continue = false;
|
|
11961
|
-
_issue.code ?? (_issue.code = "custom");
|
|
11962
|
-
_issue.input ?? (_issue.input = payload.value);
|
|
11963
|
-
_issue.inst ?? (_issue.inst = ch);
|
|
11964
|
-
_issue.continue ?? (_issue.continue = !ch._zod.def.abort);
|
|
11965
|
-
payload.issues.push(issue(_issue));
|
|
11966
|
-
}
|
|
12291
|
+
const schemas = {};
|
|
12292
|
+
const external = {
|
|
12293
|
+
registry: registry3,
|
|
12294
|
+
uri: params?.uri,
|
|
12295
|
+
defs
|
|
11967
12296
|
};
|
|
11968
|
-
|
|
11969
|
-
|
|
11970
|
-
|
|
11971
|
-
|
|
11972
|
-
|
|
11973
|
-
function _check(fn, params) {
|
|
11974
|
-
const ch = new $ZodCheck({
|
|
11975
|
-
check: "custom",
|
|
11976
|
-
...normalizeParams(params)
|
|
11977
|
-
});
|
|
11978
|
-
ch._zod.check = fn;
|
|
11979
|
-
return ch;
|
|
11980
|
-
}
|
|
11981
|
-
// @__NO_SIDE_EFFECTS__
|
|
11982
|
-
function describe(description) {
|
|
11983
|
-
const ch = new $ZodCheck({ check: "describe" });
|
|
11984
|
-
ch._zod.onattach = [
|
|
11985
|
-
(inst) => {
|
|
11986
|
-
const existing = globalRegistry.get(inst) ?? {};
|
|
11987
|
-
globalRegistry.add(inst, { ...existing, description });
|
|
12297
|
+
ctx2.external = external;
|
|
12298
|
+
for (const entry of registry3._idmap.entries()) {
|
|
12299
|
+
const [key, schema] = entry;
|
|
12300
|
+
extractDefs(ctx2, schema);
|
|
12301
|
+
schemas[key] = finalize(ctx2, schema);
|
|
11988
12302
|
}
|
|
11989
|
-
|
|
11990
|
-
|
|
11991
|
-
|
|
11992
|
-
|
|
11993
|
-
}
|
|
11994
|
-
// @__NO_SIDE_EFFECTS__
|
|
11995
|
-
function meta(metadata) {
|
|
11996
|
-
const ch = new $ZodCheck({ check: "meta" });
|
|
11997
|
-
ch._zod.onattach = [
|
|
11998
|
-
(inst) => {
|
|
11999
|
-
const existing = globalRegistry.get(inst) ?? {};
|
|
12000
|
-
globalRegistry.add(inst, { ...existing, ...metadata });
|
|
12303
|
+
if (Object.keys(defs).length > 0) {
|
|
12304
|
+
const defsSegment = ctx2.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
12305
|
+
schemas.__shared = {
|
|
12306
|
+
[defsSegment]: defs
|
|
12307
|
+
};
|
|
12001
12308
|
}
|
|
12002
|
-
|
|
12003
|
-
ch._zod.check = () => {
|
|
12004
|
-
};
|
|
12005
|
-
return ch;
|
|
12006
|
-
}
|
|
12007
|
-
// @__NO_SIDE_EFFECTS__
|
|
12008
|
-
function _stringbool(Classes, _params) {
|
|
12009
|
-
const params = normalizeParams(_params);
|
|
12010
|
-
let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"];
|
|
12011
|
-
let falsyArray = params.falsy ?? ["false", "0", "no", "off", "n", "disabled"];
|
|
12012
|
-
if (params.case !== "sensitive") {
|
|
12013
|
-
truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
|
|
12014
|
-
falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
|
|
12015
|
-
}
|
|
12016
|
-
const truthySet = new Set(truthyArray);
|
|
12017
|
-
const falsySet = new Set(falsyArray);
|
|
12018
|
-
const _Codec = Classes.Codec ?? $ZodCodec;
|
|
12019
|
-
const _Boolean = Classes.Boolean ?? $ZodBoolean;
|
|
12020
|
-
const _String = Classes.String ?? $ZodString;
|
|
12021
|
-
const stringSchema = new _String({ type: "string", error: params.error });
|
|
12022
|
-
const booleanSchema = new _Boolean({ type: "boolean", error: params.error });
|
|
12023
|
-
const codec2 = new _Codec({
|
|
12024
|
-
type: "pipe",
|
|
12025
|
-
in: stringSchema,
|
|
12026
|
-
out: booleanSchema,
|
|
12027
|
-
transform: ((input, payload) => {
|
|
12028
|
-
let data = input;
|
|
12029
|
-
if (params.case !== "sensitive")
|
|
12030
|
-
data = data.toLowerCase();
|
|
12031
|
-
if (truthySet.has(data)) {
|
|
12032
|
-
return true;
|
|
12033
|
-
} else if (falsySet.has(data)) {
|
|
12034
|
-
return false;
|
|
12035
|
-
} else {
|
|
12036
|
-
payload.issues.push({
|
|
12037
|
-
code: "invalid_value",
|
|
12038
|
-
expected: "stringbool",
|
|
12039
|
-
values: [...truthySet, ...falsySet],
|
|
12040
|
-
input: payload.value,
|
|
12041
|
-
inst: codec2,
|
|
12042
|
-
continue: false
|
|
12043
|
-
});
|
|
12044
|
-
return {};
|
|
12045
|
-
}
|
|
12046
|
-
}),
|
|
12047
|
-
reverseTransform: ((input, _payload) => {
|
|
12048
|
-
if (input === true) {
|
|
12049
|
-
return truthyArray[0] || "true";
|
|
12050
|
-
} else {
|
|
12051
|
-
return falsyArray[0] || "false";
|
|
12052
|
-
}
|
|
12053
|
-
}),
|
|
12054
|
-
error: params.error
|
|
12055
|
-
});
|
|
12056
|
-
return codec2;
|
|
12057
|
-
}
|
|
12058
|
-
// @__NO_SIDE_EFFECTS__
|
|
12059
|
-
function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
|
|
12060
|
-
const params = normalizeParams(_params);
|
|
12061
|
-
const def = {
|
|
12062
|
-
...normalizeParams(_params),
|
|
12063
|
-
check: "string_format",
|
|
12064
|
-
type: "string",
|
|
12065
|
-
format,
|
|
12066
|
-
fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
|
|
12067
|
-
...params
|
|
12068
|
-
};
|
|
12069
|
-
if (fnOrRegex instanceof RegExp) {
|
|
12070
|
-
def.pattern = fnOrRegex;
|
|
12309
|
+
return { schemas };
|
|
12071
12310
|
}
|
|
12072
|
-
const
|
|
12073
|
-
|
|
12311
|
+
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
12312
|
+
process(input, ctx);
|
|
12313
|
+
extractDefs(ctx, input);
|
|
12314
|
+
return finalize(ctx, input);
|
|
12074
12315
|
}
|
|
12075
12316
|
|
|
12076
12317
|
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-generator.js
|
|
@@ -13741,249 +13982,6 @@ function preprocess(fn, schema) {
|
|
|
13741
13982
|
});
|
|
13742
13983
|
}
|
|
13743
13984
|
|
|
13744
|
-
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
13745
|
-
var external_exports = {};
|
|
13746
|
-
__export(external_exports, {
|
|
13747
|
-
$brand: () => $brand,
|
|
13748
|
-
$input: () => $input,
|
|
13749
|
-
$output: () => $output,
|
|
13750
|
-
NEVER: () => NEVER,
|
|
13751
|
-
TimePrecision: () => TimePrecision,
|
|
13752
|
-
ZodAny: () => ZodAny,
|
|
13753
|
-
ZodArray: () => ZodArray,
|
|
13754
|
-
ZodBase64: () => ZodBase64,
|
|
13755
|
-
ZodBase64URL: () => ZodBase64URL,
|
|
13756
|
-
ZodBigInt: () => ZodBigInt,
|
|
13757
|
-
ZodBigIntFormat: () => ZodBigIntFormat,
|
|
13758
|
-
ZodBoolean: () => ZodBoolean,
|
|
13759
|
-
ZodCIDRv4: () => ZodCIDRv4,
|
|
13760
|
-
ZodCIDRv6: () => ZodCIDRv6,
|
|
13761
|
-
ZodCUID: () => ZodCUID,
|
|
13762
|
-
ZodCUID2: () => ZodCUID2,
|
|
13763
|
-
ZodCatch: () => ZodCatch,
|
|
13764
|
-
ZodCodec: () => ZodCodec,
|
|
13765
|
-
ZodCustom: () => ZodCustom,
|
|
13766
|
-
ZodCustomStringFormat: () => ZodCustomStringFormat,
|
|
13767
|
-
ZodDate: () => ZodDate,
|
|
13768
|
-
ZodDefault: () => ZodDefault,
|
|
13769
|
-
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
13770
|
-
ZodE164: () => ZodE164,
|
|
13771
|
-
ZodEmail: () => ZodEmail,
|
|
13772
|
-
ZodEmoji: () => ZodEmoji,
|
|
13773
|
-
ZodEnum: () => ZodEnum,
|
|
13774
|
-
ZodError: () => ZodError,
|
|
13775
|
-
ZodExactOptional: () => ZodExactOptional,
|
|
13776
|
-
ZodFile: () => ZodFile,
|
|
13777
|
-
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
13778
|
-
ZodFunction: () => ZodFunction,
|
|
13779
|
-
ZodGUID: () => ZodGUID,
|
|
13780
|
-
ZodIPv4: () => ZodIPv4,
|
|
13781
|
-
ZodIPv6: () => ZodIPv6,
|
|
13782
|
-
ZodISODate: () => ZodISODate,
|
|
13783
|
-
ZodISODateTime: () => ZodISODateTime,
|
|
13784
|
-
ZodISODuration: () => ZodISODuration,
|
|
13785
|
-
ZodISOTime: () => ZodISOTime,
|
|
13786
|
-
ZodIntersection: () => ZodIntersection,
|
|
13787
|
-
ZodIssueCode: () => ZodIssueCode,
|
|
13788
|
-
ZodJWT: () => ZodJWT,
|
|
13789
|
-
ZodKSUID: () => ZodKSUID,
|
|
13790
|
-
ZodLazy: () => ZodLazy,
|
|
13791
|
-
ZodLiteral: () => ZodLiteral,
|
|
13792
|
-
ZodMAC: () => ZodMAC,
|
|
13793
|
-
ZodMap: () => ZodMap,
|
|
13794
|
-
ZodNaN: () => ZodNaN,
|
|
13795
|
-
ZodNanoID: () => ZodNanoID,
|
|
13796
|
-
ZodNever: () => ZodNever,
|
|
13797
|
-
ZodNonOptional: () => ZodNonOptional,
|
|
13798
|
-
ZodNull: () => ZodNull,
|
|
13799
|
-
ZodNullable: () => ZodNullable,
|
|
13800
|
-
ZodNumber: () => ZodNumber,
|
|
13801
|
-
ZodNumberFormat: () => ZodNumberFormat,
|
|
13802
|
-
ZodObject: () => ZodObject,
|
|
13803
|
-
ZodOptional: () => ZodOptional,
|
|
13804
|
-
ZodPipe: () => ZodPipe,
|
|
13805
|
-
ZodPrefault: () => ZodPrefault,
|
|
13806
|
-
ZodPreprocess: () => ZodPreprocess,
|
|
13807
|
-
ZodPromise: () => ZodPromise,
|
|
13808
|
-
ZodReadonly: () => ZodReadonly,
|
|
13809
|
-
ZodRealError: () => ZodRealError,
|
|
13810
|
-
ZodRecord: () => ZodRecord,
|
|
13811
|
-
ZodSet: () => ZodSet,
|
|
13812
|
-
ZodString: () => ZodString,
|
|
13813
|
-
ZodStringFormat: () => ZodStringFormat,
|
|
13814
|
-
ZodSuccess: () => ZodSuccess,
|
|
13815
|
-
ZodSymbol: () => ZodSymbol,
|
|
13816
|
-
ZodTemplateLiteral: () => ZodTemplateLiteral,
|
|
13817
|
-
ZodTransform: () => ZodTransform,
|
|
13818
|
-
ZodTuple: () => ZodTuple,
|
|
13819
|
-
ZodType: () => ZodType,
|
|
13820
|
-
ZodULID: () => ZodULID,
|
|
13821
|
-
ZodURL: () => ZodURL,
|
|
13822
|
-
ZodUUID: () => ZodUUID,
|
|
13823
|
-
ZodUndefined: () => ZodUndefined,
|
|
13824
|
-
ZodUnion: () => ZodUnion,
|
|
13825
|
-
ZodUnknown: () => ZodUnknown,
|
|
13826
|
-
ZodVoid: () => ZodVoid,
|
|
13827
|
-
ZodXID: () => ZodXID,
|
|
13828
|
-
ZodXor: () => ZodXor,
|
|
13829
|
-
_ZodString: () => _ZodString,
|
|
13830
|
-
_default: () => _default2,
|
|
13831
|
-
_function: () => _function,
|
|
13832
|
-
any: () => any,
|
|
13833
|
-
array: () => array,
|
|
13834
|
-
base64: () => base642,
|
|
13835
|
-
base64url: () => base64url2,
|
|
13836
|
-
bigint: () => bigint2,
|
|
13837
|
-
boolean: () => boolean2,
|
|
13838
|
-
catch: () => _catch2,
|
|
13839
|
-
check: () => check,
|
|
13840
|
-
cidrv4: () => cidrv42,
|
|
13841
|
-
cidrv6: () => cidrv62,
|
|
13842
|
-
clone: () => clone,
|
|
13843
|
-
codec: () => codec,
|
|
13844
|
-
coerce: () => coerce_exports,
|
|
13845
|
-
config: () => config,
|
|
13846
|
-
core: () => core_exports2,
|
|
13847
|
-
cuid: () => cuid3,
|
|
13848
|
-
cuid2: () => cuid22,
|
|
13849
|
-
custom: () => custom,
|
|
13850
|
-
date: () => date3,
|
|
13851
|
-
decode: () => decode2,
|
|
13852
|
-
decodeAsync: () => decodeAsync2,
|
|
13853
|
-
describe: () => describe2,
|
|
13854
|
-
discriminatedUnion: () => discriminatedUnion,
|
|
13855
|
-
e164: () => e1642,
|
|
13856
|
-
email: () => email2,
|
|
13857
|
-
emoji: () => emoji2,
|
|
13858
|
-
encode: () => encode2,
|
|
13859
|
-
encodeAsync: () => encodeAsync2,
|
|
13860
|
-
endsWith: () => _endsWith,
|
|
13861
|
-
enum: () => _enum2,
|
|
13862
|
-
exactOptional: () => exactOptional,
|
|
13863
|
-
file: () => file,
|
|
13864
|
-
flattenError: () => flattenError,
|
|
13865
|
-
float32: () => float32,
|
|
13866
|
-
float64: () => float64,
|
|
13867
|
-
formatError: () => formatError,
|
|
13868
|
-
fromJSONSchema: () => fromJSONSchema,
|
|
13869
|
-
function: () => _function,
|
|
13870
|
-
getErrorMap: () => getErrorMap,
|
|
13871
|
-
globalRegistry: () => globalRegistry,
|
|
13872
|
-
gt: () => _gt,
|
|
13873
|
-
gte: () => _gte,
|
|
13874
|
-
guid: () => guid2,
|
|
13875
|
-
hash: () => hash,
|
|
13876
|
-
hex: () => hex2,
|
|
13877
|
-
hostname: () => hostname2,
|
|
13878
|
-
httpUrl: () => httpUrl,
|
|
13879
|
-
includes: () => _includes,
|
|
13880
|
-
instanceof: () => _instanceof,
|
|
13881
|
-
int: () => int,
|
|
13882
|
-
int32: () => int32,
|
|
13883
|
-
int64: () => int64,
|
|
13884
|
-
intersection: () => intersection,
|
|
13885
|
-
invertCodec: () => invertCodec,
|
|
13886
|
-
ipv4: () => ipv42,
|
|
13887
|
-
ipv6: () => ipv62,
|
|
13888
|
-
iso: () => iso_exports,
|
|
13889
|
-
json: () => json,
|
|
13890
|
-
jwt: () => jwt,
|
|
13891
|
-
keyof: () => keyof,
|
|
13892
|
-
ksuid: () => ksuid2,
|
|
13893
|
-
lazy: () => lazy,
|
|
13894
|
-
length: () => _length,
|
|
13895
|
-
literal: () => literal,
|
|
13896
|
-
locales: () => locales_exports,
|
|
13897
|
-
looseObject: () => looseObject,
|
|
13898
|
-
looseRecord: () => looseRecord,
|
|
13899
|
-
lowercase: () => _lowercase,
|
|
13900
|
-
lt: () => _lt,
|
|
13901
|
-
lte: () => _lte,
|
|
13902
|
-
mac: () => mac2,
|
|
13903
|
-
map: () => map,
|
|
13904
|
-
maxLength: () => _maxLength,
|
|
13905
|
-
maxSize: () => _maxSize,
|
|
13906
|
-
meta: () => meta2,
|
|
13907
|
-
mime: () => _mime,
|
|
13908
|
-
minLength: () => _minLength,
|
|
13909
|
-
minSize: () => _minSize,
|
|
13910
|
-
multipleOf: () => _multipleOf,
|
|
13911
|
-
nan: () => nan,
|
|
13912
|
-
nanoid: () => nanoid2,
|
|
13913
|
-
nativeEnum: () => nativeEnum,
|
|
13914
|
-
negative: () => _negative,
|
|
13915
|
-
never: () => never,
|
|
13916
|
-
nonnegative: () => _nonnegative,
|
|
13917
|
-
nonoptional: () => nonoptional,
|
|
13918
|
-
nonpositive: () => _nonpositive,
|
|
13919
|
-
normalize: () => _normalize,
|
|
13920
|
-
null: () => _null3,
|
|
13921
|
-
nullable: () => nullable,
|
|
13922
|
-
nullish: () => nullish2,
|
|
13923
|
-
number: () => number2,
|
|
13924
|
-
object: () => object,
|
|
13925
|
-
optional: () => optional,
|
|
13926
|
-
overwrite: () => _overwrite,
|
|
13927
|
-
parse: () => parse2,
|
|
13928
|
-
parseAsync: () => parseAsync2,
|
|
13929
|
-
partialRecord: () => partialRecord,
|
|
13930
|
-
pipe: () => pipe,
|
|
13931
|
-
positive: () => _positive,
|
|
13932
|
-
prefault: () => prefault,
|
|
13933
|
-
preprocess: () => preprocess,
|
|
13934
|
-
prettifyError: () => prettifyError,
|
|
13935
|
-
promise: () => promise,
|
|
13936
|
-
property: () => _property,
|
|
13937
|
-
readonly: () => readonly,
|
|
13938
|
-
record: () => record,
|
|
13939
|
-
refine: () => refine,
|
|
13940
|
-
regex: () => _regex,
|
|
13941
|
-
regexes: () => regexes_exports,
|
|
13942
|
-
registry: () => registry,
|
|
13943
|
-
safeDecode: () => safeDecode2,
|
|
13944
|
-
safeDecodeAsync: () => safeDecodeAsync2,
|
|
13945
|
-
safeEncode: () => safeEncode2,
|
|
13946
|
-
safeEncodeAsync: () => safeEncodeAsync2,
|
|
13947
|
-
safeParse: () => safeParse2,
|
|
13948
|
-
safeParseAsync: () => safeParseAsync2,
|
|
13949
|
-
set: () => set,
|
|
13950
|
-
setErrorMap: () => setErrorMap,
|
|
13951
|
-
size: () => _size,
|
|
13952
|
-
slugify: () => _slugify,
|
|
13953
|
-
startsWith: () => _startsWith,
|
|
13954
|
-
strictObject: () => strictObject,
|
|
13955
|
-
string: () => string2,
|
|
13956
|
-
stringFormat: () => stringFormat,
|
|
13957
|
-
stringbool: () => stringbool,
|
|
13958
|
-
success: () => success,
|
|
13959
|
-
superRefine: () => superRefine,
|
|
13960
|
-
symbol: () => symbol,
|
|
13961
|
-
templateLiteral: () => templateLiteral,
|
|
13962
|
-
toJSONSchema: () => toJSONSchema,
|
|
13963
|
-
toLowerCase: () => _toLowerCase,
|
|
13964
|
-
toUpperCase: () => _toUpperCase,
|
|
13965
|
-
transform: () => transform,
|
|
13966
|
-
treeifyError: () => treeifyError,
|
|
13967
|
-
trim: () => _trim,
|
|
13968
|
-
tuple: () => tuple,
|
|
13969
|
-
uint32: () => uint32,
|
|
13970
|
-
uint64: () => uint64,
|
|
13971
|
-
ulid: () => ulid2,
|
|
13972
|
-
undefined: () => _undefined3,
|
|
13973
|
-
union: () => union,
|
|
13974
|
-
unknown: () => unknown,
|
|
13975
|
-
uppercase: () => _uppercase,
|
|
13976
|
-
url: () => url,
|
|
13977
|
-
util: () => util_exports,
|
|
13978
|
-
uuid: () => uuid2,
|
|
13979
|
-
uuidv4: () => uuidv4,
|
|
13980
|
-
uuidv6: () => uuidv6,
|
|
13981
|
-
uuidv7: () => uuidv7,
|
|
13982
|
-
void: () => _void2,
|
|
13983
|
-
xid: () => xid2,
|
|
13984
|
-
xor: () => xor
|
|
13985
|
-
});
|
|
13986
|
-
|
|
13987
13985
|
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/compat.js
|
|
13988
13986
|
var ZodIssueCode = {
|
|
13989
13987
|
invalid_type: "invalid_type",
|
|
@@ -14518,12 +14516,14 @@ function date4(params) {
|
|
|
14518
14516
|
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
14519
14517
|
config(en_default());
|
|
14520
14518
|
|
|
14521
|
-
// web/app/dist/server/assets/chat-
|
|
14519
|
+
// web/app/dist/server/assets/chat-ScIVP5Xw.js
|
|
14522
14520
|
var MAX_ATTACHMENT_BYTES = 26214400;
|
|
14523
14521
|
var RightPanelIdSchema = external_exports.enum([
|
|
14524
14522
|
"resources",
|
|
14525
14523
|
"workspace",
|
|
14526
14524
|
"artifacts",
|
|
14525
|
+
"repl",
|
|
14526
|
+
"subagents",
|
|
14527
14527
|
"session-insights"
|
|
14528
14528
|
]);
|
|
14529
14529
|
var SessionIdSchema = external_exports.string().min(1).max(160).regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/);
|
|
@@ -14565,7 +14565,8 @@ var ProjectListResponseSchema = external_exports.object({
|
|
|
14565
14565
|
"failed"
|
|
14566
14566
|
]),
|
|
14567
14567
|
messageCount: external_exports.number().int().nonnegative(),
|
|
14568
|
-
firstMessage: external_exports.string()
|
|
14568
|
+
firstMessage: external_exports.string(),
|
|
14569
|
+
isSubagent: external_exports.boolean().optional()
|
|
14569
14570
|
}))
|
|
14570
14571
|
});
|
|
14571
14572
|
var ProjectCreateRequestSchema = external_exports.object({
|
|
@@ -14634,7 +14635,8 @@ var ChatToolPartSchema$1 = external_exports.discriminatedUnion("kind", [
|
|
|
14634
14635
|
external_exports.object({
|
|
14635
14636
|
kind: external_exports.literal("ipython"),
|
|
14636
14637
|
code: external_exports.string(),
|
|
14637
|
-
output: external_exports.string().optional()
|
|
14638
|
+
output: external_exports.string().optional(),
|
|
14639
|
+
backgroundOutput: external_exports.string().optional()
|
|
14638
14640
|
}),
|
|
14639
14641
|
external_exports.object({
|
|
14640
14642
|
kind: external_exports.literal("file"),
|
|
@@ -15384,6 +15386,24 @@ var ChatQueueEventSchema = external_exports.object({
|
|
|
15384
15386
|
steering: external_exports.array(external_exports.string()),
|
|
15385
15387
|
followUp: external_exports.array(external_exports.string())
|
|
15386
15388
|
}).openapi({ description: "Stream queue event" });
|
|
15389
|
+
var ChatQueueMutationRequestSchema = external_exports.object({
|
|
15390
|
+
sessionId: SessionIdSchema,
|
|
15391
|
+
lane: external_exports.enum(["steering", "followUp"]),
|
|
15392
|
+
index: external_exports.number().int().nonnegative(),
|
|
15393
|
+
expectedText: external_exports.string().min(1)
|
|
15394
|
+
}).openapi({ description: "Delete one queued message after verifying its expected text" });
|
|
15395
|
+
var ChatQueueMutationResponseSchema = external_exports.object({
|
|
15396
|
+
status: external_exports.enum([
|
|
15397
|
+
"applied",
|
|
15398
|
+
"rejected",
|
|
15399
|
+
"invalid",
|
|
15400
|
+
"unsupported"
|
|
15401
|
+
]),
|
|
15402
|
+
queue: external_exports.object({
|
|
15403
|
+
steering: external_exports.array(external_exports.string()),
|
|
15404
|
+
followUp: external_exports.array(external_exports.string())
|
|
15405
|
+
})
|
|
15406
|
+
}).openapi({ description: "Queued-message mutation result with an authoritative queue snapshot" });
|
|
15387
15407
|
var ChatThinkingEventSchema = external_exports.object({
|
|
15388
15408
|
type: external_exports.literal("thinking"),
|
|
15389
15409
|
phase: external_exports.enum([
|
|
@@ -15422,6 +15442,7 @@ var PrimeAgentArtifactSchema = external_exports.object({
|
|
|
15422
15442
|
status: PrimeAgentArtifactStatusSchema,
|
|
15423
15443
|
input: external_exports.unknown().optional(),
|
|
15424
15444
|
output: external_exports.unknown().optional(),
|
|
15445
|
+
backgroundOutput: external_exports.string().optional(),
|
|
15425
15446
|
timestamp: external_exports.number().finite()
|
|
15426
15447
|
}).openapi({ description: "Browser-safe Prime Agent technical artifact" });
|
|
15427
15448
|
var PrimeAgentArtifactRunSchema = external_exports.object({
|
|
@@ -15457,7 +15478,9 @@ var PrimeAgentRlmChildSchema = external_exports.object({
|
|
|
15457
15478
|
"running",
|
|
15458
15479
|
"done",
|
|
15459
15480
|
"error",
|
|
15460
|
-
"cancelled"
|
|
15481
|
+
"cancelled",
|
|
15482
|
+
"recovering",
|
|
15483
|
+
"failed"
|
|
15461
15484
|
]),
|
|
15462
15485
|
durationMs: external_exports.number().finite().optional(),
|
|
15463
15486
|
answerPreview: external_exports.string().optional(),
|
|
@@ -15476,6 +15499,7 @@ var PrimeAgentRlmChildSchema = external_exports.object({
|
|
|
15476
15499
|
error: external_exports.string().optional(),
|
|
15477
15500
|
depth: external_exports.number().int().positive().optional(),
|
|
15478
15501
|
childrenIds: external_exports.array(external_exports.string()).optional(),
|
|
15502
|
+
lastHeardFrom: external_exports.number().finite().optional(),
|
|
15479
15503
|
timestamp: external_exports.number().finite()
|
|
15480
15504
|
}).openapi({ description: "Browser-safe RLM child status" });
|
|
15481
15505
|
var PrimeAgentRlmNodeSchema = PrimeAgentRlmChildSchema.extend({
|
|
@@ -15582,6 +15606,18 @@ var ChatPresentationEventSchema = external_exports.object({
|
|
|
15582
15606
|
sessionId: SessionIdSchema,
|
|
15583
15607
|
presentation: PrimeAgentSessionPresentationSchema
|
|
15584
15608
|
}).openapi({ description: "Immutable Prime Agent presentation snapshot" });
|
|
15609
|
+
var ChatSessionSnapshotEventSchema = external_exports.object({
|
|
15610
|
+
type: external_exports.literal("session_snapshot"),
|
|
15611
|
+
session: ChatSessionMetadataSchema,
|
|
15612
|
+
messages: external_exports.array(ChatMessageSchema),
|
|
15613
|
+
presentation: PrimeAgentSessionPresentationSchema,
|
|
15614
|
+
status: external_exports.enum([
|
|
15615
|
+
"ready",
|
|
15616
|
+
"streaming",
|
|
15617
|
+
"error"
|
|
15618
|
+
]),
|
|
15619
|
+
terminal: external_exports.boolean().optional()
|
|
15620
|
+
}).openapi({ description: "Authoritative transcript bootstrap for a read-only session stream" });
|
|
15585
15621
|
var ChatRlmStreamEventSchema = external_exports.object({
|
|
15586
15622
|
type: external_exports.literal("rlm"),
|
|
15587
15623
|
child: PrimeAgentRlmChildSchema,
|
|
@@ -15661,6 +15697,7 @@ var ChatStreamEventSchema = external_exports.union([
|
|
|
15661
15697
|
ChatQueueEventSchema,
|
|
15662
15698
|
ChatThinkingEventSchema,
|
|
15663
15699
|
ChatPresentationEventSchema,
|
|
15700
|
+
ChatSessionSnapshotEventSchema,
|
|
15664
15701
|
ChatMessageEventSchema,
|
|
15665
15702
|
ChatPayloadEventSchema,
|
|
15666
15703
|
ChatReasoningEventSchema,
|
|
@@ -15697,7 +15734,8 @@ var ChatSessionInfoSchema = external_exports.object({
|
|
|
15697
15734
|
"failed"
|
|
15698
15735
|
]),
|
|
15699
15736
|
messageCount: external_exports.number(),
|
|
15700
|
-
firstMessage: external_exports.string()
|
|
15737
|
+
firstMessage: external_exports.string(),
|
|
15738
|
+
isSubagent: external_exports.boolean().optional()
|
|
15701
15739
|
}).openapi({ description: "Chat session info" });
|
|
15702
15740
|
var ChatSessionsResponseSchema = external_exports.object({ sessions: external_exports.array(ChatSessionInfoSchema) }).openapi({ description: "Chat sessions list response" });
|
|
15703
15741
|
|
|
@@ -15733,6 +15771,8 @@ export {
|
|
|
15733
15771
|
ChatQuestionAnswerResponseSchema,
|
|
15734
15772
|
ChatPlanPresentationSchema,
|
|
15735
15773
|
ChatPlanPresentationUpsertRequestSchema,
|
|
15774
|
+
ChatQueueMutationRequestSchema,
|
|
15775
|
+
ChatQueueMutationResponseSchema,
|
|
15736
15776
|
PrimeAgentSessionPresentationSchema,
|
|
15737
15777
|
ChatOpenUIArtifactUpsertRequestSchema,
|
|
15738
15778
|
ChatOpenUIArtifactUpsertResponseSchema,
|