unplugin-cloudflare-tunnel 0.1.0 → 0.1.2
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/{.github/README.md → README.md} +125 -32
- package/dist/astro.d.mts +1 -1
- package/dist/astro.mjs +2 -1
- package/dist/esbuild.d.mts +1 -1
- package/dist/esbuild.mjs +1 -1
- package/dist/farm.d.mts +1 -1
- package/dist/farm.mjs +1 -1
- package/dist/index.d.mts +2 -172
- package/dist/index.mjs +1 -1088
- package/dist/options-DI3sWmXl.d.mts +67 -0
- package/dist/rolldown.d.mts +2677 -626
- package/dist/rolldown.mjs +1 -1
- package/dist/rollup.d.mts +1 -1
- package/dist/rollup.mjs +1 -1
- package/dist/rspack.d.mts +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/src-D0eR3kCb.mjs +1949 -0
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +23 -21
- package/dist/api.d.mts +0 -53
- package/dist/api.mjs +0 -58
- package/dist/schemas-Cpk3vGGi.mjs +0 -792
- package/dist/schemas-DKJtFAG_.d.mts +0 -702
|
@@ -1,792 +0,0 @@
|
|
|
1
|
-
Object.freeze({ status: "aborted" });
|
|
2
|
-
function $constructor(name, initializer, params) {
|
|
3
|
-
function init(inst, def) {
|
|
4
|
-
if (!inst._zod) Object.defineProperty(inst, "_zod", {
|
|
5
|
-
value: {
|
|
6
|
-
def,
|
|
7
|
-
constr: _,
|
|
8
|
-
traits: /* @__PURE__ */ new Set()
|
|
9
|
-
},
|
|
10
|
-
enumerable: false
|
|
11
|
-
});
|
|
12
|
-
if (inst._zod.traits.has(name)) return;
|
|
13
|
-
inst._zod.traits.add(name);
|
|
14
|
-
initializer(inst, def);
|
|
15
|
-
const proto = _.prototype;
|
|
16
|
-
const keys = Object.keys(proto);
|
|
17
|
-
for (let i = 0; i < keys.length; i++) {
|
|
18
|
-
const k = keys[i];
|
|
19
|
-
if (!(k in inst)) inst[k] = proto[k].bind(inst);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
const Parent = params?.Parent ?? Object;
|
|
23
|
-
class Definition extends Parent {}
|
|
24
|
-
Object.defineProperty(Definition, "name", { value: name });
|
|
25
|
-
function _(def) {
|
|
26
|
-
var _a;
|
|
27
|
-
const inst = params?.Parent ? new Definition() : this;
|
|
28
|
-
init(inst, def);
|
|
29
|
-
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
30
|
-
for (const fn of inst._zod.deferred) fn();
|
|
31
|
-
return inst;
|
|
32
|
-
}
|
|
33
|
-
Object.defineProperty(_, "init", { value: init });
|
|
34
|
-
Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
|
|
35
|
-
if (params?.Parent && inst instanceof params.Parent) return true;
|
|
36
|
-
return inst?._zod?.traits?.has(name);
|
|
37
|
-
} });
|
|
38
|
-
Object.defineProperty(_, "name", { value: name });
|
|
39
|
-
return _;
|
|
40
|
-
}
|
|
41
|
-
var $ZodAsyncError = class extends Error {
|
|
42
|
-
constructor() {
|
|
43
|
-
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
const globalConfig = {};
|
|
47
|
-
function config(newConfig) {
|
|
48
|
-
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
49
|
-
return globalConfig;
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region node_modules/zod/v4/core/util.js
|
|
53
|
-
function jsonStringifyReplacer(_, value) {
|
|
54
|
-
if (typeof value === "bigint") return value.toString();
|
|
55
|
-
return value;
|
|
56
|
-
}
|
|
57
|
-
function cached(getter) {
|
|
58
|
-
return { get value() {
|
|
59
|
-
{
|
|
60
|
-
const value = getter();
|
|
61
|
-
Object.defineProperty(this, "value", { value });
|
|
62
|
-
return value;
|
|
63
|
-
}
|
|
64
|
-
throw new Error("cached value already set");
|
|
65
|
-
} };
|
|
66
|
-
}
|
|
67
|
-
function cleanRegex(source) {
|
|
68
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
69
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
70
|
-
return source.slice(start, end);
|
|
71
|
-
}
|
|
72
|
-
const EVALUATING = Symbol("evaluating");
|
|
73
|
-
function defineLazy(object, key, getter) {
|
|
74
|
-
let value = void 0;
|
|
75
|
-
Object.defineProperty(object, key, {
|
|
76
|
-
get() {
|
|
77
|
-
if (value === EVALUATING) return;
|
|
78
|
-
if (value === void 0) {
|
|
79
|
-
value = EVALUATING;
|
|
80
|
-
value = getter();
|
|
81
|
-
}
|
|
82
|
-
return value;
|
|
83
|
-
},
|
|
84
|
-
set(v) {
|
|
85
|
-
Object.defineProperty(object, key, { value: v });
|
|
86
|
-
},
|
|
87
|
-
configurable: true
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
|
|
91
|
-
function isObject(data) {
|
|
92
|
-
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
93
|
-
}
|
|
94
|
-
cached(() => {
|
|
95
|
-
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
|
|
96
|
-
try {
|
|
97
|
-
new Function("");
|
|
98
|
-
return true;
|
|
99
|
-
} catch (_) {
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
function clone(inst, def, params) {
|
|
104
|
-
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
105
|
-
if (!def || params?.parent) cl._zod.parent = inst;
|
|
106
|
-
return cl;
|
|
107
|
-
}
|
|
108
|
-
function normalizeParams(_params) {
|
|
109
|
-
const params = _params;
|
|
110
|
-
if (!params) return {};
|
|
111
|
-
if (typeof params === "string") return { error: () => params };
|
|
112
|
-
if (params?.message !== void 0) {
|
|
113
|
-
if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
|
|
114
|
-
params.error = params.message;
|
|
115
|
-
}
|
|
116
|
-
delete params.message;
|
|
117
|
-
if (typeof params.error === "string") return {
|
|
118
|
-
...params,
|
|
119
|
-
error: () => params.error
|
|
120
|
-
};
|
|
121
|
-
return params;
|
|
122
|
-
}
|
|
123
|
-
function optionalKeys(shape) {
|
|
124
|
-
return Object.keys(shape).filter((k) => {
|
|
125
|
-
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, -Number.MAX_VALUE, Number.MAX_VALUE;
|
|
129
|
-
function aborted(x, startIndex = 0) {
|
|
130
|
-
if (x.aborted === true) return true;
|
|
131
|
-
for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
|
|
132
|
-
return false;
|
|
133
|
-
}
|
|
134
|
-
function prefixIssues(path, issues) {
|
|
135
|
-
return issues.map((iss) => {
|
|
136
|
-
var _a;
|
|
137
|
-
(_a = iss).path ?? (_a.path = []);
|
|
138
|
-
iss.path.unshift(path);
|
|
139
|
-
return iss;
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
function unwrapMessage(message) {
|
|
143
|
-
return typeof message === "string" ? message : message?.message;
|
|
144
|
-
}
|
|
145
|
-
function finalizeIssue(iss, ctx, config) {
|
|
146
|
-
const full = {
|
|
147
|
-
...iss,
|
|
148
|
-
path: iss.path ?? []
|
|
149
|
-
};
|
|
150
|
-
if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
|
|
151
|
-
delete full.inst;
|
|
152
|
-
delete full.continue;
|
|
153
|
-
if (!ctx?.reportInput) delete full.input;
|
|
154
|
-
return full;
|
|
155
|
-
}
|
|
156
|
-
//#endregion
|
|
157
|
-
//#region node_modules/zod/v4/core/errors.js
|
|
158
|
-
const initializer = (inst, def) => {
|
|
159
|
-
inst.name = "$ZodError";
|
|
160
|
-
Object.defineProperty(inst, "_zod", {
|
|
161
|
-
value: inst._zod,
|
|
162
|
-
enumerable: false
|
|
163
|
-
});
|
|
164
|
-
Object.defineProperty(inst, "issues", {
|
|
165
|
-
value: def,
|
|
166
|
-
enumerable: false
|
|
167
|
-
});
|
|
168
|
-
inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
|
|
169
|
-
Object.defineProperty(inst, "toString", {
|
|
170
|
-
value: () => inst.message,
|
|
171
|
-
enumerable: false
|
|
172
|
-
});
|
|
173
|
-
};
|
|
174
|
-
const $ZodError = $constructor("$ZodError", initializer);
|
|
175
|
-
const $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
|
|
176
|
-
//#endregion
|
|
177
|
-
//#region node_modules/zod/v4/core/parse.js
|
|
178
|
-
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
179
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
180
|
-
const result = schema._zod.run({
|
|
181
|
-
value,
|
|
182
|
-
issues: []
|
|
183
|
-
}, ctx);
|
|
184
|
-
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
185
|
-
if (result.issues.length) {
|
|
186
|
-
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
187
|
-
captureStackTrace(e, _params?.callee);
|
|
188
|
-
throw e;
|
|
189
|
-
}
|
|
190
|
-
return result.value;
|
|
191
|
-
};
|
|
192
|
-
const parse = /* @__PURE__ */ _parse($ZodRealError);
|
|
193
|
-
const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
194
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
195
|
-
let result = schema._zod.run({
|
|
196
|
-
value,
|
|
197
|
-
issues: []
|
|
198
|
-
}, ctx);
|
|
199
|
-
if (result instanceof Promise) result = await result;
|
|
200
|
-
if (result.issues.length) {
|
|
201
|
-
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
202
|
-
captureStackTrace(e, params?.callee);
|
|
203
|
-
throw e;
|
|
204
|
-
}
|
|
205
|
-
return result.value;
|
|
206
|
-
};
|
|
207
|
-
const parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
208
|
-
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
209
|
-
const ctx = _ctx ? {
|
|
210
|
-
..._ctx,
|
|
211
|
-
async: false
|
|
212
|
-
} : { async: false };
|
|
213
|
-
const result = schema._zod.run({
|
|
214
|
-
value,
|
|
215
|
-
issues: []
|
|
216
|
-
}, ctx);
|
|
217
|
-
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
218
|
-
return result.issues.length ? {
|
|
219
|
-
success: false,
|
|
220
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
221
|
-
} : {
|
|
222
|
-
success: true,
|
|
223
|
-
data: result.value
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
const safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
227
|
-
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
228
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
229
|
-
let result = schema._zod.run({
|
|
230
|
-
value,
|
|
231
|
-
issues: []
|
|
232
|
-
}, ctx);
|
|
233
|
-
if (result instanceof Promise) result = await result;
|
|
234
|
-
return result.issues.length ? {
|
|
235
|
-
success: false,
|
|
236
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
237
|
-
} : {
|
|
238
|
-
success: true,
|
|
239
|
-
data: result.value
|
|
240
|
-
};
|
|
241
|
-
};
|
|
242
|
-
const safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
243
|
-
const string$1 = (params) => {
|
|
244
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
245
|
-
return new RegExp(`^${regex}$`);
|
|
246
|
-
};
|
|
247
|
-
const number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
248
|
-
const boolean$1 = /^(?:true|false)$/i;
|
|
249
|
-
//#endregion
|
|
250
|
-
//#region node_modules/zod/v4/core/versions.js
|
|
251
|
-
const version = {
|
|
252
|
-
major: 4,
|
|
253
|
-
minor: 3,
|
|
254
|
-
patch: 6
|
|
255
|
-
};
|
|
256
|
-
//#endregion
|
|
257
|
-
//#region node_modules/zod/v4/core/schemas.js
|
|
258
|
-
const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
259
|
-
var _a;
|
|
260
|
-
inst ?? (inst = {});
|
|
261
|
-
inst._zod.def = def;
|
|
262
|
-
inst._zod.bag = inst._zod.bag || {};
|
|
263
|
-
inst._zod.version = version;
|
|
264
|
-
const checks = [...inst._zod.def.checks ?? []];
|
|
265
|
-
if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
|
|
266
|
-
for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
|
|
267
|
-
if (checks.length === 0) {
|
|
268
|
-
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
269
|
-
inst._zod.deferred?.push(() => {
|
|
270
|
-
inst._zod.run = inst._zod.parse;
|
|
271
|
-
});
|
|
272
|
-
} else {
|
|
273
|
-
const runChecks = (payload, checks, ctx) => {
|
|
274
|
-
let isAborted = aborted(payload);
|
|
275
|
-
let asyncResult;
|
|
276
|
-
for (const ch of checks) {
|
|
277
|
-
if (ch._zod.def.when) {
|
|
278
|
-
if (!ch._zod.def.when(payload)) continue;
|
|
279
|
-
} else if (isAborted) continue;
|
|
280
|
-
const currLen = payload.issues.length;
|
|
281
|
-
const _ = ch._zod.check(payload);
|
|
282
|
-
if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
|
|
283
|
-
if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
284
|
-
await _;
|
|
285
|
-
if (payload.issues.length === currLen) return;
|
|
286
|
-
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
287
|
-
});
|
|
288
|
-
else {
|
|
289
|
-
if (payload.issues.length === currLen) continue;
|
|
290
|
-
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
if (asyncResult) return asyncResult.then(() => {
|
|
294
|
-
return payload;
|
|
295
|
-
});
|
|
296
|
-
return payload;
|
|
297
|
-
};
|
|
298
|
-
const handleCanaryResult = (canary, payload, ctx) => {
|
|
299
|
-
if (aborted(canary)) {
|
|
300
|
-
canary.aborted = true;
|
|
301
|
-
return canary;
|
|
302
|
-
}
|
|
303
|
-
const checkResult = runChecks(payload, checks, ctx);
|
|
304
|
-
if (checkResult instanceof Promise) {
|
|
305
|
-
if (ctx.async === false) throw new $ZodAsyncError();
|
|
306
|
-
return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
|
|
307
|
-
}
|
|
308
|
-
return inst._zod.parse(checkResult, ctx);
|
|
309
|
-
};
|
|
310
|
-
inst._zod.run = (payload, ctx) => {
|
|
311
|
-
if (ctx.skipChecks) return inst._zod.parse(payload, ctx);
|
|
312
|
-
if (ctx.direction === "backward") {
|
|
313
|
-
const canary = inst._zod.parse({
|
|
314
|
-
value: payload.value,
|
|
315
|
-
issues: []
|
|
316
|
-
}, {
|
|
317
|
-
...ctx,
|
|
318
|
-
skipChecks: true
|
|
319
|
-
});
|
|
320
|
-
if (canary instanceof Promise) return canary.then((canary) => {
|
|
321
|
-
return handleCanaryResult(canary, payload, ctx);
|
|
322
|
-
});
|
|
323
|
-
return handleCanaryResult(canary, payload, ctx);
|
|
324
|
-
}
|
|
325
|
-
const result = inst._zod.parse(payload, ctx);
|
|
326
|
-
if (result instanceof Promise) {
|
|
327
|
-
if (ctx.async === false) throw new $ZodAsyncError();
|
|
328
|
-
return result.then((result) => runChecks(result, checks, ctx));
|
|
329
|
-
}
|
|
330
|
-
return runChecks(result, checks, ctx);
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
defineLazy(inst, "~standard", () => ({
|
|
334
|
-
validate: (value) => {
|
|
335
|
-
try {
|
|
336
|
-
const r = safeParse(inst, value);
|
|
337
|
-
return r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
338
|
-
} catch (_) {
|
|
339
|
-
return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
|
|
340
|
-
}
|
|
341
|
-
},
|
|
342
|
-
vendor: "zod",
|
|
343
|
-
version: 1
|
|
344
|
-
}));
|
|
345
|
-
});
|
|
346
|
-
const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
347
|
-
$ZodType.init(inst, def);
|
|
348
|
-
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
|
|
349
|
-
inst._zod.parse = (payload, _) => {
|
|
350
|
-
if (def.coerce) try {
|
|
351
|
-
payload.value = String(payload.value);
|
|
352
|
-
} catch (_) {}
|
|
353
|
-
if (typeof payload.value === "string") return payload;
|
|
354
|
-
payload.issues.push({
|
|
355
|
-
expected: "string",
|
|
356
|
-
code: "invalid_type",
|
|
357
|
-
input: payload.value,
|
|
358
|
-
inst
|
|
359
|
-
});
|
|
360
|
-
return payload;
|
|
361
|
-
};
|
|
362
|
-
});
|
|
363
|
-
const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
364
|
-
$ZodType.init(inst, def);
|
|
365
|
-
inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
|
|
366
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
367
|
-
if (def.coerce) try {
|
|
368
|
-
payload.value = Number(payload.value);
|
|
369
|
-
} catch (_) {}
|
|
370
|
-
const input = payload.value;
|
|
371
|
-
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
|
|
372
|
-
const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
|
|
373
|
-
payload.issues.push({
|
|
374
|
-
expected: "number",
|
|
375
|
-
code: "invalid_type",
|
|
376
|
-
input,
|
|
377
|
-
inst,
|
|
378
|
-
...received ? { received } : {}
|
|
379
|
-
});
|
|
380
|
-
return payload;
|
|
381
|
-
};
|
|
382
|
-
});
|
|
383
|
-
const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
384
|
-
$ZodType.init(inst, def);
|
|
385
|
-
inst._zod.pattern = boolean$1;
|
|
386
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
387
|
-
if (def.coerce) try {
|
|
388
|
-
payload.value = Boolean(payload.value);
|
|
389
|
-
} catch (_) {}
|
|
390
|
-
const input = payload.value;
|
|
391
|
-
if (typeof input === "boolean") return payload;
|
|
392
|
-
payload.issues.push({
|
|
393
|
-
expected: "boolean",
|
|
394
|
-
code: "invalid_type",
|
|
395
|
-
input,
|
|
396
|
-
inst
|
|
397
|
-
});
|
|
398
|
-
return payload;
|
|
399
|
-
};
|
|
400
|
-
});
|
|
401
|
-
const $ZodAny = /* @__PURE__ */ $constructor("$ZodAny", (inst, def) => {
|
|
402
|
-
$ZodType.init(inst, def);
|
|
403
|
-
inst._zod.parse = (payload) => payload;
|
|
404
|
-
});
|
|
405
|
-
const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
|
|
406
|
-
$ZodType.init(inst, def);
|
|
407
|
-
inst._zod.parse = (payload) => payload;
|
|
408
|
-
});
|
|
409
|
-
function handleArrayResult(result, final, index) {
|
|
410
|
-
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
411
|
-
final.value[index] = result.value;
|
|
412
|
-
}
|
|
413
|
-
const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
414
|
-
$ZodType.init(inst, def);
|
|
415
|
-
inst._zod.parse = (payload, ctx) => {
|
|
416
|
-
const input = payload.value;
|
|
417
|
-
if (!Array.isArray(input)) {
|
|
418
|
-
payload.issues.push({
|
|
419
|
-
expected: "array",
|
|
420
|
-
code: "invalid_type",
|
|
421
|
-
input,
|
|
422
|
-
inst
|
|
423
|
-
});
|
|
424
|
-
return payload;
|
|
425
|
-
}
|
|
426
|
-
payload.value = Array(input.length);
|
|
427
|
-
const proms = [];
|
|
428
|
-
for (let i = 0; i < input.length; i++) {
|
|
429
|
-
const item = input[i];
|
|
430
|
-
const result = def.element._zod.run({
|
|
431
|
-
value: item,
|
|
432
|
-
issues: []
|
|
433
|
-
}, ctx);
|
|
434
|
-
if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
435
|
-
else handleArrayResult(result, payload, i);
|
|
436
|
-
}
|
|
437
|
-
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
438
|
-
return payload;
|
|
439
|
-
};
|
|
440
|
-
});
|
|
441
|
-
function handlePropertyResult(result, final, key, input, isOptionalOut) {
|
|
442
|
-
if (result.issues.length) {
|
|
443
|
-
if (isOptionalOut && !(key in input)) return;
|
|
444
|
-
final.issues.push(...prefixIssues(key, result.issues));
|
|
445
|
-
}
|
|
446
|
-
if (result.value === void 0) {
|
|
447
|
-
if (key in input) final.value[key] = void 0;
|
|
448
|
-
} else final.value[key] = result.value;
|
|
449
|
-
}
|
|
450
|
-
function normalizeDef(def) {
|
|
451
|
-
const keys = Object.keys(def.shape);
|
|
452
|
-
for (const k of keys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
453
|
-
const okeys = optionalKeys(def.shape);
|
|
454
|
-
return {
|
|
455
|
-
...def,
|
|
456
|
-
keys,
|
|
457
|
-
keySet: new Set(keys),
|
|
458
|
-
numKeys: keys.length,
|
|
459
|
-
optionalKeys: new Set(okeys)
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
463
|
-
const unrecognized = [];
|
|
464
|
-
const keySet = def.keySet;
|
|
465
|
-
const _catchall = def.catchall._zod;
|
|
466
|
-
const t = _catchall.def.type;
|
|
467
|
-
const isOptionalOut = _catchall.optout === "optional";
|
|
468
|
-
for (const key in input) {
|
|
469
|
-
if (keySet.has(key)) continue;
|
|
470
|
-
if (t === "never") {
|
|
471
|
-
unrecognized.push(key);
|
|
472
|
-
continue;
|
|
473
|
-
}
|
|
474
|
-
const r = _catchall.run({
|
|
475
|
-
value: input[key],
|
|
476
|
-
issues: []
|
|
477
|
-
}, ctx);
|
|
478
|
-
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
|
|
479
|
-
else handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
480
|
-
}
|
|
481
|
-
if (unrecognized.length) payload.issues.push({
|
|
482
|
-
code: "unrecognized_keys",
|
|
483
|
-
keys: unrecognized,
|
|
484
|
-
input,
|
|
485
|
-
inst
|
|
486
|
-
});
|
|
487
|
-
if (!proms.length) return payload;
|
|
488
|
-
return Promise.all(proms).then(() => {
|
|
489
|
-
return payload;
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
493
|
-
$ZodType.init(inst, def);
|
|
494
|
-
if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
|
|
495
|
-
const sh = def.shape;
|
|
496
|
-
Object.defineProperty(def, "shape", { get: () => {
|
|
497
|
-
const newSh = { ...sh };
|
|
498
|
-
Object.defineProperty(def, "shape", { value: newSh });
|
|
499
|
-
return newSh;
|
|
500
|
-
} });
|
|
501
|
-
}
|
|
502
|
-
const _normalized = cached(() => normalizeDef(def));
|
|
503
|
-
defineLazy(inst._zod, "propValues", () => {
|
|
504
|
-
const shape = def.shape;
|
|
505
|
-
const propValues = {};
|
|
506
|
-
for (const key in shape) {
|
|
507
|
-
const field = shape[key]._zod;
|
|
508
|
-
if (field.values) {
|
|
509
|
-
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
510
|
-
for (const v of field.values) propValues[key].add(v);
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
return propValues;
|
|
514
|
-
});
|
|
515
|
-
const isObject$2 = isObject;
|
|
516
|
-
const catchall = def.catchall;
|
|
517
|
-
let value;
|
|
518
|
-
inst._zod.parse = (payload, ctx) => {
|
|
519
|
-
value ?? (value = _normalized.value);
|
|
520
|
-
const input = payload.value;
|
|
521
|
-
if (!isObject$2(input)) {
|
|
522
|
-
payload.issues.push({
|
|
523
|
-
expected: "object",
|
|
524
|
-
code: "invalid_type",
|
|
525
|
-
input,
|
|
526
|
-
inst
|
|
527
|
-
});
|
|
528
|
-
return payload;
|
|
529
|
-
}
|
|
530
|
-
payload.value = {};
|
|
531
|
-
const proms = [];
|
|
532
|
-
const shape = value.shape;
|
|
533
|
-
for (const key of value.keys) {
|
|
534
|
-
const el = shape[key];
|
|
535
|
-
const isOptionalOut = el._zod.optout === "optional";
|
|
536
|
-
const r = el._zod.run({
|
|
537
|
-
value: input[key],
|
|
538
|
-
issues: []
|
|
539
|
-
}, ctx);
|
|
540
|
-
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
|
|
541
|
-
else handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
542
|
-
}
|
|
543
|
-
if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
544
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
545
|
-
};
|
|
546
|
-
});
|
|
547
|
-
function handleOptionalResult(result, input) {
|
|
548
|
-
if (result.issues.length && input === void 0) return {
|
|
549
|
-
issues: [],
|
|
550
|
-
value: void 0
|
|
551
|
-
};
|
|
552
|
-
return result;
|
|
553
|
-
}
|
|
554
|
-
const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
555
|
-
$ZodType.init(inst, def);
|
|
556
|
-
inst._zod.optin = "optional";
|
|
557
|
-
inst._zod.optout = "optional";
|
|
558
|
-
defineLazy(inst._zod, "values", () => {
|
|
559
|
-
return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0;
|
|
560
|
-
});
|
|
561
|
-
defineLazy(inst._zod, "pattern", () => {
|
|
562
|
-
const pattern = def.innerType._zod.pattern;
|
|
563
|
-
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
|
|
564
|
-
});
|
|
565
|
-
inst._zod.parse = (payload, ctx) => {
|
|
566
|
-
if (def.innerType._zod.optin === "optional") {
|
|
567
|
-
const result = def.innerType._zod.run(payload, ctx);
|
|
568
|
-
if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, payload.value));
|
|
569
|
-
return handleOptionalResult(result, payload.value);
|
|
570
|
-
}
|
|
571
|
-
if (payload.value === void 0) return payload;
|
|
572
|
-
return def.innerType._zod.run(payload, ctx);
|
|
573
|
-
};
|
|
574
|
-
});
|
|
575
|
-
const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
|
|
576
|
-
$ZodType.init(inst, def);
|
|
577
|
-
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
578
|
-
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
579
|
-
defineLazy(inst._zod, "pattern", () => {
|
|
580
|
-
const pattern = def.innerType._zod.pattern;
|
|
581
|
-
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
|
|
582
|
-
});
|
|
583
|
-
defineLazy(inst._zod, "values", () => {
|
|
584
|
-
return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : void 0;
|
|
585
|
-
});
|
|
586
|
-
inst._zod.parse = (payload, ctx) => {
|
|
587
|
-
if (payload.value === null) return payload;
|
|
588
|
-
return def.innerType._zod.run(payload, ctx);
|
|
589
|
-
};
|
|
590
|
-
});
|
|
591
|
-
//#endregion
|
|
592
|
-
//#region node_modules/zod/v4/core/registries.js
|
|
593
|
-
var _a;
|
|
594
|
-
var $ZodRegistry = class {
|
|
595
|
-
constructor() {
|
|
596
|
-
this._map = /* @__PURE__ */ new WeakMap();
|
|
597
|
-
this._idmap = /* @__PURE__ */ new Map();
|
|
598
|
-
}
|
|
599
|
-
add(schema, ..._meta) {
|
|
600
|
-
const meta = _meta[0];
|
|
601
|
-
this._map.set(schema, meta);
|
|
602
|
-
if (meta && typeof meta === "object" && "id" in meta) this._idmap.set(meta.id, schema);
|
|
603
|
-
return this;
|
|
604
|
-
}
|
|
605
|
-
clear() {
|
|
606
|
-
this._map = /* @__PURE__ */ new WeakMap();
|
|
607
|
-
this._idmap = /* @__PURE__ */ new Map();
|
|
608
|
-
return this;
|
|
609
|
-
}
|
|
610
|
-
remove(schema) {
|
|
611
|
-
const meta = this._map.get(schema);
|
|
612
|
-
if (meta && typeof meta === "object" && "id" in meta) this._idmap.delete(meta.id);
|
|
613
|
-
this._map.delete(schema);
|
|
614
|
-
return this;
|
|
615
|
-
}
|
|
616
|
-
get(schema) {
|
|
617
|
-
const p = schema._zod.parent;
|
|
618
|
-
if (p) {
|
|
619
|
-
const pm = { ...this.get(p) ?? {} };
|
|
620
|
-
delete pm.id;
|
|
621
|
-
const f = {
|
|
622
|
-
...pm,
|
|
623
|
-
...this._map.get(schema)
|
|
624
|
-
};
|
|
625
|
-
return Object.keys(f).length ? f : void 0;
|
|
626
|
-
}
|
|
627
|
-
return this._map.get(schema);
|
|
628
|
-
}
|
|
629
|
-
has(schema) {
|
|
630
|
-
return this._map.has(schema);
|
|
631
|
-
}
|
|
632
|
-
};
|
|
633
|
-
function registry() {
|
|
634
|
-
return new $ZodRegistry();
|
|
635
|
-
}
|
|
636
|
-
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
637
|
-
globalThis.__zod_globalRegistry;
|
|
638
|
-
//#endregion
|
|
639
|
-
//#region node_modules/zod/v4/core/api.js
|
|
640
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
641
|
-
function _string(Class, params) {
|
|
642
|
-
return new Class({
|
|
643
|
-
type: "string",
|
|
644
|
-
...normalizeParams(params)
|
|
645
|
-
});
|
|
646
|
-
}
|
|
647
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
648
|
-
function _number(Class, params) {
|
|
649
|
-
return new Class({
|
|
650
|
-
type: "number",
|
|
651
|
-
checks: [],
|
|
652
|
-
...normalizeParams(params)
|
|
653
|
-
});
|
|
654
|
-
}
|
|
655
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
656
|
-
function _boolean(Class, params) {
|
|
657
|
-
return new Class({
|
|
658
|
-
type: "boolean",
|
|
659
|
-
...normalizeParams(params)
|
|
660
|
-
});
|
|
661
|
-
}
|
|
662
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
663
|
-
function _any(Class) {
|
|
664
|
-
return new Class({ type: "any" });
|
|
665
|
-
}
|
|
666
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
667
|
-
function _unknown(Class) {
|
|
668
|
-
return new Class({ type: "unknown" });
|
|
669
|
-
}
|
|
670
|
-
//#endregion
|
|
671
|
-
//#region node_modules/zod/v4/mini/schemas.js
|
|
672
|
-
const ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
673
|
-
if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
|
|
674
|
-
$ZodType.init(inst, def);
|
|
675
|
-
inst.def = def;
|
|
676
|
-
inst.type = def.type;
|
|
677
|
-
inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
|
|
678
|
-
inst.safeParse = (data, params) => safeParse(inst, data, params);
|
|
679
|
-
inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
|
|
680
|
-
inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
|
|
681
|
-
inst.check = (...checks) => {
|
|
682
|
-
return inst.clone({
|
|
683
|
-
...def,
|
|
684
|
-
checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
|
|
685
|
-
check: ch,
|
|
686
|
-
def: { check: "custom" },
|
|
687
|
-
onattach: []
|
|
688
|
-
} } : ch)]
|
|
689
|
-
}, { parent: true });
|
|
690
|
-
};
|
|
691
|
-
inst.with = inst.check;
|
|
692
|
-
inst.clone = (_def, params) => clone(inst, _def, params);
|
|
693
|
-
inst.brand = () => inst;
|
|
694
|
-
inst.register = ((reg, meta) => {
|
|
695
|
-
reg.add(inst, meta);
|
|
696
|
-
return inst;
|
|
697
|
-
});
|
|
698
|
-
inst.apply = (fn) => fn(inst);
|
|
699
|
-
});
|
|
700
|
-
const ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) => {
|
|
701
|
-
$ZodString.init(inst, def);
|
|
702
|
-
ZodMiniType.init(inst, def);
|
|
703
|
-
});
|
|
704
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
705
|
-
function string(params) {
|
|
706
|
-
return /* @__PURE__ */ _string(ZodMiniString, params);
|
|
707
|
-
}
|
|
708
|
-
const ZodMiniNumber = /* @__PURE__ */ $constructor("ZodMiniNumber", (inst, def) => {
|
|
709
|
-
$ZodNumber.init(inst, def);
|
|
710
|
-
ZodMiniType.init(inst, def);
|
|
711
|
-
});
|
|
712
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
713
|
-
function number(params) {
|
|
714
|
-
return /* @__PURE__ */ _number(ZodMiniNumber, params);
|
|
715
|
-
}
|
|
716
|
-
const ZodMiniBoolean = /* @__PURE__ */ $constructor("ZodMiniBoolean", (inst, def) => {
|
|
717
|
-
$ZodBoolean.init(inst, def);
|
|
718
|
-
ZodMiniType.init(inst, def);
|
|
719
|
-
});
|
|
720
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
721
|
-
function boolean(params) {
|
|
722
|
-
return /* @__PURE__ */ _boolean(ZodMiniBoolean, params);
|
|
723
|
-
}
|
|
724
|
-
const ZodMiniAny = /* @__PURE__ */ $constructor("ZodMiniAny", (inst, def) => {
|
|
725
|
-
$ZodAny.init(inst, def);
|
|
726
|
-
ZodMiniType.init(inst, def);
|
|
727
|
-
});
|
|
728
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
729
|
-
function any() {
|
|
730
|
-
return /* @__PURE__ */ _any(ZodMiniAny);
|
|
731
|
-
}
|
|
732
|
-
const ZodMiniUnknown = /* @__PURE__ */ $constructor("ZodMiniUnknown", (inst, def) => {
|
|
733
|
-
$ZodUnknown.init(inst, def);
|
|
734
|
-
ZodMiniType.init(inst, def);
|
|
735
|
-
});
|
|
736
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
737
|
-
function unknown() {
|
|
738
|
-
return /* @__PURE__ */ _unknown(ZodMiniUnknown);
|
|
739
|
-
}
|
|
740
|
-
const ZodMiniArray = /* @__PURE__ */ $constructor("ZodMiniArray", (inst, def) => {
|
|
741
|
-
$ZodArray.init(inst, def);
|
|
742
|
-
ZodMiniType.init(inst, def);
|
|
743
|
-
});
|
|
744
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
745
|
-
function array(element, params) {
|
|
746
|
-
return new ZodMiniArray({
|
|
747
|
-
type: "array",
|
|
748
|
-
element,
|
|
749
|
-
...normalizeParams(params)
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
const ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
753
|
-
$ZodObject.init(inst, def);
|
|
754
|
-
ZodMiniType.init(inst, def);
|
|
755
|
-
defineLazy(inst, "shape", () => def.shape);
|
|
756
|
-
});
|
|
757
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
758
|
-
function object(shape, params) {
|
|
759
|
-
return new ZodMiniObject({
|
|
760
|
-
type: "object",
|
|
761
|
-
shape: shape ?? {},
|
|
762
|
-
...normalizeParams(params)
|
|
763
|
-
});
|
|
764
|
-
}
|
|
765
|
-
const ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
|
|
766
|
-
$ZodOptional.init(inst, def);
|
|
767
|
-
ZodMiniType.init(inst, def);
|
|
768
|
-
});
|
|
769
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
770
|
-
function optional(innerType) {
|
|
771
|
-
return new ZodMiniOptional({
|
|
772
|
-
type: "optional",
|
|
773
|
-
innerType
|
|
774
|
-
});
|
|
775
|
-
}
|
|
776
|
-
const ZodMiniNullable = /* @__PURE__ */ $constructor("ZodMiniNullable", (inst, def) => {
|
|
777
|
-
$ZodNullable.init(inst, def);
|
|
778
|
-
ZodMiniType.init(inst, def);
|
|
779
|
-
});
|
|
780
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
781
|
-
function nullable(innerType) {
|
|
782
|
-
return new ZodMiniNullable({
|
|
783
|
-
type: "nullable",
|
|
784
|
-
innerType
|
|
785
|
-
});
|
|
786
|
-
}
|
|
787
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
788
|
-
function nullish(innerType) {
|
|
789
|
-
return /* @__PURE__ */ optional(/* @__PURE__ */ nullable(innerType));
|
|
790
|
-
}
|
|
791
|
-
//#endregion
|
|
792
|
-
export { number as a, string as c, nullish as i, unknown as l, array as n, object as o, boolean as r, optional as s, any as t };
|