@geekmidas/cli 10.0.0-alpha.11 → 10.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -40
- package/dist/{HostingerProvider-BcyFRbqV.mjs → HostingerProvider-BY26bWwB.mjs} +20 -21
- package/dist/HostingerProvider-BY26bWwB.mjs.map +1 -0
- package/dist/{HostingerProvider-BOvsgATO.cjs → HostingerProvider-BZFGYYVA.cjs} +21 -22
- package/dist/HostingerProvider-BZFGYYVA.cjs.map +1 -0
- package/dist/{LocalStateProvider-yjXZXZDM.cjs → LocalStateProvider-7HR6SS2t.cjs} +11 -6
- package/dist/LocalStateProvider-7HR6SS2t.cjs.map +1 -0
- package/dist/{LocalStateProvider-Bq-0C0sg.mjs → LocalStateProvider-D7QyJoLM.mjs} +10 -4
- package/dist/LocalStateProvider-D7QyJoLM.mjs.map +1 -0
- package/dist/{Route53Provider-C0xmer8U.mjs → Route53Provider-Cvj40A8I.mjs} +12 -12
- package/dist/Route53Provider-Cvj40A8I.mjs.map +1 -0
- package/dist/{Route53Provider-CH9XH7bz.cjs → Route53Provider-DVILBsvV.cjs} +20 -21
- package/dist/Route53Provider-DVILBsvV.cjs.map +1 -0
- package/dist/{SSMStateProvider-DOZifZfE.mjs → SSMStateProvider-B0Hu1MKZ.mjs} +13 -4
- package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +1 -0
- package/dist/{SSMStateProvider-CXtNgPfy.cjs → SSMStateProvider-VrQ-yeqd.cjs} +17 -9
- package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +1 -0
- package/dist/{backup-provisioner-cE2PuCTb.cjs → backup-provisioner-BmhIO_Yr.cjs} +21 -19
- package/dist/backup-provisioner-BmhIO_Yr.cjs.map +1 -0
- package/dist/{backup-provisioner-DXXg6FIL.mjs → backup-provisioner-DIVCbfee.mjs} +10 -7
- package/dist/backup-provisioner-DIVCbfee.mjs.map +1 -0
- package/dist/{bundler-CaTGtiaO.cjs → bundler-BeNDZdHQ.cjs} +10 -28
- package/dist/bundler-BeNDZdHQ.cjs.map +1 -0
- package/dist/{bundler-S3ek7ea-.mjs → bundler-BodTL4kf.mjs} +9 -26
- package/dist/bundler-BodTL4kf.mjs.map +1 -0
- package/dist/{config-HhDpJmLO.cjs → config-Q1rvKHvw.cjs} +74 -69
- package/dist/config-Q1rvKHvw.cjs.map +1 -0
- package/dist/{config-B0L2tvvC.mjs → config-pqGD3hF9.mjs} +26 -14
- package/dist/config-pqGD3hF9.mjs.map +1 -0
- package/dist/config.cjs +4 -5
- package/dist/config.d.cts +14 -17
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +14 -17
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +3 -5
- package/dist/{credentials-CZrys9C5.mjs → credentials-BekkKtY_.mjs} +1331 -1100
- package/dist/credentials-BekkKtY_.mjs.map +1 -0
- package/dist/{credentials-B2Pyh3bJ.cjs → credentials-Q6F0uqJq.cjs} +1468 -1232
- package/dist/credentials-Q6F0uqJq.cjs.map +1 -0
- package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
- package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
- package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
- package/dist/deploy/sniffer-hooks.cjs +13 -7
- package/dist/deploy/sniffer-hooks.cjs.map +1 -1
- package/dist/deploy/sniffer-hooks.d.cts +1 -2
- package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
- package/dist/deploy/sniffer-hooks.d.mts +1 -2
- package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
- package/dist/deploy/sniffer-hooks.mjs +9 -2
- package/dist/deploy/sniffer-hooks.mjs.map +1 -1
- package/dist/deploy/sniffer-loader.cjs +16 -7
- package/dist/deploy/sniffer-loader.cjs.map +1 -1
- package/dist/deploy/sniffer-loader.d.cts +1 -1
- package/dist/deploy/sniffer-loader.d.mts +1 -1
- package/dist/deploy/sniffer-loader.mjs +13 -2
- package/dist/deploy/sniffer-loader.mjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.cjs +11 -11
- package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
- package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
- package/dist/deploy/sniffer-routes-worker.mjs +2 -2
- package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
- package/dist/deploy/sniffer-worker.cjs +15 -6
- package/dist/deploy/sniffer-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-worker.d.cts +1 -3
- package/dist/deploy/sniffer-worker.d.cts.map +1 -1
- package/dist/deploy/sniffer-worker.d.mts +1 -3
- package/dist/deploy/sniffer-worker.d.mts.map +1 -1
- package/dist/deploy/sniffer-worker.mjs +15 -4
- package/dist/deploy/sniffer-worker.mjs.map +1 -1
- package/dist/{discover-DTmFeloL.cjs → discover-BERGFg8v.cjs} +81 -64
- package/dist/discover-BERGFg8v.cjs.map +1 -0
- package/dist/{discover-CAlFgYec.mjs → discover-CK-n3w6b.mjs} +35 -20
- package/dist/discover-CK-n3w6b.mjs.map +1 -0
- package/dist/{emit-CUD1BWls.cjs → emit-BdoPFjZf.cjs} +53 -36
- package/dist/emit-BdoPFjZf.cjs.map +1 -0
- package/dist/{emit-CIlvnDvV.mjs → emit-Bzq7JsMP.mjs} +24 -6
- package/dist/emit-Bzq7JsMP.mjs.map +1 -0
- package/dist/{fullstack-secrets-METaRLS1.mjs → fullstack-secrets-BET8gqwK.mjs} +9 -15
- package/dist/fullstack-secrets-BET8gqwK.mjs.map +1 -0
- package/dist/{fullstack-secrets-D6MyHhQP.cjs → fullstack-secrets-DXsWO-5m.cjs} +19 -38
- package/dist/fullstack-secrets-DXsWO-5m.cjs.map +1 -0
- package/dist/{generator-VE2JrFlY.mjs → generator-LfZU7NlU.mjs} +8 -14
- package/dist/generator-LfZU7NlU.mjs.map +1 -0
- package/dist/{generator-CNzBw7g5.cjs → generator-Wdfp0jCS.cjs} +38 -45
- package/dist/generator-Wdfp0jCS.cjs.map +1 -0
- package/dist/{github-BrvaPkFf.cjs → github-BfflNPVe.cjs} +36 -30
- package/dist/{github-BrvaPkFf.cjs.map → github-BfflNPVe.cjs.map} +1 -1
- package/dist/{github-CrpsXSfV.mjs → github-CRwnxKmD.mjs} +27 -20
- package/dist/github-CRwnxKmD.mjs.map +1 -0
- package/dist/{index-CR5urhWX.d.cts → index-Cd-qeOam.d.mts} +3 -12
- package/dist/index-Cd-qeOam.d.mts.map +1 -0
- package/dist/{index-Ayxg_DQY.d.mts → index-D-iAVHx-.d.cts} +3 -12
- package/dist/index-D-iAVHx-.d.cts.map +1 -0
- package/dist/index.cjs +3320 -2961
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +3200 -2858
- package/dist/index.mjs.map +1 -1
- package/dist/{keystore-TxeYM7an.mjs → keystore-B4PRlbgE.mjs} +5 -7
- package/dist/keystore-B4PRlbgE.mjs.map +1 -0
- package/dist/{keystore-C9rint2E.cjs → keystore-DgGRj2Yy.cjs} +23 -26
- package/dist/keystore-DgGRj2Yy.cjs.map +1 -0
- package/dist/{openapi-DaKlTKxz.cjs → openapi-Dcbme-Us.cjs} +134 -171
- package/dist/openapi-Dcbme-Us.cjs.map +1 -0
- package/dist/openapi-react-query.cjs +156 -2
- package/dist/openapi-react-query.cjs.map +1 -0
- package/dist/openapi-react-query.d.cts +1 -3
- package/dist/openapi-react-query.d.cts.map +1 -1
- package/dist/openapi-react-query.d.mts +1 -3
- package/dist/openapi-react-query.d.mts.map +1 -1
- package/dist/openapi-react-query.mjs +156 -2
- package/dist/openapi-react-query.mjs.map +1 -0
- package/dist/{openapi-y1d7Kalt.mjs → openapi-vy4JzhUv.mjs} +76 -106
- package/dist/openapi-vy4JzhUv.mjs.map +1 -0
- package/dist/openapi.cjs +3 -6
- package/dist/openapi.d.cts +8 -11
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +8 -11
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +2 -6
- package/dist/reconcile/public.cjs +4 -4
- package/dist/reconcile/public.d.cts +8 -26
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +8 -26
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -4
- package/dist/{reconcile-CYMhFSYy.cjs → reconcile-Dd2iyILf.cjs} +4 -7
- package/dist/reconcile-Dd2iyILf.cjs.map +1 -0
- package/dist/{reconcile-C13ERt1U.mjs → reconcile-DhQ00DpU.mjs} +4 -7
- package/dist/reconcile-DhQ00DpU.mjs.map +1 -0
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
- package/dist/{storage-CSNplaJn.cjs → storage-C-30BD1e.cjs} +59 -69
- package/dist/storage-C-30BD1e.cjs.map +1 -0
- package/dist/{storage-B020InPW.mjs → storage-P_b3w7uj.mjs} +22 -13
- package/dist/storage-P_b3w7uj.mjs.map +1 -0
- package/dist/{sync-CzHXiR9c.mjs → sync-B3xxXtJT.mjs} +18 -6
- package/dist/sync-B3xxXtJT.mjs.map +1 -0
- package/dist/{sync-0ILCb-1S.cjs → sync-D7uTIIEi.cjs} +43 -25
- package/dist/sync-D7uTIIEi.cjs.map +1 -0
- package/dist/types-BGo5TaNE.d.mts +6164 -0
- package/dist/types-BGo5TaNE.d.mts.map +1 -0
- package/dist/types-C5ZNpUad.d.cts +6165 -0
- package/dist/types-C5ZNpUad.d.cts.map +1 -0
- package/dist/workspace/index.cjs +3 -3
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +2 -3
- package/dist/{workspace-DaEX7FEg.mjs → workspace-CgwmXEtc.mjs} +725 -871
- package/dist/workspace-CgwmXEtc.mjs.map +1 -0
- package/dist/{workspace-C-a3G_U0.cjs → workspace-mFpI_ky_.cjs} +894 -1041
- package/dist/workspace-mFpI_ky_.cjs.map +1 -0
- package/package.json +14 -14
- package/dist/CachedStateProvider-BEBl2wQT.cjs +0 -60
- package/dist/CachedStateProvider-BEBl2wQT.cjs.map +0 -1
- package/dist/CachedStateProvider-C-8wtlto.mjs +0 -3
- package/dist/CachedStateProvider-Co4n5Wvs.mjs +0 -54
- package/dist/CachedStateProvider-Co4n5Wvs.mjs.map +0 -1
- package/dist/CachedStateProvider-DqhGpzsm.cjs +0 -3
- package/dist/HostingerProvider-BOvsgATO.cjs.map +0 -1
- package/dist/HostingerProvider-BcyFRbqV.mjs.map +0 -1
- package/dist/LocalStateProvider-Bq-0C0sg.mjs.map +0 -1
- package/dist/LocalStateProvider-yjXZXZDM.cjs.map +0 -1
- package/dist/Route53Provider-C0xmer8U.mjs.map +0 -1
- package/dist/Route53Provider-CH9XH7bz.cjs.map +0 -1
- package/dist/SSMStateProvider-CXtNgPfy.cjs.map +0 -1
- package/dist/SSMStateProvider-DOZifZfE.mjs.map +0 -1
- package/dist/backup-provisioner-DXXg6FIL.mjs.map +0 -1
- package/dist/backup-provisioner-cE2PuCTb.cjs.map +0 -1
- package/dist/bundler-CaTGtiaO.cjs.map +0 -1
- package/dist/bundler-S3ek7ea-.mjs.map +0 -1
- package/dist/chunk-Duj1WY3L.mjs +0 -7
- package/dist/config-B0L2tvvC.mjs.map +0 -1
- package/dist/config-HhDpJmLO.cjs.map +0 -1
- package/dist/credentials-B2Pyh3bJ.cjs.map +0 -1
- package/dist/credentials-B5zRHdAl.mjs +0 -141
- package/dist/credentials-B5zRHdAl.mjs.map +0 -1
- package/dist/credentials-BapzjyV5.cjs +0 -195
- package/dist/credentials-BapzjyV5.cjs.map +0 -1
- package/dist/credentials-CZrys9C5.mjs.map +0 -1
- package/dist/discover-CAlFgYec.mjs.map +0 -1
- package/dist/discover-DTmFeloL.cjs.map +0 -1
- package/dist/dokploy-api-5cK2InBm.cjs +0 -3
- package/dist/dokploy-api-D2Ny4Jrc.mjs +0 -3
- package/dist/dokploy-api-pdaBryoY.mjs +0 -706
- package/dist/dokploy-api-pdaBryoY.mjs.map +0 -1
- package/dist/dokploy-api-zqKe9lHH.cjs +0 -718
- package/dist/dokploy-api-zqKe9lHH.cjs.map +0 -1
- package/dist/emit-CIlvnDvV.mjs.map +0 -1
- package/dist/emit-CUD1BWls.cjs.map +0 -1
- package/dist/encryption-D2pL3tHH.cjs +0 -54
- package/dist/encryption-D2pL3tHH.cjs.map +0 -1
- package/dist/encryption-YDsXXi6w.mjs +0 -3
- package/dist/encryption-_4zwjOAR.mjs +0 -42
- package/dist/encryption-_4zwjOAR.mjs.map +0 -1
- package/dist/encryption-sQ2Oxx0d.cjs +0 -4
- package/dist/fullstack-secrets-D6MyHhQP.cjs.map +0 -1
- package/dist/fullstack-secrets-METaRLS1.mjs.map +0 -1
- package/dist/generator-CNzBw7g5.cjs.map +0 -1
- package/dist/generator-VE2JrFlY.mjs.map +0 -1
- package/dist/github-CrpsXSfV.mjs.map +0 -1
- package/dist/index-Ayxg_DQY.d.mts.map +0 -1
- package/dist/index-CR5urhWX.d.cts.map +0 -1
- package/dist/keystore-C9rint2E.cjs.map +0 -1
- package/dist/keystore-TxeYM7an.mjs.map +0 -1
- package/dist/openapi-DaKlTKxz.cjs.map +0 -1
- package/dist/openapi-react-query-BKH334Ug.cjs +0 -173
- package/dist/openapi-react-query-BKH334Ug.cjs.map +0 -1
- package/dist/openapi-react-query-DoR5CmzQ.mjs +0 -167
- package/dist/openapi-react-query-DoR5CmzQ.mjs.map +0 -1
- package/dist/openapi-y1d7Kalt.mjs.map +0 -1
- package/dist/reconcile-C13ERt1U.mjs.map +0 -1
- package/dist/reconcile-CYMhFSYy.cjs.map +0 -1
- package/dist/setup-BWgMs4gg.mjs +0 -12
- package/dist/setup-DOv92pIu.cjs +0 -473
- package/dist/setup-DOv92pIu.cjs.map +0 -1
- package/dist/setup-DQo_h_yK.mjs +0 -443
- package/dist/setup-DQo_h_yK.mjs.map +0 -1
- package/dist/setup-lCx_DcUo.cjs +0 -12
- package/dist/storage-B020InPW.mjs.map +0 -1
- package/dist/storage-CSNplaJn.cjs.map +0 -1
- package/dist/storage-DGBzMLZa.mjs +0 -4
- package/dist/storage-DlVol_oj.cjs +0 -8
- package/dist/sync-0ILCb-1S.cjs.map +0 -1
- package/dist/sync-CzHXiR9c.mjs.map +0 -1
- package/dist/sync-DYENfOt4.cjs +0 -4
- package/dist/sync-HAau6h_R.mjs +0 -3
- package/dist/types-CL7jPFM2.d.mts +0 -2220
- package/dist/types-CL7jPFM2.d.mts.map +0 -1
- package/dist/types-Y3fKQSAK.d.cts +0 -2220
- package/dist/types-Y3fKQSAK.d.cts.map +0 -1
- package/dist/workspace-C-a3G_U0.cjs.map +0 -1
- package/dist/workspace-DQxxs7Jk.cjs +0 -10
- package/dist/workspace-DaEX7FEg.mjs.map +0 -1
- package/dist/workspace-DbI580qS.mjs +0 -9
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { __require } from "./
|
|
1
|
+
import { n as __require } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import { basename, isAbsolute, join } from "node:path";
|
|
3
|
-
|
|
4
3
|
//#region src/workspace/publicEnv.ts
|
|
5
4
|
/**
|
|
6
5
|
* All public env-var prefixes the toolbox understands.
|
|
@@ -46,16 +45,14 @@ function stripPublicPrefix(name) {
|
|
|
46
45
|
for (const prefix of PUBLIC_ENV_PREFIXES) if (prefix && name.startsWith(prefix)) return name.slice(prefix.length);
|
|
47
46
|
return null;
|
|
48
47
|
}
|
|
49
|
-
|
|
50
48
|
//#endregion
|
|
51
49
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.js
|
|
52
50
|
function getEnumValues(entries) {
|
|
53
51
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
54
|
-
|
|
55
|
-
return values;
|
|
52
|
+
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
56
53
|
}
|
|
57
|
-
function joinValues(array
|
|
58
|
-
return array
|
|
54
|
+
function joinValues(array, separator = "|") {
|
|
55
|
+
return array.map((val) => stringifyPrimitive(val)).join(separator);
|
|
59
56
|
}
|
|
60
57
|
function jsonStringifyReplacer(_, value) {
|
|
61
58
|
if (typeof value === "bigint") return value.toString();
|
|
@@ -171,12 +168,11 @@ const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace
|
|
|
171
168
|
function isObject(data) {
|
|
172
169
|
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
173
170
|
}
|
|
174
|
-
const allowsEval = /* @__PURE__
|
|
171
|
+
const allowsEval = /* @__PURE__*/ cached(() => {
|
|
175
172
|
if (globalConfig.jitless) return false;
|
|
176
173
|
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
|
|
177
174
|
try {
|
|
178
|
-
|
|
179
|
-
new F("");
|
|
175
|
+
new Function("");
|
|
180
176
|
return true;
|
|
181
177
|
} catch (_) {
|
|
182
178
|
return false;
|
|
@@ -199,7 +195,7 @@ function shallowClone(o) {
|
|
|
199
195
|
if (o instanceof Set) return new Set(o);
|
|
200
196
|
return o;
|
|
201
197
|
}
|
|
202
|
-
const propertyKeyTypes = /* @__PURE__
|
|
198
|
+
const propertyKeyTypes = /* @__PURE__*/ new Set([
|
|
203
199
|
"string",
|
|
204
200
|
"number",
|
|
205
201
|
"symbol"
|
|
@@ -237,7 +233,7 @@ function optionalKeys(shape) {
|
|
|
237
233
|
return shape[k]._zod.optin !== void 0 && shape[k]._zod.optout === "optional";
|
|
238
234
|
});
|
|
239
235
|
}
|
|
240
|
-
const NUMBER_FORMAT_RANGES =
|
|
236
|
+
const NUMBER_FORMAT_RANGES = /*@__PURE__*/ (() => ({
|
|
241
237
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
242
238
|
int32: [-2147483648, 2147483647],
|
|
243
239
|
uint32: [0, 4294967295],
|
|
@@ -245,14 +241,13 @@ const NUMBER_FORMAT_RANGES = /* @__PURE__ */ (() => ({
|
|
|
245
241
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
246
242
|
}))();
|
|
247
243
|
const BIGINT_FORMAT_RANGES = {
|
|
248
|
-
int64: [/* @__PURE__
|
|
249
|
-
uint64: [/* @__PURE__
|
|
244
|
+
int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
|
|
245
|
+
uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")]
|
|
250
246
|
};
|
|
251
247
|
function pick(schema, mask) {
|
|
252
248
|
const currDef = schema._zod.def;
|
|
253
249
|
const checks = currDef.checks;
|
|
254
|
-
|
|
255
|
-
if (hasChecks) throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
250
|
+
if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
256
251
|
const newShape = {};
|
|
257
252
|
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
258
253
|
return clone(schema, mergeDefs(currDef, {
|
|
@@ -272,8 +267,7 @@ function maskedKeys(schema, mask) {
|
|
|
272
267
|
function omit(schema, mask) {
|
|
273
268
|
const currDef = schema._zod.def;
|
|
274
269
|
const checks = currDef.checks;
|
|
275
|
-
|
|
276
|
-
if (hasChecks) throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
270
|
+
if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
277
271
|
const omitted = new Set(maskedKeys(schema, mask));
|
|
278
272
|
const newShape = {};
|
|
279
273
|
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
@@ -285,8 +279,7 @@ function omit(schema, mask) {
|
|
|
285
279
|
function extend(schema, shape) {
|
|
286
280
|
if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
|
|
287
281
|
const checks = schema._zod.def.checks;
|
|
288
|
-
|
|
289
|
-
if (hasChecks) {
|
|
282
|
+
if (checks && checks.length > 0) {
|
|
290
283
|
const existingShape = sourceShape(schema);
|
|
291
284
|
for (const key of Reflect.ownKeys(shape)) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
292
285
|
}
|
|
@@ -308,20 +301,17 @@ function merge(a, b) {
|
|
|
308
301
|
const newShape = {};
|
|
309
302
|
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
310
303
|
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
311
|
-
|
|
304
|
+
return clone(a, mergeDefs(a._zod.def, {
|
|
312
305
|
shape: newShape,
|
|
313
306
|
get catchall() {
|
|
314
307
|
return b._zod.def.catchall;
|
|
315
308
|
},
|
|
316
309
|
checks: b._zod.def.checks ?? []
|
|
317
|
-
});
|
|
318
|
-
return clone(a, def);
|
|
310
|
+
}));
|
|
319
311
|
}
|
|
320
312
|
function partial(Class, schema, mask, name = "partial") {
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
const hasChecks = checks && checks.length > 0;
|
|
324
|
-
if (hasChecks) throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
313
|
+
const checks = schema._zod.def.checks;
|
|
314
|
+
if (checks && checks.length > 0) throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
325
315
|
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
326
316
|
const newShape = {};
|
|
327
317
|
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({
|
|
@@ -354,8 +344,8 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
354
344
|
}
|
|
355
345
|
function prefixIssues(path, issues) {
|
|
356
346
|
return issues.map((iss) => {
|
|
357
|
-
var _a
|
|
358
|
-
(_a
|
|
347
|
+
var _a;
|
|
348
|
+
(_a = iss).path ?? (_a.path = []);
|
|
359
349
|
iss.path.unshift(path);
|
|
360
350
|
return iss;
|
|
361
351
|
});
|
|
@@ -364,16 +354,18 @@ function unwrapMessage(message) {
|
|
|
364
354
|
return typeof message === "string" ? message : message?.message;
|
|
365
355
|
}
|
|
366
356
|
function attachSchema(issues, start, inst) {
|
|
367
|
-
var _a
|
|
368
|
-
for (let i = start; i < issues.length; i++) (_a
|
|
357
|
+
var _a;
|
|
358
|
+
for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
|
|
369
359
|
}
|
|
370
|
-
function finalizeIssue(iss, ctx, config
|
|
371
|
-
var _a
|
|
360
|
+
function finalizeIssue(iss, ctx, config) {
|
|
361
|
+
var _a;
|
|
372
362
|
const traits = iss.inst?._zod?.traits;
|
|
373
|
-
if (traits?.has("$ZodType"))
|
|
374
|
-
|
|
363
|
+
if (traits?.has("$ZodType")) {
|
|
364
|
+
if (traits.has("$ZodCheck")) (_a = iss).schema ?? (_a.schema = iss.inst);
|
|
365
|
+
else iss.schema = iss.inst;
|
|
366
|
+
}
|
|
375
367
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
|
|
376
|
-
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config
|
|
368
|
+
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";
|
|
377
369
|
const full = {};
|
|
378
370
|
for (const k of Object.keys(iss)) {
|
|
379
371
|
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__") continue;
|
|
@@ -491,7 +483,6 @@ const breaker = {
|
|
|
491
483
|
configurable: true,
|
|
492
484
|
get() {
|
|
493
485
|
broke = true;
|
|
494
|
-
return void 0;
|
|
495
486
|
}
|
|
496
487
|
};
|
|
497
488
|
/**
|
|
@@ -577,7 +568,6 @@ function constantCatch(value) {
|
|
|
577
568
|
fn[CONSTANT_CATCH] = true;
|
|
578
569
|
return fn;
|
|
579
570
|
}
|
|
580
|
-
|
|
581
571
|
//#endregion
|
|
582
572
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.js
|
|
583
573
|
var _a$1;
|
|
@@ -606,7 +596,7 @@ function newError(Definition) {
|
|
|
606
596
|
}
|
|
607
597
|
return new Definition();
|
|
608
598
|
}
|
|
609
|
-
function $constructor(name, initializer
|
|
599
|
+
function $constructor(name, initializer, proto, params) {
|
|
610
600
|
const zodProto = {};
|
|
611
601
|
function Internals(def) {
|
|
612
602
|
this.def = def;
|
|
@@ -626,22 +616,22 @@ function $constructor(name, initializer$2, proto, params) {
|
|
|
626
616
|
}
|
|
627
617
|
} else if (inst._zod.traits.has(name)) return;
|
|
628
618
|
inst._zod.traits.add(name);
|
|
629
|
-
initializer
|
|
619
|
+
initializer(inst, def);
|
|
630
620
|
if (initialized) {
|
|
631
|
-
const own
|
|
621
|
+
const own = Object.getPrototypeOf(inst);
|
|
632
622
|
const ctorProto = inst._zod.constr.prototype;
|
|
633
|
-
let up = own
|
|
623
|
+
let up = own;
|
|
634
624
|
while (up && up !== ctorProto) up = Object.getPrototypeOf(up);
|
|
635
|
-
const target = up ?? own
|
|
625
|
+
const target = up ?? own;
|
|
636
626
|
if (!initialized.has(target)) {
|
|
637
627
|
initialized.add(target);
|
|
638
628
|
members(target, protoMembers);
|
|
639
629
|
}
|
|
640
630
|
}
|
|
641
|
-
const proto
|
|
642
|
-
for (const k in proto
|
|
643
|
-
if (!Object.prototype.hasOwnProperty.call(proto
|
|
644
|
-
if (!(k in inst)) inst[k] = proto
|
|
631
|
+
const proto = _.prototype;
|
|
632
|
+
for (const k in proto) {
|
|
633
|
+
if (!Object.prototype.hasOwnProperty.call(proto, k)) continue;
|
|
634
|
+
if (!(k in inst)) inst[k] = proto[k].bind(inst);
|
|
645
635
|
}
|
|
646
636
|
}
|
|
647
637
|
const Parent = params?.Parent ?? Object;
|
|
@@ -684,7 +674,6 @@ function config(newConfig) {
|
|
|
684
674
|
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
685
675
|
return globalConfig;
|
|
686
676
|
}
|
|
687
|
-
|
|
688
677
|
//#endregion
|
|
689
678
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.js
|
|
690
679
|
function _getMessage() {
|
|
@@ -738,39 +727,41 @@ const initializer$1 = (inst, def) => {
|
|
|
738
727
|
}
|
|
739
728
|
};
|
|
740
729
|
const $ZodError = $constructor("$ZodError", initializer$1);
|
|
741
|
-
|
|
730
|
+
$constructor("$ZodError", initializer$1, void 0, { Parent: Error });
|
|
742
731
|
/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
|
|
743
732
|
* ("toString", "constructor") would otherwise read through to the prototype, and assigning
|
|
744
733
|
* "__proto__" would hit the setter instead of creating a key. */
|
|
745
734
|
function node(obj, key, make) {
|
|
746
|
-
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
735
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
736
|
+
if (key === "__proto__") Object.defineProperty(obj, key, {
|
|
737
|
+
value: make(),
|
|
738
|
+
writable: true,
|
|
739
|
+
enumerable: true,
|
|
740
|
+
configurable: true
|
|
741
|
+
});
|
|
742
|
+
else obj[key] = make();
|
|
743
|
+
}
|
|
753
744
|
return obj[key];
|
|
754
745
|
}
|
|
755
|
-
function flattenError(error
|
|
746
|
+
function flattenError(error, mapper = (issue) => issue.message) {
|
|
756
747
|
const fieldErrors = {};
|
|
757
748
|
const formErrors = [];
|
|
758
|
-
for (const sub of error
|
|
749
|
+
for (const sub of error.issues) if (sub.path.length > 0) node(fieldErrors, sub.path[0], () => []).push(mapper(sub));
|
|
759
750
|
else formErrors.push(mapper(sub));
|
|
760
751
|
return {
|
|
761
752
|
formErrors,
|
|
762
753
|
fieldErrors
|
|
763
754
|
};
|
|
764
755
|
}
|
|
765
|
-
function formatError(error
|
|
756
|
+
function formatError(error, mapper = (issue) => issue.message) {
|
|
766
757
|
const fieldErrors = { _errors: [] };
|
|
767
|
-
const processError = (error
|
|
768
|
-
for (const issue
|
|
769
|
-
else if (issue
|
|
770
|
-
else if (issue
|
|
758
|
+
const processError = (error, path = []) => {
|
|
759
|
+
for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
|
|
760
|
+
else if (issue.code === "invalid_key") processError({ issues: issue.issues }, [...path, ...issue.path]);
|
|
761
|
+
else if (issue.code === "invalid_element") processError({ issues: issue.issues }, [...path, ...issue.path]);
|
|
771
762
|
else {
|
|
772
|
-
const fullpath = [...path, ...issue
|
|
773
|
-
if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue
|
|
763
|
+
const fullpath = [...path, ...issue.path];
|
|
764
|
+
if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue));
|
|
774
765
|
else {
|
|
775
766
|
let curr = fieldErrors;
|
|
776
767
|
let i = 0;
|
|
@@ -778,7 +769,7 @@ function formatError(error$1, mapper = (issue$1) => issue$1.message) {
|
|
|
778
769
|
const el = fullpath[i];
|
|
779
770
|
const terminal = i === fullpath.length - 1;
|
|
780
771
|
if (el === "_errors") {
|
|
781
|
-
if (terminal) curr._errors.push(mapper(issue
|
|
772
|
+
if (terminal) curr._errors.push(mapper(issue));
|
|
782
773
|
i++;
|
|
783
774
|
continue;
|
|
784
775
|
}
|
|
@@ -788,18 +779,17 @@ function formatError(error$1, mapper = (issue$1) => issue$1.message) {
|
|
|
788
779
|
writable: true,
|
|
789
780
|
configurable: true
|
|
790
781
|
});
|
|
791
|
-
const node
|
|
792
|
-
if (terminal) node
|
|
793
|
-
curr = node
|
|
782
|
+
const node = curr[el];
|
|
783
|
+
if (terminal) node._errors.push(mapper(issue));
|
|
784
|
+
curr = node;
|
|
794
785
|
i++;
|
|
795
786
|
}
|
|
796
787
|
}
|
|
797
788
|
}
|
|
798
789
|
};
|
|
799
|
-
processError(error
|
|
790
|
+
processError(error);
|
|
800
791
|
return fieldErrors;
|
|
801
792
|
}
|
|
802
|
-
|
|
803
793
|
//#endregion
|
|
804
794
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.js
|
|
805
795
|
function finalizeParams(callee, params) {
|
|
@@ -820,7 +810,7 @@ const _parse = (_Err) => {
|
|
|
820
810
|
}, ctx);
|
|
821
811
|
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
822
812
|
if (result.issues.length) {
|
|
823
|
-
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
813
|
+
const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
824
814
|
captureStackTrace(e, _params?.callee ?? fn);
|
|
825
815
|
throw e;
|
|
826
816
|
}
|
|
@@ -828,7 +818,6 @@ const _parse = (_Err) => {
|
|
|
828
818
|
};
|
|
829
819
|
return fn;
|
|
830
820
|
};
|
|
831
|
-
const parse$2 = /* @__PURE__ */ _parse($ZodRealError);
|
|
832
821
|
const _parseAsync = (_Err) => {
|
|
833
822
|
const fn = async (schema, value, _ctx, params) => {
|
|
834
823
|
const ctx = _ctx ? {
|
|
@@ -841,7 +830,7 @@ const _parseAsync = (_Err) => {
|
|
|
841
830
|
}, ctx);
|
|
842
831
|
if (result instanceof Promise) result = await result;
|
|
843
832
|
if (result.issues.length) {
|
|
844
|
-
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
833
|
+
const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
845
834
|
captureStackTrace(e, params?.callee ?? fn);
|
|
846
835
|
throw e;
|
|
847
836
|
}
|
|
@@ -849,7 +838,6 @@ const _parseAsync = (_Err) => {
|
|
|
849
838
|
};
|
|
850
839
|
return fn;
|
|
851
840
|
};
|
|
852
|
-
const parseAsync$1 = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
853
841
|
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
854
842
|
const ctx = _ctx ? {
|
|
855
843
|
..._ctx,
|
|
@@ -865,21 +853,20 @@ const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
865
853
|
data: result.value
|
|
866
854
|
};
|
|
867
855
|
};
|
|
868
|
-
const safeParse$1 = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
869
856
|
function failure(Err, issues, ctx) {
|
|
870
|
-
let error
|
|
857
|
+
let error;
|
|
871
858
|
return {
|
|
872
859
|
success: false,
|
|
873
860
|
get error() {
|
|
874
|
-
if (!error
|
|
875
|
-
error
|
|
861
|
+
if (!error) {
|
|
862
|
+
error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
876
863
|
issues = void 0;
|
|
877
864
|
ctx = void 0;
|
|
878
865
|
}
|
|
879
|
-
return error
|
|
866
|
+
return error;
|
|
880
867
|
},
|
|
881
868
|
set error(e) {
|
|
882
|
-
error
|
|
869
|
+
error = e;
|
|
883
870
|
issues = void 0;
|
|
884
871
|
ctx = void 0;
|
|
885
872
|
}
|
|
@@ -900,17 +887,16 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
900
887
|
data: result.value
|
|
901
888
|
};
|
|
902
889
|
};
|
|
903
|
-
const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
904
890
|
const COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
905
891
|
const COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
906
|
-
const validate = (schema, value, _ctx) => {
|
|
892
|
+
const validate = ((schema, value, _ctx) => {
|
|
907
893
|
const validator = schema._zod.bag.validator;
|
|
908
894
|
if (validator !== void 0) {
|
|
909
895
|
if (validator(value) !== COMPILE_INVALID) return true;
|
|
910
896
|
if (validator.definite === true && _ctx === void 0) return false;
|
|
911
897
|
}
|
|
912
898
|
return validateFallback(schema, value, _ctx);
|
|
913
|
-
};
|
|
899
|
+
});
|
|
914
900
|
function validateFallback(schema, value, _ctx) {
|
|
915
901
|
const ctx = _ctx ? {
|
|
916
902
|
..._ctx,
|
|
@@ -935,7 +921,7 @@ function validateFallback(schema, value, _ctx) {
|
|
|
935
921
|
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
936
922
|
return result.issues.length === 0;
|
|
937
923
|
}
|
|
938
|
-
const validateAsync = async (schema, value, _ctx) => {
|
|
924
|
+
const validateAsync$1 = async (schema, value, _ctx) => {
|
|
939
925
|
const ctx = _ctx ? {
|
|
940
926
|
..._ctx,
|
|
941
927
|
async: true,
|
|
@@ -952,45 +938,41 @@ const validateAsync = async (schema, value, _ctx) => {
|
|
|
952
938
|
return result.issues.length === 0;
|
|
953
939
|
};
|
|
954
940
|
const _encode = (_Err) => {
|
|
955
|
-
const parse
|
|
941
|
+
const parse = _parse(_Err);
|
|
956
942
|
const fn = (schema, value, _ctx, _params) => {
|
|
957
943
|
const ctx = _ctx ? {
|
|
958
944
|
..._ctx,
|
|
959
945
|
direction: "backward"
|
|
960
946
|
} : { direction: "backward" };
|
|
961
|
-
return parse
|
|
947
|
+
return parse(schema, value, ctx, finalizeParams(fn, _params));
|
|
962
948
|
};
|
|
963
949
|
return fn;
|
|
964
950
|
};
|
|
965
|
-
const encode$1 = /* @__PURE__ */ _encode($ZodRealError);
|
|
966
951
|
const _decode = (_Err) => {
|
|
967
|
-
const parse
|
|
952
|
+
const parse = _parse(_Err);
|
|
968
953
|
const fn = (schema, value, _ctx, _params) => {
|
|
969
|
-
return parse
|
|
954
|
+
return parse(schema, value, _ctx, finalizeParams(fn, _params));
|
|
970
955
|
};
|
|
971
956
|
return fn;
|
|
972
957
|
};
|
|
973
|
-
const decode$1 = /* @__PURE__ */ _decode($ZodRealError);
|
|
974
958
|
const _encodeAsync = (_Err) => {
|
|
975
|
-
const parseAsync
|
|
959
|
+
const parseAsync = _parseAsync(_Err);
|
|
976
960
|
const fn = async (schema, value, _ctx, _params) => {
|
|
977
961
|
const ctx = _ctx ? {
|
|
978
962
|
..._ctx,
|
|
979
963
|
direction: "backward"
|
|
980
964
|
} : { direction: "backward" };
|
|
981
|
-
return await parseAsync
|
|
965
|
+
return await parseAsync(schema, value, ctx, finalizeParams(fn, _params));
|
|
982
966
|
};
|
|
983
967
|
return fn;
|
|
984
968
|
};
|
|
985
|
-
const encodeAsync$1 = /* @__PURE__ */ _encodeAsync($ZodRealError);
|
|
986
969
|
const _decodeAsync = (_Err) => {
|
|
987
|
-
const parseAsync
|
|
970
|
+
const parseAsync = _parseAsync(_Err);
|
|
988
971
|
const fn = async (schema, value, _ctx, _params) => {
|
|
989
|
-
return await parseAsync
|
|
972
|
+
return await parseAsync(schema, value, _ctx, finalizeParams(fn, _params));
|
|
990
973
|
};
|
|
991
974
|
return fn;
|
|
992
975
|
};
|
|
993
|
-
const decodeAsync$1 = /* @__PURE__ */ _decodeAsync($ZodRealError);
|
|
994
976
|
const _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
995
977
|
const ctx = _ctx ? {
|
|
996
978
|
..._ctx,
|
|
@@ -998,11 +980,9 @@ const _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
|
998
980
|
} : { direction: "backward" };
|
|
999
981
|
return _safeParse(_Err)(schema, value, ctx);
|
|
1000
982
|
};
|
|
1001
|
-
const safeEncode$1 = /* @__PURE__ */ _safeEncode($ZodRealError);
|
|
1002
983
|
const _safeDecode = (_Err) => (schema, value, _ctx) => {
|
|
1003
984
|
return _safeParse(_Err)(schema, value, _ctx);
|
|
1004
985
|
};
|
|
1005
|
-
const safeDecode$1 = /* @__PURE__ */ _safeDecode($ZodRealError);
|
|
1006
986
|
const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1007
987
|
const ctx = _ctx ? {
|
|
1008
988
|
..._ctx,
|
|
@@ -1010,12 +990,9 @@ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
1010
990
|
} : { direction: "backward" };
|
|
1011
991
|
return _safeParseAsync(_Err)(schema, value, ctx);
|
|
1012
992
|
};
|
|
1013
|
-
const safeEncodeAsync$1 = /* @__PURE__ */ _safeEncodeAsync($ZodRealError);
|
|
1014
993
|
const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1015
994
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
1016
995
|
};
|
|
1017
|
-
const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
1018
|
-
|
|
1019
996
|
//#endregion
|
|
1020
997
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.js
|
|
1021
998
|
/**
|
|
@@ -1039,9 +1016,9 @@ const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9
|
|
|
1039
1016
|
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
1040
1017
|
*
|
|
1041
1018
|
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
1042
|
-
const uuid = (version
|
|
1043
|
-
if (!version
|
|
1044
|
-
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version
|
|
1019
|
+
const uuid = (version) => {
|
|
1020
|
+
if (!version) 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)$/;
|
|
1021
|
+
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})$`);
|
|
1045
1022
|
};
|
|
1046
1023
|
/** Practical email validation */
|
|
1047
1024
|
const 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,}$/;
|
|
@@ -1064,11 +1041,10 @@ const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468
|
|
|
1064
1041
|
function anchor(source) {
|
|
1065
1042
|
return new RegExp(`^${source}$`);
|
|
1066
1043
|
}
|
|
1067
|
-
const date =
|
|
1044
|
+
const date = /*@__PURE__*/ anchor(dateSource);
|
|
1068
1045
|
function timeSource(args) {
|
|
1069
1046
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
1070
|
-
|
|
1071
|
-
return regex;
|
|
1047
|
+
return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : args.seconds ? `${hhmm}:[0-5]\\d(?:\\.\\d+)?` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
1072
1048
|
}
|
|
1073
1049
|
function time(args) {
|
|
1074
1050
|
return new RegExp(`^${timeSource(args)}$`);
|
|
@@ -1089,14 +1065,13 @@ const number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
|
1089
1065
|
const boolean$1 = /^(?:true|false)$/i;
|
|
1090
1066
|
const lowercase = /^[^A-Z]*$/;
|
|
1091
1067
|
const uppercase = /^[^a-z]*$/;
|
|
1092
|
-
|
|
1093
1068
|
//#endregion
|
|
1094
1069
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.js
|
|
1095
|
-
const $ZodCheck =
|
|
1096
|
-
var _a
|
|
1070
|
+
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
1071
|
+
var _a;
|
|
1097
1072
|
inst._zod ?? (inst._zod = {});
|
|
1098
1073
|
inst._zod.def = def;
|
|
1099
|
-
(_a
|
|
1074
|
+
(_a = inst._zod).onattach ?? (_a.onattach = []);
|
|
1100
1075
|
});
|
|
1101
1076
|
/** Default `when` for length-based checks: run only on non-nullish values with a `length`. */
|
|
1102
1077
|
const _whenHasLength = (payload) => {
|
|
@@ -1108,7 +1083,7 @@ const numericOriginMap = {
|
|
|
1108
1083
|
bigint: "bigint",
|
|
1109
1084
|
object: "date"
|
|
1110
1085
|
};
|
|
1111
|
-
const $ZodCheckLessThan =
|
|
1086
|
+
const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
1112
1087
|
$ZodCheck.init(inst, def);
|
|
1113
1088
|
const origin = numericOriginMap[typeof def.value];
|
|
1114
1089
|
inst._zod.check = (payload) => {
|
|
@@ -1124,7 +1099,7 @@ const $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (ins
|
|
|
1124
1099
|
});
|
|
1125
1100
|
};
|
|
1126
1101
|
});
|
|
1127
|
-
const $ZodCheckGreaterThan =
|
|
1102
|
+
const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
1128
1103
|
$ZodCheck.init(inst, def);
|
|
1129
1104
|
const origin = numericOriginMap[typeof def.value];
|
|
1130
1105
|
inst._zod.check = (payload) => {
|
|
@@ -1140,12 +1115,11 @@ const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan"
|
|
|
1140
1115
|
});
|
|
1141
1116
|
};
|
|
1142
1117
|
});
|
|
1143
|
-
const $ZodCheckMultipleOf =
|
|
1118
|
+
const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
1144
1119
|
$ZodCheck.init(inst, def);
|
|
1145
1120
|
inst._zod.check = (payload) => {
|
|
1146
1121
|
if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
1147
|
-
|
|
1148
|
-
if (isMultiple) return;
|
|
1122
|
+
if (typeof payload.value === "bigint" ? def.value !== BigInt(0) && payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
|
|
1149
1123
|
payload.issues.push({
|
|
1150
1124
|
origin: typeof payload.value,
|
|
1151
1125
|
code: "not_multiple_of",
|
|
@@ -1156,7 +1130,7 @@ const $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf",
|
|
|
1156
1130
|
});
|
|
1157
1131
|
};
|
|
1158
1132
|
});
|
|
1159
|
-
const $ZodCheckNumberFormat =
|
|
1133
|
+
const $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat", (inst, def) => {
|
|
1160
1134
|
$ZodCheck.init(inst, def);
|
|
1161
1135
|
def.format = def.format || "float64";
|
|
1162
1136
|
const isInt = def.format?.includes("int");
|
|
@@ -1220,15 +1194,14 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
|
|
|
1220
1194
|
});
|
|
1221
1195
|
};
|
|
1222
1196
|
});
|
|
1223
|
-
const $ZodCheckMaxLength =
|
|
1224
|
-
var _a
|
|
1197
|
+
const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
1198
|
+
var _a;
|
|
1225
1199
|
$ZodCheck.init(inst, def);
|
|
1226
|
-
(_a
|
|
1200
|
+
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1227
1201
|
inst._zod.check = (payload) => {
|
|
1228
1202
|
const input = payload.value;
|
|
1229
1203
|
const units = input.length;
|
|
1230
|
-
|
|
1231
|
-
if (length <= def.maximum) return;
|
|
1204
|
+
if ((typeof input === "string" && units > def.maximum ? codePointLength(input) : units) <= def.maximum) return;
|
|
1232
1205
|
const origin = getLengthableOrigin(input);
|
|
1233
1206
|
payload.issues.push({
|
|
1234
1207
|
origin,
|
|
@@ -1241,15 +1214,14 @@ const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (i
|
|
|
1241
1214
|
});
|
|
1242
1215
|
};
|
|
1243
1216
|
});
|
|
1244
|
-
const $ZodCheckMinLength =
|
|
1245
|
-
var _a
|
|
1217
|
+
const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
1218
|
+
var _a;
|
|
1246
1219
|
$ZodCheck.init(inst, def);
|
|
1247
|
-
(_a
|
|
1220
|
+
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1248
1221
|
inst._zod.check = (payload) => {
|
|
1249
1222
|
const input = payload.value;
|
|
1250
1223
|
const units = input.length;
|
|
1251
|
-
|
|
1252
|
-
if (length >= def.minimum) return;
|
|
1224
|
+
if ((typeof input === "string" && units >= def.minimum && units < def.minimum * 2 ? codePointLength(input) : units) >= def.minimum) return;
|
|
1253
1225
|
const origin = getLengthableOrigin(input);
|
|
1254
1226
|
payload.issues.push({
|
|
1255
1227
|
origin,
|
|
@@ -1262,10 +1234,10 @@ const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (i
|
|
|
1262
1234
|
});
|
|
1263
1235
|
};
|
|
1264
1236
|
});
|
|
1265
|
-
const $ZodCheckLengthEquals =
|
|
1266
|
-
var _a
|
|
1237
|
+
const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
1238
|
+
var _a;
|
|
1267
1239
|
$ZodCheck.init(inst, def);
|
|
1268
|
-
(_a
|
|
1240
|
+
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1269
1241
|
inst._zod.check = (payload) => {
|
|
1270
1242
|
const input = payload.value;
|
|
1271
1243
|
const units = input.length;
|
|
@@ -1290,10 +1262,10 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
|
|
|
1290
1262
|
});
|
|
1291
1263
|
};
|
|
1292
1264
|
});
|
|
1293
|
-
const $ZodCheckStringFormat =
|
|
1294
|
-
var _a
|
|
1265
|
+
const $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
1266
|
+
var _a, _b;
|
|
1295
1267
|
$ZodCheck.init(inst, def);
|
|
1296
|
-
if (def.pattern) (_a
|
|
1268
|
+
if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
1297
1269
|
def.pattern.lastIndex = 0;
|
|
1298
1270
|
if (def.pattern.test(payload.value)) return;
|
|
1299
1271
|
payload.issues.push({
|
|
@@ -1308,7 +1280,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
|
|
|
1308
1280
|
});
|
|
1309
1281
|
else (_b = inst._zod).check ?? (_b.check = () => {});
|
|
1310
1282
|
});
|
|
1311
|
-
const $ZodCheckRegex =
|
|
1283
|
+
const $ZodCheckRegex = /*@__PURE__*/ $constructor("$ZodCheckRegex", (inst, def) => {
|
|
1312
1284
|
$ZodCheckStringFormat.init(inst, def);
|
|
1313
1285
|
inst._zod.check = (payload) => {
|
|
1314
1286
|
def.pattern.lastIndex = 0;
|
|
@@ -1324,19 +1296,18 @@ const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def
|
|
|
1324
1296
|
});
|
|
1325
1297
|
};
|
|
1326
1298
|
});
|
|
1327
|
-
const $ZodCheckLowerCase =
|
|
1299
|
+
const $ZodCheckLowerCase = /*@__PURE__*/ $constructor("$ZodCheckLowerCase", (inst, def) => {
|
|
1328
1300
|
def.pattern ?? (def.pattern = lowercase);
|
|
1329
1301
|
$ZodCheckStringFormat.init(inst, def);
|
|
1330
1302
|
});
|
|
1331
|
-
const $ZodCheckUpperCase =
|
|
1303
|
+
const $ZodCheckUpperCase = /*@__PURE__*/ $constructor("$ZodCheckUpperCase", (inst, def) => {
|
|
1332
1304
|
def.pattern ?? (def.pattern = uppercase);
|
|
1333
1305
|
$ZodCheckStringFormat.init(inst, def);
|
|
1334
1306
|
});
|
|
1335
|
-
const $ZodCheckIncludes =
|
|
1307
|
+
const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
|
|
1336
1308
|
$ZodCheck.init(inst, def);
|
|
1337
1309
|
const escapedRegex = escapeRegex(def.includes);
|
|
1338
|
-
|
|
1339
|
-
def.pattern = pattern;
|
|
1310
|
+
def.pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
1340
1311
|
inst._zod.check = (payload) => {
|
|
1341
1312
|
if (payload.value.includes(def.includes, def.position)) return;
|
|
1342
1313
|
payload.issues.push({
|
|
@@ -1350,7 +1321,7 @@ const $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (ins
|
|
|
1350
1321
|
});
|
|
1351
1322
|
};
|
|
1352
1323
|
});
|
|
1353
|
-
const $ZodCheckStartsWith =
|
|
1324
|
+
const $ZodCheckStartsWith = /*@__PURE__*/ $constructor("$ZodCheckStartsWith", (inst, def) => {
|
|
1354
1325
|
$ZodCheck.init(inst, def);
|
|
1355
1326
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
1356
1327
|
def.pattern ?? (def.pattern = pattern);
|
|
@@ -1367,7 +1338,7 @@ const $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith",
|
|
|
1367
1338
|
});
|
|
1368
1339
|
};
|
|
1369
1340
|
});
|
|
1370
|
-
const $ZodCheckEndsWith =
|
|
1341
|
+
const $ZodCheckEndsWith = /*@__PURE__*/ $constructor("$ZodCheckEndsWith", (inst, def) => {
|
|
1371
1342
|
$ZodCheck.init(inst, def);
|
|
1372
1343
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
1373
1344
|
def.pattern ?? (def.pattern = pattern);
|
|
@@ -1384,13 +1355,12 @@ const $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (ins
|
|
|
1384
1355
|
});
|
|
1385
1356
|
};
|
|
1386
1357
|
});
|
|
1387
|
-
const $ZodCheckOverwrite =
|
|
1358
|
+
const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst, def) => {
|
|
1388
1359
|
$ZodCheck.init(inst, def);
|
|
1389
1360
|
inst._zod.check = (payload) => {
|
|
1390
1361
|
payload.value = def.tx(payload.value);
|
|
1391
1362
|
};
|
|
1392
1363
|
});
|
|
1393
|
-
|
|
1394
1364
|
//#endregion
|
|
1395
1365
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.js
|
|
1396
1366
|
var Doc = class {
|
|
@@ -1414,8 +1384,7 @@ var Doc = class {
|
|
|
1414
1384
|
arg(this, { execution: "async" });
|
|
1415
1385
|
return;
|
|
1416
1386
|
}
|
|
1417
|
-
const
|
|
1418
|
-
const lines = content.split("\n").filter((x) => x);
|
|
1387
|
+
const lines = arg.split("\n").filter((x) => x);
|
|
1419
1388
|
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
|
|
1420
1389
|
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
|
|
1421
1390
|
for (const line of dedented) this.content.push(line);
|
|
@@ -1423,11 +1392,9 @@ var Doc = class {
|
|
|
1423
1392
|
compile() {
|
|
1424
1393
|
const F = Function;
|
|
1425
1394
|
const content = this?.content ?? [``];
|
|
1426
|
-
|
|
1427
|
-
return factory(...Object.values(this.closed));
|
|
1395
|
+
return new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`)(...Object.values(this.closed));
|
|
1428
1396
|
}
|
|
1429
1397
|
};
|
|
1430
|
-
|
|
1431
1398
|
//#endregion
|
|
1432
1399
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.js
|
|
1433
1400
|
const version = {
|
|
@@ -1435,11 +1402,10 @@ const version = {
|
|
|
1435
1402
|
minor: 6,
|
|
1436
1403
|
patch: 5
|
|
1437
1404
|
};
|
|
1438
|
-
|
|
1439
1405
|
//#endregion
|
|
1440
1406
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.js
|
|
1441
|
-
const $ZodType =
|
|
1442
|
-
var _a
|
|
1407
|
+
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1408
|
+
var _a;
|
|
1443
1409
|
inst ?? (inst = {});
|
|
1444
1410
|
inst._zod.def = def;
|
|
1445
1411
|
inst._zod.bag = inst._zod.bag || {};
|
|
@@ -1448,34 +1414,31 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1448
1414
|
const checks = inst._zod.traits.has("$ZodCheck") ? [inst, ...defChecks ?? []] : defChecks?.length ? [...defChecks] : [];
|
|
1449
1415
|
for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
|
|
1450
1416
|
if (checks.length === 0) {
|
|
1451
|
-
(_a
|
|
1417
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
1452
1418
|
inst._zod.deferred?.push(() => {
|
|
1453
1419
|
inst._zod.run = inst._zod.parse;
|
|
1454
1420
|
});
|
|
1455
1421
|
} else {
|
|
1456
|
-
const runChecks = (payload, checks
|
|
1422
|
+
const runChecks = (payload, checks, ctx) => {
|
|
1457
1423
|
if (payload.memo) return payload;
|
|
1458
1424
|
let isAborted = aborted(payload);
|
|
1459
1425
|
let asyncResult;
|
|
1460
|
-
for (const ch of checks
|
|
1426
|
+
for (const ch of checks) {
|
|
1461
1427
|
if (ch._zod.def.when) {
|
|
1462
1428
|
if (explicitlyAborted(payload)) continue;
|
|
1463
|
-
|
|
1464
|
-
if (!shouldRun) continue;
|
|
1429
|
+
if (!ch._zod.def.when(payload)) continue;
|
|
1465
1430
|
} else if (isAborted) continue;
|
|
1466
1431
|
const currLen = payload.issues.length;
|
|
1467
1432
|
const _ = ch._zod.check(payload);
|
|
1468
1433
|
if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
|
|
1469
1434
|
if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
1470
1435
|
await _;
|
|
1471
|
-
|
|
1472
|
-
if (nextLen === currLen) return;
|
|
1436
|
+
if (payload.issues.length === currLen) return;
|
|
1473
1437
|
attachSchema(payload.issues, currLen, inst);
|
|
1474
1438
|
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
1475
1439
|
});
|
|
1476
1440
|
else {
|
|
1477
|
-
|
|
1478
|
-
if (nextLen === currLen) continue;
|
|
1441
|
+
if (payload.issues.length === currLen) continue;
|
|
1479
1442
|
attachSchema(payload.issues, currLen, inst);
|
|
1480
1443
|
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
1481
1444
|
}
|
|
@@ -1493,7 +1456,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1493
1456
|
const checkResult = runChecks(payload, checks, ctx);
|
|
1494
1457
|
if (checkResult instanceof Promise) {
|
|
1495
1458
|
if (ctx.async === false) throw new $ZodAsyncError();
|
|
1496
|
-
return checkResult.then((checkResult
|
|
1459
|
+
return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
|
|
1497
1460
|
}
|
|
1498
1461
|
return inst._zod.parse(checkResult, ctx);
|
|
1499
1462
|
};
|
|
@@ -1507,15 +1470,15 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1507
1470
|
...ctx,
|
|
1508
1471
|
skipChecks: true
|
|
1509
1472
|
});
|
|
1510
|
-
if (canary instanceof Promise) return canary.then((canary
|
|
1511
|
-
return handleCanaryResult(canary
|
|
1473
|
+
if (canary instanceof Promise) return canary.then((canary) => {
|
|
1474
|
+
return handleCanaryResult(canary, payload, ctx);
|
|
1512
1475
|
});
|
|
1513
1476
|
return handleCanaryResult(canary, payload, ctx);
|
|
1514
1477
|
}
|
|
1515
1478
|
const result = inst._zod.parse(payload, ctx);
|
|
1516
1479
|
if (result instanceof Promise) {
|
|
1517
1480
|
if (ctx.async === false) throw new $ZodAsyncError();
|
|
1518
|
-
return result.then((result
|
|
1481
|
+
return result.then((result) => runChecks(result, checks, ctx));
|
|
1519
1482
|
}
|
|
1520
1483
|
return runChecks(result, checks, ctx);
|
|
1521
1484
|
};
|
|
@@ -1530,7 +1493,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1530
1493
|
});
|
|
1531
1494
|
/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
|
|
1532
1495
|
const toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
|
|
1533
|
-
async function validateAsync
|
|
1496
|
+
async function validateAsync(inst, value) {
|
|
1534
1497
|
const ctx = { async: true };
|
|
1535
1498
|
return toStandardResult(await inst._zod.run({
|
|
1536
1499
|
value,
|
|
@@ -1548,19 +1511,19 @@ function standardProps(inst) {
|
|
|
1548
1511
|
}, ctx);
|
|
1549
1512
|
if (!(r instanceof Promise)) return toStandardResult(r, ctx);
|
|
1550
1513
|
} catch (_) {}
|
|
1551
|
-
return validateAsync
|
|
1514
|
+
return validateAsync(inst, value);
|
|
1552
1515
|
},
|
|
1553
1516
|
vendor: "zod",
|
|
1554
1517
|
version: 1
|
|
1555
1518
|
};
|
|
1556
1519
|
}
|
|
1557
|
-
const $ZodString =
|
|
1520
|
+
const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
|
|
1558
1521
|
$ZodType.init(inst, def);
|
|
1559
1522
|
inst._zod.pattern = def.pattern ?? anyString;
|
|
1560
1523
|
inst._zod.parse = (payload, _) => {
|
|
1561
1524
|
if (def.coerce) try {
|
|
1562
1525
|
payload.value = String(payload.value);
|
|
1563
|
-
} catch (_
|
|
1526
|
+
} catch (_) {}
|
|
1564
1527
|
if (typeof payload.value === "string") return payload;
|
|
1565
1528
|
payload.issues.push({
|
|
1566
1529
|
expected: "string",
|
|
@@ -1571,17 +1534,17 @@ const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
|
1571
1534
|
return payload;
|
|
1572
1535
|
};
|
|
1573
1536
|
});
|
|
1574
|
-
const $ZodStringFormat =
|
|
1537
|
+
const $ZodStringFormat = /*@__PURE__*/ $constructor("$ZodStringFormat", (inst, def) => {
|
|
1575
1538
|
$ZodCheckStringFormat.init(inst, def);
|
|
1576
1539
|
$ZodString.init(inst, def);
|
|
1577
1540
|
});
|
|
1578
|
-
const $ZodGUID =
|
|
1541
|
+
const $ZodGUID = /*@__PURE__*/ $constructor("$ZodGUID", (inst, def) => {
|
|
1579
1542
|
def.pattern ?? (def.pattern = guid);
|
|
1580
1543
|
$ZodStringFormat.init(inst, def);
|
|
1581
1544
|
});
|
|
1582
|
-
const $ZodUUID =
|
|
1545
|
+
const $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
|
|
1583
1546
|
if (def.version) {
|
|
1584
|
-
const
|
|
1547
|
+
const v = {
|
|
1585
1548
|
v1: 1,
|
|
1586
1549
|
v2: 2,
|
|
1587
1550
|
v3: 3,
|
|
@@ -1590,21 +1553,16 @@ const $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
|
|
|
1590
1553
|
v6: 6,
|
|
1591
1554
|
v7: 7,
|
|
1592
1555
|
v8: 8
|
|
1593
|
-
};
|
|
1594
|
-
const v = versionMap[def.version];
|
|
1556
|
+
}[def.version];
|
|
1595
1557
|
if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`);
|
|
1596
1558
|
def.pattern ?? (def.pattern = uuid(v));
|
|
1597
1559
|
} else def.pattern ?? (def.pattern = uuid());
|
|
1598
1560
|
$ZodStringFormat.init(inst, def);
|
|
1599
1561
|
});
|
|
1600
|
-
const $ZodEmail =
|
|
1562
|
+
const $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
|
|
1601
1563
|
def.pattern ?? (def.pattern = email);
|
|
1602
1564
|
$ZodStringFormat.init(inst, def);
|
|
1603
1565
|
});
|
|
1604
|
-
/** The `://` guard rejected the input before the URL constructor saw it. */
|
|
1605
|
-
const URL_BAD_FORMAT = 1;
|
|
1606
|
-
/** The URL parser rejected the input. */
|
|
1607
|
-
const URL_UNPARSEABLE = 2;
|
|
1608
1566
|
function canParseURL(input) {
|
|
1609
1567
|
try {
|
|
1610
1568
|
if (typeof URL !== "undefined" && typeof URL.canParse === "function") return URL.canParse(input);
|
|
@@ -1615,20 +1573,20 @@ function canParseURL(input) {
|
|
|
1615
1573
|
}
|
|
1616
1574
|
}
|
|
1617
1575
|
function validateURL(trimmed, def) {
|
|
1618
|
-
if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) return canParseURL(trimmed) ||
|
|
1576
|
+
if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) return canParseURL(trimmed) || 2;
|
|
1619
1577
|
return parseURLObject(trimmed, def);
|
|
1620
1578
|
}
|
|
1621
1579
|
/** Parses a URL while preserving the non-normalizing HTTP guard. */
|
|
1622
1580
|
function parseURLObject(trimmed, def) {
|
|
1623
|
-
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return
|
|
1581
|
+
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return 1;
|
|
1624
1582
|
try {
|
|
1625
1583
|
if (typeof URL !== "undefined") {
|
|
1626
1584
|
const URLStatic = URL;
|
|
1627
|
-
if (typeof URLStatic.parse === "function") return URLStatic.parse(trimmed) ??
|
|
1585
|
+
if (typeof URLStatic.parse === "function") return URLStatic.parse(trimmed) ?? 2;
|
|
1628
1586
|
}
|
|
1629
1587
|
return new URL(trimmed);
|
|
1630
1588
|
} catch {
|
|
1631
|
-
return
|
|
1589
|
+
return 2;
|
|
1632
1590
|
}
|
|
1633
1591
|
}
|
|
1634
1592
|
const asciiTabOrNewline = /[\t\n\r]/g;
|
|
@@ -1636,21 +1594,21 @@ const asciiTabOrNewline = /[\t\n\r]/g;
|
|
|
1636
1594
|
function stripTabAndNewline(value) {
|
|
1637
1595
|
return value.replace(asciiTabOrNewline, "");
|
|
1638
1596
|
}
|
|
1639
|
-
function urlHostnameOk(url
|
|
1597
|
+
function urlHostnameOk(url, hostname) {
|
|
1640
1598
|
hostname.lastIndex = 0;
|
|
1641
|
-
return hostname.test(url
|
|
1599
|
+
return hostname.test(url.hostname);
|
|
1642
1600
|
}
|
|
1643
|
-
function urlProtocolOk(url
|
|
1601
|
+
function urlProtocolOk(url, protocol) {
|
|
1644
1602
|
protocol.lastIndex = 0;
|
|
1645
|
-
return protocol.test(url
|
|
1603
|
+
return protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol);
|
|
1646
1604
|
}
|
|
1647
|
-
const $ZodURL =
|
|
1605
|
+
const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
|
|
1648
1606
|
$ZodStringFormat.init(inst, def);
|
|
1649
1607
|
inst._zod.check = (payload) => {
|
|
1650
1608
|
try {
|
|
1651
1609
|
const trimmed = payload.value.trim();
|
|
1652
|
-
const url
|
|
1653
|
-
if (url
|
|
1610
|
+
const url = validateURL(trimmed, def);
|
|
1611
|
+
if (url === 1) {
|
|
1654
1612
|
payload.issues.push({
|
|
1655
1613
|
code: "invalid_format",
|
|
1656
1614
|
format: "url",
|
|
@@ -1661,7 +1619,7 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
1661
1619
|
});
|
|
1662
1620
|
return;
|
|
1663
1621
|
}
|
|
1664
|
-
if (url
|
|
1622
|
+
if (url === 2) {
|
|
1665
1623
|
payload.issues.push({
|
|
1666
1624
|
code: "invalid_format",
|
|
1667
1625
|
format: "url",
|
|
@@ -1671,11 +1629,11 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
1671
1629
|
});
|
|
1672
1630
|
return;
|
|
1673
1631
|
}
|
|
1674
|
-
if (url
|
|
1632
|
+
if (url === true) {
|
|
1675
1633
|
payload.value = stripTabAndNewline(trimmed);
|
|
1676
1634
|
return;
|
|
1677
1635
|
}
|
|
1678
|
-
if (def.hostname && !urlHostnameOk(url
|
|
1636
|
+
if (def.hostname && !urlHostnameOk(url, def.hostname)) payload.issues.push({
|
|
1679
1637
|
code: "invalid_format",
|
|
1680
1638
|
format: "url",
|
|
1681
1639
|
note: "Invalid hostname",
|
|
@@ -1684,7 +1642,7 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
1684
1642
|
inst,
|
|
1685
1643
|
continue: !def.abort
|
|
1686
1644
|
});
|
|
1687
|
-
if (def.protocol && !urlProtocolOk(url
|
|
1645
|
+
if (def.protocol && !urlProtocolOk(url, def.protocol)) payload.issues.push({
|
|
1688
1646
|
code: "invalid_format",
|
|
1689
1647
|
format: "url",
|
|
1690
1648
|
note: "Invalid protocol",
|
|
@@ -1693,7 +1651,7 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
1693
1651
|
inst,
|
|
1694
1652
|
continue: !def.abort
|
|
1695
1653
|
});
|
|
1696
|
-
payload.value = def.normalize ? url
|
|
1654
|
+
payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);
|
|
1697
1655
|
return;
|
|
1698
1656
|
} catch (_) {
|
|
1699
1657
|
payload.issues.push({
|
|
@@ -1706,11 +1664,11 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
1706
1664
|
}
|
|
1707
1665
|
};
|
|
1708
1666
|
});
|
|
1709
|
-
const $ZodEmoji =
|
|
1667
|
+
const $ZodEmoji = /*@__PURE__*/ $constructor("$ZodEmoji", (inst, def) => {
|
|
1710
1668
|
def.pattern ?? (def.pattern = emoji());
|
|
1711
1669
|
$ZodStringFormat.init(inst, def);
|
|
1712
1670
|
});
|
|
1713
|
-
const $ZodNanoID =
|
|
1671
|
+
const $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => {
|
|
1714
1672
|
if (def.length !== void 0 && (!Number.isInteger(def.length) || def.length < 1)) throw new Error(`Invalid nanoid length: ${def.length}`);
|
|
1715
1673
|
def.pattern ?? (def.pattern = def.length === void 0 ? nanoid : nanoidOfLength(def.length));
|
|
1716
1674
|
$ZodStringFormat.init(inst, def);
|
|
@@ -1720,43 +1678,43 @@ const $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => {
|
|
|
1720
1678
|
* (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
|
|
1721
1679
|
* See https://github.com/paralleldrive/cuid.
|
|
1722
1680
|
*/
|
|
1723
|
-
const $ZodCUID =
|
|
1681
|
+
const $ZodCUID = /*@__PURE__*/ $constructor("$ZodCUID", (inst, def) => {
|
|
1724
1682
|
def.pattern ?? (def.pattern = cuid);
|
|
1725
1683
|
$ZodStringFormat.init(inst, def);
|
|
1726
1684
|
});
|
|
1727
|
-
const $ZodCUID2 =
|
|
1685
|
+
const $ZodCUID2 = /*@__PURE__*/ $constructor("$ZodCUID2", (inst, def) => {
|
|
1728
1686
|
def.pattern ?? (def.pattern = cuid2);
|
|
1729
1687
|
$ZodStringFormat.init(inst, def);
|
|
1730
1688
|
});
|
|
1731
|
-
const $ZodULID =
|
|
1689
|
+
const $ZodULID = /*@__PURE__*/ $constructor("$ZodULID", (inst, def) => {
|
|
1732
1690
|
def.pattern ?? (def.pattern = ulid);
|
|
1733
1691
|
$ZodStringFormat.init(inst, def);
|
|
1734
1692
|
});
|
|
1735
|
-
const $ZodXID =
|
|
1693
|
+
const $ZodXID = /*@__PURE__*/ $constructor("$ZodXID", (inst, def) => {
|
|
1736
1694
|
def.pattern ?? (def.pattern = xid);
|
|
1737
1695
|
$ZodStringFormat.init(inst, def);
|
|
1738
1696
|
});
|
|
1739
|
-
const $ZodKSUID =
|
|
1697
|
+
const $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
|
|
1740
1698
|
def.pattern ?? (def.pattern = ksuid);
|
|
1741
1699
|
$ZodStringFormat.init(inst, def);
|
|
1742
1700
|
});
|
|
1743
|
-
const $ZodISODateTime =
|
|
1701
|
+
const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
1744
1702
|
def.pattern ?? (def.pattern = datetime(def));
|
|
1745
1703
|
$ZodStringFormat.init(inst, def);
|
|
1746
1704
|
});
|
|
1747
|
-
const $ZodISODate =
|
|
1705
|
+
const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
1748
1706
|
def.pattern ?? (def.pattern = date);
|
|
1749
1707
|
$ZodStringFormat.init(inst, def);
|
|
1750
1708
|
});
|
|
1751
|
-
const $ZodISOTime =
|
|
1709
|
+
const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
|
|
1752
1710
|
def.pattern ?? (def.pattern = time(def));
|
|
1753
1711
|
$ZodStringFormat.init(inst, def);
|
|
1754
1712
|
});
|
|
1755
|
-
const $ZodISODuration =
|
|
1713
|
+
const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def) => {
|
|
1756
1714
|
def.pattern ?? (def.pattern = duration);
|
|
1757
1715
|
$ZodStringFormat.init(inst, def);
|
|
1758
1716
|
});
|
|
1759
|
-
const $ZodIPv4 =
|
|
1717
|
+
const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
|
|
1760
1718
|
def.pattern ?? (def.pattern = ipv4);
|
|
1761
1719
|
$ZodStringFormat.init(inst, def);
|
|
1762
1720
|
});
|
|
@@ -1766,7 +1724,7 @@ function isValidIPv6(value) {
|
|
|
1766
1724
|
if (!ipv6Alphabet.test(value)) return false;
|
|
1767
1725
|
return canParseURL(`http://[${value}]`);
|
|
1768
1726
|
}
|
|
1769
|
-
const $ZodIPv6 =
|
|
1727
|
+
const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
1770
1728
|
def.pattern ?? (def.pattern = ipv6);
|
|
1771
1729
|
$ZodStringFormat.init(inst, def);
|
|
1772
1730
|
inst._zod.check = (payload) => {
|
|
@@ -1779,7 +1737,7 @@ const $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
|
1779
1737
|
});
|
|
1780
1738
|
};
|
|
1781
1739
|
});
|
|
1782
|
-
const $ZodCIDRv4 =
|
|
1740
|
+
const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
1783
1741
|
def.pattern ?? (def.pattern = cidrv4);
|
|
1784
1742
|
$ZodStringFormat.init(inst, def);
|
|
1785
1743
|
});
|
|
@@ -1793,7 +1751,7 @@ function isValidCIDRv6(value) {
|
|
|
1793
1751
|
if (prefixNum < 0 || prefixNum > 128) return false;
|
|
1794
1752
|
return isValidIPv6(address);
|
|
1795
1753
|
}
|
|
1796
|
-
const $ZodCIDRv6 =
|
|
1754
|
+
const $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => {
|
|
1797
1755
|
def.pattern ?? (def.pattern = cidrv6);
|
|
1798
1756
|
$ZodStringFormat.init(inst, def);
|
|
1799
1757
|
inst._zod.check = (payload) => {
|
|
@@ -1818,7 +1776,7 @@ function isValidBase64(data) {
|
|
|
1818
1776
|
}
|
|
1819
1777
|
}
|
|
1820
1778
|
const base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
1821
|
-
const $ZodBase64 =
|
|
1779
|
+
const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
|
|
1822
1780
|
def.pattern ?? (def.pattern = base64Charset);
|
|
1823
1781
|
$ZodStringFormat.init(inst, def);
|
|
1824
1782
|
inst._zod.check = (payload) => {
|
|
@@ -1835,11 +1793,10 @@ const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
1835
1793
|
const base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
1836
1794
|
function isValidBase64URL(data) {
|
|
1837
1795
|
if (!base64urlCharset.test(data)) return false;
|
|
1838
|
-
const base64
|
|
1839
|
-
|
|
1840
|
-
return isValidBase64(padded);
|
|
1796
|
+
const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
1797
|
+
return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
|
|
1841
1798
|
}
|
|
1842
|
-
const $ZodBase64URL =
|
|
1799
|
+
const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
|
|
1843
1800
|
def.pattern ?? (def.pattern = base64urlCharset);
|
|
1844
1801
|
$ZodStringFormat.init(inst, def);
|
|
1845
1802
|
inst._zod.check = (payload) => {
|
|
@@ -1853,7 +1810,7 @@ const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def)
|
|
|
1853
1810
|
});
|
|
1854
1811
|
};
|
|
1855
1812
|
});
|
|
1856
|
-
const $ZodE164 =
|
|
1813
|
+
const $ZodE164 = /*@__PURE__*/ $constructor("$ZodE164", (inst, def) => {
|
|
1857
1814
|
def.pattern ?? (def.pattern = e164);
|
|
1858
1815
|
$ZodStringFormat.init(inst, def);
|
|
1859
1816
|
});
|
|
@@ -1872,7 +1829,7 @@ function isValidJWT(token, algorithm = null) {
|
|
|
1872
1829
|
return false;
|
|
1873
1830
|
}
|
|
1874
1831
|
}
|
|
1875
|
-
const $ZodJWT =
|
|
1832
|
+
const $ZodJWT = /*@__PURE__*/ $constructor("$ZodJWT", (inst, def) => {
|
|
1876
1833
|
$ZodStringFormat.init(inst, def);
|
|
1877
1834
|
inst._zod.check = (payload) => {
|
|
1878
1835
|
if (isValidJWT(payload.value, def.alg)) return;
|
|
@@ -1885,7 +1842,7 @@ const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
|
|
|
1885
1842
|
});
|
|
1886
1843
|
};
|
|
1887
1844
|
});
|
|
1888
|
-
const $ZodNumber =
|
|
1845
|
+
const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
1889
1846
|
$ZodType.init(inst, def);
|
|
1890
1847
|
inst._zod.pattern = number$1;
|
|
1891
1848
|
inst._zod.parse = (payload, _ctx) => {
|
|
@@ -1905,11 +1862,11 @@ const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
|
1905
1862
|
return payload;
|
|
1906
1863
|
};
|
|
1907
1864
|
});
|
|
1908
|
-
const $ZodNumberFormat =
|
|
1865
|
+
const $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumberFormat", (inst, def) => {
|
|
1909
1866
|
$ZodCheckNumberFormat.init(inst, def);
|
|
1910
1867
|
$ZodNumber.init(inst, def);
|
|
1911
1868
|
});
|
|
1912
|
-
const $ZodBoolean =
|
|
1869
|
+
const $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => {
|
|
1913
1870
|
$ZodType.init(inst, def);
|
|
1914
1871
|
inst._zod.pattern = boolean$1;
|
|
1915
1872
|
inst._zod.parse = (payload, _ctx) => {
|
|
@@ -1927,11 +1884,11 @@ const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
1927
1884
|
return payload;
|
|
1928
1885
|
};
|
|
1929
1886
|
});
|
|
1930
|
-
const $ZodUnknown =
|
|
1887
|
+
const $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def) => {
|
|
1931
1888
|
$ZodType.init(inst, def);
|
|
1932
1889
|
inst._zod.parse = (payload) => payload;
|
|
1933
1890
|
});
|
|
1934
|
-
const $ZodNever =
|
|
1891
|
+
const $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
|
|
1935
1892
|
$ZodType.init(inst, def);
|
|
1936
1893
|
inst._zod.parse = (payload, _ctx) => {
|
|
1937
1894
|
payload.issues.push({
|
|
@@ -1947,10 +1904,10 @@ function handleArrayResult(result, final, index) {
|
|
|
1947
1904
|
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
1948
1905
|
final.value[index] = result.value;
|
|
1949
1906
|
}
|
|
1950
|
-
const $ZodArray =
|
|
1907
|
+
const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
1951
1908
|
$ZodType.init(inst, def);
|
|
1952
|
-
const memo
|
|
1953
|
-
memo
|
|
1909
|
+
const memo = globalConfig.memoizer;
|
|
1910
|
+
memo?.attach(inst);
|
|
1954
1911
|
inst._zod.parse = (payload, ctx) => {
|
|
1955
1912
|
const input = payload.value;
|
|
1956
1913
|
if (!Array.isArray(input)) {
|
|
@@ -1962,7 +1919,7 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
1962
1919
|
});
|
|
1963
1920
|
return payload;
|
|
1964
1921
|
}
|
|
1965
|
-
payload.value = memo
|
|
1922
|
+
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
1966
1923
|
const proms = [];
|
|
1967
1924
|
const abortEarly = ctx?.abortEarly;
|
|
1968
1925
|
for (let i = 0; i < input.length; i++) {
|
|
@@ -1971,7 +1928,7 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
1971
1928
|
value: item,
|
|
1972
1929
|
issues: []
|
|
1973
1930
|
}, ctx);
|
|
1974
|
-
if (result instanceof Promise) proms.push(result.then((result
|
|
1931
|
+
if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
1975
1932
|
else {
|
|
1976
1933
|
handleArrayResult(result, payload, i);
|
|
1977
1934
|
if (abortEarly && result.issues.length !== 0 && aborted(result)) break;
|
|
@@ -2045,7 +2002,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
|
|
|
2045
2002
|
value: input[key],
|
|
2046
2003
|
issues: []
|
|
2047
2004
|
}, ctx);
|
|
2048
|
-
if (r instanceof Promise) proms.push(r.then((r
|
|
2005
|
+
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
|
|
2049
2006
|
else handlePropertyResult(r, payload, key, input, optin, optout);
|
|
2050
2007
|
}
|
|
2051
2008
|
if (unrecognized.length) payload.issues.push({
|
|
@@ -2060,7 +2017,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
|
|
|
2060
2017
|
return payload;
|
|
2061
2018
|
});
|
|
2062
2019
|
}
|
|
2063
|
-
const $ZodObject =
|
|
2020
|
+
const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
2064
2021
|
$ZodType.init(inst, def);
|
|
2065
2022
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
2066
2023
|
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
@@ -2088,15 +2045,15 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
2088
2045
|
}
|
|
2089
2046
|
return propValues;
|
|
2090
2047
|
});
|
|
2091
|
-
const isObject$
|
|
2048
|
+
const isObject$2 = isObject;
|
|
2092
2049
|
const catchall = def.catchall;
|
|
2093
2050
|
let value;
|
|
2094
|
-
const memo
|
|
2095
|
-
memo
|
|
2051
|
+
const memo = globalConfig.memoizer;
|
|
2052
|
+
memo?.attach(inst);
|
|
2096
2053
|
inst._zod.parse = (payload, ctx) => {
|
|
2097
2054
|
value ?? (value = _normalized.value);
|
|
2098
2055
|
const input = payload.value;
|
|
2099
|
-
if (!isObject$
|
|
2056
|
+
if (!isObject$2(input)) {
|
|
2100
2057
|
payload.issues.push({
|
|
2101
2058
|
expected: "object",
|
|
2102
2059
|
code: "invalid_type",
|
|
@@ -2105,7 +2062,7 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
2105
2062
|
});
|
|
2106
2063
|
return payload;
|
|
2107
2064
|
}
|
|
2108
|
-
payload.value = memo
|
|
2065
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
2109
2066
|
const proms = [];
|
|
2110
2067
|
const shape = value.shape;
|
|
2111
2068
|
const abortEarly = ctx?.abortEarly;
|
|
@@ -2123,25 +2080,25 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
2123
2080
|
value: input[key],
|
|
2124
2081
|
issues: []
|
|
2125
2082
|
}, ctx);
|
|
2126
|
-
if (r instanceof Promise) proms.push(r.then((r
|
|
2083
|
+
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
|
|
2127
2084
|
else handlePropertyResult(r, payload, key, input, optin, optout);
|
|
2128
2085
|
}
|
|
2129
2086
|
if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
2130
2087
|
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
2131
2088
|
};
|
|
2132
2089
|
});
|
|
2133
|
-
const $ZodObjectJIT =
|
|
2090
|
+
const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
2134
2091
|
$ZodObject.init(inst, def);
|
|
2135
2092
|
const superParse = inst._zod.parse;
|
|
2136
2093
|
const _normalized = cached(() => normalizeDef(def));
|
|
2137
|
-
const memo
|
|
2094
|
+
const memo = globalConfig.memoizer;
|
|
2138
2095
|
const generateFastpass = (shape) => {
|
|
2139
2096
|
const normalized = _normalized.value;
|
|
2140
2097
|
const syms = normalized.symbolKeys;
|
|
2141
2098
|
const doc = new Doc(["payload", "ctx"], {
|
|
2142
2099
|
shape,
|
|
2143
2100
|
inst,
|
|
2144
|
-
memo
|
|
2101
|
+
memo,
|
|
2145
2102
|
syms
|
|
2146
2103
|
});
|
|
2147
2104
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
@@ -2161,7 +2118,7 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
|
|
|
2161
2118
|
const ids = Object.create(null);
|
|
2162
2119
|
let counter = 0;
|
|
2163
2120
|
for (const key of normalized.allKeys) ids[key] = `key_${counter++}`;
|
|
2164
|
-
doc.write(memo
|
|
2121
|
+
doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
|
|
2165
2122
|
for (const key of normalized.allKeys) {
|
|
2166
2123
|
if (key === "__proto__") continue;
|
|
2167
2124
|
const id = ids[key];
|
|
@@ -2228,8 +2185,7 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
|
|
|
2228
2185
|
let fastpass;
|
|
2229
2186
|
const isObject$1 = isObject;
|
|
2230
2187
|
const jit = !globalConfig.jitless;
|
|
2231
|
-
const
|
|
2232
|
-
const fastEnabled = jit && allowsEval$1.value;
|
|
2188
|
+
const fastEnabled = jit && allowsEval.value;
|
|
2233
2189
|
const catchall = def.catchall;
|
|
2234
2190
|
let value;
|
|
2235
2191
|
inst._zod.parse = (payload, ctx) => {
|
|
@@ -2271,20 +2227,18 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
2271
2227
|
});
|
|
2272
2228
|
return final;
|
|
2273
2229
|
}
|
|
2274
|
-
const $ZodUnion =
|
|
2230
|
+
const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
|
|
2275
2231
|
$ZodType.init(inst, def);
|
|
2276
2232
|
defineLazyInternal(inst, "optin", (zod) => zod.def.options.some((o) => o._zod.optin === "defaulted") ? "defaulted" : zod.def.options.some((o) => o._zod.optin !== void 0) ? "optional" : void 0);
|
|
2277
2233
|
defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
|
|
2278
2234
|
defineLazyInternal(inst, "values", (zod) => {
|
|
2279
2235
|
if (zod.def.options.every((o) => o._zod.values)) return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
2280
|
-
return void 0;
|
|
2281
2236
|
});
|
|
2282
2237
|
defineLazyInternal(inst, "pattern", (zod) => {
|
|
2283
2238
|
if (zod.def.options.every((o) => o._zod.pattern)) {
|
|
2284
2239
|
const patterns = zod.def.options.map((o) => o._zod.pattern);
|
|
2285
2240
|
return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
|
|
2286
2241
|
}
|
|
2287
|
-
return void 0;
|
|
2288
2242
|
});
|
|
2289
2243
|
const first = def.options.length === 1 ? def.options[0]._zod.run : null;
|
|
2290
2244
|
inst._zod.parse = (payload, ctx) => {
|
|
@@ -2305,8 +2259,8 @@ const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
|
2305
2259
|
}
|
|
2306
2260
|
}
|
|
2307
2261
|
if (!async) return handleUnionResults(results, payload, inst, ctx);
|
|
2308
|
-
return Promise.all(results).then((results
|
|
2309
|
-
return handleUnionResults(results
|
|
2262
|
+
return Promise.all(results).then((results) => {
|
|
2263
|
+
return handleUnionResults(results, payload, inst, ctx);
|
|
2310
2264
|
});
|
|
2311
2265
|
};
|
|
2312
2266
|
});
|
|
@@ -2322,7 +2276,7 @@ function discriminatorMap(def) {
|
|
|
2322
2276
|
}
|
|
2323
2277
|
return map;
|
|
2324
2278
|
}
|
|
2325
|
-
const $ZodDiscriminatedUnion =
|
|
2279
|
+
const $ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
2326
2280
|
def.inclusive = false;
|
|
2327
2281
|
$ZodUnion.init(inst, def);
|
|
2328
2282
|
const _super = inst._zod.parse;
|
|
@@ -2366,7 +2320,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
|
|
|
2366
2320
|
errors: [],
|
|
2367
2321
|
note: "No matching discriminator",
|
|
2368
2322
|
discriminator: def.discriminator,
|
|
2369
|
-
options: Array.from(disc.value.keys()).filter((value
|
|
2323
|
+
options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),
|
|
2370
2324
|
input,
|
|
2371
2325
|
path: [def.discriminator],
|
|
2372
2326
|
inst
|
|
@@ -2374,7 +2328,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
|
|
|
2374
2328
|
return payload;
|
|
2375
2329
|
};
|
|
2376
2330
|
});
|
|
2377
|
-
const $ZodIntersection =
|
|
2331
|
+
const $ZodIntersection = /*@__PURE__*/ $constructor("$ZodIntersection", (inst, def) => {
|
|
2378
2332
|
$ZodType.init(inst, def);
|
|
2379
2333
|
inst._zod.parse = (payload, ctx) => {
|
|
2380
2334
|
const input = payload.value;
|
|
@@ -2386,9 +2340,8 @@ const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst,
|
|
|
2386
2340
|
value: input,
|
|
2387
2341
|
issues: []
|
|
2388
2342
|
}, ctx);
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
return handleIntersectionResults(payload, left$1, right$1);
|
|
2343
|
+
if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left, right]) => {
|
|
2344
|
+
return handleIntersectionResults(payload, left, right);
|
|
2392
2345
|
});
|
|
2393
2346
|
return handleIntersectionResults(payload, left, right);
|
|
2394
2347
|
};
|
|
@@ -2489,10 +2442,10 @@ function handleIntersectionResults(result, left, right) {
|
|
|
2489
2442
|
result.value = merged.data;
|
|
2490
2443
|
return result;
|
|
2491
2444
|
}
|
|
2492
|
-
const $ZodRecord =
|
|
2445
|
+
const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
2493
2446
|
$ZodType.init(inst, def);
|
|
2494
|
-
const memo
|
|
2495
|
-
memo
|
|
2447
|
+
const memo = globalConfig.memoizer;
|
|
2448
|
+
memo?.attach(inst);
|
|
2496
2449
|
inst._zod.parse = (payload, ctx) => {
|
|
2497
2450
|
const input = payload.value;
|
|
2498
2451
|
if (!isPlainObject(input)) {
|
|
@@ -2507,7 +2460,7 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2507
2460
|
const proms = [];
|
|
2508
2461
|
const values = def.keyType._zod.values;
|
|
2509
2462
|
if (values && !def.partial) {
|
|
2510
|
-
payload.value = memo
|
|
2463
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
2511
2464
|
const recordKeys = /* @__PURE__ */ new Set();
|
|
2512
2465
|
for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
2513
2466
|
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
@@ -2534,9 +2487,9 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2534
2487
|
value: input[key],
|
|
2535
2488
|
issues: []
|
|
2536
2489
|
}, ctx);
|
|
2537
|
-
if (result instanceof Promise) proms.push(result.then((result
|
|
2538
|
-
if (result
|
|
2539
|
-
payload.value[outKey] = result
|
|
2490
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
2491
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2492
|
+
payload.value[outKey] = result.value;
|
|
2540
2493
|
}));
|
|
2541
2494
|
else {
|
|
2542
2495
|
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
@@ -2544,12 +2497,14 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2544
2497
|
}
|
|
2545
2498
|
}
|
|
2546
2499
|
let unrecognized;
|
|
2547
|
-
for (const key in input) if (!recordKeys.has(key))
|
|
2548
|
-
if (
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2500
|
+
for (const key in input) if (!recordKeys.has(key)) {
|
|
2501
|
+
if (def.mode === "loose") {
|
|
2502
|
+
if (key === "__proto__") continue;
|
|
2503
|
+
payload.value[key] = input[key];
|
|
2504
|
+
} else {
|
|
2505
|
+
unrecognized = unrecognized ?? [];
|
|
2506
|
+
unrecognized.push(key);
|
|
2507
|
+
}
|
|
2553
2508
|
}
|
|
2554
2509
|
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
2555
2510
|
code: "unrecognized_keys",
|
|
@@ -2559,7 +2514,7 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2559
2514
|
continue: true
|
|
2560
2515
|
});
|
|
2561
2516
|
} else {
|
|
2562
|
-
payload.value = memo
|
|
2517
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
2563
2518
|
let unrecognized;
|
|
2564
2519
|
for (const key of Reflect.ownKeys(input)) {
|
|
2565
2520
|
if (key === "__proto__") continue;
|
|
@@ -2569,8 +2524,7 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2569
2524
|
issues: []
|
|
2570
2525
|
}, ctx);
|
|
2571
2526
|
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
2572
|
-
|
|
2573
|
-
if (checkNumericKey) {
|
|
2527
|
+
if (typeof key === "string" && number$1.test(key) && keyResult.issues.length) {
|
|
2574
2528
|
const retryResult = def.keyType._zod.run({
|
|
2575
2529
|
value: Number(key),
|
|
2576
2530
|
issues: []
|
|
@@ -2599,9 +2553,9 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2599
2553
|
value: input[key],
|
|
2600
2554
|
issues: []
|
|
2601
2555
|
}, ctx);
|
|
2602
|
-
if (result instanceof Promise) proms.push(result.then((result
|
|
2603
|
-
if (result
|
|
2604
|
-
payload.value[outKey] = result
|
|
2556
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
2557
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2558
|
+
payload.value[outKey] = result.value;
|
|
2605
2559
|
}));
|
|
2606
2560
|
else {
|
|
2607
2561
|
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
@@ -2620,7 +2574,7 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2620
2574
|
return payload;
|
|
2621
2575
|
};
|
|
2622
2576
|
});
|
|
2623
|
-
const $ZodEnum =
|
|
2577
|
+
const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
|
|
2624
2578
|
$ZodType.init(inst, def);
|
|
2625
2579
|
const values = getEnumValues(def.entries);
|
|
2626
2580
|
const valuesSet = new Set(values);
|
|
@@ -2641,7 +2595,7 @@ const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
2641
2595
|
return payload;
|
|
2642
2596
|
};
|
|
2643
2597
|
});
|
|
2644
|
-
const $ZodLiteral =
|
|
2598
|
+
const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
|
|
2645
2599
|
$ZodType.init(inst, def);
|
|
2646
2600
|
const values = new Set(def.values);
|
|
2647
2601
|
inst._zod.values = values;
|
|
@@ -2661,20 +2615,17 @@ const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
2661
2615
|
return payload;
|
|
2662
2616
|
};
|
|
2663
2617
|
});
|
|
2664
|
-
const $ZodTransform =
|
|
2618
|
+
const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
|
|
2665
2619
|
$ZodType.init(inst, def);
|
|
2666
2620
|
inst._zod.optin = "optional";
|
|
2667
|
-
globalConfig.memoizer
|
|
2621
|
+
globalConfig.memoizer?.guard(inst);
|
|
2668
2622
|
inst._zod.parse = (payload, ctx) => {
|
|
2669
2623
|
if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
|
|
2670
2624
|
const _out = def.transform(payload.value, payload);
|
|
2671
|
-
if (ctx.async) {
|
|
2672
|
-
|
|
2673
|
-
return
|
|
2674
|
-
|
|
2675
|
-
return payload;
|
|
2676
|
-
});
|
|
2677
|
-
}
|
|
2625
|
+
if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
|
|
2626
|
+
payload.value = output;
|
|
2627
|
+
return payload;
|
|
2628
|
+
});
|
|
2678
2629
|
if (_out instanceof Promise) throw new $ZodAsyncError();
|
|
2679
2630
|
payload.value = _out;
|
|
2680
2631
|
return payload;
|
|
@@ -2684,13 +2635,13 @@ function handleOptionalResult(payload, result) {
|
|
|
2684
2635
|
payload.value = result.issues.length ? void 0 : result.value;
|
|
2685
2636
|
return payload;
|
|
2686
2637
|
}
|
|
2687
|
-
const $ZodOptional =
|
|
2638
|
+
const $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => {
|
|
2688
2639
|
$ZodType.init(inst, def);
|
|
2689
2640
|
defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
|
|
2690
2641
|
inst._zod.optout = "optional";
|
|
2691
2642
|
defineLazyInternal(inst, "values", (zod) => {
|
|
2692
2643
|
const values = zod.def.innerType._zod.values;
|
|
2693
|
-
return values ? new Set([...values, void 0]) : void 0;
|
|
2644
|
+
return values ? /* @__PURE__ */ new Set([...values, void 0]) : void 0;
|
|
2694
2645
|
});
|
|
2695
2646
|
defineLazyInternal(inst, "pattern", (zod) => {
|
|
2696
2647
|
const pattern = zod.def.innerType._zod.pattern;
|
|
@@ -2703,13 +2654,13 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
|
|
|
2703
2654
|
value: payload.value,
|
|
2704
2655
|
issues: []
|
|
2705
2656
|
}, ctx);
|
|
2706
|
-
if (result instanceof Promise) return result.then((result
|
|
2657
|
+
if (result instanceof Promise) return result.then((result) => handleOptionalResult(payload, result));
|
|
2707
2658
|
return handleOptionalResult(payload, result);
|
|
2708
2659
|
}
|
|
2709
2660
|
return def.innerType._zod.run(payload, ctx);
|
|
2710
2661
|
};
|
|
2711
2662
|
});
|
|
2712
|
-
const $ZodExactOptional =
|
|
2663
|
+
const $ZodExactOptional = /*@__PURE__*/ $constructor("$ZodExactOptional", (inst, def) => {
|
|
2713
2664
|
$ZodOptional.init(inst, def);
|
|
2714
2665
|
defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
2715
2666
|
defineLazyInternal(inst, "pattern", (zod) => zod.def.innerType._zod.pattern);
|
|
@@ -2717,7 +2668,7 @@ const $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (ins
|
|
|
2717
2668
|
return def.innerType._zod.run(payload, ctx);
|
|
2718
2669
|
};
|
|
2719
2670
|
});
|
|
2720
|
-
const $ZodNullable =
|
|
2671
|
+
const $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => {
|
|
2721
2672
|
$ZodType.init(inst, def);
|
|
2722
2673
|
defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
|
|
2723
2674
|
defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
|
|
@@ -2726,14 +2677,14 @@ const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) =>
|
|
|
2726
2677
|
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
|
|
2727
2678
|
});
|
|
2728
2679
|
defineLazyInternal(inst, "values", (zod) => {
|
|
2729
|
-
return zod.def.innerType._zod.values ? new Set([...zod.def.innerType._zod.values, null]) : void 0;
|
|
2680
|
+
return zod.def.innerType._zod.values ? /* @__PURE__ */ new Set([...zod.def.innerType._zod.values, null]) : void 0;
|
|
2730
2681
|
});
|
|
2731
2682
|
inst._zod.parse = (payload, ctx) => {
|
|
2732
2683
|
if (payload.value === null) return payload;
|
|
2733
2684
|
return def.innerType._zod.run(payload, ctx);
|
|
2734
2685
|
};
|
|
2735
2686
|
});
|
|
2736
|
-
const $ZodDefault =
|
|
2687
|
+
const $ZodDefault = /*@__PURE__*/ $constructor("$ZodDefault", (inst, def) => {
|
|
2737
2688
|
$ZodType.init(inst, def);
|
|
2738
2689
|
inst._zod.optin = "defaulted";
|
|
2739
2690
|
defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
@@ -2747,7 +2698,7 @@ const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
|
|
|
2747
2698
|
return payload;
|
|
2748
2699
|
}
|
|
2749
2700
|
const result = def.innerType._zod.run(payload, ctx);
|
|
2750
|
-
if (result instanceof Promise) return result.then((result
|
|
2701
|
+
if (result instanceof Promise) return result.then((result) => handleDefaultResult(result, def));
|
|
2751
2702
|
return handleDefaultResult(result, def);
|
|
2752
2703
|
};
|
|
2753
2704
|
});
|
|
@@ -2755,7 +2706,7 @@ function handleDefaultResult(payload, def) {
|
|
|
2755
2706
|
if (payload.value === void 0) payload.value = def.defaultValue;
|
|
2756
2707
|
return payload;
|
|
2757
2708
|
}
|
|
2758
|
-
const $ZodPrefault =
|
|
2709
|
+
const $ZodPrefault = /*@__PURE__*/ $constructor("$ZodPrefault", (inst, def) => {
|
|
2759
2710
|
$ZodType.init(inst, def);
|
|
2760
2711
|
inst._zod.optin = "defaulted";
|
|
2761
2712
|
defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
@@ -2765,7 +2716,7 @@ const $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) =>
|
|
|
2765
2716
|
return def.innerType._zod.run(payload, ctx);
|
|
2766
2717
|
};
|
|
2767
2718
|
});
|
|
2768
|
-
const $ZodNonOptional =
|
|
2719
|
+
const $ZodNonOptional = /*@__PURE__*/ $constructor("$ZodNonOptional", (inst, def) => {
|
|
2769
2720
|
$ZodType.init(inst, def);
|
|
2770
2721
|
defineLazyInternal(inst, "values", (zod) => {
|
|
2771
2722
|
const v = zod.def.innerType._zod.values;
|
|
@@ -2773,7 +2724,7 @@ const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, d
|
|
|
2773
2724
|
});
|
|
2774
2725
|
inst._zod.parse = (payload, ctx) => {
|
|
2775
2726
|
const result = def.innerType._zod.run(payload, ctx);
|
|
2776
|
-
if (result instanceof Promise) return result.then((result
|
|
2727
|
+
if (result instanceof Promise) return result.then((result) => handleNonOptionalResult(result, inst));
|
|
2777
2728
|
return handleNonOptionalResult(result, inst);
|
|
2778
2729
|
};
|
|
2779
2730
|
});
|
|
@@ -2800,7 +2751,7 @@ function handleCatchResult(payload, result, def, ctx) {
|
|
|
2800
2751
|
});
|
|
2801
2752
|
return payload;
|
|
2802
2753
|
}
|
|
2803
|
-
const $ZodCatch =
|
|
2754
|
+
const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
|
|
2804
2755
|
$ZodType.init(inst, def);
|
|
2805
2756
|
defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
|
|
2806
2757
|
defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
|
|
@@ -2811,11 +2762,11 @@ const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
|
|
|
2811
2762
|
value: payload.value,
|
|
2812
2763
|
issues: []
|
|
2813
2764
|
}, ctx);
|
|
2814
|
-
if (result instanceof Promise) return result.then((result
|
|
2765
|
+
if (result instanceof Promise) return result.then((result) => handleCatchResult(payload, result, def, ctx));
|
|
2815
2766
|
return handleCatchResult(payload, result, def, ctx);
|
|
2816
2767
|
};
|
|
2817
2768
|
});
|
|
2818
|
-
const $ZodPipe =
|
|
2769
|
+
const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
|
|
2819
2770
|
$ZodType.init(inst, def);
|
|
2820
2771
|
defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
|
|
2821
2772
|
defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
|
|
@@ -2824,11 +2775,11 @@ const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
|
|
|
2824
2775
|
inst._zod.parse = (payload, ctx) => {
|
|
2825
2776
|
if (ctx.direction === "backward") {
|
|
2826
2777
|
const right = def.out._zod.run(payload, ctx);
|
|
2827
|
-
if (right instanceof Promise) return right.then((right
|
|
2778
|
+
if (right instanceof Promise) return right.then((right) => handlePipeResult(right, def.in, ctx));
|
|
2828
2779
|
return handlePipeResult(right, def.in, ctx);
|
|
2829
2780
|
}
|
|
2830
2781
|
const left = def.in._zod.run(payload, ctx);
|
|
2831
|
-
if (left instanceof Promise) return left.then((left
|
|
2782
|
+
if (left instanceof Promise) return left.then((left) => handlePipeResult(left, def.out, ctx));
|
|
2832
2783
|
return handlePipeResult(left, def.out, ctx);
|
|
2833
2784
|
};
|
|
2834
2785
|
});
|
|
@@ -2842,7 +2793,7 @@ function handlePipeResult(left, next, ctx) {
|
|
|
2842
2793
|
issues: left.issues
|
|
2843
2794
|
}, ctx);
|
|
2844
2795
|
}
|
|
2845
|
-
const $ZodReadonly =
|
|
2796
|
+
const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
|
|
2846
2797
|
$ZodType.init(inst, def);
|
|
2847
2798
|
defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
|
|
2848
2799
|
defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
@@ -2859,7 +2810,7 @@ function handleReadonlyResult(payload) {
|
|
|
2859
2810
|
if (!payload.memo) payload.value = Object.freeze(payload.value);
|
|
2860
2811
|
return payload;
|
|
2861
2812
|
}
|
|
2862
|
-
const $ZodCustom =
|
|
2813
|
+
const $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => {
|
|
2863
2814
|
$ZodCheck.init(inst, def);
|
|
2864
2815
|
$ZodType.init(inst, def);
|
|
2865
2816
|
inst._zod.parse = (payload, _) => {
|
|
@@ -2868,9 +2819,8 @@ const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
|
2868
2819
|
inst._zod.check = (payload) => {
|
|
2869
2820
|
const input = payload.value;
|
|
2870
2821
|
const r = def.fn(input);
|
|
2871
|
-
if (r instanceof Promise) return r.then((r
|
|
2822
|
+
if (r instanceof Promise) return r.then((r) => handleRefineResult(r, payload, input, inst));
|
|
2872
2823
|
handleRefineResult(r, payload, input, inst);
|
|
2873
|
-
return;
|
|
2874
2824
|
};
|
|
2875
2825
|
});
|
|
2876
2826
|
function handleRefineResult(result, payload, input, inst) {
|
|
@@ -2886,7 +2836,6 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
2886
2836
|
payload.issues.push(issue(_iss));
|
|
2887
2837
|
}
|
|
2888
2838
|
}
|
|
2889
|
-
|
|
2890
2839
|
//#endregion
|
|
2891
2840
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.js
|
|
2892
2841
|
var $ZodCyclicError = class extends Error {
|
|
@@ -2907,21 +2856,21 @@ function cloneIssues(issues) {
|
|
|
2907
2856
|
path: iss.path.slice()
|
|
2908
2857
|
} : { ...iss });
|
|
2909
2858
|
}
|
|
2910
|
-
const recursive =
|
|
2859
|
+
const recursive = /*@__PURE__*/ new WeakMap();
|
|
2911
2860
|
/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */
|
|
2912
2861
|
const NONE = 0;
|
|
2913
2862
|
const ASSUMED = 1;
|
|
2914
2863
|
const PROVEN = 2;
|
|
2915
2864
|
/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */
|
|
2916
|
-
function isRecursive(inst, stack, resolve
|
|
2917
|
-
const cached
|
|
2918
|
-
if (cached
|
|
2865
|
+
function isRecursive(inst, stack, resolve) {
|
|
2866
|
+
const cached = recursive.get(inst);
|
|
2867
|
+
if (cached !== void 0) return cached ? PROVEN : NONE;
|
|
2919
2868
|
if (stack.has(inst)) return PROVEN;
|
|
2920
2869
|
stack.add(inst);
|
|
2921
2870
|
let result = NONE;
|
|
2922
2871
|
const check = (child) => {
|
|
2923
2872
|
if (result !== PROVEN && child?._zod) {
|
|
2924
|
-
const answer = isRecursive(child, stack, resolve
|
|
2873
|
+
const answer = isRecursive(child, stack, resolve);
|
|
2925
2874
|
if (answer > result) result = answer;
|
|
2926
2875
|
}
|
|
2927
2876
|
};
|
|
@@ -2930,20 +2879,19 @@ function isRecursive(inst, stack, resolve$1) {
|
|
|
2930
2879
|
for (const key of Reflect.ownKeys(sh)) {
|
|
2931
2880
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
2932
2881
|
if (spread && !desc.enumerable) continue;
|
|
2933
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve
|
|
2882
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
2934
2883
|
if (child > answer) answer = child;
|
|
2935
2884
|
}
|
|
2936
2885
|
return answer;
|
|
2937
2886
|
};
|
|
2938
|
-
const merge
|
|
2887
|
+
const merge = (answer) => {
|
|
2939
2888
|
if (answer > result) result = answer;
|
|
2940
2889
|
};
|
|
2941
2890
|
const def = inst._zod.def;
|
|
2942
|
-
|
|
2943
|
-
switch (kind) {
|
|
2891
|
+
switch (def.type) {
|
|
2944
2892
|
case "object": {
|
|
2945
2893
|
const raw = rawShape(def);
|
|
2946
|
-
merge
|
|
2894
|
+
merge(raw ? shape(raw, true) : ASSUMED);
|
|
2947
2895
|
check(def.catchall);
|
|
2948
2896
|
break;
|
|
2949
2897
|
}
|
|
@@ -2989,8 +2937,8 @@ function isRecursive(inst, stack, resolve$1) {
|
|
|
2989
2937
|
check(def.output);
|
|
2990
2938
|
break;
|
|
2991
2939
|
case "lazy": {
|
|
2992
|
-
const inner = def._cachedInner ?? (resolve
|
|
2993
|
-
merge
|
|
2940
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : void 0);
|
|
2941
|
+
merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
2994
2942
|
break;
|
|
2995
2943
|
}
|
|
2996
2944
|
case "template_literal":
|
|
@@ -3054,8 +3002,8 @@ const memo = {
|
|
|
3054
3002
|
return empty;
|
|
3055
3003
|
},
|
|
3056
3004
|
guard(inst) {
|
|
3057
|
-
var _a
|
|
3058
|
-
(_a
|
|
3005
|
+
var _a;
|
|
3006
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
3059
3007
|
inst._zod.deferred.push(() => {
|
|
3060
3008
|
const base = inst._zod.parse;
|
|
3061
3009
|
const wrapped = (payload, ctx) => {
|
|
@@ -3067,12 +3015,12 @@ const memo = {
|
|
|
3067
3015
|
});
|
|
3068
3016
|
},
|
|
3069
3017
|
attach(inst) {
|
|
3070
|
-
var _a
|
|
3018
|
+
var _a;
|
|
3071
3019
|
let isRecursiveInst;
|
|
3072
3020
|
let rechecked = false;
|
|
3073
3021
|
let lastCtx;
|
|
3074
3022
|
let lastBucket;
|
|
3075
|
-
(_a
|
|
3023
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
3076
3024
|
inst._zod.deferred.push(() => {
|
|
3077
3025
|
const base = inst._zod.parse;
|
|
3078
3026
|
const wrapped = (payload, ctx) => {
|
|
@@ -3141,7 +3089,6 @@ function isBackEdge(ctx, value) {
|
|
|
3141
3089
|
const backEdges = ctx[STATE]?.backEdges;
|
|
3142
3090
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3143
3091
|
}
|
|
3144
|
-
|
|
3145
3092
|
//#endregion
|
|
3146
3093
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.js
|
|
3147
3094
|
const error = () => {
|
|
@@ -3209,48 +3156,40 @@ const error = () => {
|
|
|
3209
3156
|
if (type === "number" && typeof input === "number" && !Number.isFinite(input)) return String(input);
|
|
3210
3157
|
return TypeDictionary[type] ?? type;
|
|
3211
3158
|
}
|
|
3212
|
-
return (issue
|
|
3213
|
-
switch (issue
|
|
3214
|
-
case "invalid_type": {
|
|
3215
|
-
const expected = getTypeName(issue$1.expected);
|
|
3216
|
-
const receivedType = parsedType(issue$1.input);
|
|
3217
|
-
const received = getTypeName(receivedType, issue$1.input);
|
|
3218
|
-
return `Invalid input: expected ${expected}, received ${received}`;
|
|
3219
|
-
}
|
|
3159
|
+
return (issue) => {
|
|
3160
|
+
switch (issue.code) {
|
|
3161
|
+
case "invalid_type": return `Invalid input: expected ${getTypeName(issue.expected)}, received ${getTypeName(parsedType(issue.input), issue.input)}`;
|
|
3220
3162
|
case "invalid_value":
|
|
3221
|
-
if (issue
|
|
3222
|
-
return `Invalid option: expected one of ${joinValues(issue
|
|
3163
|
+
if (issue.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue.values[0])}`;
|
|
3164
|
+
return `Invalid option: expected one of ${joinValues(issue.values, "|")}`;
|
|
3223
3165
|
case "too_big": {
|
|
3224
|
-
const adj = issue
|
|
3225
|
-
const sizing = getSizing(issue
|
|
3226
|
-
if (sizing) return `Too big: expected ${issue
|
|
3227
|
-
return `Too big: expected ${issue
|
|
3166
|
+
const adj = issue.exact ? "exactly " : issue.inclusive ? "<=" : "<";
|
|
3167
|
+
const sizing = getSizing(issue.origin);
|
|
3168
|
+
if (sizing) return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
|
|
3169
|
+
return `Too big: expected ${issue.origin ?? "value"} to be ${adj}${issue.maximum.toString()}`;
|
|
3228
3170
|
}
|
|
3229
3171
|
case "too_small": {
|
|
3230
|
-
const adj = issue
|
|
3231
|
-
const sizing = getSizing(issue
|
|
3232
|
-
if (sizing) return `Too small: expected ${issue
|
|
3233
|
-
return `Too small: expected ${issue
|
|
3172
|
+
const adj = issue.exact ? "exactly " : issue.inclusive ? ">=" : ">";
|
|
3173
|
+
const sizing = getSizing(issue.origin);
|
|
3174
|
+
if (sizing) return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
|
3175
|
+
return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
|
|
3234
3176
|
}
|
|
3235
3177
|
case "invalid_format": {
|
|
3236
|
-
const _issue = issue
|
|
3178
|
+
const _issue = issue;
|
|
3237
3179
|
if (_issue.format === "starts_with") return `Invalid string: must start with "${_issue.prefix}"`;
|
|
3238
3180
|
if (_issue.format === "ends_with") return `Invalid string: must end with "${_issue.suffix}"`;
|
|
3239
3181
|
if (_issue.format === "includes") return `Invalid string: must include "${_issue.includes}"`;
|
|
3240
3182
|
if (_issue.format === "regex") return `Invalid string: must match pattern ${_issue.pattern}`;
|
|
3241
|
-
return `Invalid ${FormatDictionary[_issue.format] ?? issue
|
|
3183
|
+
return `Invalid ${FormatDictionary[_issue.format] ?? issue.format}`;
|
|
3242
3184
|
}
|
|
3243
|
-
case "not_multiple_of": return `Invalid number: must be a multiple of ${issue
|
|
3244
|
-
case "unrecognized_keys": return `Unrecognized key${issue
|
|
3245
|
-
case "invalid_key": return `Invalid key in ${issue
|
|
3185
|
+
case "not_multiple_of": return `Invalid number: must be a multiple of ${issue.divisor}`;
|
|
3186
|
+
case "unrecognized_keys": return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
|
|
3187
|
+
case "invalid_key": return `Invalid key in ${issue.origin}`;
|
|
3246
3188
|
case "invalid_union":
|
|
3247
|
-
if (issue
|
|
3248
|
-
|
|
3249
|
-
return `Invalid discriminator value. Expected ${opts}`;
|
|
3250
|
-
}
|
|
3251
|
-
if (issue$1.inclusive === false) return "Invalid input: more than one option matched";
|
|
3189
|
+
if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) return `Invalid discriminator value. Expected ${issue.options.map((o) => `'${o}'`).join(" | ")}`;
|
|
3190
|
+
if (issue.inclusive === false) return "Invalid input: more than one option matched";
|
|
3252
3191
|
return "Invalid input";
|
|
3253
|
-
case "invalid_element": return `Invalid value in ${issue
|
|
3192
|
+
case "invalid_element": return `Invalid value in ${issue.origin}`;
|
|
3254
3193
|
default: return `Invalid input`;
|
|
3255
3194
|
}
|
|
3256
3195
|
};
|
|
@@ -3258,7 +3197,6 @@ const error = () => {
|
|
|
3258
3197
|
function en_default() {
|
|
3259
3198
|
return { localeError: error() };
|
|
3260
3199
|
}
|
|
3261
|
-
|
|
3262
3200
|
//#endregion
|
|
3263
3201
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.js
|
|
3264
3202
|
var _a;
|
|
@@ -3268,9 +3206,9 @@ var $ZodRegistry = class {
|
|
|
3268
3206
|
this._idmap = /* @__PURE__ */ new Map();
|
|
3269
3207
|
}
|
|
3270
3208
|
add(schema, ..._meta) {
|
|
3271
|
-
const meta
|
|
3272
|
-
this._map.set(schema, meta
|
|
3273
|
-
if (meta
|
|
3209
|
+
const meta = _meta[0];
|
|
3210
|
+
this._map.set(schema, meta);
|
|
3211
|
+
if (meta && typeof meta === "object" && "id" in meta) this._idmap.set(meta.id, schema);
|
|
3274
3212
|
return this;
|
|
3275
3213
|
}
|
|
3276
3214
|
clear() {
|
|
@@ -3279,8 +3217,8 @@ var $ZodRegistry = class {
|
|
|
3279
3217
|
return this;
|
|
3280
3218
|
}
|
|
3281
3219
|
remove(schema) {
|
|
3282
|
-
const meta
|
|
3283
|
-
if (meta
|
|
3220
|
+
const meta = this._map.get(schema);
|
|
3221
|
+
if (meta && typeof meta === "object" && "id" in meta) this._idmap.delete(meta.id);
|
|
3284
3222
|
this._map.delete(schema);
|
|
3285
3223
|
return this;
|
|
3286
3224
|
}
|
|
@@ -3306,21 +3244,20 @@ function registry() {
|
|
|
3306
3244
|
}
|
|
3307
3245
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
3308
3246
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
3309
|
-
|
|
3310
3247
|
//#endregion
|
|
3311
3248
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.js
|
|
3312
3249
|
function snapshotChecks(def) {
|
|
3313
3250
|
if (def.checks) def.checks = [...def.checks];
|
|
3314
3251
|
return def;
|
|
3315
3252
|
}
|
|
3316
|
-
|
|
3253
|
+
// @__NO_SIDE_EFFECTS__
|
|
3317
3254
|
function _string(Class, params) {
|
|
3318
3255
|
return new Class(snapshotChecks({
|
|
3319
3256
|
type: "string",
|
|
3320
3257
|
...normalizeParams(params)
|
|
3321
3258
|
}));
|
|
3322
3259
|
}
|
|
3323
|
-
|
|
3260
|
+
// @__NO_SIDE_EFFECTS__
|
|
3324
3261
|
function _email(Class, params) {
|
|
3325
3262
|
return new Class({
|
|
3326
3263
|
type: "string",
|
|
@@ -3330,7 +3267,7 @@ function _email(Class, params) {
|
|
|
3330
3267
|
...normalizeParams(params)
|
|
3331
3268
|
});
|
|
3332
3269
|
}
|
|
3333
|
-
|
|
3270
|
+
// @__NO_SIDE_EFFECTS__
|
|
3334
3271
|
function _guid(Class, params) {
|
|
3335
3272
|
return new Class({
|
|
3336
3273
|
type: "string",
|
|
@@ -3340,7 +3277,7 @@ function _guid(Class, params) {
|
|
|
3340
3277
|
...normalizeParams(params)
|
|
3341
3278
|
});
|
|
3342
3279
|
}
|
|
3343
|
-
|
|
3280
|
+
// @__NO_SIDE_EFFECTS__
|
|
3344
3281
|
function _uuid(Class, params) {
|
|
3345
3282
|
return new Class({
|
|
3346
3283
|
type: "string",
|
|
@@ -3350,7 +3287,7 @@ function _uuid(Class, params) {
|
|
|
3350
3287
|
...normalizeParams(params)
|
|
3351
3288
|
});
|
|
3352
3289
|
}
|
|
3353
|
-
|
|
3290
|
+
// @__NO_SIDE_EFFECTS__
|
|
3354
3291
|
function _uuidv4(Class, params) {
|
|
3355
3292
|
return new Class({
|
|
3356
3293
|
type: "string",
|
|
@@ -3361,7 +3298,7 @@ function _uuidv4(Class, params) {
|
|
|
3361
3298
|
...normalizeParams(params)
|
|
3362
3299
|
});
|
|
3363
3300
|
}
|
|
3364
|
-
|
|
3301
|
+
// @__NO_SIDE_EFFECTS__
|
|
3365
3302
|
function _uuidv6(Class, params) {
|
|
3366
3303
|
return new Class({
|
|
3367
3304
|
type: "string",
|
|
@@ -3372,7 +3309,7 @@ function _uuidv6(Class, params) {
|
|
|
3372
3309
|
...normalizeParams(params)
|
|
3373
3310
|
});
|
|
3374
3311
|
}
|
|
3375
|
-
|
|
3312
|
+
// @__NO_SIDE_EFFECTS__
|
|
3376
3313
|
function _uuidv7(Class, params) {
|
|
3377
3314
|
return new Class({
|
|
3378
3315
|
type: "string",
|
|
@@ -3383,7 +3320,7 @@ function _uuidv7(Class, params) {
|
|
|
3383
3320
|
...normalizeParams(params)
|
|
3384
3321
|
});
|
|
3385
3322
|
}
|
|
3386
|
-
|
|
3323
|
+
// @__NO_SIDE_EFFECTS__
|
|
3387
3324
|
function _url(Class, params) {
|
|
3388
3325
|
return new Class({
|
|
3389
3326
|
type: "string",
|
|
@@ -3393,7 +3330,7 @@ function _url(Class, params) {
|
|
|
3393
3330
|
...normalizeParams(params)
|
|
3394
3331
|
});
|
|
3395
3332
|
}
|
|
3396
|
-
|
|
3333
|
+
// @__NO_SIDE_EFFECTS__
|
|
3397
3334
|
function _emoji(Class, params) {
|
|
3398
3335
|
return new Class({
|
|
3399
3336
|
type: "string",
|
|
@@ -3403,7 +3340,7 @@ function _emoji(Class, params) {
|
|
|
3403
3340
|
...normalizeParams(params)
|
|
3404
3341
|
});
|
|
3405
3342
|
}
|
|
3406
|
-
|
|
3343
|
+
// @__NO_SIDE_EFFECTS__
|
|
3407
3344
|
function _nanoid(Class, params) {
|
|
3408
3345
|
return new Class({
|
|
3409
3346
|
type: "string",
|
|
@@ -3418,7 +3355,7 @@ function _nanoid(Class, params) {
|
|
|
3418
3355
|
* (timestamps embedded in the id). Use {@link _cuid2} instead.
|
|
3419
3356
|
* See https://github.com/paralleldrive/cuid.
|
|
3420
3357
|
*/
|
|
3421
|
-
|
|
3358
|
+
// @__NO_SIDE_EFFECTS__
|
|
3422
3359
|
function _cuid(Class, params) {
|
|
3423
3360
|
return new Class({
|
|
3424
3361
|
type: "string",
|
|
@@ -3428,7 +3365,7 @@ function _cuid(Class, params) {
|
|
|
3428
3365
|
...normalizeParams(params)
|
|
3429
3366
|
});
|
|
3430
3367
|
}
|
|
3431
|
-
|
|
3368
|
+
// @__NO_SIDE_EFFECTS__
|
|
3432
3369
|
function _cuid2(Class, params) {
|
|
3433
3370
|
return new Class({
|
|
3434
3371
|
type: "string",
|
|
@@ -3438,7 +3375,7 @@ function _cuid2(Class, params) {
|
|
|
3438
3375
|
...normalizeParams(params)
|
|
3439
3376
|
});
|
|
3440
3377
|
}
|
|
3441
|
-
|
|
3378
|
+
// @__NO_SIDE_EFFECTS__
|
|
3442
3379
|
function _ulid(Class, params) {
|
|
3443
3380
|
return new Class({
|
|
3444
3381
|
type: "string",
|
|
@@ -3448,7 +3385,7 @@ function _ulid(Class, params) {
|
|
|
3448
3385
|
...normalizeParams(params)
|
|
3449
3386
|
});
|
|
3450
3387
|
}
|
|
3451
|
-
|
|
3388
|
+
// @__NO_SIDE_EFFECTS__
|
|
3452
3389
|
function _xid(Class, params) {
|
|
3453
3390
|
return new Class({
|
|
3454
3391
|
type: "string",
|
|
@@ -3458,7 +3395,7 @@ function _xid(Class, params) {
|
|
|
3458
3395
|
...normalizeParams(params)
|
|
3459
3396
|
});
|
|
3460
3397
|
}
|
|
3461
|
-
|
|
3398
|
+
// @__NO_SIDE_EFFECTS__
|
|
3462
3399
|
function _ksuid(Class, params) {
|
|
3463
3400
|
return new Class({
|
|
3464
3401
|
type: "string",
|
|
@@ -3468,7 +3405,7 @@ function _ksuid(Class, params) {
|
|
|
3468
3405
|
...normalizeParams(params)
|
|
3469
3406
|
});
|
|
3470
3407
|
}
|
|
3471
|
-
|
|
3408
|
+
// @__NO_SIDE_EFFECTS__
|
|
3472
3409
|
function _ipv4(Class, params) {
|
|
3473
3410
|
return new Class({
|
|
3474
3411
|
type: "string",
|
|
@@ -3478,7 +3415,7 @@ function _ipv4(Class, params) {
|
|
|
3478
3415
|
...normalizeParams(params)
|
|
3479
3416
|
});
|
|
3480
3417
|
}
|
|
3481
|
-
|
|
3418
|
+
// @__NO_SIDE_EFFECTS__
|
|
3482
3419
|
function _ipv6(Class, params) {
|
|
3483
3420
|
return new Class({
|
|
3484
3421
|
type: "string",
|
|
@@ -3488,7 +3425,7 @@ function _ipv6(Class, params) {
|
|
|
3488
3425
|
...normalizeParams(params)
|
|
3489
3426
|
});
|
|
3490
3427
|
}
|
|
3491
|
-
|
|
3428
|
+
// @__NO_SIDE_EFFECTS__
|
|
3492
3429
|
function _cidrv4(Class, params) {
|
|
3493
3430
|
return new Class({
|
|
3494
3431
|
type: "string",
|
|
@@ -3498,7 +3435,7 @@ function _cidrv4(Class, params) {
|
|
|
3498
3435
|
...normalizeParams(params)
|
|
3499
3436
|
});
|
|
3500
3437
|
}
|
|
3501
|
-
|
|
3438
|
+
// @__NO_SIDE_EFFECTS__
|
|
3502
3439
|
function _cidrv6(Class, params) {
|
|
3503
3440
|
return new Class({
|
|
3504
3441
|
type: "string",
|
|
@@ -3508,7 +3445,7 @@ function _cidrv6(Class, params) {
|
|
|
3508
3445
|
...normalizeParams(params)
|
|
3509
3446
|
});
|
|
3510
3447
|
}
|
|
3511
|
-
|
|
3448
|
+
// @__NO_SIDE_EFFECTS__
|
|
3512
3449
|
function _base64(Class, params) {
|
|
3513
3450
|
return new Class({
|
|
3514
3451
|
type: "string",
|
|
@@ -3518,7 +3455,7 @@ function _base64(Class, params) {
|
|
|
3518
3455
|
...normalizeParams(params)
|
|
3519
3456
|
});
|
|
3520
3457
|
}
|
|
3521
|
-
|
|
3458
|
+
// @__NO_SIDE_EFFECTS__
|
|
3522
3459
|
function _base64url(Class, params) {
|
|
3523
3460
|
return new Class({
|
|
3524
3461
|
type: "string",
|
|
@@ -3528,7 +3465,7 @@ function _base64url(Class, params) {
|
|
|
3528
3465
|
...normalizeParams(params)
|
|
3529
3466
|
});
|
|
3530
3467
|
}
|
|
3531
|
-
|
|
3468
|
+
// @__NO_SIDE_EFFECTS__
|
|
3532
3469
|
function _e164(Class, params) {
|
|
3533
3470
|
return new Class({
|
|
3534
3471
|
type: "string",
|
|
@@ -3538,7 +3475,7 @@ function _e164(Class, params) {
|
|
|
3538
3475
|
...normalizeParams(params)
|
|
3539
3476
|
});
|
|
3540
3477
|
}
|
|
3541
|
-
|
|
3478
|
+
// @__NO_SIDE_EFFECTS__
|
|
3542
3479
|
function _jwt(Class, params) {
|
|
3543
3480
|
return new Class({
|
|
3544
3481
|
type: "string",
|
|
@@ -3548,7 +3485,7 @@ function _jwt(Class, params) {
|
|
|
3548
3485
|
...normalizeParams(params)
|
|
3549
3486
|
});
|
|
3550
3487
|
}
|
|
3551
|
-
|
|
3488
|
+
// @__NO_SIDE_EFFECTS__
|
|
3552
3489
|
function _isoDateTime(Class, params) {
|
|
3553
3490
|
return new Class({
|
|
3554
3491
|
type: "string",
|
|
@@ -3560,7 +3497,7 @@ function _isoDateTime(Class, params) {
|
|
|
3560
3497
|
...normalizeParams(params)
|
|
3561
3498
|
});
|
|
3562
3499
|
}
|
|
3563
|
-
|
|
3500
|
+
// @__NO_SIDE_EFFECTS__
|
|
3564
3501
|
function _isoDate(Class, params) {
|
|
3565
3502
|
return new Class({
|
|
3566
3503
|
type: "string",
|
|
@@ -3569,7 +3506,7 @@ function _isoDate(Class, params) {
|
|
|
3569
3506
|
...normalizeParams(params)
|
|
3570
3507
|
});
|
|
3571
3508
|
}
|
|
3572
|
-
|
|
3509
|
+
// @__NO_SIDE_EFFECTS__
|
|
3573
3510
|
function _isoTime(Class, params) {
|
|
3574
3511
|
return new Class({
|
|
3575
3512
|
type: "string",
|
|
@@ -3579,7 +3516,7 @@ function _isoTime(Class, params) {
|
|
|
3579
3516
|
...normalizeParams(params)
|
|
3580
3517
|
});
|
|
3581
3518
|
}
|
|
3582
|
-
|
|
3519
|
+
// @__NO_SIDE_EFFECTS__
|
|
3583
3520
|
function _isoDuration(Class, params) {
|
|
3584
3521
|
return new Class({
|
|
3585
3522
|
type: "string",
|
|
@@ -3588,7 +3525,7 @@ function _isoDuration(Class, params) {
|
|
|
3588
3525
|
...normalizeParams(params)
|
|
3589
3526
|
});
|
|
3590
3527
|
}
|
|
3591
|
-
|
|
3528
|
+
// @__NO_SIDE_EFFECTS__
|
|
3592
3529
|
function _number(Class, params) {
|
|
3593
3530
|
return new Class(snapshotChecks({
|
|
3594
3531
|
type: "number",
|
|
@@ -3596,7 +3533,7 @@ function _number(Class, params) {
|
|
|
3596
3533
|
...normalizeParams(params)
|
|
3597
3534
|
}));
|
|
3598
3535
|
}
|
|
3599
|
-
|
|
3536
|
+
// @__NO_SIDE_EFFECTS__
|
|
3600
3537
|
function _int(Class, params) {
|
|
3601
3538
|
return new Class({
|
|
3602
3539
|
type: "number",
|
|
@@ -3606,25 +3543,25 @@ function _int(Class, params) {
|
|
|
3606
3543
|
...normalizeParams(params)
|
|
3607
3544
|
});
|
|
3608
3545
|
}
|
|
3609
|
-
|
|
3546
|
+
// @__NO_SIDE_EFFECTS__
|
|
3610
3547
|
function _boolean(Class, params) {
|
|
3611
3548
|
return new Class({
|
|
3612
3549
|
type: "boolean",
|
|
3613
3550
|
...normalizeParams(params)
|
|
3614
3551
|
});
|
|
3615
3552
|
}
|
|
3616
|
-
|
|
3553
|
+
// @__NO_SIDE_EFFECTS__
|
|
3617
3554
|
function _unknown(Class) {
|
|
3618
3555
|
return new Class({ type: "unknown" });
|
|
3619
3556
|
}
|
|
3620
|
-
|
|
3557
|
+
// @__NO_SIDE_EFFECTS__
|
|
3621
3558
|
function _never(Class, params) {
|
|
3622
3559
|
return new Class({
|
|
3623
3560
|
type: "never",
|
|
3624
3561
|
...normalizeParams(params)
|
|
3625
3562
|
});
|
|
3626
3563
|
}
|
|
3627
|
-
|
|
3564
|
+
// @__NO_SIDE_EFFECTS__
|
|
3628
3565
|
function _lt(value, params) {
|
|
3629
3566
|
return new $ZodCheckLessThan({
|
|
3630
3567
|
check: "less_than",
|
|
@@ -3633,7 +3570,7 @@ function _lt(value, params) {
|
|
|
3633
3570
|
inclusive: false
|
|
3634
3571
|
});
|
|
3635
3572
|
}
|
|
3636
|
-
|
|
3573
|
+
// @__NO_SIDE_EFFECTS__
|
|
3637
3574
|
function _lte(value, params) {
|
|
3638
3575
|
return new $ZodCheckLessThan({
|
|
3639
3576
|
check: "less_than",
|
|
@@ -3642,7 +3579,7 @@ function _lte(value, params) {
|
|
|
3642
3579
|
inclusive: true
|
|
3643
3580
|
});
|
|
3644
3581
|
}
|
|
3645
|
-
|
|
3582
|
+
// @__NO_SIDE_EFFECTS__
|
|
3646
3583
|
function _gt(value, params) {
|
|
3647
3584
|
return new $ZodCheckGreaterThan({
|
|
3648
3585
|
check: "greater_than",
|
|
@@ -3651,7 +3588,7 @@ function _gt(value, params) {
|
|
|
3651
3588
|
inclusive: false
|
|
3652
3589
|
});
|
|
3653
3590
|
}
|
|
3654
|
-
|
|
3591
|
+
// @__NO_SIDE_EFFECTS__
|
|
3655
3592
|
function _gte(value, params) {
|
|
3656
3593
|
return new $ZodCheckGreaterThan({
|
|
3657
3594
|
check: "greater_than",
|
|
@@ -3660,7 +3597,7 @@ function _gte(value, params) {
|
|
|
3660
3597
|
inclusive: true
|
|
3661
3598
|
});
|
|
3662
3599
|
}
|
|
3663
|
-
|
|
3600
|
+
// @__NO_SIDE_EFFECTS__
|
|
3664
3601
|
function _multipleOf(value, params) {
|
|
3665
3602
|
return new $ZodCheckMultipleOf({
|
|
3666
3603
|
check: "multiple_of",
|
|
@@ -3668,16 +3605,15 @@ function _multipleOf(value, params) {
|
|
|
3668
3605
|
value
|
|
3669
3606
|
});
|
|
3670
3607
|
}
|
|
3671
|
-
|
|
3608
|
+
// @__NO_SIDE_EFFECTS__
|
|
3672
3609
|
function _maxLength(maximum, params) {
|
|
3673
|
-
|
|
3610
|
+
return new $ZodCheckMaxLength({
|
|
3674
3611
|
check: "max_length",
|
|
3675
3612
|
...normalizeParams(params),
|
|
3676
3613
|
maximum
|
|
3677
3614
|
});
|
|
3678
|
-
return ch;
|
|
3679
3615
|
}
|
|
3680
|
-
|
|
3616
|
+
// @__NO_SIDE_EFFECTS__
|
|
3681
3617
|
function _minLength(minimum, params) {
|
|
3682
3618
|
return new $ZodCheckMinLength({
|
|
3683
3619
|
check: "min_length",
|
|
@@ -3685,7 +3621,7 @@ function _minLength(minimum, params) {
|
|
|
3685
3621
|
minimum
|
|
3686
3622
|
});
|
|
3687
3623
|
}
|
|
3688
|
-
|
|
3624
|
+
// @__NO_SIDE_EFFECTS__
|
|
3689
3625
|
function _length(length, params) {
|
|
3690
3626
|
return new $ZodCheckLengthEquals({
|
|
3691
3627
|
check: "length_equals",
|
|
@@ -3693,7 +3629,7 @@ function _length(length, params) {
|
|
|
3693
3629
|
length
|
|
3694
3630
|
});
|
|
3695
3631
|
}
|
|
3696
|
-
|
|
3632
|
+
// @__NO_SIDE_EFFECTS__
|
|
3697
3633
|
function _regex(pattern, params) {
|
|
3698
3634
|
return new $ZodCheckRegex({
|
|
3699
3635
|
check: "string_format",
|
|
@@ -3702,7 +3638,7 @@ function _regex(pattern, params) {
|
|
|
3702
3638
|
pattern
|
|
3703
3639
|
});
|
|
3704
3640
|
}
|
|
3705
|
-
|
|
3641
|
+
// @__NO_SIDE_EFFECTS__
|
|
3706
3642
|
function _lowercase(params) {
|
|
3707
3643
|
return new $ZodCheckLowerCase({
|
|
3708
3644
|
check: "string_format",
|
|
@@ -3710,7 +3646,7 @@ function _lowercase(params) {
|
|
|
3710
3646
|
...normalizeParams(params)
|
|
3711
3647
|
});
|
|
3712
3648
|
}
|
|
3713
|
-
|
|
3649
|
+
// @__NO_SIDE_EFFECTS__
|
|
3714
3650
|
function _uppercase(params) {
|
|
3715
3651
|
return new $ZodCheckUpperCase({
|
|
3716
3652
|
check: "string_format",
|
|
@@ -3718,7 +3654,7 @@ function _uppercase(params) {
|
|
|
3718
3654
|
...normalizeParams(params)
|
|
3719
3655
|
});
|
|
3720
3656
|
}
|
|
3721
|
-
|
|
3657
|
+
// @__NO_SIDE_EFFECTS__
|
|
3722
3658
|
function _includes(includes, params) {
|
|
3723
3659
|
return new $ZodCheckIncludes({
|
|
3724
3660
|
check: "string_format",
|
|
@@ -3727,7 +3663,7 @@ function _includes(includes, params) {
|
|
|
3727
3663
|
includes
|
|
3728
3664
|
});
|
|
3729
3665
|
}
|
|
3730
|
-
|
|
3666
|
+
// @__NO_SIDE_EFFECTS__
|
|
3731
3667
|
function _startsWith(prefix, params) {
|
|
3732
3668
|
return new $ZodCheckStartsWith({
|
|
3733
3669
|
check: "string_format",
|
|
@@ -3736,7 +3672,7 @@ function _startsWith(prefix, params) {
|
|
|
3736
3672
|
prefix
|
|
3737
3673
|
});
|
|
3738
3674
|
}
|
|
3739
|
-
|
|
3675
|
+
// @__NO_SIDE_EFFECTS__
|
|
3740
3676
|
function _endsWith(suffix, params) {
|
|
3741
3677
|
return new $ZodCheckEndsWith({
|
|
3742
3678
|
check: "string_format",
|
|
@@ -3745,34 +3681,34 @@ function _endsWith(suffix, params) {
|
|
|
3745
3681
|
suffix
|
|
3746
3682
|
});
|
|
3747
3683
|
}
|
|
3748
|
-
|
|
3684
|
+
// @__NO_SIDE_EFFECTS__
|
|
3749
3685
|
function _overwrite(tx) {
|
|
3750
3686
|
return new $ZodCheckOverwrite({
|
|
3751
3687
|
check: "overwrite",
|
|
3752
3688
|
tx
|
|
3753
3689
|
});
|
|
3754
3690
|
}
|
|
3755
|
-
|
|
3691
|
+
// @__NO_SIDE_EFFECTS__
|
|
3756
3692
|
function _normalize(form) {
|
|
3757
3693
|
return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
|
|
3758
3694
|
}
|
|
3759
|
-
|
|
3695
|
+
// @__NO_SIDE_EFFECTS__
|
|
3760
3696
|
function _trim() {
|
|
3761
3697
|
return /* @__PURE__ */ _overwrite((input) => input.trim());
|
|
3762
3698
|
}
|
|
3763
|
-
|
|
3699
|
+
// @__NO_SIDE_EFFECTS__
|
|
3764
3700
|
function _toLowerCase() {
|
|
3765
3701
|
return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
|
|
3766
3702
|
}
|
|
3767
|
-
|
|
3703
|
+
// @__NO_SIDE_EFFECTS__
|
|
3768
3704
|
function _toUpperCase() {
|
|
3769
3705
|
return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
|
|
3770
3706
|
}
|
|
3771
|
-
|
|
3707
|
+
// @__NO_SIDE_EFFECTS__
|
|
3772
3708
|
function _slugify() {
|
|
3773
3709
|
return /* @__PURE__ */ _overwrite((input) => slugify(input));
|
|
3774
3710
|
}
|
|
3775
|
-
|
|
3711
|
+
// @__NO_SIDE_EFFECTS__
|
|
3776
3712
|
function _array(Class, element, params) {
|
|
3777
3713
|
return new Class({
|
|
3778
3714
|
type: "array",
|
|
@@ -3780,35 +3716,33 @@ function _array(Class, element, params) {
|
|
|
3780
3716
|
...normalizeParams(params)
|
|
3781
3717
|
});
|
|
3782
3718
|
}
|
|
3783
|
-
|
|
3719
|
+
// @__NO_SIDE_EFFECTS__
|
|
3784
3720
|
function _custom(Class, fn, _params) {
|
|
3785
3721
|
const norm = normalizeParams(_params);
|
|
3786
3722
|
norm.abort ?? (norm.abort = true);
|
|
3787
|
-
|
|
3723
|
+
return new Class({
|
|
3788
3724
|
type: "custom",
|
|
3789
3725
|
check: "custom",
|
|
3790
3726
|
fn,
|
|
3791
3727
|
...norm
|
|
3792
3728
|
});
|
|
3793
|
-
return schema;
|
|
3794
3729
|
}
|
|
3795
|
-
|
|
3730
|
+
// @__NO_SIDE_EFFECTS__
|
|
3796
3731
|
function _refine(Class, fn, _params) {
|
|
3797
|
-
|
|
3732
|
+
return new Class({
|
|
3798
3733
|
type: "custom",
|
|
3799
3734
|
check: "custom",
|
|
3800
3735
|
fn,
|
|
3801
3736
|
...normalizeParams(_params)
|
|
3802
3737
|
});
|
|
3803
|
-
return schema;
|
|
3804
3738
|
}
|
|
3805
|
-
|
|
3739
|
+
// @__NO_SIDE_EFFECTS__
|
|
3806
3740
|
function _superRefine(fn, params) {
|
|
3807
3741
|
const ch = /* @__PURE__ */ _check((payload) => {
|
|
3808
|
-
payload.addIssue = (issue$
|
|
3809
|
-
if (typeof issue$
|
|
3742
|
+
payload.addIssue = (issue$2) => {
|
|
3743
|
+
if (typeof issue$2 === "string") payload.issues.push(issue(issue$2, payload.value, ch._zod.def));
|
|
3810
3744
|
else {
|
|
3811
|
-
const _issue = issue$
|
|
3745
|
+
const _issue = issue$2;
|
|
3812
3746
|
if (_issue.fatal) _issue.continue = false;
|
|
3813
3747
|
_issue.code ?? (_issue.code = "custom");
|
|
3814
3748
|
if (!("input" in _issue)) _issue.input = payload.value;
|
|
@@ -3821,7 +3755,7 @@ function _superRefine(fn, params) {
|
|
|
3821
3755
|
}, params);
|
|
3822
3756
|
return ch;
|
|
3823
3757
|
}
|
|
3824
|
-
|
|
3758
|
+
// @__NO_SIDE_EFFECTS__
|
|
3825
3759
|
function _check(fn, params) {
|
|
3826
3760
|
const ch = new $ZodCheck({
|
|
3827
3761
|
check: "custom",
|
|
@@ -3830,33 +3764,6 @@ function _check(fn, params) {
|
|
|
3830
3764
|
ch._zod.check = fn;
|
|
3831
3765
|
return ch;
|
|
3832
3766
|
}
|
|
3833
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
3834
|
-
function describe$1(description) {
|
|
3835
|
-
const ch = new $ZodCheck({ check: "describe" });
|
|
3836
|
-
ch._zod.onattach = [(inst) => {
|
|
3837
|
-
const existing = globalRegistry.get(inst) ?? {};
|
|
3838
|
-
globalRegistry.add(inst, {
|
|
3839
|
-
...existing,
|
|
3840
|
-
description
|
|
3841
|
-
});
|
|
3842
|
-
}];
|
|
3843
|
-
ch._zod.check = () => {};
|
|
3844
|
-
return ch;
|
|
3845
|
-
}
|
|
3846
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
3847
|
-
function meta$1(metadata) {
|
|
3848
|
-
const ch = new $ZodCheck({ check: "meta" });
|
|
3849
|
-
ch._zod.onattach = [(inst) => {
|
|
3850
|
-
const existing = globalRegistry.get(inst) ?? {};
|
|
3851
|
-
globalRegistry.add(inst, {
|
|
3852
|
-
...existing,
|
|
3853
|
-
...metadata
|
|
3854
|
-
});
|
|
3855
|
-
}];
|
|
3856
|
-
ch._zod.check = () => {};
|
|
3857
|
-
return ch;
|
|
3858
|
-
}
|
|
3859
|
-
|
|
3860
3767
|
//#endregion
|
|
3861
3768
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.js
|
|
3862
3769
|
function assignProps(target, ...sources) {
|
|
@@ -3905,13 +3812,12 @@ function processSchema(schema, ctx, _params = {
|
|
|
3905
3812
|
path: [],
|
|
3906
3813
|
schemaPath: []
|
|
3907
3814
|
}) {
|
|
3908
|
-
var _a
|
|
3815
|
+
var _a;
|
|
3909
3816
|
const def = schema._zod.def;
|
|
3910
3817
|
const seen = ctx.seen.get(schema);
|
|
3911
3818
|
if (seen) {
|
|
3912
3819
|
seen.count++;
|
|
3913
|
-
|
|
3914
|
-
if (isCycle) seen.cycle = _params.path;
|
|
3820
|
+
if (_params.schemaPath.includes(schema)) seen.cycle = _params.path;
|
|
3915
3821
|
return seen.schema;
|
|
3916
3822
|
}
|
|
3917
3823
|
const result = {
|
|
@@ -3945,16 +3851,15 @@ function processSchema(schema, ctx, _params = {
|
|
|
3945
3851
|
ctx.seen.get(parent).isParent = true;
|
|
3946
3852
|
}
|
|
3947
3853
|
}
|
|
3948
|
-
const meta
|
|
3949
|
-
if (meta
|
|
3854
|
+
const meta = ctx.metadataRegistry.get(schema);
|
|
3855
|
+
if (meta) assignProps(result.schema, meta);
|
|
3950
3856
|
if (ctx.io === "input" && isTransforming(schema)) {
|
|
3951
3857
|
delete result.schema.examples;
|
|
3952
3858
|
delete result.schema.default;
|
|
3953
3859
|
}
|
|
3954
|
-
if (ctx.io === "input" && "_prefault" in result.schema) (_a
|
|
3860
|
+
if (ctx.io === "input" && "_prefault" in result.schema) (_a = result.schema).default ?? (_a.default = result.schema._prefault);
|
|
3955
3861
|
delete result.schema._prefault;
|
|
3956
|
-
|
|
3957
|
-
return _result.schema;
|
|
3862
|
+
return ctx.seen.get(schema).schema;
|
|
3958
3863
|
}
|
|
3959
3864
|
function encodeJSONPointerSegment(segment) {
|
|
3960
3865
|
return segment.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
@@ -3976,7 +3881,7 @@ function extractDefs(ctx, schema) {
|
|
|
3976
3881
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
3977
3882
|
if (ctx.external) {
|
|
3978
3883
|
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
3979
|
-
const uriGenerator = ctx.external.uri ?? ((id
|
|
3884
|
+
const uriGenerator = ctx.external.uri ?? ((id) => id);
|
|
3980
3885
|
if (externalId) return { ref: uriGenerator(externalId) };
|
|
3981
3886
|
const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
3982
3887
|
entry[1].defId = id;
|
|
@@ -4000,9 +3905,9 @@ function extractDefs(ctx, schema) {
|
|
|
4000
3905
|
const { ref, defId } = makeURI(entry);
|
|
4001
3906
|
seen.def = { ...seen.schema };
|
|
4002
3907
|
if (defId) seen.defId = defId;
|
|
4003
|
-
const schema
|
|
4004
|
-
for (const key in schema
|
|
4005
|
-
schema
|
|
3908
|
+
const schema = seen.schema;
|
|
3909
|
+
for (const key in schema) delete schema[key];
|
|
3910
|
+
schema.$ref = ref;
|
|
4006
3911
|
};
|
|
4007
3912
|
if (ctx.cycles === "throw") for (const entry of ctx.seen.entries()) {
|
|
4008
3913
|
const seen = entry[1];
|
|
@@ -4023,8 +3928,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4023
3928
|
continue;
|
|
4024
3929
|
}
|
|
4025
3930
|
}
|
|
4026
|
-
|
|
4027
|
-
if (id) {
|
|
3931
|
+
if (ctx.metadataRegistry.get(entry[0])?.id) {
|
|
4028
3932
|
extractToDef(entry);
|
|
4029
3933
|
continue;
|
|
4030
3934
|
}
|
|
@@ -4060,7 +3964,7 @@ function compactTypeUnion(schema) {
|
|
|
4060
3964
|
/** Keywords `foldIntersection` knows how to combine. Anything else — `$ref`, `patternProperties`,
|
|
4061
3965
|
* an annotation like `description` — makes a member unfoldable, so a constraint this does not
|
|
4062
3966
|
* understand leaves the `allOf` alone instead of being silently dropped or misattributed. */
|
|
4063
|
-
const FOLDABLE_KEYS = new Set([
|
|
3967
|
+
const FOLDABLE_KEYS = /* @__PURE__ */ new Set([
|
|
4064
3968
|
"type",
|
|
4065
3969
|
"properties",
|
|
4066
3970
|
"required",
|
|
@@ -4074,17 +3978,17 @@ function undeclaredConstraint(member) {
|
|
|
4074
3978
|
return Object.keys(extra).length ? extra : null;
|
|
4075
3979
|
}
|
|
4076
3980
|
/** Combines object members into the single object they describe together, or returns `null` if any of them carries a keyword outside {@link FOLDABLE_KEYS}. */
|
|
4077
|
-
function foldObjects(members
|
|
3981
|
+
function foldObjects(members) {
|
|
4078
3982
|
const objects = [];
|
|
4079
|
-
for (const member of members
|
|
3983
|
+
for (const member of members) {
|
|
4080
3984
|
if (typeof member !== "object" || member.type !== "object") return null;
|
|
4081
3985
|
for (const key in member) if (!FOLDABLE_KEYS.has(key)) return null;
|
|
4082
3986
|
objects.push(member);
|
|
4083
3987
|
}
|
|
4084
3988
|
const properties = {};
|
|
4085
|
-
const required
|
|
4086
|
-
for (const object
|
|
4087
|
-
for (const key in object
|
|
3989
|
+
const required = /* @__PURE__ */ new Set();
|
|
3990
|
+
for (const object of objects) {
|
|
3991
|
+
for (const key in object.properties) {
|
|
4088
3992
|
if (Object.prototype.hasOwnProperty.call(properties, key)) continue;
|
|
4089
3993
|
const parts = [];
|
|
4090
3994
|
for (const other of objects) {
|
|
@@ -4092,21 +3996,20 @@ function foldObjects(members$1) {
|
|
|
4092
3996
|
if (part === null || part === void 0) continue;
|
|
4093
3997
|
if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part))) parts.push(part);
|
|
4094
3998
|
}
|
|
4095
|
-
|
|
4096
|
-
assignProp(properties, key, merged);
|
|
3999
|
+
assignProp(properties, key, parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts });
|
|
4097
4000
|
}
|
|
4098
|
-
for (const key of object
|
|
4001
|
+
for (const key of object.required ?? []) required.add(key);
|
|
4099
4002
|
}
|
|
4100
4003
|
const folded = {
|
|
4101
4004
|
type: "object",
|
|
4102
4005
|
properties
|
|
4103
4006
|
};
|
|
4104
|
-
if (required
|
|
4105
|
-
if (objects.every((object
|
|
4007
|
+
if (required.size) folded.required = [...required];
|
|
4008
|
+
if (objects.every((object) => object.additionalProperties === false)) folded.additionalProperties = false;
|
|
4106
4009
|
else {
|
|
4107
4010
|
const constraints = [];
|
|
4108
|
-
for (const object
|
|
4109
|
-
const constraint = undeclaredConstraint(object
|
|
4011
|
+
for (const object of objects) {
|
|
4012
|
+
const constraint = undeclaredConstraint(object);
|
|
4110
4013
|
if (constraint && !constraints.some((seen) => JSON.stringify(seen) === JSON.stringify(constraint))) constraints.push(constraint);
|
|
4111
4014
|
}
|
|
4112
4015
|
if (constraints.length === 1) folded.additionalProperties = constraints[0];
|
|
@@ -4131,11 +4034,11 @@ function foldIntersection(json) {
|
|
|
4131
4034
|
let folded = null;
|
|
4132
4035
|
if (!unions.length) folded = foldObjects(allOf);
|
|
4133
4036
|
else {
|
|
4134
|
-
const union
|
|
4135
|
-
const keyword = UNION_KEYS.find((k) => Array.isArray(union
|
|
4136
|
-
if (Object.keys(union
|
|
4137
|
-
const rest = allOf.filter((m) => m !== union
|
|
4138
|
-
const branches = union
|
|
4037
|
+
const union = unions[0];
|
|
4038
|
+
const keyword = UNION_KEYS.find((k) => Array.isArray(union[k]));
|
|
4039
|
+
if (Object.keys(union).length !== 1) return;
|
|
4040
|
+
const rest = allOf.filter((m) => m !== union);
|
|
4041
|
+
const branches = union[keyword].map((branch) => foldObjects([...rest, branch]));
|
|
4139
4042
|
if (branches.some((b) => !b)) return;
|
|
4140
4043
|
folded = { [keyword]: branches };
|
|
4141
4044
|
}
|
|
@@ -4149,8 +4052,8 @@ function finalize(ctx, schema) {
|
|
|
4149
4052
|
const flattenRef = (zodSchema) => {
|
|
4150
4053
|
const seen = ctx.seen.get(zodSchema);
|
|
4151
4054
|
if (seen.ref === null) return;
|
|
4152
|
-
const schema
|
|
4153
|
-
const _cached = { ...schema
|
|
4055
|
+
const schema = seen.def ?? seen.schema;
|
|
4056
|
+
const _cached = { ...schema };
|
|
4154
4057
|
const ref = seen.ref;
|
|
4155
4058
|
seen.ref = null;
|
|
4156
4059
|
if (ref) {
|
|
@@ -4158,18 +4061,17 @@ function finalize(ctx, schema) {
|
|
|
4158
4061
|
const refSeen = ctx.seen.get(ref);
|
|
4159
4062
|
const refSchema = refSeen.schema;
|
|
4160
4063
|
if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
|
|
4161
|
-
schema
|
|
4162
|
-
schema
|
|
4163
|
-
} else assignProps(schema
|
|
4164
|
-
assignProps(schema
|
|
4165
|
-
|
|
4166
|
-
if (isParentRef) for (const key in schema$1) {
|
|
4064
|
+
schema.allOf = schema.allOf ?? [];
|
|
4065
|
+
schema.allOf.push(refSchema);
|
|
4066
|
+
} else assignProps(schema, refSchema);
|
|
4067
|
+
assignProps(schema, _cached);
|
|
4068
|
+
if (zodSchema._zod.parent === ref) for (const key in schema) {
|
|
4167
4069
|
if (key === "$ref" || key === "allOf") continue;
|
|
4168
|
-
if (!(key in _cached)) delete schema
|
|
4070
|
+
if (!(key in _cached)) delete schema[key];
|
|
4169
4071
|
}
|
|
4170
|
-
if (refSchema.$ref && refSeen.def) for (const key in schema
|
|
4072
|
+
if (refSchema.$ref && refSeen.def) for (const key in schema) {
|
|
4171
4073
|
if (key === "$ref" || key === "allOf") continue;
|
|
4172
|
-
if (key in refSeen.def && JSON.stringify(schema
|
|
4074
|
+
if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) delete schema[key];
|
|
4173
4075
|
}
|
|
4174
4076
|
}
|
|
4175
4077
|
const parent = zodSchema._zod.parent;
|
|
@@ -4177,16 +4079,16 @@ function finalize(ctx, schema) {
|
|
|
4177
4079
|
flattenRef(parent);
|
|
4178
4080
|
const parentSeen = ctx.seen.get(parent);
|
|
4179
4081
|
if (parentSeen?.schema.$ref) {
|
|
4180
|
-
schema
|
|
4181
|
-
if (parentSeen.def) for (const key in schema
|
|
4082
|
+
schema.$ref = parentSeen.schema.$ref;
|
|
4083
|
+
if (parentSeen.def) for (const key in schema) {
|
|
4182
4084
|
if (key === "$ref" || key === "allOf") continue;
|
|
4183
|
-
if (key in parentSeen.def && JSON.stringify(schema
|
|
4085
|
+
if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) delete schema[key];
|
|
4184
4086
|
}
|
|
4185
4087
|
}
|
|
4186
4088
|
}
|
|
4187
4089
|
ctx.override({
|
|
4188
4090
|
zodSchema,
|
|
4189
|
-
jsonSchema: schema
|
|
4091
|
+
jsonSchema: schema,
|
|
4190
4092
|
path: seen.path ?? []
|
|
4191
4093
|
});
|
|
4192
4094
|
};
|
|
@@ -4228,8 +4130,10 @@ function finalize(ctx, schema) {
|
|
|
4228
4130
|
}
|
|
4229
4131
|
}
|
|
4230
4132
|
if (ctx.external) ctx.sharedEmitDoneFor = ctx.external;
|
|
4231
|
-
if (ctx.external) {} else if (Object.keys(defs).length > 0)
|
|
4232
|
-
|
|
4133
|
+
if (ctx.external) {} else if (Object.keys(defs).length > 0) {
|
|
4134
|
+
if (ctx.target === "draft-2020-12") result.$defs = defs;
|
|
4135
|
+
else result.definitions = defs;
|
|
4136
|
+
}
|
|
4233
4137
|
try {
|
|
4234
4138
|
const finalized = JSON.parse(JSON.stringify(result));
|
|
4235
4139
|
Object.defineProperty(finalized, "~standard", {
|
|
@@ -4304,7 +4208,6 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
4304
4208
|
extractDefs(ctx, schema);
|
|
4305
4209
|
return finalize(ctx, schema);
|
|
4306
4210
|
};
|
|
4307
|
-
|
|
4308
4211
|
//#endregion
|
|
4309
4212
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.js
|
|
4310
4213
|
const narrowMin = (agg, key, value) => {
|
|
@@ -4386,7 +4289,7 @@ const formatMap = {
|
|
|
4386
4289
|
json_string: "json-string",
|
|
4387
4290
|
regex: ""
|
|
4388
4291
|
};
|
|
4389
|
-
const exactPatterns = new Map([[base64Charset, base64], [base64urlCharset, base64url]]);
|
|
4292
|
+
const exactPatterns = /* @__PURE__ */ new Map([[base64Charset, base64], [base64urlCharset, base64url]]);
|
|
4390
4293
|
const exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
4391
4294
|
const stringProcessor = (schema, ctx, _json, _params) => {
|
|
4392
4295
|
const json = _json;
|
|
@@ -4416,16 +4319,18 @@ const numberProcessor = (schema, ctx, _json, params) => {
|
|
|
4416
4319
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
4417
4320
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
4418
4321
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
4419
|
-
if (exMin)
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
if (
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4322
|
+
if (exMin) {
|
|
4323
|
+
if (legacy) {
|
|
4324
|
+
json.minimum = exclusiveMinimum;
|
|
4325
|
+
json.exclusiveMinimum = true;
|
|
4326
|
+
} else json.exclusiveMinimum = exclusiveMinimum;
|
|
4327
|
+
} else if (typeof minimum === "number") json.minimum = minimum;
|
|
4328
|
+
if (exMax) {
|
|
4329
|
+
if (legacy) {
|
|
4330
|
+
json.maximum = exclusiveMaximum;
|
|
4331
|
+
json.exclusiveMaximum = true;
|
|
4332
|
+
} else json.exclusiveMaximum = exclusiveMaximum;
|
|
4333
|
+
} else if (typeof maximum === "number") json.maximum = maximum;
|
|
4429
4334
|
if (multipleOf) {
|
|
4430
4335
|
const divisors = /* @__PURE__ */ new Set();
|
|
4431
4336
|
for (const divisor of multipleOf) if (Number.isFinite(divisor) && divisor !== 0) divisors.add(Math.abs(divisor));
|
|
@@ -4441,7 +4346,6 @@ const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
|
4441
4346
|
const neverProcessor = (_schema, _ctx, json, _params) => {
|
|
4442
4347
|
json.not = {};
|
|
4443
4348
|
};
|
|
4444
|
-
const unknownProcessor = (_schema, _ctx, _json, _params) => {};
|
|
4445
4349
|
const enumProcessor = (schema, _ctx, json, _params) => {
|
|
4446
4350
|
const def = schema._zod.def;
|
|
4447
4351
|
const values = getEnumValues(def.entries);
|
|
@@ -4507,8 +4411,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
4507
4411
|
const json = _json;
|
|
4508
4412
|
const def = schema._zod.def;
|
|
4509
4413
|
const shape = def.shape;
|
|
4510
|
-
|
|
4511
|
-
if (symbolKeys.length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
|
|
4414
|
+
if (Object.getOwnPropertySymbols(shape).length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
|
|
4512
4415
|
json.type = "object";
|
|
4513
4416
|
json.properties = {};
|
|
4514
4417
|
for (const key in shape) assignProp(json.properties, key, processSchema(shape[key], ctx, {
|
|
@@ -4601,7 +4504,7 @@ function stringifyKeyNames(bySchema, json, visited) {
|
|
|
4601
4504
|
const numericType = !types.includes("string") && types.some((t) => t === "number" || t === "integer");
|
|
4602
4505
|
const values = json.enum ?? (json.const !== void 0 ? [json.const] : void 0);
|
|
4603
4506
|
if (!numericType && !values?.some((v) => typeof v === "number")) return json;
|
|
4604
|
-
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id
|
|
4507
|
+
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;
|
|
4605
4508
|
if (rest.enum) rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
|
|
4606
4509
|
else if (typeof rest.const === "number") rest.const = String(rest.const);
|
|
4607
4510
|
if (!numericType) return rest;
|
|
@@ -4615,8 +4518,8 @@ function rewriteKeyNames(ctx) {
|
|
|
4615
4518
|
const bySchema = /* @__PURE__ */ new Map();
|
|
4616
4519
|
for (const entry of ctx.seen.values()) if (entry.def && !bySchema.has(entry.schema)) bySchema.set(entry.schema, entry);
|
|
4617
4520
|
const rewrites = /* @__PURE__ */ new Map();
|
|
4618
|
-
for (const record
|
|
4619
|
-
const seen = ctx.seen.get(record
|
|
4521
|
+
for (const record of pendingRecords.get(ctx) ?? []) {
|
|
4522
|
+
const seen = ctx.seen.get(record);
|
|
4620
4523
|
const names = (seen?.def ?? seen?.schema)?.propertyNames;
|
|
4621
4524
|
if (!names || names === true || rewrites.has(names)) continue;
|
|
4622
4525
|
const rewritten = stringifyKeyNames(bySchema, names, /* @__PURE__ */ new Set());
|
|
@@ -4753,7 +4656,6 @@ const optionalProcessor = (schema, ctx, _json, params) => {
|
|
|
4753
4656
|
const seen = ctx.seen.get(schema);
|
|
4754
4657
|
seen.ref = def.innerType;
|
|
4755
4658
|
};
|
|
4756
|
-
|
|
4757
4659
|
//#endregion
|
|
4758
4660
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.js
|
|
4759
4661
|
const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
@@ -4787,12 +4689,12 @@ const initializer = (inst, issues) => {
|
|
|
4787
4689
|
_installedErrorProtos.add(proto);
|
|
4788
4690
|
_lazyMethod(proto, "format", (self) => (mapper) => formatError(self, mapper));
|
|
4789
4691
|
_lazyMethod(proto, "flatten", (self) => (mapper) => flattenError(self, mapper));
|
|
4790
|
-
_lazyMethod(proto, "addIssue", (self) => (issue
|
|
4791
|
-
self.issues.push(issue
|
|
4692
|
+
_lazyMethod(proto, "addIssue", (self) => (issue) => {
|
|
4693
|
+
self.issues.push(issue);
|
|
4792
4694
|
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
4793
4695
|
});
|
|
4794
|
-
_lazyMethod(proto, "addIssues", (self) => (issues
|
|
4795
|
-
self.issues.push(...issues
|
|
4696
|
+
_lazyMethod(proto, "addIssues", (self) => (issues) => {
|
|
4697
|
+
self.issues.push(...issues);
|
|
4796
4698
|
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
4797
4699
|
});
|
|
4798
4700
|
Object.defineProperty(proto, "isEmpty", {
|
|
@@ -4803,8 +4705,7 @@ const initializer = (inst, issues) => {
|
|
|
4803
4705
|
}
|
|
4804
4706
|
});
|
|
4805
4707
|
};
|
|
4806
|
-
const ZodRealError =
|
|
4807
|
-
|
|
4708
|
+
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
4808
4709
|
//#endregion
|
|
4809
4710
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.js
|
|
4810
4711
|
const parse$1 = /* @__PURE__ */ _parse(ZodRealError);
|
|
@@ -4819,7 +4720,6 @@ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
|
4819
4720
|
const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
4820
4721
|
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
4821
4722
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
4822
|
-
|
|
4823
4723
|
//#endregion
|
|
4824
4724
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.js
|
|
4825
4725
|
function _ensureDefaultLocale() {
|
|
@@ -4828,7 +4728,7 @@ function _ensureDefaultLocale() {
|
|
|
4828
4728
|
function _ensureDefaultMemoizer() {
|
|
4829
4729
|
if (!globalConfig.memoizer) config({ memoizer: memoizer() });
|
|
4830
4730
|
}
|
|
4831
|
-
const ZodType =
|
|
4731
|
+
const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
4832
4732
|
_ensureDefaultLocale();
|
|
4833
4733
|
$ZodType.init(inst, def);
|
|
4834
4734
|
inst.def = def;
|
|
@@ -4852,8 +4752,8 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
4852
4752
|
brand() {
|
|
4853
4753
|
return this;
|
|
4854
4754
|
},
|
|
4855
|
-
register(reg, meta
|
|
4856
|
-
reg.add(this, meta
|
|
4755
|
+
register(reg, meta) {
|
|
4756
|
+
reg.add(this, meta);
|
|
4857
4757
|
return this;
|
|
4858
4758
|
},
|
|
4859
4759
|
refine(check, params) {
|
|
@@ -4863,7 +4763,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
4863
4763
|
return this.check(superRefine(refinement, params));
|
|
4864
4764
|
},
|
|
4865
4765
|
overwrite(fn) {
|
|
4866
|
-
return this.check(_overwrite(fn));
|
|
4766
|
+
return this.check(/* @__PURE__ */ _overwrite(fn));
|
|
4867
4767
|
},
|
|
4868
4768
|
optional() {
|
|
4869
4769
|
return optional(this);
|
|
@@ -4939,11 +4839,11 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
4939
4839
|
set "~standard"(value) {
|
|
4940
4840
|
own(this, "~standard", value);
|
|
4941
4841
|
},
|
|
4942
|
-
parse: function _parse
|
|
4943
|
-
return parse$1(this, data, params, { callee: _parse
|
|
4842
|
+
parse: function _parse(data, params) {
|
|
4843
|
+
return parse$1(this, data, params, { callee: _parse });
|
|
4944
4844
|
},
|
|
4945
|
-
parseAsync: async function _parseAsync
|
|
4946
|
-
return await parseAsync(this, data, params, { callee: _parseAsync
|
|
4845
|
+
parseAsync: async function _parseAsync(data, params) {
|
|
4846
|
+
return await parseAsync(this, data, params, { callee: _parseAsync });
|
|
4947
4847
|
},
|
|
4948
4848
|
safeParse(data, params) {
|
|
4949
4849
|
return safeParse(this, data, params);
|
|
@@ -4961,19 +4861,19 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
4961
4861
|
return validate(this, data, params);
|
|
4962
4862
|
},
|
|
4963
4863
|
validateAsync(data, params) {
|
|
4964
|
-
return validateAsync(this, data, params);
|
|
4864
|
+
return validateAsync$1(this, data, params);
|
|
4965
4865
|
},
|
|
4966
|
-
encode: function _encode
|
|
4967
|
-
return encode(this, data, params, { callee: _encode
|
|
4866
|
+
encode: function _encode(data, params) {
|
|
4867
|
+
return encode(this, data, params, { callee: _encode });
|
|
4968
4868
|
},
|
|
4969
|
-
decode: function _decode
|
|
4970
|
-
return decode(this, data, params, { callee: _decode
|
|
4869
|
+
decode: function _decode(data, params) {
|
|
4870
|
+
return decode(this, data, params, { callee: _decode });
|
|
4971
4871
|
},
|
|
4972
|
-
encodeAsync: async function _encodeAsync
|
|
4973
|
-
return await encodeAsync(this, data, params, { callee: _encodeAsync
|
|
4872
|
+
encodeAsync: async function _encodeAsync(data, params) {
|
|
4873
|
+
return await encodeAsync(this, data, params, { callee: _encodeAsync });
|
|
4974
4874
|
},
|
|
4975
|
-
decodeAsync: async function _decodeAsync
|
|
4976
|
-
return await decodeAsync(this, data, params, { callee: _decodeAsync
|
|
4875
|
+
decodeAsync: async function _decodeAsync(data, params) {
|
|
4876
|
+
return await decodeAsync(this, data, params, { callee: _decodeAsync });
|
|
4977
4877
|
},
|
|
4978
4878
|
safeEncode(data, params) {
|
|
4979
4879
|
return safeEncode(this, data, params);
|
|
@@ -4998,191 +4898,191 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
4998
4898
|
}
|
|
4999
4899
|
});
|
|
5000
4900
|
/** @internal */
|
|
5001
|
-
const _ZodString =
|
|
4901
|
+
const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
|
|
5002
4902
|
$ZodString.init(inst, def);
|
|
5003
4903
|
ZodType.init(inst, def);
|
|
5004
4904
|
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
5005
|
-
},
|
|
4905
|
+
}, /*@__PURE__*/ derived({
|
|
5006
4906
|
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
5007
4907
|
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
5008
4908
|
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
5009
4909
|
}, {
|
|
5010
4910
|
regex(...args) {
|
|
5011
|
-
return this.check(_regex(...args));
|
|
4911
|
+
return this.check(/* @__PURE__ */ _regex(...args));
|
|
5012
4912
|
},
|
|
5013
4913
|
includes(...args) {
|
|
5014
|
-
return this.check(_includes(...args));
|
|
4914
|
+
return this.check(/* @__PURE__ */ _includes(...args));
|
|
5015
4915
|
},
|
|
5016
4916
|
startsWith(...args) {
|
|
5017
|
-
return this.check(_startsWith(...args));
|
|
4917
|
+
return this.check(/* @__PURE__ */ _startsWith(...args));
|
|
5018
4918
|
},
|
|
5019
4919
|
endsWith(...args) {
|
|
5020
|
-
return this.check(_endsWith(...args));
|
|
4920
|
+
return this.check(/* @__PURE__ */ _endsWith(...args));
|
|
5021
4921
|
},
|
|
5022
4922
|
min(...args) {
|
|
5023
|
-
return this.check(_minLength(...args));
|
|
4923
|
+
return this.check(/* @__PURE__ */ _minLength(...args));
|
|
5024
4924
|
},
|
|
5025
4925
|
max(...args) {
|
|
5026
|
-
return this.check(_maxLength(...args));
|
|
4926
|
+
return this.check(/* @__PURE__ */ _maxLength(...args));
|
|
5027
4927
|
},
|
|
5028
4928
|
length(...args) {
|
|
5029
|
-
return this.check(_length(...args));
|
|
4929
|
+
return this.check(/* @__PURE__ */ _length(...args));
|
|
5030
4930
|
},
|
|
5031
4931
|
nonempty(...args) {
|
|
5032
|
-
return this.check(_minLength(1, ...args));
|
|
4932
|
+
return this.check(/* @__PURE__ */ _minLength(1, ...args));
|
|
5033
4933
|
},
|
|
5034
4934
|
lowercase(params) {
|
|
5035
|
-
return this.check(_lowercase(params));
|
|
4935
|
+
return this.check(/* @__PURE__ */ _lowercase(params));
|
|
5036
4936
|
},
|
|
5037
4937
|
uppercase(params) {
|
|
5038
|
-
return this.check(_uppercase(params));
|
|
4938
|
+
return this.check(/* @__PURE__ */ _uppercase(params));
|
|
5039
4939
|
},
|
|
5040
4940
|
trim() {
|
|
5041
|
-
return this.check(_trim());
|
|
4941
|
+
return this.check(/* @__PURE__ */ _trim());
|
|
5042
4942
|
},
|
|
5043
4943
|
normalize(...args) {
|
|
5044
|
-
return this.check(_normalize(...args));
|
|
4944
|
+
return this.check(/* @__PURE__ */ _normalize(...args));
|
|
5045
4945
|
},
|
|
5046
4946
|
toLowerCase() {
|
|
5047
|
-
return this.check(_toLowerCase());
|
|
4947
|
+
return this.check(/* @__PURE__ */ _toLowerCase());
|
|
5048
4948
|
},
|
|
5049
4949
|
toUpperCase() {
|
|
5050
|
-
return this.check(_toUpperCase());
|
|
4950
|
+
return this.check(/* @__PURE__ */ _toUpperCase());
|
|
5051
4951
|
},
|
|
5052
4952
|
slugify() {
|
|
5053
|
-
return this.check(_slugify());
|
|
4953
|
+
return this.check(/* @__PURE__ */ _slugify());
|
|
5054
4954
|
}
|
|
5055
4955
|
}));
|
|
5056
|
-
const ZodString =
|
|
4956
|
+
const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
|
|
5057
4957
|
$ZodString.init(inst, def);
|
|
5058
4958
|
_ZodString.init(inst, def);
|
|
5059
4959
|
}, {
|
|
5060
4960
|
email(params) {
|
|
5061
|
-
return this.check(_email(ZodEmail, params));
|
|
4961
|
+
return this.check(/* @__PURE__ */ _email(ZodEmail, params));
|
|
5062
4962
|
},
|
|
5063
4963
|
url(params) {
|
|
5064
|
-
return this.check(_url(ZodURL, params));
|
|
4964
|
+
return this.check(/* @__PURE__ */ _url(ZodURL, params));
|
|
5065
4965
|
},
|
|
5066
4966
|
jwt(params) {
|
|
5067
|
-
return this.check(_jwt(ZodJWT, params));
|
|
4967
|
+
return this.check(/* @__PURE__ */ _jwt(ZodJWT, params));
|
|
5068
4968
|
},
|
|
5069
4969
|
emoji(params) {
|
|
5070
|
-
return this.check(_emoji(ZodEmoji, params));
|
|
4970
|
+
return this.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
|
|
5071
4971
|
},
|
|
5072
4972
|
guid(params) {
|
|
5073
|
-
return this.check(_guid(ZodGUID, params));
|
|
4973
|
+
return this.check(/* @__PURE__ */ _guid(ZodGUID, params));
|
|
5074
4974
|
},
|
|
5075
4975
|
uuid(params) {
|
|
5076
|
-
return this.check(_uuid(ZodUUID, params));
|
|
4976
|
+
return this.check(/* @__PURE__ */ _uuid(ZodUUID, params));
|
|
5077
4977
|
},
|
|
5078
4978
|
uuidv4(params) {
|
|
5079
|
-
return this.check(_uuidv4(ZodUUID, params));
|
|
4979
|
+
return this.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
|
|
5080
4980
|
},
|
|
5081
4981
|
uuidv6(params) {
|
|
5082
|
-
return this.check(_uuidv6(ZodUUID, params));
|
|
4982
|
+
return this.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
|
|
5083
4983
|
},
|
|
5084
4984
|
uuidv7(params) {
|
|
5085
|
-
return this.check(_uuidv7(ZodUUID, params));
|
|
4985
|
+
return this.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
|
|
5086
4986
|
},
|
|
5087
4987
|
nanoid(params) {
|
|
5088
|
-
return this.check(_nanoid(ZodNanoID, params));
|
|
4988
|
+
return this.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
|
|
5089
4989
|
},
|
|
5090
4990
|
cuid(params) {
|
|
5091
|
-
return this.check(_cuid(ZodCUID, params));
|
|
4991
|
+
return this.check(/* @__PURE__ */ _cuid(ZodCUID, params));
|
|
5092
4992
|
},
|
|
5093
4993
|
cuid2(params) {
|
|
5094
|
-
return this.check(_cuid2(ZodCUID2, params));
|
|
4994
|
+
return this.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
|
|
5095
4995
|
},
|
|
5096
4996
|
ulid(params) {
|
|
5097
|
-
return this.check(_ulid(ZodULID, params));
|
|
4997
|
+
return this.check(/* @__PURE__ */ _ulid(ZodULID, params));
|
|
5098
4998
|
},
|
|
5099
4999
|
base64(params) {
|
|
5100
|
-
return this.check(_base64(ZodBase64, params));
|
|
5000
|
+
return this.check(/* @__PURE__ */ _base64(ZodBase64, params));
|
|
5101
5001
|
},
|
|
5102
5002
|
base64url(params) {
|
|
5103
|
-
return this.check(_base64url(ZodBase64URL, params));
|
|
5003
|
+
return this.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
|
|
5104
5004
|
},
|
|
5105
5005
|
xid(params) {
|
|
5106
|
-
return this.check(_xid(ZodXID, params));
|
|
5006
|
+
return this.check(/* @__PURE__ */ _xid(ZodXID, params));
|
|
5107
5007
|
},
|
|
5108
5008
|
ksuid(params) {
|
|
5109
|
-
return this.check(_ksuid(ZodKSUID, params));
|
|
5009
|
+
return this.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
|
|
5110
5010
|
},
|
|
5111
5011
|
ipv4(params) {
|
|
5112
|
-
return this.check(_ipv4(ZodIPv4, params));
|
|
5012
|
+
return this.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
|
|
5113
5013
|
},
|
|
5114
5014
|
ipv6(params) {
|
|
5115
|
-
return this.check(_ipv6(ZodIPv6, params));
|
|
5015
|
+
return this.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
|
|
5116
5016
|
},
|
|
5117
5017
|
cidrv4(params) {
|
|
5118
|
-
return this.check(_cidrv4(ZodCIDRv4, params));
|
|
5018
|
+
return this.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
|
|
5119
5019
|
},
|
|
5120
5020
|
cidrv6(params) {
|
|
5121
|
-
return this.check(_cidrv6(ZodCIDRv6, params));
|
|
5021
|
+
return this.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
|
|
5122
5022
|
},
|
|
5123
5023
|
e164(params) {
|
|
5124
|
-
return this.check(_e164(ZodE164, params));
|
|
5024
|
+
return this.check(/* @__PURE__ */ _e164(ZodE164, params));
|
|
5125
5025
|
},
|
|
5126
5026
|
datetime(params) {
|
|
5127
|
-
return this.check(_isoDateTime(ZodISODateTime, params));
|
|
5027
|
+
return this.check(/* @__PURE__ */ _isoDateTime(ZodISODateTime, params));
|
|
5128
5028
|
},
|
|
5129
5029
|
date(params) {
|
|
5130
|
-
return this.check(_isoDate(ZodISODate, params));
|
|
5030
|
+
return this.check(/* @__PURE__ */ _isoDate(ZodISODate, params));
|
|
5131
5031
|
},
|
|
5132
5032
|
time(params) {
|
|
5133
|
-
return this.check(_isoTime(ZodISOTime, params));
|
|
5033
|
+
return this.check(/* @__PURE__ */ _isoTime(ZodISOTime, params));
|
|
5134
5034
|
},
|
|
5135
5035
|
duration(params) {
|
|
5136
|
-
return this.check(_isoDuration(ZodISODuration, params));
|
|
5036
|
+
return this.check(/* @__PURE__ */ _isoDuration(ZodISODuration, params));
|
|
5137
5037
|
}
|
|
5138
5038
|
});
|
|
5139
5039
|
function string(params) {
|
|
5140
|
-
return _string(ZodString, params);
|
|
5040
|
+
return /* @__PURE__ */ _string(ZodString, params);
|
|
5141
5041
|
}
|
|
5142
|
-
const ZodStringFormat =
|
|
5042
|
+
const ZodStringFormat = /*@__PURE__*/ $constructor("ZodStringFormat", (inst, def) => {
|
|
5143
5043
|
$ZodStringFormat.init(inst, def);
|
|
5144
5044
|
_ZodString.init(inst, def);
|
|
5145
5045
|
});
|
|
5146
|
-
const ZodISODateTime =
|
|
5046
|
+
const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
|
|
5147
5047
|
$ZodISODateTime.init(inst, def);
|
|
5148
5048
|
ZodStringFormat.init(inst, def);
|
|
5149
5049
|
});
|
|
5150
|
-
const ZodISODate =
|
|
5050
|
+
const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
|
|
5151
5051
|
$ZodISODate.init(inst, def);
|
|
5152
5052
|
ZodStringFormat.init(inst, def);
|
|
5153
5053
|
});
|
|
5154
|
-
const ZodISOTime =
|
|
5054
|
+
const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
|
|
5155
5055
|
$ZodISOTime.init(inst, def);
|
|
5156
5056
|
ZodStringFormat.init(inst, def);
|
|
5157
5057
|
});
|
|
5158
|
-
const ZodISODuration =
|
|
5058
|
+
const ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => {
|
|
5159
5059
|
$ZodISODuration.init(inst, def);
|
|
5160
5060
|
ZodStringFormat.init(inst, def);
|
|
5161
5061
|
});
|
|
5162
|
-
const ZodEmail =
|
|
5062
|
+
const ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => {
|
|
5163
5063
|
$ZodEmail.init(inst, def);
|
|
5164
5064
|
ZodStringFormat.init(inst, def);
|
|
5165
5065
|
});
|
|
5166
|
-
const ZodGUID =
|
|
5066
|
+
const ZodGUID = /*@__PURE__*/ $constructor("ZodGUID", (inst, def) => {
|
|
5167
5067
|
$ZodGUID.init(inst, def);
|
|
5168
5068
|
ZodStringFormat.init(inst, def);
|
|
5169
5069
|
});
|
|
5170
|
-
const ZodUUID =
|
|
5070
|
+
const ZodUUID = /*@__PURE__*/ $constructor("ZodUUID", (inst, def) => {
|
|
5171
5071
|
$ZodUUID.init(inst, def);
|
|
5172
5072
|
ZodStringFormat.init(inst, def);
|
|
5173
5073
|
});
|
|
5174
|
-
const ZodURL =
|
|
5074
|
+
const ZodURL = /*@__PURE__*/ $constructor("ZodURL", (inst, def) => {
|
|
5175
5075
|
$ZodURL.init(inst, def);
|
|
5176
5076
|
ZodStringFormat.init(inst, def);
|
|
5177
5077
|
});
|
|
5178
5078
|
function url(params) {
|
|
5179
|
-
return _url(ZodURL, params);
|
|
5079
|
+
return /* @__PURE__ */ _url(ZodURL, params);
|
|
5180
5080
|
}
|
|
5181
|
-
const ZodEmoji =
|
|
5081
|
+
const ZodEmoji = /*@__PURE__*/ $constructor("ZodEmoji", (inst, def) => {
|
|
5182
5082
|
$ZodEmoji.init(inst, def);
|
|
5183
5083
|
ZodStringFormat.init(inst, def);
|
|
5184
5084
|
});
|
|
5185
|
-
const ZodNanoID =
|
|
5085
|
+
const ZodNanoID = /*@__PURE__*/ $constructor("ZodNanoID", (inst, def) => {
|
|
5186
5086
|
$ZodNanoID.init(inst, def);
|
|
5187
5087
|
ZodStringFormat.init(inst, def);
|
|
5188
5088
|
});
|
|
@@ -5191,64 +5091,64 @@ const ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
|
|
|
5191
5091
|
* (timestamps embedded in the id). Use {@link ZodCUID2} instead.
|
|
5192
5092
|
* See https://github.com/paralleldrive/cuid.
|
|
5193
5093
|
*/
|
|
5194
|
-
const ZodCUID =
|
|
5094
|
+
const ZodCUID = /*@__PURE__*/ $constructor("ZodCUID", (inst, def) => {
|
|
5195
5095
|
$ZodCUID.init(inst, def);
|
|
5196
5096
|
ZodStringFormat.init(inst, def);
|
|
5197
5097
|
});
|
|
5198
|
-
const ZodCUID2 =
|
|
5098
|
+
const ZodCUID2 = /*@__PURE__*/ $constructor("ZodCUID2", (inst, def) => {
|
|
5199
5099
|
$ZodCUID2.init(inst, def);
|
|
5200
5100
|
ZodStringFormat.init(inst, def);
|
|
5201
5101
|
});
|
|
5202
|
-
const ZodULID =
|
|
5102
|
+
const ZodULID = /*@__PURE__*/ $constructor("ZodULID", (inst, def) => {
|
|
5203
5103
|
$ZodULID.init(inst, def);
|
|
5204
5104
|
ZodStringFormat.init(inst, def);
|
|
5205
5105
|
});
|
|
5206
|
-
const ZodXID =
|
|
5106
|
+
const ZodXID = /*@__PURE__*/ $constructor("ZodXID", (inst, def) => {
|
|
5207
5107
|
$ZodXID.init(inst, def);
|
|
5208
5108
|
ZodStringFormat.init(inst, def);
|
|
5209
5109
|
});
|
|
5210
|
-
const ZodKSUID =
|
|
5110
|
+
const ZodKSUID = /*@__PURE__*/ $constructor("ZodKSUID", (inst, def) => {
|
|
5211
5111
|
$ZodKSUID.init(inst, def);
|
|
5212
5112
|
ZodStringFormat.init(inst, def);
|
|
5213
5113
|
});
|
|
5214
|
-
const ZodIPv4 =
|
|
5114
|
+
const ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => {
|
|
5215
5115
|
$ZodIPv4.init(inst, def);
|
|
5216
5116
|
ZodStringFormat.init(inst, def);
|
|
5217
5117
|
});
|
|
5218
|
-
const ZodIPv6 =
|
|
5118
|
+
const ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => {
|
|
5219
5119
|
$ZodIPv6.init(inst, def);
|
|
5220
5120
|
ZodStringFormat.init(inst, def);
|
|
5221
5121
|
});
|
|
5222
|
-
const ZodCIDRv4 =
|
|
5122
|
+
const ZodCIDRv4 = /*@__PURE__*/ $constructor("ZodCIDRv4", (inst, def) => {
|
|
5223
5123
|
$ZodCIDRv4.init(inst, def);
|
|
5224
5124
|
ZodStringFormat.init(inst, def);
|
|
5225
5125
|
});
|
|
5226
|
-
const ZodCIDRv6 =
|
|
5126
|
+
const ZodCIDRv6 = /*@__PURE__*/ $constructor("ZodCIDRv6", (inst, def) => {
|
|
5227
5127
|
$ZodCIDRv6.init(inst, def);
|
|
5228
5128
|
ZodStringFormat.init(inst, def);
|
|
5229
5129
|
});
|
|
5230
|
-
const ZodBase64 =
|
|
5130
|
+
const ZodBase64 = /*@__PURE__*/ $constructor("ZodBase64", (inst, def) => {
|
|
5231
5131
|
$ZodBase64.init(inst, def);
|
|
5232
5132
|
ZodStringFormat.init(inst, def);
|
|
5233
5133
|
});
|
|
5234
|
-
const ZodBase64URL =
|
|
5134
|
+
const ZodBase64URL = /*@__PURE__*/ $constructor("ZodBase64URL", (inst, def) => {
|
|
5235
5135
|
$ZodBase64URL.init(inst, def);
|
|
5236
5136
|
ZodStringFormat.init(inst, def);
|
|
5237
5137
|
});
|
|
5238
|
-
const ZodE164 =
|
|
5138
|
+
const ZodE164 = /*@__PURE__*/ $constructor("ZodE164", (inst, def) => {
|
|
5239
5139
|
$ZodE164.init(inst, def);
|
|
5240
5140
|
ZodStringFormat.init(inst, def);
|
|
5241
5141
|
});
|
|
5242
|
-
const ZodJWT =
|
|
5142
|
+
const ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => {
|
|
5243
5143
|
$ZodJWT.init(inst, def);
|
|
5244
5144
|
ZodStringFormat.init(inst, def);
|
|
5245
5145
|
});
|
|
5246
|
-
const ZodNumber =
|
|
5146
|
+
const ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
|
|
5247
5147
|
$ZodNumber.init(inst, def);
|
|
5248
5148
|
ZodType.init(inst, def);
|
|
5249
5149
|
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
5250
5150
|
inst.isFinite = true;
|
|
5251
|
-
},
|
|
5151
|
+
}, /*@__PURE__*/ derived({
|
|
5252
5152
|
minValue: (inst) => {
|
|
5253
5153
|
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
5254
5154
|
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
@@ -5264,22 +5164,22 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
5264
5164
|
format: (inst) => aggregateChecks(inst).format ?? null
|
|
5265
5165
|
}, {
|
|
5266
5166
|
gt(value, params) {
|
|
5267
|
-
return this.check(_gt(value, params));
|
|
5167
|
+
return this.check(/* @__PURE__ */ _gt(value, params));
|
|
5268
5168
|
},
|
|
5269
5169
|
gte(value, params) {
|
|
5270
|
-
return this.check(_gte(value, params));
|
|
5170
|
+
return this.check(/* @__PURE__ */ _gte(value, params));
|
|
5271
5171
|
},
|
|
5272
5172
|
min(value, params) {
|
|
5273
|
-
return this.check(_gte(value, params));
|
|
5173
|
+
return this.check(/* @__PURE__ */ _gte(value, params));
|
|
5274
5174
|
},
|
|
5275
5175
|
lt(value, params) {
|
|
5276
|
-
return this.check(_lt(value, params));
|
|
5176
|
+
return this.check(/* @__PURE__ */ _lt(value, params));
|
|
5277
5177
|
},
|
|
5278
5178
|
lte(value, params) {
|
|
5279
|
-
return this.check(_lte(value, params));
|
|
5179
|
+
return this.check(/* @__PURE__ */ _lte(value, params));
|
|
5280
5180
|
},
|
|
5281
5181
|
max(value, params) {
|
|
5282
|
-
return this.check(_lte(value, params));
|
|
5182
|
+
return this.check(/* @__PURE__ */ _lte(value, params));
|
|
5283
5183
|
},
|
|
5284
5184
|
int(params) {
|
|
5285
5185
|
return this.check(int(params));
|
|
@@ -5288,62 +5188,62 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
5288
5188
|
return this.check(int(params));
|
|
5289
5189
|
},
|
|
5290
5190
|
positive(params) {
|
|
5291
|
-
return this.check(_gt(0, params));
|
|
5191
|
+
return this.check(/* @__PURE__ */ _gt(0, params));
|
|
5292
5192
|
},
|
|
5293
5193
|
nonnegative(params) {
|
|
5294
|
-
return this.check(_gte(0, params));
|
|
5194
|
+
return this.check(/* @__PURE__ */ _gte(0, params));
|
|
5295
5195
|
},
|
|
5296
5196
|
negative(params) {
|
|
5297
|
-
return this.check(_lt(0, params));
|
|
5197
|
+
return this.check(/* @__PURE__ */ _lt(0, params));
|
|
5298
5198
|
},
|
|
5299
5199
|
nonpositive(params) {
|
|
5300
|
-
return this.check(_lte(0, params));
|
|
5200
|
+
return this.check(/* @__PURE__ */ _lte(0, params));
|
|
5301
5201
|
},
|
|
5302
5202
|
multipleOf(value, params) {
|
|
5303
|
-
return this.check(_multipleOf(value, params));
|
|
5203
|
+
return this.check(/* @__PURE__ */ _multipleOf(value, params));
|
|
5304
5204
|
},
|
|
5305
5205
|
step(value, params) {
|
|
5306
|
-
return this.check(_multipleOf(value, params));
|
|
5206
|
+
return this.check(/* @__PURE__ */ _multipleOf(value, params));
|
|
5307
5207
|
},
|
|
5308
5208
|
finite() {
|
|
5309
5209
|
return this;
|
|
5310
5210
|
}
|
|
5311
5211
|
}));
|
|
5312
5212
|
function number(params) {
|
|
5313
|
-
return _number(ZodNumber, params);
|
|
5213
|
+
return /* @__PURE__ */ _number(ZodNumber, params);
|
|
5314
5214
|
}
|
|
5315
|
-
const ZodNumberFormat =
|
|
5215
|
+
const ZodNumberFormat = /*@__PURE__*/ $constructor("ZodNumberFormat", (inst, def) => {
|
|
5316
5216
|
$ZodNumberFormat.init(inst, def);
|
|
5317
5217
|
ZodNumber.init(inst, def);
|
|
5318
5218
|
});
|
|
5319
5219
|
function int(params) {
|
|
5320
|
-
return _int(ZodNumberFormat, params);
|
|
5220
|
+
return /* @__PURE__ */ _int(ZodNumberFormat, params);
|
|
5321
5221
|
}
|
|
5322
|
-
const ZodBoolean =
|
|
5222
|
+
const ZodBoolean = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def) => {
|
|
5323
5223
|
$ZodBoolean.init(inst, def);
|
|
5324
5224
|
ZodType.init(inst, def);
|
|
5325
5225
|
inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
|
|
5326
5226
|
});
|
|
5327
5227
|
function boolean(params) {
|
|
5328
|
-
return _boolean(ZodBoolean, params);
|
|
5228
|
+
return /* @__PURE__ */ _boolean(ZodBoolean, params);
|
|
5329
5229
|
}
|
|
5330
|
-
const ZodUnknown =
|
|
5230
|
+
const ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => {
|
|
5331
5231
|
$ZodUnknown.init(inst, def);
|
|
5332
5232
|
ZodType.init(inst, def);
|
|
5333
|
-
inst._zod.processJSONSchema = (ctx, json, params) =>
|
|
5233
|
+
inst._zod.processJSONSchema = (ctx, json, params) => void 0;
|
|
5334
5234
|
});
|
|
5335
5235
|
function unknown() {
|
|
5336
|
-
return _unknown(ZodUnknown);
|
|
5236
|
+
return /* @__PURE__ */ _unknown(ZodUnknown);
|
|
5337
5237
|
}
|
|
5338
|
-
const ZodNever =
|
|
5238
|
+
const ZodNever = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => {
|
|
5339
5239
|
$ZodNever.init(inst, def);
|
|
5340
5240
|
ZodType.init(inst, def);
|
|
5341
5241
|
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
|
|
5342
5242
|
});
|
|
5343
5243
|
function never(params) {
|
|
5344
|
-
return _never(ZodNever, params);
|
|
5244
|
+
return /* @__PURE__ */ _never(ZodNever, params);
|
|
5345
5245
|
}
|
|
5346
|
-
const ZodArray =
|
|
5246
|
+
const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
|
|
5347
5247
|
_ensureDefaultMemoizer();
|
|
5348
5248
|
$ZodArray.init(inst, def);
|
|
5349
5249
|
ZodType.init(inst, def);
|
|
@@ -5351,25 +5251,25 @@ const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
|
5351
5251
|
inst.element = def.element;
|
|
5352
5252
|
}, {
|
|
5353
5253
|
min(n, params) {
|
|
5354
|
-
return this.check(_minLength(n, params));
|
|
5254
|
+
return this.check(/* @__PURE__ */ _minLength(n, params));
|
|
5355
5255
|
},
|
|
5356
5256
|
nonempty(params) {
|
|
5357
|
-
return this.check(_minLength(1, params));
|
|
5257
|
+
return this.check(/* @__PURE__ */ _minLength(1, params));
|
|
5358
5258
|
},
|
|
5359
5259
|
max(n, params) {
|
|
5360
|
-
return this.check(_maxLength(n, params));
|
|
5260
|
+
return this.check(/* @__PURE__ */ _maxLength(n, params));
|
|
5361
5261
|
},
|
|
5362
5262
|
length(n, params) {
|
|
5363
|
-
return this.check(_length(n, params));
|
|
5263
|
+
return this.check(/* @__PURE__ */ _length(n, params));
|
|
5364
5264
|
},
|
|
5365
5265
|
unwrap() {
|
|
5366
5266
|
return this.element;
|
|
5367
5267
|
}
|
|
5368
5268
|
});
|
|
5369
5269
|
function array(element, params) {
|
|
5370
|
-
return _array(ZodArray, element, params);
|
|
5270
|
+
return /* @__PURE__ */ _array(ZodArray, element, params);
|
|
5371
5271
|
}
|
|
5372
|
-
const ZodObject =
|
|
5272
|
+
const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
|
|
5373
5273
|
_ensureDefaultMemoizer();
|
|
5374
5274
|
$ZodObjectJIT.init(inst, def);
|
|
5375
5275
|
ZodType.init(inst, def);
|
|
@@ -5427,7 +5327,7 @@ function object(shape, params) {
|
|
|
5427
5327
|
};
|
|
5428
5328
|
return new ZodObject(def);
|
|
5429
5329
|
}
|
|
5430
|
-
const ZodUnion =
|
|
5330
|
+
const ZodUnion = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => {
|
|
5431
5331
|
$ZodUnion.init(inst, def);
|
|
5432
5332
|
ZodType.init(inst, def);
|
|
5433
5333
|
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
@@ -5440,7 +5340,7 @@ function union(options, params) {
|
|
|
5440
5340
|
...normalizeParams(params)
|
|
5441
5341
|
});
|
|
5442
5342
|
}
|
|
5443
|
-
const ZodDiscriminatedUnion =
|
|
5343
|
+
const ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("ZodDiscriminatedUnion", (inst, def) => {
|
|
5444
5344
|
ZodUnion.init(inst, def);
|
|
5445
5345
|
$ZodDiscriminatedUnion.init(inst, def);
|
|
5446
5346
|
});
|
|
@@ -5452,7 +5352,7 @@ function discriminatedUnion(discriminator, options, params) {
|
|
|
5452
5352
|
...normalizeParams(params)
|
|
5453
5353
|
});
|
|
5454
5354
|
}
|
|
5455
|
-
const ZodIntersection =
|
|
5355
|
+
const ZodIntersection = /*@__PURE__*/ $constructor("ZodIntersection", (inst, def) => {
|
|
5456
5356
|
$ZodIntersection.init(inst, def);
|
|
5457
5357
|
ZodType.init(inst, def);
|
|
5458
5358
|
inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
|
|
@@ -5464,7 +5364,7 @@ function intersection(left, right) {
|
|
|
5464
5364
|
right
|
|
5465
5365
|
});
|
|
5466
5366
|
}
|
|
5467
|
-
const ZodRecord =
|
|
5367
|
+
const ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => {
|
|
5468
5368
|
_ensureDefaultMemoizer();
|
|
5469
5369
|
$ZodRecord.init(inst, def);
|
|
5470
5370
|
ZodType.init(inst, def);
|
|
@@ -5486,7 +5386,7 @@ function record(keyType, valueType, params) {
|
|
|
5486
5386
|
...normalizeParams(params)
|
|
5487
5387
|
});
|
|
5488
5388
|
}
|
|
5489
|
-
const ZodEnum =
|
|
5389
|
+
const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
|
|
5490
5390
|
$ZodEnum.init(inst, def);
|
|
5491
5391
|
ZodType.init(inst, def);
|
|
5492
5392
|
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
@@ -5524,7 +5424,7 @@ function _enum(values, params) {
|
|
|
5524
5424
|
...normalizeParams(params)
|
|
5525
5425
|
});
|
|
5526
5426
|
}
|
|
5527
|
-
const ZodLiteral =
|
|
5427
|
+
const ZodLiteral = /*@__PURE__*/ $constructor("ZodLiteral", (inst, def) => {
|
|
5528
5428
|
$ZodLiteral.init(inst, def);
|
|
5529
5429
|
ZodType.init(inst, def);
|
|
5530
5430
|
inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
|
|
@@ -5541,7 +5441,7 @@ function literal(value, params) {
|
|
|
5541
5441
|
...normalizeParams(params)
|
|
5542
5442
|
});
|
|
5543
5443
|
}
|
|
5544
|
-
const ZodTransform =
|
|
5444
|
+
const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
|
|
5545
5445
|
_ensureDefaultMemoizer();
|
|
5546
5446
|
$ZodTransform.init(inst, def);
|
|
5547
5447
|
ZodType.init(inst, def);
|
|
@@ -5560,8 +5460,8 @@ const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) =>
|
|
|
5560
5460
|
}
|
|
5561
5461
|
};
|
|
5562
5462
|
const output = def.transform(payload.value, payload);
|
|
5563
|
-
if (output instanceof Promise) return output.then((output
|
|
5564
|
-
payload.value = output
|
|
5463
|
+
if (output instanceof Promise) return output.then((output) => {
|
|
5464
|
+
payload.value = output;
|
|
5565
5465
|
return payload;
|
|
5566
5466
|
});
|
|
5567
5467
|
payload.value = output;
|
|
@@ -5574,7 +5474,7 @@ function transform(fn) {
|
|
|
5574
5474
|
transform: fn
|
|
5575
5475
|
});
|
|
5576
5476
|
}
|
|
5577
|
-
const ZodOptional =
|
|
5477
|
+
const ZodOptional = /*@__PURE__*/ $constructor("ZodOptional", (inst, def) => {
|
|
5578
5478
|
$ZodOptional.init(inst, def);
|
|
5579
5479
|
ZodType.init(inst, def);
|
|
5580
5480
|
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
@@ -5586,7 +5486,7 @@ function optional(innerType) {
|
|
|
5586
5486
|
innerType
|
|
5587
5487
|
});
|
|
5588
5488
|
}
|
|
5589
|
-
const ZodExactOptional =
|
|
5489
|
+
const ZodExactOptional = /*@__PURE__*/ $constructor("ZodExactOptional", (inst, def) => {
|
|
5590
5490
|
$ZodExactOptional.init(inst, def);
|
|
5591
5491
|
ZodType.init(inst, def);
|
|
5592
5492
|
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
@@ -5598,7 +5498,7 @@ function exactOptional(innerType) {
|
|
|
5598
5498
|
innerType
|
|
5599
5499
|
});
|
|
5600
5500
|
}
|
|
5601
|
-
const ZodNullable =
|
|
5501
|
+
const ZodNullable = /*@__PURE__*/ $constructor("ZodNullable", (inst, def) => {
|
|
5602
5502
|
$ZodNullable.init(inst, def);
|
|
5603
5503
|
ZodType.init(inst, def);
|
|
5604
5504
|
inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
|
|
@@ -5610,7 +5510,7 @@ function nullable(innerType) {
|
|
|
5610
5510
|
innerType
|
|
5611
5511
|
});
|
|
5612
5512
|
}
|
|
5613
|
-
const ZodDefault =
|
|
5513
|
+
const ZodDefault = /*@__PURE__*/ $constructor("ZodDefault", (inst, def) => {
|
|
5614
5514
|
$ZodDefault.init(inst, def);
|
|
5615
5515
|
ZodType.init(inst, def);
|
|
5616
5516
|
inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
|
|
@@ -5626,7 +5526,7 @@ function _default(innerType, defaultValue) {
|
|
|
5626
5526
|
}
|
|
5627
5527
|
});
|
|
5628
5528
|
}
|
|
5629
|
-
const ZodPrefault =
|
|
5529
|
+
const ZodPrefault = /*@__PURE__*/ $constructor("ZodPrefault", (inst, def) => {
|
|
5630
5530
|
$ZodPrefault.init(inst, def);
|
|
5631
5531
|
ZodType.init(inst, def);
|
|
5632
5532
|
inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
|
|
@@ -5641,7 +5541,7 @@ function prefault(innerType, defaultValue) {
|
|
|
5641
5541
|
}
|
|
5642
5542
|
});
|
|
5643
5543
|
}
|
|
5644
|
-
const ZodNonOptional =
|
|
5544
|
+
const ZodNonOptional = /*@__PURE__*/ $constructor("ZodNonOptional", (inst, def) => {
|
|
5645
5545
|
$ZodNonOptional.init(inst, def);
|
|
5646
5546
|
ZodType.init(inst, def);
|
|
5647
5547
|
inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
|
|
@@ -5654,7 +5554,7 @@ function nonoptional(innerType, params) {
|
|
|
5654
5554
|
...normalizeParams(params)
|
|
5655
5555
|
});
|
|
5656
5556
|
}
|
|
5657
|
-
const ZodCatch =
|
|
5557
|
+
const ZodCatch = /*@__PURE__*/ $constructor("ZodCatch", (inst, def) => {
|
|
5658
5558
|
$ZodCatch.init(inst, def);
|
|
5659
5559
|
ZodType.init(inst, def);
|
|
5660
5560
|
inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
|
|
@@ -5668,7 +5568,7 @@ function _catch(innerType, catchValue) {
|
|
|
5668
5568
|
catchValue: typeof catchValue === "function" ? catchValue : constantCatch(catchValue)
|
|
5669
5569
|
});
|
|
5670
5570
|
}
|
|
5671
|
-
const ZodPipe =
|
|
5571
|
+
const ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => {
|
|
5672
5572
|
$ZodPipe.init(inst, def);
|
|
5673
5573
|
ZodType.init(inst, def);
|
|
5674
5574
|
inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
|
|
@@ -5682,7 +5582,7 @@ function pipe(in_, out) {
|
|
|
5682
5582
|
out
|
|
5683
5583
|
});
|
|
5684
5584
|
}
|
|
5685
|
-
const ZodReadonly =
|
|
5585
|
+
const ZodReadonly = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => {
|
|
5686
5586
|
$ZodReadonly.init(inst, def);
|
|
5687
5587
|
ZodType.init(inst, def);
|
|
5688
5588
|
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
@@ -5694,23 +5594,20 @@ function readonly(innerType) {
|
|
|
5694
5594
|
innerType
|
|
5695
5595
|
});
|
|
5696
5596
|
}
|
|
5697
|
-
const ZodCustom =
|
|
5597
|
+
const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
|
|
5698
5598
|
$ZodCustom.init(inst, def);
|
|
5699
5599
|
ZodType.init(inst, def);
|
|
5700
5600
|
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
5701
5601
|
});
|
|
5702
5602
|
function custom(fn, _params) {
|
|
5703
|
-
return _custom(ZodCustom, fn ?? (() => true), _params);
|
|
5603
|
+
return /* @__PURE__ */ _custom(ZodCustom, fn ?? (() => true), _params);
|
|
5704
5604
|
}
|
|
5705
5605
|
function refine(fn, _params = {}) {
|
|
5706
|
-
return _refine(ZodCustom, fn, _params);
|
|
5606
|
+
return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
|
|
5707
5607
|
}
|
|
5708
5608
|
function superRefine(fn, params) {
|
|
5709
|
-
return _superRefine(fn, params);
|
|
5609
|
+
return /* @__PURE__ */ _superRefine(fn, params);
|
|
5710
5610
|
}
|
|
5711
|
-
const describe = describe$1;
|
|
5712
|
-
const meta = meta$1;
|
|
5713
|
-
|
|
5714
5611
|
//#endregion
|
|
5715
5612
|
//#region src/workspace/stages.ts
|
|
5716
5613
|
/**
|
|
@@ -5724,7 +5621,7 @@ const STAGE_NAME = /^[a-z][a-z0-9-]*$/;
|
|
|
5724
5621
|
function nameProblems(name) {
|
|
5725
5622
|
const problems = [];
|
|
5726
5623
|
if (!STAGE_NAME.test(name)) problems.push(`stage "${name}" must be lowercase letters, digits and hyphens, starting with a letter`);
|
|
5727
|
-
if (name ===
|
|
5624
|
+
if (name === "test") problems.push(`stage "${TEST_STAGE}" is reserved for gkm test`);
|
|
5728
5625
|
return problems;
|
|
5729
5626
|
}
|
|
5730
5627
|
/** Everything wrong with a list of deployed stages on its own. */
|
|
@@ -5758,6 +5655,7 @@ function assertDeployedStage(stages, stage) {
|
|
|
5758
5655
|
}
|
|
5759
5656
|
/** A stages block — in gkm.config.ts or from `gkm init`'s flags — that breaks a rule. */
|
|
5760
5657
|
var InvalidStages = class extends Error {
|
|
5658
|
+
problems;
|
|
5761
5659
|
constructor(problems) {
|
|
5762
5660
|
super(`Invalid stages:\n ${problems.join("\n ")}`);
|
|
5763
5661
|
this.problems = problems;
|
|
@@ -5769,6 +5667,8 @@ var InvalidStages = class extends Error {
|
|
|
5769
5667
|
* provisioned, so a typo does not become a second environment.
|
|
5770
5668
|
*/
|
|
5771
5669
|
var UndeclaredStage = class extends Error {
|
|
5670
|
+
stage;
|
|
5671
|
+
deployed;
|
|
5772
5672
|
constructor(stage, deployed) {
|
|
5773
5673
|
super(`"${stage}" is not a deployed stage. gkm.config.ts deploys to: ${deployed.join(", ") || "nothing yet"}.`);
|
|
5774
5674
|
this.stage = stage;
|
|
@@ -5776,7 +5676,6 @@ var UndeclaredStage = class extends Error {
|
|
|
5776
5676
|
this.name = "UndeclaredStage";
|
|
5777
5677
|
}
|
|
5778
5678
|
};
|
|
5779
|
-
|
|
5780
5679
|
//#endregion
|
|
5781
5680
|
//#region src/workspace/schema.ts
|
|
5782
5681
|
/**
|
|
@@ -5825,34 +5724,22 @@ const OpenApiConfigSchema = object({
|
|
|
5825
5724
|
*/
|
|
5826
5725
|
const HooksConfigSchema = object({ server: string().optional() });
|
|
5827
5726
|
/**
|
|
5828
|
-
* Backend framework schema for non-gkm apps.
|
|
5829
|
-
*/
|
|
5830
|
-
const BackendFrameworkSchema = _enum([
|
|
5831
|
-
"hono",
|
|
5832
|
-
"better-auth",
|
|
5833
|
-
"express",
|
|
5834
|
-
"fastify"
|
|
5835
|
-
]);
|
|
5836
|
-
/**
|
|
5837
|
-
* Frontend framework schema.
|
|
5838
|
-
*/
|
|
5839
|
-
const FrontendFrameworkSchema = _enum([
|
|
5840
|
-
"nextjs",
|
|
5841
|
-
"remix",
|
|
5842
|
-
"vite",
|
|
5843
|
-
"tanstack-start"
|
|
5844
|
-
]);
|
|
5845
|
-
/**
|
|
5846
|
-
* Mobile framework schema.
|
|
5847
|
-
*/
|
|
5848
|
-
const MobileFrameworkSchema = _enum(["expo"]);
|
|
5849
|
-
/**
|
|
5850
5727
|
* Combined framework schema (backend, frontend, or mobile).
|
|
5851
5728
|
*/
|
|
5852
5729
|
const FrameworkSchema = union([
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5730
|
+
_enum([
|
|
5731
|
+
"hono",
|
|
5732
|
+
"better-auth",
|
|
5733
|
+
"express",
|
|
5734
|
+
"fastify"
|
|
5735
|
+
]),
|
|
5736
|
+
_enum([
|
|
5737
|
+
"nextjs",
|
|
5738
|
+
"remix",
|
|
5739
|
+
"vite",
|
|
5740
|
+
"tanstack-start"
|
|
5741
|
+
]),
|
|
5742
|
+
_enum(["expo"])
|
|
5856
5743
|
]);
|
|
5857
5744
|
/** Frontend framework values, kept in sync with FrontendFrameworkSchema. */
|
|
5858
5745
|
const FRONTEND_FRAMEWORKS = [
|
|
@@ -5897,76 +5784,21 @@ function isPhase2DeployTarget(target) {
|
|
|
5897
5784
|
* Get error message for unsupported deploy targets.
|
|
5898
5785
|
*/
|
|
5899
5786
|
function getDeployTargetError(target, appName) {
|
|
5900
|
-
if (isPhase2DeployTarget(target)) {
|
|
5901
|
-
const context = appName ? ` for app "${appName}"` : "";
|
|
5902
|
-
return `Deploy target "${target}"${context} is coming in Phase 2. Currently only "dokploy" is supported.`;
|
|
5903
|
-
}
|
|
5787
|
+
if (isPhase2DeployTarget(target)) return `Deploy target "${target}"${appName ? ` for app "${appName}"` : ""} is coming in Phase 2. Currently only "dokploy" is supported.`;
|
|
5904
5788
|
return `Unknown deploy target: ${target}. Supported: dokploy. Coming in Phase 2: vercel, cloudflare.`;
|
|
5905
5789
|
}
|
|
5906
5790
|
/**
|
|
5907
|
-
* Service image configuration schema.
|
|
5908
|
-
*/
|
|
5909
|
-
const ServiceImageConfigSchema = object({
|
|
5910
|
-
version: string().optional(),
|
|
5911
|
-
image: string().optional()
|
|
5912
|
-
});
|
|
5913
|
-
/**
|
|
5914
|
-
* Mail service configuration schema.
|
|
5915
|
-
*/
|
|
5916
|
-
const MailServiceConfigSchema = ServiceImageConfigSchema.extend({ smtp: object({
|
|
5917
|
-
host: string(),
|
|
5918
|
-
port: number(),
|
|
5919
|
-
user: string().optional(),
|
|
5920
|
-
pass: string().optional()
|
|
5921
|
-
}).optional() });
|
|
5922
|
-
/**
|
|
5923
|
-
* Services configuration schema.
|
|
5924
|
-
*/
|
|
5925
|
-
const ServicesConfigSchema = object({
|
|
5926
|
-
db: union([boolean(), ServiceImageConfigSchema]).optional(),
|
|
5927
|
-
cache: union([
|
|
5928
|
-
boolean(),
|
|
5929
|
-
ServiceImageConfigSchema,
|
|
5930
|
-
_enum([
|
|
5931
|
-
"upstash",
|
|
5932
|
-
"elasticache",
|
|
5933
|
-
"db"
|
|
5934
|
-
])
|
|
5935
|
-
]).optional(),
|
|
5936
|
-
mail: union([
|
|
5937
|
-
boolean(),
|
|
5938
|
-
MailServiceConfigSchema,
|
|
5939
|
-
_enum([
|
|
5940
|
-
"resend",
|
|
5941
|
-
"ses",
|
|
5942
|
-
"smtp"
|
|
5943
|
-
])
|
|
5944
|
-
]).optional(),
|
|
5945
|
-
storage: union([
|
|
5946
|
-
boolean(),
|
|
5947
|
-
ServiceImageConfigSchema,
|
|
5948
|
-
_enum([
|
|
5949
|
-
"minio",
|
|
5950
|
-
"s3",
|
|
5951
|
-
"r2"
|
|
5952
|
-
])
|
|
5953
|
-
]).optional(),
|
|
5954
|
-
events: _enum([
|
|
5955
|
-
"pgboss",
|
|
5956
|
-
"sns",
|
|
5957
|
-
"rabbitmq"
|
|
5958
|
-
]).optional(),
|
|
5959
|
-
trustLocalCa: boolean().optional()
|
|
5960
|
-
});
|
|
5961
|
-
/**
|
|
5962
5791
|
* Dokploy workspace configuration schema.
|
|
5963
5792
|
* Supports either a single endpoint or per-stage endpoints.
|
|
5964
5793
|
*/
|
|
5965
5794
|
const DokployWorkspaceConfigSchema = object({
|
|
5795
|
+
/** Single endpoint for all stages */
|
|
5966
5796
|
endpoint: url("Dokploy endpoint must be a valid URL").optional(),
|
|
5797
|
+
/** Per-stage endpoints (stage name -> endpoint URL) */
|
|
5967
5798
|
endpoints: record(string(), url("Endpoint must be a valid URL")).optional(),
|
|
5968
5799
|
registry: string().optional(),
|
|
5969
5800
|
registryId: string().optional(),
|
|
5801
|
+
/** Per-stage domain configuration (stage name -> base domain) */
|
|
5970
5802
|
domains: record(string(), string()).optional()
|
|
5971
5803
|
}).refine((data) => data.endpoint || data.endpoints, { message: "Either endpoint or endpoints must be provided" });
|
|
5972
5804
|
/**
|
|
@@ -6014,30 +5846,31 @@ const DnsRecordTypeSchema = _enum([
|
|
|
6014
5846
|
"SRV",
|
|
6015
5847
|
"CAA"
|
|
6016
5848
|
]);
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
*/
|
|
6020
|
-
const DnsRecordSchema = object({
|
|
5849
|
+
object({
|
|
5850
|
+
/** Subdomain name (e.g., 'api' for api.example.com, '@' for root) */
|
|
6021
5851
|
name: string(),
|
|
5852
|
+
/** Record type */
|
|
6022
5853
|
type: DnsRecordTypeSchema,
|
|
5854
|
+
/** TTL in seconds */
|
|
6023
5855
|
ttl: number().int().positive(),
|
|
5856
|
+
/** Record values */
|
|
6024
5857
|
values: array(string())
|
|
6025
5858
|
});
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
/**
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
record: UpsertDnsRecordSchema,
|
|
5859
|
+
object({
|
|
5860
|
+
/** The record that was upserted */
|
|
5861
|
+
record: object({
|
|
5862
|
+
/** Subdomain name (e.g., 'api' for api.example.com, '@' for root) */
|
|
5863
|
+
name: string(),
|
|
5864
|
+
/** Record type */
|
|
5865
|
+
type: DnsRecordTypeSchema,
|
|
5866
|
+
/** TTL in seconds */
|
|
5867
|
+
ttl: number().int().positive(),
|
|
5868
|
+
/** Record value (IP address, hostname, etc.) */
|
|
5869
|
+
value: string()
|
|
5870
|
+
}),
|
|
5871
|
+
/** Whether the record was created (true) or updated (false) */
|
|
6040
5872
|
created: boolean(),
|
|
5873
|
+
/** Whether the record already existed with the same value */
|
|
6041
5874
|
unchanged: boolean()
|
|
6042
5875
|
});
|
|
6043
5876
|
/**
|
|
@@ -6045,6 +5878,7 @@ const UpsertResultSchema = object({
|
|
|
6045
5878
|
*/
|
|
6046
5879
|
const HostingerDnsProviderSchema = object({
|
|
6047
5880
|
provider: literal("hostinger"),
|
|
5881
|
+
/** TTL in seconds (default: 300) */
|
|
6048
5882
|
ttl: number().int().positive().optional()
|
|
6049
5883
|
});
|
|
6050
5884
|
/**
|
|
@@ -6052,9 +5886,13 @@ const HostingerDnsProviderSchema = object({
|
|
|
6052
5886
|
*/
|
|
6053
5887
|
const Route53DnsProviderSchema = object({
|
|
6054
5888
|
provider: literal("route53"),
|
|
5889
|
+
/** AWS region (optional - uses AWS_REGION env var if not provided) */
|
|
6055
5890
|
region: AwsRegionSchema.optional(),
|
|
5891
|
+
/** AWS profile name (optional - uses default credential chain if not provided) */
|
|
6056
5892
|
profile: string().optional(),
|
|
5893
|
+
/** Hosted zone ID (optional - auto-detected from domain if not provided) */
|
|
6057
5894
|
hostedZoneId: string().optional(),
|
|
5895
|
+
/** TTL in seconds (default: 300) */
|
|
6058
5896
|
ttl: number().int().positive().optional()
|
|
6059
5897
|
});
|
|
6060
5898
|
/**
|
|
@@ -6062,6 +5900,7 @@ const Route53DnsProviderSchema = object({
|
|
|
6062
5900
|
*/
|
|
6063
5901
|
const CloudflareDnsProviderSchema = object({
|
|
6064
5902
|
provider: literal("cloudflare"),
|
|
5903
|
+
/** TTL in seconds (default: 300) */
|
|
6065
5904
|
ttl: number().int().positive().optional()
|
|
6066
5905
|
});
|
|
6067
5906
|
/**
|
|
@@ -6072,22 +5911,20 @@ const ManualDnsProviderSchema = object({ provider: literal("manual") });
|
|
|
6072
5911
|
* Custom DNS provider config (user-provided implementation).
|
|
6073
5912
|
*/
|
|
6074
5913
|
const CustomDnsProviderSchema = object({
|
|
5914
|
+
/** Custom DnsProvider implementation */
|
|
6075
5915
|
provider: custom((val) => typeof val === "object" && val !== null && typeof val.name === "string" && typeof val.getRecords === "function" && typeof val.upsertRecords === "function", { message: "Custom DNS provider must implement name, getRecords(), and upsertRecords() methods" }),
|
|
5916
|
+
/** TTL in seconds (default: 300) */
|
|
6076
5917
|
ttl: number().int().positive().optional()
|
|
6077
5918
|
});
|
|
6078
5919
|
/**
|
|
6079
|
-
*
|
|
5920
|
+
* Single DNS provider config (for one domain).
|
|
6080
5921
|
*/
|
|
6081
|
-
const
|
|
5922
|
+
const DnsProviderSchema = union([discriminatedUnion("provider", [
|
|
6082
5923
|
HostingerDnsProviderSchema,
|
|
6083
5924
|
Route53DnsProviderSchema,
|
|
6084
5925
|
CloudflareDnsProviderSchema,
|
|
6085
5926
|
ManualDnsProviderSchema
|
|
6086
|
-
]);
|
|
6087
|
-
/**
|
|
6088
|
-
* Single DNS provider config (for one domain).
|
|
6089
|
-
*/
|
|
6090
|
-
const DnsProviderSchema = union([BuiltInDnsProviderSchema, CustomDnsProviderSchema]);
|
|
5927
|
+
]), CustomDnsProviderSchema]);
|
|
6091
5928
|
/**
|
|
6092
5929
|
* DNS configuration schema.
|
|
6093
5930
|
*
|
|
@@ -6113,17 +5950,15 @@ const Route53DnsConfigSchema = Route53DnsProviderSchema.extend({ domain: string(
|
|
|
6113
5950
|
const CloudflareDnsConfigSchema = CloudflareDnsProviderSchema.extend({ domain: string().min(1, "Domain is required") });
|
|
6114
5951
|
const ManualDnsConfigSchema = ManualDnsProviderSchema.extend({ domain: string().min(1, "Domain is required") });
|
|
6115
5952
|
const CustomDnsConfigSchema = CustomDnsProviderSchema.extend({ domain: string().min(1, "Domain is required") });
|
|
6116
|
-
|
|
5953
|
+
/**
|
|
5954
|
+
* Combined DNS config that supports both new multi-domain and legacy single-domain formats.
|
|
5955
|
+
*/
|
|
5956
|
+
const DnsConfigWithLegacySchema = union([DnsConfigSchema, union([discriminatedUnion("provider", [
|
|
6117
5957
|
HostingerDnsConfigSchema,
|
|
6118
5958
|
Route53DnsConfigSchema,
|
|
6119
5959
|
CloudflareDnsConfigSchema,
|
|
6120
5960
|
ManualDnsConfigSchema
|
|
6121
|
-
]);
|
|
6122
|
-
const LegacyDnsConfigSchema = union([BuiltInDnsConfigSchema, CustomDnsConfigSchema]);
|
|
6123
|
-
/**
|
|
6124
|
-
* Combined DNS config that supports both new multi-domain and legacy single-domain formats.
|
|
6125
|
-
*/
|
|
6126
|
-
const DnsConfigWithLegacySchema = union([DnsConfigSchema, LegacyDnsConfigSchema]);
|
|
5961
|
+
]), CustomDnsConfigSchema])]);
|
|
6127
5962
|
/**
|
|
6128
5963
|
* Backups configuration schema.
|
|
6129
5964
|
*
|
|
@@ -6131,10 +5966,15 @@ const DnsConfigWithLegacySchema = union([DnsConfigSchema, LegacyDnsConfigSchema]
|
|
|
6131
5966
|
* On first deploy, creates S3 bucket with unique name and IAM credentials.
|
|
6132
5967
|
*/
|
|
6133
5968
|
const BackupsConfigSchema = object({
|
|
5969
|
+
/** Backup storage type (currently only 's3' supported) */
|
|
6134
5970
|
type: literal("s3"),
|
|
5971
|
+
/** AWS profile name for creating bucket/IAM resources */
|
|
6135
5972
|
profile: string().optional(),
|
|
5973
|
+
/** AWS region for the backup bucket */
|
|
6136
5974
|
region: AwsRegionSchema,
|
|
5975
|
+
/** Cron schedule for backups (default: '0 2 * * *' = 2 AM daily) */
|
|
6137
5976
|
schedule: string().optional(),
|
|
5977
|
+
/** Number of backups to retain (default: 30) */
|
|
6138
5978
|
retention: number().optional()
|
|
6139
5979
|
});
|
|
6140
5980
|
/**
|
|
@@ -6187,17 +6027,17 @@ const LocalStateConfigSchema = object({ provider: literal("local") });
|
|
|
6187
6027
|
*/
|
|
6188
6028
|
const SSMStateConfigSchema = object({
|
|
6189
6029
|
provider: literal("ssm"),
|
|
6030
|
+
/** AWS region (required for SSM provider) */
|
|
6190
6031
|
region: AwsRegionSchema,
|
|
6032
|
+
/** AWS profile name (optional - uses default credential chain if not provided) */
|
|
6191
6033
|
profile: string().optional()
|
|
6192
6034
|
});
|
|
6193
6035
|
/**
|
|
6194
6036
|
* Custom state provider config (user-provided implementation).
|
|
6195
6037
|
*/
|
|
6196
|
-
const CustomStateConfigSchema = object({
|
|
6197
|
-
/**
|
|
6198
|
-
|
|
6199
|
-
*/
|
|
6200
|
-
const BuiltInStateConfigSchema = discriminatedUnion("provider", [LocalStateConfigSchema, SSMStateConfigSchema]);
|
|
6038
|
+
const CustomStateConfigSchema = object({
|
|
6039
|
+
/** Custom StateProvider implementation */
|
|
6040
|
+
provider: custom((val) => typeof val === "object" && val !== null && typeof val.read === "function" && typeof val.write === "function", { message: "Custom provider must implement read() and write() methods" }) });
|
|
6201
6041
|
/**
|
|
6202
6042
|
* State configuration schema.
|
|
6203
6043
|
*
|
|
@@ -6206,7 +6046,7 @@ const BuiltInStateConfigSchema = discriminatedUnion("provider", [LocalStateConfi
|
|
|
6206
6046
|
* - 'ssm': Store in AWS SSM Parameter Store (requires region)
|
|
6207
6047
|
* - Custom: Provide a StateProvider implementation with read/write methods
|
|
6208
6048
|
*/
|
|
6209
|
-
const StateConfigSchema = union([
|
|
6049
|
+
const StateConfigSchema = union([discriminatedUnion("provider", [LocalStateConfigSchema, SSMStateConfigSchema]), CustomStateConfigSchema]);
|
|
6210
6050
|
/**
|
|
6211
6051
|
* App configuration schema.
|
|
6212
6052
|
*/
|
|
@@ -6271,15 +6111,31 @@ const AppConfigSchema = object({
|
|
|
6271
6111
|
*/
|
|
6272
6112
|
const WorkspaceConfigSchema = object({
|
|
6273
6113
|
name: string().optional(),
|
|
6114
|
+
/**
|
|
6115
|
+
* Where the workspace's own constructs live, relative to its root.
|
|
6116
|
+
*
|
|
6117
|
+
* Infrastructure is a fact about the product, not about the process that
|
|
6118
|
+
* happens to import it — so a database two apps share is declared once,
|
|
6119
|
+
* at the top, and both find it. An app-level glob still works and is
|
|
6120
|
+
* additive, for something only one app uses.
|
|
6121
|
+
*/
|
|
6274
6122
|
constructs: RoutesSchema.optional(),
|
|
6123
|
+
/**
|
|
6124
|
+
* Apps that nothing declares.
|
|
6125
|
+
*
|
|
6126
|
+
* Optional, and normally absent: a `site` is an app and so is a
|
|
6127
|
+
* `rest-api` that named one, so the list is read off the graph. This is
|
|
6128
|
+
* the escape hatch for what no construct describes — a mobile app, a
|
|
6129
|
+
* process someone runs by hand — and for overriding one field of a
|
|
6130
|
+
* derived app without restating it.
|
|
6131
|
+
*/
|
|
6275
6132
|
apps: record(string(), AppConfigSchema).optional(),
|
|
6276
6133
|
shared: SharedConfigSchema.optional(),
|
|
6277
6134
|
deploy: DeployConfigSchema.optional(),
|
|
6278
|
-
services: ServicesConfigSchema.optional(),
|
|
6279
6135
|
stages: StagesConfigSchema,
|
|
6280
6136
|
secrets: SecretsConfigSchema.optional(),
|
|
6281
6137
|
state: StateConfigSchema.optional()
|
|
6282
|
-
}).refine((data) => {
|
|
6138
|
+
}).strict().refine((data) => {
|
|
6283
6139
|
const appNames = Object.keys(data.apps ?? {});
|
|
6284
6140
|
for (const [appName, app] of Object.entries(data.apps ?? {})) for (const dep of app.dependencies ?? []) {
|
|
6285
6141
|
if (!appNames.includes(dep)) return false;
|
|
@@ -6338,14 +6194,14 @@ const WorkspaceConfigSchema = object({
|
|
|
6338
6194
|
* Validate workspace configuration.
|
|
6339
6195
|
* Throws ZodError with detailed messages on validation failure.
|
|
6340
6196
|
*/
|
|
6341
|
-
function validateWorkspaceConfig(config
|
|
6342
|
-
return WorkspaceConfigSchema.parse(config
|
|
6197
|
+
function validateWorkspaceConfig(config) {
|
|
6198
|
+
return WorkspaceConfigSchema.parse(config);
|
|
6343
6199
|
}
|
|
6344
6200
|
/**
|
|
6345
6201
|
* Safe validation that returns result instead of throwing.
|
|
6346
6202
|
*/
|
|
6347
|
-
function safeValidateWorkspaceConfig(config
|
|
6348
|
-
const result = WorkspaceConfigSchema.safeParse(config
|
|
6203
|
+
function safeValidateWorkspaceConfig(config) {
|
|
6204
|
+
const result = WorkspaceConfigSchema.safeParse(config);
|
|
6349
6205
|
if (result.success) return {
|
|
6350
6206
|
success: true,
|
|
6351
6207
|
data: result.data
|
|
@@ -6358,14 +6214,12 @@ function safeValidateWorkspaceConfig(config$1) {
|
|
|
6358
6214
|
/**
|
|
6359
6215
|
* Format Zod errors into user-friendly messages.
|
|
6360
6216
|
*/
|
|
6361
|
-
function formatValidationErrors(error
|
|
6362
|
-
|
|
6363
|
-
const path = issue
|
|
6364
|
-
return path ? ` - ${path}: ${issue
|
|
6365
|
-
})
|
|
6366
|
-
return `Workspace configuration validation failed:\n${messages.join("\n")}`;
|
|
6217
|
+
function formatValidationErrors(error) {
|
|
6218
|
+
return `Workspace configuration validation failed:\n${error.issues.map((issue) => {
|
|
6219
|
+
const path = issue.path.join(".");
|
|
6220
|
+
return path ? ` - ${path}: ${issue.message}` : ` - ${issue.message}`;
|
|
6221
|
+
}).join("\n")}`;
|
|
6367
6222
|
}
|
|
6368
|
-
|
|
6369
6223
|
//#endregion
|
|
6370
6224
|
//#region src/workspace/types.ts
|
|
6371
6225
|
/**
|
|
@@ -6380,12 +6234,22 @@ function formatValidationErrors(error$1) {
|
|
|
6380
6234
|
* }
|
|
6381
6235
|
* ```
|
|
6382
6236
|
*/
|
|
6383
|
-
function isWorkspaceConfig(config
|
|
6384
|
-
if (typeof config
|
|
6385
|
-
if ("apps" in config
|
|
6386
|
-
return "constructs" in config
|
|
6387
|
-
}
|
|
6388
|
-
|
|
6237
|
+
function isWorkspaceConfig(config) {
|
|
6238
|
+
if (typeof config !== "object" || config === null) return false;
|
|
6239
|
+
if ("apps" in config && typeof config.apps === "object") return true;
|
|
6240
|
+
return "constructs" in config && Object.keys(config).every((key) => WORKSPACE_KEYS.has(key));
|
|
6241
|
+
}
|
|
6242
|
+
/** Every top-level key a workspace config has — see `WorkspaceConfigSchema`. */
|
|
6243
|
+
const WORKSPACE_KEYS = /* @__PURE__ */ new Set([
|
|
6244
|
+
"name",
|
|
6245
|
+
"constructs",
|
|
6246
|
+
"apps",
|
|
6247
|
+
"shared",
|
|
6248
|
+
"deploy",
|
|
6249
|
+
"stages",
|
|
6250
|
+
"secrets",
|
|
6251
|
+
"state"
|
|
6252
|
+
]);
|
|
6389
6253
|
//#endregion
|
|
6390
6254
|
//#region src/workspace/index.ts
|
|
6391
6255
|
/**
|
|
@@ -6431,52 +6295,46 @@ function validateDependencies(apps) {
|
|
|
6431
6295
|
* dependencies: ['api'], // <- autocomplete shows 'api' | 'web'
|
|
6432
6296
|
* },
|
|
6433
6297
|
* },
|
|
6434
|
-
* services: {
|
|
6435
|
-
* db: true,
|
|
6436
|
-
* cache: true,
|
|
6437
|
-
* },
|
|
6438
6298
|
* });
|
|
6439
6299
|
*
|
|
6440
6300
|
* // config.apps.api <- full type inference
|
|
6441
6301
|
* // config.apps.foo <- TypeScript error
|
|
6442
6302
|
* ```
|
|
6443
6303
|
*/
|
|
6444
|
-
function defineWorkspace(config
|
|
6445
|
-
if (config
|
|
6446
|
-
const result = safeValidateWorkspaceConfig(config
|
|
6304
|
+
function defineWorkspace(config) {
|
|
6305
|
+
if (config.apps) validateDependencies(config.apps);
|
|
6306
|
+
const result = safeValidateWorkspaceConfig(config);
|
|
6447
6307
|
if (!result.success && result.error) throw new Error(formatValidationErrors(result.error));
|
|
6448
|
-
return config
|
|
6308
|
+
return config;
|
|
6449
6309
|
}
|
|
6450
6310
|
/**
|
|
6451
6311
|
* Get the package name from package.json in the given directory.
|
|
6452
6312
|
*/
|
|
6453
6313
|
function getPackageName(cwd) {
|
|
6454
6314
|
try {
|
|
6455
|
-
|
|
6456
|
-
return pkg.name?.replace(/^@[^/]+\//, "");
|
|
6315
|
+
return __require(`${cwd}/package.json`).name?.replace(/^@[^/]+\//, "");
|
|
6457
6316
|
} catch {
|
|
6458
|
-
return
|
|
6317
|
+
return;
|
|
6459
6318
|
}
|
|
6460
6319
|
}
|
|
6461
6320
|
/**
|
|
6462
6321
|
* Normalize a workspace configuration with resolved defaults.
|
|
6463
6322
|
*/
|
|
6464
|
-
function normalizeWorkspace(config
|
|
6465
|
-
const name = config
|
|
6466
|
-
const defaultTarget = config
|
|
6323
|
+
function normalizeWorkspace(config, cwd) {
|
|
6324
|
+
const name = config.name ?? getPackageName(cwd) ?? basename(cwd);
|
|
6325
|
+
const defaultTarget = config.deploy?.default ?? "dokploy";
|
|
6467
6326
|
const normalizedApps = {};
|
|
6468
|
-
for (const [appName, app] of Object.entries(config
|
|
6327
|
+
for (const [appName, app] of Object.entries(config.apps ?? {})) normalizedApps[appName] = normalizeAppConfig(app, defaultTarget);
|
|
6469
6328
|
return {
|
|
6470
6329
|
name,
|
|
6471
6330
|
root: cwd,
|
|
6472
|
-
...config
|
|
6331
|
+
...config.constructs ? { constructs: config.constructs } : {},
|
|
6473
6332
|
apps: normalizedApps,
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
state: config$1.state
|
|
6333
|
+
deploy: config.deploy ?? { default: "dokploy" },
|
|
6334
|
+
shared: config.shared ?? { packages: ["packages/*"] },
|
|
6335
|
+
stages: validateStages(config.stages),
|
|
6336
|
+
secrets: config.secrets ?? {},
|
|
6337
|
+
state: config.state
|
|
6480
6338
|
};
|
|
6481
6339
|
}
|
|
6482
6340
|
/**
|
|
@@ -6498,35 +6356,31 @@ function normalizeAppConfig(app, defaultTarget) {
|
|
|
6498
6356
|
* Wrap a single-app GkmConfig as a workspace.
|
|
6499
6357
|
* This allows existing single-app configs to work seamlessly.
|
|
6500
6358
|
*/
|
|
6501
|
-
function wrapSingleAppAsWorkspace(config
|
|
6502
|
-
const name = config$1.name ?? getPackageName(cwd) ?? basename(cwd);
|
|
6503
|
-
const normalizedServices = { ...config$1.services ?? {} };
|
|
6504
|
-
const app = {
|
|
6505
|
-
type: "backend",
|
|
6506
|
-
path: ".",
|
|
6507
|
-
port: (typeof config$1.providers?.server === "object" ? config$1.providers.server.port : void 0) ?? 3e3,
|
|
6508
|
-
dependencies: [],
|
|
6509
|
-
resolvedDeployTarget: config$1.deploy?.default ?? "dokploy",
|
|
6510
|
-
constructs: config$1.constructs,
|
|
6511
|
-
providers: config$1.providers,
|
|
6512
|
-
hooks: config$1.hooks,
|
|
6513
|
-
telescope: config$1.telescope,
|
|
6514
|
-
studio: config$1.studio,
|
|
6515
|
-
openapi: config$1.openapi,
|
|
6516
|
-
runtime: config$1.runtime,
|
|
6517
|
-
env: config$1.env
|
|
6518
|
-
};
|
|
6359
|
+
function wrapSingleAppAsWorkspace(config, cwd) {
|
|
6519
6360
|
return {
|
|
6520
|
-
name,
|
|
6361
|
+
name: config.name ?? getPackageName(cwd) ?? basename(cwd),
|
|
6521
6362
|
root: cwd,
|
|
6522
|
-
apps: { api:
|
|
6523
|
-
|
|
6363
|
+
apps: { api: {
|
|
6364
|
+
type: "backend",
|
|
6365
|
+
path: ".",
|
|
6366
|
+
port: (typeof config.providers?.server === "object" ? config.providers.server.port : void 0) ?? 3e3,
|
|
6367
|
+
dependencies: [],
|
|
6368
|
+
resolvedDeployTarget: config.deploy?.default ?? "dokploy",
|
|
6369
|
+
constructs: config.constructs,
|
|
6370
|
+
providers: config.providers,
|
|
6371
|
+
hooks: config.hooks,
|
|
6372
|
+
telescope: config.telescope,
|
|
6373
|
+
studio: config.studio,
|
|
6374
|
+
openapi: config.openapi,
|
|
6375
|
+
runtime: config.runtime,
|
|
6376
|
+
env: config.env
|
|
6377
|
+
} },
|
|
6524
6378
|
deploy: {
|
|
6525
6379
|
default: "dokploy",
|
|
6526
|
-
...config
|
|
6380
|
+
...config.deploy
|
|
6527
6381
|
},
|
|
6528
6382
|
shared: { packages: [] },
|
|
6529
|
-
stages: validateStages(config
|
|
6383
|
+
stages: validateStages(config.stages),
|
|
6530
6384
|
secrets: {}
|
|
6531
6385
|
};
|
|
6532
6386
|
}
|
|
@@ -6534,20 +6388,20 @@ function wrapSingleAppAsWorkspace(config$1, cwd) {
|
|
|
6534
6388
|
* Process a loaded configuration (either single-app or workspace).
|
|
6535
6389
|
* Returns a normalized workspace in both cases.
|
|
6536
6390
|
*/
|
|
6537
|
-
function processConfig(config
|
|
6538
|
-
if (isWorkspaceConfig(config
|
|
6539
|
-
const result = safeValidateWorkspaceConfig(config
|
|
6391
|
+
function processConfig(config, cwd) {
|
|
6392
|
+
if (isWorkspaceConfig(config)) {
|
|
6393
|
+
const result = safeValidateWorkspaceConfig(config);
|
|
6540
6394
|
if (!result.success && result.error) throw new Error(formatValidationErrors(result.error));
|
|
6541
6395
|
return {
|
|
6542
6396
|
type: "workspace",
|
|
6543
|
-
raw: config
|
|
6544
|
-
workspace: normalizeWorkspace(config
|
|
6397
|
+
raw: config,
|
|
6398
|
+
workspace: normalizeWorkspace(config, cwd)
|
|
6545
6399
|
};
|
|
6546
6400
|
}
|
|
6547
6401
|
return {
|
|
6548
6402
|
type: "single",
|
|
6549
|
-
raw: config
|
|
6550
|
-
workspace: wrapSingleAppAsWorkspace(config
|
|
6403
|
+
raw: config,
|
|
6404
|
+
workspace: wrapSingleAppAsWorkspace(config, cwd)
|
|
6551
6405
|
};
|
|
6552
6406
|
}
|
|
6553
6407
|
/**
|
|
@@ -6604,9 +6458,9 @@ function constructPatterns(routes) {
|
|
|
6604
6458
|
*/
|
|
6605
6459
|
function getAppGkmConfig(workspace, appName) {
|
|
6606
6460
|
const app = workspace.apps[appName];
|
|
6607
|
-
if (!app || app.type !== "backend") return
|
|
6461
|
+
if (!app || app.type !== "backend") return;
|
|
6608
6462
|
return {
|
|
6609
|
-
|
|
6463
|
+
...workspace.deploy ? { deploy: workspace.deploy } : {},
|
|
6610
6464
|
stages: workspace.stages,
|
|
6611
6465
|
constructs: appConstructGlobs(workspace, appName),
|
|
6612
6466
|
providers: app.providers,
|
|
@@ -6653,10 +6507,10 @@ function getDependencyEnvVars(workspace, appName, urlPrefix = "http://localhost"
|
|
|
6653
6507
|
for (const depName of app.dependencies) {
|
|
6654
6508
|
const dep = workspace.apps[depName];
|
|
6655
6509
|
if (dep) {
|
|
6656
|
-
const url
|
|
6510
|
+
const url = `${urlPrefix}:${dep.port}`;
|
|
6657
6511
|
const envKey = `${depName.toUpperCase()}_URL`;
|
|
6658
|
-
env[envKey] = url
|
|
6659
|
-
if (publicPrefix) env[`${publicPrefix}${envKey}`] = url
|
|
6512
|
+
env[envKey] = url;
|
|
6513
|
+
if (publicPrefix) env[`${publicPrefix}${envKey}`] = url;
|
|
6660
6514
|
}
|
|
6661
6515
|
}
|
|
6662
6516
|
return env;
|
|
@@ -6692,7 +6546,7 @@ function getEndpointForStage(dokployConfig, stage) {
|
|
|
6692
6546
|
if (dokployConfig.endpoints?.[stage]) return dokployConfig.endpoints[stage];
|
|
6693
6547
|
return dokployConfig.endpoint;
|
|
6694
6548
|
}
|
|
6695
|
-
|
|
6696
6549
|
//#endregion
|
|
6697
|
-
export { InvalidStages
|
|
6698
|
-
|
|
6550
|
+
export { InvalidStages as C, PUBLIC_ENV_PREFIXES as D, stageProblems as E, getPublicEnvPrefix as O, validateWorkspaceConfig as S, deployedProblems as T, formatValidationErrors as _, getAppBuildOrder as a, isPhase2DeployTarget as b, getEndpointForStage as c, workspaceConstructGlobs as d, wrapSingleAppAsWorkspace as f, WorkspaceConfigSchema as g, SUPPORTED_DEPLOY_TARGETS as h, defineWorkspace as i, stripPublicPrefix as k, normalizeWorkspace as l, PHASE_2_DEPLOY_TARGETS as m, appConstructGlobs as n, getAppGkmConfig as o, isWorkspaceConfig as p, constructPatterns as r, getDependencyEnvVars as s, allConstructGlobs as t, processConfig as u, getDeployTargetError as v, assertDeployedStage as w, safeValidateWorkspaceConfig as x, isDeployTargetSupported as y };
|
|
6551
|
+
|
|
6552
|
+
//# sourceMappingURL=workspace-CgwmXEtc.mjs.map
|