@fro.bot/systematic 3.18.0 → 3.18.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/dist/cli.js +2 -2
- package/dist/{index-y33enbkc.js → index-nrgffx9y.js} +605 -387
- package/dist/index.js +1 -1
- package/dist/pi.js +576 -367
- package/package.json +6 -6
- package/skills/ce-review/scripts/validate-review.mjs +788 -513
|
@@ -1786,7 +1786,7 @@ var BUNDLED_SKILL_NAMES = [
|
|
|
1786
1786
|
"writing-skills"
|
|
1787
1787
|
];
|
|
1788
1788
|
|
|
1789
|
-
// node_modules/.bun/zod@4.
|
|
1789
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/util.js
|
|
1790
1790
|
function getEnumValues(entries) {
|
|
1791
1791
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
1792
1792
|
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -1800,18 +1800,23 @@ function jsonStringifyReplacer(_, value) {
|
|
|
1800
1800
|
return value.toString();
|
|
1801
1801
|
return value;
|
|
1802
1802
|
}
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1803
|
+
|
|
1804
|
+
class Cached {
|
|
1805
|
+
constructor(getter) {
|
|
1806
|
+
this._getter = getter;
|
|
1807
|
+
this._value = undefined;
|
|
1808
|
+
}
|
|
1809
|
+
get value() {
|
|
1810
|
+
const getter = this._getter;
|
|
1811
|
+
if (getter !== undefined) {
|
|
1812
|
+
this._value = getter();
|
|
1813
|
+
this._getter = undefined;
|
|
1813
1814
|
}
|
|
1814
|
-
|
|
1815
|
+
return this._value;
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
function cached(getter) {
|
|
1819
|
+
return new Cached(getter);
|
|
1815
1820
|
}
|
|
1816
1821
|
function nullish(input) {
|
|
1817
1822
|
return input === null || input === undefined;
|
|
@@ -1837,6 +1842,56 @@ function assignProp(target, prop, value) {
|
|
|
1837
1842
|
configurable: true
|
|
1838
1843
|
});
|
|
1839
1844
|
}
|
|
1845
|
+
function rawShape(def) {
|
|
1846
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
1847
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
1848
|
+
}
|
|
1849
|
+
function sourceShape(schema) {
|
|
1850
|
+
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
1851
|
+
}
|
|
1852
|
+
function deferProp(target, key, getter) {
|
|
1853
|
+
Object.defineProperty(target, key, {
|
|
1854
|
+
get() {
|
|
1855
|
+
const value = getter();
|
|
1856
|
+
assignProp(this, key, value);
|
|
1857
|
+
return value;
|
|
1858
|
+
},
|
|
1859
|
+
enumerable: true,
|
|
1860
|
+
configurable: true
|
|
1861
|
+
});
|
|
1862
|
+
}
|
|
1863
|
+
function putProp(target, key, value) {
|
|
1864
|
+
if (key in target)
|
|
1865
|
+
assignProp(target, key, value);
|
|
1866
|
+
else
|
|
1867
|
+
target[key] = value;
|
|
1868
|
+
}
|
|
1869
|
+
function mirrorShape(target, source, keys, wrap) {
|
|
1870
|
+
const raw = sourceShape(source);
|
|
1871
|
+
for (const key of keys) {
|
|
1872
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key);
|
|
1873
|
+
if (!desc.enumerable)
|
|
1874
|
+
continue;
|
|
1875
|
+
if (desc.get) {
|
|
1876
|
+
deferProp(target, key, () => {
|
|
1877
|
+
const value = source._zod.def.shape[key];
|
|
1878
|
+
return wrap ? wrap(value, key) : value;
|
|
1879
|
+
});
|
|
1880
|
+
} else
|
|
1881
|
+
putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
function mirrorProps(target, source) {
|
|
1885
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
1886
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1887
|
+
if (!desc.enumerable)
|
|
1888
|
+
continue;
|
|
1889
|
+
if (desc.get)
|
|
1890
|
+
deferProp(target, key, () => source[key]);
|
|
1891
|
+
else
|
|
1892
|
+
putProp(target, key, desc.value);
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1840
1895
|
function mergeDefs(...defs) {
|
|
1841
1896
|
const mergedDescriptors = {};
|
|
1842
1897
|
for (const def of defs) {
|
|
@@ -1942,6 +1997,10 @@ var NUMBER_FORMAT_RANGES = /* @__PURE__ */ (() => ({
|
|
|
1942
1997
|
float32: [-340282346638528860000000000000000000000, 340282346638528860000000000000000000000],
|
|
1943
1998
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
1944
1999
|
}))();
|
|
2000
|
+
var BIGINT_FORMAT_RANGES = {
|
|
2001
|
+
int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
|
|
2002
|
+
uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
|
|
2003
|
+
};
|
|
1945
2004
|
function pick(schema, mask) {
|
|
1946
2005
|
const currDef = schema._zod.def;
|
|
1947
2006
|
const checks = currDef.checks;
|
|
@@ -1949,23 +2008,21 @@ function pick(schema, mask) {
|
|
|
1949
2008
|
if (hasChecks) {
|
|
1950
2009
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
1951
2010
|
}
|
|
1952
|
-
const
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
});
|
|
1968
|
-
return clone(schema, def);
|
|
2011
|
+
const newShape = {};
|
|
2012
|
+
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
2013
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
2014
|
+
}
|
|
2015
|
+
function maskedKeys(schema, mask) {
|
|
2016
|
+
const raw = sourceShape(schema);
|
|
2017
|
+
const keys = [];
|
|
2018
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
2019
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
|
|
2020
|
+
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
2021
|
+
}
|
|
2022
|
+
if (mask[key])
|
|
2023
|
+
keys.push(key);
|
|
2024
|
+
}
|
|
2025
|
+
return keys;
|
|
1969
2026
|
}
|
|
1970
2027
|
function omit(schema, mask) {
|
|
1971
2028
|
const currDef = schema._zod.def;
|
|
@@ -1974,23 +2031,10 @@ function omit(schema, mask) {
|
|
|
1974
2031
|
if (hasChecks) {
|
|
1975
2032
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
1976
2033
|
}
|
|
1977
|
-
const
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
|
|
1982
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
1983
|
-
}
|
|
1984
|
-
if (!mask[key])
|
|
1985
|
-
continue;
|
|
1986
|
-
delete newShape[key];
|
|
1987
|
-
}
|
|
1988
|
-
assignProp(this, "shape", newShape);
|
|
1989
|
-
return newShape;
|
|
1990
|
-
},
|
|
1991
|
-
checks: []
|
|
1992
|
-
});
|
|
1993
|
-
return clone(schema, def);
|
|
2034
|
+
const omitted = new Set(maskedKeys(schema, mask));
|
|
2035
|
+
const newShape = {};
|
|
2036
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
2037
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
1994
2038
|
}
|
|
1995
2039
|
function extend(schema, shape) {
|
|
1996
2040
|
if (!isPlainObject(shape)) {
|
|
@@ -1999,34 +2043,26 @@ function extend(schema, shape) {
|
|
|
1999
2043
|
const checks = schema._zod.def.checks;
|
|
2000
2044
|
const hasChecks = checks && checks.length > 0;
|
|
2001
2045
|
if (hasChecks) {
|
|
2002
|
-
const existingShape = schema
|
|
2046
|
+
const existingShape = sourceShape(schema);
|
|
2003
2047
|
for (const key of Reflect.ownKeys(shape)) {
|
|
2004
2048
|
if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {
|
|
2005
2049
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
2006
2050
|
}
|
|
2007
2051
|
}
|
|
2008
2052
|
}
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
return clone(schema, def);
|
|
2053
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
2054
|
+
}
|
|
2055
|
+
function extended(schema, shape) {
|
|
2056
|
+
const newShape = {};
|
|
2057
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
|
|
2058
|
+
mirrorProps(newShape, shape);
|
|
2059
|
+
return newShape;
|
|
2017
2060
|
}
|
|
2018
2061
|
function safeExtend(schema, shape) {
|
|
2019
2062
|
if (!isPlainObject(shape)) {
|
|
2020
2063
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
2021
2064
|
}
|
|
2022
|
-
|
|
2023
|
-
get shape() {
|
|
2024
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
2025
|
-
assignProp(this, "shape", _shape);
|
|
2026
|
-
return _shape;
|
|
2027
|
-
}
|
|
2028
|
-
});
|
|
2029
|
-
return clone(schema, def);
|
|
2065
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
2030
2066
|
}
|
|
2031
2067
|
function merge(a, b) {
|
|
2032
2068
|
if (!b?._zod?.def) {
|
|
@@ -2035,12 +2071,11 @@ function merge(a, b) {
|
|
|
2035
2071
|
if (a._zod.def.checks?.length) {
|
|
2036
2072
|
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
2037
2073
|
}
|
|
2074
|
+
const newShape = {};
|
|
2075
|
+
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
2076
|
+
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
2038
2077
|
const def = mergeDefs(a._zod.def, {
|
|
2039
|
-
|
|
2040
|
-
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
2041
|
-
assignProp(this, "shape", _shape);
|
|
2042
|
-
return _shape;
|
|
2043
|
-
},
|
|
2078
|
+
shape: newShape,
|
|
2044
2079
|
get catchall() {
|
|
2045
2080
|
return b._zod.def.catchall;
|
|
2046
2081
|
},
|
|
@@ -2055,67 +2090,16 @@ function partial(Class, schema, mask, name = "partial") {
|
|
|
2055
2090
|
if (hasChecks) {
|
|
2056
2091
|
throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
2057
2092
|
}
|
|
2058
|
-
const
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
if (mask) {
|
|
2063
|
-
for (const key of Reflect.ownKeys(mask)) {
|
|
2064
|
-
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
|
|
2065
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
2066
|
-
}
|
|
2067
|
-
if (!mask[key])
|
|
2068
|
-
continue;
|
|
2069
|
-
shape[key] = Class ? new Class({
|
|
2070
|
-
type: "optional",
|
|
2071
|
-
innerType: oldShape[key]
|
|
2072
|
-
}) : oldShape[key];
|
|
2073
|
-
}
|
|
2074
|
-
} else {
|
|
2075
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
2076
|
-
shape[key] = Class ? new Class({
|
|
2077
|
-
type: "optional",
|
|
2078
|
-
innerType: oldShape[key]
|
|
2079
|
-
}) : oldShape[key];
|
|
2080
|
-
}
|
|
2081
|
-
}
|
|
2082
|
-
assignProp(this, "shape", shape);
|
|
2083
|
-
return shape;
|
|
2084
|
-
},
|
|
2085
|
-
checks: []
|
|
2086
|
-
});
|
|
2087
|
-
return clone(schema, def);
|
|
2093
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
|
|
2094
|
+
const newShape = {};
|
|
2095
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({ type: "optional", innerType: value })));
|
|
2096
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
|
|
2088
2097
|
}
|
|
2089
2098
|
function required(Class, schema, mask) {
|
|
2090
|
-
const
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
if (mask) {
|
|
2095
|
-
for (const key of Reflect.ownKeys(mask)) {
|
|
2096
|
-
if (!Object.prototype.hasOwnProperty.call(shape, key)) {
|
|
2097
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
2098
|
-
}
|
|
2099
|
-
if (!mask[key])
|
|
2100
|
-
continue;
|
|
2101
|
-
shape[key] = new Class({
|
|
2102
|
-
type: "nonoptional",
|
|
2103
|
-
innerType: oldShape[key]
|
|
2104
|
-
});
|
|
2105
|
-
}
|
|
2106
|
-
} else {
|
|
2107
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
2108
|
-
shape[key] = new Class({
|
|
2109
|
-
type: "nonoptional",
|
|
2110
|
-
innerType: oldShape[key]
|
|
2111
|
-
});
|
|
2112
|
-
}
|
|
2113
|
-
}
|
|
2114
|
-
assignProp(this, "shape", shape);
|
|
2115
|
-
return shape;
|
|
2116
|
-
}
|
|
2117
|
-
});
|
|
2118
|
-
return clone(schema, def);
|
|
2099
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
|
|
2100
|
+
const newShape = {};
|
|
2101
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class({ type: "nonoptional", innerType: value }));
|
|
2102
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
2119
2103
|
}
|
|
2120
2104
|
function aborted(x, startIndex = 0) {
|
|
2121
2105
|
if (x.aborted === true)
|
|
@@ -2165,13 +2149,18 @@ function finalizeIssue(iss, ctx, config) {
|
|
|
2165
2149
|
}
|
|
2166
2150
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;
|
|
2167
2151
|
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
|
|
2168
|
-
const
|
|
2169
|
-
|
|
2170
|
-
|
|
2152
|
+
const full = {};
|
|
2153
|
+
for (const k of Object.keys(iss)) {
|
|
2154
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
|
|
2155
|
+
continue;
|
|
2156
|
+
full[k] = iss[k];
|
|
2157
|
+
}
|
|
2158
|
+
full.path ?? (full.path = []);
|
|
2159
|
+
full.message = message;
|
|
2171
2160
|
if (ctx?.reportInput) {
|
|
2172
|
-
|
|
2161
|
+
full.input = iss.input;
|
|
2173
2162
|
}
|
|
2174
|
-
return
|
|
2163
|
+
return full;
|
|
2175
2164
|
}
|
|
2176
2165
|
var highSurrogate = /[\uD800-\uDBFF]/;
|
|
2177
2166
|
function codePointLength(str) {
|
|
@@ -2235,6 +2224,9 @@ function members(proto, table) {
|
|
|
2235
2224
|
else
|
|
2236
2225
|
defineBound(proto, key, desc.value);
|
|
2237
2226
|
}
|
|
2227
|
+
for (const sym of Object.getOwnPropertySymbols(table)) {
|
|
2228
|
+
defineBound(proto, sym, table[sym]);
|
|
2229
|
+
}
|
|
2238
2230
|
}
|
|
2239
2231
|
function own(inst, key, value, enumerable = true) {
|
|
2240
2232
|
Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
|
|
@@ -2243,6 +2235,22 @@ function own(inst, key, value, enumerable = true) {
|
|
|
2243
2235
|
function hide(inst, key, value) {
|
|
2244
2236
|
return own(inst, key, value, false);
|
|
2245
2237
|
}
|
|
2238
|
+
function derived(computes, table) {
|
|
2239
|
+
for (const key in computes) {
|
|
2240
|
+
const compute = computes[key];
|
|
2241
|
+
Object.defineProperty(table, key, {
|
|
2242
|
+
configurable: true,
|
|
2243
|
+
enumerable: true,
|
|
2244
|
+
get() {
|
|
2245
|
+
return own(this, key, compute(this));
|
|
2246
|
+
},
|
|
2247
|
+
set(value) {
|
|
2248
|
+
own(this, key, value);
|
|
2249
|
+
}
|
|
2250
|
+
});
|
|
2251
|
+
}
|
|
2252
|
+
return table;
|
|
2253
|
+
}
|
|
2246
2254
|
function defineBound(proto, key, fn) {
|
|
2247
2255
|
Object.defineProperty(proto, key, {
|
|
2248
2256
|
configurable: true,
|
|
@@ -2324,7 +2332,7 @@ function constantCatch(value) {
|
|
|
2324
2332
|
return fn;
|
|
2325
2333
|
}
|
|
2326
2334
|
|
|
2327
|
-
// node_modules/.bun/zod@4.
|
|
2335
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/core.js
|
|
2328
2336
|
var _a;
|
|
2329
2337
|
var _zodDesc = { value: undefined, enumerable: false };
|
|
2330
2338
|
var _E = "captureStackTrace" in Error ? Error : null;
|
|
@@ -2443,7 +2451,7 @@ function config(newConfig) {
|
|
|
2443
2451
|
Object.assign(globalConfig, newConfig);
|
|
2444
2452
|
return globalConfig;
|
|
2445
2453
|
}
|
|
2446
|
-
// node_modules/.bun/zod@4.
|
|
2454
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/errors.js
|
|
2447
2455
|
function _getMessage() {
|
|
2448
2456
|
const internals = this._zod;
|
|
2449
2457
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -2458,16 +2466,12 @@ var _messageDesc = {
|
|
|
2458
2466
|
enumerable: true,
|
|
2459
2467
|
configurable: true
|
|
2460
2468
|
};
|
|
2461
|
-
var _zodDesc2 = { value: undefined, enumerable: false };
|
|
2462
2469
|
var _issuesDesc = { value: undefined, enumerable: false };
|
|
2463
2470
|
var _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
2464
2471
|
var initializer = (inst, def) => {
|
|
2465
2472
|
inst.name = "$ZodError";
|
|
2466
|
-
_zodDesc2.value = inst._zod;
|
|
2467
|
-
Object.defineProperty(inst, "_zod", _zodDesc2);
|
|
2468
2473
|
_issuesDesc.value = def;
|
|
2469
2474
|
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
2470
|
-
_zodDesc2.value = undefined;
|
|
2471
2475
|
_issuesDesc.value = undefined;
|
|
2472
2476
|
Object.defineProperty(inst, "message", _messageDesc);
|
|
2473
2477
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -2562,7 +2566,7 @@ function formatError(error, mapper = (issue) => issue.message) {
|
|
|
2562
2566
|
return fieldErrors;
|
|
2563
2567
|
}
|
|
2564
2568
|
|
|
2565
|
-
// node_modules/.bun/zod@4.
|
|
2569
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/parse.js
|
|
2566
2570
|
function finalizeParams(callee, params) {
|
|
2567
2571
|
return { callee: params?.callee ?? callee, Err: params?.Err };
|
|
2568
2572
|
}
|
|
@@ -2603,23 +2607,68 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
2603
2607
|
if (result instanceof Promise) {
|
|
2604
2608
|
throw new $ZodAsyncError;
|
|
2605
2609
|
}
|
|
2606
|
-
return result.issues.length ? {
|
|
2607
|
-
success: false,
|
|
2608
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
2609
|
-
} : { success: true, data: result.value };
|
|
2610
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
2610
2611
|
};
|
|
2611
|
-
|
|
2612
|
+
function failure(Err, issues, ctx) {
|
|
2613
|
+
let error;
|
|
2614
|
+
return {
|
|
2615
|
+
success: false,
|
|
2616
|
+
get error() {
|
|
2617
|
+
if (!error) {
|
|
2618
|
+
error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
2619
|
+
issues = undefined;
|
|
2620
|
+
ctx = undefined;
|
|
2621
|
+
}
|
|
2622
|
+
return error;
|
|
2623
|
+
},
|
|
2624
|
+
set error(e) {
|
|
2625
|
+
error = e;
|
|
2626
|
+
issues = undefined;
|
|
2627
|
+
ctx = undefined;
|
|
2628
|
+
}
|
|
2629
|
+
};
|
|
2630
|
+
}
|
|
2612
2631
|
var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
2613
2632
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
2614
2633
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
2615
2634
|
if (result instanceof Promise)
|
|
2616
2635
|
result = await result;
|
|
2617
|
-
return result.issues.length ? {
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2636
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
2637
|
+
};
|
|
2638
|
+
var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
2639
|
+
var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
2640
|
+
var validate = (schema, value, _ctx) => {
|
|
2641
|
+
const validator = schema._zod.bag.validator;
|
|
2642
|
+
if (validator !== undefined) {
|
|
2643
|
+
if (validator(value) !== COMPILE_INVALID)
|
|
2644
|
+
return true;
|
|
2645
|
+
if (validator.definite === true && _ctx === undefined)
|
|
2646
|
+
return false;
|
|
2647
|
+
}
|
|
2648
|
+
return validateFallback(schema, value, _ctx);
|
|
2649
|
+
};
|
|
2650
|
+
function validateFallback(schema, value, _ctx) {
|
|
2651
|
+
const ctx = _ctx ? { ..._ctx, async: false, abortEarly: true } : { async: false, abortEarly: true };
|
|
2652
|
+
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
2653
|
+
let result;
|
|
2654
|
+
if (fallbackRun) {
|
|
2655
|
+
ctx[COMPILE_FALLBACK] = true;
|
|
2656
|
+
result = fallbackRun({ value, issues: [] }, ctx);
|
|
2657
|
+
} else {
|
|
2658
|
+
result = schema._zod.run({ value, issues: [] }, ctx);
|
|
2659
|
+
}
|
|
2660
|
+
if (result instanceof Promise) {
|
|
2661
|
+
throw new $ZodAsyncError;
|
|
2662
|
+
}
|
|
2663
|
+
return result.issues.length === 0;
|
|
2664
|
+
}
|
|
2665
|
+
var validateAsync = async (schema, value, _ctx) => {
|
|
2666
|
+
const ctx = _ctx ? { ..._ctx, async: true, abortEarly: true } : { async: true, abortEarly: true };
|
|
2667
|
+
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
2668
|
+
if (result instanceof Promise)
|
|
2669
|
+
result = await result;
|
|
2670
|
+
return result.issues.length === 0;
|
|
2621
2671
|
};
|
|
2622
|
-
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
2623
2672
|
var _encode = (_Err) => {
|
|
2624
2673
|
const parse = _parse(_Err);
|
|
2625
2674
|
const fn = (schema, value, _ctx, _params) => {
|
|
@@ -2664,7 +2713,7 @@ var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
2664
2713
|
var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
2665
2714
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
2666
2715
|
};
|
|
2667
|
-
// node_modules/.bun/zod@4.
|
|
2716
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/regexes.js
|
|
2668
2717
|
var cuid = /^[cC][0-9a-z]{6,}$/;
|
|
2669
2718
|
var cuid2 = /^[0-9a-z]+$/;
|
|
2670
2719
|
var ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
|
|
@@ -2681,8 +2730,8 @@ var uuid = (version) => {
|
|
|
2681
2730
|
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
2682
2731
|
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
2683
2732
|
};
|
|
2684
|
-
var email = /^(
|
|
2685
|
-
var _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
2733
|
+
var email = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
2734
|
+
var _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
2686
2735
|
function emoji() {
|
|
2687
2736
|
return new RegExp(_emoji, "u");
|
|
2688
2737
|
}
|
|
@@ -2691,7 +2740,7 @@ var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|(
|
|
|
2691
2740
|
var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
2692
2741
|
var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
2693
2742
|
var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
2694
|
-
var base64url = /^[A-Za-z0-9_-]
|
|
2743
|
+
var base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
|
|
2695
2744
|
var httpProtocol = /^https?$/;
|
|
2696
2745
|
var e164 = /^\+[1-9]\d{6,14}$/;
|
|
2697
2746
|
var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
@@ -2715,17 +2764,14 @@ function datetime(args) {
|
|
|
2715
2764
|
const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
|
|
2716
2765
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
2717
2766
|
}
|
|
2718
|
-
var
|
|
2719
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
2720
|
-
return new RegExp(`^${regex}$`);
|
|
2721
|
-
};
|
|
2767
|
+
var anyString = /^[\s\S]{0,}$/;
|
|
2722
2768
|
var integer = /^-?\d+$/;
|
|
2723
2769
|
var number2 = /^-?\d+(?:\.\d+)?$/;
|
|
2724
2770
|
var boolean2 = /^(?:true|false)$/i;
|
|
2725
2771
|
var lowercase = /^[^A-Z]*$/;
|
|
2726
2772
|
var uppercase = /^[^a-z]*$/;
|
|
2727
2773
|
|
|
2728
|
-
// node_modules/.bun/zod@4.
|
|
2774
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/checks.js
|
|
2729
2775
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
2730
2776
|
var _a;
|
|
2731
2777
|
inst._zod ?? (inst._zod = {});
|
|
@@ -2744,16 +2790,6 @@ var numericOriginMap = {
|
|
|
2744
2790
|
var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
2745
2791
|
$ZodCheck.init(inst, def);
|
|
2746
2792
|
const origin = numericOriginMap[typeof def.value];
|
|
2747
|
-
inst._zod.onattach.push((inst) => {
|
|
2748
|
-
const bag = inst._zod.bag;
|
|
2749
|
-
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
2750
|
-
if (def.value < curr) {
|
|
2751
|
-
if (def.inclusive)
|
|
2752
|
-
bag.maximum = def.value;
|
|
2753
|
-
else
|
|
2754
|
-
bag.exclusiveMaximum = def.value;
|
|
2755
|
-
}
|
|
2756
|
-
});
|
|
2757
2793
|
inst._zod.check = (payload) => {
|
|
2758
2794
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
|
|
2759
2795
|
return;
|
|
@@ -2772,16 +2808,6 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
|
|
|
2772
2808
|
var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
2773
2809
|
$ZodCheck.init(inst, def);
|
|
2774
2810
|
const origin = numericOriginMap[typeof def.value];
|
|
2775
|
-
inst._zod.onattach.push((inst) => {
|
|
2776
|
-
const bag = inst._zod.bag;
|
|
2777
|
-
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
2778
|
-
if (def.value > curr) {
|
|
2779
|
-
if (def.inclusive)
|
|
2780
|
-
bag.minimum = def.value;
|
|
2781
|
-
else
|
|
2782
|
-
bag.exclusiveMinimum = def.value;
|
|
2783
|
-
}
|
|
2784
|
-
});
|
|
2785
2811
|
inst._zod.check = (payload) => {
|
|
2786
2812
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
|
|
2787
2813
|
return;
|
|
@@ -2799,10 +2825,6 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
2799
2825
|
});
|
|
2800
2826
|
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
2801
2827
|
$ZodCheck.init(inst, def);
|
|
2802
|
-
inst._zod.onattach.push((inst) => {
|
|
2803
|
-
var _a;
|
|
2804
|
-
(_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
|
|
2805
|
-
});
|
|
2806
2828
|
inst._zod.check = (payload) => {
|
|
2807
2829
|
if (typeof payload.value !== typeof def.value)
|
|
2808
2830
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
@@ -2825,14 +2847,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2825
2847
|
const isInt = def.format?.includes("int");
|
|
2826
2848
|
const origin = isInt ? "int" : "number";
|
|
2827
2849
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
2828
|
-
inst._zod.onattach.push((inst) => {
|
|
2829
|
-
const bag = inst._zod.bag;
|
|
2830
|
-
bag.format = def.format;
|
|
2831
|
-
bag.minimum = minimum;
|
|
2832
|
-
bag.maximum = maximum;
|
|
2833
|
-
if (isInt)
|
|
2834
|
-
bag.pattern = integer;
|
|
2835
|
-
});
|
|
2836
2850
|
inst._zod.check = (payload) => {
|
|
2837
2851
|
const input = payload.value;
|
|
2838
2852
|
if (isInt) {
|
|
@@ -2902,11 +2916,6 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
2902
2916
|
var _a;
|
|
2903
2917
|
$ZodCheck.init(inst, def);
|
|
2904
2918
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
2905
|
-
inst._zod.onattach.push((inst) => {
|
|
2906
|
-
const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
2907
|
-
if (def.maximum < curr)
|
|
2908
|
-
inst._zod.bag.maximum = def.maximum;
|
|
2909
|
-
});
|
|
2910
2919
|
inst._zod.check = (payload) => {
|
|
2911
2920
|
const input = payload.value;
|
|
2912
2921
|
const units = input.length;
|
|
@@ -2929,11 +2938,6 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
2929
2938
|
var _a;
|
|
2930
2939
|
$ZodCheck.init(inst, def);
|
|
2931
2940
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
2932
|
-
inst._zod.onattach.push((inst) => {
|
|
2933
|
-
const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
2934
|
-
if (def.minimum > curr)
|
|
2935
|
-
inst._zod.bag.minimum = def.minimum;
|
|
2936
|
-
});
|
|
2937
2941
|
inst._zod.check = (payload) => {
|
|
2938
2942
|
const input = payload.value;
|
|
2939
2943
|
const units = input.length;
|
|
@@ -2956,12 +2960,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2956
2960
|
var _a;
|
|
2957
2961
|
$ZodCheck.init(inst, def);
|
|
2958
2962
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
2959
|
-
inst._zod.onattach.push((inst) => {
|
|
2960
|
-
const bag = inst._zod.bag;
|
|
2961
|
-
bag.minimum = def.length;
|
|
2962
|
-
bag.maximum = def.length;
|
|
2963
|
-
bag.length = def.length;
|
|
2964
|
-
});
|
|
2965
2963
|
inst._zod.check = (payload) => {
|
|
2966
2964
|
const input = payload.value;
|
|
2967
2965
|
const units = input.length;
|
|
@@ -2984,14 +2982,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2984
2982
|
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
2985
2983
|
var _a, _b;
|
|
2986
2984
|
$ZodCheck.init(inst, def);
|
|
2987
|
-
inst._zod.onattach.push((inst) => {
|
|
2988
|
-
const bag = inst._zod.bag;
|
|
2989
|
-
bag.format = def.format;
|
|
2990
|
-
if (def.pattern) {
|
|
2991
|
-
bag.patterns ?? (bag.patterns = new Set);
|
|
2992
|
-
bag.patterns.add(def.pattern);
|
|
2993
|
-
}
|
|
2994
|
-
});
|
|
2995
2985
|
if (def.pattern)
|
|
2996
2986
|
(_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
2997
2987
|
def.pattern.lastIndex = 0;
|
|
@@ -3040,11 +3030,6 @@ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst,
|
|
|
3040
3030
|
const escapedRegex = escapeRegex(def.includes);
|
|
3041
3031
|
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
3042
3032
|
def.pattern = pattern;
|
|
3043
|
-
inst._zod.onattach.push((inst) => {
|
|
3044
|
-
const bag = inst._zod.bag;
|
|
3045
|
-
bag.patterns ?? (bag.patterns = new Set);
|
|
3046
|
-
bag.patterns.add(pattern);
|
|
3047
|
-
});
|
|
3048
3033
|
inst._zod.check = (payload) => {
|
|
3049
3034
|
if (payload.value.includes(def.includes, def.position))
|
|
3050
3035
|
return;
|
|
@@ -3063,11 +3048,6 @@ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (i
|
|
|
3063
3048
|
$ZodCheck.init(inst, def);
|
|
3064
3049
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
3065
3050
|
def.pattern ?? (def.pattern = pattern);
|
|
3066
|
-
inst._zod.onattach.push((inst) => {
|
|
3067
|
-
const bag = inst._zod.bag;
|
|
3068
|
-
bag.patterns ?? (bag.patterns = new Set);
|
|
3069
|
-
bag.patterns.add(pattern);
|
|
3070
|
-
});
|
|
3071
3051
|
inst._zod.check = (payload) => {
|
|
3072
3052
|
if (payload.value.startsWith(def.prefix))
|
|
3073
3053
|
return;
|
|
@@ -3086,11 +3066,6 @@ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst,
|
|
|
3086
3066
|
$ZodCheck.init(inst, def);
|
|
3087
3067
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
3088
3068
|
def.pattern ?? (def.pattern = pattern);
|
|
3089
|
-
inst._zod.onattach.push((inst) => {
|
|
3090
|
-
const bag = inst._zod.bag;
|
|
3091
|
-
bag.patterns ?? (bag.patterns = new Set);
|
|
3092
|
-
bag.patterns.add(pattern);
|
|
3093
|
-
});
|
|
3094
3069
|
inst._zod.check = (payload) => {
|
|
3095
3070
|
if (payload.value.endsWith(def.suffix))
|
|
3096
3071
|
return;
|
|
@@ -3112,7 +3087,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
3112
3087
|
};
|
|
3113
3088
|
});
|
|
3114
3089
|
|
|
3115
|
-
// node_modules/.bun/zod@4.
|
|
3090
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/doc.js
|
|
3116
3091
|
class Doc {
|
|
3117
3092
|
constructor(args = [], closed = {}) {
|
|
3118
3093
|
this.content = [];
|
|
@@ -3122,8 +3097,11 @@ class Doc {
|
|
|
3122
3097
|
}
|
|
3123
3098
|
indented(fn) {
|
|
3124
3099
|
this.indent += 1;
|
|
3125
|
-
|
|
3126
|
-
|
|
3100
|
+
try {
|
|
3101
|
+
fn(this);
|
|
3102
|
+
} finally {
|
|
3103
|
+
this.indent -= 1;
|
|
3104
|
+
}
|
|
3127
3105
|
}
|
|
3128
3106
|
write(arg) {
|
|
3129
3107
|
if (typeof arg === "function") {
|
|
@@ -3151,14 +3129,14 @@ ${content.join(`
|
|
|
3151
3129
|
}
|
|
3152
3130
|
}
|
|
3153
3131
|
|
|
3154
|
-
// node_modules/.bun/zod@4.
|
|
3132
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/versions.js
|
|
3155
3133
|
var version = {
|
|
3156
3134
|
major: 4,
|
|
3157
|
-
minor:
|
|
3158
|
-
patch:
|
|
3135
|
+
minor: 6,
|
|
3136
|
+
patch: 1
|
|
3159
3137
|
};
|
|
3160
3138
|
|
|
3161
|
-
// node_modules/.bun/zod@4.
|
|
3139
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/schemas.js
|
|
3162
3140
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
3163
3141
|
var _a;
|
|
3164
3142
|
inst ?? (inst = {});
|
|
@@ -3267,15 +3245,21 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
3267
3245
|
own(this, "~standard", value);
|
|
3268
3246
|
}
|
|
3269
3247
|
});
|
|
3270
|
-
var toStandardResult = (r) => r.
|
|
3248
|
+
var toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
|
|
3249
|
+
async function validateAsync2(inst, value) {
|
|
3250
|
+
const ctx = { async: true };
|
|
3251
|
+
return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
|
|
3252
|
+
}
|
|
3271
3253
|
function standardProps(inst) {
|
|
3272
3254
|
return {
|
|
3273
3255
|
validate: (value) => {
|
|
3256
|
+
const ctx = { async: false };
|
|
3274
3257
|
try {
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
}
|
|
3258
|
+
const r = inst._zod.run({ value, issues: [] }, ctx);
|
|
3259
|
+
if (!(r instanceof Promise))
|
|
3260
|
+
return toStandardResult(r, ctx);
|
|
3261
|
+
} catch (_) {}
|
|
3262
|
+
return validateAsync2(inst, value);
|
|
3279
3263
|
},
|
|
3280
3264
|
vendor: "zod",
|
|
3281
3265
|
version: 1
|
|
@@ -3283,7 +3267,7 @@ function standardProps(inst) {
|
|
|
3283
3267
|
}
|
|
3284
3268
|
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
3285
3269
|
$ZodType.init(inst, def);
|
|
3286
|
-
inst._zod.pattern =
|
|
3270
|
+
inst._zod.pattern = def.pattern ?? anyString;
|
|
3287
3271
|
inst._zod.parse = (payload, _) => {
|
|
3288
3272
|
if (def.coerce)
|
|
3289
3273
|
try {
|
|
@@ -3451,12 +3435,6 @@ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
3451
3435
|
var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
|
|
3452
3436
|
def.pattern ?? (def.pattern = datetime(def));
|
|
3453
3437
|
$ZodStringFormat.init(inst, def);
|
|
3454
|
-
if (def.local || def.precision === -1) {
|
|
3455
|
-
inst._zod.bag.laxFormat = true;
|
|
3456
|
-
inst._zod.onattach.push((s) => {
|
|
3457
|
-
s._zod.bag.laxFormat = true;
|
|
3458
|
-
});
|
|
3459
|
-
}
|
|
3460
3438
|
});
|
|
3461
3439
|
var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
|
|
3462
3440
|
def.pattern ?? (def.pattern = date);
|
|
@@ -3473,7 +3451,6 @@ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def
|
|
|
3473
3451
|
var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
|
|
3474
3452
|
def.pattern ?? (def.pattern = ipv4);
|
|
3475
3453
|
$ZodStringFormat.init(inst, def);
|
|
3476
|
-
inst._zod.bag.format = `ipv4`;
|
|
3477
3454
|
});
|
|
3478
3455
|
var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
3479
3456
|
function isValidIPv6(value) {
|
|
@@ -3489,7 +3466,6 @@ function isValidIPv6(value) {
|
|
|
3489
3466
|
var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
3490
3467
|
def.pattern ?? (def.pattern = ipv6);
|
|
3491
3468
|
$ZodStringFormat.init(inst, def);
|
|
3492
|
-
inst._zod.bag.format = `ipv6`;
|
|
3493
3469
|
inst._zod.check = (payload) => {
|
|
3494
3470
|
if (!isValidIPv6(payload.value)) {
|
|
3495
3471
|
payload.issues.push({
|
|
@@ -3549,10 +3525,10 @@ function isValidBase64(data) {
|
|
|
3549
3525
|
return false;
|
|
3550
3526
|
}
|
|
3551
3527
|
}
|
|
3528
|
+
var base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
3552
3529
|
var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
3553
|
-
def.pattern ?? (def.pattern =
|
|
3530
|
+
def.pattern ?? (def.pattern = base64Charset);
|
|
3554
3531
|
$ZodStringFormat.init(inst, def);
|
|
3555
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
3556
3532
|
inst._zod.check = (payload) => {
|
|
3557
3533
|
if (isValidBase64(payload.value))
|
|
3558
3534
|
return;
|
|
@@ -3565,17 +3541,17 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
3565
3541
|
});
|
|
3566
3542
|
};
|
|
3567
3543
|
});
|
|
3544
|
+
var base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
3568
3545
|
function isValidBase64URL(data) {
|
|
3569
|
-
if (!
|
|
3546
|
+
if (!base64urlCharset.test(data))
|
|
3570
3547
|
return false;
|
|
3571
3548
|
const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
3572
3549
|
const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
|
|
3573
3550
|
return isValidBase64(padded);
|
|
3574
3551
|
}
|
|
3575
3552
|
var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
3576
|
-
def.pattern ?? (def.pattern =
|
|
3553
|
+
def.pattern ?? (def.pattern = base64urlCharset);
|
|
3577
3554
|
$ZodStringFormat.init(inst, def);
|
|
3578
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
3579
3555
|
inst._zod.check = (payload) => {
|
|
3580
3556
|
if (isValidBase64URL(payload.value))
|
|
3581
3557
|
return;
|
|
@@ -3628,7 +3604,7 @@ var $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
|
|
|
3628
3604
|
});
|
|
3629
3605
|
var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
3630
3606
|
$ZodType.init(inst, def);
|
|
3631
|
-
inst._zod.pattern =
|
|
3607
|
+
inst._zod.pattern = number2;
|
|
3632
3608
|
inst._zod.parse = (payload, _ctx) => {
|
|
3633
3609
|
if (def.coerce)
|
|
3634
3610
|
try {
|
|
@@ -3712,6 +3688,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3712
3688
|
}
|
|
3713
3689
|
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
3714
3690
|
const proms = [];
|
|
3691
|
+
const abortEarly = ctx?.abortEarly;
|
|
3715
3692
|
for (let i = 0;i < input.length; i++) {
|
|
3716
3693
|
const item = input[i];
|
|
3717
3694
|
const result = def.element._zod.run({
|
|
@@ -3722,6 +3699,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3722
3699
|
proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
3723
3700
|
} else {
|
|
3724
3701
|
handleArrayResult(result, payload, i);
|
|
3702
|
+
if (abortEarly && result.issues.length !== 0 && aborted(result))
|
|
3703
|
+
break;
|
|
3725
3704
|
}
|
|
3726
3705
|
}
|
|
3727
3706
|
if (proms.length) {
|
|
@@ -3782,14 +3761,20 @@ function normalizeDef(def) {
|
|
|
3782
3761
|
optionalKeys: new Set(okeys)
|
|
3783
3762
|
};
|
|
3784
3763
|
}
|
|
3785
|
-
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
3764
|
+
function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
|
|
3786
3765
|
const unrecognized = [];
|
|
3787
3766
|
const keySet = def.keySet;
|
|
3788
3767
|
const _catchall = def.catchall._zod;
|
|
3789
3768
|
const t = _catchall.def.type;
|
|
3790
3769
|
const optin = _catchall.optin;
|
|
3791
3770
|
const optout = _catchall.optout;
|
|
3771
|
+
let seen = 0;
|
|
3792
3772
|
for (const key in input) {
|
|
3773
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3774
|
+
if (aborted(payload, seen))
|
|
3775
|
+
break;
|
|
3776
|
+
seen = payload.issues.length;
|
|
3777
|
+
}
|
|
3793
3778
|
if (keySet.has(key))
|
|
3794
3779
|
continue;
|
|
3795
3780
|
if (key === "__proto__") {
|
|
@@ -3823,23 +3808,19 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
3823
3808
|
return payload;
|
|
3824
3809
|
});
|
|
3825
3810
|
}
|
|
3826
|
-
var propShapes = new WeakMap;
|
|
3827
3811
|
var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
3828
3812
|
$ZodType.init(inst, def);
|
|
3829
3813
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
return newSh;
|
|
3841
|
-
}
|
|
3842
|
-
});
|
|
3814
|
+
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
3815
|
+
if (sh) {
|
|
3816
|
+
const get = () => {
|
|
3817
|
+
const newSh = { ...sh };
|
|
3818
|
+
Object.defineProperty(def, "shape", { value: newSh });
|
|
3819
|
+
get.raw = newSh;
|
|
3820
|
+
return newSh;
|
|
3821
|
+
};
|
|
3822
|
+
get.raw = sh;
|
|
3823
|
+
Object.defineProperty(def, "shape", { get });
|
|
3843
3824
|
}
|
|
3844
3825
|
const _normalized = cached(() => normalizeDef(def));
|
|
3845
3826
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
@@ -3879,7 +3860,14 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3879
3860
|
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
3880
3861
|
const proms = [];
|
|
3881
3862
|
const shape = value.shape;
|
|
3863
|
+
const abortEarly = ctx?.abortEarly;
|
|
3864
|
+
let seen = payload.issues.length;
|
|
3882
3865
|
for (const key of value.allKeys) {
|
|
3866
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3867
|
+
if (aborted(payload, seen))
|
|
3868
|
+
break;
|
|
3869
|
+
seen = payload.issues.length;
|
|
3870
|
+
}
|
|
3883
3871
|
if (key === "__proto__")
|
|
3884
3872
|
continue;
|
|
3885
3873
|
const el = shape[key];
|
|
@@ -3895,7 +3883,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3895
3883
|
if (!catchall) {
|
|
3896
3884
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
3897
3885
|
}
|
|
3898
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
3886
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
3899
3887
|
};
|
|
3900
3888
|
});
|
|
3901
3889
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -3909,10 +3897,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3909
3897
|
const doc = new Doc(["payload", "ctx"], { shape, inst, memo, syms });
|
|
3910
3898
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
3911
3899
|
const prefixStr = (id, k) => `
|
|
3900
|
+
let ${id}_ab = false;
|
|
3912
3901
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
3913
3902
|
const iss = ${id}.issues[i];
|
|
3914
3903
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
3915
3904
|
payload.issues.push(iss);
|
|
3905
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
3906
|
+
}
|
|
3907
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
3908
|
+
payload.value = newResult;
|
|
3909
|
+
return payload;
|
|
3916
3910
|
}`;
|
|
3917
3911
|
doc.write(`const input = payload.value;`);
|
|
3918
3912
|
const ids = Object.create(null);
|
|
@@ -3958,6 +3952,10 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3958
3952
|
input: undefined,
|
|
3959
3953
|
path: [${k}]
|
|
3960
3954
|
});
|
|
3955
|
+
if (ctx && ctx.abortEarly) {
|
|
3956
|
+
payload.value = newResult;
|
|
3957
|
+
return payload;
|
|
3958
|
+
}
|
|
3961
3959
|
}
|
|
3962
3960
|
|
|
3963
3961
|
if (${id}_present) {
|
|
@@ -4010,7 +4008,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
4010
4008
|
payload = fastpass(payload, ctx);
|
|
4011
4009
|
if (!catchall)
|
|
4012
4010
|
return payload;
|
|
4013
|
-
return handleCatchall([], input, payload, ctx, value, inst);
|
|
4011
|
+
return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
4014
4012
|
}
|
|
4015
4013
|
return superParse(payload, ctx);
|
|
4016
4014
|
};
|
|
@@ -4080,16 +4078,37 @@ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
|
4080
4078
|
});
|
|
4081
4079
|
};
|
|
4082
4080
|
});
|
|
4081
|
+
function discriminatorMap(def) {
|
|
4082
|
+
const map = new Map;
|
|
4083
|
+
for (const option of def.options) {
|
|
4084
|
+
const values = option._zod.propValues?.[def.discriminator];
|
|
4085
|
+
if (!values || values.size === 0)
|
|
4086
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
4087
|
+
for (const value of values) {
|
|
4088
|
+
if (map.has(value)) {
|
|
4089
|
+
if (value !== undefined)
|
|
4090
|
+
throw new Error(`Duplicate discriminator value "${String(value)}"`);
|
|
4091
|
+
map.set(value, null);
|
|
4092
|
+
} else {
|
|
4093
|
+
map.set(value, option);
|
|
4094
|
+
}
|
|
4095
|
+
}
|
|
4096
|
+
}
|
|
4097
|
+
return map;
|
|
4098
|
+
}
|
|
4083
4099
|
var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
4084
4100
|
def.inclusive = false;
|
|
4085
4101
|
$ZodUnion.init(inst, def);
|
|
4086
4102
|
const _super = inst._zod.parse;
|
|
4087
4103
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
4088
4104
|
const propValues = {};
|
|
4105
|
+
let undefinedCount = 0;
|
|
4089
4106
|
for (const option of zod.def.options) {
|
|
4090
4107
|
const pv = option._zod.propValues;
|
|
4091
4108
|
if (!pv || Object.keys(pv).length === 0)
|
|
4092
4109
|
throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
4110
|
+
if (pv[zod.def.discriminator]?.has(undefined))
|
|
4111
|
+
undefinedCount++;
|
|
4093
4112
|
for (const [k, v] of Object.entries(pv)) {
|
|
4094
4113
|
if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
|
|
4095
4114
|
assignProp(propValues, k, new Set);
|
|
@@ -4099,30 +4118,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
4099
4118
|
}
|
|
4100
4119
|
}
|
|
4101
4120
|
}
|
|
4121
|
+
if (!zod.def.unionFallback && undefinedCount > 1)
|
|
4122
|
+
propValues[zod.def.discriminator]?.delete(undefined);
|
|
4102
4123
|
return propValues;
|
|
4103
4124
|
});
|
|
4104
4125
|
def.options.forEach((option, i) => {
|
|
4105
|
-
const propShape =
|
|
4126
|
+
const propShape = rawShape(option._zod.def);
|
|
4106
4127
|
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
|
|
4107
4128
|
throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
4108
4129
|
}
|
|
4109
4130
|
});
|
|
4110
|
-
const disc = cached(() =>
|
|
4111
|
-
const opts = def.options;
|
|
4112
|
-
const map = new Map;
|
|
4113
|
-
for (const o of opts) {
|
|
4114
|
-
const values = o._zod.propValues?.[def.discriminator];
|
|
4115
|
-
if (!values || values.size === 0)
|
|
4116
|
-
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
4117
|
-
for (const v of values) {
|
|
4118
|
-
if (map.has(v)) {
|
|
4119
|
-
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
4120
|
-
}
|
|
4121
|
-
map.set(v, o);
|
|
4122
|
-
}
|
|
4123
|
-
}
|
|
4124
|
-
return map;
|
|
4125
|
-
});
|
|
4131
|
+
const disc = cached(() => discriminatorMap(def));
|
|
4126
4132
|
inst._zod.parse = (payload, ctx) => {
|
|
4127
4133
|
const input = payload.value;
|
|
4128
4134
|
if (!isObject(input)) {
|
|
@@ -4134,8 +4140,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
4134
4140
|
});
|
|
4135
4141
|
return payload;
|
|
4136
4142
|
}
|
|
4137
|
-
const
|
|
4138
|
-
|
|
4143
|
+
const value = input?.[def.discriminator];
|
|
4144
|
+
const opt = disc.value.get(value);
|
|
4145
|
+
if (opt && (value !== undefined || ctx.direction !== "backward")) {
|
|
4139
4146
|
return opt._zod.run(payload, ctx);
|
|
4140
4147
|
}
|
|
4141
4148
|
if (def.unionFallback || ctx.direction === "backward") {
|
|
@@ -4146,7 +4153,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
4146
4153
|
errors: [],
|
|
4147
4154
|
note: "No matching discriminator",
|
|
4148
4155
|
discriminator: def.discriminator,
|
|
4149
|
-
options: Array.from(disc.value.keys()),
|
|
4156
|
+
options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),
|
|
4150
4157
|
input,
|
|
4151
4158
|
path: [def.discriminator],
|
|
4152
4159
|
inst
|
|
@@ -4428,8 +4435,10 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
4428
4435
|
const values = getEnumValues(def.entries);
|
|
4429
4436
|
const valuesSet = new Set(values);
|
|
4430
4437
|
inst._zod.values = valuesSet;
|
|
4431
|
-
|
|
4432
|
-
|
|
4438
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
4439
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
4440
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
4441
|
+
});
|
|
4433
4442
|
inst._zod.parse = (payload, _ctx) => {
|
|
4434
4443
|
const input = payload.value;
|
|
4435
4444
|
if (valuesSet.has(input)) {
|
|
@@ -4448,7 +4457,10 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
4448
4457
|
$ZodType.init(inst, def);
|
|
4449
4458
|
const values = new Set(def.values);
|
|
4450
4459
|
inst._zod.values = values;
|
|
4451
|
-
inst
|
|
4460
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
4461
|
+
const vals = zod.def.values;
|
|
4462
|
+
return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
4463
|
+
});
|
|
4452
4464
|
inst._zod.parse = (payload, _ctx) => {
|
|
4453
4465
|
const input = payload.value;
|
|
4454
4466
|
if (values.has(input)) {
|
|
@@ -4716,7 +4728,62 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
4716
4728
|
payload.issues.push(issue(_iss));
|
|
4717
4729
|
}
|
|
4718
4730
|
}
|
|
4719
|
-
|
|
4731
|
+
function handlePropertiesResult(result, payload, key) {
|
|
4732
|
+
if (result.issues.length) {
|
|
4733
|
+
payload.issues.push(...prefixIssues(key, result.issues));
|
|
4734
|
+
}
|
|
4735
|
+
}
|
|
4736
|
+
var $ZodProperties = /* @__PURE__ */ $constructor("$ZodProperties", (inst, def) => {
|
|
4737
|
+
$ZodType.init(inst, def);
|
|
4738
|
+
$ZodCheck.init(inst, def);
|
|
4739
|
+
const memo = globalConfig.memoizer;
|
|
4740
|
+
memo?.attach(inst);
|
|
4741
|
+
let entries;
|
|
4742
|
+
const runShape = (payload, ctx) => {
|
|
4743
|
+
entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
|
|
4744
|
+
const input = payload.value;
|
|
4745
|
+
let proms;
|
|
4746
|
+
for (const [key, schema] of entries) {
|
|
4747
|
+
const result = schema._zod.run({ value: input[key], issues: [] }, ctx);
|
|
4748
|
+
if (result instanceof Promise) {
|
|
4749
|
+
proms ?? (proms = []);
|
|
4750
|
+
proms.push(result.then((result) => handlePropertiesResult(result, payload, key)));
|
|
4751
|
+
} else {
|
|
4752
|
+
handlePropertiesResult(result, payload, key);
|
|
4753
|
+
}
|
|
4754
|
+
}
|
|
4755
|
+
if (proms)
|
|
4756
|
+
return Promise.all(proms).then(() => {
|
|
4757
|
+
return;
|
|
4758
|
+
});
|
|
4759
|
+
return;
|
|
4760
|
+
};
|
|
4761
|
+
inst._zod.parse = (payload, ctx) => {
|
|
4762
|
+
const input = payload.value;
|
|
4763
|
+
if (input === null || typeof input !== "object" && typeof input !== "function") {
|
|
4764
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input, inst });
|
|
4765
|
+
return payload;
|
|
4766
|
+
}
|
|
4767
|
+
if (ctx.direction === "backward")
|
|
4768
|
+
ctx = { ...ctx, direction: "forward" };
|
|
4769
|
+
if (memo)
|
|
4770
|
+
memo.alloc(inst, payload, input, ctx);
|
|
4771
|
+
const result = runShape(payload, ctx);
|
|
4772
|
+
return result instanceof Promise ? result.then(() => payload) : payload;
|
|
4773
|
+
};
|
|
4774
|
+
inst._zod.check = (payload) => {
|
|
4775
|
+
if (payload.value == null) {
|
|
4776
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
|
|
4777
|
+
return;
|
|
4778
|
+
}
|
|
4779
|
+
return runShape(payload, {});
|
|
4780
|
+
};
|
|
4781
|
+
}, {
|
|
4782
|
+
*[Symbol.iterator]() {
|
|
4783
|
+
yield this;
|
|
4784
|
+
}
|
|
4785
|
+
});
|
|
4786
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/memoizer.js
|
|
4720
4787
|
class $ZodCyclicError extends Error {
|
|
4721
4788
|
constructor() {
|
|
4722
4789
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -4725,31 +4792,59 @@ class $ZodCyclicError extends Error {
|
|
|
4725
4792
|
}
|
|
4726
4793
|
var STATE = "~memo";
|
|
4727
4794
|
var NO_ISSUES = [];
|
|
4795
|
+
function isRef(value) {
|
|
4796
|
+
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
4797
|
+
}
|
|
4728
4798
|
function cloneIssues(issues) {
|
|
4729
4799
|
return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
|
|
4730
4800
|
}
|
|
4731
4801
|
var recursive = /* @__PURE__ */ new WeakMap;
|
|
4732
|
-
|
|
4802
|
+
var NONE = 0;
|
|
4803
|
+
var ASSUMED = 1;
|
|
4804
|
+
var PROVEN = 2;
|
|
4805
|
+
function isRecursive(inst, stack, resolve) {
|
|
4733
4806
|
const cached = recursive.get(inst);
|
|
4734
4807
|
if (cached !== undefined)
|
|
4735
|
-
return cached;
|
|
4808
|
+
return cached ? PROVEN : NONE;
|
|
4736
4809
|
if (stack.has(inst))
|
|
4737
|
-
return
|
|
4810
|
+
return PROVEN;
|
|
4738
4811
|
stack.add(inst);
|
|
4739
|
-
let result =
|
|
4812
|
+
let result = NONE;
|
|
4740
4813
|
const check = (child) => {
|
|
4741
|
-
if (
|
|
4742
|
-
|
|
4814
|
+
if (result !== PROVEN && child?._zod) {
|
|
4815
|
+
const answer = isRecursive(child, stack, resolve);
|
|
4816
|
+
if (answer > result)
|
|
4817
|
+
result = answer;
|
|
4818
|
+
}
|
|
4819
|
+
};
|
|
4820
|
+
const shape = (sh, spread) => {
|
|
4821
|
+
let answer = NONE;
|
|
4822
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
4823
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
4824
|
+
if (spread && !desc.enumerable)
|
|
4825
|
+
continue;
|
|
4826
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
4827
|
+
if (child > answer)
|
|
4828
|
+
answer = child;
|
|
4829
|
+
}
|
|
4830
|
+
return answer;
|
|
4831
|
+
};
|
|
4832
|
+
const merge = (answer) => {
|
|
4833
|
+
if (answer > result)
|
|
4834
|
+
result = answer;
|
|
4743
4835
|
};
|
|
4744
4836
|
const def = inst._zod.def;
|
|
4745
4837
|
const kind = def.type;
|
|
4746
4838
|
switch (kind) {
|
|
4747
4839
|
case "object": {
|
|
4748
|
-
|
|
4749
|
-
|
|
4840
|
+
const raw = rawShape(def);
|
|
4841
|
+
merge(raw ? shape(raw, true) : ASSUMED);
|
|
4750
4842
|
check(def.catchall);
|
|
4751
4843
|
break;
|
|
4752
4844
|
}
|
|
4845
|
+
case "properties":
|
|
4846
|
+
merge(shape(def.shape, false));
|
|
4847
|
+
break;
|
|
4753
4848
|
case "array":
|
|
4754
4849
|
check(def.element);
|
|
4755
4850
|
break;
|
|
@@ -4793,9 +4888,11 @@ function isRecursive(inst, stack) {
|
|
|
4793
4888
|
check(def.input);
|
|
4794
4889
|
check(def.output);
|
|
4795
4890
|
break;
|
|
4796
|
-
case "lazy":
|
|
4797
|
-
|
|
4891
|
+
case "lazy": {
|
|
4892
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : undefined);
|
|
4893
|
+
merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
4798
4894
|
break;
|
|
4895
|
+
}
|
|
4799
4896
|
case "template_literal":
|
|
4800
4897
|
case "string":
|
|
4801
4898
|
case "number":
|
|
@@ -4834,13 +4931,17 @@ function isRecursive(inst, stack) {
|
|
|
4834
4931
|
}
|
|
4835
4932
|
}
|
|
4836
4933
|
stack.delete(inst);
|
|
4837
|
-
|
|
4838
|
-
|
|
4934
|
+
return settle(inst, result);
|
|
4935
|
+
}
|
|
4936
|
+
function settle(inst, answer) {
|
|
4937
|
+
if (answer !== ASSUMED)
|
|
4938
|
+
recursive.set(inst, answer === PROVEN);
|
|
4939
|
+
return answer;
|
|
4839
4940
|
}
|
|
4840
4941
|
function bucketFor(state, inst) {
|
|
4841
4942
|
let bucket = state.buckets.get(inst);
|
|
4842
4943
|
if (!bucket) {
|
|
4843
|
-
bucket = new
|
|
4944
|
+
bucket = new WeakMap;
|
|
4844
4945
|
state.buckets.set(inst, bucket);
|
|
4845
4946
|
}
|
|
4846
4947
|
return bucket;
|
|
@@ -4876,6 +4977,7 @@ var memo = {
|
|
|
4876
4977
|
attach(inst) {
|
|
4877
4978
|
var _a;
|
|
4878
4979
|
let isRecursiveInst;
|
|
4980
|
+
let rechecked = false;
|
|
4879
4981
|
let lastCtx;
|
|
4880
4982
|
let lastBucket;
|
|
4881
4983
|
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
@@ -4883,20 +4985,24 @@ var memo = {
|
|
|
4883
4985
|
const base = inst._zod.parse;
|
|
4884
4986
|
const wrapped = (payload, ctx) => {
|
|
4885
4987
|
if (isRecursiveInst === undefined) {
|
|
4886
|
-
|
|
4887
|
-
if (
|
|
4988
|
+
const walked = isRecursive(inst, new Set, false);
|
|
4989
|
+
if (walked === NONE) {
|
|
4888
4990
|
inst._zod.parse = base;
|
|
4889
4991
|
if (inst._zod.run === wrapped)
|
|
4890
4992
|
inst._zod.run = base;
|
|
4891
4993
|
return base(payload, ctx);
|
|
4892
4994
|
}
|
|
4995
|
+
if (walked === PROVEN || rechecked)
|
|
4996
|
+
isRecursiveInst = true;
|
|
4997
|
+
else
|
|
4998
|
+
rechecked = true;
|
|
4893
4999
|
}
|
|
4894
5000
|
const input = payload.value;
|
|
4895
|
-
if (input
|
|
5001
|
+
if (!isRef(input))
|
|
4896
5002
|
return base(payload, ctx);
|
|
4897
5003
|
let state = ctx[STATE];
|
|
4898
5004
|
if (!state) {
|
|
4899
|
-
state = { buckets: new
|
|
5005
|
+
state = { buckets: new WeakMap, backEdges: undefined };
|
|
4900
5006
|
ctx[STATE] = state;
|
|
4901
5007
|
}
|
|
4902
5008
|
let bucket;
|
|
@@ -4915,7 +5021,7 @@ var memo = {
|
|
|
4915
5021
|
payload.issues.push(...cloneIssues(hit.issues));
|
|
4916
5022
|
} else {
|
|
4917
5023
|
payload.memo = true;
|
|
4918
|
-
state.backEdges ?? (state.backEdges = new
|
|
5024
|
+
state.backEdges ?? (state.backEdges = new WeakSet);
|
|
4919
5025
|
state.backEdges.add(hit.value);
|
|
4920
5026
|
}
|
|
4921
5027
|
return payload;
|
|
@@ -4947,9 +5053,9 @@ function memoizer() {
|
|
|
4947
5053
|
}
|
|
4948
5054
|
function isBackEdge(ctx, value) {
|
|
4949
5055
|
const backEdges = ctx[STATE]?.backEdges;
|
|
4950
|
-
return backEdges !== undefined && value
|
|
5056
|
+
return backEdges !== undefined && isRef(value) && backEdges.has(value);
|
|
4951
5057
|
}
|
|
4952
|
-
// node_modules/.bun/zod@4.
|
|
5058
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/locales/en.js
|
|
4953
5059
|
var error = () => {
|
|
4954
5060
|
const Sizable = {
|
|
4955
5061
|
string: { unit: "characters", verb: "to have" },
|
|
@@ -4990,6 +5096,7 @@ var error = () => {
|
|
|
4990
5096
|
json_string: "JSON string",
|
|
4991
5097
|
e164: "E.164 number",
|
|
4992
5098
|
credit_card: "credit card number",
|
|
5099
|
+
iban: "IBAN",
|
|
4993
5100
|
jwt: "JWT",
|
|
4994
5101
|
template_literal: "input"
|
|
4995
5102
|
};
|
|
@@ -5069,7 +5176,7 @@ function en_default() {
|
|
|
5069
5176
|
localeError: error()
|
|
5070
5177
|
};
|
|
5071
5178
|
}
|
|
5072
|
-
// node_modules/.bun/zod@4.
|
|
5179
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/registries.js
|
|
5073
5180
|
var _a2;
|
|
5074
5181
|
class $ZodRegistry {
|
|
5075
5182
|
constructor() {
|
|
@@ -5116,7 +5223,7 @@ function registry() {
|
|
|
5116
5223
|
}
|
|
5117
5224
|
(_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
|
|
5118
5225
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
5119
|
-
// node_modules/.bun/zod@4.
|
|
5226
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/api.js
|
|
5120
5227
|
function _string(Class, params) {
|
|
5121
5228
|
return new Class({
|
|
5122
5229
|
type: "string",
|
|
@@ -5566,7 +5673,7 @@ function _check(fn, params) {
|
|
|
5566
5673
|
ch._zod.check = fn;
|
|
5567
5674
|
return ch;
|
|
5568
5675
|
}
|
|
5569
|
-
// node_modules/.bun/zod@4.
|
|
5676
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/to-json-schema.js
|
|
5570
5677
|
function assignProps(target, ...sources) {
|
|
5571
5678
|
for (const source of sources) {
|
|
5572
5679
|
for (const key of Reflect.ownKeys(source)) {
|
|
@@ -5610,7 +5717,7 @@ function handleUnrepresentable(schema, ctx, json, params, message) {
|
|
|
5610
5717
|
Object.assign(json, result);
|
|
5611
5718
|
return true;
|
|
5612
5719
|
}
|
|
5613
|
-
function
|
|
5720
|
+
function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
5614
5721
|
var _a;
|
|
5615
5722
|
const def = schema._zod.def;
|
|
5616
5723
|
const seen = ctx.seen.get(schema);
|
|
@@ -5649,7 +5756,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
5649
5756
|
if (parent) {
|
|
5650
5757
|
if (!result.ref)
|
|
5651
5758
|
result.ref = parent;
|
|
5652
|
-
|
|
5759
|
+
processSchema(parent, ctx, params);
|
|
5653
5760
|
ctx.seen.get(parent).isParent = true;
|
|
5654
5761
|
}
|
|
5655
5762
|
}
|
|
@@ -5754,7 +5861,6 @@ function extractDefs(ctx, schema) {
|
|
|
5754
5861
|
if (seen.count > 1) {
|
|
5755
5862
|
if (ctx.reused === "ref") {
|
|
5756
5863
|
extractToDef(entry);
|
|
5757
|
-
continue;
|
|
5758
5864
|
}
|
|
5759
5865
|
}
|
|
5760
5866
|
}
|
|
@@ -6079,18 +6185,106 @@ function isTransforming(_schema, _ctx) {
|
|
|
6079
6185
|
}
|
|
6080
6186
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
6081
6187
|
const ctx = initializeContext({ ...params, processors });
|
|
6082
|
-
|
|
6188
|
+
processSchema(schema, ctx);
|
|
6083
6189
|
extractDefs(ctx, schema);
|
|
6084
6190
|
return finalize(ctx, schema);
|
|
6085
6191
|
};
|
|
6086
6192
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
6087
6193
|
const { libraryOptions, target } = params ?? {};
|
|
6088
6194
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
6089
|
-
|
|
6195
|
+
processSchema(schema, ctx);
|
|
6090
6196
|
extractDefs(ctx, schema);
|
|
6091
6197
|
return finalize(ctx, schema);
|
|
6092
6198
|
};
|
|
6093
|
-
// node_modules/.bun/zod@4.
|
|
6199
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/core/json-schema-processors.js
|
|
6200
|
+
var narrowMin = (agg, key, value) => {
|
|
6201
|
+
if (agg[key] === undefined || value > agg[key])
|
|
6202
|
+
agg[key] = value;
|
|
6203
|
+
};
|
|
6204
|
+
var narrowMax = (agg, key, value) => {
|
|
6205
|
+
if (agg[key] === undefined || value < agg[key])
|
|
6206
|
+
agg[key] = value;
|
|
6207
|
+
};
|
|
6208
|
+
var narrowBoth = (agg, value) => {
|
|
6209
|
+
narrowMin(agg, "minimum", value);
|
|
6210
|
+
narrowMax(agg, "maximum", value);
|
|
6211
|
+
};
|
|
6212
|
+
var addDivisor = (agg, value) => {
|
|
6213
|
+
agg.multipleOf ?? (agg.multipleOf = []);
|
|
6214
|
+
if (!agg.multipleOf.includes(value))
|
|
6215
|
+
agg.multipleOf.push(value);
|
|
6216
|
+
};
|
|
6217
|
+
var addPattern = (agg, pattern) => {
|
|
6218
|
+
agg.patterns ?? (agg.patterns = new Set);
|
|
6219
|
+
agg.patterns.add(pattern);
|
|
6220
|
+
};
|
|
6221
|
+
var intersectMime = (agg, mime) => {
|
|
6222
|
+
agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
|
|
6223
|
+
};
|
|
6224
|
+
var setFormat = (agg, format) => {
|
|
6225
|
+
agg.format = format;
|
|
6226
|
+
if (format.includes("int"))
|
|
6227
|
+
agg.isInt = true;
|
|
6228
|
+
};
|
|
6229
|
+
var minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
|
|
6230
|
+
var maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
|
|
6231
|
+
var formatContributor = (ranges) => (agg, def) => {
|
|
6232
|
+
setFormat(agg, def.format);
|
|
6233
|
+
const [minimum, maximum] = ranges[def.format];
|
|
6234
|
+
narrowMin(agg, "minimum", minimum);
|
|
6235
|
+
narrowMax(agg, "maximum", maximum);
|
|
6236
|
+
};
|
|
6237
|
+
var contributors = {
|
|
6238
|
+
greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
|
|
6239
|
+
less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
|
|
6240
|
+
multiple_of: (agg, def) => addDivisor(agg, def.value),
|
|
6241
|
+
number_format: formatContributor(NUMBER_FORMAT_RANGES),
|
|
6242
|
+
bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
|
|
6243
|
+
min_length: minContributor,
|
|
6244
|
+
max_length: maxContributor,
|
|
6245
|
+
length_equals: (agg, def) => narrowBoth(agg, def.length),
|
|
6246
|
+
min_size: minContributor,
|
|
6247
|
+
max_size: maxContributor,
|
|
6248
|
+
size_equals: (agg, def) => narrowBoth(agg, def.size),
|
|
6249
|
+
string_format: (agg, def) => {
|
|
6250
|
+
setFormat(agg, def.format);
|
|
6251
|
+
if (def.pattern)
|
|
6252
|
+
addPattern(agg, def.pattern);
|
|
6253
|
+
if (def.format === "base64" || def.format === "base64url")
|
|
6254
|
+
agg.contentEncoding = def.format;
|
|
6255
|
+
if (def.local || def.precision === -1)
|
|
6256
|
+
agg.laxFormat = true;
|
|
6257
|
+
},
|
|
6258
|
+
mime_type: (agg, def) => intersectMime(agg, def.mime)
|
|
6259
|
+
};
|
|
6260
|
+
function aggregateChecks(schema) {
|
|
6261
|
+
const agg = {};
|
|
6262
|
+
const def = schema._zod.def;
|
|
6263
|
+
const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
6264
|
+
for (const ch of list)
|
|
6265
|
+
contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
6266
|
+
const bag = schema._zod.bag;
|
|
6267
|
+
if (bag.minimum !== undefined)
|
|
6268
|
+
narrowMin(agg, "minimum", bag.minimum);
|
|
6269
|
+
if (bag.exclusiveMinimum !== undefined)
|
|
6270
|
+
narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
|
|
6271
|
+
if (bag.maximum !== undefined)
|
|
6272
|
+
narrowMax(agg, "maximum", bag.maximum);
|
|
6273
|
+
if (bag.exclusiveMaximum !== undefined)
|
|
6274
|
+
narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
|
|
6275
|
+
if (bag.multipleOf !== undefined)
|
|
6276
|
+
addDivisor(agg, bag.multipleOf);
|
|
6277
|
+
if (bag.format !== undefined) {
|
|
6278
|
+
agg.format ?? (agg.format = bag.format);
|
|
6279
|
+
if (bag.format.includes("int"))
|
|
6280
|
+
agg.isInt = true;
|
|
6281
|
+
}
|
|
6282
|
+
if (bag.mime)
|
|
6283
|
+
intersectMime(agg, bag.mime);
|
|
6284
|
+
for (const pattern of bag.patterns ?? [])
|
|
6285
|
+
addPattern(agg, pattern);
|
|
6286
|
+
return agg;
|
|
6287
|
+
}
|
|
6094
6288
|
var formatMap = {
|
|
6095
6289
|
guid: "uuid",
|
|
6096
6290
|
url: "uri",
|
|
@@ -6098,10 +6292,15 @@ var formatMap = {
|
|
|
6098
6292
|
json_string: "json-string",
|
|
6099
6293
|
regex: ""
|
|
6100
6294
|
};
|
|
6295
|
+
var exactPatterns = new Map([
|
|
6296
|
+
[base64Charset, base64],
|
|
6297
|
+
[base64urlCharset, base64url]
|
|
6298
|
+
]);
|
|
6299
|
+
var exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
6101
6300
|
var stringProcessor = (schema, ctx, _json, _params) => {
|
|
6102
6301
|
const json = _json;
|
|
6103
6302
|
json.type = "string";
|
|
6104
|
-
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema
|
|
6303
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
|
|
6105
6304
|
if (typeof minimum === "number")
|
|
6106
6305
|
json.minLength = minimum;
|
|
6107
6306
|
if (typeof maximum === "number")
|
|
@@ -6117,7 +6316,7 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
6117
6316
|
if (contentEncoding)
|
|
6118
6317
|
json.contentEncoding = contentEncoding;
|
|
6119
6318
|
if (patterns && patterns.size > 0) {
|
|
6120
|
-
const patternList = [...patterns];
|
|
6319
|
+
const patternList = [...patterns].map(exactPattern);
|
|
6121
6320
|
if (patternList.length === 1)
|
|
6122
6321
|
json.pattern = patternList[0].source;
|
|
6123
6322
|
else if (patternList.length > 1) {
|
|
@@ -6132,11 +6331,8 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
6132
6331
|
};
|
|
6133
6332
|
var numberProcessor = (schema, ctx, _json, params) => {
|
|
6134
6333
|
const json = _json;
|
|
6135
|
-
const { minimum, maximum,
|
|
6136
|
-
|
|
6137
|
-
json.type = "integer";
|
|
6138
|
-
else
|
|
6139
|
-
json.type = "number";
|
|
6334
|
+
const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
|
|
6335
|
+
json.type = isInt ? "integer" : "number";
|
|
6140
6336
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
6141
6337
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
6142
6338
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
@@ -6160,11 +6356,19 @@ var numberProcessor = (schema, ctx, _json, params) => {
|
|
|
6160
6356
|
} else if (typeof maximum === "number") {
|
|
6161
6357
|
json.maximum = maximum;
|
|
6162
6358
|
}
|
|
6163
|
-
if (
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6359
|
+
if (multipleOf) {
|
|
6360
|
+
const divisors = new Set;
|
|
6361
|
+
for (const divisor of multipleOf) {
|
|
6362
|
+
if (Number.isFinite(divisor) && divisor !== 0)
|
|
6363
|
+
divisors.add(Math.abs(divisor));
|
|
6364
|
+
else
|
|
6365
|
+
handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
|
|
6366
|
+
}
|
|
6367
|
+
const [first, ...rest] = divisors;
|
|
6368
|
+
if (first !== undefined)
|
|
6369
|
+
json.multipleOf = first;
|
|
6370
|
+
if (rest.length)
|
|
6371
|
+
json.allOf = [...json.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
|
|
6168
6372
|
}
|
|
6169
6373
|
};
|
|
6170
6374
|
var booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
@@ -6235,13 +6439,13 @@ var transformProcessor = (schema, ctx, json, params) => {
|
|
|
6235
6439
|
var arrayProcessor = (schema, ctx, _json, params) => {
|
|
6236
6440
|
const json = _json;
|
|
6237
6441
|
const def = schema._zod.def;
|
|
6238
|
-
const { minimum, maximum } = schema
|
|
6442
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
6239
6443
|
if (typeof minimum === "number")
|
|
6240
6444
|
json.minItems = minimum;
|
|
6241
6445
|
if (typeof maximum === "number")
|
|
6242
6446
|
json.maxItems = maximum;
|
|
6243
6447
|
json.type = "array";
|
|
6244
|
-
json.items =
|
|
6448
|
+
json.items = processSchema(def.element, ctx, {
|
|
6245
6449
|
...params,
|
|
6246
6450
|
path: [...params.path, "items"]
|
|
6247
6451
|
});
|
|
@@ -6267,7 +6471,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
6267
6471
|
json.type = "object";
|
|
6268
6472
|
json.properties = {};
|
|
6269
6473
|
for (const key in shape) {
|
|
6270
|
-
assignProp(json.properties, key,
|
|
6474
|
+
assignProp(json.properties, key, processSchema(shape[key], ctx, {
|
|
6271
6475
|
...params,
|
|
6272
6476
|
path: [...params.path, "properties", key]
|
|
6273
6477
|
}));
|
|
@@ -6290,7 +6494,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
6290
6494
|
if (ctx.io === "output")
|
|
6291
6495
|
json.additionalProperties = false;
|
|
6292
6496
|
} else if (def.catchall) {
|
|
6293
|
-
json.additionalProperties =
|
|
6497
|
+
json.additionalProperties = processSchema(def.catchall, ctx, {
|
|
6294
6498
|
...params,
|
|
6295
6499
|
path: [...params.path, "additionalProperties"]
|
|
6296
6500
|
});
|
|
@@ -6299,7 +6503,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
6299
6503
|
var unionProcessor = (schema, ctx, json, params) => {
|
|
6300
6504
|
const def = schema._zod.def;
|
|
6301
6505
|
const isExclusive = def.inclusive === false;
|
|
6302
|
-
const options = def.options.map((x, i) =>
|
|
6506
|
+
const options = def.options.map((x, i) => processSchema(x, ctx, {
|
|
6303
6507
|
...params,
|
|
6304
6508
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
6305
6509
|
}));
|
|
@@ -6311,11 +6515,11 @@ var unionProcessor = (schema, ctx, json, params) => {
|
|
|
6311
6515
|
};
|
|
6312
6516
|
var intersectionProcessor = (schema, ctx, json, params) => {
|
|
6313
6517
|
const def = schema._zod.def;
|
|
6314
|
-
const a =
|
|
6518
|
+
const a = processSchema(def.left, ctx, {
|
|
6315
6519
|
...params,
|
|
6316
6520
|
path: [...params.path, "allOf", 0]
|
|
6317
6521
|
});
|
|
6318
|
-
const b =
|
|
6522
|
+
const b = processSchema(def.right, ctx, {
|
|
6319
6523
|
...params,
|
|
6320
6524
|
path: [...params.path, "allOf", 1]
|
|
6321
6525
|
});
|
|
@@ -6395,20 +6599,19 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
6395
6599
|
const def = schema._zod.def;
|
|
6396
6600
|
json.type = "object";
|
|
6397
6601
|
const keyType = def.keyType;
|
|
6398
|
-
const
|
|
6399
|
-
const patterns = keyBag?.patterns;
|
|
6602
|
+
const patterns = aggregateChecks(keyType).patterns;
|
|
6400
6603
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
6401
|
-
const valueSchema =
|
|
6604
|
+
const valueSchema = processSchema(def.valueType, ctx, {
|
|
6402
6605
|
...params,
|
|
6403
6606
|
path: [...params.path, "patternProperties", "*"]
|
|
6404
6607
|
});
|
|
6405
6608
|
json.patternProperties = {};
|
|
6406
6609
|
for (const pattern of patterns) {
|
|
6407
|
-
assignProp(json.patternProperties, pattern.source, valueSchema);
|
|
6610
|
+
assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);
|
|
6408
6611
|
}
|
|
6409
6612
|
} else {
|
|
6410
6613
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
6411
|
-
json.propertyNames =
|
|
6614
|
+
json.propertyNames = processSchema(def.keyType, ctx, {
|
|
6412
6615
|
...params,
|
|
6413
6616
|
path: [...params.path, "propertyNames"]
|
|
6414
6617
|
});
|
|
@@ -6420,7 +6623,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
6420
6623
|
}
|
|
6421
6624
|
pending.push(schema);
|
|
6422
6625
|
}
|
|
6423
|
-
json.additionalProperties =
|
|
6626
|
+
json.additionalProperties = processSchema(def.valueType, ctx, {
|
|
6424
6627
|
...params,
|
|
6425
6628
|
path: [...params.path, "additionalProperties"]
|
|
6426
6629
|
});
|
|
@@ -6436,7 +6639,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
6436
6639
|
};
|
|
6437
6640
|
var nullableProcessor = (schema, ctx, json, params) => {
|
|
6438
6641
|
const def = schema._zod.def;
|
|
6439
|
-
const inner =
|
|
6642
|
+
const inner = processSchema(def.innerType, ctx, params);
|
|
6440
6643
|
const seen = ctx.seen.get(schema);
|
|
6441
6644
|
if (ctx.target === "openapi-3.0") {
|
|
6442
6645
|
seen.ref = def.innerType;
|
|
@@ -6447,7 +6650,7 @@ var nullableProcessor = (schema, ctx, json, params) => {
|
|
|
6447
6650
|
};
|
|
6448
6651
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
6449
6652
|
const def = schema._zod.def;
|
|
6450
|
-
|
|
6653
|
+
processSchema(def.innerType, ctx, params);
|
|
6451
6654
|
const seen = ctx.seen.get(schema);
|
|
6452
6655
|
seen.ref = def.innerType;
|
|
6453
6656
|
};
|
|
@@ -6467,7 +6670,7 @@ function serializeDefaultValue(value, schema, ctx, json, params) {
|
|
|
6467
6670
|
}
|
|
6468
6671
|
var defaultProcessor = (schema, ctx, json, params) => {
|
|
6469
6672
|
const def = schema._zod.def;
|
|
6470
|
-
|
|
6673
|
+
processSchema(def.innerType, ctx, params);
|
|
6471
6674
|
const seen = ctx.seen.get(schema);
|
|
6472
6675
|
seen.ref = def.innerType;
|
|
6473
6676
|
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
|
|
@@ -6476,7 +6679,7 @@ var defaultProcessor = (schema, ctx, json, params) => {
|
|
|
6476
6679
|
};
|
|
6477
6680
|
var prefaultProcessor = (schema, ctx, json, params) => {
|
|
6478
6681
|
const def = schema._zod.def;
|
|
6479
|
-
|
|
6682
|
+
processSchema(def.innerType, ctx, params);
|
|
6480
6683
|
const seen = ctx.seen.get(schema);
|
|
6481
6684
|
seen.ref = def.innerType;
|
|
6482
6685
|
if (ctx.io !== "input")
|
|
@@ -6487,7 +6690,7 @@ var prefaultProcessor = (schema, ctx, json, params) => {
|
|
|
6487
6690
|
};
|
|
6488
6691
|
var catchProcessor = (schema, ctx, json, params) => {
|
|
6489
6692
|
const def = schema._zod.def;
|
|
6490
|
-
|
|
6693
|
+
processSchema(def.innerType, ctx, params);
|
|
6491
6694
|
const seen = ctx.seen.get(schema);
|
|
6492
6695
|
seen.ref = def.innerType;
|
|
6493
6696
|
let catchValue;
|
|
@@ -6503,24 +6706,24 @@ var pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
6503
6706
|
const def = schema._zod.def;
|
|
6504
6707
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
6505
6708
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
6506
|
-
|
|
6709
|
+
processSchema(innerType, ctx, params);
|
|
6507
6710
|
const seen = ctx.seen.get(schema);
|
|
6508
6711
|
seen.ref = innerType;
|
|
6509
6712
|
};
|
|
6510
6713
|
var readonlyProcessor = (schema, ctx, json, params) => {
|
|
6511
6714
|
const def = schema._zod.def;
|
|
6512
|
-
|
|
6715
|
+
processSchema(def.innerType, ctx, params);
|
|
6513
6716
|
const seen = ctx.seen.get(schema);
|
|
6514
6717
|
seen.ref = def.innerType;
|
|
6515
6718
|
json.readOnly = true;
|
|
6516
6719
|
};
|
|
6517
6720
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
6518
6721
|
const def = schema._zod.def;
|
|
6519
|
-
|
|
6722
|
+
processSchema(def.innerType, ctx, params);
|
|
6520
6723
|
const seen = ctx.seen.get(schema);
|
|
6521
6724
|
seen.ref = def.innerType;
|
|
6522
6725
|
};
|
|
6523
|
-
// node_modules/.bun/zod@4.
|
|
6726
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/classic/errors.js
|
|
6524
6727
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
6525
6728
|
function _lazyMethod(proto, key, make) {
|
|
6526
6729
|
Object.defineProperty(proto, key, {
|
|
@@ -6565,11 +6768,11 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, undefi
|
|
|
6565
6768
|
Parent: Error
|
|
6566
6769
|
});
|
|
6567
6770
|
|
|
6568
|
-
// node_modules/.bun/zod@4.
|
|
6569
|
-
var
|
|
6570
|
-
var
|
|
6571
|
-
var
|
|
6572
|
-
var
|
|
6771
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/classic/parse.js
|
|
6772
|
+
var parse4 = /* @__PURE__ */ _parse(ZodRealError);
|
|
6773
|
+
var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
6774
|
+
var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
6775
|
+
var safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
6573
6776
|
var encode = /* @__PURE__ */ _encode(ZodRealError);
|
|
6574
6777
|
var decode = /* @__PURE__ */ _decode(ZodRealError);
|
|
6575
6778
|
var encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
|
|
@@ -6579,7 +6782,7 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
6579
6782
|
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
6580
6783
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
6581
6784
|
|
|
6582
|
-
// node_modules/.bun/zod@4.
|
|
6785
|
+
// node_modules/.bun/zod@4.6.1/node_modules/zod/v4/classic/schemas.js
|
|
6583
6786
|
function _ensureDefaultLocale() {
|
|
6584
6787
|
if (!globalConfig.localeError)
|
|
6585
6788
|
config(en_default());
|
|
@@ -6702,16 +6905,16 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
6702
6905
|
own(this, "~standard", value);
|
|
6703
6906
|
},
|
|
6704
6907
|
parse: function _parse(data, params) {
|
|
6705
|
-
return
|
|
6908
|
+
return parse4(this, data, params, { callee: _parse });
|
|
6706
6909
|
},
|
|
6707
6910
|
parseAsync: async function _parseAsync(data, params) {
|
|
6708
|
-
return await
|
|
6911
|
+
return await parseAsync(this, data, params, { callee: _parseAsync });
|
|
6709
6912
|
},
|
|
6710
6913
|
safeParse(data, params) {
|
|
6711
|
-
return
|
|
6914
|
+
return safeParse(this, data, params);
|
|
6712
6915
|
},
|
|
6713
6916
|
async safeParseAsync(data, params) {
|
|
6714
|
-
return
|
|
6917
|
+
return safeParseAsync(this, data, params);
|
|
6715
6918
|
},
|
|
6716
6919
|
get spa() {
|
|
6717
6920
|
return this?.safeParseAsync;
|
|
@@ -6719,6 +6922,12 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
6719
6922
|
set spa(value) {
|
|
6720
6923
|
own(this, "spa", value);
|
|
6721
6924
|
},
|
|
6925
|
+
validate(data, params) {
|
|
6926
|
+
return validate(this, data, params);
|
|
6927
|
+
},
|
|
6928
|
+
validateAsync(data, params) {
|
|
6929
|
+
return validateAsync(this, data, params);
|
|
6930
|
+
},
|
|
6722
6931
|
encode: function _encode(data, params) {
|
|
6723
6932
|
return encode(this, data, params, { callee: _encode });
|
|
6724
6933
|
},
|
|
@@ -6757,10 +6966,10 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
|
6757
6966
|
$ZodString.init(inst, def);
|
|
6758
6967
|
ZodType.init(inst, def);
|
|
6759
6968
|
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6969
|
+
}, /* @__PURE__ */ derived({
|
|
6970
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
6971
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
6972
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
6764
6973
|
}, {
|
|
6765
6974
|
regex(...args) {
|
|
6766
6975
|
return this.check(_regex(...args));
|
|
@@ -6807,7 +7016,7 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
|
6807
7016
|
slugify() {
|
|
6808
7017
|
return this.check(_slugify());
|
|
6809
7018
|
}
|
|
6810
|
-
});
|
|
7019
|
+
}));
|
|
6811
7020
|
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
6812
7021
|
$ZodString.init(inst, def);
|
|
6813
7022
|
_ZodString.init(inst, def);
|
|
@@ -6994,12 +7203,21 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
6994
7203
|
$ZodNumber.init(inst, def);
|
|
6995
7204
|
ZodType.init(inst, def);
|
|
6996
7205
|
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
6997
|
-
const bag = inst._zod.bag;
|
|
6998
|
-
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
6999
|
-
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
7000
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
7001
7206
|
inst.isFinite = true;
|
|
7002
|
-
|
|
7207
|
+
}, /* @__PURE__ */ derived({
|
|
7208
|
+
minValue: (inst) => {
|
|
7209
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
7210
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
7211
|
+
},
|
|
7212
|
+
maxValue: (inst) => {
|
|
7213
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
7214
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
7215
|
+
},
|
|
7216
|
+
isInt: (inst) => {
|
|
7217
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
7218
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
7219
|
+
},
|
|
7220
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
7003
7221
|
}, {
|
|
7004
7222
|
gt(value, params) {
|
|
7005
7223
|
return this.check(_gt(value, params));
|
|
@@ -7046,7 +7264,7 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
7046
7264
|
finite() {
|
|
7047
7265
|
return this;
|
|
7048
7266
|
}
|
|
7049
|
-
});
|
|
7267
|
+
}));
|
|
7050
7268
|
function number(params) {
|
|
7051
7269
|
return _number(ZodNumber, params);
|
|
7052
7270
|
}
|
|
@@ -7118,19 +7336,19 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
7118
7336
|
return _enum(Object.keys(this._zod.def.shape));
|
|
7119
7337
|
},
|
|
7120
7338
|
catchall(catchall) {
|
|
7121
|
-
return this.clone(
|
|
7339
|
+
return this.clone(mergeDefs(this._zod.def, { catchall }));
|
|
7122
7340
|
},
|
|
7123
7341
|
passthrough() {
|
|
7124
|
-
return this.clone(
|
|
7342
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
7125
7343
|
},
|
|
7126
7344
|
loose() {
|
|
7127
|
-
return this.clone(
|
|
7345
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
7128
7346
|
},
|
|
7129
7347
|
strict() {
|
|
7130
|
-
return this.clone(
|
|
7348
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: never() }));
|
|
7131
7349
|
},
|
|
7132
7350
|
strip() {
|
|
7133
|
-
return this.clone(
|
|
7351
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: undefined }));
|
|
7134
7352
|
},
|
|
7135
7353
|
extend(incoming) {
|
|
7136
7354
|
return extend(this, incoming);
|
|
@@ -7231,7 +7449,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
|
7231
7449
|
ZodType.init(inst, def);
|
|
7232
7450
|
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
7233
7451
|
inst.enum = def.entries;
|
|
7234
|
-
inst.options =
|
|
7452
|
+
inst.options = [...inst._zod.values];
|
|
7235
7453
|
const keys = new Set(Object.keys(def.entries));
|
|
7236
7454
|
inst.extract = (values, params) => {
|
|
7237
7455
|
const newEntries = {};
|