@geekmidas/cli 10.0.0-alpha.9 → 10.0.0-alpha.91
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 +315 -414
- package/bin/adjacent-tsconfig.mjs +46 -8
- package/bin/gkm.mjs +11 -3
- package/bin/owning-tsconfig-jsx-register.mjs +18 -0
- package/bin/owning-tsconfig-jsx.mjs +108 -0
- package/dist/EndpointGenerator-CVc6Oi1Y.mjs +1021 -0
- package/dist/EndpointGenerator-CVc6Oi1Y.mjs.map +1 -0
- package/dist/EndpointGenerator-CwLjBCFE.cjs +1080 -0
- package/dist/EndpointGenerator-CwLjBCFE.cjs.map +1 -0
- package/dist/GoDaddyProvider-DSStJVAv.mjs +387 -0
- package/dist/GoDaddyProvider-DSStJVAv.mjs.map +1 -0
- package/dist/GoDaddyProvider-DqZ1qD_F.cjs +387 -0
- package/dist/GoDaddyProvider-DqZ1qD_F.cjs.map +1 -0
- package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-BI6J7oJr.mjs} +22 -23
- package/dist/HostingerProvider-BI6J7oJr.mjs.map +1 -0
- package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-CyTpG_jy.cjs} +22 -23
- package/dist/HostingerProvider-CyTpG_jy.cjs.map +1 -0
- package/dist/LegacyStateStore-DXmNA7hy.cjs +89 -0
- package/dist/LegacyStateStore-DXmNA7hy.cjs.map +1 -0
- package/dist/LegacyStateStore-ZkdmiUFZ.mjs +89 -0
- package/dist/LegacyStateStore-ZkdmiUFZ.mjs.map +1 -0
- package/dist/LocalStateStore-BBeTlRTH.cjs +178 -0
- package/dist/LocalStateStore-BBeTlRTH.cjs.map +1 -0
- package/dist/LocalStateStore-CU-O0SBp.mjs +167 -0
- package/dist/LocalStateStore-CU-O0SBp.mjs.map +1 -0
- package/dist/OpenApiTsGenerator-B--HV-sW.cjs +541 -0
- package/dist/OpenApiTsGenerator-B--HV-sW.cjs.map +1 -0
- package/dist/OpenApiTsGenerator-CkvsPdgg.mjs +536 -0
- package/dist/OpenApiTsGenerator-CkvsPdgg.mjs.map +1 -0
- package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-Bllus2NR.cjs} +21 -22
- package/dist/Route53Provider-Bllus2NR.cjs.map +1 -0
- package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-QXxjkZO1.mjs} +13 -13
- package/dist/Route53Provider-QXxjkZO1.mjs.map +1 -0
- package/dist/S3StateStore-Br8VMY22.cjs +160 -0
- package/dist/S3StateStore-Br8VMY22.cjs.map +1 -0
- package/dist/S3StateStore-bwxcI_wQ.mjs +161 -0
- package/dist/S3StateStore-bwxcI_wQ.mjs.map +1 -0
- package/dist/SSMStateStore-CsOS0W1y.mjs +154 -0
- package/dist/SSMStateStore-CsOS0W1y.mjs.map +1 -0
- package/dist/SSMStateStore-DoZE1Wi1.cjs +153 -0
- package/dist/SSMStateStore-DoZE1Wi1.cjs.map +1 -0
- package/dist/SubscriberGenerator-BPqQf8fB.mjs +448 -0
- package/dist/SubscriberGenerator-BPqQf8fB.mjs.map +1 -0
- package/dist/SubscriberGenerator-BVn7cQ-2.cjs +489 -0
- package/dist/SubscriberGenerator-BVn7cQ-2.cjs.map +1 -0
- package/dist/add-BSHk5Ngn.mjs +747 -0
- package/dist/add-BSHk5Ngn.mjs.map +1 -0
- package/dist/add-DmmBDV2e.cjs +749 -0
- package/dist/add-DmmBDV2e.cjs.map +1 -0
- package/dist/appPorts-C9z9Pzn9.mjs +223 -0
- package/dist/appPorts-C9z9Pzn9.mjs.map +1 -0
- package/dist/appPorts-Cu79hJF6.cjs +264 -0
- package/dist/appPorts-Cu79hJF6.cjs.map +1 -0
- package/dist/aws-B-6uEhgP.mjs +71 -0
- package/dist/aws-B-6uEhgP.mjs.map +1 -0
- package/dist/aws-BTawF0F-.cjs +82 -0
- package/dist/aws-BTawF0F-.cjs.map +1 -0
- package/dist/awsStore-7VmS_cZR.cjs +54 -0
- package/dist/awsStore-7VmS_cZR.cjs.map +1 -0
- package/dist/awsStore-B529csle.mjs +43 -0
- package/dist/awsStore-B529csle.mjs.map +1 -0
- package/dist/{backup-provisioner-Bgj5Vi_L.mjs → backup-provisioner-C8DnCmxK.mjs} +11 -8
- package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
- package/dist/{backup-provisioner-BrsHwYG0.cjs → backup-provisioner-oDEsPj02.cjs} +22 -20
- package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
- package/dist/{bundler-BY1OmV1e.cjs → bundler-BQJiB7Ub.cjs} +38 -35
- package/dist/bundler-BQJiB7Ub.cjs.map +1 -0
- package/dist/{bundler-Be8Zg4Wd.mjs → bundler-D6eBfVkl.mjs} +36 -32
- package/dist/bundler-D6eBfVkl.mjs.map +1 -0
- package/dist/cli-BE9mqeX8.cjs +69 -0
- package/dist/cli-BE9mqeX8.cjs.map +1 -0
- package/dist/cli-DD-Yk-I5.mjs +69 -0
- package/dist/cli-DD-Yk-I5.mjs.map +1 -0
- package/dist/compose-Bhmf0n4o.mjs +3140 -0
- package/dist/compose-Bhmf0n4o.mjs.map +1 -0
- package/dist/compose-CvpU6ooi.cjs +3265 -0
- package/dist/compose-CvpU6ooi.cjs.map +1 -0
- package/dist/config-CdEcTrjG.d.mts +269 -0
- package/dist/config-CdEcTrjG.d.mts.map +1 -0
- package/dist/config-pST7E0CS.d.cts +269 -0
- package/dist/config-pST7E0CS.d.cts.map +1 -0
- package/dist/config.cjs +420 -11
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +4 -120
- package/dist/config.d.mts +4 -120
- package/dist/config.mjs +404 -4
- package/dist/config.mjs.map +1 -0
- package/dist/credentialSchemas-BJqRJNK4.mjs +236 -0
- package/dist/credentialSchemas-BJqRJNK4.mjs.map +1 -0
- package/dist/credentialSchemas-DCR4Wd1W.cjs +271 -0
- package/dist/credentialSchemas-DCR4Wd1W.cjs.map +1 -0
- package/dist/credentials-BKfIugu2.cjs +513 -0
- package/dist/credentials-BKfIugu2.cjs.map +1 -0
- package/dist/credentials-CnVqoXMb.mjs +388 -0
- package/dist/credentials-CnVqoXMb.mjs.map +1 -0
- package/dist/databases-BY-pEImp.cjs +597 -0
- package/dist/databases-BY-pEImp.cjs.map +1 -0
- package/dist/databases-CzszQV0N.mjs +494 -0
- package/dist/databases-CzszQV0N.mjs.map +1 -0
- package/dist/define-DR8xGYfL.mjs +97 -0
- package/dist/define-DR8xGYfL.mjs.map +1 -0
- package/dist/define-DzRz8FgH.cjs +144 -0
- package/dist/define-DzRz8FgH.cjs.map +1 -0
- package/dist/deploy/public.cjs +208 -0
- package/dist/deploy/public.cjs.map +1 -0
- package/dist/deploy/public.d.cts +649 -0
- package/dist/deploy/public.d.cts.map +1 -0
- package/dist/deploy/public.d.mts +649 -0
- package/dist/deploy/public.d.mts.map +1 -0
- package/dist/deploy/public.mjs +142 -0
- package/dist/deploy/public.mjs.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-envparser-worker.cjs +54 -0
- package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
- package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
- package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
- package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
- package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
- 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 +10 -3
- 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 +14 -3
- 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 +4 -4
- 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/deploy-CuHasEA4.cjs +554 -0
- package/dist/deploy-CuHasEA4.cjs.map +1 -0
- package/dist/deploy-QNtx_eWR.mjs +525 -0
- package/dist/deploy-QNtx_eWR.mjs.map +1 -0
- package/dist/derive-B4vDpzgP.mjs +150 -0
- package/dist/derive-B4vDpzgP.mjs.map +1 -0
- package/dist/derive-DAbo49sm.cjs +161 -0
- package/dist/derive-DAbo49sm.cjs.map +1 -0
- package/dist/discover-BPelzeGW.mjs +526 -0
- package/dist/discover-BPelzeGW.mjs.map +1 -0
- package/dist/discover-CU0paUyH.d.cts +108 -0
- package/dist/discover-CU0paUyH.d.cts.map +1 -0
- package/dist/discover-D1It5r_h.cjs +599 -0
- package/dist/discover-D1It5r_h.cjs.map +1 -0
- package/dist/discover-DFiJxwfv.d.mts +108 -0
- package/dist/discover-DFiJxwfv.d.mts.map +1 -0
- package/dist/dokploy-CYcMLh9-.mjs +38 -0
- package/dist/dokploy-CYcMLh9-.mjs.map +1 -0
- package/dist/dokploy-DIowwyIB.cjs +38 -0
- package/dist/dokploy-DIowwyIB.cjs.map +1 -0
- package/dist/drivers-DTZzxeIl.mjs +177 -0
- package/dist/drivers-DTZzxeIl.mjs.map +1 -0
- package/dist/drivers-LYSdQDmd.cjs +200 -0
- package/dist/drivers-LYSdQDmd.cjs.map +1 -0
- package/dist/{emit-CiZS_5Ub.mjs → emit-C1e8qD08.mjs} +13 -26
- package/dist/emit-C1e8qD08.mjs.map +1 -0
- package/dist/{emit-CbcRolsa.cjs → emit-Dmc1nvdS.cjs} +31 -57
- package/dist/emit-Dmc1nvdS.cjs.map +1 -0
- package/dist/encryption-BrEef7Jk.mjs +88 -0
- package/dist/encryption-BrEef7Jk.mjs.map +1 -0
- package/dist/encryption-CjYdUb2s.cjs +89 -0
- package/dist/encryption-CjYdUb2s.cjs.map +1 -0
- package/dist/engine-2h4k5ICq.mjs +3085 -0
- package/dist/engine-2h4k5ICq.mjs.map +1 -0
- package/dist/engine-BhJ7ZP9K.cjs +3198 -0
- package/dist/engine-BhJ7ZP9K.cjs.map +1 -0
- package/dist/github-B5Bw4HIu.cjs +669 -0
- package/dist/github-B5Bw4HIu.cjs.map +1 -0
- package/dist/github-BCDF6xVH.mjs +669 -0
- package/dist/github-BCDF6xVH.mjs.map +1 -0
- package/dist/{index-C6e-ULLx.d.mts → index-D-F_hTDz.d.cts} +39 -24
- package/dist/index-D-F_hTDz.d.cts.map +1 -0
- package/dist/{index-CR5urhWX.d.cts → index-YFNxR5Ns.d.mts} +39 -24
- package/dist/index-YFNxR5Ns.d.mts.map +1 -0
- package/dist/index.cjs +9487 -12080
- 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 +9420 -12026
- package/dist/index.mjs.map +1 -1
- package/dist/local-BjxDfPvy.cjs +241 -0
- package/dist/local-BjxDfPvy.cjs.map +1 -0
- package/dist/local-IuoIF3CT.mjs +224 -0
- package/dist/local-IuoIF3CT.mjs.map +1 -0
- package/dist/migrate-CGaancHY.cjs +93 -0
- package/dist/migrate-CGaancHY.cjs.map +1 -0
- package/dist/migrate-DWZz9kah.mjs +93 -0
- package/dist/migrate-DWZz9kah.mjs.map +1 -0
- package/dist/migrate-DbtcuOr_.mjs +265 -0
- package/dist/migrate-DbtcuOr_.mjs.map +1 -0
- package/dist/migrate-q2YYLJLE.cjs +270 -0
- package/dist/migrate-q2YYLJLE.cjs.map +1 -0
- package/dist/openapi.cjs +214 -10
- package/dist/openapi.cjs.map +1 -0
- package/dist/openapi.d.cts +47 -17
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +47 -17
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +208 -5
- package/dist/openapi.mjs.map +1 -0
- package/dist/provider-C9_-45d5.cjs +56 -0
- package/dist/provider-C9_-45d5.cjs.map +1 -0
- package/dist/provider-q4lsYzYG.mjs +45 -0
- package/dist/provider-q4lsYzYG.mjs.map +1 -0
- package/dist/ready-BpNbORRB.cjs +402 -0
- package/dist/ready-BpNbORRB.cjs.map +1 -0
- package/dist/ready-b6vm0-W-.mjs +373 -0
- package/dist/ready-b6vm0-W-.mjs.map +1 -0
- package/dist/reconcile/public.cjs +3 -5
- package/dist/reconcile/public.d.cts +11 -87
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +11 -87
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -4
- package/dist/{reconcile-D0pimNiy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
- package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
- package/dist/{reconcile-CFs8C_1a.mjs → reconcile-Dh1Jk7WE.mjs} +4 -7
- package/dist/reconcile-Dh1Jk7WE.mjs.map +1 -0
- package/dist/resolve-Cns0v6dN.cjs +315 -0
- package/dist/resolve-Cns0v6dN.cjs.map +1 -0
- package/dist/resolve-DNg0icnh.mjs +262 -0
- package/dist/resolve-DNg0icnh.mjs.map +1 -0
- package/dist/rollback-CFrNLmxs.mjs +132 -0
- package/dist/rollback-CFrNLmxs.mjs.map +1 -0
- package/dist/rollback-UIjS25F1.cjs +161 -0
- package/dist/rollback-UIjS25F1.cjs.map +1 -0
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
- package/dist/runtime-CN_kmqxo.d.cts +90 -0
- package/dist/runtime-CN_kmqxo.d.cts.map +1 -0
- package/dist/runtime-Cjvon3oj.d.mts +90 -0
- package/dist/runtime-Cjvon3oj.d.mts.map +1 -0
- package/dist/sandbox/config-worker.cjs +43 -0
- package/dist/sandbox/config-worker.cjs.map +1 -0
- package/dist/sandbox/config-worker.d.cts +1 -0
- package/dist/sandbox/config-worker.d.mts +1 -0
- package/dist/sandbox/config-worker.mjs +44 -0
- package/dist/sandbox/config-worker.mjs.map +1 -0
- package/dist/sandbox/credentials-worker.cjs +54 -0
- package/dist/sandbox/credentials-worker.cjs.map +1 -0
- package/dist/sandbox/credentials-worker.d.cts +1 -0
- package/dist/sandbox/credentials-worker.d.mts +1 -0
- package/dist/sandbox/credentials-worker.mjs +55 -0
- package/dist/sandbox/credentials-worker.mjs.map +1 -0
- package/dist/sandbox/discover-worker.cjs +47 -0
- package/dist/sandbox/discover-worker.cjs.map +1 -0
- package/dist/sandbox/discover-worker.d.cts +1 -0
- package/dist/sandbox/discover-worker.d.mts +1 -0
- package/dist/sandbox/discover-worker.mjs +48 -0
- package/dist/sandbox/discover-worker.mjs.map +1 -0
- package/dist/sandbox/migrate-worker.cjs +75 -0
- package/dist/sandbox/migrate-worker.cjs.map +1 -0
- package/dist/sandbox/migrate-worker.d.cts +1 -0
- package/dist/sandbox/migrate-worker.d.mts +1 -0
- package/dist/sandbox/migrate-worker.mjs +76 -0
- package/dist/sandbox/migrate-worker.mjs.map +1 -0
- package/dist/sandbox-CL--ZDui.cjs +164 -0
- package/dist/sandbox-CL--ZDui.cjs.map +1 -0
- package/dist/sandbox-Dm247NGx.mjs +117 -0
- package/dist/sandbox-Dm247NGx.mjs.map +1 -0
- package/dist/sandbox-M8UnLhXE.d.cts +126 -0
- package/dist/sandbox-M8UnLhXE.d.cts.map +1 -0
- package/dist/sandbox-M8UnLhXE.d.mts +126 -0
- package/dist/sandbox-M8UnLhXE.d.mts.map +1 -0
- package/dist/{workspace-zoqRbihZ.mjs → schemas-BObwxB_t.cjs} +998 -1659
- package/dist/schemas-BObwxB_t.cjs.map +1 -0
- package/dist/{workspace-C6VJQVtG.cjs → schemas-D-xeKJDD.mjs} +913 -1842
- package/dist/schemas-D-xeKJDD.mjs.map +1 -0
- package/dist/secretsManager-Chs9VV2r.mjs +76 -0
- package/dist/secretsManager-Chs9VV2r.mjs.map +1 -0
- package/dist/secretsManager-DcMlHnRC.cjs +87 -0
- package/dist/secretsManager-DcMlHnRC.cjs.map +1 -0
- package/dist/seeds-CkIPFGNO.cjs +10560 -0
- package/dist/seeds-CkIPFGNO.cjs.map +1 -0
- package/dist/seeds-odfgSCmu.mjs +9538 -0
- package/dist/seeds-odfgSCmu.mjs.map +1 -0
- package/dist/sniffer-BTtX3NUM.mjs +1262 -0
- package/dist/sniffer-BTtX3NUM.mjs.map +1 -0
- package/dist/sniffer-IAQEpsQb.cjs +1333 -0
- package/dist/sniffer-IAQEpsQb.cjs.map +1 -0
- package/dist/sst-BgcOsaBi.cjs +453 -0
- package/dist/sst-BgcOsaBi.cjs.map +1 -0
- package/dist/sst-CJzvyrEz.mjs +430 -0
- package/dist/sst-CJzvyrEz.mjs.map +1 -0
- package/dist/stages-CUn6gvXL.cjs +174 -0
- package/dist/stages-CUn6gvXL.cjs.map +1 -0
- package/dist/stages-CnZRYmkI.mjs +174 -0
- package/dist/stages-CnZRYmkI.mjs.map +1 -0
- package/dist/target/public.cjs +15 -0
- package/dist/target/public.d.cts +28 -0
- package/dist/target/public.d.cts.map +1 -0
- package/dist/target/public.d.mts +28 -0
- package/dist/target/public.d.mts.map +1 -0
- package/dist/target/public.mjs +4 -0
- package/dist/terminal-D8TPK7o9.mjs +84 -0
- package/dist/terminal-D8TPK7o9.mjs.map +1 -0
- package/dist/terminal-DuapRxh6.cjs +84 -0
- package/dist/terminal-DuapRxh6.cjs.map +1 -0
- package/dist/types-NqX1Hz4P.d.cts +7454 -0
- package/dist/types-NqX1Hz4P.d.cts.map +1 -0
- package/dist/types-ZHuZ89hv.d.mts +7453 -0
- package/dist/types-ZHuZ89hv.d.mts.map +1 -0
- package/dist/utils-D2Nk1Nv2.cjs +205 -0
- package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
- package/dist/utils-D_fxUqvU.mjs +156 -0
- package/dist/utils-D_fxUqvU.mjs.map +1 -0
- package/dist/vitest.cjs +65 -0
- package/dist/vitest.cjs.map +1 -0
- package/dist/vitest.d.cts +29 -0
- package/dist/vitest.d.cts.map +1 -0
- package/dist/vitest.d.mts +29 -0
- package/dist/vitest.d.mts.map +1 -0
- package/dist/vitest.mjs +65 -0
- package/dist/vitest.mjs.map +1 -0
- package/dist/workerRuntime-BXfhbe13.cjs +108 -0
- package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
- package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
- package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
- package/dist/workspace/index.cjs +8 -4
- 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-CJ0lKFq-.mjs +1979 -0
- package/dist/workspace-CJ0lKFq-.mjs.map +1 -0
- package/dist/workspace-CwW3Gkru.cjs +2355 -0
- package/dist/workspace-CwW3Gkru.cjs.map +1 -0
- package/package.json +53 -22
- package/dist/CachedStateProvider-BLo7zv7S.cjs +0 -3
- package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
- package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
- package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
- package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
- package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
- package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
- package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
- package/dist/LocalStateProvider-Bn6tS-oL.mjs +0 -42
- package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
- package/dist/LocalStateProvider-Db9SEjyH.cjs +0 -43
- package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
- package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
- package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
- package/dist/SSMStateProvider-BRt2py-A.mjs +0 -66
- package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
- package/dist/SSMStateProvider-DyX8s9HI.cjs +0 -66
- package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
- package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
- package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
- package/dist/bundler-BY1OmV1e.cjs.map +0 -1
- package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
- package/dist/chunk-Duj1WY3L.mjs +0 -7
- package/dist/config-BZ1F0WuA.cjs +0 -462
- package/dist/config-BZ1F0WuA.cjs.map +0 -1
- package/dist/config-DVVph9yz.mjs +0 -402
- package/dist/config-DVVph9yz.mjs.map +0 -1
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.mts.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-Xamqe_NJ.cjs +0 -2681
- package/dist/credentials-Xamqe_NJ.cjs.map +0 -1
- package/dist/credentials-dP8vRVRv.mjs +0 -2549
- package/dist/credentials-dP8vRVRv.mjs.map +0 -1
- package/dist/discover-CAlFgYec.mjs +0 -229
- package/dist/discover-CAlFgYec.mjs.map +0 -1
- package/dist/discover-DTmFeloL.cjs +0 -271
- package/dist/discover-DTmFeloL.cjs.map +0 -1
- package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
- package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
- package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
- package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
- package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
- package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
- package/dist/emit-CbcRolsa.cjs.map +0 -1
- package/dist/emit-CiZS_5Ub.mjs.map +0 -1
- package/dist/encryption-C6jaU0hE.cjs +0 -54
- package/dist/encryption-C6jaU0hE.cjs.map +0 -1
- package/dist/encryption-CHzzeR8a.cjs +0 -4
- package/dist/encryption-CQUncu7v.mjs +0 -3
- package/dist/encryption-D-abyhZx.mjs +0 -42
- package/dist/encryption-D-abyhZx.mjs.map +0 -1
- package/dist/fullstack-secrets-C-GGohke.cjs +0 -111
- package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
- package/dist/fullstack-secrets-D1o9-G5l.mjs +0 -87
- package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
- package/dist/generator-CNzBw7g5.cjs +0 -289
- package/dist/generator-CNzBw7g5.cjs.map +0 -1
- package/dist/generator-VE2JrFlY.mjs +0 -253
- package/dist/generator-VE2JrFlY.mjs.map +0 -1
- package/dist/index-C6e-ULLx.d.mts.map +0 -1
- package/dist/index-CR5urhWX.d.cts.map +0 -1
- package/dist/openapi-SjsgARie.cjs +0 -2075
- package/dist/openapi-SjsgARie.cjs.map +0 -1
- package/dist/openapi-Xx0A7Wg0.mjs +0 -2021
- package/dist/openapi-Xx0A7Wg0.mjs.map +0 -1
- package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
- package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
- package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
- package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
- package/dist/openapi-react-query.cjs +0 -4
- package/dist/openapi-react-query.d.cts +0 -11
- package/dist/openapi-react-query.d.cts.map +0 -1
- package/dist/openapi-react-query.d.mts +0 -11
- package/dist/openapi-react-query.d.mts.map +0 -1
- package/dist/openapi-react-query.mjs +0 -4
- package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
- package/dist/reconcile-D0pimNiy.cjs.map +0 -1
- package/dist/setup-BA8ciTPU.mjs +0 -11
- package/dist/setup-BsZvZP6f.cjs +0 -11
- package/dist/setup-C8KOx8_8.mjs +0 -443
- package/dist/setup-C8KOx8_8.mjs.map +0 -1
- package/dist/setup-hC6hI86f.cjs +0 -473
- package/dist/setup-hC6hI86f.cjs.map +0 -1
- package/dist/storage-BJmzYxt8.cjs +0 -363
- package/dist/storage-BJmzYxt8.cjs.map +0 -1
- package/dist/storage-BM9hGpgv.cjs +0 -7
- package/dist/storage-Bi24WfoW.mjs +0 -297
- package/dist/storage-Bi24WfoW.mjs.map +0 -1
- package/dist/storage-CYlGwWTj.mjs +0 -3
- package/dist/sync-CmEuNZsB.mjs +0 -76
- package/dist/sync-CmEuNZsB.mjs.map +0 -1
- package/dist/sync-D306yOWu.cjs +0 -4
- package/dist/sync-SizaChmC.cjs +0 -93
- package/dist/sync-SizaChmC.cjs.map +0 -1
- package/dist/sync-hOqAWHR6.mjs +0 -3
- package/dist/types-6pkp2RRj.d.mts +0 -2220
- package/dist/types-6pkp2RRj.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-BzrG_2SI.mjs +0 -8
- package/dist/workspace-C6VJQVtG.cjs.map +0 -1
- package/dist/workspace-XXtNhqJl.cjs +0 -9
- package/dist/workspace-zoqRbihZ.mjs.map +0 -1
|
@@ -1,61 +1,10 @@
|
|
|
1
|
-
import { __require } from "./chunk-Duj1WY3L.mjs";
|
|
2
|
-
import { basename, isAbsolute, join } from "node:path";
|
|
3
|
-
|
|
4
|
-
//#region src/workspace/publicEnv.ts
|
|
5
|
-
/**
|
|
6
|
-
* All public env-var prefixes the toolbox understands.
|
|
7
|
-
*
|
|
8
|
-
* Used when resolving incoming var names back to a dependency
|
|
9
|
-
* (e.g. `VITE_AUTH_URL` → `auth`). A var matching any of these
|
|
10
|
-
* is considered safe to inline into a client bundle.
|
|
11
|
-
*/
|
|
12
|
-
const PUBLIC_ENV_PREFIXES = [
|
|
13
|
-
"NEXT_PUBLIC_",
|
|
14
|
-
"VITE_",
|
|
15
|
-
"EXPO_PUBLIC_"
|
|
16
|
-
];
|
|
17
|
-
/**
|
|
18
|
-
* Resolve the public env-var prefix that a frontend framework's bundler
|
|
19
|
-
* inlines into client code at build time:
|
|
20
|
-
*
|
|
21
|
-
* - `nextjs` → `NEXT_PUBLIC_`
|
|
22
|
-
* - `vite` → `VITE_`
|
|
23
|
-
* - `tanstack-start` → `VITE_` (uses Vite under the hood)
|
|
24
|
-
* - `expo` → `EXPO_PUBLIC_`
|
|
25
|
-
* - `remix` → `''` (Remix exposes via loaders, no prefix convention)
|
|
26
|
-
*
|
|
27
|
-
* For backend frameworks or unspecified, falls back to `NEXT_PUBLIC_` to
|
|
28
|
-
* preserve the historical default. Backend apps never read these vars
|
|
29
|
-
* from a bundle, so the prefix only affects scaffolding/symmetry.
|
|
30
|
-
*/
|
|
31
|
-
function getPublicEnvPrefix(framework) {
|
|
32
|
-
switch (framework) {
|
|
33
|
-
case "vite":
|
|
34
|
-
case "tanstack-start": return "VITE_";
|
|
35
|
-
case "expo": return "EXPO_PUBLIC_";
|
|
36
|
-
case "remix": return "";
|
|
37
|
-
case "nextjs": return "NEXT_PUBLIC_";
|
|
38
|
-
default: return "NEXT_PUBLIC_";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Strip a known public prefix from a var name.
|
|
43
|
-
* Returns the un-prefixed name, or `null` if no prefix matched.
|
|
44
|
-
*/
|
|
45
|
-
function stripPublicPrefix(name) {
|
|
46
|
-
for (const prefix of PUBLIC_ENV_PREFIXES) if (prefix && name.startsWith(prefix)) return name.slice(prefix.length);
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
//#endregion
|
|
51
1
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.js
|
|
52
2
|
function getEnumValues(entries) {
|
|
53
3
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
54
|
-
|
|
55
|
-
return values;
|
|
4
|
+
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
56
5
|
}
|
|
57
|
-
function joinValues(array
|
|
58
|
-
return array
|
|
6
|
+
function joinValues(array, separator = "|") {
|
|
7
|
+
return array.map((val) => stringifyPrimitive(val)).join(separator);
|
|
59
8
|
}
|
|
60
9
|
function jsonStringifyReplacer(_, value) {
|
|
61
10
|
if (typeof value === "bigint") return value.toString();
|
|
@@ -171,12 +120,11 @@ const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace
|
|
|
171
120
|
function isObject(data) {
|
|
172
121
|
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
173
122
|
}
|
|
174
|
-
const allowsEval = /* @__PURE__
|
|
123
|
+
const allowsEval = /* @__PURE__*/ cached(() => {
|
|
175
124
|
if (globalConfig.jitless) return false;
|
|
176
125
|
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
|
|
177
126
|
try {
|
|
178
|
-
|
|
179
|
-
new F("");
|
|
127
|
+
new Function("");
|
|
180
128
|
return true;
|
|
181
129
|
} catch (_) {
|
|
182
130
|
return false;
|
|
@@ -199,7 +147,7 @@ function shallowClone(o) {
|
|
|
199
147
|
if (o instanceof Set) return new Set(o);
|
|
200
148
|
return o;
|
|
201
149
|
}
|
|
202
|
-
const propertyKeyTypes = /* @__PURE__
|
|
150
|
+
const propertyKeyTypes = /* @__PURE__*/ new Set([
|
|
203
151
|
"string",
|
|
204
152
|
"number",
|
|
205
153
|
"symbol"
|
|
@@ -237,7 +185,7 @@ function optionalKeys(shape) {
|
|
|
237
185
|
return shape[k]._zod.optin !== void 0 && shape[k]._zod.optout === "optional";
|
|
238
186
|
});
|
|
239
187
|
}
|
|
240
|
-
const NUMBER_FORMAT_RANGES =
|
|
188
|
+
const NUMBER_FORMAT_RANGES = /*@__PURE__*/ (() => ({
|
|
241
189
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
242
190
|
int32: [-2147483648, 2147483647],
|
|
243
191
|
uint32: [0, 4294967295],
|
|
@@ -245,14 +193,13 @@ const NUMBER_FORMAT_RANGES = /* @__PURE__ */ (() => ({
|
|
|
245
193
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
246
194
|
}))();
|
|
247
195
|
const BIGINT_FORMAT_RANGES = {
|
|
248
|
-
int64: [/* @__PURE__
|
|
249
|
-
uint64: [/* @__PURE__
|
|
196
|
+
int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
|
|
197
|
+
uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")]
|
|
250
198
|
};
|
|
251
199
|
function pick(schema, mask) {
|
|
252
200
|
const currDef = schema._zod.def;
|
|
253
201
|
const checks = currDef.checks;
|
|
254
|
-
|
|
255
|
-
if (hasChecks) throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
202
|
+
if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
256
203
|
const newShape = {};
|
|
257
204
|
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
258
205
|
return clone(schema, mergeDefs(currDef, {
|
|
@@ -272,8 +219,7 @@ function maskedKeys(schema, mask) {
|
|
|
272
219
|
function omit(schema, mask) {
|
|
273
220
|
const currDef = schema._zod.def;
|
|
274
221
|
const checks = currDef.checks;
|
|
275
|
-
|
|
276
|
-
if (hasChecks) throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
222
|
+
if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
277
223
|
const omitted = new Set(maskedKeys(schema, mask));
|
|
278
224
|
const newShape = {};
|
|
279
225
|
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
@@ -285,8 +231,7 @@ function omit(schema, mask) {
|
|
|
285
231
|
function extend(schema, shape) {
|
|
286
232
|
if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
|
|
287
233
|
const checks = schema._zod.def.checks;
|
|
288
|
-
|
|
289
|
-
if (hasChecks) {
|
|
234
|
+
if (checks && checks.length > 0) {
|
|
290
235
|
const existingShape = sourceShape(schema);
|
|
291
236
|
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
237
|
}
|
|
@@ -308,20 +253,17 @@ function merge(a, b) {
|
|
|
308
253
|
const newShape = {};
|
|
309
254
|
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
310
255
|
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
311
|
-
|
|
256
|
+
return clone(a, mergeDefs(a._zod.def, {
|
|
312
257
|
shape: newShape,
|
|
313
258
|
get catchall() {
|
|
314
259
|
return b._zod.def.catchall;
|
|
315
260
|
},
|
|
316
261
|
checks: b._zod.def.checks ?? []
|
|
317
|
-
});
|
|
318
|
-
return clone(a, def);
|
|
262
|
+
}));
|
|
319
263
|
}
|
|
320
264
|
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`);
|
|
265
|
+
const checks = schema._zod.def.checks;
|
|
266
|
+
if (checks && checks.length > 0) throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
325
267
|
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
326
268
|
const newShape = {};
|
|
327
269
|
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({
|
|
@@ -354,8 +296,8 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
354
296
|
}
|
|
355
297
|
function prefixIssues(path, issues) {
|
|
356
298
|
return issues.map((iss) => {
|
|
357
|
-
var _a
|
|
358
|
-
(_a
|
|
299
|
+
var _a;
|
|
300
|
+
(_a = iss).path ?? (_a.path = []);
|
|
359
301
|
iss.path.unshift(path);
|
|
360
302
|
return iss;
|
|
361
303
|
});
|
|
@@ -364,16 +306,18 @@ function unwrapMessage(message) {
|
|
|
364
306
|
return typeof message === "string" ? message : message?.message;
|
|
365
307
|
}
|
|
366
308
|
function attachSchema(issues, start, inst) {
|
|
367
|
-
var _a
|
|
368
|
-
for (let i = start; i < issues.length; i++) (_a
|
|
309
|
+
var _a;
|
|
310
|
+
for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
|
|
369
311
|
}
|
|
370
|
-
function finalizeIssue(iss, ctx, config
|
|
371
|
-
var _a
|
|
312
|
+
function finalizeIssue(iss, ctx, config) {
|
|
313
|
+
var _a;
|
|
372
314
|
const traits = iss.inst?._zod?.traits;
|
|
373
|
-
if (traits?.has("$ZodType"))
|
|
374
|
-
|
|
315
|
+
if (traits?.has("$ZodType")) {
|
|
316
|
+
if (traits.has("$ZodCheck")) (_a = iss).schema ?? (_a.schema = iss.inst);
|
|
317
|
+
else iss.schema = iss.inst;
|
|
318
|
+
}
|
|
375
319
|
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
|
|
320
|
+
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
321
|
const full = {};
|
|
378
322
|
for (const k of Object.keys(iss)) {
|
|
379
323
|
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__") continue;
|
|
@@ -491,7 +435,6 @@ const breaker = {
|
|
|
491
435
|
configurable: true,
|
|
492
436
|
get() {
|
|
493
437
|
broke = true;
|
|
494
|
-
return void 0;
|
|
495
438
|
}
|
|
496
439
|
};
|
|
497
440
|
/**
|
|
@@ -577,7 +520,6 @@ function constantCatch(value) {
|
|
|
577
520
|
fn[CONSTANT_CATCH] = true;
|
|
578
521
|
return fn;
|
|
579
522
|
}
|
|
580
|
-
|
|
581
523
|
//#endregion
|
|
582
524
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.js
|
|
583
525
|
var _a$1;
|
|
@@ -606,7 +548,7 @@ function newError(Definition) {
|
|
|
606
548
|
}
|
|
607
549
|
return new Definition();
|
|
608
550
|
}
|
|
609
|
-
function $constructor(name, initializer
|
|
551
|
+
function $constructor(name, initializer, proto, params) {
|
|
610
552
|
const zodProto = {};
|
|
611
553
|
function Internals(def) {
|
|
612
554
|
this.def = def;
|
|
@@ -626,22 +568,22 @@ function $constructor(name, initializer$2, proto, params) {
|
|
|
626
568
|
}
|
|
627
569
|
} else if (inst._zod.traits.has(name)) return;
|
|
628
570
|
inst._zod.traits.add(name);
|
|
629
|
-
initializer
|
|
571
|
+
initializer(inst, def);
|
|
630
572
|
if (initialized) {
|
|
631
|
-
const own
|
|
573
|
+
const own = Object.getPrototypeOf(inst);
|
|
632
574
|
const ctorProto = inst._zod.constr.prototype;
|
|
633
|
-
let up = own
|
|
575
|
+
let up = own;
|
|
634
576
|
while (up && up !== ctorProto) up = Object.getPrototypeOf(up);
|
|
635
|
-
const target = up ?? own
|
|
577
|
+
const target = up ?? own;
|
|
636
578
|
if (!initialized.has(target)) {
|
|
637
579
|
initialized.add(target);
|
|
638
580
|
members(target, protoMembers);
|
|
639
581
|
}
|
|
640
582
|
}
|
|
641
|
-
const proto
|
|
642
|
-
for (const k in proto
|
|
643
|
-
if (!Object.prototype.hasOwnProperty.call(proto
|
|
644
|
-
if (!(k in inst)) inst[k] = proto
|
|
583
|
+
const proto = _.prototype;
|
|
584
|
+
for (const k in proto) {
|
|
585
|
+
if (!Object.prototype.hasOwnProperty.call(proto, k)) continue;
|
|
586
|
+
if (!(k in inst)) inst[k] = proto[k].bind(inst);
|
|
645
587
|
}
|
|
646
588
|
}
|
|
647
589
|
const Parent = params?.Parent ?? Object;
|
|
@@ -684,7 +626,6 @@ function config(newConfig) {
|
|
|
684
626
|
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
685
627
|
return globalConfig;
|
|
686
628
|
}
|
|
687
|
-
|
|
688
629
|
//#endregion
|
|
689
630
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.js
|
|
690
631
|
function _getMessage() {
|
|
@@ -738,39 +679,41 @@ const initializer$1 = (inst, def) => {
|
|
|
738
679
|
}
|
|
739
680
|
};
|
|
740
681
|
const $ZodError = $constructor("$ZodError", initializer$1);
|
|
741
|
-
|
|
682
|
+
$constructor("$ZodError", initializer$1, void 0, { Parent: Error });
|
|
742
683
|
/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
|
|
743
684
|
* ("toString", "constructor") would otherwise read through to the prototype, and assigning
|
|
744
685
|
* "__proto__" would hit the setter instead of creating a key. */
|
|
745
686
|
function node(obj, key, make) {
|
|
746
|
-
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
687
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
688
|
+
if (key === "__proto__") Object.defineProperty(obj, key, {
|
|
689
|
+
value: make(),
|
|
690
|
+
writable: true,
|
|
691
|
+
enumerable: true,
|
|
692
|
+
configurable: true
|
|
693
|
+
});
|
|
694
|
+
else obj[key] = make();
|
|
695
|
+
}
|
|
753
696
|
return obj[key];
|
|
754
697
|
}
|
|
755
|
-
function flattenError(error
|
|
698
|
+
function flattenError(error, mapper = (issue) => issue.message) {
|
|
756
699
|
const fieldErrors = {};
|
|
757
700
|
const formErrors = [];
|
|
758
|
-
for (const sub of error
|
|
701
|
+
for (const sub of error.issues) if (sub.path.length > 0) node(fieldErrors, sub.path[0], () => []).push(mapper(sub));
|
|
759
702
|
else formErrors.push(mapper(sub));
|
|
760
703
|
return {
|
|
761
704
|
formErrors,
|
|
762
705
|
fieldErrors
|
|
763
706
|
};
|
|
764
707
|
}
|
|
765
|
-
function formatError(error
|
|
708
|
+
function formatError(error, mapper = (issue) => issue.message) {
|
|
766
709
|
const fieldErrors = { _errors: [] };
|
|
767
|
-
const processError = (error
|
|
768
|
-
for (const issue
|
|
769
|
-
else if (issue
|
|
770
|
-
else if (issue
|
|
710
|
+
const processError = (error, path = []) => {
|
|
711
|
+
for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
|
|
712
|
+
else if (issue.code === "invalid_key") processError({ issues: issue.issues }, [...path, ...issue.path]);
|
|
713
|
+
else if (issue.code === "invalid_element") processError({ issues: issue.issues }, [...path, ...issue.path]);
|
|
771
714
|
else {
|
|
772
|
-
const fullpath = [...path, ...issue
|
|
773
|
-
if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue
|
|
715
|
+
const fullpath = [...path, ...issue.path];
|
|
716
|
+
if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue));
|
|
774
717
|
else {
|
|
775
718
|
let curr = fieldErrors;
|
|
776
719
|
let i = 0;
|
|
@@ -778,7 +721,7 @@ function formatError(error$1, mapper = (issue$1) => issue$1.message) {
|
|
|
778
721
|
const el = fullpath[i];
|
|
779
722
|
const terminal = i === fullpath.length - 1;
|
|
780
723
|
if (el === "_errors") {
|
|
781
|
-
if (terminal) curr._errors.push(mapper(issue
|
|
724
|
+
if (terminal) curr._errors.push(mapper(issue));
|
|
782
725
|
i++;
|
|
783
726
|
continue;
|
|
784
727
|
}
|
|
@@ -788,18 +731,17 @@ function formatError(error$1, mapper = (issue$1) => issue$1.message) {
|
|
|
788
731
|
writable: true,
|
|
789
732
|
configurable: true
|
|
790
733
|
});
|
|
791
|
-
const node
|
|
792
|
-
if (terminal) node
|
|
793
|
-
curr = node
|
|
734
|
+
const node = curr[el];
|
|
735
|
+
if (terminal) node._errors.push(mapper(issue));
|
|
736
|
+
curr = node;
|
|
794
737
|
i++;
|
|
795
738
|
}
|
|
796
739
|
}
|
|
797
740
|
}
|
|
798
741
|
};
|
|
799
|
-
processError(error
|
|
742
|
+
processError(error);
|
|
800
743
|
return fieldErrors;
|
|
801
744
|
}
|
|
802
|
-
|
|
803
745
|
//#endregion
|
|
804
746
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.js
|
|
805
747
|
function finalizeParams(callee, params) {
|
|
@@ -820,7 +762,7 @@ const _parse = (_Err) => {
|
|
|
820
762
|
}, ctx);
|
|
821
763
|
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
822
764
|
if (result.issues.length) {
|
|
823
|
-
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
765
|
+
const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
824
766
|
captureStackTrace(e, _params?.callee ?? fn);
|
|
825
767
|
throw e;
|
|
826
768
|
}
|
|
@@ -828,7 +770,6 @@ const _parse = (_Err) => {
|
|
|
828
770
|
};
|
|
829
771
|
return fn;
|
|
830
772
|
};
|
|
831
|
-
const parse$2 = /* @__PURE__ */ _parse($ZodRealError);
|
|
832
773
|
const _parseAsync = (_Err) => {
|
|
833
774
|
const fn = async (schema, value, _ctx, params) => {
|
|
834
775
|
const ctx = _ctx ? {
|
|
@@ -841,7 +782,7 @@ const _parseAsync = (_Err) => {
|
|
|
841
782
|
}, ctx);
|
|
842
783
|
if (result instanceof Promise) result = await result;
|
|
843
784
|
if (result.issues.length) {
|
|
844
|
-
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
785
|
+
const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
845
786
|
captureStackTrace(e, params?.callee ?? fn);
|
|
846
787
|
throw e;
|
|
847
788
|
}
|
|
@@ -849,7 +790,6 @@ const _parseAsync = (_Err) => {
|
|
|
849
790
|
};
|
|
850
791
|
return fn;
|
|
851
792
|
};
|
|
852
|
-
const parseAsync$1 = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
853
793
|
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
854
794
|
const ctx = _ctx ? {
|
|
855
795
|
..._ctx,
|
|
@@ -865,21 +805,20 @@ const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
865
805
|
data: result.value
|
|
866
806
|
};
|
|
867
807
|
};
|
|
868
|
-
const safeParse$1 = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
869
808
|
function failure(Err, issues, ctx) {
|
|
870
|
-
let error
|
|
809
|
+
let error;
|
|
871
810
|
return {
|
|
872
811
|
success: false,
|
|
873
812
|
get error() {
|
|
874
|
-
if (!error
|
|
875
|
-
error
|
|
813
|
+
if (!error) {
|
|
814
|
+
error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
876
815
|
issues = void 0;
|
|
877
816
|
ctx = void 0;
|
|
878
817
|
}
|
|
879
|
-
return error
|
|
818
|
+
return error;
|
|
880
819
|
},
|
|
881
820
|
set error(e) {
|
|
882
|
-
error
|
|
821
|
+
error = e;
|
|
883
822
|
issues = void 0;
|
|
884
823
|
ctx = void 0;
|
|
885
824
|
}
|
|
@@ -900,17 +839,16 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
900
839
|
data: result.value
|
|
901
840
|
};
|
|
902
841
|
};
|
|
903
|
-
const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
904
842
|
const COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
905
843
|
const COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
906
|
-
const validate = (schema, value, _ctx) => {
|
|
844
|
+
const validate = ((schema, value, _ctx) => {
|
|
907
845
|
const validator = schema._zod.bag.validator;
|
|
908
846
|
if (validator !== void 0) {
|
|
909
847
|
if (validator(value) !== COMPILE_INVALID) return true;
|
|
910
848
|
if (validator.definite === true && _ctx === void 0) return false;
|
|
911
849
|
}
|
|
912
850
|
return validateFallback(schema, value, _ctx);
|
|
913
|
-
};
|
|
851
|
+
});
|
|
914
852
|
function validateFallback(schema, value, _ctx) {
|
|
915
853
|
const ctx = _ctx ? {
|
|
916
854
|
..._ctx,
|
|
@@ -935,7 +873,7 @@ function validateFallback(schema, value, _ctx) {
|
|
|
935
873
|
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
936
874
|
return result.issues.length === 0;
|
|
937
875
|
}
|
|
938
|
-
const validateAsync = async (schema, value, _ctx) => {
|
|
876
|
+
const validateAsync$1 = async (schema, value, _ctx) => {
|
|
939
877
|
const ctx = _ctx ? {
|
|
940
878
|
..._ctx,
|
|
941
879
|
async: true,
|
|
@@ -952,45 +890,41 @@ const validateAsync = async (schema, value, _ctx) => {
|
|
|
952
890
|
return result.issues.length === 0;
|
|
953
891
|
};
|
|
954
892
|
const _encode = (_Err) => {
|
|
955
|
-
const parse
|
|
893
|
+
const parse = _parse(_Err);
|
|
956
894
|
const fn = (schema, value, _ctx, _params) => {
|
|
957
895
|
const ctx = _ctx ? {
|
|
958
896
|
..._ctx,
|
|
959
897
|
direction: "backward"
|
|
960
898
|
} : { direction: "backward" };
|
|
961
|
-
return parse
|
|
899
|
+
return parse(schema, value, ctx, finalizeParams(fn, _params));
|
|
962
900
|
};
|
|
963
901
|
return fn;
|
|
964
902
|
};
|
|
965
|
-
const encode$1 = /* @__PURE__ */ _encode($ZodRealError);
|
|
966
903
|
const _decode = (_Err) => {
|
|
967
|
-
const parse
|
|
904
|
+
const parse = _parse(_Err);
|
|
968
905
|
const fn = (schema, value, _ctx, _params) => {
|
|
969
|
-
return parse
|
|
906
|
+
return parse(schema, value, _ctx, finalizeParams(fn, _params));
|
|
970
907
|
};
|
|
971
908
|
return fn;
|
|
972
909
|
};
|
|
973
|
-
const decode$1 = /* @__PURE__ */ _decode($ZodRealError);
|
|
974
910
|
const _encodeAsync = (_Err) => {
|
|
975
|
-
const parseAsync
|
|
911
|
+
const parseAsync = _parseAsync(_Err);
|
|
976
912
|
const fn = async (schema, value, _ctx, _params) => {
|
|
977
913
|
const ctx = _ctx ? {
|
|
978
914
|
..._ctx,
|
|
979
915
|
direction: "backward"
|
|
980
916
|
} : { direction: "backward" };
|
|
981
|
-
return await parseAsync
|
|
917
|
+
return await parseAsync(schema, value, ctx, finalizeParams(fn, _params));
|
|
982
918
|
};
|
|
983
919
|
return fn;
|
|
984
920
|
};
|
|
985
|
-
const encodeAsync$1 = /* @__PURE__ */ _encodeAsync($ZodRealError);
|
|
986
921
|
const _decodeAsync = (_Err) => {
|
|
987
|
-
const parseAsync
|
|
922
|
+
const parseAsync = _parseAsync(_Err);
|
|
988
923
|
const fn = async (schema, value, _ctx, _params) => {
|
|
989
|
-
return await parseAsync
|
|
924
|
+
return await parseAsync(schema, value, _ctx, finalizeParams(fn, _params));
|
|
990
925
|
};
|
|
991
926
|
return fn;
|
|
992
927
|
};
|
|
993
|
-
const decodeAsync$1 = /* @__PURE__ */ _decodeAsync($ZodRealError);
|
|
994
928
|
const _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
995
929
|
const ctx = _ctx ? {
|
|
996
930
|
..._ctx,
|
|
@@ -998,11 +932,9 @@ const _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
|
998
932
|
} : { direction: "backward" };
|
|
999
933
|
return _safeParse(_Err)(schema, value, ctx);
|
|
1000
934
|
};
|
|
1001
|
-
const safeEncode$1 = /* @__PURE__ */ _safeEncode($ZodRealError);
|
|
1002
935
|
const _safeDecode = (_Err) => (schema, value, _ctx) => {
|
|
1003
936
|
return _safeParse(_Err)(schema, value, _ctx);
|
|
1004
937
|
};
|
|
1005
|
-
const safeDecode$1 = /* @__PURE__ */ _safeDecode($ZodRealError);
|
|
1006
938
|
const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1007
939
|
const ctx = _ctx ? {
|
|
1008
940
|
..._ctx,
|
|
@@ -1010,12 +942,9 @@ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
1010
942
|
} : { direction: "backward" };
|
|
1011
943
|
return _safeParseAsync(_Err)(schema, value, ctx);
|
|
1012
944
|
};
|
|
1013
|
-
const safeEncodeAsync$1 = /* @__PURE__ */ _safeEncodeAsync($ZodRealError);
|
|
1014
945
|
const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1015
946
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
1016
947
|
};
|
|
1017
|
-
const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
1018
|
-
|
|
1019
948
|
//#endregion
|
|
1020
949
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.js
|
|
1021
950
|
/**
|
|
@@ -1039,12 +968,12 @@ 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
968
|
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
1040
969
|
*
|
|
1041
970
|
* @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
|
|
971
|
+
const uuid = (version) => {
|
|
972
|
+
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)$/;
|
|
973
|
+
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
974
|
};
|
|
1046
975
|
/** Practical email validation */
|
|
1047
|
-
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,}$/;
|
|
976
|
+
const email$1 = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
1048
977
|
const _emoji$1 = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
1049
978
|
function emoji() {
|
|
1050
979
|
return new RegExp(_emoji$1, "u");
|
|
@@ -1064,11 +993,10 @@ const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468
|
|
|
1064
993
|
function anchor(source) {
|
|
1065
994
|
return new RegExp(`^${source}$`);
|
|
1066
995
|
}
|
|
1067
|
-
const date =
|
|
996
|
+
const date = /*@__PURE__*/ anchor(dateSource);
|
|
1068
997
|
function timeSource(args) {
|
|
1069
998
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
1070
|
-
|
|
1071
|
-
return regex;
|
|
999
|
+
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
1000
|
}
|
|
1073
1001
|
function time(args) {
|
|
1074
1002
|
return new RegExp(`^${timeSource(args)}$`);
|
|
@@ -1089,14 +1017,13 @@ const number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
|
1089
1017
|
const boolean$1 = /^(?:true|false)$/i;
|
|
1090
1018
|
const lowercase = /^[^A-Z]*$/;
|
|
1091
1019
|
const uppercase = /^[^a-z]*$/;
|
|
1092
|
-
|
|
1093
1020
|
//#endregion
|
|
1094
1021
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.js
|
|
1095
|
-
const $ZodCheck =
|
|
1096
|
-
var _a
|
|
1022
|
+
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
1023
|
+
var _a;
|
|
1097
1024
|
inst._zod ?? (inst._zod = {});
|
|
1098
1025
|
inst._zod.def = def;
|
|
1099
|
-
(_a
|
|
1026
|
+
(_a = inst._zod).onattach ?? (_a.onattach = []);
|
|
1100
1027
|
});
|
|
1101
1028
|
/** Default `when` for length-based checks: run only on non-nullish values with a `length`. */
|
|
1102
1029
|
const _whenHasLength = (payload) => {
|
|
@@ -1108,7 +1035,7 @@ const numericOriginMap = {
|
|
|
1108
1035
|
bigint: "bigint",
|
|
1109
1036
|
object: "date"
|
|
1110
1037
|
};
|
|
1111
|
-
const $ZodCheckLessThan =
|
|
1038
|
+
const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
1112
1039
|
$ZodCheck.init(inst, def);
|
|
1113
1040
|
const origin = numericOriginMap[typeof def.value];
|
|
1114
1041
|
inst._zod.check = (payload) => {
|
|
@@ -1124,7 +1051,7 @@ const $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (ins
|
|
|
1124
1051
|
});
|
|
1125
1052
|
};
|
|
1126
1053
|
});
|
|
1127
|
-
const $ZodCheckGreaterThan =
|
|
1054
|
+
const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
1128
1055
|
$ZodCheck.init(inst, def);
|
|
1129
1056
|
const origin = numericOriginMap[typeof def.value];
|
|
1130
1057
|
inst._zod.check = (payload) => {
|
|
@@ -1140,12 +1067,11 @@ const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan"
|
|
|
1140
1067
|
});
|
|
1141
1068
|
};
|
|
1142
1069
|
});
|
|
1143
|
-
const $ZodCheckMultipleOf =
|
|
1070
|
+
const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
1144
1071
|
$ZodCheck.init(inst, def);
|
|
1145
1072
|
inst._zod.check = (payload) => {
|
|
1146
1073
|
if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
1147
|
-
|
|
1148
|
-
if (isMultiple) return;
|
|
1074
|
+
if (typeof payload.value === "bigint" ? def.value !== BigInt(0) && payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
|
|
1149
1075
|
payload.issues.push({
|
|
1150
1076
|
origin: typeof payload.value,
|
|
1151
1077
|
code: "not_multiple_of",
|
|
@@ -1156,7 +1082,7 @@ const $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf",
|
|
|
1156
1082
|
});
|
|
1157
1083
|
};
|
|
1158
1084
|
});
|
|
1159
|
-
const $ZodCheckNumberFormat =
|
|
1085
|
+
const $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat", (inst, def) => {
|
|
1160
1086
|
$ZodCheck.init(inst, def);
|
|
1161
1087
|
def.format = def.format || "float64";
|
|
1162
1088
|
const isInt = def.format?.includes("int");
|
|
@@ -1220,15 +1146,14 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
|
|
|
1220
1146
|
});
|
|
1221
1147
|
};
|
|
1222
1148
|
});
|
|
1223
|
-
const $ZodCheckMaxLength =
|
|
1224
|
-
var _a
|
|
1149
|
+
const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
1150
|
+
var _a;
|
|
1225
1151
|
$ZodCheck.init(inst, def);
|
|
1226
|
-
(_a
|
|
1152
|
+
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1227
1153
|
inst._zod.check = (payload) => {
|
|
1228
1154
|
const input = payload.value;
|
|
1229
1155
|
const units = input.length;
|
|
1230
|
-
|
|
1231
|
-
if (length <= def.maximum) return;
|
|
1156
|
+
if ((typeof input === "string" && units > def.maximum ? codePointLength(input) : units) <= def.maximum) return;
|
|
1232
1157
|
const origin = getLengthableOrigin(input);
|
|
1233
1158
|
payload.issues.push({
|
|
1234
1159
|
origin,
|
|
@@ -1241,15 +1166,14 @@ const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (i
|
|
|
1241
1166
|
});
|
|
1242
1167
|
};
|
|
1243
1168
|
});
|
|
1244
|
-
const $ZodCheckMinLength =
|
|
1245
|
-
var _a
|
|
1169
|
+
const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
1170
|
+
var _a;
|
|
1246
1171
|
$ZodCheck.init(inst, def);
|
|
1247
|
-
(_a
|
|
1172
|
+
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1248
1173
|
inst._zod.check = (payload) => {
|
|
1249
1174
|
const input = payload.value;
|
|
1250
1175
|
const units = input.length;
|
|
1251
|
-
|
|
1252
|
-
if (length >= def.minimum) return;
|
|
1176
|
+
if ((typeof input === "string" && units >= def.minimum && units < def.minimum * 2 ? codePointLength(input) : units) >= def.minimum) return;
|
|
1253
1177
|
const origin = getLengthableOrigin(input);
|
|
1254
1178
|
payload.issues.push({
|
|
1255
1179
|
origin,
|
|
@@ -1262,10 +1186,10 @@ const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (i
|
|
|
1262
1186
|
});
|
|
1263
1187
|
};
|
|
1264
1188
|
});
|
|
1265
|
-
const $ZodCheckLengthEquals =
|
|
1266
|
-
var _a
|
|
1189
|
+
const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
1190
|
+
var _a;
|
|
1267
1191
|
$ZodCheck.init(inst, def);
|
|
1268
|
-
(_a
|
|
1192
|
+
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1269
1193
|
inst._zod.check = (payload) => {
|
|
1270
1194
|
const input = payload.value;
|
|
1271
1195
|
const units = input.length;
|
|
@@ -1290,10 +1214,10 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
|
|
|
1290
1214
|
});
|
|
1291
1215
|
};
|
|
1292
1216
|
});
|
|
1293
|
-
const $ZodCheckStringFormat =
|
|
1294
|
-
var _a
|
|
1217
|
+
const $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
1218
|
+
var _a, _b;
|
|
1295
1219
|
$ZodCheck.init(inst, def);
|
|
1296
|
-
if (def.pattern) (_a
|
|
1220
|
+
if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
1297
1221
|
def.pattern.lastIndex = 0;
|
|
1298
1222
|
if (def.pattern.test(payload.value)) return;
|
|
1299
1223
|
payload.issues.push({
|
|
@@ -1308,7 +1232,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
|
|
|
1308
1232
|
});
|
|
1309
1233
|
else (_b = inst._zod).check ?? (_b.check = () => {});
|
|
1310
1234
|
});
|
|
1311
|
-
const $ZodCheckRegex =
|
|
1235
|
+
const $ZodCheckRegex = /*@__PURE__*/ $constructor("$ZodCheckRegex", (inst, def) => {
|
|
1312
1236
|
$ZodCheckStringFormat.init(inst, def);
|
|
1313
1237
|
inst._zod.check = (payload) => {
|
|
1314
1238
|
def.pattern.lastIndex = 0;
|
|
@@ -1324,19 +1248,18 @@ const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def
|
|
|
1324
1248
|
});
|
|
1325
1249
|
};
|
|
1326
1250
|
});
|
|
1327
|
-
const $ZodCheckLowerCase =
|
|
1251
|
+
const $ZodCheckLowerCase = /*@__PURE__*/ $constructor("$ZodCheckLowerCase", (inst, def) => {
|
|
1328
1252
|
def.pattern ?? (def.pattern = lowercase);
|
|
1329
1253
|
$ZodCheckStringFormat.init(inst, def);
|
|
1330
1254
|
});
|
|
1331
|
-
const $ZodCheckUpperCase =
|
|
1255
|
+
const $ZodCheckUpperCase = /*@__PURE__*/ $constructor("$ZodCheckUpperCase", (inst, def) => {
|
|
1332
1256
|
def.pattern ?? (def.pattern = uppercase);
|
|
1333
1257
|
$ZodCheckStringFormat.init(inst, def);
|
|
1334
1258
|
});
|
|
1335
|
-
const $ZodCheckIncludes =
|
|
1259
|
+
const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
|
|
1336
1260
|
$ZodCheck.init(inst, def);
|
|
1337
1261
|
const escapedRegex = escapeRegex(def.includes);
|
|
1338
|
-
|
|
1339
|
-
def.pattern = pattern;
|
|
1262
|
+
def.pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
1340
1263
|
inst._zod.check = (payload) => {
|
|
1341
1264
|
if (payload.value.includes(def.includes, def.position)) return;
|
|
1342
1265
|
payload.issues.push({
|
|
@@ -1350,7 +1273,7 @@ const $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (ins
|
|
|
1350
1273
|
});
|
|
1351
1274
|
};
|
|
1352
1275
|
});
|
|
1353
|
-
const $ZodCheckStartsWith =
|
|
1276
|
+
const $ZodCheckStartsWith = /*@__PURE__*/ $constructor("$ZodCheckStartsWith", (inst, def) => {
|
|
1354
1277
|
$ZodCheck.init(inst, def);
|
|
1355
1278
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
1356
1279
|
def.pattern ?? (def.pattern = pattern);
|
|
@@ -1367,7 +1290,7 @@ const $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith",
|
|
|
1367
1290
|
});
|
|
1368
1291
|
};
|
|
1369
1292
|
});
|
|
1370
|
-
const $ZodCheckEndsWith =
|
|
1293
|
+
const $ZodCheckEndsWith = /*@__PURE__*/ $constructor("$ZodCheckEndsWith", (inst, def) => {
|
|
1371
1294
|
$ZodCheck.init(inst, def);
|
|
1372
1295
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
1373
1296
|
def.pattern ?? (def.pattern = pattern);
|
|
@@ -1384,13 +1307,12 @@ const $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (ins
|
|
|
1384
1307
|
});
|
|
1385
1308
|
};
|
|
1386
1309
|
});
|
|
1387
|
-
const $ZodCheckOverwrite =
|
|
1310
|
+
const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst, def) => {
|
|
1388
1311
|
$ZodCheck.init(inst, def);
|
|
1389
1312
|
inst._zod.check = (payload) => {
|
|
1390
1313
|
payload.value = def.tx(payload.value);
|
|
1391
1314
|
};
|
|
1392
1315
|
});
|
|
1393
|
-
|
|
1394
1316
|
//#endregion
|
|
1395
1317
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.js
|
|
1396
1318
|
var Doc = class {
|
|
@@ -1414,8 +1336,7 @@ var Doc = class {
|
|
|
1414
1336
|
arg(this, { execution: "async" });
|
|
1415
1337
|
return;
|
|
1416
1338
|
}
|
|
1417
|
-
const
|
|
1418
|
-
const lines = content.split("\n").filter((x) => x);
|
|
1339
|
+
const lines = arg.split("\n").filter((x) => x);
|
|
1419
1340
|
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
|
|
1420
1341
|
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
|
|
1421
1342
|
for (const line of dedented) this.content.push(line);
|
|
@@ -1423,11 +1344,9 @@ var Doc = class {
|
|
|
1423
1344
|
compile() {
|
|
1424
1345
|
const F = Function;
|
|
1425
1346
|
const content = this?.content ?? [``];
|
|
1426
|
-
|
|
1427
|
-
return factory(...Object.values(this.closed));
|
|
1347
|
+
return new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`)(...Object.values(this.closed));
|
|
1428
1348
|
}
|
|
1429
1349
|
};
|
|
1430
|
-
|
|
1431
1350
|
//#endregion
|
|
1432
1351
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.js
|
|
1433
1352
|
const version = {
|
|
@@ -1435,11 +1354,10 @@ const version = {
|
|
|
1435
1354
|
minor: 6,
|
|
1436
1355
|
patch: 5
|
|
1437
1356
|
};
|
|
1438
|
-
|
|
1439
1357
|
//#endregion
|
|
1440
1358
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.js
|
|
1441
|
-
const $ZodType =
|
|
1442
|
-
var _a
|
|
1359
|
+
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1360
|
+
var _a;
|
|
1443
1361
|
inst ?? (inst = {});
|
|
1444
1362
|
inst._zod.def = def;
|
|
1445
1363
|
inst._zod.bag = inst._zod.bag || {};
|
|
@@ -1448,34 +1366,31 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1448
1366
|
const checks = inst._zod.traits.has("$ZodCheck") ? [inst, ...defChecks ?? []] : defChecks?.length ? [...defChecks] : [];
|
|
1449
1367
|
for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
|
|
1450
1368
|
if (checks.length === 0) {
|
|
1451
|
-
(_a
|
|
1369
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
1452
1370
|
inst._zod.deferred?.push(() => {
|
|
1453
1371
|
inst._zod.run = inst._zod.parse;
|
|
1454
1372
|
});
|
|
1455
1373
|
} else {
|
|
1456
|
-
const runChecks = (payload, checks
|
|
1374
|
+
const runChecks = (payload, checks, ctx) => {
|
|
1457
1375
|
if (payload.memo) return payload;
|
|
1458
1376
|
let isAborted = aborted(payload);
|
|
1459
1377
|
let asyncResult;
|
|
1460
|
-
for (const ch of checks
|
|
1378
|
+
for (const ch of checks) {
|
|
1461
1379
|
if (ch._zod.def.when) {
|
|
1462
1380
|
if (explicitlyAborted(payload)) continue;
|
|
1463
|
-
|
|
1464
|
-
if (!shouldRun) continue;
|
|
1381
|
+
if (!ch._zod.def.when(payload)) continue;
|
|
1465
1382
|
} else if (isAborted) continue;
|
|
1466
1383
|
const currLen = payload.issues.length;
|
|
1467
1384
|
const _ = ch._zod.check(payload);
|
|
1468
1385
|
if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
|
|
1469
1386
|
if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
1470
1387
|
await _;
|
|
1471
|
-
|
|
1472
|
-
if (nextLen === currLen) return;
|
|
1388
|
+
if (payload.issues.length === currLen) return;
|
|
1473
1389
|
attachSchema(payload.issues, currLen, inst);
|
|
1474
1390
|
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
1475
1391
|
});
|
|
1476
1392
|
else {
|
|
1477
|
-
|
|
1478
|
-
if (nextLen === currLen) continue;
|
|
1393
|
+
if (payload.issues.length === currLen) continue;
|
|
1479
1394
|
attachSchema(payload.issues, currLen, inst);
|
|
1480
1395
|
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
1481
1396
|
}
|
|
@@ -1493,7 +1408,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1493
1408
|
const checkResult = runChecks(payload, checks, ctx);
|
|
1494
1409
|
if (checkResult instanceof Promise) {
|
|
1495
1410
|
if (ctx.async === false) throw new $ZodAsyncError();
|
|
1496
|
-
return checkResult.then((checkResult
|
|
1411
|
+
return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
|
|
1497
1412
|
}
|
|
1498
1413
|
return inst._zod.parse(checkResult, ctx);
|
|
1499
1414
|
};
|
|
@@ -1507,15 +1422,15 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1507
1422
|
...ctx,
|
|
1508
1423
|
skipChecks: true
|
|
1509
1424
|
});
|
|
1510
|
-
if (canary instanceof Promise) return canary.then((canary
|
|
1511
|
-
return handleCanaryResult(canary
|
|
1425
|
+
if (canary instanceof Promise) return canary.then((canary) => {
|
|
1426
|
+
return handleCanaryResult(canary, payload, ctx);
|
|
1512
1427
|
});
|
|
1513
1428
|
return handleCanaryResult(canary, payload, ctx);
|
|
1514
1429
|
}
|
|
1515
1430
|
const result = inst._zod.parse(payload, ctx);
|
|
1516
1431
|
if (result instanceof Promise) {
|
|
1517
1432
|
if (ctx.async === false) throw new $ZodAsyncError();
|
|
1518
|
-
return result.then((result
|
|
1433
|
+
return result.then((result) => runChecks(result, checks, ctx));
|
|
1519
1434
|
}
|
|
1520
1435
|
return runChecks(result, checks, ctx);
|
|
1521
1436
|
};
|
|
@@ -1530,7 +1445,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1530
1445
|
});
|
|
1531
1446
|
/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
|
|
1532
1447
|
const toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
|
|
1533
|
-
async function validateAsync
|
|
1448
|
+
async function validateAsync(inst, value) {
|
|
1534
1449
|
const ctx = { async: true };
|
|
1535
1450
|
return toStandardResult(await inst._zod.run({
|
|
1536
1451
|
value,
|
|
@@ -1548,19 +1463,19 @@ function standardProps(inst) {
|
|
|
1548
1463
|
}, ctx);
|
|
1549
1464
|
if (!(r instanceof Promise)) return toStandardResult(r, ctx);
|
|
1550
1465
|
} catch (_) {}
|
|
1551
|
-
return validateAsync
|
|
1466
|
+
return validateAsync(inst, value);
|
|
1552
1467
|
},
|
|
1553
1468
|
vendor: "zod",
|
|
1554
1469
|
version: 1
|
|
1555
1470
|
};
|
|
1556
1471
|
}
|
|
1557
|
-
const $ZodString =
|
|
1472
|
+
const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
|
|
1558
1473
|
$ZodType.init(inst, def);
|
|
1559
1474
|
inst._zod.pattern = def.pattern ?? anyString;
|
|
1560
1475
|
inst._zod.parse = (payload, _) => {
|
|
1561
1476
|
if (def.coerce) try {
|
|
1562
1477
|
payload.value = String(payload.value);
|
|
1563
|
-
} catch (_
|
|
1478
|
+
} catch (_) {}
|
|
1564
1479
|
if (typeof payload.value === "string") return payload;
|
|
1565
1480
|
payload.issues.push({
|
|
1566
1481
|
expected: "string",
|
|
@@ -1571,17 +1486,17 @@ const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
|
1571
1486
|
return payload;
|
|
1572
1487
|
};
|
|
1573
1488
|
});
|
|
1574
|
-
const $ZodStringFormat =
|
|
1489
|
+
const $ZodStringFormat = /*@__PURE__*/ $constructor("$ZodStringFormat", (inst, def) => {
|
|
1575
1490
|
$ZodCheckStringFormat.init(inst, def);
|
|
1576
1491
|
$ZodString.init(inst, def);
|
|
1577
1492
|
});
|
|
1578
|
-
const $ZodGUID =
|
|
1493
|
+
const $ZodGUID = /*@__PURE__*/ $constructor("$ZodGUID", (inst, def) => {
|
|
1579
1494
|
def.pattern ?? (def.pattern = guid);
|
|
1580
1495
|
$ZodStringFormat.init(inst, def);
|
|
1581
1496
|
});
|
|
1582
|
-
const $ZodUUID =
|
|
1497
|
+
const $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
|
|
1583
1498
|
if (def.version) {
|
|
1584
|
-
const
|
|
1499
|
+
const v = {
|
|
1585
1500
|
v1: 1,
|
|
1586
1501
|
v2: 2,
|
|
1587
1502
|
v3: 3,
|
|
@@ -1590,21 +1505,16 @@ const $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
|
|
|
1590
1505
|
v6: 6,
|
|
1591
1506
|
v7: 7,
|
|
1592
1507
|
v8: 8
|
|
1593
|
-
};
|
|
1594
|
-
const v = versionMap[def.version];
|
|
1508
|
+
}[def.version];
|
|
1595
1509
|
if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`);
|
|
1596
1510
|
def.pattern ?? (def.pattern = uuid(v));
|
|
1597
1511
|
} else def.pattern ?? (def.pattern = uuid());
|
|
1598
1512
|
$ZodStringFormat.init(inst, def);
|
|
1599
1513
|
});
|
|
1600
|
-
const $ZodEmail =
|
|
1601
|
-
def.pattern ?? (def.pattern = email);
|
|
1514
|
+
const $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
|
|
1515
|
+
def.pattern ?? (def.pattern = email$1);
|
|
1602
1516
|
$ZodStringFormat.init(inst, def);
|
|
1603
1517
|
});
|
|
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
1518
|
function canParseURL(input) {
|
|
1609
1519
|
try {
|
|
1610
1520
|
if (typeof URL !== "undefined" && typeof URL.canParse === "function") return URL.canParse(input);
|
|
@@ -1615,20 +1525,20 @@ function canParseURL(input) {
|
|
|
1615
1525
|
}
|
|
1616
1526
|
}
|
|
1617
1527
|
function validateURL(trimmed, def) {
|
|
1618
|
-
if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) return canParseURL(trimmed) ||
|
|
1528
|
+
if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) return canParseURL(trimmed) || 2;
|
|
1619
1529
|
return parseURLObject(trimmed, def);
|
|
1620
1530
|
}
|
|
1621
1531
|
/** Parses a URL while preserving the non-normalizing HTTP guard. */
|
|
1622
1532
|
function parseURLObject(trimmed, def) {
|
|
1623
|
-
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return
|
|
1533
|
+
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return 1;
|
|
1624
1534
|
try {
|
|
1625
1535
|
if (typeof URL !== "undefined") {
|
|
1626
1536
|
const URLStatic = URL;
|
|
1627
|
-
if (typeof URLStatic.parse === "function") return URLStatic.parse(trimmed) ??
|
|
1537
|
+
if (typeof URLStatic.parse === "function") return URLStatic.parse(trimmed) ?? 2;
|
|
1628
1538
|
}
|
|
1629
1539
|
return new URL(trimmed);
|
|
1630
1540
|
} catch {
|
|
1631
|
-
return
|
|
1541
|
+
return 2;
|
|
1632
1542
|
}
|
|
1633
1543
|
}
|
|
1634
1544
|
const asciiTabOrNewline = /[\t\n\r]/g;
|
|
@@ -1636,21 +1546,21 @@ const asciiTabOrNewline = /[\t\n\r]/g;
|
|
|
1636
1546
|
function stripTabAndNewline(value) {
|
|
1637
1547
|
return value.replace(asciiTabOrNewline, "");
|
|
1638
1548
|
}
|
|
1639
|
-
function urlHostnameOk(url
|
|
1549
|
+
function urlHostnameOk(url, hostname) {
|
|
1640
1550
|
hostname.lastIndex = 0;
|
|
1641
|
-
return hostname.test(url
|
|
1551
|
+
return hostname.test(url.hostname);
|
|
1642
1552
|
}
|
|
1643
|
-
function urlProtocolOk(url
|
|
1553
|
+
function urlProtocolOk(url, protocol) {
|
|
1644
1554
|
protocol.lastIndex = 0;
|
|
1645
|
-
return protocol.test(url
|
|
1555
|
+
return protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol);
|
|
1646
1556
|
}
|
|
1647
|
-
const $ZodURL =
|
|
1557
|
+
const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
|
|
1648
1558
|
$ZodStringFormat.init(inst, def);
|
|
1649
1559
|
inst._zod.check = (payload) => {
|
|
1650
1560
|
try {
|
|
1651
1561
|
const trimmed = payload.value.trim();
|
|
1652
|
-
const url
|
|
1653
|
-
if (url
|
|
1562
|
+
const url = validateURL(trimmed, def);
|
|
1563
|
+
if (url === 1) {
|
|
1654
1564
|
payload.issues.push({
|
|
1655
1565
|
code: "invalid_format",
|
|
1656
1566
|
format: "url",
|
|
@@ -1661,7 +1571,7 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
1661
1571
|
});
|
|
1662
1572
|
return;
|
|
1663
1573
|
}
|
|
1664
|
-
if (url
|
|
1574
|
+
if (url === 2) {
|
|
1665
1575
|
payload.issues.push({
|
|
1666
1576
|
code: "invalid_format",
|
|
1667
1577
|
format: "url",
|
|
@@ -1671,11 +1581,11 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
1671
1581
|
});
|
|
1672
1582
|
return;
|
|
1673
1583
|
}
|
|
1674
|
-
if (url
|
|
1584
|
+
if (url === true) {
|
|
1675
1585
|
payload.value = stripTabAndNewline(trimmed);
|
|
1676
1586
|
return;
|
|
1677
1587
|
}
|
|
1678
|
-
if (def.hostname && !urlHostnameOk(url
|
|
1588
|
+
if (def.hostname && !urlHostnameOk(url, def.hostname)) payload.issues.push({
|
|
1679
1589
|
code: "invalid_format",
|
|
1680
1590
|
format: "url",
|
|
1681
1591
|
note: "Invalid hostname",
|
|
@@ -1684,7 +1594,7 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
1684
1594
|
inst,
|
|
1685
1595
|
continue: !def.abort
|
|
1686
1596
|
});
|
|
1687
|
-
if (def.protocol && !urlProtocolOk(url
|
|
1597
|
+
if (def.protocol && !urlProtocolOk(url, def.protocol)) payload.issues.push({
|
|
1688
1598
|
code: "invalid_format",
|
|
1689
1599
|
format: "url",
|
|
1690
1600
|
note: "Invalid protocol",
|
|
@@ -1693,7 +1603,7 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
1693
1603
|
inst,
|
|
1694
1604
|
continue: !def.abort
|
|
1695
1605
|
});
|
|
1696
|
-
payload.value = def.normalize ? url
|
|
1606
|
+
payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);
|
|
1697
1607
|
return;
|
|
1698
1608
|
} catch (_) {
|
|
1699
1609
|
payload.issues.push({
|
|
@@ -1706,11 +1616,11 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
1706
1616
|
}
|
|
1707
1617
|
};
|
|
1708
1618
|
});
|
|
1709
|
-
const $ZodEmoji =
|
|
1619
|
+
const $ZodEmoji = /*@__PURE__*/ $constructor("$ZodEmoji", (inst, def) => {
|
|
1710
1620
|
def.pattern ?? (def.pattern = emoji());
|
|
1711
1621
|
$ZodStringFormat.init(inst, def);
|
|
1712
1622
|
});
|
|
1713
|
-
const $ZodNanoID =
|
|
1623
|
+
const $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => {
|
|
1714
1624
|
if (def.length !== void 0 && (!Number.isInteger(def.length) || def.length < 1)) throw new Error(`Invalid nanoid length: ${def.length}`);
|
|
1715
1625
|
def.pattern ?? (def.pattern = def.length === void 0 ? nanoid : nanoidOfLength(def.length));
|
|
1716
1626
|
$ZodStringFormat.init(inst, def);
|
|
@@ -1720,43 +1630,43 @@ const $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => {
|
|
|
1720
1630
|
* (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
|
|
1721
1631
|
* See https://github.com/paralleldrive/cuid.
|
|
1722
1632
|
*/
|
|
1723
|
-
const $ZodCUID =
|
|
1633
|
+
const $ZodCUID = /*@__PURE__*/ $constructor("$ZodCUID", (inst, def) => {
|
|
1724
1634
|
def.pattern ?? (def.pattern = cuid);
|
|
1725
1635
|
$ZodStringFormat.init(inst, def);
|
|
1726
1636
|
});
|
|
1727
|
-
const $ZodCUID2 =
|
|
1637
|
+
const $ZodCUID2 = /*@__PURE__*/ $constructor("$ZodCUID2", (inst, def) => {
|
|
1728
1638
|
def.pattern ?? (def.pattern = cuid2);
|
|
1729
1639
|
$ZodStringFormat.init(inst, def);
|
|
1730
1640
|
});
|
|
1731
|
-
const $ZodULID =
|
|
1641
|
+
const $ZodULID = /*@__PURE__*/ $constructor("$ZodULID", (inst, def) => {
|
|
1732
1642
|
def.pattern ?? (def.pattern = ulid);
|
|
1733
1643
|
$ZodStringFormat.init(inst, def);
|
|
1734
1644
|
});
|
|
1735
|
-
const $ZodXID =
|
|
1645
|
+
const $ZodXID = /*@__PURE__*/ $constructor("$ZodXID", (inst, def) => {
|
|
1736
1646
|
def.pattern ?? (def.pattern = xid);
|
|
1737
1647
|
$ZodStringFormat.init(inst, def);
|
|
1738
1648
|
});
|
|
1739
|
-
const $ZodKSUID =
|
|
1649
|
+
const $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
|
|
1740
1650
|
def.pattern ?? (def.pattern = ksuid);
|
|
1741
1651
|
$ZodStringFormat.init(inst, def);
|
|
1742
1652
|
});
|
|
1743
|
-
const $ZodISODateTime =
|
|
1653
|
+
const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
1744
1654
|
def.pattern ?? (def.pattern = datetime(def));
|
|
1745
1655
|
$ZodStringFormat.init(inst, def);
|
|
1746
1656
|
});
|
|
1747
|
-
const $ZodISODate =
|
|
1657
|
+
const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
1748
1658
|
def.pattern ?? (def.pattern = date);
|
|
1749
1659
|
$ZodStringFormat.init(inst, def);
|
|
1750
1660
|
});
|
|
1751
|
-
const $ZodISOTime =
|
|
1661
|
+
const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
|
|
1752
1662
|
def.pattern ?? (def.pattern = time(def));
|
|
1753
1663
|
$ZodStringFormat.init(inst, def);
|
|
1754
1664
|
});
|
|
1755
|
-
const $ZodISODuration =
|
|
1665
|
+
const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def) => {
|
|
1756
1666
|
def.pattern ?? (def.pattern = duration);
|
|
1757
1667
|
$ZodStringFormat.init(inst, def);
|
|
1758
1668
|
});
|
|
1759
|
-
const $ZodIPv4 =
|
|
1669
|
+
const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
|
|
1760
1670
|
def.pattern ?? (def.pattern = ipv4);
|
|
1761
1671
|
$ZodStringFormat.init(inst, def);
|
|
1762
1672
|
});
|
|
@@ -1766,7 +1676,7 @@ function isValidIPv6(value) {
|
|
|
1766
1676
|
if (!ipv6Alphabet.test(value)) return false;
|
|
1767
1677
|
return canParseURL(`http://[${value}]`);
|
|
1768
1678
|
}
|
|
1769
|
-
const $ZodIPv6 =
|
|
1679
|
+
const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
1770
1680
|
def.pattern ?? (def.pattern = ipv6);
|
|
1771
1681
|
$ZodStringFormat.init(inst, def);
|
|
1772
1682
|
inst._zod.check = (payload) => {
|
|
@@ -1779,7 +1689,7 @@ const $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
|
1779
1689
|
});
|
|
1780
1690
|
};
|
|
1781
1691
|
});
|
|
1782
|
-
const $ZodCIDRv4 =
|
|
1692
|
+
const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
1783
1693
|
def.pattern ?? (def.pattern = cidrv4);
|
|
1784
1694
|
$ZodStringFormat.init(inst, def);
|
|
1785
1695
|
});
|
|
@@ -1793,7 +1703,7 @@ function isValidCIDRv6(value) {
|
|
|
1793
1703
|
if (prefixNum < 0 || prefixNum > 128) return false;
|
|
1794
1704
|
return isValidIPv6(address);
|
|
1795
1705
|
}
|
|
1796
|
-
const $ZodCIDRv6 =
|
|
1706
|
+
const $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => {
|
|
1797
1707
|
def.pattern ?? (def.pattern = cidrv6);
|
|
1798
1708
|
$ZodStringFormat.init(inst, def);
|
|
1799
1709
|
inst._zod.check = (payload) => {
|
|
@@ -1818,7 +1728,7 @@ function isValidBase64(data) {
|
|
|
1818
1728
|
}
|
|
1819
1729
|
}
|
|
1820
1730
|
const base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
1821
|
-
const $ZodBase64 =
|
|
1731
|
+
const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
|
|
1822
1732
|
def.pattern ?? (def.pattern = base64Charset);
|
|
1823
1733
|
$ZodStringFormat.init(inst, def);
|
|
1824
1734
|
inst._zod.check = (payload) => {
|
|
@@ -1835,11 +1745,10 @@ const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
1835
1745
|
const base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
1836
1746
|
function isValidBase64URL(data) {
|
|
1837
1747
|
if (!base64urlCharset.test(data)) return false;
|
|
1838
|
-
const base64
|
|
1839
|
-
|
|
1840
|
-
return isValidBase64(padded);
|
|
1748
|
+
const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
1749
|
+
return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
|
|
1841
1750
|
}
|
|
1842
|
-
const $ZodBase64URL =
|
|
1751
|
+
const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
|
|
1843
1752
|
def.pattern ?? (def.pattern = base64urlCharset);
|
|
1844
1753
|
$ZodStringFormat.init(inst, def);
|
|
1845
1754
|
inst._zod.check = (payload) => {
|
|
@@ -1853,7 +1762,7 @@ const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def)
|
|
|
1853
1762
|
});
|
|
1854
1763
|
};
|
|
1855
1764
|
});
|
|
1856
|
-
const $ZodE164 =
|
|
1765
|
+
const $ZodE164 = /*@__PURE__*/ $constructor("$ZodE164", (inst, def) => {
|
|
1857
1766
|
def.pattern ?? (def.pattern = e164);
|
|
1858
1767
|
$ZodStringFormat.init(inst, def);
|
|
1859
1768
|
});
|
|
@@ -1872,7 +1781,7 @@ function isValidJWT(token, algorithm = null) {
|
|
|
1872
1781
|
return false;
|
|
1873
1782
|
}
|
|
1874
1783
|
}
|
|
1875
|
-
const $ZodJWT =
|
|
1784
|
+
const $ZodJWT = /*@__PURE__*/ $constructor("$ZodJWT", (inst, def) => {
|
|
1876
1785
|
$ZodStringFormat.init(inst, def);
|
|
1877
1786
|
inst._zod.check = (payload) => {
|
|
1878
1787
|
if (isValidJWT(payload.value, def.alg)) return;
|
|
@@ -1885,7 +1794,7 @@ const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
|
|
|
1885
1794
|
});
|
|
1886
1795
|
};
|
|
1887
1796
|
});
|
|
1888
|
-
const $ZodNumber =
|
|
1797
|
+
const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
1889
1798
|
$ZodType.init(inst, def);
|
|
1890
1799
|
inst._zod.pattern = number$1;
|
|
1891
1800
|
inst._zod.parse = (payload, _ctx) => {
|
|
@@ -1905,11 +1814,11 @@ const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
|
1905
1814
|
return payload;
|
|
1906
1815
|
};
|
|
1907
1816
|
});
|
|
1908
|
-
const $ZodNumberFormat =
|
|
1817
|
+
const $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumberFormat", (inst, def) => {
|
|
1909
1818
|
$ZodCheckNumberFormat.init(inst, def);
|
|
1910
1819
|
$ZodNumber.init(inst, def);
|
|
1911
1820
|
});
|
|
1912
|
-
const $ZodBoolean =
|
|
1821
|
+
const $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => {
|
|
1913
1822
|
$ZodType.init(inst, def);
|
|
1914
1823
|
inst._zod.pattern = boolean$1;
|
|
1915
1824
|
inst._zod.parse = (payload, _ctx) => {
|
|
@@ -1927,11 +1836,11 @@ const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
1927
1836
|
return payload;
|
|
1928
1837
|
};
|
|
1929
1838
|
});
|
|
1930
|
-
const $ZodUnknown =
|
|
1839
|
+
const $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def) => {
|
|
1931
1840
|
$ZodType.init(inst, def);
|
|
1932
1841
|
inst._zod.parse = (payload) => payload;
|
|
1933
1842
|
});
|
|
1934
|
-
const $ZodNever =
|
|
1843
|
+
const $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
|
|
1935
1844
|
$ZodType.init(inst, def);
|
|
1936
1845
|
inst._zod.parse = (payload, _ctx) => {
|
|
1937
1846
|
payload.issues.push({
|
|
@@ -1947,10 +1856,10 @@ function handleArrayResult(result, final, index) {
|
|
|
1947
1856
|
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
1948
1857
|
final.value[index] = result.value;
|
|
1949
1858
|
}
|
|
1950
|
-
const $ZodArray =
|
|
1859
|
+
const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
1951
1860
|
$ZodType.init(inst, def);
|
|
1952
|
-
const memo
|
|
1953
|
-
memo
|
|
1861
|
+
const memo = globalConfig.memoizer;
|
|
1862
|
+
memo?.attach(inst);
|
|
1954
1863
|
inst._zod.parse = (payload, ctx) => {
|
|
1955
1864
|
const input = payload.value;
|
|
1956
1865
|
if (!Array.isArray(input)) {
|
|
@@ -1962,7 +1871,7 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
1962
1871
|
});
|
|
1963
1872
|
return payload;
|
|
1964
1873
|
}
|
|
1965
|
-
payload.value = memo
|
|
1874
|
+
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
1966
1875
|
const proms = [];
|
|
1967
1876
|
const abortEarly = ctx?.abortEarly;
|
|
1968
1877
|
for (let i = 0; i < input.length; i++) {
|
|
@@ -1971,7 +1880,7 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
1971
1880
|
value: item,
|
|
1972
1881
|
issues: []
|
|
1973
1882
|
}, ctx);
|
|
1974
|
-
if (result instanceof Promise) proms.push(result.then((result
|
|
1883
|
+
if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
1975
1884
|
else {
|
|
1976
1885
|
handleArrayResult(result, payload, i);
|
|
1977
1886
|
if (abortEarly && result.issues.length !== 0 && aborted(result)) break;
|
|
@@ -2045,7 +1954,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
|
|
|
2045
1954
|
value: input[key],
|
|
2046
1955
|
issues: []
|
|
2047
1956
|
}, ctx);
|
|
2048
|
-
if (r instanceof Promise) proms.push(r.then((r
|
|
1957
|
+
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
|
|
2049
1958
|
else handlePropertyResult(r, payload, key, input, optin, optout);
|
|
2050
1959
|
}
|
|
2051
1960
|
if (unrecognized.length) payload.issues.push({
|
|
@@ -2060,7 +1969,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
|
|
|
2060
1969
|
return payload;
|
|
2061
1970
|
});
|
|
2062
1971
|
}
|
|
2063
|
-
const $ZodObject =
|
|
1972
|
+
const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
2064
1973
|
$ZodType.init(inst, def);
|
|
2065
1974
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
2066
1975
|
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
@@ -2088,15 +1997,15 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
2088
1997
|
}
|
|
2089
1998
|
return propValues;
|
|
2090
1999
|
});
|
|
2091
|
-
const isObject$
|
|
2000
|
+
const isObject$2 = isObject;
|
|
2092
2001
|
const catchall = def.catchall;
|
|
2093
2002
|
let value;
|
|
2094
|
-
const memo
|
|
2095
|
-
memo
|
|
2003
|
+
const memo = globalConfig.memoizer;
|
|
2004
|
+
memo?.attach(inst);
|
|
2096
2005
|
inst._zod.parse = (payload, ctx) => {
|
|
2097
2006
|
value ?? (value = _normalized.value);
|
|
2098
2007
|
const input = payload.value;
|
|
2099
|
-
if (!isObject$
|
|
2008
|
+
if (!isObject$2(input)) {
|
|
2100
2009
|
payload.issues.push({
|
|
2101
2010
|
expected: "object",
|
|
2102
2011
|
code: "invalid_type",
|
|
@@ -2105,7 +2014,7 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
2105
2014
|
});
|
|
2106
2015
|
return payload;
|
|
2107
2016
|
}
|
|
2108
|
-
payload.value = memo
|
|
2017
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
2109
2018
|
const proms = [];
|
|
2110
2019
|
const shape = value.shape;
|
|
2111
2020
|
const abortEarly = ctx?.abortEarly;
|
|
@@ -2123,25 +2032,25 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
2123
2032
|
value: input[key],
|
|
2124
2033
|
issues: []
|
|
2125
2034
|
}, ctx);
|
|
2126
|
-
if (r instanceof Promise) proms.push(r.then((r
|
|
2035
|
+
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
|
|
2127
2036
|
else handlePropertyResult(r, payload, key, input, optin, optout);
|
|
2128
2037
|
}
|
|
2129
2038
|
if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
2130
2039
|
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
2131
2040
|
};
|
|
2132
2041
|
});
|
|
2133
|
-
const $ZodObjectJIT =
|
|
2042
|
+
const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
2134
2043
|
$ZodObject.init(inst, def);
|
|
2135
2044
|
const superParse = inst._zod.parse;
|
|
2136
2045
|
const _normalized = cached(() => normalizeDef(def));
|
|
2137
|
-
const memo
|
|
2046
|
+
const memo = globalConfig.memoizer;
|
|
2138
2047
|
const generateFastpass = (shape) => {
|
|
2139
2048
|
const normalized = _normalized.value;
|
|
2140
2049
|
const syms = normalized.symbolKeys;
|
|
2141
2050
|
const doc = new Doc(["payload", "ctx"], {
|
|
2142
2051
|
shape,
|
|
2143
2052
|
inst,
|
|
2144
|
-
memo
|
|
2053
|
+
memo,
|
|
2145
2054
|
syms
|
|
2146
2055
|
});
|
|
2147
2056
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
@@ -2161,7 +2070,7 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
|
|
|
2161
2070
|
const ids = Object.create(null);
|
|
2162
2071
|
let counter = 0;
|
|
2163
2072
|
for (const key of normalized.allKeys) ids[key] = `key_${counter++}`;
|
|
2164
|
-
doc.write(memo
|
|
2073
|
+
doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
|
|
2165
2074
|
for (const key of normalized.allKeys) {
|
|
2166
2075
|
if (key === "__proto__") continue;
|
|
2167
2076
|
const id = ids[key];
|
|
@@ -2228,8 +2137,7 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
|
|
|
2228
2137
|
let fastpass;
|
|
2229
2138
|
const isObject$1 = isObject;
|
|
2230
2139
|
const jit = !globalConfig.jitless;
|
|
2231
|
-
const
|
|
2232
|
-
const fastEnabled = jit && allowsEval$1.value;
|
|
2140
|
+
const fastEnabled = jit && allowsEval.value;
|
|
2233
2141
|
const catchall = def.catchall;
|
|
2234
2142
|
let value;
|
|
2235
2143
|
inst._zod.parse = (payload, ctx) => {
|
|
@@ -2271,20 +2179,18 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
2271
2179
|
});
|
|
2272
2180
|
return final;
|
|
2273
2181
|
}
|
|
2274
|
-
const $ZodUnion =
|
|
2182
|
+
const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
|
|
2275
2183
|
$ZodType.init(inst, def);
|
|
2276
2184
|
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
2185
|
defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
|
|
2278
2186
|
defineLazyInternal(inst, "values", (zod) => {
|
|
2279
2187
|
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
2188
|
});
|
|
2282
2189
|
defineLazyInternal(inst, "pattern", (zod) => {
|
|
2283
2190
|
if (zod.def.options.every((o) => o._zod.pattern)) {
|
|
2284
2191
|
const patterns = zod.def.options.map((o) => o._zod.pattern);
|
|
2285
2192
|
return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
|
|
2286
2193
|
}
|
|
2287
|
-
return void 0;
|
|
2288
2194
|
});
|
|
2289
2195
|
const first = def.options.length === 1 ? def.options[0]._zod.run : null;
|
|
2290
2196
|
inst._zod.parse = (payload, ctx) => {
|
|
@@ -2305,8 +2211,8 @@ const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
|
2305
2211
|
}
|
|
2306
2212
|
}
|
|
2307
2213
|
if (!async) return handleUnionResults(results, payload, inst, ctx);
|
|
2308
|
-
return Promise.all(results).then((results
|
|
2309
|
-
return handleUnionResults(results
|
|
2214
|
+
return Promise.all(results).then((results) => {
|
|
2215
|
+
return handleUnionResults(results, payload, inst, ctx);
|
|
2310
2216
|
});
|
|
2311
2217
|
};
|
|
2312
2218
|
});
|
|
@@ -2322,7 +2228,7 @@ function discriminatorMap(def) {
|
|
|
2322
2228
|
}
|
|
2323
2229
|
return map;
|
|
2324
2230
|
}
|
|
2325
|
-
const $ZodDiscriminatedUnion =
|
|
2231
|
+
const $ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
2326
2232
|
def.inclusive = false;
|
|
2327
2233
|
$ZodUnion.init(inst, def);
|
|
2328
2234
|
const _super = inst._zod.parse;
|
|
@@ -2366,7 +2272,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
|
|
|
2366
2272
|
errors: [],
|
|
2367
2273
|
note: "No matching discriminator",
|
|
2368
2274
|
discriminator: def.discriminator,
|
|
2369
|
-
options: Array.from(disc.value.keys()).filter((value
|
|
2275
|
+
options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),
|
|
2370
2276
|
input,
|
|
2371
2277
|
path: [def.discriminator],
|
|
2372
2278
|
inst
|
|
@@ -2374,7 +2280,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
|
|
|
2374
2280
|
return payload;
|
|
2375
2281
|
};
|
|
2376
2282
|
});
|
|
2377
|
-
const $ZodIntersection =
|
|
2283
|
+
const $ZodIntersection = /*@__PURE__*/ $constructor("$ZodIntersection", (inst, def) => {
|
|
2378
2284
|
$ZodType.init(inst, def);
|
|
2379
2285
|
inst._zod.parse = (payload, ctx) => {
|
|
2380
2286
|
const input = payload.value;
|
|
@@ -2386,9 +2292,8 @@ const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst,
|
|
|
2386
2292
|
value: input,
|
|
2387
2293
|
issues: []
|
|
2388
2294
|
}, ctx);
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
return handleIntersectionResults(payload, left$1, right$1);
|
|
2295
|
+
if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left, right]) => {
|
|
2296
|
+
return handleIntersectionResults(payload, left, right);
|
|
2392
2297
|
});
|
|
2393
2298
|
return handleIntersectionResults(payload, left, right);
|
|
2394
2299
|
};
|
|
@@ -2489,10 +2394,118 @@ function handleIntersectionResults(result, left, right) {
|
|
|
2489
2394
|
result.value = merged.data;
|
|
2490
2395
|
return result;
|
|
2491
2396
|
}
|
|
2492
|
-
const $
|
|
2397
|
+
const $ZodTuple = /*@__PURE__*/ $constructor("$ZodTuple", (inst, def) => {
|
|
2493
2398
|
$ZodType.init(inst, def);
|
|
2494
|
-
const
|
|
2495
|
-
memo
|
|
2399
|
+
const items = def.items;
|
|
2400
|
+
const memo = globalConfig.memoizer;
|
|
2401
|
+
memo?.attach(inst);
|
|
2402
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2403
|
+
const input = payload.value;
|
|
2404
|
+
if (!Array.isArray(input)) {
|
|
2405
|
+
payload.issues.push({
|
|
2406
|
+
input,
|
|
2407
|
+
inst,
|
|
2408
|
+
expected: "tuple",
|
|
2409
|
+
code: "invalid_type"
|
|
2410
|
+
});
|
|
2411
|
+
return payload;
|
|
2412
|
+
}
|
|
2413
|
+
payload.value = memo ? memo.alloc(inst, payload, [], ctx) : [];
|
|
2414
|
+
const proms = [];
|
|
2415
|
+
const optinStart = getTupleOptStart(items, "optin");
|
|
2416
|
+
const optoutStart = getTupleOptStart(items, "optout");
|
|
2417
|
+
if (!def.rest) {
|
|
2418
|
+
if (input.length < optinStart) {
|
|
2419
|
+
payload.issues.push({
|
|
2420
|
+
code: "too_small",
|
|
2421
|
+
minimum: optinStart,
|
|
2422
|
+
inclusive: true,
|
|
2423
|
+
input,
|
|
2424
|
+
inst,
|
|
2425
|
+
origin: "array"
|
|
2426
|
+
});
|
|
2427
|
+
return payload;
|
|
2428
|
+
}
|
|
2429
|
+
if (input.length > items.length) payload.issues.push({
|
|
2430
|
+
code: "too_big",
|
|
2431
|
+
maximum: items.length,
|
|
2432
|
+
inclusive: true,
|
|
2433
|
+
input,
|
|
2434
|
+
inst,
|
|
2435
|
+
origin: "array"
|
|
2436
|
+
});
|
|
2437
|
+
}
|
|
2438
|
+
const itemResults = new Array(items.length);
|
|
2439
|
+
const abortEarly = def.rest ? ctx?.abortEarly : void 0;
|
|
2440
|
+
let itemAborted = false;
|
|
2441
|
+
for (let i = 0; i < items.length; i++) {
|
|
2442
|
+
const r = items[i]._zod.run({
|
|
2443
|
+
value: input[i],
|
|
2444
|
+
issues: []
|
|
2445
|
+
}, ctx);
|
|
2446
|
+
if (r instanceof Promise) proms.push(r.then((rr) => {
|
|
2447
|
+
itemResults[i] = rr;
|
|
2448
|
+
}));
|
|
2449
|
+
else {
|
|
2450
|
+
itemResults[i] = r;
|
|
2451
|
+
if (abortEarly && !itemAborted && r.issues.length) itemAborted = aborted(r);
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
if (def.rest && !itemAborted) {
|
|
2455
|
+
let i = items.length - 1;
|
|
2456
|
+
const rest = input.slice(items.length);
|
|
2457
|
+
let seen = payload.issues.length;
|
|
2458
|
+
for (const el of rest) {
|
|
2459
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
2460
|
+
if (aborted(payload, seen)) break;
|
|
2461
|
+
seen = payload.issues.length;
|
|
2462
|
+
}
|
|
2463
|
+
i++;
|
|
2464
|
+
const result = def.rest._zod.run({
|
|
2465
|
+
value: el,
|
|
2466
|
+
issues: []
|
|
2467
|
+
}, ctx);
|
|
2468
|
+
if (result instanceof Promise) proms.push(result.then((r) => handleTupleResult(r, payload, i)));
|
|
2469
|
+
else handleTupleResult(result, payload, i);
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
if (proms.length) return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
|
|
2473
|
+
return handleTupleResults(itemResults, payload, items, input, optoutStart);
|
|
2474
|
+
};
|
|
2475
|
+
});
|
|
2476
|
+
function getTupleOptStart(items, key) {
|
|
2477
|
+
for (let i = items.length - 1; i >= 0; i--) if (!(key === "optin" ? items[i]._zod.optin !== void 0 : items[i]._zod.optout === "optional")) return i + 1;
|
|
2478
|
+
return 0;
|
|
2479
|
+
}
|
|
2480
|
+
function handleTupleResult(result, final, index) {
|
|
2481
|
+
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
2482
|
+
final.value[index] = result.value;
|
|
2483
|
+
}
|
|
2484
|
+
function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
2485
|
+
for (let i = 0; i < items.length; i++) {
|
|
2486
|
+
const r = itemResults[i];
|
|
2487
|
+
const isPresent = i < input.length;
|
|
2488
|
+
if (!isPresent && i >= optoutStart && items[i]._zod.optin === "optional") {
|
|
2489
|
+
final.value.length = i;
|
|
2490
|
+
break;
|
|
2491
|
+
}
|
|
2492
|
+
if (r.issues.length) {
|
|
2493
|
+
if (!isPresent && i >= optoutStart) {
|
|
2494
|
+
final.value.length = i;
|
|
2495
|
+
break;
|
|
2496
|
+
}
|
|
2497
|
+
final.issues.push(...prefixIssues(i, r.issues));
|
|
2498
|
+
}
|
|
2499
|
+
final.value[i] = r.value;
|
|
2500
|
+
}
|
|
2501
|
+
for (let i = final.value.length - 1; i >= input.length; i--) if (items[i]._zod.optout === "optional" && final.value[i] === void 0) final.value.length = i;
|
|
2502
|
+
else break;
|
|
2503
|
+
return final;
|
|
2504
|
+
}
|
|
2505
|
+
const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
2506
|
+
$ZodType.init(inst, def);
|
|
2507
|
+
const memo = globalConfig.memoizer;
|
|
2508
|
+
memo?.attach(inst);
|
|
2496
2509
|
inst._zod.parse = (payload, ctx) => {
|
|
2497
2510
|
const input = payload.value;
|
|
2498
2511
|
if (!isPlainObject(input)) {
|
|
@@ -2507,7 +2520,7 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2507
2520
|
const proms = [];
|
|
2508
2521
|
const values = def.keyType._zod.values;
|
|
2509
2522
|
if (values && !def.partial) {
|
|
2510
|
-
payload.value = memo
|
|
2523
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
2511
2524
|
const recordKeys = /* @__PURE__ */ new Set();
|
|
2512
2525
|
for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
2513
2526
|
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
@@ -2534,9 +2547,9 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2534
2547
|
value: input[key],
|
|
2535
2548
|
issues: []
|
|
2536
2549
|
}, ctx);
|
|
2537
|
-
if (result instanceof Promise) proms.push(result.then((result
|
|
2538
|
-
if (result
|
|
2539
|
-
payload.value[outKey] = result
|
|
2550
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
2551
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2552
|
+
payload.value[outKey] = result.value;
|
|
2540
2553
|
}));
|
|
2541
2554
|
else {
|
|
2542
2555
|
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
@@ -2544,12 +2557,14 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2544
2557
|
}
|
|
2545
2558
|
}
|
|
2546
2559
|
let unrecognized;
|
|
2547
|
-
for (const key in input) if (!recordKeys.has(key))
|
|
2548
|
-
if (
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2560
|
+
for (const key in input) if (!recordKeys.has(key)) {
|
|
2561
|
+
if (def.mode === "loose") {
|
|
2562
|
+
if (key === "__proto__") continue;
|
|
2563
|
+
payload.value[key] = input[key];
|
|
2564
|
+
} else {
|
|
2565
|
+
unrecognized = unrecognized ?? [];
|
|
2566
|
+
unrecognized.push(key);
|
|
2567
|
+
}
|
|
2553
2568
|
}
|
|
2554
2569
|
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
2555
2570
|
code: "unrecognized_keys",
|
|
@@ -2559,7 +2574,7 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2559
2574
|
continue: true
|
|
2560
2575
|
});
|
|
2561
2576
|
} else {
|
|
2562
|
-
payload.value = memo
|
|
2577
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
2563
2578
|
let unrecognized;
|
|
2564
2579
|
for (const key of Reflect.ownKeys(input)) {
|
|
2565
2580
|
if (key === "__proto__") continue;
|
|
@@ -2569,8 +2584,7 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2569
2584
|
issues: []
|
|
2570
2585
|
}, ctx);
|
|
2571
2586
|
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
2572
|
-
|
|
2573
|
-
if (checkNumericKey) {
|
|
2587
|
+
if (typeof key === "string" && number$1.test(key) && keyResult.issues.length) {
|
|
2574
2588
|
const retryResult = def.keyType._zod.run({
|
|
2575
2589
|
value: Number(key),
|
|
2576
2590
|
issues: []
|
|
@@ -2599,9 +2613,9 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2599
2613
|
value: input[key],
|
|
2600
2614
|
issues: []
|
|
2601
2615
|
}, ctx);
|
|
2602
|
-
if (result instanceof Promise) proms.push(result.then((result
|
|
2603
|
-
if (result
|
|
2604
|
-
payload.value[outKey] = result
|
|
2616
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
2617
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2618
|
+
payload.value[outKey] = result.value;
|
|
2605
2619
|
}));
|
|
2606
2620
|
else {
|
|
2607
2621
|
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
@@ -2620,7 +2634,7 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2620
2634
|
return payload;
|
|
2621
2635
|
};
|
|
2622
2636
|
});
|
|
2623
|
-
const $ZodEnum =
|
|
2637
|
+
const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
|
|
2624
2638
|
$ZodType.init(inst, def);
|
|
2625
2639
|
const values = getEnumValues(def.entries);
|
|
2626
2640
|
const valuesSet = new Set(values);
|
|
@@ -2641,7 +2655,7 @@ const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
2641
2655
|
return payload;
|
|
2642
2656
|
};
|
|
2643
2657
|
});
|
|
2644
|
-
const $ZodLiteral =
|
|
2658
|
+
const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
|
|
2645
2659
|
$ZodType.init(inst, def);
|
|
2646
2660
|
const values = new Set(def.values);
|
|
2647
2661
|
inst._zod.values = values;
|
|
@@ -2661,20 +2675,17 @@ const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
2661
2675
|
return payload;
|
|
2662
2676
|
};
|
|
2663
2677
|
});
|
|
2664
|
-
const $ZodTransform =
|
|
2678
|
+
const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
|
|
2665
2679
|
$ZodType.init(inst, def);
|
|
2666
2680
|
inst._zod.optin = "optional";
|
|
2667
|
-
globalConfig.memoizer
|
|
2681
|
+
globalConfig.memoizer?.guard(inst);
|
|
2668
2682
|
inst._zod.parse = (payload, ctx) => {
|
|
2669
2683
|
if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
|
|
2670
2684
|
const _out = def.transform(payload.value, payload);
|
|
2671
|
-
if (ctx.async) {
|
|
2672
|
-
|
|
2673
|
-
return
|
|
2674
|
-
|
|
2675
|
-
return payload;
|
|
2676
|
-
});
|
|
2677
|
-
}
|
|
2685
|
+
if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
|
|
2686
|
+
payload.value = output;
|
|
2687
|
+
return payload;
|
|
2688
|
+
});
|
|
2678
2689
|
if (_out instanceof Promise) throw new $ZodAsyncError();
|
|
2679
2690
|
payload.value = _out;
|
|
2680
2691
|
return payload;
|
|
@@ -2684,13 +2695,13 @@ function handleOptionalResult(payload, result) {
|
|
|
2684
2695
|
payload.value = result.issues.length ? void 0 : result.value;
|
|
2685
2696
|
return payload;
|
|
2686
2697
|
}
|
|
2687
|
-
const $ZodOptional =
|
|
2698
|
+
const $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => {
|
|
2688
2699
|
$ZodType.init(inst, def);
|
|
2689
2700
|
defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
|
|
2690
2701
|
inst._zod.optout = "optional";
|
|
2691
2702
|
defineLazyInternal(inst, "values", (zod) => {
|
|
2692
2703
|
const values = zod.def.innerType._zod.values;
|
|
2693
|
-
return values ? new Set([...values, void 0]) : void 0;
|
|
2704
|
+
return values ? /* @__PURE__ */ new Set([...values, void 0]) : void 0;
|
|
2694
2705
|
});
|
|
2695
2706
|
defineLazyInternal(inst, "pattern", (zod) => {
|
|
2696
2707
|
const pattern = zod.def.innerType._zod.pattern;
|
|
@@ -2703,13 +2714,13 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
|
|
|
2703
2714
|
value: payload.value,
|
|
2704
2715
|
issues: []
|
|
2705
2716
|
}, ctx);
|
|
2706
|
-
if (result instanceof Promise) return result.then((result
|
|
2717
|
+
if (result instanceof Promise) return result.then((result) => handleOptionalResult(payload, result));
|
|
2707
2718
|
return handleOptionalResult(payload, result);
|
|
2708
2719
|
}
|
|
2709
2720
|
return def.innerType._zod.run(payload, ctx);
|
|
2710
2721
|
};
|
|
2711
2722
|
});
|
|
2712
|
-
const $ZodExactOptional =
|
|
2723
|
+
const $ZodExactOptional = /*@__PURE__*/ $constructor("$ZodExactOptional", (inst, def) => {
|
|
2713
2724
|
$ZodOptional.init(inst, def);
|
|
2714
2725
|
defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
2715
2726
|
defineLazyInternal(inst, "pattern", (zod) => zod.def.innerType._zod.pattern);
|
|
@@ -2717,7 +2728,7 @@ const $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (ins
|
|
|
2717
2728
|
return def.innerType._zod.run(payload, ctx);
|
|
2718
2729
|
};
|
|
2719
2730
|
});
|
|
2720
|
-
const $ZodNullable =
|
|
2731
|
+
const $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => {
|
|
2721
2732
|
$ZodType.init(inst, def);
|
|
2722
2733
|
defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
|
|
2723
2734
|
defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
|
|
@@ -2726,14 +2737,14 @@ const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) =>
|
|
|
2726
2737
|
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
|
|
2727
2738
|
});
|
|
2728
2739
|
defineLazyInternal(inst, "values", (zod) => {
|
|
2729
|
-
return zod.def.innerType._zod.values ? new Set([...zod.def.innerType._zod.values, null]) : void 0;
|
|
2740
|
+
return zod.def.innerType._zod.values ? /* @__PURE__ */ new Set([...zod.def.innerType._zod.values, null]) : void 0;
|
|
2730
2741
|
});
|
|
2731
2742
|
inst._zod.parse = (payload, ctx) => {
|
|
2732
2743
|
if (payload.value === null) return payload;
|
|
2733
2744
|
return def.innerType._zod.run(payload, ctx);
|
|
2734
2745
|
};
|
|
2735
2746
|
});
|
|
2736
|
-
const $ZodDefault =
|
|
2747
|
+
const $ZodDefault = /*@__PURE__*/ $constructor("$ZodDefault", (inst, def) => {
|
|
2737
2748
|
$ZodType.init(inst, def);
|
|
2738
2749
|
inst._zod.optin = "defaulted";
|
|
2739
2750
|
defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
@@ -2747,7 +2758,7 @@ const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
|
|
|
2747
2758
|
return payload;
|
|
2748
2759
|
}
|
|
2749
2760
|
const result = def.innerType._zod.run(payload, ctx);
|
|
2750
|
-
if (result instanceof Promise) return result.then((result
|
|
2761
|
+
if (result instanceof Promise) return result.then((result) => handleDefaultResult(result, def));
|
|
2751
2762
|
return handleDefaultResult(result, def);
|
|
2752
2763
|
};
|
|
2753
2764
|
});
|
|
@@ -2755,7 +2766,7 @@ function handleDefaultResult(payload, def) {
|
|
|
2755
2766
|
if (payload.value === void 0) payload.value = def.defaultValue;
|
|
2756
2767
|
return payload;
|
|
2757
2768
|
}
|
|
2758
|
-
const $ZodPrefault =
|
|
2769
|
+
const $ZodPrefault = /*@__PURE__*/ $constructor("$ZodPrefault", (inst, def) => {
|
|
2759
2770
|
$ZodType.init(inst, def);
|
|
2760
2771
|
inst._zod.optin = "defaulted";
|
|
2761
2772
|
defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
@@ -2765,7 +2776,7 @@ const $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) =>
|
|
|
2765
2776
|
return def.innerType._zod.run(payload, ctx);
|
|
2766
2777
|
};
|
|
2767
2778
|
});
|
|
2768
|
-
const $ZodNonOptional =
|
|
2779
|
+
const $ZodNonOptional = /*@__PURE__*/ $constructor("$ZodNonOptional", (inst, def) => {
|
|
2769
2780
|
$ZodType.init(inst, def);
|
|
2770
2781
|
defineLazyInternal(inst, "values", (zod) => {
|
|
2771
2782
|
const v = zod.def.innerType._zod.values;
|
|
@@ -2773,7 +2784,7 @@ const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, d
|
|
|
2773
2784
|
});
|
|
2774
2785
|
inst._zod.parse = (payload, ctx) => {
|
|
2775
2786
|
const result = def.innerType._zod.run(payload, ctx);
|
|
2776
|
-
if (result instanceof Promise) return result.then((result
|
|
2787
|
+
if (result instanceof Promise) return result.then((result) => handleNonOptionalResult(result, inst));
|
|
2777
2788
|
return handleNonOptionalResult(result, inst);
|
|
2778
2789
|
};
|
|
2779
2790
|
});
|
|
@@ -2800,7 +2811,7 @@ function handleCatchResult(payload, result, def, ctx) {
|
|
|
2800
2811
|
});
|
|
2801
2812
|
return payload;
|
|
2802
2813
|
}
|
|
2803
|
-
const $ZodCatch =
|
|
2814
|
+
const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
|
|
2804
2815
|
$ZodType.init(inst, def);
|
|
2805
2816
|
defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
|
|
2806
2817
|
defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
|
|
@@ -2811,11 +2822,11 @@ const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
|
|
|
2811
2822
|
value: payload.value,
|
|
2812
2823
|
issues: []
|
|
2813
2824
|
}, ctx);
|
|
2814
|
-
if (result instanceof Promise) return result.then((result
|
|
2825
|
+
if (result instanceof Promise) return result.then((result) => handleCatchResult(payload, result, def, ctx));
|
|
2815
2826
|
return handleCatchResult(payload, result, def, ctx);
|
|
2816
2827
|
};
|
|
2817
2828
|
});
|
|
2818
|
-
const $ZodPipe =
|
|
2829
|
+
const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
|
|
2819
2830
|
$ZodType.init(inst, def);
|
|
2820
2831
|
defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
|
|
2821
2832
|
defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
|
|
@@ -2824,11 +2835,11 @@ const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
|
|
|
2824
2835
|
inst._zod.parse = (payload, ctx) => {
|
|
2825
2836
|
if (ctx.direction === "backward") {
|
|
2826
2837
|
const right = def.out._zod.run(payload, ctx);
|
|
2827
|
-
if (right instanceof Promise) return right.then((right
|
|
2838
|
+
if (right instanceof Promise) return right.then((right) => handlePipeResult(right, def.in, ctx));
|
|
2828
2839
|
return handlePipeResult(right, def.in, ctx);
|
|
2829
2840
|
}
|
|
2830
2841
|
const left = def.in._zod.run(payload, ctx);
|
|
2831
|
-
if (left instanceof Promise) return left.then((left
|
|
2842
|
+
if (left instanceof Promise) return left.then((left) => handlePipeResult(left, def.out, ctx));
|
|
2832
2843
|
return handlePipeResult(left, def.out, ctx);
|
|
2833
2844
|
};
|
|
2834
2845
|
});
|
|
@@ -2842,7 +2853,7 @@ function handlePipeResult(left, next, ctx) {
|
|
|
2842
2853
|
issues: left.issues
|
|
2843
2854
|
}, ctx);
|
|
2844
2855
|
}
|
|
2845
|
-
const $ZodReadonly =
|
|
2856
|
+
const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
|
|
2846
2857
|
$ZodType.init(inst, def);
|
|
2847
2858
|
defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
|
|
2848
2859
|
defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
@@ -2859,7 +2870,7 @@ function handleReadonlyResult(payload) {
|
|
|
2859
2870
|
if (!payload.memo) payload.value = Object.freeze(payload.value);
|
|
2860
2871
|
return payload;
|
|
2861
2872
|
}
|
|
2862
|
-
const $ZodCustom =
|
|
2873
|
+
const $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => {
|
|
2863
2874
|
$ZodCheck.init(inst, def);
|
|
2864
2875
|
$ZodType.init(inst, def);
|
|
2865
2876
|
inst._zod.parse = (payload, _) => {
|
|
@@ -2868,9 +2879,8 @@ const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
|
2868
2879
|
inst._zod.check = (payload) => {
|
|
2869
2880
|
const input = payload.value;
|
|
2870
2881
|
const r = def.fn(input);
|
|
2871
|
-
if (r instanceof Promise) return r.then((r
|
|
2882
|
+
if (r instanceof Promise) return r.then((r) => handleRefineResult(r, payload, input, inst));
|
|
2872
2883
|
handleRefineResult(r, payload, input, inst);
|
|
2873
|
-
return;
|
|
2874
2884
|
};
|
|
2875
2885
|
});
|
|
2876
2886
|
function handleRefineResult(result, payload, input, inst) {
|
|
@@ -2886,7 +2896,6 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
2886
2896
|
payload.issues.push(issue(_iss));
|
|
2887
2897
|
}
|
|
2888
2898
|
}
|
|
2889
|
-
|
|
2890
2899
|
//#endregion
|
|
2891
2900
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.js
|
|
2892
2901
|
var $ZodCyclicError = class extends Error {
|
|
@@ -2907,21 +2916,21 @@ function cloneIssues(issues) {
|
|
|
2907
2916
|
path: iss.path.slice()
|
|
2908
2917
|
} : { ...iss });
|
|
2909
2918
|
}
|
|
2910
|
-
const recursive =
|
|
2919
|
+
const recursive = /*@__PURE__*/ new WeakMap();
|
|
2911
2920
|
/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */
|
|
2912
2921
|
const NONE = 0;
|
|
2913
2922
|
const ASSUMED = 1;
|
|
2914
2923
|
const PROVEN = 2;
|
|
2915
2924
|
/** 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
|
|
2925
|
+
function isRecursive(inst, stack, resolve) {
|
|
2926
|
+
const cached = recursive.get(inst);
|
|
2927
|
+
if (cached !== void 0) return cached ? PROVEN : NONE;
|
|
2919
2928
|
if (stack.has(inst)) return PROVEN;
|
|
2920
2929
|
stack.add(inst);
|
|
2921
2930
|
let result = NONE;
|
|
2922
2931
|
const check = (child) => {
|
|
2923
2932
|
if (result !== PROVEN && child?._zod) {
|
|
2924
|
-
const answer = isRecursive(child, stack, resolve
|
|
2933
|
+
const answer = isRecursive(child, stack, resolve);
|
|
2925
2934
|
if (answer > result) result = answer;
|
|
2926
2935
|
}
|
|
2927
2936
|
};
|
|
@@ -2930,20 +2939,19 @@ function isRecursive(inst, stack, resolve$1) {
|
|
|
2930
2939
|
for (const key of Reflect.ownKeys(sh)) {
|
|
2931
2940
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
2932
2941
|
if (spread && !desc.enumerable) continue;
|
|
2933
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve
|
|
2942
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
2934
2943
|
if (child > answer) answer = child;
|
|
2935
2944
|
}
|
|
2936
2945
|
return answer;
|
|
2937
2946
|
};
|
|
2938
|
-
const merge
|
|
2947
|
+
const merge = (answer) => {
|
|
2939
2948
|
if (answer > result) result = answer;
|
|
2940
2949
|
};
|
|
2941
2950
|
const def = inst._zod.def;
|
|
2942
|
-
|
|
2943
|
-
switch (kind) {
|
|
2951
|
+
switch (def.type) {
|
|
2944
2952
|
case "object": {
|
|
2945
2953
|
const raw = rawShape(def);
|
|
2946
|
-
merge
|
|
2954
|
+
merge(raw ? shape(raw, true) : ASSUMED);
|
|
2947
2955
|
check(def.catchall);
|
|
2948
2956
|
break;
|
|
2949
2957
|
}
|
|
@@ -2989,8 +2997,8 @@ function isRecursive(inst, stack, resolve$1) {
|
|
|
2989
2997
|
check(def.output);
|
|
2990
2998
|
break;
|
|
2991
2999
|
case "lazy": {
|
|
2992
|
-
const inner = def._cachedInner ?? (resolve
|
|
2993
|
-
merge
|
|
3000
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : void 0);
|
|
3001
|
+
merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
2994
3002
|
break;
|
|
2995
3003
|
}
|
|
2996
3004
|
case "template_literal":
|
|
@@ -3054,8 +3062,8 @@ const memo = {
|
|
|
3054
3062
|
return empty;
|
|
3055
3063
|
},
|
|
3056
3064
|
guard(inst) {
|
|
3057
|
-
var _a
|
|
3058
|
-
(_a
|
|
3065
|
+
var _a;
|
|
3066
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
3059
3067
|
inst._zod.deferred.push(() => {
|
|
3060
3068
|
const base = inst._zod.parse;
|
|
3061
3069
|
const wrapped = (payload, ctx) => {
|
|
@@ -3067,12 +3075,12 @@ const memo = {
|
|
|
3067
3075
|
});
|
|
3068
3076
|
},
|
|
3069
3077
|
attach(inst) {
|
|
3070
|
-
var _a
|
|
3078
|
+
var _a;
|
|
3071
3079
|
let isRecursiveInst;
|
|
3072
3080
|
let rechecked = false;
|
|
3073
3081
|
let lastCtx;
|
|
3074
3082
|
let lastBucket;
|
|
3075
|
-
(_a
|
|
3083
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
3076
3084
|
inst._zod.deferred.push(() => {
|
|
3077
3085
|
const base = inst._zod.parse;
|
|
3078
3086
|
const wrapped = (payload, ctx) => {
|
|
@@ -3141,7 +3149,6 @@ function isBackEdge(ctx, value) {
|
|
|
3141
3149
|
const backEdges = ctx[STATE]?.backEdges;
|
|
3142
3150
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3143
3151
|
}
|
|
3144
|
-
|
|
3145
3152
|
//#endregion
|
|
3146
3153
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.js
|
|
3147
3154
|
const error = () => {
|
|
@@ -3209,48 +3216,40 @@ const error = () => {
|
|
|
3209
3216
|
if (type === "number" && typeof input === "number" && !Number.isFinite(input)) return String(input);
|
|
3210
3217
|
return TypeDictionary[type] ?? type;
|
|
3211
3218
|
}
|
|
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
|
-
}
|
|
3219
|
+
return (issue) => {
|
|
3220
|
+
switch (issue.code) {
|
|
3221
|
+
case "invalid_type": return `Invalid input: expected ${getTypeName(issue.expected)}, received ${getTypeName(parsedType(issue.input), issue.input)}`;
|
|
3220
3222
|
case "invalid_value":
|
|
3221
|
-
if (issue
|
|
3222
|
-
return `Invalid option: expected one of ${joinValues(issue
|
|
3223
|
+
if (issue.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue.values[0])}`;
|
|
3224
|
+
return `Invalid option: expected one of ${joinValues(issue.values, "|")}`;
|
|
3223
3225
|
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
|
|
3226
|
+
const adj = issue.exact ? "exactly " : issue.inclusive ? "<=" : "<";
|
|
3227
|
+
const sizing = getSizing(issue.origin);
|
|
3228
|
+
if (sizing) return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
|
|
3229
|
+
return `Too big: expected ${issue.origin ?? "value"} to be ${adj}${issue.maximum.toString()}`;
|
|
3228
3230
|
}
|
|
3229
3231
|
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
|
|
3232
|
+
const adj = issue.exact ? "exactly " : issue.inclusive ? ">=" : ">";
|
|
3233
|
+
const sizing = getSizing(issue.origin);
|
|
3234
|
+
if (sizing) return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
|
3235
|
+
return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
|
|
3234
3236
|
}
|
|
3235
3237
|
case "invalid_format": {
|
|
3236
|
-
const _issue = issue
|
|
3238
|
+
const _issue = issue;
|
|
3237
3239
|
if (_issue.format === "starts_with") return `Invalid string: must start with "${_issue.prefix}"`;
|
|
3238
3240
|
if (_issue.format === "ends_with") return `Invalid string: must end with "${_issue.suffix}"`;
|
|
3239
3241
|
if (_issue.format === "includes") return `Invalid string: must include "${_issue.includes}"`;
|
|
3240
3242
|
if (_issue.format === "regex") return `Invalid string: must match pattern ${_issue.pattern}`;
|
|
3241
|
-
return `Invalid ${FormatDictionary[_issue.format] ?? issue
|
|
3243
|
+
return `Invalid ${FormatDictionary[_issue.format] ?? issue.format}`;
|
|
3242
3244
|
}
|
|
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
|
|
3245
|
+
case "not_multiple_of": return `Invalid number: must be a multiple of ${issue.divisor}`;
|
|
3246
|
+
case "unrecognized_keys": return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
|
|
3247
|
+
case "invalid_key": return `Invalid key in ${issue.origin}`;
|
|
3246
3248
|
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";
|
|
3249
|
+
if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) return `Invalid discriminator value. Expected ${issue.options.map((o) => `'${o}'`).join(" | ")}`;
|
|
3250
|
+
if (issue.inclusive === false) return "Invalid input: more than one option matched";
|
|
3252
3251
|
return "Invalid input";
|
|
3253
|
-
case "invalid_element": return `Invalid value in ${issue
|
|
3252
|
+
case "invalid_element": return `Invalid value in ${issue.origin}`;
|
|
3254
3253
|
default: return `Invalid input`;
|
|
3255
3254
|
}
|
|
3256
3255
|
};
|
|
@@ -3258,7 +3257,6 @@ const error = () => {
|
|
|
3258
3257
|
function en_default() {
|
|
3259
3258
|
return { localeError: error() };
|
|
3260
3259
|
}
|
|
3261
|
-
|
|
3262
3260
|
//#endregion
|
|
3263
3261
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.js
|
|
3264
3262
|
var _a;
|
|
@@ -3268,9 +3266,9 @@ var $ZodRegistry = class {
|
|
|
3268
3266
|
this._idmap = /* @__PURE__ */ new Map();
|
|
3269
3267
|
}
|
|
3270
3268
|
add(schema, ..._meta) {
|
|
3271
|
-
const meta
|
|
3272
|
-
this._map.set(schema, meta
|
|
3273
|
-
if (meta
|
|
3269
|
+
const meta = _meta[0];
|
|
3270
|
+
this._map.set(schema, meta);
|
|
3271
|
+
if (meta && typeof meta === "object" && "id" in meta) this._idmap.set(meta.id, schema);
|
|
3274
3272
|
return this;
|
|
3275
3273
|
}
|
|
3276
3274
|
clear() {
|
|
@@ -3279,8 +3277,8 @@ var $ZodRegistry = class {
|
|
|
3279
3277
|
return this;
|
|
3280
3278
|
}
|
|
3281
3279
|
remove(schema) {
|
|
3282
|
-
const meta
|
|
3283
|
-
if (meta
|
|
3280
|
+
const meta = this._map.get(schema);
|
|
3281
|
+
if (meta && typeof meta === "object" && "id" in meta) this._idmap.delete(meta.id);
|
|
3284
3282
|
this._map.delete(schema);
|
|
3285
3283
|
return this;
|
|
3286
3284
|
}
|
|
@@ -3306,21 +3304,20 @@ function registry() {
|
|
|
3306
3304
|
}
|
|
3307
3305
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
3308
3306
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
3309
|
-
|
|
3310
3307
|
//#endregion
|
|
3311
3308
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.js
|
|
3312
3309
|
function snapshotChecks(def) {
|
|
3313
3310
|
if (def.checks) def.checks = [...def.checks];
|
|
3314
3311
|
return def;
|
|
3315
3312
|
}
|
|
3316
|
-
|
|
3313
|
+
// @__NO_SIDE_EFFECTS__
|
|
3317
3314
|
function _string(Class, params) {
|
|
3318
3315
|
return new Class(snapshotChecks({
|
|
3319
3316
|
type: "string",
|
|
3320
3317
|
...normalizeParams(params)
|
|
3321
3318
|
}));
|
|
3322
3319
|
}
|
|
3323
|
-
|
|
3320
|
+
// @__NO_SIDE_EFFECTS__
|
|
3324
3321
|
function _email(Class, params) {
|
|
3325
3322
|
return new Class({
|
|
3326
3323
|
type: "string",
|
|
@@ -3330,7 +3327,7 @@ function _email(Class, params) {
|
|
|
3330
3327
|
...normalizeParams(params)
|
|
3331
3328
|
});
|
|
3332
3329
|
}
|
|
3333
|
-
|
|
3330
|
+
// @__NO_SIDE_EFFECTS__
|
|
3334
3331
|
function _guid(Class, params) {
|
|
3335
3332
|
return new Class({
|
|
3336
3333
|
type: "string",
|
|
@@ -3340,7 +3337,7 @@ function _guid(Class, params) {
|
|
|
3340
3337
|
...normalizeParams(params)
|
|
3341
3338
|
});
|
|
3342
3339
|
}
|
|
3343
|
-
|
|
3340
|
+
// @__NO_SIDE_EFFECTS__
|
|
3344
3341
|
function _uuid(Class, params) {
|
|
3345
3342
|
return new Class({
|
|
3346
3343
|
type: "string",
|
|
@@ -3350,7 +3347,7 @@ function _uuid(Class, params) {
|
|
|
3350
3347
|
...normalizeParams(params)
|
|
3351
3348
|
});
|
|
3352
3349
|
}
|
|
3353
|
-
|
|
3350
|
+
// @__NO_SIDE_EFFECTS__
|
|
3354
3351
|
function _uuidv4(Class, params) {
|
|
3355
3352
|
return new Class({
|
|
3356
3353
|
type: "string",
|
|
@@ -3361,7 +3358,7 @@ function _uuidv4(Class, params) {
|
|
|
3361
3358
|
...normalizeParams(params)
|
|
3362
3359
|
});
|
|
3363
3360
|
}
|
|
3364
|
-
|
|
3361
|
+
// @__NO_SIDE_EFFECTS__
|
|
3365
3362
|
function _uuidv6(Class, params) {
|
|
3366
3363
|
return new Class({
|
|
3367
3364
|
type: "string",
|
|
@@ -3372,7 +3369,7 @@ function _uuidv6(Class, params) {
|
|
|
3372
3369
|
...normalizeParams(params)
|
|
3373
3370
|
});
|
|
3374
3371
|
}
|
|
3375
|
-
|
|
3372
|
+
// @__NO_SIDE_EFFECTS__
|
|
3376
3373
|
function _uuidv7(Class, params) {
|
|
3377
3374
|
return new Class({
|
|
3378
3375
|
type: "string",
|
|
@@ -3383,7 +3380,7 @@ function _uuidv7(Class, params) {
|
|
|
3383
3380
|
...normalizeParams(params)
|
|
3384
3381
|
});
|
|
3385
3382
|
}
|
|
3386
|
-
|
|
3383
|
+
// @__NO_SIDE_EFFECTS__
|
|
3387
3384
|
function _url(Class, params) {
|
|
3388
3385
|
return new Class({
|
|
3389
3386
|
type: "string",
|
|
@@ -3393,7 +3390,7 @@ function _url(Class, params) {
|
|
|
3393
3390
|
...normalizeParams(params)
|
|
3394
3391
|
});
|
|
3395
3392
|
}
|
|
3396
|
-
|
|
3393
|
+
// @__NO_SIDE_EFFECTS__
|
|
3397
3394
|
function _emoji(Class, params) {
|
|
3398
3395
|
return new Class({
|
|
3399
3396
|
type: "string",
|
|
@@ -3403,7 +3400,7 @@ function _emoji(Class, params) {
|
|
|
3403
3400
|
...normalizeParams(params)
|
|
3404
3401
|
});
|
|
3405
3402
|
}
|
|
3406
|
-
|
|
3403
|
+
// @__NO_SIDE_EFFECTS__
|
|
3407
3404
|
function _nanoid(Class, params) {
|
|
3408
3405
|
return new Class({
|
|
3409
3406
|
type: "string",
|
|
@@ -3418,7 +3415,7 @@ function _nanoid(Class, params) {
|
|
|
3418
3415
|
* (timestamps embedded in the id). Use {@link _cuid2} instead.
|
|
3419
3416
|
* See https://github.com/paralleldrive/cuid.
|
|
3420
3417
|
*/
|
|
3421
|
-
|
|
3418
|
+
// @__NO_SIDE_EFFECTS__
|
|
3422
3419
|
function _cuid(Class, params) {
|
|
3423
3420
|
return new Class({
|
|
3424
3421
|
type: "string",
|
|
@@ -3428,7 +3425,7 @@ function _cuid(Class, params) {
|
|
|
3428
3425
|
...normalizeParams(params)
|
|
3429
3426
|
});
|
|
3430
3427
|
}
|
|
3431
|
-
|
|
3428
|
+
// @__NO_SIDE_EFFECTS__
|
|
3432
3429
|
function _cuid2(Class, params) {
|
|
3433
3430
|
return new Class({
|
|
3434
3431
|
type: "string",
|
|
@@ -3438,7 +3435,7 @@ function _cuid2(Class, params) {
|
|
|
3438
3435
|
...normalizeParams(params)
|
|
3439
3436
|
});
|
|
3440
3437
|
}
|
|
3441
|
-
|
|
3438
|
+
// @__NO_SIDE_EFFECTS__
|
|
3442
3439
|
function _ulid(Class, params) {
|
|
3443
3440
|
return new Class({
|
|
3444
3441
|
type: "string",
|
|
@@ -3448,7 +3445,7 @@ function _ulid(Class, params) {
|
|
|
3448
3445
|
...normalizeParams(params)
|
|
3449
3446
|
});
|
|
3450
3447
|
}
|
|
3451
|
-
|
|
3448
|
+
// @__NO_SIDE_EFFECTS__
|
|
3452
3449
|
function _xid(Class, params) {
|
|
3453
3450
|
return new Class({
|
|
3454
3451
|
type: "string",
|
|
@@ -3458,7 +3455,7 @@ function _xid(Class, params) {
|
|
|
3458
3455
|
...normalizeParams(params)
|
|
3459
3456
|
});
|
|
3460
3457
|
}
|
|
3461
|
-
|
|
3458
|
+
// @__NO_SIDE_EFFECTS__
|
|
3462
3459
|
function _ksuid(Class, params) {
|
|
3463
3460
|
return new Class({
|
|
3464
3461
|
type: "string",
|
|
@@ -3468,7 +3465,7 @@ function _ksuid(Class, params) {
|
|
|
3468
3465
|
...normalizeParams(params)
|
|
3469
3466
|
});
|
|
3470
3467
|
}
|
|
3471
|
-
|
|
3468
|
+
// @__NO_SIDE_EFFECTS__
|
|
3472
3469
|
function _ipv4(Class, params) {
|
|
3473
3470
|
return new Class({
|
|
3474
3471
|
type: "string",
|
|
@@ -3478,7 +3475,7 @@ function _ipv4(Class, params) {
|
|
|
3478
3475
|
...normalizeParams(params)
|
|
3479
3476
|
});
|
|
3480
3477
|
}
|
|
3481
|
-
|
|
3478
|
+
// @__NO_SIDE_EFFECTS__
|
|
3482
3479
|
function _ipv6(Class, params) {
|
|
3483
3480
|
return new Class({
|
|
3484
3481
|
type: "string",
|
|
@@ -3488,7 +3485,7 @@ function _ipv6(Class, params) {
|
|
|
3488
3485
|
...normalizeParams(params)
|
|
3489
3486
|
});
|
|
3490
3487
|
}
|
|
3491
|
-
|
|
3488
|
+
// @__NO_SIDE_EFFECTS__
|
|
3492
3489
|
function _cidrv4(Class, params) {
|
|
3493
3490
|
return new Class({
|
|
3494
3491
|
type: "string",
|
|
@@ -3498,7 +3495,7 @@ function _cidrv4(Class, params) {
|
|
|
3498
3495
|
...normalizeParams(params)
|
|
3499
3496
|
});
|
|
3500
3497
|
}
|
|
3501
|
-
|
|
3498
|
+
// @__NO_SIDE_EFFECTS__
|
|
3502
3499
|
function _cidrv6(Class, params) {
|
|
3503
3500
|
return new Class({
|
|
3504
3501
|
type: "string",
|
|
@@ -3508,7 +3505,7 @@ function _cidrv6(Class, params) {
|
|
|
3508
3505
|
...normalizeParams(params)
|
|
3509
3506
|
});
|
|
3510
3507
|
}
|
|
3511
|
-
|
|
3508
|
+
// @__NO_SIDE_EFFECTS__
|
|
3512
3509
|
function _base64(Class, params) {
|
|
3513
3510
|
return new Class({
|
|
3514
3511
|
type: "string",
|
|
@@ -3518,7 +3515,7 @@ function _base64(Class, params) {
|
|
|
3518
3515
|
...normalizeParams(params)
|
|
3519
3516
|
});
|
|
3520
3517
|
}
|
|
3521
|
-
|
|
3518
|
+
// @__NO_SIDE_EFFECTS__
|
|
3522
3519
|
function _base64url(Class, params) {
|
|
3523
3520
|
return new Class({
|
|
3524
3521
|
type: "string",
|
|
@@ -3528,7 +3525,7 @@ function _base64url(Class, params) {
|
|
|
3528
3525
|
...normalizeParams(params)
|
|
3529
3526
|
});
|
|
3530
3527
|
}
|
|
3531
|
-
|
|
3528
|
+
// @__NO_SIDE_EFFECTS__
|
|
3532
3529
|
function _e164(Class, params) {
|
|
3533
3530
|
return new Class({
|
|
3534
3531
|
type: "string",
|
|
@@ -3538,7 +3535,7 @@ function _e164(Class, params) {
|
|
|
3538
3535
|
...normalizeParams(params)
|
|
3539
3536
|
});
|
|
3540
3537
|
}
|
|
3541
|
-
|
|
3538
|
+
// @__NO_SIDE_EFFECTS__
|
|
3542
3539
|
function _jwt(Class, params) {
|
|
3543
3540
|
return new Class({
|
|
3544
3541
|
type: "string",
|
|
@@ -3548,7 +3545,7 @@ function _jwt(Class, params) {
|
|
|
3548
3545
|
...normalizeParams(params)
|
|
3549
3546
|
});
|
|
3550
3547
|
}
|
|
3551
|
-
|
|
3548
|
+
// @__NO_SIDE_EFFECTS__
|
|
3552
3549
|
function _isoDateTime(Class, params) {
|
|
3553
3550
|
return new Class({
|
|
3554
3551
|
type: "string",
|
|
@@ -3560,7 +3557,7 @@ function _isoDateTime(Class, params) {
|
|
|
3560
3557
|
...normalizeParams(params)
|
|
3561
3558
|
});
|
|
3562
3559
|
}
|
|
3563
|
-
|
|
3560
|
+
// @__NO_SIDE_EFFECTS__
|
|
3564
3561
|
function _isoDate(Class, params) {
|
|
3565
3562
|
return new Class({
|
|
3566
3563
|
type: "string",
|
|
@@ -3569,7 +3566,7 @@ function _isoDate(Class, params) {
|
|
|
3569
3566
|
...normalizeParams(params)
|
|
3570
3567
|
});
|
|
3571
3568
|
}
|
|
3572
|
-
|
|
3569
|
+
// @__NO_SIDE_EFFECTS__
|
|
3573
3570
|
function _isoTime(Class, params) {
|
|
3574
3571
|
return new Class({
|
|
3575
3572
|
type: "string",
|
|
@@ -3579,7 +3576,7 @@ function _isoTime(Class, params) {
|
|
|
3579
3576
|
...normalizeParams(params)
|
|
3580
3577
|
});
|
|
3581
3578
|
}
|
|
3582
|
-
|
|
3579
|
+
// @__NO_SIDE_EFFECTS__
|
|
3583
3580
|
function _isoDuration(Class, params) {
|
|
3584
3581
|
return new Class({
|
|
3585
3582
|
type: "string",
|
|
@@ -3588,7 +3585,7 @@ function _isoDuration(Class, params) {
|
|
|
3588
3585
|
...normalizeParams(params)
|
|
3589
3586
|
});
|
|
3590
3587
|
}
|
|
3591
|
-
|
|
3588
|
+
// @__NO_SIDE_EFFECTS__
|
|
3592
3589
|
function _number(Class, params) {
|
|
3593
3590
|
return new Class(snapshotChecks({
|
|
3594
3591
|
type: "number",
|
|
@@ -3596,7 +3593,7 @@ function _number(Class, params) {
|
|
|
3596
3593
|
...normalizeParams(params)
|
|
3597
3594
|
}));
|
|
3598
3595
|
}
|
|
3599
|
-
|
|
3596
|
+
// @__NO_SIDE_EFFECTS__
|
|
3600
3597
|
function _int(Class, params) {
|
|
3601
3598
|
return new Class({
|
|
3602
3599
|
type: "number",
|
|
@@ -3606,25 +3603,25 @@ function _int(Class, params) {
|
|
|
3606
3603
|
...normalizeParams(params)
|
|
3607
3604
|
});
|
|
3608
3605
|
}
|
|
3609
|
-
|
|
3606
|
+
// @__NO_SIDE_EFFECTS__
|
|
3610
3607
|
function _boolean(Class, params) {
|
|
3611
3608
|
return new Class({
|
|
3612
3609
|
type: "boolean",
|
|
3613
3610
|
...normalizeParams(params)
|
|
3614
3611
|
});
|
|
3615
3612
|
}
|
|
3616
|
-
|
|
3613
|
+
// @__NO_SIDE_EFFECTS__
|
|
3617
3614
|
function _unknown(Class) {
|
|
3618
3615
|
return new Class({ type: "unknown" });
|
|
3619
3616
|
}
|
|
3620
|
-
|
|
3617
|
+
// @__NO_SIDE_EFFECTS__
|
|
3621
3618
|
function _never(Class, params) {
|
|
3622
3619
|
return new Class({
|
|
3623
3620
|
type: "never",
|
|
3624
3621
|
...normalizeParams(params)
|
|
3625
3622
|
});
|
|
3626
3623
|
}
|
|
3627
|
-
|
|
3624
|
+
// @__NO_SIDE_EFFECTS__
|
|
3628
3625
|
function _lt(value, params) {
|
|
3629
3626
|
return new $ZodCheckLessThan({
|
|
3630
3627
|
check: "less_than",
|
|
@@ -3633,7 +3630,7 @@ function _lt(value, params) {
|
|
|
3633
3630
|
inclusive: false
|
|
3634
3631
|
});
|
|
3635
3632
|
}
|
|
3636
|
-
|
|
3633
|
+
// @__NO_SIDE_EFFECTS__
|
|
3637
3634
|
function _lte(value, params) {
|
|
3638
3635
|
return new $ZodCheckLessThan({
|
|
3639
3636
|
check: "less_than",
|
|
@@ -3642,7 +3639,7 @@ function _lte(value, params) {
|
|
|
3642
3639
|
inclusive: true
|
|
3643
3640
|
});
|
|
3644
3641
|
}
|
|
3645
|
-
|
|
3642
|
+
// @__NO_SIDE_EFFECTS__
|
|
3646
3643
|
function _gt(value, params) {
|
|
3647
3644
|
return new $ZodCheckGreaterThan({
|
|
3648
3645
|
check: "greater_than",
|
|
@@ -3651,7 +3648,7 @@ function _gt(value, params) {
|
|
|
3651
3648
|
inclusive: false
|
|
3652
3649
|
});
|
|
3653
3650
|
}
|
|
3654
|
-
|
|
3651
|
+
// @__NO_SIDE_EFFECTS__
|
|
3655
3652
|
function _gte(value, params) {
|
|
3656
3653
|
return new $ZodCheckGreaterThan({
|
|
3657
3654
|
check: "greater_than",
|
|
@@ -3660,7 +3657,7 @@ function _gte(value, params) {
|
|
|
3660
3657
|
inclusive: true
|
|
3661
3658
|
});
|
|
3662
3659
|
}
|
|
3663
|
-
|
|
3660
|
+
// @__NO_SIDE_EFFECTS__
|
|
3664
3661
|
function _multipleOf(value, params) {
|
|
3665
3662
|
return new $ZodCheckMultipleOf({
|
|
3666
3663
|
check: "multiple_of",
|
|
@@ -3668,16 +3665,15 @@ function _multipleOf(value, params) {
|
|
|
3668
3665
|
value
|
|
3669
3666
|
});
|
|
3670
3667
|
}
|
|
3671
|
-
|
|
3668
|
+
// @__NO_SIDE_EFFECTS__
|
|
3672
3669
|
function _maxLength(maximum, params) {
|
|
3673
|
-
|
|
3670
|
+
return new $ZodCheckMaxLength({
|
|
3674
3671
|
check: "max_length",
|
|
3675
3672
|
...normalizeParams(params),
|
|
3676
3673
|
maximum
|
|
3677
3674
|
});
|
|
3678
|
-
return ch;
|
|
3679
3675
|
}
|
|
3680
|
-
|
|
3676
|
+
// @__NO_SIDE_EFFECTS__
|
|
3681
3677
|
function _minLength(minimum, params) {
|
|
3682
3678
|
return new $ZodCheckMinLength({
|
|
3683
3679
|
check: "min_length",
|
|
@@ -3685,7 +3681,7 @@ function _minLength(minimum, params) {
|
|
|
3685
3681
|
minimum
|
|
3686
3682
|
});
|
|
3687
3683
|
}
|
|
3688
|
-
|
|
3684
|
+
// @__NO_SIDE_EFFECTS__
|
|
3689
3685
|
function _length(length, params) {
|
|
3690
3686
|
return new $ZodCheckLengthEquals({
|
|
3691
3687
|
check: "length_equals",
|
|
@@ -3693,7 +3689,7 @@ function _length(length, params) {
|
|
|
3693
3689
|
length
|
|
3694
3690
|
});
|
|
3695
3691
|
}
|
|
3696
|
-
|
|
3692
|
+
// @__NO_SIDE_EFFECTS__
|
|
3697
3693
|
function _regex(pattern, params) {
|
|
3698
3694
|
return new $ZodCheckRegex({
|
|
3699
3695
|
check: "string_format",
|
|
@@ -3702,7 +3698,7 @@ function _regex(pattern, params) {
|
|
|
3702
3698
|
pattern
|
|
3703
3699
|
});
|
|
3704
3700
|
}
|
|
3705
|
-
|
|
3701
|
+
// @__NO_SIDE_EFFECTS__
|
|
3706
3702
|
function _lowercase(params) {
|
|
3707
3703
|
return new $ZodCheckLowerCase({
|
|
3708
3704
|
check: "string_format",
|
|
@@ -3710,7 +3706,7 @@ function _lowercase(params) {
|
|
|
3710
3706
|
...normalizeParams(params)
|
|
3711
3707
|
});
|
|
3712
3708
|
}
|
|
3713
|
-
|
|
3709
|
+
// @__NO_SIDE_EFFECTS__
|
|
3714
3710
|
function _uppercase(params) {
|
|
3715
3711
|
return new $ZodCheckUpperCase({
|
|
3716
3712
|
check: "string_format",
|
|
@@ -3718,7 +3714,7 @@ function _uppercase(params) {
|
|
|
3718
3714
|
...normalizeParams(params)
|
|
3719
3715
|
});
|
|
3720
3716
|
}
|
|
3721
|
-
|
|
3717
|
+
// @__NO_SIDE_EFFECTS__
|
|
3722
3718
|
function _includes(includes, params) {
|
|
3723
3719
|
return new $ZodCheckIncludes({
|
|
3724
3720
|
check: "string_format",
|
|
@@ -3727,7 +3723,7 @@ function _includes(includes, params) {
|
|
|
3727
3723
|
includes
|
|
3728
3724
|
});
|
|
3729
3725
|
}
|
|
3730
|
-
|
|
3726
|
+
// @__NO_SIDE_EFFECTS__
|
|
3731
3727
|
function _startsWith(prefix, params) {
|
|
3732
3728
|
return new $ZodCheckStartsWith({
|
|
3733
3729
|
check: "string_format",
|
|
@@ -3736,7 +3732,7 @@ function _startsWith(prefix, params) {
|
|
|
3736
3732
|
prefix
|
|
3737
3733
|
});
|
|
3738
3734
|
}
|
|
3739
|
-
|
|
3735
|
+
// @__NO_SIDE_EFFECTS__
|
|
3740
3736
|
function _endsWith(suffix, params) {
|
|
3741
3737
|
return new $ZodCheckEndsWith({
|
|
3742
3738
|
check: "string_format",
|
|
@@ -3745,34 +3741,34 @@ function _endsWith(suffix, params) {
|
|
|
3745
3741
|
suffix
|
|
3746
3742
|
});
|
|
3747
3743
|
}
|
|
3748
|
-
|
|
3744
|
+
// @__NO_SIDE_EFFECTS__
|
|
3749
3745
|
function _overwrite(tx) {
|
|
3750
3746
|
return new $ZodCheckOverwrite({
|
|
3751
3747
|
check: "overwrite",
|
|
3752
3748
|
tx
|
|
3753
3749
|
});
|
|
3754
3750
|
}
|
|
3755
|
-
|
|
3751
|
+
// @__NO_SIDE_EFFECTS__
|
|
3756
3752
|
function _normalize(form) {
|
|
3757
3753
|
return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
|
|
3758
3754
|
}
|
|
3759
|
-
|
|
3755
|
+
// @__NO_SIDE_EFFECTS__
|
|
3760
3756
|
function _trim() {
|
|
3761
3757
|
return /* @__PURE__ */ _overwrite((input) => input.trim());
|
|
3762
3758
|
}
|
|
3763
|
-
|
|
3759
|
+
// @__NO_SIDE_EFFECTS__
|
|
3764
3760
|
function _toLowerCase() {
|
|
3765
3761
|
return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
|
|
3766
3762
|
}
|
|
3767
|
-
|
|
3763
|
+
// @__NO_SIDE_EFFECTS__
|
|
3768
3764
|
function _toUpperCase() {
|
|
3769
3765
|
return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
|
|
3770
3766
|
}
|
|
3771
|
-
|
|
3767
|
+
// @__NO_SIDE_EFFECTS__
|
|
3772
3768
|
function _slugify() {
|
|
3773
3769
|
return /* @__PURE__ */ _overwrite((input) => slugify(input));
|
|
3774
3770
|
}
|
|
3775
|
-
|
|
3771
|
+
// @__NO_SIDE_EFFECTS__
|
|
3776
3772
|
function _array(Class, element, params) {
|
|
3777
3773
|
return new Class({
|
|
3778
3774
|
type: "array",
|
|
@@ -3780,35 +3776,33 @@ function _array(Class, element, params) {
|
|
|
3780
3776
|
...normalizeParams(params)
|
|
3781
3777
|
});
|
|
3782
3778
|
}
|
|
3783
|
-
|
|
3779
|
+
// @__NO_SIDE_EFFECTS__
|
|
3784
3780
|
function _custom(Class, fn, _params) {
|
|
3785
3781
|
const norm = normalizeParams(_params);
|
|
3786
3782
|
norm.abort ?? (norm.abort = true);
|
|
3787
|
-
|
|
3783
|
+
return new Class({
|
|
3788
3784
|
type: "custom",
|
|
3789
3785
|
check: "custom",
|
|
3790
3786
|
fn,
|
|
3791
3787
|
...norm
|
|
3792
3788
|
});
|
|
3793
|
-
return schema;
|
|
3794
3789
|
}
|
|
3795
|
-
|
|
3790
|
+
// @__NO_SIDE_EFFECTS__
|
|
3796
3791
|
function _refine(Class, fn, _params) {
|
|
3797
|
-
|
|
3792
|
+
return new Class({
|
|
3798
3793
|
type: "custom",
|
|
3799
3794
|
check: "custom",
|
|
3800
3795
|
fn,
|
|
3801
3796
|
...normalizeParams(_params)
|
|
3802
3797
|
});
|
|
3803
|
-
return schema;
|
|
3804
3798
|
}
|
|
3805
|
-
|
|
3799
|
+
// @__NO_SIDE_EFFECTS__
|
|
3806
3800
|
function _superRefine(fn, params) {
|
|
3807
3801
|
const ch = /* @__PURE__ */ _check((payload) => {
|
|
3808
|
-
payload.addIssue = (issue$
|
|
3809
|
-
if (typeof issue$
|
|
3802
|
+
payload.addIssue = (issue$2) => {
|
|
3803
|
+
if (typeof issue$2 === "string") payload.issues.push(issue(issue$2, payload.value, ch._zod.def));
|
|
3810
3804
|
else {
|
|
3811
|
-
const _issue = issue$
|
|
3805
|
+
const _issue = issue$2;
|
|
3812
3806
|
if (_issue.fatal) _issue.continue = false;
|
|
3813
3807
|
_issue.code ?? (_issue.code = "custom");
|
|
3814
3808
|
if (!("input" in _issue)) _issue.input = payload.value;
|
|
@@ -3821,7 +3815,7 @@ function _superRefine(fn, params) {
|
|
|
3821
3815
|
}, params);
|
|
3822
3816
|
return ch;
|
|
3823
3817
|
}
|
|
3824
|
-
|
|
3818
|
+
// @__NO_SIDE_EFFECTS__
|
|
3825
3819
|
function _check(fn, params) {
|
|
3826
3820
|
const ch = new $ZodCheck({
|
|
3827
3821
|
check: "custom",
|
|
@@ -3830,33 +3824,6 @@ function _check(fn, params) {
|
|
|
3830
3824
|
ch._zod.check = fn;
|
|
3831
3825
|
return ch;
|
|
3832
3826
|
}
|
|
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
3827
|
//#endregion
|
|
3861
3828
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.js
|
|
3862
3829
|
function assignProps(target, ...sources) {
|
|
@@ -3905,13 +3872,12 @@ function processSchema(schema, ctx, _params = {
|
|
|
3905
3872
|
path: [],
|
|
3906
3873
|
schemaPath: []
|
|
3907
3874
|
}) {
|
|
3908
|
-
var _a
|
|
3875
|
+
var _a;
|
|
3909
3876
|
const def = schema._zod.def;
|
|
3910
3877
|
const seen = ctx.seen.get(schema);
|
|
3911
3878
|
if (seen) {
|
|
3912
3879
|
seen.count++;
|
|
3913
|
-
|
|
3914
|
-
if (isCycle) seen.cycle = _params.path;
|
|
3880
|
+
if (_params.schemaPath.includes(schema)) seen.cycle = _params.path;
|
|
3915
3881
|
return seen.schema;
|
|
3916
3882
|
}
|
|
3917
3883
|
const result = {
|
|
@@ -3945,16 +3911,15 @@ function processSchema(schema, ctx, _params = {
|
|
|
3945
3911
|
ctx.seen.get(parent).isParent = true;
|
|
3946
3912
|
}
|
|
3947
3913
|
}
|
|
3948
|
-
const meta
|
|
3949
|
-
if (meta
|
|
3914
|
+
const meta = ctx.metadataRegistry.get(schema);
|
|
3915
|
+
if (meta) assignProps(result.schema, meta);
|
|
3950
3916
|
if (ctx.io === "input" && isTransforming(schema)) {
|
|
3951
3917
|
delete result.schema.examples;
|
|
3952
3918
|
delete result.schema.default;
|
|
3953
3919
|
}
|
|
3954
|
-
if (ctx.io === "input" && "_prefault" in result.schema) (_a
|
|
3920
|
+
if (ctx.io === "input" && "_prefault" in result.schema) (_a = result.schema).default ?? (_a.default = result.schema._prefault);
|
|
3955
3921
|
delete result.schema._prefault;
|
|
3956
|
-
|
|
3957
|
-
return _result.schema;
|
|
3922
|
+
return ctx.seen.get(schema).schema;
|
|
3958
3923
|
}
|
|
3959
3924
|
function encodeJSONPointerSegment(segment) {
|
|
3960
3925
|
return segment.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
@@ -3976,7 +3941,7 @@ function extractDefs(ctx, schema) {
|
|
|
3976
3941
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
3977
3942
|
if (ctx.external) {
|
|
3978
3943
|
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
3979
|
-
const uriGenerator = ctx.external.uri ?? ((id
|
|
3944
|
+
const uriGenerator = ctx.external.uri ?? ((id) => id);
|
|
3980
3945
|
if (externalId) return { ref: uriGenerator(externalId) };
|
|
3981
3946
|
const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
3982
3947
|
entry[1].defId = id;
|
|
@@ -4000,9 +3965,9 @@ function extractDefs(ctx, schema) {
|
|
|
4000
3965
|
const { ref, defId } = makeURI(entry);
|
|
4001
3966
|
seen.def = { ...seen.schema };
|
|
4002
3967
|
if (defId) seen.defId = defId;
|
|
4003
|
-
const schema
|
|
4004
|
-
for (const key in schema
|
|
4005
|
-
schema
|
|
3968
|
+
const schema = seen.schema;
|
|
3969
|
+
for (const key in schema) delete schema[key];
|
|
3970
|
+
schema.$ref = ref;
|
|
4006
3971
|
};
|
|
4007
3972
|
if (ctx.cycles === "throw") for (const entry of ctx.seen.entries()) {
|
|
4008
3973
|
const seen = entry[1];
|
|
@@ -4023,8 +3988,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4023
3988
|
continue;
|
|
4024
3989
|
}
|
|
4025
3990
|
}
|
|
4026
|
-
|
|
4027
|
-
if (id) {
|
|
3991
|
+
if (ctx.metadataRegistry.get(entry[0])?.id) {
|
|
4028
3992
|
extractToDef(entry);
|
|
4029
3993
|
continue;
|
|
4030
3994
|
}
|
|
@@ -4060,7 +4024,7 @@ function compactTypeUnion(schema) {
|
|
|
4060
4024
|
/** Keywords `foldIntersection` knows how to combine. Anything else — `$ref`, `patternProperties`,
|
|
4061
4025
|
* an annotation like `description` — makes a member unfoldable, so a constraint this does not
|
|
4062
4026
|
* understand leaves the `allOf` alone instead of being silently dropped or misattributed. */
|
|
4063
|
-
const FOLDABLE_KEYS = new Set([
|
|
4027
|
+
const FOLDABLE_KEYS = /* @__PURE__ */ new Set([
|
|
4064
4028
|
"type",
|
|
4065
4029
|
"properties",
|
|
4066
4030
|
"required",
|
|
@@ -4074,17 +4038,17 @@ function undeclaredConstraint(member) {
|
|
|
4074
4038
|
return Object.keys(extra).length ? extra : null;
|
|
4075
4039
|
}
|
|
4076
4040
|
/** 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
|
|
4041
|
+
function foldObjects(members) {
|
|
4078
4042
|
const objects = [];
|
|
4079
|
-
for (const member of members
|
|
4043
|
+
for (const member of members) {
|
|
4080
4044
|
if (typeof member !== "object" || member.type !== "object") return null;
|
|
4081
4045
|
for (const key in member) if (!FOLDABLE_KEYS.has(key)) return null;
|
|
4082
4046
|
objects.push(member);
|
|
4083
4047
|
}
|
|
4084
4048
|
const properties = {};
|
|
4085
|
-
const required
|
|
4086
|
-
for (const object
|
|
4087
|
-
for (const key in object
|
|
4049
|
+
const required = /* @__PURE__ */ new Set();
|
|
4050
|
+
for (const object of objects) {
|
|
4051
|
+
for (const key in object.properties) {
|
|
4088
4052
|
if (Object.prototype.hasOwnProperty.call(properties, key)) continue;
|
|
4089
4053
|
const parts = [];
|
|
4090
4054
|
for (const other of objects) {
|
|
@@ -4092,21 +4056,20 @@ function foldObjects(members$1) {
|
|
|
4092
4056
|
if (part === null || part === void 0) continue;
|
|
4093
4057
|
if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part))) parts.push(part);
|
|
4094
4058
|
}
|
|
4095
|
-
|
|
4096
|
-
assignProp(properties, key, merged);
|
|
4059
|
+
assignProp(properties, key, parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts });
|
|
4097
4060
|
}
|
|
4098
|
-
for (const key of object
|
|
4061
|
+
for (const key of object.required ?? []) required.add(key);
|
|
4099
4062
|
}
|
|
4100
4063
|
const folded = {
|
|
4101
4064
|
type: "object",
|
|
4102
4065
|
properties
|
|
4103
4066
|
};
|
|
4104
|
-
if (required
|
|
4105
|
-
if (objects.every((object
|
|
4067
|
+
if (required.size) folded.required = [...required];
|
|
4068
|
+
if (objects.every((object) => object.additionalProperties === false)) folded.additionalProperties = false;
|
|
4106
4069
|
else {
|
|
4107
4070
|
const constraints = [];
|
|
4108
|
-
for (const object
|
|
4109
|
-
const constraint = undeclaredConstraint(object
|
|
4071
|
+
for (const object of objects) {
|
|
4072
|
+
const constraint = undeclaredConstraint(object);
|
|
4110
4073
|
if (constraint && !constraints.some((seen) => JSON.stringify(seen) === JSON.stringify(constraint))) constraints.push(constraint);
|
|
4111
4074
|
}
|
|
4112
4075
|
if (constraints.length === 1) folded.additionalProperties = constraints[0];
|
|
@@ -4131,11 +4094,11 @@ function foldIntersection(json) {
|
|
|
4131
4094
|
let folded = null;
|
|
4132
4095
|
if (!unions.length) folded = foldObjects(allOf);
|
|
4133
4096
|
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
|
|
4097
|
+
const union = unions[0];
|
|
4098
|
+
const keyword = UNION_KEYS.find((k) => Array.isArray(union[k]));
|
|
4099
|
+
if (Object.keys(union).length !== 1) return;
|
|
4100
|
+
const rest = allOf.filter((m) => m !== union);
|
|
4101
|
+
const branches = union[keyword].map((branch) => foldObjects([...rest, branch]));
|
|
4139
4102
|
if (branches.some((b) => !b)) return;
|
|
4140
4103
|
folded = { [keyword]: branches };
|
|
4141
4104
|
}
|
|
@@ -4149,8 +4112,8 @@ function finalize(ctx, schema) {
|
|
|
4149
4112
|
const flattenRef = (zodSchema) => {
|
|
4150
4113
|
const seen = ctx.seen.get(zodSchema);
|
|
4151
4114
|
if (seen.ref === null) return;
|
|
4152
|
-
const schema
|
|
4153
|
-
const _cached = { ...schema
|
|
4115
|
+
const schema = seen.def ?? seen.schema;
|
|
4116
|
+
const _cached = { ...schema };
|
|
4154
4117
|
const ref = seen.ref;
|
|
4155
4118
|
seen.ref = null;
|
|
4156
4119
|
if (ref) {
|
|
@@ -4158,18 +4121,17 @@ function finalize(ctx, schema) {
|
|
|
4158
4121
|
const refSeen = ctx.seen.get(ref);
|
|
4159
4122
|
const refSchema = refSeen.schema;
|
|
4160
4123
|
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) {
|
|
4124
|
+
schema.allOf = schema.allOf ?? [];
|
|
4125
|
+
schema.allOf.push(refSchema);
|
|
4126
|
+
} else assignProps(schema, refSchema);
|
|
4127
|
+
assignProps(schema, _cached);
|
|
4128
|
+
if (zodSchema._zod.parent === ref) for (const key in schema) {
|
|
4167
4129
|
if (key === "$ref" || key === "allOf") continue;
|
|
4168
|
-
if (!(key in _cached)) delete schema
|
|
4130
|
+
if (!(key in _cached)) delete schema[key];
|
|
4169
4131
|
}
|
|
4170
|
-
if (refSchema.$ref && refSeen.def) for (const key in schema
|
|
4132
|
+
if (refSchema.$ref && refSeen.def) for (const key in schema) {
|
|
4171
4133
|
if (key === "$ref" || key === "allOf") continue;
|
|
4172
|
-
if (key in refSeen.def && JSON.stringify(schema
|
|
4134
|
+
if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) delete schema[key];
|
|
4173
4135
|
}
|
|
4174
4136
|
}
|
|
4175
4137
|
const parent = zodSchema._zod.parent;
|
|
@@ -4177,16 +4139,16 @@ function finalize(ctx, schema) {
|
|
|
4177
4139
|
flattenRef(parent);
|
|
4178
4140
|
const parentSeen = ctx.seen.get(parent);
|
|
4179
4141
|
if (parentSeen?.schema.$ref) {
|
|
4180
|
-
schema
|
|
4181
|
-
if (parentSeen.def) for (const key in schema
|
|
4142
|
+
schema.$ref = parentSeen.schema.$ref;
|
|
4143
|
+
if (parentSeen.def) for (const key in schema) {
|
|
4182
4144
|
if (key === "$ref" || key === "allOf") continue;
|
|
4183
|
-
if (key in parentSeen.def && JSON.stringify(schema
|
|
4145
|
+
if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) delete schema[key];
|
|
4184
4146
|
}
|
|
4185
4147
|
}
|
|
4186
4148
|
}
|
|
4187
4149
|
ctx.override({
|
|
4188
4150
|
zodSchema,
|
|
4189
|
-
jsonSchema: schema
|
|
4151
|
+
jsonSchema: schema,
|
|
4190
4152
|
path: seen.path ?? []
|
|
4191
4153
|
});
|
|
4192
4154
|
};
|
|
@@ -4228,8 +4190,10 @@ function finalize(ctx, schema) {
|
|
|
4228
4190
|
}
|
|
4229
4191
|
}
|
|
4230
4192
|
if (ctx.external) ctx.sharedEmitDoneFor = ctx.external;
|
|
4231
|
-
if (ctx.external) {} else if (Object.keys(defs).length > 0)
|
|
4232
|
-
|
|
4193
|
+
if (ctx.external) {} else if (Object.keys(defs).length > 0) {
|
|
4194
|
+
if (ctx.target === "draft-2020-12") result.$defs = defs;
|
|
4195
|
+
else result.definitions = defs;
|
|
4196
|
+
}
|
|
4233
4197
|
try {
|
|
4234
4198
|
const finalized = JSON.parse(JSON.stringify(result));
|
|
4235
4199
|
Object.defineProperty(finalized, "~standard", {
|
|
@@ -4304,7 +4268,6 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
4304
4268
|
extractDefs(ctx, schema);
|
|
4305
4269
|
return finalize(ctx, schema);
|
|
4306
4270
|
};
|
|
4307
|
-
|
|
4308
4271
|
//#endregion
|
|
4309
4272
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.js
|
|
4310
4273
|
const narrowMin = (agg, key, value) => {
|
|
@@ -4386,7 +4349,7 @@ const formatMap = {
|
|
|
4386
4349
|
json_string: "json-string",
|
|
4387
4350
|
regex: ""
|
|
4388
4351
|
};
|
|
4389
|
-
const exactPatterns = new Map([[base64Charset, base64], [base64urlCharset, base64url]]);
|
|
4352
|
+
const exactPatterns = /* @__PURE__ */ new Map([[base64Charset, base64], [base64urlCharset, base64url]]);
|
|
4390
4353
|
const exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
4391
4354
|
const stringProcessor = (schema, ctx, _json, _params) => {
|
|
4392
4355
|
const json = _json;
|
|
@@ -4416,16 +4379,18 @@ const numberProcessor = (schema, ctx, _json, params) => {
|
|
|
4416
4379
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
4417
4380
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
4418
4381
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
4419
|
-
if (exMin)
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
if (
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4382
|
+
if (exMin) {
|
|
4383
|
+
if (legacy) {
|
|
4384
|
+
json.minimum = exclusiveMinimum;
|
|
4385
|
+
json.exclusiveMinimum = true;
|
|
4386
|
+
} else json.exclusiveMinimum = exclusiveMinimum;
|
|
4387
|
+
} else if (typeof minimum === "number") json.minimum = minimum;
|
|
4388
|
+
if (exMax) {
|
|
4389
|
+
if (legacy) {
|
|
4390
|
+
json.maximum = exclusiveMaximum;
|
|
4391
|
+
json.exclusiveMaximum = true;
|
|
4392
|
+
} else json.exclusiveMaximum = exclusiveMaximum;
|
|
4393
|
+
} else if (typeof maximum === "number") json.maximum = maximum;
|
|
4429
4394
|
if (multipleOf) {
|
|
4430
4395
|
const divisors = /* @__PURE__ */ new Set();
|
|
4431
4396
|
for (const divisor of multipleOf) if (Number.isFinite(divisor) && divisor !== 0) divisors.add(Math.abs(divisor));
|
|
@@ -4438,10 +4403,33 @@ const numberProcessor = (schema, ctx, _json, params) => {
|
|
|
4438
4403
|
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
4439
4404
|
json.type = "boolean";
|
|
4440
4405
|
};
|
|
4406
|
+
const bigintProcessor = (schema, ctx, json, params) => {
|
|
4407
|
+
handleUnrepresentable(schema, ctx, json, params, "BigInt cannot be represented in JSON Schema");
|
|
4408
|
+
};
|
|
4409
|
+
const symbolProcessor = (schema, ctx, json, params) => {
|
|
4410
|
+
handleUnrepresentable(schema, ctx, json, params, "Symbols cannot be represented in JSON Schema");
|
|
4411
|
+
};
|
|
4412
|
+
const nullProcessor = (_schema, ctx, json, _params) => {
|
|
4413
|
+
if (ctx.target === "openapi-3.0") {
|
|
4414
|
+
json.type = "string";
|
|
4415
|
+
json.nullable = true;
|
|
4416
|
+
json.enum = [null];
|
|
4417
|
+
} else json.type = "null";
|
|
4418
|
+
};
|
|
4419
|
+
const undefinedProcessor = (schema, ctx, json, params) => {
|
|
4420
|
+
handleUnrepresentable(schema, ctx, json, params, "Undefined cannot be represented in JSON Schema");
|
|
4421
|
+
};
|
|
4422
|
+
const voidProcessor = (schema, ctx, json, params) => {
|
|
4423
|
+
handleUnrepresentable(schema, ctx, json, params, "Void cannot be represented in JSON Schema");
|
|
4424
|
+
};
|
|
4441
4425
|
const neverProcessor = (_schema, _ctx, json, _params) => {
|
|
4442
4426
|
json.not = {};
|
|
4443
4427
|
};
|
|
4428
|
+
const anyProcessor = (_schema, _ctx, _json, _params) => {};
|
|
4444
4429
|
const unknownProcessor = (_schema, _ctx, _json, _params) => {};
|
|
4430
|
+
const dateProcessor = (schema, ctx, json, params) => {
|
|
4431
|
+
handleUnrepresentable(schema, ctx, json, params, "Date cannot be represented in JSON Schema");
|
|
4432
|
+
};
|
|
4445
4433
|
const enumProcessor = (schema, _ctx, json, _params) => {
|
|
4446
4434
|
const def = schema._zod.def;
|
|
4447
4435
|
const values = getEnumValues(def.entries);
|
|
@@ -4479,12 +4467,47 @@ const literalProcessor = (schema, ctx, json, params) => {
|
|
|
4479
4467
|
json.enum = vals;
|
|
4480
4468
|
}
|
|
4481
4469
|
};
|
|
4470
|
+
const nanProcessor = (schema, ctx, json, params) => {
|
|
4471
|
+
handleUnrepresentable(schema, ctx, json, params, "NaN cannot be represented in JSON Schema");
|
|
4472
|
+
};
|
|
4473
|
+
const templateLiteralProcessor = (schema, _ctx, json, _params) => {
|
|
4474
|
+
const _json = json;
|
|
4475
|
+
const pattern = schema._zod.pattern;
|
|
4476
|
+
if (!pattern) throw new Error("Pattern not found in template literal");
|
|
4477
|
+
_json.type = "string";
|
|
4478
|
+
_json.pattern = pattern.source;
|
|
4479
|
+
};
|
|
4480
|
+
const fileProcessor = (schema, _ctx, json, _params) => {
|
|
4481
|
+
const _json = json;
|
|
4482
|
+
_json.type = "string";
|
|
4483
|
+
_json.format = "binary";
|
|
4484
|
+
_json.contentEncoding = "binary";
|
|
4485
|
+
const { minimum, maximum, mime } = aggregateChecks(schema);
|
|
4486
|
+
if (minimum !== void 0) _json.minLength = minimum;
|
|
4487
|
+
if (maximum !== void 0) _json.maxLength = maximum;
|
|
4488
|
+
if (!mime) return;
|
|
4489
|
+
if (mime.length === 0) _json.not = {};
|
|
4490
|
+
else if (mime.length === 1) _json.contentMediaType = mime[0];
|
|
4491
|
+
else _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
4492
|
+
};
|
|
4493
|
+
const successProcessor = (_schema, _ctx, json, _params) => {
|
|
4494
|
+
json.type = "boolean";
|
|
4495
|
+
};
|
|
4482
4496
|
const customProcessor = (schema, ctx, json, params) => {
|
|
4483
4497
|
handleUnrepresentable(schema, ctx, json, params, "Custom types cannot be represented in JSON Schema");
|
|
4484
4498
|
};
|
|
4499
|
+
const functionProcessor = (schema, ctx, json, params) => {
|
|
4500
|
+
handleUnrepresentable(schema, ctx, json, params, "Function types cannot be represented in JSON Schema");
|
|
4501
|
+
};
|
|
4485
4502
|
const transformProcessor = (schema, ctx, json, params) => {
|
|
4486
4503
|
handleUnrepresentable(schema, ctx, json, params, "Transforms cannot be represented in JSON Schema");
|
|
4487
4504
|
};
|
|
4505
|
+
const mapProcessor = (schema, ctx, json, params) => {
|
|
4506
|
+
handleUnrepresentable(schema, ctx, json, params, "Map cannot be represented in JSON Schema");
|
|
4507
|
+
};
|
|
4508
|
+
const setProcessor = (schema, ctx, json, params) => {
|
|
4509
|
+
handleUnrepresentable(schema, ctx, json, params, "Set cannot be represented in JSON Schema");
|
|
4510
|
+
};
|
|
4488
4511
|
const arrayProcessor = (schema, ctx, _json, params) => {
|
|
4489
4512
|
const json = _json;
|
|
4490
4513
|
const def = schema._zod.def;
|
|
@@ -4507,8 +4530,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
4507
4530
|
const json = _json;
|
|
4508
4531
|
const def = schema._zod.def;
|
|
4509
4532
|
const shape = def.shape;
|
|
4510
|
-
|
|
4511
|
-
if (symbolKeys.length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
|
|
4533
|
+
if (Object.getOwnPropertySymbols(shape).length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
|
|
4512
4534
|
json.type = "object";
|
|
4513
4535
|
json.properties = {};
|
|
4514
4536
|
for (const key in shape) assignProp(json.properties, key, processSchema(shape[key], ctx, {
|
|
@@ -4570,6 +4592,58 @@ const intersectionProcessor = (schema, ctx, json, params) => {
|
|
|
4570
4592
|
json.allOf = allOf;
|
|
4571
4593
|
ctx.intersections.push(allOf);
|
|
4572
4594
|
};
|
|
4595
|
+
const tupleProcessor = (schema, ctx, _json, params) => {
|
|
4596
|
+
const json = _json;
|
|
4597
|
+
const def = schema._zod.def;
|
|
4598
|
+
json.type = "array";
|
|
4599
|
+
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
4600
|
+
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
4601
|
+
const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
|
|
4602
|
+
...params,
|
|
4603
|
+
path: [
|
|
4604
|
+
...params.path,
|
|
4605
|
+
prefixPath,
|
|
4606
|
+
i
|
|
4607
|
+
]
|
|
4608
|
+
}));
|
|
4609
|
+
const rest = def.rest ? processSchema(def.rest, ctx, {
|
|
4610
|
+
...params,
|
|
4611
|
+
path: [
|
|
4612
|
+
...params.path,
|
|
4613
|
+
restPath,
|
|
4614
|
+
...ctx.target === "openapi-3.0" ? [def.items.length] : []
|
|
4615
|
+
]
|
|
4616
|
+
}) : null;
|
|
4617
|
+
let minItems = def.items.length;
|
|
4618
|
+
while (minItems > 0) {
|
|
4619
|
+
const item = def.items[minItems - 1];
|
|
4620
|
+
if (!(ctx.io === "input" ? inputOptin(item) !== void 0 : item._zod.optout === "optional")) break;
|
|
4621
|
+
minItems--;
|
|
4622
|
+
}
|
|
4623
|
+
const maxItems = def.items.length;
|
|
4624
|
+
const isClosed = !def.rest;
|
|
4625
|
+
if (ctx.target === "draft-2020-12") {
|
|
4626
|
+
json.prefixItems = prefixItems;
|
|
4627
|
+
if (isClosed) json.items = false;
|
|
4628
|
+
else if (rest) json.items = rest;
|
|
4629
|
+
if (minItems > 0) json.minItems = minItems;
|
|
4630
|
+
if (isClosed) json.maxItems = maxItems;
|
|
4631
|
+
} else if (ctx.target === "openapi-3.0") {
|
|
4632
|
+
json.items = { anyOf: prefixItems };
|
|
4633
|
+
if (rest) json.items.anyOf.push(rest);
|
|
4634
|
+
if (minItems > 0) json.minItems = minItems;
|
|
4635
|
+
if (isClosed) json.maxItems = maxItems;
|
|
4636
|
+
} else {
|
|
4637
|
+
json.items = prefixItems;
|
|
4638
|
+
if (isClosed) json.additionalItems = false;
|
|
4639
|
+
else if (rest) json.additionalItems = rest;
|
|
4640
|
+
if (minItems > 0) json.minItems = minItems;
|
|
4641
|
+
if (isClosed) json.maxItems = maxItems;
|
|
4642
|
+
}
|
|
4643
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
4644
|
+
if (typeof minimum === "number") json.minItems = minimum;
|
|
4645
|
+
if (typeof maximum === "number") json.maxItems = maximum;
|
|
4646
|
+
};
|
|
4573
4647
|
/** JSON object keys are always strings, so a numeric record key schema is re-expressed over the
|
|
4574
4648
|
* numeric-string form the record parser matches. Deferred to `finalize`, after the flatten: a key
|
|
4575
4649
|
* behind a wrapper only carries its own `type` before then, and a union key only has its branches.
|
|
@@ -4601,7 +4675,7 @@ function stringifyKeyNames(bySchema, json, visited) {
|
|
|
4601
4675
|
const numericType = !types.includes("string") && types.some((t) => t === "number" || t === "integer");
|
|
4602
4676
|
const values = json.enum ?? (json.const !== void 0 ? [json.const] : void 0);
|
|
4603
4677
|
if (!numericType && !values?.some((v) => typeof v === "number")) return json;
|
|
4604
|
-
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id
|
|
4678
|
+
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;
|
|
4605
4679
|
if (rest.enum) rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
|
|
4606
4680
|
else if (typeof rest.const === "number") rest.const = String(rest.const);
|
|
4607
4681
|
if (!numericType) return rest;
|
|
@@ -4615,8 +4689,8 @@ function rewriteKeyNames(ctx) {
|
|
|
4615
4689
|
const bySchema = /* @__PURE__ */ new Map();
|
|
4616
4690
|
for (const entry of ctx.seen.values()) if (entry.def && !bySchema.has(entry.schema)) bySchema.set(entry.schema, entry);
|
|
4617
4691
|
const rewrites = /* @__PURE__ */ new Map();
|
|
4618
|
-
for (const record
|
|
4619
|
-
const seen = ctx.seen.get(record
|
|
4692
|
+
for (const record of pendingRecords.get(ctx) ?? []) {
|
|
4693
|
+
const seen = ctx.seen.get(record);
|
|
4620
4694
|
const names = (seen?.def ?? seen?.schema)?.propertyNames;
|
|
4621
4695
|
if (!names || names === true || rewrites.has(names)) continue;
|
|
4622
4696
|
const rewritten = stringifyKeyNames(bySchema, names, /* @__PURE__ */ new Set());
|
|
@@ -4747,13 +4821,99 @@ const readonlyProcessor = (schema, ctx, json, params) => {
|
|
|
4747
4821
|
seen.ref = def.innerType;
|
|
4748
4822
|
json.readOnly = true;
|
|
4749
4823
|
};
|
|
4824
|
+
const promiseProcessor = (schema, ctx, _json, params) => {
|
|
4825
|
+
const def = schema._zod.def;
|
|
4826
|
+
processSchema(def.innerType, ctx, params);
|
|
4827
|
+
const seen = ctx.seen.get(schema);
|
|
4828
|
+
seen.ref = def.innerType;
|
|
4829
|
+
};
|
|
4750
4830
|
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
4751
4831
|
const def = schema._zod.def;
|
|
4752
4832
|
processSchema(def.innerType, ctx, params);
|
|
4753
4833
|
const seen = ctx.seen.get(schema);
|
|
4754
4834
|
seen.ref = def.innerType;
|
|
4755
4835
|
};
|
|
4756
|
-
|
|
4836
|
+
const lazyProcessor = (schema, ctx, _json, params) => {
|
|
4837
|
+
const innerType = schema._zod.innerType;
|
|
4838
|
+
processSchema(innerType, ctx, params);
|
|
4839
|
+
const seen = ctx.seen.get(schema);
|
|
4840
|
+
seen.ref = innerType;
|
|
4841
|
+
};
|
|
4842
|
+
const allProcessors = {
|
|
4843
|
+
string: stringProcessor,
|
|
4844
|
+
number: numberProcessor,
|
|
4845
|
+
boolean: booleanProcessor,
|
|
4846
|
+
bigint: bigintProcessor,
|
|
4847
|
+
symbol: symbolProcessor,
|
|
4848
|
+
null: nullProcessor,
|
|
4849
|
+
undefined: undefinedProcessor,
|
|
4850
|
+
void: voidProcessor,
|
|
4851
|
+
never: neverProcessor,
|
|
4852
|
+
any: anyProcessor,
|
|
4853
|
+
unknown: unknownProcessor,
|
|
4854
|
+
date: dateProcessor,
|
|
4855
|
+
enum: enumProcessor,
|
|
4856
|
+
literal: literalProcessor,
|
|
4857
|
+
nan: nanProcessor,
|
|
4858
|
+
template_literal: templateLiteralProcessor,
|
|
4859
|
+
file: fileProcessor,
|
|
4860
|
+
success: successProcessor,
|
|
4861
|
+
custom: customProcessor,
|
|
4862
|
+
function: functionProcessor,
|
|
4863
|
+
transform: transformProcessor,
|
|
4864
|
+
map: mapProcessor,
|
|
4865
|
+
set: setProcessor,
|
|
4866
|
+
array: arrayProcessor,
|
|
4867
|
+
object: objectProcessor,
|
|
4868
|
+
union: unionProcessor,
|
|
4869
|
+
intersection: intersectionProcessor,
|
|
4870
|
+
tuple: tupleProcessor,
|
|
4871
|
+
record: recordProcessor,
|
|
4872
|
+
nullable: nullableProcessor,
|
|
4873
|
+
nonoptional: nonoptionalProcessor,
|
|
4874
|
+
default: defaultProcessor,
|
|
4875
|
+
prefault: prefaultProcessor,
|
|
4876
|
+
catch: catchProcessor,
|
|
4877
|
+
pipe: pipeProcessor,
|
|
4878
|
+
readonly: readonlyProcessor,
|
|
4879
|
+
promise: promiseProcessor,
|
|
4880
|
+
optional: optionalProcessor,
|
|
4881
|
+
lazy: lazyProcessor
|
|
4882
|
+
};
|
|
4883
|
+
function toJSONSchema(input, params) {
|
|
4884
|
+
if ("_idmap" in input) {
|
|
4885
|
+
const registry = input;
|
|
4886
|
+
const ctx = initializeContext({
|
|
4887
|
+
...params,
|
|
4888
|
+
processors: allProcessors
|
|
4889
|
+
});
|
|
4890
|
+
const defs = {};
|
|
4891
|
+
for (const entry of registry._idmap.entries()) {
|
|
4892
|
+
const [_, schema] = entry;
|
|
4893
|
+
processSchema(schema, ctx);
|
|
4894
|
+
}
|
|
4895
|
+
const schemas = {};
|
|
4896
|
+
ctx.external = {
|
|
4897
|
+
registry,
|
|
4898
|
+
uri: params?.uri,
|
|
4899
|
+
defs
|
|
4900
|
+
};
|
|
4901
|
+
for (const entry of registry._idmap.entries()) {
|
|
4902
|
+
const [key, schema] = entry;
|
|
4903
|
+
extractDefs(ctx, schema);
|
|
4904
|
+
assignProp(schemas, key, finalize(ctx, schema));
|
|
4905
|
+
}
|
|
4906
|
+
if (Object.keys(defs).length > 0) schemas.__shared = { [ctx.target === "draft-2020-12" ? "$defs" : "definitions"]: defs };
|
|
4907
|
+
return { schemas };
|
|
4908
|
+
}
|
|
4909
|
+
const ctx = initializeContext({
|
|
4910
|
+
...params,
|
|
4911
|
+
processors: allProcessors
|
|
4912
|
+
});
|
|
4913
|
+
processSchema(input, ctx);
|
|
4914
|
+
extractDefs(ctx, input);
|
|
4915
|
+
return finalize(ctx, input);
|
|
4916
|
+
}
|
|
4757
4917
|
//#endregion
|
|
4758
4918
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.js
|
|
4759
4919
|
const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
@@ -4787,12 +4947,12 @@ const initializer = (inst, issues) => {
|
|
|
4787
4947
|
_installedErrorProtos.add(proto);
|
|
4788
4948
|
_lazyMethod(proto, "format", (self) => (mapper) => formatError(self, mapper));
|
|
4789
4949
|
_lazyMethod(proto, "flatten", (self) => (mapper) => flattenError(self, mapper));
|
|
4790
|
-
_lazyMethod(proto, "addIssue", (self) => (issue
|
|
4791
|
-
self.issues.push(issue
|
|
4950
|
+
_lazyMethod(proto, "addIssue", (self) => (issue) => {
|
|
4951
|
+
self.issues.push(issue);
|
|
4792
4952
|
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
4793
4953
|
});
|
|
4794
|
-
_lazyMethod(proto, "addIssues", (self) => (issues
|
|
4795
|
-
self.issues.push(...issues
|
|
4954
|
+
_lazyMethod(proto, "addIssues", (self) => (issues) => {
|
|
4955
|
+
self.issues.push(...issues);
|
|
4796
4956
|
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
4797
4957
|
});
|
|
4798
4958
|
Object.defineProperty(proto, "isEmpty", {
|
|
@@ -4803,11 +4963,10 @@ const initializer = (inst, issues) => {
|
|
|
4803
4963
|
}
|
|
4804
4964
|
});
|
|
4805
4965
|
};
|
|
4806
|
-
const ZodRealError =
|
|
4807
|
-
|
|
4966
|
+
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
4808
4967
|
//#endregion
|
|
4809
4968
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.js
|
|
4810
|
-
const parse
|
|
4969
|
+
const parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
4811
4970
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
4812
4971
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
4813
4972
|
const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
@@ -4819,7 +4978,6 @@ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
|
4819
4978
|
const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
4820
4979
|
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
4821
4980
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
4822
|
-
|
|
4823
4981
|
//#endregion
|
|
4824
4982
|
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.js
|
|
4825
4983
|
function _ensureDefaultLocale() {
|
|
@@ -4828,7 +4986,7 @@ function _ensureDefaultLocale() {
|
|
|
4828
4986
|
function _ensureDefaultMemoizer() {
|
|
4829
4987
|
if (!globalConfig.memoizer) config({ memoizer: memoizer() });
|
|
4830
4988
|
}
|
|
4831
|
-
const ZodType =
|
|
4989
|
+
const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
4832
4990
|
_ensureDefaultLocale();
|
|
4833
4991
|
$ZodType.init(inst, def);
|
|
4834
4992
|
inst.def = def;
|
|
@@ -4852,8 +5010,8 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
4852
5010
|
brand() {
|
|
4853
5011
|
return this;
|
|
4854
5012
|
},
|
|
4855
|
-
register(reg, meta
|
|
4856
|
-
reg.add(this, meta
|
|
5013
|
+
register(reg, meta) {
|
|
5014
|
+
reg.add(this, meta);
|
|
4857
5015
|
return this;
|
|
4858
5016
|
},
|
|
4859
5017
|
refine(check, params) {
|
|
@@ -4863,7 +5021,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
4863
5021
|
return this.check(superRefine(refinement, params));
|
|
4864
5022
|
},
|
|
4865
5023
|
overwrite(fn) {
|
|
4866
|
-
return this.check(_overwrite(fn));
|
|
5024
|
+
return this.check(/* @__PURE__ */ _overwrite(fn));
|
|
4867
5025
|
},
|
|
4868
5026
|
optional() {
|
|
4869
5027
|
return optional(this);
|
|
@@ -4939,11 +5097,11 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
4939
5097
|
set "~standard"(value) {
|
|
4940
5098
|
own(this, "~standard", value);
|
|
4941
5099
|
},
|
|
4942
|
-
parse: function _parse
|
|
4943
|
-
return parse
|
|
5100
|
+
parse: function _parse(data, params) {
|
|
5101
|
+
return parse(this, data, params, { callee: _parse });
|
|
4944
5102
|
},
|
|
4945
|
-
parseAsync: async function _parseAsync
|
|
4946
|
-
return await parseAsync(this, data, params, { callee: _parseAsync
|
|
5103
|
+
parseAsync: async function _parseAsync(data, params) {
|
|
5104
|
+
return await parseAsync(this, data, params, { callee: _parseAsync });
|
|
4947
5105
|
},
|
|
4948
5106
|
safeParse(data, params) {
|
|
4949
5107
|
return safeParse(this, data, params);
|
|
@@ -4961,19 +5119,19 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
4961
5119
|
return validate(this, data, params);
|
|
4962
5120
|
},
|
|
4963
5121
|
validateAsync(data, params) {
|
|
4964
|
-
return validateAsync(this, data, params);
|
|
5122
|
+
return validateAsync$1(this, data, params);
|
|
4965
5123
|
},
|
|
4966
|
-
encode: function _encode
|
|
4967
|
-
return encode(this, data, params, { callee: _encode
|
|
5124
|
+
encode: function _encode(data, params) {
|
|
5125
|
+
return encode(this, data, params, { callee: _encode });
|
|
4968
5126
|
},
|
|
4969
|
-
decode: function _decode
|
|
4970
|
-
return decode(this, data, params, { callee: _decode
|
|
5127
|
+
decode: function _decode(data, params) {
|
|
5128
|
+
return decode(this, data, params, { callee: _decode });
|
|
4971
5129
|
},
|
|
4972
|
-
encodeAsync: async function _encodeAsync
|
|
4973
|
-
return await encodeAsync(this, data, params, { callee: _encodeAsync
|
|
5130
|
+
encodeAsync: async function _encodeAsync(data, params) {
|
|
5131
|
+
return await encodeAsync(this, data, params, { callee: _encodeAsync });
|
|
4974
5132
|
},
|
|
4975
|
-
decodeAsync: async function _decodeAsync
|
|
4976
|
-
return await decodeAsync(this, data, params, { callee: _decodeAsync
|
|
5133
|
+
decodeAsync: async function _decodeAsync(data, params) {
|
|
5134
|
+
return await decodeAsync(this, data, params, { callee: _decodeAsync });
|
|
4977
5135
|
},
|
|
4978
5136
|
safeEncode(data, params) {
|
|
4979
5137
|
return safeEncode(this, data, params);
|
|
@@ -4998,191 +5156,194 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
4998
5156
|
}
|
|
4999
5157
|
});
|
|
5000
5158
|
/** @internal */
|
|
5001
|
-
const _ZodString =
|
|
5159
|
+
const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
|
|
5002
5160
|
$ZodString.init(inst, def);
|
|
5003
5161
|
ZodType.init(inst, def);
|
|
5004
5162
|
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
5005
|
-
},
|
|
5163
|
+
}, /*@__PURE__*/ derived({
|
|
5006
5164
|
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
5007
5165
|
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
5008
5166
|
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
5009
5167
|
}, {
|
|
5010
5168
|
regex(...args) {
|
|
5011
|
-
return this.check(_regex(...args));
|
|
5169
|
+
return this.check(/* @__PURE__ */ _regex(...args));
|
|
5012
5170
|
},
|
|
5013
5171
|
includes(...args) {
|
|
5014
|
-
return this.check(_includes(...args));
|
|
5172
|
+
return this.check(/* @__PURE__ */ _includes(...args));
|
|
5015
5173
|
},
|
|
5016
5174
|
startsWith(...args) {
|
|
5017
|
-
return this.check(_startsWith(...args));
|
|
5175
|
+
return this.check(/* @__PURE__ */ _startsWith(...args));
|
|
5018
5176
|
},
|
|
5019
5177
|
endsWith(...args) {
|
|
5020
|
-
return this.check(_endsWith(...args));
|
|
5178
|
+
return this.check(/* @__PURE__ */ _endsWith(...args));
|
|
5021
5179
|
},
|
|
5022
5180
|
min(...args) {
|
|
5023
|
-
return this.check(_minLength(...args));
|
|
5181
|
+
return this.check(/* @__PURE__ */ _minLength(...args));
|
|
5024
5182
|
},
|
|
5025
5183
|
max(...args) {
|
|
5026
|
-
return this.check(_maxLength(...args));
|
|
5184
|
+
return this.check(/* @__PURE__ */ _maxLength(...args));
|
|
5027
5185
|
},
|
|
5028
5186
|
length(...args) {
|
|
5029
|
-
return this.check(_length(...args));
|
|
5187
|
+
return this.check(/* @__PURE__ */ _length(...args));
|
|
5030
5188
|
},
|
|
5031
5189
|
nonempty(...args) {
|
|
5032
|
-
return this.check(_minLength(1, ...args));
|
|
5190
|
+
return this.check(/* @__PURE__ */ _minLength(1, ...args));
|
|
5033
5191
|
},
|
|
5034
5192
|
lowercase(params) {
|
|
5035
|
-
return this.check(_lowercase(params));
|
|
5193
|
+
return this.check(/* @__PURE__ */ _lowercase(params));
|
|
5036
5194
|
},
|
|
5037
5195
|
uppercase(params) {
|
|
5038
|
-
return this.check(_uppercase(params));
|
|
5196
|
+
return this.check(/* @__PURE__ */ _uppercase(params));
|
|
5039
5197
|
},
|
|
5040
5198
|
trim() {
|
|
5041
|
-
return this.check(_trim());
|
|
5199
|
+
return this.check(/* @__PURE__ */ _trim());
|
|
5042
5200
|
},
|
|
5043
5201
|
normalize(...args) {
|
|
5044
|
-
return this.check(_normalize(...args));
|
|
5202
|
+
return this.check(/* @__PURE__ */ _normalize(...args));
|
|
5045
5203
|
},
|
|
5046
5204
|
toLowerCase() {
|
|
5047
|
-
return this.check(_toLowerCase());
|
|
5205
|
+
return this.check(/* @__PURE__ */ _toLowerCase());
|
|
5048
5206
|
},
|
|
5049
5207
|
toUpperCase() {
|
|
5050
|
-
return this.check(_toUpperCase());
|
|
5208
|
+
return this.check(/* @__PURE__ */ _toUpperCase());
|
|
5051
5209
|
},
|
|
5052
5210
|
slugify() {
|
|
5053
|
-
return this.check(_slugify());
|
|
5211
|
+
return this.check(/* @__PURE__ */ _slugify());
|
|
5054
5212
|
}
|
|
5055
5213
|
}));
|
|
5056
|
-
const ZodString =
|
|
5214
|
+
const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
|
|
5057
5215
|
$ZodString.init(inst, def);
|
|
5058
5216
|
_ZodString.init(inst, def);
|
|
5059
5217
|
}, {
|
|
5060
5218
|
email(params) {
|
|
5061
|
-
return this.check(_email(ZodEmail, params));
|
|
5219
|
+
return this.check(/* @__PURE__ */ _email(ZodEmail, params));
|
|
5062
5220
|
},
|
|
5063
5221
|
url(params) {
|
|
5064
|
-
return this.check(_url(ZodURL, params));
|
|
5222
|
+
return this.check(/* @__PURE__ */ _url(ZodURL, params));
|
|
5065
5223
|
},
|
|
5066
5224
|
jwt(params) {
|
|
5067
|
-
return this.check(_jwt(ZodJWT, params));
|
|
5225
|
+
return this.check(/* @__PURE__ */ _jwt(ZodJWT, params));
|
|
5068
5226
|
},
|
|
5069
5227
|
emoji(params) {
|
|
5070
|
-
return this.check(_emoji(ZodEmoji, params));
|
|
5228
|
+
return this.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
|
|
5071
5229
|
},
|
|
5072
5230
|
guid(params) {
|
|
5073
|
-
return this.check(_guid(ZodGUID, params));
|
|
5231
|
+
return this.check(/* @__PURE__ */ _guid(ZodGUID, params));
|
|
5074
5232
|
},
|
|
5075
5233
|
uuid(params) {
|
|
5076
|
-
return this.check(_uuid(ZodUUID, params));
|
|
5234
|
+
return this.check(/* @__PURE__ */ _uuid(ZodUUID, params));
|
|
5077
5235
|
},
|
|
5078
5236
|
uuidv4(params) {
|
|
5079
|
-
return this.check(_uuidv4(ZodUUID, params));
|
|
5237
|
+
return this.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
|
|
5080
5238
|
},
|
|
5081
5239
|
uuidv6(params) {
|
|
5082
|
-
return this.check(_uuidv6(ZodUUID, params));
|
|
5240
|
+
return this.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
|
|
5083
5241
|
},
|
|
5084
5242
|
uuidv7(params) {
|
|
5085
|
-
return this.check(_uuidv7(ZodUUID, params));
|
|
5243
|
+
return this.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
|
|
5086
5244
|
},
|
|
5087
5245
|
nanoid(params) {
|
|
5088
|
-
return this.check(_nanoid(ZodNanoID, params));
|
|
5246
|
+
return this.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
|
|
5089
5247
|
},
|
|
5090
5248
|
cuid(params) {
|
|
5091
|
-
return this.check(_cuid(ZodCUID, params));
|
|
5249
|
+
return this.check(/* @__PURE__ */ _cuid(ZodCUID, params));
|
|
5092
5250
|
},
|
|
5093
5251
|
cuid2(params) {
|
|
5094
|
-
return this.check(_cuid2(ZodCUID2, params));
|
|
5252
|
+
return this.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
|
|
5095
5253
|
},
|
|
5096
5254
|
ulid(params) {
|
|
5097
|
-
return this.check(_ulid(ZodULID, params));
|
|
5255
|
+
return this.check(/* @__PURE__ */ _ulid(ZodULID, params));
|
|
5098
5256
|
},
|
|
5099
5257
|
base64(params) {
|
|
5100
|
-
return this.check(_base64(ZodBase64, params));
|
|
5258
|
+
return this.check(/* @__PURE__ */ _base64(ZodBase64, params));
|
|
5101
5259
|
},
|
|
5102
5260
|
base64url(params) {
|
|
5103
|
-
return this.check(_base64url(ZodBase64URL, params));
|
|
5261
|
+
return this.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
|
|
5104
5262
|
},
|
|
5105
5263
|
xid(params) {
|
|
5106
|
-
return this.check(_xid(ZodXID, params));
|
|
5264
|
+
return this.check(/* @__PURE__ */ _xid(ZodXID, params));
|
|
5107
5265
|
},
|
|
5108
5266
|
ksuid(params) {
|
|
5109
|
-
return this.check(_ksuid(ZodKSUID, params));
|
|
5267
|
+
return this.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
|
|
5110
5268
|
},
|
|
5111
5269
|
ipv4(params) {
|
|
5112
|
-
return this.check(_ipv4(ZodIPv4, params));
|
|
5270
|
+
return this.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
|
|
5113
5271
|
},
|
|
5114
5272
|
ipv6(params) {
|
|
5115
|
-
return this.check(_ipv6(ZodIPv6, params));
|
|
5273
|
+
return this.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
|
|
5116
5274
|
},
|
|
5117
5275
|
cidrv4(params) {
|
|
5118
|
-
return this.check(_cidrv4(ZodCIDRv4, params));
|
|
5276
|
+
return this.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
|
|
5119
5277
|
},
|
|
5120
5278
|
cidrv6(params) {
|
|
5121
|
-
return this.check(_cidrv6(ZodCIDRv6, params));
|
|
5279
|
+
return this.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
|
|
5122
5280
|
},
|
|
5123
5281
|
e164(params) {
|
|
5124
|
-
return this.check(_e164(ZodE164, params));
|
|
5282
|
+
return this.check(/* @__PURE__ */ _e164(ZodE164, params));
|
|
5125
5283
|
},
|
|
5126
5284
|
datetime(params) {
|
|
5127
|
-
return this.check(_isoDateTime(ZodISODateTime, params));
|
|
5285
|
+
return this.check(/* @__PURE__ */ _isoDateTime(ZodISODateTime, params));
|
|
5128
5286
|
},
|
|
5129
5287
|
date(params) {
|
|
5130
|
-
return this.check(_isoDate(ZodISODate, params));
|
|
5288
|
+
return this.check(/* @__PURE__ */ _isoDate(ZodISODate, params));
|
|
5131
5289
|
},
|
|
5132
5290
|
time(params) {
|
|
5133
|
-
return this.check(_isoTime(ZodISOTime, params));
|
|
5291
|
+
return this.check(/* @__PURE__ */ _isoTime(ZodISOTime, params));
|
|
5134
5292
|
},
|
|
5135
5293
|
duration(params) {
|
|
5136
|
-
return this.check(_isoDuration(ZodISODuration, params));
|
|
5294
|
+
return this.check(/* @__PURE__ */ _isoDuration(ZodISODuration, params));
|
|
5137
5295
|
}
|
|
5138
5296
|
});
|
|
5139
5297
|
function string(params) {
|
|
5140
|
-
return _string(ZodString, params);
|
|
5298
|
+
return /* @__PURE__ */ _string(ZodString, params);
|
|
5141
5299
|
}
|
|
5142
|
-
const ZodStringFormat =
|
|
5300
|
+
const ZodStringFormat = /*@__PURE__*/ $constructor("ZodStringFormat", (inst, def) => {
|
|
5143
5301
|
$ZodStringFormat.init(inst, def);
|
|
5144
5302
|
_ZodString.init(inst, def);
|
|
5145
5303
|
});
|
|
5146
|
-
const ZodISODateTime =
|
|
5304
|
+
const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
|
|
5147
5305
|
$ZodISODateTime.init(inst, def);
|
|
5148
5306
|
ZodStringFormat.init(inst, def);
|
|
5149
5307
|
});
|
|
5150
|
-
const ZodISODate =
|
|
5308
|
+
const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
|
|
5151
5309
|
$ZodISODate.init(inst, def);
|
|
5152
5310
|
ZodStringFormat.init(inst, def);
|
|
5153
5311
|
});
|
|
5154
|
-
const ZodISOTime =
|
|
5312
|
+
const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
|
|
5155
5313
|
$ZodISOTime.init(inst, def);
|
|
5156
5314
|
ZodStringFormat.init(inst, def);
|
|
5157
5315
|
});
|
|
5158
|
-
const ZodISODuration =
|
|
5316
|
+
const ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => {
|
|
5159
5317
|
$ZodISODuration.init(inst, def);
|
|
5160
5318
|
ZodStringFormat.init(inst, def);
|
|
5161
5319
|
});
|
|
5162
|
-
const ZodEmail =
|
|
5320
|
+
const ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => {
|
|
5163
5321
|
$ZodEmail.init(inst, def);
|
|
5164
5322
|
ZodStringFormat.init(inst, def);
|
|
5165
5323
|
});
|
|
5166
|
-
|
|
5324
|
+
function email(params) {
|
|
5325
|
+
return /* @__PURE__ */ _email(ZodEmail, params);
|
|
5326
|
+
}
|
|
5327
|
+
const ZodGUID = /*@__PURE__*/ $constructor("ZodGUID", (inst, def) => {
|
|
5167
5328
|
$ZodGUID.init(inst, def);
|
|
5168
5329
|
ZodStringFormat.init(inst, def);
|
|
5169
5330
|
});
|
|
5170
|
-
const ZodUUID =
|
|
5331
|
+
const ZodUUID = /*@__PURE__*/ $constructor("ZodUUID", (inst, def) => {
|
|
5171
5332
|
$ZodUUID.init(inst, def);
|
|
5172
5333
|
ZodStringFormat.init(inst, def);
|
|
5173
5334
|
});
|
|
5174
|
-
const ZodURL =
|
|
5335
|
+
const ZodURL = /*@__PURE__*/ $constructor("ZodURL", (inst, def) => {
|
|
5175
5336
|
$ZodURL.init(inst, def);
|
|
5176
5337
|
ZodStringFormat.init(inst, def);
|
|
5177
5338
|
});
|
|
5178
5339
|
function url(params) {
|
|
5179
|
-
return _url(ZodURL, params);
|
|
5340
|
+
return /* @__PURE__ */ _url(ZodURL, params);
|
|
5180
5341
|
}
|
|
5181
|
-
const ZodEmoji =
|
|
5342
|
+
const ZodEmoji = /*@__PURE__*/ $constructor("ZodEmoji", (inst, def) => {
|
|
5182
5343
|
$ZodEmoji.init(inst, def);
|
|
5183
5344
|
ZodStringFormat.init(inst, def);
|
|
5184
5345
|
});
|
|
5185
|
-
const ZodNanoID =
|
|
5346
|
+
const ZodNanoID = /*@__PURE__*/ $constructor("ZodNanoID", (inst, def) => {
|
|
5186
5347
|
$ZodNanoID.init(inst, def);
|
|
5187
5348
|
ZodStringFormat.init(inst, def);
|
|
5188
5349
|
});
|
|
@@ -5191,64 +5352,64 @@ const ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
|
|
|
5191
5352
|
* (timestamps embedded in the id). Use {@link ZodCUID2} instead.
|
|
5192
5353
|
* See https://github.com/paralleldrive/cuid.
|
|
5193
5354
|
*/
|
|
5194
|
-
const ZodCUID =
|
|
5355
|
+
const ZodCUID = /*@__PURE__*/ $constructor("ZodCUID", (inst, def) => {
|
|
5195
5356
|
$ZodCUID.init(inst, def);
|
|
5196
5357
|
ZodStringFormat.init(inst, def);
|
|
5197
5358
|
});
|
|
5198
|
-
const ZodCUID2 =
|
|
5359
|
+
const ZodCUID2 = /*@__PURE__*/ $constructor("ZodCUID2", (inst, def) => {
|
|
5199
5360
|
$ZodCUID2.init(inst, def);
|
|
5200
5361
|
ZodStringFormat.init(inst, def);
|
|
5201
5362
|
});
|
|
5202
|
-
const ZodULID =
|
|
5363
|
+
const ZodULID = /*@__PURE__*/ $constructor("ZodULID", (inst, def) => {
|
|
5203
5364
|
$ZodULID.init(inst, def);
|
|
5204
5365
|
ZodStringFormat.init(inst, def);
|
|
5205
5366
|
});
|
|
5206
|
-
const ZodXID =
|
|
5367
|
+
const ZodXID = /*@__PURE__*/ $constructor("ZodXID", (inst, def) => {
|
|
5207
5368
|
$ZodXID.init(inst, def);
|
|
5208
5369
|
ZodStringFormat.init(inst, def);
|
|
5209
5370
|
});
|
|
5210
|
-
const ZodKSUID =
|
|
5371
|
+
const ZodKSUID = /*@__PURE__*/ $constructor("ZodKSUID", (inst, def) => {
|
|
5211
5372
|
$ZodKSUID.init(inst, def);
|
|
5212
5373
|
ZodStringFormat.init(inst, def);
|
|
5213
5374
|
});
|
|
5214
|
-
const ZodIPv4 =
|
|
5375
|
+
const ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => {
|
|
5215
5376
|
$ZodIPv4.init(inst, def);
|
|
5216
5377
|
ZodStringFormat.init(inst, def);
|
|
5217
5378
|
});
|
|
5218
|
-
const ZodIPv6 =
|
|
5379
|
+
const ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => {
|
|
5219
5380
|
$ZodIPv6.init(inst, def);
|
|
5220
5381
|
ZodStringFormat.init(inst, def);
|
|
5221
5382
|
});
|
|
5222
|
-
const ZodCIDRv4 =
|
|
5383
|
+
const ZodCIDRv4 = /*@__PURE__*/ $constructor("ZodCIDRv4", (inst, def) => {
|
|
5223
5384
|
$ZodCIDRv4.init(inst, def);
|
|
5224
5385
|
ZodStringFormat.init(inst, def);
|
|
5225
5386
|
});
|
|
5226
|
-
const ZodCIDRv6 =
|
|
5387
|
+
const ZodCIDRv6 = /*@__PURE__*/ $constructor("ZodCIDRv6", (inst, def) => {
|
|
5227
5388
|
$ZodCIDRv6.init(inst, def);
|
|
5228
5389
|
ZodStringFormat.init(inst, def);
|
|
5229
5390
|
});
|
|
5230
|
-
const ZodBase64 =
|
|
5391
|
+
const ZodBase64 = /*@__PURE__*/ $constructor("ZodBase64", (inst, def) => {
|
|
5231
5392
|
$ZodBase64.init(inst, def);
|
|
5232
5393
|
ZodStringFormat.init(inst, def);
|
|
5233
5394
|
});
|
|
5234
|
-
const ZodBase64URL =
|
|
5395
|
+
const ZodBase64URL = /*@__PURE__*/ $constructor("ZodBase64URL", (inst, def) => {
|
|
5235
5396
|
$ZodBase64URL.init(inst, def);
|
|
5236
5397
|
ZodStringFormat.init(inst, def);
|
|
5237
5398
|
});
|
|
5238
|
-
const ZodE164 =
|
|
5399
|
+
const ZodE164 = /*@__PURE__*/ $constructor("ZodE164", (inst, def) => {
|
|
5239
5400
|
$ZodE164.init(inst, def);
|
|
5240
5401
|
ZodStringFormat.init(inst, def);
|
|
5241
5402
|
});
|
|
5242
|
-
const ZodJWT =
|
|
5403
|
+
const ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => {
|
|
5243
5404
|
$ZodJWT.init(inst, def);
|
|
5244
5405
|
ZodStringFormat.init(inst, def);
|
|
5245
5406
|
});
|
|
5246
|
-
const ZodNumber =
|
|
5407
|
+
const ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
|
|
5247
5408
|
$ZodNumber.init(inst, def);
|
|
5248
5409
|
ZodType.init(inst, def);
|
|
5249
5410
|
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
5250
5411
|
inst.isFinite = true;
|
|
5251
|
-
},
|
|
5412
|
+
}, /*@__PURE__*/ derived({
|
|
5252
5413
|
minValue: (inst) => {
|
|
5253
5414
|
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
5254
5415
|
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
@@ -5264,22 +5425,22 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
5264
5425
|
format: (inst) => aggregateChecks(inst).format ?? null
|
|
5265
5426
|
}, {
|
|
5266
5427
|
gt(value, params) {
|
|
5267
|
-
return this.check(_gt(value, params));
|
|
5428
|
+
return this.check(/* @__PURE__ */ _gt(value, params));
|
|
5268
5429
|
},
|
|
5269
5430
|
gte(value, params) {
|
|
5270
|
-
return this.check(_gte(value, params));
|
|
5431
|
+
return this.check(/* @__PURE__ */ _gte(value, params));
|
|
5271
5432
|
},
|
|
5272
5433
|
min(value, params) {
|
|
5273
|
-
return this.check(_gte(value, params));
|
|
5434
|
+
return this.check(/* @__PURE__ */ _gte(value, params));
|
|
5274
5435
|
},
|
|
5275
5436
|
lt(value, params) {
|
|
5276
|
-
return this.check(_lt(value, params));
|
|
5437
|
+
return this.check(/* @__PURE__ */ _lt(value, params));
|
|
5277
5438
|
},
|
|
5278
5439
|
lte(value, params) {
|
|
5279
|
-
return this.check(_lte(value, params));
|
|
5440
|
+
return this.check(/* @__PURE__ */ _lte(value, params));
|
|
5280
5441
|
},
|
|
5281
5442
|
max(value, params) {
|
|
5282
|
-
return this.check(_lte(value, params));
|
|
5443
|
+
return this.check(/* @__PURE__ */ _lte(value, params));
|
|
5283
5444
|
},
|
|
5284
5445
|
int(params) {
|
|
5285
5446
|
return this.check(int(params));
|
|
@@ -5288,62 +5449,62 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
5288
5449
|
return this.check(int(params));
|
|
5289
5450
|
},
|
|
5290
5451
|
positive(params) {
|
|
5291
|
-
return this.check(_gt(0, params));
|
|
5452
|
+
return this.check(/* @__PURE__ */ _gt(0, params));
|
|
5292
5453
|
},
|
|
5293
5454
|
nonnegative(params) {
|
|
5294
|
-
return this.check(_gte(0, params));
|
|
5455
|
+
return this.check(/* @__PURE__ */ _gte(0, params));
|
|
5295
5456
|
},
|
|
5296
5457
|
negative(params) {
|
|
5297
|
-
return this.check(_lt(0, params));
|
|
5458
|
+
return this.check(/* @__PURE__ */ _lt(0, params));
|
|
5298
5459
|
},
|
|
5299
5460
|
nonpositive(params) {
|
|
5300
|
-
return this.check(_lte(0, params));
|
|
5461
|
+
return this.check(/* @__PURE__ */ _lte(0, params));
|
|
5301
5462
|
},
|
|
5302
5463
|
multipleOf(value, params) {
|
|
5303
|
-
return this.check(_multipleOf(value, params));
|
|
5464
|
+
return this.check(/* @__PURE__ */ _multipleOf(value, params));
|
|
5304
5465
|
},
|
|
5305
5466
|
step(value, params) {
|
|
5306
|
-
return this.check(_multipleOf(value, params));
|
|
5467
|
+
return this.check(/* @__PURE__ */ _multipleOf(value, params));
|
|
5307
5468
|
},
|
|
5308
5469
|
finite() {
|
|
5309
5470
|
return this;
|
|
5310
5471
|
}
|
|
5311
5472
|
}));
|
|
5312
5473
|
function number(params) {
|
|
5313
|
-
return _number(ZodNumber, params);
|
|
5474
|
+
return /* @__PURE__ */ _number(ZodNumber, params);
|
|
5314
5475
|
}
|
|
5315
|
-
const ZodNumberFormat =
|
|
5476
|
+
const ZodNumberFormat = /*@__PURE__*/ $constructor("ZodNumberFormat", (inst, def) => {
|
|
5316
5477
|
$ZodNumberFormat.init(inst, def);
|
|
5317
5478
|
ZodNumber.init(inst, def);
|
|
5318
5479
|
});
|
|
5319
5480
|
function int(params) {
|
|
5320
|
-
return _int(ZodNumberFormat, params);
|
|
5481
|
+
return /* @__PURE__ */ _int(ZodNumberFormat, params);
|
|
5321
5482
|
}
|
|
5322
|
-
const ZodBoolean =
|
|
5483
|
+
const ZodBoolean = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def) => {
|
|
5323
5484
|
$ZodBoolean.init(inst, def);
|
|
5324
5485
|
ZodType.init(inst, def);
|
|
5325
5486
|
inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
|
|
5326
5487
|
});
|
|
5327
5488
|
function boolean(params) {
|
|
5328
|
-
return _boolean(ZodBoolean, params);
|
|
5489
|
+
return /* @__PURE__ */ _boolean(ZodBoolean, params);
|
|
5329
5490
|
}
|
|
5330
|
-
const ZodUnknown =
|
|
5491
|
+
const ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => {
|
|
5331
5492
|
$ZodUnknown.init(inst, def);
|
|
5332
5493
|
ZodType.init(inst, def);
|
|
5333
|
-
inst._zod.processJSONSchema = (ctx, json, params) =>
|
|
5494
|
+
inst._zod.processJSONSchema = (ctx, json, params) => void 0;
|
|
5334
5495
|
});
|
|
5335
5496
|
function unknown() {
|
|
5336
|
-
return _unknown(ZodUnknown);
|
|
5497
|
+
return /* @__PURE__ */ _unknown(ZodUnknown);
|
|
5337
5498
|
}
|
|
5338
|
-
const ZodNever =
|
|
5499
|
+
const ZodNever = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => {
|
|
5339
5500
|
$ZodNever.init(inst, def);
|
|
5340
5501
|
ZodType.init(inst, def);
|
|
5341
5502
|
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
|
|
5342
5503
|
});
|
|
5343
5504
|
function never(params) {
|
|
5344
|
-
return _never(ZodNever, params);
|
|
5505
|
+
return /* @__PURE__ */ _never(ZodNever, params);
|
|
5345
5506
|
}
|
|
5346
|
-
const ZodArray =
|
|
5507
|
+
const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
|
|
5347
5508
|
_ensureDefaultMemoizer();
|
|
5348
5509
|
$ZodArray.init(inst, def);
|
|
5349
5510
|
ZodType.init(inst, def);
|
|
@@ -5351,25 +5512,25 @@ const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
|
5351
5512
|
inst.element = def.element;
|
|
5352
5513
|
}, {
|
|
5353
5514
|
min(n, params) {
|
|
5354
|
-
return this.check(_minLength(n, params));
|
|
5515
|
+
return this.check(/* @__PURE__ */ _minLength(n, params));
|
|
5355
5516
|
},
|
|
5356
5517
|
nonempty(params) {
|
|
5357
|
-
return this.check(_minLength(1, params));
|
|
5518
|
+
return this.check(/* @__PURE__ */ _minLength(1, params));
|
|
5358
5519
|
},
|
|
5359
5520
|
max(n, params) {
|
|
5360
|
-
return this.check(_maxLength(n, params));
|
|
5521
|
+
return this.check(/* @__PURE__ */ _maxLength(n, params));
|
|
5361
5522
|
},
|
|
5362
5523
|
length(n, params) {
|
|
5363
|
-
return this.check(_length(n, params));
|
|
5524
|
+
return this.check(/* @__PURE__ */ _length(n, params));
|
|
5364
5525
|
},
|
|
5365
5526
|
unwrap() {
|
|
5366
5527
|
return this.element;
|
|
5367
5528
|
}
|
|
5368
5529
|
});
|
|
5369
5530
|
function array(element, params) {
|
|
5370
|
-
return _array(ZodArray, element, params);
|
|
5531
|
+
return /* @__PURE__ */ _array(ZodArray, element, params);
|
|
5371
5532
|
}
|
|
5372
|
-
const ZodObject =
|
|
5533
|
+
const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
|
|
5373
5534
|
_ensureDefaultMemoizer();
|
|
5374
5535
|
$ZodObjectJIT.init(inst, def);
|
|
5375
5536
|
ZodType.init(inst, def);
|
|
@@ -5427,7 +5588,15 @@ function object(shape, params) {
|
|
|
5427
5588
|
};
|
|
5428
5589
|
return new ZodObject(def);
|
|
5429
5590
|
}
|
|
5430
|
-
|
|
5591
|
+
function looseObject(shape, params) {
|
|
5592
|
+
return new ZodObject({
|
|
5593
|
+
type: "object",
|
|
5594
|
+
shape,
|
|
5595
|
+
catchall: unknown(),
|
|
5596
|
+
...normalizeParams(params)
|
|
5597
|
+
});
|
|
5598
|
+
}
|
|
5599
|
+
const ZodUnion = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => {
|
|
5431
5600
|
$ZodUnion.init(inst, def);
|
|
5432
5601
|
ZodType.init(inst, def);
|
|
5433
5602
|
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
@@ -5440,7 +5609,7 @@ function union(options, params) {
|
|
|
5440
5609
|
...normalizeParams(params)
|
|
5441
5610
|
});
|
|
5442
5611
|
}
|
|
5443
|
-
const ZodDiscriminatedUnion =
|
|
5612
|
+
const ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("ZodDiscriminatedUnion", (inst, def) => {
|
|
5444
5613
|
ZodUnion.init(inst, def);
|
|
5445
5614
|
$ZodDiscriminatedUnion.init(inst, def);
|
|
5446
5615
|
});
|
|
@@ -5452,7 +5621,7 @@ function discriminatedUnion(discriminator, options, params) {
|
|
|
5452
5621
|
...normalizeParams(params)
|
|
5453
5622
|
});
|
|
5454
5623
|
}
|
|
5455
|
-
const ZodIntersection =
|
|
5624
|
+
const ZodIntersection = /*@__PURE__*/ $constructor("ZodIntersection", (inst, def) => {
|
|
5456
5625
|
$ZodIntersection.init(inst, def);
|
|
5457
5626
|
ZodType.init(inst, def);
|
|
5458
5627
|
inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
|
|
@@ -5464,7 +5633,40 @@ function intersection(left, right) {
|
|
|
5464
5633
|
right
|
|
5465
5634
|
});
|
|
5466
5635
|
}
|
|
5467
|
-
const
|
|
5636
|
+
const ZodTuple = /*@__PURE__*/ $constructor("ZodTuple", (inst, def) => {
|
|
5637
|
+
_ensureDefaultMemoizer();
|
|
5638
|
+
$ZodTuple.init(inst, def);
|
|
5639
|
+
ZodType.init(inst, def);
|
|
5640
|
+
inst._zod.processJSONSchema = (ctx, json, params) => tupleProcessor(inst, ctx, json, params);
|
|
5641
|
+
}, {
|
|
5642
|
+
rest(rest) {
|
|
5643
|
+
return this.clone({
|
|
5644
|
+
...this._zod.def,
|
|
5645
|
+
rest
|
|
5646
|
+
});
|
|
5647
|
+
},
|
|
5648
|
+
partial() {
|
|
5649
|
+
const def = this._zod.def;
|
|
5650
|
+
if (def.checks?.length) throw new Error(".partial() cannot be used on tuple schemas containing refinements");
|
|
5651
|
+
return this.clone({
|
|
5652
|
+
...def,
|
|
5653
|
+
items: def.items.map((item) => new ZodOptional({
|
|
5654
|
+
type: "optional",
|
|
5655
|
+
innerType: item
|
|
5656
|
+
}))
|
|
5657
|
+
});
|
|
5658
|
+
}
|
|
5659
|
+
});
|
|
5660
|
+
function tuple(items, _paramsOrRest, _params) {
|
|
5661
|
+
const hasRest = _paramsOrRest instanceof $ZodType;
|
|
5662
|
+
return new ZodTuple({
|
|
5663
|
+
type: "tuple",
|
|
5664
|
+
items,
|
|
5665
|
+
rest: hasRest ? _paramsOrRest : null,
|
|
5666
|
+
...normalizeParams(hasRest ? _params : _paramsOrRest)
|
|
5667
|
+
});
|
|
5668
|
+
}
|
|
5669
|
+
const ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => {
|
|
5468
5670
|
_ensureDefaultMemoizer();
|
|
5469
5671
|
$ZodRecord.init(inst, def);
|
|
5470
5672
|
ZodType.init(inst, def);
|
|
@@ -5486,7 +5688,7 @@ function record(keyType, valueType, params) {
|
|
|
5486
5688
|
...normalizeParams(params)
|
|
5487
5689
|
});
|
|
5488
5690
|
}
|
|
5489
|
-
const ZodEnum =
|
|
5691
|
+
const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
|
|
5490
5692
|
$ZodEnum.init(inst, def);
|
|
5491
5693
|
ZodType.init(inst, def);
|
|
5492
5694
|
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
@@ -5524,7 +5726,7 @@ function _enum(values, params) {
|
|
|
5524
5726
|
...normalizeParams(params)
|
|
5525
5727
|
});
|
|
5526
5728
|
}
|
|
5527
|
-
const ZodLiteral =
|
|
5729
|
+
const ZodLiteral = /*@__PURE__*/ $constructor("ZodLiteral", (inst, def) => {
|
|
5528
5730
|
$ZodLiteral.init(inst, def);
|
|
5529
5731
|
ZodType.init(inst, def);
|
|
5530
5732
|
inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
|
|
@@ -5541,7 +5743,7 @@ function literal(value, params) {
|
|
|
5541
5743
|
...normalizeParams(params)
|
|
5542
5744
|
});
|
|
5543
5745
|
}
|
|
5544
|
-
const ZodTransform =
|
|
5746
|
+
const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
|
|
5545
5747
|
_ensureDefaultMemoizer();
|
|
5546
5748
|
$ZodTransform.init(inst, def);
|
|
5547
5749
|
ZodType.init(inst, def);
|
|
@@ -5560,8 +5762,8 @@ const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) =>
|
|
|
5560
5762
|
}
|
|
5561
5763
|
};
|
|
5562
5764
|
const output = def.transform(payload.value, payload);
|
|
5563
|
-
if (output instanceof Promise) return output.then((output
|
|
5564
|
-
payload.value = output
|
|
5765
|
+
if (output instanceof Promise) return output.then((output) => {
|
|
5766
|
+
payload.value = output;
|
|
5565
5767
|
return payload;
|
|
5566
5768
|
});
|
|
5567
5769
|
payload.value = output;
|
|
@@ -5574,7 +5776,7 @@ function transform(fn) {
|
|
|
5574
5776
|
transform: fn
|
|
5575
5777
|
});
|
|
5576
5778
|
}
|
|
5577
|
-
const ZodOptional =
|
|
5779
|
+
const ZodOptional = /*@__PURE__*/ $constructor("ZodOptional", (inst, def) => {
|
|
5578
5780
|
$ZodOptional.init(inst, def);
|
|
5579
5781
|
ZodType.init(inst, def);
|
|
5580
5782
|
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
@@ -5586,7 +5788,7 @@ function optional(innerType) {
|
|
|
5586
5788
|
innerType
|
|
5587
5789
|
});
|
|
5588
5790
|
}
|
|
5589
|
-
const ZodExactOptional =
|
|
5791
|
+
const ZodExactOptional = /*@__PURE__*/ $constructor("ZodExactOptional", (inst, def) => {
|
|
5590
5792
|
$ZodExactOptional.init(inst, def);
|
|
5591
5793
|
ZodType.init(inst, def);
|
|
5592
5794
|
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
@@ -5598,7 +5800,7 @@ function exactOptional(innerType) {
|
|
|
5598
5800
|
innerType
|
|
5599
5801
|
});
|
|
5600
5802
|
}
|
|
5601
|
-
const ZodNullable =
|
|
5803
|
+
const ZodNullable = /*@__PURE__*/ $constructor("ZodNullable", (inst, def) => {
|
|
5602
5804
|
$ZodNullable.init(inst, def);
|
|
5603
5805
|
ZodType.init(inst, def);
|
|
5604
5806
|
inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
|
|
@@ -5610,7 +5812,7 @@ function nullable(innerType) {
|
|
|
5610
5812
|
innerType
|
|
5611
5813
|
});
|
|
5612
5814
|
}
|
|
5613
|
-
const ZodDefault =
|
|
5815
|
+
const ZodDefault = /*@__PURE__*/ $constructor("ZodDefault", (inst, def) => {
|
|
5614
5816
|
$ZodDefault.init(inst, def);
|
|
5615
5817
|
ZodType.init(inst, def);
|
|
5616
5818
|
inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
|
|
@@ -5626,7 +5828,7 @@ function _default(innerType, defaultValue) {
|
|
|
5626
5828
|
}
|
|
5627
5829
|
});
|
|
5628
5830
|
}
|
|
5629
|
-
const ZodPrefault =
|
|
5831
|
+
const ZodPrefault = /*@__PURE__*/ $constructor("ZodPrefault", (inst, def) => {
|
|
5630
5832
|
$ZodPrefault.init(inst, def);
|
|
5631
5833
|
ZodType.init(inst, def);
|
|
5632
5834
|
inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
|
|
@@ -5641,7 +5843,7 @@ function prefault(innerType, defaultValue) {
|
|
|
5641
5843
|
}
|
|
5642
5844
|
});
|
|
5643
5845
|
}
|
|
5644
|
-
const ZodNonOptional =
|
|
5846
|
+
const ZodNonOptional = /*@__PURE__*/ $constructor("ZodNonOptional", (inst, def) => {
|
|
5645
5847
|
$ZodNonOptional.init(inst, def);
|
|
5646
5848
|
ZodType.init(inst, def);
|
|
5647
5849
|
inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
|
|
@@ -5654,7 +5856,7 @@ function nonoptional(innerType, params) {
|
|
|
5654
5856
|
...normalizeParams(params)
|
|
5655
5857
|
});
|
|
5656
5858
|
}
|
|
5657
|
-
const ZodCatch =
|
|
5859
|
+
const ZodCatch = /*@__PURE__*/ $constructor("ZodCatch", (inst, def) => {
|
|
5658
5860
|
$ZodCatch.init(inst, def);
|
|
5659
5861
|
ZodType.init(inst, def);
|
|
5660
5862
|
inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
|
|
@@ -5668,7 +5870,7 @@ function _catch(innerType, catchValue) {
|
|
|
5668
5870
|
catchValue: typeof catchValue === "function" ? catchValue : constantCatch(catchValue)
|
|
5669
5871
|
});
|
|
5670
5872
|
}
|
|
5671
|
-
const ZodPipe =
|
|
5873
|
+
const ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => {
|
|
5672
5874
|
$ZodPipe.init(inst, def);
|
|
5673
5875
|
ZodType.init(inst, def);
|
|
5674
5876
|
inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
|
|
@@ -5682,7 +5884,7 @@ function pipe(in_, out) {
|
|
|
5682
5884
|
out
|
|
5683
5885
|
});
|
|
5684
5886
|
}
|
|
5685
|
-
const ZodReadonly =
|
|
5887
|
+
const ZodReadonly = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => {
|
|
5686
5888
|
$ZodReadonly.init(inst, def);
|
|
5687
5889
|
ZodType.init(inst, def);
|
|
5688
5890
|
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
@@ -5694,985 +5896,122 @@ function readonly(innerType) {
|
|
|
5694
5896
|
innerType
|
|
5695
5897
|
});
|
|
5696
5898
|
}
|
|
5697
|
-
const ZodCustom =
|
|
5899
|
+
const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
|
|
5698
5900
|
$ZodCustom.init(inst, def);
|
|
5699
5901
|
ZodType.init(inst, def);
|
|
5700
5902
|
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
5701
5903
|
});
|
|
5702
5904
|
function custom(fn, _params) {
|
|
5703
|
-
return _custom(ZodCustom, fn ?? (() => true), _params);
|
|
5905
|
+
return /* @__PURE__ */ _custom(ZodCustom, fn ?? (() => true), _params);
|
|
5704
5906
|
}
|
|
5705
5907
|
function refine(fn, _params = {}) {
|
|
5706
|
-
return _refine(ZodCustom, fn, _params);
|
|
5908
|
+
return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
|
|
5707
5909
|
}
|
|
5708
5910
|
function superRefine(fn, params) {
|
|
5709
|
-
return _superRefine(fn, params);
|
|
5911
|
+
return /* @__PURE__ */ _superRefine(fn, params);
|
|
5710
5912
|
}
|
|
5711
|
-
const describe = describe$1;
|
|
5712
|
-
const meta = meta$1;
|
|
5713
|
-
|
|
5714
5913
|
//#endregion
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
*/
|
|
5720
|
-
const TEST_STAGE = "test";
|
|
5721
|
-
/** A stage becomes part of every physical name, so it has to fit in one. */
|
|
5722
|
-
const STAGE_NAME = /^[a-z][a-z0-9-]*$/;
|
|
5723
|
-
/** Everything wrong with one stage name, or nothing. */
|
|
5724
|
-
function nameProblems(name) {
|
|
5725
|
-
const problems = [];
|
|
5726
|
-
if (!STAGE_NAME.test(name)) problems.push(`stage "${name}" must be lowercase letters, digits and hyphens, starting with a letter`);
|
|
5727
|
-
if (name === TEST_STAGE) problems.push(`stage "${TEST_STAGE}" is reserved for gkm test`);
|
|
5728
|
-
return problems;
|
|
5729
|
-
}
|
|
5730
|
-
/** Everything wrong with a list of deployed stages on its own. */
|
|
5731
|
-
function deployedProblems(deployed) {
|
|
5732
|
-
const problems = deployed.flatMap(nameProblems);
|
|
5733
|
-
const seen = /* @__PURE__ */ new Set();
|
|
5734
|
-
for (const name of deployed) {
|
|
5735
|
-
if (seen.has(name)) problems.push(`stage "${name}" is listed twice`);
|
|
5736
|
-
seen.add(name);
|
|
5914
|
+
Object.defineProperty(exports, "_enum", {
|
|
5915
|
+
enumerable: true,
|
|
5916
|
+
get: function() {
|
|
5917
|
+
return _enum;
|
|
5737
5918
|
}
|
|
5738
|
-
return problems;
|
|
5739
|
-
}
|
|
5740
|
-
/** Everything wrong with a stages block, or nothing. */
|
|
5741
|
-
function stageProblems(stages) {
|
|
5742
|
-
if (!stages) return ["`stages` is required, e.g. stages: { local: 'dev', deployed: ['prod'] }"];
|
|
5743
|
-
const { local, deployed, protected: kept = [] } = stages;
|
|
5744
|
-
const problems = [...nameProblems(local), ...deployedProblems(deployed)];
|
|
5745
|
-
if (deployed.includes(local)) problems.push(`"${local}" is both the local stage and a deployed one; they would share secrets`);
|
|
5746
|
-
for (const name of kept) if (!deployed.includes(name)) problems.push(`protected stage "${name}" is not a deployed stage`);
|
|
5747
|
-
return problems;
|
|
5748
|
-
}
|
|
5749
|
-
/** The stages block, or an error naming everything wrong with it. */
|
|
5750
|
-
function validateStages(stages) {
|
|
5751
|
-
const problems = stageProblems(stages);
|
|
5752
|
-
if (problems.length) throw new Error(`Invalid stages in gkm.config.ts:\n ${problems.join("\n ")}`);
|
|
5753
|
-
return stages;
|
|
5754
|
-
}
|
|
5755
|
-
/** Refuses a stage the project does not deploy to. */
|
|
5756
|
-
function assertDeployedStage(stages, stage) {
|
|
5757
|
-
if (!stages.deployed.includes(stage)) throw new Error(`"${stage}" is not a deployed stage. gkm.config.ts deploys to: ${stages.deployed.join(", ") || "nothing yet"}.`);
|
|
5758
|
-
}
|
|
5759
|
-
|
|
5760
|
-
//#endregion
|
|
5761
|
-
//#region src/workspace/schema.ts
|
|
5762
|
-
/**
|
|
5763
|
-
* Routes can be a string glob, array of globs, or a partitioned config
|
|
5764
|
-
* with glob paths and a partition function.
|
|
5765
|
-
*/
|
|
5766
|
-
const RoutesSchema = union([
|
|
5767
|
-
string(),
|
|
5768
|
-
array(string()),
|
|
5769
|
-
object({
|
|
5770
|
-
paths: union([string(), array(string())]),
|
|
5771
|
-
partition: custom((val) => typeof val === "function")
|
|
5772
|
-
})
|
|
5773
|
-
]);
|
|
5774
|
-
/**
|
|
5775
|
-
* Telescope configuration schema.
|
|
5776
|
-
*/
|
|
5777
|
-
const TelescopeConfigSchema = object({
|
|
5778
|
-
enabled: boolean().optional(),
|
|
5779
|
-
port: number().optional(),
|
|
5780
|
-
path: string().optional(),
|
|
5781
|
-
ignore: array(string()).optional(),
|
|
5782
|
-
recordBody: boolean().optional(),
|
|
5783
|
-
maxEntries: number().optional(),
|
|
5784
|
-
websocket: boolean().optional()
|
|
5785
5919
|
});
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
enabled: boolean().optional(),
|
|
5791
|
-
path: string().optional(),
|
|
5792
|
-
schema: string().optional()
|
|
5793
|
-
});
|
|
5794
|
-
/**
|
|
5795
|
-
* OpenAPI configuration schema.
|
|
5796
|
-
*/
|
|
5797
|
-
const OpenApiConfigSchema = object({
|
|
5798
|
-
enabled: boolean().optional(),
|
|
5799
|
-
title: string().optional(),
|
|
5800
|
-
version: string().optional(),
|
|
5801
|
-
description: string().optional()
|
|
5802
|
-
});
|
|
5803
|
-
/**
|
|
5804
|
-
* Hooks configuration schema.
|
|
5805
|
-
*/
|
|
5806
|
-
const HooksConfigSchema = object({ server: string().optional() });
|
|
5807
|
-
/**
|
|
5808
|
-
* Backend framework schema for non-gkm apps.
|
|
5809
|
-
*/
|
|
5810
|
-
const BackendFrameworkSchema = _enum([
|
|
5811
|
-
"hono",
|
|
5812
|
-
"better-auth",
|
|
5813
|
-
"express",
|
|
5814
|
-
"fastify"
|
|
5815
|
-
]);
|
|
5816
|
-
/**
|
|
5817
|
-
* Frontend framework schema.
|
|
5818
|
-
*/
|
|
5819
|
-
const FrontendFrameworkSchema = _enum([
|
|
5820
|
-
"nextjs",
|
|
5821
|
-
"remix",
|
|
5822
|
-
"vite",
|
|
5823
|
-
"tanstack-start"
|
|
5824
|
-
]);
|
|
5825
|
-
/**
|
|
5826
|
-
* Mobile framework schema.
|
|
5827
|
-
*/
|
|
5828
|
-
const MobileFrameworkSchema = _enum(["expo"]);
|
|
5829
|
-
/**
|
|
5830
|
-
* Combined framework schema (backend, frontend, or mobile).
|
|
5831
|
-
*/
|
|
5832
|
-
const FrameworkSchema = union([
|
|
5833
|
-
BackendFrameworkSchema,
|
|
5834
|
-
FrontendFrameworkSchema,
|
|
5835
|
-
MobileFrameworkSchema
|
|
5836
|
-
]);
|
|
5837
|
-
/** Frontend framework values, kept in sync with FrontendFrameworkSchema. */
|
|
5838
|
-
const FRONTEND_FRAMEWORKS = [
|
|
5839
|
-
"nextjs",
|
|
5840
|
-
"remix",
|
|
5841
|
-
"vite",
|
|
5842
|
-
"tanstack-start"
|
|
5843
|
-
];
|
|
5844
|
-
/** Mobile framework values, kept in sync with MobileFrameworkSchema. */
|
|
5845
|
-
const MOBILE_FRAMEWORKS = ["expo"];
|
|
5846
|
-
/**
|
|
5847
|
-
* Deploy target schema.
|
|
5848
|
-
* Currently only 'dokploy' is supported.
|
|
5849
|
-
* 'vercel' and 'cloudflare' are planned for Phase 2.
|
|
5850
|
-
*/
|
|
5851
|
-
const DeployTargetSchema = _enum([
|
|
5852
|
-
"dokploy",
|
|
5853
|
-
"vercel",
|
|
5854
|
-
"cloudflare"
|
|
5855
|
-
]);
|
|
5856
|
-
/**
|
|
5857
|
-
* Supported deploy targets (Phase 1).
|
|
5858
|
-
*/
|
|
5859
|
-
const SUPPORTED_DEPLOY_TARGETS = ["dokploy"];
|
|
5860
|
-
/**
|
|
5861
|
-
* Phase 2 deploy targets (not yet implemented).
|
|
5862
|
-
*/
|
|
5863
|
-
const PHASE_2_DEPLOY_TARGETS = ["vercel", "cloudflare"];
|
|
5864
|
-
/**
|
|
5865
|
-
* Check if a deploy target is supported.
|
|
5866
|
-
*/
|
|
5867
|
-
function isDeployTargetSupported(target) {
|
|
5868
|
-
return SUPPORTED_DEPLOY_TARGETS.includes(target);
|
|
5869
|
-
}
|
|
5870
|
-
/**
|
|
5871
|
-
* Check if a deploy target is planned for Phase 2.
|
|
5872
|
-
*/
|
|
5873
|
-
function isPhase2DeployTarget(target) {
|
|
5874
|
-
return PHASE_2_DEPLOY_TARGETS.includes(target);
|
|
5875
|
-
}
|
|
5876
|
-
/**
|
|
5877
|
-
* Get error message for unsupported deploy targets.
|
|
5878
|
-
*/
|
|
5879
|
-
function getDeployTargetError(target, appName) {
|
|
5880
|
-
if (isPhase2DeployTarget(target)) {
|
|
5881
|
-
const context = appName ? ` for app "${appName}"` : "";
|
|
5882
|
-
return `Deploy target "${target}"${context} is coming in Phase 2. Currently only "dokploy" is supported.`;
|
|
5920
|
+
Object.defineProperty(exports, "array", {
|
|
5921
|
+
enumerable: true,
|
|
5922
|
+
get: function() {
|
|
5923
|
+
return array;
|
|
5883
5924
|
}
|
|
5884
|
-
return `Unknown deploy target: ${target}. Supported: dokploy. Coming in Phase 2: vercel, cloudflare.`;
|
|
5885
|
-
}
|
|
5886
|
-
/**
|
|
5887
|
-
* Service image configuration schema.
|
|
5888
|
-
*/
|
|
5889
|
-
const ServiceImageConfigSchema = object({
|
|
5890
|
-
version: string().optional(),
|
|
5891
|
-
image: string().optional()
|
|
5892
|
-
});
|
|
5893
|
-
/**
|
|
5894
|
-
* Mail service configuration schema.
|
|
5895
|
-
*/
|
|
5896
|
-
const MailServiceConfigSchema = ServiceImageConfigSchema.extend({ smtp: object({
|
|
5897
|
-
host: string(),
|
|
5898
|
-
port: number(),
|
|
5899
|
-
user: string().optional(),
|
|
5900
|
-
pass: string().optional()
|
|
5901
|
-
}).optional() });
|
|
5902
|
-
/**
|
|
5903
|
-
* Services configuration schema.
|
|
5904
|
-
*/
|
|
5905
|
-
const ServicesConfigSchema = object({
|
|
5906
|
-
db: union([boolean(), ServiceImageConfigSchema]).optional(),
|
|
5907
|
-
cache: union([
|
|
5908
|
-
boolean(),
|
|
5909
|
-
ServiceImageConfigSchema,
|
|
5910
|
-
_enum([
|
|
5911
|
-
"upstash",
|
|
5912
|
-
"elasticache",
|
|
5913
|
-
"db"
|
|
5914
|
-
])
|
|
5915
|
-
]).optional(),
|
|
5916
|
-
mail: union([
|
|
5917
|
-
boolean(),
|
|
5918
|
-
MailServiceConfigSchema,
|
|
5919
|
-
_enum([
|
|
5920
|
-
"resend",
|
|
5921
|
-
"ses",
|
|
5922
|
-
"smtp"
|
|
5923
|
-
])
|
|
5924
|
-
]).optional(),
|
|
5925
|
-
storage: union([
|
|
5926
|
-
boolean(),
|
|
5927
|
-
ServiceImageConfigSchema,
|
|
5928
|
-
_enum([
|
|
5929
|
-
"minio",
|
|
5930
|
-
"s3",
|
|
5931
|
-
"r2"
|
|
5932
|
-
])
|
|
5933
|
-
]).optional(),
|
|
5934
|
-
events: _enum([
|
|
5935
|
-
"pgboss",
|
|
5936
|
-
"sns",
|
|
5937
|
-
"rabbitmq"
|
|
5938
|
-
]).optional(),
|
|
5939
|
-
trustLocalCa: boolean().optional()
|
|
5940
|
-
});
|
|
5941
|
-
/**
|
|
5942
|
-
* Dokploy workspace configuration schema.
|
|
5943
|
-
* Supports either a single endpoint or per-stage endpoints.
|
|
5944
|
-
*/
|
|
5945
|
-
const DokployWorkspaceConfigSchema = object({
|
|
5946
|
-
endpoint: url("Dokploy endpoint must be a valid URL").optional(),
|
|
5947
|
-
endpoints: record(string(), url("Endpoint must be a valid URL")).optional(),
|
|
5948
|
-
registry: string().optional(),
|
|
5949
|
-
registryId: string().optional(),
|
|
5950
|
-
domains: record(string(), string()).optional()
|
|
5951
|
-
}).refine((data) => data.endpoint || data.endpoints, { message: "Either endpoint or endpoints must be provided" });
|
|
5952
|
-
/**
|
|
5953
|
-
* Valid AWS regions.
|
|
5954
|
-
*/
|
|
5955
|
-
const AwsRegionSchema = _enum([
|
|
5956
|
-
"us-east-1",
|
|
5957
|
-
"us-east-2",
|
|
5958
|
-
"us-west-1",
|
|
5959
|
-
"us-west-2",
|
|
5960
|
-
"af-south-1",
|
|
5961
|
-
"ap-east-1",
|
|
5962
|
-
"ap-south-1",
|
|
5963
|
-
"ap-south-2",
|
|
5964
|
-
"ap-southeast-1",
|
|
5965
|
-
"ap-southeast-2",
|
|
5966
|
-
"ap-southeast-3",
|
|
5967
|
-
"ap-southeast-4",
|
|
5968
|
-
"ap-northeast-1",
|
|
5969
|
-
"ap-northeast-2",
|
|
5970
|
-
"ap-northeast-3",
|
|
5971
|
-
"ca-central-1",
|
|
5972
|
-
"eu-central-1",
|
|
5973
|
-
"eu-central-2",
|
|
5974
|
-
"eu-west-1",
|
|
5975
|
-
"eu-west-2",
|
|
5976
|
-
"eu-west-3",
|
|
5977
|
-
"eu-south-1",
|
|
5978
|
-
"eu-south-2",
|
|
5979
|
-
"eu-north-1",
|
|
5980
|
-
"me-south-1",
|
|
5981
|
-
"me-central-1",
|
|
5982
|
-
"sa-east-1"
|
|
5983
|
-
]);
|
|
5984
|
-
/**
|
|
5985
|
-
* DNS record types supported across providers.
|
|
5986
|
-
*/
|
|
5987
|
-
const DnsRecordTypeSchema = _enum([
|
|
5988
|
-
"A",
|
|
5989
|
-
"AAAA",
|
|
5990
|
-
"CNAME",
|
|
5991
|
-
"MX",
|
|
5992
|
-
"TXT",
|
|
5993
|
-
"NS",
|
|
5994
|
-
"SRV",
|
|
5995
|
-
"CAA"
|
|
5996
|
-
]);
|
|
5997
|
-
/**
|
|
5998
|
-
* A DNS record as returned by the provider.
|
|
5999
|
-
*/
|
|
6000
|
-
const DnsRecordSchema = object({
|
|
6001
|
-
name: string(),
|
|
6002
|
-
type: DnsRecordTypeSchema,
|
|
6003
|
-
ttl: number().int().positive(),
|
|
6004
|
-
values: array(string())
|
|
6005
|
-
});
|
|
6006
|
-
/**
|
|
6007
|
-
* A DNS record to create or update.
|
|
6008
|
-
*/
|
|
6009
|
-
const UpsertDnsRecordSchema = object({
|
|
6010
|
-
name: string(),
|
|
6011
|
-
type: DnsRecordTypeSchema,
|
|
6012
|
-
ttl: number().int().positive(),
|
|
6013
|
-
value: string()
|
|
6014
|
-
});
|
|
6015
|
-
/**
|
|
6016
|
-
* Result of an upsert operation.
|
|
6017
|
-
*/
|
|
6018
|
-
const UpsertResultSchema = object({
|
|
6019
|
-
record: UpsertDnsRecordSchema,
|
|
6020
|
-
created: boolean(),
|
|
6021
|
-
unchanged: boolean()
|
|
6022
|
-
});
|
|
6023
|
-
/**
|
|
6024
|
-
* Hostinger DNS provider config (without domain - domain is the record key).
|
|
6025
|
-
*/
|
|
6026
|
-
const HostingerDnsProviderSchema = object({
|
|
6027
|
-
provider: literal("hostinger"),
|
|
6028
|
-
ttl: number().int().positive().optional()
|
|
6029
|
-
});
|
|
6030
|
-
/**
|
|
6031
|
-
* Route53 DNS provider config (without domain - domain is the record key).
|
|
6032
|
-
*/
|
|
6033
|
-
const Route53DnsProviderSchema = object({
|
|
6034
|
-
provider: literal("route53"),
|
|
6035
|
-
region: AwsRegionSchema.optional(),
|
|
6036
|
-
profile: string().optional(),
|
|
6037
|
-
hostedZoneId: string().optional(),
|
|
6038
|
-
ttl: number().int().positive().optional()
|
|
6039
|
-
});
|
|
6040
|
-
/**
|
|
6041
|
-
* Cloudflare DNS provider config (placeholder for future).
|
|
6042
|
-
*/
|
|
6043
|
-
const CloudflareDnsProviderSchema = object({
|
|
6044
|
-
provider: literal("cloudflare"),
|
|
6045
|
-
ttl: number().int().positive().optional()
|
|
6046
|
-
});
|
|
6047
|
-
/**
|
|
6048
|
-
* Manual DNS configuration (user handles DNS themselves).
|
|
6049
|
-
*/
|
|
6050
|
-
const ManualDnsProviderSchema = object({ provider: literal("manual") });
|
|
6051
|
-
/**
|
|
6052
|
-
* Custom DNS provider config (user-provided implementation).
|
|
6053
|
-
*/
|
|
6054
|
-
const CustomDnsProviderSchema = object({
|
|
6055
|
-
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" }),
|
|
6056
|
-
ttl: number().int().positive().optional()
|
|
6057
5925
|
});
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
Route53DnsProviderSchema,
|
|
6064
|
-
CloudflareDnsProviderSchema,
|
|
6065
|
-
ManualDnsProviderSchema
|
|
6066
|
-
]);
|
|
6067
|
-
/**
|
|
6068
|
-
* Single DNS provider config (for one domain).
|
|
6069
|
-
*/
|
|
6070
|
-
const DnsProviderSchema = union([BuiltInDnsProviderSchema, CustomDnsProviderSchema]);
|
|
6071
|
-
/**
|
|
6072
|
-
* DNS configuration schema.
|
|
6073
|
-
*
|
|
6074
|
-
* Maps root domains to their DNS provider configuration.
|
|
6075
|
-
* Example:
|
|
6076
|
-
* ```
|
|
6077
|
-
* dns: {
|
|
6078
|
-
* 'geekmidas.dev': { provider: 'hostinger' },
|
|
6079
|
-
* 'geekmidas.com': { provider: 'route53' },
|
|
6080
|
-
* }
|
|
6081
|
-
* ```
|
|
6082
|
-
*
|
|
6083
|
-
* Supported providers:
|
|
6084
|
-
* - 'hostinger': Use Hostinger DNS API
|
|
6085
|
-
* - 'route53': Use AWS Route53
|
|
6086
|
-
* - 'cloudflare': Use Cloudflare DNS API (future)
|
|
6087
|
-
* - 'manual': Don't create records, just print required records
|
|
6088
|
-
* - Custom: Provide a DnsProvider implementation
|
|
6089
|
-
*/
|
|
6090
|
-
const DnsConfigSchema = record(string(), DnsProviderSchema);
|
|
6091
|
-
const HostingerDnsConfigSchema = HostingerDnsProviderSchema.extend({ domain: string().min(1, "Domain is required") });
|
|
6092
|
-
const Route53DnsConfigSchema = Route53DnsProviderSchema.extend({ domain: string().min(1, "Domain is required") });
|
|
6093
|
-
const CloudflareDnsConfigSchema = CloudflareDnsProviderSchema.extend({ domain: string().min(1, "Domain is required") });
|
|
6094
|
-
const ManualDnsConfigSchema = ManualDnsProviderSchema.extend({ domain: string().min(1, "Domain is required") });
|
|
6095
|
-
const CustomDnsConfigSchema = CustomDnsProviderSchema.extend({ domain: string().min(1, "Domain is required") });
|
|
6096
|
-
const BuiltInDnsConfigSchema = discriminatedUnion("provider", [
|
|
6097
|
-
HostingerDnsConfigSchema,
|
|
6098
|
-
Route53DnsConfigSchema,
|
|
6099
|
-
CloudflareDnsConfigSchema,
|
|
6100
|
-
ManualDnsConfigSchema
|
|
6101
|
-
]);
|
|
6102
|
-
const LegacyDnsConfigSchema = union([BuiltInDnsConfigSchema, CustomDnsConfigSchema]);
|
|
6103
|
-
/**
|
|
6104
|
-
* Combined DNS config that supports both new multi-domain and legacy single-domain formats.
|
|
6105
|
-
*/
|
|
6106
|
-
const DnsConfigWithLegacySchema = union([DnsConfigSchema, LegacyDnsConfigSchema]);
|
|
6107
|
-
/**
|
|
6108
|
-
* Backups configuration schema.
|
|
6109
|
-
*
|
|
6110
|
-
* Configures automatic backup destinations for database services.
|
|
6111
|
-
* On first deploy, creates S3 bucket with unique name and IAM credentials.
|
|
6112
|
-
*/
|
|
6113
|
-
const BackupsConfigSchema = object({
|
|
6114
|
-
type: literal("s3"),
|
|
6115
|
-
profile: string().optional(),
|
|
6116
|
-
region: AwsRegionSchema,
|
|
6117
|
-
schedule: string().optional(),
|
|
6118
|
-
retention: number().optional()
|
|
6119
|
-
});
|
|
6120
|
-
/**
|
|
6121
|
-
* Deploy configuration schema.
|
|
6122
|
-
*/
|
|
6123
|
-
const DeployConfigSchema = object({
|
|
6124
|
-
default: DeployTargetSchema.optional(),
|
|
6125
|
-
dokploy: DokployWorkspaceConfigSchema.optional(),
|
|
6126
|
-
dns: DnsConfigWithLegacySchema.optional(),
|
|
6127
|
-
backups: BackupsConfigSchema.optional()
|
|
6128
|
-
});
|
|
6129
|
-
/**
|
|
6130
|
-
* Models configuration schema.
|
|
6131
|
-
*/
|
|
6132
|
-
const ModelsConfigSchema = object({
|
|
6133
|
-
path: string().optional(),
|
|
6134
|
-
schema: _enum(["zod"]).optional()
|
|
6135
|
-
});
|
|
6136
|
-
/**
|
|
6137
|
-
* Shared configuration schema.
|
|
6138
|
-
*/
|
|
6139
|
-
const SharedConfigSchema = object({
|
|
6140
|
-
packages: array(string()).optional(),
|
|
6141
|
-
models: ModelsConfigSchema.optional()
|
|
6142
|
-
});
|
|
6143
|
-
/**
|
|
6144
|
-
* Secrets configuration schema.
|
|
6145
|
-
*/
|
|
6146
|
-
const StagesConfigSchema = object({
|
|
6147
|
-
local: string(),
|
|
6148
|
-
deployed: array(string()),
|
|
6149
|
-
protected: array(string()).optional()
|
|
6150
|
-
}).superRefine((stages, ctx) => {
|
|
6151
|
-
for (const message of stageProblems(stages)) ctx.addIssue({
|
|
6152
|
-
code: "custom",
|
|
6153
|
-
message
|
|
6154
|
-
});
|
|
6155
|
-
});
|
|
6156
|
-
const SecretsConfigSchema = object({
|
|
6157
|
-
enabled: boolean().optional(),
|
|
6158
|
-
algorithm: string().optional(),
|
|
6159
|
-
kdf: _enum(["scrypt", "pbkdf2"]).optional()
|
|
5926
|
+
Object.defineProperty(exports, "boolean", {
|
|
5927
|
+
enumerable: true,
|
|
5928
|
+
get: function() {
|
|
5929
|
+
return boolean;
|
|
5930
|
+
}
|
|
6160
5931
|
});
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
* SSM state provider config (requires region).
|
|
6167
|
-
*/
|
|
6168
|
-
const SSMStateConfigSchema = object({
|
|
6169
|
-
provider: literal("ssm"),
|
|
6170
|
-
region: AwsRegionSchema,
|
|
6171
|
-
profile: string().optional()
|
|
5932
|
+
Object.defineProperty(exports, "custom", {
|
|
5933
|
+
enumerable: true,
|
|
5934
|
+
get: function() {
|
|
5935
|
+
return custom;
|
|
5936
|
+
}
|
|
6172
5937
|
});
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
/**
|
|
6178
|
-
* Built-in state provider config (discriminated union).
|
|
6179
|
-
*/
|
|
6180
|
-
const BuiltInStateConfigSchema = discriminatedUnion("provider", [LocalStateConfigSchema, SSMStateConfigSchema]);
|
|
6181
|
-
/**
|
|
6182
|
-
* State configuration schema.
|
|
6183
|
-
*
|
|
6184
|
-
* Configures how deployment state is stored.
|
|
6185
|
-
* - 'local': Store in .gkm/deploy-{stage}.json (default)
|
|
6186
|
-
* - 'ssm': Store in AWS SSM Parameter Store (requires region)
|
|
6187
|
-
* - Custom: Provide a StateProvider implementation with read/write methods
|
|
6188
|
-
*/
|
|
6189
|
-
const StateConfigSchema = union([BuiltInStateConfigSchema, CustomStateConfigSchema]);
|
|
6190
|
-
/**
|
|
6191
|
-
* App configuration schema.
|
|
6192
|
-
*/
|
|
6193
|
-
const AppConfigSchema = object({
|
|
6194
|
-
type: _enum([
|
|
6195
|
-
"backend",
|
|
6196
|
-
"web",
|
|
6197
|
-
"mobile"
|
|
6198
|
-
]).optional().default("backend"),
|
|
6199
|
-
path: string().min(1, "App path is required"),
|
|
6200
|
-
port: number().int().positive("Port must be a positive integer"),
|
|
6201
|
-
dependencies: array(string()).optional(),
|
|
6202
|
-
deploy: DeployTargetSchema.optional(),
|
|
6203
|
-
constructs: RoutesSchema.optional(),
|
|
6204
|
-
routes: RoutesSchema.optional(),
|
|
6205
|
-
functions: RoutesSchema.optional(),
|
|
6206
|
-
crons: RoutesSchema.optional(),
|
|
6207
|
-
queues: RoutesSchema.optional(),
|
|
6208
|
-
topics: RoutesSchema.optional(),
|
|
6209
|
-
subscribers: RoutesSchema.optional(),
|
|
6210
|
-
envParser: string().optional(),
|
|
6211
|
-
logger: string().optional(),
|
|
6212
|
-
hooks: HooksConfigSchema.optional(),
|
|
6213
|
-
telescope: union([
|
|
6214
|
-
string(),
|
|
6215
|
-
boolean(),
|
|
6216
|
-
TelescopeConfigSchema
|
|
6217
|
-
]).optional(),
|
|
6218
|
-
studio: union([
|
|
6219
|
-
string(),
|
|
6220
|
-
boolean(),
|
|
6221
|
-
StudioConfigSchema
|
|
6222
|
-
]).optional(),
|
|
6223
|
-
openapi: union([boolean(), OpenApiConfigSchema]).optional(),
|
|
6224
|
-
runtime: _enum(["node", "bun"]).optional(),
|
|
6225
|
-
env: union([string(), array(string())]).optional(),
|
|
6226
|
-
entry: string().optional(),
|
|
6227
|
-
framework: FrameworkSchema.optional(),
|
|
6228
|
-
config: object({
|
|
6229
|
-
client: string().optional(),
|
|
6230
|
-
server: string().optional()
|
|
6231
|
-
}).optional()
|
|
6232
|
-
}).refine((data) => {
|
|
6233
|
-
if (data.type === "web") {
|
|
6234
|
-
if (!data.framework || !FRONTEND_FRAMEWORKS.includes(data.framework)) return false;
|
|
5938
|
+
Object.defineProperty(exports, "discriminatedUnion", {
|
|
5939
|
+
enumerable: true,
|
|
5940
|
+
get: function() {
|
|
5941
|
+
return discriminatedUnion;
|
|
6235
5942
|
}
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
if (data.type === "mobile") {
|
|
6242
|
-
if (!data.framework || !MOBILE_FRAMEWORKS.includes(data.framework)) return false;
|
|
5943
|
+
});
|
|
5944
|
+
Object.defineProperty(exports, "email", {
|
|
5945
|
+
enumerable: true,
|
|
5946
|
+
get: function() {
|
|
5947
|
+
return email;
|
|
6243
5948
|
}
|
|
6244
|
-
return true;
|
|
6245
|
-
}, {
|
|
6246
|
-
message: `Mobile apps must have a valid mobile framework (${MOBILE_FRAMEWORKS.join(", ")})`,
|
|
6247
|
-
path: ["framework"]
|
|
6248
5949
|
});
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
name: string().optional(),
|
|
6254
|
-
constructs: RoutesSchema.optional(),
|
|
6255
|
-
apps: record(string(), AppConfigSchema).optional(),
|
|
6256
|
-
shared: SharedConfigSchema.optional(),
|
|
6257
|
-
deploy: DeployConfigSchema.optional(),
|
|
6258
|
-
services: ServicesConfigSchema.optional(),
|
|
6259
|
-
stages: StagesConfigSchema,
|
|
6260
|
-
secrets: SecretsConfigSchema.optional(),
|
|
6261
|
-
state: StateConfigSchema.optional()
|
|
6262
|
-
}).refine((data) => {
|
|
6263
|
-
const appNames = Object.keys(data.apps ?? {});
|
|
6264
|
-
for (const [appName, app] of Object.entries(data.apps ?? {})) for (const dep of app.dependencies ?? []) {
|
|
6265
|
-
if (!appNames.includes(dep)) return false;
|
|
6266
|
-
if (dep === appName) return false;
|
|
5950
|
+
Object.defineProperty(exports, "literal", {
|
|
5951
|
+
enumerable: true,
|
|
5952
|
+
get: function() {
|
|
5953
|
+
return literal;
|
|
6267
5954
|
}
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
function hasCycle(app) {
|
|
6274
|
-
if (recStack.has(app)) return true;
|
|
6275
|
-
if (visited.has(app)) return false;
|
|
6276
|
-
visited.add(app);
|
|
6277
|
-
recStack.add(app);
|
|
6278
|
-
const deps = data.apps?.[app]?.dependencies ?? [];
|
|
6279
|
-
for (const dep of deps) if (hasCycle(dep)) return true;
|
|
6280
|
-
recStack.delete(app);
|
|
6281
|
-
return false;
|
|
5955
|
+
});
|
|
5956
|
+
Object.defineProperty(exports, "looseObject", {
|
|
5957
|
+
enumerable: true,
|
|
5958
|
+
get: function() {
|
|
5959
|
+
return looseObject;
|
|
6282
5960
|
}
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
5961
|
+
});
|
|
5962
|
+
Object.defineProperty(exports, "number", {
|
|
5963
|
+
enumerable: true,
|
|
5964
|
+
get: function() {
|
|
5965
|
+
return number;
|
|
6287
5966
|
}
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
code: "custom",
|
|
6294
|
-
message: getDeployTargetError(defaultTarget),
|
|
6295
|
-
path: ["deploy", "default"]
|
|
6296
|
-
});
|
|
6297
|
-
return;
|
|
5967
|
+
});
|
|
5968
|
+
Object.defineProperty(exports, "object", {
|
|
5969
|
+
enumerable: true,
|
|
5970
|
+
get: function() {
|
|
5971
|
+
return object;
|
|
6298
5972
|
}
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
"apps",
|
|
6305
|
-
appName,
|
|
6306
|
-
"deploy"
|
|
6307
|
-
]
|
|
6308
|
-
});
|
|
6309
|
-
return;
|
|
5973
|
+
});
|
|
5974
|
+
Object.defineProperty(exports, "record", {
|
|
5975
|
+
enumerable: true,
|
|
5976
|
+
get: function() {
|
|
5977
|
+
return record;
|
|
6310
5978
|
}
|
|
6311
|
-
if (data.state?.provider === "ssm" && !data.name) ctx.addIssue({
|
|
6312
|
-
code: "custom",
|
|
6313
|
-
message: "Workspace name is required when using SSM state provider. Add \"name\" to your gkm.config.ts.",
|
|
6314
|
-
path: ["name"]
|
|
6315
|
-
});
|
|
6316
5979
|
});
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
function validateWorkspaceConfig(config$1) {
|
|
6322
|
-
return WorkspaceConfigSchema.parse(config$1);
|
|
6323
|
-
}
|
|
6324
|
-
/**
|
|
6325
|
-
* Safe validation that returns result instead of throwing.
|
|
6326
|
-
*/
|
|
6327
|
-
function safeValidateWorkspaceConfig(config$1) {
|
|
6328
|
-
const result = WorkspaceConfigSchema.safeParse(config$1);
|
|
6329
|
-
if (result.success) return {
|
|
6330
|
-
success: true,
|
|
6331
|
-
data: result.data
|
|
6332
|
-
};
|
|
6333
|
-
return {
|
|
6334
|
-
success: false,
|
|
6335
|
-
error: result.error
|
|
6336
|
-
};
|
|
6337
|
-
}
|
|
6338
|
-
/**
|
|
6339
|
-
* Format Zod errors into user-friendly messages.
|
|
6340
|
-
*/
|
|
6341
|
-
function formatValidationErrors(error$1) {
|
|
6342
|
-
const messages = error$1.issues.map((issue$1) => {
|
|
6343
|
-
const path = issue$1.path.join(".");
|
|
6344
|
-
return path ? ` - ${path}: ${issue$1.message}` : ` - ${issue$1.message}`;
|
|
6345
|
-
});
|
|
6346
|
-
return `Workspace configuration validation failed:\n${messages.join("\n")}`;
|
|
6347
|
-
}
|
|
6348
|
-
|
|
6349
|
-
//#endregion
|
|
6350
|
-
//#region src/workspace/types.ts
|
|
6351
|
-
/**
|
|
6352
|
-
* Type guard to check if a config is a WorkspaceConfig.
|
|
6353
|
-
*
|
|
6354
|
-
* @example
|
|
6355
|
-
* ```ts
|
|
6356
|
-
* const config = await loadConfig();
|
|
6357
|
-
* if (isWorkspaceConfig(config)) {
|
|
6358
|
-
* // config.apps is available
|
|
6359
|
-
* console.log(Object.keys(config.apps));
|
|
6360
|
-
* }
|
|
6361
|
-
* ```
|
|
6362
|
-
*/
|
|
6363
|
-
function isWorkspaceConfig(config$1) {
|
|
6364
|
-
if (typeof config$1 !== "object" || config$1 === null) return false;
|
|
6365
|
-
if ("apps" in config$1 && typeof config$1.apps === "object") return true;
|
|
6366
|
-
return "constructs" in config$1 && !("routes" in config$1) && !("envParser" in config$1);
|
|
6367
|
-
}
|
|
6368
|
-
|
|
6369
|
-
//#endregion
|
|
6370
|
-
//#region src/workspace/index.ts
|
|
6371
|
-
/**
|
|
6372
|
-
* Validate that all dependencies reference existing apps.
|
|
6373
|
-
* Returns the config if valid, throws otherwise.
|
|
6374
|
-
*/
|
|
6375
|
-
function validateDependencies(apps) {
|
|
6376
|
-
const appNames = new Set(Object.keys(apps));
|
|
6377
|
-
for (const [appName, app] of Object.entries(apps)) for (const dep of app.dependencies ?? []) {
|
|
6378
|
-
if (!appNames.has(dep)) throw new Error(`Invalid dependency: App "${appName}" depends on "${dep}" which does not exist. Valid apps are: ${[...appNames].join(", ")}`);
|
|
6379
|
-
if (dep === appName) throw new Error(`Invalid dependency: App "${appName}" cannot depend on itself.`);
|
|
5980
|
+
Object.defineProperty(exports, "string", {
|
|
5981
|
+
enumerable: true,
|
|
5982
|
+
get: function() {
|
|
5983
|
+
return string;
|
|
6380
5984
|
}
|
|
6381
|
-
}
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
* - Autocomplete for app names in dependencies
|
|
6387
|
-
* - Type errors for invalid dependency references
|
|
6388
|
-
* - Full type inference for the returned config
|
|
6389
|
-
*
|
|
6390
|
-
* @example
|
|
6391
|
-
* ```ts
|
|
6392
|
-
* // gkm.config.ts
|
|
6393
|
-
* import { defineWorkspace } from '@geekmidas/cli';
|
|
6394
|
-
*
|
|
6395
|
-
* export default defineWorkspace({
|
|
6396
|
-
* name: 'my-saas',
|
|
6397
|
-
* apps: {
|
|
6398
|
-
* api: {
|
|
6399
|
-
* type: 'backend',
|
|
6400
|
-
* path: 'apps/api',
|
|
6401
|
-
* port: 3000,
|
|
6402
|
-
* routes: './src/endpoints/**\/*.ts',
|
|
6403
|
-
* envParser: './src/config/env',
|
|
6404
|
-
* logger: './src/logger',
|
|
6405
|
-
* },
|
|
6406
|
-
* web: {
|
|
6407
|
-
* type: 'web',
|
|
6408
|
-
* framework: 'nextjs',
|
|
6409
|
-
* path: 'apps/web',
|
|
6410
|
-
* port: 3001,
|
|
6411
|
-
* dependencies: ['api'], // <- autocomplete shows 'api' | 'web'
|
|
6412
|
-
* },
|
|
6413
|
-
* },
|
|
6414
|
-
* services: {
|
|
6415
|
-
* db: true,
|
|
6416
|
-
* cache: true,
|
|
6417
|
-
* },
|
|
6418
|
-
* });
|
|
6419
|
-
*
|
|
6420
|
-
* // config.apps.api <- full type inference
|
|
6421
|
-
* // config.apps.foo <- TypeScript error
|
|
6422
|
-
* ```
|
|
6423
|
-
*/
|
|
6424
|
-
function defineWorkspace(config$1) {
|
|
6425
|
-
if (config$1.apps) validateDependencies(config$1.apps);
|
|
6426
|
-
const result = safeValidateWorkspaceConfig(config$1);
|
|
6427
|
-
if (!result.success && result.error) throw new Error(formatValidationErrors(result.error));
|
|
6428
|
-
return config$1;
|
|
6429
|
-
}
|
|
6430
|
-
/**
|
|
6431
|
-
* Get the package name from package.json in the given directory.
|
|
6432
|
-
*/
|
|
6433
|
-
function getPackageName(cwd) {
|
|
6434
|
-
try {
|
|
6435
|
-
const pkg = __require(`${cwd}/package.json`);
|
|
6436
|
-
return pkg.name?.replace(/^@[^/]+\//, "");
|
|
6437
|
-
} catch {
|
|
6438
|
-
return void 0;
|
|
5985
|
+
});
|
|
5986
|
+
Object.defineProperty(exports, "toJSONSchema", {
|
|
5987
|
+
enumerable: true,
|
|
5988
|
+
get: function() {
|
|
5989
|
+
return toJSONSchema;
|
|
6439
5990
|
}
|
|
6440
|
-
}
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
const name = config$1.name ?? getPackageName(cwd) ?? basename(cwd);
|
|
6446
|
-
const defaultTarget = config$1.deploy?.default ?? "dokploy";
|
|
6447
|
-
const normalizedApps = {};
|
|
6448
|
-
for (const [appName, app] of Object.entries(config$1.apps ?? {})) normalizedApps[appName] = normalizeAppConfig(app, defaultTarget);
|
|
6449
|
-
return {
|
|
6450
|
-
name,
|
|
6451
|
-
root: cwd,
|
|
6452
|
-
...config$1.constructs ? { constructs: config$1.constructs } : {},
|
|
6453
|
-
apps: normalizedApps,
|
|
6454
|
-
services: config$1.services ?? {},
|
|
6455
|
-
deploy: config$1.deploy ?? { default: "dokploy" },
|
|
6456
|
-
shared: config$1.shared ?? { packages: ["packages/*"] },
|
|
6457
|
-
stages: validateStages(config$1.stages),
|
|
6458
|
-
secrets: config$1.secrets ?? {},
|
|
6459
|
-
state: config$1.state
|
|
6460
|
-
};
|
|
6461
|
-
}
|
|
6462
|
-
/**
|
|
6463
|
-
* Normalize an app configuration with resolved defaults.
|
|
6464
|
-
* @param app - App configuration
|
|
6465
|
-
* @param defaultTarget - Default deploy target from workspace config
|
|
6466
|
-
*/
|
|
6467
|
-
function normalizeAppConfig(app, defaultTarget) {
|
|
6468
|
-
return {
|
|
6469
|
-
...app,
|
|
6470
|
-
type: app.type ?? "backend",
|
|
6471
|
-
port: app.port,
|
|
6472
|
-
path: app.path,
|
|
6473
|
-
dependencies: app.dependencies ?? [],
|
|
6474
|
-
resolvedDeployTarget: app.deploy ?? defaultTarget
|
|
6475
|
-
};
|
|
6476
|
-
}
|
|
6477
|
-
/**
|
|
6478
|
-
* Wrap a single-app GkmConfig as a workspace.
|
|
6479
|
-
* This allows existing single-app configs to work seamlessly.
|
|
6480
|
-
*/
|
|
6481
|
-
function wrapSingleAppAsWorkspace(config$1, cwd) {
|
|
6482
|
-
const name = config$1.name ?? getPackageName(cwd) ?? basename(cwd);
|
|
6483
|
-
const normalizedServices = { ...config$1.services ?? {} };
|
|
6484
|
-
const app = {
|
|
6485
|
-
type: "backend",
|
|
6486
|
-
path: ".",
|
|
6487
|
-
port: (typeof config$1.providers?.server === "object" ? config$1.providers.server.port : void 0) ?? 3e3,
|
|
6488
|
-
dependencies: [],
|
|
6489
|
-
resolvedDeployTarget: config$1.deploy?.default ?? "dokploy",
|
|
6490
|
-
constructs: config$1.constructs,
|
|
6491
|
-
providers: config$1.providers,
|
|
6492
|
-
hooks: config$1.hooks,
|
|
6493
|
-
telescope: config$1.telescope,
|
|
6494
|
-
studio: config$1.studio,
|
|
6495
|
-
openapi: config$1.openapi,
|
|
6496
|
-
runtime: config$1.runtime,
|
|
6497
|
-
env: config$1.env
|
|
6498
|
-
};
|
|
6499
|
-
return {
|
|
6500
|
-
name,
|
|
6501
|
-
root: cwd,
|
|
6502
|
-
apps: { api: app },
|
|
6503
|
-
services: normalizedServices,
|
|
6504
|
-
deploy: {
|
|
6505
|
-
default: "dokploy",
|
|
6506
|
-
...config$1.deploy
|
|
6507
|
-
},
|
|
6508
|
-
shared: { packages: [] },
|
|
6509
|
-
stages: validateStages(config$1.stages),
|
|
6510
|
-
secrets: {}
|
|
6511
|
-
};
|
|
6512
|
-
}
|
|
6513
|
-
/**
|
|
6514
|
-
* Process a loaded configuration (either single-app or workspace).
|
|
6515
|
-
* Returns a normalized workspace in both cases.
|
|
6516
|
-
*/
|
|
6517
|
-
function processConfig(config$1, cwd) {
|
|
6518
|
-
if (isWorkspaceConfig(config$1)) {
|
|
6519
|
-
const result = safeValidateWorkspaceConfig(config$1);
|
|
6520
|
-
if (!result.success && result.error) throw new Error(formatValidationErrors(result.error));
|
|
6521
|
-
return {
|
|
6522
|
-
type: "workspace",
|
|
6523
|
-
raw: config$1,
|
|
6524
|
-
workspace: normalizeWorkspace(config$1, cwd)
|
|
6525
|
-
};
|
|
5991
|
+
});
|
|
5992
|
+
Object.defineProperty(exports, "tuple", {
|
|
5993
|
+
enumerable: true,
|
|
5994
|
+
get: function() {
|
|
5995
|
+
return tuple;
|
|
6526
5996
|
}
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
}
|
|
6533
|
-
/**
|
|
6534
|
-
* The workspace's own constructs globs, absolute.
|
|
6535
|
-
*
|
|
6536
|
-
* Infrastructure two apps share is a fact about the product, and declaring it
|
|
6537
|
-
* inside one of them makes moving that app a change to the other's database.
|
|
6538
|
-
*/
|
|
6539
|
-
function workspaceConstructGlobs(workspace) {
|
|
6540
|
-
return constructPatterns(workspace.constructs).map((pattern) => isAbsolute(pattern) ? pattern : join(workspace.root, pattern));
|
|
6541
|
-
}
|
|
6542
|
-
/**
|
|
6543
|
-
* Every constructs glob an app can see, absolute.
|
|
6544
|
-
*
|
|
6545
|
-
* The workspace's own first, then the app's. Absolute because the app builds
|
|
6546
|
-
* from its own directory while the workspace's constructs live above it —
|
|
6547
|
-
* a relative glob resolved from the app would look for the product's
|
|
6548
|
-
* infrastructure inside one of its consumers and find nothing.
|
|
6549
|
-
*
|
|
6550
|
-
* Additive, not overriding: an app that declares its own constructs still sees
|
|
6551
|
-
* the ones the workspace declared for everybody.
|
|
6552
|
-
*/
|
|
6553
|
-
function appConstructGlobs(workspace, appName) {
|
|
6554
|
-
const globs = workspaceConstructGlobs(workspace);
|
|
6555
|
-
const app = workspace.apps[appName];
|
|
6556
|
-
if (app) {
|
|
6557
|
-
const root = isAbsolute(app.path) ? app.path : join(workspace.root, app.path);
|
|
6558
|
-
for (const pattern of constructPatterns(app.constructs)) globs.push(isAbsolute(pattern) ? pattern : join(root, pattern));
|
|
5997
|
+
});
|
|
5998
|
+
Object.defineProperty(exports, "union", {
|
|
5999
|
+
enumerable: true,
|
|
6000
|
+
get: function() {
|
|
6001
|
+
return union;
|
|
6559
6002
|
}
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
* One list, so what a deploy provisions and what an app's entry point
|
|
6566
|
-
* registers drivers for are read off the same globs.
|
|
6567
|
-
*/
|
|
6568
|
-
function allConstructGlobs(workspace) {
|
|
6569
|
-
const globs = [...workspaceConstructGlobs(workspace), ...Object.keys(workspace.apps).flatMap((appName) => appConstructGlobs(workspace, appName))];
|
|
6570
|
-
return [...new Set(globs)];
|
|
6571
|
-
}
|
|
6572
|
-
/** A `Routes` in any of its accepted shapes, as a flat list of patterns. */
|
|
6573
|
-
function constructPatterns(routes) {
|
|
6574
|
-
if (!routes) return [];
|
|
6575
|
-
if (typeof routes === "string") return [routes];
|
|
6576
|
-
if (Array.isArray(routes)) return routes;
|
|
6577
|
-
const paths = routes.paths;
|
|
6578
|
-
if (!paths) return [];
|
|
6579
|
-
return Array.isArray(paths) ? paths : [paths];
|
|
6580
|
-
}
|
|
6581
|
-
/**
|
|
6582
|
-
* Get the GkmConfig for a specific app in a workspace.
|
|
6583
|
-
* Useful for running existing single-app commands on a specific app.
|
|
6584
|
-
*/
|
|
6585
|
-
function getAppGkmConfig(workspace, appName) {
|
|
6586
|
-
const app = workspace.apps[appName];
|
|
6587
|
-
if (!app || app.type !== "backend") return void 0;
|
|
6588
|
-
return {
|
|
6589
|
-
services: workspace.services,
|
|
6590
|
-
stages: workspace.stages,
|
|
6591
|
-
constructs: appConstructGlobs(workspace, appName),
|
|
6592
|
-
providers: app.providers,
|
|
6593
|
-
hooks: app.hooks,
|
|
6594
|
-
telescope: app.telescope,
|
|
6595
|
-
studio: app.studio,
|
|
6596
|
-
openapi: app.openapi,
|
|
6597
|
-
runtime: app.runtime,
|
|
6598
|
-
env: app.env
|
|
6599
|
-
};
|
|
6600
|
-
}
|
|
6601
|
-
/**
|
|
6602
|
-
* Get topologically sorted app names based on dependencies.
|
|
6603
|
-
* Apps with no dependencies come first, then apps that depend on them.
|
|
6604
|
-
*/
|
|
6605
|
-
function getAppBuildOrder(workspace) {
|
|
6606
|
-
const appNames = Object.keys(workspace.apps);
|
|
6607
|
-
const visited = /* @__PURE__ */ new Set();
|
|
6608
|
-
const result = [];
|
|
6609
|
-
function visit(name) {
|
|
6610
|
-
if (visited.has(name)) return;
|
|
6611
|
-
visited.add(name);
|
|
6612
|
-
const app = workspace.apps[name];
|
|
6613
|
-
if (app) for (const dep of app.dependencies) visit(dep);
|
|
6614
|
-
result.push(name);
|
|
6003
|
+
});
|
|
6004
|
+
Object.defineProperty(exports, "unknown", {
|
|
6005
|
+
enumerable: true,
|
|
6006
|
+
get: function() {
|
|
6007
|
+
return unknown;
|
|
6615
6008
|
}
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
*
|
|
6622
|
-
* Each dependency gets the un-prefixed `{DEP}_URL` (for server-side use) and,
|
|
6623
|
-
* when the consuming app's framework supports a public-var prefix, also the
|
|
6624
|
-
* prefixed form (e.g. `NEXT_PUBLIC_{DEP}_URL` for Next.js, `VITE_{DEP}_URL`
|
|
6625
|
-
* for Vite/TanStack Start). The prefixed form is what gets bundled into the
|
|
6626
|
-
* client at build time.
|
|
6627
|
-
*/
|
|
6628
|
-
function getDependencyEnvVars(workspace, appName, urlPrefix = "http://localhost") {
|
|
6629
|
-
const app = workspace.apps[appName];
|
|
6630
|
-
if (!app) return {};
|
|
6631
|
-
const env = {};
|
|
6632
|
-
const publicPrefix = getPublicEnvPrefix(app.framework);
|
|
6633
|
-
for (const depName of app.dependencies) {
|
|
6634
|
-
const dep = workspace.apps[depName];
|
|
6635
|
-
if (dep) {
|
|
6636
|
-
const url$1 = `${urlPrefix}:${dep.port}`;
|
|
6637
|
-
const envKey = `${depName.toUpperCase()}_URL`;
|
|
6638
|
-
env[envKey] = url$1;
|
|
6639
|
-
if (publicPrefix) env[`${publicPrefix}${envKey}`] = url$1;
|
|
6640
|
-
}
|
|
6009
|
+
});
|
|
6010
|
+
Object.defineProperty(exports, "url", {
|
|
6011
|
+
enumerable: true,
|
|
6012
|
+
get: function() {
|
|
6013
|
+
return url;
|
|
6641
6014
|
}
|
|
6642
|
-
|
|
6643
|
-
}
|
|
6644
|
-
/**
|
|
6645
|
-
* Resolve the Dokploy endpoint for a specific stage.
|
|
6646
|
-
*
|
|
6647
|
-
* Uses per-stage endpoint from `endpoints` if available,
|
|
6648
|
-
* otherwise falls back to the global `endpoint`.
|
|
6649
|
-
*
|
|
6650
|
-
* @param dokployConfig - Dokploy workspace configuration
|
|
6651
|
-
* @param stage - Deployment stage (e.g., 'development', 'production')
|
|
6652
|
-
* @returns The endpoint URL for the stage, or undefined if not configured
|
|
6653
|
-
*
|
|
6654
|
-
* @example
|
|
6655
|
-
* ```ts
|
|
6656
|
-
* // With per-stage endpoints
|
|
6657
|
-
* const config = {
|
|
6658
|
-
* endpoints: {
|
|
6659
|
-
* development: 'https://dev.dokploy.example.com:3000',
|
|
6660
|
-
* production: 'https://prod.dokploy.example.com:3000',
|
|
6661
|
-
* },
|
|
6662
|
-
* };
|
|
6663
|
-
* getEndpointForStage(config, 'production'); // => 'https://prod.dokploy.example.com:3000'
|
|
6664
|
-
*
|
|
6665
|
-
* // With single endpoint
|
|
6666
|
-
* const config = { endpoint: 'https://dokploy.example.com:3000' };
|
|
6667
|
-
* getEndpointForStage(config, 'production'); // => 'https://dokploy.example.com:3000'
|
|
6668
|
-
* ```
|
|
6669
|
-
*/
|
|
6670
|
-
function getEndpointForStage(dokployConfig, stage) {
|
|
6671
|
-
if (!dokployConfig) return void 0;
|
|
6672
|
-
if (dokployConfig.endpoints?.[stage]) return dokployConfig.endpoints[stage];
|
|
6673
|
-
return dokployConfig.endpoint;
|
|
6674
|
-
}
|
|
6015
|
+
});
|
|
6675
6016
|
|
|
6676
|
-
//#
|
|
6677
|
-
export { PHASE_2_DEPLOY_TARGETS, PUBLIC_ENV_PREFIXES, SUPPORTED_DEPLOY_TARGETS, WorkspaceConfigSchema, allConstructGlobs, appConstructGlobs, assertDeployedStage, constructPatterns, defineWorkspace, deployedProblems, formatValidationErrors, getAppBuildOrder, getAppGkmConfig, getDependencyEnvVars, getDeployTargetError, getEndpointForStage, getPublicEnvPrefix, isDeployTargetSupported, isPhase2DeployTarget, isWorkspaceConfig, normalizeWorkspace, processConfig, safeValidateWorkspaceConfig, stageProblems, stripPublicPrefix, validateWorkspaceConfig, workspaceConstructGlobs, wrapSingleAppAsWorkspace };
|
|
6678
|
-
//# sourceMappingURL=workspace-zoqRbihZ.mjs.map
|
|
6017
|
+
//# sourceMappingURL=schemas-BObwxB_t.cjs.map
|