@vercel/cli-support 65.11.0 → 65.12.0-snapshot-801db9d533c3
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 +8 -120
- package/dist/chunks/add-BDJYCIBT.js +8 -0
- package/dist/chunks/add-LZR4CD7O.js +8 -0
- package/dist/chunks/add-MR6YZTRQ.js +8 -0
- package/dist/chunks/{alerts-JGRRCQA4.js → alerts-VOYMO6NJ.js} +1 -1
- package/dist/chunks/build-H2U56DYB.js +7 -0
- package/dist/chunks/{chunk-UF2E5BDE.js → chunk-23PO6JK6.js} +1 -1
- package/dist/chunks/{chunk-PUKYAALC.js → chunk-24SIHFEW.js} +1 -1
- package/dist/chunks/{chunk-EBIJ26IV.js → chunk-2C6TLXE5.js} +1 -1
- package/dist/chunks/{chunk-QROI2U32.js → chunk-2CQJKBKV.js} +2 -4
- package/dist/chunks/{chunk-7MZLV3KK.js → chunk-2CZL3GJU.js} +1 -1
- package/dist/chunks/{chunk-XH2R2EIK.js → chunk-2EV53VB5.js} +1 -1
- package/dist/chunks/{chunk-5B5CLOKM.js → chunk-2FNOYPRB.js} +1 -1
- package/dist/chunks/{chunk-4E6BGQWR.js → chunk-2LOA3LC6.js} +1 -1
- package/dist/chunks/{chunk-M3Z6NSC2.js → chunk-2V6UURUN.js} +1 -1
- package/dist/chunks/{chunk-B6QVH6IG.js → chunk-32EEQITR.js} +1 -1
- package/dist/chunks/{chunk-4VP57TOJ.js → chunk-33OMDQTW.js} +1 -1
- package/dist/chunks/{chunk-CFYLTZSV.js → chunk-3AGRCSWN.js} +1 -1
- package/dist/chunks/{chunk-42J2KCDF.js → chunk-3EFPSM6M.js} +1 -1
- package/dist/chunks/{chunk-DQASZDQT.js → chunk-3SNWIYU7.js} +1 -1
- package/dist/chunks/{chunk-EVBGFSK5.js → chunk-42Y46TZ3.js} +1 -1
- package/dist/chunks/{chunk-KV3QXTRZ.js → chunk-4OO6TXBM.js} +1 -1
- package/dist/chunks/{chunk-UUDE44NV.js → chunk-54FY6GJ5.js} +1 -1
- package/dist/chunks/{chunk-RIJ45N7C.js → chunk-5HQEYPDO.js} +1 -1
- package/dist/chunks/chunk-5KL6UFII.js +7 -0
- package/dist/chunks/{chunk-ECFLIVEE.js → chunk-5L566FZB.js} +1 -1
- package/dist/chunks/{chunk-NZW3RIQM.js → chunk-5MFGTXWC.js} +1 -1
- package/dist/chunks/{chunk-4ELZOAQH.js → chunk-5TMHRECT.js} +1 -1
- package/dist/chunks/{chunk-74VQ7PQV.js → chunk-5YLKPSZI.js} +1 -1
- package/dist/chunks/chunk-66TKNVRG.js +60 -0
- package/dist/chunks/{chunk-RDWLLSPU.js → chunk-6737KAJP.js} +1 -1
- package/dist/chunks/{chunk-V5TOMLK4.js → chunk-6Q2XEYCJ.js} +1 -1
- package/dist/chunks/{chunk-7VGBGUX7.js → chunk-6S6UZV3V.js} +1 -1
- package/dist/chunks/{chunk-EZLPMOHM.js → chunk-6WTGR7UP.js} +1 -1
- package/dist/chunks/chunk-7BDQUBSO.js +7 -0
- package/dist/chunks/chunk-7M6EHM5B.js +7 -0
- package/dist/chunks/{chunk-42FOKWGX.js → chunk-7PGDJTAH.js} +1 -1
- package/dist/chunks/{chunk-BZIC36KP.js → chunk-7TVNKTN2.js} +1 -1
- package/dist/chunks/{chunk-IIGNDMLO.js → chunk-ABSFPYM4.js} +1 -1
- package/dist/chunks/{chunk-MBXLL2HF.js → chunk-AGLOVMPC.js} +3 -3
- package/dist/chunks/{chunk-B56SRT5W.js → chunk-AIZIVXNX.js} +1 -1
- package/dist/chunks/{chunk-WBSFE6IE.js → chunk-AQBK55BT.js} +1 -1
- package/dist/chunks/chunk-AW33SRYY.js +7 -0
- package/dist/chunks/{chunk-UNPK7LVC.js → chunk-B3IBBNIR.js} +1 -1
- package/dist/chunks/{chunk-VRH7LWOC.js → chunk-B4KA3ZH2.js} +1 -1
- package/dist/chunks/{chunk-2J35YKA2.js → chunk-BC74BRVP.js} +12 -12
- package/dist/chunks/{chunk-PFZCGMJ7.js → chunk-BH5OASEJ.js} +1 -1
- package/dist/chunks/chunk-BIGJEDOA.js +11 -0
- package/dist/chunks/chunk-BOJDM3O7.js +7 -0
- package/dist/chunks/{chunk-375JVQYK.js → chunk-CJZE7647.js} +1 -1
- package/dist/chunks/{chunk-YZKARZ2B.js → chunk-CKJZSRAC.js} +1 -1
- package/dist/chunks/{chunk-TUAS3L5I.js → chunk-D5JRYYTT.js} +1 -1
- package/dist/chunks/{chunk-SF4E3AQ3.js → chunk-E3WP42P2.js} +1 -1
- package/dist/chunks/{chunk-6UMVJ7RL.js → chunk-E7CEQ2PO.js} +1 -1
- package/dist/chunks/chunk-E7IFYSQT.js +12 -0
- package/dist/chunks/chunk-EDO66J3L.js +7 -0
- package/dist/chunks/{chunk-C5QEQSEX.js → chunk-EIFBF3JQ.js} +1 -1
- package/dist/chunks/chunk-EM3U6PRB.js +7 -0
- package/dist/chunks/{chunk-AMPJ6RWT.js → chunk-EZVNGJN5.js} +1 -1
- package/dist/chunks/{chunk-ZPBGAZC2.js → chunk-F6KURUPQ.js} +1 -1
- package/dist/chunks/{chunk-5DXC4TE2.js → chunk-F7L5SXJM.js} +1 -1
- package/dist/chunks/{chunk-ZTHW5VNH.js → chunk-FFS3QJCU.js} +2 -2
- package/dist/chunks/{chunk-FNH3T3CF.js → chunk-FGZXIHGN.js} +1 -1
- package/dist/chunks/chunk-FXOKM2RM.js +7 -0
- package/dist/chunks/{chunk-NUSKXXZZ.js → chunk-FZLCDLWD.js} +1 -1
- package/dist/chunks/{chunk-CD6ZWCKT.js → chunk-G63MSB6N.js} +1 -1
- package/dist/chunks/{chunk-HNH3DPIZ.js → chunk-GAILIG45.js} +1 -1
- package/dist/chunks/{chunk-FVVOHGQE.js → chunk-GHNHUSVK.js} +1 -1
- package/dist/chunks/{chunk-4DMKP6AO.js → chunk-GOI2VVI7.js} +2 -2
- package/dist/chunks/chunk-GORL5DZC.js +11 -0
- package/dist/chunks/{chunk-WMWB7QKG.js → chunk-GP3KGUCK.js} +1 -1
- package/dist/chunks/{chunk-GL66K54F.js → chunk-GPDERS2D.js} +1 -1
- package/dist/chunks/{chunk-CU3LNJZV.js → chunk-GUSOYIW6.js} +1 -1
- package/dist/chunks/{chunk-AO6AMYBF.js → chunk-GY44CQXK.js} +1 -1
- package/dist/chunks/chunk-H64GR57G.js +7 -0
- package/dist/chunks/{chunk-VKCBEW6R.js → chunk-HBWRIR42.js} +1 -1
- package/dist/chunks/{chunk-4U6ACPA4.js → chunk-HR66URIC.js} +1 -1
- package/dist/chunks/chunk-HRGJO4HK.js +7 -0
- package/dist/chunks/chunk-HU5NUOWH.js +7 -0
- package/dist/chunks/{chunk-4KM733OB.js → chunk-HVJN2SSK.js} +1 -1
- package/dist/chunks/chunk-HXLOBW75.js +10 -0
- package/dist/chunks/{chunk-4T57TXQ3.js → chunk-IBBLLUXD.js} +1 -1
- package/dist/chunks/{chunk-MO2G2ND2.js → chunk-IJBRT2AD.js} +1 -1
- package/dist/chunks/{chunk-NT2N5UR4.js → chunk-IRIFXCZW.js} +1 -1
- package/dist/chunks/{chunk-ECGY67NB.js → chunk-J7RNU6AO.js} +1 -1
- package/dist/chunks/{chunk-SDYCW5JM.js → chunk-JONZUKWX.js} +1 -1
- package/dist/chunks/{chunk-P24YBQ6H.js → chunk-JVGENO2R.js} +1 -1
- package/dist/chunks/{chunk-PKNEWN4W.js → chunk-K46QQRUN.js} +1 -1
- package/dist/chunks/{chunk-BJXLR2RE.js → chunk-KKYNEEM7.js} +1 -1
- package/dist/chunks/{chunk-3TDFSO4X.js → chunk-KPSINH7T.js} +1 -1
- package/dist/chunks/chunk-KR4DMT3I.js +7 -0
- package/dist/chunks/{chunk-RCUDI7OF.js → chunk-M32HBBPK.js} +1 -1
- package/dist/chunks/{chunk-ZQXXESKG.js → chunk-MAA5GRIM.js} +1 -1
- package/dist/chunks/chunk-MCYG7CCE.js +7 -0
- package/dist/chunks/{chunk-VAZ7JG2Z.js → chunk-MNZYFYYH.js} +1 -1
- package/dist/chunks/{chunk-HDISAMDF.js → chunk-MQJ4MINN.js} +1 -1
- package/dist/chunks/{chunk-ITQPDXXA.js → chunk-MTZYPCZ7.js} +1 -1
- package/dist/chunks/{chunk-NE6PKR2J.js → chunk-MWWMY5R6.js} +1 -1
- package/dist/chunks/{chunk-UBJVL3NJ.js → chunk-MWXL6HYB.js} +3 -3
- package/dist/chunks/{chunk-UFXIPUNI.js → chunk-MXALPSIX.js} +1 -1
- package/dist/chunks/{chunk-7JMN657A.js → chunk-NBTFAXL4.js} +1 -1
- package/dist/chunks/{chunk-HYOWFNOP.js → chunk-NIZW6D6D.js} +1 -1
- package/dist/chunks/{chunk-KBVYN635.js → chunk-NREH4VSU.js} +1 -1
- package/dist/chunks/{chunk-TPJV5UNE.js → chunk-NTYBDY24.js} +1 -1
- package/dist/chunks/{chunk-NDMQVBTV.js → chunk-NYJTWSSD.js} +1 -1
- package/dist/chunks/{chunk-7ZJ7VUIR.js → chunk-O3DAPRJ3.js} +1 -1
- package/dist/chunks/chunk-O7TFWXLZ.js +13 -0
- package/dist/chunks/{chunk-K7ARJYAG.js → chunk-OFOZ5DBA.js} +1 -1
- package/dist/chunks/{chunk-FYE7ILRR.js → chunk-OFZUWHZW.js} +1 -1
- package/dist/chunks/{chunk-RI6DJAFI.js → chunk-OHEM2CSW.js} +1 -1
- package/dist/chunks/{chunk-6ORJPXDQ.js → chunk-OHK3Y5NS.js} +1 -1
- package/dist/chunks/{chunk-IHTWZEQW.js → chunk-OKKG2FUS.js} +1 -1
- package/dist/chunks/{chunk-7NMC4E66.js → chunk-OR3ZEVBW.js} +1 -1
- package/dist/chunks/{chunk-QDHTI5WK.js → chunk-POR6KNXT.js} +1 -1
- package/dist/chunks/{chunk-JUSNW3IF.js → chunk-PSFHYOLD.js} +1 -1
- package/dist/chunks/{chunk-TZE4CS4K.js → chunk-QBHTNUM5.js} +1 -1
- package/dist/chunks/chunk-QJDWNTYH.js +7 -0
- package/dist/chunks/{chunk-YUHKH4TK.js → chunk-QKOLFLLP.js} +1 -1
- package/dist/chunks/chunk-REJLEESP.js +10 -0
- package/dist/chunks/{chunk-EIMHC5UY.js → chunk-ROKZIMRO.js} +1 -1
- package/dist/chunks/{chunk-DR6OJB6P.js → chunk-RPIBJRIT.js} +1 -1
- package/dist/chunks/chunk-SEHERY6U.js +7 -0
- package/dist/chunks/{chunk-RR5SDYNN.js → chunk-SHMHL6W7.js} +1 -1
- package/dist/chunks/{chunk-5FIY443M.js → chunk-SMETSNPH.js} +1 -1
- package/dist/chunks/{chunk-NMIZSQDN.js → chunk-SP6E7PHW.js} +1 -1
- package/dist/chunks/chunk-SQBDW5FO.js +10 -0
- package/dist/chunks/chunk-SWFG73OS.js +8 -0
- package/dist/chunks/{chunk-CHIYT3V4.js → chunk-TA7KTIDV.js} +1 -1
- package/dist/chunks/{chunk-W24TLPO5.js → chunk-TJBVFVXK.js} +1 -1
- package/dist/chunks/{chunk-JTAUWH5V.js → chunk-TJUZVODP.js} +1 -1
- package/dist/chunks/{chunk-VWJXV5ZM.js → chunk-TKVUWTBK.js} +1 -1
- package/dist/chunks/chunk-U7ZEFVSQ.js +8 -0
- package/dist/chunks/{chunk-WTFD4MDT.js → chunk-UZQJQXGJ.js} +1 -1
- package/dist/chunks/{chunk-UIMJNASP.js → chunk-V7G4VDZI.js} +1 -1
- package/dist/chunks/{chunk-WNDR5HCU.js → chunk-VCJIB3FB.js} +1 -1
- package/dist/chunks/{chunk-EGTJTCCW.js → chunk-VFBELAGX.js} +1 -1
- package/dist/chunks/{chunk-AYZ52QDF.js → chunk-VM6X5BTK.js} +1 -1
- package/dist/chunks/{chunk-HZEKH3RO.js → chunk-VVTMF2AY.js} +1 -1
- package/dist/chunks/{chunk-N65H4JMJ.js → chunk-W25UARQV.js} +1 -1
- package/dist/chunks/chunk-WLMW7K7F.js +7 -0
- package/dist/chunks/{chunk-IHCYNUI2.js → chunk-XJYDISH3.js} +1 -1
- package/dist/chunks/chunk-XSQZ35V6.js +7 -0
- package/dist/chunks/{chunk-YODQLETL.js → chunk-XVDUP67R.js} +1 -1
- package/dist/chunks/{chunk-SLCPSRDR.js → chunk-Y2FVJ7YO.js} +1 -1
- package/dist/chunks/chunk-Y2SQC4GV.js +10 -0
- package/dist/chunks/{chunk-FVTRIRML.js → chunk-Y5S2OEJH.js} +1 -1
- package/dist/chunks/{chunk-EJN55YDV.js → chunk-YANOBY2G.js} +1 -1
- package/dist/chunks/{chunk-2RXUQ72I.js → chunk-YIOMTAUF.js} +1 -1
- package/dist/chunks/{chunk-BW25OFQG.js → chunk-YLCIOXSX.js} +1 -1
- package/dist/chunks/{chunk-GZLYNPNU.js → chunk-YNCWSPPJ.js} +1 -1
- package/dist/chunks/chunk-YQQ3A3YC.js +13 -0
- package/dist/chunks/{chunk-UI2H2EIM.js → chunk-YTRKHRL3.js} +1 -1
- package/dist/chunks/{chunk-MIIHBRKV.js → chunk-Z2K2JR7F.js} +1 -1
- package/dist/chunks/{chunk-F7AVGV4Y.js → chunk-Z73UJVGD.js} +1 -1
- package/dist/chunks/{chunk-6Y2ZL5XJ.js → chunk-ZKNEIE44.js} +2 -2
- package/dist/chunks/chunk-ZXEWWSTH.js +10 -0
- package/dist/chunks/chunk-ZZLCRSES.js +11 -0
- package/dist/chunks/clear-7QUM5KH7.js +8 -0
- package/dist/chunks/{cli-embedded-Y74S252S.js → cli-embedded-ABHGJLYX.js} +1 -1
- package/dist/chunks/compile-vercel-config-RDISBTDC.js +7 -0
- package/dist/chunks/config-2YNYR6YI.js +7 -0
- package/dist/chunks/config-4AOTKKGI.js +8 -0
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{connect-git-provider-GFAJLQLU.js → connect-git-provider-BMUUC7ND.js} +1 -1
- package/dist/chunks/contract-3VSUIBEY.js +10 -0
- package/dist/chunks/delete-EJNR4UYC.js +10 -0
- package/dist/chunks/delete-OYOBFPEG.js +9 -0
- package/dist/chunks/describe-ORIEHT3R.js +25 -0
- package/dist/chunks/detect-projects-AKK2XI76.js +7 -0
- package/dist/chunks/detect-services-3LYPKUVL.js +7 -0
- package/dist/chunks/disable-U6JU546S.js +7 -0
- package/dist/chunks/discard-6SHAFQ2H.js +14 -0
- package/dist/chunks/edit-YMWKFN3H.js +8 -0
- package/dist/chunks/edit-YTTKJFTG.js +9 -0
- package/dist/chunks/enable-A6KBPFXJ.js +7 -0
- package/dist/chunks/{esm-4ZHGYTUV.js → esm-CF5UHWPM.js} +1 -1
- package/dist/chunks/{esm-LNIAU767.js → esm-EYOXGOVF.js} +1 -1
- package/dist/chunks/{esm-IBY43SSX.js → esm-FSME24KA.js} +1 -1
- package/dist/chunks/{esm-7FVTQHRH.js → esm-IUATPKKB.js} +1 -1
- package/dist/chunks/{esm-GTSUYLKG.js → esm-L6OKDFWP.js} +1 -1
- package/dist/chunks/{esm-TEM4KPXZ.js → esm-ORQC2ZSA.js} +1 -1
- package/dist/chunks/{esm-TLAM7FSK.js → esm-PYIZNQIK.js} +1 -1
- package/dist/chunks/{exec-H3X7U4P3.js → exec-RQ257MTR.js} +1 -1
- package/dist/chunks/{export-25TQ3YBT.js → export-MMU6VVFK.js} +1 -1
- package/dist/chunks/future-ANILGGFQ.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-LKKZUKWF.js +7 -0
- package/dist/chunks/image-OWWKVBTU.js +7 -0
- package/dist/chunks/import-builders-VENL23EH.js +7 -0
- package/dist/chunks/{inspect-3W3TUJ6P.js → inspect-BPIJT4OX.js} +1 -1
- package/dist/chunks/inspect-GDZJZGHW.js +13 -0
- package/dist/chunks/{inspect-TN2QY3BP.js → inspect-H7JGEVL7.js} +1 -1
- package/dist/chunks/inspect-I6LQLOBG.js +8 -0
- package/dist/chunks/{inspect-BRYVSQBD.js → inspect-IGFAKTAX.js} +1 -1
- package/dist/chunks/inspect-U6V4UQXC.js +9 -0
- package/dist/chunks/list-763XVNFH.js +8 -0
- package/dist/chunks/{list-WA6Q7DUN.js → list-OX2N4JK7.js} +1 -1
- package/dist/chunks/list-WHZXMZJ5.js +12 -0
- package/dist/chunks/{list-6W4UQBY4.js → list-XLPMNNI7.js} +1 -1
- package/dist/chunks/login-2PGWWOKB.js +7 -0
- package/dist/chunks/login-T63WJL4S.js +9 -0
- package/dist/chunks/logs-S2KJGEIG.js +7 -0
- package/dist/chunks/ls-5HXYPIFR.js +11 -0
- package/dist/chunks/ls-M4GJOBZP.js +8 -0
- package/dist/chunks/ls-N56BWH2L.js +8 -0
- package/dist/chunks/{ls-L5LLKZBV.js → ls-O5B3LY4D.js} +1 -1
- package/dist/chunks/{ls-MAJ4QZTY.js → ls-PNGTHVUK.js} +1 -1
- package/dist/chunks/{ls-UXE5RSZN.js → ls-Q7FAOSVD.js} +1 -1
- package/dist/chunks/{ls-4WP6LHLL.js → ls-R4UDBWS3.js} +1 -1
- package/dist/chunks/migrate-experimental-services-HWJXO4AJ.js +7 -0
- package/dist/chunks/mutate-FM6BLE46.js +9 -0
- package/dist/chunks/{native-self-update-DEVBYOH2.js → native-self-update-7LL6RPJW.js} +1 -1
- package/dist/chunks/notifications-ZSZN35BQ.js +7 -0
- package/dist/chunks/open-4RXUUYQP.js +7 -0
- package/dist/chunks/openapi-457MABMI.js +7 -0
- package/dist/chunks/permissions-UJRTMOT7.js +7 -0
- package/dist/chunks/{plugin-offer-JUYWL4I7.js → plugin-offer-KJCRPUU5.js} +1 -1
- package/dist/chunks/prompt-missing-credentials-B5DGQFI7.js +7 -0
- package/dist/chunks/publish-I3APOD3N.js +15 -0
- package/dist/chunks/pull-2YUNTVPQ.js +7 -0
- package/dist/chunks/purchase-domain-if-available-3YOXUXII.js +7 -0
- package/dist/chunks/push-4QQJQRGZ.js +7 -0
- package/dist/chunks/query-2JO6HH5N.js +12 -0
- package/dist/chunks/reauthenticate-COYQMMAG.js +7 -0
- package/dist/chunks/remove-PWS5EJ7F.js +9 -0
- package/dist/chunks/reorder-COZQX64R.js +10 -0
- package/dist/chunks/reply-XDYZNHW2.js +9 -0
- package/dist/chunks/resolve-6KUFCZRX.js +12 -0
- package/dist/chunks/resolve-agent-team-NOT235ZN.js +7 -0
- package/dist/chunks/{resolve-deployment-framework-preset-AXXYBFCL.js → resolve-deployment-framework-preset-4TKUU6AH.js} +1 -1
- package/dist/chunks/restore-GSSD4ZWH.js +16 -0
- package/dist/chunks/rm-AUNVZPJ5.js +8 -0
- package/dist/chunks/rm-EIMUYBJT.js +8 -0
- package/dist/chunks/rm-EJH37HYN.js +8 -0
- package/dist/chunks/rm-O5NMCBC3.js +8 -0
- package/dist/chunks/rm-PHTOXG4E.js +8 -0
- package/dist/chunks/{routes-BP54NO3Z.js → routes-NEZJKMR5.js} +1 -1
- package/dist/chunks/rule-inspect-7HNYKQ6X.js +8 -0
- package/dist/chunks/{schema-753JMRZA.js → schema-5P7HROXE.js} +1 -1
- package/dist/chunks/schema-MZM5MN5V.js +14 -0
- package/dist/chunks/select-org-3BZWQD6R.js +7 -0
- package/dist/chunks/set-2RH74ZC3.js +7 -0
- package/dist/chunks/set-Q2EJ3V44.js +9 -0
- package/dist/chunks/setup-and-link-BT5TNY4J.js +7 -0
- package/dist/chunks/{skills-QZ4AMS2K.js → skills-DUOUHPBY.js} +1 -1
- package/dist/chunks/{statuspage-KHTMA4WL.js → statuspage-K5SC7KAQ.js} +1 -1
- package/dist/chunks/{detect-projects-K7SVMH5T.js → table-W6LOHWWF.js} +1 -1
- package/dist/chunks/tags-QOJEEMKS.js +7 -0
- package/dist/chunks/{types-NPUAHKSK.js → types-7L6HBXAU.js} +1 -1
- package/dist/chunks/{update-7XH7HM5F.js → update-HS6QFTQK.js} +1 -1
- package/dist/chunks/usage-3N6IA5SX.js +13 -0
- package/dist/chunks/validate-config-YLL6RPCP.js +7 -0
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +19 -37
- package/dist/commands/dev/index.js +4 -4
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +1 -1
- package/dist/commands-account.js +3 -3
- package/dist/commands-ai.js +6 -6
- package/dist/commands-blob.js +1 -1
- package/dist/commands-core.js +20 -20
- package/dist/commands-deployments.js +5 -5
- package/dist/commands-flags.js +1 -1
- package/dist/commands-integrations.js +1 -1
- package/dist/commands-observability.js +15 -8
- package/dist/commands-routing.js +5 -4
- package/dist/help.js +1 -1
- package/dist/index.js +5 -5
- package/dist/internal-build.js +1 -1
- package/dist/package.json +45 -245
- package/dist/vc.js +47 -695
- package/dist/version.mjs +1 -1
- package/package.json +51 -196
- package/dist/chunks/add-4R6FUHQT.js +0 -8
- package/dist/chunks/add-F3H4BFJZ.js +0 -8
- package/dist/chunks/add-TCOJ4SIQ.js +0 -8
- package/dist/chunks/build-GOLTZF6S.js +0 -7
- package/dist/chunks/chunk-3KJ6HWSX.js +0 -7
- package/dist/chunks/chunk-5X635INY.js +0 -11
- package/dist/chunks/chunk-7LPNDK2O.js +0 -7
- package/dist/chunks/chunk-A3M2BHWR.js +0 -13
- package/dist/chunks/chunk-BUFEV3T4.js +0 -11
- package/dist/chunks/chunk-BVR6OIU5.js +0 -7
- package/dist/chunks/chunk-D7BB5BPA.js +0 -10
- package/dist/chunks/chunk-DBT6PGEH.js +0 -7
- package/dist/chunks/chunk-DRZVM7CB.js +0 -12
- package/dist/chunks/chunk-EICEQXVS.js +0 -7
- package/dist/chunks/chunk-F2R7L3ZB.js +0 -7
- package/dist/chunks/chunk-FHMCTV5E.js +0 -7
- package/dist/chunks/chunk-FOE3MWES.js +0 -7
- package/dist/chunks/chunk-HKU6D7DU.js +0 -8
- package/dist/chunks/chunk-IOTKHTZH.js +0 -7
- package/dist/chunks/chunk-K4JTCVNW.js +0 -13
- package/dist/chunks/chunk-LALPOYIA.js +0 -8
- package/dist/chunks/chunk-M3R7F2N4.js +0 -7
- package/dist/chunks/chunk-MUKXOI2K.js +0 -8
- package/dist/chunks/chunk-NIS66BFX.js +0 -63
- package/dist/chunks/chunk-NSPW47RU.js +0 -7
- package/dist/chunks/chunk-NTDP6RTQ.js +0 -11
- package/dist/chunks/chunk-Q2QVK3TH.js +0 -7
- package/dist/chunks/chunk-RM3ZDRYE.js +0 -7
- package/dist/chunks/chunk-UCRMJMH6.js +0 -10
- package/dist/chunks/chunk-XQDHMFQY.js +0 -7
- package/dist/chunks/chunk-XRIM4BUF.js +0 -7
- package/dist/chunks/chunk-Z64MQIOE.js +0 -10
- package/dist/chunks/chunk-ZS2WS4AM.js +0 -7
- package/dist/chunks/clear-PECHXMV5.js +0 -8
- package/dist/chunks/compile-vercel-config-EM3HYOQC.js +0 -7
- package/dist/chunks/config-DA2NZUDH.js +0 -8
- package/dist/chunks/config-X6O3DT7V.js +0 -7
- package/dist/chunks/contract-RHMWRX4W.js +0 -10
- package/dist/chunks/delete-5RN5VW5L.js +0 -9
- package/dist/chunks/delete-MT6I7R7K.js +0 -10
- package/dist/chunks/detect-services-HSA4JHJX.js +0 -7
- package/dist/chunks/disable-LXPZDQMC.js +0 -7
- package/dist/chunks/discard-PW65T65S.js +0 -14
- package/dist/chunks/edit-WFSONASO.js +0 -8
- package/dist/chunks/edit-YID3FOJ3.js +0 -9
- package/dist/chunks/enable-X2EKQCIY.js +0 -7
- package/dist/chunks/future-DQBK457G.js +0 -7
- package/dist/chunks/generate-cert-for-deploy-OMEACY5G.js +0 -7
- package/dist/chunks/image-AO2OZG4W.js +0 -7
- package/dist/chunks/import-builders-GSDV4K4A.js +0 -7
- package/dist/chunks/inspect-4244CRHI.js +0 -13
- package/dist/chunks/inspect-C43IV7X4.js +0 -9
- package/dist/chunks/inspect-RP5KXOYQ.js +0 -8
- package/dist/chunks/list-2SY6PZLC.js +0 -12
- package/dist/chunks/list-WBKZGIMQ.js +0 -8
- package/dist/chunks/login-K6XBWOFD.js +0 -9
- package/dist/chunks/login-OGMXEW5N.js +0 -7
- package/dist/chunks/logs-R3ZERQ7M.js +0 -7
- package/dist/chunks/ls-EVAQD3LI.js +0 -8
- package/dist/chunks/ls-O5DKK3TY.js +0 -8
- package/dist/chunks/ls-PTHGXQLK.js +0 -11
- package/dist/chunks/mutate-EKZWPQQJ.js +0 -9
- package/dist/chunks/notifications-F5S3RKZF.js +0 -7
- package/dist/chunks/open-KGVG54NN.js +0 -7
- package/dist/chunks/openapi-7TPDTMCU.js +0 -7
- package/dist/chunks/permissions-5K7JZOMB.js +0 -7
- package/dist/chunks/prompt-missing-credentials-DX2KJB5X.js +0 -7
- package/dist/chunks/publish-KIRTO2ZO.js +0 -15
- package/dist/chunks/pull-3CRJK7BX.js +0 -7
- package/dist/chunks/purchase-domain-if-available-55IXEF43.js +0 -7
- package/dist/chunks/push-4YG5HKSD.js +0 -7
- package/dist/chunks/query-67KQVLTR.js +0 -12
- package/dist/chunks/reauthenticate-SWSBFGDU.js +0 -7
- package/dist/chunks/remove-SYTIFVWW.js +0 -9
- package/dist/chunks/reorder-TX5MXJEB.js +0 -10
- package/dist/chunks/reply-XVK33N5T.js +0 -9
- package/dist/chunks/resolve-JZ262ZF4.js +0 -12
- package/dist/chunks/resolve-agent-team-BG5YW55B.js +0 -7
- package/dist/chunks/restore-IPFL7TKT.js +0 -16
- package/dist/chunks/rm-2BCAZGQU.js +0 -8
- package/dist/chunks/rm-3CCU3CE6.js +0 -8
- package/dist/chunks/rm-5CQV5LYG.js +0 -8
- package/dist/chunks/rm-OV4OU6H2.js +0 -8
- package/dist/chunks/rm-WFGMOZ3G.js +0 -8
- package/dist/chunks/rule-inspect-RFJIIXZH.js +0 -8
- package/dist/chunks/schema-SUNFQGUL.js +0 -14
- package/dist/chunks/select-org-MPHPWWPU.js +0 -7
- package/dist/chunks/set-BR6EEOPB.js +0 -7
- package/dist/chunks/set-I3NWZRSI.js +0 -9
- package/dist/chunks/setup-and-link-MRTKVOWD.js +0 -7
- package/dist/chunks/tags-7DIZEAVE.js +0 -7
- package/dist/chunks/usage-3BS7JCCU.js +0 -13
- package/dist/chunks/validate-config-LAD7BU3B.js +0 -7
- package/dist/launcher-errors.js +0 -11
- package/dist/native-download.js +0 -8
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{buildRepoUrl,checkExistsAndConnect,connectGitProvider,disconnectGitProvider,formatProvider,parseRepoUrl,printRemoteUrls,selectAndParseRemoteUrl,selectRemoteUrl}from"./chunk-
|
|
7
|
+
import{buildRepoUrl,checkExistsAndConnect,connectGitProvider,disconnectGitProvider,formatProvider,parseRepoUrl,printRemoteUrls,selectAndParseRemoteUrl,selectRemoteUrl}from"./chunk-VCJIB3FB.js";import"./chunk-5TMHRECT.js";import"./chunk-JUAHDOL6.js";import"./chunk-YTRKHRL3.js";import"./chunk-54FY6GJ5.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import"./chunk-YNCWSPPJ.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";export{buildRepoUrl,checkExistsAndConnect,connectGitProvider,disconnectGitProvider,formatProvider,parseRepoUrl,printRemoteUrls,selectAndParseRemoteUrl,selectRemoteUrl};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{extractDatePortion,formatCurrency,formatQuantity}from"./chunk-ECQIO5K3.js";import{elapsed}from"./chunk-Q7D7RGXM.js";import{table}from"./chunk-CJZE7647.js";import{contractCommand}from"./chunk-O3DAPRJ3.js";import{printError}from"./chunk-NYJTWSSD.js";import{getScope}from"./chunk-XSQZ35V6.js";import{TelemetryClient}from"./chunk-AGLOVMPC.js";import"./chunk-2EYYB6YN.js";import"./chunk-NWGBDBZI.js";import"./chunk-GORL5DZC.js";import"./chunk-OFZUWHZW.js";import"./chunk-BC74BRVP.js";import"./chunk-4HR3I3ML.js";import"./chunk-K46QQRUN.js";import"./chunk-MTZYPCZ7.js";import"./chunk-GPDERS2D.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-VM6X5BTK.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-JONZUKWX.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-YNCWSPPJ.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import{require_dist}from"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import{getFlagsSpecification}from"./chunk-EZVNGJN5.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var ContractTelemetryClient=class extends TelemetryClient{trackCliFlagJson(json){json&&this.trackCliFlag("json")}};var import_error_utils=__toESM(require_dist(),1);async function contract(client,argv){let{print,log,error,spinner}=output_manager_default,flagsSpecification=getFlagsSpecification(contractCommand.options),parsedArgs;try{parsedArgs=parseArguments(argv,flagsSpecification)}catch(err){return printError(err),2}let telemetry=new ContractTelemetryClient({opts:{store:client.telemetryEventStore}}),formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return error(formatResult.error),2;let asJson=formatResult.jsonOutput;telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliFlagJson(parsedArgs.flags["--json"]);let contextName,teamId;try{let scope=await getScope(client);contextName=scope.contextName,teamId=scope.team?.id}catch(err){if((0,import_error_utils.isErrnoException)(err)&&(err.code==="NOT_AUTHORIZED"||err.code==="TEAM_DELETED"))return error(err.message),1;throw err}let start=Date.now();asJson||spinner(`Fetching contract commitments for ${import_chalk.default.bold(contextName)}`);let query=new URLSearchParams;teamId&&query.set("teamId",teamId);try{let response=await client.fetch(`/v1/billing/contract-commitments?${query}`,{json:!1,useCurrentTeam:!1});if(!response.ok){let errorText=await response.text();return error(`Failed to fetch contract commitments: ${response.status} ${errorText}`),1}let text=await response.text(),data=text?JSON.parse(text):null,commitments=Array.isArray(data)?data:[];if(asJson){let jsonOutput={context:contextName,commitments:commitments.map(c=>({contractId:c.ContractId,contractPeriodStart:c.ContractPeriodStart,contractPeriodEnd:c.ContractPeriodEnd,commitmentId:c.ContractCommitmentId,commitmentType:c.ContractCommitmentType,commitmentCategory:c.ContractCommitmentCategory,commitmentPeriodStart:c.ContractCommitmentPeriodStart,commitmentPeriodEnd:c.ContractCommitmentPeriodEnd,commitmentCost:c.ContractCommitmentCost,commitmentQuantity:c.ContractCommitmentQuantity,commitmentUnit:c.ContractCommitmentUnit,billingCurrency:c.BillingCurrency,description:c.ContractCommitmentDescription})),totalCommitments:commitments.length};return client.stdout.write(`${JSON.stringify(jsonOutput,null,2)}
|
|
8
|
+
`),0}if(log(`Contract commitments for ${import_chalk.default.bold(contextName)} ${elapsed(Date.now()-start)}`),log(""),commitments.length===0)return log("No contract commitments found."),0;let contractGroups=new Map;for(let commitment of commitments){let existing=contractGroups.get(commitment.ContractId)||[];existing.push(commitment),contractGroups.set(commitment.ContractId,existing)}for(let[contractId,contractCommitments]of contractGroups){let firstCommitment=contractCommitments[0];log(import_chalk.default.bold(`Contract: ${contractId}`)),log(`${import_chalk.default.gray("Period:")} ${extractDatePortion(firstCommitment.ContractPeriodStart)} to ${extractDatePortion(firstCommitment.ContractPeriodEnd)}`),log("");let headers=["Type","Category","Period","Commitment","Description"],rows=contractCommitments.map(c=>{let periodStr=`${extractDatePortion(c.ContractCommitmentPeriodStart)} - ${extractDatePortion(c.ContractCommitmentPeriodEnd)}`,commitmentValue;return c.ContractCommitmentCategory==="Spend"&&c.ContractCommitmentCost!==void 0?commitmentValue=formatCurrency(c.ContractCommitmentCost):c.ContractCommitmentCategory==="Usage"&&c.ContractCommitmentQuantity!==void 0?commitmentValue=formatQuantity(c.ContractCommitmentQuantity,c.ContractCommitmentUnit):commitmentValue="-",[c.ContractCommitmentType,c.ContractCommitmentCategory,periodStr,commitmentValue,c.ContractCommitmentDescription||"-"]}),tablePrint=table([headers.map(h=>import_chalk.default.bold(import_chalk.default.cyan(h))),...rows],{hsep:3,align:["l","l","l","r","l"]}).replace(/^/gm," ");print(`${tablePrint}
|
|
9
|
+
|
|
10
|
+
`)}return log(`${import_chalk.default.gray("Total commitments:")} ${commitments.length}`),0}catch(err){return output_manager_default.prettyError(err),1}}export{contract as default};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRouteTypeLabel,getRoutes,offerAutoPromote,parseSubcommandArgs,resolveRoutes,withGlobalFlags}from"./chunk-EIFBF3JQ.js";import{requireProjectContext}from"./chunk-FXOKM2RM.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-Q7D7RGXM.js";import"./chunk-B3IBBNIR.js";import"./chunk-PSFHYOLD.js";import{deleteSubcommand}from"./chunk-5L566FZB.js";import"./chunk-NYJTWSSD.js";import"./chunk-XSQZ35V6.js";import{AGENT_REASON,AGENT_STATUS,outputAgentError}from"./chunk-GORL5DZC.js";import"./chunk-OFZUWHZW.js";import"./chunk-BC74BRVP.js";import"./chunk-4HR3I3ML.js";import"./chunk-K46QQRUN.js";import"./chunk-MTZYPCZ7.js";import"./chunk-GPDERS2D.js";import"./chunk-4NTBYNFR.js";import"./chunk-VM6X5BTK.js";import"./chunk-2VBFQZ72.js";import"./chunk-JONZUKWX.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-YNCWSPPJ.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-EZVNGJN5.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function deleteRoutes(client,projectId,routeIds,options={}){let{teamId}=options,query=new URLSearchParams;teamId&&query.set("teamId",teamId);let queryString=query.toString(),url=`/v1/projects/${projectId}/routes${queryString?`?${queryString}`:""}`;return await client.fetch(url,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({routeIds})})}async function deleteRoute(client,argv){let parsed=await parseSubcommandArgs(argv,deleteSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args,flags}=parsed,skipConfirmation=flags["--yes"];if(args.length===0)return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.MISSING_ARGUMENTS,message:"At least one route name or ID is required.",next:[{command:withGlobalFlags(client,"routes remove <name-or-id> --yes"),when:"pass one or more ids/names and --yes to skip confirm"}]},2),output_manager_default.error(`At least one route name or ID is required. Usage: ${withGlobalFlags(client,"routes remove <name-or-id> [...]")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_FOUND,message:"No routes found in this project."},1),output_manager_default.error("No routes found in this project."),1;let resolved=await resolveRoutes(client,routes,args);if(!resolved)return 1;output_manager_default.print(`
|
|
8
|
+
`),output_manager_default.log(`The following ${resolved.length===1?"route":`${resolved.length} routes`} will be removed:`);for(let route of resolved){let typeLabels=getRouteTypeLabel(route);output_manager_default.print(` ${import_chalk.default.red("\xD7")} ${route.name} ${import_chalk.default.gray(`(${route.route.src})`)} ${import_chalk.default.gray(`[${typeLabels}]`)}
|
|
9
|
+
`)}if(output_manager_default.print(`
|
|
10
|
+
`),!skipConfirmation&&(client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:"Removing routes requires confirmation. Pass --yes to skip the prompt in non-interactive mode.",next:[{command:withGlobalFlags(client,`routes remove ${args.join(" ")} --yes`),when:"re-run with --yes to confirm without prompt"}]},1),!await client.input.confirm(`Remove ${resolved.length===1?"this route":`these ${resolved.length} routes`}?`,!1)))return output_manager_default.log("Aborted."),0;let deleteStamp=stamp_default();output_manager_default.spinner(`Removing ${resolved.length===1?"route":`${resolved.length} routes`}`);try{let{deletedCount,version}=await deleteRoutes(client,project.id,resolved.map(r=>r.id),{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Removed")} ${deletedCount} ${deletedCount===1?"route":"routes"} ${import_chalk.default.gray(deleteStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.API_ERROR,message:"Failed to remove routes for this project. See hint for error details.",hint:error.message||"Retry with the same command once transient issues are resolved."},1),output_manager_default.error(error.message||"Failed to remove routes"),1}}export{deleteRoute as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{parseThreadArg}from"./chunk-2S6PE6GB.js";import{deleteMessage,handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts}from"./chunk-23PO6JK6.js";import{outputError}from"./chunk-7PGDJTAH.js";import"./chunk-D3M2JG5C.js";import"./chunk-B3IBBNIR.js";import"./chunk-PSFHYOLD.js";import{canPrompt}from"./chunk-IQ7FPAI4.js";import{deleteSubcommand}from"./chunk-E7CEQ2PO.js";import"./chunk-NYJTWSSD.js";import"./chunk-XSQZ35V6.js";import"./chunk-GORL5DZC.js";import"./chunk-OFZUWHZW.js";import"./chunk-BC74BRVP.js";import"./chunk-4HR3I3ML.js";import"./chunk-K46QQRUN.js";import"./chunk-MTZYPCZ7.js";import"./chunk-GPDERS2D.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-VM6X5BTK.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-JONZUKWX.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-YNCWSPPJ.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-EZVNGJN5.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function deleteCommentMessage(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(deleteSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"delete")}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput,yes=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]);let[threadInput,messageId]=parsedArgs.args.slice(2);if(telemetry.trackCliArgumentThread(threadInput),telemetry.trackCliArgumentMessageId(messageId),!threadInput||!messageId)return outputError(client,jsonOutput,"MISSING_ARGUMENT","Usage: `vercel comments delete <thread> <message-id>` \u2014 message IDs are shown in `vercel comments inspect`.");let threadRef=parseThreadArg(threadInput);if(!threadRef)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}".`);let threadId=threadRef.id,scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug:threadRef.teamSlug});if(typeof scope=="number")return scope;if(!yes){if(!canPrompt(client)||jsonOutput)return outputError(client,jsonOutput,"CONFIRMATION_REQUIRED","Pass --yes to delete the message non-interactively.");if(!await client.input.confirm(`${import_chalk.default.red("Delete")} message ${messageId} from ${threadId} in team ${scope.teamSlug??scope.teamId}? This cannot be undone.`,!1))return output_manager_default.log("Canceled."),0}telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);try{let result=await deleteMessage(client,scope.teamId,threadId,messageId);return jsonOutput?(client.stdout.write(`${JSON.stringify(result,null,2)}
|
|
8
|
+
`),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} Deleted message ${messageId}
|
|
9
|
+
`),0)}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err);return outputError(client,jsonOutput,code,err.status===404?threadNotFoundMessage(threadId,scope):message)}throw err}}export{deleteCommentMessage as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{fetchDeploymentBuildEnv,resolvePerDirectoryLinkRoot}from"./chunk-5MFGTXWC.js";import{require_semver}from"./chunk-BPUANOGW.js";import"./chunk-V6Y6UK6B.js";import{require_async_sema}from"./chunk-NZ2TFADV.js";import"./chunk-REJLEESP.js";import"./chunk-NTYBDY24.js";import"./chunk-IBBLLUXD.js";import"./chunk-PVASGBEF.js";import{getRenamedOption}from"./chunk-WLMW7K7F.js";import"./chunk-Y2FVJ7YO.js";import{describeSubcommand}from"./chunk-7BDQUBSO.js";import"./chunk-NYJTWSSD.js";import{TelemetryClient}from"./chunk-AGLOVMPC.js";import"./chunk-2EYYB6YN.js";import"./chunk-NWGBDBZI.js";import"./chunk-GORL5DZC.js";import"./chunk-OFZUWHZW.js";import{findProjectsFromPath,getLinkFromDir,getProjectLink,getRepoLink,require_ignore,sleep,traceOperation}from"./chunk-BC74BRVP.js";import"./chunk-4HR3I3ML.js";import"./chunk-K46QQRUN.js";import"./chunk-MTZYPCZ7.js";import"./chunk-GPDERS2D.js";import"./chunk-4NTBYNFR.js";import{isArgumentError,parseArguments}from"./chunk-VM6X5BTK.js";import"./chunk-2VBFQZ72.js";import{wantsMachineReadableOutput}from"./chunk-JONZUKWX.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import{fetch}from"./chunk-MY4MONOH.js";import"./chunk-4SAVH3H7.js";import{InvalidToken,isAPIError,parseRetryAfterHeaderAsMillis}from"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-YNCWSPPJ.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import{getFlagsSpecification,quoteArg}from"./chunk-EZVNGJN5.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__export,__toESM}from"./chunk-BZENIQ7N.js";var DescribeError=class extends Error{constructor(reason,message){super(message);this.reason=reason}};var DescribeTelemetryClient=class extends TelemetryClient{trackCliOptionDeployment(value){value&&this.trackCliOption({option:"deployment",value:this.redactedValue})}trackCliOptionId(value){value&&this.trackCliOption({option:"id",value:this.redactedValue})}trackCliOptionAwsAccountId(value){value&&this.trackCliOption({option:"aws-account-id",value:this.redactedValue})}trackCliFlagJson(value){value&&this.trackCliFlag("json")}};var attempts=3;function downloadLayer(client,url){return client.retry((bail,attempt)=>client.withTrace("vc.cli.describe.layer_download",async trace=>{trace?.span.setAttributes({attempt:String(attempt),http_method:"GET"}),attempt>1&&await sleep(Math.random()*1e3);let response;try{let res=await fetch(url,{signal:AbortSignal.timeout(6e4)});if(response=res,trace?.span.setAttributes({http_status_code:String(res.status)}),res.ok)return new Uint8Array(await client.withTrace("vc.cli.describe.layer_body",()=>res.arrayBuffer()))}catch(error2){await response?.body?.cancel().catch(()=>{});let reason=error2 instanceof Error&&error2.name==="TimeoutError"?"timeout":"network_error";throw trace?.span.setAttributes({failure_reason:reason}),downloadError(attempt,reason)}await response.body?.cancel().catch(()=>{}),trace?.span.setAttributes({failure_reason:"http_error"});let error=downloadError(attempt,`HTTP ${response.status}`);if(response.status!==408&&response.status!==429&&response.status<500)return bail(error);let retryAfter=parseRetryAfterHeaderAsMillis(response.headers.get("retry-after"));if(retryAfter!==void 0&&retryAfter>6e4)return bail(error);throw attempt<attempts&&retryAfter&&await sleep(retryAfter),error}),{retries:attempts-1})}function downloadError(attempt,reason){return new DescribeError("layer_download_failed",`Could not download a required runtime layer.
|
|
8
|
+
Cause: ${reason}
|
|
9
|
+
Attempts: ${attempt}
|
|
10
|
+
Retry this describe command.`)}import{createHash as createHash3}from"node:crypto";import{createHash as createHash2}from"node:crypto";function getFunctionConfig(lambda){return{runtime:lambda.runtime,handler:lambda.handler,architecture:lambda.architecture,environment:Object.fromEntries(Object.entries(lambda.environment).filter(entry=>typeof entry[1]=="string")),..."launcherType"in lambda&&lambda.launcherType==="Nodejs"?{launcherType:lambda.launcherType,awsLambdaHandler:lambda.awsLambdaHandler,shouldAddHelpers:lambda.shouldAddHelpers,shouldAddSourcemapSupport:lambda.shouldAddSourcemapSupport,shouldDisableAutomaticFetchInstrumentation:lambda.shouldDisableAutomaticFetchInstrumentation,useWebApi:lambda.useWebApi}:{},memory:lambda.memory,affinity:lambda.affinity,maxConcurrency:lambda.maxConcurrency,maxDuration:lambda.maxDuration,regions:lambda.regions,functionFailoverRegions:lambda.functionFailoverRegions,supportsResponseStreaming:lambda.supportsResponseStreaming,framework:lambda.framework&&{...lambda.framework}}}var import_build_utils=__toESM(require_build_utils(),1),ROOT_BOOTSTRAP_PATH="bootstrap",USER_BOOTSTRAP_PATH="___vc_bootstrap",NATIVELY_WRAPPER_SUPPORTED_FAMILIES=["nodejs","python","ruby","java","dotnetcore","bun","executable"],BOOTSTRAP_SHIM=`#!/bin/sh
|
|
11
|
+
USER_BOOTSTRAP="/var/task/${USER_BOOTSTRAP_PATH}"
|
|
12
|
+
|
|
13
|
+
if [ -n "\${AWS_LAMBDA_EXEC_WRAPPER:-}" ]; then
|
|
14
|
+
__VC_WRAPPER="$AWS_LAMBDA_EXEC_WRAPPER"
|
|
15
|
+
AWS_LAMBDA_EXEC_WRAPPER=""
|
|
16
|
+
export AWS_LAMBDA_EXEC_WRAPPER
|
|
17
|
+
exec "$__VC_WRAPPER" "$USER_BOOTSTRAP" "$@"
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
exec "$USER_BOOTSTRAP" "$@"
|
|
21
|
+
`;function hydrateLambdaFiles(lambda,encryptedEnv){let files=lambda.files??{};if(lambda.runtime==="container"||!encryptedEnv.filename||!encryptedEnv.contentBase64)return files;if(files[encryptedEnv.filename]=new import_build_utils.FileBlob({data:Buffer.from(encryptedEnv.contentBase64,"base64")}),lambda.supportsWrapper!==!0&&!NATIVELY_WRAPPER_SUPPORTED_FAMILIES.some(family=>lambda.runtime.startsWith(family))){if(!lambda.runtime.startsWith("provided"))throw new Error(`Serverless Function runtime ${lambda.runtime} does not support more than 4KB for environment variables`);let userBootstrap=files[ROOT_BOOTSTRAP_PATH];if(!userBootstrap)throw new Error(`Serverless Function runtime ${lambda.runtime} does not support more than 4KB for environment variables`);if(files[USER_BOOTSTRAP_PATH])throw new Error(`Cannot wrap "provided.*" lambda: reserved file path ${USER_BOOTSTRAP_PATH} is already in use. Please rename your file.`);files[USER_BOOTSTRAP_PATH]=userBootstrap,delete files[ROOT_BOOTSTRAP_PATH],files[ROOT_BOOTSTRAP_PATH]=new import_build_utils.FileBlob({data:BOOTSTRAP_SHIM,mode:33261})}return files}import{join as join9}from"node:path";var import_build_utils8=__toESM(require_build_utils(),1);var import_build_utils2=__toESM(require_build_utils(),1);import{join}from"path";import{readFile}from"node:fs/promises";async function maybeReadJSON(path2){let contents;try{contents=await readFile(path2,"utf8")}catch(err){if(err.code!=="ENOENT")throw err;return}try{return JSON.parse(contents.charCodeAt(0)===65279?contents.slice(1):contents)}catch(err){throw err.message=`${path2}: ${err.message}`,err}}async function getBuildOutputConfig(outputDir){let configPath=getBuildOutputConfigPath(outputDir),config=await maybeReadJSON(configPath);if(!config)return;if(config.version!==3)throw new Error(`Expected \`version: 3\` in "${configPath}" file (received \`${config.version}\`)`);validateDeploymentId(config.deploymentId),validateExperimentalServicesV2(config.experimentalServicesV2);let framework=validateFrameworkVersion(config.framework);return{...config,framework}}function getBuildOutputConfigPath(outputDir){return join(outputDir,"config.json")}var MAX_DEPLOYMENT_ID_LENGTH=32,MAX_FRAMEWORK_SLUG_LENGTH=50,MAX_FRAMEWORK_VERSION_LENGTH=50,VALID_DEPLOYMENT_ID_PATTERN=/^[a-zA-Z0-9_-]+$/;function validateDeploymentId(deploymentId){if(deploymentId&&deploymentId.length>MAX_DEPLOYMENT_ID_LENGTH)throw new import_build_utils2.NowBuildError({message:`The configured deploymentId "${deploymentId}" exceeds the maximum length of ${MAX_DEPLOYMENT_ID_LENGTH} characters. Please use a shorter deploymentId.`,code:"VC_BUILD_INVALID_DEPLOYMENT_ID_LENGTH"});if(deploymentId&&!VALID_DEPLOYMENT_ID_PATTERN.test(deploymentId))throw new import_build_utils2.NowBuildError({message:`The configured deploymentId "${deploymentId}" contains invalid characters. Only alphanumeric characters (a-z, A-Z, 0-9), hyphens (-), and underscores (_) are allowed.`,code:"VC_BUILD_INVALID_DEPLOYMENT_ID_CHARACTERS"})}function validateFrameworkVersion(framework){if(!framework)return;let{slug,version}=framework;if(typeof slug=="string"){if(typeof version!="string")throw new import_build_utils2.NowBuildError({message:`Invalid config.json: "version" type "${typeof version}" should be "string"`,code:"VC_BUILD_INVALID_CONFIG_JSON_FRAMEWORK_VERSION_TYPE"});if(slug.length>MAX_FRAMEWORK_SLUG_LENGTH){let trimmedSlug=slug.slice(0,MAX_FRAMEWORK_SLUG_LENGTH);throw new import_build_utils2.NowBuildError({message:`Invalid config.json: "framework.slug" length ${slug.length} > ${MAX_FRAMEWORK_SLUG_LENGTH}. "${trimmedSlug}..."`,code:"VC_BUILD_INVALID_CONFIG_JSON_FRAMEWORK_SLUG_LENGTH"})}if(version.length>MAX_FRAMEWORK_VERSION_LENGTH){let trimmedVersion=version.slice(0,MAX_FRAMEWORK_VERSION_LENGTH);throw new import_build_utils2.NowBuildError({message:`Invalid config.json: "framework.version" length ${version.length} > ${MAX_FRAMEWORK_VERSION_LENGTH}. "${trimmedVersion}..."`,code:"VC_BUILD_INVALID_CONFIG_JSON_FRAMEWORK_VERSION_LENGTH"})}return framework}}function validateExperimentalServicesV2(experimentalServicesV2){if(experimentalServicesV2!==void 0&&(!experimentalServicesV2||typeof experimentalServicesV2!="object"||Array.isArray(experimentalServicesV2)))throw new import_build_utils2.NowBuildError({code:"INVALID_BUILD_OUTPUT_CONFIG",message:'Invalid config.json: "experimentalServicesV2" must be an object.'})}async function getBuildOutputConfigOrThrow(outputDir){let config=await getBuildOutputConfig(outputDir);if(config)return config;throw new Error(`Config file was not found at "${getBuildOutputConfigPath(outputDir)}"`)}import{join as join2}from"path";function getFunctionSourcePath(source){return source.service?join2("services",source.service,source.output.path):source.output.path}var import_build_utils3=__toESM(require_build_utils(),1);function isRouteMiddleware(route){return"middlewarePath"in route&&typeof route.middlewarePath=="string"}var cache=new WeakMap;function getMiddlewareRouting(buildResult){let cached=cache.get(buildResult.functions);if(cached&&cached.routes===buildResult.routes)return cached.routing;let routing=new Map,{lambdas,edgeFunctions}=buildResult.functions;for(let route of buildResult.routes){if(!isRouteMiddleware(route))continue;let outputPath=route.middlewarePath;!lambdas.has(outputPath)&&!edgeFunctions.has(outputPath)&&(outputPath=outputPath.replace(/^\//,""));let output=lambdas.get(outputPath)??edgeFunctions.get(outputPath);if(!outputPath||!output)throw new import_build_utils3.NowBuildError({message:`Mapping ${route.middlewarePath} not found. Maybe you provided a wrong middlewarePath?`,code:"middleware_path_not_found"});let index=routing.get(outputPath)?.index??routing.size;routing.set(outputPath,output.type==="EdgeFunction"?{type:"middleware",middlewarePath:route.middlewarePath,outputPath,edgeFunction:output,index}:{type:"middleware-lambda",middlewarePath:route.middlewarePath,outputPath,index})}return cache.set(buildResult.functions,{routes:buildResult.routes,routing}),routing}import{join as join3}from"path";function getServiceOutputEntries(config){return Object.entries(config.experimentalServicesV2??{}).map(([name,service])=>({name,directory:join3("services",name),service}))}var import_semver=__toESM(require_semver(),1),import_build_utils4=__toESM(require_build_utils(),1);import{createHash}from"crypto";import fs from"fs";var fileSizeCache=new Map,getFileSize=path2=>{if(!path2)return Promise.resolve(0);let cached=fileSizeCache.get(path2);if(cached)return cached;let promise=fs.promises.lstat(path2).then(stats=>stats.size);return fileSizeCache.set(path2,promise),promise},collectUncompressedSize=async(files,ignoreFn)=>{let size=0;return await Promise.all(Object.keys(files).map(async fileKey=>{if(!ignoreFn?.(fileKey)){if(files[fileKey].type==="FileBlob")size+=files[fileKey].data.length;else if(files[fileKey].type==="FileFsRef"){let curSize=files[fileKey].size??await getFileSize(files[fileKey].fsPath);size+=curSize}}})),size};var MIB=1024*1024,MAX_UNCOMPRESSED_FUNCTION_SIZE_BYTES=250*MIB,LAMBDA_RESERVED_UNCOMPRESSED_SIZE_BYTES=25*MIB,LARGE_FUNCTION_THRESHOLD_BYTES=MAX_UNCOMPRESSED_FUNCTION_SIZE_BYTES-LAMBDA_RESERVED_UNCOMPRESSED_SIZE_BYTES,MANIFEST_FILE_NAMES=["routes-manifest.json","server/pages-manifest.json","server/app-paths-manifest.json","app-path-routes-manifest.json"],TEST_DYNAMIC_ROUTE=/\/\[[^\/]+?\](?=\/|$)/;function isNextjsDynamicRoute(route){return route=route.startsWith("/")?route:`/${route}`,TEST_DYNAMIC_ROUTE.test(route)}function computeLambdaFieldsSignature(lambda,lambdaFields){let parts=[];for(let field of lambdaFields)parts.push(JSON.stringify(lambda[field]));return parts.join("|")}async function getLambdaFileSizeMetadata(lambdaFiles){let fileKeys=Object.keys(lambdaFiles),fileSizes=new Map,uncompressedSize=0;for(let fileKey of fileKeys){let file=lambdaFiles[fileKey];if(file===void 0)throw new Error("Expected lambdaFiles[fileKey] to be defined");let fileSize=0;file.type==="FileBlob"?fileSize=file.data.length:file.type==="FileFsRef"&&(fileSize=await collectUncompressedSize({[fileKey]:file},void 0)),fileSizes.set(fileKey,fileSize),uncompressedSize+=fileSize}return{fileKeys,fileSizes,uncompressedSize}}async function groupLambdas(lambdas,options){let{force}=options,lambdaFields=["allowQuery","affinity","architecture","awsLambdaHandler","environment","experimentalResponseStreaming","experimentalTriggers","framework","handler","maxConcurrency","maxDuration","memory","operationType","regions","runtime","runtimeLanguage","shouldAddHelpers","shouldAddSourcemapSupport","shouldDisableAutomaticFetchInstrumentation","supportsCancellation","supportsMultiPayloads","supportsResponseStreaming","supportsWrapper","useWebApi","functionFailoverRegions"],_typeCheck=lambdaFields,fieldsToCompare=force==="all"?["runtime","maxConcurrency"]:lambdaFields,maxUncompressedFunctionSize=LARGE_FUNCTION_THRESHOLD_BYTES,maxBundleSizeMb=options.maxBundleSizeMb;if(maxBundleSizeMb!==void 0&&Number.isFinite(maxBundleSizeMb)){let customMaxUncompressedFunctionSize=Math.floor(maxBundleSizeMb*MIB);output_manager_default.warn(`Warn: custom max uncompressed function size of ${customMaxUncompressedFunctionSize/MIB}MiB configured`),maxUncompressedFunctionSize=Math.min(customMaxUncompressedFunctionSize,MAX_UNCOMPRESSED_FUNCTION_SIZE_BYTES)}let seenLambdas=new Map;for(let[name,lambda]of Object.entries(lambdas)){if(!lambda.experimentalAllowBundling||!lambda.files)continue;let existingNames=seenLambdas.get(lambda);existingNames?existingNames.push(name):seenLambdas.set(lambda,[name])}let handlerDigestPromiseCache=new Map,getHandlerDigest=handlerFile=>{if(!handlerFile)return Promise.resolve(void 0);let cached=handlerDigestPromiseCache.get(handlerFile);if(cached)return cached;let promise=(async()=>{try{let handlerStream=handlerFile.toStream(),handlerBuffer=await(0,import_build_utils4.streamToBuffer)(handlerStream),handlerBytes=new Uint8Array(handlerBuffer.buffer,handlerBuffer.byteOffset,handlerBuffer.byteLength);return createHash("sha1").update(handlerBytes).digest("hex")}catch{return}})();return handlerDigestPromiseCache.set(handlerFile,promise),promise},bundlesBySignature=new Map,allBundledLambdas=[];for(let[lambda,lambdaNames]of seenLambdas){let lambdaFiles=lambda.files;if(!lambdaFiles)continue;let signature=computeLambdaFieldsSignature(lambda,fieldsToCompare),{fileKeys,fileSizes,uncompressedSize}=await getLambdaFileSizeMetadata(lambdaFiles),handlerDigest=await getHandlerDigest(lambdaFiles[lambda.handler]),compatibleBundles=bundlesBySignature.get(signature),isLarge=uncompressedSize>=LARGE_FUNCTION_THRESHOLD_BYTES,foundMatchingBundle=!1;if(compatibleBundles&&!isLarge)for(let bundleMeta of compatibleBundles){if(bundleMeta.isLarge||!(handlerDigest===bundleMeta.handlerDigest)&&force!=="all")continue;let uncompressedBytesIncrease=0;for(let fileKey of fileKeys){let incomingFileSize=fileSizes.get(fileKey)??0,existingFileSize=bundleMeta.fileSizesByKey.get(fileKey);existingFileSize===void 0?uncompressedBytesIncrease+=incomingFileSize:uncompressedBytesIncrease+=incomingFileSize-existingFileSize}let newTotalSize=bundleMeta.uncompressedBytes+uncompressedBytesIncrease;if(newTotalSize<=maxUncompressedFunctionSize){foundMatchingBundle=!0,bundleMeta.uncompressedBytes=newTotalSize,bundleMeta.lambdaNames.push(...lambdaNames);for(let fileKey of fileKeys)bundleMeta.fileSizesByKey.set(fileKey,fileSizes.get(fileKey)??0);let potentialLambdaFiles=bundleMeta.lambda.files;potentialLambdaFiles&&(bundleMeta.lambda.files=Object.assign(potentialLambdaFiles,lambdaFiles));break}}if(!foundMatchingBundle){let newBundleMeta={lambda,signature,handlerDigest,isLarge,uncompressedBytes:uncompressedSize,fileSizesByKey:new Map(fileSizes),lambdaNames:[...lambdaNames]},signatureBundles=bundlesBySignature.get(signature);signatureBundles||(signatureBundles=[],bundlesBySignature.set(signature,signatureBundles)),signatureBundles.push(newBundleMeta),allBundledLambdas.push(newBundleMeta)}}let finalLambdas=Object.assign({},lambdas);options.debug&&(output_manager_default.debug("GROUP_LAMBDAS: "+JSON.stringify(allBundledLambdas.map(bundleMeta=>({lambdaNames:bundleMeta.lambdaNames,signature:bundleMeta.signature,uncompressedBytes:bundleMeta.uncompressedBytes})),null,2)),output_manager_default.debug(`total grouped lambdas: ${allBundledLambdas.length}`));for(let bundleMeta of allBundledLambdas){let lambda=bundleMeta.lambda;for(let lambdaName of bundleMeta.lambdaNames)finalLambdas[lambdaName]=lambda;if(lambda.framework?.slug==="nextjs"&&lambda.framework.version){let CORRECTED_MANIFESTS_VERSION="v12.2.0";if(import_semver.default.gte(lambda.framework.version,CORRECTED_MANIFESTS_VERSION)){let pageFiles=[],manifestFileKeys={},manifestFileNames=MANIFEST_FILE_NAMES;for(let fileKey of Object.keys(lambda.files||{})){let isPageFile=fileKey.includes("server/pages/"),isAppFile=fileKey.includes("server/app/");if(isPageFile||isAppFile){let relativePageFile=fileKey.split(`server/${isPageFile?"pages":"app"}/`).pop();relativePageFile&&pageFiles.push(relativePageFile)}for(let manifestFileName of manifestFileNames)fileKey.endsWith(`/${manifestFileName}`)&&(manifestFileKeys[manifestFileName]=fileKey)}let appPathRoutesManifestFilesKey=manifestFileKeys["app-path-routes-manifest.json"],appPathRoutesManifestFile=appPathRoutesManifestFilesKey&&lambda.files?.[appPathRoutesManifestFilesKey],appPathRoutesManifest=appPathRoutesManifestFile?await(0,import_build_utils4.streamToBuffer)(appPathRoutesManifestFile.toStream()).then(res=>JSON.parse(res.toString("utf8"))).catch(()=>({})):{};for(let manifestFileName of manifestFileNames){let manifestFilesKey=manifestFileKeys[manifestFileName],manifestFile=manifestFilesKey&&lambda.files?.[manifestFilesKey];if(!manifestFile)continue;let manifestData=JSON.parse((await(0,import_build_utils4.streamToBuffer)(manifestFile.toStream())).toString("utf8")),normalizedPages=new Set(pageFiles.map(page=>(page=`/${page.replace(/\.js$/,"")}`,page==="/index"&&(page="/"),appPathRoutesManifest[page]||page)));switch(manifestFileName){case"routes-manifest.json":{let filterItem=item=>normalizedPages.has(item.page);manifestData.dynamicRoutes=manifestData.dynamicRoutes?.filter(filterItem),manifestData.staticRoutes=manifestData.staticRoutes?.filter(filterItem);break}case"server/pages-manifest.json":{for(let key of Object.keys(manifestData))isNextjsDynamicRoute(key)&&!normalizedPages.has(key)&&delete manifestData[key];break}case"server/app-paths-manifest.json":{if(appPathRoutesManifest)for(let key of Object.keys(manifestData)){let normalizedKey=appPathRoutesManifest[key]||key.replace(/(^|\/)(page|route)$/,"");isNextjsDynamicRoute(normalizedKey)&&!normalizedPages.has(normalizedKey)&&delete manifestData[key]}break}}lambda.files&&(lambda.files[manifestFilesKey]=new import_build_utils4.FileBlob({contentType:"application/json",data:JSON.stringify(manifestData)}))}}}}return finalLambdas}async function groupBundleableLambdas(params){let lambdas={};for(let[path2,lambda]of params.functions.lambdas)lambda.experimentalAllowBundling&&(lambdas[path2]=lambda);for(let[path2,prerender]of params.functions.prerenders)prerender.lambda.experimentalAllowBundling&&(lambdas[path2]=prerender.lambda);if(Object.keys(lambdas).length===0)return;let grouped=await groupLambdas(lambdas,{force:void 0,maxBundleSizeMb:params.options.maxBundleSizeMb,debug:params.options.debugGroupLambdas});for(let[path2,lambda]of Object.entries(grouped))if(params.functions.lambdas.has(path2))params.functions.lambdas.set(path2,lambda);else{let prerender=params.functions.prerenders.get(path2);if(prerender)prerender.lambda=lambda;else throw new Error(`Grouped lambda "${path2}" does not match any build output`)}}function*iterateNativeFunctionOutputs(functions){for(let outputs of[functions.lambdas,functions.prerenders])for(let[path2,output]of outputs)yield{path:path2,lambda:output.type==="Lambda"?output:output.lambda,prerender:output.type==="Prerender"?output:void 0}}import{join as join8}from"node:path";import{readFile as readFile3}from"node:fs/promises";var import_build_utils6=__toESM(require_build_utils(),1);import{join as join4,relative}from"path";import{readdir,stat}from"fs/promises";var SUFFIX=".func";async function*createFunctionEntriesIterator(dir,root=dir){let entries;try{entries=await readdir(dir,{withFileTypes:!0})}catch(error){if(!(typeof error=="object"&&error!==null&&"code"in error)||error.code!=="ENOENT"&&error.code!=="ENOTDIR")throw error;entries=[]}let names;for(let entry of entries){let absolutePath=join4(dir,entry.name),isSymbolicLink=entry.isSymbolicLink();if(entry.isDirectory()||isSymbolicLink&&(await stat(absolutePath)).isDirectory())if(entry.name.endsWith(SUFFIX)){names??=new Set(entries.map(e=>e.name));let baseName=entry.name.slice(0,-SUFFIX.length);yield{hasPrerenderConfig:names.has(`${baseName}.prerender-config.json`),isSymbolicLink,path:relative(root,absolutePath.substring(0,absolutePath.length-SUFFIX.length))}}else yield*createFunctionEntriesIterator(absolutePath,root)}}import{dirname,isAbsolute,join as join5,relative as relative2,resolve,sep}from"node:path";var import_build_utils5=__toESM(require_build_utils(),1);import{lstat,readlink,realpath,readdir as readdir2,stat as stat2}from"node:fs/promises";import assert from"assert";import path from"path";async function glob(options){if(!path.isAbsolute(options.cwd))throw new Error(`basePath/cwd must be an absolute path (${options.cwd})`);let results={},statCache={},symlinks={},files=await walkAll(options.cwd,!!options.follow,statCache,symlinks),dirs=new Set,dirsWithEntries=new Set;for(let relativePath of files){let fsPath=path.join(options.cwd,relativePath),stats=statCache[fsPath];assert(stats,`statCache does not contain value for ${relativePath}`);let isSymlink=symlinks[fsPath];if(options.follow&&(isSymlink||(await lstat(fsPath)).isSymbolicLink())){let target=await readlink(fsPath),absoluteTarget=path.resolve(path.dirname(fsPath),target);if(path.relative(options.cwd,absoluteTarget).startsWith(`..${path.sep}`))continue}if(isSymlink||stats.isFile()||stats.isDirectory()){isSymlink&&(stats=await lstat(fsPath));let dirname3=path.dirname(relativePath);if(dirsWithEntries.add(dirname3),stats.isDirectory()){dirs.add(relativePath);continue}results[relativePath]=new import_build_utils5.FileFsRef({mode:stats.mode,fsPath,size:stats.size})}}if(options.includeDirectories)for(let relativePath of dirs){if(dirsWithEntries.has(relativePath))continue;let fsPath=path.join(options.cwd,relativePath),stats=statCache[fsPath];results[relativePath]=new import_build_utils5.FileFsRef({mode:stats.mode,fsPath,size:stats.size})}return results}async function walkAll(cwd,follow,statCache,symlinks){let files=[];async function walk(dirAbs,realDir,ancestors){let entries;try{entries=await readdir2(dirAbs,{withFileTypes:!0})}catch(err){let code=err.code;if(code==="ENOENT"||code==="ENOTDIR")return;throw err}await Promise.all(entries.map(async entry=>{let abs=path.join(dirAbs,entry.name);if(entry.isSymbolicLink())if(follow){let stats=await stat2(abs).catch(()=>lstat(abs).catch(()=>null));if(stats===null)return;if(statCache[abs]=stats,files.push(abs),stats.isDirectory()){let real=await realpath(abs).catch(()=>null);real!==null&&!ancestors.has(real)&&await walk(abs,real,new Set(ancestors).add(real))}}else{let stats=await lstat(abs).catch(()=>null);if(stats===null)return;statCache[abs]=stats,symlinks[abs]=!0,files.push(abs)}else if(entry.isDirectory()){let stats=await lstat(abs).catch(()=>null);if(stats===null)return;statCache[abs]=stats,files.push(abs);let real=path.join(realDir,entry.name);await walk(abs,real,new Set(ancestors).add(real))}else{let stats=await lstat(abs).catch(()=>null);if(stats===null)return;statCache[abs]=stats,files.push(abs)}}))}let cwdReal=follow?await realpath(cwd).catch(()=>null):cwd;return cwdReal!==null&&await walk(cwd,cwdReal,new Set([cwdReal])),files.map(abs=>path.relative(cwd,abs)).sort((a,b)=>a.localeCompare(b,"en"))}import{isNativeError}from"node:util/types";import{readlink as readlink2,realpath as realpath2}from"node:fs/promises";async function readFunctions(params){let fileFsRefsCache=new Map,entries=[],functionsDir=join5(params.outputDir,"functions"),iterator=enumerate(createFunctionEntriesIterator(functionsDir));await Promise.all(Array.from({length:params.concurrency??32},async()=>{for await(let[index,entry]of iterator)entries[index]=await deserializeFunctionEntry({prebuilt:params.prebuilt,entry,fileFsRefsCache,functionsDir,repoRootPath:params.repoRootPath})}));let serverActionsManifestPaths=new Set,edgeFunctions=new Map,unsortedPrerenders=new Map,functionSymlinks=new Map,lambdas=new Map;for(let functionEntry of entries)functionEntry.symlinkTarget!==void 0&&functionSymlinks.set(functionEntry.path,functionEntry.symlinkTarget),functionEntry.serverActionsManifestPath&&serverActionsManifestPaths.add(functionEntry.serverActionsManifestPath),functionEntry.output?.type==="Prerender"?unsortedPrerenders.set(functionEntry.path,functionEntry.output):functionEntry.output?.type==="Lambda"?lambdas.set(functionEntry.path,functionEntry.output):functionEntry.output?.type==="EdgeFunction"&&edgeFunctions.set(functionEntry.path,functionEntry.output);for(let[path2,target]of functionSymlinks){let destFunction=unsortedPrerenders.get(target)?.lambda??edgeFunctions.get(target)??lambdas.get(target);if(!destFunction)throw new Error(`Could not find target "${target}" Lambda or EdgeFunction for path "${path2}"`);let srcPrerender=unsortedPrerenders.get(path2);if(!srcPrerender)destFunction.type==="Lambda"?lambdas.set(path2,destFunction):destFunction.type==="EdgeFunction"&&edgeFunctions.set(path2,destFunction);else{if(destFunction.type!=="Lambda")throw new Error(`Unexpected function type "${destFunction.type}" at path "${path2}"`);srcPrerender.lambda=destFunction}}let prerenders=new Map;for(let[path2,prerender]of[...unsortedPrerenders].sort((a,b)=>(a[1].group??0)-(b[1].group??0)))validatePrerender(prerender),prerenders.set(path2,prerender);return{edgeFunctions,lambdas,prerenders,serverActionsManifestPaths}}async function*enumerate(iterable){let index=0;for await(let item of iterable)yield[index++,item]}async function deserializeFunctionEntry(params){let functionDir=join5(params.functionsDir,`${params.entry.path}.func`),prerenderConfigPath=join5(params.functionsDir,`${params.entry.path}.prerender-config.json`),configPromise=params.entry.hasPrerenderConfig?maybeReadJSON(prerenderConfigPath):void 0;configPromise?.catch(()=>{});let lambda,serverActionsManifestPath,symlinkTarget;if(params.entry.isSymbolicLink)symlinkTarget=await readlink2(functionDir).then(link=>join5(dirname(params.entry.path),link).slice(0,-5));else{let functionConfigPath=join5(functionDir,".vc-config.json"),[functionConfig,files]=await Promise.all([maybeReadJSON(functionConfigPath),glob({cwd:functionDir,includeDirectories:!0})]);if(!functionConfig)throw new Error(`Could not load function config: "${functionConfigPath}"`);if(delete files[".vc-config.json"],functionConfig.filePathMap&&await hydrateFilesMap(files,functionConfig.filePathMap,params.repoRootPath,params.fileFsRefsCache,params.prebuilt),"type"in functionConfig&&functionConfig.type==="EdgeFunction"||functionConfig.runtime==="edge")return{path:params.entry.path,output:new import_build_utils6.EdgeFunction({deploymentTarget:"v8-worker",...functionConfig,files})};let supportsResponseStreaming=functionConfig.supportsResponseStreaming??functionConfig.experimentalResponseStreaming;lambda="launcherType"in functionConfig&&functionConfig.launcherType==="Nodejs"?new import_build_utils6.NodejsLambda({...functionConfig,files,supportsResponseStreaming:functionConfig.awsLambdaHandler===void 0||functionConfig.awsLambdaHandler===""||supportsResponseStreaming}):new import_build_utils6.Lambda({...functionConfig,files,supportsResponseStreaming}),serverActionsManifestPath=functionConfig.filePathMap?.[".next/server/server-reference-manifest.json"]}if(configPromise){let prerenderConfig=await configPromise;if(prerenderConfig)return{path:params.entry.path,symlinkTarget,serverActionsManifestPath,output:new import_build_utils6.Prerender({...prerenderConfig,fallback:await deserializePrerenderFallback(prerenderConfigPath,prerenderConfig.fallback,params),initialMetadata:sanitizeInitialMetadata(prerenderConfig.initialMetadata),lambda})}}return{path:params.entry.path,symlinkTarget,output:lambda,serverActionsManifestPath}}function validatePrerender(prerender){if(prerender.lambda===void 0)throw new Error('Prerender "buildResult" is missing "lambda" property')}async function hydrateFilesMap(files,filesMap,repoRootPath,fileFsRefsCache,prebuilt){let rootPath=prebuilt?await realpath2(repoRootPath):void 0;async function hydrateFile(projectPath){let fsPath=join5(repoRootPath,projectPath);rootPath!==void 0&&await validatePrebuiltFilePath(fsPath,rootPath,`file map source "${projectPath}"`,!0);let file=await import_build_utils6.FileFsRef.fromFsPath({fsPath});return fileFsRefsCache.set(projectPath,file),file}let pending;for(let functionPath in filesMap){let projectPath=filesMap[functionPath],cached=fileFsRefsCache.get(projectPath);if(cached&&!(cached instanceof Promise)){files[functionPath]=cached;continue}let filePromise=cached;if(!filePromise){let promise=hydrateFile(projectPath);fileFsRefsCache.set(projectPath,promise),filePromise=promise}(pending??=[]).push(filePromise.then(file=>{files[functionPath]=file}))}pending&&await Promise.all(pending)}async function validatePrebuiltFilePath(fsPath,rootPath,source,enableDanglingSymlinks=!1){let resolvedPath;try{resolvedPath=await realpath2(fsPath)}catch(error){if(!enableDanglingSymlinks||!isNativeError(error)||!("code"in error)||error.code!=="ENOENT")throw error;let target=await readlink2(fsPath),parentPath=await validatePrebuiltFilePath(dirname(fsPath),rootPath,source);resolvedPath=resolve(parentPath,target)}let sourcePath=relative2(rootPath,resolvedPath);if(sourcePath===".."||sourcePath.startsWith(`..${sep}`)||isAbsolute(sourcePath))throw new import_build_utils6.NowBuildError({code:"INVALID_PREBUILT_FILE_PATH",message:`Prebuilt ${source} must be inside the uploaded project.`});return resolvedPath}function sanitizeInitialMetadata(initialMetadata){try{if(typeof initialMetadata!="object"||initialMetadata===null||Array.isArray(initialMetadata))return;let{compute,htmlSize}=initialMetadata;return compute!=="blocking"&&compute!=="resuming"&&compute!=="static"||htmlSize!==void 0&&(!Number.isSafeInteger(htmlSize)||htmlSize<0)?void 0:{compute,...htmlSize!==void 0&&{htmlSize}}}catch{return}}async function deserializePrerenderFallback(prerenderConfigPath,fallback,options){if(fallback==null)return null;let path2=typeof fallback=="string"?fallback:fallback.fsPath,fsPath=join5(dirname(prerenderConfigPath),path2);return options.prebuilt&&await validatePrebuiltFilePath(fsPath,await realpath2(options.repoRootPath),`prerender fallback "${path2}"`),typeof fallback=="string"?import_build_utils6.FileFsRef.fromFsPath({fsPath}):fallback.mode!==void 0?new import_build_utils6.FileFsRef({mode:fallback.mode,size:fallback.size,contentType:fallback.contentType,fsPath}):import_build_utils6.FileFsRef.fromFsPath({mode:fallback.mode,size:fallback.size,contentType:fallback.contentType,fsPath})}var import_build_utils7=__toESM(require_build_utils(),1);import{join as join6}from"path";async function readServiceOutputConfig(outputDir,entry){let config=await getBuildOutputConfig(join6(outputDir,entry.directory));if(!config&&entry.service.root===void 0)throw new import_build_utils7.NowBuildError({code:"MISSING_SERVICE_BUILD_OUTPUT",message:`Service "${entry.name}" is configured in experimentalServicesV2 but is missing build output at ".vercel/output/services/${entry.name}/config.json".`});return config}var import_async_sema=__toESM(require_async_sema(),1),import_ignore=__toESM(require_ignore(),1);import{basename,isAbsolute as isAbsolute2,join as join7,relative as relative3,sep as sep2}from"node:path";import{readFile as readFile2,readdir as readdir3,realpath as realpath3,stat as stat3}from"node:fs/promises";function contains(root,path2){let rel=relative3(root,path2);return rel!==".."&&!rel.startsWith(`..${sep2}`)&&!isAbsolute2(rel)}function invalidSource(){throw new DescribeError("invalid_build_output","Build output references files outside the authorized output or includes excluded source files. Remove unsafe links and excluded file mappings, then rebuild.")}var vcs=(0,import_ignore.default)().add([".hg",".git",".gitmodules",".svn","CVS"]),dependencies=(0,import_ignore.default)().add(["node_modules",".next",".yarn/cache",".pnp*",".venv","venv","__pycache__","/target"]);async function readIgnore(root){let read=name=>readFile2(join7(root,name),"utf8").catch(error=>{if(error.code==="ENOENT")return"";throw error}),[vercelignore,nowignore]=await Promise.all([read(".vercelignore"),read(".nowignore")]);if(vercelignore&&nowignore)throw new DescribeError("invalid_build_output","Cannot use both .vercelignore and .nowignore. Remove the deprecated .nowignore file and retry.");return(0,import_ignore.default)().add((vercelignore||nowignore).replace(/(\n|^)\.\//g,"$1"))}async function validateBuildOutput(options){let root=await realpath3(options.repoRootPath),output=await realpath3(options.outputDir),expectedOutput=join7(root,relative3(options.repoRootPath,options.outputDir));(!contains(root,output)||relative3(expectedOutput,output)!=="")&&invalidSource();let project=options.directory?await realpath3(options.directory):root,bases=[root];if(project!==root&&contains(root,project))for(let segment of relative3(root,project).split(sep2))bases.push(join7(bases[bases.length-1],segment));let ignores=await Promise.all(bases.map(async base=>({base,rules:await readIgnore(base)}))),sema=new import_async_sema.default(32),limit=async fn=>{await sema.acquire();try{return await fn()}finally{sema.release()}},checkSource=async path2=>{let resolved=await limit(()=>realpath3(path2));for(let source of[join7(root,relative3(options.repoRootPath,path2)),resolved]){contains(root,source)||invalidSource();let rel=relative3(root,source).split(sep2).join("/");if(rel&&(vcs.ignores(rel)&&invalidSource(),!contains(output,source)))for(let{base,rules}of ignores){if(!contains(base,source))continue;let relToBase=relative3(base,source).split(sep2).join("/");relToBase&&rules.ignores(relToBase)&&!dependencies.ignores(relToBase)&&invalidSource()}}return resolved},checked=new Map,validateSource=path2=>{let result=checked.get(path2);return result||(result=checkSource(path2),checked.set(path2,result)),result},configs=[],visited=new Set;async function walk(dir,ancestors){visited.add(dir);let next=new Set(ancestors).add(dir),entries=await Promise.all((await limit(()=>readdir3(dir))).map(async name=>{let path2=join7(dir,name),resolved=await limit(()=>realpath3(path2));return(!contains(output,resolved)||next.has(resolved))&&invalidSource(),{path:path2,resolved,stats:await limit(()=>stat3(resolved))}}));for(let{path:path2,resolved,stats}of entries)stats.isDirectory()?visited.has(resolved)||await walk(resolved,next):basename(path2)===".vc-config.json"&&configs.push(resolved)}return await walk(output,new Set),await Promise.all(configs.map(async path2=>{let config=JSON.parse(await limit(()=>readFile2(path2,"utf8")));await Promise.all(Object.values(config.filePathMap??{}).map(source=>(typeof source!="string"&&invalidSource(),validateSource(join7(options.repoRootPath,source)))))})),validateSource}var external_exports={};__export(external_exports,{BRAND:()=>BRAND,DIRTY:()=>DIRTY,EMPTY_PATH:()=>EMPTY_PATH,INVALID:()=>INVALID,NEVER:()=>NEVER,OK:()=>OK,ParseStatus:()=>ParseStatus,Schema:()=>ZodType,ZodAny:()=>ZodAny,ZodArray:()=>ZodArray,ZodBigInt:()=>ZodBigInt,ZodBoolean:()=>ZodBoolean,ZodBranded:()=>ZodBranded,ZodCatch:()=>ZodCatch,ZodDate:()=>ZodDate,ZodDefault:()=>ZodDefault,ZodDiscriminatedUnion:()=>ZodDiscriminatedUnion,ZodEffects:()=>ZodEffects,ZodEnum:()=>ZodEnum,ZodError:()=>ZodError,ZodFirstPartyTypeKind:()=>ZodFirstPartyTypeKind,ZodFunction:()=>ZodFunction,ZodIntersection:()=>ZodIntersection,ZodIssueCode:()=>ZodIssueCode,ZodLazy:()=>ZodLazy,ZodLiteral:()=>ZodLiteral,ZodMap:()=>ZodMap,ZodNaN:()=>ZodNaN,ZodNativeEnum:()=>ZodNativeEnum,ZodNever:()=>ZodNever,ZodNull:()=>ZodNull,ZodNullable:()=>ZodNullable,ZodNumber:()=>ZodNumber,ZodObject:()=>ZodObject,ZodOptional:()=>ZodOptional,ZodParsedType:()=>ZodParsedType,ZodPipeline:()=>ZodPipeline,ZodPromise:()=>ZodPromise,ZodReadonly:()=>ZodReadonly,ZodRecord:()=>ZodRecord,ZodSchema:()=>ZodType,ZodSet:()=>ZodSet,ZodString:()=>ZodString,ZodSymbol:()=>ZodSymbol,ZodTransformer:()=>ZodEffects,ZodTuple:()=>ZodTuple,ZodType:()=>ZodType,ZodUndefined:()=>ZodUndefined,ZodUnion:()=>ZodUnion,ZodUnknown:()=>ZodUnknown,ZodVoid:()=>ZodVoid,addIssueToContext:()=>addIssueToContext,any:()=>anyType,array:()=>arrayType,bigint:()=>bigIntType,boolean:()=>booleanType,coerce:()=>coerce,custom:()=>custom,date:()=>dateType,datetimeRegex:()=>datetimeRegex,defaultErrorMap:()=>en_default,discriminatedUnion:()=>discriminatedUnionType,effect:()=>effectsType,enum:()=>enumType,function:()=>functionType,getErrorMap:()=>getErrorMap,getParsedType:()=>getParsedType,instanceof:()=>instanceOfType,intersection:()=>intersectionType,isAborted:()=>isAborted,isAsync:()=>isAsync,isDirty:()=>isDirty,isValid:()=>isValid,late:()=>late,lazy:()=>lazyType,literal:()=>literalType,makeIssue:()=>makeIssue,map:()=>mapType,nan:()=>nanType,nativeEnum:()=>nativeEnumType,never:()=>neverType,null:()=>nullType,nullable:()=>nullableType,number:()=>numberType,object:()=>objectType,objectUtil:()=>objectUtil,oboolean:()=>oboolean,onumber:()=>onumber,optional:()=>optionalType,ostring:()=>ostring,pipeline:()=>pipelineType,preprocess:()=>preprocessType,promise:()=>promiseType,quotelessJson:()=>quotelessJson,record:()=>recordType,set:()=>setType,setErrorMap:()=>setErrorMap,strictObject:()=>strictObjectType,string:()=>stringType,symbol:()=>symbolType,transformer:()=>effectsType,tuple:()=>tupleType,undefined:()=>undefinedType,union:()=>unionType,unknown:()=>unknownType,util:()=>util,void:()=>voidType});var util;(function(util2){util2.assertEqual=_=>{};function assertIs(_arg){}util2.assertIs=assertIs;function assertNever(_x){throw new Error}util2.assertNever=assertNever,util2.arrayToEnum=items=>{let obj={};for(let item of items)obj[item]=item;return obj},util2.getValidEnumValues=obj=>{let validKeys=util2.objectKeys(obj).filter(k=>typeof obj[obj[k]]!="number"),filtered={};for(let k of validKeys)filtered[k]=obj[k];return util2.objectValues(filtered)},util2.objectValues=obj=>util2.objectKeys(obj).map(function(e){return obj[e]}),util2.objectKeys=typeof Object.keys=="function"?obj=>Object.keys(obj):object=>{let keys=[];for(let key in object)Object.prototype.hasOwnProperty.call(object,key)&&keys.push(key);return keys},util2.find=(arr,checker)=>{for(let item of arr)if(checker(item))return item},util2.isInteger=typeof Number.isInteger=="function"?val=>Number.isInteger(val):val=>typeof val=="number"&&Number.isFinite(val)&&Math.floor(val)===val;function joinValues(array,separator=" | "){return array.map(val=>typeof val=="string"?`'${val}'`:val).join(separator)}util2.joinValues=joinValues,util2.jsonStringifyReplacer=(_,value)=>typeof value=="bigint"?value.toString():value})(util||(util={}));var objectUtil;(function(objectUtil2){objectUtil2.mergeShapes=(first,second)=>({...first,...second})})(objectUtil||(objectUtil={}));var ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=data=>{switch(typeof data){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return Number.isNaN(data)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(data)?ZodParsedType.array:data===null?ZodParsedType.null:data.then&&typeof data.then=="function"&&data.catch&&typeof data.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&data instanceof Map?ZodParsedType.map:typeof Set<"u"&&data instanceof Set?ZodParsedType.set:typeof Date<"u"&&data instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}};var ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=obj=>JSON.stringify(obj,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError=class _ZodError extends Error{get errors(){return this.issues}constructor(issues){super(),this.issues=[],this.addIssue=sub=>{this.issues=[...this.issues,sub]},this.addIssues=(subs=[])=>{this.issues=[...this.issues,...subs]};let actualProto=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,actualProto):this.__proto__=actualProto,this.name="ZodError",this.issues=issues}format(_mapper){let mapper=_mapper||function(issue){return issue.message},fieldErrors={_errors:[]},processError=error=>{for(let issue of error.issues)if(issue.code==="invalid_union")issue.unionErrors.map(processError);else if(issue.code==="invalid_return_type")processError(issue.returnTypeError);else if(issue.code==="invalid_arguments")processError(issue.argumentsError);else if(issue.path.length===0)fieldErrors._errors.push(mapper(issue));else{let curr=fieldErrors,i=0;for(;i<issue.path.length;){let el=issue.path[i],terminal=i===issue.path.length-1;if(el==="_errors"){terminal&&curr._errors.push(mapper(issue)),i++;continue}Object.prototype.hasOwnProperty.call(curr,el)||(el==="__proto__"?Object.defineProperty(curr,el,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):curr[el]={_errors:[]}),curr=curr[el],terminal&&curr._errors.push(mapper(issue)),i++}}};return processError(this),fieldErrors}static assert(value){if(!(value instanceof _ZodError))throw new Error(`Not a ZodError: ${value}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(mapper=issue=>issue.message){let fieldErrors=Object.create(null),formErrors=[];for(let sub of this.issues)if(sub.path.length>0){let firstEl=sub.path[0];fieldErrors[firstEl]=fieldErrors[firstEl]||[],fieldErrors[firstEl].push(mapper(sub))}else formErrors.push(mapper(sub));return{formErrors,fieldErrors}}get formErrors(){return this.flatten()}};ZodError.create=issues=>new ZodError(issues);var errorMap=(issue,_ctx)=>{let message;switch(issue.code){case ZodIssueCode.invalid_type:issue.received===ZodParsedType.undefined?message="Required":message=`Expected ${issue.expected}, received ${issue.received}`;break;case ZodIssueCode.invalid_literal:message=`Invalid literal value, expected ${JSON.stringify(issue.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:message=`Unrecognized key(s) in object: ${util.joinValues(issue.keys,", ")}`;break;case ZodIssueCode.invalid_union:message="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:message=`Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;break;case ZodIssueCode.invalid_enum_value:message=`Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;break;case ZodIssueCode.invalid_arguments:message="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:message="Invalid function return type";break;case ZodIssueCode.invalid_date:message="Invalid date";break;case ZodIssueCode.invalid_string:typeof issue.validation=="object"?"includes"in issue.validation?(message=`Invalid input: must include "${issue.validation.includes}"`,typeof issue.validation.position=="number"&&(message=`${message} at one or more positions greater than or equal to ${issue.validation.position}`)):"startsWith"in issue.validation?message=`Invalid input: must start with "${issue.validation.startsWith}"`:"endsWith"in issue.validation?message=`Invalid input: must end with "${issue.validation.endsWith}"`:util.assertNever(issue.validation):issue.validation!=="regex"?message=`Invalid ${issue.validation}`:message="Invalid";break;case ZodIssueCode.too_small:issue.type==="array"?message=`Array must contain ${issue.exact?"exactly":issue.inclusive?"at least":"more than"} ${issue.minimum} element(s)`:issue.type==="string"?message=`String must contain ${issue.exact?"exactly":issue.inclusive?"at least":"over"} ${issue.minimum} character(s)`:issue.type==="number"?message=`Number must be ${issue.exact?"exactly equal to ":issue.inclusive?"greater than or equal to ":"greater than "}${issue.minimum}`:issue.type==="bigint"?message=`Number must be ${issue.exact?"exactly equal to ":issue.inclusive?"greater than or equal to ":"greater than "}${issue.minimum}`:issue.type==="date"?message=`Date must be ${issue.exact?"exactly equal to ":issue.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(issue.minimum))}`:message="Invalid input";break;case ZodIssueCode.too_big:issue.type==="array"?message=`Array must contain ${issue.exact?"exactly":issue.inclusive?"at most":"less than"} ${issue.maximum} element(s)`:issue.type==="string"?message=`String must contain ${issue.exact?"exactly":issue.inclusive?"at most":"under"} ${issue.maximum} character(s)`:issue.type==="number"?message=`Number must be ${issue.exact?"exactly":issue.inclusive?"less than or equal to":"less than"} ${issue.maximum}`:issue.type==="bigint"?message=`BigInt must be ${issue.exact?"exactly":issue.inclusive?"less than or equal to":"less than"} ${issue.maximum}`:issue.type==="date"?message=`Date must be ${issue.exact?"exactly":issue.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(issue.maximum))}`:message="Invalid input";break;case ZodIssueCode.custom:message="Invalid input";break;case ZodIssueCode.invalid_intersection_types:message="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:message=`Number must be a multiple of ${issue.multipleOf}`;break;case ZodIssueCode.not_finite:message="Number must be finite";break;default:message=_ctx.defaultError,util.assertNever(issue)}return{message}},en_default=errorMap;var overrideErrorMap=en_default;function setErrorMap(map){overrideErrorMap=map}function getErrorMap(){return overrideErrorMap}var makeIssue=params=>{let{data,path:path2,errorMaps,issueData}=params,fullPath=[...path2,...issueData.path||[]],fullIssue={...issueData,path:fullPath};if(issueData.message!==void 0)return{...issueData,path:fullPath,message:issueData.message};let errorMessage="",maps=errorMaps.filter(m=>!!m).slice().reverse();for(let map of maps)errorMessage=map(fullIssue,{data,defaultError:errorMessage}).message;return{...issueData,path:fullPath,message:errorMessage}},EMPTY_PATH=[];function addIssueToContext(ctx,issueData){let overrideMap=getErrorMap(),issue=makeIssue({issueData,data:ctx.data,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,overrideMap,overrideMap===en_default?void 0:en_default].filter(x=>!!x)});ctx.common.issues.push(issue)}var ParseStatus=class _ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(status,results){let arrayValue=[];for(let s of results){if(s.status==="aborted")return INVALID;s.status==="dirty"&&status.dirty(),arrayValue.push(s.value)}return{status:status.value,value:arrayValue}}static async mergeObjectAsync(status,pairs){let syncPairs=[];for(let pair of pairs){let key=await pair.key,value=await pair.value;syncPairs.push({key,value})}return _ParseStatus.mergeObjectSync(status,syncPairs)}static mergeObjectSync(status,pairs){let finalObject={};for(let pair of pairs){let{key,value}=pair;if(key.status==="aborted"||value.status==="aborted")return INVALID;key.status==="dirty"&&status.dirty(),value.status==="dirty"&&status.dirty(),key.value!=="__proto__"&&(typeof value.value<"u"||pair.alwaysSet)&&(finalObject[key.value]=value.value)}return{status:status.value,value:finalObject}}},INVALID=Object.freeze({status:"aborted"}),DIRTY=value=>({status:"dirty",value}),OK=value=>({status:"valid",value}),isAborted=x=>x.status==="aborted",isDirty=x=>x.status==="dirty",isValid=x=>x.status==="valid",isAsync=x=>typeof Promise<"u"&&x instanceof Promise;var errorUtil;(function(errorUtil2){errorUtil2.errToObj=message=>typeof message=="string"?{message}:message||{},errorUtil2.toString=message=>typeof message=="string"?message:message?.message})(errorUtil||(errorUtil={}));var ParseInputLazyPath=class{constructor(parent,value,path2,key){this._cachedPath=[],this.parent=parent,this.data=value,this._path=path2,this._key=key}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},handleResult=(ctx,result)=>{if(isValid(result))return{success:!0,data:result.value};if(!ctx.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let error=new ZodError(ctx.common.issues);return this._error=error,this._error}}};function processCreateParams(params){if(!params)return{};let{errorMap:errorMap2,invalid_type_error,required_error,description}=params;if(errorMap2&&(invalid_type_error||required_error))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return errorMap2?{errorMap:errorMap2,description}:{errorMap:(iss,ctx)=>{let{message}=params;return iss.code==="invalid_enum_value"?{message:message??ctx.defaultError}:typeof ctx.data>"u"?{message:message??required_error??ctx.defaultError}:iss.code!=="invalid_type"?{message:ctx.defaultError}:{message:message??invalid_type_error??ctx.defaultError}},description}}var ZodType=class{get description(){return this._def.description}_getType(input){return getParsedType(input.data)}_getOrReturnCtx(input,ctx){return ctx||{common:input.parent.common,data:input.data,parsedType:getParsedType(input.data),schemaErrorMap:this._def.errorMap,path:input.path,parent:input.parent}}_processInputParams(input){return{status:new ParseStatus,ctx:{common:input.parent.common,data:input.data,parsedType:getParsedType(input.data),schemaErrorMap:this._def.errorMap,path:input.path,parent:input.parent}}}_parseSync(input){let result=this._parse(input);if(isAsync(result))throw new Error("Synchronous parse encountered promise.");return result}_parseAsync(input){let result=this._parse(input);return Promise.resolve(result)}parse(data,params){let result=this.safeParse(data,params);if(result.success)return result.data;throw result.error}safeParse(data,params){let ctx={common:{issues:[],async:params?.async??!1,contextualErrorMap:params?.errorMap},path:params?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data,parsedType:getParsedType(data)},result=this._parseSync({data,path:ctx.path,parent:ctx});return handleResult(ctx,result)}"~validate"(data){let ctx={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data,parsedType:getParsedType(data)};if(!this["~standard"].async)try{let result=this._parseSync({data,path:[],parent:ctx});return isValid(result)?{value:result.value}:{issues:ctx.common.issues}}catch(err){err?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),ctx.common={issues:[],async:!0}}return this._parseAsync({data,path:[],parent:ctx}).then(result=>isValid(result)?{value:result.value}:{issues:ctx.common.issues})}async parseAsync(data,params){let result=await this.safeParseAsync(data,params);if(result.success)return result.data;throw result.error}async safeParseAsync(data,params){let ctx={common:{issues:[],contextualErrorMap:params?.errorMap,async:!0},path:params?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data,parsedType:getParsedType(data)},maybeAsyncResult=this._parse({data,path:ctx.path,parent:ctx}),result=await(isAsync(maybeAsyncResult)?maybeAsyncResult:Promise.resolve(maybeAsyncResult));return handleResult(ctx,result)}refine(check,message){let getIssueProperties=val=>typeof message=="string"||typeof message>"u"?{message}:typeof message=="function"?message(val):message;return this._refinement((val,ctx)=>{let result=check(val),setError=()=>ctx.addIssue({code:ZodIssueCode.custom,...getIssueProperties(val)});return typeof Promise<"u"&&result instanceof Promise?result.then(data=>data?!0:(setError(),!1)):result?!0:(setError(),!1)})}refinement(check,refinementData){return this._refinement((val,ctx)=>check(val)?!0:(ctx.addIssue(typeof refinementData=="function"?refinementData(val,ctx):refinementData),!1))}_refinement(refinement){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement}})}superRefine(refinement){return this._refinement(refinement)}constructor(def){this.spa=this.safeParseAsync,this._def=def,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:data=>this["~validate"](data)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(option){return ZodUnion.create([this,option],this._def)}and(incoming){return ZodIntersection.create(this,incoming,this._def)}transform(transform){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform}})}default(def){let defaultValueFunc=typeof def=="function"?def:()=>def;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:defaultValueFunc,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(def){let catchValueFunc=typeof def=="function"?def:()=>def;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:catchValueFunc,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(description){let This=this.constructor;return new This({...this._def,description})}pipe(target){return ZodPipeline.create(this,target)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",emojiRegex,ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(args){let secondsRegexSource="[0-5]\\d";args.precision?secondsRegexSource=`${secondsRegexSource}\\.\\d{${args.precision}}`:args.precision==null&&(secondsRegexSource=`${secondsRegexSource}(\\.\\d+)?`);let secondsQuantifier=args.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`}function timeRegex(args){return new RegExp(`^${timeRegexSource(args)}$`)}function datetimeRegex(args){let regex=`${dateRegexSource}T${timeRegexSource(args)}`,opts=[];return opts.push(args.local?"Z?":"Z"),args.offset&&opts.push("([+-]\\d{2}:?\\d{2})"),regex=`${regex}(${opts.join("|")})`,new RegExp(`^${regex}$`)}function isValidIP(ip,version){return!!((version==="v4"||!version)&&ipv4Regex.test(ip)||(version==="v6"||!version)&&ipv6Regex.test(ip))}function isValidJWT(jwt,alg){if(!jwtRegex.test(jwt))return!1;try{let[header]=jwt.split(".");if(!header)return!1;let base64=header.replace(/-/g,"+").replace(/_/g,"/").padEnd(header.length+(4-header.length%4)%4,"="),decoded=JSON.parse(atob(base64));return!(typeof decoded!="object"||decoded===null||"typ"in decoded&&decoded?.typ!=="JWT"||!decoded.alg||alg&&decoded.alg!==alg)}catch{return!1}}function isValidCidr(ip,version){return!!((version==="v4"||!version)&&ipv4CidrRegex.test(ip)||(version==="v6"||!version)&&ipv6CidrRegex.test(ip))}var ZodString=class _ZodString extends ZodType{_parse(input){if(this._def.coerce&&(input.data=String(input.data)),this._getType(input)!==ZodParsedType.string){let ctx2=this._getOrReturnCtx(input);return addIssueToContext(ctx2,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:ctx2.parsedType}),INVALID}let status=new ParseStatus,ctx;for(let check of this._def.checks)if(check.kind==="min")input.data.length<check.value&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_small,minimum:check.value,type:"string",inclusive:!0,exact:!1,message:check.message}),status.dirty());else if(check.kind==="max")input.data.length>check.value&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:check.value,type:"string",inclusive:!0,exact:!1,message:check.message}),status.dirty());else if(check.kind==="length"){let tooBig=input.data.length>check.value,tooSmall=input.data.length<check.value;(tooBig||tooSmall)&&(ctx=this._getOrReturnCtx(input,ctx),tooBig?addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:check.value,type:"string",inclusive:!0,exact:!0,message:check.message}):tooSmall&&addIssueToContext(ctx,{code:ZodIssueCode.too_small,minimum:check.value,type:"string",inclusive:!0,exact:!0,message:check.message}),status.dirty())}else if(check.kind==="email")emailRegex.test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"email",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty());else if(check.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"emoji",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty());else if(check.kind==="uuid")uuidRegex.test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"uuid",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty());else if(check.kind==="nanoid")nanoidRegex.test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty());else if(check.kind==="cuid")cuidRegex.test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"cuid",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty());else if(check.kind==="cuid2")cuid2Regex.test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty());else if(check.kind==="ulid")ulidRegex.test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"ulid",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty());else if(check.kind==="url")try{new URL(input.data)}catch{ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"url",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty()}else check.kind==="regex"?(check.regex.lastIndex=0,check.regex.test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"regex",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty())):check.kind==="trim"?input.data=input.data.trim():check.kind==="includes"?input.data.includes(check.value,check.position)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.invalid_string,validation:{includes:check.value,position:check.position},message:check.message}),status.dirty()):check.kind==="toLowerCase"?input.data=input.data.toLowerCase():check.kind==="toUpperCase"?input.data=input.data.toUpperCase():check.kind==="startsWith"?input.data.startsWith(check.value)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.invalid_string,validation:{startsWith:check.value},message:check.message}),status.dirty()):check.kind==="endsWith"?input.data.endsWith(check.value)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.invalid_string,validation:{endsWith:check.value},message:check.message}),status.dirty()):check.kind==="datetime"?datetimeRegex(check).test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.invalid_string,validation:"datetime",message:check.message}),status.dirty()):check.kind==="date"?dateRegex.test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.invalid_string,validation:"date",message:check.message}),status.dirty()):check.kind==="time"?timeRegex(check).test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.invalid_string,validation:"time",message:check.message}),status.dirty()):check.kind==="duration"?durationRegex.test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"duration",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty()):check.kind==="ip"?isValidIP(input.data,check.version)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"ip",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty()):check.kind==="jwt"?isValidJWT(input.data,check.alg)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"jwt",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty()):check.kind==="cidr"?isValidCidr(input.data,check.version)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"cidr",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty()):check.kind==="base64"?base64Regex.test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"base64",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty()):check.kind==="base64url"?base64urlRegex.test(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{validation:"base64url",code:ZodIssueCode.invalid_string,message:check.message}),status.dirty()):util.assertNever(check);return{status:status.value,value:input.data}}_regex(regex,validation,message){return this.refinement(data=>regex.test(data),{validation,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(message)})}_addCheck(check){return new _ZodString({...this._def,checks:[...this._def.checks,check]})}email(message){return this._addCheck({kind:"email",...errorUtil.errToObj(message)})}url(message){return this._addCheck({kind:"url",...errorUtil.errToObj(message)})}emoji(message){return this._addCheck({kind:"emoji",...errorUtil.errToObj(message)})}uuid(message){return this._addCheck({kind:"uuid",...errorUtil.errToObj(message)})}nanoid(message){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(message)})}cuid(message){return this._addCheck({kind:"cuid",...errorUtil.errToObj(message)})}cuid2(message){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(message)})}ulid(message){return this._addCheck({kind:"ulid",...errorUtil.errToObj(message)})}base64(message){return this._addCheck({kind:"base64",...errorUtil.errToObj(message)})}base64url(message){return this._addCheck({kind:"base64url",...errorUtil.errToObj(message)})}jwt(options){return this._addCheck({kind:"jwt",...errorUtil.errToObj(options)})}ip(options){return this._addCheck({kind:"ip",...errorUtil.errToObj(options)})}cidr(options){return this._addCheck({kind:"cidr",...errorUtil.errToObj(options)})}datetime(options){return typeof options=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:options}):this._addCheck({kind:"datetime",precision:typeof options?.precision>"u"?null:options?.precision,offset:options?.offset??!1,local:options?.local??!1,...errorUtil.errToObj(options?.message)})}date(message){return this._addCheck({kind:"date",message})}time(options){return typeof options=="string"?this._addCheck({kind:"time",precision:null,message:options}):this._addCheck({kind:"time",precision:typeof options?.precision>"u"?null:options?.precision,...errorUtil.errToObj(options?.message)})}duration(message){return this._addCheck({kind:"duration",...errorUtil.errToObj(message)})}regex(regex,message){return this._addCheck({kind:"regex",regex,...errorUtil.errToObj(message)})}includes(value,options){return this._addCheck({kind:"includes",value,position:options?.position,...errorUtil.errToObj(options?.message)})}startsWith(value,message){return this._addCheck({kind:"startsWith",value,...errorUtil.errToObj(message)})}endsWith(value,message){return this._addCheck({kind:"endsWith",value,...errorUtil.errToObj(message)})}min(minLength,message){return this._addCheck({kind:"min",value:minLength,...errorUtil.errToObj(message)})}max(maxLength,message){return this._addCheck({kind:"max",value:maxLength,...errorUtil.errToObj(message)})}length(len,message){return this._addCheck({kind:"length",value:len,...errorUtil.errToObj(message)})}nonempty(message){return this.min(1,errorUtil.errToObj(message))}trim(){return new _ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new _ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new _ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(ch=>ch.kind==="datetime")}get isDate(){return!!this._def.checks.find(ch=>ch.kind==="date")}get isTime(){return!!this._def.checks.find(ch=>ch.kind==="time")}get isDuration(){return!!this._def.checks.find(ch=>ch.kind==="duration")}get isEmail(){return!!this._def.checks.find(ch=>ch.kind==="email")}get isURL(){return!!this._def.checks.find(ch=>ch.kind==="url")}get isEmoji(){return!!this._def.checks.find(ch=>ch.kind==="emoji")}get isUUID(){return!!this._def.checks.find(ch=>ch.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(ch=>ch.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(ch=>ch.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(ch=>ch.kind==="cuid2")}get isULID(){return!!this._def.checks.find(ch=>ch.kind==="ulid")}get isIP(){return!!this._def.checks.find(ch=>ch.kind==="ip")}get isCIDR(){return!!this._def.checks.find(ch=>ch.kind==="cidr")}get isBase64(){return!!this._def.checks.find(ch=>ch.kind==="base64")}get isBase64url(){return!!this._def.checks.find(ch=>ch.kind==="base64url")}get minLength(){let min=null;for(let ch of this._def.checks)ch.kind==="min"&&(min===null||ch.value>min)&&(min=ch.value);return min}get maxLength(){let max=null;for(let ch of this._def.checks)ch.kind==="max"&&(max===null||ch.value<max)&&(max=ch.value);return max}};ZodString.create=params=>new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:params?.coerce??!1,...processCreateParams(params)});function floatSafeRemainder(val,step){let valDecCount=(val.toString().split(".")[1]||"").length,stepDecCount=(step.toString().split(".")[1]||"").length,decCount=valDecCount>stepDecCount?valDecCount:stepDecCount,valInt=Number.parseInt(val.toFixed(decCount).replace(".","")),stepInt=Number.parseInt(step.toFixed(decCount).replace(".",""));return valInt%stepInt/10**decCount}var ZodNumber=class _ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(input){if(this._def.coerce&&(input.data=Number(input.data)),this._getType(input)!==ZodParsedType.number){let ctx2=this._getOrReturnCtx(input);return addIssueToContext(ctx2,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:ctx2.parsedType}),INVALID}let ctx,status=new ParseStatus;for(let check of this._def.checks)check.kind==="int"?util.isInteger(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:check.message}),status.dirty()):check.kind==="min"?(check.inclusive?input.data<check.value:input.data<=check.value)&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_small,minimum:check.value,type:"number",inclusive:check.inclusive,exact:!1,message:check.message}),status.dirty()):check.kind==="max"?(check.inclusive?input.data>check.value:input.data>=check.value)&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:check.value,type:"number",inclusive:check.inclusive,exact:!1,message:check.message}),status.dirty()):check.kind==="multipleOf"?floatSafeRemainder(input.data,check.value)!==0&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_multiple_of,multipleOf:check.value,message:check.message}),status.dirty()):check.kind==="finite"?Number.isFinite(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_finite,message:check.message}),status.dirty()):util.assertNever(check);return{status:status.value,value:input.data}}gte(value,message){return this.setLimit("min",value,!0,errorUtil.toString(message))}gt(value,message){return this.setLimit("min",value,!1,errorUtil.toString(message))}lte(value,message){return this.setLimit("max",value,!0,errorUtil.toString(message))}lt(value,message){return this.setLimit("max",value,!1,errorUtil.toString(message))}setLimit(kind,value,inclusive,message){return new _ZodNumber({...this._def,checks:[...this._def.checks,{kind,value,inclusive,message:errorUtil.toString(message)}]})}_addCheck(check){return new _ZodNumber({...this._def,checks:[...this._def.checks,check]})}int(message){return this._addCheck({kind:"int",message:errorUtil.toString(message)})}positive(message){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(message)})}negative(message){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(message)})}nonpositive(message){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(message)})}nonnegative(message){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(message)})}multipleOf(value,message){return this._addCheck({kind:"multipleOf",value,message:errorUtil.toString(message)})}finite(message){return this._addCheck({kind:"finite",message:errorUtil.toString(message)})}safe(message){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(message)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(message)})}get minValue(){let min=null;for(let ch of this._def.checks)ch.kind==="min"&&(min===null||ch.value>min)&&(min=ch.value);return min}get maxValue(){let max=null;for(let ch of this._def.checks)ch.kind==="max"&&(max===null||ch.value<max)&&(max=ch.value);return max}get isInt(){return!!this._def.checks.find(ch=>ch.kind==="int"||ch.kind==="multipleOf"&&util.isInteger(ch.value))}get isFinite(){let max=null,min=null;for(let ch of this._def.checks){if(ch.kind==="finite"||ch.kind==="int"||ch.kind==="multipleOf")return!0;ch.kind==="min"?(min===null||ch.value>min)&&(min=ch.value):ch.kind==="max"&&(max===null||ch.value<max)&&(max=ch.value)}return Number.isFinite(min)&&Number.isFinite(max)}};ZodNumber.create=params=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:params?.coerce||!1,...processCreateParams(params)});var ZodBigInt=class _ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(input){if(this._def.coerce)try{input.data=BigInt(input.data)}catch{return this._getInvalidInput(input)}if(this._getType(input)!==ZodParsedType.bigint)return this._getInvalidInput(input);let ctx,status=new ParseStatus;for(let check of this._def.checks)check.kind==="min"?(check.inclusive?input.data<check.value:input.data<=check.value)&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_small,type:"bigint",minimum:check.value,inclusive:check.inclusive,message:check.message}),status.dirty()):check.kind==="max"?(check.inclusive?input.data>check.value:input.data>=check.value)&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,type:"bigint",maximum:check.value,inclusive:check.inclusive,message:check.message}),status.dirty()):check.kind==="multipleOf"?input.data%check.value!==BigInt(0)&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_multiple_of,multipleOf:check.value,message:check.message}),status.dirty()):util.assertNever(check);return{status:status.value,value:input.data}}_getInvalidInput(input){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:ctx.parsedType}),INVALID}gte(value,message){return this.setLimit("min",value,!0,errorUtil.toString(message))}gt(value,message){return this.setLimit("min",value,!1,errorUtil.toString(message))}lte(value,message){return this.setLimit("max",value,!0,errorUtil.toString(message))}lt(value,message){return this.setLimit("max",value,!1,errorUtil.toString(message))}setLimit(kind,value,inclusive,message){return new _ZodBigInt({...this._def,checks:[...this._def.checks,{kind,value,inclusive,message:errorUtil.toString(message)}]})}_addCheck(check){return new _ZodBigInt({...this._def,checks:[...this._def.checks,check]})}positive(message){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(message)})}negative(message){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(message)})}nonpositive(message){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(message)})}nonnegative(message){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(message)})}multipleOf(value,message){return this._addCheck({kind:"multipleOf",value,message:errorUtil.toString(message)})}get minValue(){let min=null;for(let ch of this._def.checks)ch.kind==="min"&&(min===null||ch.value>min)&&(min=ch.value);return min}get maxValue(){let max=null;for(let ch of this._def.checks)ch.kind==="max"&&(max===null||ch.value<max)&&(max=ch.value);return max}};ZodBigInt.create=params=>new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:params?.coerce??!1,...processCreateParams(params)});var ZodBoolean=class extends ZodType{_parse(input){if(this._def.coerce&&(input.data=!!input.data),this._getType(input)!==ZodParsedType.boolean){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodBoolean.create=params=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:params?.coerce||!1,...processCreateParams(params)});var ZodDate=class _ZodDate extends ZodType{_parse(input){if(this._def.coerce&&(input.data=new Date(input.data)),this._getType(input)!==ZodParsedType.date){let ctx2=this._getOrReturnCtx(input);return addIssueToContext(ctx2,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:ctx2.parsedType}),INVALID}if(Number.isNaN(input.data.getTime())){let ctx2=this._getOrReturnCtx(input);return addIssueToContext(ctx2,{code:ZodIssueCode.invalid_date}),INVALID}let status=new ParseStatus,ctx;for(let check of this._def.checks)check.kind==="min"?input.data.getTime()<check.value&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_small,message:check.message,inclusive:!0,exact:!1,minimum:check.value,type:"date"}),status.dirty()):check.kind==="max"?input.data.getTime()>check.value&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,message:check.message,inclusive:!0,exact:!1,maximum:check.value,type:"date"}),status.dirty()):util.assertNever(check);return{status:status.value,value:new Date(input.data.getTime())}}_addCheck(check){return new _ZodDate({...this._def,checks:[...this._def.checks,check]})}min(minDate,message){return this._addCheck({kind:"min",value:minDate.getTime(),message:errorUtil.toString(message)})}max(maxDate,message){return this._addCheck({kind:"max",value:maxDate.getTime(),message:errorUtil.toString(message)})}get minDate(){let min=null;for(let ch of this._def.checks)ch.kind==="min"&&(min===null||ch.value>min)&&(min=ch.value);return min!=null?new Date(min):null}get maxDate(){let max=null;for(let ch of this._def.checks)ch.kind==="max"&&(max===null||ch.value<max)&&(max=ch.value);return max!=null?new Date(max):null}};ZodDate.create=params=>new ZodDate({checks:[],coerce:params?.coerce||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(params)});var ZodSymbol=class extends ZodType{_parse(input){if(this._getType(input)!==ZodParsedType.symbol){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodSymbol.create=params=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(params)});var ZodUndefined=class extends ZodType{_parse(input){if(this._getType(input)!==ZodParsedType.undefined){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodUndefined.create=params=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(params)});var ZodNull=class extends ZodType{_parse(input){if(this._getType(input)!==ZodParsedType.null){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodNull.create=params=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(params)});var ZodAny=class extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(input){return OK(input.data)}};ZodAny.create=params=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(params)});var ZodUnknown=class extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(input){return OK(input.data)}};ZodUnknown.create=params=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(params)});var ZodNever=class extends ZodType{_parse(input){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:ctx.parsedType}),INVALID}};ZodNever.create=params=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(params)});var ZodVoid=class extends ZodType{_parse(input){if(this._getType(input)!==ZodParsedType.undefined){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodVoid.create=params=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(params)});var ZodArray=class _ZodArray extends ZodType{_parse(input){let{ctx,status}=this._processInputParams(input),def=this._def;if(ctx.parsedType!==ZodParsedType.array)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:ctx.parsedType}),INVALID;if(def.exactLength!==null){let tooBig=ctx.data.length>def.exactLength.value,tooSmall=ctx.data.length<def.exactLength.value;(tooBig||tooSmall)&&(addIssueToContext(ctx,{code:tooBig?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:tooSmall?def.exactLength.value:void 0,maximum:tooBig?def.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:def.exactLength.message}),status.dirty())}if(def.minLength!==null&&ctx.data.length<def.minLength.value&&(addIssueToContext(ctx,{code:ZodIssueCode.too_small,minimum:def.minLength.value,type:"array",inclusive:!0,exact:!1,message:def.minLength.message}),status.dirty()),def.maxLength!==null&&ctx.data.length>def.maxLength.value&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:def.maxLength.value,type:"array",inclusive:!0,exact:!1,message:def.maxLength.message}),status.dirty()),ctx.common.async)return Promise.all([...ctx.data].map((item,i)=>def.type._parseAsync(new ParseInputLazyPath(ctx,item,ctx.path,i)))).then(result2=>ParseStatus.mergeArray(status,result2));let result=[...ctx.data].map((item,i)=>def.type._parseSync(new ParseInputLazyPath(ctx,item,ctx.path,i)));return ParseStatus.mergeArray(status,result)}get element(){return this._def.type}min(minLength,message){return new _ZodArray({...this._def,minLength:{value:minLength,message:errorUtil.toString(message)}})}max(maxLength,message){return new _ZodArray({...this._def,maxLength:{value:maxLength,message:errorUtil.toString(message)}})}length(len,message){return new _ZodArray({...this._def,exactLength:{value:len,message:errorUtil.toString(message)}})}nonempty(message){return this.min(1,message)}};ZodArray.create=(schema,params)=>new ZodArray({type:schema,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(params)});function deepPartialify(schema){if(schema instanceof ZodObject){let newShape={};for(let key in schema.shape){let fieldSchema=schema.shape[key];newShape[key]=ZodOptional.create(deepPartialify(fieldSchema))}return new ZodObject({...schema._def,shape:()=>newShape})}else return schema instanceof ZodArray?new ZodArray({...schema._def,type:deepPartialify(schema.element)}):schema instanceof ZodOptional?ZodOptional.create(deepPartialify(schema.unwrap())):schema instanceof ZodNullable?ZodNullable.create(deepPartialify(schema.unwrap())):schema instanceof ZodTuple?ZodTuple.create(schema.items.map(item=>deepPartialify(item))):schema}var ZodObject=class _ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let shape=this._def.shape(),keys=util.objectKeys(shape);return this._cached={shape,keys},this._cached}_parse(input){if(this._getType(input)!==ZodParsedType.object){let ctx2=this._getOrReturnCtx(input);return addIssueToContext(ctx2,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx2.parsedType}),INVALID}let{status,ctx}=this._processInputParams(input),{shape,keys:shapeKeys}=this._getCached(),extraKeys=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(let key in ctx.data)shapeKeys.includes(key)||extraKeys.push(key);let pairs=[];for(let key of shapeKeys){let keyValidator=shape[key],value=ctx.data[key];pairs.push({key:{status:"valid",value:key},value:keyValidator._parse(new ParseInputLazyPath(ctx,value,ctx.path,key)),alwaysSet:key in ctx.data})}if(this._def.catchall instanceof ZodNever){let unknownKeys=this._def.unknownKeys;if(unknownKeys==="passthrough")for(let key of extraKeys)pairs.push({key:{status:"valid",value:key},value:{status:"valid",value:ctx.data[key]}});else if(unknownKeys==="strict")extraKeys.length>0&&(addIssueToContext(ctx,{code:ZodIssueCode.unrecognized_keys,keys:extraKeys}),status.dirty());else if(unknownKeys!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let catchall=this._def.catchall;for(let key of extraKeys){let value=ctx.data[key];pairs.push({key:{status:"valid",value:key},value:catchall._parse(new ParseInputLazyPath(ctx,value,ctx.path,key)),alwaysSet:key in ctx.data})}}return ctx.common.async?Promise.resolve().then(async()=>{let syncPairs=[];for(let pair of pairs){let key=await pair.key,value=await pair.value;syncPairs.push({key,value,alwaysSet:pair.alwaysSet})}return syncPairs}).then(syncPairs=>ParseStatus.mergeObjectSync(status,syncPairs)):ParseStatus.mergeObjectSync(status,pairs)}get shape(){return this._def.shape()}strict(message){return errorUtil.errToObj,new _ZodObject({...this._def,unknownKeys:"strict",...message!==void 0?{errorMap:(issue,ctx)=>{let defaultError=this._def.errorMap?.(issue,ctx).message??ctx.defaultError;return issue.code==="unrecognized_keys"?{message:errorUtil.errToObj(message).message??defaultError}:{message:defaultError}}}:{}})}strip(){return new _ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new _ZodObject({...this._def,unknownKeys:"passthrough"})}extend(augmentation){return new _ZodObject({...this._def,shape:()=>({...this._def.shape(),...augmentation})})}merge(merging){return new _ZodObject({unknownKeys:merging._def.unknownKeys,catchall:merging._def.catchall,shape:()=>({...this._def.shape(),...merging._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(key,schema){return this.augment({[key]:schema})}catchall(index){return new _ZodObject({...this._def,catchall:index})}pick(mask){let shape={};for(let key of util.objectKeys(mask))mask[key]&&this.shape[key]&&(shape[key]=this.shape[key]);return new _ZodObject({...this._def,shape:()=>shape})}omit(mask){let shape={};for(let key of util.objectKeys(this.shape))mask[key]||(shape[key]=this.shape[key]);return new _ZodObject({...this._def,shape:()=>shape})}deepPartial(){return deepPartialify(this)}partial(mask){let newShape={};for(let key of util.objectKeys(this.shape)){let fieldSchema=this.shape[key];mask&&!mask[key]?newShape[key]=fieldSchema:newShape[key]=fieldSchema.optional()}return new _ZodObject({...this._def,shape:()=>newShape})}required(mask){let newShape={};for(let key of util.objectKeys(this.shape))if(mask&&!mask[key])newShape[key]=this.shape[key];else{let newField=this.shape[key];for(;newField instanceof ZodOptional;)newField=newField._def.innerType;newShape[key]=newField}return new _ZodObject({...this._def,shape:()=>newShape})}keyof(){return createZodEnum(util.objectKeys(this.shape))}};ZodObject.create=(shape,params)=>new ZodObject({shape:()=>shape,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)});ZodObject.strictCreate=(shape,params)=>new ZodObject({shape:()=>shape,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)});ZodObject.lazycreate=(shape,params)=>new ZodObject({shape,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)});var ZodUnion=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),options=this._def.options;function handleResults(results){for(let result of results)if(result.result.status==="valid")return result.result;for(let result of results)if(result.result.status==="dirty")return ctx.common.issues.push(...result.ctx.common.issues),result.result;let unionErrors=results.map(result=>new ZodError(result.ctx.common.issues));return addIssueToContext(ctx,{code:ZodIssueCode.invalid_union,unionErrors}),INVALID}if(ctx.common.async)return Promise.all(options.map(async option=>{let childCtx={...ctx,common:{...ctx.common,issues:[]},parent:null};return{result:await option._parseAsync({data:ctx.data,path:ctx.path,parent:childCtx}),ctx:childCtx}})).then(handleResults);{let dirty,issues=[];for(let option of options){let childCtx={...ctx,common:{...ctx.common,issues:[]},parent:null},result=option._parseSync({data:ctx.data,path:ctx.path,parent:childCtx});if(result.status==="valid")return result;result.status==="dirty"&&!dirty&&(dirty={result,ctx:childCtx}),childCtx.common.issues.length&&issues.push(childCtx.common.issues)}if(dirty)return ctx.common.issues.push(...dirty.ctx.common.issues),dirty.result;let unionErrors=issues.map(issues2=>new ZodError(issues2));return addIssueToContext(ctx,{code:ZodIssueCode.invalid_union,unionErrors}),INVALID}}get options(){return this._def.options}};ZodUnion.create=(types,params)=>new ZodUnion({options:types,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(params)});var getDiscriminator=type=>type instanceof ZodLazy?getDiscriminator(type.schema):type instanceof ZodEffects?getDiscriminator(type.innerType()):type instanceof ZodLiteral?[type.value]:type instanceof ZodEnum?type.options:type instanceof ZodNativeEnum?util.objectValues(type.enum):type instanceof ZodDefault?getDiscriminator(type._def.innerType):type instanceof ZodUndefined?[void 0]:type instanceof ZodNull?[null]:type instanceof ZodOptional?[void 0,...getDiscriminator(type.unwrap())]:type instanceof ZodNullable?[null,...getDiscriminator(type.unwrap())]:type instanceof ZodBranded||type instanceof ZodReadonly?getDiscriminator(type.unwrap()):type instanceof ZodCatch?getDiscriminator(type._def.innerType):[],ZodDiscriminatedUnion=class _ZodDiscriminatedUnion extends ZodType{_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.object)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx.parsedType}),INVALID;let discriminator=this.discriminator,discriminatorValue=ctx.data[discriminator],option=this.optionsMap.get(discriminatorValue);return option?ctx.common.async?option._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}):option._parseSync({data:ctx.data,path:ctx.path,parent:ctx}):(addIssueToContext(ctx,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[discriminator]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(discriminator,options,params){let optionsMap=new Map;for(let type of options){let discriminatorValues=getDiscriminator(type.shape[discriminator]);if(!discriminatorValues.length)throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);for(let value of discriminatorValues){if(optionsMap.has(value))throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);optionsMap.set(value,type)}}return new _ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator,options,optionsMap,...processCreateParams(params)})}};function mergeValues(a,b){let aType=getParsedType(a),bType=getParsedType(b);if(a===b)return{valid:!0,data:a};if(aType===ZodParsedType.object&&bType===ZodParsedType.object){let bKeys=util.objectKeys(b),sharedKeys=util.objectKeys(a).filter(key=>bKeys.indexOf(key)!==-1),newObj={...a,...b};Object.prototype.hasOwnProperty.call(newObj,"__proto__")&&delete newObj.__proto__;for(let key of sharedKeys){if(key==="__proto__")continue;let sharedValue=mergeValues(a[key],b[key]);if(!sharedValue.valid)return{valid:!1};newObj[key]=sharedValue.data}return{valid:!0,data:newObj}}else if(aType===ZodParsedType.array&&bType===ZodParsedType.array){if(a.length!==b.length)return{valid:!1};let newArray=[];for(let index=0;index<a.length;index++){let itemA=a[index],itemB=b[index],sharedValue=mergeValues(itemA,itemB);if(!sharedValue.valid)return{valid:!1};newArray.push(sharedValue.data)}return{valid:!0,data:newArray}}else return aType===ZodParsedType.date&&bType===ZodParsedType.date&&+a==+b?{valid:!0,data:a}:{valid:!1}}var ZodIntersection=class extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input),handleParsed=(parsedLeft,parsedRight)=>{if(isAborted(parsedLeft)||isAborted(parsedRight))return INVALID;let merged=mergeValues(parsedLeft.value,parsedRight.value);return merged.valid?((isDirty(parsedLeft)||isDirty(parsedRight))&&status.dirty(),{status:status.value,value:merged.data}):(addIssueToContext(ctx,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return ctx.common.async?Promise.all([this._def.left._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}),this._def.right._parseAsync({data:ctx.data,path:ctx.path,parent:ctx})]).then(([left,right])=>handleParsed(left,right)):handleParsed(this._def.left._parseSync({data:ctx.data,path:ctx.path,parent:ctx}),this._def.right._parseSync({data:ctx.data,path:ctx.path,parent:ctx}))}};ZodIntersection.create=(left,right,params)=>new ZodIntersection({left,right,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(params)});var ZodTuple=class _ZodTuple extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.array)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:ctx.parsedType}),INVALID;if(ctx.data.length<this._def.items.length)return addIssueToContext(ctx,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&ctx.data.length>this._def.items.length&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),status.dirty());let items=[...ctx.data].map((item,itemIndex)=>{let schema=this._def.items[itemIndex]||this._def.rest;return schema?schema._parse(new ParseInputLazyPath(ctx,item,ctx.path,itemIndex)):null}).filter(x=>!!x);return ctx.common.async?Promise.all(items).then(results=>ParseStatus.mergeArray(status,results)):ParseStatus.mergeArray(status,items)}get items(){return this._def.items}rest(rest){return new _ZodTuple({...this._def,rest})}};ZodTuple.create=(schemas,params)=>{if(!Array.isArray(schemas))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:schemas,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(params)})};var ZodRecord=class _ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.object)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx.parsedType}),INVALID;let pairs=[],keyType=this._def.keyType,valueType=this._def.valueType;for(let key in ctx.data)pairs.push({key:keyType._parse(new ParseInputLazyPath(ctx,key,ctx.path,key)),value:valueType._parse(new ParseInputLazyPath(ctx,ctx.data[key],ctx.path,key)),alwaysSet:key in ctx.data});return ctx.common.async?ParseStatus.mergeObjectAsync(status,pairs):ParseStatus.mergeObjectSync(status,pairs)}get element(){return this._def.valueType}static create(first,second,third){return second instanceof ZodType?new _ZodRecord({keyType:first,valueType:second,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(third)}):new _ZodRecord({keyType:ZodString.create(),valueType:first,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(second)})}},ZodMap=class extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.map)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:ctx.parsedType}),INVALID;let keyType=this._def.keyType,valueType=this._def.valueType,pairs=[...ctx.data.entries()].map(([key,value],index)=>({key:keyType._parse(new ParseInputLazyPath(ctx,key,ctx.path,[index,"key"])),value:valueType._parse(new ParseInputLazyPath(ctx,value,ctx.path,[index,"value"]))}));if(ctx.common.async){let finalMap=new Map;return Promise.resolve().then(async()=>{for(let pair of pairs){let key=await pair.key,value=await pair.value;if(key.status==="aborted"||value.status==="aborted")return INVALID;(key.status==="dirty"||value.status==="dirty")&&status.dirty(),finalMap.set(key.value,value.value)}return{status:status.value,value:finalMap}})}else{let finalMap=new Map;for(let pair of pairs){let key=pair.key,value=pair.value;if(key.status==="aborted"||value.status==="aborted")return INVALID;(key.status==="dirty"||value.status==="dirty")&&status.dirty(),finalMap.set(key.value,value.value)}return{status:status.value,value:finalMap}}}};ZodMap.create=(keyType,valueType,params)=>new ZodMap({valueType,keyType,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(params)});var ZodSet=class _ZodSet extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.set)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:ctx.parsedType}),INVALID;let def=this._def;def.minSize!==null&&ctx.data.size<def.minSize.value&&(addIssueToContext(ctx,{code:ZodIssueCode.too_small,minimum:def.minSize.value,type:"set",inclusive:!0,exact:!1,message:def.minSize.message}),status.dirty()),def.maxSize!==null&&ctx.data.size>def.maxSize.value&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:def.maxSize.value,type:"set",inclusive:!0,exact:!1,message:def.maxSize.message}),status.dirty());let valueType=this._def.valueType;function finalizeSet(elements2){let parsedSet=new Set;for(let element of elements2){if(element.status==="aborted")return INVALID;element.status==="dirty"&&status.dirty(),parsedSet.add(element.value)}return{status:status.value,value:parsedSet}}let elements=[...ctx.data.values()].map((item,i)=>valueType._parse(new ParseInputLazyPath(ctx,item,ctx.path,i)));return ctx.common.async?Promise.all(elements).then(elements2=>finalizeSet(elements2)):finalizeSet(elements)}min(minSize,message){return new _ZodSet({...this._def,minSize:{value:minSize,message:errorUtil.toString(message)}})}max(maxSize,message){return new _ZodSet({...this._def,maxSize:{value:maxSize,message:errorUtil.toString(message)}})}size(size,message){return this.min(size,message).max(size,message)}nonempty(message){return this.min(1,message)}};ZodSet.create=(valueType,params)=>new ZodSet({valueType,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(params)});var ZodFunction=class _ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.function)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:ctx.parsedType}),INVALID;function makeArgsIssue(args,error){return makeIssue({data:args,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,getErrorMap(),en_default].filter(x=>!!x),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:error}})}function makeReturnsIssue(returns,error){return makeIssue({data:returns,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,getErrorMap(),en_default].filter(x=>!!x),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:error}})}let params={errorMap:ctx.common.contextualErrorMap},fn=ctx.data;if(this._def.returns instanceof ZodPromise){let me=this;return OK(async function(...args){let error=new ZodError([]),parsedArgs=await me._def.args.parseAsync(args,params).catch(e=>{throw error.addIssue(makeArgsIssue(args,e)),error}),result=await Reflect.apply(fn,this,parsedArgs);return await me._def.returns._def.type.parseAsync(result,params).catch(e=>{throw error.addIssue(makeReturnsIssue(result,e)),error})})}else{let me=this;return OK(function(...args){let parsedArgs=me._def.args.safeParse(args,params);if(!parsedArgs.success)throw new ZodError([makeArgsIssue(args,parsedArgs.error)]);let result=Reflect.apply(fn,this,parsedArgs.data),parsedReturns=me._def.returns.safeParse(result,params);if(!parsedReturns.success)throw new ZodError([makeReturnsIssue(result,parsedReturns.error)]);return parsedReturns.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...items){return new _ZodFunction({...this._def,args:ZodTuple.create(items).rest(ZodUnknown.create())})}returns(returnType){return new _ZodFunction({...this._def,returns:returnType})}implement(func){return this.parse(func)}strictImplement(func){return this.parse(func)}static create(args,returns,params){return new _ZodFunction({args:args||ZodTuple.create([]).rest(ZodUnknown.create()),returns:returns||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(params)})}},ZodLazy=class extends ZodType{get schema(){return this._def.getter()}_parse(input){let{ctx}=this._processInputParams(input);return this._def.getter()._parse({data:ctx.data,path:ctx.path,parent:ctx})}};ZodLazy.create=(getter,params)=>new ZodLazy({getter,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(params)});var ZodLiteral=class extends ZodType{_parse(input){if(input.data!==this._def.value){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:input.data}}get value(){return this._def.value}};ZodLiteral.create=(value,params)=>new ZodLiteral({value,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(params)});function createZodEnum(values,params){return new ZodEnum({values,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(params)})}var ZodEnum=class _ZodEnum extends ZodType{_parse(input){if(typeof input.data!="string"){let ctx=this._getOrReturnCtx(input),expectedValues=this._def.values;return addIssueToContext(ctx,{expected:util.joinValues(expectedValues),received:ctx.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(input.data)){let ctx=this._getOrReturnCtx(input),expectedValues=this._def.values;return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_enum_value,options:expectedValues}),INVALID}return OK(input.data)}get options(){return this._def.values}get enum(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}get Values(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}get Enum(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}extract(values,newDef=this._def){return _ZodEnum.create(values,{...this._def,...newDef})}exclude(values,newDef=this._def){return _ZodEnum.create(this.options.filter(opt=>!values.includes(opt)),{...this._def,...newDef})}};ZodEnum.create=createZodEnum;var ZodNativeEnum=class extends ZodType{_parse(input){let nativeEnumValues=util.getValidEnumValues(this._def.values),ctx=this._getOrReturnCtx(input);if(ctx.parsedType!==ZodParsedType.string&&ctx.parsedType!==ZodParsedType.number){let expectedValues=util.objectValues(nativeEnumValues);return addIssueToContext(ctx,{expected:util.joinValues(expectedValues),received:ctx.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||(this._cache=new Set(util.getValidEnumValues(this._def.values))),!this._cache.has(input.data)){let expectedValues=util.objectValues(nativeEnumValues);return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_enum_value,options:expectedValues}),INVALID}return OK(input.data)}get enum(){return this._def.values}};ZodNativeEnum.create=(values,params)=>new ZodNativeEnum({values,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(params)});var ZodPromise=class extends ZodType{unwrap(){return this._def.type}_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.promise&&ctx.common.async===!1)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:ctx.parsedType}),INVALID;let promisified=ctx.parsedType===ZodParsedType.promise?ctx.data:Promise.resolve(ctx.data);return OK(promisified.then(data=>this._def.type.parseAsync(data,{path:ctx.path,errorMap:ctx.common.contextualErrorMap})))}};ZodPromise.create=(schema,params)=>new ZodPromise({type:schema,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(params)});var ZodEffects=class extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(input){let{status,ctx}=this._processInputParams(input),effect=this._def.effect||null,checkCtx={addIssue:arg=>{addIssueToContext(ctx,arg),arg.fatal?status.abort():status.dirty()},get path(){return ctx.path}};if(checkCtx.addIssue=checkCtx.addIssue.bind(checkCtx),effect.type==="preprocess"){let processed=effect.transform(ctx.data,checkCtx);if(ctx.common.async)return Promise.resolve(processed).then(async processed2=>{if(status.value==="aborted")return INVALID;let result=await this._def.schema._parseAsync({data:processed2,path:ctx.path,parent:ctx});return result.status==="aborted"?INVALID:result.status==="dirty"?DIRTY(result.value):status.value==="dirty"?DIRTY(result.value):result});{if(status.value==="aborted")return INVALID;let result=this._def.schema._parseSync({data:processed,path:ctx.path,parent:ctx});return result.status==="aborted"?INVALID:result.status==="dirty"?DIRTY(result.value):status.value==="dirty"?DIRTY(result.value):result}}if(effect.type==="refinement"){let executeRefinement=acc=>{let result=effect.refinement(acc,checkCtx);if(ctx.common.async)return Promise.resolve(result);if(result instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return acc};if(ctx.common.async===!1){let inner=this._def.schema._parseSync({data:ctx.data,path:ctx.path,parent:ctx});return inner.status==="aborted"?INVALID:(inner.status==="dirty"&&status.dirty(),executeRefinement(inner.value),{status:status.value,value:inner.value})}else return this._def.schema._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}).then(inner=>inner.status==="aborted"?INVALID:(inner.status==="dirty"&&status.dirty(),executeRefinement(inner.value).then(()=>({status:status.value,value:inner.value}))))}if(effect.type==="transform")if(ctx.common.async===!1){let base=this._def.schema._parseSync({data:ctx.data,path:ctx.path,parent:ctx});if(!isValid(base))return INVALID;let result=effect.transform(base.value,checkCtx);if(result instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:status.value,value:result}}else return this._def.schema._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}).then(base=>isValid(base)?Promise.resolve(effect.transform(base.value,checkCtx)).then(result=>({status:status.value,value:result})):INVALID);util.assertNever(effect)}};ZodEffects.create=(schema,effect,params)=>new ZodEffects({schema,typeName:ZodFirstPartyTypeKind.ZodEffects,effect,...processCreateParams(params)});ZodEffects.createWithPreprocess=(preprocess,schema,params)=>new ZodEffects({schema,effect:{type:"preprocess",transform:preprocess},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(params)});var ZodOptional=class extends ZodType{_parse(input){return this._getType(input)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(input)}unwrap(){return this._def.innerType}};ZodOptional.create=(type,params)=>new ZodOptional({innerType:type,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(params)});var ZodNullable=class extends ZodType{_parse(input){return this._getType(input)===ZodParsedType.null?OK(null):this._def.innerType._parse(input)}unwrap(){return this._def.innerType}};ZodNullable.create=(type,params)=>new ZodNullable({innerType:type,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(params)});var ZodDefault=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),data=ctx.data;return ctx.parsedType===ZodParsedType.undefined&&(data=this._def.defaultValue()),this._def.innerType._parse({data,path:ctx.path,parent:ctx})}removeDefault(){return this._def.innerType}};ZodDefault.create=(type,params)=>new ZodDefault({innerType:type,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof params.default=="function"?params.default:()=>params.default,...processCreateParams(params)});var ZodCatch=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),newCtx={...ctx,common:{...ctx.common,issues:[]}},result=this._def.innerType._parse({data:newCtx.data,path:newCtx.path,parent:{...newCtx}});return isAsync(result)?result.then(result2=>({status:"valid",value:result2.status==="valid"?result2.value:this._def.catchValue({get error(){return new ZodError(newCtx.common.issues)},input:newCtx.data})})):{status:"valid",value:result.status==="valid"?result.value:this._def.catchValue({get error(){return new ZodError(newCtx.common.issues)},input:newCtx.data})}}removeCatch(){return this._def.innerType}};ZodCatch.create=(type,params)=>new ZodCatch({innerType:type,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof params.catch=="function"?params.catch:()=>params.catch,...processCreateParams(params)});var ZodNaN=class extends ZodType{_parse(input){if(this._getType(input)!==ZodParsedType.nan){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:ctx.parsedType}),INVALID}return{status:"valid",value:input.data}}};ZodNaN.create=params=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(params)});var BRAND=Symbol("zod_brand"),ZodBranded=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),data=ctx.data;return this._def.type._parse({data,path:ctx.path,parent:ctx})}unwrap(){return this._def.type}},ZodPipeline=class _ZodPipeline extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.common.async)return(async()=>{let inResult=await this._def.in._parseAsync({data:ctx.data,path:ctx.path,parent:ctx});return inResult.status==="aborted"?INVALID:inResult.status==="dirty"?(status.dirty(),DIRTY(inResult.value)):this._def.out._parseAsync({data:inResult.value,path:ctx.path,parent:ctx})})();{let inResult=this._def.in._parseSync({data:ctx.data,path:ctx.path,parent:ctx});return inResult.status==="aborted"?INVALID:inResult.status==="dirty"?(status.dirty(),{status:"dirty",value:inResult.value}):this._def.out._parseSync({data:inResult.value,path:ctx.path,parent:ctx})}}static create(a,b){return new _ZodPipeline({in:a,out:b,typeName:ZodFirstPartyTypeKind.ZodPipeline})}},ZodReadonly=class extends ZodType{_parse(input){let result=this._def.innerType._parse(input),freeze=data=>(isValid(data)&&(data.value=Object.freeze(data.value)),data);return isAsync(result)?result.then(data=>freeze(data)):freeze(result)}unwrap(){return this._def.innerType}};ZodReadonly.create=(type,params)=>new ZodReadonly({innerType:type,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(params)});function cleanParams(params,data){let p=typeof params=="function"?params(data):typeof params=="string"?{message:params}:params;return typeof p=="string"?{message:p}:p}function custom(check,_params={},fatal){return check?ZodAny.create().superRefine((data,ctx)=>{let r=check(data);if(r instanceof Promise)return r.then(r2=>{if(!r2){let params=cleanParams(_params,data),_fatal=params.fatal??fatal??!0;ctx.addIssue({code:"custom",...params,fatal:_fatal})}});if(!r){let params=cleanParams(_params,data),_fatal=params.fatal??fatal??!0;ctx.addIssue({code:"custom",...params,fatal:_fatal})}}):ZodAny.create()}var late={object:ZodObject.lazycreate},ZodFirstPartyTypeKind;(function(ZodFirstPartyTypeKind2){ZodFirstPartyTypeKind2.ZodString="ZodString",ZodFirstPartyTypeKind2.ZodNumber="ZodNumber",ZodFirstPartyTypeKind2.ZodNaN="ZodNaN",ZodFirstPartyTypeKind2.ZodBigInt="ZodBigInt",ZodFirstPartyTypeKind2.ZodBoolean="ZodBoolean",ZodFirstPartyTypeKind2.ZodDate="ZodDate",ZodFirstPartyTypeKind2.ZodSymbol="ZodSymbol",ZodFirstPartyTypeKind2.ZodUndefined="ZodUndefined",ZodFirstPartyTypeKind2.ZodNull="ZodNull",ZodFirstPartyTypeKind2.ZodAny="ZodAny",ZodFirstPartyTypeKind2.ZodUnknown="ZodUnknown",ZodFirstPartyTypeKind2.ZodNever="ZodNever",ZodFirstPartyTypeKind2.ZodVoid="ZodVoid",ZodFirstPartyTypeKind2.ZodArray="ZodArray",ZodFirstPartyTypeKind2.ZodObject="ZodObject",ZodFirstPartyTypeKind2.ZodUnion="ZodUnion",ZodFirstPartyTypeKind2.ZodDiscriminatedUnion="ZodDiscriminatedUnion",ZodFirstPartyTypeKind2.ZodIntersection="ZodIntersection",ZodFirstPartyTypeKind2.ZodTuple="ZodTuple",ZodFirstPartyTypeKind2.ZodRecord="ZodRecord",ZodFirstPartyTypeKind2.ZodMap="ZodMap",ZodFirstPartyTypeKind2.ZodSet="ZodSet",ZodFirstPartyTypeKind2.ZodFunction="ZodFunction",ZodFirstPartyTypeKind2.ZodLazy="ZodLazy",ZodFirstPartyTypeKind2.ZodLiteral="ZodLiteral",ZodFirstPartyTypeKind2.ZodEnum="ZodEnum",ZodFirstPartyTypeKind2.ZodEffects="ZodEffects",ZodFirstPartyTypeKind2.ZodNativeEnum="ZodNativeEnum",ZodFirstPartyTypeKind2.ZodOptional="ZodOptional",ZodFirstPartyTypeKind2.ZodNullable="ZodNullable",ZodFirstPartyTypeKind2.ZodDefault="ZodDefault",ZodFirstPartyTypeKind2.ZodCatch="ZodCatch",ZodFirstPartyTypeKind2.ZodPromise="ZodPromise",ZodFirstPartyTypeKind2.ZodBranded="ZodBranded",ZodFirstPartyTypeKind2.ZodPipeline="ZodPipeline",ZodFirstPartyTypeKind2.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));var instanceOfType=(cls,params={message:`Input not instance of ${cls.name}`})=>custom(data=>data instanceof cls,params),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:arg=>ZodString.create({...arg,coerce:!0}),number:arg=>ZodNumber.create({...arg,coerce:!0}),boolean:arg=>ZodBoolean.create({...arg,coerce:!0}),bigint:arg=>ZodBigInt.create({...arg,coerce:!0}),date:arg=>ZodDate.create({...arg,coerce:!0})};var NEVER=INVALID;async function prepareFunctions(options){await traceOperation(options.trace,"vc.cli.describe.validate_output",()=>validateBuildOutput(options));let config=await traceOperation(options.trace,"vc.cli.describe.read_config",()=>getBuildOutputConfigOrThrow(options.outputDir));if("daemons"in config&&config.daemons&&Object.keys(config.daemons).length)throw new DescribeError("unsupported_output","This build contains daemons. Describe supports native AWS Lambda functions only.");if(!serviceInventorySchema.safeParse(config.experimentalServicesV2??{}).success)throw new DescribeError("invalid_build_output","Invalid service inventory in config.json. Rebuild the service outputs before running describe.");let scopes=[{directory:"",config}];for(let entry of getServiceOutputEntries(config)){if(entry.service.bindings?.length)throw new DescribeError("unsupported_output","This build contains service bindings, which cannot be provisioned as AWS Lambda functions. Remove the bindings and rebuild before running describe.");let serviceConfig=await readServiceOutputConfig(options.outputDir,entry).catch(error=>{throw error instanceof import_build_utils8.NowBuildError&&error.code==="MISSING_SERVICE_BUILD_OUTPUT"?new DescribeError("invalid_build_output",`Service "${entry.name}" is missing build output at ".vercel/output/services/${entry.name}/config.json". Rebuild the service before running describe.`):error});serviceConfig&&scopes.push({config:serviceConfig,directory:entry.directory,service:entry.name})}let groups=[],paths=new Set;for(let scope of scopes){let functions=await traceOperation(options.trace,"vc.cli.describe.read_functions",()=>readFunctions({outputDir:join8(options.outputDir,scope.directory),repoRootPath:options.repoRootPath,prebuilt:!0}));if(functions.edgeFunctions.size)throw new DescribeError("unsupported_output","This build contains Edge Functions, which cannot be provisioned as AWS Lambda functions.");await traceOperation(options.trace,"vc.cli.describe.group_functions",()=>groupBundleableLambdas({functions,options:{}}));let scopeGroups=new Map,middlewarePaths=getMiddlewareRouting({routes:scope.config.routes??[],functions});for(let output of iterateNativeFunctionOutputs(functions)){let lambda=output.lambda,directory=join8(scope.directory,"functions",`${output.path}.func`),functionConfig=JSON.parse(await readFile3(join8(options.outputDir,directory,".vc-config.json"),"utf8"));if(lambda.runtime==="container"||functionConfig.hive||functionConfig.affinity)throw new DescribeError("unsupported_output","This build contains container or Hive functions. Describe supports native AWS Lambda functions only.");let sourcePath=getFunctionSourcePath({output:{path:output.path},service:scope.service});if(paths.has(sourcePath))throw new DescribeError("invalid_build_output",`Multiple function outputs use "${sourcePath}". Rename the conflicting output and rebuild before running describe.`);paths.add(sourcePath);let outputs=scopeGroups.get(lambda)??[];scopeGroups.set(lambda,outputs),outputs.push({sourceKind:output.prerender?"prerender":"lambda",middleware:output.prerender===void 0&&middlewarePaths.has(output.path)?{}:void 0,path:sourcePath,directory,service:scope.service})}for(let[lambda,outputs]of scopeGroups)groups.push({lambda,outputs})}return{groups,services:config.services}}var serviceInventorySchema=external_exports.record(external_exports.string().regex(new RegExp(import_build_utils8.SERVICE_NAME_PATTERN)),external_exports.object({root:external_exports.string().optional(),bindings:external_exports.array(external_exports.unknown()).optional()}));import{writeFile}from"node:fs/promises";var descriptorSchema=external_exports.object({Architectures:external_exports.array(external_exports.string()).optional(),Environment:external_exports.object({Variables:external_exports.record(external_exports.string())}),EphemeralStorage:external_exports.object({Size:external_exports.number()}).optional(),FunctionName:external_exports.string().min(1),Handler:external_exports.string(),Layers:external_exports.array(external_exports.string()),MemorySize:external_exports.number(),Region:external_exports.string().min(1),ResolvableLayers:external_exports.record(external_exports.object({url:external_exports.string()})),Runtime:external_exports.string(),Tags:external_exports.record(external_exports.string()),Timeout:external_exports.number().optional()});async function describeFunctions(client,params){let functions=await client.withTrace("vc.cli.describe.prepare_functions",trace=>prepareFunctions({trace,directory:params.directory,repoRootPath:params.repoRootPath,outputDir:params.outputDir})),buildEnv=await client.withTrace("vc.cli.describe.build_env",async()=>external_exports.object({VERCEL_ENCRYPTED_ENV_FILENAME:external_exports.string().min(1),VERCEL_ENCRYPTED_ENV_CONTENT:external_exports.string().min(1)}).parse((await fetchDeploymentBuildEnv(client,params.deploymentId,{quiet:params.quiet})).buildEnv)),lambdas=(await Promise.all(functions.groups.map(({lambda,outputs})=>client.withTrace("vc.cli.describe.function",async()=>{lambda.files=await client.withTrace("vc.cli.describe.hydrate",()=>hydrateLambdaFiles(lambda,{filename:buildEnv.VERCEL_ENCRYPTED_ENV_FILENAME,contentBase64:buildEnv.VERCEL_ENCRYPTED_ENV_CONTENT}));let zip=await client.withTrace("vc.cli.describe.zip",()=>lambda.createZip()),bytes=new Uint8Array(zip.buffer,zip.byteOffset,zip.byteLength),digest=await client.withTrace("vc.cli.describe.hash_zip",()=>createHash2("sha256").update(bytes).digest("hex"),{byte_count:String(bytes.length)});await client.withTrace("vc.cli.describe.write_zip",()=>writeFile(join9(params.zipDirectory,`${digest}.zip`),bytes,{mode:384}),{byte_count:String(bytes.length)});let config=await client.withTrace("vc.cli.describe.configuration",()=>getFunctionConfig(lambda)),input={...config,framework:config.framework&&{slug:config.framework.slug},digest,size:bytes.length};return outputs.map(output=>({...output,lambda:input}))},{function_count:"1"})))).flat(),{descriptors}=await client.withTrace("vc.cli.describe.descriptors",async()=>external_exports.object({descriptors:external_exports.array(external_exports.array(descriptorSchema).min(1))}).parse(await client.fetch(`/v2/deployments/${params.deploymentId}/builds/function-descriptors`,{method:"POST",body:JSON.stringify({lambdas:lambdas.map(output=>({lambda:output.lambda,path:output.path,service:output.service,sourceKind:output.sourceKind,middleware:output.middleware})),services:functions.services}),headers:{"content-type":"application/json"},accountId:params.teamId,retry:{retries:0}})),{function_count:String(lambdas.length)});if(descriptors.length!==lambdas.length)throw new Error("Descriptor count does not match function outputs");return lambdas.map(({path:path2,directory,lambda},index)=>{let regional=descriptors[index];if(new Set(regional.map(d=>d.FunctionName)).size!==1)throw new Error("Inconsistent regional function name");return{path:path2,directory,digest:lambda.digest,size:lambda.size,regional}})}import{isDeepStrictEqual}from"node:util";import{join as join11}from"node:path";import{mkdir as mkdir2,mkdtemp,rename,rm,stat as stat5,writeFile as writeFile3}from"node:fs/promises";var import_build_utils9=__toESM(require_build_utils(),1);import{basename as basename2,dirname as dirname2,join as join10,relative as relative4,sep as sep3}from"node:path";import{copyFile,cp,lstat as lstat2,mkdir,readFile as readFile4,readdir as readdir4,realpath as realpath4,stat as stat4,symlink,writeFile as writeFile2}from"node:fs/promises";async function prepareContinuation(params){let{directory,outputDir,destination,manifest,repoRootPath=directory}=params,validateSource=await traceOperation(params.trace,"vc.cli.describe.validate_continuation",()=>validateBuildOutput({directory,outputDir,repoRootPath})),outputRoot=await realpath4(outputDir),functionDirectories=new Set(params.functions.map(fn=>fn.directory)),functionAliases=[];await traceOperation(params.trace,"vc.cli.describe.copy_continuation",()=>cp(outputDir,destination,{recursive:!0,dereference:!0,filter:async(path2,target)=>{let rel=relative4(outputDir,path2);return basename2(path2)!==".vc-config.json"&&rel.split(sep3).slice(0,-1).some(segment=>segment.endsWith(".func"))?!1:functionDirectories.has(rel)&&(await lstat2(path2)).isSymbolicLink()?(functionAliases.push({path:target,target:join10(destination,relative4(outputRoot,await realpath4(path2)))}),!1):!0}}));for(let{path:path2,target}of functionAliases)await mkdir(dirname2(path2),{recursive:!0}),await symlink(relative4(dirname2(path2),target),path2);await traceOperation(params.trace,"vc.cli.describe.write_manifest",()=>writeFile2(join10(destination,"provision.json"),JSON.stringify(manifest)));let manifests=new Set(await traceOperation(params.trace,"vc.cli.describe.package_manifests",()=>packageManifests(directory)));if(repoRootPath!==directory)for(let path2 of await traceOperation(params.trace,"vc.cli.describe.package_manifests",()=>packageManifests(repoRootPath)))manifests.add(path2);for(let directory2 of functionDirectories)await traceOperation(params.trace,"vc.cli.describe.rewrite_function",async()=>{let configPath=join10(destination,directory2,".vc-config.json"),config=JSON.parse(await readFile4(configPath,"utf8"));for(let[file,source]of Object.entries(config.filePathMap??{}))basename2(file)==="package.json"&&manifests.add(join10(repoRootPath,source));delete config.filePathMap,await writeFile2(configPath,JSON.stringify({...config,architecture:new import_build_utils9.Lambda({...config,files:{}}).architecture}))},{function_count:"1"});let[firstFunction]=functionDirectories;if(firstFunction!==void 0)for(let[i,path2]of[...manifests].entries()){let target=join10(destination,firstFunction,"__byoc_security__",String(i));await mkdir(target,{recursive:!0}),await traceOperation(params.trace,"vc.cli.describe.copy_manifest",async()=>copyFile(await validateSource(path2),join10(target,"package.json")))}}async function packageManifests(root){let modules=join10(root,"node_modules"),names=await readdir4(modules).catch(()=>[]),packages=await Promise.all(names.map(async name=>name.startsWith(".")?[]:name.startsWith("@")?(await readdir4(join10(modules,name)).catch(()=>[])).map(entry=>join10(modules,name,entry)):[join10(modules,name)]));return(await Promise.all([root,...packages.flat()].map(dir=>{let path2=join10(dir,"package.json");return stat4(path2).then(()=>path2,()=>{})}))).filter(p=>p!==void 0)}async function describeDeployment(client,params){return client.withTrace("vc.cli.describe",async trace=>{let output=join11(params.directory,".vercel",params.deploymentId),buildOutput=join11(params.directory,".vercel/output"),build=join11(output,"build"),repoRootPath=params.repoRootPath??params.directory,source=await client.withTrace("vc.cli.describe.resolve_source",async()=>{let source2=await exists(buildOutput)&&!await exists(join11(buildOutput,"provision.json"))?buildOutput:build;if(!await exists(join11(source2,"config.json")))throw new DescribeError("prebuilt_not_found",`No local build output found. Run \`vercel build --deployment ${params.deploymentId}\` before \`vercel deploy describe\`.`);return source2}),staging=await client.withTrace("vc.cli.describe.staging",async()=>(await mkdir2(join11(params.directory,".vercel"),{recursive:!0}),mkdtemp(join11(params.directory,".vercel",`.describe-${params.deploymentId}-`)))),removeStaging=!0,functions=new Map,layers={},manifest={};try{await client.withTrace("vc.cli.describe.prepare_directories",async()=>{await mkdir2(join11(staging,"zips")),await mkdir2(join11(staging,"layers"))});let described=await client.withTrace("vc.cli.describe.functions",()=>describeFunctions(client,{deploymentId:params.deploymentId,directory:params.directory,repoRootPath,outputDir:source,quiet:params.quiet,teamId:params.teamId,zipDirectory:join11(staging,"zips")}));return trace?.span.setAttributes({function_count:String(described.length)}),await client.withTrace("vc.cli.describe.resolve_layers",async layerScope=>{for(let{path:path2,digest,size,regional}of described){for(let descriptor of regional){let layerNames=[];for(let arn of descriptor.Layers){let layer=descriptor.ResolvableLayers[arn];if(!layer)throw new DescribeError("invalid_response","The deployment API did not provide a download URL for a required runtime layer.");let name=createHash3("sha256").update(arn).digest("hex");layerNames.push(name),await client.withTrace("vc.cli.describe.layer",async layerTrace=>{if(layerTrace?.span.setAttributes({cache_hit:layers[name]?"true":"false"}),layers[name])return;let bytes=await downloadLayer(client,layer.url);layerTrace?.span.setAttributes({byte_count:String(bytes.length)});let file=`layers/${await client.withTrace("vc.cli.describe.layer_hash",()=>createHash3("sha256").update(bytes).digest("hex"),{byte_count:String(bytes.length)})}.zip`;await client.withTrace("vc.cli.describe.layer_write",()=>writeFile3(join11(staging,file),bytes,{mode:384}),{byte_count:String(bytes.length)}),layers[name]=file})}let{Region,Layers,ResolvableLayers,...configuration}=descriptor,fn={code:`zips/${digest}.zip`,region:Region,layers:layerNames,configuration},key=`${descriptor.Region}:${descriptor.FunctionName}`,previous=functions.get(key);if(previous&&!isDeepStrictEqual(previous,fn))throw new DescribeError("invalid_response","Conflicting descriptors for the same regional function");functions.set(key,fn)}manifest[path2]={awsAccountId:params.awsAccountId,digest,functionName:regional[0].FunctionName,regions:[...new Set(regional.map(d=>d.Region))],size}}layerScope?.span.setAttributes({layer_count:String(Object.keys(layers).length)})}),trace?.span.setAttributes({layer_count:String(Object.keys(layers).length)}),await client.withTrace("vc.cli.describe.write_descriptor",()=>writeFile3(join11(staging,"descriptor.json"),JSON.stringify({awsAccountId:params.awsAccountId,deploymentId:params.deploymentId,functions:[...functions.values()],layers,version:1},null,2),{mode:384})),await client.withTrace("vc.cli.describe.continuation",trace2=>prepareContinuation({trace:trace2,destination:join11(staging,"output"),directory:params.directory,functions:described,manifest,outputDir:source,repoRootPath})),await client.withTrace("vc.cli.describe.persist",async()=>{await mkdir2(output,{recursive:!0,mode:448});let backup=join11(staging,"backup");await mkdir2(backup);let moves=[],move=async(from,to)=>{await rename(from,to),moves.push([from,to])},preserve=async(path2,name)=>{await exists(path2)&&await move(path2,join11(backup,name))};try{for(let name of["zips","layers","descriptor.json"])await preserve(join11(output,name),name),await move(join11(staging,name),join11(output,name));source===buildOutput?(await preserve(build,"build"),await move(buildOutput,build)):await preserve(buildOutput,"output"),await move(join11(staging,"output"),buildOutput)}catch(error){throw removeStaging=!1,await client.withTrace("vc.cli.describe.rollback",async()=>{for(let[from,to]of moves.reverse())await rename(to,from)}),removeStaging=!0,error}}),output}finally{removeStaging&&await client.withTrace("vc.cli.describe.cleanup",()=>rm(staging,{recursive:!0,force:!0}))}})}var exists=path2=>stat5(path2).then(()=>!0,error=>{if(error.code==="ENOENT")return!1;throw error});import{join as join13}from"node:path";import{join as join12,relative as relative5}from"node:path";async function resolveDescribeProject(client){try{let link=await getLinkFromDir(join12(client.cwd,".vercel"));if(link){let{repoRoot,resolvedRootDirectory}=resolvePerDirectoryLinkRoot(client.cwd,link.settings?.rootDirectory);return{...link,directory:join12(repoRoot,resolvedRootDirectory),repoRootPath:repoRoot}}let repo=await getRepoLink(client,client.cwd);if(!repo?.repoConfig?.projects.length)throw new DescribeError("not_linked","No linked project found. Run `vercel link`, or restore CI project settings with `vercel pull --yes`.");let matches=findProjectsFromPath(repo.repoConfig.projects,relative5(repo.rootPath,client.cwd)),candidates=matches.length?matches:repo.repoConfig.projects;if(candidates.length!==1)throw new DescribeError("ambiguous_project","Multiple projects are linked here. Run this command from the intended project directory, or pass --cwd <PROJECT_DIRECTORY>.");let project=await getProjectLink(client,client.cwd,candidates[0].id,!0);if(!project?.repoRoot)throw new Error("Project link changed");return{...project,directory:join12(project.repoRoot,project.projectRootDirectory||""),repoRootPath:project.repoRoot}}catch(error){throw error instanceof DescribeError?error:new DescribeError("invalid_project_link","Could not read the local project link. Check that .vercel/project.json or .vercel/repo.json is readable and contains valid project settings.")}}async function describe(client){let asJson=wantsMachineReadableOutput("deploy",client.argv),warnings=[],fail=(reason,message,code=1)=>(asJson?client.stderr.write(`${JSON.stringify({status:"error",reason,message,...warnings.length>0?{warnings}:{}})}
|
|
22
|
+
`):output_manager_default.error(message),code),parsed;try{parsed=parseArguments(client.argv.slice(2),getFlagsSpecification(describeSubcommand.options))}catch(error){return fail("invalid_arguments",`${isArgumentError(error)?error.message:"Invalid describe options"}. Run \`vercel deploy describe --help\` for usage.`,2)}asJson=parsed.flags["--json"]===!0;let deployment=getRenamedOption(parsed.flags,"--deployment","--id",{json:asJson});if("error"in deployment)return fail("invalid_arguments",deployment.error,2);deployment.warning&&(warnings=[deployment.warning]);let deploymentId=deployment.value,awsAccountId=parsed.flags["--aws-account-id"];if((parsed.args[0]==="deploy"?parsed.args.slice(1):parsed.args).length>1)return fail("invalid_arguments","Unexpected positional arguments. Run `vercel deploy describe --help` for usage.",2);if(!deploymentId||!/^dpl_[a-zA-Z0-9]+$/.test(deploymentId))return fail("invalid_arguments","Provide a deployment ID with --deployment, such as --deployment dpl_xxx.",2);if(!awsAccountId||!/^\d{12}$/.test(awsAccountId))return fail("invalid_arguments","Provide a 12-digit AWS account ID with --aws-account-id.",2);if(process.platform==="win32")return fail("unsupported_platform","vercel deploy describe is not supported on Windows yet. Run it on macOS or Linux.");let telemetry=new DescribeTelemetryClient({opts:{store:client.telemetryEventStore}});telemetry.trackCliOptionDeployment(parsed.flags["--deployment"]),telemetry.trackCliOptionId(parsed.flags["--id"]),telemetry.trackCliOptionAwsAccountId(awsAccountId),telemetry.trackCliFlagJson(parsed.flags["--json"]);try{let project=await resolveDescribeProject(client),explicitTeam=parsed.flags["--scope"]?client.config.currentTeam:process.env.VERCEL_ORG_ID;if(explicitTeam&&explicitTeam!==project.orgId)return fail("scope_mismatch","The selected team does not match the local project link. Use the linked team, or run `vercel pull --yes` with the intended VERCEL_ORG_ID and VERCEL_PROJECT_ID.");if(process.env.VERCEL_PROJECT_ID&&process.env.VERCEL_PROJECT_ID!==project.projectId)return fail("project_mismatch","VERCEL_PROJECT_ID differs from the linked project. Run `vercel pull --yes` to restore settings for the intended project.");client.config.currentTeam=project.orgId.startsWith("team_")?project.orgId:void 0,asJson||output_manager_default.log(`Preparing ${deploymentId} in team ${project.orgId} for AWS account ${awsAccountId}`);let directory=await describeDeployment(client,{directory:project.directory,repoRootPath:project.repoRootPath,deploymentId,awsAccountId,teamId:project.orgId,quiet:asJson}),descriptor=join13(directory,"descriptor.json");if(asJson)client.stdout.write(`${JSON.stringify({deployment:{id:deploymentId},awsAccountId,directory,descriptor,...warnings.length>0?{warnings}:{}})}
|
|
23
|
+
`);else{client.stdout.write(`${descriptor}
|
|
24
|
+
`),output_manager_default.log(`Prepared function packages in ${directory}`);let cwd=project.directory===client.cwd?"":` --cwd ${quoteArg(project.directory)}`;output_manager_default.log(`Provision the functions in descriptor.json, then run:
|
|
25
|
+
vercel deploy continue --deployment ${deploymentId}${cwd}`)}return 0}catch(error){return output_manager_default.debug(error instanceof Error?error.stack??error.message:String(error)),error instanceof DescribeError?fail(error.reason,error.message):error instanceof InvalidToken||isAPIError(error)&&error.status===401?fail("not_authorized","Could not authenticate with Vercel. Check VERCEL_TOKEN in CI, or run `vercel login`."):isAPIError(error)&&error.status===403?fail("not_authorized","Vercel denied access to this deployment. Check that your token has access to the linked project and team."):isAPIError(error)&&error.status===404?fail("not_found",`Deployment ${deploymentId} was not found, or manual provisioning is not enabled for this team.`):isAPIError(error)&&error.status<500&&error.serverMessage?fail("api_error",error.serverMessage):fail("describe_failed","Could not prepare deployment functions. Check the local build and deployment access, then rerun this command.")}}export{describe as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{detectProjects}from"./chunk-HVJN2SSK.js";import"./chunk-66TKNVRG.js";import"./chunk-REJLEESP.js";import"./chunk-ZKNEIE44.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-BZENIQ7N.js";export{detectProjects};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{getServicesConfigWriteBlocker,isExperimentalServicesEnabled,loadVercelConfig,tryDetectServices,writeServicesConfig}from"./chunk-2FNOYPRB.js";import"./chunk-5KL6UFII.js";import"./chunk-EM3U6PRB.js";import"./chunk-33OMDQTW.js";import"./chunk-2C6TLXE5.js";import"./chunk-U4Z2MMOF.js";import"./chunk-66TKNVRG.js";import"./chunk-REJLEESP.js";import"./chunk-ZKNEIE44.js";import"./chunk-25565AGS.js";import"./chunk-BC74BRVP.js";import"./chunk-4HR3I3ML.js";import"./chunk-K46QQRUN.js";import"./chunk-MTZYPCZ7.js";import"./chunk-GPDERS2D.js";import"./chunk-4NTBYNFR.js";import"./chunk-VM6X5BTK.js";import"./chunk-2VBFQZ72.js";import"./chunk-JONZUKWX.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import"./chunk-YNCWSPPJ.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-EZVNGJN5.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";export{getServicesConfigWriteBlocker,isExperimentalServicesEnabled,loadVercelConfig,tryDetectServices,writeServicesConfig};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{editRoute}from"./chunk-AM46JVVN.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,resolveRoute,withGlobalFlags}from"./chunk-EIFBF3JQ.js";import{requireProjectContext}from"./chunk-FXOKM2RM.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-Q7D7RGXM.js";import"./chunk-B3IBBNIR.js";import"./chunk-PSFHYOLD.js";import{disableSubcommand}from"./chunk-5L566FZB.js";import"./chunk-NYJTWSSD.js";import"./chunk-XSQZ35V6.js";import{outputAgentError}from"./chunk-GORL5DZC.js";import"./chunk-OFZUWHZW.js";import"./chunk-BC74BRVP.js";import"./chunk-4HR3I3ML.js";import"./chunk-K46QQRUN.js";import"./chunk-MTZYPCZ7.js";import"./chunk-GPDERS2D.js";import"./chunk-4NTBYNFR.js";import"./chunk-VM6X5BTK.js";import"./chunk-2VBFQZ72.js";import"./chunk-JONZUKWX.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-YNCWSPPJ.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-EZVNGJN5.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function disable(client,argv){let parsed=await parseSubcommandArgs(argv,disableSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args}=parsed,identifier=args[0];if(!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required.",next:[{command:withGlobalFlags(client,"routes disable <name-or-id>"),when:"replace <name-or-id>"},{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes disable <name-or-id>")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project."},1),output_manager_default.error("No routes found in this project."),1;let route=await resolveRoute(client,routes,identifier);if(!route)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;if(route.enabled===!1)return output_manager_default.log(`Route "${route.name}" is already disabled.`),0;let disableStamp=stamp_default();output_manager_default.spinner(`Disabling route "${route.name}"`);try{let{version}=await editRoute(client,project.id,route.id,{route:{name:route.name,description:route.description,enabled:!1,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Disabled")} route "${route.name}" ${import_chalk.default.gray(disableStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"api_error",message:error.message||"Failed to disable route"},1),output_manager_default.error(error.message||"Failed to disable route"),1}}export{disable as default};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{updateRouteVersion}from"./chunk-6QKS6QK7.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{confirmAction,getRoutes,parseSubcommandArgs,printDiffSummary,withGlobalFlags}from"./chunk-EIFBF3JQ.js";import{requireProjectContext}from"./chunk-FXOKM2RM.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-Q7D7RGXM.js";import"./chunk-B3IBBNIR.js";import"./chunk-PSFHYOLD.js";import{discardSubcommand}from"./chunk-5L566FZB.js";import"./chunk-NYJTWSSD.js";import"./chunk-XSQZ35V6.js";import{outputAgentError}from"./chunk-GORL5DZC.js";import"./chunk-OFZUWHZW.js";import"./chunk-BC74BRVP.js";import"./chunk-4HR3I3ML.js";import"./chunk-K46QQRUN.js";import"./chunk-MTZYPCZ7.js";import"./chunk-GPDERS2D.js";import"./chunk-4NTBYNFR.js";import"./chunk-VM6X5BTK.js";import"./chunk-2VBFQZ72.js";import"./chunk-JONZUKWX.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-YNCWSPPJ.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-EZVNGJN5.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function discard(client,argv){let parsed=await parseSubcommandArgs(argv,discardSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0;output_manager_default.spinner(`Fetching route versions for ${import_chalk.default.bold(project.name)}`);let{versions}=await getRouteVersions(client,project.id,{teamId}),stagingVersion=versions.find(v=>v.isStaging);if(!stagingVersion)return output_manager_default.warn(`No staged changes to discard. Make changes first with ${import_chalk.default.cyan(withGlobalFlags(client,"routes add"))}.`),0;output_manager_default.spinner("Fetching staged changes");let{routes:diffRoutes}=await getRoutes(client,project.id,{teamId,versionId:stagingVersion.id,diff:!0}),changedRoutes=diffRoutes.filter(r=>r.action!==void 0);if(changedRoutes.length>0?(output_manager_default.print(`
|
|
8
|
+
${import_chalk.default.bold("Changes to be discarded:")}
|
|
9
|
+
|
|
10
|
+
`),printDiffSummary(changedRoutes),output_manager_default.print(`
|
|
11
|
+
`)):output_manager_default.print(`
|
|
12
|
+
${import_chalk.default.gray("No changes detected in staging version.")}
|
|
13
|
+
|
|
14
|
+
`),!await confirmAction(client,parsed.flags["--yes"],"Discard all staged changes?","This action cannot be undone."))return output_manager_default.log("Canceled"),0;let updateStamp=stamp_default();output_manager_default.spinner("Discarding staged changes");try{return await updateRouteVersion(client,project.id,stagingVersion.id,"discard",{teamId}),output_manager_default.log(`${import_chalk.default.cyan("Success!")} Staged changes discarded ${import_chalk.default.gray(updateStamp())}`),0}catch(e){let msg=e.message||"Failed to discard staged changes";return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"api_error",message:msg,next:[{command:withGlobalFlags(client,"routes discard --yes")}]}),process.exit(1),1):(output_manager_default.error(msg),1)}}export{discard as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{editRoute}from"./chunk-AM46JVVN.js";import{applyFlagMutations,cloneRoute,convertRouteToCurrentRoute,generateRoute,generatedRouteToAddInput,hasAnyTransformFlags,populateRouteEnv,printGeneratedRoutePreview,printRouteConfig,routingRuleToCurrentRoute,runInteractiveEditLoop}from"./chunk-RPIBJRIT.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,resolveRoute,shellQuoteRouteIdentifierForSuggestion,withGlobalFlags}from"./chunk-EIFBF3JQ.js";import{requireProjectContext}from"./chunk-FXOKM2RM.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-Q7D7RGXM.js";import"./chunk-B3IBBNIR.js";import"./chunk-PSFHYOLD.js";import{editSubcommand}from"./chunk-5L566FZB.js";import"./chunk-NYJTWSSD.js";import"./chunk-XSQZ35V6.js";import{outputAgentError}from"./chunk-GORL5DZC.js";import"./chunk-OFZUWHZW.js";import"./chunk-BC74BRVP.js";import"./chunk-4HR3I3ML.js";import"./chunk-K46QQRUN.js";import"./chunk-MTZYPCZ7.js";import"./chunk-GPDERS2D.js";import"./chunk-4NTBYNFR.js";import"./chunk-VM6X5BTK.js";import"./chunk-2VBFQZ72.js";import"./chunk-JONZUKWX.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-YNCWSPPJ.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-EZVNGJN5.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function edit(client,argv){let parsed=await parseSubcommandArgs(argv,editSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args,flags}=parsed,skipConfirmation=flags["--yes"],identifier=args[0],{RoutesEditTelemetryClient}=await import("./routes-NEZJKMR5.js"),telemetry=new RoutesEditTelemetryClient({opts:{store:client.telemetryEventStore}});if(telemetry.trackCliArgumentNameOrId(identifier),telemetry.trackCliFlagYes(skipConfirmation),telemetry.trackCliOptionName(flags["--name"]),telemetry.trackCliOptionDescription(flags["--description"]),telemetry.trackCliOptionSrc(flags["--src"]),telemetry.trackCliOptionSrcSyntax(flags["--src-syntax"]),telemetry.trackCliOptionAction(flags["--action"]),telemetry.trackCliOptionDest(flags["--dest"]),telemetry.trackCliOptionStatus(flags["--status"]),telemetry.trackCliFlagNoDest(flags["--no-dest"]),telemetry.trackCliFlagNoStatus(flags["--no-status"]),telemetry.trackCliFlagClearConditions(flags["--clear-conditions"]),telemetry.trackCliFlagClearHeaders(flags["--clear-headers"]),telemetry.trackCliFlagClearTransforms(flags["--clear-transforms"]),telemetry.trackCliOptionSetResponseHeader(flags["--set-response-header"]),telemetry.trackCliOptionAppendResponseHeader(flags["--append-response-header"]),telemetry.trackCliOptionDeleteResponseHeader(flags["--delete-response-header"]),telemetry.trackCliOptionSetRequestHeader(flags["--set-request-header"]),telemetry.trackCliOptionAppendRequestHeader(flags["--append-request-header"]),telemetry.trackCliOptionDeleteRequestHeader(flags["--delete-request-header"]),telemetry.trackCliOptionSetRequestQuery(flags["--set-request-query"]),telemetry.trackCliOptionAppendRequestQuery(flags["--append-request-query"]),telemetry.trackCliOptionDeleteRequestQuery(flags["--delete-request-query"]),telemetry.trackCliOptionHas(flags["--has"]),telemetry.trackCliOptionMissing(flags["--missing"]),telemetry.trackCliOptionAi(flags["--ai"]),!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required as the first argument after routes update.",next:[{command:withGlobalFlags(client,"routes update <name-or-id>"),when:"replace <name-or-id> with route name or id from routes list"},{command:withGlobalFlags(client,"routes list"),when:"to list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes update <name-or-id>")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project.",next:[{command:withGlobalFlags(client,"routes add --ai <description> --yes"),when:"add a route first (or use full options)"}]},1),output_manager_default.error("No routes found in this project."),1;let originalRoute=await resolveRoute(client,routes,identifier);if(!originalRoute)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"to list routes and pick an exact name or id"},{command:withGlobalFlags(client,"routes update <name-or-id>"),when:"retry with a unique name or id"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;let aiPrompt=flags["--ai"];if(aiPrompt){let usedConflicts=["--name","--description","--src","--src-syntax","--action","--dest","--status","--no-dest","--no-status","--has","--missing","--set-response-header","--append-response-header","--delete-response-header","--set-request-header","--append-request-header","--delete-request-header","--set-request-query","--append-request-query","--delete-request-query","--clear-conditions","--clear-headers","--clear-transforms"].filter(f=>flags[f]!==void 0);return usedConflicts.length>0?(client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:`Cannot use --ai with ${usedConflicts.join(", ")}. Use --ai alone to describe changes.`,next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} --ai <description> --yes`),when:"use only --ai with route id/name already set"}]},2),output_manager_default.error(`Cannot use --ai with ${usedConflicts.join(", ")}. Use --ai alone to describe changes.`),2):await handleAIEdit(client,project.id,teamId,originalRoute,aiPrompt,skipConfirmation,existingStagingVersion)}let route=cloneRoute(originalRoute);if(flags["--name"]!==void 0||flags["--description"]!==void 0||flags["--src"]!==void 0||flags["--src-syntax"]!==void 0||flags["--action"]!==void 0||flags["--dest"]!==void 0||flags["--status"]!==void 0||flags["--no-dest"]!==void 0||flags["--no-status"]!==void 0||flags["--has"]!==void 0||flags["--missing"]!==void 0||flags["--clear-conditions"]!==void 0||flags["--clear-headers"]!==void 0||flags["--clear-transforms"]!==void 0||hasAnyTransformFlags(flags)){let error=applyFlagMutations(route,flags);if(error)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:error,next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} ...`),when:"fix options per message; see routes update --help"}]},2),output_manager_default.error(error),2}else{if(!client.stdin.isTTY||client.nonInteractive)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"No update options provided. In non-interactive mode pass options such as --name, --src, --dest, --action, header options, or --ai <description> --yes.",next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} --dest <dest> --yes`),when:"example: set destination; see routes update --help"}],hint:"Run vercel routes update --help for all options."},2),output_manager_default.error(`No update options provided. When running non-interactively, use options like --name, --dest, --src, etc. Run ${withGlobalFlags(client,"routes update --help")} for all options.`),2;if(output_manager_default.log(`
|
|
8
|
+
Editing route "${originalRoute.name}"`),printRouteConfig(route),await client.input.select({message:"How would you like to update this route?",choices:[{name:"Describe changes (AI-powered)",value:"ai"},{name:"Edit manually (field by field)",value:"manual"}]})==="ai")return telemetry.trackCliOptionAi("interactive"),await handleAIEdit(client,project.id,teamId,originalRoute,void 0,skipConfirmation,existingStagingVersion);await runInteractiveEditLoop(client,route)}if(populateRouteEnv(route.route,route.srcSyntax),JSON.stringify(route)===JSON.stringify(originalRoute))return output_manager_default.log("No changes made."),0;let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${route.name}"`);try{let{version}=await editRoute(client,project.id,originalRoute.id,{route:{name:route.name,description:route.description,enabled:route.enabled,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${route.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}async function handleAIEdit(client,projectId,teamId,originalRoute,aiPrompt,skipConfirmation,existingStagingVersion){let currentRoute=routingRuleToCurrentRoute(originalRoute),prompt=aiPrompt,currentGenerated;for(;;){prompt||(prompt=await client.input.text({message:"Describe what you'd like to change:",validate:val=>val?val.length>2e3?"Description must be 2000 characters or less":!0:"A description is required"})),output_manager_default.spinner("Generating updated route...");let errorMessage;try{let result=await generateRoute(client,projectId,{prompt,currentRoute},{teamId});result.error?errorMessage=result.error:result.route?currentGenerated=result.route:errorMessage="Could not apply changes. Try rephrasing."}catch(e){errorMessage=e.message||"Failed to generate updated route"}if(currentGenerated)break;if(output_manager_default.error(errorMessage),skipConfirmation||!client.stdin.isTTY)return 1;if(await client.input.select({message:"What would you like to do?",choices:[{name:"Try again with a different description",value:"retry"},{name:"Cancel",value:"cancel"}]})==="cancel")return output_manager_default.log("No changes made."),0;prompt=void 0}if(printGeneratedRoutePreview(currentGenerated),skipConfirmation)return await applyAIEdit(client,projectId,teamId,originalRoute,currentGenerated,existingStagingVersion,skipConfirmation);if(!client.stdin.isTTY)return output_manager_default.error(`Cannot interactively confirm route changes in a non-TTY environment. Use ${withGlobalFlags(client,'routes update <name-or-id> --ai "..." --yes')} to skip confirmation.`),1;for(;;){let choice=await client.input.select({message:"What would you like to do?",choices:[{name:"Confirm changes",value:"confirm"},{name:"Edit again with AI",value:"ai-edit"},{name:"Edit manually",value:"manual"},{name:"Discard",value:"discard"}],pageSize:4,loop:!1});if(choice==="confirm")return await applyAIEdit(client,projectId,teamId,originalRoute,currentGenerated,existingStagingVersion,skipConfirmation);if(choice==="ai-edit"){let editPrompt=await client.input.text({message:"Describe what you'd like to change:",validate:val=>val?val.length>2e3?"Description must be 2000 characters or less":!0:"A description is required"});output_manager_default.spinner("Updating route...");try{let editResult=await generateRoute(client,projectId,{prompt:editPrompt,currentRoute:convertRouteToCurrentRoute(currentGenerated)},{teamId});if(editResult.error){output_manager_default.error(editResult.error),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated);continue}if(!editResult.route){output_manager_default.error("Could not apply changes. Try rephrasing."),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated);continue}currentGenerated=editResult.route,printGeneratedRoutePreview(currentGenerated)}catch(e){let error=e;output_manager_default.error(error.message||"Failed to update route"),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated)}continue}if(choice==="manual"){let routeInput=generatedRouteToAddInput(currentGenerated),manualRoute=cloneRoute(originalRoute);manualRoute.name=routeInput.name,manualRoute.description=routeInput.description,manualRoute.srcSyntax=routeInput.srcSyntax,manualRoute.route=routeInput.route,await runInteractiveEditLoop(client,manualRoute),populateRouteEnv(manualRoute.route,manualRoute.srcSyntax);let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${manualRoute.name}"`);try{let{version}=await editRoute(client,projectId,originalRoute.id,{route:{name:manualRoute.name,description:manualRoute.description,enabled:manualRoute.enabled,srcSyntax:manualRoute.srcSyntax,route:manualRoute.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${manualRoute.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,projectId,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}return output_manager_default.log("No changes made."),0}}async function applyAIEdit(client,projectId,teamId,originalRoute,generated,existingStagingVersion,skipConfirmation){let routeInput=generatedRouteToAddInput(generated);populateRouteEnv(routeInput.route,routeInput.srcSyntax);let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${routeInput.name}"`);try{let{version}=await editRoute(client,projectId,originalRoute.id,{route:{name:routeInput.name,description:routeInput.description,enabled:originalRoute.enabled,srcSyntax:routeInput.srcSyntax,route:routeInput.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${routeInput.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,projectId,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}export{edit as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{resolveMessageContent}from"./chunk-2CZL3GJU.js";import{parseThreadArg}from"./chunk-2S6PE6GB.js";import{handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts,updateMessage}from"./chunk-23PO6JK6.js";import{outputError}from"./chunk-7PGDJTAH.js";import"./chunk-D3M2JG5C.js";import"./chunk-B3IBBNIR.js";import"./chunk-PSFHYOLD.js";import"./chunk-IQ7FPAI4.js";import{editSubcommand}from"./chunk-E7CEQ2PO.js";import"./chunk-NYJTWSSD.js";import"./chunk-XSQZ35V6.js";import"./chunk-GORL5DZC.js";import"./chunk-OFZUWHZW.js";import"./chunk-BC74BRVP.js";import"./chunk-4HR3I3ML.js";import"./chunk-K46QQRUN.js";import"./chunk-MTZYPCZ7.js";import"./chunk-GPDERS2D.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-VM6X5BTK.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-JONZUKWX.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-YNCWSPPJ.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-EZVNGJN5.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function edit(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(editSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"update")}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput;telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliOptionMessage(parsedArgs.flags["--message"]),telemetry.trackCliOptionFile(parsedArgs.flags["--file"]);let[threadInput,messageId]=parsedArgs.args.slice(2);if(telemetry.trackCliArgumentThread(threadInput),telemetry.trackCliArgumentMessageId(messageId),!threadInput||!messageId)return outputError(client,jsonOutput,"MISSING_ARGUMENT","Usage: `vercel comments update <thread> <message-id> --message <text>` \u2014 message IDs are shown in `vercel comments inspect`.");let threadRef=parseThreadArg(threadInput);if(!threadRef)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}".`);let threadId=threadRef.id,content=await resolveMessageContent(client,{message:parsedArgs.flags["--message"],file:parsedArgs.flags["--file"]},jsonOutput);if(typeof content=="number")return content;if(content===void 0)return outputError(client,jsonOutput,"MISSING_CONTENT","Pass the new content with --message <text> or --file <path>.");telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);let scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug:threadRef.teamSlug});if(typeof scope=="number")return scope;try{let message=await updateMessage(client,scope.teamId,threadId,messageId,{markdown:content});return jsonOutput?(client.stdout.write(`${JSON.stringify(message,null,2)}
|
|
8
|
+
`),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} Updated message ${messageId}
|
|
9
|
+
`),0)}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err);return outputError(client,jsonOutput,code,err.status===404?threadNotFoundMessage(threadId,scope):message)}throw err}}export{edit as default};
|